@signalk/freeboard-sk 3.4.0 → 3.5.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/README.md +3 -1
  2. package/package.json +2 -2
  3. package/public/assets/features/radar-overlay-2.jpg +0 -0
  4. package/public/assets/features/radar-targets-1.jpg +0 -0
  5. package/public/assets/features/route-styles-1.jpg +0 -0
  6. package/public/assets/features-corpus.json +1 -1
  7. package/public/assets/help/img/ais_shiptypes.png +0 -0
  8. package/public/assets/help/index.html +81 -27
  9. package/public/assets/img/routes/route-end.svg +6 -0
  10. package/public/assets/img/routes/route-start.svg +6 -0
  11. package/public/assets/img/routes/route-waypoint.svg +9 -0
  12. package/public/assets/img/vessels/ais_fishing.svg +33 -0
  13. package/public/chunk-2EKPI63M.js +1 -0
  14. package/public/{chunk-VBSJZWSI.js → chunk-2H73O7R4.js} +1 -1
  15. package/public/{chunk-DN6IX7CO.js → chunk-2JAD5V57.js} +1 -1
  16. package/public/{chunk-GJZ7P5CR.js → chunk-4LLIVPOH.js} +1 -1
  17. package/public/chunk-67S772YL.js +1 -0
  18. package/public/{chunk-O7ZJUEKN.js → chunk-6BSDRWQ3.js} +1 -1
  19. package/public/{chunk-PWZFOOT4.js → chunk-6EZKIXYQ.js} +1 -1
  20. package/public/{chunk-MWETYHR7.js → chunk-7ISDSY26.js} +1 -1
  21. package/public/chunk-7VLEFGRK.js +1 -0
  22. package/public/{chunk-ZQSUYMH2.js → chunk-BNDXOOFA.js} +1 -1
  23. package/public/{chunk-PWNYMCP2.js → chunk-CJARACLQ.js} +1 -1
  24. package/public/{chunk-RENDTMDT.js → chunk-G5EXGCP4.js} +1 -1
  25. package/public/chunk-GHLF3D5Z.js +2 -0
  26. package/public/chunk-GVY3IGQP.js +1 -0
  27. package/public/{chunk-AZQNOMPD.js → chunk-HHVNH6WV.js} +1 -1
  28. package/public/{chunk-A6WPZCNE.js → chunk-IQVXAJGE.js} +1 -1
  29. package/public/{chunk-WOU2FNU3.js → chunk-JPTPBTTP.js} +1 -1
  30. package/public/{chunk-VT4GQY5X.js → chunk-LH5NA6FP.js} +1 -1
  31. package/public/{chunk-DSUCHYD7.js → chunk-LRYGINIX.js} +1 -1
  32. package/public/{chunk-BC2VITG4.js → chunk-MFWKSXF7.js} +1 -1
  33. package/public/chunk-MR5B4XRH.js +1 -0
  34. package/public/{chunk-MZ3YWFFB.js → chunk-NXLWB5IV.js} +1 -1
  35. package/public/chunk-QD2NEHGC.js +1 -0
  36. package/public/{chunk-YBVURHD5.js → chunk-QJ2QMZLA.js} +1 -1
  37. package/public/{chunk-SIFYI3HU.js → chunk-SJSHCZKD.js} +1 -1
  38. package/public/{chunk-IP2UNZAT.js → chunk-TCWGFZUF.js} +1 -1
  39. package/public/{chunk-DC5AFSD6.js → chunk-THOUUI2P.js} +1 -1
  40. package/public/chunk-TLNMSJUF.js +1 -0
  41. package/public/{chunk-VXYZIAGN.js → chunk-TO4IOJWS.js} +1 -1
  42. package/public/{chunk-2GVS7ZQR.js → chunk-UOK6WTQH.js} +1 -1
  43. package/public/{chunk-S3D6SFT3.js → chunk-URCOHSFB.js} +127 -127
  44. package/public/chunk-V3SPESMB.js +7 -0
  45. package/public/{chunk-LAEWLVI3.js → chunk-VH2NXKOR.js} +1 -1
  46. package/public/chunk-W5SXKI6G.js +1 -0
  47. package/public/chunk-W7TSMHU3.js +1 -0
  48. package/public/chunk-XDKT43CW.js +4 -0
  49. package/public/{chunk-2QKJQDG4.js → chunk-XXJX5CGO.js} +14 -14
  50. package/public/index.html +1 -1
  51. package/public/main-ZCGBRKVF.js +359 -0
  52. package/public/worker-DI2XYCRR.js +3 -0
  53. package/public/chunk-6WBZNWRD.js +0 -1
  54. package/public/chunk-7TRPB24O.js +0 -1
  55. package/public/chunk-CRWXCOWS.js +0 -1
  56. package/public/chunk-K4EGDHPT.js +0 -2
  57. package/public/chunk-KVAJ5GVN.js +0 -1
  58. package/public/chunk-LEEF5WZZ.js +0 -1
  59. package/public/chunk-R6ABX6RX.js +0 -4
  60. package/public/chunk-RYULE37H.js +0 -1
  61. package/public/chunk-VX5OMNYT.js +0 -1
  62. package/public/chunk-WARJYBQ7.js +0 -7
  63. package/public/chunk-Z2IWHI3C.js +0 -1
  64. package/public/main-4HT3LEFF.js +0 -358
  65. package/public/worker-CDFJSLG6.js +0 -3
@@ -0,0 +1,2 @@
1
+ import{V as Jr,na as ve,yc as Ht}from"./chunk-XDKT43CW.js";import{a as x,b as R,g as P}from"./chunk-BZGM3F3K.js";var Gt="plotterExt/1",C={PARSE_ERROR:-32700,INVALID_REQUEST:-32600,METHOD_NOT_FOUND:-32601,INVALID_PARAMS:-32602,INTERNAL_ERROR:-32603,HOST_ERROR:-32e3,TIMEOUT:-32001,CONNECTION_CLOSED:-32002},q=class Re extends Error{code;data;constructor(e,r={}){super(e),this.name="RpcError",this.code=r.code??C.HOST_ERROR;let n=x({},r.data??{});r.reason!==void 0&&(n.reason=r.reason),this.data=Object.keys(n).length>0?n:void 0}get reason(){return typeof this.data?.reason=="string"?this.data.reason:void 0}toErrorObject(){return x({code:this.code,message:this.message},this.data?{data:this.data}:{})}static fromErrorObject(e){return new Re(e.message,{code:e.code,data:e.data})}static from(e){return e instanceof Re?e:e instanceof Error?new Re(e.message,{code:C.INTERNAL_ERROR}):new Re(String(e),{code:C.INTERNAL_ERROR})}},Wt="bus.ready",Kt="bus.handshake";function Gr(t,e){return t===e?!0:Wr(t.split("."),0,e.split("."),0)}function Wr(t,e,r,n){for(;e<t.length;){let i=t[e];if(i==="**"){if(e===t.length-1)return!0;for(let a=n;a<=r.length;a++)if(Wr(t,e+1,r,a))return!0;return!1}if(n>=r.length||i!=="*"&&i!==r[n])return!1;e++,n++}return n===r.length}function tt(t,e){for(let r of t)if(Gr(r,e))return!0;return!1}function Hr(t){return t>=-180&&t<=180?t:((t+180)%360+360)%360-180}function Kr(t){let[e,,r]=t;return r>=e?r-e:r-e+360}function ci(t){if(!Array.isArray(t)||t.length!==4||!t.every(l=>typeof l=="number"&&Number.isFinite(l)))return;let[e,r,n,i]=t;if(r<-90||i>90||r>i)return;let a=Hr(e),o=Hr(n);return(e<=n?n-e:Kr([a,r,o,i]))>=360?[-180,r,180,i]:[a,r,o,i]}function pi(t){return{bus:Gt,msg:t}}function fi(t){if(typeof t!="object"||t===null)return null;let e=t;return e.bus!==Gt?null:di(e.msg)?e.msg:null}function di(t){if(typeof t!="object"||t===null)return!1;let e=t;if(e.jsonrpc!=="2.0")return!1;if(typeof e.method=="string")return e.id===void 0||typeof e.id=="string"||typeof e.id=="number";if(!(typeof e.id=="string"||typeof e.id=="number"||e.id===null))return!1;let n="result"in e,i=e.error,a=typeof i=="object"&&i!==null&&typeof i.code=="number"&&typeof i.message=="string";return n?!("error"in e):a}function yi(t){return"method"in t&&"id"in t&&t.id!==void 0}function mi(t){return"method"in t&&(!("id"in t)||t.id===void 0)}function hi(t){return!("method"in t)}function gi(t,e={}){let r=e.listenWindow??globalThis,n=e.origin??r.location?.origin??"*";return{post(i,a){a?.length?t.postMessage(i,{targetOrigin:n,transfer:a}):t.postMessage(i,n)},listen(i){let a=o=>{o.source===t&&(n!=="*"&&o.origin!==n||i(o.data))};return r.addEventListener("message",a),()=>r.removeEventListener("message",a)}}}var vi=1e4,Zt=class{callTimeoutMs;port;unlisten;onError;pending=new Map;methods=new Map;eventHandlers=new Set;idPrefix=Math.random().toString(36).slice(2,8);seq=0;closed=!1;constructor(t){this.port=t.port,this.callTimeoutMs=t.callTimeoutMs??vi,this.onError=t.onError??(e=>console.warn("[plotterext-bus]",e)),this.unlisten=this.port.listen(e=>this.onData(e))}registerMethod(t,e){this.methods.set(t,e)}unregisterMethod(t){this.methods.delete(t)}onEvent(t,e){let r={patterns:t,fn:e};return this.eventHandlers.add(r),()=>this.eventHandlers.delete(r)}notify(t,e,r={}){this.send(x({jsonrpc:"2.0",method:t},e!==void 0?{params:e}:{}),r.transfer)}call(t,e,r={}){if(this.closed)return Promise.reject(new q("Bus endpoint is closed",{code:C.CONNECTION_CLOSED,reason:"CLOSED"}));let n=`${this.idPrefix}-${++this.seq}`,i=r.timeoutMs??this.callTimeoutMs;return new Promise((a,o)=>{let s=i>0?setTimeout(()=>{this.pending.delete(n),o(new q(`Call timed out after ${i}ms: ${t}`,{code:C.TIMEOUT,reason:"TIMEOUT"}))},i):null;this.pending.set(n,{resolve:a,reject:o,timer:s}),this.send(x({jsonrpc:"2.0",id:n,method:t},e!==void 0?{params:e}:{}),r.transfer)})}close(){if(!this.closed){this.closed=!0,this.unlisten();for(let[,t]of this.pending)t.timer&&clearTimeout(t.timer),t.reject(new q("Bus endpoint closed",{code:C.CONNECTION_CLOSED,reason:"CLOSED"}));this.pending.clear(),this.eventHandlers.clear()}}send(t,e){this.closed||this.port.post(pi(t),e)}onData(t){let e=fi(t);e&&(hi(e)?this.onResponse(e):yi(e)?this.onRequest(e):mi(e)&&this.onNotification(e.method,e.params))}onResponse(t){if(t.id===null)return;let e=this.pending.get(t.id);e&&(this.pending.delete(t.id),e.timer&&clearTimeout(e.timer),"error"in t?e.reject(q.fromErrorObject(t.error)):e.resolve(t.result))}onRequest(t){return P(this,null,function*(){let e=this.methods.get(t.method);if(!e){this.send({jsonrpc:"2.0",id:t.id,error:{code:C.METHOD_NOT_FOUND,message:`Method not found: ${t.method}`}});return}try{let r=yield e(t.params,{endpoint:this});this.send({jsonrpc:"2.0",id:t.id,result:r===void 0?null:r})}catch(r){this.send({jsonrpc:"2.0",id:t.id,error:q.from(r).toErrorObject()})}})}onNotification(t,e){for(let r of[...this.eventHandlers])if(tt(r.patterns,t))try{r.fn(t,e)}catch(n){this.onError(n)}}};var Zr=["all","extension"];function rt(t){return new q(t,{code:C.INVALID_PARAMS,reason:"events.badRequest"})}function bi(t){let e=t??{},{topic:r,scope:n="all"}=e;if(typeof r!="string"||r.length===0)throw rt("events.publish requires a non-empty topic");if(r.includes("*"))throw rt('events.publish topic must not contain "*"');if(r==="bus"||r.startsWith("bus."))throw rt("events.publish topic must not be in the bus.* namespace");if(!Zr.includes(n))throw rt(`events.publish scope must be one of: ${Zr.join(", ")}`);return"params"in e?{topic:r,scope:n,params:e.params}:{topic:r,scope:n}}var wi=class{endpoint;context;hostInfo;subs=new Map;onSubscriptionsChanged;adoptCallerId;subSeq=0;constructor(t){this.hostInfo=t.hostInfo,this.context=t.context,this.onSubscriptionsChanged=t.onSubscriptionsChanged,this.adoptCallerId=t.adoptCallerId??!1,this.endpoint=new Zt({port:t.port,callTimeoutMs:t.callTimeoutMs,onError:t.onError});for(let[e,r]of Object.entries(t.methods??{}))this.endpoint.registerMethod(e,r);this.endpoint.registerMethod("events.subscribe",e=>this.handleSubscribe(e)),this.endpoint.registerMethod("events.unsubscribe",e=>this.handleUnsubscribe(e)),this.endpoint.onEvent([Wt],(e,r)=>this.sendHandshake(r))}registerMethod(t,e){this.endpoint.registerMethod(t,e)}publish(t,e){return this.hasSubscriber(t)?(this.endpoint.notify(t,e),!0):!1}hasSubscriber(t){for(let[,e]of this.subs)if(tt(e,t))return!0;return!1}subscribedPatterns(){let t=new Set;for(let[,e]of this.subs)for(let r of e)t.add(r);return[...t]}close(){this.endpoint.close(),this.subs.clear()}sendHandshake(t){let e=this.adoptCallerId&&t?.id?R(x({},this.context),{id:t.id}):this.context;this.endpoint.notify(Kt,R(x({},this.hostInfo),{context:e}))}handleSubscribe(t){let e=t?.patterns;if(!Array.isArray(e)||e.length===0||!e.every(n=>typeof n=="string"&&n.length>0))throw new q("events.subscribe requires a non-empty patterns array",{code:C.INVALID_PARAMS,reason:"INVALID_PATTERNS"});let r=`sub-${++this.subSeq}`;return this.subs.set(r,e),this.onSubscriptionsChanged?.(this.subscribedPatterns()),{subscriptionId:r}}handleUnsubscribe(t){let e=t?.subscriptionId;if(typeof e!="string"||!this.subs.has(e))throw new q("Unknown subscriptionId",{code:C.INVALID_PARAMS,reason:"UNKNOWN_SUBSCRIPTION"});return this.subs.delete(e),this.onSubscriptionsChanged?.(this.subscribedPatterns()),{}}};var ki=4,ce=200,Si=33,Oi=1,$i=.5,Ai=.35,Xr=2e3,Yr={aboveCharts:{base:60,span:30},aboveResources:{base:190,span:10}},W=class extends Error{constructor(r,n){super(n);this.reason=r}reason},be=(t,e)=>`${t}/${e}`;function Xt(t,e){return typeof t=="number"&&Number.isFinite(t)?Math.min(1,Math.max(0,t)):e}function zi(t,e){if(typeof t.configPanel!="string")return;let r=e?.find(n=>n.id===t.configPanel);return r&&r.type==="iframe"&&r.url&&(r.apiVersion===void 0||r.apiVersion==="1")?r.id:void 0}var Qr=(t,e)=>Math.min(Math.max(t,Si)*e,ce),en=t=>typeof t=="number"&&Number.isFinite(t)&&t>0?t:void 0,Ii=t=>Array.isArray(t)&&t.every(e=>typeof e=="string")?t:void 0,tn=class t{definitions=ve([]);settings=ve({});latest=new Map;lastLive=new Map;sinks=new Map;requestSeq=0;reducedMotion=ve(!1);backoff=ve(null);windowStart=0;windowCost=0;lastFrameCostAt=-1/0;outOfRange=ve(new Set);moving=new Set;persist=()=>{};configOpener=()=>{};now=()=>performance.now();setPersist(e){this.persist=e}setConfigOpener(e){this.configOpener=e}openConfigPanel(e){let r=this.entry(e);r?.configPanel&&this.configOpener(r)}entries=Ht(()=>{let e=this.settings(),r={aboveCharts:[],aboveResources:[]};for(let{extension:c,extensionName:p,def:f,panels:d,model:h}of this.definitions()){let g=be(c,f.id),O=f.band==="aboveResources"?"aboveResources":"aboveCharts",v=e[g];r[O].push(R(x({key:g,extension:c,extensionName:p,id:f.id,title:f.title,type:h?"data":"image"},h?{model:h}:{runtime:f.runtime}),{band:O,visible:typeof v?.visible=="boolean"?v.visible:f.visible!==!1,opacity:Xt(v?.opacity,Xt(f.opacity,1)),suspended:!1,zIndex:0,minZoom:f.minZoom,maxZoom:f.maxZoom,configPanel:zi(f,d),preferredPixelRatio:h?void 0:en(f.preferredPixelRatio),preferredLiveInterval:h?void 0:en(f.preferredLiveInterval),animated:!1,interactive:!!h&&f.interactive===!0,interactiveLayers:h?Ii(f.interactiveLayers):void 0,titleProperty:typeof f.titleProperty=="string"&&f.titleProperty?f.titleProperty:"name"}))}let n=[],i=0,a=0,o=this.reducedMotion(),s=this.outOfRange(),l=this.backoff(),u=c=>l?.key===c?l.factor:1;for(let c of["aboveCharts","aboveResources"])r[c].forEach((p,f)=>{if(p.zIndex=Yr[c].base+Math.min(f,Yr[c].span-1),p.visible&&(p.suspended=i>=ki,p.suspended||i++),p.type==="image"){let d=p.preferredLiveInterval;p.animated=d!==void 0&&d<ce&&p.visible&&!p.suspended&&!s.has(p.key)&&!o&&a<Oi,p.animated&&a++,p.liveInterval=p.animated?Qr(d,u(p.key)):Math.max(d??0,ce)}n.push(p)});return n});setReducedMotion(e){this.reducedMotion.set(e)}setInRange(e,r){let n=this.outOfRange();if(n.has(e)!==r)return;let i=new Set(n);r?i.delete(e):i.add(e),this.outOfRange.set(i)}setMoving(e,r){r?this.moving.add(e):this.moving.delete(e)}reportFrameCost(e){if(!Number.isFinite(e)||e<0)return;let r=this.entries().find(u=>u.animated);if(!r?.liveInterval)return;let n=this.now(),i=this.backoff();i?.key!==r.key?(i={key:r.key,factor:1},this.backoff.set(i),this.startWindow(n)):n-this.lastFrameCostAt>Xr&&this.startWindow(n),this.lastFrameCostAt=n,this.windowCost+=e;let a=n-this.windowStart;if(a<Xr)return;let o=this.windowCost/a;this.startWindow(n);let s=r.preferredLiveInterval,l=i.factor;if(o>$i&&r.liveInterval<ce)l*=2;else if(l>1&&o*r.liveInterval/Qr(s,l/2)<Ai)l/=2;else return;this.backoff.set({key:r.key,factor:l})}startWindow(e){this.windowStart=e,this.windowCost=0}active=Ht(()=>this.entries().filter(e=>e.visible&&!e.suspended));setDefinitions(e){this.definitions.set(e);let r=new Set(this.entries().map(n=>n.key));for(let n of[...this.latest.keys()])r.has(n)||this.latest.delete(n)}loadSettings(e){this.settings.set(x({},e??{}))}entry(e){return this.entries().find(r=>r.key===e)}list(e){return this.entries().filter(r=>r.extension===e).map(r=>x({id:r.id,title:r.title,type:r.type,band:r.band,visible:r.visible,opacity:r.opacity,suspended:r.suspended},r.model?{skippedLayers:r.model.skippedLayers()}:{}))}dataModel(e,r){if(typeof r!="string")throw new W("overlays.badRequest","`overlayId` is required");this.requireOwn(e,[r]);let n=this.entry(be(e,r))?.model;if(!n)throw new W("overlays.badRequest",`Overlay "${r}" is an image overlay, not a data overlay`);return n}requireOwn(e,r){let n=new Set(this.entries().filter(a=>a.extension===e).map(a=>a.id)),i=r.filter(a=>!n.has(a));if(i.length)throw new W("overlays.unknownId",`Unknown overlay id(s): ${i.join(", ")}`)}setVisibility(e,r){this.update(e,n=>R(x({},n),{visible:r}))}setOpacity(e,r,n=!0){this.update(e,i=>R(x({},i),{opacity:Xt(r,1)}),n)}update(e,r,n=!0){let i=x({},this.settings());for(let a of e){let o=this.entry(a);o&&(i[a]=r({visible:o.visible,opacity:o.opacity}))}this.settings.set(i),n&&this.persist(i)}newRequest(e,r,n){let i=this.entry(e);if(!i)return null;let a=R(x({overlayId:i.id,requestId:`r-${++this.requestSeq}`},r),{liveInterval:i.liveInterval??ce}),o=this.latest.get(e)?.request;return this.latest.set(e,{request:a,worldOffset:n,previousSize:o?[o.width,o.height]:void 0}),a}latestRequestsFor(e,r){return this.active().filter(n=>n.extension===e&&n.runtime===r).flatMap(n=>{let i=this.latest.get(n.key)?.request;return i?[R(x({},i),{liveInterval:n.liveInterval??ce})]:[]})}clearRequest(e){this.latest.delete(e),this.lastLive.delete(e)}registerSink(e,r){return this.sinks.set(e,r),()=>{this.sinks.get(e)===r&&this.sinks.delete(e)}}acceptFrame(e,r,n){let i=be(e,n.overlayId),a=this.entry(i);if(a?.type==="data")throw n.image.close(),new W("overlays.badRequest",`Overlay "${n.overlayId}" is a data overlay; the host draws it`);if(!a||r===null||a.runtime!==r)throw n.image.close(),new W("overlays.unknownId",`No overlay "${n.overlayId}" is drawn by this context`);let o=this.latest.get(i),s=this.sinks.get(i);if(!o||!s||!a.visible||a.suspended)return n.image.close(),{accepted:!1,reason:"overlays.superseded"};let l=n.image.width===o.request.width&&n.image.height===o.request.height,u=n.requestId===void 0&&!l&&n.image.width===o.previousSize?.[0]&&n.image.height===o.previousSize?.[1];if(n.requestId!==void 0&&n.requestId!==o.request.requestId||u)return n.image.close(),{accepted:!1,reason:"overlays.superseded"};if(!l)throw n.image.close(),new W("overlays.badRequest",`Frame is ${n.image.width}x${n.image.height}, request was ${o.request.width}x${o.request.height}`);if(n.requestId===void 0){if(this.moving.has(i))return n.image.close(),{accepted:!1,reason:"overlays.throttled"};let g=this.now(),O=this.lastLive.get(i);if(O!==void 0&&g-O<(a.liveInterval??ce))return n.image.close(),{accepted:!1,reason:"overlays.throttled"};this.lastLive.set(i,g)}let[c,p,f,d]=n.extent,h=o.worldOffset;return s({image:n.image,extent:[c+h,p,f+h,d]}),{accepted:!0}}static \u0275fac=function(r){return new(r||t)};static \u0275prov=Jr({token:t,factory:t.\u0275fac,providedIn:"root"})};var Ei=8,Mi={version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},centerAltitude:{type:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},roll:{type:"number",default:0,units:"degrees"},state:{type:"state",default:{}},light:{type:"light"},sky:{type:"sky"},projection:{type:"projection"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},Ri={"*":{type:"source"}},Pi=["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],Ti={type:{required:!0,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:!1},"*":{type:"*"}},Ci={type:{required:!0,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:!1},"*":{type:"*"}},qi={type:{required:!0,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:{},custom:{}},default:"mapbox"},redFactor:{type:"number",default:1},blueFactor:{type:"number",default:1},greenFactor:{type:"number",default:1},baseShift:{type:"number",default:0},volatile:{type:"boolean",default:!1},"*":{type:"*"}},ji={type:{required:!0,type:"enum",values:{geojson:{}}},data:{required:!0,type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},Ni={type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},Di={type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},_i={id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},"color-relief":{},background:{}},required:!0},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"}},Fi=["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_color-relief","layout_background"],Li={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Vi={"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Ui={"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Bi={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Ji={"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Hi={"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image",{"!":"icon-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,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:!0,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:!1,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:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"padding",default:[2],units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,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:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},"viewport-glyph":{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,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:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,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:!0,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:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-variable-anchor-offset":{type:"variableAnchorOffsetCollection",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"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:!1,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:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,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:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Gi={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Wi={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Ki={type:"array",value:"*"},Zi={type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},Xi={type:"enum",values:{Point:{},LineString:{},Polygon:{}}},Yi={type:"array",minimum:0,maximum:24,value:["number","color"],length:2},Qi={type:"array",value:"*",minimum:1},ea={anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},ta={"sky-color":{type:"color","property-type":"data-constant",default:"#88C6FC",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-ground-blend":{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-fog-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"sky-horizon-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"atmosphere-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},ra={source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},na={type:{type:"projectionDefinition",default:"mercator","property-type":"data-constant",transition:!1,expression:{interpolated:!0,parameters:["zoom"]}}},ia=["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_color-relief","paint_background"],aa={"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},oa={"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},sa={"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},la={"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},ua={"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},ca={"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},pa={"hillshade-illumination-direction":{type:"numberArray",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-altitude":{type:"numberArray",default:45,minimum:0,maximum:90,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"colorArray",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"colorArray",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-method":{type:"enum",values:{standard:{},basic:{},combined:{},igor:{},multidirectional:{}},default:"standard",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},fa={"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},da={duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},ya={"*":{type:"string"}},$t={$version:Ei,$root:Mi,sources:Ri,source:Pi,source_vector:Ti,source_raster:Ci,source_raster_dem:qi,source_geojson:ji,source_video:Ni,source_image:Di,layer:_i,layout:Fi,layout_background:Li,layout_fill:Vi,layout_circle:Ui,layout_heatmap:Bi,"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:Ji,layout_symbol:Hi,layout_raster:Gi,layout_hillshade:Wi,"layout_color-relief":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:Ki,filter_operator:Zi,geometry_type:Xi,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:!1}},function_stop:Yi,expression:Qi,light:ea,sky:ta,terrain:ra,projection:na,paint:ia,paint_fill:aa,"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:oa,paint_circle:sa,paint_heatmap:la,paint_symbol:ua,paint_raster:ca,paint_hillshade:pa,"paint_color-relief":{"color-relief-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"color-relief-color":{type:"color",transition:!1,expression:{interpolated:!0,parameters:["elevation"]},"property-type":"color-ramp"}},paint_background:fa,transition:da,"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:ya},ma=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function ha(t,e){let r={};for(let n in t)n!=="ref"&&(r[n]=t[n]);return ma.forEach(n=>{n in e&&(r[n]=e[n])}),r}function Gs(t){t=t.slice();let e=Object.create(null);for(let r=0;r<t.length;r++)e[t[r].id]=t[r];for(let r=0;r<t.length;r++)"ref"in t[r]&&(t[r]=ha(t[r],e[t[r].ref]));return t}var y=class{constructor(e,r,n,i){this.message=(e?`${e}: `:"")+n,i&&(this.identifier=i),r!=null&&r.__line__&&(this.line=r.__line__)}};function Oe(t,...e){for(let r of e)for(let n in r)t[n]=r[n];return t}var F=class extends Error{constructor(e,r){super(r),this.message=r,this.key=e}},sr=class t{constructor(e,r=[]){this.parent=e,this.bindings={};for(let[n,i]of r)this.bindings[n]=i}concat(e){return new t(this,e)}get(e){if(this.bindings[e])return this.bindings[e];if(this.parent)return this.parent.get(e);throw new Error(`${e} not found in scope.`)}has(e){return this.bindings[e]?!0:this.parent?this.parent.has(e):!1}},At={kind:"null"},m={kind:"number"},k={kind:"string"},w={kind:"boolean"},K={kind:"color"},zt={kind:"projectionDefinition"},de={kind:"object"},b={kind:"value"},ga={kind:"error"},It={kind:"collator"},Et={kind:"formatted"},Mt={kind:"padding"},qe={kind:"colorArray"},Rt={kind:"numberArray"},Ze={kind:"resolvedImage"},Pt={kind:"variableAnchorOffsetCollection"};function D(t,e){return{kind:"array",itemType:t,N:e}}function I(t){if(t.kind==="array"){let e=I(t.itemType);return typeof t.N=="number"?`array<${e}, ${t.N}>`:t.itemType.kind==="value"?"array":`array<${e}>`}else return t.kind}var va=[At,m,k,w,K,zt,Et,de,D(b),Mt,Rt,qe,Ze,Pt];function je(t,e){if(e.kind==="error")return null;if(t.kind==="array"){if(e.kind==="array"&&(e.N===0&&e.itemType.kind==="value"||!je(t.itemType,e.itemType))&&(typeof t.N!="number"||t.N===e.N))return null}else{if(t.kind===e.kind)return null;if(t.kind==="value"){for(let r of va)if(!je(r,e))return null}}return`Expected ${I(t)} but found ${I(e)} instead.`}function Ar(t,e){return e.some(r=>r.kind===t.kind)}function ye(t,e){return e.some(r=>r==="null"?t===null:r==="array"?Array.isArray(t):r==="object"?t&&!Array.isArray(t)&&typeof t=="object":r===typeof t)}function ne(t,e){return t.kind==="array"&&e.kind==="array"?t.itemType.kind===e.itemType.kind&&typeof t.N=="number":t.kind===e.kind}var On=.96422,$n=1,An=.82521,zn=4/29,ke=6/29,In=3*ke*ke,ba=ke*ke*ke,wa=Math.PI/180,xa=180/Math.PI;function En(t){return t=t%360,t<0&&(t+=360),t}function Mn([t,e,r,n]){t=Yt(t),e=Yt(e),r=Yt(r);let i,a,o=Qt((.2225045*t+.7168786*e+.0606169*r)/$n);t===e&&e===r?i=a=o:(i=Qt((.4360747*t+.3850649*e+.1430804*r)/On),a=Qt((.0139322*t+.0971045*e+.7141733*r)/An));let s=116*o-16;return[s<0?0:s,500*(i-o),200*(o-a),n]}function Yt(t){return t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Qt(t){return t>ba?Math.pow(t,1/3):t/In+zn}function Rn([t,e,r,n]){let i=(t+16)/116,a=isNaN(e)?i:i+e/500,o=isNaN(r)?i:i-r/200;return i=$n*tr(i),a=On*tr(a),o=An*tr(o),[er(3.1338561*a-1.6168667*i-.4906146*o),er(-.9787684*a+1.9161415*i+.033454*o),er(.0719453*a-.2289914*i+1.4052427*o),n]}function er(t){return t=t<=.00304?12.92*t:1.055*Math.pow(t,1/2.4)-.055,t<0?0:t>1?1:t}function tr(t){return t>ke?t*t*t:In*(t-zn)}function ka(t){let[e,r,n,i]=Mn(t),a=Math.sqrt(r*r+n*n);return[Math.round(a*1e4)?En(Math.atan2(n,r)*xa):NaN,a,e,i]}function Sa([t,e,r,n]){return t=isNaN(t)?0:t*wa,Rn([r,Math.cos(t)*e,Math.sin(t)*e,n])}function Oa([t,e,r,n]){t=En(t),e/=100,r/=100;function i(a){let o=(a+t/30)%12,s=e*Math.min(r,1-r);return r-s*Math.max(-1,Math.min(o-3,9-o,1))}return[i(0),i(8),i(4),n]}var $a=Object.hasOwn||function(e,r){return Object.prototype.hasOwnProperty.call(e,r)};function Te(t,e){return $a(t,e)?t[e]:void 0}function Aa(t){if(t=t.toLowerCase().trim(),t==="transparent")return[0,0,0,0];let e=Te(za,t);if(e){let[i,a,o]=e;return[i/255,a/255,o/255,1]}if(t.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(t)){let a=t.length<6?1:2,o=1;return[nt(t.slice(o,o+=a)),nt(t.slice(o,o+=a)),nt(t.slice(o,o+=a)),nt(t.slice(o,o+a)||"ff")]}if(t.startsWith("rgb")){let i=/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/,a=t.match(i);if(a){let[o,s,l,u,c,p,f,d,h,g,O,v]=a,A=[u||" ",f||" ",g].join("");if(A===" "||A===" /"||A===",,"||A===",,,"){let j=[l,p,h].join(""),ue=j==="%%%"?100:j===""?255:0;if(ue){let Br=[we(+s/ue,0,1),we(+c/ue,0,1),we(+d/ue,0,1),O?rn(+O,v):1];if(nn(Br))return Br}}return}}let r=/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/,n=t.match(r);if(n){let[i,a,o,s,l,u,c,p,f]=n,d=[o||" ",l||" ",c].join("");if(d===" "||d===" /"||d===",,"||d===",,,"){let h=[+a,we(+s,0,100),we(+u,0,100),p?rn(+p,f):1];if(nn(h))return Oa(h)}}}function nt(t){return parseInt(t.padEnd(2,t),16)/255}function rn(t,e){return we(e?t/100:t,0,1)}function we(t,e,r){return Math.min(Math.max(e,t),r)}function nn(t){return!t.some(Number.isNaN)}var za={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};function ae(t,e,r){return t+r*(e-t)}function $e(t,e,r){return t.map((n,i)=>ae(n,e[i],r))}function Ia(t){return t==="rgb"||t==="hcl"||t==="lab"}var $=class t{constructor(e,r,n,i=1,a=!0){this.r=e,this.g=r,this.b=n,this.a=i,a||(this.r*=i,this.g*=i,this.b*=i,i||this.overwriteGetter("rgb",[e,r,n,i]))}static parse(e){if(e instanceof t)return e;if(typeof e!="string")return;let r=Aa(e);if(r)return new t(...r,!1)}get rgb(){let{r:e,g:r,b:n,a:i}=this,a=i||1/0;return this.overwriteGetter("rgb",[e/a,r/a,n/a,i])}get hcl(){return this.overwriteGetter("hcl",ka(this.rgb))}get lab(){return this.overwriteGetter("lab",Mn(this.rgb))}overwriteGetter(e,r){return Object.defineProperty(this,e,{value:r}),r}toString(){let[e,r,n,i]=this.rgb;return`rgba(${[e,r,n].map(a=>Math.round(a*255)).join(",")},${i})`}static interpolate(e,r,n,i="rgb"){switch(i){case"rgb":{let[a,o,s,l]=$e(e.rgb,r.rgb,n);return new t(a,o,s,l,!1)}case"hcl":{let[a,o,s,l]=e.hcl,[u,c,p,f]=r.hcl,d,h;if(!isNaN(a)&&!isNaN(u)){let j=u-a;u>a&&j>180?j-=360:u<a&&a-u>180&&(j+=360),d=a+n*j}else isNaN(a)?isNaN(u)?d=NaN:(d=u,(s===1||s===0)&&(h=c)):(d=a,(p===1||p===0)&&(h=o));let[g,O,v,A]=Sa([d,h??ae(o,c,n),ae(s,p,n),ae(l,f,n)]);return new t(g,O,v,A,!1)}case"lab":{let[a,o,s,l]=Rn($e(e.lab,r.lab,n));return new t(a,o,s,l,!1)}}}};$.black=new $(0,0,0,1);$.white=new $(1,1,1,1);$.transparent=new $(0,0,0,0);$.red=new $(1,0,0,1);var Ne=class{constructor(e,r,n){e?this.sensitivity=r?"variant":"case":this.sensitivity=r?"accent":"base",this.locale=n,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(e,r){return this.collator.compare(e,r)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}},Ea=["bottom","center","top"],De=class{constructor(e,r,n,i,a,o){this.text=e,this.image=r,this.scale=n,this.fontStack=i,this.textColor=a,this.verticalAlign=o}},oe=class t{constructor(e){this.sections=e}static fromString(e){return new t([new De(e,null,null,null,null,null)])}isEmpty(){return this.sections.length===0?!0:!this.sections.some(e=>e.text.length!==0||e.image&&e.image.name.length!==0)}static factory(e){return e instanceof t?e:t.fromString(e)}toString(){return this.sections.length===0?"":this.sections.map(e=>e.text).join("")}},V=class t{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof t)return e;if(typeof e=="number")return new t([e,e,e,e]);if(Array.isArray(e)&&!(e.length<1||e.length>4)){for(let r of e)if(typeof r!="number")return;switch(e.length){case 1:e=[e[0],e[0],e[0],e[0]];break;case 2:e=[e[0],e[1],e[0],e[1]];break;case 3:e=[e[0],e[1],e[2],e[1]];break}return new t(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,r,n){return new t($e(e.values,r.values,n))}},U=class t{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof t)return e;if(typeof e=="number")return new t([e]);if(Array.isArray(e)){for(let r of e)if(typeof r!="number")return;return new t(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,r,n){return new t($e(e.values,r.values,n))}},N=class t{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof t)return e;if(typeof e=="string"){let n=$.parse(e);return n?new t([n]):void 0}if(!Array.isArray(e))return;let r=[];for(let n of e){if(typeof n!="string")return;let i=$.parse(n);if(!i)return;r.push(i)}return new t(r)}toString(){return JSON.stringify(this.values)}static interpolate(e,r,n,i="rgb"){let a=[];if(e.values.length!=r.values.length)throw new Error(`colorArray: Arrays have mismatched length (${e.values.length} vs. ${r.values.length}), cannot interpolate.`);for(let o=0;o<e.values.length;o++)a.push($.interpolate(e.values[o],r.values[o],n,i));return new t(a)}},z=class extends Error{constructor(e){super(e),this.name="RuntimeError"}toJSON(){return this.message}},Ma=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]),X=class t{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof t)return e;if(!(!Array.isArray(e)||e.length<1||e.length%2!==0)){for(let r=0;r<e.length;r+=2){let n=e[r],i=e[r+1];if(typeof n!="string"||!Ma.has(n)||!Array.isArray(i)||i.length!==2||typeof i[0]!="number"||typeof i[1]!="number")return}return new t(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,r,n){let i=e.values,a=r.values;if(i.length!==a.length)throw new z(`Cannot interpolate values of different length. from: ${e.toString()}, to: ${r.toString()}`);let o=[];for(let s=0;s<i.length;s+=2){if(i[s]!==a[s])throw new z(`Cannot interpolate values containing mismatched anchors. from[${s}]: ${i[s]}, to[${s}]: ${a[s]}`);o.push(i[s]);let[l,u]=i[s+1],[c,p]=a[s+1];o.push([ae(l,c,n),ae(u,p,n)])}return new t(o)}},Q=class t{constructor(e){this.name=e.name,this.available=e.available}toString(){return this.name}static fromString(e){return e?new t({name:e,available:!1}):null}},se=class t{constructor(e,r,n){this.from=e,this.to=r,this.transition=n}static interpolate(e,r,n){return new t(e,r,n)}static parse(e){if(e instanceof t)return e;if(Array.isArray(e)&&e.length===3&&typeof e[0]=="string"&&typeof e[1]=="string"&&typeof e[2]=="number")return new t(e[0],e[1],e[2]);if(typeof e=="object"&&typeof e.from=="string"&&typeof e.to=="string"&&typeof e.transition=="number")return new t(e.from,e.to,e.transition);if(typeof e=="string")return new t(e,e,1)}};function Pn(t,e,r,n){return typeof t=="number"&&t>=0&&t<=255&&typeof e=="number"&&e>=0&&e<=255&&typeof r=="number"&&r>=0&&r<=255?typeof n>"u"||typeof n=="number"&&n>=0&&n<=1?null:`Invalid rgba value [${[t,e,r,n].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof n=="number"?[t,e,r,n]:[t,e,r]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function _e(t){if(t===null||typeof t=="string"||typeof t=="boolean"||typeof t=="number"||t instanceof se||t instanceof $||t instanceof Ne||t instanceof oe||t instanceof V||t instanceof U||t instanceof N||t instanceof X||t instanceof Q)return!0;if(Array.isArray(t)){for(let e of t)if(!_e(e))return!1;return!0}else if(typeof t=="object"){for(let e in t)if(!_e(t[e]))return!1;return!0}else return!1}function M(t){if(t===null)return At;if(typeof t=="string")return k;if(typeof t=="boolean")return w;if(typeof t=="number")return m;if(t instanceof $)return K;if(t instanceof se)return zt;if(t instanceof Ne)return It;if(t instanceof oe)return Et;if(t instanceof V)return Mt;if(t instanceof U)return Rt;if(t instanceof N)return qe;if(t instanceof X)return Pt;if(t instanceof Q)return Ze;if(Array.isArray(t)){let e=t.length,r;for(let n of t){let i=M(n);if(!r)r=i;else{if(r===i)continue;r=b;break}}return D(r||b,e)}else return de}function Ce(t){let e=typeof t;return t===null?"":e==="string"||e==="number"||e==="boolean"?String(t):t instanceof $||t instanceof se||t instanceof oe||t instanceof V||t instanceof U||t instanceof N||t instanceof X||t instanceof Q?t.toString():JSON.stringify(t)}var Ae=class t{constructor(e,r){this.type=e,this.value=r}static parse(e,r){if(e.length!==2)return r.error(`'literal' expression requires exactly one argument, but found ${e.length-1} instead.`);if(!_e(e[1]))return r.error("invalid value");let n=e[1],i=M(n),a=r.expectedType;return i.kind==="array"&&i.N===0&&a&&a.kind==="array"&&(typeof a.N!="number"||a.N===0)&&(i=a),new t(i,n)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}},it={string:k,number:m,boolean:w,object:de},B=class t{constructor(e,r){this.type=e,this.args=r}static parse(e,r){if(e.length<2)return r.error("Expected at least one argument.");let n=1,i,a=e[0];if(a==="array"){let s;if(e.length>2){let u=e[1];if(typeof u!="string"||!(u in it)||u==="object")return r.error('The item type argument of "array" must be one of string, number, boolean',1);s=it[u],n++}else s=b;let l;if(e.length>3){if(e[2]!==null&&(typeof e[2]!="number"||e[2]<0||e[2]!==Math.floor(e[2])))return r.error('The length argument to "array" must be a positive integer literal',2);l=e[2],n++}i=D(s,l)}else{if(!it[a])throw new Error(`Types doesn't contain name = ${a}`);i=it[a]}let o=[];for(;n<e.length;n++){let s=r.parse(e[n],n,b);if(!s)return null;o.push(s)}return new t(i,o)}evaluate(e){for(let r=0;r<this.args.length;r++){let n=this.args[r].evaluate(e);if(je(this.type,M(n))){if(r===this.args.length-1)throw new z(`Expected value to be of type ${I(this.type)}, but found ${I(M(n))} instead.`)}else return n}throw new Error}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}},an={"to-boolean":w,"to-color":K,"to-number":m,"to-string":k},ie=class t{constructor(e,r){this.type=e,this.args=r}static parse(e,r){if(e.length<2)return r.error("Expected at least one argument.");let n=e[0];if(!an[n])throw new Error(`Can't parse ${n} as it is not part of the known types`);if((n==="to-boolean"||n==="to-string")&&e.length!==2)return r.error("Expected one argument.");let i=an[n],a=[];for(let o=1;o<e.length;o++){let s=r.parse(e[o],o,b);if(!s)return null;a.push(s)}return new t(i,a)}evaluate(e){switch(this.type.kind){case"boolean":return!!this.args[0].evaluate(e);case"color":{let r,n;for(let i of this.args){if(r=i.evaluate(e),n=null,r instanceof $)return r;if(typeof r=="string"){let a=e.parseColor(r);if(a)return a}else if(Array.isArray(r)&&(r.length<3||r.length>4?n=`Invalid rgba value ${JSON.stringify(r)}: expected an array containing either three or four numeric values.`:n=Pn(r[0],r[1],r[2],r[3]),!n))return new $(r[0]/255,r[1]/255,r[2]/255,r[3])}throw new z(n||`Could not parse color from value '${typeof r=="string"?r:JSON.stringify(r)}'`)}case"padding":{let r;for(let n of this.args){r=n.evaluate(e);let i=V.parse(r);if(i)return i}throw new z(`Could not parse padding from value '${typeof r=="string"?r:JSON.stringify(r)}'`)}case"numberArray":{let r;for(let n of this.args){r=n.evaluate(e);let i=U.parse(r);if(i)return i}throw new z(`Could not parse numberArray from value '${typeof r=="string"?r:JSON.stringify(r)}'`)}case"colorArray":{let r;for(let n of this.args){r=n.evaluate(e);let i=N.parse(r);if(i)return i}throw new z(`Could not parse colorArray from value '${typeof r=="string"?r:JSON.stringify(r)}'`)}case"variableAnchorOffsetCollection":{let r;for(let n of this.args){r=n.evaluate(e);let i=X.parse(r);if(i)return i}throw new z(`Could not parse variableAnchorOffsetCollection from value '${typeof r=="string"?r:JSON.stringify(r)}'`)}case"number":{let r=null;for(let n of this.args){if(r=n.evaluate(e),r===null)return 0;let i=Number(r);if(!isNaN(i))return i}throw new z(`Could not convert ${JSON.stringify(r)} to number.`)}case"formatted":return oe.fromString(Ce(this.args[0].evaluate(e)));case"resolvedImage":return Q.fromString(Ce(this.args[0].evaluate(e)));case"projectionDefinition":return this.args[0].evaluate(e);default:return Ce(this.args[0].evaluate(e))}}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}},Ra=["Unknown","Point","LineString","Polygon"],lt=class{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache=new Map,this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?typeof this.feature.type=="number"?Ra[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||{}}parseColor(e){let r=this._parseColorCache.get(e);return r||(r=$.parse(e),this._parseColorCache.set(e,r)),r}},ut=class t{constructor(e,r,n=[],i,a=new sr,o=[]){this.registry=e,this.path=n,this.key=n.map(s=>`[${s}]`).join(""),this.scope=a,this.errors=o,this.expectedType=i,this._isConstant=r}parse(e,r,n,i,a={}){return r?this.concat(r,n,i)._parse(e,a):this._parse(e,a)}_parse(e,r){(e===null||typeof e=="string"||typeof e=="boolean"||typeof e=="number")&&(e=["literal",e]);function n(i,a,o){return o==="assert"?new B(a,[i]):o==="coerce"?new ie(a,[i]):i}if(Array.isArray(e)){if(e.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');let i=e[0];if(typeof i!="string")return this.error(`Expression name must be a string, but found ${typeof i} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;let a=this.registry[i];if(a){let o=a.parse(e,this);if(!o)return null;if(this.expectedType){let s=this.expectedType,l=o.type;if((s.kind==="string"||s.kind==="number"||s.kind==="boolean"||s.kind==="object"||s.kind==="array")&&l.kind==="value")o=n(o,s,r.typeAnnotation||"assert");else if(s.kind==="projectionDefinition"&&["string","array"].includes(l.kind)||["color","formatted","resolvedImage"].includes(s.kind)&&["value","string"].includes(l.kind)||["padding","numberArray"].includes(s.kind)&&["value","number","array"].includes(l.kind)||s.kind==="colorArray"&&["value","string","array"].includes(l.kind)||s.kind==="variableAnchorOffsetCollection"&&["value","array"].includes(l.kind))o=n(o,s,r.typeAnnotation||"coerce");else if(this.checkSubtype(s,l))return null}if(!(o instanceof Ae)&&o.type.kind!=="resolvedImage"&&this._isConstant(o)){let s=new lt;try{o=new Ae(o.type,o.evaluate(s))}catch(l){return this.error(l.message),null}}return o}return this.error(`Unknown expression "${i}". If you wanted a literal array, use ["literal", [...]].`,0)}else return typeof e>"u"?this.error("'undefined' value invalid. Use null instead."):typeof e=="object"?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error(`Expected an array, but found ${typeof e} instead.`)}concat(e,r,n){let i=typeof e=="number"?this.path.concat(e):this.path,a=n?this.scope.concat(n):this.scope;return new t(this.registry,this._isConstant,i,r||null,a,this.errors)}error(e,...r){let n=`${this.key}${r.map(i=>`[${i}]`).join("")}`;this.errors.push(new F(n,e))}checkSubtype(e,r){let n=je(e,r);return n&&this.error(n),n}},ct=class t{constructor(e,r){this.type=r.type,this.bindings=[].concat(e),this.result=r}evaluate(e){return this.result.evaluate(e)}eachChild(e){for(let r of this.bindings)e(r[1]);e(this.result)}static parse(e,r){if(e.length<4)return r.error(`Expected at least 3 arguments, but found ${e.length-1} instead.`);let n=[];for(let a=1;a<e.length-1;a+=2){let o=e[a];if(typeof o!="string")return r.error(`Expected string, but found ${typeof o} instead.`,a);if(/[^a-zA-Z0-9_]/.test(o))return r.error("Variable names must contain only alphanumeric characters or '_'.",a);let s=r.parse(e[a+1],a+1);if(!s)return null;n.push([o,s])}let i=r.parse(e[e.length-1],e.length-1,r.expectedType,n);return i?new t(n,i):null}outputDefined(){return this.result.outputDefined()}},pt=class t{constructor(e,r){this.type=r.type,this.name=e,this.boundExpression=r}static parse(e,r){if(e.length!==2||typeof e[1]!="string")return r.error("'var' expression requires exactly one string literal argument.");let n=e[1];return r.scope.has(n)?new t(n,r.scope.get(n)):r.error(`Unknown variable "${n}". Make sure "${n}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(e){return this.boundExpression.evaluate(e)}eachChild(){}outputDefined(){return!1}},lr=class t{constructor(e,r,n){this.type=e,this.index=r,this.input=n}static parse(e,r){if(e.length!==3)return r.error(`Expected 2 arguments, but found ${e.length-1} instead.`);let n=r.parse(e[1],1,m),i=r.parse(e[2],2,D(r.expectedType||b));if(!n||!i)return null;let a=i.type;return new t(a.itemType,n,i)}evaluate(e){let r=this.index.evaluate(e),n=this.input.evaluate(e);if(r<0)throw new z(`Array index out of bounds: ${r} < 0.`);if(r>=n.length)throw new z(`Array index out of bounds: ${r} > ${n.length-1}.`);if(r!==Math.floor(r))throw new z(`Array index must be an integer, but found ${r} instead.`);return n[r]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}},ur=class t{constructor(e,r){this.type=w,this.needle=e,this.haystack=r}static parse(e,r){if(e.length!==3)return r.error(`Expected 2 arguments, but found ${e.length-1} instead.`);let n=r.parse(e[1],1,b),i=r.parse(e[2],2,b);return!n||!i?null:Ar(n.type,[w,k,m,At,b])?new t(n,i):r.error(`Expected first argument to be of type boolean, string, number or null, but found ${I(n.type)} instead`)}evaluate(e){let r=this.needle.evaluate(e),n=this.haystack.evaluate(e);if(!n)return!1;if(!ye(r,["boolean","string","number","null"]))throw new z(`Expected first argument to be of type boolean, string, number or null, but found ${I(M(r))} instead.`);if(!ye(n,["string","array"]))throw new z(`Expected second argument to be of type array or string, but found ${I(M(n))} instead.`);return n.indexOf(r)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}},cr=class t{constructor(e,r,n){this.type=m,this.needle=e,this.haystack=r,this.fromIndex=n}static parse(e,r){if(e.length<=2||e.length>=5)return r.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);let n=r.parse(e[1],1,b),i=r.parse(e[2],2,b);if(!n||!i)return null;if(!Ar(n.type,[w,k,m,At,b]))return r.error(`Expected first argument to be of type boolean, string, number or null, but found ${I(n.type)} instead`);if(e.length===4){let a=r.parse(e[3],3,m);return a?new t(n,i,a):null}else return new t(n,i)}evaluate(e){let r=this.needle.evaluate(e),n=this.haystack.evaluate(e);if(!ye(r,["boolean","string","number","null"]))throw new z(`Expected first argument to be of type boolean, string, number or null, but found ${I(M(r))} instead.`);let i;if(this.fromIndex&&(i=this.fromIndex.evaluate(e)),ye(n,["string"])){let a=n.indexOf(r,i);return a===-1?-1:[...n.slice(0,a)].length}else{if(ye(n,["array"]))return n.indexOf(r,i);throw new z(`Expected second argument to be of type array or string, but found ${I(M(n))} instead.`)}}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}},pr=class t{constructor(e,r,n,i,a,o){this.inputType=e,this.type=r,this.input=n,this.cases=i,this.outputs=a,this.otherwise=o}static parse(e,r){if(e.length<5)return r.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if(e.length%2!==1)return r.error("Expected an even number of arguments.");let n,i;r.expectedType&&r.expectedType.kind!=="value"&&(i=r.expectedType);let a={},o=[];for(let u=2;u<e.length-1;u+=2){let c=e[u],p=e[u+1];Array.isArray(c)||(c=[c]);let f=r.concat(u);if(c.length===0)return f.error("Expected at least one branch label.");for(let h of c){if(typeof h!="number"&&typeof h!="string")return f.error("Branch labels must be numbers or strings.");if(typeof h=="number"&&Math.abs(h)>Number.MAX_SAFE_INTEGER)return f.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof h=="number"&&Math.floor(h)!==h)return f.error("Numeric branch labels must be integer values.");if(!n)n=M(h);else if(f.checkSubtype(n,M(h)))return null;if(typeof a[String(h)]<"u")return f.error("Branch labels must be unique.");a[String(h)]=o.length}let d=r.parse(p,u,i);if(!d)return null;i=i||d.type,o.push(d)}let s=r.parse(e[1],1,b);if(!s)return null;let l=r.parse(e[e.length-1],e.length-1,i);return!l||s.type.kind!=="value"&&r.concat(1).checkSubtype(n,s.type)?null:new t(n,i,s,a,o,l)}evaluate(e){let r=this.input.evaluate(e);return(M(r)===this.inputType&&this.outputs[this.cases[r]]||this.otherwise).evaluate(e)}eachChild(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)}outputDefined(){return this.outputs.every(e=>e.outputDefined())&&this.otherwise.outputDefined()}},fr=class t{constructor(e,r,n){this.type=e,this.branches=r,this.otherwise=n}static parse(e,r){if(e.length<4)return r.error(`Expected at least 3 arguments, but found only ${e.length-1}.`);if(e.length%2!==0)return r.error("Expected an odd number of arguments.");let n;r.expectedType&&r.expectedType.kind!=="value"&&(n=r.expectedType);let i=[];for(let o=1;o<e.length-1;o+=2){let s=r.parse(e[o],o,w);if(!s)return null;let l=r.parse(e[o+1],o+1,n);if(!l)return null;i.push([s,l]),n=n||l.type}let a=r.parse(e[e.length-1],e.length-1,n);if(!a)return null;if(!n)throw new Error("Can't infer output type");return new t(n,i,a)}evaluate(e){for(let[r,n]of this.branches)if(r.evaluate(e))return n.evaluate(e);return this.otherwise.evaluate(e)}eachChild(e){for(let[r,n]of this.branches)e(r),e(n);e(this.otherwise)}outputDefined(){return this.branches.every(([e,r])=>r.outputDefined())&&this.otherwise.outputDefined()}},dr=class t{constructor(e,r,n,i){this.type=e,this.input=r,this.beginIndex=n,this.endIndex=i}static parse(e,r){if(e.length<=2||e.length>=5)return r.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);let n=r.parse(e[1],1,b),i=r.parse(e[2],2,m);if(!n||!i)return null;if(!Ar(n.type,[D(b),k,b]))return r.error(`Expected first argument to be of type array or string, but found ${I(n.type)} instead`);if(e.length===4){let a=r.parse(e[3],3,m);return a?new t(n.type,n,i,a):null}else return new t(n.type,n,i)}evaluate(e){let r=this.input.evaluate(e),n=this.beginIndex.evaluate(e),i;if(this.endIndex&&(i=this.endIndex.evaluate(e)),ye(r,["string"]))return[...r].slice(n,i).join("");if(ye(r,["array"]))return r.slice(n,i);throw new z(`Expected first argument to be of type array or string, but found ${I(M(r))} instead.`)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}};function Tt(t,e){let r=t.length-1,n=0,i=r,a=0,o,s;for(;n<=i;)if(a=Math.floor((n+i)/2),o=t[a],s=t[a+1],o<=e){if(a===r||e<s)return a;n=a+1}else if(o>e)i=a-1;else throw new z("Input is not a number.");return 0}var ft=class t{constructor(e,r,n){this.type=e,this.input=r,this.labels=[],this.outputs=[];for(let[i,a]of n)this.labels.push(i),this.outputs.push(a)}static parse(e,r){if(e.length-1<4)return r.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!==0)return r.error("Expected an even number of arguments.");let n=r.parse(e[1],1,m);if(!n)return null;let i=[],a=null;r.expectedType&&r.expectedType.kind!=="value"&&(a=r.expectedType);for(let o=1;o<e.length;o+=2){let s=o===1?-1/0:e[o],l=e[o+1],u=o,c=o+1;if(typeof s!="number")return r.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',u);if(i.length&&i[i.length-1][0]>=s)return r.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',u);let p=r.parse(l,c,a);if(!p)return null;a=a||p.type,i.push([s,p])}return new t(a,n,i)}evaluate(e){let r=this.labels,n=this.outputs;if(r.length===1)return n[0].evaluate(e);let i=this.input.evaluate(e);if(i<=r[0])return n[0].evaluate(e);let a=r.length;if(i>=r[a-1])return n[a-1].evaluate(e);let o=Tt(r,i);return n[o].evaluate(e)}eachChild(e){e(this.input);for(let r of this.outputs)e(r)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}};function Pa(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var rr,on;function Ta(){if(on)return rr;on=1,rr=t;function t(e,r,n,i){this.cx=3*e,this.bx=3*(n-e)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*r,this.by=3*(i-r)-this.cy,this.ay=1-this.cy-this.by,this.p1x=e,this.p1y=r,this.p2x=n,this.p2y=i}return t.prototype={sampleCurveX:function(e){return((this.ax*e+this.bx)*e+this.cx)*e},sampleCurveY:function(e){return((this.ay*e+this.by)*e+this.cy)*e},sampleCurveDerivativeX:function(e){return(3*this.ax*e+2*this.bx)*e+this.cx},solveCurveX:function(e,r){if(r===void 0&&(r=1e-6),e<0)return 0;if(e>1)return 1;for(var n=e,i=0;i<8;i++){var a=this.sampleCurveX(n)-e;if(Math.abs(a)<r)return n;var o=this.sampleCurveDerivativeX(n);if(Math.abs(o)<1e-6)break;n=n-a/o}var s=0,l=1;for(n=e,i=0;i<20&&(a=this.sampleCurveX(n),!(Math.abs(a-e)<r));i++)e>a?s=n:l=n,n=(l-s)*.5+s;return n},solve:function(e,r){return this.sampleCurveY(this.solveCurveX(e,r))}},rr}var Ca=Ta(),qa=Pa(Ca),J=class t{constructor(e,r,n,i,a){this.type=e,this.operator=r,this.interpolation=n,this.input=i,this.labels=[],this.outputs=[];for(let[o,s]of a)this.labels.push(o),this.outputs.push(s)}static interpolationFactor(e,r,n,i){let a=0;if(e.name==="exponential")a=nr(r,e.base,n,i);else if(e.name==="linear")a=nr(r,1,n,i);else if(e.name==="cubic-bezier"){let o=e.controlPoints;a=new qa(o[0],o[1],o[2],o[3]).solve(nr(r,1,n,i))}return a}static parse(e,r){let[n,i,a,...o]=e;if(!Array.isArray(i)||i.length===0)return r.error("Expected an interpolation type expression.",1);if(i[0]==="linear")i={name:"linear"};else if(i[0]==="exponential"){let u=i[1];if(typeof u!="number")return r.error("Exponential interpolation requires a numeric base.",1,1);i={name:"exponential",base:u}}else if(i[0]==="cubic-bezier"){let u=i.slice(1);if(u.length!==4||u.some(c=>typeof c!="number"||c<0||c>1))return r.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);i={name:"cubic-bezier",controlPoints:u}}else return r.error(`Unknown interpolation type ${String(i[0])}`,1,0);if(e.length-1<4)return r.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!==0)return r.error("Expected an even number of arguments.");if(a=r.parse(a,2,m),!a)return null;let s=[],l=null;(n==="interpolate-hcl"||n==="interpolate-lab")&&r.expectedType!=qe?l=K:r.expectedType&&r.expectedType.kind!=="value"&&(l=r.expectedType);for(let u=0;u<o.length;u+=2){let c=o[u],p=o[u+1],f=u+3,d=u+4;if(typeof c!="number")return r.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',f);if(s.length&&s[s.length-1][0]>=c)return r.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',f);let h=r.parse(p,d,l);if(!h)return null;l=l||h.type,s.push([c,h])}return!ne(l,m)&&!ne(l,zt)&&!ne(l,K)&&!ne(l,Mt)&&!ne(l,Rt)&&!ne(l,qe)&&!ne(l,Pt)&&!ne(l,D(m))?r.error(`Type ${I(l)} is not interpolatable.`):new t(l,n,i,a,s)}evaluate(e){let r=this.labels,n=this.outputs;if(r.length===1)return n[0].evaluate(e);let i=this.input.evaluate(e);if(i<=r[0])return n[0].evaluate(e);let a=r.length;if(i>=r[a-1])return n[a-1].evaluate(e);let o=Tt(r,i),s=r[o],l=r[o+1],u=t.interpolationFactor(this.interpolation,i,s,l),c=n[o].evaluate(e),p=n[o+1].evaluate(e);switch(this.operator){case"interpolate":switch(this.type.kind){case"number":return ae(c,p,u);case"color":return $.interpolate(c,p,u);case"padding":return V.interpolate(c,p,u);case"colorArray":return N.interpolate(c,p,u);case"numberArray":return U.interpolate(c,p,u);case"variableAnchorOffsetCollection":return X.interpolate(c,p,u);case"array":return $e(c,p,u);case"projectionDefinition":return se.interpolate(c,p,u)}case"interpolate-hcl":switch(this.type.kind){case"color":return $.interpolate(c,p,u,"hcl");case"colorArray":return N.interpolate(c,p,u,"hcl")}case"interpolate-lab":switch(this.type.kind){case"color":return $.interpolate(c,p,u,"lab");case"colorArray":return N.interpolate(c,p,u,"lab")}}}eachChild(e){e(this.input);for(let r of this.outputs)e(r)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}};function nr(t,e,r,n){let i=n-r,a=t-r;return i===0?0:e===1?a/i:(Math.pow(e,a)-1)/(Math.pow(e,i)-1)}var ja={color:$.interpolate,number:ae,padding:V.interpolate,numberArray:U.interpolate,colorArray:N.interpolate,variableAnchorOffsetCollection:X.interpolate,array:$e},dt=class t{constructor(e,r){this.type=e,this.args=r}static parse(e,r){if(e.length<2)return r.error("Expected at least one argument.");let n=null,i=r.expectedType;i&&i.kind!=="value"&&(n=i);let a=[];for(let s of e.slice(1)){let l=r.parse(s,1+a.length,n,void 0,{typeAnnotation:"omit"});if(!l)return null;n=n||l.type,a.push(l)}if(!n)throw new Error("No output type");return i&&a.some(s=>je(i,s.type))?new t(b,a):new t(n,a)}evaluate(e){let r=null,n=0,i;for(let a of this.args)if(n++,r=a.evaluate(e),r&&r instanceof Q&&!r.available&&(i||(i=r.name),r=null,n===this.args.length&&(r=i)),r!==null)break;return r}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}};function sn(t,e){return t==="=="||t==="!="?e.kind==="boolean"||e.kind==="string"||e.kind==="number"||e.kind==="null"||e.kind==="value":e.kind==="string"||e.kind==="number"||e.kind==="value"}function Na(t,e,r){return e===r}function Da(t,e,r){return e!==r}function _a(t,e,r){return e<r}function Fa(t,e,r){return e>r}function La(t,e,r){return e<=r}function Va(t,e,r){return e>=r}function Tn(t,e,r,n){return n.compare(e,r)===0}function Ua(t,e,r,n){return!Tn(t,e,r,n)}function Ba(t,e,r,n){return n.compare(e,r)<0}function Ja(t,e,r,n){return n.compare(e,r)>0}function Ha(t,e,r,n){return n.compare(e,r)<=0}function Ga(t,e,r,n){return n.compare(e,r)>=0}function Ie(t,e,r){let n=t!=="=="&&t!=="!=";return class Cn{constructor(a,o,s){this.type=w,this.lhs=a,this.rhs=o,this.collator=s,this.hasUntypedArgument=a.type.kind==="value"||o.type.kind==="value"}static parse(a,o){if(a.length!==3&&a.length!==4)return o.error("Expected two or three arguments.");let s=a[0],l=o.parse(a[1],1,b);if(!l)return null;if(!sn(s,l.type))return o.concat(1).error(`"${s}" comparisons are not supported for type '${I(l.type)}'.`);let u=o.parse(a[2],2,b);if(!u)return null;if(!sn(s,u.type))return o.concat(2).error(`"${s}" comparisons are not supported for type '${I(u.type)}'.`);if(l.type.kind!==u.type.kind&&l.type.kind!=="value"&&u.type.kind!=="value")return o.error(`Cannot compare types '${I(l.type)}' and '${I(u.type)}'.`);n&&(l.type.kind==="value"&&u.type.kind!=="value"?l=new B(u.type,[l]):l.type.kind!=="value"&&u.type.kind==="value"&&(u=new B(l.type,[u])));let c=null;if(a.length===4){if(l.type.kind!=="string"&&u.type.kind!=="string"&&l.type.kind!=="value"&&u.type.kind!=="value")return o.error("Cannot use collator to compare non-string types.");if(c=o.parse(a[3],3,It),!c)return null}return new Cn(l,u,c)}evaluate(a){let o=this.lhs.evaluate(a),s=this.rhs.evaluate(a);if(n&&this.hasUntypedArgument){let l=M(o),u=M(s);if(l.kind!==u.kind||!(l.kind==="string"||l.kind==="number"))throw new z(`Expected arguments for "${t}" to be (string, string) or (number, number), but found (${l.kind}, ${u.kind}) instead.`)}if(this.collator&&!n&&this.hasUntypedArgument){let l=M(o),u=M(s);if(l.kind!=="string"||u.kind!=="string")return e(a,o,s)}return this.collator?r(a,o,s,this.collator.evaluate(a)):e(a,o,s)}eachChild(a){a(this.lhs),a(this.rhs),this.collator&&a(this.collator)}outputDefined(){return!0}}}var Wa=Ie("==",Na,Tn),Ka=Ie("!=",Da,Ua),Za=Ie("<",_a,Ba),Xa=Ie(">",Fa,Ja),Ya=Ie("<=",La,Ha),Qa=Ie(">=",Va,Ga),yt=class t{constructor(e,r,n){this.type=It,this.locale=n,this.caseSensitive=e,this.diacriticSensitive=r}static parse(e,r){if(e.length!==2)return r.error("Expected one argument.");let n=e[1];if(typeof n!="object"||Array.isArray(n))return r.error("Collator options argument must be an object.");let i=r.parse(n["case-sensitive"]===void 0?!1:n["case-sensitive"],1,w);if(!i)return null;let a=r.parse(n["diacritic-sensitive"]===void 0?!1:n["diacritic-sensitive"],1,w);if(!a)return null;let o=null;return n.locale&&(o=r.parse(n.locale,1,k),!o)?null:new t(i,a,o)}evaluate(e){return new Ne(this.caseSensitive.evaluate(e),this.diacriticSensitive.evaluate(e),this.locale?this.locale.evaluate(e):null)}eachChild(e){e(this.caseSensitive),e(this.diacriticSensitive),this.locale&&e(this.locale)}outputDefined(){return!1}},yr=class t{constructor(e,r,n,i,a){this.type=k,this.number=e,this.locale=r,this.currency=n,this.minFractionDigits=i,this.maxFractionDigits=a}static parse(e,r){if(e.length!==3)return r.error("Expected two arguments.");let n=r.parse(e[1],1,m);if(!n)return null;let i=e[2];if(typeof i!="object"||Array.isArray(i))return r.error("NumberFormat options argument must be an object.");let a=null;if(i.locale&&(a=r.parse(i.locale,1,k),!a))return null;let o=null;if(i.currency&&(o=r.parse(i.currency,1,k),!o))return null;let s=null;if(i["min-fraction-digits"]&&(s=r.parse(i["min-fraction-digits"],1,m),!s))return null;let l=null;return i["max-fraction-digits"]&&(l=r.parse(i["max-fraction-digits"],1,m),!l)?null:new t(n,a,o,s,l)}evaluate(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))}eachChild(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)}outputDefined(){return!1}},mr=class t{constructor(e){this.type=Et,this.sections=e}static parse(e,r){if(e.length<2)return r.error("Expected at least one argument.");let n=e[1];if(!Array.isArray(n)&&typeof n=="object")return r.error("First argument must be an image or text section.");let i=[],a=!1;for(let o=1;o<=e.length-1;++o){let s=e[o];if(a&&typeof s=="object"&&!Array.isArray(s)){a=!1;let l=null;if(s["font-scale"]&&(l=r.parse(s["font-scale"],1,m),!l))return null;let u=null;if(s["text-font"]&&(u=r.parse(s["text-font"],1,D(k)),!u))return null;let c=null;if(s["text-color"]&&(c=r.parse(s["text-color"],1,K),!c))return null;let p=null;if(s["vertical-align"]){if(typeof s["vertical-align"]=="string"&&!Ea.includes(s["vertical-align"]))return r.error(`'vertical-align' must be one of: 'bottom', 'center', 'top' but found '${s["vertical-align"]}' instead.`);if(p=r.parse(s["vertical-align"],1,k),!p)return null}let f=i[i.length-1];f.scale=l,f.font=u,f.textColor=c,f.verticalAlign=p}else{let l=r.parse(e[o],1,b);if(!l)return null;let u=l.type.kind;if(u!=="string"&&u!=="value"&&u!=="null"&&u!=="resolvedImage")return r.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");a=!0,i.push({content:l,scale:null,font:null,textColor:null,verticalAlign:null})}}return new t(i)}evaluate(e){let r=n=>{let i=n.content.evaluate(e);return M(i)===Ze?new De("",i,null,null,null,n.verticalAlign?n.verticalAlign.evaluate(e):null):new De(Ce(i),null,n.scale?n.scale.evaluate(e):null,n.font?n.font.evaluate(e).join(","):null,n.textColor?n.textColor.evaluate(e):null,n.verticalAlign?n.verticalAlign.evaluate(e):null)};return new oe(this.sections.map(r))}eachChild(e){for(let r of this.sections)e(r.content),r.scale&&e(r.scale),r.font&&e(r.font),r.textColor&&e(r.textColor),r.verticalAlign&&e(r.verticalAlign)}outputDefined(){return!1}},hr=class t{constructor(e){this.type=Ze,this.input=e}static parse(e,r){if(e.length!==2)return r.error("Expected two arguments.");let n=r.parse(e[1],1,k);return n?new t(n):r.error("No image name provided.")}evaluate(e){let r=this.input.evaluate(e),n=Q.fromString(r);return n&&e.availableImages&&(n.available=e.availableImages.indexOf(r)>-1),n}eachChild(e){e(this.input)}outputDefined(){return!1}},gr=class t{constructor(e){this.type=m,this.input=e}static parse(e,r){if(e.length!==2)return r.error(`Expected 1 argument, but found ${e.length-1} instead.`);let n=r.parse(e[1],1);return n?n.type.kind!=="array"&&n.type.kind!=="string"&&n.type.kind!=="value"?r.error(`Expected argument of type string or array, but found ${I(n.type)} instead.`):new t(n):null}evaluate(e){let r=this.input.evaluate(e);if(typeof r=="string")return[...r].length;if(Array.isArray(r))return r.length;throw new z(`Expected value to be of type string or array, but found ${I(M(r))} instead.`)}eachChild(e){e(this.input)}outputDefined(){return!1}},Z=8192;function eo(t,e){let r=to(t[0]),n=no(t[1]),i=Math.pow(2,e.z);return[Math.round(r*i*Z),Math.round(n*i*Z)]}function zr(t,e){let r=Math.pow(2,e.z),n=(t[0]/Z+e.x)/r,i=(t[1]/Z+e.y)/r;return[ro(n),io(i)]}function to(t){return(180+t)/360}function ro(t){return t*360-180}function no(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}function io(t){return 360/Math.PI*Math.atan(Math.exp((180-t*360)*Math.PI/180))-90}function Xe(t,e){t[0]=Math.min(t[0],e[0]),t[1]=Math.min(t[1],e[1]),t[2]=Math.max(t[2],e[0]),t[3]=Math.max(t[3],e[1])}function Fe(t,e){return!(t[0]<=e[0]||t[2]>=e[2]||t[1]<=e[1]||t[3]>=e[3])}function ao(t,e,r){return e[1]>t[1]!=r[1]>t[1]&&t[0]<(r[0]-e[0])*(t[1]-e[1])/(r[1]-e[1])+e[0]}function oo(t,e,r){let n=t[0]-e[0],i=t[1]-e[1],a=t[0]-r[0],o=t[1]-r[1];return n*o-a*i===0&&n*a<=0&&i*o<=0}function Ct(t,e,r,n){let i=[e[0]-t[0],e[1]-t[1]],a=[n[0]-r[0],n[1]-r[1]];return co(a,i)===0?!1:!!(ln(t,e,r,n)&&ln(r,n,t,e))}function so(t,e,r){for(let n of r)for(let i=0;i<n.length-1;++i)if(Ct(t,e,n[i],n[i+1]))return!0;return!1}function Ee(t,e,r=!1){let n=!1;for(let i of e)for(let a=0;a<i.length-1;a++){if(oo(t,i[a],i[a+1]))return r;ao(t,i[a],i[a+1])&&(n=!n)}return n}function lo(t,e){for(let r of e)if(Ee(t,r))return!0;return!1}function qn(t,e){for(let r of t)if(!Ee(r,e))return!1;for(let r=0;r<t.length-1;++r)if(so(t[r],t[r+1],e))return!1;return!0}function uo(t,e){for(let r of e)if(qn(t,r))return!0;return!1}function co(t,e){return t[0]*e[1]-t[1]*e[0]}function ln(t,e,r,n){let i=t[0]-r[0],a=t[1]-r[1],o=e[0]-r[0],s=e[1]-r[1],l=n[0]-r[0],u=n[1]-r[1],c=i*u-l*a,p=o*u-l*s;return c>0&&p<0||c<0&&p>0}function Ir(t,e,r){let n=[];for(let i=0;i<t.length;i++){let a=[];for(let o=0;o<t[i].length;o++){let s=eo(t[i][o],r);Xe(e,s),a.push(s)}n.push(a)}return n}function jn(t,e,r){let n=[];for(let i=0;i<t.length;i++){let a=Ir(t[i],e,r);n.push(a)}return n}function Nn(t,e,r,n){if(t[0]<r[0]||t[0]>r[2]){let i=n*.5,a=t[0]-r[0]>i?-n:r[0]-t[0]>i?n:0;a===0&&(a=t[0]-r[2]>i?-n:r[2]-t[0]>i?n:0),t[0]+=a}Xe(e,t)}function po(t){t[0]=t[1]=1/0,t[2]=t[3]=-1/0}function un(t,e,r,n){let i=Math.pow(2,n.z)*Z,a=[n.x*Z,n.y*Z],o=[];for(let s of t)for(let l of s){let u=[l.x+a[0],l.y+a[1]];Nn(u,e,r,i),o.push(u)}return o}function cn(t,e,r,n){let i=Math.pow(2,n.z)*Z,a=[n.x*Z,n.y*Z],o=[];for(let s of t){let l=[];for(let u of s){let c=[u.x+a[0],u.y+a[1]];Xe(e,c),l.push(c)}o.push(l)}if(e[2]-e[0]<=i/2){po(e);for(let s of o)for(let l of s)Nn(l,e,r,i)}return o}function fo(t,e){let r=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],i=t.canonicalID();if(e.type==="Polygon"){let a=Ir(e.coordinates,n,i),o=un(t.geometry(),r,n,i);if(!Fe(r,n))return!1;for(let s of o)if(!Ee(s,a))return!1}if(e.type==="MultiPolygon"){let a=jn(e.coordinates,n,i),o=un(t.geometry(),r,n,i);if(!Fe(r,n))return!1;for(let s of o)if(!lo(s,a))return!1}return!0}function yo(t,e){let r=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],i=t.canonicalID();if(e.type==="Polygon"){let a=Ir(e.coordinates,n,i),o=cn(t.geometry(),r,n,i);if(!Fe(r,n))return!1;for(let s of o)if(!qn(s,a))return!1}if(e.type==="MultiPolygon"){let a=jn(e.coordinates,n,i),o=cn(t.geometry(),r,n,i);if(!Fe(r,n))return!1;for(let s of o)if(!uo(s,a))return!1}return!0}var Le=class t{constructor(e,r){this.type=w,this.geojson=e,this.geometries=r}static parse(e,r){if(e.length!==2)return r.error(`'within' expression requires exactly one argument, but found ${e.length-1} instead.`);if(_e(e[1])){let n=e[1];if(n.type==="FeatureCollection"){let i=[];for(let a of n.features){let{type:o,coordinates:s}=a.geometry;o==="Polygon"&&i.push(s),o==="MultiPolygon"&&i.push(...s)}if(i.length){let a={type:"MultiPolygon",coordinates:i};return new t(n,a)}}else if(n.type==="Feature"){let i=n.geometry.type;if(i==="Polygon"||i==="MultiPolygon")return new t(n,n.geometry)}else if(n.type==="Polygon"||n.type==="MultiPolygon")return new t(n,n)}return r.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(e.geometry()!=null&&e.canonicalID()!=null){if(e.geometryType()==="Point")return fo(e,this.geometries);if(e.geometryType()==="LineString")return yo(e,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}},mt=class{constructor(e=[],r=(n,i)=>n<i?-1:n>i?1:0){if(this.data=e,this.length=this.data.length,this.compare=r,this.length>0)for(let n=(this.length>>1)-1;n>=0;n--)this._down(n)}push(e){this.data.push(e),this._up(this.length++)}pop(){if(this.length===0)return;let e=this.data[0],r=this.data.pop();return--this.length>0&&(this.data[0]=r,this._down(0)),e}peek(){return this.data[0]}_up(e){let{data:r,compare:n}=this,i=r[e];for(;e>0;){let a=e-1>>1,o=r[a];if(n(i,o)>=0)break;r[e]=o,e=a}r[e]=i}_down(e){let{data:r,compare:n}=this,i=this.length>>1,a=r[e];for(;e<i;){let o=(e<<1)+1,s=o+1;if(s<this.length&&n(r[s],r[o])<0&&(o=s),n(r[o],a)>=0)break;r[e]=r[o],e=o}r[e]=a}};function Dn(t,e,r=0,n=t.length-1,i=mo){for(;n>r;){if(n-r>600){let l=n-r+1,u=e-r+1,c=Math.log(l),p=.5*Math.exp(2*c/3),f=.5*Math.sqrt(c*p*(l-p)/l)*(u-l/2<0?-1:1),d=Math.max(r,Math.floor(e-u*p/l+f)),h=Math.min(n,Math.floor(e+(l-u)*p/l+f));Dn(t,e,d,h,i)}let a=t[e],o=r,s=n;for(Pe(t,r,e),i(t[n],a)>0&&Pe(t,r,n);o<s;){for(Pe(t,o,s),o++,s--;i(t[o],a)<0;)o++;for(;i(t[s],a)>0;)s--}i(t[r],a)===0?Pe(t,r,s):(s++,Pe(t,s,n)),s<=e&&(r=s+1),e<=s&&(n=s-1)}}function Pe(t,e,r){let n=t[e];t[e]=t[r],t[r]=n}function mo(t,e){return t<e?-1:t>e?1:0}function ho(t,e){if(t.length<=1)return[t];let n=[],i,a;for(let o of t){let s=vo(o);s!==0&&(o.area=Math.abs(s),a===void 0&&(a=s<0),a===s<0?(i&&n.push(i),i=[o]):i.push(o))}if(i&&n.push(i),e>1)for(let o=0;o<n.length;o++)n[o].length<=e||(Dn(n[o],e,1,n[o].length-1,go),n[o]=n[o].slice(0,e));return n}function go(t,e){return e.area-t.area}function vo(t){let e=0;for(let r=0,n=t.length,i=n-1,a,o;r<n;i=r++)a=t[r],o=t[i],e+=(o.x-a.x)*(a.y+o.y);return e}var bo=6378.137,pn=1/298.257223563,fn=pn*(2-pn),dn=Math.PI/180,Ve=class{constructor(e){let r=dn*bo*1e3,n=Math.cos(e*dn),i=1/(1-fn*(1-n*n)),a=Math.sqrt(i);this.kx=r*a*n,this.ky=r*a*i*(1-fn)}distance(e,r){let n=this.wrap(e[0]-r[0])*this.kx,i=(e[1]-r[1])*this.ky;return Math.sqrt(n*n+i*i)}pointOnLine(e,r){let n=1/0,i,a,o,s;for(let l=0;l<e.length-1;l++){let u=e[l][0],c=e[l][1],p=this.wrap(e[l+1][0]-u)*this.kx,f=(e[l+1][1]-c)*this.ky,d=0;(p!==0||f!==0)&&(d=(this.wrap(r[0]-u)*this.kx*p+(r[1]-c)*this.ky*f)/(p*p+f*f),d>1?(u=e[l+1][0],c=e[l+1][1]):d>0&&(u+=p/this.kx*d,c+=f/this.ky*d)),p=this.wrap(r[0]-u)*this.kx,f=(r[1]-c)*this.ky;let h=p*p+f*f;h<n&&(n=h,i=u,a=c,o=l,s=d)}return{point:[i,a],index:o,t:Math.max(0,Math.min(1,s))}}wrap(e){for(;e<-180;)e+=360;for(;e>180;)e-=360;return e}},vr=100,br=50;function _n(t,e){return e[0]-t[0]}function ht(t){return t[1]-t[0]+1}function ee(t,e){return t[1]>=t[0]&&t[1]<e}function wr(t,e){if(t[0]>t[1])return[null,null];let r=ht(t);if(e){if(r===2)return[t,null];let i=Math.floor(r/2);return[[t[0],t[0]+i],[t[0]+i,t[1]]]}if(r===1)return[t,null];let n=Math.floor(r/2)-1;return[[t[0],t[0]+n],[t[0]+n+1,t[1]]]}function xr(t,e){if(!ee(e,t.length))return[1/0,1/0,-1/0,-1/0];let r=[1/0,1/0,-1/0,-1/0];for(let n=e[0];n<=e[1];++n)Xe(r,t[n]);return r}function kr(t){let e=[1/0,1/0,-1/0,-1/0];for(let r of t)for(let n of r)Xe(e,n);return e}function yn(t){return t[0]!==-1/0&&t[1]!==-1/0&&t[2]!==1/0&&t[3]!==1/0}function Er(t,e,r){if(!yn(t)||!yn(e))return NaN;let n=0,i=0;return t[2]<e[0]&&(n=e[0]-t[2]),t[0]>e[2]&&(n=t[0]-e[2]),t[1]>e[3]&&(i=t[1]-e[3]),t[3]<e[1]&&(i=e[1]-t[3]),r.distance([0,0],[n,i])}function fe(t,e,r){let n=r.pointOnLine(e,t);return r.distance(t,n.point)}function Mr(t,e,r,n,i){let a=Math.min(fe(t,[r,n],i),fe(e,[r,n],i)),o=Math.min(fe(r,[t,e],i),fe(n,[t,e],i));return Math.min(a,o)}function wo(t,e,r,n,i){if(!(ee(e,t.length)&&ee(n,r.length)))return 1/0;let o=1/0;for(let s=e[0];s<e[1];++s){let l=t[s],u=t[s+1];for(let c=n[0];c<n[1];++c){let p=r[c],f=r[c+1];if(Ct(l,u,p,f))return 0;o=Math.min(o,Mr(l,u,p,f,i))}}return o}function xo(t,e,r,n,i){if(!(ee(e,t.length)&&ee(n,r.length)))return NaN;let o=1/0;for(let s=e[0];s<=e[1];++s)for(let l=n[0];l<=n[1];++l)if(o=Math.min(o,i.distance(t[s],r[l])),o===0)return o;return o}function ko(t,e,r){if(Ee(t,e,!0))return 0;let n=1/0;for(let i of e){let a=i[0],o=i[i.length-1];if(a!==o&&(n=Math.min(n,fe(t,[o,a],r)),n===0))return n;let s=r.pointOnLine(i,t);if(n=Math.min(n,r.distance(t,s.point)),n===0)return n}return n}function So(t,e,r,n){if(!ee(e,t.length))return NaN;for(let a=e[0];a<=e[1];++a)if(Ee(t[a],r,!0))return 0;let i=1/0;for(let a=e[0];a<e[1];++a){let o=t[a],s=t[a+1];for(let l of r)for(let u=0,c=l.length,p=c-1;u<c;p=u++){let f=l[p],d=l[u];if(Ct(o,s,f,d))return 0;i=Math.min(i,Mr(o,s,f,d,n))}}return i}function mn(t,e){for(let r of t)for(let n of r)if(Ee(n,e,!0))return!0;return!1}function Oo(t,e,r,n=1/0){let i=kr(t),a=kr(e);if(n!==1/0&&Er(i,a,r)>=n)return n;if(Fe(i,a)){if(mn(t,e))return 0}else if(mn(e,t))return 0;let o=1/0;for(let s of t)for(let l=0,u=s.length,c=u-1;l<u;c=l++){let p=s[c],f=s[l];for(let d of e)for(let h=0,g=d.length,O=g-1;h<g;O=h++){let v=d[O],A=d[h];if(Ct(p,f,v,A))return 0;o=Math.min(o,Mr(p,f,v,A,r))}}return o}function hn(t,e,r,n,i,a){if(!a)return;let o=Er(xr(n,a),i,r);o<e&&t.push([o,a,[0,0]])}function at(t,e,r,n,i,a,o){if(!a||!o)return;let s=Er(xr(n,a),xr(i,o),r);s<e&&t.push([s,a,o])}function gt(t,e,r,n,i=1/0){let a=Math.min(n.distance(t[0],r[0][0]),i);if(a===0)return a;let o=new mt([[0,[0,t.length-1],[0,0]]],_n),s=kr(r);for(;o.length>0;){let l=o.pop();if(l[0]>=a)continue;let u=l[1],c=e?br:vr;if(ht(u)<=c){if(!ee(u,t.length))return NaN;if(e){let p=So(t,u,r,n);if(isNaN(p)||p===0)return p;a=Math.min(a,p)}else for(let p=u[0];p<=u[1];++p){let f=ko(t[p],r,n);if(a=Math.min(a,f),a===0)return 0}}else{let p=wr(u,e);hn(o,a,n,t,s,p[0]),hn(o,a,n,t,s,p[1])}}return a}function vt(t,e,r,n,i,a=1/0){let o=Math.min(a,i.distance(t[0],r[0]));if(o===0)return o;let s=new mt([[0,[0,t.length-1],[0,r.length-1]]],_n);for(;s.length>0;){let l=s.pop();if(l[0]>=o)continue;let u=l[1],c=l[2],p=e?br:vr,f=n?br:vr;if(ht(u)<=p&&ht(c)<=f){if(!ee(u,t.length)&&ee(c,r.length))return NaN;let d;if(e&&n)d=wo(t,u,r,c,i),o=Math.min(o,d);else if(e&&!n){let h=t.slice(u[0],u[1]+1);for(let g=c[0];g<=c[1];++g)if(d=fe(r[g],h,i),o=Math.min(o,d),o===0)return o}else if(!e&&n){let h=r.slice(c[0],c[1]+1);for(let g=u[0];g<=u[1];++g)if(d=fe(t[g],h,i),o=Math.min(o,d),o===0)return o}else d=xo(t,u,r,c,i),o=Math.min(o,d)}else{let d=wr(u,e),h=wr(c,n);at(s,o,i,t,r,d[0],h[0]),at(s,o,i,t,r,d[0],h[1]),at(s,o,i,t,r,d[1],h[0]),at(s,o,i,t,r,d[1],h[1])}}return o}function $o(t,e){let r=t.geometry(),n=r.flat().map(o=>zr([o.x,o.y],t.canonical));if(r.length===0)return NaN;let i=new Ve(n[0][1]),a=1/0;for(let o of e){switch(o.type){case"Point":a=Math.min(a,vt(n,!1,[o.coordinates],!1,i,a));break;case"LineString":a=Math.min(a,vt(n,!1,o.coordinates,!0,i,a));break;case"Polygon":a=Math.min(a,gt(n,!1,o.coordinates,i,a));break}if(a===0)return a}return a}function Ao(t,e){let r=t.geometry(),n=r.flat().map(o=>zr([o.x,o.y],t.canonical));if(r.length===0)return NaN;let i=new Ve(n[0][1]),a=1/0;for(let o of e){switch(o.type){case"Point":a=Math.min(a,vt(n,!0,[o.coordinates],!1,i,a));break;case"LineString":a=Math.min(a,vt(n,!0,o.coordinates,!0,i,a));break;case"Polygon":a=Math.min(a,gt(n,!0,o.coordinates,i,a));break}if(a===0)return a}return a}function zo(t,e){let r=t.geometry();if(r.length===0||r[0].length===0)return NaN;let n=ho(r,0).map(o=>o.map(s=>s.map(l=>zr([l.x,l.y],t.canonical)))),i=new Ve(n[0][0][0][1]),a=1/0;for(let o of e)for(let s of n){switch(o.type){case"Point":a=Math.min(a,gt([o.coordinates],!1,s,i,a));break;case"LineString":a=Math.min(a,gt(o.coordinates,!0,s,i,a));break;case"Polygon":a=Math.min(a,Oo(s,o.coordinates,i,a));break}if(a===0)return a}return a}function ir(t){return t.type==="MultiPolygon"?t.coordinates.map(e=>({type:"Polygon",coordinates:e})):t.type==="MultiLineString"?t.coordinates.map(e=>({type:"LineString",coordinates:e})):t.type==="MultiPoint"?t.coordinates.map(e=>({type:"Point",coordinates:e})):[t]}var Ue=class t{constructor(e,r){this.type=m,this.geojson=e,this.geometries=r}static parse(e,r){if(e.length!==2)return r.error(`'distance' expression requires exactly one argument, but found ${e.length-1} instead.`);if(_e(e[1])){let n=e[1];if(n.type==="FeatureCollection")return new t(n,n.features.map(i=>ir(i.geometry)).flat());if(n.type==="Feature")return new t(n,ir(n.geometry));if("type"in n&&"coordinates"in n)return new t(n,ir(n))}return r.error("'distance' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(e.geometry()!=null&&e.canonicalID()!=null){if(e.geometryType()==="Point")return $o(e,this.geometries);if(e.geometryType()==="LineString")return Ao(e,this.geometries);if(e.geometryType()==="Polygon")return zo(e,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}},Be=class t{constructor(e){this.type=b,this.key=e}static parse(e,r){if(e.length!==2)return r.error(`Expected 1 argument, but found ${e.length-1} instead.`);let n=e[1];return n==null?r.error("Global state property must be defined."):typeof n!="string"?r.error(`Global state property must be string, but found ${typeof e[1]} instead.`):new t(n)}evaluate(e){var r;let n=(r=e.globals)===null||r===void 0?void 0:r.globalState;return!n||Object.keys(n).length===0?null:Te(n,this.key)}eachChild(){}outputDefined(){return!1}},Rr={"==":Wa,"!=":Ka,">":Xa,"<":Za,">=":Qa,"<=":Ya,array:B,at:lr,boolean:B,case:fr,coalesce:dt,collator:yt,format:mr,image:hr,in:ur,"index-of":cr,interpolate:J,"interpolate-hcl":J,"interpolate-lab":J,length:gr,let:ct,literal:Ae,match:pr,number:B,"number-format":yr,object:B,slice:dr,step:ft,string:B,"to-boolean":ie,"to-color":ie,"to-number":ie,"to-string":ie,var:pt,within:Le,distance:Ue,"global-state":Be},le=class t{constructor(e,r,n,i){this.name=e,this.type=r,this._evaluate=n,this.args=i}evaluate(e){return this._evaluate(e,this.args)}eachChild(e){this.args.forEach(e)}outputDefined(){return!1}static parse(e,r){let n=e[0],i=t.definitions[n];if(!i)return r.error(`Unknown expression "${n}". If you wanted a literal array, use ["literal", [...]].`,0);let a=Array.isArray(i)?i[0]:i.type,o=Array.isArray(i)?[[i[1],i[2]]]:i.overloads,s=o.filter(([u])=>!Array.isArray(u)||u.length===e.length-1),l=null;for(let[u,c]of s){l=new ut(r.registry,bt,r.path,null,r.scope);let p=[],f=!1;for(let d=1;d<e.length;d++){let h=e[d],g=Array.isArray(u)?u[d-1]:u.type,O=l.parse(h,1+p.length,g);if(!O){f=!0;break}p.push(O)}if(!f){if(Array.isArray(u)&&u.length!==p.length){l.error(`Expected ${u.length} arguments, but found ${p.length} instead.`);continue}for(let d=0;d<p.length;d++){let h=Array.isArray(u)?u[d]:u.type,g=p[d];l.concat(d+1).checkSubtype(h,g.type)}if(l.errors.length===0)return new t(n,a,c,p)}}if(s.length===1)r.errors.push(...l.errors);else{let c=(s.length?s:o).map(([f])=>Eo(f)).join(" | "),p=[];for(let f=1;f<e.length;f++){let d=r.parse(e[f],1+p.length);if(!d)return null;p.push(I(d.type))}r.error(`Expected arguments of type ${c}, but found (${p.join(", ")}) instead.`)}return null}static register(e,r){t.definitions=r;for(let n in r)e[n]=t}};function gn(t,[e,r,n,i]){e=e.evaluate(t),r=r.evaluate(t),n=n.evaluate(t);let a=i?i.evaluate(t):1,o=Pn(e,r,n,a);if(o)throw new z(o);return new $(e/255,r/255,n/255,a,!1)}function vn(t,e){return t in e}function ar(t,e){let r=e[t];return typeof r>"u"?null:r}function Io(t,e,r,n){for(;r<=n;){let i=r+n>>1;if(e[i]===t)return!0;e[i]>t?n=i-1:r=i+1}return!1}function pe(t){return{type:t}}le.register(Rr,{error:[ga,[k],(t,[e])=>{throw new z(e.evaluate(t))}],typeof:[k,[b],(t,[e])=>I(M(e.evaluate(t)))],"to-rgba":[D(m,4),[K],(t,[e])=>{let[r,n,i,a]=e.evaluate(t).rgb;return[r*255,n*255,i*255,a]}],rgb:[K,[m,m,m],gn],rgba:[K,[m,m,m,m],gn],has:{type:w,overloads:[[[k],(t,[e])=>vn(e.evaluate(t),t.properties())],[[k,de],(t,[e,r])=>vn(e.evaluate(t),r.evaluate(t))]]},get:{type:b,overloads:[[[k],(t,[e])=>ar(e.evaluate(t),t.properties())],[[k,de],(t,[e,r])=>ar(e.evaluate(t),r.evaluate(t))]]},"feature-state":[b,[k],(t,[e])=>ar(e.evaluate(t),t.featureState||{})],properties:[de,[],t=>t.properties()],"geometry-type":[k,[],t=>t.geometryType()],id:[b,[],t=>t.id()],zoom:[m,[],t=>t.globals.zoom],"heatmap-density":[m,[],t=>t.globals.heatmapDensity||0],elevation:[m,[],t=>t.globals.elevation||0],"line-progress":[m,[],t=>t.globals.lineProgress||0],accumulated:[b,[],t=>t.globals.accumulated===void 0?null:t.globals.accumulated],"+":[m,pe(m),(t,e)=>{let r=0;for(let n of e)r+=n.evaluate(t);return r}],"*":[m,pe(m),(t,e)=>{let r=1;for(let n of e)r*=n.evaluate(t);return r}],"-":{type:m,overloads:[[[m,m],(t,[e,r])=>e.evaluate(t)-r.evaluate(t)],[[m],(t,[e])=>-e.evaluate(t)]]},"/":[m,[m,m],(t,[e,r])=>e.evaluate(t)/r.evaluate(t)],"%":[m,[m,m],(t,[e,r])=>e.evaluate(t)%r.evaluate(t)],ln2:[m,[],()=>Math.LN2],pi:[m,[],()=>Math.PI],e:[m,[],()=>Math.E],"^":[m,[m,m],(t,[e,r])=>Math.pow(e.evaluate(t),r.evaluate(t))],sqrt:[m,[m],(t,[e])=>Math.sqrt(e.evaluate(t))],log10:[m,[m],(t,[e])=>Math.log(e.evaluate(t))/Math.LN10],ln:[m,[m],(t,[e])=>Math.log(e.evaluate(t))],log2:[m,[m],(t,[e])=>Math.log(e.evaluate(t))/Math.LN2],sin:[m,[m],(t,[e])=>Math.sin(e.evaluate(t))],cos:[m,[m],(t,[e])=>Math.cos(e.evaluate(t))],tan:[m,[m],(t,[e])=>Math.tan(e.evaluate(t))],asin:[m,[m],(t,[e])=>Math.asin(e.evaluate(t))],acos:[m,[m],(t,[e])=>Math.acos(e.evaluate(t))],atan:[m,[m],(t,[e])=>Math.atan(e.evaluate(t))],min:[m,pe(m),(t,e)=>Math.min(...e.map(r=>r.evaluate(t)))],max:[m,pe(m),(t,e)=>Math.max(...e.map(r=>r.evaluate(t)))],abs:[m,[m],(t,[e])=>Math.abs(e.evaluate(t))],round:[m,[m],(t,[e])=>{let r=e.evaluate(t);return r<0?-Math.round(-r):Math.round(r)}],floor:[m,[m],(t,[e])=>Math.floor(e.evaluate(t))],ceil:[m,[m],(t,[e])=>Math.ceil(e.evaluate(t))],"filter-==":[w,[k,b],(t,[e,r])=>t.properties()[e.value]===r.value],"filter-id-==":[w,[b],(t,[e])=>t.id()===e.value],"filter-type-==":[w,[k],(t,[e])=>t.geometryType()===e.value],"filter-<":[w,[k,b],(t,[e,r])=>{let n=t.properties()[e.value],i=r.value;return typeof n==typeof i&&n<i}],"filter-id-<":[w,[b],(t,[e])=>{let r=t.id(),n=e.value;return typeof r==typeof n&&r<n}],"filter->":[w,[k,b],(t,[e,r])=>{let n=t.properties()[e.value],i=r.value;return typeof n==typeof i&&n>i}],"filter-id->":[w,[b],(t,[e])=>{let r=t.id(),n=e.value;return typeof r==typeof n&&r>n}],"filter-<=":[w,[k,b],(t,[e,r])=>{let n=t.properties()[e.value],i=r.value;return typeof n==typeof i&&n<=i}],"filter-id-<=":[w,[b],(t,[e])=>{let r=t.id(),n=e.value;return typeof r==typeof n&&r<=n}],"filter->=":[w,[k,b],(t,[e,r])=>{let n=t.properties()[e.value],i=r.value;return typeof n==typeof i&&n>=i}],"filter-id->=":[w,[b],(t,[e])=>{let r=t.id(),n=e.value;return typeof r==typeof n&&r>=n}],"filter-has":[w,[b],(t,[e])=>e.value in t.properties()],"filter-has-id":[w,[],t=>t.id()!==null&&t.id()!==void 0],"filter-type-in":[w,[D(k)],(t,[e])=>e.value.indexOf(t.geometryType())>=0],"filter-id-in":[w,[D(b)],(t,[e])=>e.value.indexOf(t.id())>=0],"filter-in-small":[w,[k,D(b)],(t,[e,r])=>r.value.indexOf(t.properties()[e.value])>=0],"filter-in-large":[w,[k,D(b)],(t,[e,r])=>Io(t.properties()[e.value],r.value,0,r.value.length-1)],all:{type:w,overloads:[[[w,w],(t,[e,r])=>e.evaluate(t)&&r.evaluate(t)],[pe(w),(t,e)=>{for(let r of e)if(!r.evaluate(t))return!1;return!0}]]},any:{type:w,overloads:[[[w,w],(t,[e,r])=>e.evaluate(t)||r.evaluate(t)],[pe(w),(t,e)=>{for(let r of e)if(r.evaluate(t))return!0;return!1}]]},"!":[w,[w],(t,[e])=>!e.evaluate(t)],"is-supported-script":[w,[k],(t,[e])=>{let r=t.globals&&t.globals.isSupportedScript;return r?r(e.evaluate(t)):!0}],upcase:[k,[k],(t,[e])=>e.evaluate(t).toUpperCase()],downcase:[k,[k],(t,[e])=>e.evaluate(t).toLowerCase()],concat:[k,pe(b),(t,e)=>e.map(r=>Ce(r.evaluate(t))).join("")],"resolved-locale":[k,[It],(t,[e])=>e.evaluate(t).resolvedLocale()]});function Eo(t){return Array.isArray(t)?`(${t.map(I).join(", ")})`:`(${I(t.type)}...)`}function bt(t){if(t instanceof pt)return bt(t.boundExpression);if(t instanceof le&&t.name==="error")return!1;if(t instanceof yt)return!1;if(t instanceof Le)return!1;if(t instanceof Ue)return!1;if(t instanceof Be)return!1;let e=t instanceof ie||t instanceof B,r=!0;return t.eachChild(n=>{e?r=r&&bt(n):r=r&&n instanceof Ae}),r?qt(t)&&jt(t,["zoom","heatmap-density","elevation","line-progress","accumulated","is-supported-script"]):!1}function qt(t){if(t instanceof le){if(t.name==="get"&&t.args.length===1)return!1;if(t.name==="feature-state")return!1;if(t.name==="has"&&t.args.length===1)return!1;if(t.name==="properties"||t.name==="geometry-type"||t.name==="id")return!1;if(/^filter-/.test(t.name))return!1}if(t instanceof Le||t instanceof Ue)return!1;let e=!0;return t.eachChild(r=>{e&&!qt(r)&&(e=!1)}),e}function Je(t){if(t instanceof le&&t.name==="feature-state")return!1;let e=!0;return t.eachChild(r=>{e&&!Je(r)&&(e=!1)}),e}function jt(t,e){if(t instanceof le&&e.indexOf(t.name)>=0)return!1;let r=!0;return t.eachChild(n=>{r&&!jt(n,e)&&(r=!1)}),r}function Sr(t){return{result:"success",value:t}}function xe(t){return{result:"error",value:t}}function wt(t){return t["property-type"]==="data-driven"||t["property-type"]==="cross-faded-data-driven"}function Fn(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}function Pr(t){return!!t.expression&&t.expression.interpolated}function S(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":t===null?"null":typeof t}function Nt(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)&&M(t)===de}function Mo(t){return t}function Ro(t){switch(t.type){case"color":return $.parse;case"padding":return V.parse;case"numberArray":return U.parse;case"colorArray":return N.parse;default:return null}}function Po(t){switch(t){case"exponential":return Vn;case"interval":return Co;case"categorical":return To;case"identity":return qo;default:throw new Error(`Unknown function type "${t}"`)}}function Ln(t,e){let r=t.stops&&typeof t.stops[0][0]=="object",n=r||t.property!==void 0,i=r||!n,a=t.type||(Pr(e)?"exponential":"interval"),o=Ro(e);if(o&&(t=Oe({},t),t.stops&&(t.stops=t.stops.map(c=>[c[0],o(c[1])])),t.default?t.default=o(t.default):t.default=o(e.default)),t.colorSpace&&!Ia(t.colorSpace))throw new Error(`Unknown color space: "${t.colorSpace}"`);let s=Po(a),l,u;if(a==="categorical"){l=Object.create(null);for(let c of t.stops)l[c[0]]=c[1];u=typeof t.stops[0][0]}if(r){let c={},p=[];for(let h=0;h<t.stops.length;h++){let g=t.stops[h],O=g[0].zoom;c[O]===void 0&&(c[O]={zoom:O,type:t.type,property:t.property,default:t.default,stops:[]},p.push(O)),c[O].stops.push([g[0].value,g[1]])}let f=[];for(let h of p)f.push([c[h].zoom,Ln(c[h],e)]);let d={name:"linear"};return{kind:"composite",interpolationType:d,interpolationFactor:J.interpolationFactor.bind(void 0,d),zoomStops:f.map(h=>h[0]),evaluate({zoom:h},g){return Vn({stops:f,base:t.base},e,h).evaluate(h,g)}}}else if(i){let c=a==="exponential"?{name:"exponential",base:t.base!==void 0?t.base:1}:null;return{kind:"camera",interpolationType:c,interpolationFactor:J.interpolationFactor.bind(void 0,c),zoomStops:t.stops.map(p=>p[0]),evaluate:({zoom:p})=>s(t,e,p,l,u)}}else return{kind:"source",evaluate(c,p){let f=p&&p.properties?p.properties[t.property]:void 0;return f===void 0?Ye(t.default,e.default):s(t,e,f,l,u)}}}function Ye(t,e,r){if(t!==void 0)return t;if(e!==void 0)return e;if(r!==void 0)return r}function To(t,e,r,n,i){let a=typeof r===i?n[r]:void 0;return Ye(a,t.default,e.default)}function Co(t,e,r){if(S(r)!=="number")return Ye(t.default,e.default);let n=t.stops.length;if(n===1||r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[n-1][0])return t.stops[n-1][1];let i=Tt(t.stops.map(a=>a[0]),r);return t.stops[i][1]}function Vn(t,e,r){let n=t.base!==void 0?t.base:1;if(S(r)!=="number")return Ye(t.default,e.default);let i=t.stops.length;if(i===1||r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[i-1][0])return t.stops[i-1][1];let a=Tt(t.stops.map(c=>c[0]),r),o=jo(r,n,t.stops[a][0],t.stops[a+1][0]),s=t.stops[a][1],l=t.stops[a+1][1],u=ja[e.type]||Mo;return typeof s.evaluate=="function"?{evaluate(...c){let p=s.evaluate.apply(void 0,c),f=l.evaluate.apply(void 0,c);if(!(p===void 0||f===void 0))return u(p,f,o,t.colorSpace)}}:u(s,l,o,t.colorSpace)}function qo(t,e,r){switch(e.type){case"color":r=$.parse(r);break;case"formatted":r=oe.fromString(r.toString());break;case"resolvedImage":r=Q.fromString(r.toString());break;case"padding":r=V.parse(r);break;case"colorArray":r=N.parse(r);break;case"numberArray":r=U.parse(r);break;default:S(r)!==e.type&&(e.type!=="enum"||!e.values[r])&&(r=void 0)}return Ye(r,t.default,e.default)}function jo(t,e,r,n){let i=n-r,a=t-r;return i===0?0:e===1?a/i:(Math.pow(e,a)-1)/(Math.pow(e,i)-1)}var xt=class{constructor(e,r){this.expression=e,this._warningHistory={},this._evaluator=new lt,this._defaultValue=r?Fo(r):null,this._enumValues=r&&r.type==="enum"?r.values:null}evaluateWithoutErrorHandling(e,r,n,i,a,o){return this._evaluator.globals=e,this._evaluator.feature=r,this._evaluator.featureState=n,this._evaluator.canonical=i,this._evaluator.availableImages=a||null,this._evaluator.formattedSection=o,this.expression.evaluate(this._evaluator)}evaluate(e,r,n,i,a,o){this._evaluator.globals=e,this._evaluator.feature=r||null,this._evaluator.featureState=n||null,this._evaluator.canonical=i,this._evaluator.availableImages=a||null,this._evaluator.formattedSection=o||null;try{let s=this.expression.evaluate(this._evaluator);if(s==null||typeof s=="number"&&s!==s)return this._defaultValue;if(this._enumValues&&!(s in this._enumValues))throw new z(`Expected value to be one of ${Object.keys(this._enumValues).map(l=>JSON.stringify(l)).join(", ")}, but found ${JSON.stringify(s)} instead.`);return s}catch(s){return this._warningHistory[s.message]||(this._warningHistory[s.message]=!0,typeof console<"u"&&console.warn(s.message)),this._defaultValue}}};function Dt(t){return Array.isArray(t)&&t.length>0&&typeof t[0]=="string"&&t[0]in Rr}function _t(t,e){let r=new ut(Rr,bt,[],e?_o(e):void 0),n=r.parse(t,void 0,void 0,void 0,e&&e.type==="string"?{typeAnnotation:"coerce"}:void 0);return n?Sr(new xt(n,e)):xe(r.errors)}var He=class{constructor(e,r){this.kind=e,this._styleExpression=r,this.isStateDependent=e!=="constant"&&!Je(r.expression),this.globalStateRefs=Ft(r.expression)}evaluateWithoutErrorHandling(e,r,n,i,a,o){return this._styleExpression.evaluateWithoutErrorHandling(e,r,n,i,a,o)}evaluate(e,r,n,i,a,o){return this._styleExpression.evaluate(e,r,n,i,a,o)}},Ge=class{constructor(e,r,n,i){this.kind=e,this.zoomStops=n,this._styleExpression=r,this.isStateDependent=e!=="camera"&&!Je(r.expression),this.globalStateRefs=Ft(r.expression),this.interpolationType=i}evaluateWithoutErrorHandling(e,r,n,i,a,o){return this._styleExpression.evaluateWithoutErrorHandling(e,r,n,i,a,o)}evaluate(e,r,n,i,a,o){return this._styleExpression.evaluate(e,r,n,i,a,o)}interpolationFactor(e,r,n){return this.interpolationType?J.interpolationFactor(this.interpolationType,e,r,n):0}};function No(t){return t._styleExpression!==void 0}function Tr(t,e){let r=_t(t,e);if(r.result==="error")return r;let n=r.value.expression,i=qt(n);if(!i&&!wt(e))return xe([new F("","data expressions not supported")]);let a=jt(n,["zoom"]);if(!a&&!Fn(e))return xe([new F("","zoom expressions not supported")]);let o=st(n);if(!o&&!a)return xe([new F("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(o instanceof F)return xe([o]);if(o instanceof J&&!Pr(e))return xe([new F("",'"interpolate" expressions cannot be used with this property')]);if(!o)return Sr(i?new He("constant",r.value):new He("source",r.value));let s=o instanceof J?o.interpolation:void 0;return Sr(i?new Ge("camera",r.value,o.labels,s):new Ge("composite",r.value,o.labels,s))}var kt=class t{constructor(e,r){this._parameters=e,this._specification=r,Oe(this,Ln(this._parameters,this._specification))}static deserialize(e){return new t(e._parameters,e._specification)}static serialize(e){return{_parameters:e._parameters,_specification:e._specification}}};function Do(t,e){if(Nt(t))return new kt(t,e);if(Dt(t)){let r=Tr(t,e);if(r.result==="error")throw new Error(r.value.map(n=>`${n.key}: ${n.message}`).join(", "));return r.value}else{let r=t;return e.type==="color"&&typeof t=="string"?r=$.parse(t):e.type==="padding"&&(typeof t=="number"||Array.isArray(t))?r=V.parse(t):e.type==="numberArray"&&(typeof t=="number"||Array.isArray(t))?r=U.parse(t):e.type==="colorArray"&&(typeof t=="string"||Array.isArray(t))?r=N.parse(t):e.type==="variableAnchorOffsetCollection"&&Array.isArray(t)?r=X.parse(t):e.type==="projectionDefinition"&&typeof t=="string"&&(r=se.parse(t)),{globalStateRefs:new Set,kind:"constant",evaluate:()=>r}}}function st(t){let e=null;if(t instanceof ct)e=st(t.result);else if(t instanceof dt){for(let r of t.args)if(e=st(r),e)break}else(t instanceof ft||t instanceof J)&&t.input instanceof le&&t.input.name==="zoom"&&(e=t);return e instanceof F||t.eachChild(r=>{let n=st(r);n instanceof F?e=n:!e&&n?e=new F("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):e&&n&&e!==n&&(e=new F("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),e}function Ft(t,e=new Set){return t instanceof Be&&e.add(t.key),t.eachChild(r=>{Ft(r,e)}),e}function _o(t){let e={color:K,string:k,number:m,enum:k,boolean:w,formatted:Et,padding:Mt,numberArray:Rt,colorArray:qe,projectionDefinition:zt,resolvedImage:Ze,variableAnchorOffsetCollection:Pt};return t.type==="array"?D(e[t.value]||b,t.length):e[t.type]}function Fo(t){if(t.type==="color"&&Nt(t.default))return new $(0,0,0,0);switch(t.type){case"color":return $.parse(t.default)||null;case"padding":return V.parse(t.default)||null;case"numberArray":return U.parse(t.default)||null;case"colorArray":return N.parse(t.default)||null;case"variableAnchorOffsetCollection":return X.parse(t.default)||null;case"projectionDefinition":return se.parse(t.default)||null;default:return t.default===void 0?null:t.default}}function Lt(t){if(t===!0||t===!1)return!0;if(!Array.isArray(t)||t.length===0)return!1;switch(t[0]){case"has":return t.length>=2&&t[1]!=="$id"&&t[1]!=="$type";case"in":return t.length>=3&&(typeof t[1]!="string"||Array.isArray(t[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return t.length!==3||Array.isArray(t[1])||Array.isArray(t[2]);case"any":case"all":for(let e of t.slice(1))if(!Lt(e)&&typeof e!="boolean")return!1;return!0;default:return!0}}var Lo={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function Ws(t){if(t==null)return{filter:()=>!0,needGeometry:!1,getGlobalStateRefs:()=>new Set};Lt(t)||(t=St(t));let e=_t(t,Lo);if(e.result==="error")throw new Error(e.value.map(r=>`${r.key}: ${r.message}`).join(", "));{let r=Un(t);return{filter:(n,i,a)=>e.value.evaluate(n,i,{},a),needGeometry:r,getGlobalStateRefs:()=>Ft(e.value.expression)}}}function Vo(t,e){return t<e?-1:t>e?1:0}function Un(t){if(!Array.isArray(t))return!1;if(t[0]==="within"||t[0]==="distance")return!0;for(let e=1;e<t.length;e++)if(Un(t[e]))return!0;return!1}function St(t){if(!t)return!0;let e=t[0];return t.length<=1?e!=="any":e==="=="?or(t[1],t[2],"=="):e==="!="?ot(or(t[1],t[2],"==")):e==="<"||e===">"||e==="<="||e===">="?or(t[1],t[2],e):e==="any"?Uo(t.slice(1)):e==="all"?["all"].concat(t.slice(1).map(St)):e==="none"?["all"].concat(t.slice(1).map(St).map(ot)):e==="in"?bn(t[1],t.slice(2)):e==="!in"?ot(bn(t[1],t.slice(2))):e==="has"?wn(t[1]):e==="!has"?ot(wn(t[1])):!0}function or(t,e,r){switch(t){case"$type":return[`filter-type-${r}`,e];case"$id":return[`filter-id-${r}`,e];default:return[`filter-${r}`,t,e]}}function Uo(t){return["any"].concat(t.map(St))}function bn(t,e){if(e.length===0)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(r=>typeof r!=typeof e[0])?["filter-in-large",t,["literal",e.sort(Vo)]]:["filter-in-small",t,["literal",e]]}}function wn(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function ot(t){return["!",t]}function We(t){return typeof t=="object"?["literal",t]:t}function Ks(t,e){let r=t.stops;if(!r)return Bo(t,e);let n=r&&typeof r[0][0]=="object",i=n||t.property!==void 0,a=n||!i;return r=r.map(o=>!i&&e.tokens&&typeof o[1]=="string"?[o[0],Wo(o[1])]:[o[0],We(o[1])]),n?Jo(t,e,r):a?Go(t,e,r):Or(t,e,r)}function Bo(t,e){let r=["get",t.property];if(t.default===void 0)return e.type==="string"?["string",r]:r;if(e.type==="enum")return["match",r,Object.keys(e.values),r,t.default];{let n=[e.type==="color"?"to-color":e.type,r,We(t.default)];return e.type==="array"&&n.splice(1,0,e.value,e.length||null),n}}function Cr(t){switch(t.colorSpace){case"hcl":return"interpolate-hcl";case"lab":return"interpolate-lab";default:return"interpolate"}}function Jo(t,e,r){let n={},i={},a=[];for(let s=0;s<r.length;s++){let l=r[s],u=l[0].zoom;n[u]===void 0&&(n[u]={zoom:u,type:t.type,property:t.property,default:t.default},i[u]=[],a.push(u)),i[u].push([l[0].value,l[1]])}if(jr({},e)==="exponential"){let s=[Cr(t),["linear"],["zoom"]];for(let l of a){let u=Or(n[l],e,i[l]);Se(s,l,u,!1)}return s}else{let s=["step",["zoom"]];for(let l of a){let u=Or(n[l],e,i[l]);Se(s,l,u,!0)}return qr(s),s}}function Ho(t,e){if(t!==void 0)return t;if(e!==void 0)return e}function xn(t,e){let r=We(Ho(t.default,e.default));return r===void 0&&e.type==="resolvedImage"?"":r}function Or(t,e,r){let n=jr(t,e),i=["get",t.property];if(n==="categorical"&&typeof r[0][0]=="boolean"){let a=["case"];for(let o of r)a.push(["==",i,o[0]],o[1]);return a.push(xn(t,e)),a}else if(n==="categorical"){let a=["match",i];for(let o of r)Se(a,o[0],o[1],!1);return a.push(xn(t,e)),a}else if(n==="interval"){let a=["step",["number",i]];for(let o of r)Se(a,o[0],o[1],!0);return qr(a),t.default===void 0?a:["case",["==",["typeof",i],"number"],a,We(t.default)]}else if(n==="exponential"){let a=t.base!==void 0?t.base:1,o=[Cr(t),a===1?["linear"]:["exponential",a],["number",i]];for(let s of r)Se(o,s[0],s[1],!1);return t.default===void 0?o:["case",["==",["typeof",i],"number"],o,We(t.default)]}else throw new Error(`Unknown property function type ${n}`)}function Go(t,e,r,n=["zoom"]){let i=jr(t,e),a,o=!1;if(i==="interval")a=["step",n],o=!0;else if(i==="exponential"){let s=t.base!==void 0?t.base:1;a=[Cr(t),s===1?["linear"]:["exponential",s],n]}else throw new Error(`Unknown zoom function type "${i}"`);for(let s of r)Se(a,s[0],s[1],o);return qr(a),a}function qr(t){t[0]==="step"&&t.length===3&&(t.push(0),t.push(t[3]))}function Se(t,e,r,n){t.length>3&&e===t[t.length-2]||(n&&t.length===2||t.push(e),t.push(r))}function jr(t,e){return t.type?t.type:e.expression.interpolated?"exponential":"interval"}function Wo(t){let e=["concat"],r=/{([^{}]+)}/g,n=0;for(let i=r.exec(t);i!==null;i=r.exec(t)){let a=t.slice(n,r.lastIndex-i[0].length);n=r.lastIndex,a.length>0&&e.push(a),e.push(["get",i[1]])}if(e.length===1)return t;if(n<t.length)e.push(t.slice(n));else if(e.length===2)return["to-string",e[1]];return e}function Bn(t){let e=t.key,r=t.value;return r?[new y(e,r,"constants have been deprecated as of v8")]:[]}function E(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}function me(t){if(Array.isArray(t))return t.map(me);if(t instanceof Object&&!(t instanceof Number||t instanceof String||t instanceof Boolean)){let e={};for(let r in t)e[r]=me(t[r]);return e}return E(t)}function L(t){let e=t.key,r=t.value,n=t.valueSpec||{},i=t.objectElementValidators||{},a=t.style,o=t.styleSpec,s=t.validateSpec,l=[],u=S(r);if(u!=="object")return[new y(e,r,`object expected, ${u} found`)];for(let c in r){let p=c.split(".")[0],f=Te(n,p)||n["*"],d;if(Te(i,p))d=i[p];else if(Te(n,p))d=s;else if(i["*"])d=i["*"];else if(n["*"])d=s;else{l.push(new y(e,r[c],`unknown property "${c}"`));continue}l=l.concat(d({key:(e&&`${e}.`)+c,value:r[c],valueSpec:f,style:a,styleSpec:o,object:r,objectKey:c,validateSpec:s},r))}for(let c in n)i[c]||n[c].required&&n[c].default===void 0&&r[c]===void 0&&l.push(new y(e,r,`missing required property "${c}"`));return l}function Nr(t){let e=t.value,r=t.valueSpec,n=t.validateSpec,i=t.style,a=t.styleSpec,o=t.key,s=t.arrayElementValidator||n;if(S(e)!=="array")return[new y(o,e,`array expected, ${S(e)} found`)];if(r.length&&e.length!==r.length)return[new y(o,e,`array length ${r.length} expected, length ${e.length} found`)];if(r["min-length"]&&e.length<r["min-length"])return[new y(o,e,`array length at least ${r["min-length"]} expected, length ${e.length} found`)];let l={type:r.value,values:r.values};a.$version<7&&(l.function=r.function),S(r.value)==="object"&&(l=r.value);let u=[];for(let c=0;c<e.length;c++)u=u.concat(s({array:e,arrayIndex:c,value:e[c],valueSpec:l,validateSpec:t.validateSpec,style:i,styleSpec:a,key:`${o}[${c}]`}));return u}function Vt(t){let e=t.key,r=t.value,n=t.valueSpec,i=S(r);return i==="number"&&r!==r&&(i="NaN"),i!=="number"?[new y(e,r,`number expected, ${i} found`)]:"minimum"in n&&r<n.minimum?[new y(e,r,`${r} is less than the minimum value ${n.minimum}`)]:"maximum"in n&&r>n.maximum?[new y(e,r,`${r} is greater than the maximum value ${n.maximum}`)]:[]}function Jn(t){let e=t.valueSpec,r=E(t.value.type),n,i={},a,o,s=r!=="categorical"&&t.value.property===void 0,l=!s,u=S(t.value.stops)==="array"&&S(t.value.stops[0])==="array"&&S(t.value.stops[0][0])==="object",c=L({key:t.key,value:t.value,valueSpec:t.styleSpec.function,validateSpec:t.validateSpec,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:p,default:h}});return r==="identity"&&s&&c.push(new y(t.key,t.value,'missing required property "property"')),r!=="identity"&&!t.value.stops&&c.push(new y(t.key,t.value,'missing required property "stops"')),r==="exponential"&&t.valueSpec.expression&&!Pr(t.valueSpec)&&c.push(new y(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(l&&!wt(t.valueSpec)?c.push(new y(t.key,t.value,"property functions not supported")):s&&!Fn(t.valueSpec)&&c.push(new y(t.key,t.value,"zoom functions not supported"))),(r==="categorical"||u)&&t.value.property===void 0&&c.push(new y(t.key,t.value,'"property" property is required')),c;function p(g){if(r==="identity")return[new y(g.key,g.value,'identity function may not have a "stops" property')];let O=[],v=g.value;return O=O.concat(Nr({key:g.key,value:v,valueSpec:g.valueSpec,validateSpec:g.validateSpec,style:g.style,styleSpec:g.styleSpec,arrayElementValidator:f})),S(v)==="array"&&v.length===0&&O.push(new y(g.key,v,"array must have at least one stop")),O}function f(g){let O=[],v=g.value,A=g.key;if(S(v)!=="array")return[new y(A,v,`array expected, ${S(v)} found`)];if(v.length!==2)return[new y(A,v,`array length 2 expected, length ${v.length} found`)];if(u){if(S(v[0])!=="object")return[new y(A,v,`object expected, ${S(v[0])} found`)];if(v[0].zoom===void 0)return[new y(A,v,"object stop key must have zoom")];if(v[0].value===void 0)return[new y(A,v,"object stop key must have value")];if(o&&o>E(v[0].zoom))return[new y(A,v[0].zoom,"stop zoom values must appear in ascending order")];E(v[0].zoom)!==o&&(o=E(v[0].zoom),a=void 0,i={}),O=O.concat(L({key:`${A}[0]`,value:v[0],valueSpec:{zoom:{}},validateSpec:g.validateSpec,style:g.style,styleSpec:g.styleSpec,objectElementValidators:{zoom:Vt,value:d}}))}else O=O.concat(d({key:`${A}[0]`,value:v[0],validateSpec:g.validateSpec,style:g.style,styleSpec:g.styleSpec},v));return Dt(me(v[1]))?O.concat([new y(`${A}[1]`,v[1],"expressions are not allowed in function stops.")]):O.concat(g.validateSpec({key:`${A}[1]`,value:v[1],valueSpec:e,validateSpec:g.validateSpec,style:g.style,styleSpec:g.styleSpec}))}function d(g,O){let v=S(g.value),A=E(g.value),j=g.value!==null?g.value:O;if(!n)n=v;else if(v!==n)return[new y(g.key,j,`${v} stop domain type must match previous stop domain type ${n}`)];if(v!=="number"&&v!=="string"&&v!=="boolean")return[new y(g.key,j,"stop domain value must be a number, string, or boolean")];if(v!=="number"&&r!=="categorical"){let ue=`number expected, ${v} found`;return wt(e)&&r===void 0&&(ue+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new y(g.key,j,ue)]}return r==="categorical"&&v==="number"&&(!isFinite(A)||Math.floor(A)!==A)?[new y(g.key,j,`integer expected, found ${A}`)]:r!=="categorical"&&v==="number"&&a!==void 0&&A<a?[new y(g.key,j,"stop domain values must appear in ascending order")]:(a=A,r==="categorical"&&A in i?[new y(g.key,j,"stop domain values must be unique")]:(i[A]=!0,[]))}function h(g){return g.validateSpec({key:g.key,value:g.value,valueSpec:e,validateSpec:g.validateSpec,style:g.style,styleSpec:g.styleSpec})}}function ze(t){let e=(t.expressionContext==="property"?Tr:_t)(me(t.value),t.valueSpec);if(e.result==="error")return e.value.map(n=>new y(`${t.key}${n.key}`,t.value,n.message));let r=e.value.expression||e.value._styleExpression.expression;if(t.expressionContext==="property"&&t.propertyKey==="text-font"&&!r.outputDefined())return[new y(t.key,t.value,`Invalid data expression for "${t.propertyKey}". Output values must be contained as literals within the expression.`)];if(t.expressionContext==="property"&&t.propertyType==="layout"&&!Je(r))return[new y(t.key,t.value,'"feature-state" data expressions are not supported with layout properties.')];if(t.expressionContext==="filter"&&!Je(r))return[new y(t.key,t.value,'"feature-state" data expressions are not supported with filters.')];if(t.expressionContext&&t.expressionContext.indexOf("cluster")===0){if(!jt(r,["zoom","feature-state"]))return[new y(t.key,t.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(t.expressionContext==="cluster-initial"&&!qt(r))return[new y(t.key,t.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function Ko(t){let e=t.value,r=t.key,n=S(e);return n!=="boolean"?[new y(r,e,`boolean expected, ${n} found`)]:[]}function $r(t){let e=t.key,r=t.value,n=S(r);return n!=="string"?[new y(e,r,`color expected, ${n} found`)]:$.parse(String(r))?[]:[new y(e,r,`color expected, "${r}" found`)]}function Ke(t){let e=t.key,r=t.value,n=t.valueSpec,i=[];return Array.isArray(n.values)?n.values.indexOf(E(r))===-1&&i.push(new y(e,r,`expected one of [${n.values.join(", ")}], ${JSON.stringify(r)} found`)):Object.keys(n.values).indexOf(E(r))===-1&&i.push(new y(e,r,`expected one of [${Object.keys(n.values).join(", ")}], ${JSON.stringify(r)} found`)),i}function Dr(t){return Lt(me(t.value))?ze(Oe({},t,{expressionContext:"filter",valueSpec:{value:"boolean"}})):Hn(t)}function Hn(t){let e=t.value,r=t.key;if(S(e)!=="array")return[new y(r,e,`array expected, ${S(e)} found`)];let n=t.styleSpec,i,a=[];if(e.length<1)return[new y(r,e,"filter array must have at least 1 element")];switch(a=a.concat(Ke({key:`${r}[0]`,value:e[0],valueSpec:n.filter_operator,style:t.style,styleSpec:t.styleSpec})),E(e[0])){case"<":case"<=":case">":case">=":e.length>=2&&E(e[1])==="$type"&&a.push(new y(r,e,`"$type" cannot be use with operator "${e[0]}"`));case"==":case"!=":e.length!==3&&a.push(new y(r,e,`filter array for operator "${e[0]}" must have 3 elements`));case"in":case"!in":e.length>=2&&(i=S(e[1]),i!=="string"&&a.push(new y(`${r}[1]`,e[1],`string expected, ${i} found`)));for(let o=2;o<e.length;o++)i=S(e[o]),E(e[1])==="$type"?a=a.concat(Ke({key:`${r}[${o}]`,value:e[o],valueSpec:n.geometry_type,style:t.style,styleSpec:t.styleSpec})):i!=="string"&&i!=="number"&&i!=="boolean"&&a.push(new y(`${r}[${o}]`,e[o],`string, number, or boolean expected, ${i} found`));break;case"any":case"all":case"none":for(let o=1;o<e.length;o++)a=a.concat(Hn({key:`${r}[${o}]`,value:e[o],style:t.style,styleSpec:t.styleSpec}));break;case"has":case"!has":i=S(e[1]),e.length!==2?a.push(new y(r,e,`filter array for "${e[0]}" operator must have 2 elements`)):i!=="string"&&a.push(new y(`${r}[1]`,e[1],`string expected, ${i} found`));break}return a}function Gn(t,e){let r=t.key,n=t.validateSpec,i=t.style,a=t.styleSpec,o=t.value,s=t.objectKey,l=a[`${e}_${t.layerType}`];if(!l)return[];let u=s.match(/^(.*)-transition$/);if(e==="paint"&&u&&l[u[1]]&&l[u[1]].transition)return n({key:r,value:o,valueSpec:a.transition,style:i,styleSpec:a});let c=t.valueSpec||l[s];if(!c)return[new y(r,o,`unknown property "${s}"`)];let p;if(S(o)==="string"&&wt(c)&&!c.tokens&&(p=/^{([^}]+)}$/.exec(o)))return[new y(r,o,`"${s}" does not support interpolation syntax
2
+ Use an identity property function instead: \`{ "type": "identity", "property": ${JSON.stringify(p[1])} }\`.`)];let f=[];return t.layerType==="symbol"&&(s==="text-field"&&i&&!i.glyphs&&f.push(new y(r,o,'use of "text-field" requires a style "glyphs" property')),s==="text-font"&&Nt(me(o))&&E(o.type)==="identity"&&f.push(new y(r,o,'"text-font" does not support identity functions'))),f.concat(n({key:t.key,value:o,valueSpec:c,style:i,styleSpec:a,expressionContext:"property",propertyType:e,propertyKey:s}))}function Wn(t){return Gn(t,"paint")}function Kn(t){return Gn(t,"layout")}function Zn(t){let e=[],r=t.value,n=t.key,i=t.style,a=t.styleSpec;if(S(r)!=="object")return[new y(n,r,`object expected, ${S(r)} found`)];!r.type&&!r.ref&&e.push(new y(n,r,'either "type" or "ref" is required'));let o=E(r.type),s=E(r.ref);if(r.id){let l=E(r.id);for(let u=0;u<t.arrayIndex;u++){let c=i.layers[u];E(c.id)===l&&e.push(new y(n,r.id,`duplicate layer id "${r.id}", previously used at line ${c.id.__line__}`))}}if("ref"in r){["type","source","source-layer","filter","layout"].forEach(u=>{u in r&&e.push(new y(n,r[u],`"${u}" is prohibited for ref layers`))});let l;i.layers.forEach(u=>{E(u.id)===s&&(l=u)}),l?l.ref?e.push(new y(n,r.ref,"ref cannot reference another ref layer")):o=E(l.type):e.push(new y(n,r.ref,`ref layer "${s}" not found`))}else if(o!=="background")if(!r.source)e.push(new y(n,r,'missing required property "source"'));else{let l=i.sources&&i.sources[r.source],u=l&&E(l.type);l?u==="vector"&&o==="raster"?e.push(new y(n,r.source,`layer "${r.id}" requires a raster source`)):u!=="raster-dem"&&o==="hillshade"?e.push(new y(n,r.source,`layer "${r.id}" requires a raster-dem source`)):u!=="raster-dem"&&o==="color-relief"?e.push(new y(n,r.source,`layer "${r.id}" requires a raster-dem source`)):u==="raster"&&o!=="raster"?e.push(new y(n,r.source,`layer "${r.id}" requires a vector source`)):u==="vector"&&!r["source-layer"]?e.push(new y(n,r,`layer "${r.id}" must specify a "source-layer"`)):u==="raster-dem"&&o!=="hillshade"&&o!=="color-relief"?e.push(new y(n,r.source,"raster-dem source can only be used with layer type 'hillshade' or 'color-relief'.")):o==="line"&&r.paint&&r.paint["line-gradient"]&&(u!=="geojson"||!l.lineMetrics)&&e.push(new y(n,r,`layer "${r.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):e.push(new y(n,r.source,`source "${r.source}" not found`))}return e=e.concat(L({key:n,value:r,valueSpec:a.layer,style:t.style,styleSpec:t.styleSpec,validateSpec:t.validateSpec,objectElementValidators:{"*"(){return[]},type(){return t.validateSpec({key:`${n}.type`,value:r.type,valueSpec:a.layer.type,style:t.style,styleSpec:t.styleSpec,validateSpec:t.validateSpec,object:r,objectKey:"type"})},filter:Dr,layout(l){return L({layer:r,key:l.key,value:l.value,style:l.style,styleSpec:l.styleSpec,validateSpec:l.validateSpec,objectElementValidators:{"*"(u){return Kn(Oe({layerType:o},u))}}})},paint(l){return L({layer:r,key:l.key,value:l.value,style:l.style,styleSpec:l.styleSpec,validateSpec:l.validateSpec,objectElementValidators:{"*"(u){return Wn(Oe({layerType:o},u))}}})}}})),e}function he(t){let e=t.value,r=t.key,n=S(e);return n!=="string"?[new y(r,e,`string expected, ${n} found`)]:[]}function Zo(t){var e;let r=(e=t.sourceName)!==null&&e!==void 0?e:"",n=t.value,i=t.styleSpec,a=i.source_raster_dem,o=t.style,s=[],l=S(n);if(n===void 0)return s;if(l!=="object")return s.push(new y("source_raster_dem",n,`object expected, ${l} found`)),s;let c=E(n.encoding)==="custom",p=["redFactor","greenFactor","blueFactor","baseShift"],f=t.value.encoding?`"${t.value.encoding}"`:"Default";for(let d in n)!c&&p.includes(d)?s.push(new y(d,n[d],`In "${r}": "${d}" is only valid when "encoding" is set to "custom". ${f} encoding found`)):a[d]?s=s.concat(t.validateSpec({key:d,value:n[d],valueSpec:a[d],validateSpec:t.validateSpec,style:o,styleSpec:i})):s.push(new y(d,n[d],`unknown property "${d}"`));return s}var kn={promoteId:Xo};function Xn(t){let e=t.value,r=t.key,n=t.styleSpec,i=t.style,a=t.validateSpec;if(!e.type)return[new y(r,e,'"type" is required')];let o=E(e.type),s;switch(o){case"vector":case"raster":return s=L({key:r,value:e,valueSpec:n[`source_${o.replace("-","_")}`],style:t.style,styleSpec:n,objectElementValidators:kn,validateSpec:a}),s;case"raster-dem":return s=Zo({sourceName:r,value:e,style:t.style,styleSpec:n,validateSpec:a}),s;case"geojson":if(s=L({key:r,value:e,valueSpec:n.source_geojson,style:i,styleSpec:n,validateSpec:a,objectElementValidators:kn}),e.cluster)for(let l in e.clusterProperties){let[u,c]=e.clusterProperties[l],p=typeof u=="string"?[u,["accumulated"],["get",l]]:u;s.push(...ze({key:`${r}.${l}.map`,value:c,expressionContext:"cluster-map"})),s.push(...ze({key:`${r}.${l}.reduce`,value:p,expressionContext:"cluster-reduce"}))}return s;case"video":return L({key:r,value:e,valueSpec:n.source_video,style:i,validateSpec:a,styleSpec:n});case"image":return L({key:r,value:e,valueSpec:n.source_image,style:i,validateSpec:a,styleSpec:n});case"canvas":return[new y(r,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return Ke({key:`${r}.type`,value:e.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]}})}}function Xo({key:t,value:e}){if(S(e)==="string")return he({key:t,value:e});{let r=[];for(let n in e)r.push(...he({key:`${t}.${n}`,value:e[n]}));return r}}function Yn(t){let e=t.value,r=t.styleSpec,n=r.light,i=t.style,a=[],o=S(e);if(e===void 0)return a;if(o!=="object")return a=a.concat([new y("light",e,`object expected, ${o} found`)]),a;for(let s in e){let l=s.match(/^(.*)-transition$/);l&&n[l[1]]&&n[l[1]].transition?a=a.concat(t.validateSpec({key:s,value:e[s],valueSpec:r.transition,validateSpec:t.validateSpec,style:i,styleSpec:r})):n[s]?a=a.concat(t.validateSpec({key:s,value:e[s],valueSpec:n[s],validateSpec:t.validateSpec,style:i,styleSpec:r})):a=a.concat([new y(s,e[s],`unknown property "${s}"`)])}return a}function Qn(t){let e=t.value,r=t.styleSpec,n=r.sky,i=t.style,a=S(e);if(e===void 0)return[];if(a!=="object")return[new y("sky",e,`object expected, ${a} found`)];let o=[];for(let s in e)n[s]?o=o.concat(t.validateSpec({key:s,value:e[s],valueSpec:n[s],style:i,styleSpec:r})):o=o.concat([new y(s,e[s],`unknown property "${s}"`)]);return o}function ei(t){let e=t.value,r=t.styleSpec,n=r.terrain,i=t.style,a=[],o=S(e);if(e===void 0)return a;if(o!=="object")return a=a.concat([new y("terrain",e,`object expected, ${o} found`)]),a;for(let s in e)n[s]?a=a.concat(t.validateSpec({key:s,value:e[s],valueSpec:n[s],validateSpec:t.validateSpec,style:i,styleSpec:r})):a=a.concat([new y(s,e[s],`unknown property "${s}"`)]);return a}function Yo(t){return he(t).length===0?[]:ze(t)}function Qo(t){return he(t).length===0?[]:ze(t)}function es(t){let e=t.key,r=t.value;if(S(r)==="array"){if(r.length<1||r.length>4)return[new y(e,r,`padding requires 1 to 4 values; ${r.length} values found`)];let i={type:"number"},a=[];for(let o=0;o<r.length;o++)a=a.concat(t.validateSpec({key:`${e}[${o}]`,value:r[o],validateSpec:t.validateSpec,valueSpec:i}));return a}else return Vt({key:e,value:r,valueSpec:{}})}function ts(t){let e=t.key,r=t.value;if(S(r)==="array"){let i={type:"number"};if(r.length<1)return[new y(e,r,"array length at least 1 expected, length 0 found")];let a=[];for(let o=0;o<r.length;o++)a=a.concat(t.validateSpec({key:`${e}[${o}]`,value:r[o],validateSpec:t.validateSpec,valueSpec:i}));return a}else return Vt({key:e,value:r,valueSpec:{}})}function rs(t){let e=t.key,r=t.value;if(S(r)==="array"){if(r.length<1)return[new y(e,r,"array length at least 1 expected, length 0 found")];let i=[];for(let a=0;a<r.length;a++)i=i.concat($r({key:`${e}[${a}]`,value:r[a]}));return i}else return $r({key:e,value:r})}function ns(t){let e=t.key,r=t.value,n=S(r),i=t.styleSpec;if(n!=="array"||r.length<1||r.length%2!==0)return[new y(e,r,"variableAnchorOffsetCollection requires a non-empty array of even length")];let a=[];for(let o=0;o<r.length;o+=2)a=a.concat(Ke({key:`${e}[${o}]`,value:r[o],valueSpec:i.layout_symbol["text-anchor"]})),a=a.concat(Nr({key:`${e}[${o+1}]`,value:r[o+1],valueSpec:{length:2,value:"number"},validateSpec:t.validateSpec,style:t.style,styleSpec:i}));return a}function ti(t){let e=[],r=t.value,n=t.key;if(Array.isArray(r)){let i=[],a=[];for(let o in r){r[o].id&&i.includes(r[o].id)&&e.push(new y(n,r,`all the sprites' ids must be unique, but ${r[o].id} is duplicated`)),i.push(r[o].id),r[o].url&&a.includes(r[o].url)&&e.push(new y(n,r,`all the sprites' URLs must be unique, but ${r[o].url} is duplicated`)),a.push(r[o].url);let s={id:{type:"string",required:!0},url:{type:"string",required:!0}};e=e.concat(L({key:`${n}[${o}]`,value:r[o],valueSpec:s,validateSpec:t.validateSpec}))}return e}else return he({key:n,value:r})}function is(t){let e=t.value,r=t.styleSpec,n=r.projection,i=t.style,a=S(e);if(e===void 0)return[];if(a!=="object")return[new y("projection",e,`object expected, ${a} found`)];let o=[];for(let s in e)n[s]?o=o.concat(t.validateSpec({key:s,value:e[s],valueSpec:n[s],style:i,styleSpec:r})):o=o.concat([new y(s,e[s],`unknown property "${s}"`)]);return o}function as(t){let e=t.key,r=t.value;r=r instanceof String?r.valueOf():r;let n=S(r);return n==="array"&&!ss(r)&&!os(r)?[new y(e,r,`projection expected, invalid array ${JSON.stringify(r)} found`)]:["array","string"].includes(n)?[]:[new y(e,r,`projection expected, invalid type "${n}" found`)]}function os(t){return!!["interpolate","step","literal"].includes(t[0])}function ss(t){return Array.isArray(t)&&t.length===3&&typeof t[0]=="string"&&typeof t[1]=="string"&&typeof t[2]=="number"}function ls(t){return!!t&&t.constructor===Object}function ri(t){return ls(t.value)?[]:[new y(t.key,t.value,`object expected, ${S(t.value)} found`)]}var Sn={"*"(){return[]},array:Nr,boolean:Ko,number:Vt,color:$r,constants:Bn,enum:Ke,filter:Dr,function:Jn,layer:Zn,object:L,source:Xn,light:Yn,sky:Qn,terrain:ei,projection:is,projectionDefinition:as,string:he,formatted:Yo,resolvedImage:Qo,padding:es,numberArray:ts,colorArray:rs,variableAnchorOffsetCollection:ns,sprite:ti,state:ri};function Ot(t){let e=t.value,r=t.valueSpec,n=t.styleSpec;return t.validateSpec=Ot,r.expression&&Nt(E(e))?Jn(t):r.expression&&Dt(me(e))?ze(t):r.type&&Sn[r.type]?Sn[r.type](t):L(Oe({},t,{valueSpec:r.type?n[r.type]:r}))}function ni(t){let e=t.value,r=t.key,n=he(t);return n.length||(e.indexOf("{fontstack}")===-1&&n.push(new y(r,e,'"glyphs" url must include a "{fontstack}" token')),e.indexOf("{range}")===-1&&n.push(new y(r,e,'"glyphs" url must include a "{range}" token'))),n}function _(t,e=$t){let r=[];return r=r.concat(Ot({key:"",value:t,valueSpec:e.$root,styleSpec:e,style:t,validateSpec:Ot,objectElementValidators:{glyphs:ni,"*"(){return[]}}})),t.constants&&(r=r.concat(Bn({key:"constants",value:t.constants}))),ii(r)}_.source=G(H(Xn));_.sprite=G(H(ti));_.glyphs=G(H(ni));_.light=G(H(Yn));_.sky=G(H(Qn));_.terrain=G(H(ei));_.state=G(H(ri));_.layer=G(H(Zn));_.filter=G(H(Dr));_.paintProperty=G(H(Wn));_.layoutProperty=G(H(Kn));function H(t){return function(e){return t(R(x({},e),{validateSpec:Ot}))}}function ii(t){return[].concat(t).sort((e,r)=>e.line-r.line)}function G(t){return function(...e){return ii(t.apply(this,e))}}var Zs=$t,Xs={StyleExpression:xt,StylePropertyFunction:kt,ZoomConstantExpression:He,ZoomDependentExpression:Ge,createExpression:_t,createPropertyExpression:Tr,isExpression:Dt,isExpressionFilter:Lt,isZoomExpression:No,normalizePropertyExpression:Do};function ai(t,e){if(typeof t!="string"||t.length===0)return null;let r=n=>{try{return new URL(n.replace(/\{[a-z]+\}/g,"0"))}catch(i){return null}};if(t.startsWith("/")&&!t.startsWith("//")){let n=r(e)?.origin;if(!n||n==="null")return null;let i=`${n}${t}`;return r(i)?.origin===n?{url:i,credentials:"include"}:null}return/^https:\/\//i.test(t)&&r(t)?.protocol==="https:"?{url:t,credentials:"omit"}:null}function tl(t,e,r,n){return t.replace(/\{z\}/g,String(e)).replace(/\{x\}/g,String(r)).replace(/\{y\}/g,String(n))}var Y=t=>!!t&&typeof t=="object"&&!Array.isArray(t);function rl(t){if(!Y(t)||t.version!==8)return null;let e=t.sources,r=t.layers;if(!Y(e)||!Array.isArray(r)||!Object.values(e).every(Y))return null;let n=new Set;for(let a of r){if(!Y(a)||typeof a.id!="string"||n.has(a.id))return null;n.add(a.id)}let i=Y(t.state)?t.state:void 0;return structuredClone(R(x({version:8},i?{state:i}:{}),{sources:e,layers:r}))}function oi(t,e){let r={};for(let[n,i]of Object.entries(t.state??{}))r[n]=Y(i)?i.default??null:null;return x(x({},r),e)}function Qe(t,e){if(Array.isArray(t)){if(t[0]==="literal")return t;if(t[0]==="global-state"&&typeof t[1]=="string"){let r=t[1];return["get",r,["literal",{[r]:e[r]??null}]]}return t.map(r=>Qe(r,e))}return Y(t)?Object.fromEntries(Object.entries(t).map(([r,n])=>[r,Qe(n,e)])):t}function nl(t,e){let r=x({},t);return t.paint&&(r.paint=Qe(t.paint,e)),t.layout&&(r.layout=Qe(t.layout,e)),t.filter!==void 0&&(r.filter=Qe(t.filter,e)),r}var us={r:256,g:1,b:1/256,base:32768},cs={r:6553.6,g:25.6,b:.1,base:1e4},ge=(t,e)=>typeof t=="number"&&Number.isFinite(t)?t:e;function ps(t){return Array.isArray(t)&&t.length===4&&t.every(e=>typeof e=="number"&&Number.isFinite(e))?t:void 0}function fs(t,e){if(t.url!==void 0&&t.tiles===void 0)return"a TileJSON url is not supported; list the tiles";if(t.scheme==="tms")return'scheme "tms" is not supported';let r=t.tiles;if(!Array.isArray(r)||r.length===0)return"no tiles";let n=r.map(o=>typeof o=="string"?/\{(?![zxy]\})[^}]*\}/.exec(o):null).find(o=>o);if(n)return`tile placeholder ${n[0]} is not supported`;let i=r.map(o=>ai(o,e));if(i.some(o=>o===null))return"a tile URL is neither server-relative nor https";let a=i;return a.some(o=>o.credentials!==a[0].credentials)?"tile URLs mix the server and other hosts":{tiles:a.map(o=>o.url),credentials:a[0].credentials}}function ds(t,e){if(!Y(t))return{error:"not a source"};let r=t.type;if(r==="raster-dem"||r==="raster"||r==="vector"){let n=fs(t,e);if(typeof n=="string")return{error:n};let i={minzoom:ge(t.minzoom,0),maxzoom:ge(t.maxzoom,22),bounds:ps(t.bounds)};if(r==="vector")return t.encoding!==void 0&&t.encoding!=="mvt"?{error:`encoding "${String(t.encoding)}"`}:x(x({type:r},n),i);let a=ge(t.tileSize,512);if(r==="raster")return x(R(x({type:r},n),{tileSize:a}),i);let o=t.encoding??"mapbox",s;if(o==="terrarium")s=us;else if(o==="mapbox")s=cs;else if(o==="custom")s={r:ge(t.redFactor,1),g:ge(t.greenFactor,1),b:ge(t.blueFactor,1),base:ge(t.baseShift,0)};else return{error:`encoding "${String(o)}"`};return R(x(R(x({type:r},n),{tileSize:a}),i),{encoding:s})}if(r==="geojson"){if(t.cluster===!0)return{error:"clustering"};if(t.filter!==void 0)return{error:"a source filter"};let n=t.data;if(typeof n=="string"){let i=ai(n,e);return i?{type:r,url:i}:{error:"the data URL is neither server-relative nor https"}}return Y(n)?{type:r,data:n}:{error:"no data"}}return{error:`source type "${String(r)}"`}}function si(t,e){return Object.fromEntries(Object.entries(t.sources).map(([r,n])=>[r,ds(n,e)]))}var ys={"color-relief":["raster-dem"],raster:["raster"],fill:["vector","geojson"],line:["vector","geojson"],circle:["vector","geojson"],symbol:["vector","geojson"]},ms={"color-relief":{paint:["color-relief-color","color-relief-opacity","resampling"],layout:[]},raster:{paint:["raster-opacity","raster-resampling","raster-fade-duration"],layout:[]},fill:{paint:["fill-color","fill-opacity","fill-outline-color"],layout:[]},line:{paint:["line-color","line-width","line-opacity","line-dasharray"],layout:["line-cap","line-join","line-miter-limit"]},circle:{paint:["circle-color","circle-radius","circle-opacity","circle-stroke-color","circle-stroke-width","circle-stroke-opacity","circle-translate"],layout:[]},symbol:{paint:["text-color","text-halo-color","text-halo-width","text-opacity","text-translate"],layout:["symbol-placement","symbol-spacing","text-field","text-font","text-size","text-anchor","text-justify","text-max-width","text-letter-spacing","text-line-height","text-offset","text-rotate","text-rotation-alignment","text-padding","text-transform","text-keep-upright","text-max-angle","text-allow-overlap","text-ignore-placement","text-optional","text-pitch-alignment","icon-pitch-alignment"]}},hs=new Set(["image","within","distance"]);function _r(t){if(Array.isArray(t)){if(t[0]==="literal")return null;if(typeof t[0]=="string"&&hs.has(t[0]))return t[0];for(let e of t){let r=_r(e);if(r)return r}}else if(Y(t))for(let e of Object.values(t)){let r=_r(e);if(r)return r}return null}function gs(t){if(typeof t!="string")return null;let e=$.parse(t);if(!e)return null;let r=n=>e.a>0?Math.round(n/e.a*255):0;return[r(e.r),r(e.g),r(e.b),e.a]}function vs(t){if(t===void 0)return"color-relief-color is required";if(!Array.isArray(t)||t[0]!=="interpolate"||JSON.stringify(t[1])!=='["linear"]'||JSON.stringify(t[2])!=='["elevation"]')return'color-relief-color must be ["interpolate", ["linear"], ["elevation"], \u2026]';let e=t.slice(3);if(e.length<2||e.length%2!==0)return"color-relief-color needs stop/colour pairs";let r=[],n=[];for(let i=0;i<e.length;i+=2){let a=e[i],o=gs(e[i+1]);if(typeof a!="number"||!Number.isFinite(a))return"color-relief-color stops must be literal numbers";if(r.length&&a<=r[r.length-1])return"color-relief-color stops must ascend";if(!o)return"color-relief-color colours must be literal colours";r.push(a),n.push(o)}return{stops:r,colors:n}}var te=(t,e)=>({drawable:!1,reason:t,detail:e}),bs="https://glyphs.invalid/{fontstack}/{range}.pbf";function Fr(t,e,r){let n=ys[e.type];if(!n)return te("layerType",e.type);let i=typeof e.source=="string"?r[e.source]:void 0;if(!i)return te("source",`no source "${String(e.source)}"`);if("error"in i)return te("source",i.error);if(!n.includes(i.type))return te("source",`${e.type} cannot draw a ${i.type} source`);let a=x({},e.paint??{});if(e.type==="color-relief"&&"resampling"in a){if(a.resampling!=="linear"&&a.resampling!=="nearest")return te("property",'resampling must be "linear" or "nearest"');delete a.resampling}let o=_(R(x({version:8,glyphs:bs},t.state?{state:t.state}:{}),{sources:{[e.source]:t.sources[e.source]},layers:[R(x({},e),{paint:a})]})).filter(u=>u.message.startsWith("layers["));if(o.length)return te("property",o[0].message.replace(/^layers\[0\]\./,""));let s=ms[e.type];for(let u of["paint","layout"]){let c=e[u]??{},p=$t[`${u}_${e.type}`];for(let[f,d]of Object.entries(c))if(!(f==="visibility"||s[u].includes(f))&&JSON.stringify(d)!==JSON.stringify(p?.[f]?.default))return te("property",f)}let l=_r([e.paint,e.layout,e.filter]);if(l)return te("property",`the "${l}" expression`);if(e.type==="color-relief"){let u=vs(e.paint?.["color-relief-color"]);if(typeof u=="string")return te("property",u)}return{drawable:!0}}var T=class extends Error{constructor(r,n){super(n);this.reason=r}reason},ws=(t,e)=>P(null,null,function*(){let r=yield fetch(t.url,{credentials:t.credentials,cache:e?"reload":"default"});if(!r.ok)throw new Error(`HTTP ${r.status} for ${t.url}`);return r.json()}),xs=new Set(["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon","GeometryCollection"]),Ut=t=>!!t&&typeof t=="object"&&!Array.isArray(t),ui=t=>Ut(t)&&t.type==="Feature";function Lr(t){return Ut(t)?t.type==="FeatureCollection"&&Array.isArray(t.features)?t.features.filter(ui):t.type==="Feature"?[t]:typeof t.type=="string"&&xs.has(t.type)?[{type:"Feature",geometry:t,properties:{}}]:null:null}var Vr=t=>typeof t=="string"||typeof t=="number"&&Number.isFinite(t),re=t=>structuredClone(t),Ur=(t,e,r)=>`${t}/${e}/${r}`,li=class{constructor(e,r,n=ws){this.style=e;this.load=n;this.sources=si(e,r);for(let i of e.layers)this.declared.set(i.id,i),this.current.set(i.id,re(i)),this.verdicts.set(i.id,Fr(e,i,this.sources));for(let[i,a]of Object.entries(this.sources))"error"in a||a.type!=="geojson"||this.geojson.set(i,{url:a.url,features:a.url?null:this.index(Lr(a.data)??[]),generation:0,pending:[],reload:!1})}style;load;sources;declared=new Map;current=new Map;verdicts=new Map;state={};geojson=new Map;freshness=new Map;listeners=new Set;layers(){return[...this.current.values()]}layer(e){return this.current.get(e)}isDrawn(e){return this.verdicts.get(e)?.drawable===!0}skippedLayers(){let e=[];for(let[r,n]of this.verdicts)!n.drawable&&n.reason&&e.push(x({id:r,reason:n.reason},n.detail?{detail:n.detail}:{}));return e}globalState(){return oi(this.style,this.state)}subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)}emit(e){for(let r of[...this.listeners])r(e)}source(e){let r=typeof e=="string"?this.sources[e]:void 0;if(!r)throw new T("overlays.badRequest",`The overlay's style has no source "${String(e)}"`);return r}setLayer(e){let r=e.layer,n=typeof r=="string"?this.declared.get(r):void 0;if(!n)throw new T("overlays.badRequest",`The overlay's style has no layer "${String(r)}"`);for(let o of["paint","layout"])if(e[o]!==void 0&&!Ut(e[o]))throw new T("overlays.badRequest",`\`${o}\` must be an object of properties`);if("filter"in e&&e.filter!==null&&!Array.isArray(e.filter))throw new T("overlays.badRequest","`filter` must be an array or null");let i=re(this.current.get(n.id));for(let o of["paint","layout"]){let s=e[o];if(!s)continue;let l=x({},i[o]??{});for(let[u,c]of Object.entries(s))c!==null?l[u]=re(c):n[o]&&u in n[o]?l[u]=re(n[o][u]):delete l[u];i[o]=l}"filter"in e&&(e.filter===null?delete i.filter:i.filter=re(e.filter));let a=Fr(this.style,i,this.sources);if(!a.drawable)throw new T("overlays.unsupported",`Layer "${n.id}" would not be drawn: ${a.reason}`+(a.detail?` (${a.detail})`:""));this.current.set(n.id,i),this.verdicts.set(n.id,a),this.emit({kind:"layers",layers:[n.id]})}setState(e){if(!Ut(e))throw new T("overlays.badRequest","`values` must be an object of variable values");let r=x({},this.state);for(let[n,i]of Object.entries(e))i===null?delete r[n]:r[n]=re(i);this.state=r,this.emit({kind:"state"})}geojsonSource(e){let r=this.source(e),n=this.geojson.get(e);if(!n)throw new T("overlays.badRequest",`Source "${String(e)}" is not a usable geojson source`+("error"in r?` (${r.error})`:""));return n}index(e){let r=new Map;for(let n of e)r.set(Vr(n.id)?n.id:Symbol(),n);return r}setData(e){let r=this.geojsonSource(e.source),n=e.source,i=e.data!==void 0,a=e.upsert!==void 0||e.remove!==void 0;if(i===a)throw new T("overlays.badRequest",i?"`data` cannot be combined with `upsert` or `remove`":"Give `data`, or `upsert` and/or `remove`");if(i){let u=Lr(e.data);if(!u)throw new T("overlays.badRequest","`data` must be a GeoJSON object");let c=re(u);r.url=void 0,r.generation++,r.loading=void 0,r.pending=[],r.features=this.index(c),this.emit({kind:"data",source:n,replace:c});return}let o=e.upsert??[],s=e.remove??[];if(!Array.isArray(o)||!o.every(u=>ui(u)&&Vr(u.id)))throw new T("overlays.badRequest","`upsert` must be a list of GeoJSON features, each with an `id`");if(!Array.isArray(s)||!s.every(Vr))throw new T("overlays.badRequest","`remove` must be a list of feature ids");let l={upsert:re(o),remove:s};(r.loading||!r.features)&&r.pending.push(l),r.features&&(this.applyDiff(r.features,l),this.emit(x({kind:"data",source:n},l)))}applyDiff(e,r){for(let n of r.remove??[])e.delete(n);for(let n of r.upsert??[])e.set(n.id,n)}features(e){return P(this,null,function*(){let r=this.geojson.get(e);return r?r.features?[...r.features.values()]:this.loadUrl(e,r):[]})}loadUrl(e,r){if(r.loading)return r.loading;let n=r.url,i=r.generation,a=r.reload;r.reload=!1;let o=this.load(n,a).then(s=>Lr(s)??[]).catch(s=>(console.warn(`[plotterext] could not load ${n.url}:`,s),null)).then(s=>{if(r.generation!==i)return this.features(e);r.loading=void 0;let l=s===null&&r.features?new Map(r.features):this.index(s??[]);for(let p of r.pending)this.applyDiff(l,p);r.pending=[];let u=!r.features;r.features=l;let c=[...l.values()];return u||this.emit({kind:"data",source:e,replace:c}),c});return r.loading=o,o}refresh(e){let r=this.source(e.source),n=e.source;if("error"in r)throw new T("overlays.badRequest",`Source "${n}" is not drawn (${r.error})`);let i=e.tiles;if(r.type==="geojson"){if(i!==void 0)throw new T("overlays.badRequest","`tiles` applies to tiled sources only");let o=this.geojson.get(n);if(!o.url)return;o.generation++,o.loading=void 0,o.reload=!0,o.features&&this.loadUrl(n,o);return}if(i!==void 0&&!this.validTiles(i))throw new T("overlays.badRequest","`tiles` must be a list of [z, x, y] tiles that exist at zoom z");let a=this.tileFreshness(n);if(i===void 0)a.all=!0,a.dirty.clear(),a.loadedSinceAll.clear();else for(let[o,s,l]of i){let u=Ur(o,s,l);a.dirty.add(u),a.loadedSinceAll.delete(u)}this.emit(x({kind:"refresh",source:n},i!==void 0?{tiles:re(i)}:{}))}validTiles(e){return Array.isArray(e)&&e.every(r=>{if(!Array.isArray(r)||r.length!==3||!r.every(o=>Number.isInteger(o)&&o>=0))return!1;let[n,i,a]=r;return n<=30&&i<2**n&&a<2**n})}tileFreshness(e){let r=this.freshness.get(e);return r||(r={dirty:new Set,all:!1,loadedSinceAll:new Set},this.freshness.set(e,r)),r}needsReload(e,r,n,i){let a=this.freshness.get(e);if(!a)return!1;let o=Ur(r,n,i);return a.dirty.has(o)||a.all&&!a.loadedSinceAll.has(o)}markLoaded(e,r,n,i){let a=this.freshness.get(e);if(!a)return;let o=Ur(r,n,i);a.dirty.delete(o),a.all&&a.loadedSinceAll.add(o)}};function et(t,e,r){return P(this,null,function*(){let{Check:n,Errors:i}=yield import("./chunk-2H73O7R4.js");if(n(t,e))return e;let[a]=i(t,e),o=a.keyword==="required"?`${a.instancePath}/${a.params.requiredProperties[0]} is required`:`${a.instancePath||"params"} ${a.message}`;throw new q(o,{code:C.INVALID_PARAMS,reason:r})})}var Jt=()=>import("./chunk-CJARACLQ.js"),Me="overlays.badRequest",ks=t=>new q(t,{code:C.INVALID_PARAMS,reason:Me});function Ss(t){return t instanceof W||t instanceof T?t.reason===Me?ks(t.message):new q(t.message,{reason:t.reason}):t}function Os(t){if(typeof ImageBitmap<"u")return t instanceof ImageBitmap;let e=t;return!!e&&typeof e=="object"&&Number.isInteger(e.width)&&Number.isInteger(e.height)&&typeof e.close=="function"}function $s(t){return P(this,null,function*(){try{let{overlayId:e,requestId:r,extent:n,image:i}=yield et((yield Jt()).FrameParams,t,Me);return{overlayId:e,requestId:r,extent:n,image:i}}catch(e){let r=t?.image;throw Os(r)&&r.close(),e}})}function Bt(t){return P(this,null,function*(){return et((yield Jt()).DataParams,t,Me)})}function gl(t,e,r){let n=i=>a=>P(null,null,function*(){try{return yield i(a)}catch(o){throw Ss(o)}});return{"overlay.list":n(()=>({overlays:t.list(e)})),"overlay.setVisibility":n(i=>P(null,null,function*(){let{ids:a,visible:o}=yield et((yield Jt()).SetVisibilityParams,i,Me);return t.requireOwn(e,a),t.setVisibility(a.map(s=>be(e,s)),o),{}})),"overlay.setOpacity":n(i=>P(null,null,function*(){let{ids:a,opacity:o}=yield et((yield Jt()).SetOpacityParams,i,Me);return t.requireOwn(e,a),t.setOpacity(a.map(s=>be(e,s)),o),{}})),"overlay.frame":n(i=>P(null,null,function*(){return t.acceptFrame(e,r,yield $s(i))})),"overlay.refresh":n(i=>P(null,null,function*(){let a=yield Bt(i);return t.dataModel(e,a.overlayId).refresh({source:a.source,tiles:a.tiles}),{}})),"overlay.setData":n(i=>P(null,null,function*(){let a=yield Bt(i);return t.dataModel(e,a.overlayId).setData({source:a.source,data:a.data,upsert:a.upsert,remove:a.remove}),{}})),"overlay.setLayer":n(i=>P(null,null,function*(){let a=yield Bt(i);return t.dataModel(e,a.overlayId).setLayer(x({layer:a.layer,paint:a.paint,layout:a.layout},"filter"in a?{filter:a.filter}:{})),{}})),"overlay.setState":n(i=>P(null,null,function*(){let a=yield Bt(i);return t.dataModel(e,a.overlayId).setState(a.values),{}}))}}export{C as a,q as b,tt as c,ci as d,gi as e,bi as f,wi as g,et as h,be as i,tn as j,$t as k,Gs as l,$ as m,Rr as n,le as o,Nt as p,Dt as q,Tr as r,Ws as s,Ks as t,Zs as u,Xs as v,ai as w,tl as x,rl as y,nl as z,vs as A,ws as B,li as C,Os as D,gl as E};
@@ -0,0 +1 @@
1
+ import{a as t}from"./chunk-7ISDSY26.js";import"./chunk-V3SPESMB.js";import"./chunk-BZGM3F3K.js";var n=t.Object({type:t.String({minLength:1}),ids:t.Array(t.String({minLength:1}),{minItems:1})});export{n as DisplayParams};
@@ -1 +1 @@
1
- import{a as t}from"./chunk-MWETYHR7.js";import"./chunk-WARJYBQ7.js";import"./chunk-BZGM3F3K.js";var r=t.Object({id:t.String({minLength:1})});export{r as ApplyParams};
1
+ import{a as t}from"./chunk-7ISDSY26.js";import"./chunk-V3SPESMB.js";import"./chunk-BZGM3F3K.js";var r=t.Object({id:t.String({minLength:1})});export{r as ApplyParams};
@@ -1,2 +1,2 @@
1
- import{a as S}from"./chunk-7PF3OZ2P.js";import{Ha as ce,Ia as pe,bc as de,l as Q,m as Y,n as Z,o as ee,p as te,v as oe,wa as le,xa as re,y as se}from"./chunk-S3D6SFT3.js";import{a as ie,b as ne,c as ae}from"./chunk-YBVURHD5.js";import"./chunk-CI2BDMX2.js";import{a as z,b as q}from"./chunk-DSUCHYD7.js";import{j as B,k as j,l as H}from"./chunk-MZ3YWFFB.js";import"./chunk-SIFYI3HU.js";import{a as J}from"./chunk-GJZ7P5CR.js";import"./chunk-RENDTMDT.js";import"./chunk-DN6IX7CO.js";import"./chunk-ZQSUYMH2.js";import{j as N,o as U}from"./chunk-DC5AFSD6.js";import{$a as $,Fa as X,Ga as R,Ja as O,La as W,Na as V,Oa as F,Wa as K,Ya as A,i as E,rb as L}from"./chunk-2QKJQDG4.js";import"./chunk-LEEF5WZZ.js";import"./chunk-7FANVIZX.js";import"./chunk-K4EGDHPT.js";import"./chunk-RYULE37H.js";import{$b as I,Db as f,Hb as u,Jb as p,Oa as r,Tb as T,Wa as D,X as y,Yb as c,Zb as P,_a as M,_b as G,ba as m,ca as h,nb as g,ob as x,qb as b,rb as v,sb as w,tb as _,ub as a,vb as s,wb as C}from"./chunk-R6ABX6RX.js";import"./chunk-MWETYHR7.js";import"./chunk-WARJYBQ7.js";import{g as k}from"./chunk-BZGM3F3K.js";function _e(l,e){if(l&1){let t=f();a(0,"button",11),u("click",function(){m(t);let i=p();return h(i.load())}),a(1,"mat-icon"),c(2,"file_upload"),s(),c(3," \xA0Load "),s()}if(l&2){let t=p();_("disabled",!t.display.loadRoutesOK&&!t.display.loadWaypointsOK&&!t.display.loadTracksOK)}}function ue(l,e){l&1&&(a(0,"div",10)(1,"div")(2,"b"),c(3,"Invalid GPX Data:"),s(),C(4,"br")(5,"br"),a(6,"i"),c(7,"Selected file does not contain GPX data or"),C(8,"br"),c(9," does not correctly implement namespaced <extensions> attributes."),s()()())}function fe(l,e){l&1&&C(0,"mat-progress-bar",12)}function ge(l,e){if(l&1){let t=f();a(0,"div",23)(1,"div",24),c(2),s(),a(3,"div",25)(4,"mat-checkbox",26,0),u("change",function(){let i=m(t).$index,o=T(5),d=p(4);return h(d.checkWpt(o.checked,i))}),s()()()}if(l&2){let t=e.$implicit,n=e.$index,i=p(4);r(2),P(t.name),r(2),_("checked",i.selWaypoints[n])}}function xe(l,e){if(l&1){let t=f();a(0,"div",13)(1,"mat-expansion-panel",16),u("opened",function(){m(t);let i=p(3);return h(i.display.expand.waypoints=!0)})("closed",function(){m(t);let i=p(3);return h(i.display.expand.waypoints=!1)}),a(2,"mat-expansion-panel-header",17)(3,"mat-panel-title")(4,"mat-icon",18),c(5,"place"),s(),c(6," \xA0\xA0 "),a(7,"b"),c(8,"Waypoints:"),s()(),a(9,"mat-panel-description")(10,"div",5)(11,"span",19),c(12),s(),a(13,"span",20)(14,"mat-checkbox",21),u("change",function(i){m(t);let o=p(3);return h(o.checkWpt(i.checked,-1))})("click",function(i){return i.cancelBubble=!0}),s()()()()(),a(15,"div",22),v(16,ge,6,2,"div",23,b),s()()()}if(l&2){let t=p(3);r(),_("expanded",t.display.expand.waypoints),r(11),I(" (",t.display.selCount.waypoints," of ",t.gpxData.waypoints.length,") "),r(2),_("indeterminate",t.display.someWptChecked)("checked",t.display.allWaypointsChecked)("disabled",t.gpxData.waypoints.length===0),r(2),w(t.gpxData.waypoints)}}function ye(l,e){if(l&1){let t=f();a(0,"div",23)(1,"div",24),c(2),s(),a(3,"div",25)(4,"mat-checkbox",29,1),u("change",function(){let i=m(t).$index,o=T(5),d=p(4);return h(d.checkRte(o.checked,i))}),s()()()}if(l&2){let t=e.$implicit,n=e.$index,i=p(4);r(2),P(t.name),r(2),_("checked",i.selRoutes[n])}}function Ce(l,e){if(l&1){let t=f();a(0,"div",13)(1,"mat-expansion-panel",16),u("opened",function(){m(t);let i=p(3);return h(i.display.expand.routes=!0)})("closed",function(){m(t);let i=p(3);return h(i.display.expand.routes=!1)}),a(2,"mat-expansion-panel-header",17)(3,"mat-panel-title")(4,"mat-icon",27),c(5,"directions"),s(),c(6," \xA0\xA0 "),a(7,"b"),c(8,"Routes:"),s()(),a(9,"mat-panel-description")(10,"div",5)(11,"span",19),c(12),s(),a(13,"span",20)(14,"mat-checkbox",28),u("change",function(i){m(t);let o=p(3);return h(o.checkRte(i.checked,-1))})("click",function(i){return i.cancelBubble=!0}),s()()()()(),a(15,"div",22),v(16,ye,6,2,"div",23,b),s()()()}if(l&2){let t=p(3);r(),_("expanded",t.display.expand.routes),r(11),I(" (",t.display.selCount.routes," of ",t.gpxData.routes.length,") "),r(2),_("indeterminate",t.display.someRteChecked)("checked",t.display.allRoutesChecked)("disabled",t.gpxData.routes.length==0),r(2),w(t.gpxData.routes)}}function ke(l,e){if(l&1){let t=f();a(0,"div",23)(1,"div",24),c(2),s(),a(3,"div",25)(4,"mat-checkbox",32,2),u("change",function(){let i=m(t).$index,o=T(5),d=p(4);return h(d.checkTrk(o.checked,i))}),s()()()}if(l&2){let t=e.$implicit,n=e.$index,i=p(4);r(2),P(t.name),r(2),_("checked",i.selTracks[n])}}function be(l,e){if(l&1){let t=f();a(0,"div",13)(1,"mat-expansion-panel",16),u("opened",function(){m(t);let i=p(3);return h(i.display.expand.tracks=!0)})("closed",function(){m(t);let i=p(3);return h(i.display.expand.tracks=!1)}),a(2,"mat-expansion-panel-header",17)(3,"mat-panel-title")(4,"mat-icon",30),c(5,"show_chart"),s(),c(6," \xA0\xA0 "),a(7,"b"),c(8,"Tracks:"),s()(),a(9,"mat-panel-description")(10,"div",5)(11,"span",19),c(12),s(),a(13,"span",20)(14,"mat-checkbox",31),u("change",function(i){m(t);let o=p(3);return h(o.checkTrk(i.checked,-1))})("click",function(i){return i.cancelBubble=!0}),s()()()()(),a(15,"div",22),v(16,ke,6,2,"div",23,b),s()()()}if(l&2){let t=p(3);r(),_("expanded",t.display.expand.tracks),r(11),I(" (",t.display.selCount.tracks," of ",t.gpxData.tracks.length,") "),r(2),_("indeterminate",t.display.someTrkChecked)("checked",t.display.allTracksChecked)("disabled",t.gpxData.tracks.length==0),r(2),w(t.gpxData.tracks)}}function ve(l,e){if(l&1&&(a(0,"div",13)(1,"div",14)(2,"div"),c(3,"File:"),s(),a(4,"div",15),c(5),s()(),C(6,"mat-divider"),s(),g(7,xe,18,6,"div",13),g(8,Ce,18,6,"div",13),g(9,be,18,6,"div",13)),l&2){let t=p(2);r(5),G(" ",t.data.fileName," "),r(2),x(t.gpxData.waypoints.length!=0?7:-1),r(),x(t.gpxData.routes.length!=0?8:-1),r(),x(t.gpxData.tracks.length!=0&&t.app.tracksAvailable()?9:-1)}}function we(l,e){if(l&1&&(a(0,"div",10),g(1,fe,1,0,"mat-progress-bar",12)(2,ve,10,4),s()),l&2){let t=p();r(),x(t.app.sIsFetching()?1:2)}}var me=class l{constructor(e){this.data=e}data;gpxData={name:"",routes:[],waypoints:[],tracks:[]};selRoutes=[];selWaypoints=[];selTracks=[];display={notValid:!1,allRoutesChecked:!1,allWaypointsChecked:!1,allTracksChecked:!1,someWptChecked:!1,someRteChecked:!1,someTrkChecked:!1,loadRoutesOK:!1,loadWaypointsOK:!1,loadTracksOK:!1,routeViewer:!1,selCount:{routes:0,waypoints:0,tracks:0},expand:{routes:!1,waypoints:!1,tracks:!1}};errorCount=0;subCount=0;gpx=new S;app=y(de);dialogRef=y(X);skres=y(re);signalk=y(oe);symbols=y(se);ngOnInit(){this.data.fileData=this.data.fileData||null,this.parseGPXData(this.data.fileData)}ngOnDestroy(){this.clear()}load(){this.uploadToServer({rte:{selected:this.selRoutes},wpt:{selected:this.selWaypoints},trk:{selected:this.selTracks}})}parseGPXData(e){return k(this,null,function*(){this.display.allRoutesChecked=!1,this.display.loadRoutesOK=!1,this.selRoutes=[],this.display.allWaypointsChecked=!1,this.display.loadWaypointsOK=!1,this.selWaypoints=[],this.display.allTracksChecked=!1,this.display.loadTracksOK=!1,this.selTracks=[],this.display.selCount={routes:0,waypoints:0,tracks:0},this.display.expand={routes:!1,waypoints:!1,tracks:!1},this.display.notValid=!1;let t=yield this.parseFileData(e);if(!t){console.warn(`Selected file does not contain GPX data or
1
+ import{a as S}from"./chunk-7PF3OZ2P.js";import{Ha as ce,Ia as pe,dc as de,l as Q,m as Y,n as Z,o as ee,p as te,v as oe,wa as le,xa as re,y as se}from"./chunk-URCOHSFB.js";import{a as ie,b as ne,c as ae}from"./chunk-QJ2QMZLA.js";import"./chunk-CI2BDMX2.js";import{a as z,b as q}from"./chunk-LRYGINIX.js";import{j as B,k as j,l as H}from"./chunk-NXLWB5IV.js";import"./chunk-SJSHCZKD.js";import{a as J}from"./chunk-4LLIVPOH.js";import"./chunk-G5EXGCP4.js";import"./chunk-2JAD5V57.js";import"./chunk-BNDXOOFA.js";import{j as N,o as U}from"./chunk-THOUUI2P.js";import{$a as $,Fa as X,Ga as R,Ja as O,La as W,Na as V,Oa as F,Wa as K,Ya as A,i as E,ub as L}from"./chunk-XXJX5CGO.js";import"./chunk-QD2NEHGC.js";import"./chunk-7FANVIZX.js";import"./chunk-GHLF3D5Z.js";import"./chunk-W7TSMHU3.js";import{$b as P,Fb as f,Jb as u,Lb as p,Qa as r,Vb as T,Ya as D,Z as y,_b as c,ab as M,ac as G,bc as I,da as m,ea as h,pb as g,qb as x,sb as b,tb as v,ub as w,vb as _,wb as a,xb as s,yb as C}from"./chunk-XDKT43CW.js";import"./chunk-7ISDSY26.js";import"./chunk-V3SPESMB.js";import{g as k}from"./chunk-BZGM3F3K.js";function _e(l,e){if(l&1){let t=f();a(0,"button",11),u("click",function(){m(t);let i=p();return h(i.load())}),a(1,"mat-icon"),c(2,"file_upload"),s(),c(3," \xA0Load "),s()}if(l&2){let t=p();_("disabled",!t.display.loadRoutesOK&&!t.display.loadWaypointsOK&&!t.display.loadTracksOK)}}function ue(l,e){l&1&&(a(0,"div",10)(1,"div")(2,"b"),c(3,"Invalid GPX Data:"),s(),C(4,"br")(5,"br"),a(6,"i"),c(7,"Selected file does not contain GPX data or"),C(8,"br"),c(9," does not correctly implement namespaced <extensions> attributes."),s()()())}function fe(l,e){l&1&&C(0,"mat-progress-bar",12)}function ge(l,e){if(l&1){let t=f();a(0,"div",23)(1,"div",24),c(2),s(),a(3,"div",25)(4,"mat-checkbox",26,0),u("change",function(){let i=m(t).$index,o=T(5),d=p(4);return h(d.checkWpt(o.checked,i))}),s()()()}if(l&2){let t=e.$implicit,n=e.$index,i=p(4);r(2),P(t.name),r(2),_("checked",i.selWaypoints[n])}}function xe(l,e){if(l&1){let t=f();a(0,"div",13)(1,"mat-expansion-panel",16),u("opened",function(){m(t);let i=p(3);return h(i.display.expand.waypoints=!0)})("closed",function(){m(t);let i=p(3);return h(i.display.expand.waypoints=!1)}),a(2,"mat-expansion-panel-header",17)(3,"mat-panel-title")(4,"mat-icon",18),c(5,"place"),s(),c(6," \xA0\xA0 "),a(7,"b"),c(8,"Waypoints:"),s()(),a(9,"mat-panel-description")(10,"div",5)(11,"span",19),c(12),s(),a(13,"span",20)(14,"mat-checkbox",21),u("change",function(i){m(t);let o=p(3);return h(o.checkWpt(i.checked,-1))})("click",function(i){return i.cancelBubble=!0}),s()()()()(),a(15,"div",22),v(16,ge,6,2,"div",23,b),s()()()}if(l&2){let t=p(3);r(),_("expanded",t.display.expand.waypoints),r(11),I(" (",t.display.selCount.waypoints," of ",t.gpxData.waypoints.length,") "),r(2),_("indeterminate",t.display.someWptChecked)("checked",t.display.allWaypointsChecked)("disabled",t.gpxData.waypoints.length===0),r(2),w(t.gpxData.waypoints)}}function ye(l,e){if(l&1){let t=f();a(0,"div",23)(1,"div",24),c(2),s(),a(3,"div",25)(4,"mat-checkbox",29,1),u("change",function(){let i=m(t).$index,o=T(5),d=p(4);return h(d.checkRte(o.checked,i))}),s()()()}if(l&2){let t=e.$implicit,n=e.$index,i=p(4);r(2),P(t.name),r(2),_("checked",i.selRoutes[n])}}function Ce(l,e){if(l&1){let t=f();a(0,"div",13)(1,"mat-expansion-panel",16),u("opened",function(){m(t);let i=p(3);return h(i.display.expand.routes=!0)})("closed",function(){m(t);let i=p(3);return h(i.display.expand.routes=!1)}),a(2,"mat-expansion-panel-header",17)(3,"mat-panel-title")(4,"mat-icon",27),c(5,"directions"),s(),c(6," \xA0\xA0 "),a(7,"b"),c(8,"Routes:"),s()(),a(9,"mat-panel-description")(10,"div",5)(11,"span",19),c(12),s(),a(13,"span",20)(14,"mat-checkbox",28),u("change",function(i){m(t);let o=p(3);return h(o.checkRte(i.checked,-1))})("click",function(i){return i.cancelBubble=!0}),s()()()()(),a(15,"div",22),v(16,ye,6,2,"div",23,b),s()()()}if(l&2){let t=p(3);r(),_("expanded",t.display.expand.routes),r(11),I(" (",t.display.selCount.routes," of ",t.gpxData.routes.length,") "),r(2),_("indeterminate",t.display.someRteChecked)("checked",t.display.allRoutesChecked)("disabled",t.gpxData.routes.length==0),r(2),w(t.gpxData.routes)}}function ke(l,e){if(l&1){let t=f();a(0,"div",23)(1,"div",24),c(2),s(),a(3,"div",25)(4,"mat-checkbox",32,2),u("change",function(){let i=m(t).$index,o=T(5),d=p(4);return h(d.checkTrk(o.checked,i))}),s()()()}if(l&2){let t=e.$implicit,n=e.$index,i=p(4);r(2),P(t.name),r(2),_("checked",i.selTracks[n])}}function be(l,e){if(l&1){let t=f();a(0,"div",13)(1,"mat-expansion-panel",16),u("opened",function(){m(t);let i=p(3);return h(i.display.expand.tracks=!0)})("closed",function(){m(t);let i=p(3);return h(i.display.expand.tracks=!1)}),a(2,"mat-expansion-panel-header",17)(3,"mat-panel-title")(4,"mat-icon",30),c(5,"show_chart"),s(),c(6," \xA0\xA0 "),a(7,"b"),c(8,"Tracks:"),s()(),a(9,"mat-panel-description")(10,"div",5)(11,"span",19),c(12),s(),a(13,"span",20)(14,"mat-checkbox",31),u("change",function(i){m(t);let o=p(3);return h(o.checkTrk(i.checked,-1))})("click",function(i){return i.cancelBubble=!0}),s()()()()(),a(15,"div",22),v(16,ke,6,2,"div",23,b),s()()()}if(l&2){let t=p(3);r(),_("expanded",t.display.expand.tracks),r(11),I(" (",t.display.selCount.tracks," of ",t.gpxData.tracks.length,") "),r(2),_("indeterminate",t.display.someTrkChecked)("checked",t.display.allTracksChecked)("disabled",t.gpxData.tracks.length==0),r(2),w(t.gpxData.tracks)}}function ve(l,e){if(l&1&&(a(0,"div",13)(1,"div",14)(2,"div"),c(3,"File:"),s(),a(4,"div",15),c(5),s()(),C(6,"mat-divider"),s(),g(7,xe,18,6,"div",13),g(8,Ce,18,6,"div",13),g(9,be,18,6,"div",13)),l&2){let t=p(2);r(5),G(" ",t.data.fileName," "),r(2),x(t.gpxData.waypoints.length!=0?7:-1),r(),x(t.gpxData.routes.length!=0?8:-1),r(),x(t.gpxData.tracks.length!=0&&t.app.tracksAvailable()?9:-1)}}function we(l,e){if(l&1&&(a(0,"div",10),g(1,fe,1,0,"mat-progress-bar",12)(2,ve,10,4),s()),l&2){let t=p();r(),x(t.app.sIsFetching()?1:2)}}var me=class l{constructor(e){this.data=e}data;gpxData={name:"",routes:[],waypoints:[],tracks:[]};selRoutes=[];selWaypoints=[];selTracks=[];display={notValid:!1,allRoutesChecked:!1,allWaypointsChecked:!1,allTracksChecked:!1,someWptChecked:!1,someRteChecked:!1,someTrkChecked:!1,loadRoutesOK:!1,loadWaypointsOK:!1,loadTracksOK:!1,routeViewer:!1,selCount:{routes:0,waypoints:0,tracks:0},expand:{routes:!1,waypoints:!1,tracks:!1}};errorCount=0;subCount=0;gpx=new S;app=y(de);dialogRef=y(X);skres=y(re);signalk=y(oe);symbols=y(se);ngOnInit(){this.data.fileData=this.data.fileData||null,this.parseGPXData(this.data.fileData)}ngOnDestroy(){this.clear()}load(){this.uploadToServer({rte:{selected:this.selRoutes},wpt:{selected:this.selWaypoints},trk:{selected:this.selTracks}})}parseGPXData(e){return k(this,null,function*(){this.display.allRoutesChecked=!1,this.display.loadRoutesOK=!1,this.selRoutes=[],this.display.allWaypointsChecked=!1,this.display.loadWaypointsOK=!1,this.selWaypoints=[],this.display.allTracksChecked=!1,this.display.loadTracksOK=!1,this.selTracks=[],this.display.selCount={routes:0,waypoints:0,tracks:0},this.display.expand={routes:!1,waypoints:!1,tracks:!1},this.display.notValid=!1;let t=yield this.parseFileData(e);if(!t){console.warn(`Selected file does not contain GPX data or
2
2
  does not correctly implement namespaced <extensions> attributes`,"Invalid GPX Data:"),this.display.notValid=!0;return}this.gpxData=t,this.gpxData.routes.forEach(()=>{this.selRoutes.push(!1)}),this.selRoutes.length===1&&(this.selRoutes[0]=!0,this.display.allRoutesChecked=!0,this.display.expand.routes=!0,this.display.loadRoutesOK=!0,this.display.selCount.routes=1),this.gpxData.waypoints.forEach(()=>{this.selWaypoints.push(!1)}),this.selWaypoints.length===1&&(this.selWaypoints[0]=!0,this.display.allWaypointsChecked=!0,this.display.expand.waypoints=!0,this.display.loadWaypointsOK=!0,this.display.selCount.waypoints=1),this.gpxData.tracks.forEach(()=>{this.selTracks.push(!1)}),this.selTracks.length===1&&(this.selTracks[0]=!0,this.display.allTracksChecked=!0,this.display.expand.tracks=!0,this.display.loadTracksOK=!0,this.display.selCount.tracks=1)})}checkRte(e,t=-1){let n=0;if(t!==-1){this.selRoutes[t]=e,this.display.loadRoutesOK=e;for(let i of this.selRoutes)i&&n++;this.display.loadRoutesOK=n!==0,this.display.selCount.routes=n,this.display.allRoutesChecked=n===this.selRoutes.length}else{for(let i=0;i<this.selRoutes.length;i++)this.selRoutes[i]=e,this.display.loadRoutesOK=e,this.display.allRoutesChecked=e;this.display.selCount.routes=e?this.selRoutes.length:0}this.display.someRteChecked=!(this.display.allRoutesChecked||n===0)}checkWpt(e,t=-1){let n=0;if(t!==-1){this.selWaypoints[t]=e,this.display.loadWaypointsOK=e;for(let i of this.selWaypoints)i&&n++;this.display.loadWaypointsOK=n!==0,this.display.selCount.waypoints=n,this.display.allWaypointsChecked=n===this.selWaypoints.length}else{for(let i=0;i<this.selWaypoints.length;i++)this.selWaypoints[i]=e,this.display.loadWaypointsOK=e,this.display.allWaypointsChecked=e;this.display.selCount.waypoints=e?this.selWaypoints.length:0}this.display.someWptChecked=!(this.display.allWaypointsChecked||n===0)}checkTrk(e,t=-1){let n=0;if(t!==-1){this.selTracks[t]=e,this.display.loadTracksOK=e;for(let i of this.selTracks)i&&n++;this.display.loadTracksOK=n!==0,this.display.selCount.tracks=n,this.display.allTracksChecked=n===this.selTracks.length}else{for(let i=0;i<this.selTracks.length;i++)this.selTracks[i]=e,this.display.loadTracksOK=e,this.display.allTracksChecked=e;this.display.selCount.tracks=e?this.selTracks.length:0}this.display.someTrkChecked=!(this.display.allTracksChecked||n===0)}clear(){this.gpx=new S}parseFileData(e){return k(this,null,function*(){let t={name:"",routes:[],waypoints:[],tracks:[]};if(this.gpx=new S,this.app.sIsFetching.set(!0),!(yield this.gpx.parse(e)))return this.app.sIsFetching.set(!1),null;let n=1;return this.gpx.rte.forEach(i=>{t.routes.push({name:i.name!==""?i.name:`Rte: ${n}`,description:i.desc?i.desc:i.cmt?i.cmt:"",wptcount:i.rtept.length}),n++}),n=1,this.gpx.wpt.forEach(i=>{t.waypoints.push({name:i.name?i.name:`Wpt: ${n}`,description:i.desc?i.desc:i.cmt?i.cmt:""}),n++}),n=1,this.gpx.trk.forEach(i=>{t.tracks.push({name:i.name?i.name:`Trk: ${n}`,description:i.desc?i.desc:i.cmt?i.cmt:""}),n++}),this.app.sIsFetching.set(!1),t})}uploadToServer(e){return k(this,null,function*(){this.app.sIsFetching.set(!0),this.errorCount=0,this.subCount=0;for(let n=0;n<e.rte.selected.length;n++)e.rte.selected[n]&&this.transformRoute(this.gpx.rte[n]);for(let n=0;n<e.wpt.selected.length;n++)e.wpt.selected[n]&&this.transformWaypoint(this.gpx.wpt[n]);let t=[];for(let n=0;n<e.trk.selected.length;n++)if(e.trk.selected[n]){let i=this.gpx.trk[n],o=this.transformTrack(i);this.subCount++;try{let d=yield this.skres.importTrack(o.feature,le((i.trkseg??[]).map(he=>he.trkpt)));this.subCount--,t.push(d),this.app.debug("SUCCESS: Track added."),this.checkComplete()}catch(d){this.errorCount++,this.subCount--,this.logError(d),this.checkComplete()}}t.length!==0&&this.skres.trackAddFromServer(t)})}errorList=[];logError(e){if(e instanceof E){let t=e.error?e.error.message:e.message;this.errorList.push({status:e.status,message:t})}else this.errorList.push({status:void 0,message:e instanceof Error?e.message:String(e)})}checkComplete(){this.subCount===0&&(this.app.sIsFetching.set(!1),this.app.saveConfig(),this.dialogRef.close({errCount:this.errorCount,errList:this.errorList}),this.app.debug(`GPXLoad: complete: ${this.errorCount}`))}transformRoute(e){let t=this.skres.buildRoute(e.rtept.map(o=>[o.lon,o.lat])),n=t[1];n.name=e.name??"",n.description=e.desc??"";let i=n.feature.properties??={};e.cmt&&(i.cmt=e.cmt),e.src&&(i.src=e.src),e.number&&(i.number=e.number),e.type&&(i.type=e.type),i.coordinatesMeta=[],i.coordinatesMeta=e.rtept.map(o=>{let d={name:o.name??""};return o.cmt&&(d.description=o.cmt),d}),this.subCount++,this.signalk.api.put(this.app.skApiVersion,`/resources/routes/${t[0]}`,t[1]).subscribe(o=>{this.subCount--,Math.floor(o.statusCode/100)===2?(this.app.debug("SUCCESS: Route added."),this.skres.selectionAdd("routes",t[0])):this.errorCount++,this.checkComplete()},o=>{this.errorCount++,this.subCount--,this.logError(o),this.checkComplete()})}transformWaypoint(e){let t=this.skres.buildWaypoint([e.lon,e.lat]),n=t[1],i=n.feature.properties??={};if(e.ele&&n.feature.geometry.coordinates.push(e.ele),e.name&&e.name.length!==0&&(n.name=e.name),e.desc&&e.desc.length!==0&&(n.description=e.desc),e.type&&(n.type=e.type,i.type=e.type),e.cmt&&(i.cmt=e.cmt),e.src&&(i.src=e.src),e.sym){i.sym=e.sym;let o=this.symbols.resolveGpxSym(e.sym);o&&(n.type="waypoint",i.skIcon=o)}this.subCount++,this.signalk.api.put(this.app.skApiVersion,`/resources/waypoints/${t[0]}`,t[1]).subscribe(o=>{this.subCount--,Math.floor(o.statusCode/100)===2?(this.app.debug("SUCCESS: Waypoint added."),this.skres.selectionAdd("waypoints",t[0])):this.errorCount++,this.checkComplete()},o=>{this.errorCount++,this.subCount--,this.logError(o),this.checkComplete()})}transformTrack(e){let t={},n={feature:{type:"Feature",geometry:{type:"MultiLineString",coordinates:[]},properties:t,id:""}};return e.trkseg&&e.trkseg.forEach(i=>{let o=[];i.trkpt.forEach(d=>{o.push([d.lon,d.lat])}),n.feature.geometry.coordinates.push(o)}),e.name&&e.name.length!==0?t.name=e.name:t.name=`gpxtrk #${Math.random().toString().slice(-5)}`,e.desc&&e.desc.length!==0&&(t.description=e.desc),e.cmt&&(t.cmt=e.cmt),e.src&&(t.src=e.src),e.type&&(t.type=e.type),n}static \u0275fac=function(t){return new(t||l)(D(R))};static \u0275cmp=M({type:l,selectors:[["gpxload-dialog"]],decls:13,vars:3,consts:[["wval",""],["rval",""],["tval",""],[1,"gpxload-dialog"],[2,"background-color","transparent"],[2,"display","flex","width","100%"],["mat-raised-button","","matTooltip","Load selected resources","matTooltipPosition","right",2,"width","85px",3,"disabled"],[2,"flex","1 1 auto","text-align","center"],[2,"text-align","right"],["mat-icon-button","",3,"click","disabled"],["mat-dialog-content",""],["mat-raised-button","","matTooltip","Load selected resources","matTooltipPosition","right",2,"width","85px",3,"click","disabled"],["mode","indeterminate"],[1,"card-group"],[2,"display","flex"],[2,"flex","1 1 auto","padding-left","10px","overflow","hidden","display","-webkit-box","-webkit-box-orient","vertical","-webkit-line-clamp","1","line-clamp","1","text-overflow","ellipsis"],[3,"opened","closed","expanded"],[2,"padding","0 12px"],[1,"icon-waypoint"],[1,"pnlSelectedItems"],[1,"pnlSelect"],["matTooltip","Select all Waypoints","matTooltipPosition","before",3,"change","click","indeterminate","checked","disabled"],[1,"list-container-scrollable"],[1,"item-row"],[1,"name"],[1,"check"],["matTooltip","Select Waypoint","matTooltipPosition","below",3,"change","checked"],[1,"icon-route"],["matTooltip","Select all Routes","matTooltipPosition","before",3,"change","click","indeterminate","checked","disabled"],["matTooltip","Select this Route","matTooltipPosition","below",3,"change","checked"],[1,"icon-track"],["matTooltip","Select all Tracks","matTooltipPosition","before",3,"change","click","indeterminate","checked","disabled"],["matTooltip","Select this Track","matTooltipPosition","below",3,"change","checked"]],template:function(t,n){t&1&&(a(0,"div",3)(1,"mat-toolbar",4)(2,"div",5)(3,"div"),g(4,_e,4,1,"button",6),s(),a(5,"div",7),c(6,"Import GPX"),s(),a(7,"div",8)(8,"button",9),u("click",function(){return n.dialogRef.close(-1)}),a(9,"mat-icon"),c(10,"close"),s()()()()(),g(11,ue,10,0,"div",10)(12,we,3,1,"div",10),s()),t&2&&(r(4),x(n.app.sIsFetching()?-1:4),r(4),_("disabled",n.app.sIsFetching()),r(3),x(n.display.notValid?11:12))},dependencies:[ne,ie,pe,ce,W,O,F,V,$,A,K,B,N,U,q,z,te,Q,Y,ee,Z,H,j,ae,J,L],styles:[".gpxload-dialog[_ngcontent-%COMP%]{font-family:roboto;position:relative}.mat-expansion-panel-body[_ngcontent-%COMP%]{padding:0 12px 6px}.card-group-title[_ngcontent-%COMP%]{font-weight:700;font-size:10pt;font-family:Arial,Helvetica,sans-serif;padding:10px 0}.item-row[_ngcontent-%COMP%]{display:flex;width:100%;padding:2px 0}.item-row[_ngcontent-%COMP%] .name[_ngcontent-%COMP%]{flex:1 1 auto;overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1;text-overflow:ellipsis;line-height:2.5em}.item-row[_ngcontent-%COMP%] .check[_ngcontent-%COMP%]{text-align:right;padding-right:15px}.pnlSelectedItems[_ngcontent-%COMP%]{display:none;line-height:2.9em}.pnlSelect[_ngcontent-%COMP%]{flex:1 1 auto;padding-left:3px;padding-right:3px;text-align:right}.txtSelect[_ngcontent-%COMP%]{display:none}button[_ngcontent-%COMP%]{min-width:unset;padding:unset}@media only screen and (min-width:400px){.pnlSelectedItems[_ngcontent-%COMP%]{display:inline}}@media only screen and (min-width:475px){.pnlSelectedItems[_ngcontent-%COMP%]{display:inline;line-height:2.9em}.txtSelect[_ngcontent-%COMP%]{display:inline}.pnlSelect[_ngcontent-%COMP%]{flex:1 1 auto;padding-left:20px;padding-right:15px;text-align:right}button[_ngcontent-%COMP%]{min-width:inherit;padding:inherit}}"]})};export{me as GPXImportDialog};
@@ -1 +1 @@
1
- import{f as r}from"./chunk-7FANVIZX.js";import{a as t}from"./chunk-MWETYHR7.js";import"./chunk-WARJYBQ7.js";import"./chunk-BZGM3F3K.js";var i=t.Array(t.String({minLength:1})),o=t.Object({ids:i,visible:t.Boolean()}),s=t.Object({ids:i,opacity:t.Number({minimum:0,maximum:1})}),a=t.Object({ids:i,time:t.Refine(t.Union([t.Null(),t.String()]),e=>e===null||r(e),()=>"must be null or an ISO 8601 instant")}),c=t.Object({order:i});export{s as SetOpacityParams,c as SetOrderParams,a as SetTimeParams,o as SetVisibilityParams};
1
+ import{f as r}from"./chunk-7FANVIZX.js";import{a as t}from"./chunk-7ISDSY26.js";import"./chunk-V3SPESMB.js";import"./chunk-BZGM3F3K.js";var i=t.Array(t.String({minLength:1})),o=t.Object({ids:i,visible:t.Boolean()}),s=t.Object({ids:i,opacity:t.Number({minimum:0,maximum:1})}),a=t.Object({ids:i,time:t.Refine(t.Union([t.Null(),t.String()]),e=>e===null||r(e),()=>"must be null or an ISO 8601 instant")}),c=t.Object({order:i});export{s as SetOpacityParams,c as SetOrderParams,a as SetTimeParams,o as SetVisibilityParams};
@@ -1,3 +1,3 @@
1
- import{j as y}from"./chunk-2QKJQDG4.js";import{T as p,X as m,la as h,o as f}from"./chunk-R6ABX6RX.js";import{g as d}from"./chunk-BZGM3F3K.js";var k=/^---\r?\n([\s\S]*?)\r?\n---\r?\n?([\s\S]*)$/;function _(r){let e=k.exec(r);if(!e)return{frontmatter:{},body:r.trim()};let t={};for(let s of e[1].split(/\r?\n/)){let o=s.trim();if(!o||o.startsWith("#"))continue;let i=o.indexOf(":");if(i===-1)continue;let n=o.slice(0,i).trim(),a=o.slice(i+1).trim().replace(/^["']|["']$/g,"");n&&(t[n]=a)}return{frontmatter:t,body:e[2].trim()}}var g=/!\[([^\]]*)\]\(([^)\s]+)[^)]*\)/g;function D(r){let e=[];g.lastIndex=0;let t;for(;t=g.exec(r);)e.push({alt:t[1],url:t[2]});if(e.length===0)return{images:e,body:r};let s=!1,o=r.replace(g,i=>s?i:(s=!0,"")).replace(/\n{3,}/g,`
1
+ import{j as y}from"./chunk-XXJX5CGO.js";import{V as p,Z as m,na as h,o as f}from"./chunk-XDKT43CW.js";import{g as d}from"./chunk-BZGM3F3K.js";var k=/^---\r?\n([\s\S]*?)\r?\n---\r?\n?([\s\S]*)$/;function _(r){let e=k.exec(r);if(!e)return{frontmatter:{},body:r.trim()};let t={};for(let s of e[1].split(/\r?\n/)){let o=s.trim();if(!o||o.startsWith("#"))continue;let i=o.indexOf(":");if(i===-1)continue;let n=o.slice(0,i).trim(),a=o.slice(i+1).trim().replace(/^["']|["']$/g,"");n&&(t[n]=a)}return{frontmatter:t,body:e[2].trim()}}var g=/!\[([^\]]*)\]\(([^)\s]+)[^)]*\)/g;function D(r){let e=[];g.lastIndex=0;let t;for(;t=g.exec(r);)e.push({alt:t[1],url:t[2]});if(e.length===0)return{images:e,body:r};let s=!1,o=r.replace(g,i=>s?i:(s=!0,"")).replace(/\n{3,}/g,`
2
2
 
3
3
  `).trim();return{images:e,body:o}}function C(r,e){if(!r&&!e)return 0;if(!r)return-1;if(!e)return 1;let t=i=>i.replace(/^v/i,"").split(/[.-]/).map(n=>/^\d+$/.test(n)?Number(n):n),s=t(r),o=t(e);for(let i=0;i<Math.max(s.length,o.length);i++){let n=s[i],a=o[i];if(n===void 0)return typeof a=="string"?1:-1;if(a===void 0)return typeof n=="string"?-1:1;if(n!==a)return typeof n=="number"&&typeof a=="number"?n<a?-1:1:String(n)<String(a)?-1:1}return 0}function F(r){if(!r)return null;let e=String(r).replace(/^v/i,"").split(".");return e.length<2?null:`${e[0]}.${e[1]}`}function I(r){let e=null;for(let t of r)!t||t.kind==="skip"||!t.since||C(t.since,e)>0&&(e=t.since);return F(e)}function M(r,e){let t=r.filter(n=>!n.since),s=t.length?t:r.filter(n=>F(n.since)===e),o=s.map(n=>w(n.title??"")).filter(n=>n.length>0);if(o.length===0)return null;let i=s.some(n=>n.kind==="new")?"New":"Updated";return{label:t.length?"Unreleased":`${i} in ${e}`,shown:o.slice(0,3),more:Math.max(0,o.length-3)}}function x(r){let e=r?.docs??[],t=r?.ledger??[],s=I(t),o=new Map;for(let i of t){if(!i||i.kind==="skip"||!i.feature)continue;let n=o.get(i.feature);n?n.push(i):o.set(i.feature,[i])}return e.map(i=>{let{frontmatter:n,body:a}=_(i.raw),{images:v,body:E}=D(a),c=(o.get(i.id)??[]).slice().sort((u,S)=>-P(u,S)),l=c.find(u=>u.since)??c[0];return{id:i.id,title:n.title||i.id,category:n.category||"General",body:E,since:l?.since??null,latestKind:l&&(l.kind==="new"||l.kind==="enhanced")?l.kind:null,events:c.map(u=>({pr:u.pr??null,date:u.date??null,title:w(u.title??"")})),recentChanges:M(c,s),images:v}})}function P(r,e){let t=r.date??"",s=e.date??"";return t!==s?t<s?-1:1:(r.pr??0)-(e.pr??0)}var L=/^\s*(feat|fix|perf|refactor|docs|test|chore|ci|build|style|revert)(\([^)]*\))?!?:\s*/i;function w(r){return r.replace(L,"").trim()}function A(r,e,t){let s=t==="asc"?1:-1;return[...r].sort((o,i)=>{let n;return e==="since"?n=C(o.since,i.since):n=o[e].localeCompare(i[e],void 0,{sensitivity:"base"}),n===0?o.title.localeCompare(i.title,void 0,{sensitivity:"base"}):n*s})}function N(r,e,t){return t===0?-1:Math.min(Math.max(r+(e==="ArrowDown"?1:-1),0),t-1)}function b(r,e){let t=r.find(o=>o.name===e);if(t)return t.hue;let s=0;for(let o=0;o<e.length;o++)s=s*31+e.charCodeAt(o)|0;return Math.abs(s)%360}function T(r,e){let t=e.trim().toLowerCase();return t?r.filter(s=>s.title.toLowerCase().includes(t)||s.category.toLowerCase().includes(t)||s.body.toLowerCase().includes(t)):r}var R=class r{http=m(y);_features=h([]);categories=[];loadPromise=null;features=this._features.asReadonly();load(){return this.loadPromise??=this.fetch()}fetch(){return d(this,null,function*(){try{let e=yield f(this.http.get("assets/features-corpus.json"));this.categories=e.categories??[],this._features.set(x(e))}catch(e){this._features.set([])}return this._features()})}hueFor(e){return b(this.categories,e)}static \u0275fac=function(t){return new(t||r)};static \u0275prov=p({token:r,factory:r.\u0275fac,providedIn:"root"})};export{A as a,N as b,T as c,R as d};
@@ -1,4 +1,4 @@
1
- import{b as xt}from"./chunk-RENDTMDT.js";import{a as K}from"./chunk-DN6IX7CO.js";import{C as j,Ra as gt,Sa as bt,U as dt,Va as ut,Xa as ft,ab as vt,b as st,ka as U,la as ht,n as ot,t as mt,ua as r,v as lt,w as rt,xa as pt,za as _t}from"./chunk-2QKJQDG4.js";import{$a as P,Hb as T,Jb as v,Jc as q,Kb as M,Lb as m,Mb as S,Nb as G,O as Q,Oa as p,Ob as d,Pb as h,S as tt,Tb as I,U as E,V as F,Va as ct,Vb as x,X as s,_a as g,a as Y,ab as b,d as J,da as it,db as u,ea as et,eb as w,fa as nt,ia as V,ic as A,ja as H,la as R,mb as C,nb as D,oa as at,ob as z,pa as y,ra as O,tb as f,tc as B,ub as l,vb as _,w as $,wb as L}from"./chunk-R6ABX6RX.js";var Ot=(()=>{class i{get vertical(){return this._vertical}set vertical(t){this._vertical=r(t)}_vertical=!1;get inset(){return this._inset}set inset(t){this._inset=r(t)}_inset=!1;static \u0275fac=function(e){return new(e||i)};static \u0275cmp=g({type:i,selectors:[["mat-divider"]],hostAttrs:["role","separator",1,"mat-divider"],hostVars:7,hostBindings:function(e,n){e&2&&(C("aria-orientation",n.vertical?"vertical":"horizontal"),x("mat-divider-vertical",n.vertical)("mat-divider-horizontal",!n.vertical)("mat-divider-inset",n.inset))},inputs:{vertical:"vertical",inset:"inset"},decls:0,vars:0,template:function(e,n){},styles:[`.mat-divider {
1
+ import{b as xt}from"./chunk-G5EXGCP4.js";import{a as K}from"./chunk-2JAD5V57.js";import{C as j,Ra as gt,Sa as bt,U as dt,Va as ut,Xa as ft,ab as vt,b as st,ka as U,la as ht,n as ot,t as mt,ua as r,v as lt,w as rt,xa as pt,za as _t}from"./chunk-XXJX5CGO.js";import{Jb as T,Lb as v,Lc as q,Mb as M,Nb as m,Ob as S,Pb as G,Q,Qa as p,Qb as d,Rb as h,U as tt,Vb as I,W as E,X as F,Xa as ct,Xb as x,Z as s,a as Y,ab as g,bb as P,cb as b,d as J,fa as it,fb as u,ga as et,gb as w,ha as nt,ka as V,kc as A,la as H,na as R,ob as C,pb as D,qa as at,qb as z,ra as y,ta as O,vb as f,vc as B,wb as l,xb as _,y as $,yb as L}from"./chunk-XDKT43CW.js";var Ot=(()=>{class i{get vertical(){return this._vertical}set vertical(t){this._vertical=r(t)}_vertical=!1;get inset(){return this._inset}set inset(t){this._inset=r(t)}_inset=!1;static \u0275fac=function(e){return new(e||i)};static \u0275cmp=g({type:i,selectors:[["mat-divider"]],hostAttrs:["role","separator",1,"mat-divider"],hostVars:7,hostBindings:function(e,n){e&2&&(C("aria-orientation",n.vertical?"vertical":"horizontal"),x("mat-divider-vertical",n.vertical)("mat-divider-horizontal",!n.vertical)("mat-divider-inset",n.inset))},inputs:{vertical:"vertical",inset:"inset"},decls:0,vars:0,template:function(e,n){},styles:[`.mat-divider {
2
2
  display: block;
3
3
  margin: 0;
4
4
  border-top-style: solid;
@@ -1 +1 @@
1
- import{c as y,d as S,e as k,g as E,k as R}from"./chunk-DSUCHYD7.js";import"./chunk-RENDTMDT.js";import"./chunk-DN6IX7CO.js";import{$a as h,Fa as b,Ga as I,Ia as L,Ja as C,Ka as w,La as P,Na as W,Oa as v,Ya as T}from"./chunk-2QKJQDG4.js";import{d as B}from"./chunk-RYULE37H.js";import{$b as x,Db as M,Hb as c,Jb as _,Oa as l,Wa as r,Yb as o,Zb as D,_a as p,_b as A,ba as s,ca as g,rb as f,sb as u,ub as e,vb as a}from"./chunk-R6ABX6RX.js";import"./chunk-BZGM3F3K.js";var F=(n,i)=>i.extension+"/"+i.widget.id;function O(n,i){if(n&1){let t=M();e(0,"button",4),c("click",function(){let m=s(t).$implicit,j=_();return g(j.dialogRef.close(m))}),e(1,"span",5),o(2),a(),e(3,"span",6),o(4),a()()}if(n&2){let t=i.$implicit;l(2),D(t.widget.title),l(2),x("",t.extensionName," \xB7 ",t.widget.size)}}var N=class n{constructor(i,t){this.dialogRef=i;this.data=t;this.anchorLabel=B[t.anchor]}dialogRef;data;anchorLabel;static \u0275fac=function(t){return new(t||n)(r(b),r(I))};static \u0275cmp=p({type:n,selectors:[["fb-plotterext-add-widget"]],decls:12,vars:1,consts:[["mat-dialog-title","",1,"pe-add-title"],["mat-list-item",""],["align","end"],["mat-button","",3,"click"],["mat-list-item","",3,"click"],["matListItemTitle",""],["matListItemLine",""]],template:function(t,d){t&1&&(e(0,"div",0)(1,"mat-icon"),o(2,"widgets"),a(),e(3,"span"),o(4),a()(),e(5,"mat-dialog-content")(6,"mat-action-list"),f(7,O,5,3,"button",1,F),a()(),e(9,"mat-dialog-actions",2)(10,"button",3),c("click",function(){return d.dialogRef.close()}),o(11,"Cancel"),a()()),t&2&&(l(4),A("Add widget \u2014 ",d.anchorLabel),l(3),u(d.data.candidates))},dependencies:[P,L,w,C,h,T,v,W,R,k,E,S,y],styles:[".pe-add-title[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px}"]})};export{N as PlotterAddWidgetDialog};
1
+ import{c as y,d as S,e as k,g as E,k as R}from"./chunk-LRYGINIX.js";import"./chunk-G5EXGCP4.js";import"./chunk-2JAD5V57.js";import{$a as h,Fa as b,Ga as I,Ia as L,Ja as C,Ka as w,La as P,Na as W,Oa as v,Ya as T}from"./chunk-XXJX5CGO.js";import{d as B}from"./chunk-W7TSMHU3.js";import{$b as D,Fb as M,Jb as c,Lb as _,Qa as l,Ya as r,_b as o,ab as p,ac as A,bc as x,da as s,ea as g,tb as f,ub as u,wb as e,xb as a}from"./chunk-XDKT43CW.js";import"./chunk-BZGM3F3K.js";var F=(n,i)=>i.extension+"/"+i.widget.id;function O(n,i){if(n&1){let t=M();e(0,"button",4),c("click",function(){let m=s(t).$implicit,j=_();return g(j.dialogRef.close(m))}),e(1,"span",5),o(2),a(),e(3,"span",6),o(4),a()()}if(n&2){let t=i.$implicit;l(2),D(t.widget.title),l(2),x("",t.extensionName," \xB7 ",t.widget.size)}}var N=class n{constructor(i,t){this.dialogRef=i;this.data=t;this.anchorLabel=B[t.anchor]}dialogRef;data;anchorLabel;static \u0275fac=function(t){return new(t||n)(r(b),r(I))};static \u0275cmp=p({type:n,selectors:[["fb-plotterext-add-widget"]],decls:12,vars:1,consts:[["mat-dialog-title","",1,"pe-add-title"],["mat-list-item",""],["align","end"],["mat-button","",3,"click"],["mat-list-item","",3,"click"],["matListItemTitle",""],["matListItemLine",""]],template:function(t,d){t&1&&(e(0,"div",0)(1,"mat-icon"),o(2,"widgets"),a(),e(3,"span"),o(4),a()(),e(5,"mat-dialog-content")(6,"mat-action-list"),f(7,O,5,3,"button",1,F),a()(),e(9,"mat-dialog-actions",2)(10,"button",3),c("click",function(){return d.dialogRef.close()}),o(11,"Cancel"),a()()),t&2&&(l(4),A("Add widget \u2014 ",d.anchorLabel),l(3),u(d.data.candidates))},dependencies:[P,L,w,C,h,T,v,W,R,k,E,S,y],styles:[".pe-add-title[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px}"]})};export{N as PlotterAddWidgetDialog};
@@ -0,0 +1 @@
1
+ import{ac as a}from"./chunk-URCOHSFB.js";import"./chunk-QJ2QMZLA.js";import"./chunk-CI2BDMX2.js";import"./chunk-LRYGINIX.js";import"./chunk-NXLWB5IV.js";import"./chunk-SJSHCZKD.js";import"./chunk-4LLIVPOH.js";import"./chunk-G5EXGCP4.js";import"./chunk-2JAD5V57.js";import"./chunk-BNDXOOFA.js";import"./chunk-THOUUI2P.js";import"./chunk-XXJX5CGO.js";import"./chunk-QD2NEHGC.js";import"./chunk-7FANVIZX.js";import"./chunk-GHLF3D5Z.js";import"./chunk-W7TSMHU3.js";import"./chunk-XDKT43CW.js";import"./chunk-7ISDSY26.js";import"./chunk-V3SPESMB.js";import"./chunk-BZGM3F3K.js";export{a as GeoJSONImportDialog};