@atmosx/event-product-parser 3.0.51 → 3.0.53

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 (140) hide show
  1. package/{CODE_OF_CONDUCT.md → .github/CODE_OF_CONDUCT.md} +9 -9
  2. package/{CONTRIBUTING.md → .github/CONTRIBUTING.md} +29 -29
  3. package/{LICENSE → .github/LICENSE} +17 -17
  4. package/{README.md → .github/README.md} +466 -444
  5. package/{SECURITY.md → .github/SECURITY.md} +20 -20
  6. package/{SUPPORTED_EVENTS.md → .github/SUPPORTED_EVENTS.md} +369 -368
  7. package/.vscode/settings.json +3 -3
  8. package/dist/cjs/index.cjs +243 -213
  9. package/dist/esm/index.mjs +242 -212
  10. package/package.json +52 -52
  11. package/src/@building/building.attachments.ts +82 -82
  12. package/src/@building/building.clean.ts +29 -29
  13. package/src/@building/building.create.ts +55 -55
  14. package/src/@building/building.enhance.ts +59 -59
  15. package/src/@building/building.geometry.ts +47 -47
  16. package/src/@building/building.headers.ts +36 -36
  17. package/src/@building/building.office.ts +42 -42
  18. package/src/@building/building.polygon.ts +69 -69
  19. package/src/@building/building.properties.ts +95 -95
  20. package/src/@building/building.signature.ts +60 -60
  21. package/src/@building/building.tags.ts +23 -23
  22. package/src/@building/building.tracking.ts +67 -67
  23. package/src/@building/building.validate.ts +152 -151
  24. package/src/@core/core.clearEvents.ts +30 -30
  25. package/src/@core/core.createListener.ts +23 -23
  26. package/src/@core/core.getEvents.ts +23 -23
  27. package/src/@core/core.getNodes.ts +23 -23
  28. package/src/@core/core.getRandomEvent.ts +23 -23
  29. package/src/@core/core.getVersion.ts +23 -23
  30. package/src/@core/core.manualEvent.ts +38 -0
  31. package/src/@core/core.query.ts +38 -38
  32. package/src/@core/core.setNode.ts +80 -80
  33. package/src/@core/core.start.ts +60 -60
  34. package/src/@core/core.stop.ts +31 -31
  35. package/src/@dictionaries/dictionaries.actions.ts +27 -27
  36. package/src/@dictionaries/dictionaries.awips.ts +363 -363
  37. package/src/@dictionaries/dictionaries.cancellation.ts +30 -30
  38. package/src/@dictionaries/dictionaries.causes.ts +35 -35
  39. package/src/@dictionaries/dictionaries.correlations.ts +42 -42
  40. package/src/@dictionaries/dictionaries.enhanced.ts +66 -109
  41. package/src/@dictionaries/dictionaries.events.ts +82 -82
  42. package/src/@dictionaries/dictionaries.expressions.ts +28 -28
  43. package/src/@dictionaries/dictionaries.global.ts +24 -0
  44. package/src/@dictionaries/dictionaries.hail.ts +35 -35
  45. package/src/@dictionaries/dictionaries.icao.ts +258 -258
  46. package/src/@dictionaries/dictionaries.matches.ts +54 -35
  47. package/src/@dictionaries/dictionaries.products.ts +24 -24
  48. package/src/@dictionaries/dictionaries.records.ts +25 -25
  49. package/src/@dictionaries/dictionaries.severity.ts +27 -27
  50. package/src/@dictionaries/dictionaries.shapefiles.ts +35 -35
  51. package/src/@dictionaries/dictionaries.states.ts +71 -71
  52. package/src/@dictionaries/dictionaries.status.ts +30 -30
  53. package/src/@dictionaries/dictionaries.tags.ts +92 -92
  54. package/src/@dictionaries/dictionaries.testing.ts +24 -24
  55. package/src/@events/events.api.ts +116 -116
  56. package/src/@events/events.text.ts +84 -80
  57. package/src/@events/events.ugc.ts +89 -85
  58. package/src/@events/events.vtec.ts +86 -86
  59. package/src/@manager/manager.mkEvent.ts +97 -93
  60. package/src/@manager/manager.rmEvent.ts +56 -51
  61. package/src/@manager/manager.setHash.ts +35 -35
  62. package/src/@manager/manager.updateEvents.ts +32 -32
  63. package/src/@manager/manager.updateListener.ts +179 -154
  64. package/src/@manager/manager.updateNodes.ts +53 -53
  65. package/src/@modules/@database/database.broadcastify.ts +66 -66
  66. package/src/@modules/@database/database.cache.ts +49 -49
  67. package/src/@modules/@database/database.init.ts +58 -58
  68. package/src/@modules/@database/database.shapefiles.ts +92 -92
  69. package/src/@modules/@database/database.stanza.ts +46 -46
  70. package/src/@modules/@eas/eas.getCleanDescription.ts +91 -91
  71. package/src/@modules/@eas/eas.getFloatPCM16.ts +29 -29
  72. package/src/@modules/@eas/eas.getMergedPCM16.ts +32 -32
  73. package/src/@modules/@eas/eas.getPCM16.ts +52 -52
  74. package/src/@modules/@eas/eas.getPCMToFloat.ts +26 -26
  75. package/src/@modules/@eas/eas.getSampledPCM16.ts +36 -36
  76. package/src/@modules/@eas/eas.getTTS.ts +54 -54
  77. package/src/@modules/@eas/eas.getWavPCM16.ts +52 -52
  78. package/src/@modules/@eas/eas.setAFSK.ts +51 -51
  79. package/src/@modules/@eas/eas.setAsciiToBits.ts +31 -31
  80. package/src/@modules/@eas/eas.setAttentionTone.ts +40 -40
  81. package/src/@modules/@eas/eas.setEasTone.ts +151 -151
  82. package/src/@modules/@eas/eas.setNoise.ts +32 -32
  83. package/src/@modules/@eas/eas.setRadioEffect.ts +50 -50
  84. package/src/@modules/@eas/eas.setSameHeader.ts +44 -44
  85. package/src/@modules/@stanza/stanza.getAwipsType.ts +45 -45
  86. package/src/@modules/@stanza/stanza.validate.ts +49 -49
  87. package/src/@modules/@utilities/utilities.createHttp.ts +83 -70
  88. package/src/@modules/@utilities/utilities.getFormattedTime.ts +43 -43
  89. package/src/@modules/@utilities/utilities.getLatestIssuance.ts +32 -32
  90. package/src/@modules/@utilities/utilities.getMatched.ts +33 -33
  91. package/src/@modules/@utilities/utilities.getSettings.ts +25 -25
  92. package/src/@modules/@utilities/utilities.getShapeNearestPoint.ts +114 -114
  93. package/src/@modules/@utilities/utilities.setCronSchedule.ts +94 -94
  94. package/src/@modules/@utilities/utilities.setDebug.ts +38 -38
  95. package/src/@modules/@utilities/utilities.setEventEmit.ts +41 -41
  96. package/src/@modules/@utilities/utilities.setListener.ts +30 -30
  97. package/src/@modules/@utilities/utilities.setSettings.ts +42 -42
  98. package/src/@modules/@utilities/utilities.setSleep.ts +33 -33
  99. package/src/@modules/@utilities/utilities.setTimeoutAction.ts +62 -62
  100. package/src/@modules/@utilities/utilities.setWarning.ts +34 -34
  101. package/src/@modules/@xmpp/xmpp.xDeploy.ts +57 -57
  102. package/src/@modules/@xmpp/xmpp.xError.ts +26 -26
  103. package/src/@modules/@xmpp/xmpp.xOffline.ts +36 -36
  104. package/src/@modules/@xmpp/xmpp.xOnline.ts +45 -44
  105. package/src/@modules/@xmpp/xmpp.xReconnect.ts +64 -64
  106. package/src/@modules/@xmpp/xmpp.xStanza.ts +62 -62
  107. package/src/@parsers/@hvtec/hvtec.extract.ts +39 -39
  108. package/src/@parsers/@pvtec/pvtec.expires.ts +25 -25
  109. package/src/@parsers/@pvtec/pvtec.extract.ts +48 -48
  110. package/src/@parsers/@text/text.getDescriptionFromProduct.ts +52 -52
  111. package/src/@parsers/@text/text.getEmbed.ts +55 -55
  112. package/src/@parsers/@text/text.getPolygonFromProduct.ts +53 -32
  113. package/src/@parsers/@text/text.getRaw.ts +54 -0
  114. package/src/@parsers/@text/text.getTextFromProduct.ts +42 -42
  115. package/src/@parsers/@text/text.getXML.ts +60 -60
  116. package/src/@parsers/@ugc/ugc.coordinates.ts +110 -110
  117. package/src/@parsers/@ugc/ugc.expiry.ts +31 -31
  118. package/src/@parsers/@ugc/ugc.extract.ts +36 -36
  119. package/src/@parsers/@ugc/ugc.getCache.ts +23 -23
  120. package/src/@parsers/@ugc/ugc.header.ts +29 -29
  121. package/src/@parsers/@ugc/ugc.locations.ts +56 -56
  122. package/src/@parsers/@ugc/ugc.setCache.ts +27 -27
  123. package/src/@parsers/@ugc/ugc.zones.ts +51 -51
  124. package/src/@types/type.attributes.ts +28 -28
  125. package/src/@types/type.compiled.ts +34 -34
  126. package/src/@types/type.event.ts +69 -69
  127. package/src/@types/type.hash.ts +24 -24
  128. package/src/@types/type.hvtec.ts +25 -25
  129. package/src/@types/type.listener.ts +37 -32
  130. package/src/@types/type.properties.ts +77 -77
  131. package/src/@types/type.pvtec.ts +30 -30
  132. package/src/@types/type.settings.ts +93 -84
  133. package/src/@types/type.stanza.ts +37 -37
  134. package/src/@types/type.ugc.ts +24 -24
  135. package/src/bootstrap.ts +124 -115
  136. package/src/index.ts +74 -74
  137. package/{test.js → testing/init.js} +105 -92
  138. package/tsconfig.json +13 -13
  139. package/tsup.config.ts +15 -15
  140. package/src/@core/core.createEvent.ts +0 -82
@@ -1104,13 +1104,13 @@ var index_exports = {};
1104
1104
  __export(index_exports, {
1105
1105
  Manager: () => Manager,
1106
1106
  clearEvents: () => clearEvents,
1107
- createEvent: () => createEvent2,
1108
1107
  default: () => index_default,
1109
1108
  getCleanedEvent: () => getCleanedEvent,
1110
1109
  getEventGeometry: () => getEventGeometry,
1111
1110
  getEvents: () => getEvents,
1112
1111
  getNodes: () => getNodes,
1113
1112
  getRandomEvent: () => getRandomEvent,
1113
+ manualEvent: () => manualEvent,
1114
1114
  query: () => query,
1115
1115
  setEasTone: () => setEasTone,
1116
1116
  setNode: () => setNode,
@@ -1124,7 +1124,7 @@ module.exports = __toCommonJS(index_exports);
1124
1124
  var import_path = __toESM(require("path"));
1125
1125
  var import_node_events = require("events");
1126
1126
  var bootstrap = {
1127
- version: `3.0.51`,
1127
+ version: `3.0.53`,
1128
1128
  isReady: true,
1129
1129
  ratelimits: {},
1130
1130
  session_xmpp: null,
@@ -1155,7 +1155,7 @@ var bootstrap = {
1155
1155
  },
1156
1156
  settings: {
1157
1157
  Database: import_path.default.join(process.cwd(), "shapefiles.db"),
1158
- EnableWireService: true,
1158
+ EnableWireService: false,
1159
1159
  EnableDebugging: false,
1160
1160
  EnableJournal: true,
1161
1161
  NOAAWeatherWireServiceSettings: {
@@ -1188,12 +1188,21 @@ var bootstrap = {
1188
1188
  BroadcastifyDatabase: `https://scriptkitty.cafe/ftp/@atmosphericx/assets/broadcastify.json`,
1189
1189
  BroadcastifyTags: [`Ham`, `Air`, `Fire`, `Public Safety`, `Weather`, `EMS`, `Police`, `Rail`]
1190
1190
  },
1191
+ NotifyServer: {
1192
+ Enabled: false,
1193
+ Server: `https://ntfy.sh`,
1194
+ Attachments: null,
1195
+ Credentials: {
1196
+ Username: null,
1197
+ Password: null
1198
+ }
1199
+ },
1191
1200
  ListenerSettings: [],
1192
1201
  GlobalSettings: {
1193
1202
  EventManagement: true,
1194
1203
  BetterEventNames: true,
1195
1204
  DisableGeometryParsing: false,
1196
- UseShapefileCoordinates: false,
1205
+ UseShapefileCoordinates: true,
1197
1206
  SPCWatchesOnly: true,
1198
1207
  ShapefileSkipPoints: 15,
1199
1208
  NodeTTL: 60,
@@ -1325,7 +1334,7 @@ var getZonePolygon = (options) => {
1325
1334
  };
1326
1335
 
1327
1336
  // src/@building/building.geometry.ts
1328
- var getEventGeometry = (event) => __async(null, null, function* () {
1337
+ var getEventGeometry = (event) => {
1329
1338
  var _a, _b, _c, _d, _e, _f;
1330
1339
  const settings = getSettings();
1331
1340
  const generated = (_c = (_b = (_a = event == null ? void 0 : event.properties) == null ? void 0 : _a.geocode) == null ? void 0 : _b.polygon) != null ? _c : null;
@@ -1335,7 +1344,7 @@ var getEventGeometry = (event) => __async(null, null, function* () {
1335
1344
  coordinates: generated != null ? JSON.parse(Buffer.from(generated, "base64").toString("utf-8")) : null
1336
1345
  };
1337
1346
  if (settings.GlobalSettings.UseShapefileCoordinates && generated == null && ugc2 != null) {
1338
- geo = yield getZonePolygon({ zones: ugc2, isUnion: false });
1347
+ geo = getZonePolygon({ zones: ugc2, isUnion: false });
1339
1348
  if (geo == null) {
1340
1349
  geo = {
1341
1350
  type: `Polygon`,
@@ -1344,7 +1353,7 @@ var getEventGeometry = (event) => __async(null, null, function* () {
1344
1353
  }
1345
1354
  }
1346
1355
  return geo;
1347
- });
1356
+ };
1348
1357
 
1349
1358
  // src/@building/building.clean.ts
1350
1359
  var getCleanedEvent = (event) => {
@@ -4200,7 +4209,8 @@ var xOnline = () => {
4200
4209
  data: {},
4201
4210
  type: `online`,
4202
4211
  error: false
4203
- }
4212
+ },
4213
+ message: `Succesfully connected to NOAA Weather Wire Service as "${nickname}"`
4204
4214
  });
4205
4215
  }));
4206
4216
  };
@@ -4522,9 +4532,9 @@ var dict_awips = {
4522
4532
  SVR: `severe-thunderstorm-warning`,
4523
4533
  SVS: `severe-weather-statement`,
4524
4534
  SWOMCD: `mesoscale-discussion`,
4525
- SWODY1: `spc-day-1-outlook`,
4526
- SWODY2: `spc-day-2-outlook`,
4527
- SWODY3: `spc-day-3-outlook`,
4535
+ SWODY1: `storm-prediction-center-day-1-outlook`,
4536
+ SWODY2: `storm-prediction-center-day-2-outlook`,
4537
+ SWODY3: `storm-prediction-center-day-3-outlook`,
4528
4538
  SWS: `state-weather-summary`,
4529
4539
  SYN: `regional-weather-synopsis`,
4530
4540
  TAF: `terminal-aerodrome-forecast`,
@@ -4544,7 +4554,7 @@ var dict_awips = {
4544
4554
  TOE: `telephone-outage-emergency`,
4545
4555
  TOR: `tornado-warning`,
4546
4556
  TPT: `temperature-precipitation-table`,
4547
- TSU: `tsunami-watch`,
4557
+ TSU: `tsunami-information-statement`,
4548
4558
  TUV: `ultraviolet-index`,
4549
4559
  TVL: `travelers-forecast`,
4550
4560
  TWB: `transcribed-weather-broadcast`,
@@ -4640,21 +4650,39 @@ var validate = (options) => {
4640
4650
 
4641
4651
  // src/@dictionaries/dictionaries.matches.ts
4642
4652
  var dict_matches = {
4643
- "Special Weather Statement": "Special Weather Statement",
4644
- "Hurricane Warning": "Hurricane Warning",
4645
- "Hurricane Force Wind Warning": "Hurricane Force Wind Warning",
4646
- "Hurricane Watch": "Hurricane Watch",
4647
- "Tropical Storm Warning": "Tropical Storm Warning",
4648
- "Tropical Storm Watch": "Tropical Storm Watch",
4649
- "High Wind Warning": "High Wind Warning",
4650
- "Gale Warning": "Gale Warning",
4651
- "Small Craft Advisory": "Small Craft Advisory",
4652
- "Small Craft Warning": "Small Craft Warning",
4653
- "Tsunami Warning": "Tsunami Warning",
4654
- "Tsunami Watch": "Tsunami Watch",
4655
- "Tsunami Advisory": "Tsunami Advisory",
4656
- "Tsunami Information Statement": "Tsunami Information Statement",
4657
- "Subscribers:": "National Weather Service Policy"
4653
+ SPS: [
4654
+ { match: /STRONG THUNDERSTORM/i, label: "Convective Special Weather Statement", statement: false },
4655
+ { match: /SPECIAL WEATHER STATEMENT/i, label: "Special Weather Statement", statement: false }
4656
+ ],
4657
+ TSU: [
4658
+ { match: /TSUNAMI WARNING/i, label: "Tsunami Warning", statement: false },
4659
+ { match: /TSUNAMI WATCH/i, label: "Tsunami Watch", statement: false },
4660
+ { match: /TSUNAMI ADVISORY/i, label: "Tsunami Advisory", statement: false },
4661
+ { match: /TSUNAMI INFORMATION STATEMENT/i, label: "Tsunami Information Statement", statement: false },
4662
+ { match: /TSUNAMI WARNING CANCELLATION/i, label: "Tsunami Cancellation", statement: false }
4663
+ ],
4664
+ TCP: [
4665
+ { match: /HURRICANE WARNING/i, label: "Hurricane Warning", statement: false },
4666
+ { match: /HURRICANE WATCH/i, label: "Hurricane Watch", statement: false },
4667
+ { match: /TROPICAL STORM WARNING/i, label: "Tropical Storm Warning", statement: false },
4668
+ { match: /TROPICAL STORM WATCH/i, label: "Tropical Storm Watch", statement: false },
4669
+ { match: /STORM SURGE WARNING/i, label: "Storm Surge Warning", statement: false },
4670
+ { match: /STORM SURGE WATCH/i, label: "Storm Surge Watch", statement: false }
4671
+ ],
4672
+ MWW: [
4673
+ { match: /SMALL CRAFT ADVISORY/i, label: "Small Craft Advisory", statement: false },
4674
+ { match: /GALE WARNING/i, label: "Gale Warning", statement: false },
4675
+ { match: /STORM WARNING/i, label: "Storm Warning", statement: false },
4676
+ { match: /HURRICANE FORCE WIND WARNING/i, label: "Hurricane Force Wind Warning", statement: false },
4677
+ { match: /HAZARDOUS SEAS WARNING/i, label: "Hazardous Seas Warning", statement: false },
4678
+ { match: /DENSE FOG ADVISORY/i, label: "Dense Fog Advisory", statement: false },
4679
+ { match: /THUNDERSTORMS/i, label: "Convective Marine Weather Statement", statement: false },
4680
+ { match: /MARINE WEATHER STATEMENT/i, label: "Marine Weather Statement", statement: false }
4681
+ ],
4682
+ PNS: [
4683
+ { match: /NOAA WEATHER WIRE SERVICE/i, label: "NOAA Weather Wire Service Report", statement: true },
4684
+ { match: /Public Information Statement/i, label: "Public Information Statement", statement: true }
4685
+ ]
4658
4686
  };
4659
4687
 
4660
4688
  // src/@parsers/@text/text.getDescriptionFromProduct.ts
@@ -4689,18 +4717,32 @@ var getDescriptionFromProduct = (options) => {
4689
4717
  // src/@parsers/@text/text.getPolygonFromProduct.ts
4690
4718
  var getPolygonFromProduct = (message) => {
4691
4719
  const coordinates = [];
4692
- const match = message.match(/LAT\.{3}LON\s+([\d\s]+)/i);
4693
- if (!match || !match[1]) return coordinates;
4694
- const coordStrings = match[1].replace(/\n/g, " ").trim().split(/\s+/);
4695
- for (let i = 0; i < coordStrings.length - 1; i += 2) {
4696
- const lat = parseFloat(coordStrings[i]) / 100;
4697
- const lon = -parseFloat(coordStrings[i + 1]) / 100;
4698
- if (!isNaN(lat) && !isNaN(lon)) {
4699
- coordinates.push([lon, lat]);
4720
+ const match = message.match(
4721
+ /LAT\.\.\.LON\s+([\s\S]*?)(?=\n[A-Z]{2,}(?:\.\.\.|:)|\$\$|&&|$)/i
4722
+ );
4723
+ if (!match) return coordinates;
4724
+ const text2 = match[1];
4725
+ const values = text2.match(/\d{4,8}/g);
4726
+ if (!values) return coordinates;
4727
+ if (values.every((v) => v.length === 8)) {
4728
+ for (const value of values) {
4729
+ const lat = parseInt(value.slice(0, 4), 10) / 100;
4730
+ const lon = -parseInt(value.slice(4, 8), 10) / 100;
4731
+ if (Number.isFinite(lat) && Number.isFinite(lon)) {
4732
+ coordinates.push([lon, lat]);
4733
+ }
4734
+ }
4735
+ } else {
4736
+ for (let i = 0; i + 1 < values.length; i += 2) {
4737
+ const lat = parseInt(values[i], 10) / 100;
4738
+ const lon = -parseInt(values[i + 1], 10) / 100;
4739
+ if (Number.isFinite(lat) && Number.isFinite(lon)) {
4740
+ coordinates.push([lon, lat]);
4741
+ }
4700
4742
  }
4701
4743
  }
4702
4744
  if (coordinates.length > 2) {
4703
- coordinates.push(coordinates[0]);
4745
+ coordinates.push([...coordinates[0]]);
4704
4746
  }
4705
4747
  return coordinates;
4706
4748
  };
@@ -5176,7 +5218,7 @@ var setDebug = (options) => {
5176
5218
 
5177
5219
  // src/@events/events.text.ts
5178
5220
  var text = (stanza) => __async(null, null, function* () {
5179
- var _a, _b, _c;
5221
+ var _a, _b, _c, _d, _e;
5180
5222
  const getMessages = (_c = (_b = (_a = stanza == null ? void 0 : stanza.message) == null ? void 0 : _a.split(/(?=\$\$)/g)) == null ? void 0 : _b.map((message) => message.trim())) == null ? void 0 : _c.filter((message) => message && message !== "$$");
5181
5223
  if (!getMessages || (getMessages == null ? void 0 : getMessages.length) == 0) return;
5182
5224
  for (const message of getMessages) {
@@ -5186,8 +5228,9 @@ var text = (stanza) => __async(null, null, function* () {
5186
5228
  const header = getEventHeader({ properties: props, getType: stanza.getType });
5187
5229
  const issued = new Date(attributes.issue);
5188
5230
  const expires = new Date(issued.getTime() + 12 * 60 * 60 * 1e3);
5189
- let event = Object.keys(dict_matches).find((event2) => message.toLowerCase().includes(event2.toLowerCase()));
5190
- let isStatement = false;
5231
+ const matches = (_d = dict_matches[stanza.getType.prefix]) == null ? void 0 : _d.find((match) => match.match.test(message.toUpperCase()));
5232
+ let event = matches == null ? void 0 : matches.label;
5233
+ let isStatement = (_e = matches == null ? void 0 : matches.statement) != null ? _e : false;
5191
5234
  if (!event) {
5192
5235
  event = stanza.getType.type.split(`-`).map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase()).join(` `);
5193
5236
  isStatement = true;
@@ -5345,7 +5388,7 @@ var ugcExtract = (message) => __async(null, null, function* () {
5345
5388
 
5346
5389
  // src/@events/events.ugc.ts
5347
5390
  var ugc = (stanza) => __async(null, null, function* () {
5348
- var _a, _b, _c;
5391
+ var _a, _b, _c, _d, _e;
5349
5392
  const getMessages = (_c = (_b = (_a = stanza == null ? void 0 : stanza.message) == null ? void 0 : _a.split(/(?=\$\$)/g)) == null ? void 0 : _b.map((message) => message.trim())) == null ? void 0 : _c.filter((message) => message && message !== "$$");
5350
5393
  if (!getMessages || (getMessages == null ? void 0 : getMessages.length) == 0) return;
5351
5394
  for (const message of getMessages) {
@@ -5357,8 +5400,9 @@ var ugc = (stanza) => __async(null, null, function* () {
5357
5400
  const issued = new Date(attributes.issue);
5358
5401
  const expires = new Date(ugc2.expires);
5359
5402
  const header = getEventHeader({ properties: props, getType: stanza.getType });
5360
- let event = Object.keys(dict_matches).find((event2) => message.toLowerCase().includes(event2.toLowerCase()));
5361
- let isStatement = false;
5403
+ const matches = (_d = dict_matches[stanza.getType.prefix]) == null ? void 0 : _d.find((match) => match.match.test(message.toUpperCase()));
5404
+ let event = matches == null ? void 0 : matches.label;
5405
+ let isStatement = (_e = matches == null ? void 0 : matches.statement) != null ? _e : false;
5362
5406
  if (!event) {
5363
5407
  event = stanza.getType.type.split(`-`).map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase()).join(` `);
5364
5408
  isStatement = true;
@@ -5735,85 +5779,42 @@ var api = (stanza) => __async(null, null, function* () {
5735
5779
  // src/@dictionaries/dictionaries.enhanced.ts
5736
5780
  var dict_enhanced = {
5737
5781
  "Tornado Warning": {
5738
- "Tornado Emergency": {
5739
- description: "tornado emergency"
5740
- },
5741
- "PDS Tornado Warning": {
5742
- description: "particularly dangerous situation",
5743
- damage: `CONSIDERABLE`
5744
- },
5745
- "Radar Confirmed Tornado Warning": {
5746
- description: "source...radar confirmed tornado.",
5747
- tornado: `OBSERVED`
5748
- },
5749
- "Confirmed Tornado Warning": {
5750
- tornado: `OBSERVED`
5751
- },
5782
+ "Tornado Emergency": { description: "tornado emergency" },
5783
+ "PDS Tornado Warning": { description: "particularly dangerous situation", damage: `CONSIDERABLE` },
5784
+ "Radar Confirmed Tornado Warning": { description: "source...radar confirmed tornado.", tornado: `OBSERVED` },
5785
+ "Confirmed Tornado Warning": { tornado: `OBSERVED` },
5752
5786
  "Radar Indicated Tornado Warning": {}
5753
5787
  },
5754
5788
  "Fire Weather Warning": {
5755
- "PDS Fire Weather Warning": {
5756
- description: "particularly dangerous situation"
5757
- }
5789
+ "PDS Fire Weather Warning": { description: "particularly dangerous situation" }
5758
5790
  },
5759
5791
  "Blizzard Warning": {
5760
- "PDS Blizzard Warning": {
5761
- description: "particularly dangerous situation"
5762
- }
5792
+ "PDS Blizzard Warning": { description: "particularly dangerous situation" }
5763
5793
  },
5764
5794
  "Ice Storm Warning": {
5765
- "PDS Ice Storm Warning": {
5766
- description: "particularly dangerous situation"
5767
- }
5795
+ "PDS Ice Storm Warning": { description: "particularly dangerous situation" }
5768
5796
  },
5769
5797
  "Special Marine Warning": {
5770
- "Special Marine Warning (TPROB)": {
5771
- tornado: `POSSIBLE`
5772
- }
5798
+ "Special Marine Warning (TPROB)": { tornado: `POSSIBLE` }
5773
5799
  },
5774
5800
  "Tornado Watch": {
5775
- "PDS Tornado Watch": {
5776
- pdswatch: true
5777
- }
5801
+ "PDS Tornado Watch": { pdswatch: true }
5778
5802
  },
5779
5803
  "Severe Thunderstorm Watch": {
5780
- "PDS Severe Thunderstorm Watch": {
5781
- pdswatch: true
5782
- }
5804
+ "PDS Severe Thunderstorm Watch": { pdswatch: true }
5783
5805
  },
5784
5806
  "Flash Flood Warning": {
5785
- "Flash Flood Emergency": {
5786
- description: "flash flood emergency"
5787
- },
5788
- "Considerable Flash Flood Warning": {
5789
- damage: `CONSIDERABLE`
5790
- }
5807
+ "Flash Flood Emergency": { description: "flash flood emergency" },
5808
+ "Considerable Flash Flood Warning": { damage: `CONSIDERABLE` }
5791
5809
  },
5792
5810
  "Severe Thunderstorm Warning": {
5793
- "EDS Severe Thunderstorm Warning (TPROB)": {
5794
- description: "extremely dangerous situation",
5795
- tornado: "POSSIBLE"
5796
- },
5797
- "EDS Severe Thunderstorm Warning": {
5798
- description: "extremely dangerous situation"
5799
- },
5800
- "Destructive Severe Thunderstorm Warning (TPROB)": {
5801
- damage: `DESTRUCTIVE`,
5802
- tornado: `POSSIBLE`
5803
- },
5804
- "Destructive Severe Thunderstorm Warning": {
5805
- damage: `DESTRUCTIVE`
5806
- },
5807
- "Considerable Severe Thunderstorm Warning (TPROB)": {
5808
- damage: `CONSIDERABLE`,
5809
- tornado: `POSSIBLE`
5810
- },
5811
- "Considerable Severe Thunderstorm Warning": {
5812
- damage: `CONSIDERABLE`
5813
- },
5814
- "Severe Thunderstorm Warning (TPROB)": {
5815
- tornado: `POSSIBLE`
5816
- }
5811
+ "EDS Severe Thunderstorm Warning (TPROB)": { description: "extremely dangerous situation", tornado: "POSSIBLE" },
5812
+ "EDS Severe Thunderstorm Warning": { description: "extremely dangerous situation" },
5813
+ "Destructive Severe Thunderstorm Warning (TPROB)": { damage: `DESTRUCTIVE`, tornado: `POSSIBLE` },
5814
+ "Destructive Severe Thunderstorm Warning": { damage: `DESTRUCTIVE` },
5815
+ "Considerable Severe Thunderstorm Warning (TPROB)": { damage: `CONSIDERABLE`, tornado: `POSSIBLE` },
5816
+ "Considerable Severe Thunderstorm Warning": { damage: `CONSIDERABLE` },
5817
+ "Severe Thunderstorm Warning (TPROB)": { tornado: `POSSIBLE` }
5817
5818
  }
5818
5819
  };
5819
5820
 
@@ -5944,6 +5945,13 @@ var getEventSignature = (event) => {
5944
5945
  return event;
5945
5946
  };
5946
5947
 
5948
+ // src/@dictionaries/dictionaries.global.ts
5949
+ var dict_global = [
5950
+ "spc day 1 outlook",
5951
+ "spc day 2 outlook",
5952
+ "spc day 3 outlook"
5953
+ ];
5954
+
5947
5955
  // src/@manager/manager.setHash.ts
5948
5956
  var setHash = (event, entry) => {
5949
5957
  if (entry) {
@@ -6454,6 +6462,42 @@ var getEmebed = (event) => {
6454
6462
  ].filter(Boolean).join("\n");
6455
6463
  };
6456
6464
 
6465
+ // src/@parsers/@text/text.getRaw.ts
6466
+ var getRaw = (event) => {
6467
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S, _T, _U, _V, _W, _X, _Y, _Z, __, _$, _aa, _ba, _ca, _da, _ea, _fa, _ga, _ha, _ia, _ja, _ka, _la, _ma, _na, _oa, _pa, _qa, _ra, _sa, _ta, _ua, _va, _wa, _xa, _ya, _za, _Aa, _Ba, _Ca, _Da;
6468
+ const line = (label, value, condition = true) => condition && value ? `${label} ${value}` : null;
6469
+ const isStatement = event.properties.status_metadata.is_statement;
6470
+ const isExpired = event.properties.status_metadata.is_expired;
6471
+ return [
6472
+ line(`Locations:`, (_b = (_a = event == null ? void 0 : event.properties) == null ? void 0 : _a.locations) == null ? void 0 : _b.slice(0, 100)),
6473
+ line(`Issued:`, new Date(event.properties.issued).toUTCString(), !isExpired),
6474
+ line(`Expires:`, new Date(event.properties.expires).toUTCString(), !isStatement),
6475
+ line(`Damage Threat:`, (_d = (_c = event == null ? void 0 : event.properties) == null ? void 0 : _c.parameters) == null ? void 0 : _d.damage_threat, !isExpired),
6476
+ line(`Flood Threat:`, (_f = (_e = event == null ? void 0 : event.properties) == null ? void 0 : _e.parameters) == null ? void 0 : _f.flood_threat, !isExpired),
6477
+ line(`Tornado Threat:`, (_h = (_g = event == null ? void 0 : event.properties) == null ? void 0 : _g.parameters) == null ? void 0 : _h.tornado_threat, !isExpired),
6478
+ line(`Estimated Wind Gusts:`, `${(_j = (_i = event == null ? void 0 : event.properties) == null ? void 0 : _i.parameters) == null ? void 0 : _j.estimated_wind_gusts} ${((_l = (_k = event == null ? void 0 : event.properties) == null ? void 0 : _k.parameters) == null ? void 0 : _l.wind_threat) ? ` (${(_n = (_m = event == null ? void 0 : event.properties) == null ? void 0 : _m.parameters) == null ? void 0 : _n.wind_threat})` : ""}`, !isExpired && ((_p = (_o = event == null ? void 0 : event.properties) == null ? void 0 : _o.parameters) == null ? void 0 : _p.estimated_wind_gusts) != null),
6479
+ line(`Estimated Hail Size:`, `${(_r = (_q = event == null ? void 0 : event.properties) == null ? void 0 : _q.parameters) == null ? void 0 : _r.estimated_hail_size} ${((_t = (_s = event == null ? void 0 : event.properties) == null ? void 0 : _s.parameters) == null ? void 0 : _t.hail_threat) ? ` (${(_v = (_u = event == null ? void 0 : event.properties) == null ? void 0 : _u.parameters) == null ? void 0 : _v.hail_threat})` : ""}`, !isExpired && ((_x = (_w = event == null ? void 0 : event.properties) == null ? void 0 : _w.parameters) == null ? void 0 : _x.estimated_hail_size) != null),
6480
+ line(`Discussion:`, (_z = (_y = event == null ? void 0 : event.properties) == null ? void 0 : _y.discussion_parameters) == null ? void 0 : _z.discussion_number, !isExpired),
6481
+ line(`Concern:`, (_B = (_A = event == null ? void 0 : event.properties) == null ? void 0 : _A.discussion_parameters) == null ? void 0 : _B.discussion_concerning, !isExpired),
6482
+ line(`SPC Max Tornado Threat:`, (_D = (_C = event == null ? void 0 : event.properties) == null ? void 0 : _C.discussion_parameters) == null ? void 0 : _D.discussion_max_tornado, !isExpired),
6483
+ line(`SPC Max Hail Threat:`, (_F = (_E = event == null ? void 0 : event.properties) == null ? void 0 : _E.discussion_parameters) == null ? void 0 : _F.discussion_max_hail, !isExpired),
6484
+ line(`SPC Max Wind Threat:`, (_H = (_G = event == null ? void 0 : event.properties) == null ? void 0 : _G.discussion_parameters) == null ? void 0 : _H.discussion_max_wind, !isExpired),
6485
+ line(`SPC Watch Issuance Probability:`, ((_J = (_I = event == null ? void 0 : event.properties) == null ? void 0 : _I.discussion_parameters) == null ? void 0 : _J.discussion_watch_issuance) ? `${(_L = (_K = event == null ? void 0 : event.properties) == null ? void 0 : _K.discussion_parameters) == null ? void 0 : _L.discussion_watch_issuance}%` : null, !isExpired),
6486
+ line(`Watch Number:`, (_N = (_M = event == null ? void 0 : event.properties) == null ? void 0 : _M.watch_parameters) == null ? void 0 : _N.watch_number, !isExpired),
6487
+ line(`Strong Tornadoes Probability:`, ((_P = (_O = event == null ? void 0 : event.properties) == null ? void 0 : _O.watch_parameters) == null ? void 0 : _P.strong_tornadoes_probability) ? `${(_R = (_Q = event == null ? void 0 : event.properties) == null ? void 0 : _Q.watch_parameters) == null ? void 0 : _R.strong_tornadoes_probability}%` : null, !isExpired),
6488
+ line(`Additional Tornadoes Probability:`, ((_T = (_S = event == null ? void 0 : event.properties) == null ? void 0 : _S.watch_parameters) == null ? void 0 : _T.additional_tornadoes_probability) ? `${(_V = (_U = event == null ? void 0 : event.properties) == null ? void 0 : _U.watch_parameters) == null ? void 0 : _V.additional_tornadoes_probability}%` : null, !isExpired),
6489
+ line(`Combined Hail/Wind Probability:`, ((_X = (_W = event == null ? void 0 : event.properties) == null ? void 0 : _W.watch_parameters) == null ? void 0 : _X.combined_hail_wind_probability) ? `${(_Z = (_Y = event == null ? void 0 : event.properties) == null ? void 0 : _Y.watch_parameters) == null ? void 0 : _Z.combined_hail_wind_probability}%` : null, !isExpired),
6490
+ line(`Severe Hail Probability:`, ((_$ = (__ = event == null ? void 0 : event.properties) == null ? void 0 : __.watch_parameters) == null ? void 0 : _$.severe_hail_probability) ? `${(_ba = (_aa = event == null ? void 0 : event.properties) == null ? void 0 : _aa.watch_parameters) == null ? void 0 : _ba.severe_hail_probability}%` : null, !isExpired),
6491
+ line(`Hail >2in Probability:`, ((_da = (_ca = event == null ? void 0 : event.properties) == null ? void 0 : _ca.watch_parameters) == null ? void 0 : _da.hail_2in_probability) ? `${(_fa = (_ea = event == null ? void 0 : event.properties) == null ? void 0 : _ea.watch_parameters) == null ? void 0 : _fa.hail_2in_probability}%` : null, !isExpired),
6492
+ line(`Max Hail Inches:`, (_ha = (_ga = event == null ? void 0 : event.properties) == null ? void 0 : _ga.watch_parameters) == null ? void 0 : _ha.max_hail_in, !isExpired),
6493
+ line(`Severe Wind Probability:`, ((_ja = (_ia = event == null ? void 0 : event.properties) == null ? void 0 : _ia.watch_parameters) == null ? void 0 : _ja.severe_wind_probability) ? `${(_la = (_ka = event == null ? void 0 : event.properties) == null ? void 0 : _ka.watch_parameters) == null ? void 0 : _la.severe_wind_probability}%` : null, !isExpired),
6494
+ line(`Max Surface Wind:`, (_na = (_ma = event == null ? void 0 : event.properties) == null ? void 0 : _ma.watch_parameters) == null ? void 0 : _na.max_wind_surface, !isExpired),
6495
+ line(`Max Tops (x100 feet):`, (_pa = (_oa = event == null ? void 0 : event.properties) == null ? void 0 : _oa.watch_parameters) == null ? void 0 : _pa.max_tops_x100feet, !isExpired),
6496
+ line(`Sender:`, ((_sa = (_ra = (_qa = event == null ? void 0 : event.properties) == null ? void 0 : _qa.geocode) == null ? void 0 : _ra.office) == null ? void 0 : _sa.name) ? `${(_va = (_ua = (_ta = event == null ? void 0 : event.properties) == null ? void 0 : _ta.geocode) == null ? void 0 : _ua.office) == null ? void 0 : _va.name} (${(_ya = (_xa = (_wa = event == null ? void 0 : event.properties) == null ? void 0 : _wa.geocode) == null ? void 0 : _xa.office) == null ? void 0 : _ya.office})` : (_Ba = (_Aa = (_za = event == null ? void 0 : event.properties) == null ? void 0 : _za.geocode) == null ? void 0 : _Aa.office) == null ? void 0 : _Ba.office),
6497
+ line(`Tracking:`, (_Da = (_Ca = event == null ? void 0 : event.properties) == null ? void 0 : _Ca.metadata) == null ? void 0 : _Da.tracking)
6498
+ ].filter(Boolean).join("\n");
6499
+ };
6500
+
6457
6501
  // src/@modules/@utilities/utilities.createHttp.ts
6458
6502
  var createHttp = (options) => __async(null, null, function* () {
6459
6503
  var _a, _b, _c, _d;
@@ -6470,6 +6514,13 @@ var createHttp = (options) => __async(null, null, function* () {
6470
6514
  const returnHttp = function(error, status, message) {
6471
6515
  return { error, options: requestOptions, status, message };
6472
6516
  };
6517
+ if (options == null ? void 0 : options.auth) {
6518
+ const authString = `${options.auth.username}:${options.auth.password}`;
6519
+ const encodedAuth = Buffer.from(authString).toString("base64");
6520
+ requestOptions.headers = __spreadProps(__spreadValues({}, requestOptions.headers), {
6521
+ "Authorization": `Basic ${encodedAuth}`
6522
+ });
6523
+ }
6473
6524
  if (options == null ? void 0 : options.formData) {
6474
6525
  requestOptions.body = options.formData;
6475
6526
  } else if ((options == null ? void 0 : options.body) != void 0) {
@@ -6509,7 +6560,7 @@ var getMatched = (strings, string) => {
6509
6560
  // src/@manager/manager.updateListener.ts
6510
6561
  var import_fs3 = require("fs");
6511
6562
  var updateListener = (event) => __async(null, null, function* () {
6512
- var _a, _b, _c, _d, _e, _f;
6563
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
6513
6564
  const tick = performance.now();
6514
6565
  const settings = bootstrap.settings;
6515
6566
  const listeners2 = settings.ListenerSettings;
@@ -6566,8 +6617,29 @@ var updateListener = (event) => __async(null, null, function* () {
6566
6617
  }
6567
6618
  metadata.json = JSON.stringify(getCleanedEvent(event), null, 2);
6568
6619
  }
6620
+ if (settings.NotifyServer.Enabled && ((_a = listener2 == null ? void 0 : listener2.notify) == null ? void 0 : _a.enabled) && ((_b = listener2 == null ? void 0 : listener2.notify) == null ? void 0 : _b.topic)) {
6621
+ const auth = ((_c = settings.NotifyServer.Credentials) == null ? void 0 : _c.Username) && ((_d = settings.NotifyServer.Credentials) == null ? void 0 : _d.Password) ? {
6622
+ username: settings.NotifyServer.Credentials.Username,
6623
+ password: settings.NotifyServer.Credentials.Password
6624
+ } : void 0;
6625
+ const attachment = metadata.eas && settings.NotifyServer.Attachments ? `${settings.NotifyServer.Attachments}/${metadata.name}_${metadata.status}_${metadata.tracking}.wav` : null;
6626
+ yield createHttp(__spreadProps(__spreadValues({
6627
+ url: `${settings.NotifyServer.Server.replace(/\/$/, "")}/${(_e = listener2 == null ? void 0 : listener2.notify) == null ? void 0 : _e.topic}`,
6628
+ timeout: 15e3,
6629
+ method: "POST"
6630
+ }, auth && { auth }), {
6631
+ headers: __spreadProps(__spreadValues({
6632
+ "Title": `${metadata.name} (${metadata.status})`,
6633
+ "Tags": (_g = (_f = properties2.parameters.tags) == null ? void 0 : _f.join(",")) != null ? _g : "N/A"
6634
+ }, attachment && { "Attach": attachment }), {
6635
+ "Priority": "max",
6636
+ "Sound": "siren"
6637
+ }),
6638
+ body: getRaw(event)
6639
+ }));
6640
+ }
6569
6641
  if ((webhook == null ? void 0 : webhook.enabled) && (webhook == null ? void 0 : webhook.destination)) {
6570
- const isRatelimited = setTimeoutAction({ identifier: webhook.destination, interval: ((_a = webhook.ratelimit) != null ? _a : 2) * 2, max: (_b = webhook.ratelimit) != null ? _b : 2, addTime: true });
6642
+ const isRatelimited = setTimeoutAction({ identifier: webhook.destination, interval: ((_h = webhook.ratelimit) != null ? _h : 2) * 2, max: (_i = webhook.ratelimit) != null ? _i : 2, addTime: true });
6571
6643
  const form = new FormData();
6572
6644
  const embed = {
6573
6645
  title: `${metadata.name} (${metadata.status})`,
@@ -6575,7 +6647,7 @@ var updateListener = (event) => __async(null, null, function* () {
6575
6647
  fields: [],
6576
6648
  color: 16711680,
6577
6649
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
6578
- footer: { text: (_c = webhook.title) != null ? _c : `AtmosphericX` }
6650
+ footer: { text: (_j = webhook.title) != null ? _j : `AtmosphericX` }
6579
6651
  };
6580
6652
  if (isRatelimited.limited) {
6581
6653
  return;
@@ -6589,7 +6661,7 @@ var updateListener = (event) => __async(null, null, function* () {
6589
6661
  value: metadata.description ? "```\n" + metadata.description.split("\n").map((l) => l.trim()).filter(Boolean).join("\n") + "\n```" : ""
6590
6662
  });
6591
6663
  }
6592
- if (((_d = metadata.attachments) == null ? void 0 : _d.length) > 0) {
6664
+ if (((_k = metadata.attachments) == null ? void 0 : _k.length) > 0) {
6593
6665
  metadata.attachments = metadata.attachments.slice(0, 5);
6594
6666
  embed.fields.push({
6595
6667
  name: "Attachments",
@@ -6609,8 +6681,8 @@ var updateListener = (event) => __async(null, null, function* () {
6609
6681
  }
6610
6682
  }
6611
6683
  form.append("payload_json", JSON.stringify({
6612
- username: (_e = webhook.title) != null ? _e : "AtmosphericX",
6613
- content: (_f = webhook.message) != null ? _f : "",
6684
+ username: (_l = webhook.title) != null ? _l : "AtmosphericX",
6685
+ content: (_m = webhook.message) != null ? _m : "",
6614
6686
  embeds: [embed]
6615
6687
  }));
6616
6688
  yield createHttp({
@@ -6804,7 +6876,7 @@ var mkEvent = (event) => __async(null, null, function* () {
6804
6876
  if (isHashed || event.properties.status_metadata.is_expired) return;
6805
6877
  setHash(event, isEntry);
6806
6878
  const isFilteredLocation = yield updateNode(event).then(() => event.properties.metadata.filtered_proximity);
6807
- if (!isFilteredLocation && settings.GlobalSettings.EventFiltering.NodeLocationFiltering) {
6879
+ if (!isFilteredLocation && !dict_global.includes(event.properties.event.toLowerCase()) && settings.GlobalSettings.EventFiltering.NodeLocationFiltering) {
6808
6880
  return;
6809
6881
  }
6810
6882
  const isRatelimited = setTimeoutAction({ identifier: getTracking, interval: 1, max: 1, addTime: true });
@@ -6862,15 +6934,17 @@ var rmEvent = (event) => __async(null, null, function* () {
6862
6934
  event.properties.status = `Expired`;
6863
6935
  event.properties.status_metadata.is_expired = true;
6864
6936
  if (getEvent) {
6865
- setEventEmit({
6866
- event: `onEventStatus`,
6867
- metadata: {
6868
- type: `Removed`,
6869
- event
6870
- },
6871
- message: `[Removed] ${event.properties.event} (${event.properties.status}) (${event.properties.metadata.tracking})`
6872
- });
6873
- setEventEmit({ event: `onExpiredProduct`, metadata: event });
6937
+ if (!event.properties.status_metadata.is_statement) {
6938
+ setEventEmit({
6939
+ event: `onEventStatus`,
6940
+ metadata: {
6941
+ type: `Removed`,
6942
+ event
6943
+ },
6944
+ message: `[Removed] ${event.properties.event} (${event.properties.status}) (${event.properties.metadata.tracking})`
6945
+ });
6946
+ setEventEmit({ event: `onExpiredProduct`, metadata: event });
6947
+ }
6874
6948
  if (cachedStatus != `Statement`) yield updateListener(event);
6875
6949
  bootstrap.cache.events.features.splice(bootstrap.cache.events.features.indexOf(getEvent), 1);
6876
6950
  bootstrap.cache.hashes = bootstrap.cache.hashes.filter((hash) => hash.tracking !== event.properties.metadata.tracking);
@@ -6961,9 +7035,9 @@ var getEventAttachments = (event) => {
6961
7035
  const watchNumber = (_d = (_c = event == null ? void 0 : event.properties) == null ? void 0 : _c.watch_parameters) == null ? void 0 : _d.watch_number;
6962
7036
  const locations = (_e = event == null ? void 0 : event.properties) == null ? void 0 : _e.locations_array;
6963
7037
  const events = [
6964
- { target: "SPC Day 1 Outlook", attachment: `https://www.spc.noaa.gov/products/outlook/day1otlk_${issuanceTime}.png` },
6965
- { target: "SPC Day 2 Outlook", attachment: `https://www.spc.noaa.gov/products/outlook/day2otlk.png` },
6966
- { target: "SPC Day 3 Outlook", attachment: `https://www.spc.noaa.gov/products/outlook/day3otlk.png` },
7038
+ { target: "Storm Prediction Center Day 1 Outlook", attachment: `https://www.spc.noaa.gov/products/outlook/day1otlk_${issuanceTime}.png` },
7039
+ { target: "Storm Prediction Center Day 2 Outlook", attachment: `https://www.spc.noaa.gov/products/outlook/day2otlk.png` },
7040
+ { target: "Storm Prediction Center Day 3 Outlook", attachment: `https://www.spc.noaa.gov/products/outlook/day3otlk.png` },
6967
7041
  { target: "Mesoscale Discussion", attachment: `https://www.spc.noaa.gov/products/md/mcd${spcNumber}.png` },
6968
7042
  { target: "Tornado Watch", attachment: `https://www.spc.noaa.gov/products/watch/ww${watchNumber}_radar_big.gif` },
6969
7043
  { target: "PDS Tornado Watch", attachment: `https://www.spc.noaa.gov/products/watch/ww${watchNumber}_radar_big.gif` },
@@ -6971,7 +7045,7 @@ var getEventAttachments = (event) => {
6971
7045
  { target: "PDS Severe Thunderstorm Watch", attachment: `https://www.spc.noaa.gov/products/watch/ww${watchNumber}_radar_big.gif` }
6972
7046
  ];
6973
7047
  if (events.find((e) => e.target === event.properties.event)) {
6974
- attachments.push({ name: `Image: Graphic`, link: events.find((e) => e.target === event.properties.event).attachment });
7048
+ attachments.push({ name: `Image: Graphic`, link: events.find((e) => e.target.toLowerCase() === event.properties.event.toLowerCase()).attachment });
6975
7049
  }
6976
7050
  for (const location of locations) {
6977
7051
  if (dict_expressions.location.test(location)) {
@@ -7001,7 +7075,6 @@ var getEventAttachments = (event) => {
7001
7075
  // src/@building/building.validate.ts
7002
7076
  var import_crypto = require("crypto");
7003
7077
  var validateEvents = (events) => __async(null, null, function* () {
7004
- var _a;
7005
7078
  const tick = performance.now();
7006
7079
  if (events.length === 0) return;
7007
7080
  const configurations = bootstrap.settings;
@@ -7017,39 +7090,28 @@ var validateEvents = (events) => __async(null, null, function* () {
7017
7090
  bools[key] = setting;
7018
7091
  }
7019
7092
  }
7020
- const filterd = events.filter((event) => {
7021
- var _a2, _b, _c, _d, _e;
7022
- bootstrap.cache.processed = bootstrap.cache.processed.filter((e) => e !== event);
7023
- const define2 = getEventSignature(event);
7093
+ const isFiltered = (define2) => {
7094
+ var _a, _b, _c, _d;
7024
7095
  const properties2 = define2.properties;
7025
7096
  const zones = properties2.geocode.ugc;
7026
7097
  const icao = properties2.geocode.office.office;
7027
- const enhancedEventName = properties2.event = getEventEnhancedName(event);
7028
- const filteredProperties = JSON.parse(JSON.stringify(properties2));
7029
- if ((filteredProperties == null ? void 0 : filteredProperties.metadata) && "ms" in filteredProperties.metadata) {
7030
- delete filteredProperties.metadata.ms;
7031
- }
7032
- filteredProperties.metadata = (_a2 = filteredProperties.metadata) != null ? _a2 : {};
7033
- properties2.metadata.hash = (0, import_crypto.createHash)("sha256").update(JSON.stringify(filteredProperties)).digest("hex");
7034
- properties2.metadata.attachments = getEventAttachments(event);
7035
- setEventEmit({ event: `onProductType${enhancedEventName.replace(/\s+/g, "")}`, metadata: define2 });
7036
7098
  if (properties2.status_metadata.is_test) {
7037
7099
  setEventEmit({ event: `onTestProduct`, metadata: define2 });
7038
- if (bools == null ? void 0 : bools.IgnoreTestProducts) return false;
7100
+ if (bools == null ? void 0 : bools.IgnoreTestProducts) return true;
7039
7101
  }
7040
7102
  if (properties2.status_metadata.is_expired) {
7041
7103
  setEventEmit({ event: `onExpiredProduct`, metadata: define2 });
7042
7104
  rmEvent(define2);
7043
- return false;
7105
+ return true;
7044
7106
  }
7045
- if (((_c = (_b = properties2.metadata) == null ? void 0 : _b.vtec) == null ? void 0 : _c.is_watch) && properties2.metadata.source != `events.api`) {
7046
- const isSPC = (_e = (_d = properties2.metadata) == null ? void 0 : _d.vtec) == null ? void 0 : _e.prediction_center;
7107
+ if (((_b = (_a = properties2.metadata) == null ? void 0 : _a.vtec) == null ? void 0 : _b.is_watch) && properties2.metadata.source != `events.api`) {
7108
+ const isSPC = (_d = (_c = properties2.metadata) == null ? void 0 : _c.vtec) == null ? void 0 : _d.prediction_center;
7047
7109
  setEventEmit({ event: isSPC ? `onStormPredictionWatch` : `onNonStormPredictionWatch`, metadata: define2 });
7048
7110
  if ((bools == null ? void 0 : bools.SPCWatchesOnly) && !isSPC) {
7049
- return false;
7111
+ return true;
7050
7112
  }
7051
7113
  if (!(bools == null ? void 0 : bools.SPCWatchesOnly) && isSPC) {
7052
- return false;
7114
+ return true;
7053
7115
  }
7054
7116
  }
7055
7117
  for (const key in sets) {
@@ -7060,53 +7122,64 @@ var validateEvents = (events) => __async(null, null, function* () {
7060
7122
  event: `onFilteredEvent`,
7061
7123
  metadata: define2
7062
7124
  });
7063
- return false;
7125
+ return true;
7064
7126
  }
7065
7127
  if (key === "IgnoredEvents" && setting.size > 0 && getMatched(values, define2.properties.event)) {
7066
7128
  setEventEmit({
7067
7129
  event: `onIgnoredEvent`,
7068
7130
  metadata: define2
7069
7131
  });
7070
- return false;
7132
+ return true;
7071
7133
  }
7072
7134
  if (key === "ListeningICAO" && setting.size > 0 && icao != null && !setting.has(icao.toLowerCase())) {
7073
7135
  setEventEmit({
7074
7136
  event: `onFilteredICAO`,
7075
7137
  metadata: define2
7076
7138
  });
7077
- return false;
7139
+ return true;
7078
7140
  }
7079
7141
  if (key === "IgnoredICAO" && setting.size > 0 && icao != null && setting.has(icao.toLowerCase())) {
7080
7142
  setEventEmit({
7081
7143
  event: `onIgnoredICAO`,
7082
7144
  metadata: define2
7083
7145
  });
7084
- return false;
7146
+ return true;
7085
7147
  }
7086
7148
  if (key === "ListeningUGC" && setting.size > 0 && zones.length > 0 && !zones.some((ugc2) => setting.has(ugc2.toLowerCase()))) {
7087
7149
  setEventEmit({
7088
7150
  event: `onFilteredUGC`,
7089
7151
  metadata: define2
7090
7152
  });
7091
- return false;
7153
+ return true;
7092
7154
  }
7093
7155
  if (key === "ListeningStates" && setting.size > 0 && zones.length > 0 && !zones.some((ugc2) => setting.has(ugc2.substring(0, 2).toLowerCase()))) {
7094
7156
  setEventEmit({
7095
7157
  event: `onFilteredState`,
7096
7158
  metadata: define2
7097
7159
  });
7098
- return false;
7160
+ return true;
7099
7161
  }
7100
7162
  }
7101
- return true;
7163
+ return false;
7164
+ };
7165
+ const filtering = events.filter((event) => {
7166
+ var _a;
7167
+ bootstrap.cache.processed = bootstrap.cache.processed.filter((e) => e !== event);
7168
+ const define2 = getEventSignature(event);
7169
+ const properties2 = define2.properties;
7170
+ (_a = properties2 == null ? void 0 : properties2.metadata) == null ? true : delete _a.ms;
7171
+ const enhanced = properties2.event = getEventEnhancedName(event);
7172
+ const filtered = isFiltered(define2);
7173
+ if (!filtered) {
7174
+ event.geometry = !(bools == null ? void 0 : bools.DisableGeometryParsing) ? getEventGeometry(event) : null;
7175
+ properties2.metadata.attachments = getEventAttachments(event);
7176
+ }
7177
+ properties2.metadata.hash = (0, import_crypto.createHash)("sha256").update(JSON.stringify(properties2)).digest("hex");
7178
+ setEventEmit({ event: `onProductType${enhanced.replace(/\s+/g, "")}`, metadata: define2 });
7179
+ return !filtered;
7102
7180
  });
7103
- if (!((_a = configurations == null ? void 0 : configurations.GlobalSettings) == null ? void 0 : _a.DisableGeometryParsing)) {
7104
- for (const event of filterd) {
7105
- event.geometry = yield getEventGeometry(event);
7106
- }
7107
- }
7108
- if (filterd.length > 0) {
7109
- for (const event of filterd) {
7181
+ if (filtering.length > 0) {
7182
+ for (const event of filtering) {
7110
7183
  yield mkEvent(event);
7111
7184
  }
7112
7185
  }
@@ -7116,7 +7189,7 @@ var validateEvents = (events) => __async(null, null, function* () {
7116
7189
  metadata: bootstrap.cache.events,
7117
7190
  limited: true
7118
7191
  });
7119
- setDebug({ title: `@building.validate`, message: `Filtered ${filterd.length} events which took ${performance.now() - tick} ms` });
7192
+ setDebug({ title: `@building.validate`, message: `Filtered ${filtering.length} events which took ${performance.now() - tick} ms` });
7120
7193
  });
7121
7194
 
7122
7195
  // src/@building/building.create.ts
@@ -7666,59 +7739,16 @@ var getNodes = () => {
7666
7739
  return bootstrap.cache.nodes;
7667
7740
  };
7668
7741
 
7669
- // src/@core/core.createEvent.ts
7670
- var createEvent2 = (options) => {
7671
- var _a;
7672
- const tick = performance.now();
7673
- validateEvents([{
7674
- type: `Feature`,
7675
- geometry: {
7676
- type: `Point`,
7677
- coordinates: options.coordinates
7678
- },
7679
- properties: {
7680
- event: options.event,
7681
- parent: options.event,
7682
- status: options.status,
7683
- issued: options.issued.toISOString(),
7684
- expires: options.expires.toISOString(),
7685
- locations: options.locations,
7686
- locations_array: options.locations ? options.locations.split(";") : [],
7687
- description: options.description,
7688
- geocode: {
7689
- office: {
7690
- office: `ATMX`,
7691
- name: `AtmosphericX Manual Event`
7692
- },
7693
- organization: `AtmosphericX`,
7694
- ugc: [],
7695
- polygon: options.coordinates.length > 0 ? Buffer.from(JSON.stringify([options.coordinates[0]])).toString("base64") : null,
7696
- polygon_generated: options.coordinates.length > 0 ? true : false
7697
- },
7698
- status_metadata: {
7699
- is_issued: options.status == `Issued`,
7700
- is_updated: options.status == `Updated`,
7701
- is_expired: options.status == `Expired`,
7702
- is_test: options.status == `Test`,
7703
- is_statement: options.status == `Statement`
7704
- },
7705
- metadata: {
7706
- ms: performance.now() - tick,
7707
- source: `events.manual`,
7708
- tracking: `ATMX-M-W-01`,
7709
- header: `ZCZC-ATMOSX-ATMX-M-W-01`,
7710
- raw: options.description,
7711
- history: [
7712
- {
7713
- description: options.description,
7714
- issued: options.issued.toISOString(),
7715
- status: (_a = options.status) != null ? _a : null
7716
- }
7717
- ]
7718
- }
7719
- }
7720
- }]);
7721
- };
7742
+ // src/@core/core.manualEvent.ts
7743
+ var manualEvent = (options) => __async(null, null, function* () {
7744
+ const isCapEvent = options.message.includes(`<?xml`);
7745
+ const isCapAreaDescription = options.message.includes(`<areaDesc>`);
7746
+ const isVTEC = options.message.match(dict_expressions.pvtec) != null;
7747
+ const isUGC = options.message.match(dict_expressions.ugc1) != null;
7748
+ const getType = getAwipsType({ attributes: options.attributes });
7749
+ const result = { message: options.message, attributes: options.attributes, isCapEvent, isVTEC, isUGC, isCapAreaDescription, isIgnored: false, isNWWS: true, getType };
7750
+ yield createEvent(result);
7751
+ });
7722
7752
 
7723
7753
  // src/@core/core.getRandomEvent.ts
7724
7754
  var getRandomEvent = () => {
@@ -7780,12 +7810,12 @@ var index_default = Manager;
7780
7810
  0 && (module.exports = {
7781
7811
  Manager,
7782
7812
  clearEvents,
7783
- createEvent,
7784
7813
  getCleanedEvent,
7785
7814
  getEventGeometry,
7786
7815
  getEvents,
7787
7816
  getNodes,
7788
7817
  getRandomEvent,
7818
+ manualEvent,
7789
7819
  query,
7790
7820
  setEasTone,
7791
7821
  setNode,