@chrtco/sdk 0.10.2 → 0.10.3

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.
package/dist/index.cjs CHANGED
@@ -40,6 +40,7 @@ __export(index_exports, {
40
40
  CHRT_ICON_EXPRESSIONS: () => CHRT_ICON_EXPRESSIONS,
41
41
  CHRT_ICON_PREFIX: () => CHRT_ICON_PREFIX,
42
42
  CHRT_SDF_GLYPHS: () => CHRT_SDF_GLYPHS,
43
+ CHRT_STYLE_MODES: () => CHRT_STYLE_MODES,
43
44
  Chrt: () => Chrt,
44
45
  ChrtError: () => ChrtError,
45
46
  DEFAULT_CLICK_TOLERANCE: () => DEFAULT_CLICK_TOLERANCE,
@@ -169,6 +170,7 @@ __export(index_exports, {
169
170
  lightColor: () => lightColor,
170
171
  lightFillExpression: () => lightFillExpression,
171
172
  lightsIconExpression: () => lightsIconExpression,
173
+ normalizeStyleMode: () => normalizeStyleMode,
172
174
  normalizeTheme: () => normalizeTheme,
173
175
  paginate: () => paginate,
174
176
  parseListCodes: () => parseListCodes,
@@ -189,6 +191,7 @@ __export(index_exports, {
189
191
  sanitizeCustomStyleConfig: () => sanitizeCustomStyleConfig,
190
192
  scaleSizeValue: () => scaleSizeValue,
191
193
  scaminToMinZoom: () => scaminToMinZoom,
194
+ styleModeBand: () => styleModeBand,
192
195
  withinBboxFilter: () => withinBboxFilter,
193
196
  worldMinusBboxPolygon: () => worldMinusBboxPolygon
194
197
  });
@@ -536,10 +539,11 @@ var TilesEndpoint = class {
536
539
  }
537
540
  region;
538
541
  tileBaseUrl;
539
- styleEndpoint(theme, symbols) {
542
+ styleEndpoint(opts) {
540
543
  const params = new URLSearchParams();
541
- if (theme) params.set("theme", theme);
542
- if (symbols) params.set("symbols", symbols);
544
+ if (opts.theme) params.set("theme", opts.theme);
545
+ if (opts.symbols) params.set("symbols", opts.symbols);
546
+ if (opts.mode) params.set("mode", opts.mode);
543
547
  const query2 = params.size > 0 ? `?${params.toString()}` : "";
544
548
  return `${this.tileBaseUrl}/v1/styles/${this.region}/style.json${query2}`;
545
549
  }
@@ -565,7 +569,7 @@ var TilesEndpoint = class {
565
569
  */
566
570
  async styleUrl(opts = {}) {
567
571
  await this.tileAuth.getToken(this.region);
568
- return this.styleEndpoint(opts.theme, opts.symbols);
572
+ return this.styleEndpoint(opts);
569
573
  }
570
574
  /**
571
575
  * Fetch the served S-52 style as a MapLibre style object (see
@@ -579,7 +583,7 @@ var TilesEndpoint = class {
579
583
  */
580
584
  async fetchStyle(opts = {}) {
581
585
  const token = await this.tileAuth.getToken(this.region);
582
- const res = await fetch(this.styleEndpoint(opts.theme, opts.symbols), {
586
+ const res = await fetch(this.styleEndpoint(opts), {
583
587
  headers: { authorization: `Bearer ${token.token}` },
584
588
  signal: opts.signal
585
589
  });
@@ -1154,7 +1158,9 @@ var OfflineEndpoint = class {
1154
1158
  const token = await this.requireToken([region]);
1155
1159
  const palette = opts.palette ?? "DAY";
1156
1160
  const protocol = opts.protocol ?? "mbtiles";
1157
- const path = `/offline/styles/${encodeURIComponent(region)}?palette=${palette}&protocol=${protocol}`;
1161
+ const symbolsParam = opts.symbols ? `&symbols=${encodeURIComponent(opts.symbols)}` : "";
1162
+ const modeParam = opts.mode ? `&mode=${encodeURIComponent(opts.mode)}` : "";
1163
+ const path = `/offline/styles/${encodeURIComponent(region)}?palette=${palette}&protocol=${protocol}${symbolsParam}${modeParam}`;
1158
1164
  const res = await this.http.getJsonWithBearer(
1159
1165
  path,
1160
1166
  token.token
@@ -1499,157 +1505,519 @@ function dirname(p) {
1499
1505
  return p.slice(0, k);
1500
1506
  }
1501
1507
 
1502
- // src/interact/decode.ts
1503
- var LITCHR_TABLE = {
1504
- 1: { name: "Fixed", abbr: "F" },
1505
- 2: { name: "Flashing", abbr: "Fl" },
1506
- 3: { name: "Long Flashing", abbr: "LFl" },
1507
- 4: { name: "Occulting", abbr: "Oc" },
1508
- 5: { name: "Isophase", abbr: "Iso" },
1509
- 6: { name: "Short Flashing", abbr: "S.Fl" },
1510
- 7: { name: "Short Long Flashing", abbr: "S.LFl" },
1511
- 8: { name: "Alternating Occulting", abbr: "Al.Oc" },
1512
- 9: { name: "Alternating Long Flashing", abbr: "Al.LFl" },
1513
- 10: { name: "Alternating Flashing", abbr: "Al.Fl" },
1514
- 11: { name: "Alternating Group", abbr: "Al.Gp" },
1515
- 12: { name: "Morse", abbr: "Mo" },
1516
- 13: { name: "Quick", abbr: "Q" },
1517
- 14: { name: "Very Quick", abbr: "VQ" },
1518
- 15: { name: "Ultra Quick", abbr: "UQ" },
1519
- 16: { name: "Alternating", abbr: "Al" },
1520
- 17: { name: "Alternating Fixed/Flash", abbr: "Al.F.Fl" },
1521
- 25: { name: "Quick + Long Flash", abbr: "Q+LFl" },
1522
- 26: { name: "Very Quick + Long Flash", abbr: "VQ+LFl" },
1523
- 27: { name: "Ultra Quick + Long Flash", abbr: "UQ+LFl" },
1524
- 28: { name: "Alternating", abbr: "Al" },
1525
- 29: { name: "Fixed + Long Flash", abbr: "F.LFl" }
1508
+ // src/s57/codelists.generated.ts
1509
+ var BOYSHP_CODES = {
1510
+ 1: { code: 1, name: "Conical (nun, ogival)" },
1511
+ 2: { code: 2, name: "Can (cylindrical)" },
1512
+ 3: { code: 3, name: "Spherical" },
1513
+ 4: { code: 4, name: "Pillar" },
1514
+ 5: { code: 5, name: "Spar (spindle)" },
1515
+ 6: { code: 6, name: "Barrel (tun)" },
1516
+ 7: { code: 7, name: "Super-buoy" },
1517
+ 8: { code: 8, name: "Ice buoy" }
1518
+ };
1519
+ var CATACH_CODES = {
1520
+ 1: { code: 1, name: "Unrestricted anchorage" },
1521
+ 2: { code: 2, name: "Deep water anchorage" },
1522
+ 3: { code: 3, name: "Tanker anchorage" },
1523
+ 4: { code: 4, name: "Explosives anchorage" },
1524
+ 5: { code: 5, name: "Quarantine anchorage" },
1525
+ 6: { code: 6, name: "Sea-plane anchorage" },
1526
+ 7: { code: 7, name: "Small craft anchorage" },
1527
+ 8: { code: 8, name: "Small craft mooring area" },
1528
+ 9: { code: 9, name: "Anchorage for periods up to 24 hours" }
1529
+ };
1530
+ var CATCAM_CODES = {
1531
+ 1: { code: 1, name: "North cardinal mark" },
1532
+ 2: { code: 2, name: "East cardinal mark" },
1533
+ 3: { code: 3, name: "South cardinal mark" },
1534
+ 4: { code: 4, name: "West cardinal mark" }
1535
+ };
1536
+ var CATCBL_CODES = {
1537
+ 1: { code: 1, name: "Power line" },
1538
+ 2: { code: 2, name: "Submarine cable", supplement: true, unverified: true },
1539
+ 3: { code: 3, name: "Transmission line" },
1540
+ 4: { code: 4, name: "Telephone" },
1541
+ 5: { code: 5, name: "Telegraph" },
1542
+ 6: { code: 6, name: "Mooring cable/chain" }
1543
+ };
1544
+ var CATCOA_CODES = {
1545
+ 1: { code: 1, name: "Steep coast" },
1546
+ 2: { code: 2, name: "Flat coast" },
1547
+ 3: { code: 3, name: "Sandy shore" },
1548
+ 4: { code: 4, name: "Stony shore" },
1549
+ 5: { code: 5, name: "Shingly shore" },
1550
+ 6: { code: 6, name: "Glacier (seaward end)" },
1551
+ 7: { code: 7, name: "Mangrove" },
1552
+ 8: { code: 8, name: "Marshy shore" },
1553
+ 9: { code: 9, name: "Coral reef" },
1554
+ 10: { code: 10, name: "Ice coast" },
1555
+ 11: { code: 11, name: "Embankment", supplement: true, unverified: true }
1556
+ };
1557
+ var CATCRN_CODES = {
1558
+ 2: { code: 2, name: "Container crane/gantry" },
1559
+ 3: { code: 3, name: "Sheerlegs" },
1560
+ 4: { code: 4, name: "Travelling crane" },
1561
+ 5: { code: 5, name: "A-frame" }
1562
+ };
1563
+ var CATDPG_CODES = {
1564
+ 1: { code: 1, name: "General dumping ground", supplement: true, unverified: true },
1565
+ 2: { code: 2, name: "Chemical waste dumping ground" },
1566
+ 3: { code: 3, name: "Nuclear waste dumping ground" },
1567
+ 4: { code: 4, name: "Explosives dumping ground" },
1568
+ 5: { code: 5, name: "Spoil ground" },
1569
+ 6: { code: 6, name: "Vessel dumping ground" }
1570
+ };
1571
+ var CATFOG_CODES = {
1572
+ 1: { code: 1, name: "Explosive", abbr: "EXPLOS" },
1573
+ 2: { code: 2, name: "Diaphone", abbr: "DIA" },
1574
+ 3: { code: 3, name: "Siren", abbr: "SIREN" },
1575
+ 4: { code: 4, name: "Nautophone", abbr: "NAUTO" },
1576
+ 5: { code: 5, name: "Reed", abbr: "REED" },
1577
+ 6: { code: 6, name: "Tyfon", abbr: "TYFON" },
1578
+ 7: { code: 7, name: "Bell", abbr: "BELL" },
1579
+ 8: { code: 8, name: "Whistle", abbr: "WHIS" },
1580
+ 9: { code: 9, name: "Gong", abbr: "GONG" },
1581
+ 10: { code: 10, name: "Horn", abbr: "HORN" }
1582
+ };
1583
+ var CATHAF_CODES = {
1584
+ 1: { code: 1, name: "RoRo-terminal" },
1585
+ 3: { code: 3, name: "Ferry terminal" },
1586
+ 4: { code: 4, name: "Fishing harbour" },
1587
+ 5: { code: 5, name: "Yacht harbour/marina" },
1588
+ 6: { code: 6, name: "Naval base" },
1589
+ 7: { code: 7, name: "Tanker terminal" },
1590
+ 8: { code: 8, name: "Passenger terminal" },
1591
+ 9: { code: 9, name: "Shipyard" },
1592
+ 10: { code: 10, name: "Container terminal" },
1593
+ 11: { code: 11, name: "Bulk terminal" },
1594
+ 12: { code: 12, name: "Synchrolift", supplement: true, unverified: true },
1595
+ 13: { code: 13, name: "Straddle carrier", supplement: true, unverified: true },
1596
+ 14: { code: 14, name: "Port terminal", supplement: true, unverified: true }
1597
+ };
1598
+ var CATLAM_CODES = {
1599
+ 1: { code: 1, name: "Port-hand lateral mark" },
1600
+ 2: { code: 2, name: "Starboard-hand lateral mark" },
1601
+ 3: { code: 3, name: "Preferred channel to starboard lateral mark" },
1602
+ 4: { code: 4, name: "Preferred channel to port lateral mark" }
1603
+ };
1604
+ var CATLIT_CODES = {
1605
+ 1: { code: 1, name: "Directional function" },
1606
+ 4: { code: 4, name: "Leading light" },
1607
+ 5: { code: 5, name: "Aero light" },
1608
+ 6: { code: 6, name: "Air obstruction light" },
1609
+ 7: { code: 7, name: "Fog detector light" },
1610
+ 8: { code: 8, name: "Flood light" },
1611
+ 9: { code: 9, name: "Strip light" },
1612
+ 10: { code: 10, name: "Subsidiary light" },
1613
+ 11: { code: 11, name: "Spotlight" },
1614
+ 12: { code: 12, name: "Front" },
1615
+ 13: { code: 13, name: "Rear" },
1616
+ 14: { code: 14, name: "Lower" },
1617
+ 15: { code: 15, name: "Upper" },
1618
+ 16: { code: 16, name: "Moir\xE9 effect" },
1619
+ 17: { code: 17, name: "Emergency" },
1620
+ 18: { code: 18, name: "Bearing light" },
1621
+ 19: { code: 19, name: "Horizontally disposed" },
1622
+ 20: { code: 20, name: "Vertically disposed" }
1623
+ };
1624
+ var CATLMK_CODES = {
1625
+ 1: { code: 1, name: "Cairn" },
1626
+ 2: { code: 2, name: "Cemetery" },
1627
+ 3: { code: 3, name: "Chimney" },
1628
+ 4: { code: 4, name: "Dish aerial" },
1629
+ 5: { code: 5, name: "Flagstaff (flagpole)" },
1630
+ 6: { code: 6, name: "Flare stack" },
1631
+ 7: { code: 7, name: "Mast" },
1632
+ 8: { code: 8, name: "Windsock" },
1633
+ 9: { code: 9, name: "Monument" },
1634
+ 10: { code: 10, name: "Column (pillar)" },
1635
+ 11: { code: 11, name: "Memorial plaque" },
1636
+ 12: { code: 12, name: "Obelisk" },
1637
+ 13: { code: 13, name: "Statue" },
1638
+ 14: { code: 14, name: "Cross" },
1639
+ 15: { code: 15, name: "Dome" },
1640
+ 16: { code: 16, name: "Radar scanner" },
1641
+ 17: { code: 17, name: "Tower" },
1642
+ 18: { code: 18, name: "Windmill" },
1643
+ 19: { code: 19, name: "Windmotor" },
1644
+ 20: { code: 20, name: "Spire/minaret" }
1526
1645
  };
1527
- var COLOUR_TABLE = {
1528
- 1: { name: "White", abbr: "W", hex: "#ffffff" },
1529
- 2: { name: "Black", abbr: "B", hex: "#333333" },
1530
- 3: { name: "Red", abbr: "R", hex: "#ef4444" },
1531
- 4: { name: "Green", abbr: "G", hex: "#22c55e" },
1532
- 5: { name: "Blue", abbr: "Bu", hex: "#3b82f6" },
1533
- 6: { name: "Yellow", abbr: "Y", hex: "#eab308" },
1534
- 7: { name: "Grey", abbr: "Gr", hex: "#9ca3af" },
1535
- 8: { name: "Brown", abbr: "Bn", hex: "#92400e" },
1536
- 9: { name: "Amber", abbr: "Am", hex: "#f59e0b" },
1537
- 10: { name: "Violet", abbr: "Vi", hex: "#8b5cf6" },
1538
- 11: { name: "Orange", abbr: "Or", hex: "#f97316" },
1539
- 12: { name: "Magenta", abbr: "Mg", hex: "#d946ef" },
1540
- 13: { name: "Pink", abbr: "Pk", hex: "#f472b6" }
1646
+ var CATMFA_CODES = {
1647
+ 1: { code: 1, name: "Crustaceans" },
1648
+ 2: { code: 2, name: "Oyster/mussels" },
1649
+ 3: { code: 3, name: "Fish" },
1650
+ 4: { code: 4, name: "Seaweed" },
1651
+ 5: { code: 5, name: "Seaweed / kelp farm", supplement: true, unverified: true }
1541
1652
  };
1542
- var BOYSHP_TABLE = {
1543
- 1: "Conical (nun)",
1544
- 2: "Can (cylindrical)",
1545
- 3: "Spherical",
1546
- 4: "Pillar",
1547
- 5: "Spar",
1548
- 6: "Barrel",
1549
- 7: "Super buoy",
1550
- 8: "Ice buoy"
1653
+ var CATOBS_CODES = {
1654
+ 1: { code: 1, name: "Snag / stump" },
1655
+ 2: { code: 2, name: "Wellhead" },
1656
+ 3: { code: 3, name: "Diffuser" },
1657
+ 4: { code: 4, name: "Crib" },
1658
+ 5: { code: 5, name: "Fish haven" },
1659
+ 6: { code: 6, name: "Foul area" },
1660
+ 7: { code: 7, name: "Foul ground" },
1661
+ 8: { code: 8, name: "Ice boom" },
1662
+ 9: { code: 9, name: "Ground tackle" },
1663
+ 10: { code: 10, name: "Boom", supplement: true, unverified: true },
1664
+ 11: { code: 11, name: "Platform", supplement: true, unverified: true }
1551
1665
  };
1552
- var CATLAM_TABLE = {
1553
- 1: "Port",
1554
- 2: "Starboard",
1555
- 3: "Preferred channel to starboard",
1556
- 4: "Preferred channel to port"
1666
+ var CATPIP_CODES = {
1667
+ 1: { code: 1, name: "Pipeline in general", supplement: true, unverified: true },
1668
+ 2: { code: 2, name: "Outfall pipe" },
1669
+ 3: { code: 3, name: "Intake pipe" },
1670
+ 4: { code: 4, name: "Sewer" },
1671
+ 5: { code: 5, name: "Bubbler system" },
1672
+ 6: { code: 6, name: "Supply pipe" }
1557
1673
  };
1558
- var CATCAM_TABLE = {
1559
- 1: "North cardinal",
1560
- 2: "East cardinal",
1561
- 3: "South cardinal",
1562
- 4: "West cardinal"
1674
+ var CATREA_CODES = {
1675
+ 1: { code: 1, name: "Offshore safety zone" },
1676
+ 2: { code: 2, name: "Anchoring prohibition", supplement: true, unverified: true },
1677
+ 3: { code: 3, name: "Fishing prohibition", supplement: true, unverified: true },
1678
+ 4: { code: 4, name: "Nature reserve" },
1679
+ 5: { code: 5, name: "Bird sanctuary" },
1680
+ 6: { code: 6, name: "Game preserve" },
1681
+ 7: { code: 7, name: "Seal sanctuary" },
1682
+ 8: { code: 8, name: "Degaussing range" },
1683
+ 9: { code: 9, name: "Military area" },
1684
+ 10: { code: 10, name: "Historic wreck area" },
1685
+ 12: { code: 12, name: "Navigational aid safety zone" },
1686
+ 14: { code: 14, name: "Minefield" },
1687
+ 18: { code: 18, name: "Swimming area" },
1688
+ 19: { code: 19, name: "Waiting area" },
1689
+ 20: { code: 20, name: "Research area" },
1690
+ 21: { code: 21, name: "Dredging area" },
1691
+ 22: { code: 22, name: "Fish sanctuary" },
1692
+ 23: { code: 23, name: "Ecological reserve" },
1693
+ 24: { code: 24, name: "No wake area" },
1694
+ 25: { code: 25, name: "Swinging area" },
1695
+ 26: { code: 26, name: "No fishing area", supplement: true, unverified: true },
1696
+ 27: { code: 27, name: "Speed restriction zone", supplement: true, unverified: true },
1697
+ 28: { code: 28, name: "To be avoided area", supplement: true, unverified: true }
1563
1698
  };
1564
- var CATLMK_TABLE = {
1565
- 1: "Cairn",
1566
- 2: "Cemetery",
1567
- 3: "Chimney",
1568
- 4: "Dish aerial",
1569
- 5: "Flagstaff",
1570
- 6: "Flare stack",
1571
- 7: "Mast",
1572
- 8: "Windsock",
1573
- 9: "Monument",
1574
- 10: "Column / pillar",
1575
- 11: "Memorial plaque",
1576
- 12: "Obelisk",
1577
- 13: "Statue",
1578
- 14: "Cross",
1579
- 15: "Dome",
1580
- 16: "Radar scanner",
1581
- 17: "Tower",
1582
- 18: "Windmill",
1583
- 19: "Wind turbine",
1584
- 20: "Spire"
1699
+ var CATSCF_CODES = {
1700
+ 1: { code: 1, name: "Visitors' berth" },
1701
+ 2: { code: 2, name: "Nautical club" },
1702
+ 3: { code: 3, name: "Boat hoist" },
1703
+ 4: { code: 4, name: "Sailmaker" },
1704
+ 5: { code: 5, name: "Boatyard" },
1705
+ 6: { code: 6, name: "Public inn" },
1706
+ 7: { code: 7, name: "Restaurant" },
1707
+ 8: { code: 8, name: "Chandler" },
1708
+ 9: { code: 9, name: "Provisions" },
1709
+ 10: { code: 10, name: "Doctor" },
1710
+ 11: { code: 11, name: "Pharmacy" },
1711
+ 12: { code: 12, name: "Water tap" },
1712
+ 13: { code: 13, name: "Fuel station" },
1713
+ 14: { code: 14, name: "Electricity" },
1714
+ 15: { code: 15, name: "Bottle gas" },
1715
+ 16: { code: 16, name: "Showers" },
1716
+ 17: { code: 17, name: "Launderette" },
1717
+ 18: { code: 18, name: "Public toilets" },
1718
+ 19: { code: 19, name: "Post box" },
1719
+ 20: { code: 20, name: "Public telephone" },
1720
+ 21: { code: 21, name: "Refuse bin" },
1721
+ 22: { code: 22, name: "Car park" },
1722
+ 23: { code: 23, name: "Parking for boats and trailers" },
1723
+ 24: { code: 24, name: "Caravan site" },
1724
+ 25: { code: 25, name: "Camping site" },
1725
+ 26: { code: 26, name: "Sewerage pump-out station" },
1726
+ 27: { code: 27, name: "Emergency telephone" },
1727
+ 28: { code: 28, name: "Landing / launching place for boats" },
1728
+ 29: { code: 29, name: "Visitors mooring" },
1729
+ 30: { code: 30, name: "Scrubbing berth" },
1730
+ 31: { code: 31, name: "Picnic area" }
1585
1731
  };
1586
- var CATFOG_TABLE = {
1587
- 1: "Explosive",
1588
- 2: "Diaphone",
1589
- 3: "Siren",
1590
- 4: "Nautophone",
1591
- 5: "Bell",
1592
- 6: "Whistle",
1593
- 7: "Reed",
1594
- 8: "Gong",
1595
- 9: "Horn"
1732
+ var CATWRK_CODES = {
1733
+ 1: { code: 1, name: "Non-dangerous wreck" },
1734
+ 2: { code: 2, name: "Dangerous wreck" },
1735
+ 3: { code: 3, name: "Distributed remains of wreck" },
1736
+ 4: { code: 4, name: "Wreck showing mast/masts" },
1737
+ 5: { code: 5, name: "Wreck showing any portion of hull or superstructure" }
1596
1738
  };
1597
- var CATFOG_ABBR_TABLE = {
1598
- 1: "EXPLOS",
1599
- 2: "DIA",
1600
- 3: "SIREN",
1601
- 4: "NAUTO",
1602
- 5: "BELL",
1603
- 6: "WHIS",
1604
- 7: "REED",
1605
- 8: "GONG",
1606
- 9: "HORN"
1739
+ var COLOUR_CODES = {
1740
+ 1: { code: 1, name: "White", abbr: "W" },
1741
+ 2: { code: 2, name: "Black", abbr: "B" },
1742
+ 3: { code: 3, name: "Red", abbr: "R" },
1743
+ 4: { code: 4, name: "Green", abbr: "G" },
1744
+ 5: { code: 5, name: "Blue", abbr: "Bu" },
1745
+ 6: { code: 6, name: "Yellow", abbr: "Y" },
1746
+ 7: { code: 7, name: "Grey", abbr: "Gr" },
1747
+ 8: { code: 8, name: "Brown", abbr: "Bn" },
1748
+ 9: { code: 9, name: "Amber", abbr: "Am" },
1749
+ 10: { code: 10, name: "Violet", abbr: "Vi" },
1750
+ 11: { code: 11, name: "Orange", abbr: "Or" },
1751
+ 12: { code: 12, name: "Magenta", abbr: "Mg" },
1752
+ 13: { code: 13, name: "Pink", abbr: "Pk" }
1607
1753
  };
1608
- var TOPSHP_TABLE = {
1609
- 1: "Cone, point up",
1610
- 2: "Cone, point down",
1611
- 3: "Sphere",
1612
- 4: "2 spheres",
1613
- 5: "Cylinder",
1614
- 6: "Board",
1615
- 7: "X-shape",
1616
- 8: "Upright cross",
1617
- 9: "Cube, point up",
1618
- 10: "2 cones, point to point",
1619
- 11: "2 cones, base to base",
1620
- 12: "Rhombus",
1621
- 13: "2 cones, up",
1622
- 14: "2 cones, down",
1623
- 15: "Besom, point up",
1624
- 16: "Besom, point down",
1625
- 17: "Flag",
1626
- 18: "Sphere over rhombus",
1627
- 19: "Square",
1628
- 33: "T-shape"
1754
+ var CONDTN_CODES = {
1755
+ 1: { code: 1, name: "Under construction" },
1756
+ 2: { code: 2, name: "Ruined" },
1757
+ 3: { code: 3, name: "Under reclamation" },
1758
+ 4: { code: 4, name: "Wingless" },
1759
+ 5: { code: 5, name: "Planned construction" }
1629
1760
  };
1630
- var STATUS_TABLE = {
1631
- 1: "Permanent",
1632
- 2: "Occasional",
1633
- 3: "Recommended",
1634
- 4: "Not in use",
1635
- 5: "Periodic/intermittent",
1636
- 6: "Reserved",
1637
- 7: "Temporary",
1638
- 8: "Private",
1639
- 9: "Mandatory",
1640
- 11: "Extinguished",
1641
- 12: "Illuminated",
1642
- 13: "Historic",
1643
- 14: "Public",
1644
- 15: "Synchronized",
1645
- 16: "Watched",
1646
- 17: "Un-watched",
1647
- 18: "Existence doubtful"
1761
+ var LITCHR_CODES = {
1762
+ 1: { code: 1, name: "Fixed", abbr: "F" },
1763
+ 2: { code: 2, name: "Flashing", abbr: "Fl" },
1764
+ 3: { code: 3, name: "Long-flashing", abbr: "LFl" },
1765
+ 4: { code: 4, name: "Quick-flashing", abbr: "Q" },
1766
+ 5: { code: 5, name: "Very quick-flashing", abbr: "VQ" },
1767
+ 6: { code: 6, name: "Ultra quick-flashing", abbr: "UQ" },
1768
+ 7: { code: 7, name: "Isophase", abbr: "Iso" },
1769
+ 8: { code: 8, name: "Occulting", abbr: "Oc" },
1770
+ 9: { code: 9, name: "Interrupted quick-flashing", abbr: "IQ" },
1771
+ 10: { code: 10, name: "Interrupted very quick-flashing", abbr: "IVQ" },
1772
+ 11: { code: 11, name: "Interrupted ultra quick-flashing", abbr: "IUQ" },
1773
+ 12: { code: 12, name: "Morse", abbr: "Mo" },
1774
+ 13: { code: 13, name: "Fixed / flash", abbr: "FFl" },
1775
+ 14: { code: 14, name: "Flash / long-flash", abbr: "Fl+LFl" },
1776
+ 15: { code: 15, name: "Occulting / flash", abbr: "Oc+Fl" },
1777
+ 16: { code: 16, name: "Fixed / long-flash", abbr: "FLFl" },
1778
+ 17: { code: 17, name: "Occulting alternating", abbr: "Al.Oc" },
1779
+ 18: { code: 18, name: "Long-flash alternating", abbr: "Al.LFl" },
1780
+ 19: { code: 19, name: "Flash alternating", abbr: "Al.Fl" },
1781
+ 20: { code: 20, name: "Group alternating", abbr: "Al.Gr" },
1782
+ 25: { code: 25, name: "Quick-flash plus long-flash", abbr: "Q+LFl" },
1783
+ 26: { code: 26, name: "Very quick-flash plus long-flash", abbr: "VQ+LFl" },
1784
+ 27: { code: 27, name: "Ultra quick-flash plus long-flash", abbr: "UQ+LFl" },
1785
+ 28: { code: 28, name: "Alternating", abbr: "Al" },
1786
+ 29: { code: 29, name: "Fixed and alternating flashing", abbr: "F.Al.Fl" }
1648
1787
  };
1649
- var MARSYS_TABLE = {
1650
- 1: "IALA-A",
1651
- 2: "IALA-B"
1788
+ var MARSYS_CODES = {
1789
+ 1: { code: 1, name: "IALA A" },
1790
+ 2: { code: 2, name: "IALA B" },
1791
+ 9: { code: 9, name: "No system" },
1792
+ 10: { code: 10, name: "Other system" }
1652
1793
  };
1794
+ var NATSUR_CODES = {
1795
+ 1: { code: 1, name: "Mud" },
1796
+ 2: { code: 2, name: "Clay" },
1797
+ 3: { code: 3, name: "Silt" },
1798
+ 4: { code: 4, name: "Sand" },
1799
+ 5: { code: 5, name: "Stone" },
1800
+ 6: { code: 6, name: "Gravel" },
1801
+ 7: { code: 7, name: "Pebbles" },
1802
+ 8: { code: 8, name: "Cobbles" },
1803
+ 9: { code: 9, name: "Rock" },
1804
+ 11: { code: 11, name: "Lava" },
1805
+ 14: { code: 14, name: "Coral" },
1806
+ 17: { code: 17, name: "Shells" },
1807
+ 18: { code: 18, name: "Boulder" }
1808
+ };
1809
+ var QUASOU_CODES = {
1810
+ 1: { code: 1, name: "Depth known" },
1811
+ 2: { code: 2, name: "Depth unknown" },
1812
+ 3: { code: 3, name: "Doubtful sounding" },
1813
+ 4: { code: 4, name: "Unreliable sounding" },
1814
+ 5: { code: 5, name: "No bottom found at value shown" },
1815
+ 6: { code: 6, name: "Least depth known" },
1816
+ 7: { code: 7, name: "Least depth unknown, safe clearance at value shown" },
1817
+ 8: { code: 8, name: "Value reported (not surveyed)" },
1818
+ 9: { code: 9, name: "Value reported (not confirmed)" },
1819
+ 10: { code: 10, name: "Maintained depth" },
1820
+ 11: { code: 11, name: "Not regularly maintained" }
1821
+ };
1822
+ var RESTRN_CODES = {
1823
+ 1: { code: 1, name: "Anchoring prohibited" },
1824
+ 2: { code: 2, name: "Anchoring restricted" },
1825
+ 3: { code: 3, name: "Fishing prohibited" },
1826
+ 4: { code: 4, name: "Fishing restricted" },
1827
+ 5: { code: 5, name: "Trawling prohibited" },
1828
+ 6: { code: 6, name: "Trawling restricted" },
1829
+ 7: { code: 7, name: "Entry prohibited" },
1830
+ 8: { code: 8, name: "Entry restricted" },
1831
+ 9: { code: 9, name: "Dredging prohibited" },
1832
+ 10: { code: 10, name: "Dredging restricted" },
1833
+ 11: { code: 11, name: "Diving prohibited" },
1834
+ 12: { code: 12, name: "Diving restricted" },
1835
+ 13: { code: 13, name: "No wake" },
1836
+ 14: { code: 14, name: "Area to be avoided" },
1837
+ 15: { code: 15, name: "Construction prohibited" },
1838
+ 16: { code: 16, name: "Discharging prohibited", supplement: true, unverified: true },
1839
+ 17: { code: 17, name: "Discharging restricted", supplement: true, unverified: true },
1840
+ 18: { code: 18, name: "Industrial prohibited", supplement: true, unverified: true },
1841
+ 19: { code: 19, name: "Metallic hull vessels prohibited", supplement: true, unverified: true },
1842
+ 20: { code: 20, name: "Navigating prohibited", supplement: true, unverified: true },
1843
+ 21: { code: 21, name: "Speed restricted", supplement: true, unverified: true },
1844
+ 24: { code: 24, name: "Stopping prohibited", supplement: true, unverified: true },
1845
+ 25: { code: 25, name: "Landing prohibited", supplement: true, unverified: true }
1846
+ };
1847
+ var STATUS_CODES = {
1848
+ 1: { code: 1, name: "Permanent" },
1849
+ 2: { code: 2, name: "Occasional" },
1850
+ 3: { code: 3, name: "Recommended" },
1851
+ 4: { code: 4, name: "Disused" },
1852
+ 5: { code: 5, name: "Periodically/intermittent" },
1853
+ 6: { code: 6, name: "Reserved" },
1854
+ 7: { code: 7, name: "Temporary" },
1855
+ 8: { code: 8, name: "Private" },
1856
+ 9: { code: 9, name: "Mandatory" },
1857
+ 11: { code: 11, name: "Extinguished" },
1858
+ 12: { code: 12, name: "Illuminated" },
1859
+ 13: { code: 13, name: "Historic" },
1860
+ 14: { code: 14, name: "Public" },
1861
+ 15: { code: 15, name: "Synchronized" },
1862
+ 16: { code: 16, name: "Watched" },
1863
+ 17: { code: 17, name: "Un-watched" },
1864
+ 18: { code: 18, name: "Existence doubtful" }
1865
+ };
1866
+ var TOPSHP_CODES = {
1867
+ 1: { code: 1, name: "Cone, point up" },
1868
+ 2: { code: 2, name: "Cone, point down" },
1869
+ 3: { code: 3, name: "Sphere" },
1870
+ 4: { code: 4, name: "2 sphere" },
1871
+ 5: { code: 5, name: "Cylinder (can)" },
1872
+ 6: { code: 6, name: "Board" },
1873
+ 7: { code: 7, name: "X-shape (St. Andrew's cross)" },
1874
+ 8: { code: 8, name: "Upright cross (St. George cross)" },
1875
+ 9: { code: 9, name: "Cube, point up" },
1876
+ 10: { code: 10, name: "2 cones, point to point" },
1877
+ 11: { code: 11, name: "2 cones, base to base" },
1878
+ 12: { code: 12, name: "Rhombus (diamond)" },
1879
+ 13: { code: 13, name: "2 cones (points upward)" },
1880
+ 14: { code: 14, name: "2 cones (points downward)" },
1881
+ 15: { code: 15, name: "Besom, point up (broom or perch)" },
1882
+ 16: { code: 16, name: "Besom, point down (broom or perch)" },
1883
+ 17: { code: 17, name: "Flag" },
1884
+ 18: { code: 18, name: "Sphere over rhombus" },
1885
+ 19: { code: 19, name: "Square" },
1886
+ 20: { code: 20, name: "Rectangle, horizontal" },
1887
+ 21: { code: 21, name: "Rectangle, vertical" },
1888
+ 22: { code: 22, name: "Trapezium, up" },
1889
+ 23: { code: 23, name: "Trapezium, down" },
1890
+ 24: { code: 24, name: "Triangle, point up" },
1891
+ 25: { code: 25, name: "Triangle, point down" },
1892
+ 26: { code: 26, name: "Circle" },
1893
+ 27: { code: 27, name: "Two upright crosses (one over the other)" },
1894
+ 28: { code: 28, name: "T-shape" },
1895
+ 29: { code: 29, name: "Triangle pointing up over a circle" },
1896
+ 30: { code: 30, name: "Upright cross over a circle" },
1897
+ 31: { code: 31, name: "Rhombus over a circle" },
1898
+ 32: { code: 32, name: "Circle over a triangle pointing up" },
1899
+ 33: { code: 33, name: "Other shape (see INFORM)" }
1900
+ };
1901
+ var TRAFIC_CODES = {
1902
+ 1: { code: 1, name: "Inbound" },
1903
+ 2: { code: 2, name: "Outbound" },
1904
+ 3: { code: 3, name: "One-way" },
1905
+ 4: { code: 4, name: "Two-way" }
1906
+ };
1907
+ var WATLEV_CODES = {
1908
+ 1: { code: 1, name: "Partly submerged at high water" },
1909
+ 2: { code: 2, name: "Always dry" },
1910
+ 3: { code: 3, name: "Always under water/submerged" },
1911
+ 4: { code: 4, name: "Covers and uncovers" },
1912
+ 5: { code: 5, name: "Awash" },
1913
+ 6: { code: 6, name: "Subject to inundation or flooding" },
1914
+ 7: { code: 7, name: "Floating", supplement: true, unverified: true }
1915
+ };
1916
+ var S57_CODELISTS = /* @__PURE__ */ new Map([
1917
+ ["BOYSHP", BOYSHP_CODES],
1918
+ ["CATACH", CATACH_CODES],
1919
+ ["CATCAM", CATCAM_CODES],
1920
+ ["CATCBL", CATCBL_CODES],
1921
+ ["CATCOA", CATCOA_CODES],
1922
+ ["CATCRN", CATCRN_CODES],
1923
+ ["CATDPG", CATDPG_CODES],
1924
+ ["CATFOG", CATFOG_CODES],
1925
+ ["CATHAF", CATHAF_CODES],
1926
+ ["CATLAM", CATLAM_CODES],
1927
+ ["CATLIT", CATLIT_CODES],
1928
+ ["CATLMK", CATLMK_CODES],
1929
+ ["CATMFA", CATMFA_CODES],
1930
+ ["CATOBS", CATOBS_CODES],
1931
+ ["CATPIP", CATPIP_CODES],
1932
+ ["CATREA", CATREA_CODES],
1933
+ ["CATSCF", CATSCF_CODES],
1934
+ ["CATWRK", CATWRK_CODES],
1935
+ ["COLOUR", COLOUR_CODES],
1936
+ ["CONDTN", CONDTN_CODES],
1937
+ ["LITCHR", LITCHR_CODES],
1938
+ ["MARSYS", MARSYS_CODES],
1939
+ ["NATSUR", NATSUR_CODES],
1940
+ ["QUASOU", QUASOU_CODES],
1941
+ ["RESTRN", RESTRN_CODES],
1942
+ ["STATUS", STATUS_CODES],
1943
+ ["TOPSHP", TOPSHP_CODES],
1944
+ ["TRAFIC", TRAFIC_CODES],
1945
+ ["WATLEV", WATLEV_CODES]
1946
+ ]);
1947
+ var S57_DOMAINS = new Map(
1948
+ [...S57_CODELISTS].map(([acronym, list]) => [
1949
+ acronym,
1950
+ new Set(Object.keys(list).map(Number))
1951
+ ])
1952
+ );
1953
+ var nameTableCache = /* @__PURE__ */ new Map();
1954
+ var abbrTableCache = /* @__PURE__ */ new Map();
1955
+ function s57NameTable(acronym) {
1956
+ let cached = nameTableCache.get(acronym);
1957
+ if (cached === void 0) {
1958
+ const out = {};
1959
+ for (const c of Object.values(S57_CODELISTS.get(acronym) ?? {})) out[c.code] = c.name;
1960
+ cached = Object.freeze(out);
1961
+ nameTableCache.set(acronym, cached);
1962
+ }
1963
+ return cached;
1964
+ }
1965
+ function s57AbbrTable(acronym) {
1966
+ let cached = abbrTableCache.get(acronym);
1967
+ if (cached === void 0) {
1968
+ const out = {};
1969
+ for (const c of Object.values(S57_CODELISTS.get(acronym) ?? {})) {
1970
+ if (c.abbr !== void 0) out[c.code] = c.abbr;
1971
+ }
1972
+ cached = Object.freeze(out);
1973
+ abbrTableCache.set(acronym, cached);
1974
+ }
1975
+ return cached;
1976
+ }
1977
+
1978
+ // src/interact/decode.ts
1979
+ function nameAbbrTable(acronym) {
1980
+ const names = s57NameTable(acronym);
1981
+ const abbrs = s57AbbrTable(acronym);
1982
+ const out = {};
1983
+ for (const [code, name] of Object.entries(names)) {
1984
+ const abbr = abbrs[Number(code)];
1985
+ if (abbr !== void 0) out[Number(code)] = { name, abbr };
1986
+ }
1987
+ return out;
1988
+ }
1989
+ var COLOUR_HEX = {
1990
+ 1: "#ffffff",
1991
+ 2: "#333333",
1992
+ 3: "#ef4444",
1993
+ 4: "#22c55e",
1994
+ 5: "#3b82f6",
1995
+ 6: "#eab308",
1996
+ 7: "#9ca3af",
1997
+ 8: "#92400e",
1998
+ 9: "#f59e0b",
1999
+ 10: "#8b5cf6",
2000
+ 11: "#f97316",
2001
+ 12: "#d946ef",
2002
+ 13: "#f472b6"
2003
+ };
2004
+ var LITCHR_TABLE = nameAbbrTable("LITCHR");
2005
+ var COLOUR_TABLE = Object.fromEntries(
2006
+ Object.values(COLOUR_CODES).filter((c) => c.abbr !== void 0 && COLOUR_HEX[c.code] !== void 0).map((c) => [c.code, { name: c.name, abbr: c.abbr, hex: COLOUR_HEX[c.code] }])
2007
+ );
2008
+ var BOYSHP_TABLE = s57NameTable("BOYSHP");
2009
+ var CATLAM_TABLE = s57NameTable("CATLAM");
2010
+ var CATCAM_TABLE = s57NameTable("CATCAM");
2011
+ var CATLMK_TABLE = s57NameTable("CATLMK");
2012
+ var CATFOG_TABLE = s57NameTable("CATFOG");
2013
+ var CATFOG_ABBR_TABLE = s57AbbrTable("CATFOG");
2014
+ var CATFOG_NAUTOPHONE = Object.values(CATFOG_CODES).find(
2015
+ (c) => c.name.toLowerCase() === "nautophone"
2016
+ )?.code;
2017
+ var CATLIT_TABLE = s57NameTable("CATLIT");
2018
+ var TOPSHP_TABLE = s57NameTable("TOPSHP");
2019
+ var STATUS_TABLE = s57NameTable("STATUS");
2020
+ var MARSYS_TABLE = s57NameTable("MARSYS");
1653
2021
  var LAYER_TYPE_MAP = {
1654
2022
  BOYLAT: "Lateral Buoy",
1655
2023
  BOYCAR: "Cardinal Buoy",
@@ -1843,12 +2211,7 @@ var CATBRG_LABELS = {
1843
2211
  11: "Aqueduct",
1844
2212
  12: "Suspension bridge"
1845
2213
  };
1846
- var CONDTN_TABLE = {
1847
- 1: "Under construction",
1848
- 2: "Ruined",
1849
- 3: "Under reclamation",
1850
- 5: "Planned"
1851
- };
2214
+ var CONDTN_TABLE = s57NameTable("CONDTN");
1852
2215
  function parseFirstNum(val) {
1853
2216
  if (val == null) return null;
1854
2217
  const s = String(val);
@@ -1890,185 +2253,21 @@ function decodeBridgeProps(props) {
1890
2253
  sourceDate: props.SORDAT ? String(props.SORDAT) : null
1891
2254
  };
1892
2255
  }
1893
- var CATOBS_TABLE = {
1894
- 1: "Snag / stump",
1895
- 2: "Wellhead",
1896
- 3: "Diffuser",
1897
- 4: "Crib",
1898
- 5: "Fish haven",
1899
- 6: "Foul area",
1900
- 7: "Foul ground",
1901
- 8: "Ice boom",
1902
- 9: "Ground tackle",
1903
- 10: "Boom",
1904
- 11: "Platform"
1905
- };
1906
- var CATWRK_TABLE = {
1907
- 1: "Non-dangerous",
1908
- 2: "Dangerous",
1909
- 3: "Distributed remains",
1910
- 4: "Mast showing",
1911
- 5: "Hull showing"
1912
- };
1913
- var WATLEV_TABLE = {
1914
- 1: "Partly submerged at high water",
1915
- 2: "Always dry",
1916
- 3: "Always submerged",
1917
- 4: "Covers and uncovers",
1918
- 5: "Awash",
1919
- 6: "Subject to inundation / flooding",
1920
- 7: "Floating"
1921
- };
1922
- var CATREA_TABLE = {
1923
- 1: "Offshore safety zone",
1924
- 2: "Anchoring prohibition",
1925
- 3: "Fishing prohibition",
1926
- 4: "Nature reserve",
1927
- 5: "Bird sanctuary",
1928
- 6: "Game preserve",
1929
- 7: "Seal sanctuary",
1930
- 8: "Degaussing range",
1931
- 9: "Military area",
1932
- 10: "Historic wreck",
1933
- 12: "Navigational aid safety zone",
1934
- 14: "No wake zone",
1935
- 18: "Swimming area",
1936
- 19: "Waiting area",
1937
- 20: "Research area",
1938
- 21: "Dredging area",
1939
- 22: "Fish sanctuary",
1940
- 23: "Ecological reserve",
1941
- 24: "No discharge zone",
1942
- 25: "No anchoring area",
1943
- 26: "No fishing area",
1944
- 27: "Speed restriction zone",
1945
- 28: "To be avoided area"
1946
- };
1947
- var RESTRN_TABLE = {
1948
- 1: "Anchoring prohibited",
1949
- 2: "Anchoring restricted",
1950
- 3: "Fishing prohibited",
1951
- 4: "Fishing restricted",
1952
- 5: "Trawling prohibited",
1953
- 6: "Trawling restricted",
1954
- 7: "Entry prohibited",
1955
- 8: "Entry restricted",
1956
- 9: "Dredging prohibited",
1957
- 10: "Dredging restricted",
1958
- 11: "Diving prohibited",
1959
- 12: "Diving restricted",
1960
- 13: "No wake",
1961
- 14: "To be avoided",
1962
- 15: "Construction prohibited",
1963
- 16: "Discharging prohibited",
1964
- 17: "Discharging restricted",
1965
- 18: "Industrial prohibited",
1966
- 19: "Metallic hull vessels prohibited",
1967
- 20: "Navigating prohibited",
1968
- 21: "Speed restricted",
1969
- 24: "Stopping prohibited",
1970
- 25: "Landing prohibited"
1971
- };
1972
- var CATHAF_TABLE = {
1973
- 1: "RoRo terminal",
1974
- 3: "Ferry terminal",
1975
- 4: "Fishing harbour",
1976
- 5: "Yacht harbour / marina",
1977
- 6: "Naval base",
1978
- 7: "Tanker terminal",
1979
- 8: "Passenger terminal",
1980
- 9: "Shipyard",
1981
- 10: "Container terminal",
1982
- 11: "Bulk terminal",
1983
- 12: "Synchrolift",
1984
- 13: "Straddle carrier",
1985
- 14: "Port terminal"
1986
- };
1987
- var CATSCF_TABLE = {
1988
- 1: "Visitors' berth",
1989
- 2: "Nautical club",
1990
- 3: "Boat hoist",
1991
- 4: "Sailmaker",
1992
- 5: "Boatyard",
1993
- 6: "Public inn",
1994
- 7: "Restaurant",
1995
- 8: "Chandler",
1996
- 9: "Provisions",
1997
- 10: "Doctor",
1998
- 11: "Pharmacy",
1999
- 12: "Water tap",
2000
- 13: "Fuel station",
2001
- 14: "Electricity",
2002
- 15: "Bottle gas",
2003
- 16: "Showers",
2004
- 17: "Launderette",
2005
- 18: "Public toilets",
2006
- 19: "Post box"
2007
- };
2008
- var CATCRN_TABLE = {
2009
- 2: "Container crane / gantry",
2010
- 3: "Sheerlegs",
2011
- 4: "Travelling crane"
2012
- };
2013
- var CATACH_TABLE = {
2014
- 1: "Unrestricted anchorage",
2015
- 2: "Deep water anchorage",
2016
- 3: "Tanker anchorage",
2017
- 4: "Explosives anchorage",
2018
- 5: "Quarantine anchorage",
2019
- 6: "Sea-plane anchorage",
2020
- 7: "Small craft anchorage",
2021
- 8: "Small craft mooring area",
2022
- 9: "Anchorage for 24 hours or less"
2023
- };
2024
- var CATDPG_TABLE = {
2025
- 1: "General dumping ground",
2026
- 2: "Chemical waste",
2027
- 3: "Nuclear waste",
2028
- 4: "Explosives",
2029
- 5: "Spoil ground",
2030
- 6: "Vessel dumping ground"
2031
- };
2032
- var CATMFA_TABLE = {
2033
- 1: "Crustaceans",
2034
- 2: "Oysters / mussels",
2035
- 3: "Fish",
2036
- 4: "Seaweed",
2037
- 5: "Pearl culture"
2038
- };
2039
- var CATCBL_TABLE = {
2040
- 1: "Submarine power cable",
2041
- 2: "Submarine transmission cable",
2042
- 3: "Submarine telegraph cable",
2043
- 4: "Submarine telephone cable",
2044
- 5: "Mooring cable",
2045
- 6: "Ferry cable"
2046
- };
2047
- var CATPIP_TABLE = {
2048
- 1: "Pipeline",
2049
- 2: "Outfall pipe",
2050
- 3: "Intake pipe",
2051
- 4: "Sewer",
2052
- 5: "Bubbler system",
2053
- 6: "Supply pipe"
2054
- };
2055
- var TRAFIC_TABLE = {
2056
- 1: "Inbound",
2057
- 2: "Outbound",
2058
- 3: "One-way",
2059
- 4: "Two-way"
2060
- };
2061
- var QUASOU_TABLE = {
2062
- 1: "Depth known",
2063
- 2: "Depth unknown",
2064
- 3: "Doubtful sounding",
2065
- 4: "Unreliable sounding",
2066
- 6: "Least depth known",
2067
- 7: "Least depth unknown",
2068
- 9: "Not regularly maintained",
2069
- 10: "Maintained depth",
2070
- 11: "Not surveyed"
2071
- };
2256
+ var CATOBS_TABLE = s57NameTable("CATOBS");
2257
+ var CATWRK_TABLE = s57NameTable("CATWRK");
2258
+ var WATLEV_TABLE = s57NameTable("WATLEV");
2259
+ var CATREA_TABLE = s57NameTable("CATREA");
2260
+ var RESTRN_TABLE = s57NameTable("RESTRN");
2261
+ var CATHAF_TABLE = s57NameTable("CATHAF");
2262
+ var CATSCF_TABLE = s57NameTable("CATSCF");
2263
+ var CATCRN_TABLE = s57NameTable("CATCRN");
2264
+ var CATACH_TABLE = s57NameTable("CATACH");
2265
+ var CATDPG_TABLE = s57NameTable("CATDPG");
2266
+ var CATMFA_TABLE = s57NameTable("CATMFA");
2267
+ var CATCBL_TABLE = s57NameTable("CATCBL");
2268
+ var CATPIP_TABLE = s57NameTable("CATPIP");
2269
+ var TRAFIC_TABLE = s57NameTable("TRAFIC");
2270
+ var QUASOU_TABLE = s57NameTable("QUASOU");
2072
2271
  function decodeAreaFeatureProps(layerName, props) {
2073
2272
  const rawLayer = layerName.replace(/^enc-/, "").replace(/-(point|line|polygon|midpoint)$/, "");
2074
2273
  const parseCodeLocal = (val) => {
@@ -2531,6 +2730,15 @@ function decodeAreaFeatureProps(layerName, props) {
2531
2730
  if (st && STATUS_TABLE[st]) entries.push({ label: "Status", value: STATUS_TABLE[st] });
2532
2731
  return { type, title: title || type, properties: entries };
2533
2732
  }
2733
+ function catfogCodeFromName(lowercaseName) {
2734
+ if (!lowercaseName) return null;
2735
+ for (const entry of Object.values(CATFOG_CODES)) {
2736
+ const term = entry.name.toLowerCase();
2737
+ if (new RegExp(`\\b${term}\\b`).test(lowercaseName)) return entry.code;
2738
+ }
2739
+ if (/\bnauto\b/.test(lowercaseName)) return CATFOG_NAUTOPHONE ?? null;
2740
+ return null;
2741
+ }
2534
2742
  function parseCode(val) {
2535
2743
  if (val == null) return null;
2536
2744
  let s = String(val).trim();
@@ -2642,14 +2850,7 @@ function decodeNavAidProps(layerName, props, coords) {
2642
2850
  const sigper = props.SIGPER != null ? Number(props.SIGPER) : null;
2643
2851
  const group = parseGroup(props.SIGGRP);
2644
2852
  const nameForFog = String(props.OBJNAM ?? "").toLowerCase();
2645
- let catfogCode = null;
2646
- if (/\bwhistle\b/.test(nameForFog)) catfogCode = 6;
2647
- else if (/\bgong\b/.test(nameForFog)) catfogCode = 8;
2648
- else if (/\bbell\b/.test(nameForFog)) catfogCode = 5;
2649
- else if (/\bhorn\b/.test(nameForFog)) catfogCode = 9;
2650
- else if (/\bsiren\b/.test(nameForFog)) catfogCode = 3;
2651
- else if (/diaphone/.test(nameForFog)) catfogCode = 2;
2652
- else if (/nautophone|nauto/.test(nameForFog)) catfogCode = 4;
2853
+ let catfogCode = catfogCodeFromName(nameForFog);
2653
2854
  if (!catfogCode) catfogCode = parseCode(props.CATFOG);
2654
2855
  const fogSignal2 = catfogCode ? CATFOG_TABLE[catfogCode] ?? null : null;
2655
2856
  const fogSignalAbbr = catfogCode ? CATFOG_ABBR_TABLE[catfogCode] ?? null : null;
@@ -5803,6 +6004,31 @@ var S52_LOOKUP = {
5803
6004
  viewingGroup: 27080,
5804
6005
  scamin: 22e3
5805
6006
  },
6007
+ RADRFL: {
6008
+ objectClass: "RADRFL",
6009
+ name: "Radar Reflector",
6010
+ category: "Navigation Aids",
6011
+ displayCategory: "OTHER",
6012
+ int1Ref: "S6",
6013
+ style: { type: "symbol", paint: {}, layout: { "icon-size": 0.6, "icon-allow-overlap": true }, iconImage: "RADRFL03" },
6014
+ viewingGroup: 27080,
6015
+ scamin: 22e3
6016
+ },
6017
+ // Retroreflecting material fitted to buoys/beacons. 7,506 features across 616
6018
+ // NOAA cells (docs/validation/s52-occurrence-snapshot.json) rendered nothing
6019
+ // until this entry existed. RETRFL02 is the simplified variant — RETRFL01 is
6020
+ // the paper-chart glyph, per the reference manifest descriptions.
6021
+ // int1Ref intentionally omitted: no INT-1 citation for retroreflectors could
6022
+ // be verified against an in-repo source, and the field is optional.
6023
+ RETRFL: {
6024
+ objectClass: "RETRFL",
6025
+ name: "Retroreflector",
6026
+ category: "Navigation Aids",
6027
+ displayCategory: "OTHER",
6028
+ style: { type: "symbol", paint: {}, layout: { "icon-size": 0.6, "icon-allow-overlap": true }, iconImage: "RETRFL02" },
6029
+ viewingGroup: 27080,
6030
+ scamin: 22e3
6031
+ },
5806
6032
  NAVLNE: {
5807
6033
  objectClass: "NAVLNE",
5808
6034
  name: "Navigation Line",
@@ -21347,6 +21573,8 @@ var SYMBOL_MAP = {
21347
21573
  FOGSIG: "FOGSIG01",
21348
21574
  RTPBCN: "RTPBCN02",
21349
21575
  RDOSTA: "RTPBCN02",
21576
+ RADRFL: "RADRFL03",
21577
+ RETRFL: "RETRFL02",
21350
21578
  // Nav aids
21351
21579
  DAYMAR: "DAYTRI01",
21352
21580
  PILPNT: "PILPNT02",
@@ -21800,31 +22028,28 @@ function getLookupEntry(layerName) {
21800
22028
  return S52_LOOKUP[layerName] ?? null;
21801
22029
  }
21802
22030
 
22031
+ // src/s57/match-expression.ts
22032
+ var pairsCache = /* @__PURE__ */ new Map();
22033
+ function codeLabelPairs(acronym, kind) {
22034
+ const key = `${acronym}:${kind}`;
22035
+ let pairs = pairsCache.get(key);
22036
+ if (pairs === void 0) {
22037
+ const table = kind === "abbr" ? s57AbbrTable(acronym) : s57NameTable(acronym);
22038
+ const flat = [];
22039
+ for (const code of Object.keys(table).map(Number).sort((a, b) => a - b)) {
22040
+ flat.push(code, table[code]);
22041
+ }
22042
+ pairs = flat;
22043
+ pairsCache.set(key, pairs);
22044
+ }
22045
+ return pairs;
22046
+ }
22047
+ function s57MatchExpression(acronym, kind, input, fallback = "") {
22048
+ return ["match", input, ...codeLabelPairs(acronym, kind), fallback];
22049
+ }
22050
+
21803
22051
  // src/atlas/labels.ts
21804
- var LITCHR_ABBR = {
21805
- 1: "F",
21806
- 2: "Fl",
21807
- 3: "LFl",
21808
- 4: "Oc",
21809
- 5: "Iso",
21810
- 6: "S.Fl",
21811
- 7: "S.LFl",
21812
- 8: "Al.Oc",
21813
- 9: "Al.LFl",
21814
- 10: "Al.Fl",
21815
- 11: "Al.Gp",
21816
- 12: "Mo",
21817
- 13: "Q",
21818
- 14: "VQ",
21819
- 15: "UQ",
21820
- 16: "Al",
21821
- 17: "Al.F.Fl",
21822
- 25: "Q+LFl",
21823
- 26: "VQ+LFl",
21824
- 27: "UQ+LFl",
21825
- 28: "Al",
21826
- 29: "F.LFl"
21827
- };
22052
+ var LITCHR_ABBR = s57AbbrTable("LITCHR");
21828
22053
  var COLOUR_ABBR = {
21829
22054
  1: "W",
21830
22055
  3: "R",
@@ -22613,27 +22838,11 @@ function getLabelConfig(layerName, opts = {}) {
22613
22838
  }
22614
22839
  };
22615
22840
  case "FOGSIG": {
22616
- const catfogExpr = [
22617
- "match",
22618
- ["to-number", ["coalesce", ["get", "CATFOG"], 0], 0],
22619
- 2,
22620
- "DIA",
22621
- 3,
22622
- "SIREN",
22623
- 4,
22624
- "NAUTO",
22625
- 5,
22626
- "BELL",
22627
- 6,
22628
- "WHIS",
22629
- 7,
22630
- "REED",
22631
- 8,
22632
- "GONG",
22633
- 9,
22634
- "HORN",
22635
- ""
22636
- ];
22841
+ const catfogExpr = s57MatchExpression(
22842
+ "CATFOG",
22843
+ "abbr",
22844
+ ["to-number", ["coalesce", ["get", "CATFOG"], 0], 0]
22845
+ );
22637
22846
  return {
22638
22847
  type: "symbol",
22639
22848
  textField: catfogExpr,
@@ -26189,33 +26398,11 @@ function buildNavAidLabelExpression() {
26189
26398
  ];
26190
26399
  }
26191
26400
  function buildLightLabelExpression() {
26192
- const litchrExpr = [
26193
- "match",
26194
- ["coalesce", ["get", "LITCHR"], 0],
26195
- 1,
26196
- "F",
26197
- 2,
26198
- "Fl",
26199
- 3,
26200
- "LFl",
26201
- 4,
26202
- "Oc",
26203
- 5,
26204
- "Iso",
26205
- 6,
26206
- "S.Fl",
26207
- 7,
26208
- "S.LFl",
26209
- 12,
26210
- "Mo",
26211
- 13,
26212
- "Q",
26213
- 14,
26214
- "VQ",
26215
- 15,
26216
- "UQ",
26217
- ""
26218
- ];
26401
+ const litchrExpr = s57MatchExpression(
26402
+ "LITCHR",
26403
+ "abbr",
26404
+ ["coalesce", ["get", "LITCHR"], 0]
26405
+ );
26219
26406
  const colourExpr = colourCodeCase(
26220
26407
  [
26221
26408
  ["3", " R"],
@@ -27363,6 +27550,20 @@ var CHART_CASCADE_CODES = {
27363
27550
  Approach: ["1", "2", "3", "4"],
27364
27551
  Harbor: ["1", "2", "3", "4", "5", "6"]
27365
27552
  };
27553
+ var CHRT_STYLE_MODES = [
27554
+ "continuous",
27555
+ ...Object.keys(CHART_BAND_CODES).map(
27556
+ (band) => `chart:${band}`
27557
+ )
27558
+ ];
27559
+ function normalizeStyleMode(raw) {
27560
+ if (raw === null || raw === void 0 || raw === "") return "continuous";
27561
+ const lower = raw.toLowerCase();
27562
+ return CHRT_STYLE_MODES.find((mode) => mode.toLowerCase() === lower) ?? null;
27563
+ }
27564
+ function styleModeBand(mode) {
27565
+ return mode === "continuous" ? null : mode.slice("chart:".length);
27566
+ }
27366
27567
  function bandFilterExpression(codes) {
27367
27568
  const list = Array.isArray(codes) ? codes : [codes];
27368
27569
  if (list.length === 1) {
@@ -28692,6 +28893,7 @@ var Chrt = class {
28692
28893
  CHRT_ICON_EXPRESSIONS,
28693
28894
  CHRT_ICON_PREFIX,
28694
28895
  CHRT_SDF_GLYPHS,
28896
+ CHRT_STYLE_MODES,
28695
28897
  Chrt,
28696
28898
  ChrtError,
28697
28899
  DEFAULT_CLICK_TOLERANCE,
@@ -28821,6 +29023,7 @@ var Chrt = class {
28821
29023
  lightColor,
28822
29024
  lightFillExpression,
28823
29025
  lightsIconExpression,
29026
+ normalizeStyleMode,
28824
29027
  normalizeTheme,
28825
29028
  paginate,
28826
29029
  parseListCodes,
@@ -28841,6 +29044,7 @@ var Chrt = class {
28841
29044
  sanitizeCustomStyleConfig,
28842
29045
  scaleSizeValue,
28843
29046
  scaminToMinZoom,
29047
+ styleModeBand,
28844
29048
  withinBboxFilter,
28845
29049
  worldMinusBboxPolygon
28846
29050
  });