azure-maps-control 3.0.0-preview.2 → 3.0.0-preview.4

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.
@@ -52,4 +52,4 @@ Elle s’applique également, même si Microsoft connaissait ou devrait connaît
52
52
  EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous pourriez avoir d’autres droits prévus par les lois de votre pays. Le présent contrat ne modifie pas les droits que vous confèrent les lois de votre pays si celles-ci ne le permettent pas.
53
53
  */
54
54
 
55
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("azuremaps-maplibre-gl")):"function"==typeof define&&define.amd?define(["exports","azuremaps-maplibre-gl"],e):e((t=t||self).atlas=t.atlas||{},t.maplibregl)}(this,function(u,p){"use strict";p=p&&Object.prototype.hasOwnProperty.call(p,"default")?p.default:p;var t="atlas.microsoft.com",e="atlas.microsoft.com",o="styling",n="2022-08-05",r="https://login.microsoftonline.com/",l="api-version",i="Authorization",s="Bearer ",a="jwt-sas ",c="{{azMapsDomain}}",h="{azMapsDomain}",d="{{azMapsView}}",f="view",y="{{azMapsLanguage}}",m="{{azMapsStylingPath}}",g="{{azMapsStylePath}}",v="styling",_="styles",w="2.0",b="Map-Agent",S="x-ms-client-id",x="Ms-Am-Request-Origin",O="MapControl",T="https://atlas.microsoft.com/",E="Session-Id",C=window&&window.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,o=e&&t[e],n=0;if(o)return o.call(t);if(t&&"number"==typeof t.length)return{next:function(){return{value:(t=t&&n>=t.length?void 0:t)&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},P=(k.prototype.merge=function(){for(var e,t,o,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];try{for(var i=C(n),s=i.next();!s.done;s=i.next()){var a=s.value;if(a)for(var l in a)a.hasOwnProperty(l)&&this.hasOwnProperty(l)&&(void 0!==a[l]&&null!=a[l]?this[l]instanceof k?this[l].merge(a[l]):this[l]=a[l]:(o=o||new(Object.getPrototypeOf(this).constructor),this[l]=o[l]))}}catch(t){e={error:t}}finally{try{s&&!s.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}return this},k);function k(){}var A,L,I=window&&window.__extends||(A=function(t,e){return(A=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}A(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),R=window&&window.__read||function(t,e){var o="function"==typeof Symbol&&t[Symbol.iterator];if(!o)return t;var n,r,i=o.call(t),s=[];try{for(;(void 0===e||0<e--)&&!(n=i.next()).done;)s.push(n.value)}catch(t){r={error:t}}finally{try{n&&!n.done&&(o=i.return)&&o.call(i)}finally{if(r)throw r.error}}return s},N=(I(M,L=P),M);function M(){var t=null!==L&&L.apply(this,arguments)||this;return t.domain=void 0,t.headers={},t.path="",t.protocol="https",t.queryParams={},t.subdomain="",t}var j=(D.prototype.get=function(){return fetch(this.toString(),{method:"GET",mode:"cors",headers:new Headers(this.options.headers)}).then(function(t){if(t.ok)return t.json();throw new Error("HTTP "+t.status+": "+t.statusText)})},D.prototype.toString=function(){var t=this,e=Object.entries(t.options.queryParams).map(function(t){t=R(t,2);return t[0]+"="+t[1]}).join("&"),o=[],n=t.options.path||"";return D.protoRegEx.test(n)?o.push(n):(t.options.domain&&(D.protoRegEx.test(t.options.domain)||(o.push(t.options.protocol+"://"),o.push(t.options.subdomain?t.options.subdomain+".":"")),o.push(t.options.domain)),o.push(t.options.path?"/"+n:"")),o.push(e?"?"+e:""),o.join("")},D.protoRegEx=new RegExp(/^(((file|http|https):\/\/)|blob:)/i),D);function D(t){this.options=(new N).merge(t)}var z="3.0.0-preview.2",B=(F.getFullVersion=function(){return z},F.getEndpointVersion=function(){var t=z.indexOf(".");return-1===(t=z.indexOf(".",t+1))?z:z.substring(0,t)},F);function F(){}function U(t){var e=document.createElement("span");e.innerText=t,e.classList.add("tooltiptext"),window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches&&e.classList.add("dark");var o=window.matchMedia("(prefers-color-scheme: dark)"),t=function(t){t=t.matches;t&&!e.classList.contains("dark")?e.classList.add("dark"):!t&&e.classList.contains("dark")&&e.classList.remove("dark")};return"function"==typeof o.addEventListener?o.addEventListener("change",t):"function"==typeof o.addListener&&o.addListener(t),-1!=navigator.userAgent.indexOf("Edg")?e.classList.add("edge"):-1!=navigator.userAgent.indexOf("Chrome")?e.classList.add("chrome"):-1!=navigator.userAgent.indexOf("Safari")?e.classList.add("safari"):-1!=navigator.userAgent.indexOf("Firefox")&&e.classList.add("firefox"),-1!=navigator.userAgent.indexOf("Windows")?e.classList.add("win"):-1!=navigator.userAgent.indexOf("Macintosh")&&e.classList.add("mac"),e}function q(r,i,s){function t(t){var e=i.getBoundingClientRect(),o=r.getBoundingClientRect(),n=e.x+o.width>window.innerWidth?window.innerWidth-o.width:e.x,o=e.y+e.height+o.height+4>window.innerHeight?e.y-o.height-4:e.y+e.height+4;s&&i.parentElement&&(e=i.parentElement?i.parentElement.getBoundingClientRect():null,r.style.position="absolute",n-=e.x,o-=e.y),r.style.transform="translate("+n+"px, "+o+"px)"}void 0===s&&(s=!1),i.addEventListener("mouseover",t),i.addEventListener("focusin",t)}var G,Z=window&&window.__extends||(G=function(t,e){return(G=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}G(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)});(Lt=u.ControlPosition||(u.ControlPosition={})).TopLeft="top-left",Lt.TopRight="top-right",Lt.BottomLeft="bottom-left",Lt.BottomRight="bottom-right",Lt.NonFixed="non-fixed";var H,K=(Z(W,H=P),W);function W(){var t=null!==H&&H.apply(this,arguments)||this;return t.position=u.ControlPosition.NonFixed,t}var V=(Y.prototype.getLuminosity=function(){for(var t=[this.r,this.g,this.b],e=[],o=0;o<t.length;o++){var n=t[o]/255;e[o]=n<=.03928?n/12.92:Math.pow((.055+n)/1.055,2.4)}return.2126*e[0]+.7152*e[1]+.0722*e[2]},Y.prototype.getRBGA=function(t){var e=document.createElement("canvas").getContext("2d");e.globalAlpha=1,e.fillStyle=t,e.fillRect(0,0,1,1);e=e.getImageData(0,0,1,1).data;return[e[0],e[1],e[2],e[3]]},Y);function Y(t){var e;t&&(e=void 0,3<=(e="string"==typeof t?this.getRBGA(t):t).length&&(this.r=e[0],this.g=e[1],this.b=e[2],3<e.length&&(this.a=e[3])))}(Nt=u.ControlStyle||(u.ControlStyle={})).light="light",Nt.dark="dark",Nt.auto="auto";var Q=Map,J=(X.prototype._addEventListener=function(t,e,o){this.listeners.has(t)||this.listeners.set(t,new Q),this.listeners.get(t).set(e,o)},X.prototype._removeEventListener=function(t,e){this.listeners.has(t)&&this.listeners.get(t).delete(e)},X.prototype._invokeEvent=function(o,n){var r=this;this.listeners.has(o)&&this.listeners.get(o).forEach(function(t,e){t&&r._removeEventListener(o,e);try{e(n)}catch(t){console.error(t)}})},X);function X(){this.listeners=new Q}var $,tt,et=Object.freeze({__proto__:null,EventEmitter:J}),ot=((window&&window.__extends||($=function(t,e){return($=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}$(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(nt,tt=J),nt.prototype.onRemove=function(){this._container&&(this._container.remove(),delete this._container),this._map&&(this._map.events.remove("stylechanged",this._onStyleChange),delete this._map),this._observer&&(this._observer.disconnect(),delete this._observer),delete this._theme},nt.prototype.buildContainer=function(t,e,o,n){var r=this;return this._map=t,this._container=document.createElement(n||"div"),this._container.classList.add("azure-maps-control-container"),"string"==typeof o&&this._container.setAttribute("aria-label",o),e.toLowerCase()===u.ControlStyle.auto?this._map.styles.definitions().then(function(t){r._map&&r._map.events.add("stylechanged",r._onStyleChange)}):this._container.classList.add(e),this._container},nt.prototype._setTheme=function(t){this._theme!==t&&(this._container.classList.remove(this._theme),this._container.classList.add(t),this._theme=t)},nt.activateClickDelay=100,nt);function nt(){var e=null!==tt&&tt.apply(this,arguments)||this;return e._onStyleChange=function(){e._map.getStyle().style.toLowerCase().startsWith("blank")?e._observer||(e._onBackgroundChange(),e._observer=new MutationObserver(e._onBackgroundChange),e._observer.observe(e._map.getMapContainer(),{attributes:!0,attributeFilter:["style"]})):(e._observer&&(e._observer.disconnect(),delete e._observer),e._map.styles.getThemeAsync(e._map.getStyle()).then(function(t){e._setTheme(t)}))},e._onBackgroundChange=function(){var t=new V(e._map.getMapContainer().style.backgroundColor).getLuminosity(),t=isNaN(t)||.5<t?u.ControlStyle.light:u.ControlStyle.dark;e._setTheme(t)},e}var rt,it,st=((window&&window.__extends||(rt=function(t,e){return(rt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}rt(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(at,it=P),at);function at(){var t=null!==it&&it.apply(this,arguments)||this;return t.rotationDegreesDelta=15,t.style=u.ControlStyle.light,t.inverted=!1,t}var lt,ct,ut=((window&&window.__extends||(lt=function(t,e){return(lt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}lt(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(pt,ct=ot),pt.prototype.onAdd=function(t,e){var o=this,n=this.buildContainer(t,this.options.style,"Rotation Control"),r=this.constructRotationButton(t),i=this.constructRotationGrid(t,e),t=U("Reset to Default Rotation");return n.addEventListener("mouseover",function(t){o.lastActiveTime=o.lastActiveTime||t.timeStamp,o.hasMouse=!0,n.classList.add("in-use"),i.classList.remove("hidden-accessible-element")}),n.addEventListener("focusin",function(t){o.lastActiveTime=o.lastActiveTime||t.timeStamp,o.hasFocus=!0,n.classList.add("in-use"),i.classList.remove("hidden-accessible-element")}),n.addEventListener("mouseleave",function(){o.hasMouse=!1,o.hasFocus||(delete o.lastActiveTime,n.classList.remove("in-use"),i.classList.add("hidden-accessible-element"))}),n.addEventListener("focusout",function(t){t.relatedTarget instanceof Node&&n.contains(t.relatedTarget)||(o.hasFocus=!1,o.hasMouse||(delete o.lastActiveTime,n.classList.remove("in-use"),i.classList.add("hidden-accessible-element")))}),i.addEventListener("keydown",function(t){"Escape"!==t.key&&"Esc"!==t.key||(t.stopPropagation(),r.focus(),n.classList.remove("in-use"),i.classList.add("hidden-accessible-element"))}),e&&pt.InvertOrderPositions.includes(e.position)?(n.appendChild(i),n.appendChild(r),n.appendChild(t),q(t,r)):(n.appendChild(r),n.appendChild(t),q(t,r),n.appendChild(i)),n},pt.prototype.constructRotationGrid=function(t,e){var o=document.createElement("div");o.classList.add("sub-container"),o.classList.add("hidden-accessible-element");var n=this.constructRightRotationButton(t),r=this.constructLeftRotationButton(t),i=U("Rotate Left"),t=U("Rotate Right");return e&&pt.InvertOrderPositions.includes(e.position)?(o.appendChild(n),o.appendChild(t),q(t,n),o.appendChild(r),o.appendChild(i),q(i,r)):(o.appendChild(r),o.appendChild(i),q(i,r),o.appendChild(n),o.appendChild(t),q(t,n)),o},pt.prototype.constructRotationButton=function(e){var o=this,t=document.createElement("button");t.classList.add("azure-maps-control-button"),t.classList.add("rotation"),t.setAttribute("aria-label","Reset to Default Rotation"),t.setAttribute("alt","Reset to Default Rotation"),t.setAttribute("type","button");var n=document.createElement("div");return t.appendChild(n),t.addEventListener("click",function(t){t.timeStamp-o.lastActiveTime>ot.activateClickDelay&&e.setCamera({bearing:pt.DefaultRotation},!0)}),e.events.add("rotate",function(t){n.style.transform="rotate("+-t.map.getCamera().bearing+"deg)"}),t},pt.prototype.constructRightRotationButton=function(t){var e=this,o=document.createElement("button");return o.classList.add("azure-maps-control-button"),o.classList.add("rotation-right"),o.setAttribute("aria-label","Rotate Right"),o.setAttribute("alt","Rotate Right"),o.setAttribute("type","button"),o.addEventListener("click",function(){t.setCamera({bearing:t.getCamera().bearing-(e.options.inverted?-1:1)*e.options.rotationDegreesDelta,duration:pt.RotationDuration,type:"ease"},!0)}),o},pt.prototype.constructLeftRotationButton=function(t){var e=this,o=document.createElement("button");return o.classList.add("azure-maps-control-button"),o.classList.add("rotation-left"),o.setAttribute("aria-label","Rotate Left"),o.setAttribute("alt","Rotate Left"),o.setAttribute("type","button"),o.addEventListener("click",function(){t.setCamera({bearing:t.getCamera().bearing+(e.options.inverted?-1:1)*e.options.rotationDegreesDelta,duration:pt.RotationDuration,type:"ease"},!0)}),o},pt.DefaultRotation=0,pt.RotationDuration=100,pt.InvertOrderPositions=[u.ControlPosition.BottomRight,u.ControlPosition.TopRight],pt);function pt(t){var e=ct.call(this)||this;return e.hasMouse=!1,e.hasFocus=!1,e.options=(new st).merge(t),e}var ht,dt,ft=((window&&window.__extends||(ht=function(t,e){return(ht=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}ht(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(yt,dt=P),yt);function yt(){var t=null!==dt&&dt.apply(this,arguments)||this;return t.pitchDegreesDelta=10,t.style=u.ControlStyle.light,t.inverted=!1,t}var mt,gt,vt=((window&&window.__extends||(mt=function(t,e){return(mt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}mt(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(_t,gt=ot),_t.prototype.onAdd=function(t,e){var o=this,n=this.buildContainer(t,this.options.style,"Pitch Control"),r=this.constructPitchButton(t),i=this.constructPitchGrid(t,e),s=U("Reset to Default Pitch");return n.addEventListener("mouseover",function(t){o.lastActiveTime=o.lastActiveTime||t.timeStamp,o.hasMouse=!0,n.classList.add("in-use"),i.classList.remove("hidden-accessible-element")}),n.addEventListener("focusin",function(t){o.lastActiveTime=o.lastActiveTime||t.timeStamp,o.hasFocus=!0,n.classList.add("in-use"),i.classList.remove("hidden-accessible-element")}),n.addEventListener("mouseleave",function(){o.hasMouse=!1,o.hasFocus||(delete o.lastActiveTime,n.classList.remove("in-use"),i.classList.add("hidden-accessible-element"))}),n.addEventListener("focusout",function(t){t.relatedTarget instanceof Node&&n.contains(t.relatedTarget)||(o.hasFocus=!1,o.hasMouse||(delete o.lastActiveTime,n.classList.remove("in-use"),i.classList.add("hidden-accessible-element")))}),i.addEventListener("keydown",function(t){"Escape"!==t.key&&"Esc"!==t.key||(t.stopPropagation(),r.focus(),n.classList.remove("in-use"),i.classList.add("hidden-accessible-element"))}),e&&_t.INVERT_ORDER_POSITIONS.includes(e.position)?(n.appendChild(i),n.appendChild(r),n.appendChild(s),q(s,n)):(n.appendChild(r),n.appendChild(s),q(s,n),n.appendChild(i)),this.map=t,this.container=n,this.pitchButton=r,t.events.add("pitch",this.pitchChanged),this.updatePitchButtonsState(),n},_t.prototype.onRemove=function(){this.container&&(this.container.remove(),this.container=null,this.pitchButton=null,this.pitchIncrementButton=null,this.pitchDecrementButton=null),this.map&&(this.map.events.remove("pitch",this.pitchChanged),this.map=null)},_t.prototype.constructPitchGrid=function(t,e){var o=document.createElement("div");o.classList.add("sub-container"),o.classList.add("hidden-accessible-element"),this.pitchIncrementButton=this.constructPitchIncrementButton(t),this.pitchDecrementButton=this.constructPitchDecrementButton(t);var n=U("Increase Pitch"),t=U("Decrease Pitch");return e&&_t.INVERT_ORDER_POSITIONS.includes(e.position)?(o.appendChild(this.pitchDecrementButton),o.appendChild(t),q(t,this.pitchDecrementButton),o.appendChild(this.pitchIncrementButton),o.appendChild(n),q(n,this.pitchIncrementButton)):(o.appendChild(this.pitchIncrementButton),o.appendChild(n),q(n,this.pitchIncrementButton),o.appendChild(this.pitchDecrementButton),o.appendChild(t),q(t,this.pitchDecrementButton)),o},_t.prototype.constructPitchButton=function(t){var e=this,o=document.createElement("button");return o.classList.add("azure-maps-control-button"),o.classList.add("pitch"),o.setAttribute("aria-label","Reset to Default Pitch"),o.setAttribute("alt","Reset to Default Pitch"),o.setAttribute("type","button"),o.addEventListener("click",function(){event.timeStamp-e.lastActiveTime>ot.activateClickDelay&&t.setCamera({pitch:_t.DEFAULT_PITCH},!0)}),o},_t.prototype.constructPitchDecrementButton=function(t){var e=this,o=document.createElement("button");return o.classList.add("azure-maps-control-button"),o.classList.add("pitch-down"),o.setAttribute("aria-label","Decrease Pitch"),o.setAttribute("alt","Decrease Pitch"),o.setAttribute("type","button"),o.addEventListener("click",function(){t.setCamera({pitch:t.getCamera().pitch-(e.options.inverted?-1:1)*e.options.pitchDegreesDelta,duration:_t.PITCH_DURATION_MS,type:"ease"},!0)}),o},_t.prototype.constructPitchIncrementButton=function(t){var e=this,o=document.createElement("button");return o.classList.add("azure-maps-control-button"),o.classList.add("pitch-up"),o.setAttribute("aria-label","Increase Pitch"),o.setAttribute("alt","Increase Pitch"),o.setAttribute("type","button"),o.addEventListener("click",function(){t.setCamera({pitch:t.getCamera().pitch+(e.options.inverted?-1:1)*e.options.pitchDegreesDelta,duration:_t.PITCH_DURATION_MS,type:"ease"},!0)}),o},_t.PITCH_DURATION_MS=100,_t.DEFAULT_PITCH=0,_t.INVERT_ORDER_POSITIONS=[u.ControlPosition.BottomRight,u.ControlPosition.TopRight],_t);function _t(t){var o=gt.call(this)||this;return o.container=null,o.map=null,o.pitchButton=null,o.pitchIncrementButton=null,o.pitchDecrementButton=null,o.hasMouse=!1,o.hasFocus=!1,o.pitchChanged=function(t){return o.updatePitchButtonsState()},o.updatePitchButtonsState=function(){var t=o.map.getCamera().pitch<=0,e=60<=o.map.getCamera().pitch;o.hasFocus&&o.pitchButton&&(t||e)&&o.pitchButton.focus(),o.options.inverted?(o.pitchIncrementButton&&o.pitchIncrementButton.disabled!=t&&(o.pitchIncrementButton.disabled=t),o.pitchDecrementButton&&o.pitchDecrementButton.disabled!=e&&(o.pitchDecrementButton.disabled=e)):(o.pitchIncrementButton&&o.pitchIncrementButton.disabled!=e&&(o.pitchIncrementButton.disabled=e),o.pitchDecrementButton&&o.pitchDecrementButton.disabled!=t&&(o.pitchDecrementButton.disabled=t))},o.options=(new ft).merge(t),o}var wt=function(t,e){return t===e||t!=t&&e!=e};var bt=function(t,e){for(var o=t.length;o--;)if(wt(t[o][0],e))return o;return-1},St=Array.prototype.splice;var xt=function(t){var e=this.__data__;return!((t=bt(e,t))<0)&&(t==e.length-1?e.pop():St.call(e,t,1),--this.size,!0)};var Ot=function(t){var e=this.__data__;return(t=bt(e,t))<0?void 0:e[t][1]};var Tt=function(t){return-1<bt(this.__data__,t)};var Et=function(t,e){var o=this.__data__,n=bt(o,t);return n<0?(++this.size,o.push([t,e])):o[n][1]=e,this};function Ct(t){var e=-1,o=null==t?0:t.length;for(this.clear();++e<o;){var n=t[e];this.set(n[0],n[1])}}Ct.prototype.clear=function(){this.__data__=[],this.size=0},Ct.prototype.delete=xt,Ct.prototype.get=Ot,Ct.prototype.has=Tt,Ct.prototype.set=Et;var Pt=Ct;var kt=function(){this.__data__=new Pt,this.size=0};var At=function(t){var e=this.__data__,t=e.delete(t);return this.size=e.size,t};I=function(t){return this.__data__.get(t)};var Lt=function(t){return this.__data__.has(t)},Z="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function It(t,e){return t(e={exports:{}},e.exports),e.exports}var Rt="object"==typeof Z&&Z&&Z.Object===Object&&Z,Nt="object"==typeof self&&self&&self.Object===Object&&self,Mt=Rt||Nt||Function("return this")(),xt=Mt.Symbol,Ot=Object.prototype,jt=Ot.hasOwnProperty,Dt=Ot.toString,zt=xt?xt.toStringTag:void 0;var Bt=function(t){var e=jt.call(t,zt),o=t[zt];try{var n=!(t[zt]=void 0)}catch(t){}var r=Dt.call(t);return n&&(e?t[zt]=o:delete t[zt]),r},Ft=Object.prototype.toString;var Ut=function(t){return Ft.call(t)},qt=xt?xt.toStringTag:void 0;var Gt=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":(qt&&qt in Object(t)?Bt:Ut)(t)};var Zt=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)};var Ht=function(t){return!!Zt(t)&&("[object Function]"==(t=Gt(t))||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t)},Tt=Mt["__core-js_shared__"],Kt=(Et=/[^.]+$/.exec(Tt&&Tt.keys&&Tt.keys.IE_PROTO||""))?"Symbol(src)_1."+Et:"";var Wt=function(t){return!!Kt&&Kt in t},Vt=Function.prototype.toString;var Yt=function(t){if(null!=t){try{return Vt.call(t)}catch(t){}try{return t+""}catch(t){}}return""},Qt=/^\[object .+?Constructor\]$/,Z=Function.prototype,Nt=Object.prototype,Ot=Z.toString,Tt=Nt.hasOwnProperty,Jt=RegExp("^"+Ot.call(Tt).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var Xt=function(t){return!(!Zt(t)||Wt(t))&&(Ht(t)?Jt:Qt).test(Yt(t))};var $t=function(t,e){return null==t?void 0:t[e]};var te=function(t,e){return e=$t(t,e),Xt(e)?e:void 0},ee=te(Mt,"Map"),oe=te(Object,"create");var Et=function(t){return t=this.has(t)&&delete this.__data__[t],this.size-=t?1:0,t},ne=Object.prototype.hasOwnProperty;var Z=function(t){var e=this.__data__;if(oe){var o=e[t];return"__lodash_hash_undefined__"===o?void 0:o}return ne.call(e,t)?e[t]:void 0},re=Object.prototype.hasOwnProperty;Nt=function(t){var e=this.__data__;return oe?void 0!==e[t]:re.call(e,t)};Ot=function(t,e){var o=this.__data__;return this.size+=this.has(t)?0:1,o[t]=oe&&void 0===e?"__lodash_hash_undefined__":e,this};function ie(t){var e=-1,o=null==t?0:t.length;for(this.clear();++e<o;){var n=t[e];this.set(n[0],n[1])}}ie.prototype.clear=function(){this.__data__=oe?oe(null):{},this.size=0},ie.prototype.delete=Et,ie.prototype.get=Z,ie.prototype.has=Nt,ie.prototype.set=Ot;var se=ie;Tt=function(){this.size=0,this.__data__={hash:new se,map:new(ee||Pt),string:new se}};var ae=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t};var le=function(t,e){return t=t.__data__,ae(e)?t["string"==typeof e?"string":"hash"]:t.map};Et=function(t){return t=le(this,t).delete(t),this.size-=t?1:0,t};Z=function(t){return le(this,t).get(t)};Nt=function(t){return le(this,t).has(t)};Ot=function(t,e){var o=le(this,t),n=o.size;return o.set(t,e),this.size+=o.size==n?0:1,this};function ce(t){var e=-1,o=null==t?0:t.length;for(this.clear();++e<o;){var n=t[e];this.set(n[0],n[1])}}ce.prototype.clear=Tt,ce.prototype.delete=Et,ce.prototype.get=Z,ce.prototype.has=Nt,ce.prototype.set=Ot;var ue=ce;Et=function(t,e){var o=this.__data__;if(o instanceof Pt){var n=o.__data__;if(!ee||n.length<199)return n.push([t,e]),this.size=++o.size,this;o=this.__data__=new ue(n)}return o.set(t,e),this.size=o.size,this};function pe(t){t=this.__data__=new Pt(t);this.size=t.size}pe.prototype.clear=kt,pe.prototype.delete=At,pe.prototype.get=I,pe.prototype.has=Lt,pe.prototype.set=Et;var he=pe;var de=function(t,e){for(var o=-1,n=null==t?0:t.length;++o<n&&!1!==e(t[o],o,t););return t},fe=function(){try{var t=te(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();var ye=function(t,e,o){"__proto__"==e&&fe?fe(t,e,{configurable:!0,enumerable:!0,value:o,writable:!0}):t[e]=o},me=Object.prototype.hasOwnProperty;var ge=function(t,e,o){var n=t[e];me.call(t,e)&&wt(n,o)&&(void 0!==o||e in t)||ye(t,e,o)};var ve=function(t,e,o,n){var r=!o;o=o||{};for(var i=-1,s=e.length;++i<s;){var a=e[i],l=n?n(o[a],t[a],a,o,t):void 0;void 0===l&&(l=t[a]),(r?ye:ge)(o,a,l)}return o};var _e=function(t,e){for(var o=-1,n=Array(t);++o<t;)n[o]=e(o);return n};var we=function(t){return null!=t&&"object"==typeof t};var Z=function(t){return we(t)&&"[object Arguments]"==Gt(t)},Nt=Object.prototype,be=Nt.hasOwnProperty,Se=Nt.propertyIsEnumerable,xe=Z(function(){return arguments}())?Z:function(t){return we(t)&&be.call(t,"callee")&&!Se.call(t,"callee")},Oe=Array.isArray;function Te(){return!1}var Ee=It(function(t,e){var o=e&&!e.nodeType&&e,e=o&&t&&!t.nodeType&&t,o=e&&e.exports===o?Mt.Buffer:void 0,o=o?o.isBuffer:void 0;t.exports=o||Te}),Ce=/^(?:0|[1-9]\d*)$/;var Pe=function(t,e){var o=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==o||"symbol"!=o&&Ce.test(t))&&-1<t&&t%1==0&&t<e};var ke=function(t){return"number"==typeof t&&-1<t&&t%1==0&&t<=9007199254740991},Ae={};Ae["[object Float32Array]"]=Ae["[object Float64Array]"]=Ae["[object Int8Array]"]=Ae["[object Int16Array]"]=Ae["[object Int32Array]"]=Ae["[object Uint8Array]"]=Ae["[object Uint8ClampedArray]"]=Ae["[object Uint16Array]"]=Ae["[object Uint32Array]"]=!0,Ae["[object Arguments]"]=Ae["[object Array]"]=Ae["[object ArrayBuffer]"]=Ae["[object Boolean]"]=Ae["[object DataView]"]=Ae["[object Date]"]=Ae["[object Error]"]=Ae["[object Function]"]=Ae["[object Map]"]=Ae["[object Number]"]=Ae["[object Object]"]=Ae["[object RegExp]"]=Ae["[object Set]"]=Ae["[object String]"]=Ae["[object WeakMap]"]=!1;Ot=function(t){return we(t)&&ke(t.length)&&!!Ae[Gt(t)]};var kt=function(e){return function(t){return e(t)}},At=It(function(t,e){var e=e&&!e.nodeType&&e,o=e&&t&&!t.nodeType&&t,n=o&&o.exports===e&&Rt.process,e=function(){try{var t=o&&o.require&&o.require("util").types;return t?t:n&&n.binding&&n.binding("util")}catch(t){}}();t.exports=e}),I=At&&At.isTypedArray,Le=I?kt(I):Ot,Ie=Object.prototype.hasOwnProperty;var Re=function(t,e){var o,n=Oe(t),r=!n&&xe(t),i=!n&&!r&&Ee(t),s=!n&&!r&&!i&&Le(t),a=n||r||i||s,l=a?_e(t.length,String):[],c=l.length;for(o in t)!e&&!Ie.call(t,o)||a&&("length"==o||i&&("offset"==o||"parent"==o)||s&&("buffer"==o||"byteLength"==o||"byteOffset"==o)||Pe(o,c))||l.push(o);return l},Ne=Object.prototype;var Me=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Ne)};var Lt=function(e,o){return function(t){return e(o(t))}},je=Lt(Object.keys,Object),De=Object.prototype.hasOwnProperty;var ze=function(t){if(!Me(t))return je(t);var e,o=[];for(e in Object(t))De.call(t,e)&&"constructor"!=e&&o.push(e);return o};var Be=function(t){return null!=t&&ke(t.length)&&!Ht(t)};var Fe=function(t){return(Be(t)?Re:ze)(t)};var Ue=function(t,e){return t&&ve(e,Fe(e),t)};var qe=function(t){var e=[];if(null!=t)for(var o in Object(t))e.push(o);return e},Ge=Object.prototype.hasOwnProperty;var Ze=function(t){if(!Zt(t))return qe(t);var e,o=Me(t),n=[];for(e in t)("constructor"!=e||!o&&Ge.call(t,e))&&n.push(e);return n};var He=function(t){return Be(t)?Re(t,!0):Ze(t)};var Ke=function(t,e){return t&&ve(e,He(e),t)},We=It(function(t,e){var o=e&&!e.nodeType&&e,e=o&&t&&!t.nodeType&&t,o=e&&e.exports===o?Mt.Buffer:void 0,n=o?o.allocUnsafe:void 0;t.exports=function(t,e){return e?t.slice():(e=t.length,e=n?n(e):new t.constructor(e),t.copy(e),e)}});var Ve=function(t,e){var o=-1,n=t.length;for(e=e||Array(n);++o<n;)e[o]=t[o];return e};var Ye=function(t,e){for(var o=-1,n=null==t?0:t.length,r=0,i=[];++o<n;){var s=t[o];e(s,o,t)&&(i[r++]=s)}return i};var Et=function(){return[]},Qe=Object.prototype.propertyIsEnumerable,Je=Object.getOwnPropertySymbols,Xe=Je?function(e){return null==e?[]:(e=Object(e),Ye(Je(e),function(t){return Qe.call(e,t)}))}:Et;var $e=function(t,e){return ve(t,Xe(t),e)};var to=function(t,e){for(var o=-1,n=e.length,r=t.length;++o<n;)t[r+o]=e[o];return t},eo=Lt(Object.getPrototypeOf,Object),oo=Object.getOwnPropertySymbols?function(t){for(var e=[];t;)to(e,Xe(t)),t=eo(t);return e}:Et;var no=function(t,e){return ve(t,oo(t),e)};var ro=function(t,e,o){return e=e(t),Oe(t)?e:to(e,o(t))};var io=function(t){return ro(t,Fe,Xe)};function so(t){return ro(t,He,oo)}var Nt=te(Mt,"DataView"),Z=te(Mt,"Promise"),I=te(Mt,"Set"),Ot=te(Mt,"WeakMap"),ao="[object Map]",lo="[object Promise]",co="[object Set]",uo="[object WeakMap]",po="[object DataView]",ho=Yt(Nt),fo=Yt(ee),yo=Yt(Z),mo=Yt(I),go=Yt(Ot),Lt=Gt,vo=Lt=Nt&&Lt(new Nt(new ArrayBuffer(1)))!=po||ee&&Lt(new ee)!=ao||Z&&Lt(Z.resolve())!=lo||I&&Lt(new I)!=co||Ot&&Lt(new Ot)!=uo?function(t){var e=Gt(t),t="[object Object]"==e?t.constructor:void 0,t=t?Yt(t):"";if(t)switch(t){case ho:return po;case fo:return ao;case yo:return lo;case mo:return co;case go:return uo}return e}:Lt,_o=Object.prototype.hasOwnProperty;var wo=function(t){var e=t.length,o=new t.constructor(e);return e&&"string"==typeof t[0]&&_o.call(t,"index")&&(o.index=t.index,o.input=t.input),o},bo=Mt.Uint8Array;var So=function(t){var e=new t.constructor(t.byteLength);return new bo(e).set(new bo(t)),e};var xo=function(t,e){return e=e?So(t.buffer):t.buffer,new t.constructor(e,t.byteOffset,t.byteLength)},Oo=/\w*$/;var To=function(t){var e=new t.constructor(t.source,Oo.exec(t));return e.lastIndex=t.lastIndex,e},Et=xt?xt.prototype:void 0,Eo=Et?Et.valueOf:void 0;var Co=function(t){return Eo?Object(Eo.call(t)):{}};var Po=function(t,e){return e=e?So(t.buffer):t.buffer,new t.constructor(e,t.byteOffset,t.length)};var ko=function(t,e,o){var n=t.constructor;switch(e){case"[object ArrayBuffer]":return So(t);case"[object Boolean]":case"[object Date]":return new n(+t);case"[object DataView]":return xo(t,o);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 Po(t,o);case"[object Map]":return new n;case"[object Number]":case"[object String]":return new n(t);case"[object RegExp]":return To(t);case"[object Set]":return new n;case"[object Symbol]":return Co(t)}},Ao=Object.create;function Lo(){}var Io=function(t){if(!Zt(t))return{};if(Ao)return Ao(t);Lo.prototype=t;t=new Lo;return Lo.prototype=void 0,t};var Ro=function(t){return"function"!=typeof t.constructor||Me(t)?{}:Io(eo(t))};var Nt=function(t){return we(t)&&"[object Map]"==vo(t)},Z=At&&At.isMap,No=Z?kt(Z):Nt;var I=function(t){return we(t)&&"[object Set]"==vo(t)},Ot=At&&At.isSet,Mo=Ot?kt(Ot):I,jo="[object Arguments]",Do="[object Function]",zo="[object Object]",Bo={};Bo[jo]=Bo["[object Array]"]=Bo["[object ArrayBuffer]"]=Bo["[object DataView]"]=Bo["[object Boolean]"]=Bo["[object Date]"]=Bo["[object Float32Array]"]=Bo["[object Float64Array]"]=Bo["[object Int8Array]"]=Bo["[object Int16Array]"]=Bo["[object Int32Array]"]=Bo["[object Map]"]=Bo["[object Number]"]=Bo[zo]=Bo["[object RegExp]"]=Bo["[object Set]"]=Bo["[object String]"]=Bo["[object Symbol]"]=Bo["[object Uint8Array]"]=Bo["[object Uint8ClampedArray]"]=Bo["[object Uint16Array]"]=Bo["[object Uint32Array]"]=!0,Bo["[object Error]"]=Bo[Do]=Bo["[object WeakMap]"]=!1;var Fo=function o(n,r,i,t,e,s){var a,l=1&r,c=2&r,u=4&r;if(void 0!==(a=i?e?i(n,t,e,s):i(n):a))return a;if(!Zt(n))return n;var p=Oe(n);if(p){if(a=wo(n),!l)return Ve(n,a)}else{var h=vo(n),t=h==Do||"[object GeneratorFunction]"==h;if(Ee(n))return We(n,l);if(h==zo||h==jo||t&&!e){if(a=c||t?{}:Ro(n),!l)return c?no(n,Ke(a,n)):$e(n,Ue(a,n))}else{if(!Bo[h])return e?n:{};a=ko(n,h,l)}}l=(s=s||new he).get(n);if(l)return l;s.set(n,a),Mo(n)?n.forEach(function(t){a.add(o(t,r,i,t,n,s))}):No(n)&&n.forEach(function(t,e){a.set(e,o(t,r,i,e,n,s))});var d=p?void 0:(u?c?so:io:c?He:Fe)(n);return de(d||n,function(t,e){d&&(t=n[e=t]),ge(a,e,o(t,r,i,e,n,s))}),a};var Uo=function(t){return Fo(t,5)};var qo=function(t,e,o){(void 0===o||wt(t[e],o))&&(void 0!==o||e in t)||ye(t,e,o)};var Go=function(l){return function(t,e,o){for(var n=-1,r=Object(t),i=o(t),s=i.length;s--;){var a=i[l?s:++n];if(!1===e(r[a],a,r))break}return t}}();var Zo=function(t){return we(t)&&Be(t)},Lt=Function.prototype,Et=Object.prototype,Ho=Lt.toString,Ko=Et.hasOwnProperty,Wo=Ho.call(Object);var Vo=function(t){return!(!we(t)||"[object Object]"!=Gt(t))&&(null===(t=eo(t))||"function"==typeof(t=Ko.call(t,"constructor")&&t.constructor)&&t instanceof t&&Ho.call(t)==Wo)};var Yo=function(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]};var Qo=function(t){return ve(t,He(t))};var Jo=function(t,e,o,n,r,i,s){var a,l,c,u=Yo(t,o),p=Yo(e,o),h=s.get(p);h?qo(t,o,h):((a=void 0===(c=i?i(u,p,o+"",t,e,s):void 0))&&(h=!(l=Oe(p))&&Ee(p),e=!l&&!h&&Le(p),c=p,l||h||e?c=Oe(u)?u:Zo(u)?Ve(u):h?We(p,!(a=!1)):e?Po(p,!(a=!1)):[]:Vo(p)||xe(p)?xe(c=u)?c=Qo(u):Zt(u)&&!Ht(u)||(c=Ro(p)):a=!1),a&&(s.set(p,c),r(c,p,n,i,s),s.delete(p)),qo(t,o,c))};var Xo=function n(r,i,s,a,l){r!==i&&Go(i,function(t,e){var o;l=l||new he,Zt(t)?Jo(r,i,e,s,n,a,l):(o=a?a(Yo(r,e),t,e+"",r,i,l):void 0,qo(r,e,o=void 0===o?t:o))},He)};function $o(t){return t}var tn=function(t,e,o){switch(o.length){case 0:return t.call(e);case 1:return t.call(e,o[0]);case 2:return t.call(e,o[0],o[1]);case 3:return t.call(e,o[0],o[1],o[2])}return t.apply(e,o)},en=Math.max;var on=function(i,s,a){return s=en(void 0===s?i.length-1:s,0),function(){for(var t=arguments,e=-1,o=en(t.length-s,0),n=Array(o);++e<o;)n[e]=t[s+e];for(var e=-1,r=Array(s+1);++e<s;)r[e]=t[e];return r[s]=a(n),tn(i,this,r)}};var nn=function(t){return function(){return t}},rn=Date.now;var sn=function(o){var n=0,r=0;return function(){var t=rn(),e=16-(t-r);if(r=t,0<e){if(800<=++n)return arguments[0]}else n=0;return o.apply(void 0,arguments)}}(fe?function(t,e){return fe(t,"toString",{configurable:!0,enumerable:!1,value:nn(e),writable:!0})}:$o);var an=function(t,e){return sn(on(t,e,$o),t+"")};var ln=function(t,e,o){if(!Zt(o))return!1;var n=typeof e;return!!("number"==n?Be(o)&&Pe(e,o.length):"string"==n&&e in o)&&wt(o[e],t)};var cn,un,pn=function(a){return an(function(t,e){var o=-1,n=e.length,r=1<n?e[n-1]:void 0,i=2<n?e[2]:void 0,r=3<a.length&&"function"==typeof r?(n--,r):void 0;for(i&&ln(e[0],e[1],i)&&(r=n<3?void 0:r,n=1),t=Object(t);++o<n;){var s=e[o];s&&a(t,s,o,r)}return t})}(function(t,e,o){Xo(t,e,o)}),hn=((window&&window.__extends||(cn=function(t,e){return(cn=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}cn(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(dn,un=P),dn);function dn(){var t=null!==un&&un.apply(this,arguments)||this;return t.layout="icons",t.mapStyles=["road","grayscale_light","grayscale_dark","night","road_shaded_relief"],t.style=u.ControlStyle.light,t.autoSelectionMode=!0,t}var fn,yn,Z=window&&window.__extends||(fn=function(t,e){return(fn=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}fn(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),mn=window&&window.__awaiter||function(t,s,a,l){return new(a=a||Promise)(function(o,e){function n(t){try{i(l.next(t))}catch(t){e(t)}}function r(t){try{i(l.throw(t))}catch(t){e(t)}}function i(t){var e;t.done?o(t.value):((e=t.value)instanceof a?e:new a(function(t){t(e)})).then(n,r)}i((l=l.apply(t,s||[])).next())})},gn=window&&window.__generator||function(o,n){var r,i,s,a={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},t={next:e(0),throw:e(1),return:e(2)};return"function"==typeof Symbol&&(t[Symbol.iterator]=function(){return this}),t;function e(e){return function(t){return function(e){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,i&&(s=2&e[0]?i.return:e[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,e[1])).done)return s;switch(i=0,(e=s?[2&e[0],s.value]:e)[0]){case 0:case 1:s=e;break;case 4:return a.label++,{value:e[1],done:!1};case 5:a.label++,i=e[1],e=[0];continue;case 7:e=a.ops.pop(),a.trys.pop();continue;default:if(!(s=0<(s=a.trys).length&&s[s.length-1])&&(6===e[0]||2===e[0])){a=0;continue}if(3===e[0]&&(!s||e[1]>s[0]&&e[1]<s[3])){a.label=e[1];break}if(6===e[0]&&a.label<s[1]){a.label=s[1],s=e;break}if(s&&a.label<s[2]){a.label=s[2],a.ops.push(e);break}s[2]&&a.ops.pop(),a.trys.pop();continue}e=n.call(o,a)}catch(t){e=[6,t],i=0}finally{r=s=0}if(5&e[0])throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}([e,t])}}},vn=window&&window.__read||function(t,e){var o="function"==typeof Symbol&&t[Symbol.iterator];if(!o)return t;var n,r,i=o.call(t),s=[];try{for(;(void 0===e||0<e--)&&!(n=i.next()).done;)s.push(n.value)}catch(t){r={error:t}}finally{try{n&&!n.done&&(o=i.return)&&o.call(i)}finally{if(r)throw r.error}}return s},Nt=(Z(_n,yn=ot),_n.prototype.onAdd=function(t,e){var o=this;this.map=t;var n=this.buildContainer(t,this.options.style,"Map Style Control"),r=this.buildStyleOpsGrid();this.styleOpsGrid=r;var i=this.buildCurrStyleBtn(),t=U("Select Style");return r.classList.add(e&&e.position||"top-right"),n.addEventListener("mouseover",function(){o.hasMouse=!0,n.classList.add(_n.Css.inUse),r.classList.remove("hidden-accessible-element")}),n.addEventListener("focusin",function(){o.hasFocus=!0,n.classList.add(_n.Css.inUse),r.classList.remove("hidden-accessible-element")}),n.addEventListener("mouseleave",function(){o.hasMouse=!1,o.hasFocus||(n.classList.remove(_n.Css.inUse),r.classList.add("hidden-accessible-element"))}),n.addEventListener("focusout",function(t){t.relatedTarget instanceof Node&&n.contains(t.relatedTarget)||(o.hasFocus=!1,o.hasMouse||(n.classList.remove(_n.Css.inUse),r.classList.add("hidden-accessible-element")))}),r.addEventListener("keydown",function(t){27===t.keyCode&&(t.stopPropagation(),i.focus(),n.classList.contains(_n.Css.inUse)&&(n.classList.remove(_n.Css.inUse),r.classList.add("hidden-accessible-element")))}),i.addEventListener("click",function(t){n.classList.contains(_n.Css.inUse)?(n.classList.remove(_n.Css.inUse),r.classList.add("hidden-accessible-element")):(n.classList.add(_n.Css.inUse),r.classList.remove("hidden-accessible-element"),r.firstElementChild&&r.firstElementChild.focus())}),e&&_n.InvertOrderPositions.includes(e.position)?(n.appendChild(r),n.appendChild(i),n.appendChild(t),q(t,i)):(n.appendChild(i),n.appendChild(t),q(t,i),n.appendChild(r)),n},_n.prototype.onRemove=function(){yn.prototype.onRemove.call(this),this.styleOpsGrid=null,this.styleButtons.clear(),this.map.events.remove("stylechanged",this.onStyleChange),this.map.events.remove("mapconfigurationchanged",this.onMapConfigurationChange)},_n.prototype.setSelectedStyle=function(o){var e,t,n=this;this.styleIcons.has(o)&&(e=this.currStyleImage,t=this.styleIcons.get(o),e.src!==t&&(e.src=t),Object.entries(this.styleButtons).forEach(function(t){var e=vn(t,2),t=e[0];return e[1].setAttribute("aria-current",t===o?"true":"false")}),this.map.styles.definitions().then(function(t){t=n.mapToFriendlyStyleName(o,t);e.alt!==t&&(e.alt=t),e.parentElement.lastChild instanceof Text&&(e.parentElement.lastChild.textContent=t)}))},_n.prototype.disableStyle=function(t){t=this.styleButtons[t];t&&t.setAttribute("disabled","true")},_n.prototype.enableStyle=function(t){t=this.styleButtons[t];t&&t.removeAttribute("disabled")},_n.prototype.buildSelectStyleBtn=function(o,t,e){var n=this,r=document.createElement("button"),i=this.mapToFriendlyStyleName(o,t);r.setAttribute("aria-label",i),r.setAttribute("type","button");var s=new Image;e.then(function(t){return t.blob()}).then(function(t){t=URL.createObjectURL(t);s.src=t,o===n.map.getStyle().style&&(n.currStyleImage.src=t,n.currStyleImage.alt=i,n.currStyleImage.parentElement.lastChild.nodeType==Node.TEXT_NODE?n.currStyleImage.parentElement.lastChild.textContent=i:n.currStyleImage.parentElement.appendChild(document.createTextNode(i))),n.styleIcons.set(o,t)}),s.setAttribute("aria-hidden","true"),r.appendChild(s),"icons"===this.options.layout?r.classList.add(_n.Css.button):(r.classList.add(_n.Css.listButton),r.classList.add(_n.Css.expanded),r.appendChild(document.createTextNode(i))),r.addEventListener("click",function(){n.hasMouse=!1,n.hasFocus=!1;var t=n.styleButtons[o];t&&!t.hasAttribute("disabled")&&(n._invokeEvent("styleselected",o),n.options.autoSelectionMode&&n.map.setStyle({style:o}),Object.entries(n.styleButtons).forEach(function(t){var e=vn(t,2),t=e[0];return e[1].setAttribute("aria-current",t===o?"true":"false")}))});e=document.createElement("div");return e.classList.add("selected-icon"),r.appendChild(e),r},_n.prototype.buildCurrStyleBtn=function(){var t=document.createElement("button");"icons"==this.options.layout?t.classList.add(_n.Css.button):t.classList.add(_n.Css.listButton),t.classList.add(_n.Css.currentStyle),t.setAttribute("aria-label","Select Style"),t.setAttribute("tabindex","-1"),this.currStyleImage=new Image,t.appendChild(this.currStyleImage);var e=document.createElement("div");return e.classList.add("icon"),t.appendChild(e),t},_n.prototype.buildStyleOpsGrid=function(){var t=this,e=document.createElement("div");return e.classList.add(_n.Css.styleOptions),"icons"===this.options.layout?e.classList.add(this.options.layout):e.classList.add(_n.Css.dropdown),e.setAttribute("aria-label","Style Options"),e.classList.add("hidden-accessible-element"),this.map.styles.definitions().then(function(e){return mn(t,void 0,void 0,function(){return gn(this,function(t){return this.onMapConfigurationChange(e),this.map.events.add("stylechanged",this.onStyleChange),[2]})})}),this.map.events.add("mapconfigurationchanged",this.onMapConfigurationChange),e},_n.prototype.populateOpsGridFromDefinitions=function(n){var t,o,r=this;this.styleOpsGrid&&(t=n.configurations,(t=Array.isArray(this.options.mapStyles)?t.filter(function(t){return r.options.mapStyles.includes(t.name.split("_indoor")[0])}):t).forEach(function(t){var e={url:t.thumbnail};t.thumbnail&&r.map.styles._transformStyleRequest(t.thumbnail,e);var o=r.map.getServiceOptions();o.transformRequest&&pn(e,o.transformRequest(e.url,"Thumbnail"));e=fetch(e.url,{headers:e.headers}),e=r.buildSelectStyleBtn(t.name,n,e);r.styleOpsGrid.appendChild(e),r.styleButtons[t.name]=e,"icons"===r.options.layout&&(t=U(r.mapToFriendlyStyleName(t.name,n)),r.styleOpsGrid.appendChild(t),q(t,e))}),o=this.map.getStyle().style,Object.entries(this.styleButtons).forEach(function(t){var e=vn(t,2),t=e[0];return e[1].setAttribute("aria-current",t===o?"true":"false")}))},_n.InvertOrderPositions=[u.ControlPosition.TopRight,u.ControlPosition.BottomRight],_n.Css={button:"azure-maps-control-button",listButton:"azure-maps-control-list-button",expanded:"expanded",currentStyle:"curr-style",inUse:"in-use",styleOptions:"style-options",dropdown:"azure-maps-control-dropdown"},_n);function _n(t){var e=yn.call(this)||this;return e.styleOpsGrid=null,e.hasMouse=!1,e.hasFocus=!1,e.styleButtons=new Q,e.styleIcons=new Q,e.onStyleChange=function(){var t;e.options.autoSelectionMode&&(t=e.map.getStyle().style,e.setSelectedStyle(t))},e.onMapConfigurationChange=function(t){e.styleOpsGrid&&(Array.from(e.styleOpsGrid.children).forEach(function(t){return t.remove()}),e.styleButtons.clear(),e.populateOpsGridFromDefinitions(t))},e.mapToFriendlyStyleName=function(e,t){t=t.configurations.find(function(t){return t.name===e});return(null==t?void 0:t.displayName)||e},e.options=(new hn).merge(Uo(t)),e}var wn,bn,Sn=((window&&window.__extends||(wn=function(t,e){return(wn=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}wn(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(xn,bn=P),xn);function xn(){var t=null!==bn&&bn.apply(this,arguments)||this;return t.flow="none",t.incidents=!1,t}var On,Tn,En=((window&&window.__extends||(On=function(t,e){return(On=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}On(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(Cn,Tn=Sn),Cn);function Cn(){var t=null!==Tn&&Tn.apply(this,arguments)||this;return t.isActive=!1,t.style=u.ControlStyle.light,t}var Pn,kn,An=((window&&window.__extends||(Pn=function(t,e){return(Pn=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}Pn(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(Ln,kn=ot),Object.defineProperty(Ln.prototype,"isActive",{get:function(){if(!this.map)return!1;var t=this.map.getTraffic();return"none"!==t.flow||t.incidents},set:function(t){this.map&&this.map.setTraffic({flow:t?this.options.flow:"none",incidents:!!t&&this.options.incidents})},enumerable:!1,configurable:!0}),Ln.prototype.onAdd=function(t){(this.map=t).getTraffic();void 0!==this.initIsActive&&(this.isActive=this.initIsActive),this.container=this.buildContainer(t,this.style,"Traffic Control"),this.container.style.flexDirection="column";var e=this.constructTrafficButton(t);this.container.appendChild(e);t=U("Toggle Traffic Display");return this.container.appendChild(t),q(t,e),this.container},Ln.prototype.onRemove=function(){kn.prototype.onRemove.call(this),this.map=null},Ln.prototype.getOptions=function(){return(new En).merge({isActive:this.isActive,flow:this.options.flow,incidents:this.options.incidents,style:this.style})},Ln.prototype.updateButtonState=function(){this.trafficButton&&(this.isActive?this.container.classList.add("in-use"):this.container.classList.remove("in-use"),this.trafficButton.setAttribute("aria-pressed",this.isActive?"true":"false"))},Ln.prototype.constructTrafficButton=function(t){var e=this,o=document.createElement("button");return o.classList.add("azure-maps-control-button"),o.classList.add("traffic"),o.setAttribute("aria-label","Toggle Traffic Display"),o.setAttribute("alt","Toggle Traffic Display"),o.setAttribute("type","button"),this.trafficButton=o,this.updateButtonState(),o.addEventListener("click",function(){e.isActive=!e.isActive}),o},Ln);function Ln(t){var e,o=kn.call(this)||this;return o.hasMouse=!1,o.hasFocus=!1,o.options=(new Sn).merge({flow:"relative",incidents:!0}),o.style=u.ControlStyle.light,o.container=null,o.trafficButton=null,o.map=null,t&&(o.initIsActive=null!==(e=t.isActive)&&void 0!==e&&e,o.options.flow=t.flow||"relative",o.options.incidents=null===(e=t.incidents)||void 0===e||e,o.style=t.style||u.ControlStyle.light),o}var In,Rn,At=window&&window.__extends||(In=function(t,e){return(In=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}In(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),Nn=window&&window.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,o=e&&t[e],n=0;if(o)return o.call(t);if(t&&"number"==typeof t.length)return{next:function(){return{value:(t=t&&n>=t.length?void 0:t)&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},kt=(At(Mn,Rn=ot),Mn.prototype.onAdd=function(t){this.map=t;var e=this.buildContainer(t,u.ControlStyle.auto,"Traffic Legend"),t=this.buildTrafficLegendDiv(t);return e.setAttribute("role","definition"),e.appendChild(t),e},Mn.prototype.onRemove=function(){Rn.prototype.onRemove.call(this),this.syncHiddenState&&(this.map.events.remove("styledata",this.syncHiddenState),this.syncHiddenState=null),this.map=null},Mn.prototype.buildTrafficLegendDiv=function(e){var o,t,n,r,i=document.createElement("div");i.classList.add("traffic-legend","hidden"),i.setAttribute("alt","Traffic Legend");var s=document.createElement("table"),a=document.createElement("tr"),l=document.createElement("td");l.setAttribute("alt","Traffic"),l.appendChild(document.createTextNode("Traffic"));var c=U("Traffic");l.classList.add("traffic-legend-title"),l.colSpan=6,a.appendChild(l),a.appendChild(c),q(c,l),s.appendChild(a);var u=document.createElement("tr");try{for(var p=Nn(this.table),h=p.next();!h.done;h=p.next()){var d=h.value,f=document.createElement("td");if("Fast"===d||"Slow"===d)f.setAttribute("alt",d),f.appendChild(document.createTextNode(d)),f.classList.add("traffic-legend-text");else{f.classList.add("traffic-legend-colors"),f.setAttribute("aria-label","Traffic Legend"),f.setAttribute("role","img");try{for(var y=(n=void 0,Nn(d)),m=y.next();!m.done;m=y.next()){var g=m.value,v=document.createElement("div");v.classList.add(g),f.appendChild(v)}}catch(t){n={error:t}}finally{try{m&&!m.done&&(r=y.return)&&r.call(y)}finally{if(n)throw n.error}}}u.appendChild(f);var _=U(d instanceof Array?"Traffic Legend":d);u.appendChild(_),q(_,f)}}catch(t){o={error:t}}finally{try{h&&!h.done&&(t=p.return)&&t.call(p)}finally{if(o)throw o.error}}return s.appendChild(u),i.appendChild(s),this.syncHiddenState=function(t){"style"===t.dataType&&((t=e.getTraffic()).flow&&"none"!==t.flow?i.classList.remove("hidden"):i.classList.add("hidden"))},this.syncHiddenState({dataType:"style"}),e.events.add("styledata",this.syncHiddenState),i},Mn);function Mn(){var t=Rn.call(this)||this;return t.table=["Fast",["green","yellow","red","dark-red"],"Slow"],t.map=null,t.syncHiddenState=null,t}Ot=function(t){return this.__data__.has(t)};function jn(t){var e=-1,o=null==t?0:t.length;for(this.__data__=new ue;++e<o;)this.add(t[e])}jn.prototype.add=jn.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},jn.prototype.has=Ot;var Dn=jn;var zn=function(t,e){for(var o=-1,n=null==t?0:t.length;++o<n;)if(e(t[o],o,t))return!0;return!1};var Bn=function(t,e){return t.has(e)};var Fn=function(t,e,o,n,r,i){var s=1&o,a=t.length,l=e.length;if(a!=l&&!(s&&a<l))return!1;var c=i.get(t),l=i.get(e);if(c&&l)return c==e&&l==t;var u=-1,p=!0,h=2&o?new Dn:void 0;for(i.set(t,e),i.set(e,t);++u<a;){var d,f=t[u],y=e[u];if(void 0!==(d=n?s?n(y,f,u,e,t,i):n(f,y,u,t,e,i):d)){if(d)continue;p=!1;break}if(h){if(!zn(e,function(t,e){if(!Bn(h,e)&&(f===t||r(f,t,o,n,i)))return h.push(e)})){p=!1;break}}else if(f!==y&&!r(f,y,o,n,i)){p=!1;break}}return i.delete(t),i.delete(e),p};function Un(t){var o=-1,n=Array(t.size);return t.forEach(function(t,e){n[++o]=[e,t]}),n}function qn(t){var e=-1,o=Array(t.size);return t.forEach(function(t){o[++e]=t}),o}var I=xt?xt.prototype:void 0,Gn=I?I.valueOf:void 0;var Zn=function(t,e,o,n,r,i,s){switch(o){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":return t.byteLength==e.byteLength&&i(new bo(t),new bo(e))?!0:!1;case"[object Boolean]":case"[object Date]":case"[object Number]":return wt(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case"[object Map]":var a=Un;case"[object Set]":a=a||qn;if(t.size!=e.size&&!(1&n))return!1;var l=s.get(t);if(l)return l==e;n|=2,s.set(t,e);a=Fn(a(t),a(e),n,r,i,s);return s.delete(t),a;case"[object Symbol]":if(Gn)return Gn.call(t)==Gn.call(e)}return!1},Hn=Object.prototype.hasOwnProperty;var Kn=function(t,e,o,n,r,i){var s=1&o,a=io(t),l=a.length;if(l!=io(e).length&&!s)return!1;for(var c=l;c--;){var u=a[c];if(!(s?u in e:Hn.call(e,u)))return!1}var p=i.get(t),h=i.get(e);if(p&&h)return p==e&&h==t;var d=!0;i.set(t,e),i.set(e,t);for(var f=s;++c<l;){var y,m=t[u=a[c]],g=e[u];if(!(void 0===(y=n?s?n(g,m,u,e,t,i):n(m,g,u,t,e,i):y)?m===g||r(m,g,o,n,i):y)){d=!1;break}f=f||"constructor"==u}return!d||f||(p=t.constructor)!=(h=e.constructor)&&"constructor"in t&&"constructor"in e&&!("function"==typeof p&&p instanceof p&&"function"==typeof h&&h instanceof h)&&(d=!1),i.delete(t),i.delete(e),d},Wn="[object Arguments]",Vn="[object Array]",Yn="[object Object]",Qn=Object.prototype.hasOwnProperty;var Jn=function(t,e,o,n,r,i){var s=Oe(t),a=Oe(e),l=s?Vn:vo(t),c=a?Vn:vo(e),u=(l=l==Wn?Yn:l)==Yn,a=(c=c==Wn?Yn:c)==Yn;if((c=l==c)&&Ee(t)){if(!Ee(e))return!1;u=!(s=!0)}if(c&&!u)return i=i||new he,s||Le(t)?Fn(t,e,o,n,r,i):Zn(t,e,l,o,n,r,i);if(!(1&o)){u=u&&Qn.call(t,"__wrapped__"),a=a&&Qn.call(e,"__wrapped__");if(u||a)return r(u?t.value():t,a?e.value():e,o,n,i=i||new he)}return!!c&&(i=i||new he,Kn(t,e,o,n,r,i))};var Xn=function t(e,o,n,r,i){return e===o||(null==e||null==o||!we(e)&&!we(o)?e!=e&&o!=o:Jn(e,o,n,r,t,i))};var $n,tr=function(t,e){return Xn(t,e)},er=($n=Object.freeze({__proto__:null,default:{}}))&&$n.default||$n,or=It(function(a){!function(){for(var e,o,n=0,r=[],t=0;t<256;t++)r[t]=(t+256).toString(16).substr(1);function i(){var t,t=(t=16,(!e||s.BUFFER_SIZE<n+t)&&(n=0,e=s.randomBytes(s.BUFFER_SIZE)),e.slice(n,n+=t));return t[6]=15&t[6]|64,t[8]=63&t[8]|128,t}function s(){var t=i();return r[t[0]]+r[t[1]]+r[t[2]]+r[t[3]]+"-"+r[t[4]]+r[t[5]]+"-"+r[t[6]]+r[t[7]]+"-"+r[t[8]]+r[t[9]]+"-"+r[t[10]]+r[t[11]]+r[t[12]]+r[t[13]]+r[t[14]]+r[t[15]]}s.BUFFER_SIZE=4096,s.bin=i,s.clearBuffer=function(){e=null,n=0},s.test=function(t){return"string"==typeof t&&/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(t)},"undefined"!=typeof crypto?o=crypto:"undefined"!=typeof window&&void 0!==window.msCrypto&&(o=window.msCrypto),o=o||er,(a.exports=s).randomBytes=function(){if(o){if(o.randomBytes)return o.randomBytes;if(o.getRandomValues)return"function"!=typeof Uint8Array.prototype.slice?function(t){t=new Uint8Array(t);return o.getRandomValues(t),Array.from(t)}:function(t){t=new Uint8Array(t);return o.getRandomValues(t),t}}return function(t){for(var e=[],o=0;o<t;o++)e.push(Math.floor(256*Math.random()));return e}}()}()}),nr=(rr.TYPE="Feature",rr);function rr(t,e,o,n){this.type="Feature",this.type=rr.TYPE,this.properties=e||{},this.id=o,this.geometry=t,this.bbox=n}var ir,sr,Lt=window&&window.__extends||(ir=function(t,e){return(ir=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}ir(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),ar=(sr=Array,Lt(lr,sr),lr.fromData=function(o){var n=NaN,r=NaN,i=new Set(["y"]),s=new Set(["x"]);return Object.keys(o).forEach(function(t){var e=t.toLowerCase();isNaN(n)&&i.has(e)&&"number"==typeof o[t]?n=o[t]:isNaN(r)&&s.has(e)&&"number"==typeof o[t]&&(r=o[t])}),isNaN(n)||isNaN(r)?null:new lr(n,r)},lr.getX=function(t){return 0<t.length?t[0]:NaN},lr.getY=function(t){return 1<t.length?t[1]:NaN},lr.getDestination=function(t,e,o){return new lr(lr.getX(t)+o*Math.cos((e+270)*Math.PI/180),lr.getY(t)+o*Math.sin((e+270)*Math.PI/180))},lr.getDistance=function(t,e){var o=lr.getX(t)-lr.getX(e),e=lr.getY(t)-lr.getY(e);return Math.sqrt(o*o+e*e)},lr.getHeading=function(t,e){var o=lr.getX(e)-lr.getX(t),e=lr.getY(t)-lr.getY(e);return 180*(2.5*Math.PI-Math.atan2(e,o))/Math.PI%360},lr);function lr(t,e){return sr.call(this,t,e)||this}var cr=(ur.TYPE="Point",ur);function ur(t){this.type="Point",this.type=ur.TYPE,this.coordinates=t}var pr,hr,dr,fr,yr,mr=window&&window.__read||function(t,e){var o="function"==typeof Symbol&&t[Symbol.iterator];if(!o)return t;var n,r,i=o.call(t),s=[];try{for(;(void 0===e||0<e--)&&!(n=i.next()).done;)s.push(n.value)}catch(t){r={error:t}}finally{try{n&&!n.done&&(o=i.return)&&o.call(i)}finally{if(r)throw r.error}}return s},gr=window&&window.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,o=e&&t[e],n=0;if(o)return o.call(t);if(t&&"number"==typeof t.length)return{next:function(){return{value:(t=t&&n>=t.length?void 0:t)&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},vr=6378137,_r=Math.PI/180,wr=180/Math.PI,br=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9],Sr=85.0511;function xr(t){return t*_r}function Or(t){return t*wr}function Tr(t,e,o){return Math.min(Math.max(t,e),o)}function Er(t,e){var o=xr(e[1]-t[1]),n=xr(e[0]-t[0]),n=Math.pow(Math.sin(o/2),2)+Math.cos(xr(t[1]))*Math.cos(xr(e[1]))*Math.pow(Math.sin(n/2),2),n=2*Math.atan2(Math.sqrt(n),Math.sqrt(1-n));return Math.round(vr*n*100)/100}function Cr(t){if(t)switch(t.toLowerCase()){case"feet":case"foot":case"ft":return hr.feet;case"kilometers":case"kilometer":case"kilometres":case"kilometre":case"km":case"kms":return hr.kilometers;case"miles":case"mile":case"mi":return hr.miles;case"nauticalmiles":case"nauticalmile":case"nms":case"nm":return hr.nauticalMiles;case"yards":case"yard":case"yds":case"yrd":case"yrds":return hr.yards;default:return hr.meters}return hr.meters}function Pr(t){if(t)switch(t.toLowerCase()){case"milespersecondsquared":case"milepersecondsquared":case"mi/s^2":case"mi/s2":return yr.milesPerSecondSquared;case"kilometerspersecondsquared":case"kilometrespersecondsquared":case"kilometerpersecondsquared":case"kilometrepersecondsquared":case"km/s^2":case"km/s2":return yr.kilometersPerSecondSquared;case"knotspersecond":case"knotpersecond":case"knts/s":case"kn/s":case"kt/s":return yr.knotsPerSecond;case"standardgravity":case"g":return yr.standardGravity;case"feetpersecondsquared":case"footpersecondsquared":case"ft/s^2":case"ft/s2":return yr.feetPerSecondSquared;case"yardspersecondsquared":case"yardpersecondsquared":case"yds/s^2":case"yds/s2":case"yd/s^2":case"yd/s2":return yr.yardsPerSecondSquared;case"milesperhoursecond":case"mileperhoursecond":case"milesperhourseconds":case"mileperhourseconds":case"mi/h/s":return yr.milesPerHourSecond;case"kilometersperhoursecond":case"kilometrespersoursecond":case"kilometerperhoursecond":case"kilometrepersoursecond":case"kilometersperhourssecond":case"kilometrespersourssecond":case"kilometerperhourssecond":case"kilometrepersourssecond":case"kmhs":case"km/h/s":return yr.kilometersPerHourSecond;default:return yr.metersPerSecondSquared}return yr.metersPerSecondSquared}function kr(t){if(t)switch(t){case"acres":case"ac":return pr.acres;case"hectares":case"ha":return pr.hectares;case"squareFeet":case"ft^2":case"ft2":return pr.squareFeet;case"squareYards":case"squareYard":case"yds^2":case"yds2":case"yd^2":case"yd2":return pr.squareYards;case"squareKilometers":case"squareKilometres":case"squareKilometer":case"squareKilometre":case"km^2":case"km2":return pr.squareKilometers;case"squareMiles":case"squareMile":case"mi^2":case"mi2":return pr.squareMiles;default:return pr.squareMeters}return pr.squareMeters}function Ar(t){if(t)switch(t.toLowerCase()){case"feetpersecond":case"footsecond":case"ftps":case"ft/s":return fr.feetPerSecond;case"milesperhour":case"mileperhour":case"mph":case"mi/hr":case"mi/h":return fr.milesPerHour;case"knots":case"knot":case"knts":case"knt":case"kn":case"kt":return fr.knots;case"mach":case"m":return fr.mach;case"kilometersperhour":case"kilometresperhour":case"kmperhour":case"kmph":case"km/hr":case"km/h":return fr.kilometersPerHour;default:return fr.metersPerSecond}return fr.metersPerSecond}function Lr(t){if(t)switch(t.toLowerCase()){case"milliseconds":case"ms":return dr.ms;case"minutes":case"minute":case"mins":case"min":return dr.minutes;case"hours":case"hour":case"hr":case"h":return dr.hours;case"days":case"day":case"d":return dr.days;default:return dr.seconds}return dr.seconds}function Ir(t){var e=0;if(t&&0<t.length)for(var e=Math.abs(Rr(t[0])),o=1,n=t.length;o<n;o++)e-=Math.abs(Rr(t[o]));return e}function Rr(t){var e=0;if(3<=t.length){for(var o=void 0,n=void 0,r=0,i=t.length;r<i;r++)e+=(xr(t[r===i-2?(o=i-2,n=i-1,0):r===i-1?(o=i-1,n=0,1):(n=(o=r)+1,r+2)][0])-xr(t[o][0]))*Math.sin(xr(t[n][1]));e=e*vr*vr/2}return e}function Nr(t,e,o){return(t[0]-o[0])*(e[1]-o[1])-(t[1]-o[1])*(e[0]-o[0])}function Mr(t,e,o){if(2<=o.length){for(var n,r,i=1/0,s=null,a=ti(o,22),l=0,c=a.length-1;l<c;l++)r=function(t,e,o){if(e[0]===o[0]&&e[1]===o[1])return e;var n=t[0]-e[0],r=t[1]-e[1],i=o[0]-e[0],t=o[1]-e[1],r=(i*n+t*r)/(i*i+t*t);return r<0?e:1<r?o:[e[0]+i*r,e[1]+t*r]}(e,a[l],a[l+1]),(n=ar.getDistance(e,r))<i&&(i=n,s=r);if(s){var u=$r([s],22)[0];return new nr(new cr(u),{distance:Br(t,u)})}}else if(1===o.length)return new nr(new cr(o[0]),{distance:Br(t,o[0])});return null}function jr(t,e){var o;return!isNaN(t)&&"number"==typeof e&&0<=e&&(o=void 0,o=e<br.length?br[e]:Math.pow(10,e),t=Math.round(t*o)/o),t}function Dr(t,e,o,n){switch(Cr(e)){case hr.meters:t/=1e3;break;case hr.feet:t/=3280.8399;break;case hr.miles:t/=.62137119;break;case hr.yards:t/=1093.6133;break;case hr.nauticalMiles:t/=.5399568;break;case hr.kilometers:}switch(Cr(o)){case hr.meters:t*=1e3;break;case hr.feet:t*=3280.8399;break;case hr.miles:t*=.62137119;break;case hr.yards:t*=1093.6133;break;case hr.nauticalMiles:t*=.5399568;break;case hr.kilometers:}return"number"==typeof n&&0<=n&&(n=Math.pow(10,n),t=Math.round(t*n)/n),t}function zr(t,e,o,n){n=n||"meters",t=ui(t);var r=Fr(n),n=xr(t[1]),t=xr(t[0]),e=e*_r,o=o/r,r=Math.asin(Math.sin(n)*Math.cos(o)+Math.cos(n)*Math.sin(o)*Math.cos(e)),n=t+Math.atan2(Math.sin(e)*Math.sin(o)*Math.cos(n),Math.cos(o)-Math.sin(n)*Math.sin(r)),r=Tr(Qr(r*wr),-85,85);return[Jr(n*wr),r]}function Br(t,e,o){e=Er(t=ui(t),e=ui(e));return"meters"===o?e:Dr(e,"meters",o||"meters")}function Fr(t){t=Cr(t);return Dr(vr,hr.meters,t)}function Ur(t,e,o){for(var n=[],r=xr(t[1]),i=xr(t[0]),s=xr(e[1]),a=xr(e[0]),l=2*Math.asin(Math.sqrt(Math.pow(Math.sin((r-s)/2),2)+Math.cos(r)*Math.cos(s)*Math.pow(Math.sin((i-a)/2),2))),c=0;c<=o;c++){var u=c/o,p=Math.sin((1-u)*l)/Math.sin(l),h=Math.sin(u*l)/Math.sin(l),d=p*Math.cos(r)*Math.cos(i)+h*Math.cos(s)*Math.cos(a),u=p*Math.cos(r)*Math.sin(i)+h*Math.cos(s)*Math.sin(a),h=p*Math.sin(r)+h*Math.sin(s),h=Math.atan2(h,Math.sqrt(Math.pow(d,2)+Math.pow(u,2))),d=Math.atan2(u,d),h=Tr(h*wr,-85,85);d*=wr,n.push([d,h])}return n}function qr(t){return(Array.isArray(t)?t:t.coordinates).reduce(function(t,e){var o=0<t.length?t[t.length-1]:null;return o&&180<Math.abs(e[0]-o[0])?(o=o[0]<0?e[0]-360:e[0]+360,t.push([o,e[1]])):t.push(e),t},[])}function Gr(t){for(var e,o,n,r,i,s=Array.isArray(t)?t:t.coordinates,a=[],l=[],c=0;c<s.length;c++)a.push(s[c]),c+1>=s.length||(e=(n=mr(s[c],2))[0],o=n[1],i=(r=mr(s[c+1],2))[0],n=r[1],180<Math.abs(i-e)&&(r=0<e?180:-180,i=Math.abs((0<e?i+360:i-360)-e),i=o+(n-o)*(Math.abs(r-e)/i),a.push([r,i]),l.push(a),a=[[-r,i]]));return l.push(a),l}function Zr(t,e){if(t=ui(t),e=ui(e),t&&2<=t.length&&e&&2<=e.length){var o=xr(t[1]),n=xr(e[1]),e=xr(e[0]-t[0]),t=Math.sin(e)*Math.cos(n),e=Math.cos(o)*Math.sin(n)-Math.sin(o)*Math.cos(n)*Math.cos(e);return(Or(Math.atan2(t,e))+360)%360}return NaN}function Hr(t,e){var o,n=0;Array.isArray(t)?o=t:t.type&&"LineString"===t.type&&(o=t.coordinates);for(var r=0,i=o.length-1;r<i;r++)n+=Er(o[r],o[r+1]);return Dr(n,"meters",e||"meters")}function Kr(t,e,o){o=o||"meters";var n,r,i=0;if(Array.isArray(t)?r=t:t.type&&"LineString"===t.type&&(r=t.coordinates),2<=r.length){for(var s=r.length,a=1;a<s;a++){if(e<=i+(n=Br(r[a-1],r[a],o))){var l=Zr(r[a-1],r[a]);return zr(r[a-1],l,e-i,o)}i+=n}return i<=e?r[s-1]:r[0]}return null}function Wr(t,e,o,n,r){n=n||"meters",r=r||0,t=ui(t);for(var i=[],s=360/o,a=0;a<=o;a++)i.push(zr(t,(a*s+r)%360,e,n));return i}function Vr(t,e,o,n,r){return qr(Wr(t,e,o,n,r))}function Yr(t,e,o){o=void 0===o?.5:o;var n=Br(t=ui(t),e=ui(e),"kilometers");return zr(t,Zr(t,e),n*o,"kilometers")}function Qr(t){return 90<t?180<(t=(t+90)%360)?90-(t-180):t-90:t<-90?(t=(t-90)%360)<-180?-90-(t+180):t+90:t}function Jr(t){return 180<t?(t+180)%360-180:t<-180?(t-180)%360+180:t}function Xr(t,e,o){if(0===o)return Object.assign({},t);e=ui(e);for(var n,r,i=[],s=0,a=t.length;s<a;s++)n=Br(e,t[s]),r=Zr(e,t[s]),i.push(zr(e,r+o,n));return i}function $r(t,e){for(var o,n,r=512*Math.pow(2,e),i=[],s=0,a=t.length;s<a;s++)o=t[s][0]/r-.5,n=.5-t[s][1]/r,i.push([360*o,90-360*Math.atan(Math.exp(2*-n*Math.PI))/Math.PI]);return i}function ti(t,e){for(var o,n,r=512*Math.pow(2,e),i=[],s=0,a=t.length;s<a;s++)n=Math.sin(t[s][1]*Math.PI/180),o=(t[s][0]+180)/360,n=.5-Math.log((1+n)/(1-n))/(4*Math.PI),i.push([Math.round(o*r),Math.round(n*r)]);return i}function ei(t,e,o,n){switch(Pr(e)){case yr.kilometersPerHourSecond:t/=3.6;break;case yr.milesPerHourSecond:t/=2.236936292054;break;case yr.knotsPerSecond:t/=1.943844492441;break;case yr.standardGravity:t/=.1019716212978;break;case yr.kilometersPerSecondSquared:t/=.001;break;case yr.milesPerSecondSquared:t/=.000621371192;break;case yr.feetPerSecondSquared:t/=3.280839895012;break;case yr.yardsPerSecondSquared:t/=1.093613298338;break;case yr.metersPerSecondSquared:}switch(Pr(o)){case yr.kilometersPerHourSecond:t*=3.6;break;case yr.milesPerHourSecond:t*=2.236936292054;break;case yr.knotsPerSecond:t*=1.943844492441;break;case yr.standardGravity:t*=.1019716212978;break;case yr.kilometersPerSecondSquared:t*=.001;break;case yr.milesPerSecondSquared:t*=.000621371192;break;case yr.feetPerSecondSquared:t*=3.280839895012;break;case yr.yardsPerSecondSquared:t*=1.093613298338;break;case yr.metersPerSecondSquared:}return jr(t,n)}function oi(t,e,o,n){switch(kr(e)){case pr.acres:t*=4046.8564224;break;case pr.hectares:t*=1e4;break;case pr.squareFeet:t*=.09290304;break;case pr.squareKilometers:t*=1e6;break;case pr.squareMiles:t*=259e4;break;case pr.squareYards:t*=.83612736;break;case pr.squareMeters:}switch(kr(o)){case pr.acres:t/=4046.8564224;break;case pr.hectares:t/=1e4;break;case pr.squareFeet:t/=.09290304;break;case pr.squareKilometers:t/=1e6;break;case pr.squareMiles:t/=259e4;break;case pr.squareYards:t/=.83612736;break;case pr.squareMeters:}return jr(t,n)}function ni(t,e,o,n){switch(Ar(e)){case fr.feetPerSecond:t*=1.09728;break;case fr.milesPerHour:t*=1.6093;break;case fr.knots:t*=1.852;break;case fr.metersPerSecond:t*=3.6;break;case fr.mach:t*=1234.8;break;case fr.kilometersPerHour:}switch(Ar(o)){case fr.feetPerSecond:t/=1.09728;break;case fr.milesPerHour:t/=1.6093;break;case fr.knots:t/=1.852;break;case fr.metersPerSecond:t/=3.6;break;case fr.mach:t/=1234.8;break;case fr.kilometersPerHour:}return jr(t,n)}function ri(t,e,o,n){switch(Lr(e)){case dr.ms:t/=1e3;break;case dr.hours:t*=3600;break;case dr.minutes:t*=60;break;case dr.days:t*=86400;break;case dr.seconds:}switch(Lr(o)){case dr.ms:t*=1e3;break;case dr.hours:t/=3600;break;case dr.minutes:t/=60;break;case dr.days:t/=86400;break;case dr.seconds:}return jr(t,n)}function ii(t,e,o,n,r,i,s,a){r=Dr(e,r,hr.meters),i=ri(o,i,dr.seconds);return ei(2*(r-ni(t,n,fr.metersPerSecond)*i)/(i*i),yr.metersPerSecondSquared,s,a)}function si(t,e,o,n,r,i,s){t=ni(t,n,fr.metersPerSecond);return ei((ni(e,n,fr.metersPerSecond)-t)/ri(o,r,dr.seconds),yr.metersPerSecondSquared,i,s)}function ai(t,e,o,n){t=li(t),e=li(e);return null!=t&&null!=e?ri(e.getTime()-t.getTime(),dr.ms,o,n):NaN}function li(t){if("[object Date]"===Object.prototype.toString.call(t))return t;if("string"==typeof t){var e=Date.parse(t);if(!isNaN(e))return new Date(e);if(0<=t.indexOf("Date(")){e=0,e=0<(t=t.replace("/Date(","").replace(")/","")).indexOf("+")?parseInt(t.substr(0,t.indexOf("+")),10):0<t.indexOf("-")?parseInt(t.substr(0,t.indexOf("-")),10):parseInt(t,10);return new Date(e)}}else if("number"==typeof t)return new Date(t);return null}function ci(t){var e=[],o=null,n=null;if(Array.isArray(t)&&0<t.length)if(Array.isArray(t[0])&&"number"==typeof t[0][0])e=t;else for(var r=t.length,i=0;i<r;i++)e=e.concat(ci(t[i]));else if(t.type)switch(t.type){case"Point":e=[t.coordinates];break;case"LineString":e=t.coordinates;break;case"Polygon":o=t.coordinates;break;case"MultiPoint":e=t.coordinates;break;case"MultiLineString":o=t.coordinates;break;case"MultiPolygon":n=t.coordinates;break;case"Feature":var s=t,e=Si._isCircle(s)?Si._getCirclePositions(s):ci(s.geometry);break;case"FeatureCollection":e=ci(t.features);break;case"GeometryCollection":e=ci(t.geometries)}else if(t instanceof Si)return ci(t.toJson());if(o)for(r=o.length,i=0;i<r;i++)e=e.concat(o[i]);else if(n)for(var a=n.length,i=0;i<a;i++)for(var l=n[i].length,c=0;c<l;c++)e=e.concat(n[i][c]);return e}function ui(t){if(Array.isArray(t)&&"number"==typeof t[0])return t;if(t.type){if("Point"===t.type)return t.coordinates;if("Feature"===t.type&&"Point"===t.geometry.type)return t.geometry.coordinates}else if(t instanceof Si&&"Point"===t.getType())return t.getCoordinates();return null}function pi(t,e,o){o=o||"meters";var n,r,i=0;if(Array.isArray(t)?r=t:t.type&&"LineString"===t.type&&(r=t.coordinates),2<=r.length){for(var s=r.length,a=1;a<s;a++){if(e<=i+(n=Br(r[a-1],r[a],o))){var l=Zr(r[a-1],r[a]),c=zr(r[a-1],l,e-i,o);return new nr(new cr(c),{heading:l})}i+=n}return i<=e?new nr(new cr(r[s-1]),{heading:Zr(r[s-2],r[s-1])}):new nr(new cr(r[0]),{heading:Zr(r[0],r[1])})}return null}function hi(t,e,o,n){var r=ui(t),i=ti([r],22)[0],s=null,a=1/0;switch((e=e instanceof Si?e.toJson():e).type){case"Feature":return hi(t,e.geometry,o);case"Point":d=[[e.coordinates]];break;case"MultiPoint":for(var l,c=e.coordinates,u=0,p=c.length;u<p;u++)(l=Br(r,c[u]))<a&&(a=l,s=new nr(new cr(c[u]),{distance:l}));break;case"LineString":d=[e.coordinates];break;case"Polygon":case"MultiLineString":d=e.coordinates;break;case"MultiPolygon":var h=e.coordinates;if(0<h.length)for(var d=h[0],u=1,p=h.length;u<p;u++)d=d.concat(h[u])}if(d)for(var f,u=0,p=d.length;u<p;u++)(f=Mr(r,i,d[u]))&&f.properties.distance<a&&(a=f.properties.distance,s=f);return s&&(s.properties.distance=Dr(s.properties.distance,"meters",o,n)),s}(Et=pr=pr||{}).squareMeters="squareMeters",Et.acres="acres",Et.hectares="hectares",Et.squareFeet="squareFeet",Et.squareKilometers="squareKilometers",Et.squareMiles="squareMiles",Et.squareYards="squareYards",(Z=hr=hr||{}).meters="meters",Z.kilometers="kilometers",Z.feet="feet",Z.miles="miles",Z.nauticalMiles="nauticalMiles",Z.yards="yards",(At=dr=dr||{}).seconds="seconds",At.hours="hours",At.ms="ms",At.minutes="minutes",At.days="days",(Ot=fr=fr||{}).metersPerSecond="metersPerSecond",Ot.kilometersPerHour="kilometersPerHour",Ot.feetPerSecond="feetPerSecond",Ot.milesPerHour="milesPerHour",Ot.knots="knots",Ot.mach="mach",(xt=yr=yr||{}).milesPerSecondSquared="milesPerSecondSquared",xt.kilometersPerSecondSquared="kilometersPerSecondSquared",xt.knotsPerSecond="knotsPerSecond",xt.standardGravity="standardGravity",xt.feetPerSecondSquared="feetPerSecondSquared",xt.yardsPerSecondSquared="yardsPerSecondSquared",xt.milesPerHourSecond="milesPerHourSecond",xt.kilometersPerHourSecond="kilometersPerHourSecond",xt.metersPerSecondSquared="metersPerSecondSquared";var di,fi,I=window&&window.__extends||(di=function(t,e){return(di=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}di(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),yi=(fi=Array,I(mi,fi),mi.fromPosition=function(t){return 2===t.length?new mi(t[0],t[1]):2<t.length?new mi(t[0],t[1],t[2]):null},mi.areEqual=function(t,e,o){if(void 0===o&&(o=6),t&&2<=t.length&&e&&2<=e.length){var n=Math.pow(10,o),r=Qr(t[1]),o=Qr(e[1]),t=Jr(t[0]),e=Jr(e[0]);if(0!=Math.round((r-o)*n)/n)return!1;n=Math.round((t-e)*n)/n;return 0!=n&&360!=n?!1:!0}return!1},mi.fromLatLng=function(r,t,e){var i,s,a,l,c,u,o=[];return"number"==typeof r?(o.push(r),"number"==typeof t&&o.push(t),"number"==typeof e&&o.push(e)):Array.isArray(r)?2<=r.length&&"number"==typeof r[0]&&"number"==typeof r[1]&&(3<=r.length&&"number"==typeof r[2]?o.push(r[0],r[1],r[2]):o.push(r[0],r[1])):"object"==typeof r&&(i=["lat","latitude","y"],s=["lng","longitude","lon","x"],a=["elv","elevation","alt","altitude","z"],u=c=l=NaN,Object.keys(r).forEach(function(t,e,o){var n=t.toLowerCase();isNaN(l)&&0<=i.indexOf(n)&&"number"==typeof r[t]?l=r[t]:isNaN(c)&&0<=s.indexOf(n)&&"number"==typeof r[t]?c=r[t]:isNaN(u)&&0<=a.indexOf(n)&&"number"==typeof r[t]&&(u=r[t])}),isNaN(l)||isNaN(c)||(o.push(c,l),isNaN(u)||o.push(u))),2<=o.length?o:null},mi.fromLatLngs=function(t){var e=[];if(Array.isArray(t))for(var o=0,n=t.length;o<n;o++){var r=mi.fromLatLng(t[o]);r&&e.push(r)}return e},mi._getDimensions=function(t){for(var e=0;Array.isArray(t);)t=t[0],e++;return"number"==typeof t&&e--,e},mi);function mi(t,e,o){return o?fi.call(this,t,e,o)||this:fi.call(this,t,e)||this}var gi=(vi.TYPE="Polygon",vi);function vi(t,e){this.type="Polygon",this.type=vi.TYPE,1===yi._getDimensions(t)?this.coordinates=[t]:this.coordinates=t,this.bbox=e}var _i,wi,Lt=window&&window.__extends||(_i=function(t,e){return(_i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}_i(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),bi=window&&window.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,o=e&&t[e],n=0;if(o)return o.call(t);if(t&&"number"==typeof t.length)return{next:function(){return{value:(t=t&&n>=t.length?void 0:t)&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Si=(Lt(xi,wi=J),xi.prototype.addProperty=function(t,e){tr(this.data.properties[t],e)||(this.data.properties[t]=Uo(e),"subType"!==t&&"radius"!==t||this._handleCircle(),this.dataSource&&this.dataSource._updateSource(),this._invokeEvent("shapechanged",this))},xi.prototype.getBounds=function(){var e,t,o,n,r,i=this.getCoordinates(),s=this.getType();if("Point"===s)r=this.circlePolygon?(a=this.circlePolygon.geometry.coordinates,Ci.fromPositions(a[0])):new Ci(a=i,a);else if("MultiPoint"===s||"LineString"===s){var a=i;r=Ci.fromPositions(a)}else if("Polygon"===s){a=i;r=Ci.fromPositions(a[0])}else if("MultiLineString"===s){a=i;try{for(var l=bi(a),c=l.next();!c.done;c=l.next()){var u=c.value;r=Ci.merge(r,Ci.fromPositions(u))}}catch(t){e={error:t}}finally{try{c&&!c.done&&(t=l.return)&&t.call(l)}finally{if(e)throw e.error}}}else if("MultiPolygon"===s){a=i;try{for(var p=bi(a),h=p.next();!h.done;h=p.next()){var d=h.value;r=Ci.merge(r,Ci.fromPositions(d[0]))}}catch(t){o={error:t}}finally{try{h&&!h.done&&(n=p.return)&&n.call(p)}finally{if(o)throw o.error}}}return r},xi.prototype.getCoordinates=function(){return Uo(this.data.geometry.coordinates)},xi.prototype.getCircleCoordinates=function(){return this.circlePolygon?Uo(this.circlePolygon.geometry.coordinates[0]):null},xi.prototype.getId=function(){return this.data.id},xi.prototype.getProperties=function(){return Uo(this.data.properties)},xi.prototype.getType=function(){return this.data.geometry.type},xi.prototype.isCircle=function(){return xi._isCircle(this.data)},xi.prototype.isRectangle=function(){return xi._isRectangle(this.data)},xi.prototype.setCoordinates=function(t){t="Polygon"===this.getType()&&1===yi._getDimensions(t)?[t]:t;tr(this.data.geometry.coordinates,t)||(this.data.geometry.coordinates=Uo(t),this._handleCircle(),this.dataSource&&this.dataSource._updateSource(),this._invokeEvent("shapechanged",this))},xi.prototype.setProperties=function(t){t[xi._shapeIdPropName]=this.data.id,tr(this.data.properties,t)||(this.data.properties=Uo(t),this._handleCircle(),this.dataSource&&this.dataSource._updateSource(),this._invokeEvent("shapechanged",this))},xi.prototype.toJson=function(){return JSON.parse(JSON.stringify(this.data))},xi.prototype._toJson=function(){return this.circlePolygon||this.data},xi.prototype._setDataSource=function(t){void 0===t||null==t?delete this.dataSource:this.dataSource=t},xi.prototype._handleCircle=function(){var t;this.isCircle()?(t=xi._getCirclePositions(this.data),this.circlePolygon=new nr(new gi([t]),this.data.properties,this.data.id),this.data.properties.subType="Circle"):delete this.circlePolygon},xi._isCircle=function(t){return t&&t.geometry&&"Point"===t.geometry.type&&t.geometry.coordinates&&t.properties&&"string"==typeof t.properties.subType&&"circle"===t.properties.subType.toLowerCase()&&"number"==typeof t.properties.radius},xi._isRectangle=function(t){if("Polygon"===t.geometry.type&&t.geometry.coordinates&&"string"==typeof t.properties.subType&&"rectangle"===t.properties.subType.toLowerCase()){t=t.geometry.coordinates;if(1===t.length){t=t[0];if(5===t.length)return t[0][0]===t[4][0]&&t[0][1]===t[4][1];if(4===t.length)return!0}}return!1},xi._getCirclePositions=function(t){return Vr(t.geometry.coordinates,t.properties.radius,72,"meters")},xi._shapeIdPropName="_azureMapsShapeId",xi);function xi(t,e,o){var n,r,i=wi.call(this)||this;return"Feature"===t.type?(r=Uo((n=t).geometry),o=n.properties?Uo(n.properties):{},e=null==n.id||""===n.id?or():n.id):(r=Uo(t),e=null==e||""===e?or():e,o=o?Uo(o):{}),o[xi._shapeIdPropName]=e,i.data=new nr(r,o,e),i._handleCircle(),i}var Oi,Ti,Et=window&&window.__extends||(Oi=function(t,e){return(Oi=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}Oi(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),Ei=window&&window.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,o=e&&t[e],n=0;if(o)return o.call(t);if(t&&"number"==typeof t.length)return{next:function(){return{value:(t=t&&n>=t.length?void 0:t)&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Ci=(Ti=Array,Et(Pi,Ti),Pi.fromBoundingBox=function(t){var e=Pi.getWest(t),o=Pi.getSouth(t),n=Pi.getEast(t),t=Pi.getNorth(t);return new Pi([e,o,n,t])},Pi.fromDimensions=function(t,e,o){var n=t[0],r=t[1],t=Math.min(Math.max(r+o/2,-85.5),85.5),r=Math.min(Math.max(r-o/2,-85.5),85.5),o=Jr(n+e/2);return new Pi([Jr(n-e/2),r,o,t])},Pi.fromEdges=function(t,e,o,n){return new Pi([t,e,o,n])},Pi.containsPosition=function(t,e){var o=Pi.getCenter(t),n=Math.abs(o[1]-e[1]),o=Math.abs(o[0]-e[0]);180<o&&(o=360-o);e=Pi.getHeight(t),t=Pi.getWidth(t);return n<=e/2+1e-8&&o<=t/2+1e-8},Pi.containsBoundingBox=function(t,e){var o=t&&4===t.length,n=e&&4===e.length;return!(!o||!n)&&(Pi.getWest(t)<Pi.getWest(e)&&Pi.getWest(e)<Pi.getEast(t)&&Pi.getWest(t)<Pi.getEast(e)&&Pi.getEast(e)<Pi.getEast(t)&&Pi.getSouth(t)<Pi.getSouth(e)&&Pi.getSouth(e)<Pi.getNorth(t)&&Pi.getSouth(t)<Pi.getNorth(e)&&Pi.getNorth(e)<Pi.getNorth(t))},Pi.crossesAntimeridian=function(t){return Jr(Pi.getEast(t))-Jr(Pi.getWest(t))<0||Pi.isBoundingBoxWithSixOrMoreElementsLargerThanGlobe(t)||Pi.isBoundingBoxWithLessThanSixElementsLargerThanGlobe(t)},Pi.getCenter=function(t){var e=Jr(Pi.getEast(t)),o=Jr(Pi.getWest(t));e<o&&(e+=360);o=Jr((o+e)/2),e=Qr(Pi.getSouth(t)),t=Qr(Pi.getNorth(t));return[o,Qr((e+t)/2)]},Pi.getHeight=function(t){t=Qr(Pi.getNorth(t))-Qr(Pi.getSouth(t));return isNaN(t)?0:t},Pi.getWidth=function(t){t=Jr(Pi.getEast(t))-Jr(Pi.getWest(t));return isNaN(t)?0:t<0?t+360:t},Pi.getSouthWest=function(t){var e=this.getSouth(t),t=this.getWest(t);return isNaN(e)||isNaN(t)?null:[t,e]},Pi.getNorthEast=function(t){var e=this.getNorth(t),t=this.getEast(t);return isNaN(e)||isNaN(t)?null:[t,e]},Pi.getNorthWest=function(t){var e=this.getNorth(t),t=this.getWest(t);return isNaN(e)||isNaN(t)?null:[t,e]},Pi.getSouthEast=function(t){var e=this.getSouth(t),t=this.getEast(t);return isNaN(e)||isNaN(t)?null:[t,e]},Pi.getSouth=function(t){return t&&4<=t.length?Number(t[1]):NaN},Pi.getWest=function(t){return t&&4<=t.length?Number(t[0]):NaN},Pi.getNorth=function(t){if(t){if(4===t.length)return Number(t[3]);if(6===t.length)return Number(t[4])}return NaN},Pi.getEast=function(t){if(t){if(4===t.length)return Number(t[2]);if(6===t.length)return Number(t[3])}return NaN},Pi.intersect=function(t,e){var o=Pi.getCenter(t),n=Pi.getCenter(e),r=Math.abs(o[1]-n[1]),i=Math.abs(o[0]-n[0]);180<i&&(i=360-i);o=Pi.getHeight(t),n=Pi.getWidth(t),t=Pi.getHeight(e),e=Pi.getWidth(e);return r<=o/2+t/2&&i<=n/2+e/2},Pi.merge=function(t,e){var o=t&&4===t.length,n=e&&4===e.length;if(o&&!n)return t;if(n&&!o)return e;if(!o&&!n)return null;for(var o=Math.max(Qr(Pi.getNorth(t)),Qr(Pi.getNorth(e))),n=Math.min(Qr(Pi.getSouth(t)),Qr(Pi.getSouth(e))),r=[t,e],i=[],s=0,s=0;s<r.length;s++){var a=r[s],l=Jr(Pi.getWest(a)),c=Jr(Pi.getEast(a));Pi.crossesAntimeridian(a)?(i.push([l,180]),i.push([-180,c])):i.push([l,c])}i.sort(function(t,e){return t[0]===e[0]?t[1]-e[1]:t[0]-e[0]});var u=[],p=i[0];for(s=1;s<i.length;){var h=i[s];p[1]>=h[0]?p[1]=Math.max(p[1],h[1]):(u.push(p),p=h),s++}u.push(p);var d=u.length,f=u[0][0]+360-u[d-1][1],y=[u[d-1][1],u[0][0]];for(s=1;s<d;s++){var m=u[s][0]-u[s-1][1];f<m&&(f=m,y=[u[s-1][1],u[s][0]])}return new Pi([y[1],n],[y[0],o])},Pi.fromPositions=function(t){for(var e,o,n=NaN,r=NaN,i=NaN,s=NaN,a=t.length,l=new Array(a),c=0;a--;)(o=t[a])&&2<=o.length&&(e=Qr(o[1]),n=isNaN(n)?e:Math.max(n,e),r=isNaN(r)?e:Math.min(r,e),l[c++]=Jr(o[0]));if(c){l.length=c,l.sort(function(t,e){return t-e});for(var u=l[0]+360-l[c-1],p=0,a=1;a<c;a++){var h=l[a]-l[a-1];u<h&&(u=h,p=a)}i=l[p],s=l[(p||c)-1]}return isNaN(i)||isNaN(r)||isNaN(s)||isNaN(n)?null:new Pi([i,r,s,n])},Pi.fromLatLngs=function(t){return Pi.fromPositions(yi.fromLatLngs(t))},Pi.fromData=function(t){var e,o,n=null;if(Array.isArray(t)&&0<t.length){try{for(var r=Ei(t),i=r.next();!i.done;i=r.next()){var s,a=i.value;null!=(s=Pi.fromData(a))&&(n=null===n?s:Pi.merge(n,s))}}catch(t){e={error:t}}finally{try{i&&!i.done&&(o=r.return)&&o.call(r)}finally{if(e)throw e.error}}return n}if(t instanceof Si)return t.getBounds();if(t&&t.type){var l=t;if(l.bbox&&4===l.bbox.length)return l.bbox;switch(l.type){case"FeatureCollection":return Pi.fromData(l.features);case"Feature":return Si._isCircle(l)?Pi.fromPositions(Si._getCirclePositions(l)):Pi.fromData(l.geometry);case"GeometryCollection":return Pi.fromData(l.geometries);case"Point":var c=l.coordinates;if(c&&2<=c.length)return[c[0],c[1],c[0],c[1]];break;case"LineString":case"MultiPoint":return Pi.fromPositions(l.coordinates);case"Polygon":case"MultiLineString":var u=l.coordinates;if(u&&0<u.length){for(var p=0,h=u.length;p<h;p++)null!=(s=Pi.fromPositions(u[p]))&&(n=null===n?s:Pi.merge(n,s));if(null!=n)return n}break;case"MultiPolygon":var d=l.coordinates;if(d&&0<d.length){for(p=0,h=d.length;p<h;p++)for(var f=0,y=d[p].length;f<y;f++)null!=(s=Pi.fromPositions(d[p][f]))&&(n=null===n?s:Pi.merge(n,s));return n}}}return null},Pi.splitOnAntimeridian=function(t){var e,o,n,r,i,s,a=[];return Pi.isBoundingBoxWithSixOrMoreElementsLargerThanGlobe(t)?[[-180,t[1],t[2],180,t[4],t[5]]]:Pi.isBoundingBoxWithLessThanSixElementsLargerThanGlobe(t)?[[-180,t[1],180,t[3]]]:(Pi.crossesAntimeridian(t)?(s=e=void 0,o=Jr(Pi.getWest(t)),n=Jr(Pi.getEast(t)),r=Qr(Pi.getNorth(t)),i=Qr(Pi.getSouth(t)),s=6<=t.length?(e=[o,i,t[2],180,r,t[5]],[-180,i,t[2],n,r,t[5]]):(e=[o,i,180,r],[-180,i,n,r]),a.push(e,s)):a.push(t),a)},Pi.isBoundingBoxWithSixOrMoreElementsLargerThanGlobe=function(t){return 6<=t.length&&360<t[3]-t[0]},Pi.isBoundingBoxWithLessThanSixElementsLargerThanGlobe=function(t){return t.length<6&&360<t[2]-t[0]},Pi);function Pi(t,e){var o,n=this;return t&&e?n=(o=t)[2]&&e[2]?Ti.call(this,o[0],o[1],o[2]||0,e[0],e[1],e[2]||0)||this:Ti.call(this,o[0],o[1],e[0],e[1])||this:!t||(t=t)&&(4===t.length?n=Ti.call(this,t[0],t[1],t[2],t[3])||this:6<=t.length&&(n=Ti.call(this,t[0],t[1],t[2],t[3],t[4],t[5])||this)),n}var ki=(Ai.TYPE="FeatureCollection",Ai);function Ai(t,e){this.type="FeatureCollection",this.type=Ai.TYPE,this.features=t,this.bbox=e}Li.TYPE="GeometryCollection",Z=Li;function Li(t){this.type="GeometryCollection",this.type=Li.TYPE,this.geometries=t}Ii.TYPE="LineString",At=Ii;function Ii(t,e){this.type="LineString",this.type=Ii.TYPE,this.coordinates=t,this.bbox=e}Ri.TYPE="MultiLineString",Ot=Ri;function Ri(t,e){this.type="MultiLineString",this.type=Ri.TYPE,this.coordinates=t,this.bbox=e}Ni.TYPE="MultiPoint",xt=Ni;function Ni(t,e){this.type="MultiPoint",this.type=Ni.TYPE,this.coordinates=t,this.bbox=e}Mi.TYPE="MultiPolygon",I=Mi;function Mi(t,e){this.type="MultiPolygon",this.type=Mi.TYPE,this.coordinates=t,this.bbox=e}var ji,Di,Lt=window&&window.__extends||(ji=function(t,e){return(ji=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}ji(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),Et=(Di=Array,Lt(zi,Di),zi.fromPosition=function(t){return 2<=t.length?new zi((180+t[0])/360,zi._latToMercatorY(t[1]),3<=t.length?zi._altitudeToMercatorZ(t[2],t[1]):0):[0,0,0]},zi.fromPositions=function(t){for(var e=[],o=0,n=t.length;o<n;o++)e.push(this.fromPosition(t[o]));return e},zi.toFloat32Array=function(t){for(var e=new Float32Array(3*t.length),o=0,n=t.length;o<n;o++){var r=3*o,i=t[o];e[r]=(180+i[0])/360,e[1+r]=zi._latToMercatorY(i[1]),e[2+r]=3<=i.length?zi._altitudeToMercatorZ(i[2],i[1]):0}return e},zi.toPosition=function(t){if(2<=t.length){var e=360/Math.PI*Math.atan(Math.exp((180-360*t[1])*Math.PI/180))-90;return new yi(360*t[0]-180,e,3<=t.length?zi._mercatorZToAltitude(t[2],t[1]):0)}return[0,0,0]},zi.toPositions=function(t){for(var e=[],o=0,n=t.length;o<n;o++)e.push(this.toPosition(t[o]));return e},zi.mercatorScale=function(t){return 1/Math.cos(t*Math.PI/180)},zi.meterInMercatorUnits=function(t){return 1/zi.earthCircumference*zi.mercatorScale(zi._latToMercatorY(t))},zi._circumferenceAtLatitude=function(t){return zi.earthCircumference*Math.cos(t*Math.PI/180)},zi._altitudeToMercatorZ=function(t,e){return t/zi._circumferenceAtLatitude(e)},zi._mercatorZToAltitude=function(t,e){return t*zi._circumferenceAtLatitude(zi._latToMercatorY(e))},zi._latToMercatorY=function(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360},zi.earthCircumference=2*Math.PI*Fr(),zi);function zi(t,e,o){return Di.call(this,t,e,o||0)||this}var Bi,Lt=Object.freeze({__proto__:null,Feature:nr,FeatureCollection:ki,LineString:At,Point:cr,Polygon:gi,Position:yi,BoundingBox:Ci,MercatorPoint:Et,MultiLineString:Ot,MultiPoint:xt,MultiPolygon:I,GeometryCollection:Z}),Fi=It(function(t,e){function y(t,e){return t*t+e*e}function i(t,e){for(var o,n,r,i=t[0],s=[i],a=1,l=t.length;a<l;a++)o=t[a],r=i,y((n=o)[0]-r[0],n[1]-r[1])>e&&(s.push(o),i=o);return i!==o&&s.push(o),s}function m(t,e,o,n,r){for(var i,s,a,l,c,u,p,h=n,d=e+1;d<o;d++){var f=(s=t[d],a=t[e],l=t[o],p=u=f=c=void 0,c=a[0],f=a[1],u=l[0]-c,p=l[1]-f,0==u&&0==p||(1<(a=((s[0]-c)*u+(s[1]-f)*p)/y(u,p))?(c=l[0],f=l[1]):0<a&&(c+=u*a,f+=p*a)),y(s[0]-c,s[1]-f));h<f&&(i=d,h=f)}n<h&&(1<i-e&&m(t,e,i,n,r),r.push(t[i]),1<o-i&&m(t,i,o,n,r))}e.__esModule=!0,e.SimplifyAP=function(t,e,o){if(t.length<=2)return t;var n,r=(e=void 0===e?1:e)*e;return t=(o=void 0===o?!1:o)?t:i(t,r),e=(n=t).length-1,o=[n[0]],m(n,0,e,r,o),o.push(n[e]),t=o}});(Bi=Fi)&&Bi.__esModule&&Object.prototype.hasOwnProperty.call(Bi,"default")&&Bi.default;var Ui=Fi.SimplifyAP;var qi=window&&window.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,o=e&&t[e],n=0;if(o)return o.call(t);if(t&&"number"==typeof t.length)return{next:function(){return{value:(t=t&&n>=t.length?void 0:t)&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Gi=(Zi.prototype.toTarget=function(t,e){return this.transformArray(t,this.M,e)},Zi.prototype.toSource=function(t,e){return this.transformArray(t,this.inverseM,e)},Zi.prototype.transformArray=function(t,e,o){var n,r;if(t&&Array.isArray(t)&&Array.isArray(t[0])){var i=[];try{for(var s=qi(t),a=s.next();!a.done;a=s.next()){var l=a.value;i.push(this.transform(l,e,o))}}catch(t){n={error:t}}finally{try{a&&!a.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return i}return null},Zi.prototype.transform=function(t,e,o){var n=t[0]*e[0][3]+t[1]*e[1][3]+e[2][3],e=t[0]*e[0][4]+t[1]*e[1][4]+e[2][4];return"number"==typeof o&&0<=o?[jr(n,o),jr(e,o)]:[jr(n,6),jr(e,6)]},Zi._calculateAffineTransform=function(t,e){if(t.length!==e.length||t.length<1)throw new Error("Error: source and target arrays must have the same length.");var o=Math.min(t[0].length,e[0].length),n=o+1;if(t.length<o)throw new Error("Erorr: At least "+o+" reference points required.");for(var r=[],i=[],s=0;s<n;s++){i[s]=[];for(var a=0;a<n;a++){a<o&&(r[a]=0);for(var l=i[s][a]=0;l<t.length;l++)a<o&&(r[a]+=s<o?t[l][s]*e[l][a]:e[l][a]),i[s][a]+=o<=s&&o<=a?1:o<=s?t[l][a]:o<=a?t[l][s]:t[l][s]*t[l][a]}i[s]=i[s].concat(r)}if(!this._gaussJordanElimination(i))throw new Error("Error: Singular matrix. Points are likely coplanar.");return i},Zi._gaussJordanElimination=function(t){for(var e,o=t.length,n=2*o-1,r=0;r<o;r++){for(var i=r,s=r+1;s<o;s++)Math.abs(t[s][r])>Math.abs(t[i][r])&&(i=s);if(e=t[i],t[i]=t[r],t[r]=e,Math.abs(t[r][r])<=1e-12)return!1;for(var a=r+1;a<o;a++)for(var l=t[a][r]/t[r][r],c=r;c<n;c++)t[a][c]-=t[r][c]*l}for(r=o-1;-1<r;r--){l=t[r][r];for(s=0;s<r;s++)for(var u=n-1;r-1<u;u--)t[s][u]-=t[r][u]*t[s][r]/l;t[r][r]/=l;for(var p=o;p<n;p++)t[r][p]/=l}return!0},Zi);function Zi(t,e){this.M=Zi._calculateAffineTransform(t,e),this.inverseM=Zi._calculateAffineTransform(e,t)}var Hi,Ki,At=Object.freeze({__proto__:null,AffineTransform:Gi,WEBMERCATOR_MAXLAT:Sr,_precision:jr,get AreaUnits(){return pr},get DistanceUnits(){return hr},get TimeUnits(){return dr},get SpeedUnits(){return fr},get AccelerationUnits(){return yr},boundingBoxToPolygon:function(t){var e=Jr(Ci.getWest(t)),o=Jr(Ci.getEast(t)),n=Qr(Ci.getNorth(t)),r=Qr(Ci.getSouth(t)),t=Ci.getCenter(t),n=[[e,n],[e,r],[t[0],r],[o,r],[o,n],[t[0],n],[e,n]];return new gi([n])},convertDistance:Dr,getCardinalSpline:function(t,e,o,n){if(!t||t.length<=2)return i;"number"!=typeof e&&(e=.5),("number"!=typeof o||o<=0)&&(o=15);var r=t.length,i=t.slice(0);n?(yi.areEqual(i[0],i[r-1])&&(i.pop(),r--),i.unshift(t[r-1]),i.push(t[0]),i.push(t[1]),r++):(i.unshift(t[0]),i.push(t[r-1]));var s,a,l,c=[];c.push([1,0,0,0]);for(var u=1;u<o-1;u++)c.push([2*(l=(s=u/o)*(a=s*s))-3*a+1,-2*l+3*a,l-2*a+s,l-a]);c.push([0,1,0,0]);for(var p,h,d,f,y,m,g=[],u=1;u<r;u++)for(p=e*(i[u+1][0]-i[u-1][0]),h=e*(i[u+1][1]-i[u-1][1]),d=e*(i[u+2][0]-i[u][0]),f=e*(i[u+2][1]-i[u][1]),s=0;s<o;s++)m=(y=c[s])[0]*i[u][0]+y[1]*i[u+1][0]+y[2]*p+y[3]*d,y=Tr(y[0]*i[u][1]+y[1]*i[u+1][1]+y[2]*h+y[3]*f,-85,85),g.push([m,y]);return g},getDestination:zr,getDistanceTo:Br,getEarthRadius:Fr,getPathDenormalizedAtAntimerian:qr,getPathSplitByAntimeridian:Gr,getGeodesicPath:function(t,e){var o;(!e||e<=0)&&(e=15),Array.isArray(t)?o=t:t.type&&"LineString"===t.type&&(o=t.coordinates);for(var n=o.length-1,r=[],i=0;i<n;i++)r=r.concat(Ur(o[i],o[i+1],e));return qr(r)},getGeodesicPaths:function(t,e){var o;(!e||e<=0)&&(e=15),Array.isArray(t)?o=t:t.type&&"LineString"===t.type&&(o=t.coordinates);for(var n=o.length-1,r=[],i=[],s=0;s<n;s++)for(var a,l,c,u,p,h=Ur(o[s],o[s+1],e),d=0;d<h.length;d++)r.push(h[d]),d+1>=h.length||(a=(c=mr(h[d],2))[0],l=c[1],p=(u=mr(h[d+1],2))[0],c=u[1],180<Math.abs(p-a)&&(u=0<a?180:-180,p=Math.abs((0<a?p+360:p-360)-a),p=l+(c-l)*(Math.abs(u-a)/p),r.push([u,p]),i.push(r),r=[[-u,p]]));return i.push(r),i},getHeading:Zr,getLengthOfPath:Hr,getPositionAlongPath:Kr,getRegularPolygonPath:Vr,getRegularPolygonPaths:function(t,e,o,n,r){return Gr(Wr(t,e,o,n,r))},interpolate:Yr,normalizeLatitude:Qr,normalizeLongitude:Jr,rotatePositions:Xr,getPixelHeading:function(t,e){t=ui(t),e=ui(e);var t=(o=mr(ti([t,e],21),2))[0],o=(e=o[1])[0]-t[0],e=t[1]-e[1];return(2.5*Math.PI-Math.atan2(e,o))*wr%360},mercatorPixelsToPositions:$r,mercatorPositionsToPixels:ti,convertAcceleration:ei,convertArea:oi,convertSpeed:ni,convertTimespan:ri,getAcceleration:ii,getAccelerationFromSpeeds:si,getAccelerationFromFeatures:function(t,e,o,n,r,i,s){if("string"==typeof o&&"Feature"===t.type&&"Point"===t.geometry.type&&"Feature"===e.type&&"Point"===e.geometry.type){var a=ai(t.properties[o],e.properties[o],dr.seconds);if(!isNaN(a)){var l=0;if(n&&"string"==typeof n){o=t.properties[n],n=e.properties[n];if("number"==typeof o&&(l=o,"number"==typeof n))return si(o,n,a,r,dr.seconds,i,s)}return ii(l,Br(t.geometry.coordinates,e.geometry.coordinates,hr.meters),a,r,hr.meters,dr.seconds,i,s)}}return NaN},getArea:function t(e,o,n){if(e){var r=0;switch((e=e instanceof Si?e.toJson():e).type){case"Feature":var i=e;if(e.geometry)return t(i.geometry,o,n);break;case"Polygon":(i=e).coordinates&&(r=Ir(i.coordinates));break;case"MultiPolygon":var s=e;if(s.coordinates)for(var a=0,l=s.coordinates.length;a<l;a++)r+=Ir(s.coordinates[a])}return oi(r,pr.squareMeters,o,n)}return 0},getSpeed:function(t,e,o,n,r,i){if(t=ui(t),e=ui(e),t&&e){n=ri(o,n,dr.seconds);return ni(Br(t,e,hr.meters)/n,fr.metersPerSecond,r,i)}return 0},getSpeedFromFeatures:function(t,e,o,n,r){if("string"==typeof o&&"Feature"===t.type&&"Point"===t.geometry.type&&"Feature"===e.type&&"Point"===e.geometry.type){o=this.getTimespan(t.properties[o],e.properties[o],dr.seconds);if(!isNaN(o)){e=this.getDistanceTo(t.geometry.coordinates,e.geometry.coordinates,hr.meters);return this.convertSpeed(e/o,fr.metersPerSecond,n,r)}}return NaN},getTimespan:ai,getTravelDistance:function(t,e,o,n,r,i,s,a){return e=this.convertTimespan(e,r,dr.seconds),o=(o=this.convertSpeed(o,i,fr.metersPerSecond))*e,"number"==typeof n&&(o+=.5*this.convertAcceleration(n,s,yr.metersPerSecondSquared)*e*e),this.convertDistance(o,hr.meters,t,a)},parseTimestamp:li,getConvexHull:function(t){var e,o,n=ci(t).map(function(t){return[Jr(t[0]),Qr(t[1])]});n.sort(function(t,e){return t[0]===e[0]?t[1]-e[1]:t[0]-e[0]});var r=[];try{for(var i=gr(n),s=i.next();!s.done;s=i.next()){for(var a=s.value;2<=r.length&&Nr(r[r.length-2],r[r.length-1],a)<=0;)r.pop();r.push(a)}}catch(t){e={error:t}}finally{try{s&&!s.done&&(o=i.return)&&o.call(i)}finally{if(e)throw e.error}}for(var l=[],c=n.length-1;0<=c;c--){for(;2<=l.length&&Nr(l[l.length-2],l[l.length-1],n[c])<=0;)l.pop();l.push(n[c])}return new gi([r.concat(l)])},getPositions:ci,getPosition:ui,getPositionsAlongPath:function(t,e){if(e<2)return[];for(var o=[],n=Hr(t,hr.meters)/(e-1),r=0;r<e;r++){var i=Kr(t,n*r,hr.meters);null!=i&&o.push(i)}return o},getPointWithHeadingAlongPath:pi,getPointsWithHeadingsAlongPath:function(t,e){if(e<=0)return[];for(var o=[],n=Hr(t,hr.meters)/(e-1),r=0;r<e;r++){var i=pi(t,n*r,hr.meters);null!=i&&o.push(i)}return o},getClosestPointOnGeometry:hi,simplify:function(t,e){return Ui(t,e,!0)}}),Wi=((window&&window.__extends||(Hi=function(t,e){return(Hi=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}Hi(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(Vi,Ki=P),Vi);function Vi(){var t=null!==Ki&&Ki.apply(this,arguments)||this;return t.zoomDelta=1,t.style=u.ControlStyle.light,t}var Yi,Qi,Et=((window&&window.__extends||(Yi=function(t,e){return(Yi=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}Yi(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(Ji,Qi=ot),Ji.prototype.onAdd=function(t){this.container=this.buildContainer(t,this.options.style,"Zoom Control"),this.container.style.flexDirection="column",this.zoomInButton=this.constructZoomInButton(t),this.zoomOutButton=this.constructZoomOutButton(t);var e=U("Zoom In"),o=U("Zoom Out");return this.container.appendChild(this.zoomInButton),this.container.appendChild(e),this.container.appendChild(this.zoomOutButton),this.container.appendChild(o),q(e,this.zoomInButton),q(o,this.zoomOutButton),t.events.add("zoom",this.zoomChanged),t.events.add("minzoomchanged",this.minZoomChanged),t.events.add("maxzoomchanged",this.maxZoomChanged),this.map=t,this.container},Ji.prototype.onRemove=function(){Qi.prototype.onRemove.call(this),this.map&&(this.map.events.remove("zoom",this.zoomChanged),this.map.events.remove("minzoomchanged",this.minZoomChanged),this.map.events.remove("maxzoomchanged",this.maxZoomChanged),this.map=null),this.container&&(this.container.remove(),this.container=null,this.zoomInButton=null,this.zoomOutButton=null)},Ji.prototype.updateZoomButtonsState=function(){var t=this.map.getCamera().zoom>=this.map._getMap().getMaxZoom(),e=Ci.getSouth(this.map.getCamera().bounds)<=-Sr&&Ci.getNorth(this.map.getCamera().bounds)>=Sr,e=this.map.getCamera().zoom<=this.map._getMap().getMinZoom()||e;this.zoomInButton&&this.zoomInButton.disabled!=t&&(this.zoomInButton.disabled=t,this.zoomInButton.setAttribute("aria-label",t?"Zoom In disabled":"Zoom In")),this.zoomOutButton&&this.zoomOutButton.disabled!=e&&(this.zoomOutButton.disabled=e,this.zoomInButton.setAttribute("aria-label",t?"Zoom Out disabled":"Zoom Out"))},Ji.prototype.constructZoomInButton=function(t){var e=this,o=document.createElement("button");return o.classList.add("azure-maps-control-button"),o.classList.add("zoom-in"),o.setAttribute("aria-label","Zoom In"),o.setAttribute("alt","Zoom In"),o.setAttribute("type","button"),o.addEventListener("click",function(){t.setCamera({zoom:t.getCamera().zoom+e.options.zoomDelta,duration:Ji.ZOOM_DURATION_MS,type:"ease"},!0)}),o},Ji.prototype.constructZoomOutButton=function(t){var e=this,o=document.createElement("button");return o.classList.add("azure-maps-control-button"),o.classList.add("zoom-out"),o.setAttribute("aria-label","Zoom Out"),o.setAttribute("alt","Zoom Out"),o.setAttribute("type","button"),o.addEventListener("click",function(){t.setCamera({zoom:t.getCamera().zoom-e.options.zoomDelta,duration:Ji.ZOOM_DURATION_MS,type:"ease"},!0)}),o},Ji.ZOOM_DURATION_MS=200,Ji);function Ji(t){var e=Qi.call(this)||this;return e.container=null,e.zoomInButton=null,e.zoomOutButton=null,e.zoomChanged=function(t){return e.updateZoomButtonsState()},e.minZoomChanged=function(t){return e.updateZoomButtonsState()},e.maxZoomChanged=function(t){return e.updateZoomButtonsState()},e.options=(new Wi).merge(t),e}Ot=Object.freeze({__proto__:null,ControlBase:ot,PitchControl:vt,CompassControl:ut,ZoomControl:Et,StyleControl:Nt,TrafficControl:An,TrafficLegendControl:kt});var Xi,$i,ts=function(t,e){return Fo(t,5,e="function"==typeof e?e:void 0)},es=((window&&window.__extends||(Xi=function(t,e){return(Xi=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}Xi(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(os,$i=P),os);function os(){var t=null!==$i&&$i.apply(this,arguments)||this;return t.buffer=128,t.maxZoom=18,t.cluster=!1,t.clusterRadius=50,t.clusterMaxZoom=void 0,t.clusterProperties=void 0,t.lineMetrics=!1,t.tolerance=.375,t}var ns,rs,is=((window&&window.__extends||(ns=function(t,e){return(ns=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}ns(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(ss,rs=J),ss.prototype.getId=function(){return this.id},ss.prototype._setMap=function(t){var e;null==t||void 0===t?(e=this.map,delete this.map,this._invokeEvent("sourceremoved",this),e&&e.events.invoke("sourceremoved",this)):(this.map=t,this._invokeEvent("sourceadded",this),this.map.events.invoke("sourceadded",this))},ss);function ss(t){var e=rs.call(this)||this;return e.id=t||or(),e}var as,ls,xt=window&&window.__extends||(as=function(t,e){return(as=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}as(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),cs=window&&window.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,o=e&&t[e],n=0;if(o)return o.call(t);if(t&&"number"==typeof t.length)return{next:function(){return{value:(t=t&&n>=t.length?void 0:t)&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},us=(xt(ps,ls=is),ps.prototype.add=function(t,e){this._addNoUpdate(t,e),this._updateSource()},ps.prototype.clear=function(){this._clearNoUpdate(),this._updateSource()},ps.prototype.dispose=function(){this.options=null,this.shapes=null,this.shapesMap=null,this.map=null},ps.prototype.getClusterExpansionZoom=function(e){var r=this;return new Promise(function(o,n){var t;r.map?(t=r.map._getMap().getSource(r.getId()))&&"geojson"===t.type&&t.getClusterExpansionZoom(e,function(t,e){t?n(t):"number"==typeof e&&o(e)}):n("The DataSource hasn't been added to a map.")})},ps.prototype.getClusterChildren=function(e){var r=this;return new Promise(function(o,n){var t;r.map?(t=r.map._getMap().getSource(r.getId()))&&"geojson"===t.type&&t.getClusterChildren(e,function(t,e){t?n(t):e&&o(r.map.sources._mapFeaturesToShapes(e,!1,r))}):n("The DataSource hasn't been added to a map.")})},ps.prototype.getClusterLeaves=function(e,r,i){var s=this;return new Promise(function(o,n){var t;s.map?(t=s.map._getMap().getSource(s.getId()))&&"geojson"===t.type&&t.getClusterLeaves(e,r,i,function(t,e){t?n(t):e&&o(s.map.sources._mapFeaturesToShapes(e,!1,s))}):n("The DataSource hasn't been added to a map.")})},ps.prototype.getOptions=function(){return Uo(this.options)},ps.prototype.getShapes=function(){return Array.from(this.shapes)},ps.prototype.importDataFromUrl=function(t){var e=this;return fetch(t,{method:"GET",mode:"cors"}).then(function(t){if(t.ok)return t.json();throw new Error("HTTP "+t.status+": "+t.statusText)}).then(function(t){e.add(t)})},ps.prototype.getShapeById=function(t){return this.shapes[this.shapesMap.get(t)]||null},ps.prototype.remove=function(t){var e,o,t=Array.isArray(t)?t:[t];try{for(var n=cs(t),r=n.next();!r.done;r=n.next()){var i=r.value;"number"==typeof i?this._removeByIndex(i):this._removeById(i)}}catch(t){e={error:t}}finally{try{r&&!r.done&&(o=n.return)&&o.call(n)}finally{if(e)throw e.error}}this._updateSource()},ps.prototype.removeById=function(t){var e,o,t=Array.isArray(t)?t:[t];try{for(var n=cs(t),r=n.next();!r.done;r=n.next()){var i=r.value;this._removeById(i)}}catch(t){e={error:t}}finally{try{r&&!r.done&&(o=n.return)&&o.call(n)}finally{if(e)throw e.error}}this._updateSource()},ps.prototype.setOptions=function(t){t=(new es).merge(this.options,Uo(t));tr(this.options,t)||(this._invokeEvent("datasourceupdated",this),this.options=t,this.map&&this.map._rebuildStyle())},ps.prototype.setShapes=function(t){this._clearNoUpdate(),this.add(t)},ps.prototype.toJson=function(){return new ki(this.shapes.map(function(t){return t.toJson()}))},ps.prototype._toJson=function(){return new ki(this.shapes.map(function(t){return t._toJson()}))},ps.prototype._buildSource=function(){var t={type:"geojson",data:this._toJson(),maxzoom:this.options.maxZoom,cluster:this.options.cluster,clusterRadius:this.options.clusterRadius,tolerance:this.options.tolerance,lineMetrics:this.options.lineMetrics,clusterProperties:this.options.clusterProperties,buffer:this.options.buffer};return"number"==typeof this.options.clusterMaxZoom&&(t.clusterMaxZoom=this.options.clusterMaxZoom),t},ps.prototype._addNoUpdate=function(t,e){var o;t instanceof Si?(this._addToSources(t,e),o=[t]):Array.isArray(t)?(o=t.map(function(t){return t instanceof Si?t:new Si(t)}),this._addToSources(o,e)):"FeatureCollection"===t.type?(o=t.features.map(function(t){return new Si(t)}),this._addToSources(o,e)):"GeometryCollection"===t.type?(o=t.geometries.map(function(t){return new Si(t)}),this._addToSources(o,e)):(t=new Si(t),this._addToSources(t,e),o=[t]),this._invokeEvent("dataadded",o)},ps.prototype._clearNoUpdate=function(){var t=this.shapes;this.shapes=[],this.shapesMap=new Q,t&&0<t.length&&this._invokeEvent("dataremoved",t)},ps.prototype._updateSource=function(){var t=this;void 0!==this.requestId||(this.requestId=requestAnimationFrame(function(){t._updateMboxSource(),t.requestId=void 0}))},ps.prototype._addToSources=function(t,e){var o,n,r,i;if(t=Array.isArray(t)?t:[t],"number"!=typeof e)try{for(var s=cs(t),a=s.next();!a.done;a=s.next()){var l=a.value;this.shapes.push(l),this.shapesMap.set(l.getId(),this.shapes.length-1)}}catch(t){o={error:t}}finally{try{a&&!a.done&&(n=s.return)&&n.call(s)}finally{if(o)throw o.error}}else for(var c=t.length-1;0<=c;c--)this.shapes.splice(e,0,t[c]),this._updateShapesMap(e);try{for(var u=cs(t),p=u.next();!p.done;p=u.next())(l=p.value)._setDataSource(this)}catch(t){r={error:t}}finally{try{p&&!p.done&&(i=u.return)&&i.call(u)}finally{if(r)throw r.error}}},ps.prototype._removeById=function(t){var e=t instanceof Si?t.getId():"string"==typeof t||"number"==typeof t?t:t.id,t=this.shapes[this.shapesMap.get(e)];t&&(t._setDataSource(null),this.shapes.splice(this.shapesMap.get(e),1),this._updateShapesMap(this.shapesMap.get(e)),this.shapesMap.delete(e),this._invokeEvent("dataremoved",[t]))},ps.prototype._removeByIndex=function(t){var e;if(t>=this.shapes.length)throw new Error("The specified remove index '"+t+"' is greater than the maximum possible index '"+(this.shapes.length-1)+"'");e=this.shapes[t],this.shapesMap.delete(e.getId()),e._setDataSource(null),this.shapes.splice(t,1),this._updateShapesMap(t),this._invokeEvent("dataremoved",[e])},ps.prototype._updateShapesMap=function(t){for(var e=t;e<this.shapes.length;e++)this.shapesMap.set(this.shapes[e].getId(),e)},ps.prototype._updateMboxSource=function(){var t;this.map&&this.map._getMap()&&((t=this.map._getMap().getSource(this.getId()))&&"geojson"===t.type&&t.setData(this._toJson()))},ps);function ps(t,e){t=ls.call(this,t)||this;return t.requestId=void 0,t.options=(new es).merge(Uo(e)),t.shapes=[],t.shapesMap=new Q,t}var hs,ds,fs=((window&&window.__extends||(hs=function(t,e){return(hs=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}hs(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(ys,ds=P),ys);function ys(){var t=null!==ds&&ds.apply(this,arguments)||this;return t.bounds=void 0,t.minZoom=0,t.maxZoom=22,t.isTMS=!1,t.tiles=void 0,t.url=void 0,t}var ms,gs,vs=((window&&window.__extends||(ms=function(t,e){return(ms=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}ms(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(_s,gs=is),_s.prototype.getOptions=function(){return Uo(this.options)},_s.prototype.getShape=function(t,e){return this.map._getMap().querySourceFeatures(this.getId(),{sourceLayer:t,filter:e})},_s.prototype._buildSource=function(){var t={type:"vector"};return this.options.bounds&&(t.bounds=this.options.bounds),this.options.tiles?(t.tiles=this.options.tiles,t.minzoom=this.options.minZoom,t.maxzoom=this.options.maxZoom):this.options.url&&(t.url=this.options.url),this.options.isTMS&&(t.scheme="tms"),t},_s);function _s(t,e){t=gs.call(this,t)||this;return t.options=(new fs).merge(Uo(e)),t}var ws,bs,I=Object.freeze({__proto__:null,Source:is,DataSource:us,VectorTileSource:vs}),Ss=((window&&window.__extends||(ws=function(t,e){return(ws=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}ws(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(xs,bs=J),xs.prototype.getId=function(){return this.id},xs.prototype.getMap=function(){return this.map||null},xs.prototype.onAdd=function(t){this.map=t,this._invokeEvent("layeradded",this),this.map.events.invoke("layeradded",this)},xs.prototype.onRemove=function(){var t=this.map;delete this.map,this._invokeEvent("layerremoved",this),t&&t.events.invoke("layerremoved",this)},xs._isMBoxEvent=function(t){return!this.LayerEvents.hasOwnProperty(t)},xs.prototype._updateBaseProperties=function(t,e){this._updateFilter(t.filter,e.filter),this._updateZoomRange(t.minZoom,e.minZoom,t.maxZoom,e.maxZoom),this._updateLayoutProperty("visibility",t.visible,e.visible,t.visible?"visible":"none")},xs.prototype._updateFilter=function(t,e){tr(t,e)||this.map._getMap().setFilter(this.id,t)},xs.prototype._updatePaintProperty=function(t,e,o,n){tr(e,o)||this.map._getMap().setPaintProperty(this.id,t,n||e)},xs.prototype._updateLayoutProperty=function(t,e,o,n){tr(e,o)||this.map._getMap().setLayoutProperty(this.id,t,n||e)},xs.prototype._updateZoomRange=function(t,e,o,n){t===e&&n===o||this.map._getMap().setLayerZoomRange(this.id,t,o)},xs.LayerEvents={layeradded:void 0,layerremoved:void 0},xs);function xs(t){var e=bs.call(this)||this;return e.id=t||or(),e}var Os,Ts,Z=((window&&window.__extends||(Os=function(t,e){return(Os=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}Os(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(Es,Ts=P),Es._cloneCustomizer=function(t){if(t instanceof is)return t},Es);function Es(){var t=null!==Ts&&Ts.apply(this,arguments)||this;return t.filter=void 0,t.minZoom=0,t.maxZoom=24,t.visible=!0,t}var Cs,Ps,ks=((window&&window.__extends||(Cs=function(t,e){return(Cs=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}Cs(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(As,Ps=Z),As);function As(){var t=null!==Ps&&Ps.apply(this,arguments)||this;return t.source=void 0,t.sourceLayer=void 0,t.color="#1A73AA",t.blur=0,t.opacity=1,t.strokeColor="#FFFFFF",t.strokeOpacity=1,t.strokeWidth=2,t.pitchAlignment="viewport",t.radius=8,t}var Ls,Is,Rs=((window&&window.__extends||(Ls=function(t,e){return(Ls=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}Ls(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(Ns,Is=Ss),Ns.prototype.getOptions=function(){return ts(this.options,ks._cloneCustomizer)},Ns.prototype.getSource=function(){return this.options.source},Ns.prototype.setOptions=function(t){t=(new ks).merge(this.options,ts(t,ks._cloneCustomizer));if(this.map){if(t.source!==this.options.source||t.sourceLayer!==this.options.sourceLayer)return this.options=t,void this.map.layers.add(this);this._updateBaseProperties(t,this.options),this._updatePaintProperty("circle-blur",t.blur,this.options.blur),this._updatePaintProperty("circle-color",t.color,this.options.color),this._updatePaintProperty("circle-opacity",t.opacity,this.options.opacity),this._updatePaintProperty("circle-radius",t.radius,this.options.radius),this._updatePaintProperty("circle-stroke-color",t.strokeColor,this.options.strokeColor),this._updatePaintProperty("circle-stroke-opacity",t.strokeOpacity,this.options.strokeOpacity),this._updatePaintProperty("circle-stroke-width",t.strokeWidth,this.options.strokeWidth),this._updatePaintProperty("circle-pitch-alignment",t.pitchAlignment,this.options.pitchAlignment)}this.options=t},Ns.prototype._buildLayers=function(){var t={id:this.id,type:"circle",source:this.options.source instanceof is?this.options.source.getId():this.options.source,layout:{visibility:this.options.visible?"visible":"none"},paint:{"circle-color":this.options.color,"circle-blur":this.options.blur,"circle-opacity":this.options.opacity,"circle-stroke-color":this.options.strokeColor,"circle-stroke-opacity":this.options.strokeOpacity,"circle-stroke-width":this.options.strokeWidth,"circle-pitch-alignment":this.options.pitchAlignment,"circle-radius":this.options.radius},minzoom:this.options.minZoom,maxzoom:this.options.maxZoom};return this.options.filter&&(t.filter=this.options.filter),this.options.sourceLayer&&(t["source-layer"]=this.options.sourceLayer),[t]},Ns.prototype._getLayerIds=function(){return[this.id]},Ns.prototype._getSourceIds=function(){var t=new Set;return this.options.source instanceof is?t.add(this.options.source.getId()):t.add(this.options.source),t},Ns);function Ns(t,e,o){e=Is.call(this,e)||this;return e.options=(new ks).merge(ts(o,ks._cloneCustomizer)),e.options.source=t||e.options.source,e}var Ms,js,Ds=((window&&window.__extends||(Ms=function(t,e){return(Ms=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}Ms(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(zs,js=Z),zs._cloneCustomizer=function(t){if(t instanceof is)return t},zs);function zs(){var t=null!==js&&js.apply(this,arguments)||this;return t.source=void 0,t.sourceLayer=void 0,t.color=["interpolate",["linear"],["heatmap-density"],0,"rgba(0,0, 255,0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],t.intensity=1,t.opacity=1,t.radius=30,t.weight=1,t}var Bs,Fs,vt=((window&&window.__extends||(Bs=function(t,e){return(Bs=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}Bs(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(Us,Fs=Ss),Us.prototype.getOptions=function(){return ts(this.options,Ds._cloneCustomizer)},Us.prototype.getSource=function(){return this.options.source},Us.prototype.setOptions=function(t){t=(new Ds).merge(this.options,ts(t,Ds._cloneCustomizer));if(this.map){if(t.source!==this.options.source||t.sourceLayer!==this.options.sourceLayer)return this.options=t,void this.map.layers.add(this);this._updateBaseProperties(t,this.options),this._updatePaintProperty("heatmap-color",t.color,this.options.color),this._updatePaintProperty("heatmap-intensity",t.intensity,this.options.intensity),this._updatePaintProperty("heatmap-opacity",t.opacity,this.options.opacity),this._updatePaintProperty("heatmap-radius",t.radius,this.options.radius),this._updatePaintProperty("heatmap-weight",t.weight,this.options.weight)}this.options=t},Us.prototype._buildLayers=function(){var t={id:this.id,type:"heatmap",source:this.options.source instanceof is?this.options.source.getId():this.options.source,layout:{visibility:this.options.visible?"visible":"none"},paint:{"heatmap-color":this.options.color,"heatmap-intensity":this.options.intensity,"heatmap-opacity":this.options.opacity,"heatmap-radius":this.options.radius,"heatmap-weight":this.options.weight},minzoom:this.options.minZoom,maxzoom:this.options.maxZoom};return this.options.filter&&(t.filter=this.options.filter),this.options.sourceLayer&&(t["source-layer"]=this.options.sourceLayer),[t]},Us.prototype._getLayerIds=function(){return[this.id]},Us.prototype._getSourceIds=function(){var t=new Set;return this.options.source instanceof is?t.add(this.options.source.getId()):t.add(this.options.source),t},Us);function Us(t,e,o){e=Fs.call(this,e)||this;return e.options=(new Ds).merge(ts(o,Ds._cloneCustomizer)),e.options.source=t||e.options.source,e}var qs,Gs,Et=((window&&window.__extends||(qs=function(t,e){return(qs=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}qs(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(Zs,Gs=Z),Zs);function Zs(){var t=null!==Gs&&Gs.apply(this,arguments)||this;return t.contrast=0,t.fadeDuration=300,t.hueRotation=0,t.maxBrightness=1,t.minBrightness=0,t.opacity=1,t.saturation=0,t}var Hs,Ks,Ws=((window&&window.__extends||(Hs=function(t,e){return(Hs=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}Hs(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(Vs,Ks=Et),Vs._cloneCustomizer=function(t){if(t instanceof is)return t},Vs);function Vs(){var t=null!==Ks&&Ks.apply(this,arguments)||this;return t.url=void 0,t.coordinates=void 0,t}var Ys,Qs,Js=((window&&window.__extends||(Ys=function(t,e){return(Ys=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}Ys(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(Xs,Qs=Ss),Xs.prototype._getSourceIds=function(){var t=new Set;return t.add(this._getSourceId()),t},Xs);function Xs(){return null!==Qs&&Qs.apply(this,arguments)||this}var $s,ta,Nt=((window&&window.__extends||($s=function(t,e){return($s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}$s(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(ea,ta=Js),ea.prototype.getOptions=function(){return ts(this.options,Ws._cloneCustomizer)},ea.prototype.setOptions=function(t){var e=(new Ws).merge(this.options,ts(t,Ws._cloneCustomizer)),o="string"==typeof t.url&&t.url!==this.getOptions().url,n=void 0!==t.coordinates&&t.coordinates!==this.getOptions().coordinates;this.map&&(this._updateBaseProperties(e,this.options),this._updatePaintProperty("raster-contrast",e.contrast,this.options.contrast),this._updatePaintProperty("raster-fade-duration",e.fadeDuration,this.options.fadeDuration),this._updatePaintProperty("raster-hue-rotate",e.hueRotation,this.options.hueRotation),this._updatePaintProperty("raster-brightness-max",e.maxBrightness,this.options.maxBrightness),this._updatePaintProperty("raster-opacity",e.opacity,this.options.opacity),this._updatePaintProperty("raster-saturation",e.saturation,this.options.saturation),(t=this.map._getMap().getSource(this._getSourceId()))&&t.updateImage(e)),this.options=e,o?this.reloadImage():n&&this.updateTransform()},ea.prototype.getPositions=function(e){return this.transform.then(function(t){return t.toTarget(e)})},ea.prototype.getPixels=function(e){return this.transform.then(function(t){return t.toSource(e)})},ea.getCoordinatesFromRefPoints=function(t,e,o,n){return new Gi(o,n).toTarget([[0,0],[t,0],[t,e],[0,e]])},ea.getCoordinatesFromEdges=function(t,e,o,n,r){"number"!=typeof r&&(r=0);o=[Math.min(n,o),e,Math.max(n,o),t],t=Ci.getCenter(o);return Xr([Ci.getNorthWest(o),Ci.getNorthEast(o),Ci.getSouthEast(o),Ci.getSouthWest(o)],t,r)},ea.prototype._buildLayers=function(){var t={id:this.id,type:"raster",source:this._getSourceId(),layout:{visibility:this.options.visible?"visible":"none"},paint:{"raster-opacity":this.options.opacity,"raster-hue-rotate":this.options.hueRotation,"raster-brightness-min":this.options.minBrightness,"raster-brightness-max":this.options.maxBrightness,"raster-saturation":this.options.saturation,"raster-contrast":this.options.contrast,"raster-fade-duration":this.options.fadeDuration},minzoom:this.options.minZoom,maxzoom:this.options.maxZoom};return this.options.filter&&(t.filter=this.options.filter),[t]},ea.prototype._getLayerIds=function(){return[this.id]},ea.prototype._buildSource=function(){return{type:"image",url:this.options.url,coordinates:this.options.coordinates}},ea.prototype._getSourceId=function(){return this.getId()+"-ImageSource"},ea.prototype.reloadImage=function(){var o=this;this.options.url&&(this.transform=new Promise(function(e,t){o.img.onload=function(){var t=[[0,0],[o.img.width,0],[o.img.width,o.img.height],[0,o.img.height]];e(new Gi(t,o.options.coordinates)),o.isLoading=!1},o.img.onerror=o.img.onabort=function(){t("Failed to load image")},o.isLoading=!0,o.img.src=o.options.url}))},ea.prototype.updateTransform=function(){var t;this.isLoading||(t=[[0,0],[this.img.width,0],[this.img.width,this.img.height],[0,this.img.height]],this.transform=Promise.resolve(new Gi(t,this.options.coordinates)))},ea);function ea(t,e){e=ta.call(this,e)||this;return e.isLoading=!1,e.options=(new Ws).merge(ts(t,Ws._cloneCustomizer)),e.img=new Image,e.reloadImage(),e}var oa,na,ra=((window&&window.__extends||(oa=function(t,e){return(oa=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}oa(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(ia,na=Z),ia);function ia(){var t=null!==na&&na.apply(this,arguments)||this;return t.source=void 0,t.sourceLayer=void 0,t.lineCap="round",t.lineJoin="round",t.blur=0,t.strokeColor="#1E90FF",t.strokeDashArray=void 0,t.strokeGradient=void 0,t.offset=0,t.strokeOpacity=1,t.translate=new ar(0,0),t.translateAnchor="map",t.strokeWidth=2,t}var sa,aa,kt=window&&window.__extends||(sa=function(t,e){return(sa=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}sa(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),la=window&&window.__assign||function(){return(la=Object.assign||function(t){for(var e,o=1,n=arguments.length;o<n;o++)for(var r in e=arguments[o])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},ca=(kt(ua,aa=Ss),ua.prototype.getOptions=function(){return ts(this.options,ra._cloneCustomizer)},ua.prototype.getSource=function(){return this.options.source},ua.prototype.setOptions=function(t){t=(new ra).merge(this.options,ts(t,ra._cloneCustomizer));if(this.map){if(t.source!==this.options.source||t.sourceLayer!==this.options.sourceLayer)return this.options=t,void this.map.layers.add(this);this._updateBaseProperties(t,this.options),this._updatePaintProperty("line-blur",t.blur,this.options.blur),this._updateLayoutProperty("line-cap",t.lineCap,this.options.lineCap),this._updateLayoutProperty("line-join",t.lineJoin,this.options.lineJoin),this._updatePaintProperty("line-offset",t.offset,this.options.offset),this._updatePaintProperty("line-color",t.strokeColor,this.options.strokeColor),this._updatePaintProperty("line-dasharray",t.strokeDashArray,this.options.strokeDashArray),this._updatePaintProperty("line-gradient",t.strokeGradient,this.options.strokeGradient),this._updatePaintProperty("line-opacity",t.strokeOpacity,this.options.strokeOpacity),this._updatePaintProperty("line-width",t.strokeWidth,this.options.strokeWidth),this._updatePaintProperty("line-translate",t.translate,this.options.translate),this._updatePaintProperty("line-translate-anchor",t.translateAnchor,this.options.translateAnchor)}this.options=t},ua.prototype._buildLayers=function(){return[la(la(la(la({id:this.id,type:"line"},this.options.sourceLayer&&{"source-layer":this.options.sourceLayer}),{source:this.options.source instanceof is?this.options.source.getId():this.options.source,layout:{visibility:this.options.visible?"visible":"none","line-cap":this.options.lineCap,"line-join":this.options.lineJoin},paint:la(la(la({"line-blur":this.options.blur,"line-color":this.options.strokeColor},this.options.strokeDashArray&&{"line-dasharray":this.options.strokeDashArray}),this.options.strokeGradient&&{"line-gradient":this.options.strokeGradient}),{"line-offset":this.options.offset,"line-opacity":this.options.strokeOpacity,"line-translate":this.options.translate,"line-translate-anchor":this.options.translateAnchor,"line-width":this.options.strokeWidth})}),this.options.filter&&{filter:this.options.filter}),{minzoom:this.options.minZoom,maxzoom:this.options.maxZoom})]},ua.prototype._getLayerIds=function(){return[this.id]},ua.prototype._getSourceIds=function(){var t=new Set;return this.options.source instanceof is?t.add(this.options.source.getId()):t.add(this.options.source),t},ua);function ua(t,e,o){e=aa.call(this,e)||this;return e.options=(new ra).merge(ts(o,ra._cloneCustomizer)),e.options.source=t||e.options.source,e}var pa,ha,da=((window&&window.__extends||(pa=function(t,e){return(pa=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}pa(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(fa,ha=Z),fa);function fa(){var t=null!==ha&&ha.apply(this,arguments)||this;return t.source=void 0,t.sourceLayer=void 0,t.base=0,t.fillColor="#1E90FF",t.height=0,t.fillOpacity=1,t.fillPattern=void 0,t.translate=new ar(0,0),t.translateAnchor="map",t.verticalGradient=!0,t}var ya,ma,xt=window&&window.__extends||(ya=function(t,e){return(ya=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}ya(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),ga=window&&window.__assign||function(){return(ga=Object.assign||function(t){for(var e,o=1,n=arguments.length;o<n;o++)for(var r in e=arguments[o])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},kt=(xt(va,ma=Ss),va.prototype.getOptions=function(){return ts(this.options,da._cloneCustomizer)},va.prototype.getSource=function(){return this.options.source},va.prototype.setOptions=function(t){t=(new da).merge(this.options,ts(t,da._cloneCustomizer));if(this.map){if(t.source!==this.options.source||t.sourceLayer!==this.options.sourceLayer)return this.options=t,void this.map.layers.add(this);this._updateBaseProperties(t,this.options),this._updatePaintProperty("fill-extrusion-base",t.base,this.options.base),this._updatePaintProperty("fill-extrusion-color",t.fillColor,this.options.fillColor),this._updatePaintProperty("fill-extrusion-height",t.height,this.options.height),this._updatePaintProperty("fill-extrusion-opacity",t.fillOpacity,this.options.fillOpacity),this._updatePaintProperty("fill-extrusion-pattern",t.fillPattern,this.options.fillPattern),this._updatePaintProperty("fill-extrusion-translate",t.translate,this.options.translate),this._updatePaintProperty("fill-extrusion-translate-anchor",t.translateAnchor,this.options.translateAnchor),this._updatePaintProperty("fill-extrusion-vertical-gradient",t.verticalGradient,this.options.verticalGradient)}this.options=t},va.prototype._buildLayers=function(){return[ga(ga(ga(ga({id:this.id,type:"fill-extrusion"},this.options.sourceLayer&&{"source-layer":this.options.sourceLayer}),{source:this.options.source instanceof is?this.options.source.getId():this.options.source,layout:{visibility:this.options.visible?"visible":"none"},paint:ga(ga({"fill-extrusion-base":this.options.base,"fill-extrusion-height":this.options.height,"fill-extrusion-opacity":this.options.fillOpacity},this.options.fillPattern?{"fill-extrusion-pattern":this.options.fillPattern}:{"fill-extrusion-color":this.options.fillColor}),{"fill-extrusion-translate":this.options.translate,"fill-extrusion-translate-anchor":this.options.translateAnchor,"fill-extrusion-vertical-gradient":this.options.verticalGradient})}),this.options.filter&&{filter:this.options.filter}),{minzoom:this.options.minZoom,maxzoom:this.options.maxZoom})]},va.prototype._getLayerIds=function(){return[this.id]},va.prototype._getSourceIds=function(){var t=new Set;return this.options.source instanceof is?t.add(this.options.source.getId()):t.add(this.options.source),t},va);function va(t,e,o){e=ma.call(this,e)||this;return e.options=(new da).merge(ts(o,da._cloneCustomizer)),e.options.source=t||e.options.source,e}var _a,wa,xt=window&&window.__extends||(_a=function(t,e){return(_a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}_a(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),ba=window&&window.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,o=e&&t[e],n=0;if(o)return o.call(t);if(t&&"number"==typeof t.length)return{next:function(){return{value:(t=t&&n>=t.length?void 0:t)&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Sa=window&&window.__read||function(t,e){var o="function"==typeof Symbol&&t[Symbol.iterator];if(!o)return t;var n,r,i=o.call(t),s=[];try{for(;(void 0===e||0<e--)&&!(n=i.next()).done;)s.push(n.value)}catch(t){r={error:t}}finally{try{n&&!n.done&&(o=i.return)&&o.call(i)}finally{if(r)throw r.error}}return s},xa=window&&window.__spreadArray||function(t,e){for(var o=0,n=e.length,r=t.length;o<n;o++,r++)t[r]=e[o];return t},Oa=(xt(Ta,wa=Z),Ta.prototype.merge=function(){for(var t,e=[],o=0;o<arguments.length;o++)e[o]=arguments[o];var n=!1,r=!1;try{for(var i=ba(e),s=i.next();!s.done;s=i.next()){var a=s.value;a&&(a.hasOwnProperty("fillColor")?r=!(n=!0):a.hasOwnProperty("fillPattern")&&(n=!(r=!0)))}}catch(t){l={error:t}}finally{try{s&&!s.done&&(t=i.return)&&t.call(i)}finally{if(l)throw l.error}}var l=wa.prototype.merge.apply(this,xa([],Sa(e)));return n?l.fillPattern=void 0:r&&(l.fillColor=void 0),l},Ta);function Ta(){var t=null!==wa&&wa.apply(this,arguments)||this;return t.source=void 0,t.sourceLayer=void 0,t.fillColor="#1E90FF",t.fillOpacity=.5,t.fillPattern=void 0,t}var Ea,Ca,Pa=((window&&window.__extends||(Ea=function(t,e){return(Ea=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}Ea(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(ka,Ca=Ss),ka.prototype.getOptions=function(){return ts(this.options,Oa._cloneCustomizer)},ka.prototype.getSource=function(){return this.options.source},ka.prototype.setOptions=function(t){t=(new Oa).merge(this.options,ts(t,Oa._cloneCustomizer));if(this.map){if(t.source!==this.options.source||t.sourceLayer!==this.options.sourceLayer)return this.options=t,void this.map.layers.add(this);this._updateBaseProperties(t,this.options),this._updatePaintProperty("fill-color",t.fillColor,this.options.fillColor),this._updatePaintProperty("fill-opacity",t.fillOpacity,this.options.fillOpacity),this._updatePaintProperty("fill-pattern",t.fillPattern,this.options.fillPattern)}this.options=t},ka.prototype._buildLayers=function(){var t={id:this.id,type:"fill",source:this.options.source instanceof is?this.options.source.getId():this.options.source,layout:{visibility:this.options.visible?"visible":"none"},paint:{"fill-opacity":this.options.fillOpacity},minzoom:this.options.minZoom,maxzoom:this.options.maxZoom};return this.options.filter&&(t.filter=this.options.filter),this.options.sourceLayer&&(t["source-layer"]=this.options.sourceLayer),this.options.fillPattern?t.paint["fill-pattern"]=this.options.fillPattern:t.paint["fill-color"]=this.options.fillColor,[t]},ka.prototype._getLayerIds=function(){return[this.id]},ka.prototype._getSourceIds=function(){var t=new Set;return this.options.source instanceof is?t.add(this.options.source.getId()):t.add(this.options.source),t},ka);function ka(t,e,o){e=Ca.call(this,e)||this;return e.options=(new Oa).merge(ts(o,Oa._cloneCustomizer)),e.options.source=t||e.options.source,e}var Aa,La,Ia=((window&&window.__extends||(Aa=function(t,e){return(Aa=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}Aa(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(Ra,La=P),Ra);function Ra(){var t=null!==La&&La.apply(this,arguments)||this;return t.allowOverlap=!1,t.anchor="bottom",t.ignorePlacement=!1,t.image="marker-blue",t.offset=new ar(0,0),t.optional=!1,t.padding=2,t.pitchAlignment="auto",t.rotation=0,t.rotationAlignment="auto",t.size=1,t.opacity=1,t}var Na,Ma,ja=((window&&window.__extends||(Na=function(t,e){return(Na=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}Na(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(Da,Ma=P),Da);function Da(){var t=null!==Ma&&Ma.apply(this,arguments)||this;return t.allowOverlap=!1,t.anchor="center",t.textField=void 0,t.font=["StandardFont-Regular"],t.ignorePlacement=!1,t.justify="center",t.offset=new ar(0,0),t.optional=!1,t.padding=2,t.pitchAlignment="auto",t.rotation=0,t.rotationAlignment="auto",t.size=16,t.color="#000000",t.haloBlur=0,t.haloColor="rgba(0,0,0,0)",t.haloWidth=0,t.opacity=1,t}var za,Ba,Fa=((window&&window.__extends||(za=function(t,e){return(za=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}za(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(Ua,Ba=Z),Ua);function Ua(){var t=null!==Ba&&Ba.apply(this,arguments)||this;return t.source=void 0,t.sourceLayer=void 0,t.iconOptions=new Ia,t.textOptions=new ja,t.placement="point",t.zOrder="auto",t.lineSpacing=250,t}var qa,Ga,xt=window&&window.__extends||(qa=function(t,e){return(qa=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}qa(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),Za=window&&window.__assign||function(){return(Za=Object.assign||function(t){for(var e,o=1,n=arguments.length;o<n;o++)for(var r in e=arguments[o])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},Ha=(xt(Ka,Ga=Ss),Ka.prototype.getOptions=function(){return ts(this.options,Fa._cloneCustomizer)},Ka.prototype.getSource=function(){return this.options.source},Ka.prototype.setOptions=function(t){var e=(new Fa).merge(this.options,ts(t,Fa._cloneCustomizer));if(this.map){if(e.source!==this.options.source||e.sourceLayer!==this.options.sourceLayer)return this.options=e,void this.map.layers.add(this);var o=this.options,n=e.iconOptions,r=o.iconOptions,i=e.textOptions,t=o.textOptions;this._updateBaseProperties(e,o),this._updateLayoutProperty("symbol-spacing",e.lineSpacing,o.lineSpacing),this._updateLayoutProperty("symbol-placement",e.placement,o.placement),this._updateLayoutProperty("symbol-sort-key",e.sortKey,o.sortKey),this._updateLayoutProperty("symbol-z-order",e.zOrder,o.zOrder),this._updateLayoutProperty("icon-allow-overlap",n.allowOverlap,r.allowOverlap),this._updateLayoutProperty("icon-anchor",n.anchor,r.anchor),this._updateLayoutProperty("icon-ignore-placement",n.ignorePlacement,r.ignorePlacement),this._updateLayoutProperty("icon-image",n.image,r.image),this._updateLayoutProperty("icon-offset",n.offset,r.offset),this._updatePaintProperty("icon-opacity",n.opacity,r.opacity),this._updateLayoutProperty("icon-optional",n.optional,r.optional),this._updateLayoutProperty("icon-padding",n.padding,r.padding),this._updateLayoutProperty("icon-pitch-alignment",n.pitchAlignment,r.pitchAlignment),this._updateLayoutProperty("icon-rotate",n.rotation,r.rotation),this._updateLayoutProperty("icon-rotation-alignment",n.rotationAlignment,r.rotationAlignment),this._updateLayoutProperty("icon-size",n.size,r.size),this._updateLayoutProperty("text-allow-overlap",i.allowOverlap,t.allowOverlap),this._updateLayoutProperty("text-anchor",i.anchor,t.anchor),this._updatePaintProperty("text-color",i.color,t.color),this._updateLayoutProperty("text-font",i.font,t.font),this._updateLayoutProperty("text-ignore-placement",i.ignorePlacement,t.ignorePlacement),this._updateLayoutProperty("text-justify",i.justify,t.justify),this._updatePaintProperty("text-halo-blur",i.haloBlur,t.haloBlur),this._updatePaintProperty("text-halo-color",i.haloColor,t.haloColor),this._updatePaintProperty("text-halo-width",i.haloWidth,t.haloWidth),this._updateLayoutProperty("text-offset",i.offset,t.offset),this._updatePaintProperty("text-opacity",i.opacity,t.opacity),this._updateLayoutProperty("text-optional",i.optional,t.optional),this._updateLayoutProperty("text-padding",i.padding,t.padding),this._updateLayoutProperty("text-pitch-alignment",i.pitchAlignment,t.pitchAlignment),this._updateLayoutProperty("text-radial-offset",i.radialOffset,t.radialOffset),this._updateLayoutProperty("text-rotate",i.rotation,t.rotation),this._updateLayoutProperty("text-rotation-alignment",i.rotationAlignment,t.rotationAlignment),this._updateLayoutProperty("text-size",i.size,t.size),this._updateLayoutProperty("text-variable-anchor",i.variableAnchor,t.variableAnchor),this._updateLayoutProperty("text-field",i.textField,t.textField)}this.options=e},Ka.prototype._buildLayers=function(){var t=Za(Za(Za(Za({id:this.id,type:"symbol"},this.options.sourceLayer&&{"source-layer":this.options.sourceLayer}),{source:this.options.source instanceof is?this.options.source.getId():this.options.source,layout:Za(Za({visibility:this.options.visible?"visible":"none","symbol-placement":this.options.placement,"symbol-spacing":this.options.lineSpacing,"symbol-z-order":this.options.zOrder,"text-allow-overlap":this.options.textOptions.allowOverlap,"text-anchor":this.options.textOptions.anchor},this.options.textOptions.textField&&{"text-field":this.options.textOptions.textField}),{"text-font":this.options.textOptions.font,"text-ignore-placement":this.options.textOptions.ignorePlacement,"text-justify":this.options.textOptions.justify,"text-offset":this.options.textOptions.offset,"text-optional":this.options.textOptions.optional,"text-padding":this.options.textOptions.padding,"text-pitch-alignment":this.options.textOptions.pitchAlignment,"text-rotate":this.options.textOptions.rotation,"text-rotation-alignment":this.options.textOptions.rotationAlignment,"text-size":this.options.textOptions.size,"icon-allow-overlap":this.options.iconOptions.allowOverlap,"icon-anchor":this.options.iconOptions.anchor,"icon-ignore-placement":this.options.iconOptions.ignorePlacement,"icon-image":this.options.iconOptions.image,"icon-offset":this.options.iconOptions.offset,"icon-optional":this.options.iconOptions.optional,"icon-padding":this.options.iconOptions.padding,"icon-pitch-alignment":this.options.iconOptions.pitchAlignment,"icon-rotate":this.options.iconOptions.rotation,"icon-rotation-alignment":this.options.iconOptions.rotationAlignment,"icon-size":this.options.iconOptions.size}),paint:{"text-color":this.options.textOptions.color,"text-halo-blur":this.options.textOptions.haloBlur,"text-halo-color":this.options.textOptions.haloColor,"text-halo-width":this.options.textOptions.haloWidth,"text-opacity":this.options.textOptions.opacity,"icon-opacity":this.options.iconOptions.opacity}}),this.options.filter&&{filter:this.options.filter}),{minzoom:this.options.minZoom,maxzoom:this.options.maxZoom});return void 0!==this.options.sortKey&&(t.layout["symbol-sort-key"]=this.options.sortKey),void 0!==this.options.textOptions.radialOffset&&(t.layout["text-radial-offset"]=this.options.textOptions.radialOffset),void 0!==this.options.textOptions.variableAnchor&&(t.layout["text-variable-anchor"]=this.options.textOptions.variableAnchor),[t]},Ka.prototype._getLayerIds=function(){return[this.id]},Ka.prototype._getSourceIds=function(){var t=new Set;return this.options.source instanceof is?t.add(this.options.source.getId()):t.add(this.options.source),t},Ka);function Ka(t,e,o){e=Ga.call(this,e)||this;return e.options=(new Fa).merge(ts(o,Fa._cloneCustomizer)),e.options.source=t||e.options.source,e}var Wa,Va,Ya=((window&&window.__extends||(Wa=function(t,e){return(Wa=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}Wa(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(Qa,Va=Et),Qa);function Qa(){var t=null!==Va&&Va.apply(this,arguments)||this;return t.bounds=[-180,-85.0511,180,85.0511],t.minSourceZoom=0,t.maxSourceZoom=22,t.tileSize=512,t.isTMS=!1,t.subdomains=void 0,t.tileUrl=void 0,t}var Ja,Xa,Et=window&&window.__extends||(Ja=function(t,e){return(Ja=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}Ja(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),$a=window&&window.__assign||function(){return($a=Object.assign||function(t){for(var e,o=1,n=arguments.length;o<n;o++)for(var r in e=arguments[o])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},tl=window&&window.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,o=e&&t[e],n=0;if(o)return o.call(t);if(t&&"number"==typeof t.length)return{next:function(){return{value:(t=t&&n>=t.length?void 0:t)&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},el=(Et(ol,Xa=Js),ol.prototype.getOptions=function(){return ts(this.options,Ya._cloneCustomizer)},ol.prototype.setOptions=function(t){t=(new Ya).merge(this.options,ts(t,Ya._cloneCustomizer));if(this.map){if(!tr(t.bounds,this.options.bounds)||t.isTMS!==this.options.isTMS||t.maxSourceZoom!==this.options.maxSourceZoom||t.minSourceZoom!==this.options.minSourceZoom||!tr(t.subdomains,this.options.subdomains)||t.tileSize!==this.options.tileSize||t.tileUrl!==this.options.tileUrl)return this.options=t,void this.map.layers.add(this);this._updateBaseProperties(t,this.options),this._updatePaintProperty("raster-contrast",t.contrast,this.options.contrast),this._updatePaintProperty("raster-fade-duration",t.fadeDuration,this.options.fadeDuration),this._updatePaintProperty("raster-hue-rotate",t.hueRotation,this.options.hueRotation),this._updatePaintProperty("raster-brightness-max",t.maxBrightness,this.options.maxBrightness),this._updatePaintProperty("raster-opacity",t.opacity,this.options.opacity),this._updatePaintProperty("raster-saturation",t.saturation,this.options.saturation)}this.options=t},ol.prototype._setOptionsNoUpdate=function(t){this.options=(new Ya).merge(this.options,ts(t,Ya._cloneCustomizer))},ol.prototype._buildLayers=function(){return[$a($a({id:this.id,type:"raster",source:this._getSourceId(),layout:{visibility:this.options.visible?"visible":"none"},paint:{"raster-contrast":this.options.contrast,"raster-fade-duration":this.options.fadeDuration,"raster-hue-rotate":this.options.hueRotation,"raster-brightness-max":this.options.maxBrightness,"raster-brightness-min":this.options.minBrightness,"raster-opacity":this.options.opacity,"raster-saturation":this.options.saturation}},this.options.filter&&{filter:this.options.filter}),{minzoom:this.options.minZoom,maxzoom:this.options.maxZoom})]},ol.prototype._getLayerIds=function(){return[this.id]},ol.prototype._buildSource=function(){var t,e;if(this.options.tileUrl){if(-1===this.options.tileUrl.indexOf("{"))return{type:"raster",url:this.options.tileUrl};if(-1!==this.options.tileUrl.indexOf("{subdomain}")){if(!(this.options.subdomains&&0<this.options.subdomains.length))throw new Error("The {subdomain} placeholder was included in the tileUrl but no subdomains were specified");var o=[];try{for(var n=tl(this.options.subdomains),r=n.next();!r.done;r=n.next()){var i=r.value;o.push(this.options.tileUrl.replace(/{subdomain}/g,i))}}catch(t){e={error:t}}finally{try{r&&!r.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}e=o}else e=[this.options.tileUrl]}return $a({type:"raster",bounds:this.options.bounds,maxzoom:this.options.maxSourceZoom,minzoom:this.options.minSourceZoom,scheme:this.options.isTMS?"tms":"xyz",tileSize:this.options.tileSize},e&&{tiles:e})},ol.prototype._getSourceId=function(){return this.getId()+"-RasterSource"},ol);function ol(t,e){e=Xa.call(this,e)||this;return t&&e.setOptions(t),e}var nl,rl,il=((window&&window.__extends||(nl=function(t,e){return(nl=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}nl(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(sl,rl=Z),sl);function sl(){var t=null!==rl&&rl.apply(this,arguments)||this;return t.renderer=void 0,t}var al,ll,cl=((window&&window.__extends||(al=function(t,e){return(al=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}al(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(ul,ll=Ss),ul.prototype.getOptions=function(){return ts(this.options,il._cloneCustomizer)},ul.prototype.setOptions=function(t){t=(new il).merge(this.options,ts(t,il._cloneCustomizer));this.map&&this.map.triggerRepaint(),this.options=t},ul.prototype.onAdd=function(t){var e,o;ll.prototype.onAdd.call(this,t),this.map.events.add("stylechanged",this._onStyleChange),this.options.renderer&&this.glContext&&null!==(o=(e=this.options.renderer).onAdd)&&void 0!==o&&o.call(e,t,this.glContext)},ul.prototype.onRemove=function(){var t,e;this.options.renderer&&this.glContext&&null!==(e=(t=this.options.renderer).onRemove)&&void 0!==e&&e.call(t,this.map,this.glContext),this.map.events.remove("stylechanged",this._onStyleChange),this.glContext=null,ll.prototype.onRemove.call(this)},ul.prototype._buildLayers=function(){var r=this;if(!this.options.renderer)throw new Error("Cannot build the WebGL layer because renderer was not set.");return[{id:this.id,type:"custom",renderingMode:this.options.renderer.renderingMode,onAdd:function(t,e){r.glContext=e},onRemove:function(t,e){},prerender:function(t,e){var o,n;r._shouldRender()&&null!==(n=(o=r.options.renderer).prerender)&&void 0!==n&&n.call(o,t,e)},render:function(t,e){r._shouldRender()&&r.options.renderer.render(t,e)}}]},ul.prototype._getLayerIds=function(){return[this.id]},ul.prototype._getSourceIds=function(){return(new Set).add(this.source.getId())},ul.prototype._shouldRender=function(){if(this.map){var t=this.map.getCamera().zoom;return this.options.visible&&this.options.minZoom<=t&&this.options.maxZoom>t}return!1},ul);function ul(t,e){var o=ll.call(this,t)||this;return o._onStyleChange=function(){var t,e;o.map._getMap().getLayer(o.id)||(t=o.map,e=null===(e=o.map.layers._getUserLayers().find(function(t){return t.layer.getId()==o.id}))||void 0===e?void 0:e.before,t.layers.remove(o),t.layers.add(o,e))},o.options=(new il).merge(ts(e,il._cloneCustomizer)),o.source=new us,o}var kt=Object.freeze({__proto__:null,BubbleLayer:Rs,Layer:Ss,LineLayer:ca,PolygonExtrusionLayer:kt,PolygonLayer:Pa,SymbolLayer:Ha,TileLayer:el,HeatMapLayer:vt,ImageLayer:Nt,WebGLLayer:cl}),pl=(hl.convertHtmlString=function(t){if("string"!=typeof t)return t;var e=document.createElement("div");return e.innerHTML=t,e},hl.parseWithFilter=function(t,e,o,n){var r=this;if(void 0===e&&(e=function(t){return!0}),void 0===o&&(o=function(t){return t}),void 0===n&&(n=function(){return document.createElement("div")}),"string"==typeof t){var i=(new DOMParser).parseFromString(t,"text/html").body;if(0==i.children.length)return o(i.innerHTML);var s,i=1==i.children.length&&1==i.childNodes.length?i.children[0]:(s=n(),Array.from(i.childNodes).map(function(t){return s.append(t)}),s)}else i=t;return Array.from(i.children).forEach(function(t){return r.parseWithFilter(t,e,o)}),e(i)?o(i):(i.parentNode&&i.parentNode.removeChild(i),null)},hl);function hl(){}var dl,fl,yl=function(t){return we(t)&&1===t.nodeType&&!Vo(t)},ml=((window&&window.__extends||(dl=function(t,e){return(dl=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}dl(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(gl,fl=P),gl._cloneCustomizer=function(t){if(yl(t))return t},gl);function gl(){var t=null!==fl&&fl.apply(this,arguments)||this;return t.anchor="none",t.draggable=!1,t.closeButton=!0,t.content=document.createElement("span"),t.fillColor="#FFFFFF",t.pixelOffset=new ar(0,0),t.position=new yi(0,0),t.showPointer=!0,t}var vl,_l,vt=window&&window.__extends||(vl=function(t,e){return(vl=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}vl(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),wl=window&&window.__read||function(t,e){var o="function"==typeof Symbol&&t[Symbol.iterator];if(!o)return t;var n,r,i=o.call(t),s=[];try{for(;(void 0===e||0<e--)&&!(n=i.next()).done;)s.push(n.value)}catch(t){r={error:t}}finally{try{n&&!n.done&&(o=i.return)&&o.call(i)}finally{if(r)throw r.error}}return s},bl=(vt(Sl,_l=J),Sl.prototype.setPopupOptions=function(t){this.setOptions(t)},Sl.prototype.setOptions=function(t){var e=(new ml).merge(this.options,ts(t,ml._cloneCustomizer));e.content!==this.options.content?(this.htmlContent.remove(),this.htmlContent=this._createHtmlContent(e),this.contentDiv.prepend(this.htmlContent)):e.draggable!==this.options.draggable&&this._setDraggable(this.htmlContent,e.draggable),e.closeButton&&!this.closeBtn?(this.closeBtn=this._createCloseButton(),this.contentDiv.appendChild(this.closeBtn),t=U("close"),this.contentDiv.appendChild(t),q(t,this.closeBtn,!0)):!e.closeButton&&this.closeBtn&&(this.contentDiv.removeChild(this.closeBtn),delete this.closeBtn),e.showPointer&&!this.arrowDiv?(this.arrowDiv=this._createArrowDiv(),this.containerDiv.appendChild(this.arrowDiv)):!e.showPointer&&this.arrowDiv&&(this.containerDiv.removeChild(this.arrowDiv),delete this.arrowDiv),e.fillColor!==this.options.fillColor&&(this.containerDiv.style.borderColor=e.fillColor,this.contentDiv.style.backgroundColor=e.fillColor),this.marker&&(e.anchor!==this.options.anchor?"none"===this.options.anchor?(this.autoAnchor!==e.anchor&&this._replaceMarker(this.map,e),this.map.events.remove("move",this._onMove),delete this.autoAnchor):(this._replaceMarker(this.map,e),"none"===e.anchor&&this.map.events.add("move",this._onMove)):(tr(e.position,this.options.position)||this.marker.setLngLat(e.position),tr(e.pixelOffset,this.options.pixelOffset)||this.marker.setOffset(e.pixelOffset))),this.options=e},Sl.prototype.getPopupOptions=function(){return this.getOptions()},Sl.prototype.getOptions=function(){return ts(this.options,ml._cloneCustomizer)},Sl.prototype.getPopupContainer=function(){return this.containerDiv},Sl.prototype._dragToPixel=function(t){this.dragging||(this.dragging=!0,this.contentDiv.style.pointerEvents="none",this._invokeEvent("dragstart",{type:"dragstart",target:this}));t=[t[0]+this.dragOffset[0],t[1]+this.dragOffset[1]],t=wl(this.map.pixelsToPositions([t]),1)[0];this.options.position=t,this.marker.setLngLat(this.options.position),this._invokeEvent("drag",{type:"drag",target:this})},Sl.prototype._onUp=function(){this.dragging&&(this.contentDiv.style.pointerEvents="",this._invokeEvent("dragend",{type:"dragend",target:this}),"none"===this.options.anchor&&this._onMove()),delete this.dragOffset,delete this.dragging},Sl.prototype._createContainerDiv=function(t){var e=this,o=document.createElement("div");o.classList.add(Sl.Css.container),o.classList.add(Sl.Css.hidden),o.style.borderColor=t.fillColor,o.setAttribute("role","dialog"),o.setAttribute("aria-label","Map Information Window");var n=!1;return o.addEventListener("keydown",function(t){"Tab"!==t.key&&"Escape"!==t.key&&"Esc"!==t.key||(n=!0)}),o.addEventListener("keyup",function(t){"Tab"!==t.key&&"Escape"!==t.key&&"Esc"!==t.key||(n=!1)}),o.addEventListener("focusin",function(t){e.map&&!e.isOpen()&&(e.open(e.map),t.target instanceof HTMLElement&&t.target.focus())}),o.addEventListener("focusout",function(t){n&&t.relatedTarget instanceof Node&&!o.contains(t.relatedTarget)&&(n=!1,e.isOpen()&&e.close())}),o},Sl.prototype._createContentDiv=function(t){var e=document.createElement("div");return e.classList.add(Sl.Css.content),e.style.backgroundColor=t.fillColor,e.setAttribute("tabindex","0"),this.htmlContent=this._createHtmlContent(t),e.appendChild(this.htmlContent),e},Sl.prototype._createArrowDiv=function(){var t=document.createElement("div");return t.classList.add(Sl.Css.arrow),t},Sl.prototype._createCloseButton=function(){var t=document.createElement("button");return t.addEventListener("click",this.close),t.classList.add(Sl.Css.close),t.setAttribute("aria-label","close"),t.setAttribute("tabindex","0"),t.innerHTML="&times;",t},Sl.prototype._createHtmlContent=function(t){var e=pl.convertHtmlString(t.content);return t.draggable&&this._setDraggable(e,t.draggable),e},Sl.prototype._createMarker=function(t,e){var o=this.marker?this.marker.getLngLat():t.position,o="none"===t.anchor?(this.autoAnchor=e||"bottom",this.containerDiv.classList.add(this.autoAnchor),new p.Marker({anchor:this.autoAnchor,element:this.containerDiv,offset:t.pixelOffset}).setLngLat(o)):(this.containerDiv.classList.add(t.anchor),new p.Marker({anchor:t.anchor,element:this.containerDiv,offset:t.pixelOffset}).setLngLat(o));return o},Sl.prototype._getAutoAnchor=function(t,e){var o,n,r,i=this.containerDiv.offsetWidth,s=this.containerDiv.offsetHeight,a=[];return(r=this.marker?(n=(o=t._getMap().project(this.marker.getLngLat())).x,o.y):(r=wl(t.positionsToPixels([e.position]),1),n=(r=wl(r[0],2))[0],r[1]))<s?a.push("top"):r>t.getCanvas().offsetHeight-s&&a.push("bottom"),n<i/2?a.push("left"):n>t.getCanvas().offsetWidth-i/2&&a.push("right"),0<a.length?a.join("-"):"bottom"},Sl.prototype._replaceMarker=function(t,e,o){var n=this.containerDiv.nextElementSibling;this.marker.remove(),this.containerDiv.classList.remove(this.autoAnchor||this.options.anchor),this.marker=this._createMarker(e,o),this.marker.addTo(t._getMap()),t.popups._getCollectionDiv().insertBefore(this.containerDiv,n||null)},Sl.prototype._setDraggable=function(t,e){e?(t.addEventListener("mousedown",this._onDown),t.addEventListener("touchstart",this._onDown),t.addEventListener("dragstart",this._onDragStart)):(t.removeEventListener("mousedown",this._onDown),t.removeEventListener("touchstart",this._onDown),t.removeEventListener("dragstart",this._onDragStart))},Sl.Css={arrow:"popup-arrow",close:"popup-close",container:"popup-container",content:"popup-content-container",hidden:"hidden-accessible-element"},Sl);function Sl(t){var o=_l.call(this)||this;return o.attach=function(t){o.map!==t&&(o.map&&o.remove(),o.map=t,o.marker=o._createMarker(o.options),o.marker.addTo(o.map._getMap()),o.map.popups._getCollectionDiv().appendChild(o.containerDiv),o.map.popups.add(o))},o.open=function(t){if(!t&&!o.map)throw new Error("Must specify a map to open on or attach to a map in advance");o.attach(t||o.map),o.containerDiv.classList.remove(Sl.Css.hidden),o.map.events.add("move",o._onMove),o._onMove(),o._invokeEvent("open",{target:o,type:"open"})},o.close=function(){o.map&&o.map.events.remove("move",o._onMove),o.containerDiv.classList.add(Sl.Css.hidden),o._invokeEvent("close",{target:o,type:"close"})},o.remove=function(){o.map&&(o.marker.remove(),o.containerDiv.classList.remove(o.autoAnchor||o.options.anchor),o.map.events.remove("move",o._onMove),o.map.popups.remove(o),delete o.map,delete o.marker,delete o.autoAnchor)},o.isOpen=function(){return o.map&&!o.containerDiv.classList.contains(Sl.Css.hidden)},o._onMove=function(){var t=o._getAutoAnchor(o.map,o.options);t!==o.autoAnchor&&(o._replaceMarker(o.map,o.options,t),o.map.events.add("move",o._onMove))},o._onDown=function(t){o.map.popups._addDraggedPopup(o);var e=wl(o.map.positionsToPixels([o.options.position]),1)[0];"mousedown"===t.type?o.dragOffset=[e[0]-t.clientX,e[1]-t.clientY]:"touchstart"===t.type&&(o.dragOffset=[e[0]-t.touches[0].clientX,e[1]-t.touches[0].clientY])},o._onDragStart=function(t){t.preventDefault()},o.options=(new ml).merge(ts(t,ml._cloneCustomizer)),o.containerDiv=o._createContainerDiv(o.options),o.contentDiv=o._createContentDiv(o.options),o.containerDiv.appendChild(o.contentDiv),o.options.showPointer&&(o.arrowDiv=o._createArrowDiv(),o.containerDiv.appendChild(o.arrowDiv)),o.options.closeButton&&(o.closeBtn=o._createCloseButton(),o.contentDiv.appendChild(o.closeBtn),t=U("close"),o.contentDiv.appendChild(t),q(t,o.closeBtn,!0)),o}var xl,Ol,Tl=((window&&window.__extends||(xl=function(t,e){return(xl=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}xl(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(El,Ol=P),El._cloneCustomizer=function(t){if(t instanceof bl||yl(t))return t},El);function El(){var t=null!==Ol&&Ol.apply(this,arguments)||this;return t.anchor="bottom",t.color="#1A73AA",t.draggable=!1,t.htmlContent='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24.5 36.5" id="marker_'+or()+'" width="24.5" height="36.5" display="block"><path d="M12.25.25a12.2543,12.2543,0,0,0-12,12.4937c0,6.4436,6.4879,12.1093,11.059,22.5641.5493,1.2563,1.3327,1.2563,1.882,0C17.7621,24.8529,24.25,19.1857,24.25,12.7437A12.2543,12.2543,0,0,0,12.25.25Z" fill="{color}" stroke="{secondaryColor}" stroke-width="0.5"/><text style="font-family: Arial, Helvetica, sans-serif; font-size: 14px; fill: white;" text-anchor="middle" x="12" y="18">{text}</text></svg>',t.pixelOffset=new ar(0,0),t.position=new yi(0,0),t.popup=void 0,t.secondaryColor="white",t.text=void 0,t.visible=!0,t}var Cl,Pl,kl=((window&&window.__extends||(Cl=function(t,e){return(Cl=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}Cl(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(Al,Pl=J),Al.prototype.getOptions=function(){return ts(this.options,Tl._cloneCustomizer)},Al.prototype.getElement=function(){return this.marker.getElement()},Al.prototype.setOptions=function(t){t=(new Tl).merge(this.options,ts(t,Tl._cloneCustomizer));tr(t.htmlContent,this.options.htmlContent)&&t.anchor===this.options.anchor?("string"!=typeof t.htmlContent||t.color===this.options.color&&t.text===this.options.text&&t.secondaryColor===this.options.secondaryColor||(this.element.innerHTML=this._getSubbedHtmlString(t)||""),t.draggable!==this.options.draggable&&(this._setDraggable(t.draggable),this.marker.setDraggable(t.draggable)),tr(t.pixelOffset,this.options.pixelOffset)||this.marker.setOffset(t.pixelOffset),tr(t.position,this.options.position)||this.marker.setLngLat(t.position),t.visible!==this.options.visible&&(t.visible?this.element.classList.remove(Al.hiddenClass):this.element.classList.add(Al.hiddenClass))):(this.marker.remove(),this._buildMarker(t),this.map&&(this.marker.addTo(this.map._getMap()),this._getCollectionContainer().appendChild(this.element))),this.options=t},Al.prototype.togglePopup=function(){if(this.options.popup)if(this.options.popup.isOpen())this.options.popup.close();else{if(!this.map)throw new Error("The marker must be added to a map before calling togglePopup().");this.options.popup.setOptions({position:this.options.position}),this.options.popup.open(this.map)}},Al.prototype._addToMap=function(t,e){this.map&&this.map!==t&&this._removeFromMap(),e&&(this.options.position=Uo(e),this.marker.setLngLat(this.options.position)),this.map!==t&&(this.map=t,this.marker.addTo(t._getMap()),this._getCollectionContainer().appendChild(this.element))},Al.prototype._removeFromMap=function(){this.map&&(this.marker.remove(),delete this.map)},Al.prototype._getId=function(){if(this.element)return("string"==typeof this.options.htmlContent?this.element.firstChild:this.element).id},Al.prototype._buildMarker=function(t){var e;"string"==typeof t.htmlContent?(e=this._getSubbedHtmlString(t)||"",this.element=pl.convertHtmlString(e)):this.element=t.htmlContent,this.element.classList.add(Al.containerClass),t.draggable&&this._setDraggable(!0),t.visible||this.element.classList.add(Al.hiddenClass),this.marker=new p.Marker({element:this.element,offset:t.pixelOffset,draggable:t.draggable,anchor:t.anchor}).setLngLat(t.position),this.marker.on("drag",this._onDrag),this.marker.on("dragstart",this._onDragStart),this.marker.on("dragend",this._onDragEnd),this.element.addEventListener("click",this._bubbleElementEvent),this.element.addEventListener("dblclick",this._bubbleElementEvent),this.element.addEventListener("contextmenu",this._bubbleElementEvent),this.element.addEventListener("keydown",this._bubbleElementEvent),this.element.addEventListener("keypress",this._bubbleElementEvent),this.element.addEventListener("keyup",this._bubbleElementEvent),this.element.addEventListener("mousedown",this._bubbleElementEvent),this.element.addEventListener("mouseenter",this._bubbleElementEvent),this.element.addEventListener("mouseleave",this._bubbleElementEvent),this.element.addEventListener("mousemove",this._bubbleElementEvent),this.element.addEventListener("mouseout",this._bubbleElementEvent),this.element.addEventListener("mouseover",this._bubbleElementEvent),this.element.addEventListener("mouseup",this._bubbleElementEvent)},Al.prototype._getSubbedHtmlString=function(t){return"string"==typeof t.htmlContent?t.htmlContent.replace(/{color}/gi,t.color||"").replace(/{secondaryColor}/gi,t.secondaryColor||"").replace(/{text}/gi,t.text||""):null},Al.prototype._getCollectionContainer=function(){var t=this.map.getCanvasContainer().querySelector("."+Al.collectionContainerClass);return t||((t=document.createElement("div")).classList.add(Al.collectionContainerClass),this.map.getCanvasContainer().appendChild(t)),t},Al.prototype._setDraggable=function(t){t?this.element.addEventListener("dragstart",this._onEleDragStart):this.element.removeEventListener("dragstart",this._onEleDragStart)},Al.collectionContainerClass="marker-collection-container",Al.hiddenClass="hidden-accessible-element",Al.containerClass="marker-container",Al);function Al(t){var e=Pl.call(this)||this;return e._onDrag=function(){var t=e.marker.getLngLat().wrap();e.options.position=new yi(t.lng,t.lat),e._invokeEvent("drag",{type:"drag",target:e})},e._onDragStart=function(){e._invokeEvent("dragstart",{type:"dragstart",target:e})},e._onDragEnd=function(){e._invokeEvent("dragend",{type:"dragend",target:e})},e._bubbleElementEvent=function(t){e._invokeEvent(t.type,{type:t.type,target:e})},e._onEleDragStart=function(t){t.preventDefault()},e.options=(new Tl).merge(ts(t,Tl._cloneCustomizer)),e._buildMarker(e.options),e}var Ll=(Il.parse=function(t){var e=(t=t.toLowerCase()).lastIndexOf("-");return-1!==e?{code:t,language:t.substring(0,e),region:t.substring(e+1)}:{code:t,language:t}},Il);function Il(){}var Rl={localizationsPath:"locs/mapcontrol/2019-3-12",sensitiveUserRegions:["il","kr","pk","in","cn","ar","bh","eg","jo","sa","kw","om","qa","ma","ae"],locales:{defaultLanguage:{defaultRegion:{code:"NGT",strings:"en/resource.json"}},ar:{defaultRegion:{code:"ar",strings:"ar-sa/resource.json"}},bg:{defaultRegion:{code:"bg-BG",strings:"bg-bg/resource.json"}},cs:{defaultRegion:{code:"cs-CZ",strings:"cs-cz/resource.json"}},da:{defaultRegion:{code:"da-DK",strings:"da-dk/resource.json"}},de:{defaultRegion:{code:"de-DE",strings:"de-de/resource.json"}},el:{defaultRegion:{code:"el-GR",strings:"el-gr/resource.json"}},en:{defaultRegion:{code:"en",strings:"en/resource.json"},us:{code:"en-US",strings:"en/resource.json"}},es:{defaultRegion:{code:"es-ES",strings:"es-es/resource.json"},mx:{code:"es-MX",strings:"es-mx/resource.json"}},fi:{defaultRegion:{code:"fi-FI",strings:"fi-fi/resource.json"}},fr:{defaultRegion:{code:"fr-FR",strings:"fr-fr/resource.json"}},hu:{defaultRegion:{code:"hu-HU",strings:"hu-hu/resource.json"}},id:{defaultRegion:{code:"id-ID",strings:"id-id/resource.json"}},it:{defaultRegion:{code:"it-IT",strings:"it-it/resource.json"}},ko:{defaultRegion:{code:"ko-KR",strings:"ko-kr/resource.json"}},lt:{defaultRegion:{code:"lt-LT",strings:"lt-lt/resource.json"}},ms:{defaultRegion:{code:"ms-MY",strings:"ms-my/resource.json"}},nb:{defaultRegion:{code:"nb-NO",strings:"nb-no/resource.json"}},nl:{defaultRegion:{code:"nl-NL",strings:"nl-nl/resource.json"}},pl:{defaultRegion:{code:"pl-PL",strings:"pl-pl/resource.json"}},pt:{defaultRegion:{code:"pt-PT",strings:"pt-pt/resource.json"},br:{code:"pt-BR",strings:"pt-br/resource.json"}},ru:{defaultRegion:{code:"ru-RU",strings:"ru-ru/resource.json"}},sk:{defaultRegion:{code:"sk-SK",strings:"sk-sk/resource.json"}},sl:{defaultRegion:{code:"sl-SL",strings:"sl-sl/resource.json"}},sv:{defaultRegion:{code:"sv-SE",strings:"sv-se/resource.json"}},th:{defaultRegion:{code:"th-TH",strings:"th-th/resource.json"}},tr:{defaultRegion:{code:"tr-TR",strings:"tr-tr/resource.json"}},zh:{defaultRegion:{code:"zh-Hant",strings:"zh-tw/resource.json"}},"zh-hant":{defaultRegion:{code:"zh-Hant",strings:"zh-tw/resource.json"}}}},Nl=function(){this.Unknown="Unknown",this.Accident="Accident",this.Fog="Fog",this.Danger="Danger",this.Rain="Rain",this.Ice="Ice",this.Jam="Jam",this.LaneClosed="Lane Closed",this.RoadClosed="Road Closed",this.RoadWorks="Road Works",this.Wind="Wind",this.Flood="Flood",this.Detour="Detour"},Ml=(jl.getCode=function(t){var e=Ll.parse(t);return-1===Rl.sensitiveUserRegions.indexOf(e.region)?this.getLocaleData(e).code:t},jl.getStrings=function(t){t=this.getLocaleData(t);return Rl.locales.defaultLanguage.defaultRegion.code===t.code?new Promise(function(t){t(new Nl)}):new j({domain:e,path:Rl.localizationsPath+"/"+t.strings}).get().then(function(t){return t},function(){return new Nl})},jl.getLocaleData=function(t){if("string"==typeof t&&(t=Ll.parse(t)),Rl.locales[t.code])return Rl.locales[t.code].defaultRegion;var e;if(Rl.locales[t.language])e=Rl.locales[t.language];else{if(-1!==t.language.indexOf("-"))return this.getLocaleData(t.language);e=Rl.locales.defaultLanguage}return t.region&&e[t.region]?e[t.region]:e.defaultRegion},jl);function jl(){}var Dl=(zl.getEdgeOrIEVersion=function(){var t=window.navigator.userAgent,e=t.indexOf("MSIE ");if(0<e)return parseInt(t.substring(e+5,t.indexOf(".",e)),10);if(0<t.indexOf("Trident/")){var o=t.indexOf("rv:");return parseInt(t.substring(o+3,t.indexOf(".",o)),10)}o=t.indexOf("Edge/");return 0<o?parseInt(t.substring(o+5,t.indexOf(".",o)),10):-1},zl.isEdgeOrIE=function(){return-1!==this.getEdgeOrIEVersion()},zl.isIE=function(){var t=this.getEdgeOrIEVersion();return-1!==t&&t<=11},zl);function zl(){}var Bl,Nt=window&&window.__extends||(Bl=function(t,e){return(Bl=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}Bl(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),Fl=window&&window.__read||function(t,e){var o="function"==typeof Symbol&&t[Symbol.iterator];if(!o)return t;var n,r,i=o.call(t),s=[];try{for(;(void 0===e||0<e--)&&!(n=i.next()).done;)s.push(n.value)}catch(t){r={error:t}}finally{try{n&&!n.done&&(o=i.return)&&o.call(i)}finally{if(r)throw r.error}}return s},Ul=window&&window.__spreadArray||function(t,e){for(var o=0,n=e.length,r=t.length;o<n;o++,r++)t[r]=e[o];return t};(vt=u.AuthenticationType||(u.AuthenticationType={})).subscriptionKey="subscriptionKey",vt.aad="aad",vt.anonymous="anonymous",vt.sas="sas";var ql,Gl,Zl=(Nt(Hl,ql=P),Hl.prototype.setSubscriptionKey=function(t){this.authType=u.AuthenticationType.subscriptionKey,this.subscriptionKey=t},Hl.prototype.setAadProperties=function(t,e,o,n,r){this.authType=u.AuthenticationType.aad,this.authContext=r||this.authContext,this.aadInstance=n||this.aadInstance,this.clientId=t,this.aadAppId=e,this.aadTenant=o},Hl.prototype.setTokenCallbackFunction=function(t){this.authType=u.AuthenticationType.anonymous,this.getToken=t},Hl.prototype.setSasCallbackFunction=function(t){this.authType=u.AuthenticationType.sas,this.getToken=t},Hl.prototype.merge=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var o=ql.prototype.merge.apply(this,Ul([],Fl(t)));return o.authType===u.AuthenticationType.subscriptionKey?o.authContext=o.aadAppId=o.getToken=void 0:o.authType===u.AuthenticationType.aad?o.subscriptionKey=o.getToken=void 0:o.authType===u.AuthenticationType.anonymous?o.subscriptionKey=o.authContext=o.aadAppId=void 0:o.authType===u.AuthenticationType.sas&&(o.authContext=o.subscriptionKey=o.aadAppId=void 0),o},Hl);function Hl(){var t=null!==ql&&ql.apply(this,arguments)||this;return t.authType=void 0,t.subscriptionKey=void 0,t.clientId=void 0,t.aadAppId=void 0,t.aadTenant=void 0,t.aadInstance=void 0,t.getToken=void 0,t.sasToken=void 0,t.authContext=void 0,t}var Kl="NGT",Wl=or(),Vl=t,Yl=e,Ql=o,Jl=n,Xl=w,$l=new Zl,tc=!1,ec=!1,oc=!1,nc=!1,rc=!1,ic=!1,sc=!1,ac=!1,lc=!1;function cc(){return Object.assign({},$l)}function uc(){return Yl}function pc(){return Vl}function hc(){return Ql}function dc(){return Jl}function fc(){return Xl}function yc(){return p.workerCount}function mc(){return p.maxParallelImageRequests}function gc(){return Kl}function vc(){return Wl}function _c(){return $l.authType===u.AuthenticationType.subscriptionKey?$l.subscriptionKey:void 0}function wc(){return Gl}function bc(t){return!Dl.isIE()&&p.supported({failIfMajorPerformanceCaveat:t})}function Sc(t){$l=(new Zl).merge($l,t),lc=!0}function xc(t){Vl=t,ec=!0}function Oc(t){Ql=t,oc=!0}function Tc(t){0<t&&(p.workerCount=t,rc=!0)}function Ec(t){0<t&&(p.maxParallelImageRequests=t,ic=!0)}function Cc(t){Kl=Ml.getCode(t),sc=!0}function Pc(t){Wl=t,ac=!0}function kc(t){$l.setSubscriptionKey(t),lc=!0}function Ac(t){Gl=t,tc=!0}function Lc(t,e){if(e=Math.abs(e||1),"string"==typeof t&&Fc[t.toLowerCase()]){for(var o=Fc[t.toLowerCase()],n=/calc\(([0-9.]+)[px]*\s*\*\s*\{scale\}\)/gi,r=o,i=n.exec(o);i;)r=r.replace(i[0],parseFloat(i[1])*e+""),i=n.exec(o);return r=r.replace("{scale}",e+"")}throw new Error("Invalid templateName.")}function Ic(){return lc}function Rc(){return ec}function Nc(){return oc}function Mc(){return rc}function jc(){return ic}function Dc(){return sc}function zc(){return ac}function Bc(){return tc}var Fc={marker:'<svg xmlns="http://www.w3.org/2000/svg" width="calc(27 * {scale})" height="calc(39 * {scale})" viewBox="-1 -1 26 38"><path d="M12.25.25a12.254 12.254 0 0 0-12 12.494c0 6.444 6.488 12.109 11.059 22.564.549 1.256 1.333 1.256 1.882 0C17.762 24.853 24.25 19.186 24.25 12.744A12.254 12.254 0 0 0 12.25.25Z" style="fill:{color};stroke:{secondaryColor};stroke-width:1"/><text x="12.5" y="17.5" style="font-size:14px;fill:#fff;text-anchor:middle">{text}</text></svg>',"marker-thick":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(28 * {scale})" height="calc(39 * {scale})" viewBox="-1 -1 27 38"><path d="M12.25.25a12.254 12.254 0 0 0-12 12.494c0 6.444 6.488 12.109 11.059 22.564.549 1.256 1.333 1.256 1.882 0C17.762 24.853 24.25 19.186 24.25 12.744A12.254 12.254 0 0 0 12.25.25Z" style="fill:{color};stroke:{secondaryColor};stroke-width:2"/><text x="12.5" y="18.5" style="font-size:14px;fill:#fff;text-anchor:middle">{text}</text></svg>',"marker-circle":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(28 * {scale})" height="calc(39 * {scale})" viewBox="-1 -1 27 38"><path d="M12.25.25a12.254 12.254 0 0 0-12 12.494c0 6.444 6.488 12.109 11.059 22.564.549 1.256 1.333 1.256 1.882 0C17.762 24.853 24.25 19.186 24.25 12.744A12.254 12.254 0 0 0 12.25.25Z" style="fill:{color};stroke:{secondaryColor};stroke-width:1"/><circle cx="12.5" cy="12.5" r="9" fill="{secondaryColor}"/><text x="12" y="17.5" style="font-size:14px;fill:#000;text-anchor:middle">{text}</text></svg>',pin:'<svg xmlns="http://www.w3.org/2000/svg" width="calc(24 * {scale})" height="calc(28 * {scale})" viewBox="0 0 24 28"><path d="m11.988 16.615a5.15 5.15 0 0 1-2.268-.525 4.909 4.909 0 0 1-2.805-4.442 5.019 5.019 0 0 1 5.072-4.936h.012a5.03 5.03 0 0 1 5.085 4.961 4.907 4.907 0 0 1-.549 2.224 5.114 5.114 0 0 1-4.548 2.718zm0-8.06a3.173 3.173 0 0 0-3.226 3.099 3.081 3.081 0 0 0 1.77 2.782 3.299 3.299 0 0 0 4.365-1.386 3.049 3.049 0 0 0 .342-1.381 3.184 3.184 0 0 0-3.239-3.114h-.012z" fill="{secondaryColor}"/><path d="m11.999.922a10.908 10.908 0 0 0-11.076 10.732 10.639 10.639 0 0 0 4.418 8.598l6.658 6.464 6.658-6.463a10.537 10.537 0 0 0 2.198-15.041 11.182 11.182 0 0 0-8.856-4.289zm1.873 14.341a4.221 4.221 0 0 1-5.589-1.789 3.945 3.945 0 0 1-.445-1.8 4.164 4.164 0 0 1 8.323-.037 4.028 4.028 0 0 1-2.289 3.626Z" fill="{color}"/><path d="m11.999 28-7.256-7.044a11.611 11.611 0 0 1-4.743-9.303 11.844 11.844 0 0 1 11.988-11.652.102 .102 0 0 1 .02 0 12.164 12.164 0 0 1 9.577 4.647 11.357 11.357 0 0 1 2.299 8.614 11.521 11.521 0 0 1-4.63 7.695zm-.01-26.157a9.997 9.997 0 0 0-10.143 9.812 9.769 9.769 0 0 0 4.04 7.853l.099.083 6.014 5.838 6.113-5.922a9.7 9.7 0 0 0 3.945-6.505 9.533 9.533 0 0 0-1.933-7.229 10.305 10.305 0 0 0-8.116-3.931h-.021zm.021 14.772a5.11 5.11 0 0 1-4.547-2.718 4.868 4.868 0 0 1 .932-5.743 5.118 5.118 0 0 1 3.58-1.46h.024a5.031 5.031 0 0 1 5.084 4.938 4.92 4.92 0 0 1-2.805 4.457h0a5.152 5.152 0 0 1-2.269.525zm-.011-8.079h-.015a3.277 3.277 0 0 0-2.295.933 3.029 3.029 0 0 0-.587 3.58 3.297 3.297 0 0 0 4.364 1.386h0a3.092 3.092 0 0 0 1.772-2.795 3.185 3.185 0 0 0-3.239-3.105z" fill="{secondaryColor}"/><text x="12" y="17" style="font-size:14px;fill:#000;text-anchor:middle">{text}</text></svg>',"pin-round":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(25 * {scale})" height="calc(25 * {scale})" viewBox="0 0 25 25"><g transform="translate(0 1)"><circle cx="12.25" cy="11.5833" r="11" fill="{color}"/><path d="m12.25 23.583a12 12 0 1 1 12-12 12 12 0 0 1-12 12zm0-22a10 10 0 1 0 10 10 10 10 0 0 0-10-10z" fill="{secondaryColor}"/><circle cx="12.25" cy="11.5833" r="4.2386" fill="{secondaryColor}"/></g><text x="12.5" y="17" style="font-size:14px;fill:#000;text-anchor:middle">{text}</text></svg>',"marker-flat":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(27 * {scale})" height="calc(42.8 * {scale})" viewBox="0 0 1600 2570"><g fill="{color}"><path d="M691 2419c-409-575-641-1086-683-1504-10-106-10-136 5-224 31-188 105-330 241-458 129-124 270-190 453-214 69-9 113-10 182-1 373 46 655 326 703 698 40 308-120 801-424 1309-134 224-348 535-369 535-4 0-53-63-108-141z"/></g><g fill="rgba(0,0,0,0.15)" style="transform:scale(-1,1);transform-origin:center"><path d="M691 2419c-407-571-639-1083-682-1498-14-139-3-249 37-371 69-208 254-402 459-481 68-27 217-59 271-59h24v160 180 940 635c0 349-2 635-5 635-2 0-49-63-104-141z"/></g><circle cx="800" cy="800" r="600" fill="{secondaryColor}"/><text x="800" y="1100" style="font-size:800px;fill:#000;text-anchor:middle">{text}</text></svg>',"marker-arrow":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(25.47 * {scale})" height="calc(35.18 * {scale})" viewBox="0 0 4330 5980"><g fill="{color}"><path d="m2080 5969c-49-20-93-63-115-113-25-55-1928-5486-1953-5573-40-138 67-282 210-283 36 0 246 73 987 345 518 190 947 345 955 345 8 0 438-155 955-345 615-226 954-345 979-345 87 0 165 47 204 123 46 91 107-95-957 2942-537 1535-986 2805-997 2823-11 18-43 46-72 62-41 24-62 30-111 29-33 0-71-5-85-10z"/></g><g fill="{secondaryColor}"><path d="m2200 1600c-36 10-83 2-484-84-243-53-451-94-461-91-11 4-22 18-25 31-5 19 114 371 436 1292 244 697 448 1273 454 1281 19 24 50 30 71 12z"/><path d="m2200 1600c-36 10-83 2-484-84-243-53-451-94-461-91-11 4-22 18-25 31-5 19 114 371 436 1292 244 697 448 1273 454 1281 19 24 50 30 71 12z" style="transform:scale(-1,1);transform-origin:center"/></g><g fill="rgba(0,0,0,0.2)" ><path d="m2165 685c8 0 438-155 955-345 615-226 954-345 979-345 87 0 165 47 204 123 46 91 107-95-957 2942-537 1535-986 2805-997 2823-11 18-43 46-72 62-41 24-62 30-111 29z"/></g><text x="2165" y="3300" style="font-size:2500px;fill:#fff;text-anchor:middle">{text}</text></svg>',"marker-ball-pin":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(15.67 * {scale})" height="calc(33.33 * {scale})" viewBox="0 0 235 452"><g transform="translate(-135 10)"><path fill="{secondaryColor}" d="m256 442 0 0c-13 0-18-11-18-24l-6-323c0-13 11-24 24-24h0c13 0 24 11 24 24l-6 323c0 13-5 24-18 24z"/><circle style="fill:{color};stroke-width:10;stroke:{secondaryColor}" cx="256" cy="112" r="111"/><ellipse transform="matrix(0.834 0.5518 -0.5518 0.834 65.7916 -97.18)" fill="rgba(255,255,255,0.3)" cx="194.399" cy="60.749" rx="19.076" ry="32.428"/></g><text x="117.5" y="160" style="font-size:160px;fill:#fff;text-anchor:middle">{text}</text></svg>',"marker-square":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(26.67 * {scale})" height="calc(32.27 * {scale})" viewBox="0 0 2000 2420"><g transform="translate(100 100)" style="stroke:{secondaryColor};stroke-width:100;fill:{color}"><path d="M845 2152c-22-37-58-95-80-129-22-35-62-99-90-143l-50-80-312 0-313 0 0-900 0-900 900 0 900 0 0 900 0 900-313 0-313 0-34 58c-19 31-38 59-42 60-5 2-8 8-8 12 0 9-69 123-88 145-5 6-11 15-13 21-16 39-77 123-89 124-8 0-33-31-55-68z"/></g><text x="1000" y="1300" style="font-size:1000px;fill:#fff;text-anchor:middle">{text}</text></svg>',"marker-square-cluster":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(33.33 * {scale})" height="calc(38.8 * {scale})" viewBox="0 0 2500 2910"><g transform="translate(100 100)" style="stroke:{secondaryColor};stroke-width:100;fill:{color}"><path d="m866 2652c-17-31-37-68-46-82-9-14-32-54-51-90-19-36-50-92-70-125l-36-60-332-3-331-2 0-905 0-905 660 0 660 0 0-38c0-71 50-196 102-258 71-85 189-164 244-164 12 0 26-4 29-10 8-13 222-13 230 0 3 6 17 10 30 10 25 0 117 45 154 76 130 107 191 232 191 392 0 155-63 284-190 386-36 29-129 76-150 76-11 0-22 5-25 10-3 6-31 10-61 10l-54 0 0 660 0 660-332 2-332 3-29 50c-17 28-48 84-70 125-22 41-47 86-56 100-9 14-30 51-46 83-17 32-36 57-45 57-8 0-28-25-44-58z"/></g><text x="1650" y="900" style="font-size:1000px;fill:#fff">+</text><text x="1000" y="1800" style="font-size:1000px;fill:#fff;text-anchor:middle">{text}</text></svg>',"marker-square-rounded":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(26.8 * {scale})" height="calc(32.27 * {scale})" viewBox="0 0 2010 2410"><g transform="translate(100 100)" style="stroke:{secondaryColor};stroke-width:100;fill:{color}"><path d="M856 2155c-20-30-36-59-36-65 0-5-4-10-10-10-5 0-10-5-10-11 0-5-18-37-40-69-22-32-40-64-40-69 0-6-4-11-10-11-5 0-10-5-10-10 0-6-15-33-32-60l-33-50-127 0c-74 0-129-4-133-10-3-5-17-10-30-10-25 0-116-45-155-76-87-69-142-151-178-265-15-46-17-1075-2-1084 5-3 10-17 10-30 0-13 5-27 10-30 6-3 10-13 10-22 0-22 83-135 122-168 57-46 62-50 112-75l50-25 585 0 586 0 63 34c84 46 169 133 212 218l35 68 0 565 0 565-28 59c-32 69-100 157-139 180-15 9-33 22-40 29-23 22-99 57-123 57-13 0-27 5-30 10-4 6-60 10-135 10l-128 0-128 205c-84 136-133 205-144 205-10 0-33-24-54-55z"/></g><text x="1000" y="1300" style="font-size:1000px;fill:#fff;text-anchor:middle">{text}</text></svg>',"marker-square-rounded-cluster":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(33.33 * {scale})" height="calc(32.13 * {scale})" viewBox="0 0 2500 2900"><g transform="translate(100 100)" style="stroke:{secondaryColor};stroke-width:100;fill:{color}"><path d="m874 2669c-9-18-26-49-37-68-11-20-30-55-43-78-13-24-36-64-51-90-14-27-38-69-52-95l-26-48-142 0c-84 0-144-4-148-10-3-5-17-10-30-10-25 0-118-46-154-76-91-76-136-142-175-254-13-38-16-119-16-554 0-358 3-520 12-545 40-125 106-219 195-278 127-84 116-83 646-83l467 0 0-42c0-46 11-87 45-163 54-121 169-220 306-264 46-14 232-14 278 0 165 53 284 175 340 350 19 61 14 204-10 273-32 91-94 178-169 240-38 31-130 76-155 76-13 0-27 5-30 10-3 6-28 10-56 10l-49 0 0 462c0 446-1 464-21 522-32 91-94 178-169 240-38 31-130 76-155 76-13 0-27 5-30 10-4 6-65 10-149 10-138 0-143 1-154 23-12 23-62 114-112 202-16 28-44 79-63 115-42 77-67 88-93 39z"/></g><text x="1650" y="900" style="font-size:1000px;fill:#fff">+</text><text x="1000" y="1800" style="font-size:1000px;fill:#fff;text-anchor:middle">{text}</text></svg>',flag:'<svg xmlns="http://www.w3.org/2000/svg" width="calc(23.5 * {scale})" height="calc(40 * {scale})" viewBox="34 28 198 308"><path style="stroke:{secondaryColor};stroke-width:15;stroke-linecap:round;" d="M42 327l0 -291"/><path style="fill:{color};stroke:{secondaryColor};stroke-width:10;stroke-linejoin:round;" d="M49 50c70 30 104 28 178 2-21 42-21 74 0 116-72 25-101 25-178 0l0-118z"/><text x="130" y="165" style="font-size:100px;fill:#fff;text-anchor:middle">{text}</text></svg>',"flag-triangle":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(27 * {scale})" height="calc(35.33 * {scale})" viewBox="0 0 40.5 53"><g transform="translate(-31 -20)"><path fill="{secondaryColor}" d="M34.7,73.3V48.4l34.6-10.1c0.7-0.2,1.2-0.8,1.2-1.5s-0.4-1.4-1-1.7L33.7,20.5c-0.5-0.2-1.1-0.2-1.6,0.2 c-0.5,0.3-0.7,0.8-0.7,1.4v51.2H34.7z"/><polygon points="34.7,24.5 66,36.5 34.7,45 34.7,10" fill="{color}"/></g><text x="11" y="21" style="font-size:14px;fill:#fff;text-anchor:middle">{text}</text></svg>',"rounded-square":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(34 * {scale})" height="calc(34 * {scale})" viewBox="0 0 34 34"><g transform="translate(2 2)"><rect x="0" y="0" rx="8" ry="8" width="30" height="30" style="stroke:{secondaryColor};stroke-width:2;fill:{color}"/></g><text x="17" y="22" style="font-size:14px;fill:#fff;text-anchor:middle">{text}</text></svg>',"rounded-square-thick":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(38 * {scale})" height="calc(38 * {scale})" viewBox="0 0 38 38"><g transform="translate(4 4)"><rect x="0" y="0" rx="8" ry="8" width="30" height="30" style="stroke:{secondaryColor};stroke-width:4;fill:{color}"/></g><text x="19" y="24" style="font-size:14px;fill:#fff;text-anchor:middle">{text}</text></svg>',triangle:'<svg xmlns="http://www.w3.org/2000/svg" width="calc(36 * {scale})" height="calc(36 * {scale})" viewBox="0 0 36 36"><g transform="translate(2 2)"><polygon points="16,0 32,32 0,32 16,0" style="stroke:{secondaryColor};stroke-width:2;fill:{color}"/></g><text x="17.5" y="30" style="font-size:12px;fill:#fff;text-anchor:middle">{text}</text></svg>',"triangle-thick":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(40 * {scale})" height="calc(40 * {scale})" viewBox="0 0 40 40"><g transform="translate(4 4)"><polygon points="16,0 32,32 0,32 16,0" style="stroke:{secondaryColor};stroke-width:4;fill:{color}"/></g><text x="19.5" y="32" style="font-size:12px;fill:#fff;text-anchor:middle">{text}</text></svg>',hexagon:'<svg xmlns="http://www.w3.org/2000/svg" width="calc(35 * {scale})" height="calc(40 * {scale})" viewBox="0 0 35 40"><g transform="translate(2 2)"><path d="M31 9 15.5 0 0 9 0 27 15.5 36 31 27 31 9Z" style="stroke:{secondaryColor};stroke-width:2;fill:{color}"/></g><text x="17.5" y="25" style="font-size:14px;fill:#fff;text-anchor:middle">{text}</text></svg>',"hexagon-thick":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(39 * {scale})" height="calc(44 * {scale})" viewBox="0 0 39 44"><g transform="translate(4 4)"><path d="M31 9 15.5 0 0 9 0 27 15.5 36 31 27 31 9Z" style="stroke:{secondaryColor};stroke-width:4;fill:{color}"/></g><text x="19.5" y="27" style="font-size:14px;fill:#fff;text-anchor:middle">{text}</text></svg>',"hexagon-rounded":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(40 * {scale})" height="calc(40 * {scale})" viewBox="0 0 1100 1100"><g transform="translate(50 50)"><path style="stroke:{secondaryColor};stroke-width:50;fill:{color}" d="M881 210 561 25c-33-19-88-19-121 0L119 210c-33 19-61 67-61 105v370c0 39 27 86 61 105l321 185c33 19 88 19 122 0l321-185c33-19 61-67 61-105V315C942 276 915 229 881 210z"/></g><text x="550" y="700" style="font-size:400px;fill:#fff;text-anchor:middle">{text}</text></svg>',"hexagon-rounded-thick":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(40 * {scale})" height="calc(40 * {scale})" viewBox="0 0 1200 1200"><g transform="translate(100 100)"><path style="stroke:{secondaryColor};stroke-width:100;fill:{color}" d="M881 210 561 25c-33-19-88-19-121 0L119 210c-33 19-61 67-61 105v370c0 39 27 86 61 105l321 185c33 19 88 19 122 0l321-185c33-19 61-67 61-105V315C942 276 915 229 881 210z"/></g><text x="600" y="750" style="font-size:400px;fill:#fff;text-anchor:middle">{text}</text></svg>',"triangle-arrow-up":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(28 * {scale})" height="calc(28 * {scale})" viewBox="0 0 28 28"><g transform="translate(2 2)"><polygon points="12,0 0,24 12,17 24,24" stroke-width="2" stroke="{secondaryColor}" fill="{color}"/></g><text x="14" y="17" style="font-size:8px;fill:#fff;text-anchor:middle">{text}</text></svg>',"triangle-arrow-left":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(28 * {scale})" height="calc(28 * {scale})" viewBox="0 0 28 28"><g transform="translate(2 2)"><polygon points="24,12 0,0 7,12 0,24" stroke-width="2" stroke="{secondaryColor}" fill="{color}"/></g><text x="14" y="16.5" style="font-size:8px;fill:#fff;text-anchor:middle">{text}</text></svg>',"arrow-up":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(12.16 * {scale})" height="calc(30.1 * {scale})" viewBox="0 0 902 364"><g fill="{color}" transform="matrix(0,2.4,-2.4,0,897,-930)"><polygon points="902,222 233,222 233,364 0,182 233,0 233,141 902,141 902,222"/></g><text x="450" y="700" style="font-size:900px;fill:#000;text-anchor:middle">{text}</text></svg>',"arrow-up-thin":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(16 * {scale})" height="calc(33.33 * {scale})" viewBox="0 0 12 25"><g transform="translate(-136.91823 -751.91998)"><path fill="{color}" d="m148.271 760.71c-1.641-.547-3.186-1.47-4.633-2.769l0 18.07-1.675 0 0-18.07c-1.447 1.299-2.986 2.222-4.616 2.769l0-1.231c2.325-1.596 4.006-3.812 5.043-6.65l.838 0c1.037 2.838 2.718 5.055 5.043 6.65l0 1.231z"/></g><text x="6" y="20" style="font-size:10px;fill:#000;text-anchor:middle">{text}</text></svg>',car:'<svg xmlns="http://www.w3.org/2000/svg" width="calc(21.93 * {scale})" height="calc(40.9 * {scale})" viewBox="0 0 6580 12270"><g transform="translate(0 12270) rotate(-90)"><path fill="{secondaryColor}" d="M7045 6566c-42-13-105-44-105-51 0-2 23-105 50-228 28-123 50-230 50-236 0-8-241-11-907-11-855 0-1145 6-1513 30-85 6-189 13-230 15-41 3-133 10-205 15-286 21-430 32-705 50-953 63-1459 18-2335-205-304-77-746-209-799-238-131-72-221-408-285-1062-34-345-42-532-48-1130-16-1557 108-2532 336-2649 32-17 469-149 676-205 409-110 819-191 1205-238 116-14 224-18 540-18 395 1 494 5 1140 50 1124 79 1224 82 2496 78l641-3-53-237c-29-131-52-238-51-239 1-1 31-14 66-29 56-23 76-26 142-23 67 3 83 7 120 33 23 17 50 41 61 55 10 14 51 117 91 230l73 205 674 3 675 2 90-39c98-43 198-72 315-93 122-21 829-18 990 5 321 45 626 143 849 270 293 168 516 378 704 662 266 402 416 893 467 1527 15 174 8 882-9 998-6 41-18 127-27 190-69 502-253 969-523 1325-79 105-262 284-381 374-189 142-355 229-574 300-336 110-526 139-952 148-457 9-685-23-887-124l-47-24-678-6-678-6-64 179c-79 224-92 253-121 284-67 70-177 97-274 66zm-2752-5073c-23-2-64-2-90 0-26 2-7 3 42 3 50 0 71-1 48-3zm395 0c-21-2-55-2-75 0-21 2-4 4 37 4 41 0 58-2 38-4z"/><path fill="{color}" d="M7043 6498c-13-6-23-19-23-28 0-9 23-117 50-240 28-123 50-230 50-237 0-22-2126-13-2465 10-132 10-400 28-595 42-661 47-824 55-1160 62-435 7-656-8-1040-73-415-70-865-183-1447-365-168-53-272-556-325-1569-16-319-16-1311 0-1630 45-872 129-1366 257-1518 22-26 51-39 172-77 557-177 1122-310 1563-369 271-36 351-40 690-40 361 1 463 6 1165 54 1122 78 1288 83 2337 79 460-2 840-7 843-11 4-4-17-117-47-252l-55-245 39-16c76-30 180-8 224 47 10 13 54 124 98 246l79 222 709 0 709 0 47-24c74-37 219-83 322-101 122-22 606-32 802-16 374 29 658 102 933 238 124 62 271 155 361 230l61 51 6 100c19 278 103 497 247 643 88 89 173 136 278 152l70 11 41 131c116 369 159 673 168 1170 10 584-38 984-167 1397l-40 126-70 12c-193 33-348 175-441 405-56 139-89 302-89 445 0 43-3 47-58 91-290 235-644 384-1068 450-191 29-796 39-974 16-135-18-263-54-368-102l-75-35-701 0-701 0-79 223c-82 232-102 267-163 293-38 16-138 17-170 2zm-2023-820c332-15 1155-12 1835 6 308 8 563 12 566 8 4-4 10-21 13-38 7-30 6-31-92-77-518-244-1197-396-2112-474-295-25-1282-25-1579 0-231 20-473 46-479 51-6 7 49 110 93 171 160 226 416 335 855 365 142 10 539 5 900-12zm3304-263c525-111 899-887 934-1935 19-557-37-1023-172-1435-186-563-521-900-896-899-81 0-158 14-525 92-426 91-431 92-540 146-195 96-287 207-306 368-12 104-11 2985 1 3078 22 170 135 291 365 389 49 21 191 55 480 115 226 47 419 87 430 89 45 10 164 6 229-8zm-5570-485c112-43 197-156 216-291 12-83 13-2623 1-2706-23-158-125-273-270-304-44-9-100-1-542 75-272 47-514 91-539 98-266 68-487 424-594 958-56 280-70 548-40 800 56 484 207 878 414 1081 115 114 122 116 702 218 277 49 524 90 550 90 26 1 72-8 102-19zm2111-3440c1023-44 1884-213 2462-486l113-53-7-33c-3-18-8-35-10-37-2-3-236 1-521 7-993 24-1271 26-1708 11-541-18-1128-18-1249-1-377 56-588 181-734 437-32 55-41 79-32 84 12 8 246 32 491 51 356 28 815 36 1195 20z"/></g><text x="3250" y="8250" style="font-size:3000px;fill:#fff;text-anchor:middle">{text}</text></svg>',checker:'<svg xmlns="http://www.w3.org/2000/svg" width="calc(16 * {scale})" height="calc(16 * {scale})" viewBox="0 0 16 16"><pattern id="p" x="0" y="0" width="16" height="16" patternUnits="userSpaceOnUse"><rect fill="{color}" x="0" width="8" height="8" y="0"/><rect fill="{color}" x="8" width="8" height="8" y="8"/></pattern><rect x="0" y="0" width="16" height="16" fill="{secondaryColor}"/><rect x="0" y="0" width="16" height="16" fill="url(#p)"/></svg>',"checker-rotated":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(16 * {scale})" height="calc(16 * {scale})" viewBox="0 0 60 60"><rect width="60" height="60" fill="{secondaryColor}"/><rect width="42.42" height="42.42" transform="translate(30 0) rotate(45)" fill="{color}"/></svg>',"zig-zag":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(15 * {scale})" height="calc(15 * {scale})" viewBox="0 0 120 120"><rect x="0" y="0" width="120" height="120" fill="{secondaryColor}"/><polygon fill="{color}" points="120 120 60 120 90 90 120 60 120 0 120 0 60 60 0 0 0 60 30 90 60 120 120 120"/></svg>',"zig-zag-vertical":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(15 * {scale})" height="calc(15 * {scale})" viewBox="0 0 120 120"><rect x="0" y="0" width="120" height="120" fill="{secondaryColor}"/><polygon fill="{color}" points="120 0 120 60 90 30 60 0 0 0 0 0 60 60 0 120 60 120 90 90 120 60 120 0"/></svg>',"circles-spaced":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(20 * {scale})" height="calc(20 * {scale})" viewBox="0 0 20 20"><defs><pattern id="p" x="0" y="0" width="20" height="20" patternUnits="userSpaceOnUse"><circle cx="10" cy="10" r="2" stroke="none" fill="{color}"/></pattern></defs><rect x="0" y="0" width="20" height="20" fill="{secondaryColor}"/><rect x="0" y="0" width="100" height="100" fill="url(#p)"/></svg>',circles:'<svg xmlns="http://www.w3.org/2000/svg" width="calc(7 * {scale})" height="calc(7 * {scale})" viewBox="0 0 20 20"><defs><pattern id="p" x="0" y="0" width="20" height="20" patternUnits="userSpaceOnUse"><circle cx="10" cy="10" r="6" stroke="none" fill="{color}"/></pattern></defs><rect x="0" y="0" width="20" height="20" fill="{secondaryColor}"/><rect x="0" y="0" width="100" height="100" fill="url(#p)"/></svg>',"diagonal-lines-up":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(18 * {scale})" height="calc(18 * {scale})" viewBox="0 0 6 6"><rect x="0" y="0" width="6" height="6" fill="{secondaryColor}"/><g fill="{color}"><path d="M5 0h1L0 6V5zM6 5v1H5z"/></g></svg>',"diagonal-lines-down":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(18 * {scale})" height="calc(18 * {scale})" viewBox="0 0 6 6"><rect x="0" y="0" width="6" height="6" fill="{secondaryColor}"/><g transform="rotate(90 3 3)" fill="{color}"><path d="M5 0h1L0 6V5zM6 5v1H5z"/></g></svg>',"diagonal-stripes-up":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(20 * {scale})" height="calc(20 * {scale})" viewBox="0 0 40 40"><rect x="0" y="0" width="40" height="40" fill="{secondaryColor}"/><g fill="{color}"><path d="M0 40L40 0H20L0 20M40 40V20L20 40"/></g></svg>',"diagonal-stripes-down":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(20 * {scale})" height="calc(20 * {scale})" viewBox="0 0 40 40"><rect x="0" y="0" width="40" height="40" fill="{secondaryColor}"/><g transform="rotate(90 20 20)" fill="{color}"><path d="M0 40L40 0H20L0 20M40 40V20L20 40"/></g></svg>',"grid-lines":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(14 * {scale})" height="calc(14 * {scale})" viewBox="0 0 6 6"><rect x="0" y="0" width="6" height="6" fill="{secondaryColor}"/><g transform="rotate(45 3 3)" fill="{color}"><path d="M5 0h1L0 6V5zM6 5v1H5z"/></g><g fill="{color}" transform="rotate(-45 3 3)"><path d="M5 0h1L0 6V5zM6 5v1H5z"/></g></svg>',"rotated-grid-lines":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(18 * {scale})" height="calc(18 * {scale})" viewBox="0 0 6 6"><rect x="0" y="0" width="6" height="6" fill="{secondaryColor}"/><g transform="rotate(90 3 3)" fill="{color}"><path d="M5 0h1L0 6V5zM6 5v1H5z"/></g><g fill="{color}"><path d="M5 0h1L0 6V5zM6 5v1H5z"/></g></svg>',"rotated-grid-stripes":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(20 * {scale})" height="calc(20 * {scale})" viewBox="0 0 40 40"><rect x="0" y="0" width="40" height="40" fill="{secondaryColor}"/><g transform="rotate(90 20 20)" fill="{color}"><path d="M0 40L40 0H20L0 20M40 40V20L20 40"/></g><g fill="{color}"><path d="M0 40L40 0H20L0 20M40 40V20L20 40"/></g></svg>',"x-fill":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(40 * {scale})" height="calc(40 * {scale})" viewBox="0 0 40 40"><rect x="0" y="0" width="45.3" height="45.3" fill="{secondaryColor}"/><g fill="{color}"><path d="M0 38.59l2.83-2.83 1.41 1.41L1.41 40H0v-1.41zM0 1.4l2.83 2.83 1.41-1.41L1.41 0H0v1.41zM38.59 40l-2.83-2.83 1.41-1.41L40 38.59V40h-1.41zM40 1.41l-2.83 2.83-1.41-1.41L38.59 0H40v1.41zM20 18.6l2.83-2.83 1.41 1.41L21.41 20l2.83 2.83-1.41 1.41L20 21.41l-2.83 2.83-1.41-1.41L18.59 20l-2.83-2.83 1.41-1.41L20 18.59z"/></g></svg>',dots:'<svg xmlns="http://www.w3.org/2000/svg" width="calc(13 * {scale})" height="calc(13 * {scale})" viewBox="0 0 20 20"><rect x="0" y="0" width="20" height="20" fill="{secondaryColor}"/><g fill="{color}"><circle cx="3" cy="3" r="3"/><circle cx="13" cy="13" r="3"/></g></svg>'},Uc=(qc.getHighContrastMode=function(){return matchMedia("(-ms-high-contrast: white-on-black)").matches?"dark":matchMedia("(-ms-high-contrast: black-on-white)").matches?"light":matchMedia("(-ms-high-contrast: active)").matches?"dark":matchMedia("(inverted-colors: inverted)").matches?"invert":null},qc);function qc(){}var Gc,Zc,Hc=((window&&window.__extends||(Gc=function(t,e){return(Gc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}Gc(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(Kc,Zc=P),Kc);function Kc(){var t=null!==Zc&&Zc.apply(this,arguments)||this;return t.copyrightMessage=void 0,t.copyrightContent=void 0,t.customAttribution=void 0,t.showFeedbackLink=!0,t.showLogo=!0,t}var Wc,Vc,Yc=((window&&window.__extends||(Wc=function(t,e){return(Wc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}Wc(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(Qc,Vc=ot),Qc.prototype.onAdd=function(t){return this.container=this.buildContainer(t,u.ControlStyle.auto),this.container.className="map-copyright",this.copyrightDiv=this.buildCopyrightDiv(),this.copyrightDiv.className="azure-map-copyright",this.container.appendChild(this.copyrightDiv),this.options.showLogo&&this.addRemoveLogo(!0),this.options.showFeedbackLink&&this.addRemoveFeedbackDiv(!0),this.container},Qc.prototype.onRemove=function(){Vc.prototype.onRemove.call(this),delete this.container},Qc.prototype.setOptions=function(t){var e=this,o=(new Hc).merge(this.options,t);o.copyrightMessage===this.options.copyrightMessage&&o.customAttribution===this.options.customAttribution||(this.copyrightDiv.innerText=this.textAttribution(o)),o.copyrightContent!==this.options.copyrightContent&&(this.options.copyrightContent&&(t=Array.from(this.copyrightDiv.children).find(function(t){return t===e.options.copyrightContent}),this.copyrightDiv.removeChild(t)),0<this.copyrightDiv.childNodes.length?this.copyrightDiv.insertBefore(o.copyrightContent,this.copyrightDiv.childNodes[0]):this.copyrightDiv.appendChild(o.copyrightContent),this.options.copyrightContent=o.copyrightContent),!o.showLogo&&this.logoAnchor?this.addRemoveLogo(!1):o.showLogo&&!this.logoAnchor&&this.addRemoveLogo(!0),!o.showFeedbackLink&&this.feedbackAnchor?this.addRemoveFeedbackDiv(!1):o.showFeedbackLink&&!this.feedbackAnchor&&this.addRemoveFeedbackDiv(!0),this.options=o},Qc.prototype.getDefaultAttributions=function(){var t=(new Date).getFullYear(),e=["©"+t+" TomTom"];return this.options.showLogo||e.push("©"+t+" Microsoft"),e},Qc.prototype.buildCopyrightDiv=function(){var t=document.createElement("div");return t.innerText=this.textAttribution(this.options)||"",t},Qc.prototype.buildFeedbackLink=function(){var t=document.createElement("a");return t.setAttribute("alt","Give Feedback"),t.setAttribute("aria-label","Give Feedback"),t.href="https://feedback.azuremaps.com",t.target="_blank",t.rel="noopener",t.className="azure-map-feedback",t},Qc.prototype.addRemoveFeedbackDiv=function(t){t?(this.feedbackAnchor=this.buildFeedbackLink(),this.tooltip=U("Give Feedback"),this.container.appendChild(this.feedbackAnchor),this.container.appendChild(this.tooltip),q(this.tooltip,this.feedbackAnchor)):(this.feedbackAnchor.remove(),this.tooltip.remove(),delete this.tooltip,delete this.feedbackAnchor)},Qc.prototype.addRemoveLogo=function(t){t?(this.logoAnchor=document.createElement("a"),this.logoAnchor.className="azure-map-logo",this.logoAnchor.href="https://microsoft.com",this.logoAnchor.setAttribute("aria-label","Microsoft"),this.container.appendChild(this.logoAnchor),this.logoTooltip=U("Visit microsoft.com"),this.container.appendChild(this.logoTooltip),q(this.logoTooltip,this.logoAnchor)):(this.logoAnchor.remove(),this.logoTooltip.remove(),delete this.logoAnchor)},Qc);function Qc(t){var e=Vc.call(this)||this;return e.textAttribution=function(t){return[e.options.copyrightMessage,e.options.customAttribution].filter(function(t){return t}).join("")},e.options=(new Hc).merge(t),e}var Jc=(Xc.throwOnError=function(t,e){function o(t){throw n.off("error",o),t.error}var n=t instanceof fd?t._getMap():t;n.on("error",o);e=e();return n.off("error",o),e},Xc.tryCatch=function(t,e,o,n){try{return this.throwOnError(t,e)}catch(t){return o(t)}finally{"function"==typeof n&&n()}},Xc.tryFinally=function(t,e,o){try{return this.throwOnError(t,e)}finally{o()}},Xc);function Xc(){}var $c=window&&window.__assign||function(){return($c=Object.assign||function(t){for(var e,o=1,n=arguments.length;o<n;o++)for(var r in e=arguments[o])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},tu=(eu.prototype.request=function(t){var e={domain:this.map.getServiceOptions().domain,path:"search/address/reverse/json",queryParams:$c({"api-version":"1.0",language:t.style.language,limit:1,query:Qr(t.position[1])+","+Jr(t.position[0])},t.style.view&&{view:t.style.view})};return new j((null===(t=this.map.authentication)||void 0===t?void 0:t.signRequest(e))||e).get()},eu);function eu(t){this.map=t}var ou=(nu.prototype.cache=function(t,e,o,n){n=t+"_"+o[0]+"_"+o[1]+"_"+n;this._labelIdx[e.labelType]||(this._labelIdx[e.labelType]=[],this._labelCache[e.labelType]=[]),-1===this._labelIdx[e.labelType].indexOf(n)&&(this._labelCache[e.labelType].push({name:t,radius:e.radius,minZoom:e.minZoom,maxZoom:e.maxZoom||24,position:o}),this._labelIdx[e.labelType].push(n))},nu.prototype.getNearestLabel=function(t,e,o){var n=null,r=this._labelCache[t];if(r)for(var i,s=1/0,a=0,l=r.length;a<l;a++)o>=r[a].minZoom&&o<=r[a].maxZoom&&((i=Br(r[a].position,e))<=r[a].radius&&i<=s&&(s=i,n=r[a]));return n},nu.prototype._preloadCache=function(t){if(!this._preloadedCache.has(t)){this._preloadedCache.add(t);var e={source:["Ocean label","Ocean name"],labelType:"water",minZoom:0,radius:395e4,polygonSources:["Ocean","Ocean or sea"]},o=t,n=o.indexOf("-");switch(o=-1!==n?o.substr(0,n):o){case"fr":this.cache("Océan Pacifique",e,[-170,32],t),this.cache("Océan Pacifique",e,[-138,-27],t),this.cache("Océan Atlantique",e,[-40,32],t),this.cache("Océan Atlantique",e,[-17,-29],t);break;case"es":this.cache("Océan Pacifique",e,[-170,32],t),this.cache("Océan Pacifique",e,[-138,-27],t),this.cache("Océano Atlántico",e,[-40,32],t),this.cache("Océano Atlántico",e,[-17,-29],t);break;case"pt":this.cache("Oceano Pacífico",e,[-170,32],t),this.cache("Oceano Pacífico",e,[-138,-27],t),this.cache("Oceano Atlântico",e,[-40,32],t),this.cache("Oceano Atlântico",e,[-17,-29],t);break;case"ja":this.cache("太平洋",e,[-170,32],t),this.cache("太平洋",e,[-138,-27],t);break;case"en":this.cache("Pacific Ocean",e,[-170,32],t),this.cache("Pacific Ocean",e,[-138,-27],t),this.cache("Atlantic Ocean",e,[-40,32],t),this.cache("Atlantic Ocean",e,[-17,-29],t),this.cache("Indian Ocean",e,[77,-26],t)}}},nu);function nu(){this._labelCache={},this._labelIdx={},this._preloadedCache=new Set}var ru=window&&window.__awaiter||function(t,s,a,l){return new(a=a||Promise)(function(o,e){function n(t){try{i(l.next(t))}catch(t){e(t)}}function r(t){try{i(l.throw(t))}catch(t){e(t)}}function i(t){var e;t.done?o(t.value):((e=t.value)instanceof a?e:new a(function(t){t(e)})).then(n,r)}i((l=l.apply(t,s||[])).next())})},iu=window&&window.__generator||function(o,n){var r,i,s,a={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},t={next:e(0),throw:e(1),return:e(2)};return"function"==typeof Symbol&&(t[Symbol.iterator]=function(){return this}),t;function e(e){return function(t){return function(e){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,i&&(s=2&e[0]?i.return:e[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,e[1])).done)return s;switch(i=0,(e=s?[2&e[0],s.value]:e)[0]){case 0:case 1:s=e;break;case 4:return a.label++,{value:e[1],done:!1};case 5:a.label++,i=e[1],e=[0];continue;case 7:e=a.ops.pop(),a.trys.pop();continue;default:if(!(s=0<(s=a.trys).length&&s[s.length-1])&&(6===e[0]||2===e[0])){a=0;continue}if(3===e[0]&&(!s||e[1]>s[0]&&e[1]<s[3])){a.label=e[1];break}if(6===e[0]&&a.label<s[1]){a.label=s[1],s=e;break}if(s&&a.label<s[2]){a.label=s[2],a.ops.push(e);break}s[2]&&a.ops.pop(),a.trys.pop();continue}e=n.call(o,a)}catch(t){e=[6,t],i=0}finally{r=s=0}if(5&e[0])throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}([e,t])}}},su=window&&window.__read||function(t,e){var o="function"==typeof Symbol&&t[Symbol.iterator];if(!o)return t;var n,r,i=o.call(t),s=[];try{for(;(void 0===e||0<e--)&&!(n=i.next()).done;)s.push(n.value)}catch(t){r={error:t}}finally{try{n&&!n.done&&(o=i.return)&&o.call(i)}finally{if(r)throw r.error}}return s},au=(lu.prototype.dispose=function(){this._disposed=!0;var t=this._map._getMap();t.off("move",this._onMove),t.off("moveend",this._onMoveEnd),t.off("styledata",this._onStyleData),t.off("rotate",this._onRotate);t=this._map.getCanvas();t.removeEventListener("mousedown",this._onPointerDown),t.removeEventListener("touchstart",this._onPointerDown),this._map.getMapContainer().removeEventListener("keydown",this._shortcutListener)},lu.prototype._getEventPos=function(t){if("touches"in t){var e=t.touches[0],o=t.target.getBoundingClientRect();return[e.pageX-o.left,e.pageY-o.top]}return[t.offsetX,t.offsetY]},lu.prototype._checkThresholds=function(t,e){return this._checkZoomThreshold(t.zoom,e.zoom)||this._checkPitchThreshold(t.pitch,e.pitch)||this._checkLocThreshold(t.center,e.center)||this._checkHeadingThreshold(t.bearing,e.bearing)},lu.prototype._checkZoomThreshold=function(t,e){return this._round(t)!==this._round(e)},lu.prototype._checkPitchThreshold=function(t,e){return Math.abs(t-e)>=this._pitchThreshold},lu.prototype._checkLocThreshold=function(t,e){e=su(this._map.positionsToPixels([e,t]),2),t=e[0],e=e[1];return ar.getDistance(t,e)>=this._moveThreshold},lu.prototype._checkHeadingThreshold=function(t,e){t<0&&(t+=360),e<0&&(e+=360);e=Math.abs(t-e);return(e=180<e?360-e:e)>=this._headingThreshold},lu.prototype._getLocDesc=function(p,h,d){return ru(this,void 0,void 0,function(){var e,o,n,r,i,s,a,l,c,u=this;return iu(this,function(t){switch(t.label){case 0:return"blank"===d?[3,3]:this._map._getMap().loaded()?[3,2]:[4,new Promise(function(t){return u._map._getMap().once("idle",t)})];case 1:t.sent(),t.label=2;case 2:for(e={},o=this._map.positionsToPixels([p.center])[0],Jc.tryCatch(this._map,function(){n=u._map._getMap().queryRenderedFeatures(o,{layers:u._polygonStyleLayer,filter:["==",["geometry-type"],"Polygon"]})},function(){}),r=null,n&&0<n.length&&(r=n[0]),i=null,s=0,a=this._lableConfig.length;s<a;s++)l=this._lableConfig[s],p.zoom>=l.minZoom?l.polygonSources?r&&-1!==l.polygonSources.indexOf(r.layer["source-layer"])?(i=l.labelType,this._getClosestLabel(l,p,h,e,!1)):this._getClosestLabel(l,p,h,e,!0):this._getClosestLabel(l,p,h,e,!1):this._getClosestLabel(l,p,h,e,!0);return 8<=p.zoom&&this._processRoads(e,p,h),this._labelCache.forEach(function(t){e[t]||(c=null,(c="water"!==t&&"majorPoi"!==t||t===i?lu._labelCache.getNearestLabel(t,p.center,p.zoom):c)&&(e[t]=c.name))}),[2,this._processLocInfo(p,i,e,!0,this._restFallback)];case 3:return[2,this._processLocInfo(p,null,null,!1,!1)]}})})},lu.prototype._getHeadingDesc=function(t){var e=t.bearing;switch(e<0&&(e+=360),e=this._round(e,this._headingThreshold)){case 0:case 360:return"north";case 45:return"north east";case 90:return"east";case 135:return"south east";case 180:return"south";case 225:return"south west";case 270:return"west";case 315:return"north west";default:return e+" degrees"}},lu.prototype._getClosestLabel=function(t,e,o,n,r){for(var i=t.radius,s=0,a=t.source.length;s<a;s++){var l={sourceLayer:t.source[s]},c=this._map._getMap().querySourceFeatures(this._baseVectorTileSourceId,l),u=null,p=1/0,h=this._labelCache.has(t.labelType);if(!r||h)for(var d=0,f=c.length;d<f;d++){var y,m="Point"===c[d].geometry.type?c[d]:hi(e.center,c[d].geometry);r||(y="Point"===c[d].geometry.type?Br(e.center,m.geometry.coordinates):m.properties.distance)<p&&(p=y,u=c[d]),h&&lu._labelCache.cache(c[d].properties.name,t,m.geometry.coordinates,o)}r||(l=t.labelType+"Dis",u&&p<=i&&("number"!=typeof n[l]||p<=n[l])&&(n[t.labelType]=u.properties.name,n[l]=p))}},lu.prototype._processRoads=function(t,e,o,n){var r=this._map._getMap().queryRenderedFeatures(n,{filter:["==",["geometry-type"],"LineString"]});if(r){for(var i,s=void 0,a=void 0,l=void 0,c=void 0,u=0,p=r.length;u<p;u++)this._roadLayers.has(r[u].layer["source-layer"])&&r[u].properties.name&&""!==r[u].properties.name&&(i=hi(e.center,r[u]),(!l||i.properties.distance<l.properties.distance)&&(s&&r[u].properties.name===s.properties.name?l=i:s&&r[u].properties.name===s.properties.name?(!c||i.properties.distance<c.properties.distance)&&(c=i,a=r[u]):(c=l,a=s,l=i,s=r[u])));s&&(t.country||(t.country=s.properties.country_code,t.countryDis=0,lu._labelCache.cache(t.country,{source:["Country name"],labelType:"country",radius:5e3,minZoom:0},l.geometry.coordinates,o)),t.state||(t.state=s.properties.country_subdivision,t.stateDis=0,lu._labelCache.cache(t.state,{source:["State name"],labelType:"state",radius:5e3,minZoom:4},l.geometry.coordinates,o)),15<=e.zoom&&(n=this._map.positionsToPixels([e.center,l.geometry.coordinates]),(ar.getDistance(n[0],n[1])<this._roadPixelRadius||l.properties.distance<this._minRoadDistance)&&(t.road=s.properties.name),a&&(o=this._map.positionsToPixels([c.geometry.coordinates]),(ar.getDistance(n[0],o[0])<this._minIntersectionPixelDistance||c.properties.distance<this._minRoadDistance)&&(t.secondRoad=a.properties.name,t.secondRoadDis=c.properties.distance))))}},lu.prototype._getActionDesc=function(t){if(this._lastCam){var e,o,n=[];return this._checkLocThreshold(t.center,this._lastCam.center)&&(o=["panned"],0===(e=Math.round(Zr(this._lastCam.center,t.center)))||360===e?o.push("north"):e<90?o.push("north east"):90===e?o.push("east"):e<180?o.push("south east"):180===e?o.push("south"):e<270?o.push("south west"):270===e?o.push("west"):e<360&&o.push("north west"),e=Br(this._lastCam.center,t.center,hr.meters),o.push(1e3<e?jr(e/1e3,2)+" kilometers":jr(e,2)+" meters"),n.push(o.join(" "))),this._checkZoomThreshold(t.zoom,this._lastCam.zoom)&&((o=["zoomed"]).push(this._lastCam.zoom<t.zoom?"in":"out"),1<=(e=Math.abs(this._lastCam.zoom-t.zoom))&&(e=Math.ceil(e),o.push(1<e?e+" levels":e+" level")),this._getCanonicalZoom(this._lastCam.zoom)!==this._getCanonicalZoom(t.zoom)&&o.push("to "+this._getCanonicalZoom(t.zoom)+" level"),t.zoom>=t.maxZoom&&o.push("Zoom In button disabled, maximum zoom level reached"),e=Ci.getSouth(t.bounds)<=-Sr&&Ci.getNorth(t.bounds)>=Sr,(t.zoom<=t.minZoom||e)&&o.push("Zoom Out button disabled, minimum zoom level reached"),n.push(o.join(" "))),this._checkPitchThreshold(t.pitch,this._lastCam.pitch)&&(o=this._round(t.pitch,this._pitchThreshold),n.push("pitched to "+o+" degrees"),60!==t.pitch&&0!==t.pitch||(o=60===t.pitch?"maximum":"minimum",n.push("reached "+o+" of "+t.pitch+" degrees"))),this._checkHeadingThreshold(this._lastCam.bearing,t.bearing)&&n.push("rotated to "+this._getHeadingDesc(t)),n.join(" and ")||null}return null},lu.prototype._getCanonicalZoom=function(t){return(t=this._round(t))<2?"world":t<5?"country":t<11?"state province":t<15?"city":"street"},lu.prototype._processLocInfo=function(r,i,s,a,l){var c=this;return new Promise(function(e,t){var o=[];if(a){var n=[];if(s&&(i&&("water"===i&&s.water?n.push(s.water):"majorPoi"===i&&s.majorPoi&&n.push(s.majorPoi)),0===n.length&&(s.majorPoi&&8<=r.zoom?n.push(s.majorPoi):(s.poi&&14<=r.zoom?n.push(s.poi):s.road&&15<=r.zoom&&(s.secondRoad?n.push(s.road+" & "+s.secondRoad):n.push(s.road)),s.neighbourhood&&12<=r.zoom&&n.push(s.neighbourhood),s.city&&6<=r.zoom&&n.push(s.city)),s.state&&4<=r.zoom&&n.push(s.state),0===n.length?s.water?n.push(s.water):s.country&&n.push(s.country):1===n.length&&s.state&&4<=r.zoom&&s.country&&n.push(s.country))),0<n.length)o.push("<p>Location: ",n.join(", "),".</p>");else if(l&&"water"!==i)return void c._reverseGeocodeDescription(r).then(function(t){e(t)},function(){t("<p>Location: unknown</p>")})}c._returnDetailedDescriptions&&(o.push("<p>Zoom: ",jr(r.zoom,2),".</p>"),o.push("<p>Latitude: ",jr(r.center[1],5),".</p>"),o.push("<p>Longitude: ",jr(r.center[0],5),".</p>")),e(o.join(""))})},lu.prototype._reverseGeocodeDescription=function(r){var i=this;return new Promise(function(o){var n=i._map.getStyle();i._reverseSearch.request({position:r.center,style:n}).then(function(t){var e={};t&&t.addresses&&0<t.addresses.length&&t.addresses[0].address&&((t=t.addresses[0].address).country&&(e.country=t.country,lu._labelCache.cache(e.country,{source:["Country name"],labelType:"country",radius:5e3,minZoom:0},r.center,n.language)),t.countrySubdivision&&(e.state=t.countrySubdivision,lu._labelCache.cache(e.state,{source:["State name"],labelType:"state",radius:5e3,minZoom:4},r.center,n.language)),t.municipality&&(e.city=t.municipality,lu._labelCache.cache(e.state,{source:["Small city"],labelType:"city",radius:1e3,minZoom:10},r.center,n.language)),t.streetNameAndNumber?e.road=t.streetNameAndNumber:t.street&&(e.road=t.street)),i._processLocInfo(r,null,e,!0,!1).then(function(t){o(t)})},function(t){i._processLocInfo(r,null,null,!0,!1).then(function(t){o(t)})}).catch(function(t){i._processLocInfo(r,null,null,!0,!1).then(function(t){o(t)})})})},lu.prototype._round=function(t,e){return void 0===e&&(e=1),Math.round(t/e)*e},lu);function lu(t,e){var i=this;this._disposed=!1,this._lastHeadingTime=0,this._actionQueue=[],this._pointerUpdateDelay=3e3,this._camUpdateDelay=1e3,this._headUpdateLimit=1e3,this._controlEventDelay=500,this._moveThreshold=25,this._headingThreshold=5,this._pitchThreshold=5,this._roadPixelRadius=120,this._minRoadDistance=25,this._minIntersectionPixelDistance=50,this._baseVectorTileSourceId="microsoft.base",this._lableConfig=[{source:["Ocean label","Ocean name"],labelType:"water",minZoom:0,radius:395e4,polygonSources:["Ocean","Ocean or sea"]},{source:["Sea label"],labelType:"water",minZoom:3,radius:1e6,polygonSources:["Sea","Ocean or sea"]},{source:["Country name"],labelType:"country",minZoom:0,maxZoom:5,radius:3e5},{source:["State name","State name short"],labelType:"state",minZoom:4,maxZoom:7,radius:3e5},{source:["Capital city","Large city"],labelType:"city",minZoom:8,radius:4e4},{source:["Medium city"],labelType:"city",minZoom:8,radius:3e4},{source:["Small city"],labelType:"city",minZoom:8,radius:2e4},{source:["Island label"],labelType:"city",minZoom:8,radius:1e4},{source:["Town"],labelType:"city",minZoom:10,radius:1e4},{source:["Village"],labelType:"neighbourhood",minZoom:12,radius:6e3},{source:["Amusement area label"],labelType:"poi",minZoom:14,radius:2e3,polygonSources:["Amusement park"]},{source:["Hospital label"],labelType:"poi",minZoom:14,radius:1e3,polygonSources:["Hospital"]},{source:["Shopping centre label"],labelType:"poi",minZoom:14,radius:1e3,polygonSources:["Shopping"]},{source:["Stadium label"],labelType:"poi",minZoom:14,radius:1e3,polygonSources:["Stadium"]},{source:["University/School label"],labelType:"poi",minZoom:14,radius:1e3,polygonSources:["University"]},{source:["Zoo label"],labelType:"poi",minZoom:14,radius:1e3,polygonSources:["Zoo"]},{source:["Airport Label","Airport name","Airport POI"],labelType:"majorPoi",minZoom:11,radius:3e3,polygonSources:["Airport","Runway"]},{source:["National park label"],labelType:"majorPoi",minZoom:7,radius:15e3,polygonSources:["National or state park","National park","Forest"]},{source:["Reservation label"],labelType:"majorPoi",minZoom:7,radius:15e3,polygonSources:["Reservation"]}],this._polygonStyleLayer=["National or state park","National park","Reservation","Airport","Runway","Stadium","University","Zoo","Shopping","Hospital","Amusement park","Ocean","Sea","Ocean or sea"],this._labelCache=new Set(["city","state","country","water","majorPoi"]),this._roadLayers=new Set(["Connecting road","Connecting road tunnel","International road","International road tunnel","Local road","Local road tunnel","Major local road","Major local road tunnel","Major road","Major road tunnel","Minor local road","Minor local road tunnel","Motorway","Motorway tunnel","Secondary road","Secondary road tunnel","Toll connecting road","Toll connecting road tunnel","Toll international road","Toll international road tunnel","Toll local road","Toll local road tunnel","Toll major local road","Toll major local road tunnel","Toll major road","Toll major road tunnel","Toll minor local road","Toll minor local road tunnel","Toll motorway","Toll motorway tunnel","Toll secondary road","Toll secondary road tunnel"]),this._returnDetailedDescriptions=!1,this._shortcutListener=function(r){return ru(i,void 0,void 0,function(){var e,o,n;return iu(this,function(t){switch(t.label){case 0:return r.altKey&&r.ctrlKey&&68===r.keyCode?(this._returnDetailedDescriptions=!this._returnDetailedDescriptions,e=this._map.getCamera(),n=this._map.getStyle(),o=n.language.toLowerCase(),n=n.style.toLowerCase(),[4,this._getLocDesc(e,o,n)]):[3,2];case 1:n=t.sent(),this._descCallback(n),t.label=2;case 2:return[2]}})})},this._onRotate=function(){i._rotateTimeout||(Date.now()-i._lastHeadingTime>=i._headUpdateLimit?i._rotateTimeout=setTimeout(i._updateHeading,ut.RotationDuration+25):i._rotateTimeout=setTimeout(i._updateHeading,i._headUpdateLimit-(Date.now()-i._lastHeadingTime)))},this._onMove=function(){i._moveTimeout&&(clearTimeout(i._moveTimeout),delete i._moveTimeout),i._controlTimeout&&(clearTimeout(i._controlTimeout),delete i._controlTimeout)},this._onMoveEnd=function(t){t.fromControl?i._controlTimeout=setTimeout(i._updateCam,i._controlEventDelay):i._updateCam()},this._onStyleData=function(){setTimeout(i._updateStyle)},this._onPointerDown=function(t){i._lastPointerPos=i._getEventPos(t),i._pointerTimeout=setTimeout(function(){return ru(i,void 0,void 0,function(){var e,o,n;return iu(this,function(t){switch(t.label){case 0:return o=this._map.getStyle(),e=o.language.toLowerCase(),n=o.style.toLowerCase(),(o=this._map.getCamera()).center=this._map.pixelsToPositions([this._lastPointerPos])[0],[4,this._getLocDesc(o,e,n)];case 1:return n=t.sent(),this._descCallback(n),this._onPointerUp(),[2]}})})},i._pointerUpdateDelay),i._map.getCanvas().addEventListener("mousemove",i._onPointerMove),i._map.getCanvas().addEventListener("touchmove",i._onPointerMove),i._map.getCanvas().addEventListener("mouseup",i._onPointerUp),i._map.getCanvas().addEventListener("touchend",i._onPointerUp)},this._onPointerMove=function(t){var e=i._getEventPos(t),t=i._lastPointerPos[0]-e[0],e=i._lastPointerPos[1]-e[1];Math.sqrt(t*t+e*e)>i._moveThreshold&&i._onPointerUp()},this._onPointerUp=function(){clearTimeout(i._pointerTimeout),delete i._pointerTimeout,i._map.getCanvas().removeEventListener("mousemove",i._onPointerMove),i._map.getCanvas().removeEventListener("touchmove",i._onPointerMove),i._map.getCanvas().removeEventListener("mouseup",i._onPointerUp),i._map.getCanvas().removeEventListener("touchend",i._onPointerUp)},this._updateHeading=function(){var t,e=i._map.getCamera();i._lastHead&&!i._checkHeadingThreshold(e.bearing,i._lastHead)||(t=i._getHeadingDesc(e),i._lastHead=e.bearing,i._descCallback("<p>Map heading "+t+".</p>"),i._lastHeadingTime=Date.now()),delete i._rotateTimeout},this._updateStyle=function(){return ru(i,void 0,void 0,function(){var e,o,n,r;return iu(this,function(t){switch(t.label){case 0:return(e=this._map.getCamera(),n=this._map.getStyle(),o=n.language.toLowerCase(),n=n.style.toLowerCase(),this._lastLang===o)?[3,2]:(lu._labelCache._preloadCache(o),[4,this._getLocDesc(e,o,n)]);case 1:return r=t.sent(),[3,4];case 2:return this._lastStyle===n||"blank"!==this._lastStyle?[3,4]:[4,this._getLocDesc(e,o,n)];case 3:r=t.sent(),t.label=4;case 4:return this._lastLang=o,this._lastStyle=n,r&&this._descCallback(r),[2]}})})},this._updateCam=function(t){void 0===t&&(t=!1);var o,n,e,r=i._map.getCamera();(!i._lastCam||0<i._actionQueue.length||i._checkThresholds(r,i._lastCam))&&(e=i._map.getStyle(),o=e.language.toLowerCase(),n=e.style.toLowerCase(),(e=i._getActionDesc(r))&&i._actionQueue.push(e),i._lastCam=r,i._moveTimeout&&(clearTimeout(i._moveTimeout),delete i._moveTimeout),i._moveTimeout=setTimeout(function(){return ru(i,void 0,void 0,function(){var e;return iu(this,function(t){switch(t.label){case 0:return clearTimeout(this._rotateTimeout),delete this._rotateTimeout,[4,this._getLocDesc(r,o,n)];case 1:return e=t.sent(),0<this._actionQueue.length?(this._descCallback("<p>Map "+this._actionQueue.join(", then ")+".</p>"+e),this._actionQueue=[]):this._descCallback(e),[2]}})})},t?0:i._camUpdateDelay))},this._map=t,this._restFallback=t.getServiceOptions().enableAccessibilityLocationFallback,this._descCallback=e,this._reverseSearch=new tu(t),lu._labelCache||(lu._labelCache=new ou),this._lastLang=this._map.getStyle().language.toLowerCase(),lu._labelCache._preloadCache(this._lastLang),this._map.events.addOnce("idle",function(){var t;i._disposed||(i._updateCam(!0),(t=i._map._getMap()).on("move",i._onMove),t.on("moveend",i._onMoveEnd),t.on("styledata",i._onStyleData),t.on("rotate",i._onRotate),(t=i._map.getCanvas()).addEventListener("mousedown",i._onPointerDown),t.addEventListener("touchstart",i._onPointerDown))}),this._map.getMapContainer().addEventListener("keydown",this._shortcutListener)}var cu,uu,pu,hu=function(t){var o=this;this.addToMap=function(){o.initializeMapLiveStateInfo(),o.initializeMapStyleInfo(),o.createMapKeyBindingInfo(),o.map.getMapContainer().setAttribute("role","application"),o.map.getMapContainer().setAttribute("aria-label","Map Application"),o.map.getCanvasContainer().setAttribute("aria-live","polite"),o.map.getCanvasContainer().setAttribute("aria-describedby","atlas-map-state atlas-map-style"),o.map.getCanvas().setAttribute("aria-label","Interactive Map"),o.map.getCanvas().setAttribute("aria-describedby","atlas-map-shortcuts"),o.map.getCanvas().setAttribute("alt","Interactive Map")},this.removeFromMap=function(){null!=o.mapViewDesc&&o.mapViewDesc.dispose(),delete o.mapViewDesc,null!=o.atlasMapKeyBindings&&o.map.getCanvasContainer().removeChild(o.atlasMapKeyBindings),delete o.atlasMapKeyBindings,null!=o.atlasMapLiveStateInfo&&o.map.getCanvasContainer().removeChild(o.atlasMapLiveStateInfo),delete o.atlasMapLiveStateInfo,null!=o.atlasMapStyleInfo&&o.map.getCanvasContainer().removeChild(o.atlasMapStyleInfo),delete o.atlasMapStyleInfo,o.map.getMapContainer().removeAttribute("role"),o.map.getMapContainer().removeAttribute("aria-label"),o.map.getCanvasContainer().removeAttribute("aria-live"),o.map.getCanvasContainer().removeAttribute("aria-describedby"),o.map.getCanvas().removeAttribute("aria-label"),o.map.getCanvas().removeAttribute("aria-describedby"),o.map.getCanvas().removeAttribute("alt"),o.map.events.remove("stylechanged",o.updateMapStyle)},this.createMapKeyBindingInfo=function(){o.atlasMapKeyBindings=document.createElement("div"),o.atlasMapKeyBindings.setAttribute("tabindex","-1"),o.atlasMapKeyBindings.setAttribute("aria-hidden","true"),o.atlasMapKeyBindings.id="atlas-map-shortcuts",o.atlasMapKeyBindings.classList.add("hidden-accessible-element"),o.atlasMapKeyBindings.innerHTML=["Map shortcuts:","Zoom out: hyphen.","Zoom in: plus.","Pan right 100 pixels: right arrow.","Pan left 100 pixels: left arrow.","Pan up 100 pixels: up arrow.","Pan down 100 pixels: down arrow.","Rotate 15 degrees clockwise: shift + right arrow.","Rotate 15 degrees counter clockwise: shift + left arrow.","Increase pitch 10 degrees: shift + up arrow.","Decrease pitch 10 degrees: shift + down arrow.","Jump focus to the map: Escape."].join("\n"),o.map.getCanvasContainer().appendChild(o.atlasMapKeyBindings);var t=[189,187,38,37,39,40],e=o.map._getMap()._canvas;null!=e&&e.addEventListener("keyup",function(e){t.find(function(t){return e.keyCode===t})&&(o.atlasMapKeyBindings.innerHTML="")})},this.initializeMapLiveStateInfo=function(){o.mapViewDesc=new au(o.map,o.updateMapState),o.atlasMapLiveStateInfo=document.createElement("div"),o.atlasMapLiveStateInfo.setAttribute("tabindex","-1"),o.atlasMapLiveStateInfo.setAttribute("aria-hidden","true"),o.atlasMapLiveStateInfo.id="atlas-map-state",o.atlasMapLiveStateInfo.classList.add("hidden-accessible-element"),o.map.getCanvasContainer().appendChild(o.atlasMapLiveStateInfo)},this.initializeMapStyleInfo=function(){o.atlasMapStyleInfo=document.createElement("div"),o.atlasMapStyleInfo.setAttribute("tabindex","-1"),o.atlasMapStyleInfo.setAttribute("aria-hidden","true"),o.atlasMapStyleInfo.id="atlas-map-style",o.atlasMapStyleInfo.classList.add("hidden-accessible-element"),o.map.events.add("stylechanged",o.updateMapStyle),o.map.getCanvasContainer().appendChild(o.atlasMapStyleInfo)},this.updateMapStyle=function(){o.atlasMapStyleInfo.innerHTML="<p>Map style: "+o.map.getStyle().style+".</p>"},this.updateMapState=function(t){o.atlasMapLiveStateInfo.innerHTML=t},this.map=t},du=function(t){var o=this;this.listenerEnabled=!1,this.lastFlowMode="none",this.addToMap=function(){if(!o.map._isReady())throw new Error("Traffic flow could not be added to the map because the map is not ready. Please use a ready event listener to guarantee the map is ready before enabling traffic flow.");o.listenerEnabled||(o.map.events.add("styledata",o.addToMap),o.listenerEnabled=!0);var t,e=o.map.getTraffic();"none"===e.flow||(t=o.map.layers.getLayerById("traffic_"+e.flow))&&(o.lastFlowMode=e.flow,t._updateLayoutProperty("visibility","visible","none"))},this.removeFromMap=function(){var t;o.map.getTraffic();"none"!=o.lastFlowMode&&((t=o.map.layers.getLayerById("traffic_"+o.lastFlowMode))&&t._updateLayoutProperty("visibility","none","visible"),o.lastFlowMode="none"),o.listenerEnabled&&(o.map.events.remove("styledata",o.addToMap),o.listenerEnabled=!1)},this.map=t},fu=((window&&window.__extends||(cu=function(t,e){return(cu=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}cu(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(yu,uu=nr),yu.getIncidentTypeName=function(t,e){switch(t){case 0:return e.Unknown;case 1:return e.Accident;case 2:return e.Fog;case 3:return e.Danger;case 4:return e.Rain;case 5:return e.Ice;case 6:return e.Jam;case 7:return e.LaneClosed;case 8:return e.RoadClosed;case 9:return e.RoadWorks;case 10:return e.Wind;case 11:return e.Flood;case 12:return e.Detour;default:return e.Unknown}},yu.getIncidentTypeIconName=function(t){switch(t){case 0:return"unknown";case 1:return"accident";case 2:return"fog";case 3:return"danger";case 4:return"rain";case 5:return"ice";case 6:return"jam";case 7:return"lane-closed";case 8:return"road-closed";case 9:return"road-work";case 10:return"wind";case 11:return"flood";case 12:return"detour";default:return"unknown"}},yu.getSeverityColorName=function(t){switch(t){case 0:return"grey";case 1:return"yellow";case 2:return"orange";case 3:return"red";default:return"grey"}},yu.getSeverityColorHexCode=function(t){switch(t){case 0:return"#B5B6B7";case 1:return"#F4C951";case 2:return"#F4873F";case 3:return"#F04F4E";default:return"#B5B6B7"}},yu);function yu(t,e,o){var n=null!==(r=null!==(n=null!==(r=null!==(n=null!==(r=null!==(n=null!==(r=null!==(n=null!==(r=null!==(n=null!==(r=null!==(n=null!==(r=t.icon_category_12)&&void 0!==r?r:t.icon_category_11)&&void 0!==n?n:t.icon_category_10)&&void 0!==r?r:t.icon_category_9)&&void 0!==n?n:t.icon_category_8)&&void 0!==r?r:t.icon_category_7)&&void 0!==n?n:t.icon_category_6)&&void 0!==r?r:t.icon_category_5)&&void 0!==n?n:t.icon_category_4)&&void 0!==r?r:t.icon_category_3)&&void 0!==n?n:t.icon_category_2)&&void 0!==r?r:t.icon_category_1)&&void 0!==n?n:t.icon_category_0)&&void 0!==r?r:t.icon_category,r=null!==(r=null!==(r=null!==(r=null!==(r=null!==(r=null!==(r=null!==(r=null!==(r=null!==(r=null!==(r=null!==(r=null!==(r=null!==(r=t.description_12)&&void 0!==r?r:t.description_11)&&void 0!==r?r:t.description_10)&&void 0!==r?r:t.description_9)&&void 0!==r?r:t.description_8)&&void 0!==r?r:t.description_7)&&void 0!==r?r:t.description_6)&&void 0!==r?r:t.description_5)&&void 0!==r?r:t.description_4)&&void 0!==r?r:t.description_3)&&void 0!==r?r:t.description_2)&&void 0!==r?r:t.description_1)&&void 0!==r?r:t.description_0)&&void 0!==r?r:t.description,t={icon:yu.getSeverityColorName(t.magnitude)+"-"+yu.getIncidentTypeIconName(n),incidentType:yu.getIncidentTypeName(n,o),description:r,delay:t.delay,color:yu.getSeverityColorHexCode(t.magnitude),id:t.id};return uu.call(this,e,t)||this}(w=pu=pu||{}).DELAY="delay",w.LENGTH="length",w.FROM="from",w.TO="to";var mu=(gu.build=function(t,e){void 0===e&&(e="en-US");var o=document.createElement("div");o.classList.add("incident-popup-title"),o.classList.add("font-segoeui-b"),o.innerText=t.properties.incidentType,o.setAttribute("aria-label","Incident Type "+t.properties.incidentType);var n=document.createElement("div");n.classList.add("incident-popup-subtitle"),n.classList.add("font-segoeui-b"),n.setAttribute("aria-label","Incident Description "+t.properties.description),n.innerText=t.properties.description;var r=document.createElement("div");r.classList.add("incident-popup-header"),r.style.backgroundColor=t.properties.color,r.appendChild(o),r.appendChild(n);var i,s,a,n=document.createElement("div");n.classList.add("incident-popup-body"),t.properties.delay&&(i=Math.floor(t.properties.delay/60)+" min",i=this.createInfoSection(i,pu.DELAY),n.appendChild(i)),t.properties.length&&(i=new Intl.NumberFormat([e,"en-US"],{maximumFractionDigits:2}),a=void 0,a="en-US"===e?(s=Dr(t.properties.length,"meters","miles"),i.format(s)+" miles"):(s=Dr(t.properties.length,"meters","kilometers"),i.format(s)+" km"),a=this.createInfoSection(a,pu.LENGTH),n.appendChild(a)),t.properties.from&&(a=this.createInfoSection(t.properties.from,pu.FROM),n.appendChild(a)),t.properties.to&&(l=this.createInfoSection(t.properties.to,pu.TO),n.appendChild(l));var l=document.createElement("div");return l.classList.add("incident-popup-content"),l.appendChild(r),l.appendChild(n),new bl({content:l,position:t.geometry.coordinates})},gu.createInfoSection=function(t,e){var o=document.createElement("div");o.classList.add("incident-popup-info");var n=document.createElement("div");n.classList.add("icon"),n.classList.add(e);var r=document.createElement("span");return r.classList.add("message"),r.classList.add("font-segoeui"),r.setAttribute("aria-label","Incident "+e+" "+t),r.innerText=t,o.appendChild(n),o.appendChild(r),o},gu);function gu(){}var vu=window&&window.__awaiter||function(t,s,a,l){return new(a=a||Promise)(function(o,e){function n(t){try{i(l.next(t))}catch(t){e(t)}}function r(t){try{i(l.throw(t))}catch(t){e(t)}}function i(t){var e;t.done?o(t.value):((e=t.value)instanceof a?e:new a(function(t){t(e)})).then(n,r)}i((l=l.apply(t,s||[])).next())})},_u=window&&window.__generator||function(o,n){var r,i,s,a={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},t={next:e(0),throw:e(1),return:e(2)};return"function"==typeof Symbol&&(t[Symbol.iterator]=function(){return this}),t;function e(e){return function(t){return function(e){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,i&&(s=2&e[0]?i.return:e[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,e[1])).done)return s;switch(i=0,(e=s?[2&e[0],s.value]:e)[0]){case 0:case 1:s=e;break;case 4:return a.label++,{value:e[1],done:!1};case 5:a.label++,i=e[1],e=[0];continue;case 7:e=a.ops.pop(),a.trys.pop();continue;default:if(!(s=0<(s=a.trys).length&&s[s.length-1])&&(6===e[0]||2===e[0])){a=0;continue}if(3===e[0]&&(!s||e[1]>s[0]&&e[1]<s[3])){a.label=e[1];break}if(6===e[0]&&a.label<s[1]){a.label=s[1],s=e;break}if(s&&a.label<s[2]){a.label=s[2],a.ops.push(e);break}s[2]&&a.ops.pop(),a.trys.pop();continue}e=n.call(o,a)}catch(t){e=[6,t],i=0}finally{r=s=0}if(5&e[0])throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}([e,t])}}},wu=(bu.prototype.getIncidentIconImageExpression=function(){return["concat",["let","magnitude",["get","magnitude"],["case",["==",["var","magnitude"],0],"grey",["==",["var","magnitude"],1],"yellow",["==",["var","magnitude"],2],"orange",["==",["var","magnitude"],3],"red",["==",["var","magnitude"],4],"grey","grey"]],"-",["let","category",["coalesce",["get","icon_category_12"],["get","icon_category_11"],["get","icon_category_10"],["get","icon_category_9"],["get","icon_category_8"],["get","icon_category_7"],["get","icon_category_6"],["get","icon_category_5"],["get","icon_category_4"],["get","icon_category_3"],["get","icon_category_2"],["get","icon_category_0"],["get","icon_category"],0],["case",["==",["var","category"],0],"unknown",["==",["var","category"],1],"accident",["==",["var","category"],2],"fog",["==",["var","category"],3],"danger",["==",["var","category"],4],"rain",["==",["var","category"],5],"ice",["==",["var","category"],6],"jam",["==",["var","category"],7],"lane-closed",["==",["var","category"],8],"road-closed",["==",["var","category"],9],"road-work",["==",["var","category"],10],"wind",["==",["var","category"],11],"flood",["==",["var","category"],12],"detour","unknown"]]]},bu);function bu(t){var r=this;this.incidentLayerName="incidents",this.incidentSourceName="mapcontrol_traffic_incident",this.addToMap=function(){r.map.sources.getById(r.incidentSourceName)||r.map.sources.add(r.vectorTileSource),r.map.layers.getLayerById(r.incidentLayerName)||r.map.layers.add(r.incidentLayer,"labels"),r.clickPopup=new bl({position:[0,0],pixelOffset:[0,-18]}),r.map.addEventListener("mouseover",r.incidentLayerName,r.cursorToPointer),r.map.addEventListener("mouseleave",r.incidentLayerName,r.cursorToDefault),r.map.addEventListener("click",r.incidentLayerName,r.openIncidentPopup),r.map.events.addOnce("idle",r.setAccessiblePopups),r.map.events.add("moveend",r.setAccessiblePopups)},this.accessiblePopups=[],this.setAccessiblePopups=function(){return vu(r,void 0,void 0,function(){var e,i,s,a,l,c,u=this;return _u(this,function(t){switch(t.label){case 0:return this.accessiblePopups.forEach(function(t){return t.remove()}),this.accessiblePopups=[],e=this.map.layers.getRenderedShapes(this.map.getCamera().bounds,this.incidentLayer),[4,this.map._getLocalizedStrings()];case 1:return i=t.sent(),s=function(e,o){var t=e[o],n=t.geometry.coordinates,n=new cr(new yi(n[0],n[1])),n=new fu(t.properties,n,i),r=mu.build(n,u.incidentLanguage),n=r.getPopupContainer();return n.addEventListener("focusin",function(t){u.clickPopup.remove(),u.accessiblePopups.filter(function(t){return t!==r}).forEach(function(t){return t.remove()}),0<=o-1&&a(r,s(e,o-1)),o+1<e.length&&c(s(e,o+1)),2<=o&&o==e.length-1&&l(s(e,0)),0==o&&2<=e.length&&c(s(e,e.length-1))}),o==e.length-1&&n.addEventListener("focusout",function(t){null===t.relatedTarget&&r.close()}),u.accessiblePopups.push(r),r},a=function(t,e){e.open(u.map),e.close();e=e.getPopupContainer(),t=t.getPopupContainer();t.parentElement.insertBefore(e,t)},l=function(t){t.open(u.map),t.close();var e=t.getPopupContainer(),t=e.parentElement;t.insertBefore(e,t.firstElementChild)},c=function(t){t.open(u.map),t.close()},0<e.length&&c(s(e,0)),1<e.length&&c(s(e,e.length-1)),[2]}})})},this.removeFromMap=function(){var t;r.map.removeEventListener("mouseover",r.incidentLayerName,r.cursorToPointer),r.map.removeEventListener("mouseleave",r.incidentLayerName,r.cursorToDefault),r.map.removeEventListener("click",r.incidentLayerName,r.openIncidentPopup),r.map.events.remove("idle",r.setAccessiblePopups),r.map.events.remove("moveend",r.setAccessiblePopups),r.accessiblePopups.forEach(function(t){return t.remove()}),r.accessiblePopups=[],null!==(t=r.clickPopup)&&void 0!==t&&t.remove(),null!=r.map.layers.getLayerById(r.incidentLayerName)&&r.map.layers.remove(r.incidentLayerName),null!=r.map.sources.getById(r.incidentSourceName)&&r.map.sources.remove(r.incidentSourceName)},this.cursorToPointer=function(t){r.map.getCanvas().style.cursor="pointer"},this.cursorToDefault=function(t){r.map.getCanvas().style.cursor=""},this.openIncidentPopup=function(t){r.clickPopup.remove(),r.accessiblePopups.forEach(function(t){return t.close()});var o=t.position,n=t.features[0];r.map._getLocalizedStrings().then(function(t){var e=new cr(new yi(o[0],o[1])),t=new fu(n.properties,e,t);r.clickPopup=mu.build(t,r.incidentLanguage),r.clickPopup.open(r.map),r.clickPopup.getPopupContainer().addEventListener("focusout",function(t){null===t.relatedTarget&&r.clickPopup.close()})})},this.map=t,this.vectorTileSource=new vs(this.incidentSourceName,{maxZoom:22,tiles:["https://"+c+"/traffic/incident/tile/pbf?api-version=1.0&zoom={z}&x={x}&y={y}"]});t=this.getIncidentIconImageExpression();this.incidentLayer=new Ha(this.incidentSourceName,this.incidentLayerName,{sourceLayer:"Traffic incident POI",iconOptions:{ignorePlacement:!0,allowOverlap:!0,image:t,size:.75}})}var Su,xu,Ou=((window&&window.__extends||(Su=function(t,e){return(Su=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}Su(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(Tu,xu=P),Tu);function Tu(){var t=null!==xu&&xu.apply(this,arguments)||this;return t.interactive=!0,t.scrollZoomInteraction=!0,t.boxZoomInteraction=!0,t.dragRotateInteraction=!0,t.dragPanInteraction=!0,t.keyboardInteraction=!0,t.dblClickZoomInteraction=!0,t.touchInteraction=!0,t.touchRotate=!0,t.wheelZoomRate=1/450,t}var Eu=(Cu.prototype.enable=function(){this.map.getMapContainer().addEventListener("keydown",this._onKeyDown)},Cu.prototype.disable=function(){this.map.getMapContainer().removeEventListener("keydown",this._onKeyDown)},Cu);function Cu(t){var e=this;this._onKeyDown=function(t){27===t.keyCode&&e.map.getCanvas().focus()},this.map=t}var Pu=(ku.prototype.enable=function(){this.map.getCanvasContainer().addEventListener("gesturestart",this._onGestureStart),this.map.getCanvasContainer().addEventListener("gesturechange",this._onGestureChange),this.map.getCanvasContainer().addEventListener("touchstart",this._onTouchStart),this.map.getCanvasContainer().addEventListener("touchend",this._onTouchEnd)},ku.prototype.disable=function(){this.map.getCanvasContainer().removeEventListener("gesturestart",this._onGestureStart),this.map.getCanvasContainer().removeEventListener("gesturechange",this._onGestureChange),this.map.getCanvasContainer().removeEventListener("touchstart",this._onTouchStart),this.map.getCanvasContainer().removeEventListener("touchend",this._onTouchEnd)},ku);function ku(t){var e=this;this._onGestureStart=function(t){e.hasTouch||(t.preventDefault(),e.initZoom=e.map.getCamera().zoom)},this._onGestureChange=function(t){e.hasTouch||(t.preventDefault(),e.map.setCamera({zoom:e.initZoom+t.scale-1}))},this._onTouchStart=function(t){e.hasTouch=!0},this._onTouchEnd=function(t){0===t.touches.length&&(e.hasTouch=!1)},this.map=t}var Au=(Lu.prototype.addToMap=function(){this.added||(this.added=!0,this._setInteractions(this.options))},Lu.prototype.removeFromMap=function(){this.added&&(this.added=!1,this._setInteractions({interactive:!1}))},Lu.prototype.setOptions=function(t){this.options=(new Ou).merge(this.options,t),this.added&&this._setInteractions(this.options)},Lu.prototype.getOptions=function(){return Object.assign({},this.options)},Lu.prototype._setInteractions=function(t){var e;t.interactive?(t.boxZoomInteraction?this.map._getMap().boxZoom.enable():this.map._getMap().boxZoom.disable(),t.dblClickZoomInteraction?this.map._getMap().doubleClickZoom.enable():this.map._getMap().doubleClickZoom.disable(),t.dragPanInteraction?this.map._getMap().dragPan.enable():this.map._getMap().dragPan.disable(),t.dragRotateInteraction?this.map._getMap().dragRotate.enable():this.map._getMap().dragRotate.disable(),t.keyboardInteraction?(this.map._getMap().keyboard.enable(),this.focusShortcut.enable()):(this.map._getMap().keyboard.disable(),this.focusShortcut.disable()),t.scrollZoomInteraction?(this.map._getMap().scrollZoom.enable(),this.map._getMap().scrollZoom.setWheelZoomRate(t.wheelZoomRate)):this.map._getMap().scrollZoom.disable(),e=this.map._getMap().touchZoomRotate,t.touchInteraction?(e.enable(),t.touchRotate?e.enableRotation():e.disableRotation()):e.disable(),this.pinchZoom.enable()):(this.map._getMap().boxZoom.disable(),this.map._getMap().doubleClickZoom.disable(),this.map._getMap().dragPan.disable(),this.map._getMap().dragRotate.disable(),this.map._getMap().keyboard.disable(),this.focusShortcut.disable(),this.map._getMap().scrollZoom.disable(),this.map._getMap().touchZoomRotate.disable(),this.pinchZoom.disable())},Lu);function Lu(t,e){this.added=!1,this.map=t,this.focusShortcut=new Eu(t),this.pinchZoom=new Pu(t),this.options=(new Ou).merge(e)}function Iu(t,e,o){var n={type:"Feature"};return 0!==(o=void 0===o?{}:o).id&&!o.id||(n.id=o.id),o.bbox&&(n.bbox=o.bbox),n.properties=e||{},n.geometry=t,n}function Ru(t){return"Feature"===t.type?t.geometry:t}var Nu=It(function(t,e){t.exports=function(){function c(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function n(t,e){for(var o=0;o<e.length;o++){var n=e[o];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;Object.defineProperty(t,n.key,n)}}function s(t,e,o){if(e)n(t.prototype,e);if(o)n(t,o);return t}var u=function(){function t(t,e){this.next=null;this.key=t;this.data=e;this.left=null;this.right=null}return t}();function e(t,e){return t>e?1:t<e?-1:0}function a(t,e,o){var n=new u(null,null);var r=n;var i=n;while(true){var s=o(t,e.key);if(s<0){if(e.left===null)break;if(o(t,e.left.key)<0){var a=e.left;e.left=a.right;a.right=e;e=a;if(e.left===null)break}i.left=e;i=e;e=e.left}else if(s>0){if(e.right===null)break;if(o(t,e.right.key)>0){var a=e.right;e.right=a.left;a.left=e;e=a;if(e.right===null)break}r.right=e;r=e;e=e.right}else break}r.right=e.left;i.left=e.right;e.left=n.right;e.right=n.left;return e}function l(t,e,o,n){var r=new u(t,e);if(o===null){r.left=r.right=null;return r}o=a(t,o,n);var i=n(t,o.key);if(i<0){r.left=o.left;r.right=o;o.left=null}else if(i>=0){r.right=o.right;r.left=o;o.right=null}return r}function p(t,e,o){var n=null;var r=null;if(e){e=a(t,e,o);var i=o(e.key,t);if(i===0){n=e.left;r=e.right}else if(i<0){r=e.right;e.right=null;n=e}else{n=e.left;e.left=null;r=e}}return{left:n,right:r}}function h(t,e,o){if(e===null)return t;if(t===null)return e;e=a(t.key,e,o);e.left=t;return e}function d(t,e,o,n,r){if(t){n(""+e+(o?"└── ":"├── ")+r(t)+"\n");var i=e+(o?" ":"│ ");if(t.left)d(t.left,i,false,n,r);if(t.right)d(t.right,i,true,n,r)}}var L=function(){function t(t){if(t===void 0)t=e;this._root=null;this._size=0;this._comparator=t}t.prototype.insert=function(t,e){this._size++;return this._root=l(t,e,this._root,this._comparator)};t.prototype.add=function(t,e){var o=new u(t,e);if(this._root===null){o.left=o.right=null;this._size++;this._root=o}var n=this._comparator;var r=a(t,this._root,n);var i=n(t,r.key);if(i===0)this._root=r;else{if(i<0){o.left=r.left;o.right=r;r.left=null}else if(i>0){o.right=r.right;o.left=r;r.right=null}this._size++;this._root=o}return this._root};t.prototype.remove=function(t){this._root=this._remove(t,this._root,this._comparator)};t.prototype._remove=function(t,e,o){var n;if(e===null)return null;e=a(t,e,o);var r=o(t,e.key);if(r===0){if(e.left===null)n=e.right;else{n=a(t,e.left,o);n.right=e.right}this._size--;return n}return e};t.prototype.pop=function(){var t=this._root;if(t){while(t.left)t=t.left;this._root=a(t.key,this._root,this._comparator);this._root=this._remove(t.key,this._root,this._comparator);return{key:t.key,data:t.data}}return null};t.prototype.findStatic=function(t){var e=this._root;var o=this._comparator;while(e){var n=o(t,e.key);if(n===0)return e;else if(n<0)e=e.left;else e=e.right}return null};t.prototype.find=function(t){if(this._root){this._root=a(t,this._root,this._comparator);if(this._comparator(t,this._root.key)!==0)return null}return this._root};t.prototype.contains=function(t){var e=this._root;var o=this._comparator;while(e){var n=o(t,e.key);if(n===0)return true;else if(n<0)e=e.left;else e=e.right}return false};t.prototype.forEach=function(t,e){var o=this._root;var n=[];var r=false;while(!r)if(o!==null){n.push(o);o=o.left}else if(n.length!==0){o=n.pop();t.call(e,o);o=o.right}else r=true;return this};t.prototype.range=function(t,e,o,n){var r=[];var i=this._comparator;var s=this._root;var a;while(r.length!==0||s)if(s){r.push(s);s=s.left}else{s=r.pop();a=i(s.key,e);if(a>0)break;else if(i(s.key,t)>=0)if(o.call(n,s))return this;s=s.right}return this};t.prototype.keys=function(){var o=[];this.forEach(function(t){var e=t.key;return o.push(e)});return o};t.prototype.values=function(){var o=[];this.forEach(function(t){var e=t.data;return o.push(e)});return o};t.prototype.min=function(){if(this._root)return this.minNode(this._root).key;return null};t.prototype.max=function(){if(this._root)return this.maxNode(this._root).key;return null};t.prototype.minNode=function(t){if(t===void 0)t=this._root;if(t)while(t.left)t=t.left;return t};t.prototype.maxNode=function(t){if(t===void 0)t=this._root;if(t)while(t.right)t=t.right;return t};t.prototype.at=function(t){var e=this._root;var o=false;var n=0;var r=[];while(!o)if(e){r.push(e);e=e.left}else if(r.length>0){e=r.pop();if(n===t)return e;n++;e=e.right}else o=true;return null};t.prototype.next=function(t){var e=this._root;var o=null;if(t.right){o=t.right;while(o.left)o=o.left;return o}var n=this._comparator;while(e){var r=n(t.key,e.key);if(r===0)break;else if(r<0){o=e;e=e.left}else e=e.right}return o};t.prototype.prev=function(t){var e=this._root;var o=null;if(t.left!==null){o=t.left;while(o.right)o=o.right;return o}var n=this._comparator;while(e){var r=n(t.key,e.key);if(r===0)break;else if(r<0)e=e.left;else{o=e;e=e.right}}return o};t.prototype.clear=function(){this._root=null;this._size=0;return this};t.prototype.toList=function(){return o(this._root)};t.prototype.load=function(t,e,o){if(e===void 0)e=[];if(o===void 0)o=false;var n=t.length;var r=this._comparator;if(o)v(t,e,0,n-1,r);if(this._root===null){this._root=f(t,e,0,n);this._size=n}else{var i=g(this.toList(),y(t,e),r);n=this._size+n;this._root=m({head:i},0,n)}return this};t.prototype.isEmpty=function(){return this._root===null};Object.defineProperty(t.prototype,"size",{get:function t(){return this._size},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"root",{get:function t(){return this._root},enumerable:true,configurable:true});t.prototype.toString=function(t){if(t===void 0)t=function t(e){return String(e.key)};var e=[];d(this._root,"",true,function(t){return e.push(t)},t);return e.join("")};t.prototype.update=function(t,e,o){var n=this._comparator;var r=p(t,this._root,n),i=r.left,s=r.right;if(n(t,e)<0)s=l(e,o,s,n);else i=l(e,o,i,n);this._root=h(i,s,n)};t.prototype.split=function(t){return p(t,this._root,this._comparator)};return t}();function f(t,e,o,n){var r=n-o;if(r>0){var i=o+Math.floor(r/2);var s=t[i];var a=e[i];var l=new u(s,a);l.left=f(t,e,o,i);l.right=f(t,e,i+1,n);return l}return null}function y(t,e){var o=new u(null,null);var n=o;for(var r=0;r<t.length;r++)n=n.next=new u(t[r],e[r]);n.next=null;return o.next}function o(t){var e=t;var o=[];var n=false;var r=new u(null,null);var i=r;while(!n)if(e){o.push(e);e=e.left}else if(o.length>0){e=i=i.next=o.pop();e=e.right}else n=true;i.next=null;return r.next}function m(t,e,o){var n=o-e;if(n>0){var r=e+Math.floor(n/2);var i=m(t,e,r);var s=t.head;s.left=i;t.head=t.head.next;s.right=m(t,r+1,o);return s}return null}function g(t,e,o){var n=new u(null,null);var r=n;var i=t;var s=e;while(i!==null&&s!==null){if(o(i.key,s.key)<0){r.next=i;i=i.next}else{r.next=s;s=s.next}r=r.next}if(i!==null)r.next=i;else if(s!==null)r.next=s;return n.next}function v(t,e,o,n,r){if(o>=n)return;var i=t[o+n>>1];var s=o-1;var a=n+1;while(true){do{s++}while(r(t[s],i)<0);do{a--}while(r(t[a],i)>0);if(s>=a)break;var l=t[s];t[s]=t[a];t[a]=l;l=e[s];e[s]=e[a];e[a]=l}v(t,e,o,a,r);v(t,e,a+1,n,r)}var _=function t(e,o){return e.ll.x<=o.x&&o.x<=e.ur.x&&e.ll.y<=o.y&&o.y<=e.ur.y},I=function t(e,o){if(o.ur.x<e.ll.x||e.ur.x<o.ll.x||o.ur.y<e.ll.y||e.ur.y<o.ll.y)return null;var n=e.ll.x<o.ll.x?o.ll.x:e.ll.x;var r=e.ur.x<o.ur.x?e.ur.x:o.ur.x;var i=e.ll.y<o.ll.y?o.ll.y:e.ll.y;var s=e.ur.y<o.ur.y?e.ur.y:o.ur.y;return{ll:{x:n,y:i},ur:{x:r,y:s}}},r=Number.EPSILON;if(r===undefined)r=Math.pow(2,-52);var i=r*r,w=function t(e,o){if(-r<e&&e<r)if(-r<o&&o<r)return 0;var n=e-o;if(n*n<i*e*o)return 0;return e<o?-1:1},t=function(){function t(){c(this,t);this.reset()}s(t,[{key:"reset",value:function t(){this.xRounder=new b;this.yRounder=new b}},{key:"round",value:function t(e,o){return{x:this.xRounder.round(e),y:this.yRounder.round(o)}}}]);return t}(),b=function(){function t(){c(this,t);this.tree=new L;this.round(0)}s(t,[{key:"round",value:function t(e){var o=this.tree.add(e);var n=this.tree.prev(o);if(n!==null&&w(o.key,n.key)===0){this.tree.remove(e);return n.key}var r=this.tree.next(o);if(r!==null&&w(o.key,r.key)===0){this.tree.remove(e);return r.key}return e}}]);return t}(),R=new t,S=function t(e,o){return e.x*o.y-e.y*o.x},x=function t(e,o){return e.x*o.x+e.y*o.y},O=function t(e,o,n){var r={x:o.x-e.x,y:o.y-e.y};var i={x:n.x-e.x,y:n.y-e.y};var s=S(r,i);return w(s,0)},T=function t(e){return Math.sqrt(x(e,e))},E=function t(e,o,n){var r={x:o.x-e.x,y:o.y-e.y};var i={x:n.x-e.x,y:n.y-e.y};return S(i,r)/T(i)/T(r)},C=function t(e,o,n){var r={x:o.x-e.x,y:o.y-e.y};var i={x:n.x-e.x,y:n.y-e.y};return x(i,r)/T(i)/T(r)},P=function t(e,o,n){if(o.y===0)return null;return{x:e.x+o.x/o.y*(n-e.y),y:n}},k=function t(e,o,n){if(o.x===0)return null;return{x:n,y:e.y+o.y/o.x*(n-e.x)}},A=function t(e,o,n,r){if(o.x===0)return k(n,r,e.x);if(r.x===0)return k(e,o,n.x);if(o.y===0)return P(n,r,e.y);if(r.y===0)return P(e,o,n.y);var i=S(o,r);if(i==0)return null;var s={x:n.x-e.x,y:n.y-e.y};var a=S(s,o)/i;var l=S(s,r)/i;var c=e.x+l*o.x,u=n.x+a*r.x;var p=e.y+l*o.y,h=n.y+a*r.y;var d=(c+u)/2;var f=(p+h)/2;return{x:d,y:f}},N=function(){s(r,null,[{key:"compare",value:function t(e,o){var n=r.comparePoints(e.point,o.point);if(n!==0)return n;if(e.point!==o.point)e.link(o);if(e.isLeft!==o.isLeft)return e.isLeft?1:-1;return j.compare(e.segment,o.segment)}},{key:"comparePoints",value:function t(e,o){if(e.x<o.x)return-1;if(e.x>o.x)return 1;if(e.y<o.y)return-1;if(e.y>o.y)return 1;return 0}}]);function r(t,e){c(this,r);if(t.events===undefined)t.events=[this];else t.events.push(this);this.point=t;this.isLeft=e}s(r,[{key:"link",value:function t(e){if(e.point===this.point)throw new Error("Tried to link already linked events");var o=e.point.events;for(var n=0,r=o.length;n<r;n++){var i=o[n];this.point.events.push(i);i.point=this.point}this.checkForConsuming()}},{key:"checkForConsuming",value:function t(){var e=this.point.events.length;for(var o=0;o<e;o++){var n=this.point.events[o];if(n.segment.consumedBy!==undefined)continue;for(var r=o+1;r<e;r++){var i=this.point.events[r];if(i.consumedBy!==undefined)continue;if(n.otherSE.point.events!==i.otherSE.point.events)continue;n.segment.consume(i.segment)}}}},{key:"getAvailableLinkedEvents",value:function t(){var e=[];for(var o=0,n=this.point.events.length;o<n;o++){var r=this.point.events[o];if(r!==this&&!r.segment.ringOut&&r.segment.isInResult())e.push(r)}return e}},{key:"getLeftmostComparator",value:function t(n){var r=this;var l=new Map;var c=function t(e){var o=e.otherSE;l.set(e,{sine:E(r.point,n.point,o.point),cosine:C(r.point,n.point,o.point)})};return function(t,e){if(!l.has(t))c(t);if(!l.has(e))c(e);var o=l.get(t),n=o.sine,r=o.cosine;var i=l.get(e),s=i.sine,a=i.cosine;if(n>=0&&s>=0){if(r<a)return 1;if(r>a)return-1;return 0}if(n<0&&s<0){if(r<a)return-1;if(r>a)return 1;return 0}if(s<n)return-1;if(s>n)return 1;return 0}}}]);return r}(),M=0,j=function(){s(h,null,[{key:"compare",value:function t(e,o){var n=e.leftSE.point.x;var r=o.leftSE.point.x;var i=e.rightSE.point.x;var s=o.rightSE.point.x;if(s<n)return 1;if(i<r)return-1;var a=e.leftSE.point.y;var l=o.leftSE.point.y;var c=e.rightSE.point.y;var u=o.rightSE.point.y;if(n<r){if(l<a&&l<c)return 1;if(l>a&&l>c)return-1;var p=e.comparePoint(o.leftSE.point);if(p<0)return 1;if(p>0)return-1;var h=o.comparePoint(e.rightSE.point);if(h!==0)return h;return-1}if(n>r){if(a<l&&a<u)return-1;if(a>l&&a>u)return 1;var d=o.comparePoint(e.leftSE.point);if(d!==0)return d;var f=e.comparePoint(o.rightSE.point);if(f<0)return 1;if(f>0)return-1;return 1}if(a<l)return-1;if(a>l)return 1;if(i<s){var y=o.comparePoint(e.rightSE.point);if(y!==0)return y}if(i>s){var m=e.comparePoint(o.rightSE.point);if(m<0)return 1;if(m>0)return-1}if(i!==s){var g=c-a;var v=i-n;var _=u-l;var w=s-r;if(g>v&&_<w)return 1;if(g<v&&_>w)return-1}if(i>s)return 1;if(i<s)return-1;if(c<u)return-1;if(c>u)return 1;if(e.id<o.id)return-1;if(e.id>o.id)return 1;return 0}}]);function h(t,e,o,n){c(this,h);this.id=++M;this.leftSE=t;t.segment=this;t.otherSE=e;this.rightSE=e;e.segment=this;e.otherSE=t;this.rings=o;this.windings=n}s(h,[{key:"replaceRightSE",value:function t(e){this.rightSE=e;this.rightSE.segment=this;this.rightSE.otherSE=this.leftSE;this.leftSE.otherSE=this.rightSE}},{key:"bbox",value:function t(){var e=this.leftSE.point.y;var o=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:e<o?e:o},ur:{x:this.rightSE.point.x,y:e>o?e:o}}}},{key:"vector",value:function t(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}},{key:"isAnEndpoint",value:function t(e){return e.x===this.leftSE.point.x&&e.y===this.leftSE.point.y||e.x===this.rightSE.point.x&&e.y===this.rightSE.point.y}},{key:"comparePoint",value:function t(e){if(this.isAnEndpoint(e))return 0;var o=this.leftSE.point;var n=this.rightSE.point;var r=this.vector();if(o.x===n.x){if(e.x===o.x)return 0;return e.x<o.x?1:-1}var i=(e.y-o.y)/r.y;var s=o.x+i*r.x;if(e.x===s)return 0;var a=(e.x-o.x)/r.x;var l=o.y+a*r.y;if(e.y===l)return 0;return e.y<l?-1:1}},{key:"getIntersection",value:function t(e){var o=this.bbox();var n=e.bbox();var r=I(o,n);if(r===null)return null;var i=this.leftSE.point;var s=this.rightSE.point;var a=e.leftSE.point;var l=e.rightSE.point;var c=_(o,a)&&this.comparePoint(a)===0;var u=_(n,i)&&e.comparePoint(i)===0;var p=_(o,l)&&this.comparePoint(l)===0;var h=_(n,s)&&e.comparePoint(s)===0;if(u&&c){if(h&&!p)return s;if(!h&&p)return l;return null}if(u){if(p)if(i.x===l.x&&i.y===l.y)return null;return i}if(c){if(h)if(s.x===a.x&&s.y===a.y)return null;return a}if(h&&p)return null;if(h)return s;if(p)return l;var d=A(i,this.vector(),a,e.vector());if(d===null)return null;if(!_(r,d))return null;return R.round(d.x,d.y)}},{key:"split",value:function t(e){var o=[];var n=e.events!==undefined;var r=new N(e,true);var i=new N(e,false);var s=this.rightSE;this.replaceRightSE(i);o.push(i);o.push(r);var a=new h(r,s,this.rings.slice(),this.windings.slice());if(N.comparePoints(a.leftSE.point,a.rightSE.point)>0)a.swapEvents();if(N.comparePoints(this.leftSE.point,this.rightSE.point)>0)this.swapEvents();if(n){r.checkForConsuming();i.checkForConsuming()}return o}},{key:"swapEvents",value:function t(){var e=this.rightSE;this.rightSE=this.leftSE;this.leftSE=e;this.leftSE.isLeft=true;this.rightSE.isLeft=false;for(var o=0,n=this.windings.length;o<n;o++)this.windings[o]*=-1}},{key:"consume",value:function t(e){var o=this;var n=e;while(o.consumedBy)o=o.consumedBy;while(n.consumedBy)n=n.consumedBy;var r=h.compare(o,n);if(r===0)return;if(r>0){var i=o;o=n;n=i}if(o.prev===n){var s=o;o=n;n=s}for(var a=0,l=n.rings.length;a<l;a++){var c=n.rings[a];var u=n.windings[a];var p=o.rings.indexOf(c);if(p===-1){o.rings.push(c);o.windings.push(u)}else o.windings[p]+=u}n.rings=null;n.windings=null;n.consumedBy=o;n.leftSE.consumedBy=o.leftSE;n.rightSE.consumedBy=o.rightSE}},{key:"prevInResult",value:function t(){if(this._prevInResult!==undefined)return this._prevInResult;if(!this.prev)this._prevInResult=null;else if(this.prev.isInResult())this._prevInResult=this.prev;else this._prevInResult=this.prev.prevInResult();return this._prevInResult}},{key:"beforeState",value:function t(){if(this._beforeState!==undefined)return this._beforeState;if(!this.prev)this._beforeState={rings:[],windings:[],multiPolys:[]};else{var e=this.prev.consumedBy||this.prev;this._beforeState=e.afterState()}return this._beforeState}},{key:"afterState",value:function t(){if(this._afterState!==undefined)return this._afterState;var e=this.beforeState();this._afterState={rings:e.rings.slice(0),windings:e.windings.slice(0),multiPolys:[]};var o=this._afterState.rings;var n=this._afterState.windings;var r=this._afterState.multiPolys;for(var i=0,s=this.rings.length;i<s;i++){var a=this.rings[i];var l=this.windings[i];var c=o.indexOf(a);if(c===-1){o.push(a);n.push(l)}else n[c]+=l}var u=[];var p=[];for(var h=0,d=o.length;h<d;h++){if(n[h]===0)continue;var f=o[h];var y=f.poly;if(p.indexOf(y)!==-1)continue;if(f.isExterior)u.push(y);else{if(p.indexOf(y)===-1)p.push(y);var m=u.indexOf(f.poly);if(m!==-1)u.splice(m,1)}}for(var g=0,v=u.length;g<v;g++){var _=u[g].multiPoly;if(r.indexOf(_)===-1)r.push(_)}return this._afterState}},{key:"isInResult",value:function t(){if(this.consumedBy)return false;if(this._isInResult!==undefined)return this._isInResult;var e=this.beforeState().multiPolys;var o=this.afterState().multiPolys;switch(W.type){case"union":{var n=e.length===0;var r=o.length===0;this._isInResult=n!==r;break}case"intersection":{var i;var s;if(e.length<o.length){i=e.length;s=o.length}else{i=o.length;s=e.length}this._isInResult=s===W.numMultiPolys&&i<s;break}case"xor":{var a=Math.abs(e.length-o.length);this._isInResult=a%2===1;break}case"difference":{var l=function t(e){return e.length===1&&e[0].isSubject};this._isInResult=l(e)!==l(o);break}default:throw new Error("Unrecognized operation type found ".concat(W.type))}return this._isInResult}}],[{key:"fromRing",value:function t(e,o,n){var r,i,s;var a=N.comparePoints(e,o);if(a<0){r=e;i=o;s=1}else if(a>0){r=o;i=e;s=-1}else throw new Error("Tried to create degenerate segment at [".concat(e.x,", ").concat(e.y,"]"));var l=new N(r,true);var c=new N(i,false);return new h(l,c,[n],[s])}}]);return h}(),D=function(){function l(t,e,o){c(this,l);if(!Array.isArray(t)||t.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.poly=e;this.isExterior=o;this.segments=[];if(typeof t[0][0]!=="number"||typeof t[0][1]!=="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var n=R.round(t[0][0],t[0][1]);this.bbox={ll:{x:n.x,y:n.y},ur:{x:n.x,y:n.y}};var r=n;for(var i=1,s=t.length;i<s;i++){if(typeof t[i][0]!=="number"||typeof t[i][1]!=="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var a=R.round(t[i][0],t[i][1]);if(a.x===r.x&&a.y===r.y)continue;this.segments.push(j.fromRing(r,a,this));if(a.x<this.bbox.ll.x)this.bbox.ll.x=a.x;if(a.y<this.bbox.ll.y)this.bbox.ll.y=a.y;if(a.x>this.bbox.ur.x)this.bbox.ur.x=a.x;if(a.y>this.bbox.ur.y)this.bbox.ur.y=a.y;r=a}if(n.x!==r.x||n.y!==r.y)this.segments.push(j.fromRing(r,n,this))}s(l,[{key:"getSweepEvents",value:function t(){var e=[];for(var o=0,n=this.segments.length;o<n;o++){var r=this.segments[o];e.push(r.leftSE);e.push(r.rightSE)}return e}}]);return l}(),z=function(){function i(t,e){c(this,i);if(!Array.isArray(t))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new D(t[0],this,true);this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}};this.interiorRings=[];for(var o=1,n=t.length;o<n;o++){var r=new D(t[o],this,false);if(r.bbox.ll.x<this.bbox.ll.x)this.bbox.ll.x=r.bbox.ll.x;if(r.bbox.ll.y<this.bbox.ll.y)this.bbox.ll.y=r.bbox.ll.y;if(r.bbox.ur.x>this.bbox.ur.x)this.bbox.ur.x=r.bbox.ur.x;if(r.bbox.ur.y>this.bbox.ur.y)this.bbox.ur.y=r.bbox.ur.y;this.interiorRings.push(r)}this.multiPoly=e}s(i,[{key:"getSweepEvents",value:function t(){var e=this.exteriorRing.getSweepEvents();for(var o=0,n=this.interiorRings.length;o<n;o++){var r=this.interiorRings[o].getSweepEvents();for(var i=0,s=r.length;i<s;i++)e.push(r[i])}return e}}]);return i}(),B=function(){function i(t,e){c(this,i);if(!Array.isArray(t))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{if(typeof t[0][0][0]==="number")t=[t]}catch(t){}this.polys=[];this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(var o=0,n=t.length;o<n;o++){var r=new z(t[o],this);if(r.bbox.ll.x<this.bbox.ll.x)this.bbox.ll.x=r.bbox.ll.x;if(r.bbox.ll.y<this.bbox.ll.y)this.bbox.ll.y=r.bbox.ll.y;if(r.bbox.ur.x>this.bbox.ur.x)this.bbox.ur.x=r.bbox.ur.x;if(r.bbox.ur.y>this.bbox.ur.y)this.bbox.ur.y=r.bbox.ur.y;this.polys.push(r)}this.isSubject=e}s(i,[{key:"getSweepEvents",value:function t(){var e=[];for(var o=0,n=this.polys.length;o<n;o++){var r=this.polys[o].getSweepEvents();for(var i=0,s=r.length;i<s;i++)e.push(r[i])}return e}}]);return i}(),F=function(){s(b,null,[{key:"factory",value:function t(e){var o=[];for(var n=0,r=e.length;n<r;n++){var i=e[n];if(!i.isInResult()||i.ringOut)continue;var s=null;var a=i.leftSE;var l=i.rightSE;var c=[a];var u=a.point;var p=[];while(true){s=a;a=l;c.push(a);if(a.point===u)break;while(true){var h=a.getAvailableLinkedEvents();if(h.length===0){var d=c[0].point;var f=c[c.length-1].point;throw new Error("Unable to complete output ring starting at [".concat(d.x,",")+" ".concat(d.y,"]. Last matching segment found ends at")+" [".concat(f.x,", ").concat(f.y,"]."))}if(h.length===1){l=h[0].otherSE;break}var y=null;for(var m=0,g=p.length;m<g;m++)if(p[m].point===a.point){y=m;break}if(y!==null){var v=p.splice(y)[0];var _=c.splice(v.index);_.unshift(_[0].otherSE);o.push(new b(_.reverse()));continue}p.push({index:c.length,point:a.point});var w=a.getLeftmostComparator(s);l=h.sort(w)[0].otherSE;break}}o.push(new b(c))}return o}}]);function b(t){c(this,b);this.events=t;for(var e=0,o=t.length;e<o;e++)t[e].segment.ringOut=this;this.poly=null}s(b,[{key:"getGeom",value:function t(){var e=this.events[0].point;var o=[e];for(var n=1,r=this.events.length-1;n<r;n++){var i=this.events[n].point;var s=this.events[n+1].point;if(O(i,e,s)===0)continue;o.push(i);e=i}if(o.length===1)return null;var a=o[0];var l=o[1];if(O(a,e,l)===0)o.shift();o.push(o[0]);var c=this.isExteriorRing()?1:-1;var u=this.isExteriorRing()?0:o.length-1;var p=this.isExteriorRing()?o.length:-1;var h=[];for(var d=u;d!=p;d+=c)h.push([o[d].x,o[d].y]);return h}},{key:"isExteriorRing",value:function t(){if(this._isExteriorRing===undefined){var e=this.enclosingRing();this._isExteriorRing=e?!e.isExteriorRing():true}return this._isExteriorRing}},{key:"enclosingRing",value:function t(){if(this._enclosingRing===undefined)this._enclosingRing=this._calcEnclosingRing();return this._enclosingRing}},{key:"_calcEnclosingRing",value:function t(){var e=this.events[0];for(var o=1,n=this.events.length;o<n;o++){var r=this.events[o];if(N.compare(e,r)>0)e=r}var i=e.segment.prevInResult();var s=i?i.prevInResult():null;while(true){if(!i)return null;if(!s)return i.ringOut;if(s.ringOut!==i.ringOut)if(s.ringOut.enclosingRing()!==i.ringOut)return i.ringOut;else return i.ringOut.enclosingRing();i=s.prevInResult();s=i?i.prevInResult():null}}}]);return b}(),U=function(){function e(t){c(this,e);this.exteriorRing=t;t.poly=this;this.interiorRings=[]}s(e,[{key:"addInterior",value:function t(e){this.interiorRings.push(e);e.poly=this}},{key:"getGeom",value:function t(){var e=[this.exteriorRing.getGeom()];if(e[0]===null)return null;for(var o=0,n=this.interiorRings.length;o<n;o++){var r=this.interiorRings[o].getGeom();if(r===null)continue;e.push(r)}return e}}]);return e}(),q=function(){function e(t){c(this,e);this.rings=t;this.polys=this._composePolys(t)}s(e,[{key:"getGeom",value:function t(){var e=[];for(var o=0,n=this.polys.length;o<n;o++){var r=this.polys[o].getGeom();if(r===null)continue;e.push(r)}return e}},{key:"_composePolys",value:function t(e){var o=[];for(var n=0,r=e.length;n<r;n++){var i=e[n];if(i.poly)continue;if(i.isExteriorRing())o.push(new U(i));else{var s=i.enclosingRing();if(!s.poly)o.push(new U(s));s.poly.addInterior(i)}}return o}}]);return e}(),G=function(){function o(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:j.compare;c(this,o);this.queue=t;this.tree=new L(e);this.segments=[]}s(o,[{key:"process",value:function t(e){var o=e.segment;var n=[];if(e.consumedBy){if(e.isLeft)this.queue.remove(e.otherSE);else this.tree.remove(o);return n}var r=e.isLeft?this.tree.insert(o):this.tree.find(o);if(!r)throw new Error("Unable to find segment #".concat(o.id," ")+"[".concat(o.leftSE.point.x,", ").concat(o.leftSE.point.y,"] -> ")+"[".concat(o.rightSE.point.x,", ").concat(o.rightSE.point.y,"] ")+"in SweepLine tree. Please submit a bug report.");var i=r;var s=r;var a=undefined;var l=undefined;while(a===undefined){i=this.tree.prev(i);if(i===null)a=null;else if(i.key.consumedBy===undefined)a=i.key}while(l===undefined){s=this.tree.next(s);if(s===null)l=null;else if(s.key.consumedBy===undefined)l=s.key}if(e.isLeft){var c=null;if(a){var u=a.getIntersection(o);if(u!==null){if(!o.isAnEndpoint(u))c=u;if(!a.isAnEndpoint(u)){var p=this._splitSafely(a,u);for(var h=0,d=p.length;h<d;h++)n.push(p[h])}}}var f=null;if(l){var y=l.getIntersection(o);if(y!==null){if(!o.isAnEndpoint(y))f=y;if(!l.isAnEndpoint(y)){var m=this._splitSafely(l,y);for(var g=0,v=m.length;g<v;g++)n.push(m[g])}}}if(c!==null||f!==null){var _=null;if(c===null)_=f;else if(f===null)_=c;else{var w=N.comparePoints(c,f);_=w<=0?c:f}this.queue.remove(o.rightSE);n.push(o.rightSE);var b=o.split(_);for(var S=0,x=b.length;S<x;S++)n.push(b[S])}if(n.length>0){this.tree.remove(o);n.push(e)}else{this.segments.push(o);o.prev=a}}else{if(a&&l){var O=a.getIntersection(l);if(O!==null){if(!a.isAnEndpoint(O)){var T=this._splitSafely(a,O);for(var E=0,C=T.length;E<C;E++)n.push(T[E])}if(!l.isAnEndpoint(O)){var P=this._splitSafely(l,O);for(var k=0,A=P.length;k<A;k++)n.push(P[k])}}}this.tree.remove(o)}return n}},{key:"_splitSafely",value:function t(e,o){this.tree.remove(e);var n=e.rightSE;this.queue.remove(n);var r=e.split(o);r.push(n);if(e.consumedBy===undefined)this.tree.insert(e);return r}}]);return o}(),Z=typeof process!=="undefined"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,H=typeof process!=="undefined"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6,K,W=new(function(){function t(){c(this,t)}s(t,[{key:"run",value:function t(e,o,n){W.type=e;R.reset();var r=[new B(o,true)];for(var i=0,s=n.length;i<s;i++)r.push(new B(n[i],false));W.numMultiPolys=r.length;if(W.type==="difference"){var a=r[0];var l=1;while(l<r.length)if(I(r[l].bbox,a.bbox)!==null)l++;else r.splice(l,1)}if(W.type==="intersection")for(var c=0,u=r.length;c<u;c++){var p=r[c];for(var h=c+1,d=r.length;h<d;h++)if(I(p.bbox,r[h].bbox)===null)return[]}var f=new L(N.compare);for(var y=0,m=r.length;y<m;y++){var g=r[y].getSweepEvents();for(var v=0,_=g.length;v<_;v++){f.insert(g[v]);if(f.size>Z)throw new Error("Infinite loop when putting segment endpoints in a priority queue "+"(queue size too big). Please file a bug report.")}}var w=new G(f);var b=f.size;var S=f.pop();while(S){var x=S.key;if(f.size===b){var O=x.segment;throw new Error("Unable to pop() ".concat(x.isLeft?"left":"right"," SweepEvent ")+"[".concat(x.point.x,", ").concat(x.point.y,"] from segment #").concat(O.id," ")+"[".concat(O.leftSE.point.x,", ").concat(O.leftSE.point.y,"] -> ")+"[".concat(O.rightSE.point.x,", ").concat(O.rightSE.point.y,"] from queue. ")+"Please file a bug report.")}if(f.size>Z)throw new Error("Infinite loop when passing sweep line over endpoints "+"(queue size too big). Please file a bug report.");if(w.segments.length>H)throw new Error("Infinite loop when passing sweep line over endpoints "+"(too many sweep line segments). Please file a bug report.");var T=w.process(x);for(var E=0,C=T.length;E<C;E++){var P=T[E];if(P.consumedBy===undefined)f.insert(P)}b=f.size;S=f.pop()}R.reset();var k=F.factory(w.segments);var A=new q(k);return A.getGeom()}}]);return t}()),V,Y,Q,J,X;return{union:function t(e){for(var o=arguments.length,n=new Array(o>1?o-1:0),r=1;r<o;r++)n[r-1]=arguments[r];return W.run("union",e,n)},intersection:function t(e){for(var o=arguments.length,n=new Array(o>1?o-1:0),r=1;r<o;r++)n[r-1]=arguments[r];return W.run("intersection",e,n)},xor:function t(e){for(var o=arguments.length,n=new Array(o>1?o-1:0),r=1;r<o;r++)n[r-1]=arguments[r];return W.run("xor",e,n)},difference:function t(e){for(var o=arguments.length,n=new Array(o>1?o-1:0),r=1;r<o;r++)n[r-1]=arguments[r];return W.run("difference",e,n)}}}()});function Mu(t,e,o){void 0===o&&(o={});var n,t=Ru(t),e=Ru(e),e=Nu.intersection(t.coordinates,e.coordinates);return 0===e.length?null:1===e.length?function(t,e,o){void 0===o&&(o={});for(var n=0,r=t;n<r.length;n++){var i=r[n];if(i.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var s=0;s<i[i.length-1].length;s++)if(i[i.length-1][s]!==i[0][s])throw new Error("First and last Position are not equivalent.")}return Iu({type:"Polygon",coordinates:t},e,o)}(e[0],o.properties):(o=o.properties,Iu({type:"MultiPolygon",coordinates:e},o,n=void 0===n?{}:n))}var ju,w=window&&window.__decorate||function(t,e,o,n){var r,i=arguments.length,s=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;0<=a;a--)(r=t[a])&&(s=(i<3?r(s):3<i?r(e,o,s):r(e,o))||s);return 3<i&&s&&Object.defineProperty(e,o,s),s},Du=window&&window.__read||function(t,e){var o="function"==typeof Symbol&&t[Symbol.iterator];if(!o)return t;var n,r,i=o.call(t),s=[];try{for(;(void 0===e||0<e--)&&!(n=i.next()).done;)s.push(n.value)}catch(t){r={error:t}}finally{try{n&&!n.done&&(o=i.return)&&o.call(i)}finally{if(r)throw r.error}}return s},zu=window&&window.__spreadArray||function(t,e){for(var o=0,n=e.length,r=t.length;o<n;o++,r++)t[r]=e[o];return t},Bu=["DIV","SPAN","A"],Fu=["data-azure-maps-attribution-minzoom","data-azure-maps-attribution-maxzoom","data-azure-maps-attribution-geometry","data-azure-maps-attribution-tileset","data-azure-maps-attribution-order","data-azure-maps-attribution-dynamic"],Uu=zu(["href"],Du(Fu)),qu=(Gu.prototype.equals=function(t){return this.stringRepresentation===t.stringRepresentation},Object.defineProperty(Gu.prototype,"stringRepresentation",{get:function(){return[void 0!==this.minZoom?"minzoom="+this.minZoom:"",void 0!==this.maxZoom?"maxzoom="+this.maxZoom:"",void 0!==this.geometry?this.element.attributes.getNamedItem("data-azure-maps-attribution-geometry").value:"",void 0!==this.tilesetId?"tilesetId="+this.tilesetId:"",this.dynamic?"dynamic":""].filter(function(t){return 0<t.length}).join(";")},enumerable:!1,configurable:!0}),Gu.applicable=function(t){return Array.from(t.attributes).map(function(t){return Fu.includes(t.name)}).reduce(function(t,e){return t||e},!1)},Object.defineProperty(Gu.prototype,"minZoom",{get:function(){var t=this.element.attributes.getNamedItem("data-azure-maps-attribution-minzoom");return t&&!isNaN(t.value)?parseInt(t.value):void 0},enumerable:!1,configurable:!0}),Object.defineProperty(Gu.prototype,"maxZoom",{get:function(){var t=this.element.attributes.getNamedItem("data-azure-maps-attribution-maxzoom");return t&&!isNaN(t.value)?parseInt(t.value):void 0},enumerable:!1,configurable:!0}),Object.defineProperty(Gu.prototype,"geometry",{get:function(){var t=this.element.attributes.getNamedItem("data-azure-maps-attribution-geometry");if(t&&t.value)try{return JSON.parse(t.value)}catch(t){return}},enumerable:!1,configurable:!0}),Object.defineProperty(Gu.prototype,"tilesetId",{get:function(){var t=this.element.attributes.getNamedItem("data-azure-maps-attribution-tileset");return t&&t.value?t.value:void 0},enumerable:!1,configurable:!0}),Object.defineProperty(Gu.prototype,"order",{get:function(){var t=this.element.attributes.getNamedItem("data-azure-maps-attribution-order");return t&&!isNaN(t.value)?parseInt(t.value):void 0},enumerable:!1,configurable:!0}),Object.defineProperty(Gu.prototype,"dynamic",{get:function(){return null!==this.element.attributes.getNamedItem("data-azure-maps-attribution-dynamic")},enumerable:!1,configurable:!0}),Object.defineProperty(Gu.prototype,"hidesElement",{get:function(){return"none"==this.element.style.display},enumerable:!1,configurable:!0}),Gu.prototype.forceHide=function(){this.element.style.display="none"},Gu.prototype.satisfied=function(t){var e=!this.minZoom||!t.zoom||t.zoom>=this.minZoom,o=!this.maxZoom||!t.zoom||t.zoom<=this.maxZoom,n=!0;return this.geometry&&t.bounds&&(n=null!==Mu({type:"Feature",geometry:this.geometry,properties:{}},{type:"Feature",geometry:{type:"Polygon",coordinates:[[Ci.getNorthWest(t.bounds),Ci.getNorthEast(t.bounds),Ci.getSouthEast(t.bounds),Ci.getSouthWest(t.bounds),Ci.getNorthWest(t.bounds)]]},properties:{}})),e&&o&&n},Gu.prototype.apply=function(e,t){var o=this;void 0===t&&(t=null);var n=this.satisfied(e.getCamera()),r=this.dynamic&&this.tilesetId,i=this.hidesElement,t=t&&["dragend","zoomend","pitchend"].includes(t.type);return n||i?n&&(i||r)&&(n&&i&&this.element.style.removeProperty("display"),r&&(t?e.events.addOnce("idle",function(t){return o.fetchAndApplyDynamicAttribution(e)}):this.fetchAndApplyDynamicAttribution(e))):this.element.style.display="none",n===i},Gu.prototype.fetchAndApplyDynamicAttribution=function(n){var e,o,t,r=this,i=n.getCamera();this.lastFetchState&&Ci.containsBoundingBox(this.lastFetchState.bounds,i.bounds)&&Math.floor(this.lastFetchState.zoom)==Math.floor(i.zoom)||(e=Yr(i.center,Ci.getSouthWest(i.bounds),Gu.viewportBufferExpansionRatio),t=((o=Yr(i.center,Ci.getNorthEast(i.bounds),Gu.viewportBufferExpansionRatio))[0]<e[0]?[[e[0],e[1],180,o[1]],[-180,e[1],o[0],o[1]]]:[[e[0],e[1],o[0],o[1]]]).map(function(t){var e=new URLSearchParams({"api-version":"2.1",tilesetId:r.tilesetId,zoom:void 0!==i.zoom?""+Math.floor(i.zoom):void 0,bounds:t.join(",")}),o="https://{{azMapsDomain}}/map/attribution",t={url:o,headers:{}};n._substituteDomainLanguageViewAndSignInRequest(o,t);e=t.url+(t.url.includes("?")?"&":"?")+e.toString();return n._sendRequest(e,"Attribution",t.headers).then(function(t){return t.json()})}),Promise.all(t).then(function(t){r.applyAttributionResponse(t),r.lastFetchState={bounds:new Ci([e[0],e[1],o[0],o[1]]),zoom:i.zoom}}).catch(function(t){return console.error(t)}))},Gu.prototype.applyAttributionResponse=function(t){var e,o,n=this,r=t.map(function(t){return t.copyrights||[]}).reduce(function(t,e){return zu(zu([],Du(t)),Du(e))},[]);0!=r.length&&(null!==(t=pl.parseWithFilter(r.join(""),function(t){return!0},function(t){return t},function(){return n.element.innerHTML="",n.element}))?(t="string"==typeof t?((r=document.createElement("span")).innerHTML=t,r):t,o=t===this.element?(e=document.createElement("span"),Array.from(this.element.childNodes).forEach(function(t){return e.appendChild(t)}),e):t,Array.from(this.element.attributes).filter(function(t){return Fu.includes(t.name)}).forEach(function(t){return o.attributes.setNamedItem(t.cloneNode())}),o.style.display=this.element.style.display,t=this.element.parentElement,this.element.remove(),t.append(o),this.element=o,this.attributionChangeCallback(this)):console.warn("Dynamic attribution is empty after filtering"))},Gu.viewportBufferExpansionRatio=2,w([(ju=1e3,function(t,e,o){var n=o.value,r=new Map;return o.value=function(){var t=this,e=arguments;r.get(t)||!1||(n.apply(t,e),r.set(t,!0),setTimeout(function(){return r.delete(t)},ju))},o})],Gu.prototype,"fetchAndApplyDynamicAttribution",null),Gu);function Gu(t,e){var o=this;this.lastFetchState={bounds:null,zoom:null},this.getElement=function(){return o.element},this.element=t,this.attributionChangeCallback=e}var Zu=window&&window.__read||function(t,e){var o="function"==typeof Symbol&&t[Symbol.iterator];if(!o)return t;var n,r,i=o.call(t),s=[];try{for(;(void 0===e||0<e--)&&!(n=i.next()).done;)s.push(n.value)}catch(t){r={error:t}}finally{try{n&&!n.done&&(o=i.return)&&o.call(i)}finally{if(r)throw r.error}}return s},Hu=window&&window.__spreadArray||function(t,e){for(var o=0,n=e.length,r=t.length;o<n;o++,r++)t[r]=e[o];return t},Ku=[/all rights reserved/gi],Wu=(Vu.prototype.addToMap=function(){this.map.events.add("stylechanged",this.loadAttributionOnceSourcesLoaded),this.map.events.add("dragend",this.applyRules),this.map.events.add("zoomend",this.applyRules),this.map.events.add("pitchend",this.applyRules)},Vu.prototype.removeFromMap=function(){this.map.events.remove("stylechanged",this.loadAttributionOnceSourcesLoaded),this.map.events.remove("dragend",this.applyRules),this.map.events.remove("zoomend",this.applyRules),this.map.events.remove("pitchend",this.applyRules)},Vu.prototype.getDefaultAttribution=function(){return this.copyrightControl.getDefaultAttributions().map(function(t){return e=t,(t=document.createElement("a")).textContent=e,t;var e})},Vu);function Vu(t,e,o){var n,a=this;this.rules=[],this.virtualContext=((n=document.createElement("span")).className="azure-map-copyright-context",n),this.renderContext=this.virtualContext.cloneNode(!1),this.addAttributionFromSource=function(t){},this.removeAttributionFromSource=function(t){},this.getMapStyleVisibleSources=function(){var e=a.map._getMap(),o=e.getStyle();return Object.entries(o.sources).filter(function(t){var e=Zu(t,1)[0];return o.layers.filter(function(t){return t&&t.source==e}).reduce(function(t,e){return!(e.layout&&"none"===e.layout.visibility||e.paint&&0===e.paint["icon-opacity"]&&0===e.paint["text-opacity"])||t},!1)}).map(function(t){t=Zu(t,1)[0];return e.getSource(t)})},this.loadAttributionOnceSourcesLoaded=function(){var t=a.getMapStyleVisibleSources();Promise.all(t.map(function(r){return new Promise(function(o,n){"tiles"in r?o(r):(r.load(),r.on("data",function t(e){"metadata"==e.sourceDataType&&(r.off("data",t),o(r))}),r.on("error",function t(e){r.off("error",t),n(e)}))}).then(function(t){return{status:"fulfilled",value:t}}).catch(function(t){return{status:"rejected",reason:t}})})).then(function(t){a.reloadAttribution()})},this.reloadAttribution=function(){var t=a.getMapStyleVisibleSources(),n=new Set,r={},e=Object.values(t).filter(function(t){return"attribution"in t&&t.attribution&&"tiles"in t&&0<t.tiles.length}).map(function(t){return t}).map(function(t){t=t.attribution;return pl.parseWithFilter(t,function(t){return Bu.includes(t.tagName)&&Array.from(t.attributes).map(function(t){return Uu.includes(t.name)}).reduce(function(t,e){return t&&e},!0)},function(t){var e,o=null;return t instanceof HTMLElement&&qu.applicable(t)&&(o=new qu(t,function(){return a.renderAttribution()}),n.add(o),void 0!==o.order&&(t.style.order=""+o.order)),o&&t instanceof HTMLElement&&((!((e=o.stringRepresentation)in r)||void 0!==o.order&&void 0!==r[e].order&&o.order<r[e].order||void 0!==o.order&&void 0===r[e].order)&&(r[e]=o)),t},function(){return document.createElement("span")})}),o=new Set(Object.values(r)),t=new Set(Hu([],Zu(n)).filter(function(t){return!o.has(t)})),i=new Set(Hu([],Zu(t)).map(function(t){return t.getElement()}));Hu([],Zu(i)).filter(function(t){return null!==t.parentElement}).forEach(function(t){return t.parentElement.removeChild(t)}),a.rules=Object.values(r);var e=e.filter(function(t){return"string"==typeof t||!i.has(t)}).map(function(t){return"string"==typeof t?new Text(t):t}),s=document.createElement("span");0<e.length?e.forEach(function(t){return s.appendChild(t)}):a.getDefaultAttribution().forEach(function(t){return s.appendChild(t)}),a.virtualContext=s,a.copyrightControl.setOptions({copyrightContent:a.renderContext}),a.applyRules(),a.renderAttribution()},this.applyRules=function(o){void 0===o&&(o=null),a.rules.reduce(function(t,e){e=e.apply(a.map,o);return t||e},!1)&&a.renderAttribution()},this.renderAttribution=function(){var e=function(t){return Array.from("none"!=t.style.display?t.children:[]).map(function(t){return e(t)}).reduce(function(t,e){return Hu(Hu([],Zu(t)),Zu(e))},Array.from("none"!=t.style.display?t.childNodes:[]).filter(function(t){return t.nodeType==t.TEXT_NODE}))},t=a.virtualContext.cloneNode(!0),o=e(t);o.forEach(function(t){return t.textContent=Hu([],Zu(Ku)).reduce(function(t,e){return t.replace(e,"").trim()},t.textContent)}),o.reduce(function(t,e){return t.has(e.textContent)?(e.textContent="",e.parentElement&&e.parentElement.removeChild(e)):t.add(e.textContent),t},new Set),a.renderContext.innerHTML="",Array.from(t.childNodes).forEach(function(t){return a.renderContext.appendChild(t)})},this.map=t,this.copyrightControl=e,this.options=o}var Yu=It(function(t){var e=(e=function(t){if(this.REQUEST_TYPE={LOGIN:"LOGIN",RENEW_TOKEN:"RENEW_TOKEN",UNKNOWN:"UNKNOWN"},this.RESPONSE_TYPE={ID_TOKEN_TOKEN:"id_token token",TOKEN:"token"},this.CONSTANTS={ACCESS_TOKEN:"access_token",EXPIRES_IN:"expires_in",ID_TOKEN:"id_token",ERROR_DESCRIPTION:"error_description",SESSION_STATE:"session_state",ERROR:"error",STORAGE:{TOKEN_KEYS:"adal.token.keys",ACCESS_TOKEN_KEY:"adal.access.token.key",EXPIRATION_KEY:"adal.expiration.key",STATE_LOGIN:"adal.state.login",STATE_RENEW:"adal.state.renew",NONCE_IDTOKEN:"adal.nonce.idtoken",SESSION_STATE:"adal.session.state",USERNAME:"adal.username",IDTOKEN:"adal.idtoken",ERROR:"adal.error",ERROR_DESCRIPTION:"adal.error.description",LOGIN_REQUEST:"adal.login.request",LOGIN_ERROR:"adal.login.error",RENEW_STATUS:"adal.token.renew.status",ANGULAR_LOGIN_REQUEST:"adal.angular.login.request"},RESOURCE_DELIMETER:"|",CACHE_DELIMETER:"||",LOADFRAME_TIMEOUT:6e3,TOKEN_RENEW_STATUS_CANCELED:"Canceled",TOKEN_RENEW_STATUS_COMPLETED:"Completed",TOKEN_RENEW_STATUS_IN_PROGRESS:"In Progress",LOGGING_LEVEL:{ERROR:0,WARN:1,INFO:2,VERBOSE:3},LEVEL_STRING_MAP:{0:"ERROR:",1:"WARNING:",2:"INFO:",3:"VERBOSE:"},POPUP_WIDTH:483,POPUP_HEIGHT:600},e.prototype._singletonInstance)return e.prototype._singletonInstance;if((e.prototype._singletonInstance=this).instance="https://login.microsoftonline.com/",this.config={},this.callback=null,this.popUp=!1,this.isAngular=!1,this._user=null,this._activeRenewals={},this._loginInProgress=!1,this._acquireTokenInProgress=!1,this._renewStates=[],this._callBackMappedToRenewStates={},this._callBacksMappedToRenewStates={},this._openedWindows=[],this._requestType=this.REQUEST_TYPE.LOGIN,window._adalInstance=this,t.displayCall&&"function"!=typeof t.displayCall)throw new Error("displayCall is not a function");if(!t.clientId)throw new Error("clientId is required");this.config=this._cloneConfig(t),void 0===this.config.navigateToLoginRequestUrl&&(this.config.navigateToLoginRequestUrl=!0),this.config.popUp&&(this.popUp=!0),this.config.callback&&"function"==typeof this.config.callback&&(this.callback=this.config.callback),this.config.instance&&(this.instance=this.config.instance),this.config.loginResource||(this.config.loginResource=this.config.clientId),this.config.redirectUri||(this.config.redirectUri=window.location.href.split("?")[0].split("#")[0]),this.config.postLogoutRedirectUri||(this.config.postLogoutRedirectUri=window.location.href.split("?")[0].split("#")[0]),this.config.anonymousEndpoints||(this.config.anonymousEndpoints=[]),this.config.isAngular&&(this.isAngular=this.config.isAngular),this.config.loadFrameTimeout&&(this.CONSTANTS.LOADFRAME_TIMEOUT=this.config.loadFrameTimeout)},"undefined"!=typeof window&&(window.Logging={piiLoggingEnabled:!1,level:0,log:function(t){}}),e.prototype.login=function(){var t,e;this._loginInProgress?this.info("Login in progress"):(this._loginInProgress=!0,t=this._guid(),this.config.state=t,this._idTokenNonce=this._guid(),(e=this._getItem(this.CONSTANTS.STORAGE.ANGULAR_LOGIN_REQUEST))&&""!==e?this._saveItem(this.CONSTANTS.STORAGE.ANGULAR_LOGIN_REQUEST,""):e=window.location.href,this.verbose("Expected state: "+t+" startPage:"+e),this._saveItem(this.CONSTANTS.STORAGE.LOGIN_REQUEST,e),this._saveItem(this.CONSTANTS.STORAGE.LOGIN_ERROR,""),this._saveItem(this.CONSTANTS.STORAGE.STATE_LOGIN,t,!0),this._saveItem(this.CONSTANTS.STORAGE.NONCE_IDTOKEN,this._idTokenNonce,!0),this._saveItem(this.CONSTANTS.STORAGE.ERROR,""),this._saveItem(this.CONSTANTS.STORAGE.ERROR_DESCRIPTION,""),e=this._getNavigateUrl("id_token",null)+"&nonce="+encodeURIComponent(this._idTokenNonce),this.config.displayCall?this.config.displayCall(e):this.popUp?(this._saveItem(this.CONSTANTS.STORAGE.STATE_LOGIN,""),this._renewStates.push(t),this.registerCallback(t,this.config.clientId,this.callback),this._loginPopup(e)):this.promptUser(e))},e.prototype._openPopup=function(t,e,o,n){try{var r=window.screenLeft||window.screenX,i=window.screenTop||window.screenY,s=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,a=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,l=s/2-o/2+r,c=a/2-n/2+i,u=window.open(t,e,"width="+o+", height="+n+", top="+c+", left="+l);return u.focus&&u.focus(),u}catch(t){return this.warn("Error opening popup, "+t.message),this._loginInProgress=!1,this._acquireTokenInProgress=!1,null}},e.prototype._handlePopupError=function(t,e,o,n,r){this.warn(n),this._saveItem(this.CONSTANTS.STORAGE.ERROR,o),this._saveItem(this.CONSTANTS.STORAGE.ERROR_DESCRIPTION,n),this._saveItem(this.CONSTANTS.STORAGE.LOGIN_ERROR,r),e&&this._activeRenewals[e]&&(this._activeRenewals[e]=null),this._loginInProgress=!1,this._acquireTokenInProgress=!1,t&&t(n,null,o)},e.prototype._loginPopup=function(t,n,e){var r,i,s,a=this._openPopup(t,"login",this.CONSTANTS.POPUP_WIDTH,this.CONSTANTS.POPUP_HEIGHT),l=e||this.callback;null!=a?(this._openedWindows.push(a),r=-1!=this.config.redirectUri.indexOf("#")?this.config.redirectUri.split("#")[0]:this.config.redirectUri,i=this,s=window.setInterval(function(){if(!a||a.closed||void 0===a.closed){var t="Popup Window closed",e="Popup Window closed by UI action/ Popup Window handle destroyed due to cross zone navigation in IE/Edge";return i.isAngular&&i._broadcast("adal:popUpClosed",e+i.CONSTANTS.RESOURCE_DELIMETER+t),i._handlePopupError(l,n,t,e,e),void window.clearInterval(s)}try{var o=a.location;if(-1!=encodeURI(o.href).indexOf(encodeURI(r)))return i.isAngular?i._broadcast("adal:popUpHashChanged",o.hash):i.handleWindowCallback(o.hash),window.clearInterval(s),i._loginInProgress=!1,i._acquireTokenInProgress=!1,i.info("Closing popup window"),i._openedWindows=[],void a.close()}catch(t){}},1)):this._handlePopupError(l,n,"Error opening popup",e="Popup Window is null. This can happen if you are using IE",e)},e.prototype._broadcast=function(t,e){function o(t,e){e=e||{bubbles:!1,cancelable:!1,detail:void 0};var o=document.createEvent("CustomEvent");return o.initCustomEvent(t,e.bubbles,e.cancelable,e.detail),o}"function"!=typeof window.CustomEvent&&(o.prototype=window.Event.prototype,window.CustomEvent=o);e=new CustomEvent(t,{detail:e});window.dispatchEvent(e)},e.prototype.loginInProgress=function(){return this._loginInProgress},e.prototype._hasResource=function(t){var e=this._getItem(this.CONSTANTS.STORAGE.TOKEN_KEYS);return e&&!this._isEmpty(e)&&-1<e.indexOf(t+this.CONSTANTS.RESOURCE_DELIMETER)},e.prototype.getCachedToken=function(t){if(!this._hasResource(t))return null;var e=this._getItem(this.CONSTANTS.STORAGE.ACCESS_TOKEN_KEY+t),o=this._getItem(this.CONSTANTS.STORAGE.EXPIRATION_KEY+t),n=this.config.expireOffsetSeconds||300;return o&&o>this._now()+n?e:(this._saveItem(this.CONSTANTS.STORAGE.ACCESS_TOKEN_KEY+t,""),this._saveItem(this.CONSTANTS.STORAGE.EXPIRATION_KEY+t,0),null)},e.prototype.getCachedUser=function(){if(this._user)return this._user;var t=this._getItem(this.CONSTANTS.STORAGE.IDTOKEN);return this._user=this._createUser(t),this._user},e.prototype.registerCallback=function(i,s,t){this._activeRenewals[s]=i,this._callBacksMappedToRenewStates[i]||(this._callBacksMappedToRenewStates[i]=[]);var a=this;this._callBacksMappedToRenewStates[i].push(t),this._callBackMappedToRenewStates[i]||(this._callBackMappedToRenewStates[i]=function(t,e,o,n){a._activeRenewals[s]=null;for(var r=0;r<a._callBacksMappedToRenewStates[i].length;++r)try{a._callBacksMappedToRenewStates[i][r](t,e,o,n)}catch(o){a.warn(o)}a._callBacksMappedToRenewStates[i]=null,a._callBackMappedToRenewStates[i]=null})},e.prototype._renewToken=function(t,e,o){this.info("renewToken is called for resource:"+t);var n=this._addAdalFrame("adalRenewFrame"+t),r=this._guid()+"|"+t;this.config.state=r,this._renewStates.push(r),this.verbose("Renew token Expected state: "+r);var i=this._urlRemoveQueryStringParameter(this._getNavigateUrl(o=o||"token",t),"prompt");o===this.RESPONSE_TYPE.ID_TOKEN_TOKEN&&(this._idTokenNonce=this._guid(),this._saveItem(this.CONSTANTS.STORAGE.NONCE_IDTOKEN,this._idTokenNonce,!0),i+="&nonce="+encodeURIComponent(this._idTokenNonce)),i=this._addHintParameters(i+="&prompt=none"),this.registerCallback(r,t,e),this.verbosePii("Navigate to:"+i),n.src="about:blank",this._loadFrameTimeout(i,"adalRenewFrame"+t,t)},e.prototype._renewIdToken=function(t,e){this.info("renewIdToken is called");var o=this._addAdalFrame("adalIdTokenFrame"),n=this._guid()+"|"+this.config.clientId;this._idTokenNonce=this._guid(),this._saveItem(this.CONSTANTS.STORAGE.NONCE_IDTOKEN,this._idTokenNonce,!0),this.config.state=n,this._renewStates.push(n),this.verbose("Renew Idtoken Expected state: "+n);var r=null==e?null:this.config.clientId,e=e||"id_token",r=this._urlRemoveQueryStringParameter(this._getNavigateUrl(e,r),"prompt"),r=this._addHintParameters(r+="&prompt=none");r+="&nonce="+encodeURIComponent(this._idTokenNonce),this.registerCallback(n,this.config.clientId,t),this.verbosePii("Navigate to:"+r),o.src="about:blank",this._loadFrameTimeout(r,"adalIdTokenFrame",this.config.clientId)},e.prototype._urlContainsQueryStringParameter=function(t,e){return new RegExp("[\\?&]"+t+"=").test(e)},e.prototype._urlRemoveQueryStringParameter=function(t,e){var o=new RegExp("(\\&"+e+"=)[^&]+");return t=t.replace(o,""),o=new RegExp("("+e+"=)[^&]+&"),t=t.replace(o,""),o=new RegExp("("+e+"=)[^&]+"),t=t.replace(o,"")},e.prototype._loadFrameTimeout=function(t,e,o){this.verbose("Set loading state to pending for: "+o),this._saveItem(this.CONSTANTS.STORAGE.RENEW_STATUS+o,this.CONSTANTS.TOKEN_RENEW_STATUS_IN_PROGRESS),this._loadFrame(t,e);var n=this;setTimeout(function(){var t;n._getItem(n.CONSTANTS.STORAGE.RENEW_STATUS+o)===n.CONSTANTS.TOKEN_RENEW_STATUS_IN_PROGRESS&&(n.verbose("Loading frame has timed out after: "+n.CONSTANTS.LOADFRAME_TIMEOUT/1e3+" seconds for resource "+o),(t=n._activeRenewals[o])&&n._callBackMappedToRenewStates[t]&&n._callBackMappedToRenewStates[t]("Token renewal operation failed due to timeout",null,"Token Renewal Failed"),n._saveItem(n.CONSTANTS.STORAGE.RENEW_STATUS+o,n.CONSTANTS.TOKEN_RENEW_STATUS_CANCELED))},n.CONSTANTS.LOADFRAME_TIMEOUT)},e.prototype._loadFrame=function(e,t){var o=this;o.info("LoadFrame: "+t);var n=t;setTimeout(function(){var t=o._addAdalFrame(n);""!==t.src&&"about:blank"!==t.src||(t.src=e,o._loadFrame(e,n))},500)},e.prototype.acquireToken=function(t,e){if(this._isEmpty(t))return this.warn("resource is required"),void e("resource is required",null,"resource is required");var o=this.getCachedToken(t);return o?(this.info("Token is already in cache for resource:"+t),void e(null,o,null)):this._user||this.config.extraQueryParameter&&-1!==this.config.extraQueryParameter.indexOf("login_hint")?void(this._activeRenewals[t]?this.registerCallback(this._activeRenewals[t],t,e):(this._requestType=this.REQUEST_TYPE.RENEW_TOKEN,t===this.config.clientId?this._user?(this.verbose("renewing idtoken"),this._renewIdToken(e)):(this.verbose("renewing idtoken and access_token"),this._renewIdToken(e,this.RESPONSE_TYPE.ID_TOKEN_TOKEN)):this._user?(this.verbose("renewing access_token"),this._renewToken(t,e)):(this.verbose("renewing idtoken and access_token"),this._renewToken(t,e,this.RESPONSE_TYPE.ID_TOKEN_TOKEN)))):(this.warn("User login is required"),void e("User login is required",null,"login required"))},e.prototype.acquireTokenPopup=function(t,e,o,n){if(this._isEmpty(t))return this.warn("resource is required"),void n("resource is required",null,"resource is required");if(!this._user)return this.warn("User login is required"),void n("User login is required",null,"login required");if(this._acquireTokenInProgress)return this.warn("Acquire token interactive is already in progress"),void n("Acquire token interactive is already in progress",null,"Acquire token interactive is already in progress");var r=this._guid()+"|"+t;this.config.state=r,this._renewStates.push(r),this._requestType=this.REQUEST_TYPE.RENEW_TOKEN,this.verbose("Renew token Expected state: "+r);var i=this._urlRemoveQueryStringParameter(this._getNavigateUrl("token",t),"prompt");if(i+="&prompt=select_account",e&&(i+=e),o&&-1===i.indexOf("&claims"))i+="&claims="+encodeURIComponent(o);else if(o&&-1!==i.indexOf("&claims"))throw new Error("Claims cannot be passed as an extraQueryParameter");i=this._addHintParameters(i),this._acquireTokenInProgress=!0,this.info("acquireToken interactive is called for the resource "+t),this.registerCallback(r,t,n),this._loginPopup(i,t,n)},e.prototype.acquireTokenRedirect=function(t,e,o){if(this._isEmpty(t))return this.warn("resource is required"),void n("resource is required",null,"resource is required");var n=this.callback;if(!this._user)return this.warn("User login is required"),void n("User login is required",null,"login required");if(this._acquireTokenInProgress)return this.warn("Acquire token interactive is already in progress"),void n("Acquire token interactive is already in progress",null,"Acquire token interactive is already in progress");var r=this._guid()+"|"+t;this.config.state=r,this.verbose("Renew token Expected state: "+r);n=this._urlRemoveQueryStringParameter(this._getNavigateUrl("token",t),"prompt");if(n+="&prompt=select_account",e&&(n+=e),o&&-1===n.indexOf("&claims"))n+="&claims="+encodeURIComponent(o);else if(o&&-1!==n.indexOf("&claims"))throw new Error("Claims cannot be passed as an extraQueryParameter");n=this._addHintParameters(n),this._acquireTokenInProgress=!0,this.info("acquireToken interactive is called for the resource "+t),this._saveItem(this.CONSTANTS.STORAGE.LOGIN_REQUEST,window.location.href),this._saveItem(this.CONSTANTS.STORAGE.STATE_RENEW,r,!0),this.promptUser(n)},e.prototype.promptUser=function(t){t?(this.infoPii("Navigate to:"+t),window.location.replace(t)):this.info("Navigate url is empty")},e.prototype.clearCache=function(){this._saveItem(this.CONSTANTS.STORAGE.LOGIN_REQUEST,""),this._saveItem(this.CONSTANTS.STORAGE.ANGULAR_LOGIN_REQUEST,""),this._saveItem(this.CONSTANTS.STORAGE.SESSION_STATE,""),this._saveItem(this.CONSTANTS.STORAGE.STATE_LOGIN,""),this._saveItem(this.CONSTANTS.STORAGE.STATE_RENEW,""),this._renewStates=[],this._saveItem(this.CONSTANTS.STORAGE.NONCE_IDTOKEN,""),this._saveItem(this.CONSTANTS.STORAGE.IDTOKEN,""),this._saveItem(this.CONSTANTS.STORAGE.ERROR,""),this._saveItem(this.CONSTANTS.STORAGE.ERROR_DESCRIPTION,""),this._saveItem(this.CONSTANTS.STORAGE.LOGIN_ERROR,""),this._saveItem(this.CONSTANTS.STORAGE.LOGIN_ERROR,"");var t=this._getItem(this.CONSTANTS.STORAGE.TOKEN_KEYS);if(!this._isEmpty(t))for(var t=t.split(this.CONSTANTS.RESOURCE_DELIMETER),e=0;e<t.length&&""!==t[e];e++)this._saveItem(this.CONSTANTS.STORAGE.ACCESS_TOKEN_KEY+t[e],""),this._saveItem(this.CONSTANTS.STORAGE.EXPIRATION_KEY+t[e],0);this._saveItem(this.CONSTANTS.STORAGE.TOKEN_KEYS,"")},e.prototype.clearCacheForResource=function(t){this._saveItem(this.CONSTANTS.STORAGE.STATE_RENEW,""),this._saveItem(this.CONSTANTS.STORAGE.ERROR,""),this._saveItem(this.CONSTANTS.STORAGE.ERROR_DESCRIPTION,""),this._hasResource(t)&&(this._saveItem(this.CONSTANTS.STORAGE.ACCESS_TOKEN_KEY+t,""),this._saveItem(this.CONSTANTS.STORAGE.EXPIRATION_KEY+t,0))},e.prototype.logOut=function(){var t,e;this.clearCache(),this._user=null,e=this.config.logOutUri||(t="common",e="",this.config.tenant&&(t=this.config.tenant),this.config.postLogoutRedirectUri&&(e="post_logout_redirect_uri="+encodeURIComponent(this.config.postLogoutRedirectUri)),this.instance+t+"/oauth2/logout?"+e),this.infoPii("Logout navigate to: "+e),this.promptUser(e)},e.prototype._isEmpty=function(t){return void 0===t||!t||0===t.length},e.prototype.getUser=function(t){if("function"!=typeof t)throw new Error("callback is not a function");var e;this._user?t(null,this._user):(e=this._getItem(this.CONSTANTS.STORAGE.IDTOKEN),this._isEmpty(e)?(this.warn("User information is not available"),t("User information is not available",null)):(this.info("User exists in cache: "),this._user=this._createUser(e),t(null,this._user)))},e.prototype._addHintParameters=function(t){var e;return this._user&&this._user.profile&&(this._user.profile.sid&&-1!==t.indexOf("&prompt=none")?this._urlContainsQueryStringParameter("sid",t)||(t+="&sid="+encodeURIComponent(this._user.profile.sid)):this._user.profile.upn&&(this._urlContainsQueryStringParameter("login_hint",t)||(t+="&login_hint="+encodeURIComponent(this._user.profile.upn)),!this._urlContainsQueryStringParameter("domain_hint",t)&&-1<this._user.profile.upn.indexOf("@")&&(e=this._user.profile.upn.split("@"),t+="&domain_hint="+encodeURIComponent(e[e.length-1])))),t},e.prototype._createUser=function(t){var e=null,t=this._extractIdToken(t);return t&&t.hasOwnProperty("aud")&&(t.aud.toLowerCase()===this.config.clientId.toLowerCase()?(e={userName:"",profile:t},t.hasOwnProperty("upn")?e.userName=t.upn:t.hasOwnProperty("email")&&(e.userName=t.email)):this.warn("IdToken has invalid aud field")),e},e.prototype._getHash=function(t){return-1<t.indexOf("#/")?t=t.substring(t.indexOf("#/")+2):-1<t.indexOf("#")&&(t=t.substring(1)),t},e.prototype.isCallback=function(t){t=this._getHash(t);t=this._deserialize(t);return t.hasOwnProperty(this.CONSTANTS.ERROR_DESCRIPTION)||t.hasOwnProperty(this.CONSTANTS.ACCESS_TOKEN)||t.hasOwnProperty(this.CONSTANTS.ID_TOKEN)},e.prototype.getLoginError=function(){return this._getItem(this.CONSTANTS.STORAGE.LOGIN_ERROR)},e.prototype.getRequestInfo=function(t){t=this._getHash(t);var e=this._deserialize(t),o={valid:!1,parameters:{},stateMatch:!1,stateResponse:"",requestType:this.REQUEST_TYPE.UNKNOWN};if(e&&((o.parameters=e).hasOwnProperty(this.CONSTANTS.ERROR_DESCRIPTION)||e.hasOwnProperty(this.CONSTANTS.ACCESS_TOKEN)||e.hasOwnProperty(this.CONSTANTS.ID_TOKEN))){o.valid=!0;t="";if(!e.hasOwnProperty("state"))return this.warn("No state returned"),o;if(this.verbose("State: "+e.state),t=e.state,o.stateResponse=t,this._matchState(o))return o;if(!o.stateMatch&&window.parent){o.requestType=this._requestType;for(var n=this._renewStates,r=0;r<n.length;r++)if(n[r]===o.stateResponse){o.stateMatch=!0;break}}}return o},e.prototype._matchNonce=function(t){if(e=this._getItem(this.CONSTANTS.STORAGE.NONCE_IDTOKEN))for(var e=e.split(this.CONSTANTS.CACHE_DELIMETER),o=0;o<e.length;o++)if(e[o]&&e[o]===t.profile.nonce)return!0;return!1},e.prototype._matchState=function(t){if(e=this._getItem(this.CONSTANTS.STORAGE.STATE_LOGIN))for(var e=e.split(this.CONSTANTS.CACHE_DELIMETER),o=0;o<e.length;o++)if(e[o]&&e[o]===t.stateResponse)return t.requestType=this.REQUEST_TYPE.LOGIN,t.stateMatch=!0;if(n=this._getItem(this.CONSTANTS.STORAGE.STATE_RENEW))for(var n=n.split(this.CONSTANTS.CACHE_DELIMETER),o=0;o<n.length;o++)if(n[o]&&n[o]===t.stateResponse)return t.requestType=this.REQUEST_TYPE.RENEW_TOKEN,t.stateMatch=!0;return!1},e.prototype._getResourceFromState=function(t){if(t){var e=t.indexOf("|");if(-1<e&&e+1<t.length)return t.substring(e+1)}return""},e.prototype.saveTokenFromHash=function(t){this.info("State status:"+t.stateMatch+"; Request type:"+t.requestType),this._saveItem(this.CONSTANTS.STORAGE.ERROR,""),this._saveItem(this.CONSTANTS.STORAGE.ERROR_DESCRIPTION,"");var e,o=this._getResourceFromState(t.stateResponse);t.parameters.hasOwnProperty(this.CONSTANTS.ERROR_DESCRIPTION)?(this.infoPii("Error :"+t.parameters.error+"; Error description:"+t.parameters[this.CONSTANTS.ERROR_DESCRIPTION]),this._saveItem(this.CONSTANTS.STORAGE.ERROR,t.parameters.error),this._saveItem(this.CONSTANTS.STORAGE.ERROR_DESCRIPTION,t.parameters[this.CONSTANTS.ERROR_DESCRIPTION]),t.requestType===this.REQUEST_TYPE.LOGIN&&(this._loginInProgress=!1,this._saveItem(this.CONSTANTS.STORAGE.LOGIN_ERROR,t.parameters.error_description))):t.stateMatch?(this.info("State is right"),t.parameters.hasOwnProperty(this.CONSTANTS.SESSION_STATE)&&this._saveItem(this.CONSTANTS.STORAGE.SESSION_STATE,t.parameters[this.CONSTANTS.SESSION_STATE]),t.parameters.hasOwnProperty(this.CONSTANTS.ACCESS_TOKEN)&&(this.info("Fragment has access token"),this._hasResource(o)||(e=this._getItem(this.CONSTANTS.STORAGE.TOKEN_KEYS)||"",this._saveItem(this.CONSTANTS.STORAGE.TOKEN_KEYS,e+o+this.CONSTANTS.RESOURCE_DELIMETER)),this._saveItem(this.CONSTANTS.STORAGE.ACCESS_TOKEN_KEY+o,t.parameters[this.CONSTANTS.ACCESS_TOKEN]),this._saveItem(this.CONSTANTS.STORAGE.EXPIRATION_KEY+o,this._expiresIn(t.parameters[this.CONSTANTS.EXPIRES_IN]))),t.parameters.hasOwnProperty(this.CONSTANTS.ID_TOKEN)&&(this.info("Fragment has id token"),this._loginInProgress=!1,this._user=this._createUser(t.parameters[this.CONSTANTS.ID_TOKEN]),this._user&&this._user.profile?this._matchNonce(this._user)?(this._saveItem(this.CONSTANTS.STORAGE.IDTOKEN,t.parameters[this.CONSTANTS.ID_TOKEN]),o=this.config.loginResource||this.config.clientId,this._hasResource(o)||(e=this._getItem(this.CONSTANTS.STORAGE.TOKEN_KEYS)||"",this._saveItem(this.CONSTANTS.STORAGE.TOKEN_KEYS,e+o+this.CONSTANTS.RESOURCE_DELIMETER)),this._saveItem(this.CONSTANTS.STORAGE.ACCESS_TOKEN_KEY+o,t.parameters[this.CONSTANTS.ID_TOKEN]),this._saveItem(this.CONSTANTS.STORAGE.EXPIRATION_KEY+o,this._user.profile.exp)):(this._saveItem(this.CONSTANTS.STORAGE.LOGIN_ERROR,"Nonce received: "+this._user.profile.nonce+" is not same as requested: "+this._getItem(this.CONSTANTS.STORAGE.NONCE_IDTOKEN)),this._user=null):(t.parameters.error="invalid id_token",t.parameters.error_description="Invalid id_token. id_token: "+t.parameters[this.CONSTANTS.ID_TOKEN],this._saveItem(this.CONSTANTS.STORAGE.ERROR,"invalid id_token"),this._saveItem(this.CONSTANTS.STORAGE.ERROR_DESCRIPTION,"Invalid id_token. id_token: "+t.parameters[this.CONSTANTS.ID_TOKEN])))):(t.parameters.error="Invalid_state",t.parameters.error_description="Invalid_state. state: "+t.stateResponse,this._saveItem(this.CONSTANTS.STORAGE.ERROR,"Invalid_state"),this._saveItem(this.CONSTANTS.STORAGE.ERROR_DESCRIPTION,"Invalid_state. state: "+t.stateResponse)),this._saveItem(this.CONSTANTS.STORAGE.RENEW_STATUS+o,this.CONSTANTS.TOKEN_RENEW_STATUS_COMPLETED)},e.prototype.getResourceForEndpoint=function(t){if(this.config&&this.config.anonymousEndpoints)for(var e=0;e<this.config.anonymousEndpoints.length;e++)if(-1<t.indexOf(this.config.anonymousEndpoints[e]))return null;if(this.config&&this.config.endpoints)for(var o in this.config.endpoints)if(-1<t.indexOf(o))return this.config.endpoints[o];return!(-1<t.indexOf("http://")||-1<t.indexOf("https://"))||this._getHostFromUri(t)===this._getHostFromUri(this.config.redirectUri)?this.config.loginResource:null},e.prototype._getHostFromUri=function(t){return String(t).replace(/^(https?:)\/\//,"").split("/")[0]},e.prototype.handleWindowCallback=function(t){if(null==t&&(t=window.location.hash),this.isCallback(t)){var e=null,o=!1;0<this._openedWindows.length&&this._openedWindows[this._openedWindows.length-1].opener&&this._openedWindows[this._openedWindows.length-1].opener._adalInstance?(e=this._openedWindows[this._openedWindows.length-1].opener._adalInstance,o=!0):window.parent&&window.parent._adalInstance&&(e=window.parent._adalInstance);var n,r=e.getRequestInfo(t),i=null,s=o||window.parent!==window?e._callBackMappedToRenewStates[r.stateResponse]:e.callback;e.info("Returned from redirect url"),e.saveTokenFromHash(r),r.requestType===this.REQUEST_TYPE.RENEW_TOKEN&&window.parent?(window.parent!==window?e.verbose("Window is in iframe, acquiring token silently"):e.verbose("acquiring token interactive in progress"),n=r.parameters[e.CONSTANTS.ACCESS_TOKEN]||r.parameters[e.CONSTANTS.ID_TOKEN],i=e.CONSTANTS.ACCESS_TOKEN):r.requestType===this.REQUEST_TYPE.LOGIN&&(n=r.parameters[e.CONSTANTS.ID_TOKEN],i=e.CONSTANTS.ID_TOKEN);t=r.parameters[e.CONSTANTS.ERROR_DESCRIPTION],r=r.parameters[e.CONSTANTS.ERROR];try{s&&s(t,n,r,i)}catch(t){e.error("Error occurred in user defined callback function: "+t)}window.parent!==window||o||(e.config.navigateToLoginRequestUrl?window.location.href=e._getItem(e.CONSTANTS.STORAGE.LOGIN_REQUEST):window.location.hash="")}},e.prototype._getNavigateUrl=function(t,e){var o="common";this.config.tenant&&(o=this.config.tenant);e=this.instance+o+"/oauth2/authorize"+this._serialize(t,this.config,e)+this._addLibMetadata();return this.info("Navigate url:"+e),e},e.prototype._extractIdToken=function(t){t=this._decodeJwt(t);if(!t)return null;try{var e=t.JWSPayload,o=this._base64DecodeStringUrlSafe(e);return o?JSON.parse(o):(this.info("The returned id_token could not be base64 url safe decoded."),null)}catch(t){this.error("The returned id_token could not be decoded",t)}return null},e.prototype._base64DecodeStringUrlSafe=function(t){return t=t.replace(/-/g,"+").replace(/_/g,"/"),window.atob?decodeURIComponent(escape(window.atob(t))):decodeURIComponent(escape(this._decode(t)))},e.prototype._decode=function(t){var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",o=(t=String(t).replace(/=+$/,"")).length;if(o%4==1)throw new Error("The token to be decoded is not correctly encoded.");for(var n,r,i,s,a,l,c,u="",p=0;p<o;p+=4){if(n=e.indexOf(t.charAt(p)),r=e.indexOf(t.charAt(p+1)),i=e.indexOf(t.charAt(p+2)),s=e.indexOf(t.charAt(p+3)),p+2===o-1){l=(a=n<<18|r<<12|i<<6)>>16&255,c=a>>8&255,u+=String.fromCharCode(l,c);break}if(p+1===o-1){l=(a=n<<18|r<<12)>>16&255,u+=String.fromCharCode(l);break}l=(a=n<<18|r<<12|i<<6|s)>>16&255,c=a>>8&255,u+=String.fromCharCode(l,c,255&a)}return u},e.prototype._decodeJwt=function(t){if(this._isEmpty(t))return null;t=/^([^\.\s]*)\.([^\.\s]+)\.([^\.\s]*)$/.exec(t);return!t||t.length<4?(this.warn("The returned id_token is not parseable."),null):{header:t[1],JWSPayload:t[2],JWSSig:t[3]}},e.prototype._convertUrlSafeToRegularBase64EncodedString=function(t){return t.replace("-","+").replace("_","/")},e.prototype._serialize=function(t,e,o){var n=[];return null!==e&&(n.push("?response_type="+t),n.push("client_id="+encodeURIComponent(e.clientId)),o&&n.push("resource="+encodeURIComponent(o)),n.push("redirect_uri="+encodeURIComponent(e.redirectUri)),n.push("state="+encodeURIComponent(e.state)),e.hasOwnProperty("slice")&&n.push("slice="+encodeURIComponent(e.slice)),e.hasOwnProperty("extraQueryParameter")&&n.push(e.extraQueryParameter),e=e.correlationId||this._guid(),n.push("client-request-id="+encodeURIComponent(e))),n.join("&")},e.prototype._deserialize=function(t){for(var e=/\+/g,o=/([^&=]+)=([^&]*)/g,n=function(t){return decodeURIComponent(t.replace(e," "))},r={},i=o.exec(t);i;)r[n(i[1])]=n(i[2]),i=o.exec(t);return r},e.prototype._decimalToHex=function(t){for(var e=t.toString(16);e.length<2;)e="0"+e;return e},e.prototype._guid=function(){var t=window.crypto||window.msCrypto;if(t&&t.getRandomValues){var e=new Uint8Array(16);return t.getRandomValues(e),e[6]|=64,e[6]&=79,e[8]|=128,e[8]&=191,this._decimalToHex(e[0])+this._decimalToHex(e[1])+this._decimalToHex(e[2])+this._decimalToHex(e[3])+"-"+this._decimalToHex(e[4])+this._decimalToHex(e[5])+"-"+this._decimalToHex(e[6])+this._decimalToHex(e[7])+"-"+this._decimalToHex(e[8])+this._decimalToHex(e[9])+"-"+this._decimalToHex(e[10])+this._decimalToHex(e[11])+this._decimalToHex(e[12])+this._decimalToHex(e[13])+this._decimalToHex(e[14])+this._decimalToHex(e[15])}for(var o="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx",n="0123456789abcdef",r=0,i="",s=0;s<36;s++)"-"!==o[s]&&"4"!==o[s]&&(r=16*Math.random()|0),"x"===o[s]?i+=n[r]:"y"===o[s]?(r&=3,i+=n[r|=8]):i+=o[s];return i},e.prototype._expiresIn=function(t){return t=t||3599,this._now()+parseInt(t,10)},e.prototype._now=function(){return Math.round((new Date).getTime()/1e3)},e.prototype._addAdalFrame=function(t){if(void 0!==t){this.info("Add adal frame to document:"+t);var e,o=document.getElementById(t);return o||(document.createElement&&document.documentElement&&(window.opera||-1===window.navigator.userAgent.indexOf("MSIE 5.0"))?((e=document.createElement("iframe")).setAttribute("id",t),e.setAttribute("aria-hidden","true"),e.style.visibility="hidden",e.style.position="absolute",e.style.width=e.style.height=e.borderWidth="0px",o=document.getElementsByTagName("body")[0].appendChild(e)):document.body&&document.body.insertAdjacentHTML&&document.body.insertAdjacentHTML("beforeEnd",'<iframe name="'+t+'" id="'+t+'" style="display:none"></iframe>'),window.frames&&window.frames[t]&&(o=window.frames[t])),o}},e.prototype._saveItem=function(t,e,o){return this.config&&this.config.cacheLocation&&"localStorage"===this.config.cacheLocation?this._supportsLocalStorage()?(o?(o=this._getItem(t)||"",localStorage.setItem(t,o+e+this.CONSTANTS.CACHE_DELIMETER)):localStorage.setItem(t,e),!0):(this.info("Local storage is not supported"),!1):this._supportsSessionStorage()?(sessionStorage.setItem(t,e),!0):(this.info("Session storage is not supported"),!1)},e.prototype._getItem=function(t){return this.config&&this.config.cacheLocation&&"localStorage"===this.config.cacheLocation?this._supportsLocalStorage()?localStorage.getItem(t):(this.info("Local storage is not supported"),null):this._supportsSessionStorage()?sessionStorage.getItem(t):(this.info("Session storage is not supported"),null)},e.prototype._supportsLocalStorage=function(){try{return window.localStorage?(window.localStorage.setItem("storageTest","A"),"A"==window.localStorage.getItem("storageTest")&&(window.localStorage.removeItem("storageTest"),!window.localStorage.getItem("storageTest"))):!1}catch(t){return!1}},e.prototype._supportsSessionStorage=function(){try{return window.sessionStorage?(window.sessionStorage.setItem("storageTest","A"),"A"==window.sessionStorage.getItem("storageTest")&&(window.sessionStorage.removeItem("storageTest"),!window.sessionStorage.getItem("storageTest"))):!1}catch(t){return!1}},e.prototype._cloneConfig=function(t){if(null===t||"object"!=typeof t)return t;var e,o={};for(e in t)t.hasOwnProperty(e)&&(o[e]=t[e]);return o},e.prototype._addLibMetadata=function(){return"&x-client-SKU=Js&x-client-Ver="+this._libVersion()},e.prototype.log=function(t,e,o,n){var r;t<=Logging.level&&(!Logging.piiLoggingEnabled&&n||(r=(new Date).toUTCString(),n="",n=this.config.correlationId?r+":"+this.config.correlationId+"-"+this._libVersion()+"-"+this.CONSTANTS.LEVEL_STRING_MAP[t]+" "+e:r+":"+this._libVersion()+"-"+this.CONSTANTS.LEVEL_STRING_MAP[t]+" "+e,o&&(n+="\nstack:\n"+o.stack),Logging.log(n)))},e.prototype.error=function(t,e){this.log(this.CONSTANTS.LOGGING_LEVEL.ERROR,t,e)},e.prototype.warn=function(t){this.log(this.CONSTANTS.LOGGING_LEVEL.WARN,t,null)},e.prototype.info=function(t){this.log(this.CONSTANTS.LOGGING_LEVEL.INFO,t,null)},e.prototype.verbose=function(t){this.log(this.CONSTANTS.LOGGING_LEVEL.VERBOSE,t,null)},e.prototype.errorPii=function(t,e){this.log(this.CONSTANTS.LOGGING_LEVEL.ERROR,t,e,!0)},e.prototype.warnPii=function(t){this.log(this.CONSTANTS.LOGGING_LEVEL.WARN,t,null,!0)},e.prototype.infoPii=function(t){this.log(this.CONSTANTS.LOGGING_LEVEL.INFO,t,null,!0)},e.prototype.verbosePii=function(t){this.log(this.CONSTANTS.LOGGING_LEVEL.VERBOSE,t,null,!0)},e.prototype._libVersion=function(){return"1.0.18"},t.exports&&(t.exports=e,t.exports.inject=function(t){return new e(t)}),e)});Yu.inject;function Qu(t){this.message=t}(Qu.prototype=new Error).name="InvalidCharacterError";var Ju="undefined"!=typeof window&&window.atob&&window.atob.bind(window)||function(t){var e=String(t).replace(/=+$/,"");if(e.length%4==1)throw new Qu("'atob' failed: The string to be decoded is not correctly encoded.");for(var o,n,r=0,i=0,s="";n=e.charAt(i++);~n&&(o=r%4?64*o+n:n,r++%4)&&(s+=String.fromCharCode(255&o>>(-2*r&6))))n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(n);return s};function Xu(t){var e=t.replace(/-/g,"+").replace(/_/g,"/");switch(e.length%4){case 0:break;case 2:e+="==";break;case 3:e+="=";break;default:throw"Illegal base64url string!"}try{return decodeURIComponent(Ju(e).replace(/(.)/g,function(t,e){e=e.charCodeAt(0).toString(16).toUpperCase();return"%"+(e=e.length<2?"0"+e:e)}))}catch(t){return Ju(e)}}function $u(t){this.message=t}($u.prototype=new Error).name="InvalidTokenError";function tp(t,e){if("string"!=typeof t)throw new $u("Invalid token specified");e=!0===(e=e||{}).header?0:1;try{return JSON.parse(Xu(t.split(".")[e]))}catch(t){throw new $u("Invalid token specified: "+t.message)}}tp.InvalidTokenError=$u;var ep=(op.prototype.initialize=function(){var n=this;return this.initPromise||(this.initPromise=new Promise(function(t,e){if(n.options.authType===u.AuthenticationType.subscriptionKey)t();else if(n.options.authType===u.AuthenticationType.aad)n.options.authContext=n.options.authContext||op.getDefaultAuthContext(n.options),n.options.authContext.handleWindowCallback(),n.options.authContext.getLoginError()?e(new Error("Error logging in the AAD users: "+n.options.authContext.getLoginError())):n.options.authContext.isCallback(window.location.hash)?n.map.dispose():setTimeout(function(){return n._loginAndAcquire(t,e)});else if(n.options.authType===u.AuthenticationType.anonymous)t(n._triggerTokenFetch(!0));else if(n.options.authType===u.AuthenticationType.sas){if(n.options.sasToken){var o=-1;try{o=n._getTokenExpiry(n.options.sasToken)}catch(t){return void e(new Error("An invalid sasToken was provided."))}if(o>op.constants.tokenRefreshClockSkew)return n._storeToken(n.options.sasToken),n._setTimeoutTokenFetch(o-op.constants.tokenRefreshClockSkew),void t()}t(n._triggerTokenFetch())}else e(new Error("An invalid authentication type was specified."))})),this.initPromise},op.getDefaultAuthContext=function(t){if(!t.aadAppId)throw new Error("No AAD app ID was specified.");if(!t.aadTenant)throw new Error("No AAD tenant was specified.");return this.defaultAuthContext||(this.defaultAuthContext=new Yu({instance:t.aadInstance||r,tenant:t.aadTenant,clientId:t.aadAppId,cacheLocation:this.constants.preferredCacheLocation})),this.defaultAuthContext},op.prototype._loginAndAcquire=function(e,o){function t(){r.options.authContext.acquireToken(T,function(t){t?o(new Error(t)):(t={map:r.map,type:op.constants.events.tokenAcquired},r.map.events.invoke(op.constants.events.tokenAcquired,t),e())})}var n,r=this,i=this.options.authContext.getCachedToken(this.options.aadAppId),s=this.options.authContext.getCachedUser();i&&s?t():(this.options.authContext.loginInProgress()||this.options.authContext.login(),n=setInterval(function(){r.options.authContext.loginInProgress()||(clearInterval(n),r.options.authContext.getCachedToken(r.options.aadAppId)?t():o(new Error(r.options.authContext.getLoginError()||"The AAD authentication context is not logged-in for the specified app ID: "+r.options.aadAppId)))},25))},op.prototype.getAuthType=function(){return this.options.authType},op.prototype.getClientId=function(){return this.options.clientId},op.prototype.getToken=function(){var o=this;if(this.options.authType===u.AuthenticationType.aad){var n=this.options.authContext.getCachedToken(T);return n||(this.options.authContext.getCachedUser()||this.options.authContext.login(),this.options.authContext.acquireToken(T,function(t,e){t||(n=e,e={map:o.map,type:op.constants.events.tokenAcquired},o.map.events.invoke(op.constants.events.tokenAcquired,e))})),n}if(this.options.authType===u.AuthenticationType.anonymous||this.options.authType===u.AuthenticationType.sas){var t=this._getItem(op.constants.storage.tokenKey);if(t){var e=this._getTokenExpiry(t);if(e<300&&0<e)this._triggerTokenFetch();else if(e<=0)throw this._saveItem(op.constants.storage.tokenKey,""),new Error(op.constants.errors.tokenExpired)}else this._triggerTokenFetch();return t}if(this.options.authType===u.AuthenticationType.subscriptionKey)return this.options.subscriptionKey},op.prototype._getTokenExpiry=function(t){var e=tp(t).exp,t=this._getCurrentTime();return 0<e-t?e-t:-1},op.prototype._storeToken=function(t){this._saveItem(op.constants.storage.tokenKey,t);t={map:this.map,type:op.constants.events.tokenAcquired};this.map.events.invoke(op.constants.events.tokenAcquired,t)},op.prototype._saveItem=function(t,e){return this._supportsLocalStorage()?localStorage.setItem(t,e):this._supportsSessionStorage()?sessionStorage.setItem(t,e):this.fallbackStorage[t]=e,!0},op.prototype._getItem=function(t){return this._supportsLocalStorage()?localStorage.getItem(t):this._supportsSessionStorage()?sessionStorage.getItem(t):t in this.fallbackStorage?this.fallbackStorage[t]:null},op.prototype._supportsLocalStorage=function(){try{return window.localStorage?(window.localStorage.setItem(op.constants.storage.testStorageKey,"A"),"A"===window.localStorage.getItem(op.constants.storage.testStorageKey)&&(window.localStorage.removeItem(op.constants.storage.testStorageKey),!window.localStorage.getItem(op.constants.storage.testStorageKey))):!1}catch(t){return!1}},op.prototype._supportsSessionStorage=function(){try{return window.sessionStorage?(window.sessionStorage.setItem(op.constants.storage.testStorageKey,"A"),"A"===window.sessionStorage.getItem(op.constants.storage.testStorageKey)&&(window.sessionStorage.removeItem(op.constants.storage.testStorageKey),!window.sessionStorage.getItem(op.constants.storage.testStorageKey))):!1}catch(t){return!1}},op.prototype._getCurrentTime=function(){return Math.round((new Date).getTime()/1e3)},op.prototype.signRequest=function(t){t.headers=t.headers||{},t.headers[E]=this.sessionId,t.headers[x]=O,t.headers[b]="MapControl/"+z+" (Web)";var e=this.getToken();switch(this.options.authType){case u.AuthenticationType.aad:case u.AuthenticationType.anonymous:t.headers[S]=this.options.clientId,t.headers[i]=s+e;break;case u.AuthenticationType.sas:t.headers[i]=a+e;break;case u.AuthenticationType.subscriptionKey:t.headers["subscription-key"]=e;break;default:throw new Error("An invalid authentication type was specified")}return t},op.constants={preferredCacheLocation:"localStorage",storage:{tokenKey:"access.token.key",testStorageKey:"testStorage"},events:{tokenAcquired:"tokenacquired"},tokenExpiresIn:3599,tokenRefreshClockSkew:300,errors:{tokenExpired:"Token Expired, Try again"}},op);function op(t){var r=this;this.fallbackStorage={},this._triggerTokenFetch=function(t){return void 0===t&&(t=!1),new Promise(function(o,n){"function"==typeof r.options.getToken?r.options.getToken(function(t){try{var e=r._getTokenExpiry(t)-op.constants.tokenRefreshClockSkew;r._storeToken(t),r._setTimeoutTokenFetch(e),o()}catch(t){n(new Error("Invalid token returned by getToken function"))}},function(t){n(t)},r.map):n(new Error("Token cannot be "+(t?"fetched":"renewed")+" because getToken was not set or is not a function."))})},this._setTimeoutTokenFetch=function(t){clearTimeout(r.tokenTimeOutHandle),r.tokenTimeOutHandle=setTimeout(r._triggerTokenFetch,Math.min(1e3*t,2147483647))};var e=t.getServiceOptions();this.options=e.authOptions,this.sessionId=e.sessionId,this.map=t}var np=window&&window.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,o=e&&t[e],n=0;if(o)return o.call(t);if(t&&"number"==typeof t.length)return{next:function(){return{value:(t=t&&n>=t.length?void 0:t)&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},rp=(ip.prototype.add=function(t,e){var o,n;if(Array.isArray(t))try{for(var r=np(t),i=r.next();!i.done;i=r.next()){var s=i.value;this._add(s,e)}}catch(t){o={error:t}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}else this._add(t,e)},ip.prototype.getControls=function(){return Array.from(this.controls)},ip.prototype.remove=function(t){var e,o;if(Array.isArray(t))try{for(var n=np(t),r=n.next();!r.done;r=n.next()){var i=r.value;this._remove(i)}}catch(t){e={error:t}}finally{try{r&&!r.done&&(o=n.return)&&o.call(n)}finally{if(e)throw e.error}}else this._remove(t)},ip.prototype._add=function(t,e){this.controls.add(t);var o=(new K).merge(e),t=t.onAdd(this.map,e),e=this.controlContainer.getElementsByClassName(o.position);if(!(0<e.length))throw new Error("Control position "+o.position+" does not exist.");e.item(0).appendChild(t)},ip.prototype._remove=function(t){t.onRemove(),this.controls.delete(t)},ip);function ip(t){for(var e in this.map=t,this.controlContainer=document.createElement("div"),this.controlContainer.classList.add("atlas-control-container"),u.ControlPosition){var o;u.ControlPosition.hasOwnProperty(e)&&((o=document.createElement("div")).classList.add(u.ControlPosition[e]),o.classList.add("subcontrol-container"),this.controlContainer.appendChild(o))}this.map.getMapContainer().appendChild(this.controlContainer),this.controls=new Set}var sp=window&&window.__assign||function(){return(sp=Object.assign||function(t){for(var e,o=1,n=arguments.length;o<n;o++)for(var r in e=arguments[o])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},ap=(lp.prototype.addCallback=function(s,a,l,t,c){var e,u,p=this;if(t)e=function(t){var e=t.lngLat?new yi(t.lngLat.lng,t.lngLat.lat):void 0,o=t.point?[t.point.x,t.point.y]:void 0,n=t.features?t.features.map(function(t){return new nr(t.geometry,t.properties,t.id)}):[],n={type:t.type,originalEvent:t.originalEvent,position:e,coordinate:o,features:n};l(n)};else switch(s){case"data":case"sourcedata":case"styledata":e=function(t){t=sp(sp({dataType:t.dataType},"source"===t.dataType&&sp(sp(sp({isSourceLoaded:t.isSourceLoaded},t.sourceDataType&&{sourceDataType:t.sourceDataType}),{source:p.map.sources.getById(t.sourceId)}),t.tile&&{tile:{id:{x:t.tile.tileID.canonical.x,y:t.tile.tileID.canonical.y,z:t.tile.tileID.canonical.z},size:t.tile.tileSize,state:t.tile.state}})),{map:p.map,type:t.type});c&&p.map.events._removeListener(s,a,l),l(t)};break;case"error":e=function(t){t={error:t.error,map:p.map,type:t.type};c&&p.map.events._removeListener(s,a,l),l(t)};break;case"touchstart":case"touchend":case"touchmove":case"touchcancel":e=function(t){if(t.originalEvent){if(t.originalEvent===u)return;u=t.originalEvent}var e=t.point?new ar(t.point.x,t.point.y):void 0,o=t.points?t.points.map(function(t){return new ar(t.x,t.y)}):[],n=t.lngLat?new yi(t.lngLat.lng,t.lngLat.lat):void 0,r=t.lngLats?t.lngLats.map(function(t){return new yi(t.lng,t.lat)}):[],i=n?p.map.layers.getRenderedShapes(new cr(n),a?[a]:void 0):[],i={map:p.map,originalEvent:t.originalEvent,pixel:e,pixels:o,position:n,positions:r,shapes:i,layerId:a||void 0,preventDefault:function(){return t.preventDefault()},type:t.type};c&&p.map.events._removeListener(s,a,l),l(i)};break;case"mousedown":case"mouseup":case"mouseover":case"mousemove":case"click":case"dblclick":case"mouseout":case"mouseenter":case"mouseleave":case"contextmenu":e=function(t){if(t.originalEvent){if(t.originalEvent===u)return;u=t.originalEvent}var e=t.lngLat?new yi(t.lngLat.lng,t.lngLat.lat):void 0,o=t.point?new ar(t.point.x,t.point.y):void 0,n=e?p.map.layers.getRenderedShapes(new cr(e),a?[a]:void 0):[],n={map:p.map,originalEvent:t.originalEvent,position:e,pixel:o,preventDefault:function(){return t.preventDefault()},shapes:n,layerId:a||void 0,type:t.type};c&&p.map.events._removeListener(s,a,l),l(n)};break;case"styleimagemissing":e=function(t){c&&p.map.events._removeListener(s,a,l),l(t.id)};break;case"wheel":e=function(t){if(t.originalEvent){if(t.originalEvent===u)return;u=t.originalEvent}var e={map:p.map,originalEvent:t.originalEvent,preventDefault:function(){return t.preventDefault()},type:t.type};c&&p.map.events._removeListener(s,a,l),l(e)};break;case"resize":e=function(t){var e,o={map:p.map,type:t.type};for(e in t)"type"!==e&&"target"!==e&&(o[e]=t[e]);c&&p.map.events._removeListener(s,a,l),l(o)};break;default:e=function(t){var e={map:p.map,type:t.type};t.originalEvent&&(e.originalEvent=t.originalEvent),c&&p.map.events._removeListener(s,a,l),l(e)}}this.callbacks.has(a)||this.callbacks.set(a,new Q),this.callbacks.get(a).has(s)||this.callbacks.get(a).set(s,new Map),this.callbacks.get(a).get(s).set(l,[e,c])},lp.prototype.removeCallback=function(t,e,o){this.callbacks.has(e)&&this.callbacks.get(e).has(t)&&this.callbacks.get(e).get(t).has(o)&&this.callbacks.get(e).get(t).delete(o)},lp.prototype.getModifiedCallback=function(t,e,o){if(this.callbacks.has(e)&&this.callbacks.get(e).has(t)&&this.callbacks.get(e).get(t).has(o))return this.callbacks.get(e).get(t).get(o)[0]},lp.prototype.getLayerCallbacks=function(t){if(this.callbacks.has(t))return this.callbacks.get(t)},lp.prototype.getEventCallbacks=function(t,e){if(this.callbacks.has(e)){e=this.callbacks.get(e);if(e.has(t))return e.get(t)}},lp);function lp(t){this.callbacks=new Q,this.map=t}var cp=window&&window.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,o=e&&t[e],n=0;if(o)return o.call(t);if(t&&"number"==typeof t.length)return{next:function(){return{value:(t=t&&n>=t.length?void 0:t)&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},up=window&&window.__read||function(t,e){var o="function"==typeof Symbol&&t[Symbol.iterator];if(!o)return t;var n,r,i=o.call(t),s=[];try{for(;(void 0===e||0<e--)&&!(n=i.next()).done;)s.push(n.value)}catch(t){r={error:t}}finally{try{n&&!n.done&&(o=i.return)&&o.call(i)}finally{if(r)throw r.error}}return s},pp=["maxzoomchanged","minzoomchanged","mapconfigurationchanged"],hp=(dp.prototype.add=function(t,e,o){var n,r;if("function"==typeof e)this._addGlobalListener(t,e,!1,!1);else{e=Array.isArray(e)?e:[e];try{for(var i=cp(e),s=i.next();!s.done;s=i.next()){var a=s.value;a instanceof Ss&&Ss._isMBoxEvent(t)?this._addLayerListener(t,a,o,!1,!1):a._addEventListener(t,o,!1)}}catch(t){n={error:t}}finally{try{s&&!s.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}}},dp.prototype.addOnce=function(t,e,o){"function"==typeof e?this._addGlobalListener(t,e,!1,!0):e instanceof Ss&&Ss._isMBoxEvent(t)?this._addLayerListener(t,e,o,!1,!0):e._addEventListener(t,o,!0)},dp.prototype._addLegacy=function(t,e,o){"function"==typeof e?this._addGlobalListener(t,e,!0,!1):this._addLayerListener(t,e,o,!0,!1)},dp.prototype._addLayerListener=function(t,e,o,n,r){var i,s,a,l,c=e instanceof Ss?e.getId():e,e=this.map.layers.getLayerById(c),u=this.mapCallbackHandler.getModifiedCallback(t,c,o);if(u&&e)try{for(var p=cp(e._getLayerIds()),h=p.next();!h.done;h=p.next()){var d=h.value;this.map._getMap().off(t,d,u)}}catch(t){i={error:t}}finally{try{h&&!h.done&&(s=p.return)&&s.call(p)}finally{if(i)throw i.error}}if(this.mapCallbackHandler.addCallback(t,c,o,n,r),e){u=this.mapCallbackHandler.getModifiedCallback(t,c,o);try{for(var f=cp(e._getLayerIds()),y=f.next();!y.done;y=f.next()){d=y.value;this.map._getMap().on(t,d,u)}}catch(t){a={error:t}}finally{try{y&&!y.done&&(l=f.return)&&l.call(f)}finally{if(a)throw a.error}}}},dp.prototype._addGlobalListener=function(t,e,o,n){var r,i,s,a;pp.includes(t)?this.map._addEventListener(t,e,n):(r=this.mapCallbackHandler.getModifiedCallback(t,"",e),this.mapCallbackHandler.addCallback(t,"",e,o,n),i=this.mapCallbackHandler.getModifiedCallback(t,"",e),"load"===t&&this.map._isLoaded()?(s={type:"load",map:this.map},setTimeout(function(){return i(s)})):"ready"===t?this.map._isReady()&&(a={type:"ready",map:this.map},setTimeout(function(){return i(a)})):(r&&this.map._getMap().off(t,r),this.map._getMap().on(t,i)))},dp.prototype.invoke=function(t,e,o){if(void 0===o)this._invokeListeners(t,"",e);else if(e instanceof Ss&&Ss._isMBoxEvent(t))this._invokeListeners(t,e.getId(),o);else{if(!(e instanceof J))throw new Error("The invoke target is invalid.");e._invokeEvent(t,o)}},dp.prototype._invokeListeners=function(o,n,r){var i=this,t=new Q(this.mapCallbackHandler.getEventCallbacks(o,n));t?t.forEach(function(t,e){t=up(t,2),t[0];t[1]&&i._removeListener(o,n,e),e(r)}):"error"===o&&console.error("error"in r?r.error:r)},dp.prototype.remove=function(t,e,o){var n,r;if("function"==typeof e)this._removeListener(t,"",e);else{e=Array.isArray(e)?e:[e];try{for(var i=cp(e),s=i.next();!s.done;s=i.next()){var a=s.value;a instanceof Ss&&Ss._isMBoxEvent(t)?this._removeListener(t,a,o):a._removeEventListener(t,o)}}catch(t){n={error:t}}finally{try{s&&!s.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}}},dp.prototype._removeLegacy=function(t,e,o){"function"==typeof e?this._removeListener(t,"",e):this._removeListener(t,e,o)},dp.prototype._removeListener=function(t,e,o){var n,r;if(pp.includes(t))this.map._removeEventListener(t,o);else{var i=e instanceof Ss?e.getId():e,s=this.mapCallbackHandler.getModifiedCallback(t,i,o);if(s)if(i){e=this.map.layers.getLayerById(i);if(e)try{for(var a=cp(e._getLayerIds()),l=a.next();!l.done;l=a.next()){var c=l.value;this.map._getMap().off(t,c,s)}}catch(t){n={error:t}}finally{try{l&&!l.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}}else this.map._getMap().off(t,s);this.mapCallbackHandler.removeCallback(t,i,o)}},dp.prototype._enableLayerEvents=function(l){var c=this,t=this.mapCallbackHandler.getLayerCallbacks(l.getId());t&&t.forEach(function(t,a){t.forEach(function(t){var e,o,n=up(t,1)[0];try{for(var r=cp(l._getLayerIds()),i=r.next();!i.done;i=r.next()){var s=i.value;c.map._getMap().on(a,s,n)}}catch(t){e={error:t}}finally{try{i&&!i.done&&(o=r.return)&&o.call(r)}finally{if(e)throw e.error}}})})},dp.prototype._disableLayerEvents=function(l){var c=this,t=this.mapCallbackHandler.getLayerCallbacks(l.getId());t&&t.forEach(function(t,a){t.forEach(function(t){var e,o,n=up(t,1)[0];try{for(var r=cp(l._getLayerIds()),i=r.next();!i.done;i=r.next()){var s=i.value;c.map._getMap().off(a,s,n)}}catch(t){e={error:t}}finally{try{i&&!i.done&&(o=r.return)&&o.call(r)}finally{if(e)throw e.error}}})})},dp);function dp(t){this.map=t,this.mapCallbackHandler=new ap(this.map)}var fp=window&&window.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,o=e&&t[e],n=0;if(o)return o.call(t);if(t&&"number"==typeof t.length)return{next:function(){return{value:(t=t&&n>=t.length?void 0:t)&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},yp=(mp.prototype.add=function(t,e){var o,n;if(Array.isArray(t))try{for(var r=fp(t),i=r.next();!i.done;i=r.next()){var s=i.value;this._addMarker(s,e)}}catch(t){o={error:t}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}else this._addMarker(t,e)},mp.prototype._addMarker=function(t,e){t._addToMap(this.map,e),this.markers.add(t)},mp.prototype.getMarkers=function(){return Array.from(this.markers)},mp.prototype.remove=function(t){var e,o;if(Array.isArray(t))try{for(var n=fp(t),r=n.next();!r.done;r=n.next()){var i=r.value;this._removeMarker(i)}}catch(t){e={error:t}}finally{try{r&&!r.done&&(o=n.return)&&o.call(n)}finally{if(e)throw e.error}}else this._removeMarker(t)},mp.prototype._removeMarker=function(e){var o=this;e instanceof kl?(e._removeFromMap(),this.markers.delete(e)):this.markers.forEach(function(t){t._getId()===e&&(t._removeFromMap(),o.markers.delete(t))})},mp.prototype.clear=function(){var e=this;this.markers.forEach(function(t){t._removeFromMap(),e.markers.delete(t)})},mp);function mp(t){this.markers=new Set,this.map=t}var gp=(vp.prototype.add=function(s,e,a){var l=this;return new Promise(function(o,n){var r,t,i;l.userImages.has(s)?o():e instanceof HTMLImageElement||e instanceof ImageData?(l.map._getMap().addImage(s,e,a),l.userImages.set(s,{image:e,meta:a}),o()):"string"==typeof e&&(t=void 0,t=/<svg/i.test(e)&&!/^data:/i.test(e)?"data:image/svg+xml;base64,"+window.btoa(e):e,i=!1,l.map._sendRequest(t,"Image").then(function(t){return i?void 0:t.blob()}).then(function(t){var e;!i&&t&&(clearTimeout(r),(e=new Image).onload=function(){l.map._getMap().addImage(s,e,a),l.userImages.set(s,{image:e,meta:a}),o()},e.onerror=e.onabort=function(){n("Failed to load image into HTML element.")},e.src=URL.createObjectURL(t))}).catch(function(){i||(clearTimeout(r),n("Failed to load image into HTML element."))}),r=setTimeout(function(){i=!0,n("Failed to load image within specified timeout: "+l.imageLoadTimeout+" ms.")},l.imageLoadTimeout))})},vp.prototype.clear=function(){var o=this;this.userImages.forEach(function(t,e){o.map._getMap().removeImage(e)}),this.userImages.clear()},vp.prototype.getImageIds=function(){var o=[];return this.userImages.forEach(function(t,e){o.push(e)}),o},vp.prototype.createFromTemplate=function(t,e,o,n,r){o=o||"#1A73AA",n=n||"#fff";r=(r=Lc(e,r)).replace(/{color}/g,o).replace(/{secondaryColor}/g,n).replace(/{text}/g,"");return this.add(t,r)},vp.prototype.hasImage=function(t){return this.userImages.has(t)},vp.prototype.remove=function(t){this.map._getMap().removeImage(t),this.userImages.delete(t)},vp.prototype._restoreImages=function(){var o=this;this.userImages.forEach(function(t,e){o.map._getMap().hasImage(e)||o.map._getMap().addImage(e,t.image,t.meta)})},vp);function vp(t){this.userImages=new Q,this.imageLoadTimeout=5e3,this.map=t}var _p,wp,w=window&&window.__extends||(_p=function(t,e){return(_p=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}_p(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),bp=window&&window.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,o=e&&t[e],n=0;if(o)return o.call(t);if(t&&"number"==typeof t.length)return{next:function(){return{value:(t=t&&n>=t.length?void 0:t)&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Sp=(w(xp,wp=Ss),xp.prototype._buildLayers=function(){return this.layers},xp.prototype._getLayerIds=function(){return this.layers.map(function(t){return t.id})},xp.prototype._getSourceIds=function(){var e,t,o=new Set;try{for(var n=bp(this.layers),r=n.next();!r.done;r=n.next()){var i=r.value;"string"==typeof i.source?o.add(i.source):i.source&&o.add(i.id)}}catch(t){e={error:t}}finally{try{r&&!r.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}return o},xp.prototype._updateLayoutProperty=function(e,o,n,r){var i=this;this.layers.forEach(function(t){tr(o,n)||i.map._getMap().setLayoutProperty(t.id,e,r||o)})},xp);function xp(t,e){e=wp.call(this,e)||this;return e.layers=t,e}var Op=window&&window.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,o=e&&t[e],n=0;if(o)return o.call(t);if(t&&"number"==typeof t.length)return{next:function(){return{value:(t=t&&n>=t.length?void 0:t)&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Tp=window&&window.__read||function(t,e){var o="function"==typeof Symbol&&t[Symbol.iterator];if(!o)return t;var n,r,i=o.call(t),s=[];try{for(;(void 0===e||0<e--)&&!(n=i.next()).done;)s.push(n.value)}catch(t){r={error:t}}finally{try{n&&!n.done&&(o=i.return)&&o.call(i)}finally{if(r)throw r.error}}return s},Ep=window&&window.__spreadArray||function(t,e){for(var o=0,n=e.length,r=t.length;o<n;o++,r++)t[r]=e[o];return t},Cp=(Pp.prototype.add=function(t,e){var o,n,r=e instanceof Ss?e.getId():e;if(Array.isArray(t))try{for(var i=Op(t),s=i.next();!s.done;s=i.next()){var a=s.value;this._addLayer(a,r)}}catch(t){o={error:t}}finally{try{s&&!s.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}else this._addLayer(t,r)},Pp.prototype._addLayer=function(e,o){if(!(this.map._isReady()||e instanceof Sp))throw new Error("The layer '"+e.getId()+"' could not be added to the map because the map is not ready. Please use a ready event listener to guarantee the map is ready before adding a layer to it.");var t,n,r,i;o!==e.getId()&&this.layerIndex.find(function(t){return o===t.getId()})?this._getMapboxLayerExists(e)?(n=this.layerIndex.findIndex(function(t){return t.getId()===e.getId()}),r=this.userLayers.findIndex(function(t){return t.layer.getId()===e.getId()}),i=this.layerIndex[n],this._removeMapboxLayers(e),this._addMapboxLayers(e,o),this.map.events._disableLayerEvents(i),this.map.events._enableLayerEvents(e),this.layerIndex.splice(n,1),t=this.layerIndex.findIndex(function(t){return t.getId()===o}),this.layerIndex.splice(t,0,e),e instanceof Sp||(this.userLayers[r]={layer:e,before:o}),i.onRemove()):(this._addMapboxLayers(e,o),this.map.events._enableLayerEvents(e),t=this.layerIndex.findIndex(function(t){return t.getId()===o}),this.layerIndex.splice(t,0,e),e instanceof Sp||this.userLayers.push({layer:e,before:o})):(n=this.layerIndex.findIndex(function(t){return t.getId()===e.getId()}),r=this.userLayers.findIndex(function(t){return t.layer.getId()===e.getId()}),0<=n&&0<=r?(i=this.layerIndex[n],this._removeMapboxLayers(i),this._addMapboxLayers(e,n+1),this.map.events._disableLayerEvents(i),this.map.events._enableLayerEvents(e),(this.layerIndex[n]=e)instanceof Sp||(this.userLayers[r]={layer:e,before:void 0}),i.onRemove()):(this._addMapboxLayers(e),this.map.events._enableLayerEvents(e),this.layerIndex.push(e),e instanceof Sp||this.userLayers.push({layer:e,before:o}))),e.onAdd(this.map)},Pp.prototype._addMapboxLayers=function(t,e){var o,n;if(!(t instanceof el)||t.getOptions().tileUrl)if(t instanceof Sp)this.map.events._enableLayerEvents(t);else{t instanceof Js&&this.map._getMap().addSource(t._getSourceId(),t._buildSource());var r=this._getMapboxBefore(e);try{for(var i=Op(t._buildLayers()),s=i.next();!s.done;s=i.next()){var a=s.value;this.map._getMap().addLayer(a,r)}}catch(t){o={error:t}}finally{try{s&&!s.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}this.map.events._enableLayerEvents(t)}},Pp.prototype._removeMapboxLayers=function(t,e){var o,n;if(t instanceof Sp&&!e)this.map.events._disableLayerEvents(t);else{try{for(var r=Op(t._getLayerIds()),i=r.next();!i.done;i=r.next()){var s=i.value;this.map._getMap().getLayer(s)&&this.map._getMap().removeLayer(s)}}catch(t){o={error:t}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}this.map.events._disableLayerEvents(t),t instanceof Js&&this.map._getMap().getSource(t._getSourceId())&&this.map._getMap().removeSource(t._getSourceId())}},Pp.prototype._getMapboxLayerExists=function(e){var o=this,n=!1;return"string"==typeof e?!!(e=this.layerIndex.find(function(t){return t.getId()===e})):(e._getLayerIds().forEach(function(t){o.map._getMap().getLayer(t)&&(n=!0)}),n)},Pp.prototype._getMapboxBefore=function(e){var o,t,n,r;if("string"==typeof e){var i=this.layerIndex.find(function(t){return t.getId()===e});if(!i)return;try{for(var s=Op(i._getLayerIds()),a=s.next();!a.done;a=s.next()){var l=a.value;if(this.map._getMap().getLayer(l))return l}}catch(t){o={error:t}}finally{try{a&&!a.done&&(t=s.return)&&t.call(s)}finally{if(o)throw o.error}}e=this.layerIndex.findIndex(function(t){return t.getId()===e})+1}for(var c=e;c<this.layerIndex.length;c++)try{for(var u=(n=void 0,Op(this.layerIndex[c]._getLayerIds())),p=u.next();!p.done;p=u.next()){l=p.value;if(this.map._getMap().getLayer(l))return l}}catch(t){n={error:t}}finally{try{p&&!p.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}},Pp.prototype.clear=function(){for(var t=this.layerIndex.length-1;0<=t;t--){var e=this.layerIndex[t];this._removeMapboxLayers(e,!0),this.layerIndex.splice(t,1),e.onRemove()}this.userLayers=[]},Pp.prototype.getLayerById=function(e){var t=this.layerIndex.find(function(t){return t.getId()===e});if(t)return t},Pp.prototype.getLayers=function(){return this.layerIndex.slice(0)},Pp.prototype._getSourceIds=function(){var e,t,o=new Set;try{for(var n=Op(this.layerIndex),r=n.next();!r.done;r=n.next())r.value._getSourceIds().forEach(function(t){return o.add(t)})}catch(t){e={error:t}}finally{try{r&&!r.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}return o},Pp.prototype._getUserLayers=function(){return Array.from(this.userLayers)},Pp.prototype.move=function(t,e){var o=t instanceof Ss?t.getId():t,n=e instanceof Ss?e.getId():e;if(!this.layerIndex.find(function(t){return t.getId()===o}))throw new Error("The layer '"+o+"' has not been added to the map and cannot be moved.");e=this.layerIndex.findIndex(function(t){return t.getId()===o});this._moveMapboxLayers(this.layerIndex[e],n),t=this.layerIndex[e],this.layerIndex.splice(e,1);e=this.layerIndex.findIndex(function(t){return t.getId()===n});-1<e?this.layerIndex.splice(e,0,t):this.layerIndex.push(t);t=this.userLayers.find(function(t){return t.layer.getId()===o});t&&(t.before=n)},Pp.prototype._moveMapboxLayers=function(t,e){var o,n,r=this._getMapboxBefore(e);try{for(var i=Op(t._getLayerIds()),s=i.next();!s.done;s=i.next()){var a=s.value;this.map._getMap().moveLayer(a,r)}}catch(t){o={error:t}}finally{try{s&&!s.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}},Pp.prototype.getRenderedShapes=function(t,e,o){var n,r,i,s=this;if(t=t||[-180,-85.0511,180,85.0511],Array.isArray(t)?4===t.length||6===t.length?i=this.map.positionsToPixels([Ci.getSouthWest(t),Ci.getNorthEast(t)]):2!==t.length&&3!==t.length||(i=this.map.positionsToPixels([t])[0]):i=this.map.positionsToPixels([t.coordinates])[0],e){e=Array.isArray(e)?e:[e];var a=[],l=this;try{for(var c=Op(e),u=c.next();!u.done;u=c.next())!function(t){var e=t instanceof Ss?t.getId():t,t=l.layerIndex.findIndex(function(t){return t.getId()===e});if(!(-1<t))throw new Error("The layer '"+e+"' has not been added to the map and its rendered features cannot be retrieved.");a.push.apply(a,Ep([],Tp(l.layerIndex[t]._getLayerIds().filter(function(t){return!!s.map._getMap().getLayer(t)}))))}(u.value)}catch(t){n={error:t}}finally{try{u&&!u.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}}o=this.map._getMap().queryRenderedFeatures(i,{layers:a,filter:o});return this.map.sources._mapFeaturesToShapes(o)},Pp.prototype.remove=function(t){var e,o;if(Array.isArray(t))try{for(var n=Op(t),r=n.next();!r.done;r=n.next()){var i=r.value;this._removeLayer(i)}}catch(t){e={error:t}}finally{try{r&&!r.done&&(o=n.return)&&o.call(n)}finally{if(e)throw e.error}}else this._removeLayer(t)},Pp.prototype._removeLayer=function(t){var e=t instanceof Ss?t.getId():t,o=this.layerIndex.findIndex(function(t){return t.getId()===e});if(-1==o)throw new Error("The layer '"+e+"' has not been added to the map and cannot be removed.");t=this.layerIndex[o];this._removeMapboxLayers(t),this.layerIndex.splice(o,1);o=this.userLayers.findIndex(function(t){return t.layer.getId()===e});-1!=o&&this.userLayers.splice(o,1),t.onRemove()},Pp);function Pp(t){this.layerIndex=[],this.userLayers=[],this.map=t}var kp=window&&window.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,o=e&&t[e],n=0;if(o)return o.call(t);if(t&&"number"==typeof t.length)return{next:function(){return{value:(t=t&&n>=t.length?void 0:t)&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Ap=(Lp.prototype.add=function(t){var e,o;t=Array.isArray(t)?t:[t];try{for(var n=kp(t),r=n.next();!r.done;r=n.next()){var i=r.value;this.popups.has(i)||(this.popups.add(i),i.attach(this.map))}}catch(t){e={error:t}}finally{try{r&&!r.done&&(o=n.return)&&o.call(n)}finally{if(e)throw e.error}}},Lp.prototype.clear=function(){var e=this;this.popups.forEach(function(t){e.popups.delete(t),t.remove()})},Lp.prototype.remove=function(t){var e,o;t=Array.isArray(t)?t:[t];try{for(var n=kp(t),r=n.next();!r.done;r=n.next()){var i=r.value;this.popups.has(i)&&(this.popups.delete(i),i.remove())}}catch(t){e={error:t}}finally{try{r&&!r.done&&(o=n.return)&&o.call(n)}finally{if(e)throw e.error}}},Lp.prototype.getPopups=function(){return Array.from(this.popups)},Lp.prototype._getCollectionDiv=function(){var t=this.map.getMapContainer().querySelector("."+Lp.Css.collection);return t||((t=document.createElement("div")).classList.add(Lp.Css.collection),t.setAttribute("aria-label","Map Information"),this.map.getMapContainer().appendChild(t)),t},Lp.prototype._addDraggedPopup=function(t){0===this.draggedPopups.size&&(this.map.getMapContainer().addEventListener("mousemove",this._onDrag),this.map.getMapContainer().addEventListener("touchmove",this._onDrag),this.map.getMapContainer().addEventListener("mouseup",this._onUp),this.map.getMapContainer().addEventListener("touchend",this._onUp)),this.draggedPopups.add(t)},Lp.Css={collection:"popup-collection-container"},Lp);function Lp(t){var n=this;this._onDrag=function(t){var e,o;"mousemove"===t.type?(e=t.clientX,o=t.clientY):"touchmove"===t.type&&(e=t.touches[0].clientX,o=t.touches[0].clientY),n.draggedPopups.forEach(function(t){t._dragToPixel([e,o])})},this._onUp=function(){n.map.getMapContainer().removeEventListener("mousemove",n._onDrag),n.map.getMapContainer().removeEventListener("touchmove",n._onDrag),n.map.getMapContainer().removeEventListener("mouseup",n._onUp),n.map.getMapContainer().removeEventListener("touchend",n._onUp),n.draggedPopups.forEach(function(t){n.draggedPopups.delete(t),t._onUp()})},this.map=t,this.popups=new Set,this.draggedPopups=new Set}var Ip,Rp,w=window&&window.__extends||(Ip=function(t,e){return(Ip=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}Ip(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),Np=window&&window.__assign||function(){return(Np=Object.assign||function(t){for(var e,o=1,n=arguments.length;o<n;o++)for(var r in e=arguments[o])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},Mp=(w(jp,Rp=is),jp.prototype._buildSource=function(){return this.source},jp.prototype._modifySource=function(t,e){if(t.tiles){var o=t.tiles.map(function(t){return"string"==typeof t?t:new j({domain:c,path:t.path,queryParams:Np(Np({},e),t.queryParams)}).toString()});t.tiles=o}else{if(!t.url)throw new Error("Source definition must define a TileJSON 'url' or a 'tiles' array.");t.url="string"==typeof t.url?t.url:new j({domain:c,path:t.url.path,queryParams:Np(Np({},e),t.url.queryParams)}).toString()}return t},jp);function jp(t,e,o){t=Rp.call(this,t)||this;return t.source=t._modifySource(e,o),t}var Dp=window&&window.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,o=e&&t[e],n=0;if(o)return o.call(t);if(t&&"number"==typeof t.length)return{next:function(){return{value:(t=t&&n>=t.length?void 0:t)&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},zp=(Bp.prototype.add=function(t,e){var o,n;if(void 0===e&&(e=!0),Array.isArray(t))try{for(var r=Dp(t),i=r.next();!i.done;i=r.next()){var s=i.value;this._addSource(s,e)}}catch(t){o={error:t}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}else this._addSource(t,e)},Bp.prototype.getRenderedShapes=function(t,e,o){t="string"==typeof t?t:t.getId(),e=this.map._getMap().querySourceFeatures(t,{sourceLayer:o,filter:e});return this.map.sources._mapFeaturesToShapes(e,!0,this.sources.get(t))},Bp.prototype._buildSources=function(){var e={};return this.sources.forEach(function(t){e[t.getId()]=t._buildSource()}),e},Bp.prototype.clear=function(){var e=this;this.sources.forEach(function(t){e.remove(t)})},Bp.prototype.getById=function(t){return this.sources.get(t)},Bp.prototype.getSources=function(){return Array.from(this.sources.values())},Bp.prototype.isSourceLoaded=function(t){t=t instanceof is?t.getId():t;return this.map._getMap().isSourceLoaded(t)},Bp.prototype.remove=function(t,e){var o,n;if(void 0===e&&(e=!0),Array.isArray(t))try{for(var r=Dp(t),i=r.next();!i.done;i=r.next()){var s=i.value;this._removeSource(s,e)}}catch(t){o={error:t}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}else this._removeSource(t,e)},Bp.prototype._removeSource=function(t,e){t=t instanceof is?t.getId():t;if(this.sources.has(t)){if(this.map._getMap().getSource(t)&&e&&this.map._getMap().removeSource(t),this.map._getMap().getSource(t)&&e)throw new Error("One or more layers have a dependency on the source '"+t+"'");return this.sources.get(t)._setMap(null),void this.sources.delete(t)}throw new Error("'"+t+"' is not added to the map")},Bp.prototype._addSource=function(t,e){if(this.sources.has(t.getId())){if(e)throw new Error("'"+t.getId()+"' is already added to the map");this.sources.get(t.getId())._setMap(null),this.sources.delete(t.getId())}if(e){if(!this.map._isReady())throw new Error("The source '"+t.getId()+"' could not be added to the map because the map is not ready. Please use a ready event listener to guarantee the map is ready before adding a source to it.");this.map._getMap().addSource(t.getId(),t._buildSource())}this.sources.set(t.getId(),t),t._setMap(this.map)},Bp.prototype._mapFeaturesToShapes=function(t,e,o){var n,r,i=[];try{for(var s=Dp(t),a=s.next();!a.done;a=s.next()){var l=a.value;if((o||"string"==typeof l.source)&&"string"==typeof l.properties[Si._shapeIdPropName]){var c=o||this.sources.get(l.source);if(c instanceof us){var u=c.getShapeById(l.properties[Si._shapeIdPropName]);if(u instanceof Si){i.push(u);continue}}}e||i.push(l)}}catch(t){n={error:t}}finally{try{a&&!a.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return i},Bp.prototype._syncSources=function(n){var r=this;n&&(Object.keys(n).forEach(function(t){if(!r.sources.has(t)){var e=n[t];if("vector"===e.type){var o=new Mp(t,{name:t,tiles:e.tiles,type:"vector",url:e.url});r.sources.set(t,o),o._setMap(r.map)}else{if("raster"!==e.type)throw new Error("Unable to construct source with ID "+t+".");o=new Mp(t,{name:t,tiles:e.tiles,type:"raster",url:e.url});r.sources.set(t,o),o._setMap(r.map)}}}),Object.keys(this.sources).forEach(function(t){n.hasOwnProperty(t)||(r.sources.get(t)._setMap(null),r.sources.delete(t))}))},Bp);function Bp(t){this.map=t,this.sources=new Q}var Fp,Up,qp=((window&&window.__extends||(Fp=function(t,e){return(Fp=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}Fp(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(Gp,Up=P),Gp);function Gp(){var t=null!==Up&&Up.apply(this,arguments)||this;return t.duration=1e3,t.type="jump",t}var Zp,Hp,Kp=((window&&window.__extends||(Zp=function(t,e){return(Zp=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}Zp(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(Wp,Hp=P),Wp);function Wp(){var t=null!==Hp&&Hp.apply(this,arguments)||this;return t.bottom=0,t.left=0,t.right=0,t.top=0,t}var Vp,Yp,w=window&&window.__extends||(Vp=function(t,e){return(Vp=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}Vp(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),Qp=window&&window.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,o=e&&t[e],n=0;if(o)return o.call(t);if(t&&"number"==typeof t.length)return{next:function(){return{value:(t=t&&n>=t.length?void 0:t)&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Jp=window&&window.__read||function(t,e){var o="function"==typeof Symbol&&t[Symbol.iterator];if(!o)return t;var n,r,i=o.call(t),s=[];try{for(;(void 0===e||0<e--)&&!(n=i.next()).done;)s.push(n.value)}catch(t){r={error:t}}finally{try{n&&!n.done&&(o=i.return)&&o.call(i)}finally{if(r)throw r.error}}return s},Xp=window&&window.__spreadArray||function(t,e){for(var o=0,n=e.length,r=t.length;o<n;o++,r++)t[r]=e[o];return t},$p=(w(th,Yp=P),th.prototype.merge=function(){for(var e,t,o=[],n=0;n<arguments.length;n++)o[n]=arguments[n];try{for(var r=Qp(o),i=r.next();!i.done;i=r.next()){var s=i.value;s&&"number"==typeof s.padding&&(s.padding={top:s.padding,bottom:s.padding,left:s.padding,right:s.padding})}}catch(t){e={error:t}}finally{try{i&&!i.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}return Yp.prototype.merge.apply(this,Xp([],Jp(o)))},th);function th(){var t=null!==Yp&&Yp.apply(this,arguments)||this;return t.bounds=[-180,-89,180,90],t.maxBounds=void 0,t.maxZoom=20,t.offset=new ar(0,0),t.padding=new Kp,t}var eh,oh,nh=((window&&window.__extends||(eh=function(t,e){return(eh=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}eh(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(rh,oh=P),rh);function rh(){var t=null!==oh&&oh.apply(this,arguments)||this;return t.zoom=1,t.center=new yi(0,0),t.centerOffset=new ar(0,0),t.bearing=0,t.pitch=0,t.minZoom=1,t.maxZoom=20,t.maxBounds=void 0,t}var ih,sh,w=((window&&window.__extends||(ih=function(t,e){return(ih=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}ih(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(ah,sh=P),ah);function ah(){var t=null!==sh&&sh.apply(this,arguments)||this;return t.name=void 0,t.before=void 0,t.minZoom=1,t.maxZoom=20,t.overwrite=!1,t.opacity=1,t}var lh,ch,uh=((window&&window.__extends||(lh=function(t,e){return(lh=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}lh(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(ph,ch=w),ph);function ph(){var t=null!==ch&&ch.apply(this,arguments)||this;return t.color="rgba(0,0,0,.5)",t.outlineColor="#000",t.radius=1,t.outlineWidth=5,t.name="default-circles",t}var hh,dh,fh=((window&&window.__extends||(hh=function(t,e){return(hh=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}hh(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(yh,dh=w),yh);function yh(){var t=null!==dh&&dh.apply(this,arguments)||this;return t.cap="butt",t.join="miter",t.name="default-linestrings",t.color="#000",t.width=1,t}var mh,gh,vh=((window&&window.__extends||(mh=function(t,e){return(mh=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}mh(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(_h,gh=w),_h);function _h(){var t=null!==gh&&gh.apply(this,arguments)||this;return t.iconSize=1,t.fontSize=14,t.fontColor="#000",t.textFont="SegoeUi-Regular",t.cluster=!0,t.clusterIcon=void 0,t.textOffset=[0,0],t.name="default-pins",t.icon="pin-darkblue",t.title="",t}var wh,bh,Sh=((window&&window.__extends||(wh=function(t,e){return(wh=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}wh(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(xh,bh=w),xh);function xh(){var t=null!==bh&&bh.apply(this,arguments)||this;return t.color="rgba(0,0,0,.5)",t.outlineColor="#000",t.name="default-polygons",t}var Oh,Th,Eh=((window&&window.__extends||(Oh=function(t,e){return(Oh=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}Oh(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(Ch,Th=w),Ch);function Ch(){var t=null!==Th&&Th.apply(this,arguments)||this;return t.name="default-raster",t}var Ph,kh,Ah=((window&&window.__extends||(Ph=function(t,e){return(Ph=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}Ph(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(Lh,kh=P),Lh);function Lh(){var t=null!==kh&&kh.apply(this,arguments)||this;return t.anchor="map",t.color="#FFFFFF",t.intensity=.5,t.position=[1.15,210,30],t}var Ih,Rh,w=window&&window.__extends||(Ih=function(t,e){return(Ih=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}Ih(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),Nh=window&&window.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,o=e&&t[e],n=0;if(o)return o.call(t);if(t&&"number"==typeof t.length)return{next:function(){return{value:(t=t&&n>=t.length?void 0:t)&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Mh=window&&window.__read||function(t,e){var o="function"==typeof Symbol&&t[Symbol.iterator];if(!o)return t;var n,r,i=o.call(t),s=[];try{for(;(void 0===e||0<e--)&&!(n=i.next()).done;)s.push(n.value)}catch(t){r={error:t}}finally{try{n&&!n.done&&(o=i.return)&&o.call(i)}finally{if(r)throw r.error}}return s},jh=window&&window.__spreadArray||function(t,e){for(var o=0,n=e.length,r=t.length;o<n;o++,r++)t[r]=e[o];return t},Dh=(w(zh,Rh=P),zh.prototype.merge=function(){for(var e,t,o=[],n=0;n<arguments.length;n++)o[n]=arguments[n];try{for(var r=Nh(o),i=r.next();!i.done;i=r.next()){var s=i.value;s&&(s.hasOwnProperty("view")?s.userRegion=s.view:s.hasOwnProperty("userRegion")&&(s.view=s.userRegion),"string"==typeof s.language&&(s.language=Ml.getCode(s.language)))}}catch(t){e={error:t}}finally{try{i&&!i.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}return Rh.prototype.merge.apply(this,jh([],Mh(o)))},zh);function zh(){var t=null!==Rh&&Rh.apply(this,arguments)||this;return t.antialias=void 0,t.autoResize=!0,t.language=Kl,t.light=new Ah,t.preserveDrawingBuffer=!1,t.progressiveLoading=!1,t.progressiveLoadingInitialLayerGroups=["base"],t.renderWorldCopies=!0,t.showBuildingModels=!1,t.showFeedbackLink=!0,t.showLogo=!0,t.showLabels=!0,t.customAttribution=void 0,t.showTileBoundaries=!1,t.style=void 0,t.view=Gl,t.userRegion=t.view,t}function Bh(t){return 0==t.length?void 0:t.slice(1).reduce(function(o,n){return function(t,e){t=o(t,e);return qh(qh({},t),n(t.url,e))}},t[0])}var Fh,Uh,w=window&&window.__extends||(Fh=function(t,e){return(Fh=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}Fh(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),qh=window&&window.__assign||function(){return(qh=Object.assign||function(t){for(var e,o=1,n=arguments.length;o<n;o++)for(var r in e=arguments[o])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},Gh=window&&window.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,o=e&&t[e],n=0;if(o)return o.call(t);if(t&&"number"==typeof t.length)return{next:function(){return{value:(t=t&&n>=t.length?void 0:t)&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Zh=window&&window.__read||function(t,e){var o="function"==typeof Symbol&&t[Symbol.iterator];if(!o)return t;var n,r,i=o.call(t),s=[];try{for(;(void 0===e||0<e--)&&!(n=i.next()).done;)s.push(n.value)}catch(t){r={error:t}}finally{try{n&&!n.done&&(o=i.return)&&o.call(i)}finally{if(r)throw r.error}}return s},Hh=window&&window.__spreadArray||function(t,e){for(var o=0,n=e.length,r=t.length;o<n;o++,r++)t[r]=e[o];return t},Kh=(w(Wh,Uh=P),Wh.prototype.merge=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];try{for(var o=Gh(t),n=o.next();!n.done;n=o.next()){var r=n.value;r&&(r.authOptions?"string"==typeof r.authOptions.subscriptionKey&&(r.subscriptionKey=r["subscription-key"]=r.authOptions.subscriptionKey):"string"==typeof r.subscriptionKey?(r["subscription-key"]=r.subscriptionKey,r.authOptions={authType:u.AuthenticationType.subscriptionKey,subscriptionKey:r.subscriptionKey}):"string"==typeof r["subscription-key"]&&(r.subscriptionKey=r["subscription-key"],r.authOptions={authType:u.AuthenticationType.subscriptionKey,subscriptionKey:r["subscription-key"]}),"string"==typeof r.sessionId?r["session-id"]=r.sessionId:"string"==typeof r["session-id"]&&(r.sessionId=r["session-id"]),"boolean"==typeof r.disableTelemetry?r["disable-telemetry"]=r.disableTelemetry:"boolean"==typeof r["disable-telemetry"]&&(r.disableTelemetry=r["disable-telemetry"]),"boolean"==typeof r.enableAccessibility?r["enable-accessibility"]=r.enableAccessibility:"boolean"==typeof r["enable-accessibility"]&&(r.enableAccessibility=r["enable-accessibility"]))}}catch(t){a={error:t}}finally{try{n&&!n.done&&(s=o.return)&&s.call(o)}finally{if(a)throw a.error}}var i=this._transformers,s=t?t.filter(function(t){return void 0!==t}).reduce(function(t,e){return Hh(Hh([],Zh(t)),Zh(e._transformers||[]))},[]):[],a=Uh.prototype.merge.apply(this,Hh([],Zh(t)));return a.authOptions.authType!==u.AuthenticationType.subscriptionKey&&(a["subscription-key"]=a.subscriptionKey=void 0),void 0!==a.styleSet&&void 0===a.mapConfiguration&&(a.mapConfiguration=a.styleSet),a.mapConfiguration&&"string"!=typeof a.mapConfiguration&&(a.mapConfiguration=qh(qh({},a.mapConfiguration),{defaultConfiguration:a.mapConfiguration.defaultConfiguration||a.mapConfiguration.defaultStyle,configurations:a.mapConfiguration.configurations||a.mapConfiguration.styles})),this._transformers=Hh(Hh([],Zh(i||[])),Zh(s.filter(function(t){return!i.includes(t)}))),this.transformRequest&&!this._transformers.includes(this.transformRequest)&&this._transformers.push(this.transformRequest),this.transformRequest=Bh(this._transformers),a},Wh.prototype.addTransformer=function(t){this._transformers||(this._transformers=[]),this._transformers.push(t),this.transformRequest=Bh(this._transformers)},Wh.prototype.removeTransformer=function(e){this._transformers&&(this._transformers=this._transformers.filter(function(t){return e!==t}),this.transformRequest=Bh(this._transformers))},Wh._cloneCustomizer=function(t){if("object"==typeof t)return Object.assign({},t)},Wh);function Wh(){var t=null!==Uh&&Uh.apply(this,arguments)||this;return t.authOptions=cc(),t.disableTelemetry=!1,t["disable-telemetry"]=t.disableTelemetry,t.domain=Vl,t.staticAssetsDomain=Yl,t.styleDefinitionsPath=Ql,t.styleDefinitionsVersion=Jl,t.styleAPIVersion=Xl,t.mapConfiguration=void 0,t.styleSet=void 0,t.enableAccessibility=!0,t["enable-accessibility"]=t.enableAccessibility,t.enableAccessibilityLocationFallback=!0,t.maxParallelImageRequests=mc(),t.refreshExpiredTiles=!0,t.subscriptionKey=_c(),t["subscription-key"]=t.subscriptionKey,t.sessionId=Wl,t["session-id"]=t.sessionId,t._transformers=[],t.transformRequest=void 0,t.workerCount=yc(),t.fadeDuration=300,t.localIdeographFontFamily="sans-serif",t.validateStyle=!0,t}var Vh=(Yh.getLayerGroup=function(t){var e=t;if(null!=e&&e.metadata&&e.metadata["microsoft.maps:layerGroup"])return e.metadata["microsoft.maps:layerGroup"];t=null!==(e=null==e?void 0:e.id)&&void 0!==e?e:t;if(t.startsWith("microsoft.")){t=t.split(".");return 4<=t.length?t[3]:void 0}},Yh);function Yh(){}var Qh=(Jh.resolve=function(t){return new Jh(Promise.resolve(t))},Jh.reject=function(t){return new Jh(Promise.reject(t))},Jh.prototype.then=function(t,e){var o=this;return new Promise(function(t,e){o._resolve=t,o._reject=e,o._thenResolver(t,e)}).then(t,e)},Jh.prototype.catch=function(t){var o=this;return new Promise(function(t,e){o._resolve=t,o._reject=e,o._thenResolver(t,e)}).catch(t)},Jh.prototype.finally=function(t){var o=this;return new Promise(function(t,e){o._resolve=t,o._reject=e,o._thenResolver(t,e)}).finally(t)},Jh.prototype.hijackAndResolve=function(t){this._hijackedToResolve=t,this._resolve&&this._resolve(t)},Jh.prototype.hijackAndReject=function(t){this._hijackedToReject=t,this._reject&&this._reject(t)},Jh.prototype.switchWith=function(t){this.origin=t,this._toResolve=void 0,this._toReject=void 0},Jh);function Jh(t){var r=this;this.isHijacked=function(){return void 0!==r._hijackedToResolve||void 0!==r._hijackedToReject},this.isResolved=function(){return void 0!==r._hijackedToResolve||void 0!==r._toResolve},this.isRejected=function(){return void 0!==r._hijackedToReject||void 0!==r._toReject},this.resultIfResolved=function(){return r._hijackedToResolve||r._toResolve},this.errorIfRejected=function(){return r._hijackedToReject||r._toReject},this._thenResolver=function(e,o){var n;r._hijackedToResolve?e(r._hijackedToResolve):r._hijackedToReject?o(r._hijackedToReject):(n=r.origin,r.origin.then(function(t){r.isHijacked()||(n!==r.origin?r._thenResolver(e,o):(r._toResolve=t,e(t)))}).catch(function(t){r.isHijacked()||(n!==r.origin?r._thenResolver(e,o):(r._toReject=t,o(t)))}))},this.origin=t,this[Symbol.toStringTag]=this.origin[Symbol.toStringTag]}var Xh={road:"Road",satellite:"Satellite",satellite_road_labels:"Hybrid",grayscale_dark:"Grayscale (Dark)",grayscale_light:"Grayscale (Light)",night:"Night",road_shaded_relief:"Terra",blank:"Blank",blank_accessible:"Blank (Accessible)",high_contrast_dark:"High contrast (Dark)",high_contrast_light:"High contrast (Light)"},$h=window&&window.__assign||function(){return($h=Object.assign||function(t){for(var e,o=1,n=arguments.length;o<n;o++)for(var r in e=arguments[o])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},td=window&&window.__awaiter||function(t,s,a,l){return new(a=a||Promise)(function(o,e){function n(t){try{i(l.next(t))}catch(t){e(t)}}function r(t){try{i(l.throw(t))}catch(t){e(t)}}function i(t){var e;t.done?o(t.value):((e=t.value)instanceof a?e:new a(function(t){t(e)})).then(n,r)}i((l=l.apply(t,s||[])).next())})},ed=window&&window.__generator||function(o,n){var r,i,s,a={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},t={next:e(0),throw:e(1),return:e(2)};return"function"==typeof Symbol&&(t[Symbol.iterator]=function(){return this}),t;function e(e){return function(t){return function(e){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,i&&(s=2&e[0]?i.return:e[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,e[1])).done)return s;switch(i=0,(e=s?[2&e[0],s.value]:e)[0]){case 0:case 1:s=e;break;case 4:return a.label++,{value:e[1],done:!1};case 5:a.label++,i=e[1],e=[0];continue;case 7:e=a.ops.pop(),a.trys.pop();continue;default:if(!(s=0<(s=a.trys).length&&s[s.length-1])&&(6===e[0]||2===e[0])){a=0;continue}if(3===e[0]&&(!s||e[1]>s[0]&&e[1]<s[3])){a.label=e[1];break}if(6===e[0]&&a.label<s[1]){a.label=s[1],s=e;break}if(s&&a.label<s[2]){a.label=s[2],a.ops.push(e);break}s[2]&&a.ops.pop(),a.trys.pop();continue}e=n.call(o,a)}catch(t){e=[6,t],i=0}finally{r=s=0}if(5&e[0])throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}([e,t])}}},od=window&&window.__read||function(t,e){var o="function"==typeof Symbol&&t[Symbol.iterator];if(!o)return t;var n,r,i=o.call(t),s=[];try{for(;(void 0===e||0<e--)&&!(n=i.next()).done;)s.push(n.value)}catch(t){r={error:t}}finally{try{n&&!n.done&&(o=i.return)&&o.call(i)}finally{if(r)throw r.error}}return s},nd=window&&window.__spreadArray||function(t,e){for(var o=0,n=e.length,r=t.length;o<n;o++,r++)t[r]=e[o];return t},rd=(id.prototype.updateIndoorState=function(t,e){var o,n,r=this,i=this.map.styles.getMapConfiguration();i?(this.preservedPreindoorMapConfiguration=i,o=this.map.getStyle().style?this.map.getStyle().style+"_indoor"+("dark"===t?"_dark":"")+"_tileset_"+e:void 0,this.map.styles.setMapConfiguration("defaultIndoor_"+e,"microsoft-maps:default"===i?o:void 0)):(n=(null===(o=this.indoorState)||void 0===o?void 0:o.tilesetId)!==e,this.indoorState={tilesetId:e,theme:t},this.initStyleset(),this.definitions().then(function(t){var e=(r.map.getStyle().style||t.defaultConfiguration).replace("_indoor_dark","").replace("_indoor","")+"_indoor",t=t.configurations.find(function(t){return t.name.startsWith(e)});t&&r.map.setStyle({style:t.name},!n)}))},id.prototype.unsetIndoorState=function(){var o=this,t=this.preservedPreindoorMapConfiguration;t?this.map.styles.setMapConfiguration(t):(this.indoorState=void 0,this.initStyleset(),this.definitions().then(function(t){var e=o.map.getStyle().style;e.includes("_indoor")&&e.split("_indoor")[0]?o.map.setStyle({style:e.split("_indoor")[0]}):o.map.setStyle({style:void 0})}))},id.prototype.initStyleset=function(){var e=this,t=this.serviceOptions.mapConfiguration?"string"==typeof this.serviceOptions.mapConfiguration?new Qh(this._request(this.serviceOptions.domain,_+"/mapconfigurations/metadata/"+this.serviceOptions.mapConfiguration,"StyleDefinitions").then(function(t){return $h($h({},t),{defaultConfiguration:t.defaultConfiguration||t.defaultStyle,configurations:t.configurations||t.styles})})):Qh.resolve(this.serviceOptions.mapConfiguration):new Qh(this._request(this.serviceOptions.staticAssetsDomain,v+"/"+_,"StyleDefinitions",{version:this.serviceOptions.styleDefinitionsVersion}).then(function(t){return{version:isNaN(t.version)?0:parseFloat(t.version),defaultConfiguration:t.defaultStyle,configurations:t.styles.filter(function(t){return e.indoorState?"auto"===e.indoorState.theme?t.name.endsWith("dark"===t.theme?"_indoor_dark":"_indoor"):t.name.endsWith("dark"===e.indoorState.theme?"_indoor_dark":"_indoor"):!t.name.includes("indoor")}).map(function(t){return{copyright:t.copyright.join(" "),name:t.name,displayName:function(t){t=e.indoorState&&t.includes("_indoor")?t.split("_indoor")[0]:t;return t in Xh?Xh[t]:t}(t.name),theme:t.theme,thumbnail:new j({domain:e.serviceOptions.staticAssetsDomain,path:t.thumbnail,protocol:"https"}).toString(),url:new j({domain:e.serviceOptions.staticAssetsDomain,path:v+"/"+_+"/"+t.name,queryParams:{styleVersion:e.serviceOptions.styleDefinitionsVersion},protocol:"https"}).toString()}})}}));return this.initPromise&&this.initPromise.switchWith(t),this.initPromise=t,this.initPromise.then(function(t){return e.map._invokeEvent("mapconfigurationchanged",t)}),this.initPromise},id.prototype.getStyle=function(t){t=this._lookUp(t);if(!t)throw Error("Style definition is not available.");if(t.url)return t.url;if(t.style)return t.style;throw Error("Style definition does not contain neither URL nor style object.")},id.prototype.deriveNewStyle=function(t,e){var i=this.map.getStyle(),s=this.map.getTraffic();return $h($h({},e),{sources:Object.entries(e.sources).reduce(function(t,e){var o=od(e,2),e=o[0],o=o[1],o=$h({},o);return"url"in o&&"string"==typeof o.url&&o.url.includes(y)&&(o.url=o.url.replace(y,i.language)),t[e]=o,t},{}),layers:e.layers.map(function(t){var e,o,n=$h({},t),r=Vh.getLayerGroup(n);return r&&(i.showBuildingModels||"fill-extrusion"!==n.type?"fill-extrusion"===n.type&&(n.layout=null!==(t=n.layout)&&void 0!==t?t:{},n.layout.visibility="visible"):(n.layout=null!==(e=n.layout)&&void 0!==e?e:{},n.layout.visibility="none"),"none"!==s.flow&&r&&r==="traffic_"+s.flow&&"line"==n.type&&(n.layout=null!==(e=n.layout)&&void 0!==e?e:{},n.layout.visibility="visible"),"labels"!==r&&"labels_places"!==r&&"labels_indoor"!==r||"symbol"!==n.type||(i.showLabels&&"none"!==(null===(r=n.layout)||void 0===r?void 0:r.visibility)?(n.layout=null!==(o=n.layout)&&void 0!==o?o:{},n.layout.visibility="visible"):(n.layout=null!==(o=n.layout)&&void 0!==o?o:{},n.layout.visibility="none"))),n})})},id.prototype.injectUserLayersIntoStyle=function(s,a,l){return s?this.map.layers._getUserLayers().reduce(function(o,e){if(e.layer instanceof cl)return o;var t,n=l[e.before]&&0<l[e.before].length?l[e.before][0]:void 0,r=s.layers.find(function(t){return t.id===e.layer.getId()}),i=a.layers.findIndex(function(t){return t.id===e.layer.getId()});return-1<i&&a.layers.splice(i,1),r&&(t=new Set(Array.from(e.layer._getSourceIds()).map(function(t){return s.sources[t]?{source:s.sources[t],id:t}:void 0}).filter(function(t){return void 0!==t})),-1<(i=n?o.layers.findIndex(function(t){return t.id===n.id}):-1)?o.layers.splice(i,0,r):o.layers.push(r),t.forEach(function(t){var e=t.source,t=t.id;o.sources[t]=e})),o},$h({},a)):a},id.prototype.setStyle=function(r,t){var i=this;void 0===t&&(t=!0);try{this.map._getMap().setStyle(this.getStyle(r),{diff:t,validate:this.serviceOptions.validateStyle,transformStyle:function(t,e){var o,n=i.deriveNewStyle(t,e).layers.map(function(t){return{nextLayer:t,layerGroup:Vh.getLayerGroup(t)}}).filter(function(t){t.nextLayer;return void 0!==t.layerGroup}).reduce(function(t,e){var o=e.nextLayer,n=e.layerGroup;return $h($h({},t),((e={})[n]=n in t?nd(nd([],od(t[n])),[o]):[o],e))},{});r.progressiveLoading&&!i.map._isLoaded()&&(o=r.progressiveLoadingInitialLayerGroups,Array.isArray(o)&&0<o.length&&i._deferLayerGroupVisibilities(n,o));e=i.injectUserLayersIntoStyle(t,e,n),n=Object.entries(n).map(function(t){var e=od(t,2),t=e[0],e=e[1];return i._buildFundamentalLayerFrom(e,t)}),n=i.map.layers._getUserLayers().reduce(function(t,e){var o=e.before?t.findIndex(function(t){return t.getId()===e.before}):-1;return-1<o?t.splice(o,0,e.layer):t.push(e.layer),t},n);return i.map.layers.layerIndex=n,i.map.sources._syncSources(e.sources),i.map.events.remove("styledata",i._onStyleData),i.map.events.addOnce("styledata",i._onStyleData),e}})}catch(t){throw t}},id.prototype.getTheme=function(t){t=this._lookUp(t);if(t)return t.theme.toLowerCase()},id.prototype.getThemeAsync=function(e){return td(this,void 0,void 0,function(){return ed(this,function(t){switch(t.label){case 0:return[4,this._lookUpAsync(e)];case 1:return[2,t.sent().theme]}})})},id.prototype.setMapConfiguration=function(t,o){var n=this;"string"==typeof(this.serviceOptions.mapConfiguration=t)?this.initStyleset():this.initPromise?this.initPromise.hijackAndResolve(t):this.initPromise=Qh.resolve(t),this.definitions().then(function(t){var e=t.defaultConfiguration;t.configurations.find(function(t){return t.name===o})&&(e=o),n.map.setStyle({style:e})})},id.prototype.getMapConfiguration=function(){return this.serviceOptions.mapConfiguration},id.prototype.setStyleSet=function(t){this.updateIndoorState("indoor_dark"===t?"dark":"light",null)},id.prototype.getStyleSet=function(){return void 0!==this.indoorState?"dark"===this.indoorState.theme?"indoor_dark":"indoor":"base"},id.prototype.clearStyleSet=function(){this.unsetIndoorState()},id.prototype._buildFundamentalLayerFrom=function(t,e){if(t&&0<t.length){t=new Sp(t,e);return t.onAdd(this.map),t}throw new Error("Unable to construct fundamental map layer for ID: "+e+".")},id.prototype._transformStyleRequest=function(t,e){t.includes(c)&&(e.url=e.url.replace(c,this.serviceOptions.domain)),t.includes(m)&&(e.url=e.url.replace(m,v)),t.includes(g)&&(e.url=e.url.replace(g,_)),(e.url.toLocaleLowerCase().includes(this.serviceOptions.domain.toLocaleLowerCase())||e.url.toLocaleLowerCase().includes(this.serviceOptions.staticAssetsDomain.toLocaleLowerCase()))&&((t=new URL(e.url)).searchParams.get(l)||(t.searchParams.set(l,this.serviceOptions.styleAPIVersion),e.url=t.href),null!==(t=this.map.authentication)&&void 0!==t&&t.signRequest(e))},id.prototype._request=function(n,r,i,s){var a;return void 0===s&&(s={}),td(this,void 0,void 0,function(){var e,o;return ed(this,function(t){switch(t.label){case 0:return e={url:new j({protocol:"https",domain:n,path:r,queryParams:$h(((o={})[l]=this.serviceOptions.styleAPIVersion,o),s)}).toString()},"function"==typeof this.serviceOptions.transformRequest&&i&&(e=this.serviceOptions.transformRequest(e.url,i)),null!==(a=this.map.authentication)&&void 0!==a&&a.signRequest(e),o={method:"GET",mode:"cors"},e.credentials&&(o.credentials=e.credentials),e.headers&&(o.headers=e.headers),[4,fetch(e.url,o).then(function(t){if(t.ok)return t.json();throw new Error("HTTP "+t.status+": "+t.statusText+" ")})];case 1:return[2,t.sent()]}})})},id);function id(t,e){var s=this;this.definitions=function(){return s.initPromise||s.initStyleset()},this.indoorState=void 0,this.preservedPreindoorMapConfiguration=void 0,this._deferLayerGroupVisibilities=function(e,t){var o,r,n,i=t.filter(function(t){return t in e});0!==i.length&&(o=s.map._getMap(),r=o.getZoom(),(n=Object.entries(e).reduce(function(t,e){var o=od(e,2),e=o[0],o=o[1],n=i.includes(e);return nd(nd([],od(t)),od(o.filter(function(t){if("custom"===t.type)return!1;if(n)if("number"==typeof t.maxzoom&&"number"==typeof t.minzoom){if(r<=t.maxzoom&&r>=t.minzoom)return!1}else if("number"==typeof t.minzoom){if(r>=t.minzoom)return!1}else{if("number"!=typeof t.maxzoom)return!1;if(r<=t.maxzoom)return!1}return"none"!==(null===(t=t.layout)||void 0===t?void 0:t.visibility)})))},[])).forEach(function(t){t.layout=t.layout||{},t.layout.visibility="none"}),s.map.events.addOnce("load",function(){n.forEach(function(t){t.layout.visibility="visible",o.setLayoutProperty(t.id,"visibility","visible")})}))},this._onStyleData=function(){s._lookUpAsync(s.map.getStyle()).then(function(t){s.map.events.invoke("stylechanged",{style:t.name,map:s.map,type:"stylechanged"})})},this._lookUp=function(e){var t=s.definitions().errorIfRejected(),o=s.definitions().resultIfResolved();return t||void 0===o?null:o.configurations.find(function(t){return t.name===(e.style||o.defaultConfiguration)})||o.configurations.find(function(t){return t.name===o.defaultConfiguration})||o.configurations[0]},this._lookUpAsync=function(o){return td(s,void 0,void 0,function(){var e;return ed(this,function(t){switch(t.label){case 0:return[4,this.definitions()];case 1:return e=t.sent(),[2,e.configurations.find(function(t){return t.name===(o.style||e.defaultConfiguration)})||e.configurations.find(function(t){return t.name===e.defaultConfiguration})||e.configurations[0]]}})})},this.map=t,this.serviceOptions=e}var sd,ad,w=window&&window.__extends||(sd=function(t,e){return(sd=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}sd(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),ld=window&&window.__assign||function(){return(ld=Object.assign||function(t){for(var e,o=1,n=arguments.length;o<n;o++)for(var r in e=arguments[o])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},cd=window&&window.__awaiter||function(t,s,a,l){return new(a=a||Promise)(function(o,e){function n(t){try{i(l.next(t))}catch(t){e(t)}}function r(t){try{i(l.throw(t))}catch(t){e(t)}}function i(t){var e;t.done?o(t.value):((e=t.value)instanceof a?e:new a(function(t){t(e)})).then(n,r)}i((l=l.apply(t,s||[])).next())})},ud=window&&window.__generator||function(o,n){var r,i,s,a={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},t={next:e(0),throw:e(1),return:e(2)};return"function"==typeof Symbol&&(t[Symbol.iterator]=function(){return this}),t;function e(e){return function(t){return function(e){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,i&&(s=2&e[0]?i.return:e[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,e[1])).done)return s;switch(i=0,(e=s?[2&e[0],s.value]:e)[0]){case 0:case 1:s=e;break;case 4:return a.label++,{value:e[1],done:!1};case 5:a.label++,i=e[1],e=[0];continue;case 7:e=a.ops.pop(),a.trys.pop();continue;default:if(!(s=0<(s=a.trys).length&&s[s.length-1])&&(6===e[0]||2===e[0])){a=0;continue}if(3===e[0]&&(!s||e[1]>s[0]&&e[1]<s[3])){a.label=e[1];break}if(6===e[0]&&a.label<s[1]){a.label=s[1],s=e;break}if(s&&a.label<s[2]){a.label=s[2],a.ops.push(e);break}s[2]&&a.ops.pop(),a.trys.pop();continue}e=n.call(o,a)}catch(t){e=[6,t],i=0}finally{r=s=0}if(5&e[0])throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}([e,t])}}},pd=window&&window.__read||function(t,e){var o="function"==typeof Symbol&&t[Symbol.iterator];if(!o)return t;var n,r,i=o.call(t),s=[];try{for(;(void 0===e||0<e--)&&!(n=i.next()).done;)s.push(n.value)}catch(t){r={error:t}}finally{try{n&&!n.done&&(o=i.return)&&o.call(i)}finally{if(r)throw r.error}}return s},hd=window&&window.__spreadArray||function(t,e){for(var o=0,n=e.length,r=t.length;o<n;o++,r++)t[r]=e[o];return t},dd=window&&window.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,o=e&&t[e],n=0;if(o)return o.call(t);if(t&&"number"==typeof t.length)return{next:function(){return{value:(t=t&&n>=t.length?void 0:t)&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},fd=(w(yd,ad=J),yd.prototype.getCanvas=function(){return this.map.getCanvas()},yd.prototype.getCanvasContainer=function(){return this.map.getCanvasContainer()},yd.prototype.getMapContainer=function(){return this.map.getContainer()},yd.prototype.getServiceOptions=function(){return ts(this.serviceOptions,Kh._cloneCustomizer)},yd.prototype.setServiceOptions=function(t){this.serviceOptions=(new Kh).merge(this.serviceOptions,t),this.serviceOptions["enable-accessibility"]?this.accessibleMapDelegate.addToMap():this.accessibleMapDelegate.removeFromMap()},yd.prototype.addRequestTransformer=function(t){this.serviceOptions.addTransformer(t)},yd.prototype.removeRequestTransformer=function(t){this.serviceOptions.removeTransformer(t)},yd.prototype.setCamera=function(t,e){if(void 0===e&&(e=!1),"padding"in t||"offset"in t||"bounds"in t){var o,n=(new $p).merge({maxZoom:this.getCamera().maxZoom},t),r=this._generateSafeBounds(n.bounds),i={padding:n.padding,offset:n.offset,maxZoom:n.maxZoom};if(!(o=this.map.cameraForBounds(r,i))){var s=null===(s=this.map)||void 0===s?void 0:s.getContainer(),s={message:"The map cannot be fit to the current canvas with the given CameraBoundsOptions.",containerWidth:null==s?void 0:s.clientWidth,containerHeight:null==s?void 0:s.clientHeight,safeBounds:r,cameraForBoundsOptions:i};throw new Error(JSON.stringify(s))}this.map.setMaxZoom(n.maxZoom),this._invokeEvent("maxzoomchanged",this.map.getMaxZoom()),r=this._generateSafeBounds(n.maxBounds)}else{i=(new nh).merge(this.getCamera(),t);i.centerOffset&&2<=i.centerOffset.length&&(s=i.centerOffset,(n=ti([i.center],i.zoom))[0][0]+=s[0],n[0][1]+=s[1],i.center=$r(n,i.zoom)[0]),o={center:i.center,zoom:i.zoom,bearing:i.bearing,pitch:i.pitch,around:void 0},this.map.setMinZoom(i.minZoom),this.map.setMaxZoom(i.maxZoom),this._invokeEvent("minzoomchanged",this.map.getMinZoom()),this._invokeEvent("maxzoomchanged",this.map.getMaxZoom()),r=this._generateSafeBounds(i.maxBounds)}r?this.map.setMaxBounds(r):this.map.setMaxBounds(null);r=(new qp).merge(t),t={duration:r.duration,easing:function(t){return t},offset:[0,0],animate:!0},e={fromControl:e};"jump"===r.type?this.map.jumpTo(o,e):"ease"===r.type?this.map.easeTo(ld(ld({},o),t),e):"fly"===r.type&&this.map.flyTo(ld(ld({},o),t),e)},yd.prototype.setCameraBounds=function(t){this.setCamera(t)},yd.prototype.getCamera=function(){var t=this.map.getBounds().getSouthWest().toArray(),e=this.map.getBounds().getNorthEast().toArray();return{zoom:this.map.getZoom(),center:this.map.getCenter().toArray(),bearing:this.map.getBearing(),pitch:this.map.getPitch(),bounds:new Ci(t,e),minZoom:this.map.getMinZoom(),maxZoom:this.map.getMaxZoom()}},yd.prototype.setStyle=function(t,e){void 0===e&&(e=!0),delete t.preserveDrawingBuffer;t=(new Dh).merge(this.styleOptions,t);t.autoResize!==this.styleOptions.autoResize&&this._setAutoResize(t.autoResize),t.language!==this.styleOptions.language&&(this.localizedStringsPromise=Ml.getStrings(t.language)),t.renderWorldCopies!==this.styleOptions.renderWorldCopies&&this.map.setRenderWorldCopies(t.renderWorldCopies),t.showFeedbackLink!==this.styleOptions.showFeedbackLink&&this.copyrightControl.setOptions({showFeedbackLink:t.showFeedbackLink}),t.customAttribution!==this.styleOptions.customAttribution&&this.copyrightControl.setOptions({customAttribution:t.customAttribution}),t.showLogo!==this.styleOptions.showLogo&&this.copyrightControl.setOptions({showLogo:t.showLogo}),t.showTileBoundaries!==this.styleOptions.showTileBoundaries&&(this.map.showTileBoundaries=t.showTileBoundaries),this.styleOptions=t,this._setStyleComponents(t,e)},yd.prototype.getStyle=function(){return Uo(this.styleOptions)},yd.prototype.addIcon=function(t,e){this.imageSprite.add(t,e)},yd.prototype.addPins=function(t,e){var o,n=(new vh).merge(e),r=this.layers.getLayerById(n.name),i=!1;if(r||(i=!0,r=new Ha(n.name+"-source",n.name,{source:n.name+"-source",minZoom:n.minZoom,maxZoom:n.maxZoom,iconOptions:{anchor:"center",size:n.iconSize,image:["case",["has","icon"],["get","icon"],n.icon],ignorePlacement:!n.cluster,opacity:n.opacity},textOptions:{anchor:"center",textField:["case",["has","point_count"],["to-string",["get","point_count"]],["has","title"],["to-string",["get","title"]],n.title],font:["case",["has","point_count"],["literal",["StandardFontCondensed-Bold"]],["literal",[n.textFont]]],size:["case",["has","point_count"],20,n.fontSize],ignorePlacement:!n.cluster,opacity:n.opacity,offset:["case",["has","point_count"],["literal",[.5,-.45]],["literal",[n.textOffset[0]/16,n.textOffset[1]/16]]],color:n.fontColor}})),!(r instanceof Ha))throw new Error("A layer with name '"+n.name+"' already exists but it is not a SymbolLayer.A SymbolLayer should be used for rendering pins.");var s=r.getSource();"string"==typeof s?(o=s,s=this.sources.getById(o)):o=s.getId();e=!1;if(s||(e=!0,s=new us(o,{cluster:n.cluster})),!(s instanceof us))throw new Error("The source with name '"+o+"' already exists but it is not a DataSource.New data can only be added to a DataSource.");e&&this.sources.add(s),i&&this.layers.add(r,n.before);t=new ki(t);n.overwrite?s.setShapes(t):s.add(t)},yd.prototype.addCircles=function(t,e){var o,n=(new uh).merge(e),r=this.layers.getLayerById(n.name),i=!1;if(r||(i=!0,r=new Rs(n.name+"-source",n.name,{source:n.name+"-source",minZoom:n.minZoom,maxZoom:n.maxZoom,opacity:n.opacity,radius:["case",["has","radius"],["get","radius"],n.radius],color:["case",["has","color"],["get","color"],n.color],strokeColor:["case",["has","outlineColor"],["get","outlineColor"],n.outlineColor],strokeWidth:["case",["has","outlineWidth"],["get","outlineWidth"],n.outlineWidth]})),!(r instanceof Rs))throw new Error("A layer with name '"+n.name+"' already exists but it is not a BubbleLayer.A BubbleLayer should be used for rendering circles.");var s=r.getSource();"string"==typeof s?(o=s,s=this.sources.getById(o)):o=s.getId();e=!1;if(s||(e=!0,s=new us(o)),!(s instanceof us))throw new Error("The source with name '"+o+"' already exists but it is not a DataSource.New data can only be added to a DataSource.");e&&this.sources.add(s),i&&this.layers.add(r,n.before);t=new ki(t);n.overwrite?s.setShapes(t):s.add(t)},yd.prototype.addLinestrings=function(t,e){var o,n=(new fh).merge(e),r=this.layers.getLayerById(n.name),i=!1;if(r||(i=!0,r=new ca(n.name+"-source",n.name,{source:n.name+"-source",minZoom:n.minZoom,maxZoom:n.maxZoom,lineCap:n.cap,lineJoin:n.join,strokeOpacity:n.opacity,strokeColor:["case",["has","color"],["get","color"],n.color],strokeWidth:["case",["has","width"],["get","width"],n.width]})),!(r instanceof ca))throw new Error("A layer with name '"+n.name+"' already exists but it is not a LineLayer.A LineLayer should be used for rendering linestrings.");var s=r.getSource();"string"==typeof s?(o=s,s=this.sources.getById(o)):o=s.getId();e=!1;if(s||(e=!0,s=new us(o)),!(s instanceof us))throw new Error("The source with name '"+o+"' already exists but it is not a DataSource.New data can only be added to a DataSource.");e&&this.sources.add(s),i&&this.layers.add(r,n.before);t=new ki(t);n.overwrite?s.setShapes(t):s.add(t)},yd.prototype.addPolygons=function(t,e){var o,n=(new Sh).merge(e),r=this.layers.getLayerById(n.name),i=!1;if(r||(i=!0,r=new Pa(n.name+"-source",n.name,{source:n.name+"-source",minZoom:n.minZoom,maxZoom:n.maxZoom,fillOpacity:n.opacity,fillColor:["case",["has","color"],["get","color"],n.color]})),!(r instanceof Pa))throw new Error("A layer with name '"+n.name+"' already exists but it is not a PolygonLayer.A PolygonLayer should be used for rendering linestrings.");var s=r.getSource();"string"==typeof s?(o=s,s=this.sources.getById(o)):o=s.getId();e=!1;if(s||(e=!0,s=new us(o)),!(s instanceof us))throw new Error("The source with name '"+o+"' already exists but it is not a DataSource.New data can only be added to a DataSource.");e&&this.sources.add(s),i&&this.layers.add(r,n.before);t=new ki(t);n.overwrite?s.setShapes(t):s.add(t)},yd.prototype.addRaster=function(t,e){var o=(new Eh).merge(e),n=this.layers.getLayerById(o.name);if(!((n=n||new el({maxZoom:o.maxZoom,minZoom:o.minZoom,opacity:o.opacity,tileSize:256,tileUrl:"{subdomain}"},o.name))instanceof el))throw new Error("A layer with name '"+o.name+"' already exists but it is not a TileLayer.A TileLayer should be used for rendering raster images.");if("{subdomain}"!==n.getOptions().tileUrl)throw new Error("A TileLayer with name '"+o.name+"' already exists but was configured for a single tile url [default for new TileLayer(...)].");(e=!o.overwrite&&n.getOptions().subdomains||[]).push.apply(e,hd([],pd(t))),n._setOptionsNoUpdate({subdomains:e}),this.layers.add(n,o.before)},yd.prototype.getLayers=function(){return this.layers.getLayers().map(function(t){return t.getId()})},yd.prototype.removeLayers=function(t){var e,o;try{for(var n=dd(t),r=n.next();!r.done;r=n.next()){var i,s=r.value;this.layers.getLayerById(s)&&(this.layers.remove(s),i=s+"-source",this.sources.getById(i)&&this.sources.remove(i))}}catch(t){e={error:t}}finally{try{r&&!r.done&&(o=n.return)&&o.call(n)}finally{if(e)throw e.error}}},yd.prototype.addHtml=function(t,e){t.id||(t.id="marker_"+or());var o=new kl({htmlContent:t});return this.markers.add(o,e),t.id},yd.prototype.removeHtml=function(t){this.markers.remove(t)},yd.prototype.addEventListener=function(t,e,o){this.events._addLegacy(t,e,o)},yd.prototype.removeEventListener=function(t,e,o){this.events._removeLegacy(t,e,o)},yd.prototype.setUserInteraction=function(t){this.userInteractionDelegate.setOptions(t)},yd.prototype.getUserInteraction=function(){return this.userInteractionDelegate.getOptions()},yd.prototype.addControl=function(t,e){this.controls.add(t,e)},yd.prototype.removeControl=function(t){this.controls.remove(t)},yd.prototype.setTraffic=function(t){var e=this.trafficOptions.incidents,o=this.trafficOptions.flow;if(this.trafficOptions=(new Sn).merge(this.trafficOptions,t),this.controls.getControls().filter(function(t){return t instanceof An}).forEach(function(t){return t.updateButtonState()}),this.incidentDelegate&&(this.trafficOptions.incidents?e||this.incidentDelegate.addToMap():this.incidentDelegate.removeFromMap()),this.trafficOptions.flow&&"none"!==this.trafficOptions.flow)try{this.trafficOptions.flow!==o&&this.flowDelegate.addToMap()}catch(t){throw this.trafficOptions.flow=o,t}else this.flowDelegate.removeFromMap()},yd.prototype.getTraffic=function(){return Uo(this.trafficOptions)},yd.prototype.remove=function(){this.dispose()},yd.prototype.clear=function(){this.popups.clear(),this.layers.clear(),this.sources.clear(),this.markers.clear()},yd.prototype.dispose=function(){for(this.clear(),this.map.remove(),this.removed=!0;this.getMapContainer().firstChild;){var t=this.getMapContainer().firstChild;this.getMapContainer().removeChild(t)}},yd.prototype.resize=function(t,e,o){"number"!=typeof t&&"string"!=typeof t||"number"!=typeof e&&"string"!=typeof e?o=t:(t=t,this.getMapContainer().style.height="number"==typeof t?t+"px":t,this.getMapContainer().style.width="number"==typeof e?e+"px":e);e=this.getMapContainer().style.overflow;this.getMapContainer().style.overflow="hidden",this.map.resize(o),this.getMapContainer().style.overflow=e},yd.prototype.pixelsToPositions=function(t){var e,o,n=[];try{for(var r=dd(t),i=r.next();!i.done;i=r.next()){var s=i.value,a=this.map.unproject(s);n.push(new yi(a.lng,a.lat))}}catch(t){e={error:t}}finally{try{i&&!i.done&&(o=r.return)&&o.call(r)}finally{if(e)throw e.error}}return n},yd.prototype.positionsToPixels=function(t){var e,o,n=[];try{for(var r=dd(t),i=r.next();!i.done;i=r.next()){var s=i.value,a=this.map.project(s);n.push(new ar(a.x,a.y))}}catch(t){e={error:t}}finally{try{i&&!i.done&&(o=r.return)&&o.call(r)}finally{if(e)throw e.error}}return n},yd.prototype.areTilesLoaded=function(){return this.map.areTilesLoaded()},yd.prototype.stop=function(){this.map.stop()},yd.prototype.triggerRepaint=function(){this.map.triggerRepaint()},yd.prototype._getMap=function(){return this.map},yd.prototype._rebuildStyle=function(e){return void 0===e&&(e=!0),cd(this,void 0,void 0,function(){return ud(this,function(t){return this.styles.setStyle(this.styleOptions,e),this.imageSprite._restoreImages(),[2]})})},yd.prototype._isLoaded=function(){return this.loaded},yd.prototype._isReady=function(){return this.ready},yd.prototype._getLocalizedStrings=function(){return this.localizedStringsPromise},yd.prototype._sendRequest=function(t,e,o){var n;return(n="function"==typeof this.serviceOptions.transformRequest?this.serviceOptions.transformRequest(t,e):n)?fetch(n.url||t,{credentials:n.credentials,headers:ld(ld({},o),n.headers),method:"GET",mode:"cors"}):fetch(t,{headers:o,method:"GET",mode:"cors"})},yd.prototype._substituteDomainLanguageViewAndSignInRequest=function(t,e){var o,n;(t.includes(h)||t.includes(c))&&(n=new RegExp("[^{]"+h+"[^}]"),t.match(n)&&(e.url=e.url.replace(h,c)),j.protoRegEx.test(this.serviceOptions.domain)?(n=e.url.indexOf(c),e.url=this.serviceOptions.domain+e.url.substring(n+c.length)):e.url=e.url.replace(c,this.serviceOptions.domain)),(e.url.toLocaleLowerCase().includes(this.serviceOptions.domain.toLocaleLowerCase())||e.url.toLocaleLowerCase().includes(this.serviceOptions.staticAssetsDomain.toLocaleLowerCase()))&&null!==(o=this.authentication)&&void 0!==o&&o.signRequest(e),t.includes(y)&&(e.url=e.url.replace(y,this.styleOptions.language)),t.includes(d)&&(e.url=this.styleOptions.view?e.url.replace(d,this.styleOptions.view):e.url.replace(d,"").replace("&"+f+"=",""))},yd.prototype._setAutoResize=function(t){t?window.addEventListener("resize",this._windowResizeCallback):window.removeEventListener("resize",this._windowResizeCallback)},yd.prototype._setStyleComponents=function(e,o){var n=this;void 0===o&&(o=!0),this.removed||this.styles.definitions().then(function(t){n.styleOptions.style&&t.configurations.map(function(t){return t.name}).includes(n.styleOptions.style)||(n.styleOptions.style=t.defaultConfiguration),n.styleOptions=e,n._rebuildStyle(o)})},yd.prototype._updateGlobalDefaults=function(t){t&&(t.authOptions&&!lc&&Sc(t.authOptions),t.domain&&!ec&&xc(t.domain),t.styleDefinitionsPath&&!oc&&Oc(t.styleDefinitionsPath),t.workerCount&&!rc&&Tc(t.workerCount),t.maxParallelImageRequests&&!ic&&Ec(t.maxParallelImageRequests),!t.subscriptionKey&&!t["subscription-key"]||lc||kc(t.subscriptionKey||t["subscription-key"]),!t.sessionId&&!t["session-id"]||ac||Pc(t.sessionId||t["session-id"]),t.language&&!sc&&Cc(t.language),!t.userRegion&&!t.view||tc||Ac(t.userRegion||t.view))},yd.prototype._generateSafeBounds=function(t){if(t){var e=Ci.getSouth(t),o=Ci.getWest(t),n=Ci.getNorth(t),r=Ci.getEast(t);if(!(isFinite(e)&&isFinite(o)&&isFinite(n)&&isFinite(r)))throw new Error("The bounds specified are invalid: ["+t+"]");for(;r<o;)r+=360;return new Ci([o,e,r,n])}return t},yd.prototype._detectHighContrast=function(){var t,e;switch(Uc.getHighContrastMode()){case"invert":case"light":t=yd.Css.hcLight,e="high_contrast_light";break;case"dark":t=yd.Css.hcDark,e="high_contrast_dark"}t&&this.map.getContainer().classList.add(t),e&&"road"===this.styleOptions.style&&(this.styleOptions.style=e)},yd.Css={canvasContainer:"atlas-map-canvas-container",canvas:"atlas-map-canvas",container:"atlas-map",hcDark:"high-contrast-dark",hcLight:"high-contrast-light"},yd);function yd(t,e){var n=ad.call(this)||this;n.removed=!1,n.loaded=!1,n.ready=!1,n._windowResizeCallback=function(){return n.resize()};var o,r,i=!0;n._updateGlobalDefaults(e),n.serviceOptions=(new Kh).merge(e),n.styleOptions=(new Dh).merge(e),n.trafficOptions=new Sn,n.styles=new rd(n,n.serviceOptions),n.serviceOptions.authOptions.subscriptionKey&&(n.serviceOptions.authOptions.subscriptionKey=encodeURIComponent(n.serviceOptions.authOptions.subscriptionKey)),o=n.serviceOptions.authOptions.clientId||(n.serviceOptions.authOptions.subscriptionKey?n.serviceOptions.authOptions.subscriptionKey.replace(/.(?=.{3,}$)/g,"*"):"invalid-setting"),n.insights&&n.insights.setAuthenticatedUserContext(n.serviceOptions.sessionId,o),arguments[2]&&"ENVIRONMENT"in window&&window.ENVIRONMENT.hmr?(r=arguments[2],n.ready=!0,n.loaded=!0):(t={antialias:n.styleOptions.antialias,attributionControl:!1,container:t,fadeDuration:n.serviceOptions.fadeDuration,localIdeographFontFamily:n.serviceOptions.localIdeographFontFamily,preserveDrawingBuffer:n.styleOptions.preserveDrawingBuffer,refreshExpiredTiles:n.serviceOptions.refreshExpiredTiles,renderWorldCopies:n.styleOptions.renderWorldCopies,trackResize:!1,transformRequest:function(t,e){var o={url:t};return"Tile"===e||"Source"===e?(t.includes(h)&&n.insights&&n.insights.trackEvent({name:"TileLoad"}),n._substituteDomainLanguageViewAndSignInRequest(t,o)):"Style"!==e&&"SpriteJSON"!==e&&"SpriteImage"!==e&&"Glyphs"!==e||n.styles._transformStyleRequest(t,o),n.serviceOptions.transformRequest&&pn(o,n.serviceOptions.transformRequest(o.url,e)),o}},r=new p.Map(t));try{n.map=r,n.authentication=new ep(n),n.controls=new rp(n),n.events=new hp(n),n.imageSprite=new gp(n),n.layers=new Cp(n),n.markers=new yp(n),n.sources=new zp(n),n.popups=new Ap(n),n.map.getContainer().classList.add(yd.Css.container),n.map.getCanvasContainer().classList.add(yd.Css.canvasContainer),n.map.getCanvas().classList.add(yd.Css.canvas),n._detectHighContrast(),n.copyrightControl=new Yc({showFeedbackLink:n.styleOptions.showFeedbackLink,showLogo:n.styleOptions.showLogo,customAttribution:n.styleOptions.customAttribution}),n.controls.add(n.copyrightControl,{position:u.ControlPosition.NonFixed});var s=n.authentication?n.authentication.initialize():Promise.resolve();if(n.removed)return n;var a=function(){n.loaded=!0,n.map.off("load",a)};n.map.on("load",a);var l=function(){n.ready=!0,n.map.off("styledata",l),n.events.invoke("ready",{map:n,type:"ready"})};n.map.on("styledata",l),n._setAutoResize(n.styleOptions.autoResize),n.map.showTileBoundaries=n.styleOptions.showTileBoundaries,n.localizedStringsPromise=Ml.getStrings(n.styleOptions.language);var c=n.styles.initStyleset();Promise.all([s,c]).then(function(t){t=pd(t,2),t[0],t[1];if(!n.removed){if(n.authentication&&!n.authentication.getToken())throw new Error("AuthenticationManager finished initializing, but no token is available");n.serviceOptions["enable-accessibility"]&&n.accessibleMapDelegate.addToMap(),n._setStyleComponents(n.styleOptions),n.copyrightDelegate&&n.copyrightDelegate.addToMap()}}).catch(function(t){t=t instanceof Error?t:new Error(t);n.insights&&n.insights.trackException({error:t}),n.events.invoke("error",{map:n,type:"error",error:t})}),n.setCamera(ld(ld({},e),{type:"jump",duration:0})),n.incidentDelegate=new wu(n),n.flowDelegate=new du(n),n.accessibleMapDelegate=new hu(n),n.userInteractionDelegate=new Au(n,e),n.userInteractionDelegate.addToMap(),n.copyrightDelegate=new Wu(n,n.copyrightControl,n.styleOptions)}catch(t){throw i=!1,n.insights&&n.insights.trackException({error:t instanceof Error?t:new Error(t)}),t}finally{n.insights&&(n.insights.trackEvent({name:"MapLoad"},{success:i,supported:bc(!1),supportedWithPerformance:bc(!0)}),n.insights.flush())}return n}var md=window&&window.__read||function(t,e){var o="function"==typeof Symbol&&t[Symbol.iterator];if(!o)return t;var n,r,i=o.call(t),s=[];try{for(;(void 0===e||0<e--)&&!(n=i.next()).done;)s.push(n.value)}catch(t){r={error:t}}finally{try{n&&!n.done&&(o=i.return)&&o.call(i)}finally{if(r)throw r.error}}return s},gd=window&&window.__spreadArray||function(t,e){for(var o=0,n=e.length,r=t.length;o<n;o++,r++)t[r]=e[o];return t},P=(vd.applyTemplate=function(e,o){var n,r,t,i=this,s=document.createElement("div");return s.classList.add(vd.Css.template),e&&("boolean"!=typeof(o=o||{}).singleDescription&&(o.singleDescription=!0),o.sandboxContent="boolean"!=typeof o.sandboxContent||o.sandboxContent,o.title&&"string"==typeof o.content&&(o.content.includes("{title}")||o.content.includes("{name}"))||(e.title?o.title="{title}":e.name&&(o.title="{name}")),"boolean"!=typeof o.detectHyperlinks&&(o.detectHyperlinks=!0),"boolean"!=typeof o.parsePropertyPaths&&(o.parsePropertyPaths=!0),o.textColor&&(s.style.color=o.textColor),o.fillColor&&(s.style.backgroundColor=o.fillColor),o.title&&((t=this._applyStringTemplate(e,o.title,o)).innerText=t.textContent||t.innerText||"",this._appendChild(s,t,vd.Css.title)),(n=document.createElement("div")).classList.add(vd.Css.content),Array.isArray(o.content)?0<o.content.length&&o.content[0].propertyPath?this._appendChild(n,this._generateContent(e,o.content,o),vd.Css.item):o.content.forEach(function(t){i._appendChild(n,i._generateContent(e,t,o),vd.Css.item)}):(r=0,e.description&&Object.keys(e).forEach(function(t){i._ignoreProperty(t,e[t])||r++}),t=void 0,1===r||o.singleDescription&&e.description||2===r&&e.Snippet?(t=document.createElement("div")).innerHTML=e.description:t=this._generateContent(e,o.content,o),this._appendChild(n,t,vd.Css.item)),""!==n.innerHTML&&(o.sandboxContent?s.appendChild(vd._createSandboxedIframe(n,o)):s.appendChild(n))),s},vd._createSandboxedIframe=function(t,e){var o=document.createElement("iframe");o.sandbox.add("allow-popups");var n=t.innerHTML,r=!1,i=100,s=550,a=10,l=0;document.body.scrollWidth<=340&&(s=300,i=50);var c=n.split(/<(tr|div|br|li|h[0-9]|p>)/),l=Math.max.apply(Math,gd([],md(c.map(function(t){return t.replace(/<[a-zA-Z0-9\s=\/]+>/g,"").length}))))-1,t=Math.ceil(3.5*l);t<s&&(s=t,i=l),n.includes("<img")||n.includes("<video")?(r=!0,o.width="550px"):(l=-1<n.indexOf(vd.Css.table)?25:20,a+=Math.max(.5*c.length*l,Math.ceil(n.replace(/<[a-zA-Z0-9\s=\/]+>/g,"").length/i)*l)),o.width=s+"px",o.height=r||280<a?"280px":a+"px";a=e.textColor?"color:"+e.textColor+";":"",e=e.fillColor?"background-color:"+e.fillColor+";":"",n='<html><head><title></title><meta charset="utf-8" /><meta http-equiv="x-ua-compatible" content="IE=Edge" /><link rel="stylesheet" href="'+vd._cssUrl+'" type="text/css"/><style>html, body{margin:0;padding:0;'+a+e+'}</style></head><body><div class="'+vd.Css.template+'" style="padding:0;width:'+(s-20)+'px">'+n+"</div></body></html>";return void 0===o.srcdoc?o.src="data:text/html;charset=utf-8,"+encodeURI(n):o.srcdoc=n,o},vd._appendChild=function(t,e,o){e&&(o&&(e.className=(e.className?e.className+" ":"")+o),t.appendChild(e))},vd._generateContent=function(t,e,o){if(e)return Array.isArray(e)?this._generatePropertyInfoTable(t,e,o):this._applyStringTemplate(t,e,o);t=this._generateDynamicTableHtml(t,null,o);if(t){o=document.createElement("div");return o.innerHTML=t,o}return null},vd._applyStringTemplate=function(t,e,o){if(e){for(var n,r=e,i=this._placeholderRx.exec(e);i;)2<=i.length&&(n=this._getPropertyValue(t,i[1],o),r=r.replace(i[0],n)),i=this._placeholderRx.exec(e);if(r){(r=r.trim()).includes("<")&&(r=r.replace(/[\r\n]+/g,"<br/>"));var s=document.createElement("div");return s.innerHTML=r,s}}return null},vd._getPropertyValue=function(t,e,o,n){var r=o.parsePropertyPaths?e.split("/"):[e],i=r.length;if(0<i&&t){var s=r[0],a=t[s];if(o.detectHyperlinks&&"link"===e&&(!n||n.hyperlinkFormat)){var l,c=[];if(Array.isArray(a)?a.forEach(function(t){t.href?c.push(t):"string"==typeof t&&c.push({href:t})}):a.href&&c.push(a),0<c.length){n&&n.hyperlinkFormat?l=n.hyperlinkFormat:o&&o.hyperlinkFormat&&(l=o.hyperlinkFormat);var u=l&&l.target?l.target:"_blank",p=[];return c.forEach(function(t){t.title||l&&l.label||!t.rel||p.push(t.rel," - "),p.push('<a href="',t.href,'" target="',u,'">'),t.title?p.push(t.title):l&&l.label?p.push(l.label):p.push(t.href),p.push("</a>","<br/>")}),p.pop(),p.join("")}}if(null!=a){for(var h=void 0,h=1;h<i&&(a=a[r[h]],s=r[h],null!=a);h++);if(h===i&&null!=a){var d=void 0;if((d=void 0!==a.value?a.value:a)instanceof Date)return n&&n.dateFormat?d.toLocaleString(void 0,n.dateFormat):o.dateFormat?d.toLocaleString(void 0,o.dateFormat):d.toISOString();if("object"==typeof d)return(y=this._generateDynamicTableHtml(d,r.slice(1),o))||"";if("number"==typeof d){if(n){if(n.dateFormat)return new Date(d).toLocaleString(void 0,n.dateFormat);if(n.numberFormat)return d.toLocaleString(void 0,n.numberFormat)}else if(/(timestamp|date)/gi.test(s))return new Date(d).toISOString();return d.toLocaleString(void 0,o.numberFormat)}if("string"==typeof d&&""!==d&&!/[\n\r<>\s]/g.test(d)&&(o.detectHyperlinks||n&&n.hyperlinkFormat)){var d=d.trim(),f=this._isUrlRx.test(d)||n&&n.hyperlinkFormat,t=this._isImageUrlRx.test(d)&&(f||d.startsWith("data:image")),e=this._emailRx.test(d);if(f||t||e){f=void 0;n&&n.hyperlinkFormat?f=n.hyperlinkFormat:o&&o.hyperlinkFormat&&(f=o.hyperlinkFormat);var y=void 0;y=f&&f.target?' target="'+f.target+'"':' target="_blank"';o=""+(f&&f.label?f.label:d);f&&f.scheme?d=f.scheme+d:e&&(d="mailto:"+d);e=f&&f.label?' alt="'+f.label+'"':"";return'<a href="'+d+'"'+y+">"+(o=f&&f.isImage||t?'<img src="'+d+'" style="max-width:100%"'+e+'"/>':o)+"</a>"}}return d.toString()}}}return""},vd._generatePropertyInfoTable=function(o,t,n){if(o&&t&&0<t.length){var r=[],i=this;r.push('<table class="'+i.Css.table+'">'),t.forEach(function(t){var e=i._getPropertyValue(o,t.propertyPath,n,t);t.hideLabel?r.push('<tr><td colspan="2">',e,"</td></tr>"):(t=t.label||t.propertyPath.split("/")[0],r.push("<tr><th>",t,"</th><td>",e,"</td></tr>"))}),r.push("</table>");t=document.createElement("div");return t.innerHTML=r.join(""),t}return null},vd._generateDynamicTableHtml=function(e,t,o){var n=this;if(e){var r=[],i=this;r.push('<table class="'+i.Css.table+'">');var s=t&&0<t.length?t.join("/")+"/":"",a=0;return(Object.keys(e).forEach(function(t){n._ignoreProperty(t,e[t])||(r.push("<tr><th>",t,"</th><td>",i._getPropertyValue(e,s+t,o),"</td></tr>"),a++)}),0===a)?null:(r.push("</table>"),r.join(""))}return null},vd._ignoreProperty=function(t,e){switch(t){case"title":case"name":case"base":case"popupTemplate":case"anchor":case"icon":case"image":case"imageUrl":case"rotation":case"color":case"size":case"offset":case"strokeColor":case"strokeWidth":case"strokeOpacity":case"subType":case"fillColor":case"fillOpacity":case"visibility":case"visible":return!0;default:if(0===t.indexOf("_")||null==e||""===e)return!0}return!1},vd._placeholderRx=/\{([a-zA-Z0-9_\/\s]+)\}/gi,vd._isUrlRx=/^(http|https|ftp|tel|mailto):\/\//i,vd._isImageUrlRx=/(^data:image|.png$|.jpg$|.jpeg$|.gif$|.bmp$|.svg|.tif|.tiff$)/i,vd._emailRx=/^[^\.\s@:](?:[^\s@:]*[^\s@:\.])?@[^\.\s@]+(?:\.[^\.\s@]+)*$/,vd._cssUrl=new j({domain:e,path:"sdk/javascript/mapcontrol/"+B.getEndpointVersion()+"/atlas.min.css"}).toString(),vd.Css={template:"azure-maps-control-popup-template",title:"azure-maps-control-popup-template-title",content:"azure-maps-control-popup-template-content",item:"azure-maps-control-popup-template-content-item",table:"azure-maps-control-popup-template-table"},vd);function vd(){this.detectHyperlinks=!0,this.parsePropertyPaths=!0}w=new j({domain:e,path:"sdk/javascript/mapcontrol/"+B.getEndpointVersion()+"/mapbox-gl-rtl-text.min.js"});p.setRTLTextPlugin(w.toString(),function(t){t&&console.warn(t)},!0),u.HtmlMarker=kl,u.Map=fd,u.Pixel=ar,u.Popup=bl,u.PopupTemplate=P,u.Shape=Si,u._getAssetDomain=function(){return t},u._getDomain=function(){return Vl},u._hasMaxParallelImageRequests=jc,u._hasSetAuthenticationOptions=Ic,u._hasSetDomain=Rc,u._hasSetLanguage=Dc,u._hasSetSessionId=zc,u._hasSetStyleDefinitionsPath=Nc,u._hasSetStyleDefinitionsVersion=function(){return nc},u._hasSetView=Bc,u._hasWorkerCount=Mc,u.addImageTemplate=function(t,e,o){!o&&Fc[t.toLowerCase()]||(Fc[t.toLowerCase()]=e)},u.clearPrewarmedResources=function(){p.clearPrewarmedResources()},u.control=Ot,u.data=Lt,u.getAllImageTemplateNames=function(){return Object.keys(Fc)},u.getAuthenticationOptions=cc,u.getDomain=pc,u.getImageTemplate=Lc,u.getLanguage=gc,u.getMaxParallelImageRequests=mc,u.getSessionId=vc,u.getStaticAssetsDomain=uc,u.getStyleAPIVersion=fc,u.getStyleDefinitionsPath=hc,u.getStyleDefinitionsVersion=dc,u.getSubscriptionKey=_c,u.getUserRegion=function(){return Gl},u.getVersion=function(){return B.getFullVersion()},u.getView=wc,u.getWorkerCount=yc,u.internal=et,u.isSupported=bc,u.layer=kt,u.math=At,u.prewarm=function(){p.prewarm()},u.setAuthenticationOptions=Sc,u.setDomain=xc,u.setLanguage=Cc,u.setMaxParallelImageRequests=Ec,u.setSessionId=Pc,u.setStyleAPIVersion=function(t){Xl=t},u.setStyleDefinitionsPath=Oc,u.setStyleDefinitionsVersion=function(t){Jl=t,nc=!0},u.setSubscriptionKey=kc,u.setUserRegion=Ac,u.setView=function(t){Gl=t,tc=!0},u.setWorkerCount=Tc,u.source=I,Object.defineProperty(u,"__esModule",{value:!0})});
55
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("azuremaps-maplibre-gl")):"function"==typeof define&&define.amd?define(["exports","azuremaps-maplibre-gl"],t):t((e=e||self).atlas=e.atlas||{},e.maplibregl)}(this,function(l,h){"use strict";h=h&&Object.prototype.hasOwnProperty.call(h,"default")?h.default:h;var e="atlas.microsoft.com",t="atlas.microsoft.com",r="styling",o="2022-08-05",n="https://login.microsoftonline.com/",c="api-version",i="Authorization",s="Bearer ",a="jwt-sas ",u="{{azMapsDomain}}",p="{azMapsDomain}",d="{{azMapsView}}",f="view",g="{{azMapsLanguage}}",y="{{azMapsStylingPath}}",m="{{azMapsStylePath}}",v="styling",_="styles",w="2.0",b="Map-Agent",C="x-ms-client-id",E="Ms-Am-Request-Origin",S="MapControl",T="https://atlas.microsoft.com/.default",I="Session-Id",A=window&&window.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],o=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&o>=e.length?void 0:e)&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},k=(P.prototype.merge=function(){for(var t,e,r,o=[],n=0;n<arguments.length;n++)o[n]=arguments[n];try{for(var i=A(o),s=i.next();!s.done;s=i.next()){var a=s.value;if(a)for(var c in a)a.hasOwnProperty(c)&&this.hasOwnProperty(c)&&(void 0!==a[c]&&null!=a[c]?this[c]instanceof P?this[c].merge(a[c]):this[c]=a[c]:(r=r||new(Object.getPrototypeOf(this).constructor),this[c]=r[c]))}}catch(e){t={error:e}}finally{try{s&&!s.done&&(e=i.return)&&e.call(i)}finally{if(t)throw t.error}}return this},P);function P(){}var O,R,x=window&&window.__extends||(O=function(e,t){return(O=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}O(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),M=window&&window.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var o,n,i=r.call(e),s=[];try{for(;(void 0===t||0<t--)&&!(o=i.next()).done;)s.push(o.value)}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return s},N=(x(L,R=k),L);function L(){var e=null!==R&&R.apply(this,arguments)||this;return e.domain=void 0,e.headers={},e.path="",e.protocol="https",e.queryParams={},e.subdomain="",e}var D=(q.prototype.get=function(){return fetch(this.toString(),{method:"GET",mode:"cors",headers:new Headers(this.options.headers)}).then(function(e){if(e.ok)return e.json();throw new Error("HTTP "+e.status+": "+e.statusText)})},q.prototype.toString=function(){var e=this,t=Object.entries(e.options.queryParams).map(function(e){e=M(e,2);return e[0]+"="+e[1]}).join("&"),r=[],o=e.options.path||"";return q.protoRegEx.test(o)?r.push(o):(e.options.domain&&(q.protoRegEx.test(e.options.domain)||(r.push(e.options.protocol+"://"),r.push(e.options.subdomain?e.options.subdomain+".":"")),r.push(e.options.domain)),r.push(e.options.path?"/"+o:"")),r.push(t?"?"+t:""),r.join("")},q.protoRegEx=new RegExp(/^(((file|http|https):\/\/)|blob:)/i),q);function q(e){this.options=(new N).merge(e)}var U="3.0.0-preview.4",j=(H.getFullVersion=function(){return U},H.getEndpointVersion=function(){var e=U.indexOf(".");return-1===(e=U.indexOf(".",e+1))?U:U.substring(0,e)},H);function H(){}function B(e){var t=document.createElement("span");return t.innerText=e,t.classList.add("tooltiptext"),-1!=navigator.userAgent.indexOf("Edg")?t.classList.add("edge"):-1!=navigator.userAgent.indexOf("Chrome")?t.classList.add("chrome"):-1!=navigator.userAgent.indexOf("Safari")?t.classList.add("safari"):-1!=navigator.userAgent.indexOf("Firefox")&&t.classList.add("firefox"),-1!=navigator.userAgent.indexOf("Windows")?t.classList.add("win"):-1!=navigator.userAgent.indexOf("Macintosh")&&t.classList.add("mac"),t}function z(n,i,s){function e(e){var t=i.getBoundingClientRect(),r=n.getBoundingClientRect(),o=t.x+r.width>window.innerWidth?window.innerWidth-r.width:t.x,r=t.y+t.height+r.height+4>window.innerHeight?t.y-r.height-4:t.y+t.height+4;s&&i.parentElement&&(t=i.parentElement?i.parentElement.getBoundingClientRect():null,n.style.position="absolute",o-=t.x,r-=t.y),n.style.transform="translate("+o+"px, "+r+"px)"}void 0===s&&(s=!1),i.addEventListener("mouseover",e),i.addEventListener("focusin",e)}var F,K=window&&window.__extends||(F=function(e,t){return(F=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}F(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});(Re=l.ControlPosition||(l.ControlPosition={})).TopLeft="top-left",Re.TopRight="top-right",Re.BottomLeft="bottom-left",Re.BottomRight="bottom-right",Re.NonFixed="non-fixed";var G,Y=(K(Z,G=k),Z);function Z(){var e=null!==G&&G.apply(this,arguments)||this;return e.position=l.ControlPosition.NonFixed,e}var W=(V.prototype.getLuminosity=function(){for(var e=[this.r,this.g,this.b],t=[],r=0;r<e.length;r++){var o=e[r]/255;t[r]=o<=.03928?o/12.92:Math.pow((.055+o)/1.055,2.4)}return.2126*t[0]+.7152*t[1]+.0722*t[2]},V.prototype.getRBGA=function(e){var t=document.createElement("canvas").getContext("2d");t.globalAlpha=1,t.fillStyle=e,t.fillRect(0,0,1,1);t=t.getImageData(0,0,1,1).data;return[t[0],t[1],t[2],t[3]]},V);function V(e){var t;e&&(t=void 0,3<=(t="string"==typeof e?this.getRBGA(e):e).length&&(this.r=t[0],this.g=t[1],this.b=t[2],3<t.length&&(this.a=t[3])))}(Ne=l.ControlStyle||(l.ControlStyle={})).light="light",Ne.dark="dark",Ne.auto="auto";var J=Map,Q=(X.prototype._addEventListener=function(e,t,r){this.listeners.has(e)||this.listeners.set(e,new J),this.listeners.get(e).set(t,r)},X.prototype._removeEventListener=function(e,t){this.listeners.has(e)&&this.listeners.get(e).delete(t)},X.prototype._invokeEvent=function(r,o){var n=this;this.listeners.has(r)&&this.listeners.get(r).forEach(function(e,t){e&&n._removeEventListener(r,t);try{t(o)}catch(e){console.error(e)}})},X);function X(){this.listeners=new J}var $,ee,te=Object.freeze({__proto__:null,EventEmitter:Q}),re=((window&&window.__extends||($=function(e,t){return($=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}$(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}))(oe,ee=Q),oe.prototype.onRemove=function(){this._container&&(this._container.remove(),delete this._container),this._map&&(this._map.events.remove("stylechanged",this._onStyleChange),delete this._map),this._observer&&(this._observer.disconnect(),delete this._observer),delete this._theme},oe.prototype.buildContainer=function(e,t,r,o){var n=this;return this._map=e,this._container=document.createElement(o||"div"),this._container.classList.add("azure-maps-control-container"),"string"==typeof r&&this._container.setAttribute("aria-label",r),t.toLowerCase()===l.ControlStyle.auto?this._map.styles.definitions().then(function(e){n._map&&n._map.events.add("stylechanged",n._onStyleChange)}):this._container.classList.add(t),this._container},oe.prototype._setTheme=function(e){this._theme!==e&&(this._container.classList.remove(this._theme),this._container.classList.add(e),this._theme=e)},oe.activateClickDelay=100,oe);function oe(){var t=null!==ee&&ee.apply(this,arguments)||this;return t._onStyleChange=function(){t._map.getStyle().style.toLowerCase().startsWith("blank")?t._observer||(t._onBackgroundChange(),t._observer=new MutationObserver(t._onBackgroundChange),t._observer.observe(t._map.getMapContainer(),{attributes:!0,attributeFilter:["style"]})):(t._observer&&(t._observer.disconnect(),delete t._observer),t._map.styles.getThemeAsync(t._map.getStyle()).then(function(e){t._setTheme(e)}))},t._onBackgroundChange=function(){var e=new W(t._map.getMapContainer().style.backgroundColor).getLuminosity(),e=isNaN(e)||.5<e?l.ControlStyle.light:l.ControlStyle.dark;t._setTheme(e)},t}var ne,ie,se=((window&&window.__extends||(ne=function(e,t){return(ne=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}ne(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}))(ae,ie=k),ae);function ae(){var e=null!==ie&&ie.apply(this,arguments)||this;return e.rotationDegreesDelta=15,e.style=l.ControlStyle.light,e.inverted=!1,e}var ce,ue,le=((window&&window.__extends||(ce=function(e,t){return(ce=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}ce(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}))(he,ue=re),he.prototype.onAdd=function(e,t){var r=this,o=this.buildContainer(e,this.options.style,"Rotation Control"),n=this.constructRotationButton(e),i=this.constructRotationGrid(e,t),e=B("Reset to Default Rotation");return o.addEventListener("mouseover",function(e){r.lastActiveTime=r.lastActiveTime||e.timeStamp,r.hasMouse=!0,o.classList.add("in-use"),i.classList.remove("hidden-accessible-element")}),o.addEventListener("focusin",function(e){r.lastActiveTime=r.lastActiveTime||e.timeStamp,r.hasFocus=!0,o.classList.add("in-use"),i.classList.remove("hidden-accessible-element")}),o.addEventListener("mouseleave",function(){r.hasMouse=!1,r.hasFocus||(delete r.lastActiveTime,o.classList.remove("in-use"),i.classList.add("hidden-accessible-element"))}),o.addEventListener("focusout",function(e){e.relatedTarget instanceof Node&&o.contains(e.relatedTarget)||(r.hasFocus=!1,r.hasMouse||(delete r.lastActiveTime,o.classList.remove("in-use"),i.classList.add("hidden-accessible-element")))}),i.addEventListener("keydown",function(e){"Escape"!==e.key&&"Esc"!==e.key||(e.stopPropagation(),n.focus(),o.classList.remove("in-use"),i.classList.add("hidden-accessible-element"))}),t&&he.InvertOrderPositions.includes(t.position)?(o.appendChild(i),o.appendChild(n),o.appendChild(e),z(e,n)):(o.appendChild(n),o.appendChild(e),z(e,n),o.appendChild(i)),o},he.prototype.constructRotationGrid=function(e,t){var r=document.createElement("div");r.classList.add("sub-container"),r.classList.add("hidden-accessible-element");var o=this.constructRightRotationButton(e),n=this.constructLeftRotationButton(e),i=B("Rotate Left"),e=B("Rotate Right");return t&&he.InvertOrderPositions.includes(t.position)?(r.appendChild(o),r.appendChild(e),z(e,o),r.appendChild(n),r.appendChild(i),z(i,n)):(r.appendChild(n),r.appendChild(i),z(i,n),r.appendChild(o),r.appendChild(e),z(e,o)),r},he.prototype.constructRotationButton=function(t){var r=this,e=document.createElement("button");e.classList.add("azure-maps-control-button"),e.classList.add("rotation"),e.setAttribute("aria-label","Reset to Default Rotation"),e.setAttribute("alt","Reset to Default Rotation"),e.setAttribute("type","button");var o=document.createElement("div");return e.appendChild(o),e.addEventListener("click",function(e){e.timeStamp-r.lastActiveTime>re.activateClickDelay&&t.setCamera({bearing:he.DefaultRotation},!0)}),t.events.add("rotate",function(e){o.style.transform="rotate("+-e.map.getCamera().bearing+"deg)"}),e},he.prototype.constructRightRotationButton=function(e){var t=this,r=document.createElement("button");return r.classList.add("azure-maps-control-button"),r.classList.add("rotation-right"),r.setAttribute("aria-label","Rotate Right"),r.setAttribute("alt","Rotate Right"),r.setAttribute("type","button"),r.addEventListener("click",function(){e.setCamera({bearing:e.getCamera().bearing-(t.options.inverted?-1:1)*t.options.rotationDegreesDelta,duration:he.RotationDuration,type:"ease"},!0)}),r},he.prototype.constructLeftRotationButton=function(e){var t=this,r=document.createElement("button");return r.classList.add("azure-maps-control-button"),r.classList.add("rotation-left"),r.setAttribute("aria-label","Rotate Left"),r.setAttribute("alt","Rotate Left"),r.setAttribute("type","button"),r.addEventListener("click",function(){e.setCamera({bearing:e.getCamera().bearing+(t.options.inverted?-1:1)*t.options.rotationDegreesDelta,duration:he.RotationDuration,type:"ease"},!0)}),r},he.DefaultRotation=0,he.RotationDuration=100,he.InvertOrderPositions=[l.ControlPosition.BottomRight,l.ControlPosition.TopRight],he);function he(e){var t=ue.call(this)||this;return t.hasMouse=!1,t.hasFocus=!1,t.options=(new se).merge(e),t}var pe,de,fe=((window&&window.__extends||(pe=function(e,t){return(pe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}pe(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}))(ge,de=k),ge);function ge(){var e=null!==de&&de.apply(this,arguments)||this;return e.pitchDegreesDelta=10,e.style=l.ControlStyle.light,e.inverted=!1,e}var ye,me,ve=((window&&window.__extends||(ye=function(e,t){return(ye=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}ye(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}))(_e,me=re),_e.prototype.onAdd=function(e,t){var r=this,o=this.buildContainer(e,this.options.style,"Pitch Control"),n=this.constructPitchButton(e),i=this.constructPitchGrid(e,t),s=B("Reset to Default Pitch");return o.addEventListener("mouseover",function(e){r.lastActiveTime=r.lastActiveTime||e.timeStamp,r.hasMouse=!0,o.classList.add("in-use"),i.classList.remove("hidden-accessible-element")}),o.addEventListener("focusin",function(e){r.lastActiveTime=r.lastActiveTime||e.timeStamp,r.hasFocus=!0,o.classList.add("in-use"),i.classList.remove("hidden-accessible-element")}),o.addEventListener("mouseleave",function(){r.hasMouse=!1,r.hasFocus||(delete r.lastActiveTime,o.classList.remove("in-use"),i.classList.add("hidden-accessible-element"))}),o.addEventListener("focusout",function(e){e.relatedTarget instanceof Node&&o.contains(e.relatedTarget)||(r.hasFocus=!1,r.hasMouse||(delete r.lastActiveTime,o.classList.remove("in-use"),i.classList.add("hidden-accessible-element")))}),i.addEventListener("keydown",function(e){"Escape"!==e.key&&"Esc"!==e.key||(e.stopPropagation(),n.focus(),o.classList.remove("in-use"),i.classList.add("hidden-accessible-element"))}),t&&_e.INVERT_ORDER_POSITIONS.includes(t.position)?(o.appendChild(i),o.appendChild(n),o.appendChild(s),z(s,o)):(o.appendChild(n),o.appendChild(s),z(s,o),o.appendChild(i)),this.map=e,this.container=o,this.pitchButton=n,e.events.add("pitch",this.pitchChanged),this.updatePitchButtonsState(),o},_e.prototype.onRemove=function(){this.container&&(this.container.remove(),this.container=null,this.pitchButton=null,this.pitchIncrementButton=null,this.pitchDecrementButton=null),this.map&&(this.map.events.remove("pitch",this.pitchChanged),this.map=null)},_e.prototype.constructPitchGrid=function(e,t){var r=document.createElement("div");r.classList.add("sub-container"),r.classList.add("hidden-accessible-element"),this.pitchIncrementButton=this.constructPitchIncrementButton(e),this.pitchDecrementButton=this.constructPitchDecrementButton(e);var o=B("Increase Pitch"),e=B("Decrease Pitch");return t&&_e.INVERT_ORDER_POSITIONS.includes(t.position)?(r.appendChild(this.pitchDecrementButton),r.appendChild(e),z(e,this.pitchDecrementButton),r.appendChild(this.pitchIncrementButton),r.appendChild(o),z(o,this.pitchIncrementButton)):(r.appendChild(this.pitchIncrementButton),r.appendChild(o),z(o,this.pitchIncrementButton),r.appendChild(this.pitchDecrementButton),r.appendChild(e),z(e,this.pitchDecrementButton)),r},_e.prototype.constructPitchButton=function(e){var t=this,r=document.createElement("button");return r.classList.add("azure-maps-control-button"),r.classList.add("pitch"),r.setAttribute("aria-label","Reset to Default Pitch"),r.setAttribute("alt","Reset to Default Pitch"),r.setAttribute("type","button"),r.addEventListener("click",function(){event.timeStamp-t.lastActiveTime>re.activateClickDelay&&e.setCamera({pitch:_e.DEFAULT_PITCH},!0)}),r},_e.prototype.constructPitchDecrementButton=function(e){var t=this,r=document.createElement("button");return r.classList.add("azure-maps-control-button"),r.classList.add("pitch-down"),r.setAttribute("aria-label","Decrease Pitch"),r.setAttribute("alt","Decrease Pitch"),r.setAttribute("type","button"),r.addEventListener("click",function(){e.setCamera({pitch:e.getCamera().pitch-(t.options.inverted?-1:1)*t.options.pitchDegreesDelta,duration:_e.PITCH_DURATION_MS,type:"ease"},!0)}),r},_e.prototype.constructPitchIncrementButton=function(e){var t=this,r=document.createElement("button");return r.classList.add("azure-maps-control-button"),r.classList.add("pitch-up"),r.setAttribute("aria-label","Increase Pitch"),r.setAttribute("alt","Increase Pitch"),r.setAttribute("type","button"),r.addEventListener("click",function(){e.setCamera({pitch:e.getCamera().pitch+(t.options.inverted?-1:1)*t.options.pitchDegreesDelta,duration:_e.PITCH_DURATION_MS,type:"ease"},!0)}),r},_e.PITCH_DURATION_MS=100,_e.DEFAULT_PITCH=0,_e.INVERT_ORDER_POSITIONS=[l.ControlPosition.BottomRight,l.ControlPosition.TopRight],_e);function _e(e){var r=me.call(this)||this;return r.container=null,r.map=null,r.pitchButton=null,r.pitchIncrementButton=null,r.pitchDecrementButton=null,r.hasMouse=!1,r.hasFocus=!1,r.pitchChanged=function(e){return r.updatePitchButtonsState()},r.updatePitchButtonsState=function(){var e=r.map.getCamera().pitch<=0,t=60<=r.map.getCamera().pitch;r.hasFocus&&r.pitchButton&&(e||t)&&r.pitchButton.focus(),r.options.inverted?(r.pitchIncrementButton&&r.pitchIncrementButton.disabled!=e&&(r.pitchIncrementButton.disabled=e),r.pitchDecrementButton&&r.pitchDecrementButton.disabled!=t&&(r.pitchDecrementButton.disabled=t)):(r.pitchIncrementButton&&r.pitchIncrementButton.disabled!=t&&(r.pitchIncrementButton.disabled=t),r.pitchDecrementButton&&r.pitchDecrementButton.disabled!=e&&(r.pitchDecrementButton.disabled=e))},r.options=(new fe).merge(e),r}var we=function(e,t){return e===t||e!=e&&t!=t};var be=function(e,t){for(var r=e.length;r--;)if(we(e[r][0],t))return r;return-1},Ce=Array.prototype.splice;var Ee=function(e){var t=this.__data__;return!((e=be(t,e))<0)&&(e==t.length-1?t.pop():Ce.call(t,e,1),--this.size,!0)};var Se=function(e){var t=this.__data__;return(e=be(t,e))<0?void 0:t[e][1]};var Te=function(e){return-1<be(this.__data__,e)};var Ie=function(e,t){var r=this.__data__,o=be(r,e);return o<0?(++this.size,r.push([e,t])):r[o][1]=t,this};function Ae(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var o=e[t];this.set(o[0],o[1])}}Ae.prototype.clear=function(){this.__data__=[],this.size=0},Ae.prototype.delete=Ee,Ae.prototype.get=Se,Ae.prototype.has=Te,Ae.prototype.set=Ie;var ke=Ae;var Pe=function(){this.__data__=new ke,this.size=0};var Oe=function(e){var t=this.__data__,e=t.delete(e);return this.size=t.size,e};x=function(e){return this.__data__.get(e)};var Re=function(e){return this.__data__.has(e)},K="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function xe(e,t){return e(t={exports:{}},t.exports),t.exports}var Me="object"==typeof K&&K&&K.Object===Object&&K,Ne="object"==typeof self&&self&&self.Object===Object&&self,Le=Me||Ne||Function("return this")(),Ee=Le.Symbol,Se=Object.prototype,De=Se.hasOwnProperty,qe=Se.toString,Ue=Ee?Ee.toStringTag:void 0;var je=function(e){var t=De.call(e,Ue),r=e[Ue];try{var o=!(e[Ue]=void 0)}catch(e){}var n=qe.call(e);return o&&(t?e[Ue]=r:delete e[Ue]),n},He=Object.prototype.toString;var Be=function(e){return He.call(e)},ze=Ee?Ee.toStringTag:void 0;var Fe=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":(ze&&ze in Object(e)?je:Be)(e)};var Ke=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)};var Ge=function(e){return!!Ke(e)&&("[object Function]"==(e=Fe(e))||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e)},Te=Le["__core-js_shared__"],Ye=(Ie=/[^.]+$/.exec(Te&&Te.keys&&Te.keys.IE_PROTO||""))?"Symbol(src)_1."+Ie:"";var Ze=function(e){return!!Ye&&Ye in e},We=Function.prototype.toString;var Ve=function(e){if(null!=e){try{return We.call(e)}catch(e){}try{return e+""}catch(e){}}return""},Je=/^\[object .+?Constructor\]$/,K=Function.prototype,Ne=Object.prototype,Se=K.toString,Te=Ne.hasOwnProperty,Qe=RegExp("^"+Se.call(Te).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var Xe=function(e){return!(!Ke(e)||Ze(e))&&(Ge(e)?Qe:Je).test(Ve(e))};var $e=function(e,t){return null==e?void 0:e[t]};var et=function(e,t){return t=$e(e,t),Xe(t)?t:void 0},tt=et(Le,"Map"),rt=et(Object,"create");var Ie=function(e){return e=this.has(e)&&delete this.__data__[e],this.size-=e?1:0,e},ot=Object.prototype.hasOwnProperty;var K=function(e){var t=this.__data__;if(rt){var r=t[e];return"__lodash_hash_undefined__"===r?void 0:r}return ot.call(t,e)?t[e]:void 0},nt=Object.prototype.hasOwnProperty;Ne=function(e){var t=this.__data__;return rt?void 0!==t[e]:nt.call(t,e)};Se=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=rt&&void 0===t?"__lodash_hash_undefined__":t,this};function it(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var o=e[t];this.set(o[0],o[1])}}it.prototype.clear=function(){this.__data__=rt?rt(null):{},this.size=0},it.prototype.delete=Ie,it.prototype.get=K,it.prototype.has=Ne,it.prototype.set=Se;var st=it;Te=function(){this.size=0,this.__data__={hash:new st,map:new(tt||ke),string:new st}};var at=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e};var ct=function(e,t){return e=e.__data__,at(t)?e["string"==typeof t?"string":"hash"]:e.map};Ie=function(e){return e=ct(this,e).delete(e),this.size-=e?1:0,e};K=function(e){return ct(this,e).get(e)};Ne=function(e){return ct(this,e).has(e)};Se=function(e,t){var r=ct(this,e),o=r.size;return r.set(e,t),this.size+=r.size==o?0:1,this};function ut(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var o=e[t];this.set(o[0],o[1])}}ut.prototype.clear=Te,ut.prototype.delete=Ie,ut.prototype.get=K,ut.prototype.has=Ne,ut.prototype.set=Se;var lt=ut;Ie=function(e,t){var r=this.__data__;if(r instanceof ke){var o=r.__data__;if(!tt||o.length<199)return o.push([e,t]),this.size=++r.size,this;r=this.__data__=new lt(o)}return r.set(e,t),this.size=r.size,this};function ht(e){e=this.__data__=new ke(e);this.size=e.size}ht.prototype.clear=Pe,ht.prototype.delete=Oe,ht.prototype.get=x,ht.prototype.has=Re,ht.prototype.set=Ie;var pt=ht;var dt=function(e,t){for(var r=-1,o=null==e?0:e.length;++r<o&&!1!==t(e[r],r,e););return e},ft=function(){try{var e=et(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();var gt=function(e,t,r){"__proto__"==t&&ft?ft(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r},yt=Object.prototype.hasOwnProperty;var mt=function(e,t,r){var o=e[t];yt.call(e,t)&&we(o,r)&&(void 0!==r||t in e)||gt(e,t,r)};var vt=function(e,t,r,o){var n=!r;r=r||{};for(var i=-1,s=t.length;++i<s;){var a=t[i],c=o?o(r[a],e[a],a,r,e):void 0;void 0===c&&(c=e[a]),(n?gt:mt)(r,a,c)}return r};var _t=function(e,t){for(var r=-1,o=Array(e);++r<e;)o[r]=t(r);return o};var wt=function(e){return null!=e&&"object"==typeof e};var K=function(e){return wt(e)&&"[object Arguments]"==Fe(e)},Ne=Object.prototype,bt=Ne.hasOwnProperty,Ct=Ne.propertyIsEnumerable,Et=K(function(){return arguments}())?K:function(e){return wt(e)&&bt.call(e,"callee")&&!Ct.call(e,"callee")},St=Array.isArray;function Tt(){return!1}var It=xe(function(e,t){var r=t&&!t.nodeType&&t,t=r&&e&&!e.nodeType&&e,r=t&&t.exports===r?Le.Buffer:void 0,r=r?r.isBuffer:void 0;e.exports=r||Tt}),At=/^(?:0|[1-9]\d*)$/;var kt=function(e,t){var r=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==r||"symbol"!=r&&At.test(e))&&-1<e&&e%1==0&&e<t};var Pt=function(e){return"number"==typeof e&&-1<e&&e%1==0&&e<=9007199254740991},Ot={};Ot["[object Float32Array]"]=Ot["[object Float64Array]"]=Ot["[object Int8Array]"]=Ot["[object Int16Array]"]=Ot["[object Int32Array]"]=Ot["[object Uint8Array]"]=Ot["[object Uint8ClampedArray]"]=Ot["[object Uint16Array]"]=Ot["[object Uint32Array]"]=!0,Ot["[object Arguments]"]=Ot["[object Array]"]=Ot["[object ArrayBuffer]"]=Ot["[object Boolean]"]=Ot["[object DataView]"]=Ot["[object Date]"]=Ot["[object Error]"]=Ot["[object Function]"]=Ot["[object Map]"]=Ot["[object Number]"]=Ot["[object Object]"]=Ot["[object RegExp]"]=Ot["[object Set]"]=Ot["[object String]"]=Ot["[object WeakMap]"]=!1;Se=function(e){return wt(e)&&Pt(e.length)&&!!Ot[Fe(e)]};var Pe=function(t){return function(e){return t(e)}},Oe=xe(function(e,t){var t=t&&!t.nodeType&&t,r=t&&e&&!e.nodeType&&e,o=r&&r.exports===t&&Me.process,t=function(){try{var e=r&&r.require&&r.require("util").types;return e?e:o&&o.binding&&o.binding("util")}catch(e){}}();e.exports=t}),x=Oe&&Oe.isTypedArray,Rt=x?Pe(x):Se,xt=Object.prototype.hasOwnProperty;var Mt=function(e,t){var r,o=St(e),n=!o&&Et(e),i=!o&&!n&&It(e),s=!o&&!n&&!i&&Rt(e),a=o||n||i||s,c=a?_t(e.length,String):[],u=c.length;for(r in e)!t&&!xt.call(e,r)||a&&("length"==r||i&&("offset"==r||"parent"==r)||s&&("buffer"==r||"byteLength"==r||"byteOffset"==r)||kt(r,u))||c.push(r);return c},Nt=Object.prototype;var Lt=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Nt)};var Re=function(t,r){return function(e){return t(r(e))}},Dt=Re(Object.keys,Object),qt=Object.prototype.hasOwnProperty;var Ut=function(e){if(!Lt(e))return Dt(e);var t,r=[];for(t in Object(e))qt.call(e,t)&&"constructor"!=t&&r.push(t);return r};var jt=function(e){return null!=e&&Pt(e.length)&&!Ge(e)};var Ht=function(e){return(jt(e)?Mt:Ut)(e)};var Bt=function(e,t){return e&&vt(t,Ht(t),e)};var zt=function(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t},Ft=Object.prototype.hasOwnProperty;var Kt=function(e){if(!Ke(e))return zt(e);var t,r=Lt(e),o=[];for(t in e)("constructor"!=t||!r&&Ft.call(e,t))&&o.push(t);return o};var Gt=function(e){return jt(e)?Mt(e,!0):Kt(e)};var Yt=function(e,t){return e&&vt(t,Gt(t),e)},Zt=xe(function(e,t){var r=t&&!t.nodeType&&t,t=r&&e&&!e.nodeType&&e,r=t&&t.exports===r?Le.Buffer:void 0,o=r?r.allocUnsafe:void 0;e.exports=function(e,t){return t?e.slice():(t=e.length,t=o?o(t):new e.constructor(t),e.copy(t),t)}});var Wt=function(e,t){var r=-1,o=e.length;for(t=t||Array(o);++r<o;)t[r]=e[r];return t};var Vt=function(e,t){for(var r=-1,o=null==e?0:e.length,n=0,i=[];++r<o;){var s=e[r];t(s,r,e)&&(i[n++]=s)}return i};var Ie=function(){return[]},Jt=Object.prototype.propertyIsEnumerable,Qt=Object.getOwnPropertySymbols,Xt=Qt?function(t){return null==t?[]:(t=Object(t),Vt(Qt(t),function(e){return Jt.call(t,e)}))}:Ie;var $t=function(e,t){return vt(e,Xt(e),t)};var er=function(e,t){for(var r=-1,o=t.length,n=e.length;++r<o;)e[n+r]=t[r];return e},tr=Re(Object.getPrototypeOf,Object),rr=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)er(t,Xt(e)),e=tr(e);return t}:Ie;var or=function(e,t){return vt(e,rr(e),t)};var nr=function(e,t,r){return t=t(e),St(e)?t:er(t,r(e))};var ir=function(e){return nr(e,Ht,Xt)};function sr(e){return nr(e,Gt,rr)}var Ne=et(Le,"DataView"),K=et(Le,"Promise"),x=et(Le,"Set"),Se=et(Le,"WeakMap"),ar="[object Map]",cr="[object Promise]",ur="[object Set]",lr="[object WeakMap]",hr="[object DataView]",pr=Ve(Ne),dr=Ve(tt),fr=Ve(K),gr=Ve(x),yr=Ve(Se),Re=Fe,mr=Re=Ne&&Re(new Ne(new ArrayBuffer(1)))!=hr||tt&&Re(new tt)!=ar||K&&Re(K.resolve())!=cr||x&&Re(new x)!=ur||Se&&Re(new Se)!=lr?function(e){var t=Fe(e),e="[object Object]"==t?e.constructor:void 0,e=e?Ve(e):"";if(e)switch(e){case pr:return hr;case dr:return ar;case fr:return cr;case gr:return ur;case yr:return lr}return t}:Re,vr=Object.prototype.hasOwnProperty;var _r=function(e){var t=e.length,r=new e.constructor(t);return t&&"string"==typeof e[0]&&vr.call(e,"index")&&(r.index=e.index,r.input=e.input),r},wr=Le.Uint8Array;var br=function(e){var t=new e.constructor(e.byteLength);return new wr(t).set(new wr(e)),t};var Cr=function(e,t){return t=t?br(e.buffer):e.buffer,new e.constructor(t,e.byteOffset,e.byteLength)},Er=/\w*$/;var Sr=function(e){var t=new e.constructor(e.source,Er.exec(e));return t.lastIndex=e.lastIndex,t},Ie=Ee?Ee.prototype:void 0,Tr=Ie?Ie.valueOf:void 0;var Ir=function(e){return Tr?Object(Tr.call(e)):{}};var Ar=function(e,t){return t=t?br(e.buffer):e.buffer,new e.constructor(t,e.byteOffset,e.length)};var kr=function(e,t,r){var o=e.constructor;switch(t){case"[object ArrayBuffer]":return br(e);case"[object Boolean]":case"[object Date]":return new o(+e);case"[object DataView]":return Cr(e,r);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 Ar(e,r);case"[object Map]":return new o;case"[object Number]":case"[object String]":return new o(e);case"[object RegExp]":return Sr(e);case"[object Set]":return new o;case"[object Symbol]":return Ir(e)}},Pr=Object.create;function Or(){}var Rr=function(e){if(!Ke(e))return{};if(Pr)return Pr(e);Or.prototype=e;e=new Or;return Or.prototype=void 0,e};var xr=function(e){return"function"!=typeof e.constructor||Lt(e)?{}:Rr(tr(e))};var Ne=function(e){return wt(e)&&"[object Map]"==mr(e)},K=Oe&&Oe.isMap,Mr=K?Pe(K):Ne;var x=function(e){return wt(e)&&"[object Set]"==mr(e)},Se=Oe&&Oe.isSet,Nr=Se?Pe(Se):x,Lr="[object Arguments]",Dr="[object Function]",qr="[object Object]",Ur={};Ur[Lr]=Ur["[object Array]"]=Ur["[object ArrayBuffer]"]=Ur["[object DataView]"]=Ur["[object Boolean]"]=Ur["[object Date]"]=Ur["[object Float32Array]"]=Ur["[object Float64Array]"]=Ur["[object Int8Array]"]=Ur["[object Int16Array]"]=Ur["[object Int32Array]"]=Ur["[object Map]"]=Ur["[object Number]"]=Ur[qr]=Ur["[object RegExp]"]=Ur["[object Set]"]=Ur["[object String]"]=Ur["[object Symbol]"]=Ur["[object Uint8Array]"]=Ur["[object Uint8ClampedArray]"]=Ur["[object Uint16Array]"]=Ur["[object Uint32Array]"]=!0,Ur["[object Error]"]=Ur[Dr]=Ur["[object WeakMap]"]=!1;var jr=function r(o,n,i,e,t,s){var a,c=1&n,u=2&n,l=4&n;if(void 0!==(a=i?t?i(o,e,t,s):i(o):a))return a;if(!Ke(o))return o;var h=St(o);if(h){if(a=_r(o),!c)return Wt(o,a)}else{var p=mr(o),e=p==Dr||"[object GeneratorFunction]"==p;if(It(o))return Zt(o,c);if(p==qr||p==Lr||e&&!t){if(a=u||e?{}:xr(o),!c)return u?or(o,Yt(a,o)):$t(o,Bt(a,o))}else{if(!Ur[p])return t?o:{};a=kr(o,p,c)}}c=(s=s||new pt).get(o);if(c)return c;s.set(o,a),Nr(o)?o.forEach(function(e){a.add(r(e,n,i,e,o,s))}):Mr(o)&&o.forEach(function(e,t){a.set(t,r(e,n,i,t,o,s))});var d=h?void 0:(l?u?sr:ir:u?Gt:Ht)(o);return dt(d||o,function(e,t){d&&(e=o[t=e]),mt(a,t,r(e,n,i,t,o,s))}),a};var Hr=function(e){return jr(e,5)};var Br=function(e,t,r){(void 0===r||we(e[t],r))&&(void 0!==r||t in e)||gt(e,t,r)};var zr=function(c){return function(e,t,r){for(var o=-1,n=Object(e),i=r(e),s=i.length;s--;){var a=i[c?s:++o];if(!1===t(n[a],a,n))break}return e}}();var Fr=function(e){return wt(e)&&jt(e)},Re=Function.prototype,Ie=Object.prototype,Kr=Re.toString,Gr=Ie.hasOwnProperty,Yr=Kr.call(Object);var Zr=function(e){return!(!wt(e)||"[object Object]"!=Fe(e))&&(null===(e=tr(e))||"function"==typeof(e=Gr.call(e,"constructor")&&e.constructor)&&e instanceof e&&Kr.call(e)==Yr)};var Wr=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]};var Vr=function(e){return vt(e,Gt(e))};var Jr=function(e,t,r,o,n,i,s){var a,c,u,l=Wr(e,r),h=Wr(t,r),p=s.get(h);p?Br(e,r,p):((a=void 0===(u=i?i(l,h,r+"",e,t,s):void 0))&&(p=!(c=St(h))&&It(h),t=!c&&!p&&Rt(h),u=h,c||p||t?u=St(l)?l:Fr(l)?Wt(l):p?Zt(h,!(a=!1)):t?Ar(h,!(a=!1)):[]:Zr(h)||Et(h)?Et(u=l)?u=Vr(l):Ke(l)&&!Ge(l)||(u=xr(h)):a=!1),a&&(s.set(h,u),n(u,h,o,i,s),s.delete(h)),Br(e,r,u))};var Qr=function o(n,i,s,a,c){n!==i&&zr(i,function(e,t){var r;c=c||new pt,Ke(e)?Jr(n,i,t,s,o,a,c):(r=a?a(Wr(n,t),e,t+"",n,i,c):void 0,Br(n,t,r=void 0===r?e:r))},Gt)};function Xr(e){return e}var $r=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)},eo=Math.max;var to=function(i,s,a){return s=eo(void 0===s?i.length-1:s,0),function(){for(var e=arguments,t=-1,r=eo(e.length-s,0),o=Array(r);++t<r;)o[t]=e[s+t];for(var t=-1,n=Array(s+1);++t<s;)n[t]=e[t];return n[s]=a(o),$r(i,this,n)}};var ro=function(e){return function(){return e}},oo=Date.now;var no=function(r){var o=0,n=0;return function(){var e=oo(),t=16-(e-n);if(n=e,0<t){if(800<=++o)return arguments[0]}else o=0;return r.apply(void 0,arguments)}}(ft?function(e,t){return ft(e,"toString",{configurable:!0,enumerable:!1,value:ro(t),writable:!0})}:Xr);var io=function(e,t){return no(to(e,t,Xr),e+"")};var so=function(e,t,r){if(!Ke(r))return!1;var o=typeof t;return!!("number"==o?jt(r)&&kt(t,r.length):"string"==o&&t in r)&&we(r[t],e)};var ao,co,uo=function(a){return io(function(e,t){var r=-1,o=t.length,n=1<o?t[o-1]:void 0,i=2<o?t[2]:void 0,n=3<a.length&&"function"==typeof n?(o--,n):void 0;for(i&&so(t[0],t[1],i)&&(n=o<3?void 0:n,o=1),e=Object(e);++r<o;){var s=t[r];s&&a(e,s,r,n)}return e})}(function(e,t,r){Qr(e,t,r)}),lo=((window&&window.__extends||(ao=function(e,t){return(ao=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}ao(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}))(ho,co=k),ho);function ho(){var e=null!==co&&co.apply(this,arguments)||this;return e.layout="icons",e.mapStyles=["road","grayscale_light","grayscale_dark","night","road_shaded_relief"],e.style=l.ControlStyle.light,e.autoSelectionMode=!0,e}var po,fo,K=window&&window.__extends||(po=function(e,t){return(po=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}po(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),go=window&&window.__awaiter||function(e,s,a,c){return new(a=a||Promise)(function(r,t){function o(e){try{i(c.next(e))}catch(e){t(e)}}function n(e){try{i(c.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(o,n)}i((c=c.apply(e,s||[])).next())})},yo=window&&window.__generator||function(r,o){var n,i,s,a={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(t){return function(e){return function(t){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(s=2&t[0]?i.return:t[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,t[1])).done)return s;switch(i=0,(t=s?[2&t[0],s.value]:t)[0]){case 0:case 1:s=t;break;case 4:return a.label++,{value:t[1],done:!1};case 5:a.label++,i=t[1],t=[0];continue;case 7:t=a.ops.pop(),a.trys.pop();continue;default:if(!(s=0<(s=a.trys).length&&s[s.length-1])&&(6===t[0]||2===t[0])){a=0;continue}if(3===t[0]&&(!s||t[1]>s[0]&&t[1]<s[3])){a.label=t[1];break}if(6===t[0]&&a.label<s[1]){a.label=s[1],s=t;break}if(s&&a.label<s[2]){a.label=s[2],a.ops.push(t);break}s[2]&&a.ops.pop(),a.trys.pop();continue}t=o.call(r,a)}catch(e){t=[6,e],i=0}finally{n=s=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}([t,e])}}},mo=window&&window.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var o,n,i=r.call(e),s=[];try{for(;(void 0===t||0<t--)&&!(o=i.next()).done;)s.push(o.value)}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return s},Ne=(K(vo,fo=re),vo.prototype.onAdd=function(e,t){var r=this;this.map=e;var o=this.buildContainer(e,this.options.style,"Map Style Control"),n=this.buildStyleOpsGrid();this.styleOpsGrid=n;var i=this.buildCurrStyleBtn(),e=B("Select Style");return n.classList.add(t&&t.position||"top-right"),o.addEventListener("mouseover",function(){r.hasMouse=!0,o.classList.add(vo.Css.inUse),n.classList.remove("hidden-accessible-element")}),o.addEventListener("focusin",function(){r.hasFocus=!0,o.classList.add(vo.Css.inUse),n.classList.remove("hidden-accessible-element")}),o.addEventListener("mouseleave",function(){r.hasMouse=!1,r.hasFocus||(o.classList.remove(vo.Css.inUse),n.classList.add("hidden-accessible-element"))}),o.addEventListener("focusout",function(e){e.target===i&&Array.from(n.children).forEach(function(e){return e.removeAttribute("tabIndex")}),e.relatedTarget instanceof Node&&o.contains(e.relatedTarget)||(r.hasFocus=!1,r.hasMouse||(o.classList.remove(vo.Css.inUse),n.classList.add("hidden-accessible-element")))}),n.addEventListener("keydown",function(e){27===e.keyCode&&(e.stopPropagation(),i.focus(),Array.from(n.children).forEach(function(e){return e.setAttribute("tabIndex","-1")}),o.classList.contains(vo.Css.inUse)&&(o.classList.remove(vo.Css.inUse),n.classList.add("hidden-accessible-element")))}),i.addEventListener("click",function(e){o.classList.contains(vo.Css.inUse)?(o.classList.remove(vo.Css.inUse),n.classList.add("hidden-accessible-element")):(o.classList.add(vo.Css.inUse),n.classList.remove("hidden-accessible-element"),n.firstElementChild&&n.firstElementChild.focus())}),t&&vo.InvertOrderPositions.includes(t.position)?(o.appendChild(n),o.appendChild(i),o.appendChild(e),z(e,i)):(o.appendChild(i),o.appendChild(e),z(e,i),o.appendChild(n)),o},vo.prototype.onRemove=function(){fo.prototype.onRemove.call(this),this.styleOpsGrid=null,this.styleButtons.clear(),this.map.events.remove("stylechanged",this.onStyleChange),this.map.events.remove("mapconfigurationchanged",this.onMapConfigurationChange)},vo.prototype.setSelectedStyle=function(r){var t,e,o=this;this.styleIcons.has(r)&&(t=this.currStyleImage,e=this.styleIcons.get(r),t.src!==e&&(t.src=e),Object.entries(this.styleButtons).forEach(function(e){var t=mo(e,2),e=t[0];return t[1].setAttribute("aria-current",e===r?"true":"false")}),this.map.styles.definitions().then(function(e){e=o.mapToFriendlyStyleName(r,e);t.alt!==e&&(t.alt=e),t.parentElement.lastChild instanceof Text&&(t.parentElement.lastChild.textContent=e)}))},vo.prototype.disableStyle=function(e){e=this.styleButtons[e];e&&e.setAttribute("disabled","true")},vo.prototype.enableStyle=function(e){e=this.styleButtons[e];e&&e.removeAttribute("disabled")},vo.prototype.buildSelectStyleBtn=function(r,e,t){var o=this,n=document.createElement("button"),i=this.mapToFriendlyStyleName(r,e);n.setAttribute("aria-label",i),n.setAttribute("type","button");var s=new Image;t.then(function(e){return e.blob()}).then(function(e){e=URL.createObjectURL(e);s.src=e,r===o.map.getStyle().style&&(o.currStyleImage.src=e,o.currStyleImage.alt=i,o.currStyleImage.parentElement.lastChild.nodeType==Node.TEXT_NODE?o.currStyleImage.parentElement.lastChild.textContent=i:o.currStyleImage.parentElement.appendChild(document.createTextNode(i))),o.styleIcons.set(r,e)}),s.setAttribute("aria-hidden","true"),n.appendChild(s),"icons"===this.options.layout?n.classList.add(vo.Css.button):(n.classList.add(vo.Css.listButton),n.classList.add(vo.Css.expanded),n.appendChild(document.createTextNode(i))),n.addEventListener("click",function(){o.hasMouse=!1,o.hasFocus=!1;var e=o.styleButtons[r];e&&!e.hasAttribute("disabled")&&(o._invokeEvent("styleselected",r),o.options.autoSelectionMode&&o.map.setStyle({style:r}),Object.entries(o.styleButtons).forEach(function(e){var t=mo(e,2),e=t[0];return t[1].setAttribute("aria-current",e===r?"true":"false")}))});t=document.createElement("div");return t.classList.add("selected-icon"),n.appendChild(t),n},vo.prototype.buildCurrStyleBtn=function(){var e=document.createElement("button");"icons"==this.options.layout?e.classList.add(vo.Css.button):e.classList.add(vo.Css.listButton),e.classList.add(vo.Css.currentStyle),e.setAttribute("aria-label","Select Style"),e.setAttribute("tabindex","-1"),this.currStyleImage=new Image,e.appendChild(this.currStyleImage);var t=document.createElement("div");return t.classList.add("icon"),e.appendChild(t),e},vo.prototype.buildStyleOpsGrid=function(){var e=this,t=document.createElement("div");return t.classList.add(vo.Css.styleOptions),"icons"===this.options.layout?t.classList.add(this.options.layout):t.classList.add(vo.Css.dropdown),t.setAttribute("aria-label","Style Options"),t.classList.add("hidden-accessible-element"),this.map.styles.definitions().then(function(t){return go(e,void 0,void 0,function(){return yo(this,function(e){return this.onMapConfigurationChange(t),this.map.events.add("stylechanged",this.onStyleChange),[2]})})}),this.map.events.add("mapconfigurationchanged",this.onMapConfigurationChange),t},vo.prototype.populateOpsGridFromDefinitions=function(o){var e,r,n=this;this.styleOpsGrid&&(e=o.configurations,(e=Array.isArray(this.options.mapStyles)?e.filter(function(e){return n.options.mapStyles.includes(e.name.split("_indoor")[0])}):e).forEach(function(e){var t={url:e.thumbnail};e.thumbnail&&n.map.styles._transformStyleRequest(e.thumbnail,t);var r=n.map.getServiceOptions();r.transformRequest&&uo(t,r.transformRequest(t.url,"Thumbnail"));t=fetch(t.url,{headers:t.headers}),t=n.buildSelectStyleBtn(e.name,o,t);n.styleOpsGrid.appendChild(t),n.styleButtons[e.name]=t,"icons"===n.options.layout&&(e=B(n.mapToFriendlyStyleName(e.name,o)),n.styleOpsGrid.appendChild(e),z(e,t))}),r=this.map.getStyle().style,Object.entries(this.styleButtons).forEach(function(e){var t=mo(e,2),e=t[0];return t[1].setAttribute("aria-current",e===r?"true":"false")}))},vo.InvertOrderPositions=[l.ControlPosition.TopRight,l.ControlPosition.BottomRight],vo.Css={button:"azure-maps-control-button",listButton:"azure-maps-control-list-button",expanded:"expanded",currentStyle:"curr-style",inUse:"in-use",styleOptions:"style-options",dropdown:"azure-maps-control-dropdown"},vo);function vo(e){var t=fo.call(this)||this;return t.styleOpsGrid=null,t.hasMouse=!1,t.hasFocus=!1,t.styleButtons=new J,t.styleIcons=new J,t.onStyleChange=function(){var e;t.options.autoSelectionMode&&(e=t.map.getStyle().style,t.setSelectedStyle(e))},t.onMapConfigurationChange=function(e){t.styleOpsGrid&&(Array.from(t.styleOpsGrid.children).forEach(function(e){return e.remove()}),t.styleButtons.clear(),t.populateOpsGridFromDefinitions(e))},t.mapToFriendlyStyleName=function(t,e){e=e.configurations.find(function(e){return e.name===t});return(null==e?void 0:e.displayName)||t},t.options=(new lo).merge(Hr(e)),t}var _o,wo,bo=((window&&window.__extends||(_o=function(e,t){return(_o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}_o(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}))(Co,wo=k),Co);function Co(){var e=null!==wo&&wo.apply(this,arguments)||this;return e.flow="none",e.incidents=!1,e}var Eo,So,To=((window&&window.__extends||(Eo=function(e,t){return(Eo=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Eo(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}))(Io,So=bo),Io);function Io(){var e=null!==So&&So.apply(this,arguments)||this;return e.isActive=!1,e.style=l.ControlStyle.light,e}var Ao,ko,Po=((window&&window.__extends||(Ao=function(e,t){return(Ao=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Ao(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}))(Oo,ko=re),Object.defineProperty(Oo.prototype,"isActive",{get:function(){if(!this.map)return!1;var e=this.map.getTraffic();return"none"!==e.flow||e.incidents},set:function(e){this.map&&this.map.setTraffic({flow:e?this.options.flow:"none",incidents:!!e&&this.options.incidents})},enumerable:!1,configurable:!0}),Oo.prototype.onAdd=function(e){(this.map=e).getTraffic();void 0!==this.initIsActive&&(this.isActive=this.initIsActive),this.container=this.buildContainer(e,this.style,"Traffic Control"),this.container.style.flexDirection="column";var t=this.constructTrafficButton(e);this.container.appendChild(t);e=B("Toggle Traffic Display");return this.container.appendChild(e),z(e,t),this.container},Oo.prototype.onRemove=function(){ko.prototype.onRemove.call(this),this.map=null},Oo.prototype.getOptions=function(){return(new To).merge({isActive:this.isActive,flow:this.options.flow,incidents:this.options.incidents,style:this.style})},Oo.prototype.updateButtonState=function(){this.trafficButton&&(this.isActive?this.container.classList.add("in-use"):this.container.classList.remove("in-use"),this.trafficButton.setAttribute("aria-pressed",this.isActive?"true":"false"))},Oo.prototype.constructTrafficButton=function(e){var t=this,r=document.createElement("button");return r.classList.add("azure-maps-control-button"),r.classList.add("traffic"),r.setAttribute("aria-label","Toggle Traffic Display"),r.setAttribute("alt","Toggle Traffic Display"),r.setAttribute("type","button"),this.trafficButton=r,this.updateButtonState(),r.addEventListener("click",function(){t.isActive=!t.isActive}),r},Oo);function Oo(e){var t,r=ko.call(this)||this;return r.hasMouse=!1,r.hasFocus=!1,r.options=(new bo).merge({flow:"relative",incidents:!0}),r.style=l.ControlStyle.light,r.container=null,r.trafficButton=null,r.map=null,e&&(r.initIsActive=null!==(t=e.isActive)&&void 0!==t&&t,r.options.flow=e.flow||"relative",r.options.incidents=null===(t=e.incidents)||void 0===t||t,r.style=e.style||l.ControlStyle.light),r}var Ro,xo,Oe=window&&window.__extends||(Ro=function(e,t){return(Ro=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Ro(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),Mo=window&&window.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],o=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&o>=e.length?void 0:e)&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Pe=(Oe(No,xo=re),No.prototype.onAdd=function(e){this.map=e;var t=this.buildContainer(e,l.ControlStyle.auto,"Traffic Legend"),e=this.buildTrafficLegendDiv(e);return t.setAttribute("role","definition"),t.appendChild(e),t},No.prototype.onRemove=function(){xo.prototype.onRemove.call(this),this.syncHiddenState&&(this.map.events.remove("styledata",this.syncHiddenState),this.syncHiddenState=null),this.map=null},No.prototype.buildTrafficLegendDiv=function(t){var r,e,o,n,i=document.createElement("div");i.classList.add("traffic-legend","hidden"),i.setAttribute("alt","Traffic Legend");var s=document.createElement("table"),a=document.createElement("tr"),c=document.createElement("td");c.setAttribute("alt","Traffic"),c.appendChild(document.createTextNode("Traffic"));var u=B("Traffic");c.classList.add("traffic-legend-title"),c.colSpan=6,a.appendChild(c),a.appendChild(u),z(u,c),s.appendChild(a);var l=document.createElement("tr");try{for(var h=Mo(this.table),p=h.next();!p.done;p=h.next()){var d=p.value,f=document.createElement("td");if("Fast"===d||"Slow"===d)f.setAttribute("alt",d),f.appendChild(document.createTextNode(d)),f.classList.add("traffic-legend-text");else{f.classList.add("traffic-legend-colors"),f.setAttribute("aria-label","Traffic Legend"),f.setAttribute("role","img");try{for(var g=(o=void 0,Mo(d)),y=g.next();!y.done;y=g.next()){var m=y.value,v=document.createElement("div");v.classList.add(m),f.appendChild(v)}}catch(e){o={error:e}}finally{try{y&&!y.done&&(n=g.return)&&n.call(g)}finally{if(o)throw o.error}}}l.appendChild(f);var _=B(d instanceof Array?"Traffic Legend":d);l.appendChild(_),z(_,f)}}catch(e){r={error:e}}finally{try{p&&!p.done&&(e=h.return)&&e.call(h)}finally{if(r)throw r.error}}return s.appendChild(l),i.appendChild(s),this.syncHiddenState=function(e){"style"===e.dataType&&((e=t.getTraffic()).flow&&"none"!==e.flow?i.classList.remove("hidden"):i.classList.add("hidden"))},this.syncHiddenState({dataType:"style"}),t.events.add("styledata",this.syncHiddenState),i},No);function No(){var e=xo.call(this)||this;return e.table=["Fast",["green","yellow","red","dark-red"],"Slow"],e.map=null,e.syncHiddenState=null,e}Se=function(e){return this.__data__.has(e)};function Lo(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new lt;++t<r;)this.add(e[t])}Lo.prototype.add=Lo.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},Lo.prototype.has=Se;var Do=Lo;var qo=function(e,t){for(var r=-1,o=null==e?0:e.length;++r<o;)if(t(e[r],r,e))return!0;return!1};var Uo=function(e,t){return e.has(t)};var jo=function(e,t,r,o,n,i){var s=1&r,a=e.length,c=t.length;if(a!=c&&!(s&&a<c))return!1;var u=i.get(e),c=i.get(t);if(u&&c)return u==t&&c==e;var l=-1,h=!0,p=2&r?new Do:void 0;for(i.set(e,t),i.set(t,e);++l<a;){var d,f=e[l],g=t[l];if(void 0!==(d=o?s?o(g,f,l,t,e,i):o(f,g,l,e,t,i):d)){if(d)continue;h=!1;break}if(p){if(!qo(t,function(e,t){if(!Uo(p,t)&&(f===e||n(f,e,r,o,i)))return p.push(t)})){h=!1;break}}else if(f!==g&&!n(f,g,r,o,i)){h=!1;break}}return i.delete(e),i.delete(t),h};function Ho(e){var r=-1,o=Array(e.size);return e.forEach(function(e,t){o[++r]=[t,e]}),o}function Bo(e){var t=-1,r=Array(e.size);return e.forEach(function(e){r[++t]=e}),r}var x=Ee?Ee.prototype:void 0,zo=x?x.valueOf:void 0;var Fo=function(e,t,r,o,n,i,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&&i(new wr(e),new wr(t))?!0:!1;case"[object Boolean]":case"[object Date]":case"[object Number]":return we(+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 a=Ho;case"[object Set]":a=a||Bo;if(e.size!=t.size&&!(1&o))return!1;var c=s.get(e);if(c)return c==t;o|=2,s.set(e,t);a=jo(a(e),a(t),o,n,i,s);return s.delete(e),a;case"[object Symbol]":if(zo)return zo.call(e)==zo.call(t)}return!1},Ko=Object.prototype.hasOwnProperty;var Go=function(e,t,r,o,n,i){var s=1&r,a=ir(e),c=a.length;if(c!=ir(t).length&&!s)return!1;for(var u=c;u--;){var l=a[u];if(!(s?l in t:Ko.call(t,l)))return!1}var h=i.get(e),p=i.get(t);if(h&&p)return h==t&&p==e;var d=!0;i.set(e,t),i.set(t,e);for(var f=s;++u<c;){var g,y=e[l=a[u]],m=t[l];if(!(void 0===(g=o?s?o(m,y,l,t,e,i):o(y,m,l,e,t,i):g)?y===m||n(y,m,r,o,i):g)){d=!1;break}f=f||"constructor"==l}return!d||f||(h=e.constructor)!=(p=t.constructor)&&"constructor"in e&&"constructor"in t&&!("function"==typeof h&&h instanceof h&&"function"==typeof p&&p instanceof p)&&(d=!1),i.delete(e),i.delete(t),d},Yo="[object Arguments]",Zo="[object Array]",Wo="[object Object]",Vo=Object.prototype.hasOwnProperty;var Jo=function(e,t,r,o,n,i){var s=St(e),a=St(t),c=s?Zo:mr(e),u=a?Zo:mr(t),l=(c=c==Yo?Wo:c)==Wo,a=(u=u==Yo?Wo:u)==Wo;if((u=c==u)&&It(e)){if(!It(t))return!1;l=!(s=!0)}if(u&&!l)return i=i||new pt,s||Rt(e)?jo(e,t,r,o,n,i):Fo(e,t,c,r,o,n,i);if(!(1&r)){l=l&&Vo.call(e,"__wrapped__"),a=a&&Vo.call(t,"__wrapped__");if(l||a)return n(l?e.value():e,a?t.value():t,r,o,i=i||new pt)}return!!u&&(i=i||new pt,Go(e,t,r,o,n,i))};var Qo=function e(t,r,o,n,i){return t===r||(null==t||null==r||!wt(t)&&!wt(r)?t!=t&&r!=r:Jo(t,r,o,n,e,i))};var Xo,$o=function(e,t){return Qo(e,t)},en=(Xo=Object.freeze({__proto__:null,default:{}}))&&Xo.default||Xo,tn=xe(function(a){!function(){for(var t,r,o=0,n=[],e=0;e<256;e++)n[e]=(e+256).toString(16).substr(1);function i(){var e,e=(e=16,(!t||s.BUFFER_SIZE<o+e)&&(o=0,t=s.randomBytes(s.BUFFER_SIZE)),t.slice(o,o+=e));return e[6]=15&e[6]|64,e[8]=63&e[8]|128,e}function s(){var e=i();return n[e[0]]+n[e[1]]+n[e[2]]+n[e[3]]+"-"+n[e[4]]+n[e[5]]+"-"+n[e[6]]+n[e[7]]+"-"+n[e[8]]+n[e[9]]+"-"+n[e[10]]+n[e[11]]+n[e[12]]+n[e[13]]+n[e[14]]+n[e[15]]}s.BUFFER_SIZE=4096,s.bin=i,s.clearBuffer=function(){t=null,o=0},s.test=function(e){return"string"==typeof e&&/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(e)},"undefined"!=typeof crypto?r=crypto:"undefined"!=typeof window&&void 0!==window.msCrypto&&(r=window.msCrypto),r=r||en,(a.exports=s).randomBytes=function(){if(r){if(r.randomBytes)return r.randomBytes;if(r.getRandomValues)return"function"!=typeof Uint8Array.prototype.slice?function(e){e=new Uint8Array(e);return r.getRandomValues(e),Array.from(e)}:function(e){e=new Uint8Array(e);return r.getRandomValues(e),e}}return function(e){for(var t=[],r=0;r<e;r++)t.push(Math.floor(256*Math.random()));return t}}()}()}),rn=(on.TYPE="Feature",on);function on(e,t,r,o){this.type="Feature",this.type=on.TYPE,this.properties=t||{},this.id=r,this.geometry=e,this.bbox=o}var nn,sn,Re=window&&window.__extends||(nn=function(e,t){return(nn=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}nn(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),an=(sn=Array,Re(cn,sn),cn.fromData=function(r){var o=NaN,n=NaN,i=new Set(["y"]),s=new Set(["x"]);return Object.keys(r).forEach(function(e){var t=e.toLowerCase();isNaN(o)&&i.has(t)&&"number"==typeof r[e]?o=r[e]:isNaN(n)&&s.has(t)&&"number"==typeof r[e]&&(n=r[e])}),isNaN(o)||isNaN(n)?null:new cn(o,n)},cn.getX=function(e){return 0<e.length?e[0]:NaN},cn.getY=function(e){return 1<e.length?e[1]:NaN},cn.getDestination=function(e,t,r){return new cn(cn.getX(e)+r*Math.cos((t+270)*Math.PI/180),cn.getY(e)+r*Math.sin((t+270)*Math.PI/180))},cn.getDistance=function(e,t){var r=cn.getX(e)-cn.getX(t),t=cn.getY(e)-cn.getY(t);return Math.sqrt(r*r+t*t)},cn.getHeading=function(e,t){var r=cn.getX(t)-cn.getX(e),t=cn.getY(e)-cn.getY(t);return 180*(2.5*Math.PI-Math.atan2(t,r))/Math.PI%360},cn);function cn(e,t){return sn.call(this,e,t)||this}var un=(ln.TYPE="Point",ln);function ln(e){this.type="Point",this.type=ln.TYPE,this.coordinates=e}var hn,pn,dn,fn,gn,yn=window&&window.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var o,n,i=r.call(e),s=[];try{for(;(void 0===t||0<t--)&&!(o=i.next()).done;)s.push(o.value)}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return s},mn=window&&window.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],o=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&o>=e.length?void 0:e)&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},vn=6378137,_n=Math.PI/180,wn=180/Math.PI,bn=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9],Cn=85.0511;function En(e){return e*_n}function Sn(e){return e*wn}function Tn(e,t,r){return Math.min(Math.max(e,t),r)}function In(e,t){var r=En(t[1]-e[1]),o=En(t[0]-e[0]),o=Math.pow(Math.sin(r/2),2)+Math.cos(En(e[1]))*Math.cos(En(t[1]))*Math.pow(Math.sin(o/2),2),o=2*Math.atan2(Math.sqrt(o),Math.sqrt(1-o));return Math.round(vn*o*100)/100}function An(e){if(e)switch(e.toLowerCase()){case"feet":case"foot":case"ft":return pn.feet;case"kilometers":case"kilometer":case"kilometres":case"kilometre":case"km":case"kms":return pn.kilometers;case"miles":case"mile":case"mi":return pn.miles;case"nauticalmiles":case"nauticalmile":case"nms":case"nm":return pn.nauticalMiles;case"yards":case"yard":case"yds":case"yrd":case"yrds":return pn.yards;default:return pn.meters}return pn.meters}function kn(e){if(e)switch(e.toLowerCase()){case"milespersecondsquared":case"milepersecondsquared":case"mi/s^2":case"mi/s2":return gn.milesPerSecondSquared;case"kilometerspersecondsquared":case"kilometrespersecondsquared":case"kilometerpersecondsquared":case"kilometrepersecondsquared":case"km/s^2":case"km/s2":return gn.kilometersPerSecondSquared;case"knotspersecond":case"knotpersecond":case"knts/s":case"kn/s":case"kt/s":return gn.knotsPerSecond;case"standardgravity":case"g":return gn.standardGravity;case"feetpersecondsquared":case"footpersecondsquared":case"ft/s^2":case"ft/s2":return gn.feetPerSecondSquared;case"yardspersecondsquared":case"yardpersecondsquared":case"yds/s^2":case"yds/s2":case"yd/s^2":case"yd/s2":return gn.yardsPerSecondSquared;case"milesperhoursecond":case"mileperhoursecond":case"milesperhourseconds":case"mileperhourseconds":case"mi/h/s":return gn.milesPerHourSecond;case"kilometersperhoursecond":case"kilometrespersoursecond":case"kilometerperhoursecond":case"kilometrepersoursecond":case"kilometersperhourssecond":case"kilometrespersourssecond":case"kilometerperhourssecond":case"kilometrepersourssecond":case"kmhs":case"km/h/s":return gn.kilometersPerHourSecond;default:return gn.metersPerSecondSquared}return gn.metersPerSecondSquared}function Pn(e){if(e)switch(e){case"acres":case"ac":return hn.acres;case"hectares":case"ha":return hn.hectares;case"squareFeet":case"ft^2":case"ft2":return hn.squareFeet;case"squareYards":case"squareYard":case"yds^2":case"yds2":case"yd^2":case"yd2":return hn.squareYards;case"squareKilometers":case"squareKilometres":case"squareKilometer":case"squareKilometre":case"km^2":case"km2":return hn.squareKilometers;case"squareMiles":case"squareMile":case"mi^2":case"mi2":return hn.squareMiles;default:return hn.squareMeters}return hn.squareMeters}function On(e){if(e)switch(e.toLowerCase()){case"feetpersecond":case"footsecond":case"ftps":case"ft/s":return fn.feetPerSecond;case"milesperhour":case"mileperhour":case"mph":case"mi/hr":case"mi/h":return fn.milesPerHour;case"knots":case"knot":case"knts":case"knt":case"kn":case"kt":return fn.knots;case"mach":case"m":return fn.mach;case"kilometersperhour":case"kilometresperhour":case"kmperhour":case"kmph":case"km/hr":case"km/h":return fn.kilometersPerHour;default:return fn.metersPerSecond}return fn.metersPerSecond}function Rn(e){if(e)switch(e.toLowerCase()){case"milliseconds":case"ms":return dn.ms;case"minutes":case"minute":case"mins":case"min":return dn.minutes;case"hours":case"hour":case"hr":case"h":return dn.hours;case"days":case"day":case"d":return dn.days;default:return dn.seconds}return dn.seconds}function xn(e){var t=0;if(e&&0<e.length)for(var t=Math.abs(Mn(e[0])),r=1,o=e.length;r<o;r++)t-=Math.abs(Mn(e[r]));return t}function Mn(e){var t=0;if(3<=e.length){for(var r=void 0,o=void 0,n=0,i=e.length;n<i;n++)t+=(En(e[n===i-2?(r=i-2,o=i-1,0):n===i-1?(r=i-1,o=0,1):(o=(r=n)+1,n+2)][0])-En(e[r][0]))*Math.sin(En(e[o][1]));t=t*vn*vn/2}return t}function Nn(e,t,r){return(e[0]-r[0])*(t[1]-r[1])-(e[1]-r[1])*(t[0]-r[0])}function Ln(e,t,r){if(2<=r.length){for(var o,n,i=1/0,s=null,a=ei(r,22),c=0,u=a.length-1;c<u;c++)n=function(e,t,r){if(t[0]===r[0]&&t[1]===r[1])return t;var o=e[0]-t[0],n=e[1]-t[1],i=r[0]-t[0],e=r[1]-t[1],n=(i*o+e*n)/(i*i+e*e);return n<0?t:1<n?r:[t[0]+i*n,t[1]+e*n]}(t,a[c],a[c+1]),(o=an.getDistance(t,n))<i&&(i=o,s=n);if(s){var l=$n([s],22)[0];return new rn(new un(l),{distance:jn(e,l)})}}else if(1===r.length)return new rn(new un(r[0]),{distance:jn(e,r[0])});return null}function Dn(e,t){var r;return!isNaN(e)&&"number"==typeof t&&0<=t&&(r=void 0,r=t<bn.length?bn[t]:Math.pow(10,t),e=Math.round(e*r)/r),e}function qn(e,t,r,o){switch(An(t)){case pn.meters:e/=1e3;break;case pn.feet:e/=3280.8399;break;case pn.miles:e/=.62137119;break;case pn.yards:e/=1093.6133;break;case pn.nauticalMiles:e/=.5399568;break;case pn.kilometers:}switch(An(r)){case pn.meters:e*=1e3;break;case pn.feet:e*=3280.8399;break;case pn.miles:e*=.62137119;break;case pn.yards:e*=1093.6133;break;case pn.nauticalMiles:e*=.5399568;break;case pn.kilometers:}return"number"==typeof o&&0<=o&&(o=Math.pow(10,o),e=Math.round(e*o)/o),e}function Un(e,t,r,o){o=o||"meters",e=li(e);var n=Hn(o),o=En(e[1]),e=En(e[0]),t=t*_n,r=r/n,n=Math.asin(Math.sin(o)*Math.cos(r)+Math.cos(o)*Math.sin(r)*Math.cos(t)),o=e+Math.atan2(Math.sin(t)*Math.sin(r)*Math.cos(o),Math.cos(r)-Math.sin(o)*Math.sin(n)),n=Tn(Jn(n*wn),-85,85);return[Qn(o*wn),n]}function jn(e,t,r){t=In(e=li(e),t=li(t));return"meters"===r?t:qn(t,"meters",r||"meters")}function Hn(e){e=An(e);return qn(vn,pn.meters,e)}function Bn(e,t,r){for(var o=[],n=En(e[1]),i=En(e[0]),s=En(t[1]),a=En(t[0]),c=2*Math.asin(Math.sqrt(Math.pow(Math.sin((n-s)/2),2)+Math.cos(n)*Math.cos(s)*Math.pow(Math.sin((i-a)/2),2))),u=0;u<=r;u++){var l=u/r,h=Math.sin((1-l)*c)/Math.sin(c),p=Math.sin(l*c)/Math.sin(c),d=h*Math.cos(n)*Math.cos(i)+p*Math.cos(s)*Math.cos(a),l=h*Math.cos(n)*Math.sin(i)+p*Math.cos(s)*Math.sin(a),p=h*Math.sin(n)+p*Math.sin(s),p=Math.atan2(p,Math.sqrt(Math.pow(d,2)+Math.pow(l,2))),d=Math.atan2(l,d),p=Tn(p*wn,-85,85);d*=wn,o.push([d,p])}return o}function zn(e){return(Array.isArray(e)?e:e.coordinates).reduce(function(e,t){var r=0<e.length?e[e.length-1]:null;return r&&180<Math.abs(t[0]-r[0])?(r=r[0]<0?t[0]-360:t[0]+360,e.push([r,t[1]])):e.push(t),e},[])}function Fn(e){for(var t,r,o,n,i,s=Array.isArray(e)?e:e.coordinates,a=[],c=[],u=0;u<s.length;u++)a.push(s[u]),u+1>=s.length||(t=(o=yn(s[u],2))[0],r=o[1],i=(n=yn(s[u+1],2))[0],o=n[1],180<Math.abs(i-t)&&(n=0<t?180:-180,i=Math.abs((0<t?i+360:i-360)-t),i=r+(o-r)*(Math.abs(n-t)/i),a.push([n,i]),c.push(a),a=[[-n,i]]));return c.push(a),c}function Kn(e,t){if(e=li(e),t=li(t),e&&2<=e.length&&t&&2<=t.length){var r=En(e[1]),o=En(t[1]),t=En(t[0]-e[0]),e=Math.sin(t)*Math.cos(o),t=Math.cos(r)*Math.sin(o)-Math.sin(r)*Math.cos(o)*Math.cos(t);return(Sn(Math.atan2(e,t))+360)%360}return NaN}function Gn(e,t){var r,o=0;Array.isArray(e)?r=e:e.type&&"LineString"===e.type&&(r=e.coordinates);for(var n=0,i=r.length-1;n<i;n++)o+=In(r[n],r[n+1]);return qn(o,"meters",t||"meters")}function Yn(e,t,r){r=r||"meters";var o,n,i=0;if(Array.isArray(e)?n=e:e.type&&"LineString"===e.type&&(n=e.coordinates),2<=n.length){for(var s=n.length,a=1;a<s;a++){if(t<=i+(o=jn(n[a-1],n[a],r))){var c=Kn(n[a-1],n[a]);return Un(n[a-1],c,t-i,r)}i+=o}return i<=t?n[s-1]:n[0]}return null}function Zn(e,t,r,o,n){o=o||"meters",n=n||0,e=li(e);for(var i=[],s=360/r,a=0;a<=r;a++)i.push(Un(e,(a*s+n)%360,t,o));return i}function Wn(e,t,r,o,n){return zn(Zn(e,t,r,o,n))}function Vn(e,t,r){r=void 0===r?.5:r;var o=jn(e=li(e),t=li(t),"kilometers");return Un(e,Kn(e,t),o*r,"kilometers")}function Jn(e){return 90<e?180<(e=(e+90)%360)?90-(e-180):e-90:e<-90?(e=(e-90)%360)<-180?-90-(e+180):e+90:e}function Qn(e){return 180<e?(e+180)%360-180:e<-180?(e-180)%360+180:e}function Xn(e,t,r){if(0===r)return Object.assign({},e);t=li(t);for(var o,n,i=[],s=0,a=e.length;s<a;s++)o=jn(t,e[s]),n=Kn(t,e[s]),i.push(Un(t,n+r,o));return i}function $n(e,t){for(var r,o,n=512*Math.pow(2,t),i=[],s=0,a=e.length;s<a;s++)r=e[s][0]/n-.5,o=.5-e[s][1]/n,i.push([360*r,90-360*Math.atan(Math.exp(2*-o*Math.PI))/Math.PI]);return i}function ei(e,t){for(var r,o,n=512*Math.pow(2,t),i=[],s=0,a=e.length;s<a;s++)o=Math.sin(e[s][1]*Math.PI/180),r=(e[s][0]+180)/360,o=.5-Math.log((1+o)/(1-o))/(4*Math.PI),i.push([Math.round(r*n),Math.round(o*n)]);return i}function ti(e,t,r,o){switch(kn(t)){case gn.kilometersPerHourSecond:e/=3.6;break;case gn.milesPerHourSecond:e/=2.236936292054;break;case gn.knotsPerSecond:e/=1.943844492441;break;case gn.standardGravity:e/=.1019716212978;break;case gn.kilometersPerSecondSquared:e/=.001;break;case gn.milesPerSecondSquared:e/=.000621371192;break;case gn.feetPerSecondSquared:e/=3.280839895012;break;case gn.yardsPerSecondSquared:e/=1.093613298338;break;case gn.metersPerSecondSquared:}switch(kn(r)){case gn.kilometersPerHourSecond:e*=3.6;break;case gn.milesPerHourSecond:e*=2.236936292054;break;case gn.knotsPerSecond:e*=1.943844492441;break;case gn.standardGravity:e*=.1019716212978;break;case gn.kilometersPerSecondSquared:e*=.001;break;case gn.milesPerSecondSquared:e*=.000621371192;break;case gn.feetPerSecondSquared:e*=3.280839895012;break;case gn.yardsPerSecondSquared:e*=1.093613298338;break;case gn.metersPerSecondSquared:}return Dn(e,o)}function ri(e,t,r,o){switch(Pn(t)){case hn.acres:e*=4046.8564224;break;case hn.hectares:e*=1e4;break;case hn.squareFeet:e*=.09290304;break;case hn.squareKilometers:e*=1e6;break;case hn.squareMiles:e*=259e4;break;case hn.squareYards:e*=.83612736;break;case hn.squareMeters:}switch(Pn(r)){case hn.acres:e/=4046.8564224;break;case hn.hectares:e/=1e4;break;case hn.squareFeet:e/=.09290304;break;case hn.squareKilometers:e/=1e6;break;case hn.squareMiles:e/=259e4;break;case hn.squareYards:e/=.83612736;break;case hn.squareMeters:}return Dn(e,o)}function oi(e,t,r,o){switch(On(t)){case fn.feetPerSecond:e*=1.09728;break;case fn.milesPerHour:e*=1.6093;break;case fn.knots:e*=1.852;break;case fn.metersPerSecond:e*=3.6;break;case fn.mach:e*=1234.8;break;case fn.kilometersPerHour:}switch(On(r)){case fn.feetPerSecond:e/=1.09728;break;case fn.milesPerHour:e/=1.6093;break;case fn.knots:e/=1.852;break;case fn.metersPerSecond:e/=3.6;break;case fn.mach:e/=1234.8;break;case fn.kilometersPerHour:}return Dn(e,o)}function ni(e,t,r,o){switch(Rn(t)){case dn.ms:e/=1e3;break;case dn.hours:e*=3600;break;case dn.minutes:e*=60;break;case dn.days:e*=86400;break;case dn.seconds:}switch(Rn(r)){case dn.ms:e*=1e3;break;case dn.hours:e/=3600;break;case dn.minutes:e/=60;break;case dn.days:e/=86400;break;case dn.seconds:}return Dn(e,o)}function ii(e,t,r,o,n,i,s,a){n=qn(t,n,pn.meters),i=ni(r,i,dn.seconds);return ti(2*(n-oi(e,o,fn.metersPerSecond)*i)/(i*i),gn.metersPerSecondSquared,s,a)}function si(e,t,r,o,n,i,s){e=oi(e,o,fn.metersPerSecond);return ti((oi(t,o,fn.metersPerSecond)-e)/ni(r,n,dn.seconds),gn.metersPerSecondSquared,i,s)}function ai(e,t,r,o){e=ci(e),t=ci(t);return null!=e&&null!=t?ni(t.getTime()-e.getTime(),dn.ms,r,o):NaN}function ci(e){if("[object Date]"===Object.prototype.toString.call(e))return e;if("string"==typeof e){var t=Date.parse(e);if(!isNaN(t))return new Date(t);if(0<=e.indexOf("Date(")){t=0,t=0<(e=e.replace("/Date(","").replace(")/","")).indexOf("+")?parseInt(e.substr(0,e.indexOf("+")),10):0<e.indexOf("-")?parseInt(e.substr(0,e.indexOf("-")),10):parseInt(e,10);return new Date(t)}}else if("number"==typeof e)return new Date(e);return null}function ui(e){var t=[],r=null,o=null;if(Array.isArray(e)&&0<e.length)if(Array.isArray(e[0])&&"number"==typeof e[0][0])t=e;else for(var n=e.length,i=0;i<n;i++)t=t.concat(ui(e[i]));else if(e.type)switch(e.type){case"Point":t=[e.coordinates];break;case"LineString":t=e.coordinates;break;case"Polygon":r=e.coordinates;break;case"MultiPoint":t=e.coordinates;break;case"MultiLineString":r=e.coordinates;break;case"MultiPolygon":o=e.coordinates;break;case"Feature":var s=e,t=Ci._isCircle(s)?Ci._getCirclePositions(s):ui(s.geometry);break;case"FeatureCollection":t=ui(e.features);break;case"GeometryCollection":t=ui(e.geometries)}else if(e instanceof Ci)return ui(e.toJson());if(r)for(n=r.length,i=0;i<n;i++)t=t.concat(r[i]);else if(o)for(var a=o.length,i=0;i<a;i++)for(var c=o[i].length,u=0;u<c;u++)t=t.concat(o[i][u]);return t}function li(e){if(Array.isArray(e)&&"number"==typeof e[0])return e;if(e.type){if("Point"===e.type)return e.coordinates;if("Feature"===e.type&&"Point"===e.geometry.type)return e.geometry.coordinates}else if(e instanceof Ci&&"Point"===e.getType())return e.getCoordinates();return null}function hi(e,t,r){r=r||"meters";var o,n,i=0;if(Array.isArray(e)?n=e:e.type&&"LineString"===e.type&&(n=e.coordinates),2<=n.length){for(var s=n.length,a=1;a<s;a++){if(t<=i+(o=jn(n[a-1],n[a],r))){var c=Kn(n[a-1],n[a]),u=Un(n[a-1],c,t-i,r);return new rn(new un(u),{heading:c})}i+=o}return i<=t?new rn(new un(n[s-1]),{heading:Kn(n[s-2],n[s-1])}):new rn(new un(n[0]),{heading:Kn(n[0],n[1])})}return null}function pi(e,t,r,o){var n=li(e),i=ei([n],22)[0],s=null,a=1/0;switch((t=t instanceof Ci?t.toJson():t).type){case"Feature":return pi(e,t.geometry,r);case"Point":d=[[t.coordinates]];break;case"MultiPoint":for(var c,u=t.coordinates,l=0,h=u.length;l<h;l++)(c=jn(n,u[l]))<a&&(a=c,s=new rn(new un(u[l]),{distance:c}));break;case"LineString":d=[t.coordinates];break;case"Polygon":case"MultiLineString":d=t.coordinates;break;case"MultiPolygon":var p=t.coordinates;if(0<p.length)for(var d=p[0],l=1,h=p.length;l<h;l++)d=d.concat(p[l])}if(d)for(var f,l=0,h=d.length;l<h;l++)(f=Ln(n,i,d[l]))&&f.properties.distance<a&&(a=f.properties.distance,s=f);return s&&(s.properties.distance=qn(s.properties.distance,"meters",r,o)),s}(Ie=hn=hn||{}).squareMeters="squareMeters",Ie.acres="acres",Ie.hectares="hectares",Ie.squareFeet="squareFeet",Ie.squareKilometers="squareKilometers",Ie.squareMiles="squareMiles",Ie.squareYards="squareYards",(K=pn=pn||{}).meters="meters",K.kilometers="kilometers",K.feet="feet",K.miles="miles",K.nauticalMiles="nauticalMiles",K.yards="yards",(Oe=dn=dn||{}).seconds="seconds",Oe.hours="hours",Oe.ms="ms",Oe.minutes="minutes",Oe.days="days",(Se=fn=fn||{}).metersPerSecond="metersPerSecond",Se.kilometersPerHour="kilometersPerHour",Se.feetPerSecond="feetPerSecond",Se.milesPerHour="milesPerHour",Se.knots="knots",Se.mach="mach",(Ee=gn=gn||{}).milesPerSecondSquared="milesPerSecondSquared",Ee.kilometersPerSecondSquared="kilometersPerSecondSquared",Ee.knotsPerSecond="knotsPerSecond",Ee.standardGravity="standardGravity",Ee.feetPerSecondSquared="feetPerSecondSquared",Ee.yardsPerSecondSquared="yardsPerSecondSquared",Ee.milesPerHourSecond="milesPerHourSecond",Ee.kilometersPerHourSecond="kilometersPerHourSecond",Ee.metersPerSecondSquared="metersPerSecondSquared";var di,fi,x=window&&window.__extends||(di=function(e,t){return(di=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}di(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),gi=(fi=Array,x(yi,fi),yi.fromPosition=function(e){return 2===e.length?new yi(e[0],e[1]):2<e.length?new yi(e[0],e[1],e[2]):null},yi.areEqual=function(e,t,r){if(void 0===r&&(r=6),e&&2<=e.length&&t&&2<=t.length){var o=Math.pow(10,r),n=Jn(e[1]),r=Jn(t[1]),e=Qn(e[0]),t=Qn(t[0]);if(0!=Math.round((n-r)*o)/o)return!1;o=Math.round((e-t)*o)/o;return 0!=o&&360!=o?!1:!0}return!1},yi.fromLatLng=function(n,e,t){var i,s,a,c,u,l,r=[];return"number"==typeof n?(r.push(n),"number"==typeof e&&r.push(e),"number"==typeof t&&r.push(t)):Array.isArray(n)?2<=n.length&&"number"==typeof n[0]&&"number"==typeof n[1]&&(3<=n.length&&"number"==typeof n[2]?r.push(n[0],n[1],n[2]):r.push(n[0],n[1])):"object"==typeof n&&(i=["lat","latitude","y"],s=["lng","longitude","lon","x"],a=["elv","elevation","alt","altitude","z"],l=u=c=NaN,Object.keys(n).forEach(function(e,t,r){var o=e.toLowerCase();isNaN(c)&&0<=i.indexOf(o)&&"number"==typeof n[e]?c=n[e]:isNaN(u)&&0<=s.indexOf(o)&&"number"==typeof n[e]?u=n[e]:isNaN(l)&&0<=a.indexOf(o)&&"number"==typeof n[e]&&(l=n[e])}),isNaN(c)||isNaN(u)||(r.push(u,c),isNaN(l)||r.push(l))),2<=r.length?r:null},yi.fromLatLngs=function(e){var t=[];if(Array.isArray(e))for(var r=0,o=e.length;r<o;r++){var n=yi.fromLatLng(e[r]);n&&t.push(n)}return t},yi._getDimensions=function(e){for(var t=0;Array.isArray(e);)e=e[0],t++;return"number"==typeof e&&t--,t},yi);function yi(e,t,r){return r?fi.call(this,e,t,r)||this:fi.call(this,e,t)||this}var mi=(vi.TYPE="Polygon",vi);function vi(e,t){this.type="Polygon",this.type=vi.TYPE,1===gi._getDimensions(e)?this.coordinates=[e]:this.coordinates=e,this.bbox=t}var _i,wi,Re=window&&window.__extends||(_i=function(e,t){return(_i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}_i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),bi=window&&window.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],o=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&o>=e.length?void 0:e)&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Ci=(Re(Ei,wi=Q),Ei.prototype.addProperty=function(e,t){$o(this.data.properties[e],t)||(this.data.properties[e]=Hr(t),"subType"!==e&&"radius"!==e||this._handleCircle(),this.dataSource&&this.dataSource._updateSource(),this._invokeEvent("shapechanged",this))},Ei.prototype.getBounds=function(){var t,e,r,o,n,i=this.getCoordinates(),s=this.getType();if("Point"===s)n=this.circlePolygon?(a=this.circlePolygon.geometry.coordinates,Ai.fromPositions(a[0])):new Ai(a=i,a);else if("MultiPoint"===s||"LineString"===s){var a=i;n=Ai.fromPositions(a)}else if("Polygon"===s){a=i;n=Ai.fromPositions(a[0])}else if("MultiLineString"===s){a=i;try{for(var c=bi(a),u=c.next();!u.done;u=c.next()){var l=u.value;n=Ai.merge(n,Ai.fromPositions(l))}}catch(e){t={error:e}}finally{try{u&&!u.done&&(e=c.return)&&e.call(c)}finally{if(t)throw t.error}}}else if("MultiPolygon"===s){a=i;try{for(var h=bi(a),p=h.next();!p.done;p=h.next()){var d=p.value;n=Ai.merge(n,Ai.fromPositions(d[0]))}}catch(e){r={error:e}}finally{try{p&&!p.done&&(o=h.return)&&o.call(h)}finally{if(r)throw r.error}}}return n},Ei.prototype.getCoordinates=function(){return Hr(this.data.geometry.coordinates)},Ei.prototype.getCircleCoordinates=function(){return this.circlePolygon?Hr(this.circlePolygon.geometry.coordinates[0]):null},Ei.prototype.getId=function(){return this.data.id},Ei.prototype.getProperties=function(){return Hr(this.data.properties)},Ei.prototype.getType=function(){return this.data.geometry.type},Ei.prototype.isCircle=function(){return Ei._isCircle(this.data)},Ei.prototype.isRectangle=function(){return Ei._isRectangle(this.data)},Ei.prototype.setCoordinates=function(e){e="Polygon"===this.getType()&&1===gi._getDimensions(e)?[e]:e;$o(this.data.geometry.coordinates,e)||(this.data.geometry.coordinates=Hr(e),this._handleCircle(),this.dataSource&&this.dataSource._updateSource(),this._invokeEvent("shapechanged",this))},Ei.prototype.setProperties=function(e){e[Ei._shapeIdPropName]=this.data.id,$o(this.data.properties,e)||(this.data.properties=Hr(e),this._handleCircle(),this.dataSource&&this.dataSource._updateSource(),this._invokeEvent("shapechanged",this))},Ei.prototype.toJson=function(){return JSON.parse(JSON.stringify(this.data))},Ei.prototype._toJson=function(){return this.circlePolygon||this.data},Ei.prototype._setDataSource=function(e){void 0===e||null==e?delete this.dataSource:this.dataSource=e},Ei.prototype._handleCircle=function(){var e;this.isCircle()?(e=Ei._getCirclePositions(this.data),this.circlePolygon=new rn(new mi([e]),this.data.properties,this.data.id),this.data.properties.subType="Circle"):delete this.circlePolygon},Ei._isCircle=function(e){return e&&e.geometry&&"Point"===e.geometry.type&&e.geometry.coordinates&&e.properties&&"string"==typeof e.properties.subType&&"circle"===e.properties.subType.toLowerCase()&&"number"==typeof e.properties.radius},Ei._isRectangle=function(e){if("Polygon"===e.geometry.type&&e.geometry.coordinates&&"string"==typeof e.properties.subType&&"rectangle"===e.properties.subType.toLowerCase()){e=e.geometry.coordinates;if(1===e.length){e=e[0];if(5===e.length)return e[0][0]===e[4][0]&&e[0][1]===e[4][1];if(4===e.length)return!0}}return!1},Ei._getCirclePositions=function(e){return Wn(e.geometry.coordinates,e.properties.radius,72,"meters")},Ei._shapeIdPropName="_azureMapsShapeId",Ei);function Ei(e,t,r){var o,n,i=wi.call(this)||this;return"Feature"===e.type?(n=Hr((o=e).geometry),r=o.properties?Hr(o.properties):{},t=null==o.id||""===o.id?tn():o.id):(n=Hr(e),t=null==t||""===t?tn():t,r=r?Hr(r):{}),r[Ei._shapeIdPropName]=t,i.data=new rn(n,r,t),i._handleCircle(),i}var Si,Ti,Ie=window&&window.__extends||(Si=function(e,t){return(Si=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Si(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),Ii=window&&window.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],o=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&o>=e.length?void 0:e)&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Ai=(Ti=Array,Ie(ki,Ti),ki.fromBoundingBox=function(e){var t=ki.getWest(e),r=ki.getSouth(e),o=ki.getEast(e),e=ki.getNorth(e);return new ki([t,r,o,e])},ki.fromDimensions=function(e,t,r){var o=e[0],n=e[1],e=Math.min(Math.max(n+r/2,-85.5),85.5),n=Math.min(Math.max(n-r/2,-85.5),85.5),r=Qn(o+t/2);return new ki([Qn(o-t/2),n,r,e])},ki.fromEdges=function(e,t,r,o){return new ki([e,t,r,o])},ki.containsPosition=function(e,t){var r=ki.getCenter(e),o=Math.abs(r[1]-t[1]),r=Math.abs(r[0]-t[0]);180<r&&(r=360-r);t=ki.getHeight(e),e=ki.getWidth(e);return o<=t/2+1e-8&&r<=e/2+1e-8},ki.containsBoundingBox=function(e,t){var r=e&&4===e.length,o=t&&4===t.length;return!(!r||!o)&&(ki.getWest(e)<ki.getWest(t)&&ki.getWest(t)<ki.getEast(e)&&ki.getWest(e)<ki.getEast(t)&&ki.getEast(t)<ki.getEast(e)&&ki.getSouth(e)<ki.getSouth(t)&&ki.getSouth(t)<ki.getNorth(e)&&ki.getSouth(e)<ki.getNorth(t)&&ki.getNorth(t)<ki.getNorth(e))},ki.crossesAntimeridian=function(e){return Qn(ki.getEast(e))-Qn(ki.getWest(e))<0||ki.isBoundingBoxWithSixOrMoreElementsLargerThanGlobe(e)||ki.isBoundingBoxWithLessThanSixElementsLargerThanGlobe(e)},ki.getCenter=function(e){var t=Qn(ki.getEast(e)),r=Qn(ki.getWest(e));t<r&&(t+=360);r=Qn((r+t)/2),t=Jn(ki.getSouth(e)),e=Jn(ki.getNorth(e));return[r,Jn((t+e)/2)]},ki.getHeight=function(e){e=Jn(ki.getNorth(e))-Jn(ki.getSouth(e));return isNaN(e)?0:e},ki.getWidth=function(e){e=Qn(ki.getEast(e))-Qn(ki.getWest(e));return isNaN(e)?0:e<0?e+360:e},ki.getSouthWest=function(e){var t=this.getSouth(e),e=this.getWest(e);return isNaN(t)||isNaN(e)?null:[e,t]},ki.getNorthEast=function(e){var t=this.getNorth(e),e=this.getEast(e);return isNaN(t)||isNaN(e)?null:[e,t]},ki.getNorthWest=function(e){var t=this.getNorth(e),e=this.getWest(e);return isNaN(t)||isNaN(e)?null:[e,t]},ki.getSouthEast=function(e){var t=this.getSouth(e),e=this.getEast(e);return isNaN(t)||isNaN(e)?null:[e,t]},ki.getSouth=function(e){return e&&4<=e.length?Number(e[1]):NaN},ki.getWest=function(e){return e&&4<=e.length?Number(e[0]):NaN},ki.getNorth=function(e){if(e){if(4===e.length)return Number(e[3]);if(6===e.length)return Number(e[4])}return NaN},ki.getEast=function(e){if(e){if(4===e.length)return Number(e[2]);if(6===e.length)return Number(e[3])}return NaN},ki.intersect=function(e,t){var r=ki.getCenter(e),o=ki.getCenter(t),n=Math.abs(r[1]-o[1]),i=Math.abs(r[0]-o[0]);180<i&&(i=360-i);r=ki.getHeight(e),o=ki.getWidth(e),e=ki.getHeight(t),t=ki.getWidth(t);return n<=r/2+e/2&&i<=o/2+t/2},ki.merge=function(e,t){var r=e&&4===e.length,o=t&&4===t.length;if(r&&!o)return e;if(o&&!r)return t;if(!r&&!o)return null;for(var r=Math.max(Jn(ki.getNorth(e)),Jn(ki.getNorth(t))),o=Math.min(Jn(ki.getSouth(e)),Jn(ki.getSouth(t))),n=[e,t],i=[],s=0,s=0;s<n.length;s++){var a=n[s],c=Qn(ki.getWest(a)),u=Qn(ki.getEast(a));ki.crossesAntimeridian(a)?(i.push([c,180]),i.push([-180,u])):i.push([c,u])}i.sort(function(e,t){return e[0]===t[0]?e[1]-t[1]:e[0]-t[0]});var l=[],h=i[0];for(s=1;s<i.length;){var p=i[s];h[1]>=p[0]?h[1]=Math.max(h[1],p[1]):(l.push(h),h=p),s++}l.push(h);var d=l.length,f=l[0][0]+360-l[d-1][1],g=[l[d-1][1],l[0][0]];for(s=1;s<d;s++){var y=l[s][0]-l[s-1][1];f<y&&(f=y,g=[l[s-1][1],l[s][0]])}return new ki([g[1],o],[g[0],r])},ki.fromPositions=function(e){for(var t,r,o=NaN,n=NaN,i=NaN,s=NaN,a=e.length,c=new Array(a),u=0;a--;)(r=e[a])&&2<=r.length&&(t=Jn(r[1]),o=isNaN(o)?t:Math.max(o,t),n=isNaN(n)?t:Math.min(n,t),c[u++]=Qn(r[0]));if(u){c.length=u,c.sort(function(e,t){return e-t});for(var l=c[0]+360-c[u-1],h=0,a=1;a<u;a++){var p=c[a]-c[a-1];l<p&&(l=p,h=a)}i=c[h],s=c[(h||u)-1]}return isNaN(i)||isNaN(n)||isNaN(s)||isNaN(o)?null:new ki([i,n,s,o])},ki.fromLatLngs=function(e){return ki.fromPositions(gi.fromLatLngs(e))},ki.fromData=function(e){var t,r,o=null;if(Array.isArray(e)&&0<e.length){try{for(var n=Ii(e),i=n.next();!i.done;i=n.next()){var s,a=i.value;null!=(s=ki.fromData(a))&&(o=null===o?s:ki.merge(o,s))}}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}return o}if(e instanceof Ci)return e.getBounds();if(e&&e.type){var c=e;if(c.bbox&&4===c.bbox.length)return c.bbox;switch(c.type){case"FeatureCollection":return ki.fromData(c.features);case"Feature":return Ci._isCircle(c)?ki.fromPositions(Ci._getCirclePositions(c)):ki.fromData(c.geometry);case"GeometryCollection":return ki.fromData(c.geometries);case"Point":var u=c.coordinates;if(u&&2<=u.length)return[u[0],u[1],u[0],u[1]];break;case"LineString":case"MultiPoint":return ki.fromPositions(c.coordinates);case"Polygon":case"MultiLineString":var l=c.coordinates;if(l&&0<l.length){for(var h=0,p=l.length;h<p;h++)null!=(s=ki.fromPositions(l[h]))&&(o=null===o?s:ki.merge(o,s));if(null!=o)return o}break;case"MultiPolygon":var d=c.coordinates;if(d&&0<d.length){for(h=0,p=d.length;h<p;h++)for(var f=0,g=d[h].length;f<g;f++)null!=(s=ki.fromPositions(d[h][f]))&&(o=null===o?s:ki.merge(o,s));return o}}}return null},ki.splitOnAntimeridian=function(e){var t,r,o,n,i,s,a=[];return ki.isBoundingBoxWithSixOrMoreElementsLargerThanGlobe(e)?[[-180,e[1],e[2],180,e[4],e[5]]]:ki.isBoundingBoxWithLessThanSixElementsLargerThanGlobe(e)?[[-180,e[1],180,e[3]]]:(ki.crossesAntimeridian(e)?(s=t=void 0,r=Qn(ki.getWest(e)),o=Qn(ki.getEast(e)),n=Jn(ki.getNorth(e)),i=Jn(ki.getSouth(e)),s=6<=e.length?(t=[r,i,e[2],180,n,e[5]],[-180,i,e[2],o,n,e[5]]):(t=[r,i,180,n],[-180,i,o,n]),a.push(t,s)):a.push(e),a)},ki.isBoundingBoxWithSixOrMoreElementsLargerThanGlobe=function(e){return 6<=e.length&&360<e[3]-e[0]},ki.isBoundingBoxWithLessThanSixElementsLargerThanGlobe=function(e){return e.length<6&&360<e[2]-e[0]},ki);function ki(e,t){var r,o=this;return e&&t?o=(r=e)[2]&&t[2]?Ti.call(this,r[0],r[1],r[2]||0,t[0],t[1],t[2]||0)||this:Ti.call(this,r[0],r[1],t[0],t[1])||this:!e||(e=e)&&(4===e.length?o=Ti.call(this,e[0],e[1],e[2],e[3])||this:6<=e.length&&(o=Ti.call(this,e[0],e[1],e[2],e[3],e[4],e[5])||this)),o}var Pi=(Oi.TYPE="FeatureCollection",Oi);function Oi(e,t){this.type="FeatureCollection",this.type=Oi.TYPE,this.features=e,this.bbox=t}Ri.TYPE="GeometryCollection",K=Ri;function Ri(e){this.type="GeometryCollection",this.type=Ri.TYPE,this.geometries=e}xi.TYPE="LineString",Oe=xi;function xi(e,t){this.type="LineString",this.type=xi.TYPE,this.coordinates=e,this.bbox=t}Mi.TYPE="MultiLineString",Se=Mi;function Mi(e,t){this.type="MultiLineString",this.type=Mi.TYPE,this.coordinates=e,this.bbox=t}Ni.TYPE="MultiPoint",Ee=Ni;function Ni(e,t){this.type="MultiPoint",this.type=Ni.TYPE,this.coordinates=e,this.bbox=t}Li.TYPE="MultiPolygon",x=Li;function Li(e,t){this.type="MultiPolygon",this.type=Li.TYPE,this.coordinates=e,this.bbox=t}var Di,qi,Re=window&&window.__extends||(Di=function(e,t){return(Di=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Di(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),Ie=(qi=Array,Re(Ui,qi),Ui.fromPosition=function(e){return 2<=e.length?new Ui((180+e[0])/360,Ui._latToMercatorY(e[1]),3<=e.length?Ui._altitudeToMercatorZ(e[2],e[1]):0):[0,0,0]},Ui.fromPositions=function(e){for(var t=[],r=0,o=e.length;r<o;r++)t.push(this.fromPosition(e[r]));return t},Ui.toFloat32Array=function(e){for(var t=new Float32Array(3*e.length),r=0,o=e.length;r<o;r++){var n=3*r,i=e[r];t[n]=(180+i[0])/360,t[1+n]=Ui._latToMercatorY(i[1]),t[2+n]=3<=i.length?Ui._altitudeToMercatorZ(i[2],i[1]):0}return t},Ui.toPosition=function(e){if(2<=e.length){var t=360/Math.PI*Math.atan(Math.exp((180-360*e[1])*Math.PI/180))-90;return new gi(360*e[0]-180,t,3<=e.length?Ui._mercatorZToAltitude(e[2],e[1]):0)}return[0,0,0]},Ui.toPositions=function(e){for(var t=[],r=0,o=e.length;r<o;r++)t.push(this.toPosition(e[r]));return t},Ui.mercatorScale=function(e){return 1/Math.cos(e*Math.PI/180)},Ui.meterInMercatorUnits=function(e){return 1/Ui.earthCircumference*Ui.mercatorScale(Ui._latToMercatorY(e))},Ui._circumferenceAtLatitude=function(e){return Ui.earthCircumference*Math.cos(e*Math.PI/180)},Ui._altitudeToMercatorZ=function(e,t){return e/Ui._circumferenceAtLatitude(t)},Ui._mercatorZToAltitude=function(e,t){return e*Ui._circumferenceAtLatitude(Ui._latToMercatorY(t))},Ui._latToMercatorY=function(e){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))/360},Ui.earthCircumference=2*Math.PI*Hn(),Ui);function Ui(e,t,r){return qi.call(this,e,t,r||0)||this}var ji,Re=Object.freeze({__proto__:null,Feature:rn,FeatureCollection:Pi,LineString:Oe,Point:un,Polygon:mi,Position:gi,BoundingBox:Ai,MercatorPoint:Ie,MultiLineString:Se,MultiPoint:Ee,MultiPolygon:x,GeometryCollection:K}),Hi=xe(function(e,t){function g(e,t){return e*e+t*t}function i(e,t){for(var r,o,n,i=e[0],s=[i],a=1,c=e.length;a<c;a++)r=e[a],n=i,g((o=r)[0]-n[0],o[1]-n[1])>t&&(s.push(r),i=r);return i!==r&&s.push(r),s}function y(e,t,r,o,n){for(var i,s,a,c,u,l,h,p=o,d=t+1;d<r;d++){var f=(s=e[d],a=e[t],c=e[r],h=l=f=u=void 0,u=a[0],f=a[1],l=c[0]-u,h=c[1]-f,0==l&&0==h||(1<(a=((s[0]-u)*l+(s[1]-f)*h)/g(l,h))?(u=c[0],f=c[1]):0<a&&(u+=l*a,f+=h*a)),g(s[0]-u,s[1]-f));p<f&&(i=d,p=f)}o<p&&(1<i-t&&y(e,t,i,o,n),n.push(e[i]),1<r-i&&y(e,i,r,o,n))}t.__esModule=!0,t.SimplifyAP=function(e,t,r){if(e.length<=2)return e;var o,n=(t=void 0===t?1:t)*t;return e=(r=void 0===r?!1:r)?e:i(e,n),t=(o=e).length-1,r=[o[0]],y(o,0,t,n,r),r.push(o[t]),e=r}});(ji=Hi)&&ji.__esModule&&Object.prototype.hasOwnProperty.call(ji,"default")&&ji.default;var Bi=Hi.SimplifyAP;var zi=window&&window.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],o=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&o>=e.length?void 0:e)&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Fi=(Ki.prototype.toTarget=function(e,t){return this.transformArray(e,this.M,t)},Ki.prototype.toSource=function(e,t){return this.transformArray(e,this.inverseM,t)},Ki.prototype.transformArray=function(e,t,r){var o,n;if(e&&Array.isArray(e)&&Array.isArray(e[0])){var i=[];try{for(var s=zi(e),a=s.next();!a.done;a=s.next()){var c=a.value;i.push(this.transform(c,t,r))}}catch(e){o={error:e}}finally{try{a&&!a.done&&(n=s.return)&&n.call(s)}finally{if(o)throw o.error}}return i}return null},Ki.prototype.transform=function(e,t,r){var o=e[0]*t[0][3]+e[1]*t[1][3]+t[2][3],t=e[0]*t[0][4]+e[1]*t[1][4]+t[2][4];return"number"==typeof r&&0<=r?[Dn(o,r),Dn(t,r)]:[Dn(o,6),Dn(t,6)]},Ki._calculateAffineTransform=function(e,t){if(e.length!==t.length||e.length<1)throw new Error("Error: source and target arrays must have the same length.");var r=Math.min(e[0].length,t[0].length),o=r+1;if(e.length<r)throw new Error("Erorr: At least "+r+" reference points required.");for(var n=[],i=[],s=0;s<o;s++){i[s]=[];for(var a=0;a<o;a++){a<r&&(n[a]=0);for(var c=i[s][a]=0;c<e.length;c++)a<r&&(n[a]+=s<r?e[c][s]*t[c][a]:t[c][a]),i[s][a]+=r<=s&&r<=a?1:r<=s?e[c][a]:r<=a?e[c][s]:e[c][s]*e[c][a]}i[s]=i[s].concat(n)}if(!this._gaussJordanElimination(i))throw new Error("Error: Singular matrix. Points are likely coplanar.");return i},Ki._gaussJordanElimination=function(e){for(var t,r=e.length,o=2*r-1,n=0;n<r;n++){for(var i=n,s=n+1;s<r;s++)Math.abs(e[s][n])>Math.abs(e[i][n])&&(i=s);if(t=e[i],e[i]=e[n],e[n]=t,Math.abs(e[n][n])<=1e-12)return!1;for(var a=n+1;a<r;a++)for(var c=e[a][n]/e[n][n],u=n;u<o;u++)e[a][u]-=e[n][u]*c}for(n=r-1;-1<n;n--){c=e[n][n];for(s=0;s<n;s++)for(var l=o-1;n-1<l;l--)e[s][l]-=e[n][l]*e[s][n]/c;e[n][n]/=c;for(var h=r;h<o;h++)e[n][h]/=c}return!0},Ki);function Ki(e,t){this.M=Ki._calculateAffineTransform(e,t),this.inverseM=Ki._calculateAffineTransform(t,e)}var Gi,Yi,Oe=Object.freeze({__proto__:null,AffineTransform:Fi,WEBMERCATOR_MAXLAT:Cn,_precision:Dn,get AreaUnits(){return hn},get DistanceUnits(){return pn},get TimeUnits(){return dn},get SpeedUnits(){return fn},get AccelerationUnits(){return gn},boundingBoxToPolygon:function(e){var t=Qn(Ai.getWest(e)),r=Qn(Ai.getEast(e)),o=Jn(Ai.getNorth(e)),n=Jn(Ai.getSouth(e)),e=Ai.getCenter(e),o=[[t,o],[t,n],[e[0],n],[r,n],[r,o],[e[0],o],[t,o]];return new mi([o])},convertDistance:qn,getCardinalSpline:function(e,t,r,o){if(!e||e.length<=2)return i;"number"!=typeof t&&(t=.5),("number"!=typeof r||r<=0)&&(r=15);var n=e.length,i=e.slice(0);o?(gi.areEqual(i[0],i[n-1])&&(i.pop(),n--),i.unshift(e[n-1]),i.push(e[0]),i.push(e[1]),n++):(i.unshift(e[0]),i.push(e[n-1]));var s,a,c,u=[];u.push([1,0,0,0]);for(var l=1;l<r-1;l++)u.push([2*(c=(s=l/r)*(a=s*s))-3*a+1,-2*c+3*a,c-2*a+s,c-a]);u.push([0,1,0,0]);for(var h,p,d,f,g,y,m=[],l=1;l<n;l++)for(h=t*(i[l+1][0]-i[l-1][0]),p=t*(i[l+1][1]-i[l-1][1]),d=t*(i[l+2][0]-i[l][0]),f=t*(i[l+2][1]-i[l][1]),s=0;s<r;s++)y=(g=u[s])[0]*i[l][0]+g[1]*i[l+1][0]+g[2]*h+g[3]*d,g=Tn(g[0]*i[l][1]+g[1]*i[l+1][1]+g[2]*p+g[3]*f,-85,85),m.push([y,g]);return m},getDestination:Un,getDistanceTo:jn,getEarthRadius:Hn,getPathDenormalizedAtAntimerian:zn,getPathSplitByAntimeridian:Fn,getGeodesicPath:function(e,t){var r;(!t||t<=0)&&(t=15),Array.isArray(e)?r=e:e.type&&"LineString"===e.type&&(r=e.coordinates);for(var o=r.length-1,n=[],i=0;i<o;i++)n=n.concat(Bn(r[i],r[i+1],t));return zn(n)},getGeodesicPaths:function(e,t){var r;(!t||t<=0)&&(t=15),Array.isArray(e)?r=e:e.type&&"LineString"===e.type&&(r=e.coordinates);for(var o=r.length-1,n=[],i=[],s=0;s<o;s++)for(var a,c,u,l,h,p=Bn(r[s],r[s+1],t),d=0;d<p.length;d++)n.push(p[d]),d+1>=p.length||(a=(u=yn(p[d],2))[0],c=u[1],h=(l=yn(p[d+1],2))[0],u=l[1],180<Math.abs(h-a)&&(l=0<a?180:-180,h=Math.abs((0<a?h+360:h-360)-a),h=c+(u-c)*(Math.abs(l-a)/h),n.push([l,h]),i.push(n),n=[[-l,h]]));return i.push(n),i},getHeading:Kn,getLengthOfPath:Gn,getPositionAlongPath:Yn,getRegularPolygonPath:Wn,getRegularPolygonPaths:function(e,t,r,o,n){return Fn(Zn(e,t,r,o,n))},interpolate:Vn,normalizeLatitude:Jn,normalizeLongitude:Qn,rotatePositions:Xn,getPixelHeading:function(e,t){e=li(e),t=li(t);var e=(r=yn(ei([e,t],21),2))[0],r=(t=r[1])[0]-e[0],t=e[1]-t[1];return(2.5*Math.PI-Math.atan2(t,r))*wn%360},mercatorPixelsToPositions:$n,mercatorPositionsToPixels:ei,convertAcceleration:ti,convertArea:ri,convertSpeed:oi,convertTimespan:ni,getAcceleration:ii,getAccelerationFromSpeeds:si,getAccelerationFromFeatures:function(e,t,r,o,n,i,s){if("string"==typeof r&&"Feature"===e.type&&"Point"===e.geometry.type&&"Feature"===t.type&&"Point"===t.geometry.type){var a=ai(e.properties[r],t.properties[r],dn.seconds);if(!isNaN(a)){var c=0;if(o&&"string"==typeof o){r=e.properties[o],o=t.properties[o];if("number"==typeof r&&(c=r,"number"==typeof o))return si(r,o,a,n,dn.seconds,i,s)}return ii(c,jn(e.geometry.coordinates,t.geometry.coordinates,pn.meters),a,n,pn.meters,dn.seconds,i,s)}}return NaN},getArea:function e(t,r,o){if(t){var n=0;switch((t=t instanceof Ci?t.toJson():t).type){case"Feature":var i=t;if(t.geometry)return e(i.geometry,r,o);break;case"Polygon":(i=t).coordinates&&(n=xn(i.coordinates));break;case"MultiPolygon":var s=t;if(s.coordinates)for(var a=0,c=s.coordinates.length;a<c;a++)n+=xn(s.coordinates[a])}return ri(n,hn.squareMeters,r,o)}return 0},getSpeed:function(e,t,r,o,n,i){if(e=li(e),t=li(t),e&&t){o=ni(r,o,dn.seconds);return oi(jn(e,t,pn.meters)/o,fn.metersPerSecond,n,i)}return 0},getSpeedFromFeatures:function(e,t,r,o,n){if("string"==typeof r&&"Feature"===e.type&&"Point"===e.geometry.type&&"Feature"===t.type&&"Point"===t.geometry.type){r=this.getTimespan(e.properties[r],t.properties[r],dn.seconds);if(!isNaN(r)){t=this.getDistanceTo(e.geometry.coordinates,t.geometry.coordinates,pn.meters);return this.convertSpeed(t/r,fn.metersPerSecond,o,n)}}return NaN},getTimespan:ai,getTravelDistance:function(e,t,r,o,n,i,s,a){return t=this.convertTimespan(t,n,dn.seconds),r=(r=this.convertSpeed(r,i,fn.metersPerSecond))*t,"number"==typeof o&&(r+=.5*this.convertAcceleration(o,s,gn.metersPerSecondSquared)*t*t),this.convertDistance(r,pn.meters,e,a)},parseTimestamp:ci,getConvexHull:function(e){var t,r,o=ui(e).map(function(e){return[Qn(e[0]),Jn(e[1])]});o.sort(function(e,t){return e[0]===t[0]?e[1]-t[1]:e[0]-t[0]});var n=[];try{for(var i=mn(o),s=i.next();!s.done;s=i.next()){for(var a=s.value;2<=n.length&&Nn(n[n.length-2],n[n.length-1],a)<=0;)n.pop();n.push(a)}}catch(e){t={error:e}}finally{try{s&&!s.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}for(var c=[],u=o.length-1;0<=u;u--){for(;2<=c.length&&Nn(c[c.length-2],c[c.length-1],o[u])<=0;)c.pop();c.push(o[u])}return new mi([n.concat(c)])},getPositions:ui,getPosition:li,getPositionsAlongPath:function(e,t){if(t<2)return[];for(var r=[],o=Gn(e,pn.meters)/(t-1),n=0;n<t;n++){var i=Yn(e,o*n,pn.meters);null!=i&&r.push(i)}return r},getPointWithHeadingAlongPath:hi,getPointsWithHeadingsAlongPath:function(e,t){if(t<=0)return[];for(var r=[],o=Gn(e,pn.meters)/(t-1),n=0;n<t;n++){var i=hi(e,o*n,pn.meters);null!=i&&r.push(i)}return r},getClosestPointOnGeometry:pi,simplify:function(e,t){return Bi(e,t,!0)}}),Zi=((window&&window.__extends||(Gi=function(e,t){return(Gi=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Gi(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}))(Wi,Yi=k),Wi);function Wi(){var e=null!==Yi&&Yi.apply(this,arguments)||this;return e.zoomDelta=1,e.style=l.ControlStyle.light,e}var Vi,Ji,Ie=((window&&window.__extends||(Vi=function(e,t){return(Vi=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Vi(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}))(Qi,Ji=re),Qi.prototype.onAdd=function(e){this.container=this.buildContainer(e,this.options.style,"Zoom Control"),this.container.style.flexDirection="column",this.zoomInButton=this.constructZoomInButton(e),this.zoomOutButton=this.constructZoomOutButton(e);var t=B("Zoom In"),r=B("Zoom Out");return this.container.appendChild(this.zoomInButton),this.container.appendChild(t),this.container.appendChild(this.zoomOutButton),this.container.appendChild(r),z(t,this.zoomInButton),z(r,this.zoomOutButton),e.events.add("zoom",this.zoomChanged),e.events.add("minzoomchanged",this.minZoomChanged),e.events.add("maxzoomchanged",this.maxZoomChanged),this.map=e,this.container},Qi.prototype.onRemove=function(){Ji.prototype.onRemove.call(this),this.map&&(this.map.events.remove("zoom",this.zoomChanged),this.map.events.remove("minzoomchanged",this.minZoomChanged),this.map.events.remove("maxzoomchanged",this.maxZoomChanged),this.map=null),this.container&&(this.container.remove(),this.container=null,this.zoomInButton=null,this.zoomOutButton=null)},Qi.prototype.updateZoomButtonsState=function(){var e=this.map.getCamera().zoom>=this.map._getMap().getMaxZoom(),t=Ai.getSouth(this.map.getCamera().bounds)<=-Cn&&Ai.getNorth(this.map.getCamera().bounds)>=Cn,t=this.map.getCamera().zoom<=this.map._getMap().getMinZoom()||t;this.zoomInButton&&this.zoomInButton.disabled!=e&&(this.zoomInButton.disabled=e,this.zoomInButton.setAttribute("aria-label",e?"Zoom In disabled":"Zoom In")),this.zoomOutButton&&this.zoomOutButton.disabled!=t&&(this.zoomOutButton.disabled=t,this.zoomInButton.setAttribute("aria-label",e?"Zoom Out disabled":"Zoom Out"))},Qi.prototype.constructZoomInButton=function(e){var t=this,r=document.createElement("button");return r.classList.add("azure-maps-control-button"),r.classList.add("zoom-in"),r.setAttribute("aria-label","Zoom In"),r.setAttribute("alt","Zoom In"),r.setAttribute("type","button"),r.addEventListener("click",function(){e.setCamera({zoom:e.getCamera().zoom+t.options.zoomDelta,duration:Qi.ZOOM_DURATION_MS,type:"ease"},!0)}),r},Qi.prototype.constructZoomOutButton=function(e){var t=this,r=document.createElement("button");return r.classList.add("azure-maps-control-button"),r.classList.add("zoom-out"),r.setAttribute("aria-label","Zoom Out"),r.setAttribute("alt","Zoom Out"),r.setAttribute("type","button"),r.addEventListener("click",function(){e.setCamera({zoom:e.getCamera().zoom-t.options.zoomDelta,duration:Qi.ZOOM_DURATION_MS,type:"ease"},!0)}),r},Qi.ZOOM_DURATION_MS=200,Qi);function Qi(e){var t=Ji.call(this)||this;return t.container=null,t.zoomInButton=null,t.zoomOutButton=null,t.zoomChanged=function(e){return t.updateZoomButtonsState()},t.minZoomChanged=function(e){return t.updateZoomButtonsState()},t.maxZoomChanged=function(e){return t.updateZoomButtonsState()},t.options=(new Zi).merge(e),t}Se=Object.freeze({__proto__:null,ControlBase:re,PitchControl:ve,CompassControl:le,ZoomControl:Ie,StyleControl:Ne,TrafficControl:Po,TrafficLegendControl:Pe});var Xi,$i,es=function(e,t){return jr(e,5,t="function"==typeof t?t:void 0)},ts=((window&&window.__extends||(Xi=function(e,t){return(Xi=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Xi(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}))(rs,$i=k),rs);function rs(){var e=null!==$i&&$i.apply(this,arguments)||this;return e.buffer=128,e.maxZoom=18,e.cluster=!1,e.clusterRadius=50,e.clusterMaxZoom=void 0,e.clusterProperties=void 0,e.lineMetrics=!1,e.tolerance=.375,e.clusterMinPoints=2,e.generateId=!1,e.promoteId=void 0,e.filter=void 0,e}var os,ns,is=((window&&window.__extends||(os=function(e,t){return(os=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}os(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}))(ss,ns=Q),ss.prototype.getId=function(){return this.id},ss.prototype._setMap=function(e,t){var r;void 0===t&&(t=!0),null==e||void 0===e?(r=this.map,delete this.map,t&&(this._invokeEvent("sourceremoved",this),r&&r.events.invoke("sourceremoved",this))):(this.map=e,t&&(this._invokeEvent("sourceadded",this),this.map.events.invoke("sourceadded",this)))},ss);function ss(e){var t=ns.call(this)||this;return t.id=e||tn(),t}var as,cs,Ee=window&&window.__extends||(as=function(e,t){return(as=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}as(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),us=window&&window.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],o=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&o>=e.length?void 0:e)&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},ls=(Ee(hs,cs=is),hs.prototype.add=function(e,t){this._addNoUpdate(e,t),this._updateSource()},hs.prototype.clear=function(){this._clearNoUpdate(),this._updateSource()},hs.prototype.dispose=function(){this.options=null,this.shapes=null,this.shapesMap=null,this.map=null},hs.prototype.getClusterExpansionZoom=function(t){var n=this;return new Promise(function(r,o){var e;n.map?(e=n.map._getMap().getSource(n.getId()))&&"geojson"===e.type&&e.getClusterExpansionZoom(t,function(e,t){e?o(e):"number"==typeof t&&r(t)}):o("The DataSource hasn't been added to a map.")})},hs.prototype.getClusterChildren=function(t){var n=this;return new Promise(function(r,o){var e;n.map?(e=n.map._getMap().getSource(n.getId()))&&"geojson"===e.type&&e.getClusterChildren(t,function(e,t){e?o(e):t&&r(n.map.sources._mapFeaturesToShapes(t,!1,n))}):o("The DataSource hasn't been added to a map.")})},hs.prototype.getClusterLeaves=function(t,n,i){var s=this;return new Promise(function(r,o){var e;s.map?(e=s.map._getMap().getSource(s.getId()))&&"geojson"===e.type&&e.getClusterLeaves(t,n,i,function(e,t){e?o(e):t&&r(s.map.sources._mapFeaturesToShapes(t,!1,s))}):o("The DataSource hasn't been added to a map.")})},hs.prototype.getOptions=function(){return Hr(this.options)},hs.prototype.getShapes=function(){return Array.from(this.shapes)},hs.prototype.importDataFromUrl=function(e){var t=this;return fetch(e,{method:"GET",mode:"cors"}).then(function(e){if(e.ok)return e.json();throw new Error("HTTP "+e.status+": "+e.statusText)}).then(function(e){t.add(e)})},hs.prototype.getShapeById=function(e){return this.shapes[this.shapesMap.get(e)]||null},hs.prototype.remove=function(e){var t,r,e=Array.isArray(e)?e:[e];try{for(var o=us(e),n=o.next();!n.done;n=o.next()){var i=n.value;"number"==typeof i?this._removeByIndex(i):this._removeById(i)}}catch(e){t={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}this._updateSource()},hs.prototype.removeById=function(e){var t,r,e=Array.isArray(e)?e:[e];try{for(var o=us(e),n=o.next();!n.done;n=o.next()){var i=n.value;this._removeById(i)}}catch(e){t={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}this._updateSource()},hs.prototype.setOptions=function(e){e=(new ts).merge(this.options,Hr(e));$o(this.options,e)||(this._invokeEvent("datasourceupdated",this),this.options=e,this.map&&this.map._rebuildStyle())},hs.prototype.setShapes=function(e){this._clearNoUpdate(),this.add(e)},hs.prototype.toJson=function(){return new Pi(this.shapes.map(function(e){return e.toJson()}))},hs.prototype._toJson=function(){return new Pi(this.shapes.map(function(e){return e._toJson()}))},hs.prototype._buildSource=function(){var e={type:"geojson",data:this._toJson(),maxzoom:this.options.maxZoom,cluster:this.options.cluster,clusterRadius:this.options.clusterRadius,tolerance:this.options.tolerance,lineMetrics:this.options.lineMetrics,clusterProperties:this.options.clusterProperties,buffer:this.options.buffer,clusterMinPoints:this.options.clusterMinPoints,generateId:this.options.generateId,promoteId:this.options.promoteId,filter:this.options.filter};return"number"==typeof this.options.clusterMaxZoom&&(e.clusterMaxZoom=this.options.clusterMaxZoom),e},hs.prototype._isDeepEqual=function(e){if(this.constructor!==e.constructor)return!1;var t=this._buildSource(),e=e._buildSource();return t.type===e.type&&t.maxzoom===e.maxzoom&&t.cluster===e.cluster&&t.clusterRadius===e.clusterRadius&&t.tolerance===e.tolerance&&t.lineMetrics===e.lineMetrics&&JSON.stringify(t.clusterProperties)===JSON.stringify(e.clusterProperties)&&t.buffer===e.buffer&&t.clusterMinPoints===e.clusterMinPoints&&t.generateId===e.generateId&&t.promoteId===e.promoteId&&t.filter===e.filter},hs.prototype._addNoUpdate=function(e,t){var r;e instanceof Ci?(this._addToSources(e,t),r=[e]):Array.isArray(e)?(r=e.map(function(e){return e instanceof Ci?e:new Ci(e)}),this._addToSources(r,t)):"FeatureCollection"===e.type?(r=e.features.map(function(e){return new Ci(e)}),this._addToSources(r,t)):"GeometryCollection"===e.type?(r=e.geometries.map(function(e){return new Ci(e)}),this._addToSources(r,t)):(e=new Ci(e),this._addToSources(e,t),r=[e]),this._invokeEvent("dataadded",r)},hs.prototype._clearNoUpdate=function(){var e=this.shapes;this.shapes=[],this.shapesMap=new J,e&&0<e.length&&this._invokeEvent("dataremoved",e)},hs.prototype._updateSource=function(){var e=this;void 0!==this.requestId||(this.requestId=requestAnimationFrame(function(){e._updateMboxSource(),e.requestId=void 0}))},hs.prototype._addToSources=function(e,t){var r,o,n,i;if(e=Array.isArray(e)?e:[e],"number"!=typeof t)try{for(var s=us(e),a=s.next();!a.done;a=s.next()){var c=a.value;this.shapes.push(c),this.shapesMap.set(c.getId(),this.shapes.length-1)}}catch(e){r={error:e}}finally{try{a&&!a.done&&(o=s.return)&&o.call(s)}finally{if(r)throw r.error}}else for(var u=e.length-1;0<=u;u--)this.shapes.splice(t,0,e[u]),this._updateShapesMap(t);try{for(var l=us(e),h=l.next();!h.done;h=l.next())(c=h.value)._setDataSource(this)}catch(e){n={error:e}}finally{try{h&&!h.done&&(i=l.return)&&i.call(l)}finally{if(n)throw n.error}}},hs.prototype._removeById=function(e){var t=e instanceof Ci?e.getId():"string"==typeof e||"number"==typeof e?e:e.id,e=this.shapes[this.shapesMap.get(t)];e&&(e._setDataSource(null),this.shapes.splice(this.shapesMap.get(t),1),this._updateShapesMap(this.shapesMap.get(t)),this.shapesMap.delete(t),this._invokeEvent("dataremoved",[e]))},hs.prototype._removeByIndex=function(e){var t;if(e>=this.shapes.length)throw new Error("The specified remove index '"+e+"' is greater than the maximum possible index '"+(this.shapes.length-1)+"'");t=this.shapes[e],this.shapesMap.delete(t.getId()),t._setDataSource(null),this.shapes.splice(e,1),this._updateShapesMap(e),this._invokeEvent("dataremoved",[t])},hs.prototype._updateShapesMap=function(e){for(var t=e;t<this.shapes.length;t++)this.shapesMap.set(this.shapes[t].getId(),t)},hs.prototype._updateMboxSource=function(){var e;this.map&&this.map._getMap()&&((e=this.map._getMap().getSource(this.getId()))&&"geojson"===e.type&&e.setData(this._toJson()))},hs);function hs(e,t){e=cs.call(this,e)||this;return e.requestId=void 0,e.options=(new ts).merge(Hr(t)),e.shapes=[],e.shapesMap=new J,e}var ps,ds,fs=((window&&window.__extends||(ps=function(e,t){return(ps=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}ps(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}))(gs,ds=k),gs);function gs(){var e=null!==ds&&ds.apply(this,arguments)||this;return e.bounds=void 0,e.minZoom=0,e.maxZoom=22,e.isTMS=!1,e.tiles=void 0,e.url=void 0,e}var ys,ms,vs=((window&&window.__extends||(ys=function(e,t){return(ys=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}ys(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}))(_s,ms=is),_s.prototype.getOptions=function(){return Hr(this.options)},_s.prototype.getShape=function(e,t){return this.map._getMap().querySourceFeatures(this.getId(),{sourceLayer:e,filter:t})},_s.prototype._buildSource=function(){var e={type:"vector"};return this.options.bounds&&(e.bounds=this.options.bounds),this.options.tiles?(e.tiles=this.options.tiles,e.minzoom=this.options.minZoom,e.maxzoom=this.options.maxZoom):this.options.url&&(e.url=this.options.url),this.options.isTMS&&(e.scheme="tms"),e},_s.prototype._isDeepEqual=function(e){if(this.constructor!==e.constructor)return!1;var t=this._buildSource(),r=e._buildSource();return t.type===r.type&&t.url===r.url&&(void 0===t.tiles&&void 0===r.tiles||t.tiles&&r.tiles&&t.tiles.length===r.tiles.length&&t.tiles.every(function(e,t){return e===r.tiles[t]}))&&t.minzoom===r.minzoom&&t.maxzoom===r.maxzoom&&t.bounds===r.bounds&&t.attribution===r.attribution&&t.promoteId===r.promoteId&&t.scheme===r.scheme},_s);function _s(e,t){e=ms.call(this,e)||this;return e.options=(new fs).merge(Hr(t)),e}var ws,bs,Cs=((window&&window.__extends||(ws=function(e,t){return(ws=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}ws(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}))(Es,bs=is),Es.prototype._isDeepEqual=function(e){if(this.constructor!==e.constructor)return!1;var t=this.source,e=e.source;return t.type===e.type&&t.canvas===e.canvas&&JSON.stringify(t.coordinates)===JSON.stringify(e.coordinates)&&t.animate===e.animate},Es.prototype._buildSource=function(){return this.source},Es);function Es(e,t,r){e=bs.call(this,e)||this;return e.source=t,e}var Ss,Ts,Is=((window&&window.__extends||(Ss=function(e,t){return(Ss=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Ss(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}))(As,Ts=is),As.prototype._isDeepEqual=function(e){if(this.constructor!==e.constructor)return!1;var t=this.source,e=e.source;return t.type===e.type},As.prototype._buildSource=function(){return this.source},As);function As(e,t,r){e=Ts.call(this,e)||this;return e.source=t,e}var ks,Ps,Os=((window&&window.__extends||(ks=function(e,t){return(ks=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}ks(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}))(Rs,Ps=is),Rs.prototype._isDeepEqual=function(e){if(this.constructor!==e.constructor)return!1;var t=this.source,e=e.source;return t.type===e.type&&JSON.stringify(t.coordinates)===JSON.stringify(e.coordinates)&&t.url===e.url},Rs.prototype._buildSource=function(){return this.source},Rs);function Rs(e,t,r){e=Ps.call(this,e)||this;return e.source=t,e}var xs,Ms,Ns=((window&&window.__extends||(xs=function(e,t){return(xs=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}xs(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}))(Ls,Ms=is),Ls.prototype._isDeepEqual=function(e){if(this.constructor!==e.constructor)return!1;var t=this.source,e=e.source;return t.type===e.type&&JSON.stringify(t.coordinates)===JSON.stringify(e.coordinates)&&t.urls===e.urls},Ls.prototype._buildSource=function(){return this.source},Ls);function Ls(e,t,r){e=Ms.call(this,e)||this;return e.source=t,e}var Ds,qs,x=Object.freeze({__proto__:null,Source:is,DataSource:ls,VectorTileSource:vs,CanvasSource:Cs,ImageSource:Os,VideoSource:Ns,UnknownSource:Is}),Us=((window&&window.__extends||(Ds=function(e,t){return(Ds=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Ds(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}))(js,qs=Q),js.prototype.getId=function(){return this.id},js.prototype.getMap=function(){return this.map||null},js.prototype.onAdd=function(e){this.map=e,this._invokeEvent("layeradded",this),this.map.events.invoke("layeradded",this)},js.prototype.onRemove=function(){var e=this.map;delete this.map,this._invokeEvent("layerremoved",this),e&&e.events.invoke("layerremoved",this)},js._isMBoxEvent=function(e){return!this.LayerEvents.hasOwnProperty(e)},js.prototype._updateBaseProperties=function(e,t){this._updateFilter(e.filter,t.filter),this._updateZoomRange(e.minZoom,t.minZoom,e.maxZoom,t.maxZoom),this._updateLayoutProperty("visibility",e.visible,t.visible,e.visible?"visible":"none")},js.prototype._updateFilter=function(e,t){$o(e,t)||this.map._getMap().setFilter(this.id,e)},js.prototype._updatePaintProperty=function(e,t,r,o){$o(t,r)||this.map._getMap().setPaintProperty(this.id,e,o||t)},js.prototype._updateLayoutProperty=function(e,t,r,o){$o(t,r)||this.map._getMap().setLayoutProperty(this.id,e,o||t)},js.prototype._updateZoomRange=function(e,t,r,o){e===t&&o===r||this.map._getMap().setLayerZoomRange(this.id,e,r)},js.LayerEvents={layeradded:void 0,layerremoved:void 0},js);function js(e){var t=qs.call(this)||this;return t.id=e||tn(),t}var Hs,Bs,K=((window&&window.__extends||(Hs=function(e,t){return(Hs=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Hs(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}))(zs,Bs=k),zs._cloneCustomizer=function(e){if(e instanceof is)return e},zs);function zs(){var e=null!==Bs&&Bs.apply(this,arguments)||this;return e.filter=void 0,e.minZoom=0,e.maxZoom=24,e.visible=!0,e}var Fs,Ks,Gs=((window&&window.__extends||(Fs=function(e,t){return(Fs=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Fs(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}))(Ys,Ks=K),Ys);function Ys(){var e=null!==Ks&&Ks.apply(this,arguments)||this;return e.source=void 0,e.sourceLayer=void 0,e.color="#1A73AA",e.blur=0,e.opacity=1,e.strokeColor="#FFFFFF",e.strokeOpacity=1,e.strokeWidth=2,e.pitchAlignment="viewport",e.radius=8,e}var Zs,Ws,Vs=((window&&window.__extends||(Zs=function(e,t){return(Zs=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Zs(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}))(Js,Ws=Us),Js.prototype.getOptions=function(){return es(this.options,Gs._cloneCustomizer)},Js.prototype.getSource=function(){return this.options.source},Js.prototype.setOptions=function(e){e=(new Gs).merge(this.options,es(e,Gs._cloneCustomizer));if(this.map){if(e.source!==this.options.source||e.sourceLayer!==this.options.sourceLayer)return this.options=e,void this.map.layers.add(this);this._updateBaseProperties(e,this.options),this._updatePaintProperty("circle-blur",e.blur,this.options.blur),this._updatePaintProperty("circle-color",e.color,this.options.color),this._updatePaintProperty("circle-opacity",e.opacity,this.options.opacity),this._updatePaintProperty("circle-radius",e.radius,this.options.radius),this._updatePaintProperty("circle-stroke-color",e.strokeColor,this.options.strokeColor),this._updatePaintProperty("circle-stroke-opacity",e.strokeOpacity,this.options.strokeOpacity),this._updatePaintProperty("circle-stroke-width",e.strokeWidth,this.options.strokeWidth),this._updatePaintProperty("circle-pitch-alignment",e.pitchAlignment,this.options.pitchAlignment)}this.options=e},Js.prototype._buildLayers=function(){var e={id:this.id,type:"circle",source:this.options.source instanceof is?this.options.source.getId():this.options.source,layout:{visibility:this.options.visible?"visible":"none"},paint:{"circle-color":this.options.color,"circle-blur":this.options.blur,"circle-opacity":this.options.opacity,"circle-stroke-color":this.options.strokeColor,"circle-stroke-opacity":this.options.strokeOpacity,"circle-stroke-width":this.options.strokeWidth,"circle-pitch-alignment":this.options.pitchAlignment,"circle-radius":this.options.radius},minzoom:this.options.minZoom,maxzoom:this.options.maxZoom};return this.options.filter&&(e.filter=this.options.filter),this.options.sourceLayer&&(e["source-layer"]=this.options.sourceLayer),[e]},Js.prototype._getLayerIds=function(){return[this.id]},Js.prototype._getSourceIds=function(){var e=new Set;return this.options.source instanceof is?e.add(this.options.source.getId()):e.add(this.options.source),e},Js);function Js(e,t,r){t=Ws.call(this,t)||this;return t.options=(new Gs).merge(es(r,Gs._cloneCustomizer)),t.options.source=e||t.options.source,t}var Qs,Xs,$s=((window&&window.__extends||(Qs=function(e,t){return(Qs=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Qs(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}))(ea,Xs=K),ea._cloneCustomizer=function(e){if(e instanceof is)return e},ea);function ea(){var e=null!==Xs&&Xs.apply(this,arguments)||this;return e.source=void 0,e.sourceLayer=void 0,e.color=["interpolate",["linear"],["heatmap-density"],0,"rgba(0,0, 255,0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],e.intensity=1,e.opacity=1,e.radius=30,e.weight=1,e}var ta,ra,ve=((window&&window.__extends||(ta=function(e,t){return(ta=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}ta(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}))(oa,ra=Us),oa.prototype.getOptions=function(){return es(this.options,$s._cloneCustomizer)},oa.prototype.getSource=function(){return this.options.source},oa.prototype.setOptions=function(e){e=(new $s).merge(this.options,es(e,$s._cloneCustomizer));if(this.map){if(e.source!==this.options.source||e.sourceLayer!==this.options.sourceLayer)return this.options=e,void this.map.layers.add(this);this._updateBaseProperties(e,this.options),this._updatePaintProperty("heatmap-color",e.color,this.options.color),this._updatePaintProperty("heatmap-intensity",e.intensity,this.options.intensity),this._updatePaintProperty("heatmap-opacity",e.opacity,this.options.opacity),this._updatePaintProperty("heatmap-radius",e.radius,this.options.radius),this._updatePaintProperty("heatmap-weight",e.weight,this.options.weight)}this.options=e},oa.prototype._buildLayers=function(){var e={id:this.id,type:"heatmap",source:this.options.source instanceof is?this.options.source.getId():this.options.source,layout:{visibility:this.options.visible?"visible":"none"},paint:{"heatmap-color":this.options.color,"heatmap-intensity":this.options.intensity,"heatmap-opacity":this.options.opacity,"heatmap-radius":this.options.radius,"heatmap-weight":this.options.weight},minzoom:this.options.minZoom,maxzoom:this.options.maxZoom};return this.options.filter&&(e.filter=this.options.filter),this.options.sourceLayer&&(e["source-layer"]=this.options.sourceLayer),[e]},oa.prototype._getLayerIds=function(){return[this.id]},oa.prototype._getSourceIds=function(){var e=new Set;return this.options.source instanceof is?e.add(this.options.source.getId()):e.add(this.options.source),e},oa);function oa(e,t,r){t=ra.call(this,t)||this;return t.options=(new $s).merge(es(r,$s._cloneCustomizer)),t.options.source=e||t.options.source,t}var na,ia,Ie=((window&&window.__extends||(na=function(e,t){return(na=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}na(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}))(sa,ia=K),sa);function sa(){var e=null!==ia&&ia.apply(this,arguments)||this;return e.contrast=0,e.fadeDuration=300,e.hueRotation=0,e.maxBrightness=1,e.minBrightness=0,e.opacity=1,e.saturation=0,e}var aa,ca,ua=((window&&window.__extends||(aa=function(e,t){return(aa=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}aa(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}))(la,ca=Ie),la._cloneCustomizer=function(e){if(e instanceof is)return e},la);function la(){var e=null!==ca&&ca.apply(this,arguments)||this;return e.url=void 0,e.coordinates=void 0,e}var ha,pa,da=((window&&window.__extends||(ha=function(e,t){return(ha=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}ha(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}))(fa,pa=Us),fa.prototype._getSourceIds=function(){var e=new Set;return e.add(this._getSourceId()),e},fa.prototype.onAdd=function(e){pa.prototype.onAdd.call(this,e)},fa);function fa(){return null!==pa&&pa.apply(this,arguments)||this}var ga,ya,Ne=((window&&window.__extends||(ga=function(e,t){return(ga=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}ga(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}))(ma,ya=da),ma.prototype.getOptions=function(){return es(this.options,ua._cloneCustomizer)},ma.prototype.setOptions=function(e){var t=(new ua).merge(this.options,es(e,ua._cloneCustomizer)),r="string"==typeof e.url&&e.url!==this.getOptions().url,o=void 0!==e.coordinates&&e.coordinates!==this.getOptions().coordinates;this.map&&(this._updateBaseProperties(t,this.options),this._updatePaintProperty("raster-contrast",t.contrast,this.options.contrast),this._updatePaintProperty("raster-fade-duration",t.fadeDuration,this.options.fadeDuration),this._updatePaintProperty("raster-hue-rotate",t.hueRotation,this.options.hueRotation),this._updatePaintProperty("raster-brightness-max",t.maxBrightness,this.options.maxBrightness),this._updatePaintProperty("raster-opacity",t.opacity,this.options.opacity),this._updatePaintProperty("raster-saturation",t.saturation,this.options.saturation),(e=this.map._getMap().getSource(this._getSourceId()))&&e.updateImage(t)),this.options=t,r?this.reloadImage():o&&this.updateTransform()},ma.prototype.getPositions=function(t){return this.transform.then(function(e){return e.toTarget(t)})},ma.prototype.getPixels=function(t){return this.transform.then(function(e){return e.toSource(t)})},ma.getCoordinatesFromRefPoints=function(e,t,r,o){return new Fi(r,o).toTarget([[0,0],[e,0],[e,t],[0,t]])},ma.getCoordinatesFromEdges=function(e,t,r,o,n){"number"!=typeof n&&(n=0);r=[Math.min(o,r),t,Math.max(o,r),e],e=Ai.getCenter(r);return Xn([Ai.getNorthWest(r),Ai.getNorthEast(r),Ai.getSouthEast(r),Ai.getSouthWest(r)],e,n)},ma.prototype._buildLayers=function(){var e={id:this.id,type:"raster",source:this._getSourceId(),layout:{visibility:this.options.visible?"visible":"none"},paint:{"raster-opacity":this.options.opacity,"raster-hue-rotate":this.options.hueRotation,"raster-brightness-min":this.options.minBrightness,"raster-brightness-max":this.options.maxBrightness,"raster-saturation":this.options.saturation,"raster-contrast":this.options.contrast,"raster-fade-duration":this.options.fadeDuration},minzoom:this.options.minZoom,maxzoom:this.options.maxZoom};return this.options.filter&&(e.filter=this.options.filter),[e]},ma.prototype._getLayerIds=function(){return[this.id]},ma.prototype._buildSource=function(){return{type:"image",url:this.options.url,coordinates:this.options.coordinates}},ma.prototype._getSourceId=function(){return this.getId()+"-ImageSource"},ma.prototype.reloadImage=function(){var r=this;this.options.url&&(this.transform=new Promise(function(t,e){r.img.onload=function(){var e=[[0,0],[r.img.width,0],[r.img.width,r.img.height],[0,r.img.height]];t(new Fi(e,r.options.coordinates)),r.isLoading=!1},r.img.onerror=r.img.onabort=function(){e("Failed to load image")},r.isLoading=!0,r.img.src=r.options.url}))},ma.prototype.updateTransform=function(){var e;this.isLoading||(e=[[0,0],[this.img.width,0],[this.img.width,this.img.height],[0,this.img.height]],this.transform=Promise.resolve(new Fi(e,this.options.coordinates)))},ma.prototype._getSourceWrapper=function(){var e=this._getSourceId(),t=this._buildSource();return new Os(e,t)},ma);function ma(e,t){t=ya.call(this,t)||this;return t.isLoading=!1,t.options=(new ua).merge(es(e,ua._cloneCustomizer)),t.img=new Image,t.reloadImage(),t}var va,_a,wa=((window&&window.__extends||(va=function(e,t){return(va=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}va(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}))(ba,_a=K),ba);function ba(){var e=null!==_a&&_a.apply(this,arguments)||this;return e.source=void 0,e.sourceLayer=void 0,e.lineCap="round",e.lineJoin="round",e.blur=0,e.strokeColor="#1E90FF",e.strokeDashArray=void 0,e.strokeGradient=void 0,e.offset=0,e.strokeOpacity=1,e.translate=new an(0,0),e.translateAnchor="map",e.strokeWidth=2,e}var Ca,Ea,Pe=window&&window.__extends||(Ca=function(e,t){return(Ca=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Ca(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),Sa=window&&window.__assign||function(){return(Sa=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)},Ta=(Pe(Ia,Ea=Us),Ia.prototype.getOptions=function(){return es(this.options,wa._cloneCustomizer)},Ia.prototype.getSource=function(){return this.options.source},Ia.prototype.setOptions=function(e){e=(new wa).merge(this.options,es(e,wa._cloneCustomizer));if(this.map){if(e.source!==this.options.source||e.sourceLayer!==this.options.sourceLayer)return this.options=e,void this.map.layers.add(this);this._updateBaseProperties(e,this.options),this._updatePaintProperty("line-blur",e.blur,this.options.blur),this._updateLayoutProperty("line-cap",e.lineCap,this.options.lineCap),this._updateLayoutProperty("line-join",e.lineJoin,this.options.lineJoin),this._updatePaintProperty("line-offset",e.offset,this.options.offset),this._updatePaintProperty("line-color",e.strokeColor,this.options.strokeColor),this._updatePaintProperty("line-dasharray",e.strokeDashArray,this.options.strokeDashArray),this._updatePaintProperty("line-gradient",e.strokeGradient,this.options.strokeGradient),this._updatePaintProperty("line-opacity",e.strokeOpacity,this.options.strokeOpacity),this._updatePaintProperty("line-width",e.strokeWidth,this.options.strokeWidth),this._updatePaintProperty("line-translate",e.translate,this.options.translate),this._updatePaintProperty("line-translate-anchor",e.translateAnchor,this.options.translateAnchor)}this.options=e},Ia.prototype._buildLayers=function(){return[Sa(Sa(Sa(Sa({id:this.id,type:"line"},this.options.sourceLayer&&{"source-layer":this.options.sourceLayer}),{source:this.options.source instanceof is?this.options.source.getId():this.options.source,layout:{visibility:this.options.visible?"visible":"none","line-cap":this.options.lineCap,"line-join":this.options.lineJoin},paint:Sa(Sa(Sa({"line-blur":this.options.blur,"line-color":this.options.strokeColor},this.options.strokeDashArray&&{"line-dasharray":this.options.strokeDashArray}),this.options.strokeGradient&&{"line-gradient":this.options.strokeGradient}),{"line-offset":this.options.offset,"line-opacity":this.options.strokeOpacity,"line-translate":this.options.translate,"line-translate-anchor":this.options.translateAnchor,"line-width":this.options.strokeWidth})}),this.options.filter&&{filter:this.options.filter}),{minzoom:this.options.minZoom,maxzoom:this.options.maxZoom})]},Ia.prototype._getLayerIds=function(){return[this.id]},Ia.prototype._getSourceIds=function(){var e=new Set;return this.options.source instanceof is?e.add(this.options.source.getId()):e.add(this.options.source),e},Ia);function Ia(e,t,r){t=Ea.call(this,t)||this;return t.options=(new wa).merge(es(r,wa._cloneCustomizer)),t.options.source=e||t.options.source,t}var Aa,ka,Pa=((window&&window.__extends||(Aa=function(e,t){return(Aa=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Aa(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}))(Oa,ka=K),Oa);function Oa(){var e=null!==ka&&ka.apply(this,arguments)||this;return e.source=void 0,e.sourceLayer=void 0,e.base=0,e.fillColor="#1E90FF",e.height=0,e.fillOpacity=1,e.fillPattern=void 0,e.translate=new an(0,0),e.translateAnchor="map",e.verticalGradient=!0,e}var Ra,xa,Ee=window&&window.__extends||(Ra=function(e,t){return(Ra=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Ra(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),Ma=window&&window.__assign||function(){return(Ma=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)},Pe=(Ee(Na,xa=Us),Na.prototype.getOptions=function(){return es(this.options,Pa._cloneCustomizer)},Na.prototype.getSource=function(){return this.options.source},Na.prototype.setOptions=function(e){e=(new Pa).merge(this.options,es(e,Pa._cloneCustomizer));if(this.map){if(e.source!==this.options.source||e.sourceLayer!==this.options.sourceLayer)return this.options=e,void this.map.layers.add(this);this._updateBaseProperties(e,this.options),this._updatePaintProperty("fill-extrusion-base",e.base,this.options.base),this._updatePaintProperty("fill-extrusion-color",e.fillColor,this.options.fillColor),this._updatePaintProperty("fill-extrusion-height",e.height,this.options.height),this._updatePaintProperty("fill-extrusion-opacity",e.fillOpacity,this.options.fillOpacity),this._updatePaintProperty("fill-extrusion-pattern",e.fillPattern,this.options.fillPattern),this._updatePaintProperty("fill-extrusion-translate",e.translate,this.options.translate),this._updatePaintProperty("fill-extrusion-translate-anchor",e.translateAnchor,this.options.translateAnchor),this._updatePaintProperty("fill-extrusion-vertical-gradient",e.verticalGradient,this.options.verticalGradient)}this.options=e},Na.prototype._buildLayers=function(){return[Ma(Ma(Ma(Ma({id:this.id,type:"fill-extrusion"},this.options.sourceLayer&&{"source-layer":this.options.sourceLayer}),{source:this.options.source instanceof is?this.options.source.getId():this.options.source,layout:{visibility:this.options.visible?"visible":"none"},paint:Ma(Ma({"fill-extrusion-base":this.options.base,"fill-extrusion-height":this.options.height,"fill-extrusion-opacity":this.options.fillOpacity},this.options.fillPattern?{"fill-extrusion-pattern":this.options.fillPattern}:{"fill-extrusion-color":this.options.fillColor}),{"fill-extrusion-translate":this.options.translate,"fill-extrusion-translate-anchor":this.options.translateAnchor,"fill-extrusion-vertical-gradient":this.options.verticalGradient})}),this.options.filter&&{filter:this.options.filter}),{minzoom:this.options.minZoom,maxzoom:this.options.maxZoom})]},Na.prototype._getLayerIds=function(){return[this.id]},Na.prototype._getSourceIds=function(){var e=new Set;return this.options.source instanceof is?e.add(this.options.source.getId()):e.add(this.options.source),e},Na);function Na(e,t,r){t=xa.call(this,t)||this;return t.options=(new Pa).merge(es(r,Pa._cloneCustomizer)),t.options.source=e||t.options.source,t}var La,Da,Ee=window&&window.__extends||(La=function(e,t){return(La=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}La(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),qa=window&&window.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],o=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&o>=e.length?void 0:e)&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Ua=window&&window.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var o,n,i=r.call(e),s=[];try{for(;(void 0===t||0<t--)&&!(o=i.next()).done;)s.push(o.value)}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return s},ja=window&&window.__spreadArray||function(e,t){for(var r=0,o=t.length,n=e.length;r<o;r++,n++)e[n]=t[r];return e},Ha=(Ee(Ba,Da=K),Ba.prototype.merge=function(){for(var e,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var o=!1,n=!1;try{for(var i=qa(t),s=i.next();!s.done;s=i.next()){var a=s.value;a&&(a.hasOwnProperty("fillColor")?n=!(o=!0):a.hasOwnProperty("fillPattern")&&(o=!(n=!0)))}}catch(e){c={error:e}}finally{try{s&&!s.done&&(e=i.return)&&e.call(i)}finally{if(c)throw c.error}}var c=Da.prototype.merge.apply(this,ja([],Ua(t)));return o?c.fillPattern=void 0:n&&(c.fillColor=void 0),c},Ba);function Ba(){var e=null!==Da&&Da.apply(this,arguments)||this;return e.source=void 0,e.sourceLayer=void 0,e.fillColor="#1E90FF",e.fillOpacity=.5,e.fillPattern=void 0,e}var za,Fa,Ka=((window&&window.__extends||(za=function(e,t){return(za=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}za(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}))(Ga,Fa=Us),Ga.prototype.getOptions=function(){return es(this.options,Ha._cloneCustomizer)},Ga.prototype.getSource=function(){return this.options.source},Ga.prototype.setOptions=function(e){e=(new Ha).merge(this.options,es(e,Ha._cloneCustomizer));if(this.map){if(e.source!==this.options.source||e.sourceLayer!==this.options.sourceLayer)return this.options=e,void this.map.layers.add(this);this._updateBaseProperties(e,this.options),this._updatePaintProperty("fill-color",e.fillColor,this.options.fillColor),this._updatePaintProperty("fill-opacity",e.fillOpacity,this.options.fillOpacity),this._updatePaintProperty("fill-pattern",e.fillPattern,this.options.fillPattern)}this.options=e},Ga.prototype._buildLayers=function(){var e={id:this.id,type:"fill",source:this.options.source instanceof is?this.options.source.getId():this.options.source,layout:{visibility:this.options.visible?"visible":"none"},paint:{"fill-opacity":this.options.fillOpacity},minzoom:this.options.minZoom,maxzoom:this.options.maxZoom};return this.options.filter&&(e.filter=this.options.filter),this.options.sourceLayer&&(e["source-layer"]=this.options.sourceLayer),this.options.fillPattern?e.paint["fill-pattern"]=this.options.fillPattern:e.paint["fill-color"]=this.options.fillColor,[e]},Ga.prototype._getLayerIds=function(){return[this.id]},Ga.prototype._getSourceIds=function(){var e=new Set;return this.options.source instanceof is?e.add(this.options.source.getId()):e.add(this.options.source),e},Ga);function Ga(e,t,r){t=Fa.call(this,t)||this;return t.options=(new Ha).merge(es(r,Ha._cloneCustomizer)),t.options.source=e||t.options.source,t}var Ya,Za,Wa=((window&&window.__extends||(Ya=function(e,t){return(Ya=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Ya(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}))(Va,Za=k),Va);function Va(){var e=null!==Za&&Za.apply(this,arguments)||this;return e.allowOverlap=!1,e.anchor="bottom",e.ignorePlacement=!1,e.image="marker-blue",e.offset=new an(0,0),e.optional=!1,e.padding=2,e.pitchAlignment="auto",e.rotation=0,e.rotationAlignment="auto",e.size=1,e.opacity=1,e}var Ja,Qa,Xa=((window&&window.__extends||(Ja=function(e,t){return(Ja=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Ja(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}))($a,Qa=k),$a);function $a(){var e=null!==Qa&&Qa.apply(this,arguments)||this;return e.allowOverlap=!1,e.anchor="center",e.textField=void 0,e.font=["StandardFont-Regular"],e.ignorePlacement=!1,e.justify="center",e.offset=new an(0,0),e.optional=!1,e.padding=2,e.pitchAlignment="auto",e.rotation=0,e.rotationAlignment="auto",e.size=16,e.color="#000000",e.haloBlur=0,e.haloColor="rgba(0,0,0,0)",e.haloWidth=0,e.opacity=1,e}var ec,tc,rc=((window&&window.__extends||(ec=function(e,t){return(ec=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}ec(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}))(oc,tc=K),oc);function oc(){var e=null!==tc&&tc.apply(this,arguments)||this;return e.source=void 0,e.sourceLayer=void 0,e.iconOptions=new Wa,e.textOptions=new Xa,e.placement="point",e.zOrder="auto",e.lineSpacing=250,e}var nc,ic,Ee=window&&window.__extends||(nc=function(e,t){return(nc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}nc(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),sc=window&&window.__assign||function(){return(sc=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)},ac=(Ee(cc,ic=Us),cc.prototype.getOptions=function(){return es(this.options,rc._cloneCustomizer)},cc.prototype.getSource=function(){return this.options.source},cc.prototype.setOptions=function(e){var t=(new rc).merge(this.options,es(e,rc._cloneCustomizer));if(this.map){if(t.source!==this.options.source||t.sourceLayer!==this.options.sourceLayer)return this.options=t,void this.map.layers.add(this);var r=this.options,o=t.iconOptions,n=r.iconOptions,i=t.textOptions,e=r.textOptions;this._updateBaseProperties(t,r),this._updateLayoutProperty("symbol-spacing",t.lineSpacing,r.lineSpacing),this._updateLayoutProperty("symbol-placement",t.placement,r.placement),this._updateLayoutProperty("symbol-sort-key",t.sortKey,r.sortKey),this._updateLayoutProperty("symbol-z-order",t.zOrder,r.zOrder),this._updateLayoutProperty("icon-allow-overlap",o.allowOverlap,n.allowOverlap),this._updateLayoutProperty("icon-anchor",o.anchor,n.anchor),this._updateLayoutProperty("icon-ignore-placement",o.ignorePlacement,n.ignorePlacement),this._updateLayoutProperty("icon-image",o.image,n.image),this._updateLayoutProperty("icon-offset",o.offset,n.offset),this._updatePaintProperty("icon-opacity",o.opacity,n.opacity),this._updateLayoutProperty("icon-optional",o.optional,n.optional),this._updateLayoutProperty("icon-padding",o.padding,n.padding),this._updateLayoutProperty("icon-pitch-alignment",o.pitchAlignment,n.pitchAlignment),this._updateLayoutProperty("icon-rotate",o.rotation,n.rotation),this._updateLayoutProperty("icon-rotation-alignment",o.rotationAlignment,n.rotationAlignment),this._updateLayoutProperty("icon-size",o.size,n.size),this._updateLayoutProperty("text-allow-overlap",i.allowOverlap,e.allowOverlap),this._updateLayoutProperty("text-anchor",i.anchor,e.anchor),this._updatePaintProperty("text-color",i.color,e.color),this._updateLayoutProperty("text-font",i.font,e.font),this._updateLayoutProperty("text-ignore-placement",i.ignorePlacement,e.ignorePlacement),this._updateLayoutProperty("text-justify",i.justify,e.justify),this._updatePaintProperty("text-halo-blur",i.haloBlur,e.haloBlur),this._updatePaintProperty("text-halo-color",i.haloColor,e.haloColor),this._updatePaintProperty("text-halo-width",i.haloWidth,e.haloWidth),this._updateLayoutProperty("text-offset",i.offset,e.offset),this._updatePaintProperty("text-opacity",i.opacity,e.opacity),this._updateLayoutProperty("text-optional",i.optional,e.optional),this._updateLayoutProperty("text-padding",i.padding,e.padding),this._updateLayoutProperty("text-pitch-alignment",i.pitchAlignment,e.pitchAlignment),this._updateLayoutProperty("text-radial-offset",i.radialOffset,e.radialOffset),this._updateLayoutProperty("text-rotate",i.rotation,e.rotation),this._updateLayoutProperty("text-rotation-alignment",i.rotationAlignment,e.rotationAlignment),this._updateLayoutProperty("text-size",i.size,e.size),this._updateLayoutProperty("text-variable-anchor",i.variableAnchor,e.variableAnchor),this._updateLayoutProperty("text-field",i.textField,e.textField)}this.options=t},cc.prototype._buildLayers=function(){var e=sc(sc(sc(sc({id:this.id,type:"symbol"},this.options.sourceLayer&&{"source-layer":this.options.sourceLayer}),{source:this.options.source instanceof is?this.options.source.getId():this.options.source,layout:sc(sc({visibility:this.options.visible?"visible":"none","symbol-placement":this.options.placement,"symbol-spacing":this.options.lineSpacing,"symbol-z-order":this.options.zOrder,"text-allow-overlap":this.options.textOptions.allowOverlap,"text-anchor":this.options.textOptions.anchor},this.options.textOptions.textField&&{"text-field":this.options.textOptions.textField}),{"text-font":this.options.textOptions.font,"text-ignore-placement":this.options.textOptions.ignorePlacement,"text-justify":this.options.textOptions.justify,"text-offset":this.options.textOptions.offset,"text-optional":this.options.textOptions.optional,"text-padding":this.options.textOptions.padding,"text-pitch-alignment":this.options.textOptions.pitchAlignment,"text-rotate":this.options.textOptions.rotation,"text-rotation-alignment":this.options.textOptions.rotationAlignment,"text-size":this.options.textOptions.size,"icon-allow-overlap":this.options.iconOptions.allowOverlap,"icon-anchor":this.options.iconOptions.anchor,"icon-ignore-placement":this.options.iconOptions.ignorePlacement,"icon-image":this.options.iconOptions.image,"icon-offset":this.options.iconOptions.offset,"icon-optional":this.options.iconOptions.optional,"icon-padding":this.options.iconOptions.padding,"icon-pitch-alignment":this.options.iconOptions.pitchAlignment,"icon-rotate":this.options.iconOptions.rotation,"icon-rotation-alignment":this.options.iconOptions.rotationAlignment,"icon-size":this.options.iconOptions.size}),paint:{"text-color":this.options.textOptions.color,"text-halo-blur":this.options.textOptions.haloBlur,"text-halo-color":this.options.textOptions.haloColor,"text-halo-width":this.options.textOptions.haloWidth,"text-opacity":this.options.textOptions.opacity,"icon-opacity":this.options.iconOptions.opacity}}),this.options.filter&&{filter:this.options.filter}),{minzoom:this.options.minZoom,maxzoom:this.options.maxZoom});return void 0!==this.options.sortKey&&(e.layout["symbol-sort-key"]=this.options.sortKey),void 0!==this.options.textOptions.radialOffset&&(e.layout["text-radial-offset"]=this.options.textOptions.radialOffset),void 0!==this.options.textOptions.variableAnchor&&(e.layout["text-variable-anchor"]=this.options.textOptions.variableAnchor),[e]},cc.prototype._getLayerIds=function(){return[this.id]},cc.prototype._getSourceIds=function(){var e=new Set;return this.options.source instanceof is?e.add(this.options.source.getId()):e.add(this.options.source),e},cc);function cc(e,t,r){t=ic.call(this,t)||this;return t.options=(new rc).merge(es(r,rc._cloneCustomizer)),t.options.source=e||t.options.source,t}var uc,lc,Ee=window&&window.__extends||(uc=function(e,t){return(uc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}uc(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),hc=window&&window.__assign||function(){return(hc=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)},pc=(Ee(dc,lc=is),dc.prototype._buildSource=function(){return this.source},dc.prototype._isDeepEqual=function(e){if(this.constructor!==e.constructor)return!1;var t=this.source,r=e.source,o=t.type===r.type&&t.url===r.url&&(void 0===t.tiles&&void 0===r.tiles||t.tiles&&r.tiles&&t.tiles.length===r.tiles.length&&t.tiles.every(function(e,t){return e===r.tiles[t]}))&&t.minzoom===r.minzoom&&t.maxzoom===r.maxzoom&&t.bounds===r.bounds&&t.attribution===r.attribution,n="raster"!==t.type||"raster"===t.type&&t.type===r.type&&t.tileSize===r.tileSize&&t.scheme===r.scheme,e="raster-dem"!==t.type||"raster-dem"===t.type&&t.type===r.type&&t.tileSize===r.tileSize&&t.encoding===r.encoding,t="vector"!==t.type||"vector"===t.type&&t.type===r.type&&t.promoteId===r.promoteId&&t.scheme===r.scheme;return o&&n&&e&&t},dc.prototype._modifySource=function(e,t){if(e.tiles){var r=e.tiles.map(function(e){return"string"==typeof e?e:new D({domain:u,path:e.path,queryParams:hc(hc({},t),e.queryParams)}).toString()});e.tiles=r}else{if(!e.url)throw new Error("Source definition must define a TileJSON 'url' or a 'tiles' array.");e.url="string"==typeof e.url?e.url:new D({domain:u,path:e.url.path,queryParams:hc(hc({},t),e.url.queryParams)}).toString()}return e},dc);function dc(e,t,r){e=lc.call(this,e)||this;return e.source=e._modifySource(t,r),e}var fc,gc,yc=((window&&window.__extends||(fc=function(e,t){return(fc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}fc(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}))(mc,gc=Ie),mc);function mc(){var e=null!==gc&&gc.apply(this,arguments)||this;return e.bounds=[-180,-85.0511,180,85.0511],e.minSourceZoom=0,e.maxSourceZoom=22,e.tileSize=512,e.isTMS=!1,e.subdomains=void 0,e.tileUrl=void 0,e}var vc,_c,Ie=window&&window.__extends||(vc=function(e,t){return(vc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}vc(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),wc=window&&window.__assign||function(){return(wc=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)},bc=window&&window.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],o=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&o>=e.length?void 0:e)&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Cc=(Ie(Ec,_c=da),Ec.prototype.getOptions=function(){return es(this.options,yc._cloneCustomizer)},Ec.prototype.setOptions=function(e){e=(new yc).merge(this.options,es(e,yc._cloneCustomizer));if(this.map){if(!$o(e.bounds,this.options.bounds)||e.isTMS!==this.options.isTMS||e.maxSourceZoom!==this.options.maxSourceZoom||e.minSourceZoom!==this.options.minSourceZoom||!$o(e.subdomains,this.options.subdomains)||e.tileSize!==this.options.tileSize||e.tileUrl!==this.options.tileUrl)return this.options=e,void this.map.layers.add(this);this._updateBaseProperties(e,this.options),this._updatePaintProperty("raster-contrast",e.contrast,this.options.contrast),this._updatePaintProperty("raster-fade-duration",e.fadeDuration,this.options.fadeDuration),this._updatePaintProperty("raster-hue-rotate",e.hueRotation,this.options.hueRotation),this._updatePaintProperty("raster-brightness-max",e.maxBrightness,this.options.maxBrightness),this._updatePaintProperty("raster-opacity",e.opacity,this.options.opacity),this._updatePaintProperty("raster-saturation",e.saturation,this.options.saturation)}this.options=e},Ec.prototype._setOptionsNoUpdate=function(e){this.options=(new yc).merge(this.options,es(e,yc._cloneCustomizer))},Ec.prototype._buildLayers=function(){return[wc(wc({id:this.id,type:"raster",source:this._getSourceId(),layout:{visibility:this.options.visible?"visible":"none"},paint:{"raster-contrast":this.options.contrast,"raster-fade-duration":this.options.fadeDuration,"raster-hue-rotate":this.options.hueRotation,"raster-brightness-max":this.options.maxBrightness,"raster-brightness-min":this.options.minBrightness,"raster-opacity":this.options.opacity,"raster-saturation":this.options.saturation}},this.options.filter&&{filter:this.options.filter}),{minzoom:this.options.minZoom,maxzoom:this.options.maxZoom})]},Ec.prototype._getLayerIds=function(){return[this.id]},Ec.prototype._buildSource=function(){var e,t;if(this.options.tileUrl){if(-1===this.options.tileUrl.indexOf("{"))return{type:"raster",url:this.options.tileUrl};if(-1!==this.options.tileUrl.indexOf("{subdomain}")){if(!(this.options.subdomains&&0<this.options.subdomains.length))throw new Error("The {subdomain} placeholder was included in the tileUrl but no subdomains were specified");var r=[];try{for(var o=bc(this.options.subdomains),n=o.next();!n.done;n=o.next()){var i=n.value;r.push(this.options.tileUrl.replace(/{subdomain}/g,i))}}catch(e){t={error:e}}finally{try{n&&!n.done&&(e=o.return)&&e.call(o)}finally{if(t)throw t.error}}t=r}else t=[this.options.tileUrl]}return wc({type:"raster",bounds:this.options.bounds,maxzoom:this.options.maxSourceZoom,minzoom:this.options.minSourceZoom,scheme:this.options.isTMS?"tms":"xyz",tileSize:this.options.tileSize},t&&{tiles:t})},Ec.prototype._getSourceId=function(){return this.getId()+"-RasterSource"},Ec.prototype._getSourceWrapper=function(){var e=this._getSourceId(),t=this._buildSource();return new pc(e,{name:e,tiles:t.tiles,type:t.type,url:t.url})},Ec);function Ec(e,t){t=_c.call(this,t)||this;return e&&t.setOptions(e),t}var Sc,Tc,Ic=((window&&window.__extends||(Sc=function(e,t){return(Sc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Sc(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}))(Ac,Tc=K),Ac);function Ac(){var e=null!==Tc&&Tc.apply(this,arguments)||this;return e.renderer=void 0,e}var kc,Pc,Oc=((window&&window.__extends||(kc=function(e,t){return(kc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}kc(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}))(Rc,Pc=Us),Rc.prototype.getOptions=function(){return es(this.options,Ic._cloneCustomizer)},Rc.prototype.setOptions=function(e){e=(new Ic).merge(this.options,es(e,Ic._cloneCustomizer));this.map&&this.map.triggerRepaint(),this.options=e},Rc.prototype.onAdd=function(e){var t,r;Pc.prototype.onAdd.call(this,e),this.map.events.add("stylechanged",this._onStyleChange),this.options.renderer&&this.glContext&&null!==(r=(t=this.options.renderer).onAdd)&&void 0!==r&&r.call(t,e,this.glContext)},Rc.prototype.onRemove=function(){var e,t;this.options.renderer&&this.glContext&&null!==(t=(e=this.options.renderer).onRemove)&&void 0!==t&&t.call(e,this.map,this.glContext),this.map.events.remove("stylechanged",this._onStyleChange),this.glContext=null,Pc.prototype.onRemove.call(this)},Rc.prototype._buildLayers=function(){var n=this;if(!this.options.renderer)throw new Error("Cannot build the WebGL layer because renderer was not set.");return[{id:this.id,type:"custom",renderingMode:this.options.renderer.renderingMode,onAdd:function(e,t){n.glContext=t},onRemove:function(e,t){},prerender:function(e,t){var r,o;n._shouldRender()&&null!==(o=(r=n.options.renderer).prerender)&&void 0!==o&&o.call(r,e,t)},render:function(e,t){n._shouldRender()&&n.options.renderer.render(e,t)}}]},Rc.prototype._getLayerIds=function(){return[this.id]},Rc.prototype._getSourceIds=function(){return(new Set).add(this.source.getId())},Rc.prototype._shouldRender=function(){if(this.map){var e=this.map.getCamera().zoom;return this.options.visible&&this.options.minZoom<=e&&this.options.maxZoom>e}return!1},Rc);function Rc(e,t){var r=Pc.call(this,e)||this;return r._onStyleChange=function(){var e,t;r.map._getMap().getLayer(r.id)||(e=r.map,t=null===(t=r.map.layers._getUserLayers().find(function(e){return e.layer.getId()==r.id}))||void 0===t?void 0:t.before,e.layers.remove(r),e.layers.add(r,t))},r.options=(new Ic).merge(es(t,Ic._cloneCustomizer)),r.source=new ls,r}var Pe=Object.freeze({__proto__:null,BubbleLayer:Vs,Layer:Us,LineLayer:Ta,PolygonExtrusionLayer:Pe,PolygonLayer:Ka,SymbolLayer:ac,TileLayer:Cc,HeatMapLayer:ve,ImageLayer:Ne,WebGLLayer:Oc}),xc=(Mc.convertHtmlString=function(e){if("string"!=typeof e)return e;var t=document.createElement("div");return t.innerHTML=e,t},Mc.parseWithFilter=function(e,t,r,o){var n=this;if(void 0===t&&(t=function(e){return!0}),void 0===r&&(r=function(e){return e}),void 0===o&&(o=function(){return document.createElement("div")}),"string"==typeof e){var i=(new DOMParser).parseFromString(e,"text/html").body;if(0==i.children.length)return r(i.innerHTML);var s,i=1==i.children.length&&1==i.childNodes.length?i.children[0]:(s=o(),Array.from(i.childNodes).map(function(e){return s.append(e)}),s)}else i=e;return Array.from(i.children).forEach(function(e){return n.parseWithFilter(e,t,r)}),t(i)?r(i):(i.parentNode&&i.parentNode.removeChild(i),null)},Mc);function Mc(){}var Nc,Lc,Dc=function(e){return wt(e)&&1===e.nodeType&&!Zr(e)},qc=((window&&window.__extends||(Nc=function(e,t){return(Nc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Nc(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}))(Uc,Lc=k),Uc._cloneCustomizer=function(e){if(Dc(e))return e},Uc);function Uc(){var e=null!==Lc&&Lc.apply(this,arguments)||this;return e.anchor="none",e.draggable=!1,e.closeButton=!0,e.content=document.createElement("span"),e.fillColor="#FFFFFF",e.pixelOffset=new an(0,0),e.position=new gi(0,0),e.showPointer=!0,e}var jc,Hc,ve=window&&window.__extends||(jc=function(e,t){return(jc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}jc(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),Bc=window&&window.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var o,n,i=r.call(e),s=[];try{for(;(void 0===t||0<t--)&&!(o=i.next()).done;)s.push(o.value)}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return s},zc=(ve(Fc,Hc=Q),Fc.prototype.setPopupOptions=function(e){this.setOptions(e)},Fc.prototype.setOptions=function(e){var t=(new qc).merge(this.options,es(e,qc._cloneCustomizer));t.content!==this.options.content?(this.htmlContent.remove(),this.htmlContent=this._createHtmlContent(t),this.contentDiv.prepend(this.htmlContent)):t.draggable!==this.options.draggable&&this._setDraggable(this.htmlContent,t.draggable),t.closeButton&&!this.closeBtn?(this.closeBtn=this._createCloseButton(),this.contentDiv.appendChild(this.closeBtn),e=B("close"),this.contentDiv.appendChild(e),z(e,this.closeBtn,!0)):!t.closeButton&&this.closeBtn&&(this.contentDiv.removeChild(this.closeBtn),delete this.closeBtn),t.showPointer&&!this.arrowDiv?(this.arrowDiv=this._createArrowDiv(),this.containerDiv.appendChild(this.arrowDiv)):!t.showPointer&&this.arrowDiv&&(this.containerDiv.removeChild(this.arrowDiv),delete this.arrowDiv),t.fillColor!==this.options.fillColor&&(this.containerDiv.style.borderColor=t.fillColor,this.contentDiv.style.backgroundColor=t.fillColor),this.marker&&(t.anchor!==this.options.anchor?"none"===this.options.anchor?(this.autoAnchor!==t.anchor&&this._replaceMarker(this.map,t),this.map.events.remove("move",this._onMove),delete this.autoAnchor):(this._replaceMarker(this.map,t),"none"===t.anchor&&this.map.events.add("move",this._onMove)):($o(t.position,this.options.position)||this.marker.setLngLat(t.position),$o(t.pixelOffset,this.options.pixelOffset)||this.marker.setOffset(t.pixelOffset))),this.options=t},Fc.prototype.getPopupOptions=function(){return this.getOptions()},Fc.prototype.getOptions=function(){return es(this.options,qc._cloneCustomizer)},Fc.prototype.getPopupContainer=function(){return this.containerDiv},Fc.prototype._dragToPixel=function(e){this.dragging||(this.dragging=!0,this.contentDiv.style.pointerEvents="none",this._invokeEvent("dragstart",{type:"dragstart",target:this}));e=[e[0]+this.dragOffset[0],e[1]+this.dragOffset[1]],e=Bc(this.map.pixelsToPositions([e]),1)[0];this.options.position=e,this.marker.setLngLat(this.options.position),this._invokeEvent("drag",{type:"drag",target:this})},Fc.prototype._onUp=function(){this.dragging&&(this.contentDiv.style.pointerEvents="",this._invokeEvent("dragend",{type:"dragend",target:this}),"none"===this.options.anchor&&this._onMove()),delete this.dragOffset,delete this.dragging},Fc.prototype._createContainerDiv=function(e){var t=this,r=document.createElement("div");r.classList.add(Fc.Css.container),r.classList.add(Fc.Css.hidden),r.style.borderColor=e.fillColor,r.setAttribute("role","dialog"),r.setAttribute("aria-label","Map Information Window");var o=!1;return r.addEventListener("keydown",function(e){"Tab"!==e.key&&"Escape"!==e.key&&"Esc"!==e.key||(o=!0)}),r.addEventListener("keyup",function(e){"Tab"!==e.key&&"Escape"!==e.key&&"Esc"!==e.key||(o=!1)}),r.addEventListener("focusin",function(e){t.map&&!t.isOpen()&&(t.open(t.map),e.target instanceof HTMLElement&&e.target.focus())}),r.addEventListener("focusout",function(e){o&&e.relatedTarget instanceof Node&&!r.contains(e.relatedTarget)&&(o=!1,t.isOpen()&&t.close())}),r},Fc.prototype._createContentDiv=function(e){var t=document.createElement("div");return t.classList.add(Fc.Css.content),t.style.backgroundColor=e.fillColor,t.setAttribute("tabindex","0"),this.htmlContent=this._createHtmlContent(e),t.appendChild(this.htmlContent),t},Fc.prototype._createArrowDiv=function(){var e=document.createElement("div");return e.classList.add(Fc.Css.arrow),e},Fc.prototype._createCloseButton=function(){var e=document.createElement("button");return e.addEventListener("click",this.close),e.classList.add(Fc.Css.close),e.setAttribute("aria-label","close"),e.setAttribute("tabindex","0"),e.innerHTML="&times;",e},Fc.prototype._createHtmlContent=function(e){var t=xc.convertHtmlString(e.content);return e.draggable&&this._setDraggable(t,e.draggable),t},Fc.prototype._createMarker=function(e,t){var r=this.marker?this.marker.getLngLat():e.position,r="none"===e.anchor?(this.autoAnchor=t||"bottom",this.containerDiv.classList.add(this.autoAnchor),new h.Marker({anchor:this.autoAnchor,element:this.containerDiv,offset:e.pixelOffset}).setLngLat(r)):(this.containerDiv.classList.add(e.anchor),new h.Marker({anchor:e.anchor,element:this.containerDiv,offset:e.pixelOffset}).setLngLat(r));return r},Fc.prototype._getAutoAnchor=function(e,t){var r,o,n,i=this.containerDiv.offsetWidth,s=this.containerDiv.offsetHeight,a=[];return(n=this.marker?(o=(r=e._getMap().project(this.marker.getLngLat())).x,r.y):(n=Bc(e.positionsToPixels([t.position]),1),o=(n=Bc(n[0],2))[0],n[1]))<s?a.push("top"):n>e.getCanvas().offsetHeight-s&&a.push("bottom"),o<i/2?a.push("left"):o>e.getCanvas().offsetWidth-i/2&&a.push("right"),0<a.length?a.join("-"):"bottom"},Fc.prototype._replaceMarker=function(e,t,r){var o=this.containerDiv.nextElementSibling;this.marker.remove(),this.containerDiv.classList.remove(this.autoAnchor||this.options.anchor),this.marker=this._createMarker(t,r),this.marker.addTo(e._getMap()),e.popups._getCollectionDiv().insertBefore(this.containerDiv,o||null)},Fc.prototype._setDraggable=function(e,t){t?(e.addEventListener("mousedown",this._onDown),e.addEventListener("touchstart",this._onDown),e.addEventListener("dragstart",this._onDragStart)):(e.removeEventListener("mousedown",this._onDown),e.removeEventListener("touchstart",this._onDown),e.removeEventListener("dragstart",this._onDragStart))},Fc.Css={arrow:"popup-arrow",close:"popup-close",container:"popup-container",content:"popup-content-container",hidden:"hidden-accessible-element"},Fc);function Fc(e){var r=Hc.call(this)||this;return r.attach=function(e){r.map!==e&&(r.map&&r.remove(),r.map=e,r.marker=r._createMarker(r.options),r.marker.addTo(r.map._getMap()),r.map.popups._getCollectionDiv().appendChild(r.containerDiv),r.map.popups.add(r))},r.open=function(e){if(!e&&!r.map)throw new Error("Must specify a map to open on or attach to a map in advance");r.attach(e||r.map),r.containerDiv.classList.remove(Fc.Css.hidden),r.map.events.add("move",r._onMove),r._onMove(),r._invokeEvent("open",{target:r,type:"open"})},r.close=function(){r.map&&r.map.events.remove("move",r._onMove),r.containerDiv.classList.add(Fc.Css.hidden),r._invokeEvent("close",{target:r,type:"close"})},r.remove=function(){r.map&&(r.marker.remove(),r.containerDiv.classList.remove(r.autoAnchor||r.options.anchor),r.map.events.remove("move",r._onMove),r.map.popups.remove(r),delete r.map,delete r.marker,delete r.autoAnchor)},r.isOpen=function(){return r.map&&!r.containerDiv.classList.contains(Fc.Css.hidden)},r._onMove=function(){var e=r._getAutoAnchor(r.map,r.options);e!==r.autoAnchor&&(r._replaceMarker(r.map,r.options,e),r.map.events.add("move",r._onMove))},r._onDown=function(e){r.map.popups._addDraggedPopup(r);var t=Bc(r.map.positionsToPixels([r.options.position]),1)[0];"mousedown"===e.type?r.dragOffset=[t[0]-e.clientX,t[1]-e.clientY]:"touchstart"===e.type&&(r.dragOffset=[t[0]-e.touches[0].clientX,t[1]-e.touches[0].clientY])},r._onDragStart=function(e){e.preventDefault()},r.options=(new qc).merge(es(e,qc._cloneCustomizer)),r.containerDiv=r._createContainerDiv(r.options),r.contentDiv=r._createContentDiv(r.options),r.containerDiv.appendChild(r.contentDiv),r.options.showPointer&&(r.arrowDiv=r._createArrowDiv(),r.containerDiv.appendChild(r.arrowDiv)),r.options.closeButton&&(r.closeBtn=r._createCloseButton(),r.contentDiv.appendChild(r.closeBtn),e=B("close"),r.contentDiv.appendChild(e),z(e,r.closeBtn,!0)),r}var Kc,Gc,Yc=((window&&window.__extends||(Kc=function(e,t){return(Kc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Kc(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}))(Zc,Gc=k),Zc._cloneCustomizer=function(e){if(e instanceof zc||Dc(e))return e},Zc);function Zc(){var e=null!==Gc&&Gc.apply(this,arguments)||this;return e.anchor="bottom",e.color="#1A73AA",e.draggable=!1,e.htmlContent='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24.5 36.5" id="marker_'+tn()+'" width="24.5" height="36.5" display="block"><path d="M12.25.25a12.2543,12.2543,0,0,0-12,12.4937c0,6.4436,6.4879,12.1093,11.059,22.5641.5493,1.2563,1.3327,1.2563,1.882,0C17.7621,24.8529,24.25,19.1857,24.25,12.7437A12.2543,12.2543,0,0,0,12.25.25Z" fill="{color}" stroke="{secondaryColor}" stroke-width="0.5"/><text style="font-family: Arial, Helvetica, sans-serif; font-size: 14px; fill: white;" text-anchor="middle" x="12" y="18">{text}</text></svg>',e.pixelOffset=new an(0,0),e.position=new gi(0,0),e.popup=void 0,e.secondaryColor="white",e.text=void 0,e.visible=!0,e}var Wc,Vc,Jc=((window&&window.__extends||(Wc=function(e,t){return(Wc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Wc(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}))(Qc,Vc=Q),Qc.prototype.getOptions=function(){return es(this.options,Yc._cloneCustomizer)},Qc.prototype.getElement=function(){return this.marker.getElement()},Qc.prototype.setOptions=function(e){e=(new Yc).merge(this.options,es(e,Yc._cloneCustomizer));$o(e.htmlContent,this.options.htmlContent)&&e.anchor===this.options.anchor?("string"!=typeof e.htmlContent||e.color===this.options.color&&e.text===this.options.text&&e.secondaryColor===this.options.secondaryColor||(this.element.innerHTML=this._getSubbedHtmlString(e)||""),e.draggable!==this.options.draggable&&(this._setDraggable(e.draggable),this.marker.setDraggable(e.draggable)),$o(e.pixelOffset,this.options.pixelOffset)||this.marker.setOffset(e.pixelOffset),$o(e.position,this.options.position)||this.marker.setLngLat(e.position),e.visible!==this.options.visible&&(e.visible?this.element.classList.remove(Qc.hiddenClass):this.element.classList.add(Qc.hiddenClass))):(this.marker.remove(),this._buildMarker(e),this.map&&(this.marker.addTo(this.map._getMap()),this._getCollectionContainer().appendChild(this.element))),this.options=e},Qc.prototype.togglePopup=function(){if(this.options.popup)if(this.options.popup.isOpen())this.options.popup.close();else{if(!this.map)throw new Error("The marker must be added to a map before calling togglePopup().");this.options.popup.setOptions({position:this.options.position}),this.options.popup.open(this.map)}},Qc.prototype._addToMap=function(e,t){this.map&&this.map!==e&&this._removeFromMap(),t&&(this.options.position=Hr(t),this.marker.setLngLat(this.options.position)),this.map!==e&&(this.map=e,this.marker.addTo(e._getMap()),this._getCollectionContainer().appendChild(this.element))},Qc.prototype._removeFromMap=function(){this.map&&(this.marker.remove(),delete this.map)},Qc.prototype._getId=function(){if(this.element)return("string"==typeof this.options.htmlContent?this.element.firstChild:this.element).id},Qc.prototype._buildMarker=function(e){var t;"string"==typeof e.htmlContent?(t=this._getSubbedHtmlString(e)||"",this.element=xc.convertHtmlString(t)):this.element=e.htmlContent,this.element.classList.add(Qc.containerClass),e.draggable&&this._setDraggable(!0),e.visible||this.element.classList.add(Qc.hiddenClass),this.marker=new h.Marker({element:this.element,offset:e.pixelOffset,draggable:e.draggable,anchor:e.anchor}).setLngLat(e.position),this.marker.on("drag",this._onDrag),this.marker.on("dragstart",this._onDragStart),this.marker.on("dragend",this._onDragEnd),this.element.addEventListener("click",this._bubbleElementEvent),this.element.addEventListener("dblclick",this._bubbleElementEvent),this.element.addEventListener("contextmenu",this._bubbleElementEvent),this.element.addEventListener("keydown",this._bubbleElementEvent),this.element.addEventListener("keypress",this._bubbleElementEvent),this.element.addEventListener("keyup",this._bubbleElementEvent),this.element.addEventListener("mousedown",this._bubbleElementEvent),this.element.addEventListener("mouseenter",this._bubbleElementEvent),this.element.addEventListener("mouseleave",this._bubbleElementEvent),this.element.addEventListener("mousemove",this._bubbleElementEvent),this.element.addEventListener("mouseout",this._bubbleElementEvent),this.element.addEventListener("mouseover",this._bubbleElementEvent),this.element.addEventListener("mouseup",this._bubbleElementEvent)},Qc.prototype._getSubbedHtmlString=function(e){return"string"==typeof e.htmlContent?e.htmlContent.replace(/{color}/gi,e.color||"").replace(/{secondaryColor}/gi,e.secondaryColor||"").replace(/{text}/gi,e.text||""):null},Qc.prototype._getCollectionContainer=function(){var e=this.map.getCanvasContainer().querySelector("."+Qc.collectionContainerClass);return e||((e=document.createElement("div")).classList.add(Qc.collectionContainerClass),this.map.getCanvasContainer().appendChild(e)),e},Qc.prototype._setDraggable=function(e){e?this.element.addEventListener("dragstart",this._onEleDragStart):this.element.removeEventListener("dragstart",this._onEleDragStart)},Qc.collectionContainerClass="marker-collection-container",Qc.hiddenClass="hidden-accessible-element",Qc.containerClass="marker-container",Qc);function Qc(e){var t=Vc.call(this)||this;return t._onDrag=function(){var e=t.marker.getLngLat().wrap();t.options.position=new gi(e.lng,e.lat),t._invokeEvent("drag",{type:"drag",target:t})},t._onDragStart=function(){t._invokeEvent("dragstart",{type:"dragstart",target:t})},t._onDragEnd=function(){t._invokeEvent("dragend",{type:"dragend",target:t})},t._bubbleElementEvent=function(e){t._invokeEvent(e.type,{type:e.type,target:t})},t._onEleDragStart=function(e){e.preventDefault()},t.options=(new Yc).merge(es(e,Yc._cloneCustomizer)),t._buildMarker(t.options),t}var Xc=($c.parse=function(e){var t=(e=e.toLowerCase()).lastIndexOf("-");return-1!==t?{code:e,language:e.substring(0,t),region:e.substring(t+1)}:{code:e,language:e}},$c);function $c(){}var eu={localizationsPath:"locs/mapcontrol/2019-3-12",sensitiveUserRegions:["il","kr","pk","in","cn","ar","bh","eg","jo","sa","kw","om","qa","ma","ae"],locales:{defaultLanguage:{defaultRegion:{code:"NGT",strings:"en/resource.json"},latn:{code:"NGT-Latn",strings:"en/resource.json"}},ar:{defaultRegion:{code:"ar",strings:"ar-sa/resource.json"}},bg:{defaultRegion:{code:"bg-BG",strings:"bg-bg/resource.json"}},cs:{defaultRegion:{code:"cs-CZ",strings:"cs-cz/resource.json"}},da:{defaultRegion:{code:"da-DK",strings:"da-dk/resource.json"}},de:{defaultRegion:{code:"de-DE",strings:"de-de/resource.json"}},el:{defaultRegion:{code:"el-GR",strings:"el-gr/resource.json"}},en:{defaultRegion:{code:"en",strings:"en/resource.json"},us:{code:"en-US",strings:"en/resource.json"},au:{code:"en-AU",strings:"en/resource.json"},gb:{code:"en-GB",strings:"en/resource.json"},nz:{code:"en-NZ",strings:"en/resource.json"}},es:{defaultRegion:{code:"es-ES",strings:"es-es/resource.json"},mx:{code:"es-MX",strings:"es-mx/resource.json"}},fi:{defaultRegion:{code:"fi-FI",strings:"fi-fi/resource.json"}},fr:{defaultRegion:{code:"fr-FR",strings:"fr-fr/resource.json"}},hu:{defaultRegion:{code:"hu-HU",strings:"hu-hu/resource.json"}},id:{defaultRegion:{code:"id-ID",strings:"id-id/resource.json"}},it:{defaultRegion:{code:"it-IT",strings:"it-it/resource.json"}},ko:{defaultRegion:{code:"ko-KR",strings:"ko-kr/resource.json"}},lt:{defaultRegion:{code:"lt-LT",strings:"lt-lt/resource.json"}},ms:{defaultRegion:{code:"ms-MY",strings:"ms-my/resource.json"}},nb:{defaultRegion:{code:"nb-NO",strings:"nb-no/resource.json"}},nl:{defaultRegion:{code:"nl-NL",strings:"nl-nl/resource.json"}},pl:{defaultRegion:{code:"pl-PL",strings:"pl-pl/resource.json"}},pt:{defaultRegion:{code:"pt-PT",strings:"pt-pt/resource.json"},br:{code:"pt-BR",strings:"pt-br/resource.json"}},ru:{defaultRegion:{code:"ru-RU",strings:"ru-ru/resource.json"}},sk:{defaultRegion:{code:"sk-SK",strings:"sk-sk/resource.json"}},sl:{defaultRegion:{code:"sl-SL",strings:"sl-sl/resource.json"}},sv:{defaultRegion:{code:"sv-SE",strings:"sv-se/resource.json"}},th:{defaultRegion:{code:"th-TH",strings:"th-th/resource.json"}},tr:{defaultRegion:{code:"tr-TR",strings:"tr-tr/resource.json"}},zh:{defaultRegion:{code:"zh",strings:"en/resource.json"}},"zh-hans":{defaultRegion:{code:"zh-Hans",strings:"zh-cn/resource.json"},cn:{code:"zh-Hans-CN",strings:"zh-cn/resource.json"}},"zh-hant":{defaultRegion:{code:"zh-Hant",strings:"en/resource.json"},tw:{code:"zh-Hant-TW",strings:"zh-tw/resource.json"}}}},tu=function(){this.Unknown="Unknown",this.Accident="Accident",this.Fog="Fog",this.Danger="Danger",this.Rain="Rain",this.Ice="Ice",this.Jam="Jam",this.LaneClosed="Lane Closed",this.RoadClosed="Road Closed",this.RoadWorks="Road Works",this.Wind="Wind",this.Flood="Flood",this.Detour="Detour"},ru=(ou.getCode=function(e){var t=Xc.parse(e);return-1===eu.sensitiveUserRegions.indexOf(t.region)?this.getLocaleData(t).code:e},ou.getStrings=function(e){e=this.getLocaleData(e);return eu.locales.defaultLanguage.defaultRegion.code===e.code?new Promise(function(e){e(new tu)}):new D({domain:t,path:eu.localizationsPath+"/"+e.strings}).get().then(function(e){return e},function(){return new tu})},ou.getLocaleData=function(e){if("string"==typeof e&&(e=Xc.parse(e)),eu.locales[e.code])return eu.locales[e.code].defaultRegion;var t;if(eu.locales[e.language])t=eu.locales[e.language];else{if(-1!==e.language.indexOf("-"))return this.getLocaleData(e.language);t=eu.locales.defaultLanguage}return e.region&&t[e.region]?t[e.region]:t.defaultRegion},ou);function ou(){}var nu=(iu.getEdgeOrIEVersion=function(){var e=window.navigator.userAgent,t=e.indexOf("MSIE ");if(0<t)return parseInt(e.substring(t+5,e.indexOf(".",t)),10);if(0<e.indexOf("Trident/")){var r=e.indexOf("rv:");return parseInt(e.substring(r+3,e.indexOf(".",r)),10)}r=e.indexOf("Edge/");return 0<r?parseInt(e.substring(r+5,e.indexOf(".",r)),10):-1},iu.isEdgeOrIE=function(){return-1!==this.getEdgeOrIEVersion()},iu.isIE=function(){var e=this.getEdgeOrIEVersion();return-1!==e&&e<=11},iu);function iu(){}var su,Ne=window&&window.__extends||(su=function(e,t){return(su=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}su(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),au=window&&window.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var o,n,i=r.call(e),s=[];try{for(;(void 0===t||0<t--)&&!(o=i.next()).done;)s.push(o.value)}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return s},cu=window&&window.__spreadArray||function(e,t){for(var r=0,o=t.length,n=e.length;r<o;r++,n++)e[n]=t[r];return e};(ve=l.AuthenticationType||(l.AuthenticationType={})).subscriptionKey="subscriptionKey",ve.aad="aad",ve.anonymous="anonymous",ve.sas="sas";var uu,lu,hu=(Ne(pu,uu=k),pu.prototype.setSubscriptionKey=function(e){this.authType=l.AuthenticationType.subscriptionKey,this.subscriptionKey=e},pu.prototype.setAadProperties=function(e,t,r,o,n){this.authType=l.AuthenticationType.aad,this.authContext=n||this.authContext,this.aadInstance=o||this.aadInstance,this.clientId=e,this.aadAppId=t,this.aadTenant=r},pu.prototype.setTokenCallbackFunction=function(e){this.authType=l.AuthenticationType.anonymous,this.getToken=e},pu.prototype.setSasCallbackFunction=function(e){this.authType=l.AuthenticationType.sas,this.getToken=e},pu.prototype.merge=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=uu.prototype.merge.apply(this,cu([],au(e)));return r.authType===l.AuthenticationType.subscriptionKey?r.authContext=r.aadAppId=r.getToken=void 0:r.authType===l.AuthenticationType.aad?r.subscriptionKey=r.getToken=void 0:r.authType===l.AuthenticationType.anonymous?r.subscriptionKey=r.authContext=r.aadAppId=void 0:r.authType===l.AuthenticationType.sas&&(r.authContext=r.subscriptionKey=r.aadAppId=void 0),r},pu);function pu(){var e=null!==uu&&uu.apply(this,arguments)||this;return e.authType=void 0,e.subscriptionKey=void 0,e.clientId=void 0,e.aadAppId=void 0,e.aadTenant=void 0,e.aadInstance=void 0,e.getToken=void 0,e.sasToken=void 0,e.authContext=void 0,e}var du="NGT",fu=tn(),gu=e,yu=t,mu=r,vu=o,_u=w,wu=new hu,bu=!1,Cu=!1,Eu=!1,Su=!1,Tu=!1,Iu=!1,Au=!1,ku=!1,Pu=!1;function Ou(){return Object.assign({},wu)}function Ru(){return yu}function xu(){return gu}function Mu(){return mu}function Nu(){return vu}function Lu(){return _u}function Du(){return h.workerCount}function qu(){return h.maxParallelImageRequests}function Uu(){return du}function ju(){return fu}function Hu(){return wu.authType===l.AuthenticationType.subscriptionKey?wu.subscriptionKey:void 0}function Bu(){return lu}function zu(e){return!nu.isIE()&&h.supported({failIfMajorPerformanceCaveat:e})}function Fu(e){wu=(new hu).merge(wu,e),Pu=!0}function Ku(e){gu=e,Cu=!0}function Gu(e){mu=e,Eu=!0}function Yu(e){0<e&&(h.workerCount=e,Tu=!0)}function Zu(e){0<e&&(h.maxParallelImageRequests=e,Iu=!0)}function Wu(e){du=ru.getCode(e),Au=!0}function Vu(e){fu=e,ku=!0}function Ju(e){wu.setSubscriptionKey(e),Pu=!0}function Qu(e){lu=e,bu=!0}function Xu(e,t){if(t=Math.abs(t||1),"string"==typeof e&&al[e.toLowerCase()]){for(var r=al[e.toLowerCase()],o=/calc\(([0-9.]+)[px]*\s*\*\s*\{scale\}\)/gi,n=r,i=o.exec(r);i;)n=n.replace(i[0],parseFloat(i[1])*t+""),i=o.exec(r);return n=n.replace("{scale}",t+"")}throw new Error("Invalid templateName.")}function $u(){return Pu}function el(){return Cu}function tl(){return Eu}function rl(){return Tu}function ol(){return Iu}function nl(){return Au}function il(){return ku}function sl(){return bu}var al={marker:'<svg xmlns="http://www.w3.org/2000/svg" width="calc(27 * {scale})" height="calc(39 * {scale})" viewBox="-1 -1 26 38"><path d="M12.25.25a12.254 12.254 0 0 0-12 12.494c0 6.444 6.488 12.109 11.059 22.564.549 1.256 1.333 1.256 1.882 0C17.762 24.853 24.25 19.186 24.25 12.744A12.254 12.254 0 0 0 12.25.25Z" style="fill:{color};stroke:{secondaryColor};stroke-width:1"/><text x="12.5" y="17.5" style="font-size:14px;fill:#fff;text-anchor:middle">{text}</text></svg>',"marker-thick":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(28 * {scale})" height="calc(39 * {scale})" viewBox="-1 -1 27 38"><path d="M12.25.25a12.254 12.254 0 0 0-12 12.494c0 6.444 6.488 12.109 11.059 22.564.549 1.256 1.333 1.256 1.882 0C17.762 24.853 24.25 19.186 24.25 12.744A12.254 12.254 0 0 0 12.25.25Z" style="fill:{color};stroke:{secondaryColor};stroke-width:2"/><text x="12.5" y="18.5" style="font-size:14px;fill:#fff;text-anchor:middle">{text}</text></svg>',"marker-circle":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(28 * {scale})" height="calc(39 * {scale})" viewBox="-1 -1 27 38"><path d="M12.25.25a12.254 12.254 0 0 0-12 12.494c0 6.444 6.488 12.109 11.059 22.564.549 1.256 1.333 1.256 1.882 0C17.762 24.853 24.25 19.186 24.25 12.744A12.254 12.254 0 0 0 12.25.25Z" style="fill:{color};stroke:{secondaryColor};stroke-width:1"/><circle cx="12.5" cy="12.5" r="9" fill="{secondaryColor}"/><text x="12" y="17.5" style="font-size:14px;fill:#000;text-anchor:middle">{text}</text></svg>',pin:'<svg xmlns="http://www.w3.org/2000/svg" width="calc(24 * {scale})" height="calc(28 * {scale})" viewBox="0 0 24 28"><path d="m11.988 16.615a5.15 5.15 0 0 1-2.268-.525 4.909 4.909 0 0 1-2.805-4.442 5.019 5.019 0 0 1 5.072-4.936h.012a5.03 5.03 0 0 1 5.085 4.961 4.907 4.907 0 0 1-.549 2.224 5.114 5.114 0 0 1-4.548 2.718zm0-8.06a3.173 3.173 0 0 0-3.226 3.099 3.081 3.081 0 0 0 1.77 2.782 3.299 3.299 0 0 0 4.365-1.386 3.049 3.049 0 0 0 .342-1.381 3.184 3.184 0 0 0-3.239-3.114h-.012z" fill="{secondaryColor}"/><path d="m11.999.922a10.908 10.908 0 0 0-11.076 10.732 10.639 10.639 0 0 0 4.418 8.598l6.658 6.464 6.658-6.463a10.537 10.537 0 0 0 2.198-15.041 11.182 11.182 0 0 0-8.856-4.289zm1.873 14.341a4.221 4.221 0 0 1-5.589-1.789 3.945 3.945 0 0 1-.445-1.8 4.164 4.164 0 0 1 8.323-.037 4.028 4.028 0 0 1-2.289 3.626Z" fill="{color}"/><path d="m11.999 28-7.256-7.044a11.611 11.611 0 0 1-4.743-9.303 11.844 11.844 0 0 1 11.988-11.652.102 .102 0 0 1 .02 0 12.164 12.164 0 0 1 9.577 4.647 11.357 11.357 0 0 1 2.299 8.614 11.521 11.521 0 0 1-4.63 7.695zm-.01-26.157a9.997 9.997 0 0 0-10.143 9.812 9.769 9.769 0 0 0 4.04 7.853l.099.083 6.014 5.838 6.113-5.922a9.7 9.7 0 0 0 3.945-6.505 9.533 9.533 0 0 0-1.933-7.229 10.305 10.305 0 0 0-8.116-3.931h-.021zm.021 14.772a5.11 5.11 0 0 1-4.547-2.718 4.868 4.868 0 0 1 .932-5.743 5.118 5.118 0 0 1 3.58-1.46h.024a5.031 5.031 0 0 1 5.084 4.938 4.92 4.92 0 0 1-2.805 4.457h0a5.152 5.152 0 0 1-2.269.525zm-.011-8.079h-.015a3.277 3.277 0 0 0-2.295.933 3.029 3.029 0 0 0-.587 3.58 3.297 3.297 0 0 0 4.364 1.386h0a3.092 3.092 0 0 0 1.772-2.795 3.185 3.185 0 0 0-3.239-3.105z" fill="{secondaryColor}"/><text x="12" y="17" style="font-size:14px;fill:#000;text-anchor:middle">{text}</text></svg>',"pin-round":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(25 * {scale})" height="calc(25 * {scale})" viewBox="0 0 25 25"><g transform="translate(0 1)"><circle cx="12.25" cy="11.5833" r="11" fill="{color}"/><path d="m12.25 23.583a12 12 0 1 1 12-12 12 12 0 0 1-12 12zm0-22a10 10 0 1 0 10 10 10 10 0 0 0-10-10z" fill="{secondaryColor}"/><circle cx="12.25" cy="11.5833" r="4.2386" fill="{secondaryColor}"/></g><text x="12.5" y="17" style="font-size:14px;fill:#000;text-anchor:middle">{text}</text></svg>',"marker-flat":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(27 * {scale})" height="calc(42.8 * {scale})" viewBox="0 0 1600 2570"><g fill="{color}"><path d="M691 2419c-409-575-641-1086-683-1504-10-106-10-136 5-224 31-188 105-330 241-458 129-124 270-190 453-214 69-9 113-10 182-1 373 46 655 326 703 698 40 308-120 801-424 1309-134 224-348 535-369 535-4 0-53-63-108-141z"/></g><g fill="rgba(0,0,0,0.15)" style="transform:scale(-1,1);transform-origin:center"><path d="M691 2419c-407-571-639-1083-682-1498-14-139-3-249 37-371 69-208 254-402 459-481 68-27 217-59 271-59h24v160 180 940 635c0 349-2 635-5 635-2 0-49-63-104-141z"/></g><circle cx="800" cy="800" r="600" fill="{secondaryColor}"/><text x="800" y="1100" style="font-size:800px;fill:#000;text-anchor:middle">{text}</text></svg>',"marker-arrow":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(25.47 * {scale})" height="calc(35.18 * {scale})" viewBox="0 0 4330 5980"><g fill="{color}"><path d="m2080 5969c-49-20-93-63-115-113-25-55-1928-5486-1953-5573-40-138 67-282 210-283 36 0 246 73 987 345 518 190 947 345 955 345 8 0 438-155 955-345 615-226 954-345 979-345 87 0 165 47 204 123 46 91 107-95-957 2942-537 1535-986 2805-997 2823-11 18-43 46-72 62-41 24-62 30-111 29-33 0-71-5-85-10z"/></g><g fill="{secondaryColor}"><path d="m2200 1600c-36 10-83 2-484-84-243-53-451-94-461-91-11 4-22 18-25 31-5 19 114 371 436 1292 244 697 448 1273 454 1281 19 24 50 30 71 12z"/><path d="m2200 1600c-36 10-83 2-484-84-243-53-451-94-461-91-11 4-22 18-25 31-5 19 114 371 436 1292 244 697 448 1273 454 1281 19 24 50 30 71 12z" style="transform:scale(-1,1);transform-origin:center"/></g><g fill="rgba(0,0,0,0.2)" ><path d="m2165 685c8 0 438-155 955-345 615-226 954-345 979-345 87 0 165 47 204 123 46 91 107-95-957 2942-537 1535-986 2805-997 2823-11 18-43 46-72 62-41 24-62 30-111 29z"/></g><text x="2165" y="3300" style="font-size:2500px;fill:#fff;text-anchor:middle">{text}</text></svg>',"marker-ball-pin":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(15.67 * {scale})" height="calc(33.33 * {scale})" viewBox="0 0 235 452"><g transform="translate(-135 10)"><path fill="{secondaryColor}" d="m256 442 0 0c-13 0-18-11-18-24l-6-323c0-13 11-24 24-24h0c13 0 24 11 24 24l-6 323c0 13-5 24-18 24z"/><circle style="fill:{color};stroke-width:10;stroke:{secondaryColor}" cx="256" cy="112" r="111"/><ellipse transform="matrix(0.834 0.5518 -0.5518 0.834 65.7916 -97.18)" fill="rgba(255,255,255,0.3)" cx="194.399" cy="60.749" rx="19.076" ry="32.428"/></g><text x="117.5" y="160" style="font-size:160px;fill:#fff;text-anchor:middle">{text}</text></svg>',"marker-square":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(26.67 * {scale})" height="calc(32.27 * {scale})" viewBox="0 0 2000 2420"><g transform="translate(100 100)" style="stroke:{secondaryColor};stroke-width:100;fill:{color}"><path d="M845 2152c-22-37-58-95-80-129-22-35-62-99-90-143l-50-80-312 0-313 0 0-900 0-900 900 0 900 0 0 900 0 900-313 0-313 0-34 58c-19 31-38 59-42 60-5 2-8 8-8 12 0 9-69 123-88 145-5 6-11 15-13 21-16 39-77 123-89 124-8 0-33-31-55-68z"/></g><text x="1000" y="1300" style="font-size:1000px;fill:#fff;text-anchor:middle">{text}</text></svg>',"marker-square-cluster":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(33.33 * {scale})" height="calc(38.8 * {scale})" viewBox="0 0 2500 2910"><g transform="translate(100 100)" style="stroke:{secondaryColor};stroke-width:100;fill:{color}"><path d="m866 2652c-17-31-37-68-46-82-9-14-32-54-51-90-19-36-50-92-70-125l-36-60-332-3-331-2 0-905 0-905 660 0 660 0 0-38c0-71 50-196 102-258 71-85 189-164 244-164 12 0 26-4 29-10 8-13 222-13 230 0 3 6 17 10 30 10 25 0 117 45 154 76 130 107 191 232 191 392 0 155-63 284-190 386-36 29-129 76-150 76-11 0-22 5-25 10-3 6-31 10-61 10l-54 0 0 660 0 660-332 2-332 3-29 50c-17 28-48 84-70 125-22 41-47 86-56 100-9 14-30 51-46 83-17 32-36 57-45 57-8 0-28-25-44-58z"/></g><text x="1650" y="900" style="font-size:1000px;fill:#fff">+</text><text x="1000" y="1800" style="font-size:1000px;fill:#fff;text-anchor:middle">{text}</text></svg>',"marker-square-rounded":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(26.8 * {scale})" height="calc(32.27 * {scale})" viewBox="0 0 2010 2410"><g transform="translate(100 100)" style="stroke:{secondaryColor};stroke-width:100;fill:{color}"><path d="M856 2155c-20-30-36-59-36-65 0-5-4-10-10-10-5 0-10-5-10-11 0-5-18-37-40-69-22-32-40-64-40-69 0-6-4-11-10-11-5 0-10-5-10-10 0-6-15-33-32-60l-33-50-127 0c-74 0-129-4-133-10-3-5-17-10-30-10-25 0-116-45-155-76-87-69-142-151-178-265-15-46-17-1075-2-1084 5-3 10-17 10-30 0-13 5-27 10-30 6-3 10-13 10-22 0-22 83-135 122-168 57-46 62-50 112-75l50-25 585 0 586 0 63 34c84 46 169 133 212 218l35 68 0 565 0 565-28 59c-32 69-100 157-139 180-15 9-33 22-40 29-23 22-99 57-123 57-13 0-27 5-30 10-4 6-60 10-135 10l-128 0-128 205c-84 136-133 205-144 205-10 0-33-24-54-55z"/></g><text x="1000" y="1300" style="font-size:1000px;fill:#fff;text-anchor:middle">{text}</text></svg>',"marker-square-rounded-cluster":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(33.33 * {scale})" height="calc(32.13 * {scale})" viewBox="0 0 2500 2900"><g transform="translate(100 100)" style="stroke:{secondaryColor};stroke-width:100;fill:{color}"><path d="m874 2669c-9-18-26-49-37-68-11-20-30-55-43-78-13-24-36-64-51-90-14-27-38-69-52-95l-26-48-142 0c-84 0-144-4-148-10-3-5-17-10-30-10-25 0-118-46-154-76-91-76-136-142-175-254-13-38-16-119-16-554 0-358 3-520 12-545 40-125 106-219 195-278 127-84 116-83 646-83l467 0 0-42c0-46 11-87 45-163 54-121 169-220 306-264 46-14 232-14 278 0 165 53 284 175 340 350 19 61 14 204-10 273-32 91-94 178-169 240-38 31-130 76-155 76-13 0-27 5-30 10-3 6-28 10-56 10l-49 0 0 462c0 446-1 464-21 522-32 91-94 178-169 240-38 31-130 76-155 76-13 0-27 5-30 10-4 6-65 10-149 10-138 0-143 1-154 23-12 23-62 114-112 202-16 28-44 79-63 115-42 77-67 88-93 39z"/></g><text x="1650" y="900" style="font-size:1000px;fill:#fff">+</text><text x="1000" y="1800" style="font-size:1000px;fill:#fff;text-anchor:middle">{text}</text></svg>',flag:'<svg xmlns="http://www.w3.org/2000/svg" width="calc(23.5 * {scale})" height="calc(40 * {scale})" viewBox="34 28 198 308"><path style="stroke:{secondaryColor};stroke-width:15;stroke-linecap:round;" d="M42 327l0 -291"/><path style="fill:{color};stroke:{secondaryColor};stroke-width:10;stroke-linejoin:round;" d="M49 50c70 30 104 28 178 2-21 42-21 74 0 116-72 25-101 25-178 0l0-118z"/><text x="130" y="165" style="font-size:100px;fill:#fff;text-anchor:middle">{text}</text></svg>',"flag-triangle":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(27 * {scale})" height="calc(35.33 * {scale})" viewBox="0 0 40.5 53"><g transform="translate(-31 -20)"><path fill="{secondaryColor}" d="M34.7,73.3V48.4l34.6-10.1c0.7-0.2,1.2-0.8,1.2-1.5s-0.4-1.4-1-1.7L33.7,20.5c-0.5-0.2-1.1-0.2-1.6,0.2 c-0.5,0.3-0.7,0.8-0.7,1.4v51.2H34.7z"/><polygon points="34.7,24.5 66,36.5 34.7,45 34.7,10" fill="{color}"/></g><text x="11" y="21" style="font-size:14px;fill:#fff;text-anchor:middle">{text}</text></svg>',"rounded-square":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(34 * {scale})" height="calc(34 * {scale})" viewBox="0 0 34 34"><g transform="translate(2 2)"><rect x="0" y="0" rx="8" ry="8" width="30" height="30" style="stroke:{secondaryColor};stroke-width:2;fill:{color}"/></g><text x="17" y="22" style="font-size:14px;fill:#fff;text-anchor:middle">{text}</text></svg>',"rounded-square-thick":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(38 * {scale})" height="calc(38 * {scale})" viewBox="0 0 38 38"><g transform="translate(4 4)"><rect x="0" y="0" rx="8" ry="8" width="30" height="30" style="stroke:{secondaryColor};stroke-width:4;fill:{color}"/></g><text x="19" y="24" style="font-size:14px;fill:#fff;text-anchor:middle">{text}</text></svg>',triangle:'<svg xmlns="http://www.w3.org/2000/svg" width="calc(36 * {scale})" height="calc(36 * {scale})" viewBox="0 0 36 36"><g transform="translate(2 2)"><polygon points="16,0 32,32 0,32 16,0" style="stroke:{secondaryColor};stroke-width:2;fill:{color}"/></g><text x="17.5" y="30" style="font-size:12px;fill:#fff;text-anchor:middle">{text}</text></svg>',"triangle-thick":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(40 * {scale})" height="calc(40 * {scale})" viewBox="0 0 40 40"><g transform="translate(4 4)"><polygon points="16,0 32,32 0,32 16,0" style="stroke:{secondaryColor};stroke-width:4;fill:{color}"/></g><text x="19.5" y="32" style="font-size:12px;fill:#fff;text-anchor:middle">{text}</text></svg>',hexagon:'<svg xmlns="http://www.w3.org/2000/svg" width="calc(35 * {scale})" height="calc(40 * {scale})" viewBox="0 0 35 40"><g transform="translate(2 2)"><path d="M31 9 15.5 0 0 9 0 27 15.5 36 31 27 31 9Z" style="stroke:{secondaryColor};stroke-width:2;fill:{color}"/></g><text x="17.5" y="25" style="font-size:14px;fill:#fff;text-anchor:middle">{text}</text></svg>',"hexagon-thick":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(39 * {scale})" height="calc(44 * {scale})" viewBox="0 0 39 44"><g transform="translate(4 4)"><path d="M31 9 15.5 0 0 9 0 27 15.5 36 31 27 31 9Z" style="stroke:{secondaryColor};stroke-width:4;fill:{color}"/></g><text x="19.5" y="27" style="font-size:14px;fill:#fff;text-anchor:middle">{text}</text></svg>',"hexagon-rounded":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(40 * {scale})" height="calc(40 * {scale})" viewBox="0 0 1100 1100"><g transform="translate(50 50)"><path style="stroke:{secondaryColor};stroke-width:50;fill:{color}" d="M881 210 561 25c-33-19-88-19-121 0L119 210c-33 19-61 67-61 105v370c0 39 27 86 61 105l321 185c33 19 88 19 122 0l321-185c33-19 61-67 61-105V315C942 276 915 229 881 210z"/></g><text x="550" y="700" style="font-size:400px;fill:#fff;text-anchor:middle">{text}</text></svg>',"hexagon-rounded-thick":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(40 * {scale})" height="calc(40 * {scale})" viewBox="0 0 1200 1200"><g transform="translate(100 100)"><path style="stroke:{secondaryColor};stroke-width:100;fill:{color}" d="M881 210 561 25c-33-19-88-19-121 0L119 210c-33 19-61 67-61 105v370c0 39 27 86 61 105l321 185c33 19 88 19 122 0l321-185c33-19 61-67 61-105V315C942 276 915 229 881 210z"/></g><text x="600" y="750" style="font-size:400px;fill:#fff;text-anchor:middle">{text}</text></svg>',"triangle-arrow-up":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(28 * {scale})" height="calc(28 * {scale})" viewBox="0 0 28 28"><g transform="translate(2 2)"><polygon points="12,0 0,24 12,17 24,24" stroke-width="2" stroke="{secondaryColor}" fill="{color}"/></g><text x="14" y="17" style="font-size:8px;fill:#fff;text-anchor:middle">{text}</text></svg>',"triangle-arrow-left":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(28 * {scale})" height="calc(28 * {scale})" viewBox="0 0 28 28"><g transform="translate(2 2)"><polygon points="24,12 0,0 7,12 0,24" stroke-width="2" stroke="{secondaryColor}" fill="{color}"/></g><text x="14" y="16.5" style="font-size:8px;fill:#fff;text-anchor:middle">{text}</text></svg>',"arrow-up":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(12.16 * {scale})" height="calc(30.1 * {scale})" viewBox="0 0 902 364"><g fill="{color}" transform="matrix(0,2.4,-2.4,0,897,-930)"><polygon points="902,222 233,222 233,364 0,182 233,0 233,141 902,141 902,222"/></g><text x="450" y="700" style="font-size:900px;fill:#000;text-anchor:middle">{text}</text></svg>',"arrow-up-thin":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(16 * {scale})" height="calc(33.33 * {scale})" viewBox="0 0 12 25"><g transform="translate(-136.91823 -751.91998)"><path fill="{color}" d="m148.271 760.71c-1.641-.547-3.186-1.47-4.633-2.769l0 18.07-1.675 0 0-18.07c-1.447 1.299-2.986 2.222-4.616 2.769l0-1.231c2.325-1.596 4.006-3.812 5.043-6.65l.838 0c1.037 2.838 2.718 5.055 5.043 6.65l0 1.231z"/></g><text x="6" y="20" style="font-size:10px;fill:#000;text-anchor:middle">{text}</text></svg>',car:'<svg xmlns="http://www.w3.org/2000/svg" width="calc(21.93 * {scale})" height="calc(40.9 * {scale})" viewBox="0 0 6580 12270"><g transform="translate(0 12270) rotate(-90)"><path fill="{secondaryColor}" d="M7045 6566c-42-13-105-44-105-51 0-2 23-105 50-228 28-123 50-230 50-236 0-8-241-11-907-11-855 0-1145 6-1513 30-85 6-189 13-230 15-41 3-133 10-205 15-286 21-430 32-705 50-953 63-1459 18-2335-205-304-77-746-209-799-238-131-72-221-408-285-1062-34-345-42-532-48-1130-16-1557 108-2532 336-2649 32-17 469-149 676-205 409-110 819-191 1205-238 116-14 224-18 540-18 395 1 494 5 1140 50 1124 79 1224 82 2496 78l641-3-53-237c-29-131-52-238-51-239 1-1 31-14 66-29 56-23 76-26 142-23 67 3 83 7 120 33 23 17 50 41 61 55 10 14 51 117 91 230l73 205 674 3 675 2 90-39c98-43 198-72 315-93 122-21 829-18 990 5 321 45 626 143 849 270 293 168 516 378 704 662 266 402 416 893 467 1527 15 174 8 882-9 998-6 41-18 127-27 190-69 502-253 969-523 1325-79 105-262 284-381 374-189 142-355 229-574 300-336 110-526 139-952 148-457 9-685-23-887-124l-47-24-678-6-678-6-64 179c-79 224-92 253-121 284-67 70-177 97-274 66zm-2752-5073c-23-2-64-2-90 0-26 2-7 3 42 3 50 0 71-1 48-3zm395 0c-21-2-55-2-75 0-21 2-4 4 37 4 41 0 58-2 38-4z"/><path fill="{color}" d="M7043 6498c-13-6-23-19-23-28 0-9 23-117 50-240 28-123 50-230 50-237 0-22-2126-13-2465 10-132 10-400 28-595 42-661 47-824 55-1160 62-435 7-656-8-1040-73-415-70-865-183-1447-365-168-53-272-556-325-1569-16-319-16-1311 0-1630 45-872 129-1366 257-1518 22-26 51-39 172-77 557-177 1122-310 1563-369 271-36 351-40 690-40 361 1 463 6 1165 54 1122 78 1288 83 2337 79 460-2 840-7 843-11 4-4-17-117-47-252l-55-245 39-16c76-30 180-8 224 47 10 13 54 124 98 246l79 222 709 0 709 0 47-24c74-37 219-83 322-101 122-22 606-32 802-16 374 29 658 102 933 238 124 62 271 155 361 230l61 51 6 100c19 278 103 497 247 643 88 89 173 136 278 152l70 11 41 131c116 369 159 673 168 1170 10 584-38 984-167 1397l-40 126-70 12c-193 33-348 175-441 405-56 139-89 302-89 445 0 43-3 47-58 91-290 235-644 384-1068 450-191 29-796 39-974 16-135-18-263-54-368-102l-75-35-701 0-701 0-79 223c-82 232-102 267-163 293-38 16-138 17-170 2zm-2023-820c332-15 1155-12 1835 6 308 8 563 12 566 8 4-4 10-21 13-38 7-30 6-31-92-77-518-244-1197-396-2112-474-295-25-1282-25-1579 0-231 20-473 46-479 51-6 7 49 110 93 171 160 226 416 335 855 365 142 10 539 5 900-12zm3304-263c525-111 899-887 934-1935 19-557-37-1023-172-1435-186-563-521-900-896-899-81 0-158 14-525 92-426 91-431 92-540 146-195 96-287 207-306 368-12 104-11 2985 1 3078 22 170 135 291 365 389 49 21 191 55 480 115 226 47 419 87 430 89 45 10 164 6 229-8zm-5570-485c112-43 197-156 216-291 12-83 13-2623 1-2706-23-158-125-273-270-304-44-9-100-1-542 75-272 47-514 91-539 98-266 68-487 424-594 958-56 280-70 548-40 800 56 484 207 878 414 1081 115 114 122 116 702 218 277 49 524 90 550 90 26 1 72-8 102-19zm2111-3440c1023-44 1884-213 2462-486l113-53-7-33c-3-18-8-35-10-37-2-3-236 1-521 7-993 24-1271 26-1708 11-541-18-1128-18-1249-1-377 56-588 181-734 437-32 55-41 79-32 84 12 8 246 32 491 51 356 28 815 36 1195 20z"/></g><text x="3250" y="8250" style="font-size:3000px;fill:#fff;text-anchor:middle">{text}</text></svg>',checker:'<svg xmlns="http://www.w3.org/2000/svg" width="calc(16 * {scale})" height="calc(16 * {scale})" viewBox="0 0 16 16"><pattern id="p" x="0" y="0" width="16" height="16" patternUnits="userSpaceOnUse"><rect fill="{color}" x="0" width="8" height="8" y="0"/><rect fill="{color}" x="8" width="8" height="8" y="8"/></pattern><rect x="0" y="0" width="16" height="16" fill="{secondaryColor}"/><rect x="0" y="0" width="16" height="16" fill="url(#p)"/></svg>',"checker-rotated":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(16 * {scale})" height="calc(16 * {scale})" viewBox="0 0 60 60"><rect width="60" height="60" fill="{secondaryColor}"/><rect width="42.42" height="42.42" transform="translate(30 0) rotate(45)" fill="{color}"/></svg>',"zig-zag":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(15 * {scale})" height="calc(15 * {scale})" viewBox="0 0 120 120"><rect x="0" y="0" width="120" height="120" fill="{secondaryColor}"/><polygon fill="{color}" points="120 120 60 120 90 90 120 60 120 0 120 0 60 60 0 0 0 60 30 90 60 120 120 120"/></svg>',"zig-zag-vertical":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(15 * {scale})" height="calc(15 * {scale})" viewBox="0 0 120 120"><rect x="0" y="0" width="120" height="120" fill="{secondaryColor}"/><polygon fill="{color}" points="120 0 120 60 90 30 60 0 0 0 0 0 60 60 0 120 60 120 90 90 120 60 120 0"/></svg>',"circles-spaced":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(20 * {scale})" height="calc(20 * {scale})" viewBox="0 0 20 20"><defs><pattern id="p" x="0" y="0" width="20" height="20" patternUnits="userSpaceOnUse"><circle cx="10" cy="10" r="2" stroke="none" fill="{color}"/></pattern></defs><rect x="0" y="0" width="20" height="20" fill="{secondaryColor}"/><rect x="0" y="0" width="100" height="100" fill="url(#p)"/></svg>',circles:'<svg xmlns="http://www.w3.org/2000/svg" width="calc(7 * {scale})" height="calc(7 * {scale})" viewBox="0 0 20 20"><defs><pattern id="p" x="0" y="0" width="20" height="20" patternUnits="userSpaceOnUse"><circle cx="10" cy="10" r="6" stroke="none" fill="{color}"/></pattern></defs><rect x="0" y="0" width="20" height="20" fill="{secondaryColor}"/><rect x="0" y="0" width="100" height="100" fill="url(#p)"/></svg>',"diagonal-lines-up":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(18 * {scale})" height="calc(18 * {scale})" viewBox="0 0 6 6"><rect x="0" y="0" width="6" height="6" fill="{secondaryColor}"/><g fill="{color}"><path d="M5 0h1L0 6V5zM6 5v1H5z"/></g></svg>',"diagonal-lines-down":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(18 * {scale})" height="calc(18 * {scale})" viewBox="0 0 6 6"><rect x="0" y="0" width="6" height="6" fill="{secondaryColor}"/><g transform="rotate(90 3 3)" fill="{color}"><path d="M5 0h1L0 6V5zM6 5v1H5z"/></g></svg>',"diagonal-stripes-up":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(20 * {scale})" height="calc(20 * {scale})" viewBox="0 0 40 40"><rect x="0" y="0" width="40" height="40" fill="{secondaryColor}"/><g fill="{color}"><path d="M0 40L40 0H20L0 20M40 40V20L20 40"/></g></svg>',"diagonal-stripes-down":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(20 * {scale})" height="calc(20 * {scale})" viewBox="0 0 40 40"><rect x="0" y="0" width="40" height="40" fill="{secondaryColor}"/><g transform="rotate(90 20 20)" fill="{color}"><path d="M0 40L40 0H20L0 20M40 40V20L20 40"/></g></svg>',"grid-lines":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(14 * {scale})" height="calc(14 * {scale})" viewBox="0 0 6 6"><rect x="0" y="0" width="6" height="6" fill="{secondaryColor}"/><g transform="rotate(45 3 3)" fill="{color}"><path d="M5 0h1L0 6V5zM6 5v1H5z"/></g><g fill="{color}" transform="rotate(-45 3 3)"><path d="M5 0h1L0 6V5zM6 5v1H5z"/></g></svg>',"rotated-grid-lines":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(18 * {scale})" height="calc(18 * {scale})" viewBox="0 0 6 6"><rect x="0" y="0" width="6" height="6" fill="{secondaryColor}"/><g transform="rotate(90 3 3)" fill="{color}"><path d="M5 0h1L0 6V5zM6 5v1H5z"/></g><g fill="{color}"><path d="M5 0h1L0 6V5zM6 5v1H5z"/></g></svg>',"rotated-grid-stripes":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(20 * {scale})" height="calc(20 * {scale})" viewBox="0 0 40 40"><rect x="0" y="0" width="40" height="40" fill="{secondaryColor}"/><g transform="rotate(90 20 20)" fill="{color}"><path d="M0 40L40 0H20L0 20M40 40V20L20 40"/></g><g fill="{color}"><path d="M0 40L40 0H20L0 20M40 40V20L20 40"/></g></svg>',"x-fill":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(40 * {scale})" height="calc(40 * {scale})" viewBox="0 0 40 40"><rect x="0" y="0" width="45.3" height="45.3" fill="{secondaryColor}"/><g fill="{color}"><path d="M0 38.59l2.83-2.83 1.41 1.41L1.41 40H0v-1.41zM0 1.4l2.83 2.83 1.41-1.41L1.41 0H0v1.41zM38.59 40l-2.83-2.83 1.41-1.41L40 38.59V40h-1.41zM40 1.41l-2.83 2.83-1.41-1.41L38.59 0H40v1.41zM20 18.6l2.83-2.83 1.41 1.41L21.41 20l2.83 2.83-1.41 1.41L20 21.41l-2.83 2.83-1.41-1.41L18.59 20l-2.83-2.83 1.41-1.41L20 18.59z"/></g></svg>',dots:'<svg xmlns="http://www.w3.org/2000/svg" width="calc(13 * {scale})" height="calc(13 * {scale})" viewBox="0 0 20 20"><rect x="0" y="0" width="20" height="20" fill="{secondaryColor}"/><g fill="{color}"><circle cx="3" cy="3" r="3"/><circle cx="13" cy="13" r="3"/></g></svg>'},cl=(ul.getHighContrastMode=function(){return matchMedia("(-ms-high-contrast: white-on-black)").matches?"dark":matchMedia("(-ms-high-contrast: black-on-white)").matches?"light":matchMedia("(-ms-high-contrast: active)").matches?"dark":matchMedia("(inverted-colors: inverted)").matches?"invert":null},ul);function ul(){}var ll,hl,pl=((window&&window.__extends||(ll=function(e,t){return(ll=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}ll(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}))(dl,hl=k),dl);function dl(){var e=null!==hl&&hl.apply(this,arguments)||this;return e.copyrightMessage=void 0,e.copyrightContent=void 0,e.customAttribution=void 0,e.showFeedbackLink=!0,e.showLogo=!0,e}var fl,gl,yl=((window&&window.__extends||(fl=function(e,t){return(fl=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}fl(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}))(ml,gl=re),ml.prototype.onAdd=function(e){return this.container=this.buildContainer(e,l.ControlStyle.auto),this.container.className="map-copyright",this.copyrightDiv=this.buildCopyrightDiv(),this.copyrightDiv.className="azure-map-copyright",this.container.appendChild(this.copyrightDiv),this.options.showLogo&&this.addRemoveLogo(!0),this.options.showFeedbackLink&&this.addRemoveFeedbackDiv(!0),this.container},ml.prototype.onRemove=function(){gl.prototype.onRemove.call(this),delete this.container},ml.prototype.setOptions=function(e){var t=this,r=(new pl).merge(this.options,e);r.copyrightMessage===this.options.copyrightMessage&&r.customAttribution===this.options.customAttribution||(this.copyrightDiv.innerText=this.textAttribution(r)),r.copyrightContent!==this.options.copyrightContent&&(this.options.copyrightContent&&(e=Array.from(this.copyrightDiv.children).find(function(e){return e===t.options.copyrightContent}),this.copyrightDiv.removeChild(e)),0<this.copyrightDiv.childNodes.length?this.copyrightDiv.insertBefore(r.copyrightContent,this.copyrightDiv.childNodes[0]):this.copyrightDiv.appendChild(r.copyrightContent),this.options.copyrightContent=r.copyrightContent),!r.showLogo&&this.logoAnchor?this.addRemoveLogo(!1):r.showLogo&&!this.logoAnchor&&this.addRemoveLogo(!0),!r.showFeedbackLink&&this.feedbackAnchor?this.addRemoveFeedbackDiv(!1):r.showFeedbackLink&&!this.feedbackAnchor&&this.addRemoveFeedbackDiv(!0),this.options=r},ml.prototype.getDefaultAttributions=function(){var e=(new Date).getFullYear(),t=["©"+e+" TomTom"];return this.options.showLogo||t.push("©"+e+" Microsoft"),t},ml.prototype.buildCopyrightDiv=function(){var e=document.createElement("div");return e.innerText=this.textAttribution(this.options)||"",e},ml.prototype.buildFeedbackLink=function(){var e=document.createElement("a");return e.setAttribute("alt","Give Feedback"),e.setAttribute("aria-label","Give Feedback"),e.href="https://feedback.azuremaps.com",e.target="_blank",e.rel="noopener",e.className="azure-map-feedback",e},ml.prototype.addRemoveFeedbackDiv=function(e){e?(this.feedbackAnchor=this.buildFeedbackLink(),this.tooltip=B("Give Feedback"),this.container.appendChild(this.feedbackAnchor),this.container.appendChild(this.tooltip),z(this.tooltip,this.feedbackAnchor)):(this.feedbackAnchor.remove(),this.tooltip.remove(),delete this.tooltip,delete this.feedbackAnchor)},ml.prototype.addRemoveLogo=function(e){e?(this.logoAnchor=document.createElement("a"),this.logoAnchor.className="azure-map-logo",this.logoAnchor.href="https://microsoft.com",this.logoAnchor.setAttribute("aria-label","Microsoft"),this.container.appendChild(this.logoAnchor),this.logoTooltip=B("Visit microsoft.com"),this.container.appendChild(this.logoTooltip),z(this.logoTooltip,this.logoAnchor)):(this.logoAnchor.remove(),this.logoTooltip.remove(),delete this.logoAnchor)},ml);function ml(e){var t=gl.call(this)||this;return t.textAttribution=function(e){return[t.options.copyrightMessage,t.options.customAttribution].filter(function(e){return e}).join("")},t.options=(new pl).merge(e),t}var vl=(_l.throwOnError=function(e,t){function r(e){throw o.off("error",r),e.error}var o=e instanceof k0?e._getMap():e;o.on("error",r);t=t();return o.off("error",r),t},_l.tryCatch=function(e,t,r,o){try{return this.throwOnError(e,t)}catch(e){return r(e)}finally{"function"==typeof o&&o()}},_l.tryFinally=function(e,t,r){try{return this.throwOnError(e,t)}finally{r()}},_l);function _l(){}var wl=window&&window.__assign||function(){return(wl=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)},bl=(Cl.prototype.request=function(e){var t={domain:this.map.getServiceOptions().domain,path:"search/address/reverse/json",queryParams:wl({"api-version":"1.0",language:e.style.language,limit:1,query:Jn(e.position[1])+","+Qn(e.position[0])},e.style.view&&{view:e.style.view})};return new D((null===(e=this.map.authentication)||void 0===e?void 0:e.signRequest(t))||t).get()},Cl);function Cl(e){this.map=e}var El=(Sl.prototype.cache=function(e,t,r,o){o=e+"_"+r[0]+"_"+r[1]+"_"+o;this._labelIdx[t.labelType]||(this._labelIdx[t.labelType]=[],this._labelCache[t.labelType]=[]),-1===this._labelIdx[t.labelType].indexOf(o)&&(this._labelCache[t.labelType].push({name:e,radius:t.radius,minZoom:t.minZoom,maxZoom:t.maxZoom||24,position:r}),this._labelIdx[t.labelType].push(o))},Sl.prototype.getNearestLabel=function(e,t,r){var o=null,n=this._labelCache[e];if(n)for(var i,s=1/0,a=0,c=n.length;a<c;a++)r>=n[a].minZoom&&r<=n[a].maxZoom&&((i=jn(n[a].position,t))<=n[a].radius&&i<=s&&(s=i,o=n[a]));return o},Sl.prototype._preloadCache=function(e){if(!this._preloadedCache.has(e)){this._preloadedCache.add(e);var t={source:[],labelType:"water",minZoom:0,radius:395e4,polygonSources:[]},r=e,o=r.indexOf("-");switch(r=-1!==o?r.substr(0,o):r){case"fr":this.cache("Océan Pacifique",t,[-170,32],e),this.cache("Océan Pacifique",t,[-138,-27],e),this.cache("Océan Atlantique",t,[-40,32],e),this.cache("Océan Atlantique",t,[-17,-29],e);break;case"es":this.cache("Océan Pacifique",t,[-170,32],e),this.cache("Océan Pacifique",t,[-138,-27],e),this.cache("Océano Atlántico",t,[-40,32],e),this.cache("Océano Atlántico",t,[-17,-29],e);break;case"pt":this.cache("Oceano Pacífico",t,[-170,32],e),this.cache("Oceano Pacífico",t,[-138,-27],e),this.cache("Oceano Atlântico",t,[-40,32],e),this.cache("Oceano Atlântico",t,[-17,-29],e);break;case"ja":this.cache("太平洋",t,[-170,32],e),this.cache("太平洋",t,[-138,-27],e);break;case"en":this.cache("Pacific Ocean",t,[-170,32],e),this.cache("Pacific Ocean",t,[-138,-27],e),this.cache("Atlantic Ocean",t,[-40,32],e),this.cache("Atlantic Ocean",t,[-17,-29],e),this.cache("Indian Ocean",t,[77,-26],e)}}},Sl);function Sl(){this._labelCache={},this._labelIdx={},this._preloadedCache=new Set}var Tl=window&&window.__awaiter||function(e,s,a,c){return new(a=a||Promise)(function(r,t){function o(e){try{i(c.next(e))}catch(e){t(e)}}function n(e){try{i(c.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(o,n)}i((c=c.apply(e,s||[])).next())})},Il=window&&window.__generator||function(r,o){var n,i,s,a={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(t){return function(e){return function(t){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(s=2&t[0]?i.return:t[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,t[1])).done)return s;switch(i=0,(t=s?[2&t[0],s.value]:t)[0]){case 0:case 1:s=t;break;case 4:return a.label++,{value:t[1],done:!1};case 5:a.label++,i=t[1],t=[0];continue;case 7:t=a.ops.pop(),a.trys.pop();continue;default:if(!(s=0<(s=a.trys).length&&s[s.length-1])&&(6===t[0]||2===t[0])){a=0;continue}if(3===t[0]&&(!s||t[1]>s[0]&&t[1]<s[3])){a.label=t[1];break}if(6===t[0]&&a.label<s[1]){a.label=s[1],s=t;break}if(s&&a.label<s[2]){a.label=s[2],a.ops.push(t);break}s[2]&&a.ops.pop(),a.trys.pop();continue}t=o.call(r,a)}catch(e){t=[6,e],i=0}finally{n=s=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}([t,e])}}},Al=window&&window.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var o,n,i=r.call(e),s=[];try{for(;(void 0===t||0<t--)&&!(o=i.next()).done;)s.push(o.value)}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return s},kl=window&&window.__spreadArray||function(e,t){for(var r=0,o=t.length,n=e.length;r<o;r++,n++)e[n]=t[r];return e},Pl=(Ol.prototype.dispose=function(){this._disposed=!0;var e=this._map._getMap();e.off("move",this._onMove),e.off("moveend",this._onMoveEnd),e.off("styledata",this._onStyleData),e.off("rotate",this._onRotate);e=this._map.getCanvas();e.removeEventListener("mousedown",this._onPointerDown),e.removeEventListener("touchstart",this._onPointerDown),this._map.getMapContainer().removeEventListener("keydown",this._shortcutListener)},Ol.prototype._getEventPos=function(e){if("touches"in e){var t=e.touches[0],r=e.target.getBoundingClientRect();return[t.pageX-r.left,t.pageY-r.top]}return[e.offsetX,e.offsetY]},Ol.prototype._checkThresholds=function(e,t){return this._checkZoomThreshold(e.zoom,t.zoom)||this._checkPitchThreshold(e.pitch,t.pitch)||this._checkLocThreshold(e.center,t.center)||this._checkHeadingThreshold(e.bearing,t.bearing)},Ol.prototype._checkZoomThreshold=function(e,t){return this._round(e)!==this._round(t)},Ol.prototype._checkPitchThreshold=function(e,t){return Math.abs(e-t)>=this._pitchThreshold},Ol.prototype._checkLocThreshold=function(e,t){t=Al(this._map.positionsToPixels([t,e]),2),e=t[0],t=t[1];return an.getDistance(e,t)>=this._moveThreshold},Ol.prototype._checkHeadingThreshold=function(e,t){e<0&&(e+=360),t<0&&(t+=360);t=Math.abs(e-t);return(t=180<t?360-t:t)>=this._headingThreshold},Ol.prototype._getLocDesc=function(h,p,d){return Tl(this,void 0,void 0,function(){var t,r,o,n,i,s,a,c,u,l=this;return Il(this,function(e){switch(e.label){case 0:return"blank"===d?[3,3]:this._map._getMap().loaded()?[3,2]:[4,new Promise(function(e){return l._map._getMap().once("idle",e)})];case 1:e.sent(),e.label=2;case 2:for(t={},r=this._map.positionsToPixels([h.center])[0],vl.tryCatch(this._map,function(){var t=l._map._getMap();o=t.queryRenderedFeatures(r,{layers:l._polygonStyleLayer.filter(function(e){return t.getLayer(e)}),filter:["==",["geometry-type"],"Polygon"]})},function(){}),n=null,o&&0<o.length&&(n=o[0]),i=null,s=0,a=this._labelConfig.length;s<a;s++)c=this._labelConfig[s],h.zoom>=c.minZoom?c.polygonSources?n&&-1!==c.polygonSources.indexOf(n.layer["source-layer"])?(i=c.labelType,this._getClosestLabel(c,h,p,t,!1)):this._getClosestLabel(c,h,p,t,!0):this._getClosestLabel(c,h,p,t,!1):this._getClosestLabel(c,h,p,t,!0);return 8<=h.zoom&&this._processRoads(t,h,p),this._labelCache.forEach(function(e){t[e]||(u=null,(u="water"!==e&&"majorPoi"!==e||e===i?Ol._labelCache.getNearestLabel(e,h.center,h.zoom):u)&&(t[e]=u.name))}),[2,this._processLocInfo(h,i,t,!0,this._restFallback)];case 3:return[2,this._processLocInfo(h,null,null,!1,!1)]}})})},Ol.prototype._getHeadingDesc=function(e){var t=e.bearing;switch(t<0&&(t+=360),t=this._round(t,this._headingThreshold)){case 0:case 360:return"north";case 45:return"north east";case 90:return"east";case 135:return"south east";case 180:return"south";case 225:return"south west";case 270:return"west";case 315:return"north west";default:return t+" degrees"}},Ol.prototype._getClosestLabel=function(e,t,r,o,n){for(var i=e.radius,s=0,a=e.source.length;s<a;s++){var c={sourceLayer:e.source[s],filter:["has","name"]},u=this._map._getMap().querySourceFeatures(this._baseVectorTileSourceId,c),l=null,h=1/0,p=this._labelCache.has(e.labelType);if(!n||p)for(var d=0,f=u.length;d<f;d++){var g,y="Point"===u[d].geometry.type?u[d]:pi(t.center,u[d].geometry);n||(g="Point"===u[d].geometry.type?jn(t.center,y.geometry.coordinates):y.properties.distance)<h&&(h=g,l=u[d]),p&&Ol._labelCache.cache(u[d].properties.name,e,y.geometry.coordinates,r)}n||(c=e.labelType+"Dis",l&&h<=i&&("number"!=typeof o[c]||h<=o[c])&&(o[e.labelType]=l.properties.name,o[c]=h))}},Ol.prototype._processRoads=function(e,t,r,o){var n=this._map._getMap().queryRenderedFeatures(o,{filter:["==",["geometry-type"],"LineString"]});if(n){for(var i,s=void 0,a=void 0,c=void 0,u=void 0,l=0,h=n.length;l<h;l++)this._roadLayers.has(n[l].layer["source-layer"])&&n[l].properties.name&&""!==n[l].properties.name&&(i=pi(t.center,n[l]),(!c||i.properties.distance<c.properties.distance)&&(s&&n[l].properties.name===s.properties.name?c=i:s&&n[l].properties.name===s.properties.name?(!u||i.properties.distance<u.properties.distance)&&(u=i,a=n[l]):(u=c,a=s,c=i,s=n[l])));s&&(!e.country&&s.properties.country_code&&(e.country=s.properties.country_code,e.countryDis=0,Ol._labelCache.cache(e.country,{source:[],labelType:"country",radius:5e3,minZoom:0},c.geometry.coordinates,r)),!e.state&&s.properties.country_subdivision&&(e.state=s.properties.country_subdivision,e.stateDis=0,Ol._labelCache.cache(e.state,{source:[],labelType:"state",radius:5e3,minZoom:4},c.geometry.coordinates,r)),15<=t.zoom&&(o=this._map.positionsToPixels([t.center,c.geometry.coordinates]),(an.getDistance(o[0],o[1])<this._roadPixelRadius||c.properties.distance<this._minRoadDistance)&&(e.road=s.properties.name),a&&(r=this._map.positionsToPixels([u.geometry.coordinates]),(an.getDistance(o[0],r[0])<this._minIntersectionPixelDistance||u.properties.distance<this._minRoadDistance)&&(e.secondRoad=a.properties.name,e.secondRoadDis=u.properties.distance))))}},Ol.prototype._getActionDesc=function(e){if(this._lastCam){var t,r,o=[];return this._checkLocThreshold(e.center,this._lastCam.center)&&(r=["panned"],0===(t=Math.round(Kn(this._lastCam.center,e.center)))||360===t?r.push("north"):t<90?r.push("north east"):90===t?r.push("east"):t<180?r.push("south east"):180===t?r.push("south"):t<270?r.push("south west"):270===t?r.push("west"):t<360&&r.push("north west"),t=jn(this._lastCam.center,e.center,pn.meters),r.push(1e3<t?Dn(t/1e3,2)+" kilometers":Dn(t,2)+" meters"),o.push(r.join(" "))),this._checkZoomThreshold(e.zoom,this._lastCam.zoom)&&((r=["zoomed"]).push(this._lastCam.zoom<e.zoom?"in":"out"),1<=(t=Math.abs(this._lastCam.zoom-e.zoom))&&(t=Math.ceil(t),r.push(1<t?t+" levels":t+" level")),this._getCanonicalZoom(this._lastCam.zoom)!==this._getCanonicalZoom(e.zoom)&&r.push("to "+this._getCanonicalZoom(e.zoom)+" level"),e.zoom>=e.maxZoom&&r.push("Zoom In button disabled, maximum zoom level reached"),t=Ai.getSouth(e.bounds)<=-Cn&&Ai.getNorth(e.bounds)>=Cn,(e.zoom<=e.minZoom||t)&&r.push("Zoom Out button disabled, minimum zoom level reached"),o.push(r.join(" "))),this._checkPitchThreshold(e.pitch,this._lastCam.pitch)&&(r=this._round(e.pitch,this._pitchThreshold),o.push("pitched to "+r+" degrees"),60!==e.pitch&&0!==e.pitch||(r=60===e.pitch?"maximum":"minimum",o.push("reached "+r+" of "+e.pitch+" degrees"))),this._checkHeadingThreshold(this._lastCam.bearing,e.bearing)&&o.push("rotated to "+this._getHeadingDesc(e)),o.join(" and ")||null}return null},Ol.prototype._getCanonicalZoom=function(e){return(e=this._round(e))<2?"world":e<5?"country":e<11?"state province":e<15?"city":"street"},Ol.prototype._processLocInfo=function(n,i,s,a,c){var u=this;return new Promise(function(t,e){var r=[];if(a){var o=[];if(s&&(i&&("water"===i&&s.water?o.push(s.water):"majorPoi"===i&&s.majorPoi&&o.push(s.majorPoi)),0===o.length&&(s.majorPoi&&8<=n.zoom?o.push(s.majorPoi):(s.poi&&14<=n.zoom?o.push(s.poi):s.road&&15<=n.zoom&&(s.secondRoad?o.push(s.road+" & "+s.secondRoad):o.push(s.road)),s.neighbourhood&&12<=n.zoom&&o.push(s.neighbourhood),s.city&&6<=n.zoom&&o.push(s.city)),s.state&&4<=n.zoom&&o.push(s.state),0===o.length?s.water?o.push(s.water):s.country&&o.push(s.country):1===o.length&&s.state&&4<=n.zoom&&s.country&&o.push(s.country))),0<o.length)r.push("<p>Location: ",o.join(", "),".</p>");else if(c&&"water"!==i)return void u._reverseGeocodeDescription(n).then(function(e){t(e)},function(){e("<p>Location: unknown</p>")})}u._returnDetailedDescriptions&&(r.push("<p>Zoom: ",Dn(n.zoom,2),".</p>"),r.push("<p>Latitude: ",Dn(n.center[1],5),".</p>"),r.push("<p>Longitude: ",Dn(n.center[0],5),".</p>")),t(r.join(""))})},Ol.prototype._reverseGeocodeDescription=function(n){var i=this;return new Promise(function(r){var o=i._map.getStyle();i._reverseSearch.request({position:n.center,style:o}).then(function(e){var t={};e&&e.addresses&&0<e.addresses.length&&e.addresses[0].address&&((e=e.addresses[0].address).country&&(t.country=e.country,Ol._labelCache.cache(t.country,{source:[],labelType:"country",radius:5e3,minZoom:0},n.center,o.language)),e.countrySubdivision&&(t.state=e.countrySubdivision,Ol._labelCache.cache(t.state,{source:[],labelType:"state",radius:5e3,minZoom:4},n.center,o.language)),e.municipality&&(t.city=e.municipality,Ol._labelCache.cache(t.state,{source:[],labelType:"city",radius:1e3,minZoom:10},n.center,o.language)),e.streetNameAndNumber?t.road=e.streetNameAndNumber:e.street&&(t.road=e.street)),i._processLocInfo(n,null,t,!0,!1).then(function(e){r(e)})},function(e){i._processLocInfo(n,null,null,!0,!1).then(function(e){r(e)})}).catch(function(e){i._processLocInfo(n,null,null,!0,!1).then(function(e){r(e)})})})},Ol.prototype._round=function(e,t){return void 0===t&&(t=1),Math.round(e/t)*t},Ol._baseVectorTileSourceIds=["microsoft.base","vectorTiles","bing-mvt"],Ol._labelConfigBing=[{source:["water_feature"],labelType:"water",minZoom:0,radius:395e4,polygonSources:["generic_water_fill"]},{source:["water_feature"],labelType:"water",minZoom:3,radius:1e6,polygonSources:["generic_water_fill"]},{source:["country_region"],labelType:"country",minZoom:0,maxZoom:5,radius:3e5},{source:["admin_division1"],labelType:"state",minZoom:4,maxZoom:7,radius:3e5},{source:["populated_place"],labelType:"city",minZoom:8,radius:4e4},{source:["neighborhood"],labelType:"neighbourhood",minZoom:12,radius:6e3},{source:["amusement_park"],labelType:"poi",minZoom:14,radius:2e3,polygonSources:["amusement_park_fill"]},{source:["hospital"],labelType:"poi",minZoom:14,radius:1e3,polygonSources:["hospital_fill"]},{source:["shopping_center"],labelType:"poi",minZoom:14,radius:1e3,polygonSources:["shopping_center_fill"]},{source:["stadium"],labelType:"poi",minZoom:14,radius:1e3,polygonSources:["stadium_fill"]},{source:["higher_education_facility","school"],labelType:"poi",minZoom:14,radius:1e3,polygonSources:["higher_education_facility_fill","school_fill"]},{source:["zoo"],labelType:"poi",minZoom:14,radius:1e3,polygonSources:["zoo_fill"]},{source:["airport","airport_terminal"],labelType:"majorPoi",minZoom:11,radius:3e3,polygonSources:["airport_terminal_fill","airport_fill-merged7","airport_runway_fill"]},{source:["reserve"],labelType:"majorPoi",minZoom:7,radius:15e3,polygonSources:["generic_reserve_fill","land_cover_forest_fill"]}],Ol._roadLayersBing=new Set(["road"]),Ol);function Ol(e,t){var i=this;this._disposed=!1,this._lastHeadingTime=0,this._actionQueue=[],this._pointerUpdateDelay=3e3,this._camUpdateDelay=1e3,this._headUpdateLimit=1e3,this._controlEventDelay=500,this._moveThreshold=25,this._headingThreshold=5,this._pitchThreshold=5,this._roadPixelRadius=120,this._minRoadDistance=25,this._minIntersectionPixelDistance=50,this._labelConfig=[{source:["Ocean label","Ocean name"],labelType:"water",minZoom:0,radius:395e4,polygonSources:["Ocean","Ocean or sea"]},{source:["Sea label"],labelType:"water",minZoom:3,radius:1e6,polygonSources:["Sea","Ocean or sea"]},{source:["Country name"],labelType:"country",minZoom:0,maxZoom:5,radius:3e5},{source:["State name","State name short"],labelType:"state",minZoom:4,maxZoom:7,radius:3e5},{source:["Capital city","Large city"],labelType:"city",minZoom:8,radius:4e4},{source:["Medium city"],labelType:"city",minZoom:8,radius:3e4},{source:["Small city"],labelType:"city",minZoom:8,radius:2e4},{source:["Island label"],labelType:"city",minZoom:8,radius:1e4},{source:["Town"],labelType:"city",minZoom:10,radius:1e4},{source:["Village"],labelType:"neighbourhood",minZoom:12,radius:6e3},{source:["Amusement area label"],labelType:"poi",minZoom:14,radius:2e3,polygonSources:["Amusement park"]},{source:["Hospital label"],labelType:"poi",minZoom:14,radius:1e3,polygonSources:["Hospital"]},{source:["Shopping centre label"],labelType:"poi",minZoom:14,radius:1e3,polygonSources:["Shopping"]},{source:["Stadium label"],labelType:"poi",minZoom:14,radius:1e3,polygonSources:["Stadium"]},{source:["University/School label"],labelType:"poi",minZoom:14,radius:1e3,polygonSources:["University"]},{source:["Zoo label"],labelType:"poi",minZoom:14,radius:1e3,polygonSources:["Zoo"]},{source:["Airport Label","Airport name","Airport POI"],labelType:"majorPoi",minZoom:11,radius:3e3,polygonSources:["Airport","Runway"]},{source:["National park label"],labelType:"majorPoi",minZoom:7,radius:15e3,polygonSources:["National or state park","National park","Forest"]},{source:["Reservation label"],labelType:"majorPoi",minZoom:7,radius:15e3,polygonSources:["Reservation"]}],this._labelCache=new Set(["city","state","country","water","majorPoi"]),this._roadLayers=new Set(["Connecting road","Connecting road tunnel","International road","International road tunnel","Local road","Local road tunnel","Major local road","Major local road tunnel","Major road","Major road tunnel","Minor local road","Minor local road tunnel","Motorway","Motorway tunnel","Secondary road","Secondary road tunnel","Toll connecting road","Toll connecting road tunnel","Toll international road","Toll international road tunnel","Toll local road","Toll local road tunnel","Toll major local road","Toll major local road tunnel","Toll major road","Toll major road tunnel","Toll minor local road","Toll minor local road tunnel","Toll motorway","Toll motorway tunnel","Toll secondary road","Toll secondary road tunnel"]),this._returnDetailedDescriptions=!1,this._shortcutListener=function(n){return Tl(i,void 0,void 0,function(){var t,r,o;return Il(this,function(e){switch(e.label){case 0:return n.altKey&&n.ctrlKey&&68===n.keyCode?(this._returnDetailedDescriptions=!this._returnDetailedDescriptions,t=this._map.getCamera(),o=this._map.getStyle(),r=o.language.toLowerCase(),o=o.style.toLowerCase(),[4,this._getLocDesc(t,r,o)]):[3,2];case 1:o=e.sent(),this._descCallback(o),e.label=2;case 2:return[2]}})})},this._onRotate=function(){i._rotateTimeout||(Date.now()-i._lastHeadingTime>=i._headUpdateLimit?i._rotateTimeout=setTimeout(i._updateHeading,le.RotationDuration+25):i._rotateTimeout=setTimeout(i._updateHeading,i._headUpdateLimit-(Date.now()-i._lastHeadingTime)))},this._onMove=function(){i._moveTimeout&&(clearTimeout(i._moveTimeout),delete i._moveTimeout),i._controlTimeout&&(clearTimeout(i._controlTimeout),delete i._controlTimeout)},this._onMoveEnd=function(e){e.fromControl?i._controlTimeout=setTimeout(i._updateCam,i._controlEventDelay):i._updateCam()},this._onStyleData=function(){setTimeout(i._updateStyle)},this._onPointerDown=function(e){i._lastPointerPos=i._getEventPos(e),i._pointerTimeout=setTimeout(function(){return Tl(i,void 0,void 0,function(){var t,r,o;return Il(this,function(e){switch(e.label){case 0:return r=this._map.getStyle(),t=r.language.toLowerCase(),o=r.style.toLowerCase(),(r=this._map.getCamera()).center=this._map.pixelsToPositions([this._lastPointerPos])[0],[4,this._getLocDesc(r,t,o)];case 1:return o=e.sent(),this._descCallback(o),this._onPointerUp(),[2]}})})},i._pointerUpdateDelay),i._map.getCanvas().addEventListener("mousemove",i._onPointerMove),i._map.getCanvas().addEventListener("touchmove",i._onPointerMove),i._map.getCanvas().addEventListener("mouseup",i._onPointerUp),i._map.getCanvas().addEventListener("touchend",i._onPointerUp)},this._onPointerMove=function(e){var t=i._getEventPos(e),e=i._lastPointerPos[0]-t[0],t=i._lastPointerPos[1]-t[1];Math.sqrt(e*e+t*t)>i._moveThreshold&&i._onPointerUp()},this._onPointerUp=function(){clearTimeout(i._pointerTimeout),delete i._pointerTimeout,i._map.getCanvas().removeEventListener("mousemove",i._onPointerMove),i._map.getCanvas().removeEventListener("touchmove",i._onPointerMove),i._map.getCanvas().removeEventListener("mouseup",i._onPointerUp),i._map.getCanvas().removeEventListener("touchend",i._onPointerUp)},this._updateHeading=function(){var e,t=i._map.getCamera();i._lastHead&&!i._checkHeadingThreshold(t.bearing,i._lastHead)||(e=i._getHeadingDesc(t),i._lastHead=t.bearing,i._descCallback("<p>Map heading "+e+".</p>"),i._lastHeadingTime=Date.now()),delete i._rotateTimeout},this._updateStyle=function(){return Tl(i,void 0,void 0,function(){var t,r,o,n;return Il(this,function(e){switch(e.label){case 0:return(t=this._map.getCamera(),o=this._map.getStyle(),r=o.language.toLowerCase(),o=o.style.toLowerCase(),this._lastLang===r)?[3,2]:(Ol._labelCache._preloadCache(r),[4,this._getLocDesc(t,r,o)]);case 1:return n=e.sent(),[3,4];case 2:return this._lastStyle===o||"blank"!==this._lastStyle?[3,4]:[4,this._getLocDesc(t,r,o)];case 3:n=e.sent(),e.label=4;case 4:return this._lastLang=r,this._lastStyle=o,n&&this._descCallback(n),[2]}})})},this._updateCam=function(e){void 0===e&&(e=!1);var r,o,t,n=i._map.getCamera();(!i._lastCam||0<i._actionQueue.length||i._checkThresholds(n,i._lastCam))&&(t=i._map.getStyle(),r=t.language.toLowerCase(),o=t.style.toLowerCase(),(t=i._getActionDesc(n))&&i._actionQueue.push(t),i._lastCam=n,i._moveTimeout&&(clearTimeout(i._moveTimeout),delete i._moveTimeout),i._moveTimeout=setTimeout(function(){return Tl(i,void 0,void 0,function(){var t;return Il(this,function(e){switch(e.label){case 0:return clearTimeout(this._rotateTimeout),delete this._rotateTimeout,[4,this._getLocDesc(n,r,o)];case 1:return t=e.sent(),0<this._actionQueue.length?(this._descCallback("<p>Map "+this._actionQueue.join(", then ")+".</p>"+t),this._actionQueue=[]):this._descCallback(t),[2]}})})},e?0:i._camUpdateDelay))},this._map=e,this._restFallback=e.getServiceOptions().enableAccessibilityLocationFallback,this._descCallback=t,this._reverseSearch=new bl(e),Ol._labelCache||(Ol._labelCache=new El),this._lastLang=this._map.getStyle().language.toLowerCase(),Ol._labelCache._preloadCache(this._lastLang),this._map.events.addOnce("idle",function(){var e;i._disposed||(i._updateCam(!0),i._baseVectorTileSourceId=Ol._baseVectorTileSourceIds.find(function(e){return i._map.sources.getById(e)}),"bing-mvt"===i._baseVectorTileSourceId&&(i._labelConfig=Ol._labelConfigBing,i._roadLayers=Ol._roadLayersBing),i._polygonStyleLayer=i._labelConfig.reduce(function(e,t){return t.polygonSources&&e.push.apply(e,kl([],Al(t.polygonSources))),e},[]),(e=i._map._getMap()).on("move",i._onMove),e.on("moveend",i._onMoveEnd),e.on("styledata",i._onStyleData),e.on("rotate",i._onRotate),(e=i._map.getCanvas()).addEventListener("mousedown",i._onPointerDown),e.addEventListener("touchstart",i._onPointerDown))}),this._map.getMapContainer().addEventListener("keydown",this._shortcutListener)}var Rl,xl,Ml,Nl=function(e){var r=this;this.addToMap=function(){r.initializeMapLiveStateInfo(),r.initializeMapStyleInfo(),r.createMapKeyBindingInfo(),r.map.getMapContainer().setAttribute("role","application"),r.map.getMapContainer().setAttribute("aria-label","Map Application"),r.map.getCanvasContainer().setAttribute("aria-live","polite"),r.map.getCanvasContainer().setAttribute("aria-describedby","atlas-map-state atlas-map-style"),r.map.getCanvas().setAttribute("aria-label","Interactive Map"),r.map.getCanvas().setAttribute("aria-describedby","atlas-map-shortcuts"),r.map.getCanvas().setAttribute("alt","Interactive Map")},this.removeFromMap=function(){null!=r.mapViewDesc&&r.mapViewDesc.dispose(),delete r.mapViewDesc,null!=r.atlasMapKeyBindings&&r.map.getCanvasContainer().removeChild(r.atlasMapKeyBindings),delete r.atlasMapKeyBindings,null!=r.atlasMapLiveStateInfo&&r.map.getCanvasContainer().removeChild(r.atlasMapLiveStateInfo),delete r.atlasMapLiveStateInfo,null!=r.atlasMapStyleInfo&&r.map.getCanvasContainer().removeChild(r.atlasMapStyleInfo),delete r.atlasMapStyleInfo,r.map.getMapContainer().removeAttribute("role"),r.map.getMapContainer().removeAttribute("aria-label"),r.map.getCanvasContainer().removeAttribute("aria-live"),r.map.getCanvasContainer().removeAttribute("aria-describedby"),r.map.getCanvas().removeAttribute("aria-label"),r.map.getCanvas().removeAttribute("aria-describedby"),r.map.getCanvas().removeAttribute("alt"),r.map.events.remove("stylechanged",r.updateMapStyle)},this.createMapKeyBindingInfo=function(){r.atlasMapKeyBindings=document.createElement("div"),r.atlasMapKeyBindings.setAttribute("tabindex","-1"),r.atlasMapKeyBindings.setAttribute("aria-hidden","true"),r.atlasMapKeyBindings.id="atlas-map-shortcuts",r.atlasMapKeyBindings.classList.add("hidden-accessible-element"),r.atlasMapKeyBindings.innerHTML=["Map shortcuts:","Zoom out: hyphen.","Zoom in: plus.","Pan right 100 pixels: right arrow.","Pan left 100 pixels: left arrow.","Pan up 100 pixels: up arrow.","Pan down 100 pixels: down arrow.","Rotate 15 degrees clockwise: shift + right arrow.","Rotate 15 degrees counter clockwise: shift + left arrow.","Increase pitch 10 degrees: shift + up arrow.","Decrease pitch 10 degrees: shift + down arrow.","Jump focus to the map: Escape."].join("\n"),r.map.getCanvasContainer().appendChild(r.atlasMapKeyBindings);var e=[189,187,38,37,39,40],t=r.map._getMap()._canvas;null!=t&&t.addEventListener("keyup",function(t){e.find(function(e){return t.keyCode===e})&&(r.atlasMapKeyBindings.innerHTML="")})},this.initializeMapLiveStateInfo=function(){r.mapViewDesc=new Pl(r.map,r.updateMapState),r.atlasMapLiveStateInfo=document.createElement("div"),r.atlasMapLiveStateInfo.setAttribute("tabindex","-1"),r.atlasMapLiveStateInfo.setAttribute("aria-hidden","true"),r.atlasMapLiveStateInfo.id="atlas-map-state",r.atlasMapLiveStateInfo.classList.add("hidden-accessible-element"),r.map.getCanvasContainer().appendChild(r.atlasMapLiveStateInfo)},this.initializeMapStyleInfo=function(){r.atlasMapStyleInfo=document.createElement("div"),r.atlasMapStyleInfo.setAttribute("tabindex","-1"),r.atlasMapStyleInfo.setAttribute("aria-hidden","true"),r.atlasMapStyleInfo.id="atlas-map-style",r.atlasMapStyleInfo.classList.add("hidden-accessible-element"),r.map.events.add("stylechanged",r.updateMapStyle),r.map.getCanvasContainer().appendChild(r.atlasMapStyleInfo)},this.updateMapStyle=function(){r.atlasMapStyleInfo.innerHTML="<p>Map style: "+r.map.getStyle().style+".</p>"},this.updateMapState=function(e){r.atlasMapLiveStateInfo.innerHTML=e},this.map=e},Ll=function(e){var r=this;this.listenerEnabled=!1,this.lastFlowMode="none",this.addToMap=function(){if(!r.map._isReady())throw new Error("Traffic flow could not be added to the map because the map is not ready. Please use a ready event listener to guarantee the map is ready before enabling traffic flow.");r.listenerEnabled||(r.map.events.add("styledata",r.addToMap),r.listenerEnabled=!0);var e,t=r.map.getTraffic();"none"===t.flow||(e=r.map.layers.getLayerById("traffic_"+t.flow))&&(r.lastFlowMode=t.flow,e._updateLayoutProperty("visibility","visible","none"))},this.removeFromMap=function(){var e;r.map.getTraffic();"none"!=r.lastFlowMode&&((e=r.map.layers.getLayerById("traffic_"+r.lastFlowMode))&&e._updateLayoutProperty("visibility","none","visible"),r.lastFlowMode="none"),r.listenerEnabled&&(r.map.events.remove("styledata",r.addToMap),r.listenerEnabled=!1)},this.map=e},Dl=((window&&window.__extends||(Rl=function(e,t){return(Rl=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Rl(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}))(ql,xl=rn),ql.getIncidentTypeName=function(e,t){switch(e){case 0:return t.Unknown;case 1:return t.Accident;case 2:return t.Fog;case 3:return t.Danger;case 4:return t.Rain;case 5:return t.Ice;case 6:return t.Jam;case 7:return t.LaneClosed;case 8:return t.RoadClosed;case 9:return t.RoadWorks;case 10:return t.Wind;case 11:return t.Flood;case 12:return t.Detour;default:return t.Unknown}},ql.getIncidentTypeIconName=function(e){switch(e){case 0:return"unknown";case 1:return"accident";case 2:return"fog";case 3:return"danger";case 4:return"rain";case 5:return"ice";case 6:return"jam";case 7:return"lane-closed";case 8:return"road-closed";case 9:return"road-work";case 10:return"wind";case 11:return"flood";case 12:return"detour";default:return"unknown"}},ql.getSeverityColorName=function(e){switch(e){case 0:return"grey";case 1:return"yellow";case 2:return"orange";case 3:return"red";default:return"grey"}},ql.getSeverityColorHexCode=function(e){switch(e){case 0:return"#B5B6B7";case 1:return"#F4C951";case 2:return"#F4873F";case 3:return"#F04F4E";default:return"#B5B6B7"}},ql);function ql(e,t,r){var o=null!==(n=null!==(o=null!==(n=null!==(o=null!==(n=null!==(o=null!==(n=null!==(o=null!==(n=null!==(o=null!==(n=null!==(o=null!==(n=e.icon_category_12)&&void 0!==n?n:e.icon_category_11)&&void 0!==o?o:e.icon_category_10)&&void 0!==n?n:e.icon_category_9)&&void 0!==o?o:e.icon_category_8)&&void 0!==n?n:e.icon_category_7)&&void 0!==o?o:e.icon_category_6)&&void 0!==n?n:e.icon_category_5)&&void 0!==o?o:e.icon_category_4)&&void 0!==n?n:e.icon_category_3)&&void 0!==o?o:e.icon_category_2)&&void 0!==n?n:e.icon_category_1)&&void 0!==o?o:e.icon_category_0)&&void 0!==n?n:e.icon_category,n=null!==(n=null!==(n=null!==(n=null!==(n=null!==(n=null!==(n=null!==(n=null!==(n=null!==(n=null!==(n=null!==(n=null!==(n=null!==(n=e.description_12)&&void 0!==n?n:e.description_11)&&void 0!==n?n:e.description_10)&&void 0!==n?n:e.description_9)&&void 0!==n?n:e.description_8)&&void 0!==n?n:e.description_7)&&void 0!==n?n:e.description_6)&&void 0!==n?n:e.description_5)&&void 0!==n?n:e.description_4)&&void 0!==n?n:e.description_3)&&void 0!==n?n:e.description_2)&&void 0!==n?n:e.description_1)&&void 0!==n?n:e.description_0)&&void 0!==n?n:e.description,e={icon:ql.getSeverityColorName(e.magnitude)+"-"+ql.getIncidentTypeIconName(o),incidentType:ql.getIncidentTypeName(o,r),description:n,delay:e.delay,color:ql.getSeverityColorHexCode(e.magnitude),id:e.id};return xl.call(this,t,e)||this}(o=Ml=Ml||{}).DELAY="delay",o.LENGTH="length",o.FROM="from",o.TO="to";var Ul=(jl.build=function(e,t){void 0===t&&(t="en-US");var r=document.createElement("div");r.classList.add("incident-popup-title"),r.classList.add("font-segoeui-b"),r.innerText=e.properties.incidentType,r.setAttribute("aria-label","Incident Type "+e.properties.incidentType);var o=document.createElement("div");o.classList.add("incident-popup-subtitle"),o.classList.add("font-segoeui-b"),o.setAttribute("aria-label","Incident Description "+e.properties.description),o.innerText=e.properties.description;var n=document.createElement("div");n.classList.add("incident-popup-header"),n.style.backgroundColor=e.properties.color,n.appendChild(r),n.appendChild(o);var i,s,a,o=document.createElement("div");o.classList.add("incident-popup-body"),e.properties.delay&&(i=Math.floor(e.properties.delay/60)+" min",i=this.createInfoSection(i,Ml.DELAY),o.appendChild(i)),e.properties.length&&(i=new Intl.NumberFormat([t,"en-US"],{maximumFractionDigits:2}),a=void 0,a="en-US"===t?(s=qn(e.properties.length,"meters","miles"),i.format(s)+" miles"):(s=qn(e.properties.length,"meters","kilometers"),i.format(s)+" km"),a=this.createInfoSection(a,Ml.LENGTH),o.appendChild(a)),e.properties.from&&(a=this.createInfoSection(e.properties.from,Ml.FROM),o.appendChild(a)),e.properties.to&&(c=this.createInfoSection(e.properties.to,Ml.TO),o.appendChild(c));var c=document.createElement("div");return c.classList.add("incident-popup-content"),c.appendChild(n),c.appendChild(o),new zc({content:c,position:e.geometry.coordinates})},jl.createInfoSection=function(e,t){var r=document.createElement("div");r.classList.add("incident-popup-info");var o=document.createElement("div");o.classList.add("icon"),o.classList.add(t);var n=document.createElement("span");return n.classList.add("message"),n.classList.add("font-segoeui"),n.setAttribute("aria-label","Incident "+t+" "+e),n.innerText=e,r.appendChild(o),r.appendChild(n),r},jl);function jl(){}var Hl=window&&window.__awaiter||function(e,s,a,c){return new(a=a||Promise)(function(r,t){function o(e){try{i(c.next(e))}catch(e){t(e)}}function n(e){try{i(c.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(o,n)}i((c=c.apply(e,s||[])).next())})},Bl=window&&window.__generator||function(r,o){var n,i,s,a={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(t){return function(e){return function(t){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(s=2&t[0]?i.return:t[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,t[1])).done)return s;switch(i=0,(t=s?[2&t[0],s.value]:t)[0]){case 0:case 1:s=t;break;case 4:return a.label++,{value:t[1],done:!1};case 5:a.label++,i=t[1],t=[0];continue;case 7:t=a.ops.pop(),a.trys.pop();continue;default:if(!(s=0<(s=a.trys).length&&s[s.length-1])&&(6===t[0]||2===t[0])){a=0;continue}if(3===t[0]&&(!s||t[1]>s[0]&&t[1]<s[3])){a.label=t[1];break}if(6===t[0]&&a.label<s[1]){a.label=s[1],s=t;break}if(s&&a.label<s[2]){a.label=s[2],a.ops.push(t);break}s[2]&&a.ops.pop(),a.trys.pop();continue}t=o.call(r,a)}catch(e){t=[6,e],i=0}finally{n=s=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}([t,e])}}},zl=(Fl.prototype.getIncidentIconImageExpression=function(){return["concat",["let","magnitude",["get","magnitude"],["case",["==",["var","magnitude"],0],"grey",["==",["var","magnitude"],1],"yellow",["==",["var","magnitude"],2],"orange",["==",["var","magnitude"],3],"red",["==",["var","magnitude"],4],"grey","grey"]],"-",["let","category",["coalesce",["get","icon_category_12"],["get","icon_category_11"],["get","icon_category_10"],["get","icon_category_9"],["get","icon_category_8"],["get","icon_category_7"],["get","icon_category_6"],["get","icon_category_5"],["get","icon_category_4"],["get","icon_category_3"],["get","icon_category_2"],["get","icon_category_0"],["get","icon_category"],0],["case",["==",["var","category"],0],"unknown",["==",["var","category"],1],"accident",["==",["var","category"],2],"fog",["==",["var","category"],3],"danger",["==",["var","category"],4],"rain",["==",["var","category"],5],"ice",["==",["var","category"],6],"jam",["==",["var","category"],7],"lane-closed",["==",["var","category"],8],"road-closed",["==",["var","category"],9],"road-work",["==",["var","category"],10],"wind",["==",["var","category"],11],"flood",["==",["var","category"],12],"detour","unknown"]]]},Fl);function Fl(e){var n=this;this.incidentLayerName="incidents",this.incidentSourceName="mapcontrol_traffic_incident",this.addToMap=function(){n.map.sources.getById(n.incidentSourceName)||n.map.sources.add(n.vectorTileSource),n.map.layers.getLayerById(n.incidentLayerName)||n.map.layers.add(n.incidentLayer,"labels"),n.clickPopup=new zc({position:[0,0],pixelOffset:[0,-18]}),n.map.addEventListener("mouseover",n.incidentLayerName,n.cursorToPointer),n.map.addEventListener("mouseleave",n.incidentLayerName,n.cursorToDefault),n.map.addEventListener("click",n.incidentLayerName,n.openIncidentPopup),n.map.events.addOnce("idle",n.setAccessiblePopups),n.map.events.add("moveend",n.setAccessiblePopups)},this.accessiblePopups=[],this.setAccessiblePopups=function(){return Hl(n,void 0,void 0,function(){var t,i,s,a,c,u,l=this;return Bl(this,function(e){switch(e.label){case 0:return this.accessiblePopups.forEach(function(e){return e.remove()}),this.accessiblePopups=[],t=this.map.layers.getRenderedShapes(this.map.getCamera().bounds,this.incidentLayer),[4,this.map._getLocalizedStrings()];case 1:return i=e.sent(),s=function(t,r){var e=t[r],o=e.geometry.coordinates,o=new un(new gi(o[0],o[1])),o=new Dl(e.properties,o,i),n=Ul.build(o,l.incidentLanguage),o=n.getPopupContainer();return o.addEventListener("focusin",function(e){l.clickPopup.remove(),l.accessiblePopups.filter(function(e){return e!==n}).forEach(function(e){return e.remove()}),0<=r-1&&a(n,s(t,r-1)),r+1<t.length&&u(s(t,r+1)),2<=r&&r==t.length-1&&c(s(t,0)),0==r&&2<=t.length&&u(s(t,t.length-1))}),r==t.length-1&&o.addEventListener("focusout",function(e){null===e.relatedTarget&&n.close()}),l.accessiblePopups.push(n),n},a=function(e,t){t.open(l.map),t.close();t=t.getPopupContainer(),e=e.getPopupContainer();e.parentElement.insertBefore(t,e)},c=function(e){e.open(l.map),e.close();var t=e.getPopupContainer(),e=t.parentElement;e.insertBefore(t,e.firstElementChild)},u=function(e){e.open(l.map),e.close()},0<t.length&&u(s(t,0)),1<t.length&&u(s(t,t.length-1)),[2]}})})},this.removeFromMap=function(){var e;n.map.removeEventListener("mouseover",n.incidentLayerName,n.cursorToPointer),n.map.removeEventListener("mouseleave",n.incidentLayerName,n.cursorToDefault),n.map.removeEventListener("click",n.incidentLayerName,n.openIncidentPopup),n.map.events.remove("idle",n.setAccessiblePopups),n.map.events.remove("moveend",n.setAccessiblePopups),n.accessiblePopups.forEach(function(e){return e.remove()}),n.accessiblePopups=[],null!==(e=n.clickPopup)&&void 0!==e&&e.remove(),null!=n.map.layers.getLayerById(n.incidentLayerName)&&n.map.layers.remove(n.incidentLayerName),null!=n.map.sources.getById(n.incidentSourceName)&&n.map.sources.remove(n.incidentSourceName)},this.cursorToPointer=function(e){n.map.getCanvas().style.cursor="pointer"},this.cursorToDefault=function(e){n.map.getCanvas().style.cursor=""},this.openIncidentPopup=function(e){n.clickPopup.remove(),n.accessiblePopups.forEach(function(e){return e.close()});var r=e.position,o=e.features[0];n.map._getLocalizedStrings().then(function(e){var t=new un(new gi(r[0],r[1])),e=new Dl(o.properties,t,e);n.clickPopup=Ul.build(e,n.incidentLanguage),n.clickPopup.open(n.map),n.clickPopup.getPopupContainer().addEventListener("focusout",function(e){null===e.relatedTarget&&n.clickPopup.close()})})},this.map=e,this.vectorTileSource=new vs(this.incidentSourceName,{maxZoom:22,tiles:["https://"+u+"/traffic/incident/tile/pbf?api-version=1.0&zoom={z}&x={x}&y={y}"]});e=this.getIncidentIconImageExpression();this.incidentLayer=new ac(this.incidentSourceName,this.incidentLayerName,{sourceLayer:"Traffic incident POI",iconOptions:{ignorePlacement:!0,allowOverlap:!0,image:e,size:.75}})}var Kl,Gl,Yl=((window&&window.__extends||(Kl=function(e,t){return(Kl=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Kl(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}))(Zl,Gl=k),Zl);function Zl(){var e=null!==Gl&&Gl.apply(this,arguments)||this;return e.interactive=!0,e.scrollZoomInteraction=!0,e.boxZoomInteraction=!0,e.dragRotateInteraction=!0,e.dragPanInteraction=!0,e.keyboardInteraction=!0,e.dblClickZoomInteraction=!0,e.touchInteraction=!0,e.touchRotate=!0,e.wheelZoomRate=1/450,e}var Wl=(Vl.prototype.enable=function(){this.map.getMapContainer().addEventListener("keydown",this._onKeyDown)},Vl.prototype.disable=function(){this.map.getMapContainer().removeEventListener("keydown",this._onKeyDown)},Vl);function Vl(e){var t=this;this._onKeyDown=function(e){27===e.keyCode&&t.map.getCanvas().focus()},this.map=e}var Jl=(Ql.prototype.enable=function(){this.map.getCanvasContainer().addEventListener("gesturestart",this._onGestureStart),this.map.getCanvasContainer().addEventListener("gesturechange",this._onGestureChange),this.map.getCanvasContainer().addEventListener("touchstart",this._onTouchStart),this.map.getCanvasContainer().addEventListener("touchend",this._onTouchEnd)},Ql.prototype.disable=function(){this.map.getCanvasContainer().removeEventListener("gesturestart",this._onGestureStart),this.map.getCanvasContainer().removeEventListener("gesturechange",this._onGestureChange),this.map.getCanvasContainer().removeEventListener("touchstart",this._onTouchStart),this.map.getCanvasContainer().removeEventListener("touchend",this._onTouchEnd)},Ql);function Ql(e){var t=this;this._onGestureStart=function(e){t.hasTouch||(e.preventDefault(),t.initZoom=t.map.getCamera().zoom)},this._onGestureChange=function(e){t.hasTouch||(e.preventDefault(),t.map.setCamera({zoom:t.initZoom+e.scale-1}))},this._onTouchStart=function(e){t.hasTouch=!0},this._onTouchEnd=function(e){0===e.touches.length&&(t.hasTouch=!1)},this.map=e}var Xl=($l.prototype.addToMap=function(){this.added||(this.added=!0,this._setInteractions(this.options))},$l.prototype.removeFromMap=function(){this.added&&(this.added=!1,this._setInteractions({interactive:!1}))},$l.prototype.setOptions=function(e){this.options=(new Yl).merge(this.options,e),this.added&&this._setInteractions(this.options)},$l.prototype.getOptions=function(){return Object.assign({},this.options)},$l.prototype._setInteractions=function(e){var t;e.interactive?(e.boxZoomInteraction?this.map._getMap().boxZoom.enable():this.map._getMap().boxZoom.disable(),e.dblClickZoomInteraction?this.map._getMap().doubleClickZoom.enable():this.map._getMap().doubleClickZoom.disable(),e.dragPanInteraction?this.map._getMap().dragPan.enable():this.map._getMap().dragPan.disable(),e.dragRotateInteraction?this.map._getMap().dragRotate.enable():this.map._getMap().dragRotate.disable(),e.keyboardInteraction?(this.map._getMap().keyboard.enable(),this.focusShortcut.enable()):(this.map._getMap().keyboard.disable(),this.focusShortcut.disable()),e.scrollZoomInteraction?(this.map._getMap().scrollZoom.enable(),this.map._getMap().scrollZoom.setWheelZoomRate(e.wheelZoomRate)):this.map._getMap().scrollZoom.disable(),t=this.map._getMap().touchZoomRotate,e.touchInteraction?(t.enable(),e.touchRotate?t.enableRotation():t.disableRotation()):t.disable(),this.pinchZoom.enable()):(this.map._getMap().boxZoom.disable(),this.map._getMap().doubleClickZoom.disable(),this.map._getMap().dragPan.disable(),this.map._getMap().dragRotate.disable(),this.map._getMap().keyboard.disable(),this.focusShortcut.disable(),this.map._getMap().scrollZoom.disable(),this.map._getMap().touchZoomRotate.disable(),this.pinchZoom.disable())},$l);function $l(e,t){this.added=!1,this.map=e,this.focusShortcut=new Wl(e),this.pinchZoom=new Jl(e),this.options=(new Yl).merge(t)}function eh(e,t,r){var o={type:"Feature"};return 0!==(r=void 0===r?{}:r).id&&!r.id||(o.id=r.id),r.bbox&&(o.bbox=r.bbox),o.properties=t||{},o.geometry=e,o}function th(e){return"Feature"===e.type?e.geometry:e}var rh=xe(function(e,t){e.exports=function(){function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||false;o.configurable=true;if("value"in o)o.writable=true;Object.defineProperty(e,o.key,o)}}function s(e,t,r){if(t)o(e.prototype,t);if(r)o(e,r);return e}var l=function(){function e(e,t){this.next=null;this.key=e;this.data=t;this.left=null;this.right=null}return e}();function t(e,t){return e>t?1:e<t?-1:0}function a(e,t,r){var o=new l(null,null);var n=o;var i=o;while(true){var s=r(e,t.key);if(s<0){if(t.left===null)break;if(r(e,t.left.key)<0){var a=t.left;t.left=a.right;a.right=t;t=a;if(t.left===null)break}i.left=t;i=t;t=t.left}else if(s>0){if(t.right===null)break;if(r(e,t.right.key)>0){var a=t.right;t.right=a.left;a.left=t;t=a;if(t.right===null)break}n.right=t;n=t;t=t.right}else break}n.right=t.left;i.left=t.right;t.left=o.right;t.right=o.left;return t}function c(e,t,r,o){var n=new l(e,t);if(r===null){n.left=n.right=null;return n}r=a(e,r,o);var i=o(e,r.key);if(i<0){n.left=r.left;n.right=r;r.left=null}else if(i>=0){n.right=r.right;n.left=r;r.right=null}return n}function h(e,t,r){var o=null;var n=null;if(t){t=a(e,t,r);var i=r(t.key,e);if(i===0){o=t.left;n=t.right}else if(i<0){n=t.right;t.right=null;o=t}else{o=t.left;t.left=null;n=t}}return{left:o,right:n}}function p(e,t,r){if(t===null)return e;if(e===null)return t;t=a(e.key,t,r);t.left=e;return t}function d(e,t,r,o,n){if(e){o(""+t+(r?"└── ":"├── ")+n(e)+"\n");var i=t+(r?" ":"│ ");if(e.left)d(e.left,i,false,o,n);if(e.right)d(e.right,i,true,o,n)}}var R=function(){function e(e){if(e===void 0)e=t;this._root=null;this._size=0;this._comparator=e}e.prototype.insert=function(e,t){this._size++;return this._root=c(e,t,this._root,this._comparator)};e.prototype.add=function(e,t){var r=new l(e,t);if(this._root===null){r.left=r.right=null;this._size++;this._root=r}var o=this._comparator;var n=a(e,this._root,o);var i=o(e,n.key);if(i===0)this._root=n;else{if(i<0){r.left=n.left;r.right=n;n.left=null}else if(i>0){r.right=n.right;r.left=n;n.right=null}this._size++;this._root=r}return this._root};e.prototype.remove=function(e){this._root=this._remove(e,this._root,this._comparator)};e.prototype._remove=function(e,t,r){var o;if(t===null)return null;t=a(e,t,r);var n=r(e,t.key);if(n===0){if(t.left===null)o=t.right;else{o=a(e,t.left,r);o.right=t.right}this._size--;return o}return t};e.prototype.pop=function(){var e=this._root;if(e){while(e.left)e=e.left;this._root=a(e.key,this._root,this._comparator);this._root=this._remove(e.key,this._root,this._comparator);return{key:e.key,data:e.data}}return null};e.prototype.findStatic=function(e){var t=this._root;var r=this._comparator;while(t){var o=r(e,t.key);if(o===0)return t;else if(o<0)t=t.left;else t=t.right}return null};e.prototype.find=function(e){if(this._root){this._root=a(e,this._root,this._comparator);if(this._comparator(e,this._root.key)!==0)return null}return this._root};e.prototype.contains=function(e){var t=this._root;var r=this._comparator;while(t){var o=r(e,t.key);if(o===0)return true;else if(o<0)t=t.left;else t=t.right}return false};e.prototype.forEach=function(e,t){var r=this._root;var o=[];var n=false;while(!n)if(r!==null){o.push(r);r=r.left}else if(o.length!==0){r=o.pop();e.call(t,r);r=r.right}else n=true;return this};e.prototype.range=function(e,t,r,o){var n=[];var i=this._comparator;var s=this._root;var a;while(n.length!==0||s)if(s){n.push(s);s=s.left}else{s=n.pop();a=i(s.key,t);if(a>0)break;else if(i(s.key,e)>=0)if(r.call(o,s))return this;s=s.right}return this};e.prototype.keys=function(){var r=[];this.forEach(function(e){var t=e.key;return r.push(t)});return r};e.prototype.values=function(){var r=[];this.forEach(function(e){var t=e.data;return r.push(t)});return r};e.prototype.min=function(){if(this._root)return this.minNode(this._root).key;return null};e.prototype.max=function(){if(this._root)return this.maxNode(this._root).key;return null};e.prototype.minNode=function(e){if(e===void 0)e=this._root;if(e)while(e.left)e=e.left;return e};e.prototype.maxNode=function(e){if(e===void 0)e=this._root;if(e)while(e.right)e=e.right;return e};e.prototype.at=function(e){var t=this._root;var r=false;var o=0;var n=[];while(!r)if(t){n.push(t);t=t.left}else if(n.length>0){t=n.pop();if(o===e)return t;o++;t=t.right}else r=true;return null};e.prototype.next=function(e){var t=this._root;var r=null;if(e.right){r=e.right;while(r.left)r=r.left;return r}var o=this._comparator;while(t){var n=o(e.key,t.key);if(n===0)break;else if(n<0){r=t;t=t.left}else t=t.right}return r};e.prototype.prev=function(e){var t=this._root;var r=null;if(e.left!==null){r=e.left;while(r.right)r=r.right;return r}var o=this._comparator;while(t){var n=o(e.key,t.key);if(n===0)break;else if(n<0)t=t.left;else{r=t;t=t.right}}return r};e.prototype.clear=function(){this._root=null;this._size=0;return this};e.prototype.toList=function(){return r(this._root)};e.prototype.load=function(e,t,r){if(t===void 0)t=[];if(r===void 0)r=false;var o=e.length;var n=this._comparator;if(r)v(e,t,0,o-1,n);if(this._root===null){this._root=f(e,t,0,o);this._size=o}else{var i=m(this.toList(),g(e,t),n);o=this._size+o;this._root=y({head:i},0,o)}return this};e.prototype.isEmpty=function(){return this._root===null};Object.defineProperty(e.prototype,"size",{get:function e(){return this._size},enumerable:true,configurable:true});Object.defineProperty(e.prototype,"root",{get:function e(){return this._root},enumerable:true,configurable:true});e.prototype.toString=function(e){if(e===void 0)e=function e(t){return String(t.key)};var t=[];d(this._root,"",true,function(e){return t.push(e)},e);return t.join("")};e.prototype.update=function(e,t,r){var o=this._comparator;var n=h(e,this._root,o),i=n.left,s=n.right;if(o(e,t)<0)s=c(t,r,s,o);else i=c(t,r,i,o);this._root=p(i,s,o)};e.prototype.split=function(e){return h(e,this._root,this._comparator)};return e}();function f(e,t,r,o){var n=o-r;if(n>0){var i=r+Math.floor(n/2);var s=e[i];var a=t[i];var c=new l(s,a);c.left=f(e,t,r,i);c.right=f(e,t,i+1,o);return c}return null}function g(e,t){var r=new l(null,null);var o=r;for(var n=0;n<e.length;n++)o=o.next=new l(e[n],t[n]);o.next=null;return r.next}function r(e){var t=e;var r=[];var o=false;var n=new l(null,null);var i=n;while(!o)if(t){r.push(t);t=t.left}else if(r.length>0){t=i=i.next=r.pop();t=t.right}else o=true;i.next=null;return n.next}function y(e,t,r){var o=r-t;if(o>0){var n=t+Math.floor(o/2);var i=y(e,t,n);var s=e.head;s.left=i;e.head=e.head.next;s.right=y(e,n+1,r);return s}return null}function m(e,t,r){var o=new l(null,null);var n=o;var i=e;var s=t;while(i!==null&&s!==null){if(r(i.key,s.key)<0){n.next=i;i=i.next}else{n.next=s;s=s.next}n=n.next}if(i!==null)n.next=i;else if(s!==null)n.next=s;return o.next}function v(e,t,r,o,n){if(r>=o)return;var i=e[r+o>>1];var s=r-1;var a=o+1;while(true){do{s++}while(n(e[s],i)<0);do{a--}while(n(e[a],i)>0);if(s>=a)break;var c=e[s];e[s]=e[a];e[a]=c;c=t[s];t[s]=t[a];t[a]=c}v(e,t,r,a,n);v(e,t,a+1,o,n)}var _=function e(t,r){return t.ll.x<=r.x&&r.x<=t.ur.x&&t.ll.y<=r.y&&r.y<=t.ur.y},x=function e(t,r){if(r.ur.x<t.ll.x||t.ur.x<r.ll.x||r.ur.y<t.ll.y||t.ur.y<r.ll.y)return null;var o=t.ll.x<r.ll.x?r.ll.x:t.ll.x;var n=t.ur.x<r.ur.x?t.ur.x:r.ur.x;var i=t.ll.y<r.ll.y?r.ll.y:t.ll.y;var s=t.ur.y<r.ur.y?t.ur.y:r.ur.y;return{ll:{x:o,y:i},ur:{x:n,y:s}}},n=Number.EPSILON;if(n===undefined)n=Math.pow(2,-52);var i=n*n,w=function e(t,r){if(-n<t&&t<n)if(-n<r&&r<n)return 0;var o=t-r;if(o*o<i*t*r)return 0;return t<r?-1:1},e=function(){function e(){u(this,e);this.reset()}s(e,[{key:"reset",value:function e(){this.xRounder=new b;this.yRounder=new b}},{key:"round",value:function e(t,r){return{x:this.xRounder.round(t),y:this.yRounder.round(r)}}}]);return e}(),b=function(){function e(){u(this,e);this.tree=new R;this.round(0)}s(e,[{key:"round",value:function e(t){var r=this.tree.add(t);var o=this.tree.prev(r);if(o!==null&&w(r.key,o.key)===0){this.tree.remove(t);return o.key}var n=this.tree.next(r);if(n!==null&&w(r.key,n.key)===0){this.tree.remove(t);return n.key}return t}}]);return e}(),M=new e,C=function e(t,r){return t.x*r.y-t.y*r.x},E=function e(t,r){return t.x*r.x+t.y*r.y},S=function e(t,r,o){var n={x:r.x-t.x,y:r.y-t.y};var i={x:o.x-t.x,y:o.y-t.y};var s=C(n,i);return w(s,0)},T=function e(t){return Math.sqrt(E(t,t))},I=function e(t,r,o){var n={x:r.x-t.x,y:r.y-t.y};var i={x:o.x-t.x,y:o.y-t.y};return C(i,n)/T(i)/T(n)},A=function e(t,r,o){var n={x:r.x-t.x,y:r.y-t.y};var i={x:o.x-t.x,y:o.y-t.y};return E(i,n)/T(i)/T(n)},k=function e(t,r,o){if(r.y===0)return null;return{x:t.x+r.x/r.y*(o-t.y),y:o}},P=function e(t,r,o){if(r.x===0)return null;return{x:o,y:t.y+r.y/r.x*(o-t.x)}},O=function e(t,r,o,n){if(r.x===0)return P(o,n,t.x);if(n.x===0)return P(t,r,o.x);if(r.y===0)return k(o,n,t.y);if(n.y===0)return k(t,r,o.y);var i=C(r,n);if(i==0)return null;var s={x:o.x-t.x,y:o.y-t.y};var a=C(s,r)/i;var c=C(s,n)/i;var u=t.x+c*r.x,l=o.x+a*n.x;var h=t.y+c*r.y,p=o.y+a*n.y;var d=(u+l)/2;var f=(h+p)/2;return{x:d,y:f}},N=function(){s(n,null,[{key:"compare",value:function e(t,r){var o=n.comparePoints(t.point,r.point);if(o!==0)return o;if(t.point!==r.point)t.link(r);if(t.isLeft!==r.isLeft)return t.isLeft?1:-1;return D.compare(t.segment,r.segment)}},{key:"comparePoints",value:function e(t,r){if(t.x<r.x)return-1;if(t.x>r.x)return 1;if(t.y<r.y)return-1;if(t.y>r.y)return 1;return 0}}]);function n(e,t){u(this,n);if(e.events===undefined)e.events=[this];else e.events.push(this);this.point=e;this.isLeft=t}s(n,[{key:"link",value:function e(t){if(t.point===this.point)throw new Error("Tried to link already linked events");var r=t.point.events;for(var o=0,n=r.length;o<n;o++){var i=r[o];this.point.events.push(i);i.point=this.point}this.checkForConsuming()}},{key:"checkForConsuming",value:function e(){var t=this.point.events.length;for(var r=0;r<t;r++){var o=this.point.events[r];if(o.segment.consumedBy!==undefined)continue;for(var n=r+1;n<t;n++){var i=this.point.events[n];if(i.consumedBy!==undefined)continue;if(o.otherSE.point.events!==i.otherSE.point.events)continue;o.segment.consume(i.segment)}}}},{key:"getAvailableLinkedEvents",value:function e(){var t=[];for(var r=0,o=this.point.events.length;r<o;r++){var n=this.point.events[r];if(n!==this&&!n.segment.ringOut&&n.segment.isInResult())t.push(n)}return t}},{key:"getLeftmostComparator",value:function e(o){var n=this;var c=new Map;var u=function e(t){var r=t.otherSE;c.set(t,{sine:I(n.point,o.point,r.point),cosine:A(n.point,o.point,r.point)})};return function(e,t){if(!c.has(e))u(e);if(!c.has(t))u(t);var r=c.get(e),o=r.sine,n=r.cosine;var i=c.get(t),s=i.sine,a=i.cosine;if(o>=0&&s>=0){if(n<a)return 1;if(n>a)return-1;return 0}if(o<0&&s<0){if(n<a)return-1;if(n>a)return 1;return 0}if(s<o)return-1;if(s>o)return 1;return 0}}}]);return n}(),L=0,D=function(){s(p,null,[{key:"compare",value:function e(t,r){var o=t.leftSE.point.x;var n=r.leftSE.point.x;var i=t.rightSE.point.x;var s=r.rightSE.point.x;if(s<o)return 1;if(i<n)return-1;var a=t.leftSE.point.y;var c=r.leftSE.point.y;var u=t.rightSE.point.y;var l=r.rightSE.point.y;if(o<n){if(c<a&&c<u)return 1;if(c>a&&c>u)return-1;var h=t.comparePoint(r.leftSE.point);if(h<0)return 1;if(h>0)return-1;var p=r.comparePoint(t.rightSE.point);if(p!==0)return p;return-1}if(o>n){if(a<c&&a<l)return-1;if(a>c&&a>l)return 1;var d=r.comparePoint(t.leftSE.point);if(d!==0)return d;var f=t.comparePoint(r.rightSE.point);if(f<0)return 1;if(f>0)return-1;return 1}if(a<c)return-1;if(a>c)return 1;if(i<s){var g=r.comparePoint(t.rightSE.point);if(g!==0)return g}if(i>s){var y=t.comparePoint(r.rightSE.point);if(y<0)return 1;if(y>0)return-1}if(i!==s){var m=u-a;var v=i-o;var _=l-c;var w=s-n;if(m>v&&_<w)return 1;if(m<v&&_>w)return-1}if(i>s)return 1;if(i<s)return-1;if(u<l)return-1;if(u>l)return 1;if(t.id<r.id)return-1;if(t.id>r.id)return 1;return 0}}]);function p(e,t,r,o){u(this,p);this.id=++L;this.leftSE=e;e.segment=this;e.otherSE=t;this.rightSE=t;t.segment=this;t.otherSE=e;this.rings=r;this.windings=o}s(p,[{key:"replaceRightSE",value:function e(t){this.rightSE=t;this.rightSE.segment=this;this.rightSE.otherSE=this.leftSE;this.leftSE.otherSE=this.rightSE}},{key:"bbox",value:function e(){var t=this.leftSE.point.y;var r=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:t<r?t:r},ur:{x:this.rightSE.point.x,y:t>r?t:r}}}},{key:"vector",value:function e(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}},{key:"isAnEndpoint",value:function e(t){return t.x===this.leftSE.point.x&&t.y===this.leftSE.point.y||t.x===this.rightSE.point.x&&t.y===this.rightSE.point.y}},{key:"comparePoint",value:function e(t){if(this.isAnEndpoint(t))return 0;var r=this.leftSE.point;var o=this.rightSE.point;var n=this.vector();if(r.x===o.x){if(t.x===r.x)return 0;return t.x<r.x?1:-1}var i=(t.y-r.y)/n.y;var s=r.x+i*n.x;if(t.x===s)return 0;var a=(t.x-r.x)/n.x;var c=r.y+a*n.y;if(t.y===c)return 0;return t.y<c?-1:1}},{key:"getIntersection",value:function e(t){var r=this.bbox();var o=t.bbox();var n=x(r,o);if(n===null)return null;var i=this.leftSE.point;var s=this.rightSE.point;var a=t.leftSE.point;var c=t.rightSE.point;var u=_(r,a)&&this.comparePoint(a)===0;var l=_(o,i)&&t.comparePoint(i)===0;var h=_(r,c)&&this.comparePoint(c)===0;var p=_(o,s)&&t.comparePoint(s)===0;if(l&&u){if(p&&!h)return s;if(!p&&h)return c;return null}if(l){if(h)if(i.x===c.x&&i.y===c.y)return null;return i}if(u){if(p)if(s.x===a.x&&s.y===a.y)return null;return a}if(p&&h)return null;if(p)return s;if(h)return c;var d=O(i,this.vector(),a,t.vector());if(d===null)return null;if(!_(n,d))return null;return M.round(d.x,d.y)}},{key:"split",value:function e(t){var r=[];var o=t.events!==undefined;var n=new N(t,true);var i=new N(t,false);var s=this.rightSE;this.replaceRightSE(i);r.push(i);r.push(n);var a=new p(n,s,this.rings.slice(),this.windings.slice());if(N.comparePoints(a.leftSE.point,a.rightSE.point)>0)a.swapEvents();if(N.comparePoints(this.leftSE.point,this.rightSE.point)>0)this.swapEvents();if(o){n.checkForConsuming();i.checkForConsuming()}return r}},{key:"swapEvents",value:function e(){var t=this.rightSE;this.rightSE=this.leftSE;this.leftSE=t;this.leftSE.isLeft=true;this.rightSE.isLeft=false;for(var r=0,o=this.windings.length;r<o;r++)this.windings[r]*=-1}},{key:"consume",value:function e(t){var r=this;var o=t;while(r.consumedBy)r=r.consumedBy;while(o.consumedBy)o=o.consumedBy;var n=p.compare(r,o);if(n===0)return;if(n>0){var i=r;r=o;o=i}if(r.prev===o){var s=r;r=o;o=s}for(var a=0,c=o.rings.length;a<c;a++){var u=o.rings[a];var l=o.windings[a];var h=r.rings.indexOf(u);if(h===-1){r.rings.push(u);r.windings.push(l)}else r.windings[h]+=l}o.rings=null;o.windings=null;o.consumedBy=r;o.leftSE.consumedBy=r.leftSE;o.rightSE.consumedBy=r.rightSE}},{key:"prevInResult",value:function e(){if(this._prevInResult!==undefined)return this._prevInResult;if(!this.prev)this._prevInResult=null;else if(this.prev.isInResult())this._prevInResult=this.prev;else this._prevInResult=this.prev.prevInResult();return this._prevInResult}},{key:"beforeState",value:function e(){if(this._beforeState!==undefined)return this._beforeState;if(!this.prev)this._beforeState={rings:[],windings:[],multiPolys:[]};else{var t=this.prev.consumedBy||this.prev;this._beforeState=t.afterState()}return this._beforeState}},{key:"afterState",value:function e(){if(this._afterState!==undefined)return this._afterState;var t=this.beforeState();this._afterState={rings:t.rings.slice(0),windings:t.windings.slice(0),multiPolys:[]};var r=this._afterState.rings;var o=this._afterState.windings;var n=this._afterState.multiPolys;for(var i=0,s=this.rings.length;i<s;i++){var a=this.rings[i];var c=this.windings[i];var u=r.indexOf(a);if(u===-1){r.push(a);o.push(c)}else o[u]+=c}var l=[];var h=[];for(var p=0,d=r.length;p<d;p++){if(o[p]===0)continue;var f=r[p];var g=f.poly;if(h.indexOf(g)!==-1)continue;if(f.isExterior)l.push(g);else{if(h.indexOf(g)===-1)h.push(g);var y=l.indexOf(f.poly);if(y!==-1)l.splice(y,1)}}for(var m=0,v=l.length;m<v;m++){var _=l[m].multiPoly;if(n.indexOf(_)===-1)n.push(_)}return this._afterState}},{key:"isInResult",value:function e(){if(this.consumedBy)return false;if(this._isInResult!==undefined)return this._isInResult;var t=this.beforeState().multiPolys;var r=this.afterState().multiPolys;switch(Z.type){case"union":{var o=t.length===0;var n=r.length===0;this._isInResult=o!==n;break}case"intersection":{var i;var s;if(t.length<r.length){i=t.length;s=r.length}else{i=r.length;s=t.length}this._isInResult=s===Z.numMultiPolys&&i<s;break}case"xor":{var a=Math.abs(t.length-r.length);this._isInResult=a%2===1;break}case"difference":{var c=function e(t){return t.length===1&&t[0].isSubject};this._isInResult=c(t)!==c(r);break}default:throw new Error("Unrecognized operation type found ".concat(Z.type))}return this._isInResult}}],[{key:"fromRing",value:function e(t,r,o){var n,i,s;var a=N.comparePoints(t,r);if(a<0){n=t;i=r;s=1}else if(a>0){n=r;i=t;s=-1}else throw new Error("Tried to create degenerate segment at [".concat(t.x,", ").concat(t.y,"]"));var c=new N(n,true);var u=new N(i,false);return new p(c,u,[o],[s])}}]);return p}(),q=function(){function c(e,t,r){u(this,c);if(!Array.isArray(e)||e.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.poly=t;this.isExterior=r;this.segments=[];if(typeof e[0][0]!=="number"||typeof e[0][1]!=="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var o=M.round(e[0][0],e[0][1]);this.bbox={ll:{x:o.x,y:o.y},ur:{x:o.x,y:o.y}};var n=o;for(var i=1,s=e.length;i<s;i++){if(typeof e[i][0]!=="number"||typeof e[i][1]!=="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var a=M.round(e[i][0],e[i][1]);if(a.x===n.x&&a.y===n.y)continue;this.segments.push(D.fromRing(n,a,this));if(a.x<this.bbox.ll.x)this.bbox.ll.x=a.x;if(a.y<this.bbox.ll.y)this.bbox.ll.y=a.y;if(a.x>this.bbox.ur.x)this.bbox.ur.x=a.x;if(a.y>this.bbox.ur.y)this.bbox.ur.y=a.y;n=a}if(o.x!==n.x||o.y!==n.y)this.segments.push(D.fromRing(n,o,this))}s(c,[{key:"getSweepEvents",value:function e(){var t=[];for(var r=0,o=this.segments.length;r<o;r++){var n=this.segments[r];t.push(n.leftSE);t.push(n.rightSE)}return t}}]);return c}(),U=function(){function i(e,t){u(this,i);if(!Array.isArray(e))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new q(e[0],this,true);this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}};this.interiorRings=[];for(var r=1,o=e.length;r<o;r++){var n=new q(e[r],this,false);if(n.bbox.ll.x<this.bbox.ll.x)this.bbox.ll.x=n.bbox.ll.x;if(n.bbox.ll.y<this.bbox.ll.y)this.bbox.ll.y=n.bbox.ll.y;if(n.bbox.ur.x>this.bbox.ur.x)this.bbox.ur.x=n.bbox.ur.x;if(n.bbox.ur.y>this.bbox.ur.y)this.bbox.ur.y=n.bbox.ur.y;this.interiorRings.push(n)}this.multiPoly=t}s(i,[{key:"getSweepEvents",value:function e(){var t=this.exteriorRing.getSweepEvents();for(var r=0,o=this.interiorRings.length;r<o;r++){var n=this.interiorRings[r].getSweepEvents();for(var i=0,s=n.length;i<s;i++)t.push(n[i])}return t}}]);return i}(),j=function(){function i(e,t){u(this,i);if(!Array.isArray(e))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{if(typeof e[0][0][0]==="number")e=[e]}catch(e){}this.polys=[];this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(var r=0,o=e.length;r<o;r++){var n=new U(e[r],this);if(n.bbox.ll.x<this.bbox.ll.x)this.bbox.ll.x=n.bbox.ll.x;if(n.bbox.ll.y<this.bbox.ll.y)this.bbox.ll.y=n.bbox.ll.y;if(n.bbox.ur.x>this.bbox.ur.x)this.bbox.ur.x=n.bbox.ur.x;if(n.bbox.ur.y>this.bbox.ur.y)this.bbox.ur.y=n.bbox.ur.y;this.polys.push(n)}this.isSubject=t}s(i,[{key:"getSweepEvents",value:function e(){var t=[];for(var r=0,o=this.polys.length;r<o;r++){var n=this.polys[r].getSweepEvents();for(var i=0,s=n.length;i<s;i++)t.push(n[i])}return t}}]);return i}(),H=function(){s(b,null,[{key:"factory",value:function e(t){var r=[];for(var o=0,n=t.length;o<n;o++){var i=t[o];if(!i.isInResult()||i.ringOut)continue;var s=null;var a=i.leftSE;var c=i.rightSE;var u=[a];var l=a.point;var h=[];while(true){s=a;a=c;u.push(a);if(a.point===l)break;while(true){var p=a.getAvailableLinkedEvents();if(p.length===0){var d=u[0].point;var f=u[u.length-1].point;throw new Error("Unable to complete output ring starting at [".concat(d.x,",")+" ".concat(d.y,"]. Last matching segment found ends at")+" [".concat(f.x,", ").concat(f.y,"]."))}if(p.length===1){c=p[0].otherSE;break}var g=null;for(var y=0,m=h.length;y<m;y++)if(h[y].point===a.point){g=y;break}if(g!==null){var v=h.splice(g)[0];var _=u.splice(v.index);_.unshift(_[0].otherSE);r.push(new b(_.reverse()));continue}h.push({index:u.length,point:a.point});var w=a.getLeftmostComparator(s);c=p.sort(w)[0].otherSE;break}}r.push(new b(u))}return r}}]);function b(e){u(this,b);this.events=e;for(var t=0,r=e.length;t<r;t++)e[t].segment.ringOut=this;this.poly=null}s(b,[{key:"getGeom",value:function e(){var t=this.events[0].point;var r=[t];for(var o=1,n=this.events.length-1;o<n;o++){var i=this.events[o].point;var s=this.events[o+1].point;if(S(i,t,s)===0)continue;r.push(i);t=i}if(r.length===1)return null;var a=r[0];var c=r[1];if(S(a,t,c)===0)r.shift();r.push(r[0]);var u=this.isExteriorRing()?1:-1;var l=this.isExteriorRing()?0:r.length-1;var h=this.isExteriorRing()?r.length:-1;var p=[];for(var d=l;d!=h;d+=u)p.push([r[d].x,r[d].y]);return p}},{key:"isExteriorRing",value:function e(){if(this._isExteriorRing===undefined){var t=this.enclosingRing();this._isExteriorRing=t?!t.isExteriorRing():true}return this._isExteriorRing}},{key:"enclosingRing",value:function e(){if(this._enclosingRing===undefined)this._enclosingRing=this._calcEnclosingRing();return this._enclosingRing}},{key:"_calcEnclosingRing",value:function e(){var t=this.events[0];for(var r=1,o=this.events.length;r<o;r++){var n=this.events[r];if(N.compare(t,n)>0)t=n}var i=t.segment.prevInResult();var s=i?i.prevInResult():null;while(true){if(!i)return null;if(!s)return i.ringOut;if(s.ringOut!==i.ringOut)if(s.ringOut.enclosingRing()!==i.ringOut)return i.ringOut;else return i.ringOut.enclosingRing();i=s.prevInResult();s=i?i.prevInResult():null}}}]);return b}(),B=function(){function t(e){u(this,t);this.exteriorRing=e;e.poly=this;this.interiorRings=[]}s(t,[{key:"addInterior",value:function e(t){this.interiorRings.push(t);t.poly=this}},{key:"getGeom",value:function e(){var t=[this.exteriorRing.getGeom()];if(t[0]===null)return null;for(var r=0,o=this.interiorRings.length;r<o;r++){var n=this.interiorRings[r].getGeom();if(n===null)continue;t.push(n)}return t}}]);return t}(),z=function(){function t(e){u(this,t);this.rings=e;this.polys=this._composePolys(e)}s(t,[{key:"getGeom",value:function e(){var t=[];for(var r=0,o=this.polys.length;r<o;r++){var n=this.polys[r].getGeom();if(n===null)continue;t.push(n)}return t}},{key:"_composePolys",value:function e(t){var r=[];for(var o=0,n=t.length;o<n;o++){var i=t[o];if(i.poly)continue;if(i.isExteriorRing())r.push(new B(i));else{var s=i.enclosingRing();if(!s.poly)r.push(new B(s));s.poly.addInterior(i)}}return r}}]);return t}(),F=function(){function r(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:D.compare;u(this,r);this.queue=e;this.tree=new R(t);this.segments=[]}s(r,[{key:"process",value:function e(t){var r=t.segment;var o=[];if(t.consumedBy){if(t.isLeft)this.queue.remove(t.otherSE);else this.tree.remove(r);return o}var n=t.isLeft?this.tree.insert(r):this.tree.find(r);if(!n)throw new Error("Unable to find segment #".concat(r.id," ")+"[".concat(r.leftSE.point.x,", ").concat(r.leftSE.point.y,"] -> ")+"[".concat(r.rightSE.point.x,", ").concat(r.rightSE.point.y,"] ")+"in SweepLine tree. Please submit a bug report.");var i=n;var s=n;var a=undefined;var c=undefined;while(a===undefined){i=this.tree.prev(i);if(i===null)a=null;else if(i.key.consumedBy===undefined)a=i.key}while(c===undefined){s=this.tree.next(s);if(s===null)c=null;else if(s.key.consumedBy===undefined)c=s.key}if(t.isLeft){var u=null;if(a){var l=a.getIntersection(r);if(l!==null){if(!r.isAnEndpoint(l))u=l;if(!a.isAnEndpoint(l)){var h=this._splitSafely(a,l);for(var p=0,d=h.length;p<d;p++)o.push(h[p])}}}var f=null;if(c){var g=c.getIntersection(r);if(g!==null){if(!r.isAnEndpoint(g))f=g;if(!c.isAnEndpoint(g)){var y=this._splitSafely(c,g);for(var m=0,v=y.length;m<v;m++)o.push(y[m])}}}if(u!==null||f!==null){var _=null;if(u===null)_=f;else if(f===null)_=u;else{var w=N.comparePoints(u,f);_=w<=0?u:f}this.queue.remove(r.rightSE);o.push(r.rightSE);var b=r.split(_);for(var C=0,E=b.length;C<E;C++)o.push(b[C])}if(o.length>0){this.tree.remove(r);o.push(t)}else{this.segments.push(r);r.prev=a}}else{if(a&&c){var S=a.getIntersection(c);if(S!==null){if(!a.isAnEndpoint(S)){var T=this._splitSafely(a,S);for(var I=0,A=T.length;I<A;I++)o.push(T[I])}if(!c.isAnEndpoint(S)){var k=this._splitSafely(c,S);for(var P=0,O=k.length;P<O;P++)o.push(k[P])}}}this.tree.remove(r)}return o}},{key:"_splitSafely",value:function e(t,r){this.tree.remove(t);var o=t.rightSE;this.queue.remove(o);var n=t.split(r);n.push(o);if(t.consumedBy===undefined)this.tree.insert(t);return n}}]);return r}(),K=typeof process!=="undefined"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,G=typeof process!=="undefined"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6,Y,Z=new(function(){function e(){u(this,e)}s(e,[{key:"run",value:function e(t,r,o){Z.type=t;M.reset();var n=[new j(r,true)];for(var i=0,s=o.length;i<s;i++)n.push(new j(o[i],false));Z.numMultiPolys=n.length;if(Z.type==="difference"){var a=n[0];var c=1;while(c<n.length)if(x(n[c].bbox,a.bbox)!==null)c++;else n.splice(c,1)}if(Z.type==="intersection")for(var u=0,l=n.length;u<l;u++){var h=n[u];for(var p=u+1,d=n.length;p<d;p++)if(x(h.bbox,n[p].bbox)===null)return[]}var f=new R(N.compare);for(var g=0,y=n.length;g<y;g++){var m=n[g].getSweepEvents();for(var v=0,_=m.length;v<_;v++){f.insert(m[v]);if(f.size>K)throw new Error("Infinite loop when putting segment endpoints in a priority queue "+"(queue size too big). Please file a bug report.")}}var w=new F(f);var b=f.size;var C=f.pop();while(C){var E=C.key;if(f.size===b){var S=E.segment;throw new Error("Unable to pop() ".concat(E.isLeft?"left":"right"," SweepEvent ")+"[".concat(E.point.x,", ").concat(E.point.y,"] from segment #").concat(S.id," ")+"[".concat(S.leftSE.point.x,", ").concat(S.leftSE.point.y,"] -> ")+"[".concat(S.rightSE.point.x,", ").concat(S.rightSE.point.y,"] from queue. ")+"Please file a bug report.")}if(f.size>K)throw new Error("Infinite loop when passing sweep line over endpoints "+"(queue size too big). Please file a bug report.");if(w.segments.length>G)throw new Error("Infinite loop when passing sweep line over endpoints "+"(too many sweep line segments). Please file a bug report.");var T=w.process(E);for(var I=0,A=T.length;I<A;I++){var k=T[I];if(k.consumedBy===undefined)f.insert(k)}b=f.size;C=f.pop()}M.reset();var P=H.factory(w.segments);var O=new z(P);return O.getGeom()}}]);return e}()),W,V,J,Q,X;return{union:function e(t){for(var r=arguments.length,o=new Array(r>1?r-1:0),n=1;n<r;n++)o[n-1]=arguments[n];return Z.run("union",t,o)},intersection:function e(t){for(var r=arguments.length,o=new Array(r>1?r-1:0),n=1;n<r;n++)o[n-1]=arguments[n];return Z.run("intersection",t,o)},xor:function e(t){for(var r=arguments.length,o=new Array(r>1?r-1:0),n=1;n<r;n++)o[n-1]=arguments[n];return Z.run("xor",t,o)},difference:function e(t){for(var r=arguments.length,o=new Array(r>1?r-1:0),n=1;n<r;n++)o[n-1]=arguments[n];return Z.run("difference",t,o)}}}()});function oh(e,t,r){void 0===r&&(r={});var o,e=th(e),t=th(t),t=rh.intersection(e.coordinates,t.coordinates);return 0===t.length?null:1===t.length?function(e,t,r){void 0===r&&(r={});for(var o=0,n=e;o<n.length;o++){var i=n[o];if(i.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var s=0;s<i[i.length-1].length;s++)if(i[i.length-1][s]!==i[0][s])throw new Error("First and last Position are not equivalent.")}return eh({type:"Polygon",coordinates:e},t,r)}(t[0],r.properties):(r=r.properties,eh({type:"MultiPolygon",coordinates:t},r,o=void 0===o?{}:o))}var nh,w=window&&window.__decorate||function(e,t,r,o){var n,i=arguments.length,s=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,o);else for(var a=e.length-1;0<=a;a--)(n=e[a])&&(s=(i<3?n(s):3<i?n(t,r,s):n(t,r))||s);return 3<i&&s&&Object.defineProperty(t,r,s),s},ih=window&&window.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var o,n,i=r.call(e),s=[];try{for(;(void 0===t||0<t--)&&!(o=i.next()).done;)s.push(o.value)}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return s},sh=window&&window.__spreadArray||function(e,t){for(var r=0,o=t.length,n=e.length;r<o;r++,n++)e[n]=t[r];return e},ah=["DIV","SPAN","A"],ch=["data-azure-maps-attribution-minzoom","data-azure-maps-attribution-maxzoom","data-azure-maps-attribution-geometry","data-azure-maps-attribution-tileset","data-azure-maps-attribution-order","data-azure-maps-attribution-dynamic"],uh=sh(["href"],ih(ch)),lh=(hh.prototype.equals=function(e){return this.stringRepresentation===e.stringRepresentation},Object.defineProperty(hh.prototype,"stringRepresentation",{get:function(){return[void 0!==this.minZoom?"minzoom="+this.minZoom:"",void 0!==this.maxZoom?"maxzoom="+this.maxZoom:"",void 0!==this.geometry?this.element.attributes.getNamedItem("data-azure-maps-attribution-geometry").value:"",void 0!==this.tilesetId?"tilesetId="+this.tilesetId:"",this.dynamic?"dynamic":""].filter(function(e){return 0<e.length}).join(";")},enumerable:!1,configurable:!0}),hh.applicable=function(e){return Array.from(e.attributes).map(function(e){return ch.includes(e.name)}).reduce(function(e,t){return e||t},!1)},Object.defineProperty(hh.prototype,"minZoom",{get:function(){var e=this.element.attributes.getNamedItem("data-azure-maps-attribution-minzoom");return e&&!isNaN(e.value)?parseInt(e.value):void 0},enumerable:!1,configurable:!0}),Object.defineProperty(hh.prototype,"maxZoom",{get:function(){var e=this.element.attributes.getNamedItem("data-azure-maps-attribution-maxzoom");return e&&!isNaN(e.value)?parseInt(e.value):void 0},enumerable:!1,configurable:!0}),Object.defineProperty(hh.prototype,"geometry",{get:function(){var e=this.element.attributes.getNamedItem("data-azure-maps-attribution-geometry");if(e&&e.value)try{return JSON.parse(e.value)}catch(e){return}},enumerable:!1,configurable:!0}),Object.defineProperty(hh.prototype,"tilesetId",{get:function(){var e=this.element.attributes.getNamedItem("data-azure-maps-attribution-tileset");return e&&e.value?e.value:void 0},enumerable:!1,configurable:!0}),Object.defineProperty(hh.prototype,"order",{get:function(){var e=this.element.attributes.getNamedItem("data-azure-maps-attribution-order");return e&&!isNaN(e.value)?parseInt(e.value):void 0},enumerable:!1,configurable:!0}),Object.defineProperty(hh.prototype,"dynamic",{get:function(){return null!==this.element.attributes.getNamedItem("data-azure-maps-attribution-dynamic")},enumerable:!1,configurable:!0}),Object.defineProperty(hh.prototype,"hidesElement",{get:function(){return"none"==this.element.style.display},enumerable:!1,configurable:!0}),hh.prototype.forceHide=function(){this.element.style.display="none"},hh.prototype.satisfied=function(e){var t=!this.minZoom||!e.zoom||e.zoom>=this.minZoom,r=!this.maxZoom||!e.zoom||e.zoom<=this.maxZoom,o=!0;return this.geometry&&e.bounds&&(o=null!==oh({type:"Feature",geometry:this.geometry,properties:{}},{type:"Feature",geometry:{type:"Polygon",coordinates:[[Ai.getNorthWest(e.bounds),Ai.getNorthEast(e.bounds),Ai.getSouthEast(e.bounds),Ai.getSouthWest(e.bounds),Ai.getNorthWest(e.bounds)]]},properties:{}})),t&&r&&o},hh.prototype.apply=function(t,e){var r=this;void 0===e&&(e=null);var o=this.satisfied(t.getCamera()),n=this.dynamic&&this.tilesetId,i=this.hidesElement,e=e&&["dragend","zoomend","pitchend"].includes(e.type);return o||i?o&&(i||n)&&(o&&i&&this.element.style.removeProperty("display"),n&&(e?t.events.addOnce("idle",function(e){return r.fetchAndApplyDynamicAttribution(t)}):this.fetchAndApplyDynamicAttribution(t))):this.element.style.display="none",o===i},hh.prototype.fetchAndApplyDynamicAttribution=function(o){var t,r,e,n=this,i=o.getCamera();this.lastFetchState&&Ai.containsBoundingBox(this.lastFetchState.bounds,i.bounds)&&Math.floor(this.lastFetchState.zoom)==Math.floor(i.zoom)||(t=Vn(i.center,Ai.getSouthWest(i.bounds),hh.viewportBufferExpansionRatio),e=((r=Vn(i.center,Ai.getNorthEast(i.bounds),hh.viewportBufferExpansionRatio))[0]<t[0]?[[t[0],t[1],180,r[1]],[-180,t[1],r[0],r[1]]]:[[t[0],t[1],r[0],r[1]]]).map(function(e){var t=new URLSearchParams({"api-version":"2.1",tilesetId:n.tilesetId,zoom:void 0!==i.zoom?""+Math.floor(i.zoom):void 0,bounds:e.join(",")}),r="https://{{azMapsDomain}}/map/attribution",e={url:r,headers:{}};o._substituteDomainLanguageViewAndSignInRequest(r,e);t=e.url+(e.url.includes("?")?"&":"?")+t.toString();return o._sendRequest(t,"Attribution",e.headers).then(function(e){return e.json()})}),Promise.all(e).then(function(e){n.applyAttributionResponse(e),n.lastFetchState={bounds:new Ai([t[0],t[1],r[0],r[1]]),zoom:i.zoom}}).catch(function(e){return console.error(e)}))},hh.prototype.applyAttributionResponse=function(e){var t,r,o=this,n=e.map(function(e){return e.copyrights||[]}).reduce(function(e,t){return sh(sh([],ih(e)),ih(t))},[]);0!=n.length&&(null!==(e=xc.parseWithFilter(n.join(""),function(e){return!0},function(e){return e},function(){return o.element.innerHTML="",o.element}))?(e="string"==typeof e?((n=document.createElement("span")).innerHTML=e,n):e,r=e===this.element?(t=document.createElement("span"),Array.from(this.element.childNodes).forEach(function(e){return t.appendChild(e)}),t):e,Array.from(this.element.attributes).filter(function(e){return ch.includes(e.name)}).forEach(function(e){return r.attributes.setNamedItem(e.cloneNode())}),r.style.display=this.element.style.display,e=this.element.parentElement,this.element.remove(),e.append(r),this.element=r,this.attributionChangeCallback(this)):console.warn("Dynamic attribution is empty after filtering"))},hh.viewportBufferExpansionRatio=2,w([(nh=1e3,function(e,t,r){var o=r.value,n=new Map;return r.value=function(){var e=this,t=arguments;n.get(e)||!1||(o.apply(e,t),n.set(e,!0),setTimeout(function(){return n.delete(e)},nh))},r})],hh.prototype,"fetchAndApplyDynamicAttribution",null),hh);function hh(e,t){var r=this;this.lastFetchState={bounds:null,zoom:null},this.getElement=function(){return r.element},this.element=e,this.attributionChangeCallback=t}var ph=window&&window.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var o,n,i=r.call(e),s=[];try{for(;(void 0===t||0<t--)&&!(o=i.next()).done;)s.push(o.value)}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return s},dh=window&&window.__spreadArray||function(e,t){for(var r=0,o=t.length,n=e.length;r<o;r++,n++)e[n]=t[r];return e},fh=[/all rights reserved/gi],gh=(yh.prototype.addToMap=function(){this.map.events.add("stylechanged",this.loadAttributionOnceSourcesLoaded),this.map.events.add("dragend",this.applyRules),this.map.events.add("zoomend",this.applyRules),this.map.events.add("pitchend",this.applyRules)},yh.prototype.removeFromMap=function(){this.map.events.remove("stylechanged",this.loadAttributionOnceSourcesLoaded),this.map.events.remove("dragend",this.applyRules),this.map.events.remove("zoomend",this.applyRules),this.map.events.remove("pitchend",this.applyRules)},yh.prototype.getDefaultAttribution=function(){return this.copyrightControl.getDefaultAttributions().map(function(e){return t=e,(e=document.createElement("a")).textContent=t,e;var t})},yh);function yh(e,t,r){var o,a=this;this.rules=[],this.virtualContext=((o=document.createElement("span")).className="azure-map-copyright-context",o),this.renderContext=this.virtualContext.cloneNode(!1),this.addAttributionFromSource=function(e){},this.removeAttributionFromSource=function(e){},this.getMapStyleVisibleSources=function(){var t=a.map._getMap(),r=t.getStyle();return Object.entries(r.sources).filter(function(e){var t=ph(e,1)[0];return r.layers.filter(function(e){return e&&e.source==t}).reduce(function(e,t){return!(t.layout&&"none"===t.layout.visibility||t.paint&&0===t.paint["icon-opacity"]&&0===t.paint["text-opacity"])||e},!1)}).map(function(e){e=ph(e,1)[0];return t.getSource(e)})},this.loadAttributionOnceSourcesLoaded=function(){var e=a.getMapStyleVisibleSources();Promise.all(e.map(function(n){return new Promise(function(r,o){"tiles"in n?r(n):(n.load(),n.on("data",function e(t){"metadata"==t.sourceDataType&&(n.off("data",e),r(n))}),n.on("error",function e(t){n.off("error",e),o(t)}))}).then(function(e){return{status:"fulfilled",value:e}}).catch(function(e){return{status:"rejected",reason:e}})})).then(function(e){a.reloadAttribution()})},this.reloadAttribution=function(){var e=a.getMapStyleVisibleSources(),o=new Set,n={},t=Object.values(e).filter(function(e){return"attribution"in e&&e.attribution&&"tiles"in e&&0<e.tiles.length}).map(function(e){return e}).map(function(e){e=e.attribution;return xc.parseWithFilter(e,function(e){return ah.includes(e.tagName)&&Array.from(e.attributes).map(function(e){return uh.includes(e.name)}).reduce(function(e,t){return e&&t},!0)},function(e){var t,r=null;return e instanceof HTMLElement&&lh.applicable(e)&&(r=new lh(e,function(){return a.renderAttribution()}),o.add(r),void 0!==r.order&&(e.style.order=""+r.order)),r&&e instanceof HTMLElement&&((!((t=r.stringRepresentation)in n)||void 0!==r.order&&void 0!==n[t].order&&r.order<n[t].order||void 0!==r.order&&void 0===n[t].order)&&(n[t]=r)),e},function(){return document.createElement("span")})}),r=new Set(Object.values(n)),e=new Set(dh([],ph(o)).filter(function(e){return!r.has(e)})),i=new Set(dh([],ph(e)).map(function(e){return e.getElement()}));dh([],ph(i)).filter(function(e){return null!==e.parentElement}).forEach(function(e){return e.parentElement.removeChild(e)}),a.rules=Object.values(n);var t=t.filter(function(e){return"string"==typeof e||!i.has(e)}).map(function(e){return"string"==typeof e?new Text(e):e}),s=document.createElement("span");0<t.length?t.forEach(function(e){return s.appendChild(e)}):a.getDefaultAttribution().forEach(function(e){return s.appendChild(e)}),a.virtualContext=s,a.copyrightControl.setOptions({copyrightContent:a.renderContext}),a.applyRules(),a.renderAttribution()},this.applyRules=function(r){void 0===r&&(r=null),a.rules.reduce(function(e,t){t=t.apply(a.map,r);return e||t},!1)&&a.renderAttribution()},this.renderAttribution=function(){var t=function(e){return Array.from("none"!=e.style.display?e.children:[]).map(function(e){return t(e)}).reduce(function(e,t){return dh(dh([],ph(e)),ph(t))},Array.from("none"!=e.style.display?e.childNodes:[]).filter(function(e){return e.nodeType==e.TEXT_NODE}))},e=a.virtualContext.cloneNode(!0),r=t(e);r.forEach(function(e){return e.textContent=dh([],ph(fh)).reduce(function(e,t){return e.replace(t,"").trim()},e.textContent)}),r.reduce(function(e,t){return e.has(t.textContent)?(t.textContent="",t.parentElement&&t.parentElement.removeChild(t)):e.add(t.textContent),e},new Set),a.renderContext.innerHTML="",Array.from(e.childNodes).forEach(function(e){return a.renderContext.appendChild(e)})},this.map=e,this.copyrightControl=t,this.options=r}var mh=function(e,t){return(mh=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)};function vh(e,t){function r(){this.constructor=e}mh(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var _h=function(){return(_h=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)};function wh(e,t){var r={};for(n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r}function bh(e,s,a,c){return new(a=a||Promise)(function(r,t){function o(e){try{i(c.next(e))}catch(e){t(e)}}function n(e){try{i(c.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(o,n)}i((c=c.apply(e,s||[])).next())})}function Ch(r,o){var n,i,s,a={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(t){return function(e){return function(t){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(s=2&t[0]?i.return:t[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,t[1])).done)return s;switch(i=0,(t=s?[2&t[0],s.value]:t)[0]){case 0:case 1:s=t;break;case 4:return a.label++,{value:t[1],done:!1};case 5:a.label++,i=t[1],t=[0];continue;case 7:t=a.ops.pop(),a.trys.pop();continue;default:if(!(s=0<(s=a.trys).length&&s[s.length-1])&&(6===t[0]||2===t[0])){a=0;continue}if(3===t[0]&&(!s||t[1]>s[0]&&t[1]<s[3])){a.label=t[1];break}if(6===t[0]&&a.label<s[1]){a.label=s[1],s=t;break}if(s&&a.label<s[2]){a.label=s[2],a.ops.push(t);break}s[2]&&a.ops.pop(),a.trys.pop();continue}t=o.call(r,a)}catch(e){t=[6,e],i=0}finally{n=s=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}([t,e])}}}function Eh(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var o,n,i=r.call(e),s=[];try{for(;(void 0===t||0<t--)&&!(o=i.next()).done;)s.push(o.value)}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return s}(arguments[t]));return e}var Sh=function(e,t){return(Sh=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)};function Th(e,t){function r(){this.constructor=e}Sh(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var Ih=function(){return(Ih=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)};function Ah(e,s,a,c){return new(a=a||Promise)(function(r,t){function o(e){try{i(c.next(e))}catch(e){t(e)}}function n(e){try{i(c.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(o,n)}i((c=c.apply(e,s||[])).next())})}function kh(r,o){var n,i,s,a={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(t){return function(e){return function(t){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(s=2&t[0]?i.return:t[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,t[1])).done)return s;switch(i=0,(t=s?[2&t[0],s.value]:t)[0]){case 0:case 1:s=t;break;case 4:return a.label++,{value:t[1],done:!1};case 5:a.label++,i=t[1],t=[0];continue;case 7:t=a.ops.pop(),a.trys.pop();continue;default:if(!(s=0<(s=a.trys).length&&s[s.length-1])&&(6===t[0]||2===t[0])){a=0;continue}if(3===t[0]&&(!s||t[1]>s[0]&&t[1]<s[3])){a.label=t[1];break}if(6===t[0]&&a.label<s[1]){a.label=s[1],s=t;break}if(s&&a.label<s[2]){a.label=s[2],a.ops.push(t);break}s[2]&&a.ops.pop(),a.trys.pop();continue}t=o.call(r,a)}catch(e){t=[6,e],i=0}finally{n=s=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}([t,e])}}}function Ph(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;for(var o=Array(e),n=0,t=0;t<r;t++)for(var i=arguments[t],s=0,a=i.length;s<a;s++,n++)o[n]=i[s];return o}var Oh,Rh,xh,Mh,Nh,Lh={LIBRARY_NAME:"MSAL.JS",SKU:"msal.js.common",CACHE_PREFIX:"msal",DEFAULT_AUTHORITY:"https://login.microsoftonline.com/common/",DEFAULT_AUTHORITY_HOST:"login.microsoftonline.com",DEFAULT_COMMON_TENANT:"common",ADFS:"adfs",DSTS:"dstsv2",AAD_INSTANCE_DISCOVERY_ENDPT:"https://login.microsoftonline.com/common/discovery/instance?api-version=1.1&authorization_endpoint=",RESOURCE_DELIM:"|",NO_ACCOUNT:"NO_ACCOUNT",CLAIMS:"claims",CONSUMER_UTID:"9188040d-6c67-4c5b-b112-36a304b66dad",OPENID_SCOPE:"openid",PROFILE_SCOPE:"profile",OFFLINE_ACCESS_SCOPE:"offline_access",EMAIL_SCOPE:"email",CODE_RESPONSE_TYPE:"code",CODE_GRANT_TYPE:"authorization_code",RT_GRANT_TYPE:"refresh_token",FRAGMENT_RESPONSE_MODE:"fragment",S256_CODE_CHALLENGE_METHOD:"S256",URL_FORM_CONTENT_TYPE:"application/x-www-form-urlencoded;charset=utf-8",AUTHORIZATION_PENDING:"authorization_pending",NOT_DEFINED:"not_defined",EMPTY_STRING:"",NOT_APPLICABLE:"N/A",FORWARD_SLASH:"/",IMDS_ENDPOINT:"http://169.254.169.254/metadata/instance/compute/location",IMDS_VERSION:"2020-06-01",IMDS_TIMEOUT:2e3,AZURE_REGION_AUTO_DISCOVER_FLAG:"TryAutoDetect",REGIONAL_AUTH_PUBLIC_CLOUD_SUFFIX:"login.microsoft.com",REGIONAL_AUTH_NON_MSI_QUERY_STRING:"allowestsrnonmsi=true",KNOWN_PUBLIC_CLOUDS:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"],TOKEN_RESPONSE_TYPE:"token",ID_TOKEN_RESPONSE_TYPE:"id_token",SHR_NONCE_VALIDITY:240,INVALID_INSTANCE:"invalid_instance"},Dh=[Lh.OPENID_SCOPE,Lh.PROFILE_SCOPE,Lh.OFFLINE_ACCESS_SCOPE],qh=Ph(Dh,[Lh.EMAIL_SCOPE]);(o=Oh=Oh||{}).CONTENT_TYPE="Content-Type",o.RETRY_AFTER="Retry-After",o.CCS_HEADER="X-AnchorMailbox",o.WWWAuthenticate="WWW-Authenticate",o.AuthenticationInfo="Authentication-Info",o.X_MS_REQUEST_ID="x-ms-request-id",(w=Rh=Rh||{}).ID_TOKEN="idtoken",w.CLIENT_INFO="client.info",w.ADAL_ID_TOKEN="adal.idtoken",w.ERROR="error",w.ERROR_DESC="error.description",w.ACTIVE_ACCOUNT="active-account",w.ACTIVE_ACCOUNT_FILTERS="active-account-filters",(o=xh=xh||{}).COMMON="common",o.ORGANIZATIONS="organizations",o.CONSUMERS="consumers",(w=Mh=Mh||{}).CLIENT_ID="client_id",w.REDIRECT_URI="redirect_uri",w.RESPONSE_TYPE="response_type",w.RESPONSE_MODE="response_mode",w.GRANT_TYPE="grant_type",w.CLAIMS="claims",w.SCOPE="scope",w.ERROR="error",w.ERROR_DESCRIPTION="error_description",w.ACCESS_TOKEN="access_token",w.ID_TOKEN="id_token",w.REFRESH_TOKEN="refresh_token",w.EXPIRES_IN="expires_in",w.STATE="state",w.NONCE="nonce",w.PROMPT="prompt",w.SESSION_STATE="session_state",w.CLIENT_INFO="client_info",w.CODE="code",w.CODE_CHALLENGE="code_challenge",w.CODE_CHALLENGE_METHOD="code_challenge_method",w.CODE_VERIFIER="code_verifier",w.CLIENT_REQUEST_ID="client-request-id",w.X_CLIENT_SKU="x-client-SKU",w.X_CLIENT_VER="x-client-VER",w.X_CLIENT_OS="x-client-OS",w.X_CLIENT_CPU="x-client-CPU",w.X_CLIENT_CURR_TELEM="x-client-current-telemetry",w.X_CLIENT_LAST_TELEM="x-client-last-telemetry",w.X_MS_LIB_CAPABILITY="x-ms-lib-capability",w.X_APP_NAME="x-app-name",w.X_APP_VER="x-app-ver",w.POST_LOGOUT_URI="post_logout_redirect_uri",w.ID_TOKEN_HINT="id_token_hint",w.DEVICE_CODE="device_code",w.CLIENT_SECRET="client_secret",w.CLIENT_ASSERTION="client_assertion",w.CLIENT_ASSERTION_TYPE="client_assertion_type",w.TOKEN_TYPE="token_type",w.REQ_CNF="req_cnf",w.OBO_ASSERTION="assertion",w.REQUESTED_TOKEN_USE="requested_token_use",w.ON_BEHALF_OF="on_behalf_of",w.FOCI="foci",w.CCS_HEADER="X-AnchorMailbox",w.RETURN_SPA_CODE="return_spa_code",w.NATIVE_BROKER="nativebroker",w.LOGOUT_HINT="logout_hint",(o=Nh=Nh||{}).ACCESS_TOKEN="access_token",o.XMS_CC="xms_cc";var Uh,jh={LOGIN:"login",SELECT_ACCOUNT:"select_account",CONSENT:"consent",NONE:"none",CREATE:"create",NO_SESSION:"no_session"};(w=Uh=Uh||{}).ACCOUNT="account",w.SID="sid",w.LOGIN_HINT="login_hint",w.ID_TOKEN="id_token",w.DOMAIN_HINT="domain_hint",w.ORGANIZATIONS="organizations",w.CONSUMERS="consumers",w.ACCOUNT_ID="accountIdentifier",w.HOMEACCOUNT_ID="homeAccountIdentifier";var Hh,Bh,zh,Fh,Kh,Gh,Yh,Zh={PLAIN:"plain",S256:"S256"};(o=Hh=Hh||{}).QUERY="query",o.FRAGMENT="fragment",o.FORM_POST="form_post",(w=Bh=Bh||{}).IMPLICIT_GRANT="implicit",w.AUTHORIZATION_CODE_GRANT="authorization_code",w.CLIENT_CREDENTIALS_GRANT="client_credentials",w.RESOURCE_OWNER_PASSWORD_GRANT="password",w.REFRESH_TOKEN_GRANT="refresh_token",w.DEVICE_CODE_GRANT="device_code",w.JWT_BEARER="urn:ietf:params:oauth:grant-type:jwt-bearer",(o=zh=zh||{}).MSSTS_ACCOUNT_TYPE="MSSTS",o.ADFS_ACCOUNT_TYPE="ADFS",o.MSAV1_ACCOUNT_TYPE="MSA",o.GENERIC_ACCOUNT_TYPE="Generic",(w=Fh=Fh||{}).CACHE_KEY_SEPARATOR="-",w.CLIENT_INFO_SEPARATOR=".",(o=Kh=Kh||{}).ID_TOKEN="IdToken",o.ACCESS_TOKEN="AccessToken",o.ACCESS_TOKEN_WITH_AUTH_SCHEME="AccessToken_With_AuthScheme",o.REFRESH_TOKEN="RefreshToken",(w=Gh=Gh||{}).ACCOUNT="Account",w.CREDENTIAL="Credential",w.ID_TOKEN="IdToken",w.ACCESS_TOKEN="AccessToken",w.REFRESH_TOKEN="RefreshToken",w.APP_METADATA="AppMetadata",w.TEMPORARY="TempCache",w.TELEMETRY="Telemetry",w.UNDEFINED="Undefined",w.THROTTLING="Throttling",(o=Yh=Yh||{})[o.ADFS=1001]="ADFS",o[o.MSA=1002]="MSA",o[o.MSSTS=1003]="MSSTS",o[o.GENERIC=1004]="GENERIC",o[o.ACCESS_TOKEN=2001]="ACCESS_TOKEN",o[o.REFRESH_TOKEN=2002]="REFRESH_TOKEN",o[o.ID_TOKEN=2003]="ID_TOKEN",o[o.APP_METADATA=3001]="APP_METADATA",o[o.UNDEFINED=9999]="UNDEFINED";var Wh,Vh="appmetadata",Jh="authority-metadata",Qh=86400;(w=Wh=Wh||{}).CONFIG="config",w.CACHE="cache",w.NETWORK="network",w.HARDCODED_VALUES="hardcoded_values";var Xh,$h={SCHEMA_VERSION:5,MAX_CUR_HEADER_BYTES:80,MAX_LAST_HEADER_BYTES:330,MAX_CACHED_ERRORS:50,CACHE_KEY:"server-telemetry",CATEGORY_SEPARATOR:"|",VALUE_SEPARATOR:",",OVERFLOW_TRUE:"1",OVERFLOW_FALSE:"0",UNKNOWN_ERROR:"unknown_error"};(o=Xh=Xh||{}).BEARER="Bearer",o.POP="pop",o.SSH="ssh-cert";var ep,tp,rp,op,np,ip,sp=60,ap=3600,cp="throttling",up="retry-after, h429",lp="invalid_grant",hp="client_mismatch";(w=ep=ep||{}).username="username",w.password="password",(o=tp=tp||{})[o.httpSuccess=200]="httpSuccess",o[o.httpBadRequest=400]="httpBadRequest",(w=rp=rp||{}).FAILED_AUTO_DETECTION="1",w.INTERNAL_CACHE="2",w.ENVIRONMENT_VARIABLE="3",w.IMDS="4",(o=op=op||{}).CONFIGURED_MATCHES_DETECTED="1",o.CONFIGURED_NO_AUTO_DETECTION="2",o.CONFIGURED_NOT_DETECTED="3",o.AUTO_DETECTION_REQUESTED_SUCCESSFUL="4",o.AUTO_DETECTION_REQUESTED_FAILED="5",(w=np=np||{}).NO_CACHE_HIT="0",w.FORCE_REFRESH="1",w.NO_CACHED_ACCESS_TOKEN="2",w.CACHED_ACCESS_TOKEN_EXPIRED="3",w.REFRESH_CACHED_ACCESS_TOKEN="4",(o=ip=ip||{}).Jwt="JWT",o.Jwk="JWK";var pp,dp={code:"unexpected_error",desc:"Unexpected error in authentication."},fp={code:"post_request_failed",desc:"Post request failed from the network, could be a 4xx/5xx or a network unavailability. Please check the exact error code for details."},gp=(Th(yp,pp=Error),yp.prototype.setCorrelationId=function(e){this.correlationId=e},yp.createUnexpectedError=function(e){return new yp(dp.code,dp.desc+": "+e)},yp.createPostRequestFailed=function(e){return new yp(fp.code,fp.desc+": "+e)},yp);function yp(e,t,r){var o=this,o=pp.call(this,t?e+": "+t:e)||this;return Object.setPrototypeOf(o,yp.prototype),o.errorCode=e||Lh.EMPTY_STRING,o.errorMessage=t||Lh.EMPTY_STRING,o.subError=r||Lh.EMPTY_STRING,o.name="AuthError",o}var mp,vp={createNewGuid:function(){throw gp.createUnexpectedError("Crypto interface - createNewGuid() has not been implemented")},base64Decode:function(){throw gp.createUnexpectedError("Crypto interface - base64Decode() has not been implemented")},base64Encode:function(){throw gp.createUnexpectedError("Crypto interface - base64Encode() has not been implemented")},generatePkceCodes:function(){return Ah(this,void 0,void 0,function(){return kh(this,function(e){throw gp.createUnexpectedError("Crypto interface - generatePkceCodes() has not been implemented")})})},getPublicKeyThumbprint:function(){return Ah(this,void 0,void 0,function(){return kh(this,function(e){throw gp.createUnexpectedError("Crypto interface - getPublicKeyThumbprint() has not been implemented")})})},removeTokenBindingKey:function(){return Ah(this,void 0,void 0,function(){return kh(this,function(e){throw gp.createUnexpectedError("Crypto interface - removeTokenBindingKey() has not been implemented")})})},clearKeystore:function(){return Ah(this,void 0,void 0,function(){return kh(this,function(e){throw gp.createUnexpectedError("Crypto interface - clearKeystore() has not been implemented")})})},signJwt:function(){return Ah(this,void 0,void 0,function(){return kh(this,function(e){throw gp.createUnexpectedError("Crypto interface - signJwt() has not been implemented")})})},hashString:function(){return Ah(this,void 0,void 0,function(){return kh(this,function(e){throw gp.createUnexpectedError("Crypto interface - hashString() has not been implemented")})})}},_p={code:"client_info_decoding_error",desc:"The client info could not be parsed/decoded correctly. Please review the trace to determine the root cause."},wp={code:"client_info_empty_error",desc:"The client info was empty. Please review the trace to determine the root cause."},bp={code:"token_parsing_error",desc:"Token cannot be parsed. Please review stack trace to determine root cause."},Cp={code:"null_or_empty_token",desc:"The token is null or empty. Please review the trace to determine the root cause."},Ep={code:"endpoints_resolution_error",desc:"Error: could not resolve endpoints. Please check network and try again."},Sp={code:"network_error",desc:"Network request failed. Please check network trace to determine root cause."},Tp={code:"openid_config_error",desc:"Could not retrieve endpoints. Check your authority and verify the .well-known/openid-configuration endpoint returns the required endpoints."},Ip={code:"hash_not_deserialized",desc:"The hash parameters could not be deserialized. Please review the trace to determine the root cause."},Ap={code:"invalid_state",desc:"State was not the expected format. Please check the logs to determine whether the request was sent using ProtocolUtils.setRequestState()."},kp={code:"state_mismatch",desc:"State mismatch error. Please check your network. Continued requests may cause cache overflow."},Pp={code:"state_not_found",desc:"State not found"},Op={code:"nonce_mismatch",desc:"Nonce mismatch error. This may be caused by a race condition in concurrent requests."},Rp={code:"nonce_not_found",desc:"nonce not found"},xp={code:"auth_time_not_found",desc:"Max Age was requested and the ID token is missing the auth_time variable. auth_time is an optional claim and is not enabled by default - it must be enabled. See https://aka.ms/msaljs/optional-claims for more information."},Mp={code:"max_age_transpired",desc:"Max Age is set to 0, or too much time has elapsed since the last end-user authentication."},Np={code:"multiple_matching_tokens",desc:"The cache contains multiple tokens satisfying the requirements. Call AcquireToken again providing more requirements such as authority or account."},Lp={code:"multiple_matching_accounts",desc:"The cache contains multiple accounts satisfying the given parameters. Please pass more info to obtain the correct account"},Dp={code:"multiple_matching_appMetadata",desc:"The cache contains multiple appMetadata satisfying the given parameters. Please pass more info to obtain the correct appMetadata"},qp={code:"request_cannot_be_made",desc:"Token request cannot be made without authorization code or refresh token."},Up={code:"cannot_append_empty_scope",desc:"Cannot append null or empty scope to ScopeSet. Please check the stack trace for more info."},jp={code:"cannot_remove_empty_scope",desc:"Cannot remove null or empty scope from ScopeSet. Please check the stack trace for more info."},Hp={code:"cannot_append_scopeset",desc:"Cannot append ScopeSet due to error."},Bp={code:"empty_input_scopeset",desc:"Empty input ScopeSet cannot be processed."},zp={code:"device_code_polling_cancelled",desc:"Caller has cancelled token endpoint polling during device code flow by setting DeviceCodeRequest.cancel = true."},Fp={code:"device_code_expired",desc:"Device code is expired."},Kp={code:"device_code_unknown_error",desc:"Device code stopped polling for unknown reasons."},Gp={code:"no_account_in_silent_request",desc:"Please pass an account object, silent flow is not supported without account information"},Yp={code:"invalid_cache_record",desc:"Cache record object was null or undefined."},Zp={code:"invalid_cache_environment",desc:"Invalid environment when attempting to create cache entry"},Wp={code:"no_account_found",desc:"No account found in cache for given key."},Vp={code:"no cache plugin set on CacheManager",desc:"ICachePlugin needs to be set before using readFromStorage or writeFromStorage"},Jp={code:"no_crypto_object",desc:"No crypto object detected. This is required for the following operation: "},Qp={code:"invalid_cache_type",desc:"Invalid cache type"},Xp={code:"unexpected_account_type",desc:"Unexpected account type."},$p={code:"unexpected_credential_type",desc:"Unexpected credential type."},ed={code:"invalid_assertion",desc:"Client assertion must meet requirements described in https://tools.ietf.org/html/rfc7515"},td={code:"invalid_client_credential",desc:"Client credential (secret, certificate, or assertion) must not be empty when creating a confidential client. An application should at most have one credential"},rd={code:"token_refresh_required",desc:"Cannot return token from cache because it must be refreshed. This may be due to one of the following reasons: forceRefresh parameter is set to true, claims have been requested, there is no cached access token or it is expired."},od={code:"user_timeout_reached",desc:"User defined timeout for device code polling reached"},nd={code:"token_claims_cnf_required_for_signedjwt",desc:"Cannot generate a POP jwt if the token_claims are not populated"},id={code:"authorization_code_missing_from_server_response",desc:"Server response does not contain an authorization code to proceed"},sd={code:"binding_key_not_removed",desc:"Could not remove the credential's binding key from storage."},ad={code:"end_session_endpoint_not_supported",desc:"Provided authority does not support logout."},cd={code:"key_id_missing",desc:"A keyId value is missing from the requested bound token's cache record and is required to match the token to it's stored binding key."},ud=(Th(ld,mp=gp),ld.createClientInfoDecodingError=function(e){return new ld(_p.code,_p.desc+" Failed with error: "+e)},ld.createClientInfoEmptyError=function(){return new ld(wp.code,""+wp.desc)},ld.createTokenParsingError=function(e){return new ld(bp.code,bp.desc+" Failed with error: "+e)},ld.createTokenNullOrEmptyError=function(e){return new ld(Cp.code,Cp.desc+" Raw Token Value: "+e)},ld.createEndpointDiscoveryIncompleteError=function(e){return new ld(Ep.code,Ep.desc+" Detail: "+e)},ld.createNetworkError=function(e,t){return new ld(Sp.code,Sp.desc+" | Fetch client threw: "+t+" | Attempted to reach: "+e.split("?")[0])},ld.createUnableToGetOpenidConfigError=function(e){return new ld(Tp.code,Tp.desc+" Attempted to retrieve endpoints from: "+e)},ld.createHashNotDeserializedError=function(e){return new ld(Ip.code,Ip.desc+" Given Object: "+e)},ld.createInvalidStateError=function(e,t){return new ld(Ap.code,Ap.desc+" Invalid State: "+e+", Root Err: "+t)},ld.createStateMismatchError=function(){return new ld(kp.code,kp.desc)},ld.createStateNotFoundError=function(e){return new ld(Pp.code,Pp.desc+": "+e)},ld.createNonceMismatchError=function(){return new ld(Op.code,Op.desc)},ld.createAuthTimeNotFoundError=function(){return new ld(xp.code,xp.desc)},ld.createMaxAgeTranspiredError=function(){return new ld(Mp.code,Mp.desc)},ld.createNonceNotFoundError=function(e){return new ld(Rp.code,Rp.desc+": "+e)},ld.createMultipleMatchingTokensInCacheError=function(){return new ld(Np.code,Np.desc+".")},ld.createMultipleMatchingAccountsInCacheError=function(){return new ld(Lp.code,Lp.desc)},ld.createMultipleMatchingAppMetadataInCacheError=function(){return new ld(Dp.code,Dp.desc)},ld.createTokenRequestCannotBeMadeError=function(){return new ld(qp.code,qp.desc)},ld.createAppendEmptyScopeToSetError=function(e){return new ld(Up.code,Up.desc+" Given Scope: "+e)},ld.createRemoveEmptyScopeFromSetError=function(e){return new ld(jp.code,jp.desc+" Given Scope: "+e)},ld.createAppendScopeSetError=function(e){return new ld(Hp.code,Hp.desc+" Detail Error: "+e)},ld.createEmptyInputScopeSetError=function(){return new ld(Bp.code,""+Bp.desc)},ld.createDeviceCodeCancelledError=function(){return new ld(zp.code,""+zp.desc)},ld.createDeviceCodeExpiredError=function(){return new ld(Fp.code,""+Fp.desc)},ld.createDeviceCodeUnknownError=function(){return new ld(Kp.code,""+Kp.desc)},ld.createNoAccountInSilentRequestError=function(){return new ld(Gp.code,""+Gp.desc)},ld.createNullOrUndefinedCacheRecord=function(){return new ld(Yp.code,Yp.desc)},ld.createInvalidCacheEnvironmentError=function(){return new ld(Zp.code,Zp.desc)},ld.createNoAccountFoundError=function(){return new ld(Wp.code,Wp.desc)},ld.createCachePluginError=function(){return new ld(Vp.code,""+Vp.desc)},ld.createNoCryptoObjectError=function(e){return new ld(Jp.code,""+Jp.desc+e)},ld.createInvalidCacheTypeError=function(){return new ld(Qp.code,""+Qp.desc)},ld.createUnexpectedAccountTypeError=function(){return new ld(Xp.code,""+Xp.desc)},ld.createUnexpectedCredentialTypeError=function(){return new ld($p.code,""+$p.desc)},ld.createInvalidAssertionError=function(){return new ld(ed.code,""+ed.desc)},ld.createInvalidCredentialError=function(){return new ld(td.code,""+td.desc)},ld.createRefreshRequiredError=function(){return new ld(rd.code,rd.desc)},ld.createUserTimeoutReachedError=function(){return new ld(od.code,od.desc)},ld.createTokenClaimsRequiredError=function(){return new ld(nd.code,nd.desc)},ld.createNoAuthCodeInServerResponseError=function(){return new ld(id.code,id.desc)},ld.createBindingKeyNotRemovedError=function(){return new ld(sd.code,sd.desc)},ld.createLogoutNotSupportedError=function(){return new ld(ad.code,ad.desc)},ld.createKeyIdMissingError=function(){return new ld(cd.code,cd.desc)},ld);function ld(e,t){t=mp.call(this,e,t)||this;return t.name="ClientAuthError",Object.setPrototypeOf(t,ld.prototype),t}var hd,pd=(dd.decodeAuthToken=function(e){if(dd.isEmpty(e))throw ud.createTokenNullOrEmptyError(e);var t=/^([^\.\s]*)\.([^\.\s]+)\.([^\.\s]*)$/.exec(e);if(!t||t.length<4)throw ud.createTokenParsingError("Given token is malformed: "+JSON.stringify(e));return{header:t[1],JWSPayload:t[2],JWSSig:t[3]}},dd.isEmpty=function(e){return void 0===e||!e||0===e.length},dd.isEmptyObj=function(e){if(e&&!dd.isEmpty(e))try{var t=JSON.parse(e);return 0===Object.keys(t).length}catch(e){}return!0},dd.startsWith=function(e,t){return 0===e.indexOf(t)},dd.endsWith=function(e,t){return e.length>=t.length&&e.lastIndexOf(t)===e.length-t.length},dd.queryStringToObject=function(e){function r(e){return decodeURIComponent(e.replace(/\+/g," "))}var o={},e=e.split("&");return e.forEach(function(e){var t;e.trim()&&(e=(t=e.split(/=(.+)/g,2))[0],t=t[1],e&&t&&(o[r(e)]=r(t)))}),o},dd.trimArrayEntries=function(e){return e.map(function(e){return e.trim()})},dd.removeEmptyStringsFromArray=function(e){return e.filter(function(e){return!dd.isEmpty(e)})},dd.jsonParseHelper=function(e){try{return JSON.parse(e)}catch(e){return null}},dd.matchPattern=function(e,t){return new RegExp(e.replace(/\\/g,"\\\\").replace(/\*/g,"[^ ]*").replace(/\?/g,"\\?")).test(t)},dd);function dd(){}(w=hd=hd||{})[w.Error=0]="Error",w[w.Warning=1]="Warning",w[w.Info=2]="Info",w[w.Verbose=3]="Verbose",w[w.Trace=4]="Trace";var fd=(gd.prototype.clone=function(e,t,r){return new gd({loggerCallback:this.localCallback,piiLoggingEnabled:this.piiLoggingEnabled,logLevel:this.level,correlationId:r||this.correlationId},e,t)},gd.prototype.logMessage=function(e,t){var r;t.logLevel>this.level||!this.piiLoggingEnabled&&t.containsPii||(r=(new Date).toUTCString(),e=(pd.isEmpty(t.correlationId)?pd.isEmpty(this.correlationId)?"["+r+"]":"["+r+"] : ["+this.correlationId+"]":"["+r+"] : ["+t.correlationId+"]")+" : "+this.packageName+"@"+this.packageVersion+" : "+hd[t.logLevel]+" - "+e,this.executeCallback(t.logLevel,e,t.containsPii||!1))},gd.prototype.executeCallback=function(e,t,r){this.localCallback&&this.localCallback(e,t,r)},gd.prototype.error=function(e,t){this.logMessage(e,{logLevel:hd.Error,containsPii:!1,correlationId:t||Lh.EMPTY_STRING})},gd.prototype.errorPii=function(e,t){this.logMessage(e,{logLevel:hd.Error,containsPii:!0,correlationId:t||Lh.EMPTY_STRING})},gd.prototype.warning=function(e,t){this.logMessage(e,{logLevel:hd.Warning,containsPii:!1,correlationId:t||Lh.EMPTY_STRING})},gd.prototype.warningPii=function(e,t){this.logMessage(e,{logLevel:hd.Warning,containsPii:!0,correlationId:t||Lh.EMPTY_STRING})},gd.prototype.info=function(e,t){this.logMessage(e,{logLevel:hd.Info,containsPii:!1,correlationId:t||Lh.EMPTY_STRING})},gd.prototype.infoPii=function(e,t){this.logMessage(e,{logLevel:hd.Info,containsPii:!0,correlationId:t||Lh.EMPTY_STRING})},gd.prototype.verbose=function(e,t){this.logMessage(e,{logLevel:hd.Verbose,containsPii:!1,correlationId:t||Lh.EMPTY_STRING})},gd.prototype.verbosePii=function(e,t){this.logMessage(e,{logLevel:hd.Verbose,containsPii:!0,correlationId:t||Lh.EMPTY_STRING})},gd.prototype.trace=function(e,t){this.logMessage(e,{logLevel:hd.Trace,containsPii:!1,correlationId:t||Lh.EMPTY_STRING})},gd.prototype.tracePii=function(e,t){this.logMessage(e,{logLevel:hd.Trace,containsPii:!0,correlationId:t||Lh.EMPTY_STRING})},gd.prototype.isPiiLoggingEnabled=function(){return this.piiLoggingEnabled||!1},gd);function gd(e,t,r){this.level=hd.Info;this.localCallback=e.loggerCallback||function(){},this.piiLoggingEnabled=e.piiLoggingEnabled||!1,this.level="number"==typeof e.logLevel?e.logLevel:hd.Info,this.correlationId=e.correlationId||Lh.EMPTY_STRING,this.packageName=t||Lh.EMPTY_STRING,this.packageVersion=r||Lh.EMPTY_STRING}var yd;(o=yd=yd||{})[o.None=0]="None",o.AzurePublic="https://login.microsoftonline.com",o.AzurePpe="https://login.windows-ppe.net",o.AzureChina="https://login.chinacloudapi.cn",o.AzureGermany="https://login.microsoftonline.de",o.AzureUsGovernment="https://login.microsoftonline.us";var md=(vd.prototype.generateAccountId=function(){return vd.generateAccountIdForCacheKey(this.homeAccountId,this.environment)},vd.prototype.generateCredentialId=function(){return vd.generateCredentialIdForCacheKey(this.credentialType,this.clientId,this.realm,this.familyId)},vd.prototype.generateTarget=function(){return vd.generateTargetForCacheKey(this.target)},vd.prototype.generateCredentialKey=function(){return vd.generateCredentialCacheKey(this.homeAccountId,this.environment,this.credentialType,this.clientId,this.realm,this.target,this.familyId,this.tokenType,this.requestedClaimsHash)},vd.prototype.generateType=function(){switch(this.credentialType){case Kh.ID_TOKEN:return Yh.ID_TOKEN;case Kh.ACCESS_TOKEN:case Kh.ACCESS_TOKEN_WITH_AUTH_SCHEME:return Yh.ACCESS_TOKEN;case Kh.REFRESH_TOKEN:return Yh.REFRESH_TOKEN;default:throw ud.createUnexpectedCredentialTypeError()}},vd.getCredentialType=function(e){return-1!==e.indexOf(Kh.ACCESS_TOKEN.toLowerCase())?-1!==e.indexOf(Kh.ACCESS_TOKEN_WITH_AUTH_SCHEME.toLowerCase())?Kh.ACCESS_TOKEN_WITH_AUTH_SCHEME:Kh.ACCESS_TOKEN:-1!==e.indexOf(Kh.ID_TOKEN.toLowerCase())?Kh.ID_TOKEN:-1!==e.indexOf(Kh.REFRESH_TOKEN.toLowerCase())?Kh.REFRESH_TOKEN:Lh.NOT_DEFINED},vd.generateCredentialCacheKey=function(e,t,r,o,n,i,s,a,c){return[this.generateAccountIdForCacheKey(e,t),this.generateCredentialIdForCacheKey(r,o,n,s),this.generateTargetForCacheKey(i),this.generateClaimsHashForCacheKey(c),this.generateSchemeForCacheKey(a)].join(Fh.CACHE_KEY_SEPARATOR).toLowerCase()},vd.generateAccountIdForCacheKey=function(e,t){return[e,t].join(Fh.CACHE_KEY_SEPARATOR).toLowerCase()},vd.generateCredentialIdForCacheKey=function(e,t,r,o){return[e,e===Kh.REFRESH_TOKEN&&o||t,r||Lh.EMPTY_STRING].join(Fh.CACHE_KEY_SEPARATOR).toLowerCase()},vd.generateTargetForCacheKey=function(e){return(e||Lh.EMPTY_STRING).toLowerCase()},vd.generateClaimsHashForCacheKey=function(e){return(e||Lh.EMPTY_STRING).toLowerCase()},vd.generateSchemeForCacheKey=function(e){return e&&e.toLowerCase()!==Xh.BEARER.toLowerCase()?e.toLowerCase():Lh.EMPTY_STRING},vd);function vd(){}var _d,wd={code:"redirect_uri_empty",desc:"A redirect URI is required for all calls, and none has been set."},bd={code:"post_logout_uri_empty",desc:"A post logout redirect has not been set."},Cd={code:"claims_request_parsing_error",desc:"Could not parse the given claims request object."},Ed={code:"authority_uri_insecure",desc:"Authority URIs must use https. Please see here for valid authority configuration options: https://docs.microsoft.com/en-us/azure/active-directory/develop/msal-js-initializing-client-applications#configuration-options"},Sd={code:"url_parse_error",desc:"URL could not be parsed into appropriate segments."},Td={code:"empty_url_error",desc:"URL was empty or null."},Id={code:"empty_input_scopes_error",desc:"Scopes cannot be passed as null, undefined or empty array because they are required to obtain an access token."},Ad={code:"clientid_input_scopes_error",desc:"Client ID can only be provided as a single scope."},kd={code:"invalid_prompt_value",desc:"Supported prompt values are 'login', 'select_account', 'consent', 'create', 'none' and 'no_session'. Please see here for valid configuration options: https://azuread.github.io/microsoft-authentication-library-for-js/ref/modules/_azure_msal_common.html#commonauthorizationurlrequest"},Pd={code:"invalid_claims",desc:"Given claims parameter must be a stringified JSON object."},Od={code:"token_request_empty",desc:"Token request was empty and not found in cache."},Rd={code:"logout_request_empty",desc:"The logout request was null or undefined."},xd={code:"invalid_code_challenge_method",desc:'code_challenge_method passed is invalid. Valid values are "plain" and "S256".'},Md={code:"pkce_params_missing",desc:"Both params: code_challenge and code_challenge_method are to be passed if to be sent in the request"},Nd={code:"invalid_cloud_discovery_metadata",desc:"Invalid cloudDiscoveryMetadata provided. Must be a stringified JSON object containing tenant_discovery_endpoint and metadata fields"},Ld={code:"invalid_authority_metadata",desc:"Invalid authorityMetadata provided. Must by a stringified JSON object containing authorization_endpoint, token_endpoint, issuer fields."},Dd={code:"untrusted_authority",desc:"The provided authority is not a trusted authority. Please include this authority in the knownAuthorities config parameter."},qd={code:"invalid_azure_cloud_instance",desc:"Invalid AzureCloudInstance provided. Please refer MSAL JS docs: aks.ms/msaljs/azure_cloud_instance for valid values"},Ud={code:"missing_ssh_jwk",desc:"Missing sshJwk in SSH certificate request. A stringified JSON Web Key is required when using the SSH authentication scheme."},jd={code:"missing_ssh_kid",desc:"Missing sshKid in SSH certificate request. A string that uniquely identifies the public SSH key is required when using the SSH authentication scheme."},Hd={code:"missing_nonce_authentication_header",desc:"Unable to find an authentication header containing server nonce. Either the Authentication-Info or WWW-Authenticate headers must be present in order to obtain a server nonce."},Bd={code:"invalid_authentication_header",desc:"Invalid authentication header provided"},zd=(Th(Fd,_d=ud),Fd.createRedirectUriEmptyError=function(){return new Fd(wd.code,wd.desc)},Fd.createPostLogoutRedirectUriEmptyError=function(){return new Fd(bd.code,bd.desc)},Fd.createClaimsRequestParsingError=function(e){return new Fd(Cd.code,Cd.desc+" Given value: "+e)},Fd.createInsecureAuthorityUriError=function(e){return new Fd(Ed.code,Ed.desc+" Given URI: "+e)},Fd.createUrlParseError=function(e){return new Fd(Sd.code,Sd.desc+" Given Error: "+e)},Fd.createUrlEmptyError=function(){return new Fd(Td.code,Td.desc)},Fd.createEmptyScopesArrayError=function(){return new Fd(Id.code,""+Id.desc)},Fd.createClientIdSingleScopeError=function(e){return new Fd(Ad.code,Ad.desc+" Given Scopes: "+e)},Fd.createInvalidPromptError=function(e){return new Fd(kd.code,kd.desc+" Given value: "+e)},Fd.createInvalidClaimsRequestError=function(){return new Fd(Pd.code,Pd.desc)},Fd.createEmptyLogoutRequestError=function(){return new Fd(Rd.code,Rd.desc)},Fd.createEmptyTokenRequestError=function(){return new Fd(Od.code,Od.desc)},Fd.createInvalidCodeChallengeMethodError=function(){return new Fd(xd.code,xd.desc)},Fd.createInvalidCodeChallengeParamsError=function(){return new Fd(Md.code,Md.desc)},Fd.createInvalidCloudDiscoveryMetadataError=function(){return new Fd(Nd.code,Nd.desc)},Fd.createInvalidAuthorityMetadataError=function(){return new Fd(Ld.code,Ld.desc)},Fd.createUntrustedAuthorityError=function(){return new Fd(Dd.code,Dd.desc)},Fd.createInvalidAzureCloudInstanceError=function(){return new Fd(qd.code,qd.desc)},Fd.createMissingSshJwkError=function(){return new Fd(Ud.code,Ud.desc)},Fd.createMissingSshKidError=function(){return new Fd(jd.code,jd.desc)},Fd.createMissingNonceAuthenticationHeadersError=function(){return new Fd(Hd.code,Hd.desc)},Fd.createInvalidAuthenticationHeaderError=function(e,t){return new Fd(Bd.code,Bd.desc+". Invalid header: "+e+". Details: "+t)},Fd);function Fd(e,t){t=_d.call(this,e,t)||this;return t.name="ClientConfigurationError",Object.setPrototypeOf(t,Fd.prototype),t}var Kd,Gd=(Yd.fromString=function(e){return new Yd((e||Lh.EMPTY_STRING).split(" "))},Yd.prototype.validateInputScopes=function(e){if(!e||e.length<1)throw zd.createEmptyScopesArrayError()},Yd.prototype.containsScope=function(e){var t=new Yd(this.printScopesLowerCase().split(" "));return!pd.isEmpty(e)&&t.scopes.has(e.toLowerCase())},Yd.prototype.containsScopeSet=function(e){var t=this;return!(!e||e.scopes.size<=0)&&(this.scopes.size>=e.scopes.size&&e.asArray().every(function(e){return t.containsScope(e)}))},Yd.prototype.containsOnlyOIDCScopes=function(){var t=this,r=0;return qh.forEach(function(e){t.containsScope(e)&&(r+=1)}),this.scopes.size===r},Yd.prototype.appendScope=function(e){pd.isEmpty(e)||this.scopes.add(e.trim())},Yd.prototype.appendScopes=function(e){var t=this;try{e.forEach(function(e){return t.appendScope(e)})}catch(e){throw ud.createAppendScopeSetError(e)}},Yd.prototype.removeScope=function(e){if(pd.isEmpty(e))throw ud.createRemoveEmptyScopeFromSetError(e);this.scopes.delete(e.trim())},Yd.prototype.removeOIDCScopes=function(){var t=this;qh.forEach(function(e){t.scopes.delete(e)})},Yd.prototype.unionScopeSets=function(e){if(!e)throw ud.createEmptyInputScopeSetError();var t=new Set;return e.scopes.forEach(function(e){return t.add(e.toLowerCase())}),this.scopes.forEach(function(e){return t.add(e.toLowerCase())}),t},Yd.prototype.intersectingScopeSets=function(e){if(!e)throw ud.createEmptyInputScopeSetError();e.containsOnlyOIDCScopes()||e.removeOIDCScopes();var t=this.unionScopeSets(e),r=e.getScopeCount(),e=this.getScopeCount();return t.size<e+r},Yd.prototype.getScopeCount=function(){return this.scopes.size},Yd.prototype.asArray=function(){var t=[];return this.scopes.forEach(function(e){return t.push(e)}),t},Yd.prototype.printScopes=function(){return this.scopes?this.asArray().join(" "):Lh.EMPTY_STRING},Yd.prototype.printScopesLowerCase=function(){return this.printScopes().toLowerCase()},Yd);function Yd(e){var t=this,e=e?pd.trimArrayEntries(Ph(e)):[],e=e?pd.removeEmptyStringsFromArray(e):[];this.validateInputScopes(e),this.scopes=new Set,e.forEach(function(e){return t.scopes.add(e)})}function Zd(e,t){if(pd.isEmpty(e))throw ud.createClientInfoEmptyError();try{var r=t.base64Decode(e);return JSON.parse(r)}catch(e){throw ud.createClientInfoDecodingError(e.message)}}function Wd(e){if(pd.isEmpty(e))throw ud.createClientInfoDecodingError("Home account ID was empty.");e=e.split(Fh.CLIENT_INFO_SEPARATOR,2);return{uid:e[0],utid:e.length<2?Lh.EMPTY_STRING:e[1]}}(w=Kd=Kd||{})[w.Default=0]="Default",w[w.Adfs=1]="Adfs",w[w.Dsts=2]="Dsts";var Vd=(Jd.prototype.generateAccountId=function(){return[this.homeAccountId,this.environment].join(Fh.CACHE_KEY_SEPARATOR).toLowerCase()},Jd.prototype.generateAccountKey=function(){return Jd.generateAccountCacheKey({homeAccountId:this.homeAccountId,environment:this.environment,tenantId:this.realm,username:this.username,localAccountId:this.localAccountId})},Jd.prototype.generateType=function(){switch(this.authorityType){case zh.ADFS_ACCOUNT_TYPE:return Yh.ADFS;case zh.MSAV1_ACCOUNT_TYPE:return Yh.MSA;case zh.MSSTS_ACCOUNT_TYPE:return Yh.MSSTS;case zh.GENERIC_ACCOUNT_TYPE:return Yh.GENERIC;default:throw ud.createUnexpectedAccountTypeError()}},Jd.prototype.getAccountInfo=function(){return{homeAccountId:this.homeAccountId,environment:this.environment,tenantId:this.realm,username:this.username,localAccountId:this.localAccountId,name:this.name,idTokenClaims:this.idTokenClaims,nativeAccountId:this.nativeAccountId}},Jd.generateAccountCacheKey=function(e){return[e.homeAccountId,e.environment||Lh.EMPTY_STRING,e.tenantId||Lh.EMPTY_STRING].join(Fh.CACHE_KEY_SEPARATOR).toLowerCase()},Jd.createAccount=function(e,t,r,o,n,i,s,a){var c=new Jd;c.authorityType=zh.MSSTS_ACCOUNT_TYPE,c.clientInfo=e,c.homeAccountId=t,c.nativeAccountId=a;var u,o=s||o&&o.getPreferredCache();if(!o)throw ud.createInvalidCacheEnvironmentError();return c.environment=o,c.realm=(null===(o=null==r?void 0:r.claims)||void 0===o?void 0:o.tid)||Lh.EMPTY_STRING,r&&(c.idTokenClaims=r.claims,c.localAccountId=(null===(o=null==r?void 0:r.claims)||void 0===o?void 0:o.oid)||(null===(u=null==r?void 0:r.claims)||void 0===u?void 0:u.sub)||Lh.EMPTY_STRING,u=null===(o=null==r?void 0:r.claims)||void 0===o?void 0:o.preferred_username,o=null!==(o=null==r?void 0:r.claims)&&void 0!==o&&o.emails?r.claims.emails[0]:null,c.username=u||o||Lh.EMPTY_STRING,c.name=null===(r=null==r?void 0:r.claims)||void 0===r?void 0:r.name),c.cloudGraphHostName=n,c.msGraphHost=i,c},Jd.createGenericAccount=function(e,t,r,o,n,i){var s,a=new Jd;a.authorityType=r&&r.authorityType===Kd.Adfs?zh.ADFS_ACCOUNT_TYPE:zh.GENERIC_ACCOUNT_TYPE,a.homeAccountId=e,a.realm=Lh.EMPTY_STRING;i=i||r&&r.getPreferredCache();if(!i)throw ud.createInvalidCacheEnvironmentError();return t&&(a.localAccountId=(null===(r=null==t?void 0:t.claims)||void 0===r?void 0:r.oid)||(null===(s=null==t?void 0:t.claims)||void 0===s?void 0:s.sub)||Lh.EMPTY_STRING,a.username=(null===(s=null==t?void 0:t.claims)||void 0===s?void 0:s.upn)||Lh.EMPTY_STRING,a.name=(null===(s=null==t?void 0:t.claims)||void 0===s?void 0:s.name)||Lh.EMPTY_STRING,a.idTokenClaims=null==t?void 0:t.claims),a.environment=i,a.cloudGraphHostName=o,a.msGraphHost=n,a},Jd.generateHomeAccountId=function(e,t,r,o,n){var i,n=null!==(i=null==n?void 0:n.claims)&&void 0!==i&&i.sub?n.claims.sub:Lh.EMPTY_STRING;if(t===Kd.Adfs||t===Kd.Dsts)return n;if(e)try{var s=Zd(e,o);if(!pd.isEmpty(s.uid)&&!pd.isEmpty(s.utid))return""+s.uid+Fh.CLIENT_INFO_SEPARATOR+s.utid}catch(e){}return r.verbose("No client info in response"),n},Jd.isAccountEntity=function(e){return!!e&&(e.hasOwnProperty("homeAccountId")&&e.hasOwnProperty("environment")&&e.hasOwnProperty("realm")&&e.hasOwnProperty("localAccountId")&&e.hasOwnProperty("username")&&e.hasOwnProperty("authorityType"))},Jd.accountInfoIsEqual=function(e,t,r){if(!e||!t)return!1;var o,n=!0;return r&&(o=e.idTokenClaims||{},r=t.idTokenClaims||{},n=o.iat===r.iat&&o.nonce===r.nonce),e.homeAccountId===t.homeAccountId&&e.localAccountId===t.localAccountId&&e.username===t.username&&e.tenantId===t.tenantId&&e.environment===t.environment&&e.nativeAccountId===t.nativeAccountId&&n},Jd);function Jd(){}var Qd=(Xd.extractTokenClaims=function(e,t){e=pd.decodeAuthToken(e);try{var r=e.JWSPayload,o=t.base64Decode(r);return JSON.parse(o)}catch(e){throw ud.createTokenParsingError(e)}},Xd.checkMaxAge=function(e,t){if(0===t||Date.now()-3e5>e+t)throw ud.createMaxAgeTranspiredError()},Xd);function Xd(e,t){if(pd.isEmpty(e))throw ud.createTokenNullOrEmptyError(e);this.rawToken=e,this.claims=Xd.extractTokenClaims(e,t)}var $d=(ef.prototype.getAllAccounts=function(){var r=this,t=this.getAccountsFilteredBy(),e=Object.keys(t).map(function(e){return t[e]});return e.length<1?[]:e.map(function(e){var t=ef.toObject(new Vd,e).getAccountInfo(),e=r.readIdTokenFromCache(r.clientId,t);return e&&!t.idTokenClaims&&(t.idToken=e.secret,t.idTokenClaims=new Qd(e.secret,r.cryptoImpl).claims),t})},ef.prototype.saveCacheRecord=function(t){return Ah(this,void 0,void 0,function(){return kh(this,function(e){switch(e.label){case 0:if(!t)throw ud.createNullOrUndefinedCacheRecord();return t.account&&this.setAccount(t.account),t.idToken&&this.setIdTokenCredential(t.idToken),t.accessToken?[4,this.saveAccessToken(t.accessToken)]:[3,2];case 1:e.sent(),e.label=2;case 2:return t.refreshToken&&this.setRefreshTokenCredential(t.refreshToken),t.appMetadata&&this.setAppMetadata(t.appMetadata),[2]}})})},ef.prototype.saveAccessToken=function(s){return Ah(this,void 0,void 0,function(){var t,r,o,n,i=this;return kh(this,function(e){switch(e.label){case 0:return(t=this.getCredentialsFilteredBy({clientId:s.clientId,credentialType:s.credentialType,environment:s.environment,homeAccountId:s.homeAccountId,realm:s.realm,tokenType:s.tokenType,requestedClaimsHash:s.requestedClaimsHash}),r=Gd.fromString(s.target),o=Object.keys(t.accessTokens).map(function(e){return t.accessTokens[e]}))?(n=[],o.forEach(function(e){Gd.fromString(e.target).intersectingScopeSets(r)&&n.push(i.removeCredential(e))}),[4,Promise.all(n)]):[3,2];case 1:e.sent(),e.label=2;case 2:return this.setAccessTokenCredential(s),[2]}})})},ef.prototype.getAccountsFilteredBy=function(e){return this.getAccountsFilteredByInternal(e?e.homeAccountId:Lh.EMPTY_STRING,e?e.environment:Lh.EMPTY_STRING,e?e.realm:Lh.EMPTY_STRING,e?e.nativeAccountId:Lh.EMPTY_STRING)},ef.prototype.getAccountsFilteredByInternal=function(r,o,n,i){var s=this,e=this.getKeys(),a={};return e.forEach(function(e){var t=s.getAccount(e);t&&(r&&!s.matchHomeAccountId(t,r)||o&&!s.matchEnvironment(t,o)||n&&!s.matchRealm(t,n)||i&&!s.matchNativeAccountId(t,i)||(a[e]=t))}),a},ef.prototype.getCredentialsFilteredBy=function(e){return this.getCredentialsFilteredByInternal(e.homeAccountId,e.environment,e.credentialType,e.clientId,e.familyId,e.realm,e.target,e.userAssertionHash,e.tokenType,e.keyId,e.requestedClaimsHash)},ef.prototype.getCredentialsFilteredByInternal=function(n,i,s,a,c,u,l,h,p,d,f){var g=this,e=this.getKeys(),y={idTokens:{},accessTokens:{},refreshTokens:{}};return e.forEach(function(e){var t=md.getCredentialType(e);if(t!==Lh.NOT_DEFINED){var r=g.getSpecificCredential(e,t);if(r&&(!h||g.matchUserAssertionHash(r,h))&&("string"!=typeof n||g.matchHomeAccountId(r,n))&&(!i||g.matchEnvironment(r,i))&&(!u||g.matchRealm(r,u))&&(!s||g.matchCredentialType(r,s))&&(!a||g.matchClientId(r,a))&&(!c||g.matchFamilyId(r,c))&&(!l||g.matchTarget(r,l))&&(!f&&!r.requestedClaimsHash||r.requestedClaimsHash===f)){if(s===Kh.ACCESS_TOKEN_WITH_AUTH_SCHEME){if(p&&!g.matchTokenType(r,p))return;if(p===Xh.SSH&&d&&!g.matchKeyId(r,d))return}var o=g.updateCredentialCacheKey(e,r);switch(t){case Kh.ID_TOKEN:y.idTokens[o]=r;break;case Kh.ACCESS_TOKEN:case Kh.ACCESS_TOKEN_WITH_AUTH_SCHEME:y.accessTokens[o]=r;break;case Kh.REFRESH_TOKEN:y.refreshTokens[o]=r}}}}),y},ef.prototype.getAppMetadataFilteredBy=function(e){return this.getAppMetadataFilteredByInternal(e.environment,e.clientId)},ef.prototype.getAppMetadataFilteredByInternal=function(r,o){var n=this,e=this.getKeys(),i={};return e.forEach(function(e){var t;!n.isAppMetadata(e)||(t=n.getAppMetadata(e))&&(r&&!n.matchEnvironment(t,r)||o&&!n.matchClientId(t,o)||(i[e]=t))}),i},ef.prototype.getAuthorityMetadataByAlias=function(t){var r=this,e=this.getAuthorityMetadataKeys(),o=null;return e.forEach(function(e){!r.isAuthorityMetadata(e)||-1===e.indexOf(r.clientId)||(e=r.getAuthorityMetadata(e))&&-1!==e.aliases.indexOf(t)&&(o=e)}),o},ef.prototype.removeAllAccounts=function(){return Ah(this,void 0,void 0,function(){var t,r,o=this;return kh(this,function(e){switch(e.label){case 0:return t=this.getKeys(),r=[],t.forEach(function(e){o.getAccount(e)&&r.push(o.removeAccount(e))}),[4,Promise.all(r)];case 1:return e.sent(),[2,!0]}})})},ef.prototype.removeAccount=function(r){return Ah(this,void 0,void 0,function(){var t;return kh(this,function(e){switch(e.label){case 0:if(!(t=this.getAccount(r)))throw ud.createNoAccountFoundError();return[4,this.removeAccountContext(t)];case 1:return[2,e.sent()&&this.removeItem(r,Gh.ACCOUNT)]}})})},ef.prototype.removeAccountContext=function(i){return Ah(this,void 0,void 0,function(){var t,r,o,n=this;return kh(this,function(e){switch(e.label){case 0:return t=this.getKeys(),r=i.generateAccountId(),o=[],t.forEach(function(e){var t=md.getCredentialType(e);t===Lh.NOT_DEFINED||(t=n.getSpecificCredential(e,t))&&r===t.generateAccountId()&&o.push(n.removeCredential(t))}),[4,Promise.all(o)];case 1:return e.sent(),[2,!0]}})})},ef.prototype.removeCredential=function(o){return Ah(this,void 0,void 0,function(){var t,r;return kh(this,function(e){switch(e.label){case 0:if(t=o.generateCredentialKey(),o.credentialType.toLowerCase()!==Kh.ACCESS_TOKEN_WITH_AUTH_SCHEME.toLowerCase())return[3,4];if(o.tokenType!==Xh.POP)return[3,4];if(!(r=o.keyId))return[3,4];e.label=1;case 1:return e.trys.push([1,3,,4]),[4,this.cryptoImpl.removeTokenBindingKey(r)];case 2:return e.sent(),[3,4];case 3:throw e.sent(),ud.createBindingKeyNotRemovedError();case 4:return[2,this.removeItem(t,Gh.CREDENTIAL)]}})})},ef.prototype.removeAppMetadata=function(){var t=this;return this.getKeys().forEach(function(e){t.isAppMetadata(e)&&t.removeItem(e,Gh.APP_METADATA)}),!0},ef.prototype.readCacheRecord=function(e,t,r,o){var n=this.readAccountFromCache(e),i=this.readIdTokenFromCache(t,e),r=this.readAccessTokenFromCache(t,e,r),e=this.readRefreshTokenFromCache(t,e,!1),t=this.readAppMetadataFromCache(o,t);return n&&i&&(n.idTokenClaims=new Qd(i.secret,this.cryptoImpl).claims),{account:n,idToken:i,accessToken:r,refreshToken:e,appMetadata:t}},ef.prototype.readAccountFromCache=function(e){e=Vd.generateAccountCacheKey(e);return this.getAccount(e)},ef.prototype.readAccountFromCacheWithNativeAccountId=function(e){var t=this.getAccountsFilteredBy({nativeAccountId:e}),e=Object.keys(t).map(function(e){return t[e]});if(e.length<1)return null;if(1<e.length)throw ud.createMultipleMatchingAccountsInCacheError();return t[0]},ef.prototype.readIdTokenFromCache=function(e,t){var e={homeAccountId:t.homeAccountId,environment:t.environment,credentialType:Kh.ID_TOKEN,clientId:e,realm:t.tenantId},r=this.getCredentialsFilteredBy(e),t=Object.keys(r.idTokens).map(function(e){return r.idTokens[e]}),e=t.length;if(e<1)return null;if(1<e)throw ud.createMultipleMatchingTokensInCacheError();return t[0]},ef.prototype.readAccessTokenFromCache=function(e,t,r){var o=new Gd(r.scopes||[]),n=r.authenticationScheme||Xh.BEARER,i=n&&n.toLowerCase()!==Xh.BEARER.toLowerCase()?Kh.ACCESS_TOKEN_WITH_AUTH_SCHEME:Kh.ACCESS_TOKEN,n={homeAccountId:t.homeAccountId,environment:t.environment,credentialType:i,clientId:e,realm:t.tenantId,target:o.printScopesLowerCase(),tokenType:n,keyId:r.sshKid,requestedClaimsHash:r.requestedClaimsHash},s=this.getCredentialsFilteredBy(n),r=Object.keys(s.accessTokens).map(function(e){return s.accessTokens[e]}),n=r.length;if(n<1)return null;if(1<n)throw ud.createMultipleMatchingTokensInCacheError();return r[0]},ef.prototype.readRefreshTokenFromCache=function(e,t,r){var r={homeAccountId:t.homeAccountId,environment:t.environment,credentialType:Kh.REFRESH_TOKEN,clientId:e,familyId:r?"1":void 0},o=this.getCredentialsFilteredBy(r),r=Object.keys(o.refreshTokens).map(function(e){return o.refreshTokens[e]});return r.length<1?null:r[0]},ef.prototype.readAppMetadataFromCache=function(e,t){var r=this.getAppMetadataFilteredBy({environment:e,clientId:t}),e=Object.keys(r).map(function(e){return r[e]}),t=e.length;if(t<1)return null;if(1<t)throw ud.createMultipleMatchingAppMetadataInCacheError();return e[0]},ef.prototype.isAppMetadataFOCI=function(e,t){t=this.readAppMetadataFromCache(e,t);return!(!t||"1"!==t.familyId)},ef.prototype.matchHomeAccountId=function(e,t){return!("string"!=typeof e.homeAccountId||t!==e.homeAccountId)},ef.prototype.matchUserAssertionHash=function(e,t){return!(!e.userAssertionHash||t!==e.userAssertionHash)},ef.prototype.matchEnvironment=function(e,t){t=this.getAuthorityMetadataByAlias(t);return!!(t&&-1<t.aliases.indexOf(e.environment))},ef.prototype.matchCredentialType=function(e,t){return e.credentialType&&t.toLowerCase()===e.credentialType.toLowerCase()},ef.prototype.matchClientId=function(e,t){return!(!e.clientId||t!==e.clientId)},ef.prototype.matchFamilyId=function(e,t){return!(!e.familyId||t!==e.familyId)},ef.prototype.matchRealm=function(e,t){return!(!e.realm||t!==e.realm)},ef.prototype.matchNativeAccountId=function(e,t){return!(!e.nativeAccountId||t!==e.nativeAccountId)},ef.prototype.matchTarget=function(e,t){if(e.credentialType!==Kh.ACCESS_TOKEN&&e.credentialType!==Kh.ACCESS_TOKEN_WITH_AUTH_SCHEME||!e.target)return!1;e=Gd.fromString(e.target),t=Gd.fromString(t);return t.containsOnlyOIDCScopes()?t.removeScope(Lh.OFFLINE_ACCESS_SCOPE):t.removeOIDCScopes(),e.containsScopeSet(t)},ef.prototype.matchTokenType=function(e,t){return!(!e.tokenType||e.tokenType!==t)},ef.prototype.matchKeyId=function(e,t){return!(!e.keyId||e.keyId!==t)},ef.prototype.isAppMetadata=function(e){return-1!==e.indexOf(Vh)},ef.prototype.isAuthorityMetadata=function(e){return-1!==e.indexOf(Jh)},ef.prototype.generateAuthorityMetadataCacheKey=function(e){return Jh+"-"+this.clientId+"-"+e},ef.prototype.getSpecificCredential=function(e,t){switch(t){case Kh.ID_TOKEN:return this.getIdTokenCredential(e);case Kh.ACCESS_TOKEN:case Kh.ACCESS_TOKEN_WITH_AUTH_SCHEME:return this.getAccessTokenCredential(e);case Kh.REFRESH_TOKEN:return this.getRefreshTokenCredential(e);default:return null}},ef.toObject=function(e,t){for(var r in t)e[r]=t[r];return e},ef);function ef(e,t){this.clientId=e,this.cryptoImpl=t}var tf,rf=(Th(of,tf=$d),of.prototype.setAccount=function(){throw gp.createUnexpectedError("Storage interface - setAccount() has not been implemented for the cacheStorage interface.")},of.prototype.getAccount=function(){throw gp.createUnexpectedError("Storage interface - getAccount() has not been implemented for the cacheStorage interface.")},of.prototype.setIdTokenCredential=function(){throw gp.createUnexpectedError("Storage interface - setIdTokenCredential() has not been implemented for the cacheStorage interface.")},of.prototype.getIdTokenCredential=function(){throw gp.createUnexpectedError("Storage interface - getIdTokenCredential() has not been implemented for the cacheStorage interface.")},of.prototype.setAccessTokenCredential=function(){throw gp.createUnexpectedError("Storage interface - setAccessTokenCredential() has not been implemented for the cacheStorage interface.")},of.prototype.getAccessTokenCredential=function(){throw gp.createUnexpectedError("Storage interface - getAccessTokenCredential() has not been implemented for the cacheStorage interface.")},of.prototype.setRefreshTokenCredential=function(){throw gp.createUnexpectedError("Storage interface - setRefreshTokenCredential() has not been implemented for the cacheStorage interface.")},of.prototype.getRefreshTokenCredential=function(){throw gp.createUnexpectedError("Storage interface - getRefreshTokenCredential() has not been implemented for the cacheStorage interface.")},of.prototype.setAppMetadata=function(){throw gp.createUnexpectedError("Storage interface - setAppMetadata() has not been implemented for the cacheStorage interface.")},of.prototype.getAppMetadata=function(){throw gp.createUnexpectedError("Storage interface - getAppMetadata() has not been implemented for the cacheStorage interface.")},of.prototype.setServerTelemetry=function(){throw gp.createUnexpectedError("Storage interface - setServerTelemetry() has not been implemented for the cacheStorage interface.")},of.prototype.getServerTelemetry=function(){throw gp.createUnexpectedError("Storage interface - getServerTelemetry() has not been implemented for the cacheStorage interface.")},of.prototype.setAuthorityMetadata=function(){throw gp.createUnexpectedError("Storage interface - setAuthorityMetadata() has not been implemented for the cacheStorage interface.")},of.prototype.getAuthorityMetadata=function(){throw gp.createUnexpectedError("Storage interface - getAuthorityMetadata() has not been implemented for the cacheStorage interface.")},of.prototype.getAuthorityMetadataKeys=function(){throw gp.createUnexpectedError("Storage interface - getAuthorityMetadataKeys() has not been implemented for the cacheStorage interface.")},of.prototype.setThrottlingCache=function(){throw gp.createUnexpectedError("Storage interface - setThrottlingCache() has not been implemented for the cacheStorage interface.")},of.prototype.getThrottlingCache=function(){throw gp.createUnexpectedError("Storage interface - getThrottlingCache() has not been implemented for the cacheStorage interface.")},of.prototype.removeItem=function(){throw gp.createUnexpectedError("Storage interface - removeItem() has not been implemented for the cacheStorage interface.")},of.prototype.containsKey=function(){throw gp.createUnexpectedError("Storage interface - containsKey() has not been implemented for the cacheStorage interface.")},of.prototype.getKeys=function(){throw gp.createUnexpectedError("Storage interface - getKeys() has not been implemented for the cacheStorage interface.")},of.prototype.clear=function(){return Ah(this,void 0,void 0,function(){return kh(this,function(e){throw gp.createUnexpectedError("Storage interface - clear() has not been implemented for the cacheStorage interface.")})})},of.prototype.updateCredentialCacheKey=function(){throw gp.createUnexpectedError("Storage interface - updateCredentialCacheKey() has not been implemented for the cacheStorage interface.")},of);function of(){return null!==tf&&tf.apply(this,arguments)||this}var nf={tokenRenewalOffsetSeconds:300,preventCorsPreflight:!1,proxyUrl:Lh.EMPTY_STRING},sf={loggerCallback:function(){},piiLoggingEnabled:!1,logLevel:hd.Info,correlationId:Lh.EMPTY_STRING},af={sendGetRequestAsync:function(){return Ah(this,void 0,void 0,function(){return kh(this,function(e){throw gp.createUnexpectedError("Network interface - sendGetRequestAsync() has not been implemented")})})},sendPostRequestAsync:function(){return Ah(this,void 0,void 0,function(){return kh(this,function(e){throw gp.createUnexpectedError("Network interface - sendPostRequestAsync() has not been implemented")})})}},cf={sku:Lh.SKU,version:"9.0.1",cpu:Lh.EMPTY_STRING,os:Lh.EMPTY_STRING},uf={clientSecret:Lh.EMPTY_STRING,clientAssertion:void 0},lf={azureCloudInstance:yd.None,tenant:""+Lh.DEFAULT_COMMON_TENANT},hf={application:{appName:"",appVersion:""}};function pf(e){var t=e.authOptions,r=e.systemOptions,o=e.loggerOptions,n=e.storageInterface,i=e.networkInterface,s=e.cryptoInterface,a=e.clientCredentials,c=e.libraryInfo,u=e.telemetry,l=e.serverTelemetryManager,h=e.persistencePlugin,e=e.serializableCache,o=Ih(Ih({},sf),o);return{authOptions:Ih({clientCapabilities:[],azureCloudOptions:lf,skipAuthorityMetadataCache:!1},t),systemOptions:Ih(Ih({},nf),r),loggerOptions:o,storageInterface:n||new rf(t.clientId,vp),networkInterface:i||af,cryptoInterface:s||vp,clientCredentials:a||uf,libraryInfo:Ih(Ih({},cf),c),telemetry:Ih(Ih({},hf),u),serverTelemetryManager:l||null,persistencePlugin:h||null,serializableCache:e||null}}var df,ff=(Th(gf,df=gp),gf);function gf(e,t,r){r=df.call(this,e,t,r)||this;return r.name="ServerError",Object.setPrototypeOf(r,gf.prototype),r}var yf=(mf.generateThrottlingStorageKey=function(e){return cp+"."+JSON.stringify(e)},mf.preProcess=function(e,t){var r=mf.generateThrottlingStorageKey(t),o=e.getThrottlingCache(r);if(o){if(!(o.throttleTime<Date.now()))throw new ff((null===(t=o.errorCodes)||void 0===t?void 0:t.join(" "))||Lh.EMPTY_STRING,o.errorMessage,o.subError);e.removeItem(r,Gh.THROTTLING)}},mf.postProcess=function(e,t,r){(mf.checkResponseStatus(r)||mf.checkResponseForRetryAfter(r))&&(r={throttleTime:mf.calculateThrottleTime(parseInt(r.headers[Oh.RETRY_AFTER])),error:r.body.error,errorCodes:r.body.error_codes,errorMessage:r.body.error_description,subError:r.body.suberror},e.setThrottlingCache(mf.generateThrottlingStorageKey(t),r))},mf.checkResponseStatus=function(e){return 429===e.status||500<=e.status&&e.status<600},mf.checkResponseForRetryAfter=function(e){return!!e.headers&&(e.headers.hasOwnProperty(Oh.RETRY_AFTER)&&(e.status<200||300<=e.status))},mf.calculateThrottleTime=function(e){var t=e<=0?0:e,e=Date.now()/1e3;return Math.floor(1e3*Math.min(e+(t||sp),e+ap))},mf.removeThrottle=function(e,t,r,o){r={clientId:t,authority:r.authority,scopes:r.scopes,homeAccountIdentifier:o,claims:r.claims,authenticationScheme:r.authenticationScheme,resourceRequestMethod:r.resourceRequestMethod,resourceRequestUri:r.resourceRequestUri,shrClaims:r.shrClaims,sshKid:r.sshKid},r=this.generateThrottlingStorageKey(r);return e.removeItem(r,Gh.THROTTLING)},mf);function mf(){}var vf,_f=(wf.prototype.sendPostRequest=function(o,n,i){return Ah(this,void 0,void 0,function(){var t,r;return kh(this,function(e){switch(e.label){case 0:yf.preProcess(this.cacheManager,o),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,this.networkClient.sendPostRequestAsync(n,i)];case 2:return t=e.sent(),[3,4];case 3:throw(r=e.sent())instanceof gp?r:ud.createNetworkError(n,r);case 4:return yf.postProcess(this.cacheManager,o,t),[2,t]}})})},wf);function wf(e,t){this.networkClient=e,this.cacheManager=t}(o=vf=vf||{}).HOME_ACCOUNT_ID="home_account_id",o.UPN="UPN";bf.prototype.createTokenRequestHeaders=function(e){var t={};if(t[Oh.CONTENT_TYPE]=Lh.URL_FORM_CONTENT_TYPE,!this.config.systemOptions.preventCorsPreflight&&e)switch(e.type){case vf.HOME_ACCOUNT_ID:try{var r=Wd(e.credential);t[Oh.CCS_HEADER]="Oid:"+r.uid+"@"+r.utid}catch(e){this.logger.verbose("Could not parse home account ID for CCS Header: "+e)}break;case vf.UPN:t[Oh.CCS_HEADER]="UPN: "+e.credential}return t},bf.prototype.executePostToTokenEndpoint=function(r,o,n,i){return Ah(this,void 0,void 0,function(){var t;return kh(this,function(e){switch(e.label){case 0:return[4,this.networkManager.sendPostRequest(i,r,{body:o,headers:n,proxyUrl:this.config.systemOptions.proxyUrl})];case 1:return t=e.sent(),this.config.serverTelemetryManager&&t.status<500&&429!==t.status&&this.config.serverTelemetryManager.clearTelemetryCache(),[2,t]}})})},bf.prototype.updateAuthority=function(e){if(!e.discoveryComplete())throw ud.createEndpointDiscoveryIncompleteError("Updated authority has not completed endpoint discovery.");this.authority=e},w=bf;function bf(e,t){this.config=pf(e),this.logger=new fd(this.config.loggerOptions,"@azure/msal-common","9.0.1"),this.cryptoUtils=this.config.cryptoInterface,this.cacheManager=this.config.storageInterface,this.networkClient=this.config.networkInterface,this.networkManager=new _f(this.networkClient,this.cacheManager),this.serverTelemetryManager=this.config.serverTelemetryManager,this.authority=this.config.authOptions.authority,this.performanceClient=t}var Cf=(Ef.validateRedirectUri=function(e){if(pd.isEmpty(e))throw zd.createRedirectUriEmptyError()},Ef.validatePrompt=function(e){var t,r=[];for(t in jh)r.push(jh[t]);if(r.indexOf(e)<0)throw zd.createInvalidPromptError(e)},Ef.validateClaims=function(e){try{JSON.parse(e)}catch(e){throw zd.createInvalidClaimsRequestError()}},Ef.validateCodeChallengeParams=function(e,t){if(pd.isEmpty(e)||pd.isEmpty(t))throw zd.createInvalidCodeChallengeParamsError();this.validateCodeChallengeMethod(t)},Ef.validateCodeChallengeMethod=function(e){if([Zh.PLAIN,Zh.S256].indexOf(e)<0)throw zd.createInvalidCodeChallengeMethodError()},Ef.sanitizeEQParams=function(r,e){return r?(e.forEach(function(e,t){r[t]&&delete r[t]}),r):{}},Ef);function Ef(){}var Sf=(Tf.prototype.addResponseTypeCode=function(){this.parameters.set(Mh.RESPONSE_TYPE,encodeURIComponent(Lh.CODE_RESPONSE_TYPE))},Tf.prototype.addResponseTypeForTokenAndIdToken=function(){this.parameters.set(Mh.RESPONSE_TYPE,encodeURIComponent(Lh.TOKEN_RESPONSE_TYPE+" "+Lh.ID_TOKEN_RESPONSE_TYPE))},Tf.prototype.addResponseMode=function(e){this.parameters.set(Mh.RESPONSE_MODE,encodeURIComponent(e||Hh.QUERY))},Tf.prototype.addNativeBroker=function(){this.parameters.set(Mh.NATIVE_BROKER,encodeURIComponent("1"))},Tf.prototype.addScopes=function(e,t){e=(t=void 0===t?!0:t)?Ph(e||[],Dh):e||[],e=new Gd(e);this.parameters.set(Mh.SCOPE,encodeURIComponent(e.printScopes()))},Tf.prototype.addClientId=function(e){this.parameters.set(Mh.CLIENT_ID,encodeURIComponent(e))},Tf.prototype.addRedirectUri=function(e){Cf.validateRedirectUri(e),this.parameters.set(Mh.REDIRECT_URI,encodeURIComponent(e))},Tf.prototype.addPostLogoutRedirectUri=function(e){Cf.validateRedirectUri(e),this.parameters.set(Mh.POST_LOGOUT_URI,encodeURIComponent(e))},Tf.prototype.addIdTokenHint=function(e){this.parameters.set(Mh.ID_TOKEN_HINT,encodeURIComponent(e))},Tf.prototype.addDomainHint=function(e){this.parameters.set(Uh.DOMAIN_HINT,encodeURIComponent(e))},Tf.prototype.addLoginHint=function(e){this.parameters.set(Uh.LOGIN_HINT,encodeURIComponent(e))},Tf.prototype.addCcsUpn=function(e){this.parameters.set(Oh.CCS_HEADER,encodeURIComponent("UPN:"+e))},Tf.prototype.addCcsOid=function(e){this.parameters.set(Oh.CCS_HEADER,encodeURIComponent("Oid:"+e.uid+"@"+e.utid))},Tf.prototype.addSid=function(e){this.parameters.set(Uh.SID,encodeURIComponent(e))},Tf.prototype.addClaims=function(e,t){t=this.addClientCapabilitiesToClaims(e,t);Cf.validateClaims(t),this.parameters.set(Mh.CLAIMS,encodeURIComponent(t))},Tf.prototype.addCorrelationId=function(e){this.parameters.set(Mh.CLIENT_REQUEST_ID,encodeURIComponent(e))},Tf.prototype.addLibraryInfo=function(e){this.parameters.set(Mh.X_CLIENT_SKU,e.sku),this.parameters.set(Mh.X_CLIENT_VER,e.version),e.os&&this.parameters.set(Mh.X_CLIENT_OS,e.os),e.cpu&&this.parameters.set(Mh.X_CLIENT_CPU,e.cpu)},Tf.prototype.addApplicationTelemetry=function(e){null!=e&&e.appName&&this.parameters.set(Mh.X_APP_NAME,e.appName),null!=e&&e.appVersion&&this.parameters.set(Mh.X_APP_VER,e.appVersion)},Tf.prototype.addPrompt=function(e){Cf.validatePrompt(e),this.parameters.set(""+Mh.PROMPT,encodeURIComponent(e))},Tf.prototype.addState=function(e){pd.isEmpty(e)||this.parameters.set(Mh.STATE,encodeURIComponent(e))},Tf.prototype.addNonce=function(e){this.parameters.set(Mh.NONCE,encodeURIComponent(e))},Tf.prototype.addCodeChallengeParams=function(e,t){if(Cf.validateCodeChallengeParams(e,t),!e||!t)throw zd.createInvalidCodeChallengeParamsError();this.parameters.set(Mh.CODE_CHALLENGE,encodeURIComponent(e)),this.parameters.set(Mh.CODE_CHALLENGE_METHOD,encodeURIComponent(t))},Tf.prototype.addAuthorizationCode=function(e){this.parameters.set(Mh.CODE,encodeURIComponent(e))},Tf.prototype.addDeviceCode=function(e){this.parameters.set(Mh.DEVICE_CODE,encodeURIComponent(e))},Tf.prototype.addRefreshToken=function(e){this.parameters.set(Mh.REFRESH_TOKEN,encodeURIComponent(e))},Tf.prototype.addCodeVerifier=function(e){this.parameters.set(Mh.CODE_VERIFIER,encodeURIComponent(e))},Tf.prototype.addClientSecret=function(e){this.parameters.set(Mh.CLIENT_SECRET,encodeURIComponent(e))},Tf.prototype.addClientAssertion=function(e){pd.isEmpty(e)||this.parameters.set(Mh.CLIENT_ASSERTION,encodeURIComponent(e))},Tf.prototype.addClientAssertionType=function(e){pd.isEmpty(e)||this.parameters.set(Mh.CLIENT_ASSERTION_TYPE,encodeURIComponent(e))},Tf.prototype.addOboAssertion=function(e){this.parameters.set(Mh.OBO_ASSERTION,encodeURIComponent(e))},Tf.prototype.addRequestTokenUse=function(e){this.parameters.set(Mh.REQUESTED_TOKEN_USE,encodeURIComponent(e))},Tf.prototype.addGrantType=function(e){this.parameters.set(Mh.GRANT_TYPE,encodeURIComponent(e))},Tf.prototype.addClientInfo=function(){this.parameters.set("client_info","1")},Tf.prototype.addExtraQueryParameters=function(t){var r=this;Cf.sanitizeEQParams(t,this.parameters),Object.keys(t).forEach(function(e){r.parameters.set(e,t[e])})},Tf.prototype.addClientCapabilitiesToClaims=function(e,t){var r;if(e)try{r=JSON.parse(e)}catch(e){throw zd.createInvalidClaimsRequestError()}else r={};return t&&0<t.length&&(r.hasOwnProperty(Nh.ACCESS_TOKEN)||(r[Nh.ACCESS_TOKEN]={}),r[Nh.ACCESS_TOKEN][Nh.XMS_CC]={values:t}),JSON.stringify(r)},Tf.prototype.addUsername=function(e){this.parameters.set(ep.username,encodeURIComponent(e))},Tf.prototype.addPassword=function(e){this.parameters.set(ep.password,encodeURIComponent(e))},Tf.prototype.addPopToken=function(e){pd.isEmpty(e)||(this.parameters.set(Mh.TOKEN_TYPE,Xh.POP),this.parameters.set(Mh.REQ_CNF,encodeURIComponent(e)))},Tf.prototype.addSshJwk=function(e){pd.isEmpty(e)||(this.parameters.set(Mh.TOKEN_TYPE,Xh.SSH),this.parameters.set(Mh.REQ_CNF,encodeURIComponent(e)))},Tf.prototype.addServerTelemetry=function(e){this.parameters.set(Mh.X_CLIENT_CURR_TELEM,e.generateCurrentRequestHeaderValue()),this.parameters.set(Mh.X_CLIENT_LAST_TELEM,e.generateLastRequestHeaderValue())},Tf.prototype.addThrottling=function(){this.parameters.set(Mh.X_MS_LIB_CAPABILITY,up)},Tf.prototype.addLogoutHint=function(e){this.parameters.set(Mh.LOGOUT_HINT,encodeURIComponent(e))},Tf.prototype.createQueryString=function(){var r=new Array;return this.parameters.forEach(function(e,t){r.push(t+"="+e)}),r.join("&")},Tf);function Tf(){this.parameters=new Map}var If,Af=(Th(kf,If=md),kf.createIdTokenEntity=function(e,t,r,o,n){var i=new kf;return i.credentialType=Kh.ID_TOKEN,i.homeAccountId=e,i.environment=t,i.clientId=o,i.secret=r,i.realm=n,i},kf.isIdTokenEntity=function(e){return!!e&&(e.hasOwnProperty("homeAccountId")&&e.hasOwnProperty("environment")&&e.hasOwnProperty("credentialType")&&e.hasOwnProperty("realm")&&e.hasOwnProperty("clientId")&&e.hasOwnProperty("secret")&&e.credentialType===Kh.ID_TOKEN)},kf);function kf(){return null!==If&&If.apply(this,arguments)||this}var Pf=(Of.nowSeconds=function(){return Math.round((new Date).getTime()/1e3)},Of.isTokenExpired=function(e,t){return(Number(e)||0)<Of.nowSeconds()+t},Of.wasClockTurnedBack=function(e){return Number(e)>Of.nowSeconds()},Of.delay=function(t,r){return new Promise(function(e){return setTimeout(function(){return e(r)},t)})},Of);function Of(){}var Rf,xf=(Th(Mf,Rf=md),Mf.createAccessTokenEntity=function(e,t,r,o,n,i,s,a,c,u,l,h,p,d,f){var g,y=new Mf;y.homeAccountId=e,y.credentialType=Kh.ACCESS_TOKEN,y.secret=r;e=Pf.nowSeconds();if(y.cachedAt=e.toString(),y.expiresOn=s.toString(),y.extendedExpiresOn=a.toString(),u&&(y.refreshOn=u.toString()),y.environment=t,y.clientId=o,y.realm=n,y.target=i,y.userAssertionHash=h,y.tokenType=pd.isEmpty(l)?Xh.BEARER:l,d&&(y.requestedClaims=d,y.requestedClaimsHash=f),(null===(f=y.tokenType)||void 0===f?void 0:f.toLowerCase())!==Xh.BEARER.toLowerCase())switch(y.credentialType=Kh.ACCESS_TOKEN_WITH_AUTH_SCHEME,y.tokenType){case Xh.POP:var m=Qd.extractTokenClaims(r,c);if(null===(g=null==m?void 0:m.cnf)||void 0===g||!g.kid)throw ud.createTokenClaimsRequiredError();y.keyId=m.cnf.kid;break;case Xh.SSH:y.keyId=p}return y},Mf.isAccessTokenEntity=function(e){return!!e&&(e.hasOwnProperty("homeAccountId")&&e.hasOwnProperty("environment")&&e.hasOwnProperty("credentialType")&&e.hasOwnProperty("realm")&&e.hasOwnProperty("clientId")&&e.hasOwnProperty("secret")&&e.hasOwnProperty("target")&&(e.credentialType===Kh.ACCESS_TOKEN||e.credentialType===Kh.ACCESS_TOKEN_WITH_AUTH_SCHEME))},Mf);function Mf(){return null!==Rf&&Rf.apply(this,arguments)||this}var Nf,Lf=(Th(Df,Nf=md),Df.createRefreshTokenEntity=function(e,t,r,o,n,i){var s=new Df;return s.clientId=o,s.credentialType=Kh.REFRESH_TOKEN,s.environment=t,s.homeAccountId=e,s.secret=r,s.userAssertionHash=i,n&&(s.familyId=n),s},Df.isRefreshTokenEntity=function(e){return!!e&&(e.hasOwnProperty("homeAccountId")&&e.hasOwnProperty("environment")&&e.hasOwnProperty("credentialType")&&e.hasOwnProperty("clientId")&&e.hasOwnProperty("secret")&&e.credentialType===Kh.REFRESH_TOKEN)},Df);function Df(){return null!==Nf&&Nf.apply(this,arguments)||this}var qf,Uf=["interaction_required","consent_required","login_required"],jf=["message_only","additional_action","basic_action","user_password_expired","consent_required"],Hf={code:"no_tokens_found",desc:"No refresh token found in the cache. Please sign-in."},Bf={code:"native_account_unavailable",desc:"The requested account is not available in the native broker. It may have been deleted or logged out. Please sign-in again using an interactive API."},zf=(Th(Ff,qf=gp),Ff.isInteractionRequiredError=function(e,t,r){var o=!!e&&-1<Uf.indexOf(e),e=!!r&&-1<jf.indexOf(r),r=!!t&&Uf.some(function(e){return-1<t.indexOf(e)});return o||r||e},Ff.createNoTokensFoundError=function(){return new Ff(Hf.code,Hf.desc)},Ff.createNativeAccountUnavailableError=function(){return new Ff(Bf.code,Bf.desc)},Ff);function Ff(e,t,r){r=qf.call(this,e,t,r)||this;return r.name="InteractionRequiredAuthError",Object.setPrototypeOf(r,Ff.prototype),r}var Kf=function(e,t,r,o,n){this.account=e||null,this.idToken=t||null,this.accessToken=r||null,this.refreshToken=o||null,this.appMetadata=n||null},Gf=(Yf.setRequestState=function(e,t,r){r=Yf.generateLibraryState(e,r);return pd.isEmpty(t)?r:""+r+Lh.RESOURCE_DELIM+t},Yf.generateLibraryState=function(e,t){if(!e)throw ud.createNoCryptoObjectError("generateLibraryState");var r={id:e.createNewGuid()};t&&(r.meta=t);r=JSON.stringify(r);return e.base64Encode(r)},Yf.parseRequestState=function(e,t){if(!e)throw ud.createNoCryptoObjectError("parseRequestState");if(pd.isEmpty(t))throw ud.createInvalidStateError(t,"Null, undefined or empty state");try{var r=t.split(Lh.RESOURCE_DELIM),o=r[0],n=1<r.length?r.slice(1).join(Lh.RESOURCE_DELIM):Lh.EMPTY_STRING,i=e.base64Decode(o),s=JSON.parse(i);return{userRequestState:pd.isEmpty(n)?Lh.EMPTY_STRING:n,libraryState:s}}catch(e){throw ud.createInvalidStateError(t,e)}},Yf);function Yf(){}var Zf,Wf=(Object.defineProperty(Vf.prototype,"urlString",{get:function(){return this._urlString},enumerable:!1,configurable:!0}),Vf.canonicalizeUri=function(e){if(e){var t=e.toLowerCase();return pd.endsWith(t,"?")?t=t.slice(0,-1):pd.endsWith(t,"?/")&&(t=t.slice(0,-2)),pd.endsWith(t,"/")||(t+="/"),t}return e},Vf.prototype.validateAsUri=function(){var e;try{e=this.getUrlComponents()}catch(e){throw zd.createUrlParseError(e)}if(!e.HostNameAndPort||!e.PathSegments)throw zd.createUrlParseError("Given url string: "+this.urlString);if(!e.Protocol||"https:"!==e.Protocol.toLowerCase())throw zd.createInsecureAuthorityUriError(this.urlString)},Vf.appendQueryString=function(e,t){return pd.isEmpty(t)?e:e.indexOf("?")<0?e+"?"+t:e+"&"+t},Vf.removeHashFromUrl=function(e){return Vf.canonicalizeUri(e.split("#")[0])},Vf.prototype.replaceTenantPath=function(e){var t=this.getUrlComponents(),r=t.PathSegments;return!e||0===r.length||r[0]!==xh.COMMON&&r[0]!==xh.ORGANIZATIONS||(r[0]=e),Vf.constructAuthorityUriFromObject(t)},Vf.prototype.getHash=function(){return Vf.parseHash(this.urlString)},Vf.prototype.getUrlComponents=function(){var e=RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?"),t=this.urlString.match(e);if(!t)throw zd.createUrlParseError("Given url string: "+this.urlString);e={Protocol:t[1],HostNameAndPort:t[4],AbsolutePath:t[5],QueryString:t[7]},t=(t=e.AbsolutePath.split("/")).filter(function(e){return e&&0<e.length});return e.PathSegments=t,!pd.isEmpty(e.QueryString)&&e.QueryString.endsWith("/")&&(e.QueryString=e.QueryString.substring(0,e.QueryString.length-1)),e},Vf.getDomainFromUrl=function(e){var t=RegExp("^([^:/?#]+://)?([^/?#]*)"),t=e.match(t);if(!t)throw zd.createUrlParseError("Given url string: "+e);return t[2]},Vf.getAbsoluteUrl=function(e,t){if(e[0]!==Lh.FORWARD_SLASH)return e;t=new Vf(t).getUrlComponents();return t.Protocol+"//"+t.HostNameAndPort+e},Vf.parseHash=function(e){var t=e.indexOf("#"),r=e.indexOf("#/");return-1<r?e.substring(r+2):-1<t?e.substring(t+1):Lh.EMPTY_STRING},Vf.parseQueryString=function(e){var t=e.indexOf("?"),r=e.indexOf("/?");return-1<r?e.substring(r+2):-1<t?e.substring(t+1):Lh.EMPTY_STRING},Vf.constructAuthorityUriFromObject=function(e){return new Vf(e.Protocol+"//"+e.HostNameAndPort+"/"+e.PathSegments.join("/"))},Vf.getDeserializedHash=function(e){if(pd.isEmpty(e))return{};var t=Vf.parseHash(e),t=pd.queryStringToObject(pd.isEmpty(t)?e:t);if(!t)throw ud.createHashNotDeserializedError(JSON.stringify(t));return t},Vf.getDeserializedQueryString=function(e){if(pd.isEmpty(e))return{};var t=Vf.parseQueryString(e),t=pd.queryStringToObject(pd.isEmpty(t)?e:t);if(!t)throw ud.createHashNotDeserializedError(JSON.stringify(t));return t},Vf.hashContainsKnownProperties=function(e){if(pd.isEmpty(e)||e.indexOf("=")<0)return!1;e=Vf.getDeserializedHash(e);return!!(e.code||e.error_description||e.error||e.state)},Vf);function Vf(e){if(this._urlString=e,pd.isEmpty(this._urlString))throw zd.createUrlEmptyError();pd.isEmpty(this.getHash())&&(this._urlString=Vf.canonicalizeUri(e))}(o=Zf=Zf||{}).SW="sw",o.UHW="uhw";var Jf=(Qf.prototype.generateCnf=function(o){return Ah(this,void 0,void 0,function(){var t,r;return kh(this,function(e){switch(e.label){case 0:return[4,this.generateKid(o)];case 1:return r=e.sent(),t=this.cryptoUtils.base64Encode(JSON.stringify(r)),r={kid:r.kid,reqCnfString:t},[4,this.cryptoUtils.hashString(t)];case 2:return[2,(r.reqCnfHash=e.sent(),r)]}})})},Qf.prototype.generateKid=function(t){return Ah(this,void 0,void 0,function(){return kh(this,function(e){switch(e.label){case 0:return[4,this.cryptoUtils.getPublicKeyThumbprint(t)];case 1:return[2,{kid:e.sent(),xms_ksl:Zf.SW}]}})})},Qf.prototype.signPopToken=function(t,r,o){return Ah(this,void 0,void 0,function(){return kh(this,function(e){return[2,this.signPayload(t,r,o)]})})},Qf.prototype.signPayload=function(i,s,a,c){return Ah(this,void 0,void 0,function(){var t,r,o,n;return kh(this,function(e){switch(e.label){case 0:return t=a.resourceRequestMethod,n=a.resourceRequestUri,r=a.shrClaims,o=a.shrNonce,n=n?new Wf(n):void 0,n=null==n?void 0:n.getUrlComponents(),[4,this.cryptoUtils.signJwt(Ih({at:i,ts:Pf.nowSeconds(),m:null==t?void 0:t.toUpperCase(),u:null==n?void 0:n.HostNameAndPort,nonce:o||this.cryptoUtils.createNewGuid(),p:null==n?void 0:n.AbsolutePath,q:null!=n&&n.QueryString?[[],n.QueryString]:void 0,client_claims:r||void 0},c),s,a.correlationId)];case 1:return[2,e.sent()]}})})},Qf);function Qf(e){this.cryptoUtils=e}var Xf=($f.prototype.generateAppMetadataKey=function(){return $f.generateAppMetadataCacheKey(this.environment,this.clientId)},$f.generateAppMetadataCacheKey=function(e,t){return[Vh,e,t].join(Fh.CACHE_KEY_SEPARATOR).toLowerCase()},$f.createAppMetadataEntity=function(e,t,r){var o=new $f;return o.clientId=e,o.environment=t,r&&(o.familyId=r),o},$f.isAppMetadataEntity=function(e,t){return!!t&&(0===e.indexOf(Vh)&&t.hasOwnProperty("clientId")&&t.hasOwnProperty("environment"))},$f);function $f(){}var eg=(Object.defineProperty(tg.prototype,"cacheHasChanged",{get:function(){return this.hasChanged},enumerable:!1,configurable:!0}),Object.defineProperty(tg.prototype,"tokenCache",{get:function(){return this.cache},enumerable:!1,configurable:!0}),tg);function tg(e,t){this.cache=e,this.hasChanged=t}var rg=(og.prototype.validateServerAuthorizationCodeResponse=function(e,t,r){if(!e.state||!t)throw e.state?ud.createStateNotFoundError("Cached State"):ud.createStateNotFoundError("Server State");if(decodeURIComponent(e.state)!==decodeURIComponent(t))throw ud.createStateMismatchError();if(e.error||e.error_description||e.suberror){if(zf.isInteractionRequiredError(e.error,e.error_description,e.suberror))throw new zf(e.error||Lh.EMPTY_STRING,e.error_description,e.suberror);throw new ff(e.error||Lh.EMPTY_STRING,e.error_description,e.suberror)}e.client_info&&Zd(e.client_info,r)},og.prototype.validateTokenResponse=function(e){if(e.error||e.error_description||e.suberror){if(zf.isInteractionRequiredError(e.error,e.error_description,e.suberror))throw new zf(e.error,e.error_description,e.suberror);var t=e.error_codes+" - ["+e.timestamp+"]: "+e.error_description+" - Correlation ID: "+e.correlation_id+" - Trace ID: "+e.trace_id;throw new ff(e.error,t,e.suberror)}},og.prototype.handleServerTokenResponse=function(s,a,c,u,l,h,p,d,f){return Ah(this,void 0,void 0,function(){var t,r,o,n,i;return kh(this,function(e){switch(e.label){case 0:if(s.id_token){if(t=new Qd(s.id_token||Lh.EMPTY_STRING,this.cryptoObj),l&&!pd.isEmpty(l.nonce)&&t.claims.nonce!==l.nonce)throw ud.createNonceMismatchError();if(u.maxAge||0===u.maxAge){if(!(i=t.claims.auth_time))throw ud.createAuthTimeNotFoundError();Qd.checkMaxAge(i,u.maxAge)}}this.homeAccountIdentifier=Vd.generateHomeAccountId(s.client_info||Lh.EMPTY_STRING,a.authorityType,this.logger,this.cryptoObj,t),l&&l.state&&(r=Gf.parseRequestState(this.cryptoObj,l.state)),s.key_id=s.key_id||u.sshKid||void 0,o=this.generateCacheRecord(s,a,c,u,t,h,l),e.label=1;case 1:return(e.trys.push([1,,5,8]),this.persistencePlugin&&this.serializableCache)?(this.logger.verbose("Persistence enabled, calling beforeCacheAccess"),n=new eg(this.serializableCache,!0),[4,this.persistencePlugin.beforeCacheAccess(n)]):[3,3];case 2:e.sent(),e.label=3;case 3:return!p||d||!o.account||(i=o.account.generateAccountKey(),this.cacheStorage.getAccount(i))?[4,this.cacheStorage.saveCacheRecord(o)]:(this.logger.warning("Account used to refresh tokens not in persistence, refreshed tokens will not be stored in the cache"),[2,og.generateAuthenticationResult(this.cryptoObj,a,o,!1,u,t,r,void 0,f)]);case 4:return e.sent(),[3,8];case 5:return this.persistencePlugin&&this.serializableCache&&n?(this.logger.verbose("Persistence enabled, calling afterCacheAccess"),[4,this.persistencePlugin.afterCacheAccess(n)]):[3,7];case 6:e.sent(),e.label=7;case 7:return[7];case 8:return[2,og.generateAuthenticationResult(this.cryptoObj,a,o,!1,u,t,r,s.spa_code,f)]}})})},og.prototype.generateCacheRecord=function(e,t,r,o,n,i,s){var a,c,u=t.getPreferredCache();if(pd.isEmpty(u))throw ud.createInvalidCacheEnvironmentError();!pd.isEmpty(e.id_token)&&n&&(a=Af.createIdTokenEntity(this.homeAccountIdentifier,u,e.id_token||Lh.EMPTY_STRING,this.clientId,n.claims.tid||Lh.EMPTY_STRING),c=this.generateAccountEntity(e,n,t,s));var l,h,p,d=null;pd.isEmpty(e.access_token)||(l=e.scope?Gd.fromString(e.scope):new Gd(o.scopes||[]),p=(h=r+(("string"==typeof e.expires_in?parseInt(e.expires_in,10):e.expires_in)||0))+(("string"==typeof e.ext_expires_in?parseInt(e.ext_expires_in,10):e.ext_expires_in)||0),s=(s=("string"==typeof e.refresh_in?parseInt(e.refresh_in,10):e.refresh_in)||void 0)&&0<s?r+s:void 0,d=xf.createAccessTokenEntity(this.homeAccountIdentifier,u,e.access_token||Lh.EMPTY_STRING,this.clientId,n?n.claims.tid||Lh.EMPTY_STRING:t.tenant,l.printScopes(),h,p,this.cryptoObj,s,e.token_type,i,e.key_id,o.claims,o.requestedClaimsHash));o=null;pd.isEmpty(e.refresh_token)||(o=Lf.createRefreshTokenEntity(this.homeAccountIdentifier,u,e.refresh_token||Lh.EMPTY_STRING,this.clientId,e.foci,i));i=null;return pd.isEmpty(e.foci)||(i=Xf.createAppMetadataEntity(this.clientId,u,e.foci)),new Kf(c,a,d,o,i)},og.prototype.generateAccountEntity=function(e,t,r,o){var n=r.authorityType,i=o?o.cloud_graph_host_name:Lh.EMPTY_STRING,o=o?o.msgraph_host:Lh.EMPTY_STRING;if(n===Kd.Adfs)return this.logger.verbose("Authority type is ADFS, creating ADFS account"),Vd.createGenericAccount(this.homeAccountIdentifier,t,r,i,o);if(pd.isEmpty(e.client_info)&&"AAD"===r.protocolMode)throw ud.createClientInfoEmptyError();return e.client_info?Vd.createAccount(e.client_info,this.homeAccountIdentifier,t,r,i,o):Vd.createGenericAccount(this.homeAccountIdentifier,t,r,i,o)},og.generateAuthenticationResult=function(u,l,h,p,d,f,g,y,m){var v;return Ah(this,void 0,void 0,function(){var t,r,o,n,i,s,a,c;return kh(this,function(e){switch(e.label){case 0:if(t=Lh.EMPTY_STRING,r=[],o=null,i=Lh.EMPTY_STRING,!h.accessToken)return[3,4];if(h.accessToken.tokenType!==Xh.POP)return[3,2];if(s=new Jf(u),c=h.accessToken,a=c.secret,!(c=c.keyId))throw ud.createKeyIdMissingError();return[4,s.signPopToken(a,c,d)];case 1:return t=e.sent(),[3,3];case 2:t=h.accessToken.secret,e.label=3;case 3:r=Gd.fromString(h.accessToken.target).asArray(),o=new Date(1e3*Number(h.accessToken.expiresOn)),n=new Date(1e3*Number(h.accessToken.extendedExpiresOn)),e.label=4;case 4:return h.appMetadata&&(i="1"===h.appMetadata.familyId?"1":Lh.EMPTY_STRING),a=(null==f?void 0:f.claims.oid)||(null==f?void 0:f.claims.sub)||Lh.EMPTY_STRING,c=(null==f?void 0:f.claims.tid)||Lh.EMPTY_STRING,[2,{authority:l.canonicalAuthority,uniqueId:a,tenantId:c,scopes:r,account:h.account?h.account.getAccountInfo():null,idToken:f?f.rawToken:Lh.EMPTY_STRING,idTokenClaims:f?f.claims:{},accessToken:t,fromCache:p,expiresOn:o,correlationId:d.correlationId,requestId:m||Lh.EMPTY_STRING,extExpiresOn:n,familyId:i,tokenType:(null===(v=h.accessToken)||void 0===v?void 0:v.tokenType)||Lh.EMPTY_STRING,state:g?g.userRequestState:Lh.EMPTY_STRING,cloudGraphHostName:(null===(v=h.account)||void 0===v?void 0:v.cloudGraphHostName)||Lh.EMPTY_STRING,msGraphHost:(null===(v=h.account)||void 0===v?void 0:v.msGraphHost)||Lh.EMPTY_STRING,code:y,fromNativeBroker:!1}]}})})},og);function og(e,t,r,o,n,i){this.clientId=e,this.cacheStorage=t,this.cryptoObj=r,this.logger=o,this.serializableCache=n,this.persistencePlugin=i}var ng,ig,sg,ag=(Th(cg,ng=w),cg.prototype.getAuthCodeUrl=function(r){return Ah(this,void 0,void 0,function(){var t;return kh(this,function(e){switch(e.label){case 0:return[4,this.createAuthCodeUrlQueryString(r)];case 1:return t=e.sent(),[2,Wf.appendQueryString(this.authority.authorizationEndpoint,t)]}})})},cg.prototype.acquireToken=function(i,s){var a;return Ah(this,void 0,void 0,function(){var t,r,o,n;return kh(this,function(e){switch(e.label){case 0:if(this.logger.info("in acquireToken call"),!i||pd.isEmpty(i.code))throw ud.createTokenRequestCannotBeMadeError();return t=Pf.nowSeconds(),[4,this.executeTokenRequest(this.authority,i)];case 1:return r=e.sent(),o=null===(a=r.headers)||void 0===a?void 0:a[Oh.X_MS_REQUEST_ID],(n=new rg(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.config.serializableCache,this.config.persistencePlugin)).validateTokenResponse(r.body),[4,n.handleServerTokenResponse(r.body,this.authority,t,i,s,void 0,void 0,void 0,o)];case 2:return[2,e.sent()]}})})},cg.prototype.handleFragmentResponse=function(e,t){var r=new rg(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,null,null),e=new Wf(e),e=Wf.getDeserializedHash(e.getHash());if(r.validateServerAuthorizationCodeResponse(e,t,this.cryptoUtils),!e.code)throw ud.createNoAuthCodeInServerResponseError();return Ih(Ih({},e),{code:e.code})},cg.prototype.getLogoutUri=function(e){if(!e)throw zd.createEmptyLogoutRequestError();e=this.createLogoutUrlQueryString(e);return Wf.appendQueryString(this.authority.endSessionEndpoint,e)},cg.prototype.executeTokenRequest=function(s,a){return Ah(this,void 0,void 0,function(){var t,r,o,n,i;return kh(this,function(e){switch(e.label){case 0:return t={clientId:this.config.authOptions.clientId,authority:s.canonicalAuthority,scopes:a.scopes,claims:a.claims,authenticationScheme:a.authenticationScheme,resourceRequestMethod:a.resourceRequestMethod,resourceRequestUri:a.resourceRequestUri,shrClaims:a.shrClaims,sshKid:a.sshKid},[4,this.createTokenRequestBody(a)];case 1:if(r=e.sent(),i=this.createTokenQueryParameters(a),n=void 0,a.clientInfo)try{o=Zd(a.clientInfo,this.cryptoUtils),n={credential:""+o.uid+Fh.CLIENT_INFO_SEPARATOR+o.utid,type:vf.HOME_ACCOUNT_ID}}catch(e){this.logger.verbose("Could not parse client info for CCS Header: "+e)}return n=this.createTokenRequestHeaders(n||a.ccsCredential),i=pd.isEmpty(i)?s.tokenEndpoint:s.tokenEndpoint+"?"+i,[2,this.executePostToTokenEndpoint(i,r,n,t)]}})})},cg.prototype.createTokenQueryParameters=function(e){var t=new Sf;return e.tokenQueryParameters&&t.addExtraQueryParameters(e.tokenQueryParameters),t.createQueryString()},cg.prototype.createTokenRequestBody=function(s){return Ah(this,void 0,void 0,function(){var t,r,o,n,i;return kh(this,function(e){switch(e.label){case 0:return((t=new Sf).addClientId(this.config.authOptions.clientId),this.includeRedirectUri?t.addRedirectUri(s.redirectUri):Cf.validateRedirectUri(s.redirectUri),t.addScopes(s.scopes),t.addAuthorizationCode(s.code),t.addLibraryInfo(this.config.libraryInfo),t.addApplicationTelemetry(this.config.telemetry.application),t.addThrottling(),this.serverTelemetryManager&&t.addServerTelemetry(this.serverTelemetryManager),s.codeVerifier&&t.addCodeVerifier(s.codeVerifier),this.config.clientCredentials.clientSecret&&t.addClientSecret(this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion&&(r=this.config.clientCredentials.clientAssertion,t.addClientAssertion(r.assertion),t.addClientAssertionType(r.assertionType)),t.addGrantType(Bh.AUTHORIZATION_CODE_GRANT),t.addClientInfo(),s.authenticationScheme!==Xh.POP)?[3,2]:[4,new Jf(this.cryptoUtils).generateCnf(s)];case 1:return i=e.sent(),t.addPopToken(i.reqCnfString),[3,3];case 2:if(s.authenticationScheme===Xh.SSH){if(!s.sshJwk)throw zd.createMissingSshJwkError();t.addSshJwk(s.sshJwk)}e.label=3;case 3:if(i=s.correlationId||this.config.cryptoInterface.createNewGuid(),t.addCorrelationId(i),(!pd.isEmptyObj(s.claims)||this.config.authOptions.clientCapabilities&&0<this.config.authOptions.clientCapabilities.length)&&t.addClaims(s.claims,this.config.authOptions.clientCapabilities),o=void 0,s.clientInfo)try{n=Zd(s.clientInfo,this.cryptoUtils),o={credential:""+n.uid+Fh.CLIENT_INFO_SEPARATOR+n.utid,type:vf.HOME_ACCOUNT_ID}}catch(e){this.logger.verbose("Could not parse client info for CCS Header: "+e)}else o=s.ccsCredential;if(this.config.systemOptions.preventCorsPreflight&&o)switch(o.type){case vf.HOME_ACCOUNT_ID:try{n=Wd(o.credential),t.addCcsOid(n)}catch(e){this.logger.verbose("Could not parse home account ID for CCS Header: "+e)}break;case vf.UPN:t.addCcsUpn(o.credential)}return s.tokenBodyParameters&&t.addExtraQueryParameters(s.tokenBodyParameters),!s.enableSpaAuthorizationCode||s.tokenBodyParameters&&s.tokenBodyParameters[Mh.RETURN_SPA_CODE]||t.addExtraQueryParameters(((i={})[Mh.RETURN_SPA_CODE]="1",i)),[2,t.createQueryString()]}})})},cg.prototype.createAuthCodeUrlQueryString=function(i){return Ah(this,void 0,void 0,function(){var t,r,o,n;return kh(this,function(e){switch(e.label){case 0:if((t=new Sf).addClientId(this.config.authOptions.clientId),r=Ph(i.scopes||[],i.extraScopesToConsent||[]),t.addScopes(r),t.addRedirectUri(i.redirectUri),r=i.correlationId||this.config.cryptoInterface.createNewGuid(),t.addCorrelationId(r),t.addResponseMode(i.responseMode),t.addResponseTypeCode(),t.addLibraryInfo(this.config.libraryInfo),t.addApplicationTelemetry(this.config.telemetry.application),t.addClientInfo(),i.codeChallenge&&i.codeChallengeMethod&&t.addCodeChallengeParams(i.codeChallenge,i.codeChallengeMethod),i.prompt&&t.addPrompt(i.prompt),i.domainHint&&t.addDomainHint(i.domainHint),i.prompt!==jh.SELECT_ACCOUNT)if(i.sid&&i.prompt===jh.NONE)this.logger.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from request"),t.addSid(i.sid);else if(i.account){if(n=this.extractAccountSid(i.account),r=this.extractLoginHint(i.account)){this.logger.verbose("createAuthCodeUrlQueryString: login_hint claim present on account"),t.addLoginHint(r);try{o=Wd(i.account.homeAccountId),t.addCcsOid(o)}catch(e){this.logger.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}else if(n&&i.prompt===jh.NONE){this.logger.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from account"),t.addSid(n);try{o=Wd(i.account.homeAccountId),t.addCcsOid(o)}catch(e){this.logger.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}else if(i.loginHint)this.logger.verbose("createAuthCodeUrlQueryString: Adding login_hint from request"),t.addLoginHint(i.loginHint),t.addCcsUpn(i.loginHint);else if(i.account.username){this.logger.verbose("createAuthCodeUrlQueryString: Adding login_hint from account"),t.addLoginHint(i.account.username);try{o=Wd(i.account.homeAccountId),t.addCcsOid(o)}catch(e){this.logger.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}}else i.loginHint&&(this.logger.verbose("createAuthCodeUrlQueryString: No account, adding login_hint from request"),t.addLoginHint(i.loginHint),t.addCcsUpn(i.loginHint));else this.logger.verbose("createAuthCodeUrlQueryString: Prompt is select_account, ignoring account hints");return(i.nonce&&t.addNonce(i.nonce),i.state&&t.addState(i.state),(!pd.isEmpty(i.claims)||this.config.authOptions.clientCapabilities&&0<this.config.authOptions.clientCapabilities.length)&&t.addClaims(i.claims,this.config.authOptions.clientCapabilities),i.extraQueryParameters&&t.addExtraQueryParameters(i.extraQueryParameters),i.nativeBroker)?(t.addNativeBroker(),i.authenticationScheme!==Xh.POP?[3,2]:[4,new Jf(this.cryptoUtils).generateCnf(i)]):[3,2];case 1:n=e.sent(),t.addPopToken(n.reqCnfHash),e.label=2;case 2:return[2,t.createQueryString()]}})})},cg.prototype.createLogoutUrlQueryString=function(e){var t=new Sf;return e.postLogoutRedirectUri&&t.addPostLogoutRedirectUri(e.postLogoutRedirectUri),e.correlationId&&t.addCorrelationId(e.correlationId),e.idTokenHint&&t.addIdTokenHint(e.idTokenHint),e.state&&t.addState(e.state),e.logoutHint&&t.addLogoutHint(e.logoutHint),e.extraQueryParameters&&t.addExtraQueryParameters(e.extraQueryParameters),t.createQueryString()},cg.prototype.extractAccountSid=function(e){return(null===(e=e.idTokenClaims)||void 0===e?void 0:e.sid)||null},cg.prototype.extractLoginHint=function(e){return(null===(e=e.idTokenClaims)||void 0===e?void 0:e.login_hint)||null},cg);function cg(e){e=ng.call(this,e)||this;return e.includeRedirectUri=!0,e}(o=ig=ig||{}).AcquireTokenByCode="acquireTokenByCode",o.AcquireTokenByRefreshToken="acquireTokenByRefreshToken",o.AcquireTokenSilent="acquireTokenSilent",o.AcquireTokenSilentAsync="acquireTokenSilentAsync",o.AcquireTokenPopup="acquireTokenPopup",o.CryptoOptsGetPublicKeyThumbprint="cryptoOptsGetPublicKeyThumbprint",o.CryptoOptsSignJwt="cryptoOptsSignJwt",o.SilentCacheClientAcquireToken="silentCacheClientAcquireToken",o.SilentIframeClientAcquireToken="silentIframeClientAcquireToken",o.SilentRefreshClientAcquireToken="silentRefreshClientAcquireToken",o.SsoSilent="ssoSilent",o.StandardInteractionClientGetDiscoveredAuthority="standardInteractionClientGetDiscoveredAuthority",o.FetchAccountIdWithNativeBroker="fetchAccountIdWithNativeBroker",o.NativeInteractionClientAcquireToken="nativeInteractionClientAcquireToken",o.BaseClientCreateTokenRequestHeaders="baseClientCreateTokenRequestHeaders",o.BrokerHandhshake="brokerHandshake",o.AcquireTokenByRefreshTokenInBroker="acquireTokenByRefreshTokenInBroker",o.AcquireTokenByBroker="acquireTokenByBroker",o.RefreshTokenClientExecuteTokenRequest="refreshTokenClientExecuteTokenRequest",o.RefreshTokenClientAcquireToken="refreshTokenClientAcquireToken",o.RefreshTokenClientAcquireTokenWithCachedRefreshToken="refreshTokenClientAcquireTokenWithCachedRefreshToken",(o=sg=sg||{})[o.NotStarted=0]="NotStarted",o[o.InProgress=1]="InProgress",o[o.Completed=2]="Completed";var ug,lg=(Th(hg,ug=w),hg.prototype.acquireToken=function(a){var c,u;return Ah(this,void 0,void 0,function(){var t,r,o,n,i,s=this;return kh(this,function(e){switch(e.label){case 0:return t=null===(c=this.performanceClient)||void 0===c?void 0:c.startMeasurement(ig.RefreshTokenClientAcquireToken,a.correlationId),this.logger.verbose("RefreshTokenClientAcquireToken called",a.correlationId),r=Pf.nowSeconds(),[4,this.executeTokenRequest(a,this.authority)];case 1:return o=e.sent(),null!=t&&t.addStaticFields({refreshTokenSize:(null===(u=o.body.refresh_token)||void 0===u?void 0:u.length)||0}),n=null===(u=o.headers)||void 0===u?void 0:u[Oh.X_MS_REQUEST_ID],(i=new rg(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.config.serializableCache,this.config.persistencePlugin)).validateTokenResponse(o.body),[2,i.handleServerTokenResponse(o.body,this.authority,r,a,void 0,void 0,!0,a.forceCache,n).then(function(e){return null!=t&&t.endMeasurement({success:!0}),e}).catch(function(e){throw s.logger.verbose("Error in fetching refresh token",a.correlationId),null!=t&&t.endMeasurement({errorCode:e.errorCode,subErrorCode:e.subError,success:!1}),e})]}})})},hg.prototype.acquireTokenByRefreshToken=function(o){return Ah(this,void 0,void 0,function(){var t,r;return kh(this,function(e){if(!o)throw zd.createEmptyTokenRequestError();if(!o.account)throw ud.createNoAccountInSilentRequestError();if(this.cacheManager.isAppMetadataFOCI(o.account.environment,this.config.authOptions.clientId))try{return[2,this.acquireTokenWithCachedRefreshToken(o,!0)]}catch(e){if(t=e instanceof zf&&e.errorCode===Hf.code,r=e instanceof ff&&e.errorCode===lp&&e.subError===hp,t||r)return[2,this.acquireTokenWithCachedRefreshToken(o,!1)];throw e}return[2,this.acquireTokenWithCachedRefreshToken(o,!1)]})})},hg.prototype.acquireTokenWithCachedRefreshToken=function(o,n){var i;return Ah(this,void 0,void 0,function(){var t,r;return kh(this,function(e){if(t=null===(i=this.performanceClient)||void 0===i?void 0:i.startMeasurement(ig.RefreshTokenClientAcquireTokenWithCachedRefreshToken,o.correlationId),this.logger.verbose("RefreshTokenClientAcquireTokenWithCachedRefreshToken called",o.correlationId),!(r=this.cacheManager.readRefreshTokenFromCache(this.config.authOptions.clientId,o.account,n)))throw null!=t&&t.discardMeasurement(),zf.createNoTokensFoundError();return null!=t&&t.endMeasurement({success:!0}),r=Ih(Ih({},o),{refreshToken:r.secret,authenticationScheme:o.authenticationScheme||Xh.BEARER,ccsCredential:{credential:o.account.homeAccountId,type:vf.HOME_ACCOUNT_ID}}),[2,this.acquireToken(r)]})})},hg.prototype.executeTokenRequest=function(s,a){var c;return Ah(this,void 0,void 0,function(){var t,r,o,n,i;return kh(this,function(e){switch(e.label){case 0:return t=null===(c=this.performanceClient)||void 0===c?void 0:c.startMeasurement(ig.RefreshTokenClientExecuteTokenRequest,s.correlationId),[4,this.createTokenRequestBody(s)];case 1:return r=e.sent(),i=this.createTokenQueryParameters(s),o=this.createTokenRequestHeaders(s.ccsCredential),n={clientId:this.config.authOptions.clientId,authority:a.canonicalAuthority,scopes:s.scopes,claims:s.claims,authenticationScheme:s.authenticationScheme,resourceRequestMethod:s.resourceRequestMethod,resourceRequestUri:s.resourceRequestUri,shrClaims:s.shrClaims,sshKid:s.sshKid},i=Wf.appendQueryString(a.tokenEndpoint,i),[2,this.executePostToTokenEndpoint(i,r,o,n).then(function(e){return null!=t&&t.endMeasurement({success:!0}),e}).catch(function(e){throw null!=t&&t.endMeasurement({success:!1}),e})]}})})},hg.prototype.createTokenQueryParameters=function(e){var t=new Sf;return e.tokenQueryParameters&&t.addExtraQueryParameters(e.tokenQueryParameters),t.createQueryString()},hg.prototype.createTokenRequestBody=function(s){var a;return Ah(this,void 0,void 0,function(){var t,r,o,n,i;return kh(this,function(e){switch(e.label){case 0:return(t=s.correlationId,r=null===(a=this.performanceClient)||void 0===a?void 0:a.startMeasurement(ig.BaseClientCreateTokenRequestHeaders,t),(o=new Sf).addClientId(this.config.authOptions.clientId),o.addScopes(s.scopes),o.addGrantType(Bh.REFRESH_TOKEN_GRANT),o.addClientInfo(),o.addLibraryInfo(this.config.libraryInfo),o.addApplicationTelemetry(this.config.telemetry.application),o.addThrottling(),this.serverTelemetryManager&&o.addServerTelemetry(this.serverTelemetryManager),o.addCorrelationId(t),o.addRefreshToken(s.refreshToken),this.config.clientCredentials.clientSecret&&o.addClientSecret(this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion&&(n=this.config.clientCredentials.clientAssertion,o.addClientAssertion(n.assertion),o.addClientAssertionType(n.assertionType)),s.authenticationScheme!==Xh.POP)?[3,2]:[4,new Jf(this.cryptoUtils).generateCnf(s)];case 1:return n=e.sent(),o.addPopToken(n.reqCnfString),[3,3];case 2:if(s.authenticationScheme===Xh.SSH){if(!s.sshJwk)throw null!=r&&r.endMeasurement({success:!1}),zd.createMissingSshJwkError();o.addSshJwk(s.sshJwk)}e.label=3;case 3:if((!pd.isEmptyObj(s.claims)||this.config.authOptions.clientCapabilities&&0<this.config.authOptions.clientCapabilities.length)&&o.addClaims(s.claims,this.config.authOptions.clientCapabilities),this.config.systemOptions.preventCorsPreflight&&s.ccsCredential)switch(s.ccsCredential.type){case vf.HOME_ACCOUNT_ID:try{i=Wd(s.ccsCredential.credential),o.addCcsOid(i)}catch(e){this.logger.verbose("Could not parse home account ID for CCS Header: "+e)}break;case vf.UPN:o.addCcsUpn(s.ccsCredential.credential)}return null!=r&&r.endMeasurement({success:!0}),[2,o.createQueryString()]}})})},hg);function hg(e,t){return ug.call(this,e,t)||this}var pg,dg=(Th(fg,pg=w),fg.prototype.acquireToken=function(r){return Ah(this,void 0,void 0,function(){var t;return kh(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,this.acquireCachedToken(r)];case 1:return[2,e.sent()];case 2:if((t=e.sent())instanceof ud&&t.errorCode===rd.code)return[2,new lg(this.config,this.performanceClient).acquireTokenByRefreshToken(r)];throw t;case 3:return[2]}})})},fg.prototype.acquireCachedToken=function(r){var o,n;return Ah(this,void 0,void 0,function(){var t;return kh(this,function(e){switch(e.label){case 0:if(!r)throw zd.createEmptyTokenRequestError();if(r.forceRefresh)throw null!==(o=this.serverTelemetryManager)&&void 0!==o&&o.setCacheOutcome(np.FORCE_REFRESH),this.logger.info("SilentFlowClient:acquireCachedToken - Skipping cache because forceRefresh is true."),ud.createRefreshRequiredError();if(!r.account)throw ud.createNoAccountInSilentRequestError();if(t=r.authority||this.authority.getPreferredCache(),!(t=this.cacheManager.readCacheRecord(r.account,this.config.authOptions.clientId,r,t)).accessToken)throw null!==(o=this.serverTelemetryManager)&&void 0!==o&&o.setCacheOutcome(np.NO_CACHED_ACCESS_TOKEN),this.logger.info("SilentFlowClient:acquireCachedToken - No access token found in cache for the given properties."),ud.createRefreshRequiredError();if(Pf.wasClockTurnedBack(t.accessToken.cachedAt)||Pf.isTokenExpired(t.accessToken.expiresOn,this.config.systemOptions.tokenRenewalOffsetSeconds))throw null!==(n=this.serverTelemetryManager)&&void 0!==n&&n.setCacheOutcome(np.CACHED_ACCESS_TOKEN_EXPIRED),this.logger.info("SilentFlowClient:acquireCachedToken - Cached access token is expired or will expire within "+this.config.systemOptions.tokenRenewalOffsetSeconds+" seconds."),ud.createRefreshRequiredError();if(t.accessToken.refreshOn&&Pf.isTokenExpired(t.accessToken.refreshOn,0))throw null!==(n=this.serverTelemetryManager)&&void 0!==n&&n.setCacheOutcome(np.REFRESH_CACHED_ACCESS_TOKEN),this.logger.info("SilentFlowClient:acquireCachedToken - Cached access token's refreshOn property has been exceeded'."),ud.createRefreshRequiredError();return this.config.serverTelemetryManager&&this.config.serverTelemetryManager.incrementCacheHits(),[4,this.generateResultFromCacheRecord(t,r)];case 1:return[2,e.sent()]}})})},fg.prototype.generateResultFromCacheRecord=function(o,n){return Ah(this,void 0,void 0,function(){var t,r;return kh(this,function(e){switch(e.label){case 0:if(o.idToken&&(t=new Qd(o.idToken.secret,this.config.cryptoInterface)),n.maxAge||0===n.maxAge){if(!(r=null==t?void 0:t.claims.auth_time))throw ud.createAuthTimeNotFoundError();Qd.checkMaxAge(r,n.maxAge)}return[4,rg.generateAuthenticationResult(this.cryptoUtils,this.authority,o,!0,n,t)];case 1:return[2,e.sent()]}})})},fg);function fg(e,t){return pg.call(this,e,t)||this}var gg,yg={"https://login.microsoftonline.com/common/":{token_endpoint:"https://login.microsoftonline.com/common/oauth2/v2.0/token",token_endpoint_auth_methods_supported:["client_secret_post","private_key_jwt","client_secret_basic"],jwks_uri:"https://login.microsoftonline.com/common/discovery/v2.0/keys",response_modes_supported:["query","fragment","form_post"],subject_types_supported:["pairwise"],id_token_signing_alg_values_supported:["RS256"],response_types_supported:["code","id_token","code id_token","id_token token"],scopes_supported:["openid","profile","email","offline_access"],issuer:"https://login.microsoftonline.com/{tenantid}/v2.0",request_uri_parameter_supported:!1,userinfo_endpoint:"https://graph.microsoft.com/oidc/userinfo",authorization_endpoint:"https://login.microsoftonline.com/common/oauth2/v2.0/authorize",device_authorization_endpoint:"https://login.microsoftonline.com/common/oauth2/v2.0/devicecode",http_logout_supported:!0,frontchannel_logout_supported:!0,end_session_endpoint:"https://login.microsoftonline.com/common/oauth2/v2.0/logout",claims_supported:["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],kerberos_endpoint:"https://login.microsoftonline.com/common/kerberos",tenant_region_scope:null,cloud_instance_name:"microsoftonline.com",cloud_graph_host_name:"graph.windows.net",msgraph_host:"graph.microsoft.com",rbac_url:"https://pas.windows.net"},"https://login.chinacloudapi.cn/common/":{token_endpoint:"https://login.chinacloudapi.cn/common/oauth2/v2.0/token",token_endpoint_auth_methods_supported:["client_secret_post","private_key_jwt","client_secret_basic"],jwks_uri:"https://login.chinacloudapi.cn/common/discovery/v2.0/keys",response_modes_supported:["query","fragment","form_post"],subject_types_supported:["pairwise"],id_token_signing_alg_values_supported:["RS256"],response_types_supported:["code","id_token","code id_token","id_token token"],scopes_supported:["openid","profile","email","offline_access"],issuer:"https://login.partner.microsoftonline.cn/{tenantid}/v2.0",request_uri_parameter_supported:!1,userinfo_endpoint:"https://microsoftgraph.chinacloudapi.cn/oidc/userinfo",authorization_endpoint:"https://login.chinacloudapi.cn/common/oauth2/v2.0/authorize",device_authorization_endpoint:"https://login.chinacloudapi.cn/common/oauth2/v2.0/devicecode",http_logout_supported:!0,frontchannel_logout_supported:!0,end_session_endpoint:"https://login.chinacloudapi.cn/common/oauth2/v2.0/logout",claims_supported:["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],kerberos_endpoint:"https://login.chinacloudapi.cn/common/kerberos",tenant_region_scope:null,cloud_instance_name:"partner.microsoftonline.cn",cloud_graph_host_name:"graph.chinacloudapi.cn",msgraph_host:"microsoftgraph.chinacloudapi.cn",rbac_url:"https://pas.chinacloudapi.cn"},"https://login.microsoftonline.us/common/":{token_endpoint:"https://login.microsoftonline.us/common/oauth2/v2.0/token",token_endpoint_auth_methods_supported:["client_secret_post","private_key_jwt","client_secret_basic"],jwks_uri:"https://login.microsoftonline.us/common/discovery/v2.0/keys",response_modes_supported:["query","fragment","form_post"],subject_types_supported:["pairwise"],id_token_signing_alg_values_supported:["RS256"],response_types_supported:["code","id_token","code id_token","id_token token"],scopes_supported:["openid","profile","email","offline_access"],issuer:"https://login.microsoftonline.us/{tenantid}/v2.0",request_uri_parameter_supported:!1,userinfo_endpoint:"https://graph.microsoft.com/oidc/userinfo",authorization_endpoint:"https://login.microsoftonline.us/common/oauth2/v2.0/authorize",device_authorization_endpoint:"https://login.microsoftonline.us/common/oauth2/v2.0/devicecode",http_logout_supported:!0,frontchannel_logout_supported:!0,end_session_endpoint:"https://login.microsoftonline.us/common/oauth2/v2.0/logout",claims_supported:["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],kerberos_endpoint:"https://login.microsoftonline.us/common/kerberos",tenant_region_scope:null,cloud_instance_name:"microsoftonline.us",cloud_graph_host_name:"graph.windows.net",msgraph_host:"graph.microsoft.com",rbac_url:"https://pasff.usgovcloudapi.net"},"https://login.microsoftonline.com/consumers/":{token_endpoint:"https://login.microsoftonline.com/consumers/oauth2/v2.0/token",token_endpoint_auth_methods_supported:["client_secret_post","private_key_jwt","client_secret_basic"],jwks_uri:"https://login.microsoftonline.com/consumers/discovery/v2.0/keys",response_modes_supported:["query","fragment","form_post"],subject_types_supported:["pairwise"],id_token_signing_alg_values_supported:["RS256"],response_types_supported:["code","id_token","code id_token","id_token token"],scopes_supported:["openid","profile","email","offline_access"],issuer:"https://login.microsoftonline.com/9188040d-6c67-4c5b-b112-36a304b66dad/v2.0",request_uri_parameter_supported:!1,userinfo_endpoint:"https://graph.microsoft.com/oidc/userinfo",authorization_endpoint:"https://login.microsoftonline.com/consumers/oauth2/v2.0/authorize",device_authorization_endpoint:"https://login.microsoftonline.com/consumers/oauth2/v2.0/devicecode",http_logout_supported:!0,frontchannel_logout_supported:!0,end_session_endpoint:"https://login.microsoftonline.com/consumers/oauth2/v2.0/logout",claims_supported:["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],kerberos_endpoint:"https://login.microsoftonline.com/consumers/kerberos",tenant_region_scope:null,cloud_instance_name:"microsoftonline.com",cloud_graph_host_name:"graph.windows.net",msgraph_host:"graph.microsoft.com",rbac_url:"https://pas.windows.net"},"https://login.chinacloudapi.cn/consumers/":{token_endpoint:"https://login.chinacloudapi.cn/consumers/oauth2/v2.0/token",token_endpoint_auth_methods_supported:["client_secret_post","private_key_jwt","client_secret_basic"],jwks_uri:"https://login.chinacloudapi.cn/consumers/discovery/v2.0/keys",response_modes_supported:["query","fragment","form_post"],subject_types_supported:["pairwise"],id_token_signing_alg_values_supported:["RS256"],response_types_supported:["code","id_token","code id_token","id_token token"],scopes_supported:["openid","profile","email","offline_access"],issuer:"https://login.partner.microsoftonline.cn/9188040d-6c67-4c5b-b112-36a304b66dad/v2.0",request_uri_parameter_supported:!1,userinfo_endpoint:"https://microsoftgraph.chinacloudapi.cn/oidc/userinfo",authorization_endpoint:"https://login.chinacloudapi.cn/consumers/oauth2/v2.0/authorize",device_authorization_endpoint:"https://login.chinacloudapi.cn/consumers/oauth2/v2.0/devicecode",http_logout_supported:!0,frontchannel_logout_supported:!0,end_session_endpoint:"https://login.chinacloudapi.cn/consumers/oauth2/v2.0/logout",claims_supported:["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],kerberos_endpoint:"https://login.chinacloudapi.cn/consumers/kerberos",tenant_region_scope:null,cloud_instance_name:"partner.microsoftonline.cn",cloud_graph_host_name:"graph.chinacloudapi.cn",msgraph_host:"microsoftgraph.chinacloudapi.cn",rbac_url:"https://pas.chinacloudapi.cn"},"https://login.microsoftonline.us/consumers/":{token_endpoint:"https://login.microsoftonline.us/consumers/oauth2/v2.0/token",token_endpoint_auth_methods_supported:["client_secret_post","private_key_jwt","client_secret_basic"],jwks_uri:"https://login.microsoftonline.us/consumers/discovery/v2.0/keys",response_modes_supported:["query","fragment","form_post"],subject_types_supported:["pairwise"],id_token_signing_alg_values_supported:["RS256"],response_types_supported:["code","id_token","code id_token","id_token token"],scopes_supported:["openid","profile","email","offline_access"],issuer:"https://login.microsoftonline.us/9188040d-6c67-4c5b-b112-36a304b66dad/v2.0",request_uri_parameter_supported:!1,userinfo_endpoint:"https://graph.microsoft.com/oidc/userinfo",authorization_endpoint:"https://login.microsoftonline.us/consumers/oauth2/v2.0/authorize",device_authorization_endpoint:"https://login.microsoftonline.us/consumers/oauth2/v2.0/devicecode",http_logout_supported:!0,frontchannel_logout_supported:!0,end_session_endpoint:"https://login.microsoftonline.us/consumers/oauth2/v2.0/logout",claims_supported:["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],kerberos_endpoint:"https://login.microsoftonline.us/consumers/kerberos",tenant_region_scope:null,cloud_instance_name:"microsoftonline.us",cloud_graph_host_name:"graph.windows.net",msgraph_host:"graph.microsoft.com",rbac_url:"https://pasff.usgovcloudapi.net"},"https://login.microsoftonline.com/organizations/":{token_endpoint:"https://login.microsoftonline.com/organizations/oauth2/v2.0/token",token_endpoint_auth_methods_supported:["client_secret_post","private_key_jwt","client_secret_basic"],jwks_uri:"https://login.microsoftonline.com/organizations/discovery/v2.0/keys",response_modes_supported:["query","fragment","form_post"],subject_types_supported:["pairwise"],id_token_signing_alg_values_supported:["RS256"],response_types_supported:["code","id_token","code id_token","id_token token"],scopes_supported:["openid","profile","email","offline_access"],issuer:"https://login.microsoftonline.com/{tenantid}/v2.0",request_uri_parameter_supported:!1,userinfo_endpoint:"https://graph.microsoft.com/oidc/userinfo",authorization_endpoint:"https://login.microsoftonline.com/organizations/oauth2/v2.0/authorize",device_authorization_endpoint:"https://login.microsoftonline.com/organizations/oauth2/v2.0/devicecode",http_logout_supported:!0,frontchannel_logout_supported:!0,end_session_endpoint:"https://login.microsoftonline.com/organizations/oauth2/v2.0/logout",claims_supported:["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],kerberos_endpoint:"https://login.microsoftonline.com/organizations/kerberos",tenant_region_scope:null,cloud_instance_name:"microsoftonline.com",cloud_graph_host_name:"graph.windows.net",msgraph_host:"graph.microsoft.com",rbac_url:"https://pas.windows.net"},"https://login.chinacloudapi.cn/organizations/":{token_endpoint:"https://login.chinacloudapi.cn/organizations/oauth2/v2.0/token",token_endpoint_auth_methods_supported:["client_secret_post","private_key_jwt","client_secret_basic"],jwks_uri:"https://login.chinacloudapi.cn/organizations/discovery/v2.0/keys",response_modes_supported:["query","fragment","form_post"],subject_types_supported:["pairwise"],id_token_signing_alg_values_supported:["RS256"],response_types_supported:["code","id_token","code id_token","id_token token"],scopes_supported:["openid","profile","email","offline_access"],issuer:"https://login.partner.microsoftonline.cn/{tenantid}/v2.0",request_uri_parameter_supported:!1,userinfo_endpoint:"https://microsoftgraph.chinacloudapi.cn/oidc/userinfo",authorization_endpoint:"https://login.chinacloudapi.cn/organizations/oauth2/v2.0/authorize",device_authorization_endpoint:"https://login.chinacloudapi.cn/organizations/oauth2/v2.0/devicecode",http_logout_supported:!0,frontchannel_logout_supported:!0,end_session_endpoint:"https://login.chinacloudapi.cn/organizations/oauth2/v2.0/logout",claims_supported:["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],kerberos_endpoint:"https://login.chinacloudapi.cn/organizations/kerberos",tenant_region_scope:null,cloud_instance_name:"partner.microsoftonline.cn",cloud_graph_host_name:"graph.chinacloudapi.cn",msgraph_host:"microsoftgraph.chinacloudapi.cn",rbac_url:"https://pas.chinacloudapi.cn"},"https://login.microsoftonline.us/organizations/":{token_endpoint:"https://login.microsoftonline.us/organizations/oauth2/v2.0/token",token_endpoint_auth_methods_supported:["client_secret_post","private_key_jwt","client_secret_basic"],jwks_uri:"https://login.microsoftonline.us/organizations/discovery/v2.0/keys",response_modes_supported:["query","fragment","form_post"],subject_types_supported:["pairwise"],id_token_signing_alg_values_supported:["RS256"],response_types_supported:["code","id_token","code id_token","id_token token"],scopes_supported:["openid","profile","email","offline_access"],issuer:"https://login.microsoftonline.us/{tenantid}/v2.0",request_uri_parameter_supported:!1,userinfo_endpoint:"https://graph.microsoft.com/oidc/userinfo",authorization_endpoint:"https://login.microsoftonline.us/organizations/oauth2/v2.0/authorize",device_authorization_endpoint:"https://login.microsoftonline.us/organizations/oauth2/v2.0/devicecode",http_logout_supported:!0,frontchannel_logout_supported:!0,end_session_endpoint:"https://login.microsoftonline.us/organizations/oauth2/v2.0/logout",claims_supported:["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],kerberos_endpoint:"https://login.microsoftonline.us/organizations/kerberos",tenant_region_scope:null,cloud_instance_name:"microsoftonline.us",cloud_graph_host_name:"graph.windows.net",msgraph_host:"graph.microsoft.com",rbac_url:"https://pasff.usgovcloudapi.net"}},mg={"https://login.microsoftonline.com/common/":{tenant_discovery_endpoint:"https://login.microsoftonline.com/common/v2.0/.well-known/openid-configuration","api-version":"1.1",metadata:[{preferred_network:"login.microsoftonline.com",preferred_cache:"login.windows.net",aliases:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{preferred_network:"login.partner.microsoftonline.cn",preferred_cache:"login.partner.microsoftonline.cn",aliases:["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{preferred_network:"login.microsoftonline.de",preferred_cache:"login.microsoftonline.de",aliases:["login.microsoftonline.de"]},{preferred_network:"login.microsoftonline.us",preferred_cache:"login.microsoftonline.us",aliases:["login.microsoftonline.us","login.usgovcloudapi.net"]},{preferred_network:"login-us.microsoftonline.com",preferred_cache:"login-us.microsoftonline.com",aliases:["login-us.microsoftonline.com"]}]},"https://login.chinacloudapi.cn/common/":{tenant_discovery_endpoint:"https://login.chinacloudapi.cn/common/v2.0/.well-known/openid-configuration","api-version":"1.1",metadata:[{preferred_network:"login.microsoftonline.com",preferred_cache:"login.windows.net",aliases:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{preferred_network:"login.partner.microsoftonline.cn",preferred_cache:"login.partner.microsoftonline.cn",aliases:["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{preferred_network:"login.microsoftonline.de",preferred_cache:"login.microsoftonline.de",aliases:["login.microsoftonline.de"]},{preferred_network:"login.microsoftonline.us",preferred_cache:"login.microsoftonline.us",aliases:["login.microsoftonline.us","login.usgovcloudapi.net"]},{preferred_network:"login-us.microsoftonline.com",preferred_cache:"login-us.microsoftonline.com",aliases:["login-us.microsoftonline.com"]}]},"https://login.microsoftonline.us/common/":{tenant_discovery_endpoint:"https://login.microsoftonline.us/common/v2.0/.well-known/openid-configuration","api-version":"1.1",metadata:[{preferred_network:"login.microsoftonline.com",preferred_cache:"login.windows.net",aliases:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{preferred_network:"login.partner.microsoftonline.cn",preferred_cache:"login.partner.microsoftonline.cn",aliases:["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{preferred_network:"login.microsoftonline.de",preferred_cache:"login.microsoftonline.de",aliases:["login.microsoftonline.de"]},{preferred_network:"login.microsoftonline.us",preferred_cache:"login.microsoftonline.us",aliases:["login.microsoftonline.us","login.usgovcloudapi.net"]},{preferred_network:"login-us.microsoftonline.com",preferred_cache:"login-us.microsoftonline.com",aliases:["login-us.microsoftonline.com"]}]},"https://login.microsoftonline.com/consumers/":{tenant_discovery_endpoint:"https://login.microsoftonline.com/consumers/v2.0/.well-known/openid-configuration","api-version":"1.1",metadata:[{preferred_network:"login.microsoftonline.com",preferred_cache:"login.windows.net",aliases:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{preferred_network:"login.partner.microsoftonline.cn",preferred_cache:"login.partner.microsoftonline.cn",aliases:["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{preferred_network:"login.microsoftonline.de",preferred_cache:"login.microsoftonline.de",aliases:["login.microsoftonline.de"]},{preferred_network:"login.microsoftonline.us",preferred_cache:"login.microsoftonline.us",aliases:["login.microsoftonline.us","login.usgovcloudapi.net"]},{preferred_network:"login-us.microsoftonline.com",preferred_cache:"login-us.microsoftonline.com",aliases:["login-us.microsoftonline.com"]}]},"https://login.chinacloudapi.cn/consumers/":{tenant_discovery_endpoint:"https://login.chinacloudapi.cn/consumers/v2.0/.well-known/openid-configuration","api-version":"1.1",metadata:[{preferred_network:"login.microsoftonline.com",preferred_cache:"login.windows.net",aliases:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{preferred_network:"login.partner.microsoftonline.cn",preferred_cache:"login.partner.microsoftonline.cn",aliases:["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{preferred_network:"login.microsoftonline.de",preferred_cache:"login.microsoftonline.de",aliases:["login.microsoftonline.de"]},{preferred_network:"login.microsoftonline.us",preferred_cache:"login.microsoftonline.us",aliases:["login.microsoftonline.us","login.usgovcloudapi.net"]},{preferred_network:"login-us.microsoftonline.com",preferred_cache:"login-us.microsoftonline.com",aliases:["login-us.microsoftonline.com"]}]},"https://login.microsoftonline.us/consumers/":{tenant_discovery_endpoint:"https://login.microsoftonline.us/consumers/v2.0/.well-known/openid-configuration","api-version":"1.1",metadata:[{preferred_network:"login.microsoftonline.com",preferred_cache:"login.windows.net",aliases:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{preferred_network:"login.partner.microsoftonline.cn",preferred_cache:"login.partner.microsoftonline.cn",aliases:["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{preferred_network:"login.microsoftonline.de",preferred_cache:"login.microsoftonline.de",aliases:["login.microsoftonline.de"]},{preferred_network:"login.microsoftonline.us",preferred_cache:"login.microsoftonline.us",aliases:["login.microsoftonline.us","login.usgovcloudapi.net"]},{preferred_network:"login-us.microsoftonline.com",preferred_cache:"login-us.microsoftonline.com",aliases:["login-us.microsoftonline.com"]}]},"https://login.microsoftonline.com/organizations/":{tenant_discovery_endpoint:"https://login.microsoftonline.com/organizations/v2.0/.well-known/openid-configuration","api-version":"1.1",metadata:[{preferred_network:"login.microsoftonline.com",preferred_cache:"login.windows.net",aliases:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{preferred_network:"login.partner.microsoftonline.cn",preferred_cache:"login.partner.microsoftonline.cn",aliases:["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{preferred_network:"login.microsoftonline.de",preferred_cache:"login.microsoftonline.de",aliases:["login.microsoftonline.de"]},{preferred_network:"login.microsoftonline.us",preferred_cache:"login.microsoftonline.us",aliases:["login.microsoftonline.us","login.usgovcloudapi.net"]},{preferred_network:"login-us.microsoftonline.com",preferred_cache:"login-us.microsoftonline.com",aliases:["login-us.microsoftonline.com"]}]},"https://login.chinacloudapi.cn/organizations/":{tenant_discovery_endpoint:"https://login.chinacloudapi.cn/organizations/v2.0/.well-known/openid-configuration","api-version":"1.1",metadata:[{preferred_network:"login.microsoftonline.com",preferred_cache:"login.windows.net",aliases:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{preferred_network:"login.partner.microsoftonline.cn",preferred_cache:"login.partner.microsoftonline.cn",aliases:["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{preferred_network:"login.microsoftonline.de",preferred_cache:"login.microsoftonline.de",aliases:["login.microsoftonline.de"]},{preferred_network:"login.microsoftonline.us",preferred_cache:"login.microsoftonline.us",aliases:["login.microsoftonline.us","login.usgovcloudapi.net"]},{preferred_network:"login-us.microsoftonline.com",preferred_cache:"login-us.microsoftonline.com",aliases:["login-us.microsoftonline.com"]}]},"https://login.microsoftonline.us/organizations/":{tenant_discovery_endpoint:"https://login.microsoftonline.us/organizations/v2.0/.well-known/openid-configuration","api-version":"1.1",metadata:[{preferred_network:"login.microsoftonline.com",preferred_cache:"login.windows.net",aliases:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{preferred_network:"login.partner.microsoftonline.cn",preferred_cache:"login.partner.microsoftonline.cn",aliases:["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{preferred_network:"login.microsoftonline.de",preferred_cache:"login.microsoftonline.de",aliases:["login.microsoftonline.de"]},{preferred_network:"login.microsoftonline.us",preferred_cache:"login.microsoftonline.us",aliases:["login.microsoftonline.us","login.usgovcloudapi.net"]},{preferred_network:"login-us.microsoftonline.com",preferred_cache:"login-us.microsoftonline.com",aliases:["login-us.microsoftonline.com"]}]}};(o=gg=gg||{}).AAD="AAD",o.OIDC="OIDC";var vg=(_g.prototype.updateCloudDiscoveryMetadata=function(e,t){this.aliases=e.aliases,this.preferred_cache=e.preferred_cache,this.preferred_network=e.preferred_network,this.aliasesFromNetwork=t},_g.prototype.updateEndpointMetadata=function(e,t){this.authorization_endpoint=e.authorization_endpoint,this.token_endpoint=e.token_endpoint,this.end_session_endpoint=e.end_session_endpoint,this.issuer=e.issuer,this.endpointsFromNetwork=t,this.jwks_uri=e.jwks_uri},_g.prototype.updateCanonicalAuthority=function(e){this.canonical_authority=e},_g.prototype.resetExpiresAt=function(){this.expiresAt=Pf.nowSeconds()+Qh},_g.prototype.isExpired=function(){return this.expiresAt<=Pf.nowSeconds()},_g.isAuthorityMetadataEntity=function(e,t){return!!t&&(0===e.indexOf(Jh)&&t.hasOwnProperty("aliases")&&t.hasOwnProperty("preferred_cache")&&t.hasOwnProperty("preferred_network")&&t.hasOwnProperty("canonical_authority")&&t.hasOwnProperty("authorization_endpoint")&&t.hasOwnProperty("token_endpoint")&&t.hasOwnProperty("issuer")&&t.hasOwnProperty("aliasesFromNetwork")&&t.hasOwnProperty("endpointsFromNetwork")&&t.hasOwnProperty("expiresAt")&&t.hasOwnProperty("jwks_uri"))},_g);function _g(){this.expiresAt=Pf.nowSeconds()+Qh}var wg=(bg.prototype.detectRegion=function(i,s,a){return Ah(this,void 0,void 0,function(){var t,r,o,n;return kh(this,function(e){switch(e.label){case 0:if(t=i)return[3,8];r=bg.IMDS_OPTIONS,a&&(r.proxyUrl=a),e.label=1;case 1:return e.trys.push([1,6,,7]),[4,this.getRegionFromIMDS(Lh.IMDS_VERSION,r)];case 2:return(o=e.sent()).status===tp.httpSuccess&&(t=o.body,s.region_source=rp.IMDS),o.status!==tp.httpBadRequest?[3,5]:[4,this.getCurrentVersion(r)];case 3:return(n=e.sent())?[4,this.getRegionFromIMDS(n,r)]:(s.region_source=rp.FAILED_AUTO_DETECTION,[2,null]);case 4:(n=e.sent()).status===tp.httpSuccess&&(t=n.body,s.region_source=rp.IMDS),e.label=5;case 5:return[3,7];case 6:return e.sent(),s.region_source=rp.FAILED_AUTO_DETECTION,[2,null];case 7:return[3,9];case 8:s.region_source=rp.ENVIRONMENT_VARIABLE,e.label=9;case 9:return t||(s.region_source=rp.FAILED_AUTO_DETECTION),[2,t||null]}})})},bg.prototype.getRegionFromIMDS=function(t,r){return Ah(this,void 0,void 0,function(){return kh(this,function(e){return[2,this.networkInterface.sendGetRequestAsync(Lh.IMDS_ENDPOINT+"?api-version="+t+"&format=text",r,Lh.IMDS_TIMEOUT)]})})},bg.prototype.getCurrentVersion=function(r){return Ah(this,void 0,void 0,function(){var t;return kh(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,this.networkInterface.sendGetRequestAsync(Lh.IMDS_ENDPOINT+"?format=json",r)];case 1:return(t=e.sent()).status===tp.httpBadRequest&&t.body&&t.body["newest-versions"]&&0<t.body["newest-versions"].length?[2,t.body["newest-versions"][0]]:[2,null];case 2:return e.sent(),[2,null];case 3:return[2]}})})},bg.IMDS_OPTIONS={headers:{Metadata:"true"}},bg);function bg(e){this.networkInterface=e}var Cg=(Object.defineProperty(Eg.prototype,"authorityType",{get:function(){var e=this.canonicalAuthorityUrlComponents.PathSegments;if(e.length)switch(e[0].toLowerCase()){case Lh.ADFS:return Kd.Adfs;case Lh.DSTS:return Kd.Dsts}return Kd.Default},enumerable:!1,configurable:!0}),Object.defineProperty(Eg.prototype,"protocolMode",{get:function(){return this.authorityOptions.protocolMode},enumerable:!1,configurable:!0}),Object.defineProperty(Eg.prototype,"options",{get:function(){return this.authorityOptions},enumerable:!1,configurable:!0}),Object.defineProperty(Eg.prototype,"canonicalAuthority",{get:function(){return this._canonicalAuthority.urlString},set:function(e){this._canonicalAuthority=new Wf(e),this._canonicalAuthority.validateAsUri(),this._canonicalAuthorityUrlComponents=null},enumerable:!1,configurable:!0}),Object.defineProperty(Eg.prototype,"canonicalAuthorityUrlComponents",{get:function(){return this._canonicalAuthorityUrlComponents||(this._canonicalAuthorityUrlComponents=this._canonicalAuthority.getUrlComponents()),this._canonicalAuthorityUrlComponents},enumerable:!1,configurable:!0}),Object.defineProperty(Eg.prototype,"hostnameAndPort",{get:function(){return this.canonicalAuthorityUrlComponents.HostNameAndPort.toLowerCase()},enumerable:!1,configurable:!0}),Object.defineProperty(Eg.prototype,"tenant",{get:function(){return this.canonicalAuthorityUrlComponents.PathSegments[0]},enumerable:!1,configurable:!0}),Object.defineProperty(Eg.prototype,"authorizationEndpoint",{get:function(){if(this.discoveryComplete()){var e=this.replacePath(this.metadata.authorization_endpoint);return this.replaceTenant(e)}throw ud.createEndpointDiscoveryIncompleteError("Discovery incomplete.")},enumerable:!1,configurable:!0}),Object.defineProperty(Eg.prototype,"tokenEndpoint",{get:function(){if(this.discoveryComplete()){var e=this.replacePath(this.metadata.token_endpoint);return this.replaceTenant(e)}throw ud.createEndpointDiscoveryIncompleteError("Discovery incomplete.")},enumerable:!1,configurable:!0}),Object.defineProperty(Eg.prototype,"deviceCodeEndpoint",{get:function(){if(this.discoveryComplete()){var e=this.replacePath(this.metadata.token_endpoint.replace("/token","/devicecode"));return this.replaceTenant(e)}throw ud.createEndpointDiscoveryIncompleteError("Discovery incomplete.")},enumerable:!1,configurable:!0}),Object.defineProperty(Eg.prototype,"endSessionEndpoint",{get:function(){if(this.discoveryComplete()){if(!this.metadata.end_session_endpoint)throw ud.createLogoutNotSupportedError();var e=this.replacePath(this.metadata.end_session_endpoint);return this.replaceTenant(e)}throw ud.createEndpointDiscoveryIncompleteError("Discovery incomplete.")},enumerable:!1,configurable:!0}),Object.defineProperty(Eg.prototype,"selfSignedJwtAudience",{get:function(){if(this.discoveryComplete()){var e=this.replacePath(this.metadata.issuer);return this.replaceTenant(e)}throw ud.createEndpointDiscoveryIncompleteError("Discovery incomplete.")},enumerable:!1,configurable:!0}),Object.defineProperty(Eg.prototype,"jwksUri",{get:function(){if(this.discoveryComplete()){var e=this.replacePath(this.metadata.jwks_uri);return this.replaceTenant(e)}throw ud.createEndpointDiscoveryIncompleteError("Discovery incomplete.")},enumerable:!1,configurable:!0}),Eg.prototype.replaceTenant=function(e){return e.replace(/{tenant}|{tenantid}/g,this.tenant)},Eg.prototype.replacePath=function(e){var r=e,o=new Wf(this.metadata.canonical_authority).getUrlComponents().PathSegments;return this.canonicalAuthorityUrlComponents.PathSegments.forEach(function(e,t){t=o[t];e!==t&&(r=r.replace("/"+t+"/","/"+e+"/"))}),r},Object.defineProperty(Eg.prototype,"defaultOpenIdConfigurationEndpoint",{get:function(){return this.authorityType===Kd.Adfs||this.authorityType===Kd.Dsts||this.protocolMode===gg.OIDC?this.canonicalAuthority+".well-known/openid-configuration":this.canonicalAuthority+"v2.0/.well-known/openid-configuration"},enumerable:!1,configurable:!0}),Eg.prototype.discoveryComplete=function(){return!!this.metadata},Eg.prototype.resolveEndpointsAsync=function(){return Ah(this,void 0,void 0,function(){var t,r,o;return kh(this,function(e){switch(e.label){case 0:return(t=this.cacheManager.getAuthorityMetadataByAlias(this.hostnameAndPort))||(t=new vg).updateCanonicalAuthority(this.canonicalAuthority),[4,this.updateCloudDiscoveryMetadata(t)];case 1:return r=e.sent(),this.canonicalAuthority=this.canonicalAuthority.replace(this.hostnameAndPort,t.preferred_network),[4,this.updateEndpointMetadata(t)];case 2:return o=e.sent(),r!==Wh.CACHE&&o!==Wh.CACHE&&(t.resetExpiresAt(),t.updateCanonicalAuthority(this.canonicalAuthority)),o=this.cacheManager.generateAuthorityMetadataCacheKey(t.preferred_cache),this.cacheManager.setAuthorityMetadata(o,t),this.metadata=t,[2]}})})},Eg.prototype.updateEndpointMetadata=function(o){var n;return Ah(this,void 0,void 0,function(){var t,r;return kh(this,function(e){switch(e.label){case 0:return(t=this.getEndpointMetadataFromConfig())?(o.updateEndpointMetadata(t,!1),[2,Wh.CONFIG]):this.isAuthoritySameType(o)&&o.endpointsFromNetwork&&!o.isExpired()?[2,Wh.CACHE]:(r=this.getEndpointMetadataFromHardcodedValues(),[4,this.getEndpointMetadataFromNetwork()]);case 1:return(t=e.sent())?null!==(n=this.authorityOptions.azureRegionConfiguration)&&void 0!==n&&n.azureRegion?[4,this.updateMetadataWithRegionalInformation(t)]:[3,3]:[3,4];case 2:t=e.sent(),e.label=3;case 3:return o.updateEndpointMetadata(t,!0),[2,Wh.NETWORK];case 4:return!r||this.authorityOptions.skipAuthorityMetadataCache?[3,7]:null!==(n=this.authorityOptions.azureRegionConfiguration)&&void 0!==n&&n.azureRegion?[4,this.updateMetadataWithRegionalInformation(r)]:[3,6];case 5:r=e.sent(),e.label=6;case 6:return o.updateEndpointMetadata(r,!1),[2,Wh.HARDCODED_VALUES];case 7:throw ud.createUnableToGetOpenidConfigError(this.defaultOpenIdConfigurationEndpoint)}})})},Eg.prototype.isAuthoritySameType=function(e){return new Wf(e.canonical_authority).getUrlComponents().PathSegments.length===this.canonicalAuthorityUrlComponents.PathSegments.length},Eg.prototype.getEndpointMetadataFromConfig=function(){if(this.authorityOptions.authorityMetadata)try{return JSON.parse(this.authorityOptions.authorityMetadata)}catch(e){throw zd.createInvalidAuthorityMetadataError()}return null},Eg.prototype.getEndpointMetadataFromNetwork=function(){return Ah(this,void 0,void 0,function(){var r,o;return kh(this,function(e){switch(e.label){case 0:r={},this.proxyUrl&&(r.proxyUrl=this.proxyUrl),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,this.networkInterface.sendGetRequestAsync(this.defaultOpenIdConfigurationEndpoint,r)];case 2:return o=e.sent(),[2,(t=o.body).hasOwnProperty("authorization_endpoint")&&t.hasOwnProperty("token_endpoint")&&t.hasOwnProperty("issuer")&&t.hasOwnProperty("jwks_uri")?o.body:null];case 3:return e.sent(),[2,null];case 4:return[2]}var t})})},Eg.prototype.getEndpointMetadataFromHardcodedValues=function(){return this.canonicalAuthority in yg?yg[this.canonicalAuthority]:null},Eg.prototype.updateMetadataWithRegionalInformation=function(o){var n,i;return Ah(this,void 0,void 0,function(){var t,r;return kh(this,function(e){switch(e.label){case 0:return[4,this.regionDiscovery.detectRegion(null===(n=this.authorityOptions.azureRegionConfiguration)||void 0===n?void 0:n.environmentRegion,this.regionDiscoveryMetadata,this.proxyUrl)];case 1:return t=e.sent(),r=(null===(n=this.authorityOptions.azureRegionConfiguration)||void 0===n?void 0:n.azureRegion)===Lh.AZURE_REGION_AUTO_DISCOVER_FLAG?t:null===(i=this.authorityOptions.azureRegionConfiguration)||void 0===i?void 0:i.azureRegion,(null===(i=this.authorityOptions.azureRegionConfiguration)||void 0===i?void 0:i.azureRegion)===Lh.AZURE_REGION_AUTO_DISCOVER_FLAG?this.regionDiscoveryMetadata.region_outcome=t?op.AUTO_DETECTION_REQUESTED_SUCCESSFUL:op.AUTO_DETECTION_REQUESTED_FAILED:this.regionDiscoveryMetadata.region_outcome=t?(null===(i=this.authorityOptions.azureRegionConfiguration)||void 0===i?void 0:i.azureRegion)===t?op.CONFIGURED_MATCHES_DETECTED:op.CONFIGURED_NOT_DETECTED:op.CONFIGURED_NO_AUTO_DETECTION,r?(this.regionDiscoveryMetadata.region_used=r,[2,Eg.replaceWithRegionalInformation(o,r)]):[2,o]}})})},Eg.prototype.updateCloudDiscoveryMetadata=function(o){return Ah(this,void 0,void 0,function(){var t,r;return kh(this,function(e){switch(e.label){case 0:return(this.logger.verbose("Attempting to get cloud discovery metadata in the config"),this.logger.verbosePii("Known Authorities: "+(this.authorityOptions.knownAuthorities||Lh.NOT_APPLICABLE)),this.logger.verbosePii("Authority Metadata: "+(this.authorityOptions.authorityMetadata||Lh.NOT_APPLICABLE)),this.logger.verbosePii("Canonical Authority: "+(o.canonical_authority||Lh.NOT_APPLICABLE)),t=this.getCloudDiscoveryMetadataFromConfig())?(this.logger.verbose("Found cloud discovery metadata in the config."),o.updateCloudDiscoveryMetadata(t,!1),[2,Wh.CONFIG]):(this.logger.verbose("Did not find cloud discovery metadata in the config... Attempting to get cloud discovery metadata from the cache."),r=o.isExpired(),this.isAuthoritySameType(o)&&o.aliasesFromNetwork&&!r?(this.logger.verbose("Found metadata in the cache."),[2,Wh.CACHE]):(r&&this.logger.verbose("The metadata entity is expired."),this.logger.verbose("Did not find cloud discovery metadata in the cache... Attempting to get cloud discovery metadata from the network."),[4,this.getCloudDiscoveryMetadataFromNetwork()]));case 1:if(t=e.sent())return this.logger.verbose("cloud discovery metadata was successfully returned from getCloudDiscoveryMetadataFromNetwork()"),o.updateCloudDiscoveryMetadata(t,!0),[2,Wh.NETWORK];if(this.logger.verbose("Did not find cloud discovery metadata from the network... Attempting to get cloud discovery metadata from hardcoded values."),(r=this.getCloudDiscoveryMetadataFromHarcodedValues())&&!this.options.skipAuthorityMetadataCache)return this.logger.verbose("Found cloud discovery metadata from hardcoded values."),o.updateCloudDiscoveryMetadata(r,!1),[2,Wh.HARDCODED_VALUES];throw this.logger.error("Did not find cloud discovery metadata from hardcoded values... Metadata could not be obtained from config, cache, network or hardcoded values. Throwing Untrusted Authority Error."),zd.createUntrustedAuthorityError()}})})},Eg.prototype.getCloudDiscoveryMetadataFromConfig=function(){if(this.authorityOptions.cloudDiscoveryMetadata){this.logger.verbose("The cloud discovery metadata has been provided as a network response, in the config.");try{this.logger.verbose("Attempting to parse the cloud discovery metadata.");var e=JSON.parse(this.authorityOptions.cloudDiscoveryMetadata),t=Eg.getCloudDiscoveryMetadataFromNetworkResponse(e.metadata,this.hostnameAndPort);if(this.logger.verbose("Parsed the cloud discovery metadata."),t)return this.logger.verbose("There is returnable metadata attached to the parsed cloud discovery metadata."),t;this.logger.verbose("There is no metadata attached to the parsed cloud discovery metadata.")}catch(e){throw this.logger.verbose("Unable to parse the cloud discovery metadata. Throwing Invalid Cloud Discovery Metadata Error."),zd.createInvalidCloudDiscoveryMetadataError()}}return this.isInKnownAuthorities()?(this.logger.verbose("The host is included in knownAuthorities. Creating new cloud discovery metadata from the host."),Eg.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort)):null},Eg.prototype.getCloudDiscoveryMetadataFromNetwork=function(){return Ah(this,void 0,void 0,function(){var r,o,n,i,s,a;return kh(this,function(e){switch(e.label){case 0:r=""+Lh.AAD_INSTANCE_DISCOVERY_ENDPT+this.canonicalAuthority+"oauth2/v2.0/authorize",o={},this.proxyUrl&&(o.proxyUrl=this.proxyUrl),n=null,e.label=1;case 1:return e.trys.push([1,3,,4]),[4,this.networkInterface.sendGetRequestAsync(r,o)];case 2:if(i=e.sent(),a=s=void 0,(t=i.body).hasOwnProperty("tenant_discovery_endpoint")&&t.hasOwnProperty("metadata"))s=i.body,a=s.metadata,this.logger.verbosePii("tenant_discovery_endpoint is: "+s.tenant_discovery_endpoint);else{if(!(t=i.body).hasOwnProperty("error")||!t.hasOwnProperty("error_description"))return this.logger.error("AAD did not return a CloudInstanceDiscoveryResponse or CloudInstanceDiscoveryErrorResponse"),[2,null];if(this.logger.warning("A CloudInstanceDiscoveryErrorResponse was returned. The cloud instance discovery network request's status code is: "+i.status),(s=i.body).error===Lh.INVALID_INSTANCE)return this.logger.error("The CloudInstanceDiscoveryErrorResponse error is invalid_instance."),[2,null];this.logger.warning("The CloudInstanceDiscoveryErrorResponse error is "+s.error),this.logger.warning("The CloudInstanceDiscoveryErrorResponse error description is "+s.error_description),this.logger.warning("Setting the value of the CloudInstanceDiscoveryMetadata (returned from the network) to []"),a=[]}return this.logger.verbose("Attempting to find a match between the developer's authority and the CloudInstanceDiscoveryMetadata returned from the network request."),n=Eg.getCloudDiscoveryMetadataFromNetworkResponse(a,this.hostnameAndPort),[3,4];case 3:return(a=e.sent())instanceof gp?this.logger.error("There was a network error while attempting to get the cloud discovery instance metadata.\nError: "+a.errorCode+"\nError Description: "+a.errorMessage):this.logger.error("A non-MSALJS error was thrown while attempting to get the cloud instance discovery metadata.\nError: "+a.name+"\nError Description: "+a.message),[2,null];case 4:return n||(this.logger.warning("The developer's authority was not found within the CloudInstanceDiscoveryMetadata returned from the network request."),this.logger.verbose("Creating custom Authority for custom domain scenario."),n=Eg.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort)),[2,n]}var t})})},Eg.prototype.getCloudDiscoveryMetadataFromHarcodedValues=function(){return this.canonicalAuthority in mg?mg[this.canonicalAuthority]:null},Eg.prototype.isInKnownAuthorities=function(){var t=this;return 0<this.authorityOptions.knownAuthorities.filter(function(e){return Wf.getDomainFromUrl(e).toLowerCase()===t.hostnameAndPort}).length},Eg.generateAuthority=function(e,t){var r;return t&&t.azureCloudInstance!==yd.None&&(r=t.tenant||Lh.DEFAULT_COMMON_TENANT,r=t.azureCloudInstance+"/"+r+"/"),r||e},Eg.createCloudDiscoveryMetadataFromHost=function(e){return{preferred_network:e,preferred_cache:e,aliases:[e]}},Eg.getCloudDiscoveryMetadataFromNetworkResponse=function(e,t){for(var r=0;r<e.length;r++){var o=e[r];if(-1<o.aliases.indexOf(t))return o}return null},Eg.prototype.getPreferredCache=function(){if(this.discoveryComplete())return this.metadata.preferred_cache;throw ud.createEndpointDiscoveryIncompleteError("Discovery incomplete.")},Eg.prototype.isAlias=function(e){return-1<this.metadata.aliases.indexOf(e)},Eg.isPublicCloudAuthority=function(e){return 0<=Lh.KNOWN_PUBLIC_CLOUDS.indexOf(e)},Eg.buildRegionalAuthorityString=function(e,t,r){var o=new Wf(e);o.validateAsUri();var n=o.getUrlComponents(),e=t+"."+n.HostNameAndPort;this.isPublicCloudAuthority(n.HostNameAndPort)&&(e=t+"."+Lh.REGIONAL_AUTH_PUBLIC_CLOUD_SUFFIX);e=Wf.constructAuthorityUriFromObject(Ih(Ih({},o.getUrlComponents()),{HostNameAndPort:e})).urlString;return r?e+"?"+r:e},Eg.replaceWithRegionalInformation=function(e,t){return e.authorization_endpoint=Eg.buildRegionalAuthorityString(e.authorization_endpoint,t),e.token_endpoint=Eg.buildRegionalAuthorityString(e.token_endpoint,t,Lh.REGIONAL_AUTH_NON_MSI_QUERY_STRING),e.end_session_endpoint&&(e.end_session_endpoint=Eg.buildRegionalAuthorityString(e.end_session_endpoint,t)),e},Eg);function Eg(e,t,r,o,n,i){this.canonicalAuthority=e,this._canonicalAuthority.validateAsUri(),this.networkInterface=t,this.cacheManager=r,this.authorityOptions=o,this.regionDiscovery=new wg(t),this.regionDiscoveryMetadata={region_used:void 0,region_source:void 0,region_outcome:void 0},this.proxyUrl=i||Lh.EMPTY_STRING,this.logger=n}var Sg=(Tg.createDiscoveredInstance=function(o,n,i,s,a,c){return Ah(this,void 0,void 0,function(){var t,r;return kh(this,function(e){switch(e.label){case 0:t=Tg.createInstance(o,n,i,s,a,c),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,t.resolveEndpointsAsync()];case 2:return e.sent(),[2,t];case 3:throw r=e.sent(),ud.createEndpointDiscoveryIncompleteError(r);case 4:return[2]}})})},Tg.createInstance=function(e,t,r,o,n,i){if(pd.isEmpty(e))throw zd.createUrlEmptyError();return new Cg(e,t,r,o,n,i)},Tg);function Tg(){}var Ig=(Ag.isServerTelemetryEntity=function(e,t){var r=0===e.indexOf($h.CACHE_KEY),e=!0;return t&&(e=t.hasOwnProperty("failedRequests")&&t.hasOwnProperty("errors")&&t.hasOwnProperty("cacheHits")),r&&e},Ag);function Ag(){this.failedRequests=[],this.errors=[],this.cacheHits=0}var kg=(Pg.isThrottlingEntity=function(e,t){var r=!1;e&&(r=0===e.indexOf(cp));e=!0;return t&&(e=t.hasOwnProperty("throttleTime")),r&&e},Pg);function Pg(){}var Og,Rg={sendGetRequestAsync:function(){return Promise.reject(gp.createUnexpectedError("Network interface - sendGetRequestAsync() has not been implemented for the Network interface."))},sendPostRequestAsync:function(){return Promise.reject(gp.createUnexpectedError("Network interface - sendPostRequestAsync() has not been implemented for the Network interface."))}},xg={code:"missing_kid_error",desc:"The JOSE Header for the requested JWT, JWS or JWK object requires a keyId to be configured as the 'kid' header claim. No 'kid' value was provided."},Mg={code:"missing_alg_error",desc:"The JOSE Header for the requested JWT, JWS or JWK object requires an algorithm to be specified as the 'alg' header claim. No 'alg' value was provided."},Ng=(Th(Lg,Og=gp),Lg.createMissingKidError=function(){return new Lg(xg.code,xg.desc)},Lg.createMissingAlgError=function(){return new Lg(Mg.code,Mg.desc)},Lg);function Lg(e,t){t=Og.call(this,e,t)||this;return t.name="JoseHeaderError",Object.setPrototypeOf(t,Lg.prototype),t}var Dg=(qg.getShrHeaderString=function(e){if(!e.kid)throw Ng.createMissingKidError();if(!e.alg)throw Ng.createMissingAlgError();e=new qg({typ:e.typ||ip.Jwt,kid:e.kid,alg:e.alg});return JSON.stringify(e)},qg);function qg(e){this.typ=e.typ,this.alg=e.alg,this.kid=e.kid}var Ug=(jg.prototype.generateCurrentRequestHeaderValue=function(){var e=""+this.apiId+$h.VALUE_SEPARATOR+this.cacheOutcome,t=[this.wrapperSKU,this.wrapperVer].join($h.VALUE_SEPARATOR),e=[e,this.getRegionDiscoveryFields()].join($h.VALUE_SEPARATOR);return[$h.SCHEMA_VERSION,e,t].join($h.CATEGORY_SEPARATOR)},jg.prototype.generateLastRequestHeaderValue=function(){var e=this.getLastRequests(),t=jg.maxErrorsToSend(e),r=e.failedRequests.slice(0,2*t).join($h.VALUE_SEPARATOR),o=e.errors.slice(0,t).join($h.VALUE_SEPARATOR),n=e.errors.length,n=[n,t<n?$h.OVERFLOW_TRUE:$h.OVERFLOW_FALSE].join($h.VALUE_SEPARATOR);return[$h.SCHEMA_VERSION,e.cacheHits,r,o,n].join($h.CATEGORY_SEPARATOR)},jg.prototype.cacheFailedRequest=function(e){var t=this.getLastRequests();t.errors.length>=$h.MAX_CACHED_ERRORS&&(t.failedRequests.shift(),t.failedRequests.shift(),t.errors.shift()),t.failedRequests.push(this.apiId,this.correlationId),pd.isEmpty(e.subError)?pd.isEmpty(e.errorCode)?e&&e.toString()?t.errors.push(e.toString()):t.errors.push($h.UNKNOWN_ERROR):t.errors.push(e.errorCode):t.errors.push(e.subError),this.cacheManager.setServerTelemetry(this.telemetryCacheKey,t)},jg.prototype.incrementCacheHits=function(){var e=this.getLastRequests();return e.cacheHits+=1,this.cacheManager.setServerTelemetry(this.telemetryCacheKey,e),e.cacheHits},jg.prototype.getLastRequests=function(){var e=new Ig;return this.cacheManager.getServerTelemetry(this.telemetryCacheKey)||e},jg.prototype.clearTelemetryCache=function(){var e,t=this.getLastRequests(),r=jg.maxErrorsToSend(t);r===t.errors.length?this.cacheManager.removeItem(this.telemetryCacheKey):((e=new Ig).failedRequests=t.failedRequests.slice(2*r),e.errors=t.errors.slice(r),this.cacheManager.setServerTelemetry(this.telemetryCacheKey,e))},jg.maxErrorsToSend=function(e){for(var t=0,r=0,o=e.errors.length,n=0;n<o;n++){var i=e.failedRequests[2*n]||Lh.EMPTY_STRING,s=e.failedRequests[2*n+1]||Lh.EMPTY_STRING,a=e.errors[n]||Lh.EMPTY_STRING;if(!((r+=i.toString().length+s.toString().length+a.length+3)<$h.MAX_LAST_HEADER_BYTES))break;t+=1}return t},jg.prototype.getRegionDiscoveryFields=function(){var e=[];return e.push(this.regionUsed||Lh.EMPTY_STRING),e.push(this.regionSource||Lh.EMPTY_STRING),e.push(this.regionOutcome||Lh.EMPTY_STRING),e.join(",")},jg.prototype.updateRegionDiscoveryMetadata=function(e){this.regionUsed=e.region_used,this.regionSource=e.region_source,this.regionOutcome=e.region_outcome},jg.prototype.setCacheOutcome=function(e){this.cacheOutcome=e},jg);function jg(e,t){this.cacheOutcome=np.NO_CACHE_HIT,this.cacheManager=t,this.apiId=e.apiId,this.correlationId=e.correlationId,this.wrapperSKU=e.wrapperSKU||Lh.EMPTY_STRING,this.wrapperVer=e.wrapperVer||Lh.EMPTY_STRING,this.telemetryCacheKey=$h.CACHE_KEY+Fh.CACHE_KEY_SEPARATOR+e.clientId}Hg.prototype.startMeasurement=function(e,t){var r=this,o=t||this.generateId();t||this.logger.info("PerformanceClient: No correlation id provided for "+e+", generating",o),this.logger.trace("PerformanceClient: Performance measurement started for "+e,o);t=this.startPerformanceMeasuremeant(e,o);t.startMeasurement();var n={eventId:this.generateId(),status:sg.InProgress,authority:this.authority,libraryName:this.libraryName,libraryVersion:this.libraryVersion,clientId:this.clientId,name:e,startTimeMs:Date.now(),correlationId:o};this.cacheEventByCorrelationId(n);e={appName:null===(e=this.applicationTelemetry)||void 0===e?void 0:e.appName,appVersion:null===(e=this.applicationTelemetry)||void 0===e?void 0:e.appVersion};return this.addStaticFields(e,o),this.cacheMeasurement(n,t),{endMeasurement:function(e){e=r.endMeasurement(Ih(Ih({},n),e));return e&&r.cacheEventByCorrelationId(e),e},flushMeasurement:function(){return r.flushMeasurements(n.name,n.correlationId)},discardMeasurement:function(){return r.discardMeasurements(n.correlationId)},addStaticFields:function(e){return r.addStaticFields(e,n.correlationId)},measurement:t,event:n}},Hg.prototype.endMeasurement=function(e){var t=this.measurementsById.get(e.eventId);if(t){this.measurementsById.delete(e.eventId),t.endMeasurement();t=t.flushMeasurement();if(null!==t)return this.logger.trace("PerformanceClient: Performance measurement ended for "+e.name+": "+t+" ms",e.correlationId),Ih(Ih({durationMs:Math.round(t)},e),{status:sg.Completed});this.logger.trace("PerformanceClient: Performance measurement not taken",e.correlationId)}else this.logger.trace("PerformanceClient: Measurement not found for "+e.eventId,e.correlationId);return null},Hg.prototype.addStaticFields=function(e,t){var r=this.staticFieldsByCorrelationId.get(t);r?(this.logger.trace("PerformanceClient: Updating static fields"),this.staticFieldsByCorrelationId.set(t,Ih(Ih({},r),e))):(this.logger.trace("PerformanceClient: Adding static fields"),this.staticFieldsByCorrelationId.set(t,e))},Hg.prototype.cacheEventByCorrelationId=function(e){var t=this.eventsByCorrelationId.get(e.correlationId);t?(this.logger.trace("PerformanceClient: Performance measurement for "+e.name+" added/updated",e.correlationId),t.set(e.eventId,e)):(this.logger.trace("PerformanceClient: Performance measurement for "+e.name+" started",e.correlationId),this.eventsByCorrelationId.set(e.correlationId,(new Map).set(e.eventId,e)))},Hg.prototype.cacheMeasurement=function(e,t){this.measurementsById.set(e.eventId,t)},Hg.prototype.flushMeasurements=function(o,n){var i=this;this.logger.trace("PerformanceClient: Performance measurements flushed for "+o,n);var r,e,t=this.eventsByCorrelationId.get(n);t?(this.discardMeasurements(n),r=[],t.forEach(function(e){var t;e.name!==o&&e.status!==sg.Completed&&(i.logger.trace("PerformanceClient: Incomplete submeasurement "+e.name+" found for "+o,n),(t=i.endMeasurement(e))&&r.push(t)),r.push(e)}),0<(t=(e=r.sort(function(e,t){return e.startTimeMs-t.startTimeMs})).filter(function(e){return e.name===o&&e.status===sg.Completed})).length?(1<t.length&&this.logger.verbose("PerformanceClient: Multiple distinct top-level performance events found, using the first",n),t=t[0],this.logger.verbose("PerformanceClient: Measurement found for "+o,n),e=e.reduce(function(e,t){var r;return t.name!==o&&(i.logger.trace("PerformanceClient: Complete submeasurement found for "+t.name,n),e[r=t.name+"DurationMs"]?i.logger.verbose("PerformanceClient: Submeasurement for "+o+" already exists for "+t.name+", ignoring",n):e[r]=t.durationMs),e},t),t=this.staticFieldsByCorrelationId.get(n),t=Ih(Ih({},e),t),this.emitEvents([t],e.correlationId)):this.logger.verbose("PerformanceClient: No completed top-level measurements found for "+o,n)):this.logger.verbose("PerformanceClient: No measurements found",n)},Hg.prototype.discardMeasurements=function(e){this.logger.trace("PerformanceClient: Performance measurements discarded",e),this.eventsByCorrelationId.delete(e)},Hg.prototype.addPerformanceCallback=function(e){var t=this.generateId();return this.callbacks.set(t,e),this.logger.verbose("PerformanceClient: Performance callback registered with id: "+t),t},Hg.prototype.removePerformanceCallback=function(e){var t=this.callbacks.delete(e);return t?this.logger.verbose("PerformanceClient: Performance callback "+e+" removed."):this.logger.verbose("PerformanceClient: Performance callback "+e+" not removed."),t},Hg.prototype.emitEvents=function(r,o){var n=this;this.logger.verbose("PerformanceClient: Emitting performance events",o),this.callbacks.forEach(function(e,t){n.logger.trace("PerformanceClient: Emitting event to callback "+t,o),e.apply(null,[r])})},w=Hg;function Hg(e,t,r,o,n,i){this.authority=t,this.libraryName=o,this.libraryVersion=n,this.applicationTelemetry=i,this.clientId=e,this.logger=r,this.callbacks=new Map,this.eventsByCorrelationId=new Map,this.staticFieldsByCorrelationId=new Map,this.measurementsById=new Map}var Bg=(zg.prototype.startMeasurement=function(){},zg.prototype.endMeasurement=function(){},zg.prototype.flushMeasurement=function(){return null},zg);function zg(){}var Fg,Kg=(Th(Gg,Fg=w),Gg.prototype.generateId=function(){return"callback-id"},Gg.prototype.startPerformanceMeasuremeant=function(){return new Bg},Gg);function Gg(){return null!==Fg&&Fg.apply(this,arguments)||this}var Yg,Zg={code:"pkce_not_created",desc:"The PKCE code challenge and verifier could not be generated."},Wg={code:"crypto_nonexistent",desc:"The crypto object or function is not available."},Vg={code:"http_method_not_implemented",desc:"The HTTP method given has not been implemented in this library."},Jg={code:"empty_navigate_uri",desc:"Navigation URI is empty. Please check stack trace for more info."},Qg={code:"hash_empty_error",desc:"Hash value cannot be processed because it is empty. Please verify that your redirectUri is not clearing the hash. For more visit: aka.ms/msaljs/browser-errors."},Xg={code:"no_state_in_hash",desc:"Hash does not contain state. Please verify that the request originated from msal."},$g={code:"hash_does_not_contain_known_properties",desc:"Hash does not contain known properites. Please verify that your redirectUri is not changing the hash. For more visit: aka.ms/msaljs/browser-errors."},ey={code:"unable_to_parse_state",desc:"Unable to parse state. Please verify that the request originated from msal."},ty={code:"state_interaction_type_mismatch",desc:"Hash contains state but the interaction type does not match the caller."},ry={code:"interaction_in_progress",desc:"Interaction is currently in progress. Please ensure that this interaction has been completed before calling an interactive API. For more visit: aka.ms/msaljs/browser-errors."},oy={code:"popup_window_error",desc:"Error opening popup window. This can happen if you are using IE or if popups are blocked in the browser."},ny={code:"empty_window_error",desc:"window.open returned null or undefined window object."},iy={code:"user_cancelled",desc:"User cancelled the flow."},sy={code:"monitor_window_timeout",desc:"Token acquisition in popup failed due to timeout. For more visit: aka.ms/msaljs/browser-errors."},ay={code:"monitor_window_timeout",desc:"Token acquisition in iframe failed due to timeout. For more visit: aka.ms/msaljs/browser-errors."},cy={code:"redirect_in_iframe",desc:"Redirects are not supported for iframed or brokered applications. Please ensure you are using MSAL.js in a top frame of the window if using the redirect APIs, or use the popup APIs."},uy={code:"block_iframe_reload",desc:"Request was blocked inside an iframe because MSAL detected an authentication response. For more visit: aka.ms/msaljs/browser-errors"},ly={code:"block_nested_popups",desc:"Request was blocked inside a popup because MSAL detected it was running in a popup."},hy={code:"iframe_closed_prematurely",desc:"The iframe being monitored was closed prematurely."},py={code:"silent_logout_unsupported",desc:"Silent logout not supported. Please call logoutRedirect or logoutPopup instead."},dy={code:"no_account_error",desc:"No account object provided to acquireTokenSilent and no active account has been set. Please call setActiveAccount or provide an account on the request."},fy={code:"silent_prompt_value_error",desc:"The value given for the prompt value is not valid for silent requests - must be set to 'none' or 'no_session'."},gy={code:"no_token_request_cache_error",desc:"No token request found in cache."},yy={code:"unable_to_parse_token_request_cache_error",desc:"The cached token request could not be parsed."},my={code:"no_cached_authority_error",desc:"No cached authority found."},vy={code:"auth_request_not_set_error",desc:"Auth Request not set. Please ensure initiateAuthRequest was called from the InteractionHandler"},_y={code:"invalid_cache_type",desc:"Invalid cache type"},wy={code:"non_browser_environment",desc:"Login and token requests are not supported in non-browser environments."},by={code:"database_not_open",desc:"Database is not open!"},Cy={code:"no_network_connectivity",desc:"No network connectivity. Check your internet connection."},Ey={code:"post_request_failed",desc:"Network request failed: If the browser threw a CORS error, check that the redirectUri is registered in the Azure App Portal as type 'SPA'"},Sy={code:"get_request_failed",desc:"Network request failed. Please check the network trace to determine root cause."},Ty={code:"failed_to_parse_response",desc:"Failed to parse network response. Check network trace."},Iy={code:"unable_to_load_token",desc:"Error loading token to cache."},Ay={code:"crypto_key_not_found",desc:"Cryptographic Key or Keypair not found in browser storage."},ky={code:"auth_code_required",desc:"An authorization code must be provided (as the `code` property on the request) to this flow."},Py={code:"auth_code_or_nativeAccountId_required",desc:"An authorization code or nativeAccountId must be provided to this flow."},Oy={code:"database_unavailable",desc:"IndexedDB, which is required for persistent cryptographic key storage, is unavailable. This may be caused by browser privacy features which block persistent storage in third-party contexts."},Ry={code:"unable_to_acquire_token_from_native_platform",desc:"Unable to acquire token from native platform. For a list of possible reasons visit aka.ms/msaljs/browser-errors."},xy={code:"native_handshake_timeout",desc:"Timed out while attempting to establish connection to browser extension"},My={code:"native_extension_not_installed",desc:"Native extension is not installed. If you think this is a mistake call the initialize function."},Ny={code:"native_connection_not_established",desc:"Connection to native platform has not been established. Please install a compatible browser extension and run initialize(). For more please visit aka.ms/msaljs/browser-errors."},Ly={code:"native_broker_called_before_initialize",desc:"You must call and await the initialize function before attempting to call any other MSAL API when native brokering is enabled. For more please visit aka.ms/msaljs/browser-errors."},Dy={code:"native_prompt_not_supported",desc:"The provided prompt is not supported by the native platform. This request should be routed to the web based flow."},qy=(vh(Uy,Yg=gp),Uy.createPkceNotGeneratedError=function(e){return new Uy(Zg.code,Zg.desc+" Detail:"+e)},Uy.createCryptoNotAvailableError=function(e){return new Uy(Wg.code,Wg.desc+" Detail:"+e)},Uy.createHttpMethodNotImplementedError=function(e){return new Uy(Vg.code,Vg.desc+" Given Method: "+e)},Uy.createEmptyNavigationUriError=function(){return new Uy(Jg.code,Jg.desc)},Uy.createEmptyHashError=function(e){return new Uy(Qg.code,Qg.desc+" Given Url: "+e)},Uy.createHashDoesNotContainStateError=function(){return new Uy(Xg.code,Xg.desc)},Uy.createHashDoesNotContainKnownPropertiesError=function(){return new Uy($g.code,$g.desc)},Uy.createUnableToParseStateError=function(){return new Uy(ey.code,ey.desc)},Uy.createStateInteractionTypeMismatchError=function(){return new Uy(ty.code,ty.desc)},Uy.createInteractionInProgressError=function(){return new Uy(ry.code,ry.desc)},Uy.createPopupWindowError=function(e){var t=oy.desc,t=pd.isEmpty(e)?t:t+" Details: "+e;return new Uy(oy.code,t)},Uy.createEmptyWindowCreatedError=function(){return new Uy(ny.code,ny.desc)},Uy.createUserCancelledError=function(){return new Uy(iy.code,iy.desc)},Uy.createMonitorPopupTimeoutError=function(){return new Uy(sy.code,sy.desc)},Uy.createMonitorIframeTimeoutError=function(){return new Uy(ay.code,ay.desc)},Uy.createRedirectInIframeError=function(e){return new Uy(cy.code,cy.desc+" (window.parent !== window) => "+e)},Uy.createBlockReloadInHiddenIframeError=function(){return new Uy(uy.code,uy.desc)},Uy.createBlockAcquireTokenInPopupsError=function(){return new Uy(ly.code,ly.desc)},Uy.createIframeClosedPrematurelyError=function(){return new Uy(hy.code,hy.desc)},Uy.createSilentLogoutUnsupportedError=function(){return new Uy(py.code,py.desc)},Uy.createNoAccountError=function(){return new Uy(dy.code,dy.desc)},Uy.createSilentPromptValueError=function(e){return new Uy(fy.code,fy.desc+" Given value: "+e)},Uy.createUnableToParseTokenRequestCacheError=function(){return new Uy(yy.code,yy.desc)},Uy.createNoTokenRequestCacheError=function(){return new Uy(gy.code,gy.desc)},Uy.createAuthRequestNotSetError=function(){return new Uy(vy.code,vy.desc)},Uy.createNoCachedAuthorityError=function(){return new Uy(my.code,my.desc)},Uy.createInvalidCacheTypeError=function(){return new Uy(_y.code,""+_y.desc)},Uy.createNonBrowserEnvironmentError=function(){return new Uy(wy.code,wy.desc)},Uy.createDatabaseNotOpenError=function(){return new Uy(by.code,by.desc)},Uy.createNoNetworkConnectivityError=function(){return new Uy(Cy.code,Cy.desc)},Uy.createPostRequestFailedError=function(e,t){return new Uy(Ey.code,Ey.desc+" | Network client threw: "+e+" | Attempted to reach: "+t.split("?")[0])},Uy.createGetRequestFailedError=function(e,t){return new Uy(Sy.code,Sy.desc+" | Network client threw: "+e+" | Attempted to reach: "+t.split("?")[0])},Uy.createFailedToParseNetworkResponseError=function(e){return new Uy(Ty.code,Ty.desc+" | Attempted to reach: "+e.split("?")[0])},Uy.createUnableToLoadTokenError=function(e){return new Uy(Iy.code,Iy.desc+" | "+e)},Uy.createSigningKeyNotFoundInStorageError=function(e){return new Uy(Ay.code,Ay.desc+" | No match found for KeyId: "+e)},Uy.createAuthCodeRequiredError=function(){return new Uy(ky.code,ky.desc)},Uy.createAuthCodeOrNativeAccountIdRequiredError=function(){return new Uy(Py.code,Py.desc)},Uy.createDatabaseUnavailableError=function(){return new Uy(Oy.code,Oy.desc)},Uy.createUnableToAcquireTokenFromNativePlatformError=function(){return new Uy(Ry.code,Ry.desc)},Uy.createNativeHandshakeTimeoutError=function(){return new Uy(xy.code,xy.desc)},Uy.createNativeExtensionNotInstalledError=function(){return new Uy(My.code,My.desc)},Uy.createNativeConnectionNotEstablishedError=function(){return new Uy(Ny.code,Ny.desc)},Uy.createNativeBrokerCalledBeforeInitialize=function(){return new Uy(Ly.code,Ly.desc)},Uy.createNativePromptParameterNotSupportedError=function(){return new Uy(Dy.code,Dy.desc)},Uy);function Uy(e,t){t=Yg.call(this,e,t)||this;return Object.setPrototypeOf(t,Uy.prototype),t.name="BrowserAuthError",t}var jy,Hy,By,zy,Fy,Ky,Gy,Yy={INTERACTION_IN_PROGRESS_VALUE:"interaction_in_progress",INVALID_GRANT_ERROR:"invalid_grant",POPUP_WIDTH:483,POPUP_HEIGHT:600,POPUP_NAME_PREFIX:"msal",DEFAULT_POLL_INTERVAL_MS:30,MSAL_SKU:"msal.js.browser"},Zy="53ee284d-920a-4b59-9d30-a60315b26836",Wy="ppnbnpeolgkicgegkbkbjmhlideopiji",Vy="MATS";(o=jy=jy||{}).HandshakeRequest="Handshake",o.HandshakeResponse="HandshakeResponse",o.GetToken="GetToken",o.Response="Response",(o=Hy=Hy||{}).LocalStorage="localStorage",o.SessionStorage="sessionStorage",o.MemoryStorage="memoryStorage",(o=By=By||{}).GET="GET",o.POST="POST",(o=zy=zy||{}).AUTHORITY="authority",o.ACQUIRE_TOKEN_ACCOUNT="acquireToken.account",o.SESSION_STATE="session.state",o.REQUEST_STATE="request.state",o.NONCE_IDTOKEN="nonce.id_token",o.ORIGIN_URI="request.origin",o.RENEW_STATUS="token.renew.status",o.URL_HASH="urlHash",o.REQUEST_PARAMS="request.params",o.SCOPES="scopes",o.INTERACTION_STATUS_KEY="interaction.status",o.CCS_CREDENTIAL="ccs.credential",o.CORRELATION_ID="request.correlationId",o.NATIVE_REQUEST="request.native",o.REDIRECT_CONTEXT="request.redirect.context",(o=Fy=Fy||{}).WRAPPER_SKU="wrapper.sku",o.WRAPPER_VER="wrapper.version",(o=Ky=Ky||{})[o.acquireTokenRedirect=861]="acquireTokenRedirect",o[o.acquireTokenPopup=862]="acquireTokenPopup",o[o.ssoSilent=863]="ssoSilent",o[o.acquireTokenSilent_authCode=864]="acquireTokenSilent_authCode",o[o.handleRedirectPromise=865]="handleRedirectPromise",o[o.acquireTokenByCode=866]="acquireTokenByCode",o[o.acquireTokenSilent_silentFlow=61]="acquireTokenSilent_silentFlow",o[o.logout=961]="logout",o[o.logoutPopup=962]="logoutPopup",(o=Gy=Gy||{}).Redirect="redirect",o.Popup="popup",o.Silent="silent",o.None="none",(o=Om=Om||{}).Startup="startup",o.Login="login",o.Logout="logout",o.AcquireToken="acquireToken",o.SsoSilent="ssoSilent",o.HandleRedirect="handleRedirect",o.None="none";var Jy={scopes:Dh},Qy="jwk";(Om=Am=Am||{}).React="@azure/msal-react",Om.Angular="@azure/msal-angular";var Xy,$y="msal.db";(o=Xy=Xy||{})[o.Default=0]="Default",o[o.AccessToken=1]="AccessToken",o[o.AccessTokenAndRefreshToken=2]="AccessTokenAndRefreshToken",o[o.RefreshToken=3]="RefreshToken",o[o.RefreshTokenAndNetwork=4]="RefreshTokenAndNetwork",o[o.Skip=5]="Skip";var em,tm={code:"redirect_uri_empty",desc:"A redirect URI is required for all calls, and none has been set."},rm={code:"post_logout_uri_empty",desc:"A post logout redirect has not been set."},om={code:"storage_not_supported",desc:"Given storage configuration option was not supported."},nm={code:"no_redirect_callbacks",desc:"No redirect callbacks have been set. Please call setRedirectCallbacks() with the appropriate function arguments before continuing. More information is available here: https://github.com/AzureAD/microsoft-authentication-library-for-js/wiki/MSAL-basics."},im={code:"stubbed_public_client_application_called",desc:"Stub instance of Public Client Application was called. If using msal-react, please ensure context is not used without a provider. For more visit: aka.ms/msaljs/browser-errors"},sm={code:"in_mem_redirect_unavailable",desc:"Redirect cannot be supported. In-memory storage was selected and storeAuthStateInCookie=false, which would cause the library to be unable to handle the incoming hash. If you would like to use the redirect API, please use session/localStorage or set storeAuthStateInCookie=true."},am={code:"entropy_not_provided",desc:"The available browser crypto interface requires entropy set via system.cryptoOptions.entropy configuration option."},cm=(vh(um,em=gp),um.createRedirectUriEmptyError=function(){return new um(tm.code,tm.desc)},um.createPostLogoutRedirectUriEmptyError=function(){return new um(rm.code,rm.desc)},um.createStorageNotSupportedError=function(e){return new um(om.code,om.desc+" Given Location: "+e)},um.createRedirectCallbacksNotSetError=function(){return new um(nm.code,nm.desc)},um.createStubPcaInstanceCalledError=function(){return new um(im.code,im.desc)},um.createInMemoryRedirectUnavailableError=function(){return new um(sm.code,sm.desc)},um.createEntropyNotProvided=function(){return new um(am.code,am.desc)},um);function um(e,t){t=em.call(this,e,t)||this;return t.name="BrowserConfigurationAuthError",Object.setPrototypeOf(t,um.prototype),t}var lm=(hm.prototype.validateWindowStorage=function(e){if(e!==Hy.LocalStorage&&e!==Hy.SessionStorage)throw cm.createStorageNotSupportedError(e);if(!!!window[e])throw cm.createStorageNotSupportedError(e)},hm.prototype.getItem=function(e){return this.windowStorage.getItem(e)},hm.prototype.setItem=function(e,t){this.windowStorage.setItem(e,t)},hm.prototype.removeItem=function(e){this.windowStorage.removeItem(e)},hm.prototype.getKeys=function(){return Object.keys(this.windowStorage)},hm.prototype.containsKey=function(e){return this.windowStorage.hasOwnProperty(e)},hm);function hm(e){this.validateWindowStorage(e),this.windowStorage=window[e]}var pm=(dm.prototype.getItem=function(e){return this.cache.get(e)||null},dm.prototype.setItem=function(e,t){this.cache.set(e,t)},dm.prototype.removeItem=function(e){this.cache.delete(e)},dm.prototype.getKeys=function(){var r=[];return this.cache.forEach(function(e,t){r.push(t)}),r},dm.prototype.containsKey=function(e){return this.cache.has(e)},dm.prototype.clear=function(){this.cache.clear()},dm);function dm(){this.cache=new Map}var fm=(gm.extractBrowserRequestState=function(e,t){if(pd.isEmpty(t))return null;try{return Gf.parseRequestState(e,t).libraryState.meta}catch(e){throw ud.createInvalidStateError(t,e)}},gm.parseServerResponseFromHash=function(e){if(!e)return{};e=new Wf(e);return Wf.getDeserializedHash(e.getHash())},gm);function gm(){}var ym,mm=(vh(vm,ym=$d),vm.prototype.setupBrowserStorage=function(e){switch(e){case Hy.LocalStorage:case Hy.SessionStorage:try{return new lm(e)}catch(e){this.logger.verbose(e);break}}return this.cacheConfig.cacheLocation=Hy.MemoryStorage,new pm},vm.prototype.setupTemporaryCacheStorage=function(e){switch(e){case Hy.LocalStorage:case Hy.SessionStorage:try{return new lm(Hy.SessionStorage)}catch(e){return this.logger.verbose(e),this.internalStorage}case Hy.MemoryStorage:default:return this.internalStorage}},vm.prototype.migrateCacheEntries=function(){var r=this,e=Lh.CACHE_PREFIX+"."+Rh.ID_TOKEN,t=Lh.CACHE_PREFIX+"."+Rh.CLIENT_INFO,o=Lh.CACHE_PREFIX+"."+Rh.ERROR,n=Lh.CACHE_PREFIX+"."+Rh.ERROR_DESC,i=[this.browserStorage.getItem(e),this.browserStorage.getItem(t),this.browserStorage.getItem(o),this.browserStorage.getItem(n)];[Rh.ID_TOKEN,Rh.CLIENT_INFO,Rh.ERROR,Rh.ERROR_DESC].forEach(function(e,t){return r.migrateCacheEntry(e,i[t])})},vm.prototype.migrateCacheEntry=function(e,t){t&&this.setTemporaryCache(e,t,!0)},vm.prototype.validateAndParseJson=function(e){try{var t=JSON.parse(e);return t&&"object"==typeof t?t:null}catch(e){return null}},vm.prototype.getItem=function(e){return this.browserStorage.getItem(e)},vm.prototype.setItem=function(e,t){this.browserStorage.setItem(e,t)},vm.prototype.getAccount=function(e){e=this.getItem(e);if(!e)return null;e=this.validateAndParseJson(e);return e&&Vd.isAccountEntity(e)?$d.toObject(new Vd,e):null},vm.prototype.setAccount=function(e){this.logger.trace("BrowserCacheManager.setAccount called");var t=e.generateAccountKey();this.setItem(t,JSON.stringify(e))},vm.prototype.getIdTokenCredential=function(e){e=this.getItem(e);if(!e)return this.logger.trace("BrowserCacheManager.getIdTokenCredential: called, no cache hit"),null;e=this.validateAndParseJson(e);return e&&Af.isIdTokenEntity(e)?(this.logger.trace("BrowserCacheManager.getIdTokenCredential: cache hit"),$d.toObject(new Af,e)):(this.logger.trace("BrowserCacheManager.getIdTokenCredential: called, no cache hit"),null)},vm.prototype.setIdTokenCredential=function(e){this.logger.trace("BrowserCacheManager.setIdTokenCredential called");var t=e.generateCredentialKey();this.setItem(t,JSON.stringify(e))},vm.prototype.getAccessTokenCredential=function(e){e=this.getItem(e);if(!e)return this.logger.trace("BrowserCacheManager.getAccessTokenCredential: called, no cache hit"),null;e=this.validateAndParseJson(e);return e&&xf.isAccessTokenEntity(e)?(this.logger.trace("BrowserCacheManager.getAccessTokenCredential: cache hit"),$d.toObject(new xf,e)):(this.logger.trace("BrowserCacheManager.getAccessTokenCredential: called, no cache hit"),null)},vm.prototype.setAccessTokenCredential=function(e){this.logger.trace("BrowserCacheManager.setAccessTokenCredential called");var t=e.generateCredentialKey();this.setItem(t,JSON.stringify(e))},vm.prototype.getRefreshTokenCredential=function(e){e=this.getItem(e);if(!e)return this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: called, no cache hit"),null;e=this.validateAndParseJson(e);return e&&Lf.isRefreshTokenEntity(e)?(this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: cache hit"),$d.toObject(new Lf,e)):(this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: called, no cache hit"),null)},vm.prototype.setRefreshTokenCredential=function(e){this.logger.trace("BrowserCacheManager.setRefreshTokenCredential called");var t=e.generateCredentialKey();this.setItem(t,JSON.stringify(e))},vm.prototype.getAppMetadata=function(e){var t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getAppMetadata: called, no cache hit"),null;t=this.validateAndParseJson(t);return t&&Xf.isAppMetadataEntity(e,t)?(this.logger.trace("BrowserCacheManager.getAppMetadata: cache hit"),$d.toObject(new Xf,t)):(this.logger.trace("BrowserCacheManager.getAppMetadata: called, no cache hit"),null)},vm.prototype.setAppMetadata=function(e){this.logger.trace("BrowserCacheManager.setAppMetadata called");var t=e.generateAppMetadataKey();this.setItem(t,JSON.stringify(e))},vm.prototype.getServerTelemetry=function(e){var t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getServerTelemetry: called, no cache hit"),null;t=this.validateAndParseJson(t);return t&&Ig.isServerTelemetryEntity(e,t)?(this.logger.trace("BrowserCacheManager.getServerTelemetry: cache hit"),$d.toObject(new Ig,t)):(this.logger.trace("BrowserCacheManager.getServerTelemetry: called, no cache hit"),null)},vm.prototype.setServerTelemetry=function(e,t){this.logger.trace("BrowserCacheManager.setServerTelemetry called"),this.setItem(e,JSON.stringify(t))},vm.prototype.getAuthorityMetadata=function(e){var t=this.internalStorage.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getAuthorityMetadata: called, no cache hit"),null;t=this.validateAndParseJson(t);return t&&vg.isAuthorityMetadataEntity(e,t)?(this.logger.trace("BrowserCacheManager.getAuthorityMetadata: cache hit"),$d.toObject(new vg,t)):null},vm.prototype.getAuthorityMetadataKeys=function(){var t=this;return this.internalStorage.getKeys().filter(function(e){return t.isAuthorityMetadata(e)})},vm.prototype.setWrapperMetadata=function(e,t){this.internalStorage.setItem(Fy.WRAPPER_SKU,e),this.internalStorage.setItem(Fy.WRAPPER_VER,t)},vm.prototype.getWrapperMetadata=function(){return[this.internalStorage.getItem(Fy.WRAPPER_SKU)||Lh.EMPTY_STRING,this.internalStorage.getItem(Fy.WRAPPER_VER)||Lh.EMPTY_STRING]},vm.prototype.setAuthorityMetadata=function(e,t){this.logger.trace("BrowserCacheManager.setAuthorityMetadata called"),this.internalStorage.setItem(e,JSON.stringify(t))},vm.prototype.getActiveAccount=function(){var e=this.generateCacheKey(Rh.ACTIVE_ACCOUNT_FILTERS),t=this.getItem(e);if(!t){this.logger.trace("No active account filters cache schema found, looking for legacy schema");e=this.generateCacheKey(Rh.ACTIVE_ACCOUNT),e=this.getItem(e);if(!e)return this.logger.trace("No active account found"),null;e=this.getAccountInfoByFilter({localAccountId:e})[0]||null;return e?(this.logger.trace("Legacy active account cache schema found"),this.logger.trace("Adding active account filters cache schema"),this.setActiveAccount(e),e):null}t=this.validateAndParseJson(t);return t?(this.logger.trace("Active account filters schema found"),this.getAccountInfoByFilter({homeAccountId:t.homeAccountId,localAccountId:t.localAccountId})[0]||null):(this.logger.trace("No active account found"),null)},vm.prototype.setActiveAccount=function(e){var t,r=this.generateCacheKey(Rh.ACTIVE_ACCOUNT_FILTERS),o=this.generateCacheKey(Rh.ACTIVE_ACCOUNT);e?(this.logger.verbose("setActiveAccount: Active account set"),t={homeAccountId:e.homeAccountId,localAccountId:e.localAccountId},this.browserStorage.setItem(r,JSON.stringify(t)),this.browserStorage.setItem(o,e.localAccountId)):(this.logger.verbose("setActiveAccount: No account passed, active account not set"),this.browserStorage.removeItem(r),this.browserStorage.removeItem(o))},vm.prototype.getAccountInfoByFilter=function(t){return this.getAllAccounts().filter(function(e){return(!t.username||t.username.toLowerCase()===e.username.toLowerCase())&&((!t.homeAccountId||t.homeAccountId===e.homeAccountId)&&((!t.localAccountId||t.localAccountId===e.localAccountId)&&((!t.tenantId||t.tenantId===e.tenantId)&&(!t.environment||t.environment===e.environment))))})},vm.prototype.getAccountInfoByHints=function(r,o){var e=this.getAllAccounts().filter(function(e){if(o){var t=e.idTokenClaims&&e.idTokenClaims.sid;return o===t}return!!r&&r===e.username});if(1===e.length)return e[0];if(1<e.length)throw ud.createMultipleMatchingAccountsInCacheError();return null},vm.prototype.getThrottlingCache=function(e){var t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getThrottlingCache: called, no cache hit"),null;t=this.validateAndParseJson(t);return t&&kg.isThrottlingEntity(e,t)?(this.logger.trace("BrowserCacheManager.getThrottlingCache: cache hit"),$d.toObject(new kg,t)):(this.logger.trace("BrowserCacheManager.getThrottlingCache: called, no cache hit"),null)},vm.prototype.setThrottlingCache=function(e,t){this.logger.trace("BrowserCacheManager.setThrottlingCache called"),this.setItem(e,JSON.stringify(t))},vm.prototype.getTemporaryCache=function(e,t){e=t?this.generateCacheKey(e):e;if(this.cacheConfig.storeAuthStateInCookie){var r=this.getItemCookie(e);if(r)return this.logger.trace("BrowserCacheManager.getTemporaryCache: storeAuthStateInCookies set to true, retrieving from cookies"),r}r=this.temporaryCacheStorage.getItem(e);if(r)return this.logger.trace("BrowserCacheManager.getTemporaryCache: Temporary cache item returned"),r;if(this.cacheConfig.cacheLocation===Hy.LocalStorage){e=this.browserStorage.getItem(e);if(e)return this.logger.trace("BrowserCacheManager.getTemporaryCache: Temporary cache item found in local storage"),e}return this.logger.trace("BrowserCacheManager.getTemporaryCache: No cache item found in local storage"),null},vm.prototype.setTemporaryCache=function(e,t,r){e=r?this.generateCacheKey(e):e;this.temporaryCacheStorage.setItem(e,t),this.cacheConfig.storeAuthStateInCookie&&(this.logger.trace("BrowserCacheManager.setTemporaryCache: storeAuthStateInCookie set to true, setting item cookie"),this.setItemCookie(e,t))},vm.prototype.removeItem=function(e){return this.browserStorage.removeItem(e),this.temporaryCacheStorage.removeItem(e),this.cacheConfig.storeAuthStateInCookie&&(this.logger.trace("BrowserCacheManager.removeItem: storeAuthStateInCookie is true, clearing item cookie"),this.clearItemCookie(e)),!0},vm.prototype.containsKey=function(e){return this.browserStorage.containsKey(e)||this.temporaryCacheStorage.containsKey(e)},vm.prototype.getKeys=function(){return Eh(this.browserStorage.getKeys(),this.temporaryCacheStorage.getKeys())},vm.prototype.clear=function(){return bh(this,void 0,void 0,function(){var t=this;return Ch(this,function(e){switch(e.label){case 0:return[4,this.removeAllAccounts()];case 1:return e.sent(),this.removeAppMetadata(),this.getKeys().forEach(function(e){!t.browserStorage.containsKey(e)&&!t.temporaryCacheStorage.containsKey(e)||-1===e.indexOf(Lh.CACHE_PREFIX)&&-1===e.indexOf(t.clientId)||t.removeItem(e)}),this.internalStorage.clear(),[2]}})})},vm.prototype.setItemCookie=function(e,t,r){t=encodeURIComponent(e)+"="+encodeURIComponent(t)+";path=/;SameSite=Lax;";r&&(t+="expires="+this.getCookieExpirationTime(r)+";"),this.cacheConfig.secureCookies&&(t+="Secure;"),document.cookie=t},vm.prototype.getItemCookie=function(e){for(var t=encodeURIComponent(e)+"=",r=document.cookie.split(";"),o=0;o<r.length;o++){for(var n=r[o];" "===n.charAt(0);)n=n.substring(1);if(0===n.indexOf(t))return decodeURIComponent(n.substring(t.length,n.length))}return Lh.EMPTY_STRING},vm.prototype.clearMsalCookies=function(){var r=this,o=Lh.CACHE_PREFIX+"."+this.clientId;document.cookie.split(";").forEach(function(e){for(;" "===e.charAt(0);)e=e.substring(1);var t;0===e.indexOf(o)&&(t=e.split("=")[0],r.clearItemCookie(t))})},vm.prototype.clearItemCookie=function(e){this.setItemCookie(e,Lh.EMPTY_STRING,-1)},vm.prototype.getCookieExpirationTime=function(e){var t=new Date;return new Date(t.getTime()+e*this.COOKIE_LIFE_MULTIPLIER).toUTCString()},vm.prototype.getCache=function(){return this.browserStorage},vm.prototype.setCache=function(){},vm.prototype.generateCacheKey=function(e){return this.validateAndParseJson(e)?JSON.stringify(e):pd.startsWith(e,Lh.CACHE_PREFIX)||pd.startsWith(e,Rh.ADAL_ID_TOKEN)?e:Lh.CACHE_PREFIX+"."+this.clientId+"."+e},vm.prototype.generateAuthorityKey=function(e){e=Gf.parseRequestState(this.cryptoImpl,e).libraryState.id;return this.generateCacheKey(zy.AUTHORITY+"."+e)},vm.prototype.generateNonceKey=function(e){e=Gf.parseRequestState(this.cryptoImpl,e).libraryState.id;return this.generateCacheKey(zy.NONCE_IDTOKEN+"."+e)},vm.prototype.generateStateKey=function(e){e=Gf.parseRequestState(this.cryptoImpl,e).libraryState.id;return this.generateCacheKey(zy.REQUEST_STATE+"."+e)},vm.prototype.getCachedAuthority=function(e){e=this.generateStateKey(e),e=this.getTemporaryCache(e);if(!e)return null;e=this.generateAuthorityKey(e);return this.getTemporaryCache(e)},vm.prototype.updateCacheEntries=function(e,t,r,o,n){this.logger.trace("BrowserCacheManager.updateCacheEntries called");var i=this.generateStateKey(e);this.setTemporaryCache(i,e,!1);i=this.generateNonceKey(e);this.setTemporaryCache(i,t,!1);var s,e=this.generateAuthorityKey(e);this.setTemporaryCache(e,r,!1),n?(s={credential:n.homeAccountId,type:vf.HOME_ACCOUNT_ID},this.setTemporaryCache(zy.CCS_CREDENTIAL,JSON.stringify(s),!0)):pd.isEmpty(o)||(s={credential:o,type:vf.UPN},this.setTemporaryCache(zy.CCS_CREDENTIAL,JSON.stringify(s),!0))},vm.prototype.resetRequestCache=function(t){var r=this;this.logger.trace("BrowserCacheManager.resetRequestCache called"),pd.isEmpty(t)||this.getKeys().forEach(function(e){-1!==e.indexOf(t)&&r.removeItem(e)}),t&&(this.removeItem(this.generateStateKey(t)),this.removeItem(this.generateNonceKey(t)),this.removeItem(this.generateAuthorityKey(t))),this.removeItem(this.generateCacheKey(zy.REQUEST_PARAMS)),this.removeItem(this.generateCacheKey(zy.ORIGIN_URI)),this.removeItem(this.generateCacheKey(zy.URL_HASH)),this.removeItem(this.generateCacheKey(zy.CORRELATION_ID)),this.removeItem(this.generateCacheKey(zy.CCS_CREDENTIAL)),this.removeItem(this.generateCacheKey(zy.NATIVE_REQUEST)),this.setInteractionInProgress(!1)},vm.prototype.cleanRequestByState=function(e){this.logger.trace("BrowserCacheManager.cleanRequestByState called"),e&&(e=this.generateStateKey(e),e=this.temporaryCacheStorage.getItem(e),this.logger.infoPii("BrowserCacheManager.cleanRequestByState: Removing temporary cache items for state: "+e),this.resetRequestCache(e||Lh.EMPTY_STRING)),this.clearMsalCookies()},vm.prototype.cleanRequestByInteractionType=function(r){var o=this;this.logger.trace("BrowserCacheManager.cleanRequestByInteractionType called"),this.getKeys().forEach(function(e){var t;-1!==e.indexOf(zy.REQUEST_STATE)&&(!(t=o.temporaryCacheStorage.getItem(e))||(e=fm.extractBrowserRequestState(o.cryptoImpl,t))&&e.interactionType===r&&(o.logger.infoPii("BrowserCacheManager.cleanRequestByInteractionType: Removing temporary cache items for state: "+t),o.resetRequestCache(t)))}),this.clearMsalCookies(),this.setInteractionInProgress(!1)},vm.prototype.cacheCodeRequest=function(e,t){this.logger.trace("BrowserCacheManager.cacheCodeRequest called");e=t.base64Encode(JSON.stringify(e));this.setTemporaryCache(zy.REQUEST_PARAMS,e,!0)},vm.prototype.getCachedRequest=function(e,t){this.logger.trace("BrowserCacheManager.getCachedRequest called");var r=this.getTemporaryCache(zy.REQUEST_PARAMS,!0);if(!r)throw qy.createNoTokenRequestCacheError();r=this.validateAndParseJson(t.base64Decode(r));if(!r)throw qy.createUnableToParseTokenRequestCacheError();if(this.removeItem(this.generateCacheKey(zy.REQUEST_PARAMS)),pd.isEmpty(r.authority)){e=this.generateAuthorityKey(e),e=this.getTemporaryCache(e);if(!e)throw qy.createNoCachedAuthorityError();r.authority=e}return r},vm.prototype.getCachedNativeRequest=function(){this.logger.trace("BrowserCacheManager.getCachedNativeRequest called");var e=this.getTemporaryCache(zy.NATIVE_REQUEST,!0);if(!e)return this.logger.trace("BrowserCacheManager.getCachedNativeRequest: No cached native request found"),null;e=this.validateAndParseJson(e);return e||(this.logger.error("BrowserCacheManager.getCachedNativeRequest: Unable to parse native request"),null)},vm.prototype.isInteractionInProgress=function(e){var t=this.getInteractionInProgress();return e?t===this.clientId:!!t},vm.prototype.getInteractionInProgress=function(){var e=Lh.CACHE_PREFIX+"."+zy.INTERACTION_STATUS_KEY;return this.getTemporaryCache(e,!1)},vm.prototype.setInteractionInProgress=function(e){var t=Lh.CACHE_PREFIX+"."+zy.INTERACTION_STATUS_KEY;if(e){if(this.getInteractionInProgress())throw qy.createInteractionInProgressError();this.setTemporaryCache(t,this.clientId,!1)}else this.getInteractionInProgress()!==this.clientId||this.removeItem(t)},vm.prototype.getLegacyLoginHint=function(){var e=this.getTemporaryCache(Rh.ADAL_ID_TOKEN);e&&(this.browserStorage.removeItem(Rh.ADAL_ID_TOKEN),this.logger.verbose("Cached ADAL id token retrieved."));var t=this.getTemporaryCache(Rh.ID_TOKEN,!0);t&&(this.removeItem(this.generateCacheKey(Rh.ID_TOKEN)),this.logger.verbose("Cached MSAL.js v1 id token retrieved"));e=t||e;if(e){e=new Qd(e,this.cryptoImpl);if(e.claims&&e.claims.preferred_username)return this.logger.verbose("No SSO params used and ADAL/MSAL v1 token retrieved, setting ADAL/MSAL v1 preferred_username as loginHint"),e.claims.preferred_username;if(e.claims&&e.claims.upn)return this.logger.verbose("No SSO params used and ADAL/MSAL v1 token retrieved, setting ADAL/MSAL v1 upn as loginHint"),e.claims.upn;this.logger.verbose("No SSO params used and ADAL/MSAL v1 token retrieved, however, no account hint claim found. Enable preferred_username or upn id token claim to get SSO.")}return null},vm.prototype.updateCredentialCacheKey=function(e,t){var r=t.generateCredentialKey();if(e!==r){var o=this.getItem(e);if(o)return this.removeItem(e),this.setItem(r,o),this.logger.verbose("Updated an outdated "+t.credentialType+" cache key"),r;this.logger.error("Attempted to update an outdated "+t.credentialType+" cache key but no item matching the outdated key was found in storage")}return e},vm.prototype.getRedirectRequestContext=function(){return this.getTemporaryCache(zy.REDIRECT_CONTEXT,!0)},vm.prototype.setRedirectRequestContext=function(e){this.setTemporaryCache(zy.REDIRECT_CONTEXT,e,!0)},vm);function vm(e,t,r,o){r=ym.call(this,e,r)||this;return r.COOKIE_LIFE_MULTIPLIER=864e5,r.cacheConfig=t,r.logger=o,r.internalStorage=new pm,r.browserStorage=r.setupBrowserStorage(r.cacheConfig.cacheLocation),r.temporaryCacheStorage=r.setupTemporaryCacheStorage(r.cacheConfig.cacheLocation),r.migrateCacheEntries(),r}var _m="@azure/msal-browser",wm="2.32.1",bm=(Cm.prototype.sendGetRequestAsync=function(n,i){return bh(this,void 0,void 0,function(){var t,r,o;return Ch(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,fetch(n,{method:By.GET,headers:this.getFetchHeaders(i)})];case 1:return t=e.sent(),[3,3];case 2:throw r=e.sent(),window.navigator.onLine?qy.createGetRequestFailedError(r,n):qy.createNoNetworkConnectivityError();case 3:return e.trys.push([3,5,,6]),o={headers:this.getHeaderDict(t.headers)},[4,t.json()];case 4:return[2,(o.body=e.sent(),o.status=t.status,o)];case 5:throw e.sent(),qy.createFailedToParseNetworkResponseError(n);case 6:return[2]}})})},Cm.prototype.sendPostRequestAsync=function(i,s){return bh(this,void 0,void 0,function(){var t,r,o,n;return Ch(this,function(e){switch(e.label){case 0:t=s&&s.body||Lh.EMPTY_STRING,e.label=1;case 1:return e.trys.push([1,3,,4]),[4,fetch(i,{method:By.POST,headers:this.getFetchHeaders(s),body:t})];case 2:return r=e.sent(),[3,4];case 3:throw o=e.sent(),window.navigator.onLine?qy.createPostRequestFailedError(o,i):qy.createNoNetworkConnectivityError();case 4:return e.trys.push([4,6,,7]),n={headers:this.getHeaderDict(r.headers)},[4,r.json()];case 5:return[2,(n.body=e.sent(),n.status=r.status,n)];case 6:throw e.sent(),qy.createFailedToParseNetworkResponseError(i);case 7:return[2]}})})},Cm.prototype.getFetchHeaders=function(e){var t=new Headers;if(!e||!e.headers)return t;var r=e.headers;return Object.keys(r).forEach(function(e){t.append(e,r[e])}),t},Cm.prototype.getHeaderDict=function(e){var r={};return e.forEach(function(e,t){r[t]=e}),r},Cm);function Cm(){}var Em=(Sm.prototype.sendGetRequestAsync=function(t,r){return bh(this,void 0,void 0,function(){return Ch(this,function(e){return[2,this.sendRequestAsync(t,By.GET,r)]})})},Sm.prototype.sendPostRequestAsync=function(t,r){return bh(this,void 0,void 0,function(){return Ch(this,function(e){return[2,this.sendRequestAsync(t,By.POST,r)]})})},Sm.prototype.sendRequestAsync=function(i,s,e){var a=this;return new Promise(function(r,o){var n=new XMLHttpRequest;if(n.open(s,i,!0),a.setXhrHeaders(n,e),n.onload=function(){(n.status<200||300<=n.status)&&(s===By.POST?o(qy.createPostRequestFailedError("Failed with status "+n.status,i)):o(qy.createGetRequestFailedError("Failed with status "+n.status,i)));try{var e=JSON.parse(n.responseText),t={headers:a.getHeaderDict(n),body:e,status:n.status};r(t)}catch(e){o(qy.createFailedToParseNetworkResponseError(i))}},n.onerror=function(){window.navigator.onLine?s===By.POST?o(qy.createPostRequestFailedError("Failed with status "+n.status,i)):o(qy.createGetRequestFailedError("Failed with status "+n.status,i)):o(qy.createNoNetworkConnectivityError())},s===By.POST&&e&&e.body)n.send(e.body);else{if(s!==By.GET)throw qy.createHttpMethodNotImplementedError(s);n.send()}})},Sm.prototype.setXhrHeaders=function(t,e){var r;e&&e.headers&&(r=e.headers,Object.keys(r).forEach(function(e){t.setRequestHeader(e,r[e])}))},Sm.prototype.getHeaderDict=function(e){var e=e.getAllResponseHeaders().trim().split(/[\r\n]+/),r={};return e.forEach(function(e){var t=e.split(": "),e=t.shift(),t=t.join(": ");e&&t&&(r[e]=t)}),r},Sm);function Sm(){}var Tm=(Im.clearHash=function(e){e.location.hash=Lh.EMPTY_STRING,"function"==typeof e.history.replaceState&&e.history.replaceState(null,Lh.EMPTY_STRING,""+e.location.origin+e.location.pathname+e.location.search)},Im.replaceHash=function(e){e=e.split("#");e.shift(),window.location.hash=0<e.length?e.join("#"):Lh.EMPTY_STRING},Im.isInIframe=function(){return window.parent!==window},Im.isInPopup=function(){return"undefined"!=typeof window&&!!window.opener&&window.opener!==window&&"string"==typeof window.name&&0===window.name.indexOf(Yy.POPUP_NAME_PREFIX+".")},Im.getCurrentUri=function(){return window.location.href.split("?")[0].split("#")[0]},Im.getHomepage=function(){var e=new Wf(window.location.href).getUrlComponents();return e.Protocol+"//"+e.HostNameAndPort+"/"},Im.getBrowserNetworkClient=function(){return new(window.fetch&&window.Headers?bm:Em)},Im.blockReloadInHiddenIframes=function(){if(Wf.hashContainsKnownProperties(window.location.hash)&&Im.isInIframe())throw qy.createBlockReloadInHiddenIframeError()},Im.blockRedirectInIframe=function(e,t){var r=Im.isInIframe();if(e===Gy.Redirect&&r&&!t)throw qy.createRedirectInIframeError(r)},Im.blockAcquireTokenInPopups=function(){if(Im.isInPopup())throw qy.createBlockAcquireTokenInPopupsError()},Im.blockNonBrowserEnvironment=function(e){if(!e)throw qy.createNonBrowserEnvironmentError()},Im.blockNativeBrokerCalledBeforeInitialized=function(e,t){if(e&&!t)throw qy.createNativeBrokerCalledBeforeInitialize()},Im.detectIEOrEdge=function(){var e=window.navigator.userAgent,t=e.indexOf("MSIE "),r=e.indexOf("Trident/"),e=e.indexOf("Edge/");return 0<t||0<r||0<e},Im);function Im(){}var Am=(km.prototype.clearCacheOnLogout=function(t){return bh(this,void 0,void 0,function(){return Ch(this,function(e){switch(e.label){case 0:if(!t)return[3,5];Vd.accountInfoIsEqual(t,this.browserStorage.getActiveAccount(),!1)&&(this.logger.verbose("Setting active account to null"),this.browserStorage.setActiveAccount(null)),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,this.browserStorage.removeAccount(Vd.generateAccountCacheKey(t))];case 2:return e.sent(),this.logger.verbose("Cleared cache items belonging to the account provided in the logout request."),[3,4];case 3:return e.sent(),this.logger.error("Account provided in logout request was not found. Local cache unchanged."),[3,4];case 4:return[3,9];case 5:return e.trys.push([5,8,,9]),this.logger.verbose("No account provided in logout request, clearing all cache items.",this.correlationId),[4,this.browserStorage.clear()];case 6:return e.sent(),[4,this.browserCrypto.clearKeystore()];case 7:return e.sent(),[3,9];case 8:return e.sent(),this.logger.error("Attempted to clear all MSAL cache items and failed. Local cache unchanged."),[3,9];case 9:return[2]}})})},km.prototype.initializeBaseRequest=function(n){return bh(this,void 0,void 0,function(){var t,r,o;return Ch(this,function(e){switch(e.label){case 0:if(this.logger.verbose("Initializing BaseAuthRequest"),t=n.authority||this.config.auth.authority,r=Eh(n&&n.scopes||[]),(r=_h(_h({},n),{correlationId:this.correlationId,authority:t,scopes:r})).authenticationScheme){if(r.authenticationScheme===Xh.SSH){if(!n.sshJwk)throw zd.createMissingSshJwkError();if(!n.sshKid)throw zd.createMissingSshKidError()}this.logger.verbose('Authentication Scheme set to "'+r.authenticationScheme+'" as configured in Auth request')}else r.authenticationScheme=Xh.BEARER,this.logger.verbose('Authentication Scheme wasn\'t explicitly set in request, defaulting to "Bearer" request');return!n.claims||pd.isEmpty(n.claims)?[3,2]:(o=r,[4,this.browserCrypto.hashString(n.claims)]);case 1:o.requestedClaimsHash=e.sent(),e.label=2;case 2:return[2,r]}})})},km.prototype.getRedirectUri=function(e){this.logger.verbose("getRedirectUri called");e=e||this.config.auth.redirectUri||Tm.getCurrentUri();return Wf.getAbsoluteUrl(e,Tm.getCurrentUri())},km.prototype.initializeServerTelemetryManager=function(e,t){this.logger.verbose("initializeServerTelemetryManager called");t={clientId:this.config.auth.clientId,correlationId:this.correlationId,apiId:e,forceRefresh:t||!1,wrapperSKU:this.browserStorage.getWrapperMetadata()[0],wrapperVer:this.browserStorage.getWrapperMetadata()[1]};return new Ug(t,this.browserStorage)},km.prototype.getDiscoveredAuthority=function(r){return bh(this,void 0,void 0,function(){var t;return Ch(this,function(e){switch(e.label){case 0:return(this.logger.verbose("getDiscoveredAuthority called"),t={protocolMode:this.config.auth.protocolMode,knownAuthorities:this.config.auth.knownAuthorities,cloudDiscoveryMetadata:this.config.auth.cloudDiscoveryMetadata,authorityMetadata:this.config.auth.authorityMetadata},r)?(this.logger.verbose("Creating discovered authority with request authority"),[4,Sg.createDiscoveredInstance(r,this.config.system.networkClient,this.browserStorage,t,this.logger)]):[3,2];case 1:return[2,e.sent()];case 2:return this.logger.verbose("Creating discovered authority with configured authority"),[4,Sg.createDiscoveredInstance(this.config.auth.authority,this.config.system.networkClient,this.browserStorage,t,this.logger)];case 3:return[2,e.sent()]}})})},km);function km(e,t,r,o,n,i,s,a,c){this.config=e,this.browserStorage=t,this.browserCrypto=r,this.networkClient=this.config.system.networkClient,this.eventHandler=n,this.navigationClient=i,this.nativeMessageHandler=a,this.correlationId=c||this.browserCrypto.createNewGuid(),this.logger=o.clone(Yy.MSAL_SKU,wm,this.correlationId),this.performanceClient=s}var Pm,Om=(vh(Rm,Pm=Am),Rm.prototype.initializeAuthorizationCodeRequest=function(o){return bh(this,void 0,void 0,function(){var t,r;return Ch(this,function(e){switch(e.label){case 0:return this.logger.verbose("initializeAuthorizationRequest called",o.correlationId),[4,this.browserCrypto.generatePkceCodes()];case 1:return t=e.sent(),r=_h(_h({},o),{redirectUri:o.redirectUri,code:Lh.EMPTY_STRING,codeVerifier:t.verifier}),o.codeChallenge=t.challenge,o.codeChallengeMethod=Lh.S256_CODE_CHALLENGE_METHOD,[2,r]}})})},Rm.prototype.initializeLogoutRequest=function(e){this.logger.verbose("initializeLogoutRequest called",null==e?void 0:e.correlationId);var t,r=_h({correlationId:this.correlationId||this.browserCrypto.createNewGuid()},e);return e?e.logoutHint?this.logger.verbose("logoutHint has already been set in logoutRequest"):e.account?(t=this.getLogoutHintFromIdTokenClaims(e.account))&&(this.logger.verbose("Setting logoutHint to login_hint ID Token Claim value for the account provided"),r.logoutHint=t):this.logger.verbose("logoutHint was not set and account was not passed into logout request, logoutHint will not be set"):this.logger.verbose("logoutHint will not be set since no logout request was configured"),e&&null===e.postLogoutRedirectUri?this.logger.verbose("postLogoutRedirectUri passed as null, not setting post logout redirect uri",r.correlationId):e&&e.postLogoutRedirectUri?(this.logger.verbose("Setting postLogoutRedirectUri to uri set on logout request",r.correlationId),r.postLogoutRedirectUri=Wf.getAbsoluteUrl(e.postLogoutRedirectUri,Tm.getCurrentUri())):null===this.config.auth.postLogoutRedirectUri?this.logger.verbose("postLogoutRedirectUri configured as null and no uri set on request, not passing post logout redirect",r.correlationId):this.config.auth.postLogoutRedirectUri?(this.logger.verbose("Setting postLogoutRedirectUri to configured uri",r.correlationId),r.postLogoutRedirectUri=Wf.getAbsoluteUrl(this.config.auth.postLogoutRedirectUri,Tm.getCurrentUri())):(this.logger.verbose("Setting postLogoutRedirectUri to current page",r.correlationId),r.postLogoutRedirectUri=Wf.getAbsoluteUrl(Tm.getCurrentUri(),Tm.getCurrentUri())),r},Rm.prototype.getLogoutHintFromIdTokenClaims=function(e){e=e.idTokenClaims;if(e){if(e.login_hint)return e.login_hint;this.logger.verbose("The ID Token Claims tied to the provided account do not contain a login_hint claim, logoutHint will not be added to logout request")}else this.logger.verbose("The provided account does not contain ID Token Claims, logoutHint will not be added to logout request");return null},Rm.prototype.createAuthCodeClient=function(r,o,n){return bh(this,void 0,void 0,function(){var t;return Ch(this,function(e){switch(e.label){case 0:return[4,this.getClientConfiguration(r,o,n)];case 1:return t=e.sent(),[2,new ag(t)]}})})},Rm.prototype.getClientConfiguration=function(r,o,n){return bh(this,void 0,void 0,function(){var t;return Ch(this,function(e){switch(e.label){case 0:return this.logger.verbose("getClientConfiguration called",this.correlationId),[4,this.getDiscoveredAuthority(o,n)];case 1:return t=e.sent(),[2,{authOptions:{clientId:this.config.auth.clientId,authority:t,clientCapabilities:this.config.auth.clientCapabilities},systemOptions:{tokenRenewalOffsetSeconds:this.config.system.tokenRenewalOffsetSeconds,preventCorsPreflight:!0},loggerOptions:{loggerCallback:this.config.system.loggerOptions.loggerCallback,piiLoggingEnabled:this.config.system.loggerOptions.piiLoggingEnabled,logLevel:this.config.system.loggerOptions.logLevel,correlationId:this.correlationId},cryptoInterface:this.browserCrypto,networkInterface:this.networkClient,storageInterface:this.browserStorage,serverTelemetryManager:r,libraryInfo:{sku:Yy.MSAL_SKU,version:wm,cpu:Lh.EMPTY_STRING,os:Lh.EMPTY_STRING},telemetry:this.config.telemetry}]}})})},Rm.prototype.validateAndExtractStateFromHash=function(e,t,r){if(this.logger.verbose("validateAndExtractStateFromHash called",r),!e.state)throw qy.createHashDoesNotContainStateError();var o=fm.extractBrowserRequestState(this.browserCrypto,e.state);if(!o)throw qy.createUnableToParseStateError();if(o.interactionType!==t)throw qy.createStateInteractionTypeMismatchError();return this.logger.verbose("Returning state from hash",r),e.state},Rm.prototype.getDiscoveredAuthority=function(n,i){return bh(this,void 0,void 0,function(){var t,r,o;return Ch(this,function(e){switch(e.label){case 0:return this.logger.verbose("getDiscoveredAuthority called",this.correlationId),t=this.performanceClient.startMeasurement(ig.StandardInteractionClientGetDiscoveredAuthority,this.correlationId),r={protocolMode:this.config.auth.protocolMode,knownAuthorities:this.config.auth.knownAuthorities,cloudDiscoveryMetadata:this.config.auth.cloudDiscoveryMetadata,authorityMetadata:this.config.auth.authorityMetadata,skipAuthorityMetadataCache:this.config.auth.skipAuthorityMetadataCache},o=n||this.config.auth.authority,o=Cg.generateAuthority(o,i||this.config.auth.azureCloudOptions),this.logger.verbose("Creating discovered authority with configured authority",this.correlationId),[4,Sg.createDiscoveredInstance(o,this.config.system.networkClient,this.browserStorage,r,this.logger).then(function(e){return t.endMeasurement({success:!0}),e}).catch(function(e){throw t.endMeasurement({errorCode:e.errorCode,subErrorCode:e.subError,success:!1}),e})];case 1:return[2,e.sent()]}})})},Rm.prototype.initializeAuthorizationRequest=function(a,c){return bh(this,void 0,void 0,function(){var t,r,o,n,i,s;return Ch(this,function(e){switch(e.label){case 0:return this.logger.verbose("initializeAuthorizationRequest called",this.correlationId),t=this.getRedirectUri(a.redirectUri),i={interactionType:c},r=Gf.setRequestState(this.browserCrypto,a&&a.state||Lh.EMPTY_STRING,i),n=[{}],[4,this.initializeBaseRequest(a)];case 1:return o=_h.apply(void 0,[_h.apply(void 0,n.concat([e.sent()])),{redirectUri:t,state:r,nonce:a.nonce||this.browserCrypto.createNewGuid(),responseMode:Hh.FRAGMENT}]),(i=a.account||this.browserStorage.getActiveAccount())&&(this.logger.verbose("Setting validated request account",this.correlationId),this.logger.verbosePii("Setting validated request account: "+i.homeAccountId,this.correlationId),o.account=i),pd.isEmpty(o.loginHint)&&!i&&(s=this.browserStorage.getLegacyLoginHint())&&(o.loginHint=s),[2,o]}})})},Rm);function Rm(){return null!==Pm&&Pm.apply(this,arguments)||this}var xm=(Mm.prototype.handleCodeResponseFromHash=function(o,n,i,s){return bh(this,void 0,void 0,function(){var t,r;return Ch(this,function(e){if(this.logger.verbose("InteractionHandler.handleCodeResponse called"),pd.isEmpty(o))throw qy.createEmptyHashError(o);if(t=this.browserStorage.generateStateKey(n),!(t=this.browserStorage.getTemporaryCache(t)))throw ud.createStateNotFoundError("Cached State");try{r=this.authModule.handleFragmentResponse(o,t)}catch(e){throw e instanceof ff&&e.subError===iy.code?qy.createUserCancelledError():e}return[2,this.handleCodeResponseFromServer(r,n,i,s)]})})},Mm.prototype.handleCodeResponseFromServer=function(n,i,s,a,c){return void 0===c&&(c=!0),bh(this,void 0,void 0,function(){var t,r,o;return Ch(this,function(e){switch(e.label){case 0:if(this.logger.trace("InteractionHandler.handleCodeResponseFromServer called"),r=this.browserStorage.generateStateKey(i),!(t=this.browserStorage.getTemporaryCache(r)))throw ud.createStateNotFoundError("Cached State");return r=this.browserStorage.generateNonceKey(t),r=this.browserStorage.getTemporaryCache(r),this.authCodeRequest.code=n.code,n.cloud_instance_host_name?[4,this.updateTokenEndpointAuthority(n.cloud_instance_host_name,s,a)]:[3,2];case 1:e.sent(),e.label=2;case 2:return c&&(n.nonce=r||void 0),n.state=t,n.client_info?this.authCodeRequest.clientInfo=n.client_info:(o=this.checkCcsCredentials())&&(this.authCodeRequest.ccsCredential=o),[4,this.authModule.acquireToken(this.authCodeRequest,n)];case 3:return o=e.sent(),this.browserStorage.cleanRequestByState(i),[2,o]}})})},Mm.prototype.updateTokenEndpointAuthority=function(r,o,n){return bh(this,void 0,void 0,function(){var t;return Ch(this,function(e){switch(e.label){case 0:return t="https://"+r+"/"+o.tenant+"/",[4,Sg.createDiscoveredInstance(t,n,this.browserStorage,o.options,this.logger)];case 1:return t=e.sent(),this.authModule.updateAuthority(t),[2]}})})},Mm.prototype.checkCcsCredentials=function(){var t=this.browserStorage.getTemporaryCache(zy.CCS_CREDENTIAL,!0);if(t)try{return JSON.parse(t)}catch(e){this.authModule.logger.error("Cache credential could not be parsed"),this.authModule.logger.errorPii("Cache credential could not be parsed: "+t)}return null},Mm);function Mm(e,t,r,o){this.authModule=e,this.browserStorage=t,this.authCodeRequest=r,this.logger=o}var Nm,Lm,Dm,qm=(vh(Um,Nm=xm),Um.prototype.initiateAuthRequest=function(r,o){return bh(this,void 0,void 0,function(){var t;return Ch(this,function(e){switch(e.label){case 0:return(this.logger.verbose("RedirectHandler.initiateAuthRequest called"),pd.isEmpty(r))?[3,7]:(o.redirectStartPage&&(this.logger.verbose("RedirectHandler.initiateAuthRequest: redirectStartPage set, caching start page"),this.browserStorage.setTemporaryCache(zy.ORIGIN_URI,o.redirectStartPage,!0)),this.browserStorage.setTemporaryCache(zy.CORRELATION_ID,this.authCodeRequest.correlationId,!0),this.browserStorage.cacheCodeRequest(this.authCodeRequest,this.browserCrypto),this.logger.infoPii("RedirectHandler.initiateAuthRequest: Navigate to: "+r),t={apiId:Ky.acquireTokenRedirect,timeout:o.redirectTimeout,noHistory:!1},"function"!=typeof o.onRedirectNavigate?[3,4]:(this.logger.verbose("RedirectHandler.initiateAuthRequest: Invoking onRedirectNavigate callback"),!1===o.onRedirectNavigate(r)?[3,2]:(this.logger.verbose("RedirectHandler.initiateAuthRequest: onRedirectNavigate did not return false, navigating"),[4,o.navigationClient.navigateExternal(r,t)])));case 1:return e.sent(),[2];case 2:return this.logger.verbose("RedirectHandler.initiateAuthRequest: onRedirectNavigate returned false, stopping navigation"),[2];case 3:return[3,6];case 4:return this.logger.verbose("RedirectHandler.initiateAuthRequest: Navigating window to navigate url"),[4,o.navigationClient.navigateExternal(r,t)];case 5:return e.sent(),[2];case 6:return[3,8];case 7:throw this.logger.info("RedirectHandler.initiateAuthRequest: Navigate url is empty"),qy.createEmptyNavigationUriError();case 8:return[2]}})})},Um.prototype.handleCodeResponseFromHash=function(i,s,a,c){return bh(this,void 0,void 0,function(){var t,r,o,n;return Ch(this,function(e){switch(e.label){case 0:if(this.logger.verbose("RedirectHandler.handleCodeResponse called"),pd.isEmpty(i))throw qy.createEmptyHashError(i);if(this.browserStorage.setInteractionInProgress(!1),o=this.browserStorage.generateStateKey(s),!(t=this.browserStorage.getTemporaryCache(o)))throw ud.createStateNotFoundError("Cached State");try{r=this.authModule.handleFragmentResponse(i,t)}catch(e){throw e instanceof ff&&e.subError===iy.code?qy.createUserCancelledError():e}return o=this.browserStorage.generateNonceKey(t),o=this.browserStorage.getTemporaryCache(o),this.authCodeRequest.code=r.code,r.cloud_instance_host_name?[4,this.updateTokenEndpointAuthority(r.cloud_instance_host_name,a,c)]:[3,2];case 1:e.sent(),e.label=2;case 2:return r.nonce=o||void 0,r.state=t,r.client_info?this.authCodeRequest.clientInfo=r.client_info:(n=this.checkCcsCredentials())&&(this.authCodeRequest.ccsCredential=n),[4,this.authModule.acquireToken(this.authCodeRequest,r)];case 3:return n=e.sent(),this.browserStorage.cleanRequestByState(s),[2,n]}})})},Um);function Um(e,t,r,o,n){o=Nm.call(this,e,t,r,o)||this;return o.browserCrypto=n,o}(o=Lm=Lm||{}).INITIALIZE_START="msal:initializeStart",o.INITIALIZE_END="msal:initializeEnd",o.ACCOUNT_ADDED="msal:accountAdded",o.ACCOUNT_REMOVED="msal:accountRemoved",o.LOGIN_START="msal:loginStart",o.LOGIN_SUCCESS="msal:loginSuccess",o.LOGIN_FAILURE="msal:loginFailure",o.ACQUIRE_TOKEN_START="msal:acquireTokenStart",o.ACQUIRE_TOKEN_SUCCESS="msal:acquireTokenSuccess",o.ACQUIRE_TOKEN_FAILURE="msal:acquireTokenFailure",o.ACQUIRE_TOKEN_NETWORK_START="msal:acquireTokenFromNetworkStart",o.SSO_SILENT_START="msal:ssoSilentStart",o.SSO_SILENT_SUCCESS="msal:ssoSilentSuccess",o.SSO_SILENT_FAILURE="msal:ssoSilentFailure",o.ACQUIRE_TOKEN_BY_CODE_START="msal:acquireTokenByCodeStart",o.ACQUIRE_TOKEN_BY_CODE_SUCCESS="msal:acquireTokenByCodeSuccess",o.ACQUIRE_TOKEN_BY_CODE_FAILURE="msal:acquireTokenByCodeFailure",o.HANDLE_REDIRECT_START="msal:handleRedirectStart",o.HANDLE_REDIRECT_END="msal:handleRedirectEnd",o.POPUP_OPENED="msal:popupOpened",o.LOGOUT_START="msal:logoutStart",o.LOGOUT_SUCCESS="msal:logoutSuccess",o.LOGOUT_FAILURE="msal:logoutFailure",o.LOGOUT_END="msal:logoutEnd",(o=Dm=Dm||{}).USER_INTERACTION_REQUIRED="USER_INTERACTION_REQUIRED",o.USER_CANCEL="USER_CANCEL",o.NO_NETWORK="NO_NETWORK",o.TRANSIENT_ERROR="TRANSIENT_ERROR",o.PERSISTENT_ERROR="PERSISTENT_ERROR",o.DISABLED="DISABLED",o.ACCOUNT_UNAVAILABLE="ACCOUNT_UNAVAILABLE";var jm,Hm={code:"ContentError"},Bm={code:"user_switch",desc:"User attempted to switch accounts in the native broker, which is not allowed. All new accounts must sign-in through the standard web flow first, please try again."},zm={code:"tokens_not_found_in_internal_memory_cache",desc:"Tokens not cached in MSAL JS internal memory, please make the WAM request"},Fm=(vh(Km,jm=gp),Km.prototype.isFatal=function(){return!(!this.ext||!this.ext.status||this.ext.status!==Dm.PERSISTENT_ERROR&&this.ext.status!==Dm.DISABLED)||this.errorCode===Hm.code},Km.createError=function(e,t,r){if(r&&r.status)switch(r.status){case Dm.ACCOUNT_UNAVAILABLE:return zf.createNativeAccountUnavailableError();case Dm.USER_INTERACTION_REQUIRED:return new zf(e,t);case Dm.USER_CANCEL:return qy.createUserCancelledError();case Dm.NO_NETWORK:return qy.createNoNetworkConnectivityError()}return new Km(e,t,r)},Km.createUserSwitchError=function(){return new Km(Bm.code,Bm.desc)},Km.createTokensNotFoundInCacheError=function(){return new Km(zm.code,zm.desc)},Km);function Km(e,t,r){t=jm.call(this,e,t)||this;return Object.setPrototypeOf(t,Km.prototype),t.name="NativeAuthError",t.ext=r,t}var Gm,Ym=(vh(Zm,Gm=Om),Zm.prototype.acquireToken=function(i){return bh(this,void 0,void 0,function(){var t,r,o,n;return Ch(this,function(e){switch(e.label){case 0:return t=this.performanceClient.startMeasurement(ig.SilentCacheClientAcquireToken,i.correlationId),r=this.initializeServerTelemetryManager(Ky.acquireTokenSilent_silentFlow),[4,this.createSilentFlowClient(r,i.authority,i.azureCloudOptions)];case 1:o=e.sent(),this.logger.verbose("Silent auth client created"),e.label=2;case 2:return e.trys.push([2,4,,5]),[4,o.acquireCachedToken(i)];case 3:return n=e.sent(),t.endMeasurement({success:!0,fromCache:!0}),[2,n];case 4:throw(n=e.sent())instanceof qy&&n.errorCode===Ay.code&&this.logger.verbose("Signing keypair for bound access token not found. Refreshing bound access token and generating a new crypto keypair."),t.endMeasurement({errorCode:n instanceof gp&&n.errorCode||void 0,subErrorCode:n instanceof gp&&n.subError||void 0,success:!1}),n;case 5:return[2]}})})},Zm.prototype.logout=function(){return Promise.reject(qy.createSilentLogoutUnsupportedError())},Zm.prototype.createSilentFlowClient=function(r,o,n){return bh(this,void 0,void 0,function(){var t;return Ch(this,function(e){switch(e.label){case 0:return[4,this.getClientConfiguration(r,o,n)];case 1:return t=e.sent(),[2,new dg(t,this.performanceClient)]}})})},Zm.prototype.initializeSilentRequest=function(r,o){return bh(this,void 0,void 0,function(){var t;return Ch(this,function(e){switch(e.label){case 0:return t=[_h({},r)],[4,this.initializeBaseRequest(r)];case 1:return[2,_h.apply(void 0,[_h.apply(void 0,t.concat([e.sent()])),{account:o,forceRefresh:r.forceRefresh||!1}])]}})})},Zm);function Zm(){return null!==Gm&&Gm.apply(this,arguments)||this}var Wm,Vm=(vh(Jm,Wm=Am),Jm.prototype.acquireToken=function(s){return bh(this,void 0,void 0,function(){var t,r,o,n,i;return Ch(this,function(e){switch(e.label){case 0:return this.logger.trace("NativeInteractionClient - acquireToken called."),t=this.performanceClient.startMeasurement(ig.NativeInteractionClientAcquireToken,s.correlationId),r=Pf.nowSeconds(),[4,this.initializeNativeRequest(s)];case 1:o=e.sent(),e.label=2;case 2:return e.trys.push([2,4,,5]),[4,this.acquireTokensFromCache(this.accountId,o)];case 3:return n=e.sent(),t.endMeasurement({success:!0,isNativeBroker:!1,fromCache:!0}),[2,n];case 4:return e.sent(),this.logger.info("MSAL internal Cache does not contain tokens, proceed to make a native call"),[3,5];case 5:return i={method:jy.GetToken,request:o},[4,this.nativeMessageHandler.sendMessage(i)];case 6:return i=e.sent(),i=this.validateNativeResponse(i),[2,this.handleNativeResponse(i,o,r).then(function(e){return t.endMeasurement({success:!0,isNativeBroker:!0,requestId:e.requestId}),e}).catch(function(e){throw t.endMeasurement({success:!1,errorCode:e.errorCode,subErrorCode:e.subError,isNativeBroker:!0}),e})]}})})},Jm.prototype.createSilentCacheRequest=function(e,t){return{authority:e.authority,correlationId:this.correlationId,scopes:Gd.fromString(e.scope).asArray(),account:t,forceRefresh:!1}},Jm.prototype.acquireTokensFromCache=function(o,n){return bh(this,void 0,void 0,function(){var t,r;return Ch(this,function(e){switch(e.label){case 0:if(!(r=this.browserStorage.readAccountFromCacheWithNativeAccountId(o)))throw ud.createNoAccountFoundError();t=r.getAccountInfo(),e.label=1;case 1:return e.trys.push([1,3,,4]),r=this.createSilentCacheRequest(n,t),[4,this.silentCacheClient.acquireToken(r)];case 2:return[2,e.sent()];case 3:throw e.sent();case 4:return[2]}})})},Jm.prototype.acquireTokenRedirect=function(i){return bh(this,void 0,void 0,function(){var t,r,o,n;return Ch(this,function(e){switch(e.label){case 0:return this.logger.trace("NativeInteractionClient - acquireTokenRedirect called."),[4,this.initializeNativeRequest(i)];case 1:t=e.sent(),r={method:jy.GetToken,request:t},e.label=2;case 2:return e.trys.push([2,4,,5]),[4,this.nativeMessageHandler.sendMessage(r)];case 3:return o=e.sent(),this.validateNativeResponse(o),[3,5];case 4:if((n=e.sent())instanceof Fm&&n.isFatal())throw n;return[3,5];case 5:return this.browserStorage.setTemporaryCache(zy.NATIVE_REQUEST,JSON.stringify(t),!0),o={apiId:Ky.acquireTokenRedirect,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},n=this.config.auth.navigateToLoginRequestUrl?window.location.href:this.getRedirectUri(i.redirectUri),[4,this.navigationClient.navigateExternal(n,o)];case 6:return e.sent(),[2]}})})},Jm.prototype.handleRedirectPromise=function(){return bh(this,void 0,void 0,function(){var t,r,o,n;return Ch(this,function(e){switch(e.label){case 0:if(this.logger.trace("NativeInteractionClient - handleRedirectPromise called."),!this.browserStorage.isInteractionInProgress(!0))return this.logger.info("handleRedirectPromise called but there is no interaction in progress, returning null."),[2,null];if(!(r=this.browserStorage.getCachedNativeRequest()))return this.logger.verbose("NativeInteractionClient - handleRedirectPromise called but there is no cached request, returning null."),[2,null];o=r.prompt,t=wh(r,["prompt"]),o&&this.logger.verbose("NativeInteractionClient - handleRedirectPromise called and prompt was included in the original request, removing prompt from cached request to prevent second interaction with native broker window."),this.browserStorage.removeItem(this.browserStorage.generateCacheKey(zy.NATIVE_REQUEST)),r={method:jy.GetToken,request:t},o=Pf.nowSeconds(),e.label=1;case 1:return e.trys.push([1,3,,4]),this.logger.verbose("NativeInteractionClient - handleRedirectPromise sending message to native broker."),[4,this.nativeMessageHandler.sendMessage(r)];case 2:return n=e.sent(),this.validateNativeResponse(n),n=this.handleNativeResponse(n,t,o),this.browserStorage.setInteractionInProgress(!1),[2,n];case 3:throw n=e.sent(),this.browserStorage.setInteractionInProgress(!1),n;case 4:return[2]}})})},Jm.prototype.logout=function(){return this.logger.trace("NativeInteractionClient - logout called."),Promise.reject("Logout not implemented yet")},Jm.prototype.handleNativeResponse=function(f,g,y){return bh(this,void 0,void 0,function(){var t,r,o,n,i,s,a,c,u,l,h,p,d=this;return Ch(this,function(e){switch(e.label){case 0:if(this.logger.trace("NativeInteractionClient - handleNativeResponse called."),t=this.getMATSFromResponse(f),this.performanceClient.addStaticFields({extensionId:this.nativeMessageHandler.getExtensionId(),extensionVersion:this.nativeMessageHandler.getExtensionVersion(),matsBrokerVersion:t?t.broker_version:void 0,matsAccountJoinOnStart:t?t.account_join_on_start:void 0,matsAccountJoinOnEnd:t?t.account_join_on_end:void 0,matsDeviceJoin:t?t.device_join:void 0,matsPromptBehavior:t?t.prompt_behavior:void 0,matsApiErrorCode:t?t.api_error_code:void 0,matsUiVisible:t?t.ui_visible:void 0,matsSilentCode:t?t.silent_code:void 0,matsSilentBiSubCode:t?t.silent_bi_sub_code:void 0,matsSilentMessage:t?t.silent_message:void 0,matsSilentStatus:t?t.silent_status:void 0,matsHttpStatus:t?t.http_status:void 0,matsHttpEventCount:t?t.http_event_count:void 0},this.correlationId),f.account.id!==g.accountId)throw Fm.createUserSwitchError();return r=new Qd(f.id_token||Lh.EMPTY_STRING,this.browserCrypto),[4,this.getDiscoveredAuthority(g.authority)];case 1:return o=e.sent(),c=o.getPreferredCache(),n=Vd.generateHomeAccountId(f.client_info||Lh.EMPTY_STRING,Kd.Default,this.logger,this.browserCrypto,r),i=Vd.createAccount(f.client_info,n,r,void 0,void 0,void 0,c,f.account.id),this.browserStorage.setAccount(i),s=f.scope?Gd.fromString(f.scope):Gd.fromString(g.scope),l=f.account.properties||{},a=l.UID||r.claims.oid||r.claims.sub||Lh.EMPTY_STRING,c=l.TenantId||r.claims.tid||Lh.EMPTY_STRING,l=Xh.BEARER,g.tokenType===Xh.POP?[3,2]:[3,4];case 2:if(l=Xh.POP,f.shr)return this.logger.trace("handleNativeServerResponse: SHR is enabled in native layer"),u=f.shr,[3,5];if(h=new Jf(this.browserCrypto),p={resourceRequestMethod:g.resourceRequestMethod,resourceRequestUri:g.resourceRequestUri,shrClaims:g.shrClaims,shrNonce:g.shrNonce},!g.keyId)throw ud.createKeyIdMissingError();return[4,h.signPopToken(f.access_token,g.keyId,p)];case 3:return u=e.sent(),[3,5];case 4:u=f.access_token,e.label=5;case 5:return h={authority:o.canonicalAuthority,uniqueId:a,tenantId:c,scopes:s.asArray(),account:i.getAccountInfo(),idToken:f.id_token,idTokenClaims:r.claims,accessToken:u,fromCache:!!t&&this.isResponseFromCache(t),expiresOn:new Date(1e3*Number(y+f.expires_in)),tokenType:l,correlationId:this.correlationId,state:f.state,fromNativeBroker:!0},p=Af.createIdTokenEntity(n,g.authority,f.id_token||Lh.EMPTY_STRING,g.clientId,r.claims.tid||Lh.EMPTY_STRING),this.nativeStorageManager.setIdTokenCredential(p),p=l===Xh.POP?Lh.SHR_NONCE_VALIDITY:("string"==typeof f.expires_in?parseInt(f.expires_in,10):f.expires_in)||0,p=y+p,p=xf.createAccessTokenEntity(n,g.authority,u,g.clientId,c,s.printScopes(),p,0,this.browserCrypto),this.nativeStorageManager.setAccessTokenCredential(p),this.browserStorage.removeAccountContext(i).catch(function(e){d.logger.error("Error occurred while removing account context from browser storage. "+e)}),[2,h]}})})},Jm.prototype.validateNativeResponse=function(e){if(e.hasOwnProperty("access_token")&&e.hasOwnProperty("id_token")&&e.hasOwnProperty("client_info")&&e.hasOwnProperty("account")&&e.hasOwnProperty("scope")&&e.hasOwnProperty("expires_in"))return e;throw Fm.createUnexpectedError("Response missing expected properties.")},Jm.prototype.getMATSFromResponse=function(e){if(e.properties.MATS)try{return JSON.parse(e.properties.MATS)}catch(e){this.logger.error("NativeInteractionClient - Error parsing MATS telemetry, returning null instead")}return null},Jm.prototype.isResponseFromCache=function(e){return void 0===e.is_cached?(this.logger.verbose("NativeInteractionClient - MATS telemetry does not contain field indicating if response was served from cache. Returning false."),!1):!!e.is_cached},Jm.prototype.initializeNativeRequest=function(a){return bh(this,void 0,void 0,function(){var t,r,o,n,i,s=this;return Ch(this,function(e){switch(e.label){case 0:return(this.logger.trace("NativeInteractionClient - initializeNativeRequest called"),o=a.authority||this.config.auth.authority,(t=new Wf(o)).validateAsUri(),n=a.scopes,r=wh(a,["scopes"]),(o=new Gd(n||[])).appendScopes(Dh),n=function(){switch(s.apiId){case Ky.ssoSilent:case Ky.acquireTokenSilent_silentFlow:return s.logger.trace("initializeNativeRequest: silent request sets prompt to none"),jh.NONE}if(a.prompt)switch(a.prompt){case jh.NONE:case jh.CONSENT:case jh.LOGIN:return s.logger.trace("initializeNativeRequest: prompt is compatible with native flow"),a.prompt;default:throw s.logger.trace("initializeNativeRequest: prompt = "+a.prompt+" is not compatible with native flow"),qy.createNativePromptParameterNotSupportedError()}else s.logger.trace("initializeNativeRequest: prompt was not provided")},n=_h(_h({},r),{accountId:this.accountId,clientId:this.config.auth.clientId,authority:t.urlString,scope:o.printScopes(),redirectUri:this.getRedirectUri(a.redirectUri),prompt:n(),correlationId:this.correlationId,tokenType:a.authenticationScheme,windowTitleSubstring:document.title,extraParameters:_h(_h(_h({},a.extraQueryParameters),a.tokenQueryParameters),{telemetry:Vy}),extendedExpiryToken:!1}),a.authenticationScheme!==Xh.POP)?[3,2]:(i={resourceRequestUri:a.resourceRequestUri,resourceRequestMethod:a.resourceRequestMethod,shrClaims:a.shrClaims,shrNonce:a.shrNonce},[4,new Jf(this.browserCrypto).generateCnf(i)]);case 1:i=e.sent(),n.reqCnf=i.reqCnfHash,n.keyId=i.kid,e.label=2;case 2:return[2,n]}})})},Jm);function Jm(e,t,r,o,n,i,s,a,c,u,l,h){t=Wm.call(this,e,t,r,o,n,i,a,c,h)||this;return t.apiId=s,t.accountId=u,t.nativeMessageHandler=c,t.nativeStorageManager=l,t.silentCacheClient=new Ym(e,t.nativeStorageManager,r,o,n,i,a,c,h),t}var Qm=(Xm.prototype.sendMessage=function(t){return bh(this,void 0,void 0,function(){var r,o=this;return Ch(this,function(e){return this.logger.trace("NativeMessageHandler - sendMessage called."),r={channel:Zy,extensionId:this.extensionId,responseId:this.responseId++,body:t},this.logger.trace("NativeMessageHandler - Sending request to browser extension"),this.logger.tracePii("NativeMessageHandler - Sending request to browser extension: "+JSON.stringify(r)),this.messageChannel.port1.postMessage(r),[2,new Promise(function(e,t){o.resolvers.set(r.responseId,{resolve:e,reject:t})})]})})},Xm.createProvider=function(o,n){return bh(this,void 0,void 0,function(){var t,r;return Ch(this,function(e){switch(e.label){case 0:o.trace("NativeMessageHandler - createProvider called."),e.label=1;case 1:return e.trys.push([1,3,,5]),[4,(t=new Xm(o,n,Wy)).sendHandshakeRequest()];case 2:return e.sent(),[2,t];case 3:return e.sent(),[4,(r=new Xm(o,n)).sendHandshakeRequest()];case 4:return e.sent(),[2,r];case 5:return[2]}})})},Xm.prototype.sendHandshakeRequest=function(){return bh(this,void 0,void 0,function(){var r,o=this;return Ch(this,function(e){return this.logger.trace("NativeMessageHandler - sendHandshakeRequest called."),window.addEventListener("message",this.windowListener,!1),r={channel:Zy,extensionId:this.extensionId,responseId:this.responseId++,body:{method:jy.HandshakeRequest}},this.messageChannel.port1.onmessage=function(e){o.onChannelMessage(e)},window.postMessage(r,window.origin,[this.messageChannel.port2]),[2,new Promise(function(e,t){o.handshakeResolvers.set(r.responseId,{resolve:e,reject:t}),o.timeoutId=window.setTimeout(function(){window.removeEventListener("message",o.windowListener,!1),o.messageChannel.port1.close(),o.messageChannel.port2.close(),t(qy.createNativeHandshakeTimeoutError()),o.handshakeResolvers.delete(r.responseId)},o.handshakeTimeoutMs)})]})})},Xm.prototype.onWindowMessage=function(e){this.logger.trace("NativeMessageHandler - onWindowMessage called"),e.source!==window||(e=e.data).channel&&e.channel===Zy&&(e.extensionId&&e.extensionId!==this.extensionId||e.body.method===jy.HandshakeRequest&&(this.logger.verbose(e.extensionId?"Extension with id: "+e.extensionId+" not installed":"No extension installed"),clearTimeout(this.timeoutId),this.messageChannel.port1.close(),this.messageChannel.port2.close(),window.removeEventListener("message",this.windowListener,!1),(e=this.handshakeResolvers.get(e.responseId))&&e.reject(qy.createNativeExtensionNotInstalledError())))},Xm.prototype.onChannelMessage=function(t){this.logger.trace("NativeMessageHandler - onChannelMessage called.");var e=t.data,r=this.resolvers.get(e.responseId),o=this.handshakeResolvers.get(e.responseId);try{var n=e.body.method;if(n===jy.Response){if(!r)return;var i=e.body.response;if(this.logger.trace("NativeMessageHandler - Received response from browser extension"),this.logger.tracePii("NativeMessageHandler - Received response from browser extension: "+JSON.stringify(i)),"Success"!==i.status)r.reject(Fm.createError(i.code,i.description,i.ext));else{if(!i.result)throw gp.createUnexpectedError("Event does not contain result.");i.result.code&&i.result.description?r.reject(Fm.createError(i.result.code,i.result.description,i.result.ext)):r.resolve(i.result)}this.resolvers.delete(e.responseId)}else if(n===jy.HandshakeResponse){if(!o)return;clearTimeout(this.timeoutId),window.removeEventListener("message",this.windowListener,!1),this.extensionId=e.extensionId,this.extensionVersion=e.body.version,this.logger.verbose("NativeMessageHandler - Received HandshakeResponse from extension: "+this.extensionId),o.resolve(),this.handshakeResolvers.delete(e.responseId)}}catch(e){this.logger.error("Error parsing response from WAM Extension"),this.logger.errorPii("Error parsing response from WAM Extension: "+e.toString()),this.logger.errorPii("Unable to parse "+t),r?r.reject(e):o&&o.reject(e)}},Xm.prototype.getExtensionId=function(){return this.extensionId},Xm.prototype.getExtensionVersion=function(){return this.extensionVersion},Xm.isNativeAvailable=function(e,t,r,o){if(t.trace("isNativeAvailable called"),!e.system.allowNativeBroker)return t.trace("isNativeAvailable: allowNativeBroker is not enabled, returning false"),!1;if(!r)return t.trace("isNativeAvailable: WAM extension provider is not initialized, returning false"),!1;if(o)switch(o){case Xh.BEARER:case Xh.POP:return t.trace("isNativeAvailable: authenticationScheme is supported, returning true"),!0;default:return t.trace("isNativeAvailable: authenticationScheme is not supported, returning false"),!1}return!0},Xm);function Xm(e,t,r){this.logger=e,this.handshakeTimeoutMs=t,this.extensionId=r,this.resolvers=new Map,this.handshakeResolvers=new Map,this.responseId=0,this.messageChannel=new MessageChannel,this.windowListener=this.onWindowMessage.bind(this)}var $m,ev=(vh(tv,$m=Om),tv.prototype.acquireToken=function(u){return bh(this,void 0,void 0,function(){var t,r,o,n,i,s,a,c=this;return Ch(this,function(e){switch(e.label){case 0:return[4,this.initializeAuthorizationRequest(u,Gy.Redirect)];case 1:t=e.sent(),this.browserStorage.updateCacheEntries(t.state,t.nonce,t.authority,t.loginHint||Lh.EMPTY_STRING,t.account||null),r=this.initializeServerTelemetryManager(Ky.acquireTokenRedirect),o=function(e){e.persisted&&(c.logger.verbose("Page was restored from back/forward cache. Clearing temporary cache."),c.browserStorage.cleanRequestByState(t.state))},e.label=2;case 2:return e.trys.push([2,7,,8]),[4,this.initializeAuthorizationCodeRequest(t)];case 3:return n=e.sent(),[4,this.createAuthCodeClient(r,t.authority,t.azureCloudOptions)];case 4:return s=e.sent(),this.logger.verbose("Auth code client created"),i=new qm(s,this.browserStorage,n,this.logger,this.browserCrypto),[4,s.getAuthCodeUrl(_h(_h({},t),{nativeBroker:Qm.isNativeAvailable(this.config,this.logger,this.nativeMessageHandler,u.authenticationScheme)}))];case 5:return s=e.sent(),a=this.getRedirectStartPage(u.redirectStartPage),this.logger.verbosePii("Redirect start page: "+a),window.addEventListener("pageshow",o),[4,i.initiateAuthRequest(s,{navigationClient:this.navigationClient,redirectTimeout:this.config.system.redirectNavigationTimeout,redirectStartPage:a,onRedirectNavigate:u.onRedirectNavigate})];case 6:return[2,e.sent()];case 7:throw(a=e.sent())instanceof gp&&a.setCorrelationId(this.correlationId),window.removeEventListener("pageshow",o),r.cacheFailedRequest(a),this.browserStorage.cleanRequestByState(t.state),a;case 8:return[2]}})})},tv.prototype.handleRedirectPromise=function(h){return bh(this,void 0,void 0,function(){var t,r,o,n,i,s,a,c,u,l;return Ch(this,function(e){switch(e.label){case 0:t=this.initializeServerTelemetryManager(Ky.handleRedirectPromise),e.label=1;case 1:if(e.trys.push([1,10,,11]),!this.browserStorage.isInteractionInProgress(!0))return this.logger.info("handleRedirectPromise called but there is no interaction in progress, returning null."),[2,null];if(!(r=this.getRedirectResponseHash(h||window.location.hash)))return this.logger.info("handleRedirectPromise did not detect a response hash as a result of a redirect. Cleaning temporary cache."),this.browserStorage.cleanRequestByInteractionType(Gy.Redirect),[2,null];o=void 0;try{n=Wf.getDeserializedHash(r),o=this.validateAndExtractStateFromHash(n,Gy.Redirect),this.logger.verbose("State extracted from hash")}catch(e){return this.logger.info("handleRedirectPromise was unable to extract state due to: "+e),this.browserStorage.cleanRequestByInteractionType(Gy.Redirect),[2,null]}return(i=this.browserStorage.getTemporaryCache(zy.ORIGIN_URI,!0)||Lh.EMPTY_STRING,s=Wf.removeHashFromUrl(i),a=Wf.removeHashFromUrl(window.location.href),s===a&&this.config.auth.navigateToLoginRequestUrl)?(this.logger.verbose("Current page is loginRequestUrl, handling hash"),[4,this.handleHash(r,o,t)]):[3,3];case 2:return a=e.sent(),-1<i.indexOf("#")&&Tm.replaceHash(i),[2,a];case 3:return this.config.auth.navigateToLoginRequestUrl?[3,4]:(this.logger.verbose("NavigateToLoginRequestUrl set to false, handling hash"),[2,this.handleHash(r,o,t)]);case 4:return Tm.isInIframe()&&!this.config.system.allowRedirectInIframe?[3,9]:(this.browserStorage.setTemporaryCache(zy.URL_HASH,r,!0),c={apiId:Ky.handleRedirectPromise,timeout:this.config.system.redirectNavigationTimeout,noHistory:!0},u=!0,i&&"null"!==i?[3,6]:(l=Tm.getHomepage(),this.browserStorage.setTemporaryCache(zy.ORIGIN_URI,l,!0),this.logger.warning("Unable to get valid login request url from cache, redirecting to home page"),[4,this.navigationClient.navigateInternal(l,c)]));case 5:return u=e.sent(),[3,8];case 6:return this.logger.verbose("Navigating to loginRequestUrl: "+i),[4,this.navigationClient.navigateInternal(i,c)];case 7:u=e.sent(),e.label=8;case 8:if(!u)return[2,this.handleHash(r,o,t)];e.label=9;case 9:return[2,null];case 10:throw(l=e.sent())instanceof gp&&l.setCorrelationId(this.correlationId),t.cacheFailedRequest(l),this.browserStorage.cleanRequestByInteractionType(Gy.Redirect),l;case 11:return[2]}})})},tv.prototype.getRedirectResponseHash=function(e){if(this.logger.verbose("getRedirectResponseHash called"),Wf.hashContainsKnownProperties(e))return Tm.clearHash(window),this.logger.verbose("Hash contains known properties, returning response hash"),e;e=this.browserStorage.getTemporaryCache(zy.URL_HASH,!0);return this.browserStorage.removeItem(this.browserStorage.generateCacheKey(zy.URL_HASH)),this.logger.verbose("Hash does not contain known properties, returning cached hash"),e},tv.prototype.handleHash=function(i,s,a){return bh(this,void 0,void 0,function(){var t,r,o,n=this;return Ch(this,function(e){switch(e.label){case 0:if(t=this.browserStorage.getCachedRequest(s,this.browserCrypto),this.logger.verbose("handleHash called, retrieved cached request"),(r=Wf.getDeserializedHash(i)).accountId){if(this.logger.verbose("Account id found in hash, calling WAM for token"),!this.nativeMessageHandler)throw qy.createNativeConnectionNotEstablishedError();return r=new Vm(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,Ky.acquireTokenPopup,this.performanceClient,this.nativeMessageHandler,r.accountId,this.browserStorage,t.correlationId),o=Gf.parseRequestState(this.browserCrypto,s).userRequestState,[2,r.acquireToken(_h(_h({},t),{state:o,prompt:void 0})).finally(function(){n.browserStorage.cleanRequestByState(s)})]}if(!(o=this.browserStorage.getCachedAuthority(s)))throw qy.createNoCachedAuthorityError();return[4,this.createAuthCodeClient(a,o)];case 1:return o=e.sent(),this.logger.verbose("Auth code client created"),yf.removeThrottle(this.browserStorage,this.config.auth.clientId,t),[4,new qm(o,this.browserStorage,t,this.logger,this.browserCrypto).handleCodeResponseFromHash(i,s,o.authority,this.networkClient)];case 2:return[2,e.sent()]}})})},tv.prototype.logout=function(s){return bh(this,void 0,void 0,function(){var t,r,o,n,i;return Ch(this,function(e){switch(e.label){case 0:this.logger.verbose("logoutRedirect called"),t=this.initializeLogoutRequest(s),r=this.initializeServerTelemetryManager(Ky.logout),e.label=1;case 1:return e.trys.push([1,10,,11]),this.eventHandler.emitEvent(Lm.LOGOUT_START,Gy.Redirect,s),[4,this.clearCacheOnLogout(t.account)];case 2:return e.sent(),o={apiId:Ky.logout,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},[4,this.createAuthCodeClient(r,s&&s.authority)];case 3:return(i=e.sent(),this.logger.verbose("Auth code client created"),n=i.getLogoutUri(t),this.eventHandler.emitEvent(Lm.LOGOUT_SUCCESS,Gy.Redirect,t),s&&"function"==typeof s.onRedirectNavigate)?!1===s.onRedirectNavigate(n)?[3,5]:(this.logger.verbose("Logout onRedirectNavigate did not return false, navigating"),this.browserStorage.getInteractionInProgress()||this.browserStorage.setInteractionInProgress(!0),[4,this.navigationClient.navigateExternal(n,o)]):[3,7];case 4:return e.sent(),[2];case 5:this.browserStorage.setInteractionInProgress(!1),this.logger.verbose("Logout onRedirectNavigate returned false, stopping navigation"),e.label=6;case 6:return[3,9];case 7:return this.browserStorage.getInteractionInProgress()||this.browserStorage.setInteractionInProgress(!0),[4,this.navigationClient.navigateExternal(n,o)];case 8:return e.sent(),[2];case 9:return[3,11];case 10:throw(i=e.sent())instanceof gp&&i.setCorrelationId(this.correlationId),r.cacheFailedRequest(i),this.eventHandler.emitEvent(Lm.LOGOUT_FAILURE,Gy.Redirect,null,i),this.eventHandler.emitEvent(Lm.LOGOUT_END,Gy.Redirect),i;case 11:return this.eventHandler.emitEvent(Lm.LOGOUT_END,Gy.Redirect),[2]}})})},tv.prototype.getRedirectStartPage=function(e){e=e||window.location.href;return Wf.getAbsoluteUrl(e,Tm.getCurrentUri())},tv);function tv(e,t,r,o,n,i,s,a,c,u){u=$m.call(this,e,t,r,o,n,i,s,c,u)||this;return u.nativeStorage=a,u}var rv,ov=(vh(nv,rv=Om),nv.prototype.acquireToken=function(e){try{var t=this.generatePopupName(e.scopes||Dh,e.authority||this.config.auth.authority),r=e.popupWindowAttributes||{};if(this.config.system.asyncPopups)return this.logger.verbose("asyncPopups set to true, acquiring token"),this.acquireTokenPopupAsync(e,t,r);this.logger.verbose("asyncPopup set to false, opening popup before acquiring token");var o=this.openSizedPopup("about:blank",t,r);return this.acquireTokenPopupAsync(e,t,r,o)}catch(e){return Promise.reject(e)}},nv.prototype.logout=function(e){try{this.logger.verbose("logoutPopup called");var t=this.initializeLogoutRequest(e),r=this.generateLogoutPopupName(t),o=e&&e.authority,n=e&&e.mainWindowRedirectUri,i=(null==e?void 0:e.popupWindowAttributes)||{};if(this.config.system.asyncPopups)return this.logger.verbose("asyncPopups set to true"),this.logoutPopupAsync(t,r,i,o,void 0,n);this.logger.verbose("asyncPopup set to false, opening popup");var s=this.openSizedPopup("about:blank",r,i);return this.logoutPopupAsync(t,r,i,o,s,n)}catch(e){return Promise.reject(e)}},nv.prototype.acquireTokenPopupAsync=function(d,f,g,y){return bh(this,void 0,void 0,function(){var t,r,o,n,i,s,a,c,u,l,h,p=this;return Ch(this,function(e){switch(e.label){case 0:return this.logger.verbose("acquireTokenPopupAsync called"),t=this.initializeServerTelemetryManager(Ky.acquireTokenPopup),[4,this.initializeAuthorizationRequest(d,Gy.Popup)];case 1:r=e.sent(),this.browserStorage.updateCacheEntries(r.state,r.nonce,r.authority,r.loginHint||Lh.EMPTY_STRING,r.account||null),e.label=2;case 2:return e.trys.push([2,8,,9]),[4,this.initializeAuthorizationCodeRequest(r)];case 3:return o=e.sent(),[4,this.createAuthCodeClient(t,r.authority,r.azureCloudOptions)];case 4:return n=e.sent(),this.logger.verbose("Auth code client created"),i=Qm.isNativeAvailable(this.config,this.logger,this.nativeMessageHandler,d.authenticationScheme),s=void 0,i&&(s=this.performanceClient.startMeasurement(ig.FetchAccountIdWithNativeBroker,d.correlationId)),[4,n.getAuthCodeUrl(_h(_h({},r),{nativeBroker:i}))];case 5:return u=e.sent(),a=new xm(n,this.browserStorage,o,this.logger),l={popup:y,popupName:f,popupWindowAttributes:g},u=this.initiateAuthRequest(u,l),this.eventHandler.emitEvent(Lm.POPUP_OPENED,Gy.Popup,{popupWindow:u},null),[4,this.monitorPopupForHash(u)];case 6:if(h=e.sent(),l=Wf.getDeserializedHash(h),c=this.validateAndExtractStateFromHash(l,Gy.Popup,r.correlationId),yf.removeThrottle(this.browserStorage,this.config.auth.clientId,o),l.accountId){if(this.logger.verbose("Account id found in hash, calling WAM for token"),s&&s.endMeasurement({success:!0,isNativeBroker:!0}),!this.nativeMessageHandler)throw qy.createNativeConnectionNotEstablishedError();return u=new Vm(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,Ky.acquireTokenPopup,this.performanceClient,this.nativeMessageHandler,l.accountId,this.nativeStorage,r.correlationId),l=Gf.parseRequestState(this.browserCrypto,c).userRequestState,[2,u.acquireToken(_h(_h({},r),{state:l,prompt:void 0})).finally(function(){p.browserStorage.cleanRequestByState(c)})]}return[4,a.handleCodeResponseFromHash(h,c,n.authority,this.networkClient)];case 7:return[2,e.sent()];case 8:throw h=e.sent(),y&&y.close(),h instanceof gp&&h.setCorrelationId(this.correlationId),t.cacheFailedRequest(h),this.browserStorage.cleanRequestByState(r.state),h;case 9:return[2]}})})},nv.prototype.logoutPopupAsync=function(n,i,s,a,c,u){return bh(this,void 0,void 0,function(){var t,r,o;return Ch(this,function(e){switch(e.label){case 0:this.logger.verbose("logoutPopupAsync called"),this.eventHandler.emitEvent(Lm.LOGOUT_START,Gy.Popup,n),t=this.initializeServerTelemetryManager(Ky.logoutPopup),e.label=1;case 1:return e.trys.push([1,5,,6]),[4,this.clearCacheOnLogout(n.account)];case 2:return e.sent(),[4,this.createAuthCodeClient(t,a)];case 3:return r=e.sent(),this.logger.verbose("Auth code client created"),r=r.getLogoutUri(n),this.eventHandler.emitEvent(Lm.LOGOUT_SUCCESS,Gy.Popup,n),r=this.openPopup(r,{popupName:i,popupWindowAttributes:s,popup:c}),this.eventHandler.emitEvent(Lm.POPUP_OPENED,Gy.Popup,{popupWindow:r},null),[4,this.waitForLogoutPopup(r)];case 4:return e.sent(),u?(o={apiId:Ky.logoutPopup,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},r=Wf.getAbsoluteUrl(u,Tm.getCurrentUri()),this.logger.verbose("Redirecting main window to url specified in the request"),this.logger.verbosePii("Redirecting main window to: "+r),this.navigationClient.navigateInternal(r,o)):this.logger.verbose("No main window navigation requested"),[3,6];case 5:throw o=e.sent(),c&&c.close(),o instanceof gp&&o.setCorrelationId(this.correlationId),this.browserStorage.setInteractionInProgress(!1),this.eventHandler.emitEvent(Lm.LOGOUT_FAILURE,Gy.Popup,null,o),this.eventHandler.emitEvent(Lm.LOGOUT_END,Gy.Popup),t.cacheFailedRequest(o),o;case 6:return this.eventHandler.emitEvent(Lm.LOGOUT_END,Gy.Popup),[2]}})})},nv.prototype.initiateAuthRequest=function(e,t){if(pd.isEmpty(e))throw this.logger.error("Navigate url is empty"),qy.createEmptyNavigationUriError();return this.logger.infoPii("Navigate to: "+e),this.openPopup(e,t)},nv.prototype.monitorPopupForHash=function(a){var c=this;return new Promise(function(r,o){var n=c.config.system.windowHashTimeout/c.config.system.pollIntervalMilliseconds,i=0;c.logger.verbose("PopupHandler.monitorPopupForHash - polling started");var s=setInterval(function(){if(a.closed)return c.logger.error("PopupHandler.monitorPopupForHash - window closed"),c.cleanPopup(),clearInterval(s),void o(qy.createUserCancelledError());var e=Lh.EMPTY_STRING,t=Lh.EMPTY_STRING;try{e=a.location.href,t=a.location.hash}catch(e){}pd.isEmpty(e)||"about:blank"===e||(c.logger.verbose("PopupHandler.monitorPopupForHash - popup window is on same origin as caller"),i++,t?(c.logger.verbose("PopupHandler.monitorPopupForHash - found hash in url"),clearInterval(s),c.cleanPopup(a),Wf.hashContainsKnownProperties(t)?(c.logger.verbose("PopupHandler.monitorPopupForHash - hash contains known properties, returning."),r(t)):(c.logger.error("PopupHandler.monitorPopupForHash - found hash in url but it does not contain known properties. Check that your router is not changing the hash prematurely."),c.logger.errorPii("PopupHandler.monitorPopupForHash - hash found: "+t),o(qy.createHashDoesNotContainKnownPropertiesError()))):n<i&&(c.logger.error("PopupHandler.monitorPopupForHash - unable to find hash in url, timing out"),clearInterval(s),o(qy.createMonitorPopupTimeoutError())))},c.config.system.pollIntervalMilliseconds)})},nv.prototype.waitForLogoutPopup=function(o){var n=this;return new Promise(function(t){n.logger.verbose("PopupHandler.waitForLogoutPopup - polling started");var r=setInterval(function(){o.closed&&(n.logger.error("PopupHandler.waitForLogoutPopup - window closed"),n.cleanPopup(),clearInterval(r),t());var e=Lh.EMPTY_STRING;try{e=o.location.href}catch(e){}pd.isEmpty(e)||"about:blank"===e||(n.logger.verbose("PopupHandler.waitForLogoutPopup - popup window is on same origin as caller, closing."),clearInterval(r),n.cleanPopup(o),t())},n.config.system.pollIntervalMilliseconds)})},nv.prototype.openPopup=function(e,t){try{var r=void 0;if(t.popup?(r=t.popup,this.logger.verbosePii("Navigating popup window to: "+e),r.location.assign(e)):void 0===t.popup&&(this.logger.verbosePii("Opening popup window to: "+e),r=this.openSizedPopup(e,t.popupName,t.popupWindowAttributes)),!r)throw qy.createEmptyWindowCreatedError();return r.focus&&r.focus(),this.currentWindow=r,window.addEventListener("beforeunload",this.unloadWindow),r}catch(e){throw this.logger.error("error opening popup "+e.message),this.browserStorage.setInteractionInProgress(!1),qy.createPopupWindowError(e.toString())}},nv.prototype.openSizedPopup=function(e,t,r){var o=window.screenLeft||window.screenX,n=window.screenTop||window.screenY,i=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,s=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,a=null===(c=r.popupSize)||void 0===c?void 0:c.width,c=null===(u=r.popupSize)||void 0===u?void 0:u.height,u=null===(u=r.popupPosition)||void 0===u?void 0:u.top,r=null===(r=r.popupPosition)||void 0===r?void 0:r.left;return(!a||a<0||i<a)&&(this.logger.verbose("Default popup window width used. Window width not configured or invalid."),a=Yy.POPUP_WIDTH),(!c||c<0||s<c)&&(this.logger.verbose("Default popup window height used. Window height not configured or invalid."),c=Yy.POPUP_HEIGHT),(!u||u<0||s<u)&&(this.logger.verbose("Default popup window top position used. Window top not configured or invalid."),u=Math.max(0,s/2-Yy.POPUP_HEIGHT/2+n)),(!r||r<0||i<r)&&(this.logger.verbose("Default popup window left position used. Window left not configured or invalid."),r=Math.max(0,i/2-Yy.POPUP_WIDTH/2+o)),window.open(e,t,"width="+a+", height="+c+", top="+u+", left="+r+", scrollbars=yes")},nv.prototype.unloadWindow=function(e){this.browserStorage.cleanRequestByInteractionType(Gy.Popup),this.currentWindow&&this.currentWindow.close(),e.preventDefault()},nv.prototype.cleanPopup=function(e){e&&e.close(),window.removeEventListener("beforeunload",this.unloadWindow),this.browserStorage.setInteractionInProgress(!1)},nv.prototype.generatePopupName=function(e,t){return Yy.POPUP_NAME_PREFIX+"."+this.config.auth.clientId+"."+e.join("-")+"."+t+"."+this.correlationId},nv.prototype.generateLogoutPopupName=function(e){e=e.account&&e.account.homeAccountId;return Yy.POPUP_NAME_PREFIX+"."+this.config.auth.clientId+"."+e+"."+this.correlationId},nv);function nv(e,t,r,o,n,i,s,a,c,u){u=rv.call(this,e,t,r,o,n,i,s,c,u)||this;return u.unloadWindow=u.unloadWindow.bind(u),u.nativeStorage=a,u}var iv=(sv.prototype.navigateInternal=function(e,t){return sv.defaultNavigateWindow(e,t)},sv.prototype.navigateExternal=function(e,t){return sv.defaultNavigateWindow(e,t)},sv.defaultNavigateWindow=function(e,t){return t.noHistory?window.location.replace(e):window.location.assign(e),new Promise(function(e){setTimeout(function(){e(!0)},t.timeout)})},sv);function sv(){}var av=6e4,cv=6e3,uv=3e4,lv=2e3;var hv,pv=(vh(dv,hv=xm),dv.prototype.initiateAuthRequest=function(r){return bh(this,void 0,void 0,function(){var t;return Ch(this,function(e){switch(e.label){case 0:if(pd.isEmpty(r))throw this.logger.info("Navigate url is empty"),qy.createEmptyNavigationUriError();return this.navigateFrameWait?[4,this.loadFrame(r)]:[3,2];case 1:return t=e.sent(),[3,3];case 2:t=this.loadFrameSync(r),e.label=3;case 3:return[2,t]}})})},dv.prototype.monitorIframeForHash=function(s,e){var a=this;return new Promise(function(r,o){e<cv&&a.logger.warning("system.loadFrameTimeout or system.iframeHashTimeout set to lower ("+e+"ms) than the default ("+cv+"ms). This may result in timeouts.");var n=window.performance.now()+e,i=setInterval(function(){if(window.performance.now()>n)return a.removeHiddenIframe(s),clearInterval(i),void o(qy.createMonitorIframeTimeoutError());var e=Lh.EMPTY_STRING,t=s.contentWindow;try{e=t?t.location.href:Lh.EMPTY_STRING}catch(e){}pd.isEmpty(e)||(t=t?t.location.hash:Lh.EMPTY_STRING,Wf.hashContainsKnownProperties(t)&&(a.removeHiddenIframe(s),clearInterval(i),r(t)))},a.pollIntervalMilliseconds)})},dv.prototype.loadFrame=function(o){var n=this;return new Promise(function(e,t){var r=n.createHiddenIframe();setTimeout(function(){r?(r.src=o,e(r)):t("Unable to load iframe")},n.navigateFrameWait)})},dv.prototype.loadFrameSync=function(e){var t=this.createHiddenIframe();return t.src=e,t},dv.prototype.createHiddenIframe=function(){var e=document.createElement("iframe");return e.style.visibility="hidden",e.style.position="absolute",e.style.width=e.style.height="0",e.style.border="0",e.setAttribute("sandbox","allow-scripts allow-same-origin allow-forms"),document.getElementsByTagName("body")[0].appendChild(e),e},dv.prototype.removeHiddenIframe=function(e){document.body===e.parentNode&&document.body.removeChild(e)},dv);function dv(e,t,r,o,n){o=hv.call(this,e,t,r,o)||this;return o.navigateFrameWait=n.navigateFrameWait,o.pollIntervalMilliseconds=n.pollIntervalMilliseconds,o}var fv,gv=(vh(yv,fv=Om),yv.prototype.acquireToken=function(i){return bh(this,void 0,void 0,function(){var t,r,o,n;return Ch(this,function(e){switch(e.label){case 0:if(this.logger.verbose("acquireTokenByIframe called"),t=this.performanceClient.startMeasurement(ig.SilentIframeClientAcquireToken,i.correlationId),pd.isEmpty(i.loginHint)&&pd.isEmpty(i.sid)&&(!i.account||pd.isEmpty(i.account.username))&&this.logger.warning("No user hint provided. The authorization server may need more information to complete this request."),i.prompt&&i.prompt!==jh.NONE&&i.prompt!==jh.NO_SESSION)throw t.endMeasurement({success:!1}),qy.createSilentPromptValueError(i.prompt);return[4,this.initializeAuthorizationRequest(_h(_h({},i),{prompt:i.prompt||jh.NONE}),Gy.Silent)];case 1:r=e.sent(),this.browserStorage.updateCacheEntries(r.state,r.nonce,r.authority,r.loginHint||Lh.EMPTY_STRING,r.account||null),o=this.initializeServerTelemetryManager(this.apiId),e.label=2;case 2:return e.trys.push([2,5,,6]),[4,this.createAuthCodeClient(o,r.authority,r.azureCloudOptions)];case 3:return n=e.sent(),this.logger.verbose("Auth code client created"),[4,this.silentTokenHelper(n,r).then(function(e){return t.endMeasurement({success:!0,fromCache:!1,requestId:e.requestId}),e})];case 4:return[2,e.sent()];case 5:throw(n=e.sent())instanceof gp&&n.setCorrelationId(this.correlationId),o.cacheFailedRequest(n),this.browserStorage.cleanRequestByState(r.state),t.endMeasurement({errorCode:n instanceof gp&&n.errorCode||void 0,subErrorCode:n instanceof gp&&n.subError||void 0,success:!1}),n;case 6:return[2]}})})},yv.prototype.logout=function(){return Promise.reject(qy.createSilentLogoutUnsupportedError())},yv.prototype.silentTokenHelper=function(c,u){return bh(this,void 0,void 0,function(){var t,r,o,n,i,s,a=this;return Ch(this,function(e){switch(e.label){case 0:return[4,this.initializeAuthorizationCodeRequest(u)];case 1:return t=e.sent(),[4,c.getAuthCodeUrl(_h(_h({},u),{nativeBroker:Qm.isNativeAvailable(this.config,this.logger,this.nativeMessageHandler,u.authenticationScheme)}))];case 2:return s=e.sent(),[4,(r=new pv(c,this.browserStorage,t,this.logger,this.config.system)).initiateAuthRequest(s)];case 3:return i=e.sent(),[4,r.monitorIframeForHash(i,this.config.system.iframeHashTimeout)];case 4:if(o=e.sent(),s=Wf.getDeserializedHash(o),n=this.validateAndExtractStateFromHash(s,Gy.Silent,t.correlationId),s.accountId){if(this.logger.verbose("Account id found in hash, calling WAM for token"),!this.nativeMessageHandler)throw qy.createNativeConnectionNotEstablishedError();return i=new Vm(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.apiId,this.performanceClient,this.nativeMessageHandler,s.accountId,this.browserStorage,this.correlationId),s=Gf.parseRequestState(this.browserCrypto,n).userRequestState,[2,i.acquireToken(_h(_h({},u),{state:s,prompt:u.prompt||jh.NONE})).finally(function(){a.browserStorage.cleanRequestByState(n)})]}return[2,r.handleCodeResponseFromHash(o,n,c.authority,this.networkClient)]}})})},yv);function yv(e,t,r,o,n,i,s,a,c,u,l){l=fv.call(this,e,t,r,o,n,i,a,u,l)||this;return l.apiId=s,l.nativeStorage=c,l}var mv,vv=(vh(_v,mv=Om),_v.prototype.acquireToken=function(a){return bh(this,void 0,void 0,function(){var t,r,o,n,i,s=this;return Ch(this,function(e){switch(e.label){case 0:return r=[_h({},a)],[4,this.initializeBaseRequest(a)];case 1:return t=_h.apply(void 0,r.concat([e.sent()])),o=this.performanceClient.startMeasurement(ig.SilentRefreshClientAcquireToken,t.correlationId),n=this.initializeServerTelemetryManager(Ky.acquireTokenSilent_silentFlow),[4,this.createRefreshTokenClient(n,t.authority,t.azureCloudOptions)];case 2:return i=e.sent(),this.logger.verbose("Refresh token client created"),[2,i.acquireTokenByRefreshToken(t).then(function(e){return o.endMeasurement({success:!0,fromCache:e.fromCache,requestId:e.requestId}),e}).catch(function(e){throw e instanceof gp&&e.setCorrelationId(s.correlationId),n.cacheFailedRequest(e),o.endMeasurement({errorCode:e.errorCode,subErrorCode:e.subError,success:!1}),e})]}})})},_v.prototype.logout=function(){return Promise.reject(qy.createSilentLogoutUnsupportedError())},_v.prototype.createRefreshTokenClient=function(r,o,n){return bh(this,void 0,void 0,function(){var t;return Ch(this,function(e){switch(e.label){case 0:return[4,this.getClientConfiguration(r,o,n)];case 1:return t=e.sent(),[2,new lg(t,this.performanceClient)]}})})},_v);function _v(){return null!==mv&&mv.apply(this,arguments)||this}var wv=(bv.prototype.addEventCallback=function(e){if("undefined"==typeof window)return null;var t=this.browserCrypto.createNewGuid();return this.eventCallbacks.set(t,e),this.logger.verbose("Event callback registered with id: "+t),t},bv.prototype.removeEventCallback=function(e){this.eventCallbacks.delete(e),this.logger.verbose("Event callback "+e+" removed.")},bv.prototype.enableAccountStorageEvents=function(){"undefined"!=typeof window&&(this.listeningToStorageEvents?this.logger.verbose("Account storage listener already registered."):(this.logger.verbose("Adding account storage listener."),this.listeningToStorageEvents=!0,window.addEventListener("storage",this.handleAccountCacheChange)))},bv.prototype.disableAccountStorageEvents=function(){"undefined"!=typeof window&&(this.listeningToStorageEvents?(this.logger.verbose("Removing account storage listener."),window.removeEventListener("storage",this.handleAccountCacheChange),this.listeningToStorageEvents=!1):this.logger.verbose("No account storage listener registered."))},bv.prototype.emitEvent=function(r,e,t,o){var n,i=this;"undefined"!=typeof window&&(n={eventType:r,interactionType:e||null,payload:t||null,error:o||null,timestamp:Date.now()},this.logger.info("Emitting event: "+r),this.eventCallbacks.forEach(function(e,t){i.logger.verbose("Emitting event to callback "+t+": "+r),e.apply(null,[n])}))},bv.prototype.handleAccountCacheChange=function(e){try{var t=e.newValue||e.oldValue;if(!t)return;var r=JSON.parse(t);if("object"!=typeof r||!Vd.isAccountEntity(r))return;var o=$d.toObject(new Vd,r).getAccountInfo();!e.oldValue&&e.newValue?(this.logger.info("Account was added to cache in a different window"),this.emitEvent(Lm.ACCOUNT_ADDED,void 0,o)):!e.newValue&&e.oldValue&&(this.logger.info("Account was removed from cache in a different window"),this.emitEvent(Lm.ACCOUNT_REMOVED,void 0,o))}catch(e){return}},bv);function bv(e,t){this.eventCallbacks=new Map,this.logger=e,this.browserCrypto=t,this.listeningToStorageEvents=!1,this.handleAccountCacheChange=this.handleAccountCacheChange.bind(this)}var Cv=(Ev.decimalToHex=function(e){for(var t=e.toString(16);t.length<2;)t="0"+t;return t},Ev);function Ev(){}var Sv=(Tv.prototype.generateGuid=function(){try{var e=new Uint8Array(16);return this.cryptoObj.getRandomValues(e),e[6]|=64,e[6]&=79,e[8]|=128,e[8]&=191,Cv.decimalToHex(e[0])+Cv.decimalToHex(e[1])+Cv.decimalToHex(e[2])+Cv.decimalToHex(e[3])+"-"+Cv.decimalToHex(e[4])+Cv.decimalToHex(e[5])+"-"+Cv.decimalToHex(e[6])+Cv.decimalToHex(e[7])+"-"+Cv.decimalToHex(e[8])+Cv.decimalToHex(e[9])+"-"+Cv.decimalToHex(e[10])+Cv.decimalToHex(e[11])+Cv.decimalToHex(e[12])+Cv.decimalToHex(e[13])+Cv.decimalToHex(e[14])+Cv.decimalToHex(e[15])}catch(e){for(var t="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx",r="0123456789abcdef",o=0,n=Lh.EMPTY_STRING,i=0;i<36;i++)"-"!==t[i]&&"4"!==t[i]&&(o=16*Math.random()|0),"x"===t[i]?n+=r[o]:"y"===t[i]?(o&=3,n+=r[o|=8]):n+=t[i];return n}},Tv.prototype.isGuid=function(e){return/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(e)},Tv);function Tv(e){this.cryptoObj=e}var Iv=(Av.stringToUtf8Arr=function(e){for(var t,r=0,o=e.length,n=0;n<o;n++)r+=(t=e.charCodeAt(n))<128?1:t<2048?2:t<65536?3:t<2097152?4:t<67108864?5:6;for(var i=new Uint8Array(r),s=0,a=0;s<r;a++)(t=e.charCodeAt(a))<128?i[s++]=t:(t<2048?i[s++]=192+(t>>>6):(t<65536?i[s++]=224+(t>>>12):(t<2097152?i[s++]=240+(t>>>18):(t<67108864?i[s++]=248+(t>>>24):(i[s++]=252+(t>>>30),i[s++]=128+(t>>>24&63)),i[s++]=128+(t>>>18&63)),i[s++]=128+(t>>>12&63)),i[s++]=128+(t>>>6&63)),i[s++]=128+(63&t));return i},Av.stringToArrayBuffer=function(e){for(var t=new ArrayBuffer(e.length),r=new Uint8Array(t),o=0;o<e.length;o++)r[o]=e.charCodeAt(o);return t},Av.utf8ArrToString=function(e){for(var t,r=Lh.EMPTY_STRING,o=e.length,n=0;n<o;n++)t=e[n],r+=String.fromCharCode(251<t&&t<254&&n+5<o?1073741824*(t-252)+(e[++n]-128<<24)+(e[++n]-128<<18)+(e[++n]-128<<12)+(e[++n]-128<<6)+e[++n]-128:247<t&&t<252&&n+4<o?(t-248<<24)+(e[++n]-128<<18)+(e[++n]-128<<12)+(e[++n]-128<<6)+e[++n]-128:239<t&&t<248&&n+3<o?(t-240<<18)+(e[++n]-128<<12)+(e[++n]-128<<6)+e[++n]-128:223<t&&t<240&&n+2<o?(t-224<<12)+(e[++n]-128<<6)+e[++n]-128:191<t&&t<224&&n+1<o?(t-192<<6)+e[++n]-128:t);return r},Av.getSortedObjectString=function(e){return JSON.stringify(e,Object.keys(e).sort())},Av);function Av(){}var kv=(Pv.prototype.urlEncode=function(e){return encodeURIComponent(this.encode(e).replace(/=/g,Lh.EMPTY_STRING).replace(/\+/g,"-").replace(/\//g,"_"))},Pv.prototype.urlEncodeArr=function(e){return this.base64EncArr(e).replace(/=/g,Lh.EMPTY_STRING).replace(/\+/g,"-").replace(/\//g,"_")},Pv.prototype.encode=function(e){e=Iv.stringToUtf8Arr(e);return this.base64EncArr(e)},Pv.prototype.base64EncArr=function(e){for(var t,r=(3-e.length%3)%3,o=Lh.EMPTY_STRING,n=e.length,i=0,s=0;s<n;s++)i|=e[s]<<(16>>>(t=s%3)&24),2!=t&&e.length-s!=1||(o+=String.fromCharCode(this.uint6ToB64(i>>>18&63),this.uint6ToB64(i>>>12&63),this.uint6ToB64(i>>>6&63),this.uint6ToB64(63&i)),i=0);return 0==r?o:o.substring(0,o.length-r)+(1==r?"=":"==")},Pv.prototype.uint6ToB64=function(e){return e<26?e+65:e<52?e+71:e<62?e-4:62===e?43:63===e?47:65},Pv);function Pv(){}var Ov=(Rv.prototype.decode=function(e){var t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw new Error("Invalid base64 string")}e=this.base64DecToArr(t);return Iv.utf8ArrToString(e)},Rv.prototype.base64DecToArr=function(e,t){for(var r,o=e.replace(/[^A-Za-z0-9\+\/]/g,Lh.EMPTY_STRING),n=o.length,i=t?Math.ceil((3*n+1>>>2)/t)*t:3*n+1>>>2,s=new Uint8Array(i),a=void 0,c=0,u=0,l=0;l<n;l++)if(r=3&l,c|=this.b64ToUint6(o.charCodeAt(l))<<18-6*r,3==r||n-l==1){for(a=0;a<3&&u<i;a++,u++)s[u]=c>>>(16>>>a&24)&255;c=0}return s},Rv.prototype.b64ToUint6=function(e){return 64<e&&e<91?e-65:96<e&&e<123?e-71:47<e&&e<58?e+4:43===e?62:47===e?63:0},Rv);function Rv(){}var xv=(Mv.prototype.generateCodes=function(){return bh(this,void 0,void 0,function(){var t,r;return Ch(this,function(e){switch(e.label){case 0:return t=this.generateCodeVerifier(),[4,this.generateCodeChallengeFromVerifier(t)];case 1:return r=e.sent(),[2,{verifier:t,challenge:r}]}})})},Mv.prototype.generateCodeVerifier=function(){try{var e=new Uint8Array(32);return this.cryptoObj.getRandomValues(e),this.base64Encode.urlEncodeArr(e)}catch(e){throw qy.createPkceNotGeneratedError(e)}},Mv.prototype.generateCodeChallengeFromVerifier=function(r){return bh(this,void 0,void 0,function(){var t;return Ch(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,this.cryptoObj.sha256Digest(r)];case 1:return t=e.sent(),[2,this.base64Encode.urlEncodeArr(new Uint8Array(t))];case 2:throw t=e.sent(),qy.createPkceNotGeneratedError(t);case 3:return[2]}})})},Mv);function Mv(e){this.base64Encode=new kv,this.cryptoObj=e}var Nv=(Lv.prototype.getRandomValues=function(e){return window.crypto.getRandomValues(e)},Lv.prototype.generateKey=function(t,r,o){return bh(this,void 0,void 0,function(){return Ch(this,function(e){return[2,window.crypto.subtle.generateKey(t,r,o)]})})},Lv.prototype.exportKey=function(t){return bh(this,void 0,void 0,function(){return Ch(this,function(e){return[2,window.crypto.subtle.exportKey(Qy,t)]})})},Lv.prototype.importKey=function(t,r,o,n){return bh(this,void 0,void 0,function(){return Ch(this,function(e){return[2,window.crypto.subtle.importKey(Qy,t,r,o,n)]})})},Lv.prototype.sign=function(t,r,o){return bh(this,void 0,void 0,function(){return Ch(this,function(e){return[2,window.crypto.subtle.sign(t,r,o)]})})},Lv.prototype.digest=function(t,r){return bh(this,void 0,void 0,function(){return Ch(this,function(e){return[2,window.crypto.subtle.digest(t,r)]})})},Lv);function Lv(){}var Dv=(qv.prototype.initPrng=function(e){return window.msrCrypto.initPrng(Eh(e))},qv.prototype.getRandomValues=function(e){return window.msrCrypto.getRandomValues(e)},qv.prototype.generateKey=function(t,r,o){return bh(this,void 0,void 0,function(){return Ch(this,function(e){return[2,window.msrCrypto.subtle.generateKey(t,r,o)]})})},qv.prototype.exportKey=function(t){return bh(this,void 0,void 0,function(){return Ch(this,function(e){return[2,window.msrCrypto.subtle.exportKey(Qy,t)]})})},qv.prototype.importKey=function(t,r,o,n){return bh(this,void 0,void 0,function(){return Ch(this,function(e){return[2,window.msrCrypto.subtle.importKey(Qy,t,r,o,n)]})})},qv.prototype.sign=function(t,r,o){return bh(this,void 0,void 0,function(){return Ch(this,function(e){return[2,window.msrCrypto.subtle.sign(t,r,o)]})})},qv.prototype.digest=function(t,r){return bh(this,void 0,void 0,function(){return Ch(this,function(e){return[2,window.msrCrypto.subtle.digest(t,r)]})})},qv);function qv(){}var Uv=(jv.prototype.getRandomValues=function(e){return window.msCrypto.getRandomValues(e)},jv.prototype.generateKey=function(o,n,i){return bh(this,void 0,void 0,function(){return Ch(this,function(e){return[2,new Promise(function(t,r){var e=window.msCrypto.subtle.generateKey(o,n,i);e.addEventListener("complete",function(e){t(e.target.result)}),e.addEventListener("error",function(e){r(e)})})]})})},jv.prototype.exportKey=function(t){return bh(this,void 0,void 0,function(){return Ch(this,function(e){return[2,new Promise(function(r,o){var e=window.msCrypto.subtle.exportKey(Qy,t);e.addEventListener("complete",function(e){var t=e.target.result,t=Iv.utf8ArrToString(new Uint8Array(t)).replace(/\r/g,Lh.EMPTY_STRING).replace(/\n/g,Lh.EMPTY_STRING).replace(/\t/g,Lh.EMPTY_STRING).split(" ").join(Lh.EMPTY_STRING).replace("\0",Lh.EMPTY_STRING);try{r(JSON.parse(t))}catch(e){o(e)}}),e.addEventListener("error",function(e){o(e)})})]})})},jv.prototype.importKey=function(r,n,i,s){return bh(this,void 0,void 0,function(){var t,o;return Ch(this,function(e){return t=Iv.getSortedObjectString(r),o=Iv.stringToArrayBuffer(t),[2,new Promise(function(t,r){var e=window.msCrypto.subtle.importKey(Qy,o,n,i,s);e.addEventListener("complete",function(e){t(e.target.result)}),e.addEventListener("error",function(e){r(e)})})]})})},jv.prototype.sign=function(o,n,i){return bh(this,void 0,void 0,function(){return Ch(this,function(e){return[2,new Promise(function(t,r){var e=window.msCrypto.subtle.sign(o,n,i);e.addEventListener("complete",function(e){t(e.target.result)}),e.addEventListener("error",function(e){r(e)})})]})})},jv.prototype.digest=function(o,n){return bh(this,void 0,void 0,function(){return Ch(this,function(e){return[2,new Promise(function(t,r){var e=window.msCrypto.subtle.digest(o,n.buffer);e.addEventListener("complete",function(e){t(e.target.result)}),e.addEventListener("error",function(e){r(e)})})]})})},jv);function jv(){}var Hv="SHA-256",Bv=new Uint8Array([1,0,1]),zv=(Fv.prototype.hasIECrypto=function(){return"msCrypto"in window},Fv.prototype.hasBrowserCrypto=function(){return"crypto"in window},Fv.prototype.hasMsrCrypto=function(){return"msrCrypto"in window},Fv.prototype.sha256Digest=function(r){return bh(this,void 0,void 0,function(){var t;return Ch(this,function(e){return t=Iv.stringToUtf8Arr(r),[2,this.subtleCrypto.digest({name:Hv},t)]})})},Fv.prototype.getRandomValues=function(e){return this.subtleCrypto.getRandomValues(e)},Fv.prototype.generateKeyPair=function(t,r){return bh(this,void 0,void 0,function(){return Ch(this,function(e){return[2,this.subtleCrypto.generateKey(this.keygenAlgorithmOptions,t,r)]})})},Fv.prototype.exportJwk=function(t){return bh(this,void 0,void 0,function(){return Ch(this,function(e){return[2,this.subtleCrypto.exportKey(t)]})})},Fv.prototype.importJwk=function(t,r,o){return bh(this,void 0,void 0,function(){return Ch(this,function(e){return[2,this.subtleCrypto.importKey(t,this.keygenAlgorithmOptions,r,o)]})})},Fv.prototype.sign=function(t,r){return bh(this,void 0,void 0,function(){return Ch(this,function(e){return[2,this.subtleCrypto.sign(this.keygenAlgorithmOptions,t,r)]})})},Fv);function Fv(e,t){var r;if(this.logger=e,this.cryptoOptions=t,this.hasBrowserCrypto())this.logger.verbose("BrowserCrypto: modern crypto interface available"),this.subtleCrypto=new Nv;else if(this.hasIECrypto())this.logger.verbose("BrowserCrypto: MS crypto interface available"),this.subtleCrypto=new Uv;else{if(!this.hasMsrCrypto()||null===(r=this.cryptoOptions)||void 0===r||!r.useMsrCrypto)throw this.hasMsrCrypto()&&this.logger.info("BrowserCrypto: MSR Crypto interface available but system.cryptoOptions.useMsrCrypto not enabled"),this.logger.error("BrowserCrypto: No crypto interfaces available."),qy.createCryptoNotAvailableError("Browser crypto, msCrypto, or msrCrypto interfaces not available.");this.logger.verbose("BrowserCrypto: MSR crypto interface available"),this.subtleCrypto=new Dv}if(this.subtleCrypto.initPrng){if(this.logger.verbose("BrowserCrypto: Interface requires entropy"),null===(r=this.cryptoOptions)||void 0===r||!r.entropy)throw this.logger.error("BrowserCrypto: Interface requires entropy but none provided."),cm.createEntropyNotProvided();this.logger.verbose("BrowserCrypto: Entropy provided"),this.subtleCrypto.initPrng(this.cryptoOptions.entropy)}this.keygenAlgorithmOptions={name:"RSASSA-PKCS1-v1_5",hash:Hv,modulusLength:2048,publicExponent:Bv}}var Kv=(Gv.prototype.open=function(){return bh(this,void 0,void 0,function(){var o=this;return Ch(this,function(e){return[2,new Promise(function(t,e){var r=window.indexedDB.open(o.dbName,o.version);r.addEventListener("upgradeneeded",function(e){e.target.result.createObjectStore(o.tableName)}),r.addEventListener("success",function(e){o.db=e.target.result,o.dbOpen=!0,t()}),r.addEventListener("error",function(){return e(qy.createDatabaseUnavailableError())})})]})})},Gv.prototype.closeConnection=function(){var e=this.db;e&&this.dbOpen&&(e.close(),this.dbOpen=!1)},Gv.prototype.validateDbIsOpen=function(){return bh(this,void 0,void 0,function(){return Ch(this,function(e){switch(e.label){case 0:return this.dbOpen?[3,2]:[4,this.open()];case 1:return[2,e.sent()];case 2:return[2]}})})},Gv.prototype.getItem=function(n){return bh(this,void 0,void 0,function(){var o=this;return Ch(this,function(e){switch(e.label){case 0:return[4,this.validateDbIsOpen()];case 1:return e.sent(),[2,new Promise(function(t,r){if(!o.db)return r(qy.createDatabaseNotOpenError());var e=o.db.transaction([o.tableName],"readonly").objectStore(o.tableName).get(n);e.addEventListener("success",function(e){o.closeConnection(),t(e.target.result)}),e.addEventListener("error",function(e){o.closeConnection(),r(e)})})]}})})},Gv.prototype.setItem=function(n,i){return bh(this,void 0,void 0,function(){var o=this;return Ch(this,function(e){switch(e.label){case 0:return[4,this.validateDbIsOpen()];case 1:return e.sent(),[2,new Promise(function(e,t){if(!o.db)return t(qy.createDatabaseNotOpenError());var r=o.db.transaction([o.tableName],"readwrite").objectStore(o.tableName).put(i,n);r.addEventListener("success",function(){o.closeConnection(),e()}),r.addEventListener("error",function(e){o.closeConnection(),t(e)})})]}})})},Gv.prototype.removeItem=function(n){return bh(this,void 0,void 0,function(){var o=this;return Ch(this,function(e){switch(e.label){case 0:return[4,this.validateDbIsOpen()];case 1:return e.sent(),[2,new Promise(function(e,t){if(!o.db)return t(qy.createDatabaseNotOpenError());var r=o.db.transaction([o.tableName],"readwrite").objectStore(o.tableName).delete(n);r.addEventListener("success",function(){o.closeConnection(),e()}),r.addEventListener("error",function(e){o.closeConnection(),t(e)})})]}})})},Gv.prototype.getKeys=function(){return bh(this,void 0,void 0,function(){var o=this;return Ch(this,function(e){switch(e.label){case 0:return[4,this.validateDbIsOpen()];case 1:return e.sent(),[2,new Promise(function(t,r){if(!o.db)return r(qy.createDatabaseNotOpenError());var e=o.db.transaction([o.tableName],"readonly").objectStore(o.tableName).getAllKeys();e.addEventListener("success",function(e){o.closeConnection(),t(e.target.result)}),e.addEventListener("error",function(e){o.closeConnection(),r(e)})})]}})})},Gv.prototype.containsKey=function(n){return bh(this,void 0,void 0,function(){var o=this;return Ch(this,function(e){switch(e.label){case 0:return[4,this.validateDbIsOpen()];case 1:return e.sent(),[2,new Promise(function(t,r){if(!o.db)return r(qy.createDatabaseNotOpenError());var e=o.db.transaction([o.tableName],"readonly").objectStore(o.tableName).count(n);e.addEventListener("success",function(e){o.closeConnection(),t(1===e.target.result)}),e.addEventListener("error",function(e){o.closeConnection(),r(e)})})]}})})},Gv.prototype.deleteDatabase=function(){return bh(this,void 0,void 0,function(){return Ch(this,function(e){return this.db&&this.dbOpen&&this.closeConnection(),[2,new Promise(function(e,t){var r=window.indexedDB.deleteDatabase($y);r.addEventListener("success",function(){return e(!0)}),r.addEventListener("blocked",function(){return e(!0)}),r.addEventListener("error",function(){return t(!1)})})]})})},Gv);function Gv(){this.dbName=$y,this.version=1,this.tableName="msal.db.keys",this.dbOpen=!1}var Yv,Zv=(Wv.prototype.handleDatabaseAccessError=function(e){if(!(e instanceof qy&&e.errorCode===Oy.code))throw e;this.logger.error("Could not access persistent storage. This may be caused by browser privacy features which block persistent storage in third-party contexts.")},Wv.prototype.getItem=function(o){return bh(this,void 0,void 0,function(){var t,r;return Ch(this,function(e){switch(e.label){case 0:if(t=this.inMemoryCache.getItem(o))return[3,4];e.label=1;case 1:return e.trys.push([1,3,,4]),this.logger.verbose("Queried item not found in in-memory cache, now querying persistent storage."),[4,this.indexedDBCache.getItem(o)];case 2:return[2,e.sent()];case 3:return r=e.sent(),this.handleDatabaseAccessError(r),[3,4];case 4:return[2,t]}})})},Wv.prototype.setItem=function(r,o){return bh(this,void 0,void 0,function(){var t;return Ch(this,function(e){switch(e.label){case 0:this.inMemoryCache.setItem(r,o),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,this.indexedDBCache.setItem(r,o)];case 2:return e.sent(),[3,4];case 3:return t=e.sent(),this.handleDatabaseAccessError(t),[3,4];case 4:return[2]}})})},Wv.prototype.removeItem=function(r){return bh(this,void 0,void 0,function(){var t;return Ch(this,function(e){switch(e.label){case 0:this.inMemoryCache.removeItem(r),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,this.indexedDBCache.removeItem(r)];case 2:return e.sent(),[3,4];case 3:return t=e.sent(),this.handleDatabaseAccessError(t),[3,4];case 4:return[2]}})})},Wv.prototype.getKeys=function(){return bh(this,void 0,void 0,function(){var t,r;return Ch(this,function(e){switch(e.label){case 0:if(0!==(t=this.inMemoryCache.getKeys()).length)return[3,4];e.label=1;case 1:return e.trys.push([1,3,,4]),this.logger.verbose("In-memory cache is empty, now querying persistent storage."),[4,this.indexedDBCache.getKeys()];case 2:return[2,e.sent()];case 3:return r=e.sent(),this.handleDatabaseAccessError(r),[3,4];case 4:return[2,t]}})})},Wv.prototype.containsKey=function(o){return bh(this,void 0,void 0,function(){var t,r;return Ch(this,function(e){switch(e.label){case 0:if(t=this.inMemoryCache.containsKey(o))return[3,4];e.label=1;case 1:return e.trys.push([1,3,,4]),this.logger.verbose("Key not found in in-memory cache, now querying persistent storage."),[4,this.indexedDBCache.containsKey(o)];case 2:return[2,e.sent()];case 3:return r=e.sent(),this.handleDatabaseAccessError(r),[3,4];case 4:return[2,t]}})})},Wv.prototype.clearInMemory=function(){this.logger.verbose("Deleting in-memory keystore "+this.storeName),this.inMemoryCache.clear(),this.logger.verbose("In-memory keystore "+this.storeName+" deleted")},Wv.prototype.clearPersistent=function(){return bh(this,void 0,void 0,function(){var t;return Ch(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),this.logger.verbose("Deleting persistent keystore"),[4,this.indexedDBCache.deleteDatabase()];case 1:return(t=e.sent())&&this.logger.verbose("Persistent keystore deleted"),[2,t];case 2:return t=e.sent(),this.handleDatabaseAccessError(t),[2,!1];case 3:return[2]}})})},Wv);function Wv(e,t){this.inMemoryCache=new pm,this.indexedDBCache=new Kv,this.logger=e,this.storeName=t}(Am=Yv=Yv||{}).asymmetricKeys="asymmetricKeys",Am.symmetricKeys="symmetricKeys";var Vv=(Jv.prototype.clear=function(){return bh(this,void 0,void 0,function(){var t;return Ch(this,function(e){switch(e.label){case 0:this.asymmetricKeys.clearInMemory(),this.symmetricKeys.clearInMemory(),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,this.asymmetricKeys.clearPersistent()];case 2:return e.sent(),[2,!0];case 3:return(t=e.sent())instanceof Error?this.logger.error("Clearing keystore failed with error: "+t.message):this.logger.error("Clearing keystore failed with unknown error"),[2,!1];case 4:return[2]}})})},Jv);function Jv(e){this.logger=e,this.asymmetricKeys=new Zv(this.logger,Yv.asymmetricKeys),this.symmetricKeys=new Zv(this.logger,Yv.symmetricKeys)}var Qv=(Xv.prototype.createNewGuid=function(){return this.guidGenerator.generateGuid()},Xv.prototype.base64Encode=function(e){return this.b64Encode.encode(e)},Xv.prototype.base64Decode=function(e){return this.b64Decode.decode(e)},Xv.prototype.generatePkceCodes=function(){return bh(this,void 0,void 0,function(){return Ch(this,function(e){return[2,this.pkceGenerator.generateCodes()]})})},Xv.prototype.getPublicKeyThumbprint=function(s){var a;return bh(this,void 0,void 0,function(){var t,r,o,n,i;return Ch(this,function(e){switch(e.label){case 0:return t=null===(a=this.performanceClient)||void 0===a?void 0:a.startMeasurement(ig.CryptoOptsGetPublicKeyThumbprint,s.correlationId),[4,this.browserCrypto.generateKeyPair(Xv.EXTRACTABLE,Xv.POP_KEY_USAGES)];case 1:return r=e.sent(),[4,this.browserCrypto.exportJwk(r.publicKey)];case 2:return o=e.sent(),o={e:o.e,kty:o.kty,n:o.n},o=Iv.getSortedObjectString(o),[4,this.hashString(o)];case 3:return n=e.sent(),[4,this.browserCrypto.exportJwk(r.privateKey)];case 4:return i=e.sent(),[4,this.browserCrypto.importJwk(i,!1,["sign"])];case 5:return i=e.sent(),[4,this.cache.asymmetricKeys.setItem(n,{privateKey:i,publicKey:r.publicKey,requestMethod:s.resourceRequestMethod,requestUri:s.resourceRequestUri})];case 6:return e.sent(),t&&t.endMeasurement({success:!0}),[2,n]}})})},Xv.prototype.removeTokenBindingKey=function(t){return bh(this,void 0,void 0,function(){return Ch(this,function(e){switch(e.label){case 0:return[4,this.cache.asymmetricKeys.removeItem(t)];case 1:return e.sent(),[4,this.cache.asymmetricKeys.containsKey(t)];case 2:return[2,!e.sent()]}})})},Xv.prototype.clearKeystore=function(){return bh(this,void 0,void 0,function(){return Ch(this,function(e){switch(e.label){case 0:return[4,this.cache.clear()];case 1:return[2,e.sent()]}})})},Xv.prototype.signJwt=function(s,a,c){var u;return bh(this,void 0,void 0,function(){var t,r,o,n,i;return Ch(this,function(e){switch(e.label){case 0:return t=null===(u=this.performanceClient)||void 0===u?void 0:u.startMeasurement(ig.CryptoOptsSignJwt,c),[4,this.cache.asymmetricKeys.getItem(a)];case 1:if(!(r=e.sent()))throw qy.createSigningKeyNotFoundInStorageError(a);return[4,this.browserCrypto.exportJwk(r.publicKey)];case 2:return n=e.sent(),i=Iv.getSortedObjectString(n),o=this.b64Encode.urlEncode(JSON.stringify({kid:a})),n=Dg.getShrHeaderString({kid:o,alg:n.alg}),n=this.b64Encode.urlEncode(n),s.cnf={jwk:JSON.parse(i)},i=this.b64Encode.urlEncode(JSON.stringify(s)),n=n+"."+i,i=Iv.stringToArrayBuffer(n),[4,this.browserCrypto.sign(r.privateKey,i)];case 3:return i=e.sent(),i=this.b64Encode.urlEncodeArr(new Uint8Array(i)),i=n+"."+i,t&&t.endMeasurement({success:!0}),[2,i]}})})},Xv.prototype.hashString=function(r){return bh(this,void 0,void 0,function(){var t;return Ch(this,function(e){switch(e.label){case 0:return[4,this.browserCrypto.sha256Digest(r)];case 1:return t=e.sent(),t=new Uint8Array(t),[2,this.b64Encode.urlEncodeArr(t)]}})})},Xv.POP_KEY_USAGES=["sign","verify"],Xv.EXTRACTABLE=!0,Xv);function Xv(e,t,r){this.logger=e,this.browserCrypto=new zv(this.logger,r),this.b64Encode=new kv,this.b64Decode=new Ov,this.guidGenerator=new Sv(this.browserCrypto),this.pkceGenerator=new xv(this.browserCrypto),this.cache=new Vv(this.logger),this.performanceClient=t}var $v=(e_.prototype.loadExternalTokens=function(e,t,r){if(this.logger.info("TokenCache - loadExternalTokens called"),!t.id_token)throw qy.createUnableToLoadTokenError("Please ensure server response includes id token.");var o=new Qd(t.id_token,this.cryptoObj);if(e.account)var n=this.loadAccount(o,e.account.environment,void 0,void 0,e.account.homeAccountId),i=new Kf(n,this.loadIdToken(o,n.homeAccountId,e.account.environment,e.account.tenantId),this.loadAccessToken(e,t,n.homeAccountId,e.account.environment,e.account.tenantId,r),this.loadRefreshToken(e,t,n.homeAccountId,e.account.environment));else{if(!e.authority)throw qy.createUnableToLoadTokenError("Please provide a request with an account or a request with authority.");var s=Cg.generateAuthority(e.authority,e.azureCloudOptions),a={protocolMode:this.config.auth.protocolMode,knownAuthorities:this.config.auth.knownAuthorities,cloudDiscoveryMetadata:this.config.auth.cloudDiscoveryMetadata,authorityMetadata:this.config.auth.authorityMetadata,skipAuthorityMetadataCache:this.config.auth.skipAuthorityMetadataCache},a=new Cg(s,this.config.system.networkClient,this.storage,a,this.logger);if(r.clientInfo){this.logger.trace("TokenCache - homeAccountId from options");n=this.loadAccount(o,a.hostnameAndPort,r.clientInfo,a.authorityType);i=new Kf(n,this.loadIdToken(o,n.homeAccountId,a.hostnameAndPort,a.tenant),this.loadAccessToken(e,t,n.homeAccountId,a.hostnameAndPort,a.tenant,r),this.loadRefreshToken(e,t,n.homeAccountId,a.hostnameAndPort))}else{if(!t.client_info)throw qy.createUnableToLoadTokenError("Please provide clientInfo in the response or options.");this.logger.trace("TokenCache - homeAccountId from response");n=this.loadAccount(o,a.hostnameAndPort,t.client_info,a.authorityType);i=new Kf(n,this.loadIdToken(o,n.homeAccountId,a.hostnameAndPort,a.tenant),this.loadAccessToken(e,t,n.homeAccountId,a.hostnameAndPort,a.tenant,r),this.loadRefreshToken(e,t,n.homeAccountId,a.hostnameAndPort))}}return this.generateAuthenticationResult(e,o,i,a)},e_.prototype.loadAccount=function(e,t,r,o,n){var i;if(n?i=n:void 0!==o&&r&&(i=Vd.generateHomeAccountId(r,o,this.logger,this.cryptoObj,e)),!i)throw qy.createUnableToLoadTokenError("Unexpected missing homeAccountId");t=r?Vd.createAccount(r,i,e,void 0,void 0,void 0,t):Vd.createGenericAccount(i,e,void 0,void 0,void 0,t);if(this.isBrowserEnvironment)return this.logger.verbose("TokenCache - loading account"),this.storage.setAccount(t),t;throw qy.createUnableToLoadTokenError("loadExternalTokens is designed to work in browser environments only.")},e_.prototype.loadIdToken=function(e,t,r,o){o=Af.createIdTokenEntity(t,r,e.rawToken,this.config.auth.clientId,o);if(this.isBrowserEnvironment)return this.logger.verbose("TokenCache - loading id token"),this.storage.setIdTokenCredential(o),o;throw qy.createUnableToLoadTokenError("loadExternalTokens is designed to work in browser environments only.")},e_.prototype.loadAccessToken=function(e,t,r,o,n,i){if(!t.access_token)return this.logger.verbose("TokenCache - No access token provided for caching"),null;if(!t.expires_in)throw qy.createUnableToLoadTokenError("Please ensure server response includes expires_in value.");if(!i.extendedExpiresOn)throw qy.createUnableToLoadTokenError("Please provide an extendedExpiresOn value in the options.");var s=new Gd(e.scopes).printScopes(),e=i.expiresOn||t.expires_in+(new Date).getTime()/1e3,i=i.extendedExpiresOn,i=xf.createAccessTokenEntity(r,o,t.access_token,this.config.auth.clientId,n,s,e,i,this.cryptoObj);if(this.isBrowserEnvironment)return this.logger.verbose("TokenCache - loading access token"),this.storage.setAccessTokenCredential(i),i;throw qy.createUnableToLoadTokenError("loadExternalTokens is designed to work in browser environments only.")},e_.prototype.loadRefreshToken=function(e,t,r,o){if(!t.refresh_token)return this.logger.verbose("TokenCache - No refresh token provided for caching"),null;t=Lf.createRefreshTokenEntity(r,o,t.refresh_token,this.config.auth.clientId);if(this.isBrowserEnvironment)return this.logger.verbose("TokenCache - loading refresh token"),this.storage.setRefreshTokenCredential(t),t;throw qy.createUnableToLoadTokenError("loadExternalTokens is designed to work in browser environments only.")},e_.prototype.generateAuthenticationResult=function(e,t,r,o){var n,i=Lh.EMPTY_STRING,s=[],a=null;null!=r&&r.accessToken&&(i=r.accessToken.secret,s=Gd.fromString(r.accessToken.target).asArray(),a=new Date(1e3*Number(r.accessToken.expiresOn)),n=new Date(1e3*Number(r.accessToken.extendedExpiresOn)));var c=(null==t?void 0:t.claims.oid)||(null==t?void 0:t.claims.sub)||Lh.EMPTY_STRING,u=(null==t?void 0:t.claims.tid)||Lh.EMPTY_STRING;return{authority:o?o.canonicalAuthority:Lh.EMPTY_STRING,uniqueId:c,tenantId:u,scopes:s,account:null!=r&&r.account?r.account.getAccountInfo():null,idToken:t?t.rawToken:Lh.EMPTY_STRING,idTokenClaims:t?t.claims:{},accessToken:i,fromCache:!0,expiresOn:a,correlationId:e.correlationId||Lh.EMPTY_STRING,requestId:Lh.EMPTY_STRING,extExpiresOn:n,familyId:Lh.EMPTY_STRING,tokenType:(null===(n=null==r?void 0:r.accessToken)||void 0===n?void 0:n.tokenType)||Lh.EMPTY_STRING,state:Lh.EMPTY_STRING,cloudGraphHostName:(null===(n=null==r?void 0:r.account)||void 0===n?void 0:n.cloudGraphHostName)||Lh.EMPTY_STRING,msGraphHost:(null===(r=null==r?void 0:r.account)||void 0===r?void 0:r.msGraphHost)||Lh.EMPTY_STRING,code:void 0,fromNativeBroker:!1}},e_);function e_(e,t,r,o){this.isBrowserEnvironment="undefined"!=typeof window,this.config=e,this.storage=t,this.logger=r,this.cryptoObj=o}var t_,r_=(vh(o_,t_=ag),o_);function o_(e){e=t_.call(this,e)||this;return e.includeRedirectUri=!1,e}var n_,i_=(vh(s_,n_=Om),s_.prototype.acquireToken=function(i){return bh(this,void 0,void 0,function(){var t,r,o,n;return Ch(this,function(e){switch(e.label){case 0:if(this.logger.trace("SilentAuthCodeClient.acquireToken called"),!i.code)throw qy.createAuthCodeRequiredError();return[4,this.initializeAuthorizationRequest(i,Gy.Silent)];case 1:t=e.sent(),this.browserStorage.updateCacheEntries(t.state,t.nonce,t.authority,t.loginHint||Lh.EMPTY_STRING,t.account||null),r=this.initializeServerTelemetryManager(this.apiId),e.label=2;case 2:return e.trys.push([2,4,,5]),o=_h(_h({},t),{code:i.code}),[4,this.getClientConfiguration(r,t.authority)];case 3:return n=e.sent(),n=new r_(n),this.logger.verbose("Auth code client created"),[2,new pv(n,this.browserStorage,o,this.logger,this.config.system).handleCodeResponseFromServer({code:i.code,msgraph_host:i.msGraphHost,cloud_graph_host_name:i.cloudGraphHostName,cloud_instance_host_name:i.cloudInstanceHostName},t.state,n.authority,this.networkClient,!1)];case 4:throw(n=e.sent())instanceof gp&&n.setCorrelationId(this.correlationId),r.cacheFailedRequest(n),this.browserStorage.cleanRequestByState(t.state),n;case 5:return[2]}})})},s_.prototype.logout=function(){return Promise.reject(qy.createSilentLogoutUnsupportedError())},s_);function s_(e,t,r,o,n,i,s,a,c,u){u=n_.call(this,e,t,r,o,n,i,a,c,u)||this;return u.apiId=s,u}var a_=(c_.supportsBrowserPerformance=function(){return"undefined"!=typeof window&&void 0!==window.performance&&"function"==typeof window.performance.mark&&"function"==typeof window.performance.measure&&"function"==typeof window.performance.clearMarks&&"function"==typeof window.performance.clearMeasures&&"function"==typeof window.performance.getEntriesByName},c_.prototype.startMeasurement=function(){if(c_.supportsBrowserPerformance())try{window.performance.mark(this.startMark)}catch(e){}},c_.prototype.endMeasurement=function(){if(c_.supportsBrowserPerformance())try{window.performance.mark(this.endMark),window.performance.measure(this.measureName,this.startMark,this.endMark)}catch(e){}},c_.prototype.flushMeasurement=function(){if(c_.supportsBrowserPerformance())try{var e=window.performance.getEntriesByName(this.measureName,"measure");if(0<e.length){var t=e[0].duration;return window.performance.clearMeasures(this.measureName),window.performance.clearMarks(this.startMark),window.performance.clearMarks(this.endMark),t}}catch(e){}return null},c_);function c_(e,t){this.correlationId=t,this.measureName="msal.measure."+e+"."+this.correlationId,this.startMark="msal.start."+e+"."+this.correlationId,this.endMark="msal.end."+e+"."+this.correlationId}var u_,l_=(vh(h_,u_=w),h_.prototype.startPerformanceMeasuremeant=function(e,t){return new a_(e,t)},h_.prototype.generateId=function(){return this.guidGenerator.generateGuid()},h_.prototype.getPageVisibility=function(){var e;return(null===(e=document.visibilityState)||void 0===e?void 0:e.toString())||null},h_.prototype.startMeasurement=function(e,t){var r=this,o=this.getPageVisibility(),n=u_.prototype.startMeasurement.call(this,e,t);return _h(_h({},n),{endMeasurement:function(e){return n.endMeasurement(_h({startPageVisibility:o,endPageVisibility:r.getPageVisibility()},e))}})},h_);function h_(e,t,r,o,n,i,s){i=u_.call(this,e,t,r,o,n,i)||this;return i.browserCrypto=new zv(i.logger,s),i.guidGenerator=new Sv(i.browserCrypto),i}p_.prototype.initialize=function(){return bh(this,void 0,void 0,function(){var t,r;return Ch(this,function(e){switch(e.label){case 0:if(this.logger.trace("initialize called"),this.initialized)return this.logger.info("initialize has already been called, exiting early."),[2];if(this.eventHandler.emitEvent(Lm.INITIALIZE_START),!this.config.system.allowNativeBroker)return[3,4];e.label=1;case 1:return e.trys.push([1,3,,4]),t=this,[4,Qm.createProvider(this.logger,this.config.system.nativeBrokerHandshakeTimeout)];case 2:return t.nativeExtensionProvider=e.sent(),[3,4];case 3:return r=e.sent(),this.logger.verbose(r),[3,4];case 4:return this.initialized=!0,this.eventHandler.emitEvent(Lm.INITIALIZE_END),[2]}})})},p_.prototype.handleRedirectPromise=function(a){return bh(this,void 0,void 0,function(){var t,r,o,n,i,s=this;return Ch(this,function(e){return this.logger.verbose("handleRedirectPromise called"),Tm.blockNativeBrokerCalledBeforeInitialized(this.config.system.allowNativeBroker,this.initialized),t=this.getAllAccounts(),this.isBrowserEnvironment?(r=a||Lh.EMPTY_STRING,void 0===(o=this.redirectResponse.get(r))?(this.eventHandler.emitEvent(Lm.HANDLE_REDIRECT_START,Gy.Redirect),this.logger.verbose("handleRedirectPromise has been called for the first time, storing the promise"),i=this.browserStorage.getCachedNativeRequest(),n=void 0,n=i&&Qm.isNativeAvailable(this.config,this.logger,this.nativeExtensionProvider)&&this.nativeExtensionProvider&&!a?(this.logger.trace("handleRedirectPromise - acquiring token from native platform"),new Vm(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,Ky.handleRedirectPromise,this.performanceClient,this.nativeExtensionProvider,i.accountId,this.nativeInternalStorage,i.correlationId).handleRedirectPromise()):(this.logger.trace("handleRedirectPromise - acquiring token from web flow"),i=this.browserStorage.getTemporaryCache(zy.CORRELATION_ID,!0)||Lh.EMPTY_STRING,this.createRedirectClient(i).handleRedirectPromise(a)),o=n.then(function(e){return e&&(t.length<s.getAllAccounts().length?(s.eventHandler.emitEvent(Lm.LOGIN_SUCCESS,Gy.Redirect,e),s.logger.verbose("handleRedirectResponse returned result, login success")):(s.eventHandler.emitEvent(Lm.ACQUIRE_TOKEN_SUCCESS,Gy.Redirect,e),s.logger.verbose("handleRedirectResponse returned result, acquire token success"))),s.eventHandler.emitEvent(Lm.HANDLE_REDIRECT_END,Gy.Redirect),e}).catch(function(e){throw 0<t.length?s.eventHandler.emitEvent(Lm.ACQUIRE_TOKEN_FAILURE,Gy.Redirect,null,e):s.eventHandler.emitEvent(Lm.LOGIN_FAILURE,Gy.Redirect,null,e),s.eventHandler.emitEvent(Lm.HANDLE_REDIRECT_END,Gy.Redirect),e}),this.redirectResponse.set(r,o)):this.logger.verbose("handleRedirectPromise has been called previously, returning the result from the first call"),[2,o]):(this.logger.verbose("handleRedirectPromise returns null, not browser environment"),[2,null])})})},p_.prototype.acquireTokenRedirect=function(n){return bh(this,void 0,void 0,function(){var t,r,o=this;return Ch(this,function(e){return t=this.getRequestCorrelationId(n),this.logger.verbose("acquireTokenRedirect called",t),this.preflightBrowserEnvironmentCheck(Gy.Redirect),(r=0<this.getAllAccounts().length)?this.eventHandler.emitEvent(Lm.ACQUIRE_TOKEN_START,Gy.Redirect,n):this.eventHandler.emitEvent(Lm.LOGIN_START,Gy.Redirect,n),[2,(this.nativeExtensionProvider&&this.canUseNative(n)?new Vm(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,Ky.acquireTokenRedirect,this.performanceClient,this.nativeExtensionProvider,this.getNativeAccountId(n),this.nativeInternalStorage,n.correlationId).acquireTokenRedirect(n).catch(function(e){if(e instanceof Fm&&e.isFatal())return o.nativeExtensionProvider=void 0,o.createRedirectClient(n.correlationId).acquireToken(n);if(e instanceof zf)return o.logger.verbose("acquireTokenRedirect - Resolving interaction required error thrown by native broker by falling back to web flow"),o.createRedirectClient(n.correlationId).acquireToken(n);throw o.browserStorage.setInteractionInProgress(!1),e}):this.createRedirectClient(n.correlationId).acquireToken(n)).catch(function(e){throw r?o.eventHandler.emitEvent(Lm.ACQUIRE_TOKEN_FAILURE,Gy.Redirect,null,e):o.eventHandler.emitEvent(Lm.LOGIN_FAILURE,Gy.Redirect,null,e),e})]})})},p_.prototype.acquireTokenPopup=function(t){var r=this,e=this.getRequestCorrelationId(t),o=this.performanceClient.startMeasurement(ig.AcquireTokenPopup,e);try{this.logger.verbose("acquireTokenPopup called",e),this.preflightBrowserEnvironmentCheck(Gy.Popup)}catch(e){return Promise.reject(e)}var n=this.getAllAccounts();return 0<n.length?this.eventHandler.emitEvent(Lm.ACQUIRE_TOKEN_START,Gy.Popup,t):this.eventHandler.emitEvent(Lm.LOGIN_START,Gy.Popup,t),(this.canUseNative(t)?this.acquireTokenNative(t,Ky.acquireTokenPopup).then(function(e){return r.browserStorage.setInteractionInProgress(!1),o.endMeasurement({success:!0,isNativeBroker:!0,requestId:e.requestId}),o.flushMeasurement(),e}).catch(function(e){if(e instanceof Fm&&e.isFatal())return r.nativeExtensionProvider=void 0,r.createPopupClient(t.correlationId).acquireToken(t);if(e instanceof zf)return r.logger.verbose("acquireTokenPopup - Resolving interaction required error thrown by native broker by falling back to web flow"),r.createPopupClient(t.correlationId).acquireToken(t);throw r.browserStorage.setInteractionInProgress(!1),e}):this.createPopupClient(t.correlationId).acquireToken(t)).then(function(e){return n.length<r.getAllAccounts().length?r.eventHandler.emitEvent(Lm.LOGIN_SUCCESS,Gy.Popup,e):r.eventHandler.emitEvent(Lm.ACQUIRE_TOKEN_SUCCESS,Gy.Popup,e),o.addStaticFields({accessTokenSize:e.accessToken.length,idTokenSize:e.idToken.length}),o.endMeasurement({success:!0,requestId:e.requestId}),o.flushMeasurement(),e}).catch(function(e){return 0<n.length?r.eventHandler.emitEvent(Lm.ACQUIRE_TOKEN_FAILURE,Gy.Popup,null,e):r.eventHandler.emitEvent(Lm.LOGIN_FAILURE,Gy.Popup,null,e),o.endMeasurement({errorCode:e.errorCode,subErrorCode:e.subError,success:!1}),o.flushMeasurement(),Promise.reject(e)})},p_.prototype.ssoSilent=function(i){return bh(this,void 0,void 0,function(){var t,r,o,n=this;return Ch(this,function(e){return t=this.getRequestCorrelationId(i),r=_h(_h({},i),{prompt:i.prompt,correlationId:t}),this.preflightBrowserEnvironmentCheck(Gy.Silent),o=this.performanceClient.startMeasurement(ig.SsoSilent,t),this.logger.verbose("ssoSilent called",t),this.eventHandler.emitEvent(Lm.SSO_SILENT_START,Gy.Silent,r),[2,(this.canUseNative(r)?this.acquireTokenNative(r,Ky.ssoSilent).catch(function(e){if(e instanceof Fm&&e.isFatal())return n.nativeExtensionProvider=void 0,n.createSilentIframeClient(r.correlationId).acquireToken(r);throw e}):this.createSilentIframeClient(r.correlationId).acquireToken(r)).then(function(e){return n.eventHandler.emitEvent(Lm.SSO_SILENT_SUCCESS,Gy.Silent,e),o.addStaticFields({accessTokenSize:e.accessToken.length,idTokenSize:e.idToken.length}),o.endMeasurement({success:!0,isNativeBroker:e.fromNativeBroker,requestId:e.requestId}),o.flushMeasurement(),e}).catch(function(e){throw n.eventHandler.emitEvent(Lm.SSO_SILENT_FAILURE,Gy.Silent,null,e),o.endMeasurement({errorCode:e.errorCode,subErrorCode:e.subError,success:!1}),o.flushMeasurement(),e})]})})},p_.prototype.acquireTokenByCode=function(s){return bh(this,void 0,void 0,function(){var t,r,o,n,i=this;return Ch(this,function(e){t=this.getRequestCorrelationId(s),this.preflightBrowserEnvironmentCheck(Gy.Silent),this.logger.trace("acquireTokenByCode called",t),this.eventHandler.emitEvent(Lm.ACQUIRE_TOKEN_BY_CODE_START,Gy.Silent,s),r=this.performanceClient.startMeasurement(ig.AcquireTokenByCode,s.correlationId);try{if(s.code)return o=s.code,(n=this.hybridAuthCodeResponses.get(o))?(this.logger.verbose("Existing acquireTokenByCode request found",s.correlationId),r.endMeasurement({success:!0}),r.discardMeasurement()):(this.logger.verbose("Initiating new acquireTokenByCode request",t),n=this.acquireTokenByCodeAsync(_h(_h({},s),{correlationId:t})).then(function(e){return i.eventHandler.emitEvent(Lm.ACQUIRE_TOKEN_BY_CODE_SUCCESS,Gy.Silent,e),i.hybridAuthCodeResponses.delete(o),r.addStaticFields({accessTokenSize:e.accessToken.length,idTokenSize:e.idToken.length}),r.endMeasurement({success:!0,isNativeBroker:e.fromNativeBroker,requestId:e.requestId}),r.flushMeasurement(),e}).catch(function(e){throw i.hybridAuthCodeResponses.delete(o),i.eventHandler.emitEvent(Lm.ACQUIRE_TOKEN_BY_CODE_FAILURE,Gy.Silent,null,e),r.endMeasurement({errorCode:e.errorCode,subErrorCode:e.subError,success:!1}),r.flushMeasurement(),e}),this.hybridAuthCodeResponses.set(o,n)),[2,n];if(s.nativeAccountId){if(this.canUseNative(s,s.nativeAccountId))return[2,this.acquireTokenNative(s,Ky.acquireTokenByCode,s.nativeAccountId).catch(function(e){throw e instanceof Fm&&e.isFatal()&&(i.nativeExtensionProvider=void 0),e})];throw qy.createUnableToAcquireTokenFromNativePlatformError()}throw qy.createAuthCodeOrNativeAccountIdRequiredError()}catch(e){throw this.eventHandler.emitEvent(Lm.ACQUIRE_TOKEN_BY_CODE_FAILURE,Gy.Silent,null,e),r.endMeasurement({errorCode:e instanceof gp&&e.errorCode||void 0,subErrorCode:e instanceof gp&&e.subError||void 0,success:!1}),e}return[2]})})},p_.prototype.acquireTokenByCodeAsync=function(t){return bh(this,void 0,void 0,function(){return Ch(this,function(e){switch(e.label){case 0:return this.logger.trace("acquireTokenByCodeAsync called",t.correlationId),[4,this.createSilentAuthCodeClient(t.correlationId).acquireToken(t)];case 1:return[2,e.sent()]}})})},p_.prototype.acquireTokenFromCache=function(t,r,o){return bh(this,void 0,void 0,function(){return Ch(this,function(e){switch(o.cacheLookupPolicy){case Xy.Default:case Xy.AccessToken:case Xy.AccessTokenAndRefreshToken:return[2,t.acquireToken(r)];default:throw ud.createRefreshRequiredError()}return[2]})})},p_.prototype.acquireTokenByRefreshToken=function(t,r){return bh(this,void 0,void 0,function(){return Ch(this,function(e){switch(r.cacheLookupPolicy){case Xy.Default:case Xy.AccessTokenAndRefreshToken:case Xy.RefreshToken:case Xy.RefreshTokenAndNetwork:return[2,this.createSilentRefreshClient(t.correlationId).acquireToken(t)];default:throw ud.createRefreshRequiredError()}return[2]})})},p_.prototype.acquireTokenBySilentIframe=function(t){return bh(this,void 0,void 0,function(){return Ch(this,function(e){return[2,this.createSilentIframeClient(t.correlationId).acquireToken(t)]})})},p_.prototype.logout=function(r){return bh(this,void 0,void 0,function(){var t;return Ch(this,function(e){return t=this.getRequestCorrelationId(r),this.logger.warning("logout API is deprecated and will be removed in msal-browser v3.0.0. Use logoutRedirect instead.",t),[2,this.logoutRedirect(_h({correlationId:t},r))]})})},p_.prototype.logoutRedirect=function(r){return bh(this,void 0,void 0,function(){var t;return Ch(this,function(e){return t=this.getRequestCorrelationId(r),this.preflightBrowserEnvironmentCheck(Gy.Redirect),[2,this.createRedirectClient(t).logout(r)]})})},p_.prototype.logoutPopup=function(e){try{var t=this.getRequestCorrelationId(e);return this.preflightBrowserEnvironmentCheck(Gy.Popup),this.createPopupClient(t).logout(e)}catch(e){return Promise.reject(e)}},p_.prototype.getAllAccounts=function(){return this.logger.verbose("getAllAccounts called"),this.isBrowserEnvironment?this.browserStorage.getAllAccounts():[]},p_.prototype.getAccountByUsername=function(t){var e=this.getAllAccounts();return!pd.isEmpty(t)&&e&&e.length?(this.logger.verbose("Account matching username found, returning"),this.logger.verbosePii("Returning signed-in accounts matching username: "+t),e.filter(function(e){return e.username.toLowerCase()===t.toLowerCase()})[0]||null):(this.logger.verbose("getAccountByUsername: No matching account found, returning null"),null)},p_.prototype.getAccountByHomeId=function(t){var e=this.getAllAccounts();return!pd.isEmpty(t)&&e&&e.length?(this.logger.verbose("Account matching homeAccountId found, returning"),this.logger.verbosePii("Returning signed-in accounts matching homeAccountId: "+t),e.filter(function(e){return e.homeAccountId===t})[0]||null):(this.logger.verbose("getAccountByHomeId: No matching account found, returning null"),null)},p_.prototype.getAccountByLocalId=function(t){var e=this.getAllAccounts();return!pd.isEmpty(t)&&e&&e.length?(this.logger.verbose("Account matching localAccountId found, returning"),this.logger.verbosePii("Returning signed-in accounts matching localAccountId: "+t),e.filter(function(e){return e.localAccountId===t})[0]||null):(this.logger.verbose("getAccountByLocalId: No matching account found, returning null"),null)},p_.prototype.setActiveAccount=function(e){this.browserStorage.setActiveAccount(e)},p_.prototype.getActiveAccount=function(){return this.browserStorage.getActiveAccount()},p_.prototype.preflightBrowserEnvironmentCheck=function(e,t){if(void 0===t&&(t=!0),this.logger.verbose("preflightBrowserEnvironmentCheck started"),Tm.blockNonBrowserEnvironment(this.isBrowserEnvironment),Tm.blockRedirectInIframe(e,this.config.system.allowRedirectInIframe),Tm.blockReloadInHiddenIframes(),Tm.blockAcquireTokenInPopups(),Tm.blockNativeBrokerCalledBeforeInitialized(this.config.system.allowNativeBroker,this.initialized),e===Gy.Redirect&&this.config.cache.cacheLocation===Hy.MemoryStorage&&!this.config.cache.storeAuthStateInCookie)throw cm.createInMemoryRedirectUnavailableError();e!==Gy.Redirect&&e!==Gy.Popup||this.preflightInteractiveRequest(t)},p_.prototype.preflightInteractiveRequest=function(e){this.logger.verbose("preflightInteractiveRequest called, validating app environment"),Tm.blockReloadInHiddenIframes(),e&&this.browserStorage.setInteractionInProgress(!0)},p_.prototype.acquireTokenNative=function(t,r,o){return bh(this,void 0,void 0,function(){return Ch(this,function(e){if(this.logger.trace("acquireTokenNative called"),!this.nativeExtensionProvider)throw qy.createNativeConnectionNotEstablishedError();return[2,new Vm(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,r,this.performanceClient,this.nativeExtensionProvider,o||this.getNativeAccountId(t),this.nativeInternalStorage,t.correlationId).acquireToken(t)]})})},p_.prototype.canUseNative=function(e,t){if(this.logger.trace("canUseNative called"),!Qm.isNativeAvailable(this.config,this.logger,this.nativeExtensionProvider,e.authenticationScheme))return this.logger.trace("canUseNative: isNativeAvailable returned false, returning false"),!1;if(e.prompt)switch(e.prompt){case jh.NONE:case jh.CONSENT:case jh.LOGIN:this.logger.trace("canUseNative: prompt is compatible with native flow");break;default:return this.logger.trace("canUseNative: prompt = "+e.prompt+" is not compatible with native flow, returning false"),!1}return!(!t&&!this.getNativeAccountId(e))||(this.logger.trace("canUseNative: nativeAccountId is not available, returning false"),!1)},p_.prototype.getNativeAccountId=function(e){e=e.account||this.browserStorage.getAccountInfoByHints(e.loginHint,e.sid)||this.getActiveAccount();return e&&e.nativeAccountId||""},p_.prototype.createPopupClient=function(e){return new ov(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeInternalStorage,this.nativeExtensionProvider,e)},p_.prototype.createRedirectClient=function(e){return new ev(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeInternalStorage,this.nativeExtensionProvider,e)},p_.prototype.createSilentIframeClient=function(e){return new gv(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,Ky.ssoSilent,this.performanceClient,this.nativeInternalStorage,this.nativeExtensionProvider,e)},p_.prototype.createSilentCacheClient=function(e){return new Ym(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeExtensionProvider,e)},p_.prototype.createSilentRefreshClient=function(e){return new vv(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeExtensionProvider,e)},p_.prototype.createSilentAuthCodeClient=function(e){return new i_(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,Ky.acquireTokenByCode,this.performanceClient,this.nativeExtensionProvider,e)},p_.prototype.addEventCallback=function(e){return this.eventHandler.addEventCallback(e)},p_.prototype.removeEventCallback=function(e){this.eventHandler.removeEventCallback(e)},p_.prototype.addPerformanceCallback=function(e){return this.performanceClient.addPerformanceCallback(e)},p_.prototype.removePerformanceCallback=function(e){return this.performanceClient.removePerformanceCallback(e)},p_.prototype.enableAccountStorageEvents=function(){this.eventHandler.enableAccountStorageEvents()},p_.prototype.disableAccountStorageEvents=function(){this.eventHandler.disableAccountStorageEvents()},p_.prototype.getTokenCache=function(){return this.tokenCache},p_.prototype.getLogger=function(){return this.logger},p_.prototype.setLogger=function(e){this.logger=e},p_.prototype.initializeWrapperLibrary=function(e,t){this.browserStorage.setWrapperMetadata(e,t)},p_.prototype.setNavigationClient=function(e){this.navigationClient=e},p_.prototype.getConfiguration=function(){return this.config},p_.prototype.getRequestCorrelationId=function(e){return null!=e&&e.correlationId?e.correlationId:this.isBrowserEnvironment?this.browserCrypto.createNewGuid():Lh.EMPTY_STRING},w=p_;function p_(e){var t,r,o,n,i,s,a;this.isBrowserEnvironment="undefined"!=typeof window,this.config=(t=e,s=this.isBrowserEnvironment,r=t.auth,o=t.cache,n=t.system,a=t.telemetry,i={clientId:Lh.EMPTY_STRING,authority:""+Lh.DEFAULT_AUTHORITY,knownAuthorities:[],cloudDiscoveryMetadata:Lh.EMPTY_STRING,authorityMetadata:Lh.EMPTY_STRING,redirectUri:Lh.EMPTY_STRING,postLogoutRedirectUri:Lh.EMPTY_STRING,navigateToLoginRequestUrl:!0,clientCapabilities:[],protocolMode:gg.AAD,azureCloudOptions:{azureCloudInstance:yd.None,tenant:Lh.EMPTY_STRING},skipAuthorityMetadataCache:!1},e={cacheLocation:Hy.SessionStorage,storeAuthStateInCookie:!1,secureCookies:!1},t={loggerCallback:function(){},logLevel:hd.Info,piiLoggingEnabled:!1},t=_h(_h({},nf),{loggerOptions:t,networkClient:s?Tm.getBrowserNetworkClient():Rg,navigationClient:new iv,loadFrameTimeout:0,windowHashTimeout:(null==n?void 0:n.loadFrameTimeout)||av,iframeHashTimeout:(null==n?void 0:n.loadFrameTimeout)||cv,navigateFrameWait:s&&Tm.detectIEOrEdge()?500:0,redirectNavigationTimeout:uv,asyncPopups:!1,allowRedirectInIframe:!1,allowNativeBroker:!1,nativeBrokerHandshakeTimeout:(null==n?void 0:n.nativeBrokerHandshakeTimeout)||lv,pollIntervalMilliseconds:Yy.DEFAULT_POLL_INTERVAL_MS,cryptoOptions:{useMsrCrypto:!1,entropy:void 0}}),s={application:{appName:Lh.EMPTY_STRING,appVersion:Lh.EMPTY_STRING}},{auth:_h(_h({},i),r),cache:_h(_h({},e),o),system:_h(_h({},t),n),telemetry:_h(_h({},s),a)}),this.initialized=!1,this.logger=new fd(this.config.system.loggerOptions,_m,wm),this.networkClient=this.config.system.networkClient,this.navigationClient=this.config.system.navigationClient,this.redirectResponse=new Map,this.hybridAuthCodeResponses=new Map,this.performanceClient=this.isBrowserEnvironment?new l_(this.config.auth.clientId,this.config.auth.authority,this.logger,_m,wm,this.config.telemetry.application,this.config.system.cryptoOptions):new Kg(this.config.auth.clientId,this.config.auth.authority,this.logger,_m,wm,this.config.telemetry.application),this.browserCrypto=this.isBrowserEnvironment?new Qv(this.logger,this.performanceClient,this.config.system.cryptoOptions):vp,this.eventHandler=new wv(this.logger,this.browserCrypto),this.browserStorage=this.isBrowserEnvironment?new mm(this.config.auth.clientId,this.config.cache,this.browserCrypto,this.logger):(s=this.config.auth.clientId,c=this.logger,a={cacheLocation:Hy.MemoryStorage,storeAuthStateInCookie:!1,secureCookies:!1},new mm(s,a,vp,c));var c={cacheLocation:Hy.MemoryStorage,storeAuthStateInCookie:!1,secureCookies:!1};this.nativeInternalStorage=new mm(this.config.auth.clientId,c,this.browserCrypto,this.logger),this.tokenCache=new $v(this.config,this.browserStorage,this.logger,this.browserCrypto)}var d_,f_=(vh(g_,d_=w),g_.prototype.loginRedirect=function(r){return bh(this,void 0,void 0,function(){var t;return Ch(this,function(e){return t=this.getRequestCorrelationId(r),this.logger.verbose("loginRedirect called",t),[2,this.acquireTokenRedirect(_h({correlationId:t},r||Jy))]})})},g_.prototype.loginPopup=function(e){var t=this.getRequestCorrelationId(e);return this.logger.verbose("loginPopup called",t),this.acquireTokenPopup(_h({correlationId:t},e||Jy))},g_.prototype.acquireTokenSilent=function(a){return bh(this,void 0,void 0,function(){var t,r,o,n,i,s=this;return Ch(this,function(e){if(t=this.getRequestCorrelationId(a),(r=this.performanceClient.startMeasurement(ig.AcquireTokenSilent,t)).addStaticFields({cacheLookupPolicy:a.cacheLookupPolicy}),this.preflightBrowserEnvironmentCheck(Gy.Silent),this.logger.verbose("acquireTokenSilent called",t),!(i=a.account||this.getActiveAccount()))throw qy.createNoAccountError();return n={clientId:this.config.auth.clientId,authority:a.authority||Lh.EMPTY_STRING,scopes:a.scopes,homeAccountIdentifier:i.homeAccountId,claims:a.claims,authenticationScheme:a.authenticationScheme,resourceRequestMethod:a.resourceRequestMethod,resourceRequestUri:a.resourceRequestUri,shrClaims:a.shrClaims,sshKid:a.sshKid},o=JSON.stringify(n),void 0===(n=this.activeSilentTokenRequests.get(o))?(this.logger.verbose("acquireTokenSilent called for the first time, storing active request",t),i=this.acquireTokenSilentAsync(_h(_h({},a),{correlationId:t}),i).then(function(e){return s.activeSilentTokenRequests.delete(o),r.addStaticFields({accessTokenSize:e.accessToken.length,idTokenSize:e.idToken.length}),r.endMeasurement({success:!0,fromCache:e.fromCache,isNativeBroker:e.fromNativeBroker,requestId:e.requestId}),r.flushMeasurement(),e}).catch(function(e){throw s.activeSilentTokenRequests.delete(o),r.endMeasurement({errorCode:e.errorCode,subErrorCode:e.subError,success:!1}),r.flushMeasurement(),e}),this.activeSilentTokenRequests.set(o,i),[2,i]):(this.logger.verbose("acquireTokenSilent has been called previously, returning the result from the first call",t),r.endMeasurement({success:!0}),r.discardMeasurement(),[2,n])})})},g_.prototype.acquireTokenSilentAsync=function(a,c){return bh(this,void 0,void 0,function(){var t,r,o,n,i,s=this;return Ch(this,function(e){switch(e.label){case 0:return(this.eventHandler.emitEvent(Lm.ACQUIRE_TOKEN_START,Gy.Silent,a),t=this.performanceClient.startMeasurement(ig.AcquireTokenSilentAsync,a.correlationId),Qm.isNativeAvailable(this.config,this.logger,this.nativeExtensionProvider,a.authenticationScheme)&&c.nativeAccountId)?(this.logger.verbose("acquireTokenSilent - attempting to acquire token from native platform"),r=_h(_h({},a),{account:c}),r=this.acquireTokenNative(r,Ky.acquireTokenSilent_silentFlow).catch(function(t){return bh(s,void 0,void 0,function(){return Ch(this,function(e){if(t instanceof Fm&&t.isFatal())return this.logger.verbose("acquireTokenSilent - native platform unavailable, falling back to web flow"),this.nativeExtensionProvider=void 0,[2,this.createSilentIframeClient(a.correlationId).acquireToken(a)];throw t})})}),[3,3]):[3,1];case 1:return this.logger.verbose("acquireTokenSilent - attempting to acquire token from web flow"),[4,(o=this.createSilentCacheClient(a.correlationId)).initializeSilentRequest(a,c)];case 2:n=e.sent(),i=_h(_h({},a),{cacheLookupPolicy:a.cacheLookupPolicy||Xy.Default}),r=this.acquireTokenFromCache(o,n,i).catch(function(e){if(i.cacheLookupPolicy===Xy.AccessToken)throw e;return Tm.blockReloadInHiddenIframes(),s.eventHandler.emitEvent(Lm.ACQUIRE_TOKEN_NETWORK_START,Gy.Silent,n),s.acquireTokenByRefreshToken(n,i).catch(function(e){var t=e instanceof ff,r=e.errorCode===Yy.INVALID_GRANT_ERROR;if((!t||!r||e instanceof zf||i.cacheLookupPolicy===Xy.AccessTokenAndRefreshToken||i.cacheLookupPolicy===Xy.RefreshToken)&&i.cacheLookupPolicy!==Xy.Skip)throw e;return s.logger.verbose("Refresh token expired/invalid or CacheLookupPolicy is set to Skip, attempting acquire token by iframe.",a.correlationId),s.acquireTokenBySilentIframe(n)})}),e.label=3;case 3:return[2,r.then(function(e){return s.eventHandler.emitEvent(Lm.ACQUIRE_TOKEN_SUCCESS,Gy.Silent,e),t.endMeasurement({success:!0,fromCache:e.fromCache,isNativeBroker:e.fromNativeBroker,requestId:e.requestId}),e}).catch(function(e){throw s.eventHandler.emitEvent(Lm.ACQUIRE_TOKEN_FAILURE,Gy.Silent,null,e),t.endMeasurement({errorCode:e.errorCode,subErrorCode:e.subError,success:!1}),e})]}})})},g_);function g_(e){e=d_.call(this,e)||this;return e.activeSilentTokenRequests=new Map,e}function y_(e){this.message=e}(y_.prototype=new Error).name="InvalidCharacterError";var m_="undefined"!=typeof window&&window.atob&&window.atob.bind(window)||function(e){var t=String(e).replace(/=+$/,"");if(t.length%4==1)throw new y_("'atob' failed: The string to be decoded is not correctly encoded.");for(var r,o,n=0,i=0,s="";o=t.charAt(i++);~o&&(r=n%4?64*r+o:o,n++%4)&&(s+=String.fromCharCode(255&r>>(-2*n&6))))o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(o);return s};function v_(e){this.message=e}function __(e,t){if("string"!=typeof e)throw new v_("Invalid token specified");t=!0===(t=t||{}).header?0:1;try{return JSON.parse(function(e){var t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw"Illegal base64url string!"}try{return decodeURIComponent(m_(t).replace(/(.)/g,function(e,t){t=t.charCodeAt(0).toString(16).toUpperCase();return"%"+(t=t.length<2?"0"+t:t)}))}catch(e){return m_(t)}}(e.split(".")[t]))}catch(e){throw new v_("Invalid token specified: "+e.message)}}(v_.prototype=new Error).name="InvalidTokenError";var w_=(b_.prototype.initialize=function(){var o=this;return this.initPromise||(this.initPromise=new Promise(function(e,t){if(o.options.authType===l.AuthenticationType.subscriptionKey)e();else if(o.options.authType===l.AuthenticationType.aad)o.options.authContext=o.options.authContext||b_.getDefaultAuthContext(o.options),o.options.authContext.handleRedirectPromise().then(function(){setTimeout(function(){return o._loginAndAcquireTokenForAAD(e,t)})}).catch(function(e){t(new Error("Error logging in the AAD users: "+e))});else if(o.options.authType===l.AuthenticationType.anonymous)e(o._triggerTokenFetch(!0));else if(o.options.authType===l.AuthenticationType.sas){if(o.options.sasToken){var r=-1;try{r=o._getTokenExpiry(o.options.sasToken)}catch(e){return void t(new Error("An invalid sasToken was provided."))}if(r>b_.constants.tokenRefreshClockSkew)return o._storeToken(o.options.sasToken),o._setTimeoutTokenFetch(r-b_.constants.tokenRefreshClockSkew),void e()}e(o._triggerTokenFetch())}else t(new Error("An invalid authentication type was specified."))})),this.initPromise},b_.prototype.dispose=function(){this.tokenTimeOutHandle&&(clearTimeout(this.tokenTimeOutHandle),this.tokenTimeOutHandle=null)},b_.getDefaultAuthContext=function(e){if(!e.aadAppId)throw new Error("No AAD app ID was specified.");if(!e.aadTenant)throw new Error("No AAD tenant was specified.");return this.defaultAuthContext||(this.defaultAuthContext=new f_({auth:{authority:""+(e.aadInstance||n)+e.aadTenant,clientId:e.aadAppId},cache:{cacheLocation:this.constants.preferredCacheLocation}})),this.defaultAuthContext},b_.prototype._loginAndAcquireTokenForAAD=function(e,t){var r=(null===(r=this.options.authContext)||void 0===r?void 0:r.getAllAccounts())||[];0===r.length?(this.options.authContext.loginRedirect(),e()):(this.options.authContext.setActiveAccount(r[0]),this._acquireTokenForAAD(e,t))},b_.prototype._acquireTokenForAAD=function(r,t){var o=this,n={scopes:[T]};this.options.authContext.acquireTokenSilent(n).then(function(e){o._saveItem(b_.constants.storage.tokenKey,e.accessToken);var t={map:o.map,type:b_.constants.events.tokenAcquired};o.map.events.invoke(b_.constants.events.tokenAcquired,t),clearTimeout(o.tokenTimeOutHandle);e=new Date(e.expiresOn).getTime()-Date.now();o.tokenTimeOutHandle=setTimeout(function(){return o._acquireTokenForAAD()},e),null!=r&&r()}).catch(function(e){return e instanceof zf?(o.options.authContext.acquireTokenRedirect(n),null==r?void 0:r()):void(null!=t&&t(e))})},b_.prototype.getAuthType=function(){return this.options.authType},b_.prototype.getClientId=function(){return this.options.clientId},b_.prototype.getToken=function(){if(this.options.authType===l.AuthenticationType.aad)return this._getItem(b_.constants.storage.tokenKey);if(this.options.authType!==l.AuthenticationType.anonymous&&this.options.authType!==l.AuthenticationType.sas)return this.options.authType===l.AuthenticationType.subscriptionKey?this.options.subscriptionKey:void 0;var e=this._getItem(b_.constants.storage.tokenKey);if(e){var t=this._getTokenExpiry(e);if(t<300&&0<t)this._triggerTokenFetch();else if(t<=0)throw this._saveItem(b_.constants.storage.tokenKey,""),new Error(b_.constants.errors.tokenExpired)}else this._triggerTokenFetch();return e},b_.prototype._getTokenExpiry=function(e){var t=__(e).exp,e=this._getCurrentTime();return 0<t-e?t-e:-1},b_.prototype._storeToken=function(e){this._saveItem(b_.constants.storage.tokenKey,e);e={map:this.map,type:b_.constants.events.tokenAcquired};this.map.events.invoke(b_.constants.events.tokenAcquired,e)},b_.prototype._saveItem=function(e,t){return this._supportsLocalStorage()?localStorage.setItem(e,t):this._supportsSessionStorage()?sessionStorage.setItem(e,t):this.fallbackStorage[e]=t,!0},b_.prototype._getItem=function(e){return this._supportsLocalStorage()?localStorage.getItem(e):this._supportsSessionStorage()?sessionStorage.getItem(e):e in this.fallbackStorage?this.fallbackStorage[e]:null},b_.prototype._supportsLocalStorage=function(){try{return window.localStorage?(window.localStorage.setItem(b_.constants.storage.testStorageKey,"A"),"A"===window.localStorage.getItem(b_.constants.storage.testStorageKey)&&(window.localStorage.removeItem(b_.constants.storage.testStorageKey),!window.localStorage.getItem(b_.constants.storage.testStorageKey))):!1}catch(e){return!1}},b_.prototype._supportsSessionStorage=function(){try{return window.sessionStorage?(window.sessionStorage.setItem(b_.constants.storage.testStorageKey,"A"),"A"===window.sessionStorage.getItem(b_.constants.storage.testStorageKey)&&(window.sessionStorage.removeItem(b_.constants.storage.testStorageKey),!window.sessionStorage.getItem(b_.constants.storage.testStorageKey))):!1}catch(e){return!1}},b_.prototype._getCurrentTime=function(){return Math.round((new Date).getTime()/1e3)},b_.prototype.signRequest=function(e){e.headers=e.headers||{},e.headers[I]=this.sessionId,e.headers[E]=S,e.headers[b]="MapControl/"+U+" (Web)";var t=this.getToken();switch(this.options.authType){case l.AuthenticationType.aad:case l.AuthenticationType.anonymous:e.headers[C]=this.options.clientId,e.headers[i]=s+t;break;case l.AuthenticationType.sas:e.headers[i]=a+t;break;case l.AuthenticationType.subscriptionKey:e.headers["subscription-key"]=t;break;default:throw new Error("An invalid authentication type was specified")}return e},b_.constants={preferredCacheLocation:"localStorage",storage:{tokenKey:"access.token.key",testStorageKey:"testStorage"},events:{tokenAcquired:"tokenacquired"},tokenExpiresIn:3599,tokenRefreshClockSkew:300,errors:{tokenExpired:"Token Expired, Try again"}},b_);function b_(e){var n=this;this.fallbackStorage={},this._triggerTokenFetch=function(e){return void 0===e&&(e=!1),new Promise(function(r,o){"function"==typeof n.options.getToken?n.options.getToken(function(e){try{var t=n._getTokenExpiry(e)-b_.constants.tokenRefreshClockSkew;n._storeToken(e),n._setTimeoutTokenFetch(t),r()}catch(e){o(new Error("Invalid token returned by getToken function"))}},function(e){o(e)},n.map):o(new Error("Token cannot be "+(e?"fetched":"renewed")+" because getToken was not set or is not a function."))})},this._setTimeoutTokenFetch=function(e){clearTimeout(n.tokenTimeOutHandle),n.tokenTimeOutHandle=setTimeout(n._triggerTokenFetch,Math.min(1e3*e,2147483647))};var t=e.getServiceOptions();this.options=t.authOptions,this.sessionId=t.sessionId,this.map=e}var C_=window&&window.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],o=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&o>=e.length?void 0:e)&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},E_=(S_.prototype.add=function(e,t){var r,o;if(Array.isArray(e))try{for(var n=C_(e),i=n.next();!i.done;i=n.next()){var s=i.value;this._add(s,t)}}catch(e){r={error:e}}finally{try{i&&!i.done&&(o=n.return)&&o.call(n)}finally{if(r)throw r.error}}else this._add(e,t)},S_.prototype.getControls=function(){return Array.from(this.controls)},S_.prototype.remove=function(e){var t,r;if(Array.isArray(e))try{for(var o=C_(e),n=o.next();!n.done;n=o.next()){var i=n.value;this._remove(i)}}catch(e){t={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}else this._remove(e)},S_.prototype._add=function(e,t){this.controls.add(e);var r=(new Y).merge(t),e=e.onAdd(this.map,t),t=this.controlContainer.getElementsByClassName(r.position);if(!(0<t.length))throw new Error("Control position "+r.position+" does not exist.");t.item(0).appendChild(e)},S_.prototype._remove=function(e){e.onRemove(),this.controls.delete(e)},S_);function S_(e){for(var t in this.map=e,this.controlContainer=document.createElement("div"),this.controlContainer.classList.add("atlas-control-container"),l.ControlPosition){var r;l.ControlPosition.hasOwnProperty(t)&&((r=document.createElement("div")).classList.add(l.ControlPosition[t]),r.classList.add("subcontrol-container"),this.controlContainer.appendChild(r))}this.map.getMapContainer().appendChild(this.controlContainer),this.controls=new Set}var T_=window&&window.__assign||function(){return(T_=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)},I_=(A_.prototype.addCallback=function(s,a,c,e,u){var t,l,h=this;if(e)t=function(e){var t=e.lngLat?new gi(e.lngLat.lng,e.lngLat.lat):void 0,r=e.point?[e.point.x,e.point.y]:void 0,o=e.features?e.features.map(function(e){return new rn(e.geometry,e.properties,e.id)}):[],o={type:e.type,originalEvent:e.originalEvent,position:t,coordinate:r,features:o};c(o)};else switch(s){case"data":case"sourcedata":case"styledata":t=function(e){e=T_(T_({dataType:e.dataType},"source"===e.dataType&&T_(T_(T_({isSourceLoaded:e.isSourceLoaded},e.sourceDataType&&{sourceDataType:e.sourceDataType}),{source:h.map.sources.getById(e.sourceId)}),e.tile&&{tile:{id:{x:e.tile.tileID.canonical.x,y:e.tile.tileID.canonical.y,z:e.tile.tileID.canonical.z},size:e.tile.tileSize,state:e.tile.state}})),{map:h.map,type:e.type});u&&h.map.events._removeListener(s,a,c),c(e)};break;case"error":t=function(e){e={error:e.error,map:h.map,type:e.type};u&&h.map.events._removeListener(s,a,c),c(e)};break;case"touchstart":case"touchend":case"touchmove":case"touchcancel":t=function(e){if(e.originalEvent){if(e.originalEvent===l)return;l=e.originalEvent}var t=e.point?new an(e.point.x,e.point.y):void 0,r=e.points?e.points.map(function(e){return new an(e.x,e.y)}):[],o=e.lngLat?new gi(e.lngLat.lng,e.lngLat.lat):void 0,n=e.lngLats?e.lngLats.map(function(e){return new gi(e.lng,e.lat)}):[],i=o?h.map.layers.getRenderedShapes(new un(o),a?[a]:void 0):[],i={map:h.map,originalEvent:e.originalEvent,pixel:t,pixels:r,position:o,positions:n,shapes:i,layerId:a||void 0,preventDefault:function(){return e.preventDefault()},type:e.type};u&&h.map.events._removeListener(s,a,c),c(i)};break;case"mousedown":case"mouseup":case"mouseover":case"mousemove":case"click":case"dblclick":case"mouseout":case"mouseenter":case"mouseleave":case"contextmenu":t=function(e){if(e.originalEvent){if(e.originalEvent===l)return;l=e.originalEvent}var t=e.lngLat?new gi(e.lngLat.lng,e.lngLat.lat):void 0,r=e.point?new an(e.point.x,e.point.y):void 0,o=t?h.map.layers.getRenderedShapes(new un(t),a?[a]:void 0):[],o={map:h.map,originalEvent:e.originalEvent,position:t,pixel:r,preventDefault:function(){return e.preventDefault()},shapes:o,layerId:a||void 0,type:e.type};u&&h.map.events._removeListener(s,a,c),c(o)};break;case"styleimagemissing":t=function(e){u&&h.map.events._removeListener(s,a,c),c(e.id)};break;case"wheel":t=function(e){if(e.originalEvent){if(e.originalEvent===l)return;l=e.originalEvent}var t={map:h.map,originalEvent:e.originalEvent,preventDefault:function(){return e.preventDefault()},type:e.type};u&&h.map.events._removeListener(s,a,c),c(t)};break;case"resize":t=function(e){var t,r={map:h.map,type:e.type};for(t in e)"type"!==t&&"target"!==t&&(r[t]=e[t]);u&&h.map.events._removeListener(s,a,c),c(r)};break;default:t=function(e){var t={map:h.map,type:e.type};e.originalEvent&&(t.originalEvent=e.originalEvent),u&&h.map.events._removeListener(s,a,c),c(t)}}this.callbacks.has(a)||this.callbacks.set(a,new J),this.callbacks.get(a).has(s)||this.callbacks.get(a).set(s,new Map),this.callbacks.get(a).get(s).set(c,[t,u])},A_.prototype.removeCallback=function(e,t,r){this.callbacks.has(t)&&this.callbacks.get(t).has(e)&&this.callbacks.get(t).get(e).has(r)&&this.callbacks.get(t).get(e).delete(r)},A_.prototype.getModifiedCallback=function(e,t,r){if(this.callbacks.has(t)&&this.callbacks.get(t).has(e)&&this.callbacks.get(t).get(e).has(r))return this.callbacks.get(t).get(e).get(r)[0]},A_.prototype.getLayerCallbacks=function(e){if(this.callbacks.has(e))return this.callbacks.get(e)},A_.prototype.getEventCallbacks=function(e,t){if(this.callbacks.has(t)){t=this.callbacks.get(t);if(t.has(e))return t.get(e)}},A_);function A_(e){this.callbacks=new J,this.map=e}var k_=window&&window.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],o=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&o>=e.length?void 0:e)&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},P_=window&&window.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var o,n,i=r.call(e),s=[];try{for(;(void 0===t||0<t--)&&!(o=i.next()).done;)s.push(o.value)}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return s},O_=["maxzoomchanged","minzoomchanged","mapconfigurationchanged"],R_=(x_.prototype.add=function(e,t,r){var o,n;if("function"==typeof t)this._addGlobalListener(e,t,!1,!1);else{t=Array.isArray(t)?t:[t];try{for(var i=k_(t),s=i.next();!s.done;s=i.next()){var a=s.value;a instanceof Us&&Us._isMBoxEvent(e)?this._addLayerListener(e,a,r,!1,!1):a._addEventListener(e,r,!1)}}catch(e){o={error:e}}finally{try{s&&!s.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}}},x_.prototype.addOnce=function(e,t,r){"function"==typeof t?this._addGlobalListener(e,t,!1,!0):t instanceof Us&&Us._isMBoxEvent(e)?this._addLayerListener(e,t,r,!1,!0):t._addEventListener(e,r,!0)},x_.prototype._addLegacy=function(e,t,r){"function"==typeof t?this._addGlobalListener(e,t,!0,!1):this._addLayerListener(e,t,r,!0,!1)},x_.prototype._addLayerListener=function(e,t,r,o,n){var i,s,a,c,u=t instanceof Us?t.getId():t,t=this.map.layers.getLayerById(u),l=this.mapCallbackHandler.getModifiedCallback(e,u,r);if(l&&t)try{for(var h=k_(t._getLayerIds()),p=h.next();!p.done;p=h.next()){var d=p.value;this.map._getMap().off(e,d,l)}}catch(e){i={error:e}}finally{try{p&&!p.done&&(s=h.return)&&s.call(h)}finally{if(i)throw i.error}}if(this.mapCallbackHandler.addCallback(e,u,r,o,n),t){l=this.mapCallbackHandler.getModifiedCallback(e,u,r);try{for(var f=k_(t._getLayerIds()),g=f.next();!g.done;g=f.next()){d=g.value;this.map._getMap().on(e,d,l)}}catch(e){a={error:e}}finally{try{g&&!g.done&&(c=f.return)&&c.call(f)}finally{if(a)throw a.error}}}},x_.prototype._addGlobalListener=function(e,t,r,o){var n,i,s,a;O_.includes(e)?this.map._addEventListener(e,t,o):(n=this.mapCallbackHandler.getModifiedCallback(e,"",t),this.mapCallbackHandler.addCallback(e,"",t,r,o),i=this.mapCallbackHandler.getModifiedCallback(e,"",t),"load"===e&&this.map._isLoaded()?(s={type:"load",map:this.map},setTimeout(function(){return i(s)})):"ready"===e?this.map._isReady()&&(a={type:"ready",map:this.map},setTimeout(function(){return i(a)})):(n&&this.map._getMap().off(e,n),this.map._getMap().on(e,i)))},x_.prototype.invoke=function(e,t,r){if(void 0===r)this._invokeListeners(e,"",t);else if(t instanceof Us&&Us._isMBoxEvent(e))this._invokeListeners(e,t.getId(),r);else{if(!(t instanceof Q))throw new Error("The invoke target is invalid.");t._invokeEvent(e,r)}},x_.prototype._invokeListeners=function(r,o,n){var i=this,e=new J(this.mapCallbackHandler.getEventCallbacks(r,o));e?e.forEach(function(e,t){e=P_(e,2),e[0];e[1]&&i._removeListener(r,o,t),t(n)}):"error"===r&&console.error("error"in n?n.error:n)},x_.prototype.remove=function(e,t,r){var o,n;if("function"==typeof t)this._removeListener(e,"",t);else{t=Array.isArray(t)?t:[t];try{for(var i=k_(t),s=i.next();!s.done;s=i.next()){var a=s.value;a instanceof Us&&Us._isMBoxEvent(e)?this._removeListener(e,a,r):a._removeEventListener(e,r)}}catch(e){o={error:e}}finally{try{s&&!s.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}}},x_.prototype._removeLegacy=function(e,t,r){"function"==typeof t?this._removeListener(e,"",t):this._removeListener(e,t,r)},x_.prototype._removeListener=function(e,t,r){var o,n;if(O_.includes(e))this.map._removeEventListener(e,r);else{var i=t instanceof Us?t.getId():t,s=this.mapCallbackHandler.getModifiedCallback(e,i,r);if(s)if(i){t=this.map.layers.getLayerById(i);if(t)try{for(var a=k_(t._getLayerIds()),c=a.next();!c.done;c=a.next()){var u=c.value;this.map._getMap().off(e,u,s)}}catch(e){o={error:e}}finally{try{c&&!c.done&&(n=a.return)&&n.call(a)}finally{if(o)throw o.error}}}else this.map._getMap().off(e,s);this.mapCallbackHandler.removeCallback(e,i,r)}},x_.prototype._enableLayerEvents=function(c){var u=this,e=this.mapCallbackHandler.getLayerCallbacks(c.getId());e&&e.forEach(function(e,a){e.forEach(function(e){var t,r,o=P_(e,1)[0];try{for(var n=k_(c._getLayerIds()),i=n.next();!i.done;i=n.next()){var s=i.value;u.map._getMap().on(a,s,o)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}})})},x_.prototype._disableLayerEvents=function(c){var u=this,e=this.mapCallbackHandler.getLayerCallbacks(c.getId());e&&e.forEach(function(e,a){e.forEach(function(e){var t,r,o=P_(e,1)[0];try{for(var n=k_(c._getLayerIds()),i=n.next();!i.done;i=n.next()){var s=i.value;u.map._getMap().off(a,s,o)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}})})},x_);function x_(e){this.map=e,this.mapCallbackHandler=new I_(this.map)}var M_=window&&window.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],o=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&o>=e.length?void 0:e)&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},N_=(L_.prototype.add=function(e,t){var r,o;if(Array.isArray(e))try{for(var n=M_(e),i=n.next();!i.done;i=n.next()){var s=i.value;this._addMarker(s,t)}}catch(e){r={error:e}}finally{try{i&&!i.done&&(o=n.return)&&o.call(n)}finally{if(r)throw r.error}}else this._addMarker(e,t)},L_.prototype._addMarker=function(e,t){e._addToMap(this.map,t),this.markers.add(e)},L_.prototype.getMarkers=function(){return Array.from(this.markers)},L_.prototype.remove=function(e){var t,r;if(Array.isArray(e))try{for(var o=M_(e),n=o.next();!n.done;n=o.next()){var i=n.value;this._removeMarker(i)}}catch(e){t={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}else this._removeMarker(e)},L_.prototype._removeMarker=function(t){var r=this;t instanceof Jc?(t._removeFromMap(),this.markers.delete(t)):this.markers.forEach(function(e){e._getId()===t&&(e._removeFromMap(),r.markers.delete(e))})},L_.prototype.clear=function(){var t=this;this.markers.forEach(function(e){e._removeFromMap(),t.markers.delete(e)})},L_);function L_(e){this.markers=new Set,this.map=e}var D_=(q_.prototype.add=function(s,t,a){var c=this;return new Promise(function(r,o){var n,e,i;c.userImages.has(s)?r():t instanceof HTMLImageElement||t instanceof ImageData?(c.map._getMap().addImage(s,t,a),c.userImages.set(s,{image:t,meta:a}),r()):"string"==typeof t&&(e=void 0,e=/<svg/i.test(t)&&!/^data:/i.test(t)?"data:image/svg+xml;base64,"+window.btoa(t):t,i=!1,c.map._sendRequest(e,"Image").then(function(e){return i?void 0:e.blob()}).then(function(e){var t;!i&&e&&(clearTimeout(n),(t=new Image).onload=function(){c.map._getMap().addImage(s,t,a),c.userImages.set(s,{image:t,meta:a}),r()},t.onerror=t.onabort=function(){o("Failed to load image into HTML element.")},t.src=URL.createObjectURL(e))}).catch(function(){i||(clearTimeout(n),o("Failed to load image into HTML element."))}),n=setTimeout(function(){i=!0,o("Failed to load image within specified timeout: "+c.imageLoadTimeout+" ms.")},c.imageLoadTimeout))})},q_.prototype.clear=function(){var r=this;this.userImages.forEach(function(e,t){r.map._getMap().removeImage(t)}),this.userImages.clear()},q_.prototype.getImageIds=function(){var r=[];return this.userImages.forEach(function(e,t){r.push(t)}),r},q_.prototype.createFromTemplate=function(e,t,r,o,n){r=r||"#1A73AA",o=o||"#fff";n=(n=Xu(t,n)).replace(/{color}/g,r).replace(/{secondaryColor}/g,o).replace(/{text}/g,"");return this.add(e,n)},q_.prototype.hasImage=function(e){return this.userImages.has(e)},q_.prototype.remove=function(e){this.map._getMap().removeImage(e),this.userImages.delete(e)},q_.prototype._restoreImages=function(){var r=this;this.userImages.forEach(function(e,t){r.map._getMap().hasImage(t)||r.map._getMap().addImage(t,e.image,e.meta)})},q_);function q_(e){this.userImages=new J,this.imageLoadTimeout=5e3,this.map=e}var U_,j_,w=window&&window.__extends||(U_=function(e,t){return(U_=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}U_(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),H_=window&&window.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],o=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&o>=e.length?void 0:e)&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},B_=(w(z_,j_=Us),z_.prototype._buildLayers=function(){return this.layers},z_.prototype._getLayerIds=function(){return this.layers.map(function(e){return e.id})},z_.prototype._getSourceIds=function(){var t,e,r=new Set;try{for(var o=H_(this.layers),n=o.next();!n.done;n=o.next()){var i=n.value;"string"==typeof i.source?r.add(i.source):i.source&&r.add(i.id)}}catch(e){t={error:e}}finally{try{n&&!n.done&&(e=o.return)&&e.call(o)}finally{if(t)throw t.error}}return r},z_.prototype._updateLayoutProperty=function(t,r,o,n){var i=this;this.layers.forEach(function(e){$o(r,o)||i.map._getMap().setLayoutProperty(e.id,t,n||r)})},z_);function z_(e,t){t=j_.call(this,t)||this;return t.layers=e,t}var F_=window&&window.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],o=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&o>=e.length?void 0:e)&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},K_=window&&window.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var o,n,i=r.call(e),s=[];try{for(;(void 0===t||0<t--)&&!(o=i.next()).done;)s.push(o.value)}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return s},G_=window&&window.__spreadArray||function(e,t){for(var r=0,o=t.length,n=e.length;r<o;r++,n++)e[n]=t[r];return e},Y_=(Z_.prototype.add=function(e,t){var r,o,n=t instanceof Us?t.getId():t;if(Array.isArray(e))try{for(var i=F_(e),s=i.next();!s.done;s=i.next()){var a=s.value;this._addLayer(a,n)}}catch(e){r={error:e}}finally{try{s&&!s.done&&(o=i.return)&&o.call(i)}finally{if(r)throw r.error}}else this._addLayer(e,n)},Z_.prototype._addLayer=function(t,r){if(!(this.map._isReady()||t instanceof B_))throw new Error("The layer '"+t.getId()+"' could not be added to the map because the map is not ready. Please use a ready event listener to guarantee the map is ready before adding a layer to it.");var e,o,n,i;r!==t.getId()&&this.layerIndex.find(function(e){return r===e.getId()})?this._getMapboxLayerExists(t)?(o=this.layerIndex.findIndex(function(e){return e.getId()===t.getId()}),n=this.userLayers.findIndex(function(e){return e.layer.getId()===t.getId()}),i=this.layerIndex[o],this._removeMapboxLayers(t),this._addMapboxLayers(t,r),this.map.events._disableLayerEvents(i),this.map.events._enableLayerEvents(t),this.layerIndex.splice(o,1),e=this.layerIndex.findIndex(function(e){return e.getId()===r}),this.layerIndex.splice(e,0,t),t instanceof B_||(this.userLayers[n]={layer:t,before:r}),i.onRemove()):(this._addMapboxLayers(t,r),this.map.events._enableLayerEvents(t),e=this.layerIndex.findIndex(function(e){return e.getId()===r}),this.layerIndex.splice(e,0,t),t instanceof B_||this.userLayers.push({layer:t,before:r})):(o=this.layerIndex.findIndex(function(e){return e.getId()===t.getId()}),n=this.userLayers.findIndex(function(e){return e.layer.getId()===t.getId()}),0<=o&&0<=n?(i=this.layerIndex[o],this._removeMapboxLayers(i),this._addMapboxLayers(t,o+1),this.map.events._disableLayerEvents(i),this.map.events._enableLayerEvents(t),(this.layerIndex[o]=t)instanceof B_||(this.userLayers[n]={layer:t,before:void 0}),i.onRemove()):(this._addMapboxLayers(t),this.map.events._enableLayerEvents(t),this.layerIndex.push(t),t instanceof B_||this.userLayers.push({layer:t,before:r}))),t.onAdd(this.map)},Z_.prototype._addMapboxLayers=function(e,t){var r,o;if(!(e instanceof Cc)||e.getOptions().tileUrl)if(e instanceof B_)this.map.events._enableLayerEvents(e);else{e instanceof da&&(this.map._getMap().addSource(e._getSourceId(),e._buildSource()),this.map.sources.setSourceState(e._getSourceWrapper()));var n=this._getMapboxBefore(t);try{for(var i=F_(e._buildLayers()),s=i.next();!s.done;s=i.next()){var a=s.value;this.map._getMap().addLayer(a,n)}}catch(e){r={error:e}}finally{try{s&&!s.done&&(o=i.return)&&o.call(i)}finally{if(r)throw r.error}}this.map.events._enableLayerEvents(e)}},Z_.prototype._removeMapboxLayers=function(e,t){var r,o;if(e instanceof B_&&!t)this.map.events._disableLayerEvents(e);else{try{for(var n=F_(e._getLayerIds()),i=n.next();!i.done;i=n.next()){var s=i.value;this.map._getMap().getLayer(s)&&this.map._getMap().removeLayer(s)}}catch(e){r={error:e}}finally{try{i&&!i.done&&(o=n.return)&&o.call(n)}finally{if(r)throw r.error}}this.map.events._disableLayerEvents(e),e instanceof da&&this.map._getMap().getSource(e._getSourceId())&&this.map._getMap().removeSource(e._getSourceId())}},Z_.prototype._getMapboxLayerExists=function(t){var r=this,o=!1;return"string"==typeof t?!!(t=this.layerIndex.find(function(e){return e.getId()===t})):(t._getLayerIds().forEach(function(e){r.map._getMap().getLayer(e)&&(o=!0)}),o)},Z_.prototype._getMapboxBefore=function(t){var r,e,o,n;if("string"==typeof t){var i=this.layerIndex.find(function(e){return e.getId()===t});if(!i)return;try{for(var s=F_(i._getLayerIds()),a=s.next();!a.done;a=s.next()){var c=a.value;if(this.map._getMap().getLayer(c))return c}}catch(e){r={error:e}}finally{try{a&&!a.done&&(e=s.return)&&e.call(s)}finally{if(r)throw r.error}}t=this.layerIndex.findIndex(function(e){return e.getId()===t})+1}for(var u=t;u<this.layerIndex.length;u++)try{for(var l=(o=void 0,F_(this.layerIndex[u]._getLayerIds())),h=l.next();!h.done;h=l.next()){c=h.value;if(this.map._getMap().getLayer(c))return c}}catch(e){o={error:e}}finally{try{h&&!h.done&&(n=l.return)&&n.call(l)}finally{if(o)throw o.error}}},Z_.prototype.clear=function(){for(var e=this.layerIndex.length-1;0<=e;e--){var t=this.layerIndex[e];this._removeMapboxLayers(t,!0),this.layerIndex.splice(e,1),t.onRemove()}this.userLayers=[]},Z_.prototype.getLayerById=function(t){var e=this.layerIndex.find(function(e){return e.getId()===t});if(e)return e},Z_.prototype.getLayers=function(){return this.layerIndex.slice(0)},Z_.prototype._getSourceIds=function(){var t,e,r=new Set;try{for(var o=F_(this.layerIndex),n=o.next();!n.done;n=o.next())n.value._getSourceIds().forEach(function(e){return r.add(e)})}catch(e){t={error:e}}finally{try{n&&!n.done&&(e=o.return)&&e.call(o)}finally{if(t)throw t.error}}return r},Z_.prototype._getUserLayers=function(){return Array.from(this.userLayers)},Z_.prototype.move=function(e,t){var r=e instanceof Us?e.getId():e,o=t instanceof Us?t.getId():t;if(!this.layerIndex.find(function(e){return e.getId()===r}))throw new Error("The layer '"+r+"' has not been added to the map and cannot be moved.");t=this.layerIndex.findIndex(function(e){return e.getId()===r});this._moveMapboxLayers(this.layerIndex[t],o),e=this.layerIndex[t],this.layerIndex.splice(t,1);t=this.layerIndex.findIndex(function(e){return e.getId()===o});-1<t?this.layerIndex.splice(t,0,e):this.layerIndex.push(e);e=this.userLayers.find(function(e){return e.layer.getId()===r});e&&(e.before=o)},Z_.prototype._moveMapboxLayers=function(e,t){var r,o,n=this._getMapboxBefore(t);try{for(var i=F_(e._getLayerIds()),s=i.next();!s.done;s=i.next()){var a=s.value;this.map._getMap().moveLayer(a,n)}}catch(e){r={error:e}}finally{try{s&&!s.done&&(o=i.return)&&o.call(i)}finally{if(r)throw r.error}}},Z_.prototype.getRenderedShapes=function(e,t,r){var o,n,i,s=this;if(e=e||[-180,-85.0511,180,85.0511],Array.isArray(e)?4===e.length||6===e.length?i=this.map.positionsToPixels([Ai.getSouthWest(e),Ai.getNorthEast(e)]):2!==e.length&&3!==e.length||(i=this.map.positionsToPixels([e])[0]):i=this.map.positionsToPixels([e.coordinates])[0],t){t=Array.isArray(t)?t:[t];var a=[],c=this;try{for(var u=F_(t),l=u.next();!l.done;l=u.next())!function(e){var t=e instanceof Us?e.getId():e,e=c.layerIndex.findIndex(function(e){return e.getId()===t});if(!(-1<e))throw new Error("The layer '"+t+"' has not been added to the map and its rendered features cannot be retrieved.");a.push.apply(a,G_([],K_(c.layerIndex[e]._getLayerIds().filter(function(e){return!!s.map._getMap().getLayer(e)}))))}(l.value)}catch(e){o={error:e}}finally{try{l&&!l.done&&(n=u.return)&&n.call(u)}finally{if(o)throw o.error}}}r=this.map._getMap().queryRenderedFeatures(i,{layers:a,filter:r});return this.map.sources._mapFeaturesToShapes(r)},Z_.prototype.remove=function(e){var t,r;if(Array.isArray(e))try{for(var o=F_(e),n=o.next();!n.done;n=o.next()){var i=n.value;this._removeLayer(i)}}catch(e){t={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}else this._removeLayer(e)},Z_.prototype._removeLayer=function(e){var t=e instanceof Us?e.getId():e,r=this.layerIndex.findIndex(function(e){return e.getId()===t});if(-1==r)throw new Error("The layer '"+t+"' has not been added to the map and cannot be removed.");var o=this.layerIndex[r];this._removeMapboxLayers(o),this.layerIndex.splice(r,1);r=this.userLayers.findIndex(function(e){return e.layer.getId()===t});-1!=r&&this.userLayers.splice(r,1),e instanceof da&&this.map.sources.unsetSourceState(e._getSourceId()),o.onRemove()},Z_);function Z_(e){this.layerIndex=[],this.userLayers=[],this.map=e}var W_=window&&window.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],o=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&o>=e.length?void 0:e)&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},V_=(J_.prototype.add=function(e){var t,r;e=Array.isArray(e)?e:[e];try{for(var o=W_(e),n=o.next();!n.done;n=o.next()){var i=n.value;this.popups.has(i)||(this.popups.add(i),i.attach(this.map))}}catch(e){t={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}},J_.prototype.clear=function(){var t=this;this.popups.forEach(function(e){t.popups.delete(e),e.remove()})},J_.prototype.remove=function(e){var t,r;e=Array.isArray(e)?e:[e];try{for(var o=W_(e),n=o.next();!n.done;n=o.next()){var i=n.value;this.popups.has(i)&&(this.popups.delete(i),i.remove())}}catch(e){t={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}},J_.prototype.getPopups=function(){return Array.from(this.popups)},J_.prototype._getCollectionDiv=function(){var e=this.map.getMapContainer().querySelector("."+J_.Css.collection);return e||((e=document.createElement("div")).classList.add(J_.Css.collection),e.setAttribute("aria-label","Map Information"),this.map.getMapContainer().appendChild(e)),e},J_.prototype._addDraggedPopup=function(e){0===this.draggedPopups.size&&(this.map.getMapContainer().addEventListener("mousemove",this._onDrag),this.map.getMapContainer().addEventListener("touchmove",this._onDrag),this.map.getMapContainer().addEventListener("mouseup",this._onUp),this.map.getMapContainer().addEventListener("touchend",this._onUp)),this.draggedPopups.add(e)},J_.Css={collection:"popup-collection-container"},J_);function J_(e){var o=this;this._onDrag=function(e){var t,r;"mousemove"===e.type?(t=e.clientX,r=e.clientY):"touchmove"===e.type&&(t=e.touches[0].clientX,r=e.touches[0].clientY),o.draggedPopups.forEach(function(e){e._dragToPixel([t,r])})},this._onUp=function(){o.map.getMapContainer().removeEventListener("mousemove",o._onDrag),o.map.getMapContainer().removeEventListener("touchmove",o._onDrag),o.map.getMapContainer().removeEventListener("mouseup",o._onUp),o.map.getMapContainer().removeEventListener("touchend",o._onUp),o.draggedPopups.forEach(function(e){o.draggedPopups.delete(e),e._onUp()})},this.map=e,this.popups=new Set,this.draggedPopups=new Set}var Q_=window&&window.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],o=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&o>=e.length?void 0:e)&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},X_=($_.prototype.add=function(e,t){var r,o;if(void 0===t&&(t=!0),Array.isArray(e))try{for(var n=Q_(e),i=n.next();!i.done;i=n.next()){var s=i.value;this._addSource(s,t)}}catch(e){r={error:e}}finally{try{i&&!i.done&&(o=n.return)&&o.call(n)}finally{if(r)throw r.error}}else this._addSource(e,t)},$_.prototype.getRenderedShapes=function(e,t,r){e="string"==typeof e?e:e.getId(),t=this.map._getMap().querySourceFeatures(e,{sourceLayer:r,filter:t});return this.map.sources._mapFeaturesToShapes(t,!0,this.sources.get(e))},$_.prototype._buildSources=function(){var t={};return this.sources.forEach(function(e){t[e.getId()]=e._buildSource()}),t},$_.prototype.clear=function(){var t=this;this.sources.forEach(function(e){t.remove(e)})},$_.prototype.getById=function(e){return this.sources.get(e)},$_.prototype.getSources=function(){return Array.from(this.sources.values())},$_.prototype.isSourceLoaded=function(e){e=e instanceof is?e.getId():e;return this.map._getMap().isSourceLoaded(e)},$_.prototype.remove=function(e,t){var r,o;if(void 0===t&&(t=!0),Array.isArray(e))try{for(var n=Q_(e),i=n.next();!i.done;i=n.next()){var s=i.value;this._removeSource(s,t)}}catch(e){r={error:e}}finally{try{i&&!i.done&&(o=n.return)&&o.call(n)}finally{if(r)throw r.error}}else this._removeSource(e,t)},$_.prototype.setSourceState=function(e,t){void 0===t&&(t=!0),this.sources.set(e.getId(),e),e._setMap(this.map,t)},$_.prototype.unsetSourceState=function(e){this.sources.has(e)&&(this.sources.get(e)._setMap(null),this.sources.delete(e))},$_.prototype._removeSource=function(e,t){e=e instanceof is?e.getId():e;if(!this.sources.has(e))throw new Error("'"+e+"' is not added to the map");if(this.map._getMap().getSource(e)&&t&&this.map._getMap().removeSource(e),this.map._getMap().getSource(e)&&t)throw new Error("One or more layers have a dependency on the source '"+e+"'");this.unsetSourceState(e)},$_.prototype._addSource=function(e,t){if(this.sources.has(e.getId())){if(t)throw new Error("'"+e.getId()+"' is already added to the map");this.unsetSourceState(e.getId())}if(t){if(!this.map._isReady())throw new Error("The source '"+e.getId()+"' could not be added to the map because the map is not ready. Please use a ready event listener to guarantee the map is ready before adding a source to it.");this.map._getMap().addSource(e.getId(),e._buildSource())}this.setSourceState(e)},$_.prototype._mapFeaturesToShapes=function(e,t,r){var o,n,i=[];try{for(var s=Q_(e),a=s.next();!a.done;a=s.next()){var c=a.value;if((r||"string"==typeof c.source)&&"string"==typeof c.properties[Ci._shapeIdPropName]){var u=r||this.sources.get(c.source);if(u instanceof ls){var l=u.getShapeById(c.properties[Ci._shapeIdPropName]);if(l instanceof Ci){i.push(l);continue}}}t||i.push(c)}}catch(e){o={error:e}}finally{try{a&&!a.done&&(n=s.return)&&n.call(s)}finally{if(o)throw o.error}}return i},$_.prototype._syncSources=function(n){var o=this;n?(Object.keys(n).map(function(e){var t,r=n[e];switch(r.type){case"vector":case"raster":case"raster-dem":t=new pc(e,{name:e,tiles:r.tiles,type:r.type,url:r.url,tileSize:"tileSize"in r?r.tileSize:void 0});break;case"canvas":t=new Cs(e,r);break;case"geojson":var o=new ls(e,{maxZoom:r.maxzoom,cluster:r.cluster,clusterRadius:r.clusterRadius,tolerance:r.tolerance,lineMetrics:r.lineMetrics,clusterProperties:r.clusterProperties,buffer:r.buffer,clusterMinPoints:r.clusterMinPoints,generateId:r.generateId,promoteId:r.promoteId,filter:r.filter});"string"!=typeof r.data&&void 0!==r.data&&o._addNoUpdate(r.data),t=o;break;case"image":t=new Os(e,r);break;case"video":t=new Ns(e,r);break;default:t=new Is(e,r)}return t}).forEach(function(e){var t=o.sources.get(e.getId()),r=t&&e._isDeepEqual(t);!r&&t&&o.unsetSourceState(t.getId()),o.setSourceState(e,!r)}),Array.from(this.sources.keys()).filter(function(e){return!(e in n)}).forEach(function(e){return o.unsetSourceState(e)})):console.warn("syncSources called with no style sources which is unexpected.")},$_);function $_(e){this.map=e,this.sources=new J}var ew,tw,rw=((window&&window.__extends||(ew=function(e,t){return(ew=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}ew(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}))(ow,tw=k),ow);function ow(){var e=null!==tw&&tw.apply(this,arguments)||this;return e.duration=1e3,e.type="jump",e}var nw,iw,sw=((window&&window.__extends||(nw=function(e,t){return(nw=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}nw(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}))(aw,iw=k),aw);function aw(){var e=null!==iw&&iw.apply(this,arguments)||this;return e.bottom=0,e.left=0,e.right=0,e.top=0,e}var cw,uw,w=window&&window.__extends||(cw=function(e,t){return(cw=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}cw(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),lw=window&&window.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],o=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&o>=e.length?void 0:e)&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},hw=window&&window.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var o,n,i=r.call(e),s=[];try{for(;(void 0===t||0<t--)&&!(o=i.next()).done;)s.push(o.value)}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return s},pw=window&&window.__spreadArray||function(e,t){for(var r=0,o=t.length,n=e.length;r<o;r++,n++)e[n]=t[r];return e},dw=(w(fw,uw=k),fw.prototype.merge=function(){for(var t,e,r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];try{for(var n=lw(r),i=n.next();!i.done;i=n.next()){var s=i.value;s&&"number"==typeof s.padding&&(s.padding={top:s.padding,bottom:s.padding,left:s.padding,right:s.padding})}}catch(e){t={error:e}}finally{try{i&&!i.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}return uw.prototype.merge.apply(this,pw([],hw(r)))},fw);function fw(){var e=null!==uw&&uw.apply(this,arguments)||this;return e.bounds=[-180,-89,180,90],e.maxBounds=void 0,e.maxZoom=20,e.offset=new an(0,0),e.padding=new sw,e}var gw,yw,mw=((window&&window.__extends||(gw=function(e,t){return(gw=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}gw(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}))(vw,yw=k),vw);function vw(){var e=null!==yw&&yw.apply(this,arguments)||this;return e.zoom=1,e.center=new gi(0,0),e.centerOffset=new an(0,0),e.bearing=0,e.pitch=0,e.minZoom=1,e.maxZoom=20,e.maxBounds=void 0,e}var _w,ww,w=((window&&window.__extends||(_w=function(e,t){return(_w=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}_w(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}))(bw,ww=k),bw);function bw(){var e=null!==ww&&ww.apply(this,arguments)||this;return e.name=void 0,e.before=void 0,e.minZoom=1,e.maxZoom=20,e.overwrite=!1,e.opacity=1,e}var Cw,Ew,Sw=((window&&window.__extends||(Cw=function(e,t){return(Cw=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Cw(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}))(Tw,Ew=w),Tw);function Tw(){var e=null!==Ew&&Ew.apply(this,arguments)||this;return e.color="rgba(0,0,0,.5)",e.outlineColor="#000",e.radius=1,e.outlineWidth=5,e.name="default-circles",e}var Iw,Aw,kw=((window&&window.__extends||(Iw=function(e,t){return(Iw=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Iw(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}))(Pw,Aw=w),Pw);function Pw(){var e=null!==Aw&&Aw.apply(this,arguments)||this;return e.cap="butt",e.join="miter",e.name="default-linestrings",e.color="#000",e.width=1,e}var Ow,Rw,xw=((window&&window.__extends||(Ow=function(e,t){return(Ow=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Ow(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}))(Mw,Rw=w),Mw);function Mw(){var e=null!==Rw&&Rw.apply(this,arguments)||this;return e.iconSize=1,e.fontSize=14,e.fontColor="#000",e.textFont="SegoeUi-Regular",e.cluster=!0,e.clusterIcon=void 0,e.textOffset=[0,0],e.name="default-pins",e.icon="pin-darkblue",e.title="",e}var Nw,Lw,Dw=((window&&window.__extends||(Nw=function(e,t){return(Nw=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Nw(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}))(qw,Lw=w),qw);function qw(){var e=null!==Lw&&Lw.apply(this,arguments)||this;return e.color="rgba(0,0,0,.5)",e.outlineColor="#000",e.name="default-polygons",e}var Uw,jw,Hw=((window&&window.__extends||(Uw=function(e,t){return(Uw=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Uw(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}))(Bw,jw=w),Bw);function Bw(){var e=null!==jw&&jw.apply(this,arguments)||this;return e.name="default-raster",e}var zw,Fw,Kw=((window&&window.__extends||(zw=function(e,t){return(zw=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}zw(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}))(Gw,Fw=k),Gw);function Gw(){var e=null!==Fw&&Fw.apply(this,arguments)||this;return e.anchor="map",e.color="#FFFFFF",e.intensity=.5,e.position=[1.15,210,30],e}var Yw,Zw,w=window&&window.__extends||(Yw=function(e,t){return(Yw=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Yw(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),Ww=window&&window.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],o=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&o>=e.length?void 0:e)&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Vw=window&&window.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var o,n,i=r.call(e),s=[];try{for(;(void 0===t||0<t--)&&!(o=i.next()).done;)s.push(o.value)}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return s},Jw=window&&window.__spreadArray||function(e,t){for(var r=0,o=t.length,n=e.length;r<o;r++,n++)e[n]=t[r];return e},Qw=(w(Xw,Zw=k),Xw.prototype.merge=function(){for(var t,e,r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];try{for(var n=Ww(r),i=n.next();!i.done;i=n.next()){var s=i.value;s&&(s.hasOwnProperty("view")?s.userRegion=s.view:s.hasOwnProperty("userRegion")&&(s.view=s.userRegion),"string"==typeof s.language&&(s.language=ru.getCode(s.language)))}}catch(e){t={error:e}}finally{try{i&&!i.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}return Zw.prototype.merge.apply(this,Jw([],Vw(r)))},Xw);function Xw(){var e=null!==Zw&&Zw.apply(this,arguments)||this;return e.antialias=void 0,e.autoResize=!0,e.language=du,e.light=new Kw,e.preserveDrawingBuffer=!1,e.progressiveLoading=!1,e.progressiveLoadingInitialLayerGroups=["base"],e.renderWorldCopies=!0,e.showBuildingModels=!1,e.showFeedbackLink=!0,e.showLogo=!0,e.showLabels=!0,e.customAttribution=void 0,e.showTileBoundaries=!1,e.style=void 0,e.view=lu,e.userRegion=e.view,e}function $w(e){return 0==e.length?void 0:e.slice(1).reduce(function(r,o){return function(e,t){e=r(e,t);return r0(r0({},e),o(e.url,t))}},e[0])}var e0,t0,w=window&&window.__extends||(e0=function(e,t){return(e0=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}e0(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),r0=window&&window.__assign||function(){return(r0=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)},o0=window&&window.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],o=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&o>=e.length?void 0:e)&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},n0=window&&window.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var o,n,i=r.call(e),s=[];try{for(;(void 0===t||0<t--)&&!(o=i.next()).done;)s.push(o.value)}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return s},i0=window&&window.__spreadArray||function(e,t){for(var r=0,o=t.length,n=e.length;r<o;r++,n++)e[n]=t[r];return e},s0=(w(a0,t0=k),a0.prototype.merge=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];try{for(var r=o0(e),o=r.next();!o.done;o=r.next()){var n=o.value;n&&(n.authOptions?"string"==typeof n.authOptions.subscriptionKey&&(n.subscriptionKey=n["subscription-key"]=n.authOptions.subscriptionKey):"string"==typeof n.subscriptionKey?(n["subscription-key"]=n.subscriptionKey,n.authOptions={authType:l.AuthenticationType.subscriptionKey,subscriptionKey:n.subscriptionKey}):"string"==typeof n["subscription-key"]&&(n.subscriptionKey=n["subscription-key"],n.authOptions={authType:l.AuthenticationType.subscriptionKey,subscriptionKey:n["subscription-key"]}),"string"==typeof n.sessionId?n["session-id"]=n.sessionId:"string"==typeof n["session-id"]&&(n.sessionId=n["session-id"]),"boolean"==typeof n.disableTelemetry?n["disable-telemetry"]=n.disableTelemetry:"boolean"==typeof n["disable-telemetry"]&&(n.disableTelemetry=n["disable-telemetry"]),"boolean"==typeof n.enableAccessibility?n["enable-accessibility"]=n.enableAccessibility:"boolean"==typeof n["enable-accessibility"]&&(n.enableAccessibility=n["enable-accessibility"]))}}catch(e){a={error:e}}finally{try{o&&!o.done&&(s=r.return)&&s.call(r)}finally{if(a)throw a.error}}var i=this._transformers,s=e?e.filter(function(e){return void 0!==e}).reduce(function(e,t){return i0(i0([],n0(e)),n0(t._transformers||[]))},[]):[],a=t0.prototype.merge.apply(this,i0([],n0(e)));return a.authOptions.authType!==l.AuthenticationType.subscriptionKey&&(a["subscription-key"]=a.subscriptionKey=void 0),void 0!==a.styleSet&&void 0===a.mapConfiguration&&(a.mapConfiguration=a.styleSet),a.mapConfiguration&&"string"!=typeof a.mapConfiguration&&(a.mapConfiguration=r0(r0({},a.mapConfiguration),{defaultConfiguration:a.mapConfiguration.defaultConfiguration||a.mapConfiguration.defaultStyle,configurations:a.mapConfiguration.configurations||a.mapConfiguration.styles})),this._transformers=i0(i0([],n0(i||[])),n0(s.filter(function(e){return!i.includes(e)}))),this.transformRequest&&!this._transformers.includes(this.transformRequest)&&this._transformers.push(this.transformRequest),this.transformRequest=$w(this._transformers),a},a0.prototype.addTransformer=function(e){this._transformers||(this._transformers=[]),this._transformers.push(e),this.transformRequest=$w(this._transformers)},a0.prototype.removeTransformer=function(t){this._transformers&&(this._transformers=this._transformers.filter(function(e){return t!==e}),this.transformRequest=$w(this._transformers))},a0._cloneCustomizer=function(e){if("object"==typeof e)return Object.assign({},e)},a0);function a0(){var e=null!==t0&&t0.apply(this,arguments)||this;return e.authOptions=Ou(),e.disableTelemetry=!1,e["disable-telemetry"]=e.disableTelemetry,e.domain=gu,e.staticAssetsDomain=yu,e.styleDefinitionsPath=mu,e.styleDefinitionsVersion=vu,e.styleAPIVersion=_u,e.mapConfiguration=void 0,e.styleSet=void 0,e.enableAccessibility=!0,e["enable-accessibility"]=e.enableAccessibility,e.enableAccessibilityLocationFallback=!0,e.maxParallelImageRequests=qu(),e.refreshExpiredTiles=!0,e.subscriptionKey=Hu(),e["subscription-key"]=e.subscriptionKey,e.sessionId=fu,e["session-id"]=e.sessionId,e._transformers=[],e.transformRequest=void 0,e.workerCount=Du(),e.fadeDuration=300,e.localIdeographFontFamily="sans-serif",e.validateStyle=!0,e}var c0=(u0.getLayerGroup=function(e){var t=e;if(null!=t&&t.metadata&&t.metadata["microsoft.maps:layerGroup"])return t.metadata["microsoft.maps:layerGroup"];e=null!==(t=null==t?void 0:t.id)&&void 0!==t?t:e;if(e.startsWith("microsoft.")){e=e.split(".");return 4<=e.length?e[3]:void 0}},u0);function u0(){}var l0=(h0.resolve=function(e){return new h0(Promise.resolve(e))},h0.reject=function(e){return new h0(Promise.reject(e))},h0.prototype.then=function(e,t){var r=this;return new Promise(function(e,t){r._resolve=e,r._reject=t,r._thenResolver(e,t)}).then(e,t)},h0.prototype.catch=function(e){var r=this;return new Promise(function(e,t){r._resolve=e,r._reject=t,r._thenResolver(e,t)}).catch(e)},h0.prototype.finally=function(e){var r=this;return new Promise(function(e,t){r._resolve=e,r._reject=t,r._thenResolver(e,t)}).finally(e)},h0.prototype.hijackAndResolve=function(e){this._hijackedToResolve=e,this._resolve&&this._resolve(e)},h0.prototype.hijackAndReject=function(e){this._hijackedToReject=e,this._reject&&this._reject(e)},h0.prototype.switchWith=function(e){this.origin=e,this._toResolve=void 0,this._toReject=void 0},h0);function h0(e){var n=this;this.isHijacked=function(){return void 0!==n._hijackedToResolve||void 0!==n._hijackedToReject},this.isResolved=function(){return void 0!==n._hijackedToResolve||void 0!==n._toResolve},this.isRejected=function(){return void 0!==n._hijackedToReject||void 0!==n._toReject},this.resultIfResolved=function(){return n._hijackedToResolve||n._toResolve},this.errorIfRejected=function(){return n._hijackedToReject||n._toReject},this._thenResolver=function(t,r){var o;n._hijackedToResolve?t(n._hijackedToResolve):n._hijackedToReject?r(n._hijackedToReject):(o=n.origin,n.origin.then(function(e){n.isHijacked()||(o!==n.origin?n._thenResolver(t,r):(n._toResolve=e,t(e)))}).catch(function(e){n.isHijacked()||(o!==n.origin?n._thenResolver(t,r):(n._toReject=e,r(e)))}))},this.origin=e,this[Symbol.toStringTag]=this.origin[Symbol.toStringTag]}var p0={road:"Road",satellite:"Satellite",satellite_road_labels:"Hybrid",grayscale_dark:"Grayscale (Dark)",grayscale_light:"Grayscale (Light)",night:"Night",road_shaded_relief:"Terra",blank:"Blank",blank_accessible:"Blank (Accessible)",high_contrast_dark:"High contrast (Dark)",high_contrast_light:"High contrast (Light)"},d0=window&&window.__assign||function(){return(d0=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)},f0=window&&window.__awaiter||function(e,s,a,c){return new(a=a||Promise)(function(r,t){function o(e){try{i(c.next(e))}catch(e){t(e)}}function n(e){try{i(c.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(o,n)}i((c=c.apply(e,s||[])).next())})},g0=window&&window.__generator||function(r,o){var n,i,s,a={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(t){return function(e){return function(t){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(s=2&t[0]?i.return:t[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,t[1])).done)return s;switch(i=0,(t=s?[2&t[0],s.value]:t)[0]){case 0:case 1:s=t;break;case 4:return a.label++,{value:t[1],done:!1};case 5:a.label++,i=t[1],t=[0];continue;case 7:t=a.ops.pop(),a.trys.pop();continue;default:if(!(s=0<(s=a.trys).length&&s[s.length-1])&&(6===t[0]||2===t[0])){a=0;continue}if(3===t[0]&&(!s||t[1]>s[0]&&t[1]<s[3])){a.label=t[1];break}if(6===t[0]&&a.label<s[1]){a.label=s[1],s=t;break}if(s&&a.label<s[2]){a.label=s[2],a.ops.push(t);break}s[2]&&a.ops.pop(),a.trys.pop();continue}t=o.call(r,a)}catch(e){t=[6,e],i=0}finally{n=s=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}([t,e])}}},y0=window&&window.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var o,n,i=r.call(e),s=[];try{for(;(void 0===t||0<t--)&&!(o=i.next()).done;)s.push(o.value)}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return s},m0=window&&window.__spreadArray||function(e,t){for(var r=0,o=t.length,n=e.length;r<o;r++,n++)e[n]=t[r];return e},v0=(_0.prototype.updateIndoorState=function(e,t){var r,o,n=this,i=this.map.styles.getMapConfiguration();i?(this.preservedPreindoorMapConfiguration=i,r=this.map.getStyle().style?this.map.getStyle().style+"_indoor"+("dark"===e?"_dark":"")+"_tileset_"+t:void 0,this.map.styles.setMapConfiguration("defaultIndoor_"+t,"microsoft-maps:default"===i?r:void 0)):(o=(null===(r=this.indoorState)||void 0===r?void 0:r.tilesetId)!==t,this.indoorState={tilesetId:t,theme:e},this.initStyleset(),this.definitions().then(function(e){var t=(n.map.getStyle().style||e.defaultConfiguration).replace("_indoor_dark","").replace("_indoor","")+"_indoor",e=e.configurations.find(function(e){return e.name.startsWith(t)});e&&n.map.setStyle({style:e.name},!o)}))},_0.prototype.unsetIndoorState=function(){var r=this,e=this.preservedPreindoorMapConfiguration;e?this.map.styles.setMapConfiguration(e):(this.indoorState=void 0,this.initStyleset(),this.definitions().then(function(e){var t=r.map.getStyle().style;t.includes("_indoor")&&t.split("_indoor")[0]?r.map.setStyle({style:t.split("_indoor")[0]}):r.map.setStyle({style:void 0})}))},_0.prototype.initStyleset=function(){var r=this,e=this.serviceOptions.mapConfiguration?"string"==typeof this.serviceOptions.mapConfiguration?new l0(this._request(this.serviceOptions.domain,_+"/mapconfigurations/metadata/"+this.serviceOptions.mapConfiguration,"StyleDefinitions").then(function(e){return d0(d0({},e),{defaultConfiguration:e.defaultConfiguration||e.defaultStyle,configurations:e.configurations||e.styles})})):l0.resolve(this.serviceOptions.mapConfiguration):new l0(this._request(this.serviceOptions.staticAssetsDomain,v+"/"+_,"StyleDefinitions",{version:this.serviceOptions.styleDefinitionsVersion}).then(function(t){return{version:isNaN(t.version)?0:parseFloat(t.version),defaultConfiguration:t.defaultStyle,configurations:t.styles.filter(function(e){return r.indoorState?"auto"===r.indoorState.theme?e.name.endsWith("dark"===e.theme?"_indoor_dark":"_indoor"):e.name.endsWith("dark"===r.indoorState.theme?"_indoor_dark":"_indoor"):!e.name.includes("indoor")}).map(function(e){return{copyright:e.copyright.join(" "),name:e.name,displayName:function(e){e=r.indoorState&&e.includes("_indoor")?e.split("_indoor")[0]:e;return e in p0?p0[e]:e}(e.name),theme:e.theme,thumbnail:new D({domain:r.serviceOptions.staticAssetsDomain,path:e.thumbnail,protocol:"https"}).toString(),url:new D({domain:r.serviceOptions.staticAssetsDomain,path:v+"/"+_+"/"+e.name,queryParams:{styleVersion:void 0!==t.version&&null!==t.version?t.version:r.serviceOptions.styleDefinitionsVersion},protocol:"https"}).toString()}})}}));return this.initPromise&&this.initPromise.switchWith(e),this.initPromise=e,this.initPromise.then(function(e){return r.map._invokeEvent("mapconfigurationchanged",e)}),this.initPromise},_0.prototype.getStyle=function(e){e=this._lookUp(e);if(!e)throw Error("Style definition is not available.");if(e.url)return e.url;if(e.style)return e.style;throw Error("Style definition does not contain neither URL nor style object.")},_0.prototype.deriveNewStyle=function(e,t){var i=this.map.getStyle(),s=this.map.getTraffic();return d0(d0({},t),{layers:t.layers.map(function(e){var t,r,o=d0({},e),n=c0.getLayerGroup(o);return n&&(i.showBuildingModels||"fill-extrusion"!==o.type?"fill-extrusion"===o.type&&(o.layout=null!==(e=o.layout)&&void 0!==e?e:{},o.layout.visibility="visible"):(o.layout=null!==(t=o.layout)&&void 0!==t?t:{},o.layout.visibility="none"),"none"!==s.flow&&n&&n==="traffic_"+s.flow&&"line"==o.type&&(o.layout=null!==(t=o.layout)&&void 0!==t?t:{},o.layout.visibility="visible"),"labels"!==n&&"labels_places"!==n&&"labels_indoor"!==n||"symbol"!==o.type||(i.showLabels&&"none"!==(null===(n=o.layout)||void 0===n?void 0:n.visibility)?(o.layout=null!==(r=o.layout)&&void 0!==r?r:{},o.layout.visibility="visible"):(o.layout=null!==(r=o.layout)&&void 0!==r?r:{},o.layout.visibility="none"))),o})})},_0.prototype.injectUserLayersIntoStyle=function(s,a,c){return s?this.map.layers._getUserLayers().reduce(function(r,t){if(t.layer instanceof Oc)return r;var e,o=c[t.before]&&0<c[t.before].length?c[t.before][0]:void 0,n=s.layers.find(function(e){return e.id===t.layer.getId()}),i=a.layers.findIndex(function(e){return e.id===t.layer.getId()});return-1<i&&a.layers.splice(i,1),n&&(e=new Set(Array.from(t.layer._getSourceIds()).map(function(e){return s.sources[e]?{source:s.sources[e],id:e}:void 0}).filter(function(e){return void 0!==e})),-1<(i=o?r.layers.findIndex(function(e){return e.id===o.id}):-1)?r.layers.splice(i,0,n):r.layers.push(n),e.forEach(function(e){var t=e.source,e=e.id;r.sources[e]=t})),r},d0({},a)):a},_0.prototype.setStyle=function(n,e){var i=this;void 0===e&&(e=!0);try{this.map._getMap().setStyle(this.getStyle(n),{diff:e,validate:this.serviceOptions.validateStyle,transformStyle:function(e,t){var r=t,o=n.progressiveLoading&&!i.map._isLoaded();o&&Array.isArray(null==t?void 0:t.layers)&&((r=d0({},t)).layers=r.layers.map(function(e){var t=d0({},e);return e.layout&&(t.layout=d0({},e.layout)),t}));t=i.deriveNewStyle(e,r).layers.map(function(e){return{nextLayer:e,layerGroup:c0.getLayerGroup(e)}}).filter(function(e){e.nextLayer;return void 0!==e.layerGroup}).reduce(function(e,t){var r=t.nextLayer,o=t.layerGroup;return d0(d0({},e),((t={})[o]=o in e?m0(m0([],y0(e[o])),[r]):[r],t))},{});o&&(o=n.progressiveLoadingInitialLayerGroups,Array.isArray(o)&&0<o.length&&i._deferLayerGroupVisibilities(t,o));r=i.injectUserLayersIntoStyle(e,r,t),t=Object.entries(t).map(function(e){var t=y0(e,2),e=t[0],t=t[1];return i._buildFundamentalLayerFrom(t,e)}),t=i.map.layers._getUserLayers().reduce(function(e,t){var r=t.before?e.findIndex(function(e){return e.getId()===t.before}):-1;return-1<r?e.splice(r,0,t.layer):e.push(t.layer),e},t);return i.map.layers.layerIndex=t,i.map.sources._syncSources(r.sources),i.map.events.remove("styledata",i._onStyleData),i.map.events.addOnce("styledata",i._onStyleData),r}})}catch(e){throw e}},_0.prototype.getTheme=function(e){e=this._lookUp(e);if(e)return e.theme.toLowerCase()},_0.prototype.getThemeAsync=function(t){return f0(this,void 0,void 0,function(){return g0(this,function(e){switch(e.label){case 0:return[4,this._lookUpAsync(t)];case 1:return[2,e.sent().theme]}})})},_0.prototype.setMapConfiguration=function(e,r){var o=this;"string"==typeof(this.serviceOptions.mapConfiguration=e)?this.initStyleset():this.initPromise?this.initPromise.hijackAndResolve(e):this.initPromise=l0.resolve(e),this.definitions().then(function(e){var t=e.defaultConfiguration;e.configurations.find(function(e){return e.name===r})&&(t=r),o.map.setStyle({style:t})})},_0.prototype.getMapConfiguration=function(){return this.serviceOptions.mapConfiguration},_0.prototype.setStyleSet=function(e){this.updateIndoorState("indoor_dark"===e?"dark":"light",null)},_0.prototype.getStyleSet=function(){return void 0!==this.indoorState?"dark"===this.indoorState.theme?"indoor_dark":"indoor":"base"},_0.prototype.clearStyleSet=function(){this.unsetIndoorState()},_0.prototype._buildFundamentalLayerFrom=function(e,t){if(e&&0<e.length){e=new B_(e,t);return e.onAdd(this.map),e}throw new Error("Unable to construct fundamental map layer for ID: "+t+".")},_0.prototype._transformStyleRequest=function(e,t){e.includes(u)&&(t.url=t.url.replace(u,this.serviceOptions.domain)),e.includes(y)&&(t.url=t.url.replace(y,v)),e.includes(m)&&(t.url=t.url.replace(m,_)),(t.url.toLocaleLowerCase().includes(this.serviceOptions.domain.toLocaleLowerCase())||t.url.toLocaleLowerCase().includes(this.serviceOptions.staticAssetsDomain.toLocaleLowerCase()))&&((e=new URL(t.url)).searchParams.get(c)||(e.searchParams.set(c,this.serviceOptions.styleAPIVersion),t.url=e.href),null!==(e=this.map.authentication)&&void 0!==e&&e.signRequest(t))},_0.prototype._request=function(o,n,i,s){var a;return void 0===s&&(s={}),f0(this,void 0,void 0,function(){var t,r;return g0(this,function(e){switch(e.label){case 0:return t={url:new D({protocol:"https",domain:o,path:n,queryParams:d0(((r={})[c]=this.serviceOptions.styleAPIVersion,r.hash=_0._hashCode(null===(a=this.map.authentication)||void 0===a?void 0:a.getToken()),r),s)}).toString()},"function"==typeof this.serviceOptions.transformRequest&&i&&(t=this.serviceOptions.transformRequest(t.url,i)),null!==(a=this.map.authentication)&&void 0!==a&&a.signRequest(t),r={method:"GET",mode:"cors"},t.credentials&&(r.credentials=t.credentials),t.headers&&(r.headers=t.headers),[4,fetch(t.url,r).then(function(e){if(e.ok)return e.json();throw new Error("HTTP "+e.status+": "+e.statusText+" ")})];case 1:return[2,e.sent()]}})})},_0._hashCode=function(e){var t=0;if(!(e=void 0===e?"":e))return t;for(var r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r),t|=0;return t},_0);function _0(e,t){var a=this;this.definitions=function(){return a.initPromise||a.initStyleset()},this.indoorState=void 0,this.preservedPreindoorMapConfiguration=void 0,this._progressiveLoadingState={mapStyle:void 0,pendingVisibilityChange:void 0},this._deferLayerGroupVisibilities=function(t,e){var r,n,o,i,s=e.filter(function(e){return e in t});0!==s.length&&(r=a.map._getMap(),n=r.getZoom(),o=a.map.getStyle().style,a._progressiveLoadingState.pendingVisibilityChange&&(a.map.events.remove("load",a._progressiveLoadingState.pendingVisibilityChange),a._progressiveLoadingState.pendingVisibilityChange=null),a._progressiveLoadingState.mapStyle=o,(i=Object.entries(t).reduce(function(e,t){var r=y0(t,2),t=r[0],r=r[1],o=s.includes(t);return m0(m0([],y0(e)),y0(r.filter(function(e){if("custom"===e.type)return!1;if(o)if("number"==typeof e.maxzoom&&"number"==typeof e.minzoom){if(n<=e.maxzoom&&n>=e.minzoom)return!1}else if("number"==typeof e.minzoom){if(n>=e.minzoom)return!1}else{if("number"!=typeof e.maxzoom)return!1;if(n<=e.maxzoom)return!1}return"none"!==(null===(e=e.layout)||void 0===e?void 0:e.visibility)})))},[])).forEach(function(e){e.layout=e.layout||{},e.layout.visibility="none"}),a._progressiveLoadingState.pendingVisibilityChange=function(){a._progressiveLoadingState.pendingVisibilityChange=null;var e=a.map.getStyle().style;o===e&&i.forEach(function(e){e.layout.visibility="visible",r.setLayoutProperty(e.id,"visibility","visible")})},a.map.events.addOnce("load",a._progressiveLoadingState.pendingVisibilityChange))},this._onStyleData=function(){a._lookUpAsync(a.map.getStyle()).then(function(e){a.map.events.invoke("stylechanged",{style:e.name,map:a.map,type:"stylechanged"})})},this._lookUp=function(t){var e=a.definitions().errorIfRejected(),r=a.definitions().resultIfResolved();return e||void 0===r?null:r.configurations.find(function(e){return e.name===(t.style||r.defaultConfiguration)})||r.configurations.find(function(e){return e.name===r.defaultConfiguration})||r.configurations[0]},this._lookUpAsync=function(r){return f0(a,void 0,void 0,function(){var t;return g0(this,function(e){switch(e.label){case 0:return[4,this.definitions()];case 1:return t=e.sent(),[2,t.configurations.find(function(e){return e.name===(r.style||t.defaultConfiguration)})||t.configurations.find(function(e){return e.name===t.defaultConfiguration})||t.configurations[0]]}})})},this.map=e,this.serviceOptions=t}var w0,b0,w=window&&window.__extends||(w0=function(e,t){return(w0=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}w0(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),C0=window&&window.__assign||function(){return(C0=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)},E0=window&&window.__awaiter||function(e,s,a,c){return new(a=a||Promise)(function(r,t){function o(e){try{i(c.next(e))}catch(e){t(e)}}function n(e){try{i(c.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(o,n)}i((c=c.apply(e,s||[])).next())})},S0=window&&window.__generator||function(r,o){var n,i,s,a={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(t){return function(e){return function(t){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(s=2&t[0]?i.return:t[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,t[1])).done)return s;switch(i=0,(t=s?[2&t[0],s.value]:t)[0]){case 0:case 1:s=t;break;case 4:return a.label++,{value:t[1],done:!1};case 5:a.label++,i=t[1],t=[0];continue;case 7:t=a.ops.pop(),a.trys.pop();continue;default:if(!(s=0<(s=a.trys).length&&s[s.length-1])&&(6===t[0]||2===t[0])){a=0;continue}if(3===t[0]&&(!s||t[1]>s[0]&&t[1]<s[3])){a.label=t[1];break}if(6===t[0]&&a.label<s[1]){a.label=s[1],s=t;break}if(s&&a.label<s[2]){a.label=s[2],a.ops.push(t);break}s[2]&&a.ops.pop(),a.trys.pop();continue}t=o.call(r,a)}catch(e){t=[6,e],i=0}finally{n=s=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}([t,e])}}},T0=window&&window.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var o,n,i=r.call(e),s=[];try{for(;(void 0===t||0<t--)&&!(o=i.next()).done;)s.push(o.value)}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return s},I0=window&&window.__spreadArray||function(e,t){for(var r=0,o=t.length,n=e.length;r<o;r++,n++)e[n]=t[r];return e},A0=window&&window.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],o=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&o>=e.length?void 0:e)&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},k0=(w(P0,b0=Q),P0.prototype.getCanvas=function(){return this.map.getCanvas()},P0.prototype.getCanvasContainer=function(){return this.map.getCanvasContainer()},P0.prototype.getMapContainer=function(){return this.map.getContainer()},P0.prototype.getServiceOptions=function(){return es(this.serviceOptions,s0._cloneCustomizer)},P0.prototype.setServiceOptions=function(e){this.serviceOptions=(new s0).merge(this.serviceOptions,e),this.serviceOptions["enable-accessibility"]?this.accessibleMapDelegate.addToMap():this.accessibleMapDelegate.removeFromMap()},P0.prototype.addRequestTransformer=function(e){this.serviceOptions.addTransformer(e)},P0.prototype.removeRequestTransformer=function(e){this.serviceOptions.removeTransformer(e)},P0.prototype.setCamera=function(e,t){if(void 0===t&&(t=!1),"padding"in e||"offset"in e||"bounds"in e){var r,o=(new dw).merge({maxZoom:this.getCamera().maxZoom},e),n=this._generateSafeBounds(o.bounds),i={padding:o.padding,offset:o.offset,maxZoom:o.maxZoom};if(!(r=this.map.cameraForBounds(n,i))){var s=null===(s=this.map)||void 0===s?void 0:s.getContainer(),s={message:"The map cannot be fit to the current canvas with the given CameraBoundsOptions.",containerWidth:null==s?void 0:s.clientWidth,containerHeight:null==s?void 0:s.clientHeight,safeBounds:n,cameraForBoundsOptions:i};throw new Error(JSON.stringify(s))}"pitch"in e&&(r.pitch=e.pitch),"bearing"in e&&(r.bearing=e.bearing),this.map.setMaxZoom(o.maxZoom),this._invokeEvent("maxzoomchanged",this.map.getMaxZoom()),n=this._generateSafeBounds(o.maxBounds)}else{i=(new mw).merge(this.getCamera(),e);i.centerOffset&&2<=i.centerOffset.length&&(s=i.centerOffset,(o=ei([i.center],i.zoom))[0][0]+=s[0],o[0][1]+=s[1],i.center=$n(o,i.zoom)[0]),r={center:i.center,zoom:i.zoom,bearing:i.bearing,pitch:i.pitch,around:void 0},this.map.setMinZoom(i.minZoom),this.map.setMaxZoom(i.maxZoom),this._invokeEvent("minzoomchanged",this.map.getMinZoom()),this._invokeEvent("maxzoomchanged",this.map.getMaxZoom()),n=this._generateSafeBounds(i.maxBounds)}n?this.map.setMaxBounds(n):this.map.setMaxBounds(null);n=(new rw).merge(e),e={duration:n.duration,easing:function(e){return e},offset:[0,0],animate:!0},t={fromControl:t};"jump"===n.type?this.map.jumpTo(r,t):"ease"===n.type?this.map.easeTo(C0(C0({},r),e),t):"fly"===n.type&&this.map.flyTo(C0(C0({},r),e),t)},P0.prototype.setCameraBounds=function(e){this.setCamera(e)},P0.prototype.getCamera=function(){var e=this.map.getBounds().getSouthWest().toArray(),t=this.map.getBounds().getNorthEast().toArray();return{zoom:this.map.getZoom(),center:this.map.getCenter().toArray(),bearing:this.map.getBearing(),pitch:this.map.getPitch(),bounds:new Ai(e,t),minZoom:this.map.getMinZoom(),maxZoom:this.map.getMaxZoom()}},P0.prototype.setStyle=function(e,t){void 0===t&&(t=!0),delete e.preserveDrawingBuffer;e=(new Qw).merge(this.styleOptions,e);e.autoResize!==this.styleOptions.autoResize&&this._setAutoResize(e.autoResize),e.language!==this.styleOptions.language&&(this.localizedStringsPromise=ru.getStrings(e.language)),e.renderWorldCopies!==this.styleOptions.renderWorldCopies&&this.map.setRenderWorldCopies(e.renderWorldCopies),e.showFeedbackLink!==this.styleOptions.showFeedbackLink&&this.copyrightControl.setOptions({showFeedbackLink:e.showFeedbackLink}),e.customAttribution!==this.styleOptions.customAttribution&&this.copyrightControl.setOptions({customAttribution:e.customAttribution}),e.showLogo!==this.styleOptions.showLogo&&this.copyrightControl.setOptions({showLogo:e.showLogo}),e.showTileBoundaries!==this.styleOptions.showTileBoundaries&&(this.map.showTileBoundaries=e.showTileBoundaries),e.showBuildingModels&&console.warn("showBuildingModels is deprecated.");t=t&&this.styleOptions.language===e.language&&this.styleOptions.view===e.view;this.styleOptions=e,this._setStyleComponents(e,t)},P0.prototype.getStyle=function(){return Hr(this.styleOptions)},P0.prototype.addIcon=function(e,t){this.imageSprite.add(e,t)},P0.prototype.addPins=function(e,t){var r,o=(new xw).merge(t),n=this.layers.getLayerById(o.name),i=!1;if(n||(i=!0,n=new ac(o.name+"-source",o.name,{source:o.name+"-source",minZoom:o.minZoom,maxZoom:o.maxZoom,iconOptions:{anchor:"center",size:o.iconSize,image:["case",["has","icon"],["get","icon"],o.icon],ignorePlacement:!o.cluster,opacity:o.opacity},textOptions:{anchor:"center",textField:["case",["has","point_count"],["to-string",["get","point_count"]],["has","title"],["to-string",["get","title"]],o.title],font:["case",["has","point_count"],["literal",["StandardFontCondensed-Bold"]],["literal",[o.textFont]]],size:["case",["has","point_count"],20,o.fontSize],ignorePlacement:!o.cluster,opacity:o.opacity,offset:["case",["has","point_count"],["literal",[.5,-.45]],["literal",[o.textOffset[0]/16,o.textOffset[1]/16]]],color:o.fontColor}})),!(n instanceof ac))throw new Error("A layer with name '"+o.name+"' already exists but it is not a SymbolLayer.A SymbolLayer should be used for rendering pins.");var s=n.getSource();"string"==typeof s?(r=s,s=this.sources.getById(r)):r=s.getId();t=!1;if(s||(t=!0,s=new ls(r,{cluster:o.cluster})),!(s instanceof ls))throw new Error("The source with name '"+r+"' already exists but it is not a DataSource.New data can only be added to a DataSource.");t&&this.sources.add(s),i&&this.layers.add(n,o.before);e=new Pi(e);o.overwrite?s.setShapes(e):s.add(e)},P0.prototype.addCircles=function(e,t){var r,o=(new Sw).merge(t),n=this.layers.getLayerById(o.name),i=!1;if(n||(i=!0,n=new Vs(o.name+"-source",o.name,{source:o.name+"-source",minZoom:o.minZoom,maxZoom:o.maxZoom,opacity:o.opacity,radius:["case",["has","radius"],["get","radius"],o.radius],color:["case",["has","color"],["get","color"],o.color],strokeColor:["case",["has","outlineColor"],["get","outlineColor"],o.outlineColor],strokeWidth:["case",["has","outlineWidth"],["get","outlineWidth"],o.outlineWidth]})),!(n instanceof Vs))throw new Error("A layer with name '"+o.name+"' already exists but it is not a BubbleLayer.A BubbleLayer should be used for rendering circles.");var s=n.getSource();"string"==typeof s?(r=s,s=this.sources.getById(r)):r=s.getId();t=!1;if(s||(t=!0,s=new ls(r)),!(s instanceof ls))throw new Error("The source with name '"+r+"' already exists but it is not a DataSource.New data can only be added to a DataSource.");t&&this.sources.add(s),i&&this.layers.add(n,o.before);e=new Pi(e);o.overwrite?s.setShapes(e):s.add(e)},P0.prototype.addLinestrings=function(e,t){var r,o=(new kw).merge(t),n=this.layers.getLayerById(o.name),i=!1;if(n||(i=!0,n=new Ta(o.name+"-source",o.name,{source:o.name+"-source",minZoom:o.minZoom,maxZoom:o.maxZoom,lineCap:o.cap,lineJoin:o.join,strokeOpacity:o.opacity,strokeColor:["case",["has","color"],["get","color"],o.color],strokeWidth:["case",["has","width"],["get","width"],o.width]})),!(n instanceof Ta))throw new Error("A layer with name '"+o.name+"' already exists but it is not a LineLayer.A LineLayer should be used for rendering linestrings.");var s=n.getSource();"string"==typeof s?(r=s,s=this.sources.getById(r)):r=s.getId();t=!1;if(s||(t=!0,s=new ls(r)),!(s instanceof ls))throw new Error("The source with name '"+r+"' already exists but it is not a DataSource.New data can only be added to a DataSource.");t&&this.sources.add(s),i&&this.layers.add(n,o.before);e=new Pi(e);o.overwrite?s.setShapes(e):s.add(e)},P0.prototype.addPolygons=function(e,t){var r,o=(new Dw).merge(t),n=this.layers.getLayerById(o.name),i=!1;if(n||(i=!0,n=new Ka(o.name+"-source",o.name,{source:o.name+"-source",minZoom:o.minZoom,maxZoom:o.maxZoom,fillOpacity:o.opacity,fillColor:["case",["has","color"],["get","color"],o.color]})),!(n instanceof Ka))throw new Error("A layer with name '"+o.name+"' already exists but it is not a PolygonLayer.A PolygonLayer should be used for rendering linestrings.");var s=n.getSource();"string"==typeof s?(r=s,s=this.sources.getById(r)):r=s.getId();t=!1;if(s||(t=!0,s=new ls(r)),!(s instanceof ls))throw new Error("The source with name '"+r+"' already exists but it is not a DataSource.New data can only be added to a DataSource.");t&&this.sources.add(s),i&&this.layers.add(n,o.before);e=new Pi(e);o.overwrite?s.setShapes(e):s.add(e)},P0.prototype.addRaster=function(e,t){var r=(new Hw).merge(t),o=this.layers.getLayerById(r.name);if(!((o=o||new Cc({maxZoom:r.maxZoom,minZoom:r.minZoom,opacity:r.opacity,tileSize:256,tileUrl:"{subdomain}"},r.name))instanceof Cc))throw new Error("A layer with name '"+r.name+"' already exists but it is not a TileLayer.A TileLayer should be used for rendering raster images.");if("{subdomain}"!==o.getOptions().tileUrl)throw new Error("A TileLayer with name '"+r.name+"' already exists but was configured for a single tile url [default for new TileLayer(...)].");(t=!r.overwrite&&o.getOptions().subdomains||[]).push.apply(t,I0([],T0(e))),o._setOptionsNoUpdate({subdomains:t}),this.layers.add(o,r.before)},P0.prototype.getLayers=function(){return this.layers.getLayers().map(function(e){return e.getId()})},P0.prototype.removeLayers=function(e){var t,r;try{for(var o=A0(e),n=o.next();!n.done;n=o.next()){var i,s=n.value;this.layers.getLayerById(s)&&(this.layers.remove(s),i=s+"-source",this.sources.getById(i)&&this.sources.remove(i))}}catch(e){t={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}},P0.prototype.addHtml=function(e,t){e.id||(e.id="marker_"+tn());var r=new Jc({htmlContent:e});return this.markers.add(r,t),e.id},P0.prototype.removeHtml=function(e){this.markers.remove(e)},P0.prototype.addEventListener=function(e,t,r){this.events._addLegacy(e,t,r)},P0.prototype.removeEventListener=function(e,t,r){this.events._removeLegacy(e,t,r)},P0.prototype.setUserInteraction=function(e){this.userInteractionDelegate.setOptions(e)},P0.prototype.getUserInteraction=function(){return this.userInteractionDelegate.getOptions()},P0.prototype.addControl=function(e,t){this.controls.add(e,t)},P0.prototype.removeControl=function(e){this.controls.remove(e)},P0.prototype.setTraffic=function(e){var t=this.trafficOptions.incidents,r=this.trafficOptions.flow;if(this.trafficOptions=(new bo).merge(this.trafficOptions,e),this.controls.getControls().filter(function(e){return e instanceof Po}).forEach(function(e){return e.updateButtonState()}),this.incidentDelegate&&(this.trafficOptions.incidents?t||this.incidentDelegate.addToMap():this.incidentDelegate.removeFromMap()),this.trafficOptions.flow&&"none"!==this.trafficOptions.flow){["absolute","relative-delay"].includes(this.trafficOptions.flow)&&console.warn("The 'absolute' and 'relative-delay' flow options are deprecated. Please use 'relative' instead.");try{this.trafficOptions.flow!==r&&this.flowDelegate.addToMap()}catch(e){throw this.trafficOptions.flow=r,e}}else this.flowDelegate.removeFromMap()},P0.prototype.getTraffic=function(){return Hr(this.trafficOptions)},P0.prototype.remove=function(){this.dispose()},P0.prototype.clear=function(){this.popups.clear(),this.layers.clear(),this.sources.clear(),this.markers.clear()},P0.prototype.dispose=function(){var e;for(this.clear(),this.map.remove(),null!==(e=this.authentication)&&void 0!==e&&e.dispose(),this.removed=!0,window.removeEventListener("resize",this._windowResizeCallback);this.getMapContainer().firstChild;){var t=this.getMapContainer().firstChild;this.getMapContainer().removeChild(t)}},P0.prototype.resize=function(e,t,r){"number"!=typeof e&&"string"!=typeof e||"number"!=typeof t&&"string"!=typeof t?r=e:(e=e,this.getMapContainer().style.height="number"==typeof e?e+"px":e,this.getMapContainer().style.width="number"==typeof t?t+"px":t);t=this.getMapContainer().style.overflow;this.getMapContainer().style.overflow="hidden",this.map.resize(r),this.getMapContainer().style.overflow=t},P0.prototype.pixelsToPositions=function(e){var t,r,o=[];try{for(var n=A0(e),i=n.next();!i.done;i=n.next()){var s=i.value,a=this.map.unproject(s);o.push(new gi(a.lng,a.lat))}}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}return o},P0.prototype.positionsToPixels=function(e){var t,r,o=[];try{for(var n=A0(e),i=n.next();!i.done;i=n.next()){var s=i.value,a=this.map.project(s);o.push(new an(a.x,a.y))}}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}return o},P0.prototype.areTilesLoaded=function(){return this.map.areTilesLoaded()},P0.prototype.stop=function(){this.map.stop()},P0.prototype.triggerRepaint=function(){this.map.triggerRepaint()},P0.prototype._getMap=function(){return this.map},P0.prototype._rebuildStyle=function(t){return void 0===t&&(t=!0),E0(this,void 0,void 0,function(){return S0(this,function(e){return this.styles.setStyle(this.styleOptions,t),this.imageSprite._restoreImages(),[2]})})},P0.prototype._isLoaded=function(){return this.loaded},P0.prototype._isReady=function(){return this.ready},P0.prototype._getLocalizedStrings=function(){return this.localizedStringsPromise},P0.prototype._sendRequest=function(e,t,r){var o;return(o="function"==typeof this.serviceOptions.transformRequest?this.serviceOptions.transformRequest(e,t):o)?fetch(o.url||e,{credentials:o.credentials,headers:C0(C0({},r),o.headers),method:"GET",mode:"cors"}):fetch(e,{headers:r,method:"GET",mode:"cors"})},P0.prototype._substituteDomainLanguageViewAndSignInRequest=function(e,t){var r,o;(e.includes(p)||e.includes(u))&&(o=new RegExp("[^{]"+p+"[^}]"),e.match(o)&&(t.url=t.url.replace(p,u)),D.protoRegEx.test(this.serviceOptions.domain)?(o=t.url.indexOf(u),t.url=this.serviceOptions.domain+t.url.substring(o+u.length)):t.url=t.url.replace(u,this.serviceOptions.domain)),(t.url.toLocaleLowerCase().includes(this.serviceOptions.domain.toLocaleLowerCase())||t.url.toLocaleLowerCase().includes(this.serviceOptions.staticAssetsDomain.toLocaleLowerCase()))&&null!==(r=this.authentication)&&void 0!==r&&r.signRequest(t),e.includes(g)&&(t.url=t.url.replace(g,this.styleOptions.language)),e.includes(d)&&(t.url=this.styleOptions.view?t.url.replace(d,this.styleOptions.view):t.url.replace(d,"").replace("&"+f+"=",""))},P0.prototype._setAutoResize=function(e){e?window.addEventListener("resize",this._windowResizeCallback):window.removeEventListener("resize",this._windowResizeCallback)},P0.prototype._setStyleComponents=function(t,r){var o=this;void 0===r&&(r=!0),this.removed||this.styles.definitions().then(function(e){o.styleOptions.style&&e.configurations.map(function(e){return e.name}).includes(o.styleOptions.style)||(o.styleOptions.style=e.defaultConfiguration),o.styleOptions=t,o._rebuildStyle(r)})},P0.prototype._updateGlobalDefaults=function(e){e&&(e.authOptions&&!Pu&&Fu(e.authOptions),e.domain&&!Cu&&Ku(e.domain),e.styleDefinitionsPath&&!Eu&&Gu(e.styleDefinitionsPath),e.workerCount&&!Tu&&Yu(e.workerCount),e.maxParallelImageRequests&&!Iu&&Zu(e.maxParallelImageRequests),!e.subscriptionKey&&!e["subscription-key"]||Pu||Ju(e.subscriptionKey||e["subscription-key"]),!e.sessionId&&!e["session-id"]||ku||Vu(e.sessionId||e["session-id"]),e.language&&!Au&&Wu(e.language),!e.userRegion&&!e.view||bu||Qu(e.userRegion||e.view))},P0.prototype._generateSafeBounds=function(e){if(e){var t=Ai.getSouth(e),r=Ai.getWest(e),o=Ai.getNorth(e),n=Ai.getEast(e);if(!(isFinite(t)&&isFinite(r)&&isFinite(o)&&isFinite(n)))throw new Error("The bounds specified are invalid: ["+e+"]");for(;n<r;)n+=360;return new Ai([r,t,n,o])}return e},P0.prototype._detectHighContrast=function(){var e,t;switch(cl.getHighContrastMode()){case"invert":case"light":e=P0.Css.hcLight,t="high_contrast_light";break;case"dark":e=P0.Css.hcDark,t="high_contrast_dark"}e&&this.map.getContainer().classList.add(e),t&&"road"===this.styleOptions.style&&(this.styleOptions.style=t)},P0.Css={canvasContainer:"atlas-map-canvas-container",canvas:"atlas-map-canvas",container:"atlas-map",hcDark:"high-contrast-dark",hcLight:"high-contrast-light"},P0);function P0(e,t){var o=b0.call(this)||this;o.removed=!1,o.loaded=!1,o.ready=!1,o._windowResizeCallback=function(){return o.resize()};var r,n,i=!0;o._updateGlobalDefaults(t),o.serviceOptions=(new s0).merge(t),o.styleOptions=(new Qw).merge(t),o.trafficOptions=new bo,o.styles=new v0(o,o.serviceOptions),o.serviceOptions.authOptions.subscriptionKey&&(o.serviceOptions.authOptions.subscriptionKey=encodeURIComponent(o.serviceOptions.authOptions.subscriptionKey)),r=o.serviceOptions.authOptions.clientId||(o.serviceOptions.authOptions.subscriptionKey?o.serviceOptions.authOptions.subscriptionKey.replace(/.(?=.{3,}$)/g,"*"):"invalid-setting"),o.insights&&o.insights.setAuthenticatedUserContext(o.serviceOptions.sessionId,r),arguments[2]&&"ENVIRONMENT"in window&&window.ENVIRONMENT.hmr?(n=arguments[2],o.ready=!0,o.loaded=!0):(e={antialias:o.styleOptions.antialias,attributionControl:!1,container:e,fadeDuration:o.serviceOptions.fadeDuration,localIdeographFontFamily:o.serviceOptions.localIdeographFontFamily,preserveDrawingBuffer:o.styleOptions.preserveDrawingBuffer,refreshExpiredTiles:o.serviceOptions.refreshExpiredTiles,renderWorldCopies:o.styleOptions.renderWorldCopies,trackResize:!1,transformRequest:function(e,t){var r={url:e};return"Tile"===t||"Source"===t?(e.includes(p)&&o.insights&&o.insights.trackEvent({name:"TileLoad"}),o._substituteDomainLanguageViewAndSignInRequest(e,r)):"Style"!==t&&"SpriteJSON"!==t&&"SpriteImage"!==t&&"Glyphs"!==t||o.styles._transformStyleRequest(e,r),o.serviceOptions.transformRequest&&uo(r,o.serviceOptions.transformRequest(r.url,t)),r}},n=new h.Map(e));try{o.map=n,o.authentication=new w_(o),o.controls=new E_(o),o.events=new R_(o),o.imageSprite=new D_(o),o.layers=new Y_(o),o.markers=new N_(o),o.sources=new X_(o),o.popups=new V_(o),o.map.getContainer().classList.add(P0.Css.container),o.map.getCanvasContainer().classList.add(P0.Css.canvasContainer),o.map.getCanvas().classList.add(P0.Css.canvas),o._detectHighContrast(),o.copyrightControl=new yl({showFeedbackLink:o.styleOptions.showFeedbackLink,showLogo:o.styleOptions.showLogo,customAttribution:o.styleOptions.customAttribution}),o.controls.add(o.copyrightControl,{position:l.ControlPosition.NonFixed});var s=o.authentication?o.authentication.initialize():Promise.resolve();if(o.removed)return o;var a=function(){o.loaded=!0,o.map.off("load",a)};o.map.on("load",a);var c=function(){o.ready=!0,o.map.off("styledata",c),o.events.invoke("ready",{map:o,type:"ready"})};o.map.on("styledata",c),o._setAutoResize(o.styleOptions.autoResize),o.map.showTileBoundaries=o.styleOptions.showTileBoundaries,o.localizedStringsPromise=ru.getStrings(o.styleOptions.language);var u=o.styles.initStyleset();Promise.all([s,u]).then(function(e){e=T0(e,2),e[0],e[1];if(!o.removed){if(o.authentication&&!o.authentication.getToken())throw new Error("AuthenticationManager finished initializing, but no token is available");o.serviceOptions["enable-accessibility"]&&o.accessibleMapDelegate.addToMap(),o._setStyleComponents(o.styleOptions),o.copyrightDelegate&&o.copyrightDelegate.addToMap()}}).catch(function(e){e=e instanceof Error?e:new Error(e);o.insights&&o.insights.trackException({error:e}),o.events.invoke("error",{map:o,type:"error",error:e})}),o.setCamera(C0(C0({minZoom:1},t),{type:"jump",duration:0})),o.incidentDelegate=new zl(o),o.flowDelegate=new Ll(o),o.accessibleMapDelegate=new Nl(o),o.userInteractionDelegate=new Xl(o,t),o.userInteractionDelegate.addToMap(),o.copyrightDelegate=new gh(o,o.copyrightControl,o.styleOptions)}catch(e){throw i=!1,o.insights&&o.insights.trackException({error:e instanceof Error?e:new Error(e)}),e}finally{o.insights&&(o.insights.trackEvent({name:"MapLoad"},{success:i,supported:zu(!1),supportedWithPerformance:zu(!0)}),o.insights.flush())}return o}var O0=window&&window.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var o,n,i=r.call(e),s=[];try{for(;(void 0===t||0<t--)&&!(o=i.next()).done;)s.push(o.value)}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return s},R0=window&&window.__spreadArray||function(e,t){for(var r=0,o=t.length,n=e.length;r<o;r++,n++)e[n]=t[r];return e},k=(x0.applyTemplate=function(t,r){var o,n,e,i=this,s=document.createElement("div");return s.classList.add(x0.Css.template),t&&("boolean"!=typeof(r=r||{}).singleDescription&&(r.singleDescription=!0),r.sandboxContent="boolean"!=typeof r.sandboxContent||r.sandboxContent,r.title&&"string"==typeof r.content&&(r.content.includes("{title}")||r.content.includes("{name}"))||(t.title?r.title="{title}":t.name&&(r.title="{name}")),"boolean"!=typeof r.detectHyperlinks&&(r.detectHyperlinks=!0),"boolean"!=typeof r.parsePropertyPaths&&(r.parsePropertyPaths=!0),r.textColor&&(s.style.color=r.textColor),r.fillColor&&(s.style.backgroundColor=r.fillColor),r.title&&((e=this._applyStringTemplate(t,r.title,r)).innerText=e.textContent||e.innerText||"",this._appendChild(s,e,x0.Css.title)),(o=document.createElement("div")).classList.add(x0.Css.content),Array.isArray(r.content)?0<r.content.length&&r.content[0].propertyPath?this._appendChild(o,this._generateContent(t,r.content,r),x0.Css.item):r.content.forEach(function(e){i._appendChild(o,i._generateContent(t,e,r),x0.Css.item)}):(n=0,t.description&&Object.keys(t).forEach(function(e){i._ignoreProperty(e,t[e])||n++}),e=void 0,1===n||r.singleDescription&&t.description||2===n&&t.Snippet?(e=document.createElement("div")).innerHTML=t.description:e=this._generateContent(t,r.content,r),this._appendChild(o,e,x0.Css.item)),""!==o.innerHTML&&(r.sandboxContent?s.appendChild(x0._createSandboxedIframe(o,r)):s.appendChild(o))),s},x0._createSandboxedIframe=function(e,t){var r=document.createElement("iframe");r.sandbox.add("allow-popups");var o=e.innerHTML,n=!1,i=100,s=550,a=10,c=0;document.body.scrollWidth<=340&&(s=300,i=50);var u=o.split(/<(tr|div|br|li|h[0-9]|p>)/),c=Math.max.apply(Math,R0([],O0(u.map(function(e){return e.replace(/<[a-zA-Z0-9\s=\/]+>/g,"").length}))))-1,e=Math.ceil(3.5*c);e<s&&(s=e,i=c),o.includes("<img")||o.includes("<video")?(n=!0,r.width="550px"):(c=-1<o.indexOf(x0.Css.table)?25:20,a+=Math.max(.5*u.length*c,Math.ceil(o.replace(/<[a-zA-Z0-9\s=\/]+>/g,"").length/i)*c)),r.width=s+"px",r.height=n||280<a?"280px":a+"px";a=t.textColor?"color:"+t.textColor+";":"",t=t.fillColor?"background-color:"+t.fillColor+";":"",o='<html><head><title></title><meta charset="utf-8" /><meta http-equiv="x-ua-compatible" content="IE=Edge" /><link rel="stylesheet" href="'+x0._cssUrl+'" type="text/css"/><style>html, body{margin:0;padding:0;'+a+t+'}</style></head><body><div class="'+x0.Css.template+'" style="padding:0;width:'+(s-20)+'px">'+o+"</div></body></html>";return void 0===r.srcdoc?r.src="data:text/html;charset=utf-8,"+encodeURI(o):r.srcdoc=o,r},x0._appendChild=function(e,t,r){t&&(r&&(t.className=(t.className?t.className+" ":"")+r),e.appendChild(t))},x0._generateContent=function(e,t,r){if(t)return Array.isArray(t)?this._generatePropertyInfoTable(e,t,r):this._applyStringTemplate(e,t,r);e=this._generateDynamicTableHtml(e,null,r);if(e){r=document.createElement("div");return r.innerHTML=e,r}return null},x0._applyStringTemplate=function(e,t,r){if(t){for(var o,n=t,i=this._placeholderRx.exec(t);i;)2<=i.length&&(o=this._getPropertyValue(e,i[1],r),n=n.replace(i[0],o)),i=this._placeholderRx.exec(t);if(n){(n=n.trim()).includes("<")&&(n=n.replace(/[\r\n]+/g,"<br/>"));var s=document.createElement("div");return s.innerHTML=n,s}}return null},x0._getPropertyValue=function(e,t,r,o){var n=r.parsePropertyPaths?t.split("/"):[t],i=n.length;if(0<i&&e){var s=n[0],a=e[s];if(r.detectHyperlinks&&"link"===t&&(!o||o.hyperlinkFormat)){var c,u=[];if(Array.isArray(a)?a.forEach(function(e){e.href?u.push(e):"string"==typeof e&&u.push({href:e})}):a.href&&u.push(a),0<u.length){o&&o.hyperlinkFormat?c=o.hyperlinkFormat:r&&r.hyperlinkFormat&&(c=r.hyperlinkFormat);var l=c&&c.target?c.target:"_blank",h=[];return u.forEach(function(e){e.title||c&&c.label||!e.rel||h.push(e.rel," - "),h.push('<a href="',e.href,'" target="',l,'">'),e.title?h.push(e.title):c&&c.label?h.push(c.label):h.push(e.href),h.push("</a>","<br/>")}),h.pop(),h.join("")}}if(null!=a){for(var p=void 0,p=1;p<i&&(a=a[n[p]],s=n[p],null!=a);p++);if(p===i&&null!=a){var d=void 0;if((d=void 0!==a.value?a.value:a)instanceof Date)return o&&o.dateFormat?d.toLocaleString(void 0,o.dateFormat):r.dateFormat?d.toLocaleString(void 0,r.dateFormat):d.toISOString();if("object"==typeof d)return(g=this._generateDynamicTableHtml(d,n.slice(1),r))||"";if("number"==typeof d){if(o){if(o.dateFormat)return new Date(d).toLocaleString(void 0,o.dateFormat);if(o.numberFormat)return d.toLocaleString(void 0,o.numberFormat)}else if(/(timestamp|date)/gi.test(s))return new Date(d).toISOString();return d.toLocaleString(void 0,r.numberFormat)}if("string"==typeof d&&""!==d&&!/[\n\r<>\s]/g.test(d)&&(r.detectHyperlinks||o&&o.hyperlinkFormat)){var d=d.trim(),f=this._isUrlRx.test(d)||o&&o.hyperlinkFormat,e=this._isImageUrlRx.test(d)&&(f||d.startsWith("data:image")),t=this._emailRx.test(d);if(f||e||t){f=void 0;o&&o.hyperlinkFormat?f=o.hyperlinkFormat:r&&r.hyperlinkFormat&&(f=r.hyperlinkFormat);var g=void 0;g=f&&f.target?' target="'+f.target+'"':' target="_blank"';r=""+(f&&f.label?f.label:d);f&&f.scheme?d=f.scheme+d:t&&(d="mailto:"+d);t=f&&f.label?' alt="'+f.label+'"':"";return'<a href="'+d+'"'+g+">"+(r=f&&f.isImage||e?'<img src="'+d+'" style="max-width:100%"'+t+'"/>':r)+"</a>"}}return d.toString()}}}return""},x0._generatePropertyInfoTable=function(r,e,o){if(r&&e&&0<e.length){var n=[],i=this;n.push('<table class="'+i.Css.table+'">'),e.forEach(function(e){var t=i._getPropertyValue(r,e.propertyPath,o,e);e.hideLabel?n.push('<tr><td colspan="2">',t,"</td></tr>"):(e=e.label||e.propertyPath.split("/")[0],n.push("<tr><th>",e,"</th><td>",t,"</td></tr>"))}),n.push("</table>");e=document.createElement("div");return e.innerHTML=n.join(""),e}return null},x0._generateDynamicTableHtml=function(t,e,r){var o=this;if(t){var n=[],i=this;n.push('<table class="'+i.Css.table+'">');var s=e&&0<e.length?e.join("/")+"/":"",a=0;return(Object.keys(t).forEach(function(e){o._ignoreProperty(e,t[e])||(n.push("<tr><th>",e,"</th><td>",i._getPropertyValue(t,s+e,r),"</td></tr>"),a++)}),0===a)?null:(n.push("</table>"),n.join(""))}return null},x0._ignoreProperty=function(e,t){switch(e){case"title":case"name":case"base":case"popupTemplate":case"anchor":case"icon":case"image":case"imageUrl":case"rotation":case"color":case"size":case"offset":case"strokeColor":case"strokeWidth":case"strokeOpacity":case"subType":case"fillColor":case"fillOpacity":case"visibility":case"visible":return!0;default:if(0===e.indexOf("_")||null==t||""===t)return!0}return!1},x0._placeholderRx=/\{([a-zA-Z0-9_\/\s]+)\}/gi,x0._isUrlRx=/^(http|https|ftp|tel|mailto):\/\//i,x0._isImageUrlRx=/(^data:image|.png$|.jpg$|.jpeg$|.gif$|.bmp$|.svg|.tif|.tiff$)/i,x0._emailRx=/^[^\.\s@:](?:[^\s@:]*[^\s@:\.])?@[^\.\s@]+(?:\.[^\.\s@]+)*$/,x0._cssUrl=new D({domain:t,path:"sdk/javascript/mapcontrol/"+j.getEndpointVersion()+"/atlas.min.css"}).toString(),x0.Css={template:"azure-maps-control-popup-template",title:"azure-maps-control-popup-template-title",content:"azure-maps-control-popup-template-content",item:"azure-maps-control-popup-template-content-item",table:"azure-maps-control-popup-template-table"},x0);function x0(){this.detectHyperlinks=!0,this.parsePropertyPaths=!0}w=new D({domain:t,path:"sdk/javascript/mapcontrol/"+j.getEndpointVersion()+"/mapbox-gl-rtl-text.min.js"});h.setRTLTextPlugin(w.toString(),function(e){e&&console.warn(e)},!0),l.HtmlMarker=Jc,l.Map=k0,l.Pixel=an,l.Popup=zc,l.PopupTemplate=k,l.Shape=Ci,l._getAssetDomain=function(){return e},l._getDomain=function(){return gu},l._hasMaxParallelImageRequests=ol,l._hasSetAuthenticationOptions=$u,l._hasSetDomain=el,l._hasSetLanguage=nl,l._hasSetSessionId=il,l._hasSetStyleDefinitionsPath=tl,l._hasSetStyleDefinitionsVersion=function(){return Su},l._hasSetView=sl,l._hasWorkerCount=rl,l.addImageTemplate=function(e,t,r){!r&&al[e.toLowerCase()]||(al[e.toLowerCase()]=t)},l.clearPrewarmedResources=function(){h.clearPrewarmedResources()},l.control=Se,l.data=Re,l.getAllImageTemplateNames=function(){return Object.keys(al)},l.getAuthenticationOptions=Ou,l.getDomain=xu,l.getImageTemplate=Xu,l.getLanguage=Uu,l.getMaxParallelImageRequests=qu,l.getSessionId=ju,l.getStaticAssetsDomain=Ru,l.getStyleAPIVersion=Lu,l.getStyleDefinitionsPath=Mu,l.getStyleDefinitionsVersion=Nu,l.getSubscriptionKey=Hu,l.getUserRegion=function(){return lu},l.getVersion=function(){return j.getFullVersion()},l.getView=Bu,l.getWorkerCount=Du,l.internal=te,l.isSupported=zu,l.layer=Pe,l.math=Oe,l.prewarm=function(){h.prewarm()},l.setAuthenticationOptions=Fu,l.setDomain=Ku,l.setLanguage=Wu,l.setMaxParallelImageRequests=Zu,l.setSessionId=Vu,l.setStyleAPIVersion=function(e){_u=e},l.setStyleDefinitionsPath=Gu,l.setStyleDefinitionsVersion=function(e){vu=e,Su=!0},l.setSubscriptionKey=Ju,l.setUserRegion=Qu,l.setView=function(e){lu=e,bu=!0},l.setWorkerCount=Yu,l.source=x,Object.defineProperty(l,"__esModule",{value:!0})});