From 0c7097957abdd12be5def88b00346290166b3de2 Mon Sep 17 00:00:00 2001 From: Josh Reisner <1551689+joshreisner@users.noreply.github.com> Date: Mon, 10 Oct 2022 08:07:42 -0700 Subject: [PATCH] Typescript Conversions (#262) converts all JS except loadMeetingData to TS --- index.d.ts | 10 +- package-lock.json | 24 ++- package.json | 3 +- public/app.js | 2 +- src/app.tsx | 8 +- src/components/Alert.tsx | 2 +- src/components/Controls.tsx | 178 +++++++++--------- src/components/{Dropdown.jsx => Dropdown.tsx} | 50 ++++- src/components/{Link.jsx => Link.tsx} | 22 ++- src/components/{Map.jsx => Map.tsx} | 81 ++++++-- src/components/Meeting.spec.tsx | 30 ++- src/components/{Meeting.jsx => Meeting.tsx} | 105 +++++++---- .../{Table.spec.jsx => Table.spec.tsx} | 64 +++++-- src/components/{Table.jsx => Table.tsx} | 134 +++++++------ src/components/{Title.jsx => Title.tsx} | 27 ++- src/components/{TsmlUI.jsx => TsmlUI.tsx} | 48 +++-- src/helpers/data/calculate-distances.js | 62 ------ src/helpers/data/calculate-distances.ts | 99 ++++++++++ src/helpers/{ => data}/distance.spec.ts | 43 +++-- ...meeting-data.js => filter-meeting-data.ts} | 53 +++--- ...indexes.js => flatten-and-sort-indexes.ts} | 7 +- ...et-index-by-key.js => get-index-by-key.ts} | 7 +- src/helpers/data/load-meeting-data.js | 2 +- ...gle-sheet.js => translate-google-sheet.ts} | 16 +- src/helpers/distance.ts | 32 ---- .../format/format-conference-provider.spec.ts | 4 +- .../format/format-conference-provider.ts | 6 +- src/helpers/format/format-directions-url.ts | 7 +- src/helpers/index.ts | 1 - src/helpers/query-string.ts | 8 +- src/helpers/settings.ts | 3 +- src/types/JSONData.ts | 50 +++++ src/types/Meeting.ts | 7 +- src/types/State.ts | 5 + src/types/index.ts | 1 + 35 files changed, 777 insertions(+), 424 deletions(-) rename src/components/{Dropdown.jsx => Dropdown.tsx} (70%) rename src/components/{Link.jsx => Link.tsx} (65%) rename src/components/{Map.jsx => Map.tsx} (79%) rename src/components/{Meeting.jsx => Meeting.tsx} (85%) rename src/components/{Table.spec.jsx => Table.spec.tsx} (79%) rename src/components/{Table.jsx => Table.tsx} (63%) rename src/components/{Title.jsx => Title.tsx} (59%) rename src/components/{TsmlUI.jsx => TsmlUI.tsx} (89%) delete mode 100644 src/helpers/data/calculate-distances.js create mode 100644 src/helpers/data/calculate-distances.ts rename src/helpers/{ => data}/distance.spec.ts (56%) rename src/helpers/data/{filter-meeting-data.js => filter-meeting-data.ts} (83%) rename src/helpers/data/{flatten-and-sort-indexes.js => flatten-and-sort-indexes.ts} (63%) rename src/helpers/data/{get-index-by-key.js => get-index-by-key.ts} (63%) rename src/helpers/data/{translate-google-sheet.js => translate-google-sheet.ts} (81%) delete mode 100644 src/helpers/distance.ts create mode 100644 src/types/JSONData.ts diff --git a/index.d.ts b/index.d.ts index dc95ba95..8dbf184e 100644 --- a/index.d.ts +++ b/index.d.ts @@ -10,7 +10,7 @@ interface TSMLReactConfig { conference_providers: Record; defaults: { distance: string[]; - meeting: string | null; + meeting?: string; mode: 'search' | 'location' | 'me'; region: string[]; search: string; @@ -18,11 +18,10 @@ interface TSMLReactConfig { type: MeetingType[]; view: 'table' | 'map'; weekday: TSMLReactConfig['weekdays']; - duration: number; }; distance_options: number[]; distance_unit: 'mi' | 'km'; - /** Email addresses for update meeting info button */ + duration: number; feedback_emails: string[]; filters: Array<'region' | 'distance' | 'weekday' | 'time' | 'type'>; flags: Array<'M' | 'W'> | undefined | null; @@ -39,16 +38,11 @@ interface TSMLReactConfig { }; style: string; }; - /** What meetings to show based off a past start time in minutes */ now_offset: number; - /** Input other than filters */ params: Array<'search' | 'mode' | 'view' | 'meeting'>; show: { - /** Whether to show search + dropdowns + list/map */ controls: boolean; - /** Show conference buttons in list or show labels */ listButtons: boolean; - /** Whether to display the title h1 */ title: boolean; }; strings: { diff --git a/package-lock.json b/package-lock.json index 38342cde..5fe5ce04 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "tsml-ui", - "version": "1.4.6", + "version": "1.4.7", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "tsml-ui", - "version": "1.4.6", + "version": "1.4.7", "hasInstallScript": true, "license": "MIT", "dependencies": { @@ -29,6 +29,7 @@ "@types/luxon": "^3.0.1", "@types/react": "^17.0.38", "@types/react-dom": "^17.0.11", + "@types/react-infinite-scroller": "^1.2.3", "@types/react-test-renderer": "^17.0.1", "autoprefixer": "10.4.5", "jest": "^27.4.7", @@ -3035,6 +3036,16 @@ "@types/react": "*" } }, + "node_modules/@types/react-infinite-scroller": { + "version": "1.2.3", + "resolved": "https://packages.atlassian.com/api/npm/npm-remote/@types/react-infinite-scroller/-/react-infinite-scroller-1.2.3.tgz", + "integrity": "sha512-l60JckVoO+dxmKW2eEG7jbliEpITsTJvRPTe97GazjF5+ylagAuyYdXl8YY9DQsTP9QjhqGKZROknzgscGJy0A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/react": "*" + } + }, "node_modules/@types/react-test-renderer": { "version": "17.0.1", "resolved": "https://registry.npmjs.org/@types/react-test-renderer/-/react-test-renderer-17.0.1.tgz", @@ -15618,6 +15629,15 @@ "@types/react": "*" } }, + "@types/react-infinite-scroller": { + "version": "1.2.3", + "resolved": "https://packages.atlassian.com/api/npm/npm-remote/@types/react-infinite-scroller/-/react-infinite-scroller-1.2.3.tgz", + "integrity": "sha512-l60JckVoO+dxmKW2eEG7jbliEpITsTJvRPTe97GazjF5+ylagAuyYdXl8YY9DQsTP9QjhqGKZROknzgscGJy0A==", + "dev": true, + "requires": { + "@types/react": "*" + } + }, "@types/react-test-renderer": { "version": "17.0.1", "resolved": "https://registry.npmjs.org/@types/react-test-renderer/-/react-test-renderer-17.0.1.tgz", diff --git a/package.json b/package.json index a949b016..f7fd453f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "tsml-ui", - "version": "1.4.6", + "version": "1.4.7", "private": false, "license": "MIT", "scripts": { @@ -21,6 +21,7 @@ "@types/luxon": "^3.0.1", "@types/react": "^17.0.38", "@types/react-dom": "^17.0.11", + "@types/react-infinite-scroller": "^1.2.3", "@types/react-test-renderer": "^17.0.1", "autoprefixer": "10.4.5", "jest": "^27.4.7", diff --git a/public/app.js b/public/app.js index ba3e40cc..e26fc6b7 100644 --- a/public/app.js +++ b/public/app.js @@ -1,2 +1,2 @@ /*! For license information please see app.js.LICENSE.txt */ -(()=>{var t,e={474:(t,e,i)=>{"use strict";var n=i(935),r=i(294);function o(...t){return Object.values(t).map((t=>"string"==typeof t?t:Array.isArray(t)?t.join(" "):"object"==typeof t?Object.keys(t).filter((e=>!!t[e])).join(" "):null)).filter((t=>t)).join(" ")}var a=i(996),s=i.n(a);class l extends Error{}class c extends l{constructor(t){super(`Invalid DateTime: ${t.toMessage()}`)}}class u extends l{constructor(t){super(`Invalid Interval: ${t.toMessage()}`)}}class d extends l{constructor(t){super(`Invalid Duration: ${t.toMessage()}`)}}class h extends l{}class p extends l{constructor(t){super(`Invalid unit ${t}`)}}class m extends l{}class f extends l{constructor(){super("Zone is an abstract class")}}const g="numeric",v="short",y="long",_={year:g,month:g,day:g},x={year:g,month:v,day:g},b={year:g,month:v,day:g,weekday:v},w={year:g,month:y,day:g},k={year:g,month:y,day:g,weekday:y},E={hour:g,minute:g},T={hour:g,minute:g,second:g},S={hour:g,minute:g,second:g,timeZoneName:v},C={hour:g,minute:g,second:g,timeZoneName:y},M={hour:g,minute:g,hourCycle:"h23"},z={hour:g,minute:g,second:g,hourCycle:"h23"},I={hour:g,minute:g,second:g,hourCycle:"h23",timeZoneName:v},P={hour:g,minute:g,second:g,hourCycle:"h23",timeZoneName:y},A={year:g,month:g,day:g,hour:g,minute:g},D={year:g,month:g,day:g,hour:g,minute:g,second:g},O={year:g,month:v,day:g,hour:g,minute:g},L={year:g,month:v,day:g,hour:g,minute:g,second:g},R={year:g,month:v,day:g,weekday:v,hour:g,minute:g},B={year:g,month:y,day:g,hour:g,minute:g,timeZoneName:v},F={year:g,month:y,day:g,hour:g,minute:g,second:g,timeZoneName:v},j={year:g,month:y,day:g,weekday:y,hour:g,minute:g,timeZoneName:y},N={year:g,month:y,day:g,weekday:y,hour:g,minute:g,second:g,timeZoneName:y};function V(t){return void 0===t}function U(t){return"number"==typeof t}function Z(t){return"number"==typeof t&&t%1==0}function $(){try{return"undefined"!=typeof Intl&&!!Intl.RelativeTimeFormat}catch(t){return!1}}function G(t,e,i){if(0!==t.length)return t.reduce(((t,n)=>{const r=[e(n),n];return t&&i(t[0],r[0])===t[0]?t:r}),null)[1]}function q(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function W(t,e,i){return Z(t)&&t>=e&&t<=i}function H(t,e=2){let i;return i=t<0?"-"+(""+-t).padStart(e,"0"):(""+t).padStart(e,"0"),i}function X(t){return V(t)||null===t||""===t?void 0:parseInt(t,10)}function Y(t){return V(t)||null===t||""===t?void 0:parseFloat(t)}function K(t){if(!V(t)&&null!==t&&""!==t){const e=1e3*parseFloat("0."+t);return Math.floor(e)}}function J(t,e,i=!1){const n=10**e;return(i?Math.trunc:Math.round)(t*n)/n}function Q(t){return t%4==0&&(t%100!=0||t%400==0)}function tt(t){return Q(t)?366:365}function et(t,e){const i=function(t,e){return t-e*Math.floor(t/e)}(e-1,12)+1;return 2===i?Q(t+(e-i)/12)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][i-1]}function it(t){let e=Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,t.second,t.millisecond);return t.year<100&&t.year>=0&&(e=new Date(e),e.setUTCFullYear(e.getUTCFullYear()-1900)),+e}function nt(t){const e=(t+Math.floor(t/4)-Math.floor(t/100)+Math.floor(t/400))%7,i=t-1,n=(i+Math.floor(i/4)-Math.floor(i/100)+Math.floor(i/400))%7;return 4===e||3===n?53:52}function rt(t){return t>99?t:t>60?1900+t:2e3+t}function ot(t,e,i,n=null){const r=new Date(t),o={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};n&&(o.timeZone=n);const a={timeZoneName:e,...o},s=new Intl.DateTimeFormat(i,a).formatToParts(r).find((t=>"timezonename"===t.type.toLowerCase()));return s?s.value:null}function at(t,e){let i=parseInt(t,10);Number.isNaN(i)&&(i=0);const n=parseInt(e,10)||0;return 60*i+(i<0||Object.is(i,-0)?-n:n)}function st(t){const e=Number(t);if("boolean"==typeof t||""===t||Number.isNaN(e))throw new m(`Invalid unit value ${t}`);return e}function lt(t,e){const i={};for(const n in t)if(q(t,n)){const r=t[n];if(null==r)continue;i[e(n)]=st(r)}return i}function ct(t,e){const i=Math.trunc(Math.abs(t/60)),n=Math.trunc(Math.abs(t%60)),r=t>=0?"+":"-";switch(e){case"short":return`${r}${H(i,2)}:${H(n,2)}`;case"narrow":return`${r}${i}${n>0?`:${n}`:""}`;case"techie":return`${r}${H(i,2)}${H(n,2)}`;default:throw new RangeError(`Value format ${e} is out of range for property format`)}}function ut(t){return function(t,e){return e.reduce(((e,i)=>(e[i]=t[i],e)),{})}(t,["hour","minute","second","millisecond"])}const dt=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;const ht=["January","February","March","April","May","June","July","August","September","October","November","December"],pt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],mt=["J","F","M","A","M","J","J","A","S","O","N","D"];function ft(t){switch(t){case"narrow":return[...mt];case"short":return[...pt];case"long":return[...ht];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const gt=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],vt=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],yt=["M","T","W","T","F","S","S"];function _t(t){switch(t){case"narrow":return[...yt];case"short":return[...vt];case"long":return[...gt];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const xt=["AM","PM"],bt=["Before Christ","Anno Domini"],wt=["BC","AD"],kt=["B","A"];function Et(t){switch(t){case"narrow":return[...kt];case"short":return[...wt];case"long":return[...bt];default:return null}}function Tt(t,e){let i="";for(const n of t)n.literal?i+=n.val:i+=e(n.val);return i}const St={D:_,DD:x,DDD:w,DDDD:k,t:E,tt:T,ttt:S,tttt:C,T:M,TT:z,TTT:I,TTTT:P,f:A,ff:O,fff:B,ffff:j,F:D,FF:L,FFF:F,FFFF:N};class Ct{static create(t,e={}){return new Ct(t,e)}static parseFormat(t){let e=null,i="",n=!1;const r=[];for(let o=0;o0&&r.push({literal:n,val:i}),e=null,i="",n=!n):n||a===e?i+=a:(i.length>0&&r.push({literal:!1,val:i}),i=a,e=a)}return i.length>0&&r.push({literal:n,val:i}),r}static macroTokenToFormatOpts(t){return St[t]}constructor(t,e){this.opts=e,this.loc=t,this.systemLoc=null}formatWithSystemDefault(t,e){null===this.systemLoc&&(this.systemLoc=this.loc.redefaultToSystem());return this.systemLoc.dtFormatter(t,{...this.opts,...e}).format()}formatDateTime(t,e={}){return this.loc.dtFormatter(t,{...this.opts,...e}).format()}formatDateTimeParts(t,e={}){return this.loc.dtFormatter(t,{...this.opts,...e}).formatToParts()}resolvedOptions(t,e={}){return this.loc.dtFormatter(t,{...this.opts,...e}).resolvedOptions()}num(t,e=0){if(this.opts.forceSimple)return H(t,e);const i={...this.opts};return e>0&&(i.padTo=e),this.loc.numberFormatter(i).format(t)}formatDateTimeFromString(t,e){const i="en"===this.loc.listingMode(),n=this.loc.outputCalendar&&"gregory"!==this.loc.outputCalendar,r=(e,i)=>this.loc.extract(t,e,i),o=e=>t.isOffsetFixed&&0===t.offset&&e.allowZ?"Z":t.isValid?t.zone.formatOffset(t.ts,e.format):"",a=()=>i?function(t){return xt[t.hour<12?0:1]}(t):r({hour:"numeric",hourCycle:"h12"},"dayperiod"),s=(e,n)=>i?function(t,e){return ft(e)[t.month-1]}(t,e):r(n?{month:e}:{month:e,day:"numeric"},"month"),l=(e,n)=>i?function(t,e){return _t(e)[t.weekday-1]}(t,e):r(n?{weekday:e}:{weekday:e,month:"long",day:"numeric"},"weekday"),c=e=>{const i=Ct.macroTokenToFormatOpts(e);return i?this.formatWithSystemDefault(t,i):e},u=e=>i?function(t,e){return Et(e)[t.year<0?0:1]}(t,e):r({era:e},"era");return Tt(Ct.parseFormat(e),(e=>{switch(e){case"S":return this.num(t.millisecond);case"u":case"SSS":return this.num(t.millisecond,3);case"s":return this.num(t.second);case"ss":return this.num(t.second,2);case"uu":return this.num(Math.floor(t.millisecond/10),2);case"uuu":return this.num(Math.floor(t.millisecond/100));case"m":return this.num(t.minute);case"mm":return this.num(t.minute,2);case"h":return this.num(t.hour%12==0?12:t.hour%12);case"hh":return this.num(t.hour%12==0?12:t.hour%12,2);case"H":return this.num(t.hour);case"HH":return this.num(t.hour,2);case"Z":return o({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return o({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return o({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return t.zone.offsetName(t.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return t.zone.offsetName(t.ts,{format:"long",locale:this.loc.locale});case"z":return t.zoneName;case"a":return a();case"d":return n?r({day:"numeric"},"day"):this.num(t.day);case"dd":return n?r({day:"2-digit"},"day"):this.num(t.day,2);case"c":case"E":return this.num(t.weekday);case"ccc":return l("short",!0);case"cccc":return l("long",!0);case"ccccc":return l("narrow",!0);case"EEE":return l("short",!1);case"EEEE":return l("long",!1);case"EEEEE":return l("narrow",!1);case"L":return n?r({month:"numeric",day:"numeric"},"month"):this.num(t.month);case"LL":return n?r({month:"2-digit",day:"numeric"},"month"):this.num(t.month,2);case"LLL":return s("short",!0);case"LLLL":return s("long",!0);case"LLLLL":return s("narrow",!0);case"M":return n?r({month:"numeric"},"month"):this.num(t.month);case"MM":return n?r({month:"2-digit"},"month"):this.num(t.month,2);case"MMM":return s("short",!1);case"MMMM":return s("long",!1);case"MMMMM":return s("narrow",!1);case"y":return n?r({year:"numeric"},"year"):this.num(t.year);case"yy":return n?r({year:"2-digit"},"year"):this.num(t.year.toString().slice(-2),2);case"yyyy":return n?r({year:"numeric"},"year"):this.num(t.year,4);case"yyyyyy":return n?r({year:"numeric"},"year"):this.num(t.year,6);case"G":return u("short");case"GG":return u("long");case"GGGGG":return u("narrow");case"kk":return this.num(t.weekYear.toString().slice(-2),2);case"kkkk":return this.num(t.weekYear,4);case"W":return this.num(t.weekNumber);case"WW":return this.num(t.weekNumber,2);case"o":return this.num(t.ordinal);case"ooo":return this.num(t.ordinal,3);case"q":return this.num(t.quarter);case"qq":return this.num(t.quarter,2);case"X":return this.num(Math.floor(t.ts/1e3));case"x":return this.num(t.ts);default:return c(e)}}))}formatDurationFromString(t,e){const i=t=>{switch(t[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},n=Ct.parseFormat(e),r=n.reduce(((t,{literal:e,val:i})=>e?t:t.concat(i)),[]);return Tt(n,(t=>e=>{const n=i(e);return n?this.num(t.get(n),e.length):e})(t.shiftTo(...r.map(i).filter((t=>t)))))}}class Mt{constructor(t,e){this.reason=t,this.explanation=e}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}class zt{get type(){throw new f}get name(){throw new f}get ianaName(){return this.name}get isUniversal(){throw new f}offsetName(t,e){throw new f}formatOffset(t,e){throw new f}offset(t){throw new f}equals(t){throw new f}get isValid(){throw new f}}let It=null;class Pt extends zt{static get instance(){return null===It&&(It=new Pt),It}get type(){return"system"}get name(){return(new Intl.DateTimeFormat).resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(t,{format:e,locale:i}){return ot(t,e,i)}formatOffset(t,e){return ct(this.offset(t),e)}offset(t){return-new Date(t).getTimezoneOffset()}equals(t){return"system"===t.type}get isValid(){return!0}}let At={};const Dt={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};let Ot={};class Lt extends zt{static create(t){return Ot[t]||(Ot[t]=new Lt(t)),Ot[t]}static resetCache(){Ot={},At={}}static isValidSpecifier(t){return this.isValidZone(t)}static isValidZone(t){if(!t)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:t}).format(),!0}catch(t){return!1}}constructor(t){super(),this.zoneName=t,this.valid=Lt.isValidZone(t)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(t,{format:e,locale:i}){return ot(t,e,i,this.name)}formatOffset(t,e){return ct(this.offset(t),e)}offset(t){const e=new Date(t);if(isNaN(e))return NaN;const i=(n=this.name,At[n]||(At[n]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:n,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),At[n]);var n;let[r,o,a,s,l,c,u]=i.formatToParts?function(t,e){const i=t.formatToParts(e),n=[];for(let t=0;t=0?h:1e3+h,(it({year:r,month:o,day:a,hour:24===l?0:l,minute:c,second:u,millisecond:0})-d)/6e4}equals(t){return"iana"===t.type&&t.name===this.name}get isValid(){return this.valid}}let Rt=null;class Bt extends zt{static get utcInstance(){return null===Rt&&(Rt=new Bt(0)),Rt}static instance(t){return 0===t?Bt.utcInstance:new Bt(t)}static parseSpecifier(t){if(t){const e=t.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(e)return new Bt(at(e[1],e[2]))}return null}constructor(t){super(),this.fixed=t}get type(){return"fixed"}get name(){return 0===this.fixed?"UTC":`UTC${ct(this.fixed,"narrow")}`}get ianaName(){return 0===this.fixed?"Etc/UTC":`Etc/GMT${ct(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(t,e){return ct(this.fixed,e)}get isUniversal(){return!0}offset(){return this.fixed}equals(t){return"fixed"===t.type&&t.fixed===this.fixed}get isValid(){return!0}}class Ft extends zt{constructor(t){super(),this.zoneName=t}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function jt(t,e){if(V(t)||null===t)return e;if(t instanceof zt)return t;if("string"==typeof t){const i=t.toLowerCase();return"default"===i?e:"local"===i||"system"===i?Pt.instance:"utc"===i||"gmt"===i?Bt.utcInstance:Bt.parseSpecifier(i)||Lt.create(t)}return U(t)?Bt.instance(t):"object"==typeof t&&t.offset&&"number"==typeof t.offset?t:new Ft(t)}let Nt,Vt=()=>Date.now(),Ut="system",Zt=null,$t=null,Gt=null;class qt{static get now(){return Vt}static set now(t){Vt=t}static set defaultZone(t){Ut=t}static get defaultZone(){return jt(Ut,Pt.instance)}static get defaultLocale(){return Zt}static set defaultLocale(t){Zt=t}static get defaultNumberingSystem(){return $t}static set defaultNumberingSystem(t){$t=t}static get defaultOutputCalendar(){return Gt}static set defaultOutputCalendar(t){Gt=t}static get throwOnInvalid(){return Nt}static set throwOnInvalid(t){Nt=t}static resetCaches(){ne.resetCache(),Lt.resetCache()}}let Wt={};let Ht={};function Xt(t,e={}){const i=JSON.stringify([t,e]);let n=Ht[i];return n||(n=new Intl.DateTimeFormat(t,e),Ht[i]=n),n}let Yt={};let Kt={};let Jt=null;function Qt(t,e,i,n,r){const o=t.listingMode(i);return"error"===o?null:"en"===o?n(e):r(e)}class te{constructor(t,e,i){this.padTo=i.padTo||0,this.floor=i.floor||!1;const{padTo:n,floor:r,...o}=i;if(!e||Object.keys(o).length>0){const e={useGrouping:!1,...i};i.padTo>0&&(e.minimumIntegerDigits=i.padTo),this.inf=function(t,e={}){const i=JSON.stringify([t,e]);let n=Yt[i];return n||(n=new Intl.NumberFormat(t,e),Yt[i]=n),n}(t,e)}}format(t){if(this.inf){const e=this.floor?Math.floor(t):t;return this.inf.format(e)}return H(this.floor?Math.floor(t):J(t,3),this.padTo)}}class ee{constructor(t,e,i){let n;if(this.opts=i,t.zone.isUniversal){const e=t.offset/60*-1,r=e>=0?`Etc/GMT+${e}`:`Etc/GMT${e}`;0!==t.offset&&Lt.create(r).valid?(n=r,this.dt=t):(n="UTC",i.timeZoneName?this.dt=t:this.dt=0===t.offset?t:rn.fromMillis(t.ts+60*t.offset*1e3))}else"system"===t.zone.type?this.dt=t:(this.dt=t,n=t.zone.name);const r={...this.opts};n&&(r.timeZone=n),this.dtf=Xt(e,r)}format(){return this.dtf.format(this.dt.toJSDate())}formatToParts(){return this.dtf.formatToParts(this.dt.toJSDate())}resolvedOptions(){return this.dtf.resolvedOptions()}}class ie{constructor(t,e,i){this.opts={style:"long",...i},!e&&$()&&(this.rtf=function(t,e={}){const{base:i,...n}=e,r=JSON.stringify([t,n]);let o=Kt[r];return o||(o=new Intl.RelativeTimeFormat(t,e),Kt[r]=o),o}(t,i))}format(t,e){return this.rtf?this.rtf.format(t,e):function(t,e,i="always",n=!1){const r={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},o=-1===["hours","minutes","seconds"].indexOf(t);if("auto"===i&&o){const i="days"===t;switch(e){case 1:return i?"tomorrow":`next ${r[t][0]}`;case-1:return i?"yesterday":`last ${r[t][0]}`;case 0:return i?"today":`this ${r[t][0]}`}}const a=Object.is(e,-0)||e<0,s=Math.abs(e),l=1===s,c=r[t],u=n?l?c[1]:c[2]||c[1]:l?r[t][0]:t;return a?`${s} ${u} ago`:`in ${s} ${u}`}(e,t,this.opts.numeric,"long"!==this.opts.style)}formatToParts(t,e){return this.rtf?this.rtf.formatToParts(t,e):[]}}class ne{static fromOpts(t){return ne.create(t.locale,t.numberingSystem,t.outputCalendar,t.defaultToEN)}static create(t,e,i,n=!1){const r=t||qt.defaultLocale,o=r||(n?"en-US":Jt||(Jt=(new Intl.DateTimeFormat).resolvedOptions().locale,Jt)),a=e||qt.defaultNumberingSystem,s=i||qt.defaultOutputCalendar;return new ne(o,a,s,r)}static resetCache(){Jt=null,Ht={},Yt={},Kt={}}static fromObject({locale:t,numberingSystem:e,outputCalendar:i}={}){return ne.create(t,e,i)}constructor(t,e,i,n){const[r,o,a]=function(t){const e=t.indexOf("-u-");if(-1===e)return[t];{let i;const n=t.substring(0,e);try{i=Xt(t).resolvedOptions()}catch(t){i=Xt(n).resolvedOptions()}const{numberingSystem:r,calendar:o}=i;return[n,r,o]}}(t);this.locale=r,this.numberingSystem=e||o||null,this.outputCalendar=i||a||null,this.intl=function(t,e,i){return i||e?(t+="-u",i&&(t+=`-ca-${i}`),e&&(t+=`-nu-${e}`),t):t}(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=n,this.fastNumbersCached=null}get fastNumbers(){var t;return null==this.fastNumbersCached&&(this.fastNumbersCached=(!(t=this).numberingSystem||"latn"===t.numberingSystem)&&("latn"===t.numberingSystem||!t.locale||t.locale.startsWith("en")||"latn"===new Intl.DateTimeFormat(t.intl).resolvedOptions().numberingSystem)),this.fastNumbersCached}listingMode(){const t=this.isEnglish(),e=!(null!==this.numberingSystem&&"latn"!==this.numberingSystem||null!==this.outputCalendar&&"gregory"!==this.outputCalendar);return t&&e?"en":"intl"}clone(t){return t&&0!==Object.getOwnPropertyNames(t).length?ne.create(t.locale||this.specifiedLocale,t.numberingSystem||this.numberingSystem,t.outputCalendar||this.outputCalendar,t.defaultToEN||!1):this}redefaultToEN(t={}){return this.clone({...t,defaultToEN:!0})}redefaultToSystem(t={}){return this.clone({...t,defaultToEN:!1})}months(t,e=!1,i=!0){return Qt(this,t,i,ft,(()=>{const i=e?{month:t,day:"numeric"}:{month:t},n=e?"format":"standalone";return this.monthsCache[n][t]||(this.monthsCache[n][t]=function(t){const e=[];for(let i=1;i<=12;i++){const n=rn.utc(2016,i,1);e.push(t(n))}return e}((t=>this.extract(t,i,"month")))),this.monthsCache[n][t]}))}weekdays(t,e=!1,i=!0){return Qt(this,t,i,_t,(()=>{const i=e?{weekday:t,year:"numeric",month:"long",day:"numeric"}:{weekday:t},n=e?"format":"standalone";return this.weekdaysCache[n][t]||(this.weekdaysCache[n][t]=function(t){const e=[];for(let i=1;i<=7;i++){const n=rn.utc(2016,11,13+i);e.push(t(n))}return e}((t=>this.extract(t,i,"weekday")))),this.weekdaysCache[n][t]}))}meridiems(t=!0){return Qt(this,void 0,t,(()=>xt),(()=>{if(!this.meridiemCache){const t={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[rn.utc(2016,11,13,9),rn.utc(2016,11,13,19)].map((e=>this.extract(e,t,"dayperiod")))}return this.meridiemCache}))}eras(t,e=!0){return Qt(this,t,e,Et,(()=>{const e={era:t};return this.eraCache[t]||(this.eraCache[t]=[rn.utc(-40,1,1),rn.utc(2017,1,1)].map((t=>this.extract(t,e,"era")))),this.eraCache[t]}))}extract(t,e,i){const n=this.dtFormatter(t,e).formatToParts().find((t=>t.type.toLowerCase()===i));return n?n.value:null}numberFormatter(t={}){return new te(this.intl,t.forceSimple||this.fastNumbers,t)}dtFormatter(t,e={}){return new ee(t,this.intl,e)}relFormatter(t={}){return new ie(this.intl,this.isEnglish(),t)}listFormatter(t={}){return function(t,e={}){const i=JSON.stringify([t,e]);let n=Wt[i];return n||(n=new Intl.ListFormat(t,e),Wt[i]=n),n}(this.intl,t)}isEnglish(){return"en"===this.locale||"en-us"===this.locale.toLowerCase()||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}equals(t){return this.locale===t.locale&&this.numberingSystem===t.numberingSystem&&this.outputCalendar===t.outputCalendar}}function re(...t){const e=t.reduce(((t,e)=>t+e.source),"");return RegExp(`^${e}$`)}function oe(...t){return e=>t.reduce((([t,i,n],r)=>{const[o,a,s]=r(e,n);return[{...t,...o},a||i,s]}),[{},null,1]).slice(0,2)}function ae(t,...e){if(null==t)return[null,null];for(const[i,n]of e){const e=i.exec(t);if(e)return n(e)}return[null,null]}function se(...t){return(e,i)=>{const n={};let r;for(r=0;rvoid 0!==t&&(e||t&&u)?-t:t;return[{years:h(Y(i)),months:h(Y(n)),weeks:h(Y(r)),days:h(Y(o)),hours:h(Y(a)),minutes:h(Y(s)),seconds:h(Y(l),"-0"===l),milliseconds:h(K(c),d)}]}const ke={GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Ee(t,e,i,n,r,o,a){const s={year:2===e.length?rt(X(e)):X(e),month:pt.indexOf(i)+1,day:X(n),hour:X(r),minute:X(o)};return a&&(s.second=X(a)),t&&(s.weekday=t.length>3?gt.indexOf(t)+1:vt.indexOf(t)+1),s}const Te=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function Se(t){const[,e,i,n,r,o,a,s,l,c,u,d]=t,h=Ee(e,r,n,i,o,a,s);let p;return p=l?ke[l]:c?0:at(u,d),[h,new Bt(p)]}const Ce=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,Me=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,ze=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function Ie(t){const[,e,i,n,r,o,a,s]=t;return[Ee(e,r,n,i,o,a,s),Bt.utcInstance]}function Pe(t){const[,e,i,n,r,o,a,s]=t;return[Ee(e,s,i,n,r,o,a),Bt.utcInstance]}const Ae=re(/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,de),De=re(/(\d{4})-?W(\d\d)(?:-?(\d))?/,de),Oe=re(/(\d{4})-?(\d{3})/,de),Le=re(ue),Re=oe((function(t,e){return[{year:ge(t,e),month:ge(t,e+1,1),day:ge(t,e+2,1)},null,e+3]}),ve,ye,_e),Be=oe(he,ve,ye,_e),Fe=oe(pe,ve,ye,_e),je=oe(ve,ye,_e);const Ne=oe(ve);const Ve=re(/(\d{4})-(\d\d)-(\d\d)/,fe),Ue=re(me),Ze=oe(ve,ye,_e);const $e={weeks:{days:7,hours:168,minutes:10080,seconds:604800,milliseconds:6048e5},days:{hours:24,minutes:1440,seconds:86400,milliseconds:864e5},hours:{minutes:60,seconds:3600,milliseconds:36e5},minutes:{seconds:60,milliseconds:6e4},seconds:{milliseconds:1e3}},Ge={years:{quarters:4,months:12,weeks:52,days:365,hours:8760,minutes:525600,seconds:31536e3,milliseconds:31536e6},quarters:{months:3,weeks:13,days:91,hours:2184,minutes:131040,seconds:7862400,milliseconds:78624e5},months:{weeks:4,days:30,hours:720,minutes:43200,seconds:2592e3,milliseconds:2592e6},...$e},qe=365.2425,We=30.436875,He={years:{quarters:4,months:12,weeks:52.1775,days:qe,hours:8765.82,minutes:525949.2,seconds:525949.2*60,milliseconds:525949.2*60*1e3},quarters:{months:3,weeks:13.044375,days:91.310625,hours:2191.455,minutes:131487.3,seconds:525949.2*60/4,milliseconds:7889237999.999999},months:{weeks:4.3481250000000005,days:We,hours:730.485,minutes:43829.1,seconds:2629746,milliseconds:2629746e3},...$e},Xe=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],Ye=Xe.slice(0).reverse();function Ke(t,e,i=!1){const n={values:i?e.values:{...t.values,...e.values||{}},loc:t.loc.clone(e.loc),conversionAccuracy:e.conversionAccuracy||t.conversionAccuracy,matrix:e.matrix||t.matrix};return new Qe(n)}function Je(t,e,i,n,r){const o=t[r][i],a=e[i]/o,s=!(Math.sign(a)===Math.sign(n[r]))&&0!==n[r]&&Math.abs(a)<=1?function(t){return t<0?Math.floor(t):Math.ceil(t)}(a):Math.trunc(a);n[r]+=s,e[i]-=s*o}class Qe{constructor(t){const e="longterm"===t.conversionAccuracy||!1;let i=e?He:Ge;t.matrix&&(i=t.matrix),this.values=t.values,this.loc=t.loc||ne.create(),this.conversionAccuracy=e?"longterm":"casual",this.invalid=t.invalid||null,this.matrix=i,this.isLuxonDuration=!0}static fromMillis(t,e){return Qe.fromObject({milliseconds:t},e)}static fromObject(t,e={}){if(null==t||"object"!=typeof t)throw new m("Duration.fromObject: argument expected to be an object, got "+(null===t?"null":typeof t));return new Qe({values:lt(t,Qe.normalizeUnit),loc:ne.fromObject(e),conversionAccuracy:e.conversionAccuracy,matrix:e.matrix})}static fromDurationLike(t){if(U(t))return Qe.fromMillis(t);if(Qe.isDuration(t))return t;if("object"==typeof t)return Qe.fromObject(t);throw new m(`Unknown duration argument ${t} of type ${typeof t}`)}static fromISO(t,e){const[i]=function(t){return ae(t,[be,we])}(t);return i?Qe.fromObject(i,e):Qe.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static fromISOTime(t,e){const[i]=function(t){return ae(t,[xe,Ne])}(t);return i?Qe.fromObject(i,e):Qe.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static invalid(t,e=null){if(!t)throw new m("need to specify a reason the Duration is invalid");const i=t instanceof Mt?t:new Mt(t,e);if(qt.throwOnInvalid)throw new d(i);return new Qe({invalid:i})}static normalizeUnit(t){const e={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[t?t.toLowerCase():t];if(!e)throw new p(t);return e}static isDuration(t){return t&&t.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(t,e={}){const i={...e,floor:!1!==e.round&&!1!==e.floor};return this.isValid?Ct.create(this.loc,i).formatDurationFromString(this,t):"Invalid Duration"}toHuman(t={}){const e=Xe.map((e=>{const i=this.values[e];return V(i)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...t,unit:e.slice(0,-1)}).format(i)})).filter((t=>t));return this.loc.listFormatter({type:"conjunction",style:t.listStyle||"narrow",...t}).format(e)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let t="P";return 0!==this.years&&(t+=this.years+"Y"),0===this.months&&0===this.quarters||(t+=this.months+3*this.quarters+"M"),0!==this.weeks&&(t+=this.weeks+"W"),0!==this.days&&(t+=this.days+"D"),0===this.hours&&0===this.minutes&&0===this.seconds&&0===this.milliseconds||(t+="T"),0!==this.hours&&(t+=this.hours+"H"),0!==this.minutes&&(t+=this.minutes+"M"),0===this.seconds&&0===this.milliseconds||(t+=J(this.seconds+this.milliseconds/1e3,3)+"S"),"P"===t&&(t+="T0S"),t}toISOTime(t={}){if(!this.isValid)return null;const e=this.toMillis();if(e<0||e>=864e5)return null;t={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...t};const i=this.shiftTo("hours","minutes","seconds","milliseconds");let n="basic"===t.format?"hhmm":"hh:mm";t.suppressSeconds&&0===i.seconds&&0===i.milliseconds||(n+="basic"===t.format?"ss":":ss",t.suppressMilliseconds&&0===i.milliseconds||(n+=".SSS"));let r=i.toFormat(n);return t.includePrefix&&(r="T"+r),r}toJSON(){return this.toISO()}toString(){return this.toISO()}toMillis(){return this.as("milliseconds")}valueOf(){return this.toMillis()}plus(t){if(!this.isValid)return this;const e=Qe.fromDurationLike(t),i={};for(const t of Xe)(q(e.values,t)||q(this.values,t))&&(i[t]=e.get(t)+this.get(t));return Ke(this,{values:i},!0)}minus(t){if(!this.isValid)return this;const e=Qe.fromDurationLike(t);return this.plus(e.negate())}mapUnits(t){if(!this.isValid)return this;const e={};for(const i of Object.keys(this.values))e[i]=st(t(this.values[i],i));return Ke(this,{values:e},!0)}get(t){return this[Qe.normalizeUnit(t)]}set(t){if(!this.isValid)return this;return Ke(this,{values:{...this.values,...lt(t,Qe.normalizeUnit)}})}reconfigure({locale:t,numberingSystem:e,conversionAccuracy:i,matrix:n}={}){return Ke(this,{loc:this.loc.clone({locale:t,numberingSystem:e}),matrix:n,conversionAccuracy:i})}as(t){return this.isValid?this.shiftTo(t).get(t):NaN}normalize(){if(!this.isValid)return this;const t=this.toObject();return function(t,e){Ye.reduce(((i,n)=>V(e[n])?i:(i&&Je(t,e,i,e,n),n)),null)}(this.matrix,t),Ke(this,{values:t},!0)}shiftTo(...t){if(!this.isValid)return this;if(0===t.length)return this;t=t.map((t=>Qe.normalizeUnit(t)));const e={},i={},n=this.toObject();let r;for(const o of Xe)if(t.indexOf(o)>=0){r=o;let t=0;for(const e in i)t+=this.matrix[e][o]*i[e],i[e]=0;U(n[o])&&(t+=n[o]);const a=Math.trunc(t);e[o]=a,i[o]=(1e3*t-1e3*a)/1e3;for(const t in n)Xe.indexOf(t)>Xe.indexOf(o)&&Je(this.matrix,n,t,e,o)}else U(n[o])&&(i[o]=n[o]);for(const t in i)0!==i[t]&&(e[r]+=t===r?i[t]:i[t]/this.matrix[r][t]);return Ke(this,{values:e},!0).normalize()}negate(){if(!this.isValid)return this;const t={};for(const e of Object.keys(this.values))t[e]=0===this.values[e]?0:-this.values[e];return Ke(this,{values:t},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return null===this.invalid}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(t){if(!this.isValid||!t.isValid)return!1;if(!this.loc.equals(t.loc))return!1;for(const n of Xe)if(e=this.values[n],i=t.values[n],!(void 0===e||0===e?void 0===i||0===i:e===i))return!1;var e,i;return!0}}const ti="Invalid Interval";class ei{constructor(t){this.s=t.start,this.e=t.end,this.invalid=t.invalid||null,this.isLuxonInterval=!0}static invalid(t,e=null){if(!t)throw new m("need to specify a reason the Interval is invalid");const i=t instanceof Mt?t:new Mt(t,e);if(qt.throwOnInvalid)throw new u(i);return new ei({invalid:i})}static fromDateTimes(t,e){const i=on(t),n=on(e),r=function(t,e){return t&&t.isValid?e&&e.isValid?et}isBefore(t){return!!this.isValid&&this.e<=t}contains(t){return!!this.isValid&&(this.s<=t&&this.e>t)}set({start:t,end:e}={}){return this.isValid?ei.fromDateTimes(t||this.s,e||this.e):this}splitAt(...t){if(!this.isValid)return[];const e=t.map(on).filter((t=>this.contains(t))).sort(),i=[];let{s:n}=this,r=0;for(;n+this.e?this.e:t;i.push(ei.fromDateTimes(n,o)),n=o,r+=1}return i}splitBy(t){const e=Qe.fromDurationLike(t);if(!this.isValid||!e.isValid||0===e.as("milliseconds"))return[];let i,{s:n}=this,r=1;const o=[];for(;nt*r)));i=+t>+this.e?this.e:t,o.push(ei.fromDateTimes(n,i)),n=i,r+=1}return o}divideEqually(t){return this.isValid?this.splitBy(this.length()/t).slice(0,t):[]}overlaps(t){return this.e>t.s&&this.s=t.e)}equals(t){return!(!this.isValid||!t.isValid)&&(this.s.equals(t.s)&&this.e.equals(t.e))}intersection(t){if(!this.isValid)return this;const e=this.s>t.s?this.s:t.s,i=this.e=i?null:ei.fromDateTimes(e,i)}union(t){if(!this.isValid)return this;const e=this.st.e?this.e:t.e;return ei.fromDateTimes(e,i)}static merge(t){const[e,i]=t.sort(((t,e)=>t.s-e.s)).reduce((([t,e],i)=>e?e.overlaps(i)||e.abutsStart(i)?[t,e.union(i)]:[t.concat([e]),i]:[t,i]),[[],null]);return i&&e.push(i),e}static xor(t){let e=null,i=0;const n=[],r=t.map((t=>[{time:t.s,type:"s"},{time:t.e,type:"e"}])),o=Array.prototype.concat(...r).sort(((t,e)=>t.time-e.time));for(const t of o)i+="s"===t.type?1:-1,1===i?e=t.time:(e&&+e!=+t.time&&n.push(ei.fromDateTimes(e,t.time)),e=null);return ei.merge(n)}difference(...t){return ei.xor([this].concat(t)).map((t=>this.intersection(t))).filter((t=>t&&!t.isEmpty()))}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:ti}toISO(t){return this.isValid?`${this.s.toISO(t)}/${this.e.toISO(t)}`:ti}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:ti}toISOTime(t){return this.isValid?`${this.s.toISOTime(t)}/${this.e.toISOTime(t)}`:ti}toFormat(t,{separator:e=" – "}={}){return this.isValid?`${this.s.toFormat(t)}${e}${this.e.toFormat(t)}`:ti}toDuration(t,e){return this.isValid?this.e.diff(this.s,t,e):Qe.invalid(this.invalidReason)}mapEndpoints(t){return ei.fromDateTimes(t(this.s),t(this.e))}}class ii{static hasDST(t=qt.defaultZone){const e=rn.now().setZone(t).set({month:12});return!t.isUniversal&&e.offset!==e.set({month:6}).offset}static isValidIANAZone(t){return Lt.isValidZone(t)}static normalizeZone(t){return jt(t,qt.defaultZone)}static months(t="long",{locale:e=null,numberingSystem:i=null,locObj:n=null,outputCalendar:r="gregory"}={}){return(n||ne.create(e,i,r)).months(t)}static monthsFormat(t="long",{locale:e=null,numberingSystem:i=null,locObj:n=null,outputCalendar:r="gregory"}={}){return(n||ne.create(e,i,r)).months(t,!0)}static weekdays(t="long",{locale:e=null,numberingSystem:i=null,locObj:n=null}={}){return(n||ne.create(e,i,null)).weekdays(t)}static weekdaysFormat(t="long",{locale:e=null,numberingSystem:i=null,locObj:n=null}={}){return(n||ne.create(e,i,null)).weekdays(t,!0)}static meridiems({locale:t=null}={}){return ne.create(t).meridiems()}static eras(t="short",{locale:e=null}={}){return ne.create(e,null,"gregory").eras(t)}static features(){return{relative:$()}}}function ni(t,e){const i=t=>t.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),n=i(e)-i(t);return Math.floor(Qe.fromMillis(n).as("days"))}function ri(t,e,i,n){let[r,o,a,s]=function(t,e,i){const n=[["years",(t,e)=>e.year-t.year],["quarters",(t,e)=>e.quarter-t.quarter],["months",(t,e)=>e.month-t.month+12*(e.year-t.year)],["weeks",(t,e)=>{const i=ni(t,e);return(i-i%7)/7}],["days",ni]],r={};let o,a;for(const[s,l]of n)if(i.indexOf(s)>=0){o=s;let i=l(t,e);a=t.plus({[s]:i}),a>e?(t=t.plus({[s]:i-1}),i-=1):t=a,r[s]=i}return[t,r,a,o]}(t,e,i);const l=e-r,c=i.filter((t=>["hours","minutes","seconds","milliseconds"].indexOf(t)>=0));0===c.length&&(a0?Qe.fromMillis(l,n).shiftTo(...c).plus(u):u}const oi={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},ai={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},si=oi.hanidec.replace(/[\[|\]]/g,"").split("");function li({numberingSystem:t},e=""){return new RegExp(`${oi[t||"latn"]}${e}`)}function ci(t,e=(t=>t)){return{regex:t,deser:([t])=>e(function(t){let e=parseInt(t,10);if(isNaN(e)){e="";for(let i=0;i=i&&n<=r&&(e+=n-i)}}return parseInt(e,10)}return e}(t))}}const ui=`[ ${String.fromCharCode(160)}]`,di=new RegExp(ui,"g");function hi(t){return t.replace(/\./g,"\\.?").replace(di,ui)}function pi(t){return t.replace(/\./g,"").replace(di," ").toLowerCase()}function mi(t,e){return null===t?null:{regex:RegExp(t.map(hi).join("|")),deser:([i])=>t.findIndex((t=>pi(i)===pi(t)))+e}}function fi(t,e){return{regex:t,deser:([,t,e])=>at(t,e),groups:e}}function gi(t){return{regex:t,deser:([t])=>t}}const vi={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour:{numeric:"h","2-digit":"hh"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};let yi=null;function _i(t,e){return Array.prototype.concat(...t.map((t=>function(t,e){if(t.literal)return t;const i=bi(Ct.macroTokenToFormatOpts(t.val),e);return null==i||i.includes(void 0)?t:i}(t,e))))}function xi(t,e,i){const n=_i(Ct.parseFormat(i),t),r=n.map((e=>function(t,e){const i=li(e),n=li(e,"{2}"),r=li(e,"{3}"),o=li(e,"{4}"),a=li(e,"{6}"),s=li(e,"{1,2}"),l=li(e,"{1,3}"),c=li(e,"{1,6}"),u=li(e,"{1,9}"),d=li(e,"{2,4}"),h=li(e,"{4,6}"),p=t=>{return{regex:RegExp((e=t.val,e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&"))),deser:([t])=>t,literal:!0};var e},m=(m=>{if(t.literal)return p(m);switch(m.val){case"G":return mi(e.eras("short",!1),0);case"GG":return mi(e.eras("long",!1),0);case"y":return ci(c);case"yy":case"kk":return ci(d,rt);case"yyyy":case"kkkk":return ci(o);case"yyyyy":return ci(h);case"yyyyyy":return ci(a);case"M":case"L":case"d":case"H":case"h":case"m":case"q":case"s":case"W":return ci(s);case"MM":case"LL":case"dd":case"HH":case"hh":case"mm":case"qq":case"ss":case"WW":return ci(n);case"MMM":return mi(e.months("short",!0,!1),1);case"MMMM":return mi(e.months("long",!0,!1),1);case"LLL":return mi(e.months("short",!1,!1),1);case"LLLL":return mi(e.months("long",!1,!1),1);case"o":case"S":return ci(l);case"ooo":case"SSS":return ci(r);case"u":return gi(u);case"uu":return gi(s);case"uuu":case"E":case"c":return ci(i);case"a":return mi(e.meridiems(),0);case"EEE":return mi(e.weekdays("short",!1,!1),1);case"EEEE":return mi(e.weekdays("long",!1,!1),1);case"ccc":return mi(e.weekdays("short",!0,!1),1);case"cccc":return mi(e.weekdays("long",!0,!1),1);case"Z":case"ZZ":return fi(new RegExp(`([+-]${s.source})(?::(${n.source}))?`),2);case"ZZZ":return fi(new RegExp(`([+-]${s.source})(${n.source})?`),2);case"z":return gi(/[a-z_+-/]{1,256}?/i);default:return p(m)}})(t)||{invalidReason:"missing Intl.DateTimeFormat.formatToParts support"};return m.token=t,m}(e,t))),o=r.find((t=>t.invalidReason));if(o)return{input:e,tokens:n,invalidReason:o.invalidReason};{const[t,i]=function(t){return[`^${t.map((t=>t.regex)).reduce(((t,e)=>`${t}(${e.source})`),"")}$`,t]}(r),o=RegExp(t,"i"),[a,s]=function(t,e,i){const n=t.match(e);if(n){const t={};let e=1;for(const r in i)if(q(i,r)){const o=i[r],a=o.groups?o.groups+1:1;!o.literal&&o.token&&(t[o.token.val[0]]=o.deser(n.slice(e,e+a))),e+=a}return[n,t]}return[n,{}]}(e,o,i),[l,c,u]=s?function(t){let e,i=null;return V(t.z)||(i=Lt.create(t.z)),V(t.Z)||(i||(i=new Bt(t.Z)),e=t.Z),V(t.q)||(t.M=3*(t.q-1)+1),V(t.h)||(t.h<12&&1===t.a?t.h+=12:12===t.h&&0===t.a&&(t.h=0)),0===t.G&&t.y&&(t.y=-t.y),V(t.u)||(t.S=K(t.u)),[Object.keys(t).reduce(((e,i)=>{const n=(t=>{switch(t){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}})(i);return n&&(e[n]=t[i]),e}),{}),i,e]}(s):[null,null,void 0];if(q(s,"a")&&q(s,"H"))throw new h("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:n,regex:o,rawMatches:a,matches:s,result:l,zone:c,specificOffset:u}}}function bi(t,e){if(!t)return null;return Ct.create(e,t).formatDateTimeParts((yi||(yi=rn.fromMillis(1555555555555)),yi)).map((e=>function(t,e,i){const{type:n,value:r}=t;if("literal"===n)return{literal:!0,val:r};const o=i[n];let a=vi[n];return"object"==typeof a&&(a=a[o]),a?{literal:!1,val:a}:void 0}(e,0,t)))}const wi=[0,31,59,90,120,151,181,212,243,273,304,334],ki=[0,31,60,91,121,152,182,213,244,274,305,335];function Ei(t,e){return new Mt("unit out of range",`you specified ${e} (of type ${typeof e}) as a ${t}, which is invalid`)}function Ti(t,e,i){const n=new Date(Date.UTC(t,e-1,i));t<100&&t>=0&&n.setUTCFullYear(n.getUTCFullYear()-1900);const r=n.getUTCDay();return 0===r?7:r}function Si(t,e,i){return i+(Q(t)?ki:wi)[e-1]}function Ci(t,e){const i=Q(t)?ki:wi,n=i.findIndex((t=>tnt(e)?(a=e+1,s=1):a=e,{weekYear:a,weekNumber:s,weekday:o,...ut(t)}}function zi(t){const{weekYear:e,weekNumber:i,weekday:n}=t,r=Ti(e,1,4),o=tt(e);let a,s=7*i+n-r-3;s<1?(a=e-1,s+=tt(a)):s>o?(a=e+1,s-=tt(e)):a=e;const{month:l,day:c}=Ci(a,s);return{year:a,month:l,day:c,...ut(t)}}function Ii(t){const{year:e,month:i,day:n}=t;return{year:e,ordinal:Si(e,i,n),...ut(t)}}function Pi(t){const{year:e,ordinal:i}=t,{month:n,day:r}=Ci(e,i);return{year:e,month:n,day:r,...ut(t)}}function Ai(t){const e=Z(t.year),i=W(t.month,1,12),n=W(t.day,1,et(t.year,t.month));return e?i?!n&&Ei("day",t.day):Ei("month",t.month):Ei("year",t.year)}function Di(t){const{hour:e,minute:i,second:n,millisecond:r}=t,o=W(e,0,23)||24===e&&0===i&&0===n&&0===r,a=W(i,0,59),s=W(n,0,59),l=W(r,0,999);return o?a?s?!l&&Ei("millisecond",r):Ei("second",n):Ei("minute",i):Ei("hour",e)}const Oi="Invalid DateTime",Li=864e13;function Ri(t){return new Mt("unsupported zone",`the zone "${t.name}" is not supported`)}function Bi(t){return null===t.weekData&&(t.weekData=Mi(t.c)),t.weekData}function Fi(t,e){const i={ts:t.ts,zone:t.zone,c:t.c,o:t.o,loc:t.loc,invalid:t.invalid};return new rn({...i,...e,old:i})}function ji(t,e,i){let n=t-60*e*1e3;const r=i.offset(n);if(e===r)return[n,e];n-=60*(r-e)*1e3;const o=i.offset(n);return r===o?[n,r]:[t-60*Math.min(r,o)*1e3,Math.max(r,o)]}function Ni(t,e){const i=new Date(t+=60*e*1e3);return{year:i.getUTCFullYear(),month:i.getUTCMonth()+1,day:i.getUTCDate(),hour:i.getUTCHours(),minute:i.getUTCMinutes(),second:i.getUTCSeconds(),millisecond:i.getUTCMilliseconds()}}function Vi(t,e,i){return ji(it(t),e,i)}function Ui(t,e){const i=t.o,n=t.c.year+Math.trunc(e.years),r=t.c.month+Math.trunc(e.months)+3*Math.trunc(e.quarters),o={...t.c,year:n,month:r,day:Math.min(t.c.day,et(n,r))+Math.trunc(e.days)+7*Math.trunc(e.weeks)},a=Qe.fromObject({years:e.years-Math.trunc(e.years),quarters:e.quarters-Math.trunc(e.quarters),months:e.months-Math.trunc(e.months),weeks:e.weeks-Math.trunc(e.weeks),days:e.days-Math.trunc(e.days),hours:e.hours,minutes:e.minutes,seconds:e.seconds,milliseconds:e.milliseconds}).as("milliseconds"),s=it(o);let[l,c]=ji(s,i,t.zone);return 0!==a&&(l+=a,c=t.zone.offset(l)),{ts:l,o:c}}function Zi(t,e,i,n,r,o){const{setZone:a,zone:s}=i;if(t&&0!==Object.keys(t).length){const n=e||s,r=rn.fromObject(t,{...i,zone:n,specificOffset:o});return a?r:r.setZone(s)}return rn.invalid(new Mt("unparsable",`the input "${r}" can't be parsed as ${n}`))}function $i(t,e,i=!0){return t.isValid?Ct.create(ne.create("en-US"),{allowZ:i,forceSimple:!0}).formatDateTimeFromString(t,e):null}function Gi(t,e){const i=t.c.year>9999||t.c.year<0;let n="";return i&&t.c.year>=0&&(n+="+"),n+=H(t.c.year,i?6:4),e?(n+="-",n+=H(t.c.month),n+="-",n+=H(t.c.day)):(n+=H(t.c.month),n+=H(t.c.day)),n}function qi(t,e,i,n,r,o){let a=H(t.c.hour);return e?(a+=":",a+=H(t.c.minute),0===t.c.second&&i||(a+=":")):a+=H(t.c.minute),0===t.c.second&&i||(a+=H(t.c.second),0===t.c.millisecond&&n||(a+=".",a+=H(t.c.millisecond,3))),r&&(t.isOffsetFixed&&0===t.offset&&!o?a+="Z":t.o<0?(a+="-",a+=H(Math.trunc(-t.o/60)),a+=":",a+=H(Math.trunc(-t.o%60))):(a+="+",a+=H(Math.trunc(t.o/60)),a+=":",a+=H(Math.trunc(t.o%60)))),o&&(a+="["+t.zone.ianaName+"]"),a}const Wi={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},Hi={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},Xi={ordinal:1,hour:0,minute:0,second:0,millisecond:0},Yi=["year","month","day","hour","minute","second","millisecond"],Ki=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],Ji=["year","ordinal","hour","minute","second","millisecond"];function Qi(t){const e={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[t.toLowerCase()];if(!e)throw new p(t);return e}function tn(t,e){const i=jt(e.zone,qt.defaultZone),n=ne.fromObject(e),r=qt.now();let o,a;if(V(t.year))o=r;else{for(const e of Yi)V(t[e])&&(t[e]=Wi[e]);const e=Ai(t)||Di(t);if(e)return rn.invalid(e);const n=i.offset(r);[o,a]=Vi(t,n,i)}return new rn({ts:o,zone:i,loc:n,o:a})}function en(t,e,i){const n=!!V(i.round)||i.round,r=(t,r)=>{t=J(t,n||i.calendary?0:2,!0);return e.loc.clone(i).relFormatter(i).format(t,r)},o=n=>i.calendary?e.hasSame(t,n)?0:e.startOf(n).diff(t.startOf(n),n).get(n):e.diff(t,n).get(n);if(i.unit)return r(o(i.unit),i.unit);for(const t of i.units){const e=o(t);if(Math.abs(e)>=1)return r(e,t)}return r(t>e?-0:0,i.units[i.units.length-1])}function nn(t){let e,i={};return t.length>0&&"object"==typeof t[t.length-1]?(i=t[t.length-1],e=Array.from(t).slice(0,t.length-1)):e=Array.from(t),[i,e]}class rn{constructor(t){const e=t.zone||qt.defaultZone;let i=t.invalid||(Number.isNaN(t.ts)?new Mt("invalid input"):null)||(e.isValid?null:Ri(e));this.ts=V(t.ts)?qt.now():t.ts;let n=null,r=null;if(!i){if(t.old&&t.old.ts===this.ts&&t.old.zone.equals(e))[n,r]=[t.old.c,t.old.o];else{const t=e.offset(this.ts);n=Ni(this.ts,t),i=Number.isNaN(n.year)?new Mt("invalid input"):null,n=i?null:n,r=i?null:t}}this._zone=e,this.loc=t.loc||ne.create(),this.invalid=i,this.weekData=null,this.c=n,this.o=r,this.isLuxonDateTime=!0}static now(){return new rn({})}static local(){const[t,e]=nn(arguments),[i,n,r,o,a,s,l]=e;return tn({year:i,month:n,day:r,hour:o,minute:a,second:s,millisecond:l},t)}static utc(){const[t,e]=nn(arguments),[i,n,r,o,a,s,l]=e;return t.zone=Bt.utcInstance,tn({year:i,month:n,day:r,hour:o,minute:a,second:s,millisecond:l},t)}static fromJSDate(t,e={}){const i=(n=t,"[object Date]"===Object.prototype.toString.call(n)?t.valueOf():NaN);var n;if(Number.isNaN(i))return rn.invalid("invalid input");const r=jt(e.zone,qt.defaultZone);return r.isValid?new rn({ts:i,zone:r,loc:ne.fromObject(e)}):rn.invalid(Ri(r))}static fromMillis(t,e={}){if(U(t))return t<-Li||t>Li?rn.invalid("Timestamp out of range"):new rn({ts:t,zone:jt(e.zone,qt.defaultZone),loc:ne.fromObject(e)});throw new m(`fromMillis requires a numerical input, but received a ${typeof t} with value ${t}`)}static fromSeconds(t,e={}){if(U(t))return new rn({ts:1e3*t,zone:jt(e.zone,qt.defaultZone),loc:ne.fromObject(e)});throw new m("fromSeconds requires a numerical input")}static fromObject(t,e={}){t=t||{};const i=jt(e.zone,qt.defaultZone);if(!i.isValid)return rn.invalid(Ri(i));const n=qt.now(),r=V(e.specificOffset)?i.offset(n):e.specificOffset,o=lt(t,Qi),a=!V(o.ordinal),s=!V(o.year),l=!V(o.month)||!V(o.day),c=s||l,u=o.weekYear||o.weekNumber,d=ne.fromObject(e);if((c||a)&&u)throw new h("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(l&&a)throw new h("Can't mix ordinal dates with month/day");const p=u||o.weekday&&!c;let m,f,g=Ni(n,r);p?(m=Ki,f=Hi,g=Mi(g)):a?(m=Ji,f=Xi,g=Ii(g)):(m=Yi,f=Wi);let v=!1;for(const t of m){V(o[t])?o[t]=v?f[t]:g[t]:v=!0}const y=p?function(t){const e=Z(t.weekYear),i=W(t.weekNumber,1,nt(t.weekYear)),n=W(t.weekday,1,7);return e?i?!n&&Ei("weekday",t.weekday):Ei("week",t.week):Ei("weekYear",t.weekYear)}(o):a?function(t){const e=Z(t.year),i=W(t.ordinal,1,tt(t.year));return e?!i&&Ei("ordinal",t.ordinal):Ei("year",t.year)}(o):Ai(o),_=y||Di(o);if(_)return rn.invalid(_);const x=p?zi(o):a?Pi(o):o,[b,w]=Vi(x,r,i),k=new rn({ts:b,zone:i,o:w,loc:d});return o.weekday&&c&&t.weekday!==k.weekday?rn.invalid("mismatched weekday",`you can't specify both a weekday of ${o.weekday} and a date of ${k.toISO()}`):k}static fromISO(t,e={}){const[i,n]=function(t){return ae(t,[Ae,Re],[De,Be],[Oe,Fe],[Le,je])}(t);return Zi(i,n,e,"ISO 8601",t)}static fromRFC2822(t,e={}){const[i,n]=function(t){return ae(function(t){return t.replace(/\([^)]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}(t),[Te,Se])}(t);return Zi(i,n,e,"RFC 2822",t)}static fromHTTP(t,e={}){const[i,n]=function(t){return ae(t,[Ce,Ie],[Me,Ie],[ze,Pe])}(t);return Zi(i,n,e,"HTTP",e)}static fromFormat(t,e,i={}){if(V(t)||V(e))throw new m("fromFormat requires an input string and a format");const{locale:n=null,numberingSystem:r=null}=i,o=ne.fromOpts({locale:n,numberingSystem:r,defaultToEN:!0}),[a,s,l,c]=function(t,e,i){const{result:n,zone:r,specificOffset:o,invalidReason:a}=xi(t,e,i);return[n,r,o,a]}(o,t,e);return c?rn.invalid(c):Zi(a,s,i,`format ${e}`,t,l)}static fromString(t,e,i={}){return rn.fromFormat(t,e,i)}static fromSQL(t,e={}){const[i,n]=function(t){return ae(t,[Ve,Re],[Ue,Ze])}(t);return Zi(i,n,e,"SQL",t)}static invalid(t,e=null){if(!t)throw new m("need to specify a reason the DateTime is invalid");const i=t instanceof Mt?t:new Mt(t,e);if(qt.throwOnInvalid)throw new c(i);return new rn({invalid:i})}static isDateTime(t){return t&&t.isLuxonDateTime||!1}static parseFormatForOpts(t,e={}){const i=bi(t,ne.fromObject(e));return i?i.map((t=>t?t.val:null)).join(""):null}static expandFormat(t,e={}){return _i(Ct.parseFormat(t),ne.fromObject(e)).map((t=>t.val)).join("")}get(t){return this[t]}get isValid(){return null===this.invalid}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?Bi(this).weekYear:NaN}get weekNumber(){return this.isValid?Bi(this).weekNumber:NaN}get weekday(){return this.isValid?Bi(this).weekday:NaN}get ordinal(){return this.isValid?Ii(this.c).ordinal:NaN}get monthShort(){return this.isValid?ii.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?ii.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?ii.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?ii.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return!this.isOffsetFixed&&(this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset)}get isInLeapYear(){return Q(this.year)}get daysInMonth(){return et(this.year,this.month)}get daysInYear(){return this.isValid?tt(this.year):NaN}get weeksInWeekYear(){return this.isValid?nt(this.weekYear):NaN}resolvedLocaleOptions(t={}){const{locale:e,numberingSystem:i,calendar:n}=Ct.create(this.loc.clone(t),t).resolvedOptions(this);return{locale:e,numberingSystem:i,outputCalendar:n}}toUTC(t=0,e={}){return this.setZone(Bt.instance(t),e)}toLocal(){return this.setZone(qt.defaultZone)}setZone(t,{keepLocalTime:e=!1,keepCalendarTime:i=!1}={}){if((t=jt(t,qt.defaultZone)).equals(this.zone))return this;if(t.isValid){let n=this.ts;if(e||i){const e=t.offset(this.ts),i=this.toObject();[n]=Vi(i,e,t)}return Fi(this,{ts:n,zone:t})}return rn.invalid(Ri(t))}reconfigure({locale:t,numberingSystem:e,outputCalendar:i}={}){return Fi(this,{loc:this.loc.clone({locale:t,numberingSystem:e,outputCalendar:i})})}setLocale(t){return this.reconfigure({locale:t})}set(t){if(!this.isValid)return this;const e=lt(t,Qi),i=!V(e.weekYear)||!V(e.weekNumber)||!V(e.weekday),n=!V(e.ordinal),r=!V(e.year),o=!V(e.month)||!V(e.day),a=r||o,s=e.weekYear||e.weekNumber;if((a||n)&&s)throw new h("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(o&&n)throw new h("Can't mix ordinal dates with month/day");let l;i?l=zi({...Mi(this.c),...e}):V(e.ordinal)?(l={...this.toObject(),...e},V(e.day)&&(l.day=Math.min(et(l.year,l.month),l.day))):l=Pi({...Ii(this.c),...e});const[c,u]=Vi(l,this.o,this.zone);return Fi(this,{ts:c,o:u})}plus(t){if(!this.isValid)return this;return Fi(this,Ui(this,Qe.fromDurationLike(t)))}minus(t){if(!this.isValid)return this;return Fi(this,Ui(this,Qe.fromDurationLike(t).negate()))}startOf(t){if(!this.isValid)return this;const e={},i=Qe.normalizeUnit(t);switch(i){case"years":e.month=1;case"quarters":case"months":e.day=1;case"weeks":case"days":e.hour=0;case"hours":e.minute=0;case"minutes":e.second=0;case"seconds":e.millisecond=0}if("weeks"===i&&(e.weekday=1),"quarters"===i){const t=Math.ceil(this.month/3);e.month=3*(t-1)+1}return this.set(e)}endOf(t){return this.isValid?this.plus({[t]:1}).startOf(t).minus(1):this}toFormat(t,e={}){return this.isValid?Ct.create(this.loc.redefaultToEN(e)).formatDateTimeFromString(this,t):Oi}toLocaleString(t=_,e={}){return this.isValid?Ct.create(this.loc.clone(e),t).formatDateTime(this):Oi}toLocaleParts(t={}){return this.isValid?Ct.create(this.loc.clone(t),t).formatDateTimeParts(this):[]}toISO({format:t="extended",suppressSeconds:e=!1,suppressMilliseconds:i=!1,includeOffset:n=!0,extendedZone:r=!1}={}){if(!this.isValid)return null;const o="extended"===t;let a=Gi(this,o);return a+="T",a+=qi(this,o,e,i,n,r),a}toISODate({format:t="extended"}={}){return this.isValid?Gi(this,"extended"===t):null}toISOWeekDate(){return $i(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:t=!1,suppressSeconds:e=!1,includeOffset:i=!0,includePrefix:n=!1,extendedZone:r=!1,format:o="extended"}={}){if(!this.isValid)return null;return(n?"T":"")+qi(this,"extended"===o,e,t,i,r)}toRFC2822(){return $i(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return $i(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?Gi(this,!0):null}toSQLTime({includeOffset:t=!0,includeZone:e=!1,includeOffsetSpace:i=!0}={}){let n="HH:mm:ss.SSS";return(e||t)&&(i&&(n+=" "),e?n+="z":t&&(n+="ZZ")),$i(this,n,!0)}toSQL(t={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(t)}`:null}toString(){return this.isValid?this.toISO():Oi}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(t={}){if(!this.isValid)return{};const e={...this.c};return t.includeConfig&&(e.outputCalendar=this.outputCalendar,e.numberingSystem=this.loc.numberingSystem,e.locale=this.loc.locale),e}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(t,e="milliseconds",i={}){if(!this.isValid||!t.isValid)return Qe.invalid("created by diffing an invalid DateTime");const n={locale:this.locale,numberingSystem:this.numberingSystem,...i},r=(s=e,Array.isArray(s)?s:[s]).map(Qe.normalizeUnit),o=t.valueOf()>this.valueOf(),a=ri(o?this:t,o?t:this,r,n);var s;return o?a.negate():a}diffNow(t="milliseconds",e={}){return this.diff(rn.now(),t,e)}until(t){return this.isValid?ei.fromDateTimes(this,t):this}hasSame(t,e){if(!this.isValid)return!1;const i=t.valueOf(),n=this.setZone(t.zone,{keepLocalTime:!0});return n.startOf(e)<=i&&i<=n.endOf(e)}equals(t){return this.isValid&&t.isValid&&this.valueOf()===t.valueOf()&&this.zone.equals(t.zone)&&this.loc.equals(t.loc)}toRelative(t={}){if(!this.isValid)return null;const e=t.base||rn.fromObject({},{zone:this.zone}),i=t.padding?thist.valueOf()),Math.min)}static max(...t){if(!t.every(rn.isDateTime))throw new m("max requires all arguments be DateTimes");return G(t,(t=>t.valueOf()),Math.max)}static fromFormatExplain(t,e,i={}){const{locale:n=null,numberingSystem:r=null}=i;return xi(ne.fromOpts({locale:n,numberingSystem:r,defaultToEN:!0}),t,e)}static fromStringExplain(t,e,i={}){return rn.fromFormatExplain(t,e,i)}static get DATE_SHORT(){return _}static get DATE_MED(){return x}static get DATE_MED_WITH_WEEKDAY(){return b}static get DATE_FULL(){return w}static get DATE_HUGE(){return k}static get TIME_SIMPLE(){return E}static get TIME_WITH_SECONDS(){return T}static get TIME_WITH_SHORT_OFFSET(){return S}static get TIME_WITH_LONG_OFFSET(){return C}static get TIME_24_SIMPLE(){return M}static get TIME_24_WITH_SECONDS(){return z}static get TIME_24_WITH_SHORT_OFFSET(){return I}static get TIME_24_WITH_LONG_OFFSET(){return P}static get DATETIME_SHORT(){return A}static get DATETIME_SHORT_WITH_SECONDS(){return D}static get DATETIME_MED(){return O}static get DATETIME_MED_WITH_SECONDS(){return L}static get DATETIME_MED_WITH_WEEKDAY(){return R}static get DATETIME_FULL(){return B}static get DATETIME_FULL_WITH_SECONDS(){return F}static get DATETIME_HUGE(){return j}static get DATETIME_HUGE_WITH_SECONDS(){return N}}function on(t){if(rn.isDateTime(t))return t;if(t&&t.valueOf&&U(t.valueOf()))return rn.fromJSDate(t);if(t&&"object"==typeof t)return rn.fromObject(t);throw new m(`Unknown datetime argument: ${t}, of type ${typeof t}`)}const an={cache:!1,columns:["time","distance","name","location_group","address","region"],conference_providers:{"bluejeans.com":"Bluejeans","freeconference.com":"Free Conference","freeconferencecall.com":"FreeConferenceCall","meet.google.com":"Google Hangouts","gotomeet.me":"GoToMeeting","gotomeeting.com":"GoToMeeting","meet.jit.si":"Jitsi","skype.com":"Skype","webex.com":"WebEx","zoho.com":"Zoho","zoom.us":"Zoom"},defaults:{distance:[],meeting:null,mode:"search",region:[],search:"",time:[],type:[],view:"table",weekday:[],duration:60},distance_options:[1,2,5,10,15,25],distance_unit:"mi",feedback_emails:[],filters:["region","distance","weekday","time","type"],flags:null,in_person_types:["BA","BRK","CAN","CF","AL-AN","AL","FF","OUT","SM","X","XB"],language:"en",map:{markers:{location:{backgroundImage:`url(data:image/svg+xml;base64,${window.btoa('')})`,cursor:"pointer",height:38.4,width:26}},style:"mapbox://styles/mapbox/streets-v9"},now_offset:-10,params:["search","mode","view","meeting"],show:{controls:!0,listButtons:!1,title:!0},strings:{en:{add_to_calendar:"Add to Calendar",address:"Address / Platform",appointment:"Appointment",back_to_meetings:"Back to Meetings",contact_call:"Call %contact%",contact_email:"Email %contact%",contribute_with:"Contribute with %service%",distance:"Distance",distance_any:"Any Distance",email_edit_url:"Edit URL: %url%",email_public_url:"Public URL: %url%",email_subject:"Meeting Feedback: %name%",evening:"Evening",feedback:"Update Meeting Info",friday:"Friday",get_directions:"Get Directions",in_progress_single:"1 meeting in progress",in_progress_multiple:"%count% meetings in progress",location:"Location",location_group:"Location / Group",meeting_information:"Meeting Information",meetings:"Meetings",midday:"Midday",midnight:"Mid",monday:"Monday",morning:"Morning",name:"Name",no_results:"No meetings were found matching the selected criteria.",noon:"Noon",not_found:"Meeting not found.",modes:{location:"Near Location",me:"Near Me",search:"Search"},night:"Night",phone:"Phone",region:"Region",region_any:"Anywhere",remove:"Remove %filter%",saturday:"Saturday",seventh_tradition:"Seventh Tradition",sunday:"Sunday",thursday:"Thursday",time:"Time",time_any:"Any Time",title:{weekday:"%weekday%",time:"%time%",type:"%type%",meetings:"%meetings%",region:"in %region%",search_with:"with %search%",search_near:"near %search%",distance:"within %distance%"},tuesday:"Tuesday",type_any:"Any Type",type_descriptions:{C:"Closed meetings are for A.A. members only, or for those who have a drinking problem and “have a desire to stop drinking.”",O:"Open meetings are available to anyone interested in Alcoholics Anonymous’ program of recovery from alcoholism. Nonalcoholics may attend open meetings as observers."},types:{11:"11th Step Meditation","12x12":"12 Steps & 12 Traditions",active:"Active","AL-AN":"Concurrent with Al-Anon",A:"Secular",ABSI:"As Bill Sees It",AL:"Concurrent with Alateen",ASL:"American Sign Language",B:"Big Book",BA:"Babysitting Available",BE:"Newcomer",BRK:"Breakfast",BI:"Bisexual",C:"Closed",CAN:"Candlelight",CF:"Child-friendly",D:"Discussion",DB:"Digital Basket",DD:"Dual Diagnosis",DR:"Daily Reflections",EN:"English",FF:"Fragrance Free",FR:"French",G:"Gay",GR:"Grapevine",H:"Birthday",HE:"Hebrew",inactive:"Inactive","in-person":"In-person",ITA:"Italian",JA:"Japanese",KOR:"Korean",L:"Lesbian",LGBTQ:"LGBTQ",LIT:"Literature",LS:"Living Sober",M:"Men",MED:"Meditation",N:"Native American",NDG:"Indigenous",O:"Open",online:"Online",OUT:"Outdoor",P:"Professionals",POC:"People of Color",POL:"Polish",POR:"Portuguese",PUN:"Punjabi",RUS:"Russian",S:"Spanish",SEN:"Seniors",SM:"Smoking Permitted",SP:"Speaker",ST:"Step Study",T:"Transgender",TC:"Location Temporarily Closed",TR:"Tradition Study",W:"Women",X:"Wheelchair Access",XB:"Wheelchair-accessible Bathroom",XT:"Cross Talk Permitted",Y:"Young People"},unnamed_meeting:"Unnamed meeting",updated:"Updated %updated%",views:{table:"List",map:"Map"},wednesday:"Wednesday",weekday_any:"Any Day"},es:{add_to_calendar:"Añadir al calendario",address:"Dirección",appointment:"Cita",back_to_meetings:"Volver a las reuniones",contact_call:"Llamar a %contact%",contact_email:"Correo a %contact%",contribute_with:"Contribuya con %service%",distance:"Distancia",distance_any:"Cualquier distancia",email_edit_url:"Editar URL: %url%",email_public_url:"URL pública: %url%",email_subject:"Comentarios de la reunión: %name%",evening:"Noche",feedback:"Actualizar la información de la reunión",friday:"Viernes",get_directions:"Obtener las direcciones",in_progress_single:"1 reunión en curso",in_progress_multiple:"%count% reuniones en curso",location:"Ubicación",location_group:"Ubicación / Grupo",meeting_information:"Información de la reunión",meetings:"Reuniones",midday:"Mediodía",midnight:"Medianoche",monday:"Lunes",morning:"Mañana",name:"Nombre",no_results:"No se encontraron reuniones que coincidieran con los criterios.",noon:"Mediodía",not_found:"Reunión no encontrada.",modes:{location:"Ubicación cercana",me:"Cerca de mí",search:"Buscar"},night:"Noche",phone:"Teléfono",region:"Región",region_any:"Todos lados",remove:"Quitar %filter%",saturday:"Sábado",seventh_tradition:"Séptima Tradición",sunday:"Domingo",thursday:"Jueves",time:"Hora",time_any:"Cualquier momento",title:{weekday:"%weekday%",time:"%time%",type:"%type%",meetings:"%meetings%",region:"en %region%",search_with:"con %search%",search_near:"cerca de %search%",distance:"dentro de %distance%"},tuesday:"Martes",type_any:"Cualquier tipo",type_descriptions:{C:'Las reuniones cerradas son para A.A. solo para miembros, o para aquellos que tienen un problema con la bebida y "desean dejar de beber".',O:"Las reuniones abiertas están disponibles para cualquier persona interesada en el programa de recuperación del alcoholismo de Alcohólicos Anónimos. Los no alcohólicos pueden asistir a reuniones abiertas como observadores."},types:{11:"Meditación del Paso 11","12x12":"12 Pasos y 12 Tradiciones",active:"Activo","AL-AN":"Concurrente con Al-Anon",A:"Secular",ABSI:"Como lo ve Bill",AL:"Concurrente con Alateen",ASL:"Lenguaje por señas",B:"Libro Grande",BA:"Guardería disponible",BE:"Principiantes",BI:"Bisexual",BRK:"Desayuno",C:"Cerrada",CAN:"Luz de una vela",CF:"Niño amigable",D:"Discusión",DB:"Canasta digital",DD:"Diagnóstico dual",DR:"Reflexiones Diarias",EN:"Inglés",FF:"Sin fragancia",FR:"Francés",G:"Gay",GR:"La Viña",H:"Cumpleaños",HE:"Hebreo",inactive:"Inactiva","in-person":"En persona",ITA:"Italiano",JA:"Japonés",KOR:"Coreano",L:"Lesbianas",LGBTQ:"LGBTQ",LIT:"Literatura",LS:"Viviendo Sobrio",M:"Hombres",MED:"Meditación",N:"Nativo Americano",NDG:"Indígena",O:"Abierta",online:"En Línea",OUT:"Al aire libre",P:"Profesionales",POC:"Gente de color",POL:"Polaco",POR:"Portugués",PUN:"Punjabi",RUS:"Ruso",S:"Español",SEN:"Personas mayores",SM:"Se permite fumar",SP:"Orador",ST:"Estudio de pasos",T:"Transgénero",TC:"Ubicación temporalmente cerrada",TR:"Estudio de tradicion",W:"Mujer",X:"Acceso en silla de ruedas",XB:"Baño accesible para sillas de ruedas",XT:"Se permite opinar",Y:"Gente joven"},unnamed_meeting:"Reunión sin nombre",updated:"Actualizado el %updated%",views:{table:"Lista",map:"Mapa"},wednesday:"Miércoles",weekday_any:"Cualquier día"},fr:{add_to_calendar:"Ajouter au calendrier",address:"Adresse",appointment:"Rendez-vous",back_to_meetings:"Retour aux réunions",contact_call:"Appelez %contact%",contact_email:"E-mail à %contact%",contribute_with:"Contribuer avec %service%",distance:"Distance",distance_any:"Toute distance",email_edit_url:"Modifier l’URL : %url%",email_public_url:"URL publique : %url%",email_subject:"Commentaires sur la réunion : %name%",evening:"Soir",feedback:"Mettre à jour les informations sur la réunion",friday:"Vendredi",get_directions:"Obtenir des itinéraires",in_progress_single:"1 réunion en cours",in_progress_multiple:"%count% rendez-vous en cours",location:"Emplacement",location_group:"Emplacement / Groupe",meeting_information:"Informations sur la réunion",meetings:"Rencontres",midday:"Midi",midnight:"Minuit",monday:"Lundi",morning:"Matin",name:"Nom",no_results:"Aucune réunion n'a été trouvée.",noon:"Le midi",not_found:"Réunion introuvable.",modes:{location:"Près de l’emplacement",me:"Proche de moi",search:"Chercher"},night:"Nuit",phone:"Téléphone",region:"Région",region_any:"Partout",remove:"Supprimer %filter%",saturday:"Samedi",seventh_tradition:"Septième tradition",sunday:"Dimanche",thursday:"Jeudi",time:"Temps",time_any:"À tout moment",title:{weekday:"%weekday%",time:"%time%",type:"%type%",meetings:"%meetings%",region:"à %region%",search_with:"avec %search%",search_near:"près de %search%",distance:"à moins de %distance%"},tuesday:"Mardi",type_any:"N’importe quel type",type_descriptions:{C:"Les réunions fermées sont réservées aux AA. membres seulement, ou pour ceux qui ont un problème d’alcool et « ont le désir d’arrêter de boire ».",O:"Des réunions ouvertes sont disponibles pour toute personne intéressée par le programme de rétablissement des Alcooliques anonymes. Les non-alcooliques peuvent assister aux réunions publiques en tant qu’observateurs."},types:{11:"Méditation sur la 11e Étape","12x12":"12 Étapes et 12 Traditions,",active:"Actives","AL-AN":"En même temps qu’Al-Anon",A:"Séculier",ABSI:"Réflexions de Bill",AL:"En même temps qu’Alateen",ASL:"Langage des Signes",B:"Gros Livre",BA:"Garderie d’enfants disponible",BE:"Nouveau/nouvelle",BI:"Bisexuel",BRK:"Petit déjeuner",C:"Fermé",CAN:"À la chandelle",CF:"Enfants acceptés",D:"Discussion",DB:"Panier numérique",DD:"Double diagnostic",DR:"Réflexions quotidiennes",EN:"Anglais",FF:"Sans parfum",FR:"Français",G:"Gai",GR:"Grapevine",H:"Anniversaire",HE:"Hébreu",inactive:"Inactives","in-person":"En personne",ITA:"Italien",JA:"Japonais",KOR:"Coréen",L:"Lesbienne",LGBTQ:"LGBTQ",LIT:"Publications",LS:"Vivre… Sans alcool",M:"Hommes",MED:"Méditation",N:"Autochtone",NDG:"Indigène",O:"Ouvert(e)",online:"En ligne",OUT:"En plein air",P:"Professionnels",POC:"Gens de couleur",POL:"Polonais",POR:"Portugais",PUN:"Pendjabi",RUS:"Russe",S:"Espagnol",SEN:"Séniors",SM:"Permis de fumer",SP:"Conférencier",ST:"Sur les Étapes",T:"Transgenre",TC:"Emplacement temporairement fermé",TR:"Étude des Traditions",W:"Femmes",X:"Accès aux fauteuils roulants",XB:"Toilettes accessibles aux fauteuils roulants",XT:"Conversation croisée permise",Y:"Jeunes"},unnamed_meeting:"Réunion sans nom",updated:"Mis à jour le %updated%",views:{table:"Liste",map:"Carte"},wednesday:"Mercredi",weekday_any:"Tous les jours"}},times:["morning","midday","evening","night"],weekdays:["sunday","monday","tuesday","wednesday","thursday","friday","saturday"]},sn="object"==typeof tsml_react_config?s()(an,tsml_react_config):an;Array.isArray(sn.flags)||(sn.flags=["M","W"]),"object"==typeof tsml_react_config&&Array.isArray(tsml_react_config.columns)&&(sn.columns=tsml_react_config.columns);const ln=navigator.language.substring(0,2),cn=Object.keys(sn.strings).includes(ln)?ln:sn.language,un=sn.strings[cn];function dn(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function hn({formatted_address:t,latitude:e,longitude:i}){if(dn()){const n=e&&i?{daddr:[e,i].join(),q:t}:{daddr:t};return`maps://?${new URLSearchParams(n)}`}return`https://www.google.com/maps/dir/?${new URLSearchParams({api:"1",destination:e&&i?[e,i].join():t})}`}function pn(){const t=Object.assign({},sn.defaults),e=new URLSearchParams(window.location.search);return sn.filters.filter((t=>e.has(t))).forEach((i=>{t[i]=e.get(i).split("/")})),sn.params.filter((t=>e.has(t))).forEach((i=>{t[i]=e.get(i)})),t}function mn(t){const e={};sn.filters.filter((e=>void 0!==t[e])).filter((e=>{var i;return null===(i=t[e])||void 0===i?void 0:i.length})).forEach((i=>{e[i]=t[i].join("/")})),sn.params.filter((e=>void 0!==t[e])).filter((e=>t[e]!==sn.defaults[e])).forEach((i=>{e[i]=t[i]}));const i=new URLSearchParams(e).toString().replace(/%2F/g,"/").replace(/%20/g,"+").replace(/%2C/g,","),[n]=window.location.href.split("?");return`${n}${i.length?`?${i}`:""}`}function fn(t,e){var i;const n=mn({meeting:pn().meeting}),r=["","","","-----",un.email_public_url.replace("%url%",n)];return e.edit_url&&r.push(un.email_edit_url.replace("%url%",e.edit_url)),`mailto:${function(t){if(Array.isArray(t))return t;const e=typeof t;return"string"===e?[t]:"object"===e?Object.values(t):[]}(t).join()}?${new URLSearchParams({subject:un.email_subject.replace("%name%",null!==(i=e.name)&&void 0!==i?i:un.unnamed_meeting),body:r.join("\n")}).toString().replaceAll("+"," ")}`}function gn(t){t=t.trim().toLowerCase();const e="åàáãäâèéëêìíïîòóöôùúüûñç·/_,:;";for(let i=0,n=e.length;i(0,vn.jsx)("path",{fillRule:"evenodd",d:t},e)))})}function xn({className:t,href:e,icon:i,onClick:n,small:r=!1,text:a}){return(0,vn.jsxs)("a",{className:o("align-items-center btn justify-content-center",{"d-flex overflow-hidden":!r,"btn-sm d-inline-flex":r,"cursor-pointer":!(!e&&!n),"btn-outline-secondary":!r&&!t},t),href:e,onClick:n,target:e&&"_blank",children:[i&&(0,vn.jsx)(_n,{icon:i,size:r?18:void 0,className:r?"me-1":"me-2"}),r?a:(0,vn.jsx)("div",{className:"text-truncate",children:a})]})}function bn(t,e){if(!((null==t?void 0:t.latitude)&&(null==e?void 0:e.latitude)&&(null==t?void 0:t.longitude)&&(null==e?void 0:e.longitude)))return null;if(t.latitude===e.latitude&&t.longitude===e.longitude)return 0;{const i=Math.PI*t.latitude/180,n=Math.PI*e.latitude/180,r=Math.PI*(t.longitude-e.longitude)/180;let o=Math.sin(i)*Math.sin(n)+Math.cos(i)*Math.cos(n)*Math.cos(r);return o>1&&(o=1),o=Math.acos(o),o=12436.2*o/Math.PI,"km"===sn.distance_unit&&(o*=1.609344),parseFloat(o.toFixed(2))}}function wn(t,e){return Object.values(t).map((t=>(t.children&&(t.children=wn(t.children,e)),t))).sort(e)}function kn(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function En(t){for(var e=1;e{o[t]={key:t.toString(),name:`${t} ${sn.distance_unit}`,slugs:[]}})),i.forEach((i=>{n.meetings[i]=En(En({},n.meetings[i]),{},{distance:bn({latitude:t,longitude:e},n.meetings[i])}),sn.distance_options.forEach((t=>{n.meetings[i].distance<=t&&o[t].slugs.push(i)}))}));const a=wn(o,((t,e)=>parseInt(t.key)-parseInt(e.key)));n.capabilities.distance=!!a.length,r(En(En({},n),{},{capabilities:n.capabilities,indexes:En(En({},n.indexes),{},{distance:a}),input:En(En({},n.input),{},{latitude:parseFloat(t.toFixed(5)),longitude:parseFloat(e.toFixed(5))}),ready:!0}))}function Cn(t,e){for(const i of t){if(i.key===e)return i;if(i.children){const t=Cn(i.children,e);if(t)return t}}}function Mn(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function zn(t){for(var e=1;e"ONL"!==t)),s=Object.values(un.types),l={};a.forEach((t=>{l[un.types[t]]=t})),t=function(t){const e=[],i=[];return t.forEach(((t,n)=>{Array.isArray(t.day)&&(i.push(n),t.day.forEach((i=>{e.push(zn(zn({},t),{},{day:i,slug:t.slug+"-"+i}))})))})),i.forEach((e=>{t.splice(e,1)})),t.concat(e)}(t),t.forEach((t=>{if(Object.keys(t).filter((t=>!o.includes(t))).forEach((e=>delete t[e])),!t.slug)return void console.warn(`TSML no slug: ${t.edit_url}`);if(t.slug in n)return void console.warn(`TSML UI ${t.slug} duplicate slug: ${t.edit_url}`);if(t.name||(t.name=un.unnamed_meeting),t.conference_provider=t.conference_url?function(t){const e=t.split("/");if(e.length<2)return null;const i=Object.keys(sn.conference_providers).filter((t=>e[2].endsWith(t)));return i.length?sn.conference_providers[i[0]]:null}(t.conference_url):void 0,t.conference_url&&!t.conference_provider&&console.warn(`TSML UI unknown conference_url ${t.conference_url}: ${t.edit_url}`),t.formatted_address||t.city&&(t.formatted_address=t.city,t.address&&(t.formatted_address=t.address+", "+t.formatted_address),t.state&&(t.formatted_address=t.formatted_address+", "+t.state),t.postal_code&&(t.formatted_address=t.formatted_address+" "+t.postal_code),t.country&&(t.formatted_address=t.formatted_address+", "+t.country)),t.address||(t.address=function(t=""){const e=t.split(", ");return e.length>3?e[0]:null}(t.formatted_address)),t.coordinates){const e=t.coordinates.split(",");t.approximate=2!==e.length,t.latitude=t.approximate?null:e[0],t.longitude=t.approximate?null:e[1]}else t.approximate=t.approximate?"yes"===t.approximate.toLowerCase():!t.address;if(t.approximate&&(t.address=null),t.types?"string"==typeof t.types&&(t.types=t.types.split(",").map((t=>t.trim()))):t.types=[],t.isOnline=!!t.conference_provider||!!t.conference_phone,t.isOnline&&t.types.push("online"),t.isTempClosed=t.types.includes("TC")||t.types.includes(un.types.TC),t.isInPerson=!t.isTempClosed&&!t.approximate,t.isActive=t.isOnline||t.isInPerson,t.isInPerson&&t.types.push("in-person"),t.isActive?t.types.push("active"):(e.inactive=!0,t.types.push("inactive")),t.isInPerson||(t.types=t.types.filter((t=>!sn.in_person_types.includes(t)))),!e.location&&(t.isOnline&&t.group||t.isInPerson&&t.location)&&(e.location=!0),t.latitude&&t.longitude&&(t.isInPerson?(e.coordinates=!0,t.latitude=parseFloat(t.latitude),t.longitude=parseFloat(t.longitude)):(t.latitude=null,t.longitude=null)),Number.isInteger(t.day)?t.day=t.day.toString():Array.isArray(t.day)||t.day&&(t.day=t.day.toLowerCase(),sn.weekdays.includes(t.day)&&(t.day=sn.weekdays.indexOf(t.day).toString())),t.day&&t.time){const e="0"===t.day?"7":t.day,[n,o]=t.time.split(":").map((t=>parseInt(t)));if(!t.timezone){if(!i)return void console.warn(`TSML UI ${t.slug} has no timezone: ${t.edit_url}`);t.timezone=i}if(t.start=rn.fromObject({weekday:e,hour:n,minute:o},{zone:t.timezone}),!t.start.isValid)return void console.warn(`TSML UI invalid start time (${t.start.invalid.explanation}): ${t.edit_url}`);if(t.end_time){const i=t.end_time.split(":").map((t=>parseInt(t)));t.end=rn.fromObject({weekday:e,hour:i[0],minute:i[1]},{zone:t.timezone})}else t.end=t.start.plus({minutes:sn.defaults.duration});if(!t.end.isValid)return void console.warn(`TSML UI invalid end time (${t.end.invalid.explanation}): ${t.edit_url}`);const a=t.end.diff(t.start,"minutes").toObject().minutes;if(a>120&&console.warn(`TSML UI ${t.slug} is unusually long (${a} mins): ${t.edit_url}`),i||(t.start=t.start.setZone("local"),t.end&&(t.end=t.end.setZone("local"))),t.isActive){r.weekday.hasOwnProperty(t.day)||(r.weekday[t.day]={key:t.day,name:un[sn.weekdays[t.day]]??un.appointment,slugs:[]}),r.weekday[t.day].slugs.push(t.slug);const e=60*t.start.hour+t.start.minute;t.minutes_week=e+1440*t.day;const i=[];e>=240&&e<720&&i.push(0),e>=660&&e<1020&&i.push(1),e>=960&&e<1260&&i.push(2),(e>=1200||e<300)&&i.push(3),i.forEach((e=>{r.time.hasOwnProperty(e)||(r.time[e]={key:sn.times[e],name:un[sn.times[e]],slugs:[]}),r.time[e].slugs.push(t.slug)}))}}t.regions&&Array.isArray(t.regions)||(t.regions=[],t.region?(t.regions.push(t.region),t.sub_region&&(t.regions.push(t.sub_region),t.sub_sub_region&&t.regions.push(t.sub_sub_region))):t.city&&t.regions.push(t.city)),t.isActive&&t.regions.length&&(r.region=An(t.regions,0,r.region,t.slug)),t.types=Array.isArray(t.types)?t.types.map((t=>"number"==typeof t?t.toString():"string"==typeof t?t.trim():null)).filter((t=>a.includes(t)||s.includes(t))).map((t=>s.includes(t)?l[t]:t)):[];if((t.isActive?t.types:["inactive"]).forEach((e=>{r.type.hasOwnProperty(e)||(r.type[e]={key:gn(un.types[e]),name:un.types[e],slugs:[]}),r.type[e].slugs.push(t.slug)})),t.updated){const e=rn.fromISO(t.updated).setZone(i);t.updated=e.isValid?e.toLocaleString():void 0}t.venmo&&(t.venmo.startsWith("@")||(console.warn(`TSML UI invalid venmo ${t.venmo}: ${t.edit_url}`),t.venmo=null)),t.square&&(t.square.startsWith("$")||(console.warn(`TSML UI invalid square ${t.square}: ${t.edit_url}`),t.square=null)),t.paypal&&(t.paypal.startsWith("https://www.paypal.me")||t.paypal.startsWith("https://paypal.me")||(console.warn(`TSML UI invalid paypal ${t.paypal}: ${t.edit_url}`),t.paypal=null)),t.search=[t.district,t.formatted_address,t.group,t.group_notes,t.location,t.location_notes,t.name,t.notes,t.regions].flat().filter((t=>t)).join("\t").toLowerCase(),n[t.slug]=t})),r.region=wn(r.region,((t,e)=>t.name>e.name?1:e.name>t.name?-1:0)),r.weekday=wn(r.weekday,((t,e)=>parseInt(t.key)-parseInt(e.key))),r.time=wn(r.time,((t,e)=>sn.times.indexOf(t.key)-sn.times.indexOf(e.key))),r.type=wn(r.type,((t,e)=>t.name>e.name?1:e.name>t.name?-1:0));const c=Object.keys(n).length;return["region","weekday","time","type"].forEach((t=>{e[t]=!!r[t].filter((t=>t.slugs.length!==c)).length})),e.inactive||(r.type=r.type.filter((t=>"active"!==t.key)),Object.keys(n).forEach((t=>{n[t]=zn(zn({},n[t]),{},{types:n[t].types.filter((t=>t!==un.types.active))})}))),e.geolocation=navigator.geolocation&&e.coordinates&&("https:"===window.location.protocol||"localhost"===window.location.hostname),[n,r,e]}function An(t,e,i,n){const r=t[e];return i.hasOwnProperty(r)||(i[r]={key:gn(t.slice(0,e+1).join(" ")),name:r,slugs:[],children:{}}),i[r].slugs.push(n),t.length>e+1&&(i[r].children=An(t,e+1,i[r].children,n)),i}function Dn({state:t,setState:e}){return t.error?(0,vn.jsx)("div",{className:"alert alert-danger text-center m-0",children:t.error}):t.alert?(0,vn.jsxs)("div",{className:"d-flex flex-column gap-3",children:[(0,vn.jsx)("div",{className:"alert alert-warning text-center m-0",children:t.alert}),t.alert===un.no_results&&t.input.search&&(0,vn.jsx)(xn,{onClick:()=>{t.input.search="",e(Object.assign({},t))},className:"btn-light btn-outline-secondary",text:un.remove.replace("%filter%",`‘${t.input.search}’`),icon:"close"}),t.alert===un.no_results&&sn.filters.map((i=>t.input[i].map((n=>{var r;return(0,vn.jsx)(xn,{className:"btn-light btn-outline-secondary",onClick:()=>{t.input[i]=t.input[i].filter((t=>t!==n)),e(Object.assign({},t))},text:un.remove.replace("%filter%",null===(r=Cn(t.indexes[i],n))||void 0===r?void 0:r.name),icon:"close"},n)}))))]}):null}function On(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Ln(t){for(var e=1;e{if(t.preventDefault(),i)if(t.metaKey){const t=l.input[e].indexOf(i);-1===t?l.input[e].push(i):l.input[e].splice(t,1)}else l.input[e]=[i];else l.input[e]=[];l.input[e].sort(((t,i)=>l.indexes[e].findIndex((e=>t===e.key))-l.indexes[e].findIndex((t=>i===t.key)))),s(Ln({},l))},h=({key:t,name:e,slugs:n,children:a})=>(0,vn.jsxs)(r.Fragment,{children:[(0,vn.jsxs)("a",{className:o("align-items-center d-flex dropdown-item justify-content-between",{"bg-secondary text-white":u.includes(t)}),href:mn(Ln(Ln({},l.input),{},{[i]:u.includes(t)?[t]:[]})),onClick:e=>d(e,i,t),children:[(0,vn.jsx)("span",{children:e}),(0,vn.jsx)("span",{className:"badge bg-light border ms-3 text-dark",children:n.length})]}),!!a?.length&&(0,vn.jsx)("div",{className:"children",children:a.map((t=>h(t)))})]},t),p={type:["active","in-person","online"]};return(0,vn.jsxs)("div",{className:"dropdown",children:[(0,vn.jsx)("button",{"aria-expanded":n,className:"btn btn-outline-secondary dropdown-toggle w-100",id:i,onClick:()=>a(n?null:i),children:u?.length&&c?.length?u.map((t=>Cn(c,t)?.name)).join(" + "):t}),(0,vn.jsxs)("div",{className:o("dropdown-menu my-1",{show:n,"dropdown-menu-end":e}),"aria-labelledby":i,children:[(0,vn.jsx)("a",{className:o("dropdown-item",{"active bg-secondary text-white":!u.length}),onClick:t=>d(t,i,null),href:mn(Ln(Ln({},l.input),{},{[i]:[]})),children:t}),[c?.filter((t=>p[i]?.includes(t.key))).sort(((t,e)=>p[i]?.indexOf(t.key)-p[i]?.indexOf(e.key))),c?.filter((t=>!p[i]?.includes(t.key)))].filter((t=>t.length)).map(((t,e)=>(0,vn.jsxs)(r.Fragment,{children:[(0,vn.jsx)("div",{className:"dropdown-divider"}),t.map((t=>h(t)))]},e)))]})]})}function Fn({state:t,setState:e,mapbox:i}){const[n,a]=(0,r.useState)(),[s,l]=(0,r.useState)("location"===t.input.mode?t.input.search:""),c=(0,r.useRef)(null),u=["search","location","me"].filter((e=>"location"!==e||t.capabilities.coordinates&&i)).filter((e=>"me"!==e||t.capabilities.coordinates&&t.capabilities.geolocation)),d=sn.filters.filter((e=>t.capabilities[e])).filter((e=>"region"!==e||"me"!==t.input.mode)).filter((e=>"distance"!==e||"search"!==t.input.mode)),h=["table","map"].filter((e=>"map"!==e||t.capabilities.coordinates&&i)),p=h.length>1;(0,r.useEffect)((()=>(document.body.addEventListener("click",m),()=>{document.body.removeEventListener("click",m)})),[document]),(0,r.useEffect)((()=>{const e=setTimeout((()=>{t.input.search&&function({category:t,action:e,label:i}){"function"==typeof gtag?gtag("event",e,{event_category:t,event_label:i}):"function"==typeof ga&&ga("send",{hitType:"event",eventCategory:t,eventAction:e,eventLabel:i})}({category:"search",action:t.input.mode,label:t.input.search})}),2e3);return()=>clearTimeout(e)}),[t.input.search]);const m=t=>{t.target.classList.contains("dropdown-toggle")||a(void 0)};return!!Object.keys(t.meetings).length&&(0,vn.jsxs)("div",{className:"controls d-print-none gx-3 gx-md-4 gy-3 row",children:[(0,vn.jsx)("div",{className:"col-6 col-lg",children:(0,vn.jsxs)("div",{className:"position-relative",children:[(0,vn.jsxs)("form",{className:"input-group",onSubmit:i=>{i.preventDefault(),"location"===t.input.mode&&e(Object.assign(Object.assign({},t),{input:Object.assign(Object.assign({},t.input),{latitude:void 0,longitude:void 0,search:s})}))},children:[(0,vn.jsx)("input",{"aria-label":un.modes[t.input.mode],className:"form-control",disabled:"me"===t.input.mode,onChange:i=>{"search"===t.input.mode?(t.input.search=i.target.value,e(Object.assign({},t))):l(i.target.value)},placeholder:un.modes[t.input.mode],ref:c,spellCheck:"false",type:"search",value:"location"===t.input.mode?s:t.input.search}),u.length>1&&(0,vn.jsx)("button",{id:"mode","aria-label":un.modes[t.input.mode],className:"btn btn-outline-secondary dropdown-toggle",onClick:()=>a("search"===n?void 0:"search"),type:"button"})]}),u.length>1&&(0,vn.jsx)("div",{className:o("dropdown-menu dropdown-menu-end my-1",{show:"search"===n}),children:u.map((i=>(0,vn.jsx)("a",{className:o("align-items-center dropdown-item d-flex justify-content-between",{"active bg-secondary text-white":t.input.mode===i}),href:mn(Object.assign(Object.assign({},t.input),{mode:i})),onClick:n=>((i,n)=>{i.preventDefault(),Object.keys(t.meetings).forEach((e=>{t.meetings[e].distance=void 0})),l(""),setTimeout((()=>{var t;return null===(t=c.current)||void 0===t?void 0:t.focus()}),100),e(Object.assign(Object.assign({},t),{capabilities:Object.assign(Object.assign({},t.capabilities),{distance:!1}),indexes:Object.assign(Object.assign({},t.indexes),{distance:[]}),input:Object.assign(Object.assign({},t.input),{distance:[],latitude:void 0,longitude:void 0,mode:n,search:""})}))})(n,i),children:un.modes[i]},i)))})]})}),d.map(((i,r)=>(0,vn.jsx)("div",{className:"col-6 col-lg",children:(0,vn.jsx)(Bn,{defaultValue:un[`${i}_any`],end:!p&&r===d.length-1,filter:i,open:n===i,setDropdown:a,state:t,setState:e})},i))),p&&(0,vn.jsx)("div",{className:"col-6 col-lg",children:(0,vn.jsx)("div",{className:"btn-group h-100 w-100",role:"group",children:h.map((i=>(0,vn.jsx)("button",{"aria-label":un.views[i],className:o("align-items-center btn btn-outline-secondary d-flex justify-content-center w-100",{active:t.input.view===i}),onClick:n=>((i,n)=>{i.preventDefault(),t.input.view=n,e(Object.assign({},t))})(n,i),type:"button",children:(0,vn.jsx)(_n,{icon:i})},i)))})})]})}function jn(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Nn(t){for(var e=1;ee.types.includes(t))).map((t=>un.types[t])).sort().join(", ");return t&&i?(0,vn.jsxs)(vn.Fragment,{children:[(0,vn.jsx)("a",{href:mn(Nn(Nn({},t.input),{},{meeting:e.slug})),onClick:n=>{n.preventDefault(),n.stopPropagation(),i(Nn(Nn({},t),{},{input:Nn(Nn({},t.input),{},{meeting:e.slug})}))},children:e.name}),n&&(0,vn.jsx)("small",{className:"ms-2 text-muted",children:n})]}):n?(0,vn.jsxs)(vn.Fragment,{children:[(0,vn.jsx)("span",{children:e.name}),(0,vn.jsx)("small",{className:"ms-2 text-muted",children:n})]}):e.name}function Zn(){return(0,vn.jsx)("div",{className:"align-items-center d-flex flex-grow-1 h-100 justify-content-center loading",children:(0,vn.jsx)("div",{className:"m-5 spinner-border text-secondary"})})}function $n(){return $n=Object.assign||function(t){for(var e=1;et.length)&&(e=t.length);for(var i=0,n=new Array(e);ii?i:t}const rr=Math.log2||function(t){return Math.log(t)*Math.LOG2E};function or(t,e,i){var n=e[0],r=e[1],o=e[2],a=e[3],s=e[4],l=e[5],c=e[6],u=e[7],d=e[8],h=e[9],p=e[10],m=e[11],f=e[12],g=e[13],v=e[14],y=e[15],_=i[0],x=i[1],b=i[2],w=i[3];return t[0]=_*n+x*s+b*d+w*f,t[1]=_*r+x*l+b*h+w*g,t[2]=_*o+x*c+b*p+w*v,t[3]=_*a+x*u+b*m+w*y,_=i[4],x=i[5],b=i[6],w=i[7],t[4]=_*n+x*s+b*d+w*f,t[5]=_*r+x*l+b*h+w*g,t[6]=_*o+x*c+b*p+w*v,t[7]=_*a+x*u+b*m+w*y,_=i[8],x=i[9],b=i[10],w=i[11],t[8]=_*n+x*s+b*d+w*f,t[9]=_*r+x*l+b*h+w*g,t[10]=_*o+x*c+b*p+w*v,t[11]=_*a+x*u+b*m+w*y,_=i[12],x=i[13],b=i[14],w=i[15],t[12]=_*n+x*s+b*d+w*f,t[13]=_*r+x*l+b*h+w*g,t[14]=_*o+x*c+b*p+w*v,t[15]=_*a+x*u+b*m+w*y,t}function ar(t,e,i){var n,r,o,a,s,l,c,u,d,h,p,m,f=i[0],g=i[1],v=i[2];return e===t?(t[12]=e[0]*f+e[4]*g+e[8]*v+e[12],t[13]=e[1]*f+e[5]*g+e[9]*v+e[13],t[14]=e[2]*f+e[6]*g+e[10]*v+e[14],t[15]=e[3]*f+e[7]*g+e[11]*v+e[15]):(n=e[0],r=e[1],o=e[2],a=e[3],s=e[4],l=e[5],c=e[6],u=e[7],d=e[8],h=e[9],p=e[10],m=e[11],t[0]=n,t[1]=r,t[2]=o,t[3]=a,t[4]=s,t[5]=l,t[6]=c,t[7]=u,t[8]=d,t[9]=h,t[10]=p,t[11]=m,t[12]=n*f+s*g+d*v+e[12],t[13]=r*f+l*g+h*v+e[13],t[14]=o*f+c*g+p*v+e[14],t[15]=a*f+u*g+m*v+e[15]),t}function sr(t,e,i){var n=i[0],r=i[1],o=i[2];return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*o,t[9]=e[9]*o,t[10]=e[10]*o,t[11]=e[11]*o,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function lr(t,e){var i=t[0],n=t[1],r=t[2],o=t[3],a=t[4],s=t[5],l=t[6],c=t[7],u=t[8],d=t[9],h=t[10],p=t[11],m=t[12],f=t[13],g=t[14],v=t[15],y=e[0],_=e[1],x=e[2],b=e[3],w=e[4],k=e[5],E=e[6],T=e[7],S=e[8],C=e[9],M=e[10],z=e[11],I=e[12],P=e[13],A=e[14],D=e[15];return Math.abs(i-y)<=Kn*Math.max(1,Math.abs(i),Math.abs(y))&&Math.abs(n-_)<=Kn*Math.max(1,Math.abs(n),Math.abs(_))&&Math.abs(r-x)<=Kn*Math.max(1,Math.abs(r),Math.abs(x))&&Math.abs(o-b)<=Kn*Math.max(1,Math.abs(o),Math.abs(b))&&Math.abs(a-w)<=Kn*Math.max(1,Math.abs(a),Math.abs(w))&&Math.abs(s-k)<=Kn*Math.max(1,Math.abs(s),Math.abs(k))&&Math.abs(l-E)<=Kn*Math.max(1,Math.abs(l),Math.abs(E))&&Math.abs(c-T)<=Kn*Math.max(1,Math.abs(c),Math.abs(T))&&Math.abs(u-S)<=Kn*Math.max(1,Math.abs(u),Math.abs(S))&&Math.abs(d-C)<=Kn*Math.max(1,Math.abs(d),Math.abs(C))&&Math.abs(h-M)<=Kn*Math.max(1,Math.abs(h),Math.abs(M))&&Math.abs(p-z)<=Kn*Math.max(1,Math.abs(p),Math.abs(z))&&Math.abs(m-I)<=Kn*Math.max(1,Math.abs(m),Math.abs(I))&&Math.abs(f-P)<=Kn*Math.max(1,Math.abs(f),Math.abs(P))&&Math.abs(g-A)<=Kn*Math.max(1,Math.abs(g),Math.abs(A))&&Math.abs(v-D)<=Kn*Math.max(1,Math.abs(v),Math.abs(D))}function cr(t,e,i){return t[0]=e[0]+i[0],t[1]=e[1]+i[1],t}function ur(t){var e=t[0],i=t[1];return Math.hypot(e,i)}function dr(t,e,i,n){var r=e[0],o=e[1];return t[0]=r+n*(i[0]-r),t[1]=o+n*(i[1]-o),t}var hr=function(t,e,i){return t[0]=e[0]-i[0],t[1]=e[1]-i[1],t};!function(){var t=function(){var t=new Jn(2);return Jn!=Float32Array&&(t[0]=0,t[1]=0),t}()}();var pr=function(t,e,i){return t[0]=e[0]*i[0],t[1]=e[1]*i[1],t[2]=e[2]*i[2],t};!function(){var t=function(){var t=new Jn(3);return Jn!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}()}();function mr(t,e){if(!t)throw new Error(e||"@math.gl/web-mercator: assertion failed.")}const fr=Math.PI,gr=fr/4,vr=fr/180,yr=180/fr,_r=512,xr=85.051129;function br(t){return Math.pow(2,t)}function wr(t){return rr(t)}function kr([t,e]){mr(Number.isFinite(t)),mr(Number.isFinite(e)&&e>=-90&&e<=90,"invalid latitude");const i=e*vr;return[_r*(t*vr+fr)/(2*fr),_r*(fr+Math.log(Math.tan(gr+.5*i)))/(2*fr)]}function Er([t,e]){const i=t/_r*(2*fr)-fr,n=2*(Math.atan(Math.exp(e/_r*(2*fr)-fr))-gr);return[i*yr,n*yr]}function Tr({latitude:t,longitude:e,highPrecision:i=!1}){mr(Number.isFinite(t)&&Number.isFinite(e));const n={},r=Math.cos(t*vr),o=512/360,a=o/r,s=12790407194604047e-21/r;if(n.unitsPerMeter=[s,s,s],n.metersPerUnit=[1/s,1/s,1/s],n.unitsPerDegree=[o,a,s],n.degreesPerUnit=[.703125,1/a,1/s],i){const e=vr*Math.tan(t*vr)/r,i=o*e/2,l=12790407194604047e-21*e,c=l/a*s;n.unitsPerDegree2=[0,i,l],n.unitsPerMeter2=[c,0,c]}return n}function Sr({height:t,pitch:e,bearing:i,altitude:n,scale:r,center:o=null}){const a=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];return ar(a,a,[0,0,-n]),function(t,e,i){var n=Math.sin(i),r=Math.cos(i),o=e[4],a=e[5],s=e[6],l=e[7],c=e[8],u=e[9],d=e[10],h=e[11];e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=o*r+c*n,t[5]=a*r+u*n,t[6]=s*r+d*n,t[7]=l*r+h*n,t[8]=c*r-o*n,t[9]=u*r-a*n,t[10]=d*r-s*n,t[11]=h*r-l*n}(a,a,-e*vr),function(t,e,i){var n=Math.sin(i),r=Math.cos(i),o=e[0],a=e[1],s=e[2],l=e[3],c=e[4],u=e[5],d=e[6],h=e[7];e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*r+c*n,t[1]=a*r+u*n,t[2]=s*r+d*n,t[3]=l*r+h*n,t[4]=c*r-o*n,t[5]=u*r-a*n,t[6]=d*r-s*n,t[7]=h*r-l*n}(a,a,i*vr),sr(a,a,[r/=t,r,r]),o&&ar(a,a,function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t}([],o)),a}function Cr({width:t,height:e,pitch:i,altitude:n,fovy:r,nearZMultiplier:o,farZMultiplier:a}){const{fov:s,aspect:l,near:c,far:u}=function({width:t,height:e,fovy:i=Mr(1.5),altitude:n,pitch:r=0,nearZMultiplier:o=1,farZMultiplier:a=1}){void 0!==n&&(i=Mr(n));const s=.5*i*vr,l=zr(i),c=r*vr,u=Math.sin(s)*l/Math.sin(Math.min(Math.max(Math.PI/2-c-s,.01),Math.PI-.01));return{fov:2*s,aspect:t/e,focalDistance:l,near:o,far:(Math.sin(c)*u+l)*a}}({width:t,height:e,altitude:n,fovy:r,pitch:i,nearZMultiplier:o,farZMultiplier:a}),d=function(t,e,i,n,r){var o,a=1/Math.tan(e/2);return t[0]=a/i,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=r&&r!==1/0?(o=1/(n-r),t[10]=(r+n)*o,t[14]=2*r*n*o):(t[10]=-1,t[14]=-2*n),t}([],s,l,c,u);return d}function Mr(t){return 2*Math.atan(.5/t)*yr}function zr(t){return.5/Math.tan(.5*t*vr)}function Ir(t,e,i=0){const[n,r,o]=t;if(mr(Number.isFinite(n)&&Number.isFinite(r),"invalid pixel coordinate"),Number.isFinite(o)){return er(e,[n,r,o,1])}const a=er(e,[n,r,0,1]),s=er(e,[n,r,1,1]),l=a[2],c=s[2];return dr([],a,s,l===c?0:((i||0)-l)/(c-l))}const Pr=Math.PI/180;function Ar(t,e,i){const{pixelUnprojectionMatrix:n}=t,r=er(n,[e,0,1,1]),o=er(n,[e,t.height,1,1]),a=Er(dr([],r,o,(i*t.distanceScales.unitsPerMeter[2]-r[2])/(o[2]-r[2])));return a[2]=i,a}class Dr{constructor({width:t,height:e,latitude:i=0,longitude:n=0,zoom:r=0,pitch:o=0,bearing:a=0,altitude:s=null,fovy:l=null,position:c=null,nearZMultiplier:u=.02,farZMultiplier:d=1.01}={width:1,height:1}){t=t||1,e=e||1,null===l&&null===s?l=Mr(s=1.5):null===l?l=Mr(s):null===s&&(s=zr(l));const h=br(r);s=Math.max(.75,s);const p=Tr({longitude:n,latitude:i}),m=kr([n,i]);m[2]=0,c&&function(t,e,i){t[0]=e[0]+i[0],t[1]=e[1]+i[1],t[2]=e[2]+i[2]}(m,m,pr([],c,p.unitsPerMeter)),this.projectionMatrix=Cr({width:t,height:e,pitch:o,fovy:l,nearZMultiplier:u,farZMultiplier:d}),this.viewMatrix=Sr({height:e,scale:h,center:m,pitch:o,bearing:a,altitude:s}),this.width=t,this.height=e,this.scale=h,this.latitude=i,this.longitude=n,this.zoom=r,this.pitch=o,this.bearing=a,this.altitude=s,this.fovy=l,this.center=m,this.meterOffset=c||[0,0,0],this.distanceScales=p,this._initMatrices(),this.equals=this.equals.bind(this),this.project=this.project.bind(this),this.unproject=this.unproject.bind(this),this.projectPosition=this.projectPosition.bind(this),this.unprojectPosition=this.unprojectPosition.bind(this),Object.freeze(this)}_initMatrices(){const{width:t,height:e,projectionMatrix:i,viewMatrix:n}=this,r=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];or(r,r,i),or(r,r,n),this.viewProjectionMatrix=r;const o=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];sr(o,o,[t/2,-e/2,1]),ar(o,o,[1,-1,0]),or(o,o,r);const a=function(t,e){var i=e[0],n=e[1],r=e[2],o=e[3],a=e[4],s=e[5],l=e[6],c=e[7],u=e[8],d=e[9],h=e[10],p=e[11],m=e[12],f=e[13],g=e[14],v=e[15],y=i*s-n*a,_=i*l-r*a,x=i*c-o*a,b=n*l-r*s,w=n*c-o*s,k=r*c-o*l,E=u*f-d*m,T=u*g-h*m,S=u*v-p*m,C=d*g-h*f,M=d*v-p*f,z=h*v-p*g,I=y*z-_*M+x*C+b*S-w*T+k*E;return I?(I=1/I,t[0]=(s*z-l*M+c*C)*I,t[1]=(r*M-n*z-o*C)*I,t[2]=(f*k-g*w+v*b)*I,t[3]=(h*w-d*k-p*b)*I,t[4]=(l*S-a*z-c*T)*I,t[5]=(i*z-r*S+o*T)*I,t[6]=(g*x-m*k-v*_)*I,t[7]=(u*k-h*x+p*_)*I,t[8]=(a*M-s*S+c*E)*I,t[9]=(n*S-i*M-o*E)*I,t[10]=(m*w-f*x+v*y)*I,t[11]=(d*x-u*w-p*y)*I,t[12]=(s*T-a*C-l*E)*I,t[13]=(i*C-n*T+r*E)*I,t[14]=(f*_-m*b-g*y)*I,t[15]=(u*b-d*_+h*y)*I,t):null}([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],o);if(!a)throw new Error("Pixel project matrix not invertible");this.pixelProjectionMatrix=o,this.pixelUnprojectionMatrix=a}equals(t){return t instanceof Dr&&(t.width===this.width&&t.height===this.height&&lr(t.projectionMatrix,this.projectionMatrix)&&lr(t.viewMatrix,this.viewMatrix))}project(t,{topLeft:e=!0}={}){const i=function(t,e){const[i,n,r=0]=t;return mr(Number.isFinite(i)&&Number.isFinite(n)&&Number.isFinite(r)),er(e,[i,n,r,1])}(this.projectPosition(t),this.pixelProjectionMatrix),[n,r]=i,o=e?r:this.height-r;return 2===t.length?[n,o]:[n,o,i[2]]}unproject(t,{topLeft:e=!0,targetZ:i}={}){const[n,r,o]=t,a=e?r:this.height-r,s=i&&i*this.distanceScales.unitsPerMeter[2],l=Ir([n,a,o],this.pixelUnprojectionMatrix,s),[c,u,d]=this.unprojectPosition(l);return Number.isFinite(o)?[c,u,d]:Number.isFinite(i)?[c,u,i]:[c,u]}projectPosition(t){const[e,i]=kr(t);return[e,i,(t[2]||0)*this.distanceScales.unitsPerMeter[2]]}unprojectPosition(t){const[e,i]=Er(t);return[e,i,(t[2]||0)*this.distanceScales.metersPerUnit[2]]}projectFlat(t){return kr(t)}unprojectFlat(t){return Er(t)}getMapCenterByLngLatPosition({lngLat:t,pos:e}){const i=Ir(e,this.pixelUnprojectionMatrix),n=cr([],kr(t),function(t,e){return t[0]=-e[0],t[1]=-e[1],t}([],i));return Er(cr([],this.center,n))}getLocationAtPoint({lngLat:t,pos:e}){return this.getMapCenterByLngLatPosition({lngLat:t,pos:e})}fitBounds(t,e={}){const{width:i,height:n}=this,{longitude:r,latitude:o,zoom:a}=function({width:t,height:e,bounds:i,minExtent:n=0,maxZoom:r=24,padding:o=0,offset:a=[0,0]}){const[[s,l],[c,u]]=i;Number.isFinite(o)?o={top:o,bottom:o,left:o,right:o}:mr(Number.isFinite(o.top)&&Number.isFinite(o.bottom)&&Number.isFinite(o.left)&&Number.isFinite(o.right));const d=kr([s,nr(u,-85.051129,xr)]),h=kr([c,nr(l,-85.051129,xr)]),p=[Math.max(Math.abs(h[0]-d[0]),n),Math.max(Math.abs(h[1]-d[1]),n)],m=[t-o.left-o.right-2*Math.abs(a[0]),e-o.top-o.bottom-2*Math.abs(a[1])];mr(m[0]>0&&m[1]>0);const f=m[0]/p[0],g=m[1]/p[1],v=(o.right-o.left)/2/f,y=(o.bottom-o.top)/2/g,_=Er([(h[0]+d[0])/2+v,(h[1]+d[1])/2+y]),x=Math.min(r,rr(Math.abs(Math.min(f,g))));return mr(Number.isFinite(x)),{longitude:_[0],latitude:_[1],zoom:x}}(Object.assign({width:i,height:n,bounds:t},e));return new Dr({width:i,height:n,longitude:r,latitude:o,zoom:a})}getBounds(t){const e=this.getBoundingRegion(t),i=Math.min(...e.map((t=>t[0]))),n=Math.max(...e.map((t=>t[0])));return[[i,Math.min(...e.map((t=>t[1])))],[n,Math.max(...e.map((t=>t[1])))]]}getBoundingRegion(t={}){return function(t,e=0){const{width:i,height:n,unproject:r}=t,o={targetZ:e},a=r([0,n],o),s=r([i,n],o);let l,c;return(t.fovy?.5*t.fovy*Pr:Math.atan(.5/t.altitude))>(90-t.pitch)*Pr-.01?(l=Ar(t,0,e),c=Ar(t,i,e)):(l=r([0,0],o),c=r([i,0],o)),[a,s,c,l]}(this,t.z||0)}}const Or=["longitude","latitude","zoom"],Lr={curve:1.414,speed:1.2};function Rr(t,e,i){const n=(i=Object.assign({},Lr,i)).curve,r=t.zoom,o=[t.longitude,t.latitude],a=br(r),s=e.zoom,l=[e.longitude,e.latitude],c=br(s-r),u=kr(o),d=kr(l),h=hr([],d,u),p=Math.max(t.width,t.height),m=p/c,f=ur(h)*a,g=Math.max(f,.01),v=n*n,y=(m*m-p*p+v*v*g*g)/(2*p*v*g),_=(m*m-p*p-v*v*g*g)/(2*m*v*g),x=Math.log(Math.sqrt(y*y+1)-y),b=Math.log(Math.sqrt(_*_+1)-_);return{startZoom:r,startCenterXY:u,uDelta:h,w0:p,u1:f,S:(b-x)/n,rho:n,rho2:v,r0:x,r1:b}}var Br=function(){if("undefined"!=typeof Map)return Map;function t(t,e){var i=-1;return t.some((function(t,n){return t[0]===e&&(i=n,!0)})),i}return function(){function e(){this.__entries__=[]}return Object.defineProperty(e.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),e.prototype.get=function(e){var i=t(this.__entries__,e),n=this.__entries__[i];return n&&n[1]},e.prototype.set=function(e,i){var n=t(this.__entries__,e);~n?this.__entries__[n][1]=i:this.__entries__.push([e,i])},e.prototype.delete=function(e){var i=this.__entries__,n=t(i,e);~n&&i.splice(n,1)},e.prototype.has=function(e){return!!~t(this.__entries__,e)},e.prototype.clear=function(){this.__entries__.splice(0)},e.prototype.forEach=function(t,e){void 0===e&&(e=null);for(var i=0,n=this.__entries__;i0},t.prototype.connect_=function(){Fr&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),Ur?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},t.prototype.disconnect_=function(){Fr&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},t.prototype.onTransitionEnd_=function(t){var e=t.propertyName,i=void 0===e?"":e;Vr.some((function(t){return!!~i.indexOf(t)}))&&this.refresh()},t.getInstance=function(){return this.instance_||(this.instance_=new t),this.instance_},t.instance_=null,t}(),$r=function(t,e){for(var i=0,n=Object.keys(e);i0},t}(),io="undefined"!=typeof WeakMap?new WeakMap:new Br,no=function t(e){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var i=Zr.getInstance(),n=new eo(e,i,this);io.set(this,n)};["observe","unobserve","disconnect"].forEach((function(t){no.prototype[t]=function(){var e;return(e=io.get(this))[t].apply(e,arguments)}}));const ro=void 0!==jr.ResizeObserver?jr.ResizeObserver:no;function oo(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ao(t,e){for(var i=0;i=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){i=t[Symbol.iterator]()},n:function(){var t=i.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==i.return||i.return()}finally{if(s)throw o}}}}function po(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i1&&void 0!==arguments[1]?arguments[1]:"component";t.debug&&Xn.checkPropTypes(vo,t,"prop",e)}var xo=function(){function t(e){var i=this;if(oo(this,t),Hn(this,"props",yo),Hn(this,"width",0),Hn(this,"height",0),Hn(this,"_fireLoadEvent",(function(){i.props.onLoad({type:"load",target:i._map})})),Hn(this,"_handleError",(function(t){i.props.onError(t)})),!e.mapboxgl)throw new Error("Mapbox not available");this.mapboxgl=e.mapboxgl,t.initialized||(t.initialized=!0,this._checkStyleSheet(this.mapboxgl.version)),this._initialize(e)}return so(t,[{key:"finalize",value:function(){return this._destroy(),this}},{key:"setProps",value:function(t){return this._update(this.props,t),this}},{key:"redraw",value:function(){var t=this._map;t.style&&(t._frame&&(t._frame.cancel(),t._frame=null),t._render())}},{key:"getMap",value:function(){return this._map}},{key:"_reuse",value:function(e){this._map=t.savedMap;var i=this._map.getContainer(),n=e.container;for(n.classList.add("mapboxgl-map");i.childNodes.length>0;)n.appendChild(i.childNodes[0]);this._map._container=n,t.savedMap=null,e.mapStyle&&this._map.setStyle(fo(e.mapStyle),{diff:!1}),this._map.isStyleLoaded()?this._fireLoadEvent():this._map.once("styledata",this._fireLoadEvent)}},{key:"_create",value:function(e){if(e.reuseMaps&&t.savedMap)this._reuse(e);else{if(e.gl){var i=HTMLCanvasElement.prototype.getContext;HTMLCanvasElement.prototype.getContext=function(){return HTMLCanvasElement.prototype.getContext=i,e.gl}}var n={container:e.container,center:[0,0],zoom:8,pitch:0,bearing:0,maxZoom:24,style:fo(e.mapStyle),interactive:!1,trackResize:!1,attributionControl:e.attributionControl,preserveDrawingBuffer:e.preserveDrawingBuffer};e.transformRequest&&(n.transformRequest=e.transformRequest),this._map=new this.mapboxgl.Map(Object.assign({},n,e.mapOptions)),this._map.once("load",this._fireLoadEvent),this._map.on("error",this._handleError)}return this}},{key:"_destroy",value:function(){this._map&&(this.props.reuseMaps&&!t.savedMap?(t.savedMap=this._map,this._map.off("load",this._fireLoadEvent),this._map.off("error",this._handleError),this._map.off("styledata",this._fireLoadEvent)):this._map.remove(),this._map=null)}},{key:"_initialize",value:function(t){var e=this;_o(t=Object.assign({},yo,t),"Mapbox"),this.mapboxgl.accessToken=t.mapboxApiAccessToken||yo.mapboxApiAccessToken,this.mapboxgl.baseApiUrl=t.mapboxApiUrl,this._create(t);var i=t.container;Object.defineProperty(i,"offsetWidth",{configurable:!0,get:function(){return e.width}}),Object.defineProperty(i,"clientWidth",{configurable:!0,get:function(){return e.width}}),Object.defineProperty(i,"offsetHeight",{configurable:!0,get:function(){return e.height}}),Object.defineProperty(i,"clientHeight",{configurable:!0,get:function(){return e.height}});var n=this._map.getCanvas();n&&(n.style.outline="none"),this._updateMapViewport({},t),this._updateMapSize({},t),this.props=t}},{key:"_update",value:function(t,e){if(this._map){_o(e=Object.assign({},this.props,e),"Mapbox");var i=this._updateMapViewport(t,e),n=this._updateMapSize(t,e);this._updateMapStyle(t,e),e.asyncRender||!i&&!n||this.redraw(),this.props=e}}},{key:"_updateMapStyle",value:function(t,e){t.mapStyle!==e.mapStyle&&this._map.setStyle(fo(e.mapStyle),{diff:!e.preventStyleDiffing})}},{key:"_updateMapSize",value:function(t,e){var i=t.width!==e.width||t.height!==e.height;return i&&(this.width=e.width,this.height=e.height,this._map.resize()),i}},{key:"_updateMapViewport",value:function(t,e){var i=this._getViewState(t),n=this._getViewState(e),r=n.latitude!==i.latitude||n.longitude!==i.longitude||n.zoom!==i.zoom||n.pitch!==i.pitch||n.bearing!==i.bearing||n.altitude!==i.altitude;return r&&(this._map.jumpTo(this._viewStateToMapboxProps(n)),n.altitude!==i.altitude&&(this._map.transform.altitude=n.altitude)),r}},{key:"_getViewState",value:function(t){var e=t.viewState||t,i=e.longitude,n=e.latitude,r=e.zoom,o=e.pitch,a=void 0===o?0:o,s=e.bearing,l=void 0===s?0:s,c=e.altitude;return{longitude:i,latitude:n,zoom:r,pitch:a,bearing:l,altitude:void 0===c?1.5:c}}},{key:"_checkStyleSheet",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"0.47.0";if(void 0!==lo)try{var e=lo.createElement("div");e.className="mapboxgl-map",e.style.display="none",lo.body.appendChild(e);var i="static"!==window.getComputedStyle(e).position;if(!i){var n=lo.createElement("link");n.setAttribute("rel","stylesheet"),n.setAttribute("type","text/css"),n.setAttribute("href","https://api.tiles.mapbox.com/mapbox-gl-js/v".concat(t,"/mapbox-gl.css")),lo.head.appendChild(n)}}catch(t){}}},{key:"_viewStateToMapboxProps",value:function(t){return{center:[t.longitude,t.latitude],zoom:t.zoom,bearing:t.bearing,pitch:t.pitch}}}]),t}();Hn(xo,"initialized",!1),Hn(xo,"propTypes",vo),Hn(xo,"defaultProps",yo),Hn(xo,"savedMap",null);var bo=i(158),wo=i.n(bo);function ko(t){return Array.isArray(t)||ArrayBuffer.isView(t)}function Eo(t,e){if(t===e)return!0;if(ko(t)&&ko(e)){if(t.length!==e.length)return!1;for(var i=0;i0,"`scale` must be a positive number");var r=this._state,o=r.startZoom,a=r.startZoomLngLat;Number.isFinite(o)||(o=this._viewportProps.zoom,a=this._unproject(i)||this._unproject(e)),Co(a,"`startZoomLngLat` prop is required for zoom behavior to calculate where to position the map.");var s=this._calculateNewZoom({scale:n,startZoom:o||0}),l=Yn(new Dr(Object.assign({},this._viewportProps,{zoom:s})).getMapCenterByLngLatPosition({lngLat:a,pos:e}),2),c=l[0],u=l[1];return this._getUpdatedMapState({zoom:s,longitude:c,latitude:u})}},{key:"zoomEnd",value:function(){return this._getUpdatedMapState({startZoomLngLat:null,startZoom:null})}},{key:"_getUpdatedMapState",value:function(e){return new t(Object.assign({},this._viewportProps,this._state,e))}},{key:"_applyConstraints",value:function(t){var e=t.maxZoom,i=t.minZoom,n=t.zoom;t.zoom=To(n,i,e);var r=t.maxPitch,o=t.minPitch,a=t.pitch;return t.pitch=To(a,o,r),Object.assign(t,function({width:t,height:e,longitude:i,latitude:n,zoom:r,pitch:o=0,bearing:a=0}){(i<-180||i>180)&&(i=ir(i+180,360)-180),(a<-180||a>180)&&(a=ir(a+180,360)-180);const s=rr(e/512);if(r<=s)r=s,n=0;else{const t=e/2/Math.pow(2,r),i=Er([0,t])[1];if(ne&&(n=e)}}return{width:t,height:e,longitude:i,latitude:n,zoom:r,pitch:o,bearing:a}}(t)),t}},{key:"_unproject",value:function(t){var e=new Dr(this._viewportProps);return t&&e.unproject(t)}},{key:"_calculateNewLngLat",value:function(t){var e=t.startPanLngLat,i=t.pos;return new Dr(this._viewportProps).getMapCenterByLngLatPosition({lngLat:e,pos:i})}},{key:"_calculateNewZoom",value:function(t){var e=t.scale,i=t.startZoom,n=this._viewportProps,r=n.maxZoom,o=n.minZoom;return To(i+Math.log2(e),o,r)}},{key:"_calculateNewPitchAndBearing",value:function(t){var e=t.deltaScaleX,i=t.deltaScaleY,n=t.startBearing,r=t.startPitch;i=To(i,-1,1);var o=this._viewportProps,a=o.minPitch,s=o.maxPitch,l=r;return i>0?l=r+i*(s-r):i<0&&(l=r-i*(a-r)),{pitch:l,bearing:n+180*e}}},{key:"_getRotationParams",value:function(t,e){var i=t[0]-e[0],n=t[1]-e[1],r=t[1],o=e[1],a=this._viewportProps,s=a.width,l=a.height,c=i/s,u=0;return n>0?Math.abs(l-o)>5&&(u=n/(o-l)*1.2):n<0&&o>5&&(u=1-r/o),{deltaScaleX:c,deltaScaleY:u=Math.min(1,Math.max(-1,u))}}}]),t}();function Lo(t){return t[0].toLowerCase()+t.slice(1)}function Ro(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Bo(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:{},n=t.current&&t.current.getMap();return n&&n.queryRenderedFeatures(e,i)}}}(c)}),[]);var f=(0,r.useCallback)((function(t){var e=t.target;e===h.current&&e.scrollTo(0,0)}),[]),g=m&&r.createElement(jo,{value:$o($o({},p),{},{viewport:p.viewport||qo($o({map:m,props:t},s)),map:m,container:p.container||d.current})},r.createElement("div",{key:"map-overlays",className:"overlays",ref:h,style:Wo,onScroll:f},t.children)),v=t.className,y=t.width,_=t.height,x=t.style,b=t.visibilityConstraints,w=Object.assign({position:"relative"},x,{width:y,height:_}),k=t.visible&&function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Io;for(var i in e){var n=i.slice(0,3),r=Lo(i.slice(3));if("min"===n&&t[r]e[i])return!1}return!0}(t.viewState||t,b),E=Object.assign({},Wo,{visibility:k?"inherit":"hidden"});return r.createElement("div",{key:"map-container",ref:d,style:w},r.createElement("div",{key:"map-mapbox",ref:u,style:E,className:v}),g,!n&&!t.disableTokenWarning&&r.createElement(Yo,null))}));Ko.supported=function(){return wo()&&wo().supported()},Ko.propTypes=Ho,Ko.defaultProps=Xo;const Jo=Ko;function Qo(t,e){var i;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(i=function(t,e){if(!t)return;if("string"==typeof t)return ta(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);"Object"===i&&t.constructor&&(i=t.constructor.name);if("Map"===i||"Set"===i)return Array.from(t);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return ta(t,e)}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,r=function(){};return{s:r,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){i=t[Symbol.iterator]()},n:function(){var t=i.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==i.return||i.return()}finally{if(s)throw o}}}}function ta(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i180&&(i=i<0?i+360:i-360),i}function da(t,e){var i;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(i=function(t,e){if(!t)return;if("string"==typeof t)return ha(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);"Object"===i&&t.constructor&&(i=t.constructor.name);if("Map"===i||"Set"===i)return Array.from(t);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return ha(t,e)}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,r=function(){};return{s:r,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){i=t[Symbol.iterator]()},n:function(){var t=i.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==i.return||i.return()}finally{if(s)throw o}}}}function ha(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i0&&void 0!==arguments[0]?arguments[0]:{};return oo(this,i),Hn(ia(t=e.call(this)),"propNames",ma),t.props=Object.assign({},ya,n),t}so(i,[{key:"initializeProps",value:function(t,e){var i,n={},r={},o=da(fa);try{for(o.s();!(i=o.n()).done;){var a=i.value,s=t[a],l=e[a];Co(ca(s)&&ca(l),"".concat(a," must be supplied for transition")),n[a]=s,r[a]=ua(a,s,l)}}catch(t){o.e(t)}finally{o.f()}var c,u=da(va);try{for(u.s();!(c=u.n()).done;){var d=c.value,h=t[d]||0,p=e[d]||0;n[d]=h,r[d]=ua(d,h,p)}}catch(t){u.e(t)}finally{u.f()}return{start:n,end:r}}},{key:"interpolateProps",value:function(t,e,i){var n,r=function(t,e,i,n={}){const r={},{startZoom:o,startCenterXY:a,uDelta:s,w0:l,u1:c,S:u,rho:d,rho2:h,r0:p}=Rr(t,e,n);if(c<.01){for(const n of Or){const o=t[n],a=e[n];r[n]=(m=i)*a+(1-m)*o}return r}var m;const f=i*u,g=Math.cosh(p)/Math.cosh(p+d*f),v=l*((Math.cosh(p)*Math.tanh(p+d*f)-Math.sinh(p))/h)/c,y=o+wr(1/g),_=function(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t}([],s,v);cr(_,_,a);const x=Er(_);return r.longitude=x[0],r.latitude=x[1],r.zoom=y,r}(t,e,i,this.props),o=da(va);try{for(o.s();!(n=o.n()).done;){var a=n.value;r[a]=So(t[a],e[a],i)}}catch(t){o.e(t)}finally{o.f()}return r}},{key:"getDuration",value:function(t,e){var i=e.transitionDuration;return"auto"===i&&(i=function(t,e,i={}){i=Object.assign({},Lr,i);const{screenSpeed:n,speed:r,maxDuration:o}=i,{S:a,rho:s}=Rr(t,e,i),l=1e3*a;let c;return c=Number.isFinite(n)?l/(n/s):l/r,Number.isFinite(o)&&c>o?0:c}(t,e,this.props)),i}}])}(ea);function _a(t,e){var i;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(i=function(t,e){if(!t)return;if("string"==typeof t)return xa(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);"Object"===i&&t.constructor&&(i=t.constructor.name);if("Map"===i||"Set"===i)return Array.from(t);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return xa(t,e)}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,r=function(){};return{s:r,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){i=t[Symbol.iterator]()},n:function(){var t=i.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==i.return||i.return()}finally{if(s)throw o}}}}function xa(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i0&&void 0!==arguments[0]?arguments[0]:{};return oo(this,i),t=e.call(this),Array.isArray(n)&&(n={transitionProps:n}),t.propNames=n.transitionProps||wa,n.around&&(t.around=n.around),t}return so(i,[{key:"initializeProps",value:function(t,e){var i={},n={};if(this.around){i.around=this.around;var r=new Dr(t).unproject(this.around);Object.assign(n,e,{around:new Dr(e).project(r),aroundLngLat:r})}var o,a=_a(this.propNames);try{for(a.s();!(o=a.n()).done;){var s=o.value,l=t[s],c=e[s];Co(ca(l)&&ca(c),"".concat(s," must be supplied for transition")),i[s]=l,n[s]=ua(s,l,c)}}catch(t){a.e(t)}finally{a.f()}return{start:i,end:n}}},{key:"interpolateProps",value:function(t,e,i){var n,r={},o=_a(this.propNames);try{for(o.s();!(n=o.n()).done;){var a=n.value;r[a]=So(t[a],e[a],i)}}catch(t){o.e(t)}finally{o.f()}if(e.around){var s=Yn(new Dr(Object.assign({},e,r)).getMapCenterByLngLatPosition({lngLat:e.aroundLngLat,pos:So(t.around,e.around,i)}),2),l=s[0],c=s[1];r.longitude=l,r.latitude=c}return r}}]),i}(ea),Ea=function(){};var Ta=1,Sa=2,Ca=3,Ma=4,za={transitionDuration:0,transitionEasing:function(t){return t},transitionInterpolator:new ka,transitionInterruption:Ta,onTransitionStart:Ea,onTransitionInterrupt:Ea,onTransitionEnd:Ea},Ia=function(){function t(){var e=this,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};oo(this,t),Hn(this,"_animationFrame",null),Hn(this,"_onTransitionFrame",(function(){e._animationFrame=requestAnimationFrame(e._onTransitionFrame),e._updateViewport()})),this.props=null,this.onViewportChange=i.onViewportChange||Ea,this.onStateChange=i.onStateChange||Ea,this.time=i.getTime||Date.now}return so(t,[{key:"getViewportInTransition",value:function(){return this._animationFrame?this.state.propsInTransition:null}},{key:"processViewportChange",value:function(t){var e=this.props;if(this.props=t,!e||this._shouldIgnoreViewportChange(e,t))return!1;if(this._isTransitionEnabled(t)){var i=Object.assign({},e),n=Object.assign({},t);if(this._isTransitionInProgress()&&(e.onTransitionInterrupt(),this.state.interruption===Sa?Object.assign(i,this.state.endProps):Object.assign(i,this.state.propsInTransition),this.state.interruption===Ma)){var r=this.time(),o=(r-this.state.startTime)/this.state.duration;n.transitionDuration=this.state.duration-(r-this.state.startTime),n.transitionEasing=function(t,e){var i=t(e);return function(n){return 1/(1-i)*(t(n*(1-e)+e)-i)}}(this.state.easing,o),n.transitionInterpolator=i.transitionInterpolator}return n.onTransitionStart(),this._triggerTransition(i,n),!0}return this._isTransitionInProgress()&&(e.onTransitionInterrupt(),this._endTransition()),!1}},{key:"_isTransitionInProgress",value:function(){return Boolean(this._animationFrame)}},{key:"_isTransitionEnabled",value:function(t){var e=t.transitionDuration,i=t.transitionInterpolator;return(e>0||"auto"===e)&&Boolean(i)}},{key:"_isUpdateDueToCurrentTransition",value:function(t){return!!this.state.propsInTransition&&this.state.interpolator.arePropsEqual(t,this.state.propsInTransition)}},{key:"_shouldIgnoreViewportChange",value:function(t,e){return!t||(this._isTransitionInProgress()?this.state.interruption===Ca||this._isUpdateDueToCurrentTransition(e):!this._isTransitionEnabled(e)||e.transitionInterpolator.arePropsEqual(t,e))}},{key:"_triggerTransition",value:function(t,e){Co(this._isTransitionEnabled(e)),this._animationFrame&&cancelAnimationFrame(this._animationFrame);var i=e.transitionInterpolator,n=i.getDuration?i.getDuration(t,e):e.transitionDuration;if(0!==n){var r=e.transitionInterpolator.initializeProps(t,e),o={inTransition:!0,isZooming:t.zoom!==e.zoom,isPanning:t.longitude!==e.longitude||t.latitude!==e.latitude,isRotating:t.bearing!==e.bearing||t.pitch!==e.pitch};this.state={duration:n,easing:e.transitionEasing,interpolator:e.transitionInterpolator,interruption:e.transitionInterruption,startTime:this.time(),startProps:r.start,endProps:r.end,animation:null,propsInTransition:{}},this._onTransitionFrame(),this.onStateChange(o)}}},{key:"_endTransition",value:function(){this._animationFrame&&(cancelAnimationFrame(this._animationFrame),this._animationFrame=null),this.onStateChange({inTransition:!1,isZooming:!1,isPanning:!1,isRotating:!1})}},{key:"_updateViewport",value:function(){var t=this.time(),e=this.state,i=e.startTime,n=e.duration,r=e.easing,o=e.interpolator,a=e.startProps,s=e.endProps,l=!1,c=(t-i)/n;c>=1&&(c=1,l=!0),c=r(c);var u=o.interpolateProps(a,s,c),d=new Oo(Object.assign({},this.props,u));this.state.propsInTransition=d.getViewportProps(),this.onViewportChange(this.state.propsInTransition,this.props),l&&(this._endTransition(),this.props.onTransitionEnd())}}]),t}();Hn(Ia,"defaultProps",za);var Pa=i(797),Aa=i.n(Pa);const Da={mousedown:1,mousemove:2,mouseup:4};!function(t){const e=t.prototype.handler;t.prototype.handler=function(t){const i=this.store;t.button>0&&"pointerdown"===t.type&&(function(t,e){for(let i=0;ie.pointerId===t.pointerId))||i.push(t)),e.call(this,t)}}(Aa().PointerEventInput),Aa().MouseInput.prototype.handler=function(t){let e=Da[t.type];1&e&&t.button>=0&&(this.pressed=!0),2&e&&0===t.which&&(e=4),this.pressed&&(4&e&&(this.pressed=!1),this.callback(this.manager,e,{pointers:[t],changedPointers:[t],pointerType:"mouse",srcEvent:t}))};const Oa=Aa().Manager,La=Aa(),Ra=La?[[La.Pan,{event:"tripan",pointers:3,threshold:0,enable:!1}],[La.Rotate,{enable:!1}],[La.Pinch,{enable:!1}],[La.Swipe,{enable:!1}],[La.Pan,{threshold:0,enable:!1}],[La.Press,{enable:!1}],[La.Tap,{event:"doubletap",taps:2,enable:!1}],[La.Tap,{event:"anytap",enable:!1}],[La.Tap,{enable:!1}]]:null,Ba={tripan:["rotate","pinch","pan"],rotate:["pinch"],pinch:["pan"],pan:["press","doubletap","anytap","tap"],doubletap:["anytap"],anytap:["tap"]},Fa={doubletap:["tap"]},ja={pointerdown:"pointerdown",pointermove:"pointermove",pointerup:"pointerup",touchstart:"pointerdown",touchmove:"pointermove",touchend:"pointerup",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup"},Na={KEY_EVENTS:["keydown","keyup"],MOUSE_EVENTS:["mousedown","mousemove","mouseup","mouseover","mouseout","mouseleave"],WHEEL_EVENTS:["wheel","mousewheel"]},Va={tap:"tap",anytap:"anytap",doubletap:"doubletap",press:"press",pinch:"pinch",pinchin:"pinch",pinchout:"pinch",pinchstart:"pinch",pinchmove:"pinch",pinchend:"pinch",pinchcancel:"pinch",rotate:"rotate",rotatestart:"rotate",rotatemove:"rotate",rotateend:"rotate",rotatecancel:"rotate",tripan:"tripan",tripanstart:"tripan",tripanmove:"tripan",tripanup:"tripan",tripandown:"tripan",tripanleft:"tripan",tripanright:"tripan",tripanend:"tripan",tripancancel:"tripan",pan:"pan",panstart:"pan",panmove:"pan",panup:"pan",pandown:"pan",panleft:"pan",panright:"pan",panend:"pan",pancancel:"pan",swipe:"swipe",swipeleft:"swipe",swiperight:"swipe",swipeup:"swipe",swipedown:"swipe"},Ua={click:"tap",anyclick:"anytap",dblclick:"doubletap",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup",mouseover:"pointerover",mouseout:"pointerout",mouseleave:"pointerleave"},Za="undefined"!=typeof navigator&&navigator.userAgent?navigator.userAgent.toLowerCase():"",$a="undefined"!=typeof window?window:i.g;void 0!==i.g?i.g:window,"undefined"!=typeof document&&document;let Ga=!1;try{const t={get passive(){return Ga=!0,!0}};$a.addEventListener("test",t,t),$a.removeEventListener("test",t,t)}catch(t){}const qa=-1!==Za.indexOf("firefox"),{WHEEL_EVENTS:Wa}=Na,Ha="wheel",Xa=4.000244140625;class Ya{constructor(t,e,i={}){this.element=t,this.callback=e,this.options=Object.assign({enable:!0},i),this.events=Wa.concat(i.events||[]),this.handleEvent=this.handleEvent.bind(this),this.events.forEach((e=>t.addEventListener(e,this.handleEvent,!!Ga&&{passive:!1})))}destroy(){this.events.forEach((t=>this.element.removeEventListener(t,this.handleEvent)))}enableEventType(t,e){t===Ha&&(this.options.enable=e)}handleEvent(t){if(!this.options.enable)return;let e=t.deltaY;$a.WheelEvent&&(qa&&t.deltaMode===$a.WheelEvent.DOM_DELTA_PIXEL&&(e/=$a.devicePixelRatio),t.deltaMode===$a.WheelEvent.DOM_DELTA_LINE&&(e*=40));const i={x:t.clientX,y:t.clientY};0!==e&&e%Xa==0&&(e=Math.floor(e/Xa)),t.shiftKey&&e&&(e*=.25),this._onWheel(t,-e,i)}_onWheel(t,e,i){this.callback({type:Ha,center:i,delta:e,srcEvent:t,pointerType:"mouse",target:t.target})}}const{MOUSE_EVENTS:Ka}=Na,Ja="pointermove",Qa="pointerover",ts="pointerout",es="pointerleave";class is{constructor(t,e,i={}){this.element=t,this.callback=e,this.pressed=!1,this.options=Object.assign({enable:!0},i),this.enableMoveEvent=this.options.enable,this.enableLeaveEvent=this.options.enable,this.enableOutEvent=this.options.enable,this.enableOverEvent=this.options.enable,this.events=Ka.concat(i.events||[]),this.handleEvent=this.handleEvent.bind(this),this.events.forEach((e=>t.addEventListener(e,this.handleEvent)))}destroy(){this.events.forEach((t=>this.element.removeEventListener(t,this.handleEvent)))}enableEventType(t,e){t===Ja&&(this.enableMoveEvent=e),t===Qa&&(this.enableOverEvent=e),t===ts&&(this.enableOutEvent=e),t===es&&(this.enableLeaveEvent=e)}handleEvent(t){this.handleOverEvent(t),this.handleOutEvent(t),this.handleLeaveEvent(t),this.handleMoveEvent(t)}handleOverEvent(t){this.enableOverEvent&&"mouseover"===t.type&&this.callback({type:Qa,srcEvent:t,pointerType:"mouse",target:t.target})}handleOutEvent(t){this.enableOutEvent&&"mouseout"===t.type&&this.callback({type:ts,srcEvent:t,pointerType:"mouse",target:t.target})}handleLeaveEvent(t){this.enableLeaveEvent&&"mouseleave"===t.type&&this.callback({type:es,srcEvent:t,pointerType:"mouse",target:t.target})}handleMoveEvent(t){if(this.enableMoveEvent)switch(t.type){case"mousedown":t.button>=0&&(this.pressed=!0);break;case"mousemove":0===t.which&&(this.pressed=!1),this.pressed||this.callback({type:Ja,srcEvent:t,pointerType:"mouse",target:t.target});break;case"mouseup":this.pressed=!1}}}const{KEY_EVENTS:ns}=Na,rs="keydown",os="keyup";class as{constructor(t,e,i={}){this.element=t,this.callback=e,this.options=Object.assign({enable:!0},i),this.enableDownEvent=this.options.enable,this.enableUpEvent=this.options.enable,this.events=ns.concat(i.events||[]),this.handleEvent=this.handleEvent.bind(this),t.tabIndex=i.tabIndex||0,t.style.outline="none",this.events.forEach((e=>t.addEventListener(e,this.handleEvent)))}destroy(){this.events.forEach((t=>this.element.removeEventListener(t,this.handleEvent)))}enableEventType(t,e){t===rs&&(this.enableDownEvent=e),t===os&&(this.enableUpEvent=e)}handleEvent(t){const e=t.target||t.srcElement;"INPUT"===e.tagName&&"text"===e.type||"TEXTAREA"===e.tagName||(this.enableDownEvent&&"keydown"===t.type&&this.callback({type:rs,srcEvent:t,key:t.key,target:t.target}),this.enableUpEvent&&"keyup"===t.type&&this.callback({type:os,srcEvent:t,key:t.key,target:t.target}))}}const ss="contextmenu";class ls{constructor(t,e,i={}){this.element=t,this.callback=e,this.options=Object.assign({enable:!0},i),this.handleEvent=this.handleEvent.bind(this),t.addEventListener("contextmenu",this.handleEvent)}destroy(){this.element.removeEventListener("contextmenu",this.handleEvent)}enableEventType(t,e){t===ss&&(this.options.enable=e)}handleEvent(t){this.options.enable&&this.callback({type:ss,center:{x:t.clientX,y:t.clientY},srcEvent:t,pointerType:"mouse",target:t.target})}}const cs={pointerdown:1,pointermove:2,pointerup:4,mousedown:1,mousemove:2,mouseup:4};const us={srcElement:"root",priority:0};class ds{constructor(t){this.eventManager=t,this.handlers=[],this.handlersByElement=new Map,this.handleEvent=this.handleEvent.bind(this),this._active=!1}isEmpty(){return!this._active}add(t,e,i,n=!1,r=!1){const{handlers:o,handlersByElement:a}=this;i&&("object"!=typeof i||i.addEventListener)&&(i={srcElement:i}),i=i?Object.assign({},us,i):us;let s=a.get(i.srcElement);s||(s=[],a.set(i.srcElement,s));const l={type:t,handler:e,srcElement:i.srcElement,priority:i.priority};n&&(l.once=!0),r&&(l.passive=!0),o.push(l),this._active=this._active||!l.passive;let c=s.length-1;for(;c>=0&&!(s[c].priority>=l.priority);)c--;s.splice(c+1,0,l)}remove(t,e){const{handlers:i,handlersByElement:n}=this;for(let r=i.length-1;r>=0;r--){const o=i[r];if(o.type===t&&o.handler===e){i.splice(r,1);const t=n.get(o.srcElement);t.splice(t.indexOf(o),1),0===t.length&&n.delete(o.srcElement)}}this._active=i.some((t=>!t.passive))}handleEvent(t){if(this.isEmpty())return;const e=this._normalizeEvent(t);let i=t.srcEvent.target;for(;i&&i!==e.rootElement;){if(this._emit(e,i),e.handled)return;i=i.parentNode}this._emit(e,"root")}_emit(t,e){const i=this.handlersByElement.get(e);if(i){let e=!1;const n=()=>{t.handled=!0},r=()=>{t.handled=!0,e=!0},o=[];for(let a=0;a{const e=this.manager.get(t);e&&Ba[t].forEach((t=>{e.recognizeWith(t)}))}));for(const t in e.recognizerOptions){const i=this.manager.get(t);if(i){const n=e.recognizerOptions[t];delete n.enable,i.set(n)}}this.wheelInput=new Ya(t,this._onOtherEvent,{enable:!1}),this.moveInput=new is(t,this._onOtherEvent,{enable:!1}),this.keyInput=new as(t,this._onOtherEvent,{enable:!1,tabIndex:e.tabIndex}),this.contextmenuInput=new ls(t,this._onOtherEvent,{enable:!1});for(const[t,e]of this.events)e.isEmpty()||(this._toggleRecognizer(e.recognizerName,!0),this.manager.on(t,e.handleEvent))}destroy(){this.element&&(this.wheelInput.destroy(),this.moveInput.destroy(),this.keyInput.destroy(),this.contextmenuInput.destroy(),this.manager.destroy(),this.wheelInput=null,this.moveInput=null,this.keyInput=null,this.contextmenuInput=null,this.manager=null,this.element=null)}on(t,e,i){this._addEventHandler(t,e,i,!1)}once(t,e,i){this._addEventHandler(t,e,i,!0)}watch(t,e,i){this._addEventHandler(t,e,i,!1,!0)}off(t,e){this._removeEventHandler(t,e)}_toggleRecognizer(t,e){const{manager:i}=this;if(!i)return;const n=i.get(t);if(n&&n.options.enable!==e){n.set({enable:e});const r=Fa[t];r&&!this.options.recognizers&&r.forEach((r=>{const o=i.get(r);e?(o.requireFailure(t),n.dropRequireFailure(r)):o.dropRequireFailure(t)}))}this.wheelInput.enableEventType(t,e),this.moveInput.enableEventType(t,e),this.keyInput.enableEventType(t,e),this.contextmenuInput.enableEventType(t,e)}_addEventHandler(t,e,i,n,r){if("string"!=typeof t){i=e;for(const e in t)this._addEventHandler(e,t[e],i,n,r);return}const{manager:o,events:a}=this,s=Ua[t]||t;let l=a.get(s);l||(l=new ds(this),a.set(s,l),l.recognizerName=Va[s]||s,o&&o.on(s,l.handleEvent)),l.add(t,e,i,n,r),l.isEmpty()||this._toggleRecognizer(l.recognizerName,!0)}_removeEventHandler(t,e){if("string"!=typeof t){for(const e in t)this._removeEventHandler(e,t[e]);return}const{events:i}=this,n=Ua[t]||t,r=i.get(n);if(r&&(r.remove(t,e),r.isEmpty())){const{recognizerName:t}=r;let e=!1;for(const n of i.values())if(n.recognizerName===t&&!n.isEmpty()){e=!0;break}e||this._toggleRecognizer(t,!1)}}_onBasicInput(t){const{srcEvent:e}=t,i=ja[e.type];i&&this.manager.emit(i,t)}_onOtherEvent(t){this.manager.emit(t.type,t)}}function ms(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function fs(t){for(var e=1;e0),a=o&&!this.state.isHovering,s=!o&&this.state.isHovering;(n||a)&&(t.features=e,n&&n(t)),a&&Ds.call(this,"onMouseEnter",t),s&&Ds.call(this,"onMouseLeave",t),(a||s)&&this.setState({isHovering:o})}}function Bs(t){var e=this.props,i=e.onClick,n=e.onNativeClick,r=e.onDblClick,o=e.doubleClickZoom,a=[],s=r||o;switch(t.type){case"anyclick":a.push(n),s||a.push(i);break;case"click":s&&a.push(i)}(a=a.filter(Boolean)).length&&((t=Ps.call(this,t)).features=As.call(this,t.point),a.forEach((function(e){return e(t)})))}var Fs=(0,r.forwardRef)((function(t,e){var i=(0,r.useContext)(No),n=(0,r.useMemo)((function(){return t.controller||new Ss}),[]),o=(0,r.useMemo)((function(){return new ps(null,{touchAction:t.touchAction,recognizerOptions:t.eventRecognizerOptions})}),[]),a=(0,r.useRef)(null),s=(0,r.useRef)(null),l=(0,r.useRef)({width:0,height:0,state:{isHovering:!1,isDragging:!1}}).current;l.props=t,l.map=s.current&&s.current.getMap(),l.setState=function(e){l.state=Ms(Ms({},l.state),e),a.current.style.cursor=t.getCursor(l.state)};var c,u,d=!0,h=function(t,e,i){if(d)c=[t,e,i];else{var n=l.props,r=n.onViewStateChange,o=n.onViewportChange;Object.defineProperty(t,"position",{get:function(){return[0,0,Uo(l.map,t)]}}),r&&r({viewState:t,interactionState:e,oldViewState:i}),o&&o(t,e,i)}};(0,r.useImperativeHandle)(e,(function(){return function(t){return{getMap:t.current&&t.current.getMap,queryRenderedFeatures:t.current&&t.current.queryRenderedFeatures}}(s)}),[]);var p=(0,r.useMemo)((function(){return Ms(Ms({},i),{},{eventManager:o,container:i.container||a.current})}),[i,a.current]);p.onViewportChange=h,p.viewport=i.viewport||qo(l),l.viewport=p.viewport;var m=function(t){var e=t.isDragging,i=void 0!==e&&e;if(i!==l.state.isDragging&&l.setState({isDragging:i}),d)u=t;else{var n=l.props.onInteractionStateChange;n&&n(t)}},f=function(){l.width&&l.height&&n.setOptions(Ms(Ms(Ms({},l.props),l.props.viewState),{},{isInteractive:Boolean(l.props.onViewStateChange||l.props.onViewportChange),onViewportChange:h,onStateChange:m,eventManager:o,width:l.width,height:l.height}))};(0,r.useEffect)((function(){return o.setElement(a.current),o.on({pointerdown:Os.bind(l),pointermove:Rs.bind(l),pointerup:Ls.bind(l),pointerleave:Ds.bind(l,"onMouseOut"),click:Bs.bind(l),anyclick:Bs.bind(l),dblclick:Ds.bind(l,"onDblClick"),wheel:Ds.bind(l,"onWheel"),contextmenu:Ds.bind(l,"onContextMenu")}),function(){o.destroy()}}),[]),Vo((function(){c&&h.apply(void 0,Wn(c)),u&&m(u)})),f();var g=t.width,v=t.height,y=t.style,_=t.getCursor,x=(0,r.useMemo)((function(){return Ms(Ms({position:"relative"},y),{},{width:g,height:v,cursor:_(l.state)})}),[y,g,v,_,l.state]);return c&&l._child||(l._child=r.createElement(jo,{value:p},r.createElement("div",{key:"event-canvas",ref:a,style:x},r.createElement(Jo,$n({},t,{width:"100%",height:"100%",style:null,onResize:function(t){var e=t.width,i=t.height;l.width=e,l.height=i,f(),l.props.onResize({width:e,height:i})},ref:s}))))),d=!1,l._child}));Fs.supported=Jo.supported,Fs.propTypes=zs,Fs.defaultProps=Is;const js=Fs;function Ns(t,e){if(t===e)return!0;if(!t||!e)return!1;if(Array.isArray(t)){if(!Array.isArray(e)||t.length!==e.length)return!1;for(var i=0;i prop: ".concat(n));else t.setCoordinates(e.coordinates)}}(s,t,i.current):s=$s(a,o,t),i.current=t,s&&r.Children.map(t.children,(function(t){return t&&(0,r.cloneElement)(t,{source:o})}))||null}Gs.propTypes=Us;function qs(t,e){if(null==t)return{};var i,n,r=function(t,e){if(null==t)return{};var i,n,r={},o=Object.keys(t);for(n=0;n=0||(r[i]=t[i]);return r}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(t,i)&&(r[i]=t[i])}return r}function Ws(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Hs(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{},e=(0,r.useContext)(No),i=(0,r.useRef)(null),n=(0,r.useRef)({props:t,state:{},context:e,containerRef:i}),o=n.current;return o.props=t,o.context=e,(0,r.useEffect)((function(){return el(o)}),[e.eventManager]),o}function nl(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=sa(t);if(e){var r=sa(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return aa(this,i)}}function rl(t){var e=t.instance,i=il(t),n=i.context,r=i.containerRef;return e._context=n,e._containerRef=r,e._render()}var ol=function(t){ra(i,t);var e=nl(i);function i(){var t;oo(this,i);for(var n=arguments.length,o=new Array(n),a=0;a2&&void 0!==arguments[2]?arguments[2]:"x";if(null===t)return e;var n="x"===i?t.offsetWidth:t.offsetHeight;return fl(e/100*n)/n*100};function vl(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}var yl=Object.assign({},ll,{className:Xn.string,longitude:Xn.number.isRequired,latitude:Xn.number.isRequired,style:Xn.object}),_l=Object.assign({},cl,{className:""});function xl(t){var e=function(t){var e=Yn((0,r.useState)(null),2),i=e[0],n=e[1],o=Yn((0,r.useState)(null),2),a=o[0],s=o[1],l=il(sl(sl({},t),{},{onDragStart:hl}));return l.callbacks=t,l.state.dragPos=i,l.state.setDragPos=n,l.state.dragOffset=a,l.state.setDragOffset=s,(0,r.useEffect)((function(){return pl(l)}),[l.context.eventManager,Boolean(i)]),l}(t),i=e.state,n=e.containerRef,o=t.children,a=t.className,s=t.draggable,l=t.style,c=i.dragPos,u=function(t){var e=t.props,i=t.state,n=t.context,r=e.longitude,o=e.latitude,a=e.offsetLeft,s=e.offsetTop,l=i.dragPos,c=i.dragOffset,u=n.viewport,d=n.map;if(l&&c)return[l[0]+c[0],l[1]+c[1]];var h=Uo(d,{longitude:r,latitude:o}),p=Yn(u.project([r,o,h]),2),m=p[0],f=p[1];return[m+=a,f+=s]}(e),d=Yn(u,2),h=d[0],p=d[1],m="translate(".concat(fl(h),"px, ").concat(fl(p),"px)"),f=s?c?"grabbing":"grab":"auto",g=(0,r.useMemo)((function(){var t=function(t){for(var e=1;e0){var g=h,v=f;for(h=0;h<=1;h+=.5)m=(p=i-h*a)+a,(f=Math.max(0,c-p)+Math.max(0,m-r+c))0){var w=d,k=b;for(d=0;d<=1;d+=y)x=(_=e-d*o)+o,(b=Math.max(0,c-_)+Math.max(0,x-n+c))1||l<-1||a<0||a>e.width||s<0||s>e.height?v.display="none":v.zIndex=Math.floor((1-l)/2*1e5),v):v}(t,s,o.current,g,v),_=(0,r.useCallback)((function(t){i.props.onClose();var e=i.context.eventManager;e&&e.once("click",(function(t){return t.stopPropagation()}),t.target)}),[]);return r.createElement("div",{className:"mapboxgl-popup mapboxgl-popup-anchor-".concat(v," ").concat(c),style:y,ref:o},r.createElement("div",{key:"tip",className:"mapboxgl-popup-tip",style:{borderWidth:h}}),r.createElement("div",{key:"content",ref:e,className:"mapboxgl-popup-content"},p&&r.createElement("button",{key:"close-button",className:"mapboxgl-popup-close-button",type:"button",onClick:_},"×"),m))}Cl.propTypes=El,Cl.defaultProps=Tl;const Ml=r.memo(Cl);function zl(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}var Il=Object.assign({},tl,{toggleLabel:Xn.string,className:Xn.string,style:Xn.object,compact:Xn.bool,customAttribution:Xn.oneOfType([Xn.string,Xn.arrayOf(Xn.string)])}),Pl=Object.assign({},Qs,{className:"",toggleLabel:"Toggle Attribution"});function Al(t){var e=il(t),i=e.context,n=e.containerRef,o=(0,r.useRef)(null),a=Yn((0,r.useState)(!1),2),s=a[0],l=a[1];(0,r.useEffect)((function(){var e;return i.map&&(e=function(t,e,i,n){var r=new(wo().AttributionControl)(t);return r._map=e,r._container=i,r._innerContainer=n,r._updateAttributions(),r._updateEditLink(),e.on("styledata",r._updateData),e.on("sourcedata",r._updateData),r}({customAttribution:t.customAttribution},i.map,n.current,o.current)),function(){return e&&function(t){t._map.off("styledata",t._updateData),t._map.off("sourcedata",t._updateData)}(e)}}),[i.map]);var c=void 0===t.compact?i.viewport.width<=640:t.compact;(0,r.useEffect)((function(){!c&&s&&l(!1)}),[c]);var u=(0,r.useCallback)((function(){return l((function(t){return!t}))}),[]),d=(0,r.useMemo)((function(){return function(t){for(var e=1;ea)return 1}return 0}(t,"1.6.0")>=0?2:1}function Xl(t,e,i){var n=t.viewport,r=new Oo(Object.assign({},n,i)),o=Object.assign({},r.getViewportProps(),vs),a=e.onViewportChange||t.onViewportChange||Gl;(e.onViewStateChange||t.onViewStateChange||Gl)({viewState:o}),a(o)}function Yl(t,e,i,n){return r.createElement("button",{key:t,className:"mapboxgl-ctrl-icon mapboxgl-ctrl-".concat(t),type:"button",title:e,onClick:i},n||r.createElement("span",{className:"mapboxgl-ctrl-icon","aria-hidden":"true"}))}function Kl(t){var e=il(t),i=e.context,n=e.containerRef,o=t.className,a=t.showCompass,s=t.showZoom,l=t.zoomInLabel,c=t.zoomOutLabel,u=t.compassLabel,d=(0,r.useMemo)((function(){return function(t){for(var e=1;e{const t=()=>{const{width:t,height:e}=m.current.getBoundingClientRect();t&&e&&p({width:t-2,height:e-2})};return t(),window.addEventListener("resize",t),()=>{window.removeEventListener("resize",t)}}),[]),(0,r.useEffect)((()=>(i.input?.meeting||document.body.classList.add("tsml-ui-map"),()=>{document.body.classList.remove("tsml-ui-map")})),[i.input?.meeting]),(0,r.useEffect)((()=>{const e={},n={};t.forEach((t=>{const r=i.meetings[t];if(r?.latitude&&r?.longitude&&r?.isInPerson){const t=r.latitude+","+r.longitude;e.hasOwnProperty(t)||(e[t]={directions_url:hn(r),formatted_address:r.formatted_address,latitude:r.latitude,longitude:r.longitude,meetings:[],name:r.location}),(!n.north||r.latitude>n.north)&&(n.north=r.latitude),(!n.south||r.latituden.east)&&(n.east=r.longitude),(!n.west||r.longitudee[i].latitude-e[t].latitude));d({bounds:n,locations:e,locationKeys:r}),1===r.length&&s(r[0])}),[t]),(0,r.useEffect)((()=>{h&&u.bounds&&c(u.bounds.west===u.bounds.east?pc(pc({},h),{},{latitude:u.bounds.north,longitude:u.bounds.west,zoom:14}):new Dr(h).fitBounds([[u.bounds.west,u.bounds.south],[u.bounds.east,u.bounds.north]],{padding:Math.min(h.width,h.height)/10}))}),[u,h]),(0,vn.jsx)("div",{className:"border rounded bg-light flex-grow-1 map",ref:m,children:l&&!!u.locationKeys.length&&(0,vn.jsxs)(js,pc(pc({mapStyle:sn.map.style,mapboxApiAccessToken:o,onViewportChange:c},l),{},{children:[u.locationKeys.map((t=>(0,vn.jsxs)("div",{children:[(0,vn.jsx)(bl,{latitude:u.locations[t].latitude,longitude:u.locations[t].longitude,offsetLeft:-sn.map.markers.location.width/2,offsetTop:-sn.map.markers.location.height,children:(0,vn.jsx)("div",{"data-testid":t,onClick:()=>s(t),style:sn.map.markers.location,title:u.locations[t].name})}),a===t&&(0,vn.jsx)(Ml,{captureScroll:!0,closeOnClick:!1,latitude:u.locations[t].latitude,longitude:u.locations[t].longitude,offsetTop:-sn.map.markers.location.height,onClose:()=>s(null),children:(0,vn.jsxs)("div",{className:"d-grid gap-2",children:[(0,vn.jsx)("h4",{className:"fw-light",children:u.locations[t].name}),(0,vn.jsx)("p",{children:u.locations[t].formatted_address}),e&&(0,vn.jsx)("div",{className:"list-group mb-1",children:u.locations[t].meetings.sort(((t,e)=>t.start>e.start)).map(((t,e)=>(0,vn.jsxs)("div",{className:"list-group-item",children:[(0,vn.jsxs)("time",{className:"d-block",children:[t.start.toFormat("t"),(0,vn.jsx)("span",{className:"ms-1",children:t.start.toFormat("cccc")})]}),(0,vn.jsx)(Un,{meeting:t,setState:n,state:i})]},e)))}),u.locations[t].directions_url&&(0,vn.jsx)(xn,{className:"in-person",href:u.locations[t].directions_url,icon:"geo",text:un.get_directions})]})})]},t))),(0,vn.jsx)(Jl,{className:"d-none d-md-block",onViewportChange:c,showCompass:!1,style:{top:10,right:10}})]}))})}function gc(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function vc(t){for(var e=1;e{const t=document.getElementById("tsml-ui");if(t){const e=Math.max(0,...[...document.body.getElementsByTagName("*")].filter((t=>"fixed"===getComputedStyle(t,null).getPropertyValue("position")&&t.offsetTop<100)).map((t=>t.offsetTop+t.offsetHeight)));e&&(t.style.scrollMarginTop=`${e}px`),t.scrollIntoView()}return l.edit_url&&(console.log(`TSML UI edit ${l.name}: ${l.edit_url}`),kc(l.edit_url)),()=>{kc()}}),[t.input.meeting]),(0,r.useEffect)((()=>(document.body.classList.add("tsml-ui-meeting"),()=>{document.body.classList.remove("tsml-ui-meeting")})),[]);const c=l.isInPerson?hn(l):void 0;document.title=l.name,!l.feedback_url&&n.length&&(l.feedback_url=fn(sn.feedback_emails,l));const u=[];l.email&&u.push({href:`mailto:${l.email}`,icon:"email",text:l.email}),l.website&&u.push({href:l.website,target:"_blank",icon:"link",text:new URL(l.website).host.replace("www.","")}),l.phone&&u.push({href:l.phone,icon:"phone",text:l.phone}),l.venmo&&u.push({href:`https://venmo.com/${l.venmo.substr(1)}`,icon:"cash",text:un.contribute_with.replace("%service%","Venmo")}),l.square&&u.push({href:`https://cash.app/${l.square}`,icon:"cash",text:un.contribute_with.replace("%service%","Cash App")}),l.paypal&&u.push({href:l.paypal,icon:"cash",text:un.contribute_with.replace("%service%","PayPal")});for(let t=1;t<4;t++)l[`contact_${t}_name`]&&(l[`contact_${t}_email`]&&u.push({href:`mailto:${l[`contact_${t}_email`]}`,icon:"email",text:un.contact_email.replace("%contact%",l[`contact_${t}_name`])}),l[`contact_${t}_phone`]&&u.push({href:`tel:${l[`contact_${t}_phone`]}`,icon:"phone",text:un.contact_call.replace("%contact%",l[`contact_${t}_name`])}));const d=ii.weekdays().map(((e,i)=>({name:e,meetings:Object.values(t.meetings).filter((t=>t.start?.weekday===i+1)).filter((t=>l.isInPerson&&t.isInPerson&&t.formatted_address===l.formatted_address)).sort(((t,e)=>t.start-e.start))}))).filter((t=>t.meetings.length));1===d.length&&1===d[0].meetings.length&&d.splice(0,1);const h=ii.weekdays().map(((e,i)=>({name:e,meetings:Object.values(t.meetings).filter((t=>t.start?.weekday===i+1)).filter((t=>l.group&&(t.isOnline||t.isInPerson)&&t.group===l.group)).sort(((t,e)=>t.start-e.start))}))).filter((t=>t.meetings.length));return 1===h.length&&1===h[0].meetings.length&&h.splice(0,1),(0,vn.jsxs)("div",{className:o("d-flex flex-column flex-grow-1 meeting",{"in-person":l.isInPerson,inactive:!l.isActive,online:l.isOnline}),children:[(0,vn.jsx)("h1",{className:"fw-light mb-1",children:(0,vn.jsx)(Un,{meeting:l})}),(0,vn.jsxs)("div",{className:"align-items-center border-bottom d-flex h6 mb-3 pb-2",children:[(0,vn.jsx)(_n,{icon:"back"}),(0,vn.jsx)("a",{href:mn(vc(vc({},t.input),{},{meeting:null})),onClick:i=>{i.preventDefault(),e(vc(vc({},t),{},{input:vc(vc({},t.input),{},{meeting:null})}))},children:un.back_to_meetings})]}),(0,vn.jsxs)("div",{className:"flex-grow-1 row",children:[(0,vn.jsxs)("div",{className:"align-content-start col-md-4 d-grid gap-3 mb-3 mb-md-0",children:[c&&(0,vn.jsx)(xn,{className:"in-person",href:c,icon:"geo",text:un.get_directions}),(0,vn.jsxs)("div",{className:"list-group",children:[(0,vn.jsxs)("div",{className:"d-grid gap-2 list-group-item py-3",children:[(0,vn.jsx)("h2",{className:"h5",children:un.meeting_information}),(0,vn.jsx)("p",{children:wc(l.start,l.end)}),l.start&&l.start.zoneName!==l.timezone&&(0,vn.jsxs)("p",{className:"text-muted",children:["(",wc(l.start.setZone(l.timezone),l.end.setZone(l.timezone)),")"]}),t.capabilities.type&&l.types&&(0,vn.jsx)("ul",{className:"ms-4",children:l.types.filter((t=>"active"!==t)).sort(((t,e)=>un.types[t].localeCompare(un.types[e]))).map(((t,e)=>(0,vn.jsx)("li",{className:"m-0",children:un.type_descriptions?.[t]?(0,vn.jsxs)("button",{className:"d-flex flex-column bg-transparent border-0 p-0 text-start text-reset",onClick:()=>s(a===t?null:t),children:[(0,vn.jsxs)("div",{className:"d-flex align-items-center gap-2",children:[(0,vn.jsx)("span",{children:un.types[t]}),(0,vn.jsx)(_n,{icon:"info",size:13,className:a===t?"text-muted":void 0})]}),a===t&&(0,vn.jsx)("small",{className:"d-block mb-2",children:un.type_descriptions[t]})]}):un.types[t]},e)))}),l.notes&&(0,vn.jsx)(xc,{text:l.notes}),(l.isActive||!l.group&&!!u.length)&&(0,vn.jsxs)("div",{className:"d-grid gap-3 mt-2",children:[l.conference_provider&&(0,vn.jsxs)("div",{className:"d-grid gap-1",children:[(0,vn.jsx)(xn,{className:"online",href:l.conference_url,icon:"camera",text:l.conference_provider}),l.conference_url_notes&&(0,vn.jsx)(xc,{className:"d-block text-muted",text:l.conference_url_notes})]}),l.conference_phone&&(0,vn.jsxs)("div",{className:"d-grid gap-1",children:[(0,vn.jsx)(xn,{className:"online",href:`tel:${l.conference_phone}`,icon:"phone",text:un.phone}),l.conference_phone_notes&&(0,vn.jsx)(xc,{className:"d-block text-muted",text:l.conference_phone_notes})]}),l.start&&l.isActive&&(0,vn.jsx)(xn,{onClick:()=>function(t){var e;const i="yyyyLLdd'T'HHmmss";if(!t.start||!t.end)return;t.startt.replaceAll("\n","\\n").replaceAll(",","\\,"))),"END:VEVENT","END:VCALENDAR"].join("\n");if(dn()){const t=`data:text/calendar;charset=utf8,${o}`;window.location=encodeURI(t)}else{const i=window.URL.createObjectURL(new Blob([o])),n=document.createElement("a");n.href=i,n.setAttribute("download",`${t.name}.ics`),document.body.appendChild(n),n.click(),null===(e=n.parentNode)||void 0===e||e.removeChild(n)}}(l),icon:"calendar",text:un.add_to_calendar}),!l.group&&u.map(((t,e)=>(0,r.createElement)(xn,vc(vc({},t),{},{key:e}))))]})]}),!l.approximate&&(0,vn.jsxs)("div",{className:o({"text-decoration-line-through text-muted":l.isTempClosed},"d-grid gap-2 list-group-item py-3 location"),children:[l.location&&(0,vn.jsx)("h2",{className:"h5",children:l.location}),l.formatted_address&&(0,vn.jsx)("p",{children:l.formatted_address}),l.regions&&(0,vn.jsx)("p",{children:l.regions.join(" > ")}),l.location_notes&&(0,vn.jsx)(xc,{text:l.location_notes}),(0,vn.jsx)("div",{className:"meetings d-grid gap-2",children:bc(d,l.slug,t,e)})]}),l.group&&(l.district||l.group_notes||!!h.length||!!u.length)&&(0,vn.jsxs)("div",{className:"d-grid gap-2 list-group-item py-3 group",children:[(0,vn.jsx)("h2",{className:"h5",children:l.group}),l.district&&(0,vn.jsx)("p",{children:l.district}),l.group_notes&&(0,vn.jsx)(xc,{text:l.group_notes}),!!u.length&&(0,vn.jsx)("div",{className:"d-grid gap-3 mt-2",children:u.map(((t,e)=>(0,r.createElement)(xn,vc(vc({},t),{},{key:e}))))}),(0,vn.jsx)("div",{className:"meetings d-grid gap-2",children:bc(h,l.slug,t,e)})]}),l.updated&&(0,vn.jsx)("div",{className:"list-group-item",children:un.updated.replace("%updated%",l.updated)})]}),l.feedback_url&&(0,vn.jsx)(xn,{href:l.feedback_url,icon:"edit",text:un.feedback})]}),!!i&&(0,vn.jsx)("div",{className:o({"d-md-block d-none":!l.isInPerson},"col-md-8"),children:(0,vn.jsx)(fc,{filteredSlugs:[l.slug],listMeetingsInPopup:!1,state:t,setState:e,mapbox:i})})]})]})}function xc({text:t,className:e}){return(0,vn.jsx)("div",{className:e,children:t.split("\n").filter((t=>t)).map(((t,e)=>(0,vn.jsx)("p",{children:t},e)))})}function bc(t,e,i,n){return t.map((({meetings:t,name:r},o)=>(0,vn.jsxs)("div",{children:[(0,vn.jsx)("h3",{className:"h6 mb-1 mt-2",children:r}),(0,vn.jsx)("ol",{className:"list-unstyled",children:t.map(((t,r)=>(0,vn.jsxs)("li",{className:"d-flex flex-row gap-2 justify-content-between m-0",children:[(0,vn.jsx)("div",{className:"text-muted text-nowrap",children:t.start.toFormat("t")}),(0,vn.jsx)("div",{className:"flex-grow-1",children:t.slug===e?(0,vn.jsx)(Un,{meeting:t}):(0,vn.jsx)(Un,{meeting:t,setState:n,state:i})}),(0,vn.jsxs)("div",{className:"align-items-start d-flex gap-1 justify-content-end pt-1",children:[t.isInPerson&&(0,vn.jsx)("small",{className:"align-items-center d-flex flex-row float-end gap-2 px-2 py-1 rounded text-sm in-person",children:(0,vn.jsx)(_n,{icon:"geo",size:13})}),t.isOnline&&(0,vn.jsxs)("small",{className:"align-items-center d-flex flex-row float-end gap-2 px-2 py-1 rounded text-sm online",children:[t.conference_provider&&(0,vn.jsx)(_n,{icon:"camera",size:13}),t.conference_phone&&(0,vn.jsx)(_n,{icon:"phone",size:13})]})]})]},r)))})]},o)))}function wc(t,e){return t?e?t.weekday===e.weekday?`${t.toFormat("cccc t")} – ${e.toFormat("t ZZZZ")}`:`${t.toFormat("cccc t")} – ${e.toFormat("cccc t ZZZZ")}`:t.toFormat("cccc t ZZZZ"):un.appointment}function kc(t){const e=document.getElementById("wp-admin-bar-root-default");if(!e)return;const i=document.getElementById("wp-admin-bar-edit-meeting");if(t){const i=document.createElement("a");i.setAttribute("class","ab-item"),i.setAttribute("href",t),i.appendChild(document.createTextNode("Edit Meeting"));const n=document.createElement("li");n.setAttribute("id","wp-admin-bar-edit-meeting"),n.appendChild(i),e.appendChild(n)}else i&&i.parentNode.removeChild(i)}var Ec=i(246),Tc=i.n(Ec);function Sc(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Cc(t){for(var e=1;e(document.body.classList.add("tsml-ui-table"),()=>{document.body.classList.remove("tsml-ui-table")})),[]);const f=sn.columns.filter((t=>s.includes(t))).filter((t=>m||"region"!==t)).filter((t=>h||"distance"!==t)).filter((t=>p||!["location","location_group"].includes(t))),g=(i,n)=>{if("address"===n){const t=[];return i.isInPerson&&t.push({className:"in-person",href:a?hn(i):void 0,icon:"geo",text:i.address}),i.conference_provider&&t.push({className:"online",href:a?i.conference_url:void 0,icon:"camera",text:i.conference_provider}),i.conference_phone&&t.push({className:"online",href:a?`tel:${i.conference_phone}`:void 0,icon:"phone",text:un.phone}),i.isInPerson||i.isOnline||t.push({className:"inactive",icon:"close",text:un.types.inactive}),(0,vn.jsx)("div",{className:"d-flex flex-wrap gap-1",children:t.map(((t,e)=>(0,vn.jsx)(xn,Cc({small:!0},t),e)))})}return"distance"===n&&i.distance?(0,vn.jsxs)(vn.Fragment,{children:[i.distance,(0,vn.jsx)("small",{className:"ms-1 text-muted",children:sn.distance_unit})]}):"location"===n?i.location:"location_group"===n?i.isInPerson?i.location:i.group:"name"===n&&i.slug?(0,vn.jsx)(Un,{meeting:i,state:t,setState:e}):"region"===n&&i.regions?i.regions[i.regions.length-1]:"time"===n?i.start?(0,vn.jsxs)("time",{className:"d-flex flex-column flex-lg-row gap-lg-1",children:[(0,vn.jsx)("span",{className:"text-nowrap text-lowercase",children:i.start.toFormat("t")}),(0,vn.jsx)("span",{className:"text-nowrap",children:i.start.toFormat("cccc")})]}):un.appointment:null},v=({slug:i})=>{const n=t.meetings[i];return(0,vn.jsx)("tr",{className:o({"cursor-pointer":!a},"d-block d-md-table-row"),onClick:()=>{a||e(Cc(Cc({},t),{},{input:Cc(Cc({},t.input),{},{meeting:n.slug})}))},children:f.map(((t,e)=>(0,vn.jsx)("td",{className:o("d-block d-md-table-cell",t),children:g(n,t)},e)))})};return!!i.length&&(0,vn.jsx)("div",{className:"row",children:(0,vn.jsxs)("table",{className:o("table table-striped flex-grow-1 my-0",{"clickable-rows":!a}),children:[(0,vn.jsx)("thead",{children:(0,vn.jsx)("tr",{className:"d-none d-md-table-row",children:f.map(((t,e)=>(0,vn.jsx)("th",{className:o("pt-0",t),children:un[t]},e)))})}),!!n.length&&(0,vn.jsx)("tbody",{className:"tsml-in-progress",children:u?n.map(((t,e)=>(0,vn.jsx)(v,{slug:t},e))):(0,vn.jsx)("tr",{children:(0,vn.jsx)("td",{className:"p-2 text-center rounded-0",colSpan:f.length,children:(0,vn.jsx)("button",{onClick:()=>d(!0),className:"alert-link bg-transparent border-0 d-block fw-normal mx-auto p-2 text-center text-decoration-underline w-100",children:1===n.length?un.in_progress_single:un.in_progress_multiple.replace("%count%",n.length)})})})}),(0,vn.jsx)(Tc(),{element:"tbody",loadMore:()=>{c(l+10)},hasMore:i.length>l,children:i.slice(0,l).map(((t,e)=>(0,vn.jsx)(v,{slug:t},e)))})]})})}function Ic({state:{indexes:t,input:e}}){if(!t||!e)return null;const i=[];Object.keys(un.title).forEach((n=>{if("meetings"===n)i.push(un.meetings);else if("search_with"===n&&"search"===e.mode&&e.search)i.push(un.title.search_with.replace("%search%",`‘${e.search}’`));else if("search_near"===n&&"location"===e.mode&&e.search)i.push(un.title.search_near.replace("%search%",`‘${e.search}’`));else if(t[n]&&e[n]?.length){const r=e[n].map((e=>Cn(t[n],e)?.name)).join(" + ");i.push(un.title[n].replace(`%${n}%`,r))}}));const n=i.join(" ");return document.title=n,(0,vn.jsx)("h1",{className:"fw-light mb-n1",children:n})}var Pc=i(379),Ac=i.n(Pc),Dc=i(460),Oc={insert:"head",singleton:!1};Ac()(Dc.Z,Oc);Dc.Z.locals;var Lc=i(809),Rc={insert:"head",singleton:!1};Ac()(Lc.Z,Rc);Lc.Z.locals;function Bc(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Fc(t){for(var e=1;e{const t=()=>{a(Fc(Fc({},o),{},{input:pn(window.location.search)}))};window.addEventListener("popstate",t);let e=document.querySelector('link[rel="canonical"]');return e||(e=document.createElement("link"),e.setAttribute("rel","canonical"),document.getElementsByTagName("head")[0]?.appendChild(e)),e.setAttribute("href",mn(o.input.meeting?{meeting:o.input.meeting}:o.input)),()=>{window.removeEventListener("popstate",t)}}),[o,window.location.search]),(0,r.useEffect)((()=>(document.body.classList.add("tsml-ui"),()=>{document.body.classList.remove("tsml-ui")})),[]),o.loading){console.log("TSML UI meeting finder: https://github.com/code4recovery/tsml-ui");const e=pn();if(t){const r=t.startsWith("https://docs.google.com/spreadsheets/d/")?t.split("/")[5]:void 0;r&&(i||a(Fc(Fc({},o),{},{error:"Configuration error: a Google API key is required.",loading:!1})),t=`https://sheets.googleapis.com/v4/spreadsheets/${r}/values/A1:ZZ?key=${i}`),t.endsWith(".json")&&e.meeting&&(t=`${t}?${(new Date).getTime()}`),fetch(t).then((t=>t.ok?t.json():Promise.reject(t.status))).then((t=>{if(r&&(t=function(t,e){if(!t.values)return;const i=[],n=t.values.shift().map((t=>gn(t).replaceAll("-","_"))).map((t=>"id"===t?"slug":t)).map((t=>"full_address"===t?"formatted_address":t));return t.values.forEach(((t,r)=>{if(!t.filter((t=>t)).length)return;const o={};if(n.forEach(((e,i)=>{o[e]=t[i]})),o.edit_url=`https://docs.google.com/spreadsheets/d/${e}/edit#gid=0&range=${r+2}:${r+2}+`,o.time){const t=rn.fromFormat(o.time,"h:mm a",{locale:"en"});t.isValid?o.time=t.toFormat("HH:mm"):(o.time=void 0,console.warn(`TSML UI error parsing ${o.time} (${t.invalidExplanation}): ${o.edit_url}`))}if(o.end_time){const t=rn.fromFormat(o.end_time,"h:mm a",{locale:"en"});t.isValid?o.end_time=t.toFormat("HH:mm"):(o.end_time=void 0,console.warn(`TSML UI error parsing ${o.end_time} (${t.invalidExplanation}): ${o.edit_url}`))}i.push(o)})),i}(t,r)),!Array.isArray(t)||!t.length)return a(Fc(Fc({},o),{},{error:"Configuration error: data is not in the correct format.",loading:!1,ready:!0}));const[i,s,l]=Pn(t,o.capabilities,n);if(!n&&!Object.keys(i).length)return a(Fc(Fc({},o),{},{error:"Configuration error: time zone is not set.",loading:!1,ready:!0}));const c=(!e.latitude||!e.longitude)&&("location"===e.mode&&e.search||"me"===e.mode);a(Fc(Fc({},o),{},{capabilities:l,indexes:s,input:e,loading:!1,meetings:i,ready:!c}))})).catch((t=>{const e={400:"bad request",401:"unauthorized",403:"forbidden",404:"not found",429:"too many requests",500:"internal server",502:"bad gateway",503:"service unavailable",504:"gateway timeout"};a(Fc(Fc({},o),{},{error:e[t]?`Error: ${e[t]} (${t}) when ${r?"contacting Google":"loading data"}.`:t.toString(),loading:!1,ready:!0}))}))}else a(Fc(Fc({},o),{},{error:"Configuration error: a data source must be specified.",loading:!1,ready:!0}))}!function(t){const e=mn(t);window.location.href!==e&&window.history.pushState("","",e)}(o.input);const[s,l]=function(t,e,i){const n=[],r=rn.now(),o=r.plus({minute:sn.now_offset}),a=Object.keys(t.meetings),s={};if(sn.filters.forEach((e=>{t.input[e]?.length&&t.capabilities[e]&&("type"===e?t.input.type.forEach((i=>n.push(Cn(t.indexes[e],i)?.slugs??[]))):n.push([].concat.apply([],t.input[e].map((i=>Cn(t.indexes[e],i)?.slugs??[])))))})),"search"===t.input.mode){if(t.input.search){const e=t.input.search.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replaceAll(" OR ","|").toLowerCase().split("|").map((t=>t.split('"'))).map((t=>[...new Set(t.filter(((t,e)=>e%2)).concat(t.filter(((t,e)=>!(e%2))).join(" ").split(" ")).filter((t=>t)))])).filter((t=>t.length)),i=a.filter((i=>e.some((e=>e.every((e=>-1!==t.meetings[i].search.search(e)))))));n.push([].concat.apply([],i))}}else["me","location"].includes(t.input.mode)&&(n.push(a.filter((e=>t.meetings[e].latitude&&t.meetings[e].latitude))),t.input.latitude&&t.input.longitude||(t.input.search&&"location"===t.input.mode?fetch(`https://api.mapbox.com/geocoding/v5/mapbox.places/${t.input.search}.json?${new URLSearchParams({access_token:i,autocomplete:!1,language:sn.language})}`).then((t=>t.json())).then((i=>{i.features&&i.features.length&&Sn(i.features[0].center[1],i.features[0].center[0],l,t,e)})):"me"===t.input.mode&&navigator.geolocation.getCurrentPosition((i=>{Sn(i.coords.latitude,i.coords.longitude,l,t,e)}),(t=>{console.warn(`TSML UI geolocation error: ${t}`)}),{timeout:5e3})));const l=n.length?n.shift().filter((t=>n.every((e=>e.includes(t))))):a;a.forEach((e=>{s[e]=t.meetings[e].start?.diff(r,"minutes").minutes??-9999,s[e]{const n=t.meetings[e],r=t.meetings[i];if(n.time&&!r.time)return-1;if(!n.time&&r.time)return 1;if(t.input.weekday.length){if(n.minutes_week!==r.minutes_week)return n.minutes_week-r.minutes_week}else if(s[e]!==s[i])return s[e]-s[i];return n.distance!==r.distance?null===n.distance?-1:null===r.distance?1:n.distance-r.distance:n.name!==r.name?n.name?r.name?n.name.localeCompare(r.name):1:-1:n.location!==r.location?n.location?r.location?n.location.localeCompare(r.location):1:-1:0}));const c=t.input.weekday?.length?[]:l.filter((e=>t.meetings[e].startr&&!t.meetings[e].types.includes("inactive")));return[l,c]}(o,a,e);return o.alert=s.length?void 0:un.no_results,o.input.meeting&&!o.meetings[o.input.meeting]&&(o.error=un.not_found),o.ready?(0,vn.jsx)("div",{className:"tsml-ui",children:(0,vn.jsx)("div",{className:"container-fluid d-flex flex-column py-3",children:o.input.meeting&&o.input.meeting in o.meetings?(0,vn.jsx)(_c,{state:o,setState:a,mapbox:e,feedback_emails:sn.feedback_emails}):(0,vn.jsxs)("div",{className:"d-grid gap-3",children:[sn.show.title&&(0,vn.jsx)(Ic,{state:o}),sn.show.controls&&(0,vn.jsx)(Fn,{state:o,setState:a,mapbox:e}),(o.alert||o.error)&&(0,vn.jsx)(Dn,{state:o,setState:a}),s&&"table"===o.input.view&&(0,vn.jsx)(zc,{state:o,setState:a,filteredSlugs:s,inProgress:l,listButtons:sn.show.listButtons}),s&&"map"===o.input.view&&(0,vn.jsx)(fc,{state:o,setState:a,filteredSlugs:s,mapbox:e})]})})}):(0,vn.jsx)("div",{className:"tsml-ui",children:(0,vn.jsx)(Zn,{})})}const Vc=document.getElementById("tsml-ui");Vc?n.render((0,vn.jsx)(Nc,{google:Vc.getAttribute("data-google"),mapbox:Vc.getAttribute("data-mapbox"),src:Vc.getAttribute("data-src"),timezone:Vc.getAttribute("data-timezone")}),Vc):console.warn("TSML UI could not find a div#tsml-ui element")},809:(t,e,i)=>{"use strict";i.d(e,{Z:()=>o});var n=i(645),r=i.n(n)()((function(t){return t[1]}));r.push([t.id,".mapboxgl-map{-webkit-tap-highlight-color:rgba(0,0,0,0);font:12px/20px Helvetica Neue,Arial,Helvetica,sans-serif;overflow:hidden;position:relative}.mapboxgl-canvas{left:0;position:absolute;top:0}.mapboxgl-map:-webkit-full-screen{height:100%;width:100%}.mapboxgl-canary{background-color:salmon}.mapboxgl-canvas-container.mapboxgl-interactive,.mapboxgl-ctrl-group button.mapboxgl-ctrl-compass{cursor:-webkit-grab;cursor:grab;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.mapboxgl-canvas-container.mapboxgl-interactive.mapboxgl-track-pointer{cursor:pointer}.mapboxgl-canvas-container.mapboxgl-interactive:active,.mapboxgl-ctrl-group button.mapboxgl-ctrl-compass:active{cursor:-webkit-grabbing;cursor:grabbing}.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate,.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate .mapboxgl-canvas{touch-action:pan-x pan-y}.mapboxgl-canvas-container.mapboxgl-touch-drag-pan,.mapboxgl-canvas-container.mapboxgl-touch-drag-pan .mapboxgl-canvas{touch-action:pinch-zoom}.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate.mapboxgl-touch-drag-pan,.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate.mapboxgl-touch-drag-pan .mapboxgl-canvas{touch-action:none}.mapboxgl-ctrl-bottom-left,.mapboxgl-ctrl-bottom-right,.mapboxgl-ctrl-top-left,.mapboxgl-ctrl-top-right{pointer-events:none;position:absolute;z-index:2}.mapboxgl-ctrl-top-left{left:0;top:0}.mapboxgl-ctrl-top-right{right:0;top:0}.mapboxgl-ctrl-bottom-left{bottom:0;left:0}.mapboxgl-ctrl-bottom-right{bottom:0;right:0}.mapboxgl-ctrl{clear:both;pointer-events:auto;transform:translate(0)}.mapboxgl-ctrl-top-left .mapboxgl-ctrl{float:left;margin:10px 0 0 10px}.mapboxgl-ctrl-top-right .mapboxgl-ctrl{float:right;margin:10px 10px 0 0}.mapboxgl-ctrl-bottom-left .mapboxgl-ctrl{float:left;margin:0 0 10px 10px}.mapboxgl-ctrl-bottom-right .mapboxgl-ctrl{float:right;margin:0 10px 10px 0}.mapboxgl-ctrl-group{background:#fff;border-radius:4px}.mapboxgl-ctrl-group:not(:empty){box-shadow:0 0 0 2px rgba(0,0,0,.1)}@media (-ms-high-contrast:active){.mapboxgl-ctrl-group:not(:empty){box-shadow:0 0 0 2px ButtonText}}.mapboxgl-ctrl-group button{background-color:transparent;border:0;box-sizing:border-box;cursor:pointer;display:block;height:29px;outline:none;overflow:hidden;padding:0;width:29px}.mapboxgl-ctrl-group button+button{border-top:1px solid #ddd}.mapboxgl-ctrl button .mapboxgl-ctrl-icon{background-position:50%;background-repeat:no-repeat;display:block;height:100%;width:100%}@media (-ms-high-contrast:active){.mapboxgl-ctrl-icon{background-color:transparent}.mapboxgl-ctrl-group button+button{border-top:1px solid ButtonText}}.mapboxgl-ctrl-attrib-button:focus,.mapboxgl-ctrl-group button:focus{box-shadow:0 0 2px 2px #0096ff}.mapboxgl-ctrl button:disabled{cursor:not-allowed}.mapboxgl-ctrl button:disabled .mapboxgl-ctrl-icon{opacity:.25}.mapboxgl-ctrl button:not(:disabled):hover{background-color:rgba(0,0,0,.05)}.mapboxgl-ctrl-group button:focus:focus-visible{box-shadow:0 0 2px 2px #0096ff}.mapboxgl-ctrl-group button:focus:not(:focus-visible){box-shadow:none}.mapboxgl-ctrl-group button:focus:first-child{border-radius:4px 4px 0 0}.mapboxgl-ctrl-group button:focus:last-child{border-radius:0 0 4px 4px}.mapboxgl-ctrl-group button:focus:only-child{border-radius:inherit}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E\")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E\")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E\")}}.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E\")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E\")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E\")}}.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='m10.5 14 4-8 4 8h-8z'/%3E%3Cpath d='m10.5 16 4 8 4-8h-8z' fill='%23ccc'/%3E%3C/svg%3E\")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='m10.5 14 4-8 4 8h-8z'/%3E%3Cpath d='m10.5 16 4 8 4-8h-8z' fill='%23999'/%3E%3C/svg%3E\")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m10.5 14 4-8 4 8h-8z'/%3E%3Cpath d='m10.5 16 4 8 4-8h-8z' fill='%23ccc'/%3E%3C/svg%3E\")}}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23aaa'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath d='m14 5 1 1-9 9-1-1 9-9z' fill='red'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active-error .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e58978'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background-error .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e54e33'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-waiting .mapboxgl-ctrl-icon{-webkit-animation:mapboxgl-spin 2s linear infinite;animation:mapboxgl-spin 2s linear infinite}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23999'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath d='m14 5 1 1-9 9-1-1 9-9z' fill='red'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active-error .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e58978'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background-error .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e54e33'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3C/svg%3E\")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23666'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath d='m14 5 1 1-9 9-1-1 9-9z' fill='red'/%3E%3C/svg%3E\")}}@-webkit-keyframes mapboxgl-spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}@keyframes mapboxgl-spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}a.mapboxgl-ctrl-logo{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='88' height='23' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd'%3E%3Cdefs%3E%3Cpath id='a' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 0 1 3.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='b' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 0 0-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 0 0 4.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 0 1-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 0 1 .3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 0 1-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='c'%3E%3Crect width='100%25' height='100%25' fill='%23fff'/%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/mask%3E%3Cg opacity='.3' stroke='%23000' stroke-width='3'%3E%3Ccircle mask='url(%23c)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23b' mask='url(%23c)'/%3E%3C/g%3E%3Cg opacity='.9' fill='%23fff'%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/g%3E%3C/svg%3E\");background-repeat:no-repeat;cursor:pointer;display:block;height:23px;margin:0 0 -4px -4px;overflow:hidden;width:88px}a.mapboxgl-ctrl-logo.mapboxgl-compact{width:23px}@media (-ms-high-contrast:active){a.mapboxgl-ctrl-logo{background-color:transparent;background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='88' height='23' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd'%3E%3Cdefs%3E%3Cpath id='a' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 0 1 3.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='b' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 0 0-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 0 0 4.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 0 1-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 0 1 .3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 0 1-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='c'%3E%3Crect width='100%25' height='100%25' fill='%23fff'/%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/mask%3E%3Cg stroke='%23000' stroke-width='3'%3E%3Ccircle mask='url(%23c)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23b' mask='url(%23c)'/%3E%3C/g%3E%3Cg fill='%23fff'%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/g%3E%3C/svg%3E\")}}@media (-ms-high-contrast:black-on-white){a.mapboxgl-ctrl-logo{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='88' height='23' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd'%3E%3Cdefs%3E%3Cpath id='a' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 0 1 3.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='b' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 0 0-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 0 0 4.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 0 1-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 0 1 .3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 0 1-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='c'%3E%3Crect width='100%25' height='100%25' fill='%23fff'/%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/mask%3E%3Cg stroke='%23fff' stroke-width='3' fill='%23fff'%3E%3Ccircle mask='url(%23c)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23b' mask='url(%23c)'/%3E%3C/g%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/svg%3E\")}}.mapboxgl-ctrl.mapboxgl-ctrl-attrib{background-color:hsla(0,0%,100%,.5);margin:0;padding:0 5px}@media screen{.mapboxgl-ctrl-attrib.mapboxgl-compact{background-color:#fff;border-radius:12px;margin:10px;min-height:20px;padding:2px 24px 2px 0;position:relative}.mapboxgl-ctrl-attrib.mapboxgl-compact-show{padding:2px 28px 2px 8px;visibility:visible}.mapboxgl-ctrl-bottom-left>.mapboxgl-ctrl-attrib.mapboxgl-compact-show,.mapboxgl-ctrl-top-left>.mapboxgl-ctrl-attrib.mapboxgl-compact-show{border-radius:12px;padding:2px 8px 2px 28px}.mapboxgl-ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-inner{display:none}.mapboxgl-ctrl-attrib-button{background-color:hsla(0,0%,100%,.5);background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E\");border:0;border-radius:12px;box-sizing:border-box;cursor:pointer;display:none;height:24px;outline:none;position:absolute;right:0;top:0;width:24px}.mapboxgl-ctrl-bottom-left .mapboxgl-ctrl-attrib-button,.mapboxgl-ctrl-top-left .mapboxgl-ctrl-attrib-button{left:0}.mapboxgl-ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-button,.mapboxgl-ctrl-attrib.mapboxgl-compact-show .mapboxgl-ctrl-attrib-inner{display:block}.mapboxgl-ctrl-attrib.mapboxgl-compact-show .mapboxgl-ctrl-attrib-button{background-color:rgba(0,0,0,.05)}.mapboxgl-ctrl-bottom-right>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{bottom:0;right:0}.mapboxgl-ctrl-top-right>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{right:0;top:0}.mapboxgl-ctrl-top-left>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{left:0;top:0}.mapboxgl-ctrl-bottom-left>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{bottom:0;left:0}}@media screen and (-ms-high-contrast:active){.mapboxgl-ctrl-attrib.mapboxgl-compact:after{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd' fill='%23fff'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E\")}}@media screen and (-ms-high-contrast:black-on-white){.mapboxgl-ctrl-attrib.mapboxgl-compact:after{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E\")}}.mapboxgl-ctrl-attrib a{color:rgba(0,0,0,.75);text-decoration:none}.mapboxgl-ctrl-attrib a:hover{color:inherit;text-decoration:underline}.mapboxgl-ctrl-attrib .mapbox-improve-map{font-weight:700;margin-left:2px}.mapboxgl-attrib-empty{display:none}.mapboxgl-ctrl-scale{background-color:hsla(0,0%,100%,.75);border:2px solid #333;border-top:#333;box-sizing:border-box;color:#333;font-size:10px;padding:0 5px}.mapboxgl-popup{display:flex;left:0;pointer-events:none;position:absolute;top:0;will-change:transform}.mapboxgl-popup-anchor-top,.mapboxgl-popup-anchor-top-left,.mapboxgl-popup-anchor-top-right{flex-direction:column}.mapboxgl-popup-anchor-bottom,.mapboxgl-popup-anchor-bottom-left,.mapboxgl-popup-anchor-bottom-right{flex-direction:column-reverse}.mapboxgl-popup-anchor-left{flex-direction:row}.mapboxgl-popup-anchor-right{flex-direction:row-reverse}.mapboxgl-popup-tip{border:10px solid transparent;height:0;width:0;z-index:1}.mapboxgl-popup-anchor-top .mapboxgl-popup-tip{align-self:center;border-bottom-color:#fff;border-top:none}.mapboxgl-popup-anchor-top-left .mapboxgl-popup-tip{align-self:flex-start;border-bottom-color:#fff;border-left:none;border-top:none}.mapboxgl-popup-anchor-top-right .mapboxgl-popup-tip{align-self:flex-end;border-bottom-color:#fff;border-right:none;border-top:none}.mapboxgl-popup-anchor-bottom .mapboxgl-popup-tip{align-self:center;border-bottom:none;border-top-color:#fff}.mapboxgl-popup-anchor-bottom-left .mapboxgl-popup-tip{align-self:flex-start;border-bottom:none;border-left:none;border-top-color:#fff}.mapboxgl-popup-anchor-bottom-right .mapboxgl-popup-tip{align-self:flex-end;border-bottom:none;border-right:none;border-top-color:#fff}.mapboxgl-popup-anchor-left .mapboxgl-popup-tip{align-self:center;border-left:none;border-right-color:#fff}.mapboxgl-popup-anchor-right .mapboxgl-popup-tip{align-self:center;border-left-color:#fff;border-right:none}.mapboxgl-popup-close-button{background-color:transparent;border:0;border-radius:0 3px 0 0;cursor:pointer;position:absolute;right:0;top:0}.mapboxgl-popup-close-button:hover{background-color:rgba(0,0,0,.05)}.mapboxgl-popup-content{background:#fff;border-radius:3px;box-shadow:0 1px 2px rgba(0,0,0,.1);padding:10px 10px 15px;pointer-events:auto;position:relative}.mapboxgl-popup-anchor-top-left .mapboxgl-popup-content{border-top-left-radius:0}.mapboxgl-popup-anchor-top-right .mapboxgl-popup-content{border-top-right-radius:0}.mapboxgl-popup-anchor-bottom-left .mapboxgl-popup-content{border-bottom-left-radius:0}.mapboxgl-popup-anchor-bottom-right .mapboxgl-popup-content{border-bottom-right-radius:0}.mapboxgl-popup-track-pointer{display:none}.mapboxgl-popup-track-pointer *{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.mapboxgl-map:hover .mapboxgl-popup-track-pointer{display:flex}.mapboxgl-map:active .mapboxgl-popup-track-pointer{display:none}.mapboxgl-marker{left:0;opacity:1;position:absolute;top:0;transition:opacity .2s;will-change:transform}.mapboxgl-user-location-dot,.mapboxgl-user-location-dot:before{background-color:#1da1f2;border-radius:50%;height:15px;width:15px}.mapboxgl-user-location-dot:before{-webkit-animation:mapboxgl-user-location-dot-pulse 2s infinite;animation:mapboxgl-user-location-dot-pulse 2s infinite;content:\"\";position:absolute}.mapboxgl-user-location-dot:after{border:2px solid #fff;border-radius:50%;box-shadow:0 0 3px rgba(0,0,0,.35);box-sizing:border-box;content:\"\";height:19px;left:-2px;position:absolute;top:-2px;width:19px}.mapboxgl-user-location-show-heading .mapboxgl-user-location-heading{height:0;width:0}.mapboxgl-user-location-show-heading .mapboxgl-user-location-heading:after,.mapboxgl-user-location-show-heading .mapboxgl-user-location-heading:before{border-bottom:7.5px solid #4aa1eb;content:\"\";position:absolute}.mapboxgl-user-location-show-heading .mapboxgl-user-location-heading:before{border-left:7.5px solid transparent;transform:translateY(-28px) skewY(-20deg)}.mapboxgl-user-location-show-heading .mapboxgl-user-location-heading:after{border-right:7.5px solid transparent;transform:translate(7.5px,-28px) skewY(20deg)}@-webkit-keyframes mapboxgl-user-location-dot-pulse{0%{opacity:1;transform:scale(1)}70%{opacity:0;transform:scale(3)}to{opacity:0;transform:scale(1)}}@keyframes mapboxgl-user-location-dot-pulse{0%{opacity:1;transform:scale(1)}70%{opacity:0;transform:scale(3)}to{opacity:0;transform:scale(1)}}.mapboxgl-user-location-dot-stale{background-color:#aaa}.mapboxgl-user-location-dot-stale:after{display:none}.mapboxgl-user-location-accuracy-circle{background-color:rgba(29,161,242,.2);border-radius:100%;height:1px;width:1px}.mapboxgl-crosshair,.mapboxgl-crosshair .mapboxgl-interactive,.mapboxgl-crosshair .mapboxgl-interactive:active{cursor:crosshair}.mapboxgl-boxzoom{background:#fff;border:2px dotted #202020;height:0;left:0;opacity:.5;position:absolute;top:0;width:0}@media print{.mapbox-improve-map{display:none}}.mapboxgl-scroll-zoom-blocker,.mapboxgl-touch-pan-blocker{align-items:center;background:rgba(0,0,0,.7);color:#fff;display:flex;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif;height:100%;justify-content:center;left:0;opacity:0;pointer-events:none;position:absolute;text-align:center;top:0;transition:opacity .75s ease-in-out;transition-delay:1s;width:100%}.mapboxgl-scroll-zoom-blocker-show,.mapboxgl-touch-pan-blocker-show{opacity:1;transition:opacity .1s ease-in-out}.mapboxgl-canvas-container.mapboxgl-touch-pan-blocker-override.mapboxgl-scrollable-page,.mapboxgl-canvas-container.mapboxgl-touch-pan-blocker-override.mapboxgl-scrollable-page .mapboxgl-canvas{touch-action:pan-x pan-y}",""]);const o=r},460:(t,e,i)=>{"use strict";i.d(e,{Z:()=>o});var n=i(645),r=i.n(n)()((function(t){return t[1]}));r.push([t.id,"@charset \"UTF-8\";body,div#tsml-ui,div.tsml-ui,html{height:100%;margin:0 auto}div.tsml-ui{-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-text-size-adjust:100%;background-color:#fff!important;color:#212529!important;font-family:system-ui,-apple-system,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,Liberation Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji!important;font-weight:400!important;line-height:1.5!important}div.tsml-ui :root{--bs-blue:#0d6efd;--bs-indigo:#6610f2;--bs-purple:#6f42c1;--bs-pink:#d63384;--bs-red:#dc3545;--bs-orange:#fd7e14;--bs-yellow:#ffc107;--bs-green:#198754;--bs-teal:#20c997;--bs-cyan:#0dcaf0;--bs-white:#fff;--bs-gray:#6c757d;--bs-gray-dark:#343a40;--bs-gray-100:#f8f9fa;--bs-gray-200:#e9ecef;--bs-gray-300:#dee2e6;--bs-gray-400:#ced4da;--bs-gray-500:#adb5bd;--bs-gray-600:#6c757d;--bs-gray-700:#495057;--bs-gray-800:#343a40;--bs-gray-900:#212529;--bs-primary:#0d6efd;--bs-secondary:#6c757d;--bs-success:#198754;--bs-info:#0dcaf0;--bs-warning:#ffc107;--bs-danger:#dc3545;--bs-light:#f8f9fa;--bs-dark:#212529;--bs-primary-rgb:13,110,253;--bs-secondary-rgb:108,117,125;--bs-success-rgb:25,135,84;--bs-info-rgb:13,202,240;--bs-warning-rgb:255,193,7;--bs-danger-rgb:220,53,69;--bs-light-rgb:248,249,250;--bs-dark-rgb:33,37,41;--bs-white-rgb:255,255,255;--bs-black-rgb:0,0,0;--bs-body-color-rgb:33,37,41;--bs-body-bg-rgb:255,255,255;--bs-font-sans-serif:system-ui,-apple-system,\"Segoe UI\",Roboto,\"Helvetica Neue\",Arial,\"Noto Sans\",\"Liberation Sans\",sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\",\"Segoe UI Symbol\",\"Noto Color Emoji\";--bs-font-monospace:SFMono-Regular,Menlo,Monaco,Consolas,\"Liberation Mono\",\"Courier New\",monospace;--bs-gradient:linear-gradient(180deg,hsla(0,0%,100%,.15),hsla(0,0%,100%,0));--bs-body-font-family:var(--bs-font-sans-serif);--bs-body-font-size:1rem;--bs-body-font-weight:400;--bs-body-line-height:1.5;--bs-body-color:#212529;--bs-body-bg:#fff}div.tsml-ui *,div.tsml-ui :after,div.tsml-ui :before{box-sizing:border-box}@media (prefers-reduced-motion:no-preference){div.tsml-ui :root{scroll-behavior:smooth}}div.tsml-ui body{-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:rgba(0,0,0,0);background-color:var(--bs-body-bg);color:var(--bs-body-color);font-family:var(--bs-body-font-family);font-size:var(--bs-body-font-size);font-weight:var(--bs-body-font-weight);line-height:var(--bs-body-line-height);margin:0;text-align:var(--bs-body-text-align)}div.tsml-ui hr{background-color:currentColor;border:0;color:inherit;margin:16px 0;opacity:.25}div.tsml-ui hr:not([size]){height:1px}div.tsml-ui .h1,div.tsml-ui .h2,div.tsml-ui .h3,div.tsml-ui .h4,div.tsml-ui .h5,div.tsml-ui .h6,div.tsml-ui h1,div.tsml-ui h2,div.tsml-ui h3,div.tsml-ui h4,div.tsml-ui h5,div.tsml-ui h6{font-weight:500;line-height:1.2;margin-bottom:8px;margin-top:0}div.tsml-ui .h1,div.tsml-ui h1{font-size:calc(22px + 1.5vw)}@media (min-width:1200px){div.tsml-ui .h1,div.tsml-ui h1{font-size:40px}}div.tsml-ui .h2,div.tsml-ui h2{font-size:calc(21.2px + .9vw)}@media (min-width:1200px){div.tsml-ui .h2,div.tsml-ui h2{font-size:32px}}div.tsml-ui .h3,div.tsml-ui h3{font-size:calc(20.8px + .6vw)}@media (min-width:1200px){div.tsml-ui .h3,div.tsml-ui h3{font-size:28px}}div.tsml-ui .h4,div.tsml-ui h4{font-size:calc(20.4px + .3vw)}@media (min-width:1200px){div.tsml-ui .h4,div.tsml-ui h4{font-size:24px}}div.tsml-ui .h5,div.tsml-ui h5{font-size:20px}div.tsml-ui .h6,div.tsml-ui h6{font-size:16px}div.tsml-ui p{margin-bottom:1rem;margin-top:0}div.tsml-ui abbr[data-bs-original-title],div.tsml-ui abbr[title]{cursor:help;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;-webkit-text-decoration-skip-ink:none;text-decoration-skip-ink:none}div.tsml-ui address{font-style:normal;line-height:inherit;margin-bottom:1rem}div.tsml-ui ol,div.tsml-ui ul{padding-left:2rem}div.tsml-ui dl,div.tsml-ui ol,div.tsml-ui ul{margin-bottom:1rem;margin-top:0}div.tsml-ui ol ol,div.tsml-ui ol ul,div.tsml-ui ul ol,div.tsml-ui ul ul{margin-bottom:0}div.tsml-ui dt{font-weight:700}div.tsml-ui dd{margin-bottom:.5rem;margin-left:0}div.tsml-ui blockquote{margin:0 0 1rem}div.tsml-ui b,div.tsml-ui strong{font-weight:bolder}div.tsml-ui .small,div.tsml-ui small{font-size:.875em}div.tsml-ui .mark,div.tsml-ui mark{background-color:#fcf8e3;padding:.2em}div.tsml-ui sub,div.tsml-ui sup{font-size:.75em;line-height:0;position:relative;vertical-align:baseline}div.tsml-ui sub{bottom:-.25em}div.tsml-ui sup{top:-.5em}div.tsml-ui a{color:#0d6efd;text-decoration:underline}div.tsml-ui a:hover{color:#0a58ca}div.tsml-ui a:not([href]):not([class]),div.tsml-ui a:not([href]):not([class]):hover{color:inherit;text-decoration:none}div.tsml-ui code,div.tsml-ui kbd,div.tsml-ui pre,div.tsml-ui samp{direction:ltr;font-family:var(--bs-font-monospace);font-size:1em;unicode-bidi:bidi-override}div.tsml-ui pre{display:block;font-size:.875em;margin-bottom:1rem;margin-top:0;overflow:auto}div.tsml-ui pre code{color:inherit;font-size:inherit;word-break:normal}div.tsml-ui code{word-wrap:break-word;color:#d63384;font-size:.875em}a>div.tsml-ui code{color:inherit}div.tsml-ui kbd{background-color:#212529;border-radius:.2rem;color:#fff;font-size:.875em;padding:.2rem .4rem}div.tsml-ui kbd kbd{font-size:1em;font-weight:700;padding:0}div.tsml-ui figure{margin:0 0 1rem}div.tsml-ui img,div.tsml-ui svg{vertical-align:middle}div.tsml-ui table{border-collapse:collapse;caption-side:bottom}div.tsml-ui caption{color:#6c757d;padding-bottom:8px;padding-top:8px;text-align:left}div.tsml-ui th{text-align:inherit;text-align:-webkit-match-parent}div.tsml-ui tbody,div.tsml-ui td,div.tsml-ui tfoot,div.tsml-ui th,div.tsml-ui thead,div.tsml-ui tr{border:0 solid;border-color:inherit}div.tsml-ui label{display:inline-block}div.tsml-ui button{border-radius:0}div.tsml-ui button:focus:not(:focus-visible){outline:0}div.tsml-ui button,div.tsml-ui input,div.tsml-ui optgroup,div.tsml-ui select,div.tsml-ui textarea{font-family:inherit;font-size:inherit;line-height:inherit;margin:0}div.tsml-ui button,div.tsml-ui select{text-transform:none}div.tsml-ui [role=button]{cursor:pointer}div.tsml-ui select{word-wrap:normal}div.tsml-ui select:disabled{opacity:1}div.tsml-ui [list]::-webkit-calendar-picker-indicator{display:none}div.tsml-ui [type=button],div.tsml-ui [type=reset],div.tsml-ui [type=submit],div.tsml-ui button{-webkit-appearance:button}div.tsml-ui [type=button]:not(:disabled),div.tsml-ui [type=reset]:not(:disabled),div.tsml-ui [type=submit]:not(:disabled),div.tsml-ui button:not(:disabled){cursor:pointer}div.tsml-ui ::-moz-focus-inner{border-style:none;padding:0}div.tsml-ui textarea{resize:vertical}div.tsml-ui fieldset{border:0;margin:0;min-width:0;padding:0}div.tsml-ui legend{float:left;font-size:calc(20.4px + .3vw);line-height:inherit;margin-bottom:.5rem;padding:0;width:100%}@media (min-width:1200px){div.tsml-ui legend{font-size:24px}}div.tsml-ui legend+*{clear:left}div.tsml-ui ::-webkit-datetime-edit-day-field,div.tsml-ui ::-webkit-datetime-edit-fields-wrapper,div.tsml-ui ::-webkit-datetime-edit-hour-field,div.tsml-ui ::-webkit-datetime-edit-minute,div.tsml-ui ::-webkit-datetime-edit-month-field,div.tsml-ui ::-webkit-datetime-edit-text,div.tsml-ui ::-webkit-datetime-edit-year-field{padding:0}div.tsml-ui ::-webkit-inner-spin-button{height:auto}div.tsml-ui [type=search]{-webkit-appearance:textfield;outline-offset:-2px}div.tsml-ui ::-webkit-search-decoration{-webkit-appearance:none}div.tsml-ui ::-webkit-color-swatch-wrapper{padding:0}div.tsml-ui ::file-selector-button{font:inherit}div.tsml-ui ::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}div.tsml-ui output{display:inline-block}div.tsml-ui iframe{border:0}div.tsml-ui summary{cursor:pointer;display:list-item}div.tsml-ui progress{vertical-align:baseline}div.tsml-ui [hidden]{display:none!important}div.tsml-ui .lead{font-size:20px;font-weight:300}div.tsml-ui .display-1{font-size:calc(26px + 4.5vw);font-weight:300;line-height:1.2}@media (min-width:1200px){div.tsml-ui .display-1{font-size:80px}}div.tsml-ui .display-2{font-size:calc(25.2px + 3.9vw);font-weight:300;line-height:1.2}@media (min-width:1200px){div.tsml-ui .display-2{font-size:72px}}div.tsml-ui .display-3{font-size:calc(24.4px + 3.3vw);font-weight:300;line-height:1.2}@media (min-width:1200px){div.tsml-ui .display-3{font-size:64px}}div.tsml-ui .display-4{font-size:calc(23.6px + 2.7vw);font-weight:300;line-height:1.2}@media (min-width:1200px){div.tsml-ui .display-4{font-size:56px}}div.tsml-ui .display-5{font-size:calc(22.8px + 2.1vw);font-weight:300;line-height:1.2}@media (min-width:1200px){div.tsml-ui .display-5{font-size:48px}}div.tsml-ui .display-6{font-size:calc(22px + 1.5vw);font-weight:300;line-height:1.2}@media (min-width:1200px){div.tsml-ui .display-6{font-size:40px}}div.tsml-ui .list-inline,div.tsml-ui .list-unstyled{list-style:none;padding-left:0}div.tsml-ui .list-inline-item{display:inline-block}div.tsml-ui .list-inline-item:not(:last-child){margin-right:.5rem}div.tsml-ui .initialism{font-size:.875em;text-transform:uppercase}div.tsml-ui .blockquote{font-size:20px;margin-bottom:16px}div.tsml-ui .blockquote>:last-child{margin-bottom:0}div.tsml-ui .blockquote-footer{color:#6c757d;font-size:.875em;margin-bottom:16px;margin-top:-16px}div.tsml-ui .blockquote-footer:before{content:\"— \"}div.tsml-ui .container,div.tsml-ui .container-fluid,div.tsml-ui .container-lg,div.tsml-ui .container-md,div.tsml-ui .container-sm,div.tsml-ui .container-xl,div.tsml-ui .container-xxl{margin-left:auto;margin-right:auto;padding-left:var(--bs-gutter-x,12px);padding-right:var(--bs-gutter-x,12px);width:100%}@media (min-width:576px){div.tsml-ui .container,div.tsml-ui .container-sm{max-width:540px}}@media (min-width:768px){div.tsml-ui .container,div.tsml-ui .container-md,div.tsml-ui .container-sm{max-width:720px}}@media (min-width:992px){div.tsml-ui .container,div.tsml-ui .container-lg,div.tsml-ui .container-md,div.tsml-ui .container-sm{max-width:960px}}@media (min-width:1200px){div.tsml-ui .container,div.tsml-ui .container-lg,div.tsml-ui .container-md,div.tsml-ui .container-sm,div.tsml-ui .container-xl{max-width:1140px}}@media (min-width:1400px){div.tsml-ui .container,div.tsml-ui .container-lg,div.tsml-ui .container-md,div.tsml-ui .container-sm,div.tsml-ui .container-xl,div.tsml-ui .container-xxl{max-width:1320px}}div.tsml-ui .row{--bs-gutter-x:24px;--bs-gutter-y:0;display:flex;flex-wrap:wrap;margin-left:calc(var(--bs-gutter-x)*-.5);margin-right:calc(var(--bs-gutter-x)*-.5);margin-top:calc(var(--bs-gutter-y)*-1)}div.tsml-ui .row>*{flex-shrink:0;margin-top:var(--bs-gutter-y);max-width:100%;padding-left:calc(var(--bs-gutter-x)*.5);padding-right:calc(var(--bs-gutter-x)*.5);width:100%}div.tsml-ui .col{flex:1 0 0%}div.tsml-ui .row-cols-auto>*{flex:0 0 auto;width:auto}div.tsml-ui .row-cols-1>*{flex:0 0 auto;width:100%}div.tsml-ui .row-cols-2>*{flex:0 0 auto;width:50%}div.tsml-ui .row-cols-3>*{flex:0 0 auto;width:33.3333333333%}div.tsml-ui .row-cols-4>*{flex:0 0 auto;width:25%}div.tsml-ui .row-cols-5>*{flex:0 0 auto;width:20%}div.tsml-ui .row-cols-6>*{flex:0 0 auto;width:16.6666666667%}div.tsml-ui .col-auto{flex:0 0 auto;width:auto}div.tsml-ui .col-1{flex:0 0 auto;width:8.33333333%}div.tsml-ui .col-2{flex:0 0 auto;width:16.66666667%}div.tsml-ui .col-3{flex:0 0 auto;width:25%}div.tsml-ui .col-4{flex:0 0 auto;width:33.33333333%}div.tsml-ui .col-5{flex:0 0 auto;width:41.66666667%}div.tsml-ui .col-6{flex:0 0 auto;width:50%}div.tsml-ui .col-7{flex:0 0 auto;width:58.33333333%}div.tsml-ui .col-8{flex:0 0 auto;width:66.66666667%}div.tsml-ui .col-9{flex:0 0 auto;width:75%}div.tsml-ui .col-10{flex:0 0 auto;width:83.33333333%}div.tsml-ui .col-11{flex:0 0 auto;width:91.66666667%}div.tsml-ui .col-12{flex:0 0 auto;width:100%}div.tsml-ui .offset-1{margin-left:8.33333333%}div.tsml-ui .offset-2{margin-left:16.66666667%}div.tsml-ui .offset-3{margin-left:25%}div.tsml-ui .offset-4{margin-left:33.33333333%}div.tsml-ui .offset-5{margin-left:41.66666667%}div.tsml-ui .offset-6{margin-left:50%}div.tsml-ui .offset-7{margin-left:58.33333333%}div.tsml-ui .offset-8{margin-left:66.66666667%}div.tsml-ui .offset-9{margin-left:75%}div.tsml-ui .offset-10{margin-left:83.33333333%}div.tsml-ui .offset-11{margin-left:91.66666667%}div.tsml-ui .g-0,div.tsml-ui .gx-0{--bs-gutter-x:0}div.tsml-ui .g-0,div.tsml-ui .gy-0{--bs-gutter-y:0}div.tsml-ui .g-1,div.tsml-ui .gx-1{--bs-gutter-x:4px}div.tsml-ui .g-1,div.tsml-ui .gy-1{--bs-gutter-y:4px}div.tsml-ui .g-2,div.tsml-ui .gx-2{--bs-gutter-x:8px}div.tsml-ui .g-2,div.tsml-ui .gy-2{--bs-gutter-y:8px}div.tsml-ui .g-3,div.tsml-ui .gx-3{--bs-gutter-x:16px}div.tsml-ui .g-3,div.tsml-ui .gy-3{--bs-gutter-y:16px}div.tsml-ui .g-4,div.tsml-ui .gx-4{--bs-gutter-x:24px}div.tsml-ui .g-4,div.tsml-ui .gy-4{--bs-gutter-y:24px}div.tsml-ui .g-5,div.tsml-ui .gx-5{--bs-gutter-x:48px}div.tsml-ui .g-5,div.tsml-ui .gy-5{--bs-gutter-y:48px}@media (min-width:576px){div.tsml-ui .col-sm{flex:1 0 0%}div.tsml-ui .row-cols-sm-auto>*{flex:0 0 auto;width:auto}div.tsml-ui .row-cols-sm-1>*{flex:0 0 auto;width:100%}div.tsml-ui .row-cols-sm-2>*{flex:0 0 auto;width:50%}div.tsml-ui .row-cols-sm-3>*{flex:0 0 auto;width:33.3333333333%}div.tsml-ui .row-cols-sm-4>*{flex:0 0 auto;width:25%}div.tsml-ui .row-cols-sm-5>*{flex:0 0 auto;width:20%}div.tsml-ui .row-cols-sm-6>*{flex:0 0 auto;width:16.6666666667%}div.tsml-ui .col-sm-auto{flex:0 0 auto;width:auto}div.tsml-ui .col-sm-1{flex:0 0 auto;width:8.33333333%}div.tsml-ui .col-sm-2{flex:0 0 auto;width:16.66666667%}div.tsml-ui .col-sm-3{flex:0 0 auto;width:25%}div.tsml-ui .col-sm-4{flex:0 0 auto;width:33.33333333%}div.tsml-ui .col-sm-5{flex:0 0 auto;width:41.66666667%}div.tsml-ui .col-sm-6{flex:0 0 auto;width:50%}div.tsml-ui .col-sm-7{flex:0 0 auto;width:58.33333333%}div.tsml-ui .col-sm-8{flex:0 0 auto;width:66.66666667%}div.tsml-ui .col-sm-9{flex:0 0 auto;width:75%}div.tsml-ui .col-sm-10{flex:0 0 auto;width:83.33333333%}div.tsml-ui .col-sm-11{flex:0 0 auto;width:91.66666667%}div.tsml-ui .col-sm-12{flex:0 0 auto;width:100%}div.tsml-ui .offset-sm-0{margin-left:0}div.tsml-ui .offset-sm-1{margin-left:8.33333333%}div.tsml-ui .offset-sm-2{margin-left:16.66666667%}div.tsml-ui .offset-sm-3{margin-left:25%}div.tsml-ui .offset-sm-4{margin-left:33.33333333%}div.tsml-ui .offset-sm-5{margin-left:41.66666667%}div.tsml-ui .offset-sm-6{margin-left:50%}div.tsml-ui .offset-sm-7{margin-left:58.33333333%}div.tsml-ui .offset-sm-8{margin-left:66.66666667%}div.tsml-ui .offset-sm-9{margin-left:75%}div.tsml-ui .offset-sm-10{margin-left:83.33333333%}div.tsml-ui .offset-sm-11{margin-left:91.66666667%}div.tsml-ui .g-sm-0,div.tsml-ui .gx-sm-0{--bs-gutter-x:0}div.tsml-ui .g-sm-0,div.tsml-ui .gy-sm-0{--bs-gutter-y:0}div.tsml-ui .g-sm-1,div.tsml-ui .gx-sm-1{--bs-gutter-x:4px}div.tsml-ui .g-sm-1,div.tsml-ui .gy-sm-1{--bs-gutter-y:4px}div.tsml-ui .g-sm-2,div.tsml-ui .gx-sm-2{--bs-gutter-x:8px}div.tsml-ui .g-sm-2,div.tsml-ui .gy-sm-2{--bs-gutter-y:8px}div.tsml-ui .g-sm-3,div.tsml-ui .gx-sm-3{--bs-gutter-x:16px}div.tsml-ui .g-sm-3,div.tsml-ui .gy-sm-3{--bs-gutter-y:16px}div.tsml-ui .g-sm-4,div.tsml-ui .gx-sm-4{--bs-gutter-x:24px}div.tsml-ui .g-sm-4,div.tsml-ui .gy-sm-4{--bs-gutter-y:24px}div.tsml-ui .g-sm-5,div.tsml-ui .gx-sm-5{--bs-gutter-x:48px}div.tsml-ui .g-sm-5,div.tsml-ui .gy-sm-5{--bs-gutter-y:48px}}@media (min-width:768px){div.tsml-ui .col-md{flex:1 0 0%}div.tsml-ui .row-cols-md-auto>*{flex:0 0 auto;width:auto}div.tsml-ui .row-cols-md-1>*{flex:0 0 auto;width:100%}div.tsml-ui .row-cols-md-2>*{flex:0 0 auto;width:50%}div.tsml-ui .row-cols-md-3>*{flex:0 0 auto;width:33.3333333333%}div.tsml-ui .row-cols-md-4>*{flex:0 0 auto;width:25%}div.tsml-ui .row-cols-md-5>*{flex:0 0 auto;width:20%}div.tsml-ui .row-cols-md-6>*{flex:0 0 auto;width:16.6666666667%}div.tsml-ui .col-md-auto{flex:0 0 auto;width:auto}div.tsml-ui .col-md-1{flex:0 0 auto;width:8.33333333%}div.tsml-ui .col-md-2{flex:0 0 auto;width:16.66666667%}div.tsml-ui .col-md-3{flex:0 0 auto;width:25%}div.tsml-ui .col-md-4{flex:0 0 auto;width:33.33333333%}div.tsml-ui .col-md-5{flex:0 0 auto;width:41.66666667%}div.tsml-ui .col-md-6{flex:0 0 auto;width:50%}div.tsml-ui .col-md-7{flex:0 0 auto;width:58.33333333%}div.tsml-ui .col-md-8{flex:0 0 auto;width:66.66666667%}div.tsml-ui .col-md-9{flex:0 0 auto;width:75%}div.tsml-ui .col-md-10{flex:0 0 auto;width:83.33333333%}div.tsml-ui .col-md-11{flex:0 0 auto;width:91.66666667%}div.tsml-ui .col-md-12{flex:0 0 auto;width:100%}div.tsml-ui .offset-md-0{margin-left:0}div.tsml-ui .offset-md-1{margin-left:8.33333333%}div.tsml-ui .offset-md-2{margin-left:16.66666667%}div.tsml-ui .offset-md-3{margin-left:25%}div.tsml-ui .offset-md-4{margin-left:33.33333333%}div.tsml-ui .offset-md-5{margin-left:41.66666667%}div.tsml-ui .offset-md-6{margin-left:50%}div.tsml-ui .offset-md-7{margin-left:58.33333333%}div.tsml-ui .offset-md-8{margin-left:66.66666667%}div.tsml-ui .offset-md-9{margin-left:75%}div.tsml-ui .offset-md-10{margin-left:83.33333333%}div.tsml-ui .offset-md-11{margin-left:91.66666667%}div.tsml-ui .g-md-0,div.tsml-ui .gx-md-0{--bs-gutter-x:0}div.tsml-ui .g-md-0,div.tsml-ui .gy-md-0{--bs-gutter-y:0}div.tsml-ui .g-md-1,div.tsml-ui .gx-md-1{--bs-gutter-x:4px}div.tsml-ui .g-md-1,div.tsml-ui .gy-md-1{--bs-gutter-y:4px}div.tsml-ui .g-md-2,div.tsml-ui .gx-md-2{--bs-gutter-x:8px}div.tsml-ui .g-md-2,div.tsml-ui .gy-md-2{--bs-gutter-y:8px}div.tsml-ui .g-md-3,div.tsml-ui .gx-md-3{--bs-gutter-x:16px}div.tsml-ui .g-md-3,div.tsml-ui .gy-md-3{--bs-gutter-y:16px}div.tsml-ui .g-md-4,div.tsml-ui .gx-md-4{--bs-gutter-x:24px}div.tsml-ui .g-md-4,div.tsml-ui .gy-md-4{--bs-gutter-y:24px}div.tsml-ui .g-md-5,div.tsml-ui .gx-md-5{--bs-gutter-x:48px}div.tsml-ui .g-md-5,div.tsml-ui .gy-md-5{--bs-gutter-y:48px}}@media (min-width:992px){div.tsml-ui .col-lg{flex:1 0 0%}div.tsml-ui .row-cols-lg-auto>*{flex:0 0 auto;width:auto}div.tsml-ui .row-cols-lg-1>*{flex:0 0 auto;width:100%}div.tsml-ui .row-cols-lg-2>*{flex:0 0 auto;width:50%}div.tsml-ui .row-cols-lg-3>*{flex:0 0 auto;width:33.3333333333%}div.tsml-ui .row-cols-lg-4>*{flex:0 0 auto;width:25%}div.tsml-ui .row-cols-lg-5>*{flex:0 0 auto;width:20%}div.tsml-ui .row-cols-lg-6>*{flex:0 0 auto;width:16.6666666667%}div.tsml-ui .col-lg-auto{flex:0 0 auto;width:auto}div.tsml-ui .col-lg-1{flex:0 0 auto;width:8.33333333%}div.tsml-ui .col-lg-2{flex:0 0 auto;width:16.66666667%}div.tsml-ui .col-lg-3{flex:0 0 auto;width:25%}div.tsml-ui .col-lg-4{flex:0 0 auto;width:33.33333333%}div.tsml-ui .col-lg-5{flex:0 0 auto;width:41.66666667%}div.tsml-ui .col-lg-6{flex:0 0 auto;width:50%}div.tsml-ui .col-lg-7{flex:0 0 auto;width:58.33333333%}div.tsml-ui .col-lg-8{flex:0 0 auto;width:66.66666667%}div.tsml-ui .col-lg-9{flex:0 0 auto;width:75%}div.tsml-ui .col-lg-10{flex:0 0 auto;width:83.33333333%}div.tsml-ui .col-lg-11{flex:0 0 auto;width:91.66666667%}div.tsml-ui .col-lg-12{flex:0 0 auto;width:100%}div.tsml-ui .offset-lg-0{margin-left:0}div.tsml-ui .offset-lg-1{margin-left:8.33333333%}div.tsml-ui .offset-lg-2{margin-left:16.66666667%}div.tsml-ui .offset-lg-3{margin-left:25%}div.tsml-ui .offset-lg-4{margin-left:33.33333333%}div.tsml-ui .offset-lg-5{margin-left:41.66666667%}div.tsml-ui .offset-lg-6{margin-left:50%}div.tsml-ui .offset-lg-7{margin-left:58.33333333%}div.tsml-ui .offset-lg-8{margin-left:66.66666667%}div.tsml-ui .offset-lg-9{margin-left:75%}div.tsml-ui .offset-lg-10{margin-left:83.33333333%}div.tsml-ui .offset-lg-11{margin-left:91.66666667%}div.tsml-ui .g-lg-0,div.tsml-ui .gx-lg-0{--bs-gutter-x:0}div.tsml-ui .g-lg-0,div.tsml-ui .gy-lg-0{--bs-gutter-y:0}div.tsml-ui .g-lg-1,div.tsml-ui .gx-lg-1{--bs-gutter-x:4px}div.tsml-ui .g-lg-1,div.tsml-ui .gy-lg-1{--bs-gutter-y:4px}div.tsml-ui .g-lg-2,div.tsml-ui .gx-lg-2{--bs-gutter-x:8px}div.tsml-ui .g-lg-2,div.tsml-ui .gy-lg-2{--bs-gutter-y:8px}div.tsml-ui .g-lg-3,div.tsml-ui .gx-lg-3{--bs-gutter-x:16px}div.tsml-ui .g-lg-3,div.tsml-ui .gy-lg-3{--bs-gutter-y:16px}div.tsml-ui .g-lg-4,div.tsml-ui .gx-lg-4{--bs-gutter-x:24px}div.tsml-ui .g-lg-4,div.tsml-ui .gy-lg-4{--bs-gutter-y:24px}div.tsml-ui .g-lg-5,div.tsml-ui .gx-lg-5{--bs-gutter-x:48px}div.tsml-ui .g-lg-5,div.tsml-ui .gy-lg-5{--bs-gutter-y:48px}}@media (min-width:1200px){div.tsml-ui .col-xl{flex:1 0 0%}div.tsml-ui .row-cols-xl-auto>*{flex:0 0 auto;width:auto}div.tsml-ui .row-cols-xl-1>*{flex:0 0 auto;width:100%}div.tsml-ui .row-cols-xl-2>*{flex:0 0 auto;width:50%}div.tsml-ui .row-cols-xl-3>*{flex:0 0 auto;width:33.3333333333%}div.tsml-ui .row-cols-xl-4>*{flex:0 0 auto;width:25%}div.tsml-ui .row-cols-xl-5>*{flex:0 0 auto;width:20%}div.tsml-ui .row-cols-xl-6>*{flex:0 0 auto;width:16.6666666667%}div.tsml-ui .col-xl-auto{flex:0 0 auto;width:auto}div.tsml-ui .col-xl-1{flex:0 0 auto;width:8.33333333%}div.tsml-ui .col-xl-2{flex:0 0 auto;width:16.66666667%}div.tsml-ui .col-xl-3{flex:0 0 auto;width:25%}div.tsml-ui .col-xl-4{flex:0 0 auto;width:33.33333333%}div.tsml-ui .col-xl-5{flex:0 0 auto;width:41.66666667%}div.tsml-ui .col-xl-6{flex:0 0 auto;width:50%}div.tsml-ui .col-xl-7{flex:0 0 auto;width:58.33333333%}div.tsml-ui .col-xl-8{flex:0 0 auto;width:66.66666667%}div.tsml-ui .col-xl-9{flex:0 0 auto;width:75%}div.tsml-ui .col-xl-10{flex:0 0 auto;width:83.33333333%}div.tsml-ui .col-xl-11{flex:0 0 auto;width:91.66666667%}div.tsml-ui .col-xl-12{flex:0 0 auto;width:100%}div.tsml-ui .offset-xl-0{margin-left:0}div.tsml-ui .offset-xl-1{margin-left:8.33333333%}div.tsml-ui .offset-xl-2{margin-left:16.66666667%}div.tsml-ui .offset-xl-3{margin-left:25%}div.tsml-ui .offset-xl-4{margin-left:33.33333333%}div.tsml-ui .offset-xl-5{margin-left:41.66666667%}div.tsml-ui .offset-xl-6{margin-left:50%}div.tsml-ui .offset-xl-7{margin-left:58.33333333%}div.tsml-ui .offset-xl-8{margin-left:66.66666667%}div.tsml-ui .offset-xl-9{margin-left:75%}div.tsml-ui .offset-xl-10{margin-left:83.33333333%}div.tsml-ui .offset-xl-11{margin-left:91.66666667%}div.tsml-ui .g-xl-0,div.tsml-ui .gx-xl-0{--bs-gutter-x:0}div.tsml-ui .g-xl-0,div.tsml-ui .gy-xl-0{--bs-gutter-y:0}div.tsml-ui .g-xl-1,div.tsml-ui .gx-xl-1{--bs-gutter-x:4px}div.tsml-ui .g-xl-1,div.tsml-ui .gy-xl-1{--bs-gutter-y:4px}div.tsml-ui .g-xl-2,div.tsml-ui .gx-xl-2{--bs-gutter-x:8px}div.tsml-ui .g-xl-2,div.tsml-ui .gy-xl-2{--bs-gutter-y:8px}div.tsml-ui .g-xl-3,div.tsml-ui .gx-xl-3{--bs-gutter-x:16px}div.tsml-ui .g-xl-3,div.tsml-ui .gy-xl-3{--bs-gutter-y:16px}div.tsml-ui .g-xl-4,div.tsml-ui .gx-xl-4{--bs-gutter-x:24px}div.tsml-ui .g-xl-4,div.tsml-ui .gy-xl-4{--bs-gutter-y:24px}div.tsml-ui .g-xl-5,div.tsml-ui .gx-xl-5{--bs-gutter-x:48px}div.tsml-ui .g-xl-5,div.tsml-ui .gy-xl-5{--bs-gutter-y:48px}}@media (min-width:1400px){div.tsml-ui .col-xxl{flex:1 0 0%}div.tsml-ui .row-cols-xxl-auto>*{flex:0 0 auto;width:auto}div.tsml-ui .row-cols-xxl-1>*{flex:0 0 auto;width:100%}div.tsml-ui .row-cols-xxl-2>*{flex:0 0 auto;width:50%}div.tsml-ui .row-cols-xxl-3>*{flex:0 0 auto;width:33.3333333333%}div.tsml-ui .row-cols-xxl-4>*{flex:0 0 auto;width:25%}div.tsml-ui .row-cols-xxl-5>*{flex:0 0 auto;width:20%}div.tsml-ui .row-cols-xxl-6>*{flex:0 0 auto;width:16.6666666667%}div.tsml-ui .col-xxl-auto{flex:0 0 auto;width:auto}div.tsml-ui .col-xxl-1{flex:0 0 auto;width:8.33333333%}div.tsml-ui .col-xxl-2{flex:0 0 auto;width:16.66666667%}div.tsml-ui .col-xxl-3{flex:0 0 auto;width:25%}div.tsml-ui .col-xxl-4{flex:0 0 auto;width:33.33333333%}div.tsml-ui .col-xxl-5{flex:0 0 auto;width:41.66666667%}div.tsml-ui .col-xxl-6{flex:0 0 auto;width:50%}div.tsml-ui .col-xxl-7{flex:0 0 auto;width:58.33333333%}div.tsml-ui .col-xxl-8{flex:0 0 auto;width:66.66666667%}div.tsml-ui .col-xxl-9{flex:0 0 auto;width:75%}div.tsml-ui .col-xxl-10{flex:0 0 auto;width:83.33333333%}div.tsml-ui .col-xxl-11{flex:0 0 auto;width:91.66666667%}div.tsml-ui .col-xxl-12{flex:0 0 auto;width:100%}div.tsml-ui .offset-xxl-0{margin-left:0}div.tsml-ui .offset-xxl-1{margin-left:8.33333333%}div.tsml-ui .offset-xxl-2{margin-left:16.66666667%}div.tsml-ui .offset-xxl-3{margin-left:25%}div.tsml-ui .offset-xxl-4{margin-left:33.33333333%}div.tsml-ui .offset-xxl-5{margin-left:41.66666667%}div.tsml-ui .offset-xxl-6{margin-left:50%}div.tsml-ui .offset-xxl-7{margin-left:58.33333333%}div.tsml-ui .offset-xxl-8{margin-left:66.66666667%}div.tsml-ui .offset-xxl-9{margin-left:75%}div.tsml-ui .offset-xxl-10{margin-left:83.33333333%}div.tsml-ui .offset-xxl-11{margin-left:91.66666667%}div.tsml-ui .g-xxl-0,div.tsml-ui .gx-xxl-0{--bs-gutter-x:0}div.tsml-ui .g-xxl-0,div.tsml-ui .gy-xxl-0{--bs-gutter-y:0}div.tsml-ui .g-xxl-1,div.tsml-ui .gx-xxl-1{--bs-gutter-x:4px}div.tsml-ui .g-xxl-1,div.tsml-ui .gy-xxl-1{--bs-gutter-y:4px}div.tsml-ui .g-xxl-2,div.tsml-ui .gx-xxl-2{--bs-gutter-x:8px}div.tsml-ui .g-xxl-2,div.tsml-ui .gy-xxl-2{--bs-gutter-y:8px}div.tsml-ui .g-xxl-3,div.tsml-ui .gx-xxl-3{--bs-gutter-x:16px}div.tsml-ui .g-xxl-3,div.tsml-ui .gy-xxl-3{--bs-gutter-y:16px}div.tsml-ui .g-xxl-4,div.tsml-ui .gx-xxl-4{--bs-gutter-x:24px}div.tsml-ui .g-xxl-4,div.tsml-ui .gy-xxl-4{--bs-gutter-y:24px}div.tsml-ui .g-xxl-5,div.tsml-ui .gx-xxl-5{--bs-gutter-x:48px}div.tsml-ui .g-xxl-5,div.tsml-ui .gy-xxl-5{--bs-gutter-y:48px}}div.tsml-ui .table{--bs-table-bg:transparent;--bs-table-accent-bg:transparent;--bs-table-striped-color:#212529;--bs-table-striped-bg:rgba(0,0,0,.05);--bs-table-active-color:#212529;--bs-table-active-bg:rgba(0,0,0,.1);--bs-table-hover-color:#212529;--bs-table-hover-bg:rgba(0,0,0,.075);border-color:#dee2e6;color:#212529;margin-bottom:16px;vertical-align:top;width:100%}div.tsml-ui .table>:not(caption)>*>*{background-color:var(--bs-table-bg);border-bottom-width:1px;box-shadow:inset 0 0 0 9999px var(--bs-table-accent-bg);padding:8px}div.tsml-ui .table>tbody{vertical-align:inherit}div.tsml-ui .table>thead{vertical-align:bottom}div.tsml-ui .table>:not(:first-child){border-top:2px solid}div.tsml-ui .caption-top{caption-side:top}div.tsml-ui .table-sm>:not(caption)>*>*{padding:.25rem}div.tsml-ui .table-bordered>:not(caption)>*{border-width:1px 0}div.tsml-ui .table-bordered>:not(caption)>*>*{border-width:0 1px}div.tsml-ui .table-borderless>:not(caption)>*>*{border-bottom-width:0}div.tsml-ui .table-borderless>:not(:first-child){border-top-width:0}div.tsml-ui .table-striped>tbody>tr:nth-of-type(odd)>*{--bs-table-accent-bg:var(--bs-table-striped-bg);color:var(--bs-table-striped-color)}div.tsml-ui .table-active{--bs-table-accent-bg:var(--bs-table-active-bg);color:var(--bs-table-active-color)}div.tsml-ui .table-hover>tbody>tr:hover>*{--bs-table-accent-bg:var(--bs-table-hover-bg);color:var(--bs-table-hover-color)}div.tsml-ui .table-primary{--bs-table-bg:#cfe2ff;--bs-table-striped-bg:#c5d7f2;--bs-table-striped-color:#000;--bs-table-active-bg:#bacbe6;--bs-table-active-color:#000;--bs-table-hover-bg:#bfd1ec;--bs-table-hover-color:#000;border-color:#bacbe6;color:#000}div.tsml-ui .table-secondary{--bs-table-bg:#e2e3e5;--bs-table-striped-bg:#d7d8da;--bs-table-striped-color:#000;--bs-table-active-bg:#cbccce;--bs-table-active-color:#000;--bs-table-hover-bg:#d1d2d4;--bs-table-hover-color:#000;border-color:#cbccce;color:#000}div.tsml-ui .table-success{--bs-table-bg:#d1e7dd;--bs-table-striped-bg:#c7dbd2;--bs-table-striped-color:#000;--bs-table-active-bg:#bcd0c7;--bs-table-active-color:#000;--bs-table-hover-bg:#c1d6cc;--bs-table-hover-color:#000;border-color:#bcd0c7;color:#000}div.tsml-ui .table-info{--bs-table-bg:#cff4fc;--bs-table-striped-bg:#c5e8ef;--bs-table-striped-color:#000;--bs-table-active-bg:#badce3;--bs-table-active-color:#000;--bs-table-hover-bg:#bfe2e9;--bs-table-hover-color:#000;border-color:#badce3;color:#000}div.tsml-ui .table-warning{--bs-table-bg:#fff3cd;--bs-table-striped-bg:#f2e7c3;--bs-table-striped-color:#000;--bs-table-active-bg:#e6dbb9;--bs-table-active-color:#000;--bs-table-hover-bg:#ece1be;--bs-table-hover-color:#000;border-color:#e6dbb9;color:#000}div.tsml-ui .table-danger{--bs-table-bg:#f8d7da;--bs-table-striped-bg:#eccccf;--bs-table-striped-color:#000;--bs-table-active-bg:#dfc2c4;--bs-table-active-color:#000;--bs-table-hover-bg:#e5c7ca;--bs-table-hover-color:#000;border-color:#dfc2c4;color:#000}div.tsml-ui .table-light{--bs-table-bg:#f8f9fa;--bs-table-striped-bg:#ecedee;--bs-table-striped-color:#000;--bs-table-active-bg:#dfe0e1;--bs-table-active-color:#000;--bs-table-hover-bg:#e5e6e7;--bs-table-hover-color:#000;border-color:#dfe0e1;color:#000}div.tsml-ui .table-dark{--bs-table-bg:#212529;--bs-table-striped-bg:#2c3034;--bs-table-striped-color:#fff;--bs-table-active-bg:#373b3e;--bs-table-active-color:#fff;--bs-table-hover-bg:#323539;--bs-table-hover-color:#fff;border-color:#373b3e;color:#fff}div.tsml-ui .table-responsive{-webkit-overflow-scrolling:touch;overflow-x:auto}@media (max-width:575.98px){div.tsml-ui .table-responsive-sm{-webkit-overflow-scrolling:touch;overflow-x:auto}}@media (max-width:767.98px){div.tsml-ui .table-responsive-md{-webkit-overflow-scrolling:touch;overflow-x:auto}}@media (max-width:991.98px){div.tsml-ui .table-responsive-lg{-webkit-overflow-scrolling:touch;overflow-x:auto}}@media (max-width:1199.98px){div.tsml-ui .table-responsive-xl{-webkit-overflow-scrolling:touch;overflow-x:auto}}@media (max-width:1399.98px){div.tsml-ui .table-responsive-xxl{-webkit-overflow-scrolling:touch;overflow-x:auto}}div.tsml-ui .form-label{margin-bottom:.5rem}div.tsml-ui .col-form-label{font-size:inherit;line-height:1.5;margin-bottom:0;padding-bottom:7px;padding-top:7px}div.tsml-ui .col-form-label-lg{font-size:20px;padding-bottom:calc(.5rem + 1px);padding-top:calc(.5rem + 1px)}div.tsml-ui .col-form-label-sm{font-size:14px;padding-bottom:5px;padding-top:5px}div.tsml-ui .form-text{color:#6c757d;font-size:.875em;margin-top:.25rem}div.tsml-ui .form-control{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-clip:padding-box;background-color:#fff;border:1px solid #ced4da;border-radius:.25rem;color:#212529;display:block;font-size:16px;font-weight:400;line-height:1.5;padding:6px 12px;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out;width:100%}@media (prefers-reduced-motion:reduce){div.tsml-ui .form-control{transition:none}}div.tsml-ui .form-control[type=file]{overflow:hidden}div.tsml-ui .form-control[type=file]:not(:disabled):not([readonly]){cursor:pointer}div.tsml-ui .form-control:focus{background-color:#fff;border-color:#86b7fe;box-shadow:0 0 0 .25rem rgba(13,110,253,.25);color:#212529;outline:0}div.tsml-ui .form-control::-webkit-date-and-time-value{height:1.5em}div.tsml-ui .form-control::-moz-placeholder{color:#6c757d;opacity:1}div.tsml-ui .form-control:-ms-input-placeholder{color:#6c757d;opacity:1}div.tsml-ui .form-control::placeholder{color:#6c757d;opacity:1}div.tsml-ui .form-control:disabled,div.tsml-ui .form-control[readonly]{background-color:#e9ecef;opacity:1}div.tsml-ui .form-control::file-selector-button{-webkit-margin-end:12px;background-color:#e9ecef;border:0 solid;border-color:inherit;border-inline-end-width:1px;border-radius:0;color:#212529;margin:-6px -12px;margin-inline-end:12px;padding:6px 12px;pointer-events:none;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out}@media (prefers-reduced-motion:reduce){div.tsml-ui .form-control::-webkit-file-upload-button{-webkit-transition:none;transition:none}div.tsml-ui .form-control::file-selector-button{transition:none}}div.tsml-ui .form-control:hover:not(:disabled):not([readonly])::file-selector-button{background-color:#dde0e3}div.tsml-ui .form-control::-webkit-file-upload-button{-webkit-margin-end:12px;background-color:#e9ecef;border:0 solid;border-color:inherit;border-inline-end-width:1px;border-radius:0;color:#212529;margin:-6px -12px;margin-inline-end:12px;padding:6px 12px;pointer-events:none;-webkit-transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out}@media (prefers-reduced-motion:reduce){div.tsml-ui .form-control::-webkit-file-upload-button{-webkit-transition:none;transition:none}}div.tsml-ui .form-control:hover:not(:disabled):not([readonly])::-webkit-file-upload-button{background-color:#dde0e3}div.tsml-ui .form-control-plaintext{background-color:transparent;border:solid transparent;border-width:1px 0;color:#212529;display:block;line-height:1.5;margin-bottom:0;padding:6px 0;width:100%}div.tsml-ui .form-control-plaintext.form-control-lg,div.tsml-ui .form-control-plaintext.form-control-sm{padding-left:0;padding-right:0}div.tsml-ui .form-control-sm{border-radius:.2rem;font-size:14px;min-height:calc(1.5em + 10px);padding:4px 8px}div.tsml-ui .form-control-sm::file-selector-button{-webkit-margin-end:8px;margin:-4px -8px;margin-inline-end:8px;padding:4px 8px}div.tsml-ui .form-control-sm::-webkit-file-upload-button{-webkit-margin-end:8px;margin:-4px -8px;margin-inline-end:8px;padding:4px 8px}div.tsml-ui .form-control-lg{border-radius:.3rem;font-size:20px;min-height:calc(1.5em + 1rem + 2px);padding:.5rem 1rem}div.tsml-ui .form-control-lg::file-selector-button{-webkit-margin-end:1rem;margin:-.5rem -1rem;margin-inline-end:1rem;padding:.5rem 1rem}div.tsml-ui .form-control-lg::-webkit-file-upload-button{-webkit-margin-end:1rem;margin:-.5rem -1rem;margin-inline-end:1rem;padding:.5rem 1rem}div.tsml-ui textarea.form-control{min-height:calc(1.5em + 14px)}div.tsml-ui textarea.form-control-sm{min-height:calc(1.5em + 10px)}div.tsml-ui textarea.form-control-lg{min-height:calc(1.5em + 1rem + 2px)}div.tsml-ui .form-control-color{height:auto;padding:6px;width:3rem}div.tsml-ui .form-control-color:not(:disabled):not([readonly]){cursor:pointer}div.tsml-ui .form-control-color::-moz-color-swatch{border-radius:.25rem;height:1.5em}div.tsml-ui .form-control-color::-webkit-color-swatch{border-radius:.25rem;height:1.5em}div.tsml-ui .form-select{-moz-padding-start:9px;-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:#fff;background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3E%3C/svg%3E\");background-position:right 12px center;background-repeat:no-repeat;background-size:16px 12px;border:1px solid #ced4da;border-radius:.25rem;color:#212529;display:block;font-size:16px;font-weight:400;line-height:1.5;padding:6px 36px 6px 12px;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out;width:100%}@media (prefers-reduced-motion:reduce){div.tsml-ui .form-select{transition:none}}div.tsml-ui .form-select:focus{border-color:#86b7fe;box-shadow:0 0 0 .25rem rgba(13,110,253,.25);outline:0}div.tsml-ui .form-select[multiple],div.tsml-ui .form-select[size]:not([size=\"1\"]){background-image:none;padding-right:12px}div.tsml-ui .form-select:disabled{background-color:#e9ecef}div.tsml-ui .form-select:-moz-focusring{color:transparent;text-shadow:0 0 0 #212529}div.tsml-ui .form-select-sm{border-radius:.2rem;font-size:14px;padding-bottom:4px;padding-left:8px;padding-top:4px}div.tsml-ui .form-select-lg{border-radius:.3rem;font-size:20px;padding-bottom:.5rem;padding-left:1rem;padding-top:.5rem}div.tsml-ui .form-check{display:block;margin-bottom:.125rem;min-height:1.5rem;padding-left:1.5em}div.tsml-ui .form-check .form-check-input{float:left;margin-left:-1.5em}div.tsml-ui .form-check-input{color-adjust:exact;-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:#fff;background-position:50%;background-repeat:no-repeat;background-size:contain;border:1px solid rgba(0,0,0,.25);height:1em;margin-top:.25em;-webkit-print-color-adjust:exact;vertical-align:top;width:1em}div.tsml-ui .form-check-input[type=checkbox]{border-radius:.25em}div.tsml-ui .form-check-input[type=radio]{border-radius:50%}div.tsml-ui .form-check-input:active{filter:brightness(90%)}div.tsml-ui .form-check-input:focus{border-color:#86b7fe;box-shadow:0 0 0 .25rem rgba(13,110,253,.25);outline:0}div.tsml-ui .form-check-input:checked{background-color:#0d6efd;border-color:#0d6efd}div.tsml-ui .form-check-input:checked[type=checkbox]{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m6 10 3 3 6-6'/%3E%3C/svg%3E\")}div.tsml-ui .form-check-input:checked[type=radio]{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3E%3Ccircle r='2' fill='%23fff'/%3E%3C/svg%3E\")}div.tsml-ui .form-check-input[type=checkbox]:indeterminate{background-color:#0d6efd;background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M6 10h8'/%3E%3C/svg%3E\");border-color:#0d6efd}div.tsml-ui .form-check-input:disabled{filter:none;opacity:.5;pointer-events:none}div.tsml-ui .form-check-input:disabled~.form-check-label,div.tsml-ui .form-check-input[disabled]~.form-check-label{opacity:.5}div.tsml-ui .form-switch{padding-left:2.5em}div.tsml-ui .form-switch .form-check-input{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3E%3Ccircle r='3' fill='rgba(0, 0, 0, 0.25)'/%3E%3C/svg%3E\");background-position:0;border-radius:2em;margin-left:-2.5em;transition:background-position .15s ease-in-out;width:2em}@media (prefers-reduced-motion:reduce){div.tsml-ui .form-switch .form-check-input{transition:none}}div.tsml-ui .form-switch .form-check-input:focus{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3E%3Ccircle r='3' fill='%2386b7fe'/%3E%3C/svg%3E\")}div.tsml-ui .form-switch .form-check-input:checked{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3E%3Ccircle r='3' fill='%23fff'/%3E%3C/svg%3E\");background-position:100%}div.tsml-ui .form-check-inline{display:inline-block;margin-right:1rem}div.tsml-ui .btn-check{clip:rect(0,0,0,0);pointer-events:none;position:absolute}div.tsml-ui .btn-check:disabled+.btn,div.tsml-ui .btn-check[disabled]+.btn{filter:none;opacity:.65;pointer-events:none}div.tsml-ui .form-range{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:transparent;height:1.5rem;padding:0;width:100%}div.tsml-ui .form-range:focus{outline:0}div.tsml-ui .form-range:focus::-webkit-slider-thumb{box-shadow:0 0 0 1px #fff,0 0 0 .25rem rgba(13,110,253,.25)}div.tsml-ui .form-range:focus::-moz-range-thumb{box-shadow:0 0 0 1px #fff,0 0 0 .25rem rgba(13,110,253,.25)}div.tsml-ui .form-range::-moz-focus-outer{border:0}div.tsml-ui .form-range::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;background-color:#0d6efd;border:0;border-radius:1rem;height:1rem;margin-top:-.25rem;-webkit-transition:background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;transition:background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;width:1rem}@media (prefers-reduced-motion:reduce){div.tsml-ui .form-range::-webkit-slider-thumb{-webkit-transition:none;transition:none}}div.tsml-ui .form-range::-webkit-slider-thumb:active{background-color:#b6d4fe}div.tsml-ui .form-range::-webkit-slider-runnable-track{background-color:#dee2e6;border-color:transparent;border-radius:1rem;color:transparent;cursor:pointer;height:.5rem;width:100%}div.tsml-ui .form-range::-moz-range-thumb{-moz-appearance:none;appearance:none;background-color:#0d6efd;border:0;border-radius:1rem;height:1rem;-moz-transition:background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;transition:background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;width:1rem}@media (prefers-reduced-motion:reduce){div.tsml-ui .form-range::-moz-range-thumb{-moz-transition:none;transition:none}}div.tsml-ui .form-range::-moz-range-thumb:active{background-color:#b6d4fe}div.tsml-ui .form-range::-moz-range-track{background-color:#dee2e6;border-color:transparent;border-radius:1rem;color:transparent;cursor:pointer;height:.5rem;width:100%}div.tsml-ui .form-range:disabled{pointer-events:none}div.tsml-ui .form-range:disabled::-webkit-slider-thumb{background-color:#adb5bd}div.tsml-ui .form-range:disabled::-moz-range-thumb{background-color:#adb5bd}div.tsml-ui .form-floating{position:relative}div.tsml-ui .form-floating>.form-control,div.tsml-ui .form-floating>.form-select{height:calc(3.5rem + 2px);line-height:1.25}div.tsml-ui .form-floating>label{border:1px solid transparent;height:100%;left:0;padding:1rem 12px;pointer-events:none;position:absolute;top:0;transform-origin:0 0;transition:opacity .1s ease-in-out,transform .1s ease-in-out}@media (prefers-reduced-motion:reduce){div.tsml-ui .form-floating>label{transition:none}}div.tsml-ui .form-floating>.form-control{padding:1rem 12px}div.tsml-ui .form-floating>.form-control::-moz-placeholder{color:transparent}div.tsml-ui .form-floating>.form-control:-ms-input-placeholder{color:transparent}div.tsml-ui .form-floating>.form-control::placeholder{color:transparent}div.tsml-ui .form-floating>.form-control:not(:-moz-placeholder-shown){padding-bottom:.625rem;padding-top:1.625rem}div.tsml-ui .form-floating>.form-control:not(:-ms-input-placeholder){padding-bottom:.625rem;padding-top:1.625rem}div.tsml-ui .form-floating>.form-control:focus,div.tsml-ui .form-floating>.form-control:not(:placeholder-shown){padding-bottom:.625rem;padding-top:1.625rem}div.tsml-ui .form-floating>.form-control:-webkit-autofill{padding-bottom:.625rem;padding-top:1.625rem}div.tsml-ui .form-floating>.form-select{padding-bottom:.625rem;padding-top:1.625rem}div.tsml-ui .form-floating>.form-control:not(:-moz-placeholder-shown)~label{opacity:.65;transform:scale(.85) translateY(-.5rem) translateX(.15rem)}div.tsml-ui .form-floating>.form-control:not(:-ms-input-placeholder)~label{opacity:.65;transform:scale(.85) translateY(-.5rem) translateX(.15rem)}div.tsml-ui .form-floating>.form-control:focus~label,div.tsml-ui .form-floating>.form-control:not(:placeholder-shown)~label,div.tsml-ui .form-floating>.form-select~label{opacity:.65;transform:scale(.85) translateY(-.5rem) translateX(.15rem)}div.tsml-ui .form-floating>.form-control:-webkit-autofill~label{opacity:.65;transform:scale(.85) translateY(-.5rem) translateX(.15rem)}div.tsml-ui .input-group{align-items:stretch;display:flex;flex-wrap:wrap;position:relative;width:100%}div.tsml-ui .input-group>.form-control,div.tsml-ui .input-group>.form-select{flex:1 1 auto;min-width:0;position:relative;width:1%}div.tsml-ui .input-group>.form-control:focus,div.tsml-ui .input-group>.form-select:focus{z-index:3}div.tsml-ui .input-group .btn{position:relative;z-index:2}div.tsml-ui .input-group .btn:focus{z-index:3}div.tsml-ui .input-group-text{align-items:center;background-color:#e9ecef;border:1px solid #ced4da;border-radius:.25rem;color:#212529;display:flex;font-size:16px;font-weight:400;line-height:1.5;padding:6px 12px;text-align:center;white-space:nowrap}div.tsml-ui .input-group-lg>.btn,div.tsml-ui .input-group-lg>.form-control,div.tsml-ui .input-group-lg>.form-select,div.tsml-ui .input-group-lg>.input-group-text{border-radius:.3rem;font-size:20px;padding:.5rem 1rem}div.tsml-ui .input-group-sm>.btn,div.tsml-ui .input-group-sm>.form-control,div.tsml-ui .input-group-sm>.form-select,div.tsml-ui .input-group-sm>.input-group-text{border-radius:.2rem;font-size:14px;padding:4px 8px}div.tsml-ui .input-group-lg>.form-select,div.tsml-ui .input-group-sm>.form-select{padding-right:48px}div.tsml-ui .input-group.has-validation>.dropdown-toggle:nth-last-child(n+4),div.tsml-ui .input-group.has-validation>:nth-last-child(n+3):not(.dropdown-toggle):not(.dropdown-menu),div.tsml-ui .input-group:not(.has-validation)>.dropdown-toggle:nth-last-child(n+3),div.tsml-ui .input-group:not(.has-validation)>:not(:last-child):not(.dropdown-toggle):not(.dropdown-menu){border-bottom-right-radius:0;border-top-right-radius:0}div.tsml-ui .input-group>:not(:first-child):not(.dropdown-menu):not(.valid-tooltip):not(.valid-feedback):not(.invalid-tooltip):not(.invalid-feedback){border-bottom-left-radius:0;border-top-left-radius:0;margin-left:-1px}div.tsml-ui .valid-feedback{color:#198754;display:none;font-size:.875em;margin-top:.25rem;width:100%}div.tsml-ui .valid-tooltip{background-color:rgba(25,135,84,.9);border-radius:.25rem;color:#fff;display:none;font-size:14px;margin-top:.1rem;max-width:100%;padding:4px 8px;position:absolute;top:100%;z-index:5}.was-validated div.tsml-ui:valid~.valid-feedback,.was-validated div.tsml-ui:valid~.valid-tooltip,div.tsml-ui.is-valid~.valid-feedback,div.tsml-ui.is-valid~.valid-tooltip{display:block}.was-validated div.tsml-ui .form-control:valid,div.tsml-ui .form-control.is-valid{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpath fill='%23198754' d='M2.3 6.73.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3E%3C/svg%3E\");background-position:right calc(.375em + 3px) center;background-repeat:no-repeat;background-size:calc(.75em + 6px) calc(.75em + 6px);border-color:#198754;padding-right:calc(1.5em + 12px)}.was-validated div.tsml-ui .form-control:valid:focus,div.tsml-ui .form-control.is-valid:focus{border-color:#198754;box-shadow:0 0 0 .25rem rgba(25,135,84,.25)}.was-validated div.tsml-ui textarea.form-control:valid,div.tsml-ui textarea.form-control.is-valid{background-position:top calc(.375em + 3px) right calc(.375em + 3px);padding-right:calc(1.5em + 12px)}.was-validated div.tsml-ui .form-select:valid,div.tsml-ui .form-select.is-valid{border-color:#198754}.was-validated div.tsml-ui .form-select:valid:not([multiple]):not([size]),.was-validated div.tsml-ui .form-select:valid:not([multiple])[size=\"1\"],div.tsml-ui .form-select.is-valid:not([multiple]):not([size]),div.tsml-ui .form-select.is-valid:not([multiple])[size=\"1\"]{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3E%3C/svg%3E\"),url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpath fill='%23198754' d='M2.3 6.73.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3E%3C/svg%3E\");background-position:right 12px center,center right 36px;background-size:16px 12px,calc(.75em + 6px) calc(.75em + 6px);padding-right:66px}.was-validated div.tsml-ui .form-select:valid:focus,div.tsml-ui .form-select.is-valid:focus{border-color:#198754;box-shadow:0 0 0 .25rem rgba(25,135,84,.25)}.was-validated div.tsml-ui .form-check-input:valid,div.tsml-ui .form-check-input.is-valid{border-color:#198754}.was-validated div.tsml-ui .form-check-input:valid:checked,div.tsml-ui .form-check-input.is-valid:checked{background-color:#198754}.was-validated div.tsml-ui .form-check-input:valid:focus,div.tsml-ui .form-check-input.is-valid:focus{box-shadow:0 0 0 .25rem rgba(25,135,84,.25)}.was-validated div.tsml-ui .form-check-input:valid~.form-check-label,div.tsml-ui .form-check-input.is-valid~.form-check-label{color:#198754}div.tsml-ui .form-check-inline .form-check-input~.valid-feedback{margin-left:.5em}.was-validated div.tsml-ui .input-group .form-control:valid,.was-validated div.tsml-ui .input-group .form-select:valid,div.tsml-ui .input-group .form-control.is-valid,div.tsml-ui .input-group .form-select.is-valid{z-index:1}.was-validated div.tsml-ui .input-group .form-control:valid:focus,.was-validated div.tsml-ui .input-group .form-select:valid:focus,div.tsml-ui .input-group .form-control.is-valid:focus,div.tsml-ui .input-group .form-select.is-valid:focus{z-index:3}div.tsml-ui .invalid-feedback{color:#dc3545;display:none;font-size:.875em;margin-top:.25rem;width:100%}div.tsml-ui .invalid-tooltip{background-color:rgba(220,53,69,.9);border-radius:.25rem;color:#fff;display:none;font-size:14px;margin-top:.1rem;max-width:100%;padding:4px 8px;position:absolute;top:100%;z-index:5}.was-validated div.tsml-ui:invalid~.invalid-feedback,.was-validated div.tsml-ui:invalid~.invalid-tooltip,div.tsml-ui.is-invalid~.invalid-feedback,div.tsml-ui.is-invalid~.invalid-tooltip{display:block}.was-validated div.tsml-ui .form-control:invalid,div.tsml-ui .form-control.is-invalid{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23dc3545'%3E%3Ccircle cx='6' cy='6' r='4.5'/%3E%3Cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3E%3Ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3E%3C/svg%3E\");background-position:right calc(.375em + 3px) center;background-repeat:no-repeat;background-size:calc(.75em + 6px) calc(.75em + 6px);border-color:#dc3545;padding-right:calc(1.5em + 12px)}.was-validated div.tsml-ui .form-control:invalid:focus,div.tsml-ui .form-control.is-invalid:focus{border-color:#dc3545;box-shadow:0 0 0 .25rem rgba(220,53,69,.25)}.was-validated div.tsml-ui textarea.form-control:invalid,div.tsml-ui textarea.form-control.is-invalid{background-position:top calc(.375em + 3px) right calc(.375em + 3px);padding-right:calc(1.5em + 12px)}.was-validated div.tsml-ui .form-select:invalid,div.tsml-ui .form-select.is-invalid{border-color:#dc3545}.was-validated div.tsml-ui .form-select:invalid:not([multiple]):not([size]),.was-validated div.tsml-ui .form-select:invalid:not([multiple])[size=\"1\"],div.tsml-ui .form-select.is-invalid:not([multiple]):not([size]),div.tsml-ui .form-select.is-invalid:not([multiple])[size=\"1\"]{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3E%3C/svg%3E\"),url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23dc3545'%3E%3Ccircle cx='6' cy='6' r='4.5'/%3E%3Cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3E%3Ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3E%3C/svg%3E\");background-position:right 12px center,center right 36px;background-size:16px 12px,calc(.75em + 6px) calc(.75em + 6px);padding-right:66px}.was-validated div.tsml-ui .form-select:invalid:focus,div.tsml-ui .form-select.is-invalid:focus{border-color:#dc3545;box-shadow:0 0 0 .25rem rgba(220,53,69,.25)}.was-validated div.tsml-ui .form-check-input:invalid,div.tsml-ui .form-check-input.is-invalid{border-color:#dc3545}.was-validated div.tsml-ui .form-check-input:invalid:checked,div.tsml-ui .form-check-input.is-invalid:checked{background-color:#dc3545}.was-validated div.tsml-ui .form-check-input:invalid:focus,div.tsml-ui .form-check-input.is-invalid:focus{box-shadow:0 0 0 .25rem rgba(220,53,69,.25)}.was-validated div.tsml-ui .form-check-input:invalid~.form-check-label,div.tsml-ui .form-check-input.is-invalid~.form-check-label{color:#dc3545}div.tsml-ui .form-check-inline .form-check-input~.invalid-feedback{margin-left:.5em}.was-validated div.tsml-ui .input-group .form-control:invalid,.was-validated div.tsml-ui .input-group .form-select:invalid,div.tsml-ui .input-group .form-control.is-invalid,div.tsml-ui .input-group .form-select.is-invalid{z-index:2}.was-validated div.tsml-ui .input-group .form-control:invalid:focus,.was-validated div.tsml-ui .input-group .form-select:invalid:focus,div.tsml-ui .input-group .form-control.is-invalid:focus,div.tsml-ui .input-group .form-select.is-invalid:focus{z-index:3}div.tsml-ui .btn{background-color:transparent;border:1px solid transparent;border-radius:.25rem;color:#212529;cursor:pointer;display:inline-block;font-size:16px;font-weight:400;line-height:1.5;padding:6px 12px;text-align:center;text-decoration:none;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;vertical-align:middle}@media (prefers-reduced-motion:reduce){div.tsml-ui .btn{transition:none}}div.tsml-ui .btn:hover{color:#212529}.btn-check:focus+div.tsml-ui .btn,div.tsml-ui .btn:focus{box-shadow:0 0 0 .25rem rgba(13,110,253,.25);outline:0}div.tsml-ui .btn.disabled,div.tsml-ui .btn:disabled,fieldset:disabled div.tsml-ui .btn{opacity:.65;pointer-events:none}div.tsml-ui .btn-primary{background-color:#0d6efd;border-color:#0d6efd;color:#fff}div.tsml-ui .btn-primary:hover{background-color:#0b5ed7;border-color:#0a58ca;color:#fff}.btn-check:focus+div.tsml-ui .btn-primary,div.tsml-ui .btn-primary:focus{background-color:#0b5ed7;border-color:#0a58ca;box-shadow:0 0 0 .25rem rgba(49,132,253,.5);color:#fff}.btn-check:active+div.tsml-ui .btn-primary,.btn-check:checked+div.tsml-ui .btn-primary,.show>div.tsml-ui .btn-primary.dropdown-toggle,div.tsml-ui .btn-primary.active,div.tsml-ui .btn-primary:active{background-color:#0a58ca;border-color:#0a53be;color:#fff}.btn-check:active+div.tsml-ui .btn-primary:focus,.btn-check:checked+div.tsml-ui .btn-primary:focus,.show>div.tsml-ui .btn-primary.dropdown-toggle:focus,div.tsml-ui .btn-primary.active:focus,div.tsml-ui .btn-primary:active:focus{box-shadow:0 0 0 .25rem rgba(49,132,253,.5)}div.tsml-ui .btn-primary.disabled,div.tsml-ui .btn-primary:disabled{background-color:#0d6efd;border-color:#0d6efd;color:#fff}div.tsml-ui .btn-secondary{background-color:#6c757d;border-color:#6c757d;color:#fff}div.tsml-ui .btn-secondary:hover{background-color:#5c636a;border-color:#565e64;color:#fff}.btn-check:focus+div.tsml-ui .btn-secondary,div.tsml-ui .btn-secondary:focus{background-color:#5c636a;border-color:#565e64;box-shadow:0 0 0 .25rem hsla(208,6%,54%,.5);color:#fff}.btn-check:active+div.tsml-ui .btn-secondary,.btn-check:checked+div.tsml-ui .btn-secondary,.show>div.tsml-ui .btn-secondary.dropdown-toggle,div.tsml-ui .btn-secondary.active,div.tsml-ui .btn-secondary:active{background-color:#565e64;border-color:#51585e;color:#fff}.btn-check:active+div.tsml-ui .btn-secondary:focus,.btn-check:checked+div.tsml-ui .btn-secondary:focus,.show>div.tsml-ui .btn-secondary.dropdown-toggle:focus,div.tsml-ui .btn-secondary.active:focus,div.tsml-ui .btn-secondary:active:focus{box-shadow:0 0 0 .25rem hsla(208,6%,54%,.5)}div.tsml-ui .btn-secondary.disabled,div.tsml-ui .btn-secondary:disabled{background-color:#6c757d;border-color:#6c757d;color:#fff}div.tsml-ui .btn-success{background-color:#198754;border-color:#198754;color:#fff}div.tsml-ui .btn-success:hover{background-color:#157347;border-color:#146c43;color:#fff}.btn-check:focus+div.tsml-ui .btn-success,div.tsml-ui .btn-success:focus{background-color:#157347;border-color:#146c43;box-shadow:0 0 0 .25rem rgba(60,153,110,.5);color:#fff}.btn-check:active+div.tsml-ui .btn-success,.btn-check:checked+div.tsml-ui .btn-success,.show>div.tsml-ui .btn-success.dropdown-toggle,div.tsml-ui .btn-success.active,div.tsml-ui .btn-success:active{background-color:#146c43;border-color:#13653f;color:#fff}.btn-check:active+div.tsml-ui .btn-success:focus,.btn-check:checked+div.tsml-ui .btn-success:focus,.show>div.tsml-ui .btn-success.dropdown-toggle:focus,div.tsml-ui .btn-success.active:focus,div.tsml-ui .btn-success:active:focus{box-shadow:0 0 0 .25rem rgba(60,153,110,.5)}div.tsml-ui .btn-success.disabled,div.tsml-ui .btn-success:disabled{background-color:#198754;border-color:#198754;color:#fff}div.tsml-ui .btn-info{background-color:#0dcaf0;border-color:#0dcaf0;color:#000}div.tsml-ui .btn-info:hover{background-color:#31d2f2;border-color:#25cff2;color:#000}.btn-check:focus+div.tsml-ui .btn-info,div.tsml-ui .btn-info:focus{background-color:#31d2f2;border-color:#25cff2;box-shadow:0 0 0 .25rem rgba(11,172,204,.5);color:#000}.btn-check:active+div.tsml-ui .btn-info,.btn-check:checked+div.tsml-ui .btn-info,.show>div.tsml-ui .btn-info.dropdown-toggle,div.tsml-ui .btn-info.active,div.tsml-ui .btn-info:active{background-color:#3dd5f3;border-color:#25cff2;color:#000}.btn-check:active+div.tsml-ui .btn-info:focus,.btn-check:checked+div.tsml-ui .btn-info:focus,.show>div.tsml-ui .btn-info.dropdown-toggle:focus,div.tsml-ui .btn-info.active:focus,div.tsml-ui .btn-info:active:focus{box-shadow:0 0 0 .25rem rgba(11,172,204,.5)}div.tsml-ui .btn-info.disabled,div.tsml-ui .btn-info:disabled{background-color:#0dcaf0;border-color:#0dcaf0;color:#000}div.tsml-ui .btn-warning{background-color:#ffc107;border-color:#ffc107;color:#000}div.tsml-ui .btn-warning:hover{background-color:#ffca2c;border-color:#ffc720;color:#000}.btn-check:focus+div.tsml-ui .btn-warning,div.tsml-ui .btn-warning:focus{background-color:#ffca2c;border-color:#ffc720;box-shadow:0 0 0 .25rem rgba(217,164,6,.5);color:#000}.btn-check:active+div.tsml-ui .btn-warning,.btn-check:checked+div.tsml-ui .btn-warning,.show>div.tsml-ui .btn-warning.dropdown-toggle,div.tsml-ui .btn-warning.active,div.tsml-ui .btn-warning:active{background-color:#ffcd39;border-color:#ffc720;color:#000}.btn-check:active+div.tsml-ui .btn-warning:focus,.btn-check:checked+div.tsml-ui .btn-warning:focus,.show>div.tsml-ui .btn-warning.dropdown-toggle:focus,div.tsml-ui .btn-warning.active:focus,div.tsml-ui .btn-warning:active:focus{box-shadow:0 0 0 .25rem rgba(217,164,6,.5)}div.tsml-ui .btn-warning.disabled,div.tsml-ui .btn-warning:disabled{background-color:#ffc107;border-color:#ffc107;color:#000}div.tsml-ui .btn-danger{background-color:#dc3545;border-color:#dc3545;color:#fff}div.tsml-ui .btn-danger:hover{background-color:#bb2d3b;border-color:#b02a37;color:#fff}.btn-check:focus+div.tsml-ui .btn-danger,div.tsml-ui .btn-danger:focus{background-color:#bb2d3b;border-color:#b02a37;box-shadow:0 0 0 .25rem rgba(225,83,97,.5);color:#fff}.btn-check:active+div.tsml-ui .btn-danger,.btn-check:checked+div.tsml-ui .btn-danger,.show>div.tsml-ui .btn-danger.dropdown-toggle,div.tsml-ui .btn-danger.active,div.tsml-ui .btn-danger:active{background-color:#b02a37;border-color:#a52834;color:#fff}.btn-check:active+div.tsml-ui .btn-danger:focus,.btn-check:checked+div.tsml-ui .btn-danger:focus,.show>div.tsml-ui .btn-danger.dropdown-toggle:focus,div.tsml-ui .btn-danger.active:focus,div.tsml-ui .btn-danger:active:focus{box-shadow:0 0 0 .25rem rgba(225,83,97,.5)}div.tsml-ui .btn-danger.disabled,div.tsml-ui .btn-danger:disabled{background-color:#dc3545;border-color:#dc3545;color:#fff}div.tsml-ui .btn-light{background-color:#f8f9fa;border-color:#f8f9fa;color:#000}div.tsml-ui .btn-light:hover{background-color:#f9fafb;border-color:#f9fafb;color:#000}.btn-check:focus+div.tsml-ui .btn-light,div.tsml-ui .btn-light:focus{background-color:#f9fafb;border-color:#f9fafb;box-shadow:0 0 0 .25rem hsla(210,2%,83%,.5);color:#000}.btn-check:active+div.tsml-ui .btn-light,.btn-check:checked+div.tsml-ui .btn-light,.show>div.tsml-ui .btn-light.dropdown-toggle,div.tsml-ui .btn-light.active,div.tsml-ui .btn-light:active{background-color:#f9fafb;border-color:#f9fafb;color:#000}.btn-check:active+div.tsml-ui .btn-light:focus,.btn-check:checked+div.tsml-ui .btn-light:focus,.show>div.tsml-ui .btn-light.dropdown-toggle:focus,div.tsml-ui .btn-light.active:focus,div.tsml-ui .btn-light:active:focus{box-shadow:0 0 0 .25rem hsla(210,2%,83%,.5)}div.tsml-ui .btn-light.disabled,div.tsml-ui .btn-light:disabled{background-color:#f8f9fa;border-color:#f8f9fa;color:#000}div.tsml-ui .btn-dark{background-color:#212529;border-color:#212529;color:#fff}div.tsml-ui .btn-dark:hover{background-color:#1c1f23;border-color:#1a1e21;color:#fff}.btn-check:focus+div.tsml-ui .btn-dark,div.tsml-ui .btn-dark:focus{background-color:#1c1f23;border-color:#1a1e21;box-shadow:0 0 0 .25rem rgba(66,70,73,.5);color:#fff}.btn-check:active+div.tsml-ui .btn-dark,.btn-check:checked+div.tsml-ui .btn-dark,.show>div.tsml-ui .btn-dark.dropdown-toggle,div.tsml-ui .btn-dark.active,div.tsml-ui .btn-dark:active{background-color:#1a1e21;border-color:#191c1f;color:#fff}.btn-check:active+div.tsml-ui .btn-dark:focus,.btn-check:checked+div.tsml-ui .btn-dark:focus,.show>div.tsml-ui .btn-dark.dropdown-toggle:focus,div.tsml-ui .btn-dark.active:focus,div.tsml-ui .btn-dark:active:focus{box-shadow:0 0 0 .25rem rgba(66,70,73,.5)}div.tsml-ui .btn-dark.disabled,div.tsml-ui .btn-dark:disabled{background-color:#212529;border-color:#212529;color:#fff}div.tsml-ui .btn-outline-primary{border-color:#0d6efd;color:#0d6efd}div.tsml-ui .btn-outline-primary:hover{background-color:#0d6efd;border-color:#0d6efd;color:#fff}.btn-check:focus+div.tsml-ui .btn-outline-primary,div.tsml-ui .btn-outline-primary:focus{box-shadow:0 0 0 .25rem rgba(13,110,253,.5)}.btn-check:active+div.tsml-ui .btn-outline-primary,.btn-check:checked+div.tsml-ui .btn-outline-primary,div.tsml-ui .btn-outline-primary.active,div.tsml-ui .btn-outline-primary.dropdown-toggle.show,div.tsml-ui .btn-outline-primary:active{background-color:#0d6efd;border-color:#0d6efd;color:#fff}.btn-check:active+div.tsml-ui .btn-outline-primary:focus,.btn-check:checked+div.tsml-ui .btn-outline-primary:focus,div.tsml-ui .btn-outline-primary.active:focus,div.tsml-ui .btn-outline-primary.dropdown-toggle.show:focus,div.tsml-ui .btn-outline-primary:active:focus{box-shadow:0 0 0 .25rem rgba(13,110,253,.5)}div.tsml-ui .btn-outline-primary.disabled,div.tsml-ui .btn-outline-primary:disabled{background-color:transparent;color:#0d6efd}div.tsml-ui .btn-outline-secondary{border-color:#6c757d;color:#6c757d}div.tsml-ui .btn-outline-secondary:hover{background-color:#6c757d;border-color:#6c757d;color:#fff}.btn-check:focus+div.tsml-ui .btn-outline-secondary,div.tsml-ui .btn-outline-secondary:focus{box-shadow:0 0 0 .25rem hsla(208,7%,46%,.5)}.btn-check:active+div.tsml-ui .btn-outline-secondary,.btn-check:checked+div.tsml-ui .btn-outline-secondary,div.tsml-ui .btn-outline-secondary.active,div.tsml-ui .btn-outline-secondary.dropdown-toggle.show,div.tsml-ui .btn-outline-secondary:active{background-color:#6c757d;border-color:#6c757d;color:#fff}.btn-check:active+div.tsml-ui .btn-outline-secondary:focus,.btn-check:checked+div.tsml-ui .btn-outline-secondary:focus,div.tsml-ui .btn-outline-secondary.active:focus,div.tsml-ui .btn-outline-secondary.dropdown-toggle.show:focus,div.tsml-ui .btn-outline-secondary:active:focus{box-shadow:0 0 0 .25rem hsla(208,7%,46%,.5)}div.tsml-ui .btn-outline-secondary.disabled,div.tsml-ui .btn-outline-secondary:disabled{background-color:transparent;color:#6c757d}div.tsml-ui .btn-outline-success{border-color:#198754;color:#198754}div.tsml-ui .btn-outline-success:hover{background-color:#198754;border-color:#198754;color:#fff}.btn-check:focus+div.tsml-ui .btn-outline-success,div.tsml-ui .btn-outline-success:focus{box-shadow:0 0 0 .25rem rgba(25,135,84,.5)}.btn-check:active+div.tsml-ui .btn-outline-success,.btn-check:checked+div.tsml-ui .btn-outline-success,div.tsml-ui .btn-outline-success.active,div.tsml-ui .btn-outline-success.dropdown-toggle.show,div.tsml-ui .btn-outline-success:active{background-color:#198754;border-color:#198754;color:#fff}.btn-check:active+div.tsml-ui .btn-outline-success:focus,.btn-check:checked+div.tsml-ui .btn-outline-success:focus,div.tsml-ui .btn-outline-success.active:focus,div.tsml-ui .btn-outline-success.dropdown-toggle.show:focus,div.tsml-ui .btn-outline-success:active:focus{box-shadow:0 0 0 .25rem rgba(25,135,84,.5)}div.tsml-ui .btn-outline-success.disabled,div.tsml-ui .btn-outline-success:disabled{background-color:transparent;color:#198754}div.tsml-ui .btn-outline-info{border-color:#0dcaf0;color:#0dcaf0}div.tsml-ui .btn-outline-info:hover{background-color:#0dcaf0;border-color:#0dcaf0;color:#000}.btn-check:focus+div.tsml-ui .btn-outline-info,div.tsml-ui .btn-outline-info:focus{box-shadow:0 0 0 .25rem rgba(13,202,240,.5)}.btn-check:active+div.tsml-ui .btn-outline-info,.btn-check:checked+div.tsml-ui .btn-outline-info,div.tsml-ui .btn-outline-info.active,div.tsml-ui .btn-outline-info.dropdown-toggle.show,div.tsml-ui .btn-outline-info:active{background-color:#0dcaf0;border-color:#0dcaf0;color:#000}.btn-check:active+div.tsml-ui .btn-outline-info:focus,.btn-check:checked+div.tsml-ui .btn-outline-info:focus,div.tsml-ui .btn-outline-info.active:focus,div.tsml-ui .btn-outline-info.dropdown-toggle.show:focus,div.tsml-ui .btn-outline-info:active:focus{box-shadow:0 0 0 .25rem rgba(13,202,240,.5)}div.tsml-ui .btn-outline-info.disabled,div.tsml-ui .btn-outline-info:disabled{background-color:transparent;color:#0dcaf0}div.tsml-ui .btn-outline-warning{border-color:#ffc107;color:#ffc107}div.tsml-ui .btn-outline-warning:hover{background-color:#ffc107;border-color:#ffc107;color:#000}.btn-check:focus+div.tsml-ui .btn-outline-warning,div.tsml-ui .btn-outline-warning:focus{box-shadow:0 0 0 .25rem rgba(255,193,7,.5)}.btn-check:active+div.tsml-ui .btn-outline-warning,.btn-check:checked+div.tsml-ui .btn-outline-warning,div.tsml-ui .btn-outline-warning.active,div.tsml-ui .btn-outline-warning.dropdown-toggle.show,div.tsml-ui .btn-outline-warning:active{background-color:#ffc107;border-color:#ffc107;color:#000}.btn-check:active+div.tsml-ui .btn-outline-warning:focus,.btn-check:checked+div.tsml-ui .btn-outline-warning:focus,div.tsml-ui .btn-outline-warning.active:focus,div.tsml-ui .btn-outline-warning.dropdown-toggle.show:focus,div.tsml-ui .btn-outline-warning:active:focus{box-shadow:0 0 0 .25rem rgba(255,193,7,.5)}div.tsml-ui .btn-outline-warning.disabled,div.tsml-ui .btn-outline-warning:disabled{background-color:transparent;color:#ffc107}div.tsml-ui .btn-outline-danger{border-color:#dc3545;color:#dc3545}div.tsml-ui .btn-outline-danger:hover{background-color:#dc3545;border-color:#dc3545;color:#fff}.btn-check:focus+div.tsml-ui .btn-outline-danger,div.tsml-ui .btn-outline-danger:focus{box-shadow:0 0 0 .25rem rgba(220,53,69,.5)}.btn-check:active+div.tsml-ui .btn-outline-danger,.btn-check:checked+div.tsml-ui .btn-outline-danger,div.tsml-ui .btn-outline-danger.active,div.tsml-ui .btn-outline-danger.dropdown-toggle.show,div.tsml-ui .btn-outline-danger:active{background-color:#dc3545;border-color:#dc3545;color:#fff}.btn-check:active+div.tsml-ui .btn-outline-danger:focus,.btn-check:checked+div.tsml-ui .btn-outline-danger:focus,div.tsml-ui .btn-outline-danger.active:focus,div.tsml-ui .btn-outline-danger.dropdown-toggle.show:focus,div.tsml-ui .btn-outline-danger:active:focus{box-shadow:0 0 0 .25rem rgba(220,53,69,.5)}div.tsml-ui .btn-outline-danger.disabled,div.tsml-ui .btn-outline-danger:disabled{background-color:transparent;color:#dc3545}div.tsml-ui .btn-outline-light{border-color:#f8f9fa;color:#f8f9fa}div.tsml-ui .btn-outline-light:hover{background-color:#f8f9fa;border-color:#f8f9fa;color:#000}.btn-check:focus+div.tsml-ui .btn-outline-light,div.tsml-ui .btn-outline-light:focus{box-shadow:0 0 0 .25rem rgba(248,249,250,.5)}.btn-check:active+div.tsml-ui .btn-outline-light,.btn-check:checked+div.tsml-ui .btn-outline-light,div.tsml-ui .btn-outline-light.active,div.tsml-ui .btn-outline-light.dropdown-toggle.show,div.tsml-ui .btn-outline-light:active{background-color:#f8f9fa;border-color:#f8f9fa;color:#000}.btn-check:active+div.tsml-ui .btn-outline-light:focus,.btn-check:checked+div.tsml-ui .btn-outline-light:focus,div.tsml-ui .btn-outline-light.active:focus,div.tsml-ui .btn-outline-light.dropdown-toggle.show:focus,div.tsml-ui .btn-outline-light:active:focus{box-shadow:0 0 0 .25rem rgba(248,249,250,.5)}div.tsml-ui .btn-outline-light.disabled,div.tsml-ui .btn-outline-light:disabled{background-color:transparent;color:#f8f9fa}div.tsml-ui .btn-outline-dark{border-color:#212529;color:#212529}div.tsml-ui .btn-outline-dark:hover{background-color:#212529;border-color:#212529;color:#fff}.btn-check:focus+div.tsml-ui .btn-outline-dark,div.tsml-ui .btn-outline-dark:focus{box-shadow:0 0 0 .25rem rgba(33,37,41,.5)}.btn-check:active+div.tsml-ui .btn-outline-dark,.btn-check:checked+div.tsml-ui .btn-outline-dark,div.tsml-ui .btn-outline-dark.active,div.tsml-ui .btn-outline-dark.dropdown-toggle.show,div.tsml-ui .btn-outline-dark:active{background-color:#212529;border-color:#212529;color:#fff}.btn-check:active+div.tsml-ui .btn-outline-dark:focus,.btn-check:checked+div.tsml-ui .btn-outline-dark:focus,div.tsml-ui .btn-outline-dark.active:focus,div.tsml-ui .btn-outline-dark.dropdown-toggle.show:focus,div.tsml-ui .btn-outline-dark:active:focus{box-shadow:0 0 0 .25rem rgba(33,37,41,.5)}div.tsml-ui .btn-outline-dark.disabled,div.tsml-ui .btn-outline-dark:disabled{background-color:transparent;color:#212529}div.tsml-ui .btn-link{color:#0d6efd;font-weight:400;text-decoration:underline}div.tsml-ui .btn-link:hover{color:#0a58ca}div.tsml-ui .btn-link.disabled,div.tsml-ui .btn-link:disabled{color:#6c757d}div.tsml-ui .btn-group-lg>.btn,div.tsml-ui .btn-lg{border-radius:.3rem;font-size:20px;padding:.5rem 1rem}div.tsml-ui .btn-group-sm>.btn,div.tsml-ui .btn-sm{border-radius:.2rem;font-size:14px;padding:4px 8px}div.tsml-ui .dropdown,div.tsml-ui .dropend,div.tsml-ui .dropstart,div.tsml-ui .dropup{position:relative}div.tsml-ui .dropdown-toggle{white-space:nowrap}div.tsml-ui .dropdown-toggle:after{border-bottom:0;border-left:.3em solid transparent;border-right:.3em solid transparent;border-top:.3em solid;content:\"\";display:inline-block;margin-left:.255em;vertical-align:.255em}div.tsml-ui .dropdown-toggle:empty:after{margin-left:0}div.tsml-ui .dropdown-menu{background-clip:padding-box;background-color:#fff;border:1px solid rgba(0,0,0,.15);border-radius:.25rem;color:#212529;display:none;font-size:16px;list-style:none;margin:0;min-width:10rem;padding:.5rem 0;position:absolute;text-align:left;z-index:1000}div.tsml-ui .dropdown-menu[data-bs-popper]{left:0;margin-top:.125rem;top:100%}div.tsml-ui .dropdown-menu-start{--bs-position:start}div.tsml-ui .dropdown-menu-start[data-bs-popper]{left:0;right:auto}div.tsml-ui .dropdown-menu-end{--bs-position:end}div.tsml-ui .dropdown-menu-end[data-bs-popper]{left:auto;right:0}@media (min-width:576px){div.tsml-ui .dropdown-menu-sm-start{--bs-position:start}div.tsml-ui .dropdown-menu-sm-start[data-bs-popper]{left:0;right:auto}div.tsml-ui .dropdown-menu-sm-end{--bs-position:end}div.tsml-ui .dropdown-menu-sm-end[data-bs-popper]{left:auto;right:0}}@media (min-width:768px){div.tsml-ui .dropdown-menu-md-start{--bs-position:start}div.tsml-ui .dropdown-menu-md-start[data-bs-popper]{left:0;right:auto}div.tsml-ui .dropdown-menu-md-end{--bs-position:end}div.tsml-ui .dropdown-menu-md-end[data-bs-popper]{left:auto;right:0}}@media (min-width:992px){div.tsml-ui .dropdown-menu-lg-start{--bs-position:start}div.tsml-ui .dropdown-menu-lg-start[data-bs-popper]{left:0;right:auto}div.tsml-ui .dropdown-menu-lg-end{--bs-position:end}div.tsml-ui .dropdown-menu-lg-end[data-bs-popper]{left:auto;right:0}}@media (min-width:1200px){div.tsml-ui .dropdown-menu-xl-start{--bs-position:start}div.tsml-ui .dropdown-menu-xl-start[data-bs-popper]{left:0;right:auto}div.tsml-ui .dropdown-menu-xl-end{--bs-position:end}div.tsml-ui .dropdown-menu-xl-end[data-bs-popper]{left:auto;right:0}}@media (min-width:1400px){div.tsml-ui .dropdown-menu-xxl-start{--bs-position:start}div.tsml-ui .dropdown-menu-xxl-start[data-bs-popper]{left:0;right:auto}div.tsml-ui .dropdown-menu-xxl-end{--bs-position:end}div.tsml-ui .dropdown-menu-xxl-end[data-bs-popper]{left:auto;right:0}}div.tsml-ui .dropup .dropdown-menu[data-bs-popper]{bottom:100%;margin-bottom:.125rem;margin-top:0;top:auto}div.tsml-ui .dropup .dropdown-toggle:after{border-bottom:.3em solid;border-left:.3em solid transparent;border-right:.3em solid transparent;border-top:0;content:\"\";display:inline-block;margin-left:.255em;vertical-align:.255em}div.tsml-ui .dropup .dropdown-toggle:empty:after{margin-left:0}div.tsml-ui .dropend .dropdown-menu[data-bs-popper]{left:100%;margin-left:.125rem;margin-top:0;right:auto;top:0}div.tsml-ui .dropend .dropdown-toggle:after{border-bottom:.3em solid transparent;border-left:.3em solid;border-right:0;border-top:.3em solid transparent;content:\"\";display:inline-block;margin-left:.255em;vertical-align:.255em}div.tsml-ui .dropend .dropdown-toggle:empty:after{margin-left:0}div.tsml-ui .dropend .dropdown-toggle:after{vertical-align:0}div.tsml-ui .dropstart .dropdown-menu[data-bs-popper]{left:auto;margin-right:.125rem;margin-top:0;right:100%;top:0}div.tsml-ui .dropstart .dropdown-toggle:after{content:\"\";display:inline-block;display:none;margin-left:.255em;vertical-align:.255em}div.tsml-ui .dropstart .dropdown-toggle:before{border-bottom:.3em solid transparent;border-right:.3em solid;border-top:.3em solid transparent;content:\"\";display:inline-block;margin-right:.255em;vertical-align:.255em}div.tsml-ui .dropstart .dropdown-toggle:empty:after{margin-left:0}div.tsml-ui .dropstart .dropdown-toggle:before{vertical-align:0}div.tsml-ui .dropdown-divider{border-top:1px solid rgba(0,0,0,.15);height:0;margin:8px 0;overflow:hidden}div.tsml-ui .dropdown-item{background-color:transparent;border:0;clear:both;color:#212529;display:block;font-weight:400;padding:4px 16px;text-align:inherit;text-decoration:none;white-space:nowrap;width:100%}div.tsml-ui .dropdown-item:focus,div.tsml-ui .dropdown-item:hover{background-color:#e9ecef;color:#1e2125}div.tsml-ui .dropdown-item.active,div.tsml-ui .dropdown-item:active{background-color:#0d6efd;color:#fff;text-decoration:none}div.tsml-ui .dropdown-item.disabled,div.tsml-ui .dropdown-item:disabled{background-color:transparent;color:#adb5bd;pointer-events:none}div.tsml-ui .dropdown-menu.show{display:block}div.tsml-ui .dropdown-header{color:#6c757d;display:block;font-size:14px;margin-bottom:0;padding:.5rem 16px;white-space:nowrap}div.tsml-ui .dropdown-item-text{color:#212529;display:block;padding:4px 16px}div.tsml-ui .dropdown-menu-dark{background-color:#343a40;border-color:rgba(0,0,0,.15);color:#dee2e6}div.tsml-ui .dropdown-menu-dark .dropdown-item{color:#dee2e6}div.tsml-ui .dropdown-menu-dark .dropdown-item:focus,div.tsml-ui .dropdown-menu-dark .dropdown-item:hover{background-color:hsla(0,0%,100%,.15);color:#fff}div.tsml-ui .dropdown-menu-dark .dropdown-item.active,div.tsml-ui .dropdown-menu-dark .dropdown-item:active{background-color:#0d6efd;color:#fff}div.tsml-ui .dropdown-menu-dark .dropdown-item.disabled,div.tsml-ui .dropdown-menu-dark .dropdown-item:disabled{color:#adb5bd}div.tsml-ui .dropdown-menu-dark .dropdown-divider{border-color:rgba(0,0,0,.15)}div.tsml-ui .dropdown-menu-dark .dropdown-item-text{color:#dee2e6}div.tsml-ui .dropdown-menu-dark .dropdown-header{color:#adb5bd}div.tsml-ui .btn-group,div.tsml-ui .btn-group-vertical{display:inline-flex;position:relative;vertical-align:middle}div.tsml-ui .btn-group-vertical>.btn,div.tsml-ui .btn-group>.btn{flex:1 1 auto;position:relative}div.tsml-ui .btn-group-vertical>.btn-check:checked+.btn,div.tsml-ui .btn-group-vertical>.btn-check:focus+.btn,div.tsml-ui .btn-group-vertical>.btn.active,div.tsml-ui .btn-group-vertical>.btn:active,div.tsml-ui .btn-group-vertical>.btn:focus,div.tsml-ui .btn-group-vertical>.btn:hover,div.tsml-ui .btn-group>.btn-check:checked+.btn,div.tsml-ui .btn-group>.btn-check:focus+.btn,div.tsml-ui .btn-group>.btn.active,div.tsml-ui .btn-group>.btn:active,div.tsml-ui .btn-group>.btn:focus,div.tsml-ui .btn-group>.btn:hover{z-index:1}div.tsml-ui .btn-toolbar{display:flex;flex-wrap:wrap;justify-content:flex-start}div.tsml-ui .btn-toolbar .input-group{width:auto}div.tsml-ui .btn-group>.btn-group:not(:first-child),div.tsml-ui .btn-group>.btn:not(:first-child){margin-left:-1px}div.tsml-ui .btn-group>.btn-group:not(:last-child)>.btn,div.tsml-ui .btn-group>.btn:not(:last-child):not(.dropdown-toggle){border-bottom-right-radius:0;border-top-right-radius:0}div.tsml-ui .btn-group>.btn-group:not(:first-child)>.btn,div.tsml-ui .btn-group>.btn:nth-child(n+3),div.tsml-ui .btn-group>:not(.btn-check)+.btn{border-bottom-left-radius:0;border-top-left-radius:0}div.tsml-ui .dropdown-toggle-split{padding-left:9px;padding-right:9px}.dropend div.tsml-ui .dropdown-toggle-split:after,.dropup div.tsml-ui .dropdown-toggle-split:after,div.tsml-ui .dropdown-toggle-split:after{margin-left:0}.dropstart div.tsml-ui .dropdown-toggle-split:before{margin-right:0}div.tsml-ui .btn-group-sm>.btn+.dropdown-toggle-split,div.tsml-ui .btn-sm+.dropdown-toggle-split{padding-left:6px;padding-right:6px}div.tsml-ui .btn-group-lg>.btn+.dropdown-toggle-split,div.tsml-ui .btn-lg+.dropdown-toggle-split{padding-left:.75rem;padding-right:.75rem}div.tsml-ui .btn-group-vertical{align-items:flex-start;flex-direction:column;justify-content:center}div.tsml-ui .btn-group-vertical>.btn,div.tsml-ui .btn-group-vertical>.btn-group{width:100%}div.tsml-ui .btn-group-vertical>.btn-group:not(:first-child),div.tsml-ui .btn-group-vertical>.btn:not(:first-child){margin-top:-1px}div.tsml-ui .btn-group-vertical>.btn-group:not(:last-child)>.btn,div.tsml-ui .btn-group-vertical>.btn:not(:last-child):not(.dropdown-toggle){border-bottom-left-radius:0;border-bottom-right-radius:0}div.tsml-ui .btn-group-vertical>.btn-group:not(:first-child)>.btn,div.tsml-ui .btn-group-vertical>.btn~.btn{border-top-left-radius:0;border-top-right-radius:0}div.tsml-ui .badge{border-radius:.25rem;color:#fff;display:inline-block;font-size:.75em;font-weight:700;line-height:1;padding:.35em .65em;text-align:center;vertical-align:baseline;white-space:nowrap}div.tsml-ui .badge:empty{display:none}div.tsml-ui .btn .badge{position:relative;top:-1px}div.tsml-ui .alert{border:1px solid transparent;border-radius:.25rem;margin-bottom:1rem;padding:16px;position:relative}div.tsml-ui .alert-heading{color:inherit}div.tsml-ui .alert-link{font-weight:700}div.tsml-ui .alert-dismissible{padding-right:48px}div.tsml-ui .alert-dismissible .btn-close{padding:20px 16px;position:absolute;right:0;top:0;z-index:2}div.tsml-ui .alert-primary{background-color:#cfe2ff;border-color:#b6d4fe;color:#084298}div.tsml-ui .alert-primary .alert-link{color:#06357a}div.tsml-ui .alert-secondary{background-color:#e2e3e5;border-color:#d3d6d8;color:#41464b}div.tsml-ui .alert-secondary .alert-link{color:#34383c}div.tsml-ui .alert-success{background-color:#d1e7dd;border-color:#badbcc;color:#0f5132}div.tsml-ui .alert-success .alert-link{color:#0c4128}div.tsml-ui .alert-info{background-color:#cff4fc;border-color:#b6effb;color:#055160}div.tsml-ui .alert-info .alert-link{color:#04414d}div.tsml-ui .alert-warning{background-color:#fff3cd;border-color:#ffecb5;color:#664d03}div.tsml-ui .alert-warning .alert-link{color:#523e02}div.tsml-ui .alert-danger{background-color:#f8d7da;border-color:#f5c2c7;color:#842029}div.tsml-ui .alert-danger .alert-link{color:#6a1a21}div.tsml-ui .alert-light{background-color:#fefefe;border-color:#fdfdfe;color:#636464}div.tsml-ui .alert-light .alert-link{color:#4f5050}div.tsml-ui .alert-dark{background-color:#d3d3d4;border-color:#bcbebf;color:#141619}div.tsml-ui .alert-dark .alert-link{color:#101214}div.tsml-ui .list-group{border-radius:.25rem;display:flex;flex-direction:column;margin-bottom:0;padding-left:0}div.tsml-ui .list-group-numbered{counter-reset:section;list-style-type:none}div.tsml-ui .list-group-numbered>li:before{content:counters(section,\".\") \". \";counter-increment:section}div.tsml-ui .list-group-item-action{color:#495057;text-align:inherit;width:100%}div.tsml-ui .list-group-item-action:focus,div.tsml-ui .list-group-item-action:hover{background-color:#f8f9fa;color:#495057;text-decoration:none;z-index:1}div.tsml-ui .list-group-item-action:active{background-color:#e9ecef;color:#212529}div.tsml-ui .list-group-item{background-color:#fff;border:1px solid rgba(0,0,0,.125);color:#212529;display:block;padding:8px 16px;position:relative;text-decoration:none}div.tsml-ui .list-group-item:first-child{border-top-left-radius:inherit;border-top-right-radius:inherit}div.tsml-ui .list-group-item:last-child{border-bottom-left-radius:inherit;border-bottom-right-radius:inherit}div.tsml-ui .list-group-item.disabled,div.tsml-ui .list-group-item:disabled{background-color:#fff;color:#6c757d;pointer-events:none}div.tsml-ui .list-group-item.active{background-color:#0d6efd;border-color:#0d6efd;color:#fff;z-index:2}div.tsml-ui .list-group-item+div.tsml-ui .list-group-item{border-top-width:0}div.tsml-ui .list-group-item+div.tsml-ui .list-group-item.active{border-top-width:1px;margin-top:-1px}div.tsml-ui .list-group-horizontal{flex-direction:row}div.tsml-ui .list-group-horizontal>.list-group-item:first-child{border-bottom-left-radius:.25rem;border-top-right-radius:0}div.tsml-ui .list-group-horizontal>.list-group-item:last-child{border-bottom-left-radius:0;border-top-right-radius:.25rem}div.tsml-ui .list-group-horizontal>.list-group-item.active{margin-top:0}div.tsml-ui .list-group-horizontal>.list-group-item+.list-group-item{border-left-width:0;border-top-width:1px}div.tsml-ui .list-group-horizontal>.list-group-item+.list-group-item.active{border-left-width:1px;margin-left:-1px}@media (min-width:576px){div.tsml-ui .list-group-horizontal-sm{flex-direction:row}div.tsml-ui .list-group-horizontal-sm>.list-group-item:first-child{border-bottom-left-radius:.25rem;border-top-right-radius:0}div.tsml-ui .list-group-horizontal-sm>.list-group-item:last-child{border-bottom-left-radius:0;border-top-right-radius:.25rem}div.tsml-ui .list-group-horizontal-sm>.list-group-item.active{margin-top:0}div.tsml-ui .list-group-horizontal-sm>.list-group-item+.list-group-item{border-left-width:0;border-top-width:1px}div.tsml-ui .list-group-horizontal-sm>.list-group-item+.list-group-item.active{border-left-width:1px;margin-left:-1px}}@media (min-width:768px){div.tsml-ui .list-group-horizontal-md{flex-direction:row}div.tsml-ui .list-group-horizontal-md>.list-group-item:first-child{border-bottom-left-radius:.25rem;border-top-right-radius:0}div.tsml-ui .list-group-horizontal-md>.list-group-item:last-child{border-bottom-left-radius:0;border-top-right-radius:.25rem}div.tsml-ui .list-group-horizontal-md>.list-group-item.active{margin-top:0}div.tsml-ui .list-group-horizontal-md>.list-group-item+.list-group-item{border-left-width:0;border-top-width:1px}div.tsml-ui .list-group-horizontal-md>.list-group-item+.list-group-item.active{border-left-width:1px;margin-left:-1px}}@media (min-width:992px){div.tsml-ui .list-group-horizontal-lg{flex-direction:row}div.tsml-ui .list-group-horizontal-lg>.list-group-item:first-child{border-bottom-left-radius:.25rem;border-top-right-radius:0}div.tsml-ui .list-group-horizontal-lg>.list-group-item:last-child{border-bottom-left-radius:0;border-top-right-radius:.25rem}div.tsml-ui .list-group-horizontal-lg>.list-group-item.active{margin-top:0}div.tsml-ui .list-group-horizontal-lg>.list-group-item+.list-group-item{border-left-width:0;border-top-width:1px}div.tsml-ui .list-group-horizontal-lg>.list-group-item+.list-group-item.active{border-left-width:1px;margin-left:-1px}}@media (min-width:1200px){div.tsml-ui .list-group-horizontal-xl{flex-direction:row}div.tsml-ui .list-group-horizontal-xl>.list-group-item:first-child{border-bottom-left-radius:.25rem;border-top-right-radius:0}div.tsml-ui .list-group-horizontal-xl>.list-group-item:last-child{border-bottom-left-radius:0;border-top-right-radius:.25rem}div.tsml-ui .list-group-horizontal-xl>.list-group-item.active{margin-top:0}div.tsml-ui .list-group-horizontal-xl>.list-group-item+.list-group-item{border-left-width:0;border-top-width:1px}div.tsml-ui .list-group-horizontal-xl>.list-group-item+.list-group-item.active{border-left-width:1px;margin-left:-1px}}@media (min-width:1400px){div.tsml-ui .list-group-horizontal-xxl{flex-direction:row}div.tsml-ui .list-group-horizontal-xxl>.list-group-item:first-child{border-bottom-left-radius:.25rem;border-top-right-radius:0}div.tsml-ui .list-group-horizontal-xxl>.list-group-item:last-child{border-bottom-left-radius:0;border-top-right-radius:.25rem}div.tsml-ui .list-group-horizontal-xxl>.list-group-item.active{margin-top:0}div.tsml-ui .list-group-horizontal-xxl>.list-group-item+.list-group-item{border-left-width:0;border-top-width:1px}div.tsml-ui .list-group-horizontal-xxl>.list-group-item+.list-group-item.active{border-left-width:1px;margin-left:-1px}}div.tsml-ui .list-group-flush{border-radius:0}div.tsml-ui .list-group-flush>.list-group-item{border-width:0 0 1px}div.tsml-ui .list-group-flush>.list-group-item:last-child{border-bottom-width:0}div.tsml-ui .list-group-item-primary{background-color:#cfe2ff;color:#084298}div.tsml-ui .list-group-item-primary.list-group-item-action:focus,div.tsml-ui .list-group-item-primary.list-group-item-action:hover{background-color:#bacbe6;color:#084298}div.tsml-ui .list-group-item-primary.list-group-item-action.active{background-color:#084298;border-color:#084298;color:#fff}div.tsml-ui .list-group-item-secondary{background-color:#e2e3e5;color:#41464b}div.tsml-ui .list-group-item-secondary.list-group-item-action:focus,div.tsml-ui .list-group-item-secondary.list-group-item-action:hover{background-color:#cbccce;color:#41464b}div.tsml-ui .list-group-item-secondary.list-group-item-action.active{background-color:#41464b;border-color:#41464b;color:#fff}div.tsml-ui .list-group-item-success{background-color:#d1e7dd;color:#0f5132}div.tsml-ui .list-group-item-success.list-group-item-action:focus,div.tsml-ui .list-group-item-success.list-group-item-action:hover{background-color:#bcd0c7;color:#0f5132}div.tsml-ui .list-group-item-success.list-group-item-action.active{background-color:#0f5132;border-color:#0f5132;color:#fff}div.tsml-ui .list-group-item-info{background-color:#cff4fc;color:#055160}div.tsml-ui .list-group-item-info.list-group-item-action:focus,div.tsml-ui .list-group-item-info.list-group-item-action:hover{background-color:#badce3;color:#055160}div.tsml-ui .list-group-item-info.list-group-item-action.active{background-color:#055160;border-color:#055160;color:#fff}div.tsml-ui .list-group-item-warning{background-color:#fff3cd;color:#664d03}div.tsml-ui .list-group-item-warning.list-group-item-action:focus,div.tsml-ui .list-group-item-warning.list-group-item-action:hover{background-color:#e6dbb9;color:#664d03}div.tsml-ui .list-group-item-warning.list-group-item-action.active{background-color:#664d03;border-color:#664d03;color:#fff}div.tsml-ui .list-group-item-danger{background-color:#f8d7da;color:#842029}div.tsml-ui .list-group-item-danger.list-group-item-action:focus,div.tsml-ui .list-group-item-danger.list-group-item-action:hover{background-color:#dfc2c4;color:#842029}div.tsml-ui .list-group-item-danger.list-group-item-action.active{background-color:#842029;border-color:#842029;color:#fff}div.tsml-ui .list-group-item-light{background-color:#fefefe;color:#636464}div.tsml-ui .list-group-item-light.list-group-item-action:focus,div.tsml-ui .list-group-item-light.list-group-item-action:hover{background-color:#e5e5e5;color:#636464}div.tsml-ui .list-group-item-light.list-group-item-action.active{background-color:#636464;border-color:#636464;color:#fff}div.tsml-ui .list-group-item-dark{background-color:#d3d3d4;color:#141619}div.tsml-ui .list-group-item-dark.list-group-item-action:focus,div.tsml-ui .list-group-item-dark.list-group-item-action:hover{background-color:#bebebf;color:#141619}div.tsml-ui .list-group-item-dark.list-group-item-action.active{background-color:#141619;border-color:#141619;color:#fff}@-webkit-keyframes spinner-border{to{transform:rotate(1turn)}}@keyframes spinner-border{to{transform:rotate(1turn)}}div.tsml-ui .spinner-border{-webkit-animation:spinner-border .75s linear infinite;animation:spinner-border .75s linear infinite;border:.25em solid;border-radius:50%;border-right:.25em solid transparent;display:inline-block;height:2rem;vertical-align:-.125em;width:2rem}div.tsml-ui .spinner-border-sm{border-width:.2em;height:1rem;width:1rem}@-webkit-keyframes spinner-grow{0%{transform:scale(0)}50%{opacity:1;transform:none}}@keyframes spinner-grow{0%{transform:scale(0)}50%{opacity:1;transform:none}}div.tsml-ui .spinner-grow{-webkit-animation:spinner-grow .75s linear infinite;animation:spinner-grow .75s linear infinite;background-color:currentColor;border-radius:50%;display:inline-block;height:2rem;opacity:0;vertical-align:-.125em;width:2rem}div.tsml-ui .spinner-grow-sm{height:1rem;width:1rem}@media (prefers-reduced-motion:reduce){div.tsml-ui .spinner-border,div.tsml-ui .spinner-grow{-webkit-animation-duration:1.5s;animation-duration:1.5s}}div.tsml-ui .offcanvas{background-clip:padding-box;background-color:#fff;bottom:0;display:flex;flex-direction:column;max-width:100%;outline:0;position:fixed;transition:transform .3s ease-in-out;visibility:hidden;z-index:1045}@media (prefers-reduced-motion:reduce){div.tsml-ui .offcanvas{transition:none}}div.tsml-ui .offcanvas-backdrop{background-color:#000;height:100vh;left:0;position:fixed;top:0;width:100vw;z-index:1040}div.tsml-ui .offcanvas-backdrop.fade{opacity:0}div.tsml-ui .offcanvas-backdrop.show{opacity:.5}div.tsml-ui .offcanvas-header{align-items:center;display:flex;justify-content:space-between;padding:16px}div.tsml-ui .offcanvas-header .btn-close{margin-bottom:-8px;margin-right:-8px;margin-top:-8px;padding:8px}div.tsml-ui .offcanvas-title{line-height:1.5;margin-bottom:0}div.tsml-ui .offcanvas-body{flex-grow:1;overflow-y:auto;padding:16px}div.tsml-ui .offcanvas-start{border-right:1px solid rgba(0,0,0,.2);left:0;top:0;transform:translateX(-100%);width:400px}div.tsml-ui .offcanvas-end{border-left:1px solid rgba(0,0,0,.2);right:0;top:0;transform:translateX(100%);width:400px}div.tsml-ui .offcanvas-top{border-bottom:1px solid rgba(0,0,0,.2);height:30vh;left:0;max-height:100%;right:0;top:0;transform:translateY(-100%)}div.tsml-ui .offcanvas-bottom{border-top:1px solid rgba(0,0,0,.2);height:30vh;left:0;max-height:100%;right:0;transform:translateY(100%)}div.tsml-ui .offcanvas.show{transform:none}div.tsml-ui .clearfix:after{clear:both;content:\"\";display:block}div.tsml-ui .link-primary{color:#0d6efd}div.tsml-ui .link-primary:focus,div.tsml-ui .link-primary:hover{color:#0a58ca}div.tsml-ui .link-secondary{color:#6c757d}div.tsml-ui .link-secondary:focus,div.tsml-ui .link-secondary:hover{color:#565e64}div.tsml-ui .link-success{color:#198754}div.tsml-ui .link-success:focus,div.tsml-ui .link-success:hover{color:#146c43}div.tsml-ui .link-info{color:#0dcaf0}div.tsml-ui .link-info:focus,div.tsml-ui .link-info:hover{color:#3dd5f3}div.tsml-ui .link-warning{color:#ffc107}div.tsml-ui .link-warning:focus,div.tsml-ui .link-warning:hover{color:#ffcd39}div.tsml-ui .link-danger{color:#dc3545}div.tsml-ui .link-danger:focus,div.tsml-ui .link-danger:hover{color:#b02a37}div.tsml-ui .link-light{color:#f8f9fa}div.tsml-ui .link-light:focus,div.tsml-ui .link-light:hover{color:#f9fafb}div.tsml-ui .link-dark{color:#212529}div.tsml-ui .link-dark:focus,div.tsml-ui .link-dark:hover{color:#1a1e21}div.tsml-ui .ratio{position:relative;width:100%}div.tsml-ui .ratio:before{content:\"\";display:block;padding-top:var(--bs-aspect-ratio)}div.tsml-ui .ratio>*{height:100%;left:0;position:absolute;top:0;width:100%}div.tsml-ui .ratio-1x1{--bs-aspect-ratio:100%}div.tsml-ui .ratio-4x3{--bs-aspect-ratio:75%}div.tsml-ui .ratio-16x9{--bs-aspect-ratio:56.25%}div.tsml-ui .ratio-21x9{--bs-aspect-ratio:42.8571428571%}div.tsml-ui .fixed-top{left:0;position:fixed;right:0;top:0;z-index:1030}div.tsml-ui .fixed-bottom{bottom:0;left:0;position:fixed;right:0;z-index:1030}div.tsml-ui .sticky-top{position:-webkit-sticky;position:sticky;top:0;z-index:1020}@media (min-width:576px){div.tsml-ui .sticky-sm-top{position:-webkit-sticky;position:sticky;top:0;z-index:1020}}@media (min-width:768px){div.tsml-ui .sticky-md-top{position:-webkit-sticky;position:sticky;top:0;z-index:1020}}@media (min-width:992px){div.tsml-ui .sticky-lg-top{position:-webkit-sticky;position:sticky;top:0;z-index:1020}}@media (min-width:1200px){div.tsml-ui .sticky-xl-top{position:-webkit-sticky;position:sticky;top:0;z-index:1020}}@media (min-width:1400px){div.tsml-ui .sticky-xxl-top{position:-webkit-sticky;position:sticky;top:0;z-index:1020}}div.tsml-ui .hstack{align-items:center;align-self:stretch;display:flex;flex-direction:row}div.tsml-ui .vstack{align-self:stretch;display:flex;flex:1 1 auto;flex-direction:column}div.tsml-ui .visually-hidden,div.tsml-ui .visually-hidden-focusable:not(:focus):not(:focus-within){clip:rect(0,0,0,0)!important;border:0!important;height:1px!important;margin:-1px!important;overflow:hidden!important;padding:0!important;position:absolute!important;white-space:nowrap!important;width:1px!important}div.tsml-ui .stretched-link:after{bottom:0;content:\"\";left:0;position:absolute;right:0;top:0;z-index:1}div.tsml-ui .text-truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}div.tsml-ui .vr{align-self:stretch;background-color:currentColor;display:inline-block;min-height:1em;opacity:.25;width:1px}div.tsml-ui .align-baseline{vertical-align:baseline!important}div.tsml-ui .align-top{vertical-align:top!important}div.tsml-ui .align-middle{vertical-align:middle!important}div.tsml-ui .align-bottom{vertical-align:bottom!important}div.tsml-ui .align-text-bottom{vertical-align:text-bottom!important}div.tsml-ui .align-text-top{vertical-align:text-top!important}div.tsml-ui .float-start{float:left!important}div.tsml-ui .float-end{float:right!important}div.tsml-ui .float-none{float:none!important}div.tsml-ui .opacity-0{opacity:0!important}div.tsml-ui .opacity-25{opacity:.25!important}div.tsml-ui .opacity-50{opacity:.5!important}div.tsml-ui .opacity-75{opacity:.75!important}div.tsml-ui .opacity-100{opacity:1!important}div.tsml-ui .overflow-auto{overflow:auto!important}div.tsml-ui .overflow-hidden{overflow:hidden!important}div.tsml-ui .overflow-visible{overflow:visible!important}div.tsml-ui .overflow-scroll{overflow:scroll!important}div.tsml-ui .d-inline{display:inline!important}div.tsml-ui .d-inline-block{display:inline-block!important}div.tsml-ui .d-block{display:block!important}div.tsml-ui .d-grid{display:grid!important}div.tsml-ui .d-table{display:table!important}div.tsml-ui .d-table-row{display:table-row!important}div.tsml-ui .d-table-cell{display:table-cell!important}div.tsml-ui .d-flex{display:flex!important}div.tsml-ui .d-inline-flex{display:inline-flex!important}div.tsml-ui .d-none{display:none!important}div.tsml-ui .shadow{box-shadow:0 .5rem 1rem rgba(0,0,0,.15)!important}div.tsml-ui .shadow-sm{box-shadow:0 .125rem .25rem rgba(0,0,0,.075)!important}div.tsml-ui .shadow-lg{box-shadow:0 1rem 3rem rgba(0,0,0,.175)!important}div.tsml-ui .shadow-none{box-shadow:none!important}div.tsml-ui .position-static{position:static!important}div.tsml-ui .position-relative{position:relative!important}div.tsml-ui .position-absolute{position:absolute!important}div.tsml-ui .position-fixed{position:fixed!important}div.tsml-ui .position-sticky{position:-webkit-sticky!important;position:sticky!important}div.tsml-ui .top-0{top:0!important}div.tsml-ui .top-50{top:50%!important}div.tsml-ui .top-100{top:100%!important}div.tsml-ui .bottom-0{bottom:0!important}div.tsml-ui .bottom-50{bottom:50%!important}div.tsml-ui .bottom-100{bottom:100%!important}div.tsml-ui .start-0{left:0!important}div.tsml-ui .start-50{left:50%!important}div.tsml-ui .start-100{left:100%!important}div.tsml-ui .end-0{right:0!important}div.tsml-ui .end-50{right:50%!important}div.tsml-ui .end-100{right:100%!important}div.tsml-ui .translate-middle{transform:translate(-50%,-50%)!important}div.tsml-ui .translate-middle-x{transform:translateX(-50%)!important}div.tsml-ui .translate-middle-y{transform:translateY(-50%)!important}div.tsml-ui .border{border:1px solid #dee2e6!important}div.tsml-ui .border-0{border:0!important}div.tsml-ui .border-top{border-top:1px solid #dee2e6!important}div.tsml-ui .border-top-0{border-top:0!important}div.tsml-ui .border-end{border-right:1px solid #dee2e6!important}div.tsml-ui .border-end-0{border-right:0!important}div.tsml-ui .border-bottom{border-bottom:1px solid #dee2e6!important}div.tsml-ui .border-bottom-0{border-bottom:0!important}div.tsml-ui .border-start{border-left:1px solid #dee2e6!important}div.tsml-ui .border-start-0{border-left:0!important}div.tsml-ui .border-primary{border-color:#0d6efd!important}div.tsml-ui .border-secondary{border-color:#6c757d!important}div.tsml-ui .border-success{border-color:#198754!important}div.tsml-ui .border-info{border-color:#0dcaf0!important}div.tsml-ui .border-warning{border-color:#ffc107!important}div.tsml-ui .border-danger{border-color:#dc3545!important}div.tsml-ui .border-light{border-color:#f8f9fa!important}div.tsml-ui .border-dark{border-color:#212529!important}div.tsml-ui .border-white{border-color:#fff!important}div.tsml-ui .border-1{border-width:1px!important}div.tsml-ui .border-2{border-width:2px!important}div.tsml-ui .border-3{border-width:3px!important}div.tsml-ui .border-4{border-width:4px!important}div.tsml-ui .border-5{border-width:5px!important}div.tsml-ui .w-25{width:25%!important}div.tsml-ui .w-50{width:50%!important}div.tsml-ui .w-75{width:75%!important}div.tsml-ui .w-100{width:100%!important}div.tsml-ui .w-auto{width:auto!important}div.tsml-ui .mw-100{max-width:100%!important}div.tsml-ui .vw-100{width:100vw!important}div.tsml-ui .min-vw-100{min-width:100vw!important}div.tsml-ui .h-25{height:25%!important}div.tsml-ui .h-50{height:50%!important}div.tsml-ui .h-75{height:75%!important}div.tsml-ui .h-100{height:100%!important}div.tsml-ui .h-auto{height:auto!important}div.tsml-ui .mh-100{max-height:100%!important}div.tsml-ui .vh-100{height:100vh!important}div.tsml-ui .min-vh-100{min-height:100vh!important}div.tsml-ui .flex-fill{flex:1 1 auto!important}div.tsml-ui .flex-row{flex-direction:row!important}div.tsml-ui .flex-column{flex-direction:column!important}div.tsml-ui .flex-row-reverse{flex-direction:row-reverse!important}div.tsml-ui .flex-column-reverse{flex-direction:column-reverse!important}div.tsml-ui .flex-grow-0{flex-grow:0!important}div.tsml-ui .flex-grow-1{flex-grow:1!important}div.tsml-ui .flex-shrink-0{flex-shrink:0!important}div.tsml-ui .flex-shrink-1{flex-shrink:1!important}div.tsml-ui .flex-wrap{flex-wrap:wrap!important}div.tsml-ui .flex-nowrap{flex-wrap:nowrap!important}div.tsml-ui .flex-wrap-reverse{flex-wrap:wrap-reverse!important}div.tsml-ui .gap-0{gap:0!important}div.tsml-ui .gap-1{gap:4px!important}div.tsml-ui .gap-2{gap:8px!important}div.tsml-ui .gap-3{gap:16px!important}div.tsml-ui .gap-4{gap:24px!important}div.tsml-ui .gap-5{gap:48px!important}div.tsml-ui .justify-content-start{justify-content:flex-start!important}div.tsml-ui .justify-content-end{justify-content:flex-end!important}div.tsml-ui .justify-content-center{justify-content:center!important}div.tsml-ui .justify-content-between{justify-content:space-between!important}div.tsml-ui .justify-content-around{justify-content:space-around!important}div.tsml-ui .justify-content-evenly{justify-content:space-evenly!important}div.tsml-ui .align-items-start{align-items:flex-start!important}div.tsml-ui .align-items-end{align-items:flex-end!important}div.tsml-ui .align-items-center{align-items:center!important}div.tsml-ui .align-items-baseline{align-items:baseline!important}div.tsml-ui .align-items-stretch{align-items:stretch!important}div.tsml-ui .align-content-start{align-content:flex-start!important}div.tsml-ui .align-content-end{align-content:flex-end!important}div.tsml-ui .align-content-center{align-content:center!important}div.tsml-ui .align-content-between{align-content:space-between!important}div.tsml-ui .align-content-around{align-content:space-around!important}div.tsml-ui .align-content-stretch{align-content:stretch!important}div.tsml-ui .align-self-auto{align-self:auto!important}div.tsml-ui .align-self-start{align-self:flex-start!important}div.tsml-ui .align-self-end{align-self:flex-end!important}div.tsml-ui .align-self-center{align-self:center!important}div.tsml-ui .align-self-baseline{align-self:baseline!important}div.tsml-ui .align-self-stretch{align-self:stretch!important}div.tsml-ui .order-first{order:-1!important}div.tsml-ui .order-0{order:0!important}div.tsml-ui .order-1{order:1!important}div.tsml-ui .order-2{order:2!important}div.tsml-ui .order-3{order:3!important}div.tsml-ui .order-4{order:4!important}div.tsml-ui .order-5{order:5!important}div.tsml-ui .order-last{order:6!important}div.tsml-ui .m-0{margin:0!important}div.tsml-ui .m-1{margin:4px!important}div.tsml-ui .m-2{margin:8px!important}div.tsml-ui .m-3{margin:16px!important}div.tsml-ui .m-4{margin:24px!important}div.tsml-ui .m-5{margin:48px!important}div.tsml-ui .m-auto{margin:auto!important}div.tsml-ui .mx-0{margin-left:0!important;margin-right:0!important}div.tsml-ui .mx-1{margin-left:4px!important;margin-right:4px!important}div.tsml-ui .mx-2{margin-left:8px!important;margin-right:8px!important}div.tsml-ui .mx-3{margin-left:16px!important;margin-right:16px!important}div.tsml-ui .mx-4{margin-left:24px!important;margin-right:24px!important}div.tsml-ui .mx-5{margin-left:48px!important;margin-right:48px!important}div.tsml-ui .mx-auto{margin-left:auto!important;margin-right:auto!important}div.tsml-ui .my-0{margin-bottom:0!important;margin-top:0!important}div.tsml-ui .my-1{margin-bottom:4px!important;margin-top:4px!important}div.tsml-ui .my-2{margin-bottom:8px!important;margin-top:8px!important}div.tsml-ui .my-3{margin-bottom:16px!important;margin-top:16px!important}div.tsml-ui .my-4{margin-bottom:24px!important;margin-top:24px!important}div.tsml-ui .my-5{margin-bottom:48px!important;margin-top:48px!important}div.tsml-ui .my-auto{margin-bottom:auto!important;margin-top:auto!important}div.tsml-ui .mt-0{margin-top:0!important}div.tsml-ui .mt-1{margin-top:4px!important}div.tsml-ui .mt-2{margin-top:8px!important}div.tsml-ui .mt-3{margin-top:16px!important}div.tsml-ui .mt-4{margin-top:24px!important}div.tsml-ui .mt-5{margin-top:48px!important}div.tsml-ui .mt-auto{margin-top:auto!important}div.tsml-ui .me-0{margin-right:0!important}div.tsml-ui .me-1{margin-right:4px!important}div.tsml-ui .me-2{margin-right:8px!important}div.tsml-ui .me-3{margin-right:16px!important}div.tsml-ui .me-4{margin-right:24px!important}div.tsml-ui .me-5{margin-right:48px!important}div.tsml-ui .me-auto{margin-right:auto!important}div.tsml-ui .mb-0{margin-bottom:0!important}div.tsml-ui .mb-1{margin-bottom:4px!important}div.tsml-ui .mb-2{margin-bottom:8px!important}div.tsml-ui .mb-3{margin-bottom:16px!important}div.tsml-ui .mb-4{margin-bottom:24px!important}div.tsml-ui .mb-5{margin-bottom:48px!important}div.tsml-ui .mb-auto{margin-bottom:auto!important}div.tsml-ui .ms-0{margin-left:0!important}div.tsml-ui .ms-1{margin-left:4px!important}div.tsml-ui .ms-2{margin-left:8px!important}div.tsml-ui .ms-3{margin-left:16px!important}div.tsml-ui .ms-4{margin-left:24px!important}div.tsml-ui .ms-5{margin-left:48px!important}div.tsml-ui .ms-auto{margin-left:auto!important}div.tsml-ui .p-0{padding:0!important}div.tsml-ui .p-1{padding:4px!important}div.tsml-ui .p-2{padding:8px!important}div.tsml-ui .p-3{padding:16px!important}div.tsml-ui .p-4{padding:24px!important}div.tsml-ui .p-5{padding:48px!important}div.tsml-ui .px-0{padding-left:0!important;padding-right:0!important}div.tsml-ui .px-1{padding-left:4px!important;padding-right:4px!important}div.tsml-ui .px-2{padding-left:8px!important;padding-right:8px!important}div.tsml-ui .px-3{padding-left:16px!important;padding-right:16px!important}div.tsml-ui .px-4{padding-left:24px!important;padding-right:24px!important}div.tsml-ui .px-5{padding-left:48px!important;padding-right:48px!important}div.tsml-ui .py-0{padding-bottom:0!important;padding-top:0!important}div.tsml-ui .py-1{padding-bottom:4px!important;padding-top:4px!important}div.tsml-ui .py-2{padding-bottom:8px!important;padding-top:8px!important}div.tsml-ui .py-3{padding-bottom:16px!important;padding-top:16px!important}div.tsml-ui .py-4{padding-bottom:24px!important;padding-top:24px!important}div.tsml-ui .py-5{padding-bottom:48px!important;padding-top:48px!important}div.tsml-ui .pt-0{padding-top:0!important}div.tsml-ui .pt-1{padding-top:4px!important}div.tsml-ui .pt-2{padding-top:8px!important}div.tsml-ui .pt-3{padding-top:16px!important}div.tsml-ui .pt-4{padding-top:24px!important}div.tsml-ui .pt-5{padding-top:48px!important}div.tsml-ui .pe-0{padding-right:0!important}div.tsml-ui .pe-1{padding-right:4px!important}div.tsml-ui .pe-2{padding-right:8px!important}div.tsml-ui .pe-3{padding-right:16px!important}div.tsml-ui .pe-4{padding-right:24px!important}div.tsml-ui .pe-5{padding-right:48px!important}div.tsml-ui .pb-0{padding-bottom:0!important}div.tsml-ui .pb-1{padding-bottom:4px!important}div.tsml-ui .pb-2{padding-bottom:8px!important}div.tsml-ui .pb-3{padding-bottom:16px!important}div.tsml-ui .pb-4{padding-bottom:24px!important}div.tsml-ui .pb-5{padding-bottom:48px!important}div.tsml-ui .ps-0{padding-left:0!important}div.tsml-ui .ps-1{padding-left:4px!important}div.tsml-ui .ps-2{padding-left:8px!important}div.tsml-ui .ps-3{padding-left:16px!important}div.tsml-ui .ps-4{padding-left:24px!important}div.tsml-ui .ps-5{padding-left:48px!important}div.tsml-ui .font-monospace{font-family:var(--bs-font-monospace)!important}div.tsml-ui .fs-1{font-size:calc(22px + 1.5vw)!important}div.tsml-ui .fs-2{font-size:calc(21.2px + .9vw)!important}div.tsml-ui .fs-3{font-size:calc(20.8px + .6vw)!important}div.tsml-ui .fs-4{font-size:calc(20.4px + .3vw)!important}div.tsml-ui .fs-5{font-size:20px!important}div.tsml-ui .fs-6{font-size:16px!important}div.tsml-ui .fst-italic{font-style:italic!important}div.tsml-ui .fst-normal{font-style:normal!important}div.tsml-ui .fw-light{font-weight:300!important}div.tsml-ui .fw-lighter{font-weight:lighter!important}div.tsml-ui .fw-normal{font-weight:400!important}div.tsml-ui .fw-bold{font-weight:700!important}div.tsml-ui .fw-bolder{font-weight:bolder!important}div.tsml-ui .lh-1{line-height:1!important}div.tsml-ui .lh-sm{line-height:1.25!important}div.tsml-ui .lh-base{line-height:1.5!important}div.tsml-ui .lh-lg{line-height:2!important}div.tsml-ui .text-start{text-align:left!important}div.tsml-ui .text-end{text-align:right!important}div.tsml-ui .text-center{text-align:center!important}div.tsml-ui .text-decoration-none{text-decoration:none!important}div.tsml-ui .text-decoration-underline{text-decoration:underline!important}div.tsml-ui .text-decoration-line-through{text-decoration:line-through!important}div.tsml-ui .text-lowercase{text-transform:lowercase!important}div.tsml-ui .text-uppercase{text-transform:uppercase!important}div.tsml-ui .text-capitalize{text-transform:capitalize!important}div.tsml-ui .text-wrap{white-space:normal!important}div.tsml-ui .text-nowrap{white-space:nowrap!important}div.tsml-ui .text-break{word-wrap:break-word!important;word-break:break-word!important}div.tsml-ui .text-primary{--bs-text-opacity:1;color:rgba(var(--bs-primary-rgb),var(--bs-text-opacity))!important}div.tsml-ui .text-secondary{--bs-text-opacity:1;color:rgba(var(--bs-secondary-rgb),var(--bs-text-opacity))!important}div.tsml-ui .text-success{--bs-text-opacity:1;color:rgba(var(--bs-success-rgb),var(--bs-text-opacity))!important}div.tsml-ui .text-info{--bs-text-opacity:1;color:rgba(var(--bs-info-rgb),var(--bs-text-opacity))!important}div.tsml-ui .text-warning{--bs-text-opacity:1;color:rgba(var(--bs-warning-rgb),var(--bs-text-opacity))!important}div.tsml-ui .text-danger{--bs-text-opacity:1;color:rgba(var(--bs-danger-rgb),var(--bs-text-opacity))!important}div.tsml-ui .text-light{--bs-text-opacity:1;color:rgba(var(--bs-light-rgb),var(--bs-text-opacity))!important}div.tsml-ui .text-dark{--bs-text-opacity:1;color:rgba(var(--bs-dark-rgb),var(--bs-text-opacity))!important}div.tsml-ui .text-black{--bs-text-opacity:1;color:rgba(var(--bs-black-rgb),var(--bs-text-opacity))!important}div.tsml-ui .text-white{--bs-text-opacity:1;color:rgba(var(--bs-white-rgb),var(--bs-text-opacity))!important}div.tsml-ui .text-body{--bs-text-opacity:1;color:rgba(var(--bs-body-color-rgb),var(--bs-text-opacity))!important}div.tsml-ui .text-muted{--bs-text-opacity:1;color:#6c757d!important}div.tsml-ui .text-black-50{--bs-text-opacity:1;color:rgba(0,0,0,.5)!important}div.tsml-ui .text-white-50{--bs-text-opacity:1;color:hsla(0,0%,100%,.5)!important}div.tsml-ui .text-reset{--bs-text-opacity:1;color:inherit!important}div.tsml-ui .text-opacity-25{--bs-text-opacity:0.25}div.tsml-ui .text-opacity-50{--bs-text-opacity:0.5}div.tsml-ui .text-opacity-75{--bs-text-opacity:0.75}div.tsml-ui .text-opacity-100{--bs-text-opacity:1}div.tsml-ui .bg-primary{--bs-bg-opacity:1;background-color:rgba(var(--bs-primary-rgb),var(--bs-bg-opacity))!important}div.tsml-ui .bg-secondary{--bs-bg-opacity:1;background-color:rgba(var(--bs-secondary-rgb),var(--bs-bg-opacity))!important}div.tsml-ui .bg-success{--bs-bg-opacity:1;background-color:rgba(var(--bs-success-rgb),var(--bs-bg-opacity))!important}div.tsml-ui .bg-info{--bs-bg-opacity:1;background-color:rgba(var(--bs-info-rgb),var(--bs-bg-opacity))!important}div.tsml-ui .bg-warning{--bs-bg-opacity:1;background-color:rgba(var(--bs-warning-rgb),var(--bs-bg-opacity))!important}div.tsml-ui .bg-danger{--bs-bg-opacity:1;background-color:rgba(var(--bs-danger-rgb),var(--bs-bg-opacity))!important}div.tsml-ui .bg-light{--bs-bg-opacity:1;background-color:rgba(var(--bs-light-rgb),var(--bs-bg-opacity))!important}div.tsml-ui .bg-dark{--bs-bg-opacity:1;background-color:rgba(var(--bs-dark-rgb),var(--bs-bg-opacity))!important}div.tsml-ui .bg-black{--bs-bg-opacity:1;background-color:rgba(var(--bs-black-rgb),var(--bs-bg-opacity))!important}div.tsml-ui .bg-white{--bs-bg-opacity:1;background-color:rgba(var(--bs-white-rgb),var(--bs-bg-opacity))!important}div.tsml-ui .bg-body{--bs-bg-opacity:1;background-color:rgba(var(--bs-body-bg-rgb),var(--bs-bg-opacity))!important}div.tsml-ui .bg-transparent{--bs-bg-opacity:1;background-color:transparent!important}div.tsml-ui .bg-opacity-10{--bs-bg-opacity:0.1}div.tsml-ui .bg-opacity-25{--bs-bg-opacity:0.25}div.tsml-ui .bg-opacity-50{--bs-bg-opacity:0.5}div.tsml-ui .bg-opacity-75{--bs-bg-opacity:0.75}div.tsml-ui .bg-opacity-100{--bs-bg-opacity:1}div.tsml-ui .bg-gradient{background-image:var(--bs-gradient)!important}div.tsml-ui .user-select-all{-webkit-user-select:all!important;-moz-user-select:all!important;user-select:all!important}div.tsml-ui .user-select-auto{-webkit-user-select:auto!important;-moz-user-select:auto!important;-ms-user-select:auto!important;user-select:auto!important}div.tsml-ui .user-select-none{-webkit-user-select:none!important;-moz-user-select:none!important;-ms-user-select:none!important;user-select:none!important}div.tsml-ui .pe-none{pointer-events:none!important}div.tsml-ui .pe-auto{pointer-events:auto!important}div.tsml-ui .rounded{border-radius:.25rem!important}div.tsml-ui .rounded-0{border-radius:0!important}div.tsml-ui .rounded-1{border-radius:.2rem!important}div.tsml-ui .rounded-2{border-radius:.25rem!important}div.tsml-ui .rounded-3{border-radius:.3rem!important}div.tsml-ui .rounded-circle{border-radius:50%!important}div.tsml-ui .rounded-pill{border-radius:50rem!important}div.tsml-ui .rounded-top{border-top-left-radius:.25rem!important;border-top-right-radius:.25rem!important}div.tsml-ui .rounded-end{border-bottom-right-radius:.25rem!important;border-top-right-radius:.25rem!important}div.tsml-ui .rounded-bottom{border-bottom-left-radius:.25rem!important;border-bottom-right-radius:.25rem!important}div.tsml-ui .rounded-start{border-bottom-left-radius:.25rem!important;border-top-left-radius:.25rem!important}div.tsml-ui .visible{visibility:visible!important}div.tsml-ui .invisible{visibility:hidden!important}@media (min-width:576px){div.tsml-ui .float-sm-start{float:left!important}div.tsml-ui .float-sm-end{float:right!important}div.tsml-ui .float-sm-none{float:none!important}div.tsml-ui .d-sm-inline{display:inline!important}div.tsml-ui .d-sm-inline-block{display:inline-block!important}div.tsml-ui .d-sm-block{display:block!important}div.tsml-ui .d-sm-grid{display:grid!important}div.tsml-ui .d-sm-table{display:table!important}div.tsml-ui .d-sm-table-row{display:table-row!important}div.tsml-ui .d-sm-table-cell{display:table-cell!important}div.tsml-ui .d-sm-flex{display:flex!important}div.tsml-ui .d-sm-inline-flex{display:inline-flex!important}div.tsml-ui .d-sm-none{display:none!important}div.tsml-ui .flex-sm-fill{flex:1 1 auto!important}div.tsml-ui .flex-sm-row{flex-direction:row!important}div.tsml-ui .flex-sm-column{flex-direction:column!important}div.tsml-ui .flex-sm-row-reverse{flex-direction:row-reverse!important}div.tsml-ui .flex-sm-column-reverse{flex-direction:column-reverse!important}div.tsml-ui .flex-sm-grow-0{flex-grow:0!important}div.tsml-ui .flex-sm-grow-1{flex-grow:1!important}div.tsml-ui .flex-sm-shrink-0{flex-shrink:0!important}div.tsml-ui .flex-sm-shrink-1{flex-shrink:1!important}div.tsml-ui .flex-sm-wrap{flex-wrap:wrap!important}div.tsml-ui .flex-sm-nowrap{flex-wrap:nowrap!important}div.tsml-ui .flex-sm-wrap-reverse{flex-wrap:wrap-reverse!important}div.tsml-ui .gap-sm-0{gap:0!important}div.tsml-ui .gap-sm-1{gap:4px!important}div.tsml-ui .gap-sm-2{gap:8px!important}div.tsml-ui .gap-sm-3{gap:16px!important}div.tsml-ui .gap-sm-4{gap:24px!important}div.tsml-ui .gap-sm-5{gap:48px!important}div.tsml-ui .justify-content-sm-start{justify-content:flex-start!important}div.tsml-ui .justify-content-sm-end{justify-content:flex-end!important}div.tsml-ui .justify-content-sm-center{justify-content:center!important}div.tsml-ui .justify-content-sm-between{justify-content:space-between!important}div.tsml-ui .justify-content-sm-around{justify-content:space-around!important}div.tsml-ui .justify-content-sm-evenly{justify-content:space-evenly!important}div.tsml-ui .align-items-sm-start{align-items:flex-start!important}div.tsml-ui .align-items-sm-end{align-items:flex-end!important}div.tsml-ui .align-items-sm-center{align-items:center!important}div.tsml-ui .align-items-sm-baseline{align-items:baseline!important}div.tsml-ui .align-items-sm-stretch{align-items:stretch!important}div.tsml-ui .align-content-sm-start{align-content:flex-start!important}div.tsml-ui .align-content-sm-end{align-content:flex-end!important}div.tsml-ui .align-content-sm-center{align-content:center!important}div.tsml-ui .align-content-sm-between{align-content:space-between!important}div.tsml-ui .align-content-sm-around{align-content:space-around!important}div.tsml-ui .align-content-sm-stretch{align-content:stretch!important}div.tsml-ui .align-self-sm-auto{align-self:auto!important}div.tsml-ui .align-self-sm-start{align-self:flex-start!important}div.tsml-ui .align-self-sm-end{align-self:flex-end!important}div.tsml-ui .align-self-sm-center{align-self:center!important}div.tsml-ui .align-self-sm-baseline{align-self:baseline!important}div.tsml-ui .align-self-sm-stretch{align-self:stretch!important}div.tsml-ui .order-sm-first{order:-1!important}div.tsml-ui .order-sm-0{order:0!important}div.tsml-ui .order-sm-1{order:1!important}div.tsml-ui .order-sm-2{order:2!important}div.tsml-ui .order-sm-3{order:3!important}div.tsml-ui .order-sm-4{order:4!important}div.tsml-ui .order-sm-5{order:5!important}div.tsml-ui .order-sm-last{order:6!important}div.tsml-ui .m-sm-0{margin:0!important}div.tsml-ui .m-sm-1{margin:4px!important}div.tsml-ui .m-sm-2{margin:8px!important}div.tsml-ui .m-sm-3{margin:16px!important}div.tsml-ui .m-sm-4{margin:24px!important}div.tsml-ui .m-sm-5{margin:48px!important}div.tsml-ui .m-sm-auto{margin:auto!important}div.tsml-ui .mx-sm-0{margin-left:0!important;margin-right:0!important}div.tsml-ui .mx-sm-1{margin-left:4px!important;margin-right:4px!important}div.tsml-ui .mx-sm-2{margin-left:8px!important;margin-right:8px!important}div.tsml-ui .mx-sm-3{margin-left:16px!important;margin-right:16px!important}div.tsml-ui .mx-sm-4{margin-left:24px!important;margin-right:24px!important}div.tsml-ui .mx-sm-5{margin-left:48px!important;margin-right:48px!important}div.tsml-ui .mx-sm-auto{margin-left:auto!important;margin-right:auto!important}div.tsml-ui .my-sm-0{margin-bottom:0!important;margin-top:0!important}div.tsml-ui .my-sm-1{margin-bottom:4px!important;margin-top:4px!important}div.tsml-ui .my-sm-2{margin-bottom:8px!important;margin-top:8px!important}div.tsml-ui .my-sm-3{margin-bottom:16px!important;margin-top:16px!important}div.tsml-ui .my-sm-4{margin-bottom:24px!important;margin-top:24px!important}div.tsml-ui .my-sm-5{margin-bottom:48px!important;margin-top:48px!important}div.tsml-ui .my-sm-auto{margin-bottom:auto!important;margin-top:auto!important}div.tsml-ui .mt-sm-0{margin-top:0!important}div.tsml-ui .mt-sm-1{margin-top:4px!important}div.tsml-ui .mt-sm-2{margin-top:8px!important}div.tsml-ui .mt-sm-3{margin-top:16px!important}div.tsml-ui .mt-sm-4{margin-top:24px!important}div.tsml-ui .mt-sm-5{margin-top:48px!important}div.tsml-ui .mt-sm-auto{margin-top:auto!important}div.tsml-ui .me-sm-0{margin-right:0!important}div.tsml-ui .me-sm-1{margin-right:4px!important}div.tsml-ui .me-sm-2{margin-right:8px!important}div.tsml-ui .me-sm-3{margin-right:16px!important}div.tsml-ui .me-sm-4{margin-right:24px!important}div.tsml-ui .me-sm-5{margin-right:48px!important}div.tsml-ui .me-sm-auto{margin-right:auto!important}div.tsml-ui .mb-sm-0{margin-bottom:0!important}div.tsml-ui .mb-sm-1{margin-bottom:4px!important}div.tsml-ui .mb-sm-2{margin-bottom:8px!important}div.tsml-ui .mb-sm-3{margin-bottom:16px!important}div.tsml-ui .mb-sm-4{margin-bottom:24px!important}div.tsml-ui .mb-sm-5{margin-bottom:48px!important}div.tsml-ui .mb-sm-auto{margin-bottom:auto!important}div.tsml-ui .ms-sm-0{margin-left:0!important}div.tsml-ui .ms-sm-1{margin-left:4px!important}div.tsml-ui .ms-sm-2{margin-left:8px!important}div.tsml-ui .ms-sm-3{margin-left:16px!important}div.tsml-ui .ms-sm-4{margin-left:24px!important}div.tsml-ui .ms-sm-5{margin-left:48px!important}div.tsml-ui .ms-sm-auto{margin-left:auto!important}div.tsml-ui .p-sm-0{padding:0!important}div.tsml-ui .p-sm-1{padding:4px!important}div.tsml-ui .p-sm-2{padding:8px!important}div.tsml-ui .p-sm-3{padding:16px!important}div.tsml-ui .p-sm-4{padding:24px!important}div.tsml-ui .p-sm-5{padding:48px!important}div.tsml-ui .px-sm-0{padding-left:0!important;padding-right:0!important}div.tsml-ui .px-sm-1{padding-left:4px!important;padding-right:4px!important}div.tsml-ui .px-sm-2{padding-left:8px!important;padding-right:8px!important}div.tsml-ui .px-sm-3{padding-left:16px!important;padding-right:16px!important}div.tsml-ui .px-sm-4{padding-left:24px!important;padding-right:24px!important}div.tsml-ui .px-sm-5{padding-left:48px!important;padding-right:48px!important}div.tsml-ui .py-sm-0{padding-bottom:0!important;padding-top:0!important}div.tsml-ui .py-sm-1{padding-bottom:4px!important;padding-top:4px!important}div.tsml-ui .py-sm-2{padding-bottom:8px!important;padding-top:8px!important}div.tsml-ui .py-sm-3{padding-bottom:16px!important;padding-top:16px!important}div.tsml-ui .py-sm-4{padding-bottom:24px!important;padding-top:24px!important}div.tsml-ui .py-sm-5{padding-bottom:48px!important;padding-top:48px!important}div.tsml-ui .pt-sm-0{padding-top:0!important}div.tsml-ui .pt-sm-1{padding-top:4px!important}div.tsml-ui .pt-sm-2{padding-top:8px!important}div.tsml-ui .pt-sm-3{padding-top:16px!important}div.tsml-ui .pt-sm-4{padding-top:24px!important}div.tsml-ui .pt-sm-5{padding-top:48px!important}div.tsml-ui .pe-sm-0{padding-right:0!important}div.tsml-ui .pe-sm-1{padding-right:4px!important}div.tsml-ui .pe-sm-2{padding-right:8px!important}div.tsml-ui .pe-sm-3{padding-right:16px!important}div.tsml-ui .pe-sm-4{padding-right:24px!important}div.tsml-ui .pe-sm-5{padding-right:48px!important}div.tsml-ui .pb-sm-0{padding-bottom:0!important}div.tsml-ui .pb-sm-1{padding-bottom:4px!important}div.tsml-ui .pb-sm-2{padding-bottom:8px!important}div.tsml-ui .pb-sm-3{padding-bottom:16px!important}div.tsml-ui .pb-sm-4{padding-bottom:24px!important}div.tsml-ui .pb-sm-5{padding-bottom:48px!important}div.tsml-ui .ps-sm-0{padding-left:0!important}div.tsml-ui .ps-sm-1{padding-left:4px!important}div.tsml-ui .ps-sm-2{padding-left:8px!important}div.tsml-ui .ps-sm-3{padding-left:16px!important}div.tsml-ui .ps-sm-4{padding-left:24px!important}div.tsml-ui .ps-sm-5{padding-left:48px!important}div.tsml-ui .text-sm-start{text-align:left!important}div.tsml-ui .text-sm-end{text-align:right!important}div.tsml-ui .text-sm-center{text-align:center!important}}@media (min-width:768px){div.tsml-ui .float-md-start{float:left!important}div.tsml-ui .float-md-end{float:right!important}div.tsml-ui .float-md-none{float:none!important}div.tsml-ui .d-md-inline{display:inline!important}div.tsml-ui .d-md-inline-block{display:inline-block!important}div.tsml-ui .d-md-block{display:block!important}div.tsml-ui .d-md-grid{display:grid!important}div.tsml-ui .d-md-table{display:table!important}div.tsml-ui .d-md-table-row{display:table-row!important}div.tsml-ui .d-md-table-cell{display:table-cell!important}div.tsml-ui .d-md-flex{display:flex!important}div.tsml-ui .d-md-inline-flex{display:inline-flex!important}div.tsml-ui .d-md-none{display:none!important}div.tsml-ui .flex-md-fill{flex:1 1 auto!important}div.tsml-ui .flex-md-row{flex-direction:row!important}div.tsml-ui .flex-md-column{flex-direction:column!important}div.tsml-ui .flex-md-row-reverse{flex-direction:row-reverse!important}div.tsml-ui .flex-md-column-reverse{flex-direction:column-reverse!important}div.tsml-ui .flex-md-grow-0{flex-grow:0!important}div.tsml-ui .flex-md-grow-1{flex-grow:1!important}div.tsml-ui .flex-md-shrink-0{flex-shrink:0!important}div.tsml-ui .flex-md-shrink-1{flex-shrink:1!important}div.tsml-ui .flex-md-wrap{flex-wrap:wrap!important}div.tsml-ui .flex-md-nowrap{flex-wrap:nowrap!important}div.tsml-ui .flex-md-wrap-reverse{flex-wrap:wrap-reverse!important}div.tsml-ui .gap-md-0{gap:0!important}div.tsml-ui .gap-md-1{gap:4px!important}div.tsml-ui .gap-md-2{gap:8px!important}div.tsml-ui .gap-md-3{gap:16px!important}div.tsml-ui .gap-md-4{gap:24px!important}div.tsml-ui .gap-md-5{gap:48px!important}div.tsml-ui .justify-content-md-start{justify-content:flex-start!important}div.tsml-ui .justify-content-md-end{justify-content:flex-end!important}div.tsml-ui .justify-content-md-center{justify-content:center!important}div.tsml-ui .justify-content-md-between{justify-content:space-between!important}div.tsml-ui .justify-content-md-around{justify-content:space-around!important}div.tsml-ui .justify-content-md-evenly{justify-content:space-evenly!important}div.tsml-ui .align-items-md-start{align-items:flex-start!important}div.tsml-ui .align-items-md-end{align-items:flex-end!important}div.tsml-ui .align-items-md-center{align-items:center!important}div.tsml-ui .align-items-md-baseline{align-items:baseline!important}div.tsml-ui .align-items-md-stretch{align-items:stretch!important}div.tsml-ui .align-content-md-start{align-content:flex-start!important}div.tsml-ui .align-content-md-end{align-content:flex-end!important}div.tsml-ui .align-content-md-center{align-content:center!important}div.tsml-ui .align-content-md-between{align-content:space-between!important}div.tsml-ui .align-content-md-around{align-content:space-around!important}div.tsml-ui .align-content-md-stretch{align-content:stretch!important}div.tsml-ui .align-self-md-auto{align-self:auto!important}div.tsml-ui .align-self-md-start{align-self:flex-start!important}div.tsml-ui .align-self-md-end{align-self:flex-end!important}div.tsml-ui .align-self-md-center{align-self:center!important}div.tsml-ui .align-self-md-baseline{align-self:baseline!important}div.tsml-ui .align-self-md-stretch{align-self:stretch!important}div.tsml-ui .order-md-first{order:-1!important}div.tsml-ui .order-md-0{order:0!important}div.tsml-ui .order-md-1{order:1!important}div.tsml-ui .order-md-2{order:2!important}div.tsml-ui .order-md-3{order:3!important}div.tsml-ui .order-md-4{order:4!important}div.tsml-ui .order-md-5{order:5!important}div.tsml-ui .order-md-last{order:6!important}div.tsml-ui .m-md-0{margin:0!important}div.tsml-ui .m-md-1{margin:4px!important}div.tsml-ui .m-md-2{margin:8px!important}div.tsml-ui .m-md-3{margin:16px!important}div.tsml-ui .m-md-4{margin:24px!important}div.tsml-ui .m-md-5{margin:48px!important}div.tsml-ui .m-md-auto{margin:auto!important}div.tsml-ui .mx-md-0{margin-left:0!important;margin-right:0!important}div.tsml-ui .mx-md-1{margin-left:4px!important;margin-right:4px!important}div.tsml-ui .mx-md-2{margin-left:8px!important;margin-right:8px!important}div.tsml-ui .mx-md-3{margin-left:16px!important;margin-right:16px!important}div.tsml-ui .mx-md-4{margin-left:24px!important;margin-right:24px!important}div.tsml-ui .mx-md-5{margin-left:48px!important;margin-right:48px!important}div.tsml-ui .mx-md-auto{margin-left:auto!important;margin-right:auto!important}div.tsml-ui .my-md-0{margin-bottom:0!important;margin-top:0!important}div.tsml-ui .my-md-1{margin-bottom:4px!important;margin-top:4px!important}div.tsml-ui .my-md-2{margin-bottom:8px!important;margin-top:8px!important}div.tsml-ui .my-md-3{margin-bottom:16px!important;margin-top:16px!important}div.tsml-ui .my-md-4{margin-bottom:24px!important;margin-top:24px!important}div.tsml-ui .my-md-5{margin-bottom:48px!important;margin-top:48px!important}div.tsml-ui .my-md-auto{margin-bottom:auto!important;margin-top:auto!important}div.tsml-ui .mt-md-0{margin-top:0!important}div.tsml-ui .mt-md-1{margin-top:4px!important}div.tsml-ui .mt-md-2{margin-top:8px!important}div.tsml-ui .mt-md-3{margin-top:16px!important}div.tsml-ui .mt-md-4{margin-top:24px!important}div.tsml-ui .mt-md-5{margin-top:48px!important}div.tsml-ui .mt-md-auto{margin-top:auto!important}div.tsml-ui .me-md-0{margin-right:0!important}div.tsml-ui .me-md-1{margin-right:4px!important}div.tsml-ui .me-md-2{margin-right:8px!important}div.tsml-ui .me-md-3{margin-right:16px!important}div.tsml-ui .me-md-4{margin-right:24px!important}div.tsml-ui .me-md-5{margin-right:48px!important}div.tsml-ui .me-md-auto{margin-right:auto!important}div.tsml-ui .mb-md-0{margin-bottom:0!important}div.tsml-ui .mb-md-1{margin-bottom:4px!important}div.tsml-ui .mb-md-2{margin-bottom:8px!important}div.tsml-ui .mb-md-3{margin-bottom:16px!important}div.tsml-ui .mb-md-4{margin-bottom:24px!important}div.tsml-ui .mb-md-5{margin-bottom:48px!important}div.tsml-ui .mb-md-auto{margin-bottom:auto!important}div.tsml-ui .ms-md-0{margin-left:0!important}div.tsml-ui .ms-md-1{margin-left:4px!important}div.tsml-ui .ms-md-2{margin-left:8px!important}div.tsml-ui .ms-md-3{margin-left:16px!important}div.tsml-ui .ms-md-4{margin-left:24px!important}div.tsml-ui .ms-md-5{margin-left:48px!important}div.tsml-ui .ms-md-auto{margin-left:auto!important}div.tsml-ui .p-md-0{padding:0!important}div.tsml-ui .p-md-1{padding:4px!important}div.tsml-ui .p-md-2{padding:8px!important}div.tsml-ui .p-md-3{padding:16px!important}div.tsml-ui .p-md-4{padding:24px!important}div.tsml-ui .p-md-5{padding:48px!important}div.tsml-ui .px-md-0{padding-left:0!important;padding-right:0!important}div.tsml-ui .px-md-1{padding-left:4px!important;padding-right:4px!important}div.tsml-ui .px-md-2{padding-left:8px!important;padding-right:8px!important}div.tsml-ui .px-md-3{padding-left:16px!important;padding-right:16px!important}div.tsml-ui .px-md-4{padding-left:24px!important;padding-right:24px!important}div.tsml-ui .px-md-5{padding-left:48px!important;padding-right:48px!important}div.tsml-ui .py-md-0{padding-bottom:0!important;padding-top:0!important}div.tsml-ui .py-md-1{padding-bottom:4px!important;padding-top:4px!important}div.tsml-ui .py-md-2{padding-bottom:8px!important;padding-top:8px!important}div.tsml-ui .py-md-3{padding-bottom:16px!important;padding-top:16px!important}div.tsml-ui .py-md-4{padding-bottom:24px!important;padding-top:24px!important}div.tsml-ui .py-md-5{padding-bottom:48px!important;padding-top:48px!important}div.tsml-ui .pt-md-0{padding-top:0!important}div.tsml-ui .pt-md-1{padding-top:4px!important}div.tsml-ui .pt-md-2{padding-top:8px!important}div.tsml-ui .pt-md-3{padding-top:16px!important}div.tsml-ui .pt-md-4{padding-top:24px!important}div.tsml-ui .pt-md-5{padding-top:48px!important}div.tsml-ui .pe-md-0{padding-right:0!important}div.tsml-ui .pe-md-1{padding-right:4px!important}div.tsml-ui .pe-md-2{padding-right:8px!important}div.tsml-ui .pe-md-3{padding-right:16px!important}div.tsml-ui .pe-md-4{padding-right:24px!important}div.tsml-ui .pe-md-5{padding-right:48px!important}div.tsml-ui .pb-md-0{padding-bottom:0!important}div.tsml-ui .pb-md-1{padding-bottom:4px!important}div.tsml-ui .pb-md-2{padding-bottom:8px!important}div.tsml-ui .pb-md-3{padding-bottom:16px!important}div.tsml-ui .pb-md-4{padding-bottom:24px!important}div.tsml-ui .pb-md-5{padding-bottom:48px!important}div.tsml-ui .ps-md-0{padding-left:0!important}div.tsml-ui .ps-md-1{padding-left:4px!important}div.tsml-ui .ps-md-2{padding-left:8px!important}div.tsml-ui .ps-md-3{padding-left:16px!important}div.tsml-ui .ps-md-4{padding-left:24px!important}div.tsml-ui .ps-md-5{padding-left:48px!important}div.tsml-ui .text-md-start{text-align:left!important}div.tsml-ui .text-md-end{text-align:right!important}div.tsml-ui .text-md-center{text-align:center!important}}@media (min-width:992px){div.tsml-ui .float-lg-start{float:left!important}div.tsml-ui .float-lg-end{float:right!important}div.tsml-ui .float-lg-none{float:none!important}div.tsml-ui .d-lg-inline{display:inline!important}div.tsml-ui .d-lg-inline-block{display:inline-block!important}div.tsml-ui .d-lg-block{display:block!important}div.tsml-ui .d-lg-grid{display:grid!important}div.tsml-ui .d-lg-table{display:table!important}div.tsml-ui .d-lg-table-row{display:table-row!important}div.tsml-ui .d-lg-table-cell{display:table-cell!important}div.tsml-ui .d-lg-flex{display:flex!important}div.tsml-ui .d-lg-inline-flex{display:inline-flex!important}div.tsml-ui .d-lg-none{display:none!important}div.tsml-ui .flex-lg-fill{flex:1 1 auto!important}div.tsml-ui .flex-lg-row{flex-direction:row!important}div.tsml-ui .flex-lg-column{flex-direction:column!important}div.tsml-ui .flex-lg-row-reverse{flex-direction:row-reverse!important}div.tsml-ui .flex-lg-column-reverse{flex-direction:column-reverse!important}div.tsml-ui .flex-lg-grow-0{flex-grow:0!important}div.tsml-ui .flex-lg-grow-1{flex-grow:1!important}div.tsml-ui .flex-lg-shrink-0{flex-shrink:0!important}div.tsml-ui .flex-lg-shrink-1{flex-shrink:1!important}div.tsml-ui .flex-lg-wrap{flex-wrap:wrap!important}div.tsml-ui .flex-lg-nowrap{flex-wrap:nowrap!important}div.tsml-ui .flex-lg-wrap-reverse{flex-wrap:wrap-reverse!important}div.tsml-ui .gap-lg-0{gap:0!important}div.tsml-ui .gap-lg-1{gap:4px!important}div.tsml-ui .gap-lg-2{gap:8px!important}div.tsml-ui .gap-lg-3{gap:16px!important}div.tsml-ui .gap-lg-4{gap:24px!important}div.tsml-ui .gap-lg-5{gap:48px!important}div.tsml-ui .justify-content-lg-start{justify-content:flex-start!important}div.tsml-ui .justify-content-lg-end{justify-content:flex-end!important}div.tsml-ui .justify-content-lg-center{justify-content:center!important}div.tsml-ui .justify-content-lg-between{justify-content:space-between!important}div.tsml-ui .justify-content-lg-around{justify-content:space-around!important}div.tsml-ui .justify-content-lg-evenly{justify-content:space-evenly!important}div.tsml-ui .align-items-lg-start{align-items:flex-start!important}div.tsml-ui .align-items-lg-end{align-items:flex-end!important}div.tsml-ui .align-items-lg-center{align-items:center!important}div.tsml-ui .align-items-lg-baseline{align-items:baseline!important}div.tsml-ui .align-items-lg-stretch{align-items:stretch!important}div.tsml-ui .align-content-lg-start{align-content:flex-start!important}div.tsml-ui .align-content-lg-end{align-content:flex-end!important}div.tsml-ui .align-content-lg-center{align-content:center!important}div.tsml-ui .align-content-lg-between{align-content:space-between!important}div.tsml-ui .align-content-lg-around{align-content:space-around!important}div.tsml-ui .align-content-lg-stretch{align-content:stretch!important}div.tsml-ui .align-self-lg-auto{align-self:auto!important}div.tsml-ui .align-self-lg-start{align-self:flex-start!important}div.tsml-ui .align-self-lg-end{align-self:flex-end!important}div.tsml-ui .align-self-lg-center{align-self:center!important}div.tsml-ui .align-self-lg-baseline{align-self:baseline!important}div.tsml-ui .align-self-lg-stretch{align-self:stretch!important}div.tsml-ui .order-lg-first{order:-1!important}div.tsml-ui .order-lg-0{order:0!important}div.tsml-ui .order-lg-1{order:1!important}div.tsml-ui .order-lg-2{order:2!important}div.tsml-ui .order-lg-3{order:3!important}div.tsml-ui .order-lg-4{order:4!important}div.tsml-ui .order-lg-5{order:5!important}div.tsml-ui .order-lg-last{order:6!important}div.tsml-ui .m-lg-0{margin:0!important}div.tsml-ui .m-lg-1{margin:4px!important}div.tsml-ui .m-lg-2{margin:8px!important}div.tsml-ui .m-lg-3{margin:16px!important}div.tsml-ui .m-lg-4{margin:24px!important}div.tsml-ui .m-lg-5{margin:48px!important}div.tsml-ui .m-lg-auto{margin:auto!important}div.tsml-ui .mx-lg-0{margin-left:0!important;margin-right:0!important}div.tsml-ui .mx-lg-1{margin-left:4px!important;margin-right:4px!important}div.tsml-ui .mx-lg-2{margin-left:8px!important;margin-right:8px!important}div.tsml-ui .mx-lg-3{margin-left:16px!important;margin-right:16px!important}div.tsml-ui .mx-lg-4{margin-left:24px!important;margin-right:24px!important}div.tsml-ui .mx-lg-5{margin-left:48px!important;margin-right:48px!important}div.tsml-ui .mx-lg-auto{margin-left:auto!important;margin-right:auto!important}div.tsml-ui .my-lg-0{margin-bottom:0!important;margin-top:0!important}div.tsml-ui .my-lg-1{margin-bottom:4px!important;margin-top:4px!important}div.tsml-ui .my-lg-2{margin-bottom:8px!important;margin-top:8px!important}div.tsml-ui .my-lg-3{margin-bottom:16px!important;margin-top:16px!important}div.tsml-ui .my-lg-4{margin-bottom:24px!important;margin-top:24px!important}div.tsml-ui .my-lg-5{margin-bottom:48px!important;margin-top:48px!important}div.tsml-ui .my-lg-auto{margin-bottom:auto!important;margin-top:auto!important}div.tsml-ui .mt-lg-0{margin-top:0!important}div.tsml-ui .mt-lg-1{margin-top:4px!important}div.tsml-ui .mt-lg-2{margin-top:8px!important}div.tsml-ui .mt-lg-3{margin-top:16px!important}div.tsml-ui .mt-lg-4{margin-top:24px!important}div.tsml-ui .mt-lg-5{margin-top:48px!important}div.tsml-ui .mt-lg-auto{margin-top:auto!important}div.tsml-ui .me-lg-0{margin-right:0!important}div.tsml-ui .me-lg-1{margin-right:4px!important}div.tsml-ui .me-lg-2{margin-right:8px!important}div.tsml-ui .me-lg-3{margin-right:16px!important}div.tsml-ui .me-lg-4{margin-right:24px!important}div.tsml-ui .me-lg-5{margin-right:48px!important}div.tsml-ui .me-lg-auto{margin-right:auto!important}div.tsml-ui .mb-lg-0{margin-bottom:0!important}div.tsml-ui .mb-lg-1{margin-bottom:4px!important}div.tsml-ui .mb-lg-2{margin-bottom:8px!important}div.tsml-ui .mb-lg-3{margin-bottom:16px!important}div.tsml-ui .mb-lg-4{margin-bottom:24px!important}div.tsml-ui .mb-lg-5{margin-bottom:48px!important}div.tsml-ui .mb-lg-auto{margin-bottom:auto!important}div.tsml-ui .ms-lg-0{margin-left:0!important}div.tsml-ui .ms-lg-1{margin-left:4px!important}div.tsml-ui .ms-lg-2{margin-left:8px!important}div.tsml-ui .ms-lg-3{margin-left:16px!important}div.tsml-ui .ms-lg-4{margin-left:24px!important}div.tsml-ui .ms-lg-5{margin-left:48px!important}div.tsml-ui .ms-lg-auto{margin-left:auto!important}div.tsml-ui .p-lg-0{padding:0!important}div.tsml-ui .p-lg-1{padding:4px!important}div.tsml-ui .p-lg-2{padding:8px!important}div.tsml-ui .p-lg-3{padding:16px!important}div.tsml-ui .p-lg-4{padding:24px!important}div.tsml-ui .p-lg-5{padding:48px!important}div.tsml-ui .px-lg-0{padding-left:0!important;padding-right:0!important}div.tsml-ui .px-lg-1{padding-left:4px!important;padding-right:4px!important}div.tsml-ui .px-lg-2{padding-left:8px!important;padding-right:8px!important}div.tsml-ui .px-lg-3{padding-left:16px!important;padding-right:16px!important}div.tsml-ui .px-lg-4{padding-left:24px!important;padding-right:24px!important}div.tsml-ui .px-lg-5{padding-left:48px!important;padding-right:48px!important}div.tsml-ui .py-lg-0{padding-bottom:0!important;padding-top:0!important}div.tsml-ui .py-lg-1{padding-bottom:4px!important;padding-top:4px!important}div.tsml-ui .py-lg-2{padding-bottom:8px!important;padding-top:8px!important}div.tsml-ui .py-lg-3{padding-bottom:16px!important;padding-top:16px!important}div.tsml-ui .py-lg-4{padding-bottom:24px!important;padding-top:24px!important}div.tsml-ui .py-lg-5{padding-bottom:48px!important;padding-top:48px!important}div.tsml-ui .pt-lg-0{padding-top:0!important}div.tsml-ui .pt-lg-1{padding-top:4px!important}div.tsml-ui .pt-lg-2{padding-top:8px!important}div.tsml-ui .pt-lg-3{padding-top:16px!important}div.tsml-ui .pt-lg-4{padding-top:24px!important}div.tsml-ui .pt-lg-5{padding-top:48px!important}div.tsml-ui .pe-lg-0{padding-right:0!important}div.tsml-ui .pe-lg-1{padding-right:4px!important}div.tsml-ui .pe-lg-2{padding-right:8px!important}div.tsml-ui .pe-lg-3{padding-right:16px!important}div.tsml-ui .pe-lg-4{padding-right:24px!important}div.tsml-ui .pe-lg-5{padding-right:48px!important}div.tsml-ui .pb-lg-0{padding-bottom:0!important}div.tsml-ui .pb-lg-1{padding-bottom:4px!important}div.tsml-ui .pb-lg-2{padding-bottom:8px!important}div.tsml-ui .pb-lg-3{padding-bottom:16px!important}div.tsml-ui .pb-lg-4{padding-bottom:24px!important}div.tsml-ui .pb-lg-5{padding-bottom:48px!important}div.tsml-ui .ps-lg-0{padding-left:0!important}div.tsml-ui .ps-lg-1{padding-left:4px!important}div.tsml-ui .ps-lg-2{padding-left:8px!important}div.tsml-ui .ps-lg-3{padding-left:16px!important}div.tsml-ui .ps-lg-4{padding-left:24px!important}div.tsml-ui .ps-lg-5{padding-left:48px!important}div.tsml-ui .text-lg-start{text-align:left!important}div.tsml-ui .text-lg-end{text-align:right!important}div.tsml-ui .text-lg-center{text-align:center!important}}@media (min-width:1200px){div.tsml-ui .float-xl-start{float:left!important}div.tsml-ui .float-xl-end{float:right!important}div.tsml-ui .float-xl-none{float:none!important}div.tsml-ui .d-xl-inline{display:inline!important}div.tsml-ui .d-xl-inline-block{display:inline-block!important}div.tsml-ui .d-xl-block{display:block!important}div.tsml-ui .d-xl-grid{display:grid!important}div.tsml-ui .d-xl-table{display:table!important}div.tsml-ui .d-xl-table-row{display:table-row!important}div.tsml-ui .d-xl-table-cell{display:table-cell!important}div.tsml-ui .d-xl-flex{display:flex!important}div.tsml-ui .d-xl-inline-flex{display:inline-flex!important}div.tsml-ui .d-xl-none{display:none!important}div.tsml-ui .flex-xl-fill{flex:1 1 auto!important}div.tsml-ui .flex-xl-row{flex-direction:row!important}div.tsml-ui .flex-xl-column{flex-direction:column!important}div.tsml-ui .flex-xl-row-reverse{flex-direction:row-reverse!important}div.tsml-ui .flex-xl-column-reverse{flex-direction:column-reverse!important}div.tsml-ui .flex-xl-grow-0{flex-grow:0!important}div.tsml-ui .flex-xl-grow-1{flex-grow:1!important}div.tsml-ui .flex-xl-shrink-0{flex-shrink:0!important}div.tsml-ui .flex-xl-shrink-1{flex-shrink:1!important}div.tsml-ui .flex-xl-wrap{flex-wrap:wrap!important}div.tsml-ui .flex-xl-nowrap{flex-wrap:nowrap!important}div.tsml-ui .flex-xl-wrap-reverse{flex-wrap:wrap-reverse!important}div.tsml-ui .gap-xl-0{gap:0!important}div.tsml-ui .gap-xl-1{gap:4px!important}div.tsml-ui .gap-xl-2{gap:8px!important}div.tsml-ui .gap-xl-3{gap:16px!important}div.tsml-ui .gap-xl-4{gap:24px!important}div.tsml-ui .gap-xl-5{gap:48px!important}div.tsml-ui .justify-content-xl-start{justify-content:flex-start!important}div.tsml-ui .justify-content-xl-end{justify-content:flex-end!important}div.tsml-ui .justify-content-xl-center{justify-content:center!important}div.tsml-ui .justify-content-xl-between{justify-content:space-between!important}div.tsml-ui .justify-content-xl-around{justify-content:space-around!important}div.tsml-ui .justify-content-xl-evenly{justify-content:space-evenly!important}div.tsml-ui .align-items-xl-start{align-items:flex-start!important}div.tsml-ui .align-items-xl-end{align-items:flex-end!important}div.tsml-ui .align-items-xl-center{align-items:center!important}div.tsml-ui .align-items-xl-baseline{align-items:baseline!important}div.tsml-ui .align-items-xl-stretch{align-items:stretch!important}div.tsml-ui .align-content-xl-start{align-content:flex-start!important}div.tsml-ui .align-content-xl-end{align-content:flex-end!important}div.tsml-ui .align-content-xl-center{align-content:center!important}div.tsml-ui .align-content-xl-between{align-content:space-between!important}div.tsml-ui .align-content-xl-around{align-content:space-around!important}div.tsml-ui .align-content-xl-stretch{align-content:stretch!important}div.tsml-ui .align-self-xl-auto{align-self:auto!important}div.tsml-ui .align-self-xl-start{align-self:flex-start!important}div.tsml-ui .align-self-xl-end{align-self:flex-end!important}div.tsml-ui .align-self-xl-center{align-self:center!important}div.tsml-ui .align-self-xl-baseline{align-self:baseline!important}div.tsml-ui .align-self-xl-stretch{align-self:stretch!important}div.tsml-ui .order-xl-first{order:-1!important}div.tsml-ui .order-xl-0{order:0!important}div.tsml-ui .order-xl-1{order:1!important}div.tsml-ui .order-xl-2{order:2!important}div.tsml-ui .order-xl-3{order:3!important}div.tsml-ui .order-xl-4{order:4!important}div.tsml-ui .order-xl-5{order:5!important}div.tsml-ui .order-xl-last{order:6!important}div.tsml-ui .m-xl-0{margin:0!important}div.tsml-ui .m-xl-1{margin:4px!important}div.tsml-ui .m-xl-2{margin:8px!important}div.tsml-ui .m-xl-3{margin:16px!important}div.tsml-ui .m-xl-4{margin:24px!important}div.tsml-ui .m-xl-5{margin:48px!important}div.tsml-ui .m-xl-auto{margin:auto!important}div.tsml-ui .mx-xl-0{margin-left:0!important;margin-right:0!important}div.tsml-ui .mx-xl-1{margin-left:4px!important;margin-right:4px!important}div.tsml-ui .mx-xl-2{margin-left:8px!important;margin-right:8px!important}div.tsml-ui .mx-xl-3{margin-left:16px!important;margin-right:16px!important}div.tsml-ui .mx-xl-4{margin-left:24px!important;margin-right:24px!important}div.tsml-ui .mx-xl-5{margin-left:48px!important;margin-right:48px!important}div.tsml-ui .mx-xl-auto{margin-left:auto!important;margin-right:auto!important}div.tsml-ui .my-xl-0{margin-bottom:0!important;margin-top:0!important}div.tsml-ui .my-xl-1{margin-bottom:4px!important;margin-top:4px!important}div.tsml-ui .my-xl-2{margin-bottom:8px!important;margin-top:8px!important}div.tsml-ui .my-xl-3{margin-bottom:16px!important;margin-top:16px!important}div.tsml-ui .my-xl-4{margin-bottom:24px!important;margin-top:24px!important}div.tsml-ui .my-xl-5{margin-bottom:48px!important;margin-top:48px!important}div.tsml-ui .my-xl-auto{margin-bottom:auto!important;margin-top:auto!important}div.tsml-ui .mt-xl-0{margin-top:0!important}div.tsml-ui .mt-xl-1{margin-top:4px!important}div.tsml-ui .mt-xl-2{margin-top:8px!important}div.tsml-ui .mt-xl-3{margin-top:16px!important}div.tsml-ui .mt-xl-4{margin-top:24px!important}div.tsml-ui .mt-xl-5{margin-top:48px!important}div.tsml-ui .mt-xl-auto{margin-top:auto!important}div.tsml-ui .me-xl-0{margin-right:0!important}div.tsml-ui .me-xl-1{margin-right:4px!important}div.tsml-ui .me-xl-2{margin-right:8px!important}div.tsml-ui .me-xl-3{margin-right:16px!important}div.tsml-ui .me-xl-4{margin-right:24px!important}div.tsml-ui .me-xl-5{margin-right:48px!important}div.tsml-ui .me-xl-auto{margin-right:auto!important}div.tsml-ui .mb-xl-0{margin-bottom:0!important}div.tsml-ui .mb-xl-1{margin-bottom:4px!important}div.tsml-ui .mb-xl-2{margin-bottom:8px!important}div.tsml-ui .mb-xl-3{margin-bottom:16px!important}div.tsml-ui .mb-xl-4{margin-bottom:24px!important}div.tsml-ui .mb-xl-5{margin-bottom:48px!important}div.tsml-ui .mb-xl-auto{margin-bottom:auto!important}div.tsml-ui .ms-xl-0{margin-left:0!important}div.tsml-ui .ms-xl-1{margin-left:4px!important}div.tsml-ui .ms-xl-2{margin-left:8px!important}div.tsml-ui .ms-xl-3{margin-left:16px!important}div.tsml-ui .ms-xl-4{margin-left:24px!important}div.tsml-ui .ms-xl-5{margin-left:48px!important}div.tsml-ui .ms-xl-auto{margin-left:auto!important}div.tsml-ui .p-xl-0{padding:0!important}div.tsml-ui .p-xl-1{padding:4px!important}div.tsml-ui .p-xl-2{padding:8px!important}div.tsml-ui .p-xl-3{padding:16px!important}div.tsml-ui .p-xl-4{padding:24px!important}div.tsml-ui .p-xl-5{padding:48px!important}div.tsml-ui .px-xl-0{padding-left:0!important;padding-right:0!important}div.tsml-ui .px-xl-1{padding-left:4px!important;padding-right:4px!important}div.tsml-ui .px-xl-2{padding-left:8px!important;padding-right:8px!important}div.tsml-ui .px-xl-3{padding-left:16px!important;padding-right:16px!important}div.tsml-ui .px-xl-4{padding-left:24px!important;padding-right:24px!important}div.tsml-ui .px-xl-5{padding-left:48px!important;padding-right:48px!important}div.tsml-ui .py-xl-0{padding-bottom:0!important;padding-top:0!important}div.tsml-ui .py-xl-1{padding-bottom:4px!important;padding-top:4px!important}div.tsml-ui .py-xl-2{padding-bottom:8px!important;padding-top:8px!important}div.tsml-ui .py-xl-3{padding-bottom:16px!important;padding-top:16px!important}div.tsml-ui .py-xl-4{padding-bottom:24px!important;padding-top:24px!important}div.tsml-ui .py-xl-5{padding-bottom:48px!important;padding-top:48px!important}div.tsml-ui .pt-xl-0{padding-top:0!important}div.tsml-ui .pt-xl-1{padding-top:4px!important}div.tsml-ui .pt-xl-2{padding-top:8px!important}div.tsml-ui .pt-xl-3{padding-top:16px!important}div.tsml-ui .pt-xl-4{padding-top:24px!important}div.tsml-ui .pt-xl-5{padding-top:48px!important}div.tsml-ui .pe-xl-0{padding-right:0!important}div.tsml-ui .pe-xl-1{padding-right:4px!important}div.tsml-ui .pe-xl-2{padding-right:8px!important}div.tsml-ui .pe-xl-3{padding-right:16px!important}div.tsml-ui .pe-xl-4{padding-right:24px!important}div.tsml-ui .pe-xl-5{padding-right:48px!important}div.tsml-ui .pb-xl-0{padding-bottom:0!important}div.tsml-ui .pb-xl-1{padding-bottom:4px!important}div.tsml-ui .pb-xl-2{padding-bottom:8px!important}div.tsml-ui .pb-xl-3{padding-bottom:16px!important}div.tsml-ui .pb-xl-4{padding-bottom:24px!important}div.tsml-ui .pb-xl-5{padding-bottom:48px!important}div.tsml-ui .ps-xl-0{padding-left:0!important}div.tsml-ui .ps-xl-1{padding-left:4px!important}div.tsml-ui .ps-xl-2{padding-left:8px!important}div.tsml-ui .ps-xl-3{padding-left:16px!important}div.tsml-ui .ps-xl-4{padding-left:24px!important}div.tsml-ui .ps-xl-5{padding-left:48px!important}div.tsml-ui .text-xl-start{text-align:left!important}div.tsml-ui .text-xl-end{text-align:right!important}div.tsml-ui .text-xl-center{text-align:center!important}}@media (min-width:1400px){div.tsml-ui .float-xxl-start{float:left!important}div.tsml-ui .float-xxl-end{float:right!important}div.tsml-ui .float-xxl-none{float:none!important}div.tsml-ui .d-xxl-inline{display:inline!important}div.tsml-ui .d-xxl-inline-block{display:inline-block!important}div.tsml-ui .d-xxl-block{display:block!important}div.tsml-ui .d-xxl-grid{display:grid!important}div.tsml-ui .d-xxl-table{display:table!important}div.tsml-ui .d-xxl-table-row{display:table-row!important}div.tsml-ui .d-xxl-table-cell{display:table-cell!important}div.tsml-ui .d-xxl-flex{display:flex!important}div.tsml-ui .d-xxl-inline-flex{display:inline-flex!important}div.tsml-ui .d-xxl-none{display:none!important}div.tsml-ui .flex-xxl-fill{flex:1 1 auto!important}div.tsml-ui .flex-xxl-row{flex-direction:row!important}div.tsml-ui .flex-xxl-column{flex-direction:column!important}div.tsml-ui .flex-xxl-row-reverse{flex-direction:row-reverse!important}div.tsml-ui .flex-xxl-column-reverse{flex-direction:column-reverse!important}div.tsml-ui .flex-xxl-grow-0{flex-grow:0!important}div.tsml-ui .flex-xxl-grow-1{flex-grow:1!important}div.tsml-ui .flex-xxl-shrink-0{flex-shrink:0!important}div.tsml-ui .flex-xxl-shrink-1{flex-shrink:1!important}div.tsml-ui .flex-xxl-wrap{flex-wrap:wrap!important}div.tsml-ui .flex-xxl-nowrap{flex-wrap:nowrap!important}div.tsml-ui .flex-xxl-wrap-reverse{flex-wrap:wrap-reverse!important}div.tsml-ui .gap-xxl-0{gap:0!important}div.tsml-ui .gap-xxl-1{gap:4px!important}div.tsml-ui .gap-xxl-2{gap:8px!important}div.tsml-ui .gap-xxl-3{gap:16px!important}div.tsml-ui .gap-xxl-4{gap:24px!important}div.tsml-ui .gap-xxl-5{gap:48px!important}div.tsml-ui .justify-content-xxl-start{justify-content:flex-start!important}div.tsml-ui .justify-content-xxl-end{justify-content:flex-end!important}div.tsml-ui .justify-content-xxl-center{justify-content:center!important}div.tsml-ui .justify-content-xxl-between{justify-content:space-between!important}div.tsml-ui .justify-content-xxl-around{justify-content:space-around!important}div.tsml-ui .justify-content-xxl-evenly{justify-content:space-evenly!important}div.tsml-ui .align-items-xxl-start{align-items:flex-start!important}div.tsml-ui .align-items-xxl-end{align-items:flex-end!important}div.tsml-ui .align-items-xxl-center{align-items:center!important}div.tsml-ui .align-items-xxl-baseline{align-items:baseline!important}div.tsml-ui .align-items-xxl-stretch{align-items:stretch!important}div.tsml-ui .align-content-xxl-start{align-content:flex-start!important}div.tsml-ui .align-content-xxl-end{align-content:flex-end!important}div.tsml-ui .align-content-xxl-center{align-content:center!important}div.tsml-ui .align-content-xxl-between{align-content:space-between!important}div.tsml-ui .align-content-xxl-around{align-content:space-around!important}div.tsml-ui .align-content-xxl-stretch{align-content:stretch!important}div.tsml-ui .align-self-xxl-auto{align-self:auto!important}div.tsml-ui .align-self-xxl-start{align-self:flex-start!important}div.tsml-ui .align-self-xxl-end{align-self:flex-end!important}div.tsml-ui .align-self-xxl-center{align-self:center!important}div.tsml-ui .align-self-xxl-baseline{align-self:baseline!important}div.tsml-ui .align-self-xxl-stretch{align-self:stretch!important}div.tsml-ui .order-xxl-first{order:-1!important}div.tsml-ui .order-xxl-0{order:0!important}div.tsml-ui .order-xxl-1{order:1!important}div.tsml-ui .order-xxl-2{order:2!important}div.tsml-ui .order-xxl-3{order:3!important}div.tsml-ui .order-xxl-4{order:4!important}div.tsml-ui .order-xxl-5{order:5!important}div.tsml-ui .order-xxl-last{order:6!important}div.tsml-ui .m-xxl-0{margin:0!important}div.tsml-ui .m-xxl-1{margin:4px!important}div.tsml-ui .m-xxl-2{margin:8px!important}div.tsml-ui .m-xxl-3{margin:16px!important}div.tsml-ui .m-xxl-4{margin:24px!important}div.tsml-ui .m-xxl-5{margin:48px!important}div.tsml-ui .m-xxl-auto{margin:auto!important}div.tsml-ui .mx-xxl-0{margin-left:0!important;margin-right:0!important}div.tsml-ui .mx-xxl-1{margin-left:4px!important;margin-right:4px!important}div.tsml-ui .mx-xxl-2{margin-left:8px!important;margin-right:8px!important}div.tsml-ui .mx-xxl-3{margin-left:16px!important;margin-right:16px!important}div.tsml-ui .mx-xxl-4{margin-left:24px!important;margin-right:24px!important}div.tsml-ui .mx-xxl-5{margin-left:48px!important;margin-right:48px!important}div.tsml-ui .mx-xxl-auto{margin-left:auto!important;margin-right:auto!important}div.tsml-ui .my-xxl-0{margin-bottom:0!important;margin-top:0!important}div.tsml-ui .my-xxl-1{margin-bottom:4px!important;margin-top:4px!important}div.tsml-ui .my-xxl-2{margin-bottom:8px!important;margin-top:8px!important}div.tsml-ui .my-xxl-3{margin-bottom:16px!important;margin-top:16px!important}div.tsml-ui .my-xxl-4{margin-bottom:24px!important;margin-top:24px!important}div.tsml-ui .my-xxl-5{margin-bottom:48px!important;margin-top:48px!important}div.tsml-ui .my-xxl-auto{margin-bottom:auto!important;margin-top:auto!important}div.tsml-ui .mt-xxl-0{margin-top:0!important}div.tsml-ui .mt-xxl-1{margin-top:4px!important}div.tsml-ui .mt-xxl-2{margin-top:8px!important}div.tsml-ui .mt-xxl-3{margin-top:16px!important}div.tsml-ui .mt-xxl-4{margin-top:24px!important}div.tsml-ui .mt-xxl-5{margin-top:48px!important}div.tsml-ui .mt-xxl-auto{margin-top:auto!important}div.tsml-ui .me-xxl-0{margin-right:0!important}div.tsml-ui .me-xxl-1{margin-right:4px!important}div.tsml-ui .me-xxl-2{margin-right:8px!important}div.tsml-ui .me-xxl-3{margin-right:16px!important}div.tsml-ui .me-xxl-4{margin-right:24px!important}div.tsml-ui .me-xxl-5{margin-right:48px!important}div.tsml-ui .me-xxl-auto{margin-right:auto!important}div.tsml-ui .mb-xxl-0{margin-bottom:0!important}div.tsml-ui .mb-xxl-1{margin-bottom:4px!important}div.tsml-ui .mb-xxl-2{margin-bottom:8px!important}div.tsml-ui .mb-xxl-3{margin-bottom:16px!important}div.tsml-ui .mb-xxl-4{margin-bottom:24px!important}div.tsml-ui .mb-xxl-5{margin-bottom:48px!important}div.tsml-ui .mb-xxl-auto{margin-bottom:auto!important}div.tsml-ui .ms-xxl-0{margin-left:0!important}div.tsml-ui .ms-xxl-1{margin-left:4px!important}div.tsml-ui .ms-xxl-2{margin-left:8px!important}div.tsml-ui .ms-xxl-3{margin-left:16px!important}div.tsml-ui .ms-xxl-4{margin-left:24px!important}div.tsml-ui .ms-xxl-5{margin-left:48px!important}div.tsml-ui .ms-xxl-auto{margin-left:auto!important}div.tsml-ui .p-xxl-0{padding:0!important}div.tsml-ui .p-xxl-1{padding:4px!important}div.tsml-ui .p-xxl-2{padding:8px!important}div.tsml-ui .p-xxl-3{padding:16px!important}div.tsml-ui .p-xxl-4{padding:24px!important}div.tsml-ui .p-xxl-5{padding:48px!important}div.tsml-ui .px-xxl-0{padding-left:0!important;padding-right:0!important}div.tsml-ui .px-xxl-1{padding-left:4px!important;padding-right:4px!important}div.tsml-ui .px-xxl-2{padding-left:8px!important;padding-right:8px!important}div.tsml-ui .px-xxl-3{padding-left:16px!important;padding-right:16px!important}div.tsml-ui .px-xxl-4{padding-left:24px!important;padding-right:24px!important}div.tsml-ui .px-xxl-5{padding-left:48px!important;padding-right:48px!important}div.tsml-ui .py-xxl-0{padding-bottom:0!important;padding-top:0!important}div.tsml-ui .py-xxl-1{padding-bottom:4px!important;padding-top:4px!important}div.tsml-ui .py-xxl-2{padding-bottom:8px!important;padding-top:8px!important}div.tsml-ui .py-xxl-3{padding-bottom:16px!important;padding-top:16px!important}div.tsml-ui .py-xxl-4{padding-bottom:24px!important;padding-top:24px!important}div.tsml-ui .py-xxl-5{padding-bottom:48px!important;padding-top:48px!important}div.tsml-ui .pt-xxl-0{padding-top:0!important}div.tsml-ui .pt-xxl-1{padding-top:4px!important}div.tsml-ui .pt-xxl-2{padding-top:8px!important}div.tsml-ui .pt-xxl-3{padding-top:16px!important}div.tsml-ui .pt-xxl-4{padding-top:24px!important}div.tsml-ui .pt-xxl-5{padding-top:48px!important}div.tsml-ui .pe-xxl-0{padding-right:0!important}div.tsml-ui .pe-xxl-1{padding-right:4px!important}div.tsml-ui .pe-xxl-2{padding-right:8px!important}div.tsml-ui .pe-xxl-3{padding-right:16px!important}div.tsml-ui .pe-xxl-4{padding-right:24px!important}div.tsml-ui .pe-xxl-5{padding-right:48px!important}div.tsml-ui .pb-xxl-0{padding-bottom:0!important}div.tsml-ui .pb-xxl-1{padding-bottom:4px!important}div.tsml-ui .pb-xxl-2{padding-bottom:8px!important}div.tsml-ui .pb-xxl-3{padding-bottom:16px!important}div.tsml-ui .pb-xxl-4{padding-bottom:24px!important}div.tsml-ui .pb-xxl-5{padding-bottom:48px!important}div.tsml-ui .ps-xxl-0{padding-left:0!important}div.tsml-ui .ps-xxl-1{padding-left:4px!important}div.tsml-ui .ps-xxl-2{padding-left:8px!important}div.tsml-ui .ps-xxl-3{padding-left:16px!important}div.tsml-ui .ps-xxl-4{padding-left:24px!important}div.tsml-ui .ps-xxl-5{padding-left:48px!important}div.tsml-ui .text-xxl-start{text-align:left!important}div.tsml-ui .text-xxl-end{text-align:right!important}div.tsml-ui .text-xxl-center{text-align:center!important}}@media (min-width:1200px){div.tsml-ui .fs-1{font-size:40px!important}div.tsml-ui .fs-2{font-size:32px!important}div.tsml-ui .fs-3{font-size:28px!important}div.tsml-ui .fs-4{font-size:24px!important}}@media print{div.tsml-ui .d-print-inline{display:inline!important}div.tsml-ui .d-print-inline-block{display:inline-block!important}div.tsml-ui .d-print-block{display:block!important}div.tsml-ui .d-print-grid{display:grid!important}div.tsml-ui .d-print-table{display:table!important}div.tsml-ui .d-print-table-row{display:table-row!important}div.tsml-ui .d-print-table-cell{display:table-cell!important}div.tsml-ui .d-print-flex{display:flex!important}div.tsml-ui .d-print-inline-flex{display:inline-flex!important}div.tsml-ui .d-print-none{display:none!important}}div.tsml-ui .h1,div.tsml-ui .h2,div.tsml-ui .h3,div.tsml-ui .h4,div.tsml-ui .h5,div.tsml-ui .h6,div.tsml-ui h1,div.tsml-ui h2,div.tsml-ui h3,div.tsml-ui h4,div.tsml-ui h5,div.tsml-ui h6,div.tsml-ui ol,div.tsml-ui p,div.tsml-ui ul{letter-spacing:0!important;margin:0;padding:0;text-align:left;text-transform:none}div.tsml-ui button{font-weight:inherit}div.tsml-ui .mapboxgl-ctrl-attrib-inner{font-size:12px!important}div.tsml-ui .btn{cursor:inherit}div.tsml-ui .btn[href]{cursor:pointer}div.tsml-ui .mb-n1{margin-bottom:-4px!important}div.tsml-ui .online.small,div.tsml-ui a.btn.online,div.tsml-ui small.online{background-color:#cfe2ff;border-color:#cfe2ff;color:#0a58ca!important}div.tsml-ui .online[href].small,div.tsml-ui a.btn.online[href],div.tsml-ui small.online[href]{border-color:#9ec5fe}div.tsml-ui .online[href].small:hover,div.tsml-ui a.btn.online[href]:hover,div.tsml-ui small.online[href]:hover{background-color:#3d8bfd;color:#fff!important}div.tsml-ui .in-person.small,div.tsml-ui a.btn.in-person,div.tsml-ui small.in-person{background-color:#d1e7dd;border-color:#d1e7dd;color:#146c43!important}div.tsml-ui .in-person[href].small,div.tsml-ui a.btn.in-person[href],div.tsml-ui small.in-person[href]{border-color:#a3cfbb}div.tsml-ui .in-person[href].small:hover,div.tsml-ui a.btn.in-person[href]:hover,div.tsml-ui small.in-person[href]:hover{background-color:#479f76;color:#fff!important}div.tsml-ui .inactive.small,div.tsml-ui a.btn.inactive,div.tsml-ui small.inactive{background-color:#f8d7da;border-color:#f8d7da;color:#b02a37!important}div.tsml-ui .inactive[href].small,div.tsml-ui a.btn.inactive[href],div.tsml-ui small.inactive[href]{border-color:#f1aeb5}div.tsml-ui .inactive[href].small:hover,div.tsml-ui a.btn.inactive[href]:hover,div.tsml-ui small.inactive[href]:hover{background-color:#e35d6a;color:#fff!important}div.tsml-ui .bg-light{background-color:#f8f9fa!important}div.tsml-ui .bg-secondary{background-color:#6c757d!important}div.tsml-ui .text-white{color:#fff!important}div.tsml-ui .text-dark{color:#343a40!important}@media (min-width:768px){div.tsml-ui .container-fluid,div.tsml-ui .container-lg,div.tsml-ui .container-md,div.tsml-ui .container-sm,div.tsml-ui .container-xl,div.tsml-ui .container-xxl{min-height:100%}}div.tsml-ui .cursor-pointer{cursor:pointer}div.tsml-ui .list-group{overflow-x:hidden}div.tsml-ui .list-group .list-group-item+.list-group-item{border-top-width:0}div.tsml-ui .controls{flex:none}div.tsml-ui .controls input[type=search]::-webkit-search-cancel-button{-webkit-appearance:searchfield-cancel-button}div.tsml-ui .controls .dropdown .dropdown-menu{min-width:100%}div.tsml-ui .controls .dropdown .children a{padding-left:24px}div.tsml-ui .controls .dropdown .children .children a{padding-left:48px}div.tsml-ui .controls .dropdown .children .children .children a{padding-left:64px}div.tsml-ui .controls .dropdown-menu-end{right:0}div.tsml-ui .meeting .map{height:100%;max-height:1000px;overflow:hidden;position:relative}div.tsml-ui .map{min-height:500px}div.tsml-ui .map .mapboxgl-popup{max-width:85%;width:320px;z-index:100}div.tsml-ui .map .mapboxgl-popup .mapboxgl-popup-content{padding:12px;position:relative}div.tsml-ui .map .mapboxgl-popup .mapboxgl-popup-content .list-group{max-height:250px}div.tsml-ui .map .mapboxgl-popup .mapboxgl-popup-content .list-group .list-group-item{font-size:14.4px;padding:8px}div.tsml-ui .map .mapboxgl-popup .mapboxgl-popup-content .mapboxgl-popup-close-button{background:#fff;border:1px solid #dee2e6;border-radius:100%;color:#adb5bd;font-size:24px;height:30px;line-height:1;padding:0 4px 4px;position:absolute;right:-10px;top:-10px;width:30px}div.tsml-ui .map .mapboxgl-popup .mapboxgl-popup-content .mapboxgl-popup-close-button:hover{background-color:inherit;color:#343a40}div.tsml-ui table.table{border-width:0;font-size:16px!important;table-layout:auto}div.tsml-ui table.table tr{border-bottom:1px solid #dee2e6}div.tsml-ui table.table th{text-transform:none}div.tsml-ui table.table td{border:0;vertical-align:middle}div.tsml-ui table.table thead tr{border-bottom:1px solid #ced4da}div.tsml-ui table.table .distance{text-align:right}div.tsml-ui table.table td:first-child,div.tsml-ui table.table tr th:first-child{padding-left:16px}div.tsml-ui table.table tbody{border-top:0!important}div.tsml-ui table.table tbody:first-of-type{border-top:1px solid #dee2e6!important}div.tsml-ui table.table tbody.tsml-in-progress{background-color:rgba(255,193,7,.25)}div.tsml-ui table.table tbody.tsml-in-progress tr{background-color:hsla(0,0%,100%,.75)!important}div.tsml-ui table.table tbody.tsml-in-progress tr a,div.tsml-ui table.table tbody.tsml-in-progress tr button{color:#998a5e}div.tsml-ui table.table tbody.tsml-in-progress tr a:hover,div.tsml-ui table.table tbody.tsml-in-progress tr button:hover,div.tsml-ui table.table tbody.tsml-in-progress tr:hover a:not(.btn-sm){color:#664d03!important}div.tsml-ui table.table tbody.tsml-in-progress tr:nth-of-type(odd){background-color:rgba(248,249,250,.5)!important}div.tsml-ui table.table tbody>tr:nth-of-type(odd){background-color:#f8f9fa}div.tsml-ui table.table tbody>tr:nth-of-type(odd) td,div.tsml-ui table.table tbody>tr:nth-of-type(odd) time{box-shadow:none}div.tsml-ui table.table.clickable-rows tbody tr:hover a{color:#084298}@media (max-width:767.98px){div.tsml-ui table.table tr{padding:6px 12px;position:relative}div.tsml-ui table.table tr td{border:0;padding:0 0 0 96px}div.tsml-ui table.table tr td.time{left:16px;padding-left:0;position:absolute;width:88px}div.tsml-ui table.table tr td.distance{font-size:24px;left:16px;padding-left:0;position:absolute;top:56px}}#wpadminbar #wp-admin-bar-edit-meeting>.ab-item:before{content:\"\\f464\";top:2px}body.theme-twentyfourteen #page:before,body.theme-twentyfourteen #secondary,body.theme-twentyfourteen .entry-header,body.twentyfourteen #page:before,body.twentyfourteen #secondary,body.twentyfourteen .entry-header{display:none}body.theme-twentyfourteen #primary,body.twentyfourteen #primary{padding-top:0}body.theme-twentyfourteen #content,body.twentyfourteen #content{margin-left:0}body.theme-twentyfourteen .entry-content,body.twentyfourteen .entry-content{max-width:none;min-height:100vh;padding:0!important}body.theme-twentytwenty button,body.theme-twentytwenty input[type=search],body.twentytwenty button,body.twentytwenty input[type=search]{letter-spacing:0}body[class*=avada-] .fusion-tb-header{margin-bottom:0!important}body[class*=avada-] .post-content,body[class*=avada-] main#main{padding:0!important}body[class*=avada-] .avada-page-titlebar-wrapper{display:none}",""]);const o=r},645:t=>{"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var i=t(e);return e[2]?"@media ".concat(e[2]," {").concat(i,"}"):i})).join("")},e.i=function(t,i,n){"string"==typeof t&&(t=[[null,t,""]]);var r={};if(n)for(var o=0;o{"use strict";var e=function(t){return function(t){return!!t&&"object"==typeof t}(t)&&!function(t){var e=Object.prototype.toString.call(t);return"[object RegExp]"===e||"[object Date]"===e||function(t){return t.$$typeof===i}(t)}(t)};var i="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function n(t,e){return!1!==e.clone&&e.isMergeableObject(t)?l((i=t,Array.isArray(i)?[]:{}),t,e):t;var i}function r(t,e,i){return t.concat(e).map((function(t){return n(t,i)}))}function o(t){return Object.keys(t).concat(function(t){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t).filter((function(e){return t.propertyIsEnumerable(e)})):[]}(t))}function a(t,e){try{return e in t}catch(t){return!1}}function s(t,e,i){var r={};return i.isMergeableObject(t)&&o(t).forEach((function(e){r[e]=n(t[e],i)})),o(e).forEach((function(o){(function(t,e){return a(t,e)&&!(Object.hasOwnProperty.call(t,e)&&Object.propertyIsEnumerable.call(t,e))})(t,o)||(a(t,o)&&i.isMergeableObject(e[o])?r[o]=function(t,e){if(!e.customMerge)return l;var i=e.customMerge(t);return"function"==typeof i?i:l}(o,i)(t[o],e[o],i):r[o]=n(e[o],i))})),r}function l(t,i,o){(o=o||{}).arrayMerge=o.arrayMerge||r,o.isMergeableObject=o.isMergeableObject||e,o.cloneUnlessOtherwiseSpecified=n;var a=Array.isArray(i);return a===Array.isArray(t)?a?o.arrayMerge(t,i,o):s(t,i,o):n(i,o)}l.all=function(t,e){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce((function(t,i){return l(t,i,e)}),{})};var c=l;t.exports=c},797:(t,e,i)=>{var n;!function(r,o,a,s){"use strict";var l,c=["","webkit","Moz","MS","ms","o"],u=o.createElement("div"),d=Math.round,h=Math.abs,p=Date.now;function m(t,e,i){return setTimeout(b(t,i),e)}function f(t,e,i){return!!Array.isArray(t)&&(g(t,i[e],i),!0)}function g(t,e,i){var n;if(t)if(t.forEach)t.forEach(e,i);else if(t.length!==s)for(n=0;n\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",o=r.console&&(r.console.warn||r.console.log);return o&&o.call(r.console,n,i),t.apply(this,arguments)}}l="function"!=typeof Object.assign?function(t){if(t===s||null===t)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(t),i=1;i-1}function M(t){return t.trim().split(/\s+/g)}function z(t,e,i){if(t.indexOf&&!i)return t.indexOf(e);for(var n=0;ni[e]})):n.sort()),n}function A(t,e){for(var i,n,r=e[0].toUpperCase()+e.slice(1),o=0;o1&&!i.firstMultiple?i.firstMultiple=G(e):1===r&&(i.firstMultiple=!1);var o=i.firstInput,a=i.firstMultiple,l=a?a.center:o.center,c=e.center=q(n);e.timeStamp=p(),e.deltaTime=e.timeStamp-o.timeStamp,e.angle=Y(l,c),e.distance=X(l,c),function(t,e){var i=e.center,n=t.offsetDelta||{},r=t.prevDelta||{},o=t.prevInput||{};1!==e.eventType&&4!==o.eventType||(r=t.prevDelta={x:o.deltaX||0,y:o.deltaY||0},n=t.offsetDelta={x:i.x,y:i.y});e.deltaX=r.x+(i.x-n.x),e.deltaY=r.y+(i.y-n.y)}(i,e),e.offsetDirection=H(e.deltaX,e.deltaY);var u=W(e.deltaTime,e.deltaX,e.deltaY);e.overallVelocityX=u.x,e.overallVelocityY=u.y,e.overallVelocity=h(u.x)>h(u.y)?u.x:u.y,e.scale=a?(d=a.pointers,m=n,X(m[0],m[1],U)/X(d[0],d[1],U)):1,e.rotation=a?function(t,e){return Y(e[1],e[0],U)+Y(t[1],t[0],U)}(a.pointers,n):0,e.maxPointers=i.prevInput?e.pointers.length>i.prevInput.maxPointers?e.pointers.length:i.prevInput.maxPointers:e.pointers.length,function(t,e){var i,n,r,o,a=t.lastInterval||e,l=e.timeStamp-a.timeStamp;if(8!=e.eventType&&(l>25||a.velocity===s)){var c=e.deltaX-a.deltaX,u=e.deltaY-a.deltaY,d=W(l,c,u);n=d.x,r=d.y,i=h(d.x)>h(d.y)?d.x:d.y,o=H(c,u),t.lastInterval=e}else i=a.velocity,n=a.velocityX,r=a.velocityY,o=a.direction;e.velocity=i,e.velocityX=n,e.velocityY=r,e.direction=o}(i,e);var d,m;var f=t.element;S(e.srcEvent.target,f)&&(f=e.srcEvent.target);e.target=f}(t,i),t.emit("hammer.input",i),t.recognize(i),t.session.prevInput=i}function G(t){for(var e=[],i=0;i=h(e)?t<0?2:4:e<0?8:16}function X(t,e,i){i||(i=V);var n=e[i[0]]-t[i[0]],r=e[i[1]]-t[i[1]];return Math.sqrt(n*n+r*r)}function Y(t,e,i){i||(i=V);var n=e[i[0]]-t[i[0]],r=e[i[1]]-t[i[1]];return 180*Math.atan2(r,n)/Math.PI}Z.prototype={handler:function(){},init:function(){this.evEl&&E(this.element,this.evEl,this.domHandler),this.evTarget&&E(this.target,this.evTarget,this.domHandler),this.evWin&&E(O(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&T(this.element,this.evEl,this.domHandler),this.evTarget&&T(this.target,this.evTarget,this.domHandler),this.evWin&&T(O(this.element),this.evWin,this.domHandler)}};var K={mousedown:1,mousemove:2,mouseup:4},J="mousedown",Q="mousemove mouseup";function tt(){this.evEl=J,this.evWin=Q,this.pressed=!1,Z.apply(this,arguments)}x(tt,Z,{handler:function(t){var e=K[t.type];1&e&&0===t.button&&(this.pressed=!0),2&e&&1!==t.which&&(e=4),this.pressed&&(4&e&&(this.pressed=!1),this.callback(this.manager,e,{pointers:[t],changedPointers:[t],pointerType:j,srcEvent:t}))}});var et={pointerdown:1,pointermove:2,pointerup:4,pointercancel:8,pointerout:8},it={2:F,3:"pen",4:j,5:"kinect"},nt="pointerdown",rt="pointermove pointerup pointercancel";function ot(){this.evEl=nt,this.evWin=rt,Z.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}r.MSPointerEvent&&!r.PointerEvent&&(nt="MSPointerDown",rt="MSPointerMove MSPointerUp MSPointerCancel"),x(ot,Z,{handler:function(t){var e=this.store,i=!1,n=t.type.toLowerCase().replace("ms",""),r=et[n],o=it[t.pointerType]||t.pointerType,a=o==F,s=z(e,t.pointerId,"pointerId");1&r&&(0===t.button||a)?s<0&&(e.push(t),s=e.length-1):12&r&&(i=!0),s<0||(e[s]=t,this.callback(this.manager,r,{pointers:e,changedPointers:[t],pointerType:o,srcEvent:t}),i&&e.splice(s,1))}});var at={touchstart:1,touchmove:2,touchend:4,touchcancel:8},st="touchstart",lt="touchstart touchmove touchend touchcancel";function ct(){this.evTarget=st,this.evWin=lt,this.started=!1,Z.apply(this,arguments)}function ut(t,e){var i=I(t.touches),n=I(t.changedTouches);return 12&e&&(i=P(i.concat(n),"identifier",!0)),[i,n]}x(ct,Z,{handler:function(t){var e=at[t.type];if(1===e&&(this.started=!0),this.started){var i=ut.call(this,t,e);12&e&&i[0].length-i[1].length==0&&(this.started=!1),this.callback(this.manager,e,{pointers:i[0],changedPointers:i[1],pointerType:F,srcEvent:t})}}});var dt={touchstart:1,touchmove:2,touchend:4,touchcancel:8},ht="touchstart touchmove touchend touchcancel";function pt(){this.evTarget=ht,this.targetIds={},Z.apply(this,arguments)}function mt(t,e){var i=I(t.touches),n=this.targetIds;if(3&e&&1===i.length)return n[i[0].identifier]=!0,[i,i];var r,o,a=I(t.changedTouches),s=[],l=this.target;if(o=i.filter((function(t){return S(t.target,l)})),1===e)for(r=0;r-1&&n.splice(t,1)}),2500)}}function yt(t){for(var e=t.srcEvent.clientX,i=t.srcEvent.clientY,n=0;n-1&&this.requireFail.splice(e,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(t){return!!this.simultaneous[t.id]},emit:function(t){var e=this,i=this.state;function n(i){e.manager.emit(i,t)}i<8&&n(e.options.event+Pt(i)),n(e.options.event),t.additionalEvent&&n(t.additionalEvent),i>=8&&n(e.options.event+Pt(i))},tryEmit:function(t){if(this.canEmit())return this.emit(t);this.state=zt},canEmit:function(){for(var t=0;te.threshold&&r&e.direction},attrTest:function(t){return Ot.prototype.attrTest.call(this,t)&&(2&this.state||!(2&this.state)&&this.directionTest(t))},emit:function(t){this.pX=t.deltaX,this.pY=t.deltaY;var e=At(t.direction);e&&(t.additionalEvent=this.options.event+e),this._super.emit.call(this,t)}}),x(Rt,Ot,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Et]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.scale-1)>this.options.threshold||2&this.state)},emit:function(t){if(1!==t.scale){var e=t.scale<1?"in":"out";t.additionalEvent=this.options.event+e}this._super.emit.call(this,t)}}),x(Bt,It,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[wt]},process:function(t){var e=this.options,i=t.pointers.length===e.pointers,n=t.distancee.time;if(this._input=t,!n||!i||12&t.eventType&&!r)this.reset();else if(1&t.eventType)this.reset(),this._timer=m((function(){this.state=8,this.tryEmit()}),e.time,this);else if(4&t.eventType)return 8;return zt},reset:function(){clearTimeout(this._timer)},emit:function(t){8===this.state&&(t&&4&t.eventType?this.manager.emit(this.options.event+"up",t):(this._input.timeStamp=p(),this.manager.emit(this.options.event,this._input)))}}),x(Ft,Ot,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Et]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.rotation)>this.options.threshold||2&this.state)}}),x(jt,Ot,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:30,pointers:1},getTouchAction:function(){return Lt.prototype.getTouchAction.call(this)},attrTest:function(t){var e,i=this.options.direction;return 30&i?e=t.overallVelocity:6&i?e=t.overallVelocityX:i&N&&(e=t.overallVelocityY),this._super.attrTest.call(this,t)&&i&t.offsetDirection&&t.distance>this.options.threshold&&t.maxPointers==this.options.pointers&&h(e)>this.options.velocity&&4&t.eventType},emit:function(t){var e=At(t.offsetDirection);e&&this.manager.emit(this.options.event+e,t),this.manager.emit(this.options.event,t)}}),x(Nt,It,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[kt]},process:function(t){var e=this.options,i=t.pointers.length===e.pointers,n=t.distance(n=1))return n;for(;io?i=r:n=r,r=.5*(n-i)+i}return r},r.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))};var o=a;function a(t,e){this.x=t,this.y=e}a.prototype={clone:function(){return new a(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},multByPoint:function(t){return this.clone()._multByPoint(t)},divByPoint:function(t){return this.clone()._divByPoint(t)},mult:function(t){return this.clone()._mult(t)},div:function(t){return this.clone()._div(t)},rotate:function(t){return this.clone()._rotate(t)},rotateAround:function(t,e){return this.clone()._rotateAround(t,e)},matMult:function(t){return this.clone()._matMult(t)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(t){return this.x===t.x&&this.y===t.y},dist:function(t){return Math.sqrt(this.distSqr(t))},distSqr:function(t){var e=t.x-this.x,i=t.y-this.y;return e*e+i*i},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith:function(t){return this.angleWithSep(t.x,t.y)},angleWithSep:function(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},_matMult:function(t){var e=t[2]*this.x+t[3]*this.y;return this.x=t[0]*this.x+t[1]*this.y,this.y=e,this},_add:function(t){return this.x+=t.x,this.y+=t.y,this},_sub:function(t){return this.x-=t.x,this.y-=t.y,this},_mult:function(t){return this.x*=t,this.y*=t,this},_div:function(t){return this.x/=t,this.y/=t,this},_multByPoint:function(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint:function(t){return this.x/=t.x,this.y/=t.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var t=this.y;return this.y=this.x,this.x=-t,this},_rotate:function(t){var e=Math.cos(t),i=Math.sin(t),n=i*this.x+e*this.y;return this.x=e*this.x-i*this.y,this.y=n,this},_rotateAround:function(t,e){var i=Math.cos(t),n=Math.sin(t),r=e.y+n*(this.x-e.x)+i*(this.y-e.y);return this.x=e.x+i*(this.x-e.x)-n*(this.y-e.y),this.y=r,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},a.convert=function(t){return t instanceof a?t:Array.isArray(t)?new a(t[0],t[1]):t};var s="undefined"!=typeof self?self:{},l=1e-6,c="undefined"!=typeof Float32Array?Float32Array:Array;function u(){var t=new c(9);return c!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function d(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function h(t,e,i){var n=e[0],r=e[1],o=e[2],a=e[3],s=e[4],l=e[5],c=e[6],u=e[7],d=e[8],h=e[9],p=e[10],m=e[11],f=e[12],g=e[13],v=e[14],y=e[15],_=i[0],x=i[1],b=i[2],w=i[3];return t[0]=_*n+x*s+b*d+w*f,t[1]=_*r+x*l+b*h+w*g,t[2]=_*o+x*c+b*p+w*v,t[3]=_*a+x*u+b*m+w*y,t[4]=(_=i[4])*n+(x=i[5])*s+(b=i[6])*d+(w=i[7])*f,t[5]=_*r+x*l+b*h+w*g,t[6]=_*o+x*c+b*p+w*v,t[7]=_*a+x*u+b*m+w*y,t[8]=(_=i[8])*n+(x=i[9])*s+(b=i[10])*d+(w=i[11])*f,t[9]=_*r+x*l+b*h+w*g,t[10]=_*o+x*c+b*p+w*v,t[11]=_*a+x*u+b*m+w*y,t[12]=(_=i[12])*n+(x=i[13])*s+(b=i[14])*d+(w=i[15])*f,t[13]=_*r+x*l+b*h+w*g,t[14]=_*o+x*c+b*p+w*v,t[15]=_*a+x*u+b*m+w*y,t}function p(t,e,i){var n,r,o,a,s,l,c,u,d,h,p,m,f=i[0],g=i[1],v=i[2];return e===t?(t[12]=e[0]*f+e[4]*g+e[8]*v+e[12],t[13]=e[1]*f+e[5]*g+e[9]*v+e[13],t[14]=e[2]*f+e[6]*g+e[10]*v+e[14],t[15]=e[3]*f+e[7]*g+e[11]*v+e[15]):(r=e[1],o=e[2],a=e[3],s=e[4],l=e[5],c=e[6],u=e[7],d=e[8],h=e[9],p=e[10],m=e[11],t[0]=n=e[0],t[1]=r,t[2]=o,t[3]=a,t[4]=s,t[5]=l,t[6]=c,t[7]=u,t[8]=d,t[9]=h,t[10]=p,t[11]=m,t[12]=n*f+s*g+d*v+e[12],t[13]=r*f+l*g+h*v+e[13],t[14]=o*f+c*g+p*v+e[14],t[15]=a*f+u*g+m*v+e[15]),t}function m(t,e,i){var n=i[0],r=i[1],o=i[2];return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*o,t[9]=e[9]*o,t[10]=e[10]*o,t[11]=e[11]*o,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function f(t,e,i){var n=Math.sin(i),r=Math.cos(i),o=e[4],a=e[5],s=e[6],l=e[7],c=e[8],u=e[9],d=e[10],h=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=o*r+c*n,t[5]=a*r+u*n,t[6]=s*r+d*n,t[7]=l*r+h*n,t[8]=c*r-o*n,t[9]=u*r-a*n,t[10]=d*r-s*n,t[11]=h*r-l*n,t}function g(t,e,i){var n=Math.sin(i),r=Math.cos(i),o=e[0],a=e[1],s=e[2],l=e[3],c=e[8],u=e[9],d=e[10],h=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*r-c*n,t[1]=a*r-u*n,t[2]=s*r-d*n,t[3]=l*r-h*n,t[8]=o*n+c*r,t[9]=a*n+u*r,t[10]=s*n+d*r,t[11]=l*n+h*r,t}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var v=h;function y(){var t=new c(3);return c!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function _(t){var e=new c(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function x(t){return Math.hypot(t[0],t[1],t[2])}function b(t,e,i){var n=new c(3);return n[0]=t,n[1]=e,n[2]=i,n}function w(t,e,i){return t[0]=e[0]+i[0],t[1]=e[1]+i[1],t[2]=e[2]+i[2],t}function k(t,e,i){return t[0]=e[0]-i[0],t[1]=e[1]-i[1],t[2]=e[2]-i[2],t}function E(t,e,i){return t[0]=e[0]*i[0],t[1]=e[1]*i[1],t[2]=e[2]*i[2],t}function T(t,e,i){return t[0]=Math.max(e[0],i[0]),t[1]=Math.max(e[1],i[1]),t[2]=Math.max(e[2],i[2]),t}function S(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t}function C(t,e,i,n){return t[0]=e[0]+i[0]*n,t[1]=e[1]+i[1]*n,t[2]=e[2]+i[2]*n,t}function M(t,e){var i=e[0],n=e[1],r=e[2],o=i*i+n*n+r*r;return o>0&&(o=1/Math.sqrt(o)),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o,t}function z(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function I(t,e,i){var n=e[0],r=e[1],o=e[2],a=i[0],s=i[1],l=i[2];return t[0]=r*l-o*s,t[1]=o*a-n*l,t[2]=n*s-r*a,t}function P(t,e,i){var n=e[0],r=e[1],o=e[2],a=i[3]*n+i[7]*r+i[11]*o+i[15];return t[0]=(i[0]*n+i[4]*r+i[8]*o+i[12])/(a=a||1),t[1]=(i[1]*n+i[5]*r+i[9]*o+i[13])/a,t[2]=(i[2]*n+i[6]*r+i[10]*o+i[14])/a,t}function A(t,e,i){var n=i[0],r=i[1],o=i[2],a=e[0],s=e[1],l=e[2],c=r*l-o*s,u=o*a-n*l,d=n*s-r*a,h=r*d-o*u,p=o*c-n*d,m=n*u-r*c,f=2*i[3];return u*=f,d*=f,p*=2,m*=2,t[0]=a+(c*=f)+(h*=2),t[1]=s+u+p,t[2]=l+d+m,t}var D,O=k,L=E,R=x;function B(t,e,i){var n=e[0],r=e[1],o=e[2],a=e[3];return t[0]=i[0]*n+i[4]*r+i[8]*o+i[12]*a,t[1]=i[1]*n+i[5]*r+i[9]*o+i[13]*a,t[2]=i[2]*n+i[6]*r+i[10]*o+i[14]*a,t[3]=i[3]*n+i[7]*r+i[11]*o+i[15]*a,t}function F(){var t=new c(4);return c!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function j(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t}function N(t,e,i){i*=.5;var n=e[0],r=e[1],o=e[2],a=e[3],s=Math.sin(i),l=Math.cos(i);return t[0]=n*l+a*s,t[1]=r*l+o*s,t[2]=o*l-r*s,t[3]=a*l-n*s,t}function V(t,e){return t[0]===e[0]&&t[1]===e[1]}y(),D=new c(4),c!=Float32Array&&(D[0]=0,D[1]=0,D[2]=0,D[3]=0),y(),b(1,0,0),b(0,1,0),F(),F(),u(),function(){var t;t=new c(2),c!=Float32Array&&(t[0]=0,t[1]=0)}();const U=Math.PI/180,Z=180/Math.PI;function $(t){return t*U}function G(t){return t*Z}const q=[[0,0],[1,0],[1,1],[0,1]];function W(t){if(t<=0)return 0;if(t>=1)return 1;const e=t*t,i=e*t;return 4*(t<.5?i:3*(t-e)+i-.75)}function H(t,e,n,r){const o=new i(t,e,n,r);return function(t){return o.solve(t)}}const X=H(.25,.1,.25,1);function Y(t,e,i){return Math.min(i,Math.max(e,t))}function K(t,e,i){return(i=Y((i-t)/(e-t),0,1))*i*(3-2*i)}function J(t,e,i){const n=i-e,r=((t-e)%n+n)%n+e;return r===e?i:r}function Q(t,e,i){if(!t.length)return i(null,[]);let n=t.length;const r=new Array(t.length);let o=null;t.forEach(((t,a)=>{e(t,((t,e)=>{t&&(o=t),r[a]=e,0==--n&&i(o,r)}))}))}function tt(t){const e=[];for(const i in t)e.push(t[i]);return e}function et(t,...e){for(const i of e)for(const e in i)t[e]=i[e];return t}let it=1;function nt(){return it++}function rt(){return function t(e){return e?(e^16*Math.random()>>e/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,t)}()}function ot(t){return t<=1?1:Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))}function at(t){return!!t&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(t)}function st(t,e){t.forEach((t=>{e[t]&&(e[t]=e[t].bind(e))}))}function lt(t,e){return-1!==t.indexOf(e,t.length-e.length)}function ct(t,e,i){const n={};for(const r in t)n[r]=e.call(i||this,t[r],r,t);return n}function ut(t,e,i){const n={};for(const r in t)e.call(i||this,t[r],r,t)&&(n[r]=t[r]);return n}function dt(t){return Array.isArray(t)?t.map(dt):"object"==typeof t&&t?ct(t,dt):t}const ht={};function pt(t){ht[t]||("undefined"!=typeof console&&console.warn(t),ht[t]=!0)}function mt(t,e,i){return(i.y-t.y)*(e.x-t.x)>(e.y-t.y)*(i.x-t.x)}function ft(t){let e=0;for(let i,n,r=0,o=t.length,a=o-1;r@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,((t,i,n,r)=>{const o=n||r;return e[i]=!o||o.toLowerCase(),""})),e["max-age"]){const t=parseInt(e["max-age"],10);isNaN(t)?delete e["max-age"]:e["max-age"]=t}return e}let yt,_t,xt,bt=null;function wt(t){if(null==bt){const e=t.navigator?t.navigator.userAgent:null;bt=!!t.safari||!(!e||!(/\b(iPad|iPhone|iPod)\b/.test(e)||e.match("Safari")&&!e.match("Chrome")))}return bt}function kt(t){try{const e=s[t];return e.setItem("_mapbox_test_",1),e.removeItem("_mapbox_test_"),!0}catch(t){return!1}}const Et={now:()=>void 0!==xt?xt:s.performance.now(),setNow(t){xt=t},restoreNow(){xt=void 0},frame(t){const e=s.requestAnimationFrame(t);return{cancel:()=>s.cancelAnimationFrame(e)}},getImageData(t,e=0){const i=s.document.createElement("canvas"),n=i.getContext("2d");if(!n)throw new Error("failed to create canvas 2d context");return i.width=t.width,i.height=t.height,n.drawImage(t,0,0,t.width,t.height),n.getImageData(-e,-e,t.width+2*e,t.height+2*e)},resolveURL:t=>(yt||(yt=s.document.createElement("a")),yt.href=t,yt.href),get devicePixelRatio(){return s.devicePixelRatio},get prefersReducedMotion(){return!!s.matchMedia&&(null==_t&&(_t=s.matchMedia("(prefers-reduced-motion: reduce)")),_t.matches)}};let Tt;const St={API_URL:"https://api.mapbox.com",get API_URL_REGEX(){if(null==Tt){const t=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;try{Tt=null!=n.env.API_URL_REGEX?new RegExp(n.env.API_URL_REGEX):t}catch(e){Tt=t}}return Tt},get EVENTS_URL(){return this.API_URL?0===this.API_URL.indexOf("https://api.mapbox.cn")?"https://events.mapbox.cn/events/v2":0===this.API_URL.indexOf("https://api.mapbox.com")?"https://events.mapbox.com/events/v2":null:null},SESSION_PATH:"/map-sessions/v1",FEEDBACK_URL:"https://apps.mapbox.com/feedback",TILE_URL_VERSION:"v4",RASTER_URL_PREFIX:"raster/v1",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,MAX_PARALLEL_IMAGE_REQUESTS:16},Ct={supported:!1,testSupport:function(t){!It&&zt&&(Pt?At(t):Mt=t)}};let Mt,zt,It=!1,Pt=!1;function At(t){const e=t.createTexture();t.bindTexture(t.TEXTURE_2D,e);try{if(t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,zt),t.isContextLost())return;Ct.supported=!0}catch(t){}t.deleteTexture(e),It=!0}s.document&&(zt=s.document.createElement("img"),zt.onload=function(){Mt&&At(Mt),Mt=null,Pt=!0},zt.onerror=function(){It=!0,Mt=null},zt.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");const Dt="01",Ot="NO_ACCESS_TOKEN";function Lt(t){return 0===t.indexOf("mapbox:")}function Rt(t){return St.API_URL_REGEX.test(t)}const Bt=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function Ft(t){const e=t.match(Bt);if(!e)throw new Error("Unable to parse URL object");return{protocol:e[1],authority:e[2],path:e[3]||"/",params:e[4]?e[4].split("&"):[]}}function jt(t){const e=t.params.length?`?${t.params.join("&")}`:"";return`${t.protocol}://${t.authority}${t.path}${e}`}function Nt(t){if(!t)return null;const e=t.split(".");if(!e||3!==e.length)return null;try{return JSON.parse(decodeURIComponent(s.atob(e[1]).split("").map((t=>"%"+("00"+t.charCodeAt(0).toString(16)).slice(-2))).join("")))}catch(t){return null}}class Vt{constructor(t){this.type=t,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null}getStorageKey(t){const e=Nt(St.ACCESS_TOKEN);let i="";return i=e&&e.u?s.btoa(encodeURIComponent(e.u).replace(/%([0-9A-F]{2})/g,((t,e)=>String.fromCharCode(Number("0x"+e))))):St.ACCESS_TOKEN||"",t?`mapbox.eventData.${t}:${i}`:`mapbox.eventData:${i}`}fetchEventData(){const t=kt("localStorage"),e=this.getStorageKey(),i=this.getStorageKey("uuid");if(t)try{const t=s.localStorage.getItem(e);t&&(this.eventData=JSON.parse(t));const n=s.localStorage.getItem(i);n&&(this.anonId=n)}catch(t){pt("Unable to read from LocalStorage")}}saveEventData(){const t=kt("localStorage"),e=this.getStorageKey(),i=this.getStorageKey("uuid");if(t)try{s.localStorage.setItem(i,this.anonId),Object.keys(this.eventData).length>=1&&s.localStorage.setItem(e,JSON.stringify(this.eventData))}catch(t){pt("Unable to write to LocalStorage")}}processRequests(t){}postEvent(t,i,n,r){if(!St.EVENTS_URL)return;const o=Ft(St.EVENTS_URL);o.params.push(`access_token=${r||St.ACCESS_TOKEN||""}`);const a={event:this.type,created:new Date(t).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:e,skuId:Dt,userId:this.anonId},s=i?et(a,i):a,l={url:jt(o),headers:{"Content-Type":"text/plain"},body:JSON.stringify([s])};this.pendingRequest=le(l,(t=>{this.pendingRequest=null,n(t),this.saveEventData(),this.processRequests(r)}))}queueRequest(t,e){this.queue.push(t),this.processRequests(e)}}const Ut=new class extends Vt{constructor(t){super("appUserTurnstile"),this._customAccessToken=t}postTurnstileEvent(t,e){St.EVENTS_URL&&St.ACCESS_TOKEN&&Array.isArray(t)&&t.some((t=>Lt(t)||Rt(t)))&&this.queueRequest(Date.now(),e)}processRequests(t){if(this.pendingRequest||0===this.queue.length)return;this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();const e=Nt(St.ACCESS_TOKEN),i=e?e.u:St.ACCESS_TOKEN;let n=i!==this.eventData.tokenU;at(this.anonId)||(this.anonId=rt(),n=!0);const r=this.queue.shift();if(this.eventData.lastSuccess){const t=new Date(this.eventData.lastSuccess),e=new Date(r),i=(r-this.eventData.lastSuccess)/864e5;n=n||i>=1||i<-1||t.getDate()!==e.getDate()}else n=!0;if(!n)return this.processRequests();this.postEvent(r,{"enabled.telemetry":!1},(t=>{t||(this.eventData.lastSuccess=r,this.eventData.tokenU=i)}),t)}},Zt=Ut.postTurnstileEvent.bind(Ut),$t=new class extends Vt{constructor(){super("map.load"),this.success={},this.skuToken=""}postMapLoadEvent(t,e,i,n){this.skuToken=e,this.errorCb=n,St.EVENTS_URL&&(i||St.ACCESS_TOKEN?this.queueRequest({id:t,timestamp:Date.now()},i):this.errorCb(new Error(Ot)))}processRequests(t){if(this.pendingRequest||0===this.queue.length)return;const{id:e,timestamp:i}=this.queue.shift();e&&this.success[e]||(this.anonId||this.fetchEventData(),at(this.anonId)||(this.anonId=rt()),this.postEvent(i,{skuToken:this.skuToken},(t=>{t?this.errorCb(t):e&&(this.success[e]=!0)}),t))}},Gt=$t.postMapLoadEvent.bind($t),qt=new class extends Vt{constructor(){super("map.auth"),this.success={},this.skuToken=""}getSession(t,e,i,n){if(!St.API_URL||!St.SESSION_PATH)return;const r=Ft(St.API_URL+St.SESSION_PATH);r.params.push(`sku=${e||""}`),r.params.push(`access_token=${n||St.ACCESS_TOKEN||""}`);const o={url:jt(r),headers:{"Content-Type":"text/plain"}};this.pendingRequest=ce(o,(t=>{this.pendingRequest=null,i(t),this.saveEventData(),this.processRequests(n)}))}getSessionAPI(t,e,i,n){this.skuToken=e,this.errorCb=n,St.SESSION_PATH&&St.API_URL&&(i||St.ACCESS_TOKEN?this.queueRequest({id:t,timestamp:Date.now()},i):this.errorCb(new Error(Ot)))}processRequests(t){if(this.pendingRequest||0===this.queue.length)return;const{id:e,timestamp:i}=this.queue.shift();e&&this.success[e]||this.getSession(i,this.skuToken,(t=>{t?this.errorCb(t):e&&(this.success[e]=!0)}),t)}},Wt=qt.getSessionAPI.bind(qt),Ht=new Set,Xt="mapbox-tiles";let Yt,Kt,Jt=500,Qt=50;function te(){s.caches&&!Yt&&(Yt=s.caches.open(Xt))}function ee(t){const e=t.indexOf("?");return e<0?t:t.slice(0,e)}let ie=1/0;const ne={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};"function"==typeof Object.freeze&&Object.freeze(ne);class re extends Error{constructor(t,e,i){401===e&&Rt(i)&&(t+=": you may have provided an invalid Mapbox access token. See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes"),super(t),this.status=e,this.url=i}toString(){return`${this.name}: ${this.message} (${this.status}): ${this.url}`}}const oe=gt()?()=>self.worker&&self.worker.referrer:()=>("blob:"===s.location.protocol?s.parent:s).location.href,ae=function(t,e){if(!(/^file:/.test(i=t.url)||/^file:/.test(oe())&&!/^\w+:/.test(i))){if(s.fetch&&s.Request&&s.AbortController&&s.Request.prototype.hasOwnProperty("signal"))return function(t,e){const i=new s.AbortController,n=new s.Request(t.url,{method:t.method||"GET",body:t.body,credentials:t.credentials,headers:t.headers,referrer:oe(),signal:i.signal});let r=!1,o=!1;const a=(l=n.url).indexOf("sku=")>0&&Rt(l);var l;"json"===t.type&&n.headers.set("Accept","application/json");const c=(i,r,l)=>{if(o)return;if(i&&"SecurityError"!==i.message&&pt(i),r&&l)return u(r);const c=Date.now();s.fetch(n).then((i=>{if(i.ok){const t=a?i.clone():null;return u(i,t,c)}return e(new re(i.statusText,i.status,t.url))})).catch((t=>{20!==t.code&&e(new Error(t.message))}))},u=(i,a,l)=>{("arrayBuffer"===t.type?i.arrayBuffer():"json"===t.type?i.json():i.text()).then((t=>{o||(a&&l&&function(t,e,i){if(te(),!Yt)return;const n={status:e.status,statusText:e.statusText,headers:new s.Headers};e.headers.forEach(((t,e)=>n.headers.set(e,t)));const r=vt(e.headers.get("Cache-Control")||"");r["no-store"]||(r["max-age"]&&n.headers.set("Expires",new Date(i+1e3*r["max-age"]).toUTCString()),new Date(n.headers.get("Expires")).getTime()-i<42e4||function(t,e){if(void 0===Kt)try{new Response(new ReadableStream),Kt=!0}catch(t){Kt=!1}Kt?e(t.body):t.blob().then(e)}(e,(e=>{const i=new s.Response(e,n);te(),Yt&&Yt.then((e=>e.put(ee(t.url),i))).catch((t=>pt(t.message)))})))}(n,a,l),r=!0,e(null,t,i.headers.get("Cache-Control"),i.headers.get("Expires")))})).catch((t=>{o||e(new Error(t.message))}))};return a?function(t,e){if(te(),!Yt)return e(null);const i=ee(t.url);Yt.then((t=>{t.match(i).then((n=>{const r=function(t){if(!t)return!1;const e=new Date(t.headers.get("Expires")||0),i=vt(t.headers.get("Cache-Control")||"");return e>Date.now()&&!i["no-cache"]}(n);t.delete(i),r&&t.put(i,n.clone()),e(null,n,r)})).catch(e)})).catch(e)}(n,c):c(null,null),{cancel:()=>{o=!0,r||i.abort()}}}(t,e);if(gt()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",t,e,void 0,!0)}var i;return function(t,e){const i=new s.XMLHttpRequest;i.open(t.method||"GET",t.url,!0),"arrayBuffer"===t.type&&(i.responseType="arraybuffer");for(const e in t.headers)i.setRequestHeader(e,t.headers[e]);return"json"===t.type&&(i.responseType="text",i.setRequestHeader("Accept","application/json")),i.withCredentials="include"===t.credentials,i.onerror=()=>{e(new Error(i.statusText))},i.onload=()=>{if((i.status>=200&&i.status<300||0===i.status)&&null!==i.response){let n=i.response;if("json"===t.type)try{n=JSON.parse(i.response)}catch(t){return e(t)}e(null,n,i.getResponseHeader("Cache-Control"),i.getResponseHeader("Expires"))}else e(new re(i.statusText,i.status,t.url))},i.send(t.body),{cancel:()=>i.abort()}}(t,e)},se=function(t,e){return ae(et(t,{type:"arrayBuffer"}),e)},le=function(t,e){return ae(et(t,{method:"POST"}),e)},ce=function(t,e){return ae(et(t,{method:"GET"}),e)};function ue(t){const e=s.document.createElement("a");return e.href=t,e.protocol===s.document.location.protocol&&e.host===s.document.location.host}const de="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";let he,pe;he=[],pe=0;const me=function(t,e){if(Ct.supported&&(t.headers||(t.headers={}),t.headers.accept="image/webp,*/*"),pe>=St.MAX_PARALLEL_IMAGE_REQUESTS){const i={requestParameters:t,callback:e,cancelled:!1,cancel(){this.cancelled=!0}};return he.push(i),i}pe++;let i=!1;const n=()=>{if(!i)for(i=!0,pe--;he.length&&pe{n(),t?e(t):i&&(s.createImageBitmap?function(t,e){const i=new s.Blob([new Uint8Array(t)],{type:"image/png"});s.createImageBitmap(i).then((t=>{e(null,t)})).catch((t=>{e(new Error(`Could not load image because of ${t.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`))}))}(i,((t,i)=>e(t,i,r,o))):function(t,e){const i=new s.Image,n=s.URL;i.onload=()=>{e(null,i),n.revokeObjectURL(i.src),i.onload=null,s.requestAnimationFrame((()=>{i.src=de}))},i.onerror=()=>e(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."));const r=new s.Blob([new Uint8Array(t)],{type:"image/png"});i.src=t.byteLength?n.createObjectURL(r):de}(i,((t,i)=>e(t,i,r,o))))}));return{cancel:()=>{r.cancel(),n()}}};function fe(t,e,i){i[t]&&-1!==i[t].indexOf(e)||(i[t]=i[t]||[],i[t].push(e))}function ge(t,e,i){if(i&&i[t]){const n=i[t].indexOf(e);-1!==n&&i[t].splice(n,1)}}class ve{constructor(t,e={}){et(this,e),this.type=t}}class ye extends ve{constructor(t,e={}){super("error",et({error:t},e))}}class _e{on(t,e){return this._listeners=this._listeners||{},fe(t,e,this._listeners),this}off(t,e){return ge(t,e,this._listeners),ge(t,e,this._oneTimeListeners),this}once(t,e){return e?(this._oneTimeListeners=this._oneTimeListeners||{},fe(t,e,this._oneTimeListeners),this):new Promise((e=>this.once(t,e)))}fire(t,e){"string"==typeof t&&(t=new ve(t,e||{}));const i=t.type;if(this.listens(i)){t.target=this;const e=this._listeners&&this._listeners[i]?this._listeners[i].slice():[];for(const i of e)i.call(this,t);const n=this._oneTimeListeners&&this._oneTimeListeners[i]?this._oneTimeListeners[i].slice():[];for(const e of n)ge(i,e,this._oneTimeListeners),e.call(this,t);const r=this._eventedParent;r&&(et(t,"function"==typeof this._eventedParentData?this._eventedParentData():this._eventedParentData),r.fire(t))}else t instanceof ye&&console.error(t.error);return this}listens(t){return!!(this._listeners&&this._listeners[t]&&this._listeners[t].length>0||this._oneTimeListeners&&this._oneTimeListeners[t]&&this._oneTimeListeners[t].length>0||this._eventedParent&&this._eventedParent.listens(t))}setEventedParent(t,e){return this._eventedParent=t,this._eventedParentData=e,this}}var xe=JSON.parse('{"$version":8,"$root":{"version":{"required":true,"type":"enum","values":[8]},"name":{"type":"string"},"metadata":{"type":"*"},"center":{"type":"array","value":"number"},"zoom":{"type":"number"},"bearing":{"type":"number","default":0,"period":360,"units":"degrees"},"pitch":{"type":"number","default":0,"units":"degrees"},"light":{"type":"light"},"terrain":{"type":"terrain"},"fog":{"type":"fog"},"sources":{"required":true,"type":"sources"},"sprite":{"type":"string"},"glyphs":{"type":"string"},"transition":{"type":"transition"},"projection":{"type":"projection"},"layers":{"required":true,"type":"array","value":"layer"}},"sources":{"*":{"type":"source"}},"source":["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],"source_vector":{"type":{"required":true,"type":"enum","values":{"vector":{}}},"url":{"type":"string"},"tiles":{"type":"array","value":"string"},"bounds":{"type":"array","value":"number","length":4,"default":[-180,-85.051129,180,85.051129]},"scheme":{"type":"enum","values":{"xyz":{},"tms":{}},"default":"xyz"},"minzoom":{"type":"number","default":0},"maxzoom":{"type":"number","default":22},"attribution":{"type":"string"},"promoteId":{"type":"promoteId"},"volatile":{"type":"boolean","default":false},"*":{"type":"*"}},"source_raster":{"type":{"required":true,"type":"enum","values":{"raster":{}}},"url":{"type":"string"},"tiles":{"type":"array","value":"string"},"bounds":{"type":"array","value":"number","length":4,"default":[-180,-85.051129,180,85.051129]},"minzoom":{"type":"number","default":0},"maxzoom":{"type":"number","default":22},"tileSize":{"type":"number","default":512,"units":"pixels"},"scheme":{"type":"enum","values":{"xyz":{},"tms":{}},"default":"xyz"},"attribution":{"type":"string"},"volatile":{"type":"boolean","default":false},"*":{"type":"*"}},"source_raster_dem":{"type":{"required":true,"type":"enum","values":{"raster-dem":{}}},"url":{"type":"string"},"tiles":{"type":"array","value":"string"},"bounds":{"type":"array","value":"number","length":4,"default":[-180,-85.051129,180,85.051129]},"minzoom":{"type":"number","default":0},"maxzoom":{"type":"number","default":22},"tileSize":{"type":"number","default":512,"units":"pixels"},"attribution":{"type":"string"},"encoding":{"type":"enum","values":{"terrarium":{},"mapbox":{}},"default":"mapbox"},"volatile":{"type":"boolean","default":false},"*":{"type":"*"}},"source_geojson":{"type":{"required":true,"type":"enum","values":{"geojson":{}}},"data":{"type":"*"},"maxzoom":{"type":"number","default":18},"attribution":{"type":"string"},"buffer":{"type":"number","default":128,"maximum":512,"minimum":0},"filter":{"type":"*"},"tolerance":{"type":"number","default":0.375},"cluster":{"type":"boolean","default":false},"clusterRadius":{"type":"number","default":50,"minimum":0},"clusterMaxZoom":{"type":"number"},"clusterMinPoints":{"type":"number"},"clusterProperties":{"type":"*"},"lineMetrics":{"type":"boolean","default":false},"generateId":{"type":"boolean","default":false},"promoteId":{"type":"promoteId"}},"source_video":{"type":{"required":true,"type":"enum","values":{"video":{}}},"urls":{"required":true,"type":"array","value":"string"},"coordinates":{"required":true,"type":"array","length":4,"value":{"type":"array","length":2,"value":"number"}}},"source_image":{"type":{"required":true,"type":"enum","values":{"image":{}}},"url":{"required":true,"type":"string"},"coordinates":{"required":true,"type":"array","length":4,"value":{"type":"array","length":2,"value":"number"}}},"layer":{"id":{"type":"string","required":true},"type":{"type":"enum","values":{"fill":{},"line":{},"symbol":{},"circle":{},"heatmap":{},"fill-extrusion":{},"raster":{},"hillshade":{},"background":{},"sky":{}},"required":true},"metadata":{"type":"*"},"source":{"type":"string"},"source-layer":{"type":"string"},"minzoom":{"type":"number","minimum":0,"maximum":24},"maxzoom":{"type":"number","minimum":0,"maximum":24},"filter":{"type":"filter"},"layout":{"type":"layout"},"paint":{"type":"paint"}},"layout":["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background","layout_sky"],"layout_background":{"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"}},"layout_sky":{"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"}},"layout_fill":{"fill-sort-key":{"type":"number","expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"}},"layout_circle":{"circle-sort-key":{"type":"number","expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"}},"layout_heatmap":{"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"}},"layout_fill-extrusion":{"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"}},"layout_line":{"line-cap":{"type":"enum","values":{"butt":{},"round":{},"square":{}},"default":"butt","expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-join":{"type":"enum","values":{"bevel":{},"round":{},"miter":{}},"default":"miter","expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{"type":"number","default":2,"requires":[{"line-join":"miter"}],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"line-round-limit":{"type":"number","default":1.05,"requires":[{"line-join":"round"}],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"line-sort-key":{"type":"number","expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"}},"layout_symbol":{"symbol-placement":{"type":"enum","values":{"point":{},"line":{},"line-center":{}},"default":"point","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"symbol-spacing":{"type":"number","default":250,"minimum":1,"units":"pixels","requires":[{"symbol-placement":"line"}],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{"type":"boolean","default":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{"type":"number","expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{"type":"enum","values":{"auto":{},"viewport-y":{},"source":{}},"default":"auto","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{"type":"boolean","default":false,"requires":["icon-image"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{"type":"boolean","default":false,"requires":["icon-image"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-optional":{"type":"boolean","default":false,"requires":["icon-image","text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{"type":"enum","values":{"map":{},"viewport":{},"auto":{}},"default":"auto","requires":["icon-image"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-size":{"type":"number","default":1,"minimum":0,"units":"factor of the original icon size","requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{"type":"enum","values":{"none":{},"width":{},"height":{},"both":{}},"default":"none","requires":["icon-image","text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{"type":"array","value":"number","length":4,"default":[0,0,0,0],"units":"pixels","requires":["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"icon-image":{"type":"resolvedImage","tokens":true,"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{"type":"number","default":0,"period":360,"units":"degrees","requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{"type":"number","default":2,"minimum":0,"units":"pixels","requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{"type":"boolean","default":false,"requires":["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-offset":{"type":"array","value":"number","length":2,"default":[0,0],"requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{"type":"enum","values":{"center":{},"left":{},"right":{},"top":{},"bottom":{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},"default":"center","requires":["icon-image"],"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{"type":"enum","values":{"map":{},"viewport":{},"auto":{}},"default":"auto","requires":["icon-image"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{"type":"enum","values":{"map":{},"viewport":{},"auto":{}},"default":"auto","requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{"type":"enum","values":{"map":{},"viewport":{},"auto":{}},"default":"auto","requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-field":{"type":"formatted","default":"","tokens":true,"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-font":{"type":"array","value":"string","default":["Open Sans Regular","Arial Unicode MS Regular"],"requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-size":{"type":"number","default":16,"minimum":0,"units":"pixels","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{"type":"number","default":10,"minimum":0,"units":"ems","requires":["text-field",{"symbol-placement":["point"]}],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{"type":"number","default":1.2,"units":"ems","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-letter-spacing":{"type":"number","default":0,"units":"ems","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-justify":{"type":"enum","values":{"auto":{},"left":{},"center":{},"right":{}},"default":"center","requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{"type":"number","units":"ems","default":0,"requires":["text-field"],"property-type":"data-driven","expression":{"interpolated":true,"parameters":["zoom","feature"]}},"text-variable-anchor":{"type":"array","value":"enum","values":{"center":{},"left":{},"right":{},"top":{},"bottom":{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},"requires":["text-field",{"symbol-placement":["point"]}],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-anchor":{"type":"enum","values":{"center":{},"left":{},"right":{},"top":{},"bottom":{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},"default":"center","requires":["text-field",{"!":"text-variable-anchor"}],"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{"type":"number","default":45,"units":"degrees","requires":["text-field",{"symbol-placement":["line","line-center"]}],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"text-writing-mode":{"type":"array","value":"enum","values":{"horizontal":{},"vertical":{}},"requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-rotate":{"type":"number","default":0,"period":360,"units":"degrees","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-padding":{"type":"number","default":2,"minimum":0,"units":"pixels","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"text-keep-upright":{"type":"boolean","default":true,"requires":["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-transform":{"type":"enum","values":{"none":{},"uppercase":{},"lowercase":{}},"default":"none","requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-offset":{"type":"array","value":"number","units":"ems","length":2,"default":[0,0],"requires":["text-field",{"!":"text-radial-offset"}],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{"type":"boolean","default":false,"requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{"type":"boolean","default":false,"requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-optional":{"type":"boolean","default":false,"requires":["text-field","icon-image"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"}},"layout_raster":{"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"}},"layout_hillshade":{"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"}},"filter":{"type":"array","value":"*"},"filter_symbol":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature","pitch","distance-from-center"]}},"filter_fill":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_line":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_circle":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_fill-extrusion":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_heatmap":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_operator":{"type":"enum","values":{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},"in":{},"!in":{},"all":{},"any":{},"none":{},"has":{},"!has":{},"within":{}}},"geometry_type":{"type":"enum","values":{"Point":{},"LineString":{},"Polygon":{}}},"function":{"expression":{"type":"expression"},"stops":{"type":"array","value":"function_stop"},"base":{"type":"number","default":1,"minimum":0},"property":{"type":"string","default":"$zoom"},"type":{"type":"enum","values":{"identity":{},"exponential":{},"interval":{},"categorical":{}},"default":"exponential"},"colorSpace":{"type":"enum","values":{"rgb":{},"lab":{},"hcl":{}},"default":"rgb"},"default":{"type":"*","required":false}},"function_stop":{"type":"array","minimum":0,"maximum":24,"value":["number","color"],"length":2},"expression":{"type":"array","value":"*","minimum":1},"fog":{"range":{"type":"array","default":[0.5,10],"minimum":-20,"maximum":20,"length":2,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"color":{"type":"color","property-type":"data-constant","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"horizon-blend":{"type":"number","property-type":"data-constant","default":0.1,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true}},"light":{"anchor":{"type":"enum","default":"viewport","values":{"map":{},"viewport":{}},"property-type":"data-constant","transition":false,"expression":{"interpolated":false,"parameters":["zoom"]}},"position":{"type":"array","default":[1.15,210,30],"length":3,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"color":{"type":"color","property-type":"data-constant","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"intensity":{"type":"number","property-type":"data-constant","default":0.5,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true}},"projection":{"name":{"type":"enum","values":{"albers":{},"equalEarth":{},"equirectangular":{},"lambertConformalConic":{},"mercator":{},"naturalEarth":{},"winkelTripel":{}},"default":"mercator","required":true},"center":{"type":"array","length":2,"value":"number","property-type":"data-constant","transition":false,"requires":[{"name":["albers","lambertConformalConic"]}]},"parallels":{"type":"array","length":2,"value":"number","property-type":"data-constant","transition":false,"requires":[{"name":["albers","lambertConformalConic"]}]}},"terrain":{"source":{"type":"string","required":true},"exaggeration":{"type":"number","property-type":"data-constant","default":1,"minimum":0,"maximum":1000,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true}},"paint":["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background","paint_sky"],"paint_fill":{"fill-antialias":{"type":"boolean","default":true,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"fill-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{"type":"color","default":"#000000","transition":true,"requires":[{"!":"fill-pattern"}],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{"type":"color","transition":true,"requires":[{"!":"fill-pattern"},{"fill-antialias":true}],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["fill-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"fill-pattern":{"type":"resolvedImage","transition":true,"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{"type":"color","default":"#000000","transition":true,"requires":[{"!":"fill-extrusion-pattern"}],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["fill-extrusion-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{"type":"resolvedImage","transition":true,"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{"type":"number","default":0,"minimum":0,"units":"meters","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{"type":"number","default":0,"minimum":0,"units":"meters","transition":true,"requires":["fill-extrusion-height"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{"type":"boolean","default":true,"transition":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_line":{"line-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{"type":"color","default":"#000000","transition":true,"requires":[{"!":"line-pattern"}],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["line-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"line-width":{"type":"number","default":1,"minimum":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{"type":"number","default":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{"type":"array","value":"number","minimum":0,"transition":true,"units":"line widths","requires":[{"!":"line-pattern"}],"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-pattern":{"type":"resolvedImage","transition":true,"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{"type":"color","transition":false,"requires":[{"!":"line-pattern"},{"source":"geojson","has":{"lineMetrics":true}}],"expression":{"interpolated":true,"parameters":["line-progress"]},"property-type":"color-ramp"}},"paint_circle":{"circle-radius":{"type":"number","default":5,"minimum":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{"type":"number","default":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["circle-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{"type":"enum","values":{"map":{},"viewport":{}},"default":"viewport","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"}},"paint_heatmap":{"heatmap-radius":{"type":"number","default":30,"minimum":1,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{"type":"number","default":1,"minimum":0,"transition":false,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{"type":"number","default":1,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"heatmap-color":{"type":"color","default":["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",0.1,"royalblue",0.3,"cyan",0.5,"lime",0.7,"yellow",1,"red"],"transition":false,"expression":{"interpolated":true,"parameters":["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_symbol":{"icon-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{"type":"color","default":"#000000","transition":true,"requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{"type":"color","default":"rgba(0, 0, 0, 0)","transition":true,"requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["icon-image","icon-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{"type":"color","default":"#000000","transition":true,"overridable":true,"requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{"type":"color","default":"rgba(0, 0, 0, 0)","transition":true,"requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["text-field","text-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_raster":{"raster-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{"type":"number","default":0,"period":360,"transition":true,"units":"degrees","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{"type":"number","default":0,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-saturation":{"type":"number","default":0,"minimum":-1,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-contrast":{"type":"number","default":0,"minimum":-1,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-resampling":{"type":"enum","values":{"linear":{},"nearest":{}},"default":"linear","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{"type":"number","default":300,"minimum":0,"transition":false,"units":"milliseconds","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_hillshade":{"hillshade-illumination-direction":{"type":"number","default":335,"minimum":0,"maximum":359,"transition":false,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"viewport","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{"type":"number","default":0.5,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{"type":"color","default":"#FFFFFF","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_background":{"background-color":{"type":"color","default":"#000000","transition":true,"requires":[{"!":"background-pattern"}],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"background-pattern":{"type":"resolvedImage","transition":true,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"cross-faded"},"background-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_sky":{"sky-type":{"type":"enum","values":{"gradient":{},"atmosphere":{}},"default":"atmosphere","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun":{"type":"array","value":"number","length":2,"units":"degrees","minimum":[0,0],"maximum":[360,180],"transition":false,"requires":[{"sky-type":"atmosphere"}],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun-intensity":{"type":"number","requires":[{"sky-type":"atmosphere"}],"default":10,"minimum":0,"maximum":100,"transition":false,"property-type":"data-constant"},"sky-gradient-center":{"type":"array","requires":[{"sky-type":"gradient"}],"value":"number","default":[0,0],"length":2,"units":"degrees","minimum":[0,0],"maximum":[360,180],"transition":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"sky-gradient-radius":{"type":"number","requires":[{"sky-type":"gradient"}],"default":90,"minimum":0,"maximum":180,"transition":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"sky-gradient":{"type":"color","default":["interpolate",["linear"],["sky-radial-progress"],0.8,"#87ceeb",1,"white"],"transition":false,"requires":[{"sky-type":"gradient"}],"expression":{"interpolated":true,"parameters":["sky-radial-progress"]},"property-type":"color-ramp"},"sky-atmosphere-halo-color":{"type":"color","default":"white","transition":false,"requires":[{"sky-type":"atmosphere"}],"property-type":"data-constant"},"sky-atmosphere-color":{"type":"color","default":"white","transition":false,"requires":[{"sky-type":"atmosphere"}],"property-type":"data-constant"},"sky-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"transition":{"duration":{"type":"number","default":300,"minimum":0,"units":"milliseconds"},"delay":{"type":"number","default":0,"minimum":0,"units":"milliseconds"}},"property-type":{"data-driven":{"type":"property-type"},"cross-faded":{"type":"property-type"},"cross-faded-data-driven":{"type":"property-type"},"color-ramp":{"type":"property-type"},"data-constant":{"type":"property-type"},"constant":{"type":"property-type"}},"promoteId":{"*":{"type":"string"}}}');class be{constructor(t,e,i,n){this.message=(t?`${t}: `:"")+i,n&&(this.identifier=n),null!=e&&e.__line__&&(this.line=e.__line__)}}function we(t){const e=t.value;return e?[new be(t.key,e,"constants have been deprecated as of v8")]:[]}function ke(t,...e){for(const i of e)for(const e in i)t[e]=i[e];return t}function Ee(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}function Te(t){if(Array.isArray(t))return t.map(Te);if(t instanceof Object&&!(t instanceof Number||t instanceof String||t instanceof Boolean)){const e={};for(const i in t)e[i]=Te(t[i]);return e}return Ee(t)}class Se extends Error{constructor(t,e){super(e),this.message=e,this.key=t}}class Ce{constructor(t,e=[]){this.parent=t,this.bindings={};for(const[t,i]of e)this.bindings[t]=i}concat(t){return new Ce(this,t)}get(t){if(this.bindings[t])return this.bindings[t];if(this.parent)return this.parent.get(t);throw new Error(`${t} not found in scope.`)}has(t){return!!this.bindings[t]||!!this.parent&&this.parent.has(t)}}const Me={kind:"null"},ze={kind:"number"},Ie={kind:"string"},Pe={kind:"boolean"},Ae={kind:"color"},De={kind:"object"},Oe={kind:"value"},Le={kind:"collator"},Re={kind:"formatted"},Be={kind:"resolvedImage"};function Fe(t,e){return{kind:"array",itemType:t,N:e}}function je(t){if("array"===t.kind){const e=je(t.itemType);return"number"==typeof t.N?`array<${e}, ${t.N}>`:"value"===t.itemType.kind?"array":`array<${e}>`}return t.kind}const Ne=[Me,ze,Ie,Pe,Ae,Re,De,Fe(Oe),Be];function Ve(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!Ve(t.itemType,e.itemType))&&("number"!=typeof t.N||t.N===e.N))return null}else{if(t.kind===e.kind)return null;if("value"===t.kind)for(const t of Ne)if(!Ve(t,e))return null}return`Expected ${je(t)} but found ${je(e)} instead.`}function Ue(t,e){return e.some((e=>e.kind===t.kind))}function Ze(t,e){return e.some((e=>"null"===e?null===t:"array"===e?Array.isArray(t):"object"===e?t&&!Array.isArray(t)&&"object"==typeof t:e===typeof t))}function $e(t){var e={exports:{}};return t(e,e.exports),e.exports}var Ge=$e((function(t,e){var i={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function n(t){return(t=Math.round(t))<0?0:t>255?255:t}function r(t){return n("%"===t[t.length-1]?parseFloat(t)/100*255:parseInt(t))}function o(t){return(e="%"===t[t.length-1]?parseFloat(t)/100:parseFloat(t))<0?0:e>1?1:e;var e}function a(t,e,i){return i<0?i+=1:i>1&&(i-=1),6*i<1?t+(e-t)*i*6:2*i<1?e:3*i<2?t+(e-t)*(2/3-i)*6:t}try{e.parseCSSColor=function(t){var e,s=t.replace(/ /g,"").toLowerCase();if(s in i)return i[s].slice();if("#"===s[0])return 4===s.length?(e=parseInt(s.substr(1),16))>=0&&e<=4095?[(3840&e)>>4|(3840&e)>>8,240&e|(240&e)>>4,15&e|(15&e)<<4,1]:null:7===s.length&&(e=parseInt(s.substr(1),16))>=0&&e<=16777215?[(16711680&e)>>16,(65280&e)>>8,255&e,1]:null;var l=s.indexOf("("),c=s.indexOf(")");if(-1!==l&&c+1===s.length){var u=s.substr(0,l),d=s.substr(l+1,c-(l+1)).split(","),h=1;switch(u){case"rgba":if(4!==d.length)return null;h=o(d.pop());case"rgb":return 3!==d.length?null:[r(d[0]),r(d[1]),r(d[2]),h];case"hsla":if(4!==d.length)return null;h=o(d.pop());case"hsl":if(3!==d.length)return null;var p=(parseFloat(d[0])%360+360)%360/360,m=o(d[1]),f=o(d[2]),g=f<=.5?f*(m+1):f+m-f*m,v=2*f-g;return[n(255*a(v,g,p+1/3)),n(255*a(v,g,p)),n(255*a(v,g,p-1/3)),h];default:return null}}return null}}catch(t){}}));class qe{constructor(t,e,i,n=1){this.r=t,this.g=e,this.b=i,this.a=n}static parse(t){if(!t)return;if(t instanceof qe)return t;if("string"!=typeof t)return;const e=Ge.parseCSSColor(t);return e?new qe(e[0]/255*e[3],e[1]/255*e[3],e[2]/255*e[3],e[3]):void 0}toString(){const[t,e,i,n]=this.toArray();return`rgba(${Math.round(t)},${Math.round(e)},${Math.round(i)},${n})`}toArray(){const{r:t,g:e,b:i,a:n}=this;return 0===n?[0,0,0,0]:[255*t/n,255*e/n,255*i/n,n]}}qe.black=new qe(0,0,0,1),qe.white=new qe(1,1,1,1),qe.transparent=new qe(0,0,0,0),qe.red=new qe(1,0,0,1),qe.blue=new qe(0,0,1,1);class We{constructor(t,e,i){this.sensitivity=t?e?"variant":"case":e?"accent":"base",this.locale=i,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(t,e){return this.collator.compare(t,e)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class He{constructor(t,e,i,n,r){this.text=t.normalize?t.normalize():t,this.image=e,this.scale=i,this.fontStack=n,this.textColor=r}}class Xe{constructor(t){this.sections=t}static fromString(t){return new Xe([new He(t,null,null,null,null)])}isEmpty(){return 0===this.sections.length||!this.sections.some((t=>0!==t.text.length||t.image&&0!==t.image.name.length))}static factory(t){return t instanceof Xe?t:Xe.fromString(t)}toString(){return 0===this.sections.length?"":this.sections.map((t=>t.text)).join("")}serialize(){const t=["format"];for(const e of this.sections){if(e.image){t.push(["image",e.image.name]);continue}t.push(e.text);const i={};e.fontStack&&(i["text-font"]=["literal",e.fontStack.split(",")]),e.scale&&(i["font-scale"]=e.scale),e.textColor&&(i["text-color"]=["rgba"].concat(e.textColor.toArray())),t.push(i)}return t}}class Ye{constructor(t){this.name=t.name,this.available=t.available}toString(){return this.name}static fromString(t){return t?new Ye({name:t,available:!1}):null}serialize(){return["image",this.name]}}function Ke(t,e,i,n){return"number"==typeof t&&t>=0&&t<=255&&"number"==typeof e&&e>=0&&e<=255&&"number"==typeof i&&i>=0&&i<=255?void 0===n||"number"==typeof n&&n>=0&&n<=1?null:`Invalid rgba value [${[t,e,i,n].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${("number"==typeof n?[t,e,i,n]:[t,e,i]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function Je(t){if(null===t)return!0;if("string"==typeof t)return!0;if("boolean"==typeof t)return!0;if("number"==typeof t)return!0;if(t instanceof qe)return!0;if(t instanceof We)return!0;if(t instanceof Xe)return!0;if(t instanceof Ye)return!0;if(Array.isArray(t)){for(const e of t)if(!Je(e))return!1;return!0}if("object"==typeof t){for(const e in t)if(!Je(t[e]))return!1;return!0}return!1}function Qe(t){if(null===t)return Me;if("string"==typeof t)return Ie;if("boolean"==typeof t)return Pe;if("number"==typeof t)return ze;if(t instanceof qe)return Ae;if(t instanceof We)return Le;if(t instanceof Xe)return Re;if(t instanceof Ye)return Be;if(Array.isArray(t)){const e=t.length;let i;for(const e of t){const t=Qe(e);if(i){if(i===t)continue;i=Oe;break}i=t}return Fe(i||Oe,e)}return De}function ti(t){const e=typeof t;return null===t?"":"string"===e||"number"===e||"boolean"===e?String(t):t instanceof qe||t instanceof Xe||t instanceof Ye?t.toString():JSON.stringify(t)}class ei{constructor(t,e){this.type=t,this.value=e}static parse(t,e){if(2!==t.length)return e.error(`'literal' expression requires exactly one argument, but found ${t.length-1} instead.`);if(!Je(t[1]))return e.error("invalid value");const i=t[1];let n=Qe(i);const r=e.expectedType;return"array"!==n.kind||0!==n.N||!r||"array"!==r.kind||"number"==typeof r.N&&0!==r.N||(n=r),new ei(n,i)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}serialize(){return"array"===this.type.kind||"object"===this.type.kind?["literal",this.value]:this.value instanceof qe?["rgba"].concat(this.value.toArray()):this.value instanceof Xe?this.value.serialize():this.value}}class ii{constructor(t){this.name="ExpressionEvaluationError",this.message=t}toJSON(){return this.message}}const ni={string:Ie,number:ze,boolean:Pe,object:De};class ri{constructor(t,e){this.type=t,this.args=e}static parse(t,e){if(t.length<2)return e.error("Expected at least one argument.");let i,n=1;const r=t[0];if("array"===r){let r,o;if(t.length>2){const i=t[1];if("string"!=typeof i||!(i in ni)||"object"===i)return e.error('The item type argument of "array" must be one of string, number, boolean',1);r=ni[i],n++}else r=Oe;if(t.length>3){if(null!==t[2]&&("number"!=typeof t[2]||t[2]<0||t[2]!==Math.floor(t[2])))return e.error('The length argument to "array" must be a positive integer literal',2);o=t[2],n++}i=Fe(r,o)}else i=ni[r];const o=[];for(;nt.outputDefined()))}serialize(){const t=this.type,e=[t.kind];if("array"===t.kind){const i=t.itemType;if("string"===i.kind||"number"===i.kind||"boolean"===i.kind){e.push(i.kind);const n=t.N;("number"==typeof n||this.args.length>1)&&e.push(n)}}return e.concat(this.args.map((t=>t.serialize())))}}class oi{constructor(t){this.type=Re,this.sections=t}static parse(t,e){if(t.length<2)return e.error("Expected at least one argument.");const i=t[1];if(!Array.isArray(i)&&"object"==typeof i)return e.error("First argument must be an image or text section.");const n=[];let r=!1;for(let i=1;i<=t.length-1;++i){const o=t[i];if(r&&"object"==typeof o&&!Array.isArray(o)){r=!1;let t=null;if(o["font-scale"]&&(t=e.parse(o["font-scale"],1,ze),!t))return null;let i=null;if(o["text-font"]&&(i=e.parse(o["text-font"],1,Fe(Ie)),!i))return null;let a=null;if(o["text-color"]&&(a=e.parse(o["text-color"],1,Ae),!a))return null;const s=n[n.length-1];s.scale=t,s.font=i,s.textColor=a}else{const o=e.parse(t[i],1,Oe);if(!o)return null;const a=o.type.kind;if("string"!==a&&"value"!==a&&"null"!==a&&"resolvedImage"!==a)return e.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");r=!0,n.push({content:o,scale:null,font:null,textColor:null})}}return new oi(n)}evaluate(t){return new Xe(this.sections.map((e=>{const i=e.content.evaluate(t);return Qe(i)===Be?new He("",i,null,null,null):new He(ti(i),null,e.scale?e.scale.evaluate(t):null,e.font?e.font.evaluate(t).join(","):null,e.textColor?e.textColor.evaluate(t):null)})))}eachChild(t){for(const e of this.sections)t(e.content),e.scale&&t(e.scale),e.font&&t(e.font),e.textColor&&t(e.textColor)}outputDefined(){return!1}serialize(){const t=["format"];for(const e of this.sections){t.push(e.content.serialize());const i={};e.scale&&(i["font-scale"]=e.scale.serialize()),e.font&&(i["text-font"]=e.font.serialize()),e.textColor&&(i["text-color"]=e.textColor.serialize()),t.push(i)}return t}}class ai{constructor(t){this.type=Be,this.input=t}static parse(t,e){if(2!==t.length)return e.error("Expected two arguments.");const i=e.parse(t[1],1,Ie);return i?new ai(i):e.error("No image name provided.")}evaluate(t){const e=this.input.evaluate(t),i=Ye.fromString(e);return i&&t.availableImages&&(i.available=t.availableImages.indexOf(e)>-1),i}eachChild(t){t(this.input)}outputDefined(){return!1}serialize(){return["image",this.input.serialize()]}}const si={"to-boolean":Pe,"to-color":Ae,"to-number":ze,"to-string":Ie};class li{constructor(t,e){this.type=t,this.args=e}static parse(t,e){if(t.length<2)return e.error("Expected at least one argument.");const i=t[0];if(("to-boolean"===i||"to-string"===i)&&2!==t.length)return e.error("Expected one argument.");const n=si[i],r=[];for(let i=1;i4?`Invalid rbga value ${JSON.stringify(e)}: expected an array containing either three or four numeric values.`:Ke(e[0],e[1],e[2],e[3]),!i))return new qe(e[0]/255,e[1]/255,e[2]/255,e[3])}throw new ii(i||`Could not parse color from value '${"string"==typeof e?e:String(JSON.stringify(e))}'`)}if("number"===this.type.kind){let e=null;for(const i of this.args){if(e=i.evaluate(t),null===e)return 0;const n=Number(e);if(!isNaN(n))return n}throw new ii(`Could not convert ${JSON.stringify(e)} to number.`)}return"formatted"===this.type.kind?Xe.fromString(ti(this.args[0].evaluate(t))):"resolvedImage"===this.type.kind?Ye.fromString(ti(this.args[0].evaluate(t))):ti(this.args[0].evaluate(t))}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every((t=>t.outputDefined()))}serialize(){if("formatted"===this.type.kind)return new oi([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if("resolvedImage"===this.type.kind)return new ai(this.args[0]).serialize();const t=[`to-${this.type.kind}`];return this.eachChild((e=>{t.push(e.serialize())})),t}}const ci=["Unknown","Point","LineString","Polygon"];class ui{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null,this.featureTileCoord=null,this.featureDistanceData=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?"number"==typeof this.feature.type?ci[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}distanceFromCenter(){if(this.featureTileCoord&&this.featureDistanceData){const t=this.featureDistanceData.center,e=this.featureDistanceData.scale,{x:i,y:n}=this.featureTileCoord;return this.featureDistanceData.bearing[0]*(i*e-t[0])+this.featureDistanceData.bearing[1]*(n*e-t[1])}return 0}parseColor(t){let e=this._parseColorCache[t];return e||(e=this._parseColorCache[t]=qe.parse(t)),e}}class di{constructor(t,e,i,n){this.name=t,this.type=e,this._evaluate=i,this.args=n}evaluate(t){return this._evaluate(t,this.args)}eachChild(t){this.args.forEach(t)}outputDefined(){return!1}serialize(){return[this.name].concat(this.args.map((t=>t.serialize())))}static parse(t,e){const i=t[0],n=di.definitions[i];if(!n)return e.error(`Unknown expression "${i}". If you wanted a literal array, use ["literal", [...]].`,0);const r=Array.isArray(n)?n[0]:n.type,o=Array.isArray(n)?[[n[1],n[2]]]:n.overloads,a=o.filter((([e])=>!Array.isArray(e)||e.length===t.length-1));let s=null;for(const[n,o]of a){s=new Oi(e.registry,e.path,null,e.scope);const a=[];let l=!1;for(let e=1;e{return e=t,Array.isArray(e)?`(${e.map(je).join(", ")})`:`(${je(e.type)}...)`;var e})).join(" | "),n=[];for(let i=1;i=e[2]||t[1]<=e[1]||t[3]>=e[3])}function gi(t,e){const i=(180+t[0])/360,n=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t[1]*Math.PI/360)))/360,r=Math.pow(2,e.z);return[Math.round(i*r*pi),Math.round(n*r*pi)]}function vi(t,e,i){const n=t[0]-e[0],r=t[1]-e[1],o=t[0]-i[0],a=t[1]-i[1];return n*a-o*r==0&&n*o<=0&&r*a<=0}function yi(t,e){let i=!1;for(let a=0,s=e.length;a(n=t)[1]!=(o=s[e+1])[1]>n[1]&&n[0]<(o[0]-r[0])*(n[1]-r[1])/(o[1]-r[1])+r[0]&&(i=!i)}}var n,r,o;return i}function _i(t,e){for(let i=0;i0&&s<0||a<0&&s>0}function bi(t,e,i){for(const c of i)for(let i=0;ii[2]){const e=.5*n;let r=t[0]-i[0]>e?-n:i[0]-t[0]>e?n:0;0===r&&(r=t[0]-i[2]>e?-n:i[2]-t[0]>e?n:0),t[0]+=r}mi(e,t)}function Ci(t,e,i,n){const r=Math.pow(2,n.z)*pi,o=[n.x*pi,n.y*pi],a=[];for(const n of t)for(const t of n){const n=[t.x+o[0],t.y+o[1]];Si(n,e,i,r),a.push(n)}return a}function Mi(t,e,i,n){const r=Math.pow(2,n.z)*pi,o=[n.x*pi,n.y*pi],a=[];for(const i of t){const t=[];for(const n of i){const i=[n.x+o[0],n.y+o[1]];mi(e,i),t.push(i)}a.push(t)}if(e[2]-e[0]<=r/2){(s=e)[0]=s[1]=1/0,s[2]=s[3]=-1/0;for(const t of a)for(const n of t)Si(n,e,i,r)}var s;return a}class zi{constructor(t,e){this.type=Pe,this.geojson=t,this.geometries=e}static parse(t,e){if(2!==t.length)return e.error(`'within' expression requires exactly one argument, but found ${t.length-1} instead.`);if(Je(t[1])){const e=t[1];if("FeatureCollection"===e.type)for(let t=0;t{e&&!Ii(t)&&(e=!1)})),e}function Pi(t){if(t instanceof di&&"feature-state"===t.name)return!1;let e=!0;return t.eachChild((t=>{e&&!Pi(t)&&(e=!1)})),e}function Ai(t,e){if(t instanceof di&&e.indexOf(t.name)>=0)return!1;let i=!0;return t.eachChild((t=>{i&&!Ai(t,e)&&(i=!1)})),i}class Di{constructor(t,e){this.type=e.type,this.name=t,this.boundExpression=e}static parse(t,e){if(2!==t.length||"string"!=typeof t[1])return e.error("'var' expression requires exactly one string literal argument.");const i=t[1];return e.scope.has(i)?new Di(i,e.scope.get(i)):e.error(`Unknown variable "${i}". Make sure "${i}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(t){return this.boundExpression.evaluate(t)}eachChild(){}outputDefined(){return!1}serialize(){return["var",this.name]}}class Oi{constructor(t,e=[],i,n=new Ce,r=[]){this.registry=t,this.path=e,this.key=e.map((t=>`[${t}]`)).join(""),this.scope=n,this.errors=r,this.expectedType=i}parse(t,e,i,n,r={}){return e?this.concat(e,i,n)._parse(t,r):this._parse(t,r)}_parse(t,e){function i(t,e,i){return"assert"===i?new ri(e,[t]):"coerce"===i?new li(e,[t]):t}if(null!==t&&"string"!=typeof t&&"boolean"!=typeof t&&"number"!=typeof t||(t=["literal",t]),Array.isArray(t)){if(0===t.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const n=t[0];if("string"!=typeof n)return this.error(`Expression name must be a string, but found ${typeof n} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const r=this.registry[n];if(r){let n=r.parse(t,this);if(!n)return null;if(this.expectedType){const t=this.expectedType,r=n.type;if("string"!==t.kind&&"number"!==t.kind&&"boolean"!==t.kind&&"object"!==t.kind&&"array"!==t.kind||"value"!==r.kind)if("color"!==t.kind&&"formatted"!==t.kind&&"resolvedImage"!==t.kind||"value"!==r.kind&&"string"!==r.kind){if(this.checkSubtype(t,r))return null}else n=i(n,t,e.typeAnnotation||"coerce");else n=i(n,t,e.typeAnnotation||"assert")}if(!(n instanceof ei)&&"resolvedImage"!==n.type.kind&&Li(n)){const e=new ui;try{n=new ei(n.type,n.evaluate(e))}catch(t){return this.error(t.message),null}}return n}return this.error(`Unknown expression "${n}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(void 0===t?"'undefined' value invalid. Use null instead.":"object"==typeof t?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof t} instead.`)}concat(t,e,i){const n="number"==typeof t?this.path.concat(t):this.path,r=i?this.scope.concat(i):this.scope;return new Oi(this.registry,n,e||null,r,this.errors)}error(t,...e){const i=`${this.key}${e.map((t=>`[${t}]`)).join("")}`;this.errors.push(new Se(i,t))}checkSubtype(t,e){const i=Ve(t,e);return i&&this.error(i),i}}function Li(t){if(t instanceof Di)return Li(t.boundExpression);if(t instanceof di&&"error"===t.name)return!1;if(t instanceof hi)return!1;if(t instanceof zi)return!1;const e=t instanceof li||t instanceof ri;let i=!0;return t.eachChild((t=>{i=e?i&&Li(t):i&&t instanceof ei})),!!i&&Ii(t)&&Ai(t,["zoom","heatmap-density","line-progress","sky-radial-progress","accumulated","is-supported-script","pitch","distance-from-center"])}function Ri(t,e){const i=t.length-1;let n,r,o=0,a=i,s=0;for(;o<=a;)if(s=Math.floor((o+a)/2),n=t[s],r=t[s+1],n<=e){if(s===i||ee))throw new ii("Input is not a number.");a=s-1}return 0}class Bi{constructor(t,e,i){this.type=t,this.input=e,this.labels=[],this.outputs=[];for(const[t,e]of i)this.labels.push(t),this.outputs.push(e)}static parse(t,e){if(t.length-1<4)return e.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");const i=e.parse(t[1],1,ze);if(!i)return null;const n=[];let r=null;e.expectedType&&"value"!==e.expectedType.kind&&(r=e.expectedType);for(let i=1;i=o)return e.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',s);const c=e.parse(a,l,r);if(!c)return null;r=r||c.type,n.push([o,c])}return new Bi(r,i,n)}evaluate(t){const e=this.labels,i=this.outputs;if(1===e.length)return i[0].evaluate(t);const n=this.input.evaluate(t);if(n<=e[0])return i[0].evaluate(t);const r=e.length;return n>=e[r-1]?i[r-1].evaluate(t):i[Ri(e,n)].evaluate(t)}eachChild(t){t(this.input);for(const e of this.outputs)t(e)}outputDefined(){return this.outputs.every((t=>t.outputDefined()))}serialize(){const t=["step",this.input.serialize()];for(let e=0;e0&&t.push(this.labels[e]),t.push(this.outputs[e].serialize());return t}}function Fi(t,e,i){return t*(1-i)+e*i}var ji=Object.freeze({__proto__:null,number:Fi,color:function(t,e,i){return new qe(Fi(t.r,e.r,i),Fi(t.g,e.g,i),Fi(t.b,e.b,i),Fi(t.a,e.a,i))},array:function(t,e,i){return t.map(((t,n)=>Fi(t,e[n],i)))}});const Ni=.95047,Vi=1.08883,Ui=4/29,Zi=6/29,$i=3*Zi*Zi,Gi=Math.PI/180,qi=180/Math.PI;function Wi(t){return t>.008856451679035631?Math.pow(t,1/3):t/$i+Ui}function Hi(t){return t>Zi?t*t*t:$i*(t-Ui)}function Xi(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Yi(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Ki(t){const e=Yi(t.r),i=Yi(t.g),n=Yi(t.b),r=Wi((.4124564*e+.3575761*i+.1804375*n)/Ni),o=Wi((.2126729*e+.7151522*i+.072175*n)/1);return{l:116*o-16,a:500*(r-o),b:200*(o-Wi((.0193339*e+.119192*i+.9503041*n)/Vi)),alpha:t.a}}function Ji(t){let e=(t.l+16)/116,i=isNaN(t.a)?e:e+t.a/500,n=isNaN(t.b)?e:e-t.b/200;return e=1*Hi(e),i=Ni*Hi(i),n=Vi*Hi(n),new qe(Xi(3.2404542*i-1.5371385*e-.4985314*n),Xi(-.969266*i+1.8760108*e+.041556*n),Xi(.0556434*i-.2040259*e+1.0572252*n),t.alpha)}function Qi(t,e,i){const n=e-t;return t+i*(n>180||n<-180?n-360*Math.round(n/360):n)}const tn={forward:Ki,reverse:Ji,interpolate:function(t,e,i){return{l:Fi(t.l,e.l,i),a:Fi(t.a,e.a,i),b:Fi(t.b,e.b,i),alpha:Fi(t.alpha,e.alpha,i)}}},en={forward:function(t){const{l:e,a:i,b:n}=Ki(t),r=Math.atan2(n,i)*qi;return{h:r<0?r+360:r,c:Math.sqrt(i*i+n*n),l:e,alpha:t.a}},reverse:function(t){const e=t.h*Gi,i=t.c;return Ji({l:t.l,a:Math.cos(e)*i,b:Math.sin(e)*i,alpha:t.alpha})},interpolate:function(t,e,i){return{h:Qi(t.h,e.h,i),c:Fi(t.c,e.c,i),l:Fi(t.l,e.l,i),alpha:Fi(t.alpha,e.alpha,i)}}};var nn=Object.freeze({__proto__:null,lab:tn,hcl:en});class rn{constructor(t,e,i,n,r){this.type=t,this.operator=e,this.interpolation=i,this.input=n,this.labels=[],this.outputs=[];for(const[t,e]of r)this.labels.push(t),this.outputs.push(e)}static interpolationFactor(t,e,n,r){let o=0;if("exponential"===t.name)o=on(e,t.base,n,r);else if("linear"===t.name)o=on(e,1,n,r);else if("cubic-bezier"===t.name){const a=t.controlPoints;o=new i(a[0],a[1],a[2],a[3]).solve(on(e,1,n,r))}return o}static parse(t,e){let[i,n,r,...o]=t;if(!Array.isArray(n)||0===n.length)return e.error("Expected an interpolation type expression.",1);if("linear"===n[0])n={name:"linear"};else if("exponential"===n[0]){const t=n[1];if("number"!=typeof t)return e.error("Exponential interpolation requires a numeric base.",1,1);n={name:"exponential",base:t}}else{if("cubic-bezier"!==n[0])return e.error(`Unknown interpolation type ${String(n[0])}`,1,0);{const t=n.slice(1);if(4!==t.length||t.some((t=>"number"!=typeof t||t<0||t>1)))return e.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);n={name:"cubic-bezier",controlPoints:t}}}if(t.length-1<4)return e.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");if(r=e.parse(r,2,ze),!r)return null;const a=[];let s=null;"interpolate-hcl"===i||"interpolate-lab"===i?s=Ae:e.expectedType&&"value"!==e.expectedType.kind&&(s=e.expectedType);for(let t=0;t=i)return e.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',r);const c=e.parse(n,l,s);if(!c)return null;s=s||c.type,a.push([i,c])}return"number"===s.kind||"color"===s.kind||"array"===s.kind&&"number"===s.itemType.kind&&"number"==typeof s.N?new rn(s,i,n,r,a):e.error(`Type ${je(s)} is not interpolatable.`)}evaluate(t){const e=this.labels,i=this.outputs;if(1===e.length)return i[0].evaluate(t);const n=this.input.evaluate(t);if(n<=e[0])return i[0].evaluate(t);const r=e.length;if(n>=e[r-1])return i[r-1].evaluate(t);const o=Ri(e,n),a=rn.interpolationFactor(this.interpolation,n,e[o],e[o+1]),s=i[o].evaluate(t),l=i[o+1].evaluate(t);return"interpolate"===this.operator?ji[this.type.kind.toLowerCase()](s,l,a):"interpolate-hcl"===this.operator?en.reverse(en.interpolate(en.forward(s),en.forward(l),a)):tn.reverse(tn.interpolate(tn.forward(s),tn.forward(l),a))}eachChild(t){t(this.input);for(const e of this.outputs)t(e)}outputDefined(){return this.outputs.every((t=>t.outputDefined()))}serialize(){let t;t="linear"===this.interpolation.name?["linear"]:"exponential"===this.interpolation.name?1===this.interpolation.base?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints);const e=[this.operator,t,this.input.serialize()];for(let t=0;tVe(n,t.type)));return new an(o?Oe:i,r)}evaluate(t){let e,i=null,n=0;for(const r of this.args){if(n++,i=r.evaluate(t),i&&i instanceof Ye&&!i.available&&(e||(e=i),i=null,n===this.args.length))return e;if(null!==i)break}return i}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every((t=>t.outputDefined()))}serialize(){const t=["coalesce"];return this.eachChild((e=>{t.push(e.serialize())})),t}}class sn{constructor(t,e){this.type=e.type,this.bindings=[].concat(t),this.result=e}evaluate(t){return this.result.evaluate(t)}eachChild(t){for(const e of this.bindings)t(e[1]);t(this.result)}static parse(t,e){if(t.length<4)return e.error(`Expected at least 3 arguments, but found ${t.length-1} instead.`);const i=[];for(let n=1;n=i.length)throw new ii(`Array index out of bounds: ${e} > ${i.length-1}.`);if(e!==Math.floor(e))throw new ii(`Array index must be an integer, but found ${e} instead.`);return i[e]}eachChild(t){t(this.index),t(this.input)}outputDefined(){return!1}serialize(){return["at",this.index.serialize(),this.input.serialize()]}}class cn{constructor(t,e){this.type=Pe,this.needle=t,this.haystack=e}static parse(t,e){if(3!==t.length)return e.error(`Expected 2 arguments, but found ${t.length-1} instead.`);const i=e.parse(t[1],1,Oe),n=e.parse(t[2],2,Oe);return i&&n?Ue(i.type,[Pe,Ie,ze,Me,Oe])?new cn(i,n):e.error(`Expected first argument to be of type boolean, string, number or null, but found ${je(i.type)} instead`):null}evaluate(t){const e=this.needle.evaluate(t),i=this.haystack.evaluate(t);if(!i)return!1;if(!Ze(e,["boolean","string","number","null"]))throw new ii(`Expected first argument to be of type boolean, string, number or null, but found ${je(Qe(e))} instead.`);if(!Ze(i,["string","array"]))throw new ii(`Expected second argument to be of type array or string, but found ${je(Qe(i))} instead.`);return i.indexOf(e)>=0}eachChild(t){t(this.needle),t(this.haystack)}outputDefined(){return!0}serialize(){return["in",this.needle.serialize(),this.haystack.serialize()]}}class un{constructor(t,e,i){this.type=ze,this.needle=t,this.haystack=e,this.fromIndex=i}static parse(t,e){if(t.length<=2||t.length>=5)return e.error(`Expected 3 or 4 arguments, but found ${t.length-1} instead.`);const i=e.parse(t[1],1,Oe),n=e.parse(t[2],2,Oe);if(!i||!n)return null;if(!Ue(i.type,[Pe,Ie,ze,Me,Oe]))return e.error(`Expected first argument to be of type boolean, string, number or null, but found ${je(i.type)} instead`);if(4===t.length){const r=e.parse(t[3],3,ze);return r?new un(i,n,r):null}return new un(i,n)}evaluate(t){const e=this.needle.evaluate(t),i=this.haystack.evaluate(t);if(!Ze(e,["boolean","string","number","null"]))throw new ii(`Expected first argument to be of type boolean, string, number or null, but found ${je(Qe(e))} instead.`);if(!Ze(i,["string","array"]))throw new ii(`Expected second argument to be of type array or string, but found ${je(Qe(i))} instead.`);if(this.fromIndex){const n=this.fromIndex.evaluate(t);return i.indexOf(e,n)}return i.indexOf(e)}eachChild(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)}outputDefined(){return!1}serialize(){if(null!=this.fromIndex&&void 0!==this.fromIndex){const t=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),t]}return["index-of",this.needle.serialize(),this.haystack.serialize()]}}class dn{constructor(t,e,i,n,r,o){this.inputType=t,this.type=e,this.input=i,this.cases=n,this.outputs=r,this.otherwise=o}static parse(t,e){if(t.length<5)return e.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if(t.length%2!=1)return e.error("Expected an even number of arguments.");let i,n;e.expectedType&&"value"!==e.expectedType.kind&&(n=e.expectedType);const r={},o=[];for(let a=2;aNumber.MAX_SAFE_INTEGER)return c.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if("number"==typeof t&&Math.floor(t)!==t)return c.error("Numeric branch labels must be integer values.");if(i){if(c.checkSubtype(i,Qe(t)))return null}else i=Qe(t);if(void 0!==r[String(t)])return c.error("Branch labels must be unique.");r[String(t)]=o.length}const u=e.parse(l,a,n);if(!u)return null;n=n||u.type,o.push(u)}const a=e.parse(t[1],1,Oe);if(!a)return null;const s=e.parse(t[t.length-1],t.length-1,n);return s?"value"!==a.type.kind&&e.concat(1).checkSubtype(i,a.type)?null:new dn(i,n,a,r,o,s):null}evaluate(t){const e=this.input.evaluate(t);return(Qe(e)===this.inputType&&this.outputs[this.cases[e]]||this.otherwise).evaluate(t)}eachChild(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)}outputDefined(){return this.outputs.every((t=>t.outputDefined()))&&this.otherwise.outputDefined()}serialize(){const t=["match",this.input.serialize()],e=Object.keys(this.cases).sort(),i=[],n={};for(const t of e){const e=n[this.cases[t]];void 0===e?(n[this.cases[t]]=i.length,i.push([this.cases[t],[t]])):i[e][1].push(t)}const r=t=>"number"===this.inputType.kind?Number(t):t;for(const[e,n]of i)t.push(1===n.length?r(n[0]):n.map(r)),t.push(this.outputs[e].serialize());return t.push(this.otherwise.serialize()),t}}class hn{constructor(t,e,i){this.type=t,this.branches=e,this.otherwise=i}static parse(t,e){if(t.length<4)return e.error(`Expected at least 3 arguments, but found only ${t.length-1}.`);if(t.length%2!=0)return e.error("Expected an odd number of arguments.");let i;e.expectedType&&"value"!==e.expectedType.kind&&(i=e.expectedType);const n=[];for(let r=1;re.outputDefined()))&&this.otherwise.outputDefined()}serialize(){const t=["case"];return this.eachChild((e=>{t.push(e.serialize())})),t}}class pn{constructor(t,e,i,n){this.type=t,this.input=e,this.beginIndex=i,this.endIndex=n}static parse(t,e){if(t.length<=2||t.length>=5)return e.error(`Expected 3 or 4 arguments, but found ${t.length-1} instead.`);const i=e.parse(t[1],1,Oe),n=e.parse(t[2],2,ze);if(!i||!n)return null;if(!Ue(i.type,[Fe(Oe),Ie,Oe]))return e.error(`Expected first argument to be of type array or string, but found ${je(i.type)} instead`);if(4===t.length){const r=e.parse(t[3],3,ze);return r?new pn(i.type,i,n,r):null}return new pn(i.type,i,n)}evaluate(t){const e=this.input.evaluate(t),i=this.beginIndex.evaluate(t);if(!Ze(e,["string","array"]))throw new ii(`Expected first argument to be of type array or string, but found ${je(Qe(e))} instead.`);if(this.endIndex){const n=this.endIndex.evaluate(t);return e.slice(i,n)}return e.slice(i)}eachChild(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)}outputDefined(){return!1}serialize(){if(null!=this.endIndex&&void 0!==this.endIndex){const t=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),t]}return["slice",this.input.serialize(),this.beginIndex.serialize()]}}function mn(t,e){return"=="===t||"!="===t?"boolean"===e.kind||"string"===e.kind||"number"===e.kind||"null"===e.kind||"value"===e.kind:"string"===e.kind||"number"===e.kind||"value"===e.kind}function fn(t,e,i,n){return 0===n.compare(e,i)}function gn(t,e,i){const n="=="!==t&&"!="!==t;return class r{constructor(t,e,i){this.type=Pe,this.lhs=t,this.rhs=e,this.collator=i,this.hasUntypedArgument="value"===t.type.kind||"value"===e.type.kind}static parse(t,e){if(3!==t.length&&4!==t.length)return e.error("Expected two or three arguments.");const i=t[0];let o=e.parse(t[1],1,Oe);if(!o)return null;if(!mn(i,o.type))return e.concat(1).error(`"${i}" comparisons are not supported for type '${je(o.type)}'.`);let a=e.parse(t[2],2,Oe);if(!a)return null;if(!mn(i,a.type))return e.concat(2).error(`"${i}" comparisons are not supported for type '${je(a.type)}'.`);if(o.type.kind!==a.type.kind&&"value"!==o.type.kind&&"value"!==a.type.kind)return e.error(`Cannot compare types '${je(o.type)}' and '${je(a.type)}'.`);n&&("value"===o.type.kind&&"value"!==a.type.kind?o=new ri(a.type,[o]):"value"!==o.type.kind&&"value"===a.type.kind&&(a=new ri(o.type,[a])));let s=null;if(4===t.length){if("string"!==o.type.kind&&"string"!==a.type.kind&&"value"!==o.type.kind&&"value"!==a.type.kind)return e.error("Cannot use collator to compare non-string types.");if(s=e.parse(t[3],3,Le),!s)return null}return new r(o,a,s)}evaluate(r){const o=this.lhs.evaluate(r),a=this.rhs.evaluate(r);if(n&&this.hasUntypedArgument){const e=Qe(o),i=Qe(a);if(e.kind!==i.kind||"string"!==e.kind&&"number"!==e.kind)throw new ii(`Expected arguments for "${t}" to be (string, string) or (number, number), but found (${e.kind}, ${i.kind}) instead.`)}if(this.collator&&!n&&this.hasUntypedArgument){const t=Qe(o),i=Qe(a);if("string"!==t.kind||"string"!==i.kind)return e(r,o,a)}return this.collator?i(r,o,a,this.collator.evaluate(r)):e(r,o,a)}eachChild(t){t(this.lhs),t(this.rhs),this.collator&&t(this.collator)}outputDefined(){return!0}serialize(){const e=[t];return this.eachChild((t=>{e.push(t.serialize())})),e}}}const vn=gn("==",(function(t,e,i){return e===i}),fn),yn=gn("!=",(function(t,e,i){return e!==i}),(function(t,e,i,n){return!fn(0,e,i,n)})),_n=gn("<",(function(t,e,i){return e",(function(t,e,i){return e>i}),(function(t,e,i,n){return n.compare(e,i)>0})),bn=gn("<=",(function(t,e,i){return e<=i}),(function(t,e,i,n){return n.compare(e,i)<=0})),wn=gn(">=",(function(t,e,i){return e>=i}),(function(t,e,i,n){return n.compare(e,i)>=0}));class kn{constructor(t,e,i,n,r){this.type=Ie,this.number=t,this.locale=e,this.currency=i,this.minFractionDigits=n,this.maxFractionDigits=r}static parse(t,e){if(3!==t.length)return e.error("Expected two arguments.");const i=e.parse(t[1],1,ze);if(!i)return null;const n=t[2];if("object"!=typeof n||Array.isArray(n))return e.error("NumberFormat options argument must be an object.");let r=null;if(n.locale&&(r=e.parse(n.locale,1,Ie),!r))return null;let o=null;if(n.currency&&(o=e.parse(n.currency,1,Ie),!o))return null;let a=null;if(n["min-fraction-digits"]&&(a=e.parse(n["min-fraction-digits"],1,ze),!a))return null;let s=null;return n["max-fraction-digits"]&&(s=e.parse(n["max-fraction-digits"],1,ze),!s)?null:new kn(i,r,o,a,s)}evaluate(t){return new Intl.NumberFormat(this.locale?this.locale.evaluate(t):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(t):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(t):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(t):void 0}).format(this.number.evaluate(t))}eachChild(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)}outputDefined(){return!1}serialize(){const t={};return this.locale&&(t.locale=this.locale.serialize()),this.currency&&(t.currency=this.currency.serialize()),this.minFractionDigits&&(t["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(t["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),t]}}class En{constructor(t){this.type=ze,this.input=t}static parse(t,e){if(2!==t.length)return e.error(`Expected 1 argument, but found ${t.length-1} instead.`);const i=e.parse(t[1],1);return i?"array"!==i.type.kind&&"string"!==i.type.kind&&"value"!==i.type.kind?e.error(`Expected argument of type string or array, but found ${je(i.type)} instead.`):new En(i):null}evaluate(t){const e=this.input.evaluate(t);if("string"==typeof e)return e.length;if(Array.isArray(e))return e.length;throw new ii(`Expected value to be of type string or array, but found ${je(Qe(e))} instead.`)}eachChild(t){t(this.input)}outputDefined(){return!1}serialize(){const t=["length"];return this.eachChild((e=>{t.push(e.serialize())})),t}}const Tn={"==":vn,"!=":yn,">":xn,"<":_n,">=":wn,"<=":bn,array:ri,at:ln,boolean:ri,case:hn,coalesce:an,collator:hi,format:oi,image:ai,in:cn,"index-of":un,interpolate:rn,"interpolate-hcl":rn,"interpolate-lab":rn,length:En,let:sn,literal:ei,match:dn,number:ri,"number-format":kn,object:ri,slice:pn,step:Bi,string:ri,"to-boolean":li,"to-color":li,"to-number":li,"to-string":li,var:Di,within:zi};function Sn(t,[e,i,n,r]){e=e.evaluate(t),i=i.evaluate(t),n=n.evaluate(t);const o=r?r.evaluate(t):1,a=Ke(e,i,n,o);if(a)throw new ii(a);return new qe(e/255*o,i/255*o,n/255*o,o)}function Cn(t,e){return t in e}function Mn(t,e){const i=e[t];return void 0===i?null:i}function zn(t){return{type:t}}function In(t){return{result:"success",value:t}}function Pn(t){return{result:"error",value:t}}function An(t){return"data-driven"===t["property-type"]||"cross-faded-data-driven"===t["property-type"]}function Dn(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}function On(t){return!!t.expression&&t.expression.interpolated}function Ln(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":typeof t}function Rn(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}function Bn(t){return t}function Fn(t,e){const i="color"===e.type,n=t.stops&&"object"==typeof t.stops[0][0],r=n||!(n||void 0!==t.property),o=t.type||(On(e)?"exponential":"interval");if(i&&((t=ke({},t)).stops&&(t.stops=t.stops.map((t=>[t[0],qe.parse(t[1])]))),t.default=qe.parse(t.default?t.default:e.default)),t.colorSpace&&"rgb"!==t.colorSpace&&!nn[t.colorSpace])throw new Error(`Unknown color space: ${t.colorSpace}`);let a,s,l;if("exponential"===o)a=Un;else if("interval"===o)a=Vn;else if("categorical"===o){a=Nn,s=Object.create(null);for(const e of t.stops)s[e[0]]=e[1];l=typeof t.stops[0][0]}else{if("identity"!==o)throw new Error(`Unknown function type "${o}"`);a=Zn}if(n){const i={},n=[];for(let e=0;et[0])),evaluate:({zoom:i},n)=>Un({stops:r,base:t.base},e,i).evaluate(i,n)}}if(r){const i="exponential"===o?{name:"exponential",base:void 0!==t.base?t.base:1}:null;return{kind:"camera",interpolationType:i,interpolationFactor:rn.interpolationFactor.bind(void 0,i),zoomStops:t.stops.map((t=>t[0])),evaluate:({zoom:i})=>a(t,e,i,s,l)}}return{kind:"source",evaluate(i,n){const r=n&&n.properties?n.properties[t.property]:void 0;return void 0===r?jn(t.default,e.default):a(t,e,r,s,l)}}}function jn(t,e,i){return void 0!==t?t:void 0!==e?e:void 0!==i?i:void 0}function Nn(t,e,i,n,r){return jn(typeof i===r?n[i]:void 0,t.default,e.default)}function Vn(t,e,i){if("number"!==Ln(i))return jn(t.default,e.default);const n=t.stops.length;if(1===n)return t.stops[0][1];if(i<=t.stops[0][0])return t.stops[0][1];if(i>=t.stops[n-1][0])return t.stops[n-1][1];const r=Ri(t.stops.map((t=>t[0])),i);return t.stops[r][1]}function Un(t,e,i){const n=void 0!==t.base?t.base:1;if("number"!==Ln(i))return jn(t.default,e.default);const r=t.stops.length;if(1===r)return t.stops[0][1];if(i<=t.stops[0][0])return t.stops[0][1];if(i>=t.stops[r-1][0])return t.stops[r-1][1];const o=Ri(t.stops.map((t=>t[0])),i),a=function(t,e,i,n){const r=n-i,o=t-i;return 0===r?0:1===e?o/r:(Math.pow(e,o)-1)/(Math.pow(e,r)-1)}(i,n,t.stops[o][0],t.stops[o+1][0]),s=t.stops[o][1],l=t.stops[o+1][1];let c=ji[e.type]||Bn;if(t.colorSpace&&"rgb"!==t.colorSpace){const e=nn[t.colorSpace];c=(t,i)=>e.reverse(e.interpolate(e.forward(t),e.forward(i),a))}return"function"==typeof s.evaluate?{evaluate(...t){const e=s.evaluate.apply(void 0,t),i=l.evaluate.apply(void 0,t);if(void 0!==e&&void 0!==i)return c(e,i,a)}}:c(s,l,a)}function Zn(t,e,i){return"color"===e.type?i=qe.parse(i):"formatted"===e.type?i=Xe.fromString(i.toString()):"resolvedImage"===e.type?i=Ye.fromString(i.toString()):Ln(i)===e.type||"enum"===e.type&&e.values[i]||(i=void 0),jn(i,t.default,e.default)}di.register(Tn,{error:[{kind:"error"},[Ie],(t,[e])=>{throw new ii(e.evaluate(t))}],typeof:[Ie,[Oe],(t,[e])=>je(Qe(e.evaluate(t)))],"to-rgba":[Fe(ze,4),[Ae],(t,[e])=>e.evaluate(t).toArray()],rgb:[Ae,[ze,ze,ze],Sn],rgba:[Ae,[ze,ze,ze,ze],Sn],has:{type:Pe,overloads:[[[Ie],(t,[e])=>Cn(e.evaluate(t),t.properties())],[[Ie,De],(t,[e,i])=>Cn(e.evaluate(t),i.evaluate(t))]]},get:{type:Oe,overloads:[[[Ie],(t,[e])=>Mn(e.evaluate(t),t.properties())],[[Ie,De],(t,[e,i])=>Mn(e.evaluate(t),i.evaluate(t))]]},"feature-state":[Oe,[Ie],(t,[e])=>Mn(e.evaluate(t),t.featureState||{})],properties:[De,[],t=>t.properties()],"geometry-type":[Ie,[],t=>t.geometryType()],id:[Oe,[],t=>t.id()],zoom:[ze,[],t=>t.globals.zoom],pitch:[ze,[],t=>t.globals.pitch||0],"distance-from-center":[ze,[],t=>t.distanceFromCenter()],"heatmap-density":[ze,[],t=>t.globals.heatmapDensity||0],"line-progress":[ze,[],t=>t.globals.lineProgress||0],"sky-radial-progress":[ze,[],t=>t.globals.skyRadialProgress||0],accumulated:[Oe,[],t=>void 0===t.globals.accumulated?null:t.globals.accumulated],"+":[ze,zn(ze),(t,e)=>{let i=0;for(const n of e)i+=n.evaluate(t);return i}],"*":[ze,zn(ze),(t,e)=>{let i=1;for(const n of e)i*=n.evaluate(t);return i}],"-":{type:ze,overloads:[[[ze,ze],(t,[e,i])=>e.evaluate(t)-i.evaluate(t)],[[ze],(t,[e])=>-e.evaluate(t)]]},"/":[ze,[ze,ze],(t,[e,i])=>e.evaluate(t)/i.evaluate(t)],"%":[ze,[ze,ze],(t,[e,i])=>e.evaluate(t)%i.evaluate(t)],ln2:[ze,[],()=>Math.LN2],pi:[ze,[],()=>Math.PI],e:[ze,[],()=>Math.E],"^":[ze,[ze,ze],(t,[e,i])=>Math.pow(e.evaluate(t),i.evaluate(t))],sqrt:[ze,[ze],(t,[e])=>Math.sqrt(e.evaluate(t))],log10:[ze,[ze],(t,[e])=>Math.log(e.evaluate(t))/Math.LN10],ln:[ze,[ze],(t,[e])=>Math.log(e.evaluate(t))],log2:[ze,[ze],(t,[e])=>Math.log(e.evaluate(t))/Math.LN2],sin:[ze,[ze],(t,[e])=>Math.sin(e.evaluate(t))],cos:[ze,[ze],(t,[e])=>Math.cos(e.evaluate(t))],tan:[ze,[ze],(t,[e])=>Math.tan(e.evaluate(t))],asin:[ze,[ze],(t,[e])=>Math.asin(e.evaluate(t))],acos:[ze,[ze],(t,[e])=>Math.acos(e.evaluate(t))],atan:[ze,[ze],(t,[e])=>Math.atan(e.evaluate(t))],min:[ze,zn(ze),(t,e)=>Math.min(...e.map((e=>e.evaluate(t))))],max:[ze,zn(ze),(t,e)=>Math.max(...e.map((e=>e.evaluate(t))))],abs:[ze,[ze],(t,[e])=>Math.abs(e.evaluate(t))],round:[ze,[ze],(t,[e])=>{const i=e.evaluate(t);return i<0?-Math.round(-i):Math.round(i)}],floor:[ze,[ze],(t,[e])=>Math.floor(e.evaluate(t))],ceil:[ze,[ze],(t,[e])=>Math.ceil(e.evaluate(t))],"filter-==":[Pe,[Ie,Oe],(t,[e,i])=>t.properties()[e.value]===i.value],"filter-id-==":[Pe,[Oe],(t,[e])=>t.id()===e.value],"filter-type-==":[Pe,[Ie],(t,[e])=>t.geometryType()===e.value],"filter-<":[Pe,[Ie,Oe],(t,[e,i])=>{const n=t.properties()[e.value],r=i.value;return typeof n==typeof r&&n{const i=t.id(),n=e.value;return typeof i==typeof n&&i":[Pe,[Ie,Oe],(t,[e,i])=>{const n=t.properties()[e.value],r=i.value;return typeof n==typeof r&&n>r}],"filter-id->":[Pe,[Oe],(t,[e])=>{const i=t.id(),n=e.value;return typeof i==typeof n&&i>n}],"filter-<=":[Pe,[Ie,Oe],(t,[e,i])=>{const n=t.properties()[e.value],r=i.value;return typeof n==typeof r&&n<=r}],"filter-id-<=":[Pe,[Oe],(t,[e])=>{const i=t.id(),n=e.value;return typeof i==typeof n&&i<=n}],"filter->=":[Pe,[Ie,Oe],(t,[e,i])=>{const n=t.properties()[e.value],r=i.value;return typeof n==typeof r&&n>=r}],"filter-id->=":[Pe,[Oe],(t,[e])=>{const i=t.id(),n=e.value;return typeof i==typeof n&&i>=n}],"filter-has":[Pe,[Oe],(t,[e])=>e.value in t.properties()],"filter-has-id":[Pe,[],t=>null!==t.id()&&void 0!==t.id()],"filter-type-in":[Pe,[Fe(Ie)],(t,[e])=>e.value.indexOf(t.geometryType())>=0],"filter-id-in":[Pe,[Fe(Oe)],(t,[e])=>e.value.indexOf(t.id())>=0],"filter-in-small":[Pe,[Ie,Fe(Oe)],(t,[e,i])=>i.value.indexOf(t.properties()[e.value])>=0],"filter-in-large":[Pe,[Ie,Fe(Oe)],(t,[e,i])=>function(t,e,i,n){for(;i<=n;){const r=i+n>>1;if(e[r]===t)return!0;e[r]>t?n=r-1:i=r+1}return!1}(t.properties()[e.value],i.value,0,i.value.length-1)],all:{type:Pe,overloads:[[[Pe,Pe],(t,[e,i])=>e.evaluate(t)&&i.evaluate(t)],[zn(Pe),(t,e)=>{for(const i of e)if(!i.evaluate(t))return!1;return!0}]]},any:{type:Pe,overloads:[[[Pe,Pe],(t,[e,i])=>e.evaluate(t)||i.evaluate(t)],[zn(Pe),(t,e)=>{for(const i of e)if(i.evaluate(t))return!0;return!1}]]},"!":[Pe,[Pe],(t,[e])=>!e.evaluate(t)],"is-supported-script":[Pe,[Ie],(t,[e])=>{const i=t.globals&&t.globals.isSupportedScript;return!i||i(e.evaluate(t))}],upcase:[Ie,[Ie],(t,[e])=>e.evaluate(t).toUpperCase()],downcase:[Ie,[Ie],(t,[e])=>e.evaluate(t).toLowerCase()],concat:[Ie,zn(Oe),(t,e)=>e.map((e=>ti(e.evaluate(t)))).join("")],"resolved-locale":[Ie,[Le],(t,[e])=>e.evaluate(t).resolvedLocale()]});class $n{constructor(t,e){this.expression=t,this._warningHistory={},this._evaluator=new ui,this._defaultValue=e?function(t){return"color"===t.type&&Rn(t.default)?new qe(0,0,0,0):"color"===t.type?qe.parse(t.default)||null:void 0===t.default?null:t.default}(e):null,this._enumValues=e&&"enum"===e.type?e.values:null}evaluateWithoutErrorHandling(t,e,i,n,r,o,a,s){return this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=i,this._evaluator.canonical=n,this._evaluator.availableImages=r||null,this._evaluator.formattedSection=o,this._evaluator.featureTileCoord=a||null,this._evaluator.featureDistanceData=s||null,this.expression.evaluate(this._evaluator)}evaluate(t,e,i,n,r,o,a,s){this._evaluator.globals=t,this._evaluator.feature=e||null,this._evaluator.featureState=i||null,this._evaluator.canonical=n,this._evaluator.availableImages=r||null,this._evaluator.formattedSection=o||null,this._evaluator.featureTileCoord=a||null,this._evaluator.featureDistanceData=s||null;try{const t=this.expression.evaluate(this._evaluator);if(null==t||"number"==typeof t&&t!=t)return this._defaultValue;if(this._enumValues&&!(t in this._enumValues))throw new ii(`Expected value to be one of ${Object.keys(this._enumValues).map((t=>JSON.stringify(t))).join(", ")}, but found ${JSON.stringify(t)} instead.`);return t}catch(t){return this._warningHistory[t.message]||(this._warningHistory[t.message]=!0,"undefined"!=typeof console&&console.warn(t.message)),this._defaultValue}}}function Gn(t){return Array.isArray(t)&&t.length>0&&"string"==typeof t[0]&&t[0]in Tn}function qn(t,e){const i=new Oi(Tn,[],e?function(t){const e={color:Ae,string:Ie,number:ze,enum:Ie,boolean:Pe,formatted:Re,resolvedImage:Be};return"array"===t.type?Fe(e[t.value]||Oe,t.length):e[t.type]}(e):void 0),n=i.parse(t,void 0,void 0,void 0,e&&"string"===e.type?{typeAnnotation:"coerce"}:void 0);return n?In(new $n(n,e)):Pn(i.errors)}class Wn{constructor(t,e){this.kind=t,this._styleExpression=e,this.isStateDependent="constant"!==t&&!Pi(e.expression)}evaluateWithoutErrorHandling(t,e,i,n,r,o){return this._styleExpression.evaluateWithoutErrorHandling(t,e,i,n,r,o)}evaluate(t,e,i,n,r,o){return this._styleExpression.evaluate(t,e,i,n,r,o)}}class Hn{constructor(t,e,i,n){this.kind=t,this.zoomStops=i,this._styleExpression=e,this.isStateDependent="camera"!==t&&!Pi(e.expression),this.interpolationType=n}evaluateWithoutErrorHandling(t,e,i,n,r,o){return this._styleExpression.evaluateWithoutErrorHandling(t,e,i,n,r,o)}evaluate(t,e,i,n,r,o){return this._styleExpression.evaluate(t,e,i,n,r,o)}interpolationFactor(t,e,i){return this.interpolationType?rn.interpolationFactor(this.interpolationType,t,e,i):0}}function Xn(t,e){if("error"===(t=qn(t,e)).result)return t;const i=t.value.expression,n=Ii(i);if(!n&&!An(e))return Pn([new Se("","data expressions not supported")]);const r=Ai(i,["zoom","pitch","distance-from-center"]);if(!r&&!Dn(e))return Pn([new Se("","zoom expressions not supported")]);const o=Kn(i);return o||r?o instanceof Se?Pn([o]):o instanceof rn&&!On(e)?Pn([new Se("",'"interpolate" expressions cannot be used with this property')]):In(o?new Hn(n?"camera":"composite",t.value,o.labels,o instanceof rn?o.interpolation:void 0):new Wn(n?"constant":"source",t.value)):Pn([new Se("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class Yn{constructor(t,e){this._parameters=t,this._specification=e,ke(this,Fn(this._parameters,this._specification))}static deserialize(t){return new Yn(t._parameters,t._specification)}static serialize(t){return{_parameters:t._parameters,_specification:t._specification}}}function Kn(t){let e=null;if(t instanceof sn)e=Kn(t.result);else if(t instanceof an){for(const i of t.args)if(e=Kn(i),e)break}else(t instanceof Bi||t instanceof rn)&&t.input instanceof di&&"zoom"===t.input.name&&(e=t);return e instanceof Se||t.eachChild((t=>{const i=Kn(t);i instanceof Se?e=i:!e&&i?e=new Se("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):e&&i&&e!==i&&(e=new Se("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))})),e}function Jn(t){const e=t.key,i=t.value,n=t.valueSpec||{},r=t.objectElementValidators||{},o=t.style,a=t.styleSpec;let s=[];const l=Ln(i);if("object"!==l)return[new be(e,i,`object expected, ${l} found`)];for(const t in i){const l=t.split(".")[0],c=n[l]||n["*"];let u;if(r[l])u=r[l];else if(n[l])u=Pr;else if(r["*"])u=r["*"];else{if(!n["*"]){s.push(new be(e,i[t],`unknown property "${t}"`));continue}u=Pr}s=s.concat(u({key:(e?`${e}.`:e)+t,value:i[t],valueSpec:c,style:o,styleSpec:a,object:i,objectKey:t},i))}for(const t in n)r[t]||n[t].required&&void 0===n[t].default&&void 0===i[t]&&s.push(new be(e,i,`missing required property "${t}"`));return s}function Qn(t){const e=t.value,i=t.valueSpec,n=t.style,r=t.styleSpec,o=t.key,a=t.arrayElementValidator||Pr;if("array"!==Ln(e))return[new be(o,e,`array expected, ${Ln(e)} found`)];if(i.length&&e.length!==i.length)return[new be(o,e,`array length ${i.length} expected, length ${e.length} found`)];if(i["min-length"]&&e.lengthr)return[new be(e,i,`${i} is greater than the maximum value ${r}`)]}return[]}function er(t){const e=t.valueSpec,i=Ee(t.value.type);let n,r,o,a={};const s="categorical"!==i&&void 0===t.value.property,l=!s,c="array"===Ln(t.value.stops)&&"array"===Ln(t.value.stops[0])&&"object"===Ln(t.value.stops[0][0]),u=Jn({key:t.key,value:t.value,valueSpec:t.styleSpec.function,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:function(t){if("identity"===i)return[new be(t.key,t.value,'identity function may not have a "stops" property')];let e=[];const n=t.value;return e=e.concat(Qn({key:t.key,value:n,valueSpec:t.valueSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:d})),"array"===Ln(n)&&0===n.length&&e.push(new be(t.key,n,"array must have at least one stop")),e},default:function(t){return Pr({key:t.key,value:t.value,valueSpec:e,style:t.style,styleSpec:t.styleSpec})}}});return"identity"===i&&s&&u.push(new be(t.key,t.value,'missing required property "property"')),"identity"===i||t.value.stops||u.push(new be(t.key,t.value,'missing required property "stops"')),"exponential"===i&&t.valueSpec.expression&&!On(t.valueSpec)&&u.push(new be(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(l&&!An(t.valueSpec)?u.push(new be(t.key,t.value,"property functions not supported")):s&&!Dn(t.valueSpec)&&u.push(new be(t.key,t.value,"zoom functions not supported"))),"categorical"!==i&&!c||void 0!==t.value.property||u.push(new be(t.key,t.value,'"property" property is required')),u;function d(t){let i=[];const n=t.value,s=t.key;if("array"!==Ln(n))return[new be(s,n,`array expected, ${Ln(n)} found`)];if(2!==n.length)return[new be(s,n,`array length 2 expected, length ${n.length} found`)];if(c){if("object"!==Ln(n[0]))return[new be(s,n,`object expected, ${Ln(n[0])} found`)];if(void 0===n[0].zoom)return[new be(s,n,"object stop key must have zoom")];if(void 0===n[0].value)return[new be(s,n,"object stop key must have value")];if(o&&o>Ee(n[0].zoom))return[new be(s,n[0].zoom,"stop zoom values must appear in ascending order")];Ee(n[0].zoom)!==o&&(o=Ee(n[0].zoom),r=void 0,a={}),i=i.concat(Jn({key:`${s}[0]`,value:n[0],valueSpec:{zoom:{}},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:tr,value:h}}))}else i=i.concat(h({key:`${s}[0]`,value:n[0],valueSpec:{},style:t.style,styleSpec:t.styleSpec},n));return Gn(Te(n[1]))?i.concat([new be(`${s}[1]`,n[1],"expressions are not allowed in function stops.")]):i.concat(Pr({key:`${s}[1]`,value:n[1],valueSpec:e,style:t.style,styleSpec:t.styleSpec}))}function h(t,o){const s=Ln(t.value),l=Ee(t.value),c=null!==t.value?t.value:o;if(n){if(s!==n)return[new be(t.key,c,`${s} stop domain type must match previous stop domain type ${n}`)]}else n=s;if("number"!==s&&"string"!==s&&"boolean"!==s)return[new be(t.key,c,"stop domain value must be a number, string, or boolean")];if("number"!==s&&"categorical"!==i){let n=`number expected, ${s} found`;return An(e)&&void 0===i&&(n+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new be(t.key,c,n)]}return"categorical"!==i||"number"!==s||isFinite(l)&&Math.floor(l)===l?"categorical"!==i&&"number"===s&&void 0!==r&&lnew be(`${t.key}${e.key}`,t.value,e.message)));const i=e.value.expression||e.value._styleExpression.expression;if("property"===t.expressionContext&&"text-font"===t.propertyKey&&!i.outputDefined())return[new be(t.key,t.value,`Invalid data expression for "${t.propertyKey}". Output values must be contained as literals within the expression.`)];if("property"===t.expressionContext&&"layout"===t.propertyType&&!Pi(i))return[new be(t.key,t.value,'"feature-state" data expressions are not supported with layout properties.')];if("filter"===t.expressionContext)return nr(i,t);if(t.expressionContext&&0===t.expressionContext.indexOf("cluster")){if(!Ai(i,["zoom","feature-state"]))return[new be(t.key,t.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if("cluster-initial"===t.expressionContext&&!Ii(i))return[new be(t.key,t.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function nr(t,e){const i=new Set(["zoom","feature-state","pitch","distance-from-center"]);for(const t of e.valueSpec.expression.parameters)i.delete(t);if(0===i.size)return[];const n=[];return t instanceof di&&i.has(t.name)?[new be(e.key,e.value,`["${t.name}"] expression is not supported in a filter for a ${e.object.type} layer with id: ${e.object.id}`)]:(t.eachChild((t=>{n.push(...nr(t,e))})),n)}function rr(t){const e=t.key,i=t.value,n=t.valueSpec,r=[];return Array.isArray(n.values)?-1===n.values.indexOf(Ee(i))&&r.push(new be(e,i,`expected one of [${n.values.join(", ")}], ${JSON.stringify(i)} found`)):-1===Object.keys(n.values).indexOf(Ee(i))&&r.push(new be(e,i,`expected one of [${Object.keys(n.values).join(", ")}], ${JSON.stringify(i)} found`)),r}function or(t){if(!0===t||!1===t)return!0;if(!Array.isArray(t)||0===t.length)return!1;switch(t[0]){case"has":return t.length>=2&&"$id"!==t[1]&&"$type"!==t[1];case"in":return t.length>=3&&("string"!=typeof t[1]||Array.isArray(t[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==t.length||Array.isArray(t[1])||Array.isArray(t[2]);case"any":case"all":for(const e of t.slice(1))if(!or(e)&&"boolean"!=typeof e)return!1;return!0;default:return!0}}function ar(t,e="fill"){if(null==t)return{filter:()=>!0,needGeometry:!1,needFeature:!1};or(t)||(t=pr(t));const i=t;let n=!0;try{n=function(t){if(!cr(t))return t;let e=Te(t);return lr(e),e=sr(e),e}(i)}catch(t){console.warn(`Failed to extract static filter. Filter will continue working, but at higher memory usage and slower framerate.\nThis is most likely a bug, please report this via https://github.com/mapbox/mapbox-gl-js/issues/new?assignees=&labels=&template=Bug_report.md\nand paste the contents of this message in the report.\nThank you!\nFilter Expression:\n${JSON.stringify(i,null,2)}\n `)}const r=xe[`filter_${e}`],o=qn(n,r);let a=null;if("error"===o.result)throw new Error(o.value.map((t=>`${t.key}: ${t.message}`)).join(", "));a=(t,e,i)=>o.value.evaluate(t,e,{},i);let s=null,l=null;if(n!==i){const t=qn(i,r);if("error"===t.result)throw new Error(t.value.map((t=>`${t.key}: ${t.message}`)).join(", "));s=(e,i,n,r,o)=>t.value.evaluate(e,i,{},n,void 0,void 0,r,o),l=!Ii(t.value.expression)}return{filter:a,dynamicFilter:s||void 0,needGeometry:hr(n),needFeature:!!l}}function sr(t){if(!Array.isArray(t))return t;const e=function(t){if(ur.has(t[0]))for(let e=1;esr(t)))}function lr(t){let e=!1;const i=[];if("case"===t[0]){for(let n=1;n",">=","<","<=","to-boolean"]);function dr(t,e){return te?1:0}function hr(t){if(!Array.isArray(t))return!1;if("within"===t[0])return!0;for(let e=1;e"===e||"<="===e||">="===e?mr(t[1],t[2],e):"any"===e?(i=t.slice(1),["any"].concat(i.map(pr))):"all"===e?["all"].concat(t.slice(1).map(pr)):"none"===e?["all"].concat(t.slice(1).map(pr).map(vr)):"in"===e?fr(t[1],t.slice(2)):"!in"===e?vr(fr(t[1],t.slice(2))):"has"===e?gr(t[1]):"!has"===e?vr(gr(t[1])):"within"!==e||t;var i}function mr(t,e,i){switch(t){case"$type":return[`filter-type-${i}`,e];case"$id":return[`filter-id-${i}`,e];default:return[`filter-${i}`,t,e]}}function fr(t,e){if(0===e.length)return!1;switch(t){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some((t=>typeof t!=typeof e[0]))?["filter-in-large",t,["literal",e.sort(dr)]]:["filter-in-small",t,["literal",e]]}}function gr(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function vr(t){return["!",t]}function yr(t){if(or(Te(t.value))){const e=Te(t.layerType);return ir(ke({},t,{expressionContext:"filter",valueSpec:t.styleSpec[`filter_${e||"fill"}`]}))}return _r(t)}function _r(t){const e=t.value,i=t.key;if("array"!==Ln(e))return[new be(i,e,`array expected, ${Ln(e)} found`)];const n=t.styleSpec;let r,o=[];if(e.length<1)return[new be(i,e,"filter array must have at least 1 element")];switch(o=o.concat(rr({key:`${i}[0]`,value:e[0],valueSpec:n.filter_operator,style:t.style,styleSpec:t.styleSpec})),Ee(e[0])){case"<":case"<=":case">":case">=":e.length>=2&&"$type"===Ee(e[1])&&o.push(new be(i,e,`"$type" cannot be use with operator "${e[0]}"`));case"==":case"!=":3!==e.length&&o.push(new be(i,e,`filter array for operator "${e[0]}" must have 3 elements`));case"in":case"!in":e.length>=2&&(r=Ln(e[1]),"string"!==r&&o.push(new be(`${i}[1]`,e[1],`string expected, ${r} found`)));for(let a=2;a{t in i&&e.push(new be(n,i[t],`"${t}" is prohibited for ref layers`))})),r.layers.forEach((e=>{Ee(e.id)===s&&(t=e)})),t?t.ref?e.push(new be(n,i.ref,"ref cannot reference another ref layer")):a=Ee(t.type):e.push(new be(n,i.ref,`ref layer "${s}" not found`))}else if("background"!==a&&"sky"!==a)if(i.source){const t=r.sources&&r.sources[i.source],o=t&&Ee(t.type);t?"vector"===o&&"raster"===a?e.push(new be(n,i.source,`layer "${i.id}" requires a raster source`)):"raster"===o&&"raster"!==a?e.push(new be(n,i.source,`layer "${i.id}" requires a vector source`)):"vector"!==o||i["source-layer"]?"raster-dem"===o&&"hillshade"!==a?e.push(new be(n,i.source,"raster-dem source can only be used with layer type 'hillshade'.")):"line"!==a||!i.paint||!i.paint["line-gradient"]||"geojson"===o&&t.lineMetrics||e.push(new be(n,i,`layer "${i.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):e.push(new be(n,i,`layer "${i.id}" must specify a "source-layer"`)):e.push(new be(n,i.source,`source "${i.source}" not found`))}else e.push(new be(n,i,'missing required property "source"'));return e=e.concat(Jn({key:n,value:i,valueSpec:o.layer,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":()=>[],type:()=>Pr({key:`${n}.type`,value:i.type,valueSpec:o.layer.type,style:t.style,styleSpec:t.styleSpec,object:i,objectKey:"type"}),filter:t=>yr(ke({layerType:a},t)),layout:t=>Jn({layer:i,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":t=>wr(ke({layerType:a},t))}}),paint:t=>Jn({layer:i,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":t=>br(ke({layerType:a},t))}})}})),e}function Er(t){const e=t.value,i=t.key,n=Ln(e);return"string"!==n?[new be(i,e,`string expected, ${n} found`)]:[]}const Tr={promoteId:function({key:t,value:e}){if("string"===Ln(e))return Er({key:t,value:e});{const i=[];for(const n in e)i.push(...Er({key:`${t}.${n}`,value:e[n]}));return i}}};function Sr(t){const e=t.value,i=t.key,n=t.styleSpec,r=t.style;if(!e.type)return[new be(i,e,'"type" is required')];const o=Ee(e.type);let a;switch(o){case"vector":case"raster":case"raster-dem":return a=Jn({key:i,value:e,valueSpec:n[`source_${o.replace("-","_")}`],style:t.style,styleSpec:n,objectElementValidators:Tr}),a;case"geojson":if(a=Jn({key:i,value:e,valueSpec:n.source_geojson,style:r,styleSpec:n,objectElementValidators:Tr}),e.cluster)for(const t in e.clusterProperties){const[n,r]=e.clusterProperties[t],o="string"==typeof n?[n,["accumulated"],["get",t]]:n;a.push(...ir({key:`${i}.${t}.map`,value:r,expressionContext:"cluster-map"})),a.push(...ir({key:`${i}.${t}.reduce`,value:o,expressionContext:"cluster-reduce"}))}return a;case"video":return Jn({key:i,value:e,valueSpec:n.source_video,style:r,styleSpec:n});case"image":return Jn({key:i,value:e,valueSpec:n.source_image,style:r,styleSpec:n});case"canvas":return[new be(i,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return rr({key:`${i}.type`,value:e.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:r,styleSpec:n})}}function Cr(t){const e=t.value,i=t.styleSpec,n=i.light,r=t.style;let o=[];const a=Ln(e);if(void 0===e)return o;if("object"!==a)return o=o.concat([new be("light",e,`object expected, ${a} found`)]),o;for(const t in e){const a=t.match(/^(.*)-transition$/);o=o.concat(a&&n[a[1]]&&n[a[1]].transition?Pr({key:t,value:e[t],valueSpec:i.transition,style:r,styleSpec:i}):n[t]?Pr({key:t,value:e[t],valueSpec:n[t],style:r,styleSpec:i}):[new be(t,e[t],`unknown property "${t}"`)])}return o}function Mr(t){const e=t.value,i=t.key,n=t.style,r=t.styleSpec,o=r.terrain;let a=[];const s=Ln(e);if(void 0===e)return a;if("object"!==s)return a=a.concat([new be("terrain",e,`object expected, ${s} found`)]),a;for(const t in e){const i=t.match(/^(.*)-transition$/);a=a.concat(i&&o[i[1]]&&o[i[1]].transition?Pr({key:t,value:e[t],valueSpec:r.transition,style:n,styleSpec:r}):o[t]?Pr({key:t,value:e[t],valueSpec:o[t],style:n,styleSpec:r}):[new be(t,e[t],`unknown property "${t}"`)])}if(e.source){const t=n.sources&&n.sources[e.source],r=t&&Ee(t.type);t?"raster-dem"!==r&&a.push(new be(i,e.source,`terrain cannot be used with a source of type ${r}, it only be used with a "raster-dem" source type`)):a.push(new be(i,e.source,`source "${e.source}" not found`))}else a.push(new be(i,e,'terrain is missing required property "source"'));return a}function zr(t){const e=t.value,i=t.style,n=t.styleSpec,r=n.fog;let o=[];const a=Ln(e);if(void 0===e)return o;if("object"!==a)return o=o.concat([new be("fog",e,`object expected, ${a} found`)]),o;for(const t in e){const a=t.match(/^(.*)-transition$/);o=o.concat(a&&r[a[1]]&&r[a[1]].transition?Pr({key:t,value:e[t],valueSpec:n.transition,style:i,styleSpec:n}):r[t]?Pr({key:t,value:e[t],valueSpec:r[t],style:i,styleSpec:n}):[new be(t,e[t],`unknown property "${t}"`)])}return o}const Ir={"*":()=>[],array:Qn,boolean:function(t){const e=t.value,i=t.key,n=Ln(e);return"boolean"!==n?[new be(i,e,`boolean expected, ${n} found`)]:[]},number:tr,color:function(t){const e=t.key,i=t.value,n=Ln(i);return"string"!==n?[new be(e,i,`color expected, ${n} found`)]:null===Ge.parseCSSColor(i)?[new be(e,i,`color expected, "${i}" found`)]:[]},constants:we,enum:rr,filter:yr,function:er,layer:kr,object:Jn,source:Sr,light:Cr,terrain:Mr,fog:zr,string:Er,formatted:function(t){return 0===Er(t).length?[]:ir(t)},resolvedImage:function(t){return 0===Er(t).length?[]:ir(t)},projection:function(t){const e=t.value,i=t.styleSpec,n=i.projection,r=t.style;let o=[];const a=Ln(e);if("object"===a)for(const t in e)o=o.concat(Pr({key:t,value:e[t],valueSpec:n[t],style:r,styleSpec:i}));else"string"!==a&&(o=o.concat([new be("projection",e,`object or string expected, ${a} found`)]));return o}};function Pr(t){const e=t.value,i=t.valueSpec,n=t.styleSpec;return i.expression&&Rn(Ee(e))?er(t):i.expression&&Gn(Te(e))?ir(t):i.type&&Ir[i.type]?Ir[i.type](t):Jn(ke({},t,{valueSpec:i.type?n[i.type]:i}))}function Ar(t){const e=t.value,i=t.key,n=Er(t);return n.length||(-1===e.indexOf("{fontstack}")&&n.push(new be(i,e,'"glyphs" url must include a "{fontstack}" token')),-1===e.indexOf("{range}")&&n.push(new be(i,e,'"glyphs" url must include a "{range}" token'))),n}function Dr(t,e=xe){let i=[];return i=i.concat(Pr({key:"",value:t,valueSpec:e.$root,styleSpec:e,style:t,objectElementValidators:{glyphs:Ar,"*":()=>[]}})),t.constants&&(i=i.concat(we({key:"constants",value:t.constants,style:t,styleSpec:e}))),Or(i)}function Or(t){return[].concat(t).sort(((t,e)=>t.line-e.line))}function Lr(t){return function(...e){return Or(t.apply(this,e))}}Dr.source=Lr(Sr),Dr.light=Lr(Cr),Dr.terrain=Lr(Mr),Dr.fog=Lr(zr),Dr.layer=Lr(kr),Dr.filter=Lr(yr),Dr.paintProperty=Lr(br),Dr.layoutProperty=Lr(wr);const Rr=Dr,Br=Rr.light,Fr=Rr.fog,jr=Rr.paintProperty,Nr=Rr.layoutProperty;function Vr(t,e){let i=!1;if(e&&e.length)for(const n of e)t.fire(new ye(new Error(n.message))),i=!0;return i}var Ur=Zr;function Zr(t,e,i){var n=this.cells=[];if(t instanceof ArrayBuffer){this.arrayBuffer=t;var r=new Int32Array(this.arrayBuffer);t=r[0],this.d=(e=r[1])+2*(i=r[2]);for(var o=0;o=u[p+0]&&n>=u[p+1])?(a[h]=!0,o.push(c[h])):a[h]=!1}}},Zr.prototype._forEachCell=function(t,e,i,n,r,o,a,s){for(var l=this._convertToCellCoord(t),c=this._convertToCellCoord(e),u=this._convertToCellCoord(i),d=this._convertToCellCoord(n),h=l;h<=u;h++)for(var p=c;p<=d;p++){var m=this.d*p+h;if((!s||s(this._convertFromCellCoord(h),this._convertFromCellCoord(p),this._convertFromCellCoord(h+1),this._convertFromCellCoord(p+1)))&&r.call(this,t,e,i,n,m,o,a,s))return}},Zr.prototype._convertFromCellCoord=function(t){return(t-this.padding)/this.scale},Zr.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},Zr.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var t=this.cells,e=3+this.cells.length+1+1,i=0,n=0;n=0)continue;const o=t[i];r[i]=qr[n].shallow.indexOf(i)>=0?o:Yr(o,e)}t instanceof Error&&(r.message=t.message)}if(r.$name)throw new Error("$name property is reserved for worker serialization logic.");return"Object"!==n&&(r.$name=n),r}throw new Error("can't serialize object of type "+typeof t)}function Kr(t){if(null==t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp||Hr(t)||Xr(t)||ArrayBuffer.isView(t)||t instanceof $r)return t;if(Array.isArray(t))return t.map(Kr);if("object"==typeof t){const e=t.$name||"Object",{klass:i}=qr[e];if(!i)throw new Error(`can't deserialize unregistered class ${e}`);if(i.deserialize)return i.deserialize(t);const n=Object.create(i.prototype);for(const i of Object.keys(t)){if("$name"===i)continue;const r=t[i];n[i]=qr[e].shallow.indexOf(i)>=0?r:Kr(r)}return n}throw new Error("can't deserialize object of type "+typeof t)}class Jr{constructor(){this.first=!0}update(t,e){const i=Math.floor(t);return this.first?(this.first=!1,this.lastIntegerZoom=i,this.lastIntegerZoomTime=0,this.lastZoom=t,this.lastFloorZoom=i,!0):(this.lastFloorZoom>i?(this.lastIntegerZoom=i+1,this.lastIntegerZoomTime=e):this.lastFloorZoomt>=1536&&t<=1791,to=t=>t>=1872&&t<=1919,eo=t=>t>=2208&&t<=2303,io=t=>t>=11904&&t<=12031,no=t=>t>=12032&&t<=12255,ro=t=>t>=12272&&t<=12287,oo=t=>t>=12288&&t<=12351,ao=t=>t>=12352&&t<=12447,so=t=>t>=12448&&t<=12543,lo=t=>t>=12544&&t<=12591,co=t=>t>=12704&&t<=12735,uo=t=>t>=12736&&t<=12783,ho=t=>t>=12784&&t<=12799,po=t=>t>=12800&&t<=13055,mo=t=>t>=13056&&t<=13311,fo=t=>t>=13312&&t<=19903,go=t=>t>=19968&&t<=40959,vo=t=>t>=40960&&t<=42127,yo=t=>t>=42128&&t<=42191,_o=t=>t>=44032&&t<=55215,xo=t=>t>=63744&&t<=64255,bo=t=>t>=64336&&t<=65023,wo=t=>t>=65040&&t<=65055,ko=t=>t>=65072&&t<=65103,Eo=t=>t>=65104&&t<=65135,To=t=>t>=65136&&t<=65279,So=t=>t>=65280&&t<=65519;function Co(t){for(const e of t)if(Io(e.charCodeAt(0)))return!0;return!1}function Mo(t){for(const e of t)if(!zo(e.charCodeAt(0)))return!1;return!0}function zo(t){return!(Qr(t)||to(t)||eo(t)||bo(t)||To(t))}function Io(t){return!(746!==t&&747!==t&&(t<4352||!(co(t)||lo(t)||ko(t)&&!(t>=65097&&t<=65103)||xo(t)||mo(t)||io(t)||uo(t)||!(!oo(t)||t>=12296&&t<=12305||t>=12308&&t<=12319||12336===t)||fo(t)||go(t)||po(t)||(t=>t>=12592&&t<=12687)(t)||(t=>t>=43360&&t<=43391)(t)||(t=>t>=55216&&t<=55295)(t)||(t=>t>=4352&&t<=4607)(t)||_o(t)||ao(t)||ro(t)||(t=>t>=12688&&t<=12703)(t)||no(t)||ho(t)||so(t)&&12540!==t||!(!So(t)||65288===t||65289===t||65293===t||t>=65306&&t<=65310||65339===t||65341===t||65343===t||t>=65371&&t<=65503||65507===t||t>=65512&&t<=65519)||!(!Eo(t)||t>=65112&&t<=65118||t>=65123&&t<=65126)||(t=>t>=5120&&t<=5759)(t)||(t=>t>=6320&&t<=6399)(t)||wo(t)||(t=>t>=19904&&t<=19967)(t)||vo(t)||yo(t))))}function Po(t){return!(Io(t)||function(t){return!!((t=>t>=128&&t<=255)(t)&&(167===t||169===t||174===t||177===t||188===t||189===t||190===t||215===t||247===t)||(t=>t>=8192&&t<=8303)(t)&&(8214===t||8224===t||8225===t||8240===t||8241===t||8251===t||8252===t||8258===t||8263===t||8264===t||8265===t||8273===t)||(t=>t>=8448&&t<=8527)(t)||(t=>t>=8528&&t<=8591)(t)||(t=>t>=8960&&t<=9215)(t)&&(t>=8960&&t<=8967||t>=8972&&t<=8991||t>=8996&&t<=9e3||9003===t||t>=9085&&t<=9114||t>=9150&&t<=9165||9167===t||t>=9169&&t<=9179||t>=9186&&t<=9215)||(t=>t>=9216&&t<=9279)(t)&&9251!==t||(t=>t>=9280&&t<=9311)(t)||(t=>t>=9312&&t<=9471)(t)||(t=>t>=9632&&t<=9727)(t)||(t=>t>=9728&&t<=9983)(t)&&!(t>=9754&&t<=9759)||(t=>t>=11008&&t<=11263)(t)&&(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243)||oo(t)||so(t)||(t=>t>=57344&&t<=63743)(t)||ko(t)||Eo(t)||So(t)||8734===t||8756===t||8757===t||t>=9984&&t<=10087||t>=10102&&t<=10131||65532===t||65533===t)}(t))}function Ao(t){return t>=1424&&t<=2303||bo(t)||To(t)}function Do(t,e){return!(!e&&Ao(t)||t>=2304&&t<=3583||t>=3840&&t<=4255||(t=>t>=6016&&t<=6143)(t))}function Oo(t){for(const e of t)if(Ao(e.charCodeAt(0)))return!0;return!1}const Lo="deferred",Ro="loading",Bo="loaded";let Fo=null,jo="unavailable",No=null;const Vo=function(t){t&&"string"==typeof t&&t.indexOf("NetworkError")>-1&&(jo="error"),Fo&&Fo(t)};function Uo(){Zo.fire(new ve("pluginStateChange",{pluginStatus:jo,pluginURL:No}))}const Zo=new _e,$o=function(){return jo},Go=function(){if(jo!==Lo||!No)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");jo=Ro,Uo(),No&&se({url:No},(t=>{t?Vo(t):(jo=Bo,Uo())}))},qo={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:()=>jo===Bo||null!=qo.applyArabicShaping,isLoading:()=>jo===Ro,setState(t){jo=t.pluginStatus,No=t.pluginURL},isParsed:()=>null!=qo.applyArabicShaping&&null!=qo.processBidirectionalText&&null!=qo.processStyledBidirectionalText,getPluginURL:()=>No};class Wo{constructor(t,e){this.zoom=t,e?(this.now=e.now,this.fadeDuration=e.fadeDuration,this.zoomHistory=e.zoomHistory,this.transition=e.transition,this.pitch=e.pitch):(this.now=0,this.fadeDuration=0,this.zoomHistory=new Jr,this.transition={},this.pitch=0)}isSupportedScript(t){return function(t,e){for(const i of t)if(!Do(i.charCodeAt(0),e))return!1;return!0}(t,qo.isLoaded())}crossFadingFactor(){return 0===this.fadeDuration?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){const t=this.zoom,e=t-Math.floor(t),i=this.crossFadingFactor();return t>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:e+(1-e)*i}:{fromScale:.5,toScale:1,t:1-(1-i)*e}}}class Ho{constructor(t,e){this.property=t,this.value=e,this.expression=function(t,e){if(Rn(t))return new Yn(t,e);if(Gn(t)){const i=Xn(t,e);if("error"===i.result)throw new Error(i.value.map((t=>`${t.key}: ${t.message}`)).join(", "));return i.value}{let i=t;return"string"==typeof t&&"color"===e.type&&(i=qe.parse(t)),{kind:"constant",evaluate:()=>i}}}(void 0===e?t.specification.default:e,t.specification)}isDataDriven(){return"source"===this.expression.kind||"composite"===this.expression.kind}possiblyEvaluate(t,e,i){return this.property.possiblyEvaluate(this,t,e,i)}}class Xo{constructor(t){this.property=t,this.value=new Ho(t,void 0)}transitioned(t,e){return new Ko(this.property,this.value,e,et({},t.transition,this.transition),t.now)}untransitioned(){return new Ko(this.property,this.value,null,{},0)}}class Yo{constructor(t){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues)}getValue(t){return dt(this._values[t].value.value)}setValue(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new Xo(this._values[t].property)),this._values[t].value=new Ho(this._values[t].property,null===e?void 0:dt(e))}getTransition(t){return dt(this._values[t].transition)}setTransition(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new Xo(this._values[t].property)),this._values[t].transition=dt(e)||void 0}serialize(){const t={};for(const e of Object.keys(this._values)){const i=this.getValue(e);void 0!==i&&(t[e]=i);const n=this.getTransition(e);void 0!==n&&(t[`${e}-transition`]=n)}return t}transitioned(t,e){const i=new Jo(this._properties);for(const n of Object.keys(this._values))i._values[n]=this._values[n].transitioned(t,e._values[n]);return i}untransitioned(){const t=new Jo(this._properties);for(const e of Object.keys(this._values))t._values[e]=this._values[e].untransitioned();return t}}class Ko{constructor(t,e,i,n,r){const o=n.delay||0,a=n.duration||0;r=r||0,this.property=t,this.value=e,this.begin=r+o,this.end=this.begin+a,t.specification.transition&&(n.delay||n.duration)&&(this.prior=i)}possiblyEvaluate(t,e,i){const n=t.now||0,r=this.value.possiblyEvaluate(t,e,i),o=this.prior;if(o){if(n>this.end)return this.prior=null,r;if(this.value.isDataDriven())return this.prior=null,r;if(nn.zoomHistory.lastIntegerZoom?{from:t,to:e,other:i}:{from:i,to:e,other:t}}interpolate(t){return t}}class oa{constructor(t){this.specification=t}possiblyEvaluate(t,e,i,n){if(void 0!==t.value){if("constant"===t.expression.kind){const r=t.expression.evaluate(e,null,{},i,n);return this._calculate(r,r,r,e)}return this._calculate(t.expression.evaluate(new Wo(Math.floor(e.zoom-1),e)),t.expression.evaluate(new Wo(Math.floor(e.zoom),e)),t.expression.evaluate(new Wo(Math.floor(e.zoom+1),e)),e)}}_calculate(t,e,i,n){return n.zoom>n.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:i,to:e}}interpolate(t){return t}}class aa{constructor(t){this.specification=t}possiblyEvaluate(t,e,i,n){return!!t.expression.evaluate(e,null,{},i,n)}interpolate(){return!1}}class sa{constructor(t){this.properties=t,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(const e in t){const i=t[e];i.specification.overridable&&this.overridableProperties.push(e);const n=this.defaultPropertyValues[e]=new Ho(i,void 0),r=this.defaultTransitionablePropertyValues[e]=new Xo(i);this.defaultTransitioningPropertyValues[e]=r.untransitioned(),this.defaultPossiblyEvaluatedValues[e]=n.possiblyEvaluate({})}}}function la(t,e){return 256*(t=Y(Math.floor(t),0,255))+Y(Math.floor(e),0,255)}Wr("DataDrivenProperty",na),Wr("DataConstantProperty",ia),Wr("CrossFadedDataDrivenProperty",ra),Wr("CrossFadedProperty",oa),Wr("ColorRampProperty",aa);const ca={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class ua{constructor(t,e){this._structArray=t,this._pos1=e*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class da{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(t,e){return t._trim(),e&&(t.isTransferred=!0,e.push(t.arrayBuffer)),{length:t.length,arrayBuffer:t.arrayBuffer}}static deserialize(t){const e=Object.create(this.prototype);return e.arrayBuffer=t.arrayBuffer,e.length=t.length,e.capacity=t.arrayBuffer.byteLength/e.bytesPerElement,e._refreshViews(),e}_trim(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}clear(){this.length=0}resize(t){this.reserve(t),this.length=t}reserve(t){if(t>this.capacity){this.capacity=Math.max(t,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);const e=this.uint8;this._refreshViews(),e&&this.uint8.set(e)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}}function ha(t,e=1){let i=0,n=0;return{members:t.map((t=>{const r=ca[t.type].BYTES_PER_ELEMENT,o=i=pa(i,Math.max(e,r)),a=t.components||1;return n=Math.max(n,r),i+=r*a,{name:t.name,type:t.type,components:a,offset:o}})),size:pa(i,Math.max(n,e)),alignment:e}}function pa(t,e){return Math.ceil(t/e)*e}class ma extends da{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e){const i=this.length;return this.resize(i+1),this.emplace(i,t,e)}emplace(t,e,i){const n=2*t;return this.int16[n+0]=e,this.int16[n+1]=i,t}}ma.prototype.bytesPerElement=4,Wr("StructArrayLayout2i4",ma);class fa extends da{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,i,n){const r=this.length;return this.resize(r+1),this.emplace(r,t,e,i,n)}emplace(t,e,i,n,r){const o=4*t;return this.int16[o+0]=e,this.int16[o+1]=i,this.int16[o+2]=n,this.int16[o+3]=r,t}}fa.prototype.bytesPerElement=8,Wr("StructArrayLayout4i8",fa);class ga extends da{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,i,n,r,o,a){const s=this.length;return this.resize(s+1),this.emplace(s,t,e,i,n,r,o,a)}emplace(t,e,i,n,r,o,a,s){const l=6*t,c=12*t,u=3*t;return this.int16[l+0]=e,this.int16[l+1]=i,this.uint8[c+4]=n,this.uint8[c+5]=r,this.uint8[c+6]=o,this.uint8[c+7]=a,this.float32[u+2]=s,t}}ga.prototype.bytesPerElement=12,Wr("StructArrayLayout2i4ub1f12",ga);class va extends da{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,i){const n=this.length;return this.resize(n+1),this.emplace(n,t,e,i)}emplace(t,e,i,n){const r=3*t;return this.float32[r+0]=e,this.float32[r+1]=i,this.float32[r+2]=n,t}}va.prototype.bytesPerElement=12,Wr("StructArrayLayout3f12",va);class ya extends da{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,i,n,r,o,a,s,l,c){const u=this.length;return this.resize(u+1),this.emplace(u,t,e,i,n,r,o,a,s,l,c)}emplace(t,e,i,n,r,o,a,s,l,c,u){const d=10*t;return this.uint16[d+0]=e,this.uint16[d+1]=i,this.uint16[d+2]=n,this.uint16[d+3]=r,this.uint16[d+4]=o,this.uint16[d+5]=a,this.uint16[d+6]=s,this.uint16[d+7]=l,this.uint16[d+8]=c,this.uint16[d+9]=u,t}}ya.prototype.bytesPerElement=20,Wr("StructArrayLayout10ui20",ya);class _a extends da{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,i,n,r,o,a,s){const l=this.length;return this.resize(l+1),this.emplace(l,t,e,i,n,r,o,a,s)}emplace(t,e,i,n,r,o,a,s,l){const c=8*t;return this.uint16[c+0]=e,this.uint16[c+1]=i,this.uint16[c+2]=n,this.uint16[c+3]=r,this.uint16[c+4]=o,this.uint16[c+5]=a,this.uint16[c+6]=s,this.uint16[c+7]=l,t}}_a.prototype.bytesPerElement=16,Wr("StructArrayLayout8ui16",_a);class xa extends da{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,i,n,r,o,a,s,l,c,u,d,h,p,m,f){const g=this.length;return this.resize(g+1),this.emplace(g,t,e,i,n,r,o,a,s,l,c,u,d,h,p,m,f)}emplace(t,e,i,n,r,o,a,s,l,c,u,d,h,p,m,f,g){const v=16*t;return this.int16[v+0]=e,this.int16[v+1]=i,this.int16[v+2]=n,this.int16[v+3]=r,this.uint16[v+4]=o,this.uint16[v+5]=a,this.uint16[v+6]=s,this.uint16[v+7]=l,this.int16[v+8]=c,this.int16[v+9]=u,this.int16[v+10]=d,this.int16[v+11]=h,this.int16[v+12]=p,this.int16[v+13]=m,this.int16[v+14]=f,this.int16[v+15]=g,t}}xa.prototype.bytesPerElement=32,Wr("StructArrayLayout4i4ui4i4i32",xa);class ba extends da{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(t){const e=this.length;return this.resize(e+1),this.emplace(e,t)}emplace(t,e){return this.uint32[1*t+0]=e,t}}ba.prototype.bytesPerElement=4,Wr("StructArrayLayout1ul4",ba);class wa extends da{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,i,n,r,o,a,s,l,c,u,d,h){const p=this.length;return this.resize(p+1),this.emplace(p,t,e,i,n,r,o,a,s,l,c,u,d,h)}emplace(t,e,i,n,r,o,a,s,l,c,u,d,h,p){const m=20*t,f=10*t;return this.int16[m+0]=e,this.int16[m+1]=i,this.int16[m+2]=n,this.int16[m+3]=r,this.int16[m+4]=o,this.float32[f+3]=a,this.float32[f+4]=s,this.float32[f+5]=l,this.float32[f+6]=c,this.int16[m+14]=u,this.uint32[f+8]=d,this.uint16[m+18]=h,this.uint16[m+19]=p,t}}wa.prototype.bytesPerElement=40,Wr("StructArrayLayout5i4f1i1ul2ui40",wa);class ka extends da{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,i,n,r,o,a){const s=this.length;return this.resize(s+1),this.emplace(s,t,e,i,n,r,o,a)}emplace(t,e,i,n,r,o,a,s){const l=8*t;return this.int16[l+0]=e,this.int16[l+1]=i,this.int16[l+2]=n,this.int16[l+4]=r,this.int16[l+5]=o,this.int16[l+6]=a,this.int16[l+7]=s,t}}ka.prototype.bytesPerElement=16,Wr("StructArrayLayout3i2i2i16",ka);class Ea extends da{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,i,n,r){const o=this.length;return this.resize(o+1),this.emplace(o,t,e,i,n,r)}emplace(t,e,i,n,r,o){const a=4*t,s=8*t;return this.float32[a+0]=e,this.float32[a+1]=i,this.float32[a+2]=n,this.int16[s+6]=r,this.int16[s+7]=o,t}}Ea.prototype.bytesPerElement=16,Wr("StructArrayLayout2f1f2i16",Ea);class Ta extends da{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,i,n){const r=this.length;return this.resize(r+1),this.emplace(r,t,e,i,n)}emplace(t,e,i,n,r){const o=12*t,a=3*t;return this.uint8[o+0]=e,this.uint8[o+1]=i,this.float32[a+1]=n,this.float32[a+2]=r,t}}Ta.prototype.bytesPerElement=12,Wr("StructArrayLayout2ub2f12",Ta);class Sa extends da{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,i){const n=this.length;return this.resize(n+1),this.emplace(n,t,e,i)}emplace(t,e,i,n){const r=3*t;return this.uint16[r+0]=e,this.uint16[r+1]=i,this.uint16[r+2]=n,t}}Sa.prototype.bytesPerElement=6,Wr("StructArrayLayout3ui6",Sa);class Ca extends da{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(t,e,i,n,r,o,a,s,l,c,u,d,h,p,m,f,g,v,y,_,x){const b=this.length;return this.resize(b+1),this.emplace(b,t,e,i,n,r,o,a,s,l,c,u,d,h,p,m,f,g,v,y,_,x)}emplace(t,e,i,n,r,o,a,s,l,c,u,d,h,p,m,f,g,v,y,_,x,b){const w=30*t,k=15*t,E=60*t;return this.int16[w+0]=e,this.int16[w+1]=i,this.int16[w+2]=n,this.float32[k+2]=r,this.float32[k+3]=o,this.uint16[w+8]=a,this.uint16[w+9]=s,this.uint32[k+5]=l,this.uint32[k+6]=c,this.uint32[k+7]=u,this.uint16[w+16]=d,this.uint16[w+17]=h,this.uint16[w+18]=p,this.float32[k+10]=m,this.float32[k+11]=f,this.uint8[E+48]=g,this.uint8[E+49]=v,this.uint8[E+50]=y,this.uint32[k+13]=_,this.int16[w+28]=x,this.uint8[E+58]=b,t}}Ca.prototype.bytesPerElement=60,Wr("StructArrayLayout3i2f2ui3ul3ui2f3ub1ul1i1ub60",Ca);class Ma extends da{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(t,e,i,n,r,o,a,s,l,c,u,d,h,p,m,f,g,v,y,_,x,b,w,k,E,T,S,C,M,z){const I=this.length;return this.resize(I+1),this.emplace(I,t,e,i,n,r,o,a,s,l,c,u,d,h,p,m,f,g,v,y,_,x,b,w,k,E,T,S,C,M,z)}emplace(t,e,i,n,r,o,a,s,l,c,u,d,h,p,m,f,g,v,y,_,x,b,w,k,E,T,S,C,M,z,I){const P=38*t,A=19*t;return this.int16[P+0]=e,this.int16[P+1]=i,this.int16[P+2]=n,this.float32[A+2]=r,this.float32[A+3]=o,this.int16[P+8]=a,this.int16[P+9]=s,this.int16[P+10]=l,this.int16[P+11]=c,this.int16[P+12]=u,this.int16[P+13]=d,this.uint16[P+14]=h,this.uint16[P+15]=p,this.uint16[P+16]=m,this.uint16[P+17]=f,this.uint16[P+18]=g,this.uint16[P+19]=v,this.uint16[P+20]=y,this.uint16[P+21]=_,this.uint16[P+22]=x,this.uint16[P+23]=b,this.uint16[P+24]=w,this.uint16[P+25]=k,this.uint16[P+26]=E,this.uint16[P+27]=T,this.uint16[P+28]=S,this.uint32[A+15]=C,this.float32[A+16]=M,this.float32[A+17]=z,this.float32[A+18]=I,t}}Ma.prototype.bytesPerElement=76,Wr("StructArrayLayout3i2f6i15ui1ul3f76",Ma);class za extends da{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t){const e=this.length;return this.resize(e+1),this.emplace(e,t)}emplace(t,e){return this.float32[1*t+0]=e,t}}za.prototype.bytesPerElement=4,Wr("StructArrayLayout1f4",za);class Ia extends da{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,i){const n=this.length;return this.resize(n+1),this.emplace(n,t,e,i)}emplace(t,e,i,n){const r=3*t;return this.int16[r+0]=e,this.int16[r+1]=i,this.int16[r+2]=n,t}}Ia.prototype.bytesPerElement=6,Wr("StructArrayLayout3i6",Ia);class Pa extends da{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,i,n,r,o,a){const s=this.length;return this.resize(s+1),this.emplace(s,t,e,i,n,r,o,a)}emplace(t,e,i,n,r,o,a,s){const l=7*t;return this.float32[l+0]=e,this.float32[l+1]=i,this.float32[l+2]=n,this.float32[l+3]=r,this.float32[l+4]=o,this.float32[l+5]=a,this.float32[l+6]=s,t}}Pa.prototype.bytesPerElement=28,Wr("StructArrayLayout7f28",Pa);class Aa extends da{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,i,n){const r=this.length;return this.resize(r+1),this.emplace(r,t,e,i,n)}emplace(t,e,i,n,r){const o=6*t;return this.uint32[3*t+0]=e,this.uint16[o+2]=i,this.uint16[o+3]=n,this.uint16[o+4]=r,t}}Aa.prototype.bytesPerElement=12,Wr("StructArrayLayout1ul3ui12",Aa);class Da extends da{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e){const i=this.length;return this.resize(i+1),this.emplace(i,t,e)}emplace(t,e,i){const n=2*t;return this.uint16[n+0]=e,this.uint16[n+1]=i,t}}Da.prototype.bytesPerElement=4,Wr("StructArrayLayout2ui4",Da);class Oa extends da{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t){const e=this.length;return this.resize(e+1),this.emplace(e,t)}emplace(t,e){return this.uint16[1*t+0]=e,t}}Oa.prototype.bytesPerElement=2,Wr("StructArrayLayout1ui2",Oa);class La extends da{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e){const i=this.length;return this.resize(i+1),this.emplace(i,t,e)}emplace(t,e,i){const n=2*t;return this.float32[n+0]=e,this.float32[n+1]=i,t}}La.prototype.bytesPerElement=8,Wr("StructArrayLayout2f8",La);class Ra extends da{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,i,n){const r=this.length;return this.resize(r+1),this.emplace(r,t,e,i,n)}emplace(t,e,i,n,r){const o=4*t;return this.float32[o+0]=e,this.float32[o+1]=i,this.float32[o+2]=n,this.float32[o+3]=r,t}}Ra.prototype.bytesPerElement=16,Wr("StructArrayLayout4f16",Ra);class Ba extends ua{get projectedAnchorX(){return this._structArray.int16[this._pos2+0]}get projectedAnchorY(){return this._structArray.int16[this._pos2+1]}get projectedAnchorZ(){return this._structArray.int16[this._pos2+2]}get tileAnchorX(){return this._structArray.int16[this._pos2+3]}get tileAnchorY(){return this._structArray.int16[this._pos2+4]}get x1(){return this._structArray.float32[this._pos4+3]}get y1(){return this._structArray.float32[this._pos4+4]}get x2(){return this._structArray.float32[this._pos4+5]}get y2(){return this._structArray.float32[this._pos4+6]}get padding(){return this._structArray.int16[this._pos2+14]}get featureIndex(){return this._structArray.uint32[this._pos4+8]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+18]}get bucketIndex(){return this._structArray.uint16[this._pos2+19]}}Ba.prototype.size=40;class Fa extends wa{get(t){return new Ba(this,t)}}Wr("CollisionBoxArray",Fa);class ja extends ua{get projectedAnchorX(){return this._structArray.int16[this._pos2+0]}get projectedAnchorY(){return this._structArray.int16[this._pos2+1]}get projectedAnchorZ(){return this._structArray.int16[this._pos2+2]}get tileAnchorX(){return this._structArray.float32[this._pos4+2]}get tileAnchorY(){return this._structArray.float32[this._pos4+3]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+8]}get numGlyphs(){return this._structArray.uint16[this._pos2+9]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+5]}get lineStartIndex(){return this._structArray.uint32[this._pos4+6]}get lineLength(){return this._structArray.uint32[this._pos4+7]}get segment(){return this._structArray.uint16[this._pos2+16]}get lowerSize(){return this._structArray.uint16[this._pos2+17]}get upperSize(){return this._structArray.uint16[this._pos2+18]}get lineOffsetX(){return this._structArray.float32[this._pos4+10]}get lineOffsetY(){return this._structArray.float32[this._pos4+11]}get writingMode(){return this._structArray.uint8[this._pos1+48]}get placedOrientation(){return this._structArray.uint8[this._pos1+49]}set placedOrientation(t){this._structArray.uint8[this._pos1+49]=t}get hidden(){return this._structArray.uint8[this._pos1+50]}set hidden(t){this._structArray.uint8[this._pos1+50]=t}get crossTileID(){return this._structArray.uint32[this._pos4+13]}set crossTileID(t){this._structArray.uint32[this._pos4+13]=t}get associatedIconIndex(){return this._structArray.int16[this._pos2+28]}get flipState(){return this._structArray.uint8[this._pos1+58]}set flipState(t){this._structArray.uint8[this._pos1+58]=t}}ja.prototype.size=60;class Na extends Ca{get(t){return new ja(this,t)}}Wr("PlacedSymbolArray",Na);class Va extends ua{get projectedAnchorX(){return this._structArray.int16[this._pos2+0]}get projectedAnchorY(){return this._structArray.int16[this._pos2+1]}get projectedAnchorZ(){return this._structArray.int16[this._pos2+2]}get tileAnchorX(){return this._structArray.float32[this._pos4+2]}get tileAnchorY(){return this._structArray.float32[this._pos4+3]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+8]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+9]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+10]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+11]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+12]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+13]}get key(){return this._structArray.uint16[this._pos2+14]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+17]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+18]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+19]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+20]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+21]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+22]}get featureIndex(){return this._structArray.uint16[this._pos2+23]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+24]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+25]}get numIconVertices(){return this._structArray.uint16[this._pos2+26]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+27]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+28]}get crossTileID(){return this._structArray.uint32[this._pos4+15]}set crossTileID(t){this._structArray.uint32[this._pos4+15]=t}get textOffset0(){return this._structArray.float32[this._pos4+16]}get textOffset1(){return this._structArray.float32[this._pos4+17]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+18]}}Va.prototype.size=76;class Ua extends Ma{get(t){return new Va(this,t)}}Wr("SymbolInstanceArray",Ua);class Za extends za{getoffsetX(t){return this.float32[1*t+0]}}Wr("GlyphOffsetArray",Za);class $a extends Ia{getx(t){return this.int16[3*t+0]}gety(t){return this.int16[3*t+1]}gettileUnitDistanceFromAnchor(t){return this.int16[3*t+2]}}Wr("SymbolLineVertexArray",$a);class Ga extends ua{get featureIndex(){return this._structArray.uint32[this._pos4+0]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+2]}get bucketIndex(){return this._structArray.uint16[this._pos2+3]}get layoutVertexArrayOffset(){return this._structArray.uint16[this._pos2+4]}}Ga.prototype.size=12;class qa extends Aa{get(t){return new Ga(this,t)}}Wr("FeatureIndexArray",qa);class Wa extends ua{get a_centroid_pos0(){return this._structArray.uint16[this._pos2+0]}get a_centroid_pos1(){return this._structArray.uint16[this._pos2+1]}}Wa.prototype.size=4;class Ha extends Da{get(t){return new Wa(this,t)}}Wr("FillExtrusionCentroidArray",Ha);const Xa=ha([{name:"a_pattern_to",components:4,type:"Uint16"},{name:"a_pattern_from",components:4,type:"Uint16"},{name:"a_pixel_ratio_to",components:1,type:"Uint16"},{name:"a_pixel_ratio_from",components:1,type:"Uint16"}]),Ya=ha([{name:"a_dash_to",components:4,type:"Uint16"},{name:"a_dash_from",components:4,type:"Uint16"}]);var Ka=$e((function(t){t.exports=function(t,e){var i,n,r,o,a,s,l,c;for(n=t.length-(i=3&t.length),r=e,a=3432918353,s=461845907,c=0;c>>16)*a&65535)<<16)&4294967295)<<15|l>>>17))*s+(((l>>>16)*s&65535)<<16)&4294967295)<<13|r>>>19))+((5*(r>>>16)&65535)<<16)&4294967295))+((58964+(o>>>16)&65535)<<16);switch(l=0,i){case 3:l^=(255&t.charCodeAt(c+2))<<16;case 2:l^=(255&t.charCodeAt(c+1))<<8;case 1:r^=l=(65535&(l=(l=(65535&(l^=255&t.charCodeAt(c)))*a+(((l>>>16)*a&65535)<<16)&4294967295)<<15|l>>>17))*s+(((l>>>16)*s&65535)<<16)&4294967295}return r^=t.length,r=2246822507*(65535&(r^=r>>>16))+((2246822507*(r>>>16)&65535)<<16)&4294967295,r=3266489909*(65535&(r^=r>>>13))+((3266489909*(r>>>16)&65535)<<16)&4294967295,(r^=r>>>16)>>>0}})),Ja=$e((function(t){t.exports=function(t,e){for(var i,n=t.length,r=e^n,o=0;n>=4;)i=1540483477*(65535&(i=255&t.charCodeAt(o)|(255&t.charCodeAt(++o))<<8|(255&t.charCodeAt(++o))<<16|(255&t.charCodeAt(++o))<<24))+((1540483477*(i>>>16)&65535)<<16),r=1540483477*(65535&r)+((1540483477*(r>>>16)&65535)<<16)^(i=1540483477*(65535&(i^=i>>>24))+((1540483477*(i>>>16)&65535)<<16)),n-=4,++o;switch(n){case 3:r^=(255&t.charCodeAt(o+2))<<16;case 2:r^=(255&t.charCodeAt(o+1))<<8;case 1:r=1540483477*(65535&(r^=255&t.charCodeAt(o)))+((1540483477*(r>>>16)&65535)<<16)}return r=1540483477*(65535&(r^=r>>>13))+((1540483477*(r>>>16)&65535)<<16),(r^=r>>>15)>>>0}})),Qa=Ka,ts=Ja;Qa.murmur3=Ka,Qa.murmur2=ts;class es{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(t,e,i,n){this.ids.push(is(t)),this.positions.push(e,i,n)}getPositions(t){const e=is(t);let i=0,n=this.ids.length-1;for(;i>1;this.ids[t]>=e?n=t:i=t+1}const r=[];for(;this.ids[i]===e;)r.push({index:this.positions[3*i],start:this.positions[3*i+1],end:this.positions[3*i+2]}),i++;return r}static serialize(t,e){const i=new Float64Array(t.ids),n=new Uint32Array(t.positions);return ns(i,n,0,i.length-1),e&&e.push(i.buffer,n.buffer),{ids:i,positions:n}}static deserialize(t){const e=new es;return e.ids=t.ids,e.positions=t.positions,e.indexed=!0,e}}function is(t){const e=+t;return!isNaN(e)&&Number.MIN_SAFE_INTEGER<=e&&e<=Number.MAX_SAFE_INTEGER?e:Qa(String(t))}function ns(t,e,i,n){for(;i>1];let o=i-1,a=n+1;for(;;){do{o++}while(t[o]r);if(o>=a)break;rs(t,o,a),rs(e,3*o,3*a),rs(e,3*o+1,3*a+1),rs(e,3*o+2,3*a+2)}a-i`u_${t}`)),this.type=i}setUniform(t,e,i){t.set(i.constantOr(this.value))}getBinding(t,e,i){return"color"===this.type?new ls(t,e):new as(t,e)}}class ms{constructor(t,e){this.uniformNames=e.map((t=>`u_${t}`)),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(t,e){this.pixelRatioFrom=e.pixelRatio,this.pixelRatioTo=t.pixelRatio,this.patternFrom=e.tl.concat(e.br),this.patternTo=t.tl.concat(t.br)}setUniform(t,e,i,n){const r="u_pattern_to"===n||"u_dash_to"===n?this.patternTo:"u_pattern_from"===n||"u_dash_from"===n?this.patternFrom:"u_pixel_ratio_to"===n?this.pixelRatioTo:"u_pixel_ratio_from"===n?this.pixelRatioFrom:null;r&&t.set(r)}getBinding(t,e,i){return"u_pattern_from"===i||"u_pattern_to"===i||"u_dash_from"===i||"u_dash_to"===i?new ss(t,e):new as(t,e)}}class fs{constructor(t,e,i,n){this.expression=t,this.type=i,this.maxValue=0,this.paintVertexAttributes=e.map((t=>({name:`a_${t}`,type:"Float32",components:"color"===i?2:1,offset:0}))),this.paintVertexArray=new n}populatePaintArray(t,e,i,n,r,o){const a=this.paintVertexArray.length,s=this.expression.evaluate(new Wo(0),e,{},r,n,o);this.paintVertexArray.resize(t),this._setPaintValue(a,t,s)}updatePaintArray(t,e,i,n,r){const o=this.expression.evaluate({zoom:0},i,n,void 0,r);this._setPaintValue(t,e,o)}_setPaintValue(t,e,i){if("color"===this.type){const n=hs(i);for(let i=t;i`u_${t}_t`)),this.type=i,this.useIntegerZoom=n,this.zoom=r,this.maxValue=0,this.paintVertexAttributes=e.map((t=>({name:`a_${t}`,type:"Float32",components:"color"===i?4:2,offset:0}))),this.paintVertexArray=new o}populatePaintArray(t,e,i,n,r,o){const a=this.expression.evaluate(new Wo(this.zoom),e,{},r,n,o),s=this.expression.evaluate(new Wo(this.zoom+1),e,{},r,n,o),l=this.paintVertexArray.length;this.paintVertexArray.resize(t),this._setPaintValue(l,t,a,s)}updatePaintArray(t,e,i,n,r){const o=this.expression.evaluate({zoom:this.zoom},i,n,void 0,r),a=this.expression.evaluate({zoom:this.zoom+1},i,n,void 0,r);this._setPaintValue(t,e,o,a)}_setPaintValue(t,e,i,n){if("color"===this.type){const r=hs(i),o=hs(n);for(let i=t;i!0)){this.binders={},this._buffers=[];const n=[];for(const r in t.paint._values){if(!i(r))continue;const o=t.paint.get(r);if(!(o instanceof ta&&An(o.property.specification)))continue;const a=bs(r,t.type),s=o.value,l=o.property.specification.type,c=o.property.useIntegerZoom,u=o.property.specification["property-type"],d="cross-faded"===u||"cross-faded-data-driven"===u,h="line-dasharray"===String(r)&&"constant"!==t.layout.get("line-cap").value.kind;if("constant"!==s.kind||h)if("source"===s.kind||h||d){const i=Es(r,l,"source");this.binders[r]=d?new vs(s,a,l,c,e,i,t.id):new fs(s,a,l,i),n.push(`/a_${r}`)}else{const t=Es(r,l,"composite");this.binders[r]=new gs(s,a,l,c,e,t),n.push(`/z_${r}`)}else this.binders[r]=d?new ms(s.value,a):new ps(s.value,a,l),n.push(`/u_${r}`)}this.cacheKey=n.sort().join("")}getMaxValue(t){const e=this.binders[t];return e instanceof fs||e instanceof gs?e.maxValue:0}populatePaintArrays(t,e,i,n,r,o){for(const a in this.binders){const s=this.binders[a];(s instanceof fs||s instanceof gs||s instanceof vs)&&s.populatePaintArray(t,e,i,n,r,o)}}setConstantPatternPositions(t,e){for(const i in this.binders){const n=this.binders[i];n instanceof ms&&n.setConstantPatternPositions(t,e)}}updatePaintArrays(t,e,i,n,r,o){let a=!1;for(const s in t){const l=e.getPositions(s);for(const e of l){const l=i.feature(e.index);for(const i in this.binders){const c=this.binders[i];if((c instanceof fs||c instanceof gs||c instanceof vs)&&!0===c.expression.isStateDependent){const u=n.paint.get(i);c.expression=u.value,c.updatePaintArray(e.start,e.end,l,t[s],r,o),a=!0}}}}return a}defines(){const t=[];for(const e in this.binders){const i=this.binders[e];(i instanceof ps||i instanceof ms)&&t.push(...i.uniformNames.map((t=>`#define HAS_UNIFORM_${t}`)))}return t}getBinderAttributes(){const t=[];for(const e in this.binders){const i=this.binders[e];if(i instanceof fs||i instanceof gs||i instanceof vs)for(let e=0;e!0)){this.programConfigurations={};for(const n of t)this.programConfigurations[n.id]=new ys(n,e,i);this.needsUpload=!1,this._featureMap=new es,this._bufferOffset=0}populatePaintArrays(t,e,i,n,r,o,a){for(const i in this.programConfigurations)this.programConfigurations[i].populatePaintArrays(t,e,n,r,o,a);void 0!==e.id&&this._featureMap.add(e.id,i,this._bufferOffset,t),this._bufferOffset=t,this.needsUpload=!0}updatePaintArrays(t,e,i,n,r){for(const o of i)this.needsUpload=this.programConfigurations[o.id].updatePaintArrays(t,this._featureMap,e,o,n,r)||this.needsUpload}get(t){return this.programConfigurations[t]}upload(t){if(this.needsUpload){for(const e in this.programConfigurations)this.programConfigurations[e].upload(t);this.needsUpload=!1}}destroy(){for(const t in this.programConfigurations)this.programConfigurations[t].destroy()}}const xs={"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-extrusion-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"line-dasharray":["dash_to","dash_from"]};function bs(t,e){return xs[t]||[t.replace(`${e}-`,"").replace(/-/g,"_")]}const ws={"line-pattern":{source:ya,composite:ya},"fill-pattern":{source:ya,composite:ya},"fill-extrusion-pattern":{source:ya,composite:ya},"line-dasharray":{source:_a,composite:_a}},ks={color:{source:La,composite:Ra},number:{source:za,composite:La}};function Es(t,e,i){const n=ws[t];return n&&n[i]||ks[e][i]}Wr("ConstantBinder",ps),Wr("CrossFadedConstantBinder",ms),Wr("SourceExpressionBinder",fs),Wr("CrossFadedCompositeBinder",vs),Wr("CompositeExpressionBinder",gs),Wr("ProgramConfiguration",ys,{omit:["_buffers"]}),Wr("ProgramConfigurationSet",_s);const Ts="-transition";class Ss extends _e{constructor(t,e){if(super(),this.id=t.id,this.type=t.type,this._featureFilter={filter:()=>!0,needGeometry:!1,needFeature:!1},this._filterCompiled=!1,"custom"!==t.type&&(this.metadata=t.metadata,this.minzoom=t.minzoom,this.maxzoom=t.maxzoom,"background"!==t.type&&"sky"!==t.type&&(this.source=t.source,this.sourceLayer=t["source-layer"],this.filter=t.filter),e.layout&&(this._unevaluatedLayout=new Qo(e.layout)),e.paint)){this._transitionablePaint=new Yo(e.paint);for(const e in t.paint)this.setPaintProperty(e,t.paint[e],{validate:!1});for(const e in t.layout)this.setLayoutProperty(e,t.layout[e],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new ea(e.paint)}}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(t){return"visibility"===t?this.visibility:this._unevaluatedLayout.getValue(t)}setLayoutProperty(t,e,i={}){null!=e&&this._validate(Nr,`layers.${this.id}.layout.${t}`,t,e,i)||("visibility"!==t?this._unevaluatedLayout.setValue(t,e):this.visibility=e)}getPaintProperty(t){return lt(t,Ts)?this._transitionablePaint.getTransition(t.slice(0,-Ts.length)):this._transitionablePaint.getValue(t)}setPaintProperty(t,e,i={}){if(null!=e&&this._validate(jr,`layers.${this.id}.paint.${t}`,t,e,i))return!1;if(lt(t,Ts))return this._transitionablePaint.setTransition(t.slice(0,-Ts.length),e||void 0),!1;{const i=this._transitionablePaint._values[t],n="cross-faded-data-driven"===i.property.specification["property-type"],r=i.value.isDataDriven(),o=i.value;this._transitionablePaint.setValue(t,e),this._handleSpecialPaintPropertyUpdate(t);const a=this._transitionablePaint._values[t].value;return a.isDataDriven()||r||n||this._handleOverridablePaintPropertyUpdate(t,o,a)}}_handleSpecialPaintPropertyUpdate(t){}getProgramIds(){return null}getProgramConfiguration(t){return null}_handleOverridablePaintPropertyUpdate(t,e,i){return!1}isHidden(t){return!!(this.minzoom&&t=this.maxzoom)||"none"===this.visibility}updateTransitions(t){this._transitioningPaint=this._transitionablePaint.transitioned(t,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(t,e){t.getCrossfadeParameters&&(this._crossfadeParameters=t.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(t,void 0,e)),this.paint=this._transitioningPaint.possiblyEvaluate(t,void 0,e)}serialize(){const t={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(t.layout=t.layout||{},t.layout.visibility=this.visibility),ut(t,((t,e)=>!(void 0===t||"layout"===e&&!Object.keys(t).length||"paint"===e&&!Object.keys(t).length)))}_validate(t,e,i,n,r={}){return(!r||!1!==r.validate)&&Vr(this,t.call(Rr,{key:e,layerType:this.type,objectKey:i,value:n,styleSpec:xe,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isSky(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(const t in this.paint._values){const e=this.paint.get(t);if(e instanceof ta&&An(e.property.specification)&&("source"===e.value.kind||"composite"===e.value.kind)&&e.value.isStateDependent)return!0}return!1}compileFilter(){this._filterCompiled||(this._featureFilter=ar(this.filter),this._filterCompiled=!0)}invalidateCompiledFilter(){this._filterCompiled=!1}dynamicFilter(){return this._featureFilter.dynamicFilter}dynamicFilterNeedsFeature(){return this._featureFilter.needFeature}}const Cs=ha([{name:"a_pos",components:2,type:"Int16"}],4),{members:Ms}=Cs;class zs{constructor(t=[]){this.segments=t}prepareSegment(t,e,i,n){let r=this.segments[this.segments.length-1];return t>zs.MAX_VERTEX_ARRAY_LENGTH&&pt(`Max vertices per segment is ${zs.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${t}`),(!r||r.vertexLength+t>zs.MAX_VERTEX_ARRAY_LENGTH||r.sortKey!==n)&&(r={vertexOffset:e.length,primitiveOffset:i.length,vertexLength:0,primitiveLength:0},void 0!==n&&(r.sortKey=n),this.segments.push(r)),r}get(){return this.segments}destroy(){for(const t of this.segments)for(const e in t.vaos)t.vaos[e].destroy()}static simpleSegment(t,e,i,n){return new zs([{vertexOffset:t,primitiveOffset:e,vertexLength:i,primitiveLength:n,vaos:{},sortKey:0}])}}zs.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,Wr("SegmentVector",zs);var Is=8192;class Ps{constructor(t,e){t&&(e?this.setSouthWest(t).setNorthEast(e):4===t.length?this.setSouthWest([t[0],t[1]]).setNorthEast([t[2],t[3]]):this.setSouthWest(t[0]).setNorthEast(t[1]))}setNorthEast(t){return this._ne=t instanceof Ds?new Ds(t.lng,t.lat):Ds.convert(t),this}setSouthWest(t){return this._sw=t instanceof Ds?new Ds(t.lng,t.lat):Ds.convert(t),this}extend(t){const e=this._sw,i=this._ne;let n,r;if(t instanceof Ds)n=t,r=t;else{if(!(t instanceof Ps))return Array.isArray(t)?4===t.length||t.every(Array.isArray)?this.extend(Ps.convert(t)):this.extend(Ds.convert(t)):this;if(n=t._sw,r=t._ne,!n||!r)return this}return e||i?(e.lng=Math.min(n.lng,e.lng),e.lat=Math.min(n.lat,e.lat),i.lng=Math.max(r.lng,i.lng),i.lat=Math.max(r.lat,i.lat)):(this._sw=new Ds(n.lng,n.lat),this._ne=new Ds(r.lng,r.lat)),this}getCenter(){return new Ds((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)}getSouthWest(){return this._sw}getNorthEast(){return this._ne}getNorthWest(){return new Ds(this.getWest(),this.getNorth())}getSouthEast(){return new Ds(this.getEast(),this.getSouth())}getWest(){return this._sw.lng}getSouth(){return this._sw.lat}getEast(){return this._ne.lng}getNorth(){return this._ne.lat}toArray(){return[this._sw.toArray(),this._ne.toArray()]}toString(){return`LngLatBounds(${this._sw.toString()}, ${this._ne.toString()})`}isEmpty(){return!(this._sw&&this._ne)}contains(t){const{lng:e,lat:i}=Ds.convert(t);let n=this._sw.lng<=e&&e<=this._ne.lng;return this._sw.lng>this._ne.lng&&(n=this._sw.lng>=e&&e>=this._ne.lng),this._sw.lat<=i&&i<=this._ne.lat&&n}static convert(t){return!t||t instanceof Ps?t:new Ps(t)}}const As=6371008.8;class Ds{constructor(t,e){if(isNaN(t)||isNaN(e))throw new Error(`Invalid LngLat object: (${t}, ${e})`);if(this.lng=+t,this.lat=+e,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new Ds(J(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(t){const e=Math.PI/180,i=this.lat*e,n=t.lat*e,r=Math.sin(i)*Math.sin(n)+Math.cos(i)*Math.cos(n)*Math.cos((t.lng-this.lng)*e);return As*Math.acos(Math.min(r,1))}toBounds(t=0){const e=360*t/40075017,i=e/Math.cos(Math.PI/180*this.lat);return new Ps(new Ds(this.lng-i,this.lat-e),new Ds(this.lng+i,this.lat+e))}static convert(t){if(t instanceof Ds)return t;if(Array.isArray(t)&&(2===t.length||3===t.length))return new Ds(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&"object"==typeof t&&null!==t)return new Ds(Number("lng"in t?t.lng:t.lon),Number(t.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: , lat: }, an object {lon: , lat: }, or an array of [, ]")}}const Os=2*Math.PI*As;function Ls(t){return Os*Math.cos(t*Math.PI/180)}function Rs(t){return(180+t)/360}function Bs(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}function Fs(t,e){return t/Ls(e)}function js(t){return 360*t-180}function Ns(t){return 360/Math.PI*Math.atan(Math.exp((180-360*t)*Math.PI/180))-90}function Vs(t,e){return t*Ls(Ns(e))}const Us=85.051129;class Zs{constructor(t,e,i=0){this.x=+t,this.y=+e,this.z=+i}static fromLngLat(t,e=0){const i=Ds.convert(t);return new Zs(Rs(i.lng),Bs(i.lat),Fs(e,i.lat))}toLngLat(){return new Ds(js(this.x),Ns(this.y))}toAltitude(){return Vs(this.z,this.y)}meterInMercatorCoordinateUnits(){return 1/Os*(t=Ns(this.y),1/Math.cos(t*Math.PI/180));var t}}function $s(t,e,i,n,r,a,s,l,c){const u=(e+n)/2,d=(i+r)/2,h=new o(u,d);l(h),function(t,e,i,n,r,o){const a=i-r,s=n-o;return Math.abs((n-e)*a-(i-t)*s)/Math.hypot(a,s)}(h.x,h.y,a.x,a.y,s.x,s.y)>=c?($s(t,e,i,u,d,a,h,l,c),$s(t,u,d,n,r,h,s,l,c)):t.push(s)}function Gs(t,e,i){const n=[];let r,o,a;for(const s of t){const{x:t,y:l}=s;e(s),a?$s(n,r,o,t,l,a,s,e,i):n.push(s),r=t,o=l,a=s}return n}const qs=Math.pow(2,14)-1,Ws=-qs-1;function Hs(t,e){const i=Math.round(t.x*e),n=Math.round(t.y*e);return t.x=Y(i,Ws,qs),t.y=Y(n,Ws,qs),(it.x+1||nt.y+1)&&pt("Geometry exceeds allowed extent, reduce your vector tile buffer size"),t}function Xs(t,e,i){const n=t.loadGeometry(),r=t.extent,o=Is/r;if(e&&i&&i.projection.isReprojectedInTileSpace){const o=1<{const i=js((e.x+t.x/r)/o),n=Ns((e.y+t.y/r)/o),u=c.project(i,n);t.x=(u.x*a-s)*r,t.y=(u.y*a-l)*r};for(let e=0;e=r||i.y<0||i.y>=r||(u(i),t.push(i));n[e]=t}}for(const t of n)for(const e of t)Hs(e,o);return n}function Ys(t,e){return{type:t.type,id:t.id,properties:t.properties,geometry:e?Xs(t):[]}}function Ks(t,e,i,n,r){t.emplaceBack(2*e+(n+1)/2,2*i+(r+1)/2)}class Js{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((t=>t.id)),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new ma,this.indexArray=new Sa,this.segments=new zs,this.programConfigurations=new _s(t.layers,t.zoom),this.stateDependentLayerIds=this.layers.filter((t=>t.isStateDependent())).map((t=>t.id))}populate(t,e,i,n){const r=this.layers[0],o=[];let a=null;"circle"===r.type&&(a=r.layout.get("circle-sort-key"));for(const{feature:e,id:r,index:s,sourceLayerIndex:l}of t){const t=this.layers[0]._featureFilter.needGeometry,c=Ys(e,t);if(!this.layers[0]._featureFilter.filter(new Wo(this.zoom),c,i))continue;const u=a?a.evaluate(c,{},i):void 0,d={id:r,properties:e.properties,type:e.type,sourceLayerIndex:l,index:s,geometry:t?c.geometry:Xs(e,i,n),patterns:{},sortKey:u};o.push(d)}a&&o.sort(((t,e)=>t.sortKey-e.sortKey));for(const n of o){const{geometry:r,index:o,sourceLayerIndex:a}=n,s=t[o].feature;this.addFeature(n,r,o,e.availableImages,i),e.featureIndex.insert(s,r,o,a,this.index)}}update(t,e,i,n){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,i,n)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Ms),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(t,e,i,n,r){for(const i of e)for(const e of i){const i=e.x,n=e.y;if(i<0||i>=Is||n<0||n>=Is)continue;const r=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,t.sortKey),o=r.vertexLength;Ks(this.layoutVertexArray,i,n,-1,-1),Ks(this.layoutVertexArray,i,n,1,-1),Ks(this.layoutVertexArray,i,n,1,1),Ks(this.layoutVertexArray,i,n,-1,1),this.indexArray.emplaceBack(o,o+1,o+2),this.indexArray.emplaceBack(o,o+3,o+2),r.vertexLength+=4,r.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,i,{},n,r)}}function Qs(t,e){for(let i=0;i1){if(nl(t,e))return!0;for(let n=0;n1?i:i.sub(e)._mult(r)._add(e))}function sl(t,e){let i,n,r,o=!1;for(let a=0;ae.y!=r.y>e.y&&e.x<(r.x-n.x)*(e.y-n.y)/(r.y-n.y)+n.x&&(o=!o)}return o}function ll(t,e){let i=!1;for(let n=0,r=t.length-1;ne.y!=a.y>e.y&&e.x<(a.x-o.x)*(e.y-o.y)/(a.y-o.y)+o.x&&(i=!i)}return i}function cl(t,e,i,n,r){for(const o of t)if(e<=o.x&&i<=o.y&&n>=o.x&&r>=o.y)return!0;const a=[new o(e,i),new o(e,r),new o(n,r),new o(n,i)];if(t.length>2)for(const e of a)if(ll(t,e))return!0;for(let e=0;er.x&&e.x>r.x||t.yr.y&&e.y>r.y)return!1;const o=mt(t,e,i[0]);return o!==mt(t,e,i[1])||o!==mt(t,e,i[2])||o!==mt(t,e,i[3])}function dl(t,e,i){const n=e.paint.get(t).value;return"constant"===n.kind?n.value:i.programConfigurations.get(e.id).getMaxValue(t)}function hl(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function pl(t,e,i,n,r){if(!e[0]&&!e[1])return t;const a=o.convert(e)._mult(r);"viewport"===i&&a._rotate(-n);const s=[];for(let e=0;e{const o=B([],i,t),a=1/o[3]/e*r;return function(t,e,i){return t[0]=e[0]*i[0],t[1]=e[1]*i[1],t[2]=e[2]*i[2],t[3]=e[3]*i[3],t}(o,o,[a,a,n?1/o[3]:a,a])})),a=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map((t=>{const e=M([],I([],O([],o[t[0]],o[t[1]]),O([],o[t[2]],o[t[1]]))),i=-z(e,o[t[1]]);return e.concat(i)}));return new vl(o,a)}}class yl{constructor(t,e){this.min=t,this.max=e,this.center=S([],w([],this.min,this.max),.5)}quadrant(t){const e=[t%2==0,t<2],i=_(this.min),n=_(this.max);for(let t=0;t=0;if(0===o)return 0;o!==e.length&&(i=!1)}if(i)return 2;for(let e=0;e<3;e++){let i=Number.MAX_VALUE,n=-Number.MAX_VALUE;for(let r=0;rthis.max[e]-this.min[e])return 0}return 1}}function _l(t,e,i,n,r,o,a,s,l){if(o&&t.queryGeometry.isAboveHorizon)return!1;o&&(l*=t.pixelToTileUnitsFactor);for(const c of e)for(const e of c){const c=e.add(s),u=r&&i.elevation?i.elevation.exaggeration()*r.getElevationAt(c.x,c.y,!0):0,d=o?c:xl(c,u,n),h=o?t.tilespaceRays.map((t=>kl(t,u))):t.queryGeometry.screenGeometry,p=B([],[e.x,e.y,u,1],n);if(!a&&o?l*=p[3]/i.cameraToCenterDistance:a&&!o&&(l*=i.cameraToCenterDistance/p[3]),tl(h,d,l))return!0}return!1}function xl(t,e,i){const n=B([],[t.x,t.y,e,1],i);return new o(n[0]/n[3],n[1]/n[3])}const bl=b(0,0,0),wl=b(0,0,1);function kl(t,e){const i=y();return bl[2]=e,t.intersectsPlane(bl,wl,i),new o(i[0],i[1])}class El extends Js{}function Tl(t,{width:e,height:i},n,r){if(r){if(r instanceof Uint8ClampedArray)r=new Uint8Array(r.buffer);else if(r.length!==e*i*n)throw new RangeError("mismatched image size")}else r=new Uint8Array(e*i*n);return t.width=e,t.height=i,t.data=r,t}function Sl(t,{width:e,height:i},n){if(e===t.width&&i===t.height)return;const r=Tl({},{width:e,height:i},n);Cl(t,r,{x:0,y:0},{x:0,y:0},{width:Math.min(t.width,e),height:Math.min(t.height,i)},n),t.width=e,t.height=i,t.data=r.data}function Cl(t,e,i,n,r,o){if(0===r.width||0===r.height)return e;if(r.width>t.width||r.height>t.height||i.x>t.width-r.width||i.y>t.height-r.height)throw new RangeError("out of range source coordinates for image copy");if(r.width>e.width||r.height>e.height||n.x>e.width-r.width||n.y>e.height-r.height)throw new RangeError("out of range destination coordinates for image copy");const a=t.data,s=e.data;for(let l=0;l{e[t.evaluationKey]=o;const a=t.expression.evaluate(e);r.data[i+n+0]=Math.floor(255*a.r/a.a),r.data[i+n+1]=Math.floor(255*a.g/a.a),r.data[i+n+2]=Math.floor(255*a.b/a.a),r.data[i+n+3]=Math.floor(255*a.a)};if(t.clips)for(let e=0,r=0;e80*i){n=o=t[0],r=a=t[1];for(var m=i;mo&&(o=s),l>a&&(a=l);c=0!==(c=Math.max(o-n,a-r))?1/c:0}return Nl(h,p,i,n,r,c),p}function Fl(t,e,i,n,r){var o,a;if(r===lc(t,e,i,n)>0)for(o=e;o=e;o-=n)a=oc(o,t[o],t[o+1],a);return a&&Ql(a,a.next)&&(ac(a),a=a.next),a}function jl(t,e){if(!t)return t;e||(e=t);var i,n=t;do{if(i=!1,n.steiner||!Ql(n,n.next)&&0!==Jl(n.prev,n,n.next))n=n.next;else{if(ac(n),(n=e=n.prev)===n.next)break;i=!0}}while(i||n!==e);return e}function Nl(t,e,i,n,r,o,a){if(t){!a&&o&&function(t,e,i,n){var r=t;do{null===r.z&&(r.z=Hl(r.x,r.y,e,i,n)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,function(t){var e,i,n,r,o,a,s,l,c=1;do{for(i=t,t=null,o=null,a=0;i;){for(a++,n=i,s=0,e=0;e0||l>0&&n;)0!==s&&(0===l||!n||i.z<=n.z)?(r=i,i=i.nextZ,s--):(r=n,n=n.nextZ,l--),o?o.nextZ=r:t=r,r.prevZ=o,o=r;i=n}o.nextZ=null,c*=2}while(a>1)}(r)}(t,n,r,o);for(var s,l,c=t;t.prev!==t.next;)if(s=t.prev,l=t.next,o?Ul(t,n,r,o):Vl(t))e.push(s.i/i),e.push(t.i/i),e.push(l.i/i),ac(t),t=l.next,c=l.next;else if((t=l)===c){a?1===a?Nl(t=Zl(jl(t),e,i),e,i,n,r,o,2):2===a&&$l(t,e,i,n,r,o):Nl(jl(t),e,i,n,r,o,1);break}}}function Vl(t){var e=t.prev,i=t,n=t.next;if(Jl(e,i,n)>=0)return!1;for(var r=t.next.next;r!==t.prev;){if(Yl(e.x,e.y,i.x,i.y,n.x,n.y,r.x,r.y)&&Jl(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function Ul(t,e,i,n){var r=t.prev,o=t,a=t.next;if(Jl(r,o,a)>=0)return!1;for(var s=r.x>o.x?r.x>a.x?r.x:a.x:o.x>a.x?o.x:a.x,l=r.y>o.y?r.y>a.y?r.y:a.y:o.y>a.y?o.y:a.y,c=Hl(r.x=c&&h&&h.z<=u;){if(d!==t.prev&&d!==t.next&&Yl(r.x,r.y,o.x,o.y,a.x,a.y,d.x,d.y)&&Jl(d.prev,d,d.next)>=0)return!1;if(d=d.prevZ,h!==t.prev&&h!==t.next&&Yl(r.x,r.y,o.x,o.y,a.x,a.y,h.x,h.y)&&Jl(h.prev,h,h.next)>=0)return!1;h=h.nextZ}for(;d&&d.z>=c;){if(d!==t.prev&&d!==t.next&&Yl(r.x,r.y,o.x,o.y,a.x,a.y,d.x,d.y)&&Jl(d.prev,d,d.next)>=0)return!1;d=d.prevZ}for(;h&&h.z<=u;){if(h!==t.prev&&h!==t.next&&Yl(r.x,r.y,o.x,o.y,a.x,a.y,h.x,h.y)&&Jl(h.prev,h,h.next)>=0)return!1;h=h.nextZ}return!0}function Zl(t,e,i){var n=t;do{var r=n.prev,o=n.next.next;!Ql(r,o)&&tc(r,n,n.next,o)&&nc(r,o)&&nc(o,r)&&(e.push(r.i/i),e.push(n.i/i),e.push(o.i/i),ac(n),ac(n.next),n=t=o),n=n.next}while(n!==t);return jl(n)}function $l(t,e,i,n,r,o){var a=t;do{for(var s=a.next.next;s!==a.prev;){if(a.i!==s.i&&Kl(a,s)){var l=rc(a,s);return a=jl(a,a.next),l=jl(l,l.next),Nl(a,e,i,n,r,o),void Nl(l,e,i,n,r,o)}s=s.next}a=a.next}while(a!==t)}function Gl(t,e){return t.x-e.x}function ql(t,e){var i=function(t,e){var i,n=e,r=t.x,o=t.y,a=-1/0;do{if(o<=n.y&&o>=n.next.y&&n.next.y!==n.y){var s=n.x+(o-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=r&&s>a){if(a=s,s===r){if(o===n.y)return n;if(o===n.next.y)return n.next}i=n.x=n.x&&n.x>=u&&r!==n.x&&Yl(oi.x||n.x===i.x&&Wl(i,n)))&&(i=n,h=l)),n=n.next}while(n!==c);return i}(t,e);if(!i)return e;var n=rc(i,t),r=jl(i,i.next);return jl(n,n.next),e===i?r:e}function Wl(t,e){return Jl(t.prev,t,e.prev)<0&&Jl(e.next,t,t.next)<0}function Hl(t,e,i,n,r){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-i)*r)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*r)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function Xl(t){var e=t,i=t;do{(e.x=0&&(t-a)*(n-s)-(i-a)*(e-s)>=0&&(i-a)*(o-s)-(r-a)*(n-s)>=0}function Kl(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==e.i&&i.next.i!==e.i&&tc(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(t,e)&&(nc(t,e)&&nc(e,t)&&function(t,e){var i=t,n=!1,r=(t.x+e.x)/2,o=(t.y+e.y)/2;do{i.y>o!=i.next.y>o&&i.next.y!==i.y&&r<(i.next.x-i.x)*(o-i.y)/(i.next.y-i.y)+i.x&&(n=!n),i=i.next}while(i!==t);return n}(t,e)&&(Jl(t.prev,t,e.prev)||Jl(t,e.prev,e))||Ql(t,e)&&Jl(t.prev,t,t.next)>0&&Jl(e.prev,e,e.next)>0)}function Jl(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function Ql(t,e){return t.x===e.x&&t.y===e.y}function tc(t,e,i,n){var r=ic(Jl(t,e,i)),o=ic(Jl(t,e,n)),a=ic(Jl(i,n,t)),s=ic(Jl(i,n,e));return r!==o&&a!==s||!(0!==r||!ec(t,i,e))||!(0!==o||!ec(t,n,e))||!(0!==a||!ec(i,t,n))||!(0!==s||!ec(i,e,n))}function ec(t,e,i){return e.x<=Math.max(t.x,i.x)&&e.x>=Math.min(t.x,i.x)&&e.y<=Math.max(t.y,i.y)&&e.y>=Math.min(t.y,i.y)}function ic(t){return t>0?1:t<0?-1:0}function nc(t,e){return Jl(t.prev,t,t.next)<0?Jl(t,e,t.next)>=0&&Jl(t,t.prev,e)>=0:Jl(t,e,t.prev)<0||Jl(t,t.next,e)<0}function rc(t,e){var i=new sc(t.i,t.x,t.y),n=new sc(e.i,e.x,e.y),r=t.next,o=e.prev;return t.next=e,e.prev=t,i.next=r,r.prev=i,n.next=i,i.prev=n,o.next=n,n.prev=o,n}function oc(t,e,i,n){var r=new sc(t,e,i);return n?(r.next=n.next,r.prev=n,n.next.prev=r,n.next=r):(r.prev=r,r.next=r),r}function ac(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function sc(t,e,i){this.i=t,this.x=e,this.y=i,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function lc(t,e,i,n){for(var r=0,o=e,a=i-n;oi;){if(n-i>600){var o=n-i+1,a=e-i+1,s=Math.log(o),l=.5*Math.exp(2*s/3),c=.5*Math.sqrt(s*l*(o-l)/o)*(a-o/2<0?-1:1);uc(t,e,Math.max(i,Math.floor(e-a*l/o+c)),Math.min(n,Math.floor(e+(o-a)*l/o+c)),r)}var u=t[e],d=i,h=n;for(dc(t,i,e),r(t[n],u)>0&&dc(t,i,n);d0;)h--}0===r(t[i],u)?dc(t,i,h):dc(t,++h,n),h<=e&&(i=h+1),e<=h&&(n=h-1)}}function dc(t,e,i){var n=t[e];t[e]=t[i],t[i]=n}function hc(t,e){return te?1:0}function pc(t,e){const i=t.length;if(i<=1)return[t];const n=[];let r,o;for(let e=0;e1)for(let t=0;t0&&i.holes.push(n+=t[r-1].length)}return i},Ll.default=Rl;class vc{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((t=>t.id)),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new ma,this.indexArray=new Sa,this.indexArray2=new Da,this.programConfigurations=new _s(t.layers,t.zoom),this.segments=new zs,this.segments2=new zs,this.stateDependentLayerIds=this.layers.filter((t=>t.isStateDependent())).map((t=>t.id))}populate(t,e,i,n){this.hasPattern=fc("fill",this.layers,e);const r=this.layers[0].layout.get("fill-sort-key"),o=[];for(const{feature:a,id:s,index:l,sourceLayerIndex:c}of t){const t=this.layers[0]._featureFilter.needGeometry,u=Ys(a,t);if(!this.layers[0]._featureFilter.filter(new Wo(this.zoom),u,i))continue;const d=r?r.evaluate(u,{},i,e.availableImages):void 0,h={id:s,properties:a.properties,type:a.type,sourceLayerIndex:c,index:l,geometry:t?u.geometry:Xs(a,i,n),patterns:{},sortKey:d};o.push(h)}r&&o.sort(((t,e)=>t.sortKey-e.sortKey));for(const n of o){const{geometry:r,index:o,sourceLayerIndex:a}=n;if(this.hasPattern){const t=gc("fill",this.layers,n,this.zoom,e);this.patternFeatures.push(t)}else this.addFeature(n,r,o,i,{},e.availableImages);e.featureIndex.insert(t[o].feature,r,o,a,this.index)}}update(t,e,i,n){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,i,n)}addFeatures(t,e,i,n){for(const t of this.patternFeatures)this.addFeature(t,t.geometry,t.index,e,i,n)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Ol),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.indexBuffer2=t.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())}addFeature(t,e,i,n,r,o=[]){for(const t of pc(e,500)){let e=0;for(const i of t)e+=i.length;const i=this.segments.prepareSegment(e,this.layoutVertexArray,this.indexArray),n=i.vertexLength,r=[],o=[];for(const e of t){if(0===e.length)continue;e!==t[0]&&o.push(r.length/2);const i=this.segments2.prepareSegment(e.length,this.layoutVertexArray,this.indexArray2),n=i.vertexLength;this.layoutVertexArray.emplaceBack(e[0].x,e[0].y),this.indexArray2.emplaceBack(n+e.length-1,n),r.push(e[0].x),r.push(e[0].y);for(let t=1;t>3}if(r--,1===n||2===n)a+=t.readSVarint(),s+=t.readSVarint(),1===n&&(e&&l.push(e),e=[]),e.push(new o(a,s));else{if(7!==n)throw new Error("unknown command "+n);e&&e.push(e[0].clone())}}return e&&l.push(e),l},Ec.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,i=1,n=0,r=0,o=0,a=1/0,s=-1/0,l=1/0,c=-1/0;t.pos>3}if(n--,1===i||2===i)(r+=t.readSVarint())s&&(s=r),(o+=t.readSVarint())c&&(c=o);else if(7!==i)throw new Error("unknown command "+i)}return[a,l,s,c]},Ec.prototype.toGeoJSON=function(t,e,i){var n,r,o=this.extent*Math.pow(2,i),a=this.extent*t,s=this.extent*e,l=this.loadGeometry(),c=Ec.types[this.type];function u(t){for(var e=0;e>3;e=1===n?t.readString():2===n?t.readFloat():3===n?t.readDouble():4===n?t.readVarint64():5===n?t.readVarint():6===n?t.readSVarint():7===n?t.readBoolean():null}return e}(i))}function Ic(t,e,i){if(3===t){var n=new Cc(i,i.readVarint()+i.pos);n.length&&(e[n.name]=n)}}Mc.prototype.feature=function(t){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];var e=this._pbf.readVarint()+this._pbf.pos;return new kc(this._pbf,e,this.extent,this._keys,this._values)};var Pc={VectorTile:function(t,e){this.layers=t.readFields(Ic,{},e)},VectorTileFeature:kc,VectorTileLayer:Cc};const Ac=Pc.VectorTileFeature.types,Dc=Math.pow(2,13);function Oc(t,e,i,n,r,o,a,s){t.emplaceBack((e<<1)+a,(i<<1)+o,(Math.floor(n*Dc)<<1)+r,Math.round(s))}class Lc{constructor(){this.acc=new o(0,0),this.polyCount=[]}startRing(t){this.currentPolyCount={edges:0,top:0},this.polyCount.push(this.currentPolyCount),this.min||(this.min=new o(t.x,t.y),this.max=new o(t.x,t.y))}append(t,e){this.currentPolyCount.edges++,this.acc._add(t);let i=!!this.borders;const n=this.min,r=this.max;t.xr.x&&(r.x=t.x,i=!0),t.yr.y&&(r.y=t.y,i=!0),((0===t.x||t.x===Is)&&t.x===e.x)!=((0===t.y||t.y===Is)&&t.y===e.y)&&this.processBorderOverlap(t,e),i&&this.checkBorderIntersection(t,e)}checkBorderIntersection(t,e){e.x<0!=t.x<0&&this.addBorderIntersection(0,Fi(e.y,t.y,(0-e.x)/(t.x-e.x))),e.x>Is!=t.x>Is&&this.addBorderIntersection(1,Fi(e.y,t.y,(Is-e.x)/(t.x-e.x))),e.y<0!=t.y<0&&this.addBorderIntersection(2,Fi(e.x,t.x,(0-e.y)/(t.y-e.y))),e.y>Is!=t.y>Is&&this.addBorderIntersection(3,Fi(e.x,t.x,(Is-e.y)/(t.y-e.y)))}addBorderIntersection(t,e){this.borders||(this.borders=[[Number.MAX_VALUE,-Number.MAX_VALUE],[Number.MAX_VALUE,-Number.MAX_VALUE],[Number.MAX_VALUE,-Number.MAX_VALUE],[Number.MAX_VALUE,-Number.MAX_VALUE]]);const i=this.borders[t];ei[1]&&(i[1]=e)}processBorderOverlap(t,e){if(t.x===e.x){if(t.y===e.y)return;const i=0===t.x?0:1;this.addBorderIntersection(i,e.y),this.addBorderIntersection(i,t.y)}else{const i=0===t.y?2:3;this.addBorderIntersection(i,e.x),this.addBorderIntersection(i,t.x)}}centroid(){const t=this.polyCount.reduce(((t,e)=>t+e.edges),0);return 0!==t?this.acc.div(t)._round():new o(0,0)}span(){return new o(this.max.x-this.min.x,this.max.y-this.min.y)}intersectsCount(){return this.borders.reduce(((t,e)=>t+ +(e[0]!==Number.MAX_VALUE)),0)}}class Rc{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((t=>t.id)),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new fa,this.centroidVertexArray=new Ha,this.indexArray=new Sa,this.programConfigurations=new _s(t.layers,t.zoom),this.segments=new zs,this.stateDependentLayerIds=this.layers.filter((t=>t.isStateDependent())).map((t=>t.id)),this.enableTerrain=t.enableTerrain}populate(t,e,i,n){this.features=[],this.hasPattern=fc("fill-extrusion",this.layers,e),this.featuresOnBorder=[],this.borders=[[],[],[],[]],this.borderDone=[!1,!1,!1,!1],this.tileToMeter=function(t){const e=Math.exp(Math.PI*(1-t.y/(1<t.x<=0))||s.every((t=>t.x>=Is))||s.every((t=>t.y<=0))||s.every((t=>t.y>=Is)))continue;for(let t=0;t=1){const i=r[t-1];if(!Bc(e,i)){a&&a.append(e,i),n.vertexLength+4>zs.MAX_VERTEX_ARRAY_LENGTH&&(n=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));const t=e.sub(i)._perp(),r=t.x/(Math.abs(t.x)+Math.abs(t.y)),s=t.y>0?1:0,l=i.dist(e);o+l>32768&&(o=0),Oc(this.layoutVertexArray,e.x,e.y,r,s,0,0,o),Oc(this.layoutVertexArray,e.x,e.y,r,s,0,1,o),o+=l,Oc(this.layoutVertexArray,i.x,i.y,r,s,0,0,o),Oc(this.layoutVertexArray,i.x,i.y,r,s,0,1,o);const c=n.vertexLength;this.indexArray.emplaceBack(c,c+2,c+1),this.indexArray.emplaceBack(c+1,c+2,c+3),n.vertexLength+=4,n.primitiveLength+=2}}}}if(n.vertexLength+e>zs.MAX_VERTEX_ARRAY_LENGTH&&(n=this.segments.prepareSegment(e,this.layoutVertexArray,this.indexArray)),"Polygon"!==Ac[t.type])continue;const r=[],o=[],l=n.vertexLength;for(let t=0;t0){if(a.borders){a.vertexArrayOffset=this.centroidVertexArray.length;const t=a.borders,e=this.featuresOnBorder.push(a)-1;for(let i=0;i<4;i++)t[i][0]!==Number.MAX_VALUE&&this.borders[i].push(e)}this.encodeCentroid(a.borders?void 0:a.centroid(),a)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,i,r,o,n)}sortBorders(){for(let t=0;t<4;t++)this.borders[t].sort(((e,i)=>this.featuresOnBorder[e].borders[t][0]-this.featuresOnBorder[i].borders[t][0]))}encodeCentroid(t,e,i=!0){let n,r;if(t)if(0!==t.y){const i=e.span()._mult(this.tileToMeter);n=(Math.max(t.x,1)<<3)+Math.min(7,Math.round(i.x/10)),r=(Math.max(t.y,1)<<3)+Math.min(7,Math.round(i.y/10))}else n=Math.ceil(7*(t.x+450)),r=0;else n=0,r=+i;let o=i?this.centroidVertexArray.length:e.vertexArrayOffset;for(const t of e.polyCount){i&&this.centroidVertexArray.resize(this.centroidVertexArray.length+4*t.edges+t.top);for(let e=0;e<2*t.edges;e++)this.centroidVertexArray.emplace(o++,0,r),this.centroidVertexArray.emplace(o++,n,r);for(let e=0;eIs)||t.y===e.y&&(t.y<0||t.y>Is)}Wr("FillExtrusionBucket",Rc,{omit:["layers","features"]}),Wr("PartMetadata",Lc);var Fc={paint:new sa({"fill-extrusion-opacity":new ia(xe["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new na(xe["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new ia(xe["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new ia(xe["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new ra(xe["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new na(xe["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new na(xe["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new ia(xe["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})};function jc(t,e){return t.x*e.x+t.y*e.y}function Nc(t,e){if(1===t.length){let i=0;const n=e[i++];let r;for(;!r||n.equals(r);)if(r=e[i++],!r)return 1/0;for(;it.id)),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach((t=>{this.gradients[t.id]={}})),this.layoutVertexArray=new ga,this.layoutVertexArray2=new va,this.indexArray=new Sa,this.programConfigurations=new _s(t.layers,t.zoom),this.segments=new zs,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter((t=>t.isStateDependent())).map((t=>t.id))}populate(t,e,i,n){this.hasPattern=fc("line",this.layers,e);const r=this.layers[0].layout.get("line-sort-key"),o=[];for(const{feature:e,id:a,index:s,sourceLayerIndex:l}of t){const t=this.layers[0]._featureFilter.needGeometry,c=Ys(e,t);if(!this.layers[0]._featureFilter.filter(new Wo(this.zoom),c,i))continue;const u=r?r.evaluate(c,{},i):void 0,d={id:a,properties:e.properties,type:e.type,sourceLayerIndex:l,index:s,geometry:t?c.geometry:Xs(e,i,n),patterns:{},sortKey:u};o.push(d)}r&&o.sort(((t,e)=>t.sortKey-e.sortKey));const{lineAtlas:a,featureIndex:s}=e,l=this.addConstantDashes(a);for(const n of o){const{geometry:r,index:o,sourceLayerIndex:c}=n;if(l&&this.addFeatureDashes(n,a),this.hasPattern){const t=gc("line",this.layers,n,this.zoom,e);this.patternFeatures.push(t)}else this.addFeature(n,r,o,i,a.positions,e.availableImages);s.insert(t[o].feature,r,o,c,this.index)}}addConstantDashes(t){let e=!1;for(const i of this.layers){const n=i.paint.get("line-dasharray").value,r=i.layout.get("line-cap").value;if("constant"!==n.kind||"constant"!==r.kind)e=!0;else{const e=r.value,i=n.value;if(!i)continue;t.addDash(i.from,e),t.addDash(i.to,e),i.other&&t.addDash(i.other,e)}}return e}addFeatureDashes(t,e){const i=this.zoom;for(const n of this.layers){const r=n.paint.get("line-dasharray").value,o=n.layout.get("line-cap").value;if("constant"===r.kind&&"constant"===o.kind)continue;let a,s,l,c,u,d;if("constant"===r.kind){const t=r.value;if(!t)continue;a=t.other||t.to,s=t.to,l=t.from}else a=r.evaluate({zoom:i-1},t),s=r.evaluate({zoom:i},t),l=r.evaluate({zoom:i+1},t);"constant"===o.kind?c=u=d=o.value:(c=o.evaluate({zoom:i-1},t),u=o.evaluate({zoom:i},t),d=o.evaluate({zoom:i+1},t)),e.addDash(a,c),e.addDash(s,u),e.addDash(l,d);const h=e.getKey(a,c),p=e.getKey(s,u),m=e.getKey(l,d);t.patterns[n.id]={min:h,mid:p,max:m}}}update(t,e,i,n){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,i,n)}addFeatures(t,e,i,n){for(const t of this.patternFeatures)this.addFeature(t,t.geometry,t.index,e,i,n)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(0!==this.layoutVertexArray2.length&&(this.layoutVertexBuffer2=t.createVertexBuffer(this.layoutVertexArray2,qc)),this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,$c),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(t){if(t.properties&&t.properties.hasOwnProperty("mapbox_clip_start")&&t.properties.hasOwnProperty("mapbox_clip_end"))return{start:+t.properties.mapbox_clip_start,end:+t.properties.mapbox_clip_end}}addFeature(t,e,i,n,r,o){const a=this.layers[0].layout,s=a.get("line-join").evaluate(t,{}),l=a.get("line-cap").evaluate(t,{}),c=a.get("line-miter-limit"),u=a.get("line-round-limit");this.lineClips=this.lineFeatureClips(t);for(const i of e)this.addLine(i,t,s,l,c,u);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,i,r,o,n)}addLine(t,e,i,n,r,o){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineSoFar=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let e=0;e=2&&t[s-1].equals(t[s-2]);)s--;let l=0;for(;l0;if(b&&e>l){const t=d.dist(h);if(t>2*c){const e=d.sub(d.sub(h)._mult(c/t)._round());this.updateDistance(h,e),this.addCurrentVertex(e,m,0,0,u),h=e}}const k=h&&p;let E=k?i:a?"butt":n;if(k&&"round"===E&&(_r&&(E="bevel"),"bevel"===E&&(_>2&&(E="flipbevel"),_100)g=f.mult(-1);else{const t=_*m.add(f).mag()/m.sub(f).mag();g._perp()._mult(t*(w?-1:1))}this.addCurrentVertex(d,g,0,0,u),this.addCurrentVertex(d,g.mult(-1),0,0,u)}else if("bevel"===E||"fakeround"===E){const t=-Math.sqrt(_*_-1),e=w?t:0,i=w?0:t;if(h&&this.addCurrentVertex(d,m,e,i,u),"fakeround"===E){const t=Math.round(180*x/Math.PI/20);for(let e=1;e2*c){const e=d.add(p.sub(d)._mult(c/t)._round());this.updateDistance(d,e),this.addCurrentVertex(e,f,0,0,u),d=e}}}}addCurrentVertex(t,e,i,n,r,o=!1){const a=e.y*n-e.x,s=-e.y-e.x*n;this.addHalfVertex(t,e.x+e.y*i,e.y-e.x*i,o,!1,i,r),this.addHalfVertex(t,a,s,o,!0,-n,r)}addHalfVertex({x:t,y:e},i,n,r,o,a,s){this.layoutVertexArray.emplaceBack((t<<1)+(r?1:0),(e<<1)+(o?1:0),Math.round(63*i)+128,Math.round(63*n)+128,1+(0===a?0:a<0?-1:1),0,this.lineSoFar),this.lineClips&&this.layoutVertexArray2.emplaceBack(this.scaledDistance,this.lineClipsArray.length,this.lineSoFar);const l=s.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,l),s.primitiveLength++),o?this.e2=l:this.e1=l}updateScaledDistance(){if(this.lineClips){const t=this.totalDistance/(this.lineClips.end-this.lineClips.start);this.scaledDistance=this.distance/this.totalDistance,this.lineSoFar=t*this.lineClips.start+this.distance}else this.lineSoFar=this.distance}updateDistance(t,e){this.distance+=t.dist(e),this.updateScaledDistance()}}Wr("LineBucket",Xc,{omit:["layers","patternFeatures"]});const Yc=new sa({"line-cap":new na(xe.layout_line["line-cap"]),"line-join":new na(xe.layout_line["line-join"]),"line-miter-limit":new ia(xe.layout_line["line-miter-limit"]),"line-round-limit":new ia(xe.layout_line["line-round-limit"]),"line-sort-key":new na(xe.layout_line["line-sort-key"])});var Kc={paint:new sa({"line-opacity":new na(xe.paint_line["line-opacity"]),"line-color":new na(xe.paint_line["line-color"]),"line-translate":new ia(xe.paint_line["line-translate"]),"line-translate-anchor":new ia(xe.paint_line["line-translate-anchor"]),"line-width":new na(xe.paint_line["line-width"]),"line-gap-width":new na(xe.paint_line["line-gap-width"]),"line-offset":new na(xe.paint_line["line-offset"]),"line-blur":new na(xe.paint_line["line-blur"]),"line-dasharray":new ra(xe.paint_line["line-dasharray"]),"line-pattern":new ra(xe.paint_line["line-pattern"]),"line-gradient":new aa(xe.paint_line["line-gradient"])}),layout:Yc};const Jc=new class extends na{possiblyEvaluate(t,e){return e=new Wo(Math.floor(e.zoom),{now:e.now,fadeDuration:e.fadeDuration,zoomHistory:e.zoomHistory,transition:e.transition}),super.possiblyEvaluate(t,e)}evaluate(t,e,i,n){return e=et({},e,{zoom:Math.floor(e.zoom)}),super.evaluate(t,e,i,n)}}(Kc.paint.properties["line-width"].specification);function Qc(t,e){return e>0?e+2*t:t}Jc.useIntegerZoom=!0;const tu=ha([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_tex_size",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"},{name:"a_z_tile_anchor",components:4,type:"Int16"}],4),eu=ha([{name:"a_projected_pos",components:3,type:"Float32"}],4);ha([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const iu=ha([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}]),nu=ha([{name:"a_size_scale",components:1,type:"Float32"},{name:"a_padding",components:2,type:"Float32"}]);ha([{type:"Int16",name:"projectedAnchorX"},{type:"Int16",name:"projectedAnchorY"},{type:"Int16",name:"projectedAnchorZ"},{type:"Int16",name:"tileAnchorX"},{type:"Int16",name:"tileAnchorY"},{type:"Float32",name:"x1"},{type:"Float32",name:"y1"},{type:"Float32",name:"x2"},{type:"Float32",name:"y2"},{type:"Int16",name:"padding"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]);const ru=ha([{name:"a_pos",components:3,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),ou=ha([{name:"a_pos_2f",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);ha([{name:"triangle",components:3,type:"Uint16"}]),ha([{type:"Int16",name:"projectedAnchorX"},{type:"Int16",name:"projectedAnchorY"},{type:"Int16",name:"projectedAnchorZ"},{type:"Float32",name:"tileAnchorX"},{type:"Float32",name:"tileAnchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"},{type:"Uint8",name:"flipState"}]),ha([{type:"Int16",name:"projectedAnchorX"},{type:"Int16",name:"projectedAnchorY"},{type:"Int16",name:"projectedAnchorZ"},{type:"Float32",name:"tileAnchorX"},{type:"Float32",name:"tileAnchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",components:2,name:"textOffset"},{type:"Float32",name:"collisionCircleDiameter"}]),ha([{type:"Float32",name:"offsetX"}]),ha([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);var au=24;const su=128;function lu(t,e){const{expression:i}=e;if("constant"===i.kind)return{kind:"constant",layoutSize:i.evaluate(new Wo(t+1))};if("source"===i.kind)return{kind:"source"};{const{zoomStops:e,interpolationType:n}=i;let r=0;for(;r{t.text=function(t,e,i){const n=e.layout.get("text-transform").evaluate(i,{});return"uppercase"===n?t=t.toLocaleUpperCase():"lowercase"===n&&(t=t.toLocaleLowerCase()),qo.applyArabicShaping&&(t=qo.applyArabicShaping(t)),t}(t.text,e,i)})),t}const pu={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"};function mu(t){return"︶"===t||"﹈"===t||"︸"===t||"﹄"===t||"﹂"===t||"︾"===t||"︼"===t||"︺"===t||"︘"===t||"﹀"===t||"︐"===t||"︓"===t||"︔"===t||"`"===t||" ̄"===t||"︑"===t||"︒"===t}function fu(t){return"︵"===t||"﹇"===t||"︷"===t||"﹃"===t||"﹁"===t||"︽"===t||"︻"===t||"︹"===t||"︗"===t||"︿"===t}var gu=function(t,e,i,n,r){var o,a,s=8*r-n-1,l=(1<>1,u=-7,d=i?r-1:0,h=i?-1:1,p=t[e+d];for(d+=h,o=p&(1<<-u)-1,p>>=-u,u+=s;u>0;o=256*o+t[e+d],d+=h,u-=8);for(a=o&(1<<-u)-1,o>>=-u,u+=n;u>0;a=256*a+t[e+d],d+=h,u-=8);if(0===o)o=1-c;else{if(o===l)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,n),o-=c}return(p?-1:1)*a*Math.pow(2,o-n)},vu=function(t,e,i,n,r,o){var a,s,l,c=8*o-r-1,u=(1<>1,h=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,m=n?1:-1,f=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=u):(a=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-a))<1&&(a--,l*=2),(e+=a+d>=1?h/l:h*Math.pow(2,1-d))*l>=2&&(a++,l/=2),a+d>=u?(s=0,a=u):a+d>=1?(s=(e*l-1)*Math.pow(2,r),a+=d):(s=e*Math.pow(2,d-1)*Math.pow(2,r),a=0));r>=8;t[i+p]=255&s,p+=m,s/=256,r-=8);for(a=a<0;t[i+p]=255&a,p+=m,a/=256,c-=8);t[i+p-m]|=128*f},yu=_u;function _u(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}_u.Varint=0,_u.Fixed64=1,_u.Bytes=2,_u.Fixed32=5;var xu=4294967296,bu=1/xu,wu="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function ku(t){return t.type===_u.Bytes?t.readVarint()+t.pos:t.pos+1}function Eu(t,e,i){return i?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function Tu(t,e,i){var n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));i.realloc(n);for(var r=i.pos-1;r>=t;r--)i.buf[r+n]=i.buf[r]}function Su(t,e){for(var i=0;i>>8,t[i+2]=e>>>16,t[i+3]=e>>>24}function Bu(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}function Fu(t,e,i){e.glyphs=[],1===t&&i.readMessage(ju,e)}function ju(t,e,i){if(3===t){const{id:t,bitmap:n,width:r,height:o,left:a,top:s,advance:l}=i.readMessage(Nu,{});e.glyphs.push({id:t,bitmap:new Ml({width:r+6,height:o+6},n),metrics:{width:r,height:o,left:a,top:s,advance:l}})}else 4===t?e.ascender=i.readSVarint():5===t&&(e.descender=i.readSVarint())}function Nu(t,e,i){1===t?e.id=i.readVarint():2===t?e.bitmap=i.readBytes():3===t?e.width=i.readVarint():4===t?e.height=i.readVarint():5===t?e.left=i.readSVarint():6===t?e.top=i.readSVarint():7===t&&(e.advance=i.readVarint())}function Vu(t){let e=0,i=0;for(const n of t)e+=n.w*n.h,i=Math.max(i,n.w);t.sort(((t,e)=>e.h-t.h));const n=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(e/.95)),i),h:1/0}];let r=0,o=0;for(const e of t)for(let t=n.length-1;t>=0;t--){const i=n[t];if(!(e.w>i.w||e.h>i.h)){if(e.x=i.x,e.y=i.y,o=Math.max(o,e.y+e.h),r=Math.max(r,e.x+e.w),e.w===i.w&&e.h===i.h){const e=n.pop();t>3,o=this.pos;this.type=7&n,t(r,e,this),this.pos===o&&this.skip(n)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=Lu(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=Bu(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=Lu(this.buf,this.pos)+Lu(this.buf,this.pos+4)*xu;return this.pos+=8,t},readSFixed64:function(){var t=Lu(this.buf,this.pos)+Bu(this.buf,this.pos+4)*xu;return this.pos+=8,t},readFloat:function(){var t=gu(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=gu(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,i,n=this.buf;return e=127&(i=n[this.pos++]),i<128?e:(e|=(127&(i=n[this.pos++]))<<7,i<128?e:(e|=(127&(i=n[this.pos++]))<<14,i<128?e:(e|=(127&(i=n[this.pos++]))<<21,i<128?e:function(t,e,i){var n,r,o=i.buf;if(n=(112&(r=o[i.pos++]))>>4,r<128)return Eu(t,n,e);if(n|=(127&(r=o[i.pos++]))<<3,r<128)return Eu(t,n,e);if(n|=(127&(r=o[i.pos++]))<<10,r<128)return Eu(t,n,e);if(n|=(127&(r=o[i.pos++]))<<17,r<128)return Eu(t,n,e);if(n|=(127&(r=o[i.pos++]))<<24,r<128)return Eu(t,n,e);if(n|=(1&(r=o[i.pos++]))<<31,r<128)return Eu(t,n,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(i=n[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2==1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=12&&wu?function(t,e,i){return wu.decode(t.subarray(e,i))}(this.buf,e,t):function(t,e,i){for(var n="",r=e;r239?4:l>223?3:l>191?2:1;if(r+u>i)break;1===u?l<128&&(c=l):2===u?128==(192&(o=t[r+1]))&&(c=(31&l)<<6|63&o)<=127&&(c=null):3===u?(a=t[r+2],128==(192&(o=t[r+1]))&&128==(192&a)&&((c=(15&l)<<12|(63&o)<<6|63&a)<=2047||c>=55296&&c<=57343)&&(c=null)):4===u&&(a=t[r+2],s=t[r+3],128==(192&(o=t[r+1]))&&128==(192&a)&&128==(192&s)&&((c=(15&l)<<18|(63&o)<<12|(63&a)<<6|63&s)<=65535||c>=1114112)&&(c=null)),null===c?(c=65533,u=1):c>65535&&(c-=65536,n+=String.fromCharCode(c>>>10&1023|55296),c=56320|1023&c),n+=String.fromCharCode(c),r+=u}return n}(this.buf,e,t)},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){if(this.type!==_u.Bytes)return t.push(this.readVarint(e));var i=ku(this);for(t=t||[];this.pos127;);else if(e===_u.Bytes)this.pos=this.readVarint()+this.pos;else if(e===_u.Fixed32)this.pos+=4;else{if(e!==_u.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e268435455||t<0?function(t,e){var i,n;if(t>=0?(i=t%4294967296|0,n=t/4294967296|0):(n=~(-t/4294967296),4294967295^(i=~(-t%4294967296))?i=i+1|0:(i=0,n=n+1|0)),t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),function(t,e,i){i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos++]=127&t|128,i.buf[i.pos]=127&(t>>>=7)}(i,0,e),function(t,e){var i=(7&t)<<4;e.buf[e.pos++]|=i|((t>>>=3)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t)))))}(n,e)}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var e=this.pos;this.pos=function(t,e,i){for(var n,r,o=0;o55295&&n<57344){if(!r){n>56319||o+1===e.length?(t[i++]=239,t[i++]=191,t[i++]=189):r=n;continue}if(n<56320){t[i++]=239,t[i++]=191,t[i++]=189,r=n;continue}n=r-55296<<10|n-56320|65536,r=null}else r&&(t[i++]=239,t[i++]=191,t[i++]=189,r=null);n<128?t[i++]=n:(n<2048?t[i++]=n>>6|192:(n<65536?t[i++]=n>>12|224:(t[i++]=n>>18|240,t[i++]=n>>12&63|128),t[i++]=n>>6&63|128),t[i++]=63&n|128)}return i}(this.buf,t,this.pos);var i=this.pos-e;i>=128&&Tu(e,i,this),this.pos=e-1,this.writeVarint(i),this.pos+=i},writeFloat:function(t){this.realloc(4),vu(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),vu(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var i=0;i=128&&Tu(i,n,this),this.pos=i-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,i){this.writeTag(t,_u.Bytes),this.writeRawMessage(e,i)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,Su,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,Cu,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,Iu,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,Mu,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,zu,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,Pu,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,Au,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,Du,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,Ou,e)},writeBytesField:function(t,e){this.writeTag(t,_u.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,_u.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,_u.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,_u.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,_u.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,_u.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,_u.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,_u.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,_u.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,_u.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}};class Uu{constructor(t,{pixelRatio:e,version:i,stretchX:n,stretchY:r,content:o}){this.paddedRect=t,this.pixelRatio=e,this.stretchX=n,this.stretchY=r,this.content=o,this.version=i}get tl(){return[this.paddedRect.x+1,this.paddedRect.y+1]}get br(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]}get displaySize(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]}}class Zu{constructor(t,e){const i={},n={};this.haveRenderCallbacks=[];const r=[];this.addImages(t,i,r),this.addImages(e,n,r);const{w:o,h:a}=Vu(r),s=new zl({width:o||1,height:a||1});for(const e in t){const n=t[e],r=i[e].paddedRect;zl.copy(n.data,s,{x:0,y:0},{x:r.x+1,y:r.y+1},n.data)}for(const t in e){const i=e[t],r=n[t].paddedRect,o=r.x+1,a=r.y+1,l=i.data.width,c=i.data.height;zl.copy(i.data,s,{x:0,y:0},{x:o,y:a},i.data),zl.copy(i.data,s,{x:0,y:c-1},{x:o,y:a-1},{width:l,height:1}),zl.copy(i.data,s,{x:0,y:0},{x:o,y:a+c},{width:l,height:1}),zl.copy(i.data,s,{x:l-1,y:0},{x:o-1,y:a},{width:1,height:c}),zl.copy(i.data,s,{x:0,y:0},{x:o+l,y:a},{width:1,height:c})}this.image=s,this.iconPositions=i,this.patternPositions=n}addImages(t,e,i){for(const n in t){const r=t[n],o={x:0,y:0,w:r.data.width+2,h:r.data.height+2};i.push(o),e[n]=new Uu(o,r),r.hasRenderCallback&&this.haveRenderCallbacks.push(n)}}patchUpdatedImages(t,e){t.dispatchRenderCallbacks(this.haveRenderCallbacks);for(const i in t.updatedImages)this.patchUpdatedImage(this.iconPositions[i],t.getImage(i),e),this.patchUpdatedImage(this.patternPositions[i],t.getImage(i),e)}patchUpdatedImage(t,e,i){if(!t||!e)return;if(t.version===e.version)return;t.version=e.version;const[n,r]=t.tl;i.update(e.data,void 0,{x:n,y:r})}}Wr("ImagePosition",Uu),Wr("ImageAtlas",Zu);const $u={horizontal:1,vertical:2,horizontalOnly:3};class Gu{constructor(){this.scale=1,this.fontStack="",this.imageName=null}static forText(t,e){const i=new Gu;return i.scale=t||1,i.fontStack=e,i}static forImage(t){const e=new Gu;return e.imageName=t,e}}class qu{constructor(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null}static fromFeature(t,e){const i=new qu;for(let n=0;n=0&&i>=t&&Hu[this.text.charCodeAt(i)];i--)e--;this.text=this.text.substring(t,e),this.sectionIndex=this.sectionIndex.slice(t,e)}substring(t,e){const i=new qu;return i.text=this.text.substring(t,e),i.sectionIndex=this.sectionIndex.slice(t,e),i.sections=this.sections,i}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce(((t,e)=>Math.max(t,this.sections[e].scale)),0)}addTextSection(t,e){this.text+=t.text,this.sections.push(Gu.forText(t.scale,t.fontStack||e));const i=this.sections.length-1;for(let e=0;e=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function Wu(t,e,i,n,r,o,a,s,l,c,u,d,h,p,m,f){const g=qu.fromFeature(t,r);let v;d===$u.vertical&&g.verticalizePunctuation(h);const{processBidirectionalText:y,processStyledBidirectionalText:_}=qo;if(y&&1===g.sections.length){v=[];const t=y(g.toString(),ed(g,c,o,e,n,p,m));for(const e of t){const t=new qu;t.text=e,t.sections=g.sections;for(let i=0;i0&&o>b&&(b=o)}else{const t=i[s.fontStack];if(!t)continue;t[f]&&(E=t[f]);const n=e[s.fontStack];if(!n)continue;const o=n.glyphs[f];if(!o)continue;if(_=o.metrics,S=8203!==f?au:0,g){const t=void 0!==n.ascender?Math.abs(n.ascender):0,e=void 0!==n.descender?Math.abs(n.descender):0,i=(t+e)*v;w=0;let u=0;for(let i=0;i-i/2;){if(a--,a<0)return!1;s-=t[a].dist(o),o=t[a]}s+=t[a].dist(t[a+1]),a++;const l=[];let c=0;for(;sn;)c-=l.shift().angleDelta;if(c>r)return!1;a++,s+=e.dist(i)}return!0}function ld(t){let e=0;for(let i=0;ic){const u=(c-l)/o,d=Fi(n.x,r.x,u),h=Fi(n.y,r.y,u),p=new ad(d,h,0,r.angleTo(n),i);return!a||sd(t,p,s,a,e)?p:void 0}l+=o}}function hd(t,e,i,n,r,o,a,s,l){const c=cd(n,o,a),u=ud(n,r),d=u*a,h=0===t[0].x||t[0].x===l||0===t[0].y||t[0].y===l;return e-d=0&&v=0&&y=0&&h+c<=u){const i=new ad(v,y,0,f,e);i._round(),n&&!sd(t,i,o,n,r)||p.push(i)}}d+=m}return s||p.length||a||(p=pd(t,d/2,i,n,r,o,a,!0,l)),p}function md(t,e,i,n,r){const a=[];for(let s=0;s=n&&u.x>=n||(s.x>=n?s=new o(n,s.y+(n-s.x)/(u.x-s.x)*(u.y-s.y))._round():u.x>=n&&(u=new o(n,s.y+(n-s.x)/(u.x-s.x)*(u.y-s.y))._round()),s.y>=r&&u.y>=r||(s.y>=r?s=new o(s.x+(r-s.y)/(u.y-s.y)*(u.x-s.x),r)._round():u.y>=r&&(u=new o(s.x+(r-s.y)/(u.y-s.y)*(u.x-s.x),r)._round()),c&&s.equals(c[c.length-1])||(c=[s],a.push(c)),c.push(u)))))}}return a}Wr("Anchor",ad);const fd=1e20;function gd(t,e,i,n,r,o,a,s,l){for(let c=e;c-1);l++,o[l]=s,a[l]=c,a[l+1]=fd}for(let s=0,l=0;s{let n=this.entries[t];n||(n=this.entries[t]={glyphs:{},requests:{},ranges:{},ascender:void 0,descender:void 0});let r=n.glyphs[e];if(void 0!==r)return void i(null,{stack:t,id:e,glyph:r});if(r=this._tinySDF(n,t,e),r)return n.glyphs[e]=r,void i(null,{stack:t,id:e,glyph:r});const o=Math.floor(e/256);if(256*o>65535)return void i(new Error("glyphs > 65535 not supported"));if(n.ranges[o])return void i(null,{stack:t,id:e,glyph:r});let a=n.requests[o];a||(a=n.requests[o]=[],_d.loadGlyphRange(t,o,this.url,this.requestManager,((t,e)=>{if(e){n.ascender=e.ascender,n.descender=e.descender;for(const t in e.glyphs)this._doesCharSupportLocalGlyph(+t)||(n.glyphs[+t]=e.glyphs[+t]);n.ranges[o]=!0}for(const i of a)i(t,e);delete n.requests[o]}))),a.push(((n,r)=>{n?i(n):r&&i(null,{stack:t,id:e,glyph:r.glyphs[e]||null})}))}),((t,i)=>{if(t)e(t);else if(i){const t={};for(const{stack:e,id:n,glyph:r}of i)void 0===t[e]&&(t[e]={}),void 0===t[e].glyphs&&(t[e].glyphs={}),t[e].glyphs[n]=r&&{id:r.id,bitmap:r.bitmap.clone(),metrics:r.metrics},t[e].ascender=this.entries[e].ascender,t[e].descender=this.entries[e].descender;e(null,t)}}))}_doesCharSupportLocalGlyph(t){return this.localGlyphMode!==yd.none&&(this.localGlyphMode===yd.all?!!this.localFontFamily:!!this.localFontFamily&&(go(t)||_o(t)||ao(t)||so(t))||oo(t))}_tinySDF(t,e,i){const n=this.localFontFamily;if(!n||!this._doesCharSupportLocalGlyph(i))return;let r=t.tinySDF;if(!r){let i="400";/bold/i.test(e)?i="900":/medium/i.test(e)?i="500":/light/i.test(e)&&(i="200"),r=t.tinySDF=new _d.TinySDF({fontFamily:n,fontWeight:i,fontSize:48,buffer:6,radius:16}),r.fontWeight=i}if(this.localGlyphs[r.fontWeight][i])return this.localGlyphs[r.fontWeight][i];const o=String.fromCharCode(i),{data:a,width:s,height:l,glyphWidth:c,glyphHeight:u,glyphLeft:d,glyphTop:h,glyphAdvance:p}=r.draw(o);return this.localGlyphs[r.fontWeight][i]={id:i,bitmap:new Ml({width:s,height:l},a),metrics:{width:c/2,height:u/2,left:d/2,top:h/2-27,advance:p/2,localGlyph:!0}}}}function xd(t,e,i,n){const r=[],a=t.image,s=a.pixelRatio,l=a.paddedRect.w-2,c=a.paddedRect.h-2,u=t.right-t.left,d=t.bottom-t.top,h=a.stretchX||[[0,l]],p=a.stretchY||[[0,c]],m=(t,e)=>t+e[1]-e[0],f=h.reduce(m,0),g=p.reduce(m,0),v=l-f,y=c-g;let _=0,x=f,b=0,w=g,k=0,E=v,T=0,S=y;if(a.content&&n){const t=a.content;_=bd(h,0,t[0]),b=bd(p,0,t[1]),x=bd(h,t[0],t[2]),w=bd(p,t[1],t[3]),k=t[0]-_,T=t[1]-b,E=t[2]-t[0]-x,S=t[3]-t[1]-w}const C=(n,r,l,c)=>{const h=kd(n.stretch-_,x,u,t.left),p=Ed(n.fixed-k,E,n.stretch,f),m=kd(r.stretch-b,w,d,t.top),v=Ed(r.fixed-T,S,r.stretch,g),y=kd(l.stretch-_,x,u,t.left),C=Ed(l.fixed-k,E,l.stretch,f),M=kd(c.stretch-b,w,d,t.top),z=Ed(c.fixed-T,S,c.stretch,g),I=new o(h,m),P=new o(y,m),A=new o(y,M),D=new o(h,M),O=new o(p/s,v/s),L=new o(C/s,z/s),R=e*Math.PI/180;if(R){const t=Math.sin(R),e=Math.cos(R),i=[e,-t,t,e];I._matMult(i),P._matMult(i),D._matMult(i),A._matMult(i)}const B=n.stretch+n.fixed,F=r.stretch+r.fixed;return{tl:I,tr:P,bl:D,br:A,tex:{x:a.paddedRect.x+1+B,y:a.paddedRect.y+1+F,w:l.stretch+l.fixed-B,h:c.stretch+c.fixed-F},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:O,pixelOffsetBR:L,minFontScaleX:E/s/u,minFontScaleY:S/s/d,isSDF:i}};if(n&&(a.stretchX||a.stretchY)){const t=wd(h,v,f),e=wd(p,y,g);for(let i=0;i{if(t)r(t);else if(e){const t={},i=function(t){return new yu(t).readFields(Fu,{})}(e);for(const e of i.glyphs)t[e.id]=e;r(null,{glyphs:t,ascender:i.ascender,descender:i.descender})}}))},_d.TinySDF=class{constructor({fontSize:t=24,buffer:e=3,radius:i=8,cutoff:n=.25,fontFamily:r="sans-serif",fontWeight:o="normal",fontStyle:a="normal"}){this.buffer=e,this.cutoff=n,this.radius=i;const s=this.size=t+4*e,l=this._createCanvas(s),c=this.ctx=l.getContext("2d",{willReadFrequently:!0});c.font=`${a} ${o} ${t}px ${r}`,c.textBaseline="alphabetic",c.textAlign="left",c.fillStyle="black",this.gridOuter=new Float64Array(s*s),this.gridInner=new Float64Array(s*s),this.f=new Float64Array(s),this.z=new Float64Array(s+1),this.v=new Uint16Array(s)}_createCanvas(t){const e=document.createElement("canvas");return e.width=e.height=t,e}draw(t){const{width:e,actualBoundingBoxAscent:i,actualBoundingBoxDescent:n,actualBoundingBoxLeft:r,actualBoundingBoxRight:o}=this.ctx.measureText(t),a=Math.floor(i),s=Math.min(this.size-this.buffer,Math.ceil(o-r)),l=Math.min(this.size-this.buffer,Math.ceil(i)+Math.ceil(n)),c=s+2*this.buffer,u=l+2*this.buffer,d=c*u,h=new Uint8ClampedArray(d),p={data:h,width:c,height:u,glyphWidth:s,glyphHeight:l,glyphTop:a,glyphLeft:0,glyphAdvance:e};if(0===s||0===l)return p;const{ctx:m,buffer:f,gridInner:g,gridOuter:v}=this;m.clearRect(f,f,s,l),m.fillText(t,f,f+a+1);const y=m.getImageData(f,f,s,l);v.fill(fd,0,d),g.fill(0,0,d);for(let t=0;t0?t*t:0,g[n]=t<0?t*t:0}}gd(v,0,0,c,u,c,this.f,this.v,this.z),gd(g,f,f,s,l,c,this.f,this.v,this.z);for(let t=0;t0)for(let t=(this.length>>1)-1;t>=0;t--)this._down(t)}push(t){this.data.push(t),this.length++,this._up(this.length-1)}pop(){if(0===this.length)return;const t=this.data[0],e=this.data.pop();return this.length--,this.length>0&&(this.data[0]=e,this._down(0)),t}peek(){return this.data[0]}_up(t){const{data:e,compare:i}=this,n=e[t];for(;t>0;){const r=t-1>>1,o=e[r];if(i(n,o)>=0)break;e[t]=o,t=r}e[t]=n}_down(t){const{data:e,compare:i}=this,n=this.length>>1,r=e[t];for(;t=0)break;e[t]=o,t=n}e[t]=r}}function Cd(t,e){return te?1:0}function Md(t,e=1,i=!1){let n=1/0,r=1/0,a=-1/0,s=-1/0;const l=t[0];for(let t=0;ta)&&(a=e.x),(!t||e.y>s)&&(s=e.y)}const c=Math.min(a-n,s-r);let u=c/2;const d=new Sd([],zd);if(0===c)return new o(n,r);for(let e=n;eh.d||!h.d)&&(h=n,i&&console.log("found best %d after %d probes",Math.round(1e4*n.d)/1e4,p)),n.max-h.d<=e||(u=n.h/2,d.push(new Id(n.p.x-u,n.p.y-u,u,t)),d.push(new Id(n.p.x+u,n.p.y-u,u,t)),d.push(new Id(n.p.x-u,n.p.y+u,u,t)),d.push(new Id(n.p.x+u,n.p.y+u,u,t)),p+=4)}return i&&(console.log(`num probes: ${p}`),console.log(`best distance: ${h.d}`)),h.p}function zd(t,e){return e.max-t.max}function Id(t,e,i,n){this.p=new o(t,e),this.h=i,this.d=function(t,e){let i=!1,n=1/0;for(let r=0;rt.y!=s.y>t.y&&t.x<(s.x-r.x)*(t.y-r.y)/(s.y-r.y)+r.x&&(i=!i),n=Math.min(n,al(t,r,s))}}return(i?1:-1)*Math.sqrt(n)}(this.p,n),this.max=this.d+this.h*Math.SQRT2}const Pd=Number.POSITIVE_INFINITY,Ad=Math.sqrt(2);function Dd(t,e){return e[1]!==Pd?function(t,e,i){let n=0,r=0;switch(e=Math.abs(e),i=Math.abs(i),t){case"top-right":case"top-left":case"top":r=i-7;break;case"bottom-right":case"bottom-left":case"bottom":r=7-i}switch(t){case"top-right":case"bottom-right":case"right":n=-e;break;case"top-left":case"bottom-left":case"left":n=e}return[n,r]}(t,e[0],e[1]):function(t,e){let i=0,n=0;e<0&&(e=0);const r=e/Ad;switch(t){case"top-right":case"top-left":n=r-7;break;case"bottom-right":case"bottom-left":n=7-r;break;case"bottom":n=7-e;break;case"top":n=e-7}switch(t){case"top-right":case"bottom-right":i=-r;break;case"top-left":case"bottom-left":i=r;break;case"left":i=e;break;case"right":i=-e}return[i,n]}(t,e[0])}function Od(t,e,i,n,r,o,a,s,l,c){t.createArrays(),t.tilePixelRatio=Is/(512*t.overscaling),t.compareText={},t.iconsNeedLinear=!1;const u=t.layers[0].layout,d=t.layers[0]._unevaluatedLayout._values,h={};if("composite"===t.textSizeData.kind){const{minZoom:e,maxZoom:i}=t.textSizeData;h.compositeTextSizes=[d["text-size"].possiblyEvaluate(new Wo(e),s),d["text-size"].possiblyEvaluate(new Wo(i),s)]}if("composite"===t.iconSizeData.kind){const{minZoom:e,maxZoom:i}=t.iconSizeData;h.compositeIconSizes=[d["icon-size"].possiblyEvaluate(new Wo(e),s),d["icon-size"].possiblyEvaluate(new Wo(i),s)]}h.layoutTextSize=d["text-size"].possiblyEvaluate(new Wo(l+1),s),h.layoutIconSize=d["icon-size"].possiblyEvaluate(new Wo(l+1),s),h.textMaxSize=d["text-size"].possiblyEvaluate(new Wo(18),s);const p="map"===u.get("text-rotation-alignment")&&"point"!==u.get("symbol-placement"),m=u.get("text-size");for(const o of t.features){const l=u.get("text-font").evaluate(o,{},s).join(","),d=m.evaluate(o,{},s),f=h.layoutTextSize.evaluate(o,{},s),g=(h.layoutIconSize.evaluate(o,{},s),{horizontal:{},vertical:void 0}),v=o.text;let y,_=[0,0];if(v){const n=v.toString(),a=u.get("text-letter-spacing").evaluate(o,{},s)*au,c=u.get("text-line-height").evaluate(o,{},s)*au,h=Mo(n)?a:0,m=u.get("text-anchor").evaluate(o,{},s),y=u.get("text-variable-anchor");if(!y){const t=u.get("text-radial-offset").evaluate(o,{},s);_=t?Dd(m,[t*au,Pd]):u.get("text-offset").evaluate(o,{},s).map((t=>t*au))}let x=p?"center":u.get("text-justify").evaluate(o,{},s);const b=u.get("symbol-placement"),w="point"===b,k="point"===b?u.get("text-max-width").evaluate(o,{},s)*au:0,E=o=>{t.allowVerticalPlacement&&Co(n)&&(g.vertical=Wu(v,e,i,r,l,k,c,m,o,h,_,$u.vertical,!0,b,f,d))};if(!p&&y){const t="auto"===x?y.map((t=>Ld(t))):[x];let n=!1;for(let o=0;o=0||!Co(n)){const t=Wu(v,e,i,r,l,k,c,m,x,h,_,$u.horizontal,!1,b,f,d);t&&(g.horizontal[x]=t)}E("point"===b?"left":x)}}let x=!1;if(o.icon&&o.icon.name){const e=n[o.icon.name];e&&(y=rd(r[o.icon.name],u.get("icon-offset").evaluate(o,{},s),u.get("icon-anchor").evaluate(o,{},s)),x=e.sdf,void 0===t.sdfIcons?t.sdfIcons=e.sdf:t.sdfIcons!==e.sdf&&pt("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(e.pixelRatio!==t.pixelRatio||0!==u.get("icon-rotate").constantOr(1))&&(t.iconsNeedLinear=!0))}const b=jd(g.horizontal)||g.vertical;t.iconsInText||(t.iconsInText=!!b&&b.iconsInText),(b||y)&&Rd(t,o,g,y,n,h,f,0,_,x,a,s,c)}o&&t.generateCollisionDebugBuffers(l,t.collisionBoxArray)}function Ld(t){switch(t){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function Rd(t,e,i,n,r,o,a,s,l,c,u,d,h){let p=o.textMaxSize.evaluate(e,{},d);void 0===p&&(p=a);const m=t.layers[0].layout,f=m.get("icon-offset").evaluate(e,{},d),g=jd(i.horizontal)||i.vertical,v=a/24,y=t.tilePixelRatio*p/24,_=t.tilePixelRatio*m.get("symbol-spacing"),x=m.get("text-padding")*t.tilePixelRatio,b=m.get("icon-padding")*t.tilePixelRatio,w=$(m.get("text-max-angle")),k="map"===m.get("text-rotation-alignment")&&"point"!==m.get("symbol-placement"),E="map"===m.get("icon-rotation-alignment")&&"point"!==m.get("symbol-placement"),T=m.get("symbol-placement"),S=_/2,C=m.get("icon-text-fit");let M;n&&"none"!==C&&(t.allowVerticalPlacement&&i.vertical&&(M=od(n,i.vertical,C,m.get("icon-text-fit-padding"),f,v)),g&&(n=od(n,g,C,m.get("icon-text-fit-padding"),f,v)));const z=(a,s,p)=>{if(s.x<0||s.x>=Is||s.y<0||s.y>=Is)return;const{x:m,y:g,z:v}=h.projectTilePoint(s.x,s.y,p),y=new ad(m,g,v,0,void 0);!function(t,e,i,n,r,o,a,s,l,c,u,d,h,p,m,f,g,v,y,_,x,b,w,k,E){const T=t.addToLineVertexArray(e,n);let S,C,M,z,I,P,A,D=0,O=0,L=0,R=0,B=-1,F=-1;const j={};let N=Qa(""),V=0,U=0;if(void 0===l._unevaluatedLayout.getValue("text-radial-offset")?[V,U]=l.layout.get("text-offset").evaluate(x,{},E).map((t=>t*au)):(V=l.layout.get("text-radial-offset").evaluate(x,{},E)*au,U=Pd),t.allowVerticalPlacement&&r.vertical){const t=r.vertical;if(m)P=Vd(t),s&&(A=Vd(s));else{const n=l.layout.get("text-rotate").evaluate(x,{},E)+90;M=Nd(c,i,e,u,d,h,t,p,n,f),s&&(z=Nd(c,i,e,u,d,h,s,v,n))}}if(o){const n=l.layout.get("icon-rotate").evaluate(x,{},E),r="none"!==l.layout.get("icon-text-fit"),a=xd(o,n,w,r),p=s?xd(s,n,w,r):void 0;C=Nd(c,i,e,u,d,h,o,v,n),D=4*a.length;const m=t.iconSizeData;let f=null;"source"===m.kind?(f=[su*l.layout.get("icon-size").evaluate(x,{},E)],f[0]>Bd&&pt(`${t.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)):"composite"===m.kind&&(f=[su*b.compositeIconSizes[0].evaluate(x,{},E),su*b.compositeIconSizes[1].evaluate(x,{},E)],(f[0]>Bd||f[1]>Bd)&&pt(`${t.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)),t.addSymbols(t.icon,a,f,_,y,x,!1,i,e,T.lineStartIndex,T.lineLength,-1,k,E),B=t.icon.placedSymbolArray.length-1,p&&(O=4*p.length,t.addSymbols(t.icon,p,f,_,y,x,$u.vertical,i,e,T.lineStartIndex,T.lineLength,-1,k,E),F=t.icon.placedSymbolArray.length-1)}for(const n in r.horizontal){const o=r.horizontal[n];S||(N=Qa(o.text),m?I=Vd(o):S=Nd(c,i,e,u,d,h,o,p,l.layout.get("text-rotate").evaluate(x,{},E),f));const s=1===o.positionedLines.length;if(L+=Fd(t,i,e,o,a,l,m,x,f,T,r.vertical?$u.horizontal:$u.horizontalOnly,s?Object.keys(r.horizontal):[n],j,B,b,k,E),s)break}r.vertical&&(R+=Fd(t,i,e,r.vertical,a,l,m,x,f,T,$u.vertical,["vertical"],j,F,b,k,E));let Z=-1;const $=(t,e)=>t?Math.max(t,e):e;Z=$(I,Z),Z=$(P,Z),Z=$(A,Z);const G=Z>-1?1:0;t.glyphOffsetArray.length>=Yd.MAX_GLYPHS&&pt("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),void 0!==x.sortKey&&t.addToSortKeyRanges(t.symbolInstances.length,x.sortKey),t.symbolInstances.emplaceBack(i.x,i.y,i.z,e.x,e.y,j.right>=0?j.right:-1,j.center>=0?j.center:-1,j.left>=0?j.left:-1,j.vertical>=0?j.vertical:-1,B,F,N,void 0!==S?S:t.collisionBoxArray.length,void 0!==S?S+1:t.collisionBoxArray.length,void 0!==M?M:t.collisionBoxArray.length,void 0!==M?M+1:t.collisionBoxArray.length,void 0!==C?C:t.collisionBoxArray.length,void 0!==C?C+1:t.collisionBoxArray.length,z||t.collisionBoxArray.length,z?z+1:t.collisionBoxArray.length,u,L,R,D,O,G,0,V,U,Z)}(t,s,y,a,i,n,r,M,t.layers[0],t.collisionBoxArray,e.index,e.sourceLayerIndex,t.index,x,k,l,0,b,E,f,e,o,c,u,d)};if("line"===T)for(const r of md(e.geometry,0,0,Is,Is)){const e=hd(r,_,w,i.vertical||g,n,24,y,t.overscaling,Is);for(const i of e){const e=g;e&&Ud(t,e.text,S,i)||z(r,i,d)}}else if("line-center"===T){for(const t of e.geometry)if(t.length>1){const e=dd(t,w,i.vertical||g,n,24,y);e&&z(t,e,d)}}else if("Polygon"===e.type)for(const t of pc(e.geometry,0)){const e=Md(t,16);z(t[0],new ad(e.x,e.y,0,0,void 0),d)}else if("LineString"===e.type)for(const t of e.geometry)z(t,new ad(t[0].x,t[0].y,0,0,void 0),d);else if("Point"===e.type)for(const t of e.geometry)for(const e of t)z([e],new ad(e.x,e.y,0,0,void 0),d)}const Bd=32640;function Fd(t,e,i,n,r,a,s,l,c,u,d,h,p,m,f,g,v){const y=function(t,e,i,n,r,a,s,l){const c=[];if(0===e.positionedLines.length)return c;const u=n.layout.get("text-rotate").evaluate(a,{})*Math.PI/180,d=function(t){const e=t[0],i=t[1],n=e*i;return n>0?[e,-i]:n<0?[-e,i]:0===e?[i,e]:[i,-e]}(i);let h=Math.abs(e.top-e.bottom);for(const t of e.positionedLines)h-=t.lineOffset;const p=e.positionedLines.length,m=h/p;let f=e.top-i[1];for(let t=0;tBd&&pt(`${t.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)):"composite"===_.kind&&(x=[su*f.compositeTextSizes[0].evaluate(l,{},v),su*f.compositeTextSizes[1].evaluate(l,{},v)],(x[0]>Bd||x[1]>Bd)&&pt(`${t.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)),t.addSymbols(t.text,y,x,c,s,l,d,e,i,u.lineStartIndex,u.lineLength,m,g,v);for(const e of h)p[e]=t.text.placedSymbolArray.length-1;return 4*y.length}function jd(t){for(const e in t)return t[e];return null}function Nd(t,e,i,n,r,a,s,l,c,u){let d=s.top,h=s.bottom,p=s.left,m=s.right;const f=s.collisionPadding;if(f&&(p-=f[0],d-=f[1],m+=f[2],h+=f[3]),c){const t=new o(p,d),e=new o(m,d),i=new o(p,h),n=new o(m,h),r=$(c);let a=new o(0,0);u&&(a=new o(u[0],u[1])),t._rotateAround(r,a),e._rotateAround(r,a),i._rotateAround(r,a),n._rotateAround(r,a),p=Math.min(t.x,e.x,i.x,n.x),m=Math.max(t.x,e.x,i.x,n.x),d=Math.min(t.y,e.y,i.y,n.y),h=Math.max(t.y,e.y,i.y,n.y)}return t.emplaceBack(e.x,e.y,e.z,i.x,i.y,p,d,m,h,l,n,r,a),t.length-1}function Vd(t){t.collisionPadding&&(t.top-=t.collisionPadding[1],t.bottom+=t.collisionPadding[3]);const e=t.bottom-t.top;return e>0?Math.max(10,e):null}function Ud(t,e,i,n){const r=t.compareText;if(e in r){const t=r[e];for(let e=t.length-1;e>=0;e--)if(n.dist(t[e])t.id)),this.index=t.index,this.pixelRatio=t.pixelRatio,this.sourceLayerIndex=t.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.fullyClipped=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=d([]),this.placementViewportMatrix=d([]);const e=this.layers[0]._unevaluatedLayout._values;this.textSizeData=lu(this.zoom,e["text-size"]),this.iconSizeData=lu(this.zoom,e["icon-size"]);const i=this.layers[0].layout,n=i.get("symbol-sort-key"),r=i.get("symbol-z-order");this.canOverlap=i.get("text-allow-overlap")||i.get("icon-allow-overlap")||i.get("text-ignore-placement")||i.get("icon-ignore-placement"),this.sortFeaturesByKey="viewport-y"!==r&&void 0!==n.constantOr(1),this.sortFeaturesByY=("viewport-y"===r||"auto"===r&&!this.sortFeaturesByKey)&&this.canOverlap,this.writingModes=i.get("text-writing-mode").map((t=>$u[t])),this.stateDependentLayerIds=this.layers.filter((t=>t.isStateDependent())).map((t=>t.id)),this.sourceID=t.sourceID}createArrays(){this.text=new Hd(new _s(this.layers,this.zoom,(t=>/^text/.test(t)))),this.icon=new Hd(new _s(this.layers,this.zoom,(t=>/^icon/.test(t)))),this.glyphOffsetArray=new Za,this.lineVertexArray=new $a,this.symbolInstances=new Ua}calculateGlyphDependencies(t,e,i,n,r){for(let i=0;i0)&&("constant"!==a.value.kind||a.value.value.length>0),u="constant"!==l.value.kind||!!l.value.value||Object.keys(l.parameters).length>0,d=o.get("symbol-sort-key");if(this.features=[],!c&&!u)return;const h=e.iconDependencies,p=e.glyphDependencies,m=e.availableImages,f=new Wo(this.zoom);for(const{feature:e,id:s,index:l,sourceLayerIndex:g}of t){const t=r._featureFilter.needGeometry,v=Ys(e,t);if(!r._featureFilter.filter(f,v,i))continue;let y,_;if(t||(v.geometry=Xs(e,i,n)),c){const t=r.getValueAndResolveTokens("text-field",v,i,m),e=Xe.factory(t);Wd(e)&&(this.hasRTLText=!0),(!this.hasRTLText||"unavailable"===$o()||this.hasRTLText&&qo.isParsed())&&(y=hu(e,r,v))}if(u){const t=r.getValueAndResolveTokens("icon-image",v,i,m);_=t instanceof Ye?t:Ye.fromString(t)}if(!y&&!_)continue;const x=this.sortFeaturesByKey?d.evaluate(v,{},i):void 0;if(this.features.push({id:s,text:y,icon:_,index:l,sourceLayerIndex:g,geometry:v.geometry,properties:e.properties,type:Zd[e.type],sortKey:x}),_&&(h[_.name]=!0),y){const t=a.evaluate(v,{},i).join(","),e="map"===o.get("text-rotation-alignment")&&"point"!==o.get("symbol-placement");this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf($u.vertical)>=0;for(const i of y.sections)if(i.image)h[i.image.name]=!0;else{const n=Co(y.toString()),r=i.fontStack||t,o=p[r]=p[r]||{};this.calculateGlyphDependencies(i.text,o,e,this.allowVerticalPlacement,n)}}}"line"===o.get("symbol-placement")&&(this.features=function(t){const e={},i={},n=[];let r=0;function o(e){n.push(t[e]),r++}function a(t,e,r){const o=i[t];return delete i[t],i[e]=o,n[o].geometry[0].pop(),n[o].geometry[0]=n[o].geometry[0].concat(r[0]),o}function s(t,i,r){const o=e[i];return delete e[i],e[t]=o,n[o].geometry[0].shift(),n[o].geometry[0]=r[0].concat(n[o].geometry[0]),o}function l(t,e,i){const n=i?e[0][e[0].length-1]:e[0][0];return`${t}:${n.x}:${n.y}`}for(let c=0;ct.geometry))}(this.features)),this.sortFeaturesByKey&&this.features.sort(((t,e)=>t.sortKey-e.sortKey))}update(t,e,i,n){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(t,e,this.layers,i,n),this.icon.programConfigurations.updatePaintArrays(t,e,this.layers,i,n))}isEmpty(){return 0===this.symbolInstances.length&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(t){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(t),this.iconCollisionBox.upload(t)),this.text.upload(t,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(t,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(t,e){const i=this.lineVertexArray.length;if(void 0!==t.segment){let i=t.dist(e[t.segment+1]),n=t.dist(e[t.segment]);const r={};for(let n=t.segment+1;n=0;i--)r[i]={x:e[i].x,y:e[i].y,tileUnitDistanceFromAnchor:n},i>0&&(n+=e[i-1].dist(e[i]));for(let t=0;t=0?e.rightJustifiedTextSymbolIndex:e.centerJustifiedTextSymbolIndex>=0?e.centerJustifiedTextSymbolIndex:e.leftJustifiedTextSymbolIndex>=0?e.leftJustifiedTextSymbolIndex:e.verticalPlacedTextSymbolIndex>=0?e.verticalPlacedTextSymbolIndex:n),o=cu(this.textSizeData,t,r)/au;return this.tilePixelRatio*o}getSymbolInstanceIconSize(t,e,i){const n=this.icon.placedSymbolArray.get(i),r=cu(this.iconSizeData,t,n);return this.tilePixelRatio*r}_commitDebugCollisionVertexUpdate(t,e,i){t.emplaceBack(e,-i,-i),t.emplaceBack(e,i,-i),t.emplaceBack(e,i,i),t.emplaceBack(e,-i,i)}_updateTextDebugCollisionBoxes(t,e,i,n,r,o){for(let a=n;a0}hasIconData(){return this.icon.segments.get().length>0}hasDebugData(){return this.textCollisionBox&&this.iconCollisionBox}hasTextCollisionBoxData(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0}hasIconCollisionBoxData(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0}addIndicesForPlacedSymbol(t,e){const i=t.placedSymbolArray.get(e),n=i.vertexStartIndex+4*i.numGlyphs;for(let e=i.vertexStartIndex;en[t]-n[e]||r[e]-r[t])),o}addToSortKeyRanges(t,e){const i=this.sortKeyRanges[this.sortKeyRanges.length-1];i&&i.sortKey===e?i.symbolInstanceEnd=t+1:this.sortKeyRanges.push({sortKey:e,symbolInstanceStart:t,symbolInstanceEnd:t+1})}sortFeatures(t){if(this.sortFeaturesByY&&this.sortedAngle!==t&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(t),this.sortedAngle=t,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(const t of this.symbolInstanceIndexes){const e=this.symbolInstances.get(t);this.featureSortOrder.push(e.featureIndex),[e.rightJustifiedTextSymbolIndex,e.centerJustifiedTextSymbolIndex,e.leftJustifiedTextSymbolIndex].forEach(((t,e,i)=>{t>=0&&i.indexOf(t)===e&&this.addIndicesForPlacedSymbol(this.text,t)})),e.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,e.verticalPlacedTextSymbolIndex),e.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,e.placedIconSymbolIndex),e.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,e.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}Wr("SymbolBucket",Yd,{omit:["layers","collisionBoxArray","features","compareText"]}),Yd.MAX_GLYPHS=65535,Yd.addDynamicAttributes=qd;const Kd=new sa({"symbol-placement":new ia(xe.layout_symbol["symbol-placement"]),"symbol-spacing":new ia(xe.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new ia(xe.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new na(xe.layout_symbol["symbol-sort-key"]),"symbol-z-order":new ia(xe.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new ia(xe.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new ia(xe.layout_symbol["icon-ignore-placement"]),"icon-optional":new ia(xe.layout_symbol["icon-optional"]),"icon-rotation-alignment":new ia(xe.layout_symbol["icon-rotation-alignment"]),"icon-size":new na(xe.layout_symbol["icon-size"]),"icon-text-fit":new ia(xe.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new ia(xe.layout_symbol["icon-text-fit-padding"]),"icon-image":new na(xe.layout_symbol["icon-image"]),"icon-rotate":new na(xe.layout_symbol["icon-rotate"]),"icon-padding":new ia(xe.layout_symbol["icon-padding"]),"icon-keep-upright":new ia(xe.layout_symbol["icon-keep-upright"]),"icon-offset":new na(xe.layout_symbol["icon-offset"]),"icon-anchor":new na(xe.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new ia(xe.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new ia(xe.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new ia(xe.layout_symbol["text-rotation-alignment"]),"text-field":new na(xe.layout_symbol["text-field"]),"text-font":new na(xe.layout_symbol["text-font"]),"text-size":new na(xe.layout_symbol["text-size"]),"text-max-width":new na(xe.layout_symbol["text-max-width"]),"text-line-height":new na(xe.layout_symbol["text-line-height"]),"text-letter-spacing":new na(xe.layout_symbol["text-letter-spacing"]),"text-justify":new na(xe.layout_symbol["text-justify"]),"text-radial-offset":new na(xe.layout_symbol["text-radial-offset"]),"text-variable-anchor":new ia(xe.layout_symbol["text-variable-anchor"]),"text-anchor":new na(xe.layout_symbol["text-anchor"]),"text-max-angle":new ia(xe.layout_symbol["text-max-angle"]),"text-writing-mode":new ia(xe.layout_symbol["text-writing-mode"]),"text-rotate":new na(xe.layout_symbol["text-rotate"]),"text-padding":new ia(xe.layout_symbol["text-padding"]),"text-keep-upright":new ia(xe.layout_symbol["text-keep-upright"]),"text-transform":new na(xe.layout_symbol["text-transform"]),"text-offset":new na(xe.layout_symbol["text-offset"]),"text-allow-overlap":new ia(xe.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new ia(xe.layout_symbol["text-ignore-placement"]),"text-optional":new ia(xe.layout_symbol["text-optional"])});var Jd={paint:new sa({"icon-opacity":new na(xe.paint_symbol["icon-opacity"]),"icon-color":new na(xe.paint_symbol["icon-color"]),"icon-halo-color":new na(xe.paint_symbol["icon-halo-color"]),"icon-halo-width":new na(xe.paint_symbol["icon-halo-width"]),"icon-halo-blur":new na(xe.paint_symbol["icon-halo-blur"]),"icon-translate":new ia(xe.paint_symbol["icon-translate"]),"icon-translate-anchor":new ia(xe.paint_symbol["icon-translate-anchor"]),"text-opacity":new na(xe.paint_symbol["text-opacity"]),"text-color":new na(xe.paint_symbol["text-color"],{runtimeType:Ae,getOverride:t=>t.textColor,hasOverride:t=>!!t.textColor}),"text-halo-color":new na(xe.paint_symbol["text-halo-color"]),"text-halo-width":new na(xe.paint_symbol["text-halo-width"]),"text-halo-blur":new na(xe.paint_symbol["text-halo-blur"]),"text-translate":new ia(xe.paint_symbol["text-translate"]),"text-translate-anchor":new ia(xe.paint_symbol["text-translate-anchor"])}),layout:Kd};class Qd{constructor(t){this.type=t.property.overrides?t.property.overrides.runtimeType:Me,this.defaultValue=t}evaluate(t){if(t.formattedSection){const e=this.defaultValue.property.overrides;if(e&&e.hasOverride(t.formattedSection))return e.getOverride(t.formattedSection)}return t.feature&&t.featureState?this.defaultValue.evaluate(t.feature,t.featureState):this.defaultValue.property.specification.default}eachChild(t){this.defaultValue.isConstant()||t(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}Wr("FormatSectionOverride",Qd,{omit:["defaultValue"]});class th extends Ss{constructor(t){super(t,Jd)}recalculate(t,e){super.recalculate(t,e),"auto"===this.layout.get("icon-rotation-alignment")&&(this.layout._values["icon-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-rotation-alignment")&&(this.layout._values["text-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-pitch-alignment")&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),"auto"===this.layout.get("icon-pitch-alignment")&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment"));const i=this.layout.get("text-writing-mode");if(i){const t=[];for(const e of i)t.indexOf(e)<0&&t.push(e);this.layout._values["text-writing-mode"]=t}else this.layout._values["text-writing-mode"]="point"===this.layout.get("symbol-placement")?["horizontal"]:["horizontal","vertical"];this._setPaintOverrides()}getValueAndResolveTokens(t,e,i,n){const r=this.layout.get(t).evaluate(e,{},i,n),o=this._unevaluatedLayout._values[t];return o.isDataDriven()||Gn(o.value)||!r?r:function(t,e){return e.replace(/{([^{}]+)}/g,((e,i)=>i in t?String(t[i]):""))}(e.properties,r)}createBucket(t){return new Yd(t)}queryRadius(){return 0}queryIntersectsFeature(){return!1}_setPaintOverrides(){for(const t of Jd.paint.overridableProperties){if(!th.hasPaintOverride(this.layout,t))continue;const e=this.paint.get(t),i=new Qd(e),n=new $n(i,e.property.specification);let r=null;r="constant"===e.value.kind||"source"===e.value.kind?new Wn("source",n):new Hn("composite",n,e.value.zoomStops,e.value._interpolationType),this.paint._values[t]=new ta(e.property,r,e.parameters)}}_handleOverridablePaintPropertyUpdate(t,e,i){return!(!this.layout||e.isDataDriven()||i.isDataDriven())&&th.hasPaintOverride(this.layout,t)}static hasPaintOverride(t,e){const i=t.get("text-field"),n=Jd.paint.properties[e];let r=!1;const o=t=>{for(const e of t)if(n.overrides&&n.overrides.hasOverride(e))return void(r=!0)};if("constant"===i.value.kind&&i.value.value instanceof Xe)o(i.value.value.sections);else if("source"===i.value.kind){const t=e=>{r||(e instanceof ei&&Qe(e.value)===Re?o(e.value.sections):e instanceof oi?o(e.sections):e.eachChild(t))},e=i.value;e._styleExpression&&t(e._styleExpression.expression)}return r}getProgramConfiguration(t){return new ys(this,t)}}var eh={paint:new sa({"background-color":new ia(xe.paint_background["background-color"]),"background-pattern":new oa(xe.paint_background["background-pattern"]),"background-opacity":new ia(xe.paint_background["background-opacity"])})},ih={paint:new sa({"raster-opacity":new ia(xe.paint_raster["raster-opacity"]),"raster-hue-rotate":new ia(xe.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new ia(xe.paint_raster["raster-brightness-min"]),"raster-brightness-max":new ia(xe.paint_raster["raster-brightness-max"]),"raster-saturation":new ia(xe.paint_raster["raster-saturation"]),"raster-contrast":new ia(xe.paint_raster["raster-contrast"]),"raster-resampling":new ia(xe.paint_raster["raster-resampling"]),"raster-fade-duration":new ia(xe.paint_raster["raster-fade-duration"])})};class nh extends Ss{constructor(t){super(t,{}),this.implementation=t}is3D(){return"3d"===this.implementation.renderingMode}hasOffscreenPass(){return void 0!==this.implementation.prerender}recalculate(){}updateTransitions(){}hasTransition(){}serialize(){}onAdd(t){this.implementation.onAdd&&this.implementation.onAdd(t,t.painter.context.gl)}onRemove(t){this.implementation.onRemove&&this.implementation.onRemove(t,t.painter.context.gl)}}var rh={paint:new sa({"sky-type":new ia(xe.paint_sky["sky-type"]),"sky-atmosphere-sun":new ia(xe.paint_sky["sky-atmosphere-sun"]),"sky-atmosphere-sun-intensity":new ia(xe.paint_sky["sky-atmosphere-sun-intensity"]),"sky-gradient-center":new ia(xe.paint_sky["sky-gradient-center"]),"sky-gradient-radius":new ia(xe.paint_sky["sky-gradient-radius"]),"sky-gradient":new aa(xe.paint_sky["sky-gradient"]),"sky-atmosphere-halo-color":new ia(xe.paint_sky["sky-atmosphere-halo-color"]),"sky-atmosphere-color":new ia(xe.paint_sky["sky-atmosphere-color"]),"sky-opacity":new ia(xe.paint_sky["sky-opacity"])})};function oh(t,e,i){const n=b(0,0,1),r=j(F());return function(t,e,i){i*=.5;var n=e[0],r=e[1],o=e[2],a=e[3],s=Math.sin(i),l=Math.cos(i);t[0]=n*l-o*s,t[1]=r*l+a*s,t[2]=o*l+n*s,t[3]=a*l-r*s}(r,r,i?-$(t)+Math.PI:$(t)),N(r,r,-$(e)),A(n,n,r),M(n,n)}const ah={circle:class extends Ss{constructor(t){super(t,gl)}createBucket(t){return new Js(t)}queryRadius(t){const e=t;return dl("circle-radius",this,e)+dl("circle-stroke-width",this,e)+hl(this.paint.get("circle-translate"))}queryIntersectsFeature(t,e,i,n,r,o,a,s){const l=ml(this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),o.angle,t.pixelToTileUnitsFactor),c=this.paint.get("circle-radius").evaluate(e,i)+this.paint.get("circle-stroke-width").evaluate(e,i);return _l(t,n,o,a,s,"map"===this.paint.get("circle-pitch-alignment"),"map"===this.paint.get("circle-pitch-scale"),l,c)}getProgramIds(){return["circle"]}getProgramConfiguration(t){return new ys(this,t)}},heatmap:class extends Ss{createBucket(t){return new El(t)}constructor(t){super(t,Il),this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(t){"heatmap-color"===t&&this._updateColorRamp()}_updateColorRamp(){this.colorRamp=Pl({expression:this._transitionablePaint._values["heatmap-color"].value.expression,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null}resize(){this.heatmapFbo&&(this.heatmapFbo.destroy(),this.heatmapFbo=null)}queryRadius(t){return dl("heatmap-radius",this,t)}queryIntersectsFeature(t,e,i,n,r,a,s,l){const c=this.paint.get("heatmap-radius").evaluate(e,i);return _l(t,n,a,s,l,!0,!0,new o(0,0),c)}hasOffscreenPass(){return 0!==this.paint.get("heatmap-opacity")&&"none"!==this.visibility}getProgramIds(){return["heatmap","heatmapTexture"]}getProgramConfiguration(t){return new ys(this,t)}},hillshade:class extends Ss{constructor(t){super(t,Al)}hasOffscreenPass(){return 0!==this.paint.get("hillshade-exaggeration")&&"none"!==this.visibility}getProgramIds(){return["hillshade","hillshadePrepare"]}getProgramConfiguration(t){return new ys(this,t)}},fill:class extends Ss{constructor(t){super(t,_c)}getProgramIds(){const t=this.paint.get("fill-pattern"),e=t&&t.constantOr(1),i=[e?"fillPattern":"fill"];return this.paint.get("fill-antialias")&&i.push(e&&!this.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline"),i}getProgramConfiguration(t){return new ys(this,t)}recalculate(t,e){super.recalculate(t,e);const i=this.paint._values["fill-outline-color"];"constant"===i.value.kind&&void 0===i.value.value&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(t){return new vc(t)}queryRadius(){return hl(this.paint.get("fill-translate"))}queryIntersectsFeature(t,e,i,n,r,o){return!t.queryGeometry.isAboveHorizon&&el(pl(t.tilespaceGeometry,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),o.angle,t.pixelToTileUnitsFactor),n)}isTileClipped(){return!0}},"fill-extrusion":class extends Ss{constructor(t){super(t,Fc)}createBucket(t){return new Rc(t)}queryRadius(){return hl(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}getProgramIds(){return[this.paint.get("fill-extrusion-pattern").constantOr(1)?"fillExtrusionPattern":"fillExtrusion"]}getProgramConfiguration(t){return new ys(this,t)}queryIntersectsFeature(t,e,i,n,r,a,s,l,c){const u=ml(this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),a.angle,t.pixelToTileUnitsFactor),d=this.paint.get("fill-extrusion-height").evaluate(e,i),h=this.paint.get("fill-extrusion-base").evaluate(e,i),p=[0,0],m=l&&a.elevation,f=a.elevation?a.elevation.exaggeration():1;if(m){const e=t.tile.getBucket(this).centroidVertexArray,i=c+1;if(i=3)for(let e=0;e1&&(a=t[++o]);const l=Math.abs(s-a.left),c=Math.abs(s-a.right),u=Math.min(l,c);let d;const h=e/i*(n+1);if(a.isDash){const t=n-Math.abs(h);d=Math.sqrt(u*u+t*t)}else d=n-Math.sqrt(u*u+h*h);this.image.data[r+s]=Math.max(0,Math.min(255,d+128))}}}addRegularDash(t,e){for(let e=t.length-1;e>=0;--e){const i=t[e],n=t[e+1];i.zeroLength?t.splice(e,1):n&&n.isDash===i.isDash&&(n.left=i.left,t.splice(e,1))}const i=t[0],n=t[t.length-1];i.isDash===n.isDash&&(i.left=n.left-this.width,n.right=i.right+this.width);const r=this.width*this.nextRow;let o=0,a=t[o];for(let i=0;i1&&(a=t[++o]);const n=Math.abs(i-a.left),s=Math.abs(i-a.right),l=Math.min(n,s);this.image.data[r+i]=Math.max(0,Math.min(255,(a.isDash?l:-l)+e+128))}}addDash(t,e){const i=this.getKey(t,e);if(this.positions[i])return this.positions[i];const n="round"===e,r=n?7:0,o=2*r+1;if(this.nextRow+o>this.height)return pt("LineAtlas out of space"),null;0===t.length&&t.push(1);let a=0;for(let e=0;e{this._triggered=!1,this._callback()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout((()=>{this._triggered=!1,this._callback()}),0))}remove(){delete this._channel,this._callback=()=>{}}}const fh=s.performance;function gh(t){const e=t?t.url.toString():void 0;return fh.getEntriesByName(e)}class vh{constructor(){this.tasks={},this.taskQueue=[],st(["process"],this),this.invoker=new mh(this.process),this.nextId=0}add(t,e){const i=this.nextId++,n=function({type:t,isSymbolTile:e,zoom:i}){return i=i||0,"message"===t?0:"maybePrepare"!==t||e?"parseTile"!==t||e?"parseTile"===t&&e?300-i:"maybePrepare"===t&&e?400-i:500:200-i:100-i}(e);if(0===n){gt();try{t()}finally{}return{cancel:()=>{}}}return this.tasks[i]={fn:t,metadata:e,priority:n,id:i},this.taskQueue.push(i),this.invoker.trigger(),{cancel:()=>{delete this.tasks[i]}}}process(){gt();try{if(this.taskQueue=this.taskQueue.filter((t=>!!this.tasks[t])),!this.taskQueue.length)return;const t=this.pick();if(null===t)return;const e=this.tasks[t];if(delete this.tasks[t],this.taskQueue.length&&this.invoker.trigger(),!e)return;e.fn()}finally{}}pick(){let t=null,e=1/0;for(let i=0;i0;o--)n=1<this.canonical.z?new bh(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new bh(t,this.wrap,t,this.canonical.x>>e,this.canonical.y>>e)}calculateScaledKey(t,e=!0){if(this.overscaledZ===t&&e)return this.key;if(t>this.canonical.z)return wh(this.wrap*+e,t,this.canonical.z,this.canonical.x,this.canonical.y);{const i=this.canonical.z-t;return wh(this.wrap*+e,t,t,this.canonical.x>>i,this.canonical.y>>i)}}isChildOf(t){if(t.wrap!==this.wrap)return!1;const e=this.canonical.z-t.canonical.z;return 0===t.overscaledZ||t.overscaledZ>e&&t.canonical.y===this.canonical.y>>e}children(t){if(this.overscaledZ>=t)return[new bh(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];const e=this.canonical.z+1,i=2*this.canonical.x,n=2*this.canonical.y;return[new bh(e,this.wrap,e,i,n),new bh(e,this.wrap,e,i+1,n),new bh(e,this.wrap,e,i,n+1),new bh(e,this.wrap,e,i+1,n+1)]}isLessThan(t){return this.wrapt.wrap)&&(this.overscaledZt.overscaledZ)&&(this.canonical.xt.canonical.x)&&this.canonical.ye[a])return null}else{const s=1/n[a];let l=(t[a]-i[a])*s,c=(e[a]-i[a])*s;if(l>c){const t=l;l=c,c=t}if(l>r&&(r=l),co)return null}return r}function Lh(t,e,i,n,r,o,a,s,l,c,u){const d=n-t,h=r-e,p=o-i,m=a-t,f=s-e,g=l-i,v=u[1]*g-u[2]*f,y=u[2]*m-u[0]*g,_=u[0]*f-u[1]*m,x=d*v+h*y+p*_;if(Math.abs(x)<1e-15)return null;const b=1/x,w=c[0]-t,k=c[1]-e,E=c[2]-i,T=(w*v+k*y+E*_)*b;if(T<0||T>1)return null;const S=k*p-E*h,C=E*d-w*p,M=w*h-k*d,z=(u[0]*S+u[1]*C+u[2]*M)*b;return z<0||T+z>1?null:(m*S+f*C+g*M)*b}function Rh(t,e,i){return(t-e)/(i-e)}function Bh(t,e,i,n,r,o,a,s,l){const c=1<{const o=n?1:0,a=(t+1)*i-o,s=e*i,l=(e+1)*i-o;r[0]=t*i,r[1]=s,r[2]=a,r[3]=l};let a=new Dh(n);const s=[];for(let e=0;e=1;n/=2){const t=i[i.length-1];a=new Dh(n);for(let e=0;e0;){const{idx:s,t:p,nodex:m,nodey:f,depth:g}=h.pop();if(this.leaves[s]){Bh(m,f,g,t,e,i,n,u,d);const s=1<=t[2])return p}continue}let v=0;for(let h=0;h=l[c[i]]&&(c.splice(i,0,h),e=!0);e||(c[v]=h),v++}}for(let t=0;t=this.dim+1||e<-1||e>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(e+1)*this.stride+(t+1)}_unpackMapbox(t,e,i){return(256*t*256+256*e+i)/10-1e4}_unpackTerrarium(t,e,i){return 256*t+e+i/256-32768}static pack(t,e){const i=[0,0,0,0],n=Uh.getUnpackVector(e);let r=Math.floor((t+n[3])/n[2]);return i[2]=r%256,r=Math.floor(r/256),i[1]=r%256,r=Math.floor(r/256),i[0]=r,i}getPixels(){return new zl({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(t,e,i){if(this.dim!==t.dim)throw new Error("dem dimension mismatch");let n=e*this.dim,r=e*this.dim+this.dim,o=i*this.dim,a=i*this.dim+this.dim;switch(e){case-1:n=r-1;break;case 1:r=n+1}switch(i){case-1:o=a-1;break;case 1:a=o+1}const s=-e*this.dim,l=-i*this.dim;for(let e=o;e{this.remove(t,r)}),i)),this.data[n].push(r),this.order.push(n),this.order.length>this.max){const t=this._getAndRemoveByKey(this.order[0]);t&&this.onRemove(t)}return this}has(t){return t.wrapped().key in this.data}getAndRemove(t){return this.has(t)?this._getAndRemoveByKey(t.wrapped().key):null}_getAndRemoveByKey(t){const e=this.data[t].shift();return e.timeout&&clearTimeout(e.timeout),0===this.data[t].length&&delete this.data[t],this.order.splice(this.order.indexOf(t),1),e.value}getByKey(t){const e=this.data[t];return e?e[0].value:null}get(t){return this.has(t)?this.data[t.wrapped().key][0].value:null}remove(t,e){if(!this.has(t))return this;const i=t.wrapped().key,n=void 0===e?0:this.data[i].indexOf(e),r=this.data[i][n];return this.data[i].splice(n,1),r.timeout&&clearTimeout(r.timeout),0===this.data[i].length&&delete this.data[i],this.onRemove(r.value),this.order.splice(this.order.indexOf(i),1),this}setMaxSize(t){for(this.max=t;this.order.length>this.max;){const t=this._getAndRemoveByKey(this.order[0]);t&&this.onRemove(t)}return this}filter(t){const e=[];for(const i in this.data)for(const n of this.data[i])t(n.value)||e.push(n);for(const t of e)this.remove(t.value.tileID,t)}}class $h extends _e{constructor(t,e,i){super(),this.id=t,this._onlySymbols=i,e.on("data",(t=>{"source"===t.dataType&&"metadata"===t.sourceDataType&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&"source"===t.dataType&&"content"===t.sourceDataType&&(this.reload(),this.transform&&this.update(this.transform))})),e.on("error",(()=>{this._sourceErrored=!0})),this._source=e,this._tiles={},this._cache=new Zh(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._minTileCacheSize=null,this._maxTileCacheSize=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new Ah}onAdd(t){this.map=t,this._minTileCacheSize=t?t._minTileCacheSize:null,this._maxTileCacheSize=t?t._maxTileCacheSize:null}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded)return!1;if(!this._source.loaded())return!1;for(const t in this._tiles){const e=this._tiles[t];if("loaded"!==e.state&&"errored"!==e.state)return!1}return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;const t=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,t&&this.reload(),this.transform&&this.update(this.transform)}_loadTile(t,e){return t.isSymbolTile=this._onlySymbols,this._source.loadTile(t,e)}_unloadTile(t){if(this._source.unloadTile)return this._source.unloadTile(t,(()=>{}))}_abortTile(t){if(this._source.abortTile)return this._source.abortTile(t,(()=>{}))}serialize(){return this._source.serialize()}prepare(t){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(const e in this._tiles){const i=this._tiles[e];i.upload(t),i.prepare(this.map.style.imageManager)}}getIds(){return tt(this._tiles).map((t=>t.tileID)).sort(Gh).map((t=>t.key))}getRenderableIds(t){const e=[];for(const i in this._tiles)this._isIdRenderable(+i,t)&&e.push(this._tiles[i]);return t?e.sort(((t,e)=>{const i=t.tileID,n=e.tileID,r=new o(i.canonical.x,i.canonical.y)._rotate(this.transform.angle),a=new o(n.canonical.x,n.canonical.y)._rotate(this.transform.angle);return i.overscaledZ-n.overscaledZ||a.y-r.y||a.x-r.x})).map((t=>t.tileID.key)):e.map((t=>t.tileID)).sort(Gh).map((t=>t.key))}hasRenderableParent(t){const e=this.findLoadedParent(t,0);return!!e&&this._isIdRenderable(e.tileID.key)}_isIdRenderable(t,e){return this._tiles[t]&&this._tiles[t].hasData()&&!this._coveredTiles[t]&&(e||!this._tiles[t].holdingForFade())}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(const t in this._tiles)"errored"!==this._tiles[t].state&&this._reloadTile(+t,"reloading")}}_reloadTile(t,e){const i=this._tiles[t];i&&("loading"!==i.state&&(i.state=e),this._loadTile(i,this._tileLoaded.bind(this,i,t,e)))}_tileLoaded(t,e,i,n){if(n)if(t.state="errored",404!==n.status)this._source.fire(new ye(n,{tile:t}));else if("raster-dem"===this._source.type&&this.usedForTerrain&&this.map.painter.terrain){const t=this.map.painter.terrain;this.update(this.transform,t.getScaledDemTileSize(),!0),t.resetTileLookupCache(this.id)}else this.update(this.transform);else t.timeAdded=Et.now(),"expired"===i&&(t.refreshedUponExpiration=!0),this._setTileReloadTimer(e,t),"raster-dem"===this._source.type&&t.dem&&this._backfillDEM(t),this._state.initializeTileState(t,this.map?this.map.painter:null),this._source.fire(new ve("data",{dataType:"source",tile:t,coord:t.tileID,sourceCacheId:this.id}))}_backfillDEM(t){const e=this.getRenderableIds();for(let n=0;n1||(Math.abs(i)>1&&(1===Math.abs(i+r)?i+=r:1===Math.abs(i-r)&&(i-=r)),e.dem&&t.dem&&(t.dem.backfillBorder(e.dem,i,n),t.neighboringTiles&&t.neighboringTiles[o]&&(t.neighboringTiles[o].backfilled=!0)))}}getTile(t){return this.getTileByID(t.key)}getTileByID(t){return this._tiles[t]}_retainLoadedChildren(t,e,i,n){for(const r in this._tiles){let o=this._tiles[r];if(n[r]||!o.hasData()||o.tileID.overscaledZ<=e||o.tileID.overscaledZ>i)continue;let a=o.tileID;for(;o&&o.tileID.overscaledZ>e+1;){const t=o.tileID.scaledTo(o.tileID.overscaledZ-1);o=this._tiles[t.key],o&&o.hasData()&&(a=t)}let s=a;for(;s.overscaledZ>e;)if(s=s.scaledTo(s.overscaledZ-1),t[s.key]){n[a.key]=a;break}}}findLoadedParent(t,e){if(t.key in this._loadedParentTiles){const i=this._loadedParentTiles[t.key];return i&&i.tileID.overscaledZ>=e?i:null}for(let i=t.overscaledZ-1;i>=e;i--){const e=t.scaledTo(i),n=this._getLoadedTile(e);if(n)return n}}_getLoadedTile(t){const e=this._tiles[t.key];return e&&e.hasData()?e:this._cache.getByKey(this._source.reparseOverscaled?t.wrapped().key:t.canonical.key)}updateCacheSize(t,e){e=e||this._source.tileSize;const i=Math.ceil(t.width/e)+1,n=Math.ceil(t.height/e)+1,r=Math.floor(i*n*5),o="number"==typeof this._minTileCacheSize?Math.max(this._minTileCacheSize,r):r,a="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,o):o;this._cache.setMaxSize(a)}handleWrapJump(t){const e=Math.round((t-(void 0===this._prevLng?t:this._prevLng))/360);if(this._prevLng=t,e){const t={};for(const i in this._tiles){const n=this._tiles[i];n.tileID=n.tileID.unwrapTo(n.tileID.wrap+e),t[n.tileID.key]=n}this._tiles=t;for(const t in this._timers)clearTimeout(this._timers[t]),delete this._timers[t];for(const t in this._tiles)this._setTileReloadTimer(+t,this._tiles[t])}}update(t,e,i){if(this.transform=t,!this._sourceLoaded||this._paused||this.transform.freezeTileCoverage)return;if(this.usedForTerrain&&!i)return;let n;this.updateCacheSize(t,e),"globe"!==this.transform.projection.name&&this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?n=t.getVisibleUnwrappedCoordinates(this._source.tileID).map((t=>new bh(t.canonical.z,t.wrap,t.canonical.z,t.canonical.x,t.canonical.y))):(n=t.coveringTiles({tileSize:e||this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom&&!i,reparseOverscaled:this._source.reparseOverscaled,isTerrainDEM:this.usedForTerrain}),this._source.hasTile&&(n=n.filter((t=>this._source.hasTile(t))))):n=[];const r=this._updateRetainedTiles(n);if(qh(this._source.type)&&0!==n.length){const t={},e={},i=Object.keys(r);for(const n of i){const i=r[n],o=this._tiles[n];if(!o||o.fadeEndTime&&o.fadeEndTime<=Et.now())continue;const a=this.findLoadedParent(i,Math.max(i.overscaledZ-$h.maxOverzooming,this._source.minzoom));a&&(this._addTile(a.tileID),t[a.tileID.key]=a.tileID),e[n]=i}const o=n[n.length-1].overscaledZ;for(const t in this._tiles){const i=this._tiles[t];if(r[t]||!i.hasData())continue;let n=i.tileID;for(;n.overscaledZ>o;){n=n.scaledTo(n.overscaledZ-1);const o=this._tiles[n.key];if(o&&o.hasData()&&e[n.key]){r[t]=i.tileID;break}}}for(const e in t)r[e]||(this._coveredTiles[e]=!0,r[e]=t[e])}for(const t in r)this._tiles[t].clearFadeHold();const o=function(t,e){const i=[];for(const n in t)n in e||i.push(n);return i}(this._tiles,r);for(const t of o){const e=this._tiles[t];e.hasSymbolBuckets&&!e.holdingForFade()?e.setHoldDuration(this.map._fadeDuration):e.hasSymbolBuckets&&!e.symbolFadeFinished()||this._removeTile(+t)}this._updateLoadedParentTileCache(),this._onlySymbols&&this._source.afterUpdate&&this._source.afterUpdate()}releaseSymbolFadeTiles(){for(const t in this._tiles)this._tiles[t].holdingForFade()&&this._removeTile(+t)}_updateRetainedTiles(t){const e={};if(0===t.length)return e;const i={},n=t.reduce(((t,e)=>Math.min(t,e.overscaledZ)),1/0),r=t[0].overscaledZ,o=Math.max(r-$h.maxOverzooming,this._source.minzoom),a=Math.max(r+$h.maxUnderzooming,this._source.minzoom),s={};for(const i of t){const t=this._addTile(i);e[i.key]=i,t.hasData()||n=this._source.maxzoom){const t=n.children(this._source.maxzoom)[0],i=this.getTile(t);if(i&&i.hasData()){e[t.key]=t;continue}}else{const t=n.children(this._source.maxzoom);if(e[t[0].key]&&e[t[1].key]&&e[t[2].key]&&e[t[3].key])continue}let r=t.wasRequested();for(let a=n.overscaledZ-1;a>=o;--a){const o=n.scaledTo(a);if(i[o.key])break;if(i[o.key]=!0,t=this.getTile(o),!t&&r&&(t=this._addTile(o)),t&&(e[o.key]=o,r=t.wasRequested(),t.hasData()))break}}return e}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(const t in this._tiles){const e=[];let i,n=this._tiles[t].tileID;for(;n.overscaledZ>0;){if(n.key in this._loadedParentTiles){i=this._loadedParentTiles[n.key];break}e.push(n.key);const t=n.scaledTo(n.overscaledZ-1);if(i=this._getLoadedTile(t),i)break;n=t}for(const t of e)this._loadedParentTiles[t]=i}}_addTile(t){let e=this._tiles[t.key];if(e)return e;e=this._cache.getAndRemove(t),e&&(this._setTileReloadTimer(t.key,e),e.tileID=t,this._state.initializeTileState(e,this.map?this.map.painter:null),this._cacheTimers[t.key]&&(clearTimeout(this._cacheTimers[t.key]),delete this._cacheTimers[t.key],this._setTileReloadTimer(t.key,e)));const i=Boolean(e);if(!i){const i=this.map?this.map.painter:null,n="raster"===this._source.type||"raster-dem"===this._source.type;e=new sp(t,this._source.tileSize*t.overscaleFactor(),this.transform.tileZoom,i,n),this._loadTile(e,this._tileLoaded.bind(this,e,t.key,e.state))}return e?(e.uses++,this._tiles[t.key]=e,i||this._source.fire(new ve("dataloading",{tile:e,coord:e.tileID,dataType:"source"})),e):null}_setTileReloadTimer(t,e){t in this._timers&&(clearTimeout(this._timers[t]),delete this._timers[t]);const i=e.getExpiryTimeout();i&&(this._timers[t]=setTimeout((()=>{this._reloadTile(t,"expired"),delete this._timers[t]}),i))}_removeTile(t){const e=this._tiles[t];e&&(e.uses--,delete this._tiles[t],this._timers[t]&&(clearTimeout(this._timers[t]),delete this._timers[t]),e.uses>0||(e.hasData()&&"reloading"!==e.state?this._cache.add(e.tileID,e,e.getExpiryTimeout()):(e.aborted=!0,this._abortTile(e),this._unloadTile(e))))}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(const t in this._tiles)this._removeTile(+t);this._source._clear&&this._source._clear(),this._cache.reset()}tilesIn(t,e,i){const n=[],r=this.transform;if(!r)return n;for(const o in this._tiles){const a=this._tiles[o];if(i&&a.clearQueryDebugViz(),a.holdingForFade())continue;const s=t.containsTile(a,r,e);s&&n.push(s)}return n}getVisibleCoordinates(t){const e=this.getRenderableIds(t).map((t=>this._tiles[t].tileID));for(const t of e)t.projMatrix=this.transform.calculateProjMatrix(t.toUnwrapped());return e}hasTransition(){if(this._source.hasTransition())return!0;if(qh(this._source.type))for(const t in this._tiles){const e=this._tiles[t];if(void 0!==e.fadeEndTime&&e.fadeEndTime>=Et.now())return!0}return!1}setFeatureState(t,e,i){this._state.updateState(t=t||"_geojsonTileLayer",e,i)}removeFeatureState(t,e,i){this._state.removeFeatureState(t=t||"_geojsonTileLayer",e,i)}getFeatureState(t,e){return this._state.getState(t=t||"_geojsonTileLayer",e)}setDependencies(t,e,i){const n=this._tiles[t];n&&n.setDependencies(e,i)}reloadTilesForDependencies(t,e){for(const i in this._tiles)this._tiles[i].hasDependency(t,e)&&this._reloadTile(+i,"reloading");this._cache.filter((i=>!i.hasDependency(t,e)))}_preloadTiles(t,e){const i=new Map,n=Array.isArray(t)?t:[t],r=this.map.painter.terrain,o=this.usedForTerrain&&r?r.getScaledDemTileSize():this._source.tileSize;for(const t of n){const e=t.coveringTiles({tileSize:o,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom&&!this.usedForTerrain,reparseOverscaled:this._source.reparseOverscaled,isTerrainDEM:this.usedForTerrain});for(const t of e)i.set(t.key,t);this.usedForTerrain&&t.updateElevation(!1)}const a=Array.from(i.values()),s="raster"===this._source.type||"raster-dem"===this._source.type;Q(a,((t,e)=>{const i=new sp(t,this._source.tileSize*t.overscaleFactor(),this.transform.tileZoom,this.map.painter,s);this._loadTile(i,(t=>{"raster-dem"===this._source.type&&i.dem&&this._backfillDEM(i),e(t,i)}))}),e)}}function Gh(t,e){const i=Math.abs(2*t.wrap)-+(t.wrap<0),n=Math.abs(2*e.wrap)-+(e.wrap<0);return t.overscaledZ-e.overscaledZ||n-i||e.canonical.y-t.canonical.y||e.canonical.x-t.canonical.x}function qh(t){return"raster"===t||"image"===t||"video"===t}$h.maxOverzooming=10,$h.maxUnderzooming=3;class Wh{constructor(t,e,i){this._demTile=t,this._dem=this._demTile.dem,this._scale=e,this._offset=i}static create(t,e,i){const n=i||t.findDEMTileFor(e);if(!n||!n.dem)return;const r=n.dem,o=n.tileID,a=1<=0&&n[3]>=0&&s.insert(a,n[0],n[1],n[2],n[3])}}loadVTLayers(){if(!this.vtLayers){this.vtLayers=new Pc.VectorTile(new yu(this.rawTileData)).layers,this.sourceLayerCoder=new Ih(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"]),this.vtFeatures={};for(const t in this.vtLayers)this.vtFeatures[t]=[]}return this.vtLayers}query(t,e,i,n){this.loadVTLayers();const r=t.params||{},o=ar(r.filter),a=t.tileResult,s=t.transform,l=a.bufferedTilespaceBounds,c=this.grid.query(l.min.x,l.min.y,l.max.x,l.max.y,((t,e,i,n)=>cl(a.bufferedTilespaceGeometry,t,e,i,n)));c.sort(Yh);let u=null;s.elevation&&c.length>0&&(u=Wh.create(s.elevation,this.tileID));const d={};let h;for(let s=0;s(m||(m=Xs(e,this.tileID.canonical,t.tileTransform)),i.queryIntersectsFeature(a,e,n,m,this.z,t.transform,t.pixelPosMatrix,u,r))))}return d}loadMatchingFeature(t,e,i,n,r,o,a,s,l){const{featureIndex:c,bucketIndex:u,sourceLayerIndex:d,layoutVertexArrayOffset:h}=e,p=this.bucketLayerIDs[u];if(n&&!function(t,e){for(let i=0;i=0)return!0;return!1}(n,p))return;const m=this.sourceLayerCoder.decode(d),f=this.vtLayers[m].feature(c);if(i.needGeometry){const t=Ys(f,!0);if(!i.filter(new Wo(this.tileID.overscaledZ),t,this.tileID.canonical))return}else if(!i.filter(new Wo(this.tileID.overscaledZ),f))return;const g=this.getId(f,m);for(let e=0;e{const a=e instanceof ea?e.get(o):null;return a&&a.evaluate?a.evaluate(i,n,r):a}))}function Yh(t,e){return e-t}Wr("FeatureIndex",Hh,{omit:["rawTileData","sourceLayerCoder"]});var Kh=ha([{name:"a_pos",type:"Int16",components:2}]);const Jh=32,Qh=33,tp=new Uint16Array(8184);for(let t=0;t<2046;t++){let e=t+2,i=0,n=0,r=0,o=0,a=0,s=0;for(1&e?r=o=a=Jh:i=n=s=Jh;(e>>=1)>1;){const t=i+r>>1,l=n+o>>1;1&e?(r=i,o=n,i=a,n=s):(i=r,n=o,r=a,o=s),a=t,s=l}const l=4*t;tp[l+0]=i,tp[l+1]=n,tp[l+2]=r,tp[l+3]=o}const ep=new Uint16Array(2178),ip=new Uint8Array(1089),np=new Uint16Array(1089);function rp(t){return 0===t?-.03125:32===t?.03125:0}var op=ha([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);const ap={type:2,extent:Is,loadGeometry:()=>[[new o(0,0),new o(8193,0),new o(8193,8193),new o(0,8193),new o(0,0)]]};class sp{constructor(t,e,i,n,r){this.tileID=t,this.uid=nt(),this.uses=0,this.tileSize=e,this.tileZoom=i,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.isRaster=r,this.expiredRequestCount=0,this.state="loading",n&&n.transform&&(this.projection=n.transform.projection)}registerFadeDuration(t){const e=t+this.timeAdded;ee.getLayer(t))).filter(Boolean);if(0!==t.length){n.layers=t,n.stateDependentLayerIds&&(n.stateDependentLayers=n.stateDependentLayerIds.map((e=>t.filter((t=>t.id===e))[0])));for(const e of t)i[e.id]=n}}return i}(t.buckets,e.style),this.hasSymbolBuckets=!1;for(const t in this.buckets){const e=this.buckets[t];if(e instanceof Yd){if(this.hasSymbolBuckets=!0,!i)break;e.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(const t in this.buckets){const e=this.buckets[t];if(e instanceof Yd&&e.hasRTLText){this.hasRTLText=!0,qo.isLoading()||qo.isLoaded()||"deferred"!==$o()||Go();break}}this.queryPadding=0;for(const t in this.buckets){const i=this.buckets[t];this.queryPadding=Math.max(this.queryPadding,e.style.getLayer(t).queryRadius(i))}t.imageAtlas&&(this.imageAtlas=t.imageAtlas),t.glyphAtlasImage&&(this.glyphAtlasImage=t.glyphAtlasImage),t.lineAtlas&&(this.lineAtlas=t.lineAtlas)}else this.collisionBoxArray=new Fa}unloadVectorData(){if(this.hasData()){for(const t in this.buckets)this.buckets[t].destroy();this.buckets={},this.imageAtlas&&(this.imageAtlas=null),this.lineAtlas&&(this.lineAtlas=null),this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.lineAtlasTexture&&this.lineAtlasTexture.destroy(),this._tileBoundsBuffer&&(this._tileBoundsBuffer.destroy(),this._tileBoundsIndexBuffer.destroy(),this._tileBoundsSegments.destroy(),this._tileBoundsBuffer=null),this._tileDebugBuffer&&(this._tileDebugBuffer.destroy(),this._tileDebugIndexBuffer.destroy(),this._tileDebugSegments.destroy(),this._tileDebugBuffer=null),this.globeGridBuffer&&(this.globeGridBuffer.destroy(),this.globeGridBuffer=null),this.globePoleBuffer&&(this.globePoleBuffer.destroy(),this.globePoleBuffer=null),this.latestFeatureIndex=null,this.state="unloaded"}}getBucket(t){return this.buckets[t.id]}upload(t){for(const e in this.buckets){const i=this.buckets[e];i.uploadPending()&&i.upload(t)}const e=t.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new hh(t,this.imageAtlas.image,e.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new hh(t,this.glyphAtlasImage,e.ALPHA),this.glyphAtlasImage=null),this.lineAtlas&&!this.lineAtlas.uploaded&&(this.lineAtlasTexture=new hh(t,this.lineAtlas.image,e.ALPHA),this.lineAtlas.uploaded=!0)}prepare(t){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(t,this.imageAtlasTexture)}queryRenderedFeatures(t,e,i,n,r,o,a,s){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({tileResult:n,pixelPosMatrix:a,transform:o,params:r,tileTransform:this.tileTransform},t,e,i):{}}querySourceFeatures(t,e){const i=this.latestFeatureIndex;if(!i||!i.rawTileData)return;const n=i.loadVTLayers(),r=e?e.sourceLayer:"",o=n._geojsonTileLayer||n[r];if(!o)return;const a=ar(e&&e.filter),{z:s,x:l,y:c}=this.tileID.canonical,u={z:s,x:l,y:c};for(let e=0;et)i=!1;else if(e)if(this.expirationTime=0;t--){const e=4*t,i=tp[e+0],n=tp[e+1],r=tp[e+2],o=tp[e+3],a=i+r>>1,s=n+o>>1,l=a+s-n,c=s+i-a,u=n*Qh+i,d=o*Qh+r,h=s*Qh+a,p=Math.hypot((ep[2*u+0]+ep[2*d+0])/2-ep[2*h+0],(ep[2*u+1]+ep[2*d+1])/2-ep[2*h+1])>=16;if(ip[h]=ip[h]||(p?1:0),t<1022){const t=(n+c>>1)*Qh+(i+l>>1),e=(o+c>>1)*Qh+(r+l>>1);ip[h]=ip[h]||ip[t]||ip[e]}}const r=new fa,o=new Sa;let a=0;function s(t,e){const i=e*Qh+t;return 0===np[i]&&(r.emplaceBack(ep[2*i+0],ep[2*i+1],t*Is/Jh,e*Is/Jh),np[i]=++a),np[i]-1}function l(t,e,i,n,r,a){const c=t+i>>1,u=e+n>>1;if(Math.abs(t-r)+Math.abs(e-a)>1&&ip[u*Qh+c])l(r,a,t,e,c,u),l(i,n,r,a,c,u);else{const l=s(t,e),c=s(i,n),u=s(r,a);o.emplaceBack(l,c,u)}}return l(0,0,Jh,Jh,Jh,0),l(Jh,Jh,0,0,0,Jh),{vertices:r,indices:o}}(this.tileID.canonical,e);n=t.vertices,r=t.indices}else{n=new fa,r=new Sa;for(const{x:t,y:e}of i)n.emplaceBack(t,e,0,0);const t=Ll(n.int16,void 0,4);for(let e=0;et*(1-i)+e*i,[n,r]=vp(t),o=new Pa,a=function(t){const e=d(new Float64Array(16)),i=xp(t);var n,r;return m(e,e,[i,i,i]),p(e,e,((n=[])[0]=-(r=t.min)[0],n[1]=-r[1],n[2]=-r[2],n)),e}(gp(t));o.reserve(4096);for(let s=0;s<65;s++){const l=i(n[0],r[0],s/64),c=Bs(l),u=c*e-t.y,d=Math.sin($(l)),h=Math.cos($(l));for(let t=0;t<65;t++){const e=t/64,s=i(n[1],r[1],e),l=yp(h,d,s);P(l,l,a);const p=Rs(s);o.emplaceBack(l[0],l[1],l[2],p,c,e,u)}}return o}_createGridIndices(){const t=new Sa,e=(e,i)=>{const n=65*i+e;t.emplaceBack(n+1,n,n+65),t.emplaceBack(n+65,n+65+1,n+1)};for(let t=0;t<64;t++)for(let i=0;i<64;i++)e(i,t);return t}getWirefameBuffer(t){if(!this.wireframeSegments){const e=this._createWireframeGrid();this.wireframeIndexBuffer=t.createIndexBuffer(e),this.wireframeSegments=zs.simpleSegment(0,0,4096,e.length)}return[this.wireframeIndexBuffer,this.wireframeSegments]}_createWireframeGrid(){const t=new Da,e=(e,i)=>{const n=65*i+e;t.emplaceBack(n,n+1),t.emplaceBack(n,n+65),t.emplaceBack(n,n+65+1)};for(let t=0;t<64;t++)for(let i=0;i<64;i++)e(i,t);return t}}function Ep(t,e){if(!e.isReprojectedInTileSpace)return{scale:1<_&&(x(t,c,n,r,s,l),x(c,i,s,l,o,a))}x(d,h,n,o,r,o),x(h,p,r,o,r,a),x(p,m,r,a,n,a),x(m,d,n,a,n,o),f-=_,g-=_,v+=_,y+=_;const b=1/Math.max(v-f,y-g);return{scale:b,x:f*b,y:g*b,x2:v*b,y2:y*b,projection:e}}class Tp{constructor(t){const e={},i=[];for(const n in t){const r=t[n],o=e[n]={};for(const t in r.glyphs){const e=r.glyphs[+t];if(!e||0===e.bitmap.width||0===e.bitmap.height)continue;const n=e.metrics.localGlyph?2:1,a={x:0,y:0,w:e.bitmap.width+2*n,h:e.bitmap.height+2*n};i.push(a),o[t]=a}}const{w:n,h:r}=Vu(i),o=new Ml({width:n||1,height:r||1});for(const i in t){const n=t[i];for(const t in n.glyphs){const r=n.glyphs[+t];if(!r||0===r.bitmap.width||0===r.bitmap.height)continue;const a=e[i][t],s=r.metrics.localGlyph?2:1;Ml.copy(r.bitmap,o,{x:0,y:0},{x:a.x+s,y:a.y+s},r.bitmap)}}this.image=o,this.positions=e}}Wr("GlyphAtlas",Tp);class Sp{constructor(t){this.tileID=new bh(t.tileID.overscaledZ,t.tileID.wrap,t.tileID.canonical.z,t.tileID.canonical.x,t.tileID.canonical.y),this.tileZoom=t.tileZoom,this.uid=t.uid,this.zoom=t.zoom,this.canonical=t.tileID.canonical,this.pixelRatio=t.pixelRatio,this.tileSize=t.tileSize,this.source=t.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=t.showCollisionBoxes,this.collectResourceTiming=!!t.collectResourceTiming,this.returnDependencies=!!t.returnDependencies,this.promoteId=t.promoteId,this.enableTerrain=!!t.enableTerrain,this.isSymbolTile=t.isSymbolTile,this.tileTransform=Ep(t.tileID.canonical,t.projection),this.projection=t.projection}parse(t,e,i,n,r){this.status="parsing",this.data=t,this.collisionBoxArray=new Fa;const o=new Ih(Object.keys(t.layers).sort()),a=new Hh(this.tileID,this.promoteId);a.bucketLayerIDs=[];const s={},l=new ph(256,256),c={featureIndex:a,iconDependencies:{},patternDependencies:{},glyphDependencies:{},lineAtlas:l,availableImages:i},u=e.familiesBySource[this.source];for(const e in u){const n=t.layers[e];if(!n)continue;let r=!1,l=!1;for(const t of u[e])"symbol"===t[0].type?r=!0:l=!0;if(!0===this.isSymbolTile&&!r)continue;if(!1===this.isSymbolTile&&!l)continue;1===n.version&&pt(`Vector tile source "${this.source}" layer "${e}" does not use vector tile spec v2 and therefore may have some rendering errors.`);const d=o.encode(e),h=[];for(let t=0;t=e.maxzoom||"none"!==e.visibility&&(Cp(t,this.zoom,i),(s[e.id]=e.createBucket({index:a.bucketLayerIDs.length,layers:t,zoom:this.zoom,canonical:this.canonical,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:d,sourceID:this.source,enableTerrain:this.enableTerrain,availableImages:i})).populate(h,c,this.tileID.canonical,this.tileTransform),a.bucketLayerIDs.push(t.map((t=>t.id))))}}let d,h,p,m;l.trim();const f={type:"maybePrepare",isSymbolTile:this.isSymbolTile,zoom:this.zoom},g=ct(c.glyphDependencies,(t=>Object.keys(t).map(Number)));Object.keys(g).length?n.send("getGlyphs",{uid:this.uid,stacks:g},((t,e)=>{d||(d=t,h=e,_.call(this))}),void 0,!1,f):h={};const v=Object.keys(c.iconDependencies);v.length?n.send("getImages",{icons:v,source:this.source,tileID:this.tileID,type:"icons"},((t,e)=>{d||(d=t,p=e,_.call(this))}),void 0,!1,f):p={};const y=Object.keys(c.patternDependencies);function _(){if(d)return r(d);if(h&&p&&m){const t=new Tp(h),e=new Zu(p,m);for(const n in s){const r=s[n];r instanceof Yd?(Cp(r.layers,this.zoom,i),Od(r,h,t.positions,p,e.iconPositions,this.showCollisionBoxes,i,this.tileID.canonical,this.tileZoom,this.projection),r.projection=this.projection.name):r.hasPattern&&(r instanceof Xc||r instanceof vc||r instanceof Rc)&&(Cp(r.layers,this.zoom,i),r.addFeatures(c,this.tileID.canonical,e.patternPositions,i))}this.status="done",r(null,{buckets:tt(s).filter((t=>!t.isEmpty())),featureIndex:a,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:t.image,lineAtlas:l,imageAtlas:e,glyphMap:this.returnDependencies?h:null,iconMap:this.returnDependencies?p:null,glyphPositions:this.returnDependencies?t.positions:null})}}y.length?n.send("getImages",{icons:y,source:this.source,tileID:this.tileID,type:"patterns"},((t,e)=>{d||(d=t,m=e,_.call(this))}),void 0,!1,f):m={},_.call(this)}}function Cp(t,e,i){const n=new Wo(e);for(const e of t)e.recalculate(n,i)}class Mp{constructor(t){this.entries={},this.scheduler=t}request(t,e,i,n){const r=this.entries[t]=this.entries[t]||{callbacks:[]};if(r.result){const[t,i]=r.result;return this.scheduler?this.scheduler.add((()=>{n(t,i)}),e):n(t,i),()=>{}}return r.callbacks.push(n),r.cancel||(r.cancel=i(((i,n)=>{r.result=[i,n];for(const t of r.callbacks)this.scheduler?this.scheduler.add((()=>{t(i,n)}),e):t(i,n);setTimeout((()=>delete this.entries[t]),3e3)}))),()=>{r.result||(r.callbacks=r.callbacks.filter((t=>t!==n)),r.callbacks.length||(r.cancel(),delete this.entries[t]))}}}function zp(t,e,i){const n=JSON.stringify(t.request);return t.data&&(this.deduped.entries[n]={result:[null,t.data]}),this.deduped.request(n,{type:"parseTile",isSymbolTile:t.isSymbolTile,zoom:t.tileZoom},(e=>{const n=se(t.request,((t,n,r,o)=>{t?e(t):n&&e(null,{vectorTile:i?void 0:new Pc.VectorTile(new yu(n)),rawData:n,cacheControl:r,expires:o})}));return()=>{n.cancel(),e()}}),e)}const Ip=d(new Float64Array(16));class Pp{constructor(t,e){this._tr=t,this._worldSize=e}createInversionMatrix(){return Ip}createTileMatrix(t){let e,i,n;const r=t.canonical,o=d(new Float64Array(16)),a=this._tr.projection;if(a.isReprojectedInTileSpace){const s=Ep(r,a);e=1,i=s.x+t.wrap*s.scale,n=s.y,m(o,o,[e/s.scale,e/s.scale,this._tr.pixelsPerMeter/this._worldSize])}else e=this._worldSize/this._tr.zoomScale(r.z),i=(r.x+Math.pow(2,r.z)*t.wrap)*e,n=r.y*e;return p(o,o,[i,n,0]),m(o,o,[e/Is,e/Is,1]),o}pointCoordinate(t,e,i){const n=this._tr.horizonLineFromTop(!1),r=new o(t,Math.max(n,e));return this._tr.rayIntersectionCoordinate(this._tr.pointRayIntersection(r,i))}upVector(){return[0,0,1]}upVectorScale(){return 1}}var Ap={name:"albers",range:[4,7],center:[-96,37.5],parallels:[29.5,45.5],zAxisUnit:"meters",conic:!0,isReprojectedInTileSpace:!0,unsupportedLayers:["custom"],initializeConstants(){if(this.constants&&V(this.parallels,this.constants.parallels))return;const t=Math.sin($(this.parallels[0])),e=(t+Math.sin($(this.parallels[1])))/2,i=1+t*(2*e-t),n=Math.sqrt(i)/e;this.constants={n:e,c:i,r0:n,parallels:this.parallels}},project(t,e){this.initializeConstants();const i=$(t-this.center[0]),n=$(e),{n:r,c:o,r0:a}=this.constants,s=Math.sqrt(o-2*r*Math.sin(n))/r;return{x:s*Math.sin(i*r),y:s*Math.cos(i*r)-a,z:0}},unproject(t,e){this.initializeConstants();const{n:i,c:n,r0:r}=this.constants,o=r+e;let a=Math.atan2(t,Math.abs(o))*Math.sign(o);o*i<0&&(a-=Math.PI*Math.sign(t)*Math.sign(o));const s=$(this.center[0])*i;a=J(a,-Math.PI-s,Math.PI-s);const l=G(a/i)+this.center[0],c=Math.asin(Y((n-(t*t+o*o)*i*i)/(2*i),-1,1)),u=Y(G(c),-85.051129,Us);return new Ds(l,u)},projectTilePoint:(t,e)=>({x:t,y:e,z:0}),locationPoint:(t,e)=>t._coordinatePoint(t.locationCoordinate(e),!1),pixelsPerMeter:(t,e)=>Fs(1,t)*e,farthestPixelDistance(t){return dp(t,this.pixelsPerMeter(t.center.lat,t.worldSize))},createTileTransform:(t,e)=>new Pp(t,e)};const Dp=1.340264,Op=-.081106,Lp=893e-6,Rp=.003796,Bp=Math.sqrt(3)/2;var Fp={name:"equalEarth",center:[0,0],range:[3.5,7],zAxisUnit:"meters",isReprojectedInTileSpace:!0,unsupportedLayers:["custom"],project(t,e){e=e/180*Math.PI,t=t/180*Math.PI;const i=Math.asin(Bp*Math.sin(e)),n=i*i,r=n*n*n;return{x:.5*(t*Math.cos(i)/(Bp*(Dp+3*Op*n+r*(7*Lp+9*Rp*n)))/Math.PI+.5),y:1-.5*(i*(Dp+Op*n+r*(Lp+Rp*n))/Math.PI+1),z:0}},unproject(t,e){t=(2*t-.5)*Math.PI;let i=e=(2*(1-e)-1)*Math.PI,n=i*i,r=n*n*n;for(let t,o,a,s=0;s<12&&(o=i*(Dp+Op*n+r*(Lp+Rp*n))-e,a=Dp+3*Op*n+r*(7*Lp+9*Rp*n),t=o/a,i=Y(i-t,-Math.PI/3,Math.PI/3),n=i*i,r=n*n*n,!(Math.abs(t)<1e-12));++s);const o=Bp*t*(Dp+3*Op*n+r*(7*Lp+9*Rp*n))/Math.cos(i),a=Math.asin(Math.sin(i)/Bp),s=Y(180*o/Math.PI,-180,180),l=Y(180*a/Math.PI,-85.051129,Us);return new Ds(s,l)},projectTilePoint:(t,e)=>({x:t,y:e,z:0}),locationPoint:(t,e)=>t._coordinatePoint(t.locationCoordinate(e),!1),pixelsPerMeter:(t,e)=>Fs(1,t)*e,farthestPixelDistance(t){return dp(t,this.pixelsPerMeter(t.center.lat,t.worldSize))},createTileTransform:(t,e)=>new Pp(t,e)},jp={name:"equirectangular",supportsWorldCopies:!0,center:[0,0],range:[3.5,7],zAxisUnit:"meters",wrap:!0,isReprojectedInTileSpace:!0,unsupportedLayers:["custom"],project:(t,e)=>({x:.5+t/360,y:.5-e/360,z:0}),unproject(t,e){const i=360*(t-.5),n=Y(360*(.5-e),-85.051129,Us);return new Ds(i,n)},projectTilePoint:(t,e)=>({x:t,y:e,z:0}),locationPoint:(t,e)=>t._coordinatePoint(t.locationCoordinate(e),!1),pixelsPerMeter:(t,e)=>Fs(1,t)*e,farthestPixelDistance(t){return dp(t,this.pixelsPerMeter(t.center.lat,t.worldSize))},createTileTransform:(t,e)=>new Pp(t,e)};const Np=Math.PI/2;function Vp(t){return Math.tan((Np+t)/2)}var Up={name:"lambertConformalConic",range:[3.5,7],zAxisUnit:"meters",center:[0,30],parallels:[30,30],conic:!0,isReprojectedInTileSpace:!0,unsupportedLayers:["custom"],initializeConstants(){if(this.constants&&V(this.parallels,this.constants.parallels))return;const t=$(this.parallels[0]),e=$(this.parallels[1]),i=Math.cos(t),n=t===e?Math.sin(t):Math.log(i/Math.cos(e))/Math.log(Vp(e)/Vp(t)),r=i*Math.pow(Vp(t),n)/n;this.constants={n,f:r,parallels:this.parallels}},project(t,e){this.initializeConstants(),e=$(e),t=$(t-this.center[0]);const i=1e-6,{n,f:r}=this.constants;r>0?e<-Np+i&&(e=-Np+i):e>Np-i&&(e=Np-i);const o=r/Math.pow(Vp(e),n),a=o*Math.sin(n*t),s=r-o*Math.cos(n*t);return{x:.5*(a/Math.PI+.5),y:1-.5*(s/Math.PI+.5),z:0}},unproject(t,e){this.initializeConstants(),t=(2*t-.5)*Math.PI,e=(2*(1-e)-.5)*Math.PI;const{n:i,f:n}=this.constants,r=n-e,o=Math.sign(r),a=Math.sign(i)*Math.sqrt(t*t+r*r);let s=Math.atan2(t,Math.abs(r))*o;r*i<0&&(s-=Math.PI*Math.sign(t)*o);const l=Y(G(s/i)+this.center[0],-180,180),c=Y(G(2*Math.atan(Math.pow(n/a,1/i))-Np),-85.051129,Us);return new Ds(l,c)},projectTilePoint:(t,e)=>({x:t,y:e,z:0}),locationPoint:(t,e)=>t._coordinatePoint(t.locationCoordinate(e),!1),pixelsPerMeter:(t,e)=>Fs(1,t)*e,farthestPixelDistance(t){return dp(t,this.pixelsPerMeter(t.center.lat,t.worldSize))},createTileTransform:(t,e)=>new Pp(t,e)},Zp={name:"mercator",wrap:!0,requiresDraping:!1,supportsWorldCopies:!0,supportsTerrain:!0,supportsFog:!0,supportsFreeCamera:!0,zAxisUnit:"meters",center:[0,0],project:(t,e)=>({x:Rs(t),y:Bs(e),z:0}),unproject(t,e){const i=js(t),n=Ns(e);return new Ds(i,n)},projectTilePoint:(t,e)=>({x:t,y:e,z:0}),locationPoint:(t,e)=>t._coordinatePoint(t.locationCoordinate(e),!1),pixelsPerMeter:(t,e)=>Fs(1,t)*e,farthestPixelDistance(t){return dp(t,this.pixelsPerMeter(t.center.lat,t.worldSize))},createTileTransform:(t,e)=>new Pp(t,e)};const $p=$(Us);var Gp={name:"naturalEarth",center:[0,0],range:[3.5,7],isReprojectedInTileSpace:!0,zAxisUnit:"meters",unsupportedLayers:["custom"],project(t,e){const i=(e=$(e))*e,n=i*i;return{x:.5*((t=$(t))*(.8707-.131979*i+n*(n*(.003971*i-.001529*n)-.013791))/Math.PI+.5),y:1-.5*(e*(1.007226+i*(.015085+n*(.028874*i-.044475-.005916*n)))/Math.PI+1),z:0}},unproject(t,e){t=(2*t-.5)*Math.PI;let i=e=(2*(1-e)-1)*Math.PI,n=25,r=0,o=i*i;do{o=i*i;const t=o*o;r=(i*(1.007226+o*(.015085+t*(.028874*o-.044475-.005916*t)))-e)/(1.007226+o*(.045255+t*(.259866*o-.311325-.005916*11*t))),i=Y(i-r,-$p,$p)}while(Math.abs(r)>1e-6&&--n>0);o=i*i;const a=Y(G(t/(.8707+o*(o*(o*o*o*(.003971-.001529*o)-.013791)-.131979))),-180,180),s=G(i);return new Ds(a,s)},projectTilePoint:(t,e)=>({x:t,y:e,z:0}),locationPoint:(t,e)=>t._coordinatePoint(t.locationCoordinate(e),!1),pixelsPerMeter:(t,e)=>Fs(1,t)*e,farthestPixelDistance(t){return dp(t,this.pixelsPerMeter(t.center.lat,t.worldSize))},createTileTransform:(t,e)=>new Pp(t,e)};const qp=$(Us),Wp={albers:Ap,equalEarth:Fp,equirectangular:jp,lambertConformalConic:Up,mercator:Zp,naturalEarth:Gp,winkelTripel:{name:"winkelTripel",center:[0,0],range:[3.5,7],zAxisUnit:"meters",isReprojectedInTileSpace:!0,unsupportedLayers:["custom"],project(t,e){e=$(e),t=$(t);const i=Math.cos(e),n=2/Math.PI,r=Math.acos(i*Math.cos(t/2)),o=Math.sin(r)/r,a=.5*(t*n+2*i*Math.sin(t/2)/o)||0,s=.5*(e+Math.sin(e)/o)||0;return{x:.5*(a/Math.PI+.5),y:1-.5*(s/Math.PI+1),z:0}},unproject(t,e){let i=t=(2*t-.5)*Math.PI,n=e=(2*(1-e)-1)*Math.PI,r=25;const o=1e-6;let a=0,s=0;do{const r=Math.cos(n),o=Math.sin(n),l=2*o*r,c=o*o,u=r*r,d=Math.cos(i/2),h=Math.sin(i/2),p=2*d*h,m=h*h,f=1-u*d*d,g=f?1/f:0,v=f?Math.acos(r*d)*Math.sqrt(1/f):0,y=.5*(2*v*r*h+2*i/Math.PI)-t,_=.5*(v*o+n)-e,x=.5*g*(u*m+v*r*d*c)+1/Math.PI,b=g*(p*l/4-v*o*h),w=.125*g*(l*h-v*o*u*p),k=.5*g*(c*d+v*m*r)+.5,E=b*w-k*x;a=(_*b-y*k)/E,s=(y*w-_*x)/E,i=Y(i-a,-Math.PI,Math.PI),n=Y(n-s,-qp,qp)}while((Math.abs(a)>o||Math.abs(s)>o)&&--r>0);return new Ds(G(i),G(n))},projectTilePoint:(t,e)=>({x:t,y:e,z:0}),locationPoint:(t,e)=>t._coordinatePoint(t.locationCoordinate(e),!1),pixelsPerMeter:(t,e)=>Fs(1,t)*e,farthestPixelDistance(t){return dp(t,this.pixelsPerMeter(t.center.lat,t.worldSize))},createTileTransform:(t,e)=>new Pp(t,e)}};t.ARRAY_TYPE=c,t.AUTH_ERR_MSG=Ot,t.Aabb=yl,t.Actor=class{constructor(t,e,i){this.target=t,this.parent=e,this.mapId=i,this.callbacks={},this.cancelCallbacks={},st(["receive"],this),this.target.addEventListener("message",this.receive,!1),this.globalScope=gt()?t:s,this.scheduler=new vh}send(t,e,i,n,r=!1,o){const a=Math.round(1e18*Math.random()).toString(36).substring(0,10);i&&(i.metadata=o,this.callbacks[a]=i);const s=wt(this.globalScope)?void 0:[];return this.target.postMessage({id:a,type:t,hasCallback:!!i,targetMapId:n,mustQueue:r,sourceMapId:this.mapId,data:Yr(e,s)},s),{cancel:()=>{i&&delete this.callbacks[a],this.target.postMessage({id:a,type:"",targetMapId:n,sourceMapId:this.mapId})}}}receive(t){const e=t.data,i=e.id;if(i&&(!e.targetMapId||this.mapId===e.targetMapId))if(""===e.type){const t=this.cancelCallbacks[i];delete this.cancelCallbacks[i],t&&t.cancel()}else if(e.mustQueue||gt()){const t=this.callbacks[i];this.cancelCallbacks[i]=this.scheduler.add((()=>this.processTask(i,e)),t&&t.metadata||{type:"message"})}else this.processTask(i,e)}processTask(t,e){if(""===e.type){const i=this.callbacks[t];delete this.callbacks[t],i&&(e.error?i(Kr(e.error)):i(null,Kr(e.data)))}else{const i=wt(this.globalScope)?void 0:[],n=e.hasCallback?(e,n)=>{delete this.cancelCallbacks[t],this.target.postMessage({id:t,type:"",sourceMapId:this.mapId,error:e?Yr(e):null,data:Yr(n,i)},i)}:t=>{},r=Kr(e.data);if(this.parent[e.type])this.parent[e.type](e.sourceMapId,r,n);else if(this.parent.getWorkerSource){const t=e.type.split(".");this.parent.getWorkerSource(e.sourceMapId,t[0],r.source)[t[1]](r,n)}else n(new Error(`Could not find function ${e.type}`))}}remove(){this.scheduler.remove(),this.target.removeEventListener("message",this.receive,!1)}},t.CanonicalTileID=_h,t.Color=qe,t.ColorMode=Sh,t.CullFaceMode=zh,t.DEMData=Uh,t.DataConstantProperty=ia,t.DedupedRequest=Mp,t.DepthMode=kh,t.EXTENT=Is,t.Elevation=class{getAtPointOrZero(t,e=0){return this.getAtPoint(t,e)||0}getAtPoint(t,e,i=!0){null==e&&(e=null);const n=this._source();if(!n)return e;if(t.y<0||t.y>1)return e;const r=n.getSource().maxzoom,o=1<{const n=this.getAtTileOffset(t,i.x,i.y),r=e.upVector(t.canonical,i.x,i.y);return S(r,r,n*e.upVectorScale(t.canonical)),r}}getForTilePoints(t,e,i,n){const r=Wh.create(this,t,n);return!!r&&(e.forEach((t=>{t[2]=this.exaggeration()*r.getElevationAt(t[0],t[1],i)})),!0)}getMinMaxForTile(t){const e=this.findDEMTileFor(t);if(!e||!e.dem)return null;const i=e.dem.tree,n=e.tileID,r=1<this._skuTokenExpiresAt}transformRequest(t,e){return this._transformRequestFn&&this._transformRequestFn(t,e)||{url:t}}normalizeStyleURL(t,e){if(!Lt(t))return t;const i=Ft(t);return i.path=`/styles/v1${i.path}`,this._makeAPIURL(i,this._customAccessToken||e)}normalizeGlyphsURL(t,e){if(!Lt(t))return t;const i=Ft(t);return i.path=`/fonts/v1${i.path}`,this._makeAPIURL(i,this._customAccessToken||e)}normalizeSourceURL(t,e){if(!Lt(t))return t;const i=Ft(t);return i.path=`/v4/${i.authority}.json`,i.params.push("secure"),this._makeAPIURL(i,this._customAccessToken||e)}normalizeSpriteURL(t,e,i,n){const r=Ft(t);return Lt(t)?(r.path=`/styles/v1${r.path}/sprite${e}${i}`,this._makeAPIURL(r,this._customAccessToken||n)):(r.path+=`${e}${i}`,jt(r))}normalizeTileURL(t,e,i){if(this._isSkuTokenExpired()&&this._createSkuToken(),t&&!Lt(t))return t;const n=Ft(t);n.path=n.path.replace(/(\.(png|jpg)\d*)(?=$)/,`${e||i&&"raster"!==n.authority&&512===i?"@2x":""}${Ct.supported?".webp":"$1"}`),"raster"===n.authority?n.path=`/${St.RASTER_URL_PREFIX}${n.path}`:(n.path=n.path.replace(/^.+\/v4\//,"/"),n.path=`/${St.TILE_URL_VERSION}${n.path}`);const r=this._customAccessToken||function(t){for(const e of t){const t=e.match(/^access_token=(.*)$/);if(t)return t[1]}return null}(n.params)||St.ACCESS_TOKEN;return St.REQUIRE_ACCESS_TOKEN&&r&&this._skuToken&&n.params.push(`sku=${this._skuToken}`),this._makeAPIURL(n,r)}canonicalizeTileURL(t,e){const i=Ft(t);if(!i.path.match(/^(\/v4\/|\/raster\/v1\/)/)||!i.path.match(/\.[\w]+$/))return t;let n="mapbox://";i.path.match(/^\/raster\/v1\//)?n+=`raster/${i.path.replace(`/${St.RASTER_URL_PREFIX}/`,"")}`:n+=`tiles/${i.path.replace(`/${St.TILE_URL_VERSION}/`,"")}`;let r=i.params;return e&&(r=r.filter((t=>!t.match(/^access_token=/)))),r.length&&(n+=`?${r.join("&")}`),n}canonicalizeTileset(t,e){const i=!!e&&Lt(e),n=[];for(const e of t.tiles||[])Rt(e)?n.push(this.canonicalizeTileURL(e,i)):n.push(e);return n}_makeAPIURL(t,e){const i="See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes",n=Ft(St.API_URL);if(t.protocol=n.protocol,t.authority=n.authority,"http"===t.protocol){const e=t.params.indexOf("secure");e>=0&&t.params.splice(e,1)}if("/"!==n.path&&(t.path=`${n.path}${t.path}`),!St.REQUIRE_ACCESS_TOKEN)return jt(t);if(e=e||St.ACCESS_TOKEN,!this._silenceAuthErrors){if(!e)throw new Error(`An API access token is required to use Mapbox GL. ${i}`);if("s"===e[0])throw new Error(`Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). ${i}`)}return t.params=t.params.filter((t=>-1===t.indexOf("access_token"))),t.params.push(`access_token=${e||""}`),jt(t)}},t.ResourceType=ne,t.SegmentVector=zs,t.SourceCache=$h,t.StencilMode=Th,t.StructArrayLayout1ui2=Oa,t.StructArrayLayout2f1f2i16=Ea,t.StructArrayLayout2i4=ma,t.StructArrayLayout2ui4=Da,t.StructArrayLayout3f12=va,t.StructArrayLayout3ui6=Sa,t.StructArrayLayout4i8=fa,t.Texture=hh,t.Tile=sp,t.Transitionable=Yo,t.Uniform1f=as,t.Uniform1i=class extends os{constructor(t,e){super(t,e),this.current=0}set(t){this.current!==t&&(this.current=t,this.gl.uniform1i(this.location,t))}},t.Uniform2f=class extends os{constructor(t,e){super(t,e),this.current=[0,0]}set(t){t[0]===this.current[0]&&t[1]===this.current[1]||(this.current=t,this.gl.uniform2f(this.location,t[0],t[1]))}},t.Uniform3f=class extends os{constructor(t,e){super(t,e),this.current=[0,0,0]}set(t){t[0]===this.current[0]&&t[1]===this.current[1]&&t[2]===this.current[2]||(this.current=t,this.gl.uniform3f(this.location,t[0],t[1],t[2]))}},t.Uniform4f=ss,t.UniformColor=ls,t.UniformMatrix2f=class extends os{constructor(t,e){super(t,e),this.current=ds}set(t){for(let e=0;e<4;e++)if(t[e]!==this.current[e]){this.current=t,this.gl.uniformMatrix2fv(this.location,!1,t);break}}},t.UniformMatrix3f=class extends os{constructor(t,e){super(t,e),this.current=us}set(t){for(let e=0;e<9;e++)if(t[e]!==this.current[e]){this.current=t,this.gl.uniformMatrix3fv(this.location,!1,t);break}}},t.UniformMatrix4f=class extends os{constructor(t,e){super(t,e),this.current=cs}set(t){if(t[12]!==this.current[12]||t[0]!==this.current[0])return this.current=t,void this.gl.uniformMatrix4fv(this.location,!1,t);for(let e=1;e<16;e++)if(t[e]!==this.current[e]){this.current=t,this.gl.uniformMatrix4fv(this.location,!1,t);break}}},t.UnwrappedTileID=xh,t.ValidationError=be,t.VectorTileWorkerSource=class extends _e{constructor(t,e,i,n,r){super(),this.actor=t,this.layerIndex=e,this.availableImages=i,this.loadVectorData=r||zp,this.loading={},this.loaded={},this.deduped=new Mp(t.scheduler),this.isSpriteLoaded=n,this.scheduler=t.scheduler}loadTile(t,e){const i=t.uid,n=t&&t.request,r=n&&n.collectResourceTiming,o=this.loading[i]=new Sp(t);o.abort=this.loadVectorData(t,((a,s)=>{const l=!this.loading[i];if(delete this.loading[i],l||a||!s)return o.status="done",l||(this.loaded[i]=o),e(a);const c=s.rawData,u={};s.expires&&(u.expires=s.expires),s.cacheControl&&(u.cacheControl=s.cacheControl),o.vectorTile=s.vectorTile||new Pc.VectorTile(new yu(c));const d=()=>{o.parse(o.vectorTile,this.layerIndex,this.availableImages,this.actor,((t,i)=>{if(t||!i)return e(t);const o={};if(r){const t=gh(n);t.length>0&&(o.resourceTiming=JSON.parse(JSON.stringify(t)))}e(null,et({rawTileData:c.slice(0)},i,u,o))}))};this.isSpriteLoaded?d():this.once("isSpriteLoaded",(()=>{this.scheduler?this.scheduler.add(d,{type:"parseTile",isSymbolTile:t.isSymbolTile,zoom:t.tileZoom}):d()})),this.loaded=this.loaded||{},this.loaded[i]=o}))}reloadTile(t,e){const i=this.loaded,n=t.uid,r=this;if(i&&i[n]){const o=i[n];o.showCollisionBoxes=t.showCollisionBoxes,o.enableTerrain=!!t.enableTerrain,o.projection=t.projection;const a=(t,i)=>{const n=o.reloadCallback;n&&(delete o.reloadCallback,o.parse(o.vectorTile,r.layerIndex,this.availableImages,r.actor,n)),e(t,i)};"parsing"===o.status?o.reloadCallback=a:"done"===o.status&&(o.vectorTile?o.parse(o.vectorTile,this.layerIndex,this.availableImages,this.actor,a):a())}}abortTile(t,e){const i=t.uid,n=this.loading[i];n&&(n.abort&&n.abort(),delete this.loading[i]),e()}removeTile(t,e){const i=this.loaded,n=t.uid;i&&i[n]&&delete i[n],e()}},t.WritingMode=$u,t.ZoomHistory=Jr,t.add=w,t.addDynamicAttributes=qd,t.adjoint=function(t,e){var i=e[0],n=e[1],r=e[2],o=e[3],a=e[4],s=e[5],l=e[6],c=e[7],u=e[8];return t[0]=a*u-s*c,t[1]=r*c-n*u,t[2]=n*s-r*a,t[3]=s*l-o*u,t[4]=i*u-r*l,t[5]=r*o-i*s,t[6]=o*c-a*l,t[7]=n*l-i*c,t[8]=i*a-n*o,t},t.asyncAll=Q,t.bezier=H,t.bindAll=st,t.boundsAttributes=op,t.bufferConvexPolygon=function(t,e){const i=[];for(let n=0;nQt&&(t.getActor().send("enforceCacheSizeLimit",Jt),ie=0)},t.calculateGlobeMatrix=wp,t.calculateGlobeMercatorMatrix=function(t){const e=t.worldSize,i=Y(t.center.lat,-85.051129,Us),n=new o(Rs(t.center.lng)*e,Bs(i)*e),r=Fs(1,t.center.lat)*e,a=t.pixelsPerMeter,s=e/(r/t.pixelsPerMeter),l=d(new Float64Array(16));return p(l,l,[n.x,n.y,0]),m(l,l,[s,s,a]),l},t.clamp=Y,t.clearTileCache=function(t){const e=s.caches.delete(Xt);t&&e.catch(t).then((()=>t()))},t.clipLine=md,t.clone=function(t){var e=new c(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},t.clone$1=dt,t.collisionCircleLayout=ou,t.config=St,t.conjugate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t},t.create=function(){var t=new c(16);return c!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t},t.create$1=u,t.createExpression=qn,t.createLayout=ha,t.createStyleLayer=function(t){return"custom"===t.type?new nh(t):new ah[t.type](t)},t.cross=I,t.degToRad=$,t.div=function(t,e,i){return t[0]=e[0]/i[0],t[1]=e[1]/i[1],t[2]=e[2]/i[2],t},t.dot=z,t.ease=X,t.easeCubicInOut=W,t.emitValidationErrors=Vr,t.endsWith=lt,t.enforceCacheSizeLimit=function(t){te(),Yt&&Yt.then((e=>{e.keys().then((i=>{for(let n=0;no&&(n+=(t[r]-o)*(t[r]-o)),e[r]{}}},t.globeBuffersForTileMesh=function(t,e,i,n){const r=t.context,o=t.transform;let a=e.globeGridBuffer,s=e.globePoleBuffer;if(!a){const t=kp.createGridVertices(i.canonical);a=e.globeGridBuffer=r.createVertexBuffer(t,up,!1)}if(!s){const t=kp.createPoleTriangleVertices(n,o.tileSize*n,0===i.canonical.y);s=e.globePoleBuffer=r.createVertexBuffer(t,up,!1)}return[a,s]},t.globeDenormalizeECEF=bp,t.globeMatrixForTile=function(t,e){const i=bp(gp(t)),n=((r=new Float64Array(16))[0]=(o=e)[0],r[1]=o[1],r[2]=o[2],r[3]=o[3],r[4]=o[4],r[5]=o[5],r[6]=o[6],r[7]=o[7],r[8]=o[8],r[9]=o[9],r[10]=o[10],r[11]=o[11],r[12]=o[12],r[13]=o[13],r[14]=o[14],r[15]=o[15],r);var r,o;return v(n,n,i),n},t.globePoleMatrixForTile=function(t,e,i){const n=d(new Float64Array(16)),r=Math.pow(2,t.z),o=(t.x-r/2)/r*Math.PI*2,a=i.point,s=i.worldSize/(i.tileSize*r);return p(n,n,[a.x,a.y,-i.worldSize/Math.PI/2]),m(n,n,[s,s,s]),f(n,n,$(-i._center.lat)),g(n,n,$(-i._center.lng)),g(n,n,o),e&&m(n,n,[1,-1,1]),n},t.globeTileBounds=gp,t.globeToMercatorTransition=function(t){return K(5,6,t)},t.identity=d,t.identity$1=j,t.invert=function(t,e){var i=e[0],n=e[1],r=e[2],o=e[3],a=e[4],s=e[5],l=e[6],c=e[7],u=e[8],d=e[9],h=e[10],p=e[11],m=e[12],f=e[13],g=e[14],v=e[15],y=i*s-n*a,_=i*l-r*a,x=i*c-o*a,b=n*l-r*s,w=n*c-o*s,k=r*c-o*l,E=u*f-d*m,T=u*g-h*m,S=u*v-p*m,C=d*g-h*f,M=d*v-p*f,z=h*v-p*g,I=y*z-_*M+x*C+b*S-w*T+k*E;return I?(t[0]=(s*z-l*M+c*C)*(I=1/I),t[1]=(r*M-n*z-o*C)*I,t[2]=(f*k-g*w+v*b)*I,t[3]=(h*w-d*k-p*b)*I,t[4]=(l*S-a*z-c*T)*I,t[5]=(i*z-r*S+o*T)*I,t[6]=(g*x-m*k-v*_)*I,t[7]=(u*k-h*x+p*_)*I,t[8]=(a*M-s*S+c*E)*I,t[9]=(n*S-i*M-o*E)*I,t[10]=(m*w-f*x+v*y)*I,t[11]=(d*x-u*w-p*y)*I,t[12]=(s*T-a*C-l*E)*I,t[13]=(i*C-n*T+r*E)*I,t[14]=(f*_-m*b-g*y)*I,t[15]=(u*b-d*_+h*y)*I,t):null},t.isMapAuthenticated=function(t){return Ht.has(t)},t.isMapboxURL=Lt,t.latFromMercatorY=Ns,t.len=R,t.length=x,t.length$1=function(t){return Math.hypot(t[0],t[1],t[2],t[3])},t.loadVectorTile=zp,t.makeRequest=ae,t.mercatorXfromLng=Rs,t.mercatorYfromLat=Bs,t.mercatorZfromAltitude=Fs,t.mul=v,t.mul$1=L,t.multiply=function(t,e,i){var n=e[0],r=e[1],o=e[2],a=e[3],s=e[4],l=e[5],c=e[6],u=e[7],d=e[8],h=i[0],p=i[1],m=i[2],f=i[3],g=i[4],v=i[5],y=i[6],_=i[7],x=i[8];return t[0]=h*n+p*a+m*c,t[1]=h*r+p*s+m*u,t[2]=h*o+p*l+m*d,t[3]=f*n+g*a+v*c,t[4]=f*r+g*s+v*u,t[5]=f*o+g*l+v*d,t[6]=y*n+_*a+x*c,t[7]=y*r+_*s+x*u,t[8]=y*o+_*l+x*d,t},t.multiply$1=h,t.multiply$2=E,t.nextPowerOfTwo=ot,t.normalize=M,t.normalize$1=function(t,e){var i=e[0],n=e[1],r=e[2],o=e[3],a=i*i+n*n+r*r+o*o;return a>0&&(a=1/Math.sqrt(a)),t[0]=i*a,t[1]=n*a,t[2]=r*a,t[3]=o*a,t},t.number=Fi,t.ortho=function(t,e,i,n,r,o,a){var s=1/(e-i),l=1/(n-r),c=1/(o-a);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(e+i)*s,t[13]=(r+n)*l,t[14]=(a+o)*c,t[15]=1,t},t.pbf=yu,t.perspective=function(t,e,i,n,r){var o,a=1/Math.tan(e/2);return t[0]=a/i,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=r&&r!==1/0?(t[10]=(r+n)*(o=1/(n-r)),t[14]=2*r*n*o):(t[10]=-1,t[14]=-2*n),t},t.pick=function(t,e){const i={};for(let n=0;nthis._layers[t.id])),i=e[0];if("none"===i.visibility)continue;const n=i.source||"";let r=this.familiesBySource[n];r||(r=this.familiesBySource[n]={});const o=i.sourceLayer||"_geojsonTileLayer";let a=r[o];a||(a=r[o]=[]),a.push(e)}}}const{ImageBitmap:r}=t.window;class o{loadTile(e,i){const{uid:n,encoding:o,rawImageData:a,padding:s,buildQuadTree:l}=e,c=r&&a instanceof r?this.getImageData(a,s):a;i(null,new t.DEMData(n,c,o,s<1,l))}getImageData(e,i){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(e.width,e.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d")),this.offscreenCanvas.width=e.width,this.offscreenCanvas.height=e.height,this.offscreenCanvasContext.drawImage(e,0,0,e.width,e.height);const n=this.offscreenCanvasContext.getImageData(-i,-i,e.width+2*i,e.height+2*i);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),new t.RGBAImage({width:n.width,height:n.height},n.data)}}var a=function t(e,i){var n,r=e&&e.type;if("FeatureCollection"===r)for(n=0;n=Math.abs(s)?i-l+s:s-l+i,i=l}i+n>=0!=!!e&&t.reverse()}const c=t.vectorTile.VectorTileFeature.prototype.toGeoJSON;class u{constructor(e){this._feature=e,this.extent=t.EXTENT,this.type=e.type,this.properties=e.tags,"id"in e&&!isNaN(e.id)&&(this.id=parseInt(e.id,10))}loadGeometry(){if(1===this._feature.type){const e=[];for(const i of this._feature.geometry)e.push([new t.pointGeometry(i[0],i[1])]);return e}{const e=[];for(const i of this._feature.geometry){const n=[];for(const e of i)n.push(new t.pointGeometry(e[0],e[1]));e.push(n)}return e}}toGeoJSON(t,e,i){return c.call(this,t,e,i)}}class d{constructor(e){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=t.EXTENT,this.length=e.length,this._features=e}feature(t){return new u(this._features[t])}}var h=t.vectorTile.VectorTileFeature,p=m;function m(t,e){this.options=e||{},this.features=t,this.length=t.length}function f(t,e){this.id="number"==typeof t.id?t.id:void 0,this.type=t.type,this.rawGeometry=1===t.type?[t.geometry]:t.geometry,this.properties=t.tags,this.extent=e||4096}m.prototype.feature=function(t){return new f(this.features[t],this.options.extent)},f.prototype.loadGeometry=function(){var e=this.rawGeometry;this.geometry=[];for(var i=0;i>31}function E(t,e){for(var i=t.loadGeometry(),n=t.type,r=0,o=0,a=i.length,s=0;s>1;C(t,e,a,n,r,o%2),S(t,e,i,n,a-1,o+1),S(t,e,i,a+1,r,o+1)}function C(t,e,i,n,r,o){for(;r>n;){if(r-n>600){const a=r-n+1,s=i-n+1,l=Math.log(a),c=.5*Math.exp(2*l/3),u=.5*Math.sqrt(l*c*(a-c)/a)*(s-a/2<0?-1:1);C(t,e,i,Math.max(n,Math.floor(i-s*c/a+u)),Math.min(r,Math.floor(i+(a-s)*c/a+u)),o)}const a=e[2*i+o];let s=n,l=r;for(M(t,e,n,i),e[2*r+o]>a&&M(t,e,n,r);sa;)l--}e[2*n+o]===a?M(t,e,n,l):(l++,M(t,e,l,r)),l<=i&&(n=l+1),i<=l&&(r=l-1)}}function M(t,e,i,n){z(t,i,n),z(e,2*i,2*n),z(e,2*i+1,2*n+1)}function z(t,e,i){const n=t[e];t[e]=t[i],t[i]=n}function I(t,e,i,n){const r=t-i,o=e-n;return r*r+o*o}g.fromVectorTileJs=y,g.fromGeojsonVt=function(t,e){e=e||{};var i={};for(var n in t)i[n]=new p(t[n].features,e),i[n].name=n,i[n].version=e.version,i[n].extent=e.extent;return y({layers:i})},g.GeoJSONWrapper=v;const P=t=>t[0],A=t=>t[1];class D{constructor(t,e=P,i=A,n=64,r=Float64Array){this.nodeSize=n,this.points=t;const o=t.length<65536?Uint16Array:Uint32Array,a=this.ids=new o(t.length),s=this.coords=new r(2*t.length);for(let n=0;n=i&&c<=r&&u>=n&&u<=o&&l.push(t[a]);continue}const m=Math.floor((p+h)/2);c=e[2*m],u=e[2*m+1],c>=i&&c<=r&&u>=n&&u<=o&&l.push(t[m]);const f=(d+1)%2;(0===d?i<=c:n<=u)&&(s.push(p),s.push(m-1),s.push(f)),(0===d?r>=c:o>=u)&&(s.push(m+1),s.push(h),s.push(f))}return l}(this.ids,this.coords,t,e,i,n,this.nodeSize)}within(t,e,i){return function(t,e,i,n,r,o){const a=[0,t.length-1,0],s=[],l=r*r;for(;a.length;){const c=a.pop(),u=a.pop(),d=a.pop();if(u-d<=o){for(let r=d;r<=u;r++)I(e[2*r],e[2*r+1],i,n)<=l&&s.push(t[r]);continue}const h=Math.floor((d+u)/2),p=e[2*h],m=e[2*h+1];I(p,m,i,n)<=l&&s.push(t[h]);const f=(c+1)%2;(0===c?i-r<=p:n-r<=m)&&(a.push(d),a.push(h-1),a.push(f)),(0===c?i+r>=p:n+r>=m)&&(a.push(h+1),a.push(u),a.push(f))}return s}(this.ids,this.coords,t,e,i,this.nodeSize)}}const O={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:t=>t},L=Math.fround||(R=new Float32Array(1),t=>(R[0]=+t,R[0]));var R;class B{constructor(t){this.options=G(Object.create(O),t),this.trees=new Array(this.options.maxZoom+1)}load(t){const{log:e,minZoom:i,maxZoom:n,nodeSize:r}=this.options;e&&console.time("total time");const o=`prepare ${t.length} points`;e&&console.time(o),this.points=t;let a=[];for(let e=0;e=i;t--){const i=+Date.now();a=this._cluster(a,t),this.trees[t]=new D(a,q,W,r,Float32Array),e&&console.log("z%d: %d clusters in %dms",t,a.length,+Date.now()-i)}return e&&console.timeEnd("total time"),this}getClusters(t,e){let i=((t[0]+180)%360+360)%360-180;const n=Math.max(-90,Math.min(90,t[1]));let r=180===t[2]?180:((t[2]+180)%360+360)%360-180;const o=Math.max(-90,Math.min(90,t[3]));if(t[2]-t[0]>=360)i=-180,r=180;else if(i>r){const t=this.getClusters([i,n,180,o],e),a=this.getClusters([-180,n,r,o],e);return t.concat(a)}const a=this.trees[this._limitZoom(e)],s=a.range(U(i),Z(o),U(r),Z(n)),l=[];for(const t of s){const e=a.points[t];l.push(e.numPoints?N(e):this.points[e.index])}return l}getChildren(t){const e=this._getOriginId(t),i=this._getOriginZoom(t),n="No cluster with the specified id.",r=this.trees[i];if(!r)throw new Error(n);const o=r.points[e];if(!o)throw new Error(n);const a=this.options.radius/(this.options.extent*Math.pow(2,i-1)),s=r.within(o.x,o.y,a),l=[];for(const e of s){const i=r.points[e];i.parentId===t&&l.push(i.numPoints?N(i):this.points[i.index])}if(0===l.length)throw new Error(n);return l}getLeaves(t,e,i){const n=[];return this._appendLeaves(n,t,e=e||10,i=i||0,0),n}getTile(t,e,i){const n=this.trees[this._limitZoom(t)],r=Math.pow(2,t),{extent:o,radius:a}=this.options,s=a/o,l=(i-s)/r,c=(i+1+s)/r,u={features:[]};return this._addTileFeatures(n.range((e-s)/r,l,(e+1+s)/r,c),n.points,e,i,r,u),0===e&&this._addTileFeatures(n.range(1-s/r,l,1,c),n.points,r,i,r,u),e===r-1&&this._addTileFeatures(n.range(0,l,s/r,c),n.points,-1,i,r,u),u.features.length?u:null}getClusterExpansionZoom(t){let e=this._getOriginZoom(t)-1;for(;e<=this.options.maxZoom;){const i=this.getChildren(t);if(e++,1!==i.length)break;t=i[0].properties.cluster_id}return e}_appendLeaves(t,e,i,n,r){const o=this.getChildren(e);for(const e of o){const o=e.properties;if(o&&o.cluster?r+o.point_count<=n?r+=o.point_count:r=this._appendLeaves(t,o.cluster_id,i,n,r):re&&(d+=i.numPoints||1)}if(d>u&&d>=a){let t=r.x*u,a=r.y*u,s=o&&u>1?this._map(r,!0):null;const h=(n<<5)+(e+1)+this.points.length;for(const i of c){const n=l.points[i];if(n.zoom<=e)continue;n.zoom=e;const c=n.numPoints||1;t+=n.x*c,a+=n.y*c,n.parentId=h,o&&(s||(s=this._map(r,!0)),o(s,this._map(n)))}r.parentId=h,i.push(F(t/d,a/d,h,d,s))}else if(i.push(r),d>1)for(const t of c){const n=l.points[t];n.zoom<=e||(n.zoom=e,i.push(n))}}return i}_getOriginId(t){return t-this.points.length>>5}_getOriginZoom(t){return(t-this.points.length)%32}_map(t,e){if(t.numPoints)return e?G({},t.properties):t.properties;const i=this.points[t.index].properties,n=this.options.map(i);return e&&n===i?G({},n):n}}function F(t,e,i,n,r){return{x:L(t),y:L(e),zoom:1/0,id:i,parentId:-1,numPoints:n,properties:r}}function j(t,e){const[i,n]=t.geometry.coordinates;return{x:L(U(i)),y:L(Z(n)),zoom:1/0,index:e,parentId:-1}}function N(t){return{type:"Feature",id:t.id,properties:V(t),geometry:{type:"Point",coordinates:[(e=t.x,360*(e-.5)),$(t.y)]}};var e}function V(t){const e=t.numPoints,i=e>=1e4?`${Math.round(e/1e3)}k`:e>=1e3?Math.round(e/100)/10+"k":e;return G(G({},t.properties),{cluster:!0,cluster_id:t.id,point_count:e,point_count_abbreviated:i})}function U(t){return t/360+.5}function Z(t){const e=Math.sin(t*Math.PI/180),i=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return i<0?0:i>1?1:i}function $(t){const e=(180-360*t)*Math.PI/180;return 360*Math.atan(Math.exp(e))/Math.PI-90}function G(t,e){for(const i in e)t[i]=e[i];return t}function q(t){return t.x}function W(t){return t.y}function H(t,e,i,n){for(var r,o=n,a=i-e>>1,s=i-e,l=t[e],c=t[e+1],u=t[i],d=t[i+1],h=e+3;ho)r=h,o=p;else if(p===o){var m=Math.abs(h-a);mn&&(r-e>3&&H(t,e,r,n),t[r+2]=o,i-r>3&&H(t,r,i,n))}function X(t,e,i,n,r,o){var a=r-i,s=o-n;if(0!==a||0!==s){var l=((t-i)*a+(e-n)*s)/(a*a+s*s);l>1?(i=r,n=o):l>0&&(i+=a*l,n+=s*l)}return(a=t-i)*a+(s=e-n)*s}function Y(t,e,i,n){var r={id:void 0===t?null:t,type:e,geometry:i,tags:n,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(t){var e=t.geometry,i=t.type;if("Point"===i||"MultiPoint"===i||"LineString"===i)K(t,e);else if("Polygon"===i||"MultiLineString"===i)for(var n=0;n0&&(a+=n?(r*c-l*o)/2:Math.sqrt(Math.pow(l-r,2)+Math.pow(c-o,2))),r=l,o=c}var u=e.length-3;e[2]=1,H(e,0,u,i),e[u+2]=1,e.size=Math.abs(a),e.start=0,e.end=e.size}function et(t,e,i,n){for(var r=0;r1?1:i}function rt(t,e,i,n,r,o,a,s){if(n/=e,o>=(i/=e)&&a=n)return null;for(var l=[],c=0;c=i&&m=n)){var f=[];if("Point"===h||"MultiPoint"===h)ot(d,f,i,n,r);else if("LineString"===h)at(d,f,i,n,r,!1,s.lineMetrics);else if("MultiLineString"===h)lt(d,f,i,n,r,!1);else if("Polygon"===h)lt(d,f,i,n,r,!0);else if("MultiPolygon"===h)for(var g=0;g=i&&a<=n&&(e.push(t[o]),e.push(t[o+1]),e.push(t[o+2]))}}function at(t,e,i,n,r,o,a){for(var s,l,c=st(t),u=0===r?ut:dt,d=t.start,h=0;hi&&(l=u(c,p,m,g,v,i),a&&(c.start=d+s*l)):y>n?_=i&&(l=u(c,p,m,g,v,i),x=!0),_>n&&y<=n&&(l=u(c,p,m,g,v,n),x=!0),!o&&x&&(a&&(c.end=d+s*l),e.push(c),c=st(t)),a&&(d+=s)}var b=t.length-3;p=t[b],m=t[b+1],f=t[b+2],(y=0===r?p:m)>=i&&y<=n&&ct(c,p,m,f),b=c.length-3,o&&b>=3&&(c[b]!==c[0]||c[b+1]!==c[1])&&ct(c,c[0],c[1],c[2]),c.length&&e.push(c)}function st(t){var e=[];return e.size=t.size,e.start=t.start,e.end=t.end,e}function lt(t,e,i,n,r,o){for(var a=0;aa.maxX&&(a.maxX=u),d>a.maxY&&(a.maxY=d)}return a}function vt(t,e,i,n){var r=e.geometry,o=e.type,a=[];if("Point"===o||"MultiPoint"===o)for(var s=0;s0&&e.size<(r?a:n))i.numPoints+=e.length/3;else{for(var s=[],l=0;la)&&(i.numSimplified++,s.push(e[l]),s.push(e[l+1])),i.numPoints++;r&&function(t,e){for(var i=0,n=0,r=t.length,o=r-2;n0===e)for(n=0,r=t.length;n24)throw new Error("maxZoom should be in the 0-24 range");if(e.promoteId&&e.generateId)throw new Error("promoteId and generateId cannot be used together.");var n=function(t,e){var i=[];if("FeatureCollection"===t.type)for(var n=0;n1&&console.time("creation"),h=this.tiles[d]=gt(t,e,i,n,l),this.tileCoords.push({z:e,x:i,y:n}),c)){c>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",e,i,n,h.numFeatures,h.numPoints,h.numSimplified),console.timeEnd("creation"));var p="z"+e;this.stats[p]=(this.stats[p]||0)+1,this.total++}if(h.source=t,r){if(e===l.maxZoom||e===r)continue;var m=1<1&&console.time("clipping");var f,g,v,y,_,x,b=.5*l.buffer/l.extent,w=.5-b,k=.5+b,E=1+b;f=g=v=y=null,_=rt(t,u,i-b,i+k,0,h.minX,h.maxX,l),x=rt(t,u,i+w,i+E,0,h.minX,h.maxX,l),t=null,_&&(f=rt(_,u,n-b,n+k,1,h.minY,h.maxY,l),g=rt(_,u,n+w,n+E,1,h.minY,h.maxY,l),_=null),x&&(v=rt(x,u,n-b,n+k,1,h.minY,h.maxY,l),y=rt(x,u,n+w,n+E,1,h.minY,h.maxY,l),x=null),c>1&&console.timeEnd("clipping"),s.push(f||[],e+1,2*i,2*n),s.push(g||[],e+1,2*i,2*n+1),s.push(v||[],e+1,2*i+1,2*n),s.push(y||[],e+1,2*i+1,2*n+1)}}},_t.prototype.getTile=function(t,e,i){var n=this.options,r=n.extent,o=n.debug;if(t<0||t>24)return null;var a=1<1&&console.log("drilling down to z%d-%d-%d",t,e,i);for(var l,c=t,u=e,d=i;!l&&c>0;)c--,u=Math.floor(u/2),d=Math.floor(d/2),l=this.tiles[xt(c,u,d)];return l&&l.source?(o>1&&console.log("found parent tile z%d-%d-%d",c,u,d),o>1&&console.time("drilling down"),this.splitTile(l.source,c,u,d,t,e,i),o>1&&console.timeEnd("drilling down"),this.tiles[s]?mt(this.tiles[s],r):null):null};class wt extends t.VectorTileWorkerSource{constructor(t,e,i,n,r){super(t,e,i,n,bt),r&&(this.loadGeoJSON=r)}loadData(e,i){const n=e&&e.request,r=n&&n.collectResourceTiming;this.loadGeoJSON(e,((o,s)=>{if(o||!s)return i(o);if("object"!=typeof s)return i(new Error(`Input data given to '${e.source}' is not a valid GeoJSON object.`));{a(s,!0);try{if(e.filter){const i=t.createExpression(e.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if("error"===i.result)throw new Error(i.value.map((t=>`${t.key}: ${t.message}`)).join(", "));const n=s.features.filter((t=>i.value.evaluate({zoom:0},t)));s={type:"FeatureCollection",features:n}}this._geoJSONIndex=e.cluster?new B(function({superclusterOptions:e,clusterProperties:i}){if(!i||!e)return e;const n={},r={},o={accumulated:null,zoom:0},a={properties:null},s=Object.keys(i);for(const e of s){const[o,a]=i[e],s=t.createExpression(a),l=t.createExpression("string"==typeof o?[o,["accumulated"],["get",e]]:o);n[e]=s.value,r[e]=l.value}return e.map=t=>{a.properties=t;const e={};for(const t of s)e[t]=n[t].evaluate(o,a);return e},e.reduce=(t,e)=>{a.properties=e;for(const e of s)o.accumulated=t[e],t[e]=r[e].evaluate(o,a)},e}(e)).load(s.features):function(t,e){return new _t(t,e)}(s,e.geojsonVtOptions)}catch(o){return i(o)}this.loaded={};const l={};if(r){const i=t.getPerformanceMeasurement(n);i&&(l.resourceTiming={},l.resourceTiming[e.source]=JSON.parse(JSON.stringify(i)))}i(null,l)}}))}reloadTile(t,e){const i=this.loaded;return i&&i[t.uid]?super.reloadTile(t,e):this.loadTile(t,e)}loadGeoJSON(e,i){if(e.request)t.getJSON(e.request,i);else{if("string"!=typeof e.data)return i(new Error(`Input data given to '${e.source}' is not a valid GeoJSON object.`));try{return i(null,JSON.parse(e.data))}catch(t){return i(new Error(`Input data given to '${e.source}' is not a valid GeoJSON object.`))}}}getClusterExpansionZoom(t,e){try{e(null,this._geoJSONIndex.getClusterExpansionZoom(t.clusterId))}catch(t){e(t)}}getClusterChildren(t,e){try{e(null,this._geoJSONIndex.getChildren(t.clusterId))}catch(t){e(t)}}getClusterLeaves(t,e){try{e(null,this._geoJSONIndex.getLeaves(t.clusterId,t.limit,t.offset))}catch(t){e(t)}}}class kt{constructor(e){this.self=e,this.actor=new t.Actor(e,this),this.layerIndexes={},this.availableImages={},this.isSpriteLoaded={},this.projections={},this.defaultProjection=t.getProjection({name:"mercator"}),this.workerSourceTypes={vector:t.VectorTileWorkerSource,geojson:wt},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=(t,e)=>{if(this.workerSourceTypes[t])throw new Error(`Worker source with name "${t}" already registered.`);this.workerSourceTypes[t]=e},this.self.registerRTLTextPlugin=e=>{if(t.plugin.isParsed())throw new Error("RTL text plugin already registered.");t.plugin.applyArabicShaping=e.applyArabicShaping,t.plugin.processBidirectionalText=e.processBidirectionalText,t.plugin.processStyledBidirectionalText=e.processStyledBidirectionalText}}clearCaches(t,e,i){delete this.layerIndexes[t],delete this.availableImages[t],delete this.workerSources[t],delete this.demWorkerSources[t],i()}checkIfReady(t,e,i){i()}setReferrer(t,e){this.referrer=e}spriteLoaded(e,i){this.isSpriteLoaded[e]=i;for(const n in this.workerSources[e]){const r=this.workerSources[e][n];for(const e in r)r[e]instanceof t.VectorTileWorkerSource&&(r[e].isSpriteLoaded=i,r[e].fire(new t.Event("isSpriteLoaded")))}}setImages(t,e,i){this.availableImages[t]=e;for(const i in this.workerSources[t]){const n=this.workerSources[t][i];for(const t in n)n[t].availableImages=e}i()}enableTerrain(t,e,i){this.terrain=e,i()}setProjection(e,i){this.projections[e]=t.getProjection(i)}setLayers(t,e,i){this.getLayerIndex(t).replace(e),i()}updateLayers(t,e,i){this.getLayerIndex(t).update(e.layers,e.removedIds),i()}loadTile(e,i,n){const r=this.enableTerrain?t.extend({enableTerrain:this.terrain},i):i;r.projection=this.projections[e]||this.defaultProjection,this.getWorkerSource(e,i.type,i.source).loadTile(r,n)}loadDEMTile(e,i,n){const r=this.enableTerrain?t.extend({buildQuadTree:this.terrain},i):i;this.getDEMWorkerSource(e,i.source).loadTile(r,n)}reloadTile(e,i,n){const r=this.enableTerrain?t.extend({enableTerrain:this.terrain},i):i;r.projection=this.projections[e]||this.defaultProjection,this.getWorkerSource(e,i.type,i.source).reloadTile(r,n)}abortTile(t,e,i){this.getWorkerSource(t,e.type,e.source).abortTile(e,i)}removeTile(t,e,i){this.getWorkerSource(t,e.type,e.source).removeTile(e,i)}removeSource(t,e,i){if(!this.workerSources[t]||!this.workerSources[t][e.type]||!this.workerSources[t][e.type][e.source])return;const n=this.workerSources[t][e.type][e.source];delete this.workerSources[t][e.type][e.source],void 0!==n.removeSource?n.removeSource(e,i):i()}loadWorkerSource(t,e,i){try{this.self.importScripts(e.url),i()}catch(t){i(t.toString())}}syncRTLPluginState(e,i,n){try{t.plugin.setState(i);const e=t.plugin.getPluginURL();if(t.plugin.isLoaded()&&!t.plugin.isParsed()&&null!=e){this.self.importScripts(e);const i=t.plugin.isParsed();n(i?void 0:new Error(`RTL Text Plugin failed to import scripts from ${e}`),i)}}catch(t){n(t.toString())}}getAvailableImages(t){let e=this.availableImages[t];return e||(e=[]),e}getLayerIndex(t){let e=this.layerIndexes[t];return e||(e=this.layerIndexes[t]=new n),e}getWorkerSource(t,e,i){return this.workerSources[t]||(this.workerSources[t]={}),this.workerSources[t][e]||(this.workerSources[t][e]={}),this.workerSources[t][e][i]||(this.workerSources[t][e][i]=new this.workerSourceTypes[e]({send:(e,i,n,r,o,a)=>{this.actor.send(e,i,n,t,o,a)},scheduler:this.actor.scheduler},this.getLayerIndex(t),this.getAvailableImages(t),this.isSpriteLoaded[t])),this.workerSources[t][e][i]}getDEMWorkerSource(t,e){return this.demWorkerSources[t]||(this.demWorkerSources[t]={}),this.demWorkerSources[t][e]||(this.demWorkerSources[t][e]=new o),this.demWorkerSources[t][e]}enforceCacheSizeLimit(e,i){t.enforceCacheSizeLimit(i)}getWorkerPerformanceMetrics(t,e,i){i(void 0,void 0)}}return"undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof self&&self instanceof WorkerGlobalScope&&(self.worker=new kt(self)),kt})),r(["./shared"],(function(t){var e=i;function i(t){return!function(t){return"undefined"==typeof window||"undefined"==typeof document?"not a browser":Array.prototype&&Array.prototype.every&&Array.prototype.filter&&Array.prototype.forEach&&Array.prototype.indexOf&&Array.prototype.lastIndexOf&&Array.prototype.map&&Array.prototype.some&&Array.prototype.reduce&&Array.prototype.reduceRight&&Array.isArray?Function.prototype&&Function.prototype.bind?Object.keys&&Object.create&&Object.getPrototypeOf&&Object.getOwnPropertyNames&&Object.isSealed&&Object.isFrozen&&Object.isExtensible&&Object.getOwnPropertyDescriptor&&Object.defineProperty&&Object.defineProperties&&Object.seal&&Object.freeze&&Object.preventExtensions?"JSON"in window&&"parse"in JSON&&"stringify"in JSON?function(){if(!("Worker"in window&&"Blob"in window&&"URL"in window))return!1;var t,e,i=new Blob([""],{type:"text/javascript"}),n=URL.createObjectURL(i);try{e=new Worker(n),t=!0}catch(e){t=!1}return e&&e.terminate(),URL.revokeObjectURL(n),t}()?"Uint8ClampedArray"in window?ArrayBuffer.isView?function(){var t=document.createElement("canvas");t.width=t.height=1;var e=t.getContext("2d");if(!e)return!1;var i=e.getImageData(0,0,1,1);return i&&i.width===t.width}()?(void 0===n[e=t&&t.failIfMajorPerformanceCaveat]&&(n[e]=function(t){var e,n=function(t){var e=document.createElement("canvas"),n=Object.create(i.webGLContextAttributes);return n.failIfMajorPerformanceCaveat=t,e.getContext("webgl",n)||e.getContext("experimental-webgl",n)}(t);if(!n)return!1;try{e=n.createShader(n.VERTEX_SHADER)}catch(t){return!1}return!(!e||n.isContextLost())&&(n.shaderSource(e,"void main() {}"),n.compileShader(e),!0===n.getShaderParameter(e,n.COMPILE_STATUS))}(e)),n[e]?document.documentMode?"insufficient ECMAScript 6 support":void 0:"insufficient WebGL support"):"insufficient Canvas/getImageData support":"insufficient ArrayBuffer support":"insufficient Uint8ClampedArray support":"insufficient worker support":"insufficient JSON support":"insufficient Object support":"insufficient Function support":"insufficent Array support";var e}(t)}var n={};function r(t,e){var i=e[0],n=e[1],r=e[2],o=e[3],a=i*o-r*n;return a?(t[0]=o*(a=1/a),t[1]=-n*a,t[2]=-r*a,t[3]=i*a,t):null}function o(t,e){if(Array.isArray(t)){if(!Array.isArray(e)||t.length!==e.length)return!1;for(let i=0;i{t.window.removeEventListener("click",u,!0)}),0)},a.mousePos=function(t,e){const i=t.getBoundingClientRect();return d(t,i,e)},a.touchPos=function(t,e){const i=t.getBoundingClientRect(),n=[];for(let r=0;r=0?0:e.button};class p extends t.Evented{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new t.RGBAImage({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(t){if(this.loaded!==t&&(this.loaded=t,t)){for(const{ids:t,callback:e}of this.requestors)this._notify(t,e);this.requestors=[]}}getImage(t){return this.images[t]}addImage(t,e){this._validate(t,e)&&(this.images[t]=e)}_validate(e,i){let n=!0;return this._validateStretch(i.stretchX,i.data&&i.data.width)||(this.fire(new t.ErrorEvent(new Error(`Image "${e}" has invalid "stretchX" value`))),n=!1),this._validateStretch(i.stretchY,i.data&&i.data.height)||(this.fire(new t.ErrorEvent(new Error(`Image "${e}" has invalid "stretchY" value`))),n=!1),this._validateContent(i.content,i)||(this.fire(new t.ErrorEvent(new Error(`Image "${e}" has invalid "content" value`))),n=!1),n}_validateStretch(t,e){if(!t)return!0;let i=0;for(const n of t){if(n[0]{this.ready=!0}))}broadcast(e,i,n){t.asyncAll(this.actors,((t,n)=>{t.send(e,i,n)}),n=n||function(){})}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(){this.actors.forEach((t=>{t.remove()})),this.actors=[],this.workerPool.release(this.id)}}function S(e,i,n){return i*(t.EXTENT/(e.tileSize*Math.pow(2,n-e.tileID.overscaledZ)))}T.Actor=t.Actor;class C{constructor(t,e,i){this.context=t;const n=t.gl;this.buffer=n.createBuffer(),this.dynamicDraw=Boolean(i),this.context.unbindVAO(),t.bindElementBuffer.set(this.buffer),n.bufferData(n.ELEMENT_ARRAY_BUFFER,e.arrayBuffer,this.dynamicDraw?n.DYNAMIC_DRAW:n.STATIC_DRAW),this.dynamicDraw||delete e.arrayBuffer}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(t){const e=this.context.gl;this.context.unbindVAO(),this.bind(),e.bufferSubData(e.ELEMENT_ARRAY_BUFFER,0,t.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}const M={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class z{constructor(t,e,i,n){this.length=e.length,this.attributes=i,this.itemSize=e.bytesPerElement,this.dynamicDraw=n,this.context=t;const r=t.gl;this.buffer=r.createBuffer(),t.bindVertexBuffer.set(this.buffer),r.bufferData(r.ARRAY_BUFFER,e.arrayBuffer,this.dynamicDraw?r.DYNAMIC_DRAW:r.STATIC_DRAW),this.dynamicDraw||delete e.arrayBuffer}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(t){const e=this.context.gl;this.bind(),e.bufferSubData(e.ARRAY_BUFFER,0,t.arrayBuffer)}enableAttributes(t,e){for(let i=0;in.pointCoordinate3D(t))),this.cameraGeometry=this.bufferedCameraGeometry(0)}static createFromScreenPoints(e,i){let n,r;if(e instanceof t.pointGeometry||"number"==typeof e[0]){const o=t.pointGeometry.convert(e);n=[t.pointGeometry.convert(e)],r=i.isPointAboveHorizon(o)}else{const o=t.pointGeometry.convert(e[0]),a=t.pointGeometry.convert(e[1]);n=[o,a],r=t.polygonizeBounds(o,a).every((t=>i.isPointAboveHorizon(t)))}return new mt(n,i.getCameraPoint(),r,i)}isPointQuery(){return 1===this.screenBounds.length}bufferedScreenGeometry(e){return t.polygonizeBounds(this.screenBounds[0],1===this.screenBounds.length?this.screenBounds[0]:this.screenBounds[1],e)}bufferedCameraGeometry(e){const i=this.screenBounds[0],n=1===this.screenBounds.length?this.screenBounds[0].add(new t.pointGeometry(1,1)):this.screenBounds[1],r=t.polygonizeBounds(i,n,0,!1);return this.cameraPoint.y>n.y&&(this.cameraPoint.x>i.x&&this.cameraPoint.x=n.x?r[2]=this.cameraPoint:this.cameraPoint.x<=i.x&&(r[3]=this.cameraPoint)),t.bufferConvexPolygon(r,e)}containsTile(e,i,n){const r=e.queryPadding+1,o=e.tileID.wrap,a=n?this._bufferedCameraMercator(r,i).map((i=>t.getTilePoint(e.tileTransform,i,o))):this._bufferedScreenMercator(r,i).map((i=>t.getTilePoint(e.tileTransform,i,o))),s=this.screenGeometryMercator.map((i=>t.getTileVec3(e.tileTransform,i,o))),l=s.map((e=>new t.pointGeometry(e[0],e[1]))),c=i.getFreeCameraOptions().position||new t.MercatorCoordinate(0,0,0),u=t.getTileVec3(e.tileTransform,c,o),d=s.map((e=>{const i=t.sub(e,e,u);return t.normalize(i,i),new t.Ray(u,i)})),h=S(e,1,i.zoom);if(t.polygonIntersectsBox(a,0,0,t.EXTENT,t.EXTENT))return{queryGeometry:this,tilespaceGeometry:l,tilespaceRays:d,bufferedTilespaceGeometry:a,bufferedTilespaceBounds:(p=t.getBounds(a),p.min.x=t.clamp(p.min.x,0,t.EXTENT),p.min.y=t.clamp(p.min.y,0,t.EXTENT),p.max.x=t.clamp(p.max.x,0,t.EXTENT),p.max.y=t.clamp(p.max.y,0,t.EXTENT),p),tile:e,tileID:e.tileID,pixelToTileUnitsFactor:h};var p}_bufferedScreenMercator(t,e){const i=ft(t);if(this._screenRaycastCache[i])return this._screenRaycastCache[i];{const n=this.bufferedScreenGeometry(t).map((t=>e.pointCoordinate3D(t)));return this._screenRaycastCache[i]=n,n}}_bufferedCameraMercator(t,e){const i=ft(t);if(this._cameraRaycastCache[i])return this._cameraRaycastCache[i];{const n=this.bufferedCameraGeometry(t).map((t=>e.pointCoordinate3D(t)));return this._cameraRaycastCache[i]=n,n}}}function ft(t){return 100*t|0}function gt(e,i,n){const r=function(r,o){if(r)return n(r);if(o){const r=t.pick(t.extend(o,e),["tiles","minzoom","maxzoom","attribution","mapbox_logo","bounds","scheme","tileSize","encoding"]);o.vector_layers&&(r.vectorLayers=o.vector_layers,r.vectorLayerIds=r.vectorLayers.map((t=>t.id))),r.tiles=i.canonicalizeTileset(r,e.url),n(null,r)}};return e.url?t.getJSON(i.transformRequest(i.normalizeSourceURL(e.url),t.ResourceType.Source),r):t.exported.frame((()=>r(null,e)))}class vt{constructor(e,i,n){this.bounds=t.LngLatBounds.convert(this.validateBounds(e)),this.minzoom=i||0,this.maxzoom=n||24}validateBounds(t){return Array.isArray(t)&&4===t.length?[Math.max(-180,t[0]),Math.max(-90,t[1]),Math.min(180,t[2]),Math.min(90,t[3])]:[-180,-90,180,90]}contains(e){const i=Math.pow(2,e.z),n=Math.floor(t.mercatorXfromLng(this.bounds.getWest())*i),r=Math.floor(t.mercatorYfromLat(this.bounds.getNorth())*i),o=Math.ceil(t.mercatorXfromLng(this.bounds.getEast())*i),a=Math.ceil(t.mercatorYfromLat(this.bounds.getSouth())*i);return e.x>=n&&e.x=r&&e.y{this._tileJSONRequest=null,this._loaded=!0,e?this.fire(new t.ErrorEvent(e)):i&&(t.extend(this,i),i.bounds&&(this.tileBounds=new vt(i.bounds,this.minzoom,this.maxzoom)),t.postTurnstileEvent(i.tiles),this.fire(new t.Event("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new t.Event("data",{dataType:"source",sourceDataType:"content"})))}))}loaded(){return this._loaded}onAdd(t){this.map=t,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}serialize(){return t.extend({},this._options)}hasTile(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)}loadTile(e,i){const n=t.exported.devicePixelRatio>=2,r=this.map._requestManager.normalizeTileURL(e.tileID.canonical.url(this.tiles,this.scheme),n,this.tileSize);e.request=t.getImage(this.map._requestManager.transformRequest(r,t.ResourceType.Tile),((n,r,o,a)=>{if(delete e.request,e.aborted)e.state="unloaded",i(null);else if(n)e.state="errored",i(n);else if(r){this.map._refreshExpiredTiles&&e.setExpiryData({cacheControl:o,expires:a});const n=this.map.painter.context,s=n.gl;e.texture=this.map.painter.getTileTexture(r.width),e.texture?e.texture.update(r,{useMipmap:!0}):(e.texture=new t.Texture(n,r,s.RGBA,{useMipmap:!0}),e.texture.bind(s.LINEAR,s.CLAMP_TO_EDGE),n.extTextureFilterAnisotropic&&s.texParameterf(s.TEXTURE_2D,n.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,n.extTextureFilterAnisotropicMax)),e.state="loaded",t.cacheEntryPossiblyAdded(this.dispatcher),i(null)}}))}abortTile(t,e){t.request&&(t.request.cancel(),delete t.request),e()}unloadTile(t,e){t.texture&&this.map.painter.saveTileTexture(t.texture),e()}hasTransition(){return!1}}let _t;function xt(e,i,n,r,o,a,s,l){const c=[e,n,o,i,r,a,1,1,1],u=[s,l,1],d=t.adjoint([],c),[h,p,m]=t.transformMat3(u,u,t.transpose(d,d));return t.multiply(c,[h,0,0,0,p,0,0,0,m],c)}class bt extends t.Evented{constructor(t,e,i,n){super(),this.id=t,this.dispatcher=i,this.coordinates=e.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(n),this.options=e}load(e,i){this._loaded=!1,this.fire(new t.Event("dataloading",{dataType:"source"})),this.url=this.options.url,t.getImage(this.map._requestManager.transformRequest(this.url,t.ResourceType.Image),((n,r)=>{this._loaded=!0,n?this.fire(new t.ErrorEvent(n)):r&&(this.image=t.exported.getImageData(r),this.width=this.image.width,this.height=this.image.height,e&&(this.coordinates=e),i&&i(),this._finishLoading())}))}loaded(){return this._loaded}updateImage(t){return this.image&&t.url?(this.options.url=t.url,this.load(t.coordinates,(()=>{this.texture=null})),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new t.Event("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(t){this.map=t,this.load()}setCoordinates(e){this.coordinates=e,delete this._boundsArray;const i=e.map(t.MercatorCoordinate.fromLngLat);return this.tileID=function(e){let i=1/0,n=1/0,r=-1/0,o=-1/0;for(const t of e)i=Math.min(i,t.x),n=Math.min(n,t.y),r=Math.max(r,t.x),o=Math.max(o,t.y);const a=Math.max(r-i,o-n),s=Math.max(0,Math.floor(-Math.log(a)/Math.LN2)),l=Math.pow(2,s);return new t.CanonicalTileID(s,Math.floor((i+r)/2*l),Math.floor((n+o)/2*l))}(i),this.minzoom=this.maxzoom=this.tileID.z,this.fire(new t.Event("data",{dataType:"source",sourceDataType:"content"})),this}_clear(){delete this._boundsArray}_makeBoundsArray(){const e=t.tileTransform(this.tileID,this.map.transform.projection),[i,n,r,o]=this.coordinates.map((i=>{const n=e.projection.project(i[0],i[1]);return t.getTilePoint(e,n)._round()}));return this.perspectiveTransform=function(e,i,n,r,o,a,s,l,c,u){const d=xt(0,0,e,0,0,i,e,i),h=xt(n,r,o,a,s,l,c,u);return t.multiply(h,t.adjoint(d,d),h),[h[6]/h[8]*e/t.EXTENT,h[7]/h[8]*i/t.EXTENT]}(this.width,this.height,i.x,i.y,n.x,n.y,o.x,o.y,r.x,r.y),this._boundsArray=new t.StructArrayLayout4i8,this._boundsArray.emplaceBack(i.x,i.y,0,0),this._boundsArray.emplaceBack(n.x,n.y,t.EXTENT,0),this._boundsArray.emplaceBack(o.x,o.y,0,t.EXTENT),this._boundsArray.emplaceBack(r.x,r.y,t.EXTENT,t.EXTENT),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this}prepare(){if(0===Object.keys(this.tiles).length||!this.image)return;const e=this.map.painter.context,i=e.gl;this._boundsArray||this._makeBoundsArray(),this.boundsBuffer||(this.boundsBuffer=e.createVertexBuffer(this._boundsArray,t.boundsAttributes.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture||(this.texture=new t.Texture(e,this.image,i.RGBA),this.texture.bind(i.LINEAR,i.CLAMP_TO_EDGE));for(const t in this.tiles){const e=this.tiles[t];"loaded"!==e.state&&(e.state="loaded",e.texture=this.texture)}}loadTile(t,e){this.tileID&&this.tileID.equals(t.tileID.canonical)?(this.tiles[String(t.tileID.wrap)]=t,t.buckets={},e(null)):(t.state="errored",e(null))}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}}const wt={vector:class extends t.Evented{constructor(e,i,n,r){if(super(),this.id=e,this.dispatcher=n,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,t.extend(this,t.pick(i,["url","scheme","tileSize","promoteId"])),this._options=t.extend({type:"vector"},i),this._collectResourceTiming=i.collectResourceTiming,512!==this.tileSize)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(r),this._tileWorkers={},this._deduped=new t.DedupedRequest}load(){this._loaded=!1,this.fire(new t.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=gt(this._options,this.map._requestManager,((e,i)=>{this._tileJSONRequest=null,this._loaded=!0,e?this.fire(new t.ErrorEvent(e)):i&&(t.extend(this,i),i.bounds&&(this.tileBounds=new vt(i.bounds,this.minzoom,this.maxzoom)),t.postTurnstileEvent(i.tiles,this.map._requestManager._customAccessToken),this.fire(new t.Event("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new t.Event("data",{dataType:"source",sourceDataType:"content"})))}))}loaded(){return this._loaded}hasTile(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)}onAdd(t){this.map=t,this.load()}setSourceProperty(t){this._tileJSONRequest&&this._tileJSONRequest.cancel(),t();const e=this.map.style._getSourceCaches(this.id);for(const t of e)t.clearTiles();this.load()}setTiles(t){return this.setSourceProperty((()=>{this._options.tiles=t})),this}setUrl(t){return this.setSourceProperty((()=>{this.url=t,this._options.url=t})),this}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}serialize(){return t.extend({},this._options)}loadTile(e,i){const n=this.map._requestManager.normalizeTileURL(e.tileID.canonical.url(this.tiles,this.scheme)),r={request:this.map._requestManager.transformRequest(n,t.ResourceType.Tile),data:void 0,uid:e.uid,tileID:e.tileID,tileZoom:e.tileZoom,zoom:e.tileID.overscaledZ,tileSize:this.tileSize*e.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:t.exported.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId,isSymbolTile:e.isSymbolTile};if(r.request.collectResourceTiming=this._collectResourceTiming,e.actor&&"expired"!==e.state)"loading"===e.state?e.reloadCallback=i:e.request=e.actor.send("reloadTile",r,o.bind(this));else if(e.actor=this._tileWorkers[n]=this._tileWorkers[n]||this.dispatcher.getActor(),this.dispatcher.ready)e.request=e.actor.send("loadTile",r,o.bind(this),void 0,!0);else{const i=t.loadVectorTile.call({deduped:this._deduped},r,((t,i)=>{t||!i?o.call(this,t):(r.data={cacheControl:i.cacheControl,expires:i.expires,rawData:i.rawData.slice(0)},e.actor&&e.actor.send("loadTile",r,o.bind(this),void 0,!0))}),!0);e.request={cancel:i}}function o(n,r){return delete e.request,e.aborted?i(null):n&&404!==n.status?i(n):(r&&r.resourceTiming&&(e.resourceTiming=r.resourceTiming),this.map._refreshExpiredTiles&&r&&e.setExpiryData(r),e.loadVectorData(r,this.map.painter),t.cacheEntryPossiblyAdded(this.dispatcher),i(null),void(e.reloadCallback&&(this.loadTile(e,e.reloadCallback),e.reloadCallback=null)))}}abortTile(t){t.request&&(t.request.cancel(),delete t.request),t.actor&&t.actor.send("abortTile",{uid:t.uid,type:this.type,source:this.id})}unloadTile(t){t.unloadVectorData(),t.actor&&t.actor.send("removeTile",{uid:t.uid,type:this.type,source:this.id})}hasTransition(){return!1}afterUpdate(){this._tileWorkers={}}},raster:yt,"raster-dem":class extends yt{constructor(e,i,n,r){super(e,i,n,r),this.type="raster-dem",this.maxzoom=22,this._options=t.extend({type:"raster-dem"},i),this.encoding=i.encoding||"mapbox"}loadTile(e,i){const n=this.map._requestManager.normalizeTileURL(e.tileID.canonical.url(this.tiles,this.scheme),!1,this.tileSize);function r(t,n){t&&(e.state="errored",i(t)),n&&(e.dem=n,e.dem.onDeserialize(),e.needsHillshadePrepare=!0,e.needsDEMTextureUpload=!0,e.state="loaded",i(null))}e.request=t.getImage(this.map._requestManager.transformRequest(n,t.ResourceType.Tile),function(n,o,a,s){if(delete e.request,e.aborted)e.state="unloaded",i(null);else if(n)e.state="errored",i(n);else if(o){this.map._refreshExpiredTiles&&e.setExpiryData({cacheControl:a,expires:s});const i=t.window.ImageBitmap&&o instanceof t.window.ImageBitmap&&(null==_t&&(_t=t.window.OffscreenCanvas&&new t.window.OffscreenCanvas(1,1).getContext("2d")&&"function"==typeof t.window.createImageBitmap),_t),n=1-(o.width-t.prevPowerOfTwo(o.width))/2;n<1||e.neighboringTiles||(e.neighboringTiles=this._getNeighboringTiles(e.tileID));const l=i?o:t.exported.getImageData(o,n),c={uid:e.uid,coord:e.tileID,source:this.id,rawImageData:l,encoding:this.encoding,padding:n};e.actor&&"expired"!==e.state||(e.actor=this.dispatcher.getActor(),e.actor.send("loadDEMTile",c,r.bind(this),void 0,!0))}}.bind(this))}_getNeighboringTiles(e){const i=e.canonical,n=Math.pow(2,i.z),r=(i.x-1+n)%n,o=0===i.x?e.wrap-1:e.wrap,a=(i.x+1+n)%n,s=i.x+1===n?e.wrap+1:e.wrap,l={};return l[new t.OverscaledTileID(e.overscaledZ,o,i.z,r,i.y).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,s,i.z,a,i.y).key]={backfilled:!1},i.y>0&&(l[new t.OverscaledTileID(e.overscaledZ,o,i.z,r,i.y-1).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,e.wrap,i.z,i.x,i.y-1).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,s,i.z,a,i.y-1).key]={backfilled:!1}),i.y+1{if(this._loaded=!0,this._pendingLoad=null,e)this.fire(new t.ErrorEvent(e));else{const e={dataType:"source",sourceDataType:this._metadataFired?"content":"metadata"};this._collectResourceTiming&&i&&i.resourceTiming&&i.resourceTiming[this.id]&&(e.resourceTiming=i.resourceTiming[this.id]),this.fire(new t.Event("data",e)),this._metadataFired=!0}this._coalesce&&(this._updateWorkerData(),this._coalesce=!1)}))}loaded(){return this._loaded}loadTile(e,i){const n=e.actor?"reloadTile":"loadTile";e.actor=this.actor,e.request=this.actor.send(n,{type:this.type,uid:e.uid,tileID:e.tileID,tileZoom:e.tileZoom,zoom:e.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:t.exported.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId},((t,r)=>(delete e.request,e.unloadVectorData(),e.aborted?i(null):t?i(t):(e.loadVectorData(r,this.map.painter,"reloadTile"===n),i(null)))),void 0,"loadTile"===n)}abortTile(t){t.request&&(t.request.cancel(),delete t.request),t.aborted=!0}unloadTile(t){t.unloadVectorData(),this.actor.send("removeTile",{uid:t.uid,type:this.type,source:this.id})}onRemove(){this._pendingLoad&&this._pendingLoad.cancel()}serialize(){return t.extend({},this._options,{type:this.type,data:this._data})}hasTransition(){return!1}},video:class extends bt{constructor(t,e,i,n){super(t,e,i,n),this.roundZoom=!0,this.type="video",this.options=e}load(){this._loaded=!1;const e=this.options;this.urls=[];for(const i of e.urls)this.urls.push(this.map._requestManager.transformRequest(i,t.ResourceType.Source).url);t.getVideo(this.urls,((e,i)=>{this._loaded=!0,e?this.fire(new t.ErrorEvent(e)):i&&(this.video=i,this.video.loop=!0,this.video.setAttribute("playsinline",""),this.video.addEventListener("playing",(()=>{this.map.triggerRepaint()})),this.map&&this.video.play(),this._finishLoading())}))}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(e){if(this.video){const i=this.video.seekable;ei.end(0)?this.fire(new t.ErrorEvent(new t.ValidationError(`sources.${this.id}`,null,`Playback for this video can be set only between the ${i.start(0)} and ${i.end(0)}-second mark.`))):this.video.currentTime=e}}getVideo(){return this.video}onAdd(t){this.map||(this.map=t,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}prepare(){if(0===Object.keys(this.tiles).length||this.video.readyState<2)return;const e=this.map.painter.context,i=e.gl;this.texture?this.video.paused||(this.texture.bind(i.LINEAR,i.CLAMP_TO_EDGE),i.texSubImage2D(i.TEXTURE_2D,0,0,0,i.RGBA,i.UNSIGNED_BYTE,this.video)):(this.texture=new t.Texture(e,this.video,i.RGBA),this.texture.bind(i.LINEAR,i.CLAMP_TO_EDGE),this.width=this.video.videoWidth,this.height=this.video.videoHeight),this._boundsArray||this._makeBoundsArray(),this.boundsBuffer||(this.boundsBuffer=e.createVertexBuffer(this._boundsArray,t.boundsAttributes.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2));for(const t in this.tiles){const e=this.tiles[t];"loaded"!==e.state&&(e.state="loaded",e.texture=this.texture)}}serialize(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}hasTransition(){return this.video&&!this.video.paused}},image:bt,canvas:class extends bt{constructor(e,i,n,r){super(e,i,n,r),i.coordinates?Array.isArray(i.coordinates)&&4===i.coordinates.length&&!i.coordinates.some((t=>!Array.isArray(t)||2!==t.length||t.some((t=>"number"!=typeof t))))||this.fire(new t.ErrorEvent(new t.ValidationError(`sources.${e}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new t.ErrorEvent(new t.ValidationError(`sources.${e}`,null,'missing required property "coordinates"'))),i.animate&&"boolean"!=typeof i.animate&&this.fire(new t.ErrorEvent(new t.ValidationError(`sources.${e}`,null,'optional "animate" property must be a boolean value'))),i.canvas?"string"==typeof i.canvas||i.canvas instanceof t.window.HTMLCanvasElement||this.fire(new t.ErrorEvent(new t.ValidationError(`sources.${e}`,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new t.ErrorEvent(new t.ValidationError(`sources.${e}`,null,'missing required property "canvas"'))),this.options=i,this.animate=void 0===i.animate||i.animate}load(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof t.window.HTMLCanvasElement?this.options.canvas:t.window.document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new t.ErrorEvent(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())}getCanvas(){return this.canvas}onAdd(t){this.map=t,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let e=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,e=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,e=!0),this._hasInvalidDimensions())return;if(0===Object.keys(this.tiles).length)return;const i=this.map.painter.context,n=i.gl;this._boundsArray||this._makeBoundsArray(),this.boundsBuffer||(this.boundsBuffer=i.createVertexBuffer(this._boundsArray,t.boundsAttributes.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(e||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new t.Texture(i,this.canvas,n.RGBA,{premultiply:!0});for(const t in this.tiles){const e=this.tiles[t];"loaded"!==e.state&&(e.state="loaded",e.texture=this.texture)}}serialize(){return{type:"canvas",coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(const t of[this.canvas.width,this.canvas.height])if(isNaN(t)||t<=0)return!0;return!1}}},kt=function(e,i,n,r){const o=new wt[i.type](e,i,n,r);if(o.id!==e)throw new Error(`Expected Source id to be ${e} instead of ${o.id}`);return t.bindAll(["load","abort","unload","serialize","prepare"],o),o};function Et(e,i){const n=t.identity([]);return t.scale(n,n,[.5*e.width,.5*-e.height,1]),t.translate(n,n,[1,-1,0]),t.multiply$1(n,n,e.calculateProjMatrix(i.toUnwrapped()))}function Tt(t,e,i,n,r,o,a,s=!1){const l=t.tilesIn(n,a,s);l.sort(Ct);const c=[];for(const n of l)c.push({wrappedTileID:n.tile.tileID.wrapped().key,queryResults:n.tile.queryRenderedFeatures(e,i,t._state,n,r,o,Et(t.transform,n.tile.tileID),s)});const u=function(t){const e={},i={};for(const n of t){const t=n.queryResults,r=n.wrappedTileID,o=i[r]=i[r]||{};for(const i in t){const n=t[i],r=o[i]=o[i]||{},a=e[i]=e[i]||[];for(const t of n)r[t.featureIndex]||(r[t.featureIndex]=!0,a.push(t))}}return e}(c);for(const e in u)u[e].forEach((e=>{const i=e.feature,n=t.getFeatureState(i.layer["source-layer"],i.id);i.source=i.layer.source,i.layer["source-layer"]&&(i.sourceLayer=i.layer["source-layer"]),i.state=n}));return u}function St(t,e){const i=t.getRenderableIds().map((e=>t.getTileByID(e))),n=[],r={};for(let t=0;t{t.terminate()})),this.workers=null)}isPreloaded(){return!!this.active[zt]}numActive(){return Object.keys(this.active).length}}let Pt;function At(){return Pt||(Pt=new It),Pt}function Dt(e,i){const n={};for(const t in e)"ref"!==t&&(n[t]=e[t]);return t.refProperties.forEach((t=>{t in i&&(n[t]=i[t])})),n}function Ot(t){t=t.slice();const e=Object.create(null);for(let i=0;i0?(r-a)/s:0;return this.points[o].mult(1-l).add(this.points[i].mult(l))}}class $t{constructor(t,e,i){const n=this.boxCells=[],r=this.circleCells=[];this.xCellCount=Math.ceil(t/i),this.yCellCount=Math.ceil(e/i);for(let t=0;tthis.width||n<0||e>this.height)return!r&&[];const a=[];if(t<=0&&e<=0&&this.width<=i&&this.height<=n){if(r)return!0;for(let t=0;t0:a}_queryCircle(t,e,i,n,r){const o=t-i,a=t+i,s=e-i,l=e+i;if(a<0||o>this.width||l<0||s>this.height)return!n&&[];const c=[];return this._forEachCell(o,s,a,l,this._queryCellCircle,c,{hitTest:n,circle:{x:t,y:e,radius:i},seenUids:{box:{},circle:{}}},r),n?c.length>0:c}query(t,e,i,n,r){return this._query(t,e,i,n,!1,r)}hitTest(t,e,i,n,r){return this._query(t,e,i,n,!0,r)}hitTestCircle(t,e,i,n){return this._queryCircle(t,e,i,!0,n)}_queryCell(t,e,i,n,r,o,a,s){const l=a.seenUids,c=this.boxCells[r];if(null!==c){const r=this.bboxes;for(const u of c)if(!l.box[u]){l.box[u]=!0;const c=4*u;if(t<=r[c+2]&&e<=r[c+3]&&i>=r[c+0]&&n>=r[c+1]&&(!s||s(this.boxKeys[u]))){if(a.hitTest)return o.push(!0),!0;o.push({key:this.boxKeys[u],x1:r[c],y1:r[c+1],x2:r[c+2],y2:r[c+3]})}}}const u=this.circleCells[r];if(null!==u){const r=this.circles;for(const c of u)if(!l.circle[c]){l.circle[c]=!0;const u=3*c;if(this._circleAndRectCollide(r[u],r[u+1],r[u+2],t,e,i,n)&&(!s||s(this.circleKeys[c]))){if(a.hitTest)return o.push(!0),!0;{const t=r[u],e=r[u+1],i=r[u+2];o.push({key:this.circleKeys[c],x1:t-i,y1:e-i,x2:t+i,y2:e+i})}}}}}_queryCellCircle(t,e,i,n,r,o,a,s){const l=a.circle,c=a.seenUids,u=this.boxCells[r];if(null!==u){const t=this.bboxes;for(const e of u)if(!c.box[e]){c.box[e]=!0;const i=4*e;if(this._circleAndRectCollide(l.x,l.y,l.radius,t[i+0],t[i+1],t[i+2],t[i+3])&&(!s||s(this.boxKeys[e])))return o.push(!0),!0}}const d=this.circleCells[r];if(null!==d){const t=this.circles;for(const e of d)if(!c.circle[e]){c.circle[e]=!0;const i=3*e;if(this._circlesCollide(t[i],t[i+1],t[i+2],l.x,l.y,l.radius)&&(!s||s(this.circleKeys[e])))return o.push(!0),!0}}}_forEachCell(t,e,i,n,r,o,a,s){const l=this._convertToXCellCoord(t),c=this._convertToYCellCoord(e),u=this._convertToXCellCoord(i),d=this._convertToYCellCoord(n);for(let h=l;h<=u;h++)for(let l=c;l<=d;l++)if(r.call(this,t,e,i,n,this.xCellCount*l+h,o,a,s))return}_convertToXCellCoord(t){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(t*this.xScale)))}_convertToYCellCoord(t){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(t*this.yScale)))}_circlesCollide(t,e,i,n,r,o){const a=n-t,s=r-e,l=i+o;return l*l>a*a+s*s}_circleAndRectCollide(t,e,i,n,r,o,a){const s=(o-n)/2,l=Math.abs(t-(n+s));if(l>s+i)return!1;const c=(a-r)/2,u=Math.abs(e-(r+c));if(u>c+i)return!1;if(l<=s||u<=c)return!0;const d=l-s,h=u-c;return d*d+h*h<=i*i}}const Gt=Math.tan(85*Math.PI/180);function qt(e,i,n,o,a,s){let l=t.create();if(n){if("globe"===a.projection.name)l=t.calculateGlobeMatrix(a,a.worldSize/a._projectionScaler,[0,0]),t.multiply$1(l,l,t.globeDenormalizeECEF(t.globeTileBounds(i)));else{const t=r([],s);l[0]=t[0],l[1]=t[1],l[4]=t[2],l[5]=t[3]}o||t.rotateZ(l,l,a.angle)}else t.multiply$1(l,a.labelPlaneMatrix,e);return l}function Wt(e,i,n,r,o,a){if(n){if("globe"===o.projection.name){const s=qt(e,i,n,r,o,a);return t.invert(s,s),t.multiply$1(s,e,s),s}{const i=t.clone(e),n=t.identity([]);return n[0]=a[0],n[1]=a[1],n[4]=a[2],n[5]=a[3],t.multiply$1(i,i,n),r||t.rotateZ(i,i,-o.angle),i}}return o.glCoordMatrix}function Ht(e,i,n=0){const r=[e.x,e.y,n,1];n?t.transformMat4$1(r,r,i):ae(r,r,i);const o=r[3];return{point:new t.pointGeometry(r[0]/o,r[1]/o),signedDistanceFromCamera:o}}function Xt(t,e){return Math.min(.5+t/e*.5,1.5)}function Yt(t,e){const i=t[0]/t[3],n=t[1]/t[3];return i>=-e[0]&&i<=e[0]&&n>=-e[1]&&n<=e[1]}function Kt(e,i,n,r,o,a,s,l,c,u){const d=n.transform,h=r?e.textSizeData:e.iconSizeData,p=t.evaluateSizeForZoom(h,n.transform.zoom),m=[256/n.width*2+1,256/n.height*2+1],f=r?e.text.dynamicLayoutVertexArray:e.icon.dynamicLayoutVertexArray;f.clear();const g=e.lineVertexArray,v=r?e.text.placedSymbolArray:e.icon.placedSymbolArray,y=n.transform.width/n.transform.height;let _=!1;for(let r=0;rMath.abs(n.x-i.x)*r?{useVertical:!0}:e.writingMode===t.WritingMode.vertical?i.yGt}(i,n,r)?1===e.flipState?{needsFlipping:!0}:null:i.x>n.x?{needsFlipping:!0}:null}function te(e,i,n,r,o,a,s,l,c,u,d,h,p,m,f,g,v){const y=i/24,_=e.lineOffsetX*y,x=e.lineOffsetY*y;let b;if(e.numGlyphs>1){const t=e.glyphStartIndex+e.numGlyphs,i=e.lineStartIndex,o=e.lineStartIndex+e.lineLength,u=Jt(y,l,_,x,n,d,h,e,c,a,p,f,!1,g,v);if(!u)return{notEnoughRoom:!0};const w=Ht(u.first.point,s).point,k=Ht(u.last.point,s).point;if(r&&!n){const t=Qt(e,w,k,m);if(e.flipState=t&&t.needsFlipping?1:2,t)return t}b=[u.first];for(let r=e.glyphStartIndex+1;r0?a.point:ie(h,r,i,1,o,void 0,g,v.canonical),m);if(e.flipState=s&&s.needsFlipping?1:2,s)return s}const i=ne(y*l.getoffsetX(e.glyphStartIndex),_,x,n,d,h,e.segment,e.lineStartIndex,e.lineStartIndex+e.lineLength,c,a,p,f,!1,!1,g,v);if(!i)return{notEnoughRoom:!0};b=[i]}for(const e of b)t.addDynamicAttributes(u,e.point,e.angle);return{}}function ee(e,i,n,r,o){const a=r.projectTilePoint(e.x,e.y,i);if(!o)return Ht(a,n,a.z);const s=o(e);return Ht(new t.pointGeometry(a.x+s[0],a.y+s[1]),n,a.z+s[2])}function ie(t,e,i,n,r,o,a,s){const l=ee(t.add(t.sub(e)._unit()),s,r,a,o).point,c=i.sub(l);return i.add(c._mult(n/c.mag()))}function ne(e,i,n,r,o,a,s,l,c,u,d,h,p,m,f,g,v){const y=r?e-i:e+i;let _=y>0?1:-1,x=0;r&&(_*=-1,x=Math.PI),_<0&&(x+=Math.PI);let b=_>0?l+s:l+s+1,w=o,k=o,E=0,T=0;const S=Math.abs(y),C=[],M=[];let z=a;const I=()=>{const e=b-_;return 0===E?a:new t.pointGeometry(u.getx(e),u.gety(e))},P=()=>ie(I(),z,k,S-E+1,d,p,g,v.canonical);for(;E+T<=S;){if(b+=_,b=c)return null;if(k=w,C.push(w),m&&M.push(z||I()),w=h[b],void 0===w){z=new t.pointGeometry(u.getx(b),u.gety(b));const e=ee(z,v.canonical,d,g,p);w=e.signedDistanceFromCamera>0?h[b]=e.point:P()}else z=null;E+=T,T=k.dist(w)}f&&p&&(z=z||new t.pointGeometry(u.getx(b),u.gety(b)),h[b]=w=void 0===h[b]?w:P(),T=k.dist(w));const A=(S-E)/T,D=w.sub(k),O=D.mult(A)._add(k);n&&O._add(D._unit()._perp()._mult(n*_));const L=x+Math.atan2(w.y-k.y,w.x-k.x);return C.push(O),m&&(z=z||new t.pointGeometry(u.getx(b),u.gety(b)),M.push(function(e,i,n){const r=1-n;return new t.pointGeometry(e.x*r+i.x*n,e.y*r+i.y*n)}(M.length>0?M[M.length-1]:z,z,A))),{point:O,angle:L,path:C,tilePath:M}}const re=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function oe(t,e){for(let i=0;i[0,0,0],_=new t.pointGeometry(i.tileAnchorX,i.tileAnchorY),x=this.transform.projection.projectTilePoint(i.tileAnchorX,i.tileAnchorY,m.canonical),b=y(_),w=[x.x+b[0],x.y+b[1],x.z+b[2]],k=this.projectAndGetPerspectiveRatio(a,w[0],w[1],w[2],m),{perspectiveRatio:E}=k,T=(u?o/E:o*E)/t.ONE_EM,S=Ht(new t.pointGeometry(w[0],w[1]),s,w[2]).point,C=k.signedDistanceFromCamera>0?Jt(T,r,i.lineOffsetX*T,i.lineOffsetY*T,!1,S,_,i,n,s,{},g&&!u?y:null,u&&!!g,this.transform.projection,m):null;let M=!1,z=!1,I=!0;if(C&&!k.aboveHorizon){const i=.5*h*E+p,n=new t.pointGeometry(-100,-100),r=new t.pointGeometry(this.screenRightBoundary,this.screenBottomBoundary),o=new Zt,a=C.first,s=C.last;let u=[];for(let t=a.path.length-1;t>=1;t--)u.push(a.path[t]);for(let t=1;t{const i=y(eHt(t,l));u=t.some((t=>t.signedDistanceFromCamera<=0))?[]:t.map((t=>t.point))}let v=[];if(u.length>0){const e=u[0].clone(),i=u[0].clone();for(let t=1;t=n.x&&i.x<=r.x&&e.y>=n.y&&i.y<=r.y?[u]:i.xr.x||i.yr.y?[]:t.clipLine([u],n.x,n.y,r.x,r.y)}for(const t of v){o.reset(t,.25*i);let n=0;n=o.length<=.5*i?1:Math.ceil(o.paddedLength/m)+1;for(let t=0;t0){t.transformMat4$1(a,a,e);let l=!1;this.fogState&&o&&(l=function(e,i,n,r,o,a){const s=a.calculateFogTileMatrix(o),l=[i,n,r];return t.transformMat4(l,l,s),x(e,l,a.pitch,a._fov)}(this.fogState,i,n,r||0,o.toUnwrapped(),this.transform)>.9),s=a[2]>a[3]||l}else ae(a,a,e);return{point:new t.pointGeometry((a[0]/a[3]+1)/2*this.transform.width+se,(-a[1]/a[3]+1)/2*this.transform.height+se),perspectiveRatio:Math.min(.5+this.transform.cameraToCenterDistance/a[3]*.5,1.5),signedDistanceFromCamera:a[3],aboveHorizon:s}}isOffscreen(t,e,i,n){return i=this.screenRightBoundary||nthis.screenBottomBoundary}isInsideGrid(t,e,i,n){return i>=0&&t=0&&et.collisionGroupID===e}}return this.collisionGroups[t]}}function fe(e,i,n,r,o){const{horizontalAlign:a,verticalAlign:s}=t.getAnchorAlignment(e),l=-(a-.5)*i,c=-(s-.5)*n,u=t.evaluateVariableOffset(e,r);return new t.pointGeometry(l+u[0]*o,c+u[1]*o)}function ge(e,i,n,r,o){const a=new t.pointGeometry(e,i);return n&&a._rotate(r?o:-o),a}class ve{constructor(t,e,i,n,r){this.transform=t.clone(),this.collisionIndex=new le(this.transform,r),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=e,this.retainedQueryData={},this.collisionGroups=new me(i),this.collisionCircleArrays={},this.prevPlacement=n,n&&(n.prevPlacement=void 0),this.placedOrientations={}}getBucketParts(e,i,n,r){const o=n.getBucket(i),a=n.latestFeatureIndex;if(!o||!a||i.id!==o.layerIds[0])return;const s=o.layers[0].layout,l=n.collisionBoxArray,c=Math.pow(2,this.transform.zoom-n.tileID.overscaledZ),u=n.tileSize/t.EXTENT,d=n.tileID.toUnwrapped(),h=this.transform.calculateProjMatrix(d),p="map"===s.get("text-pitch-alignment"),m="map"===s.get("text-rotation-alignment");i.compileFilter();const f=i.dynamicFilter(),g=i.dynamicFilterNeedsFeature(),v=this.transform.calculatePixelsToTileUnitsMatrix(n),y=qt(h,n.tileID.canonical,p,m,this.transform,v);let _=null;if(p){const e=Wt(h,n.tileID.canonical,p,m,this.transform,v);_=t.multiply$1([],this.transform.labelPlaneMatrix,e)}let x=null;f&&n.latestFeatureIndex&&(x={unwrappedTileID:d,dynamicFilter:f,dynamicFilterNeedsFeature:g,featureIndex:n.latestFeatureIndex}),this.retainedQueryData[o.bucketInstanceId]=new pe(o.bucketInstanceId,a,o.sourceLayerIndex,o.index,n.tileID);const b={bucket:o,layout:s,posMatrix:h,textLabelPlaneMatrix:y,labelToScreenMatrix:_,clippingData:x,scale:c,textPixelRatio:u,holdingForFade:n.holdingForFade(),collisionBoxArray:l,partiallyEvaluatedTextSize:t.evaluateSizeForZoom(o.textSizeData,this.transform.zoom),partiallyEvaluatedIconSize:t.evaluateSizeForZoom(o.iconSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(o.sourceID)};if(r)for(const t of o.sortKeyRanges){const{sortKey:i,symbolInstanceStart:n,symbolInstanceEnd:r}=t;e.push({sortKey:i,symbolInstanceStart:n,symbolInstanceEnd:r,parameters:b})}else e.push({symbolInstanceStart:0,symbolInstanceEnd:o.symbolInstances.length,parameters:b})}attemptAnchorPlacement(t,e,i,n,r,o,a,s,l,c,u,d,h,p,m,f,g,v){const y=[d.textOffset0,d.textOffset1],_=fe(t,i,n,y,r),x=this.collisionIndex.placeCollisionBox(r,e,ge(_.x,_.y,o,a,this.transform.angle),u,s,l,c.predicate);if((!f||0!==this.collisionIndex.placeCollisionBox(p.getSymbolInstanceIconSize(v,this.transform.zoom,h),f,ge(_.x,_.y,o,a,this.transform.angle),u,s,l,c.predicate).box.length)&&x.box.length>0){let e;return this.prevPlacement&&this.prevPlacement.variableOffsets[d.crossTileID]&&this.prevPlacement.placements[d.crossTileID]&&this.prevPlacement.placements[d.crossTileID].text&&(e=this.prevPlacement.variableOffsets[d.crossTileID].anchor),this.variableOffsets[d.crossTileID]={textOffset:y,width:i,height:n,anchor:t,textScale:r,prevAnchor:e},this.markUsedJustification(p,t,d,m),p.allowVerticalPlacement&&(this.markUsedOrientation(p,m,d),this.placedOrientations[d.crossTileID]=m),{shift:_,placedGlyphBoxes:x}}}placeLayerBucketPart(e,i,n,r){const{bucket:o,layout:a,posMatrix:s,textLabelPlaneMatrix:l,labelToScreenMatrix:c,clippingData:u,textPixelRatio:d,holdingForFade:h,collisionBoxArray:p,partiallyEvaluatedTextSize:m,partiallyEvaluatedIconSize:f,collisionGroup:g}=e.parameters,v=a.get("text-optional"),y=a.get("icon-optional"),_=a.get("text-allow-overlap"),x=a.get("icon-allow-overlap"),b="map"===a.get("text-rotation-alignment"),w="map"===a.get("text-pitch-alignment"),k="none"!==a.get("icon-text-fit"),E="viewport-y"===a.get("symbol-z-order"),T=_&&(x||!o.hasIconData()||y),S=x&&(_||!o.hasTextData()||v);!o.collisionArrays&&p&&o.deserializeCollisionBoxes(p),n&&r&&o.updateCollisionDebugBuffers(this.transform.zoom,p);const C=(e,r,p)=>{if(u){const n={zoom:this.transform.zoom,pitch:this.transform.pitch};let r=null;if(u.dynamicFilterNeedsFeature){const t=this.retainedQueryData[o.bucketInstanceId];r=u.featureIndex.loadFeature({featureIndex:e.featureIndex,bucketIndex:t.bucketIndex,sourceLayerIndex:t.sourceLayerIndex,layoutVertexArrayOffset:0})}if(!(0,u.dynamicFilter)(n,r,this.retainedQueryData[o.bucketInstanceId].tileID.canonical,new t.pointGeometry(e.tileAnchorX,e.tileAnchorY),this.transform.calculateDistanceTileData(u.unwrappedTileID)))return this.placements[e.crossTileID]=new de(!1,!1,!1,!0),void(i[e.crossTileID]=!0)}if(i[e.crossTileID])return;if(h)return void(this.placements[e.crossTileID]=new de(!1,!1,!1));let E=!1,C=!1,M=!0,z=null,I={box:null,offscreen:null},P={box:null,offscreen:null},A=null,D=null,O=null,L=0,R=0,B=0;p.textFeatureIndex?L=p.textFeatureIndex:e.useRuntimeCollisionCircles&&(L=e.featureIndex),p.verticalTextFeatureIndex&&(R=p.verticalTextFeatureIndex);const F=t=>{t.tileID=this.retainedQueryData[o.bucketInstanceId].tileID,(this.transform.elevation||t.elevation)&&(t.elevation=this.transform.elevation?this.transform.elevation.getAtTileOffset(this.retainedQueryData[o.bucketInstanceId].tileID,t.tileAnchorX,t.tileAnchorY):0)},j=p.textBox;if(j){F(j);const i=i=>{let n=t.WritingMode.horizontal;if(o.allowVerticalPlacement&&!i&&this.prevPlacement){const t=this.prevPlacement.placedOrientations[e.crossTileID];t&&(this.placedOrientations[e.crossTileID]=t,n=t,this.markUsedOrientation(o,n,e))}return n},n=(i,n)=>{if(o.allowVerticalPlacement&&e.numVerticalGlyphVertices>0&&p.verticalTextBox){for(const e of o.writingModes)if(e===t.WritingMode.vertical?(I=n(),P=I):I=i(),I&&I.box&&I.box.length)break}else I=i()};if(a.get("text-variable-anchor")){let l=a.get("text-variable-anchor");if(this.prevPlacement&&this.prevPlacement.variableOffsets[e.crossTileID]){const t=this.prevPlacement.variableOffsets[e.crossTileID];l.indexOf(t.anchor)>0&&(l=l.filter((e=>e!==t.anchor)),l.unshift(t.anchor))}const c=(t,i,n)=>{const a=o.getSymbolInstanceTextSize(m,e,this.transform.zoom,r),c=(t.x2-t.x1)*a+2*t.padding,u=(t.y2-t.y1)*a+2*t.padding,h=k&&!x?i:null;h&&F(h);let p={box:[],offscreen:!1};const v=_?2*l.length:l.length;for(let i=0;i=l.length,e,r,o,n,h,m,f);if(v&&(p=v.placedGlyphBoxes,p&&p.box&&p.box.length)){E=!0,z=v.shift;break}}return p};n((()=>c(j,p.iconBox,t.WritingMode.horizontal)),(()=>{const i=p.verticalTextBox;return i&&F(i),o.allowVerticalPlacement&&!(I&&I.box&&I.box.length)&&e.numVerticalGlyphVertices>0&&i?c(i,p.verticalIconBox,t.WritingMode.vertical):{box:null,offscreen:null}})),I&&(E=I.box,M=I.offscreen);const u=i(I&&I.box);if(!E&&this.prevPlacement){const t=this.prevPlacement.variableOffsets[e.crossTileID];t&&(this.variableOffsets[e.crossTileID]=t,this.markUsedJustification(o,t.anchor,e,u))}}else{const a=(i,n)=>{const a=o.getSymbolInstanceTextSize(m,e,this.transform.zoom,r),l=this.collisionIndex.placeCollisionBox(a,i,new t.pointGeometry(0,0),_,d,s,g.predicate);return l&&l.box&&l.box.length&&(this.markUsedOrientation(o,n,e),this.placedOrientations[e.crossTileID]=n),l};n((()=>a(j,t.WritingMode.horizontal)),(()=>{const i=p.verticalTextBox;return o.allowVerticalPlacement&&e.numVerticalGlyphVertices>0&&i?(F(i),a(i,t.WritingMode.vertical)):{box:null,offscreen:null}})),i(I&&I.box&&I.box.length)}}if(A=I,E=A&&A.box&&A.box.length>0,M=A&&A.offscreen,e.useRuntimeCollisionCircles){const i=o.text.placedSymbolArray.get(e.centerJustifiedTextSymbolIndex>=0?e.centerJustifiedTextSymbolIndex:e.verticalPlacedTextSymbolIndex),r=t.evaluateSizeForFeature(o.textSizeData,m,i),u=a.get("text-padding");D=this.collisionIndex.placeCollisionCircles(_,i,o.lineVertexArray,o.glyphOffsetArray,r,s,l,c,n,w,g.predicate,e.collisionCircleDiameter*r/t.ONE_EM,u,this.retainedQueryData[o.bucketInstanceId].tileID),E=_||D.circles.length>0&&!D.collisionDetected,M=M&&D.offscreen}if(p.iconFeatureIndex&&(B=p.iconFeatureIndex),p.iconBox){const e=e=>{F(e);const i=k&&z?ge(z.x,z.y,b,w,this.transform.angle):new t.pointGeometry(0,0),n=o.getSymbolInstanceIconSize(f,this.transform.zoom,r);return this.collisionIndex.placeCollisionBox(n,e,i,x,d,s,g.predicate)};P&&P.box&&P.box.length&&p.verticalIconBox?(O=e(p.verticalIconBox),C=O.box.length>0):(O=e(p.iconBox),C=O.box.length>0),M=M&&O.offscreen}const N=v||0===e.numHorizontalGlyphVertices&&0===e.numVerticalGlyphVertices,V=y||0===e.numIconVertices;if(N||V?V?N||(C=C&&E):E=C&&E:C=E=C&&E,E&&A&&A.box&&this.collisionIndex.insertCollisionBox(A.box,a.get("text-ignore-placement"),o.bucketInstanceId,P&&P.box&&R?R:L,g.ID),C&&O&&this.collisionIndex.insertCollisionBox(O.box,a.get("icon-ignore-placement"),o.bucketInstanceId,B,g.ID),D&&(E&&this.collisionIndex.insertCollisionCircles(D.circles,a.get("text-ignore-placement"),o.bucketInstanceId,L,g.ID),n)){const t=o.bucketInstanceId;let e=this.collisionCircleArrays[t];void 0===e&&(e=this.collisionCircleArrays[t]=new he);for(let t=0;t=0;--e){const i=t[e];C(o.symbolInstances.get(i),i,o.collisionArrays[i])}}else for(let t=e.symbolInstanceStart;t=0&&(e.text.placedSymbolArray.get(t).crossTileID=o>=0&&t!==o?0:n.crossTileID)}markUsedOrientation(e,i,n){const r=i===t.WritingMode.horizontal||i===t.WritingMode.horizontalOnly?i:0,o=i===t.WritingMode.vertical?i:0,a=[n.leftJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.rightJustifiedTextSymbolIndex];for(const t of a)e.text.placedSymbolArray.get(t).placedOrientation=r;n.verticalPlacedTextSymbolIndex&&(e.text.placedSymbolArray.get(n.verticalPlacedTextSymbolIndex).placedOrientation=o)}commit(t){this.commitTime=t,this.zoomAtLastRecencyCheck=this.transform.zoom;const e=this.prevPlacement;let i=!1;this.prevZoomAdjustment=e?e.zoomAdjustment(this.transform.zoom):0;const n=e?e.symbolFadeChange(t):1,r=e?e.opacities:{},o=e?e.variableOffsets:{},a=e?e.placedOrientations:{};for(const t in this.placements){const e=this.placements[t],o=r[t];o?(this.opacities[t]=new ue(o,n,e.text,e.icon,null,e.clipped),i=i||e.text!==o.text.placed||e.icon!==o.icon.placed):(this.opacities[t]=new ue(null,n,e.text,e.icon,e.skipFade,e.clipped),i=i||e.text||e.icon)}for(const t in r){const e=r[t];if(!this.opacities[t]){const r=new ue(e,n,!1,!1);r.isHidden()||(this.opacities[t]=r,i=i||e.text.placed||e.icon.placed)}}for(const t in o)this.variableOffsets[t]||!this.opacities[t]||this.opacities[t].isHidden()||(this.variableOffsets[t]=o[t]);for(const t in a)this.placedOrientations[t]||!this.opacities[t]||this.opacities[t].isHidden()||(this.placedOrientations[t]=a[t]);i?this.lastPlacementChangeTime=t:"number"!=typeof this.lastPlacementChangeTime&&(this.lastPlacementChangeTime=e?e.lastPlacementChangeTime:t)}updateLayerOpacities(t,e){const i={};for(const n of e){const e=n.getBucket(t);e&&n.latestFeatureIndex&&t.id===e.layerIds[0]&&this.updateBucketOpacities(e,i,n.collisionBoxArray)}}updateBucketOpacities(e,i,n){e.hasTextData()&&e.text.opacityVertexArray.clear(),e.hasIconData()&&e.icon.opacityVertexArray.clear(),e.hasIconCollisionBoxData()&&e.iconCollisionBox.collisionVertexArray.clear(),e.hasTextCollisionBoxData()&&e.textCollisionBox.collisionVertexArray.clear();const r=e.layers[0].layout,o=!!e.layers[0].dynamicFilter(),a=new ue(null,0,!1,!1,!0),s=r.get("text-allow-overlap"),l=r.get("icon-allow-overlap"),c=r.get("text-variable-anchor"),u="map"===r.get("text-rotation-alignment"),d="map"===r.get("text-pitch-alignment"),h="none"!==r.get("icon-text-fit"),p=new ue(null,0,s&&(l||!e.hasIconData()||r.get("icon-optional")),l&&(s||!e.hasTextData()||r.get("text-optional")),!0);!e.collisionArrays&&n&&(e.hasIconCollisionBoxData()||e.hasTextCollisionBoxData())&&e.deserializeCollisionBoxes(n);const m=(t,e,i)=>{for(let n=0;n0||l>0,_=r.numIconVertices>0,x=this.placedOrientations[r.crossTileID],b=x===t.WritingMode.vertical,w=x===t.WritingMode.horizontal||x===t.WritingMode.horizontalOnly;if(!y&&!_||v.isHidden()||f++,y){const t=Se(v.text);m(e.text,s,b?Ce:t),m(e.text,l,w?Ce:t);const i=v.text.isHidden();[r.rightJustifiedTextSymbolIndex,r.centerJustifiedTextSymbolIndex,r.leftJustifiedTextSymbolIndex].forEach((t=>{t>=0&&(e.text.placedSymbolArray.get(t).hidden=i||b?1:0)})),r.verticalPlacedTextSymbolIndex>=0&&(e.text.placedSymbolArray.get(r.verticalPlacedTextSymbolIndex).hidden=i||w?1:0);const n=this.variableOffsets[r.crossTileID];n&&this.markUsedJustification(e,n.anchor,r,x);const o=this.placedOrientations[r.crossTileID];o&&(this.markUsedJustification(e,"left",r,o),this.markUsedOrientation(e,o,r))}if(_){const t=Se(v.icon);r.placedIconSymbolIndex>=0&&(m(e.icon,r.numIconVertices,b?Ce:t),e.icon.placedSymbolArray.get(r.placedIconSymbolIndex).hidden=v.icon.isHidden()),r.verticalPlacedIconSymbolIndex>=0&&(m(e.icon,r.numVerticalIconVertices,w?Ce:t),e.icon.placedSymbolArray.get(r.verticalPlacedIconSymbolIndex).hidden=v.icon.isHidden())}if(e.hasIconCollisionBoxData()||e.hasTextCollisionBoxData()){const i=e.collisionArrays[n];if(i){let n=new t.pointGeometry(0,0),r=!0;if(i.textBox||i.verticalTextBox){if(c){const t=this.variableOffsets[g];t?(n=fe(t.anchor,t.width,t.height,t.textOffset,t.textScale),u&&n._rotate(d?this.transform.angle:-this.transform.angle)):r=!1}o&&(r=!v.clipped),i.textBox&&ye(e.textCollisionBox.collisionVertexArray,v.text.placed,!r||b,n.x,n.y),i.verticalTextBox&&ye(e.textCollisionBox.collisionVertexArray,v.text.placed,!r||w,n.x,n.y)}const a=r&&Boolean(!w&&i.verticalIconBox);i.iconBox&&ye(e.iconCollisionBox.collisionVertexArray,v.icon.placed,a,h?n.x:0,h?n.y:0),i.verticalIconBox&&ye(e.iconCollisionBox.collisionVertexArray,v.icon.placed,!a,h?n.x:0,h?n.y:0)}}}if(e.fullyClipped=0===f,e.sortFeatures(this.transform.angle),this.retainedQueryData[e.bucketInstanceId]&&(this.retainedQueryData[e.bucketInstanceId].featureSortOrder=e.featureSortOrder),e.hasTextData()&&e.text.opacityVertexBuffer&&e.text.opacityVertexBuffer.updateData(e.text.opacityVertexArray),e.hasIconData()&&e.icon.opacityVertexBuffer&&e.icon.opacityVertexBuffer.updateData(e.icon.opacityVertexArray),e.hasIconCollisionBoxData()&&e.iconCollisionBox.collisionVertexBuffer&&e.iconCollisionBox.collisionVertexBuffer.updateData(e.iconCollisionBox.collisionVertexArray),e.hasTextCollisionBoxData()&&e.textCollisionBox.collisionVertexBuffer&&e.textCollisionBox.collisionVertexBuffer.updateData(e.textCollisionBox.collisionVertexArray),e.bucketInstanceId in this.collisionCircleArrays){const t=this.collisionCircleArrays[e.bucketInstanceId];e.placementInvProjMatrix=t.invProjMatrix,e.placementViewportMatrix=t.viewportMatrix,e.collisionCircleArray=t.circles,delete this.collisionCircleArrays[e.bucketInstanceId]}}symbolFadeChange(t){return 0===this.fadeDuration?1:(t-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(t){return Math.max(0,(this.transform.zoom-t)/1.5)}hasTransitions(t){return this.stale||t-this.lastPlacementChangeTimet}setStale(){this.stale=!0}}function ye(t,e,i,n,r){t.emplaceBack(e?1:0,i?1:0,n||0,r||0),t.emplaceBack(e?1:0,i?1:0,n||0,r||0),t.emplaceBack(e?1:0,i?1:0,n||0,r||0),t.emplaceBack(e?1:0,i?1:0,n||0,r||0)}const _e=Math.pow(2,25),xe=Math.pow(2,24),be=Math.pow(2,17),we=Math.pow(2,16),ke=Math.pow(2,9),Ee=Math.pow(2,8),Te=Math.pow(2,1);function Se(t){if(0===t.opacity&&!t.placed)return 0;if(1===t.opacity&&t.placed)return 4294967295;const e=t.placed?1:0,i=Math.floor(127*t.opacity);return i*_e+e*xe+i*be+e*we+i*ke+e*Ee+i*Te+e}const Ce=0;class Me{constructor(t){this._sortAcrossTiles="viewport-y"!==t.layout.get("symbol-z-order")&&void 0!==t.layout.get("symbol-sort-key").constantOr(1),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(t,e,i,n,r){const o=this._bucketParts;for(;this._currentTileIndext.sortKey-e.sortKey)));this._currentPartIndex{const e=t.exported.now()-r;return!this._forceFullPlacement&&e>2};for(;this._currentPlacementIndex>=0;){const t=i[e[this._currentPlacementIndex]],r=this.placement.collisionIndex.transform.zoom;if("symbol"===t.type&&(!t.minzoom||t.minzoom<=r)&&(!t.maxzoom||t.maxzoom>r)){if(this._inProgressLayer||(this._inProgressLayer=new Me(t)),this._inProgressLayer.continuePlacement(n[t.source],this.placement,this._showCollisionBoxes,t,o))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(t){return this.placement.commit(t),this.placement}}const Ie=512/t.EXTENT/2;class Pe{constructor(t,e,i){this.tileID=t,this.indexedSymbolInstances={},this.bucketInstanceId=i;for(let i=0;it.overscaledZ)for(const i in r){const o=r[i];o.tileID.isChildOf(t)&&o.findMatches(e.symbolInstances,t,n)}else{const o=r[t.scaledTo(Number(i)).key];o&&o.findMatches(e.symbolInstances,t,n)}}for(let t=0;t{e[t]=!0}));for(const t in this.layerIndexes)e[t]||delete this.layerIndexes[t]}}const Le=(e,i)=>t.emitValidationErrors(e,i&&i.filter((t=>"source.canvas"!==t.identifier))),Re=t.pick(Lt,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData","setTerrain","setFog","setProjection"]),Be=t.pick(Lt,["setCenter","setZoom","setBearing","setPitch"]),Fe=function(){const e={},i=t.spec.$version;for(const n in t.spec.$root){const r=t.spec.$root[n];if(r.required){let t=null;t="version"===n?i:"array"===r.type?[]:{},null!=t&&(e[n]=t)}}return e}(),je={fill:!0,line:!0,background:!0,hillshade:!0,raster:!0};class Ne extends t.Evented{constructor(e,i={}){super(),this.map=e,this.dispatcher=new T(At(),this),this.imageManager=new p,this.imageManager.setEventedParent(this),this.glyphManager=new t.GlyphManager(e._requestManager,i.localFontFamily?t.LocalGlyphMode.all:i.localIdeographFontFamily?t.LocalGlyphMode.ideographs:t.LocalGlyphMode.none,i.localFontFamily||i.localIdeographFontFamily),this.lineAtlas=new t.LineAtlas(256,512),this.crossTileSymbolIndex=new Oe,this._layers={},this._num3DLayers=0,this._numSymbolLayers=0,this._numCircleLayers=0,this._serializedLayers={},this._sourceCaches={},this._otherSourceCaches={},this._symbolSourceCaches={},this.zoomHistory=new t.ZoomHistory,this._loaded=!1,this._availableImages=[],this._order=[],this._drapedFirstOrder=[],this._markersNeedUpdate=!1,this._resetUpdates(),this.dispatcher.broadcast("setReferrer",t.getReferrer());const n=this;this._rtlTextPluginCallback=Ne.registerForPluginStateChange((e=>{n.dispatcher.broadcast("syncRTLPluginState",{pluginStatus:e.pluginStatus,pluginURL:e.pluginURL},((e,i)=>{if(t.triggerPluginCompletionEvent(e),i&&i.every((t=>t)))for(const t in n._sourceCaches){const e=n._sourceCaches[t],i=e.getSource().type;"vector"!==i&&"geojson"!==i||e.reload()}}))})),this.on("data",(t=>{if("source"!==t.dataType||"metadata"!==t.sourceDataType)return;const e=this.getSource(t.sourceId);if(e&&e.vectorLayerIds)for(const t in this._layers){const i=this._layers[t];i.source===e.id&&this._validateLayer(i)}}))}loadURL(e,i={}){this.fire(new t.Event("dataloading",{dataType:"style"}));const n="boolean"==typeof i.validate?i.validate:!t.isMapboxURL(e);e=this.map._requestManager.normalizeStyleURL(e,i.accessToken);const r=this.map._requestManager.transformRequest(e,t.ResourceType.Style);this._request=t.getJSON(r,((e,i)=>{this._request=null,e?this.fire(new t.ErrorEvent(e)):i&&this._load(i,n)}))}loadJSON(e,i={}){this.fire(new t.Event("dataloading",{dataType:"style"})),this._request=t.exported.frame((()=>{this._request=null,this._load(e,!1!==i.validate)}))}loadEmpty(){this.fire(new t.Event("dataloading",{dataType:"style"})),this._load(Fe,!1)}_updateLayerCount(t,e){const i=e?1:-1;t.is3D()&&(this._num3DLayers+=i),"circle"===t.type&&(this._numCircleLayers+=i),"symbol"===t.type&&(this._numSymbolLayers+=i)}_load(e,i){if(i&&Le(this,t.validateStyle(e)))return;this._loaded=!0,this.stylesheet=e,this.updateProjection();for(const t in e.sources)this.addSource(t,e.sources[t],{validate:!1});this._changed=!1,e.sprite?this._loadSprite(e.sprite):(this.imageManager.setLoaded(!0),this.dispatcher.broadcast("spriteLoaded",!0)),this.glyphManager.setURL(e.glyphs);const n=Ot(this.stylesheet.layers);this._order=n.map((t=>t.id)),this._layers={},this._serializedLayers={};for(let e of n)e=t.createStyleLayer(e),e.setEventedParent(this,{layer:{id:e.id}}),this._layers[e.id]=e,this._serializedLayers[e.id]=e.serialize(),this._updateLayerCount(e,!0);this.dispatcher.broadcast("setLayers",this._serializeLayers(this._order)),this.light=new g(this.stylesheet.light),this.stylesheet.terrain&&!this.terrainSetForDrapingOnly()&&this._createTerrain(this.stylesheet.terrain,1),this.stylesheet.fog&&this._createFog(this.stylesheet.fog),this._updateDrapeFirstLayers(),this.fire(new t.Event("data",{dataType:"style"})),this.fire(new t.Event("style.load"))}terrainSetForDrapingOnly(){return this.terrain&&0===this.terrain.drapeRenderMode}setProjection(t){t?this.stylesheet.projection=t:delete this.stylesheet.projection,this.updateProjection()}updateProjection(){const t=this.map.transform.projection,e=this.map.transform.setProjection(this.map._runtimeProjection||(this.stylesheet?this.stylesheet.projection:void 0)),i=this.map.transform.projection;if(this._loaded&&(i.requiresDraping?this.getTerrain()||this.stylesheet.terrain||this.setTerrainForDraping():this.terrainSetForDrapingOnly()&&this.setTerrain(null)),this.dispatcher.broadcast("setProjection",this.map.transform.projectionOptions),e){if(i.isReprojectedInTileSpace||t.isReprojectedInTileSpace){this.map.painter.clearBackgroundTiles();for(const t in this._sourceCaches)this._sourceCaches[t].clearTiles()}else this._forceSymbolLayerUpdate();this.map._update(!0)}}_loadSprite(e){this._spriteRequest=function(e,i,n){let r,o,a;const s=t.exported.devicePixelRatio>1?"@2x":"";let l=t.getJSON(i.transformRequest(i.normalizeSpriteURL(e,s,".json"),t.ResourceType.SpriteJSON),((t,e)=>{l=null,a||(a=t,r=e,u())})),c=t.getImage(i.transformRequest(i.normalizeSpriteURL(e,s,".png"),t.ResourceType.SpriteImage),((t,e)=>{c=null,a||(a=t,o=e,u())}));function u(){if(a)n(a);else if(r&&o){const e=t.exported.getImageData(o),i={};for(const n in r){const{width:o,height:a,x:s,y:l,sdf:c,pixelRatio:u,stretchX:d,stretchY:h,content:p}=r[n],m=new t.RGBAImage({width:o,height:a});t.RGBAImage.copy(e,m,{x:s,y:l},{x:0,y:0},{width:o,height:a}),i[n]={data:m,pixelRatio:u,sdf:c,stretchX:d,stretchY:h,content:p}}n(null,i)}}return{cancel(){l&&(l.cancel(),l=null),c&&(c.cancel(),c=null)}}}(e,this.map._requestManager,((e,i)=>{if(this._spriteRequest=null,e)this.fire(new t.ErrorEvent(e));else if(i)for(const t in i)this.imageManager.addImage(t,i[t]);this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),this.dispatcher.broadcast("setImages",this._availableImages),this.dispatcher.broadcast("spriteLoaded",!0),this.fire(new t.Event("data",{dataType:"style"}))}))}_validateLayer(e){const i=this.getSource(e.source);if(!i)return;const n=e.sourceLayer;n&&("geojson"===i.type||i.vectorLayerIds&&-1===i.vectorLayerIds.indexOf(n))&&this.fire(new t.ErrorEvent(new Error(`Source layer "${n}" does not exist on source "${i.id}" as specified by style layer "${e.id}"`)))}loaded(){if(!this._loaded)return!1;if(Object.keys(this._updatedSources).length)return!1;for(const t in this._sourceCaches)if(!this._sourceCaches[t].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeLayers(t){const e=[];for(const i of t){const t=this._layers[i];"custom"!==t.type&&e.push(t.serialize())}return e}hasTransitions(){if(this.light&&this.light.hasTransition())return!0;if(this.fog&&this.fog.hasTransition())return!0;for(const t in this._sourceCaches)if(this._sourceCaches[t].hasTransition())return!0;for(const t in this._layers)if(this._layers[t].hasTransition())return!0;return!1}get order(){return this.map._optimizeForTerrain&&this.terrain?this._drapedFirstOrder:this._order}isLayerDraped(t){return!!this.terrain&&je[t.type]}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading")}update(e){if(!this._loaded)return;const i=this._changed;if(this._changed){const t=Object.keys(this._updatedLayers),i=Object.keys(this._removedLayers);(t.length||i.length)&&this._updateWorkerLayers(t,i);for(const t in this._updatedSources){const e=this._updatedSources[t];"reload"===e?this._reloadSource(t):"clear"===e&&this._clearSource(t)}this._updateTilesForChangedImages();for(const t in this._updatedPaintProps)this._layers[t].updateTransitions(e);this.light.updateTransitions(e),this.fog&&this.fog.updateTransitions(e),this._resetUpdates()}const n={};for(const t in this._sourceCaches){const e=this._sourceCaches[t];n[t]=e.used,e.used=!1}for(const t of this._order){const i=this._layers[t];if(i.recalculate(e,this._availableImages),!i.isHidden(e.zoom)){const t=this._getLayerSourceCache(i);t&&(t.used=!0)}const n=this.map.painter;if(n){const t=i.getProgramIds();if(!t)continue;const r=i.getProgramConfiguration(e.zoom);for(const e of t)n.useProgram(e,r)}}for(const e in n){const i=this._sourceCaches[e];n[e]!==i.used&&i.getSource().fire(new t.Event("data",{sourceDataType:"visibility",dataType:"source",sourceId:i.getSource().id}))}this.light.recalculate(e),this.terrain&&this.terrain.recalculate(e),this.fog&&this.fog.recalculate(e),this.z=e.zoom,this._markersNeedUpdate&&(this._updateMarkersOpacity(),this._markersNeedUpdate=!1),i&&this.fire(new t.Event("data",{dataType:"style"}))}_updateTilesForChangedImages(){const t=Object.keys(this._changedImages);if(t.length){for(const e in this._sourceCaches)this._sourceCaches[e].reloadTilesForDependencies(["icons","patterns"],t);this._changedImages={}}}_updateWorkerLayers(t,e){this.dispatcher.broadcast("updateLayers",{layers:this._serializeLayers(t),removedIds:e})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={}}setState(e){if(this._checkLoaded(),Le(this,t.validateStyle(e)))return!1;(e=t.clone$1(e)).layers=Ot(e.layers);const i=function(t,e){if(!t)return[{command:Lt.setStyle,args:[e]}];let i=[];try{if(!o(t.version,e.version))return[{command:Lt.setStyle,args:[e]}];o(t.center,e.center)||i.push({command:Lt.setCenter,args:[e.center]}),o(t.zoom,e.zoom)||i.push({command:Lt.setZoom,args:[e.zoom]}),o(t.bearing,e.bearing)||i.push({command:Lt.setBearing,args:[e.bearing]}),o(t.pitch,e.pitch)||i.push({command:Lt.setPitch,args:[e.pitch]}),o(t.sprite,e.sprite)||i.push({command:Lt.setSprite,args:[e.sprite]}),o(t.glyphs,e.glyphs)||i.push({command:Lt.setGlyphs,args:[e.glyphs]}),o(t.transition,e.transition)||i.push({command:Lt.setTransition,args:[e.transition]}),o(t.light,e.light)||i.push({command:Lt.setLight,args:[e.light]}),o(t.fog,e.fog)||i.push({command:Lt.setFog,args:[e.fog]}),o(t.projection,e.projection)||i.push({command:Lt.setProjection,args:[e.projection]});const n={},r=[];!function(t,e,i,n){let r;for(r in e=e||{},t=t||{})t.hasOwnProperty(r)&&(e.hasOwnProperty(r)||Bt(r,i,n));for(r in e)e.hasOwnProperty(r)&&(t.hasOwnProperty(r)?o(t[r],e[r])||("geojson"===t[r].type&&"geojson"===e[r].type&&jt(t,e,r)?i.push({command:Lt.setGeoJSONSourceData,args:[r,e[r].data]}):Ft(r,e,i,n)):Rt(r,e,i))}(t.sources,e.sources,r,n);const a=[];t.layers&&t.layers.forEach((t=>{n[t.source]?i.push({command:Lt.removeLayer,args:[t.id]}):a.push(t)}));let s=t.terrain;s&&n[s.source]&&(i.push({command:Lt.setTerrain,args:[void 0]}),s=void 0),i=i.concat(r),o(s,e.terrain)||i.push({command:Lt.setTerrain,args:[e.terrain]}),function(t,e,i){e=e||[];const n=(t=t||[]).map(Vt),r=e.map(Vt),a=t.reduce(Ut,{}),s=e.reduce(Ut,{}),l=n.slice(),c=Object.create(null);let u,d,h,p,m,f,g;for(u=0,d=0;u!(t.command in Be)));if(0===i.length)return!1;const n=i.filter((t=>!(t.command in Re)));if(n.length>0)throw new Error(`Unimplemented: ${n.map((t=>t.command)).join(", ")}.`);return i.forEach((t=>{"setTransition"!==t.command&&this[t.command].apply(this,t.args)})),this.stylesheet=e,this.updateProjection(),!0}addImage(e,i){if(this.getImage(e))return this.fire(new t.ErrorEvent(new Error("An image with this name already exists.")));this.imageManager.addImage(e,i),this._afterImageUpdated(e)}updateImage(t,e){this.imageManager.updateImage(t,e)}getImage(t){return this.imageManager.getImage(t)}removeImage(e){if(!this.getImage(e))return this.fire(new t.ErrorEvent(new Error("No image with this name exists.")));this.imageManager.removeImage(e),this._afterImageUpdated(e)}_afterImageUpdated(e){this._availableImages=this.imageManager.listImages(),this._changedImages[e]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new t.Event("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this._availableImages.slice()}addSource(e,i,n={}){if(this._checkLoaded(),void 0!==this.getSource(e))throw new Error("There is already a source with this ID");if(!i.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(i).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(i.type)>=0&&this._validate(t.validateStyle.source,`sources.${e}`,i,null,n))return;this.map&&this.map._collectResourceTiming&&(i.collectResourceTiming=!0);const r=kt(e,i,this.dispatcher,this);r.setEventedParent(this,(()=>({isSourceLoaded:this.loaded(),source:r.serialize(),sourceId:e})));const o=i=>{const n=(i?"symbol:":"other:")+e,o=this._sourceCaches[n]=new t.SourceCache(n,r,i);(i?this._symbolSourceCaches:this._otherSourceCaches)[e]=o,o.style=this,o.onAdd(this.map)};o(!1),"vector"!==i.type&&"geojson"!==i.type||o(!0),r.onAdd&&r.onAdd(this.map),this._changed=!0}removeSource(e){this._checkLoaded();const i=this.getSource(e);if(void 0===i)throw new Error("There is no source with this ID");for(const i in this._layers)if(this._layers[i].source===e)return this.fire(new t.ErrorEvent(new Error(`Source "${e}" cannot be removed while layer "${i}" is using it.`)));if(this.terrain&&this.terrain.get().source===e)return this.fire(new t.ErrorEvent(new Error(`Source "${e}" cannot be removed while terrain is using it.`)));const n=this._getSourceCaches(e);for(const e of n)delete this._sourceCaches[e.id],delete this._updatedSources[e.id],e.fire(new t.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:e.getSource().id})),e.setEventedParent(null),e.clearTiles();delete this._otherSourceCaches[e],delete this._symbolSourceCaches[e],i.setEventedParent(null),i.onRemove&&i.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(t,e){this._checkLoaded(),this.getSource(t).setData(e),this._changed=!0}getSource(t){const e=this._getSourceCache(t);return e&&e.getSource()}addLayer(e,i,n={}){this._checkLoaded();const r=e.id;if(this.getLayer(r))return void this.fire(new t.ErrorEvent(new Error(`Layer with id "${r}" already exists on this map`)));let o;if("custom"===e.type){if(Le(this,t.validateCustomStyleLayer(e)))return;o=t.createStyleLayer(e)}else{if("object"==typeof e.source&&(this.addSource(r,e.source),e=t.clone$1(e),e=t.extend(e,{source:r})),this._validate(t.validateStyle.layer,`layers.${r}`,e,{arrayIndex:-1},n))return;o=t.createStyleLayer(e),this._validateLayer(o),o.setEventedParent(this,{layer:{id:r}}),this._serializedLayers[o.id]=o.serialize(),this._updateLayerCount(o,!0)}const a=i?this._order.indexOf(i):this._order.length;if(i&&-1===a)return void this.fire(new t.ErrorEvent(new Error(`Layer with id "${i}" does not exist on this map.`)));this._order.splice(a,0,r),this._layerOrderChanged=!0,this._layers[r]=o;const s=this._getLayerSourceCache(o);if(this._removedLayers[r]&&o.source&&s&&"custom"!==o.type){const t=this._removedLayers[r];delete this._removedLayers[r],t.type!==o.type?this._updatedSources[o.source]="clear":(this._updatedSources[o.source]="reload",s.pause())}this._updateLayer(o),o.onAdd&&o.onAdd(this.map),this._updateDrapeFirstLayers()}moveLayer(e,i){if(this._checkLoaded(),this._changed=!0,!this._layers[e])return void this.fire(new t.ErrorEvent(new Error(`The layer '${e}' does not exist in the map's style and cannot be moved.`)));if(e===i)return;const n=this._order.indexOf(e);this._order.splice(n,1);const r=i?this._order.indexOf(i):this._order.length;i&&-1===r?this.fire(new t.ErrorEvent(new Error(`Layer with id "${i}" does not exist on this map.`))):(this._order.splice(r,0,e),this._layerOrderChanged=!0,this._updateDrapeFirstLayers())}removeLayer(e){this._checkLoaded();const i=this._layers[e];if(!i)return void this.fire(new t.ErrorEvent(new Error(`The layer '${e}' does not exist in the map's style and cannot be removed.`)));i.setEventedParent(null),this._updateLayerCount(i,!1);const n=this._order.indexOf(e);this._order.splice(n,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[e]=i,delete this._layers[e],delete this._serializedLayers[e],delete this._updatedLayers[e],delete this._updatedPaintProps[e],i.onRemove&&i.onRemove(this.map),this._updateDrapeFirstLayers()}getLayer(t){return this._layers[t]}hasLayer(t){return t in this._layers}hasLayerType(t){for(const e in this._layers)if(this._layers[e].type===t)return!0;return!1}setLayerZoomRange(e,i,n){this._checkLoaded();const r=this.getLayer(e);r?r.minzoom===i&&r.maxzoom===n||(null!=i&&(r.minzoom=i),null!=n&&(r.maxzoom=n),this._updateLayer(r)):this.fire(new t.ErrorEvent(new Error(`The layer '${e}' does not exist in the map's style and cannot have zoom extent.`)))}setFilter(e,i,n={}){this._checkLoaded();const r=this.getLayer(e);if(r){if(!o(r.filter,i))return null==i?(r.filter=void 0,void this._updateLayer(r)):void(this._validate(t.validateStyle.filter,`layers.${r.id}.filter`,i,{layerType:r.type},n)||(r.filter=t.clone$1(i),this._updateLayer(r)))}else this.fire(new t.ErrorEvent(new Error(`The layer '${e}' does not exist in the map's style and cannot be filtered.`)))}getFilter(e){return t.clone$1(this.getLayer(e).filter)}setLayoutProperty(e,i,n,r={}){this._checkLoaded();const a=this.getLayer(e);a?o(a.getLayoutProperty(i),n)||(a.setLayoutProperty(i,n,r),this._updateLayer(a)):this.fire(new t.ErrorEvent(new Error(`The layer '${e}' does not exist in the map's style and cannot be styled.`)))}getLayoutProperty(e,i){const n=this.getLayer(e);if(n)return n.getLayoutProperty(i);this.fire(new t.ErrorEvent(new Error(`The layer '${e}' does not exist in the map's style.`)))}setPaintProperty(e,i,n,r={}){this._checkLoaded();const a=this.getLayer(e);a?o(a.getPaintProperty(i),n)||(a.setPaintProperty(i,n,r)&&this._updateLayer(a),this._changed=!0,this._updatedPaintProps[e]=!0):this.fire(new t.ErrorEvent(new Error(`The layer '${e}' does not exist in the map's style and cannot be styled.`)))}getPaintProperty(t,e){return this.getLayer(t).getPaintProperty(e)}setFeatureState(e,i){this._checkLoaded();const n=e.source,r=e.sourceLayer,o=this.getSource(n);if(void 0===o)return void this.fire(new t.ErrorEvent(new Error(`The source '${n}' does not exist in the map's style.`)));const a=o.type;if("geojson"===a&&r)return void this.fire(new t.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter.")));if("vector"===a&&!r)return void this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));void 0===e.id&&this.fire(new t.ErrorEvent(new Error("The feature id parameter must be provided.")));const s=this._getSourceCaches(n);for(const t of s)t.setFeatureState(r,e.id,i)}removeFeatureState(e,i){this._checkLoaded();const n=e.source,r=this.getSource(n);if(void 0===r)return void this.fire(new t.ErrorEvent(new Error(`The source '${n}' does not exist in the map's style.`)));const o=r.type,a="vector"===o?e.sourceLayer:void 0;if("vector"===o&&!a)return void this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));if(i&&"string"!=typeof e.id&&"number"!=typeof e.id)return void this.fire(new t.ErrorEvent(new Error("A feature id is required to remove its specific state property.")));const s=this._getSourceCaches(n);for(const t of s)t.removeFeatureState(a,e.id,i)}getFeatureState(e){this._checkLoaded();const i=e.source,n=e.sourceLayer,r=this.getSource(i);if(void 0!==r){if("vector"!==r.type||n)return void 0===e.id&&this.fire(new t.ErrorEvent(new Error("The feature id parameter must be provided."))),this._getSourceCaches(i)[0].getFeatureState(n,e.id);this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new t.ErrorEvent(new Error(`The source '${i}' does not exist in the map's style.`)))}getTransition(){return t.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){const e={};for(const t in this._sourceCaches){const i=this._sourceCaches[t].getSource();e[i.id]||(e[i.id]=i.serialize())}return t.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,terrain:this.stylesheet.terrain,fog:this.stylesheet.fog,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,projection:this.stylesheet.projection,sources:e,layers:this._serializeLayers(this._order)},(t=>void 0!==t))}_updateLayer(t){this._updatedLayers[t.id]=!0;const e=this._getLayerSourceCache(t);t.source&&!this._updatedSources[t.source]&&e&&"raster"!==e.getSource().type&&(this._updatedSources[t.source]="reload",e.pause()),this._changed=!0,t.invalidateCompiledFilter()}_flattenAndSortRenderedFeatures(t){const e=t=>"fill-extrusion"===this._layers[t].type,i={},n=[];for(let r=this._order.length-1;r>=0;r--){const o=this._order[r];if(e(o)){i[o]=r;for(const e of t){const t=e[o];if(t)for(const e of t)n.push(e)}}}n.sort(((t,e)=>e.intersectionZ-t.intersectionZ));const r=[];for(let o=this._order.length-1;o>=0;o--){const a=this._order[o];if(e(a))for(let t=n.length-1;t>=0;t--){const e=n[t].feature;if(i[e.layer.id]{const e=this.getLayer(t);return e&&e.is3D()})):this.has3DLayers(),s=mt.createFromScreenPoints(e,n);for(const t in this._sourceCaches){const e=this._sourceCaches[t].getSource().id;i.layers&&!r[e]||o.push(Tt(this._sourceCaches[t],this._layers,this._serializedLayers,s,i,n,a,!!this.map._showQueryGeometry))}return this.placement&&o.push(function(t,e,i,n,r,o,a){const s={},l=o.queryRenderedSymbols(n),c=[];for(const t of Object.keys(l).map(Number))c.push(a[t]);c.sort(Ct);for(const i of c){const n=i.featureIndex.lookupSymbolFeatures(l[i.bucketInstanceId],e,i.bucketIndex,i.sourceLayerIndex,r.filter,r.layers,r.availableImages,t);for(const t in n){const e=s[t]=s[t]||[],r=n[t];r.sort(((t,e)=>{const n=i.featureSortOrder;if(n){const i=n.indexOf(t.featureIndex);return n.indexOf(e.featureIndex)-i}return e.featureIndex-t.featureIndex}));for(const t of r)e.push(t)}}for(const e in s)s[e].forEach((n=>{const r=n.feature,o=i(t[e]).getFeatureState(r.layer["source-layer"],r.id);r.source=r.layer.source,r.layer["source-layer"]&&(r.sourceLayer=r.layer["source-layer"]),r.state=o}));return s}(this._layers,this._serializedLayers,this._getLayerSourceCache.bind(this),s.screenGeometry,i,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(o)}querySourceFeatures(e,i){i&&i.filter&&this._validate(t.validateStyle.filter,"querySourceFeatures.filter",i.filter,null,i);const n=this._getSourceCaches(e);let r=[];for(const t of n)r=r.concat(St(t,i));return r}addSourceType(t,e,i){return Ne.getSourceType(t)?i(new Error(`A source type called "${t}" already exists.`)):(Ne.setSourceType(t,e),e.workerSourceURL?void this.dispatcher.broadcast("loadWorkerSource",{name:t,url:e.workerSourceURL},i):i(null,null))}getLight(){return this.light.getLight()}setLight(e,i={}){this._checkLoaded();const n=this.light.getLight();let r=!1;for(const t in e)if(!o(e[t],n[t])){r=!0;break}if(!r)return;const a={now:t.exported.now(),transition:t.extend({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(e,i),this.light.updateTransitions(a)}getTerrain(){return this.terrain&&1===this.terrain.drapeRenderMode?this.terrain.get():null}setTerrainForDraping(){this.setTerrain({source:"",exaggeration:0},0)}setTerrain(e,i=1){if(this._checkLoaded(),!e)return delete this.terrain,delete this.stylesheet.terrain,this.dispatcher.broadcast("enableTerrain",!1),this._force3DLayerUpdate(),void(this._markersNeedUpdate=!0);if(1===i){if("object"==typeof e.source){const i="terrain-dem-src";this.addSource(i,e.source),e=t.clone$1(e),e=t.extend(e,{source:i})}if(this._validate(t.validateStyle.terrain,"terrain",e))return}if(!this.terrain||this.terrain&&i!==this.terrain.drapeRenderMode)this._createTerrain(e,i);else{const i=this.terrain,n=i.get();for(const r in e)if(!o(e[r],n[r])){i.set(e),this.stylesheet.terrain=e;const n={now:t.exported.now(),transition:t.extend({duration:0},this.stylesheet.transition)};i.updateTransitions(n);break}}this._updateDrapeFirstLayers(),this._markersNeedUpdate=!0}_createFog(e){const i=this.fog=new E(e,this.map.transform);this.stylesheet.fog=e;const n={now:t.exported.now(),transition:t.extend({duration:0},this.stylesheet.transition)};i.updateTransitions(n)}_updateMarkersOpacity(){0!==this.map._markers.length&&this.map._requestDomTask((()=>{for(const t of this.map._markers)t._evaluateOpacity()}))}getFog(){return this.fog?this.fog.get():null}setFog(e){if(this._checkLoaded(),!e)return delete this.fog,delete this.stylesheet.fog,void(this._markersNeedUpdate=!0);if(this.fog){const i=this.fog,n=i.get();for(const r in e)if(!o(e[r],n[r])){i.set(e),this.stylesheet.fog=e;const n={now:t.exported.now(),transition:t.extend({duration:0},this.stylesheet.transition)};i.updateTransitions(n);break}}else this._createFog(e);this._markersNeedUpdate=!0}_updateDrapeFirstLayers(){if(!this.map._optimizeForTerrain||!this.terrain)return;const t=this._order.filter((t=>this.isLayerDraped(this._layers[t]))),e=this._order.filter((t=>!this.isLayerDraped(this._layers[t])));this._drapedFirstOrder=[],this._drapedFirstOrder.push(...t),this._drapedFirstOrder.push(...e)}_createTerrain(e,i){const n=this.terrain=new _(e,i);this.stylesheet.terrain=e,this.dispatcher.broadcast("enableTerrain",!0),this._force3DLayerUpdate();const r={now:t.exported.now(),transition:t.extend({duration:0},this.stylesheet.transition)};n.updateTransitions(r)}_force3DLayerUpdate(){for(const t in this._layers){const e=this._layers[t];"fill-extrusion"===e.type&&this._updateLayer(e)}}_forceSymbolLayerUpdate(){for(const t in this._layers){const e=this._layers[t];"symbol"===e.type&&this._updateLayer(e)}}_validate(e,i,n,r,o={}){return(!o||!1!==o.validate)&&Le(this,e.call(t.validateStyle,t.extend({key:i,style:this.serialize(),value:n,styleSpec:t.spec},r)))}_remove(){this._request&&(this._request.cancel(),this._request=null),this._spriteRequest&&(this._spriteRequest.cancel(),this._spriteRequest=null),t.evented.off("pluginStateChange",this._rtlTextPluginCallback);for(const t in this._layers)this._layers[t].setEventedParent(null);for(const t in this._sourceCaches)this._sourceCaches[t].clearTiles(),this._sourceCaches[t].setEventedParent(null);this.imageManager.setEventedParent(null),this.setEventedParent(null),this.dispatcher.remove()}_clearSource(t){const e=this._getSourceCaches(t);for(const t of e)t.clearTiles()}_reloadSource(t){const e=this._getSourceCaches(t);for(const t of e)t.resume(),t.reload()}_updateSources(t){for(const e in this._sourceCaches)this._sourceCaches[e].update(t)}_generateCollisionBoxes(){for(const t in this._sourceCaches){const e=this._sourceCaches[t];e.resume(),e.reload()}}_updatePlacement(e,i,n,r,o=!1){let a=!1,s=!1;const l={};for(const t of this._order){const i=this._layers[t];if("symbol"!==i.type)continue;if(!l[i.source]){const t=this._getLayerSourceCache(i);if(!t)continue;l[i.source]=t.getRenderableIds(!0).map((e=>t.getTileByID(e))).sort(((t,e)=>e.tileID.overscaledZ-t.tileID.overscaledZ||(t.tileID.isLessThan(e.tileID)?-1:1)))}const n=this.crossTileSymbolIndex.addLayer(i,l[i.source],e.center.lng,e.projection);a=a||n}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),o=o||this._layerOrderChanged||0===n,this._layerOrderChanged&&this.fire(new t.Event("neworder")),(o||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(t.exported.now(),e.zoom))&&(this.pauseablePlacement=new ze(e,this._order,o,i,n,r,this.placement,this.fog&&e.projection.supportsFog?this.fog.state:null),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,l),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(t.exported.now()),s=!0),a&&this.pauseablePlacement.placement.setStale()),s||a)for(const t of this._order){const e=this._layers[t];"symbol"===e.type&&this.placement.updateLayerOpacities(e,l[e.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(t.exported.now())}_releaseSymbolFadeTiles(){for(const t in this._sourceCaches)this._sourceCaches[t].releaseSymbolFadeTiles()}getImages(t,e,i){this.imageManager.getImages(e.icons,i),this._updateTilesForChangedImages();const n=t=>{t&&t.setDependencies(e.tileID.key,e.type,e.icons)};n(this._otherSourceCaches[e.source]),n(this._symbolSourceCaches[e.source])}getGlyphs(t,e,i){this.glyphManager.getGlyphs(e.stacks,i)}getResource(e,i,n){return t.makeRequest(i,n)}_getSourceCache(t){return this._otherSourceCaches[t]}_getLayerSourceCache(t){return"symbol"===t.type?this._symbolSourceCaches[t.source]:this._otherSourceCaches[t.source]}_getSourceCaches(t){const e=[];return this._otherSourceCaches[t]&&e.push(this._otherSourceCaches[t]),this._symbolSourceCaches[t]&&e.push(this._symbolSourceCaches[t]),e}has3DLayers(){return this._num3DLayers>0}hasSymbolLayers(){return this._numSymbolLayers>0}hasCircleLayers(){return this._numCircleLayers>0}_clearWorkerCaches(){this.dispatcher.broadcast("clearCaches")}destroy(){this._clearWorkerCaches(),this.terrainSetForDrapingOnly()&&(delete this.terrain,delete this.stylesheet.terrain)}}Ne.getSourceType=function(t){return wt[t]},Ne.setSourceType=function(t,e){wt[t]=e},Ne.registerForPluginStateChange=t.registerForPluginStateChange;var Ve="\n#define EPSILON 0.0000001\n#define PI 3.141592653589793\n#define EXTENT 8192.0\n#ifdef FOG\nuniform mediump vec4 u_fog_color;uniform mediump vec2 u_fog_range;uniform mediump float u_fog_horizon_blend;varying vec3 v_fog_pos;float fog_range(float depth) {return (depth-u_fog_range[0])/(u_fog_range[1]-u_fog_range[0]);}float fog_horizon_blending(vec3 camera_dir) {float t=max(0.0,camera_dir.z/u_fog_horizon_blend);return u_fog_color.a*exp(-3.0*t*t);}float fog_opacity(float t) {const float decay=6.0;float falloff=1.0-min(1.0,exp(-decay*t));falloff*=falloff*falloff;return u_fog_color.a*min(1.0,1.00747*falloff);}\n#endif",Ue="attribute highp vec3 a_pos_3f;uniform lowp mat4 u_matrix;varying highp vec3 v_uv;void main() {const mat3 half_neg_pi_around_x=mat3(1.0,0.0, 0.0,0.0,0.0,-1.0,0.0,1.0, 0.0);v_uv=half_neg_pi_around_x*a_pos_3f;vec4 pos=u_matrix*vec4(a_pos_3f,1.0);gl_Position=pos.xyww;}";let Ze={},$e={};Ze=He("","\n#define ELEVATION_SCALE 7.0\n#define ELEVATION_OFFSET 450.0\n#ifdef PROJECTION_GLOBE_VIEW\nuniform vec3 u_tile_tl_up;uniform vec3 u_tile_tr_up;uniform vec3 u_tile_br_up;uniform vec3 u_tile_bl_up;uniform float u_tile_up_scale;vec3 elevationVector(vec2 pos) {vec2 uv=pos/EXTENT;vec3 up=normalize(mix(\nmix(u_tile_tl_up,u_tile_tr_up,uv.xxx),mix(u_tile_bl_up,u_tile_br_up,uv.xxx),uv.yyy));return up*u_tile_up_scale;}\n#else\nvec3 elevationVector(vec2 pos) { return vec3(0,0,1); }\n#endif\n#ifdef TERRAIN\n#ifdef TERRAIN_DEM_FLOAT_FORMAT\nuniform highp sampler2D u_dem;uniform highp sampler2D u_dem_prev;\n#else\nuniform sampler2D u_dem;uniform sampler2D u_dem_prev;\n#endif\nuniform vec4 u_dem_unpack;uniform vec2 u_dem_tl;uniform vec2 u_dem_tl_prev;uniform float u_dem_scale;uniform float u_dem_scale_prev;uniform float u_dem_size;uniform float u_dem_lerp;uniform float u_exaggeration;uniform float u_meter_to_dem;uniform mat4 u_label_plane_matrix_inv;uniform sampler2D u_depth;uniform vec2 u_depth_size_inv;vec4 tileUvToDemSample(vec2 uv,float dem_size,float dem_scale,vec2 dem_tl) {vec2 pos=dem_size*(uv*dem_scale+dem_tl)+1.0;vec2 f=fract(pos);return vec4((pos-f+0.5)/(dem_size+2.0),f);}float decodeElevation(vec4 v) {return dot(vec4(v.xyz*255.0,-1.0),u_dem_unpack);}float currentElevation(vec2 apos) {\n#ifdef TERRAIN_DEM_FLOAT_FORMAT\nvec2 pos=(u_dem_size*(apos/8192.0*u_dem_scale+u_dem_tl)+1.5)/(u_dem_size+2.0);return u_exaggeration*texture2D(u_dem,pos).a;\n#else\nfloat dd=1.0/(u_dem_size+2.0);vec4 r=tileUvToDemSample(apos/8192.0,u_dem_size,u_dem_scale,u_dem_tl);vec2 pos=r.xy;vec2 f=r.zw;float tl=decodeElevation(texture2D(u_dem,pos));\n#ifdef TERRAIN_DEM_NEAREST_FILTER\nreturn u_exaggeration*tl;\n#endif\nfloat tr=decodeElevation(texture2D(u_dem,pos+vec2(dd,0.0)));float bl=decodeElevation(texture2D(u_dem,pos+vec2(0.0,dd)));float br=decodeElevation(texture2D(u_dem,pos+vec2(dd,dd)));return u_exaggeration*mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);\n#endif\n}float prevElevation(vec2 apos) {\n#ifdef TERRAIN_DEM_FLOAT_FORMAT\nvec2 pos=(u_dem_size*(apos/8192.0*u_dem_scale_prev+u_dem_tl_prev)+1.5)/(u_dem_size+2.0);return u_exaggeration*texture2D(u_dem_prev,pos).a;\n#else\nfloat dd=1.0/(u_dem_size+2.0);vec4 r=tileUvToDemSample(apos/8192.0,u_dem_size,u_dem_scale_prev,u_dem_tl_prev);vec2 pos=r.xy;vec2 f=r.zw;float tl=decodeElevation(texture2D(u_dem_prev,pos));float tr=decodeElevation(texture2D(u_dem_prev,pos+vec2(dd,0.0)));float bl=decodeElevation(texture2D(u_dem_prev,pos+vec2(0.0,dd)));float br=decodeElevation(texture2D(u_dem_prev,pos+vec2(dd,dd)));return u_exaggeration*mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);\n#endif\n}\n#ifdef TERRAIN_VERTEX_MORPHING\nfloat elevation(vec2 apos) {float nextElevation=currentElevation(apos);float prevElevation=prevElevation(apos);return mix(prevElevation,nextElevation,u_dem_lerp);}\n#else\nfloat elevation(vec2 apos) {return currentElevation(apos);}\n#endif\nfloat unpack_depth(vec4 rgba_depth)\n{const vec4 bit_shift=vec4(1.0/(256.0*256.0*256.0),1.0/(256.0*256.0),1.0/256.0,1.0);return dot(rgba_depth,bit_shift)*2.0-1.0;}bool isOccluded(vec4 frag) {vec3 coord=frag.xyz/frag.w;float depth=unpack_depth(texture2D(u_depth,(coord.xy+1.0)*0.5));return coord.z > depth+0.0005;}float occlusionFade(vec4 frag) {vec3 coord=frag.xyz/frag.w;vec3 df=vec3(5.0*u_depth_size_inv,0.0);vec2 uv=0.5*coord.xy+0.5;vec4 depth=vec4(\nunpack_depth(texture2D(u_depth,uv-df.xz)),unpack_depth(texture2D(u_depth,uv+df.xz)),unpack_depth(texture2D(u_depth,uv-df.zy)),unpack_depth(texture2D(u_depth,uv+df.zy))\n);return dot(vec4(0.25),vec4(1.0)-clamp(300.0*(vec4(coord.z-0.001)-depth),0.0,1.0));}vec4 fourSample(vec2 pos,vec2 off) {\n#ifdef TERRAIN_DEM_FLOAT_FORMAT\nfloat tl=texture2D(u_dem,pos).a;float tr=texture2D(u_dem,pos+vec2(off.x,0.0)).a;float bl=texture2D(u_dem,pos+vec2(0.0,off.y)).a;float br=texture2D(u_dem,pos+off).a;\n#else\nvec4 demtl=vec4(texture2D(u_dem,pos).xyz*255.0,-1.0);float tl=dot(demtl,u_dem_unpack);vec4 demtr=vec4(texture2D(u_dem,pos+vec2(off.x,0.0)).xyz*255.0,-1.0);float tr=dot(demtr,u_dem_unpack);vec4 dembl=vec4(texture2D(u_dem,pos+vec2(0.0,off.y)).xyz*255.0,-1.0);float bl=dot(dembl,u_dem_unpack);vec4 dembr=vec4(texture2D(u_dem,pos+off).xyz*255.0,-1.0);float br=dot(dembr,u_dem_unpack);\n#endif\nreturn vec4(tl,tr,bl,br);}float flatElevation(vec2 pack) {vec2 apos=floor(pack/8.0);vec2 span=10.0*(pack-apos*8.0);vec2 uvTex=(apos-vec2(1.0,1.0))/8190.0;float size=u_dem_size+2.0;float dd=1.0/size;vec2 pos=u_dem_size*(uvTex*u_dem_scale+u_dem_tl)+1.0;vec2 f=fract(pos);pos=(pos-f+0.5)*dd;vec4 h=fourSample(pos,vec2(dd));float z=mix(mix(h.x,h.y,f.x),mix(h.z,h.w,f.x),f.y);vec2 w=floor(0.5*(span*u_meter_to_dem-1.0));vec2 d=dd*w;vec4 bounds=vec4(d,vec2(1.0)-d);h=fourSample(pos-d,2.0*d+vec2(dd));vec4 diff=abs(h.xzxy-h.ywzw);vec2 slope=min(vec2(0.25),u_meter_to_dem*0.5*(diff.xz+diff.yw)/(2.0*w+vec2(1.0)));vec2 fix=slope*span;float base=z+max(fix.x,fix.y);return u_exaggeration*base;}float elevationFromUint16(float word) {return u_exaggeration*(word/ELEVATION_SCALE-ELEVATION_OFFSET);}\n#else\nfloat elevation(vec2 pos) { return 0.0; }bool isOccluded(vec4 frag) { return false; }float occlusionFade(vec4 frag) { return 1.0; }\n#endif",!0),$e=He("#ifdef FOG\nuniform float u_fog_temporal_offset;float fog_opacity(vec3 pos) {float depth=length(pos);return fog_opacity(fog_range(depth));}vec3 fog_apply(vec3 color,vec3 pos) {float depth=length(pos);float opacity=fog_opacity(fog_range(depth));opacity*=fog_horizon_blending(pos/depth);return mix(color,u_fog_color.rgb,opacity);}vec4 fog_apply_from_vert(vec4 color,float fog_opac) {float alpha=EPSILON+color.a;color.rgb=mix(color.rgb/alpha,u_fog_color.rgb,fog_opac)*alpha;return color;}vec3 fog_apply_sky_gradient(vec3 camera_ray,vec3 sky_color) {float horizon_blend=fog_horizon_blending(normalize(camera_ray));return mix(sky_color,u_fog_color.rgb,horizon_blend);}vec4 fog_apply_premultiplied(vec4 color,vec3 pos) {float alpha=EPSILON+color.a;color.rgb=fog_apply(color.rgb/alpha,pos)*alpha;return color;}vec3 fog_dither(vec3 color) {vec2 dither_seed=gl_FragCoord.xy+u_fog_temporal_offset;return dither(color,dither_seed);}vec4 fog_dither(vec4 color) {return vec4(fog_dither(color.rgb),color.a);}\n#endif","#ifdef FOG\nuniform mat4 u_fog_matrix;vec3 fog_position(vec3 pos) {return (u_fog_matrix*vec4(pos,1.0)).xyz;}vec3 fog_position(vec2 pos) {return fog_position(vec3(pos,0.0));}float fog(vec3 pos) {float depth=length(pos);float opacity=fog_opacity(fog_range(depth));return opacity*fog_horizon_blending(pos/depth);}\n#endif",!0);const Ge=He("\nhighp vec3 hash(highp vec2 p) {highp vec3 p3=fract(p.xyx*vec3(443.8975,397.2973,491.1871));p3+=dot(p3,p3.yxz+19.19);return fract((p3.xxy+p3.yzz)*p3.zyx);}vec3 dither(vec3 color,highp vec2 seed) {vec3 rnd=hash(seed)+hash(seed+0.59374)-0.5;return color+rnd/255.0;}\n#ifdef TERRAIN\nhighp vec4 pack_depth(highp float ndc_z) {highp float depth=ndc_z*0.5+0.5;const highp vec4 bit_shift=vec4(256.0*256.0*256.0,256.0*256.0,256.0,1.0);const highp vec4 bit_mask =vec4(0.0,1.0/256.0,1.0/256.0,1.0/256.0);highp vec4 res=fract(depth*bit_shift);res-=res.xxyz*bit_mask;return res;}\n#endif","\nfloat wrap(float n,float min,float max) {float d=max-min;float w=mod(mod(n-min,d)+d,d)+min;return (w==min) ? max : w;}vec3 mercator_tile_position(mat4 matrix,vec2 tile_anchor,vec3 tile_id,vec2 mercator_center) {\n#if defined(PROJECTION_GLOBE_VIEW) && !defined(PROJECTED_POS_ON_VIEWPORT)\nfloat tiles=tile_id.z;vec2 mercator=(tile_anchor/EXTENT+tile_id.xy)/tiles;mercator-=mercator_center;mercator.x=wrap(mercator.x,-0.5,0.5);vec4 mercator_tile=vec4(mercator.xy*EXTENT,EXTENT/(2.0*PI),1.0);mercator_tile=matrix*mercator_tile;return mercator_tile.xyz;\n#else\nreturn vec3(0.0);\n#endif\n}vec3 mix_globe_mercator(vec3 globe,vec3 mercator,float t) {\n#if defined(PROJECTION_GLOBE_VIEW) && !defined(PROJECTED_POS_ON_VIEWPORT)\nreturn mix(globe,mercator,t);\n#else\nreturn globe;\n#endif\n}\n#ifdef PROJECTION_GLOBE_VIEW\nmat3 globe_mercator_surface_vectors(vec3 pos_normal,vec3 up_dir,float zoom_transition) {vec3 normal=zoom_transition==0.0 ? pos_normal : normalize(mix(pos_normal,up_dir,zoom_transition));vec3 xAxis=normalize(vec3(normal.z,0.0,-normal.x));vec3 yAxis=normalize(cross(normal,xAxis));return mat3(xAxis,yAxis,normal);}\n#endif\nvec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const float packedOpacity) {int intOpacity=int(packedOpacity)/2;return vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));}vec4 decode_color(const vec2 encodedColor) {return vec4(\nunpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0\n);}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {vec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);return (tile_units_to_pixels*pos+offset)/pattern_size;}const vec4 AWAY=vec4(-1000.0,-1000.0,-1000.0,1);//Normalized device coordinate that is not rendered."),qe=Ve;var We={background:He("uniform vec4 u_color;uniform float u_opacity;void main() {vec4 out_color=u_color;\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\ngl_FragColor=out_color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}"),backgroundPattern:He("uniform vec2 u_pattern_tl_a;uniform vec2 u_pattern_br_a;uniform vec2 u_pattern_tl_b;uniform vec2 u_pattern_br_b;uniform vec2 u_texsize;uniform float u_mix;uniform float u_opacity;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(u_pattern_tl_a/u_texsize,u_pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(u_pattern_tl_b/u_texsize,u_pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 out_color=mix(color1,color2,u_mix);\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\ngl_FragColor=out_color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pattern_size_a;uniform vec2 u_pattern_size_b;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_scale_a;uniform float u_scale_b;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_a*u_pattern_size_a,u_tile_units_to_pixels,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_b*u_pattern_size_b,u_tile_units_to_pixels,a_pos);\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}"),circle:He("varying vec3 v_data;varying float v_visibility;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=v_data.xy;float extrude_length=length(extrude);lowp float antialiasblur=v_data.z;float antialiased_blur=-max(blur,antialiasblur);float opacity_t=smoothstep(0.0,antialiased_blur,extrude_length-1.0);float color_t=stroke_width < 0.01 ? 0.0 : smoothstep(\nantialiased_blur,0.0,extrude_length-radius/(radius+stroke_width)\n);vec4 out_color=mix(color*opacity,stroke_color*stroke_opacity,color_t);\n#ifdef FOG\nout_color=fog_apply_premultiplied(out_color,v_fog_pos);\n#endif\ngl_FragColor=out_color*(v_visibility*opacity_t);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","#define NUM_VISIBILITY_RINGS 2\n#define INV_SQRT2 0.70710678\n#define ELEVATION_BIAS 0.0001\n#define NUM_SAMPLES_PER_RING 16\nuniform mat4 u_matrix;uniform mat2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;attribute vec2 a_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nattribute vec3 a_pos_3;attribute vec3 a_pos_normal_3;attribute float a_scale;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;\n#endif\nvarying vec3 v_data;varying float v_visibility;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvec2 calc_offset(vec2 extrusion,float radius,float stroke_width, float view_scale) {return extrusion*(radius+stroke_width)*u_extrude_scale*view_scale;}float cantilevered_elevation(vec2 pos,float radius,float stroke_width,float view_scale) {vec2 c1=pos+calc_offset(vec2(-1,-1),radius,stroke_width,view_scale);vec2 c2=pos+calc_offset(vec2(1,-1),radius,stroke_width,view_scale);vec2 c3=pos+calc_offset(vec2(1,1),radius,stroke_width,view_scale);vec2 c4=pos+calc_offset(vec2(-1,1),radius,stroke_width,view_scale);float h1=elevation(c1)+ELEVATION_BIAS;float h2=elevation(c2)+ELEVATION_BIAS;float h3=elevation(c3)+ELEVATION_BIAS;float h4=elevation(c4)+ELEVATION_BIAS;return max(h4,max(h3,max(h1,h2)));}float circle_elevation(vec2 pos) {\n#if defined(TERRAIN)\nreturn elevation(pos)+ELEVATION_BIAS;\n#else\nreturn 0.0;\n#endif\n}vec4 project_vertex(vec2 extrusion,vec4 world_center,vec4 projected_center,float radius,float stroke_width, float view_scale,mat3 surface_vectors) {vec2 sample_offset=calc_offset(extrusion,radius,stroke_width,view_scale);\n#ifdef PITCH_WITH_MAP\n#ifdef PROJECTION_GLOBE_VIEW\nreturn u_matrix*( world_center+vec4(sample_offset.x*surface_vectors[0]+sample_offset.y*surface_vectors[1],0) );\n#else\nreturn u_matrix*( world_center+vec4(sample_offset,0,0) );\n#endif\n#else\nreturn projected_center+vec4(sample_offset,0,0);\n#endif\n}float get_sample_step() {\n#ifdef PITCH_WITH_MAP\nreturn 2.0*PI/float(NUM_SAMPLES_PER_RING);\n#else\nreturn PI/float(NUM_SAMPLES_PER_RING);\n#endif\n}void main(void) {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);\n#ifdef PROJECTION_GLOBE_VIEW\nvec2 scaled_extrude=extrude*a_scale;vec3 pos_normal_3=a_pos_normal_3/16384.0;mat3 surface_vectors=globe_mercator_surface_vectors(pos_normal_3,u_up_dir,u_zoom_transition);vec3 surface_extrusion=scaled_extrude.x*surface_vectors[0]+scaled_extrude.y*surface_vectors[1];vec3 globe_elevation=elevationVector(circle_center)*circle_elevation(circle_center);vec3 globe_pos=a_pos_3+surface_extrusion+globe_elevation;vec3 mercator_elevation=u_up_dir*u_tile_up_scale*circle_elevation(circle_center);vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,circle_center,u_tile_id,u_merc_center)+surface_extrusion+mercator_elevation;vec3 pos=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition);vec4 world_center=vec4(pos,1);\n#else \nmat3 surface_vectors=mat3(1.0);float height=circle_elevation(circle_center);vec4 world_center=vec4(circle_center,height,1);\n#endif\nvec4 projected_center=u_matrix*world_center;float view_scale=0.0;\n#ifdef PITCH_WITH_MAP\n#ifdef SCALE_WITH_MAP\nview_scale=1.0;\n#else\nview_scale=projected_center.w/u_camera_to_center_distance;\n#endif\n#else\n#ifdef SCALE_WITH_MAP\nview_scale=u_camera_to_center_distance;\n#else\nview_scale=projected_center.w;\n#endif\n#endif\n#if defined(SCALE_WITH_MAP) && defined(PROJECTION_GLOBE_VIEW)\nview_scale*=a_scale;\n#endif\ngl_Position=project_vertex(extrude,world_center,projected_center,radius,stroke_width,view_scale,surface_vectors);float visibility=0.0;\n#ifdef TERRAIN\nfloat step=get_sample_step();\n#ifdef PITCH_WITH_MAP\nfloat cantilevered_height=cantilevered_elevation(circle_center,radius,stroke_width,view_scale);vec4 occlusion_world_center=vec4(circle_center,cantilevered_height,1);vec4 occlusion_projected_center=u_matrix*occlusion_world_center;\n#else\nvec4 occlusion_world_center=world_center;vec4 occlusion_projected_center=projected_center;\n#endif\nfor(int ring=0; ring < NUM_VISIBILITY_RINGS; ring++) {float scale=(float(ring)+1.0)/float(NUM_VISIBILITY_RINGS);for(int i=0; i < NUM_SAMPLES_PER_RING; i++) {vec2 extrusion=vec2(cos(step*float(i)),-sin(step*float(i)))*scale;vec4 frag_pos=project_vertex(extrusion,occlusion_world_center,occlusion_projected_center,radius,stroke_width,view_scale,surface_vectors);visibility+=float(!isOccluded(frag_pos));}}visibility/=float(NUM_VISIBILITY_RINGS)*float(NUM_SAMPLES_PER_RING);\n#else\nvisibility=1.0;\n#endif\n#ifdef PROJECTION_GLOBE_VIEW\nvisibility=1.0;\n#endif\nv_visibility=visibility;lowp float antialiasblur=1.0/u_device_pixel_ratio/(radius+stroke_width);v_data=vec3(extrude.x,extrude.y,antialiasblur);\n#ifdef FOG\nv_fog_pos=fog_position(world_center.xyz);\n#endif\n}"),clippingMask:He("void main() {gl_FragColor=vec4(1.0);}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),heatmap:He("uniform highp float u_intensity;varying vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#define GAUSS_COEF 0.3989422804014327\nvoid main() {\n#pragma mapbox: initialize highp float weight\nfloat d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);gl_FragColor=vec4(val,1.0,1.0,1.0);\n#ifdef FOG\ngl_FragColor.r*=pow(1.0-fog_opacity(v_fog_pos),2.0);\n#endif\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;attribute vec2 a_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nattribute vec3 a_pos_3;attribute vec3 a_pos_normal_3;attribute float a_scale;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;\n#endif\nvarying vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#pragma mapbox: define mediump float radius\nconst highp float ZERO=1.0/255.0/16.0;\n#define GAUSS_COEF 0.3989422804014327\nvoid main(void) {\n#pragma mapbox: initialize highp float weight\n#pragma mapbox: initialize mediump float radius\nvec2 unscaled_extrude=vec2(mod(a_pos,2.0)*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec2 tilePos=floor(a_pos*0.5);\n#ifdef PROJECTION_GLOBE_VIEW\nextrude*=a_scale;vec3 pos_normal_3=a_pos_normal_3/16384.0;mat3 surface_vectors=globe_mercator_surface_vectors(pos_normal_3,u_up_dir,u_zoom_transition);vec3 surface_extrusion=extrude.x*surface_vectors[0]+extrude.y*surface_vectors[1];vec3 globe_elevation=elevationVector(tilePos)*elevation(tilePos);vec3 globe_pos=a_pos_3+surface_extrusion+globe_elevation;vec3 mercator_elevation=u_up_dir*u_tile_up_scale*elevation(tilePos);vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,tilePos,u_tile_id,u_merc_center)+surface_extrusion+mercator_elevation;vec3 pos=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition);\n#else\nvec3 pos=vec3(tilePos+extrude,elevation(tilePos));\n#endif\ngl_Position=u_matrix*vec4(pos,1);\n#ifdef FOG\nv_fog_pos=fog_position(pos);\n#endif\n}"),heatmapTexture:He("uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;varying vec2 v_pos;void main() {float t=texture2D(u_image,v_pos).r;vec4 color=texture2D(u_color_ramp,vec2(t,0.5));gl_FragColor=color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(0.0);\n#endif\n}","attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=vec4(a_pos,0,1);v_pos=a_pos*0.5+0.5;}"),collisionBox:He("varying float v_placed;varying float v_notUsed;void main() {vec4 red =vec4(1.0,0.0,0.0,1.0);vec4 blue=vec4(0.0,0.0,1.0,0.5);gl_FragColor =mix(red,blue,step(0.5,v_placed))*0.5;gl_FragColor*=mix(1.0,0.1,step(0.5,v_notUsed));}","attribute vec3 a_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;attribute vec2 a_shift;attribute float a_size_scale;attribute vec2 a_padding;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;varying float v_placed;varying float v_notUsed;void main() {vec4 projectedPoint=u_matrix*vec4(a_pos+elevationVector(a_anchor_pos)*elevation(a_anchor_pos),1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(\n0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,1.5);gl_Position=projectedPoint;gl_Position.xy+=(a_extrude*a_size_scale+a_shift+a_padding)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}"),collisionCircle:He("varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);gl_FragColor=color*alpha*opacity_t;}","attribute vec2 a_pos_2f;attribute float a_radius;attribute vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos_2f;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(\nmix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp(\n0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),debug:He("uniform highp vec4 u_color;uniform sampler2D u_overlay;varying vec2 v_uv;void main() {vec4 overlay_color=texture2D(u_overlay,v_uv);gl_FragColor=mix(u_color,overlay_color,overlay_color.a);}","attribute vec2 a_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nattribute vec3 a_pos_3;\n#endif\nvarying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {float h=elevation(a_pos);v_uv=a_pos/8192.0;\n#ifdef PROJECTION_GLOBE_VIEW\ngl_Position=u_matrix*vec4(a_pos_3+elevationVector(a_pos)*h,1);\n#else\ngl_Position=u_matrix*vec4(a_pos*u_overlay_scale,h,1);\n#endif\n}"),fill:He("#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\nvec4 out_color=color;\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\ngl_FragColor=out_color*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}"),fillOutline:He("varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);vec4 out_color=outline_color;\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\ngl_FragColor=out_color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}"),fillOutlinePattern:He("uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);vec4 out_color=mix(color1,color2,u_fade);\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\ngl_FragColor=out_color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}"),fillPattern:He("uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 out_color=mix(color1,color2,u_fade);\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\ngl_FragColor=out_color*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}"),fillExtrusion:He("varying vec4 v_color;void main() {vec4 color=v_color;\n#ifdef FOG\ncolor=fog_dither(fog_apply_premultiplied(color,v_fog_pos));\n#endif\ngl_FragColor=color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;attribute vec4 a_pos_normal_ed;attribute vec2 a_centroid_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nattribute vec3 a_pos_3;attribute vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;uniform float u_height_lift;\n#endif\nvarying vec4 v_color;\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define highp vec4 color\nvoid main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize highp vec4 color\nvec3 pos_nx=floor(a_pos_normal_ed.xyz*0.5);mediump vec3 top_up_ny=a_pos_normal_ed.xyz-2.0*pos_nx;float x_normal=pos_nx.z/8192.0;vec3 normal=top_up_ny.y==1.0 ? vec3(0.0,0.0,1.0) : normalize(vec3(x_normal,(2.0*top_up_ny.z-1.0)*(1.0-abs(x_normal)),0.0));base=max(0.0,base);height=max(0.0,height);float t=top_up_ny.x;vec2 centroid_pos=vec2(0.0);\n#if defined(HAS_CENTROID) || defined(TERRAIN)\ncentroid_pos=a_centroid_pos;\n#endif\n#ifdef TERRAIN\nbool flat_roof=centroid_pos.x !=0.0 && t > 0.0;float ele=elevation(pos_nx.xy);float c_ele=flat_roof ? centroid_pos.y==0.0 ? elevationFromUint16(centroid_pos.x) : flatElevation(centroid_pos) : ele;float h=flat_roof ? max(c_ele+height,ele+base+2.0) : ele+(t > 0.0 ? height : base==0.0 ?-5.0 : base);vec3 pos=vec3(pos_nx.xy,h);\n#else\nvec3 pos=vec3(pos_nx.xy,t > 0.0 ? height : base);\n#endif\n#ifdef PROJECTION_GLOBE_VIEW\nfloat lift=float((t+base) > 0.0)*u_height_lift;vec3 globe_normal=normalize(mix(a_pos_normal_3/16384.0,u_up_dir,u_zoom_transition));vec3 globe_pos=a_pos_3+globe_normal*(u_tile_up_scale*(pos.z+lift));vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,pos.xy,u_tile_id,u_merc_center)+u_up_dir*u_tile_up_scale*pos.z;pos=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition);\n#endif\nfloat hidden=float(centroid_pos.x==0.0 && centroid_pos.y==1.0);gl_Position=mix(u_matrix*vec4(pos,1),AWAY,hidden);float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;float directional=clamp(dot(normal,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=(\n(1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.rgb+=clamp(color.rgb*directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_color*=u_opacity;\n#ifdef FOG\nv_fog_pos=fog_position(pos);\n#endif\n}"),fillExtrusionPattern:He("uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 out_color=mix(color1,color2,u_fade);out_color=out_color*v_lighting;\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\ngl_FragColor=out_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec4 a_pos_normal_ed;attribute vec2 a_centroid_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nattribute vec3 a_pos_3;attribute vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;uniform float u_height_lift;\n#endif\nvarying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 pos_nx=floor(a_pos_normal_ed.xyz*0.5);mediump vec3 top_up_ny=a_pos_normal_ed.xyz-2.0*pos_nx;float x_normal=pos_nx.z/8192.0;vec3 normal=top_up_ny.y==1.0 ? vec3(0.0,0.0,1.0) : normalize(vec3(x_normal,(2.0*top_up_ny.z-1.0)*(1.0-abs(x_normal)),0.0));float edgedistance=a_pos_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;base=max(0.0,base);height=max(0.0,height);float t=top_up_ny.x;float z=t > 0.0 ? height : base;vec2 centroid_pos=vec2(0.0);\n#if defined(HAS_CENTROID) || defined(TERRAIN)\ncentroid_pos=a_centroid_pos;\n#endif\n#ifdef TERRAIN\nbool flat_roof=centroid_pos.x !=0.0 && t > 0.0;float ele=elevation(pos_nx.xy);float c_ele=flat_roof ? centroid_pos.y==0.0 ? elevationFromUint16(centroid_pos.x) : flatElevation(centroid_pos) : ele;float h=flat_roof ? max(c_ele+height,ele+base+2.0) : ele+(t > 0.0 ? height : base==0.0 ?-5.0 : base);vec3 p=vec3(pos_nx.xy,h);\n#else\nvec3 p=vec3(pos_nx.xy,z);\n#endif\n#ifdef PROJECTION_GLOBE_VIEW\nfloat lift=float((t+base) > 0.0)*u_height_lift;vec3 globe_normal=normalize(mix(a_pos_normal_3/16384.0,u_up_dir,u_zoom_transition));vec3 globe_pos=a_pos_3+globe_normal*(u_tile_up_scale*(p.z+lift));vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,p.xy,u_tile_id,u_merc_center)+u_up_dir*u_tile_up_scale*p.z;p=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition);\n#endif\nfloat hidden=float(centroid_pos.x==0.0 && centroid_pos.y==1.0);gl_Position=mix(u_matrix*vec4(p,1),AWAY,hidden);vec2 pos=normal.z==1.0\n? pos_nx.xy\n: vec2(edgedistance,z*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=(\n(1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;\n#ifdef FOG\nv_fog_pos=fog_position(p);\n#endif\n}"),hillshadePrepare:He("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord) {\n#ifdef TERRAIN_DEM_FLOAT_FORMAT\nreturn texture2D(u_image,coord).a/4.0;\n#else\nvec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;\n#endif\n}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y));float b=getElevation(v_pos+vec2(0,-epsilon.y));float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y));float d=getElevation(v_pos+vec2(-epsilon.x,0));float e=getElevation(v_pos);float f=getElevation(v_pos+vec2(epsilon.x,0));float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y));float h=getElevation(v_pos+vec2(0,epsilon.y));float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y));float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2(\n(c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c)\n)/pow(2.0,exaggeration+(19.2562-u_zoom));gl_FragColor=clamp(vec4(\nderiv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}"),hillshade:He("uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent;void main() {vec4 pixel=texture2D(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);gl_FragColor=accent_color*(1.0-shade_color.a)+shade_color;\n#ifdef FOG\ngl_FragColor=fog_dither(fog_apply_premultiplied(gl_FragColor,v_fog_pos));\n#endif\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}"),line:He("uniform lowp float u_device_pixel_ratio;uniform float u_alpha_discard_threshold;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;\n#ifdef RENDER_LINE_DASH\nuniform sampler2D u_dash_image;uniform float u_mix;uniform vec3 u_scale;varying vec2 v_tex_a;varying vec2 v_tex_b;\n#endif\n#ifdef RENDER_LINE_GRADIENT\nuniform sampler2D u_gradient_image;varying highp vec2 v_uv;\n#endif\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define lowp vec4 dash_from\n#pragma mapbox: define lowp vec4 dash_to\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize lowp vec4 dash_from\n#pragma mapbox: initialize lowp vec4 dash_to\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);\n#ifdef RENDER_LINE_DASH\nfloat sdfdist_a=texture2D(u_dash_image,v_tex_a).a;float sdfdist_b=texture2D(u_dash_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);float sdfwidth=min(dash_from.z*u_scale.y,dash_to.z*u_scale.z);float sdfgamma=1.0/(2.0*u_device_pixel_ratio)/sdfwidth;alpha*=smoothstep(0.5-sdfgamma/floorwidth,0.5+sdfgamma/floorwidth,sdfdist);\n#endif\n#ifdef RENDER_LINE_GRADIENT\nvec4 out_color=texture2D(u_gradient_image,v_uv);\n#else\nvec4 out_color=color;\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\n#ifdef RENDER_LINE_ALPHA_DISCARD\nif (alpha < u_alpha_discard_threshold) {discard;}\n#endif\ngl_FragColor=out_color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define EXTRUDE_SCALE 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;\n#ifdef RENDER_LINE_GRADIENT\nattribute vec3 a_packed;\n#else\nattribute float a_linesofar;\n#endif\nuniform mat4 u_matrix;uniform mat2 u_pixels_to_tile_units;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;\n#ifdef RENDER_LINE_DASH\nuniform vec2 u_texsize;uniform mediump vec3 u_scale;varying vec2 v_tex_a;varying vec2 v_tex_b;\n#endif\n#ifdef RENDER_LINE_GRADIENT\nuniform float u_image_height;varying highp vec2 v_uv;\n#endif\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define lowp vec4 dash_from\n#pragma mapbox: define lowp vec4 dash_to\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize lowp vec4 dash_from\n#pragma mapbox: initialize lowp vec4 dash_to\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*EXTRUDE_SCALE;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*EXTRUDE_SCALE*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist*u_pixels_to_tile_units,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2*u_pixels_to_tile_units,0.0,1.0)+projected_extrude;\n#ifndef RENDER_TO_TEXTURE\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#else\nv_gamma_scale=1.0;\n#endif\n#ifdef RENDER_LINE_GRADIENT\nfloat a_uv_x=a_packed[0];float a_split_index=a_packed[1];float a_linesofar=a_packed[2];highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);\n#endif\n#ifdef RENDER_LINE_DASH\nfloat tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;float scaleA=dash_from.z==0.0 ? 0.0 : tileZoomRatio/(dash_from.z*fromScale);float scaleB=dash_to.z==0.0 ? 0.0 : tileZoomRatio/(dash_to.z*toScale);float heightA=dash_from.y;float heightB=dash_to.y;v_tex_a=vec2(a_linesofar*scaleA/floorwidth,(-normal.y*heightA+dash_from.x+0.5)/u_texsize.y);v_tex_b=vec2(a_linesofar*scaleB/floorwidth,(-normal.y*heightB+dash_to.x+0.5)/u_texsize.y);\n#endif\nv_width2=vec2(outset,inset);\n#ifdef FOG\nv_fog_pos=fog_position(pos);\n#endif\n}"),linePattern:He("uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);\n#ifdef FOG\ncolor=fog_dither(fog_apply_premultiplied(color,v_fog_pos));\n#endif\ngl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_linesofar;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mat2 u_pixels_to_tile_units;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist*u_pixels_to_tile_units,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2*u_pixels_to_tile_units,0.0,1.0)+projected_extrude;\n#ifndef RENDER_TO_TEXTURE\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#else\nv_gamma_scale=1.0;\n#endif\nv_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;\n#ifdef FOG\nv_fog_pos=fog_position(pos);\n#endif\n}"),raster:He("uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture2D(u_image0,v_pos0);vec4 color1=texture2D(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(\ndot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);vec3 out_color=mix(u_high_vec,u_low_vec,rgb);\n#ifdef FOG\nout_color=fog_dither(fog_apply(out_color,v_fog_pos));\n#endif\ngl_FragColor=vec4(out_color*color.a,color.a);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform vec2 u_perspective_transform;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {float w=1.0+dot(a_texture_pos,u_perspective_transform);gl_Position=u_matrix*vec4(a_pos*w,0,w);v_pos0=a_texture_pos/8192.0;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}"),symbolIcon:He("uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nlowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec4 a_pos_offset;attribute vec4 a_tex_size;attribute vec4 a_pixeloffset;attribute vec4 a_z_tile_anchor;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_tex_size.xy;vec2 a_size=a_tex_size.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}float anchorZ=a_z_tile_anchor.x;vec2 tileAnchor=a_z_tile_anchor.yz;vec3 h=elevationVector(tileAnchor)*elevation(tileAnchor);vec3 mercator_pos=mercator_tile_position(u_inv_rot_matrix,tileAnchor,u_tile_id,u_merc_center);vec3 world_pos=mix_globe_mercator(vec3(a_pos,anchorZ)+h,mercator_pos,u_zoom_transition);vec4 projectedPoint=u_matrix*vec4(world_pos,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(\n0.5+0.5*distance_ratio,0.0,1.5);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),anchorZ,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}vec3 proj_pos=mix_globe_mercator(vec3(a_projected_pos.xy,anchorZ),mercator_pos,u_zoom_transition);\n#ifdef PROJECTED_POS_ON_VIEWPORT\nvec4 projected_pos=u_label_plane_matrix*vec4(proj_pos.xy,0.0,1.0);\n#else\nvec4 projected_pos=u_label_plane_matrix*vec4(proj_pos.xyz+h,1.0);\n#endif\nhighp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);float z=0.0;vec2 offset=rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0);\n#ifdef PITCH_WITH_MAP_TERRAIN\nvec4 tile_pos=u_label_plane_matrix_inv*vec4(a_projected_pos.xy+offset,0.0,1.0);z=elevation(tile_pos.xy);\n#endif\nfloat occlusion_fade=occlusionFade(projectedPoint);gl_Position=mix(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+offset,z,1.0),AWAY,float(projectedPoint.w <=0.0 || occlusion_fade==0.0));float projection_transition_fade=1.0;\n#if defined(PROJECTED_POS_ON_VIEWPORT) && defined(PROJECTION_GLOBE_VIEW)\nprojection_transition_fade=1.0-step(EPSILON,u_zoom_transition);\n#endif\nv_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;v_fade_opacity=max(0.0,min(occlusion_fade,fade_opacity[0]+fade_change))*projection_transition_fade;}"),symbolSDF:He("#define SDF_PX 8.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec4 a_pos_offset;attribute vec4 a_tex_size;attribute vec4 a_pixeloffset;attribute vec4 a_z_tile_anchor;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec3 u_tile_id;uniform float u_zoom_transition;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_tex_size.xy;vec2 a_size=a_tex_size.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}float anchorZ=a_z_tile_anchor.x;vec2 tileAnchor=a_z_tile_anchor.yz;vec3 h=elevationVector(tileAnchor)*elevation(tileAnchor);vec3 mercator_pos=mercator_tile_position(u_inv_rot_matrix,tileAnchor,u_tile_id,u_merc_center);vec3 world_pos=mix_globe_mercator(vec3(a_pos,anchorZ)+h,mercator_pos,u_zoom_transition);vec4 projectedPoint=u_matrix*vec4(world_pos,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(\n0.5+0.5*distance_ratio,0.0,1.5);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),anchorZ,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}vec3 proj_pos=mix_globe_mercator(vec3(a_projected_pos.xy,anchorZ),mercator_pos,u_zoom_transition);\n#ifdef PROJECTED_POS_ON_VIEWPORT\nvec4 projected_pos=u_label_plane_matrix*vec4(proj_pos.xy,0.0,1.0);\n#else\nvec4 projected_pos=u_label_plane_matrix*vec4(proj_pos.xyz+h,1.0);\n#endif\nhighp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);float z=0.0;vec2 offset=rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset);\n#ifdef PITCH_WITH_MAP_TERRAIN\nvec4 tile_pos=u_label_plane_matrix_inv*vec4(a_projected_pos.xy+offset,0.0,1.0);z=elevation(tile_pos.xy);\n#endif\nfloat occlusion_fade=occlusionFade(projectedPoint);gl_Position=mix(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+offset,z,1.0),AWAY,float(projectedPoint.w <=0.0 || occlusion_fade==0.0));float gamma_scale=gl_Position.w;float projection_transition_fade=1.0;\n#if defined(PROJECTED_POS_ON_VIEWPORT) && defined(PROJECTION_GLOBE_VIEW)\nprojection_transition_fade=1.0-step(EPSILON,u_zoom_transition);\n#endif\nvec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(occlusion_fade,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity*projection_transition_fade);}"),symbolTextAndIcon:He("#define SDF_PX 8.0\n#define SDF 1.0\n#define ICON 0.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;varying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\nreturn;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec4 a_pos_offset;attribute vec4 a_tex_size;attribute vec4 a_z_tile_anchor;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;varying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_tex_size.xy;vec2 a_size=a_tex_size.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}float anchorZ=a_z_tile_anchor.x;vec2 tileAnchor=a_z_tile_anchor.yz;vec3 h=elevationVector(tileAnchor)*elevation(tileAnchor);vec3 mercator_pos=mercator_tile_position(u_inv_rot_matrix,tileAnchor,u_tile_id,u_merc_center);vec3 world_pos=mix_globe_mercator(vec3(a_pos,anchorZ)+h,mercator_pos,u_zoom_transition);vec4 projectedPoint=u_matrix*vec4(world_pos,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(\n0.5+0.5*distance_ratio,0.0,1.5);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),anchorZ,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}vec3 proj_pos=mix_globe_mercator(vec3(a_projected_pos.xy,anchorZ),mercator_pos,u_zoom_transition);\n#ifdef PROJECTED_POS_ON_VIEWPORT\nvec4 projected_pos=u_label_plane_matrix*vec4(proj_pos.xy,0.0,1.0);\n#else\nvec4 projected_pos=u_label_plane_matrix*vec4(proj_pos.xyz+h,1.0);\n#endif\nhighp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);float z=0.0;vec2 offset=rotation_matrix*(a_offset/32.0*fontScale);\n#ifdef PITCH_WITH_MAP_TERRAIN\nvec4 tile_pos=u_label_plane_matrix_inv*vec4(a_projected_pos.xy+offset,0.0,1.0);z=elevation(tile_pos.xy);\n#endif\nfloat occlusion_fade=occlusionFade(projectedPoint);gl_Position=mix(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+offset,z,1.0),AWAY,float(projectedPoint.w <=0.0 || occlusion_fade==0.0));float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(occlusion_fade,fade_opacity[0]+fade_change));float projection_transition_fade=1.0;\n#if defined(PROJECTED_POS_ON_VIEWPORT) && defined(PROJECTION_GLOBE_VIEW)\nprojection_transition_fade=1.0-step(EPSILON,u_zoom_transition);\n#endif\nv_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity*projection_transition_fade,is_sdf);}"),terrainRaster:He("uniform sampler2D u_image0;varying vec2 v_pos0;\n#ifdef FOG\nvarying float v_fog_opacity;\n#endif\nvoid main() {vec4 color=texture2D(u_image0,v_pos0);\n#ifdef FOG\ncolor=fog_dither(fog_apply_from_vert(color,v_fog_opacity));\n#endif\ngl_FragColor=color;\n#ifdef TERRAIN_WIREFRAME\ngl_FragColor=vec4(1.0,0.0,0.0,0.8);\n#endif\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform float u_skirt_height;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;\n#ifdef FOG\nvarying float v_fog_opacity;\n#endif\nconst float skirtOffset=24575.0;const float wireframeOffset=0.00015;void main() {v_pos0=a_texture_pos/8192.0;float skirt=float(a_pos.x >=skirtOffset);float elevation=elevation(a_texture_pos)-skirt*u_skirt_height;\n#ifdef TERRAIN_WIREFRAME\nelevation+=u_skirt_height*u_skirt_height*wireframeOffset;\n#endif\nvec2 decodedPos=a_pos-vec2(skirt*skirtOffset,0.0);gl_Position=u_matrix*vec4(decodedPos,elevation,1.0);\n#ifdef FOG\nv_fog_opacity=fog(fog_position(vec3(decodedPos,elevation)));\n#endif\n}"),terrainDepth:He("#ifdef GL_ES\nprecision highp float;\n#endif\nvarying float v_depth;void main() {gl_FragColor=pack_depth(v_depth);}","uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying float v_depth;void main() {float elevation=elevation(a_texture_pos);gl_Position=u_matrix*vec4(a_pos,elevation,1.0);v_depth=gl_Position.z/gl_Position.w;}"),skybox:He("\nvarying lowp vec3 v_uv;uniform lowp samplerCube u_cubemap;uniform lowp float u_opacity;uniform highp float u_temporal_offset;uniform highp vec3 u_sun_direction;float sun_disk(highp vec3 ray_direction,highp vec3 sun_direction) {highp float cos_angle=dot(normalize(ray_direction),sun_direction);const highp float cos_sun_angular_diameter=0.99996192306;const highp float smoothstep_delta=1e-5;return smoothstep(\ncos_sun_angular_diameter-smoothstep_delta,cos_sun_angular_diameter+smoothstep_delta,cos_angle);}float map(float value,float start,float end,float new_start,float new_end) {return ((value-start)*(new_end-new_start))/(end-start)+new_start;}void main() {vec3 uv=v_uv;const float y_bias=0.015;uv.y+=y_bias;uv.y=pow(abs(uv.y),1.0/5.0);uv.y=map(uv.y,0.0,1.0,-1.0,1.0);vec3 sky_color=textureCube(u_cubemap,uv).rgb;\n#ifdef FOG\nsky_color=fog_apply_sky_gradient(v_uv.xzy,sky_color);\n#endif\nsky_color.rgb=dither(sky_color.rgb,gl_FragCoord.xy+u_temporal_offset);sky_color+=0.1*sun_disk(v_uv,u_sun_direction);gl_FragColor=vec4(sky_color*u_opacity,u_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}",Ue),skyboxGradient:He("varying highp vec3 v_uv;uniform lowp sampler2D u_color_ramp;uniform highp vec3 u_center_direction;uniform lowp float u_radius;uniform lowp float u_opacity;uniform highp float u_temporal_offset;void main() {float progress=acos(dot(normalize(v_uv),u_center_direction))/u_radius;vec4 color=texture2D(u_color_ramp,vec2(progress,0.5));\n#ifdef FOG\ncolor.rgb=fog_apply_sky_gradient(v_uv.xzy,color.rgb/color.a)*color.a;\n#endif\ncolor*=u_opacity;color.rgb=dither(color.rgb,gl_FragCoord.xy+u_temporal_offset);gl_FragColor=color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}",Ue),skyboxCapture:He("\nvarying highp vec3 v_position;uniform highp float u_sun_intensity;uniform highp float u_luminance;uniform lowp vec3 u_sun_direction;uniform highp vec4 u_color_tint_r;uniform highp vec4 u_color_tint_m;\n#ifdef GL_ES\nprecision highp float;\n#endif\n#define BETA_R vec3(5.5e-6,13.0e-6,22.4e-6)\n#define BETA_M vec3(21e-6,21e-6,21e-6)\n#define MIE_G 0.76\n#define DENSITY_HEIGHT_SCALE_R 8000.0\n#define DENSITY_HEIGHT_SCALE_M 1200.0\n#define PLANET_RADIUS 6360e3\n#define ATMOSPHERE_RADIUS 6420e3\n#define SAMPLE_STEPS 10\n#define DENSITY_STEPS 4\nfloat ray_sphere_exit(vec3 orig,vec3 dir,float radius) {float a=dot(dir,dir);float b=2.0*dot(dir,orig);float c=dot(orig,orig)-radius*radius;float d=sqrt(b*b-4.0*a*c);return (-b+d)/(2.0*a);}vec3 extinction(vec2 density) {return exp(-vec3(BETA_R*u_color_tint_r.a*density.x+BETA_M*u_color_tint_m.a*density.y));}vec2 local_density(vec3 point) {float height=max(length(point)-PLANET_RADIUS,0.0);float exp_r=exp(-height/DENSITY_HEIGHT_SCALE_R);float exp_m=exp(-height/DENSITY_HEIGHT_SCALE_M);return vec2(exp_r,exp_m);}float phase_ray(float cos_angle) {return (3.0/(16.0*PI))*(1.0+cos_angle*cos_angle);}float phase_mie(float cos_angle) {return (3.0/(8.0*PI))*((1.0-MIE_G*MIE_G)*(1.0+cos_angle*cos_angle))/((2.0+MIE_G*MIE_G)*pow(1.0+MIE_G*MIE_G-2.0*MIE_G*cos_angle,1.5));}vec2 density_to_atmosphere(vec3 point,vec3 light_dir) {float ray_len=ray_sphere_exit(point,light_dir,ATMOSPHERE_RADIUS);float step_len=ray_len/float(DENSITY_STEPS);vec2 density_point_to_atmosphere=vec2(0.0);for (int i=0; i < DENSITY_STEPS;++i) {vec3 point_on_ray=point+light_dir*((float(i)+0.5)*step_len);density_point_to_atmosphere+=local_density(point_on_ray)*step_len;;}return density_point_to_atmosphere;}vec3 atmosphere(vec3 ray_dir,vec3 sun_direction,float sun_intensity) {vec2 density_orig_to_point=vec2(0.0);vec3 scatter_r=vec3(0.0);vec3 scatter_m=vec3(0.0);vec3 origin=vec3(0.0,PLANET_RADIUS,0.0);float ray_len=ray_sphere_exit(origin,ray_dir,ATMOSPHERE_RADIUS);float step_len=ray_len/float(SAMPLE_STEPS);for (int i=0; i < SAMPLE_STEPS;++i) {vec3 point_on_ray=origin+ray_dir*((float(i)+0.5)*step_len);vec2 density=local_density(point_on_ray)*step_len;density_orig_to_point+=density;vec2 density_point_to_atmosphere=density_to_atmosphere(point_on_ray,sun_direction);vec2 density_orig_to_atmosphere=density_orig_to_point+density_point_to_atmosphere;vec3 extinction=extinction(density_orig_to_atmosphere);scatter_r+=density.x*extinction;scatter_m+=density.y*extinction;}float cos_angle=dot(ray_dir,sun_direction);float phase_r=phase_ray(cos_angle);float phase_m=phase_mie(cos_angle);vec3 beta_r=BETA_R*u_color_tint_r.rgb*u_color_tint_r.a;vec3 beta_m=BETA_M*u_color_tint_m.rgb*u_color_tint_m.a;return (scatter_r*phase_r*beta_r+scatter_m*phase_m*beta_m)*sun_intensity;}const float A=0.15;const float B=0.50;const float C=0.10;const float D=0.20;const float E=0.02;const float F=0.30;vec3 uncharted2_tonemap(vec3 x) {return ((x*(A*x+C*B)+D*E)/(x*(A*x+B)+D*F))-E/F;}void main() {vec3 ray_direction=v_position;ray_direction.y=pow(ray_direction.y,5.0);const float y_bias=0.015;ray_direction.y+=y_bias;vec3 color=atmosphere(normalize(ray_direction),u_sun_direction,u_sun_intensity);float white_scale=1.0748724675633854;color=uncharted2_tonemap((log2(2.0/pow(u_luminance,4.0)))*color)*white_scale;gl_FragColor=vec4(color,1.0);}","attribute highp vec3 a_pos_3f;uniform mat3 u_matrix_3f;varying highp vec3 v_position;float map(float value,float start,float end,float new_start,float new_end) {return ((value-start)*(new_end-new_start))/(end-start)+new_start;}void main() {vec4 pos=vec4(u_matrix_3f*a_pos_3f,1.0);v_position=pos.xyz;v_position.y*=-1.0;v_position.y=map(v_position.y,-1.0,1.0,0.0,1.0);gl_Position=vec4(a_pos_3f.xy,0.0,1.0);}"),globeRaster:He("uniform sampler2D u_image0;varying vec2 v_pos0;void main() {gl_FragColor=texture2D(u_image0,v_pos0);\n#ifdef TERRAIN_WIREFRAME\ngl_FragColor=vec4(1.0,0.0,0.0,0.8);\n#endif\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_proj_matrix;uniform mat4 u_globe_matrix;uniform mat4 u_merc_matrix;uniform float u_zoom_transition;uniform vec2 u_merc_center;attribute vec3 a_globe_pos;attribute vec2 a_merc_pos;attribute vec2 a_uv;varying vec2 v_pos0;const float wireframeOffset=1e3;void main() {v_pos0=a_uv;vec2 uv=a_uv*EXTENT;vec4 up_vector=vec4(elevationVector(uv),1.0);float height=elevation(uv);\n#ifdef TERRAIN_WIREFRAME\nheight+=wireframeOffset;\n#endif\nvec4 globe=u_globe_matrix*vec4(a_globe_pos+up_vector.xyz*height,1.0);vec4 mercator=vec4(0.0);if (u_zoom_transition > 0.0) {mercator=vec4(a_merc_pos,height,1.0);mercator.xy-=u_merc_center;mercator.x=wrap(mercator.x,-0.5,0.5);mercator=u_merc_matrix*mercator;}vec3 position=mix(globe.xyz,mercator.xyz,u_zoom_transition);gl_Position=u_proj_matrix*vec4(position,1.0);}"),globeAtmosphere:He("uniform vec2 u_center;uniform float u_radius;uniform vec2 u_screen_size;uniform float u_opacity;uniform highp float u_fadeout_range;uniform vec3 u_start_color;uniform vec3 u_end_color;uniform float u_pixel_ratio;void main() {highp vec2 fragCoord=gl_FragCoord.xy/u_pixel_ratio;fragCoord.y=u_screen_size.y-fragCoord.y;float distFromCenter=length(fragCoord-u_center);float normDistFromCenter=length(fragCoord-u_center)/u_radius;if (normDistFromCenter < 1.0)\ndiscard;float t=clamp(1.0-sqrt(normDistFromCenter-1.0)/u_fadeout_range,0.0,1.0);vec3 color=mix(u_start_color,u_end_color,1.0-t);gl_FragColor=vec4(color*t*u_opacity,u_opacity);}","attribute vec3 a_pos;void main() {gl_Position=vec4(a_pos,1.0);}")};function He(t,e,i){const n=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,r=/uniform (highp |mediump |lowp )?([\w]+) ([\w]+)([\s]*)([\w]*)/g,o=e.match(/attribute (highp |mediump |lowp )?([\w]+) ([\w]+)/g),a=t.match(r),s=e.match(r),l=Ve.match(r);let c=s?s.concat(a):a;i||(Ze.staticUniforms&&(c=Ze.staticUniforms.concat(c)),$e.staticUniforms&&(c=$e.staticUniforms.concat(c))),c&&(c=c.concat(l));const u={};return{fragmentSource:t=t.replace(n,((t,e,i,n,r)=>(u[r]=!0,"define"===e?`\n#ifndef HAS_UNIFORM_u_${r}\nvarying ${i} ${n} ${r};\n#else\nuniform ${i} ${n} u_${r};\n#endif\n`:`\n#ifdef HAS_UNIFORM_u_${r}\n ${i} ${n} ${r} = u_${r};\n#endif\n`))),vertexSource:e=e.replace(n,((t,e,i,n,r)=>{const o="float"===n?"vec2":"vec4",a=r.match(/color/)?"color":o;return u[r]?"define"===e?`\n#ifndef HAS_UNIFORM_u_${r}\nuniform lowp float u_${r}_t;\nattribute ${i} ${o} a_${r};\nvarying ${i} ${n} ${r};\n#else\nuniform ${i} ${n} u_${r};\n#endif\n`:"vec4"===a?`\n#ifndef HAS_UNIFORM_u_${r}\n ${r} = a_${r};\n#else\n ${i} ${n} ${r} = u_${r};\n#endif\n`:`\n#ifndef HAS_UNIFORM_u_${r}\n ${r} = unpack_mix_${a}(a_${r}, u_${r}_t);\n#else\n ${i} ${n} ${r} = u_${r};\n#endif\n`:"define"===e?`\n#ifndef HAS_UNIFORM_u_${r}\nuniform lowp float u_${r}_t;\nattribute ${i} ${o} a_${r};\n#else\nuniform ${i} ${n} u_${r};\n#endif\n`:"vec4"===a?`\n#ifndef HAS_UNIFORM_u_${r}\n ${i} ${n} ${r} = a_${r};\n#else\n ${i} ${n} ${r} = u_${r};\n#endif\n`:`\n#ifndef HAS_UNIFORM_u_${r}\n ${i} ${n} ${r} = unpack_mix_${a}(a_${r}, u_${r}_t);\n#else\n ${i} ${n} ${r} = u_${r};\n#endif\n`})),staticAttributes:o,staticUniforms:c}}class Xe{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(t,e,i,n,r,o,a,s){this.context=t;let l=this.boundPaintVertexBuffers.length!==n.length;for(let t=0;!l&&t{const r=i.paint.get("hillshade-shadow-color"),o=i.paint.get("hillshade-highlight-color"),a=i.paint.get("hillshade-accent-color");let s=i.paint.get("hillshade-illumination-direction")*(Math.PI/180);"viewport"===i.paint.get("hillshade-illumination-anchor")&&(s-=t.transform.angle);const l=!t.options.moving;return{u_matrix:n||t.transform.calculateProjMatrix(e.tileID.toUnwrapped(),l),u_image:0,u_latrange:Ye(0,e.tileID),u_light:[i.paint.get("hillshade-exaggeration"),s],u_shadow:r,u_highlight:o,u_accent:a}})(e,n,r,e.terrain?i.projMatrix:null);e.prepareDrawProgram(l,d,i.toUnwrapped());const{tileBoundsBuffer:p,tileBoundsIndexBuffer:m,tileBoundsSegments:f}=e.getTileBoundsBuffers(n);d.draw(l,c.TRIANGLES,o,a,s,t.CullFaceMode.disabled,h,r.id,p,m,f)}function Je(e,i,n){if(!i.needsDEMTextureUpload)return;const r=e.context,o=r.gl;r.pixelStoreUnpackPremultiplyAlpha.set(!1),i.demTexture=i.demTexture||e.getTileTexture(n.stride);const a=n.getPixels();i.demTexture?i.demTexture.update(a,{premultiply:!1}):i.demTexture=new t.Texture(r,a,o.RGBA,{premultiply:!1}),i.needsDEMTextureUpload=!1}function Qe(e,i,n,r,o,a){const s=e.context,l=s.gl;if(!i.dem)return;const c=i.dem;if(s.activeTexture.set(l.TEXTURE1),Je(e,i,c),!i.demTexture)return;i.demTexture.bind(l.NEAREST,l.CLAMP_TO_EDGE);const u=c.dim;s.activeTexture.set(l.TEXTURE0);let d=i.fbo;if(!d){const e=new t.Texture(s,{width:u,height:u,data:null},l.RGBA);e.bind(l.LINEAR,l.CLAMP_TO_EDGE),d=i.fbo=s.createFramebuffer(u,u,!0),d.colorAttachment.set(e.texture)}s.bindFramebuffer.set(d.framebuffer),s.viewport.set([0,0,u,u]);const{tileBoundsBuffer:h,tileBoundsIndexBuffer:p,tileBoundsSegments:m}=e.getMercatorTileBoundsBuffers();e.useProgram("hillshadePrepare").draw(s,l.TRIANGLES,r,o,a,t.CullFaceMode.disabled,((e,i)=>{const n=i.stride,r=t.create();return t.ortho(r,0,t.EXTENT,-t.EXTENT,0,0,1),t.translate(r,r,[0,-t.EXTENT,0]),{u_matrix:r,u_image:1,u_dimension:[n,n],u_zoom:e.overscaledZ,u_unpack:i.unpackVector}})(i.tileID,c),n.id,h,p,m),i.needsHillshadePrepare=!1}const ti=(e,i)=>({u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_image0:new t.Uniform1i(e,i.u_image0),u_skirt_height:new t.Uniform1f(e,i.u_skirt_height)}),ei=(t,e)=>({u_matrix:t,u_image0:0,u_skirt_height:e}),ii=(t,e,i,n,r)=>({u_proj_matrix:Float32Array.from(t),u_globe_matrix:e,u_merc_matrix:i,u_zoom_transition:n,u_merc_center:r,u_image0:0});function ni(t,e){return null!=t&&null!=e&&!(!t.hasData()||!e.hasData())&&null!=t.demTexture&&null!=e.demTexture&&t.tileID.key!==e.tileID.key}const ri=new class{constructor(){this.operations={}}newMorphing(t,e,i,n,r){if(t in this.operations){const e=this.operations[t];e.to.tileID.key!==i.tileID.key&&(e.queued=i)}else this.operations[t]={startTime:n,phase:0,duration:r,from:e,to:i,queued:null}}getMorphValuesForProxy(t){if(!(t in this.operations))return null;const e=this.operations[t];return{from:e.from,to:e.to,phase:e.phase}}update(t){for(const e in this.operations){const i=this.operations[e];for(i.phase=(t-i.startTime)/i.duration;i.phase>=1||!this._validOp(i);)if(!this._nextOp(i,t)){delete this.operations[e];break}}}_nextOp(t,e){return!!t.queued&&(t.from=t.to,t.to=t.queued,t.queued=null,t.phase=0,t.startTime=e,!0)}_validOp(t){return t.from.hasData()&&t.to.hasData()}},oi={0:null,1:"TERRAIN_VERTEX_MORPHING",2:"TERRAIN_WIREFRAME"};function ai(t,e){const i=1<({u_matrix:t});function li(e,i,n,r,o){if(o>0){const a=t.exported.now(),s=(a-e.timeAdded)/o,l=i?(a-i.timeAdded)/o:-1,c=n.getSource(),u=r.coveringZoomLevel({tileSize:c.tileSize,roundZoom:c.roundZoom}),d=!i||Math.abs(i.tileID.overscaledZ-u)>Math.abs(e.tileID.overscaledZ-u),h=d&&e.refreshedUponExpiration?1:t.clamp(d?s:1-l,0,1);return e.refreshedUponExpiration&&s>=1&&(e.refreshedUponExpiration=!1),i?{opacity:1,mix:1-h}:{opacity:h,mix:0}}return{opacity:1,mix:0}}class ci extends t.SourceCache{constructor(t){const e={type:"raster-dem",maxzoom:t.transform.maxZoom},i=new T(At(),null),n=kt("mock-dem",e,i,t.style);super("mock-dem",n,!1),n.setEventedParent(this),this._sourceLoaded=!0}_loadTile(t,e){t.state="loaded",e(null)}}class ui extends t.SourceCache{constructor(t){const e=kt("proxy",{type:"geojson",maxzoom:t.transform.maxZoom},new T(At(),null),t.style);super("proxy",e,!1),e.setEventedParent(this),this.map=this.getSource().map=t,this.used=this._sourceLoaded=!0,this.renderCache=[],this.renderCachePool=[],this.proxyCachedFBO={}}update(e,i,n){if(e.freezeTileCoverage)return;this.transform=e;const r=e.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}).reduce(((i,n)=>{if(i[n.key]="",!this._tiles[n.key]){const i=new t.Tile(n,this._source.tileSize*n.overscaleFactor(),e.tileZoom);i.state="loaded",this._tiles[n.key]=i}return i}),{});for(const t in this._tiles)t in r||(this.freeFBO(t),this._tiles[t].unloadVectorData(),delete this._tiles[t])}freeFBO(t){const e=this.proxyCachedFBO[t];if(void 0!==e){const i=Object.values(e);this.renderCachePool.push(...i),delete this.proxyCachedFBO[t]}}deallocRenderCache(){this.renderCache.forEach((t=>t.fb.destroy())),this.renderCache=[],this.renderCachePool=[],this.proxyCachedFBO={}}}class di extends t.OverscaledTileID{constructor(t,e,i){super(t.overscaledZ,t.wrap,t.canonical.z,t.canonical.x,t.canonical.y),this.proxyTileKey=e,this.projMatrix=i}}class hi extends t.Elevation{constructor(e,i){super(),this.painter=e,this.terrainTileForTile={},this.prevTerrainTileForTile={};const[n,r,o]=function(e){const i=new t.StructArrayLayout4i8,n=new t.StructArrayLayout3ui6,r=131;i.reserve(17161),n.reserve(33800);const o=t.EXTENT/128,a=t.EXTENT+o/2,s=a+o;for(let e=-o;ea||e<0||e>a?24575:0,o=t.clamp(Math.round(n),0,t.EXTENT),s=t.clamp(Math.round(e),0,t.EXTENT);i.emplaceBack(o+r,s,o,s)}const l=(t,e)=>{const i=e*r+t;n.emplaceBack(i+1,i,i+r),n.emplaceBack(i+r,i+r+1,i+1)};for(let t=1;t<129;t++)for(let e=1;e<129;e++)l(e,t);return[0,129].forEach((t=>{for(let e=0;e<130;e++)l(e,t),l(t,e)})),[i,n,32768]}(),a=e.context;this.gridBuffer=a.createVertexBuffer(n,t.boundsAttributes.members),this.gridIndexBuffer=a.createIndexBuffer(r),this.gridSegments=t.SegmentVector.simpleSegment(0,0,n.length,r.length),this.gridNoSkirtSegments=t.SegmentVector.simpleSegment(0,0,n.length,o),this.proxyCoords=[],this.proxiedCoords={},this._visibleDemTiles=[],this._drapedRenderBatches=[],this._sourceTilesOverlap={},this.proxySourceCache=new ui(i.map),this.orthoMatrix=t.create(),t.ortho(this.orthoMatrix,0,t.EXTENT,0,t.EXTENT,0,1);const s=a.gl;this._overlapStencilMode=new t.StencilMode({func:s.GEQUAL,mask:255},0,255,s.KEEP,s.KEEP,s.REPLACE),this._previousZoom=e.transform.zoom,this.pool=[],this._findCoveringTileCache={},this._tilesDirty={},this.style=i,this._useVertexMorphing=!0,this._exaggeration=1,this._mockSourceCache=new ci(i.map)}set style(t){t.on("data",this._onStyleDataEvent.bind(this)),t.on("neworder",this._checkRenderCacheEfficiency.bind(this)),this._style=t,this._checkRenderCacheEfficiency()}update(e,i,n){if(e&&e.terrain){this._style!==e&&(this.style=e),this.enabled=!0;const r=e.terrain.properties;this.sourceCache=0===e.terrain.drapeRenderMode?this._mockSourceCache:e._getSourceCache(r.get("source")),this._exaggeration=r.get("exaggeration");const o=()=>{this.sourceCache.used&&t.warnOnce(`Raster DEM source '${this.sourceCache.id}' is used both for terrain and as layer source.\nThis leads to lower resolution of hillshade. For full hillshade resolution but higher memory consumption, define another raster DEM source.`);const e=this.getScaledDemTileSize();this.sourceCache.update(i,e,!0),this.resetTileLookupCache(this.sourceCache.id)};this.sourceCache.usedForTerrain||(this.resetTileLookupCache(this.sourceCache.id),this.sourceCache.usedForTerrain=!0,o(),this._initializing=!0),o(),i.updateElevation(!n),this.resetTileLookupCache(this.proxySourceCache.id),this.proxySourceCache.update(i),this._emptyDEMTextureDirty=!0}else this._disable()}resetTileLookupCache(t){this._findCoveringTileCache[t]={}}getScaledDemTileSize(){return this.sourceCache.getSource().tileSize/128*this.proxySourceCache.getSource().tileSize}_checkRenderCacheEfficiency(){const e=this.renderCacheEfficiency(this._style);this._style.map._optimizeForTerrain||100!==e.efficiency&&t.warnOnce(`Terrain render cache efficiency is not optimal (${e.efficiency}%) and performance\n may be affected negatively, consider placing all background, fill and line layers before layer\n with id '${e.firstUndrapedLayer}' or create a map using optimizeForTerrain: true option.`)}_onStyleDataEvent(t){t.coord&&"source"===t.dataType?this._clearRenderCacheForTile(t.sourceCacheId,t.coord):"style"===t.dataType&&(this._invalidateRenderCache=!0)}_disable(){if(this.enabled&&(this.enabled=!1,this._sharedDepthStencil=void 0,this.proxySourceCache.deallocRenderCache(),this._style))for(const t in this._style._sourceCaches)this._style._sourceCaches[t].usedForTerrain=!1}destroy(){this._disable(),this._emptyDEMTexture&&this._emptyDEMTexture.destroy(),this._emptyDepthBufferTexture&&this._emptyDepthBufferTexture.destroy(),this.pool.forEach((t=>t.fb.destroy())),this.pool=[],this._depthFBO&&(this._depthFBO.destroy(),delete this._depthFBO,delete this._depthTexture)}_source(){return this.enabled?this.sourceCache:null}exaggeration(){return this._exaggeration}get visibleDemTiles(){return this._visibleDemTiles}get drapeBufferSize(){const t=2*this.proxySourceCache.getSource().tileSize;return[t,t]}set useVertexMorphing(t){this._useVertexMorphing=t}updateTileBinding(e){if(!this.enabled)return;this.prevTerrainTileForTile=this.terrainTileForTile;const i=this.proxySourceCache,n=this.painter.transform;this._initializing&&(this._initializing=0===n._centerAltitude&&-1===this.getAtPointOrZero(t.MercatorCoordinate.fromLngLat(n.center),-1),this._emptyDEMTextureDirty=!this._initializing);const r=this.proxyCoords=i.getIds().map((t=>{const e=i.getTileByID(t).tileID;return e.projMatrix=n.calculateProjMatrix(e.toUnwrapped()),e}));!function(e,i){const n=i.transform.pointCoordinate(i.transform.getCameraPoint()),r=new t.pointGeometry(n.x,n.y);e.sort(((e,i)=>{if(i.overscaledZ-e.overscaledZ)return i.overscaledZ-e.overscaledZ;const n=new t.pointGeometry(e.canonical.x+(1<{this.proxyToSource[t.key]={}})),this.terrainTileForTile={};const a=this._style._sourceCaches;for(const t in a){const i=a[t];if(!i.used)continue;if(i!==this.sourceCache&&this.resetTileLookupCache(i.id),this._setupProxiedCoordsForOrtho(i,e[t],o),i.usedForTerrain)continue;const n=e[t];i.getSource().reparseOverscaled&&this._assignTerrainTiles(n)}this.proxiedCoords[i.id]=r.map((t=>new di(t,t.key,this.orthoMatrix))),this._assignTerrainTiles(r),this._prepareDEMTextures(),this._setupDrapedRenderBatches(),this._initFBOPool(),this._setupRenderCache(o),this.renderingToTexture=!1,this._updateTimestamp=t.exported.now();const s={};this._visibleDemTiles=[];for(const t of this.proxyCoords){const e=this.terrainTileForTile[t.key];if(!e)continue;const i=e.tileID.key;i in s||(this._visibleDemTiles.push(e),s[i]=i)}}_assignTerrainTiles(t){this._initializing||t.forEach((t=>{if(this.terrainTileForTile[t.key])return;const e=this._findTileCoveringTileID(t,this.sourceCache);e&&(this.terrainTileForTile[t.key]=e)}))}_prepareDEMTextures(){const t=this.painter.context,e=t.gl;for(const i in this.terrainTileForTile){const n=this.terrainTileForTile[i],r=n.dem;!r||n.demTexture&&!n.needsDEMTextureUpload||(t.activeTexture.set(e.TEXTURE1),Je(this.painter,n,r))}}_prepareDemTileUniforms(t,e,i,n){if(!e||null==e.demTexture)return!1;const r=t.tileID.canonical,o=Math.pow(2,e.tileID.canonical.z-r.z),a=n||"";return i[`u_dem_tl${a}`]=[r.x*o%1,r.y*o%1],i[`u_dem_scale${a}`]=o,!0}get emptyDEMTexture(){return!this._emptyDEMTextureDirty&&this._emptyDEMTexture?this._emptyDEMTexture:this._updateEmptyDEMTexture()}get emptyDepthBufferTexture(){const e=this.painter.context,i=e.gl;if(!this._emptyDepthBufferTexture){const n={width:1,height:1,data:new Uint8Array([255,255,255,255])};this._emptyDepthBufferTexture=new t.Texture(e,n,i.RGBA,{premultiply:!1})}return this._emptyDepthBufferTexture}_getLoadedAreaMinimum(){let t=0;const e=this._visibleDemTiles.reduce(((e,i)=>{if(!i.dem)return e;const n=i.dem.tree.minimums[0];return n>0&&t++,e+n}),0);return t?e/t:0}_updateEmptyDEMTexture(){const e=this.painter.context,i=e.gl;e.activeTexture.set(i.TEXTURE2);const n=this._getLoadedAreaMinimum(),r={width:1,height:1,data:new Uint8Array(t.DEMData.pack(n,this.sourceCache.getSource().encoding))};this._emptyDEMTextureDirty=!1;let o=this._emptyDEMTexture;return o?o.update(r,{premultiply:!1}):o=this._emptyDEMTexture=new t.Texture(e,r,i.RGBA,{premultiply:!1}),o}setupElevationDraw(e,i,n){const r=this.painter.context,o=r.gl,a=(s=this.sourceCache.getSource().encoding,{u_dem:2,u_dem_prev:4,u_dem_unpack:t.DEMData.getUnpackVector(s),u_dem_tl:[0,0],u_dem_tl_prev:[0,0],u_dem_scale:0,u_dem_scale_prev:0,u_dem_size:0,u_dem_lerp:1,u_depth:3,u_depth_size_inv:[0,0],u_exaggeration:0,u_tile_tl_up:[0,0,1],u_tile_tr_up:[0,0,1],u_tile_br_up:[0,0,1],u_tile_bl_up:[0,0,1],u_tile_up_scale:1});var s;a.u_dem_size=this.sourceCache.getSource().tileSize,a.u_exaggeration=this.exaggeration();const l=this.painter.transform,c=l.projection.createTileTransform(l,l.worldSize),u=e.tileID.canonical;a.u_tile_tl_up=c.upVector(u,0,0),a.u_tile_tr_up=c.upVector(u,t.EXTENT,0),a.u_tile_br_up=c.upVector(u,t.EXTENT,t.EXTENT),a.u_tile_bl_up=c.upVector(u,0,t.EXTENT),a.u_tile_up_scale=c.upVectorScale(u);let d=null,h=null,p=1;if(n&&n.morphing&&this._useVertexMorphing){const t=n.morphing.srcDemTile,i=n.morphing.dstDemTile;p=n.morphing.phase,t&&i&&(this._prepareDemTileUniforms(e,t,a,"_prev")&&(h=t),this._prepareDemTileUniforms(e,i,a)&&(d=i))}if(h&&d?(r.activeTexture.set(o.TEXTURE2),d.demTexture.bind(o.NEAREST,o.CLAMP_TO_EDGE,o.NEAREST),r.activeTexture.set(o.TEXTURE4),h.demTexture.bind(o.NEAREST,o.CLAMP_TO_EDGE,o.NEAREST),a.u_dem_lerp=p):(d=this.terrainTileForTile[e.tileID.key],r.activeTexture.set(o.TEXTURE2),(this._prepareDemTileUniforms(e,d,a)?d.demTexture:this.emptyDEMTexture).bind(o.NEAREST,o.CLAMP_TO_EDGE)),r.activeTexture.set(o.TEXTURE3),n&&n.useDepthForOcclusion?(this._depthTexture.bind(o.NEAREST,o.CLAMP_TO_EDGE),a.u_depth_size_inv=[1/this._depthFBO.width,1/this._depthFBO.height]):(this.emptyDepthBufferTexture.bind(o.NEAREST,o.CLAMP_TO_EDGE),a.u_depth_size_inv=[1,1]),n&&n.useMeterToDem&&d){const e=(1<{if(c===t)return;const n=[];i&&n.push(oi[u]),n.push(oi[t]),n.push("PROJECTION_GLOBE_VIEW"),l=e.useProgram("globeRaster",null,n),c=t},h=e.colorModeForRenderPass(),p=new t.DepthMode(s.LEQUAL,t.DepthMode.ReadWrite,e.depthRangeFor3D);ri.update(o);const m=e.transform,f=t.calculateGlobeMatrix(m,m.worldSize),g=t.calculateGlobeMercatorMatrix(m),v=[t.mercatorXfromLng(m.center.lng),t.mercatorYfromLat(m.center.lat)],y=e.globeSharedBuffers;(u?[!1,!0]:[!1]).forEach((u=>{c=-1;const _=u?s.LINES:s.TRIANGLES;for(const c of r){const r=n.getTile(c),x=Math.pow(2,c.canonical.z),[b,w]=t.globeBuffersForTileMesh(e,r,c,x),k=t.StencilMode.disabled,E=i.prevTerrainTileForTile[c.key],T=i.terrainTileForTile[c.key];ni(E,T)&&ri.newMorphing(c.key,E,T,o,250),a.activeTexture.set(s.TEXTURE0),r.texture.bind(s.LINEAR,s.CLAMP_TO_EDGE);const S=ri.getMorphValuesForProxy(c.key),C=S?1:0,M={};S&&t.extend$1(M,{morphing:{srcDemTile:S.from,dstDemTile:S.to,phase:t.easeCubicInOut(S.phase)}});const z=t.globeMatrixForTile(c.canonical,f),I=ii(m.projMatrix,z,g,t.globeToMercatorTransition(m.zoom),v);if(d(C,u),i.setupElevationDraw(r,l,M),e.prepareDrawProgram(a,l,c.toUnwrapped()),y){const[i,n]=u?y.getWirefameBuffer(e.context):[y.gridIndexBuffer,y.gridSegments];l.draw(a,_,p,k,h,t.CullFaceMode.backCCW,I,"globe_raster",b,i,n)}if(!u){const e=[0===c.canonical.y?t.globePoleMatrixForTile(c.canonical,!1,m):null,c.canonical.y===x-1?t.globePoleMatrixForTile(c.canonical,!0,m):null];for(const i of e){if(!i)continue;const e=ii(m.projMatrix,i,i,0,v);y&&l.draw(a,_,p,k,h,t.CullFaceMode.disabled,e,"globe_pole_raster",w,y.poleIndexBuffer,y.poleSegments)}}}}))}(e,i,n,r,o);else{const a=e.context,s=a.gl;let l,c;const u=e.options.showTerrainWireframe?2:0,d=(t,i)=>{if(c===t)return;const n=[oi[t]];i&&n.push(oi[u]),l=e.useProgram("terrainRaster",null,n),c=t},h=e.colorModeForRenderPass(),p=new t.DepthMode(s.LEQUAL,t.DepthMode.ReadWrite,e.depthRangeFor3D);ri.update(o);const m=e.transform,f=6*Math.pow(1.5,22-m.zoom)*i.exaggeration();(u?[!1,!0]:[!1]).forEach((u=>{c=-1;const g=u?s.LINES:s.TRIANGLES,[v,y]=u?i.getWirefameBuffer():[i.gridIndexBuffer,i.gridSegments];for(const c of r){const r=n.getTile(c),_=t.StencilMode.disabled,x=i.prevTerrainTileForTile[c.key],b=i.terrainTileForTile[c.key];ni(x,b)&&ri.newMorphing(c.key,x,b,o,250),a.activeTexture.set(s.TEXTURE0),r.texture.bind(s.LINEAR,s.CLAMP_TO_EDGE,s.LINEAR_MIPMAP_NEAREST);const w=ri.getMorphValuesForProxy(c.key),k=w?1:0;let E;w&&(E={morphing:{srcDemTile:w.from,dstDemTile:w.to,phase:t.easeCubicInOut(w.phase)}});const T=ei(c.projMatrix,ai(c.canonical,m.renderWorldCopies)?f/10:f);d(k,u),i.setupElevationDraw(r,l,E),e.prepareDrawProgram(a,l,c.toUnwrapped()),l.draw(a,g,p,_,h,t.CullFaceMode.backCCW,T,"terrain_raster",i.gridBuffer,v,y)}}))}}(i,this,this.proxySourceCache,e,this._updateTimestamp),this.renderingToTexture=!0,e.splice(0,e.length))}renderBatch(e){if(0===this._drapedRenderBatches.length)return e+1;this.renderingToTexture=!0;const i=this.painter,n=this.painter.context,r=this.proxySourceCache,o=this.proxiedCoords[r.id],a=this._drapedRenderBatches.shift(),s=[],l=i.style.order;let c=0;for(const u of o){const o=r.getTileByID(u.proxyTileKey),d=r.proxyCachedFBO[u.key]?r.proxyCachedFBO[u.key][e]:void 0,h=void 0!==d?r.renderCache[d]:this.pool[c++],p=void 0!==d;if(o.texture=h.tex,p&&!h.dirty){s.push(o.tileID);continue}let m;n.bindFramebuffer.set(h.fb.framebuffer),this.renderedToTile=!1,h.dirty&&(n.clear({color:t.Color.transparent,stencil:0}),h.dirty=!1);for(let t=a.start;t<=a.end;++t){const e=i.style._layers[l[t]];if(e.isHidden(i.transform.zoom))continue;const r=i.style._getLayerSourceCache(e),o=r?this.proxyToSource[u.key][r.id]:[u];if(!o)continue;const a=o;n.viewport.set([0,0,h.fb.width,h.fb.height]),m!==(r?r.id:null)&&(this._setupStencil(h,o,e,r),m=r?r.id:null),i.renderLayer(i,r,e,a)}this.renderedToTile?(h.dirty=!0,s.push(o.tileID)):p||--c,5===c&&(c=0,this.renderToBackBuffer(s))}return this.renderToBackBuffer(s),this.renderingToTexture=!1,n.bindFramebuffer.set(null),n.viewport.set([0,0,i.width,i.height]),a.end+1}postRender(){}renderCacheEfficiency(t){const e=t.order.length;if(0===e)return{efficiency:100};let i,n=0,r=0,o=!1;for(let a=0;at.dem)).forEach((e=>{t=Math.min(t,e.dem.tree.minimums[0])})),0===t?t:(t-30)*this._exaggeration}raycast(t,e,i){if(!this._visibleDemTiles)return null;const n=this._visibleDemTiles.filter((t=>t.dem)).map((n=>{const r=n.tileID,o=Math.pow(2,r.overscaledZ),{x:a,y:s}=r.canonical,l=a/o,c=(a+1)/o,u=s/o,d=(s+1)/o;return{minx:l,miny:u,maxx:c,maxy:d,t:n.dem.tree.raycastRoot(l,u,c,d,t,e,i),tile:n}}));n.sort(((t,e)=>(null!==t.t?t.t:Number.MAX_VALUE)-(null!==e.t?e.t:Number.MAX_VALUE)));for(const r of n){if(null==r.t)return null;const n=r.tile.dem.tree.raycast(r.minx,r.miny,r.maxx,r.maxy,t,e,i);if(null!=n)return n}return null}_createFBO(){const e=this.painter.context,i=e.gl,n=this.drapeBufferSize;e.activeTexture.set(i.TEXTURE0);const r=new t.Texture(e,{width:n[0],height:n[1],data:null},i.RGBA);r.bind(i.LINEAR,i.CLAMP_TO_EDGE);const o=e.createFramebuffer(n[0],n[1],!1);return o.colorAttachment.set(r.texture),o.depthAttachment=new dt(e,o.framebuffer),void 0===this._sharedDepthStencil?(this._sharedDepthStencil=e.createRenderbuffer(e.gl.DEPTH_STENCIL,n[0],n[1]),this._stencilRef=0,o.depthAttachment.set(this._sharedDepthStencil),e.clear({stencil:0})):o.depthAttachment.set(this._sharedDepthStencil),e.extTextureFilterAnisotropic&&!e.extTextureFilterAnisotropicForceOff&&i.texParameterf(i.TEXTURE_2D,e.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,e.extTextureFilterAnisotropicMax),{fb:o,tex:r,dirty:!1}}_initFBOPool(){for(;this.pool.length{const e=this._style._layers[t],i=e.isHidden(this.painter.transform.zoom),n=e.getCrossfadeParameters(),r=!!n&&1!==n.t,o=e.hasTransition();return"custom"!==e.type&&!i&&(r||o)}))}_clearRasterFadeFromRenderCache(){let t=!1;for(const e in this._style._sourceCaches)if(this._style._sourceCaches[e]._source instanceof yt){t=!0;break}if(t)for(let t=0;te.renderCachePool.length){const t=Object.values(e.proxyCachedFBO);e.proxyCachedFBO={};for(let i=0;i=0;r--){const o=i[r];if(e.getTileByID(o.key),void 0!==e.proxyCachedFBO[o.key]){const i=t[o.key],r=this.proxyToSource[o.key];let a=0;for(const t in r){const e=r[t],o=i[t];if(!o||o.length!==e.length||e.some(((e,i)=>e!==o[i]||n[t]&&n[t].hasOwnProperty(e.key)))){a=-1;break}++a}for(const t in e.proxyCachedFBO[o.key])e.renderCache[e.proxyCachedFBO[o.key][t]].dirty=a<0||a!==Object.values(i).length}}const r=[...this._drapedRenderBatches];r.sort(((t,e)=>e.end-e.start-(t.end-t.start)));for(const t of r)for(const n of i){if(e.proxyCachedFBO[n.key])continue;let i=e.renderCachePool.pop();void 0===i&&e.renderCache.length<50&&(i=e.renderCache.length,e.renderCache.push(this._createFBO())),void 0!==i&&(e.proxyCachedFBO[n.key]={},e.proxyCachedFBO[n.key][t.start]=i,e.renderCache[i].dirty=!0)}this._tilesDirty={}}_setupStencil(t,e,i,n){if(!n||!this._sourceTilesOverlap[n.id])return void(this._overlapStencilType&&(this._overlapStencilType=!1));const r=this.painter.context,o=r.gl;if(e.length<=1)return void(this._overlapStencilType=!1);let a;if(i.isTileClipped())a=e.length,this._overlapStencilMode.test={func:o.EQUAL,mask:255},this._overlapStencilType="Clip";else{if(!(e[0].overscaledZ>e[e.length-1].overscaledZ))return void(this._overlapStencilType=!1);a=1,this._overlapStencilMode.test={func:o.GREATER,mask:255},this._overlapStencilType="Mask"}this._stencilRef+a>255&&(r.clear({stencil:0}),this._stencilRef=0),this._stencilRef+=a,this._overlapStencilMode.ref=this._stencilRef,i.isTileClipped()&&this._renderTileClippingMasks(e,this._overlapStencilMode.ref)}clipOrMaskOverlapStencilType(){return"Clip"===this._overlapStencilType||"Mask"===this._overlapStencilType}stencilModeForRTTOverlap(e){return this.renderingToTexture&&this._overlapStencilType?("Clip"===this._overlapStencilType&&(this._overlapStencilMode.ref=this.painter._tileClippingMaskIDs[e.key]),this._overlapStencilMode):t.StencilMode.disabled}_renderTileClippingMasks(e,i){const n=this.painter,r=this.painter.context,o=r.gl;n._tileClippingMaskIDs={},r.setColorMode(t.ColorMode.disabled),r.setDepthMode(t.DepthMode.disabled);const a=n.useProgram("clippingMask");for(const s of e){const e=n._tileClippingMaskIDs[s.key]=--i;a.draw(r,o.TRIANGLES,t.DepthMode.disabled,new t.StencilMode({func:o.ALWAYS,mask:0},e,255,o.KEEP,o.KEEP,o.REPLACE),t.ColorMode.disabled,t.CullFaceMode.disabled,si(s.projMatrix),"$clipping",n.tileExtentBuffer,n.quadTriangleIndexBuffer,n.tileExtentSegments)}}pointCoordinate(e){const i=this.painter.transform;if(e.x<0||e.x>i.width||e.y<0||e.y>i.height)return null;const n=[e.x,e.y,1,1];t.transformMat4$1(n,n,i.pixelMatrixInverse),t.scale$1(n,n,1/n[3]),n[0]/=i.worldSize,n[1]/=i.worldSize;const r=i._camera.position,o=t.mercatorZfromAltitude(1,i.center.lat),a=[r[0],r[1],r[2]/o,0],s=t.subtract([],n.slice(0,3),a);t.normalize(s,s);const l=this.raycast(a,s,this._exaggeration);return null!==l&&l?(t.scaleAndAdd(a,a,s,l),a[3]=a[2],a[2]*=o,a):null}drawDepth(){const e=this.painter,i=e.context,n=this.proxySourceCache,r=Math.ceil(e.width),o=Math.ceil(e.height);if(!this._depthFBO||this._depthFBO.width===r&&this._depthFBO.height===o||(this._depthFBO.destroy(),delete this._depthFBO,delete this._depthTexture),!this._depthFBO){const e=i.gl,n=i.createFramebuffer(r,o,!0);i.activeTexture.set(e.TEXTURE0);const a=new t.Texture(i,{width:r,height:o,data:null},e.RGBA);a.bind(e.NEAREST,e.CLAMP_TO_EDGE),n.colorAttachment.set(a.texture);const s=i.createRenderbuffer(i.gl.DEPTH_COMPONENT16,r,o);n.depthAttachment.set(s),this._depthFBO=n,this._depthTexture=a}i.bindFramebuffer.set(this._depthFBO.framebuffer),i.viewport.set([0,0,r,o]),function(e,i,n,r){if("globe"===e.transform.projection.name)return;const o=e.context,a=o.gl;o.clear({depth:1});const s=e.useProgram("terrainDepth"),l=new t.DepthMode(a.LESS,t.DepthMode.ReadWrite,e.depthRangeFor3D);for(const e of r){const r=n.getTile(e),c=ei(e.projMatrix,0);i.setupElevationDraw(r,s),s.draw(o,a.TRIANGLES,l,t.StencilMode.disabled,t.ColorMode.unblended,t.CullFaceMode.backCCW,c,"terrain_depth",i.gridBuffer,i.gridIndexBuffer,i.gridNoSkirtSegments)}}(e,this,n,this.proxyCoords)}_setupProxiedCoordsForOrtho(t,e,i){if(t.getSource()instanceof bt)return this._setupProxiedCoordsForImageSource(t,e,i);this._findCoveringTileCache[t.id]=this._findCoveringTileCache[t.id]||{};const n=this.proxiedCoords[t.id]=[],r=this.proxyCoords;for(let e=0;e(t.min.x=Math.min(t.min.x,e.x-s.x),t.min.y=Math.min(t.min.y,e.y-s.y),t.max.x=Math.max(t.max.x,e.x-s.x),t.max.y=Math.max(t.max.y,e.y-s.y),t)),{min:new t.pointGeometry(Number.MAX_VALUE,Number.MAX_VALUE),max:new t.pointGeometry(-Number.MAX_VALUE,-Number.MAX_VALUE)}),c=(e,i)=>{const n=e.wrap+e.canonical.x/(1<a+l.max.x||r+os+l.max.y};for(let t=0;tt.key===i.tileID.key));if(t)return t}if(i.tileID.key!==e.key){const n=e.canonical.z-i.tileID.canonical.z;let o,a,s;r=t.create();const l=i.tileID.wrap-e.wrap<0?(o=t.EXTENT>>n,a=o*((i.tileID.canonical.x<=r){const n=e.canonical.z-r;i.getSource().reparseOverscaled?(s=Math.max(e.canonical.z+2,i.transform.tileZoom),a=new t.OverscaledTileID(s,e.wrap,r,e.canonical.x>>n,e.canonical.y>>n)):0!==n&&(s=r,a=new t.OverscaledTileID(s,e.wrap,r,e.canonical.x>>n,e.canonical.y>>n))}a.key!==e.key&&(c.push(a.key),n=i.getTile(a))}const u=t=>{c.forEach((e=>{r[e]=t})),c.length=0};for(s-=1;s>=l&&(!n||!n.hasData());s--){n&&u(n.tileID.key);const t=a.calculateScaledKey(s);if(n=i.getTileByID(t),n&&n.hasData())break;const e=r[t];if(null===e)break;void 0===e?c.push(t):n=i.getTileByID(e)}return u(n?n.tileID.key:null),n&&n.hasData()?n:null}findDEMTileFor(t){return this.enabled?this._findTileCoveringTileID(t,this.sourceCache):null}prepareDrawTile(t){this.renderedToTile=!0}_clearRenderCacheForTile(t,e){let i=this._tilesDirty[t];i||(i=this._tilesDirty[t]={}),i[e.key]=!0}getWirefameBuffer(){if(!this.wireframeSegments){const e=function(e){let i,n,r;const o=new t.StructArrayLayout2ui4,a=131;for(n=1;n<129;n++){for(i=1;i<129;i++)r=n*a+i,o.emplaceBack(r,r+1),o.emplaceBack(r,r+a),o.emplaceBack(r+1,r+a),128===n&&o.emplaceBack(r+a,r+a+1);o.emplaceBack(r+1,r+1+a)}return o}();this.wireframeIndexBuffer=this.painter.context.createIndexBuffer(e),this.wireframeSegments=t.SegmentVector.simpleSegment(0,0,this.gridBuffer.length,e.length)}return[this.wireframeIndexBuffer,this.wireframeSegments]}}function pi(t){const e=[];for(let i=0;i`#define ${t}`)));const g=f.concat("\n#ifdef GL_ES\nprecision mediump float;\n#else\n\n#if !defined(lowp)\n#define lowp\n#endif\n\n#if !defined(mediump)\n#define mediump\n#endif\n\n#if !defined(highp)\n#define highp\n#endif\n\n#endif",qe,Ge.fragmentSource,$e.fragmentSource,n.fragmentSource).join("\n"),v=f.concat("\n#ifdef GL_ES\nprecision highp float;\n#else\n\n#if !defined(lowp)\n#define lowp\n#endif\n\n#if !defined(mediump)\n#define mediump\n#endif\n\n#if !defined(highp)\n#define highp\n#endif\n\n#endif",qe,Ge.vertexSource,$e.vertexSource,Ze.vertexSource,n.vertexSource).join("\n"),y=s.createShader(s.FRAGMENT_SHADER);if(s.isContextLost())return void(this.failedToCreate=!0);s.shaderSource(y,g),s.compileShader(y),s.attachShader(this.program,y);const _=s.createShader(s.VERTEX_SHADER);if(s.isContextLost())return void(this.failedToCreate=!0);s.shaderSource(_,v),s.compileShader(_),s.attachShader(this.program,_),this.attributes={};const x={};this.numAttributes=u.length;for(let t=0;t({u_dem:new t.Uniform1i(e,i.u_dem),u_dem_prev:new t.Uniform1i(e,i.u_dem_prev),u_dem_unpack:new t.Uniform4f(e,i.u_dem_unpack),u_dem_tl:new t.Uniform2f(e,i.u_dem_tl),u_dem_scale:new t.Uniform1f(e,i.u_dem_scale),u_dem_tl_prev:new t.Uniform2f(e,i.u_dem_tl_prev),u_dem_scale_prev:new t.Uniform1f(e,i.u_dem_scale_prev),u_dem_size:new t.Uniform1f(e,i.u_dem_size),u_dem_lerp:new t.Uniform1f(e,i.u_dem_lerp),u_exaggeration:new t.Uniform1f(e,i.u_exaggeration),u_depth:new t.Uniform1i(e,i.u_depth),u_depth_size_inv:new t.Uniform2f(e,i.u_depth_size_inv),u_meter_to_dem:new t.Uniform1f(e,i.u_meter_to_dem),u_label_plane_matrix_inv:new t.UniformMatrix4f(e,i.u_label_plane_matrix_inv),u_tile_tl_up:new t.Uniform3f(e,i.u_tile_tl_up),u_tile_tr_up:new t.Uniform3f(e,i.u_tile_tr_up),u_tile_br_up:new t.Uniform3f(e,i.u_tile_br_up),u_tile_bl_up:new t.Uniform3f(e,i.u_tile_bl_up),u_tile_up_scale:new t.Uniform1f(e,i.u_tile_up_scale)}))(e,x)),-1!==a.indexOf("FOG")&&(this.fogUniforms=((e,i)=>({u_fog_matrix:new t.UniformMatrix4f(e,i.u_fog_matrix),u_fog_range:new t.Uniform2f(e,i.u_fog_range),u_fog_color:new t.Uniform4f(e,i.u_fog_color),u_fog_horizon_blend:new t.Uniform1f(e,i.u_fog_horizon_blend),u_fog_temporal_offset:new t.Uniform1f(e,i.u_fog_temporal_offset)}))(e,x))}setTerrainUniformValues(t,e){if(!this.terrainUniforms)return;const i=this.terrainUniforms;if(!this.failedToCreate){t.program.set(this.program);for(const t in e)i[t].set(e[t])}}setFogUniformValues(t,e){if(!this.fogUniforms)return;const i=this.fogUniforms;if(!this.failedToCreate){t.program.set(this.program);for(const t in e)i[t].location&&i[t].set(e[t])}}draw(t,e,i,n,r,o,a,s,l,c,u,d,h,p,m,f){const g=t.gl;if(this.failedToCreate)return;t.program.set(this.program),t.setDepthMode(i),t.setStencilMode(n),t.setColorMode(r),t.setCullFace(o);for(const t of Object.keys(this.fixedUniforms))this.fixedUniforms[t].set(a[t]);p&&p.setUniforms(t,this.binderUniforms,d,{zoom:h});const v={[g.LINES]:2,[g.TRIANGLES]:3,[g.LINE_STRIP]:1}[e];for(const i of u.get()){const n=i.vaos||(i.vaos={});(n[s]||(n[s]=new Xe)).bind(t,this,l,p?p.getPaintVertexBuffers():[],c,i.vertexOffset,m,f),g.drawElements(e,i.primitiveLength*v,g.UNSIGNED_SHORT,i.primitiveOffset*v*2)}}}function fi(t,e,i){const n=1/S(i,1,e.transform.tileZoom),r=Math.pow(2,i.tileID.overscaledZ),o=i.tileSize*Math.pow(2,e.transform.tileZoom)/r,a=o*(i.tileID.canonical.x+i.tileID.wrap*r),s=o*i.tileID.canonical.y;return{u_image:0,u_texsize:i.imageAtlasTexture.size,u_scale:[n,t.fromScale,t.toScale],u_fade:t.t,u_pixel_coord_upper:[a>>16,s>>16],u_pixel_coord_lower:[65535&a,65535&s]}}const gi=(e,i,n,r)=>{const o=i.style.light,a=o.properties.get("position"),s=[a.x,a.y,a.z],l=t.create$1();"viewport"===o.properties.get("anchor")&&(t.fromRotation(l,-i.transform.angle),t.transformMat3(s,s,l));const c=o.properties.get("color");return{u_matrix:e,u_lightpos:s,u_lightintensity:o.properties.get("intensity"),u_lightcolor:[c.r,c.g,c.b],u_vertical_gradient:+n,u_opacity:r}},vi=(e,i,n,r,o,a,s)=>t.extend(gi(e,i,n,r),fi(a,i,s),{u_height_factor:-Math.pow(2,o.overscaledZ)/s.tileSize/8}),yi=t=>({u_matrix:t}),_i=(e,i,n,r)=>t.extend(yi(e),fi(n,i,r)),xi=(t,e)=>({u_matrix:t,u_world:e}),bi=(e,i,n,r,o)=>t.extend(_i(e,i,n,r),{u_world:o}),wi=(e,i,n,r)=>{const o=e.transform;let a;return a="map"===r.paint.get("circle-pitch-alignment")?o.calculatePixelsToTileUnitsMatrix(n):new Float32Array([o.pixelsToGLUnits[0],0,0,o.pixelsToGLUnits[1]]),{u_camera_to_center_distance:o.cameraToCenterDistance,u_matrix:e.translatePosMatrix(i.projMatrix,n,r.paint.get("circle-translate"),r.paint.get("circle-translate-anchor")),u_device_pixel_ratio:t.exported.devicePixelRatio,u_extrude_scale:a}},ki=t=>{const e=[];return"map"===t.paint.get("circle-pitch-alignment")&&e.push("PITCH_WITH_MAP"),"map"===t.paint.get("circle-pitch-scale")&&e.push("SCALE_WITH_MAP"),e},Ei=(e,i,n)=>{const r=t.EXTENT/n.tileSize;return{u_matrix:e,u_camera_to_center_distance:i.cameraToCenterDistance,u_extrude_scale:[i.pixelsToGLUnits[0]/r,i.pixelsToGLUnits[1]/r]}},Ti=(t,e,i=1)=>({u_matrix:t,u_color:e,u_overlay:0,u_overlay_scale:i}),Si=(t,e,i,n)=>({u_matrix:t,u_extrude_scale:S(e,1,i),u_intensity:n}),Ci=(e,i,n,r,o,a)=>{const s=e.transform,l=s.calculatePixelsToTileUnitsMatrix(i),c={u_matrix:Ii(e,i,n,o),u_pixels_to_tile_units:l,u_device_pixel_ratio:t.exported.devicePixelRatio,u_units_to_pixels:[1/s.pixelsToGLUnits[0],1/s.pixelsToGLUnits[1]],u_dash_image:0,u_gradient_image:1,u_image_height:a,u_texsize:[0,0],u_scale:[0,0,0],u_mix:0,u_alpha_discard_threshold:0};if(Pi(n)){const t=zi(i,e.transform);c.u_texsize=i.lineAtlasTexture.size,c.u_scale=[t,r.fromScale,r.toScale],c.u_mix=r.t}return c},Mi=(e,i,n,r,o)=>{const a=e.transform,s=zi(i,a);return{u_matrix:Ii(e,i,n,o),u_texsize:i.imageAtlasTexture.size,u_pixels_to_tile_units:a.calculatePixelsToTileUnitsMatrix(i),u_device_pixel_ratio:t.exported.devicePixelRatio,u_image:0,u_scale:[s,r.fromScale,r.toScale],u_fade:r.t,u_units_to_pixels:[1/a.pixelsToGLUnits[0],1/a.pixelsToGLUnits[1]],u_alpha_discard_threshold:0}};function zi(t,e){return 1/S(t,1,e.tileZoom)}function Ii(t,e,i,n){return t.translatePosMatrix(n||e.tileID.projMatrix,e,i.paint.get("line-translate"),i.paint.get("line-translate-anchor"))}function Pi(t){const e=t.paint.get("line-dasharray").value;return e.value||"constant"!==e.kind}const Ai=(t,e,i,n,r,o)=>{return{u_matrix:t,u_tl_parent:e,u_scale_parent:i,u_fade_t:n.mix,u_opacity:n.opacity*r.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:r.paint.get("raster-brightness-min"),u_brightness_high:r.paint.get("raster-brightness-max"),u_saturation_factor:(s=r.paint.get("raster-saturation"),s>0?1-1/(1.001-s):-s),u_contrast_factor:(a=r.paint.get("raster-contrast"),a>0?1/(1-a):1+a),u_spin_weights:Di(r.paint.get("raster-hue-rotate")),u_perspective_transform:o};var a,s};function Di(t){t*=Math.PI/180;const e=Math.sin(t),i=Math.cos(t);return[(2*i+1)/3,(-Math.sqrt(3)*e-i+1)/3,(Math.sqrt(3)*e-i+1)/3]}const Oi=(t,e,i,n,r,o,a,s,l,c,u,d,h,p)=>{const m=r.transform;return{u_is_size_zoom_constant:+("constant"===t||"source"===t),u_is_size_feature_constant:+("constant"===t||"camera"===t),u_size_t:e?e.uSizeT:0,u_size:e?e.uSize:0,u_camera_to_center_distance:m.cameraToCenterDistance,u_pitch:m.pitch/360*2*Math.PI,u_rotate_symbol:+i,u_aspect_ratio:m.width/m.height,u_fade_change:r.options.fadeDuration?r.symbolFadeChange:1,u_matrix:o,u_label_plane_matrix:a,u_coord_matrix:s,u_is_text:+l,u_pitch_with_map:+n,u_texsize:c,u_tile_id:u,u_zoom_transition:d,u_inv_rot_matrix:h,u_merc_center:p,u_texture:0}},Li=(e,i,n,r,o,a,s,l,c,u,d,h,p,m,f)=>{const{cameraToCenterDistance:g,_pitch:v}=o.transform;return t.extend(Oi(e,i,n,r,o,a,s,l,c,u,h,p,m,f),{u_gamma_scale:r?g*Math.cos(o.terrain?0:v):1,u_device_pixel_ratio:t.exported.devicePixelRatio,u_is_halo:+d})},Ri=(e,i,n,r,o,a,s,l,c,u,d,h,p,m)=>t.extend(Li(e,i,n,r,o,a,s,l,!0,c,!0,d,h,p,m),{u_texsize_icon:u,u_texture_icon:1}),Bi=(t,e,i)=>({u_matrix:t,u_opacity:e,u_color:i}),Fi=(e,i,n,r,o,a)=>t.extend(function(t,e,i,n){const r=i.imageManager.getPattern(t.from.toString()),o=i.imageManager.getPattern(t.to.toString()),{width:a,height:s}=i.imageManager.getPixelSize(),l=Math.pow(2,n.tileID.overscaledZ),c=n.tileSize*Math.pow(2,i.transform.tileZoom)/l,u=c*(n.tileID.canonical.x+n.tileID.wrap*l),d=c*n.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:r.tl,u_pattern_br_a:r.br,u_pattern_tl_b:o.tl,u_pattern_br_b:o.br,u_texsize:[a,s],u_mix:e.t,u_pattern_size_a:r.displaySize,u_pattern_size_b:o.displaySize,u_scale_a:e.fromScale,u_scale_b:e.toScale,u_tile_units_to_pixels:1/S(n,1,i.transform.tileZoom),u_pixel_coord_upper:[u>>16,d>>16],u_pixel_coord_lower:[65535&u,65535&d]}}(r,a,n,o),{u_matrix:e,u_opacity:i}),ji={fillExtrusion:(e,i)=>({u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_lightpos:new t.Uniform3f(e,i.u_lightpos),u_lightintensity:new t.Uniform1f(e,i.u_lightintensity),u_lightcolor:new t.Uniform3f(e,i.u_lightcolor),u_vertical_gradient:new t.Uniform1f(e,i.u_vertical_gradient),u_opacity:new t.Uniform1f(e,i.u_opacity)}),fillExtrusionPattern:(e,i)=>({u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_lightpos:new t.Uniform3f(e,i.u_lightpos),u_lightintensity:new t.Uniform1f(e,i.u_lightintensity),u_lightcolor:new t.Uniform3f(e,i.u_lightcolor),u_vertical_gradient:new t.Uniform1f(e,i.u_vertical_gradient),u_height_factor:new t.Uniform1f(e,i.u_height_factor),u_image:new t.Uniform1i(e,i.u_image),u_texsize:new t.Uniform2f(e,i.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,i.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,i.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,i.u_scale),u_fade:new t.Uniform1f(e,i.u_fade),u_opacity:new t.Uniform1f(e,i.u_opacity)}),fill:(e,i)=>({u_matrix:new t.UniformMatrix4f(e,i.u_matrix)}),fillPattern:(e,i)=>({u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_image:new t.Uniform1i(e,i.u_image),u_texsize:new t.Uniform2f(e,i.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,i.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,i.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,i.u_scale),u_fade:new t.Uniform1f(e,i.u_fade)}),fillOutline:(e,i)=>({u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_world:new t.Uniform2f(e,i.u_world)}),fillOutlinePattern:(e,i)=>({u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_world:new t.Uniform2f(e,i.u_world),u_image:new t.Uniform1i(e,i.u_image),u_texsize:new t.Uniform2f(e,i.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,i.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,i.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,i.u_scale),u_fade:new t.Uniform1f(e,i.u_fade)}),circle:(e,i)=>({u_camera_to_center_distance:new t.Uniform1f(e,i.u_camera_to_center_distance),u_extrude_scale:new t.UniformMatrix2f(e,i.u_extrude_scale),u_device_pixel_ratio:new t.Uniform1f(e,i.u_device_pixel_ratio),u_matrix:new t.UniformMatrix4f(e,i.u_matrix)}),collisionBox:(e,i)=>({u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_camera_to_center_distance:new t.Uniform1f(e,i.u_camera_to_center_distance),u_extrude_scale:new t.Uniform2f(e,i.u_extrude_scale)}),collisionCircle:(e,i)=>({u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_inv_matrix:new t.UniformMatrix4f(e,i.u_inv_matrix),u_camera_to_center_distance:new t.Uniform1f(e,i.u_camera_to_center_distance),u_viewport_size:new t.Uniform2f(e,i.u_viewport_size)}),debug:(e,i)=>({u_color:new t.UniformColor(e,i.u_color),u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_overlay:new t.Uniform1i(e,i.u_overlay),u_overlay_scale:new t.Uniform1f(e,i.u_overlay_scale)}),clippingMask:(e,i)=>({u_matrix:new t.UniformMatrix4f(e,i.u_matrix)}),heatmap:(e,i)=>({u_extrude_scale:new t.Uniform1f(e,i.u_extrude_scale),u_intensity:new t.Uniform1f(e,i.u_intensity),u_matrix:new t.UniformMatrix4f(e,i.u_matrix)}),heatmapTexture:(e,i)=>({u_image:new t.Uniform1i(e,i.u_image),u_color_ramp:new t.Uniform1i(e,i.u_color_ramp),u_opacity:new t.Uniform1f(e,i.u_opacity)}),hillshade:(e,i)=>({u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_image:new t.Uniform1i(e,i.u_image),u_latrange:new t.Uniform2f(e,i.u_latrange),u_light:new t.Uniform2f(e,i.u_light),u_shadow:new t.UniformColor(e,i.u_shadow),u_highlight:new t.UniformColor(e,i.u_highlight),u_accent:new t.UniformColor(e,i.u_accent)}),hillshadePrepare:(e,i)=>({u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_image:new t.Uniform1i(e,i.u_image),u_dimension:new t.Uniform2f(e,i.u_dimension),u_zoom:new t.Uniform1f(e,i.u_zoom),u_unpack:new t.Uniform4f(e,i.u_unpack)}),line:(e,i)=>({u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_pixels_to_tile_units:new t.UniformMatrix2f(e,i.u_pixels_to_tile_units),u_device_pixel_ratio:new t.Uniform1f(e,i.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,i.u_units_to_pixels),u_dash_image:new t.Uniform1i(e,i.u_dash_image),u_gradient_image:new t.Uniform1i(e,i.u_gradient_image),u_image_height:new t.Uniform1f(e,i.u_image_height),u_texsize:new t.Uniform2f(e,i.u_texsize),u_scale:new t.Uniform3f(e,i.u_scale),u_mix:new t.Uniform1f(e,i.u_mix),u_alpha_discard_threshold:new t.Uniform1f(e,i.u_alpha_discard_threshold)}),linePattern:(e,i)=>({u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_texsize:new t.Uniform2f(e,i.u_texsize),u_pixels_to_tile_units:new t.UniformMatrix2f(e,i.u_pixels_to_tile_units),u_device_pixel_ratio:new t.Uniform1f(e,i.u_device_pixel_ratio),u_image:new t.Uniform1i(e,i.u_image),u_units_to_pixels:new t.Uniform2f(e,i.u_units_to_pixels),u_scale:new t.Uniform3f(e,i.u_scale),u_fade:new t.Uniform1f(e,i.u_fade),u_alpha_discard_threshold:new t.Uniform1f(e,i.u_alpha_discard_threshold)}),raster:(e,i)=>({u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_tl_parent:new t.Uniform2f(e,i.u_tl_parent),u_scale_parent:new t.Uniform1f(e,i.u_scale_parent),u_fade_t:new t.Uniform1f(e,i.u_fade_t),u_opacity:new t.Uniform1f(e,i.u_opacity),u_image0:new t.Uniform1i(e,i.u_image0),u_image1:new t.Uniform1i(e,i.u_image1),u_brightness_low:new t.Uniform1f(e,i.u_brightness_low),u_brightness_high:new t.Uniform1f(e,i.u_brightness_high),u_saturation_factor:new t.Uniform1f(e,i.u_saturation_factor),u_contrast_factor:new t.Uniform1f(e,i.u_contrast_factor),u_spin_weights:new t.Uniform3f(e,i.u_spin_weights),u_perspective_transform:new t.Uniform2f(e,i.u_perspective_transform)}),symbolIcon:(e,i)=>({u_is_size_zoom_constant:new t.Uniform1i(e,i.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,i.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,i.u_size_t),u_size:new t.Uniform1f(e,i.u_size),u_camera_to_center_distance:new t.Uniform1f(e,i.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,i.u_pitch),u_rotate_symbol:new t.Uniform1i(e,i.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,i.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,i.u_fade_change),u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,i.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,i.u_coord_matrix),u_is_text:new t.Uniform1i(e,i.u_is_text),u_pitch_with_map:new t.Uniform1i(e,i.u_pitch_with_map),u_texsize:new t.Uniform2f(e,i.u_texsize),u_tile_id:new t.Uniform3f(e,i.u_tile_id),u_zoom_transition:new t.Uniform1f(e,i.u_zoom_transition),u_inv_rot_matrix:new t.UniformMatrix4f(e,i.u_inv_rot_matrix),u_merc_center:new t.Uniform2f(e,i.u_merc_center),u_texture:new t.Uniform1i(e,i.u_texture)}),symbolSDF:(e,i)=>({u_is_size_zoom_constant:new t.Uniform1i(e,i.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,i.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,i.u_size_t),u_size:new t.Uniform1f(e,i.u_size),u_camera_to_center_distance:new t.Uniform1f(e,i.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,i.u_pitch),u_rotate_symbol:new t.Uniform1i(e,i.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,i.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,i.u_fade_change),u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,i.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,i.u_coord_matrix),u_is_text:new t.Uniform1i(e,i.u_is_text),u_pitch_with_map:new t.Uniform1i(e,i.u_pitch_with_map),u_texsize:new t.Uniform2f(e,i.u_texsize),u_texture:new t.Uniform1i(e,i.u_texture),u_gamma_scale:new t.Uniform1f(e,i.u_gamma_scale),u_device_pixel_ratio:new t.Uniform1f(e,i.u_device_pixel_ratio),u_tile_id:new t.Uniform3f(e,i.u_tile_id),u_zoom_transition:new t.Uniform1f(e,i.u_zoom_transition),u_inv_rot_matrix:new t.UniformMatrix4f(e,i.u_inv_rot_matrix),u_merc_center:new t.Uniform2f(e,i.u_merc_center),u_is_halo:new t.Uniform1i(e,i.u_is_halo)}),symbolTextAndIcon:(e,i)=>({u_is_size_zoom_constant:new t.Uniform1i(e,i.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,i.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,i.u_size_t),u_size:new t.Uniform1f(e,i.u_size),u_camera_to_center_distance:new t.Uniform1f(e,i.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,i.u_pitch),u_rotate_symbol:new t.Uniform1i(e,i.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,i.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,i.u_fade_change),u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,i.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,i.u_coord_matrix),u_is_text:new t.Uniform1i(e,i.u_is_text),u_pitch_with_map:new t.Uniform1i(e,i.u_pitch_with_map),u_texsize:new t.Uniform2f(e,i.u_texsize),u_texsize_icon:new t.Uniform2f(e,i.u_texsize_icon),u_texture:new t.Uniform1i(e,i.u_texture),u_texture_icon:new t.Uniform1i(e,i.u_texture_icon),u_gamma_scale:new t.Uniform1f(e,i.u_gamma_scale),u_device_pixel_ratio:new t.Uniform1f(e,i.u_device_pixel_ratio),u_is_halo:new t.Uniform1i(e,i.u_is_halo)}),background:(e,i)=>({u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_opacity:new t.Uniform1f(e,i.u_opacity),u_color:new t.UniformColor(e,i.u_color)}),backgroundPattern:(e,i)=>({u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_opacity:new t.Uniform1f(e,i.u_opacity),u_image:new t.Uniform1i(e,i.u_image),u_pattern_tl_a:new t.Uniform2f(e,i.u_pattern_tl_a),u_pattern_br_a:new t.Uniform2f(e,i.u_pattern_br_a),u_pattern_tl_b:new t.Uniform2f(e,i.u_pattern_tl_b),u_pattern_br_b:new t.Uniform2f(e,i.u_pattern_br_b),u_texsize:new t.Uniform2f(e,i.u_texsize),u_mix:new t.Uniform1f(e,i.u_mix),u_pattern_size_a:new t.Uniform2f(e,i.u_pattern_size_a),u_pattern_size_b:new t.Uniform2f(e,i.u_pattern_size_b),u_scale_a:new t.Uniform1f(e,i.u_scale_a),u_scale_b:new t.Uniform1f(e,i.u_scale_b),u_pixel_coord_upper:new t.Uniform2f(e,i.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,i.u_pixel_coord_lower),u_tile_units_to_pixels:new t.Uniform1f(e,i.u_tile_units_to_pixels)}),terrainRaster:ti,terrainDepth:ti,skybox:(e,i)=>({u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_sun_direction:new t.Uniform3f(e,i.u_sun_direction),u_cubemap:new t.Uniform1i(e,i.u_cubemap),u_opacity:new t.Uniform1f(e,i.u_opacity),u_temporal_offset:new t.Uniform1f(e,i.u_temporal_offset)}),skyboxGradient:(e,i)=>({u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_color_ramp:new t.Uniform1i(e,i.u_color_ramp),u_center_direction:new t.Uniform3f(e,i.u_center_direction),u_radius:new t.Uniform1f(e,i.u_radius),u_opacity:new t.Uniform1f(e,i.u_opacity),u_temporal_offset:new t.Uniform1f(e,i.u_temporal_offset)}),skyboxCapture:(e,i)=>({u_matrix_3f:new t.UniformMatrix3f(e,i.u_matrix_3f),u_sun_direction:new t.Uniform3f(e,i.u_sun_direction),u_sun_intensity:new t.Uniform1f(e,i.u_sun_intensity),u_color_tint_r:new t.Uniform4f(e,i.u_color_tint_r),u_color_tint_m:new t.Uniform4f(e,i.u_color_tint_m),u_luminance:new t.Uniform1f(e,i.u_luminance)}),globeRaster:(e,i)=>({u_proj_matrix:new t.UniformMatrix4f(e,i.u_proj_matrix),u_globe_matrix:new t.UniformMatrix4f(e,i.u_globe_matrix),u_merc_matrix:new t.UniformMatrix4f(e,i.u_merc_matrix),u_zoom_transition:new t.Uniform1f(e,i.u_zoom_transition),u_merc_center:new t.Uniform2f(e,i.u_merc_center),u_image0:new t.Uniform1i(e,i.u_image0)}),globeAtmosphere:(e,i)=>({u_center:new t.Uniform2f(e,i.u_center),u_radius:new t.Uniform1f(e,i.u_radius),u_screen_size:new t.Uniform2f(e,i.u_screen_size),u_pixel_ratio:new t.Uniform1f(e,i.u_pixel_ratio),u_opacity:new t.Uniform1f(e,i.u_opacity),u_fadeout_range:new t.Uniform1f(e,i.u_fadeout_range),u_start_color:new t.Uniform3f(e,i.u_start_color),u_end_color:new t.Uniform3f(e,i.u_end_color)})};let Ni;function Vi(e,i,n,r,o,a,s){const l=e.context,c=l.gl,u=e.useProgram("collisionBox"),d=[];let h=0,p=0;for(let m=0;m0){const i=t.create(),n=y;t.mul(i,v.placementInvProjMatrix,e.transform.glCoordMatrix),t.mul(i,i,v.placementViewportMatrix),d.push({circleArray:x,circleOffset:p,transform:n,invTransform:i}),h+=x.length/4,p=h}_&&(e.terrain&&e.terrain.setupElevationDraw(g,u),u.draw(l,c.LINES,t.DepthMode.disabled,t.StencilMode.disabled,e.colorModeForRenderPass(),t.CullFaceMode.disabled,Ei(y,e.transform,g),n.id,_.layoutVertexBuffer,_.indexBuffer,_.segments,null,e.transform.zoom,null,_.collisionVertexBuffer,_.collisionVertexBufferExt))}if(!s||!d.length)return;const m=e.useProgram("collisionCircle"),f=new t.StructArrayLayout2f1f2i16;f.resize(4*h),f._trim();let g=0;for(const t of d)for(let e=0;e[0,0,0];m.clear();for(let l=0;l=0&&(g[h.associatedIconIndex]={shiftedAnchor:C,angle:M})}else oe(h.numGlyphs,m)}if(d){f.clear();const i=e.icon.placedSymbolArray;for(let e=0;e[0,0,0];Kt(c,l.projMatrix,e,o,N,U,y,u,i,l)}const G=e.translatePosMatrix(l.projMatrix,r,a,s),q=_||o&&T||$?Ui:N,W=e.translatePosMatrix(U,r,a,s,!0),H=p&&0!==n.paint.get(o?"text-halo-width":"icon-halo-width").constantOr(1);let X;const Y=g.createInversionMatrix(l.toUnwrapped());X=p?c.iconsInText?Ri(k.kind,P,x,y,e,G,q,W,D,B,A,C,Y,E):Li(k.kind,P,x,y,e,G,q,W,o,D,!0,A,C,Y,E):Oi(k.kind,P,x,y,e,G,q,W,o,D,A,C,Y,E);const K={program:I,buffers:d,uniformValues:X,atlasTexture:O,atlasTextureIcon:F,atlasInterpolation:L,atlasInterpolationIcon:R,isSDF:p,hasHalo:H,tile:r,labelPlaneMatrixInv:V};if(b&&c.canOverlap){w=!0;const e=d.segments.get();for(const i of e)M.push({segments:new t.SegmentVector([i]),sortKey:i.sortKey,state:K})}else M.push({segments:d.segments,sortKey:0,state:K})}w&&M.sort(((t,e)=>t.sortKey-e.sortKey));for(const t of M){const i=t.state;if(e.terrain&&e.terrain.setupElevationDraw(i.tile,i.program,{useDepthForOcclusion:!S,labelPlaneMatrixInv:i.labelPlaneMatrixInv}),p.activeTexture.set(m.TEXTURE0),i.atlasTexture.bind(i.atlasInterpolation,m.CLAMP_TO_EDGE),i.atlasTextureIcon&&(p.activeTexture.set(m.TEXTURE1),i.atlasTextureIcon&&i.atlasTextureIcon.bind(i.atlasInterpolationIcon,m.CLAMP_TO_EDGE)),i.isSDF){const r=i.uniformValues;i.hasHalo&&(r.u_is_halo=1,Wi(i.buffers,t.segments,n,e,i.program,k,d,h,r)),r.u_is_halo=0}Wi(i.buffers,t.segments,n,e,i.program,k,d,h,i.uniformValues)}}function Wi(e,i,n,r,o,a,s,l,c){const u=r.context;o.draw(u,u.gl.TRIANGLES,a,s,l,t.CullFaceMode.disabled,c,n.id,e.layoutVertexBuffer,e.indexBuffer,i,n.paint,r.transform.zoom,e.programConfigurations.get(n.id),e.dynamicLayoutVertexBuffer,e.opacityVertexBuffer)}function Hi(e,i,n,r,o,a,s){const l=e.context.gl,c=n.paint.get("fill-pattern"),u=c&&c.constantOr(1),d=n.getCrossfadeParameters();let h,p,m,f,g;s?(p=u&&!n.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",h=l.LINES):(p=u?"fillPattern":"fill",h=l.TRIANGLES);for(const v of r){const r=i.getTile(v);if(u&&!r.patternsLoaded())continue;const y=r.getBucket(n);if(!y)continue;e.prepareDrawTile(v);const _=y.programConfigurations.get(n.id),x=e.useProgram(p,_);u&&(e.context.activeTexture.set(l.TEXTURE0),r.imageAtlasTexture.bind(l.LINEAR,l.CLAMP_TO_EDGE),_.updatePaintBuffers(d));const b=c.constantOr(null);if(b&&r.imageAtlas){const t=r.imageAtlas,e=t.patternPositions[b.to.toString()],i=t.patternPositions[b.from.toString()];e&&i&&_.setConstantPatternPositions(e,i)}const w=e.translatePosMatrix(v.projMatrix,r,n.paint.get("fill-translate"),n.paint.get("fill-translate-anchor"));if(s){f=y.indexBuffer2,g=y.segments2;const t=e.terrain&&e.terrain.renderingToTexture?e.terrain.drapeBufferSize:[l.drawingBufferWidth,l.drawingBufferHeight];m="fillOutlinePattern"===p&&u?bi(w,e,d,r,t):xi(w,t)}else f=y.indexBuffer,g=y.segments,m=u?_i(w,e,d,r):yi(w);e.prepareDrawProgram(e.context,x,v.toUnwrapped()),x.draw(e.context,h,o,e.stencilModeForClipping(v),a,t.CullFaceMode.disabled,m,n.id,y.layoutVertexBuffer,f,g,n.paint,e.transform.zoom,_)}}function Xi(e,i,n,r,o,a,s){const l=e.context,c=l.gl,u=n.paint.get("fill-extrusion-pattern"),d=u.constantOr(1),h=n.getCrossfadeParameters(),p=n.paint.get("fill-extrusion-opacity");for(const m of r){const r=i.getTile(m),f=r.getBucket(n);if(!f)continue;const g=f.programConfigurations.get(n.id),v=e.useProgram(d?"fillExtrusionPattern":"fillExtrusion",g);if(e.terrain){const t=e.terrain;if(!f.enableTerrain)continue;if(t.setupElevationDraw(r,v,{useMeterToDem:!0}),Yi(l,i,m,f,n,t),!f.centroidVertexBuffer){const t=v.attributes.a_centroid_pos;void 0!==t&&c.vertexAttrib2f(t,0,0)}}d&&(e.context.activeTexture.set(c.TEXTURE0),r.imageAtlasTexture.bind(c.LINEAR,c.CLAMP_TO_EDGE),g.updatePaintBuffers(h));const y=u.constantOr(null);if(y&&r.imageAtlas){const t=r.imageAtlas,e=t.patternPositions[y.to.toString()],i=t.patternPositions[y.from.toString()];e&&i&&g.setConstantPatternPositions(e,i)}const _=e.translatePosMatrix(m.projMatrix,r,n.paint.get("fill-extrusion-translate"),n.paint.get("fill-extrusion-translate-anchor")),x=n.paint.get("fill-extrusion-vertical-gradient"),b=d?vi(_,e,x,p,m,h,r):gi(_,e,x,p);e.prepareDrawProgram(l,v,m.toUnwrapped()),v.draw(l,l.gl.TRIANGLES,o,a,s,t.CullFaceMode.backCCW,b,n.id,f.layoutVertexBuffer,f.indexBuffer,f.segments,n.paint,e.transform.zoom,g,e.terrain?f.centroidVertexBuffer:null)}}function Yi(e,i,n,r,o,a){const s=[e=>{let i=e.canonical.x-1,n=e.wrap;return i<0&&(i=(1<{let i=e.canonical.x+1,n=e.wrap;return i===1<new t.OverscaledTileID(e.overscaledZ,e.wrap,e.canonical.z,e.canonical.x,(0===e.canonical.y?1<new t.OverscaledTileID(e.overscaledZ,e.wrap,e.canonical.z,e.canonical.x,e.canonical.y===(1<{const e=i.getSource().maxzoom,n=t=>{const e=i.getTileByID(t);if(e&&e.hasData())return e.getBucket(o)};let r,a,s;return(t.overscaledZ===t.canonical.z||t.overscaledZ>=e)&&(r=n(t.key)),t.overscaledZ>=e&&(a=n(t.calculateScaledKey(t.overscaledZ+1))),t.overscaledZ>e&&(s=n(t.calculateScaledKey(t.overscaledZ-1))),r||a||s},c=[0,0,0],u=(e,i)=>(c[0]=Math.min(e.min.y,i.min.y),c[1]=Math.max(e.max.y,i.max.y),c[2]=t.EXTENT-i.min.x>e.max.x?i.min.x-t.EXTENT:e.max.x,c),d=(e,i)=>(c[0]=Math.min(e.min.x,i.min.x),c[1]=Math.max(e.max.x,i.max.x),c[2]=t.EXTENT-i.min.y>e.max.y?i.min.y-t.EXTENT:e.max.y,c),h=[(t,e)=>u(t,e),(t,e)=>u(e,t),(t,e)=>d(t,e),(t,e)=>d(e,t)],p=new t.pointGeometry(0,0);let m,f,g;const v=(e,i,r,o,s)=>{const l=[[o?r:e,o?e:r,0],[o?r:i,o?i:r,0]],c=s<0?t.EXTENT+s:s,u=[o?c:(e+i)/2,o?(e+i)/2:c,0];return 0===r&&s<0||0!==r&&s>0?a.getForTilePoints(g,[u],!0,f):l.push(u),a.getForTilePoints(n,l,!0,m),Math.max(l[0][2],l[1][2],u[2])/a.exaggeration()};for(let e=0;e<4;e++){const i=r.borders[e];if(0===i.length&&(r.borderDone[e]=!0),r.borderDone[e])continue;const o=g=s[e](n),c=l(o);if(!c||!c.enableTerrain)continue;if(f=a.findDEMTileFor(o),!f||!f.dem)continue;if(!m){const t=a.findDEMTileFor(n);if(!t||!t.dem)return;m=t}const u=(e<2?1:5)-e,d=c.borders[u];let y=0;for(let n=0;na[0]+3));)c.borderDone[u]||c.encodeCentroid(void 0,s,!1),y++;if(s&&ya[1]-3)&&(n++,++y!==d.length);)s=c.featuresOnBorder[d[y]];if(s=c.featuresOnBorder[d[i]],o.intersectsCount()>1||s.intersectsCount()>1||1!==n){1!==n&&(y=i),r.encodeCentroid(void 0,o,!1),c.borderDone[u]||c.encodeCentroid(void 0,s,!1);continue}const l=h[e](o,s),m=e%2?t.EXTENT-1:0;p.x=v(l[0],Math.min(t.EXTENT-1,l[1]),m,e<2,l[2]),p.y=0,r.encodeCentroid(p,o,!1),c.borderDone[u]||c.encodeCentroid(p,s,!1)}else r.encodeCentroid(void 0,o,!1)}r.borderDone[e]=r.needsCentroidUpdate=!0,c.borderDone[u]||(c.borderDone[u]=c.needsCentroidUpdate=!0)}(r.needsCentroidUpdate||!r.centroidVertexBuffer&&0!==r.centroidVertexArray.length)&&r.uploadCentroid(e)}const Ki=new t.Color(1,0,0,1),Ji=new t.Color(0,1,0,1),Qi=new t.Color(0,0,1,1),tn=new t.Color(1,0,1,1),en=new t.Color(0,1,1,1);function nn(t,e,i,n){on(t,0,e+i/2,t.transform.width,i,n)}function rn(t,e,i,n){on(t,e-i/2,0,i,t.transform.height,n)}function on(e,i,n,r,o,a){const s=e.context,l=s.gl;l.enable(l.SCISSOR_TEST),l.scissor(i*t.exported.devicePixelRatio,n*t.exported.devicePixelRatio,r*t.exported.devicePixelRatio,o*t.exported.devicePixelRatio),s.clear({color:a}),l.disable(l.SCISSOR_TEST)}function an(e,i,n){const r=e.context,o=r.gl,a=n.projMatrix,s=e.useProgram("debug"),l=i.getTileByID(n.key);e.terrain&&e.terrain.setupElevationDraw(l,s);const c=t.DepthMode.disabled,u=t.StencilMode.disabled,d=e.colorModeForRenderPass(),h="$debug";r.activeTexture.set(o.TEXTURE0),e.emptyTexture.bind(o.LINEAR,o.CLAMP_TO_EDGE),l._makeDebugTileBoundsBuffers(e.context,e.transform.projection);const p=l._tileDebugBuffer||e.debugBuffer,m=l._tileDebugIndexBuffer||e.debugIndexBuffer,f=l._tileDebugSegments||e.debugSegments;s.draw(r,o.LINE_STRIP,c,u,d,t.CullFaceMode.disabled,Ti(a,t.Color.red),h,p,m,f);const g=l.latestRawTileData,v=Math.floor((g&&g.byteLength||0)/1024),y=i.getTile(n).tileSize,_=512/Math.min(y,512)*(n.overscaledZ/e.transform.zoom)*.5;let x=n.canonical.toString();n.overscaledZ!==n.canonical.z&&(x+=` => ${n.overscaledZ}`),function(t,e){t.initDebugOverlayCanvas();const i=t.debugOverlayCanvas,n=t.context.gl,r=t.debugOverlayCanvas.getContext("2d");r.clearRect(0,0,i.width,i.height),r.shadowColor="white",r.shadowBlur=2,r.lineWidth=1.5,r.strokeStyle="white",r.textBaseline="top",r.font="bold 36px Open Sans, sans-serif",r.fillText(e,5,5),r.strokeText(e,5,5),t.debugOverlayTexture.update(i),t.debugOverlayTexture.bind(n.LINEAR,n.CLAMP_TO_EDGE)}(e,`${x} ${v}kb`),s.draw(r,o.TRIANGLES,c,u,t.ColorMode.alphaBlended,t.CullFaceMode.disabled,Ti(a,t.Color.transparent,_),h,e.debugBuffer,e.quadTriangleIndexBuffer,e.debugSegments)}const sn=t.createLayout([{name:"a_pos_3f",components:3,type:"Float32"}]),{members:ln}=sn;function cn(t,e,i,n){t.emplaceBack(e,i,n)}class un{constructor(e){this.vertexArray=new t.StructArrayLayout3f12,this.indices=new t.StructArrayLayout3ui6,cn(this.vertexArray,-1,-1,1),cn(this.vertexArray,1,-1,1),cn(this.vertexArray,-1,1,1),cn(this.vertexArray,1,1,1),cn(this.vertexArray,-1,-1,-1),cn(this.vertexArray,1,-1,-1),cn(this.vertexArray,-1,1,-1),cn(this.vertexArray,1,1,-1),this.indices.emplaceBack(5,1,3),this.indices.emplaceBack(3,7,5),this.indices.emplaceBack(6,2,0),this.indices.emplaceBack(0,4,6),this.indices.emplaceBack(2,6,7),this.indices.emplaceBack(7,3,2),this.indices.emplaceBack(5,4,0),this.indices.emplaceBack(0,1,5),this.indices.emplaceBack(0,2,3),this.indices.emplaceBack(3,1,0),this.indices.emplaceBack(7,6,4),this.indices.emplaceBack(4,5,7),this.vertexBuffer=e.createVertexBuffer(this.vertexArray,ln),this.indexBuffer=e.createIndexBuffer(this.indices),this.segment=t.SegmentVector.simpleSegment(0,0,36,12)}}function dn(e,i,n,r,o,a){const s=e.gl,l=i.paint.get("sky-atmosphere-color"),c=i.paint.get("sky-atmosphere-halo-color"),u=i.paint.get("sky-atmosphere-sun-intensity"),d=((t,e,i,n,r)=>({u_matrix_3f:t,u_sun_direction:e,u_sun_intensity:i,u_color_tint_r:[n.r,n.g,n.b,n.a],u_color_tint_m:[r.r,r.g,r.b,r.a],u_luminance:5e-5}))(t.fromMat4([],r),o,u,l,c);s.framebufferTexture2D(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.TEXTURE_CUBE_MAP_POSITIVE_X+a,i.skyboxTexture,0),n.draw(e,s.TRIANGLES,t.DepthMode.disabled,t.StencilMode.disabled,t.ColorMode.unblended,t.CullFaceMode.frontCW,d,"skyboxCapture",i.skyboxGeometry.vertexBuffer,i.skyboxGeometry.indexBuffer,i.skyboxGeometry.segment)}const hn={symbol:function(e,i,n,r,o){if("translucent"!==e.renderPass)return;const a=t.StencilMode.disabled,s=e.colorModeForRenderPass();n.layout.get("text-variable-anchor")&&function(e,i,n,r,o,a,s){const l=i.transform,c="map"===o,u="map"===a,d=l.projection.createTileTransform(l,l.worldSize);for(const o of e){const e=r.getTile(o),a=e.getBucket(n);if(!a||a.projection!==l.projection.name||!a.text||!a.text.segments.get().length)continue;const h=t.evaluateSizeForZoom(a.textSizeData,l.zoom),p=i.transform.calculatePixelsToTileUnitsMatrix(e),m=qt(o.projMatrix,e.tileID.canonical,u,c,i.transform,p),f="none"!==n.layout.get("icon-text-fit")&&a.hasIconData();if(h){const i=Math.pow(2,l.zoom-e.tileID.overscaledZ);$i(a,c,u,s,t.symbolSize,l,m,o,i,h,f,d)}}}(r,e,n,i,n.layout.get("text-rotation-alignment"),n.layout.get("text-pitch-alignment"),o),0!==n.paint.get("icon-opacity").constantOr(1)&&qi(e,i,n,r,!1,n.paint.get("icon-translate"),n.paint.get("icon-translate-anchor"),n.layout.get("icon-rotation-alignment"),n.layout.get("icon-pitch-alignment"),n.layout.get("icon-keep-upright"),a,s),0!==n.paint.get("text-opacity").constantOr(1)&&qi(e,i,n,r,!0,n.paint.get("text-translate"),n.paint.get("text-translate-anchor"),n.layout.get("text-rotation-alignment"),n.layout.get("text-pitch-alignment"),n.layout.get("text-keep-upright"),a,s),i.map.showCollisionBoxes&&(Vi(e,i,n,r,n.paint.get("text-translate"),n.paint.get("text-translate-anchor"),!0),Vi(e,i,n,r,n.paint.get("icon-translate"),n.paint.get("icon-translate-anchor"),!1))},circle:function(e,i,n,r){if("translucent"!==e.renderPass)return;const o=n.paint.get("circle-opacity"),a=n.paint.get("circle-stroke-width"),s=n.paint.get("circle-stroke-opacity"),l=void 0!==n.layout.get("circle-sort-key").constantOr(1);if(0===o.constantOr(1)&&(0===a.constantOr(1)||0===s.constantOr(1)))return;const c=e.context,u=c.gl,d=e.depthModeForSublayer(0,t.DepthMode.ReadOnly),h=t.StencilMode.disabled,p=e.colorModeForRenderPass(),m=[];for(let o=0;ot.sortKey-e.sortKey));const f={useDepthForOcclusion:!("globe"===e.transform.projection.name)};for(const i of m){const{programConfiguration:r,program:o,layoutVertexBuffer:a,indexBuffer:s,uniformValues:l,tile:m}=i.state,g=i.segments;e.terrain&&e.terrain.setupElevationDraw(m,o,f),e.prepareDrawProgram(c,o,m.tileID.toUnwrapped()),o.draw(c,u.TRIANGLES,d,h,p,t.CullFaceMode.disabled,l,n.id,a,s,g,n.paint,e.transform.zoom,r)}},heatmap:function(e,i,n,r){if(0!==n.paint.get("heatmap-opacity"))if("offscreen"===e.renderPass){const o=e.context,a=o.gl,s=t.StencilMode.disabled,l=new t.ColorMode([a.ONE,a.ONE],t.Color.transparent,[!0,!0,!0,!0]);!function(t,e,i){const n=t.gl;t.activeTexture.set(n.TEXTURE1),t.viewport.set([0,0,e.width/4,e.height/4]);let r=i.heatmapFbo;if(r)n.bindTexture(n.TEXTURE_2D,r.colorAttachment.get()),t.bindFramebuffer.set(r.framebuffer);else{const o=n.createTexture();n.bindTexture(n.TEXTURE_2D,o),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.LINEAR),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.LINEAR),r=i.heatmapFbo=t.createFramebuffer(e.width/4,e.height/4,!1),function(t,e,i,n){const r=t.gl;r.texImage2D(r.TEXTURE_2D,0,r.RGBA,e.width/4,e.height/4,0,r.RGBA,t.extRenderToTextureHalfFloat?t.extTextureHalfFloat.HALF_FLOAT_OES:r.UNSIGNED_BYTE,null),n.colorAttachment.set(i)}(t,e,o,r)}}(o,e,n),o.clear({color:t.Color.transparent});for(let c=0;c({u_image:0,u_color_ramp:1,u_opacity:e.paint.get("heatmap-opacity")}))(0,i),i.id,e.viewportBuffer,e.quadTriangleIndexBuffer,e.viewportSegments,i.paint,e.transform.zoom)}(e,n))},line:function(e,i,n,r){if("translucent"!==e.renderPass)return;const o=n.paint.get("line-opacity"),a=n.paint.get("line-width");if(0===o.constantOr(1)||0===a.constantOr(1))return;const s=e.depthModeForSublayer(0,t.DepthMode.ReadOnly),l=e.colorModeForRenderPass(),c=n.paint.get("line-dasharray"),u=c.constantOr(1),d=n.layout.get("line-cap"),h=n.paint.get("line-pattern"),p=h.constantOr(1),m=n.paint.get("line-gradient"),f=n.getCrossfadeParameters(),g=p?"linePattern":"line",v=e.context,y=v.gl,_=(t=>{const e=[];Pi(t)&&e.push("RENDER_LINE_DASH"),t.paint.get("line-gradient")&&e.push("RENDER_LINE_GRADIENT");const i=t.paint.get("line-pattern").constantOr(1),n=1!==t.paint.get("line-opacity").constantOr(1);return!i&&n&&e.push("RENDER_LINE_ALPHA_DISCARD"),e})(n);let x=_.includes("RENDER_LINE_ALPHA_DISCARD");e.terrain&&e.terrain.clipOrMaskOverlapStencilType()&&(x=!1);for(const o of r){const r=i.getTile(o);if(p&&!r.patternsLoaded())continue;const a=r.getBucket(n);if(!a)continue;e.prepareDrawTile(o);const b=a.programConfigurations.get(n.id),w=e.useProgram(g,b,_),k=h.constantOr(null);if(k&&r.imageAtlas){const t=r.imageAtlas,e=t.patternPositions[k.to.toString()],i=t.patternPositions[k.from.toString()];e&&i&&b.setConstantPatternPositions(e,i)}const E=c.constantOr(null),T=d.constantOr(null);if(!p&&E&&T&&r.lineAtlas){const t=r.lineAtlas,e=t.getDash(E.to,T),i=t.getDash(E.from,T);e&&i&&b.setConstantPatternPositions(e,i)}const S=e.terrain?o.projMatrix:null,C=p?Mi(e,r,n,f,S):Ci(e,r,n,f,S,a.lineClipsArray.length);if(m){const r=a.gradients[n.id];let s=r.texture;if(n.gradientVersion!==r.version){let l=256;if(n.stepInterpolant){const n=i.getSource().maxzoom,r=o.canonical.z===n?Math.ceil(1<{w.draw(v,y.TRIANGLES,s,i,l,t.CullFaceMode.disabled,C,n.id,a.layoutVertexBuffer,a.indexBuffer,a.segments,n.paint,e.transform.zoom,b,a.layoutVertexBuffer2)};if(x){const i=e.stencilModeForClipping(o).ref;0===i&&e.terrain&&v.clear({stencil:0});const n={func:y.EQUAL,mask:255};C.u_alpha_discard_threshold=.8,M(new t.StencilMode(n,i,255,y.KEEP,y.KEEP,y.INVERT)),C.u_alpha_discard_threshold=0,M(new t.StencilMode(n,i,255,y.KEEP,y.KEEP,y.KEEP))}else M(e.stencilModeForClipping(o))}x&&(e.resetStencilClippingMasks(),e.terrain&&v.clear({stencil:0}))},fill:function(e,i,n,r){const o=n.paint.get("fill-color"),a=n.paint.get("fill-opacity");if(0===a.constantOr(1))return;const s=e.colorModeForRenderPass(),l=n.paint.get("fill-pattern"),c=e.opaquePassEnabledForLayer()&&!l.constantOr(1)&&1===o.constantOr(t.Color.transparent).a&&1===a.constantOr(0)?"opaque":"translucent";if(e.renderPass===c){const o=e.depthModeForSublayer(1,"opaque"===e.renderPass?t.DepthMode.ReadWrite:t.DepthMode.ReadOnly);Hi(e,i,n,r,o,s,!1)}if("translucent"===e.renderPass&&n.paint.get("fill-antialias")){const o=e.depthModeForSublayer(n.getPaintProperty("fill-outline-color")?2:0,t.DepthMode.ReadOnly);Hi(e,i,n,r,o,s,!0)}},"fill-extrusion":function(e,i,n,r){const o=n.paint.get("fill-extrusion-opacity");if(0!==o&&"translucent"===e.renderPass){const a=new t.DepthMode(e.context.gl.LEQUAL,t.DepthMode.ReadWrite,e.depthRangeFor3D);if(1!==o||n.paint.get("fill-extrusion-pattern").constantOr(1))Xi(e,i,n,r,a,t.StencilMode.disabled,t.ColorMode.disabled),Xi(e,i,n,r,a,e.stencilModeFor3D(),e.colorModeForRenderPass()),e.resetStencilClippingMasks();else{const o=e.colorModeForRenderPass();Xi(e,i,n,r,a,t.StencilMode.disabled,o)}}},hillshade:function(e,i,n,r){if("offscreen"!==e.renderPass&&"translucent"!==e.renderPass)return;const o=e.context,a=e.depthModeForSublayer(0,t.DepthMode.ReadOnly),s=e.colorModeForRenderPass(),l=e.terrain&&e.terrain.renderingToTexture,[c,u]="translucent"!==e.renderPass||l?[{},r]:e.stencilConfigForOverlap(r);for(const r of u){const o=i.getTile(r);if(o.needsHillshadePrepare&&"offscreen"===e.renderPass)Qe(e,o,n,a,t.StencilMode.disabled,s);else if("translucent"===e.renderPass){const t=l&&e.terrain?e.terrain.stencilModeForRTTOverlap(r):c[r.overscaledZ];Ke(e,r,o,n,a,t,s)}}o.viewport.set([0,0,e.width,e.height]),e.resetStencilClippingMasks()},raster:function(e,i,n,r,o,a){if("translucent"!==e.renderPass)return;if(0===n.paint.get("raster-opacity"))return;if(!r.length)return;const s=e.context,l=s.gl,c=i.getSource(),u=e.useProgram("raster"),d=e.colorModeForRenderPass(),h=e.terrain&&e.terrain.renderingToTexture,[p,m]=c instanceof bt||h?[{},r]:e.stencilConfigForOverlap(r),f=m[m.length-1].overscaledZ,g=!e.options.moving;for(const r of m){const o=h?t.DepthMode.disabled:e.depthModeForSublayer(r.overscaledZ-f,1===n.paint.get("raster-opacity")?t.DepthMode.ReadWrite:t.DepthMode.ReadOnly,l.LESS),m=r.toUnwrapped(),v=i.getTile(r);if(h&&(!v||!v.hasData()))continue;const y=h?r.projMatrix:e.transform.calculateProjMatrix(m,g),_=e.terrain&&h?e.terrain.stencilModeForRTTOverlap(r):p[r.overscaledZ],x=a?0:n.paint.get("raster-fade-duration");v.registerFadeDuration(x);const b=i.findLoadedParent(r,0),w=li(v,b,i,e.transform,x);let k,E;e.terrain&&e.terrain.prepareDrawTile(r);const T="nearest"===n.paint.get("raster-resampling")?l.NEAREST:l.LINEAR;s.activeTexture.set(l.TEXTURE0),v.texture.bind(T,l.CLAMP_TO_EDGE),s.activeTexture.set(l.TEXTURE1),b?(b.texture.bind(T,l.CLAMP_TO_EDGE),k=Math.pow(2,b.tileID.overscaledZ-v.tileID.overscaledZ),E=[v.tileID.canonical.x*k%1,v.tileID.canonical.y*k%1]):v.texture.bind(T,l.CLAMP_TO_EDGE);const S=Ai(y,E||[0,0],k||1,w,n,c instanceof bt?c.perspectiveTransform:[0,0]);if(e.prepareDrawProgram(s,u,m),c instanceof bt)u.draw(s,l.TRIANGLES,o,t.StencilMode.disabled,d,t.CullFaceMode.disabled,S,n.id,c.boundsBuffer,e.quadTriangleIndexBuffer,c.boundsSegments);else{const{tileBoundsBuffer:i,tileBoundsIndexBuffer:r,tileBoundsSegments:a}=e.getTileBoundsBuffers(v);u.draw(s,l.TRIANGLES,o,_,d,t.CullFaceMode.disabled,S,n.id,i,r,a)}}e.resetStencilClippingMasks()},background:function(e,i,n,r){const o=n.paint.get("background-color"),a=n.paint.get("background-opacity");if(0===a)return;const s=e.context,l=s.gl,c=e.transform,u=c.tileSize,d=n.paint.get("background-pattern");if(e.isPatternMissing(d))return;const h=!d&&1===o.a&&1===a&&e.opaquePassEnabledForLayer()?"opaque":"translucent";if(e.renderPass!==h)return;const p=t.StencilMode.disabled,m=e.depthModeForSublayer(0,"opaque"===h?t.DepthMode.ReadWrite:t.DepthMode.ReadOnly),f=e.colorModeForRenderPass(),g=e.useProgram(d?"backgroundPattern":"background");let v,y=r;y||(v=e.getBackgroundTiles(),y=Object.values(v).map((t=>t.tileID))),d&&(s.activeTexture.set(l.TEXTURE0),e.imageManager.bind(e.context));const _=n.getCrossfadeParameters();for(const h of y){const y=h.toUnwrapped(),x=r?h.projMatrix:e.transform.calculateProjMatrix(y);e.prepareDrawTile(h);const b=i?i.getTile(h):v?v[h.key]:new t.Tile(h,u,c.zoom,e),w=d?Fi(x,a,e,d,{tileID:h,tileSize:u},_):Bi(x,a,o);e.prepareDrawProgram(s,g,y);const{tileBoundsBuffer:k,tileBoundsIndexBuffer:E,tileBoundsSegments:T}=e.getTileBoundsBuffers(b);g.draw(s,l.TRIANGLES,m,p,f,t.CullFaceMode.disabled,w,n.id,k,E,T)}},sky:function(e,i,n){const r=e.transform,o="mercator"===r.projection.name||"globe"===r.projection.name?1:t.smoothstep(7,8,r.zoom),a=n.paint.get("sky-opacity")*o;if(0===a)return;const s=e.context,l=n.paint.get("sky-type"),c=new t.DepthMode(s.gl.LEQUAL,t.DepthMode.ReadOnly,[0,1]),u=e.frameCounter/1e3%1;"atmosphere"===l?"offscreen"===e.renderPass?n.needsSkyboxCapture(e)&&(function(e,i,n,r){const o=e.context,a=o.gl;let s=i.skyboxFbo;if(!s){s=i.skyboxFbo=o.createFramebuffer(32,32,!1),i.skyboxGeometry=new un(o),i.skyboxTexture=o.gl.createTexture(),a.bindTexture(a.TEXTURE_CUBE_MAP,i.skyboxTexture),a.texParameteri(a.TEXTURE_CUBE_MAP,a.TEXTURE_WRAP_S,a.CLAMP_TO_EDGE),a.texParameteri(a.TEXTURE_CUBE_MAP,a.TEXTURE_WRAP_T,a.CLAMP_TO_EDGE),a.texParameteri(a.TEXTURE_CUBE_MAP,a.TEXTURE_MIN_FILTER,a.LINEAR),a.texParameteri(a.TEXTURE_CUBE_MAP,a.TEXTURE_MAG_FILTER,a.LINEAR);for(let t=0;t<6;++t)a.texImage2D(a.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,a.RGBA,32,32,0,a.RGBA,a.UNSIGNED_BYTE,null)}o.bindFramebuffer.set(s.framebuffer),o.viewport.set([0,0,32,32]);const l=i.getCenter(e,!0),c=e.useProgram("skyboxCapture"),u=new Float64Array(16);t.identity(u),t.rotateY(u,u,.5*-Math.PI),dn(o,i,c,u,l,0),t.identity(u),t.rotateY(u,u,.5*Math.PI),dn(o,i,c,u,l,1),t.identity(u),t.rotateX(u,u,.5*-Math.PI),dn(o,i,c,u,l,2),t.identity(u),t.rotateX(u,u,.5*Math.PI),dn(o,i,c,u,l,3),t.identity(u),dn(o,i,c,u,l,4),t.identity(u),t.rotateY(u,u,Math.PI),dn(o,i,c,u,l,5),o.viewport.set([0,0,e.width,e.height])}(e,n),n.markSkyboxValid(e)):"sky"===e.renderPass&&function(e,i,n,r,o){const a=e.context,s=a.gl,l=e.transform,c=e.useProgram("skybox");a.activeTexture.set(s.TEXTURE0),s.bindTexture(s.TEXTURE_CUBE_MAP,i.skyboxTexture);const u=((t,e,i,n,r)=>({u_matrix:t,u_sun_direction:e,u_cubemap:0,u_opacity:n,u_temporal_offset:r}))(l.skyboxMatrix,i.getCenter(e,!1),0,r,o);e.prepareDrawProgram(a,c),c.draw(a,s.TRIANGLES,n,t.StencilMode.disabled,e.colorModeForRenderPass(),t.CullFaceMode.backCW,u,"skybox",i.skyboxGeometry.vertexBuffer,i.skyboxGeometry.indexBuffer,i.skyboxGeometry.segment)}(e,n,c,a,u):"gradient"===l&&"sky"===e.renderPass&&function(e,i,n,r,o){const a=e.context,s=a.gl,l=e.transform,c=e.useProgram("skyboxGradient");i.skyboxGeometry||(i.skyboxGeometry=new un(a)),a.activeTexture.set(s.TEXTURE0);let u=i.colorRampTexture;u||(u=i.colorRampTexture=new t.Texture(a,i.colorRamp,s.RGBA)),u.bind(s.LINEAR,s.CLAMP_TO_EDGE);const d=((e,i,n,r,o)=>({u_matrix:e,u_color_ramp:0,u_center_direction:i,u_radius:t.degToRad(n),u_opacity:r,u_temporal_offset:o}))(l.skyboxMatrix,i.getCenter(e,!1),i.paint.get("sky-gradient-radius"),r,o);e.prepareDrawProgram(a,c),c.draw(a,s.TRIANGLES,n,t.StencilMode.disabled,e.colorModeForRenderPass(),t.CullFaceMode.backCW,d,"skyboxGradient",i.skyboxGeometry.vertexBuffer,i.skyboxGeometry.indexBuffer,i.skyboxGeometry.segment)}(e,n,c,a,u)},debug:function(t,e,i){for(let n=0;nn)return void(this.transform.fogCullDistSq=null);const r=i+.78*(n-i);this.transform.fogCullDistSq=r*r}get terrain(){return this.transform._terrainEnabled()&&this._terrain&&this._terrain.enabled?this._terrain:null}resize(e,i){if(this.width=e*t.exported.devicePixelRatio,this.height=i*t.exported.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(const t of this.style.order)this.style._layers[t].resize()}setup(){const e=this.context,i=new t.StructArrayLayout2i4;i.emplaceBack(0,0),i.emplaceBack(t.EXTENT,0),i.emplaceBack(0,t.EXTENT),i.emplaceBack(t.EXTENT,t.EXTENT),this.tileExtentBuffer=e.createVertexBuffer(i,t.posAttributes.members),this.tileExtentSegments=t.SegmentVector.simpleSegment(0,0,4,2);const n=new t.StructArrayLayout2i4;n.emplaceBack(0,0),n.emplaceBack(t.EXTENT,0),n.emplaceBack(0,t.EXTENT),n.emplaceBack(t.EXTENT,t.EXTENT),this.debugBuffer=e.createVertexBuffer(n,t.posAttributes.members),this.debugSegments=t.SegmentVector.simpleSegment(0,0,4,5);const r=new t.StructArrayLayout2i4;r.emplaceBack(-1,-1),r.emplaceBack(1,-1),r.emplaceBack(-1,1),r.emplaceBack(1,1),this.viewportBuffer=e.createVertexBuffer(r,t.posAttributes.members),this.viewportSegments=t.SegmentVector.simpleSegment(0,0,4,2);const o=new t.StructArrayLayout4i8;o.emplaceBack(0,0,0,0),o.emplaceBack(t.EXTENT,0,t.EXTENT,0),o.emplaceBack(0,t.EXTENT,0,t.EXTENT),o.emplaceBack(t.EXTENT,t.EXTENT,t.EXTENT,t.EXTENT),this.mercatorBoundsBuffer=e.createVertexBuffer(o,t.boundsAttributes.members),this.mercatorBoundsSegments=t.SegmentVector.simpleSegment(0,0,4,2);const a=new t.StructArrayLayout3ui6;a.emplaceBack(0,1,2),a.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=e.createIndexBuffer(a);const s=new t.StructArrayLayout1ui2;for(const t of[0,1,3,2,0])s.emplaceBack(t);this.debugIndexBuffer=e.createIndexBuffer(s),this.emptyTexture=new t.Texture(e,{width:1,height:1,data:new Uint8Array([0,0,0,0])},e.gl.RGBA),this.identityMat=t.create();const l=this.context.gl;this.stencilClearMode=new t.StencilMode({func:l.ALWAYS,mask:0},0,255,l.ZERO,l.ZERO,l.ZERO),this.loadTimeStamps.push(t.window.performance.now())}getMercatorTileBoundsBuffers(){return{tileBoundsBuffer:this.mercatorBoundsBuffer,tileBoundsIndexBuffer:this.quadTriangleIndexBuffer,tileBoundsSegments:this.mercatorBoundsSegments}}getTileBoundsBuffers(t){return t._makeTileBoundsBuffers(this.context,this.transform.projection),t._tileBoundsBuffer?{tileBoundsBuffer:t._tileBoundsBuffer,tileBoundsIndexBuffer:t._tileBoundsIndexBuffer,tileBoundsSegments:t._tileBoundsSegments}:this.getMercatorTileBoundsBuffers()}clearStencil(){const e=this.context,i=e.gl;this.nextStencilID=1,this.currentStencilSource=void 0,this._tileClippingMaskIDs={},this.useProgram("clippingMask").draw(e,i.TRIANGLES,t.DepthMode.disabled,this.stencilClearMode,t.ColorMode.disabled,t.CullFaceMode.disabled,si(this.identityMat),"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}resetStencilClippingMasks(){this.terrain||(this.currentStencilSource=void 0,this._tileClippingMaskIDs={})}_renderTileClippingMasks(e,i,n){if(!i||this.currentStencilSource===i.id||!e.isTileClipped()||!n||0===n.length)return;if(this._tileClippingMaskIDs&&!this.terrain){let t=!1;for(const e of n)if(void 0===this._tileClippingMaskIDs[e.key]){t=!0;break}if(!t)return}this.currentStencilSource=i.id;const r=this.context,o=r.gl;this.nextStencilID+n.length>256&&this.clearStencil(),r.setColorMode(t.ColorMode.disabled),r.setDepthMode(t.DepthMode.disabled);const a=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(const e of n){const n=i.getTile(e),s=this._tileClippingMaskIDs[e.key]=this.nextStencilID++,{tileBoundsBuffer:l,tileBoundsIndexBuffer:c,tileBoundsSegments:u}=this.getTileBoundsBuffers(n);a.draw(r,o.TRIANGLES,t.DepthMode.disabled,new t.StencilMode({func:o.ALWAYS,mask:0},s,255,o.KEEP,o.KEEP,o.REPLACE),t.ColorMode.disabled,t.CullFaceMode.disabled,si(e.projMatrix),"$clipping",l,c,u)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const e=this.nextStencilID++,i=this.context.gl;return new t.StencilMode({func:i.NOTEQUAL,mask:255},e,255,i.KEEP,i.KEEP,i.REPLACE)}stencilModeForClipping(e){if(this.terrain)return this.terrain.stencilModeForRTTOverlap(e);const i=this.context.gl;return new t.StencilMode({func:i.EQUAL,mask:255},this._tileClippingMaskIDs[e.key],0,i.KEEP,i.KEEP,i.REPLACE)}stencilConfigForOverlap(e){const i=this.context.gl,n=e.sort(((t,e)=>e.overscaledZ-t.overscaledZ)),r=n[n.length-1].overscaledZ,o=n[0].overscaledZ-r+1;if(o>1){this.currentStencilSource=void 0,this.nextStencilID+o>256&&this.clearStencil();const e={};for(let n=0;n=0;this.currentLayer--){const t=this.style._layers[n[this.currentLayer]],i=e._getLayerSourceCache(t);if(t.isSky())continue;const r=i?a[i.id]:void 0;this._renderTileClippingMasks(t,i,r),this.renderLayer(this,i,t,r)}if(this.renderPass="sky",(t.globeToMercatorTransition(this.transform.zoom)>0||"globe"!==this.transform.projection.name)&&this.transform.isHorizonVisible())for(this.currentLayer=0;this.currentLayer{const n=e._getLayerSourceCache(t);n&&!t.isHidden(this.transform.zoom)&&(!i||i.getSource().maxzoom0?e.pop():null}isPatternMissing(t){if(!t)return!1;if(!t.from||!t.to)return!0;const e=this.imageManager.getPattern(t.from.toString()),i=this.imageManager.getPattern(t.to.toString());return!e||!i}currentGlobalDefines(){const t=this.terrain&&this.terrain.renderingToTexture,e=this.style&&this.style.fog,i=[];return this.terrain&&!this.terrain.renderingToTexture&&i.push("TERRAIN"),e&&!t&&0!==e.getOpacity(this.transform.pitch)&&i.push("FOG"),t&&i.push("RENDER_TO_TEXTURE"),this._showOverdrawInspector&&i.push("OVERDRAW_INSPECTOR"),i}useProgram(t,e,i){this.cache=this.cache||{};const n=i||[],r=this.currentGlobalDefines().concat(n),o=mi.cacheKey(t,r,e);return this.cache[o]||(this.cache[o]=new mi(this.context,t,We[t],e,ji[t],r)),this.cache[o]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.frontFace.setDefault(),this.context.cullFaceSide.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){const t=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(t.FUNC_ADD)}initDebugOverlayCanvas(){null==this.debugOverlayCanvas&&(this.debugOverlayCanvas=t.window.document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new t.Texture(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this._terrain&&this._terrain.destroy(),this.globeSharedBuffers&&this.globeSharedBuffers.destroy(),this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy()}prepareDrawTile(t){this.terrain&&this.terrain.prepareDrawTile(t)}prepareDrawProgram(t,e,i){if(this.terrain&&this.terrain.renderingToTexture)return;const n=this.style.fog;if(n){const r=n.getOpacity(this.transform.pitch);0!==r&&e.setFogUniformValues(t,((t,e,i,n)=>{const r=e.properties.get("color"),o=t.frameCounter/1e3%1,a=[r.r/r.a,r.g/r.a,r.b/r.a,n];return{u_fog_matrix:i?t.transform.calculateFogTileMatrix(i):t.identityMat,u_fog_range:e.getFovAdjustedRange(t.transform._fov),u_fog_color:a,u_fog_horizon_blend:e.properties.get("horizon-blend"),u_fog_temporal_offset:o}})(this,n,i,r))}}setTileLoadedFlag(t){this.tileLoaded=t}saveCanvasCopy(){this.frameCopies.push(this.canvasCopy()),this.tileLoaded=!1}canvasCopy(){const t=this.context.gl,e=t.createTexture();return t.bindTexture(t.TEXTURE_2D,e),t.copyTexImage2D(t.TEXTURE_2D,0,t.RGBA,0,0,t.drawingBufferWidth,t.drawingBufferHeight,0),e}getCanvasCopiesAndTimestamps(){return{canvasCopies:this.frameCopies,timeStamps:this.loadTimeStamps}}averageElevationNeedsEasing(){if(!this.transform._elevation)return!1;const t=this.style&&this.style.fog;return!!t&&0!==t.getOpacity(this.transform.pitch)}getBackgroundTiles(){const e=this._backgroundTiles,i=this._backgroundTiles={},n=this.transform.coveringTiles({tileSize:512});for(const r of n)i[r.key]=e[r.key]||new t.Tile(r,512,this.transform.tileZoom,this);return i}clearBackgroundTiles(){this._backgroundTiles={}}}class mn{constructor(t=0,e=0,i=0,n=0){if(isNaN(t)||t<0||isNaN(e)||e<0||isNaN(i)||i<0||isNaN(n)||n<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=t,this.bottom=e,this.left=i,this.right=n}interpolate(e,i,n){return null!=i.top&&null!=e.top&&(this.top=t.number(e.top,i.top,n)),null!=i.bottom&&null!=e.bottom&&(this.bottom=t.number(e.bottom,i.bottom,n)),null!=i.left&&null!=e.left&&(this.left=t.number(e.left,i.left,n)),null!=i.right&&null!=e.right&&(this.right=t.number(e.right,i.right,n)),this}getCenter(e,i){const n=t.clamp((this.left+e-this.right)/2,0,e),r=t.clamp((this.top+i-this.bottom)/2,0,i);return new t.pointGeometry(n,r)}equals(t){return this.top===t.top&&this.bottom===t.bottom&&this.left===t.left&&this.right===t.right}clone(){return new mn(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}function fn(e,i){const n=t.getColumn(e,3);t.fromQuat(e,i),t.setColumn(e,3,n)}function gn(e,i){t.setColumn(e,3,[i[0],i[1],i[2],1])}function vn(e,i){const n=t.identity$1([]);return t.rotateZ$1(n,n,-i),t.rotateX$1(n,n,-e),n}function yn(e,i){const n=[e[0],e[1],0],r=[i[0],i[1],0];if(t.length(n)>=1e-15){const e=t.normalize([],n);t.scale$2(r,e,t.dot(r,e)),i[0]=r[0],i[1]=r[1]}const o=t.cross([],i,e);if(t.len(o)<1e-15)return null;const a=Math.atan2(-o[1],o[0]);return vn(Math.atan2(Math.sqrt(e[0]*e[0]+e[1]*e[1]),-e[2]),a)}class _n{constructor(t,e){this.position=t,this.orientation=e}get position(){return this._position}set position(e){this._position=this._renderWorldCopies?function(e){if(!e)return;const i=Array.isArray(e)?new t.MercatorCoordinate(e[0],e[1],e[2]):e;return i.x=t.wrap(i.x,0,1),i}(e):e}lookAtPoint(e,i){if(this.orientation=null,!this.position)return;const n=this._elevation?this._elevation.getAtPointOrZero(t.MercatorCoordinate.fromLngLat(e)):0,r=this.position,o=t.MercatorCoordinate.fromLngLat(e,n),a=[o.x-r.x,o.y-r.y,o.z-r.z];i||(i=[0,0,1]),i[2]=Math.abs(i[2]),this.orientation=yn(a,i)}setPitchBearing(e,i){this.orientation=vn(t.degToRad(e),t.degToRad(-i))}}class xn{constructor(e,i){this._transform=t.identity([]),this._orientation=t.identity$1([]),i&&(this._orientation=i,fn(this._transform,this._orientation)),e&&gn(this._transform,e)}get mercatorPosition(){const e=this.position;return new t.MercatorCoordinate(e[0],e[1],e[2])}get position(){const e=t.getColumn(this._transform,3);return[e[0],e[1],e[2]]}set position(t){gn(this._transform,t)}get orientation(){return this._orientation}set orientation(t){this._orientation=t,fn(this._transform,this._orientation)}getPitchBearing(){const t=this.forward(),e=this.right();return{bearing:Math.atan2(-e[1],e[0]),pitch:Math.atan2(Math.sqrt(t[0]*t[0]+t[1]*t[1]),-t[2])}}setPitchBearing(t,e){this._orientation=vn(t,e),fn(this._transform,this._orientation)}forward(){const e=t.getColumn(this._transform,2);return[-e[0],-e[1],-e[2]]}up(){const e=t.getColumn(this._transform,1);return[-e[0],-e[1],-e[2]]}right(){const e=t.getColumn(this._transform,0);return[e[0],e[1],e[2]]}getCameraToWorld(e,i){const n=new Float64Array(16);return t.invert(n,this.getWorldToCamera(e,i)),n}getWorldToCameraPosition(e,i,n){const r=this.position;t.scale$2(r,r,-e);const o=new Float64Array(16);return t.fromScaling(o,[n,n,n]),t.translate(o,o,r),o[10]*=i,o}getWorldToCamera(e,i){const n=new Float64Array(16),r=new Float64Array(4),o=this.position;return t.conjugate(r,this._orientation),t.scale$2(o,o,-e),t.fromQuat(n,r),t.translate(n,n,o),n[1]*=-1,n[5]*=-1,n[9]*=-1,n[13]*=-1,n[8]*=i,n[9]*=i,n[10]*=i,n[11]*=i,n}getCameraToClipPerspective(e,i,n,r){const o=new Float64Array(16);return t.perspective(o,e,i,n,r),o}getDistanceToElevation(e){const i=0===e?0:t.mercatorZfromAltitude(e,this.position[1]),n=this.forward();return(i-this.position[2])/n[2]}clone(){return new xn([...this.position],[...this.orientation])}}function bn(e,i){const n=kn(e),r=function(e,i,n,r,o){const a=new t.LngLat(n.lng-180*En,n.lat),s=new t.LngLat(n.lng+180*En,n.lat),l=e.project(a.lng,a.lat),c=e.project(s.lng,s.lat),u=-Math.atan2(c.y-l.y,c.x-l.x),d=t.MercatorCoordinate.fromLngLat(n);d.y=t.clamp(d.y,-.999975,.999975);const h=d.toLngLat(),p=e.project(h.lng,h.lat),m=t.MercatorCoordinate.fromLngLat(h);m.x+=En;const f=m.toLngLat(),g=e.project(f.lng,f.lat),v=Sn(g.x-p.x,g.y-p.y,u),y=t.MercatorCoordinate.fromLngLat(h);y.y+=En;const _=y.toLngLat(),x=e.project(_.lng,_.lat),b=Sn(x.x-p.x,x.y-p.y,u),w=Math.abs(v.x)/Math.abs(b.y),k=t.identity([]);t.rotateZ(k,k,-u*(1-(o?0:r)));const E=t.identity([]);return t.scale(E,E,[1,1-(1-w)*r,1]),E[4]=-b.x/b.y*r,t.rotateZ(E,E,u),t.multiply$1(E,k,E),E}(e.projection,0,e.center,n,i),o=wn(e);return t.scale(r,r,[o,o,1]),r}function wn(e){const i=e.projection,n=kn(e),r=Tn(i,e.center),o=Tn(i,t.LngLat.convert(i.center));return Math.pow(2,r*n+(1-n)*o)}function kn(e){const i=e.projection.range;if(!i)return 0;const n=Math.max(e.width,e.height),r=Math.log(n/1024)/Math.LN2;return t.smoothstep(i[0]+r,i[1]+r,e.zoom)}const En=1/4e4;function Tn(e,i){const n=t.clamp(i.lat,-t.MAX_MERCATOR_LATITUDE,t.MAX_MERCATOR_LATITUDE),r=new t.LngLat(i.lng-180*En,n),o=new t.LngLat(i.lng+180*En,n),a=e.project(r.lng,n),s=e.project(o.lng,n),l=t.MercatorCoordinate.fromLngLat(r),c=t.MercatorCoordinate.fromLngLat(o),u=s.x-a.x,d=s.y-a.y,h=c.x-l.x,p=c.y-l.y,m=Math.sqrt((h*h+p*p)/(u*u+d*d));return Math.log(m)/Math.LN2}function Sn(t,e,i){const n=Math.cos(i),r=Math.sin(i);return{x:t*n-e*r,y:t*r+e*n}}class Cn{constructor(e,i,n,r,o){this.tileSize=512,this._renderWorldCopies=void 0===o||o,this._minZoom=e||0,this._maxZoom=i||22,this._minPitch=null==n?0:n,this._maxPitch=null==r?60:r,this.setProjection(),this.setMaxBounds(),this.width=0,this.height=0,this._center=new t.LngLat(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._nearZ=0,this._farZ=0,this._unmodified=!0,this._edgeInsets=new mn,this._projMatrixCache={},this._alignedProjMatrixCache={},this._fogTileMatrixCache={},this._distanceTileDataCache={},this._camera=new xn,this._centerAltitude=0,this._averageElevation=0,this.cameraElevationReference="ground",this._projectionScaler=1,this._horizonShift=.1}clone(){const t=new Cn(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return t.setProjection(this.getProjection()),t._elevation=this._elevation,t._centerAltitude=this._centerAltitude,t.tileSize=this.tileSize,t.setMaxBounds(this.getMaxBounds()),t.width=this.width,t.height=this.height,t.cameraElevationReference=this.cameraElevationReference,t._center=this._center,t._setZoom(this.zoom),t._cameraZoom=this._cameraZoom,t.angle=this.angle,t._fov=this._fov,t._pitch=this._pitch,t._nearZ=this._nearZ,t._farZ=this._farZ,t._averageElevation=this._averageElevation,t._unmodified=this._unmodified,t._edgeInsets=this._edgeInsets.clone(),t._camera=this._camera.clone(),t._calcMatrices(),t.freezeTileCoverage=this.freezeTileCoverage,t}get elevation(){return this._elevation}set elevation(t){this._elevation!==t&&(this._elevation=t,t?this._updateCenterElevation()&&this._updateCameraOnTerrain():(this._cameraZoom=null,this._centerAltitude=0),this._calcMatrices())}updateElevation(t){this._terrainEnabled()&&null==this._cameraZoom&&this._updateCenterElevation()&&this._updateCameraOnTerrain(),t&&this._constrainCameraAltitude(),this._calcMatrices()}getProjection(){return t.pick(this.projection,["name","center","parallels"])}setProjection(e){null==e&&(e={name:"mercator"}),this.projectionOptions=e;const i=this.projection?this.getProjection():void 0;return this.projection=t.getProjection(e),!o(i,this.getProjection())&&(this._calcMatrices(),!0)}get minZoom(){return this._minZoom}set minZoom(t){this._minZoom!==t&&(this._minZoom=t,this.zoom=Math.max(this.zoom,t))}get maxZoom(){return this._maxZoom}set maxZoom(t){this._maxZoom!==t&&(this._maxZoom=t,this.zoom=Math.min(this.zoom,t))}get minPitch(){return this._minPitch}set minPitch(t){this._minPitch!==t&&(this._minPitch=t,this.pitch=Math.max(this.pitch,t))}get maxPitch(){return this._maxPitch}set maxPitch(t){this._maxPitch!==t&&(this._maxPitch=t,this.pitch=Math.min(this.pitch,t))}get renderWorldCopies(){return this._renderWorldCopies&&!0===this.projection.supportsWorldCopies}set renderWorldCopies(t){void 0===t?t=!0:null===t&&(t=!1),this._renderWorldCopies=t}get worldSize(){return this.tileSize*this.scale}get cameraWorldSize(){const t=Math.max(this._camera.getDistanceToElevation(this._averageElevation),Number.EPSILON);return this._worldSizeFromZoom(this._zoomFromMercatorZ(t))}get pixelsPerMeter(){return this.projection.pixelsPerMeter(this.center.lat,this.worldSize)}get cameraPixelsPerMeter(){return this.projection.pixelsPerMeter(this.center.lat,this.cameraWorldSize)}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new t.pointGeometry(this.width,this.height)}get bearing(){return t.wrap(this.rotation,-180,180)}set bearing(t){this.rotation=t}get rotation(){return-this.angle/Math.PI*180}set rotation(e){const i=-e*Math.PI/180;var n;this.angle!==i&&(this._unmodified=!1,this.angle=i,this._calcMatrices(),this.rotationMatrix=(n=new t.ARRAY_TYPE(4),t.ARRAY_TYPE!=Float32Array&&(n[1]=0,n[2]=0),n[0]=1,n[3]=1,n),function(t,e,i){var n=e[0],r=e[1],o=e[2],a=e[3],s=Math.sin(i),l=Math.cos(i);t[0]=n*l+o*s,t[1]=r*l+a*s,t[2]=n*-s+o*l,t[3]=r*-s+a*l}(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(e){const i=t.clamp(e,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==i&&(this._unmodified=!1,this._pitch=i,this._calcMatrices())}get fov(){return this._fov/Math.PI*180}set fov(t){t=Math.max(.01,Math.min(60,t)),this._fov!==t&&(this._unmodified=!1,this._fov=t/180*Math.PI,this._calcMatrices())}get averageElevation(){return this._averageElevation}set averageElevation(t){this._averageElevation=t,this._calcFogMatrices()}get zoom(){return this._zoom}set zoom(t){const e=Math.min(Math.max(t,this.minZoom),this.maxZoom);this._zoom!==e&&(this._unmodified=!1,this._setZoom(e),this._terrainEnabled()&&this._updateCameraOnTerrain(),this._constrain(),this._calcMatrices())}_setZoom(t){this._zoom=t,this.scale=this.zoomScale(t),this.tileZoom=Math.floor(t),this.zoomFraction=t-this.tileZoom}_updateCenterElevation(){if(!this._elevation)return!1;const t=this._elevation.getAtPointOrZero(this.locationCoordinate(this.center),-1);return-1===t?(this._cameraZoom=null,!1):(this._centerAltitude=t,!0)}_updateCameraOnTerrain(){this._cameraZoom=this._zoomFromMercatorZ((this.pixelsPerMeter*this._centerAltitude+this.cameraToCenterDistance)/this.worldSize)}sampleAverageElevation(){if(!this._elevation)return 0;const e=this._elevation,i=[[.5,.2],[.3,.5],[.5,.5],[.7,.5],[.5,.8]],n=this.horizonLineFromTop();let r=0,o=0;for(let a=0;ae.maxzoom&&(i=e.maxzoom);const a=this.locationCoordinate(this.center),s=1<{const i=1/4e4,n=new t.MercatorCoordinate(e.x+i,e.y,e.z),r=new t.MercatorCoordinate(e.x,e.y+i,e.z),o=e.toLngLat(),a=n.toLngLat(),s=r.toLngLat(),l=this.locationCoordinate(o),c=this.locationCoordinate(a),u=this.locationCoordinate(s),d=Math.hypot(c.x-l.x,c.y-l.y),h=Math.hypot(u.x-l.x,u.y-l.y);return Math.sqrt(d*h)*y/i},x=e=>{const i=g,n=v;return{aabb:t.tileAABB(this,s,0,0,0,e,n,i,this.projection),zoom:0,x:0,y:0,minZ:n,maxZ:i,wrap:e,fullyVisible:!1}},b=[];let w=[];const k=i,E=e.reparseOverscaled?n:i,T=t=>t*t,S=T((h-this._centerAltitude)*d),C=t=>{if(!this._elevation||!t.tileID||!o)return;const e=this._elevation.getMinMaxForTile(t.tileID),i=t.aabb;e?(i.min[2]=e.min,i.max[2]=e.max,i.center[2]=(i.min[2]+i.max[2])/2):(t.shouldSplit=M(t),t.shouldSplit||(i.min[2]=i.max[2]=i.center[2]=this._centerAltitude))},M=e=>{if(e.zoom.85?1:n}const l=i*i+o*o+a;return l{if(e*T(.707)0;){const n=b.pop(),a=n.x,u=n.y;let d=n.fullyVisible;if(!d){const t=n.aabb.intersects(c);if(0===t)continue;d=2===t}if(n.zoom!==k&&M(n))for(let e=0;e<4;e++){const i=(a<<1)+e%2,l=(u<<1)+(e>>1),c={aabb:o?n.aabb.quadrant(e):t.tileAABB(this,s,n.zoom+1,i,l,n.wrap,n.minZ,n.maxZ,this.projection),zoom:n.zoom+1,x:i,y:l,wrap:n.wrap,fullyVisible:d,tileID:void 0,shouldSplit:void 0,minZ:n.minZ,maxZ:n.maxZ};r&&(c.tileID=new t.OverscaledTileID(n.zoom+1===k?E:n.zoom+1,n.wrap,n.zoom+1,i,l),C(c)),b.push(c)}else{const r=n.zoom===k?E:n.zoom;if(e.minzoom&&e.minzoom>r)continue;const o=l[0]-(.5+a+(n.wrap<{const o=[0,0,0,1],a=[t.EXTENT,t.EXTENT,0,1],s=this.calculateFogTileMatrix(r.tileID.toUnwrapped());t.transformMat4$1(o,o,s),t.transformMat4$1(a,a,s);const l=t.getAABBPointSquareDist(o,a);if(0===l)return!0;let c=!1;const u=this._elevation;if(u&&l>i&&0!==n){const i=this.calculateProjMatrix(r.tileID.toUnwrapped());let o;e.isTerrainDEM||(o=u.getMinMaxForTile(r.tileID)),o||(o={min:v,max:g});const a=t.furthestTileCorner(this.rotation),s=[a[0]*t.EXTENT,a[1]*t.EXTENT,o.max];t.transformMat4(s,s,i),c=(1-s[1])*this.height*.5t.distanceSq-e.distanceSq)).map((t=>t.tileID))}resize(t,e){this.width=t,this.height=e,this.pixelsToGLUnits=[2/t,-2/e],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(t){return Math.pow(2,t)}scaleZoom(t){return Math.log(t)/Math.LN2}project(e){const i=t.clamp(e.lat,-t.MAX_MERCATOR_LATITUDE,t.MAX_MERCATOR_LATITUDE),n=this.projection.project(e.lng,i);return new t.pointGeometry(n.x*this.worldSize,n.y*this.worldSize)}unproject(t){return this.projection.unproject(t.x/this.worldSize,t.y/this.worldSize)}get point(){return this.project(this.center)}setLocationAtPoint(e,i){const n=this.pointCoordinate(i),r=this.pointCoordinate(this.centerPoint),o=this.locationCoordinate(e);this.setLocation(new t.MercatorCoordinate(o.x-(n.x-r.x),o.y-(n.y-r.y)))}setLocation(t){this.center=this.coordinateLocation(t),this.projection.wrap&&(this.center=this.center.wrap())}locationPoint(t){return this.projection.locationPoint(this,t)}locationPoint3D(t){return this._coordinatePoint(this.locationCoordinate(t),!0)}pointLocation(t){return this.coordinateLocation(this.pointCoordinate(t))}pointLocation3D(t){return this.coordinateLocation(this.pointCoordinate3D(t))}locationCoordinate(e,i){const n=i?t.mercatorZfromAltitude(i,e.lat):void 0,r=this.projection.project(e.lng,e.lat);return new t.MercatorCoordinate(r.x,r.y,n)}coordinateLocation(t){return this.projection.unproject(t.x,t.y)}pointRayIntersection(e,i){const n=null!=i?i:this._centerAltitude,r=[e.x,e.y,0,1],o=[e.x,e.y,1,1];t.transformMat4$1(r,r,this.pixelMatrixInverse),t.transformMat4$1(o,o,this.pixelMatrixInverse);const a=o[3];t.scale$1(r,r,1/r[3]),t.scale$1(o,o,1/a);const s=r[2],l=o[2];return{p0:r,p1:o,t:s===l?0:(n-s)/(l-s)}}screenPointToMercatorRay(e){const i=[e.x,e.y,0,1],n=[e.x,e.y,1,1];return t.transformMat4$1(i,i,this.pixelMatrixInverse),t.transformMat4$1(n,n,this.pixelMatrixInverse),t.scale$1(i,i,1/i[3]),t.scale$1(n,n,1/n[3]),i[2]=t.mercatorZfromAltitude(i[2],this._center.lat)*this.worldSize,n[2]=t.mercatorZfromAltitude(n[2],this._center.lat)*this.worldSize,t.scale$1(i,i,1/this.worldSize),t.scale$1(n,n,1/this.worldSize),new t.Ray([i[0],i[1],i[2]],t.normalize([],t.sub([],n,i)))}rayIntersectionCoordinate(e){const{p0:i,p1:n,t:r}=e,o=t.mercatorZfromAltitude(i[2],this._center.lat),a=t.mercatorZfromAltitude(n[2],this._center.lat);return new t.MercatorCoordinate(t.number(i[0],n[0],r)/this.worldSize,t.number(i[1],n[1],r)/this.worldSize,t.number(o,a,r))}pointCoordinate(t,e=this._centerAltitude){return this.projection.createTileTransform(this,this.worldSize).pointCoordinate(t.x,t.y,e)}pointCoordinate3D(e){if(!this.elevation)return this.pointCoordinate(e);const i=this.elevation;let n=this.elevation.pointCoordinate(e);if(n)return new t.MercatorCoordinate(n[0],n[1],n[2]);let r=0,o=this.horizonLineFromTop();if(e.y>o)return this.pointCoordinate(e);const a=.02*o,s=e.clone();for(let e=0;e<10&&o-r>a;e++){s.y=t.number(r,o,.66);const e=i.pointCoordinate(s);e?(o=s.y,n=e):r=s.y}return n?new t.MercatorCoordinate(n[0],n[1],n[2]):this.pointCoordinate(e)}isPointAboveHorizon(t){if(this.elevation)return!this.elevation.pointCoordinate(t);{const e=this.horizonLineFromTop();return t.y0?new t.pointGeometry(r[0]/r[3],r[1]/r[3]):new t.pointGeometry(Number.MAX_VALUE,Number.MAX_VALUE)}_getBounds(e,i){const n=new t.pointGeometry(this._edgeInsets.left,this._edgeInsets.top),r=new t.pointGeometry(this.width-this._edgeInsets.right,this._edgeInsets.top),o=new t.pointGeometry(this.width-this._edgeInsets.right,this.height-this._edgeInsets.bottom),a=new t.pointGeometry(this._edgeInsets.left,this.height-this._edgeInsets.bottom);let s=this.pointCoordinate(n,e),l=this.pointCoordinate(r,e);const c=this.pointCoordinate(o,i),u=this.pointCoordinate(a,i),d=(t,e)=>(e.y-t.y)/(e.x-t.x);return s.y>1&&l.y>=0?s=new t.MercatorCoordinate((1-u.y)/d(u,s)+u.x,1):s.y<0&&l.y<=1&&(s=new t.MercatorCoordinate(-u.y/d(u,s)+u.x,0)),l.y>1&&s.y>=0?l=new t.MercatorCoordinate((1-c.y)/d(c,l)+c.x,1):l.y<0&&s.y<=1&&(l=new t.MercatorCoordinate(-c.y/d(c,l)+c.x,0)),(new t.LngLatBounds).extend(this.coordinateLocation(s)).extend(this.coordinateLocation(l)).extend(this.coordinateLocation(u)).extend(this.coordinateLocation(c))}_getBounds3D(){const t=this.elevation;if(!t.visibleDemTiles.length)return this._getBounds(0,0);const e=t.visibleDemTiles.reduce(((t,e)=>{if(e.dem){const i=e.dem.tree;t.min=Math.min(t.min,i.minimums[0]),t.max=Math.max(t.max,i.maximums[0])}return t}),{min:Number.MAX_VALUE,max:0});return this._getBounds(e.min*t.exaggeration(),e.max*t.exaggeration())}getBounds(){return this._terrainEnabled()?this._getBounds3D():this._getBounds(0,0)}horizonLineFromTop(t=!0){const e=this.height/2/Math.tan(this._fov/2)/Math.tan(Math.max(this._pitch,.1))+this.centerOffset.y,i=this.height/2-e*(1-this._horizonShift);return t?Math.max(0,i):i}getMaxBounds(){return this.maxBounds}setMaxBounds(e){this.maxBounds=e,this.minLat=-t.MAX_MERCATOR_LATITUDE,this.maxLat=t.MAX_MERCATOR_LATITUDE,this.minLng=-180,this.maxLng=180,e&&(this.minLat=e.getSouth(),this.maxLat=e.getNorth(),this.minLng=e.getWest(),this.maxLng=e.getEast(),this.maxLngu&&(a=u-l),u-ce&&(o=e-s),e-t.5?y-1:y,_>.5?_-1:_,0]),this.alignedProjMatrix=x,s=t.create(),t.scale(s,s,[this.width/2,-this.height/2,1]),t.translate(s,s,[1,-1,0]),this.labelPlaneMatrix=s,s=t.create(),t.scale(s,s,[1,-1,1]),t.translate(s,s,[-1,-1,0]),t.scale(s,s,[2/this.width,2/this.height,1]),this.glCoordMatrix=s,this.pixelMatrix=t.multiply$1(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),this._calcFogMatrices(),this._distanceTileDataCache={},s=t.invert(new Float64Array(16),this.pixelMatrix),!s)throw new Error("failed to invert matrix");this.pixelMatrixInverse=s,this._projMatrixCache={},this._alignedProjMatrixCache={},this._pixelsToTileUnitsCache={}}_calcFogMatrices(){this._fogTileMatrixCache={};const e=this.cameraWorldSize,i=this.cameraPixelsPerMeter,n=this._camera.position,r=1/this.height,o=[e,e,i];t.scale$2(o,o,r),t.scale$2(n,n,-1),t.multiply$2(n,n,o);const a=t.create();t.translate(a,a,n),t.scale(a,a,o),this.mercatorFogMatrix=a,this.worldToFogMatrix=this._camera.getWorldToCameraPosition(e,i,r)}_computeCameraPosition(t){const e=(t=t||this.pixelsPerMeter)/this.pixelsPerMeter,i=this._camera.forward(),n=this.point,r=this._mercatorZfromZoom(this._cameraZoom?this._cameraZoom:this._zoom)*e-t/this.worldSize*this._centerAltitude;return[n.x/this.worldSize-i[0]*r,n.y/this.worldSize-i[1]*r,t/this.worldSize*this._centerAltitude-i[2]*r]}_updateCameraState(){this.height&&(this._camera.setPitchBearing(this._pitch,this.angle),this._camera.position=this._computeCameraPosition())}_translateCameraConstrained(e){const i=this._maxCameraBoundsDistance()*Math.cos(this._pitch),n=e[2];let r=1;n>0&&(r=Math.min((i-this._camera.position[2])/n,1)),this._camera.position=t.scaleAndAdd([],this._camera.position,e,r),this._updateStateFromCamera()}_updateStateFromCamera(){const e=this._camera.position,i=this._camera.forward(),{pitch:n,bearing:r}=this._camera.getPitchBearing(),o=t.mercatorZfromAltitude(this._centerAltitude,this.center.lat)*this._projectionScaler,a=this._mercatorZfromZoom(this._maxZoom)*Math.cos(t.degToRad(this._maxPitch)),s=Math.max((e[2]-o)/Math.cos(n),a),l=this._zoomFromMercatorZ(s);t.scaleAndAdd(e,e,i,s),this._pitch=t.clamp(n,t.degToRad(this.minPitch),t.degToRad(this.maxPitch)),this.angle=t.wrap(r,-Math.PI,Math.PI),this._setZoom(t.clamp(l,this._minZoom,this._maxZoom)),this._terrainEnabled()&&this._updateCameraOnTerrain(),this._center=this.coordinateLocation(new t.MercatorCoordinate(e[0],e[1],e[2])),this._unmodified=!1,this._constrain(),this._calcMatrices()}_worldSizeFromZoom(t){return Math.pow(2,t)*this.tileSize}_mercatorZfromZoom(t){return this.cameraToCenterDistance/this._worldSizeFromZoom(t)}_minimumHeightOverTerrain(){const t=Math.min((null!=this._cameraZoom?this._cameraZoom:this._zoom)+2,this._maxZoom);return this._mercatorZfromZoom(t)}_zoomFromMercatorZ(t){return this.scaleZoom(this.cameraToCenterDistance/(t*this.tileSize))}_terrainEnabled(){return!(!this._elevation||!this.projection.supportsTerrain&&(t.warnOnce("Terrain is not yet supported with alternate projections. Use mercator to enable terrain."),1))}anyCornerOffEdge(e,i){const n=Math.min(e.x,i.x),r=Math.max(e.x,i.x),o=Math.min(e.y,i.y),a=Math.max(e.y,i.y);if(oc||i.y>1)return!0}return!1}isHorizonVisible(){return this.pitch+t.radToDeg(this.fovAboveCenter)>88||this.anyCornerOffEdge(new t.pointGeometry(0,0),new t.pointGeometry(this.width,this.height))}zoomDeltaToMovement(e,i){const n=t.length(t.sub([],this._camera.position,e)),r=this._zoomFromMercatorZ(n)+i;return n-this._mercatorZfromZoom(r)}getCameraPoint(){const e=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new t.pointGeometry(0,e))}}function Mn(t,e){let i=!1,n=null;const r=()=>{n=null,i&&(t(),n=setTimeout(r,e),i=!1)};return()=>(i=!0,n||r(),n)}class zn{constructor(e){this._hashName=e&&encodeURIComponent(e),t.bindAll(["_getCurrentHash","_onHashChange","_updateHash"],this),this._updateHash=Mn(this._updateHashUnthrottled.bind(this),300)}addTo(e){return this._map=e,t.window.addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this}remove(){return t.window.removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),delete this._map,this}getHashString(e){const i=this._map.getCenter(),n=Math.round(100*this._map.getZoom())/100,r=Math.ceil((n*Math.LN2+Math.log(512/360/.5))/Math.LN10),o=Math.pow(10,r),a=Math.round(i.lng*o)/o,s=Math.round(i.lat*o)/o,l=this._map.getBearing(),c=this._map.getPitch();let u="";if(u+=e?`/${a}/${s}/${n}`:`${n}/${s}/${a}`,(l||c)&&(u+="/"+Math.round(10*l)/10),c&&(u+=`/${Math.round(c)}`),this._hashName){const e=this._hashName;let i=!1;const n=t.window.location.hash.slice(1).split("&").map((t=>{const n=t.split("=")[0];return n===e?(i=!0,`${n}=${u}`):t})).filter((t=>t));return i||n.push(`${e}=${u}`),`#${n.join("&")}`}return`#${u}`}_getCurrentHash(){const e=t.window.location.hash.replace("#","");if(this._hashName){let t;return e.split("&").map((t=>t.split("="))).forEach((e=>{e[0]===this._hashName&&(t=e)})),(t&&t[1]||"").split("/")}return e.split("/")}_onHashChange(){const t=this._getCurrentHash();if(t.length>=3&&!t.some((t=>isNaN(t)))){const e=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(t[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+t[2],+t[1]],zoom:+t[0],bearing:e,pitch:+(t[4]||0)}),!0}return!1}_updateHashUnthrottled(){const e=t.window.location.href.replace(/(#.+)?$/,this.getHashString());t.window.history.replaceState(t.window.history.state,null,e)}}const In={linearity:.3,easing:t.bezier(0,0,.3,1)},Pn=t.extend({deceleration:2500,maxSpeed:1400},In),An=t.extend({deceleration:20,maxSpeed:1400},In),Dn=t.extend({deceleration:1e3,maxSpeed:360},In),On=t.extend({deceleration:1e3,maxSpeed:90},In);class Ln{constructor(t){this._map=t,this.clear()}clear(){this._inertiaBuffer=[]}record(e){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:t.exported.now(),settings:e})}_drainInertiaBuffer(){const e=this._inertiaBuffer,i=t.exported.now();for(;e.length>0&&i-e[0].time>160;)e.shift()}_onMoveEnd(e){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;const i={zoom:0,bearing:0,pitch:0,pan:new t.pointGeometry(0,0),pinchAround:void 0,around:void 0};for(const{settings:t}of this._inertiaBuffer)i.zoom+=t.zoomDelta||0,i.bearing+=t.bearingDelta||0,i.pitch+=t.pitchDelta||0,t.panDelta&&i.pan._add(t.panDelta),t.around&&(i.around=t.around),t.pinchAround&&(i.pinchAround=t.pinchAround);const n=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,r={};if(i.pan.mag()){const o=Bn(i.pan.mag(),n,t.extend({},Pn,e||{}));r.offset=i.pan.mult(o.amount/i.pan.mag()),r.center=this._map.transform.center,Rn(r,o)}if(i.zoom){const t=Bn(i.zoom,n,An);r.zoom=this._map.transform.zoom+t.amount,Rn(r,t)}if(i.bearing){const e=Bn(i.bearing,n,Dn);r.bearing=this._map.transform.bearing+t.clamp(e.amount,-179,179),Rn(r,e)}if(i.pitch){const t=Bn(i.pitch,n,On);r.pitch=this._map.transform.pitch+t.amount,Rn(r,t)}if(r.zoom||r.bearing){const t=void 0===i.pinchAround?i.around:i.pinchAround;r.around=t?this._map.unproject(t):this._map.getCenter()}return this.clear(),t.extend(r,{noMoveStart:!0})}}function Rn(t,e){(!t.duration||t.durationi.unproject(t))),l=o.reduce(((t,e,i,n)=>t.add(e.div(n.length))),new t.pointGeometry(0,0));super(e,{points:o,point:l,lngLats:s,lngLat:i.unproject(l),originalEvent:n}),this._defaultPrevented=!1}}class Nn extends t.Event{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(t,e,i){super(t,{originalEvent:i}),this._defaultPrevented=!1}}class Vn{constructor(t,e){this._map=t,this._clickTolerance=e.clickTolerance}reset(){delete this._mousedownPos}wheel(t){return this._firePreventable(new Nn(t.type,this._map,t))}mousedown(t,e){return this._mousedownPos=e,this._firePreventable(new Fn(t.type,this._map,t))}mouseup(t){this._map.fire(new Fn(t.type,this._map,t))}preclick(e){const i=t.extend({},e);i.type="preclick",this._map.fire(new Fn(i.type,this._map,i))}click(t,e){this._mousedownPos&&this._mousedownPos.dist(e)>=this._clickTolerance||(this.preclick(t),this._map.fire(new Fn(t.type,this._map,t)))}dblclick(t){return this._firePreventable(new Fn(t.type,this._map,t))}mouseover(t){this._map.fire(new Fn(t.type,this._map,t))}mouseout(t){this._map.fire(new Fn(t.type,this._map,t))}touchstart(t){return this._firePreventable(new jn(t.type,this._map,t))}touchmove(t){this._map.fire(new jn(t.type,this._map,t))}touchend(t){this._map.fire(new jn(t.type,this._map,t))}touchcancel(t){this._map.fire(new jn(t.type,this._map,t))}_firePreventable(t){if(this._map.fire(t),t.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Un{constructor(t){this._map=t}reset(){this._delayContextMenu=!1,delete this._contextMenuEvent}mousemove(t){this._map.fire(new Fn(t.type,this._map,t))}mousedown(){this._delayContextMenu=!0}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Fn("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(t){this._delayContextMenu?this._contextMenuEvent=t:this._map.fire(new Fn(t.type,this._map,t)),this._map.listens("contextmenu")&&t.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Zn{constructor(t,e){this._map=t,this._el=t.getCanvasContainer(),this._container=t.getContainer(),this._clickTolerance=e.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(t,e){this.isEnabled()&&t.shiftKey&&0===t.button&&(a.disableDrag(),this._startPos=this._lastPos=e,this._active=!0)}mousemoveWindow(t,e){if(!this._active)return;const i=e;if(this._lastPos.equals(i)||!this._box&&i.dist(this._startPos){this._box&&(this._box.style.transform=`translate(${r}px,${s}px)`,this._box.style.width=o-r+"px",this._box.style.height=l-s+"px")}))}mouseupWindow(e,i){if(!this._active)return;if(0!==e.button)return;const n=this._startPos,r=i;if(this.reset(),a.suppressClick(),n.x!==r.x||n.y!==r.y)return this._map.fire(new t.Event("boxzoomend",{originalEvent:e})),{cameraAnimation:t=>t.fitScreenCoordinates(n,r,this._map.getBearing(),{linear:!1})};this._fireEvent("boxzoomcancel",e)}keydown(t){this._active&&27===t.keyCode&&(this.reset(),this._fireEvent("boxzoomcancel",t))}blur(){this.reset()}reset(){this._active=!1,this._container.classList.remove("mapboxgl-crosshair"),this._box&&(this._box.remove(),this._box=null),a.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(e,i){return this._map.fire(new t.Event(e,{originalEvent:i}))}}function $n(t,e){const i={};for(let n=0;nthis.numTouches)&&(this.aborted=!0),this.aborted||(void 0===this.startTime&&(this.startTime=e.timeStamp),n.length===this.numTouches&&(this.centroid=function(e){const i=new t.pointGeometry(0,0);for(const t of e)i._add(t);return i.div(e.length)}(i),this.touches=$n(n,i)))}touchmove(t,e,i){if(this.aborted||!this.centroid)return;const n=$n(i,e);for(const t in this.touches){const e=this.touches[t],i=n[t];(!i||i.dist(e)>30)&&(this.aborted=!0)}}touchend(t,e,i){if((!this.centroid||t.timeStamp-this.startTime>500)&&(this.aborted=!0),0===i.length){const t=!this.aborted&&this.centroid;if(this.reset(),t)return t}}}class qn{constructor(t){this.singleTap=new Gn(t),this.numTaps=t.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(t,e,i){this.singleTap.touchstart(t,e,i)}touchmove(t,e,i){this.singleTap.touchmove(t,e,i)}touchend(t,e,i){const n=this.singleTap.touchend(t,e,i);if(n){const e=t.timeStamp-this.lastTime<500,i=!this.lastTap||this.lastTap.dist(n)<30;if(e&&i||this.reset(),this.count++,this.lastTime=t.timeStamp,this.lastTap=n,this.count===this.numTaps)return this.reset(),n}}}class Wn{constructor(){this._zoomIn=new qn({numTouches:1,numTaps:2}),this._zoomOut=new qn({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(t,e,i){this._zoomIn.touchstart(t,e,i),this._zoomOut.touchstart(t,e,i)}touchmove(t,e,i){this._zoomIn.touchmove(t,e,i),this._zoomOut.touchmove(t,e,i)}touchend(t,e,i){const n=this._zoomIn.touchend(t,e,i),r=this._zoomOut.touchend(t,e,i);return n?(this._active=!0,t.preventDefault(),setTimeout((()=>this.reset()),0),{cameraAnimation:e=>e.easeTo({duration:300,zoom:e.getZoom()+1,around:e.unproject(n)},{originalEvent:t})}):r?(this._active=!0,t.preventDefault(),setTimeout((()=>this.reset()),0),{cameraAnimation:e=>e.easeTo({duration:300,zoom:e.getZoom()-1,around:e.unproject(r)},{originalEvent:t})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}const Hn={0:1,2:2};class Xn{constructor(t){this.reset(),this._clickTolerance=t.clickTolerance||1}blur(){this.reset()}reset(){this._active=!1,this._moved=!1,delete this._lastPoint,delete this._eventButton}_correctButton(t,e){return!1}_move(t,e){return{}}mousedown(t,e){if(this._lastPoint)return;const i=a.mouseButton(t);this._correctButton(t,i)&&(this._lastPoint=e,this._eventButton=i)}mousemoveWindow(t,e){const i=this._lastPoint;if(i)if(t.preventDefault(),function(t,e){const i=Hn[e];return void 0===t.buttons||(t.buttons&i)!==i}(t,this._eventButton))this.reset();else if(this._moved||!(e.dist(i)0&&(this._active=!0);const r=$n(n,i),o=new t.pointGeometry(0,0),a=new t.pointGeometry(0,0);let s=0;for(const t in r){const e=r[t],i=this._touches[t];i&&(o._add(e),a._add(e.sub(i)),s++,r[t]=e)}if(this._touches=r,s{this._alertContainer.classList.remove("mapboxgl-touch-pan-blocker-show")}),500)}}class tr{constructor(){this.reset()}reset(){this._active=!1,delete this._firstTwoTouches}_start(t){}_move(t,e,i){return{}}touchstart(t,e,i){this._firstTwoTouches||i.length<2||(this._firstTwoTouches=[i[0].identifier,i[1].identifier],this._start([e[0],e[1]]))}touchmove(t,e,i){if(!this._firstTwoTouches)return;t.preventDefault();const[n,r]=this._firstTwoTouches,o=er(i,e,n),a=er(i,e,r);if(!o||!a)return;const s=this._aroundCenter?null:o.add(a).div(2);return this._move([o,a],s,t)}touchend(t,e,i){if(!this._firstTwoTouches)return;const[n,r]=this._firstTwoTouches,o=er(i,e,n),s=er(i,e,r);o&&s||(this._active&&a.suppressClick(),this.reset())}touchcancel(){this.reset()}enable(t){this._enabled=!0,this._aroundCenter=!!t&&"center"===t.around}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}function er(t,e,i){for(let n=0;nMath.abs(t.x)}class sr extends tr{constructor(t){super(),this._map=t}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}_start(t){this._lastPoints=t,ar(t[0].sub(t[1]))&&(this._valid=!1)}_move(t,e,i){const n=t[0].sub(this._lastPoints[0]),r=t[1].sub(this._lastPoints[1]);if(!(this._map._cooperativeGestures&&i.touches.length<3)&&(this._valid=this.gestureBeginsVertically(n,r,i.timeStamp),this._valid))return this._lastPoints=t,this._active=!0,{pitchDelta:(n.y+r.y)/2*-.5}}gestureBeginsVertically(t,e,i){if(void 0!==this._valid)return this._valid;const n=t.mag()>=2,r=e.mag()>=2;if(!n&&!r)return;if(!n||!r)return void 0===this._firstMove&&(this._firstMove=i),i-this._firstMove<100&&void 0;const o=t.y>0==e.y>0;return ar(t)&&ar(e)&&o}}const lr={panStep:100,bearingStep:15,pitchStep:10};class cr{constructor(){const t=lr;this._panStep=t.panStep,this._bearingStep=t.bearingStep,this._pitchStep=t.pitchStep,this._rotationDisabled=!1}blur(){this.reset()}reset(){this._active=!1}keydown(t){if(t.altKey||t.ctrlKey||t.metaKey)return;let e=0,i=0,n=0,r=0,o=0;switch(t.keyCode){case 61:case 107:case 171:case 187:e=1;break;case 189:case 109:case 173:e=-1;break;case 37:t.shiftKey?i=-1:(t.preventDefault(),r=-1);break;case 39:t.shiftKey?i=1:(t.preventDefault(),r=1);break;case 38:t.shiftKey?n=1:(t.preventDefault(),o=-1);break;case 40:t.shiftKey?n=-1:(t.preventDefault(),o=1);break;default:return}return this._rotationDisabled&&(i=0,n=0),{cameraAnimation:a=>{const s=a.getZoom();a.easeTo({duration:300,easeId:"keyboardHandler",easing:ur,zoom:e?Math.round(s)+e*(t.shiftKey?2:1):s,bearing:a.getBearing()+i*this._bearingStep,pitch:a.getPitch()+n*this._pitchStep,offset:[-r*this._panStep,-o*this._panStep],center:a.getCenter()},{originalEvent:t})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}disableRotation(){this._rotationDisabled=!0}enableRotation(){this._rotationDisabled=!1}}function ur(t){return t*(2-t)}const dr=4.000244140625;class hr{constructor(e,i){this._map=e,this._el=e.getCanvasContainer(),this._handler=i,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222,t.bindAll(["_onTimeout","_addScrollZoomBlocker","_showBlockerAlert","_isFullscreen"],this)}setZoomRate(t){this._defaultZoomRate=t}setWheelZoomRate(t){this._wheelZoomRate=t}isEnabled(){return!!this._enabled}isActive(){return!!this._active||void 0!==this._finishTimeout}isZooming(){return!!this._zooming}enable(t){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!t&&"center"===t.around,this._map._cooperativeGestures&&this._addScrollZoomBlocker())}disable(){this.isEnabled()&&(this._enabled=!1,this._map._cooperativeGestures&&(clearTimeout(this._alertTimer),this._alertContainer.remove()))}wheel(e){if(!this.isEnabled())return;if(this._map._cooperativeGestures){if(!(e.ctrlKey||e.metaKey||this.isZooming()||this._isFullscreen()))return void this._showBlockerAlert();"hidden"!==this._alertContainer.style.visibility&&(this._alertContainer.style.visibility="hidden",clearTimeout(this._alertTimer))}let i=e.deltaMode===t.window.WheelEvent.DOM_DELTA_LINE?40*e.deltaY:e.deltaY;const n=t.exported.now(),r=n-(this._lastWheelEventTime||0);this._lastWheelEventTime=n,0!==i&&i%dr==0?this._type="wheel":0!==i&&Math.abs(i)<4?this._type="trackpad":r>400?(this._type=null,this._lastValue=i,this._timeout=setTimeout(this._onTimeout,40,e)):this._type||(this._type=Math.abs(r*i)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,i+=this._lastValue)),e.shiftKey&&i&&(i/=4),this._type&&(this._lastWheelEvent=e,this._delta-=i,this._active||this._start(e)),e.preventDefault()}_onTimeout(t){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(t)}_start(t){if(!this._delta)return;this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);const e=a.mousePos(this._el,t);this._aroundPoint=this._aroundCenter?this._map.transform.centerPoint:e,this._aroundCoord=this._map.transform.pointCoordinate3D(this._aroundPoint),this._targetZoom=void 0,this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}renderFrame(){if(!this._frameId)return;if(this._frameId=null,!this.isActive())return;const e=this._map.transform,i=()=>e._terrainEnabled()&&this._aroundCoord?e.computeZoomRelativeTo(this._aroundCoord):e.zoom;if(0!==this._delta){const t="wheel"===this._type&&Math.abs(this._delta)>dr?this._wheelZoomRate:this._defaultZoomRate;let n=2/(1+Math.exp(-Math.abs(this._delta*t)));this._delta<0&&0!==n&&(n=1/n);const r=i(),o=Math.pow(2,r),a="number"==typeof this._targetZoom?e.zoomScale(this._targetZoom):o;this._targetZoom=Math.min(e.maxZoom,Math.max(e.minZoom,e.scaleZoom(a*n))),"wheel"===this._type&&(this._startZoom=i(),this._easing=this._smoothOutEasing(200)),this._delta=0}const n="number"==typeof this._targetZoom?this._targetZoom:i(),r=this._startZoom,o=this._easing;let a,s=!1;if("wheel"===this._type&&r&&o){const e=Math.min((t.exported.now()-this._lastWheelEventTime)/200,1),i=o(e);a=t.number(r,n,i),e<1?this._frameId||(this._frameId=!0):s=!0}else a=n,s=!0;return this._active=!0,s&&(this._active=!1,this._finishTimeout=setTimeout((()=>{this._zooming=!1,this._handler._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout}),200)),{noInertia:!0,needsRenderFrame:!s,zoomDelta:a-i(),around:this._aroundPoint,aroundCoord:this._aroundCoord,originalEvent:this._lastWheelEvent}}_smoothOutEasing(e){let i=t.ease;if(this._prevEase){const e=this._prevEase,n=(t.exported.now()-e.start)/e.duration,r=e.easing(n+.01)-e.easing(n),o=.27/Math.sqrt(r*r+1e-4)*.01,a=Math.sqrt(.0729-o*o);i=t.bezier(o,a,.25,1)}return this._prevEase={start:t.exported.now(),duration:e,easing:i},i}blur(){this.reset()}reset(){this._active=!1}_addScrollZoomBlocker(){this._map&&!this._alertContainer&&(this._alertContainer=a.create("div","mapboxgl-scroll-zoom-blocker",this._map._container),this._alertContainer.textContent=/(Mac|iPad)/i.test(t.window.navigator.userAgent)?this._map._getUIString("ScrollZoomBlocker.CmdMessage"):this._map._getUIString("ScrollZoomBlocker.CtrlMessage"),this._alertContainer.style.fontSize=`${Math.max(10,Math.min(24,Math.floor(.05*this._el.clientWidth)))}px`)}_isFullscreen(){return!!t.window.document.fullscreenElement}_showBlockerAlert(){"hidden"===this._alertContainer.style.visibility&&(this._alertContainer.style.visibility="visible"),this._alertContainer.classList.add("mapboxgl-scroll-zoom-blocker-show"),clearTimeout(this._alertTimer),this._alertTimer=setTimeout((()=>{this._alertContainer.classList.remove("mapboxgl-scroll-zoom-blocker-show")}),200)}}class pr{constructor(t,e){this._clickZoom=t,this._tapZoom=e}enable(){this._clickZoom.enable(),this._tapZoom.enable()}disable(){this._clickZoom.disable(),this._tapZoom.disable()}isEnabled(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()}isActive(){return this._clickZoom.isActive()||this._tapZoom.isActive()}}class mr{constructor(){this.reset()}reset(){this._active=!1}blur(){this.reset()}dblclick(t,e){return t.preventDefault(),{cameraAnimation:i=>{i.easeTo({duration:300,zoom:i.getZoom()+(t.shiftKey?-1:1),around:i.unproject(e)},{originalEvent:t})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class fr{constructor(){this._tap=new qn({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,this._tap.reset()}touchstart(t,e,i){this._swipePoint||(this._tapTime&&t.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?i.length>0&&(this._swipePoint=e[0],this._swipeTouch=i[0].identifier):this._tap.touchstart(t,e,i))}touchmove(t,e,i){if(this._tapTime){if(this._swipePoint){if(i[0].identifier!==this._swipeTouch)return;const n=e[0],r=n.y-this._swipePoint.y;return this._swipePoint=n,t.preventDefault(),this._active=!0,{zoomDelta:r/128}}}else this._tap.touchmove(t,e,i)}touchend(t,e,i){this._tapTime?this._swipePoint&&0===i.length&&this.reset():this._tap.touchend(t,e,i)&&(this._tapTime=t.timeStamp)}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class gr{constructor(t,e,i){this._el=t,this._mousePan=e,this._touchPan=i}enable(t){this._inertiaOptions=t||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}}class vr{constructor(t,e,i){this._pitchWithRotate=t.pitchWithRotate,this._mouseRotate=e,this._mousePitch=i}enable(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()}disable(){this._mouseRotate.disable(),this._mousePitch.disable()}isEnabled(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())}isActive(){return this._mouseRotate.isActive()||this._mousePitch.isActive()}}class yr{constructor(t,e,i,n){this._el=t,this._touchZoom=e,this._touchRotate=i,this._tapDragZoom=n,this._rotationDisabled=!1,this._enabled=!0}enable(t){this._touchZoom.enable(t),this._rotationDisabled||this._touchRotate.enable(t),this._tapDragZoom.enable(),this._el.classList.add("mapboxgl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-touch-zoom-rotate")}isEnabled(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()}isActive(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()}disableRotation(){this._rotationDisabled=!0,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}}const _r=t=>t.zoom||t.drag||t.pitch||t.rotate;class xr extends t.Event{}class br{constructor(){this.constants=[1,1,.01],this.radius=0}setup(e,i){const n=t.sub([],i,e);this.radius=t.length(n[2]<0?t.div([],n,this.constants):[n[0],n[1],0])}projectRay(e){t.div(e,e,this.constants),t.normalize(e,e),t.mul$1(e,e,this.constants);const i=t.scale$2([],e,this.radius);if(i[2]>0){const e=t.scale$2([],[0,0,1],t.dot(i,[0,0,1])),n=t.scale$2([],t.normalize([],[i[0],i[1],0]),this.radius),r=t.add([],i,t.scale$2([],t.sub([],t.add([],n,e),i),2));i[0]=r[0],i[1]=r[1]}return i}}function wr(t){return t.panDelta&&t.panDelta.mag()||t.zoomDelta||t.bearingDelta||t.pitchDelta}class kr{constructor(e,i){this._map=e,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Ln(e),this._bearingSnap=i.bearingSnap,this._previousActiveHandlers={},this._trackingEllipsoid=new br,this._dragOrigin=null,this._eventsInProgress={},this._addDefaultHandlers(i),t.bindAll(["handleEvent","handleWindowEvent"],this);const n=this._el;this._listeners=[[n,"touchstart",{passive:!0}],[n,"touchmove",{passive:!1}],[n,"touchend",void 0],[n,"touchcancel",void 0],[n,"mousedown",void 0],[n,"mousemove",void 0],[n,"mouseup",void 0],[t.window.document,"mousemove",{capture:!0}],[t.window.document,"mouseup",void 0],[n,"mouseover",void 0],[n,"mouseout",void 0],[n,"dblclick",void 0],[n,"click",void 0],[n,"keydown",{capture:!1}],[n,"keyup",void 0],[n,"wheel",{passive:!1}],[n,"contextmenu",void 0],[t.window,"blur",void 0]];for(const[e,i,n]of this._listeners)e.addEventListener(i,e===t.window.document?this.handleWindowEvent:this.handleEvent,n)}destroy(){for(const[e,i,n]of this._listeners)e.removeEventListener(i,e===t.window.document?this.handleWindowEvent:this.handleEvent,n)}_addDefaultHandlers(t){const e=this._map,i=e.getCanvasContainer();this._add("mapEvent",new Vn(e,t));const n=e.boxZoom=new Zn(e,t);this._add("boxZoom",n);const r=new Wn,o=new mr;e.doubleClickZoom=new pr(o,r),this._add("tapZoom",r),this._add("clickZoom",o);const a=new fr;this._add("tapDragZoom",a);const s=e.touchPitch=new sr(e);this._add("touchPitch",s);const l=new Kn(t),c=new Jn(t);e.dragRotate=new vr(t,l,c),this._add("mouseRotate",l,["mousePitch"]),this._add("mousePitch",c,["mouseRotate"]);const u=new Yn(t),d=new Qn(e,t);e.dragPan=new gr(i,u,d),this._add("mousePan",u),this._add("touchPan",d,["touchZoom","touchRotate"]);const h=new or,p=new nr;e.touchZoomRotate=new yr(i,p,h,a),this._add("touchRotate",h,["touchPan","touchZoom"]),this._add("touchZoom",p,["touchPan","touchRotate"]),this._add("blockableMapEvent",new Un(e));const m=e.scrollZoom=new hr(e,this);this._add("scrollZoom",m,["mousePan"]);const f=e.keyboard=new cr;this._add("keyboard",f);for(const i of["boxZoom","doubleClickZoom","tapDragZoom","touchPitch","dragRotate","dragPan","touchZoomRotate","scrollZoom","keyboard"])t.interactive&&t[i]&&e[i].enable(t[i])}_add(t,e,i){this._handlers.push({handlerName:t,handler:e,allowed:i}),this._handlersById[t]=e}stop(t){if(!this._updatingCamera){for(const{handler:t}of this._handlers)t.reset();this._inertia.clear(),this._fireEvents({},{},t),this._changes=[]}}isActive(){for(const{handler:t}of this._handlers)if(t.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return Boolean(_r(this._eventsInProgress))||this.isZooming()}_blockedByActive(t,e,i){for(const n in t)if(n!==i&&(!e||e.indexOf(n)<0))return!0;return!1}handleWindowEvent(t){this.handleEvent(t,`${t.type}Window`)}_getMapTouches(t){const e=[];for(const i of t)this._el.contains(i.target)&&e.push(i);return e}handleEvent(t,e){this._updatingCamera=!0;const i="renderFrame"===t.type,n=i?void 0:t,r={needsRenderFrame:!1},o={},s={},l=t.touches?this._getMapTouches(t.touches):void 0,c=l?a.touchPos(this._el,l):i?void 0:a.mousePos(this._el,t);for(const{handlerName:i,handler:a,allowed:u}of this._handlers){if(!a.isEnabled())continue;let d;this._blockedByActive(s,u,i)?a.reset():a[e||t.type]&&(d=a[e||t.type](t,c,l),this.mergeHandlerResult(r,o,d,i,n),d&&d.needsRenderFrame&&this._triggerRenderFrame()),(d||a.isActive())&&(s[i]=a)}const u={};for(const t in this._previousActiveHandlers)s[t]||(u[t]=n);this._previousActiveHandlers=s,(Object.keys(u).length||wr(r))&&(this._changes.push([r,o,u]),this._triggerRenderFrame()),(Object.keys(s).length||wr(r))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:d}=r;d&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],d(this._map))}mergeHandlerResult(e,i,n,r,o){if(!n)return;t.extend(e,n);const a={handlerName:r,originalEvent:n.originalEvent||o};void 0!==n.zoomDelta&&(i.zoom=a),void 0!==n.panDelta&&(i.drag=a),void 0!==n.pitchDelta&&(i.pitch=a),void 0!==n.bearingDelta&&(i.rotate=a)}_applyChanges(){const e={},i={},n={};for(const[r,o,a]of this._changes)r.panDelta&&(e.panDelta=(e.panDelta||new t.pointGeometry(0,0))._add(r.panDelta)),r.zoomDelta&&(e.zoomDelta=(e.zoomDelta||0)+r.zoomDelta),r.bearingDelta&&(e.bearingDelta=(e.bearingDelta||0)+r.bearingDelta),r.pitchDelta&&(e.pitchDelta=(e.pitchDelta||0)+r.pitchDelta),void 0!==r.around&&(e.around=r.around),void 0!==r.aroundCoord&&(e.aroundCoord=r.aroundCoord),void 0!==r.pinchAround&&(e.pinchAround=r.pinchAround),r.noInertia&&(e.noInertia=r.noInertia),t.extend(i,o),t.extend(n,a);this._updateMapTransform(e,i,n),this._changes=[]}_updateMapTransform(e,i,n){const r=this._map,o=r.transform,a=t=>[t.x,t.y,t.z];if((t=>{const e=this._eventsInProgress.drag;return e&&!this._handlersById[e.handlerName].isActive()})()&&!wr(e)){const t=o.zoom;o.cameraElevationReference="sea",o.recenterOnTerrain(),o.cameraElevationReference="ground",t!==o.zoom&&this._map._update(!0)}if(!wr(e))return this._fireEvents(i,n,!0);let{panDelta:s,zoomDelta:l,bearingDelta:c,pitchDelta:u,around:d,aroundCoord:h,pinchAround:p}=e;void 0!==p&&(d=p),(t=>i.drag&&!this._eventsInProgress.drag)()&&d&&(this._dragOrigin=a(o.pointCoordinate3D(d)),this._trackingEllipsoid.setup(o._camera.position,this._dragOrigin)),o.cameraElevationReference="sea",r._stop(!0),d=d||r.transform.centerPoint,c&&(o.bearing+=c),u&&(o.pitch+=u),o._updateCameraState();const m=[0,0,0];if(s){const t=o.pointCoordinate(d),e=o.pointCoordinate(d.sub(s));t&&e&&(m[0]=e.x-t.x,m[1]=e.y-t.y)}const f=o.zoom,g=[0,0,0];if(l){const e=a(h||o.pointCoordinate3D(d)),i={dir:t.normalize([],t.sub([],e,o._camera.position))};if(i.dir[2]<0){const n=o.zoomDeltaToMovement(e,l);t.scale$2(g,i.dir,n)}}const v=t.add(m,m,g);o._translateCameraConstrained(v),l&&Math.abs(o.zoom-f)>1e-4&&o.recenterOnTerrain(),o.cameraElevationReference="ground",this._map._update(),e.noInertia||this._inertia.record(e),this._fireEvents(i,n,!0)}_fireEvents(e,i,n){const r=_r(this._eventsInProgress),o=_r(e),a={};for(const t in e){const{originalEvent:i}=e[t];this._eventsInProgress[t]||(a[`${t}start`]=i),this._eventsInProgress[t]=e[t]}!r&&o&&this._fireEvent("movestart",o.originalEvent);for(const t in a)this._fireEvent(t,a[t]);o&&this._fireEvent("move",o.originalEvent);for(const t in e){const{originalEvent:i}=e[t];this._fireEvent(t,i)}const s={};let l;for(const t in this._eventsInProgress){const{handlerName:e,originalEvent:n}=this._eventsInProgress[t];this._handlersById[e].isActive()||(delete this._eventsInProgress[t],l=i[e]||n,s[`${t}end`]=l)}for(const t in s)this._fireEvent(t,s[t]);const c=_r(this._eventsInProgress);if(n&&(r||o)&&!c){this._updatingCamera=!0;const e=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),i=t=>0!==t&&-this._bearingSnap{delete this._frameId,this.handleEvent(new xr("renderFrame",{timeStamp:t})),this._applyChanges()}))}_triggerRenderFrame(){void 0===this._frameId&&(this._frameId=this._requestFrame())}}const Er="map.setFreeCameraOptions(...) and map.getFreeCameraOptions() are not yet supported for non-mercator projections.";class Tr extends t.Evented{constructor(e,i){super(),this._moving=!1,this._zooming=!1,this.transform=e,this._bearingSnap=i.bearingSnap,t.bindAll(["_renderFrameCallback"],this)}getCenter(){return new t.LngLat(this.transform.center.lng,this.transform.center.lat)}setCenter(t,e){return this.jumpTo({center:t},e)}panBy(e,i,n){return e=t.pointGeometry.convert(e).mult(-1),this.panTo(this.transform.center,t.extend({offset:e},i),n)}panTo(e,i,n){return this.easeTo(t.extend({center:e},i),n)}getZoom(){return this.transform.zoom}setZoom(t,e){return this.jumpTo({zoom:t},e),this}zoomTo(e,i,n){return this.easeTo(t.extend({zoom:e},i),n)}zoomIn(t,e){return this.zoomTo(this.getZoom()+1,t,e),this}zoomOut(t,e){return this.zoomTo(this.getZoom()-1,t,e),this}getBearing(){return this.transform.bearing}setBearing(t,e){return this.jumpTo({bearing:t},e),this}getPadding(){return this.transform.padding}setPadding(t,e){return this.jumpTo({padding:t},e),this}rotateTo(e,i,n){return this.easeTo(t.extend({bearing:e},i),n)}resetNorth(e,i){return this.rotateTo(0,t.extend({duration:1e3},e),i),this}resetNorthPitch(e,i){return this.easeTo(t.extend({bearing:0,pitch:0,duration:1e3},e),i),this}snapToNorth(t,e){return Math.abs(this.getBearing())m=>{if(b&&(n.zoom=t.number(r,l,m)),w&&(n.bearing=t.number(o,c,m)),k&&(n.pitch=t.number(a,u,m)),E&&(n.interpolatePadding(s,d,m),p=n.centerPoint.add(h)),_)n.setLocationAtPoint(_,x);else{const t=n.zoomScale(n.zoom-r),e=l>r?Math.min(2,y):Math.max(.5,y),i=Math.pow(e,1-m),o=n.unproject(g.add(v.mult(m*i)).mult(t));n.setLocationAtPoint(n.renderWorldCopies?o.wrap():o,p)}return e.preloadOnly||this._fireMoveEvents(i),n};if(e.preloadOnly){const t=this._emulate(T,e.duration,n);return this._preloadTiles(t),this}const S={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=b,this._rotating=w,this._pitching=k,this._padding=E,this._easeId=e.easeId,this._prepareEase(i,e.noMoveStart,S),this._ease(T(n),(t=>{n.recenterOnTerrain(),this._afterEase(i,t)}),e),this}_prepareEase(e,i,n={}){this._moving=!0,this.transform.cameraElevationReference="sea",i||n.moving||this.fire(new t.Event("movestart",e)),this._zooming&&!n.zooming&&this.fire(new t.Event("zoomstart",e)),this._rotating&&!n.rotating&&this.fire(new t.Event("rotatestart",e)),this._pitching&&!n.pitching&&this.fire(new t.Event("pitchstart",e))}_fireMoveEvents(e){this.fire(new t.Event("move",e)),this._zooming&&this.fire(new t.Event("zoom",e)),this._rotating&&this.fire(new t.Event("rotate",e)),this._pitching&&this.fire(new t.Event("pitch",e))}_afterEase(e,i){if(this._easeId&&i&&this._easeId===i)return;delete this._easeId,this.transform.cameraElevationReference="ground";const n=this._zooming,r=this._rotating,o=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,n&&this.fire(new t.Event("zoomend",e)),r&&this.fire(new t.Event("rotateend",e)),o&&this.fire(new t.Event("pitchend",e)),this.fire(new t.Event("moveend",e))}flyTo(e,i){if(!e.essential&&t.exported.prefersReducedMotion){const n=t.pick(e,["center","zoom","bearing","pitch","around"]);return this.jumpTo(n,i)}this.stop(),e=t.extend({offset:[0,0],speed:1.2,curve:1.42,easing:t.ease},e);const n=this.transform,r=this.getZoom(),o=this.getBearing(),a=this.getPitch(),s=this.getPadding(),l="zoom"in e?t.clamp(+e.zoom,n.minZoom,n.maxZoom):r,c="bearing"in e?this._normalizeBearing(e.bearing,o):o,u="pitch"in e?+e.pitch:a,d="padding"in e?e.padding:n.padding,h=n.zoomScale(l-r),p=t.pointGeometry.convert(e.offset);let m=n.centerPoint.add(p);const f=n.pointLocation(m),g=t.LngLat.convert(e.center||f);this._normalizeCenter(g);const v=n.project(f),y=n.project(g).sub(v);let _=e.curve;const x=Math.max(n.width,n.height),b=x/h,w=y.mag();if("minZoom"in e){const i=t.clamp(Math.min(e.minZoom,r,l),n.minZoom,n.maxZoom),o=x/n.zoomScale(i-r);_=Math.sqrt(o/w*2)}const k=_*_;function E(t){const e=(b*b-x*x+(t?-1:1)*k*k*w*w)/(2*(t?b:x)*k*w);return Math.log(Math.sqrt(e*e+1)-e)}function T(t){return(Math.exp(t)-Math.exp(-t))/2}function S(t){return(Math.exp(t)+Math.exp(-t))/2}const C=E(0);let M=function(t){return S(C)/S(C+_*t)},z=function(t){return x*((S(C)*(T(e=C+_*t)/S(e))-T(C))/k)/w;var e},I=(E(1)-C)/_;if(Math.abs(w)<1e-6||!isFinite(I)){if(Math.abs(x-b)<1e-6)return this.easeTo(e,i);const t=be.maxDuration&&(e.duration=0);const P=o!==c,A=u!==a,D=!n.isPaddingEqual(d),O=n=>h=>{const f=h*I,_=1/M(f);n.zoom=1===h?l:r+n.scaleZoom(_),P&&(n.bearing=t.number(o,c,h)),A&&(n.pitch=t.number(a,u,h)),D&&(n.interpolatePadding(s,d,h),m=n.centerPoint.add(p));const x=1===h?g:n.unproject(v.add(y.mult(z(f))).mult(_));return n.setLocationAtPoint(n.renderWorldCopies?x.wrap():x,m),n._updateCenterElevation(),e.preloadOnly||this._fireMoveEvents(i),n};if(e.preloadOnly){const t=this._emulate(O,e.duration,n);return this._preloadTiles(t),this}return this._zooming=!0,this._rotating=P,this._pitching=A,this._padding=D,this._prepareEase(i,!1),this._ease(O(n),(()=>this._afterEase(i)),e),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(t,e){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){const t=this._onEaseEnd;delete this._onEaseEnd,t.call(this,e)}if(!t){const t=this.handlers;t&&t.stop(!1)}return this}_ease(e,i,n){!1===n.animate||0===n.duration?(e(1),i()):(this._easeStart=t.exported.now(),this._easeOptions=n,this._onEaseFrame=e,this._onEaseEnd=i,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_renderFrameCallback(){const e=Math.min((t.exported.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(e)),e<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()}_normalizeBearing(e,i){e=t.wrap(e,-180,180);const n=Math.abs(e-i);return Math.abs(e-360-i)180?-360:i<-180?360:0}_emulate(t,e,i){const n=Math.ceil(15*e/1e3),r=[],o=t(i.clone());for(let t=0;t<=n;t++){const e=o(t/n);r.push(e.clone())}return r}}class Sr{constructor(e={}){this.options=e,t.bindAll(["_toggleAttribution","_updateEditLink","_updateData","_updateCompact"],this)}getDefaultPosition(){return"bottom-right"}onAdd(t){const e=this.options&&this.options.compact;return this._map=t,this._container=a.create("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._compactButton=a.create("button","mapboxgl-ctrl-attrib-button",this._container),a.create("span","mapboxgl-ctrl-icon",this._compactButton).setAttribute("aria-hidden",!0),this._compactButton.type="button",this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=a.create("div","mapboxgl-ctrl-attrib-inner",this._container),this._innerContainer.setAttribute("role","list"),e&&this._container.classList.add("mapboxgl-compact"),this._updateAttributions(),this._updateEditLink(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("moveend",this._updateEditLink),void 0===e&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container}onRemove(){this._container.remove(),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0,this._attribHTML=void 0}_setElementTitle(t,e){const i=this._map._getUIString(`AttributionControl.${e}`);t.setAttribute("aria-label",i),t.removeAttribute("title"),t.firstElementChild&&t.firstElementChild.setAttribute("title",i)}_toggleAttribution(){this._container.classList.contains("mapboxgl-compact-show")?(this._container.classList.remove("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-expanded","false")):(this._container.classList.add("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-expanded","true"))}_updateEditLink(){let e=this._editLink;e||(e=this._editLink=this._container.querySelector(".mapbox-improve-map"));const i=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||t.config.ACCESS_TOKEN}];if(e){const n=i.reduce(((t,e,n)=>(e.value&&(t+=`${e.key}=${e.value}${nt.length-e.length)),t=t.filter(((e,i)=>{for(let n=i+1;n=0)return!1;return!0})),this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?t=[...this.options.customAttribution,...t]:t.unshift(this.options.customAttribution));const i=t.join(" | ");i!==this._attribHTML&&(this._attribHTML=i,t.length?(this._innerContainer.innerHTML=i,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}_updateCompact(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact","mapboxgl-compact-show")}}class Cr{constructor(){t.bindAll(["_updateLogo"],this),t.bindAll(["_updateCompact"],this)}onAdd(t){this._map=t,this._container=a.create("div","mapboxgl-ctrl");const e=a.create("a","mapboxgl-ctrl-logo");return e.target="_blank",e.rel="noopener nofollow",e.href="https://www.mapbox.com/",e.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),e.setAttribute("rel","noopener nofollow"),this._container.appendChild(e),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){this._container.remove(),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)}getDefaultPosition(){return"bottom-left"}_updateLogo(t){t&&"metadata"!==t.sourceDataType||(this._container.style.display=this._logoRequired()?"block":"none")}_logoRequired(){if(!this._map.style)return!0;const t=this._map.style._sourceCaches;if(0===Object.entries(t).length)return!0;for(const e in t){const i=t[e].getSource();if(i.hasOwnProperty("mapbox_logo")&&!i.mapbox_logo)return!1}return!0}_updateCompact(){const t=this._container.children;if(t.length){const e=t[0];this._map.getCanvasContainer().offsetWidth<250?e.classList.add("mapboxgl-compact"):e.classList.remove("mapboxgl-compact")}}}class Mr{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(t){const e=++this._id;return this._queue.push({callback:t,id:e,cancelled:!1}),e}remove(t){const e=this._currentlyRunning,i=e?this._queue.concat(e):this._queue;for(const e of i)if(e.id===t)return void(e.cancelled=!0)}run(t=0){const e=this._currentlyRunning=this._queue;this._queue=[];for(const i of e)if(!i.cancelled&&(i.callback(t),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}function zr(e,i,n){if(e=new t.LngLat(e.lng,e.lat),i){const r=new t.LngLat(e.lng-360,e.lat),o=new t.LngLat(e.lng+360,e.lat),a=360*Math.ceil(Math.abs(e.lng-n.center.lng)/360),s=n.locationPoint(e).distSqr(i),l=i.x<0||i.y<0||i.x>n.width||i.y>n.height;n.locationPoint(r).distSqr(i)180;){const t=n.locationPoint(e);if(t.x>=0&&t.y>=0&&t.x<=n.width&&t.y<=n.height)break;e.lng>n.center.lng?e.lng-=360:e.lng+=360}return e}const Ir={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};class Pr extends t.Evented{constructor(e,i){if(super(),(e instanceof t.window.HTMLElement||i)&&(e=t.extend({element:e},i)),t.bindAll(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress","_clearFadeTimer"],this),this._anchor=e&&e.anchor||"center",this._color=e&&e.color||"#3FB1CE",this._scale=e&&e.scale||1,this._draggable=e&&e.draggable||!1,this._clickTolerance=e&&e.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=e&&e.rotation||0,this._rotationAlignment=e&&e.rotationAlignment||"auto",this._pitchAlignment=e&&e.pitchAlignment&&"auto"!==e.pitchAlignment?e.pitchAlignment:this._rotationAlignment,this._updateMoving=()=>this._update(!0),e&&e.element)this._element=e.element,this._offset=t.pointGeometry.convert(e&&e.offset||[0,0]);else{this._defaultMarker=!0,this._element=a.create("div");const i=41,n=27,r=a.createSVG("svg",{display:"block",height:i*this._scale+"px",width:n*this._scale+"px",viewBox:`0 0 ${n} ${i}`},this._element),o=a.createSVG("radialGradient",{id:"shadowGradient"},a.createSVG("defs",{},r));a.createSVG("stop",{offset:"10%","stop-opacity":.4},o),a.createSVG("stop",{offset:"100%","stop-opacity":.05},o),a.createSVG("ellipse",{cx:13.5,cy:34.8,rx:10.5,ry:5.25,fill:"url(#shadowGradient)"},r),a.createSVG("path",{fill:this._color,d:"M27,13.5C27,19.07 20.25,27 14.75,34.5C14.02,35.5 12.98,35.5 12.25,34.5C6.75,27 0,19.22 0,13.5C0,6.04 6.04,0 13.5,0C20.96,0 27,6.04 27,13.5Z"},r),a.createSVG("path",{opacity:.25,d:"M13.5,0C6.04,0 0,6.04 0,13.5C0,19.22 6.75,27 12.25,34.5C13,35.52 14.02,35.5 14.75,34.5C20.25,27 27,19.07 27,13.5C27,6.04 20.96,0 13.5,0ZM13.5,1C20.42,1 26,6.58 26,13.5C26,15.9 24.5,19.18 22.22,22.74C19.95,26.3 16.71,30.14 13.94,33.91C13.74,34.18 13.61,34.32 13.5,34.44C13.39,34.32 13.26,34.18 13.06,33.91C10.28,30.13 7.41,26.31 5.02,22.77C2.62,19.23 1,15.95 1,13.5C1,6.58 6.58,1 13.5,1Z"},r),a.createSVG("circle",{fill:"white",cx:13.5,cy:13.5,r:5.5},r),this._offset=t.pointGeometry.convert(e&&e.offset||[0,-14])}this._element.hasAttribute("aria-label")||this._element.setAttribute("aria-label","Map marker"),this._element.classList.add("mapboxgl-marker"),this._element.addEventListener("dragstart",(t=>{t.preventDefault()})),this._element.addEventListener("mousedown",(t=>{t.preventDefault()}));const n=this._element.classList;for(const t in Ir)n.remove(`mapboxgl-marker-anchor-${t}`);n.add(`mapboxgl-marker-anchor-${this._anchor}`),this._popup=null}addTo(t){return t===this._map||(this.remove(),this._map=t,t.getCanvasContainer().appendChild(this._element),t.on("move",this._updateMoving),t.on("moveend",this._update),t.on("remove",this._clearFadeTimer),t._addMarker(this),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick)),this}remove(){return this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._updateMoving),this._map.off("moveend",this._update),this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler),this._map.off("mouseup",this._onUp),this._map.off("touchend",this._onUp),this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),this._map.off("remove",this._clearFadeTimer),this._map._removeMarker(this),delete this._map),this._clearFadeTimer(),this._element.remove(),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(e){return this._lngLat=t.LngLat.convert(e),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(!0),this}getElement(){return this._element}setPopup(t){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeAttribute("role"),this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),t){if(!("offset"in t.options)){const e=38.1,i=13.5,n=Math.sqrt(Math.pow(i,2)/2);t.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-e],"bottom-left":[n,-1*(e-i+n)],"bottom-right":[-n,-1*(e-i+n)],left:[i,-1*(e-i)],right:[-i,-1*(e-i)]}:this._offset}this._popup=t,this._lngLat&&this._popup.setLngLat(this._lngLat),this._element.setAttribute("role","button"),this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress),this._element.setAttribute("aria-expanded","false")}return this}_onKeyPress(t){const e=t.code,i=t.charCode||t.keyCode;"Space"!==e&&"Enter"!==e&&32!==i&&13!==i||this.togglePopup()}_onMapClick(t){const e=t.originalEvent.target,i=this._element;this._popup&&(e===i||i.contains(e))&&this.togglePopup()}getPopup(){return this._popup}togglePopup(){const t=this._popup;return t?(t.isOpen()?(t.remove(),this._element.setAttribute("aria-expanded","false")):(t.addTo(this._map),this._element.setAttribute("aria-expanded","true")),this):this}_evaluateOpacity(){const t=this._pos?this._pos.sub(this._transformedOffset()):null;if(!this._withinScreenBounds(t))return void this._clearFadeTimer();const e=this._map.unproject(t);let i=!1;if(this._map.transform._terrainEnabled()&&this._map.getTerrain()){const t=this._map.getFreeCameraOptions();if(t.position){const n=t.position.toLngLat();i=n.distanceTo(e)<.9*n.distanceTo(this._lngLat)}}const n=(1-this._map._queryFogOpacity(e))*(i?.2:1);this._element.style.opacity=`${n}`,this._popup&&this._popup._setOpacity(`${n}`),this._fadeTimer=null}_clearFadeTimer(){this._fadeTimer&&(clearTimeout(this._fadeTimer),this._fadeTimer=null)}_withinScreenBounds(t){const e=this._map.transform;return!!t&&t.x>=0&&t.x=0&&t.y{this._element&&this._pos&&this._anchor&&(this._pos=this._pos.round(),this._updateDOM())})):this._pos=this._pos.round(),this._map._requestDomTask((()=>{this._map&&(this._element&&this._pos&&this._anchor&&this._updateDOM(),!this._map.getTerrain()&&!this._map.getFog()||this._fadeTimer||(this._fadeTimer=setTimeout(this._evaluateOpacity.bind(this),60)))})))}_transformedOffset(){if(!this._defaultMarker)return this._offset;const t=this._map.transform,e=this._offset.mult(this._scale);return"map"===this._rotationAlignment&&e._rotate(t.angle),"map"===this._pitchAlignment&&(e.y*=Math.cos(t._pitch)),e}getOffset(){return this._offset}setOffset(e){return this._offset=t.pointGeometry.convert(e),this._update(),this}_onMove(e){if(!this._isDragging){const t=this._clickTolerance||this._map._clickTolerance;this._isDragging=e.point.dist(this._pointerdownPos)>=t}this._isDragging&&(this._pos=e.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none","pending"===this._state&&(this._state="active",this.fire(new t.Event("dragstart"))),this.fire(new t.Event("drag")))}_onUp(){this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),"active"===this._state&&this.fire(new t.Event("dragend")),this._state="inactive"}_addDragHandler(t){this._element.contains(t.originalEvent.target)&&(t.preventDefault(),this._positionDelta=t.point.sub(this._pos).add(this._transformedOffset()),this._pointerdownPos=t.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))}setDraggable(t){return this._draggable=!!t,this._map&&(t?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this}isDraggable(){return this._draggable}setRotation(t){return this._rotation=t||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(t){return this._rotationAlignment=t||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(t){return this._pitchAlignment=t&&"auto"!==t?t:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}}class Ar{constructor(t){this.jumpTo(t)}getValue(e){if(e<=this._startTime)return this._start;if(e>=this._endTime)return this._end;const i=t.easeCubicInOut((e-this._startTime)/(this._endTime-this._startTime));return this._start*(1-i)+this._end*i}isEasing(t){return t>=this._startTime&&t<=this._endTime}jumpTo(t){this._startTime=-1/0,this._endTime=-1/0,this._start=t,this._end=t}easeTo(t,e,i){this._start=this.getValue(e),this._end=t,this._startTime=e,this._endTime=e+i}}const Dr={"AttributionControl.ToggleAttribution":"Toggle attribution","AttributionControl.MapFeedback":"Map feedback","FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"Mapbox logo","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","ScaleControl.Feet":"ft","ScaleControl.Meters":"m","ScaleControl.Kilometers":"km","ScaleControl.Miles":"mi","ScaleControl.NauticalMiles":"nm","ScrollZoomBlocker.CtrlMessage":"Use ctrl + scroll to zoom the map","ScrollZoomBlocker.CmdMessage":"Use ⌘ + scroll to zoom the map","TouchPanBlocker.Message":"Use two fingers to move the map"},{HTMLImageElement:Or,HTMLElement:Lr,ImageBitmap:Rr}=t.window,Br={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:85,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,cooperativeGestures:!1,bearingSnap:7,clickTolerance:3,pitchWithRotate:!0,hash:!1,attributionControl:!0,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,optimizeForTerrain:!0,renderWorldCopies:!0,refreshExpiredTiles:!0,maxTileCacheSize:null,localIdeographFontFamily:"sans-serif",localFontFamily:null,transformRequest:null,accessToken:null,fadeDuration:300,crossSourceCollisions:!0};function Fr(t){t.parentNode&&t.parentNode.removeChild(t)}const jr={showCompass:!0,showZoom:!0,visualizePitch:!1};class Nr{constructor(e,i,n=!1){this._clickTolerance=10,this.element=i,this.mouseRotate=new Kn({clickTolerance:e.dragRotate._mouseRotate._clickTolerance}),this.map=e,n&&(this.mousePitch=new Jn({clickTolerance:e.dragRotate._mousePitch._clickTolerance})),t.bindAll(["mousedown","mousemove","mouseup","touchstart","touchmove","touchend","reset"],this),i.addEventListener("mousedown",this.mousedown),i.addEventListener("touchstart",this.touchstart,{passive:!1}),i.addEventListener("touchmove",this.touchmove),i.addEventListener("touchend",this.touchend),i.addEventListener("touchcancel",this.reset)}down(t,e){this.mouseRotate.mousedown(t,e),this.mousePitch&&this.mousePitch.mousedown(t,e),a.disableDrag()}move(t,e){const i=this.map,n=this.mouseRotate.mousemoveWindow(t,e);if(n&&n.bearingDelta&&i.setBearing(i.getBearing()+n.bearingDelta),this.mousePitch){const n=this.mousePitch.mousemoveWindow(t,e);n&&n.pitchDelta&&i.setPitch(i.getPitch()+n.pitchDelta)}}off(){const t=this.element;t.removeEventListener("mousedown",this.mousedown),t.removeEventListener("touchstart",this.touchstart,{passive:!1}),t.removeEventListener("touchmove",this.touchmove),t.removeEventListener("touchend",this.touchend),t.removeEventListener("touchcancel",this.reset),this.offTemp()}offTemp(){a.enableDrag(),t.window.removeEventListener("mousemove",this.mousemove),t.window.removeEventListener("mouseup",this.mouseup)}mousedown(e){this.down(t.extend({},e,{ctrlKey:!0,preventDefault:()=>e.preventDefault()}),a.mousePos(this.element,e)),t.window.addEventListener("mousemove",this.mousemove),t.window.addEventListener("mouseup",this.mouseup)}mousemove(t){this.move(t,a.mousePos(this.element,t))}mouseup(t){this.mouseRotate.mouseupWindow(t),this.mousePitch&&this.mousePitch.mouseupWindow(t),this.offTemp()}touchstart(t){1!==t.targetTouches.length?this.reset():(this._startPos=this._lastPos=a.touchPos(this.element,t.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:()=>t.preventDefault()},this._startPos))}touchmove(t){1!==t.targetTouches.length?this.reset():(this._lastPos=a.touchPos(this.element,t.targetTouches)[0],this.move({preventDefault:()=>t.preventDefault()},this._lastPos))}touchend(t){0===t.targetTouches.length&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)5280?Wr(e,n,i/5280,t._getUIString("ScaleControl.Miles"),t):Wr(e,n,i,t._getUIString("ScaleControl.Feet"),t)}else i&&"nautical"===i.unit?Wr(e,n,s/1852,t._getUIString("ScaleControl.NauticalMiles"),t):s>=1e3?Wr(e,n,s/1e3,t._getUIString("ScaleControl.Kilometers"),t):Wr(e,n,s,t._getUIString("ScaleControl.Meters"),t)}function Wr(t,e,i,n,r){const o=function(t){const e=Math.pow(10,`${Math.floor(t)}`.length-1);let i=t/e;return i=i>=10?10:i>=5?5:i>=3?3:i>=2?2:i>=1?1:function(t){const e=Math.pow(10,Math.ceil(-Math.log(t)/Math.LN10));return Math.round(t*e)/e}(i),e*i}(i),a=o/i;r._requestDomTask((()=>{t.style.width=e*a+"px",t.innerHTML=`${o} ${n}`}))}const Hr={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},Xr=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", "),Yr={version:t.version,supported:e,setRTLTextPlugin:t.setRTLTextPlugin,getRTLTextPluginStatus:t.getRTLTextPluginStatus,Map:class extends Tr{constructor(e){if(null!=(e=t.extend({},Br,e)).minZoom&&null!=e.maxZoom&&e.minZoom>e.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(null!=e.minPitch&&null!=e.maxPitch&&e.minPitch>e.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(null!=e.minPitch&&e.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(null!=e.maxPitch&&e.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(super(new Cn(e.minZoom,e.maxZoom,e.minPitch,e.maxPitch,e.renderWorldCopies),e),this._interactive=e.interactive,this._minTileCacheSize=e.minTileCacheSize,this._maxTileCacheSize=e.maxTileCacheSize,this._failIfMajorPerformanceCaveat=e.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=e.preserveDrawingBuffer,this._antialias=e.antialias,this._trackResize=e.trackResize,this._bearingSnap=e.bearingSnap,this._refreshExpiredTiles=e.refreshExpiredTiles,this._fadeDuration=e.fadeDuration,this._isInitialLoad=!0,this._crossSourceCollisions=e.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=e.collectResourceTiming,this._optimizeForTerrain=e.optimizeForTerrain,this._renderTaskQueue=new Mr,this._domRenderTaskQueue=new Mr,this._controls=[],this._markers=[],this._mapId=t.uniqueId(),this._locale=t.extend({},Dr,e.locale),this._clickTolerance=e.clickTolerance,this._cooperativeGestures=e.cooperativeGestures,this._containerWidth=0,this._containerHeight=0,this._averageElevationLastSampledAt=-1/0,this._averageElevation=new Ar(0),this._requestManager=new t.RequestManager(e.transformRequest,e.accessToken,e.testMode),this._silenceAuthErrors=!!e.testMode,"string"==typeof e.container){if(this._container=t.window.document.getElementById(e.container),!this._container)throw new Error(`Container '${e.container}' not found.`)}else{if(!(e.container instanceof Lr))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=e.container}if(this._container.childNodes.length>0&&t.warnOnce("The map container element should be empty, otherwise the map's interactivity will be negatively impacted. If you want to display a message when WebGL is not supported, use the Mapbox GL Supported plugin instead."),e.maxBounds&&this.setMaxBounds(e.maxBounds),t.bindAll(["_onWindowOnline","_onWindowResize","_onMapScroll","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),void 0===this.painter)throw new Error("Failed to initialize WebGL.");this.on("move",(()=>this._update(!1))),this.on("moveend",(()=>this._update(!1))),this.on("zoom",(()=>this._update(!0))),void 0!==t.window&&(t.window.addEventListener("online",this._onWindowOnline,!1),t.window.addEventListener("resize",this._onWindowResize,!1),t.window.addEventListener("orientationchange",this._onWindowResize,!1),t.window.addEventListener("webkitfullscreenchange",this._onWindowResize,!1)),this.handlers=new kr(this,e),this._localFontFamily=e.localFontFamily,this._localIdeographFontFamily=e.localIdeographFontFamily,e.style&&this.setStyle(e.style,{localFontFamily:this._localFontFamily,localIdeographFontFamily:this._localIdeographFontFamily}),e.projection&&this.setProjection(e.projection),this._hash=e.hash&&new zn("string"==typeof e.hash&&e.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:e.center,zoom:e.zoom,bearing:e.bearing,pitch:e.pitch}),e.bounds&&(this.resize(),this.fitBounds(e.bounds,t.extend({},e.fitBoundsOptions,{duration:0})))),this.resize(),e.attributionControl&&this.addControl(new Sr({customAttribution:e.customAttribution})),this._logoControl=new Cr,this.addControl(this._logoControl,e.logoPosition),this.on("style.load",(()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)})),this.on("data",(e=>{this._update("style"===e.dataType),this.fire(new t.Event(`${e.dataType}data`,e))})),this.on("dataloading",(e=>{this.fire(new t.Event(`${e.dataType}dataloading`,e))}))}_getMapId(){return this._mapId}addControl(e,i){if(void 0===i&&(i=e.getDefaultPosition?e.getDefaultPosition():"top-right"),!e||!e.onAdd)return this.fire(new t.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const n=e.onAdd(this);this._controls.push(e);const r=this._controlPositions[i];return-1!==i.indexOf("bottom")?r.insertBefore(n,r.firstChild):r.appendChild(n),this}removeControl(e){if(!e||!e.onRemove)return this.fire(new t.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));const i=this._controls.indexOf(e);return i>-1&&this._controls.splice(i,1),e.onRemove(this),this}hasControl(t){return this._controls.indexOf(t)>-1}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}resize(e){if(this._updateContainerDimensions(),this._containerWidth===this.transform.width&&this._containerHeight===this.transform.height)return this;this._resizeCanvas(this._containerWidth,this._containerHeight),this.transform.resize(this._containerWidth,this._containerHeight),this.painter.resize(Math.ceil(this._containerWidth),Math.ceil(this._containerHeight));const i=!this._moving;return i&&this.fire(new t.Event("movestart",e)).fire(new t.Event("move",e)),this.fire(new t.Event("resize",e)),i&&this.fire(new t.Event("moveend",e)),this}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()||null}setMaxBounds(e){return this.transform.setMaxBounds(t.LngLatBounds.convert(e)),this._update()}setMinZoom(e){if((e=null==e?-2:e)>=-2&&e<=this.transform.maxZoom)return this.transform.minZoom=e,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=e,this._update(),this.getZoom()>e?this.setZoom(e):this.fire(new t.Event("zoomstart")).fire(new t.Event("zoom")).fire(new t.Event("zoomend")),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(e){if((e=null==e?0:e)<0)throw new Error("minPitch must be greater than or equal to 0");if(e>=0&&e<=this.transform.maxPitch)return this.transform.minPitch=e,this._update(),this.getPitch()85)throw new Error("maxPitch must be less than or equal to 85");if(e>=this.transform.minPitch)return this.transform.maxPitch=e,this._update(),this.getPitch()>e?this.setPitch(e):this.fire(new t.Event("pitchstart")).fire(new t.Event("pitch")).fire(new t.Event("pitchend")),this;throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(t){return this.transform.renderWorldCopies=t,this._update()}getProjection(){return this.transform.getProjection()}setProjection(t){return this._lazyInitEmptyStyle(),"string"==typeof t&&(t={name:t}),this._runtimeProjection=t,this.style.updateProjection(),this._transitionFromGlobe=!1,this}project(e){return this.transform.locationPoint3D(t.LngLat.convert(e))}unproject(e){return this.transform.pointLocation3D(t.pointGeometry.convert(e))}isMoving(){return this._moving||this.handlers&&this.handlers.isMoving()}isZooming(){return this._zooming||this.handlers&&this.handlers.isZooming()}isRotating(){return this._rotating||this.handlers&&this.handlers.isRotating()}_createDelegatedListener(t,e,i){if("mouseenter"===t||"mouseover"===t){let n=!1;const r=r=>{const o=e.filter((t=>this.getLayer(t))),a=o.length?this.queryRenderedFeatures(r.point,{layers:o}):[];a.length?n||(n=!0,i.call(this,new Fn(t,this,r.originalEvent,{features:a}))):n=!1},o=()=>{n=!1};return{layers:new Set(e),listener:i,delegates:{mousemove:r,mouseout:o}}}if("mouseleave"===t||"mouseout"===t){let n=!1;const r=r=>{const o=e.filter((t=>this.getLayer(t)));(o.length?this.queryRenderedFeatures(r.point,{layers:o}):[]).length?n=!0:n&&(n=!1,i.call(this,new Fn(t,this,r.originalEvent)))},o=e=>{n&&(n=!1,i.call(this,new Fn(t,this,e.originalEvent)))};return{layers:new Set(e),listener:i,delegates:{mousemove:r,mouseout:o}}}{const n=t=>{const n=e.filter((t=>this.getLayer(t))),r=n.length?this.queryRenderedFeatures(t.point,{layers:n}):[];r.length&&(t.features=r,i.call(this,t),delete t.features)};return{layers:new Set(e),listener:i,delegates:{[t]:n}}}}on(t,e,i){if(void 0===i)return super.on(t,e);Array.isArray(e)||(e=[e]);const n=this._createDelegatedListener(t,e,i);this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[t]=this._delegatedListeners[t]||[],this._delegatedListeners[t].push(n);for(const t in n.delegates)this.on(t,n.delegates[t]);return this}once(t,e,i){if(void 0===i)return super.once(t,e);Array.isArray(e)||(e=[e]);const n=this._createDelegatedListener(t,e,i);for(const t in n.delegates)this.once(t,n.delegates[t]);return this}off(t,e,i){if(void 0===i)return super.off(t,e);e=new Set(Array.isArray(e)?e:[e]);const n=(t,e)=>{if(t.size!==e.size)return!1;for(const i of t)if(!e.has(i))return!1;return!0},r=this._delegatedListeners?this._delegatedListeners[t]:void 0;return r&&(t=>{for(let r=0;r{e?this.fire(new t.ErrorEvent(e)):n&&this._updateDiff(n,i)}))}else"object"==typeof e&&this._updateDiff(e,i)}_updateDiff(e,i){try{this.style.setState(e)&&this._update(!0)}catch(n){t.warnOnce(`Unable to perform style diff: ${n.message||n.error||n}. Rebuilding the style from scratch.`),this._updateStyle(e,i)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():t.warnOnce("There is no style added to the map.")}addSource(t,e){return this._lazyInitEmptyStyle(),this.style.addSource(t,e),this._update(!0)}isSourceLoaded(e){const i=this.style&&this.style._getSourceCaches(e);if(0!==i.length)return i.every((t=>t.loaded()));this.fire(new t.ErrorEvent(new Error(`There is no source with ID '${e}'`)))}areTilesLoaded(){const t=this.style&&this.style._sourceCaches;for(const e in t){const i=t[e]._tiles;for(const t in i){const e=i[t];if("loaded"!==e.state&&"errored"!==e.state)return!1}}return!0}addSourceType(t,e,i){return this._lazyInitEmptyStyle(),this.style.addSourceType(t,e,i)}removeSource(t){return this.style.removeSource(t),this._updateTerrain(),this._update(!0)}getSource(t){return this.style.getSource(t)}addImage(e,i,{pixelRatio:n=1,sdf:r=!1,stretchX:o,stretchY:a,content:s}={}){if(this._lazyInitEmptyStyle(),i instanceof Or||Rr&&i instanceof Rr){const{width:l,height:c,data:u}=t.exported.getImageData(i);this.style.addImage(e,{data:new t.RGBAImage({width:l,height:c},u),pixelRatio:n,stretchX:o,stretchY:a,content:s,sdf:r,version:0})}else{if(void 0===i.width||void 0===i.height)return this.fire(new t.ErrorEvent(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));{const{width:l,height:c,data:u}=i,d=i;this.style.addImage(e,{data:new t.RGBAImage({width:l,height:c},new Uint8Array(u)),pixelRatio:n,stretchX:o,stretchY:a,content:s,sdf:r,version:0,userImage:d}),d.onAdd&&d.onAdd(this,e)}}}updateImage(e,i){const n=this.style.getImage(e);if(!n)return this.fire(new t.ErrorEvent(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const r=i instanceof Or||Rr&&i instanceof Rr?t.exported.getImageData(i):i,{width:o,height:a,data:s}=r;return void 0===o||void 0===a?this.fire(new t.ErrorEvent(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`"))):o!==n.data.width||a!==n.data.height?this.fire(new t.ErrorEvent(new Error("The width and height of the updated image must be that same as the previous version of the image"))):(n.data.replace(s,!(i instanceof Or||Rr&&i instanceof Rr)),void this.style.updateImage(e,n))}hasImage(e){return e?!!this.style.getImage(e):(this.fire(new t.ErrorEvent(new Error("Missing required image id"))),!1)}removeImage(t){this.style.removeImage(t)}loadImage(e,i){t.getImage(this._requestManager.transformRequest(e,t.ResourceType.Image),((e,n)=>{i(e,n instanceof Or?t.exported.getImageData(n):n)}))}listImages(){return this.style.listImages()}addLayer(t,e){return this._lazyInitEmptyStyle(),this.style.addLayer(t,e),this._update(!0)}moveLayer(t,e){return this.style.moveLayer(t,e),this._update(!0)}removeLayer(t){return this.style.removeLayer(t),this._update(!0)}getLayer(t){return this.style.getLayer(t)}setLayerZoomRange(t,e,i){return this.style.setLayerZoomRange(t,e,i),this._update(!0)}setFilter(t,e,i={}){return this.style.setFilter(t,e,i),this._update(!0)}getFilter(t){return this.style.getFilter(t)}setPaintProperty(t,e,i,n={}){return this.style.setPaintProperty(t,e,i,n),this._update(!0)}getPaintProperty(t,e){return this.style.getPaintProperty(t,e)}setLayoutProperty(t,e,i,n={}){return this.style.setLayoutProperty(t,e,i,n),this._update(!0)}getLayoutProperty(t,e){return this.style.getLayoutProperty(t,e)}setLight(t,e={}){return this._lazyInitEmptyStyle(),this.style.setLight(t,e),this._update(!0)}getLight(){return this.style.getLight()}setTerrain(t){return this._lazyInitEmptyStyle(),!t&&this.transform.projection.requiresDraping?this.style.setTerrainForDraping():this.style.setTerrain(t),this._averageElevationLastSampledAt=-1/0,this._update(!0)}_updateProjection(){"globe"===this.transform.projection.name&&this.transform.zoom>=t.GLOBE_ZOOM_THRESHOLD_MAX&&!this._transitionFromGlobe&&(this.setProjection({name:"mercator"}),this._transitionFromGlobe=!0)}getTerrain(){return this.style?this.style.getTerrain():null}setFog(t){return this._lazyInitEmptyStyle(),this.style.setFog(t),this._update(!0)}getFog(){return this.style?this.style.getFog():null}_queryFogOpacity(e){return this.style&&this.style.fog?this.style.fog.getOpacityAtLatLng(t.LngLat.convert(e),this.transform):0}setFeatureState(t,e){return this.style.setFeatureState(t,e),this._update()}removeFeatureState(t,e){return this.style.removeFeatureState(t,e),this._update()}getFeatureState(t){return this.style.getFeatureState(t)}_updateContainerDimensions(){if(!this._container)return;const e=this._container.getBoundingClientRect().width||400,i=this._container.getBoundingClientRect().height||300;let n,r=this._container;for(;r&&!n;){const e=t.window.getComputedStyle(r).transform;e&&"none"!==e&&(n=e.match(/matrix.*\((.+)\)/)[1].split(", ")),r=r.parentElement}n?(this._containerWidth=n[0]&&"0"!==n[0]?Math.abs(e/n[0]):e,this._containerHeight=n[3]&&"0"!==n[3]?Math.abs(i/n[3]):i):(this._containerWidth=e,this._containerHeight=i)}_detectMissingCSS(){"rgb(250, 128, 114)"!==t.window.getComputedStyle(this._missingCSSCanary).getPropertyValue("background-color")&&t.warnOnce("This page appears to be missing CSS declarations for Mapbox GL JS, which may cause the map to display incorrectly. Please ensure your page includes mapbox-gl.css, as described in https://www.mapbox.com/mapbox-gl-js/api/.")}_setupContainer(){const t=this._container;t.classList.add("mapboxgl-map"),(this._missingCSSCanary=a.create("div","mapboxgl-canary",t)).style.visibility="hidden",this._detectMissingCSS();const e=this._canvasContainer=a.create("div","mapboxgl-canvas-container",t);this._interactive&&e.classList.add("mapboxgl-interactive"),this._canvas=a.create("canvas","mapboxgl-canvas",e),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex","0"),this._canvas.setAttribute("aria-label","Map"),this._canvas.setAttribute("role","region"),this._updateContainerDimensions(),this._resizeCanvas(this._containerWidth,this._containerHeight);const i=this._controlContainer=a.create("div","mapboxgl-control-container",t),n=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach((t=>{n[t]=a.create("div",`mapboxgl-ctrl-${t}`,i)})),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(e,i){const n=t.exported.devicePixelRatio||1;this._canvas.width=n*Math.ceil(e),this._canvas.height=n*Math.ceil(i),this._canvas.style.width=`${e}px`,this._canvas.style.height=`${i}px`}_addMarker(t){this._markers.push(t)}_removeMarker(t){const e=this._markers.indexOf(t);-1!==e&&this._markers.splice(e,1)}_setupPainter(){const i=t.extend({},e.webGLContextAttributes,{failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1}),n=this._canvas.getContext("webgl",i)||this._canvas.getContext("experimental-webgl",i);n?(t.storeAuthState(n,!0),this.painter=new pn(n,this.transform),this.on("data",(t=>{"source"===t.dataType&&this.painter.setTileLoadedFlag(!0)})),t.exported$1.testSupport(n)):this.fire(new t.ErrorEvent(new Error("Failed to initialize WebGL")))}_contextLost(e){e.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new t.Event("webglcontextlost",{originalEvent:e}))}_contextRestored(e){this._setupPainter(),this.resize(),this._update(),this.fire(new t.Event("webglcontextrestored",{originalEvent:e}))}_onMapScroll(t){if(t.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(t){return this.style?(this._styleDirty=this._styleDirty||t,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(t){return this._update(),this._renderTaskQueue.add(t)}_cancelRenderFrame(t){this._renderTaskQueue.remove(t)}_requestDomTask(t){!this.loaded()||this.loaded()&&!this.isMoving()?t():this._domRenderTaskQueue.add(t)}_render(e){let i;const n=this.painter.context.extTimerQuery,r=t.exported.now();this.listens("gpu-timing-frame")&&(i=n.createQueryEXT(),n.beginQueryEXT(n.TIME_ELAPSED_EXT,i));let o=this._updateAverageElevation(r);if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(e),this._domRenderTaskQueue.run(e),this._removed)return;this._updateProjection();let a=!1;const s=this._isInitialLoad?0:this._fadeDuration;if(this.style&&this._styleDirty){this._styleDirty=!1;const e=this.transform.zoom,i=this.transform.pitch,n=t.exported.now();this.style.zoomHistory.update(e,n);const r=new t.EvaluationParameters(e,{now:n,fadeDuration:s,pitch:i,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),o=r.crossFadingFactor();1===o&&o===this._crossFadingFactor||(a=!0,this._crossFadingFactor=o),this.style.update(r)}if(this.style&&this.style.fog&&this.style.fog.hasTransition()&&(this.style._markersNeedUpdate=!0,this._sourcesDirty=!0),this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.painter._updateFog(this.style),this._updateTerrain(),this.style._updateSources(this.transform),this._forceMarkerUpdate()),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,s,this._crossSourceCollisions),this.style&&this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showTerrainWireframe:this.showTerrainWireframe,showOverdrawInspector:this._showOverdrawInspector,showQueryGeometry:!!this._showQueryGeometry,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:s,isInitialLoad:this._isInitialLoad,showPadding:this.showPadding,gpuTiming:!!this.listens("gpu-timing-layer"),speedIndexTiming:this.speedIndexTiming}),this.fire(new t.Event("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire(new t.Event("load"))),this.style&&(this.style.hasTransitions()||a)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles(),this.listens("gpu-timing-frame")){const e=t.exported.now()-r;n.endQueryEXT(n.TIME_ELAPSED_EXT,i),setTimeout((()=>{const r=n.getQueryObjectEXT(i,n.QUERY_RESULT_EXT)/1e6;n.deleteQueryEXT(i),this.fire(new t.Event("gpu-timing-frame",{cpuTime:e,gpuTime:r}))}),50)}if(this.listens("gpu-timing-layer")){const e=this.painter.collectGpuTimers();setTimeout((()=>{const i=this.painter.queryGpuTimers(e);this.fire(new t.Event("gpu-timing-layer",{layerTimes:i}))}),50)}const l=this._sourcesDirty||this._styleDirty||this._placementDirty||o;if(l||this._repaint)this.triggerRepaint();else{const e=!this.isMoving()&&this.loaded();if(e&&(o=this._updateAverageElevation(r,!0)),o)this.triggerRepaint();else if(this._triggerFrame(!1),e&&(this.fire(new t.Event("idle")),this._isInitialLoad=!1,this.speedIndexTiming)){const e=this._calculateSpeedIndex();this.fire(new t.Event("speedindexcompleted",{speedIndex:e})),this.speedIndexTiming=!1}}return!this._loaded||this._fullyLoaded||l||(this._fullyLoaded=!0,this._authenticate()),this}_forceMarkerUpdate(){for(const t of this._markers)t._update()}_updateAverageElevation(t,e=!1){const i=t=>(this.transform.averageElevation=t,this._update(!1),!0);if(!this.painter.averageElevationNeedsEasing())return 0!==this.transform.averageElevation&&i(0);if((e||t-this._averageElevationLastSampledAt>500)&&!this._averageElevation.isEasing(t)){const e=this.transform.averageElevation;let n=this.transform.sampleAverageElevation();isNaN(n)?n=0:this._averageElevationLastSampledAt=t;const r=Math.abs(e-n);if(r>1){if(this._isInitialLoad)return this._averageElevation.jumpTo(n),i(n);this._averageElevation.easeTo(n,t,300)}else if(r>1e-4)return this._averageElevation.jumpTo(n),i(n)}return!!this._averageElevation.isEasing(t)&&i(this._averageElevation.getValue(t))}_authenticate(){t.getMapSessionAPI(this._getMapId(),this._requestManager._skuToken,this._requestManager._customAccessToken,(e=>{if(e&&(e.message===t.AUTH_ERR_MSG||401===e.status)){const e=this.painter.context.gl;t.storeAuthState(e,!1),this._logoControl instanceof Cr&&this._logoControl._updateLogo(),e&&e.clear(e.DEPTH_BUFFER_BIT|e.COLOR_BUFFER_BIT|e.STENCIL_BUFFER_BIT),this._silenceAuthErrors||this.fire(new t.ErrorEvent(new Error("A valid Mapbox access token is required to use Mapbox GL JS. To create an account or a new access token, visit https://account.mapbox.com/")))}})),t.postMapLoadEvent(this._getMapId(),this._requestManager._skuToken,this._requestManager._customAccessToken,(()=>{}))}_updateTerrain(){this.painter.updateTerrain(this.style,this.isMoving()||this.isRotating()||this.isZooming())}_calculateSpeedIndex(){const t=this.painter.canvasCopy(),e=this.painter.getCanvasCopiesAndTimestamps();e.timeStamps.push(performance.now());const i=this.painter.context.gl,n=i.createFramebuffer();function r(t){i.framebufferTexture2D(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.TEXTURE_2D,t,0);const e=new Uint8Array(i.drawingBufferWidth*i.drawingBufferHeight*4);return i.readPixels(0,0,i.drawingBufferWidth,i.drawingBufferHeight,i.RGBA,i.UNSIGNED_BYTE,e),e}return i.bindFramebuffer(i.FRAMEBUFFER,n),this._canvasPixelComparison(r(t),e.canvasCopies.map(r),e.timeStamps)}_canvasPixelComparison(t,e,i){let n=i[1]-i[0];const r=t.length/4;for(let o=0;o{const e=!!this._renderNextFrame;this._frame=null,this._renderNextFrame=null,e&&this._render(t)})))}_preloadTiles(e){const i=this.style&&Object.values(this.style._sourceCaches)||[];return t.asyncAll(i,((t,i)=>t._preloadTiles(e,i)),(()=>{this.triggerRepaint()})),this}_onWindowOnline(){this._update()}_onWindowResize(t){this._trackResize&&this.resize({originalEvent:t})._update()}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(t){this._showTileBoundaries!==t&&(this._showTileBoundaries=t,this._update())}get showTerrainWireframe(){return!!this._showTerrainWireframe}set showTerrainWireframe(t){this._showTerrainWireframe!==t&&(this._showTerrainWireframe=t,this._update())}get speedIndexTiming(){return!!this._speedIndexTiming}set speedIndexTiming(t){this._speedIndexTiming!==t&&(this._speedIndexTiming=t,this._update())}get showPadding(){return!!this._showPadding}set showPadding(t){this._showPadding!==t&&(this._showPadding=t,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(t){this._showCollisionBoxes!==t&&(this._showCollisionBoxes=t,t?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(t){this._showOverdrawInspector!==t&&(this._showOverdrawInspector=t,this._update())}get repaint(){return!!this._repaint}set repaint(t){this._repaint!==t&&(this._repaint=t,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(t){this._vertices=t,this._update()}_setCacheLimits(e,i){t.setCacheLimits(e,i)}get version(){return t.version}},NavigationControl:class{constructor(e){this.options=t.extend({},jr,e),this._container=a.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.addEventListener("contextmenu",(t=>t.preventDefault())),this.options.showZoom&&(t.bindAll(["_setButtonTitle","_updateZoomButtons"],this),this._zoomInButton=this._createButton("mapboxgl-ctrl-zoom-in",(t=>this._map.zoomIn({},{originalEvent:t}))),a.create("span","mapboxgl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden",!0),this._zoomOutButton=this._createButton("mapboxgl-ctrl-zoom-out",(t=>this._map.zoomOut({},{originalEvent:t}))),a.create("span","mapboxgl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden",!0)),this.options.showCompass&&(t.bindAll(["_rotateCompassArrow"],this),this._compass=this._createButton("mapboxgl-ctrl-compass",(t=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:t}):this._map.resetNorth({},{originalEvent:t})})),this._compassIcon=a.create("span","mapboxgl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden",!0))}_updateZoomButtons(){const t=this._map.getZoom(),e=t===this._map.getMaxZoom(),i=t===this._map.getMinZoom();this._zoomInButton.disabled=e,this._zoomOutButton.disabled=i,this._zoomInButton.setAttribute("aria-disabled",e.toString()),this._zoomOutButton.setAttribute("aria-disabled",i.toString())}_rotateCompassArrow(){const t=this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(this._map.transform.pitch*(Math.PI/180)),.5)}) rotateX(${this._map.transform.pitch}deg) rotateZ(${this._map.transform.angle*(180/Math.PI)}deg)`:`rotate(${this._map.transform.angle*(180/Math.PI)}deg)`;this._map._requestDomTask((()=>{this._compassIcon&&(this._compassIcon.style.transform=t)}))}onAdd(t){return this._map=t,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),this._map.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new Nr(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){this._container.remove(),this.options.showZoom&&this._map.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map}_createButton(t,e){const i=a.create("button",t,this._container);return i.type="button",i.addEventListener("click",e),i}_setButtonTitle(t,e){const i=this._map._getUIString(`NavigationControl.${e}`);t.setAttribute("aria-label",i),t.firstElementChild&&t.firstElementChild.setAttribute("title",i)}},GeolocateControl:class extends t.Evented{constructor(e){super(),this.options=t.extend({},Vr,e),t.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker","_updateMarkerRotation"],this),this._onDeviceOrientationListener=this._onDeviceOrientation.bind(this),this._updateMarkerRotationThrottled=Mn(this._updateMarkerRotation,20)}onAdd(e){var i;return this._map=e,this._container=a.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),i=this._setupUI,void 0!==Ur?i(Ur):void 0!==t.window.navigator.permissions?t.window.navigator.permissions.query({name:"geolocation"}).then((t=>{Ur="denied"!==t.state,i(Ur)})):(Ur=!!t.window.navigator.geolocation,i(Ur)),this._container}onRemove(){void 0!==this._geolocationWatchID&&(t.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),this._container.remove(),this._map.off("zoom",this._onZoom),this._map=void 0,Zr=0,$r=!1}_isOutOfMapMaxBounds(t){const e=this._map.getMaxBounds(),i=t.coords;return e&&(i.longitudee.getEast()||i.latitudee.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting")}}_onSuccess(e){if(this._map){if(this._isOutOfMapMaxBounds(e))return this._setErrorState(),this.fire(new t.Event("outofmaxbounds",e)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=e,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background")}this.options.showUserLocation&&"OFF"!==this._watchState&&this._updateMarker(e),this.options.trackUserLocation&&"ACTIVE_LOCK"!==this._watchState||this._updateCamera(e),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new t.Event("geolocate",e)),this._finish()}}_updateCamera(e){const i=new t.LngLat(e.coords.longitude,e.coords.latitude),n=e.coords.accuracy,r=this._map.getBearing(),o=t.extend({bearing:r},this.options.fitBoundsOptions);this._map.fitBounds(i.toBounds(n),o,{geolocateSource:!0})}_updateMarker(e){if(e){const i=new t.LngLat(e.coords.longitude,e.coords.latitude);this._accuracyCircleMarker.setLngLat(i).addTo(this._map),this._userLocationDotMarker.setLngLat(i).addTo(this._map),this._accuracy=e.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()}_updateCircleRadius(){const t=this._map._containerHeight/2,e=this._map.unproject([0,t]),i=this._map.unproject([100,t]),n=e.distanceTo(i)/100,r=Math.ceil(2*this._accuracy/n);this._circleElement.style.width=`${r}px`,this._circleElement.style.height=`${r}px`}_onZoom(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}_updateMarkerRotation(){this._userLocationDotMarker&&"number"==typeof this._heading?(this._userLocationDotMarker.setRotation(this._heading),this._dotElement.classList.add("mapboxgl-user-location-show-heading")):(this._dotElement.classList.remove("mapboxgl-user-location-show-heading"),this._userLocationDotMarker.setRotation(0))}_onError(e){if(this._map){if(this.options.trackUserLocation)if(1===e.code){this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;const t=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.setAttribute("aria-label",t),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",t),void 0!==this._geolocationWatchID&&this._clearWatch()}else{if(3===e.code&&$r)return;this._setErrorState()}"OFF"!==this._watchState&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new t.Event("error",e)),this._finish()}}_finish(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0}_setupUI(e){if(this._container.addEventListener("contextmenu",(t=>t.preventDefault())),this._geolocateButton=a.create("button","mapboxgl-ctrl-geolocate",this._container),a.create("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden",!0),this._geolocateButton.type="button",!1===e){t.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");const e=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.setAttribute("aria-label",e),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",e)}else{const t=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.setAttribute("aria-label",t),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",t)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=a.create("div","mapboxgl-user-location"),this._dotElement.appendChild(a.create("div","mapboxgl-user-location-dot")),this._dotElement.appendChild(a.create("div","mapboxgl-user-location-heading")),this._userLocationDotMarker=new Pr({element:this._dotElement,rotationAlignment:"map",pitchAlignment:"map"}),this._circleElement=a.create("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Pr({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",(e=>{e.geolocateSource||"ACTIVE_LOCK"!==this._watchState||e.originalEvent&&"resize"===e.originalEvent.type||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this.fire(new t.Event("trackuserlocationend")))}))}_onDeviceOrientation(t){this._userLocationDotMarker&&(t.webkitCompassHeading?this._heading=t.webkitCompassHeading:!0===t.absolute&&(this._heading=-1*t.alpha),this._updateMarkerRotationThrottled())}trigger(){if(!this._setup)return t.warnOnce("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new t.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":Zr--,$r=!1,this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire(new t.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new t.Event("trackuserlocationstart"))}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error")}if("OFF"===this._watchState&&void 0!==this._geolocationWatchID)this._clearWatch();else if(void 0===this._geolocationWatchID){let e;this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),Zr++,Zr>1?(e={maximumAge:6e5,timeout:0},$r=!0):(e=this.options.positionOptions,$r=!1),this._geolocationWatchID=t.window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,e),this.options.showUserHeading&&this._addDeviceOrientationListener()}}else t.window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0}_addDeviceOrientationListener(){const e=()=>{t.window.addEventListener("ondeviceorientationabsolute"in t.window?"deviceorientationabsolute":"deviceorientation",this._onDeviceOrientationListener)};void 0!==t.window.DeviceMotionEvent&&"function"==typeof t.window.DeviceMotionEvent.requestPermission?DeviceOrientationEvent.requestPermission().then((t=>{"granted"===t&&e()})).catch(console.error):e()}_clearWatch(){t.window.navigator.geolocation.clearWatch(this._geolocationWatchID),t.window.removeEventListener("deviceorientation",this._onDeviceOrientationListener),t.window.removeEventListener("deviceorientationabsolute",this._onDeviceOrientationListener),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)}},AttributionControl:Sr,ScaleControl:class{constructor(e){this.options=t.extend({},Gr,e),t.bindAll(["_onMove","setUnit"],this)}getDefaultPosition(){return"bottom-left"}_onMove(){qr(this._map,this._container,this.options)}onAdd(t){return this._map=t,this._container=a.create("div","mapboxgl-ctrl mapboxgl-ctrl-scale",t.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){this._container.remove(),this._map.off("move",this._onMove),this._map=void 0}setUnit(t){this.options.unit=t,qr(this._map,this._container,this.options)}},FullscreenControl:class{constructor(e){this._fullscreen=!1,e&&e.container&&(e.container instanceof t.window.HTMLElement?this._container=e.container:t.warnOnce("Full screen control 'container' must be a DOM element.")),t.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in t.window.document?this._fullscreenchange="fullscreenchange":"onwebkitfullscreenchange"in t.window.document&&(this._fullscreenchange="webkitfullscreenchange")}onAdd(e){return this._map=e,this._container||(this._container=this._map.getContainer()),this._controlContainer=a.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",t.warnOnce("This device does not support fullscreen mode.")),this._controlContainer}onRemove(){this._controlContainer.remove(),this._map=null,t.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)}_checkFullscreenSupport(){return!(!t.window.document.fullscreenEnabled&&!t.window.document.webkitFullscreenEnabled)}_setupUI(){const e=this._fullscreenButton=a.create("button","mapboxgl-ctrl-fullscreen",this._controlContainer);a.create("span","mapboxgl-ctrl-icon",e).setAttribute("aria-hidden",!0),e.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),t.window.document.addEventListener(this._fullscreenchange,this._changeIcon)}_updateTitle(){const t=this._getTitle();this._fullscreenButton.setAttribute("aria-label",t),this._fullscreenButton.firstElementChild&&this._fullscreenButton.firstElementChild.setAttribute("title",t)}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_changeIcon(){(t.window.document.fullscreenElement||t.window.document.webkitFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())}_onClickFullscreen(){this._isFullscreen()?t.window.document.exitFullscreen?t.window.document.exitFullscreen():t.window.document.webkitCancelFullScreen&&t.window.document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()}},Popup:class extends t.Evented{constructor(e){super(),this.options=t.extend(Object.create(Hr),e),t.bindAll(["_update","_onClose","remove","_onMouseMove","_onMouseUp","_onDrag"],this),this._classList=new Set(e&&e.className?e.className.trim().split(/\s+/):[])}addTo(e){return this._map&&this.remove(),this._map=e,this.options.closeOnClick&&this._map.on("preclick",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")):this._map.on("move",this._update),this.fire(new t.Event("open")),this}isOpen(){return!!this._map}remove(){return this._content&&this._content.remove(),this._container&&(this._container.remove(),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),delete this._map),this.fire(new t.Event("close")),this}getLngLat(){return this._lngLat}setLngLat(e){return this._lngLat=t.LngLat.convert(e),this._pos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._map._canvasContainer.classList.remove("mapboxgl-track-pointer")),this}trackPointer(){return this._trackPointer=!0,this._pos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")),this}getElement(){return this._container}setText(e){return this.setDOMContent(t.window.document.createTextNode(e))}setHTML(e){const i=t.window.document.createDocumentFragment(),n=t.window.document.createElement("body");let r;for(n.innerHTML=e;r=n.firstChild,r;)i.appendChild(r);return this.setDOMContent(i)}getMaxWidth(){return this._container&&this._container.style.maxWidth}setMaxWidth(t){return this.options.maxWidth=t,this._update(),this}setDOMContent(t){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=a.create("div","mapboxgl-popup-content",this._container);return this._content.appendChild(t),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(t){return this._classList.add(t),this._container&&this._updateClassList(),this}removeClassName(t){return this._classList.delete(t),this._container&&this._updateClassList(),this}setOffset(t){return this.options.offset=t,this._update(),this}toggleClassName(t){let e;return this._classList.delete(t)?e=!1:(this._classList.add(t),e=!0),this._container&&this._updateClassList(),e}_createCloseButton(){this.options.closeButton&&(this._closeButton=a.create("button","mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.setAttribute("aria-hidden","true"),this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))}_onMouseUp(t){this._update(t.point)}_onMouseMove(t){this._update(t.point)}_onDrag(t){this._update(t.point)}_getAnchor(t){if(this.options.anchor)return this.options.anchor;const e=this._pos,i=this._container.offsetWidth,n=this._container.offsetHeight;let r;return r=e.y+t.bottom.ythis._map.transform.height-n?["bottom"]:[],e.xthis._map.transform.width-i/2&&r.push("right"),0===r.length?"bottom":r.join("-")}_updateClassList(){const t=[...this._classList];t.push("mapboxgl-popup"),this._anchor&&t.push(`mapboxgl-popup-anchor-${this._anchor}`),this._trackPointer&&t.push("mapboxgl-popup-track-pointer"),this._container.className=t.join(" ")}_update(e){if(this._map&&(this._lngLat||this._trackPointer)&&this._content){if(this._container||(this._container=a.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=a.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content)),this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._map.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=zr(this._lngLat,this._pos,this._map.transform)),!this._trackPointer||e){const i=this._pos=this._trackPointer&&e?e:this._map.project(this._lngLat),n=function(e){if(e||(e=new t.pointGeometry(0,0)),"number"==typeof e){const i=Math.round(Math.sqrt(.5*Math.pow(e,2)));return{center:new t.pointGeometry(0,0),top:new t.pointGeometry(0,e),"top-left":new t.pointGeometry(i,i),"top-right":new t.pointGeometry(-i,i),bottom:new t.pointGeometry(0,-e),"bottom-left":new t.pointGeometry(i,-i),"bottom-right":new t.pointGeometry(-i,-i),left:new t.pointGeometry(e,0),right:new t.pointGeometry(-e,0)}}if(e instanceof t.pointGeometry||Array.isArray(e)){const i=t.pointGeometry.convert(e);return{center:i,top:i,"top-left":i,"top-right":i,bottom:i,"bottom-left":i,"bottom-right":i,left:i,right:i}}return{center:t.pointGeometry.convert(e.center||[0,0]),top:t.pointGeometry.convert(e.top||[0,0]),"top-left":t.pointGeometry.convert(e["top-left"]||[0,0]),"top-right":t.pointGeometry.convert(e["top-right"]||[0,0]),bottom:t.pointGeometry.convert(e.bottom||[0,0]),"bottom-left":t.pointGeometry.convert(e["bottom-left"]||[0,0]),"bottom-right":t.pointGeometry.convert(e["bottom-right"]||[0,0]),left:t.pointGeometry.convert(e.left||[0,0]),right:t.pointGeometry.convert(e.right||[0,0])}}(this.options.offset),r=this._anchor=this._getAnchor(n),o=i.add(n[r]).round();this._map._requestDomTask((()=>{this._container&&r&&(this._container.style.transform=`${Ir[r]} translate(${o.x}px,${o.y}px)`)}))}this._updateClassList()}}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;const t=this._container.querySelector(Xr);t&&t.focus()}_onClose(){this.remove()}_setOpacity(t){this._content&&(this._content.style.opacity=t),this._tip&&(this._tip.style.opacity=t)}},Marker:Pr,Style:Ne,LngLat:t.LngLat,LngLatBounds:t.LngLatBounds,Point:t.pointGeometry,MercatorCoordinate:t.MercatorCoordinate,FreeCameraOptions:_n,Evented:t.Evented,config:t.config,prewarm:function(){At().acquire(zt)},clearPrewarmedResources:function(){const t=Pt;t&&(t.isPreloaded()&&1===t.numActive()?(t.release(zt),Pt=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))},get accessToken(){return t.config.ACCESS_TOKEN},set accessToken(e){t.config.ACCESS_TOKEN=e},get baseApiUrl(){return t.config.API_URL},set baseApiUrl(e){t.config.API_URL=e},get workerCount(){return It.workerCount},set workerCount(t){It.workerCount=t},get maxParallelImageRequests(){return t.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(e){t.config.MAX_PARALLEL_IMAGE_REQUESTS=e},clearStorage(e){t.clearTileCache(e)},workerUrl:"",workerClass:null,setNow:t.exported.setNow,restoreNow:t.exported.restoreNow};return Yr})),i}()},395:()=>{},418:t=>{"use strict";var e=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function r(t){if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}t.exports=function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},i=0;i<10;i++)e["_"+String.fromCharCode(i)]=i;if("0123456789"!==Object.getOwnPropertyNames(e).map((function(t){return e[t]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(t){n[t]=t})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(t){return!1}}()?Object.assign:function(t,o){for(var a,s,l=r(t),c=1;c{var e,i,n=t.exports={};function r(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function a(t){if(e===setTimeout)return setTimeout(t,0);if((e===r||!e)&&setTimeout)return e=setTimeout,setTimeout(t,0);try{return e(t,0)}catch(i){try{return e.call(null,t,0)}catch(i){return e.call(this,t,0)}}}!function(){try{e="function"==typeof setTimeout?setTimeout:r}catch(t){e=r}try{i="function"==typeof clearTimeout?clearTimeout:o}catch(t){i=o}}();var s,l=[],c=!1,u=-1;function d(){c&&s&&(c=!1,s.length?l=s.concat(l):u=-1,l.length&&h())}function h(){if(!c){var t=a(d);c=!0;for(var e=l.length;e;){for(s=l,l=[];++u1)for(var i=1;i{"use strict";var n=i(414);function r(){}function o(){}o.resetWarningCache=r,t.exports=function(){function t(t,e,i,r,o,a){if(a!==n){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function e(){return t}t.isRequired=t;var i={array:t,bigint:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,elementType:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:o,resetWarningCache:r};return i.PropTypes=i,i}},697:(t,e,i)=>{t.exports=i(703)()},414:t=>{"use strict";t.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},448:(t,e,i)=>{"use strict";var n=i(294),r=i(418),o=i(840);function a(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,i=1;i