diff --git a/Samples/3D-layer/Flowmap.gl/dist/Flowmapgl.bundle.js b/Samples/3D-layer/Flowmap.gl/dist/Flowmapgl.bundle.js index c7196993..ac654b87 100644 --- a/Samples/3D-layer/Flowmap.gl/dist/Flowmapgl.bundle.js +++ b/Samples/3D-layer/Flowmap.gl/dist/Flowmapgl.bundle.js @@ -3,7 +3,7 @@ } catch (error) { console.error(error); throw error; -}`)}function wk(n){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,t=arguments.length>2?arguments[2]:void 0;const r=t||new Set;if(n){if(xk(n))r.add(n);else if(xk(n.buffer))r.add(n.buffer);else if(!ArrayBuffer.isView(n)){if(e&&typeof n=="object")for(const i in n)wk(n[i],e,r)}}return t===void 0?Array.from(r):[]}function xk(n){return n?n instanceof ArrayBuffer||typeof MessagePort<"u"&&n instanceof MessagePort||typeof ImageBitmap<"u"&&n instanceof ImageBitmap||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas:!1}const qT=()=>{};class $T{static isSupported(){return typeof Worker<"u"&&Pb||typeof HT<"u"&&!Pb}constructor(e){Y(this,"name",void 0),Y(this,"source",void 0),Y(this,"url",void 0),Y(this,"terminated",!1),Y(this,"worker",void 0),Y(this,"onMessage",void 0),Y(this,"onError",void 0),Y(this,"_loadableURL","");const{name:t,source:r,url:i}=e;Ll(r||i),this.name=t,this.source=r,this.url=i,this.onMessage=qT,this.onError=o=>console.log(o),this.worker=Pb?this._createBrowserWorker():this._createNodeWorker()}destroy(){this.onMessage=qT,this.onError=qT,this.worker.terminate(),this.terminated=!0}get isRunning(){return!!this.onMessage}postMessage(e,t){t=t||wk(e),this.worker.postMessage(e,t)}_getErrorFromErrorEvent(e){let t="Failed to load ";return t+="worker ".concat(this.name," from ").concat(this.url,". "),e.message&&(t+="".concat(e.message," in ")),e.lineno&&(t+=":".concat(e.lineno,":").concat(e.colno)),new Error(t)}_createBrowserWorker(){this._loadableURL=i7({source:this.source,url:this.url});const e=new Worker(this._loadableURL,{name:this.name});return e.onmessage=t=>{t.data?this.onMessage(t.data):this.onError(new Error("No data received"))},e.onerror=t=>{this.onError(this._getErrorFromErrorEvent(t)),this.terminated=!0},e.onmessageerror=t=>console.error(t),e}_createNodeWorker(){let e;if(this.url){const r=this.url.includes(":/")||this.url.startsWith("/")?this.url:"./".concat(this.url);e=new HT(r,{eval:!1})}else if(this.source)e=new HT(this.source,{eval:!0});else throw new Error("no worker");return e.on("message",t=>{this.onMessage(t)}),e.on("error",t=>{this.onError(t)}),e.on("exit",t=>{}),e}}class s7{static isSupported(){return $T.isSupported()}constructor(e){Y(this,"name","unnamed"),Y(this,"source",void 0),Y(this,"url",void 0),Y(this,"maxConcurrency",1),Y(this,"maxMobileConcurrency",1),Y(this,"onDebug",()=>{}),Y(this,"reuseWorkers",!0),Y(this,"props",{}),Y(this,"jobQueue",[]),Y(this,"idleQueue",[]),Y(this,"count",0),Y(this,"isDestroyed",!1),this.source=e.source,this.url=e.url,this.setProps(e)}destroy(){this.idleQueue.forEach(e=>e.destroy()),this.isDestroyed=!0}setProps(e){this.props={...this.props,...e},e.name!==void 0&&(this.name=e.name),e.maxConcurrency!==void 0&&(this.maxConcurrency=e.maxConcurrency),e.maxMobileConcurrency!==void 0&&(this.maxMobileConcurrency=e.maxMobileConcurrency),e.reuseWorkers!==void 0&&(this.reuseWorkers=e.reuseWorkers),e.onDebug!==void 0&&(this.onDebug=e.onDebug)}async startJob(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:(o,a,l)=>o.done(l),r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:(o,a)=>o.error(a);const i=new Promise(o=>(this.jobQueue.push({name:e,onMessage:t,onError:r,onStart:o}),this));return this._startQueuedJob(),await i}async _startQueuedJob(){if(!this.jobQueue.length)return;const e=this._getAvailableWorker();if(!e)return;const t=this.jobQueue.shift();if(t){this.onDebug({message:"Starting job",name:t.name,workerThread:e,backlog:this.jobQueue.length});const r=new r7(t.name,e);e.onMessage=i=>t.onMessage(r,i.type,i.payload),e.onError=i=>t.onError(r,i),t.onStart(r);try{await r.result}finally{this.returnWorkerToQueue(e)}}}returnWorkerToQueue(e){this.isDestroyed||!this.reuseWorkers||this.count>this._getMaxConcurrency()?(e.destroy(),this.count--):this.idleQueue.push(e),this.isDestroyed||this._startQueuedJob()}_getAvailableWorker(){if(this.idleQueue.length>0)return this.idleQueue.shift()||null;if(this.count{}};class Nl{static isSupported(){return $T.isSupported()}static getWorkerFarm(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return Nl._workerFarm=Nl._workerFarm||new Nl({}),Nl._workerFarm.setProps(e),Nl._workerFarm}constructor(e){Y(this,"props",void 0),Y(this,"workerPools",new Map),this.props={...c7},this.setProps(e),this.workerPools=new Map}destroy(){for(const e of this.workerPools.values())e.destroy();this.workerPools=new Map}setProps(e){this.props={...this.props,...e};for(const t of this.workerPools.values())t.setProps(this._getWorkerPoolProps())}getWorkerPool(e){const{name:t,source:r,url:i}=e;let o=this.workerPools.get(t);return o||(o=new s7({name:t,source:r,url:i}),o.setProps(this._getWorkerPoolProps()),this.workerPools.set(t,o)),o}_getWorkerPoolProps(){return{maxConcurrency:this.props.maxConcurrency,maxMobileConcurrency:this.props.maxMobileConcurrency,reuseWorkers:this.props.reuseWorkers,onDebug:this.props.onDebug}}}Y(Nl,"_workerFarm",void 0);const l7="latest";function u7(n){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const t=e[n.id]||{},r="".concat(n.id,"-worker.js");let i=t.workerUrl;if(!i&&n.id==="compression"&&(i=e.workerUrl),e._workerType==="test"&&(i="modules/".concat(n.module,"/dist/").concat(r)),!i){let o=n.version;o==="latest"&&(o=l7);const a=o?"@".concat(o):"";i="https://unpkg.com/@loaders.gl/".concat(n.module).concat(a,"/dist/").concat(r)}return Ll(i),i}function h7(n){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:JV;Ll(n,"no worker provided");const t=n.version;return!(!e||!t)}const d7=Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"}));function f7(n,e){return!Nl.isSupported()||!Pb&&!(e!=null&&e._nodeWorkers)?!1:n.worker&&(e==null?void 0:e.worker)}async function p7(n,e,t,r,i){const o=n.id,a=u7(n,t),h=Nl.getWorkerFarm(t).getWorkerPool({name:o,url:a});t=JSON.parse(JSON.stringify(t)),r=JSON.parse(JSON.stringify(r||{}));const p=await h.startJob("process-on-worker",g7.bind(null,i));return p.postMessage("process",{input:e,options:t,context:r}),await(await p.result).result}async function g7(n,e,t,r){switch(t){case"done":e.done(r);break;case"error":e.error(new Error(r.error));break;case"process":const{id:i,input:o,options:a}=r;try{const l=await n(o,a);e.postMessage("done",{id:i,result:l})}catch(l){const h=l instanceof Error?l.message:"unknown error";e.postMessage("error",{id:i,error:h})}break;default:console.warn("parse-with-worker unknown message ".concat(t))}}function m7(n,e,t){if(t=t||n.byteLength,n.byteLengthl instanceof ArrayBuffer?new Uint8Array(l):l),i=r.reduce((l,h)=>l+h.byteLength,0),o=new Uint8Array(i);let a=0;for(const l of r)o.set(l,a),a+=l.byteLength;return o.buffer}async function _7(n){const e=[];for await(const t of n)e.push(t);return y7(...e)}function Ek(){let n;if(typeof window<"u"&&window.performance)n=window.performance.now();else if(typeof process<"u"&&process.hrtime){const e=process.hrtime();n=e[0]*1e3+e[1]/1e6}else n=Date.now();return n}class Tk{constructor(e,t){Y(this,"name",void 0),Y(this,"type",void 0),Y(this,"sampleSize",1),Y(this,"time",void 0),Y(this,"count",void 0),Y(this,"samples",void 0),Y(this,"lastTiming",void 0),Y(this,"lastSampleTime",void 0),Y(this,"lastSampleCount",void 0),Y(this,"_count",0),Y(this,"_time",0),Y(this,"_samples",0),Y(this,"_startTime",0),Y(this,"_timerPending",!1),this.name=e,this.type=t,this.reset()}setSampleSize(e){return this.sampleSize=e,this}incrementCount(){return this.addCount(1),this}decrementCount(){return this.subtractCount(1),this}addCount(e){return this._count+=e,this._samples++,this._checkSampling(),this}subtractCount(e){return this._count-=e,this._samples++,this._checkSampling(),this}addTime(e){return this._time+=e,this.lastTiming=e,this._samples++,this._checkSampling(),this}timeStart(){return this._startTime=Ek(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(Ek()-this._startTime),this._timerPending=!1,this._checkSampling(),this):this}getSampleAverageCount(){return this.sampleSize>0?this.lastSampleCount/this.sampleSize:0}getSampleAverageTime(){return this.sampleSize>0?this.lastSampleTime/this.sampleSize:0}getSampleHz(){return this.lastSampleTime>0?this.sampleSize/(this.lastSampleTime/1e3):0}getAverageCount(){return this.samples>0?this.count/this.samples:0}getAverageTime(){return this.samples>0?this.time/this.samples:0}getHz(){return this.time>0?this.samples/(this.time/1e3):0}reset(){return this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this}_checkSampling(){this._samples===this.sampleSize&&(this.lastSampleTime=this._time,this.lastSampleCount=this._count,this.count+=this._count,this.time+=this._time,this.samples+=this._samples,this._time=0,this._count=0,this._samples=0)}}class WT{constructor(e){Y(this,"id",void 0),Y(this,"stats",{}),this.id=e.id,this.stats={},this._initializeStats(e.stats),Object.seal(this)}get(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"count";return this._getOrCreate({name:e,type:t})}get size(){return Object.keys(this.stats).length}reset(){for(const e in this.stats)this.stats[e].reset();return this}forEach(e){for(const t in this.stats)e(this.stats[t])}getTable(){const e={};return this.forEach(t=>{e[t.name]={time:t.time||0,count:t.count||0,average:t.getAverageTime()||0,hz:t.getHz()||0}}),e}_initializeStats(){(arguments.length>0&&arguments[0]!==void 0?arguments[0]:[]).forEach(t=>this._getOrCreate(t))}_getOrCreate(e){if(!e||!e.name)return null;const{name:t,type:r}=e;return this.stats[t]||(e instanceof Tk?this.stats[t]=e:this.stats[t]=new Tk(t,r)),this.stats[t]}}let v7="";const Sk={};function b7(n){for(const e in Sk)if(n.startsWith(e)){const t=Sk[e];n=n.replace(e,t)}return!n.startsWith("http://")&&!n.startsWith("https://")&&(n="".concat(v7).concat(n)),n}function sSe(n){return n}function w7(n){return n&&typeof n=="object"&&n.isBuffer}function Ck(n){if(w7(n))return n;if(n instanceof ArrayBuffer)return n;if(ArrayBuffer.isView(n))return n.byteOffset===0&&n.byteLength===n.buffer.byteLength?n.buffer:n.buffer.slice(n.byteOffset,n.byteOffset+n.byteLength);if(typeof n=="string"){const e=n;return new TextEncoder().encode(e).buffer}if(n&&typeof n=="object"&&n._toArrayBuffer)return n._toArrayBuffer();throw new Error("toArrayBuffer")}function Ak(n){const e=n?n.lastIndexOf("/"):-1;return e>=0?n.substr(e+1):""}function x7(n){const e=n?n.lastIndexOf("/"):-1;return e>=0?n.substr(0,e):""}const E7=n=>typeof n=="boolean",Iy=n=>typeof n=="function",Py=n=>n!==null&&typeof n=="object",Ik=n=>Py(n)&&n.constructor==={}.constructor,T7=n=>n&&typeof n[Symbol.iterator]=="function",S7=n=>n&&typeof n[Symbol.asyncIterator]=="function",bd=n=>typeof Response<"u"&&n instanceof Response||n&&n.arrayBuffer&&n.text&&n.json,wd=n=>typeof Blob<"u"&&n instanceof Blob,C7=n=>n&&typeof n=="object"&&n.isBuffer,A7=n=>typeof ReadableStream<"u"&&n instanceof ReadableStream||Py(n)&&Iy(n.tee)&&Iy(n.cancel)&&Iy(n.getReader),I7=n=>Py(n)&&Iy(n.read)&&Iy(n.pipe)&&E7(n.readable),Pk=n=>A7(n)||I7(n),P7=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,M7=/^([-\w.]+\/[-\w.+]+)/;function R7(n){const e=M7.exec(n);return e?e[1]:n}function Mk(n){const e=P7.exec(n);return e?e[1]:""}const Rk=/\?.*/;function k7(n){const e=n.match(Rk);return e&&e[0]}function YT(n){return n.replace(Rk,"")}function Mb(n){return bd(n)?n.url:wd(n)?n.name||"":typeof n=="string"?n:""}function KT(n){if(bd(n)){const e=n,t=e.headers.get("content-type")||"",r=YT(e.url);return R7(t)||Mk(r)}return wd(n)?n.type||"":typeof n=="string"?Mk(n):""}function O7(n){return bd(n)?n.headers["content-length"]||-1:wd(n)?n.size:typeof n=="string"?n.length:n instanceof ArrayBuffer||ArrayBuffer.isView(n)?n.byteLength:-1}async function kk(n){if(bd(n))return n;const e={},t=O7(n);t>=0&&(e["content-length"]=String(t));const r=Mb(n),i=KT(n);i&&(e["content-type"]=i);const o=await D7(n);o&&(e["x-first-bytes"]=o),typeof n=="string"&&(n=new TextEncoder().encode(n));const a=new Response(n,{headers:e});return Object.defineProperty(a,"url",{value:r}),a}async function L7(n){if(!n.ok){const e=await N7(n);throw new Error(e)}}async function N7(n){let e="Failed to fetch resource ".concat(n.url," (").concat(n.status,"): ");try{const t=n.headers.get("Content-Type");let r=n.statusText;t.includes("application/json")&&(r+=" ".concat(await n.text())),e+=r,e=e.length>60?"".concat(e.slice(0,60),"..."):e}catch{}return e}async function D7(n){if(typeof n=="string")return"data:,".concat(n.slice(0,5));if(n instanceof Blob){const t=n.slice(0,5);return await new Promise(r=>{const i=new FileReader;i.onload=o=>{var a;return r(o==null||(a=o.target)===null||a===void 0?void 0:a.result)},i.readAsDataURL(t)})}if(n instanceof ArrayBuffer){const t=n.slice(0,5),r=F7(t);return"data:base64,".concat(r)}return null}function F7(n){let e="";const t=new Uint8Array(n);for(let r=0;r=0)}function Dl(){return!(typeof process=="object"&&String(process)==="[object process]"&&!process.browser)||Lk()}const Rb={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document,process:typeof process=="object"&&process},kb=Rb.window||Rb.self||Rb.global,My=Rb.process||{},Nk=typeof __VERSION__<"u"?__VERSION__:"untranspiled source";Dl();const ZT=globalThis;function Dk(n){if(!n&&!Dl())return"Node";if(Lk(n))return"Electron";const t=n||(typeof navigator<"u"?navigator:{}).userAgent||"";if(t.indexOf("Edge")>-1)return"Edge";const r=t.indexOf("MSIE ")!==-1,i=t.indexOf("Trident/")!==-1;return r||i?"IE":ZT.chrome?"Chrome":ZT.safari?"Safari":ZT.mozInnerScreenX?"Firefox":"Unknown"}function B7(n){try{const e=window[n],t="__storage_test__";return e.setItem(t,t),e.removeItem(t),e}catch{return null}}class U7{constructor(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"sessionStorage";Y(this,"storage",void 0),Y(this,"id",void 0),Y(this,"config",void 0),this.storage=B7(r),this.id=e,this.config=t,this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(e){if(Object.assign(this.config,e),this.storage){const t=JSON.stringify(this.config);this.storage.setItem(this.id,t)}}_loadConfiguration(){let e={};if(this.storage){const t=this.storage.getItem(this.id);e=t?JSON.parse(t):{}}return Object.assign(this.config,e),this}}function z7(n){let e;return n<10?e="".concat(n.toFixed(2),"ms"):n<100?e="".concat(n.toFixed(1),"ms"):n<1e3?e="".concat(n.toFixed(0),"ms"):e="".concat((n/1e3).toFixed(2),"s"),e}function j7(n){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:8;const t=Math.max(e-n.length,0);return"".concat(" ".repeat(t)).concat(n)}function XT(n,e,t){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:600;const i=n.src.replace(/\(/g,"%28").replace(/\)/g,"%29");n.width>r&&(t=Math.min(t,r/n.width));const o=n.width*t,a=n.height*t,l=["font-size:1px;","padding:".concat(Math.floor(a/2),"px ").concat(Math.floor(o/2),"px;"),"line-height:".concat(a,"px;"),"background:url(".concat(i,");"),"background-size:".concat(o,"px ").concat(a,"px;"),"color:transparent;"].join("");return["".concat(e," %c+"),l]}let Ob;(function(n){n[n.BLACK=30]="BLACK",n[n.RED=31]="RED",n[n.GREEN=32]="GREEN",n[n.YELLOW=33]="YELLOW",n[n.BLUE=34]="BLUE",n[n.MAGENTA=35]="MAGENTA",n[n.CYAN=36]="CYAN",n[n.WHITE=37]="WHITE",n[n.BRIGHT_BLACK=90]="BRIGHT_BLACK",n[n.BRIGHT_RED=91]="BRIGHT_RED",n[n.BRIGHT_GREEN=92]="BRIGHT_GREEN",n[n.BRIGHT_YELLOW=93]="BRIGHT_YELLOW",n[n.BRIGHT_BLUE=94]="BRIGHT_BLUE",n[n.BRIGHT_MAGENTA=95]="BRIGHT_MAGENTA",n[n.BRIGHT_CYAN=96]="BRIGHT_CYAN",n[n.BRIGHT_WHITE=97]="BRIGHT_WHITE"})(Ob||(Ob={}));function Fk(n){return typeof n=="string"?Ob[n.toUpperCase()]||Ob.WHITE:n}function V7(n,e,t){return!Dl&&typeof n=="string"&&(e&&(e=Fk(e),n="\x1B[".concat(e,"m").concat(n,"\x1B[39m")),t&&(e=Fk(t),n="\x1B[".concat(t+10,"m").concat(n,"\x1B[49m"))),n}function H7(n){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:["constructor"];const t=Object.getPrototypeOf(n),r=Object.getOwnPropertyNames(t);for(const i of r)typeof n[i]=="function"&&(e.find(o=>i===o)||(n[i]=n[i].bind(n)))}function Lb(n,e){if(!n)throw new Error(e||"Assertion failed")}function wp(){let n;if(Dl&&"performance"in kb){var e,t;n=kb==null||(e=kb.performance)===null||e===void 0||(t=e.now)===null||t===void 0?void 0:t.call(e)}else if("hrtime"in My){var r;const i=My==null||(r=My.hrtime)===null||r===void 0?void 0:r.call(My);n=i[0]*1e3+i[1]/1e6}else n=Date.now();return n}const xp={debug:Dl&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},G7={enabled:!0,level:0};function zs(){}const Bk={},Uk={once:!0};class Ry{constructor(){let{id:e}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{id:""};Y(this,"id",void 0),Y(this,"VERSION",Nk),Y(this,"_startTs",wp()),Y(this,"_deltaTs",wp()),Y(this,"_storage",void 0),Y(this,"userData",{}),Y(this,"LOG_THROTTLE_TIMEOUT",0),this.id=e,this.userData={},this._storage=new U7("__probe-".concat(this.id,"__"),G7),this.timeStamp("".concat(this.id," started")),H7(this),Object.seal(this)}set level(e){this.setLevel(e)}get level(){return this.getLevel()}isEnabled(){return this._storage.config.enabled}getLevel(){return this._storage.config.level}getTotal(){return Number((wp()-this._startTs).toPrecision(10))}getDelta(){return Number((wp()-this._deltaTs).toPrecision(10))}set priority(e){this.level=e}get priority(){return this.level}getPriority(){return this.level}enable(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return this._storage.setConfiguration({enabled:e}),this}setLevel(e){return this._storage.setConfiguration({level:e}),this}get(e){return this._storage.config[e]}set(e,t){this._storage.setConfiguration({[e]:t})}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}assert(e,t){Lb(e,t)}warn(e){return this._getLogFunction(0,e,xp.warn,arguments,Uk)}error(e){return this._getLogFunction(0,e,xp.error,arguments)}deprecated(e,t){return this.warn("`".concat(e,"` is deprecated and will be removed in a later version. Use `").concat(t,"` instead"))}removed(e,t){return this.error("`".concat(e,"` has been removed. Use `").concat(t,"` instead"))}probe(e,t){return this._getLogFunction(e,t,xp.log,arguments,{time:!0,once:!0})}log(e,t){return this._getLogFunction(e,t,xp.debug,arguments)}info(e,t){return this._getLogFunction(e,t,console.info,arguments)}once(e,t){for(var r=arguments.length,i=new Array(r>2?r-2:0),o=2;o2&&arguments[2]!==void 0?arguments[2]:{collapsed:!1};const i=jk({logLevel:e,message:t,opts:r}),{collapsed:o}=r;return i.method=(o?console.groupCollapsed:console.group)||console.info,this._getLogFunction(i)}groupCollapsed(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.group(e,t,Object.assign({},r,{collapsed:!0}))}groupEnd(e){return this._getLogFunction(e,"",console.groupEnd||zs)}withGroup(e,t,r){this.group(e,t)();try{r()}finally{this.groupEnd(e)()}}trace(){console.trace&&console.trace()}_shouldLog(e){return this.isEnabled()&&this.getLevel()>=zk(e)}_getLogFunction(e,t,r,i,o){if(this._shouldLog(e)){o=jk({logLevel:e,message:t,args:i,opts:o}),r=r||o.method,Lb(r),o.total=this.getTotal(),o.delta=this.getDelta(),this._deltaTs=wp();const a=o.tag||o.message;if(o.once)if(!Bk[a])Bk[a]=wp();else return zs;return t=q7(this.id,o.message,o),r.bind(console,t,...o.args)}return zs}}Y(Ry,"VERSION",Nk);function zk(n){if(!n)return 0;let e;switch(typeof n){case"number":e=n;break;case"object":e=n.logLevel||n.priority||0;break;default:return 0}return Lb(Number.isFinite(e)&&e>=0),e}function jk(n){const{logLevel:e,message:t}=n;n.logLevel=zk(e);const r=n.args?Array.from(n.args):[];for(;r.length&&r.shift()!==t;);switch(typeof e){case"string":case"function":t!==void 0&&r.unshift(t),n.message=e;break;case"object":Object.assign(n,e);break}typeof n.message=="function"&&(n.message=n.message());const i=typeof n.message;return Lb(i==="string"||i==="object"),Object.assign(n,{args:r},n.opts)}function q7(n,e,t){if(typeof e=="string"){const r=t.time?j7(z7(t.total)):"";e=t.time?"".concat(n,": ").concat(r," ").concat(e):"".concat(n,": ").concat(e),e=V7(e,t.color,t.background)}return e}function $7(n){return console.warn("removed"),zs}function W7(n){let{image:e,message:t="",scale:r=1}=n;if(typeof e=="string"){const o=new Image;return o.onload=()=>{const a=XT(o,t,r);console.log(...a)},o.src=e,zs}const i=e.nodeName||"";if(i.toLowerCase()==="img")return console.log(...XT(e,t,r)),zs;if(i.toLowerCase()==="canvas"){const o=new Image;return o.onload=()=>console.log(...XT(o,t,r)),o.src=e.toDataURL(),zs}return zs}function Y7(n){for(const e in n)for(const t in n[e])return t||"untitled";return"empty"}const Vk=new Ry({id:"loaders.gl"});class K7{log(){return()=>{}}info(){return()=>{}}warn(){return()=>{}}error(){return()=>{}}}class Z7{constructor(){Y(this,"console",void 0),this.console=console}log(){for(var e=arguments.length,t=new Array(e),r=0;r{const n=Gk();return n.globalOptions=n.globalOptions||{...Hk},n.globalOptions};function Q7(n,e,t,r){return t=t||[],t=Array.isArray(t)?t:[t],J7(n,t),tH(e,n,r)}function J7(n,e){$k(n,null,Hk,X7,e);for(const t of e){const r=n&&n[t.id]||{},i=t.options&&t.options[t.id]||{},o=t.deprecatedOptions&&t.deprecatedOptions[t.id]||{};$k(r,t.id,i,o,e)}}function $k(n,e,t,r,i){const o=e||"Top level",a=e?"".concat(e,"."):"";for(const l in n){const h=!e&&Py(n[l]),p=l==="baseUri"&&!e,g=l==="workerUrl"&&e;if(!(l in t)&&!p&&!g){if(l in r)Vk.warn("".concat(o," loader option '").concat(a).concat(l,"' no longer supported, use '").concat(r[l],"'"))();else if(!h){const _=eH(l,i);Vk.warn("".concat(o," loader option '").concat(a).concat(l,"' not recognized. ").concat(_))()}}}}function eH(n,e){const t=n.toLowerCase();let r="";for(const i of e)for(const o in i.options){if(n===o)return"Did you mean '".concat(i.id,".").concat(o,"'?");const a=o.toLowerCase();(t.startsWith(a)||a.startsWith(t))&&(r=r||"Did you mean '".concat(i.id,".").concat(o,"'?"))}return r}function tH(n,e,t){const i={...n.options||{}};return nH(i,t),i.log===null&&(i.log=new K7),Wk(i,qk()),Wk(i,e),i}function Wk(n,e){for(const t in e)if(t in e){const r=e[t];Ik(r)&&Ik(n[t])?n[t]={...n[t],...e[t]}:n[t]=e[t]}}function nH(n,e){e&&!("baseUri"in n)&&(n.baseUri=e)}function QT(n){var e;return n?(Array.isArray(n)&&(n=n[0]),Array.isArray((e=n)===null||e===void 0?void 0:e.extensions)):!1}function JT(n){var e,t;Ib(n,"null loader"),Ib(QT(n),"invalid loader");let r;return Array.isArray(n)&&(r=n[1],n=n[0],n={...n,options:{...n.options,...r}}),((e=n)!==null&&e!==void 0&&e.parseTextSync||(t=n)!==null&&t!==void 0&&t.parseText)&&(n.text=!0),n.text||(n.binary=!0),n}const Yk=()=>{const n=Gk();return n.loaderRegistry=n.loaderRegistry||[],n.loaderRegistry};function rH(n){const e=Yk();n=Array.isArray(n)?n:[n];for(const t of n){const r=JT(t);e.find(i=>r===i)||e.unshift(r)}}function iH(){return Yk()}const oH=new Ry({id:"loaders.gl"}),aH=/\.([^.]+)$/;async function sH(n){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],t=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;if(!Zk(n))return null;let i=Kk(n,e,{...t,nothrow:!0},r);if(i)return i;if(wd(n)&&(n=await n.slice(0,10).arrayBuffer(),i=Kk(n,e,t,r)),!i&&!(t!=null&&t.nothrow))throw new Error(Xk(n));return i}function Kk(n){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],t=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;if(!Zk(n))return null;if(e&&!Array.isArray(e))return JT(e);let i=[];e&&(i=i.concat(e)),t!=null&&t.ignoreRegisteredLoaders||i.push(...iH()),lH(i);const o=cH(n,i,t,r);if(!o&&!(t!=null&&t.nothrow))throw new Error(Xk(n));return o}function cH(n,e,t,r){const i=Mb(n),o=KT(n),a=YT(i)||(r==null?void 0:r.url);let l=null,h="";if(t!=null&&t.mimeType&&(l=eS(e,t==null?void 0:t.mimeType),h="match forced by supplied MIME type ".concat(t==null?void 0:t.mimeType)),l=l||uH(e,a),h=h||(l?"matched url ".concat(a):""),l=l||eS(e,o),h=h||(l?"matched MIME type ".concat(o):""),l=l||dH(e,n),h=h||(l?"matched initial data ".concat(Jk(n)):""),l=l||eS(e,t==null?void 0:t.fallbackMimeType),h=h||(l?"matched fallback MIME type ".concat(o):""),h){var p;oH.log(1,"selectLoader selected ".concat((p=l)===null||p===void 0?void 0:p.name,": ").concat(h,"."))}return l}function Zk(n){return!(n instanceof Response&&n.status===204)}function Xk(n){const e=Mb(n),t=KT(n);let r="No valid loader found (";r+=e?"".concat(Ak(e),", "):"no url provided, ",r+="MIME type: ".concat(t?'"'.concat(t,'"'):"not provided",", ");const i=n?Jk(n):"";return r+=i?' first bytes: "'.concat(i,'"'):"first bytes: not available",r+=")",r}function lH(n){for(const e of n)JT(e)}function uH(n,e){const t=e&&aH.exec(e),r=t&&t[1];return r?hH(n,r):null}function hH(n,e){e=e.toLowerCase();for(const t of n)for(const r of t.extensions)if(r.toLowerCase()===e)return t;return null}function eS(n,e){for(const t of n)if(t.mimeTypes&&t.mimeTypes.includes(e)||e==="application/x.".concat(t.id))return t;return null}function dH(n,e){if(!e)return null;for(const t of n)if(typeof e=="string"){if(fH(e,t))return t}else if(ArrayBuffer.isView(e)){if(Qk(e.buffer,e.byteOffset,t))return t}else if(e instanceof ArrayBuffer&&Qk(e,0,t))return t;return null}function fH(n,e){return e.testText?e.testText(n):(Array.isArray(e.tests)?e.tests:[e.tests]).some(r=>n.startsWith(r))}function Qk(n,e,t){return(Array.isArray(t.tests)?t.tests:[t.tests]).some(i=>pH(n,e,t,i))}function pH(n,e,t,r){if(r instanceof ArrayBuffer)return m7(r,n,r.byteLength);switch(typeof r){case"function":return r(n,t);case"string":const i=tS(n,e,r.length);return r===i;default:return!1}}function Jk(n){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:5;return typeof n=="string"?n.slice(0,e):ArrayBuffer.isView(n)?tS(n.buffer,n.byteOffset,e):n instanceof ArrayBuffer?tS(n,0,e):""}function tS(n,e,t){if(n.byteLength1&&arguments[1]!==void 0?arguments[1]:{};return function*(){const{chunkSize:t=yH}=e;let r=0;for(;rOk(i,r):e!=null&&e.fetch?e==null?void 0:e.fetch:Ok}function CH(n,e,t){if(t)return t;const r={fetch:nO(e,n),...n};if(r.url){const i=YT(r.url);r.baseUrl=i,r.queryString=k7(r.url),r.filename=Ak(i),r.baseUrl=x7(i)}return Array.isArray(r.loaders)||(r.loaders=null),r}function AH(n,e){if(!e&&n&&!Array.isArray(n))return n;let t;if(n&&(t=Array.isArray(n)?n:[n]),e&&e.loaders){const r=Array.isArray(e.loaders)?e.loaders:[e.loaders];t=t?[...t,...r]:r}return t&&t.length?t:null}async function nS(n,e,t,r){Ll(!r||typeof r=="object"),e&&!Array.isArray(e)&&!QT(e)&&(r=void 0,t=e,e=void 0),n=await n,t=t||{};const i=Mb(n),a=AH(e,r),l=await sH(n,a,t);return l?(t=Q7(t,l,a,i),r=CH({url:i,parse:nS,loaders:a},t,r||null),await IH(l,n,t,r)):null}async function IH(n,e,t,r){if(h7(n),bd(e)){const i=e,{ok:o,redirected:a,status:l,statusText:h,type:p,url:g}=i,_=Object.fromEntries(i.headers.entries());r.response={headers:_,ok:o,redirected:a,status:l,statusText:h,type:p,url:g}}if(e=await SH(e,n,t),n.parseTextSync&&typeof e=="string")return t.dataType="text",n.parseTextSync(e,t,r,n);if(f7(n,t))return await p7(n,e,t,r,nS);if(n.parseText&&typeof e=="string")return await n.parseText(e,t,r,n);if(n.parse)return await n.parse(e,t,r,n);throw Ll(!n.parseSync),new Error("".concat(n.id," loader - no parser found and worker is disabled"))}async function Nb(n,e,t,r){!Array.isArray(e)&&!QT(e)&&(t=e,e=void 0);const i=nO(t);let o=n;return typeof n=="string"&&(o=await i(n)),wd(n)&&(o=await i(n)),await nS(o,e,t)}const PH="3.4.15",{_parseImageNode:MH}=globalThis,rS=typeof Image<"u",iS=typeof ImageBitmap<"u",oS=VT?!0:!!MH;function RH(n){switch(n){case"auto":return iS||rS||oS;case"imagebitmap":return iS;case"image":return rS;case"data":return oS;default:throw new Error("@loaders.gl/images: image ".concat(n," not supported in this environment"))}}function kH(){if(iS)return"imagebitmap";if(rS)return"image";if(oS)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}function OH(n){const e=NH(n);if(!e)throw new Error("Not an image");return e}function LH(n){switch(OH(n)){case"data":return n;case"image":case"imagebitmap":const e=document.createElement("canvas"),t=e.getContext("2d");if(!t)throw new Error("getImageData");return e.width=n.width,e.height=n.height,t.drawImage(n,0,0),t.getImageData(0,0,n.width,n.height);default:throw new Error("getImageData")}}function NH(n){return typeof ImageBitmap<"u"&&n instanceof ImageBitmap?"imagebitmap":typeof Image<"u"&&n instanceof Image?"image":n&&typeof n=="object"&&n.data&&n.width&&n.height?"data":null}const DH=/^data:image\/svg\+xml/,FH=/\.svg((\?|#).*)?$/;function aS(n){return n&&(DH.test(n)||FH.test(n))}function BH(n,e){if(aS(e)){let r=new TextDecoder().decode(n);try{typeof unescape=="function"&&typeof encodeURIComponent=="function"&&(r=unescape(encodeURIComponent(r)))}catch(o){throw new Error(o.message)}return"data:image/svg+xml;base64,".concat(btoa(r))}return rO(n,e)}function rO(n,e){if(aS(e))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(n)])}async function iO(n,e,t){const r=BH(n,t),i=self.URL||self.webkitURL,o=typeof r!="string"&&i.createObjectURL(r);try{return await UH(o||r,e)}finally{o&&i.revokeObjectURL(o)}}async function UH(n,e){const t=new Image;return t.src=n,e.image&&e.image.decode&&t.decode?(await t.decode(),t):await new Promise((r,i)=>{try{t.onload=()=>r(t),t.onerror=o=>i(new Error("Could not load image ".concat(n,": ").concat(o)))}catch(o){i(o)}})}const zH={};let oO=!0;async function jH(n,e,t){let r;aS(t)?r=await iO(n,e,t):r=rO(n,t);const i=e&&e.imagebitmap;return await VH(r,i)}async function VH(n){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if((HH(e)||!oO)&&(e=null),e)try{return await createImageBitmap(n,e)}catch(t){console.warn(t),oO=!1}return await createImageBitmap(n)}function HH(n){for(const e in n||zH)return!1;return!0}function GH(n){return!YH(n,"ftyp",4)||!(n[8]&96)?null:qH(n)}function qH(n){switch($H(n,8,12).replace("\0"," ").trim()){case"avif":case"avis":return{extension:"avif",mimeType:"image/avif"};default:return null}}function $H(n,e,t){return String.fromCharCode(...n.slice(e,t))}function WH(n){return[...n].map(e=>e.charCodeAt(0))}function YH(n,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;const r=WH(e);for(let i=0;i=24&&e.getUint32(0,Fc)===2303741511?{mimeType:"image/png",width:e.getUint32(16,Fc),height:e.getUint32(20,Fc)}:null}function XH(n){const e=Oy(n);return e.byteLength>=10&&e.getUint32(0,Fc)===1195984440?{mimeType:"image/gif",width:e.getUint16(6,ky),height:e.getUint16(8,ky)}:null}function QH(n){const e=Oy(n);return e.byteLength>=14&&e.getUint16(0,Fc)===16973&&e.getUint32(2,ky)===e.byteLength?{mimeType:"image/bmp",width:e.getUint32(18,ky),height:e.getUint32(22,ky)}:null}function JH(n){const e=Oy(n);if(!(e.byteLength>=3&&e.getUint16(0,Fc)===65496&&e.getUint8(2)===255))return null;const{tableMarkers:r,sofMarkers:i}=eG();let o=2;for(;o+9!!aO(new DataView(n))],options:{image:{type:"auto",decode:!0}}},Ir=new Ry({id:"deck"}),zu={attributeUpdateStart:-1,attributeManagerUpdateStart:-1,attributeUpdateMessages:[]},sS=1,Ly=2,cS=3,lS=4,oG=2,aG=n=>({"layer.changeFlag":(e,t,r)=>{n.log(cS,"".concat(e.id," ").concat(t,": "),r[t])()},"layer.initialize":e=>{n.log(sS,"Initializing ".concat(e))()},"layer.update":(e,t)=>{if(t){const r=e.getChangeFlags();n.log(Ly,"Updating ".concat(e," because: ").concat(Object.keys(r).filter(i=>r[i]).join(", ")))()}else n.log(lS,"".concat(e," does not need update"))()},"layer.matched":(e,t)=>{t&&n.log(lS,"Matched ".concat(e,", state transfered"))()},"layer.finalize":e=>{n.log(sS,"Finalizing ".concat(e))()},"compositeLayer.renderLayers":(e,t,r)=>{t?n.log(Ly,"Composite layer rendered new subLayers ".concat(e),r)():n.log(lS,"Composite layer reused subLayers ".concat(e),r)()},"layerManager.setLayers":(e,t,r)=>{t&&n.log(Ly,"Updating ".concat(r.length," deck layers"))()},"layerManager.activateViewport":(e,t)=>{n.log(cS,"Viewport changed",t)()},"attributeManager.invalidate":(e,t,r)=>{n.log(sS,r?"invalidated attributes ".concat(r," (").concat(t,") for ").concat(e.id):"invalidated all attributes for ".concat(e.id))()},"attributeManager.updateStart":e=>{zu.attributeUpdateMessages.length=0,zu.attributeManagerUpdateStart=Date.now()},"attributeManager.updateEnd":(e,t)=>{const r=Math.round(Date.now()-zu.attributeManagerUpdateStart);n.groupCollapsed(Ly,"Updated attributes for ".concat(t," instances in ").concat(e.id," in ").concat(r,"ms"))();for(const i of zu.attributeUpdateMessages)n.log(cS,i)();n.groupEnd(Ly)()},"attribute.updateStart":e=>{zu.attributeUpdateStart=Date.now()},"attribute.allocate":(e,t)=>{const r="".concat(e.id," allocated ").concat(t);zu.attributeUpdateMessages.push(r)},"attribute.updateEnd":(e,t)=>{const r=Math.round(Date.now()-zu.attributeUpdateStart),i="".concat(e.id," updated ").concat(t," in ").concat(r,"ms");zu.attributeUpdateMessages.push(i)},"deckRenderer.renderLayers":(e,t,r)=>{const{pass:i,redrawReason:o,stats:a}=r;for(const l of t){const{totalCount:h,visibleCount:p,compositeCount:g,pickableCount:_}=l,C=h-g-p;n.log(oG,"RENDER #".concat(e.renderCount," ").concat(p," (of ").concat(h," layers) to ").concat(i," because ").concat(o," (").concat(C," hidden, ").concat(g," composite ").concat(_," pickable)"))(),a&&a.get("Redraw Layers").add(p)}}});let Db={};process.env.NODE_ENV!=="production"&&(Db=aG(Ir));function sG(n){Db=n}function oa(n,e,t,r){Ir.level>0&&Db[n]&&Db[n].call(null,e,t,r)}function cG(n){const e=n[0],t=n[n.length-1];return e==="{"&&t==="}"||e==="["&&t==="]"}const lG={id:"JSON",name:"JSON",module:"",version:"",options:{},extensions:["json","geojson"],mimeTypes:["application/json","application/geo+json"],testText:cG,parseTextSync:JSON.parse};function uG(){const n="8.9.36",e=globalThis.deck&&globalThis.deck.VERSION;if(e&&e!==n)throw new Error("deck.gl - multiple versions detected: ".concat(e," vs ").concat(n));return e||(Ir.log(1,"deck.gl ".concat(n))(),globalThis.deck={...globalThis.deck,VERSION:n,version:n,log:Ir,_registerLoggers:sG},rH([lG,[iG,{imagebitmap:{premultiplyAlpha:"none"}}]])),n}const hG=uG(),Zr={DEFAULT:-1,LNGLAT:1,METER_OFFSETS:2,LNGLAT_OFFSETS:3,CARTESIAN:0};Object.defineProperty(Zr,"IDENTITY",{get:()=>(Ir.deprecated("COORDINATE_SYSTEM.IDENTITY","COORDINATE_SYSTEM.CARTESIAN")(),0)});const Bc={WEB_MERCATOR:1,GLOBE:2,WEB_MERCATOR_AUTO_OFFSET:4,IDENTITY:0},Ep={common:0,meters:1,pixels:2},sO={click:{handler:"onClick"},panstart:{handler:"onDragStart"},panmove:{handler:"onDrag"},panend:{handler:"onDragEnd"}},Tn=new Ry({id:"luma.gl"});function va(n,e){if(!n)throw new Error(e||"luma.gl: assertion failed.")}const dG="Invalid WebGLRenderingContext",fG="Requires WebGL2";function Fb(n){return typeof WebGLRenderingContext<"u"&&n instanceof WebGLRenderingContext||typeof WebGL2RenderingContext<"u"&&n instanceof WebGL2RenderingContext?!0:!!(n&&Number.isFinite(n._version))}function yr(n){return typeof WebGL2RenderingContext<"u"&&n instanceof WebGL2RenderingContext?!0:!!(n&&n._version===2)}function pG(n){return yr(n)?n:null}function Bb(n){return va(Fb(n),dG),n}function aa(n){return va(yr(n),fG),n}const Ny={};function gG(n){globalThis.console&&globalThis.console.error&&globalThis.console.error(n)}function mG(n){globalThis.console&&globalThis.console.log&&globalThis.console.log(n)}function yG(n,e){Ny[n]=!0,e!==void 0&&gG(e)}function _G(n){const e=n.getError;n.getError=function(){let r;do r=e.apply(n),r!==0&&(Ny[r]=!0);while(r!==0);for(r in Ny)if(Ny[r])return delete Ny[r],parseInt(r,10);return 0}}const Dy=function n(e){const t=e.gl;this.ext=e,this.isAlive=!0,this.hasBeenBound=!1,this.elementArrayBuffer=null,this.attribs=new Array(e.maxVertexAttribs);for(let r=0;r{mG("OESVertexArrayObject emulation library context restored"),t.reset_()},!0),this.reset_()};xd.prototype.VERTEX_ARRAY_BINDING_OES=34229,xd.prototype.reset_=function(){if(this.vertexArrayObjects!==void 0)for(let r=0;ryr(n)?void 0:0,PG={3074:n=>yr(n)?void 0:36064,[EG]:n=>yr(n)?void 0:TG,35977:di,32937:di,[SG]:(n,e)=>{const t=yr(n)?n.getExtension(wG):n.getExtension(bG);return t&&t.GPU_DISJOINT_EXT?e(t.GPU_DISJOINT_EXT):0},[AG]:(n,e)=>{const t=n.getExtension(uO);return e(t&&t.UNMASKED_VENDOR_WEBGL||7936)},[IG]:(n,e)=>{const t=n.getExtension(uO);return e(t&&t.UNMASKED_RENDERER_WEBGL||7937)},[CG]:(n,e)=>{const t=n.luma.extensions[xG];return t?e(t.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1},32883:di,35071:di,37447:di,36063:(n,e)=>{if(!yr(n)){const t=n.getExtension(lO);return t?e(t.MAX_COLOR_ATTACHMENTS_WEBGL):0}},35379:di,35374:di,35377:di,34852:n=>{if(!yr(n)){const e=n.getExtension(lO);return e?e.MAX_DRAW_BUFFERS_WEBGL:0}},36203:n=>n.getExtension(cO)?2147483647:65535,33001:n=>n.getExtension(cO)?16777216:65535,33e3:n=>16777216,37157:di,35373:di,35657:di,36183:di,37137:di,34045:di,35978:di,35979:di,35968:di,35376:di,35375:di,35659:di,37154:di,35371:di,35658:di,35076:di,35077:di,35380:di};function MG(n,e,t){const r=PG[t],i=typeof r=="function"?r(n,e,t):r;return i!==void 0?i:e(t)}const RG="OES_vertex_array_object",hO="ANGLE_instanced_arrays",kG="WEBGL_draw_buffers",OG="EXT_disjoint_timer_query",LG="EXT_texture_filter_anisotropic",NG="VertexArray requires WebGL2 or OES_vertex_array_object extension";function DG(n,e){return{webgl2:yr(n),ext:n.getExtension(e)}}const dO={[RG]:{meta:{suffix:"OES"},createVertexArray:()=>{va(!1,NG)},deleteVertexArray:()=>{},bindVertexArray:()=>{},isVertexArray:()=>!1},[hO]:{meta:{suffix:"ANGLE"},vertexAttribDivisor(n,e){va(e===0,"WebGL instanced rendering not supported")},drawElementsInstanced:()=>{},drawArraysInstanced:()=>{}},[kG]:{meta:{suffix:"WEBGL"},drawBuffers:()=>{va(!1)}},[OG]:{meta:{suffix:"EXT"},createQuery:()=>{va(!1)},deleteQuery:()=>{va(!1)},beginQuery:()=>{va(!1)},endQuery:()=>{},getQuery(n,e){return this.getQueryObject(n,e)},getQueryParameter(n,e){return this.getQueryObject(n,e)},getQueryObject:()=>{}}},uS={readBuffer:(n,e,t)=>{yr(n)&&e(t)},getVertexAttrib:(n,e,t,r)=>{const{webgl2:i,ext:o}=DG(n,hO);let a;switch(r){case 35069:a=i?void 0:!1;break;case 35070:a=!i&&!o?0:void 0;break}return a!==void 0?a:e(t,r)},getProgramParameter:(n,e,t,r)=>{if(!yr(n))switch(r){case 35967:return 35981;case 35971:return 0;case 35382:return 0}return e(t,r)},getInternalformatParameter:(n,e,t,r,i)=>{if(!yr(n))switch(i){case 32937:return new Int32Array([0])}return n.getInternalformatParameter(t,r,i)},getTexParameter(n,e,t,r){switch(r){case 34046:const{extensions:i}=n.luma,o=i[LG];r=o&&o.TEXTURE_MAX_ANISOTROPY_EXT||34046;break}return e(t,r)},getParameter:MG,hint(n,e,t,r){return e(t,r)}};function FG(n){n.luma=n.luma||{};const{luma:e}=n;return e.polyfilled||(vG(n),BG(n),zG(n,dO),UG(n,{target:e,target2:n}),e.polyfilled=!0),n}globalThis.polyfillContext=FG;function BG(n){n.luma.extensions={};const e=n.getSupportedExtensions()||[];for(const t of e)n.luma[t]=n.getExtension(t)}function UG(n,e){let{target:t,target2:r}=e;Object.keys(uS).forEach(i=>{if(typeof uS[i]=="function"){const o=n[i]?n[i].bind(n):()=>{},a=uS[i].bind(null,n,o);t[i]=a,r[i]=a}})}function zG(n,e){for(const t of Object.getOwnPropertyNames(e))t!=="overrides"&&jG(n,{extension:t,target:n.luma,target2:n})}function jG(n,e){let{extension:t,target:r,target2:i}=e;const o=dO[t];va(o);const{meta:a={}}=o,{suffix:l=""}=a,h=n.getExtension(t);for(const p of Object.keys(o)){const g="".concat(p).concat(l);let _=null;p==="meta"||typeof n[p]=="function"||(h&&typeof h[g]=="function"?_=function(){return h[g](...arguments)}:typeof o[p]=="function"&&(_=o[p].bind(r))),_&&(r[p]=_,i[p]=_)}}const hS={3042:!1,32773:new Float32Array([0,0,0,0]),32777:32774,34877:32774,32969:1,32968:0,32971:1,32970:0,3106:new Float32Array([0,0,0,0]),3107:[!0,!0,!0,!0],2884:!1,2885:1029,2929:!1,2931:1,2932:513,2928:new Float32Array([0,1]),2930:!0,3024:!0,36006:null,2886:2305,33170:4352,2849:1,32823:!1,32824:0,10752:0,32938:1,32939:!1,3089:!1,3088:new Int32Array([0,0,1024,1024]),2960:!1,2961:0,2968:4294967295,36005:4294967295,2962:519,2967:0,2963:4294967295,34816:519,36003:0,36004:4294967295,2964:7680,2965:7680,2966:7680,34817:7680,34818:7680,34819:7680,2978:[0,0,1024,1024],3333:4,3317:4,37440:!1,37441:!1,37443:37444,35723:4352,36010:null,35977:!1,3330:0,3332:0,3331:0,3314:0,32878:0,3316:0,3315:0,32877:0},ju=(n,e,t)=>e?n.enable(t):n.disable(t),fO=(n,e,t)=>n.hint(t,e),hs=(n,e,t)=>n.pixelStorei(t,e),VG=(n,e)=>{const t=yr(n)?36009:36160;return n.bindFramebuffer(t,e)},HG=(n,e)=>n.bindFramebuffer(36008,e);function Fy(n){return Array.isArray(n)||ArrayBuffer.isView(n)}const GG={3042:ju,32773:(n,e)=>n.blendColor(...e),32777:"blendEquation",34877:"blendEquation",32969:"blendFunc",32968:"blendFunc",32971:"blendFunc",32970:"blendFunc",3106:(n,e)=>n.clearColor(...e),3107:(n,e)=>n.colorMask(...e),2884:ju,2885:(n,e)=>n.cullFace(e),2929:ju,2931:(n,e)=>n.clearDepth(e),2932:(n,e)=>n.depthFunc(e),2928:(n,e)=>n.depthRange(...e),2930:(n,e)=>n.depthMask(e),3024:ju,35723:fO,36006:VG,2886:(n,e)=>n.frontFace(e),33170:fO,2849:(n,e)=>n.lineWidth(e),32823:ju,32824:"polygonOffset",10752:"polygonOffset",35977:ju,32938:"sampleCoverage",32939:"sampleCoverage",3089:ju,3088:(n,e)=>n.scissor(...e),2960:ju,2961:(n,e)=>n.clearStencil(e),2968:(n,e)=>n.stencilMaskSeparate(1028,e),36005:(n,e)=>n.stencilMaskSeparate(1029,e),2962:"stencilFuncFront",2967:"stencilFuncFront",2963:"stencilFuncFront",34816:"stencilFuncBack",36003:"stencilFuncBack",36004:"stencilFuncBack",2964:"stencilOpFront",2965:"stencilOpFront",2966:"stencilOpFront",34817:"stencilOpBack",34818:"stencilOpBack",34819:"stencilOpBack",2978:(n,e)=>n.viewport(...e),3333:hs,3317:hs,37440:hs,37441:hs,37443:hs,3330:hs,3332:hs,3331:hs,36010:HG,3314:hs,32878:hs,3316:hs,3315:hs,32877:hs,framebuffer:(n,e)=>{const t=e&&"handle"in e?e.handle:e;return n.bindFramebuffer(36160,t)},blend:(n,e)=>e?n.enable(3042):n.disable(3042),blendColor:(n,e)=>n.blendColor(...e),blendEquation:(n,e)=>{e=Fy(e)?e:[e,e],n.blendEquationSeparate(...e)},blendFunc:(n,e)=>{e=Fy(e)&&e.length===2?[...e,...e]:e,n.blendFuncSeparate(...e)},clearColor:(n,e)=>n.clearColor(...e),clearDepth:(n,e)=>n.clearDepth(e),clearStencil:(n,e)=>n.clearStencil(e),colorMask:(n,e)=>n.colorMask(...e),cull:(n,e)=>e?n.enable(2884):n.disable(2884),cullFace:(n,e)=>n.cullFace(e),depthTest:(n,e)=>e?n.enable(2929):n.disable(2929),depthFunc:(n,e)=>n.depthFunc(e),depthMask:(n,e)=>n.depthMask(e),depthRange:(n,e)=>n.depthRange(...e),dither:(n,e)=>e?n.enable(3024):n.disable(3024),derivativeHint:(n,e)=>{n.hint(35723,e)},frontFace:(n,e)=>n.frontFace(e),mipmapHint:(n,e)=>n.hint(33170,e),lineWidth:(n,e)=>n.lineWidth(e),polygonOffsetFill:(n,e)=>e?n.enable(32823):n.disable(32823),polygonOffset:(n,e)=>n.polygonOffset(...e),sampleCoverage:(n,e)=>n.sampleCoverage(...e),scissorTest:(n,e)=>e?n.enable(3089):n.disable(3089),scissor:(n,e)=>n.scissor(...e),stencilTest:(n,e)=>e?n.enable(2960):n.disable(2960),stencilMask:(n,e)=>{e=Fy(e)?e:[e,e];const[t,r]=e;n.stencilMaskSeparate(1028,t),n.stencilMaskSeparate(1029,r)},stencilFunc:(n,e)=>{e=Fy(e)&&e.length===3?[...e,...e]:e;const[t,r,i,o,a,l]=e;n.stencilFuncSeparate(1028,t,r,i),n.stencilFuncSeparate(1029,o,a,l)},stencilOp:(n,e)=>{e=Fy(e)&&e.length===3?[...e,...e]:e;const[t,r,i,o,a,l]=e;n.stencilOpSeparate(1028,t,r,i),n.stencilOpSeparate(1029,o,a,l)},viewport:(n,e)=>n.viewport(...e)};function ji(n,e,t){return e[n]!==void 0?e[n]:t[n]}const qG={blendEquation:(n,e,t)=>n.blendEquationSeparate(ji(32777,e,t),ji(34877,e,t)),blendFunc:(n,e,t)=>n.blendFuncSeparate(ji(32969,e,t),ji(32968,e,t),ji(32971,e,t),ji(32970,e,t)),polygonOffset:(n,e,t)=>n.polygonOffset(ji(32824,e,t),ji(10752,e,t)),sampleCoverage:(n,e,t)=>n.sampleCoverage(ji(32938,e,t),ji(32939,e,t)),stencilFuncFront:(n,e,t)=>n.stencilFuncSeparate(1028,ji(2962,e,t),ji(2967,e,t),ji(2963,e,t)),stencilFuncBack:(n,e,t)=>n.stencilFuncSeparate(1029,ji(34816,e,t),ji(36003,e,t),ji(36004,e,t)),stencilOpFront:(n,e,t)=>n.stencilOpSeparate(1028,ji(2964,e,t),ji(2965,e,t),ji(2966,e,t)),stencilOpBack:(n,e,t)=>n.stencilOpSeparate(1029,ji(34817,e,t),ji(34818,e,t),ji(34819,e,t))},pO={enable:(n,e)=>n({[e]:!0}),disable:(n,e)=>n({[e]:!1}),pixelStorei:(n,e,t)=>n({[e]:t}),hint:(n,e,t)=>n({[e]:t}),bindFramebuffer:(n,e,t)=>{switch(e){case 36160:return n({36006:t,36010:t});case 36009:return n({36006:t});case 36008:return n({36010:t});default:return null}},blendColor:(n,e,t,r,i)=>n({32773:new Float32Array([e,t,r,i])}),blendEquation:(n,e)=>n({32777:e,34877:e}),blendEquationSeparate:(n,e,t)=>n({32777:e,34877:t}),blendFunc:(n,e,t)=>n({32969:e,32968:t,32971:e,32970:t}),blendFuncSeparate:(n,e,t,r,i)=>n({32969:e,32968:t,32971:r,32970:i}),clearColor:(n,e,t,r,i)=>n({3106:new Float32Array([e,t,r,i])}),clearDepth:(n,e)=>n({2931:e}),clearStencil:(n,e)=>n({2961:e}),colorMask:(n,e,t,r,i)=>n({3107:[e,t,r,i]}),cullFace:(n,e)=>n({2885:e}),depthFunc:(n,e)=>n({2932:e}),depthRange:(n,e,t)=>n({2928:new Float32Array([e,t])}),depthMask:(n,e)=>n({2930:e}),frontFace:(n,e)=>n({2886:e}),lineWidth:(n,e)=>n({2849:e}),polygonOffset:(n,e,t)=>n({32824:e,10752:t}),sampleCoverage:(n,e,t)=>n({32938:e,32939:t}),scissor:(n,e,t,r,i)=>n({3088:new Int32Array([e,t,r,i])}),stencilMask:(n,e)=>n({2968:e,36005:e}),stencilMaskSeparate:(n,e,t)=>n({[e===1028?2968:36005]:t}),stencilFunc:(n,e,t,r)=>n({2962:e,2967:t,2963:r,34816:e,36003:t,36004:r}),stencilFuncSeparate:(n,e,t,r,i)=>n({[e===1028?2962:34816]:t,[e===1028?2967:36003]:r,[e===1028?2963:36004]:i}),stencilOp:(n,e,t,r)=>n({2964:e,2965:t,2966:r,34817:e,34818:t,34819:r}),stencilOpSeparate:(n,e,t,r,i)=>n({[e===1028?2964:34817]:t,[e===1028?2965:34818]:r,[e===1028?2966:34819]:i}),viewport:(n,e,t,r,i)=>n({2978:[e,t,r,i]})},Uc=(n,e)=>n.isEnabled(e),gO={3042:Uc,2884:Uc,2929:Uc,3024:Uc,32823:Uc,32926:Uc,32928:Uc,3089:Uc,2960:Uc,35977:Uc};function mO(n){for(const e in n)return!1;return!0}function $G(n,e){if(n===e)return!0;const t=Array.isArray(n)||ArrayBuffer.isView(n),r=Array.isArray(e)||ArrayBuffer.isView(e);if(t&&r&&n.length===e.length){for(let i=0;i{}}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.gl=e,this.program=null,this.stateStack=[],this.enable=!0,this.cache=t?XG(e):Object.assign({},hS),this.log=r,this._updateCache=this._updateCache.bind(this),Object.seal(this)}push(){this.stateStack.push({})}pop(){va(this.stateStack.length>0);const e=this.stateStack[this.stateStack.length-1];Fl(this.gl,e),this.stateStack.pop()}_updateCache(e){let t=!1,r;const i=this.stateStack.length>0&&this.stateStack[this.stateStack.length-1];for(const o in e){va(o!==void 0);const a=e[o],l=this.cache[o];$G(a,l)||(t=!0,r=l,i&&!(o in i)&&(i[o]=l),this.cache[o]=a)}return{valueChanged:t,oldValue:r}}}function _O(n){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{enable:t=!0,copyState:r}=e;if(va(r!==void 0),!n.state){const{polyfillContext:i}=globalThis;i&&i(n),n.state=new KG(n,{copyState:r}),YG(n);for(const o in pO){const a=pO[o];WG(n,o,a)}yO(n,"getParameter"),yO(n,"isEnabled")}return n.state.enable=t,n}function ZG(n){n.state||_O(n,{copyState:!1}),n.state.push()}function vO(n){va(n.state),n.state.pop()}function Fl(n,e){if(va(Fb(n),"setParameters requires a WebGL context"),mO(e))return;const t={};for(const i in e){const o=Number(i),a=GG[i];a&&(typeof a=="string"?t[a]=!0:a(n,e[i],o))}const r=n.state&&n.state.cache;if(r)for(const i in t){const o=qG[i];o(n,e,r)}}function XG(n,e){if(e=e||hS,typeof e=="number"){const i=e,o=gO[i];return o?o(n,i):n.getParameter(i)}const t=Array.isArray(e)?e:Object.keys(e),r={};for(const i of t){const o=gO[i];r[i]=o?o(n,Number(i)):n.getParameter(Number(i))}return r}function QG(n){Fl(n,hS)}function fc(n,e,t){if(mO(e))return t(n);const{nocatch:r=!0}=e;ZG(n),Fl(n,e);let i;if(r)i=t(n),vO(n);else try{i=t(n)}finally{vO(n)}return i}function Tp(n){const{luma:e}=n;if(n.canvas&&e){const t=e.canvasSizeInfo,r="clientWidth"in t?t.clientWidth:n.canvas.clientWidth;return r?n.drawingBufferWidth/r:1}return 1}function dS(n,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;const r=Tp(n),i=n.drawingBufferWidth,o=n.drawingBufferHeight;return eq(e,r,i,o,t)}function JG(n){const e=typeof window>"u"?1:window.devicePixelRatio||1;return Number.isFinite(n)?n<=0?1:n:n?e:1}function eq(n,e,t,r,i){const o=bO(n[0],e,t);let a=wO(n[1],e,r,i),l=bO(n[0]+1,e,t);const h=l===t-1?l:l-1;l=wO(n[1]+1,e,r,i);let p;return i?(l=l===0?l:l+1,p=a,a=l):p=l===r-1?l:l-1,{x:o,y:a,width:Math.max(h-o+1,1),height:Math.max(p-a+1,1)}}function bO(n,e,t){return Math.min(Math.round(n*e),t-1)}function wO(n,e,t,r){return r?Math.max(0,t-1-Math.round(n*e)):Math.min(Math.round(n*e),t-1)}const fS=Dl(),tq=fS&&typeof document<"u",xO={webgl2:!0,webgl1:!0,throwOnError:!0,manageState:!0,canvas:null,debug:!1,width:800,height:600};function EO(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};va(fS,`createGLContext only available in the browser. +}`)}function wk(n){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,t=arguments.length>2?arguments[2]:void 0;const r=t||new Set;if(n){if(xk(n))r.add(n);else if(xk(n.buffer))r.add(n.buffer);else if(!ArrayBuffer.isView(n)){if(e&&typeof n=="object")for(const i in n)wk(n[i],e,r)}}return t===void 0?Array.from(r):[]}function xk(n){return n?n instanceof ArrayBuffer||typeof MessagePort<"u"&&n instanceof MessagePort||typeof ImageBitmap<"u"&&n instanceof ImageBitmap||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas:!1}const qT=()=>{};class $T{static isSupported(){return typeof Worker<"u"&&Pb||typeof HT<"u"&&!Pb}constructor(e){Y(this,"name",void 0),Y(this,"source",void 0),Y(this,"url",void 0),Y(this,"terminated",!1),Y(this,"worker",void 0),Y(this,"onMessage",void 0),Y(this,"onError",void 0),Y(this,"_loadableURL","");const{name:t,source:r,url:i}=e;Ll(r||i),this.name=t,this.source=r,this.url=i,this.onMessage=qT,this.onError=o=>console.log(o),this.worker=Pb?this._createBrowserWorker():this._createNodeWorker()}destroy(){this.onMessage=qT,this.onError=qT,this.worker.terminate(),this.terminated=!0}get isRunning(){return!!this.onMessage}postMessage(e,t){t=t||wk(e),this.worker.postMessage(e,t)}_getErrorFromErrorEvent(e){let t="Failed to load ";return t+="worker ".concat(this.name," from ").concat(this.url,". "),e.message&&(t+="".concat(e.message," in ")),e.lineno&&(t+=":".concat(e.lineno,":").concat(e.colno)),new Error(t)}_createBrowserWorker(){this._loadableURL=i7({source:this.source,url:this.url});const e=new Worker(this._loadableURL,{name:this.name});return e.onmessage=t=>{t.data?this.onMessage(t.data):this.onError(new Error("No data received"))},e.onerror=t=>{this.onError(this._getErrorFromErrorEvent(t)),this.terminated=!0},e.onmessageerror=t=>console.error(t),e}_createNodeWorker(){let e;if(this.url){const r=this.url.includes(":/")||this.url.startsWith("/")?this.url:"./".concat(this.url);e=new HT(r,{eval:!1})}else if(this.source)e=new HT(this.source,{eval:!0});else throw new Error("no worker");return e.on("message",t=>{this.onMessage(t)}),e.on("error",t=>{this.onError(t)}),e.on("exit",t=>{}),e}}class s7{static isSupported(){return $T.isSupported()}constructor(e){Y(this,"name","unnamed"),Y(this,"source",void 0),Y(this,"url",void 0),Y(this,"maxConcurrency",1),Y(this,"maxMobileConcurrency",1),Y(this,"onDebug",()=>{}),Y(this,"reuseWorkers",!0),Y(this,"props",{}),Y(this,"jobQueue",[]),Y(this,"idleQueue",[]),Y(this,"count",0),Y(this,"isDestroyed",!1),this.source=e.source,this.url=e.url,this.setProps(e)}destroy(){this.idleQueue.forEach(e=>e.destroy()),this.isDestroyed=!0}setProps(e){this.props={...this.props,...e},e.name!==void 0&&(this.name=e.name),e.maxConcurrency!==void 0&&(this.maxConcurrency=e.maxConcurrency),e.maxMobileConcurrency!==void 0&&(this.maxMobileConcurrency=e.maxMobileConcurrency),e.reuseWorkers!==void 0&&(this.reuseWorkers=e.reuseWorkers),e.onDebug!==void 0&&(this.onDebug=e.onDebug)}async startJob(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:(o,a,l)=>o.done(l),r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:(o,a)=>o.error(a);const i=new Promise(o=>(this.jobQueue.push({name:e,onMessage:t,onError:r,onStart:o}),this));return this._startQueuedJob(),await i}async _startQueuedJob(){if(!this.jobQueue.length)return;const e=this._getAvailableWorker();if(!e)return;const t=this.jobQueue.shift();if(t){this.onDebug({message:"Starting job",name:t.name,workerThread:e,backlog:this.jobQueue.length});const r=new r7(t.name,e);e.onMessage=i=>t.onMessage(r,i.type,i.payload),e.onError=i=>t.onError(r,i),t.onStart(r);try{await r.result}finally{this.returnWorkerToQueue(e)}}}returnWorkerToQueue(e){this.isDestroyed||!this.reuseWorkers||this.count>this._getMaxConcurrency()?(e.destroy(),this.count--):this.idleQueue.push(e),this.isDestroyed||this._startQueuedJob()}_getAvailableWorker(){if(this.idleQueue.length>0)return this.idleQueue.shift()||null;if(this.count{}};class Nl{static isSupported(){return $T.isSupported()}static getWorkerFarm(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return Nl._workerFarm=Nl._workerFarm||new Nl({}),Nl._workerFarm.setProps(e),Nl._workerFarm}constructor(e){Y(this,"props",void 0),Y(this,"workerPools",new Map),this.props={...c7},this.setProps(e),this.workerPools=new Map}destroy(){for(const e of this.workerPools.values())e.destroy();this.workerPools=new Map}setProps(e){this.props={...this.props,...e};for(const t of this.workerPools.values())t.setProps(this._getWorkerPoolProps())}getWorkerPool(e){const{name:t,source:r,url:i}=e;let o=this.workerPools.get(t);return o||(o=new s7({name:t,source:r,url:i}),o.setProps(this._getWorkerPoolProps()),this.workerPools.set(t,o)),o}_getWorkerPoolProps(){return{maxConcurrency:this.props.maxConcurrency,maxMobileConcurrency:this.props.maxMobileConcurrency,reuseWorkers:this.props.reuseWorkers,onDebug:this.props.onDebug}}}Y(Nl,"_workerFarm",void 0);const l7="latest";function u7(n){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const t=e[n.id]||{},r="".concat(n.id,"-worker.js");let i=t.workerUrl;if(!i&&n.id==="compression"&&(i=e.workerUrl),e._workerType==="test"&&(i="modules/".concat(n.module,"/dist/").concat(r)),!i){let o=n.version;o==="latest"&&(o=l7);const a=o?"@".concat(o):"";i="https://unpkg.com/@loaders.gl/".concat(n.module).concat(a,"/dist/").concat(r)}return Ll(i),i}function h7(n){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:JV;Ll(n,"no worker provided");const t=n.version;return!(!e||!t)}const d7=Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"}));function f7(n,e){return!Nl.isSupported()||!Pb&&!(e!=null&&e._nodeWorkers)?!1:n.worker&&(e==null?void 0:e.worker)}async function p7(n,e,t,r,i){const o=n.id,a=u7(n,t),h=Nl.getWorkerFarm(t).getWorkerPool({name:o,url:a});t=JSON.parse(JSON.stringify(t)),r=JSON.parse(JSON.stringify(r||{}));const p=await h.startJob("process-on-worker",g7.bind(null,i));return p.postMessage("process",{input:e,options:t,context:r}),await(await p.result).result}async function g7(n,e,t,r){switch(t){case"done":e.done(r);break;case"error":e.error(new Error(r.error));break;case"process":const{id:i,input:o,options:a}=r;try{const l=await n(o,a);e.postMessage("done",{id:i,result:l})}catch(l){const h=l instanceof Error?l.message:"unknown error";e.postMessage("error",{id:i,error:h})}break;default:console.warn("parse-with-worker unknown message ".concat(t))}}function m7(n,e,t){if(t=t||n.byteLength,n.byteLengthl instanceof ArrayBuffer?new Uint8Array(l):l),i=r.reduce((l,h)=>l+h.byteLength,0),o=new Uint8Array(i);let a=0;for(const l of r)o.set(l,a),a+=l.byteLength;return o.buffer}async function _7(n){const e=[];for await(const t of n)e.push(t);return y7(...e)}function Ek(){let n;if(typeof window<"u"&&window.performance)n=window.performance.now();else if(typeof process<"u"&&process.hrtime){const e=process.hrtime();n=e[0]*1e3+e[1]/1e6}else n=Date.now();return n}class Tk{constructor(e,t){Y(this,"name",void 0),Y(this,"type",void 0),Y(this,"sampleSize",1),Y(this,"time",void 0),Y(this,"count",void 0),Y(this,"samples",void 0),Y(this,"lastTiming",void 0),Y(this,"lastSampleTime",void 0),Y(this,"lastSampleCount",void 0),Y(this,"_count",0),Y(this,"_time",0),Y(this,"_samples",0),Y(this,"_startTime",0),Y(this,"_timerPending",!1),this.name=e,this.type=t,this.reset()}setSampleSize(e){return this.sampleSize=e,this}incrementCount(){return this.addCount(1),this}decrementCount(){return this.subtractCount(1),this}addCount(e){return this._count+=e,this._samples++,this._checkSampling(),this}subtractCount(e){return this._count-=e,this._samples++,this._checkSampling(),this}addTime(e){return this._time+=e,this.lastTiming=e,this._samples++,this._checkSampling(),this}timeStart(){return this._startTime=Ek(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(Ek()-this._startTime),this._timerPending=!1,this._checkSampling(),this):this}getSampleAverageCount(){return this.sampleSize>0?this.lastSampleCount/this.sampleSize:0}getSampleAverageTime(){return this.sampleSize>0?this.lastSampleTime/this.sampleSize:0}getSampleHz(){return this.lastSampleTime>0?this.sampleSize/(this.lastSampleTime/1e3):0}getAverageCount(){return this.samples>0?this.count/this.samples:0}getAverageTime(){return this.samples>0?this.time/this.samples:0}getHz(){return this.time>0?this.samples/(this.time/1e3):0}reset(){return this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this}_checkSampling(){this._samples===this.sampleSize&&(this.lastSampleTime=this._time,this.lastSampleCount=this._count,this.count+=this._count,this.time+=this._time,this.samples+=this._samples,this._time=0,this._count=0,this._samples=0)}}class WT{constructor(e){Y(this,"id",void 0),Y(this,"stats",{}),this.id=e.id,this.stats={},this._initializeStats(e.stats),Object.seal(this)}get(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"count";return this._getOrCreate({name:e,type:t})}get size(){return Object.keys(this.stats).length}reset(){for(const e in this.stats)this.stats[e].reset();return this}forEach(e){for(const t in this.stats)e(this.stats[t])}getTable(){const e={};return this.forEach(t=>{e[t.name]={time:t.time||0,count:t.count||0,average:t.getAverageTime()||0,hz:t.getHz()||0}}),e}_initializeStats(){(arguments.length>0&&arguments[0]!==void 0?arguments[0]:[]).forEach(t=>this._getOrCreate(t))}_getOrCreate(e){if(!e||!e.name)return null;const{name:t,type:r}=e;return this.stats[t]||(e instanceof Tk?this.stats[t]=e:this.stats[t]=new Tk(t,r)),this.stats[t]}}let v7="";const Sk={};function b7(n){for(const e in Sk)if(n.startsWith(e)){const t=Sk[e];n=n.replace(e,t)}return!n.startsWith("http://")&&!n.startsWith("https://")&&(n="".concat(v7).concat(n)),n}function sSe(n){return n}function w7(n){return n&&typeof n=="object"&&n.isBuffer}function Ck(n){if(w7(n))return n;if(n instanceof ArrayBuffer)return n;if(ArrayBuffer.isView(n))return n.byteOffset===0&&n.byteLength===n.buffer.byteLength?n.buffer:n.buffer.slice(n.byteOffset,n.byteOffset+n.byteLength);if(typeof n=="string"){const e=n;return new TextEncoder().encode(e).buffer}if(n&&typeof n=="object"&&n._toArrayBuffer)return n._toArrayBuffer();throw new Error("toArrayBuffer")}function Ak(n){const e=n?n.lastIndexOf("/"):-1;return e>=0?n.substr(e+1):""}function x7(n){const e=n?n.lastIndexOf("/"):-1;return e>=0?n.substr(0,e):""}const E7=n=>typeof n=="boolean",Iy=n=>typeof n=="function",Py=n=>n!==null&&typeof n=="object",Ik=n=>Py(n)&&n.constructor==={}.constructor,T7=n=>n&&typeof n[Symbol.iterator]=="function",S7=n=>n&&typeof n[Symbol.asyncIterator]=="function",bd=n=>typeof Response<"u"&&n instanceof Response||n&&n.arrayBuffer&&n.text&&n.json,wd=n=>typeof Blob<"u"&&n instanceof Blob,C7=n=>n&&typeof n=="object"&&n.isBuffer,A7=n=>typeof ReadableStream<"u"&&n instanceof ReadableStream||Py(n)&&Iy(n.tee)&&Iy(n.cancel)&&Iy(n.getReader),I7=n=>Py(n)&&Iy(n.read)&&Iy(n.pipe)&&E7(n.readable),Pk=n=>A7(n)||I7(n),P7=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,M7=/^([-\w.]+\/[-\w.+]+)/;function R7(n){const e=M7.exec(n);return e?e[1]:n}function Mk(n){const e=P7.exec(n);return e?e[1]:""}const Rk=/\?.*/;function k7(n){const e=n.match(Rk);return e&&e[0]}function YT(n){return n.replace(Rk,"")}function Mb(n){return bd(n)?n.url:wd(n)?n.name||"":typeof n=="string"?n:""}function KT(n){if(bd(n)){const e=n,t=e.headers.get("content-type")||"",r=YT(e.url);return R7(t)||Mk(r)}return wd(n)?n.type||"":typeof n=="string"?Mk(n):""}function O7(n){return bd(n)?n.headers["content-length"]||-1:wd(n)?n.size:typeof n=="string"?n.length:n instanceof ArrayBuffer||ArrayBuffer.isView(n)?n.byteLength:-1}async function kk(n){if(bd(n))return n;const e={},t=O7(n);t>=0&&(e["content-length"]=String(t));const r=Mb(n),i=KT(n);i&&(e["content-type"]=i);const o=await D7(n);o&&(e["x-first-bytes"]=o),typeof n=="string"&&(n=new TextEncoder().encode(n));const a=new Response(n,{headers:e});return Object.defineProperty(a,"url",{value:r}),a}async function L7(n){if(!n.ok){const e=await N7(n);throw new Error(e)}}async function N7(n){let e="Failed to fetch resource ".concat(n.url," (").concat(n.status,"): ");try{const t=n.headers.get("Content-Type");let r=n.statusText;t.includes("application/json")&&(r+=" ".concat(await n.text())),e+=r,e=e.length>60?"".concat(e.slice(0,60),"..."):e}catch{}return e}async function D7(n){if(typeof n=="string")return"data:,".concat(n.slice(0,5));if(n instanceof Blob){const t=n.slice(0,5);return await new Promise(r=>{const i=new FileReader;i.onload=o=>{var a;return r(o==null||(a=o.target)===null||a===void 0?void 0:a.result)},i.readAsDataURL(t)})}if(n instanceof ArrayBuffer){const t=n.slice(0,5),r=F7(t);return"data:base64,".concat(r)}return null}function F7(n){let e="";const t=new Uint8Array(n);for(let r=0;r=0)}function Dl(){return!(typeof process=="object"&&String(process)==="[object process]"&&!process.browser)||Lk()}const Rb={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document,process:typeof process=="object"&&process},kb=Rb.window||Rb.self||Rb.global,My=Rb.process||{},Nk=typeof __VERSION__<"u"?__VERSION__:"untranspiled source";Dl();const ZT=globalThis;function Dk(n){if(!n&&!Dl())return"Node";if(Lk(n))return"Electron";const t=n||(typeof navigator<"u"?navigator:{}).userAgent||"";if(t.indexOf("Edge")>-1)return"Edge";const r=t.indexOf("MSIE ")!==-1,i=t.indexOf("Trident/")!==-1;return r||i?"IE":ZT.chrome?"Chrome":ZT.safari?"Safari":ZT.mozInnerScreenX?"Firefox":"Unknown"}function B7(n){try{const e=window[n],t="__storage_test__";return e.setItem(t,t),e.removeItem(t),e}catch{return null}}class U7{constructor(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"sessionStorage";Y(this,"storage",void 0),Y(this,"id",void 0),Y(this,"config",void 0),this.storage=B7(r),this.id=e,this.config=t,this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(e){if(Object.assign(this.config,e),this.storage){const t=JSON.stringify(this.config);this.storage.setItem(this.id,t)}}_loadConfiguration(){let e={};if(this.storage){const t=this.storage.getItem(this.id);e=t?JSON.parse(t):{}}return Object.assign(this.config,e),this}}function z7(n){let e;return n<10?e="".concat(n.toFixed(2),"ms"):n<100?e="".concat(n.toFixed(1),"ms"):n<1e3?e="".concat(n.toFixed(0),"ms"):e="".concat((n/1e3).toFixed(2),"s"),e}function j7(n){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:8;const t=Math.max(e-n.length,0);return"".concat(" ".repeat(t)).concat(n)}function XT(n,e,t){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:600;const i=n.src.replace(/\(/g,"%28").replace(/\)/g,"%29");n.width>r&&(t=Math.min(t,r/n.width));const o=n.width*t,a=n.height*t,l=["font-size:1px;","padding:".concat(Math.floor(a/2),"px ").concat(Math.floor(o/2),"px;"),"line-height:".concat(a,"px;"),"background:url(".concat(i,");"),"background-size:".concat(o,"px ").concat(a,"px;"),"color:transparent;"].join("");return["".concat(e," %c+"),l]}let Ob;(function(n){n[n.BLACK=30]="BLACK",n[n.RED=31]="RED",n[n.GREEN=32]="GREEN",n[n.YELLOW=33]="YELLOW",n[n.BLUE=34]="BLUE",n[n.MAGENTA=35]="MAGENTA",n[n.CYAN=36]="CYAN",n[n.WHITE=37]="WHITE",n[n.BRIGHT_BLACK=90]="BRIGHT_BLACK",n[n.BRIGHT_RED=91]="BRIGHT_RED",n[n.BRIGHT_GREEN=92]="BRIGHT_GREEN",n[n.BRIGHT_YELLOW=93]="BRIGHT_YELLOW",n[n.BRIGHT_BLUE=94]="BRIGHT_BLUE",n[n.BRIGHT_MAGENTA=95]="BRIGHT_MAGENTA",n[n.BRIGHT_CYAN=96]="BRIGHT_CYAN",n[n.BRIGHT_WHITE=97]="BRIGHT_WHITE"})(Ob||(Ob={}));function Fk(n){return typeof n=="string"?Ob[n.toUpperCase()]||Ob.WHITE:n}function V7(n,e,t){return!Dl&&typeof n=="string"&&(e&&(e=Fk(e),n="\x1B[".concat(e,"m").concat(n,"\x1B[39m")),t&&(e=Fk(t),n="\x1B[".concat(t+10,"m").concat(n,"\x1B[49m"))),n}function H7(n){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:["constructor"];const t=Object.getPrototypeOf(n),r=Object.getOwnPropertyNames(t);for(const i of r)typeof n[i]=="function"&&(e.find(o=>i===o)||(n[i]=n[i].bind(n)))}function Lb(n,e){if(!n)throw new Error(e||"Assertion failed")}function wp(){let n;if(Dl&&"performance"in kb){var e,t;n=kb==null||(e=kb.performance)===null||e===void 0||(t=e.now)===null||t===void 0?void 0:t.call(e)}else if("hrtime"in My){var r;const i=My==null||(r=My.hrtime)===null||r===void 0?void 0:r.call(My);n=i[0]*1e3+i[1]/1e6}else n=Date.now();return n}const xp={debug:Dl&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},G7={enabled:!0,level:0};function zs(){}const Bk={},Uk={once:!0};class Ry{constructor(){let{id:e}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{id:""};Y(this,"id",void 0),Y(this,"VERSION",Nk),Y(this,"_startTs",wp()),Y(this,"_deltaTs",wp()),Y(this,"_storage",void 0),Y(this,"userData",{}),Y(this,"LOG_THROTTLE_TIMEOUT",0),this.id=e,this.userData={},this._storage=new U7("__probe-".concat(this.id,"__"),G7),this.timeStamp("".concat(this.id," started")),H7(this),Object.seal(this)}set level(e){this.setLevel(e)}get level(){return this.getLevel()}isEnabled(){return this._storage.config.enabled}getLevel(){return this._storage.config.level}getTotal(){return Number((wp()-this._startTs).toPrecision(10))}getDelta(){return Number((wp()-this._deltaTs).toPrecision(10))}set priority(e){this.level=e}get priority(){return this.level}getPriority(){return this.level}enable(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return this._storage.setConfiguration({enabled:e}),this}setLevel(e){return this._storage.setConfiguration({level:e}),this}get(e){return this._storage.config[e]}set(e,t){this._storage.setConfiguration({[e]:t})}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}assert(e,t){Lb(e,t)}warn(e){return this._getLogFunction(0,e,xp.warn,arguments,Uk)}error(e){return this._getLogFunction(0,e,xp.error,arguments)}deprecated(e,t){return this.warn("`".concat(e,"` is deprecated and will be removed in a later version. Use `").concat(t,"` instead"))}removed(e,t){return this.error("`".concat(e,"` has been removed. Use `").concat(t,"` instead"))}probe(e,t){return this._getLogFunction(e,t,xp.log,arguments,{time:!0,once:!0})}log(e,t){return this._getLogFunction(e,t,xp.debug,arguments)}info(e,t){return this._getLogFunction(e,t,console.info,arguments)}once(e,t){for(var r=arguments.length,i=new Array(r>2?r-2:0),o=2;o2&&arguments[2]!==void 0?arguments[2]:{collapsed:!1};const i=jk({logLevel:e,message:t,opts:r}),{collapsed:o}=r;return i.method=(o?console.groupCollapsed:console.group)||console.info,this._getLogFunction(i)}groupCollapsed(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.group(e,t,Object.assign({},r,{collapsed:!0}))}groupEnd(e){return this._getLogFunction(e,"",console.groupEnd||zs)}withGroup(e,t,r){this.group(e,t)();try{r()}finally{this.groupEnd(e)()}}trace(){console.trace&&console.trace()}_shouldLog(e){return this.isEnabled()&&this.getLevel()>=zk(e)}_getLogFunction(e,t,r,i,o){if(this._shouldLog(e)){o=jk({logLevel:e,message:t,args:i,opts:o}),r=r||o.method,Lb(r),o.total=this.getTotal(),o.delta=this.getDelta(),this._deltaTs=wp();const a=o.tag||o.message;if(o.once)if(!Bk[a])Bk[a]=wp();else return zs;return t=q7(this.id,o.message,o),r.bind(console,t,...o.args)}return zs}}Y(Ry,"VERSION",Nk);function zk(n){if(!n)return 0;let e;switch(typeof n){case"number":e=n;break;case"object":e=n.logLevel||n.priority||0;break;default:return 0}return Lb(Number.isFinite(e)&&e>=0),e}function jk(n){const{logLevel:e,message:t}=n;n.logLevel=zk(e);const r=n.args?Array.from(n.args):[];for(;r.length&&r.shift()!==t;);switch(typeof e){case"string":case"function":t!==void 0&&r.unshift(t),n.message=e;break;case"object":Object.assign(n,e);break}typeof n.message=="function"&&(n.message=n.message());const i=typeof n.message;return Lb(i==="string"||i==="object"),Object.assign(n,{args:r},n.opts)}function q7(n,e,t){if(typeof e=="string"){const r=t.time?j7(z7(t.total)):"";e=t.time?"".concat(n,": ").concat(r," ").concat(e):"".concat(n,": ").concat(e),e=V7(e,t.color,t.background)}return e}function $7(n){return console.warn("removed"),zs}function W7(n){let{image:e,message:t="",scale:r=1}=n;if(typeof e=="string"){const o=new Image;return o.onload=()=>{const a=XT(o,t,r);console.log(...a)},o.src=e,zs}const i=e.nodeName||"";if(i.toLowerCase()==="img")return console.log(...XT(e,t,r)),zs;if(i.toLowerCase()==="canvas"){const o=new Image;return o.onload=()=>console.log(...XT(o,t,r)),o.src=e.toDataURL(),zs}return zs}function Y7(n){for(const e in n)for(const t in n[e])return t||"untitled";return"empty"}const Vk=new Ry({id:"loaders.gl"});class K7{log(){return()=>{}}info(){return()=>{}}warn(){return()=>{}}error(){return()=>{}}}class Z7{constructor(){Y(this,"console",void 0),this.console=console}log(){for(var e=arguments.length,t=new Array(e),r=0;r{const n=Gk();return n.globalOptions=n.globalOptions||{...Hk},n.globalOptions};function Q7(n,e,t,r){return t=t||[],t=Array.isArray(t)?t:[t],J7(n,t),tH(e,n,r)}function J7(n,e){$k(n,null,Hk,X7,e);for(const t of e){const r=n&&n[t.id]||{},i=t.options&&t.options[t.id]||{},o=t.deprecatedOptions&&t.deprecatedOptions[t.id]||{};$k(r,t.id,i,o,e)}}function $k(n,e,t,r,i){const o=e||"Top level",a=e?"".concat(e,"."):"";for(const l in n){const h=!e&&Py(n[l]),p=l==="baseUri"&&!e,g=l==="workerUrl"&&e;if(!(l in t)&&!p&&!g){if(l in r)Vk.warn("".concat(o," loader option '").concat(a).concat(l,"' no longer supported, use '").concat(r[l],"'"))();else if(!h){const _=eH(l,i);Vk.warn("".concat(o," loader option '").concat(a).concat(l,"' not recognized. ").concat(_))()}}}}function eH(n,e){const t=n.toLowerCase();let r="";for(const i of e)for(const o in i.options){if(n===o)return"Did you mean '".concat(i.id,".").concat(o,"'?");const a=o.toLowerCase();(t.startsWith(a)||a.startsWith(t))&&(r=r||"Did you mean '".concat(i.id,".").concat(o,"'?"))}return r}function tH(n,e,t){const i={...n.options||{}};return nH(i,t),i.log===null&&(i.log=new K7),Wk(i,qk()),Wk(i,e),i}function Wk(n,e){for(const t in e)if(t in e){const r=e[t];Ik(r)&&Ik(n[t])?n[t]={...n[t],...e[t]}:n[t]=e[t]}}function nH(n,e){e&&!("baseUri"in n)&&(n.baseUri=e)}function QT(n){var e;return n?(Array.isArray(n)&&(n=n[0]),Array.isArray((e=n)===null||e===void 0?void 0:e.extensions)):!1}function JT(n){var e,t;Ib(n,"null loader"),Ib(QT(n),"invalid loader");let r;return Array.isArray(n)&&(r=n[1],n=n[0],n={...n,options:{...n.options,...r}}),((e=n)!==null&&e!==void 0&&e.parseTextSync||(t=n)!==null&&t!==void 0&&t.parseText)&&(n.text=!0),n.text||(n.binary=!0),n}const Yk=()=>{const n=Gk();return n.loaderRegistry=n.loaderRegistry||[],n.loaderRegistry};function rH(n){const e=Yk();n=Array.isArray(n)?n:[n];for(const t of n){const r=JT(t);e.find(i=>r===i)||e.unshift(r)}}function iH(){return Yk()}const oH=new Ry({id:"loaders.gl"}),aH=/\.([^.]+)$/;async function sH(n){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],t=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;if(!Zk(n))return null;let i=Kk(n,e,{...t,nothrow:!0},r);if(i)return i;if(wd(n)&&(n=await n.slice(0,10).arrayBuffer(),i=Kk(n,e,t,r)),!i&&!(t!=null&&t.nothrow))throw new Error(Xk(n));return i}function Kk(n){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],t=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;if(!Zk(n))return null;if(e&&!Array.isArray(e))return JT(e);let i=[];e&&(i=i.concat(e)),t!=null&&t.ignoreRegisteredLoaders||i.push(...iH()),lH(i);const o=cH(n,i,t,r);if(!o&&!(t!=null&&t.nothrow))throw new Error(Xk(n));return o}function cH(n,e,t,r){const i=Mb(n),o=KT(n),a=YT(i)||(r==null?void 0:r.url);let l=null,h="";if(t!=null&&t.mimeType&&(l=eS(e,t==null?void 0:t.mimeType),h="match forced by supplied MIME type ".concat(t==null?void 0:t.mimeType)),l=l||uH(e,a),h=h||(l?"matched url ".concat(a):""),l=l||eS(e,o),h=h||(l?"matched MIME type ".concat(o):""),l=l||dH(e,n),h=h||(l?"matched initial data ".concat(Jk(n)):""),l=l||eS(e,t==null?void 0:t.fallbackMimeType),h=h||(l?"matched fallback MIME type ".concat(o):""),h){var p;oH.log(1,"selectLoader selected ".concat((p=l)===null||p===void 0?void 0:p.name,": ").concat(h,"."))}return l}function Zk(n){return!(n instanceof Response&&n.status===204)}function Xk(n){const e=Mb(n),t=KT(n);let r="No valid loader found (";r+=e?"".concat(Ak(e),", "):"no url provided, ",r+="MIME type: ".concat(t?'"'.concat(t,'"'):"not provided",", ");const i=n?Jk(n):"";return r+=i?' first bytes: "'.concat(i,'"'):"first bytes: not available",r+=")",r}function lH(n){for(const e of n)JT(e)}function uH(n,e){const t=e&&aH.exec(e),r=t&&t[1];return r?hH(n,r):null}function hH(n,e){e=e.toLowerCase();for(const t of n)for(const r of t.extensions)if(r.toLowerCase()===e)return t;return null}function eS(n,e){for(const t of n)if(t.mimeTypes&&t.mimeTypes.includes(e)||e==="application/x.".concat(t.id))return t;return null}function dH(n,e){if(!e)return null;for(const t of n)if(typeof e=="string"){if(fH(e,t))return t}else if(ArrayBuffer.isView(e)){if(Qk(e.buffer,e.byteOffset,t))return t}else if(e instanceof ArrayBuffer&&Qk(e,0,t))return t;return null}function fH(n,e){return e.testText?e.testText(n):(Array.isArray(e.tests)?e.tests:[e.tests]).some(r=>n.startsWith(r))}function Qk(n,e,t){return(Array.isArray(t.tests)?t.tests:[t.tests]).some(i=>pH(n,e,t,i))}function pH(n,e,t,r){if(r instanceof ArrayBuffer)return m7(r,n,r.byteLength);switch(typeof r){case"function":return r(n,t);case"string":const i=tS(n,e,r.length);return r===i;default:return!1}}function Jk(n){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:5;return typeof n=="string"?n.slice(0,e):ArrayBuffer.isView(n)?tS(n.buffer,n.byteOffset,e):n instanceof ArrayBuffer?tS(n,0,e):""}function tS(n,e,t){if(n.byteLength1&&arguments[1]!==void 0?arguments[1]:{};return function*(){const{chunkSize:t=yH}=e;let r=0;for(;rOk(i,r):e!=null&&e.fetch?e==null?void 0:e.fetch:Ok}function CH(n,e,t){if(t)return t;const r={fetch:nO(e,n),...n};if(r.url){const i=YT(r.url);r.baseUrl=i,r.queryString=k7(r.url),r.filename=Ak(i),r.baseUrl=x7(i)}return Array.isArray(r.loaders)||(r.loaders=null),r}function AH(n,e){if(!e&&n&&!Array.isArray(n))return n;let t;if(n&&(t=Array.isArray(n)?n:[n]),e&&e.loaders){const r=Array.isArray(e.loaders)?e.loaders:[e.loaders];t=t?[...t,...r]:r}return t&&t.length?t:null}async function nS(n,e,t,r){Ll(!r||typeof r=="object"),e&&!Array.isArray(e)&&!QT(e)&&(r=void 0,t=e,e=void 0),n=await n,t=t||{};const i=Mb(n),a=AH(e,r),l=await sH(n,a,t);return l?(t=Q7(t,l,a,i),r=CH({url:i,parse:nS,loaders:a},t,r||null),await IH(l,n,t,r)):null}async function IH(n,e,t,r){if(h7(n),bd(e)){const i=e,{ok:o,redirected:a,status:l,statusText:h,type:p,url:g}=i,_=Object.fromEntries(i.headers.entries());r.response={headers:_,ok:o,redirected:a,status:l,statusText:h,type:p,url:g}}if(e=await SH(e,n,t),n.parseTextSync&&typeof e=="string")return t.dataType="text",n.parseTextSync(e,t,r,n);if(f7(n,t))return await p7(n,e,t,r,nS);if(n.parseText&&typeof e=="string")return await n.parseText(e,t,r,n);if(n.parse)return await n.parse(e,t,r,n);throw Ll(!n.parseSync),new Error("".concat(n.id," loader - no parser found and worker is disabled"))}async function Nb(n,e,t,r){!Array.isArray(e)&&!QT(e)&&(t=e,e=void 0);const i=nO(t);let o=n;return typeof n=="string"&&(o=await i(n)),wd(n)&&(o=await i(n)),await nS(o,e,t)}const PH="3.4.15",{_parseImageNode:MH}=globalThis,rS=typeof Image<"u",iS=typeof ImageBitmap<"u",oS=VT?!0:!!MH;function RH(n){switch(n){case"auto":return iS||rS||oS;case"imagebitmap":return iS;case"image":return rS;case"data":return oS;default:throw new Error("@loaders.gl/images: image ".concat(n," not supported in this environment"))}}function kH(){if(iS)return"imagebitmap";if(rS)return"image";if(oS)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}function OH(n){const e=NH(n);if(!e)throw new Error("Not an image");return e}function LH(n){switch(OH(n)){case"data":return n;case"image":case"imagebitmap":const e=document.createElement("canvas"),t=e.getContext("2d");if(!t)throw new Error("getImageData");return e.width=n.width,e.height=n.height,t.drawImage(n,0,0),t.getImageData(0,0,n.width,n.height);default:throw new Error("getImageData")}}function NH(n){return typeof ImageBitmap<"u"&&n instanceof ImageBitmap?"imagebitmap":typeof Image<"u"&&n instanceof Image?"image":n&&typeof n=="object"&&n.data&&n.width&&n.height?"data":null}const DH=/^data:image\/svg\+xml/,FH=/\.svg((\?|#).*)?$/;function aS(n){return n&&(DH.test(n)||FH.test(n))}function BH(n,e){if(aS(e)){let r=new TextDecoder().decode(n);try{typeof unescape=="function"&&typeof encodeURIComponent=="function"&&(r=unescape(encodeURIComponent(r)))}catch(o){throw new Error(o.message)}return"data:image/svg+xml;base64,".concat(btoa(r))}return rO(n,e)}function rO(n,e){if(aS(e))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(n)])}async function iO(n,e,t){const r=BH(n,t),i=self.URL||self.webkitURL,o=typeof r!="string"&&i.createObjectURL(r);try{return await UH(o||r,e)}finally{o&&i.revokeObjectURL(o)}}async function UH(n,e){const t=new Image;return t.src=n,e.image&&e.image.decode&&t.decode?(await t.decode(),t):await new Promise((r,i)=>{try{t.onload=()=>r(t),t.onerror=o=>i(new Error("Could not load image ".concat(n,": ").concat(o)))}catch(o){i(o)}})}const zH={};let oO=!0;async function jH(n,e,t){let r;aS(t)?r=await iO(n,e,t):r=rO(n,t);const i=e&&e.imagebitmap;return await VH(r,i)}async function VH(n){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if((HH(e)||!oO)&&(e=null),e)try{return await createImageBitmap(n,e)}catch(t){console.warn(t),oO=!1}return await createImageBitmap(n)}function HH(n){for(const e in n||zH)return!1;return!0}function GH(n){return!YH(n,"ftyp",4)||!(n[8]&96)?null:qH(n)}function qH(n){switch($H(n,8,12).replace("\0"," ").trim()){case"avif":case"avis":return{extension:"avif",mimeType:"image/avif"};default:return null}}function $H(n,e,t){return String.fromCharCode(...n.slice(e,t))}function WH(n){return[...n].map(e=>e.charCodeAt(0))}function YH(n,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;const r=WH(e);for(let i=0;i=24&&e.getUint32(0,Fc)===2303741511?{mimeType:"image/png",width:e.getUint32(16,Fc),height:e.getUint32(20,Fc)}:null}function XH(n){const e=Oy(n);return e.byteLength>=10&&e.getUint32(0,Fc)===1195984440?{mimeType:"image/gif",width:e.getUint16(6,ky),height:e.getUint16(8,ky)}:null}function QH(n){const e=Oy(n);return e.byteLength>=14&&e.getUint16(0,Fc)===16973&&e.getUint32(2,ky)===e.byteLength?{mimeType:"image/bmp",width:e.getUint32(18,ky),height:e.getUint32(22,ky)}:null}function JH(n){const e=Oy(n);if(!(e.byteLength>=3&&e.getUint16(0,Fc)===65496&&e.getUint8(2)===255))return null;const{tableMarkers:r,sofMarkers:i}=eG();let o=2;for(;o+9!!aO(new DataView(n))],options:{image:{type:"auto",decode:!0}}},Ir=new Ry({id:"deck"}),zu={attributeUpdateStart:-1,attributeManagerUpdateStart:-1,attributeUpdateMessages:[]},sS=1,Ly=2,cS=3,lS=4,oG=2,aG=n=>({"layer.changeFlag":(e,t,r)=>{n.log(cS,"".concat(e.id," ").concat(t,": "),r[t])()},"layer.initialize":e=>{n.log(sS,"Initializing ".concat(e))()},"layer.update":(e,t)=>{if(t){const r=e.getChangeFlags();n.log(Ly,"Updating ".concat(e," because: ").concat(Object.keys(r).filter(i=>r[i]).join(", ")))()}else n.log(lS,"".concat(e," does not need update"))()},"layer.matched":(e,t)=>{t&&n.log(lS,"Matched ".concat(e,", state transfered"))()},"layer.finalize":e=>{n.log(sS,"Finalizing ".concat(e))()},"compositeLayer.renderLayers":(e,t,r)=>{t?n.log(Ly,"Composite layer rendered new subLayers ".concat(e),r)():n.log(lS,"Composite layer reused subLayers ".concat(e),r)()},"layerManager.setLayers":(e,t,r)=>{t&&n.log(Ly,"Updating ".concat(r.length," deck layers"))()},"layerManager.activateViewport":(e,t)=>{n.log(cS,"Viewport changed",t)()},"attributeManager.invalidate":(e,t,r)=>{n.log(sS,r?"invalidated attributes ".concat(r," (").concat(t,") for ").concat(e.id):"invalidated all attributes for ".concat(e.id))()},"attributeManager.updateStart":e=>{zu.attributeUpdateMessages.length=0,zu.attributeManagerUpdateStart=Date.now()},"attributeManager.updateEnd":(e,t)=>{const r=Math.round(Date.now()-zu.attributeManagerUpdateStart);n.groupCollapsed(Ly,"Updated attributes for ".concat(t," instances in ").concat(e.id," in ").concat(r,"ms"))();for(const i of zu.attributeUpdateMessages)n.log(cS,i)();n.groupEnd(Ly)()},"attribute.updateStart":e=>{zu.attributeUpdateStart=Date.now()},"attribute.allocate":(e,t)=>{const r="".concat(e.id," allocated ").concat(t);zu.attributeUpdateMessages.push(r)},"attribute.updateEnd":(e,t)=>{const r=Math.round(Date.now()-zu.attributeUpdateStart),i="".concat(e.id," updated ").concat(t," in ").concat(r,"ms");zu.attributeUpdateMessages.push(i)},"deckRenderer.renderLayers":(e,t,r)=>{const{pass:i,redrawReason:o,stats:a}=r;for(const l of t){const{totalCount:h,visibleCount:p,compositeCount:g,pickableCount:_}=l,C=h-g-p;n.log(oG,"RENDER #".concat(e.renderCount," ").concat(p," (of ").concat(h," layers) to ").concat(i," because ").concat(o," (").concat(C," hidden, ").concat(g," composite ").concat(_," pickable)"))(),a&&a.get("Redraw Layers").add(p)}}});let Db={};({}).NODE_ENV!=="production"&&(Db=aG(Ir));function sG(n){Db=n}function oa(n,e,t,r){Ir.level>0&&Db[n]&&Db[n].call(null,e,t,r)}function cG(n){const e=n[0],t=n[n.length-1];return e==="{"&&t==="}"||e==="["&&t==="]"}const lG={id:"JSON",name:"JSON",module:"",version:"",options:{},extensions:["json","geojson"],mimeTypes:["application/json","application/geo+json"],testText:cG,parseTextSync:JSON.parse};function uG(){const n="8.9.36",e=globalThis.deck&&globalThis.deck.VERSION;if(e&&e!==n)throw new Error("deck.gl - multiple versions detected: ".concat(e," vs ").concat(n));return e||(Ir.log(1,"deck.gl ".concat(n))(),globalThis.deck={...globalThis.deck,VERSION:n,version:n,log:Ir,_registerLoggers:sG},rH([lG,[iG,{imagebitmap:{premultiplyAlpha:"none"}}]])),n}const hG=uG(),Zr={DEFAULT:-1,LNGLAT:1,METER_OFFSETS:2,LNGLAT_OFFSETS:3,CARTESIAN:0};Object.defineProperty(Zr,"IDENTITY",{get:()=>(Ir.deprecated("COORDINATE_SYSTEM.IDENTITY","COORDINATE_SYSTEM.CARTESIAN")(),0)});const Bc={WEB_MERCATOR:1,GLOBE:2,WEB_MERCATOR_AUTO_OFFSET:4,IDENTITY:0},Ep={common:0,meters:1,pixels:2},sO={click:{handler:"onClick"},panstart:{handler:"onDragStart"},panmove:{handler:"onDrag"},panend:{handler:"onDragEnd"}},Tn=new Ry({id:"luma.gl"});function va(n,e){if(!n)throw new Error(e||"luma.gl: assertion failed.")}const dG="Invalid WebGLRenderingContext",fG="Requires WebGL2";function Fb(n){return typeof WebGLRenderingContext<"u"&&n instanceof WebGLRenderingContext||typeof WebGL2RenderingContext<"u"&&n instanceof WebGL2RenderingContext?!0:!!(n&&Number.isFinite(n._version))}function yr(n){return typeof WebGL2RenderingContext<"u"&&n instanceof WebGL2RenderingContext?!0:!!(n&&n._version===2)}function pG(n){return yr(n)?n:null}function Bb(n){return va(Fb(n),dG),n}function aa(n){return va(yr(n),fG),n}const Ny={};function gG(n){globalThis.console&&globalThis.console.error&&globalThis.console.error(n)}function mG(n){globalThis.console&&globalThis.console.log&&globalThis.console.log(n)}function yG(n,e){Ny[n]=!0,e!==void 0&&gG(e)}function _G(n){const e=n.getError;n.getError=function(){let r;do r=e.apply(n),r!==0&&(Ny[r]=!0);while(r!==0);for(r in Ny)if(Ny[r])return delete Ny[r],parseInt(r,10);return 0}}const Dy=function n(e){const t=e.gl;this.ext=e,this.isAlive=!0,this.hasBeenBound=!1,this.elementArrayBuffer=null,this.attribs=new Array(e.maxVertexAttribs);for(let r=0;r{mG("OESVertexArrayObject emulation library context restored"),t.reset_()},!0),this.reset_()};xd.prototype.VERTEX_ARRAY_BINDING_OES=34229,xd.prototype.reset_=function(){if(this.vertexArrayObjects!==void 0)for(let r=0;ryr(n)?void 0:0,PG={3074:n=>yr(n)?void 0:36064,[EG]:n=>yr(n)?void 0:TG,35977:di,32937:di,[SG]:(n,e)=>{const t=yr(n)?n.getExtension(wG):n.getExtension(bG);return t&&t.GPU_DISJOINT_EXT?e(t.GPU_DISJOINT_EXT):0},[AG]:(n,e)=>{const t=n.getExtension(uO);return e(t&&t.UNMASKED_VENDOR_WEBGL||7936)},[IG]:(n,e)=>{const t=n.getExtension(uO);return e(t&&t.UNMASKED_RENDERER_WEBGL||7937)},[CG]:(n,e)=>{const t=n.luma.extensions[xG];return t?e(t.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1},32883:di,35071:di,37447:di,36063:(n,e)=>{if(!yr(n)){const t=n.getExtension(lO);return t?e(t.MAX_COLOR_ATTACHMENTS_WEBGL):0}},35379:di,35374:di,35377:di,34852:n=>{if(!yr(n)){const e=n.getExtension(lO);return e?e.MAX_DRAW_BUFFERS_WEBGL:0}},36203:n=>n.getExtension(cO)?2147483647:65535,33001:n=>n.getExtension(cO)?16777216:65535,33e3:n=>16777216,37157:di,35373:di,35657:di,36183:di,37137:di,34045:di,35978:di,35979:di,35968:di,35376:di,35375:di,35659:di,37154:di,35371:di,35658:di,35076:di,35077:di,35380:di};function MG(n,e,t){const r=PG[t],i=typeof r=="function"?r(n,e,t):r;return i!==void 0?i:e(t)}const RG="OES_vertex_array_object",hO="ANGLE_instanced_arrays",kG="WEBGL_draw_buffers",OG="EXT_disjoint_timer_query",LG="EXT_texture_filter_anisotropic",NG="VertexArray requires WebGL2 or OES_vertex_array_object extension";function DG(n,e){return{webgl2:yr(n),ext:n.getExtension(e)}}const dO={[RG]:{meta:{suffix:"OES"},createVertexArray:()=>{va(!1,NG)},deleteVertexArray:()=>{},bindVertexArray:()=>{},isVertexArray:()=>!1},[hO]:{meta:{suffix:"ANGLE"},vertexAttribDivisor(n,e){va(e===0,"WebGL instanced rendering not supported")},drawElementsInstanced:()=>{},drawArraysInstanced:()=>{}},[kG]:{meta:{suffix:"WEBGL"},drawBuffers:()=>{va(!1)}},[OG]:{meta:{suffix:"EXT"},createQuery:()=>{va(!1)},deleteQuery:()=>{va(!1)},beginQuery:()=>{va(!1)},endQuery:()=>{},getQuery(n,e){return this.getQueryObject(n,e)},getQueryParameter(n,e){return this.getQueryObject(n,e)},getQueryObject:()=>{}}},uS={readBuffer:(n,e,t)=>{yr(n)&&e(t)},getVertexAttrib:(n,e,t,r)=>{const{webgl2:i,ext:o}=DG(n,hO);let a;switch(r){case 35069:a=i?void 0:!1;break;case 35070:a=!i&&!o?0:void 0;break}return a!==void 0?a:e(t,r)},getProgramParameter:(n,e,t,r)=>{if(!yr(n))switch(r){case 35967:return 35981;case 35971:return 0;case 35382:return 0}return e(t,r)},getInternalformatParameter:(n,e,t,r,i)=>{if(!yr(n))switch(i){case 32937:return new Int32Array([0])}return n.getInternalformatParameter(t,r,i)},getTexParameter(n,e,t,r){switch(r){case 34046:const{extensions:i}=n.luma,o=i[LG];r=o&&o.TEXTURE_MAX_ANISOTROPY_EXT||34046;break}return e(t,r)},getParameter:MG,hint(n,e,t,r){return e(t,r)}};function FG(n){n.luma=n.luma||{};const{luma:e}=n;return e.polyfilled||(vG(n),BG(n),zG(n,dO),UG(n,{target:e,target2:n}),e.polyfilled=!0),n}globalThis.polyfillContext=FG;function BG(n){n.luma.extensions={};const e=n.getSupportedExtensions()||[];for(const t of e)n.luma[t]=n.getExtension(t)}function UG(n,e){let{target:t,target2:r}=e;Object.keys(uS).forEach(i=>{if(typeof uS[i]=="function"){const o=n[i]?n[i].bind(n):()=>{},a=uS[i].bind(null,n,o);t[i]=a,r[i]=a}})}function zG(n,e){for(const t of Object.getOwnPropertyNames(e))t!=="overrides"&&jG(n,{extension:t,target:n.luma,target2:n})}function jG(n,e){let{extension:t,target:r,target2:i}=e;const o=dO[t];va(o);const{meta:a={}}=o,{suffix:l=""}=a,h=n.getExtension(t);for(const p of Object.keys(o)){const g="".concat(p).concat(l);let _=null;p==="meta"||typeof n[p]=="function"||(h&&typeof h[g]=="function"?_=function(){return h[g](...arguments)}:typeof o[p]=="function"&&(_=o[p].bind(r))),_&&(r[p]=_,i[p]=_)}}const hS={3042:!1,32773:new Float32Array([0,0,0,0]),32777:32774,34877:32774,32969:1,32968:0,32971:1,32970:0,3106:new Float32Array([0,0,0,0]),3107:[!0,!0,!0,!0],2884:!1,2885:1029,2929:!1,2931:1,2932:513,2928:new Float32Array([0,1]),2930:!0,3024:!0,36006:null,2886:2305,33170:4352,2849:1,32823:!1,32824:0,10752:0,32938:1,32939:!1,3089:!1,3088:new Int32Array([0,0,1024,1024]),2960:!1,2961:0,2968:4294967295,36005:4294967295,2962:519,2967:0,2963:4294967295,34816:519,36003:0,36004:4294967295,2964:7680,2965:7680,2966:7680,34817:7680,34818:7680,34819:7680,2978:[0,0,1024,1024],3333:4,3317:4,37440:!1,37441:!1,37443:37444,35723:4352,36010:null,35977:!1,3330:0,3332:0,3331:0,3314:0,32878:0,3316:0,3315:0,32877:0},ju=(n,e,t)=>e?n.enable(t):n.disable(t),fO=(n,e,t)=>n.hint(t,e),hs=(n,e,t)=>n.pixelStorei(t,e),VG=(n,e)=>{const t=yr(n)?36009:36160;return n.bindFramebuffer(t,e)},HG=(n,e)=>n.bindFramebuffer(36008,e);function Fy(n){return Array.isArray(n)||ArrayBuffer.isView(n)}const GG={3042:ju,32773:(n,e)=>n.blendColor(...e),32777:"blendEquation",34877:"blendEquation",32969:"blendFunc",32968:"blendFunc",32971:"blendFunc",32970:"blendFunc",3106:(n,e)=>n.clearColor(...e),3107:(n,e)=>n.colorMask(...e),2884:ju,2885:(n,e)=>n.cullFace(e),2929:ju,2931:(n,e)=>n.clearDepth(e),2932:(n,e)=>n.depthFunc(e),2928:(n,e)=>n.depthRange(...e),2930:(n,e)=>n.depthMask(e),3024:ju,35723:fO,36006:VG,2886:(n,e)=>n.frontFace(e),33170:fO,2849:(n,e)=>n.lineWidth(e),32823:ju,32824:"polygonOffset",10752:"polygonOffset",35977:ju,32938:"sampleCoverage",32939:"sampleCoverage",3089:ju,3088:(n,e)=>n.scissor(...e),2960:ju,2961:(n,e)=>n.clearStencil(e),2968:(n,e)=>n.stencilMaskSeparate(1028,e),36005:(n,e)=>n.stencilMaskSeparate(1029,e),2962:"stencilFuncFront",2967:"stencilFuncFront",2963:"stencilFuncFront",34816:"stencilFuncBack",36003:"stencilFuncBack",36004:"stencilFuncBack",2964:"stencilOpFront",2965:"stencilOpFront",2966:"stencilOpFront",34817:"stencilOpBack",34818:"stencilOpBack",34819:"stencilOpBack",2978:(n,e)=>n.viewport(...e),3333:hs,3317:hs,37440:hs,37441:hs,37443:hs,3330:hs,3332:hs,3331:hs,36010:HG,3314:hs,32878:hs,3316:hs,3315:hs,32877:hs,framebuffer:(n,e)=>{const t=e&&"handle"in e?e.handle:e;return n.bindFramebuffer(36160,t)},blend:(n,e)=>e?n.enable(3042):n.disable(3042),blendColor:(n,e)=>n.blendColor(...e),blendEquation:(n,e)=>{e=Fy(e)?e:[e,e],n.blendEquationSeparate(...e)},blendFunc:(n,e)=>{e=Fy(e)&&e.length===2?[...e,...e]:e,n.blendFuncSeparate(...e)},clearColor:(n,e)=>n.clearColor(...e),clearDepth:(n,e)=>n.clearDepth(e),clearStencil:(n,e)=>n.clearStencil(e),colorMask:(n,e)=>n.colorMask(...e),cull:(n,e)=>e?n.enable(2884):n.disable(2884),cullFace:(n,e)=>n.cullFace(e),depthTest:(n,e)=>e?n.enable(2929):n.disable(2929),depthFunc:(n,e)=>n.depthFunc(e),depthMask:(n,e)=>n.depthMask(e),depthRange:(n,e)=>n.depthRange(...e),dither:(n,e)=>e?n.enable(3024):n.disable(3024),derivativeHint:(n,e)=>{n.hint(35723,e)},frontFace:(n,e)=>n.frontFace(e),mipmapHint:(n,e)=>n.hint(33170,e),lineWidth:(n,e)=>n.lineWidth(e),polygonOffsetFill:(n,e)=>e?n.enable(32823):n.disable(32823),polygonOffset:(n,e)=>n.polygonOffset(...e),sampleCoverage:(n,e)=>n.sampleCoverage(...e),scissorTest:(n,e)=>e?n.enable(3089):n.disable(3089),scissor:(n,e)=>n.scissor(...e),stencilTest:(n,e)=>e?n.enable(2960):n.disable(2960),stencilMask:(n,e)=>{e=Fy(e)?e:[e,e];const[t,r]=e;n.stencilMaskSeparate(1028,t),n.stencilMaskSeparate(1029,r)},stencilFunc:(n,e)=>{e=Fy(e)&&e.length===3?[...e,...e]:e;const[t,r,i,o,a,l]=e;n.stencilFuncSeparate(1028,t,r,i),n.stencilFuncSeparate(1029,o,a,l)},stencilOp:(n,e)=>{e=Fy(e)&&e.length===3?[...e,...e]:e;const[t,r,i,o,a,l]=e;n.stencilOpSeparate(1028,t,r,i),n.stencilOpSeparate(1029,o,a,l)},viewport:(n,e)=>n.viewport(...e)};function ji(n,e,t){return e[n]!==void 0?e[n]:t[n]}const qG={blendEquation:(n,e,t)=>n.blendEquationSeparate(ji(32777,e,t),ji(34877,e,t)),blendFunc:(n,e,t)=>n.blendFuncSeparate(ji(32969,e,t),ji(32968,e,t),ji(32971,e,t),ji(32970,e,t)),polygonOffset:(n,e,t)=>n.polygonOffset(ji(32824,e,t),ji(10752,e,t)),sampleCoverage:(n,e,t)=>n.sampleCoverage(ji(32938,e,t),ji(32939,e,t)),stencilFuncFront:(n,e,t)=>n.stencilFuncSeparate(1028,ji(2962,e,t),ji(2967,e,t),ji(2963,e,t)),stencilFuncBack:(n,e,t)=>n.stencilFuncSeparate(1029,ji(34816,e,t),ji(36003,e,t),ji(36004,e,t)),stencilOpFront:(n,e,t)=>n.stencilOpSeparate(1028,ji(2964,e,t),ji(2965,e,t),ji(2966,e,t)),stencilOpBack:(n,e,t)=>n.stencilOpSeparate(1029,ji(34817,e,t),ji(34818,e,t),ji(34819,e,t))},pO={enable:(n,e)=>n({[e]:!0}),disable:(n,e)=>n({[e]:!1}),pixelStorei:(n,e,t)=>n({[e]:t}),hint:(n,e,t)=>n({[e]:t}),bindFramebuffer:(n,e,t)=>{switch(e){case 36160:return n({36006:t,36010:t});case 36009:return n({36006:t});case 36008:return n({36010:t});default:return null}},blendColor:(n,e,t,r,i)=>n({32773:new Float32Array([e,t,r,i])}),blendEquation:(n,e)=>n({32777:e,34877:e}),blendEquationSeparate:(n,e,t)=>n({32777:e,34877:t}),blendFunc:(n,e,t)=>n({32969:e,32968:t,32971:e,32970:t}),blendFuncSeparate:(n,e,t,r,i)=>n({32969:e,32968:t,32971:r,32970:i}),clearColor:(n,e,t,r,i)=>n({3106:new Float32Array([e,t,r,i])}),clearDepth:(n,e)=>n({2931:e}),clearStencil:(n,e)=>n({2961:e}),colorMask:(n,e,t,r,i)=>n({3107:[e,t,r,i]}),cullFace:(n,e)=>n({2885:e}),depthFunc:(n,e)=>n({2932:e}),depthRange:(n,e,t)=>n({2928:new Float32Array([e,t])}),depthMask:(n,e)=>n({2930:e}),frontFace:(n,e)=>n({2886:e}),lineWidth:(n,e)=>n({2849:e}),polygonOffset:(n,e,t)=>n({32824:e,10752:t}),sampleCoverage:(n,e,t)=>n({32938:e,32939:t}),scissor:(n,e,t,r,i)=>n({3088:new Int32Array([e,t,r,i])}),stencilMask:(n,e)=>n({2968:e,36005:e}),stencilMaskSeparate:(n,e,t)=>n({[e===1028?2968:36005]:t}),stencilFunc:(n,e,t,r)=>n({2962:e,2967:t,2963:r,34816:e,36003:t,36004:r}),stencilFuncSeparate:(n,e,t,r,i)=>n({[e===1028?2962:34816]:t,[e===1028?2967:36003]:r,[e===1028?2963:36004]:i}),stencilOp:(n,e,t,r)=>n({2964:e,2965:t,2966:r,34817:e,34818:t,34819:r}),stencilOpSeparate:(n,e,t,r,i)=>n({[e===1028?2964:34817]:t,[e===1028?2965:34818]:r,[e===1028?2966:34819]:i}),viewport:(n,e,t,r,i)=>n({2978:[e,t,r,i]})},Uc=(n,e)=>n.isEnabled(e),gO={3042:Uc,2884:Uc,2929:Uc,3024:Uc,32823:Uc,32926:Uc,32928:Uc,3089:Uc,2960:Uc,35977:Uc};function mO(n){for(const e in n)return!1;return!0}function $G(n,e){if(n===e)return!0;const t=Array.isArray(n)||ArrayBuffer.isView(n),r=Array.isArray(e)||ArrayBuffer.isView(e);if(t&&r&&n.length===e.length){for(let i=0;i{}}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.gl=e,this.program=null,this.stateStack=[],this.enable=!0,this.cache=t?XG(e):Object.assign({},hS),this.log=r,this._updateCache=this._updateCache.bind(this),Object.seal(this)}push(){this.stateStack.push({})}pop(){va(this.stateStack.length>0);const e=this.stateStack[this.stateStack.length-1];Fl(this.gl,e),this.stateStack.pop()}_updateCache(e){let t=!1,r;const i=this.stateStack.length>0&&this.stateStack[this.stateStack.length-1];for(const o in e){va(o!==void 0);const a=e[o],l=this.cache[o];$G(a,l)||(t=!0,r=l,i&&!(o in i)&&(i[o]=l),this.cache[o]=a)}return{valueChanged:t,oldValue:r}}}function _O(n){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{enable:t=!0,copyState:r}=e;if(va(r!==void 0),!n.state){const{polyfillContext:i}=globalThis;i&&i(n),n.state=new KG(n,{copyState:r}),YG(n);for(const o in pO){const a=pO[o];WG(n,o,a)}yO(n,"getParameter"),yO(n,"isEnabled")}return n.state.enable=t,n}function ZG(n){n.state||_O(n,{copyState:!1}),n.state.push()}function vO(n){va(n.state),n.state.pop()}function Fl(n,e){if(va(Fb(n),"setParameters requires a WebGL context"),mO(e))return;const t={};for(const i in e){const o=Number(i),a=GG[i];a&&(typeof a=="string"?t[a]=!0:a(n,e[i],o))}const r=n.state&&n.state.cache;if(r)for(const i in t){const o=qG[i];o(n,e,r)}}function XG(n,e){if(e=e||hS,typeof e=="number"){const i=e,o=gO[i];return o?o(n,i):n.getParameter(i)}const t=Array.isArray(e)?e:Object.keys(e),r={};for(const i of t){const o=gO[i];r[i]=o?o(n,Number(i)):n.getParameter(Number(i))}return r}function QG(n){Fl(n,hS)}function fc(n,e,t){if(mO(e))return t(n);const{nocatch:r=!0}=e;ZG(n),Fl(n,e);let i;if(r)i=t(n),vO(n);else try{i=t(n)}finally{vO(n)}return i}function Tp(n){const{luma:e}=n;if(n.canvas&&e){const t=e.canvasSizeInfo,r="clientWidth"in t?t.clientWidth:n.canvas.clientWidth;return r?n.drawingBufferWidth/r:1}return 1}function dS(n,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;const r=Tp(n),i=n.drawingBufferWidth,o=n.drawingBufferHeight;return eq(e,r,i,o,t)}function JG(n){const e=typeof window>"u"?1:window.devicePixelRatio||1;return Number.isFinite(n)?n<=0?1:n:n?e:1}function eq(n,e,t,r,i){const o=bO(n[0],e,t);let a=wO(n[1],e,r,i),l=bO(n[0]+1,e,t);const h=l===t-1?l:l-1;l=wO(n[1]+1,e,r,i);let p;return i?(l=l===0?l:l+1,p=a,a=l):p=l===r-1?l:l-1,{x:o,y:a,width:Math.max(h-o+1,1),height:Math.max(p-a+1,1)}}function bO(n,e,t){return Math.min(Math.round(n*e),t-1)}function wO(n,e,t,r){return r?Math.max(0,t-1-Math.round(n*e)):Math.min(Math.round(n*e),t-1)}const fS=Dl(),tq=fS&&typeof document<"u",xO={webgl2:!0,webgl1:!0,throwOnError:!0,manageState:!0,canvas:null,debug:!1,width:800,height:600};function EO(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};va(fS,`createGLContext only available in the browser. Create your own headless context or use 'createHeadlessContext' from @luma.gl/test-utils`),n=Object.assign({},xO,n);const{width:e,height:t}=n;function r(l){if(n.throwOnError)throw new Error(l);return console.error(l),null}n.onError=r;let i;const{canvas:o}=n,a=oq({canvas:o,width:e,height:t,onError:r});return i=iq(a,n),i?(i=pS(i,n),aq(i),i):null}function pS(n){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!n||n._instrumented)return n;n._version=n._version||sq(n),n.luma=n.luma||{},n.luma.canvasSizeInfo=n.luma.canvasSizeInfo||{},e=Object.assign({},xO,e);const{manageState:t,debug:r}=e;return t&&_O(n,{copyState:!1,log:function(){for(var i=arguments.length,o=new Array(i),a=0;a1&&arguments[1]!==void 0?arguments[1]:{};if(n.canvas){const r=JG(e.useDevicePixels);cq(n,r,e);return}const t=n.getExtension("STACKGL_resize_drawingbuffer");t&&"width"in e&&"height"in e&&t.resize(e.width,e.height)}function iq(n,e){const{onError:t}=e;let r=null;const i=h=>r=h.statusMessage||r;n.addEventListener("webglcontextcreationerror",i,!1);const{webgl1:o=!0,webgl2:a=!0}=e;let l=null;return a&&(l=l||n.getContext("webgl2",e),l=l||n.getContext("experimental-webgl2",e)),o&&(l=l||n.getContext("webgl",e),l=l||n.getContext("experimental-webgl",e)),n.removeEventListener("webglcontextcreationerror",i,!1),l?(e.onContextLost&&n.addEventListener("webglcontextlost",e.onContextLost,!1),e.onContextRestored&&n.addEventListener("webglcontextrestored",e.onContextRestored,!1),l):t("Failed to create ".concat(a&&!o?"WebGL2":"WebGL"," context: ").concat(r||"Unknown error"))}function oq(n){let{canvas:e,width:t=800,height:r=600,onError:i}=n,o;return typeof e=="string"?(tq&&document.readyState==="complete"||i("createGLContext called on canvas '".concat(e,"' before page was loaded")),o=document.getElementById(e)):e?o=e:(o=document.createElement("canvas"),o.id="lumagl-canvas",o.style.width=Number.isFinite(t)?"".concat(t,"px"):"100%",o.style.height=Number.isFinite(r)?"".concat(r,"px"):"100%",document.body.insertBefore(o,document.body.firstChild)),o}function aq(n){const e=yr(n)?"WebGL2":"WebGL1",t=nq(n),r=t?"(".concat(t.vendor,",").concat(t.renderer,")"):"",i=n.debug?" debug":"";Tn.info(1,"".concat(e).concat(i," context ").concat(r))()}function sq(n){return typeof WebGL2RenderingContext<"u"&&n instanceof WebGL2RenderingContext?2:1}function cq(n,e,t){let r="width"in t?t.width:n.canvas.clientWidth,i="height"in t?t.height:n.canvas.clientHeight;(!r||!i)&&(Tn.log(1,"Canvas clientWidth/clientHeight is 0")(),e=1,r=n.canvas.width||1,i=n.canvas.height||1),n.luma=n.luma||{},n.luma.canvasSizeInfo=n.luma.canvasSizeInfo||{};const o=n.luma.canvasSizeInfo;if(o.clientWidth!==r||o.clientHeight!==i||o.devicePixelRatio!==e){let a=e;const l=Math.floor(r*a),h=Math.floor(i*a);n.canvas.width=l,n.canvas.height=h,(n.drawingBufferWidth!==l||n.drawingBufferHeight!==h)&&(Tn.warn("Device pixel ratio clamped")(),a=Math.min(n.drawingBufferWidth/r,n.drawingBufferHeight/i),n.canvas.width=Math.floor(r*a),n.canvas.height=Math.floor(i*a)),Object.assign(n.luma.canvasSizeInfo,{clientWidth:r,clientHeight:i,devicePixelRatio:e})}}const By="8.5.21",lq="set luma.log.level=1 (or higher) to trace rendering";class uq{constructor(){this.stats=new Map}get(e){return this.stats.has(e)||this.stats.set(e,new WT({id:e})),this.stats.get(e)}}const Ed=new uq;if(globalThis.luma&&globalThis.luma.VERSION!==By)throw new Error("luma.gl - multiple VERSIONs detected: ".concat(globalThis.luma.VERSION," vs ").concat(By));globalThis.luma||(Dl()&&Tn.log(1,"luma.gl ".concat(By," - ").concat(lq))(),globalThis.luma=globalThis.luma||{VERSION:By,version:By,log:Tn,stats:Ed,globals:{modules:{},nodeIO:{}}});function hq(n){return typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame(n):setTimeout(n,1e3/60)}function dq(n){return typeof window<"u"&&window.cancelAnimationFrame?window.cancelAnimationFrame(n):clearTimeout(n)}function Xt(n,e){if(!n)throw new Error(e||"luma.gl: assertion failed.")}function gS(n,e){if(typeof e!="string")return e;const t=Number(e);if(!isNaN(t))return t;e=e.replace(/^.*\./,"");const r=n[e];return Xt(r!==void 0,"Accessing undefined constant GL.".concat(e)),r}function Vu(n,e){e=Number(e);for(const t in n)if(n[t]===e)return"GL.".concat(t);return String(e)}const mS={};function Hu(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"id";mS[n]=mS[n]||1;const e=mS[n]++;return"".concat(n,"-").concat(e)}function TO(n){return Xt(typeof n=="number","Input must be a number"),n&&(n&n-1)===0}function Sp(n){let e=!0;for(const t in n){e=!1;break}return e}function SO(n,e,t,r){const i="See luma.gl ".concat(t," Upgrade Guide at https://luma.gl/docs/upgrade-guide"),o=Object.getPrototypeOf(n);r.forEach(a=>{o.methodName||(o[a]=()=>{throw Tn.removed("Calling removed method ".concat(e,".").concat(a,": "),i)(),new Error(a)})})}const Cp="Resource subclass must define virtual methods";let Bl=class{get[Symbol.toStringTag](){return"Resource"}constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Bb(e);const{id:r,userData:i={}}=t;this.gl=e,this.gl2=e,this.id=r||Hu(this[Symbol.toStringTag]),this.userData=i,this._bound=!1,this._handle=t.handle,this._handle===void 0&&(this._handle=this._createHandle()),this.byteLength=0,this._addStats()}toString(){return"".concat(this[Symbol.toStringTag]||this.constructor.name,"(").concat(this.id,")")}get handle(){return this._handle}delete(){let{deleteChildren:e=!1}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const t=this._handle&&this._deleteHandle(this._handle);return this._handle&&this._removeStats(),this._handle=null,t&&e&&t.filter(Boolean).forEach(r=>r.delete()),this}bind(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.handle;if(typeof e!="function")return this._bindHandle(e),this;let t;return this._bound?t=e():(this._bindHandle(this.handle),this._bound=!0,t=e(),this._bound=!1,this._bindHandle(null)),t}unbind(){this.bind(null)}getParameter(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};e=gS(this.gl,e),Xt(e);const i=(this.constructor.PARAMETERS||{})[e];if(i){const o=yr(this.gl);if(!((!("webgl2"in i)||o)&&(!("extension"in i)||this.gl.getExtension(i.extension)))){const l=i.webgl1,h="webgl2"in i?i.webgl2:i.webgl1;return o?h:l}}return this._getParameter(e,t)}getParameters(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const{parameters:t,keys:r}=e,i=this.constructor.PARAMETERS||{},o=yr(this.gl),a={},l=t||Object.keys(i);for(const h of l){const p=i[h];if(p&&(!("webgl2"in p)||o)&&(!("extension"in p)||this.gl.getExtension(p.extension))){const _=r?Vu(this.gl,h):h;a[_]=this.getParameter(h,e),r&&p.type==="GLenum"&&(a[_]=Vu(this.gl,a[_]))}}return a}setParameter(e,t){e=gS(this.gl,e),Xt(e);const i=(this.constructor.PARAMETERS||{})[e];if(i){const o=yr(this.gl);if(!((!("webgl2"in i)||o)&&(!("extension"in i)||this.gl.getExtension(i.extension))))throw new Error("Parameter not available on this platform");i.type==="GLenum"&&(t=gS(t))}return this._setParameter(e,t),this}setParameters(e){for(const t in e)this.setParameter(t,e[t]);return this}stubRemovedMethods(e,t,r){return SO(this,e,t,r)}initialize(e){}_createHandle(){throw new Error(Cp)}_deleteHandle(){throw new Error(Cp)}_bindHandle(e){throw new Error(Cp)}_getOptsFromHandle(){throw new Error(Cp)}_getParameter(e,t){throw new Error(Cp)}_setParameter(e,t){throw new Error(Cp)}_context(){return this.gl.luma=this.gl.luma||{},this.gl.luma}_addStats(){const e=this[Symbol.toStringTag],t=Ed.get("Resource Counts");t.get("Resources Created").incrementCount(),t.get("".concat(e,"s Created")).incrementCount(),t.get("".concat(e,"s Active")).incrementCount()}_removeStats(){const e=this[Symbol.toStringTag];Ed.get("Resource Counts").get("".concat(e,"s Active")).decrementCount()}_trackAllocatedMemory(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this[Symbol.toStringTag];this._trackAllocatedMemoryForContext(e,t),this._trackAllocatedMemoryForContext(e,t,this.gl.canvas&&this.gl.canvas.id),this.byteLength=e}_trackAllocatedMemoryForContext(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this[Symbol.toStringTag],r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"";const i=Ed.get("Memory Usage".concat(r));i.get("GPU Memory").addCount(e),i.get("".concat(t," Memory")).addCount(e)}_trackDeallocatedMemory(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this[Symbol.toStringTag];this._trackDeallocatedMemoryForContext(e),this._trackDeallocatedMemoryForContext(e,this.gl.canvas&&this.gl.canvas.id),this.byteLength=0}_trackDeallocatedMemoryForContext(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this[Symbol.toStringTag],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const r=Ed.get("Memory Usage".concat(t));r.get("GPU Memory").subtractCount(this.byteLength),r.get("".concat(e," Memory")).subtractCount(this.byteLength)}};const fq="Failed to deduce GL constant from typed array";function yS(n){switch(ArrayBuffer.isView(n)?n.constructor:n){case Float32Array:return 5126;case Uint16Array:return 5123;case Uint32Array:return 5125;case Uint8Array:return 5121;case Uint8ClampedArray:return 5121;case Int8Array:return 5120;case Int16Array:return 5122;case Int32Array:return 5124;default:throw new Error(fq)}}function Uy(n){let{clamped:e=!0}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};switch(n){case 5126:return Float32Array;case 5123:case 33635:case 32819:case 32820:return Uint16Array;case 5125:return Uint32Array;case 5121:return e?Uint8ClampedArray:Uint8Array;case 5120:return Int8Array;case 5122:return Int16Array;case 5124:return Int32Array;default:throw new Error("Failed to deduce typed array type from GL constant")}}function pq(n){let{data:e,width:t,height:r,bytesPerPixel:i=4,temp:o}=n;const a=t*i;o=o||new Uint8Array(a);for(let l=0;lthis._assign(i)),Object.freeze(this)}toString(){return JSON.stringify(this)}get BYTES_PER_ELEMENT(){return ds.getBytesPerElement(this)}get BYTES_PER_VERTEX(){return ds.getBytesPerVertex(this)}_assign(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return e=_S("Accessor",e,yq),e.type!==void 0&&(this.type=e.type,(e.type===5124||e.type===5125)&&(this.integer=!0)),e.size!==void 0&&(this.size=e.size),e.offset!==void 0&&(this.offset=e.offset),e.stride!==void 0&&(this.stride=e.stride),e.normalized!==void 0&&(this.normalized=e.normalized),e.integer!==void 0&&(this.integer=e.integer),e.divisor!==void 0&&(this.divisor=e.divisor),e.buffer!==void 0&&(this.buffer=e.buffer),e.index!==void 0&&(typeof e.index=="boolean"?this.index=e.index?1:0:this.index=e.index),e.instanced!==void 0&&(this.divisor=e.instanced?1:0),e.isInstanced!==void 0&&(this.divisor=e.isInstanced?1:0),this}}const CO=10,AO={offset:"accessor.offset",stride:"accessor.stride",type:"accessor.type",size:"accessor.size",divisor:"accessor.divisor",normalized:"accessor.normalized",integer:"accessor.integer",instanced:"accessor.divisor",isInstanced:"accessor.divisor"},_q={removedProps:{},replacedProps:{bytes:"byteLength"},deprecatedProps:AO},vq={removedProps:AO};class ni extends Bl{get[Symbol.toStringTag](){return"Buffer"}constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(e,t),this.stubRemovedMethods("Buffer","v6.0",["layout","setLayout","getIndexedParameter"]),this.target=t.target||(this.gl.webgl2?36662:34962),this.initialize(t),Object.seal(this)}getElementCount(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.accessor;return Math.round(this.byteLength/ds.getBytesPerElement(e))}getVertexCount(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.accessor;return Math.round(this.byteLength/ds.getBytesPerVertex(e))}initialize(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return ArrayBuffer.isView(e)&&(e={data:e}),Number.isFinite(e)&&(e={byteLength:e}),e=_S("Buffer",e,_q),this.usage=e.usage||35044,this.debugData=null,this.setAccessor(Object.assign({},e,e.accessor)),e.data?this._setData(e.data,e.offset,e.byteLength):this._setByteLength(e.byteLength||0),this}setProps(e){return e=_S("Buffer",e,vq),"accessor"in e&&this.setAccessor(e.accessor),this}setAccessor(e){return e=Object.assign({},e),delete e.buffer,this.accessor=new ds(e),this}reallocate(e){return e>this.byteLength?(this._setByteLength(e),!0):(this.bytesUsed=e,!1)}setData(e){return this.initialize(e)}subData(e){ArrayBuffer.isView(e)&&(e={data:e});const{data:t,offset:r=0,srcOffset:i=0}=e,o=e.byteLength||e.length;Xt(t);const a=this.gl.webgl2?36663:this.target;return this.gl.bindBuffer(a,this.handle),i!==0||o!==void 0?(aa(this.gl),this.gl.bufferSubData(this.target,r,t,i,o)):this.gl.bufferSubData(a,r,t),this.gl.bindBuffer(a,null),this.debugData=null,this._inferType(t),this}copyData(e){let{sourceBuffer:t,readOffset:r=0,writeOffset:i=0,size:o}=e;const{gl:a}=this;return aa(a),a.bindBuffer(36662,t.handle),a.bindBuffer(36663,this.handle),a.copyBufferSubData(36662,36663,r,i,o),a.bindBuffer(36662,null),a.bindBuffer(36663,null),this.debugData=null,this}getData(){let{dstData:e=null,srcByteOffset:t=0,dstOffset:r=0,length:i=0}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};aa(this.gl);const o=Uy(this.accessor.type||5126,{clamped:!1}),a=this._getAvailableElementCount(t),l=r;let h,p;e?(p=e.length,h=p-l):(h=Math.min(a,i||a),p=l+h);const g=Math.min(a,h);return i=i||g,Xt(i<=g),e=e||new o(p),this.gl.bindBuffer(36662,this.handle),this.gl.getBufferSubData(36662,t,e,r,i),this.gl.bindBuffer(36662,null),e}bind(){let{target:e=this.target,index:t=this.accessor&&this.accessor.index,offset:r=0,size:i}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return e===35345||e===35982?i!==void 0?this.gl.bindBufferRange(e,t,this.handle,r,i):(Xt(r===0),this.gl.bindBufferBase(e,t,this.handle)):this.gl.bindBuffer(e,this.handle),this}unbind(){let{target:e=this.target,index:t=this.accessor&&this.accessor.index}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return e===35345||e===35982?this.gl.bindBufferBase(e,t,null):this.gl.bindBuffer(e,null),this}getDebugData(){return this.debugData?{data:this.debugData,changed:!1}:(this.debugData=this.getData({length:Math.min(CO,this.byteLength)}),{data:this.debugData,changed:!0})}invalidateDebugData(){this.debugData=null}_setData(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.byteLength+t;Xt(ArrayBuffer.isView(e)),this._trackDeallocatedMemory();const i=this._getTarget();this.gl.bindBuffer(i,this.handle),this.gl.bufferData(i,r,this.usage),this.gl.bufferSubData(i,t,e),this.gl.bindBuffer(i,null),this.debugData=e.slice(0,CO),this.bytesUsed=r,this._trackAllocatedMemory(r);const o=yS(e);return Xt(o),this.setAccessor(new ds(this.accessor,{type:o})),this}_setByteLength(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.usage;Xt(e>=0),this._trackDeallocatedMemory();let r=e;e===0&&(r=new Float32Array(0));const i=this._getTarget();return this.gl.bindBuffer(i,this.handle),this.gl.bufferData(i,r,t),this.gl.bindBuffer(i,null),this.usage=t,this.debugData=null,this.bytesUsed=e,this._trackAllocatedMemory(e),this}_getTarget(){return this.gl.webgl2?36663:this.target}_getAvailableElementCount(e){const t=Uy(this.accessor.type||5126,{clamped:!1}),r=e/t.BYTES_PER_ELEMENT;return this.getElementCount()-r}_inferType(e){this.accessor.type||this.setAccessor(new ds(this.accessor,{type:yS(e)}))}_createHandle(){return this.gl.createBuffer()}_deleteHandle(){this.gl.deleteBuffer(this.handle),this._trackDeallocatedMemory()}_getParameter(e){this.gl.bindBuffer(this.target,this.handle);const t=this.gl.getBufferParameter(this.target,e);return this.gl.bindBuffer(this.target,null),t}get type(){return Tn.deprecated("Buffer.type","Buffer.accessor.type")(),this.accessor.type}get bytes(){return Tn.deprecated("Buffer.bytes","Buffer.byteLength")(),this.byteLength}setByteLength(e){return Tn.deprecated("setByteLength","reallocate")(),this.reallocate(e)}updateAccessor(e){return Tn.deprecated("updateAccessor(...)","setAccessor(new Accessor(buffer.accessor, ...)")(),this.accessor=new ds(this.accessor,e),this}}const vS={6407:{dataFormat:6407,types:[5121,33635]},6408:{dataFormat:6408,types:[5121,32819,32820]},6406:{dataFormat:6406,types:[5121]},6409:{dataFormat:6409,types:[5121]},6410:{dataFormat:6410,types:[5121]},33326:{dataFormat:6403,types:[5126],gl2:!0},33328:{dataFormat:33319,types:[5126],gl2:!0},34837:{dataFormat:6407,types:[5126],gl2:!0},34836:{dataFormat:6408,types:[5126],gl2:!0}},IO={6403:1,36244:1,33319:2,33320:2,6407:3,36248:3,6408:4,36249:4,6402:1,34041:1,6406:1,6409:1,6410:2},PO={5126:4,5125:4,5124:4,5123:2,5122:2,5131:2,5120:1,5121:1};function bq(n,e){const t=vS[e];if(!t)return!1;if(t.gl1===void 0&&t.gl2===void 0)return!0;const r=yr(n)&&t.gl2||t.gl1;return typeof r=="string"?n.getExtension(r):r}function wq(n,e){const t=vS[e];switch(t&&t.types[0]){case 5126:return n.getExtension("OES_texture_float_linear");case 5131:return n.getExtension("OES_texture_half_float_linear");default:return!0}}const xq=[9729,9728],MO=globalThis.WebGLBuffer||function(){};class Td extends Bl{get[Symbol.toStringTag](){return"Texture"}static isSupported(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{format:r,linearFiltering:i}=t;let o=!0;return r&&(o=o&&bq(e,r),o=o&&(!i||wq(e,r))),o}constructor(e,t){const{id:r=Hu("texture"),handle:i,target:o}=t;super(e,{id:r,handle:i}),this.target=o,this.textureUnit=void 0,this.loaded=!1,this.width=void 0,this.height=void 0,this.depth=void 0,this.format=void 0,this.type=void 0,this.dataFormat=void 0,this.border=void 0,this.textureUnit=void 0,this.mipmaps=void 0}toString(){return"Texture(".concat(this.id,",").concat(this.width,"x").concat(this.height,")")}initialize(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.data;if(t instanceof Promise)return t.then(ee=>this.initialize(Object.assign({},e,{pixels:ee,data:ee}))),this;const r=typeof HTMLVideoElement<"u"&&t instanceof HTMLVideoElement;if(r&&t.readyStatethis.initialize(e)),this;const{pixels:i=null,format:o=6408,border:a=0,recreate:l=!1,parameters:h={},pixelStore:p={},textureUnit:g=void 0}=e;t||(t=i);let{width:_,height:x,dataFormat:C,type:M,compressed:L=!1,mipmaps:F=!0}=e;const{depth:z=0}=e;return{width:_,height:x,compressed:L,dataFormat:C,type:M}=this._deduceParameters({format:o,type:M,dataFormat:C,compressed:L,data:t,width:_,height:x}),this.width=_,this.height=x,this.depth=z,this.format=o,this.type=M,this.dataFormat=C,this.border=a,this.textureUnit=g,Number.isFinite(this.textureUnit)&&(this.gl.activeTexture(33984+this.textureUnit),this.gl.bindTexture(this.target,this.handle)),F&&this._isNPOT()&&(Tn.warn("texture: ".concat(this," is Non-Power-Of-Two, disabling mipmaping"))(),F=!1,this._updateForNPOT(h)),this.mipmaps=F,this.setImageData({data:t,width:_,height:x,depth:z,format:o,type:M,dataFormat:C,border:a,mipmaps:F,parameters:p,compressed:L}),F&&this.generateMipmap(),this.setParameters(h),l&&(this.data=t),r&&(this._video={video:t,parameters:h,lastTime:t.readyState>=HTMLVideoElement.HAVE_CURRENT_DATA?t.currentTime:-1}),this}update(){if(this._video){const{video:e,parameters:t,lastTime:r}=this._video;if(r===e.currentTime||e.readyState0&&arguments[0]!==void 0?arguments[0]:{};return this._isNPOT()?(Tn.warn("texture: ".concat(this," is Non-Power-Of-Two, disabling mipmaping"))(),this):(this.mipmaps=!0,this.gl.bindTexture(this.target,this.handle),fc(this.gl,e,()=>{this.gl.generateMipmap(this.target)}),this.gl.bindTexture(this.target,null),this)}setImageData(e){this._trackDeallocatedMemory("Texture");const{target:t=this.target,pixels:r=null,level:i=0,format:o=this.format,border:a=this.border,offset:l=0,parameters:h={}}=e;let{data:p=null,type:g=this.type,width:_=this.width,height:x=this.height,dataFormat:C=this.dataFormat,compressed:M=!1}=e;p||(p=r),{type:g,dataFormat:C,compressed:M,width:_,height:x}=this._deduceParameters({format:o,type:g,dataFormat:C,compressed:M,data:p,width:_,height:x});const{gl:L}=this;L.bindTexture(this.target,this.handle);let F=null;({data:p,dataType:F}=this._getDataType({data:p,compressed:M}));let z,ee=0;if(fc(this.gl,h,()=>{switch(F){case"null":L.texImage2D(t,i,o,_,x,a,C,g,p);break;case"typed-array":L.texImage2D(t,i,o,_,x,a,C,g,p,l);break;case"buffer":z=aa(L),z.bindBuffer(35052,p.handle||p),z.texImage2D(t,i,o,_,x,a,C,g,l),z.bindBuffer(35052,null);break;case"browser-object":yr(L)?L.texImage2D(t,i,o,_,x,a,C,g,p):L.texImage2D(t,i,o,C,g,p);break;case"compressed":for(const[ce,se]of p.entries())L.compressedTexImage2D(t,ce,se.format,se.width,se.height,a,se.data),ee+=se.levelSize;break;default:Xt(!1,"Unknown image data type")}}),F==="compressed")this._trackAllocatedMemory(ee,"Texture");else if(p&&p.byteLength)this._trackAllocatedMemory(p.byteLength,"Texture");else{const ce=IO[this.dataFormat]||4,se=PO[this.type]||1;this._trackAllocatedMemory(this.width*this.height*ce*se,"Texture")}return this.loaded=!0,this}setSubImageData(e){let{target:t=this.target,pixels:r=null,data:i=null,x:o=0,y:a=0,width:l=this.width,height:h=this.height,level:p=0,format:g=this.format,type:_=this.type,dataFormat:x=this.dataFormat,compressed:C=!1,offset:M=0,border:L=this.border,parameters:F={}}=e;if({type:_,dataFormat:x,compressed:C,width:l,height:h}=this._deduceParameters({format:g,type:_,dataFormat:x,compressed:C,data:i,width:l,height:h}),Xt(this.depth===0,"texSubImage not supported for 3D textures"),i||(i=r),i&&i.data){const z=i;i=z.data,l=z.shape[0],h=z.shape[1]}i instanceof ni&&(i=i.handle),this.gl.bindTexture(this.target,this.handle),fc(this.gl,F,()=>{if(C)this.gl.compressedTexSubImage2D(t,p,o,a,l,h,g,i);else if(i===null)this.gl.texSubImage2D(t,p,o,a,l,h,x,_,null);else if(ArrayBuffer.isView(i))this.gl.texSubImage2D(t,p,o,a,l,h,x,_,i,M);else if(i instanceof MO){const z=aa(this.gl);z.bindBuffer(35052,i),z.texSubImage2D(t,p,o,a,l,h,x,_,M),z.bindBuffer(35052,null)}else yr(this.gl)?aa(this.gl).texSubImage2D(t,p,o,a,l,h,x,_,i):this.gl.texSubImage2D(t,p,o,a,x,_,i)}),this.gl.bindTexture(this.target,null)}copyFramebuffer(){return Tn.error("Texture.copyFramebuffer({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null}getActiveUnit(){return this.gl.getParameter(34016)-33984}bind(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.textureUnit;const{gl:t}=this;return e!==void 0&&(this.textureUnit=e,t.activeTexture(33984+e)),t.bindTexture(this.target,this.handle),e}unbind(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.textureUnit;const{gl:t}=this;return e!==void 0&&(this.textureUnit=e,t.activeTexture(33984+e)),t.bindTexture(this.target,null),e}_getDataType(e){let{data:t,compressed:r=!1}=e;return r?{data:t,dataType:"compressed"}:t===null?{data:t,dataType:"null"}:ArrayBuffer.isView(t)?{data:t,dataType:"typed-array"}:t instanceof ni?{data:t.handle,dataType:"buffer"}:t instanceof MO?{data:t,dataType:"buffer"}:{data:t,dataType:"browser-object"}}_deduceParameters(e){const{format:t,data:r}=e;let{width:i,height:o,dataFormat:a,type:l,compressed:h}=e;const p=vS[t];return a=a||p&&p.dataFormat,l=l||p&&p.types[0],h=h||p&&p.compressed,{width:i,height:o}=this._deduceImageSize(r,i,o),{dataFormat:a,type:l,compressed:h,width:i,height:o,format:t,data:r}}_deduceImageSize(e,t,r){let i;return typeof ImageData<"u"&&e instanceof ImageData?i={width:e.width,height:e.height}:typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement?i={width:e.naturalWidth,height:e.naturalHeight}:typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement?i={width:e.width,height:e.height}:typeof ImageBitmap<"u"&&e instanceof ImageBitmap?i={width:e.width,height:e.height}:typeof HTMLVideoElement<"u"&&e instanceof HTMLVideoElement?i={width:e.videoWidth,height:e.videoHeight}:e?i={width:t,height:r}:i={width:t>=0?t:1,height:r>=0?r:1},Xt(i,"Could not deduced texture size"),Xt(t===void 0||i.width===t,"Deduced texture width does not match supplied width"),Xt(r===void 0||i.height===r,"Deduced texture height does not match supplied height"),i}_createHandle(){return this.gl.createTexture()}_deleteHandle(){this.gl.deleteTexture(this.handle),this._trackDeallocatedMemory("Texture")}_getParameter(e){switch(e){case 4096:return this.width;case 4097:return this.height;default:this.gl.bindTexture(this.target,this.handle);const t=this.gl.getTexParameter(this.target,e);return this.gl.bindTexture(this.target,null),t}}_setParameter(e,t){switch(this.gl.bindTexture(this.target,this.handle),t=this._getNPOTParam(e,t),e){case 33082:case 33083:this.gl.texParameterf(this.handle,e,t);break;case 4096:case 4097:Xt(!1);break;default:this.gl.texParameteri(this.target,e,t);break}return this.gl.bindTexture(this.target,null),this}_isNPOT(){return yr(this.gl)||!this.width||!this.height?!1:!TO(this.width)||!TO(this.height)}_updateForNPOT(e){e[this.gl.TEXTURE_MIN_FILTER]===void 0&&(e[this.gl.TEXTURE_MIN_FILTER]=this.gl.LINEAR),e[this.gl.TEXTURE_WRAP_S]===void 0&&(e[this.gl.TEXTURE_WRAP_S]=this.gl.CLAMP_TO_EDGE),e[this.gl.TEXTURE_WRAP_T]===void 0&&(e[this.gl.TEXTURE_WRAP_T]=this.gl.CLAMP_TO_EDGE)}_getNPOTParam(e,t){if(this._isNPOT())switch(e){case 10241:xq.indexOf(t)===-1&&(t=9729);break;case 10242:case 10243:t!==33071&&(t=33071);break}return t}}let Eq="";function Tq(n,e){return Xt(typeof n=="string"),n=Eq+n,new Promise((t,r)=>{try{const i=new Image;i.onload=()=>t(i),i.onerror=()=>r(new Error("Could not load image ".concat(n,"."))),i.crossOrigin=e&&e.crossOrigin||"anonymous",i.src=n}catch(i){r(i)}})}class fs extends Td{get[Symbol.toStringTag](){return"Texture2D"}static isSupported(e,t){return Td.isSupported(e,t)}constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Bb(e),(t instanceof Promise||typeof t=="string")&&(t={data:t}),typeof t.data=="string"&&(t=Object.assign({},t,{data:Tq(t.data)})),super(e,Object.assign({},t,{target:3553})),this.initialize(t),Object.seal(this)}}const bS=[34069,34070,34071,34072,34073,34074];class RO extends Td{get[Symbol.toStringTag](){return"TextureCube"}constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Bb(e),super(e,Object.assign({},t,{target:34067})),this.initialize(t),Object.seal(this)}initialize(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const{mipmaps:t=!0,parameters:r={}}=e;return this.opts=e,this.setCubeMapImageData(e).then(()=>{this.loaded=!0,t&&this.generateMipmap(e),this.setParameters(r)}),this}subImage(e){let{face:t,data:r,x:i=0,y:o=0,mipmapLevel:a=0}=e;return this._subImage({target:t,data:r,x:i,y:o,mipmapLevel:a})}async setCubeMapImageData(e){let{width:t,height:r,pixels:i,data:o,border:a=0,format:l=6408,type:h=5121}=e;const{gl:p}=this,g=i||o,_=await Promise.all(bS.map(x=>{const C=g[x];return Promise.all(Array.isArray(C)?C:[C])}));this.bind(),bS.forEach((x,C)=>{_[C].length>1&&this.opts.mipmaps!==!1&&Tn.warn("".concat(this.id," has mipmap and multiple LODs."))(),_[C].forEach((M,L)=>{t&&r?p.texImage2D(x,L,l,t,r,a,l,h,M):p.texImage2D(x,L,l,l,h,M)})}),this.unbind()}setImageDataForFace(e){const{face:t,width:r,height:i,pixels:o,data:a,border:l=0,format:h=6408,type:p=5121}=e,{gl:g}=this,_=o||a;return this.bind(),_ instanceof Promise?_.then(x=>this.setImageDataForFace(Object.assign({},e,{face:t,data:x,pixels:x}))):this.width||this.height?g.texImage2D(t,0,h,r,i,l,h,p,_):g.texImage2D(t,0,h,h,p,_),this}}RO.FACES=bS;class Sq extends Td{get[Symbol.toStringTag](){return"Texture3D"}static isSupported(e){return yr(e)}constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};aa(e),t=Object.assign({depth:1},t,{target:32879,unpackFlipY:!1}),super(e,t),this.initialize(t),Object.seal(this)}setImageData(e){let{level:t=0,dataFormat:r=6408,width:i,height:o,depth:a=1,border:l=0,format:h,type:p=5121,offset:g=0,data:_,parameters:x={}}=e;if(this._trackDeallocatedMemory("Texture"),this.gl.bindTexture(this.target,this.handle),fc(this.gl,x,()=>{ArrayBuffer.isView(_)&&this.gl.texImage3D(this.target,t,r,i,o,a,l,h,p,_),_ instanceof ni&&(this.gl.bindBuffer(35052,_.handle),this.gl.texImage3D(this.target,t,r,i,o,a,l,h,p,g))}),_&&_.byteLength)this._trackAllocatedMemory(_.byteLength,"Texture");else{const C=IO[this.dataFormat]||4,M=PO[this.type]||1;this._trackAllocatedMemory(this.width*this.height*this.depth*C*M,"Texture")}return this.loaded=!0,this}}const Sd="EXT_color_buffer_float",kO={33189:{bpp:2},33190:{gl2:!0,bpp:3},36012:{gl2:!0,bpp:4},36168:{bpp:1},34041:{bpp:4},35056:{gl2:!0,bpp:4},36013:{gl2:!0,bpp:5},32854:{bpp:2},36194:{bpp:2},32855:{bpp:2},33321:{gl2:!0,bpp:1},33330:{gl2:!0,bpp:1},33329:{gl2:!0,bpp:1},33332:{gl2:!0,bpp:2},33331:{gl2:!0,bpp:2},33334:{gl2:!0,bpp:4},33333:{gl2:!0,bpp:4},33323:{gl2:!0,bpp:2},33336:{gl2:!0,bpp:2},33335:{gl2:!0,bpp:2},33338:{gl2:!0,bpp:4},33337:{gl2:!0,bpp:4},33340:{gl2:!0,bpp:8},33339:{gl2:!0,bpp:8},32849:{gl2:!0,bpp:3},32856:{gl2:!0,bpp:4},32857:{gl2:!0,bpp:4},36220:{gl2:!0,bpp:4},36238:{gl2:!0,bpp:4},36975:{gl2:!0,bpp:4},36214:{gl2:!0,bpp:8},36232:{gl2:!0,bpp:8},36226:{gl2:!0,bpp:16},36208:{gl2:!0,bpp:16},33325:{gl2:Sd,bpp:2},33327:{gl2:Sd,bpp:4},34842:{gl2:Sd,bpp:8},33326:{gl2:Sd,bpp:4},33328:{gl2:Sd,bpp:8},34836:{gl2:Sd,bpp:16},35898:{gl2:Sd,bpp:4}};function Cq(n,e,t){const r=t[e];if(!r)return!1;const i=yr(n)&&r.gl2||r.gl1;return typeof i=="string"?n.getExtension(i):i}class Ap extends Bl{get[Symbol.toStringTag](){return"Renderbuffer"}static isSupported(e){let{format:t}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{format:null};return!t||Cq(e,t,kO)}static getSamplesForFormat(e,t){let{format:r}=t;return e.getInternalformatParameter(36161,r,32937)}constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(e,t),this.initialize(t),Object.seal(this)}initialize(e){let{format:t,width:r=1,height:i=1,samples:o=0}=e;return Xt(t,"Needs format"),this._trackDeallocatedMemory(),this.gl.bindRenderbuffer(36161,this.handle),o!==0&&yr(this.gl)?this.gl.renderbufferStorageMultisample(36161,o,t,r,i):this.gl.renderbufferStorage(36161,t,r,i),this.format=t,this.width=r,this.height=i,this.samples=o,this._trackAllocatedMemory(this.width*this.height*(this.samples||1)*kO[this.format].bpp),this}resize(e){let{width:t,height:r}=e;return t!==this.width||r!==this.height?this.initialize({width:t,height:r,format:this.format,samples:this.samples}):this}_createHandle(){return this.gl.createRenderbuffer()}_deleteHandle(){this.gl.deleteRenderbuffer(this.handle),this._trackDeallocatedMemory()}_bindHandle(e){this.gl.bindRenderbuffer(36161,e)}_syncHandle(e){this.format=this.getParameter(36164),this.width=this.getParameter(36162),this.height=this.getParameter(36163),this.samples=this.getParameter(36011)}_getParameter(e){return this.gl.bindRenderbuffer(36161,this.handle),this.gl.getRenderbufferParameter(36161,e)}}const Aq=256,Iq=1024,Pq=16384,OO=6144,LO=6145,NO=6146,DO=34041,FO="clear: bad arguments";function wS(n){let{framebuffer:e=null,color:t=null,depth:r=null,stencil:i=null}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const o={};e&&(o.framebuffer=e);let a=0;t&&(a|=Pq,t!==!0&&(o.clearColor=t)),r&&(a|=Aq,r!==!0&&(o.clearDepth=r)),i&&(a|=Iq,r!==!0&&(o.clearStencil=r)),Xt(a!==0,FO),fc(n,o,()=>{n.clear(a)})}function Mq(n){let{framebuffer:e=null,buffer:t=OO,drawBuffer:r=0,value:i=[0,0,0,0]}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};aa(n),fc(n,{framebuffer:e},()=>{switch(t){case OO:switch(i.constructor){case Int32Array:n.clearBufferiv(t,r,i);break;case Uint32Array:n.clearBufferuiv(t,r,i);break;case Float32Array:default:n.clearBufferfv(t,r,i)}break;case LO:n.clearBufferfv(LO,0,[i]);break;case NO:n.clearBufferiv(NO,0,[i]);break;case DO:const[o,a]=i;n.clearBufferfi(DO,0,o,a);break;default:Xt(!1,FO)}})}function Rq(n){switch(n){case 6406:case 33326:case 6403:return 1;case 33328:case 33319:return 2;case 6407:case 34837:return 3;case 6408:case 34836:return 4;default:return Xt(!1),0}}function Ub(n){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{sourceX:t=0,sourceY:r=0,sourceFormat:i=6408}=e;let{sourceAttachment:o=36064,target:a=null,sourceWidth:l,sourceHeight:h,sourceType:p}=e;const{framebuffer:g,deleteFramebuffer:_}=UO(n);Xt(g);const{gl:x,handle:C,attachments:M}=g;l=l||g.width,h=h||g.height,o===36064&&C===null&&(o=1028),Xt(M[o]),p=p||M[o].type,a=Oq(a,p,i,l,h),p=p||yS(a);const L=x.bindFramebuffer(36160,C);return x.readPixels(t,r,l,h,i,p,a),x.bindFramebuffer(36160,L||null),_&&g.delete(),a}function BO(n){let{sourceAttachment:e=36064,targetMaxHeight:t=Number.MAX_SAFE_INTEGER}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=Ub(n,{sourceAttachment:e}),{width:i,height:o}=n;for(;o>t;)({data:r,width:i,height:o}=gq({data:r,width:i,height:o}));pq({data:r,width:i,height:o});const a=document.createElement("canvas");a.width=i,a.height=o;const l=a.getContext("2d"),h=l.createImageData(i,o);return h.data.set(r),l.putImageData(h,0,0),a.toDataURL()}function kq(n,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const{sourceX:r=0,sourceY:i=0,targetMipmaplevel:o=0,targetInternalFormat:a=6408}=t;let{targetX:l,targetY:h,targetZ:p,width:g,height:_}=t;const{framebuffer:x,deleteFramebuffer:C}=UO(n);Xt(x);const{gl:M,handle:L}=x,F=typeof l<"u"||typeof h<"u"||typeof p<"u";l=l||0,h=h||0,p=p||0;const z=M.bindFramebuffer(36160,L);Xt(e);let ee=null;if(e instanceof Td&&(ee=e,g=Number.isFinite(g)?g:ee.width,_=Number.isFinite(_)?_:ee.height,ee.bind(0),e=ee.target),!F)M.copyTexImage2D(e,o,a,r,i,g,_,0);else switch(e){case 3553:case 34067:M.copyTexSubImage2D(e,o,l,h,r,i,g,_);break;case 35866:case 32879:aa(M).copyTexSubImage3D(e,o,l,h,p,r,i,g,_);break}return ee&&ee.unbind(),M.bindFramebuffer(36160,z||null),C&&x.delete(),ee}function UO(n){return n instanceof _o?{framebuffer:n,deleteFramebuffer:!1}:{framebuffer:Hq(n),deleteFramebuffer:!0}}function Oq(n,e,t,r,i){if(n)return n;e=e||5121;const o=Uy(e,{clamped:!1}),a=Rq(t);return new o(r*i*a)}const Ri={WEBGL2:"WEBGL2",VERTEX_ARRAY_OBJECT:"VERTEX_ARRAY_OBJECT",TIMER_QUERY:"TIMER_QUERY",INSTANCED_RENDERING:"INSTANCED_RENDERING",MULTIPLE_RENDER_TARGETS:"MULTIPLE_RENDER_TARGETS",ELEMENT_INDEX_UINT32:"ELEMENT_INDEX_UINT32",BLEND_EQUATION_MINMAX:"BLEND_EQUATION_MINMAX",FLOAT_BLEND:"FLOAT_BLEND",COLOR_ENCODING_SRGB:"COLOR_ENCODING_SRGB",TEXTURE_DEPTH:"TEXTURE_DEPTH",TEXTURE_FLOAT:"TEXTURE_FLOAT",TEXTURE_HALF_FLOAT:"TEXTURE_HALF_FLOAT",TEXTURE_FILTER_LINEAR_FLOAT:"TEXTURE_FILTER_LINEAR_FLOAT",TEXTURE_FILTER_LINEAR_HALF_FLOAT:"TEXTURE_FILTER_LINEAR_HALF_FLOAT",TEXTURE_FILTER_ANISOTROPIC:"TEXTURE_FILTER_ANISOTROPIC",COLOR_ATTACHMENT_RGBA32F:"COLOR_ATTACHMENT_RGBA32F",COLOR_ATTACHMENT_FLOAT:"COLOR_ATTACHMENT_FLOAT",COLOR_ATTACHMENT_HALF_FLOAT:"COLOR_ATTACHMENT_HALF_FLOAT",GLSL_FRAG_DATA:"GLSL_FRAG_DATA",GLSL_FRAG_DEPTH:"GLSL_FRAG_DEPTH",GLSL_DERIVATIVES:"GLSL_DERIVATIVES",GLSL_TEXTURE_LOD:"GLSL_TEXTURE_LOD"};function Lq(n){const e=new fs(n,{format:6408,type:5126,dataFormat:6408}),t=new _o(n,{id:"test-framebuffer",check:!1,attachments:{36064:e}}),r=t.getStatus();return e.delete(),t.delete(),r===36053}const zO={[Ri.WEBGL2]:[!1,!0],[Ri.VERTEX_ARRAY_OBJECT]:["OES_vertex_array_object",!0],[Ri.TIMER_QUERY]:["EXT_disjoint_timer_query","EXT_disjoint_timer_query_webgl2"],[Ri.INSTANCED_RENDERING]:["ANGLE_instanced_arrays",!0],[Ri.MULTIPLE_RENDER_TARGETS]:["WEBGL_draw_buffers",!0],[Ri.ELEMENT_INDEX_UINT32]:["OES_element_index_uint",!0],[Ri.BLEND_EQUATION_MINMAX]:["EXT_blend_minmax",!0],[Ri.FLOAT_BLEND]:["EXT_float_blend"],[Ri.COLOR_ENCODING_SRGB]:["EXT_sRGB",!0],[Ri.TEXTURE_DEPTH]:["WEBGL_depth_texture",!0],[Ri.TEXTURE_FLOAT]:["OES_texture_float",!0],[Ri.TEXTURE_HALF_FLOAT]:["OES_texture_half_float",!0],[Ri.TEXTURE_FILTER_LINEAR_FLOAT]:["OES_texture_float_linear"],[Ri.TEXTURE_FILTER_LINEAR_HALF_FLOAT]:["OES_texture_half_float_linear"],[Ri.TEXTURE_FILTER_ANISOTROPIC]:["EXT_texture_filter_anisotropic"],[Ri.COLOR_ATTACHMENT_RGBA32F]:[Lq,"EXT_color_buffer_float"],[Ri.COLOR_ATTACHMENT_FLOAT]:[!1,"EXT_color_buffer_float"],[Ri.COLOR_ATTACHMENT_HALF_FLOAT]:["EXT_color_buffer_half_float"],[Ri.GLSL_FRAG_DATA]:["WEBGL_draw_buffers",!0],[Ri.GLSL_FRAG_DEPTH]:["EXT_frag_depth",!0],[Ri.GLSL_DERIVATIVES]:["OES_standard_derivatives",!0],[Ri.GLSL_TEXTURE_LOD]:["EXT_shader_texture_lod",!0]},Nq=2;function Dq(n,e){return jO(n,e)}function jO(n,e){return e=Array.isArray(e)?e:[e],e.every(t=>VO(n,t))}function Fq(n){n.luma=n.luma||{},n.luma.caps=n.luma.caps||{};for(const e in zO)n.luma.caps[e]===void 0&&(n.luma.caps[e]=VO(n,e));return n.luma.caps}function VO(n,e){return n.luma=n.luma||{},n.luma.caps=n.luma.caps||{},n.luma.caps[e]===void 0&&(n.luma.caps[e]=Bq(n,e)),n.luma.caps[e]||Tn.log(Nq,"Feature: ".concat(e," not supported"))(),n.luma.caps[e]}function Bq(n,e){const t=zO[e];Xt(t,e);let r;const i=yr(n)&&t[1]||t[0];if(typeof i=="function")r=i(n);else if(Array.isArray(i)){r=!0;for(const o of i)r=r&&!!n.getExtension(o)}else typeof i=="string"?r=!!n.getExtension(i):typeof i=="boolean"?r=i:Xt(!1);return r}const HO="Multiple render targets not supported";class _o extends Bl{get[Symbol.toStringTag](){return"Framebuffer"}static isSupported(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{colorBufferFloat:r,colorBufferHalfFloat:i}=t;let o=!0;return r&&(o=!!(e.getExtension("EXT_color_buffer_float")||e.getExtension("WEBGL_color_buffer_float")||e.getExtension("OES_texture_float"))),i&&(o=o&&!!(e.getExtension("EXT_color_buffer_float")||e.getExtension("EXT_color_buffer_half_float"))),o}static getDefaultFramebuffer(e){return e.luma=e.luma||{},e.luma.defaultFramebuffer=e.luma.defaultFramebuffer||new _o(e,{id:"default-framebuffer",handle:null,attachments:{}}),e.luma.defaultFramebuffer}get MAX_COLOR_ATTACHMENTS(){const e=aa(this.gl);return e.getParameter(e.MAX_COLOR_ATTACHMENTS)}get MAX_DRAW_BUFFERS(){const e=aa(this.gl);return e.getParameter(e.MAX_DRAW_BUFFERS)}constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(e,t),this.width=null,this.height=null,this.attachments={},this.readBuffer=36064,this.drawBuffers=[36064],this.ownResources=[],this.initialize(t),Object.seal(this)}get color(){return this.attachments[36064]||null}get texture(){return this.attachments[36064]||null}get depth(){return this.attachments[36096]||this.attachments[33306]||null}get stencil(){return this.attachments[36128]||this.attachments[33306]||null}initialize(e){let{width:t=1,height:r=1,attachments:i=null,color:o=!0,depth:a=!0,stencil:l=!1,check:h=!0,readBuffer:p=void 0,drawBuffers:g=void 0}=e;if(Xt(t>=0&&r>=0,"Width and height need to be integers"),this.width=t,this.height=r,i)for(const _ in i){const x=i[_];(Array.isArray(x)?x[0]:x).resize({width:t,height:r})}else i=this._createDefaultAttachments(o,a,l,t,r);this.update({clearAttachments:!0,attachments:i,readBuffer:p,drawBuffers:g}),i&&h&&this.checkStatus()}delete(){for(const e of this.ownResources)e.delete();return super.delete(),this}update(e){let{attachments:t={},readBuffer:r,drawBuffers:i,clearAttachments:o=!1,resizeAttachments:a=!0}=e;this.attach(t,{clearAttachments:o,resizeAttachments:a});const{gl:l}=this,h=l.bindFramebuffer(36160,this.handle);return r&&this._setReadBuffer(r),i&&this._setDrawBuffers(i),l.bindFramebuffer(36160,h||null),this}resize(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},{width:t,height:r}=e;if(this.handle===null)return Xt(t===void 0&&r===void 0),this.width=this.gl.drawingBufferWidth,this.height=this.gl.drawingBufferHeight,this;t===void 0&&(t=this.gl.drawingBufferWidth),r===void 0&&(r=this.gl.drawingBufferHeight),t!==this.width&&r!==this.height&&Tn.log(2,"Resizing framebuffer ".concat(this.id," to ").concat(t,"x").concat(r))();for(const i in this.attachments)this.attachments[i].resize({width:t,height:r});return this.width=t,this.height=r,this}attach(e){let{clearAttachments:t=!1,resizeAttachments:r=!0}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const i={};t&&Object.keys(this.attachments).forEach(a=>{i[a]=null}),Object.assign(i,e);const o=this.gl.bindFramebuffer(36160,this.handle);for(const a in i){Xt(a!==void 0,"Misspelled framebuffer binding point?");const l=Number(a),h=i[l];let p=h;if(!p)this._unattach(l);else if(p instanceof Ap)this._attachRenderbuffer({attachment:l,renderbuffer:p});else if(Array.isArray(h)){const[g,_=0,x=0]=h;p=g,this._attachTexture({attachment:l,texture:g,layer:_,level:x})}else this._attachTexture({attachment:l,texture:p,layer:0,level:0});r&&p&&p.resize({width:this.width,height:this.height})}this.gl.bindFramebuffer(36160,o||null),Object.assign(this.attachments,e),Object.keys(this.attachments).filter(a=>!this.attachments[a]).forEach(a=>{delete this.attachments[a]})}checkStatus(){const e=this.getStatus();if(e!==36053)throw new Error(zq(e));return this}getStatus(){const{gl:e}=this,t=e.bindFramebuffer(36160,this.handle),r=e.checkFramebufferStatus(36160);return e.bindFramebuffer(36160,t||null),r}clear(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const{color:t,depth:r,stencil:i,drawBuffers:o=[]}=e,a=this.gl.bindFramebuffer(36160,this.handle);return(t||r||i)&&wS(this.gl,{color:t,depth:r,stencil:i}),o.forEach((l,h)=>{Mq(this.gl,{drawBuffer:h,value:l})}),this.gl.bindFramebuffer(36160,a||null),this}readPixels(){return Tn.error("Framebuffer.readPixels() is no logner supported, use readPixelsToArray(framebuffer)")(),null}readPixelsToBuffer(){return Tn.error("Framebuffer.readPixelsToBuffer()is no logner supported, use readPixelsToBuffer(framebuffer)")(),null}copyToDataUrl(){return Tn.error("Framebuffer.copyToDataUrl() is no logner supported, use copyToDataUrl(framebuffer)")(),null}copyToImage(){return Tn.error("Framebuffer.copyToImage() is no logner supported, use copyToImage(framebuffer)")(),null}copyToTexture(){return Tn.error("Framebuffer.copyToTexture({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null}blit(){return Tn.error("Framebuffer.blit({...}) is no logner supported, use blit(source, target, opts)")(),null}invalidate(e){let{attachments:t=[],x:r=0,y:i=0,width:o,height:a}=e;const l=aa(this.gl),h=l.bindFramebuffer(36008,this.handle);return r===0&&i===0&&o===void 0&&a===void 0?l.invalidateFramebuffer(36008,t):l.invalidateFramebuffer(36008,t,r,i,o,a),l.bindFramebuffer(36008,h),this}getAttachmentParameter(e,t,r){let i=this._getAttachmentParameterFallback(t);return i===null&&(this.gl.bindFramebuffer(36160,this.handle),i=this.gl.getFramebufferAttachmentParameter(36160,e,t),this.gl.bindFramebuffer(36160,null)),r&&i>1e3&&(i=Vu(this.gl,i)),i}getAttachmentParameters(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:36064,t=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.constructor.ATTACHMENT_PARAMETERS||[];const i={};for(const o of r){const a=t?Vu(this.gl,o):o;i[a]=this.getAttachmentParameter(e,o,t)}return i}getParameters(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;const t=Object.keys(this.attachments),r={};for(const i of t){const o=Number(i),a=e?Vu(this.gl,o):o;r[a]=this.getAttachmentParameters(o,e)}return r}show(){return typeof window<"u"&&window.open(BO(this),"luma-debug-texture"),this}log(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";if(e>Tn.level||typeof window>"u")return this;t=t||"Framebuffer ".concat(this.id);const r=BO(this,{targetMaxHeight:100});return Tn.image({logLevel:e,message:t,image:r},t)(),this}bind(){let{target:e=36160}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return this.gl.bindFramebuffer(e,this.handle),this}unbind(){let{target:e=36160}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return this.gl.bindFramebuffer(e,null),this}_createDefaultAttachments(e,t,r,i,o){let a=null;return e&&(a=a||{},a[36064]=new fs(this.gl,{id:"".concat(this.id,"-color0"),pixels:null,format:6408,type:5121,width:i,height:o,mipmaps:!1,parameters:{10241:9729,10240:9729,10242:33071,10243:33071}}),this.ownResources.push(a[36064])),t&&r?(a=a||{},a[33306]=new Ap(this.gl,{id:"".concat(this.id,"-depth-stencil"),format:35056,width:i,height:111}),this.ownResources.push(a[33306])):t?(a=a||{},a[36096]=new Ap(this.gl,{id:"".concat(this.id,"-depth"),format:33189,width:i,height:o}),this.ownResources.push(a[36096])):r&&Xt(!1),a}_unattach(e){const t=this.attachments[e];t&&(t instanceof Ap?this.gl.framebufferRenderbuffer(36160,e,36161,null):this.gl.framebufferTexture2D(36160,e,3553,null,0),delete this.attachments[e])}_attachRenderbuffer(e){let{attachment:t=36064,renderbuffer:r}=e;const{gl:i}=this;i.framebufferRenderbuffer(36160,t,36161,r.handle),this.attachments[t]=r}_attachTexture(e){let{attachment:t=36064,texture:r,layer:i,level:o}=e;const{gl:a}=this;switch(a.bindTexture(r.target,r.handle),r.target){case 35866:case 32879:aa(a).framebufferTextureLayer(36160,t,r.target,o,i);break;case 34067:const h=Uq(i);a.framebufferTexture2D(36160,t,h,r.handle,o);break;case 3553:a.framebufferTexture2D(36160,t,3553,r.handle,o);break;default:Xt(!1,"Illegal texture type")}a.bindTexture(r.target,null),this.attachments[t]=r}_setReadBuffer(e){const t=pG(this.gl);t?t.readBuffer(e):Xt(e===36064||e===1029,HO),this.readBuffer=e}_setDrawBuffers(e){const{gl:t}=this,r=aa(t);if(r)r.drawBuffers(e);else{const i=t.getExtension("WEBGL_draw_buffers");i?i.drawBuffersWEBGL(e):Xt(e.length===1&&(e[0]===36064||e[0]===1029),HO)}this.drawBuffers=e}_getAttachmentParameterFallback(e){const t=Fq(this.gl);switch(e){case 36052:return t.WEBGL2?null:0;case 33298:case 33299:case 33300:case 33301:case 33302:case 33303:return t.WEBGL2?null:8;case 33297:return t.WEBGL2?null:5125;case 33296:return!t.WEBGL2&&!t.EXT_sRGB?9729:null;default:return null}}_createHandle(){return this.gl.createFramebuffer()}_deleteHandle(){this.gl.deleteFramebuffer(this.handle)}_bindHandle(e){return this.gl.bindFramebuffer(36160,e)}}function Uq(n){return n<34069?n+34069:n}function zq(n){return(_o.STATUS||{})[n]||"Framebuffer error ".concat(n)}const jq=[36049,36048,33296,33298,33299,33300,33301,33302,33303];_o.ATTACHMENT_PARAMETERS=jq;function Vq(n,e){Xt(n instanceof fs||n instanceof RO||n instanceof Sq);const t=n.constructor,{gl:r,width:i,height:o,format:a,type:l,dataFormat:h,border:p,mipmaps:g}=n,_=Object.assign({width:i,height:o,format:a,type:l,dataFormat:h,border:p,mipmaps:g},e);return new t(r,_)}function Hq(n,e){const{gl:t,width:r,height:i,id:o}=n;return new _o(t,Object.assign({},e,{id:"framebuffer-for-".concat(o),width:r,height:i,attachments:{36064:n}}))}function zb(n){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"unnamed";const t=/#define[\s*]SHADER_NAME[\s*]([A-Za-z0-9_-]+)[\s*]/,r=n.match(t);return r?r[1]:e}const Gq=35632,qq=35633;function $q(n){switch(n){case Gq:return"fragment";case qq:return"vertex";default:return"unknown type"}}function Wq(n,e,t,r){const i=n.split(/\r?\n/),o={},a={},l=r||zb(e)||"(unnamed)",h="".concat($q(t)," shader ").concat(l);for(let g=0;ge[qv]&&(F[fr]=e[qv]),se(e[Fh],[]),se(e[tM],F),x[Rf]=function(J){x[kf]()>=e[qv]?a||(Ut(r,2,67,"Maximum buffer size reached: "+x[kf](),!0),a=!0):(J.cnt=J.cnt||0,!bt(_)&&J.cnt>_||(C[Rf](J),se(e.BUFFER_KEY,x[Hv]())))},x[am]=function(){C[am](),se(e.BUFFER_KEY,x[Hv]()),se(e[Fh],[]),a=!1},x[qx]=function(J){se(e[tM],x._set(z(J,x[Hv]())));var pe=ee(e[Fh]);pe instanceof Array&&J instanceof Array&&((pe=pe[sm](J))[fr]>e[qv]&&(Ut(r,1,67,"Sent buffer reached its maximum size: "+pe[fr],!0),pe[fr]=e[qv]),se(e[Fh],pe))},x[Gv]=function(J){J=z(J,ee(e[Fh])),se(e[Fh],J)},x[JP]=function(J,pe,ue){ue=!!ue;var xe=x[Hv]().slice(0),je=ee(e[Fh]).slice(0),ne=(J=J||r,pe=pe||{},x[am](),new(ue?e:fM)(J,pe));return on(xe,function(Ee){ne[Rf](Ee)}),ue&&ne[qx](je),ne}}),o}var t;return au(e,n),(t=e).VERSION="_1",e.BUFFER_KEY="AI_buffer"+t.VERSION,e.SENT_BUFFER_KEY="AI_sentBuffer"+t.VERSION,e.MAX_BUFFER_SIZE=2e3,e}(Pz),Bbe=function(){function n(e){mi(n,this,function(t){function r(a,l){var h="__aiCircularRefCheck",p={};if(a)if(a[h])Ut(e,2,50,"Circular reference detected while serializing object",{name:l},!0);else if(a.aiDataContract)a[h]=!0,dr(a.aiDataContract,function(g,M){var x=Gn(M)?1&M():1&M,C=Gn(M)?4&M():4&M,M=2&M,L=a[g]!==void 0,F=Wa(a[g])&&a[g]!==null;!x||L||M?C||(x=void 0)!==(x=F?(M?i:r)(a[g],g):a[g])&&(p[g]=x):Ut(e,1,24,"Missing required field specification. The field is required but not present on source",{field:g,name:l})}),delete a[h];else if(l==="measurements")p=o(a,"number",l);else if(l==="properties")p=o(a,"string",l);else if(l==="tags")p=o(a,"string",l);else if(hr(a))p=i(a,l);else{Ut(e,2,49,"Attempting to serialize an object which does not implement ISerializable",{name:l},!0);try{xc()[Vv](a),p=a}catch(g){Ut(e,1,48,g&&Gn(g[Mf])?g[Mf]():"Error serializing object",null,!0)}}else Ut(e,1,48,"cannot serialize object because it is null or undefined",{name:l},!0);return p}function i(a,l){if(a)if(hr(a))for(var h=[],p=0;pAt[lM]&&!J?Ge[sM](Te,At):Ge[cm](Te,QB(Ie)):(t=0,Ge[Yx](Te,0))}function ln(Ie,Te,At){Ie.readyState===4&&ae(Ie.status,Te,Ie.responseURL,At,tx(Ie),kz(Ie)||Ie.response)}function Mn(Ie){try{var Te;if(Ie)return(Te=Ie[uM])&&Te[fr]?Te:null}catch{}return null}function Ot(Ie,Te){return!(ce||(Ie?Ie.baseData&&!Ie[hM]?(Te&&Ut(Te,1,70,"Cannot send telemetry without baseData and baseType"),1):(Ie[hM]||(Ie[hM]="EventData"),Ge[Wv]?Ge._sample.isSampledIn(Ie)?(Ie[p8]=Ge._sample[Kx],0):(Te&&Ut(Te,2,33,"Telemetry item was sampled out and not sent",{SampleRate:Ge._sample[Kx]}),1):(Te&&Ut(Te,1,28,"Sender was not initialized"),1)):(Te&&Ut(Te,1,7,"Cannot send empty telemetry"),1)))}function En(Ie,Te){var At=Ie.iKey||se,xt=e.constructEnvelope(Ie,At,Te,_e);if(xt){var qt=!1;if(Ie[Ko]&&Ie[Ko][hP]&&(on(Ie[Ko][hP],function(fn){try{fn&&fn(xt)===!1&&(qt=!0,hf(Te,"Telemetry processor check returns false"))}catch(Ke){Ut(Te,1,64,"One of telemetry initializers failed, telemetry item will not be sent: "+Dr(Ke),{exception:rn(Ke)},!0)}}),delete Ie[Ko][hP]),!qt)return xt}else Ut(Te,1,47,"Unable to create an AppInsights envelope")}function lt(Ie){var Te=Rz,At=Ge[ha]();try{var xt=Ot(Ie,At),qt=null;(qt=xt?En(Ie,At):qt)&&(Te=a[Wx](qt))}catch{}return Te}function Pt(Ie){var Te=Rz;return Te=Ie&&Ie[fr]?"["+Ie.join(",")+"]":Te}function he(Ie){var Te=D(),At={urlString:x};return At[Ma]=Ie,At.headers=Te,At}function B(Ke,Te,At,xt){xt===void 0&&(xt=!0);function qt(gt,Tt,Rn){var Qn;Qn=Te,Rn=Rn,gt===200&&Qn?Ge._onSuccess(Qn,Qn[fr]):Rn&&Ge[cm](Qn,Rn)}var fn=H(Te),Ke=Ke&&Ke.sendPOST;return Ke&&fn?(xt&&Ge._buffer[qx](Te),Ke(fn,qt,!At)):null}function H(Ie){var Te,At,xt;return hr(Ie)&&0M&&(g&&!g.isOnline()||Ge[$v](!0,null,10))}function ae(Ie,Te,At,xt,qt,fn){var Ke=null;Ge._appId||(Ke=eP(fn))&&Ke.appId&&(Ge._appId=Ke.appId),(Ie<200||300<=Ie)&&Ie!==0?(Ie!==301&&Ie!==307&&Ie!==308||q(At))&&!J&&Lt(Ie)?(rt(Te),Ut(Ge[ha](),2,40,". Response code "+Ie+". Will retry to send "+Te[fr]+" items.")):Ge[cm](Te,qt):g&&!g.isOnline()?J||(rt(Te,10),Ut(Ge[ha](),2,40,". Offline - Response Code: ".concat(Ie,". Offline status: ").concat(!g.isOnline(),". Will retry to send ").concat(Te.length," items."))):(q(At),Ie===206?(Ke=Ke||eP(fn))&&!J?Ge[sM](Te,Ke):Ge[cm](Te,qt):(t=0,Ge[Yx](Te,xt)))}function q(Ie){return!(10<=l||bt(Ie)||Ie===""||Ie===x)&&(x=Ie,++l,1)}function Ae(Ie,Te){if(!p)return B(ht&&ht[$x]([3],!0),Ie,Te);p(Ie,!1)}function Pe(Ie){try{if(Ie&&Ie[fr])return Pn(Ie[0])}catch{}}function We(Ie,Te){var At=null;if(hr(Ie)){for(var xt=Ie[fr],qt=0;qt=o[h].minZoom&&r<=o[h].maxZoom&&(a=Ga(o[h].position,t))<=o[h].radius&&a<=l&&(l=a,i=o[h]);return i},n.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,i=r.indexOf("-");switch(r=i!==-1?r.substr(0,i):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)}}},n}(),c0=window&&window.__awaiter||function(n,e,t,r){return new(t=t||Promise)(function(i,o){function a(p){try{h(r.next(p))}catch(g){o(g)}}function l(p){try{h(r.throw(p))}catch(g){o(g)}}function h(p){var g;p.done?i(p.value):((g=p.value)instanceof t?g:new t(function(_){_(g)})).then(a,l)}h((r=r.apply(n,e||[])).next())})},l0=window&&window.__generator||function(n,e){var t,r,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},a={next:l(0),throw:l(1),return:l(2)};return typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function l(h){return function(p){var g=[h,p];if(t)throw new TypeError("Generator is already executing.");for(;o=a&&g[a=0]?0:o;)try{if(t=1,r&&(i=2&g[0]?r.return:g[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,g[1])).done)return i;switch(r=0,(g=i?[2&g[0],i.value]:g)[0]){case 0:case 1:i=g;break;case 4:return o.label++,{value:g[1],done:!1};case 5:o.label++,r=g[1],g=[0];continue;case 7:g=o.ops.pop(),o.trys.pop();continue;default:if(!(i=0<(i=o.trys).length&&i[i.length-1])&&(g[0]===6||g[0]===2)){o=0;continue}if(g[0]===3&&(!i||g[1]>i[0]&&g[1]=r._headUpdateLimit?r._rotateTimeout=setTimeout(r._updateHeading,DF.RotationDuration+25):r._rotateTimeout=setTimeout(r._updateHeading,r._headUpdateLimit-(Date.now()-r._lastHeadingTime)))},this._onMove=function(){r._moveTimeout&&(clearTimeout(r._moveTimeout),delete r._moveTimeout),r._controlTimeout&&(clearTimeout(r._controlTimeout),delete r._controlTimeout)},this._onMoveEnd=function(i){i.fromControl?r._controlTimeout=setTimeout(r._updateCam,r._controlEventDelay):r._updateCam()},this._onStyleData=function(){setTimeout(r._updateStyle)},this._onPointerDown=function(i){r._lastPointerPos=r._getEventPos(i),r._pointerTimeout=setTimeout(function(){return c0(r,void 0,void 0,function(){var o,a,l;return l0(this,function(h){switch(h.label){case 0:return a=this._map.getStyle(),o=a.language.toLowerCase(),a=a.style.toLowerCase(),(l=this._map.getCamera()).center=this._map.pixelsToPositions([this._lastPointerPos])[0],[4,this._getLocDesc(l,o,a)];case 1:return l=h.sent(),this._descCallback(l),this._onPointerUp(),[2]}})})},r._pointerUpdateDelay),r._map.getCanvas().addEventListener("mousemove",r._onPointerMove),r._map.getCanvas().addEventListener("touchmove",r._onPointerMove),r._map.getCanvas().addEventListener("mouseup",r._onPointerUp),r._map.getCanvas().addEventListener("touchend",r._onPointerUp)},this._onPointerMove=function(a){var a=r._getEventPos(a),o=r._lastPointerPos[0]-a[0],a=r._lastPointerPos[1]-a[1];Math.sqrt(o*o+a*a)>r._moveThreshold&&r._onPointerUp()},this._onPointerUp=function(){clearTimeout(r._pointerTimeout),delete r._pointerTimeout,r._map.getCanvas().removeEventListener("mousemove",r._onPointerMove),r._map.getCanvas().removeEventListener("touchmove",r._onPointerMove),r._map.getCanvas().removeEventListener("mouseup",r._onPointerUp),r._map.getCanvas().removeEventListener("touchend",r._onPointerUp)},this._updateHeading=function(){var i,o=r._map.getCamera();r._lastHead&&!r._checkHeadingThreshold(o.bearing,r._lastHead)||(i=r._getHeadingDesc(o),r._lastHead=o.bearing,r._descCallback("

Map heading ".concat(i,".

")),r._lastHeadingTime=Date.now()),delete r._rotateTimeout},this._updateStyle=function(){return c0(r,void 0,void 0,function(){var i,o,a,l;return l0(this,function(h){switch(h.label){case 0:return i=this._map.getCamera(),a=this._map.getStyle(),o=a.language.toLowerCase(),a=a.style.toLowerCase(),this._lastLang===o?[3,2]:(n._labelCache._preloadCache(o),[4,this._getLocDesc(i,o,a)]);case 1:return l=h.sent(),[3,4];case 2:return this._lastStyle===a||this._lastStyle!=="blank"?[3,4]:[4,this._getLocDesc(i,o,a)];case 3:l=h.sent(),h.label=4;case 4:return this._lastLang=o,this._lastStyle=a,l&&this._descCallback(l),[2]}})})},this._updateCam=function(i){i===void 0&&(i=!1);var o,a,l,h=r._map.getCamera();(!r._lastCam||0Map ".concat(this._actionQueue.join(", then "),".

").concat(p)),this._actionQueue=[]):this._descCallback(p),[2]}})})},i?0:r._camUpdateDelay))},this._map=e,this._restFallback=e.getServiceOptions().enableAccessibilityLocationFallback,this._descCallback=t,this._reverseSearch=new Q1e(e),n._labelCache||(n._labelCache=new J1e),this._lastLang=this._map.getStyle().language.toLowerCase(),n._labelCache._preloadCache(this._lastLang),this._map.events.addOnce("idle",function(){var i;r._disposed||(r._updateCam(!0),r._baseVectorTileSourceId=n._baseVectorTileSourceIds.find(function(o){return r._map.sources.getById(o)}),r._baseVectorTileSourceId==="bing-mvt"&&(r._labelConfig=n._labelConfigBing,r._roadLayers=n._roadLayersBing),r._polygonStyleLayer=r._labelConfig.reduce(function(o,a){return a.polygonSources&&o.push.apply(o,ewe([],Mj(a.polygonSources),!1)),o},[]),(i=r._map._getMap()).on("move",r._onMove),i.on("moveend",r._onMoveEnd),i.on("styledata",r._onStyleData),i.on("rotate",r._onRotate),(i=r._map.getCanvas()).addEventListener("mousedown",r._onPointerDown),i.addEventListener("touchstart",r._onPointerDown))}),this._map.getMapContainer().addEventListener("keydown",this._shortcutListener)}return n.prototype.dispose=function(){this._disposed=!0;var e=this._map._getMap(),e=(e.off("move",this._onMove),e.off("moveend",this._onMoveEnd),e.off("styledata",this._onStyleData),e.off("rotate",this._onRotate),this._map.getCanvas());e.removeEventListener("mousedown",this._onPointerDown),e.removeEventListener("touchstart",this._onPointerDown),this._map.getMapContainer().removeEventListener("keydown",this._shortcutListener)},n.prototype._getEventPos=function(e){var t,r;return"touches"in e?(t=e.touches[0],r=e.target.getBoundingClientRect(),[t.pageX-r.left,t.pageY-r.top]):[e.offsetX,e.offsetY]},n.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)},n.prototype._checkZoomThreshold=function(e,t){return this._round(e)!==this._round(t)},n.prototype._checkPitchThreshold=function(e,t){return Math.abs(e-t)>=this._pitchThreshold},n.prototype._checkLocThreshold=function(e,t){return e=(t=Mj(this._map.positionsToPixels([t,e]),2))[0],t=t[1],Go.getDistance(e,t)>=this._moveThreshold},n.prototype._checkHeadingThreshold=function(e,t){return e<0&&(e+=360),t<0&&(t+=360),e=Math.abs(e-t),(e=180=this._headingThreshold},n.prototype._getLocDesc=function(e,t,r){return c0(this,void 0,void 0,function(){var i,o,a,l,h,p,g,_,x,C=this;return l0(this,function(M){switch(M.label){case 0:return r==="blank"?[3,3]:this._map._getMap().loaded()?[3,2]:[4,new Promise(function(L){return C._map._getMap().once("idle",L)})];case 1:M.sent(),M.label=2;case 2:for(i={},o=this._map.positionsToPixels([e.center])[0],X1e.tryCatch(this._map,function(){var L=C._map._getMap();a=L.queryRenderedFeatures(o,{layers:C._polygonStyleLayer.filter(function(F){return L.getLayer(F)}),filter:["==",["geometry-type"],"Polygon"]})},function(){}),l=null,a&&0=_.minZoom?_.polygonSources?l&&_.polygonSources.indexOf(l.layer["source-layer"])!==-1?(h=_.labelType,this._getClosestLabel(_,e,t,i,!1)):this._getClosestLabel(_,e,t,i,!0):this._getClosestLabel(_,e,t,i,!1):this._getClosestLabel(_,e,t,i,!0);return 8<=e.zoom&&this._processRoads(i,e,t),this._labelCache.forEach(function(L){!i[L]&&(x=null,x=L!=="water"&&L!=="majorPoi"||L===h?n._labelCache.getNearestLabel(L,e.center,e.zoom):x)&&(i[L]=x.name)}),[2,this._processLocInfo(e,h,i,!0,this._restFallback)];case 3:return[2,this._processLocInfo(e,null,null,!1,!1)]}})})},n.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"".concat(t," degrees")}},n.prototype._getClosestLabel=function(e,t,r,i,o){for(var a=e.radius,l=0,h=e.source.length;l=e.maxZoom&&i.push("Zoom In button disabled, maximum zoom level reached"),r=rr.getSouth(e.bounds)<=-O_&&rr.getNorth(e.bounds)>=O_,(e.zoom<=e.minZoom||r)&&i.push("Zoom Out button disabled, minimum zoom level reached"),t.push(i.join(" "))),this._checkPitchThreshold(e.pitch,this._lastCam.pitch)&&(r=this._round(e.pitch,this._pitchThreshold),t.push("pitched to ".concat(r," degrees")),e.pitch!==60&&e.pitch!==0||(i=e.pitch===60?"maximum":"minimum",t.push("reached ".concat(i," of ").concat(e.pitch," degrees")))),this._checkHeadingThreshold(this._lastCam.bearing,e.bearing)&&t.push("rotated to ".concat(this._getHeadingDesc(e))),t.join(" and "))||null},n.prototype._getCanonicalZoom=function(e){return(e=this._round(e))<2?"world":e<5?"country":e<11?"state province":e<15?"city":"street"},n.prototype._processLocInfo=function(e,t,r,i,o){var a=this;return new Promise(function(l,h){var p=[];if(i){var g=[];if(r&&(t&&(t==="water"&&r.water?g.push(r.water):t==="majorPoi"&&r.majorPoi&&g.push(r.majorPoi)),g.length===0)&&(r.majorPoi&&8<=e.zoom?g.push(r.majorPoi):(r.poi&&14<=e.zoom?g.push(r.poi):r.road&&15<=e.zoom&&(r.secondRoad?g.push(r.road+" & "+r.secondRoad):g.push(r.road)),r.neighbourhood&&12<=e.zoom&&g.push(r.neighbourhood),r.city&&6<=e.zoom&&g.push(r.city)),r.state&&4<=e.zoom&&g.push(r.state),g.length===0?r.water?g.push(r.water):r.country&&g.push(r.country):g.length===1&&r.state&&4<=e.zoom&&r.country&&g.push(r.country)),0Location: ",g.join(", "),".

");else if(o&&t!=="water")return void a._reverseGeocodeDescription(e).then(function(_){l(_)},function(){h("

Location: unknown

")})}a._returnDetailedDescriptions&&(p.push("

Zoom: ",Ha(e.zoom,2),".

"),p.push("

Latitude: ",Ha(e.center[1],5),".

"),p.push("

Longitude: ",Ha(e.center[0],5),".

")),l(p.join(""))})},n.prototype._reverseGeocodeDescription=function(e){var t=this;return new Promise(function(r){var i=t._map.getStyle();t._reverseSearch.request({position:e.center,style:i}).then(function(o){var a,l={};o&&o.features&&0Map style: ".concat(e.map.getStyle().style,".

")},this.updateMapState=function(t){e.atlasMapLiveStateInfo.innerHTML=t},this.map=n},rwe=function(n){var e=this;this.listenerEnabled=!1,this.lastFlowMode="none",this.addToMap=function(){if(!e.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.");e.listenerEnabled||(e.map.events.add("styledata",e.addToMap),e.listenerEnabled=!0);var t,r=e.map.getTraffic();r.flow!=="none"&&(t=e.map.layers.getLayerById("traffic_".concat(r.flow)))&&(e.lastFlowMode=r.flow,t._updateLayoutProperty("visibility","visible","none"))},this.removeFromMap=function(){var t;e.map.getTraffic(),e.lastFlowMode!="none"&&((t=e.map.layers.getLayerById("traffic_".concat(e.lastFlowMode)))&&t._updateLayoutProperty("visibility","none","visible"),e.lastFlowMode="none"),e.listenerEnabled&&(e.map.events.remove("styledata",e.addToMap),e.listenerEnabled=!1)},this.map=n},iwe=window&&window.__extends||function(){var n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(r,i){r.__proto__=i}:function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])}))(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),Rj=function(n){function e(t,r,i){var a=(a=(a=(a=(a=(a=(a=(a=(a=(a=(a=(a=(a=(a=t.icon_category_12)!=null?a:t.icon_category_11)!=null?a:t.icon_category_10)!=null?a:t.icon_category_9)!=null?a:t.icon_category_8)!=null?a:t.icon_category_7)!=null?a:t.icon_category_6)!=null?a:t.icon_category_5)!=null?a:t.icon_category_4)!=null?a:t.icon_category_3)!=null?a:t.icon_category_2)!=null?a:t.icon_category_1)!=null?a:t.icon_category_0)!=null?a:t.icon_category,o=(o=(o=(o=(o=(o=(o=(o=(o=(o=(o=(o=(o=(o=t.description_12)!=null?o:t.description_11)!=null?o:t.description_10)!=null?o:t.description_9)!=null?o:t.description_8)!=null?o:t.description_7)!=null?o:t.description_6)!=null?o:t.description_5)!=null?o:t.description_4)!=null?o:t.description_3)!=null?o:t.description_2)!=null?o:t.description_1)!=null?o:t.description_0)!=null?o:t.description,a={icon:"".concat(e.getSeverityColorName(t.magnitude),"-").concat(e.getIncidentTypeIconName(a)),incidentType:e.getIncidentTypeName(a,i),description:o,delay:t.delay,color:e.getSeverityColorHexCode(t.magnitude),id:t.id};return n.call(this,r,a)||this}return iwe(e,n),e.getIncidentTypeName=function(t,r){switch(t){case 0:return r.Unknown;case 1:return r.Accident;case 2:return r.Fog;case 3:return r.Danger;case 4:return r.Rain;case 5:return r.Ice;case 6:return r.Jam;case 7:return r.LaneClosed;case 8:return r.RoadClosed;case 9:return r.RoadWorks;case 10:return r.Wind;case 11:return r.Flood;case 12:return r.Detour;default:return r.Unknown}},e.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"}},e.getSeverityColorName=function(t){switch(t){case 0:return"grey";case 1:return"yellow";case 2:return"orange";case 3:return"red";default:return"grey"}},e.getSeverityColorHexCode=function(t){switch(t){case 0:return"#B5B6B7";case 1:return"#F4C951";case 2:return"#F4873F";case 3:return"#F04F4E";default:return"#B5B6B7"}},e}(_c),kj=(function(n){n.DELAY="delay",n.LENGTH="length",n.FROM="from",n.TO="to"}(wm=wm||{}),function(){function n(){}return n.build=function(e,t){t===void 0&&(t="en-US");var r,o=document.createElement("div"),a=(o.classList.add("incident-popup-title"),o.classList.add("font-segoeui-b"),o.innerText=e.properties.incidentType,o.setAttribute("aria-label","Incident Type ".concat(e.properties.incidentType)),document.createElement("div")),i=(a.classList.add("incident-popup-subtitle"),a.classList.add("font-segoeui-b"),a.setAttribute("aria-label","Incident Description ".concat(e.properties.description)),a.innerText=e.properties.description,document.createElement("div")),o=(i.classList.add("incident-popup-header"),i.style.backgroundColor=e.properties.color,i.appendChild(o),i.appendChild(a),document.createElement("div")),a=(o.classList.add("incident-popup-body"),e.properties.delay&&(a="".concat(Math.floor(e.properties.delay/60)," min"),a=this.createInfoSection(a,wm.DELAY),o.appendChild(a)),e.properties.length&&(a=new Intl.NumberFormat([t,"en-US"],{maximumFractionDigits:2}),r=void 0,r=t==="en-US"?(t=Kl(e.properties.length,"meters","miles"),"".concat(a.format(t)," miles")):(t=Kl(e.properties.length,"meters","kilometers"),"".concat(a.format(t)," km")),a=this.createInfoSection(r,wm.LENGTH),o.appendChild(a)),e.properties.from&&(t=this.createInfoSection(e.properties.from,wm.FROM),o.appendChild(t)),e.properties.to&&(r=this.createInfoSection(e.properties.to,wm.TO),o.appendChild(r)),document.createElement("div"));return a.classList.add("incident-popup-content"),a.appendChild(i),a.appendChild(o),new pw({content:a,position:e.geometry.coordinates})},n.createInfoSection=function(e,t){var r=document.createElement("div"),i=(r.classList.add("incident-popup-info"),document.createElement("div")),o=(i.classList.add("icon"),i.classList.add(t),document.createElement("span"));return o.classList.add("message"),o.classList.add("font-segoeui"),o.setAttribute("aria-label","Incident ".concat(t," ").concat(e)),o.innerText=e,r.appendChild(i),r.appendChild(o),r},n}()),owe=window&&window.__awaiter||function(n,e,t,r){return new(t=t||Promise)(function(i,o){function a(p){try{h(r.next(p))}catch(g){o(g)}}function l(p){try{h(r.throw(p))}catch(g){o(g)}}function h(p){var g;p.done?i(p.value):((g=p.value)instanceof t?g:new t(function(_){_(g)})).then(a,l)}h((r=r.apply(n,e||[])).next())})},awe=window&&window.__generator||function(n,e){var t,r,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},a={next:l(0),throw:l(1),return:l(2)};return typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function l(h){return function(p){var g=[h,p];if(t)throw new TypeError("Generator is already executing.");for(;o=a&&g[a=0]?0:o;)try{if(t=1,r&&(i=2&g[0]?r.return:g[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,g[1])).done)return i;switch(r=0,(g=i?[2&g[0],i.value]:g)[0]){case 0:case 1:i=g;break;case 4:return o.label++,{value:g[1],done:!1};case 5:o.label++,r=g[1],g=[0];continue;case 7:g=o.ops.pop(),o.trys.pop();continue;default:if(!(i=0<(i=o.trys).length&&i[i.length-1])&&(g[0]===6||g[0]===2)){o=0;continue}if(g[0]===3&&(!i||g[1]>i[0]&&g[1]B?1:he0){if(B.right===null)break;if(H(he,B.right.key)>0){var Ae=B.right;if(B.right=Ae.left,Ae.left=B,B=Ae,B.right===null)break}Q.right=B,Q=B,B=B.right}else break}return Q.right=B.left,ae.left=B.right,B.left=D.right,B.right=D.left,B}function a(he,B,H,D){var Q=new r(he,B);if(H===null)return Q.left=Q.right=null,Q;H=o(he,H,D);var ae=D(he,H.key);return ae<0?(Q.left=H.left,Q.right=H,H.left=null):ae>=0&&(Q.right=H.right,Q.left=H,H.right=null),Q}function l(he,B,H){var D=null,Q=null;if(B){B=o(he,B,H);var ae=H(B.key,he);ae===0?(D=B.left,Q=B.right):ae<0?(Q=B.right,B.right=null,D=B):(D=B.left,B.left=null,Q=B)}return{left:D,right:Q}}function h(he,B,H){return B===null?he:(he===null||(B=o(he.key,B,H),B.left=he),B)}function p(he,B,H,D,Q){if(he){D(""+B+(H?"└── ":"├── ")+Q(he)+` -`);var ae=B+(H?" ":"│ ");he.left&&p(he.left,ae,!1,D,Q),he.right&&p(he.right,ae,!0,D,Q)}}var g=function(){function he(B){B===void 0&&(B=i),this._root=null,this._size=0,this._comparator=B}return he.prototype.insert=function(B,H){return this._size++,this._root=a(B,H,this._root,this._comparator)},he.prototype.add=function(B,H){var D=new r(B,H);this._root===null&&(D.left=D.right=null,this._size++,this._root=D);var Q=this._comparator,ae=o(B,this._root,Q),q=Q(B,ae.key);return q===0?this._root=ae:(q<0?(D.left=ae.left,D.right=ae,ae.left=null):q>0&&(D.right=ae.right,D.left=ae,ae.right=null),this._size++,this._root=D),this._root},he.prototype.remove=function(B){this._root=this._remove(B,this._root,this._comparator)},he.prototype._remove=function(B,H,D){var Q;if(H===null)return null;H=o(B,H,D);var ae=D(B,H.key);return ae===0?(H.left===null?Q=H.right:(Q=o(B,H.left,D),Q.right=H.right),this._size--,Q):H},he.prototype.pop=function(){var B=this._root;if(B){for(;B.left;)B=B.left;return this._root=o(B.key,this._root,this._comparator),this._root=this._remove(B.key,this._root,this._comparator),{key:B.key,data:B.data}}return null},he.prototype.findStatic=function(B){for(var H=this._root,D=this._comparator;H;){var Q=D(B,H.key);if(Q===0)return H;Q<0?H=H.left:H=H.right}return null},he.prototype.find=function(B){return this._root&&(this._root=o(B,this._root,this._comparator),this._comparator(B,this._root.key)!==0)?null:this._root},he.prototype.contains=function(B){for(var H=this._root,D=this._comparator;H;){var Q=D(B,H.key);if(Q===0)return!0;Q<0?H=H.left:H=H.right}return!1},he.prototype.forEach=function(B,H){for(var D=this._root,Q=[],ae=!1;!ae;)D!==null?(Q.push(D),D=D.left):Q.length!==0?(D=Q.pop(),B.call(H,D),D=D.right):ae=!0;return this},he.prototype.range=function(B,H,D,Q){for(var ae=[],q=this._comparator,Ae=this._root,Pe;ae.length!==0||Ae;)if(Ae)ae.push(Ae),Ae=Ae.left;else{if(Ae=ae.pop(),Pe=q(Ae.key,H),Pe>0)break;if(q(Ae.key,B)>=0&&D.call(Q,Ae))return this;Ae=Ae.right}return this},he.prototype.keys=function(){var B=[];return this.forEach(function(H){var D=H.key;return B.push(D)}),B},he.prototype.values=function(){var B=[];return this.forEach(function(H){var D=H.data;return B.push(D)}),B},he.prototype.min=function(){return this._root?this.minNode(this._root).key:null},he.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},he.prototype.minNode=function(B){if(B===void 0&&(B=this._root),B)for(;B.left;)B=B.left;return B},he.prototype.maxNode=function(B){if(B===void 0&&(B=this._root),B)for(;B.right;)B=B.right;return B},he.prototype.at=function(B){for(var H=this._root,D=!1,Q=0,ae=[];!D;)if(H)ae.push(H),H=H.left;else if(ae.length>0){if(H=ae.pop(),Q===B)return H;Q++,H=H.right}else D=!0;return null},he.prototype.next=function(B){var H=this._root,D=null;if(B.right){for(D=B.right;D.left;)D=D.left;return D}for(var Q=this._comparator;H;){var ae=Q(B.key,H.key);if(ae===0)break;ae<0?(D=H,H=H.left):H=H.right}return D},he.prototype.prev=function(B){var H=this._root,D=null;if(B.left!==null){for(D=B.left;D.right;)D=D.right;return D}for(var Q=this._comparator;H;){var ae=Q(B.key,H.key);if(ae===0)break;ae<0?H=H.left:(D=H,H=H.right)}return D},he.prototype.clear=function(){return this._root=null,this._size=0,this},he.prototype.toList=function(){return C(this._root)},he.prototype.load=function(B,H,D){H===void 0&&(H=[]),D===void 0&&(D=!1);var Q=B.length,ae=this._comparator;if(D&&F(B,H,0,Q-1,ae),this._root===null)this._root=_(B,H,0,Q),this._size=Q;else{var q=L(this.toList(),x(B,H),ae);Q=this._size+Q,this._root=M({head:q},0,Q)}return this},he.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(he.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(he.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),he.prototype.toString=function(B){B===void 0&&(B=function(Q){return String(Q.key)});var H=[];return p(this._root,"",!0,function(D){return H.push(D)},B),H.join("")},he.prototype.update=function(B,H,D){var Q=this._comparator,ae=l(B,this._root,Q),q=ae.left,Ae=ae.right;Q(B,H)<0?Ae=a(H,D,Ae,Q):q=a(H,D,q,Q),this._root=h(q,Ae,Q)},he.prototype.split=function(B){return l(B,this._root,this._comparator)},he}();function _(he,B,H,D){var Q=D-H;if(Q>0){var ae=H+Math.floor(Q/2),q=he[ae],Ae=B[ae],Pe=new r(q,Ae);return Pe.left=_(he,B,H,ae),Pe.right=_(he,B,ae+1,D),Pe}return null}function x(he,B){for(var H=new r(null,null),D=H,Q=0;Q0?(B=ae=ae.next=H.pop(),B=B.right):D=!0;return ae.next=null,Q.next}function M(he,B,H){var D=H-B;if(D>0){var Q=B+Math.floor(D/2),ae=M(he,B,Q),q=he.head;return q.left=ae,he.head=he.head.next,q.right=M(he,Q+1,H),q}return null}function L(he,B,H){for(var D=new r(null,null),Q=D,ae=he,q=B;ae!==null&&q!==null;)H(ae.key,q.key)<0?(Q.next=ae,ae=ae.next):(Q.next=q,q=q.next),Q=Q.next;return ae!==null?Q.next=ae:q!==null&&(Q.next=q),D.next}function F(he,B,H,D,Q){if(!(H>=D)){for(var ae=he[H+D>>1],q=H-1,Ae=D+1;;){do q++;while(Q(he[q],ae)<0);do Ae--;while(Q(he[Ae],ae)>0);if(q>=Ae)break;var Pe=he[q];he[q]=he[Ae],he[Ae]=Pe,Pe=B[q],B[q]=B[Ae],B[Ae]=Pe}F(he,B,H,Ae,Q),F(he,B,Ae+1,D,Q)}}var z=function(B,H){return B.ll.x<=H.x&&H.x<=B.ur.x&&B.ll.y<=H.y&&H.y<=B.ur.y},ee=function(B,H){if(H.ur.xD.x?1:H.yD.y?1:0}}]);function he(B,H){n(this,he),B.events===void 0?B.events=[this]:B.events.push(this),this.point=B,this.isLeft=H}return t(he,[{key:"link",value:function(H){if(H.point===this.point)throw new Error("Tried to link already linked events");for(var D=H.point.events,Q=0,ae=D.length;Q=0&&Bt>=0?rtLt?-1:0:We<0&&Bt<0?rtLt?1:0:BtWe?1:0}}}]),he}(),Rt=0,dn=function(){t(he,null,[{key:"compare",value:function(H,D){var Q=H.leftSE.point.x,ae=D.leftSE.point.x,q=H.rightSE.point.x,Ae=D.rightSE.point.x;if(AePe&&We>rt)return-1;var Bt=H.comparePoint(D.leftSE.point);if(Bt<0)return 1;if(Bt>0)return-1;var Lt=D.comparePoint(H.rightSE.point);return Lt!==0?Lt:-1}if(Q>ae){if(PeWe&&Pe>Et)return 1;var an=D.comparePoint(H.leftSE.point);if(an!==0)return an;var Ie=H.comparePoint(D.rightSE.point);return Ie<0?1:Ie>0?-1:1}if(PeWe)return 1;if(qAe){var At=H.comparePoint(D.rightSE.point);if(At<0)return 1;if(At>0)return-1}if(q!==Ae){var xt=rt-Pe,qt=q-Q,fn=Et-We,Ke=Ae-ae;if(xt>qt&&fnKe)return-1}return q>Ae?1:qEt?1:H.idD.id?1:0}}]);function he(B,H,D,Q){n(this,he),this.id=++Rt,this.leftSE=B,B.segment=this,B.otherSE=H,this.rightSE=H,H.segment=this,H.otherSE=B,this.rings=D,this.windings=Q}return t(he,[{key:"replaceRightSE",value:function(H){this.rightSE=H,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}},{key:"bbox",value:function(){var H=this.leftSE.point.y,D=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:HD?H:D}}}},{key:"vector",value:function(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}},{key:"isAnEndpoint",value:function(H){return H.x===this.leftSE.point.x&&H.y===this.leftSE.point.y||H.x===this.rightSE.point.x&&H.y===this.rightSE.point.y}},{key:"comparePoint",value:function(H){if(this.isAnEndpoint(H))return 0;var D=this.leftSE.point,Q=this.rightSE.point,ae=this.vector();if(D.x===Q.x)return H.x===D.x?0:H.x0&&Pe.swapEvents(),ht.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),Q&&(ae.checkForConsuming(),q.checkForConsuming()),D}},{key:"swapEvents",value:function(){var H=this.rightSE;this.rightSE=this.leftSE,this.leftSE=H,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(var D=0,Q=this.windings.length;D0){var q=D;D=Q,Q=q}if(D.prev===Q){var Ae=D;D=Q,Q=Ae}for(var Pe=0,We=Q.rings.length;Pe0)ae=D,q=H,Ae=-1;else throw new Error("Tried to create degenerate segment at [".concat(H.x,", ").concat(H.y,"]"));var We=new ht(ae,!0),rt=new ht(q,!1);return new he(We,rt,[Q],[Ae])}}]),he}(),wt=function(){function he(B,H,D){if(n(this,he),!Array.isArray(B)||B.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=H,this.isExterior=D,this.segments=[],typeof B[0][0]!="number"||typeof B[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var Q=ue.round(B[0][0],B[0][1]);this.bbox={ll:{x:Q.x,y:Q.y},ur:{x:Q.x,y:Q.y}};for(var ae=Q,q=1,Ae=B.length;qthis.bbox.ur.x&&(this.bbox.ur.x=Pe.x),Pe.y>this.bbox.ur.y&&(this.bbox.ur.y=Pe.y),ae=Pe)}(Q.x!==ae.x||Q.y!==ae.y)&&this.segments.push(dn.fromRing(ae,Q,this))}return t(he,[{key:"getSweepEvents",value:function(){for(var H=[],D=0,Q=this.segments.length;Dthis.bbox.ur.x&&(this.bbox.ur.x=ae.bbox.ur.x),ae.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=ae.bbox.ur.y),this.interiorRings.push(ae)}this.multiPoly=H}return t(he,[{key:"getSweepEvents",value:function(){for(var H=this.exteriorRing.getSweepEvents(),D=0,Q=this.interiorRings.length;Dthis.bbox.ur.x&&(this.bbox.ur.x=ae.bbox.ur.x),ae.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=ae.bbox.ur.y),this.polys.push(ae)}this.isSubject=H}return t(he,[{key:"getSweepEvents",value:function(){for(var H=[],D=0,Q=this.polys.length;D0&&(H=ae)}for(var q=H.segment.prevInResult(),Ae=q?q.prevInResult():null;;){if(!q)return null;if(!Ae)return q.ringOut;if(Ae.ringOut!==q.ringOut)return Ae.ringOut.enclosingRing()!==q.ringOut?q.ringOut:q.ringOut.enclosingRing();q=Ae.prevInResult(),Ae=q?q.prevInResult():null}}}]),he}(),ln=function(){function he(B){n(this,he),this.exteriorRing=B,B.poly=this,this.interiorRings=[]}return t(he,[{key:"addInterior",value:function(H){this.interiorRings.push(H),H.poly=this}},{key:"getGeom",value:function(){var H=[this.exteriorRing.getGeom()];if(H[0]===null)return null;for(var D=0,Q=this.interiorRings.length;D1&&arguments[1]!==void 0?arguments[1]:dn.compare;n(this,he),this.queue=B,this.tree=new g(H),this.segments=[]}return t(he,[{key:"process",value:function(H){var D=H.segment,Q=[];if(H.consumedBy)return H.isLeft?this.queue.remove(H.otherSE):this.tree.remove(D),Q;var ae=H.isLeft?this.tree.insert(D):this.tree.find(D);if(!ae)throw new Error("Unable to find segment #".concat(D.id," ")+"[".concat(D.leftSE.point.x,", ").concat(D.leftSE.point.y,"] -> ")+"[".concat(D.rightSE.point.x,", ").concat(D.rightSE.point.y,"] ")+"in SweepLine tree. Please submit a bug report.");for(var q=ae,Ae=ae,Pe=void 0,We=void 0;Pe===void 0;)q=this.tree.prev(q),q===null?Pe=null:q.key.consumedBy===void 0&&(Pe=q.key);for(;We===void 0;)Ae=this.tree.next(Ae),Ae===null?We=null:Ae.key.consumedBy===void 0&&(We=Ae.key);if(H.isLeft){var rt=null;if(Pe){var Et=Pe.getIntersection(D);if(Et!==null&&(D.isAnEndpoint(Et)||(rt=Et),!Pe.isAnEndpoint(Et)))for(var Bt=this._splitSafely(Pe,Et),Lt=0,an=Bt.length;Lt0?(this.tree.remove(D),Q.push(H)):(this.segments.push(D),D.prev=Pe)}else{if(Pe&&We){var Qn=Pe.getIntersection(We);if(Qn!==null){if(!Pe.isAnEndpoint(Qn))for(var nn=this._splitSafely(Pe,Qn),Fr=0,ti=nn.length;FrEn)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big). Please file a bug report.");for(var Ke=new Ot(Ie),gt=Ie.size,Tt=Ie.pop();Tt;){var Rn=Tt.key;if(Ie.size===gt){var Qn=Rn.segment;throw new Error("Unable to pop() ".concat(Rn.isLeft?"left":"right"," SweepEvent ")+"[".concat(Rn.point.x,", ").concat(Rn.point.y,"] from segment #").concat(Qn.id," ")+"[".concat(Qn.leftSE.point.x,", ").concat(Qn.leftSE.point.y,"] -> ")+"[".concat(Qn.rightSE.point.x,", ").concat(Qn.rightSE.point.y,"] from queue. ")+"Please file a bug report.")}if(Ie.size>En)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big). Please file a bug report.");if(Ke.segments.length>lt)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments). Please file a bug report.");for(var nn=Ke.process(Rn),Fr=0,ti=nn.length;Fr1?H-1:0),Q=1;Q1?H-1:0),Q=1;Q1?H-1:0),Q=1;Q1?H-1:0),Q=1;Q=this.minZoom,r=!this.maxZoom||!e.zoom||e.zoom<=this.maxZoom,i=!0;return this.geometry&&e.bounds&&(i=mwe({type:"Feature",geometry:this.geometry,properties:{}},{type:"Feature",geometry:{type:"Polygon",coordinates:[[rr.getNorthWest(e.bounds),rr.getNorthEast(e.bounds),rr.getSouthEast(e.bounds),rr.getSouthWest(e.bounds),rr.getNorthWest(e.bounds)]]},properties:{}})!==null),t&&r&&i},n.prototype.apply=function(e,l){var r=this,i=(l===void 0&&(l=null),this.satisfied(e.getCamera())),o=this.dynamic&&this.tilesetId,a=this.hidesElement,l=l&&["dragend","zoomend","pitchend"].includes(l.type);return i||a?i&&(a||o)&&(i&&a&&this.element.style.removeProperty("display"),o)&&(l?e.events.addOnce("idle",function(h){return r.fetchAndApplyDynamicAttribution(e)}):this.fetchAndApplyDynamicAttribution(e)):this.element.style.display="none",i===a},n.prototype.fetchAndApplyDynamicAttribution=function(e){var t,r,i,o=this,a=e.getCamera();this.lastFetchState&&rr.containsBoundingBox(this.lastFetchState.bounds,a.bounds)&&Math.floor(this.lastFetchState.zoom)==Math.floor(a.zoom)||(t=i2(a.center,rr.getSouthWest(a.bounds),n.viewportBufferExpansionRatio),i=((r=i2(a.center,rr.getNorthEast(a.bounds),n.viewportBufferExpansionRatio))[0]i[0]&&g[1]i[0]&&g[1]=t.length&&e.lastIndexOf(t)===e.length-t.length},n.queryStringToObject=function(i){function t(o){return decodeURIComponent(o.replace(/\+/g," "))}var r={},i=i.split("&");return i.forEach(function(o){var a;o.trim()&&(a=(o=o.split(/=(.+)/g,2))[0],o=o[1],a)&&o&&(r[t(a)]=t(o))}),r},n.trimArrayEntries=function(e){return e.map(function(t){return t.trim()})},n.removeEmptyStringsFromArray=function(e){return e.filter(function(t){return!n.isEmpty(t)})},n.jsonParseHelper=function(e){try{return JSON.parse(e)}catch{return null}},n.matchPattern=function(e,t){return new RegExp(e.replace(/\\/g,"\\\\").replace(/\*/g,"[^ ]*").replace(/\?/g,"\\?")).test(t)},n}(),KM=(function(n){n[n.Error=0]="Error",n[n.Warning=1]="Warning",n[n.Info=2]="Info",n[n.Verbose=3]="Verbose",n[n.Trace=4]="Trace"}(No=No||{}),function(){function n(e,t,r){this.level=No.Info,e=e||n.createDefaultLoggerOptions(),this.localCallback=e.loggerCallback||function(){},this.piiLoggingEnabled=e.piiLoggingEnabled||!1,this.level=typeof e.logLevel=="number"?e.logLevel:No.Info,this.correlationId=e.correlationId||Le.EMPTY_STRING,this.packageName=t||Le.EMPTY_STRING,this.packageVersion=r||Le.EMPTY_STRING}return n.createDefaultLoggerOptions=function(){return{loggerCallback:function(){},piiLoggingEnabled:!1,logLevel:No.Info}},n.prototype.clone=function(e,t,r){return new n({loggerCallback:this.localCallback,piiLoggingEnabled:this.piiLoggingEnabled,logLevel:this.level,correlationId:r||this.correlationId},e,t)},n.prototype.logMessage=function(e,t){var r;t.logLevel>this.level||!this.piiLoggingEnabled&&t.containsPii||(r=new Date().toUTCString(),r=(Kt.isEmpty(t.correlationId)?Kt.isEmpty(this.correlationId)?"["+r+"]":"["+r+"] : ["+this.correlationId+"]":"["+r+"] : ["+t.correlationId+"]")+" : "+this.packageName+"@"+this.packageVersion+" : "+No[t.logLevel]+" - "+e,this.executeCallback(t.logLevel,r,t.containsPii||!1))},n.prototype.executeCallback=function(e,t,r){this.localCallback&&this.localCallback(e,t,r)},n.prototype.error=function(e,t){this.logMessage(e,{logLevel:No.Error,containsPii:!1,correlationId:t||Le.EMPTY_STRING})},n.prototype.errorPii=function(e,t){this.logMessage(e,{logLevel:No.Error,containsPii:!0,correlationId:t||Le.EMPTY_STRING})},n.prototype.warning=function(e,t){this.logMessage(e,{logLevel:No.Warning,containsPii:!1,correlationId:t||Le.EMPTY_STRING})},n.prototype.warningPii=function(e,t){this.logMessage(e,{logLevel:No.Warning,containsPii:!0,correlationId:t||Le.EMPTY_STRING})},n.prototype.info=function(e,t){this.logMessage(e,{logLevel:No.Info,containsPii:!1,correlationId:t||Le.EMPTY_STRING})},n.prototype.infoPii=function(e,t){this.logMessage(e,{logLevel:No.Info,containsPii:!0,correlationId:t||Le.EMPTY_STRING})},n.prototype.verbose=function(e,t){this.logMessage(e,{logLevel:No.Verbose,containsPii:!1,correlationId:t||Le.EMPTY_STRING})},n.prototype.verbosePii=function(e,t){this.logMessage(e,{logLevel:No.Verbose,containsPii:!0,correlationId:t||Le.EMPTY_STRING})},n.prototype.trace=function(e,t){this.logMessage(e,{logLevel:No.Trace,containsPii:!1,correlationId:t||Le.EMPTY_STRING})},n.prototype.tracePii=function(e,t){this.logMessage(e,{logLevel:No.Trace,containsPii:!0,correlationId:t||Le.EMPTY_STRING})},n.prototype.isPiiLoggingEnabled=function(){return this.piiLoggingEnabled||!1},n}()),Gj="@azure/msal-common",ZM="13.3.1",Vn=(function(n){n[n.None=0]="None",n.AzurePublic="https://login.microsoftonline.com",n.AzurePpe="https://login.windows-ppe.net",n.AzureChina="https://login.chinacloudapi.cn",n.AzureGermany="https://login.microsoftonline.de",n.AzureUsGovernment="https://login.microsoftonline.us"}(d0=d0||{}),{redirectUriNotSet:{code:"redirect_uri_empty",desc:"A redirect URI is required for all calls, and none has been set."},postLogoutUriNotSet:{code:"post_logout_uri_empty",desc:"A post logout redirect has not been set."},claimsRequestParsingError:{code:"claims_request_parsing_error",desc:"Could not parse the given claims request object."},authorityUriInsecure:{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"},urlParseError:{code:"url_parse_error",desc:"URL could not be parsed into appropriate segments."},urlEmptyError:{code:"empty_url_error",desc:"URL was empty or null."},emptyScopesError:{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."},nonArrayScopesError:{code:"nonarray_input_scopes_error",desc:"Scopes cannot be passed as non-array."},clientIdSingleScopeError:{code:"clientid_input_scopes_error",desc:"Client ID can only be provided as a single scope."},invalidPrompt:{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"},invalidClaimsRequest:{code:"invalid_claims",desc:"Given claims parameter must be a stringified JSON object."},tokenRequestEmptyError:{code:"token_request_empty",desc:"Token request was empty and not found in cache."},logoutRequestEmptyError:{code:"logout_request_empty",desc:"The logout request was null or undefined."},invalidCodeChallengeMethod:{code:"invalid_code_challenge_method",desc:'code_challenge_method passed is invalid. Valid values are "plain" and "S256".'},invalidCodeChallengeParams:{code:"pkce_params_missing",desc:"Both params: code_challenge and code_challenge_method are to be passed if to be sent in the request"},invalidCloudDiscoveryMetadata:{code:"invalid_cloud_discovery_metadata",desc:"Invalid cloudDiscoveryMetadata provided. Must be a stringified JSON object containing tenant_discovery_endpoint and metadata fields"},invalidAuthorityMetadata:{code:"invalid_authority_metadata",desc:"Invalid authorityMetadata provided. Must by a stringified JSON object containing authorization_endpoint, token_endpoint, issuer fields."},untrustedAuthority:{code:"untrusted_authority",desc:"The provided authority is not a trusted authority. Please include this authority in the knownAuthorities config parameter."},invalidAzureCloudInstance:{code:"invalid_azure_cloud_instance",desc:"Invalid AzureCloudInstance provided. Please refer MSAL JS docs: aks.ms/msaljs/azure_cloud_instance for valid values"},missingSshJwk:{code:"missing_ssh_jwk",desc:"Missing sshJwk in SSH certificate request. A stringified JSON Web Key is required when using the SSH authentication scheme."},missingSshKid:{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."},missingNonceAuthenticationHeader:{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."},invalidAuthenticationHeader:{code:"invalid_authentication_header",desc:"Invalid authentication header provided"},authorityMismatch:{code:"authority_mismatch",desc:"Authority mismatch error. Authority provided in login request or PublicClientApplication config does not match the environment of the provided account. Please use a matching account or make an interactive request to login to this authority."}}),yi=function(n){function e(t,r){return t=n.call(this,t,r)||this,t.name="ClientConfigurationError",Object.setPrototypeOf(t,e.prototype),t}return Ja(e,n),e.createRedirectUriEmptyError=function(){return new e(Vn.redirectUriNotSet.code,Vn.redirectUriNotSet.desc)},e.createPostLogoutRedirectUriEmptyError=function(){return new e(Vn.postLogoutUriNotSet.code,Vn.postLogoutUriNotSet.desc)},e.createClaimsRequestParsingError=function(t){return new e(Vn.claimsRequestParsingError.code,Vn.claimsRequestParsingError.desc+" Given value: "+t)},e.createInsecureAuthorityUriError=function(t){return new e(Vn.authorityUriInsecure.code,Vn.authorityUriInsecure.desc+" Given URI: "+t)},e.createUrlParseError=function(t){return new e(Vn.urlParseError.code,Vn.urlParseError.desc+" Given Error: "+t)},e.createUrlEmptyError=function(){return new e(Vn.urlEmptyError.code,Vn.urlEmptyError.desc)},e.createEmptyScopesArrayError=function(){return new e(Vn.emptyScopesError.code,""+Vn.emptyScopesError.desc)},e.createClientIdSingleScopeError=function(t){return new e(Vn.clientIdSingleScopeError.code,Vn.clientIdSingleScopeError.desc+" Given Scopes: "+t)},e.createInvalidPromptError=function(t){return new e(Vn.invalidPrompt.code,Vn.invalidPrompt.desc+" Given value: "+t)},e.createInvalidClaimsRequestError=function(){return new e(Vn.invalidClaimsRequest.code,Vn.invalidClaimsRequest.desc)},e.createEmptyLogoutRequestError=function(){return new e(Vn.logoutRequestEmptyError.code,Vn.logoutRequestEmptyError.desc)},e.createEmptyTokenRequestError=function(){return new e(Vn.tokenRequestEmptyError.code,Vn.tokenRequestEmptyError.desc)},e.createInvalidCodeChallengeMethodError=function(){return new e(Vn.invalidCodeChallengeMethod.code,Vn.invalidCodeChallengeMethod.desc)},e.createInvalidCodeChallengeParamsError=function(){return new e(Vn.invalidCodeChallengeParams.code,Vn.invalidCodeChallengeParams.desc)},e.createInvalidCloudDiscoveryMetadataError=function(){return new e(Vn.invalidCloudDiscoveryMetadata.code,Vn.invalidCloudDiscoveryMetadata.desc)},e.createInvalidAuthorityMetadataError=function(){return new e(Vn.invalidAuthorityMetadata.code,Vn.invalidAuthorityMetadata.desc)},e.createUntrustedAuthorityError=function(){return new e(Vn.untrustedAuthority.code,Vn.untrustedAuthority.desc)},e.createInvalidAzureCloudInstanceError=function(){return new e(Vn.invalidAzureCloudInstance.code,Vn.invalidAzureCloudInstance.desc)},e.createMissingSshJwkError=function(){return new e(Vn.missingSshJwk.code,Vn.missingSshJwk.desc)},e.createMissingSshKidError=function(){return new e(Vn.missingSshKid.code,Vn.missingSshKid.desc)},e.createMissingNonceAuthenticationHeadersError=function(){return new e(Vn.missingNonceAuthenticationHeader.code,Vn.missingNonceAuthenticationHeader.desc)},e.createInvalidAuthenticationHeaderError=function(t,r){return new e(Vn.invalidAuthenticationHeader.code,Vn.invalidAuthenticationHeader.desc+". Invalid header: "+t+". Details: "+r)},e.createAuthorityMismatchError=function(){return new e(Vn.authorityMismatch.code,Vn.authorityMismatch.desc)},e}(en),fa=function(){function n(r){var t=this,r=r?Kt.trimArrayEntries(vE(r)):[],r=r?Kt.removeEmptyStringsFromArray(r):[];this.validateInputScopes(r),this.scopes=new Set,r.forEach(function(i){return t.scopes.add(i)})}return n.fromString=function(e){return new n((e||Le.EMPTY_STRING).split(" "))},n.createSearchScopes=function(e){return e=new n(e),e.containsOnlyOIDCScopes()?e.removeScope(Le.OFFLINE_ACCESS_SCOPE):e.removeOIDCScopes(),e},n.prototype.validateInputScopes=function(e){if(!e||e.length<1)throw yi.createEmptyScopesArrayError()},n.prototype.containsScope=function(e){var t=new n(this.printScopesLowerCase().split(" "));return!Kt.isEmpty(e)&&t.scopes.has(e.toLowerCase())},n.prototype.containsScopeSet=function(e){var t=this;return!(!e||e.scopes.size<=0)&&this.scopes.size>=e.scopes.size&&e.asArray().every(function(r){return t.containsScope(r)})},n.prototype.containsOnlyOIDCScopes=function(){var e=this,t=0;return jj.forEach(function(r){e.containsScope(r)&&(t+=1)}),this.scopes.size===t},n.prototype.appendScope=function(e){Kt.isEmpty(e)||this.scopes.add(e.trim())},n.prototype.appendScopes=function(e){var t=this;try{e.forEach(function(r){return t.appendScope(r)})}catch(r){throw en.createAppendScopeSetError(r)}},n.prototype.removeScope=function(e){if(Kt.isEmpty(e))throw en.createRemoveEmptyScopeFromSetError(e);this.scopes.delete(e.trim())},n.prototype.removeOIDCScopes=function(){var e=this;jj.forEach(function(t){e.scopes.delete(t)})},n.prototype.unionScopeSets=function(e){var t;if(e)return t=new Set,e.scopes.forEach(function(r){return t.add(r.toLowerCase())}),this.scopes.forEach(function(r){return t.add(r.toLowerCase())}),t;throw en.createEmptyInputScopeSetError()},n.prototype.intersectingScopeSets=function(r){if(!r)throw en.createEmptyInputScopeSetError();r.containsOnlyOIDCScopes()||r.removeOIDCScopes();var t=this.unionScopeSets(r),r=r.getScopeCount(),i=this.getScopeCount();return t.sizee+t)throw en.createMaxAgeTranspiredError()},n}(),es=function(){function n(e,t,r){this.clientId=e,this.cryptoImpl=t,this.commonLogger=r.clone(Gj,ZM)}return n.prototype.getAllAccounts=function(){var e=this,t=this.getAccountKeys();return t.length<1||(t=t.reduce(function(r,i){return i=e.getAccount(i),i&&r.push(i),r},[])).length<1?[]:t.map(function(r){return e.getAccountInfoFromEntity(r)})},n.prototype.getAccountInfoFilteredBy=function(e){return e=this.getAccountsFilteredBy(e),0n.nowSeconds()},n.delay=function(e,t){return new Promise(function(r){return setTimeout(function(){return r(t)},e)})},n}(),Zf=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return Ja(e,n),e.createAccessTokenEntity=function(ce,r,i,o,a,l,h,p,g,_,x,C,M,L,F){var z,ee=new e,ce=(ee.homeAccountId=ce,ee.credentialType=In.ACCESS_TOKEN,ee.secret=i,ec.nowSeconds());if(ee.cachedAt=ce.toString(),ee.expiresOn=h.toString(),ee.extendedExpiresOn=p.toString(),_&&(ee.refreshOn=_.toString()),ee.environment=r,ee.clientId=o,ee.realm=a,ee.target=l,ee.userAssertionHash=C,ee.tokenType=Kt.isEmpty(x)?qr.BEARER:x,L&&(ee.requestedClaims=L,ee.requestedClaimsHash=F),((ce=ee.tokenType)==null?void 0:ce.toLowerCase())!==qr.BEARER.toLowerCase())switch(ee.credentialType=In.ACCESS_TOKEN_WITH_AUTH_SCHEME,ee.tokenType){case qr.POP:var se=ml.extractTokenClaims(i,g);if((z=se==null?void 0:se.cnf)==null||!z.kid)throw en.createTokenClaimsRequiredError();ee.keyId=se.cnf.kid;break;case qr.SSH:ee.keyId=M}return ee},e.isAccessTokenEntity=function(t){return!!t&&t.hasOwnProperty("homeAccountId")&&t.hasOwnProperty("environment")&&t.hasOwnProperty("credentialType")&&t.hasOwnProperty("realm")&&t.hasOwnProperty("clientId")&&t.hasOwnProperty("secret")&&t.hasOwnProperty("target")&&(t.credentialType===In.ACCESS_TOKEN||t.credentialType===In.ACCESS_TOKEN_WITH_AUTH_SCHEME)},e}(JM),Cm=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return Ja(e,n),e.createRefreshTokenEntity=function(t,r,i,o,a,l){var h=new e;return h.clientId=o,h.credentialType=In.REFRESH_TOKEN,h.environment=r,h.homeAccountId=t,h.secret=i,h.userAssertionHash=l,a&&(h.familyId=a),h},e.isRefreshTokenEntity=function(t){return!!t&&t.hasOwnProperty("homeAccountId")&&t.hasOwnProperty("environment")&&t.hasOwnProperty("credentialType")&&t.hasOwnProperty("clientId")&&t.hasOwnProperty("secret")&&t.credentialType===In.REFRESH_TOKEN},e}(JM),$j=["interaction_required","consent_required","login_required"],Fwe=["message_only","additional_action","basic_action","user_password_expired","consent_required"],Am={noTokensFoundError:{code:"no_tokens_found",desc:"No refresh token found in the cache. Please sign-in."},native_account_unavailable:{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."}},tc=function(n){function e(t,r,i,o,a,l,h){return t=n.call(this,t,r,i)||this,Object.setPrototypeOf(t,e.prototype),t.timestamp=o||Le.EMPTY_STRING,t.traceId=a||Le.EMPTY_STRING,t.correlationId=l||Le.EMPTY_STRING,t.claims=h||Le.EMPTY_STRING,t.name="InteractionRequiredAuthError",t}return Ja(e,n),e.isInteractionRequiredError=function(o,r,a){var o=!!o&&-1<$j.indexOf(o),a=!!a&&-10&&(D.right=ae.right,D.left=ae,ae.right=null),this._size++,this._root=D),this._root},he.prototype.remove=function(B){this._root=this._remove(B,this._root,this._comparator)},he.prototype._remove=function(B,H,D){var Q;if(H===null)return null;H=o(B,H,D);var ae=D(B,H.key);return ae===0?(H.left===null?Q=H.right:(Q=o(B,H.left,D),Q.right=H.right),this._size--,Q):H},he.prototype.pop=function(){var B=this._root;if(B){for(;B.left;)B=B.left;return this._root=o(B.key,this._root,this._comparator),this._root=this._remove(B.key,this._root,this._comparator),{key:B.key,data:B.data}}return null},he.prototype.findStatic=function(B){for(var H=this._root,D=this._comparator;H;){var Q=D(B,H.key);if(Q===0)return H;Q<0?H=H.left:H=H.right}return null},he.prototype.find=function(B){return this._root&&(this._root=o(B,this._root,this._comparator),this._comparator(B,this._root.key)!==0)?null:this._root},he.prototype.contains=function(B){for(var H=this._root,D=this._comparator;H;){var Q=D(B,H.key);if(Q===0)return!0;Q<0?H=H.left:H=H.right}return!1},he.prototype.forEach=function(B,H){for(var D=this._root,Q=[],ae=!1;!ae;)D!==null?(Q.push(D),D=D.left):Q.length!==0?(D=Q.pop(),B.call(H,D),D=D.right):ae=!0;return this},he.prototype.range=function(B,H,D,Q){for(var ae=[],q=this._comparator,Ae=this._root,Pe;ae.length!==0||Ae;)if(Ae)ae.push(Ae),Ae=Ae.left;else{if(Ae=ae.pop(),Pe=q(Ae.key,H),Pe>0)break;if(q(Ae.key,B)>=0&&D.call(Q,Ae))return this;Ae=Ae.right}return this},he.prototype.keys=function(){var B=[];return this.forEach(function(H){var D=H.key;return B.push(D)}),B},he.prototype.values=function(){var B=[];return this.forEach(function(H){var D=H.data;return B.push(D)}),B},he.prototype.min=function(){return this._root?this.minNode(this._root).key:null},he.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},he.prototype.minNode=function(B){if(B===void 0&&(B=this._root),B)for(;B.left;)B=B.left;return B},he.prototype.maxNode=function(B){if(B===void 0&&(B=this._root),B)for(;B.right;)B=B.right;return B},he.prototype.at=function(B){for(var H=this._root,D=!1,Q=0,ae=[];!D;)if(H)ae.push(H),H=H.left;else if(ae.length>0){if(H=ae.pop(),Q===B)return H;Q++,H=H.right}else D=!0;return null},he.prototype.next=function(B){var H=this._root,D=null;if(B.right){for(D=B.right;D.left;)D=D.left;return D}for(var Q=this._comparator;H;){var ae=Q(B.key,H.key);if(ae===0)break;ae<0?(D=H,H=H.left):H=H.right}return D},he.prototype.prev=function(B){var H=this._root,D=null;if(B.left!==null){for(D=B.left;D.right;)D=D.right;return D}for(var Q=this._comparator;H;){var ae=Q(B.key,H.key);if(ae===0)break;ae<0?H=H.left:(D=H,H=H.right)}return D},he.prototype.clear=function(){return this._root=null,this._size=0,this},he.prototype.toList=function(){return C(this._root)},he.prototype.load=function(B,H,D){H===void 0&&(H=[]),D===void 0&&(D=!1);var Q=B.length,ae=this._comparator;if(D&&F(B,H,0,Q-1,ae),this._root===null)this._root=_(B,H,0,Q),this._size=Q;else{var q=L(this.toList(),x(B,H),ae);Q=this._size+Q,this._root=M({head:q},0,Q)}return this},he.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(he.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(he.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),he.prototype.toString=function(B){B===void 0&&(B=function(Q){return String(Q.key)});var H=[];return p(this._root,"",!0,function(D){return H.push(D)},B),H.join("")},he.prototype.update=function(B,H,D){var Q=this._comparator,ae=l(B,this._root,Q),q=ae.left,Ae=ae.right;Q(B,H)<0?Ae=a(H,D,Ae,Q):q=a(H,D,q,Q),this._root=h(q,Ae,Q)},he.prototype.split=function(B){return l(B,this._root,this._comparator)},he}();function _(he,B,H,D){var Q=D-H;if(Q>0){var ae=H+Math.floor(Q/2),q=he[ae],Ae=B[ae],Pe=new r(q,Ae);return Pe.left=_(he,B,H,ae),Pe.right=_(he,B,ae+1,D),Pe}return null}function x(he,B){for(var H=new r(null,null),D=H,Q=0;Q0?(B=ae=ae.next=H.pop(),B=B.right):D=!0;return ae.next=null,Q.next}function M(he,B,H){var D=H-B;if(D>0){var Q=B+Math.floor(D/2),ae=M(he,B,Q),q=he.head;return q.left=ae,he.head=he.head.next,q.right=M(he,Q+1,H),q}return null}function L(he,B,H){for(var D=new r(null,null),Q=D,ae=he,q=B;ae!==null&&q!==null;)H(ae.key,q.key)<0?(Q.next=ae,ae=ae.next):(Q.next=q,q=q.next),Q=Q.next;return ae!==null?Q.next=ae:q!==null&&(Q.next=q),D.next}function F(he,B,H,D,Q){if(!(H>=D)){for(var ae=he[H+D>>1],q=H-1,Ae=D+1;;){do q++;while(Q(he[q],ae)<0);do Ae--;while(Q(he[Ae],ae)>0);if(q>=Ae)break;var Pe=he[q];he[q]=he[Ae],he[Ae]=Pe,Pe=B[q],B[q]=B[Ae],B[Ae]=Pe}F(he,B,H,Ae,Q),F(he,B,Ae+1,D,Q)}}var z=function(B,H){return B.ll.x<=H.x&&H.x<=B.ur.x&&B.ll.y<=H.y&&H.y<=B.ur.y},ee=function(B,H){if(H.ur.xD.x?1:H.yD.y?1:0}}]);function he(B,H){n(this,he),B.events===void 0?B.events=[this]:B.events.push(this),this.point=B,this.isLeft=H}return t(he,[{key:"link",value:function(H){if(H.point===this.point)throw new Error("Tried to link already linked events");for(var D=H.point.events,Q=0,ae=D.length;Q=0&&Bt>=0?rtLt?-1:0:We<0&&Bt<0?rtLt?1:0:BtWe?1:0}}}]),he}(),Rt=0,dn=function(){t(he,null,[{key:"compare",value:function(H,D){var Q=H.leftSE.point.x,ae=D.leftSE.point.x,q=H.rightSE.point.x,Ae=D.rightSE.point.x;if(AePe&&We>rt)return-1;var Bt=H.comparePoint(D.leftSE.point);if(Bt<0)return 1;if(Bt>0)return-1;var Lt=D.comparePoint(H.rightSE.point);return Lt!==0?Lt:-1}if(Q>ae){if(PeWe&&Pe>Et)return 1;var an=D.comparePoint(H.leftSE.point);if(an!==0)return an;var Ie=H.comparePoint(D.rightSE.point);return Ie<0?1:Ie>0?-1:1}if(PeWe)return 1;if(qAe){var At=H.comparePoint(D.rightSE.point);if(At<0)return 1;if(At>0)return-1}if(q!==Ae){var xt=rt-Pe,qt=q-Q,fn=Et-We,Ke=Ae-ae;if(xt>qt&&fnKe)return-1}return q>Ae?1:qEt?1:H.idD.id?1:0}}]);function he(B,H,D,Q){n(this,he),this.id=++Rt,this.leftSE=B,B.segment=this,B.otherSE=H,this.rightSE=H,H.segment=this,H.otherSE=B,this.rings=D,this.windings=Q}return t(he,[{key:"replaceRightSE",value:function(H){this.rightSE=H,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}},{key:"bbox",value:function(){var H=this.leftSE.point.y,D=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:HD?H:D}}}},{key:"vector",value:function(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}},{key:"isAnEndpoint",value:function(H){return H.x===this.leftSE.point.x&&H.y===this.leftSE.point.y||H.x===this.rightSE.point.x&&H.y===this.rightSE.point.y}},{key:"comparePoint",value:function(H){if(this.isAnEndpoint(H))return 0;var D=this.leftSE.point,Q=this.rightSE.point,ae=this.vector();if(D.x===Q.x)return H.x===D.x?0:H.x0&&Pe.swapEvents(),ht.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),Q&&(ae.checkForConsuming(),q.checkForConsuming()),D}},{key:"swapEvents",value:function(){var H=this.rightSE;this.rightSE=this.leftSE,this.leftSE=H,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(var D=0,Q=this.windings.length;D0){var q=D;D=Q,Q=q}if(D.prev===Q){var Ae=D;D=Q,Q=Ae}for(var Pe=0,We=Q.rings.length;Pe0)ae=D,q=H,Ae=-1;else throw new Error("Tried to create degenerate segment at [".concat(H.x,", ").concat(H.y,"]"));var We=new ht(ae,!0),rt=new ht(q,!1);return new he(We,rt,[Q],[Ae])}}]),he}(),wt=function(){function he(B,H,D){if(n(this,he),!Array.isArray(B)||B.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=H,this.isExterior=D,this.segments=[],typeof B[0][0]!="number"||typeof B[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var Q=ue.round(B[0][0],B[0][1]);this.bbox={ll:{x:Q.x,y:Q.y},ur:{x:Q.x,y:Q.y}};for(var ae=Q,q=1,Ae=B.length;qthis.bbox.ur.x&&(this.bbox.ur.x=Pe.x),Pe.y>this.bbox.ur.y&&(this.bbox.ur.y=Pe.y),ae=Pe)}(Q.x!==ae.x||Q.y!==ae.y)&&this.segments.push(dn.fromRing(ae,Q,this))}return t(he,[{key:"getSweepEvents",value:function(){for(var H=[],D=0,Q=this.segments.length;Dthis.bbox.ur.x&&(this.bbox.ur.x=ae.bbox.ur.x),ae.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=ae.bbox.ur.y),this.interiorRings.push(ae)}this.multiPoly=H}return t(he,[{key:"getSweepEvents",value:function(){for(var H=this.exteriorRing.getSweepEvents(),D=0,Q=this.interiorRings.length;Dthis.bbox.ur.x&&(this.bbox.ur.x=ae.bbox.ur.x),ae.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=ae.bbox.ur.y),this.polys.push(ae)}this.isSubject=H}return t(he,[{key:"getSweepEvents",value:function(){for(var H=[],D=0,Q=this.polys.length;D0&&(H=ae)}for(var q=H.segment.prevInResult(),Ae=q?q.prevInResult():null;;){if(!q)return null;if(!Ae)return q.ringOut;if(Ae.ringOut!==q.ringOut)return Ae.ringOut.enclosingRing()!==q.ringOut?q.ringOut:q.ringOut.enclosingRing();q=Ae.prevInResult(),Ae=q?q.prevInResult():null}}}]),he}(),ln=function(){function he(B){n(this,he),this.exteriorRing=B,B.poly=this,this.interiorRings=[]}return t(he,[{key:"addInterior",value:function(H){this.interiorRings.push(H),H.poly=this}},{key:"getGeom",value:function(){var H=[this.exteriorRing.getGeom()];if(H[0]===null)return null;for(var D=0,Q=this.interiorRings.length;D1&&arguments[1]!==void 0?arguments[1]:dn.compare;n(this,he),this.queue=B,this.tree=new g(H),this.segments=[]}return t(he,[{key:"process",value:function(H){var D=H.segment,Q=[];if(H.consumedBy)return H.isLeft?this.queue.remove(H.otherSE):this.tree.remove(D),Q;var ae=H.isLeft?this.tree.insert(D):this.tree.find(D);if(!ae)throw new Error("Unable to find segment #".concat(D.id," ")+"[".concat(D.leftSE.point.x,", ").concat(D.leftSE.point.y,"] -> ")+"[".concat(D.rightSE.point.x,", ").concat(D.rightSE.point.y,"] ")+"in SweepLine tree. Please submit a bug report.");for(var q=ae,Ae=ae,Pe=void 0,We=void 0;Pe===void 0;)q=this.tree.prev(q),q===null?Pe=null:q.key.consumedBy===void 0&&(Pe=q.key);for(;We===void 0;)Ae=this.tree.next(Ae),Ae===null?We=null:Ae.key.consumedBy===void 0&&(We=Ae.key);if(H.isLeft){var rt=null;if(Pe){var Et=Pe.getIntersection(D);if(Et!==null&&(D.isAnEndpoint(Et)||(rt=Et),!Pe.isAnEndpoint(Et)))for(var Bt=this._splitSafely(Pe,Et),Lt=0,an=Bt.length;Lt0?(this.tree.remove(D),Q.push(H)):(this.segments.push(D),D.prev=Pe)}else{if(Pe&&We){var Qn=Pe.getIntersection(We);if(Qn!==null){if(!Pe.isAnEndpoint(Qn))for(var nn=this._splitSafely(Pe,Qn),Fr=0,ti=nn.length;FrEn)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big). Please file a bug report.");for(var Ke=new Ot(Ie),gt=Ie.size,Tt=Ie.pop();Tt;){var Rn=Tt.key;if(Ie.size===gt){var Qn=Rn.segment;throw new Error("Unable to pop() ".concat(Rn.isLeft?"left":"right"," SweepEvent ")+"[".concat(Rn.point.x,", ").concat(Rn.point.y,"] from segment #").concat(Qn.id," ")+"[".concat(Qn.leftSE.point.x,", ").concat(Qn.leftSE.point.y,"] -> ")+"[".concat(Qn.rightSE.point.x,", ").concat(Qn.rightSE.point.y,"] from queue. ")+"Please file a bug report.")}if(Ie.size>En)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big). Please file a bug report.");if(Ke.segments.length>lt)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments). Please file a bug report.");for(var nn=Ke.process(Rn),Fr=0,ti=nn.length;Fr1?H-1:0),Q=1;Q1?H-1:0),Q=1;Q1?H-1:0),Q=1;Q1?H-1:0),Q=1;Q=this.minZoom,r=!this.maxZoom||!e.zoom||e.zoom<=this.maxZoom,i=!0;return this.geometry&&e.bounds&&(i=mwe({type:"Feature",geometry:this.geometry,properties:{}},{type:"Feature",geometry:{type:"Polygon",coordinates:[[rr.getNorthWest(e.bounds),rr.getNorthEast(e.bounds),rr.getSouthEast(e.bounds),rr.getSouthWest(e.bounds),rr.getNorthWest(e.bounds)]]},properties:{}})!==null),t&&r&&i},n.prototype.apply=function(e,l){var r=this,i=(l===void 0&&(l=null),this.satisfied(e.getCamera())),o=this.dynamic&&this.tilesetId,a=this.hidesElement,l=l&&["dragend","zoomend","pitchend"].includes(l.type);return i||a?i&&(a||o)&&(i&&a&&this.element.style.removeProperty("display"),o)&&(l?e.events.addOnce("idle",function(h){return r.fetchAndApplyDynamicAttribution(e)}):this.fetchAndApplyDynamicAttribution(e)):this.element.style.display="none",i===a},n.prototype.fetchAndApplyDynamicAttribution=function(e){var t,r,i,o=this,a=e.getCamera();this.lastFetchState&&rr.containsBoundingBox(this.lastFetchState.bounds,a.bounds)&&Math.floor(this.lastFetchState.zoom)==Math.floor(a.zoom)||(t=i2(a.center,rr.getSouthWest(a.bounds),n.viewportBufferExpansionRatio),i=((r=i2(a.center,rr.getNorthEast(a.bounds),n.viewportBufferExpansionRatio))[0]i[0]&&g[1]i[0]&&g[1]=t.length&&e.lastIndexOf(t)===e.length-t.length},n.queryStringToObject=function(i){function t(o){return decodeURIComponent(o.replace(/\+/g," "))}var r={},i=i.split("&");return i.forEach(function(o){var a;o.trim()&&(a=(o=o.split(/=(.+)/g,2))[0],o=o[1],a)&&o&&(r[t(a)]=t(o))}),r},n.trimArrayEntries=function(e){return e.map(function(t){return t.trim()})},n.removeEmptyStringsFromArray=function(e){return e.filter(function(t){return!n.isEmpty(t)})},n.jsonParseHelper=function(e){try{return JSON.parse(e)}catch{return null}},n.matchPattern=function(e,t){return new RegExp(e.replace(/\\/g,"\\\\").replace(/\*/g,"[^ ]*").replace(/\?/g,"\\?")).test(t)},n}(),KM=(function(n){n[n.Error=0]="Error",n[n.Warning=1]="Warning",n[n.Info=2]="Info",n[n.Verbose=3]="Verbose",n[n.Trace=4]="Trace"}(No=No||{}),function(){function n(e,t,r){this.level=No.Info,e=e||n.createDefaultLoggerOptions(),this.localCallback=e.loggerCallback||function(){},this.piiLoggingEnabled=e.piiLoggingEnabled||!1,this.level=typeof e.logLevel=="number"?e.logLevel:No.Info,this.correlationId=e.correlationId||Le.EMPTY_STRING,this.packageName=t||Le.EMPTY_STRING,this.packageVersion=r||Le.EMPTY_STRING}return n.createDefaultLoggerOptions=function(){return{loggerCallback:function(){},piiLoggingEnabled:!1,logLevel:No.Info}},n.prototype.clone=function(e,t,r){return new n({loggerCallback:this.localCallback,piiLoggingEnabled:this.piiLoggingEnabled,logLevel:this.level,correlationId:r||this.correlationId},e,t)},n.prototype.logMessage=function(e,t){var r;t.logLevel>this.level||!this.piiLoggingEnabled&&t.containsPii||(r=new Date().toUTCString(),r=(Kt.isEmpty(t.correlationId)?Kt.isEmpty(this.correlationId)?"["+r+"]":"["+r+"] : ["+this.correlationId+"]":"["+r+"] : ["+t.correlationId+"]")+" : "+this.packageName+"@"+this.packageVersion+" : "+No[t.logLevel]+" - "+e,this.executeCallback(t.logLevel,r,t.containsPii||!1))},n.prototype.executeCallback=function(e,t,r){this.localCallback&&this.localCallback(e,t,r)},n.prototype.error=function(e,t){this.logMessage(e,{logLevel:No.Error,containsPii:!1,correlationId:t||Le.EMPTY_STRING})},n.prototype.errorPii=function(e,t){this.logMessage(e,{logLevel:No.Error,containsPii:!0,correlationId:t||Le.EMPTY_STRING})},n.prototype.warning=function(e,t){this.logMessage(e,{logLevel:No.Warning,containsPii:!1,correlationId:t||Le.EMPTY_STRING})},n.prototype.warningPii=function(e,t){this.logMessage(e,{logLevel:No.Warning,containsPii:!0,correlationId:t||Le.EMPTY_STRING})},n.prototype.info=function(e,t){this.logMessage(e,{logLevel:No.Info,containsPii:!1,correlationId:t||Le.EMPTY_STRING})},n.prototype.infoPii=function(e,t){this.logMessage(e,{logLevel:No.Info,containsPii:!0,correlationId:t||Le.EMPTY_STRING})},n.prototype.verbose=function(e,t){this.logMessage(e,{logLevel:No.Verbose,containsPii:!1,correlationId:t||Le.EMPTY_STRING})},n.prototype.verbosePii=function(e,t){this.logMessage(e,{logLevel:No.Verbose,containsPii:!0,correlationId:t||Le.EMPTY_STRING})},n.prototype.trace=function(e,t){this.logMessage(e,{logLevel:No.Trace,containsPii:!1,correlationId:t||Le.EMPTY_STRING})},n.prototype.tracePii=function(e,t){this.logMessage(e,{logLevel:No.Trace,containsPii:!0,correlationId:t||Le.EMPTY_STRING})},n.prototype.isPiiLoggingEnabled=function(){return this.piiLoggingEnabled||!1},n}()),Gj="@azure/msal-common",ZM="13.3.1",Vn=(function(n){n[n.None=0]="None",n.AzurePublic="https://login.microsoftonline.com",n.AzurePpe="https://login.windows-ppe.net",n.AzureChina="https://login.chinacloudapi.cn",n.AzureGermany="https://login.microsoftonline.de",n.AzureUsGovernment="https://login.microsoftonline.us"}(d0=d0||{}),{redirectUriNotSet:{code:"redirect_uri_empty",desc:"A redirect URI is required for all calls, and none has been set."},postLogoutUriNotSet:{code:"post_logout_uri_empty",desc:"A post logout redirect has not been set."},claimsRequestParsingError:{code:"claims_request_parsing_error",desc:"Could not parse the given claims request object."},authorityUriInsecure:{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"},urlParseError:{code:"url_parse_error",desc:"URL could not be parsed into appropriate segments."},urlEmptyError:{code:"empty_url_error",desc:"URL was empty or null."},emptyScopesError:{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."},nonArrayScopesError:{code:"nonarray_input_scopes_error",desc:"Scopes cannot be passed as non-array."},clientIdSingleScopeError:{code:"clientid_input_scopes_error",desc:"Client ID can only be provided as a single scope."},invalidPrompt:{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"},invalidClaimsRequest:{code:"invalid_claims",desc:"Given claims parameter must be a stringified JSON object."},tokenRequestEmptyError:{code:"token_request_empty",desc:"Token request was empty and not found in cache."},logoutRequestEmptyError:{code:"logout_request_empty",desc:"The logout request was null or undefined."},invalidCodeChallengeMethod:{code:"invalid_code_challenge_method",desc:'code_challenge_method passed is invalid. Valid values are "plain" and "S256".'},invalidCodeChallengeParams:{code:"pkce_params_missing",desc:"Both params: code_challenge and code_challenge_method are to be passed if to be sent in the request"},invalidCloudDiscoveryMetadata:{code:"invalid_cloud_discovery_metadata",desc:"Invalid cloudDiscoveryMetadata provided. Must be a stringified JSON object containing tenant_discovery_endpoint and metadata fields"},invalidAuthorityMetadata:{code:"invalid_authority_metadata",desc:"Invalid authorityMetadata provided. Must by a stringified JSON object containing authorization_endpoint, token_endpoint, issuer fields."},untrustedAuthority:{code:"untrusted_authority",desc:"The provided authority is not a trusted authority. Please include this authority in the knownAuthorities config parameter."},invalidAzureCloudInstance:{code:"invalid_azure_cloud_instance",desc:"Invalid AzureCloudInstance provided. Please refer MSAL JS docs: aks.ms/msaljs/azure_cloud_instance for valid values"},missingSshJwk:{code:"missing_ssh_jwk",desc:"Missing sshJwk in SSH certificate request. A stringified JSON Web Key is required when using the SSH authentication scheme."},missingSshKid:{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."},missingNonceAuthenticationHeader:{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."},invalidAuthenticationHeader:{code:"invalid_authentication_header",desc:"Invalid authentication header provided"},authorityMismatch:{code:"authority_mismatch",desc:"Authority mismatch error. Authority provided in login request or PublicClientApplication config does not match the environment of the provided account. Please use a matching account or make an interactive request to login to this authority."}}),yi=function(n){function e(t,r){return t=n.call(this,t,r)||this,t.name="ClientConfigurationError",Object.setPrototypeOf(t,e.prototype),t}return Ja(e,n),e.createRedirectUriEmptyError=function(){return new e(Vn.redirectUriNotSet.code,Vn.redirectUriNotSet.desc)},e.createPostLogoutRedirectUriEmptyError=function(){return new e(Vn.postLogoutUriNotSet.code,Vn.postLogoutUriNotSet.desc)},e.createClaimsRequestParsingError=function(t){return new e(Vn.claimsRequestParsingError.code,Vn.claimsRequestParsingError.desc+" Given value: "+t)},e.createInsecureAuthorityUriError=function(t){return new e(Vn.authorityUriInsecure.code,Vn.authorityUriInsecure.desc+" Given URI: "+t)},e.createUrlParseError=function(t){return new e(Vn.urlParseError.code,Vn.urlParseError.desc+" Given Error: "+t)},e.createUrlEmptyError=function(){return new e(Vn.urlEmptyError.code,Vn.urlEmptyError.desc)},e.createEmptyScopesArrayError=function(){return new e(Vn.emptyScopesError.code,""+Vn.emptyScopesError.desc)},e.createClientIdSingleScopeError=function(t){return new e(Vn.clientIdSingleScopeError.code,Vn.clientIdSingleScopeError.desc+" Given Scopes: "+t)},e.createInvalidPromptError=function(t){return new e(Vn.invalidPrompt.code,Vn.invalidPrompt.desc+" Given value: "+t)},e.createInvalidClaimsRequestError=function(){return new e(Vn.invalidClaimsRequest.code,Vn.invalidClaimsRequest.desc)},e.createEmptyLogoutRequestError=function(){return new e(Vn.logoutRequestEmptyError.code,Vn.logoutRequestEmptyError.desc)},e.createEmptyTokenRequestError=function(){return new e(Vn.tokenRequestEmptyError.code,Vn.tokenRequestEmptyError.desc)},e.createInvalidCodeChallengeMethodError=function(){return new e(Vn.invalidCodeChallengeMethod.code,Vn.invalidCodeChallengeMethod.desc)},e.createInvalidCodeChallengeParamsError=function(){return new e(Vn.invalidCodeChallengeParams.code,Vn.invalidCodeChallengeParams.desc)},e.createInvalidCloudDiscoveryMetadataError=function(){return new e(Vn.invalidCloudDiscoveryMetadata.code,Vn.invalidCloudDiscoveryMetadata.desc)},e.createInvalidAuthorityMetadataError=function(){return new e(Vn.invalidAuthorityMetadata.code,Vn.invalidAuthorityMetadata.desc)},e.createUntrustedAuthorityError=function(){return new e(Vn.untrustedAuthority.code,Vn.untrustedAuthority.desc)},e.createInvalidAzureCloudInstanceError=function(){return new e(Vn.invalidAzureCloudInstance.code,Vn.invalidAzureCloudInstance.desc)},e.createMissingSshJwkError=function(){return new e(Vn.missingSshJwk.code,Vn.missingSshJwk.desc)},e.createMissingSshKidError=function(){return new e(Vn.missingSshKid.code,Vn.missingSshKid.desc)},e.createMissingNonceAuthenticationHeadersError=function(){return new e(Vn.missingNonceAuthenticationHeader.code,Vn.missingNonceAuthenticationHeader.desc)},e.createInvalidAuthenticationHeaderError=function(t,r){return new e(Vn.invalidAuthenticationHeader.code,Vn.invalidAuthenticationHeader.desc+". Invalid header: "+t+". Details: "+r)},e.createAuthorityMismatchError=function(){return new e(Vn.authorityMismatch.code,Vn.authorityMismatch.desc)},e}(en),fa=function(){function n(r){var t=this,r=r?Kt.trimArrayEntries(vE(r)):[],r=r?Kt.removeEmptyStringsFromArray(r):[];this.validateInputScopes(r),this.scopes=new Set,r.forEach(function(i){return t.scopes.add(i)})}return n.fromString=function(e){return new n((e||Le.EMPTY_STRING).split(" "))},n.createSearchScopes=function(e){return e=new n(e),e.containsOnlyOIDCScopes()?e.removeScope(Le.OFFLINE_ACCESS_SCOPE):e.removeOIDCScopes(),e},n.prototype.validateInputScopes=function(e){if(!e||e.length<1)throw yi.createEmptyScopesArrayError()},n.prototype.containsScope=function(e){var t=new n(this.printScopesLowerCase().split(" "));return!Kt.isEmpty(e)&&t.scopes.has(e.toLowerCase())},n.prototype.containsScopeSet=function(e){var t=this;return!(!e||e.scopes.size<=0)&&this.scopes.size>=e.scopes.size&&e.asArray().every(function(r){return t.containsScope(r)})},n.prototype.containsOnlyOIDCScopes=function(){var e=this,t=0;return jj.forEach(function(r){e.containsScope(r)&&(t+=1)}),this.scopes.size===t},n.prototype.appendScope=function(e){Kt.isEmpty(e)||this.scopes.add(e.trim())},n.prototype.appendScopes=function(e){var t=this;try{e.forEach(function(r){return t.appendScope(r)})}catch(r){throw en.createAppendScopeSetError(r)}},n.prototype.removeScope=function(e){if(Kt.isEmpty(e))throw en.createRemoveEmptyScopeFromSetError(e);this.scopes.delete(e.trim())},n.prototype.removeOIDCScopes=function(){var e=this;jj.forEach(function(t){e.scopes.delete(t)})},n.prototype.unionScopeSets=function(e){var t;if(e)return t=new Set,e.scopes.forEach(function(r){return t.add(r.toLowerCase())}),this.scopes.forEach(function(r){return t.add(r.toLowerCase())}),t;throw en.createEmptyInputScopeSetError()},n.prototype.intersectingScopeSets=function(r){if(!r)throw en.createEmptyInputScopeSetError();r.containsOnlyOIDCScopes()||r.removeOIDCScopes();var t=this.unionScopeSets(r),r=r.getScopeCount(),i=this.getScopeCount();return t.sizee+t)throw en.createMaxAgeTranspiredError()},n}(),es=function(){function n(e,t,r){this.clientId=e,this.cryptoImpl=t,this.commonLogger=r.clone(Gj,ZM)}return n.prototype.getAllAccounts=function(){var e=this,t=this.getAccountKeys();return t.length<1||(t=t.reduce(function(r,i){return i=e.getAccount(i),i&&r.push(i),r},[])).length<1?[]:t.map(function(r){return e.getAccountInfoFromEntity(r)})},n.prototype.getAccountInfoFilteredBy=function(e){return e=this.getAccountsFilteredBy(e),0n.nowSeconds()},n.delay=function(e,t){return new Promise(function(r){return setTimeout(function(){return r(t)},e)})},n}(),Zf=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return Ja(e,n),e.createAccessTokenEntity=function(ce,r,i,o,a,l,h,p,g,_,x,C,M,L,F){var z,ee=new e,ce=(ee.homeAccountId=ce,ee.credentialType=In.ACCESS_TOKEN,ee.secret=i,ec.nowSeconds());if(ee.cachedAt=ce.toString(),ee.expiresOn=h.toString(),ee.extendedExpiresOn=p.toString(),_&&(ee.refreshOn=_.toString()),ee.environment=r,ee.clientId=o,ee.realm=a,ee.target=l,ee.userAssertionHash=C,ee.tokenType=Kt.isEmpty(x)?qr.BEARER:x,L&&(ee.requestedClaims=L,ee.requestedClaimsHash=F),((ce=ee.tokenType)==null?void 0:ce.toLowerCase())!==qr.BEARER.toLowerCase())switch(ee.credentialType=In.ACCESS_TOKEN_WITH_AUTH_SCHEME,ee.tokenType){case qr.POP:var se=ml.extractTokenClaims(i,g);if((z=se==null?void 0:se.cnf)==null||!z.kid)throw en.createTokenClaimsRequiredError();ee.keyId=se.cnf.kid;break;case qr.SSH:ee.keyId=M}return ee},e.isAccessTokenEntity=function(t){return!!t&&t.hasOwnProperty("homeAccountId")&&t.hasOwnProperty("environment")&&t.hasOwnProperty("credentialType")&&t.hasOwnProperty("realm")&&t.hasOwnProperty("clientId")&&t.hasOwnProperty("secret")&&t.hasOwnProperty("target")&&(t.credentialType===In.ACCESS_TOKEN||t.credentialType===In.ACCESS_TOKEN_WITH_AUTH_SCHEME)},e}(JM),Cm=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return Ja(e,n),e.createRefreshTokenEntity=function(t,r,i,o,a,l){var h=new e;return h.clientId=o,h.credentialType=In.REFRESH_TOKEN,h.environment=r,h.homeAccountId=t,h.secret=i,h.userAssertionHash=l,a&&(h.familyId=a),h},e.isRefreshTokenEntity=function(t){return!!t&&t.hasOwnProperty("homeAccountId")&&t.hasOwnProperty("environment")&&t.hasOwnProperty("credentialType")&&t.hasOwnProperty("clientId")&&t.hasOwnProperty("secret")&&t.credentialType===In.REFRESH_TOKEN},e}(JM),$j=["interaction_required","consent_required","login_required"],Fwe=["message_only","additional_action","basic_action","user_password_expired","consent_required"],Am={noTokensFoundError:{code:"no_tokens_found",desc:"No refresh token found in the cache. Please sign-in."},native_account_unavailable:{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."}},tc=function(n){function e(t,r,i,o,a,l,h){return t=n.call(this,t,r,i)||this,Object.setPrototypeOf(t,e.prototype),t.timestamp=o||Le.EMPTY_STRING,t.traceId=a||Le.EMPTY_STRING,t.correlationId=l||Le.EMPTY_STRING,t.claims=h||Le.EMPTY_STRING,t.name="InteractionRequiredAuthError",t}return Ja(e,n),e.isInteractionRequiredError=function(o,r,a){var o=!!o&&-1<$j.indexOf(o),a=!!a&&-1=Xo.MAX_CACHED_ERRORS&&(t.failedRequests.shift(),t.failedRequests.shift(),t.errors.shift()),t.failedRequests.push(this.apiId,this.correlationId),Kt.isEmpty(e.subError)?Kt.isEmpty(e.errorCode)?e&&e.toString()?t.errors.push(e.toString()):t.errors.push(Xo.UNKNOWN_ERROR):t.errors.push(e.errorCode):t.errors.push(e.subError),this.cacheManager.setServerTelemetry(this.telemetryCacheKey,t)},n.prototype.incrementCacheHits=function(){var e=this.getLastRequests();return e.cacheHits+=1,this.cacheManager.setServerTelemetry(this.telemetryCacheKey,e),e.cacheHits},n.prototype.getLastRequests=function(){var e=new RE;return this.cacheManager.getServerTelemetry(this.telemetryCacheKey)||e},n.prototype.clearTelemetryCache=function(){var e,t=this.getLastRequests(),r=n.maxErrorsToSend(t);r===t.errors.length?this.cacheManager.removeItem(this.telemetryCacheKey):((e=new RE).failedRequests=t.failedRequests.slice(2*r),e.errors=t.errors.slice(r),this.cacheManager.setServerTelemetry(this.telemetryCacheKey,e))},n.maxErrorsToSend=function(e){for(var t=0,r=0,i=e.errors.length,o=0;o "+t)},e.createBlockReloadInHiddenIframeError=function(){return new e(It.blockTokenRequestsInHiddenIframeError.code,It.blockTokenRequestsInHiddenIframeError.desc)},e.createBlockAcquireTokenInPopupsError=function(){return new e(It.blockAcquireTokenInPopupsError.code,It.blockAcquireTokenInPopupsError.desc)},e.createIframeClosedPrematurelyError=function(){return new e(It.iframeClosedPrematurelyError.code,It.iframeClosedPrematurelyError.desc)},e.createSilentLogoutUnsupportedError=function(){return new e(It.silentLogoutUnsupportedError.code,It.silentLogoutUnsupportedError.desc)},e.createNoAccountError=function(){return new e(It.noAccountError.code,It.noAccountError.desc)},e.createSilentPromptValueError=function(t){return new e(It.silentPromptValueError.code,It.silentPromptValueError.desc+" Given value: "+t)},e.createUnableToParseTokenRequestCacheError=function(){return new e(It.unableToParseTokenRequestCacheError.code,It.unableToParseTokenRequestCacheError.desc)},e.createNoTokenRequestCacheError=function(){return new e(It.noTokenRequestCacheError.code,It.noTokenRequestCacheError.desc)},e.createAuthRequestNotSetError=function(){return new e(It.authRequestNotSet.code,It.authRequestNotSet.desc)},e.createNoCachedAuthorityError=function(){return new e(It.noCachedAuthorityError.code,It.noCachedAuthorityError.desc)},e.createInvalidCacheTypeError=function(){return new e(It.invalidCacheType.code,""+It.invalidCacheType.desc)},e.createNonBrowserEnvironmentError=function(){return new e(It.notInBrowserEnvironment.code,It.notInBrowserEnvironment.desc)},e.createDatabaseNotOpenError=function(){return new e(It.databaseNotOpen.code,It.databaseNotOpen.desc)},e.createNoNetworkConnectivityError=function(){return new e(It.noNetworkConnectivity.code,It.noNetworkConnectivity.desc)},e.createPostRequestFailedError=function(t,r){return new e(It.postRequestFailed.code,It.postRequestFailed.desc+" | Network client threw: "+t+" | Attempted to reach: "+r.split("?")[0])},e.createGetRequestFailedError=function(t,r){return new e(It.getRequestFailed.code,It.getRequestFailed.desc+" | Network client threw: "+t+" | Attempted to reach: "+r.split("?")[0])},e.createFailedToParseNetworkResponseError=function(t){return new e(It.failedToParseNetworkResponse.code,It.failedToParseNetworkResponse.desc+" | Attempted to reach: "+t.split("?")[0])},e.createUnableToLoadTokenError=function(t){return new e(It.unableToLoadTokenError.code,It.unableToLoadTokenError.desc+" | "+t)},e.createSigningKeyNotFoundInStorageError=function(t){return new e(It.signingKeyNotFoundInStorage.code,It.signingKeyNotFoundInStorage.desc+" | No match found for KeyId: "+t)},e.createAuthCodeRequiredError=function(){return new e(It.authCodeRequired.code,It.authCodeRequired.desc)},e.createAuthCodeOrNativeAccountIdRequiredError=function(){return new e(It.authCodeOrNativeAccountRequired.code,It.authCodeOrNativeAccountRequired.desc)},e.createSpaCodeAndNativeAccountIdPresentError=function(){return new e(It.spaCodeAndNativeAccountPresent.code,It.spaCodeAndNativeAccountPresent.desc)},e.createDatabaseUnavailableError=function(){return new e(It.databaseUnavailable.code,It.databaseUnavailable.desc)},e.createUnableToAcquireTokenFromNativePlatformError=function(){return new e(It.unableToAcquireTokenFromNativePlatform.code,It.unableToAcquireTokenFromNativePlatform.desc)},e.createNativeHandshakeTimeoutError=function(){return new e(It.nativeHandshakeTimeout.code,It.nativeHandshakeTimeout.desc)},e.createNativeExtensionNotInstalledError=function(){return new e(It.nativeExtensionNotInstalled.code,It.nativeExtensionNotInstalled.desc)},e.createNativeConnectionNotEstablishedError=function(){return new e(It.nativeConnectionNotEstablished.code,It.nativeConnectionNotEstablished.desc)},e.createNativeBrokerCalledBeforeInitialize=function(){return new e(It.nativeBrokerCalledBeforeInitialize.code,It.nativeBrokerCalledBeforeInitialize.desc)},e.createNativePromptParameterNotSupportedError=function(){return new e(It.nativePromptNotSupported.code,It.nativePromptNotSupported.desc)},e}(wn),Pc={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"},b0={CHANNEL_ID:"53ee284d-920a-4b59-9d30-a60315b26836",PREFERRED_EXTENSION_ID:"ppnbnpeolgkicgegkbkbjmhlideopiji",MATS_TELEMETRY:"MATS"},i9=(function(n){n.HandshakeRequest="Handshake",n.HandshakeResponse="HandshakeResponse",n.GetToken="GetToken",n.Response="Response"}(wu=wu||{}),function(n){n.LocalStorage="localStorage",n.SessionStorage="sessionStorage",n.MemoryStorage="memoryStorage"}(go=go||{}),function(n){n.GET="GET",n.POST="POST"}(yl=yl||{}),function(n){n.AUTHORITY="authority",n.ACQUIRE_TOKEN_ACCOUNT="acquireToken.account",n.SESSION_STATE="session.state",n.REQUEST_STATE="request.state",n.NONCE_IDTOKEN="nonce.id_token",n.ORIGIN_URI="request.origin",n.RENEW_STATUS="token.renew.status",n.URL_HASH="urlHash",n.REQUEST_PARAMS="request.params",n.SCOPES="scopes",n.INTERACTION_STATUS_KEY="interaction.status",n.CCS_CREDENTIAL="ccs.credential",n.CORRELATION_ID="request.correlationId",n.NATIVE_REQUEST="request.native",n.REDIRECT_CONTEXT="request.redirect.context"}(Mr=Mr||{}),function(n){n.ACCOUNT_KEYS="msal.account.keys",n.TOKEN_KEYS="msal.token.keys"}(_l=_l||{}),function(n){n.WRAPPER_SKU="wrapper.sku",n.WRAPPER_VER="wrapper.version"}(Pm=Pm||{}),function(n){n[n.acquireTokenRedirect=861]="acquireTokenRedirect",n[n.acquireTokenPopup=862]="acquireTokenPopup",n[n.ssoSilent=863]="ssoSilent",n[n.acquireTokenSilent_authCode=864]="acquireTokenSilent_authCode",n[n.handleRedirectPromise=865]="handleRedirectPromise",n[n.acquireTokenByCode=866]="acquireTokenByCode",n[n.acquireTokenSilent_silentFlow=61]="acquireTokenSilent_silentFlow",n[n.logout=961]="logout",n[n.logoutPopup=962]="logoutPopup"}(_i=_i||{}),function(n){n.Redirect="redirect",n.Popup="popup",n.Silent="silent",n.None="none"}(hn=hn||{}),function(n){n.Startup="startup",n.Login="login",n.Logout="logout",n.AcquireToken="acquireToken",n.SsoSilent="ssoSilent",n.HandleRedirect="handleRedirect",n.None="none"}(Qj=Qj||{}),{scopes:f0}),Mm="jwk",nR=(function(n){n.React="@azure/msal-react",n.Angular="@azure/msal-angular"}(Jj=Jj||{}),"msal.db"),Kwe=1,Zwe=nR+".keys",ns=(function(n){n[n.Default=0]="Default",n[n.AccessToken=1]="AccessToken",n[n.AccessTokenAndRefreshToken=2]="AccessTokenAndRefreshToken",n[n.RefreshToken=3]="RefreshToken",n[n.RefreshTokenAndNetwork=4]="RefreshTokenAndNetwork",n[n.Skip=5]="Skip"}(ts=ts||{}),{redirectUriNotSet:{code:"redirect_uri_empty",desc:"A redirect URI is required for all calls, and none has been set."},postLogoutUriNotSet:{code:"post_logout_uri_empty",desc:"A post logout redirect has not been set."},storageNotSupportedError:{code:"storage_not_supported",desc:"Given storage configuration option was not supported."},noRedirectCallbacksSet:{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."},invalidCallbackObject:{code:"invalid_callback_object",desc:"The object passed for the callback was invalid. More information is available here: https://github.com/AzureAD/microsoft-authentication-library-for-js/wiki/MSAL-basics."},stubPcaInstanceCalled:{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"},inMemRedirectUnavailable:{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."},entropyNotProvided:{code:"entropy_not_provided",desc:"The available browser crypto interface requires entropy set via system.cryptoOptions.entropy configuration option."}}),OE=function(n){function e(t,r){return t=n.call(this,t,r)||this,t.name="BrowserConfigurationAuthError",Object.setPrototypeOf(t,e.prototype),t}return Zo(e,n),e.createRedirectUriEmptyError=function(){return new e(ns.redirectUriNotSet.code,ns.redirectUriNotSet.desc)},e.createPostLogoutRedirectUriEmptyError=function(){return new e(ns.postLogoutUriNotSet.code,ns.postLogoutUriNotSet.desc)},e.createStorageNotSupportedError=function(t){return new e(ns.storageNotSupportedError.code,ns.storageNotSupportedError.desc+" Given Location: "+t)},e.createRedirectCallbacksNotSetError=function(){return new e(ns.noRedirectCallbacksSet.code,ns.noRedirectCallbacksSet.desc)},e.createStubPcaInstanceCalledError=function(){return new e(ns.stubPcaInstanceCalled.code,ns.stubPcaInstanceCalled.desc)},e.createInMemoryRedirectUnavailableError=function(){return new e(ns.inMemRedirectUnavailable.code,ns.inMemRedirectUnavailable.desc)},e.createEntropyNotProvided=function(){return new e(ns.entropyNotProvided.code,ns.entropyNotProvided.desc)},e}(wn),o9=function(){function n(e){this.validateWindowStorage(e),this.windowStorage=window[e]}return n.prototype.validateWindowStorage=function(e){if(e!==go.LocalStorage&&e!==go.SessionStorage||!window[e])throw OE.createStorageNotSupportedError(e)},n.prototype.getItem=function(e){return this.windowStorage.getItem(e)},n.prototype.setItem=function(e,t){this.windowStorage.setItem(e,t)},n.prototype.removeItem=function(e){this.windowStorage.removeItem(e)},n.prototype.getKeys=function(){return Object.keys(this.windowStorage)},n.prototype.containsKey=function(e){return this.windowStorage.hasOwnProperty(e)},n}(),rR=function(){function n(){this.cache=new Map}return n.prototype.getItem=function(e){return this.cache.get(e)||null},n.prototype.setItem=function(e,t){this.cache.set(e,t)},n.prototype.removeItem=function(e){this.cache.delete(e)},n.prototype.getKeys=function(){var e=[];return this.cache.forEach(function(t,r){e.push(r)}),e},n.prototype.containsKey=function(e){return this.cache.has(e)},n.prototype.clear=function(){this.cache.clear()},n}(),a9=function(){function n(){}return n.extractBrowserRequestState=function(e,t){if(Kt.isEmpty(t))return null;try{return bu.parseRequestState(e,t).libraryState.meta}catch(r){throw en.createInvalidStateError(t,r)}},n.parseServerResponseFromHash=function(e){return e?(e=new wr(e),wr.getDeserializedHash(e.getHash())):{}},n}(),iR=function(n){function e(t,r,i,o){return t=n.call(this,t,i,o)||this,t.COOKIE_LIFE_MULTIPLIER=864e5,t.cacheConfig=r,t.logger=o,t.internalStorage=new rR,t.browserStorage=t.setupBrowserStorage(t.cacheConfig.cacheLocation),t.temporaryCacheStorage=t.setupTemporaryCacheStorage(t.cacheConfig.temporaryCacheLocation,t.cacheConfig.cacheLocation),r.cacheMigrationEnabled&&(t.migrateCacheEntries(),t.createKeyMaps()),t}return Zo(e,n),e.prototype.setupBrowserStorage=function(t){switch(t){case go.LocalStorage:case go.SessionStorage:try{return new o9(t)}catch(r){this.logger.verbose(r);break}}return this.cacheConfig.cacheLocation=go.MemoryStorage,new rR},e.prototype.setupTemporaryCacheStorage=function(t,r){switch(r){case go.LocalStorage:case go.SessionStorage:try{return new o9(t||go.SessionStorage)}catch(i){return this.logger.verbose(i),this.internalStorage}case go.MemoryStorage:default:return this.internalStorage}},e.prototype.migrateCacheEntries=function(){var t=this,r=Le.CACHE_PREFIX+"."+xo.ID_TOKEN,i=Le.CACHE_PREFIX+"."+xo.CLIENT_INFO,o=Le.CACHE_PREFIX+"."+xo.ERROR,a=Le.CACHE_PREFIX+"."+xo.ERROR_DESC,l=[this.browserStorage.getItem(r),this.browserStorage.getItem(i),this.browserStorage.getItem(o),this.browserStorage.getItem(a)];[xo.ID_TOKEN,xo.CLIENT_INFO,xo.ERROR,xo.ERROR_DESC].forEach(function(h,p){return t.migrateCacheEntry(h,l[p])})},e.prototype.migrateCacheEntry=function(t,r){r&&this.setTemporaryCache(t,r,!0)},e.prototype.createKeyMaps=function(){var t=this,r=(this.logger.trace("BrowserCacheManager - createKeyMaps called."),this.getItem(_l.ACCOUNT_KEYS)),i=this.getItem(_l.TOKEN_KEYS+"."+this.clientId);r&&i?this.logger.verbose("BrowserCacheManager:createKeyMaps - account and token key maps already exist, skipping migration."):this.browserStorage.getKeys().forEach(function(o){var a;if(t.isCredentialKey(o)&&(a=t.getItem(o))){var l,h,p=t.validateAndParseJson(a);if(p&&p.hasOwnProperty("credentialType"))switch(p.credentialType){case In.ID_TOKEN:if(Kf.isIdTokenEntity(p))return t.logger.trace("BrowserCacheManager:createKeyMaps - idToken found, saving key to token key map"),t.logger.tracePii("BrowserCacheManager:createKeyMaps - idToken with key: "+o+" found, saving key to token key map"),h=es.toObject(new Kf,p),h=t.updateCredentialCacheKey(o,h),void t.addTokenKey(h,In.ID_TOKEN);t.logger.trace("BrowserCacheManager:createKeyMaps - key found matching idToken schema with value containing idToken credentialType field but value failed IdTokenEntity validation, skipping."),t.logger.tracePii("BrowserCacheManager:createKeyMaps - failed idToken validation on key: "+o);break;case In.ACCESS_TOKEN:case In.ACCESS_TOKEN_WITH_AUTH_SCHEME:if(Zf.isAccessTokenEntity(p))return t.logger.trace("BrowserCacheManager:createKeyMaps - accessToken found, saving key to token key map"),t.logger.tracePii("BrowserCacheManager:createKeyMaps - accessToken with key: "+o+" found, saving key to token key map"),l=es.toObject(new Zf,p),h=t.updateCredentialCacheKey(o,l),void t.addTokenKey(h,In.ACCESS_TOKEN);t.logger.trace("BrowserCacheManager:createKeyMaps - key found matching accessToken schema with value containing accessToken credentialType field but value failed AccessTokenEntity validation, skipping."),t.logger.tracePii("BrowserCacheManager:createKeyMaps - failed accessToken validation on key: "+o);break;case In.REFRESH_TOKEN:if(Cm.isRefreshTokenEntity(p))return t.logger.trace("BrowserCacheManager:createKeyMaps - refreshToken found, saving key to token key map"),t.logger.tracePii("BrowserCacheManager:createKeyMaps - refreshToken with key: "+o+" found, saving key to token key map"),l=es.toObject(new Cm,p),h=t.updateCredentialCacheKey(o,l),void t.addTokenKey(h,In.REFRESH_TOKEN);t.logger.trace("BrowserCacheManager:createKeyMaps - key found matching refreshToken schema with value containing refreshToken credentialType field but value failed RefreshTokenEntity validation, skipping."),t.logger.tracePii("BrowserCacheManager:createKeyMaps - failed refreshToken validation on key: "+o)}}t.isAccountKey(o)&&(a=t.getItem(o))&&(a=t.validateAndParseJson(a))&&Qo.isAccountEntity(a)&&(t.logger.trace("BrowserCacheManager:createKeyMaps - account found, saving key to account key map"),t.logger.tracePii("BrowserCacheManager:createKeyMaps - account with key: "+o+" found, saving key to account key map"),t.addAccountKeyToMap(o))})},e.prototype.validateAndParseJson=function(t){try{var r=JSON.parse(t);return r&&typeof r=="object"?r:null}catch{return null}},e.prototype.getItem=function(t){return this.browserStorage.getItem(t)},e.prototype.setItem=function(t,r){this.browserStorage.setItem(t,r)},e.prototype.getAccount=function(t){this.logger.trace("BrowserCacheManager.getAccount called");var r=this.getItem(t);return(r=r&&this.validateAndParseJson(r))&&Qo.isAccountEntity(r)?es.toObject(new Qo,r):(this.removeAccountKeyFromMap(t),null)},e.prototype.setAccount=function(t){this.logger.trace("BrowserCacheManager.setAccount called");var r=t.generateAccountKey();this.setItem(r,JSON.stringify(t)),this.addAccountKeyToMap(r)},e.prototype.getAccountKeys=function(){this.logger.trace("BrowserCacheManager.getAccountKeys called");var t=this.getItem(_l.ACCOUNT_KEYS);return t?JSON.parse(t):(this.logger.verbose("BrowserCacheManager.getAccountKeys - No account keys found"),[])},e.prototype.addAccountKeyToMap=function(t){this.logger.trace("BrowserCacheManager.addAccountKeyToMap called"),this.logger.tracePii("BrowserCacheManager.addAccountKeyToMap called with key: "+t);var r=this.getAccountKeys();r.indexOf(t)===-1?(r.push(t),this.setItem(_l.ACCOUNT_KEYS,JSON.stringify(r)),this.logger.verbose("BrowserCacheManager.addAccountKeyToMap account key added")):this.logger.verbose("BrowserCacheManager.addAccountKeyToMap account key already exists in map")},e.prototype.removeAccountKeyFromMap=function(i){this.logger.trace("BrowserCacheManager.removeAccountKeyFromMap called"),this.logger.tracePii("BrowserCacheManager.removeAccountKeyFromMap called with key: "+i);var r=this.getAccountKeys(),i=r.indexOf(i);-1l)i.removeHiddenIframe(t),clearInterval(h),a(Vt.createMonitorIframeTimeoutError());else{var p=Le.EMPTY_STRING,g=t.contentWindow;try{p=g?g.location.href:Le.EMPTY_STRING}catch{}Kt.isEmpty(p)||(p=g?g.location.hash:Le.EMPTY_STRING,wr.hashContainsKnownProperties(p)&&(i.removeHiddenIframe(t),clearInterval(h),o(p)))}},i.pollIntervalMilliseconds)})},e.prototype.loadFrame=function(t){var r=this;return this.performanceClient.addQueueMeasurement(nt.SilentHandlerLoadFrame,this.authCodeRequest.correlationId),new Promise(function(i,o){var a=r.createHiddenIframe();setTimeout(function(){a?(a.src=t,i(a)):o("Unable to load iframe")},r.navigateFrameWait)})},e.prototype.loadFrameSync=function(t){var r=this.createHiddenIframe();return r.src=t,r},e.prototype.createHiddenIframe=function(){var t=document.createElement("iframe");return t.style.visibility="hidden",t.style.position="absolute",t.style.width=t.style.height="0",t.style.border="0",t.setAttribute("sandbox","allow-scripts allow-same-origin allow-forms"),document.getElementsByTagName("body")[0].appendChild(t),t},e.prototype.removeHiddenIframe=function(t){document.body===t.parentNode&&document.body.removeChild(t)},e}(aR),sxe=function(n){function e(t,r,i,o,a,l,h,p,g,_,x){return t=n.call(this,t,r,i,o,a,l,p,_,x)||this,t.apiId=h,t.nativeStorage=g,t}return Zo(e,n),e.prototype.acquireToken=function(t){return dt(this,void 0,void 0,function(){var r,i,o,a;return ft(this,function(l){switch(l.label){case 0:if(this.performanceClient.addQueueMeasurement(nt.SilentIframeClientAcquireToken,t.correlationId),this.logger.verbose("acquireTokenByIframe called"),r=this.performanceClient.startMeasurement(nt.SilentIframeClientAcquireToken,t.correlationId),Kt.isEmpty(t.loginHint)&&Kt.isEmpty(t.sid)&&(!t.account||Kt.isEmpty(t.account.username))&&this.logger.warning("No user hint provided. The authorization server may need more information to complete this request."),t.prompt&&t.prompt!==da.NONE&&t.prompt!==da.NO_SESSION)throw r.endMeasurement({success:!1}),Vt.createSilentPromptValueError(t.prompt);return this.performanceClient.setPreQueueTime(nt.StandardInteractionClientInitializeAuthorizationRequest,t.correlationId),[4,this.initializeAuthorizationRequest(yn(yn({},t),{prompt:t.prompt||da.NONE}),hn.Silent)];case 1:i=l.sent(),this.browserStorage.updateCacheEntries(i.state,i.nonce,i.authority,i.loginHint||Le.EMPTY_STRING,i.account||null),o=this.initializeServerTelemetryManager(this.apiId),l.label=2;case 2:return l.trys.push([2,5,,6]),this.performanceClient.setPreQueueTime(nt.StandardInteractionClientCreateAuthCodeClient,t.correlationId),[4,this.createAuthCodeClient(o,i.authority,i.azureCloudOptions)];case 3:return a=l.sent(),this.logger.verbose("Auth code client created"),this.performanceClient.setPreQueueTime(nt.SilentIframeClientTokenHelper,t.correlationId),[4,this.silentTokenHelper(a,i).then(function(h){return r.endMeasurement({success:!0,fromCache:!1,requestId:h.requestId}),h})];case 4:return[2,l.sent()];case 5:throw(a=l.sent())instanceof wn&&a.setCorrelationId(this.correlationId),o.cacheFailedRequest(a),this.browserStorage.cleanRequestByState(i.state),r.endMeasurement({errorCode:a instanceof wn&&a.errorCode||void 0,subErrorCode:a instanceof wn&&a.subError||void 0,success:!1}),a;case 6:return[2]}})})},e.prototype.logout=function(){return Promise.reject(Vt.createSilentLogoutUnsupportedError())},e.prototype.silentTokenHelper=function(t,r){return dt(this,void 0,void 0,function(){var i,o,a,l,h,p,g,_=this;return ft(this,function(x){switch(x.label){case 0:return this.performanceClient.addQueueMeasurement(nt.SilentIframeClientTokenHelper,r.correlationId),this.performanceClient.setPreQueueTime(nt.StandardInteractionClientInitializeAuthorizationCodeRequest,r.correlationId),[4,this.initializeAuthorizationCodeRequest(r)];case 1:return i=x.sent(),this.performanceClient.setPreQueueTime(nt.GetAuthCodeUrl,r.correlationId),[4,t.getAuthCodeUrl(yn(yn({},r),{nativeBroker:Xf.isNativeAvailable(this.config,this.logger,this.nativeMessageHandler,r.authenticationScheme)}))];case 2:return a=x.sent(),o=new u9(t,this.browserStorage,i,this.logger,this.config.system,this.performanceClient),this.performanceClient.setPreQueueTime(nt.SilentHandlerInitiateAuthRequest,r.correlationId),[4,o.initiateAuthRequest(a)];case 3:return a=x.sent(),this.performanceClient.setPreQueueTime(nt.SilentHandlerMonitorIframeForHash,r.correlationId),[4,o.monitorIframeForHash(a,this.config.system.iframeHashTimeout)];case 4:if(l=x.sent(),p=wr.getDeserializedHash(l),h=this.validateAndExtractStateFromHash(p,hn.Silent,i.correlationId),p.accountId){if(this.logger.verbose("Account id found in hash, calling WAM for token"),this.nativeMessageHandler)return p=new km(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.apiId,this.performanceClient,this.nativeMessageHandler,p.accountId,this.browserStorage,this.correlationId),g=bu.parseRequestState(this.browserCrypto,h).userRequestState,[2,p.acquireToken(yn(yn({},r),{state:g,prompt:r.prompt||da.NONE})).finally(function(){_.browserStorage.cleanRequestByState(h)})];throw Vt.createNativeConnectionNotEstablishedError()}return this.performanceClient.setPreQueueTime(nt.HandleCodeResponseFromHash,r.correlationId),[2,o.handleCodeResponseFromHash(l,h,t.authority,this.networkClient)]}})})},e}(Rm),cxe=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return Zo(e,n),e.prototype.acquireToken=function(t){return dt(this,void 0,void 0,function(){var r,i,o,a,l,h=this;return ft(this,function(p){switch(p.label){case 0:return this.performanceClient.addQueueMeasurement(nt.SilentRefreshClientAcquireToken,t.correlationId),this.performanceClient.setPreQueueTime(nt.InitializeBaseRequest,t.correlationId),i=[yn({},t)],[4,this.initializeBaseRequest(t,t.account)];case 1:return r=yn.apply(void 0,i.concat([p.sent()])),o=this.performanceClient.startMeasurement(nt.SilentRefreshClientAcquireToken,r.correlationId),a=this.initializeServerTelemetryManager(_i.acquireTokenSilent_silentFlow),[4,this.createRefreshTokenClient(a,r.authority,r.azureCloudOptions)];case 2:return l=p.sent(),this.logger.verbose("Refresh token client created"),this.performanceClient.setPreQueueTime(nt.RefreshTokenClientAcquireTokenByRefreshToken,t.correlationId),[2,l.acquireTokenByRefreshToken(r).then(function(g){return o.endMeasurement({success:!0,fromCache:g.fromCache,requestId:g.requestId}),g}).catch(function(g){throw g instanceof wn&&g.setCorrelationId(h.correlationId),a.cacheFailedRequest(g),o.endMeasurement({errorCode:g.errorCode,subErrorCode:g.subError,success:!1}),g})]}})})},e.prototype.logout=function(){return Promise.reject(Vt.createSilentLogoutUnsupportedError())},e.prototype.createRefreshTokenClient=function(t,r,i){return dt(this,void 0,void 0,function(){var o;return ft(this,function(a){switch(a.label){case 0:return this.performanceClient.setPreQueueTime(nt.StandardInteractionClientGetClientConfiguration,this.correlationId),[4,this.getClientConfiguration(t,r,i)];case 1:return o=a.sent(),[2,new Yj(o,this.performanceClient)]}})})},e}(Rm),lxe=function(){function n(e,t){this.eventCallbacks=new Map,this.logger=e,this.browserCrypto=t,this.listeningToStorageEvents=!1,this.handleAccountCacheChange=this.handleAccountCacheChange.bind(this)}return n.prototype.addEventCallback=function(e){var t;return typeof window<"u"?(t=this.browserCrypto.createNewGuid(),this.eventCallbacks.set(t,e),this.logger.verbose("Event callback registered with id: "+t),t):null},n.prototype.removeEventCallback=function(e){this.eventCallbacks.delete(e),this.logger.verbose("Event callback "+e+" removed.")},n.prototype.enableAccountStorageEvents=function(){typeof window<"u"&&(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)))},n.prototype.disableAccountStorageEvents=function(){typeof window<"u"&&(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."))},n.prototype.emitEvent=function(e,t,r,i){var o,a=this;typeof window<"u"&&(o={eventType:e,interactionType:t||null,payload:r||null,error:i||null,timestamp:Date.now()},this.logger.info("Emitting event: "+e),this.eventCallbacks.forEach(function(l,h){a.logger.verbose("Emitting event to callback "+h+": "+e),l.apply(null,[o])}))},n.prototype.handleAccountCacheChange=function(e){try{var t,r,i=e.newValue||e.oldValue;i&&typeof(t=JSON.parse(i))=="object"&&Qo.isAccountEntity(t)&&(r=es.toObject(new Qo,t).getAccountInfo(),!e.oldValue&&e.newValue?(this.logger.info("Account was added to cache in a different window"),this.emitEvent(Fn.ACCOUNT_ADDED,void 0,r)):!e.newValue&&e.oldValue&&(this.logger.info("Account was removed from cache in a different window"),this.emitEvent(Fn.ACCOUNT_REMOVED,void 0,r)))}catch{}},n}(),pa=function(){function n(){}return n.decimalToHex=function(e){for(var t=e.toString(16);t.length<2;)t="0"+t;return t},n}(),h9=function(){function n(e){this.cryptoObj=e}return n.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,pa.decimalToHex(e[0])+pa.decimalToHex(e[1])+pa.decimalToHex(e[2])+pa.decimalToHex(e[3])+"-"+pa.decimalToHex(e[4])+pa.decimalToHex(e[5])+"-"+pa.decimalToHex(e[6])+pa.decimalToHex(e[7])+"-"+pa.decimalToHex(e[8])+pa.decimalToHex(e[9])+"-"+pa.decimalToHex(e[10])+pa.decimalToHex(e[11])+pa.decimalToHex(e[12])+pa.decimalToHex(e[13])+pa.decimalToHex(e[14])+pa.decimalToHex(e[15])}catch{for(var t="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx",r="0123456789abcdef",i=0,o=Le.EMPTY_STRING,a=0;a<36;a++)t[a]!=="-"&&t[a]!=="4"&&(i=16*Math.random()|0),o+=t[a]==="x"?r[i]:t[a]==="y"?r[i=i&3|8]:t[a];return o}},n.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)},n}(),xu=function(){function n(){}return n.stringToUtf8Arr=function(e){for(var t,r=0,i=e.length,o=0;o>>6):(t<65536?a[l++]=224+(t>>>12):(t<2097152?a[l++]=240+(t>>>18):(t<67108864?a[l++]=248+(t>>>24):(a[l++]=252+(t>>>30),a[l++]=128+(t>>>24&63)),a[l++]=128+(t>>>18&63)),a[l++]=128+(t>>>12&63)),a[l++]=128+(t>>>6&63)),a[l++]=128+(63&t));return a},n.stringToArrayBuffer=function(e){for(var t=new ArrayBuffer(e.length),r=new Uint8Array(t),i=0;i>>(t=l%3)&24),t!=2&&e.length-l!=1||(i+=String.fromCharCode(this.uint6ToB64(a>>>18&63),this.uint6ToB64(a>>>12&63),this.uint6ToB64(a>>>6&63),this.uint6ToB64(63&a)),a=0);return r==0?i:i.substring(0,i.length-r)+(r==1?"=":"==")},n.prototype.uint6ToB64=function(e){return e<26?e+65:e<52?e+71:e<62?e-4:e===62?43:e===63?47:65},n}(),uxe=function(){function n(){}return n.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")}return e=this.base64DecToArr(t),xu.utf8ArrToString(e)},n.prototype.base64DecToArr=function(e,t){for(var r,i=e.replace(/[^A-Za-z0-9\+\/]/g,Le.EMPTY_STRING),o=i.length,a=t?Math.ceil((3*o+1>>>2)/t)*t:3*o+1>>>2,l=new Uint8Array(a),h=void 0,p=0,g=0,_=0;_>>(16>>>h&24)&255;p=0}return l},n.prototype.b64ToUint6=function(e){return 64>(-2*i&6))))r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(r);return a};function Ixe(n){var e=n.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(y9(e).replace(/(.)/g,function(t,r){return r=r.charCodeAt(0).toString(16).toUpperCase(),"%"+(r=r.length<2?"0"+r:r)}))}catch{return y9(e)}}function NE(n){this.message=n}function Pxe(n,e){if(typeof n!="string")throw new NE("Invalid token specified");e=(e=e||{}).header===!0?0:1;try{return JSON.parse(Ixe(n.split(".")[e]))}catch(t){throw new NE("Invalid token specified: "+t.message)}}NE.prototype=new Error,NE.prototype.name="InvalidTokenError";var Mxe=function(){function n(e){var t=this,r=(this.fallbackStorage={},this._triggerTokenFetch=function(i){return i===void 0&&(i=!1),new Promise(function(o,a){typeof t.options.getToken!="function"?a(new Error("Token cannot be ".concat(i?"fetched":"renewed"," because getToken was not set or is not a function."))):t.options.getToken(function(l){try{var h=t._getTokenExpiry(l)-n.constants.tokenRefreshClockSkew;t._storeToken(l),t._setTimeoutTokenFetch(h),o()}catch{a(new Error("Invalid token returned by getToken function"))}},function(l){a(l)},t.map)})},this._setTimeoutTokenFetch=function(i){clearTimeout(t.tokenTimeOutHandle),t.tokenTimeOutHandle=setTimeout(t._triggerTokenFetch,Math.min(1e3*i,2147483647))},e.getServiceOptions());this.options=r.authOptions,this.sessionId=r.sessionId,this.map=e}return n.prototype.initialize=function(){var e=this;return this.initPromise||(this.initPromise=new Promise(function(t,r){if(e.options.authType===ri.subscriptionKey)t();else if(e.options.authType===ri.aad)e.options.authContext=e.options.authContext||n.getDefaultAuthContext(e.options),e.options.authContext.handleRedirectPromise().then(function(){setTimeout(function(){return e._loginAndAcquireTokenForAAD(t,r)})}).catch(function(o){r(new Error("Error logging in the AAD users: "+o))});else if(e.options.authType===ri.anonymous)t(e._triggerTokenFetch(!0));else if(e.options.authType===ri.sas){if(e.options.sasToken){var i=-1;try{i=e._getTokenExpiry(e.options.sasToken)}catch{return void r(new Error("An invalid sasToken was provided."))}if(i>n.constants.tokenRefreshClockSkew)return e._storeToken(e.options.sasToken),e._setTimeoutTokenFetch(i-n.constants.tokenRefreshClockSkew),void t()}t(e._triggerTokenFetch())}else r(new Error("An invalid authentication type was specified."))})),this.initPromise},n.prototype.dispose=function(){this.tokenTimeOutHandle&&(clearTimeout(this.tokenTimeOutHandle),this.tokenTimeOutHandle=null)},n.getDefaultAuthContext=function(e){if(!e.aadAppId)throw new Error("No AAD app ID was specified.");if(e.aadTenant)return this.defaultAuthContext||(this.defaultAuthContext=new Axe({auth:{authority:"".concat(e.aadInstance||yc.aadInstance).concat(e.aadTenant),clientId:e.aadAppId},cache:{cacheLocation:this.constants.preferredCacheLocation}})),this.defaultAuthContext;throw new Error("No AAD tenant was specified.")},n.prototype._loginAndAcquireTokenForAAD=function(e,t){var r=((r=this.options.authContext)==null?void 0:r.getAllAccounts())||[];r.length===0?(this.options.authContext.loginRedirect(),e()):(this.options.authContext.setActiveAccount(r[0]),this._acquireTokenForAAD(e,t))},n.prototype._acquireTokenForAAD=function(e,t){var r=this,i={scopes:[Nn.aadResourceId]};this.options.authContext.acquireTokenSilent(i).then(function(o){r._saveItem(n.constants.storage.tokenKey,o.accessToken);var a={map:r.map,type:n.constants.events.tokenAcquired},a=(r.map.events.invoke(n.constants.events.tokenAcquired,a),clearTimeout(r.tokenTimeOutHandle),new Date(o.expiresOn).getTime()-Date.now());r.tokenTimeOutHandle=setTimeout(function(){return r._acquireTokenForAAD()},a),e!=null&&e()}).catch(function(o){if(o instanceof tc)return r.options.authContext.acquireTokenRedirect(i),e==null?void 0:e();t!=null&&t(o)})},n.prototype.getAuthType=function(){return this.options.authType},n.prototype.getClientId=function(){return this.options.clientId},n.prototype.getToken=function(){if(this.options.authType===ri.aad)return this._getItem(n.constants.storage.tokenKey);if(this.options.authType!==ri.anonymous&&this.options.authType!==ri.sas)return this.options.authType===ri.subscriptionKey?this.options.subscriptionKey:void 0;var e=this._getItem(n.constants.storage.tokenKey);if(e){var t=this._getTokenExpiry(e);if(t<300&&0=n.length?void 0:n)&&n[r++],done:!n}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Rxe=function(){function n(e){for(var t in this.map=e,this.controlContainer=document.createElement("div"),this.controlContainer.classList.add("atlas-control-container"),xa){var r;xa.hasOwnProperty(t)&&((r=document.createElement("div")).classList.add(xa[t]),r.classList.add("subcontrol-container"),this.controlContainer.appendChild(r))}this.map.getMapContainer().appendChild(this.controlContainer),this.controls=new Set}return n.prototype.add=function(e,t){var r,i;if(Array.isArray(e))try{for(var o=_9(e),a=o.next();!a.done;a=o.next()){var l=a.value;this._add(l,t)}}catch(h){r={error:h}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}else this._add(e,t)},n.prototype.getControls=function(){return Array.from(this.controls)},n.prototype.remove=function(e){var t,r;if(Array.isArray(e))try{for(var i=_9(e),o=i.next();!o.done;o=i.next()){var a=o.value;this._remove(a)}}catch(l){t={error:l}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}else this._remove(e)},n.prototype._add=function(i,o){this.controls.add(i);var r=new noe().merge(o),i=i.onAdd(this.map,o),o=this.controlContainer.getElementsByClassName(r.position);if(!(0=n.length?void 0:n)&&n[r++],done:!n}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},lR=window&&window.__read||function(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r,i,o=t.call(n),a=[];try{for(;(e===void 0||0=n.length?void 0:n)&&n[r++],done:!n}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Lxe=function(){function n(e){this.markers=new Set,this.map=e}return n.prototype.add=function(e,t){var r,i;if(Array.isArray(e))try{for(var o=b9(e),a=o.next();!a.done;a=o.next()){var l=a.value;this._addMarker(l,t)}}catch(h){r={error:h}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}else this._addMarker(e,t)},n.prototype._addMarker=function(e,t){e._addToMap(this.map,t),this.markers.add(e)},n.prototype.getMarkers=function(){return Array.from(this.markers)},n.prototype.remove=function(e){var t,r;if(Array.isArray(e))try{for(var i=b9(e),o=i.next();!o.done;o=i.next()){var a=o.value;this._removeMarker(a)}}catch(l){t={error:l}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}else this._removeMarker(e)},n.prototype._removeMarker=function(e){var t=this;e instanceof p2?(e._removeFromMap(),this.markers.delete(e)):this.markers.forEach(function(r){r._getId()===e&&(r._removeFromMap(),t.markers.delete(r))})},n.prototype.clear=function(){var e=this;this.markers.forEach(function(t){t._removeFromMap(),e.markers.delete(t)})},n}(),Nxe=function(){function n(e){this.userImages=new ws,this.imageLoadTimeout=5e3,this.map=e}return n.prototype.add=function(e,t,r){var i=this;return new Promise(function(o,a){var l,h,p;i.userImages.has(e)?o():t instanceof HTMLImageElement||t instanceof ImageData?(i.map._getMap().addImage(e,t,r),i.userImages.set(e,{image:t,meta:r}),o()):typeof t=="string"&&(h=void 0,h=/=n.length?void 0:n)&&n[r++],done:!n}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Kh=function(n){function e(t,r){return r=n.call(this,r)||this,r.layers=t,r}return Dxe(e,n),e.prototype.getOptions=function(){return{}},e.prototype.setOptions=function(t){},e.prototype._buildLayers=function(){return this.layers},e.prototype._getLayerIds=function(){return this.layers.map(function(t){return t.id})},e.prototype._getSourceIds=function(){var t,r,i=new Set;try{for(var o=Fxe(this.layers),a=o.next();!a.done;a=o.next()){var l=a.value;"source"in l&&typeof l.source=="string"?i.add(l.source):"source"in l&&l.source&&i.add(l.id)}}catch(h){t={error:h}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}return i},e.prototype._updateLayoutProperty=function(t,r,i,o){var a;Ea(r,i)||(a=this.map._getMap(),this.layers.forEach(function(l){a.getLayer(l.id)?a.setLayoutProperty(l.id,t,o||r):console.warn("Could not update layout property ".concat(t," for layer ").concat(l.id," to ").concat(o||r))}))},e}(Ai),Eu=window&&window.__values||function(n){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&n[e],r=0;if(t)return t.call(n);if(n&&typeof n.length=="number")return{next:function(){return{value:(n=n&&r>=n.length?void 0:n)&&n[r++],done:!n}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Bxe=window&&window.__read||function(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r,i,o=t.call(n),a=[];try{for(;(e===void 0||0=n.length?void 0:n)&&n[r++],done:!n}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},jxe=function(){function n(e){var t=this;this._onDrag=function(r){var i,o;r.type==="mousemove"?(i=r.clientX,o=r.clientY):r.type==="touchmove"&&(i=r.touches[0].clientX,o=r.touches[0].clientY),t.draggedPopups.forEach(function(a){a._dragToPixel([i,o])})},this._onUp=function(){t.map.getMapContainer().removeEventListener("mousemove",t._onDrag),t.map.getMapContainer().removeEventListener("touchmove",t._onDrag),t.map.getMapContainer().removeEventListener("mouseup",t._onUp),t.map.getMapContainer().removeEventListener("touchend",t._onUp),t.draggedPopups.forEach(function(r){t.draggedPopups.delete(r),r._onUp()})},this.map=e,this.popups=new Set,this.draggedPopups=new Set}return n.prototype.add=function(e){var t,r;e=Array.isArray(e)?e:[e];try{for(var i=w9(e),o=i.next();!o.done;o=i.next()){var a=o.value;this.popups.has(a)||(this.popups.add(a),a.attach(this.map))}}catch(l){t={error:l}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}},n.prototype.clear=function(){var e=this;this.popups.forEach(function(t){e.popups.delete(t),t.remove()})},n.prototype.remove=function(e){var t,r;e=Array.isArray(e)?e:[e];try{for(var i=w9(e),o=i.next();!o.done;o=i.next()){var a=o.value;this.popups.has(a)&&(this.popups.delete(a),a.remove())}}catch(l){t={error:l}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}},n.prototype.getPopups=function(){return Array.from(this.popups)},n.prototype._getCollectionDiv=function(){var e=this.map.getMapContainer().querySelector(".".concat(n.Css.collection));return e||((e=document.createElement("div")).classList.add(n.Css.collection),e.setAttribute("aria-label","Map Information"),this.map.getMapContainer().appendChild(e)),e},n.prototype._addDraggedPopup=function(e){this.draggedPopups.size===0&&(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)},n.Css={collection:"popup-collection-container"},n}(),uR=window&&window.__values||function(n){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&n[e],r=0;if(t)return t.call(n);if(n&&typeof n.length=="number")return{next:function(){return{value:(n=n&&r>=n.length?void 0:n)&&n[r++],done:!n}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Vxe=function(){function n(e){this.map=e,this.sources=new ws}return n.prototype.add=function(e,t){var r,i;if(t===void 0&&(t=!0),Array.isArray(e))try{for(var o=uR(e),a=o.next();!a.done;a=o.next()){var l=a.value;this._addSource(l,t)}}catch(h){r={error:h}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}else this._addSource(e,t)},n.prototype.getRenderedShapes=function(e,t,r){return e=typeof e=="string"?e:e.getId(),r=this.map._getMap().querySourceFeatures(e,{sourceLayer:r,filter:t}),this.map.sources._mapFeaturesToShapes(r,!0,this.sources.get(e))},n.prototype.getFeatureState=function(e,t,r){return e=typeof e=="string"?e:e instanceof Ci?e.getId():e.id,t=typeof t=="string"?t:t.getId(),this.map._getMap().getFeatureState({id:e,source:t,sourceLayer:r})},n.prototype.removeFeatureState=function(e,t,r,i){e=typeof e=="string"?e:e instanceof Ci?e.getId():e.id,t=typeof t=="string"?t:t.getId(),this.map._getMap().removeFeatureState({id:e,source:t,sourceLayer:r},i)},n.prototype.setFeatureState=function(e,t,r,i){e=typeof e=="string"?e:e instanceof Ci?e.getId():e.id,t=typeof t=="string"?t:t.getId(),this.map._getMap().setFeatureState({id:e,source:t,sourceLayer:i},r)},n.prototype._buildSources=function(){var e={};return this.sources.forEach(function(t){e[t.getId()]=t._buildSource()}),e},n.prototype.clear=function(){var e=this;this.sources.forEach(function(t){e.remove(t)})},n.prototype.getById=function(e){return this.sources.get(e)},n.prototype.getSources=function(){return Array.from(this.sources.values())},n.prototype.isSourceLoaded=function(e){return e=e instanceof gi?e.getId():e,this.map._getMap().isSourceLoaded(e)},n.prototype.remove=function(e,t){var r,i;if(t===void 0&&(t=!0),Array.isArray(e))try{for(var o=uR(e),a=o.next();!a.done;a=o.next()){var l=a.value;this._removeSource(l,t)}}catch(h){r={error:h}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}else this._removeSource(e,t)},n.prototype.setSourceState=function(e,t){t===void 0&&(t=!0),this.sources.set(e.getId(),e),e._setMap(this.map,t)},n.prototype.unsetSourceState=function(e){this.sources.has(e)&&(this.sources.get(e)._setMap(null),this.sources.delete(e))},n.prototype._removeSource=function(e,t){if(e=e instanceof gi?e.getId():e,!this.sources.has(e))throw new Error("'".concat(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 '".concat(e,"'"));this.unsetSourceState(e)},n.prototype._addSource=function(e,t){if(this.sources.has(e.getId())){if(t)throw new Error("'".concat(e.getId(),"' is already added to the map"));this.unsetSourceState(e.getId())}if(t){if(!this.map._isReady())throw new Error("The source '".concat(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)},n.prototype._mapFeaturesToShapes=function(e,t,r){var i,o,a=[];try{for(var l=uR(e),h=l.next();!h.done;h=l.next()){var p=h.value;if((r||typeof p.source=="string")&&typeof p.properties[Ci._shapeIdPropName]=="string"){var g=r||this.sources.get(p.source);if(g instanceof Es){var _=g.getShapeById(p.properties[Ci._shapeIdPropName]);if(_ instanceof Ci){a.push(_);continue}}}t||a.push(p)}}catch(x){i={error:x}}finally{try{h&&!h.done&&(o=l.return)&&o.call(l)}finally{if(i)throw i.error}}return a},n.prototype._syncSources=function(e){var t=this;e?(Object.keys(e).map(function(r){var i,o=e[r];switch(o.type){case"vector":case"raster":case"raster-dem":i=new L6(r,{name:r,tiles:o.tiles,type:o.type,url:o.url,tileSize:"tileSize"in o?o.tileSize:void 0});break;case"canvas":i=new A6(r,o);break;case"geojson":var a=new Es(r,{maxZoom:o.maxzoom,cluster:o.cluster,clusterRadius:o.clusterRadius,tolerance:o.tolerance,lineMetrics:o.lineMetrics,clusterProperties:o.clusterProperties,buffer:o.buffer,clusterMinPoints:o.clusterMinPoints,generateId:o.generateId,promoteId:o.promoteId,filter:o.filter});typeof o.data!="string"&&o.data!==void 0&&a._addNoUpdate(o.data),i=a;break;case"image":i=new u2(r,o);break;case"video":i=new P6(r,o);break;default:i=new I6(r,o)}return i}).forEach(function(r){var i=t.sources.get(r.getId()),o=i&&r._isDeepEqual(i);!o&&i&&t.unsetSourceState(i.getId()),t.setSourceState(r,!o)}),Array.from(this.sources.keys()).filter(function(r){return!(r in e)}).forEach(function(r){return t.unsetSourceState(r)})):console.warn("syncSources called with no style sources which is unexpected.")},n}(),Hxe=window&&window.__extends||function(){var n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(r,i){r.__proto__=i}:function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])}))(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),Gxe=function(n){function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.duration=1e3,t.type="jump",t}return Hxe(e,n),e}(ii),qxe=window&&window.__extends||function(){var n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(r,i){r.__proto__=i}:function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])}))(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),$xe=function(n){function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.bottom=0,t.left=0,t.right=0,t.top=0,t}return qxe(e,n),e}(ii),Wxe=window&&window.__extends||function(){var n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(r,i){r.__proto__=i}:function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])}))(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),Yxe=window&&window.__values||function(n){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&n[e],r=0;if(t)return t.call(n);if(n&&typeof n.length=="number")return{next:function(){return{value:(n=n&&r>=n.length?void 0:n)&&n[r++],done:!n}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Kxe=window&&window.__read||function(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r,i,o=t.call(n),a=[];try{for(;(e===void 0||0=n.length?void 0:n)&&n[r++],done:!n}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},gEe=window&&window.__read||function(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r,i,o=t.call(n),a=[];try{for(;(e===void 0||0=n.length?void 0:n)&&n[r++],done:!n}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},S0=window&&window.__read||function(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r,i,o=t.call(n),a=[];try{for(;(e===void 0||0i[0]&&g[1]=n.length?void 0:n)&&n[r++],done:!n}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},FE={countryRegion:"cr|bv:0",adminDistrict:"ad|bv:0",adminDistrict2:"ds|bv:0",buildingFootprint:"bld|v:0_adr|lv:0",roadDetails:"g|rasterDetailsVisible:0"},wEe=function(){function n(e,t){var r=this;this.definitions=function(){var i=r.initPromise||r.initStyleset();return i},this.indoorState=void 0,this.preservedPreindoorMapConfiguration=void 0,this._progressiveLoadingState={mapStyle:void 0,pendingVisibilityChange:void 0},this._deferLayerGroupVisibilities=function(i,o){var a,l,h,p,g=o.filter(function(_){return _ in i});g.length!==0&&(a=r.map._getMap(),l=a.getZoom(),h=r.map.getStyle().style,r._progressiveLoadingState.pendingVisibilityChange&&(r.map.events.remove("load",r._progressiveLoadingState.pendingVisibilityChange),r._progressiveLoadingState.pendingVisibilityChange=null),r._progressiveLoadingState.mapStyle=h,(p=Object.entries(i).reduce(function(_,M){var M=Zh(M,2),C=M[0],M=M[1],L=g.includes(C);return gR(gR([],Zh(_),!1),Zh(M.filter(function(F){if(F.type==="custom")return!1;if(L){if(typeof F.maxzoom=="number"&&typeof F.minzoom=="number"){if(l<=F.maxzoom&&l>=F.minzoom)return!1}else if(typeof F.minzoom=="number"){if(l>=F.minzoom)return!1}else if(typeof F.maxzoom!="number"||l<=F.maxzoom)return!1}return((F=F.layout)==null?void 0:F.visibility)!=="none"})),!1)},[])).forEach(function(_){_.layout=_.layout||{},_.layout.visibility="none"}),r._progressiveLoadingState.pendingVisibilityChange=function(){r._progressiveLoadingState.pendingVisibilityChange=null;var _=r.map.getStyle().style;h===_&&(p.forEach(function(x){x.layout.visibility="visible",a.setLayoutProperty(x.id,"visibility","visible")}),(_=r.map.copyrightDelegate)!=null)&&_.reloadAttribution()},r.map.events.addOnce("load",r._progressiveLoadingState.pendingVisibilityChange))},this._onStyleData=function(i){r.map.events.invoke("stylechanged",{style:i.name,map:r.map,type:"stylechanged"})},this._lookUp=function(i){var o,a,p=r.definitions(),l=p.errorIfRejected(),h=p.resultIfResolved();if(l||!h)return null;var p=h.configurations,g=void 0;try{for(var _=bEe(p),x=_.next();!x.done;x=_.next()){var C=x.value;if(C.name===i.style)return C;C.name===h.defaultConfiguration&&(g=g||C)}}catch(M){o={error:M}}finally{try{x&&!x.done&&(a=_.return)&&a.call(_)}finally{if(o)throw o.error}}return g=g||p[0]},this._lookUpAsync=function(i){return fR(r,void 0,void 0,function(){var o;return pR(this,function(a){switch(a.label){case 0:return[4,this.definitions()];case 1:return o=a.sent(),[2,o.configurations.find(function(l){return l.name===(i.style||o.defaultConfiguration)})||o.configurations.find(function(l){return l.name===o.defaultConfiguration})||o.configurations[0]]}})})},this.map=e,this.serviceOptions=t}return n.prototype.updateIndoorState=function(e,t){var r,i,o=this,a=this.map.styles.getMapConfiguration();a?(this.preservedPreindoorMapConfiguration=a,r=this.map.getStyle().style?"".concat(this.map.getStyle().style,"_indoor").concat(e==="dark"?"_dark":"","_tileset_").concat(t):void 0,this.map.styles.setMapConfiguration("defaultIndoor_".concat(t),a==="microsoft-maps:default"?r:void 0)):(i=((a=this.indoorState)==null?void 0:a.tilesetId)!==t,this.indoorState={tilesetId:t,theme:e},this.initStyleset(),this.definitions().then(function(l){var p=(o.map.getStyle().style||l.defaultConfiguration).replace("_indoor_dark","").replace("_indoor",""),h="".concat(p,"_indoor"),p=l.configurations.find(function(g){return g.name.startsWith(h)});p&&o.map.setStyle({style:p.name},!i)}))},n.prototype.unsetIndoorState=function(){var e=this,t=this.preservedPreindoorMapConfiguration;t?this.map.styles.setMapConfiguration(t):(this.indoorState=void 0,this.initStyleset(),this.definitions().then(function(r){var i=e.map.getStyle().style;i.includes("_indoor")&&i.split("_indoor")[0]?e.map.setStyle({style:i.split("_indoor")[0]}):e.map.setStyle({style:void 0})}))},n.prototype.initStyleset=function(){var e,t=this;return e=this.serviceOptions.mapConfiguration?typeof this.serviceOptions.mapConfiguration=="string"?(e=this.map.authentication?this.map.authentication.initialize():Promise.resolve(),new DE(e.then(function(){return t._request(t.serviceOptions.domain,"".concat(Nn.styleResourcePath,"/mapconfigurations/metadata/").concat(t.serviceOptions.mapConfiguration),"StyleDefinitions").then(function(r){return Mc(Mc({},r),{defaultConfiguration:r.defaultConfiguration||r.defaultStyle,configurations:r.configurations||r.styles})})}))):DE.resolve(this.serviceOptions.mapConfiguration):(e=this.map.authentication?this.map.authentication.initialize():Promise.resolve(),new DE(e.then(function(){return t._request(t.serviceOptions.staticAssetsDomain,"".concat(Nn.stylePath,"/").concat(Nn.styleResourcePath),"StyleDefinitions",{version:t.serviceOptions.styleDefinitionsVersion,mcv:ah.replace(/\./g,"")}).then(function(r){return{version:isNaN(r.version)?0:parseFloat(r.version),defaultConfiguration:r.defaultStyle,configurations:r.styles.filter(function(i){return t.indoorState?t.indoorState.theme==="auto"?i.name.endsWith(i.theme==="dark"?"_indoor_dark":"_indoor"):i.name.endsWith(t.indoorState.theme==="dark"?"_indoor_dark":"_indoor"):!i.name.includes("indoor")}).map(function(i){return{copyright:i.copyright.join(" "),name:i.name,displayName:function(o){return o=t.indoorState&&o.includes("_indoor")?o.split("_indoor")[0]:o,o in E9?E9[o]:o}(i.name),theme:i.theme,thumbnail:new Zc({domain:t.serviceOptions.staticAssetsDomain,path:i.thumbnail,protocol:"https"}).toString(),url:new Zc({domain:t.serviceOptions.staticAssetsDomain,path:"".concat(Nn.stylePath,"/").concat(Nn.styleResourcePath,"/").concat(i.name),queryParams:{styleVersion:r.version!==void 0&&r.version!==null?r.version:t.serviceOptions.styleDefinitionsVersion,mcv:ah.replace(/\./g,"")},protocol:"https"}).toString()}})}})}))),this.initPromise&&this.initPromise.switchWith(e),this.initPromise=e,this.initPromise.then(function(r){return t.map._invokeEvent("mapconfigurationchanged",r)}),this.initPromise},n.prototype.getStyle=function(e){if(e=this._lookUp(e),!e)throw Error("Style definition is not available.");if(e.url)return e.url;if(e.style)return e.style;throw Error("Style definition neither contains URL nor style object.")},n.prototype.deriveNewStyleAndLayerGroups=function(e,t){for(var r,i,o=this.map.getStyle(),a=this.map.getTraffic(),l={},h=0;h=n.length?void 0:n)&&n[r++],done:!n}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},EEe=function(){function n(e){this.map=e,this.indicators=new Set}return n.prototype.add=function(e){var t,r;e=Array.isArray(e)?e:[e];try{for(var i=T9(e),o=i.next();!o.done;o=i.next()){var a=o.value;this.indicators.has(a)||(this.indicators.add(a),a.attach(this.map))}}catch(l){t={error:l}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}},n.prototype.clear=function(){var e=this;this.indicators.forEach(function(t){e.indicators.delete(t),t.remove()})},n.prototype.remove=function(e){var t,r;e=Array.isArray(e)?e:[e];try{for(var i=T9(e),o=i.next();!o.done;o=i.next()){var a=o.value;this.indicators.has(a)&&(this.indicators.delete(a),a.remove())}}catch(l){t={error:l}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}},n.prototype.getIndicators=function(){return Array.from(this.indicators)},n.prototype._getCollectionDiv=function(){var e=this.map.getMapContainer().querySelector(".".concat(n.Css.collection));return e||((e=document.createElement("div")).setAttribute("aria-label","map data"),e.setAttribute("role","listbox"),e.classList.add(n.Css.collection),this.map.getMapContainer().appendChild(e)),e},n.Css={collection:"accessible-indicator-collection-container"},n}(),TEe=window&&window.__extends||function(){var n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(r,i){r.__proto__=i}:function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])}))(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),Tu=window&&window.__assign||function(){return(Tu=Object.assign||function(n){for(var e,t=1,r=arguments.length;ti[0]&&g[1]=n.length?void 0:n)&&n[r++],done:!n}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},S9=function(n){function e(t,r){var i,o,a=n.call(this)||this,l=(a.removed=!1,a.loaded=!1,a.ready=!1,a._resizeCallback=function(){return a.resize()},!0);a._updateGlobalDefaults(r),a.serviceOptions=new dR().merge(r),a.styleOptions=new x9().merge(r),a.trafficOptions=new ew,a.styles=new wEe(a,a.serviceOptions),a.insights=new G1e(a.serviceOptions),a.serviceOptions.authOptions.subscriptionKey&&(a.serviceOptions.authOptions.subscriptionKey=encodeURIComponent(a.serviceOptions.authOptions.subscriptionKey)),i=a.serviceOptions.authOptions.clientId||(a.serviceOptions.authOptions.subscriptionKey?a.serviceOptions.authOptions.subscriptionKey.replace(/.(?=.{3,}$)/g,"*"):"invalid-setting"),a.insights&&a.insights.setAuthenticatedUserContext(a.serviceOptions.sessionId,i),arguments[2]&&xEe()?(o=arguments[2],a.ready=!0,a.loaded=!0):(i={antialias:a.styleOptions.antialias,attributionControl:!1,container:t,fadeDuration:a.serviceOptions.fadeDuration,localIdeographFontFamily:a.serviceOptions.localIdeographFontFamily,preserveDrawingBuffer:a.styleOptions.preserveDrawingBuffer,refreshExpiredTiles:a.serviceOptions.refreshExpiredTiles,renderWorldCopies:a.styleOptions.renderWorldCopies,trackResize:!1,transformRequest:function(_,x){var C={url:_};return x==="Tile"||x==="Source"?(_.includes(Nn.legacyDomainPlaceHolder)&&a.insights&&a.insights.trackEvent({name:"TileLoad"}),a._substituteDomainLanguageViewAndSignInRequest(_,C)):x!=="Style"&&x!=="SpriteJSON"&&x!=="SpriteImage"&&x!=="Glyphs"||a.styles._transformStyleRequest(_,C),a.serviceOptions.transformRequest&&j5(C,a.serviceOptions.transformRequest(C.url,x)),C}},o=new wa.Map(i));try{a.map=o,a.authentication=new Mxe(a),a.controls=new Rxe(a),a.events=new Oxe(a),a.imageSprite=new Nxe(a),a.layers=new zxe(a),a.markers=new Lxe(a),a.sources=new Vxe(a),a.popups=new jxe(a),a.indicators=new EEe(a),a.map.getContainer().classList.add(e.Css.container),a.map.getCanvasContainer().classList.add(e.Css.canvasContainer),a.map.getCanvas().classList.add(e.Css.canvas),a._detectHighContrast(),a.copyrightControl=new W1e({showFeedbackLink:a.styleOptions.showFeedbackLink,showLogo:a.styleOptions.showLogo,customAttribution:a.styleOptions.customAttribution}),a.controls.add(a.copyrightControl,{position:xa.NonFixed}),a.logoControl=new Z1e({showLogo:a.styleOptions.showLogo}),a.controls.add(a.logoControl,{position:xa.BottomLeft});var h=a.authentication?a.authentication.initialize():Promise.resolve();if(a.removed)return a;var p=function(){a.loaded=!0,a.map.off("load",p)},g=(a.map.on("load",p),function(){a.ready=!0,a.map.off("styledata",g),a.events.invoke("ready",{map:a,type:"ready"})});a.map.on("styledata",g),a._setAutoResize(a.styleOptions.autoResize),a.map.showTileBoundaries=a.styleOptions.showTileBoundaries,a.localizedStringsPromise=z1.getStrings(a.styleOptions.language),h.then(function(){return a.styles.definitions()}).then(function(_){if(!a.removed){if(a.authentication&&!a.authentication.getToken())throw new Error("AuthenticationManager finished initializing, but no token is available");a.serviceOptions["enable-accessibility"]&&a.accessibleMapDelegate.addToMap(),a._setStyleComponents(a.styleOptions),a.copyrightDelegate&&a.copyrightDelegate.addToMap()}}).catch(function(_){_=_ instanceof Error?_:new Error(_),a.insights.trackException({error:_}),_={map:a,type:"error",error:_},a.events.invoke("error",_)}),a.setCamera(Tu(Tu({minZoom:1},r),{type:"jump",duration:0})),a.incidentDelegate=new swe(a),a.flowDelegate=new rwe(a),a.accessibleMapDelegate=new nwe(a),a.userInteractionDelegate=new hwe(a,r),a.userInteractionDelegate.addToMap(),a.copyrightDelegate=new xwe(a,a.copyrightControl,a.styleOptions)}catch(_){throw l=!1,a.insights.trackException({error:_ instanceof Error?_:new Error(_)}),_}finally{a.insights.trackEvent({name:"MapLoad"},{success:l,supported:SA(),supportedWithPerformance:SA({failIfMajorPerformanceCaveat:!0})}),a.insights.flush()}return a}return TEe(e,n),Object.defineProperty(e.prototype,"isDisposed",{get:function(){return this.removed},enumerable:!1,configurable:!0}),e.prototype.getCanvas=function(){return this.map.getCanvas()},e.prototype.getCanvasContainer=function(){return this.map.getCanvasContainer()},e.prototype.getMapContainer=function(){return this.map.getContainer()},e.prototype.getServiceOptions=function(){return Cr(this.serviceOptions,dR._cloneCustomizer)},e.prototype.setServiceOptions=function(t){this.serviceOptions=new dR().merge(this.serviceOptions,t),this.serviceOptions["enable-accessibility"]?this.accessibleMapDelegate.addToMap():this.accessibleMapDelegate.removeFromMap(),t=this.styles.serviceOptions.mapConfiguration!==this.serviceOptions.mapConfiguration||this.styles.serviceOptions.staticAssetsDomain!==this.serviceOptions.staticAssetsDomain||this.styles.serviceOptions.styleDefinitionsVersion!==this.serviceOptions.styleDefinitionsVersion||this.styles.serviceOptions.domain!==this.serviceOptions.domain||this.styles.serviceOptions.styleAPIVersion!==this.serviceOptions.styleAPIVersion,this.styles.serviceOptions=this.serviceOptions,t&&(this.styles.initPromise=null,this.setStyle({}))},e.prototype.addRequestTransformer=function(t){this.serviceOptions.addTransformer(t)},e.prototype.removeRequestTransformer=function(t){this.serviceOptions.removeTransformer(t)},e.prototype.setCamera=function(t,r){if(r===void 0&&(r=!1),"padding"in t||"offset"in t||"bounds"in t){var i,l=new Xxe().merge({maxZoom:this.getCamera().maxZoom},t),o=this._generateSafeBounds(l.bounds),h={padding:l.padding,offset:l.offset,maxZoom:l.maxZoom};if(!(i=this.map.cameraForBounds(o,h)))throw a={message:"The map cannot be fit to the current canvas with the given CameraBoundsOptions.",containerWidth:(a=(a=this.map)==null?void 0:a.getContainer())==null?void 0:a.clientWidth,containerHeight:a==null?void 0:a.clientHeight,safeBounds:o,cameraForBoundsOptions:h},new Error(JSON.stringify(a));"pitch"in t&&(i.pitch=t.pitch),"bearing"in t&&(i.bearing=t.bearing),"minPitch"in t&&this.map.setMinPitch(t.minPitch),"maxPitch"in t&&this.map.setMaxPitch(t.maxPitch),"minZoom"in t&&this.map.setMinZoom(t.minZoom),o=this._generateSafeBounds(l.maxBounds)}else h=new Jxe().merge(this.getCamera(),t),h.centerOffset&&2<=h.centerOffset.length&&(a=h.centerOffset,(l=N_([h.center],h.zoom))[0][0]+=a[0],l[0][1]+=a[1],h.center=o2(l,h.zoom)[0]),i={center:h.center,zoom:h.zoom,bearing:h.bearing,pitch:h.pitch,around:void 0},h.minZoom<1&&console.warn("Setting minZoom below 1 may result in an empty map when the zoom level is less than 1."),this.map.setMinZoom(h.minZoom),this.map.setMaxZoom(h.maxZoom),h.minPitch&&this.map.setMinPitch(h.minPitch),h.maxPitch&&this.map.setMaxPitch(h.maxPitch),this._invokeEvent("minzoomchanged",this.map.getMinZoom()),this._invokeEvent("maxzoomchanged",this.map.getMaxZoom()),o=this._generateSafeBounds(h.maxBounds);o?this.map.setMaxBounds(o):this.map.setMaxBounds(null);var a=new Gxe().merge(t),l={duration:a.duration,easing:function(p){return p},offset:[0,0],animate:!0},h={fromControl:r};a.type==="jump"?this.map.jumpTo(i,h):a.type==="ease"?this.map.easeTo(Tu(Tu({},i),l),h):a.type==="fly"&&this.map.flyTo(Tu(Tu({},i),l),h)},e.prototype.setCameraBounds=function(t){this.setCamera(t)},e.prototype.getCamera=function(){var t=this.map.getBounds().getSouthWest().toArray(),r=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 rr(t,r),minZoom:this.map.getMinZoom(),maxZoom:this.map.getMaxZoom(),maxBounds:(t=this.map.getMaxBounds())==null?void 0:t.toArray().flat()}},e.prototype.setStyle=function(t,r){r===void 0&&(r=!0),delete t.preserveDrawingBuffer,t=new x9().merge(this.styleOptions,t),t.autoResize!==this.styleOptions.autoResize&&this._setAutoResize(t.autoResize),t.language!==this.styleOptions.language&&(this.localizedStringsPromise=z1.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}),this.logoControl.setOptions({showLogo:t.showLogo})),t.showTileBoundaries!==this.styleOptions.showTileBoundaries&&(this.map.showTileBoundaries=t.showTileBoundaries),t.showBuildingModels&&console.warn("showBuildingModels is deprecated."),r=r&&this.styleOptions.language===t.language&&this.styleOptions.view===t.view,this.styleOptions=t,this._setStyleComponents(t,r)},e.prototype.getStyle=function(){return Zi(this.styleOptions)},e.prototype.addIcon=function(t,r){this.imageSprite.add(t,r)},e.prototype.addPins=function(t,i){var i=new aEe().merge(i),o=this.layers.getLayerById(i.name),a=!1;if(o||(a=!0,o=new lw("".concat(i.name,"-source"),i.name,{source:"".concat(i.name,"-source"),minZoom:i.minZoom,maxZoom:i.maxZoom,iconOptions:{anchor:"center",size:i.iconSize,image:["case",["has","icon"],["get","icon"],i.icon],ignorePlacement:!i.cluster,opacity:i.opacity},textOptions:{anchor:"center",textField:["case",["has","point_count"],["to-string",["get","point_count"]],["has","title"],["to-string",["get","title"]],i.title],font:["case",["has","point_count"],["literal",["StandardFontCondensed-Bold"]],["literal",[i.textFont]]],size:["case",["has","point_count"],20,i.fontSize],ignorePlacement:!i.cluster,opacity:i.opacity,offset:["case",["has","point_count"],["literal",[.5,-.45]],["literal",[i.textOffset[0]/16,i.textOffset[1]/16]]],color:i.fontColor}})),!(o instanceof lw))throw new Error("A layer with name '".concat(i.name,"' already exists but it is not a SymbolLayer.")+"A SymbolLayer should be used for rendering pins.");var l=o.getSource(),h=(typeof l=="string"?(p=l,l=this.sources.getById(p)):p=l.getId(),!1);if(l||(h=!0,l=new Es(p,{cluster:i.cluster})),!(l instanceof Es))throw new Error("The source with name '".concat(p,"' already exists but it is not a DataSource.")+"New data can only be added to a DataSource.");h&&this.sources.add(l),a&&this.layers.add(o,i.before);var p=new Yd(t);i.overwrite?l.setShapes(p):l.add(p)},e.prototype.addCircles=function(t,i){var i=new nEe().merge(i),o=this.layers.getLayerById(i.name),a=!1;if(o||(a=!0,o=new h2("".concat(i.name,"-source"),i.name,{source:"".concat(i.name,"-source"),minZoom:i.minZoom,maxZoom:i.maxZoom,opacity:i.opacity,radius:["case",["has","radius"],["get","radius"],i.radius],color:["case",["has","color"],["get","color"],i.color],strokeColor:["case",["has","outlineColor"],["get","outlineColor"],i.outlineColor],strokeWidth:["case",["has","outlineWidth"],["get","outlineWidth"],i.outlineWidth]})),!(o instanceof h2))throw new Error("A layer with name '".concat(i.name,"' already exists but it is not a BubbleLayer.")+"A BubbleLayer should be used for rendering circles.");var l=o.getSource(),h=(typeof l=="string"?(p=l,l=this.sources.getById(p)):p=l.getId(),!1);if(l||(h=!0,l=new Es(p)),!(l instanceof Es))throw new Error("The source with name '".concat(p,"' already exists but it is not a DataSource.")+"New data can only be added to a DataSource.");h&&this.sources.add(l),a&&this.layers.add(o,i.before);var p=new Yd(t);i.overwrite?l.setShapes(p):l.add(p)},e.prototype.addLinestrings=function(t,i){var i=new iEe().merge(i),o=this.layers.getLayerById(i.name),a=!1;if(o||(a=!0,o=new d2("".concat(i.name,"-source"),i.name,{source:"".concat(i.name,"-source"),minZoom:i.minZoom,maxZoom:i.maxZoom,lineCap:i.cap,lineJoin:i.join,strokeOpacity:i.opacity,strokeColor:["case",["has","color"],["get","color"],i.color],strokeWidth:["case",["has","width"],["get","width"],i.width]})),!(o instanceof d2))throw new Error("A layer with name '".concat(i.name,"' already exists but it is not a LineLayer.")+"A LineLayer should be used for rendering linestrings.");var l=o.getSource(),h=(typeof l=="string"?(p=l,l=this.sources.getById(p)):p=l.getId(),!1);if(l||(h=!0,l=new Es(p)),!(l instanceof Es))throw new Error("The source with name '".concat(p,"' already exists but it is not a DataSource.")+"New data can only be added to a DataSource.");h&&this.sources.add(l),a&&this.layers.add(o,i.before);var p=new Yd(t);i.overwrite?l.setShapes(p):l.add(p)},e.prototype.addPolygons=function(t,i){var i=new cEe().merge(i),o=this.layers.getLayerById(i.name),a=!1;if(o||(a=!0,o=new f2("".concat(i.name,"-source"),i.name,{source:"".concat(i.name,"-source"),minZoom:i.minZoom,maxZoom:i.maxZoom,fillOpacity:i.opacity,fillColor:["case",["has","color"],["get","color"],i.color]})),!(o instanceof f2))throw new Error("A layer with name '".concat(i.name,"' already exists but it is not a PolygonLayer.")+"A PolygonLayer should be used for rendering linestrings.");var l=o.getSource(),h=(typeof l=="string"?(p=l,l=this.sources.getById(p)):p=l.getId(),!1);if(l||(h=!0,l=new Es(p)),!(l instanceof Es))throw new Error("The source with name '".concat(p,"' already exists but it is not a DataSource.")+"New data can only be added to a DataSource.");h&&this.sources.add(l),a&&this.layers.add(o,i.before);var p=new Yd(t);i.overwrite?l.setShapes(p):l.add(p)},e.prototype.addRaster=function(t,o){var i,o=new uEe().merge(o),a=this.layers.getLayerById(o.name);if(!((a=a||new hw({maxZoom:o.maxZoom,minZoom:o.minZoom,opacity:o.opacity,tileSize:256,tileUrl:"{subdomain}"},o.name))instanceof hw))throw new Error("A layer with name '".concat(o.name,"' already exists but it is not a TileLayer.")+"A TileLayer should be used for rendering raster images.");if(a.getOptions().tileUrl!=="{subdomain}")throw new Error("A TileLayer with name '".concat(o.name,"' already exists but was configured ")+"for a single tile url [default for new TileLayer(...)].");(i=!o.overwrite&&a.getOptions().subdomains||[]).push.apply(i,IEe([],AEe(t),!1)),a._setOptionsNoUpdate({subdomains:i}),this.layers.add(a,o.before)},e.prototype.getLayers=function(){return this.layers.getLayers().map(function(t){return t.getId()})},e.prototype.removeLayers=function(t){var r,i;try{for(var o=BE(t),a=o.next();!a.done;a=o.next()){var l,h=a.value;this.layers.getLayerById(h)&&(this.layers.remove(h),l="".concat(h,"-source"),this.sources.getById(l))&&this.sources.remove(l)}}catch(p){r={error:p}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}},e.prototype.addHtml=function(t,r){t.id||(t.id="marker_".concat(Vd()));var i=new p2({htmlContent:t});return this.markers.add(i,r),t.id},e.prototype.removeHtml=function(t){this.markers.remove(t)},e.prototype.addEventListener=function(t,r,i){this.events._addLegacy(t,r,i)},e.prototype.removeEventListener=function(t,r,i){this.events._removeLegacy(t,r,i)},e.prototype.setUserInteraction=function(t){this.userInteractionDelegate.setOptions(t)},e.prototype.getUserInteraction=function(){return this.userInteractionDelegate.getOptions()},e.prototype.addControl=function(t,r){this.controls.add(t,r)},e.prototype.removeControl=function(t){this.controls.remove(t)},e.prototype.setTraffic=function(t){var r=this.trafficOptions.incidents,i=this.trafficOptions.flow;if(this.trafficOptions=new ew().merge(this.trafficOptions,t),this.controls.getControls().filter(function(o){return o instanceof V5}).forEach(function(o){return o.updateButtonState()}),this.incidentDelegate&&(this.trafficOptions.incidents?r||this.incidentDelegate.addToMap():this.incidentDelegate.removeFromMap()),this.trafficOptions.flow&&this.trafficOptions.flow!=="none"){["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!==i&&this.flowDelegate.addToMap()}catch(o){throw this.trafficOptions.flow=i,o}}else this.flowDelegate.removeFromMap()},e.prototype.getTraffic=function(){return Zi(this.trafficOptions)},e.prototype.remove=function(){this.dispose()},e.prototype.clear=function(){this.popups.clear(),this.layers.clear(),this.sources.clear(),this.markers.clear(),this.indicators.clear()},e.prototype.dispose=function(){var t;for(this.clear(),this.map.remove(),(t=this.authentication)!=null&&t.dispose(),this.removed=!0,(t=this.resizeObserver)!=null&&t.disconnect(),this.resizeObserver=null;this.getMapContainer().firstChild;){var r=this.getMapContainer().firstChild;this.getMapContainer().removeChild(r)}},e.prototype.resize=function(t,r,i){typeof t!="number"&&typeof t!="string"||typeof r!="number"&&typeof r!="string"?i=t:(t=t,this.getMapContainer().style.height=typeof t=="number"?"".concat(t,"px"):t,this.getMapContainer().style.width=typeof r=="number"?"".concat(r,"px"):r),t=this.getMapContainer().style.overflow,this.getMapContainer().style.overflow="hidden",this.map.resize(i),this.getMapContainer().style.overflow=t},e.prototype.pixelsToPositions=function(t){var r,i,o=[];try{for(var a=BE(t),l=a.next();!l.done;l=a.next()){var h=l.value,p=this.map.unproject(h);o.push(new $o(p.lng,p.lat))}}catch(g){r={error:g}}finally{try{l&&!l.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}return o},e.prototype.positionsToPixels=function(t){var r,i,o=[];try{for(var a=BE(t),l=a.next();!l.done;l=a.next()){var h=l.value,p=this.map.project(h);o.push(new Go(p.x,p.y))}}catch(g){r={error:g}}finally{try{l&&!l.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}return o},e.prototype.areTilesLoaded=function(){return this.map.areTilesLoaded()},e.prototype.stop=function(){this.map.stop()},e.prototype.triggerRepaint=function(){this.map.triggerRepaint()},e.prototype.enableElevation=function(t,r){this.map.setTerrain(typeof t=="string"?{source:t,exaggeration:r}:{source:t.getId(),exaggeration:r})},e.prototype.disableElevation=function(){this.map.setTerrain(null)},e.prototype._getMap=function(){return this.map},e.prototype._rebuildStyle=function(t){return t===void 0&&(t=!0),SEe(this,void 0,void 0,function(){return CEe(this,function(r){return this.styles.setStyle(this.styleOptions,t),this.imageSprite._restoreImages(),[2]})})},e.prototype._isLoaded=function(){return this.loaded},e.prototype._isReady=function(){return this.ready},e.prototype._getLocalizedStrings=function(){return this.localizedStringsPromise},e.prototype._sendRequest=function(t,r,i){var o;return(o=typeof this.serviceOptions.transformRequest=="function"?this.serviceOptions.transformRequest(t,r):o)?fetch(o.url||t,{credentials:o.credentials,headers:Tu(Tu({},i),o.headers),method:"GET",mode:"cors"}):fetch(t,{headers:i,method:"GET",mode:"cors"})},e.prototype._substituteDomainLanguageViewAndSignInRequest=function(t,r){var i;(t.includes(Nn.legacyDomainPlaceHolder)||t.includes(Nn.domainPlaceHolder))&&(i=new RegExp("[^{]".concat(Nn.legacyDomainPlaceHolder,"[^}]")),t.match(i)&&(r.url=r.url.replace(Nn.legacyDomainPlaceHolder,Nn.domainPlaceHolder)),Zc.protoRegEx.test(this.serviceOptions.domain)?(i=r.url.indexOf(Nn.domainPlaceHolder),r.url=this.serviceOptions.domain+r.url.substring(i+Nn.domainPlaceHolder.length)):r.url=r.url.replace(Nn.domainPlaceHolder,this.serviceOptions.domain)),(r.url.toLocaleLowerCase().includes(this.serviceOptions.domain.toLocaleLowerCase())||r.url.toLocaleLowerCase().includes(this.serviceOptions.staticAssetsDomain.toLocaleLowerCase()))&&(i=this.authentication)!=null&&i.signRequest(r),t.includes(Nn.languagePlaceHolder)&&(r.url=r.url.replace(Nn.languagePlaceHolder,this.styleOptions.language)),t.includes(Nn.viewPlaceHolder)&&(r.url=this.styleOptions.view?r.url.replace(Nn.viewPlaceHolder,this.styleOptions.view):r.url.replace(Nn.viewPlaceHolder,"").replace("&".concat(Nn.viewParameter,"="),""))},e.prototype._setAutoResize=function(t){t?(this.resizeObserver||(this.resizeObserver=new ResizeObserver(this._resizeCallback)),this.resizeObserver.observe(this.map.getContainer())):this.resizeObserver&&this.resizeObserver.unobserve(this.map.getContainer())},e.prototype._setStyleComponents=function(t,r){var i=this;r===void 0&&(r=!0),this.removed||this.styles.definitions().then(function(o){var a,l,h=!0;if(i.styleOptions.style)try{for(var p=BE(o.configurations),g=p.next();!g.done;g=p.next()){var _=g.value;if(i.styleOptions.style===_.name){h=!1;break}}}catch(x){a={error:x}}finally{try{g&&!g.done&&(l=p.return)&&l.call(p)}finally{if(a)throw a.error}}h&&(i.styleOptions.style=o.defaultConfiguration),i.styleOptions=t,i._rebuildStyle(r)})},e.prototype._updateGlobalDefaults=function(t){t&&(t.authOptions&&!RA()&&_F(t.authOptions),t.domain&&!IF()&&vF(t.domain),t.styleDefinitionsPath&&!PF()&&bF(t.styleDefinitionsPath),t.workerCount&&!MF()&&wF(t.workerCount),t.maxParallelImageRequests&&!RF()&&xF(t.maxParallelImageRequests),!t.subscriptionKey&&!t["subscription-key"]||RA()||SF(t.subscriptionKey||t["subscription-key"]),!t.sessionId&&!t["session-id"]||OF()||TF(t.sessionId||t["session-id"]),t.language&&!kF()&&EF(t.language),!t.userRegion&&!t.view||LF()||CF(t.userRegion||t.view))},e.prototype._generateSafeBounds=function(t){if(t){var r=rr.getSouth(t),i=rr.getWest(t),o=rr.getNorth(t),a=rr.getEast(t);if(!(isFinite(r)&&isFinite(i)&&isFinite(o)&&isFinite(a)))throw new Error("The bounds specified are invalid: [".concat(t,"]"));for(;a)/)),p=Math.max.apply(Math,MEe([],PEe(g.map(function(x){return x.replace(/<[a-zA-Z0-9\s=\/]+>/g,"").length})),!1))-1,h=Math.ceil(3.5*p),p=(h/g,"").length/_)*h)),r.width=a+"px",r.height=o||280'+'')+"")+'
').concat(i,"
");return r.srcdoc===void 0?r.src="data:text/html;charset=utf-8,"+encodeURI(_):r.srcdoc=_,r},n._appendChild=function(e,t,r){t&&(r&&(t.className=(t.className?t.className+" ":"")+r),e.appendChild(t))},n._generateContent=function(e,t,r){return t?Array.isArray(t)?this._generatePropertyInfoTable(e,t,r):this._applyStringTemplate(e,t,r):(t=this._generateDynamicTableHtml(e,null,r))?((e=document.createElement("div")).innerHTML=t,e):null},n._applyStringTemplate=function(e,t,r){if(t){for(var i,o,a=t,l=this._placeholderRx.exec(t);l;)2<=l.length&&(i=this._getPropertyValue(e,l[1],r),a=a.replace(l[0],i)),l=this._placeholderRx.exec(t);if(a)return(a=a.trim()).includes("<")&&(a=a.replace(/[\r\n]+/g,"
")),(o=document.createElement("div")).innerHTML=a,o}return null},n._getPropertyValue=function(e,t,r,i){var o=r.parsePropertyPaths?t.split("/"):[t],a=o.length;if(0'),z.title?_.push(z.title):p&&p.label?_.push(p.label):_.push(z.href),_.push("","
")}),_.pop(),_.join("")}if(h!=null){for(var C=void 0,C=1;C\s]/g.test(e)&&(r.detectHyperlinks||i&&i.hyperlinkFormat)){var M,e=e.trim(),t=this._isUrlRx.test(e)||i&&i.hyperlinkFormat,L=this._isImageUrlRx.test(e)&&(t||e.startsWith("data:image")),F=this._emailRx.test(e);if(t||L||F)return t=void 0,M=void(i&&i.hyperlinkFormat?t=i.hyperlinkFormat:r&&r.hyperlinkFormat&&(t=r.hyperlinkFormat)),M=t&&t.target?' target="'.concat(t.target,'"'):' target="_blank"',i="".concat(t&&t.label?t.label:e),t&&t.scheme?e=t.scheme+e:F&&(e="mailto:"+e),r=t&&t.label?' alt="'.concat(t.label,'"'):"",(t&&t.isImage||L)&&(i='')),'").concat(i,"")}return e.toString()}}}return""},n._generatePropertyInfoTable=function(e,t,r){var i,o;return e&&t&&0')),t.forEach(function(a){var l=o._getPropertyValue(e,a.propertyPath,r,a);a.hideLabel?i.push('',l,""):(a=a.label||a.propertyPath.split("/")[0],i.push("",a,"",l,""))}),i.push(""),(t=document.createElement("div")).innerHTML=i.join(""),t):null},n._generateDynamicTableHtml=function(e,t,r){var i,o,a,l,h=this;return!e||((i=[]).push('')),a=t&&0"),l++)}),l===0)?null:(i.push("
",p,"",o._getPropertyValue(e,a+p,r),"
"),i.join(""))},n._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(e.indexOf("_")===0||t==null||t==="")return!0}return!1},n._placeholderRx=/\{([a-zA-Z0-9_\/\s]+)\}/gi,n._isUrlRx=/^(http|https|ftp|tel|mailto):\/\//i,n._isImageUrlRx=/(^data:image|.png$|.jpg$|.jpeg$|.gif$|.bmp$|.svg|.tif|.tiff$)/i,n._emailRx=/^[^\.\s@:](?:[^\s@:]*[^\s@:\.])?@[^\.\s@]+(?:\.[^\.\s@]+)*$/,n._cssUrl=new Zc({domain:yc.staticAssetsDomain,path:"sdk/javascript/mapcontrol/".concat(j1.getEndpointVersion(),"/atlas.min.css")}).toString(),n.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"},n}(),C9=(NF(),Object.freeze({__proto__:null,get AuthenticationType(){return ri},get ControlPosition(){return xa},get ControlStyle(){return Ro},HtmlMarker:p2,Map:S9,Pixel:Go,Popup:pw,PopupTemplate:REe,Shape:Ci,_enableRTLTextPlugin:NF,_getAssetDomain:Jie,_getDomain:eoe,_hasMaxParallelImageRequests:RF,_hasSetAuthenticationOptions:RA,_hasSetDomain:IF,_hasSetLanguage:kF,_hasSetSessionId:OF,_hasSetStyleDefinitionsPath:PF,_hasSetStyleDefinitionsVersion:Qie,_hasSetView:LF,_hasWorkerCount:MF,addImageTemplate:$ie,addProtocol:Zie,clearPrewarmedResources:Kie,control:Jge,data:Nge,getAllImageTemplateNames:Wie,getAuthenticationOptions:sF,getDomain:MA,getImageTemplate:AF,getLanguage:pF,getMaxParallelImageRequests:fF,getSessionId:gF,getStaticAssetsDomain:cF,getStyleAPIVersion:hF,getStyleDefinitionsPath:lF,getStyleDefinitionsVersion:uF,getSubscriptionKey:mF,getUserRegion:zie,getVersion:jie,getView:yF,getWorkerCount:dF,internal:ioe,isSupported:Vie,layer:eye,math:Gge,prewarm:Yie,removeProtocol:Xie,setAuthenticationOptions:_F,setDomain:vF,setLanguage:EF,setMaxParallelImageRequests:xF,setSessionId:TF,setStyleAPIVersion:Gie,setStyleDefinitionsPath:bF,setStyleDefinitionsVersion:Hie,setSubscriptionKey:SF,setUserRegion:CF,setView:qie,setWorkerCount:wF,source:bme}));let A9,mR,I9,A0;function kEe(){OEe().then(n=>{({locations:mR,flows:I9}=n);const[e,t]=[globalThis.innerWidth,globalThis.innerHeight],r=F4(mR,a=>[a.lon,a.lat],[e,t],{pad:.3});A0=new C9.Map("myMap",{style:"grayscale_dark",interactive:!1,center:[r.longitude,r.latitude],zoom:r.zoom,bearing:r.bearing,pitch:r.pitch,authOptions:{authType:"anonymous",clientId:"e6b6ab59-eb5d-4d25-aa57-581135b927f0",getToken:function(a,l,h){var p="https://samples.azuremaps.com/api/GetAzureMapsToken";fetch(p).then(g=>g.text()).then(g=>a(g))}}}),A0.events.add("ready",()=>{A0.controls.add(new C9.control.StyleControl({mapStyles:["road","grayscale_light","grayscale_dark","night","satellite"]}),{position:"top-right"})}),A9=new sC({canvas:"deck-canvas",width:"100%",height:"100%",initialViewState:r,controller:!0,map:!0,onViewStateChange:({viewState:a})=>{A0.setCamera({center:[a.longitude,a.latitude],zoom:a.zoom,bearing:a.bearing,pitch:a.pitch})},layers:[]}),yR(),document.querySelectorAll(".control").forEach(a=>{a.onchange=yR}),document.getElementById("darkMode").onchange=LEe;const i=document.getElementById("deck-canvas"),o=document.getElementById("myMap");o.insertBefore(i,o.querySelector(".atlas-control-container"))})}async function OEe(){const[n,e]=await Promise.all([V4("/data/flowmap/locations.csv",t=>({id:t.id,name:t.name,lat:+t.lat,lon:+t.lon})),V4("/data/flowmap/flows.csv",t=>({origin:t.origin,dest:t.dest,count:+t.count}))]);return{locations:n,flows:e}}function yR(){A9.setProps({layers:[new B4({id:"my-flowmap-layer",data:{locations:mR,flows:I9},pickable:!0,darkMode:I0("darkMode"),colorScheme:FEe("colorScheme"),clusteringEnabled:I0("clusteringEnabled"),getLocationId:n=>n.id,getLocationLat:n=>n.lat,getLocationLon:n=>n.lon,getFlowOriginId:n=>n.origin,getFlowDestId:n=>n.dest,getFlowMagnitude:n=>n.count,getLocationName:n=>n.name,onHover:n=>NEe(DEe(n))})]})}function LEe(){A0.setStyle({style:I0("darkMode")?"grayscale_dark":"grayscale_light"}),document.getElementById("deck-canvas").style.mixBlendMode=I0("darkMode")?"screen":"darken",document.getElementById("container").style.backgroundColor=I0("darkMode")?"#000":"#fff",yR()}function NEe(n){const e=document.getElementById("tooltip");if(!n){e.style.display="none";return}e.style.left=`${n.position.left}px`,e.style.top=`${n.position.top}px`,e.innerHTML=n.content,e.style.display="block"}function DEe(n){if(!n)return;const{x:e,y:t,object:r}=n,i={left:e,top:t};switch(r==null?void 0:r.type){case cg.LOCATION:const o=document.createElement("b");o.innerText=r.name.replaceAll('"',"");const a=document.createElement("li");a.innerText=`Incoming trips: ${r.totals.incomingCount}`;const l=document.createElement("li");l.innerText=`Outgoing trips: ${r.totals.outgoingCount}`;const h=document.createElement("li");return h.innerText=`Internal or round trips: ${r.totals.internalCount}`,{position:i,content:[o,a,l,h].map(x=>x.outerHTML).join("")};case cg.FLOW:const p=document.createElement("b");p.innerText="Route Info";const g=document.createElement("li");g.innerText=`Bike Station: ${r.origin.id.slice(2,-2)} → ${r.dest.id.slice(2,-2)}`;const _=document.createElement("li");return _.innerText=`Trips Count: ${r.count}`,{position:i,content:[p,g,_].map(x=>x.outerHTML).join("")}}}function FEe(n){var e=document.getElementById(n);return e.options[e.selectedIndex].value}function I0(n){return document.getElementById(n).checked}document.body.onload=kEe}); +Error Description: `+l.message),[2,null];case 4:return i||(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."),i=n.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort)),[2,i]}})})},n.prototype.getCloudDiscoveryMetadataFromHarcodedValues=function(){return this.canonicalAuthority in Xj?Xj[this.canonicalAuthority]:null},n.prototype.isInKnownAuthorities=function(){var e=this;return 0=Xo.MAX_CACHED_ERRORS&&(t.failedRequests.shift(),t.failedRequests.shift(),t.errors.shift()),t.failedRequests.push(this.apiId,this.correlationId),Kt.isEmpty(e.subError)?Kt.isEmpty(e.errorCode)?e&&e.toString()?t.errors.push(e.toString()):t.errors.push(Xo.UNKNOWN_ERROR):t.errors.push(e.errorCode):t.errors.push(e.subError),this.cacheManager.setServerTelemetry(this.telemetryCacheKey,t)},n.prototype.incrementCacheHits=function(){var e=this.getLastRequests();return e.cacheHits+=1,this.cacheManager.setServerTelemetry(this.telemetryCacheKey,e),e.cacheHits},n.prototype.getLastRequests=function(){var e=new RE;return this.cacheManager.getServerTelemetry(this.telemetryCacheKey)||e},n.prototype.clearTelemetryCache=function(){var e,t=this.getLastRequests(),r=n.maxErrorsToSend(t);r===t.errors.length?this.cacheManager.removeItem(this.telemetryCacheKey):((e=new RE).failedRequests=t.failedRequests.slice(2*r),e.errors=t.errors.slice(r),this.cacheManager.setServerTelemetry(this.telemetryCacheKey,e))},n.maxErrorsToSend=function(e){for(var t=0,r=0,i=e.errors.length,o=0;o "+t)},e.createBlockReloadInHiddenIframeError=function(){return new e(It.blockTokenRequestsInHiddenIframeError.code,It.blockTokenRequestsInHiddenIframeError.desc)},e.createBlockAcquireTokenInPopupsError=function(){return new e(It.blockAcquireTokenInPopupsError.code,It.blockAcquireTokenInPopupsError.desc)},e.createIframeClosedPrematurelyError=function(){return new e(It.iframeClosedPrematurelyError.code,It.iframeClosedPrematurelyError.desc)},e.createSilentLogoutUnsupportedError=function(){return new e(It.silentLogoutUnsupportedError.code,It.silentLogoutUnsupportedError.desc)},e.createNoAccountError=function(){return new e(It.noAccountError.code,It.noAccountError.desc)},e.createSilentPromptValueError=function(t){return new e(It.silentPromptValueError.code,It.silentPromptValueError.desc+" Given value: "+t)},e.createUnableToParseTokenRequestCacheError=function(){return new e(It.unableToParseTokenRequestCacheError.code,It.unableToParseTokenRequestCacheError.desc)},e.createNoTokenRequestCacheError=function(){return new e(It.noTokenRequestCacheError.code,It.noTokenRequestCacheError.desc)},e.createAuthRequestNotSetError=function(){return new e(It.authRequestNotSet.code,It.authRequestNotSet.desc)},e.createNoCachedAuthorityError=function(){return new e(It.noCachedAuthorityError.code,It.noCachedAuthorityError.desc)},e.createInvalidCacheTypeError=function(){return new e(It.invalidCacheType.code,""+It.invalidCacheType.desc)},e.createNonBrowserEnvironmentError=function(){return new e(It.notInBrowserEnvironment.code,It.notInBrowserEnvironment.desc)},e.createDatabaseNotOpenError=function(){return new e(It.databaseNotOpen.code,It.databaseNotOpen.desc)},e.createNoNetworkConnectivityError=function(){return new e(It.noNetworkConnectivity.code,It.noNetworkConnectivity.desc)},e.createPostRequestFailedError=function(t,r){return new e(It.postRequestFailed.code,It.postRequestFailed.desc+" | Network client threw: "+t+" | Attempted to reach: "+r.split("?")[0])},e.createGetRequestFailedError=function(t,r){return new e(It.getRequestFailed.code,It.getRequestFailed.desc+" | Network client threw: "+t+" | Attempted to reach: "+r.split("?")[0])},e.createFailedToParseNetworkResponseError=function(t){return new e(It.failedToParseNetworkResponse.code,It.failedToParseNetworkResponse.desc+" | Attempted to reach: "+t.split("?")[0])},e.createUnableToLoadTokenError=function(t){return new e(It.unableToLoadTokenError.code,It.unableToLoadTokenError.desc+" | "+t)},e.createSigningKeyNotFoundInStorageError=function(t){return new e(It.signingKeyNotFoundInStorage.code,It.signingKeyNotFoundInStorage.desc+" | No match found for KeyId: "+t)},e.createAuthCodeRequiredError=function(){return new e(It.authCodeRequired.code,It.authCodeRequired.desc)},e.createAuthCodeOrNativeAccountIdRequiredError=function(){return new e(It.authCodeOrNativeAccountRequired.code,It.authCodeOrNativeAccountRequired.desc)},e.createSpaCodeAndNativeAccountIdPresentError=function(){return new e(It.spaCodeAndNativeAccountPresent.code,It.spaCodeAndNativeAccountPresent.desc)},e.createDatabaseUnavailableError=function(){return new e(It.databaseUnavailable.code,It.databaseUnavailable.desc)},e.createUnableToAcquireTokenFromNativePlatformError=function(){return new e(It.unableToAcquireTokenFromNativePlatform.code,It.unableToAcquireTokenFromNativePlatform.desc)},e.createNativeHandshakeTimeoutError=function(){return new e(It.nativeHandshakeTimeout.code,It.nativeHandshakeTimeout.desc)},e.createNativeExtensionNotInstalledError=function(){return new e(It.nativeExtensionNotInstalled.code,It.nativeExtensionNotInstalled.desc)},e.createNativeConnectionNotEstablishedError=function(){return new e(It.nativeConnectionNotEstablished.code,It.nativeConnectionNotEstablished.desc)},e.createNativeBrokerCalledBeforeInitialize=function(){return new e(It.nativeBrokerCalledBeforeInitialize.code,It.nativeBrokerCalledBeforeInitialize.desc)},e.createNativePromptParameterNotSupportedError=function(){return new e(It.nativePromptNotSupported.code,It.nativePromptNotSupported.desc)},e}(wn),Pc={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"},b0={CHANNEL_ID:"53ee284d-920a-4b59-9d30-a60315b26836",PREFERRED_EXTENSION_ID:"ppnbnpeolgkicgegkbkbjmhlideopiji",MATS_TELEMETRY:"MATS"},i9=(function(n){n.HandshakeRequest="Handshake",n.HandshakeResponse="HandshakeResponse",n.GetToken="GetToken",n.Response="Response"}(wu=wu||{}),function(n){n.LocalStorage="localStorage",n.SessionStorage="sessionStorage",n.MemoryStorage="memoryStorage"}(go=go||{}),function(n){n.GET="GET",n.POST="POST"}(yl=yl||{}),function(n){n.AUTHORITY="authority",n.ACQUIRE_TOKEN_ACCOUNT="acquireToken.account",n.SESSION_STATE="session.state",n.REQUEST_STATE="request.state",n.NONCE_IDTOKEN="nonce.id_token",n.ORIGIN_URI="request.origin",n.RENEW_STATUS="token.renew.status",n.URL_HASH="urlHash",n.REQUEST_PARAMS="request.params",n.SCOPES="scopes",n.INTERACTION_STATUS_KEY="interaction.status",n.CCS_CREDENTIAL="ccs.credential",n.CORRELATION_ID="request.correlationId",n.NATIVE_REQUEST="request.native",n.REDIRECT_CONTEXT="request.redirect.context"}(Mr=Mr||{}),function(n){n.ACCOUNT_KEYS="msal.account.keys",n.TOKEN_KEYS="msal.token.keys"}(_l=_l||{}),function(n){n.WRAPPER_SKU="wrapper.sku",n.WRAPPER_VER="wrapper.version"}(Pm=Pm||{}),function(n){n[n.acquireTokenRedirect=861]="acquireTokenRedirect",n[n.acquireTokenPopup=862]="acquireTokenPopup",n[n.ssoSilent=863]="ssoSilent",n[n.acquireTokenSilent_authCode=864]="acquireTokenSilent_authCode",n[n.handleRedirectPromise=865]="handleRedirectPromise",n[n.acquireTokenByCode=866]="acquireTokenByCode",n[n.acquireTokenSilent_silentFlow=61]="acquireTokenSilent_silentFlow",n[n.logout=961]="logout",n[n.logoutPopup=962]="logoutPopup"}(_i=_i||{}),function(n){n.Redirect="redirect",n.Popup="popup",n.Silent="silent",n.None="none"}(hn=hn||{}),function(n){n.Startup="startup",n.Login="login",n.Logout="logout",n.AcquireToken="acquireToken",n.SsoSilent="ssoSilent",n.HandleRedirect="handleRedirect",n.None="none"}(Qj=Qj||{}),{scopes:f0}),Mm="jwk",nR=(function(n){n.React="@azure/msal-react",n.Angular="@azure/msal-angular"}(Jj=Jj||{}),"msal.db"),Kwe=1,Zwe=nR+".keys",ns=(function(n){n[n.Default=0]="Default",n[n.AccessToken=1]="AccessToken",n[n.AccessTokenAndRefreshToken=2]="AccessTokenAndRefreshToken",n[n.RefreshToken=3]="RefreshToken",n[n.RefreshTokenAndNetwork=4]="RefreshTokenAndNetwork",n[n.Skip=5]="Skip"}(ts=ts||{}),{redirectUriNotSet:{code:"redirect_uri_empty",desc:"A redirect URI is required for all calls, and none has been set."},postLogoutUriNotSet:{code:"post_logout_uri_empty",desc:"A post logout redirect has not been set."},storageNotSupportedError:{code:"storage_not_supported",desc:"Given storage configuration option was not supported."},noRedirectCallbacksSet:{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."},invalidCallbackObject:{code:"invalid_callback_object",desc:"The object passed for the callback was invalid. More information is available here: https://github.com/AzureAD/microsoft-authentication-library-for-js/wiki/MSAL-basics."},stubPcaInstanceCalled:{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"},inMemRedirectUnavailable:{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."},entropyNotProvided:{code:"entropy_not_provided",desc:"The available browser crypto interface requires entropy set via system.cryptoOptions.entropy configuration option."}}),OE=function(n){function e(t,r){return t=n.call(this,t,r)||this,t.name="BrowserConfigurationAuthError",Object.setPrototypeOf(t,e.prototype),t}return Zo(e,n),e.createRedirectUriEmptyError=function(){return new e(ns.redirectUriNotSet.code,ns.redirectUriNotSet.desc)},e.createPostLogoutRedirectUriEmptyError=function(){return new e(ns.postLogoutUriNotSet.code,ns.postLogoutUriNotSet.desc)},e.createStorageNotSupportedError=function(t){return new e(ns.storageNotSupportedError.code,ns.storageNotSupportedError.desc+" Given Location: "+t)},e.createRedirectCallbacksNotSetError=function(){return new e(ns.noRedirectCallbacksSet.code,ns.noRedirectCallbacksSet.desc)},e.createStubPcaInstanceCalledError=function(){return new e(ns.stubPcaInstanceCalled.code,ns.stubPcaInstanceCalled.desc)},e.createInMemoryRedirectUnavailableError=function(){return new e(ns.inMemRedirectUnavailable.code,ns.inMemRedirectUnavailable.desc)},e.createEntropyNotProvided=function(){return new e(ns.entropyNotProvided.code,ns.entropyNotProvided.desc)},e}(wn),o9=function(){function n(e){this.validateWindowStorage(e),this.windowStorage=window[e]}return n.prototype.validateWindowStorage=function(e){if(e!==go.LocalStorage&&e!==go.SessionStorage||!window[e])throw OE.createStorageNotSupportedError(e)},n.prototype.getItem=function(e){return this.windowStorage.getItem(e)},n.prototype.setItem=function(e,t){this.windowStorage.setItem(e,t)},n.prototype.removeItem=function(e){this.windowStorage.removeItem(e)},n.prototype.getKeys=function(){return Object.keys(this.windowStorage)},n.prototype.containsKey=function(e){return this.windowStorage.hasOwnProperty(e)},n}(),rR=function(){function n(){this.cache=new Map}return n.prototype.getItem=function(e){return this.cache.get(e)||null},n.prototype.setItem=function(e,t){this.cache.set(e,t)},n.prototype.removeItem=function(e){this.cache.delete(e)},n.prototype.getKeys=function(){var e=[];return this.cache.forEach(function(t,r){e.push(r)}),e},n.prototype.containsKey=function(e){return this.cache.has(e)},n.prototype.clear=function(){this.cache.clear()},n}(),a9=function(){function n(){}return n.extractBrowserRequestState=function(e,t){if(Kt.isEmpty(t))return null;try{return bu.parseRequestState(e,t).libraryState.meta}catch(r){throw en.createInvalidStateError(t,r)}},n.parseServerResponseFromHash=function(e){return e?(e=new wr(e),wr.getDeserializedHash(e.getHash())):{}},n}(),iR=function(n){function e(t,r,i,o){return t=n.call(this,t,i,o)||this,t.COOKIE_LIFE_MULTIPLIER=864e5,t.cacheConfig=r,t.logger=o,t.internalStorage=new rR,t.browserStorage=t.setupBrowserStorage(t.cacheConfig.cacheLocation),t.temporaryCacheStorage=t.setupTemporaryCacheStorage(t.cacheConfig.temporaryCacheLocation,t.cacheConfig.cacheLocation),r.cacheMigrationEnabled&&(t.migrateCacheEntries(),t.createKeyMaps()),t}return Zo(e,n),e.prototype.setupBrowserStorage=function(t){switch(t){case go.LocalStorage:case go.SessionStorage:try{return new o9(t)}catch(r){this.logger.verbose(r);break}}return this.cacheConfig.cacheLocation=go.MemoryStorage,new rR},e.prototype.setupTemporaryCacheStorage=function(t,r){switch(r){case go.LocalStorage:case go.SessionStorage:try{return new o9(t||go.SessionStorage)}catch(i){return this.logger.verbose(i),this.internalStorage}case go.MemoryStorage:default:return this.internalStorage}},e.prototype.migrateCacheEntries=function(){var t=this,r=Le.CACHE_PREFIX+"."+xo.ID_TOKEN,i=Le.CACHE_PREFIX+"."+xo.CLIENT_INFO,o=Le.CACHE_PREFIX+"."+xo.ERROR,a=Le.CACHE_PREFIX+"."+xo.ERROR_DESC,l=[this.browserStorage.getItem(r),this.browserStorage.getItem(i),this.browserStorage.getItem(o),this.browserStorage.getItem(a)];[xo.ID_TOKEN,xo.CLIENT_INFO,xo.ERROR,xo.ERROR_DESC].forEach(function(h,p){return t.migrateCacheEntry(h,l[p])})},e.prototype.migrateCacheEntry=function(t,r){r&&this.setTemporaryCache(t,r,!0)},e.prototype.createKeyMaps=function(){var t=this,r=(this.logger.trace("BrowserCacheManager - createKeyMaps called."),this.getItem(_l.ACCOUNT_KEYS)),i=this.getItem(_l.TOKEN_KEYS+"."+this.clientId);r&&i?this.logger.verbose("BrowserCacheManager:createKeyMaps - account and token key maps already exist, skipping migration."):this.browserStorage.getKeys().forEach(function(o){var a;if(t.isCredentialKey(o)&&(a=t.getItem(o))){var l,h,p=t.validateAndParseJson(a);if(p&&p.hasOwnProperty("credentialType"))switch(p.credentialType){case In.ID_TOKEN:if(Kf.isIdTokenEntity(p))return t.logger.trace("BrowserCacheManager:createKeyMaps - idToken found, saving key to token key map"),t.logger.tracePii("BrowserCacheManager:createKeyMaps - idToken with key: "+o+" found, saving key to token key map"),h=es.toObject(new Kf,p),h=t.updateCredentialCacheKey(o,h),void t.addTokenKey(h,In.ID_TOKEN);t.logger.trace("BrowserCacheManager:createKeyMaps - key found matching idToken schema with value containing idToken credentialType field but value failed IdTokenEntity validation, skipping."),t.logger.tracePii("BrowserCacheManager:createKeyMaps - failed idToken validation on key: "+o);break;case In.ACCESS_TOKEN:case In.ACCESS_TOKEN_WITH_AUTH_SCHEME:if(Zf.isAccessTokenEntity(p))return t.logger.trace("BrowserCacheManager:createKeyMaps - accessToken found, saving key to token key map"),t.logger.tracePii("BrowserCacheManager:createKeyMaps - accessToken with key: "+o+" found, saving key to token key map"),l=es.toObject(new Zf,p),h=t.updateCredentialCacheKey(o,l),void t.addTokenKey(h,In.ACCESS_TOKEN);t.logger.trace("BrowserCacheManager:createKeyMaps - key found matching accessToken schema with value containing accessToken credentialType field but value failed AccessTokenEntity validation, skipping."),t.logger.tracePii("BrowserCacheManager:createKeyMaps - failed accessToken validation on key: "+o);break;case In.REFRESH_TOKEN:if(Cm.isRefreshTokenEntity(p))return t.logger.trace("BrowserCacheManager:createKeyMaps - refreshToken found, saving key to token key map"),t.logger.tracePii("BrowserCacheManager:createKeyMaps - refreshToken with key: "+o+" found, saving key to token key map"),l=es.toObject(new Cm,p),h=t.updateCredentialCacheKey(o,l),void t.addTokenKey(h,In.REFRESH_TOKEN);t.logger.trace("BrowserCacheManager:createKeyMaps - key found matching refreshToken schema with value containing refreshToken credentialType field but value failed RefreshTokenEntity validation, skipping."),t.logger.tracePii("BrowserCacheManager:createKeyMaps - failed refreshToken validation on key: "+o)}}t.isAccountKey(o)&&(a=t.getItem(o))&&(a=t.validateAndParseJson(a))&&Qo.isAccountEntity(a)&&(t.logger.trace("BrowserCacheManager:createKeyMaps - account found, saving key to account key map"),t.logger.tracePii("BrowserCacheManager:createKeyMaps - account with key: "+o+" found, saving key to account key map"),t.addAccountKeyToMap(o))})},e.prototype.validateAndParseJson=function(t){try{var r=JSON.parse(t);return r&&typeof r=="object"?r:null}catch{return null}},e.prototype.getItem=function(t){return this.browserStorage.getItem(t)},e.prototype.setItem=function(t,r){this.browserStorage.setItem(t,r)},e.prototype.getAccount=function(t){this.logger.trace("BrowserCacheManager.getAccount called");var r=this.getItem(t);return(r=r&&this.validateAndParseJson(r))&&Qo.isAccountEntity(r)?es.toObject(new Qo,r):(this.removeAccountKeyFromMap(t),null)},e.prototype.setAccount=function(t){this.logger.trace("BrowserCacheManager.setAccount called");var r=t.generateAccountKey();this.setItem(r,JSON.stringify(t)),this.addAccountKeyToMap(r)},e.prototype.getAccountKeys=function(){this.logger.trace("BrowserCacheManager.getAccountKeys called");var t=this.getItem(_l.ACCOUNT_KEYS);return t?JSON.parse(t):(this.logger.verbose("BrowserCacheManager.getAccountKeys - No account keys found"),[])},e.prototype.addAccountKeyToMap=function(t){this.logger.trace("BrowserCacheManager.addAccountKeyToMap called"),this.logger.tracePii("BrowserCacheManager.addAccountKeyToMap called with key: "+t);var r=this.getAccountKeys();r.indexOf(t)===-1?(r.push(t),this.setItem(_l.ACCOUNT_KEYS,JSON.stringify(r)),this.logger.verbose("BrowserCacheManager.addAccountKeyToMap account key added")):this.logger.verbose("BrowserCacheManager.addAccountKeyToMap account key already exists in map")},e.prototype.removeAccountKeyFromMap=function(i){this.logger.trace("BrowserCacheManager.removeAccountKeyFromMap called"),this.logger.tracePii("BrowserCacheManager.removeAccountKeyFromMap called with key: "+i);var r=this.getAccountKeys(),i=r.indexOf(i);-1l)i.removeHiddenIframe(t),clearInterval(h),a(Vt.createMonitorIframeTimeoutError());else{var p=Le.EMPTY_STRING,g=t.contentWindow;try{p=g?g.location.href:Le.EMPTY_STRING}catch{}Kt.isEmpty(p)||(p=g?g.location.hash:Le.EMPTY_STRING,wr.hashContainsKnownProperties(p)&&(i.removeHiddenIframe(t),clearInterval(h),o(p)))}},i.pollIntervalMilliseconds)})},e.prototype.loadFrame=function(t){var r=this;return this.performanceClient.addQueueMeasurement(nt.SilentHandlerLoadFrame,this.authCodeRequest.correlationId),new Promise(function(i,o){var a=r.createHiddenIframe();setTimeout(function(){a?(a.src=t,i(a)):o("Unable to load iframe")},r.navigateFrameWait)})},e.prototype.loadFrameSync=function(t){var r=this.createHiddenIframe();return r.src=t,r},e.prototype.createHiddenIframe=function(){var t=document.createElement("iframe");return t.style.visibility="hidden",t.style.position="absolute",t.style.width=t.style.height="0",t.style.border="0",t.setAttribute("sandbox","allow-scripts allow-same-origin allow-forms"),document.getElementsByTagName("body")[0].appendChild(t),t},e.prototype.removeHiddenIframe=function(t){document.body===t.parentNode&&document.body.removeChild(t)},e}(aR),sxe=function(n){function e(t,r,i,o,a,l,h,p,g,_,x){return t=n.call(this,t,r,i,o,a,l,p,_,x)||this,t.apiId=h,t.nativeStorage=g,t}return Zo(e,n),e.prototype.acquireToken=function(t){return dt(this,void 0,void 0,function(){var r,i,o,a;return ft(this,function(l){switch(l.label){case 0:if(this.performanceClient.addQueueMeasurement(nt.SilentIframeClientAcquireToken,t.correlationId),this.logger.verbose("acquireTokenByIframe called"),r=this.performanceClient.startMeasurement(nt.SilentIframeClientAcquireToken,t.correlationId),Kt.isEmpty(t.loginHint)&&Kt.isEmpty(t.sid)&&(!t.account||Kt.isEmpty(t.account.username))&&this.logger.warning("No user hint provided. The authorization server may need more information to complete this request."),t.prompt&&t.prompt!==da.NONE&&t.prompt!==da.NO_SESSION)throw r.endMeasurement({success:!1}),Vt.createSilentPromptValueError(t.prompt);return this.performanceClient.setPreQueueTime(nt.StandardInteractionClientInitializeAuthorizationRequest,t.correlationId),[4,this.initializeAuthorizationRequest(yn(yn({},t),{prompt:t.prompt||da.NONE}),hn.Silent)];case 1:i=l.sent(),this.browserStorage.updateCacheEntries(i.state,i.nonce,i.authority,i.loginHint||Le.EMPTY_STRING,i.account||null),o=this.initializeServerTelemetryManager(this.apiId),l.label=2;case 2:return l.trys.push([2,5,,6]),this.performanceClient.setPreQueueTime(nt.StandardInteractionClientCreateAuthCodeClient,t.correlationId),[4,this.createAuthCodeClient(o,i.authority,i.azureCloudOptions)];case 3:return a=l.sent(),this.logger.verbose("Auth code client created"),this.performanceClient.setPreQueueTime(nt.SilentIframeClientTokenHelper,t.correlationId),[4,this.silentTokenHelper(a,i).then(function(h){return r.endMeasurement({success:!0,fromCache:!1,requestId:h.requestId}),h})];case 4:return[2,l.sent()];case 5:throw(a=l.sent())instanceof wn&&a.setCorrelationId(this.correlationId),o.cacheFailedRequest(a),this.browserStorage.cleanRequestByState(i.state),r.endMeasurement({errorCode:a instanceof wn&&a.errorCode||void 0,subErrorCode:a instanceof wn&&a.subError||void 0,success:!1}),a;case 6:return[2]}})})},e.prototype.logout=function(){return Promise.reject(Vt.createSilentLogoutUnsupportedError())},e.prototype.silentTokenHelper=function(t,r){return dt(this,void 0,void 0,function(){var i,o,a,l,h,p,g,_=this;return ft(this,function(x){switch(x.label){case 0:return this.performanceClient.addQueueMeasurement(nt.SilentIframeClientTokenHelper,r.correlationId),this.performanceClient.setPreQueueTime(nt.StandardInteractionClientInitializeAuthorizationCodeRequest,r.correlationId),[4,this.initializeAuthorizationCodeRequest(r)];case 1:return i=x.sent(),this.performanceClient.setPreQueueTime(nt.GetAuthCodeUrl,r.correlationId),[4,t.getAuthCodeUrl(yn(yn({},r),{nativeBroker:Xf.isNativeAvailable(this.config,this.logger,this.nativeMessageHandler,r.authenticationScheme)}))];case 2:return a=x.sent(),o=new u9(t,this.browserStorage,i,this.logger,this.config.system,this.performanceClient),this.performanceClient.setPreQueueTime(nt.SilentHandlerInitiateAuthRequest,r.correlationId),[4,o.initiateAuthRequest(a)];case 3:return a=x.sent(),this.performanceClient.setPreQueueTime(nt.SilentHandlerMonitorIframeForHash,r.correlationId),[4,o.monitorIframeForHash(a,this.config.system.iframeHashTimeout)];case 4:if(l=x.sent(),p=wr.getDeserializedHash(l),h=this.validateAndExtractStateFromHash(p,hn.Silent,i.correlationId),p.accountId){if(this.logger.verbose("Account id found in hash, calling WAM for token"),this.nativeMessageHandler)return p=new km(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.apiId,this.performanceClient,this.nativeMessageHandler,p.accountId,this.browserStorage,this.correlationId),g=bu.parseRequestState(this.browserCrypto,h).userRequestState,[2,p.acquireToken(yn(yn({},r),{state:g,prompt:r.prompt||da.NONE})).finally(function(){_.browserStorage.cleanRequestByState(h)})];throw Vt.createNativeConnectionNotEstablishedError()}return this.performanceClient.setPreQueueTime(nt.HandleCodeResponseFromHash,r.correlationId),[2,o.handleCodeResponseFromHash(l,h,t.authority,this.networkClient)]}})})},e}(Rm),cxe=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return Zo(e,n),e.prototype.acquireToken=function(t){return dt(this,void 0,void 0,function(){var r,i,o,a,l,h=this;return ft(this,function(p){switch(p.label){case 0:return this.performanceClient.addQueueMeasurement(nt.SilentRefreshClientAcquireToken,t.correlationId),this.performanceClient.setPreQueueTime(nt.InitializeBaseRequest,t.correlationId),i=[yn({},t)],[4,this.initializeBaseRequest(t,t.account)];case 1:return r=yn.apply(void 0,i.concat([p.sent()])),o=this.performanceClient.startMeasurement(nt.SilentRefreshClientAcquireToken,r.correlationId),a=this.initializeServerTelemetryManager(_i.acquireTokenSilent_silentFlow),[4,this.createRefreshTokenClient(a,r.authority,r.azureCloudOptions)];case 2:return l=p.sent(),this.logger.verbose("Refresh token client created"),this.performanceClient.setPreQueueTime(nt.RefreshTokenClientAcquireTokenByRefreshToken,t.correlationId),[2,l.acquireTokenByRefreshToken(r).then(function(g){return o.endMeasurement({success:!0,fromCache:g.fromCache,requestId:g.requestId}),g}).catch(function(g){throw g instanceof wn&&g.setCorrelationId(h.correlationId),a.cacheFailedRequest(g),o.endMeasurement({errorCode:g.errorCode,subErrorCode:g.subError,success:!1}),g})]}})})},e.prototype.logout=function(){return Promise.reject(Vt.createSilentLogoutUnsupportedError())},e.prototype.createRefreshTokenClient=function(t,r,i){return dt(this,void 0,void 0,function(){var o;return ft(this,function(a){switch(a.label){case 0:return this.performanceClient.setPreQueueTime(nt.StandardInteractionClientGetClientConfiguration,this.correlationId),[4,this.getClientConfiguration(t,r,i)];case 1:return o=a.sent(),[2,new Yj(o,this.performanceClient)]}})})},e}(Rm),lxe=function(){function n(e,t){this.eventCallbacks=new Map,this.logger=e,this.browserCrypto=t,this.listeningToStorageEvents=!1,this.handleAccountCacheChange=this.handleAccountCacheChange.bind(this)}return n.prototype.addEventCallback=function(e){var t;return typeof window<"u"?(t=this.browserCrypto.createNewGuid(),this.eventCallbacks.set(t,e),this.logger.verbose("Event callback registered with id: "+t),t):null},n.prototype.removeEventCallback=function(e){this.eventCallbacks.delete(e),this.logger.verbose("Event callback "+e+" removed.")},n.prototype.enableAccountStorageEvents=function(){typeof window<"u"&&(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)))},n.prototype.disableAccountStorageEvents=function(){typeof window<"u"&&(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."))},n.prototype.emitEvent=function(e,t,r,i){var o,a=this;typeof window<"u"&&(o={eventType:e,interactionType:t||null,payload:r||null,error:i||null,timestamp:Date.now()},this.logger.info("Emitting event: "+e),this.eventCallbacks.forEach(function(l,h){a.logger.verbose("Emitting event to callback "+h+": "+e),l.apply(null,[o])}))},n.prototype.handleAccountCacheChange=function(e){try{var t,r,i=e.newValue||e.oldValue;i&&typeof(t=JSON.parse(i))=="object"&&Qo.isAccountEntity(t)&&(r=es.toObject(new Qo,t).getAccountInfo(),!e.oldValue&&e.newValue?(this.logger.info("Account was added to cache in a different window"),this.emitEvent(Fn.ACCOUNT_ADDED,void 0,r)):!e.newValue&&e.oldValue&&(this.logger.info("Account was removed from cache in a different window"),this.emitEvent(Fn.ACCOUNT_REMOVED,void 0,r)))}catch{}},n}(),pa=function(){function n(){}return n.decimalToHex=function(e){for(var t=e.toString(16);t.length<2;)t="0"+t;return t},n}(),h9=function(){function n(e){this.cryptoObj=e}return n.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,pa.decimalToHex(e[0])+pa.decimalToHex(e[1])+pa.decimalToHex(e[2])+pa.decimalToHex(e[3])+"-"+pa.decimalToHex(e[4])+pa.decimalToHex(e[5])+"-"+pa.decimalToHex(e[6])+pa.decimalToHex(e[7])+"-"+pa.decimalToHex(e[8])+pa.decimalToHex(e[9])+"-"+pa.decimalToHex(e[10])+pa.decimalToHex(e[11])+pa.decimalToHex(e[12])+pa.decimalToHex(e[13])+pa.decimalToHex(e[14])+pa.decimalToHex(e[15])}catch{for(var t="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx",r="0123456789abcdef",i=0,o=Le.EMPTY_STRING,a=0;a<36;a++)t[a]!=="-"&&t[a]!=="4"&&(i=16*Math.random()|0),o+=t[a]==="x"?r[i]:t[a]==="y"?r[i=i&3|8]:t[a];return o}},n.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)},n}(),xu=function(){function n(){}return n.stringToUtf8Arr=function(e){for(var t,r=0,i=e.length,o=0;o>>6):(t<65536?a[l++]=224+(t>>>12):(t<2097152?a[l++]=240+(t>>>18):(t<67108864?a[l++]=248+(t>>>24):(a[l++]=252+(t>>>30),a[l++]=128+(t>>>24&63)),a[l++]=128+(t>>>18&63)),a[l++]=128+(t>>>12&63)),a[l++]=128+(t>>>6&63)),a[l++]=128+(63&t));return a},n.stringToArrayBuffer=function(e){for(var t=new ArrayBuffer(e.length),r=new Uint8Array(t),i=0;i>>(t=l%3)&24),t!=2&&e.length-l!=1||(i+=String.fromCharCode(this.uint6ToB64(a>>>18&63),this.uint6ToB64(a>>>12&63),this.uint6ToB64(a>>>6&63),this.uint6ToB64(63&a)),a=0);return r==0?i:i.substring(0,i.length-r)+(r==1?"=":"==")},n.prototype.uint6ToB64=function(e){return e<26?e+65:e<52?e+71:e<62?e-4:e===62?43:e===63?47:65},n}(),uxe=function(){function n(){}return n.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")}return e=this.base64DecToArr(t),xu.utf8ArrToString(e)},n.prototype.base64DecToArr=function(e,t){for(var r,i=e.replace(/[^A-Za-z0-9\+\/]/g,Le.EMPTY_STRING),o=i.length,a=t?Math.ceil((3*o+1>>>2)/t)*t:3*o+1>>>2,l=new Uint8Array(a),h=void 0,p=0,g=0,_=0;_>>(16>>>h&24)&255;p=0}return l},n.prototype.b64ToUint6=function(e){return 64>(-2*i&6))))r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(r);return a};function Ixe(n){var e=n.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(y9(e).replace(/(.)/g,function(t,r){return r=r.charCodeAt(0).toString(16).toUpperCase(),"%"+(r=r.length<2?"0"+r:r)}))}catch{return y9(e)}}function NE(n){this.message=n}function Pxe(n,e){if(typeof n!="string")throw new NE("Invalid token specified");e=(e=e||{}).header===!0?0:1;try{return JSON.parse(Ixe(n.split(".")[e]))}catch(t){throw new NE("Invalid token specified: "+t.message)}}NE.prototype=new Error,NE.prototype.name="InvalidTokenError";var Mxe=function(){function n(e){var t=this,r=(this.fallbackStorage={},this._triggerTokenFetch=function(i){return i===void 0&&(i=!1),new Promise(function(o,a){typeof t.options.getToken!="function"?a(new Error("Token cannot be ".concat(i?"fetched":"renewed"," because getToken was not set or is not a function."))):t.options.getToken(function(l){try{var h=t._getTokenExpiry(l)-n.constants.tokenRefreshClockSkew;t._storeToken(l),t._setTimeoutTokenFetch(h),o()}catch{a(new Error("Invalid token returned by getToken function"))}},function(l){a(l)},t.map)})},this._setTimeoutTokenFetch=function(i){clearTimeout(t.tokenTimeOutHandle),t.tokenTimeOutHandle=setTimeout(t._triggerTokenFetch,Math.min(1e3*i,2147483647))},e.getServiceOptions());this.options=r.authOptions,this.sessionId=r.sessionId,this.map=e}return n.prototype.initialize=function(){var e=this;return this.initPromise||(this.initPromise=new Promise(function(t,r){if(e.options.authType===ri.subscriptionKey)t();else if(e.options.authType===ri.aad)e.options.authContext=e.options.authContext||n.getDefaultAuthContext(e.options),e.options.authContext.handleRedirectPromise().then(function(){setTimeout(function(){return e._loginAndAcquireTokenForAAD(t,r)})}).catch(function(o){r(new Error("Error logging in the AAD users: "+o))});else if(e.options.authType===ri.anonymous)t(e._triggerTokenFetch(!0));else if(e.options.authType===ri.sas){if(e.options.sasToken){var i=-1;try{i=e._getTokenExpiry(e.options.sasToken)}catch{return void r(new Error("An invalid sasToken was provided."))}if(i>n.constants.tokenRefreshClockSkew)return e._storeToken(e.options.sasToken),e._setTimeoutTokenFetch(i-n.constants.tokenRefreshClockSkew),void t()}t(e._triggerTokenFetch())}else r(new Error("An invalid authentication type was specified."))})),this.initPromise},n.prototype.dispose=function(){this.tokenTimeOutHandle&&(clearTimeout(this.tokenTimeOutHandle),this.tokenTimeOutHandle=null)},n.getDefaultAuthContext=function(e){if(!e.aadAppId)throw new Error("No AAD app ID was specified.");if(e.aadTenant)return this.defaultAuthContext||(this.defaultAuthContext=new Axe({auth:{authority:"".concat(e.aadInstance||yc.aadInstance).concat(e.aadTenant),clientId:e.aadAppId},cache:{cacheLocation:this.constants.preferredCacheLocation}})),this.defaultAuthContext;throw new Error("No AAD tenant was specified.")},n.prototype._loginAndAcquireTokenForAAD=function(e,t){var r=((r=this.options.authContext)==null?void 0:r.getAllAccounts())||[];r.length===0?(this.options.authContext.loginRedirect(),e()):(this.options.authContext.setActiveAccount(r[0]),this._acquireTokenForAAD(e,t))},n.prototype._acquireTokenForAAD=function(e,t){var r=this,i={scopes:[Nn.aadResourceId]};this.options.authContext.acquireTokenSilent(i).then(function(o){r._saveItem(n.constants.storage.tokenKey,o.accessToken);var a={map:r.map,type:n.constants.events.tokenAcquired},a=(r.map.events.invoke(n.constants.events.tokenAcquired,a),clearTimeout(r.tokenTimeOutHandle),new Date(o.expiresOn).getTime()-Date.now());r.tokenTimeOutHandle=setTimeout(function(){return r._acquireTokenForAAD()},a),e!=null&&e()}).catch(function(o){if(o instanceof tc)return r.options.authContext.acquireTokenRedirect(i),e==null?void 0:e();t!=null&&t(o)})},n.prototype.getAuthType=function(){return this.options.authType},n.prototype.getClientId=function(){return this.options.clientId},n.prototype.getToken=function(){if(this.options.authType===ri.aad)return this._getItem(n.constants.storage.tokenKey);if(this.options.authType!==ri.anonymous&&this.options.authType!==ri.sas)return this.options.authType===ri.subscriptionKey?this.options.subscriptionKey:void 0;var e=this._getItem(n.constants.storage.tokenKey);if(e){var t=this._getTokenExpiry(e);if(t<300&&0=n.length?void 0:n)&&n[r++],done:!n}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Rxe=function(){function n(e){for(var t in this.map=e,this.controlContainer=document.createElement("div"),this.controlContainer.classList.add("atlas-control-container"),xa){var r;xa.hasOwnProperty(t)&&((r=document.createElement("div")).classList.add(xa[t]),r.classList.add("subcontrol-container"),this.controlContainer.appendChild(r))}this.map.getMapContainer().appendChild(this.controlContainer),this.controls=new Set}return n.prototype.add=function(e,t){var r,i;if(Array.isArray(e))try{for(var o=_9(e),a=o.next();!a.done;a=o.next()){var l=a.value;this._add(l,t)}}catch(h){r={error:h}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}else this._add(e,t)},n.prototype.getControls=function(){return Array.from(this.controls)},n.prototype.remove=function(e){var t,r;if(Array.isArray(e))try{for(var i=_9(e),o=i.next();!o.done;o=i.next()){var a=o.value;this._remove(a)}}catch(l){t={error:l}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}else this._remove(e)},n.prototype._add=function(i,o){this.controls.add(i);var r=new noe().merge(o),i=i.onAdd(this.map,o),o=this.controlContainer.getElementsByClassName(r.position);if(!(0=n.length?void 0:n)&&n[r++],done:!n}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},lR=window&&window.__read||function(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r,i,o=t.call(n),a=[];try{for(;(e===void 0||0=n.length?void 0:n)&&n[r++],done:!n}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Lxe=function(){function n(e){this.markers=new Set,this.map=e}return n.prototype.add=function(e,t){var r,i;if(Array.isArray(e))try{for(var o=b9(e),a=o.next();!a.done;a=o.next()){var l=a.value;this._addMarker(l,t)}}catch(h){r={error:h}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}else this._addMarker(e,t)},n.prototype._addMarker=function(e,t){e._addToMap(this.map,t),this.markers.add(e)},n.prototype.getMarkers=function(){return Array.from(this.markers)},n.prototype.remove=function(e){var t,r;if(Array.isArray(e))try{for(var i=b9(e),o=i.next();!o.done;o=i.next()){var a=o.value;this._removeMarker(a)}}catch(l){t={error:l}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}else this._removeMarker(e)},n.prototype._removeMarker=function(e){var t=this;e instanceof p2?(e._removeFromMap(),this.markers.delete(e)):this.markers.forEach(function(r){r._getId()===e&&(r._removeFromMap(),t.markers.delete(r))})},n.prototype.clear=function(){var e=this;this.markers.forEach(function(t){t._removeFromMap(),e.markers.delete(t)})},n}(),Nxe=function(){function n(e){this.userImages=new ws,this.imageLoadTimeout=5e3,this.map=e}return n.prototype.add=function(e,t,r){var i=this;return new Promise(function(o,a){var l,h,p;i.userImages.has(e)?o():t instanceof HTMLImageElement||t instanceof ImageData?(i.map._getMap().addImage(e,t,r),i.userImages.set(e,{image:t,meta:r}),o()):typeof t=="string"&&(h=void 0,h=/=n.length?void 0:n)&&n[r++],done:!n}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Kh=function(n){function e(t,r){return r=n.call(this,r)||this,r.layers=t,r}return Dxe(e,n),e.prototype.getOptions=function(){return{}},e.prototype.setOptions=function(t){},e.prototype._buildLayers=function(){return this.layers},e.prototype._getLayerIds=function(){return this.layers.map(function(t){return t.id})},e.prototype._getSourceIds=function(){var t,r,i=new Set;try{for(var o=Fxe(this.layers),a=o.next();!a.done;a=o.next()){var l=a.value;"source"in l&&typeof l.source=="string"?i.add(l.source):"source"in l&&l.source&&i.add(l.id)}}catch(h){t={error:h}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}return i},e.prototype._updateLayoutProperty=function(t,r,i,o){var a;Ea(r,i)||(a=this.map._getMap(),this.layers.forEach(function(l){a.getLayer(l.id)?a.setLayoutProperty(l.id,t,o||r):console.warn("Could not update layout property ".concat(t," for layer ").concat(l.id," to ").concat(o||r))}))},e}(Ai),Eu=window&&window.__values||function(n){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&n[e],r=0;if(t)return t.call(n);if(n&&typeof n.length=="number")return{next:function(){return{value:(n=n&&r>=n.length?void 0:n)&&n[r++],done:!n}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Bxe=window&&window.__read||function(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r,i,o=t.call(n),a=[];try{for(;(e===void 0||0=n.length?void 0:n)&&n[r++],done:!n}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},jxe=function(){function n(e){var t=this;this._onDrag=function(r){var i,o;r.type==="mousemove"?(i=r.clientX,o=r.clientY):r.type==="touchmove"&&(i=r.touches[0].clientX,o=r.touches[0].clientY),t.draggedPopups.forEach(function(a){a._dragToPixel([i,o])})},this._onUp=function(){t.map.getMapContainer().removeEventListener("mousemove",t._onDrag),t.map.getMapContainer().removeEventListener("touchmove",t._onDrag),t.map.getMapContainer().removeEventListener("mouseup",t._onUp),t.map.getMapContainer().removeEventListener("touchend",t._onUp),t.draggedPopups.forEach(function(r){t.draggedPopups.delete(r),r._onUp()})},this.map=e,this.popups=new Set,this.draggedPopups=new Set}return n.prototype.add=function(e){var t,r;e=Array.isArray(e)?e:[e];try{for(var i=w9(e),o=i.next();!o.done;o=i.next()){var a=o.value;this.popups.has(a)||(this.popups.add(a),a.attach(this.map))}}catch(l){t={error:l}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}},n.prototype.clear=function(){var e=this;this.popups.forEach(function(t){e.popups.delete(t),t.remove()})},n.prototype.remove=function(e){var t,r;e=Array.isArray(e)?e:[e];try{for(var i=w9(e),o=i.next();!o.done;o=i.next()){var a=o.value;this.popups.has(a)&&(this.popups.delete(a),a.remove())}}catch(l){t={error:l}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}},n.prototype.getPopups=function(){return Array.from(this.popups)},n.prototype._getCollectionDiv=function(){var e=this.map.getMapContainer().querySelector(".".concat(n.Css.collection));return e||((e=document.createElement("div")).classList.add(n.Css.collection),e.setAttribute("aria-label","Map Information"),this.map.getMapContainer().appendChild(e)),e},n.prototype._addDraggedPopup=function(e){this.draggedPopups.size===0&&(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)},n.Css={collection:"popup-collection-container"},n}(),uR=window&&window.__values||function(n){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&n[e],r=0;if(t)return t.call(n);if(n&&typeof n.length=="number")return{next:function(){return{value:(n=n&&r>=n.length?void 0:n)&&n[r++],done:!n}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Vxe=function(){function n(e){this.map=e,this.sources=new ws}return n.prototype.add=function(e,t){var r,i;if(t===void 0&&(t=!0),Array.isArray(e))try{for(var o=uR(e),a=o.next();!a.done;a=o.next()){var l=a.value;this._addSource(l,t)}}catch(h){r={error:h}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}else this._addSource(e,t)},n.prototype.getRenderedShapes=function(e,t,r){return e=typeof e=="string"?e:e.getId(),r=this.map._getMap().querySourceFeatures(e,{sourceLayer:r,filter:t}),this.map.sources._mapFeaturesToShapes(r,!0,this.sources.get(e))},n.prototype.getFeatureState=function(e,t,r){return e=typeof e=="string"?e:e instanceof Ci?e.getId():e.id,t=typeof t=="string"?t:t.getId(),this.map._getMap().getFeatureState({id:e,source:t,sourceLayer:r})},n.prototype.removeFeatureState=function(e,t,r,i){e=typeof e=="string"?e:e instanceof Ci?e.getId():e.id,t=typeof t=="string"?t:t.getId(),this.map._getMap().removeFeatureState({id:e,source:t,sourceLayer:r},i)},n.prototype.setFeatureState=function(e,t,r,i){e=typeof e=="string"?e:e instanceof Ci?e.getId():e.id,t=typeof t=="string"?t:t.getId(),this.map._getMap().setFeatureState({id:e,source:t,sourceLayer:i},r)},n.prototype._buildSources=function(){var e={};return this.sources.forEach(function(t){e[t.getId()]=t._buildSource()}),e},n.prototype.clear=function(){var e=this;this.sources.forEach(function(t){e.remove(t)})},n.prototype.getById=function(e){return this.sources.get(e)},n.prototype.getSources=function(){return Array.from(this.sources.values())},n.prototype.isSourceLoaded=function(e){return e=e instanceof gi?e.getId():e,this.map._getMap().isSourceLoaded(e)},n.prototype.remove=function(e,t){var r,i;if(t===void 0&&(t=!0),Array.isArray(e))try{for(var o=uR(e),a=o.next();!a.done;a=o.next()){var l=a.value;this._removeSource(l,t)}}catch(h){r={error:h}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}else this._removeSource(e,t)},n.prototype.setSourceState=function(e,t){t===void 0&&(t=!0),this.sources.set(e.getId(),e),e._setMap(this.map,t)},n.prototype.unsetSourceState=function(e){this.sources.has(e)&&(this.sources.get(e)._setMap(null),this.sources.delete(e))},n.prototype._removeSource=function(e,t){if(e=e instanceof gi?e.getId():e,!this.sources.has(e))throw new Error("'".concat(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 '".concat(e,"'"));this.unsetSourceState(e)},n.prototype._addSource=function(e,t){if(this.sources.has(e.getId())){if(t)throw new Error("'".concat(e.getId(),"' is already added to the map"));this.unsetSourceState(e.getId())}if(t){if(!this.map._isReady())throw new Error("The source '".concat(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)},n.prototype._mapFeaturesToShapes=function(e,t,r){var i,o,a=[];try{for(var l=uR(e),h=l.next();!h.done;h=l.next()){var p=h.value;if((r||typeof p.source=="string")&&typeof p.properties[Ci._shapeIdPropName]=="string"){var g=r||this.sources.get(p.source);if(g instanceof Es){var _=g.getShapeById(p.properties[Ci._shapeIdPropName]);if(_ instanceof Ci){a.push(_);continue}}}t||a.push(p)}}catch(x){i={error:x}}finally{try{h&&!h.done&&(o=l.return)&&o.call(l)}finally{if(i)throw i.error}}return a},n.prototype._syncSources=function(e){var t=this;e?(Object.keys(e).map(function(r){var i,o=e[r];switch(o.type){case"vector":case"raster":case"raster-dem":i=new L6(r,{name:r,tiles:o.tiles,type:o.type,url:o.url,tileSize:"tileSize"in o?o.tileSize:void 0});break;case"canvas":i=new A6(r,o);break;case"geojson":var a=new Es(r,{maxZoom:o.maxzoom,cluster:o.cluster,clusterRadius:o.clusterRadius,tolerance:o.tolerance,lineMetrics:o.lineMetrics,clusterProperties:o.clusterProperties,buffer:o.buffer,clusterMinPoints:o.clusterMinPoints,generateId:o.generateId,promoteId:o.promoteId,filter:o.filter});typeof o.data!="string"&&o.data!==void 0&&a._addNoUpdate(o.data),i=a;break;case"image":i=new u2(r,o);break;case"video":i=new P6(r,o);break;default:i=new I6(r,o)}return i}).forEach(function(r){var i=t.sources.get(r.getId()),o=i&&r._isDeepEqual(i);!o&&i&&t.unsetSourceState(i.getId()),t.setSourceState(r,!o)}),Array.from(this.sources.keys()).filter(function(r){return!(r in e)}).forEach(function(r){return t.unsetSourceState(r)})):console.warn("syncSources called with no style sources which is unexpected.")},n}(),Hxe=window&&window.__extends||function(){var n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(r,i){r.__proto__=i}:function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])}))(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),Gxe=function(n){function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.duration=1e3,t.type="jump",t}return Hxe(e,n),e}(ii),qxe=window&&window.__extends||function(){var n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(r,i){r.__proto__=i}:function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])}))(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),$xe=function(n){function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.bottom=0,t.left=0,t.right=0,t.top=0,t}return qxe(e,n),e}(ii),Wxe=window&&window.__extends||function(){var n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(r,i){r.__proto__=i}:function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])}))(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),Yxe=window&&window.__values||function(n){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&n[e],r=0;if(t)return t.call(n);if(n&&typeof n.length=="number")return{next:function(){return{value:(n=n&&r>=n.length?void 0:n)&&n[r++],done:!n}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Kxe=window&&window.__read||function(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r,i,o=t.call(n),a=[];try{for(;(e===void 0||0=n.length?void 0:n)&&n[r++],done:!n}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},gEe=window&&window.__read||function(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r,i,o=t.call(n),a=[];try{for(;(e===void 0||0=n.length?void 0:n)&&n[r++],done:!n}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},S0=window&&window.__read||function(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r,i,o=t.call(n),a=[];try{for(;(e===void 0||0i[0]&&g[1]=n.length?void 0:n)&&n[r++],done:!n}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},FE={countryRegion:"cr|bv:0",adminDistrict:"ad|bv:0",adminDistrict2:"ds|bv:0",buildingFootprint:"bld|v:0_adr|lv:0",roadDetails:"g|rasterDetailsVisible:0"},wEe=function(){function n(e,t){var r=this;this.definitions=function(){var i=r.initPromise||r.initStyleset();return i},this.indoorState=void 0,this.preservedPreindoorMapConfiguration=void 0,this._progressiveLoadingState={mapStyle:void 0,pendingVisibilityChange:void 0},this._deferLayerGroupVisibilities=function(i,o){var a,l,h,p,g=o.filter(function(_){return _ in i});g.length!==0&&(a=r.map._getMap(),l=a.getZoom(),h=r.map.getStyle().style,r._progressiveLoadingState.pendingVisibilityChange&&(r.map.events.remove("load",r._progressiveLoadingState.pendingVisibilityChange),r._progressiveLoadingState.pendingVisibilityChange=null),r._progressiveLoadingState.mapStyle=h,(p=Object.entries(i).reduce(function(_,M){var M=Zh(M,2),C=M[0],M=M[1],L=g.includes(C);return gR(gR([],Zh(_),!1),Zh(M.filter(function(F){if(F.type==="custom")return!1;if(L){if(typeof F.maxzoom=="number"&&typeof F.minzoom=="number"){if(l<=F.maxzoom&&l>=F.minzoom)return!1}else if(typeof F.minzoom=="number"){if(l>=F.minzoom)return!1}else if(typeof F.maxzoom!="number"||l<=F.maxzoom)return!1}return((F=F.layout)==null?void 0:F.visibility)!=="none"})),!1)},[])).forEach(function(_){_.layout=_.layout||{},_.layout.visibility="none"}),r._progressiveLoadingState.pendingVisibilityChange=function(){r._progressiveLoadingState.pendingVisibilityChange=null;var _=r.map.getStyle().style;h===_&&(p.forEach(function(x){x.layout.visibility="visible",a.setLayoutProperty(x.id,"visibility","visible")}),(_=r.map.copyrightDelegate)!=null)&&_.reloadAttribution()},r.map.events.addOnce("load",r._progressiveLoadingState.pendingVisibilityChange))},this._onStyleData=function(i){r.map.events.invoke("stylechanged",{style:i.name,map:r.map,type:"stylechanged"})},this._lookUp=function(i){var o,a,p=r.definitions(),l=p.errorIfRejected(),h=p.resultIfResolved();if(l||!h)return null;var p=h.configurations,g=void 0;try{for(var _=bEe(p),x=_.next();!x.done;x=_.next()){var C=x.value;if(C.name===i.style)return C;C.name===h.defaultConfiguration&&(g=g||C)}}catch(M){o={error:M}}finally{try{x&&!x.done&&(a=_.return)&&a.call(_)}finally{if(o)throw o.error}}return g=g||p[0]},this._lookUpAsync=function(i){return fR(r,void 0,void 0,function(){var o;return pR(this,function(a){switch(a.label){case 0:return[4,this.definitions()];case 1:return o=a.sent(),[2,o.configurations.find(function(l){return l.name===(i.style||o.defaultConfiguration)})||o.configurations.find(function(l){return l.name===o.defaultConfiguration})||o.configurations[0]]}})})},this.map=e,this.serviceOptions=t}return n.prototype.updateIndoorState=function(e,t){var r,i,o=this,a=this.map.styles.getMapConfiguration();a?(this.preservedPreindoorMapConfiguration=a,r=this.map.getStyle().style?"".concat(this.map.getStyle().style,"_indoor").concat(e==="dark"?"_dark":"","_tileset_").concat(t):void 0,this.map.styles.setMapConfiguration("defaultIndoor_".concat(t),a==="microsoft-maps:default"?r:void 0)):(i=((a=this.indoorState)==null?void 0:a.tilesetId)!==t,this.indoorState={tilesetId:t,theme:e},this.initStyleset(),this.definitions().then(function(l){var p=(o.map.getStyle().style||l.defaultConfiguration).replace("_indoor_dark","").replace("_indoor",""),h="".concat(p,"_indoor"),p=l.configurations.find(function(g){return g.name.startsWith(h)});p&&o.map.setStyle({style:p.name},!i)}))},n.prototype.unsetIndoorState=function(){var e=this,t=this.preservedPreindoorMapConfiguration;t?this.map.styles.setMapConfiguration(t):(this.indoorState=void 0,this.initStyleset(),this.definitions().then(function(r){var i=e.map.getStyle().style;i.includes("_indoor")&&i.split("_indoor")[0]?e.map.setStyle({style:i.split("_indoor")[0]}):e.map.setStyle({style:void 0})}))},n.prototype.initStyleset=function(){var e,t=this;return e=this.serviceOptions.mapConfiguration?typeof this.serviceOptions.mapConfiguration=="string"?(e=this.map.authentication?this.map.authentication.initialize():Promise.resolve(),new DE(e.then(function(){return t._request(t.serviceOptions.domain,"".concat(Nn.styleResourcePath,"/mapconfigurations/metadata/").concat(t.serviceOptions.mapConfiguration),"StyleDefinitions").then(function(r){return Mc(Mc({},r),{defaultConfiguration:r.defaultConfiguration||r.defaultStyle,configurations:r.configurations||r.styles})})}))):DE.resolve(this.serviceOptions.mapConfiguration):(e=this.map.authentication?this.map.authentication.initialize():Promise.resolve(),new DE(e.then(function(){return t._request(t.serviceOptions.staticAssetsDomain,"".concat(Nn.stylePath,"/").concat(Nn.styleResourcePath),"StyleDefinitions",{version:t.serviceOptions.styleDefinitionsVersion,mcv:ah.replace(/\./g,"")}).then(function(r){return{version:isNaN(r.version)?0:parseFloat(r.version),defaultConfiguration:r.defaultStyle,configurations:r.styles.filter(function(i){return t.indoorState?t.indoorState.theme==="auto"?i.name.endsWith(i.theme==="dark"?"_indoor_dark":"_indoor"):i.name.endsWith(t.indoorState.theme==="dark"?"_indoor_dark":"_indoor"):!i.name.includes("indoor")}).map(function(i){return{copyright:i.copyright.join(" "),name:i.name,displayName:function(o){return o=t.indoorState&&o.includes("_indoor")?o.split("_indoor")[0]:o,o in E9?E9[o]:o}(i.name),theme:i.theme,thumbnail:new Zc({domain:t.serviceOptions.staticAssetsDomain,path:i.thumbnail,protocol:"https"}).toString(),url:new Zc({domain:t.serviceOptions.staticAssetsDomain,path:"".concat(Nn.stylePath,"/").concat(Nn.styleResourcePath,"/").concat(i.name),queryParams:{styleVersion:r.version!==void 0&&r.version!==null?r.version:t.serviceOptions.styleDefinitionsVersion,mcv:ah.replace(/\./g,"")},protocol:"https"}).toString()}})}})}))),this.initPromise&&this.initPromise.switchWith(e),this.initPromise=e,this.initPromise.then(function(r){return t.map._invokeEvent("mapconfigurationchanged",r)}),this.initPromise},n.prototype.getStyle=function(e){if(e=this._lookUp(e),!e)throw Error("Style definition is not available.");if(e.url)return e.url;if(e.style)return e.style;throw Error("Style definition neither contains URL nor style object.")},n.prototype.deriveNewStyleAndLayerGroups=function(e,t){for(var r,i,o=this.map.getStyle(),a=this.map.getTraffic(),l={},h=0;h=n.length?void 0:n)&&n[r++],done:!n}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},EEe=function(){function n(e){this.map=e,this.indicators=new Set}return n.prototype.add=function(e){var t,r;e=Array.isArray(e)?e:[e];try{for(var i=T9(e),o=i.next();!o.done;o=i.next()){var a=o.value;this.indicators.has(a)||(this.indicators.add(a),a.attach(this.map))}}catch(l){t={error:l}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}},n.prototype.clear=function(){var e=this;this.indicators.forEach(function(t){e.indicators.delete(t),t.remove()})},n.prototype.remove=function(e){var t,r;e=Array.isArray(e)?e:[e];try{for(var i=T9(e),o=i.next();!o.done;o=i.next()){var a=o.value;this.indicators.has(a)&&(this.indicators.delete(a),a.remove())}}catch(l){t={error:l}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}},n.prototype.getIndicators=function(){return Array.from(this.indicators)},n.prototype._getCollectionDiv=function(){var e=this.map.getMapContainer().querySelector(".".concat(n.Css.collection));return e||((e=document.createElement("div")).setAttribute("aria-label","map data"),e.setAttribute("role","listbox"),e.classList.add(n.Css.collection),this.map.getMapContainer().appendChild(e)),e},n.Css={collection:"accessible-indicator-collection-container"},n}(),TEe=window&&window.__extends||function(){var n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(r,i){r.__proto__=i}:function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])}))(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),Tu=window&&window.__assign||function(){return(Tu=Object.assign||function(n){for(var e,t=1,r=arguments.length;ti[0]&&g[1]=n.length?void 0:n)&&n[r++],done:!n}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},S9=function(n){function e(t,r){var i,o,a=n.call(this)||this,l=(a.removed=!1,a.loaded=!1,a.ready=!1,a._resizeCallback=function(){return a.resize()},!0);a._updateGlobalDefaults(r),a.serviceOptions=new dR().merge(r),a.styleOptions=new x9().merge(r),a.trafficOptions=new ew,a.styles=new wEe(a,a.serviceOptions),a.insights=new G1e(a.serviceOptions),a.serviceOptions.authOptions.subscriptionKey&&(a.serviceOptions.authOptions.subscriptionKey=encodeURIComponent(a.serviceOptions.authOptions.subscriptionKey)),i=a.serviceOptions.authOptions.clientId||(a.serviceOptions.authOptions.subscriptionKey?a.serviceOptions.authOptions.subscriptionKey.replace(/.(?=.{3,}$)/g,"*"):"invalid-setting"),a.insights&&a.insights.setAuthenticatedUserContext(a.serviceOptions.sessionId,i),arguments[2]&&xEe()?(o=arguments[2],a.ready=!0,a.loaded=!0):(i={antialias:a.styleOptions.antialias,attributionControl:!1,container:t,fadeDuration:a.serviceOptions.fadeDuration,localIdeographFontFamily:a.serviceOptions.localIdeographFontFamily,preserveDrawingBuffer:a.styleOptions.preserveDrawingBuffer,refreshExpiredTiles:a.serviceOptions.refreshExpiredTiles,renderWorldCopies:a.styleOptions.renderWorldCopies,trackResize:!1,transformRequest:function(_,x){var C={url:_};return x==="Tile"||x==="Source"?(_.includes(Nn.legacyDomainPlaceHolder)&&a.insights&&a.insights.trackEvent({name:"TileLoad"}),a._substituteDomainLanguageViewAndSignInRequest(_,C)):x!=="Style"&&x!=="SpriteJSON"&&x!=="SpriteImage"&&x!=="Glyphs"||a.styles._transformStyleRequest(_,C),a.serviceOptions.transformRequest&&j5(C,a.serviceOptions.transformRequest(C.url,x)),C}},o=new wa.Map(i));try{a.map=o,a.authentication=new Mxe(a),a.controls=new Rxe(a),a.events=new Oxe(a),a.imageSprite=new Nxe(a),a.layers=new zxe(a),a.markers=new Lxe(a),a.sources=new Vxe(a),a.popups=new jxe(a),a.indicators=new EEe(a),a.map.getContainer().classList.add(e.Css.container),a.map.getCanvasContainer().classList.add(e.Css.canvasContainer),a.map.getCanvas().classList.add(e.Css.canvas),a._detectHighContrast(),a.copyrightControl=new W1e({showFeedbackLink:a.styleOptions.showFeedbackLink,showLogo:a.styleOptions.showLogo,customAttribution:a.styleOptions.customAttribution}),a.controls.add(a.copyrightControl,{position:xa.NonFixed}),a.logoControl=new Z1e({showLogo:a.styleOptions.showLogo}),a.controls.add(a.logoControl,{position:xa.BottomLeft});var h=a.authentication?a.authentication.initialize():Promise.resolve();if(a.removed)return a;var p=function(){a.loaded=!0,a.map.off("load",p)},g=(a.map.on("load",p),function(){a.ready=!0,a.map.off("styledata",g),a.events.invoke("ready",{map:a,type:"ready"})});a.map.on("styledata",g),a._setAutoResize(a.styleOptions.autoResize),a.map.showTileBoundaries=a.styleOptions.showTileBoundaries,a.localizedStringsPromise=z1.getStrings(a.styleOptions.language),h.then(function(){return a.styles.definitions()}).then(function(_){if(!a.removed){if(a.authentication&&!a.authentication.getToken())throw new Error("AuthenticationManager finished initializing, but no token is available");a.serviceOptions["enable-accessibility"]&&a.accessibleMapDelegate.addToMap(),a._setStyleComponents(a.styleOptions),a.copyrightDelegate&&a.copyrightDelegate.addToMap()}}).catch(function(_){_=_ instanceof Error?_:new Error(_),a.insights.trackException({error:_}),_={map:a,type:"error",error:_},a.events.invoke("error",_)}),a.setCamera(Tu(Tu({minZoom:1},r),{type:"jump",duration:0})),a.incidentDelegate=new swe(a),a.flowDelegate=new rwe(a),a.accessibleMapDelegate=new nwe(a),a.userInteractionDelegate=new hwe(a,r),a.userInteractionDelegate.addToMap(),a.copyrightDelegate=new xwe(a,a.copyrightControl,a.styleOptions)}catch(_){throw l=!1,a.insights.trackException({error:_ instanceof Error?_:new Error(_)}),_}finally{a.insights.trackEvent({name:"MapLoad"},{success:l,supported:SA(),supportedWithPerformance:SA({failIfMajorPerformanceCaveat:!0})}),a.insights.flush()}return a}return TEe(e,n),Object.defineProperty(e.prototype,"isDisposed",{get:function(){return this.removed},enumerable:!1,configurable:!0}),e.prototype.getCanvas=function(){return this.map.getCanvas()},e.prototype.getCanvasContainer=function(){return this.map.getCanvasContainer()},e.prototype.getMapContainer=function(){return this.map.getContainer()},e.prototype.getServiceOptions=function(){return Cr(this.serviceOptions,dR._cloneCustomizer)},e.prototype.setServiceOptions=function(t){this.serviceOptions=new dR().merge(this.serviceOptions,t),this.serviceOptions["enable-accessibility"]?this.accessibleMapDelegate.addToMap():this.accessibleMapDelegate.removeFromMap(),t=this.styles.serviceOptions.mapConfiguration!==this.serviceOptions.mapConfiguration||this.styles.serviceOptions.staticAssetsDomain!==this.serviceOptions.staticAssetsDomain||this.styles.serviceOptions.styleDefinitionsVersion!==this.serviceOptions.styleDefinitionsVersion||this.styles.serviceOptions.domain!==this.serviceOptions.domain||this.styles.serviceOptions.styleAPIVersion!==this.serviceOptions.styleAPIVersion,this.styles.serviceOptions=this.serviceOptions,t&&(this.styles.initPromise=null,this.setStyle({}))},e.prototype.addRequestTransformer=function(t){this.serviceOptions.addTransformer(t)},e.prototype.removeRequestTransformer=function(t){this.serviceOptions.removeTransformer(t)},e.prototype.setCamera=function(t,r){if(r===void 0&&(r=!1),"padding"in t||"offset"in t||"bounds"in t){var i,l=new Xxe().merge({maxZoom:this.getCamera().maxZoom},t),o=this._generateSafeBounds(l.bounds),h={padding:l.padding,offset:l.offset,maxZoom:l.maxZoom};if(!(i=this.map.cameraForBounds(o,h)))throw a={message:"The map cannot be fit to the current canvas with the given CameraBoundsOptions.",containerWidth:(a=(a=this.map)==null?void 0:a.getContainer())==null?void 0:a.clientWidth,containerHeight:a==null?void 0:a.clientHeight,safeBounds:o,cameraForBoundsOptions:h},new Error(JSON.stringify(a));"pitch"in t&&(i.pitch=t.pitch),"bearing"in t&&(i.bearing=t.bearing),"minPitch"in t&&this.map.setMinPitch(t.minPitch),"maxPitch"in t&&this.map.setMaxPitch(t.maxPitch),"minZoom"in t&&this.map.setMinZoom(t.minZoom),o=this._generateSafeBounds(l.maxBounds)}else h=new Jxe().merge(this.getCamera(),t),h.centerOffset&&2<=h.centerOffset.length&&(a=h.centerOffset,(l=N_([h.center],h.zoom))[0][0]+=a[0],l[0][1]+=a[1],h.center=o2(l,h.zoom)[0]),i={center:h.center,zoom:h.zoom,bearing:h.bearing,pitch:h.pitch,around:void 0},h.minZoom<1&&console.warn("Setting minZoom below 1 may result in an empty map when the zoom level is less than 1."),this.map.setMinZoom(h.minZoom),this.map.setMaxZoom(h.maxZoom),h.minPitch&&this.map.setMinPitch(h.minPitch),h.maxPitch&&this.map.setMaxPitch(h.maxPitch),this._invokeEvent("minzoomchanged",this.map.getMinZoom()),this._invokeEvent("maxzoomchanged",this.map.getMaxZoom()),o=this._generateSafeBounds(h.maxBounds);o?this.map.setMaxBounds(o):this.map.setMaxBounds(null);var a=new Gxe().merge(t),l={duration:a.duration,easing:function(p){return p},offset:[0,0],animate:!0},h={fromControl:r};a.type==="jump"?this.map.jumpTo(i,h):a.type==="ease"?this.map.easeTo(Tu(Tu({},i),l),h):a.type==="fly"&&this.map.flyTo(Tu(Tu({},i),l),h)},e.prototype.setCameraBounds=function(t){this.setCamera(t)},e.prototype.getCamera=function(){var t=this.map.getBounds().getSouthWest().toArray(),r=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 rr(t,r),minZoom:this.map.getMinZoom(),maxZoom:this.map.getMaxZoom(),maxBounds:(t=this.map.getMaxBounds())==null?void 0:t.toArray().flat()}},e.prototype.setStyle=function(t,r){r===void 0&&(r=!0),delete t.preserveDrawingBuffer,t=new x9().merge(this.styleOptions,t),t.autoResize!==this.styleOptions.autoResize&&this._setAutoResize(t.autoResize),t.language!==this.styleOptions.language&&(this.localizedStringsPromise=z1.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}),this.logoControl.setOptions({showLogo:t.showLogo})),t.showTileBoundaries!==this.styleOptions.showTileBoundaries&&(this.map.showTileBoundaries=t.showTileBoundaries),t.showBuildingModels&&console.warn("showBuildingModels is deprecated."),r=r&&this.styleOptions.language===t.language&&this.styleOptions.view===t.view,this.styleOptions=t,this._setStyleComponents(t,r)},e.prototype.getStyle=function(){return Zi(this.styleOptions)},e.prototype.addIcon=function(t,r){this.imageSprite.add(t,r)},e.prototype.addPins=function(t,i){var i=new aEe().merge(i),o=this.layers.getLayerById(i.name),a=!1;if(o||(a=!0,o=new lw("".concat(i.name,"-source"),i.name,{source:"".concat(i.name,"-source"),minZoom:i.minZoom,maxZoom:i.maxZoom,iconOptions:{anchor:"center",size:i.iconSize,image:["case",["has","icon"],["get","icon"],i.icon],ignorePlacement:!i.cluster,opacity:i.opacity},textOptions:{anchor:"center",textField:["case",["has","point_count"],["to-string",["get","point_count"]],["has","title"],["to-string",["get","title"]],i.title],font:["case",["has","point_count"],["literal",["StandardFontCondensed-Bold"]],["literal",[i.textFont]]],size:["case",["has","point_count"],20,i.fontSize],ignorePlacement:!i.cluster,opacity:i.opacity,offset:["case",["has","point_count"],["literal",[.5,-.45]],["literal",[i.textOffset[0]/16,i.textOffset[1]/16]]],color:i.fontColor}})),!(o instanceof lw))throw new Error("A layer with name '".concat(i.name,"' already exists but it is not a SymbolLayer.")+"A SymbolLayer should be used for rendering pins.");var l=o.getSource(),h=(typeof l=="string"?(p=l,l=this.sources.getById(p)):p=l.getId(),!1);if(l||(h=!0,l=new Es(p,{cluster:i.cluster})),!(l instanceof Es))throw new Error("The source with name '".concat(p,"' already exists but it is not a DataSource.")+"New data can only be added to a DataSource.");h&&this.sources.add(l),a&&this.layers.add(o,i.before);var p=new Yd(t);i.overwrite?l.setShapes(p):l.add(p)},e.prototype.addCircles=function(t,i){var i=new nEe().merge(i),o=this.layers.getLayerById(i.name),a=!1;if(o||(a=!0,o=new h2("".concat(i.name,"-source"),i.name,{source:"".concat(i.name,"-source"),minZoom:i.minZoom,maxZoom:i.maxZoom,opacity:i.opacity,radius:["case",["has","radius"],["get","radius"],i.radius],color:["case",["has","color"],["get","color"],i.color],strokeColor:["case",["has","outlineColor"],["get","outlineColor"],i.outlineColor],strokeWidth:["case",["has","outlineWidth"],["get","outlineWidth"],i.outlineWidth]})),!(o instanceof h2))throw new Error("A layer with name '".concat(i.name,"' already exists but it is not a BubbleLayer.")+"A BubbleLayer should be used for rendering circles.");var l=o.getSource(),h=(typeof l=="string"?(p=l,l=this.sources.getById(p)):p=l.getId(),!1);if(l||(h=!0,l=new Es(p)),!(l instanceof Es))throw new Error("The source with name '".concat(p,"' already exists but it is not a DataSource.")+"New data can only be added to a DataSource.");h&&this.sources.add(l),a&&this.layers.add(o,i.before);var p=new Yd(t);i.overwrite?l.setShapes(p):l.add(p)},e.prototype.addLinestrings=function(t,i){var i=new iEe().merge(i),o=this.layers.getLayerById(i.name),a=!1;if(o||(a=!0,o=new d2("".concat(i.name,"-source"),i.name,{source:"".concat(i.name,"-source"),minZoom:i.minZoom,maxZoom:i.maxZoom,lineCap:i.cap,lineJoin:i.join,strokeOpacity:i.opacity,strokeColor:["case",["has","color"],["get","color"],i.color],strokeWidth:["case",["has","width"],["get","width"],i.width]})),!(o instanceof d2))throw new Error("A layer with name '".concat(i.name,"' already exists but it is not a LineLayer.")+"A LineLayer should be used for rendering linestrings.");var l=o.getSource(),h=(typeof l=="string"?(p=l,l=this.sources.getById(p)):p=l.getId(),!1);if(l||(h=!0,l=new Es(p)),!(l instanceof Es))throw new Error("The source with name '".concat(p,"' already exists but it is not a DataSource.")+"New data can only be added to a DataSource.");h&&this.sources.add(l),a&&this.layers.add(o,i.before);var p=new Yd(t);i.overwrite?l.setShapes(p):l.add(p)},e.prototype.addPolygons=function(t,i){var i=new cEe().merge(i),o=this.layers.getLayerById(i.name),a=!1;if(o||(a=!0,o=new f2("".concat(i.name,"-source"),i.name,{source:"".concat(i.name,"-source"),minZoom:i.minZoom,maxZoom:i.maxZoom,fillOpacity:i.opacity,fillColor:["case",["has","color"],["get","color"],i.color]})),!(o instanceof f2))throw new Error("A layer with name '".concat(i.name,"' already exists but it is not a PolygonLayer.")+"A PolygonLayer should be used for rendering linestrings.");var l=o.getSource(),h=(typeof l=="string"?(p=l,l=this.sources.getById(p)):p=l.getId(),!1);if(l||(h=!0,l=new Es(p)),!(l instanceof Es))throw new Error("The source with name '".concat(p,"' already exists but it is not a DataSource.")+"New data can only be added to a DataSource.");h&&this.sources.add(l),a&&this.layers.add(o,i.before);var p=new Yd(t);i.overwrite?l.setShapes(p):l.add(p)},e.prototype.addRaster=function(t,o){var i,o=new uEe().merge(o),a=this.layers.getLayerById(o.name);if(!((a=a||new hw({maxZoom:o.maxZoom,minZoom:o.minZoom,opacity:o.opacity,tileSize:256,tileUrl:"{subdomain}"},o.name))instanceof hw))throw new Error("A layer with name '".concat(o.name,"' already exists but it is not a TileLayer.")+"A TileLayer should be used for rendering raster images.");if(a.getOptions().tileUrl!=="{subdomain}")throw new Error("A TileLayer with name '".concat(o.name,"' already exists but was configured ")+"for a single tile url [default for new TileLayer(...)].");(i=!o.overwrite&&a.getOptions().subdomains||[]).push.apply(i,IEe([],AEe(t),!1)),a._setOptionsNoUpdate({subdomains:i}),this.layers.add(a,o.before)},e.prototype.getLayers=function(){return this.layers.getLayers().map(function(t){return t.getId()})},e.prototype.removeLayers=function(t){var r,i;try{for(var o=BE(t),a=o.next();!a.done;a=o.next()){var l,h=a.value;this.layers.getLayerById(h)&&(this.layers.remove(h),l="".concat(h,"-source"),this.sources.getById(l))&&this.sources.remove(l)}}catch(p){r={error:p}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}},e.prototype.addHtml=function(t,r){t.id||(t.id="marker_".concat(Vd()));var i=new p2({htmlContent:t});return this.markers.add(i,r),t.id},e.prototype.removeHtml=function(t){this.markers.remove(t)},e.prototype.addEventListener=function(t,r,i){this.events._addLegacy(t,r,i)},e.prototype.removeEventListener=function(t,r,i){this.events._removeLegacy(t,r,i)},e.prototype.setUserInteraction=function(t){this.userInteractionDelegate.setOptions(t)},e.prototype.getUserInteraction=function(){return this.userInteractionDelegate.getOptions()},e.prototype.addControl=function(t,r){this.controls.add(t,r)},e.prototype.removeControl=function(t){this.controls.remove(t)},e.prototype.setTraffic=function(t){var r=this.trafficOptions.incidents,i=this.trafficOptions.flow;if(this.trafficOptions=new ew().merge(this.trafficOptions,t),this.controls.getControls().filter(function(o){return o instanceof V5}).forEach(function(o){return o.updateButtonState()}),this.incidentDelegate&&(this.trafficOptions.incidents?r||this.incidentDelegate.addToMap():this.incidentDelegate.removeFromMap()),this.trafficOptions.flow&&this.trafficOptions.flow!=="none"){["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!==i&&this.flowDelegate.addToMap()}catch(o){throw this.trafficOptions.flow=i,o}}else this.flowDelegate.removeFromMap()},e.prototype.getTraffic=function(){return Zi(this.trafficOptions)},e.prototype.remove=function(){this.dispose()},e.prototype.clear=function(){this.popups.clear(),this.layers.clear(),this.sources.clear(),this.markers.clear(),this.indicators.clear()},e.prototype.dispose=function(){var t;for(this.clear(),this.map.remove(),(t=this.authentication)!=null&&t.dispose(),this.removed=!0,(t=this.resizeObserver)!=null&&t.disconnect(),this.resizeObserver=null;this.getMapContainer().firstChild;){var r=this.getMapContainer().firstChild;this.getMapContainer().removeChild(r)}},e.prototype.resize=function(t,r,i){typeof t!="number"&&typeof t!="string"||typeof r!="number"&&typeof r!="string"?i=t:(t=t,this.getMapContainer().style.height=typeof t=="number"?"".concat(t,"px"):t,this.getMapContainer().style.width=typeof r=="number"?"".concat(r,"px"):r),t=this.getMapContainer().style.overflow,this.getMapContainer().style.overflow="hidden",this.map.resize(i),this.getMapContainer().style.overflow=t},e.prototype.pixelsToPositions=function(t){var r,i,o=[];try{for(var a=BE(t),l=a.next();!l.done;l=a.next()){var h=l.value,p=this.map.unproject(h);o.push(new $o(p.lng,p.lat))}}catch(g){r={error:g}}finally{try{l&&!l.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}return o},e.prototype.positionsToPixels=function(t){var r,i,o=[];try{for(var a=BE(t),l=a.next();!l.done;l=a.next()){var h=l.value,p=this.map.project(h);o.push(new Go(p.x,p.y))}}catch(g){r={error:g}}finally{try{l&&!l.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}return o},e.prototype.areTilesLoaded=function(){return this.map.areTilesLoaded()},e.prototype.stop=function(){this.map.stop()},e.prototype.triggerRepaint=function(){this.map.triggerRepaint()},e.prototype.enableElevation=function(t,r){this.map.setTerrain(typeof t=="string"?{source:t,exaggeration:r}:{source:t.getId(),exaggeration:r})},e.prototype.disableElevation=function(){this.map.setTerrain(null)},e.prototype._getMap=function(){return this.map},e.prototype._rebuildStyle=function(t){return t===void 0&&(t=!0),SEe(this,void 0,void 0,function(){return CEe(this,function(r){return this.styles.setStyle(this.styleOptions,t),this.imageSprite._restoreImages(),[2]})})},e.prototype._isLoaded=function(){return this.loaded},e.prototype._isReady=function(){return this.ready},e.prototype._getLocalizedStrings=function(){return this.localizedStringsPromise},e.prototype._sendRequest=function(t,r,i){var o;return(o=typeof this.serviceOptions.transformRequest=="function"?this.serviceOptions.transformRequest(t,r):o)?fetch(o.url||t,{credentials:o.credentials,headers:Tu(Tu({},i),o.headers),method:"GET",mode:"cors"}):fetch(t,{headers:i,method:"GET",mode:"cors"})},e.prototype._substituteDomainLanguageViewAndSignInRequest=function(t,r){var i;(t.includes(Nn.legacyDomainPlaceHolder)||t.includes(Nn.domainPlaceHolder))&&(i=new RegExp("[^{]".concat(Nn.legacyDomainPlaceHolder,"[^}]")),t.match(i)&&(r.url=r.url.replace(Nn.legacyDomainPlaceHolder,Nn.domainPlaceHolder)),Zc.protoRegEx.test(this.serviceOptions.domain)?(i=r.url.indexOf(Nn.domainPlaceHolder),r.url=this.serviceOptions.domain+r.url.substring(i+Nn.domainPlaceHolder.length)):r.url=r.url.replace(Nn.domainPlaceHolder,this.serviceOptions.domain)),(r.url.toLocaleLowerCase().includes(this.serviceOptions.domain.toLocaleLowerCase())||r.url.toLocaleLowerCase().includes(this.serviceOptions.staticAssetsDomain.toLocaleLowerCase()))&&(i=this.authentication)!=null&&i.signRequest(r),t.includes(Nn.languagePlaceHolder)&&(r.url=r.url.replace(Nn.languagePlaceHolder,this.styleOptions.language)),t.includes(Nn.viewPlaceHolder)&&(r.url=this.styleOptions.view?r.url.replace(Nn.viewPlaceHolder,this.styleOptions.view):r.url.replace(Nn.viewPlaceHolder,"").replace("&".concat(Nn.viewParameter,"="),""))},e.prototype._setAutoResize=function(t){t?(this.resizeObserver||(this.resizeObserver=new ResizeObserver(this._resizeCallback)),this.resizeObserver.observe(this.map.getContainer())):this.resizeObserver&&this.resizeObserver.unobserve(this.map.getContainer())},e.prototype._setStyleComponents=function(t,r){var i=this;r===void 0&&(r=!0),this.removed||this.styles.definitions().then(function(o){var a,l,h=!0;if(i.styleOptions.style)try{for(var p=BE(o.configurations),g=p.next();!g.done;g=p.next()){var _=g.value;if(i.styleOptions.style===_.name){h=!1;break}}}catch(x){a={error:x}}finally{try{g&&!g.done&&(l=p.return)&&l.call(p)}finally{if(a)throw a.error}}h&&(i.styleOptions.style=o.defaultConfiguration),i.styleOptions=t,i._rebuildStyle(r)})},e.prototype._updateGlobalDefaults=function(t){t&&(t.authOptions&&!RA()&&_F(t.authOptions),t.domain&&!IF()&&vF(t.domain),t.styleDefinitionsPath&&!PF()&&bF(t.styleDefinitionsPath),t.workerCount&&!MF()&&wF(t.workerCount),t.maxParallelImageRequests&&!RF()&&xF(t.maxParallelImageRequests),!t.subscriptionKey&&!t["subscription-key"]||RA()||SF(t.subscriptionKey||t["subscription-key"]),!t.sessionId&&!t["session-id"]||OF()||TF(t.sessionId||t["session-id"]),t.language&&!kF()&&EF(t.language),!t.userRegion&&!t.view||LF()||CF(t.userRegion||t.view))},e.prototype._generateSafeBounds=function(t){if(t){var r=rr.getSouth(t),i=rr.getWest(t),o=rr.getNorth(t),a=rr.getEast(t);if(!(isFinite(r)&&isFinite(i)&&isFinite(o)&&isFinite(a)))throw new Error("The bounds specified are invalid: [".concat(t,"]"));for(;a)/)),p=Math.max.apply(Math,MEe([],PEe(g.map(function(x){return x.replace(/<[a-zA-Z0-9\s=\/]+>/g,"").length})),!1))-1,h=Math.ceil(3.5*p),p=(h/g,"").length/_)*h)),r.width=a+"px",r.height=o||280'+'')+"")+'
').concat(i,"
");return r.srcdoc===void 0?r.src="data:text/html;charset=utf-8,"+encodeURI(_):r.srcdoc=_,r},n._appendChild=function(e,t,r){t&&(r&&(t.className=(t.className?t.className+" ":"")+r),e.appendChild(t))},n._generateContent=function(e,t,r){return t?Array.isArray(t)?this._generatePropertyInfoTable(e,t,r):this._applyStringTemplate(e,t,r):(t=this._generateDynamicTableHtml(e,null,r))?((e=document.createElement("div")).innerHTML=t,e):null},n._applyStringTemplate=function(e,t,r){if(t){for(var i,o,a=t,l=this._placeholderRx.exec(t);l;)2<=l.length&&(i=this._getPropertyValue(e,l[1],r),a=a.replace(l[0],i)),l=this._placeholderRx.exec(t);if(a)return(a=a.trim()).includes("<")&&(a=a.replace(/[\r\n]+/g,"
")),(o=document.createElement("div")).innerHTML=a,o}return null},n._getPropertyValue=function(e,t,r,i){var o=r.parsePropertyPaths?t.split("/"):[t],a=o.length;if(0'),z.title?_.push(z.title):p&&p.label?_.push(p.label):_.push(z.href),_.push("","
")}),_.pop(),_.join("")}if(h!=null){for(var C=void 0,C=1;C\s]/g.test(e)&&(r.detectHyperlinks||i&&i.hyperlinkFormat)){var M,e=e.trim(),t=this._isUrlRx.test(e)||i&&i.hyperlinkFormat,L=this._isImageUrlRx.test(e)&&(t||e.startsWith("data:image")),F=this._emailRx.test(e);if(t||L||F)return t=void 0,M=void(i&&i.hyperlinkFormat?t=i.hyperlinkFormat:r&&r.hyperlinkFormat&&(t=r.hyperlinkFormat)),M=t&&t.target?' target="'.concat(t.target,'"'):' target="_blank"',i="".concat(t&&t.label?t.label:e),t&&t.scheme?e=t.scheme+e:F&&(e="mailto:"+e),r=t&&t.label?' alt="'.concat(t.label,'"'):"",(t&&t.isImage||L)&&(i='')),'").concat(i,"")}return e.toString()}}}return""},n._generatePropertyInfoTable=function(e,t,r){var i,o;return e&&t&&0')),t.forEach(function(a){var l=o._getPropertyValue(e,a.propertyPath,r,a);a.hideLabel?i.push('',l,""):(a=a.label||a.propertyPath.split("/")[0],i.push("",a,"",l,""))}),i.push(""),(t=document.createElement("div")).innerHTML=i.join(""),t):null},n._generateDynamicTableHtml=function(e,t,r){var i,o,a,l,h=this;return!e||((i=[]).push('')),a=t&&0"),l++)}),l===0)?null:(i.push("
",p,"",o._getPropertyValue(e,a+p,r),"
"),i.join(""))},n._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(e.indexOf("_")===0||t==null||t==="")return!0}return!1},n._placeholderRx=/\{([a-zA-Z0-9_\/\s]+)\}/gi,n._isUrlRx=/^(http|https|ftp|tel|mailto):\/\//i,n._isImageUrlRx=/(^data:image|.png$|.jpg$|.jpeg$|.gif$|.bmp$|.svg|.tif|.tiff$)/i,n._emailRx=/^[^\.\s@:](?:[^\s@:]*[^\s@:\.])?@[^\.\s@]+(?:\.[^\.\s@]+)*$/,n._cssUrl=new Zc({domain:yc.staticAssetsDomain,path:"sdk/javascript/mapcontrol/".concat(j1.getEndpointVersion(),"/atlas.min.css")}).toString(),n.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"},n}(),C9=(NF(),Object.freeze({__proto__:null,get AuthenticationType(){return ri},get ControlPosition(){return xa},get ControlStyle(){return Ro},HtmlMarker:p2,Map:S9,Pixel:Go,Popup:pw,PopupTemplate:REe,Shape:Ci,_enableRTLTextPlugin:NF,_getAssetDomain:Jie,_getDomain:eoe,_hasMaxParallelImageRequests:RF,_hasSetAuthenticationOptions:RA,_hasSetDomain:IF,_hasSetLanguage:kF,_hasSetSessionId:OF,_hasSetStyleDefinitionsPath:PF,_hasSetStyleDefinitionsVersion:Qie,_hasSetView:LF,_hasWorkerCount:MF,addImageTemplate:$ie,addProtocol:Zie,clearPrewarmedResources:Kie,control:Jge,data:Nge,getAllImageTemplateNames:Wie,getAuthenticationOptions:sF,getDomain:MA,getImageTemplate:AF,getLanguage:pF,getMaxParallelImageRequests:fF,getSessionId:gF,getStaticAssetsDomain:cF,getStyleAPIVersion:hF,getStyleDefinitionsPath:lF,getStyleDefinitionsVersion:uF,getSubscriptionKey:mF,getUserRegion:zie,getVersion:jie,getView:yF,getWorkerCount:dF,internal:ioe,isSupported:Vie,layer:eye,math:Gge,prewarm:Yie,removeProtocol:Xie,setAuthenticationOptions:_F,setDomain:vF,setLanguage:EF,setMaxParallelImageRequests:xF,setSessionId:TF,setStyleAPIVersion:Gie,setStyleDefinitionsPath:bF,setStyleDefinitionsVersion:Hie,setSubscriptionKey:SF,setUserRegion:CF,setView:qie,setWorkerCount:wF,source:bme}));let A9,mR,I9,A0;function kEe(){OEe().then(n=>{({locations:mR,flows:I9}=n);const[e,t]=[globalThis.innerWidth,globalThis.innerHeight],r=F4(mR,a=>[a.lon,a.lat],[e,t],{pad:.3});A0=new C9.Map("myMap",{style:"grayscale_dark",interactive:!1,center:[r.longitude,r.latitude],zoom:r.zoom,bearing:r.bearing,pitch:r.pitch,authOptions:{authType:"sas",getToken:function(a,l,h){var p="https://samples.azuremaps.com/api/GetAzureMapsSasToken";fetch(p).then(g=>g.text()).then(g=>a(g))}}}),A0.events.add("ready",()=>{A0.controls.add(new C9.control.StyleControl({mapStyles:["road","grayscale_light","grayscale_dark","night","satellite"]}),{position:"top-right"})}),A9=new sC({canvas:"deck-canvas",width:"100%",height:"100%",initialViewState:r,controller:!0,map:!0,onViewStateChange:({viewState:a})=>{A0.setCamera({center:[a.longitude,a.latitude],zoom:a.zoom,bearing:a.bearing,pitch:a.pitch})},layers:[]}),yR(),document.querySelectorAll(".control").forEach(a=>{a.onchange=yR}),document.getElementById("darkMode").onchange=LEe;const i=document.getElementById("deck-canvas"),o=document.getElementById("myMap");o.insertBefore(i,o.querySelector(".atlas-control-container"))})}async function OEe(){const[n,e]=await Promise.all([V4("/data/flowmap/locations.csv",t=>({id:t.id,name:t.name,lat:+t.lat,lon:+t.lon})),V4("/data/flowmap/flows.csv",t=>({origin:t.origin,dest:t.dest,count:+t.count}))]);return{locations:n,flows:e}}function yR(){A9.setProps({layers:[new B4({id:"my-flowmap-layer",data:{locations:mR,flows:I9},pickable:!0,darkMode:I0("darkMode"),colorScheme:FEe("colorScheme"),clusteringEnabled:I0("clusteringEnabled"),getLocationId:n=>n.id,getLocationLat:n=>n.lat,getLocationLon:n=>n.lon,getFlowOriginId:n=>n.origin,getFlowDestId:n=>n.dest,getFlowMagnitude:n=>n.count,getLocationName:n=>n.name,onHover:n=>NEe(DEe(n))})]})}function LEe(){A0.setStyle({style:I0("darkMode")?"grayscale_dark":"grayscale_light"}),document.getElementById("deck-canvas").style.mixBlendMode=I0("darkMode")?"screen":"darken",document.getElementById("container").style.backgroundColor=I0("darkMode")?"#000":"#fff",yR()}function NEe(n){const e=document.getElementById("tooltip");if(!n){e.style.display="none";return}e.style.left=`${n.position.left}px`,e.style.top=`${n.position.top}px`,e.innerHTML=n.content,e.style.display="block"}function DEe(n){if(!n)return;const{x:e,y:t,object:r}=n,i={left:e,top:t};switch(r==null?void 0:r.type){case cg.LOCATION:const o=document.createElement("b");o.innerText=r.name.replaceAll('"',"");const a=document.createElement("li");a.innerText=`Incoming trips: ${r.totals.incomingCount}`;const l=document.createElement("li");l.innerText=`Outgoing trips: ${r.totals.outgoingCount}`;const h=document.createElement("li");return h.innerText=`Internal or round trips: ${r.totals.internalCount}`,{position:i,content:[o,a,l,h].map(x=>x.outerHTML).join("")};case cg.FLOW:const p=document.createElement("b");p.innerText="Route Info";const g=document.createElement("li");g.innerText=`Bike Station: ${r.origin.id.slice(2,-2)} → ${r.dest.id.slice(2,-2)}`;const _=document.createElement("li");return _.innerText=`Trips Count: ${r.count}`,{position:i,content:[p,g,_].map(x=>x.outerHTML).join("")}}}function FEe(n){var e=document.getElementById(n);return e.options[e.selectedIndex].value}function I0(n){return document.getElementById(n).checked}document.body.onload=kEe}); diff --git a/Samples/3D-layer/Flowmap.gl/vite.config.js b/Samples/3D-layer/Flowmap.gl/vite.config.js index f851dfd4..55b703ed 100644 --- a/Samples/3D-layer/Flowmap.gl/vite.config.js +++ b/Samples/3D-layer/Flowmap.gl/vite.config.js @@ -1,11 +1,12 @@ -import { defineConfig } from 'vite' +import { defineConfig } from "vite"; export default defineConfig({ build: { lib: { - entry: 'src/Flowmap.gl.js', - name: 'FlowmapGL', - fileName: () => 'Flowmapgl.bundle.js' + entry: "src/Flowmap.gl.js", + name: "FlowmapGL", + fileName: () => "Flowmapgl.bundle.js", }, }, -}) + define: { "process.env": {} }, +});