aviation-chart 0.1.35 → 0.2.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 (86) hide show
  1. package/CHANGES.md +0 -0
  2. package/README.md +286 -0
  3. package/dist/MapSDK.d.ts +128 -0
  4. package/dist/apis/index.d.ts +60 -0
  5. package/dist/constants/aviation-sources.d.ts +28 -0
  6. package/dist/constants/builtin-layers.d.ts +3 -0
  7. package/dist/index.d.ts +21 -0
  8. package/dist/layericons/Airport-Civil-Selected.png +0 -0
  9. package/dist/layericons/Airport-Joint-Selected.png +0 -0
  10. package/dist/layericons/Airport-Military-Selected.png +0 -0
  11. package/dist/layericons/NDB-Mandatory-Selected.png +0 -0
  12. package/dist/layericons/NDB-Optional-Selected.png +0 -0
  13. package/dist/layericons/VOR-Mandatory-S-Selected.png +0 -0
  14. package/dist/layericons/VOR-Optional-S-Selected.png +0 -0
  15. package/dist/layericons/Waypoint-Mandatory-Selected.png +0 -0
  16. package/dist/layericons/Waypoint-Optional-Selected.png +0 -0
  17. package/dist/layericons/adsb-airplane.png +0 -0
  18. package/dist/layericons/air-label-left1.png +0 -0
  19. package/dist/layericons/air-label-none1.png +0 -0
  20. package/dist/layericons/air-label-right1.png +0 -0
  21. package/dist/layericons/airport-civ.png +0 -0
  22. package/dist/layericons/airport-mil.png +0 -0
  23. package/dist/layericons/airport-milext.png +0 -0
  24. package/dist/layericons/airport-userfoc.png +0 -0
  25. package/dist/layericons/airspace-line.png +0 -0
  26. package/dist/layericons/border.png +0 -0
  27. package/dist/layericons/controlled copy.png +0 -0
  28. package/dist/layericons/controlled-line.png +0 -0
  29. package/dist/layericons/controlled.png +0 -0
  30. package/dist/layericons/designate_point_inway.png +0 -0
  31. package/dist/layericons/designate_point_notinway.png +0 -0
  32. package/dist/layericons/line-blue-pattenr.png +0 -0
  33. package/dist/layericons/line-blue-pattern.png +0 -0
  34. package/dist/layericons/ndb-inway.png +0 -0
  35. package/dist/layericons/ndb-notinway.png +0 -0
  36. package/dist/layericons/notam-fill.png +0 -0
  37. package/dist/layericons/place-label.png +0 -0
  38. package/dist/layericons/re-text-bg.png +0 -0
  39. package/dist/layericons/restricted-line.png +0 -0
  40. package/dist/layericons/restricted.png +0 -0
  41. package/dist/layericons/segment-both.png +0 -0
  42. package/dist/layericons/segment-left.png +0 -0
  43. package/dist/layericons/segment-right.png +0 -0
  44. package/dist/layericons/sprite.json +352 -0
  45. package/dist/layericons/sprite.png +0 -0
  46. package/dist/layericons/sprite@2x.json +352 -0
  47. package/dist/layericons/sprite@2x.png +0 -0
  48. package/dist/layericons/taix-text-bg.png +0 -0
  49. package/dist/layericons/text-bg-orange.png +0 -0
  50. package/dist/layericons/text-bg-t.png +0 -0
  51. package/dist/layericons/text-bg.png +0 -0
  52. package/dist/layericons/vor-inway.png +0 -0
  53. package/dist/layericons/vor-notinway.png +0 -0
  54. package/dist/managers/ADSBManager.d.ts +39 -0
  55. package/dist/managers/ClickManager.d.ts +15 -0
  56. package/dist/managers/ErrorManager.d.ts +25 -0
  57. package/dist/managers/GeoJSONManager.d.ts +29 -0
  58. package/dist/managers/GlobalConfigManager.d.ts +48 -0
  59. package/dist/managers/Graticule.d.ts +41 -0
  60. package/dist/managers/HoverManage.d.ts +26 -0
  61. package/dist/managers/LayerManager.d.ts +33 -0
  62. package/dist/managers/LineLabelOptimizer.d.ts +38 -0
  63. package/dist/managers/NotamManager.d.ts +40 -0
  64. package/dist/managers/PerformanceManager.d.ts +40 -0
  65. package/dist/managers/PluginManager.d.ts +17 -0
  66. package/dist/managers/PopupManager.d.ts +2 -0
  67. package/dist/managers/RasterManager.d.ts +16 -0
  68. package/dist/managers/SelectFeature.d.ts +34 -0
  69. package/dist/managers/ThemeManage.d.ts +11 -0
  70. package/dist/managers/WindManager.d.ts +21 -0
  71. package/dist/nav-sdk.cjs +27061 -0
  72. package/dist/nav-sdk.d.ts +3228 -0
  73. package/dist/nav-sdk.esm.js +27037 -0
  74. package/dist/nav-sdk.min.js +1 -0
  75. package/dist/nav-sdk.umd.js +27067 -0
  76. package/dist/plugins/DrawPlugin.d.ts +14 -0
  77. package/dist/plugins/MeasurePlugin.d.ts +26 -0
  78. package/dist/sdk.style.css +696 -0
  79. package/dist/style/amm-chart.d.ts +439 -0
  80. package/dist/style/aviation-chart.d.ts +2354 -0
  81. package/dist/types/index.d.ts +212 -0
  82. package/package.json +64 -21
  83. package/dist/aviation-chart.umd.js +0 -6
  84. package/dist/index.cjs +0 -6
  85. package/dist/index.js +0 -3571
  86. package/preview.html +0 -48
package/dist/index.cjs DELETED
@@ -1,6 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const jt=require("maplibre-gl");var vt,Ct,Pt;function Ot(o,r){if(!vt)vt=r;else if(!Ct)Ct=r;else{var d="var sharedChunk = {}; ("+vt+")(sharedChunk); ("+Ct+")(sharedChunk);",y={};vt(y),Pt=r(y),typeof window<"u"&&(Pt.workerUrl=window.URL.createObjectURL(new Blob([d],{type:"text/javascript"})))}}Ot(["exports"],function(o){class r{constructor(e,i){this.start=e,this.end=i,this.points=[],this.append=this.append.bind(this),this.prepend=this.prepend.bind(this)}append(e,i){this.points.push(Math.round(e),Math.round(i))}prepend(e,i){this.points.splice(0,0,Math.round(e),Math.round(i))}lineString(){return this.toArray()}isEmpty(){return this.points.length<2}appendFragment(e){this.points.push(...e.points),this.end=e.end}toArray(){return this.points}}const d=[[],[[[1,2],[0,1]]],[[[2,1],[1,2]]],[[[2,1],[0,1]]],[[[1,0],[2,1]]],[[[1,2],[0,1]],[[1,0],[2,1]]],[[[1,0],[1,2]]],[[[1,0],[0,1]]],[[[0,1],[1,0]]],[[[1,2],[1,0]]],[[[0,1],[1,0]],[[2,1],[1,2]]],[[[2,1],[1,0]]],[[[0,1],[2,1]]],[[[1,2],[2,1]]],[[[0,1],[1,2]]],[]];function y(t,e,i,n){return e=e*2+n[0],i=i*2+n[1],e+i*(t+1)*2}function g(t,e,i){return(e-t)/(i-t)}function w(t,e,i=4096,n=1){if(!t)return{};const a=i/(e.width-1);let l,s,c,m,h,f;const u={},_=new Map,F=new Map;function M(P,L,R){P[0]===0?R(a*(f-1),a*(h-g(c,L,l))):P[0]===2?R(a*f,a*(h-g(m,L,s))):P[1]===0?R(a*(f-g(s,L,l)),a*(h-1)):R(a*(f-g(m,L,c)),a*h)}for(h=1-n;h<e.height+n;h++){s=e.get(0,h-1),m=e.get(0,h);let P=Math.min(s,m),L=Math.max(s,m);for(f=1-n;f<e.width+n;f++){l=s,c=m,s=e.get(f,h-1),m=e.get(f,h);const R=P,V=L;if(P=Math.min(s,m),L=Math.max(s,m),isNaN(l)||isNaN(s)||isNaN(m)||isNaN(c))continue;const ut=Math.min(R,P),pt=Math.max(V,L),X=Math.ceil(ut/t)*t,ot=Math.floor(pt/t)*t;for(let C=X;C<=ot;C+=t){const At=l>C,q=s>C,nt=c>C,_t=m>C;for(const bt of d[(At?8:0)|(q?4:0)|(_t?2:0)|(nt?1:0)]){let H=_.get(C);H||_.set(C,H=new Map);let lt=F.get(C);lt||F.set(C,lt=new Map);const Rt=bt[0],zt=bt[1],yt=y(e.width,f,h,Rt),st=y(e.width,f,h,zt);let G,Tt;if(G=lt.get(yt))if(lt.delete(yt),Tt=H.get(st))if(H.delete(st),G===Tt){if(M(zt,C,G.append),!G.isEmpty()){let rt=u[C];rt||(u[C]=rt=[]),rt.push(G.lineString())}}else G.appendFragment(Tt),lt.set(G.end=Tt.end,G);else M(zt,C,G.append),lt.set(G.end=st,G);else if(G=H.get(st))H.delete(st),M(Rt,C,G.prepend),H.set(G.start=yt,G);else{const rt=new r(yt,st);M(Rt,C,rt.append),M(zt,C,rt.append),H.set(yt,rt),lt.set(st,rt)}}}}}for(const[P,L]of _.entries()){let R=null;for(const V of L.values())V.isEmpty()||(R==null&&(R=u[P]||(u[P]=[])),R.push(V.lineString()))}return u}function b(t){const e=Object.entries(t);return e.sort(([i],[n])=>i<n?-1:i>n?1:0),e}function S(t){return b(t).map(([e,i])=>[e,...typeof i=="number"?[i]:i].join("*")).join("~")}function O(t){return Object.fromEntries(t.split("~").map(e=>e.split("*").map(Number)).map(([e,...i])=>[e,i]))}function A({thresholds:t,...e}){return b({thresholds:S(t),...e}).map(([i,n])=>`${encodeURIComponent(i)}=${encodeURIComponent(n)}`).join("&")}function z(t){return Object.fromEntries(t.replace(/^.*\?/,"").split("&").map(e=>{const i=e.split("=").map(decodeURIComponent),n=i[0];let a=i[1];switch(n){case"thresholds":a=O(a);break;case"extent":case"multiplier":case"overzoom":case"buffer":a=Number(a)}return[n,a]}))}function p(t){return b(t).map(([e,i])=>`${encodeURIComponent(e)}=${encodeURIComponent(i)}`).join(",")}function x(t,e){const{thresholds:i,...n}=t;let a=[],l=-1/0;return Object.entries(i).forEach(([s,c])=>{const m=Number(s);m<=e&&m>l&&(l=m,a=typeof c=="number"?[c]:c)}),{levels:a,...n}}function T(t){const e=new ArrayBuffer(t.byteLength);return new Uint8Array(e).set(new Uint8Array(t)),e}function D(t,e){return t.then(({data:i,...n})=>{let a=i;return e&&(a=new Float32Array(i.length),a.set(i)),{...n,data:a,transferrables:[a.buffer]}})}function k(t){return t.then(({arrayBuffer:e})=>{const i=T(e);return{arrayBuffer:i,transferrables:[i]}})}let j=null;function mt(){return j==null&&(j=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),j||!1}let tt=null;function Y(){if(tt==null&&(tt=!1,mt()&&typeof VideoFrame<"u")){const i=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(i){for(let a=0;a<5*5;a++){const l=a*4;i.fillStyle=`rgb(${l},${l+1},${l+2})`,i.fillRect(a%5,Math.floor(a/5),1,1)}const n=i.getImageData(0,0,5,5).data;for(let a=0;a<5*5*4;a++)if(a%4!==3&&n[a]!==a){tt=!0;break}}}return tt||!1}function I(t,e,i){let n=()=>{};const a=setTimeout(()=>{n(new Error("timed out")),i==null||i.abort()},t);U(i,()=>{n(new Error("aborted")),clearTimeout(a)});const l=new Promise((s,c)=>{n=c});return Promise.race([l,e.finally(()=>clearTimeout(a))])}function U(t,e){e&&(t==null||t.signal.addEventListener("abort",e))}function B(t){var e;return!!(!((e=t==null?void 0:t.signal)===null||e===void 0)&&e.aborted)}let E=0;class Z{constructor(e=100){this.size=()=>this.items.size,this.get=(i,n,a)=>{let l=this.items.get(i);if(l)l.lastUsed=++E,l.waiting++;else{const h=new AbortController,f=n(i,h);l={abortController:h,item:f,lastUsed:++E,waiting:1},this.items.set(i,l),this.prune()}const s=this.items,c=l.item.then(h=>h,h=>(s.delete(i),Promise.reject(h)));let m=!1;return U(a,()=>{var h;l&&l.abortController&&!m&&(m=!0,--l.waiting<=0&&((h=l.abortController)===null||h===void 0||h.abort(),s.delete(i)))}),c},this.clear=()=>this.items.clear(),this.maxSize=e,this.items=new Map}prune(){if(this.items.size>this.maxSize){let e,i=1/0;this.items.forEach((n,a)=>{n.lastUsed<i&&(i=n.lastUsed,e=a)}),typeof e<"u"&&this.items.delete(e)}}}let K,et,N,it;async function at(t,e,i){const n=await createImageBitmap(t);return B(i)?null:W(n,e)}function W(t,e){return K||(K=new OffscreenCanvas(t.width,t.height),et=K.getContext("2d",{willReadFrequently:!0})),Gt(t,e,K,et)}async function xt(t,e,i){var n,a,l;const s=await createImageBitmap(t);if(B(i))return null;const c=new VideoFrame(s,{timestamp:0});try{if(!(((n=c==null?void 0:c.format)===null||n===void 0?void 0:n.startsWith("BGR"))||((a=c==null?void 0:c.format)===null||a===void 0?void 0:a.startsWith("RGB"))))throw new Error(`Unrecognized format: ${c==null?void 0:c.format}`);const h=(l=c==null?void 0:c.format)===null||l===void 0?void 0:l.startsWith("BGR"),f=c.allocationSize(),u=new Uint8ClampedArray(f);if(await c.copyTo(u),h)for(let _=0;_<u.length;_+=4){const F=u[_];u[_]=u[_+2],u[_+2]=F}return Et(s.width,s.height,e,u)}catch{return B(i)?null:W(s,e)}finally{c.close()}}async function qt(t,e,i){N||(N=document.createElement("canvas"),it=N.getContext("2d",{willReadFrequently:!0}));const n=new Image;U(i,()=>n.src="");const a=await new Promise((l,s)=>{n.onload=()=>{B(i)||l(n),URL.revokeObjectURL(n.src),n.onload=null},n.onerror=()=>s(new Error("Could not load image.")),n.src=t.size?URL.createObjectURL(t):""});return Gt(a,e,N,it)}function te(t,e,i){return self.actor.send("decodeImage",[],i,void 0,t,e)}function ee(){return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope}const Lt=Y()?xt:mt()?at:ee()?te:qt;function Gt(t,e,i,n){if(i.width=t.width,i.height=t.height,!n)throw new Error("failed to get context");n.drawImage(t,0,0,t.width,t.height);const a=n.getImageData(0,0,t.width,t.height).data;return Et(t.width,t.height,e,a)}function Et(t,e,i,n){const a=i==="mapbox"?(s,c,m)=>-1e4+(s*256*256+c*256+m)*.1:(s,c,m)=>s*256+c+m/256-32768,l=new Float32Array(t*e);for(let s=0;s<n.length;s+=4)l[s/4]=a(n[s],n[s+1],n[s+2]);return{width:t,height:e,data:l}}const ie=-12e3,oe=9e3;function re(t){return!isNaN(t)&&t>=ie&&t<=oe}class ${constructor(e,i,n){this.split=(a,l,s)=>{if(a===0)return this;const c=1<<a,m=l*this.width/c,h=s*this.height/c;return new $(this.width/c,this.height/c,(f,u)=>this.get(f+m,u+h))},this.subsamplePixelCenters=a=>{const l=(m,h,f)=>isNaN(m)?h:isNaN(h)?m:m+(h-m)*f;if(a<=1)return this;const s=.5-1/(2*a),c=(m,h)=>{const f=m/a-s,u=h/a-s,_=Math.floor(f),F=Math.floor(u),M=this.get(_,F),P=this.get(_+1,F),L=this.get(_,F+1),R=this.get(_+1,F+1),V=f-_,ut=u-F,pt=l(M,P,V),X=l(L,R,V);return l(pt,X,ut)};return new $(this.width*a,this.height*a,c)},this.averagePixelCentersToGrid=(a=1)=>new $(this.width+1,this.height+1,(l,s)=>{let c=0,m=0,h=0;for(let f=l-a;f<l+a;f++)for(let u=s-a;u<s+a;u++)isNaN(h=this.get(f,u))||(m++,c+=h);return m===0?NaN:c/m}),this.scaleElevation=a=>a===1?this:new $(this.width,this.height,(l,s)=>this.get(l,s)*a),this.materialize=(a=2)=>{const l=this.width+2*a,s=new Float32Array(l*(this.height+2*a));let c=0;for(let m=-a;m<this.height+a;m++)for(let h=-a;h<this.width+a;h++)s[c++]=this.get(h,m);return new $(this.width,this.height,(m,h)=>s[(h+a)*l+m+a])},this.get=n,this.width=e,this.height=i}static fromRawDem(e){return new $(e.width,e.height,(i,n)=>{const a=e.data[n*e.width+i];return re(a)?a:NaN})}static combineNeighbors(e){if(e.length!==9)throw new Error("Must include a tile plus 8 neighbors");const i=e[4];if(!i)return;const n=i.width,a=i.height;return new $(n,a,(l,s)=>{let c=0;s<0?s+=a:s<a?c+=3:(s-=a,c+=6),l<0?l+=n:l<n?c+=1:(l-=n,c+=2);const m=e[c];return m?m.get(l,s):NaN})}}function ae(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Ft={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */Ft.read=function(t,e,i,n,a){var l,s,c=a*8-n-1,m=(1<<c)-1,h=m>>1,f=-7,u=i?a-1:0,_=i?-1:1,F=t[e+u];for(u+=_,l=F&(1<<-f)-1,F>>=-f,f+=c;f>0;l=l*256+t[e+u],u+=_,f-=8);for(s=l&(1<<-f)-1,l>>=-f,f+=n;f>0;s=s*256+t[e+u],u+=_,f-=8);if(l===0)l=1-h;else{if(l===m)return s?NaN:(F?-1:1)*(1/0);s=s+Math.pow(2,n),l=l-h}return(F?-1:1)*s*Math.pow(2,l-n)},Ft.write=function(t,e,i,n,a,l){var s,c,m,h=l*8-a-1,f=(1<<h)-1,u=f>>1,_=a===23?Math.pow(2,-24)-Math.pow(2,-77):0,F=n?0:l-1,M=n?1:-1,P=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(c=isNaN(e)?1:0,s=f):(s=Math.floor(Math.log(e)/Math.LN2),e*(m=Math.pow(2,-s))<1&&(s--,m*=2),s+u>=1?e+=_/m:e+=_*Math.pow(2,1-u),e*m>=2&&(s++,m/=2),s+u>=f?(c=0,s=f):s+u>=1?(c=(e*m-1)*Math.pow(2,a),s=s+u):(c=e*Math.pow(2,u-1)*Math.pow(2,a),s=0));a>=8;t[i+F]=c&255,F+=M,c/=256,a-=8);for(s=s<<a|c,h+=a;h>0;t[i+F]=s&255,F+=M,s/=256,h-=8);t[i+F-M]|=P*128};var ne=v,gt=Ft;function v(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}v.Varint=0,v.Fixed64=1,v.Bytes=2,v.Fixed32=5;var St=65536*65536,It=1/St,le=12,Bt=typeof TextDecoder>"u"?null:new TextDecoder("utf8");v.prototype={destroy:function(){this.buf=null},readFields:function(t,e,i){for(i=i||this.length;this.pos<i;){var n=this.readVarint(),a=n>>3,l=this.pos;this.type=n&7,t(a,e,this),this.pos===l&&this.skip(n)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=wt(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=Nt(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=wt(this.buf,this.pos)+wt(this.buf,this.pos+4)*St;return this.pos+=8,t},readSFixed64:function(){var t=wt(this.buf,this.pos)+Nt(this.buf,this.pos+4)*St;return this.pos+=8,t},readFloat:function(){var t=gt.read(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=gt.read(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e=this.buf,i,n;return n=e[this.pos++],i=n&127,n<128||(n=e[this.pos++],i|=(n&127)<<7,n<128)||(n=e[this.pos++],i|=(n&127)<<14,n<128)||(n=e[this.pos++],i|=(n&127)<<21,n<128)?i:(n=e[this.pos],i|=(n&15)<<28,se(i,t,this))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2===1?(t+1)/-2:t/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=le&&Bt?ze(this.buf,e,t):be(this.buf,e,t)},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){if(this.type!==v.Bytes)return t.push(this.readVarint(e));var i=J(this);for(t=t||[];this.pos<i;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){if(this.type!==v.Bytes)return t.push(this.readSVarint());var e=J(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==v.Bytes)return t.push(this.readBoolean());var e=J(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==v.Bytes)return t.push(this.readFloat());var e=J(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==v.Bytes)return t.push(this.readDouble());var e=J(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==v.Bytes)return t.push(this.readFixed32());var e=J(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==v.Bytes)return t.push(this.readSFixed32());var e=J(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==v.Bytes)return t.push(this.readFixed64());var e=J(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==v.Bytes)return t.push(this.readSFixed64());var e=J(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=t&7;if(e===v.Varint)for(;this.buf[this.pos++]>127;);else if(e===v.Bytes)this.pos=this.readVarint()+this.pos;else if(e===v.Fixed32)this.pos+=4;else if(e===v.Fixed64)this.pos+=8;else throw new Error("Unimplemented type: "+e)},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e<this.pos+t;)e*=2;if(e!==this.length){var i=new Uint8Array(e);i.set(this.buf),this.buf=i,this.length=e}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(t){this.realloc(4),ft(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),ft(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),ft(this.buf,t&-1,this.pos),ft(this.buf,Math.floor(t*It),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),ft(this.buf,t&-1,this.pos),ft(this.buf,Math.floor(t*It),this.pos+4),this.pos+=8},writeVarint:function(t){if(t=+t||0,t>268435455||t<0){ce(t,this);return}this.realloc(4),this.buf[this.pos++]=t&127|(t>127?128:0),!(t<=127)&&(this.buf[this.pos++]=(t>>>=7)&127|(t>127?128:0),!(t<=127)&&(this.buf[this.pos++]=(t>>>=7)&127|(t>127?128:0),!(t<=127)&&(this.buf[this.pos++]=t>>>7&127)))},writeSVarint:function(t){this.writeVarint(t<0?-t*2-1:t*2)},writeBoolean:function(t){this.writeVarint(!!t)},writeString:function(t){t=String(t),this.realloc(t.length*4),this.pos++;var e=this.pos;this.pos=Te(this.buf,t,this.pos);var i=this.pos-e;i>=128&&Xt(e,i,this),this.pos=e-1,this.writeVarint(i),this.pos+=i},writeFloat:function(t){this.realloc(4),gt.write(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),gt.write(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var i=0;i<e;i++)this.buf[this.pos++]=t[i]},writeRawMessage:function(t,e){this.pos++;var i=this.pos;t(e,this);var n=this.pos-i;n>=128&&Xt(i,n,this),this.pos=i-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,i){this.writeTag(t,v.Bytes),this.writeRawMessage(e,i)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,fe,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,de,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,ye,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,ue,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,pe,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,xe,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,ge,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,we,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,_e,e)},writeBytesField:function(t,e){this.writeTag(t,v.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,v.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,v.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,v.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,v.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,v.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,v.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,v.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,v.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,v.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,!!e)}};function se(t,e,i){var n=i.buf,a,l;if(l=n[i.pos++],a=(l&112)>>4,l<128||(l=n[i.pos++],a|=(l&127)<<3,l<128)||(l=n[i.pos++],a|=(l&127)<<10,l<128)||(l=n[i.pos++],a|=(l&127)<<17,l<128)||(l=n[i.pos++],a|=(l&127)<<24,l<128)||(l=n[i.pos++],a|=(l&1)<<31,l<128))return ht(t,a,e);throw new Error("Expected varint not more than 10 bytes")}function J(t){return t.type===v.Bytes?t.readVarint()+t.pos:t.pos+1}function ht(t,e,i){return i?e*4294967296+(t>>>0):(e>>>0)*4294967296+(t>>>0)}function ce(t,e){var i,n;if(t>=0?(i=t%4294967296|0,n=t/4294967296|0):(i=~(-t%4294967296),n=~(-t/4294967296),i^4294967295?i=i+1|0:(i=0,n=n+1|0)),t>=18446744073709552e3||t<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),me(i,n,e),he(n,e)}function me(t,e,i){i.buf[i.pos++]=t&127|128,t>>>=7,i.buf[i.pos++]=t&127|128,t>>>=7,i.buf[i.pos++]=t&127|128,t>>>=7,i.buf[i.pos++]=t&127|128,t>>>=7,i.buf[i.pos]=t&127}function he(t,e){var i=(t&7)<<4;e.buf[e.pos++]|=i|((t>>>=3)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127)))))}function Xt(t,e,i){var n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(Math.LN2*7));i.realloc(n);for(var a=i.pos-1;a>=t;a--)i.buf[a+n]=i.buf[a]}function fe(t,e){for(var i=0;i<t.length;i++)e.writeVarint(t[i])}function de(t,e){for(var i=0;i<t.length;i++)e.writeSVarint(t[i])}function ue(t,e){for(var i=0;i<t.length;i++)e.writeFloat(t[i])}function pe(t,e){for(var i=0;i<t.length;i++)e.writeDouble(t[i])}function ye(t,e){for(var i=0;i<t.length;i++)e.writeBoolean(t[i])}function xe(t,e){for(var i=0;i<t.length;i++)e.writeFixed32(t[i])}function ge(t,e){for(var i=0;i<t.length;i++)e.writeSFixed32(t[i])}function we(t,e){for(var i=0;i<t.length;i++)e.writeFixed64(t[i])}function _e(t,e){for(var i=0;i<t.length;i++)e.writeSFixed64(t[i])}function wt(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+t[e+3]*16777216}function ft(t,e,i){t[i]=e,t[i+1]=e>>>8,t[i+2]=e>>>16,t[i+3]=e>>>24}function Nt(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}function be(t,e,i){for(var n="",a=e;a<i;){var l=t[a],s=null,c=l>239?4:l>223?3:l>191?2:1;if(a+c>i)break;var m,h,f;c===1?l<128&&(s=l):c===2?(m=t[a+1],(m&192)===128&&(s=(l&31)<<6|m&63,s<=127&&(s=null))):c===3?(m=t[a+1],h=t[a+2],(m&192)===128&&(h&192)===128&&(s=(l&15)<<12|(m&63)<<6|h&63,(s<=2047||s>=55296&&s<=57343)&&(s=null))):c===4&&(m=t[a+1],h=t[a+2],f=t[a+3],(m&192)===128&&(h&192)===128&&(f&192)===128&&(s=(l&15)<<18|(m&63)<<12|(h&63)<<6|f&63,(s<=65535||s>=1114112)&&(s=null))),s===null?(s=65533,c=1):s>65535&&(s-=65536,n+=String.fromCharCode(s>>>10&1023|55296),s=56320|s&1023),n+=String.fromCharCode(s),a+=c}return n}function ze(t,e,i){return Bt.decode(t.subarray(e,i))}function Te(t,e,i){for(var n=0,a,l;n<e.length;n++){if(a=e.charCodeAt(n),a>55295&&a<57344)if(l)if(a<56320){t[i++]=239,t[i++]=191,t[i++]=189,l=a;continue}else a=l-55296<<10|a-56320|65536,l=null;else{a>56319||n+1===e.length?(t[i++]=239,t[i++]=191,t[i++]=189):l=a;continue}else l&&(t[i++]=239,t[i++]=191,t[i++]=189,l=null);a<128?t[i++]=a:(a<2048?t[i++]=a>>6|192:(a<65536?t[i++]=a>>12|224:(t[i++]=a>>18|240,t[i++]=a>>12&63|128),t[i++]=a>>6&63|128),t[i++]=a&63|128)}return i}var ve=ae(ne),dt;(function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.POINT=1]="POINT",t[t.LINESTRING=2]="LINESTRING",t[t.POLYGON=3]="POLYGON"})(dt||(dt={}));function De(t){const e=new ve;for(const i in t.layers){const n=t.layers[i];n.extent||(n.extent=t.extent),e.writeMessage(3,Ee,{...n,id:i})}return e.finish()}function Ee(t,e){if(!e)throw new Error("pbf undefined");e.writeVarintField(15,2),e.writeStringField(1,t.id||""),e.writeVarintField(5,t.extent||4096);const i={keys:[],values:[],keycache:{},valuecache:{}};for(const n of t.features)i.feature=n,e.writeMessage(2,Fe,i);for(const n of i.keys)e.writeStringField(3,n);for(const n of i.values)e.writeMessage(4,Ae,n)}function Fe(t,e){const i=t.feature;if(!i||!e)throw new Error;e.writeMessage(2,Se,t),e.writeVarintField(3,i.type),e.writeMessage(4,ke,i)}function Se(t,e){const i=t.feature;if(!i||!e)throw new Error;const n=t.keys,a=t.values,l=t.keycache,s=t.valuecache;for(const c in i.properties){let m=i.properties[c],h=l[c];if(m===null)continue;typeof h>"u"&&(n.push(c),h=n.length-1,l[c]=h),e.writeVarint(h);const f=typeof m;f!=="string"&&f!=="boolean"&&f!=="number"&&(m=JSON.stringify(m));const u=`${f}:${m}`;let _=s[u];typeof _>"u"&&(a.push(m),_=a.length-1,s[u]=_),e.writeVarint(_)}}function kt(t,e){return(e<<3)+(t&7)}function Vt(t){return t<<1^t>>31}function ke(t,e){if(!e)throw new Error;const i=t.geometry,n=t.type;let a=0,l=0;for(const s of i){let c=1;n===dt.POINT&&(c=s.length/2),e.writeVarint(kt(1,c));const m=s.length/2,h=n===dt.POLYGON?m-1:m;for(let f=0;f<h;f++){f===1&&n!==1&&e.writeVarint(kt(2,h-1));const u=s[f*2]-a,_=s[f*2+1]-l;e.writeVarint(Vt(u)),e.writeVarint(Vt(_)),a+=u,l+=_}n===dt.POLYGON&&e.writeVarint(kt(7,1))}}function Ae(t,e){if(!e)throw new Error;typeof t=="string"?e.writeStringField(1,t):typeof t=="boolean"?e.writeBooleanField(7,t):typeof t=="number"&&(t%1!==0?e.writeDoubleField(3,t):t<0?e.writeSVarintField(6,t):e.writeVarintField(5,t))}class Re{constructor(e,i,n,a,l){this.loaded=Promise.resolve(),this.decodeImage=Lt,this.fetchAndParseTile=(s,c,m,h,f)=>{const u=this,_=this.demUrlPattern.replace("{z}",s.toString()).replace("{x}",c.toString()).replace("{y}",m.toString());return f==null||f.useTile(_),this.parsedCache.get(_,async(F,M)=>{const P=await u.fetchTile(s,c,m,M,f);if(B(M))throw new Error("canceled");const L=u.decodeImage(P.data,u.encoding,M),R=f==null?void 0:f.marker("decode"),V=await L;return R==null||R(),V},h)},this.tileCache=new Z(i),this.parsedCache=new Z(i),this.contourCache=new Z(i),this.timeoutMs=l,this.demUrlPattern=e,this.encoding=n,this.maxzoom=a}fetchTile(e,i,n,a,l){const s=this.demUrlPattern.replace("{z}",e.toString()).replace("{x}",i.toString()).replace("{y}",n.toString());return l==null||l.useTile(s),this.tileCache.get(s,(c,m)=>{const h={signal:m.signal};l==null||l.fetchTile(s);const f=l==null?void 0:l.marker("fetch");return I(this.timeoutMs,fetch(s,h).then(async u=>{if(f==null||f(),!u.ok)throw new Error(`Bad response: ${u.status} for ${s}`);return{data:await u.blob(),expires:u.headers.get("expires")||void 0,cacheControl:u.headers.get("cache-control")||void 0}}),m)},a)}async fetchDem(e,i,n,a,l,s){const c=Math.min(e-(a.overzoom||0),this.maxzoom),m=e-c,h=1<<m,f=Math.floor(i/h),u=Math.floor(n/h),_=await this.fetchAndParseTile(c,f,u,l,s);return $.fromRawDem(_).split(m,i%h,n%h)}fetchContourTile(e,i,n,a,l,s){const{levels:c,multiplier:m=1,buffer:h=1,extent:f=4096,contourLayer:u="contours",elevationKey:_="ele",levelKey:F="level",subsampleBelow:M=100}=a;if(!c||c.length===0)return Promise.resolve({arrayBuffer:new ArrayBuffer(0)});const P=[e,i,n,p(a)].join("/");return this.contourCache.get(P,async(L,R)=>{const V=1<<e,ut=[];for(let q=n-1;q<=n+1;q++)for(let nt=i-1;nt<=i+1;nt++)ut.push(q<0||q>=V?void 0:this.fetchDem(e,(nt+V)%V,q,a,R,s));const pt=await Promise.all(ut);let X=$.combineNeighbors(pt);if(!X||B(R))return{arrayBuffer:new Uint8Array().buffer};const ot=s==null?void 0:s.marker("isoline");if(X.width>=M)X=X.materialize(2);else for(;X.width<M;)X=X.subsamplePixelCenters(2).materialize(2);X=X.averagePixelCentersToGrid().scaleElevation(m).materialize(1);const C=w(c[0],X,f,h);ot==null||ot();const At=De({extent:f,layers:{[u]:{features:Object.entries(C).map(([q,nt])=>{const _t=Number(q);return{type:dt.LINESTRING,geometry:nt,properties:{[_]:_t,[F]:Math.max(...c.map((bt,H)=>_t%bt===0?H:0))}}})}}});return ot==null||ot(),{arrayBuffer:At.buffer}},l)}}const Q=typeof performance<"u"?performance:void 0,Ce=Q?Q.timeOrigin||new Date().getTime()-Q.now():new Date().getTime();function Me(t){var e;return JSON.parse(JSON.stringify(((e=Q==null?void 0:Q.getEntriesByName)===null||e===void 0?void 0:e.call(Q,t))||[]))}function Ut(){return Q?Q.now():new Date().getTime()}function Pe(t){const e=[];for(const i of t)e.push(...i);return e}class Wt{constructor(e){this.marks={},this.urls=[],this.fetched=[],this.resources=[],this.tilesFetched=0,this.timeOrigin=Ce,this.finish=i=>{this.markFinish();const n=m=>{const h=this.marks[m]||[],f=Math.max(...h.map(_=>Math.max(..._))),u=Math.min(...h.map(_=>Math.min(..._)));return Number.isFinite(f)?f-u:void 0},a=n("main")||0,l=n("fetch"),s=n("decode"),c=n("isoline");return{url:i,tilesUsed:this.tilesFetched,origin:this.timeOrigin,marks:this.marks,resources:[...this.resources,...Pe(this.fetched.map(Me))],duration:a,fetch:l,decode:s,process:c,wait:a-(l||0)-(s||0)-(c||0)}},this.error=i=>({...this.finish(i),error:!0}),this.marker=i=>{var n;this.marks[i]||(this.marks[i]=[]);const a=[Ut()];return(n=this.marks[i])===null||n===void 0||n.push(a),()=>a.push(Ut())},this.useTile=i=>{this.urls.indexOf(i)<0&&(this.urls.push(i),this.tilesFetched++)},this.fetchTile=i=>{this.fetched.indexOf(i)<0&&this.fetched.push(i)},this.addAll=i=>{var n;this.tilesFetched+=i.tilesUsed;const a=i.origin-this.timeOrigin;for(const l in i.marks){const s=l;(this.marks[s]||(this.marks[s]=[])).push(...((n=i.marks[s])===null||n===void 0?void 0:n.map(m=>m.map(h=>h+a)))||[])}this.resources.push(...i.resources.map(l=>Le(l,a)))},this.markFinish=this.marker(e)}}const Oe=/(Start$|End$|^start|^end)/;function Le(t,e){const i={};for(const n in t)t[n]!==0&&Oe.test(n)?i[n]=Number(t[n])+e:i[n]=t[n];return i}let Ge=0;class Ie{constructor(e,i,n=2e4){this.callbacks={},this.cancels={},this.dest=e,this.timeoutMs=n,this.dest.onmessage=async({data:a})=>{const l=a;if(l.type==="cancel"){const s=this.cancels[l.id];delete this.cancels[l.id],s==null||s.abort()}else if(l.type==="response"){const s=this.callbacks[l.id];delete this.callbacks[l.id],s&&s(l.error?new Error(l.error):void 0,l.response,l.timings)}else if(l.type==="request"){const s=new Wt("worker"),c=i[l.name],m=new AbortController,h=c.apply(c,[...l.args,m,s]),f=`${l.name}_${l.id}`;if(l.id&&h){this.cancels[l.id]=m;try{const u=await h,_=u==null?void 0:u.transferrables;this.postMessage({id:l.id,type:"response",response:u,timings:s.finish(f)},_)}catch(u){this.postMessage({id:l.id,type:"response",error:(u==null?void 0:u.toString())||"error",timings:s.finish(f)})}delete this.cancels[l.id]}}}}postMessage(e,i){this.dest.postMessage(e,i||[])}send(e,i,n,a,...l){const s=++Ge,c=new Promise((m,h)=>{this.postMessage({id:s,type:"request",name:e,args:l},i),this.callbacks[s]=(f,u,_)=>{a==null||a.addAll(_),f?h(f):m(u)}});return U(n,()=>{delete this.callbacks[s],this.postMessage({id:s,type:"cancel"})}),I(this.timeoutMs,c,n)}}o.A=Ie,o.H=$,o.L=Re,o.T=Wt,o.a=z,o.b=w,o.c=Et,o.d=Lt,o.e=A,o.f=k,o.g=x,o.p=D});Ot(["./shared"],function(o){const r=g=>Promise.reject(new Error(`No manager registered for ${g}`));class d{constructor(){this.managers={},this.init=(w,b)=>(this.managers[w.managerId]=new o.L(w.demUrlPattern,w.cacheSize,w.encoding,w.maxzoom,w.timeoutMs),Promise.resolve()),this.fetchTile=(w,b,S,O,A,z)=>{var p;return((p=this.managers[w])===null||p===void 0?void 0:p.fetchTile(b,S,O,A,z))||r(w)},this.fetchAndParseTile=(w,b,S,O,A,z)=>{var p;return o.p(((p=this.managers[w])===null||p===void 0?void 0:p.fetchAndParseTile(b,S,O,A,z))||r(w),!0)},this.fetchContourTile=(w,b,S,O,A,z,p)=>{var x;return o.f(((x=this.managers[w])===null||x===void 0?void 0:x.fetchContourTile(b,S,O,A,z,p))||r(w))}}}const y=typeof self<"u"?self:typeof window<"u"?window:global;y.actor=new o.A(y,new d)});Ot(["./shared"],function(o){const r={workerUrl:""};let d,y=0;class g{constructor(){this.decodeImage=(x,T,D)=>o.p(o.d(x,T,D),!1)}}function w(){if(!d){const p=new Worker(r.workerUrl),x=new g;d=new o.A(p,x)}return d}class b{constructor(x,T,D,k,j,mt){this.fetchTile=(Y,I,U,B,E)=>this.actor.send("fetchTile",[],B,E,this.managerId,Y,I,U),this.fetchAndParseTile=(Y,I,U,B,E)=>this.actor.send("fetchAndParseTile",[],B,E,this.managerId,Y,I,U),this.fetchContourTile=(Y,I,U,B,E,Z)=>this.actor.send("fetchContourTile",[],E,Z,this.managerId,Y,I,U,B);const tt=this.managerId=++y;this.actor=mt||w(),this.loaded=this.actor.send("init",[],new AbortController,void 0,{cacheSize:T,demUrlPattern:x,encoding:D,maxzoom:k,managerId:tt,timeoutMs:j})}}Blob.prototype.arrayBuffer||(Blob.prototype.arrayBuffer=function(){return new Promise((x,T)=>{const D=new FileReader;D.onload=k=>{var j;return x((j=k.target)===null||j===void 0?void 0:j.result)},D.onerror=T,D.readAsArrayBuffer(this)})});const S=p=>(x,T)=>{if(T instanceof AbortController)return p(x,T);{const D=new AbortController;return p(x,D).then(k=>T(void 0,k.data,k.cacheControl,k.expires),k=>T(k)),{cancel:()=>D.abort()}}},O=new Set;class A{constructor({url:x,cacheSize:T=100,id:D="dem",encoding:k="terrarium",maxzoom:j=12,worker:mt=!0,timeoutMs:tt=1e4,actor:Y}){this.timingCallbacks=[],this.onTiming=E=>{this.timingCallbacks.push(E)},this.setupMaplibre=E=>{E.addProtocol(this.sharedDemProtocolId,this.sharedDemProtocol),E.addProtocol(this.contourProtocolId,this.contourProtocol)},this.sharedDemProtocolV4=async(E,Z)=>{const[K,et,N]=this.parseUrl(E.url),it=new o.T("main");let at;try{const W=await this.manager.fetchTile(K,et,N,Z,it);return at=it.finish(E.url),{data:await W.data.arrayBuffer(),cacheControl:W.cacheControl,expires:W.expires}}catch(W){throw at=it.error(E.url),W}finally{this.timingCallbacks.forEach(W=>W(at))}},this.contourProtocolV4=async(E,Z)=>{const K=new o.T("main");let et;try{const[N,it,at]=this.parseUrl(E.url),W=o.a(E.url),xt=await this.manager.fetchContourTile(N,it,at,o.g(W,N),Z,K);return et=K.finish(E.url),{data:xt.arrayBuffer}}catch(N){throw et=K.error(E.url),N}finally{this.timingCallbacks.forEach(N=>N(et))}},this.contourProtocol=S(this.contourProtocolV4),this.sharedDemProtocol=S(this.sharedDemProtocolV4),this.contourProtocolUrl=E=>`${this.contourProtocolUrlBase}?${o.e(E)}`;let I=D,U=1;for(;O.has(I);)I=D+U++;O.add(I),this.sharedDemProtocolId=`${I}-shared`,this.contourProtocolId=`${I}-contour`,this.sharedDemProtocolUrl=`${this.sharedDemProtocolId}://{z}/{x}/{y}`,this.contourProtocolUrlBase=`${this.contourProtocolId}://{z}/{x}/{y}`;const B=mt?b:o.L;this.manager=new B(x,T,k,j,tt,Y)}getDemTile(x,T,D,k){return this.manager.fetchAndParseTile(x,T,D,k||new AbortController)}parseUrl(x){const[,T,D,k]=/\/\/(\d+)\/(\d+)\/(\d+)/.exec(x)||[];return[Number(T),Number(D),Number(k)]}}return{generateIsolines:o.b,DemSource:A,HeightTile:o.H,LocalDemManager:o.L,decodeParsedImage:o.c,set workerUrl(p){r.workerUrl=p},get workerUrl(){return r.workerUrl}}});var Be=Pt;function Xe(o){return o}function Ne(o){if(o==null)return Xe;var r,d,y=o.scale[0],g=o.scale[1],w=o.translate[0],b=o.translate[1];return function(S,O){O||(r=d=0);var A=2,z=S.length,p=new Array(z);for(p[0]=(r+=S[0])*y+w,p[1]=(d+=S[1])*g+b;A<z;)p[A]=S[A],++A;return p}}function Ve(o,r){for(var d,y=o.length,g=y-r;g<--y;)d=o[g],o[g++]=o[y],o[y]=d}function $t(o,r){return typeof r=="string"&&(r=o.objects[r]),r.type==="GeometryCollection"?{type:"FeatureCollection",features:r.geometries.map(function(d){return Kt(o,d)})}:Kt(o,r)}function Kt(o,r){var d=r.id,y=r.bbox,g=r.properties==null?{}:r.properties,w=Ue(o,r);return d==null&&y==null?{type:"Feature",properties:g,geometry:w}:y==null?{type:"Feature",id:d,properties:g,geometry:w}:{type:"Feature",id:d,bbox:y,properties:g,geometry:w}}function Ue(o,r){var d=Ne(o.transform),y=o.arcs;function g(z,p){p.length&&p.pop();for(var x=y[z<0?~z:z],T=0,D=x.length;T<D;++T)p.push(d(x[T],T));z<0&&Ve(p,D)}function w(z){return d(z)}function b(z){for(var p=[],x=0,T=z.length;x<T;++x)g(z[x],p);return p.length<2&&p.push(p[0]),p}function S(z){for(var p=b(z);p.length<4;)p.push(p[0]);return p}function O(z){return z.map(S)}function A(z){var p=z.type,x;switch(p){case"GeometryCollection":return{type:p,geometries:z.geometries.map(A)};case"Point":x=w(z.coordinates);break;case"MultiPoint":x=z.coordinates.map(w);break;case"LineString":x=b(z.arcs);break;case"MultiLineString":x=z.arcs.map(b);break;case"Polygon":x=O(z.arcs);break;case"MultiPolygon":x=z.arcs.map(O);break;default:return null}return{type:p,coordinates:x}}return A(r)}const We={airspaceStroke:"#AAB7B8",restrictedStroke:"#D35400",controlledStroke:"#10B981",controlledFill:"#10B981",segment:"#2E4053",waypoint:"#1C2526",vor:"#00008B",ndb:"#0066CC",airport:"#006400",runway:"#333333"};function je(){const o="navdata",r=We;return[{id:"landLaye",type:"fill",source:"land",layout:{visibility:"visible"},paint:{"fill-color":"#F7F9FB","fill-opacity":1}},{id:"boundary",type:"line",source:"boundary",minzoom:.5,paint:{"line-width":["interpolate",["linear"],["zoom"],0,1,7,4],"line-opacity":1,"line-pattern":"normal:national-border"}},{id:"adiz-line",type:"line",source:o,"source-layer":"adiz",minzoom:3,layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":4,"line-pattern":"normal:adiz","line-opacity":["interpolate",["linear"],["zoom"],3,.6,8,.4]}},{id:"adiz-label",type:"symbol",source:o,"source-layer":"adiz-centroid",minzoom:3,layout:{"text-field":["coalesce",["get","TXT_NAME"],["get","CODE_ID"]],"text-size":10,"text-max-width":10,"symbol-placement":"point"},paint:{"text-color":"#6600cc","text-halo-color":"#ffffff","text-halo-width":1.5}},{id:"fir-line",type:"line",source:o,"source-layer":"fir",minzoom:2,paint:{"line-color":r.airspaceStroke,"line-opacity":["interpolate",["linear"],["zoom"],2,0,2.7,.8,9,.8,10,.5],"line-width":.5,"line-dasharray":[4.2,4]}},{id:"fir_line_dash",type:"line",source:o,"source-layer":"fir",minzoom:5,layout:{"line-miter-limit":0,"line-cap":"butt","line-join":"miter"},paint:{"line-color":r.airspaceStroke,"line-opacity":["interpolate",["linear"],["zoom"],5,0,5.5,.8,9,.8,10,.5],"line-width":6,"line-dasharray":[.2,5]}},{id:"fir-label-lineside",type:"symbol",source:o,"source-layer":"fir",minzoom:4,layout:{"text-field":["concat",["get","TXT_NAME"],"/",["get","CODE_ID"],"/",["get","CODE_TYPE"]],"text-size":10,"symbol-placement":"line","text-max-width":8,"text-offset":[0,1],"text-letter-spacing":.05,"text-optional":!0},paint:{"text-color":r.airspaceStroke}},{id:"fir-label",type:"symbol",source:o,"source-layer":"fir-centroid",minzoom:3,layout:{"text-field":["coalesce",["get","TXT_NAME"],["get","CODE_ID"]],"text-size":["interpolate",["linear"],["zoom"],3,12,17,16],"symbol-placement":"point","text-max-width":8},paint:{"text-color":r.airspaceStroke,"text-opacity":["interpolate",["linear"],["zoom"],3,.85,8,.7,12,.5]}},{id:"restricted-fill",type:"fill",source:o,"source-layer":"restricted-fill",minzoom:4,paint:{"fill-color":"#FAD7A0","fill-opacity":["interpolate",["linear"],["zoom"],10,.15,11.5,0]}},{id:"restricted-stroke",type:"line",source:o,"source-layer":"restricted",paint:{"line-color":"#f6bf65","line-width":1,"line-dasharray":[2,2],"line-opacity":["interpolate",["linear"],["zoom"],4,.5,8,1]}},{id:"restricted-label",type:"symbol",source:o,"source-layer":"restricted",minzoom:6,layout:{"text-field":["concat",["get","TXT_NAME"],"/",["get","CODE_ID"],"/",["get","CODE_TYPE"]],"text-letter-spacing":.1,"text-size":10,"symbol-placement":"line","text-max-width":8,"text-offset":[0,1]},paint:{"text-color":r.restrictedStroke}},{id:"controlled-fill",type:"fill",source:o,"source-layer":"controlled-fill",minzoom:4,paint:{"fill-color":r.controlledFill,"fill-opacity":["interpolate",["linear"],["zoom"],10,.035,11.5,0]}},{id:"controlled-stroke",type:"line",source:o,"source-layer":"controlled",paint:{"line-color":r.controlledStroke,"line-width":1,"line-opacity":["interpolate",["linear"],["zoom"],4,.5,8,1],"line-dasharray":[1,1.4]}},{id:"controlled-label",type:"symbol",source:o,"source-layer":"controlled",minzoom:6,layout:{"text-field":["concat",["get","TXT_NAME"],"/",["get","CODE_ID"],"/",["get","CODE_TYPE"]],"text-size":10,"symbol-placement":"line","text-letter-spacing":.2,"text-max-width":8,"text-offset":[0,1]},paint:{"text-color":r.controlledStroke}},{id:"segment-line",type:"line",source:o,"source-layer":"segment",minzoom:5,paint:{"line-color":["case",["==",["get","HAS_REMARK"],1],"#E8A020",r.segment],"line-width":["interpolate",["linear"],["zoom"],5,.2,8,.8],"line-blur":0,"line-opacity":["interpolate",["linear"],["zoom"],5,.3,6,1,8,1,12,.8,15,.2]}},{id:"segment-label",type:"symbol",source:o,"source-layer":"segment",minzoom:6,layout:{"icon-image":["case",["all",["has","TXT_DESIG"],["!=",["get","TXT_DESIG"],""],["!=",["get","TXT_DESIG"]," "],["!=",["get","TXT_DESIG"],null]],"segment-both",["all",["has","TXT_DESIG_FORWARD"]],"segment-right",["all",["has","TXT_DESIG_BACKWARD"]],"segment-left","segment-both"],"icon-anchor":"center","symbol-placement":"line","icon-text-fit":"width","icon-size":1,"text-allow-overlap":!1,"icon-allow-overlap":!1,"text-optional":!1,"text-anchor":"center","text-justify":"center","text-line-height":1.3,"text-letter-spacing":.1,"text-field":["step",["zoom"],["format",["case",["all",["has","TXT_DESIG"],["!=",["get","TXT_DESIG"],""]],["get","TXT_DESIG"],["all",["has","TXT_DESIG_FORWARD"],["!=",["get","TXT_DESIG_FORWARD"],""]],["get","TXT_DESIG_FORWARD"],["all",["has","TXT_DESIG_BACKWARD"],["!=",["get","TXT_DESIG_BACKWARD"],""]],["get","TXT_DESIG_BACKWARD"],"-"],{"font-scale":1,"text-color":"#ffffff"}],10,["format",["concat",["get","VAL_LEN"],"",["get","UOM_DIST"]],{"font-scale":.95,"text-color":"#3E4759"},`
2
- `,["case",["all",["has","TXT_DESIG_FORWARD"],["!=",["get","TXT_DESIG_FORWARD"],""]],["case",["all",["has","TXT_DESIG_RNP"],["!=",["get","TXT_DESIG_RNP"],""]],["get","TXT_DESIG_RNP"],""],""],{"font-scale":1,"text-color":"#E8A020"},["case",["all",["has","TXT_DESIG_FORWARD"],["!=",["get","TXT_DESIG_FORWARD"],""]],["case",["all",["has","TXT_DESIG_RNP"],["!=",["get","TXT_DESIG_RNP"],""]]," ",""],""],{},["case",["all",["has","TXT_DESIG_FORWARD"],["!=",["get","TXT_DESIG_FORWARD"],""]],["get","TXT_DESIG_FORWARD"],["all",["has","TXT_DESIG"],["!=",["get","TXT_DESIG"],""]],["get","TXT_DESIG"],["all",["has","TXT_DESIG_BACKWARD"],["!=",["get","TXT_DESIG_BACKWARD"],""]],["get","TXT_DESIG_BACKWARD"],"-"],{"font-scale":1,"text-color":"#ffffff","font-weight":"bold"},["case",["all",["has","TXT_DESIG_FORWARD"],["!=",["get","TXT_DESIG_FORWARD"],""]],"",["case",["all",["has","TXT_DESIG_RNP"],["!=",["get","TXT_DESIG_RNP"],""]]," ",""]],{},["case",["all",["has","TXT_DESIG_FORWARD"],["!=",["get","TXT_DESIG_FORWARD"],""]],"",["case",["all",["has","TXT_DESIG_RNP"],["!=",["get","TXT_DESIG_RNP"],""]],["get","TXT_DESIG_RNP"],""]],{"font-scale":.85,"text-color":"#E8A020"},`
3
- `,["case",["all",["has","TXT_DESIG_HIGH"],["!=",["get","TXT_DESIG_HIGH"],""]],["get","TXT_DESIG_HIGH"],["all",["has","TXT_DESIG_FORWARD"],["!=",["get","TXT_DESIG_FORWARD"],""]],["get","TXT_DESIG_FORWARD"],["all",["has","TXT_DESIG_BACKWARD"],["!=",["get","TXT_DESIG_BACKWARD"],""]],["get","TXT_DESIG_BACKWARD"],"-"],{"font-scale":.95,"text-color":"#3E4759"}]],"text-size":["interpolate",["linear"],["zoom"],6,9,10,10],"icon-text-fit-padding":[0,3,0,3]},paint:{"text-halo-color":"#ffffff","text-halo-width":.1,"icon-color":r.segment,"text-opacity":["interpolate",["linear"],["zoom"],6,1,12,1,15,.3],"icon-opacity":["interpolate",["linear"],["zoom"],6,1,12,1,15,.3]}},{id:"segment-radial",type:"symbol",source:o,"source-layer":"segment-radial",minzoom:10,layout:{"text-field":["concat",["get","bearing"],"°"],"text-size":9,"text-rotate":["to-number",["get","line_angle"],0],"text-rotation-alignment":"map","text-allow-overlap":!0,"text-ignore-placement":!0,"text-offset":[0,-.6],"text-justify":"auto"},paint:{"text-color":r.segment}},{id:"airport-circle",type:"symbol",source:o,minzoom:3,"source-layer":"airport",filter:["case",["<",["zoom"],6],["==",["get","level"],1],!0],layout:{"icon-image":["case",["==",["get","CODE_TYPE_MIL_OPS"],"MIL"],"airport-mil",["==",["get","CODE_TYPE_MIL_OPS"],"MILEXT"],"airport-milext","airport-civ"],"icon-size":["interpolate",["linear"],["zoom"],4,.5,10,.9],"symbol-z-order":"viewport-y","text-field":["get","codeId"],"text-letter-spacing":.05,"text-field":["get","CODE_ID"],"text-anchor":"bottom","text-justify":"center","text-size":["interpolate",["linear"],["zoom"],4,0,5,12],"text-offset":["interpolate",["linear"],["zoom"],4,["literal",[0,-1.2]],5,["literal",[0,-.6]]],"icon-allow-overlap":!0,"icon-ignore-placement":!0,"text-allow-overlap":!0,"text-ignore-placement":!0,visibility:"none","icon-size":["interpolate",["linear"],["zoom"],5,.6,9,1.2,12,1.3]},paint:{"icon-color":["case",["has","has_amm"],"#4B2D6E",r.airport],"icon-opacity":["interpolate",["linear"],["zoom"],2,.75,3,.95,5,1,9,1,11,.2],"text-color":["case",["has","has_amm"],"#4B2D6E",r.airport],"text-opacity":["interpolate",["linear"],["zoom"],4,.95,5,1,9,1,11,.2]}},{id:"runway-line",type:"line",source:o,"source-layer":"runway",filter:["!",["has","has_amm"]],minzoom:4,maxzoom:11,paint:{"line-color":r.runway,"line-width":["interpolate",["linear"],["zoom"],4,1,13,10]}},{id:"runway-line-amm",type:"line",source:o,"source-layer":"runway",filter:["has","has_amm"],minzoom:4,maxzoom:11,paint:{"line-color":r.runway,"line-width":["interpolate",["linear"],["zoom"],4,1,10,4],"line-opacity":["interpolate",["linear"],["zoom"],10.5,1,11,0]}},{id:"runway-label",type:"symbol",source:o,"source-layer":"runway",minzoom:10,layout:{"text-field":["concat",["to-string",["get","VAL_LEN"]],"×",["to-string",["get","VAL_WID"]],"m"],"text-size":10,"symbol-placement":"line-center","text-rotation-alignment":"map","text-optional":!0},paint:{"text-color":r.runway,"text-halo-width":1,"text-opacity":["interpolate",["linear"],["zoom"],10.5,1,11,0]}},{id:"vor-symbol",type:"symbol",source:o,"source-layer":"vor",minzoom:8,layout:{"icon-image":"vor_dial","icon-size":["interpolate",["linear"],["zoom"],8,.072,10,.072,11,.126,12,.18,13,.234,14,.288,15,.342,16,.396,17,.45,22,.45],"icon-rotate":["to-number",["get","VAL_MAG_VAR"],0],"icon-rotation-alignment":"map","symbol-z-order":"viewport-y","text-letter-spacing":.05,"text-optional":!0,"icon-allow-overlap":!0,visibility:"none"},paint:{"icon-color":"#0b417a"}},{id:"vor-symbol-normal",minzoom:4,maxzoom:9,type:"symbol",source:o,"source-layer":"vor",layout:{"icon-image":"v2:vor-normal","icon-size":["interpolate",["linear"],["zoom"],4,.7,8,1],"icon-rotation-alignment":"map","symbol-z-order":"viewport-y","text-letter-spacing":.05,"text-optional":!0,"icon-allow-overlap":!0},paint:{"icon-color":"#3874cb","icon-opacity":["interpolate",["linear"],["zoom"],8,1,9,0]}},{id:"vor-label",type:"symbol",source:o,"source-layer":"vor",minzoom:5,layout:{"text-field":["get","CODE_ID"],"text-size":10,"text-anchor":"bottom","text-offset":[0,-.8]},paint:{"text-color":r.vor,"text-halo-color":"#ffffff","text-halo-width":1}},{id:"ndb-symbol",type:"symbol",source:o,minzoom:4,"source-layer":"ndb",layout:{"icon-image":"v2:ndb-normal","icon-size":["interpolate",["linear"],["zoom"],6,.5,10,1],"symbol-z-order":"viewport-y","text-field":["format",["get","CODE_ID"],{"text-color":r.ndb,"font-scale":1.1},"",{},["coalesce",["get","VAL_FREQ"],""],{"text-color":r.ndb,"font-scale":.95}],"text-size":10,"text-offset":[0,.5],"text-letter-spacing":.05,"text-optional":!0,"icon-allow-overlap":!0,"text-anchor":"top"},paint:{"text-color":r.ndb,"text-halo-color":"#ffffff","text-halo-width":.5,"text-halo-blur":1,"icon-color":r.ndb,"text-opacity":["interpolate",["linear"],["zoom"],4,0,5.5,0,6,.6,8,1,10,.3,12,0],"icon-opacity":["interpolate",["linear"],["zoom"],4,0,5,.3,5.5,.8,8,1,12,1,14,.6]}},{id:"waypoint-symbol",type:"symbol",source:o,"source-layer":"waypoint",minzoom:5,layout:{"icon-image":["case",["==",["get","report_type"],"C"],"waypoint-compusory","waypoint"],"icon-size":.6,"icon-allow-overlap":!0,"icon-ignore-placement":!0,"text-field":["get","CODE_ID"],"text-size":10,"text-letter-spacing":.02,"text-variable-anchor-offset":["bottom",[0,-.6],"top",[0,.6],"right",[-.6,0],"left",[.6,0],"bottom-right",[-.4,-.4],"bottom-left",[.4,-.4],"top-right",[-.4,.4],"top-left",[.4,.4]],"text-justify":"auto"},paint:{"icon-color":r.waypoint,"text-color":r.waypoint,"text-halo-color":"#ffffff","text-halo-width":1,"icon-halo-color":"rgba(0,0,0,0)","icon-halo-width":0,"icon-opacity":["interpolate",["linear"],["zoom"],5,.5,12,1,15,.2],"text-halo-color":"#FFFFFF","text-halo-blur":0,"text-opacity":["interpolate",["linear"],["zoom"],6,1,12,.9,15,.15]}},{id:"waypoint-off-airway-symbol",type:"symbol",source:o,"source-layer":"waypoint-off-airway",minzoom:7,layout:{"icon-image":["case",["==",["get","report_type"],"C"],"designate_point_inway","designate_point_notinway"],"icon-size":.6,"icon-allow-overlap":!0,"icon-ignore-placement":!0,"text-field":["get","CODE_ID"],"text-size":9,"text-variable-anchor-offset":["bottom",[0,-.6],"top",[0,.6],"right",[-.6,0],"left",[.6,0],"bottom-right",[-.4,-.4],"bottom-left",[.4,-.4],"top-right",[-.4,.4],"top-left",[.4,.4]],"text-justify":"auto","text-optional":!0},paint:{"icon-color":r.waypoint,"text-color":r.waypoint,"text-halo-color":"#ffffff","text-halo-width":1,"icon-opacity":["interpolate",["linear"],["zoom"],7,.5,12,1,15,.2],"text-opacity":["interpolate",["linear"],["zoom"],7,1,12,.9,15,.15]}}]}const $e={airspaceStroke:"#18C29C",restrictedStroke:"#CC7722",controlledStroke:"#22C55E",controlledFill:"#22C55E",segment:"#40C4FF",waypoint:"#74cdde",vor:"#72aae5",ndb:"#62d6ef",airport:"#73ccdd",runway:"#64748b"};function Ke(){const o="navdata",r=$e;return[{id:"landLaye",type:"fill",source:"land",layout:{visibility:"visible"},paint:{"fill-color":"#0A111A","fill-opacity":1}},{id:"boundary",type:"line",source:"boundary",minzoom:.5,paint:{"line-width":["interpolate",["linear"],["zoom"],0,1,7,4],"line-opacity":1,"line-pattern":"normal:national-border-dark"}},{id:"adiz-line",type:"line",source:o,"source-layer":"adiz",minzoom:3,layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#a855f7","line-width":["interpolate",["linear"],["zoom"],3,3,7,6],"line-pattern":"normal:adiz","line-opacity":["interpolate",["linear"],["zoom"],3,.7,8,.5]}},{id:"adiz-label",type:"symbol",source:o,"source-layer":"adiz-centroid",minzoom:3,layout:{"text-field":["coalesce",["get","TXT_NAME"],["get","CODE_ID"]],"text-size":10,"text-max-width":10,"symbol-placement":"point"},paint:{"text-color":"#c084fc","text-halo-color":"#0f172a","text-halo-width":1.5}},{id:"fir-line",type:"line",source:o,"source-layer":"fir",minzoom:2,layout:{"line-cap":"butt","line-join":"miter","line-miter-limit":0},paint:{"line-color":r.airspaceStroke,"line-opacity":["interpolate",["linear"],["zoom"],2,0,2.7,.8,9,.8,10,.5],"line-width":.8,"line-dasharray":[4.2,4]}},{id:"fir_line_dash",type:"line",source:o,"source-layer":"fir",minzoom:5,layout:{"line-miter-limit":0,"line-cap":"butt","line-join":"miter"},paint:{"line-color":r.airspaceStroke,"line-opacity":["interpolate",["linear"],["zoom"],5,0,5.5,.8,9,.8,10,.5],"line-width":5,"line-dasharray":[.2,5]}},{id:"fir-label-lineside",type:"symbol",source:o,"source-layer":"fir",minzoom:4,layout:{"text-field":["concat",["get","TXT_NAME"],"/",["get","CODE_ID"],"/",["get","CODE_TYPE"]],"text-size":10,"symbol-placement":"line","text-max-width":8,"text-offset":[0,1],"text-letter-spacing":.05,"text-optional":!0},paint:{"text-color":r.airspaceStroke,"text-halo-color":"#0f172a","text-halo-width":1}},{id:"fir-label",type:"symbol",source:o,"source-layer":"fir-centroid",minzoom:3,layout:{"text-field":["coalesce",["get","TXT_NAME"],["get","CODE_ID"]],"text-size":["interpolate",["linear"],["zoom"],3,12,17,16],"symbol-placement":"point","text-max-width":8},paint:{"text-color":r.airspaceStroke,"text-halo-color":"#0f172a","text-halo-width":1.5,"text-opacity":["interpolate",["linear"],["zoom"],3,.85,8,.7,12,.5]}},{id:"restricted-fill",type:"fill",source:o,"source-layer":"restricted-fill",minzoom:4,paint:{"fill-color":["case",["==",["get","CODE_TYPE"],"P"],"#ef4444",["==",["get","CODE_TYPE"],"D"],"#f97316","#ef4444"],"fill-opacity":.04}},{id:"restricted-stroke",type:"line",source:o,"source-layer":"restricted",paint:{"line-color":r.restrictedStroke,"line-width":1,"line-dasharray":[2,2],"line-opacity":["interpolate",["linear"],["zoom"],4,.6,8,1]}},{id:"restricted-label",type:"symbol",source:o,"source-layer":"restricted",minzoom:6,layout:{"text-field":["coalesce",["get","TXT_NAME"],["get","CODE_ID"]],"text-size":10,"symbol-placement":"line","text-max-width":8,"text-offset":[0,1]},paint:{"text-color":r.restrictedStroke,"text-halo-color":"#0f172a","text-halo-width":1}},{id:"controlled-fill",type:"fill",source:o,"source-layer":"controlled-fill",minzoom:4,paint:{"fill-color":r.controlledFill,"fill-opacity":["interpolate",["linear"],["zoom"],10,.04,11.5,0]}},{id:"controlled-stroke",type:"line",source:o,"source-layer":"controlled",paint:{"line-color":r.controlledStroke,"line-width":1,"line-opacity":["interpolate",["linear"],["zoom"],4,.6,8,1],"line-dasharray":[4,2]}},{id:"controlled-label",type:"symbol",source:o,"source-layer":"controlled",minzoom:6,layout:{"text-field":["coalesce",["get","TXT_NAME"],["get","CODE_ID"]],"text-size":10,"symbol-placement":"point","text-max-width":8},paint:{"text-color":r.controlledStroke,"text-halo-color":"#0f172a","text-halo-width":1.5}},{id:"segment-line",type:"line",source:o,"source-layer":"segment",minzoom:5,paint:{"line-color":["case",["==",["get","HAS_REMARK"],1],"#fbbf24",r.segment],"line-width":["interpolate",["linear"],["zoom"],5,.2,8,.8],"line-blur":0,"line-opacity":["interpolate",["linear"],["zoom"],5,.3,6,1,8,1,12,.8,15,.2]}},{id:"segment-label",type:"symbol",source:o,"source-layer":"segment",minzoom:6,layout:{"icon-image":["case",["all",["has","TXT_DESIG"],["!=",["get","TXT_DESIG"],""],["!=",["get","TXT_DESIG"]," "],["!=",["get","TXT_DESIG"],null]],"segment-both",["all",["has","TXT_DESIG_FORWARD"]],"segment-right",["all",["has","TXT_DESIG_BACKWARD"]],"segment-left","segment-both"],"icon-anchor":"center","symbol-placement":"line","icon-text-fit":"width","icon-size":1,"text-allow-overlap":!1,"icon-allow-overlap":!1,"text-anchor":"center","text-justify":"center","text-line-height":1.3,"text-letter-spacing":.1,"text-field":["step",["zoom"],["format",["case",["all",["has","TXT_DESIG"],["!=",["get","TXT_DESIG"],""]],["get","TXT_DESIG"],["all",["has","TXT_DESIG_FORWARD"],["!=",["get","TXT_DESIG_FORWARD"],""]],["get","TXT_DESIG_FORWARD"],["all",["has","TXT_DESIG_BACKWARD"],["!=",["get","TXT_DESIG_BACKWARD"],""]],["get","TXT_DESIG_BACKWARD"],"-"],{"font-scale":1,"text-color":"#0f172a"}],10,["format",["concat",["get","VAL_LEN"],"",["get","UOM_DIST"]],{"font-scale":.95,"text-color":"#cbd5e1"},`
4
- `,["case",["all",["has","TXT_DESIG_FORWARD"],["!=",["get","TXT_DESIG_FORWARD"],""]],["case",["all",["has","TXT_DESIG_RNP"],["!=",["get","TXT_DESIG_RNP"],""]],["get","TXT_DESIG_RNP"],""],""],{"font-scale":1,"text-color":"#FFFFFF"},["case",["all",["has","TXT_DESIG_FORWARD"],["!=",["get","TXT_DESIG_FORWARD"],""]],["case",["all",["has","TXT_DESIG_RNP"],["!=",["get","TXT_DESIG_RNP"],""]]," ",""],""],{},["case",["all",["has","TXT_DESIG_FORWARD"],["!=",["get","TXT_DESIG_FORWARD"],""]],["get","TXT_DESIG_FORWARD"],["all",["has","TXT_DESIG"],["!=",["get","TXT_DESIG"],""]],["get","TXT_DESIG"],["all",["has","TXT_DESIG_BACKWARD"],["!=",["get","TXT_DESIG_BACKWARD"],""]],["get","TXT_DESIG_BACKWARD"],"-"],{"font-scale":1,"text-color":"#0f172a","font-weight":"bold"},["case",["all",["has","TXT_DESIG_FORWARD"],["!=",["get","TXT_DESIG_FORWARD"],""]],"",["case",["all",["has","TXT_DESIG_RNP"],["!=",["get","TXT_DESIG_RNP"],""]]," ",""]],{},["case",["all",["has","TXT_DESIG_FORWARD"],["!=",["get","TXT_DESIG_FORWARD"],""]],"",["case",["all",["has","TXT_DESIG_RNP"],["!=",["get","TXT_DESIG_RNP"],""]],["get","TXT_DESIG_RNP"],""]],{"font-scale":.85,"text-color":"#FFFFFF"},`
5
- `,["case",["all",["has","TXT_DESIG_HIGH"],["!=",["get","TXT_DESIG_HIGH"],""]],["get","TXT_DESIG_HIGH"],["all",["has","TXT_DESIG_FORWARD"],["!=",["get","TXT_DESIG_FORWARD"],""]],["get","TXT_DESIG_FORWARD"],["all",["has","TXT_DESIG_BACKWARD"],["!=",["get","TXT_DESIG_BACKWARD"],""]],["get","TXT_DESIG_BACKWARD"],"-"],{"font-scale":.95,"text-color":"#cbd5e1"}]],"text-size":["interpolate",["linear"],["zoom"],6,9,10,10],"icon-text-fit-padding":[0,3,0,3]},paint:{"icon-color":r.segment}},{id:"segment-radial",type:"symbol",source:o,"source-layer":"segment-radial",minzoom:10,layout:{"text-field":["concat",["get","bearing"],"°"],"text-size":9,"text-rotate":["to-number",["get","line_angle"],0],"text-rotation-alignment":"map","text-allow-overlap":!0,"text-ignore-placement":!0,"text-offset":[0,-1]},paint:{"text-color":r.segment,"text-halo-color":"#0f172a","text-halo-width":1}},{id:"airport-circle",type:"symbol",source:o,minzoom:3,"source-layer":"airport",filter:["case",["<",["zoom"],6],["==",["get","level"],1],!0],layout:{"icon-image":["case",["==",["get","CODE_TYPE_MIL_OPS"],"MIL"],"airport-mil",["==",["get","CODE_TYPE_MIL_OPS"],"MILEXT"],"airport-milext","airport-civ"],"icon-size":["interpolate",["linear"],["zoom"],4,.5,10,.9],"symbol-z-order":"viewport-y","text-field":["get","codeId"],"text-letter-spacing":.05,"text-anchor":"bottom","text-field":["get","CODE_ID"],"text-justify":"center","text-size":["interpolate",["linear"],["zoom"],4,0,5,12],"text-offset":["interpolate",["linear"],["zoom"],4,["literal",[0,-1.2]],5,["literal",[0,-.6]]],"icon-allow-overlap":!0,"icon-ignore-placement":!0,"text-allow-overlap":!0,"text-ignore-placement":!0,visibility:"none","icon-size":["interpolate",["linear"],["zoom"],5,.6,9,1.2,12,1.3]},paint:{"icon-color":["case",["has","has_amm"],"#4B2D6E",r.airport],"icon-opacity":["interpolate",["linear"],["zoom"],2,.75,3,.95,5,1,9,1,11,.2],"text-color":["case",["has","has_amm"],"#4B2D6E","#E0F7FA"],"text-opacity":["interpolate",["linear"],["zoom"],4,.95,5,1,9,1,11,.2]}},{id:"runway-line",type:"line",source:o,"source-layer":"runway",filter:["!",["has","has_amm"]],minzoom:4,paint:{"line-color":r.runway,"line-width":["interpolate",["linear"],["zoom"],4,1,10,3]}},{id:"runway-line-amm",type:"line",source:o,"source-layer":"runway",filter:["has","has_amm"],minzoom:4,paint:{"line-color":r.runway,"line-width":["interpolate",["linear"],["zoom"],4,1,10,3],"line-opacity":["interpolate",["linear"],["zoom"],10.5,1,11,0]}},{id:"runway-label",type:"symbol",source:o,"source-layer":"runway",minzoom:10,layout:{"text-field":["concat",["to-string",["get","VAL_LEN"]],"×",["to-string",["get","VAL_WID"]],"m"],"text-size":10,"text-font":["Noto Sans Regular"],"symbol-placement":"line-center","text-rotation-alignment":"map","text-optional":!0},paint:{"text-color":r.runway,"text-halo-color":"#0f172a","text-halo-width":1,"text-opacity":["interpolate",["linear"],["zoom"],10.5,1,11,0]}},{id:"vor-symbol",type:"symbol",source:o,"source-layer":"vor",layout:{"icon-image":"vor_dial","icon-size":["interpolate",["linear"],["zoom"],5,.072,10,.072,11,.126,12,.18,13,.234,14,.288,15,.342,16,.396,17,.45,22,.45],"icon-rotate":["to-number",["get","VAL_MAG_VAR"],0],"icon-rotation-alignment":"map","symbol-z-order":"viewport-y","text-letter-spacing":.05,"text-optional":!0,"icon-allow-overlap":!0,visibility:"none"},paint:{"icon-color":"#38bdf8"}},{id:"vor-label",type:"symbol",source:o,"source-layer":"vor",minzoom:5,layout:{"text-field":["get","CODE_ID"],"text-size":10,"text-anchor":"bottom","text-offset":[0,-.8]},paint:{"text-color":r.vor,"text-halo-color":"#0f172a","text-halo-width":1}},{id:"ndb-symbol",type:"symbol",source:o,minzoom:4,"source-layer":"ndb",layout:{"icon-image":"ndb-inway","icon-size":["interpolate",["linear"],["zoom"],6,.5,10,1],"symbol-z-order":"viewport-y","text-field":["concat",["get","CODE_ID"],`
6
- `,["get","VAL_FREQ"],"kHz"],"text-size":10,"text-offset":[0,1.4],"text-letter-spacing":.05,"text-optional":!0,"icon-allow-overlap":!0},paint:{"text-color":r.ndb,"text-halo-color":"#0f172a","text-halo-width":1,"icon-color":r.ndb}},{id:"waypoint-symbol",type:"symbol",source:o,"source-layer":"waypoint",minzoom:5,layout:{"icon-image":["case",["==",["get","report_type"],"C"],"waypoint-compusory","waypoint"],"icon-size":.6,"icon-allow-overlap":!0,"icon-ignore-placement":!0,"text-field":["get","CODE_ID"],"text-size":9,"text-variable-anchor-offset":["bottom",[0,-.6],"top",[0,.6],"right",[-.6,0],"left",[.6,0],"bottom-right",[-.4,-.4],"bottom-left",[.4,-.4],"top-right",[-.4,.4],"top-left",[.4,.4]],"text-justify":"auto","text-optional":!0},paint:{"icon-color":r.waypoint,"text-color":r.waypoint,"text-halo-color":"#0f172a","text-halo-width":1}},{id:"waypoint-off-airway-symbol",type:"symbol",source:o,"source-layer":"waypoint-off-airway",minzoom:7,layout:{"icon-image":["case",["==",["get","report_type"],"C"],"designate_point_inway","designate_point_notinway"],"icon-size":.6,"icon-allow-overlap":!0,"icon-ignore-placement":!0,"text-field":["get","CODE_ID"],"text-size":9,"text-variable-anchor-offset":["bottom",[0,-.6],"top",[0,.6],"right",[-.6,0],"left",[.6,0],"bottom-right",[-.4,-.4],"bottom-left",[.4,-.4],"top-right",[-.4,.4],"top-left",[.4,.4]],"text-justify":"auto","text-optional":!0},paint:{"icon-color":r.waypoint,"text-color":r.waypoint,"text-halo-color":"#0f172a","text-halo-width":1}}]}const ct={light:{id:"light",label:"日间",background:"#EAF2F8",build:je},dark:{id:"dark",label:"夜间",background:"#000000",build:Ke}};function Ht(o="light"){return(ct[o]??ct.light).build()}const Dt={adiz:["adiz-line","adiz-label"],airspace:["fir-line","fir_line_dash","fir-label","fir-label-lineside"],restricted:["restricted-fill","restricted-stroke","restricted-label"],controlled:["controlled-fill","controlled-stroke","controlled-label"],airline:["segment-radial","segment-line","segment-label","waypoint-symbol"],waypointOffAirway:["waypoint-off-airway-symbol"],vor:["vor-symbol","vor-label","vor-symbol-normal"],ndb:["ndb-symbol"],airport:["airport-circle"],runway:["runway-line","runway-line-amm","runway-label"]},He={airport:"#e2e8f0",runway:"#94a3b8",apron:"#cbd5e1",taxiway:"#e2e8f0",taxiwayLine:"#f59e0b",holding:"#b91c1c",stand:"#1e293b",runwayMarking:"#ffffff",runwayCenterline:"#ffffff",standLine:"#64748b",restricted:"#b91c1c",hotspot:"#ea580c"};function Ye(o="amm"){const r=He;return[{id:"amm-airport-fill",type:"fill",source:o,"source-layer":"amm-airport",minzoom:11,paint:{"fill-color":r.airport,"fill-opacity":.4}},{id:"amm-airport-stroke",type:"line",source:o,"source-layer":"amm-airport",minzoom:11,paint:{"line-color":r.airport,"line-width":1}},{id:"amm-runway-fill",type:"fill",source:o,"source-layer":"amm-runway",minzoom:11,paint:{"fill-color":r.runway,"fill-opacity":.9}},{id:"amm-runway-stroke",type:"line",source:o,"source-layer":"amm-runway",minzoom:11,paint:{"line-color":"#64748b","line-width":.5}},{id:"amm-apron-fill",type:"fill",source:o,"source-layer":"amm-apron",minzoom:11,paint:{"fill-color":r.apron,"fill-opacity":.6}},{id:"amm-apron-stroke",type:"line",source:o,"source-layer":"amm-apron",minzoom:11,paint:{"line-color":"#94a3b8","line-width":.5}},{id:"amm-taxiway-fill",type:"fill",source:o,"source-layer":"amm-taxiway",minzoom:11,paint:{"fill-color":r.taxiway,"fill-opacity":.7}},{id:"amm-taxiway-line",type:"line",source:o,"source-layer":"amm-taxiway-line",minzoom:11,paint:{"line-color":r.taxiwayLine,"line-width":["interpolate",["linear"],["zoom"],15,.8,18,2]}},{id:"amm-taxiway-label",type:"symbol",source:o,"source-layer":"amm-taxiway-line",minzoom:14,layout:{"text-field":["get","idlin"],"text-size":10,"icon-image":"text_bg","icon-text-fit":"both","icon-text-fit-padding":[1,2,1,2],"symbol-placement":"line","text-keep-upright":!0,"text-allow-overlap":!1},paint:{"text-color":"#FFF","icon-color":r.taxiwayLine}},{id:"amm-holding",type:"line",source:o,"source-layer":"amm-holding",minzoom:11,paint:{"line-color":r.holding,"line-width":1.5}},{id:"amm-runway-marking",type:"fill",source:o,"source-layer":"amm-runway-marking",minzoom:13,paint:{"fill-color":r.runwayMarking,"fill-opacity":.9}},{id:"amm-restricted-fill",type:"fill",source:o,"source-layer":"amm-restricted",minzoom:11,paint:{"fill-color":r.restricted,"fill-opacity":.08}},{id:"amm-restricted-stroke",type:"line",source:o,"source-layer":"amm-restricted",minzoom:11,paint:{"line-color":r.restricted,"line-width":1.5,"line-dasharray":[4,2]}},{id:"amm-hotspot-fill",type:"fill",source:o,"source-layer":"amm-hotspot",minzoom:11,paint:{"fill-color":r.hotspot,"fill-opacity":.1}},{id:"amm-hotspot-stroke",type:"line",source:o,"source-layer":"amm-hotspot",minzoom:11,paint:{"line-color":r.hotspot,"line-width":1.5}},{id:"amm-runway-centerline",type:"line",source:o,"source-layer":"amm-runway-centerline",minzoom:11,paint:{"line-color":r.runwayCenterline,"line-width":1,"line-dasharray":[6,3]}},{id:"amm-runway-info",type:"symbol",source:o,"source-layer":"amm-runway-label",minzoom:13,layout:{"text-field":["concat",["coalesce",["get","length"],""],"×",["coalesce",["get","width"],""],"m"],"text-size":["interpolate",["exponential",1.5],["zoom"],13,10,16,13],"symbol-placement":"point","text-rotate":["coalesce",["get","bearing"],0],"text-rotation-alignment":"map","text-allow-overlap":!0,"text-ignore-placement":!0},paint:{"text-color":"#f8fafc","text-halo-color":"#334155","text-halo-width":2.5}},{id:"amm-stand-line",type:"line",source:o,"source-layer":"amm-stand-line",minzoom:13,paint:{"line-color":r.standLine,"line-width":1}},{id:"amm-runway-threshold-label",type:"symbol",source:o,"source-layer":"amm-runway-threshold",minzoom:12,layout:{"icon-image":"text_bg","icon-text-fit":"both","icon-text-fit-padding":[1,2,1,2],"text-field":["get","idthr"],"text-size":14,"text-allow-overlap":!0,"text-rotation-alignment":"map","icon-rotation-alignment":"map"},paint:{"text-color":"#fff","icon-color":"#b91c1c"}},{id:"amm-stand",type:"circle",source:o,"source-layer":"amm-stand",minzoom:12,paint:{"circle-color":r.stand,"circle-radius":1.5}},{id:"amm-stand-label",type:"symbol",source:o,"source-layer":"amm-stand",minzoom:14,layout:{"text-field":["get","idstd"],"text-size":9,"text-anchor":"bottom","text-offset":[0,-.5],"text-allow-overlap":!1},paint:{"text-color":r.standLine}},{id:"amm-obstacle-region-fill",type:"fill",source:o,"source-layer":"amm-obstacle-region",minzoom:11,paint:{"fill-color":"#fef08a","fill-opacity":.35}},{id:"amm-obstacle-region-stroke",type:"line",source:o,"source-layer":"amm-obstacle-region",minzoom:11,paint:{"line-color":"#ca8a04","line-width":1.5,"line-dasharray":[1.5,1]}},{id:"amm-obstacle-point",type:"circle",source:o,"source-layer":"amm-obstacle-point",minzoom:11,paint:{"circle-color":"#b45309","circle-radius":4,"circle-stroke-color":"#ffffff","circle-stroke-width":1}},{id:"amm-obstacle-point-label",type:"symbol",source:o,"source-layer":"amm-obstacle-point",minzoom:14,layout:{"text-field":["coalesce",["get","ident"],["get","LABEL"]],"text-size":9,"text-anchor":"bottom","text-offset":[0,-.5],"text-allow-overlap":!1},paint:{"text-color":"#92400e","text-halo-color":"#ffffff","text-halo-width":1}},{id:"amm-construction-fill",type:"fill",source:o,"source-layer":"amm-construction",minzoom:11,paint:{"fill-pattern":"normal:passline","fill-opacity":.8}},{id:"amm-construction-stroke",type:"line",source:o,"source-layer":"amm-construction",minzoom:11,paint:{"line-color":"#d97706","line-width":1.5,"line-dasharray":[4,2]}},{id:"amm-construction-label",type:"symbol",source:o,"source-layer":"amm-construction",minzoom:13,layout:{"text-field":["get","text"],"text-size":9,"text-anchor":"center","symbol-placement":"point","text-allow-overlap":!1},paint:{"text-color":"#92400e","text-halo-color":"#ffffff","text-halo-width":1}}]}const Ze={airport:"#334155",runway:"#475569",apron:"#1e293b",taxiway:"#334155",taxiwayLine:"#fbbf24",holding:"#ef4444",stand:"#34d399",runwayMarking:"#cbd5e1",runwayCenterline:"#94a3b8",standLine:"#64748b",restricted:"#f87171",hotspot:"#fb923c"};function Je(o="amm"){const r=Ze;return[{id:"amm-airport-fill",type:"fill",source:o,"source-layer":"amm-airport",minzoom:11,paint:{"fill-color":r.airport,"fill-opacity":.3}},{id:"amm-airport-stroke",type:"line",source:o,"source-layer":"amm-airport",minzoom:11,paint:{"line-color":"#475569","line-width":1}},{id:"amm-runway-fill",type:"fill",source:o,"source-layer":"amm-runway",minzoom:11,paint:{"fill-color":r.runway,"fill-opacity":1}},{id:"amm-runway-stroke",type:"line",source:o,"source-layer":"amm-runway",minzoom:11,paint:{"line-color":"#64748b","line-width":.5}},{id:"amm-apron-fill",type:"fill",source:o,"source-layer":"amm-apron",minzoom:11,paint:{"fill-color":r.apron,"fill-opacity":1}},{id:"amm-apron-stroke",type:"line",source:o,"source-layer":"amm-apron",minzoom:11,paint:{"line-color":"#334155","line-width":.5}},{id:"amm-taxiway-fill",type:"fill",source:o,"source-layer":"amm-taxiway",minzoom:11,paint:{"fill-color":r.taxiway,"fill-opacity":.8}},{id:"amm-taxiway-line",type:"line",source:o,"source-layer":"amm-taxiway-line",minzoom:11,paint:{"line-color":r.taxiwayLine,"line-width":["interpolate",["linear"],["zoom"],15,.8,18,2]}},{id:"amm-taxiway-label",type:"symbol",source:o,"source-layer":"amm-taxiway-line",minzoom:14,layout:{"text-field":["get","idlin"],"text-size":10,"icon-image":"text_bg","icon-text-fit":"both","icon-text-fit-padding":[1,2,1,2],"symbol-placement":"line","text-keep-upright":!0,"text-allow-overlap":!1},paint:{"text-color":"#0f172a","icon-color":r.taxiwayLine}},{id:"amm-holding",type:"line",source:o,"source-layer":"amm-holding",minzoom:11,paint:{"line-color":r.holding,"line-width":1.5}},{id:"amm-runway-marking",type:"fill",source:o,"source-layer":"amm-runway-marking",minzoom:13,paint:{"fill-color":r.runwayMarking,"fill-opacity":.8}},{id:"amm-restricted-fill",type:"fill",source:o,"source-layer":"amm-restricted",minzoom:11,paint:{"fill-color":r.restricted,"fill-opacity":.12}},{id:"amm-restricted-stroke",type:"line",source:o,"source-layer":"amm-restricted",minzoom:11,paint:{"line-color":r.restricted,"line-width":1.2,"line-dasharray":[4,2]}},{id:"amm-hotspot-fill",type:"fill",source:o,"source-layer":"amm-hotspot",minzoom:11,paint:{"fill-color":r.hotspot,"fill-opacity":.15}},{id:"amm-hotspot-stroke",type:"line",source:o,"source-layer":"amm-hotspot",minzoom:11,paint:{"line-color":r.hotspot,"line-width":1.2}},{id:"amm-runway-centerline",type:"line",source:o,"source-layer":"amm-runway-centerline",minzoom:11,paint:{"line-color":r.runwayCenterline,"line-width":1,"line-dasharray":[6,3]}},{id:"amm-runway-info",type:"symbol",source:o,"source-layer":"amm-runway-label",minzoom:13,layout:{"text-field":["concat",["coalesce",["get","length"],""],"×",["coalesce",["get","width"],""],"m"],"text-size":["interpolate",["exponential",1.5],["zoom"],13,10,16,13],"symbol-placement":"point","text-rotate":["coalesce",["get","bearing"],0],"text-rotation-alignment":"map","text-allow-overlap":!0,"text-ignore-placement":!0},paint:{"text-color":"#e2e8f0","text-halo-color":"#0f172a","text-halo-width":2}},{id:"amm-stand-line",type:"line",source:o,"source-layer":"amm-stand-line",minzoom:13,paint:{"line-color":r.standLine,"line-width":1}},{id:"amm-runway-threshold-label",type:"symbol",source:o,"source-layer":"amm-runway-threshold",minzoom:12,layout:{"icon-image":"text_bg","icon-text-fit":"both","icon-text-fit-padding":[1,2,1,2],"text-field":["get","idthr"],"text-size":14,"text-allow-overlap":!0,"text-rotation-alignment":"map","icon-rotation-alignment":"map"},paint:{"text-color":"#ffffff","icon-color":"#ef4444"}},{id:"amm-stand",type:"circle",source:o,"source-layer":"amm-stand",minzoom:12,paint:{"circle-color":r.stand,"circle-radius":1.5}},{id:"amm-stand-label",type:"symbol",source:o,"source-layer":"amm-stand",minzoom:14,layout:{"text-field":["get","idstd"],"text-size":9,"text-anchor":"bottom","text-offset":[0,-.5],"text-allow-overlap":!1},paint:{"text-color":r.stand,"text-halo-color":"#0f172a","text-halo-width":1}},{id:"amm-obstacle-region-fill",type:"fill",source:o,"source-layer":"amm-obstacle-region",minzoom:11,paint:{"fill-color":"#fef08a","fill-opacity":.15}},{id:"amm-obstacle-region-stroke",type:"line",source:o,"source-layer":"amm-obstacle-region",minzoom:11,paint:{"line-color":"#eab308","line-width":1.2,"line-dasharray":[1.5,1]}},{id:"amm-obstacle-point",type:"circle",source:o,"source-layer":"amm-obstacle-point",minzoom:11,paint:{"circle-color":"#f97316","circle-radius":4,"circle-stroke-color":"#0f172a","circle-stroke-width":1}},{id:"amm-obstacle-point-label",type:"symbol",source:o,"source-layer":"amm-obstacle-point",minzoom:14,layout:{"text-field":["coalesce",["get","ident"],["get","LABEL"]],"text-size":9,"text-anchor":"bottom","text-offset":[0,-.5],"text-allow-overlap":!1},paint:{"text-color":"#fdba74","text-halo-color":"#0f172a","text-halo-width":1.2}},{id:"amm-construction-fill",type:"fill",source:o,"source-layer":"amm-construction",minzoom:11,paint:{"fill-pattern":"normal:passline","fill-opacity":.6}},{id:"amm-construction-stroke",type:"line",source:o,"source-layer":"amm-construction",minzoom:11,paint:{"line-color":"#ea580c","line-width":1.2,"line-dasharray":[4,2]}},{id:"amm-construction-label",type:"symbol",source:o,"source-layer":"amm-construction",minzoom:13,layout:{"text-field":["get","text"],"text-size":9,"text-anchor":"center","symbol-placement":"point","text-allow-overlap":!1},paint:{"text-color":"#f97316","text-halo-color":"#0f172a","text-halo-width":1}}]}const Qe={airport:"#4b5563",runway:"#71717a",apron:"#27272a",taxiway:"#3f3f46",taxiwayLine:"#eab308",holding:"#ef4444",stand:"#10b981",runwayMarking:"#e4e4e7",runwayCenterline:"#d4d4d8",standLine:"#6b7280",threshold:"#f97316",restricted:"#f87171",hotspot:"#fb923c"};function qe(o="amm"){const r=Qe,d="#1f1f23";return[{id:"amm-airport-fill",type:"fill",source:o,"source-layer":"amm-airport",minzoom:11,paint:{"fill-color":r.airport,"fill-opacity":.3}},{id:"amm-airport-stroke",type:"line",source:o,"source-layer":"amm-airport",minzoom:11,paint:{"line-color":"#52525b","line-width":1}},{id:"amm-runway-fill",type:"fill",source:o,"source-layer":"amm-runway",minzoom:11,paint:{"fill-color":r.runway,"fill-opacity":1}},{id:"amm-runway-stroke",type:"line",source:o,"source-layer":"amm-runway",minzoom:11,paint:{"line-color":"#52525b","line-width":.5}},{id:"amm-apron-fill",type:"fill",source:o,"source-layer":"amm-apron",minzoom:11,paint:{"fill-color":r.apron,"fill-opacity":1}},{id:"amm-apron-stroke",type:"line",source:o,"source-layer":"amm-apron",minzoom:11,paint:{"line-color":"#3f3f46","line-width":.5}},{id:"amm-taxiway-fill",type:"fill",source:o,"source-layer":"amm-taxiway",minzoom:11,paint:{"fill-color":r.taxiway,"fill-opacity":.9}},{id:"amm-taxiway-line",type:"line",source:o,"source-layer":"amm-taxiway-line",minzoom:11,paint:{"line-color":r.taxiwayLine,"line-width":["interpolate",["linear"],["zoom"],15,.8,18,2]}},{id:"amm-taxiway-label",type:"symbol",source:o,"source-layer":"amm-taxiway-line",minzoom:14,layout:{"text-field":["get","idlin"],"text-size":10,"icon-image":"text_bg","icon-text-fit":"both","icon-text-fit-padding":[1,2,1,2],"symbol-placement":"line","text-keep-upright":!0,"text-allow-overlap":!1},paint:{"text-color":d,"icon-color":r.taxiwayLine}},{id:"amm-holding",type:"line",source:o,"source-layer":"amm-holding",minzoom:11,paint:{"line-color":r.holding,"line-width":1.5}},{id:"amm-runway-marking",type:"fill",source:o,"source-layer":"amm-runway-marking",minzoom:13,paint:{"fill-color":r.runwayMarking,"fill-opacity":.85}},{id:"amm-restricted-fill",type:"fill",source:o,"source-layer":"amm-restricted",minzoom:11,paint:{"fill-color":r.restricted,"fill-opacity":.1}},{id:"amm-restricted-stroke",type:"line",source:o,"source-layer":"amm-restricted",minzoom:11,paint:{"line-color":r.restricted,"line-width":1.2,"line-dasharray":[4,2]}},{id:"amm-hotspot-fill",type:"fill",source:o,"source-layer":"amm-hotspot",minzoom:11,paint:{"fill-color":r.hotspot,"fill-opacity":.12}},{id:"amm-hotspot-stroke",type:"line",source:o,"source-layer":"amm-hotspot",minzoom:11,paint:{"line-color":r.hotspot,"line-width":1.2}},{id:"amm-runway-centerline",type:"line",source:o,"source-layer":"amm-runway-centerline",minzoom:11,paint:{"line-color":r.runwayCenterline,"line-width":1,"line-dasharray":[6,3]}},{id:"amm-runway-info",type:"symbol",source:o,"source-layer":"amm-runway-label",minzoom:13,layout:{"text-field":["concat",["coalesce",["get","length"],""],"×",["coalesce",["get","width"],""],"m"],"text-size":["interpolate",["exponential",1.5],["zoom"],13,10,16,13],"symbol-placement":"point","text-rotate":["coalesce",["get","bearing"],0],"text-rotation-alignment":"map","text-allow-overlap":!0,"text-ignore-placement":!0},paint:{"text-color":"#e4e4e7","text-halo-color":d,"text-halo-width":2}},{id:"amm-stand-line",type:"line",source:o,"source-layer":"amm-stand-line",minzoom:13,paint:{"line-color":r.standLine,"line-width":1}},{id:"amm-runway-threshold-label",type:"symbol",source:o,"source-layer":"amm-runway-threshold",minzoom:12,layout:{"icon-image":"text_bg","icon-text-fit":"both","icon-text-fit-padding":[1,2,1,2],"text-field":["get","idthr"],"text-size":14,"text-allow-overlap":!0,"text-rotation-alignment":"map","icon-rotation-alignment":"map"},paint:{"text-color":"#ffffff","icon-color":r.threshold}},{id:"amm-stand",type:"circle",source:o,"source-layer":"amm-stand",minzoom:12,paint:{"circle-color":r.stand,"circle-radius":1.5}},{id:"amm-stand-label",type:"symbol",source:o,"source-layer":"amm-stand",minzoom:14,layout:{"text-field":["get","idstd"],"text-size":9,"text-anchor":"bottom","text-offset":[0,-.5],"text-allow-overlap":!1},paint:{"text-color":r.stand,"text-halo-color":d,"text-halo-width":1}},{id:"amm-obstacle-region-fill",type:"fill",source:o,"source-layer":"amm-obstacle-region",minzoom:11,paint:{"fill-color":"#fef08a","fill-opacity":.1}},{id:"amm-obstacle-region-stroke",type:"line",source:o,"source-layer":"amm-obstacle-region",minzoom:11,paint:{"line-color":"#eab308","line-width":1.2,"line-dasharray":[1.5,1]}},{id:"amm-obstacle-point",type:"circle",source:o,"source-layer":"amm-obstacle-point",minzoom:11,paint:{"circle-color":"#f97316","circle-radius":4,"circle-stroke-color":d,"circle-stroke-width":1}},{id:"amm-obstacle-point-label",type:"symbol",source:o,"source-layer":"amm-obstacle-point",minzoom:14,layout:{"text-field":["coalesce",["get","ident"],["get","LABEL"]],"text-size":9,"text-anchor":"bottom","text-offset":[0,-.5],"text-allow-overlap":!1},paint:{"text-color":"#fdba74","text-halo-color":d,"text-halo-width":1.2}},{id:"amm-construction-fill",type:"fill",source:o,"source-layer":"amm-construction",minzoom:11,paint:{"fill-pattern":"normal:passline","fill-opacity":.6}},{id:"amm-construction-stroke",type:"line",source:o,"source-layer":"amm-construction",minzoom:11,paint:{"line-color":"#ea580c","line-width":1.2,"line-dasharray":[4,2]}},{id:"amm-construction-label",type:"symbol",source:o,"source-layer":"amm-construction",minzoom:13,layout:{"text-field":["get","text"],"text-size":9,"text-anchor":"center","symbol-placement":"point","text-allow-overlap":!1},paint:{"text-color":"#f97316","text-halo-color":d,"text-halo-width":1}}]}function Yt(o="amm",r="light"){return r==="dark"?Je(o):r==="neutral"?qe(o):Ye(o)}const ti={ammAirport:["amm-airport-fill","amm-airport-stroke"],ammRunway:["amm-runway-fill","amm-runway-stroke","amm-runway-info","amm-runway-marking","amm-runway-centerline","amm-runway-threshold","amm-runway-threshold-label"],ammApron:["amm-apron-fill","amm-apron-stroke"],ammTaxiway:["amm-taxiway-fill","amm-taxiway-line","amm-taxiway-label"],ammHolding:["amm-holding"],ammStand:["amm-stand","amm-stand-label","amm-stand-line"],ammRestricted:["amm-restricted-fill","amm-restricted-stroke"],ammHotspot:["amm-hotspot-fill","amm-hotspot-stroke"],ammObstacle:["amm-obstacle-region-fill","amm-obstacle-region-stroke","amm-obstacle-point","amm-obstacle-point-label"],ammConstruction:["amm-construction-fill","amm-construction-stroke","amm-construction-label"]},ei="https://aips.siniswift.com",ii=["interpolate",["linear"],["elevation"],0,"#a8c98a",600,"#cdd98a",1200,"#e8d79a",2400,"#c79a5b",3600,"#9c6b3f",4500,"#f2efe9"],Mt=["amm-airport-fill","amm-airport-stroke","amm-runway-fill","amm-runway-stroke","amm-runway-info","amm-runway-marking","amm-runway-centerline","amm-runway-threshold-label","amm-apron-fill","amm-apron-stroke","amm-taxiway-fill","amm-taxiway-line","amm-taxiway-label","amm-holding","amm-stand","amm-stand-label","amm-stand-line","amm-restricted-fill","amm-restricted-stroke","amm-hotspot-fill","amm-hotspot-stroke","amm-obstacle-region-fill","amm-obstacle-region-stroke","amm-obstacle-point","amm-obstacle-point-label","amm-construction-fill","amm-construction-stroke","amm-construction-label"],Zt=["terrain-color","terrain-hillshade"],Jt=["contour-line","contour-label"];async function Qt(o){const r=await fetch(o);if(!r.ok)throw new Error(`fetch ${o} → ${r.status}`);const d=r.headers.get("Content-Encoding"),y=r.headers.get("Content-Type")||"";if(d==="gzip"||y.includes("json"))return r.json();const g=r.body.pipeThrough(new DecompressionStream("gzip"));return new Response(g).json()}class oi{constructor(r={}){const{container:d,theme:y="light",apiUrl:g=ei,spriteUrl:w,period:b=null,layers:S={},center:O=[104,36],zoom:A=4,terrainUrl:z=null}=r;return this._apiUrl=g.replace(/\/$/,""),this._spriteUrl=(w??g).replace(/\/$/,""),this._terrainUrl=z??`${this._apiUrl}/api/terrain/{z}/{x}/{y}.png`,this._theme=y,this._period=b,this._center=O,this._zoom=A,this._ready=!1,this._layerVisible={adiz:!0,fir:!0,restricted:!0,controlled:!0,segment:!0,waypoint:!0,waypointOffAirway:!0,vor:!0,ndb:!0,airport:!0,runway:!0,amm:!0,terrain:!1,contour:!1,...S},this._initMap(d),new Proxy(this,{get(p,x){if(typeof x=="symbol"||Reflect.has(p,x)){const k=p[x];return typeof k=="function"?k.bind(p):k}const T=p._map;if(!T)return;const D=T[x];return typeof D=="function"?D.bind(T):D},set(p,x,T){return typeof x=="symbol"||Reflect.has(p,x)||!p._map?p[x]=T:x in p._map?p._map[x]=T:p[x]=T,!0},has(p,x){return Reflect.has(p,x)||(p._map?x in p._map:!1)}})}_initMap(r){const d=ct[this._theme]??ct.light;this._map=new jt.Map({container:r,style:{version:8,glyphs:"https://aips.siniswift.com/mapsdk/glyphs/{fontstack}/{range}.pbf",sprite:[{id:"normal",url:`${this._spriteUrl}/sprites/sprite-color`},{id:"default",url:`${this._spriteUrl}/sprites/sprite`},{id:"v2",url:`${this._spriteUrl}/sprites/sprite-v2`},{id:"plane",url:`${this._spriteUrl}/sprites/sprite-plane`}],sources:{land:{type:"geojson",data:{type:"FeatureCollection",features:[]}},boundary:{type:"geojson",data:{type:"FeatureCollection",features:[]}}},layers:[{id:"background",type:"background",paint:{"background-color":d.background}}]},center:this._center,zoom:this._zoom,minZoom:0,maxZoom:17.5,crossSourceCollisions:!1,maxTileCacheSize:512,prefetchZoomDelta:1,fadeDuration:0,attributionControl:!1}),this._map.on("load",async()=>{await this._initSources(),this._initLayers(),this._applyVisibility(),this._ready=!0,this._map.fire("aviation:ready")})}async _initSources(){if(!this._period)try{const y=await(await fetch(`${this._apiUrl}/api/periods`)).json();this._period=y[y.length-1]}catch(d){console.warn("[AviationChart] fetchPeriods failed:",d),this._period="latest"}this._map.addSource("navdata",{type:"vector",tiles:[`${this._apiUrl}/api/tiles/${this._period}/{z}/{x}/{y}.pbf`],minzoom:.5,maxzoom:18}),this._map.addSource("amm",{type:"vector",tiles:[`${this._apiUrl}/api/amm/{z}/{x}/{y}.pbf`],minzoom:11,maxzoom:18}),this._map.addSource("terrain",{type:"raster-dem",tiles:[this._terrainUrl],tileSize:256,encoding:"mapbox",maxzoom:8});const r=new Be.DemSource({url:this._terrainUrl,encoding:"mapbox",maxzoom:8,worker:!0});r.setupMaplibre(jt),this._map.addSource("contour",{type:"vector",tiles:[r.contourProtocolUrl({thresholds:{5:[250,1e3],7:[125,500],9:[100,500],11:[50,500],13:[25,500]},elevationKey:"ele",levelKey:"level",contourLayer:"contours"})],maxzoom:13}),await this._loadBaseData()}async _loadBaseData(){var r,d,y,g;try{const[w,b]=await Promise.all([Qt(`${this._apiUrl}/topjson/land.topojson.gz`),Qt(`${this._apiUrl}/topjson/boundary.topojson.gz`)]);(r=w==null?void 0:w.objects)!=null&&r.land?(d=this._map.getSource("land"))==null||d.setData($t(w,w.objects.land)):console.warn("[AviationChart] land topojson missing objects.land"),(y=b==null?void 0:b.objects)!=null&&y.boundary?(g=this._map.getSource("boundary"))==null||g.setData($t(b,b.objects.boundary)):console.warn("[AviationChart] boundary topojson missing objects.boundary")}catch(w){console.error("[AviationChart] loadBaseData failed:",w)}}_initLayers(){const r=this._layerVisible.terrain?"visible":"none",d=this._layerVisible.contour?"visible":"none";this._map.addLayer({id:"terrain-color",type:"color-relief",source:"terrain",layout:{visibility:r},paint:{"color-relief-color":ii}}),this._map.addLayer({id:"terrain-hillshade",type:"hillshade",source:"terrain",layout:{visibility:r},paint:{"hillshade-shadow-color":"rgba(74,59,42,0.35)","hillshade-highlight-color":"rgba(255,246,230,0.25)","hillshade-accent-color":"rgba(74,59,42,0.2)","hillshade-exaggeration":.45,"hillshade-illumination-direction":315,"hillshade-illumination-anchor":"viewport"}}),this._map.addLayer({id:"contour-line",type:"line",source:"contour","source-layer":"contours",layout:{visibility:d},paint:{"line-color":["case",["==",["get","level"],1],"rgba(100,70,40,0.40)","rgba(120,90,60,0.18)"],"line-width":["case",["==",["get","level"],1],1,.5]}}),this._map.addLayer({id:"contour-label",type:"symbol",source:"contour","source-layer":"contours",filter:["==",["get","level"],1],layout:{visibility:d,"symbol-placement":"line","text-field":["concat",["to-string",["get","ele"]],"m"],"text-size":10,"text-font":["Open Sans Regular"],"text-allow-overlap":!0,"text-keep-upright":!0},paint:{"text-color":"rgba(100,70,40,0.55)","text-halo-color":"rgba(255,255,255,0.6)","text-halo-width":1}}),this._layerVisible.terrain&&this._map.setTerrain({source:"terrain",exaggeration:4});for(const y of Ht(this._theme))this._map.getLayer(y.id)||this._map.addLayer(y);for(const y of["terrain-color","terrain-hillshade","contour-line","contour-label"])this._map.getLayer(y)&&this._map.getLayer("boundary")&&this._map.moveLayer(y,"boundary");for(const y of Yt("amm",this._theme))this._map.getLayer(y.id)||this._map.addLayer(y,"fir-line")}_applyVisibility(){for(const[g,w]of Object.entries(Dt)){const b=this._layerVisible[g]!==!1?"visible":"none";for(const S of w)this._map.getLayer(S)&&this._map.setLayoutProperty(S,"visibility",b)}const r=this._layerVisible.amm!==!1?"visible":"none";for(const g of Mt)this._map.getLayer(g)&&this._map.setLayoutProperty(g,"visibility",r);const d=this._layerVisible.terrain?"visible":"none";for(const g of Zt)this._map.getLayer(g)&&this._map.setLayoutProperty(g,"visibility",d);const y=this._layerVisible.contour?"visible":"none";for(const g of Jt)this._map.getLayer(g)&&this._map.setLayoutProperty(g,"visibility",y)}get map(){return this._map}get theme(){return this._theme}get period(){return this._period}setTheme(r){if(r===this._theme)return;this._theme=r;const d=ct[r]??ct.light;this._map.setPaintProperty("background","background-color",d.background);const y=["landLaye","boundary",...Object.values(Dt).flat(),...Mt];for(const g of y)this._map.getLayer(g)&&this._map.removeLayer(g);for(const g of Ht(this._theme))this._map.addLayer(g);for(const g of Yt("amm",this._theme))this._map.getLayer(g.id)||this._map.addLayer(g,"fir-line");this._applyVisibility()}setLayerVisible(r,d){if(this._layerVisible[r]=d,r==="terrain"){const w=d?"visible":"none";for(const b of Zt)this._map.getLayer(b)&&this._map.setLayoutProperty(b,"visibility",w);this._map.setTerrain(d?{source:"terrain",exaggeration:4}:null);return}if(r==="contour"){const w=d?"visible":"none";for(const b of Jt)this._map.getLayer(b)&&this._map.setLayoutProperty(b,"visibility",w);return}if(r==="amm"){const w=d?"visible":"none";for(const b of Mt)this._map.getLayer(b)&&this._map.setLayoutProperty(b,"visibility",w);return}const y=Dt[r];if(!y){console.warn(`[AviationChart] Unknown layer key: "${r}"`);return}const g=d?"visible":"none";for(const w of y)this._map.getLayer(w)&&this._map.setLayoutProperty(w,"visibility",g)}setPeriod(r){var y;this._period=r;const d=(y=this._map)==null?void 0:y.getSource("navdata");d&&d.setTiles([`${this._apiUrl}/api/tiles/${r}/{z}/{x}/{y}.pbf`])}on(r,d,y){return typeof d=="string"?this._map.on(r,d,y):this._map.on(r,d??y),this}off(r,d,y){return typeof d=="string"?this._map.off(r,d,y):this._map.off(r,d??y),this}once(r,d,y){return typeof d=="string"?this._map.once(r,d,y):this._map.once(r,d??y),this}destroy(){this._map&&(this._map.remove(),this._map=null)}}exports.AMM_LAYER_GROUPS=ti;exports.AviationChart=oi;exports.CHART_THEMES=ct;exports.LAYER_GROUPS=Dt;