@atmosx/event-product-parser 3.0.55 → 3.0.62

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 (156) hide show
  1. package/.github/CODE_OF_CONDUCT.md +9 -9
  2. package/.github/CONTRIBUTING.md +29 -29
  3. package/.github/LICENSE +17 -17
  4. package/.github/SECURITY.md +20 -20
  5. package/.github/SUPPORTED_EVENTS.md +369 -369
  6. package/.github/docs/docs-functions.md +30 -0
  7. package/.github/docs/docs-general-configurations.md +209 -0
  8. package/.github/docs/docs-integrations.md +37 -0
  9. package/.github/docs/docs-listeners.md +28 -0
  10. package/.github/docs/docs-source-configuration.md +218 -0
  11. package/.github/docs/docs-technical.md +50 -0
  12. package/.github/logo.png +0 -0
  13. package/.github/samples/SAMPLE_EAS_GENERATION.wav +0 -0
  14. package/.github/samples/SAMPLE_GEOJSON.json +204 -0
  15. package/.github/samples/SAMPLE_TEXT_PRODUCT.txt +119 -0
  16. package/.vscode/settings.json +3 -3
  17. package/README.md +167 -0
  18. package/dist/cjs/index.cjs +1439 -1277
  19. package/dist/esm/index.mjs +1420 -1258
  20. package/package.json +47 -52
  21. package/src/@building/{building.create.ts → CreateEvent.ts} +55 -55
  22. package/src/@building/{building.clean.ts → GetCleanedEvent.ts} +29 -29
  23. package/src/@building/{building.attachments.ts → GetEventAttachments.ts} +85 -82
  24. package/src/@building/{building.enhance.ts → GetEventEnhancedName.ts} +54 -59
  25. package/src/@building/{building.geometry.ts → GetEventGeometry.ts} +47 -47
  26. package/src/@building/{building.headers.ts → GetEventHeader.ts} +36 -36
  27. package/src/@building/{building.polygon.ts → GetEventNodes.ts} +72 -69
  28. package/src/@building/{building.office.ts → GetEventOffice.ts} +42 -42
  29. package/src/@building/{building.properties.ts → GetEventProperties.ts} +95 -95
  30. package/src/@building/{building.signature.ts → GetEventSignature.ts} +60 -60
  31. package/src/@building/{building.tags.ts → GetEventTags.ts} +29 -24
  32. package/src/@building/{building.tracking.ts → GetEventTracking.ts} +67 -67
  33. package/src/@core/{core.clearEvents.ts → ClearEvents.ts} +30 -30
  34. package/src/@core/{core.createListener.ts → CreateListener.ts} +23 -23
  35. package/src/@core/{core.getEvents.ts → GetEvents.ts} +23 -23
  36. package/src/@core/{core.getNodes.ts → GetNodes.ts} +23 -23
  37. package/src/@core/{core.getRandomEvent.ts → GetRandomEvent.ts} +23 -23
  38. package/src/@core/{core.getVersion.ts → GetVersion.ts} +23 -23
  39. package/src/@core/{core.manualEvent.ts → ManualEvent.ts} +56 -38
  40. package/src/@core/{core.query.ts → QueryStanza.ts} +38 -38
  41. package/src/@core/{core.setNode.ts → SetNode.ts} +80 -80
  42. package/src/@core/{core.start.ts → StartService.ts} +60 -60
  43. package/src/@core/{core.stop.ts → StopService.ts} +31 -31
  44. package/src/@enums/AWIPS.ts +366 -0
  45. package/src/{@dictionaries/dictionaries.actions.ts → @enums/Actions.ts} +27 -27
  46. package/src/{@dictionaries/dictionaries.cancellation.ts → @enums/Cancellation.ts} +30 -30
  47. package/src/{@dictionaries/dictionaries.causes.ts → @enums/Causes.ts} +35 -35
  48. package/src/{@dictionaries/dictionaries.correlations.ts → @enums/Correlations.ts} +42 -42
  49. package/src/{@dictionaries/dictionaries.enhanced.ts → @enums/Enhanced.ts} +69 -69
  50. package/src/{@dictionaries/dictionaries.events.ts → @enums/Events.ts} +82 -82
  51. package/src/{@dictionaries/dictionaries.expressions.ts → @enums/Expressions.ts} +28 -28
  52. package/src/@enums/GlobalFilter.ts +24 -0
  53. package/src/{@dictionaries/dictionaries.hail.ts → @enums/Hail.ts} +37 -35
  54. package/src/{@dictionaries/dictionaries.icao.ts → @enums/ICAO.ts} +258 -258
  55. package/src/{@dictionaries/dictionaries.matches.ts → @enums/Matches.ts} +54 -54
  56. package/src/{@dictionaries/dictionaries.products.ts → @enums/Products.ts} +24 -24
  57. package/src/{@dictionaries/dictionaries.records.ts → @enums/Records.ts} +25 -25
  58. package/src/{@dictionaries/dictionaries.severity.ts → @enums/Severity.ts} +27 -27
  59. package/src/{@dictionaries/dictionaries.shapefiles.ts → @enums/Shapefiles.ts} +35 -35
  60. package/src/{@dictionaries/dictionaries.states.ts → @enums/States.ts} +71 -71
  61. package/src/{@dictionaries/dictionaries.status.ts → @enums/Status.ts} +30 -30
  62. package/src/{@dictionaries/dictionaries.global.ts → @enums/Strings.ts} +22 -24
  63. package/src/@enums/Tags.ts +167 -0
  64. package/src/{@dictionaries/dictionaries.testing.ts → @enums/Testing.ts} +24 -24
  65. package/src/@events/{events.api.ts → ParseAPI.ts} +116 -116
  66. package/src/@events/{events.text.ts → ParseText.ts} +87 -84
  67. package/src/@events/{events.ugc.ts → ParseUGC.ts} +93 -89
  68. package/src/@events/{events.vtec.ts → ParseVTEC.ts} +86 -86
  69. package/src/@manager/MakeEvents.ts +106 -0
  70. package/src/@manager/{manager.rmEvent.ts → RemoveEvent.ts} +69 -71
  71. package/src/@manager/{manager.setHash.ts → SetHash.ts} +35 -35
  72. package/src/@manager/Tasks.ts +246 -0
  73. package/src/@manager/{manager.updateEvents.ts → UpdateEvents.ts} +34 -34
  74. package/src/@manager/{manager.updateNodes.ts → UpdateNode.ts} +61 -53
  75. package/src/{@building/building.validate.ts → @manager/ValidateEvents.ts} +141 -154
  76. package/src/@modules/@database/{database.cache.ts → GetCachedEvents.ts} +49 -49
  77. package/src/@modules/@database/{database.broadcastify.ts → ImportBroadcastify.ts} +69 -66
  78. package/src/@modules/@database/{database.shapefiles.ts → ImportShapefiles.ts} +92 -92
  79. package/src/@modules/@database/{database.stanza.ts → ImportStanza.ts} +46 -46
  80. package/src/@modules/@database/{database.init.ts → InitializeDatabase.ts} +58 -58
  81. package/src/@modules/@eas/{eas.setEasTone.ts → GenerateEASMessage.ts} +144 -151
  82. package/src/@modules/@eas/{eas.getCleanDescription.ts → GetCleanDescription.ts} +91 -91
  83. package/src/@modules/@eas/{eas.getFloatPCM16.ts → GetFloatPCM16.ts} +29 -29
  84. package/src/@modules/@eas/{eas.getMergedPCM16.ts → GetMergedPCM16.ts} +32 -32
  85. package/src/@modules/@eas/{eas.getPCM16.ts → GetPCM16.ts} +52 -52
  86. package/src/@modules/@eas/{eas.getPCMToFloat.ts → GetPCMToFloat.ts} +26 -26
  87. package/src/@modules/@eas/{eas.getSampledPCM16.ts → GetSampledPCM16.ts} +36 -36
  88. package/src/@modules/@eas/{eas.getTTS.ts → GetTTS.ts} +54 -54
  89. package/src/@modules/@eas/{eas.getWavPCM16.ts → GetWavPCM16.ts} +52 -52
  90. package/src/@modules/@eas/{eas.setAFSK.ts → SetAFSK.ts} +51 -51
  91. package/src/@modules/@eas/{eas.setAsciiToBits.ts → SetAsciiToBits.ts} +31 -31
  92. package/src/@modules/@eas/{eas.setAttentionTone.ts → SetAttentionTone.ts} +40 -40
  93. package/src/@modules/@eas/{eas.setNoise.ts → SetNoise.ts} +32 -32
  94. package/src/@modules/@eas/{eas.setRadioEffect.ts → SetRadioEffect.ts} +50 -50
  95. package/src/@modules/@eas/{eas.setSameHeader.ts → SetSameHeader.ts} +44 -44
  96. package/src/@modules/@stanza/{stanza.getAwipsType.ts → GetAwipsType.ts} +47 -45
  97. package/src/@modules/@stanza/{stanza.validate.ts → ValidateStanza.ts} +49 -49
  98. package/src/@modules/@utilities/{utilities.createHttp.ts → CreateHttp.ts} +83 -83
  99. package/src/@modules/@utilities/{utilities.getFormattedTime.ts → GetFormattedTime.ts} +43 -43
  100. package/src/@modules/@utilities/{utilities.getLatestIssuance.ts → GetLatestIssuance.ts} +32 -32
  101. package/src/@modules/@utilities/{utilities.getMatched.ts → GetMatched.ts} +33 -33
  102. package/src/@modules/@utilities/{utilities.getSettings.ts → GetSettings.ts} +25 -25
  103. package/src/@modules/@utilities/{utilities.getShapeNearestPoint.ts → GetShapeNearestPoint.ts} +114 -114
  104. package/src/@modules/@utilities/{utilities.setCronSchedule.ts → SetCronSchedule.ts} +94 -94
  105. package/src/@modules/@utilities/{utilities.setDebug.ts → SetDebug.ts} +37 -38
  106. package/src/@modules/@utilities/{utilities.setEventEmit.ts → SetEventEmit.ts} +41 -41
  107. package/src/@modules/@utilities/{utilities.setListener.ts → SetListener.ts} +30 -30
  108. package/src/@modules/@utilities/{utilities.setSettings.ts → SetSettings.ts} +42 -42
  109. package/src/@modules/@utilities/{utilities.setSleep.ts → SetSleep.ts} +33 -33
  110. package/src/@modules/@utilities/{utilities.setTimeoutAction.ts → SetTimeoutAction.ts} +63 -63
  111. package/src/@modules/@utilities/{utilities.setWarning.ts → SetWarning.ts} +34 -34
  112. package/src/@modules/@xmpp/{xmpp.xDeploy.ts → DeployXMPP.ts} +57 -57
  113. package/src/@modules/@xmpp/{xmpp.xError.ts → ErrorXMPP.ts} +26 -26
  114. package/src/@modules/@xmpp/{xmpp.xOffline.ts → OfflineXMPP.ts} +36 -36
  115. package/src/@modules/@xmpp/{xmpp.xOnline.ts → OnlineXMPP.ts} +45 -45
  116. package/src/@modules/@xmpp/{xmpp.xReconnect.ts → ReconnectXMPP.ts} +64 -64
  117. package/src/@modules/@xmpp/{xmpp.xStanza.ts → StanzaXMPP.ts} +62 -62
  118. package/src/@parsers/@hvtec/{hvtec.extract.ts → HVExtract.ts} +39 -39
  119. package/src/@parsers/@pvtec/{pvtec.expires.ts → GetExpiry.ts} +25 -25
  120. package/src/@parsers/@pvtec/{pvtec.extract.ts → VTECExtract.ts} +48 -48
  121. package/src/@parsers/@text/{text.getDescriptionFromProduct.ts → GetDescriptionFromProduct.ts} +59 -52
  122. package/src/@parsers/@text/{text.getEmbedText.ts → GetEmbededText.ts} +55 -55
  123. package/src/@parsers/@text/{text.getPolygonFromProduct.ts → GetPolygonFromProduct.ts} +52 -52
  124. package/src/@parsers/@text/{text.getStringText.ts → GetStringText.ts} +57 -53
  125. package/src/@parsers/@text/{text.getTextFromProduct.ts → GetTextFromProduct.ts} +42 -42
  126. package/src/@parsers/@text/{text.getXML.ts → GetXML.ts} +60 -60
  127. package/src/@parsers/@ugc/{ugc.getCache.ts → GetCache.ts} +23 -23
  128. package/src/@parsers/@ugc/{ugc.expiry.ts → GetExpiry.ts} +31 -31
  129. package/src/@parsers/@ugc/{ugc.locations.ts → GetLocations.ts} +56 -56
  130. package/src/@parsers/@ugc/{ugc.header.ts → GetUGCHeader.ts} +29 -29
  131. package/src/@parsers/@ugc/{ugc.coordinates.ts → GetZonePolygon.ts} +110 -110
  132. package/src/@parsers/@ugc/{ugc.zones.ts → GetZones.ts} +51 -51
  133. package/src/@parsers/@ugc/{ugc.setCache.ts → SetCache.ts} +27 -27
  134. package/src/@parsers/@ugc/{ugc.extract.ts → UGCExtract.ts} +36 -36
  135. package/src/@types/{type.listener.ts → Actions.ts} +37 -38
  136. package/src/@types/{type.attributes.ts → Attributes.ts} +28 -28
  137. package/src/@types/{type.event.ts → Event.ts} +69 -69
  138. package/src/@types/{type.hvtec.ts → HVTEC.ts} +25 -25
  139. package/src/@types/{type.hash.ts → Hash.ts} +24 -24
  140. package/src/@types/{type.properties.ts → Properties.ts} +77 -77
  141. package/src/@types/{type.settings.ts → Settings.ts} +99 -93
  142. package/src/@types/{type.stanza.ts → Stanza.ts} +37 -37
  143. package/src/@types/{type.compiled.ts → StanzaCompiled.ts} +35 -34
  144. package/src/@types/{type.ugc.ts → UGC.ts} +24 -24
  145. package/src/@types/{type.pvtec.ts → VTEC.ts} +30 -30
  146. package/src/bootstrap.ts +128 -124
  147. package/src/index.ts +74 -74
  148. package/tsconfig.json +13 -13
  149. package/tsup.config.ts +15 -15
  150. package/.github/README.md +0 -384
  151. package/src/@dictionaries/dictionaries.awips.ts +0 -364
  152. package/src/@dictionaries/dictionaries.strings.ts +0 -22
  153. package/src/@dictionaries/dictionaries.tags.ts +0 -93
  154. package/src/@manager/manager.mkEvent.ts +0 -98
  155. package/src/@manager/manager.updateListener.ts +0 -180
  156. package/testing/init.js +0 -91
@@ -300,13 +300,13 @@ var require_Element = __commonJS({
300
300
  return result;
301
301
  }
302
302
  getText() {
303
- let text2 = "";
303
+ let text = "";
304
304
  for (const child of this.children) {
305
305
  if (typeof child === "string" || typeof child === "number") {
306
- text2 += child;
306
+ text += child;
307
307
  }
308
308
  }
309
- return text2;
309
+ return text;
310
310
  }
311
311
  getChildText(name, xmlns) {
312
312
  const child = this.getChild(name, xmlns);
@@ -365,8 +365,8 @@ var require_Element = __commonJS({
365
365
  }
366
366
  }
367
367
  /** add text node and return element */
368
- t(text2) {
369
- this.children.push(text2);
368
+ t(text) {
369
+ this.children.push(text);
370
370
  return this;
371
371
  }
372
372
  /* Manipulation */
@@ -579,9 +579,9 @@ var require_ltx = __commonJS({
579
579
  switch (state) {
580
580
  case STATE_TEXT:
581
581
  if (c === 60) {
582
- const text2 = endRecording();
583
- if (text2) {
584
- this.emit("text", escape2.unescapeXML(text2));
582
+ const text = endRecording();
583
+ if (text) {
584
+ this.emit("text", escape2.unescapeXML(text));
585
585
  }
586
586
  state = STATE_TAG_NAME;
587
587
  recordStart = pos + 1;
@@ -814,10 +814,10 @@ var require_bitops = __commonJS({
814
814
  }
815
815
  return new Uint8Array(res);
816
816
  };
817
- exports.H = function(text2) {
817
+ exports.H = function(text) {
818
818
  return __async(this, null, function* () {
819
819
  return new Uint8Array(
820
- yield crypto.subtle.digest("SHA-1", text2)
820
+ yield crypto.subtle.digest("SHA-1", text)
821
821
  );
822
822
  });
823
823
  };
@@ -839,9 +839,9 @@ var require_bitops = __commonJS({
839
839
  ));
840
840
  });
841
841
  };
842
- exports.Hi = function(text2, salt, iterations) {
842
+ exports.Hi = function(text, salt, iterations) {
843
843
  return __async(this, null, function* () {
844
- const key = new TextEncoder().encode(text2);
844
+ const key = new TextEncoder().encode(text);
845
845
  var concat = new Uint8Array(salt.length + 4);
846
846
  concat.set(salt);
847
847
  concat.set(new Uint8Array([0, 0, 0, 1]), salt.length);
@@ -1104,7 +1104,7 @@ var require_main3 = __commonJS({
1104
1104
  import path from "path";
1105
1105
  import { EventEmitter } from "events";
1106
1106
  var bootstrap = {
1107
- version: `3.0.55`,
1107
+ version: `3.0.61`,
1108
1108
  isReady: true,
1109
1109
  ratelimits: {},
1110
1110
  session_xmpp: null,
@@ -1171,22 +1171,26 @@ var bootstrap = {
1171
1171
  NotifyServer: {
1172
1172
  Enabled: false,
1173
1173
  Server: `https://ntfy.sh`,
1174
- Attachments: null,
1174
+ Timezone: "UTC",
1175
+ MediaStorage: {
1176
+ EAS: null,
1177
+ TEXT: null,
1178
+ JSON: null
1179
+ },
1175
1180
  Credentials: {
1176
1181
  Username: null,
1177
1182
  Password: null
1178
1183
  }
1179
1184
  },
1180
- ListenerSettings: [],
1185
+ ActionSettings: [],
1181
1186
  GlobalSettings: {
1182
1187
  EventManagement: true,
1183
- BetterEventNames: true,
1184
1188
  DisableGeometryParsing: false,
1185
1189
  UseShapefileCoordinates: true,
1186
1190
  SPCWatchesOnly: true,
1187
1191
  ShapefileSkipPoints: 15,
1188
1192
  NodeTTL: 60,
1189
- NodeMinDistance: 120,
1193
+ NodeMaxDistance: 120,
1190
1194
  EventFiltering: {
1191
1195
  ListeningEvents: [],
1192
1196
  ListeningICAO: [],
@@ -1199,7 +1203,7 @@ var bootstrap = {
1199
1203
  },
1200
1204
  ArchiveSettings: {
1201
1205
  TTL: 60,
1202
- EventDirectory: null,
1206
+ JSONDirectory: null,
1203
1207
  TextDirectory: null,
1204
1208
  EasDirectory: null,
1205
1209
  EasToneout: null
@@ -1208,8 +1212,8 @@ var bootstrap = {
1208
1212
  }
1209
1213
  };
1210
1214
 
1211
- // src/@modules/@utilities/utilities.setSettings.ts
1212
- var setSettings = (newSettings) => {
1215
+ // src/@modules/@utilities/SetSettings.ts
1216
+ var SetSettings = (newSettings) => {
1213
1217
  const settings = bootstrap.settings;
1214
1218
  const merge = (target, source) => {
1215
1219
  for (const key in source) {
@@ -1230,12 +1234,12 @@ var setSettings = (newSettings) => {
1230
1234
  return settings;
1231
1235
  };
1232
1236
 
1233
- // src/@modules/@utilities/utilities.getSettings.ts
1234
- var getSettings = () => {
1237
+ // src/@modules/@utilities/GetSettings.ts
1238
+ var GetSettings = () => {
1235
1239
  return bootstrap.settings;
1236
1240
  };
1237
1241
 
1238
- // src/@parsers/@ugc/ugc.coordinates.ts
1242
+ // src/@parsers/@ugc/GetZonePolygon.ts
1239
1243
  import { union } from "polygon-clipping";
1240
1244
  var getZonePolygon = (options) => {
1241
1245
  var _a, _b;
@@ -1313,18 +1317,18 @@ var getZonePolygon = (options) => {
1313
1317
  }
1314
1318
  };
1315
1319
 
1316
- // src/@building/building.geometry.ts
1317
- var getEventGeometry = (event) => {
1320
+ // src/@building/GetEventGeometry.ts
1321
+ var GetEventGeometry = (event) => {
1318
1322
  var _a, _b, _c, _d, _e, _f;
1319
- const settings = getSettings();
1323
+ const settings = GetSettings();
1320
1324
  const generated = (_c = (_b = (_a = event == null ? void 0 : event.properties) == null ? void 0 : _a.geocode) == null ? void 0 : _b.polygon) != null ? _c : null;
1321
- const ugc2 = (_f = (_e = (_d = event == null ? void 0 : event.properties) == null ? void 0 : _d.geocode) == null ? void 0 : _e.ugc) != null ? _f : null;
1325
+ const ugc = (_f = (_e = (_d = event == null ? void 0 : event.properties) == null ? void 0 : _d.geocode) == null ? void 0 : _e.ugc) != null ? _f : null;
1322
1326
  let geo = {
1323
1327
  type: `Polygon`,
1324
1328
  coordinates: generated != null ? JSON.parse(Buffer.from(generated, "base64").toString("utf-8")) : null
1325
1329
  };
1326
- if (settings.GlobalSettings.UseShapefileCoordinates && generated == null && ugc2 != null) {
1327
- geo = getZonePolygon({ zones: ugc2, isUnion: false });
1330
+ if (settings.GlobalSettings.UseShapefileCoordinates && generated == null && ugc != null) {
1331
+ geo = getZonePolygon({ zones: ugc, isUnion: false });
1328
1332
  if (geo == null) {
1329
1333
  geo = {
1330
1334
  type: `Polygon`,
@@ -1335,21 +1339,21 @@ var getEventGeometry = (event) => {
1335
1339
  return geo;
1336
1340
  };
1337
1341
 
1338
- // src/@building/building.clean.ts
1339
- var getCleanedEvent = (event) => {
1342
+ // src/@building/GetCleanedEvent.ts
1343
+ var GetCleanedEvent = (event) => {
1340
1344
  for (const key of Object.keys(event)) {
1341
1345
  const value = event[key];
1342
1346
  if (value === null || value === void 0) {
1343
1347
  delete event[key];
1344
1348
  } else if (typeof value === "object" && value !== null && !Array.isArray(value)) {
1345
- event[key] = getCleanedEvent(value);
1349
+ event[key] = GetCleanedEvent(value);
1346
1350
  }
1347
1351
  }
1348
1352
  return event;
1349
1353
  };
1350
1354
 
1351
- // src/@modules/@utilities/utilities.setTimeoutAction.ts
1352
- var setTimeoutAction = (options) => {
1355
+ // src/@modules/@utilities/SetTimeoutAction.ts
1356
+ var SetTimeoutAction = (options) => {
1353
1357
  var _a, _b, _c;
1354
1358
  let target = (_b = (_a = bootstrap) == null ? void 0 : _a.ratelimits) == null ? void 0 : _b[options == null ? void 0 : options.identifier];
1355
1359
  if (!target) {
@@ -1378,8 +1382,8 @@ var setTimeoutAction = (options) => {
1378
1382
  return { limited: false };
1379
1383
  };
1380
1384
 
1381
- // src/@modules/@utilities/utilities.setWarning.ts
1382
- var setWarning = (options) => {
1385
+ // src/@modules/@utilities/SetWarning.ts
1386
+ var SetWarning = (options) => {
1383
1387
  var _a, _b;
1384
1388
  const settings = bootstrap.settings;
1385
1389
  bootstrap.listener.emit(`log`, `${(_a = options.title) != null ? _a : `[${bootstrap.ansi_colors.YELLOW}@atmosx/product-parser${bootstrap.ansi_colors.RESET}]`} ${options.message}`);
@@ -1388,10 +1392,10 @@ var setWarning = (options) => {
1388
1392
  }
1389
1393
  };
1390
1394
 
1391
- // src/@modules/@utilities/utilities.setEventEmit.ts
1392
- var setEventEmit = (options) => {
1395
+ // src/@modules/@utilities/SetEventEmit.ts
1396
+ var SetEventEmit = (options) => {
1393
1397
  if (options.limited) {
1394
- const isTimeout = setTimeoutAction({ identifier: `event.${options.event}`, addTime: true, max: 1, interval: 1 });
1398
+ const isTimeout = SetTimeoutAction({ identifier: `event.${options.event}`, addTime: true, max: 1, interval: 1 });
1395
1399
  if (isTimeout.limited) return;
1396
1400
  }
1397
1401
  bootstrap.listener.emit(options.event, options.metadata);
@@ -1399,21 +1403,21 @@ var setEventEmit = (options) => {
1399
1403
  bootstrap.listener.emit(`*`, { event: options.event, data: options.metadata });
1400
1404
  }
1401
1405
  if (options.message) {
1402
- setWarning({ message: options.message });
1406
+ SetWarning({ message: options.message });
1403
1407
  }
1404
1408
  };
1405
1409
 
1406
- // src/@modules/@utilities/utilities.setListener.ts
1407
- var setListener = (options) => {
1410
+ // src/@modules/@utilities/SetListener.ts
1411
+ var SetListener = (options) => {
1408
1412
  bootstrap.listener.on(options.event, options.callback);
1409
1413
  return () => {
1410
1414
  void bootstrap.listener.off(options.event, options.callback);
1411
1415
  };
1412
1416
  };
1413
1417
 
1414
- // src/@core/core.createListener.ts
1415
- var createListener = (event, callback) => {
1416
- setListener({ event, callback });
1418
+ // src/@core/CreateListener.ts
1419
+ var CreateListener = (event, callback) => {
1420
+ SetListener({ event, callback });
1417
1421
  };
1418
1422
 
1419
1423
  // node_modules/@xmpp/xml/index.js
@@ -1802,20 +1806,20 @@ var jid_default = j;
1802
1806
 
1803
1807
  // node_modules/@xmpp/error/index.js
1804
1808
  var XMPPError = class extends Error {
1805
- constructor(condition, text2, application) {
1806
- super(condition + (text2 ? ` - ${text2}` : ""));
1809
+ constructor(condition, text, application) {
1810
+ super(condition + (text ? ` - ${text}` : ""));
1807
1811
  this.name = "XMPPError";
1808
1812
  this.condition = condition;
1809
- this.text = text2;
1813
+ this.text = text;
1810
1814
  this.application = application;
1811
1815
  }
1812
1816
  static fromElement(element) {
1813
1817
  const [condition, second, third] = element.getChildElements();
1814
- let text2;
1818
+ let text;
1815
1819
  let application;
1816
1820
  if (second) {
1817
1821
  if (second.is("text")) {
1818
- text2 = second;
1822
+ text = second;
1819
1823
  } else if (second) {
1820
1824
  application = second;
1821
1825
  }
@@ -1823,7 +1827,7 @@ var XMPPError = class extends Error {
1823
1827
  }
1824
1828
  const error = new this(
1825
1829
  condition.name,
1826
- text2 ? text2.text() : "",
1830
+ text ? text.text() : "",
1827
1831
  application
1828
1832
  );
1829
1833
  error.element = element;
@@ -2741,8 +2745,8 @@ function id() {
2741
2745
 
2742
2746
  // node_modules/@xmpp/middleware/lib/StanzaError.js
2743
2747
  var StanzaError = class extends error_default {
2744
- constructor(condition, text2, application, type) {
2745
- super(condition, text2, application);
2748
+ constructor(condition, text, application, type) {
2749
+ super(condition, text, application);
2746
2750
  this.type = type;
2747
2751
  this.name = "StanzaError";
2748
2752
  }
@@ -4171,8 +4175,8 @@ function setupIfAvailable(module, ...args) {
4171
4175
  return module(...args);
4172
4176
  }
4173
4177
 
4174
- // src/@modules/@xmpp/xmpp.xOnline.ts
4175
- var xOnline = () => {
4178
+ // src/@modules/@xmpp/OnlineXMPP.ts
4179
+ var OnlineXMPP = () => {
4176
4180
  const settings = bootstrap.settings;
4177
4181
  bootstrap.session_xmpp.on(`online`, (address) => __async(null, null, function* () {
4178
4182
  bootstrap.cache.sigHault = false;
@@ -4183,7 +4187,7 @@ var xOnline = () => {
4183
4187
  to: `nwws@conference.nwws-oi.weather.gov/${nickname}`,
4184
4188
  xmlns: "http://jabber.org/protocol/muc"
4185
4189
  }));
4186
- setEventEmit({
4190
+ SetEventEmit({
4187
4191
  event: `onServiceStatus`,
4188
4192
  metadata: {
4189
4193
  message: `Succesfully connected to NOAA Weather Wire Service as "${nickname}"`,
@@ -4196,12 +4200,12 @@ var xOnline = () => {
4196
4200
  }));
4197
4201
  };
4198
4202
 
4199
- // src/@modules/@xmpp/xmpp.xOffline.ts
4200
- var xOffline = () => {
4203
+ // src/@modules/@xmpp/OfflineXMPP.ts
4204
+ var OfflineXMPP = () => {
4201
4205
  bootstrap.session_xmpp.on(`offline`, () => __async(null, null, function* () {
4202
4206
  bootstrap.cache.isConnected = false;
4203
4207
  bootstrap.cache.sigHault = true;
4204
- setEventEmit({
4208
+ SetEventEmit({
4205
4209
  event: `onServiceStatus`,
4206
4210
  metadata: {
4207
4211
  message: `Client has gone offline`,
@@ -4213,16 +4217,16 @@ var xOffline = () => {
4213
4217
  }));
4214
4218
  };
4215
4219
 
4216
- // src/@modules/@xmpp/xmpp.xError.ts
4217
- var xError = () => {
4220
+ // src/@modules/@xmpp/ErrorXMPP.ts
4221
+ var ErrorXMPP = () => {
4218
4222
  bootstrap.session_xmpp.on(`error`, (error) => __async(null, null, function* () {
4219
4223
  bootstrap.cache.isConnected = false;
4220
4224
  bootstrap.cache.sigHault = true;
4221
4225
  }));
4222
4226
  };
4223
4227
 
4224
- // src/@dictionaries/dictionaries.expressions.ts
4225
- var dict_expressions = {
4228
+ // src/@enums/Expressions.ts
4229
+ var EnumExpressions = {
4226
4230
  location: new RegExp(/^([A-Za-z.\-' ]+),\s*([A-Z]{2})$/),
4227
4231
  pvtec: new RegExp(`[OTEX].(NEW|CON|EXT|EXA|EXB|UPG|CAN|EXP|COR|ROU).[A-Z]{4}.[A-Z]{2}.[WAYSFON].[0-9]{4}.[0-9]{6}T[0-9]{4}Z-[0-9]{6}T[0-9]{4}Z`, "g"),
4228
4232
  hvtec: new RegExp(`[a-zA-Z0-9]{4}.[A-Z0-9].[A-Z]{2}.[0-9]{6}T[0-9]{4}Z.[0-9]{6}T[0-9]{4}Z.[0-9]{6}T[0-9]{4}Z.[A-Z]{2}`, "imu"),
@@ -4233,372 +4237,375 @@ var dict_expressions = {
4233
4237
  dateline: new RegExp(`\\d{3,4}\\s*(AM|PM)?\\s*[A-Z]{2,4}\\s+[A-Z]{3,}\\s+[A-Z]{3,}\\s+\\d{1,2}\\s+\\d{4}`, "gim")
4234
4238
  };
4235
4239
 
4236
- // src/@dictionaries/dictionaries.awips.ts
4237
- var dict_awips = {
4238
- ABV: `rawinsonde-data-above-100-millibars`,
4239
- ADA: `alarm-alert-administrative-message`,
4240
- ADM: `alert-administrative-message`,
4241
- ADR: `nws-administrative-message`,
4242
- ADV: `space-environment-advisory`,
4243
- AFD: `area-forecast-discussion`,
4244
- AFM: `area-forecast-matrices`,
4245
- AFP: `area-forecast-product`,
4246
- AFW: `fire-weather-matrix`,
4247
- AGF: `agricultural-forecast`,
4248
- AGO: `agricultural-observations`,
4249
- ALT: `space-environment-alert`,
4250
- AQA: `air-quality-alert`,
4251
- AQI: `air-quality-index-statement`,
4252
- ASA: `air-stagnation-advisory`,
4253
- AVA: `avalanche-watch`,
4254
- AVG: `avalanche-weather-guidance`,
4255
- AVW: `avalanche-warning`,
4256
- AWO: `area-weather-outlook`,
4257
- AWS: `area-weather-summary`,
4258
- AWU: `area-weather-update`,
4259
- AWW: `airport-weather-warning`,
4260
- BLU: `blue-alert`,
4261
- BOY: `buoy-report`,
4262
- BRG: `coast-guard-observations`,
4263
- BRT: `hourly-roundup-for-weather-radio`,
4264
- CAE: `child-abduction-emergency`,
4265
- CCF: `coded-city-forecast`,
4266
- CDW: `civil-danger-warning`,
4267
- CEM: `civil-emergency-message`,
4268
- CF6: `monthly-daily-climate-data`,
4269
- CFP: `convective-forecast-product`,
4270
- CFW: `coastal-flood-warnings-watches-statements`,
4271
- CGR: `coast-guard-surface-report`,
4272
- CHG: `computer-hurricane-guidance`,
4273
- CLA: `climatological-report-annual`,
4274
- CLI: `climatological-report-daily`,
4275
- CLM: `climatological-report-monthly`,
4276
- CLQ: `climatological-report-quarterly`,
4277
- CLS: `climatological-report-seasonal`,
4278
- CLT: `climate-report`,
4279
- CMM: `coded-climatological-monthly-means`,
4280
- COD: `coded-analysis-and-forecasts`,
4281
- CPF: `great-lakes-port-forecast`,
4282
- CUR: `space-environment-products-routine`,
4283
- CWA: `center-weather-advisory`,
4284
- CWF: `coastal-waters-forecast`,
4285
- CWS: `center-weather-statement`,
4286
- DAY: `space-environment-product-daily`,
4287
- DDO: `daily-dispersion-outlook`,
4288
- DGT: `drought-information-statement`,
4289
- DMO: `practice-demo-warning`,
4290
- DSA: `unnumbered-depression-advisory`,
4291
- DSM: `asos-daily-summary`,
4292
- DSW: `dust-storm-warning`,
4293
- EFP: `extended-forecast-3-to-5-day`,
4294
- EOL: `six-to-ten-day-weather-outlook-local`,
4295
- EQI: `tsunami-bulletin`,
4296
- EQR: `earthquake-report`,
4297
- EQW: `earthquake-warning`,
4298
- ESF: `flood-potential-outlook`,
4299
- ESG: `extended-streamflow-guidance`,
4300
- ESP: `extended-streamflow-prediction`,
4301
- ESS: `water-supply-outlook`,
4302
- EVI: `evacuation-immediate`,
4303
- EWW: `extreme-wind-warning`,
4304
- FA0: `aviation-area-forecast-pacific`,
4305
- FA1: `aviation-area-forecast-northeast`,
4306
- FA2: `aviation-area-forecast-southeast`,
4307
- FA3: `aviation-area-forecast-north-central`,
4308
- FA4: `aviation-area-forecast-south-central`,
4309
- FA5: `aviation-area-forecast-rocky-mountains`,
4310
- FA6: `aviation-area-forecast-west-coast`,
4311
- FA7: `aviation-area-forecast-juneau-ak`,
4312
- FA8: `aviation-area-forecast-anchorage-ak`,
4313
- FA9: `aviation-area-forecast-fairbanks-ak`,
4314
- FD0: `winds-aloft-forecast-24hr-high-altitude`,
4315
- FD1: `winds-aloft-forecast-6hr`,
4316
- FD2: `winds-aloft-forecast-12hr`,
4317
- FD3: `winds-aloft-forecast-24hr`,
4318
- FD4: `winds-aloft-forecast`,
4319
- FD5: `winds-aloft-forecast`,
4320
- FD6: `winds-aloft-forecast`,
4321
- FD7: `winds-aloft-forecast`,
4322
- FD8: `winds-aloft-forecast-6hr-high-altitude`,
4323
- FD9: `winds-aloft-forecast-12hr-high-altitude`,
4324
- FDI: `fire-danger-indices`,
4325
- FFA: `flash-flood-watch`,
4326
- FFG: `flash-flood-guidance`,
4327
- FFH: `headwater-guidance`,
4328
- FFS: `flash-flood-statement`,
4329
- FFW: `flash-flood-warning`,
4330
- FLN: `national-flood-summary`,
4331
- FLS: `flood-statement`,
4332
- FLW: `flood-warning`,
4333
- FOF: `upper-wind-fallout-forecast`,
4334
- FRW: `fire-warning`,
4335
- FSH: `marine-fisheries-service-message`,
4336
- FTM: `radar-outage-notification`,
4337
- FTP: `temp-pop-guidance`,
4338
- FWA: `fire-weather-administrative-message`,
4339
- FWD: `fire-weather-outlook-discussion`,
4340
- FWF: `fire-weather-forecast`,
4341
- FWL: `land-management-forecast`,
4342
- FWM: `miscellaneous-fire-weather-product`,
4343
- FWN: `fire-weather-notification`,
4344
- FWO: `fire-weather-observation`,
4345
- FWS: `fire-weather-spot-forecast`,
4346
- FZL: `freezing-level-data`,
4347
- GLF: `great-lakes-forecast`,
4348
- GLS: `great-lakes-storm-summary`,
4349
- GRE: `green`,
4350
- HD1: `rfc-qpf-data-product`,
4351
- HD2: `rfc-qpf-data-product`,
4352
- HD3: `rfc-qpf-data-product`,
4353
- HD4: `rfc-qpf-data-product`,
4354
- HD7: `rfc-qpf-data-product`,
4355
- HD8: `rfc-qpf-data-product`,
4356
- HD9: `rfc-qpf-data-product`,
4357
- HLS: `hurricane-local-statement`,
4358
- HMD: `hydrometeorological-discussion`,
4359
- HML: `ahps-xml-product`,
4360
- HMW: `hazardous-materials-warning`,
4361
- HP1: `rfc-qpf-verification-product`,
4362
- HP2: `rfc-qpf-verification-product`,
4363
- HP3: `rfc-qpf-verification-product`,
4364
- HP4: `rfc-qpf-verification-product`,
4365
- HP5: `rfc-qpf-verification-product`,
4366
- HP6: `rfc-qpf-verification-product`,
4367
- HP7: `rfc-qpf-verification-product`,
4368
- HP8: `rfc-qpf-verification-product`,
4369
- HRR: `weather-roundup`,
4370
- HSF: `high-seas-forecast`,
4371
- HWO: `hazardous-weather-outlook`,
4372
- HWR: `hourly-weather-roundup`,
4373
- HYD: `daily-hydrometeorological-products`,
4374
- HYM: `monthly-hydrometeorological-product`,
4375
- ICE: `ice-forecast`,
4376
- IDM: `ice-drift-vectors`,
4377
- INI: `administrative-message`,
4378
- IOB: `ice-observation`,
4379
- KPA: `keep-alive-message`,
4380
- LAE: `local-area-emergency`,
4381
- LCD: `preliminary-local-climatological-data`,
4382
- LCO: `local-cooperative-observation`,
4383
- LEW: `law-enforcement-warning`,
4384
- LFP: `local-forecast`,
4385
- LKE: `lake-stages`,
4386
- LLS: `low-level-sounding`,
4387
- LOW: `low-temperatures`,
4388
- LSR: `local-storm-report`,
4389
- LTG: `lightning-data`,
4390
- MAN: `rawinsonde-mandatory-levels`,
4391
- MAP: `mean-areal-precipitation`,
4392
- MAW: `amended-marine-forecast`,
4393
- MFM: `marine-forecast-matrix`,
4394
- MIM: `marine-interpretation-message`,
4395
- MIS: `miscellaneous-local-product`,
4396
- MOB: `marine-observations`,
4397
- MON: `space-environment-product-monthly`,
4398
- MRP: `marine-product-techniques-development`,
4399
- MSM: `asos-monthly-summary-message`,
4400
- MTR: `metar-observation`,
4401
- MTT: `metar-test-message`,
4402
- MVF: `marine-verification-coded-message`,
4403
- MWS: `marine-weather-statement`,
4404
- MWW: `marine-weather-message`,
4405
- NOU: `weather-reconnaissance-flights`,
4406
- NOW: `short-term-forecast`,
4407
- NOX: `data-management-message`,
4408
- NPW: `non-precipitation-warning`,
4409
- NSH: `nearshore-marine-forecast`,
4410
- NUW: `nuclear-power-plant-warning`,
4411
- NWR: `noaa-weather-radio-forecast`,
4412
- OAV: `other-aviation-products`,
4413
- OBS: `observations`,
4414
- OFA: `offshore-aviation-forecast`,
4415
- OFF: `offshore-forecast`,
4416
- OMR: `other-marine-products`,
4417
- OPU: `other-public-products`,
4418
- OSO: `other-surface-observations`,
4419
- OSW: `ocean-surface-winds`,
4420
- OUA: `other-upper-air-data`,
4421
- OZF: `zone-forecast`,
4422
- PFM: `point-forecast-matrices`,
4423
- PFW: `fire-weather-point-forecast-matrices`,
4424
- PLS: `plain-language-ship-report`,
4425
- PMD: `prognostic-meteorological-discussion`,
4426
- PNS: `public-information-statement`,
4427
- POE: `probability-of-exceedance`,
4428
- PRB: `heat-index-forecast-tables`,
4429
- PRC: `pilot-report-collective`,
4430
- PRE: `preliminary-forecasts`,
4431
- PSH: `post-storm-hurricane-report`,
4432
- PTS: `probabilistic-outlook-points`,
4433
- PWO: `public-severe-weather-outlook`,
4434
- PWS: `tropical-cyclone-probabilities`,
4435
- QPF: `quantitative-precipitation-forecast`,
4436
- QPS: `quantitative-precipitation-statement`,
4437
- RDF: `revised-digital-forecast`,
4438
- REC: `recreational-report`,
4439
- RER: `record-report`,
4440
- RET: `eas-activation-request`,
4441
- RFD: `rangeland-fire-danger-forecast`,
4442
- RFI: `rfi-observation`,
4443
- RFR: `route-forecast`,
4444
- RFW: `red-flag-warning`,
4445
- RHW: `radiological-hazard-warning`,
4446
- RMT: `required-monthly-test`,
4447
- RNS: `rain-information-statement`,
4448
- RR1: `hydro-met-data-report-part-1`,
4449
- RR2: `hydro-met-data-report-part-2`,
4450
- RR3: `hydro-met-data-report-part-3`,
4451
- RR4: `hydro-met-data-report-part-4`,
4452
- RR5: `hydro-met-data-report-part-5`,
4453
- RR6: `hydro-met-data-report-part-6`,
4454
- RR7: `hydro-met-data-report-part-7`,
4455
- RR8: `hydro-met-data-report-part-8`,
4456
- RR9: `hydro-met-data-report-part-9`,
4457
- RRA: `automated-hydrologic-observation-report`,
4458
- RRM: `miscellaneous-hydrologic-data`,
4459
- RRS: `hads-data`,
4460
- RRY: `asos-hourly-test-message`,
4461
- RSD: `daily-snotel-data`,
4462
- RSM: `monthly-snotel-data`,
4463
- RTP: `regional-temp-precip-table`,
4464
- RVA: `river-summary`,
4465
- RVD: `daily-river-forecast`,
4466
- RVF: `river-forecast`,
4467
- RVI: `river-ice-statement`,
4468
- RVM: `miscellaneous-river-product`,
4469
- RVR: `river-recreation-statement`,
4470
- RVS: `river-statement`,
4471
- RWR: `regional-weather-roundup`,
4472
- RWS: `regional-weather-summary`,
4473
- RWT: `required-weekly-test`,
4474
- SAB: `special-avalanche-bulletin`,
4475
- SAF: `agricultural-weather-forecast`,
4476
- SAG: `snow-avalanche-guidance`,
4477
- SAT: `apt-prediction`,
4478
- SAW: `preliminary-notice-of-watch`,
4479
- SCC: `storm-summary`,
4480
- SCD: `supplementary-climatological-data`,
4481
- SCN: `soil-climate-analysis-network`,
4482
- SCP: `satellite-cloud-product`,
4483
- SCS: `selected-cities-summary`,
4484
- SDO: `supplementary-data-observation`,
4485
- SDS: `special-dispersion-statement`,
4486
- SEL: `severe-local-storm-watch`,
4487
- SEV: `spc-watch-point-information`,
4488
- SFP: `state-forecast`,
4489
- SFT: `tabular-state-forecast`,
4490
- SGL: `rawinsonde-significant-levels`,
4491
- SHP: `surface-ship-report`,
4492
- SIG: `international-sigmet`,
4493
- SIM: `satellite-interpretation-message`,
4494
- SLS: `severe-local-storm-outline`,
4495
- SMF: `smoke-management-weather-forecast`,
4496
- SMW: `special-marine-warning`,
4497
- SOO: `science-operations-officer-product`,
4498
- SPE: `satellite-precipitation-estimates`,
4499
- SPF: `storm-strike-probability-bulletin`,
4500
- SPS: `special-weather-statement`,
4501
- SPW: `shelter-in-place-warning`,
4502
- SQW: `snow-squall-warning`,
4503
- SRD: `surf-discussion`,
4504
- SRF: `surf-forecast`,
4505
- SRG: `soaring-guidance`,
4506
- SSM: `synoptic-surface-observation`,
4507
- STA: `weather-statistical-summary`,
4508
- STD: `satellite-tropical-disturbance-summary`,
4509
- STO: `road-condition-report`,
4510
- STP: `state-temp-precip-table`,
4511
- STQ: `spot-forecast-request`,
4512
- SUM: `space-weather-message`,
4513
- SVR: `severe-thunderstorm-warning`,
4514
- SVS: `severe-weather-statement`,
4515
- SWOMCD: `mesoscale-discussion`,
4516
- SWODY1: `storm-prediction-center-day-1-outlook`,
4517
- SWODY2: `storm-prediction-center-day-2-outlook`,
4518
- SWODY3: `storm-prediction-center-day-3-outlook`,
4519
- SWS: `state-weather-summary`,
4520
- SYN: `regional-weather-synopsis`,
4521
- TAF: `terminal-aerodrome-forecast`,
4522
- TAP: `terminal-alerting-products`,
4523
- TAV: `travelers-forecast-table`,
4524
- TCA: `tropical-cyclone-advisory`,
4525
- TCD: `tropical-cyclone-discussion`,
4526
- TCE: `tropical-cyclone-position-estimate`,
4527
- TCM: `tropical-cyclone-marine-aviation-advisory`,
4528
- TCP: `public-tropical-cyclone-advisory`,
4529
- TCS: `satellite-tropical-cyclone-summary`,
4530
- TCU: `tropical-cyclone-update`,
4531
- TCV: `tropical-cyclone-break-points`,
4532
- TIB: `tsunami-bulletin`,
4533
- TID: `tide-report`,
4534
- TMA: `tsunami-tide-seismic-acknowledgement`,
4535
- TOE: `telephone-outage-emergency`,
4536
- TOR: `tornado-warning`,
4537
- TPT: `temperature-precipitation-table`,
4538
- TSU: `tsunami-information-statement`,
4539
- TUV: `ultraviolet-index`,
4540
- TVL: `travelers-forecast`,
4541
- TWB: `transcribed-weather-broadcast`,
4542
- TWD: `tropical-weather-discussion`,
4543
- TWO: `tropical-weather-outlook`,
4544
- TWS: `tropical-weather-summary`,
4545
- URN: `aircraft-reconnaissance`,
4546
- UVI: `ultraviolet-index`,
4547
- VAA: `volcanic-activity-advisory`,
4548
- VER: `forecast-verification-statistics`,
4549
- VFT: `taf-verification-product`,
4550
- VOW: `volcano-warning`,
4551
- WA0: `airmet-pacific`,
4552
- WA1: `airmet-northeast`,
4553
- WA2: `airmet-southeast`,
4554
- WA3: `airmet-north-central`,
4555
- WA4: `airmet-south-central`,
4556
- WA5: `airmet-rocky-mountains`,
4557
- WA6: `airmet-west-coast`,
4558
- WA7: `airmet-juneau-ak`,
4559
- WA8: `airmet-anchorage-ak`,
4560
- WA9: `airmet-fairbanks-ak`,
4561
- WAR: `space-environment-warning`,
4562
- WAT: `space-environment-watch`,
4563
- WCN: `weather-watch-clearance-notification`,
4564
- WCR: `weekly-weather-and-crop-report`,
4565
- WDA: `weekly-data-for-agriculture`,
4566
- WDU: `warning-decision-update`,
4567
- WEK: `space-environment-product-weekly`,
4568
- WOU: `watch-outline-update`,
4569
- WS1: `sigmet-northeast`,
4570
- WS2: `sigmet-southeast`,
4571
- WS3: `sigmet-north-central`,
4572
- WS4: `sigmet-south-central`,
4573
- WS5: `sigmet-rocky-mountains`,
4574
- WS6: `sigmet-west-coast`,
4575
- WST: `tropical-cyclone-sigmet`,
4576
- WSV: `volcanic-activity-sigmet`,
4577
- WSW: `winter-weather-warning`,
4578
- WWA: `watch-status-report`,
4579
- WWP: `watch-probabilities`,
4580
- ZFP: `zone-forecast-product`
4240
+ // src/@enums/AWIPS.ts
4241
+ var EnumAWIPS = {
4242
+ ABV: `Rawinsonde Data Above 100 Millibars`,
4243
+ ADA: `Alarm Alert Administrative Message`,
4244
+ ADM: `Alert Administrative Message`,
4245
+ ADR: `NWS Administrative Message`,
4246
+ ADV: `Space Environment Advisory`,
4247
+ AFD: `Area Forecast Discussion`,
4248
+ AFM: `Area Forecast Matrices`,
4249
+ AFP: `Area Forecast Product`,
4250
+ AFW: `Fire Weather Matrix`,
4251
+ AGF: `Agricultural Forecast`,
4252
+ AGO: `Agricultural Observations`,
4253
+ ALT: `Space Environment Alert`,
4254
+ AQA: `Air Quality Alert`,
4255
+ AQI: `Air Quality Index Statement`,
4256
+ ASA: `Air Stagnation Advisory`,
4257
+ AVA: `Avalanche Watch`,
4258
+ AVG: `Avalanche Weather Guidance`,
4259
+ AVW: `Avalanche Warning`,
4260
+ AWO: `Area Weather Outlook`,
4261
+ AWS: `Area Weather Summary`,
4262
+ AWU: `Area Weather Update`,
4263
+ AWW: `Airport Weather Warning`,
4264
+ BLU: `Blue Alert`,
4265
+ BOY: `Buoy Report`,
4266
+ BRG: `Coast Guard Observations`,
4267
+ BRT: `Hourly Roundup for Weather Radio`,
4268
+ CAE: `Child Abduction Emergency`,
4269
+ CCF: `Coded City Forecast`,
4270
+ CDW: `Civil Danger Warning`,
4271
+ CEM: `Civil Emergency Message`,
4272
+ CF6: `Monthly Daily Climate Data`,
4273
+ CFP: `Convective Forecast Product`,
4274
+ CFW: `Coastal Flood Warnings, Watches, and Statements`,
4275
+ CGR: `Coast Guard Surface Report`,
4276
+ CHG: `Computer Hurricane Guidance`,
4277
+ CLA: `Climatological Report Annual`,
4278
+ CLI: `Climatological Report Daily`,
4279
+ CLM: `Climatological Report Monthly`,
4280
+ CLQ: `Climatological Report Quarterly`,
4281
+ CLS: `Climatological Report Seasonal`,
4282
+ CLT: `Climate Report`,
4283
+ CMM: `Coded Climatological Monthly Means`,
4284
+ COD: `Coded Analysis and Forecasts`,
4285
+ CPF: `Great Lakes Port Forecast`,
4286
+ CUR: `Space Environment Products Routine`,
4287
+ CWA: `Center Weather Advisory`,
4288
+ CWF: `Coastal Waters Forecast`,
4289
+ CWS: `Center Weather Statement`,
4290
+ DAY: `Space Environment Product Daily`,
4291
+ DDO: `Daily Dispersion Outlook`,
4292
+ DGT: `Drought Information Statement`,
4293
+ DMO: `Practice Demo Warning`,
4294
+ DSA: `Unnumbered Depression Advisory`,
4295
+ DSM: `ASOS Daily Summary`,
4296
+ DSW: `Dust Storm Warning`,
4297
+ EFP: `Extended Forecast (3 to 5 Day)`,
4298
+ EOL: `Six to Ten Day Weather Outlook (Local)`,
4299
+ EQI: `Tsunami Bulletin`,
4300
+ EQR: `Earthquake Report`,
4301
+ EQW: `Earthquake Warning`,
4302
+ ESF: `Flood Potential Outlook`,
4303
+ ESG: `Extended Streamflow Guidance`,
4304
+ ESP: `Extended Streamflow Prediction`,
4305
+ ESS: `Water Supply Outlook`,
4306
+ EVI: `Evacuation Immediate`,
4307
+ EWW: `Extreme Wind Warning`,
4308
+ FA0: `Aviation Area Forecast (Pacific)`,
4309
+ FA1: `Aviation Area Forecast (Northeast)`,
4310
+ FA2: `Aviation Area Forecast (Southeast)`,
4311
+ FA3: `Aviation Area Forecast (North Central)`,
4312
+ FA4: `Aviation Area Forecast (South Central)`,
4313
+ FA5: `Aviation Area Forecast (Rocky Mountains)`,
4314
+ FA6: `Aviation Area Forecast (West Coast)`,
4315
+ FA7: `Aviation Area Forecast (Juneau, AK)`,
4316
+ FA8: `Aviation Area Forecast (Anchorage, AK)`,
4317
+ FA9: `Aviation Area Forecast (Fairbanks, AK)`,
4318
+ FD0: `Winds Aloft Forecast (24-Hour High Altitude)`,
4319
+ FD1: `Winds Aloft Forecast (6-Hour)`,
4320
+ FD2: `Winds Aloft Forecast (12-Hour)`,
4321
+ FD3: `Winds Aloft Forecast (24-Hour)`,
4322
+ FD4: `Winds Aloft Forecast`,
4323
+ FD5: `Winds Aloft Forecast`,
4324
+ FD6: `Winds Aloft Forecast`,
4325
+ FD7: `Winds Aloft Forecast`,
4326
+ FD8: `Winds Aloft Forecast (6-Hour High Altitude)`,
4327
+ FD9: `Winds Aloft Forecast (12-Hour High Altitude)`,
4328
+ FDI: `Fire Danger Indices`,
4329
+ FFA: `Flash Flood Watch`,
4330
+ FFG: `Flash Flood Guidance`,
4331
+ FFH: `Headwater Guidance`,
4332
+ FFS: `Flash Flood Statement`,
4333
+ FFW: `Flash Flood Warning`,
4334
+ FLN: `National Flood Summary`,
4335
+ FLS: `Flood Statement`,
4336
+ FLW: `Flood Warning`,
4337
+ FOF: `Upper Wind Fallout Forecast`,
4338
+ FRW: `Fire Warning`,
4339
+ FSH: `Marine Fisheries Service Message`,
4340
+ FTM: `Radar Outage Notification`,
4341
+ FTP: `Temp POP Guidance`,
4342
+ FWA: `Fire Weather Administrative Message`,
4343
+ FWD: `Fire Weather Outlook Discussion`,
4344
+ FWF: `Fire Weather Forecast`,
4345
+ FWL: `Land Management Forecast`,
4346
+ FWM: `Miscellaneous Fire Weather Product`,
4347
+ FWN: `Fire Weather Notification`,
4348
+ FWO: `Fire Weather Observation`,
4349
+ FWS: `Fire Weather Spot Forecast`,
4350
+ FZL: `Freezing Level Data`,
4351
+ GLF: `Great Lakes Forecast`,
4352
+ GLS: `Great Lakes Storm Summary`,
4353
+ GRE: `Green`,
4354
+ HD1: `RFC QPF Data Product`,
4355
+ HD2: `RFC QPF Data Product`,
4356
+ HD3: `RFC QPF Data Product`,
4357
+ HD4: `RFC QPF Data Product`,
4358
+ HD7: `RFC QPF Data Product`,
4359
+ HD8: `RFC QPF Data Product`,
4360
+ HD9: `RFC QPF Data Product`,
4361
+ HLS: `Hurricane Local Statement`,
4362
+ HMD: `Hydrometeorological Discussion`,
4363
+ HML: `AHPS XML Product`,
4364
+ HMW: `Hazardous Materials Warning`,
4365
+ HP1: `RFC QPF Verification Product`,
4366
+ HP2: `RFC QPF Verification Product`,
4367
+ HP3: `RFC QPF Verification Product`,
4368
+ HP4: `RFC QPF Verification Product`,
4369
+ HP5: `RFC QPF Verification Product`,
4370
+ HP6: `RFC QPF Verification Product`,
4371
+ HP7: `RFC QPF Verification Product`,
4372
+ HP8: `RFC QPF Verification Product`,
4373
+ HRR: `Weather Roundup`,
4374
+ HSF: `High Seas Forecast`,
4375
+ HWO: `Hazardous Weather Outlook`,
4376
+ HWR: `Hourly Weather Roundup`,
4377
+ HYD: `Daily Hydrometeorological Products`,
4378
+ HYM: `Monthly Hydrometeorological Product`,
4379
+ ICE: `Ice Forecast`,
4380
+ IDM: `Ice Drift Vectors`,
4381
+ INI: `Administrative Message`,
4382
+ IOB: `Ice Observation`,
4383
+ KPA: `Keep Alive Message`,
4384
+ LAE: `Local Area Emergency`,
4385
+ LCD: `Preliminary Local Climatological Data`,
4386
+ LCO: `Local Cooperative Observation`,
4387
+ LEW: `Law Enforcement Warning`,
4388
+ LFP: `Local Forecast`,
4389
+ LKE: `Lake Stages`,
4390
+ LLS: `Low Level Sounding`,
4391
+ LOW: `Low Temperatures`,
4392
+ LSR: `Local Storm Report`,
4393
+ LTG: `Lightning Data`,
4394
+ MAN: `Rawinsonde Mandatory Levels`,
4395
+ MAP: `Mean Areal Precipitation`,
4396
+ MAW: `Amended Marine Forecast`,
4397
+ MFM: `Marine Forecast Matrix`,
4398
+ MIM: `Marine Interpretation Message`,
4399
+ MIS: `Miscellaneous Local Product`,
4400
+ MOB: `Marine Observations`,
4401
+ MON: `Space Environment Product Monthly`,
4402
+ MRP: `Marine Product Techniques Development`,
4403
+ MSM: `ASOS Monthly Summary Message`,
4404
+ MTR: `METAR Observation`,
4405
+ MTT: `METAR Test Message`,
4406
+ MVF: `Marine Verification Coded Message`,
4407
+ MWS: `Marine Weather Statement`,
4408
+ MWW: `Marine Weather Message`,
4409
+ NOU: `Weather Reconnaissance Flights`,
4410
+ NOW: `Short-Term Forecast`,
4411
+ NOX: `Data Management Message`,
4412
+ NPW: `Non-Precipitation Warning`,
4413
+ NSH: `Nearshore Marine Forecast`,
4414
+ NUW: `Nuclear Power Plant Warning`,
4415
+ NWR: `NOAA Weather Radio Forecast`,
4416
+ OAV: `Other Aviation Products`,
4417
+ OBS: `Observations`,
4418
+ OFA: `Offshore Aviation Forecast`,
4419
+ OFF: `Offshore Forecast`,
4420
+ OMR: `Other Marine Products`,
4421
+ OPU: `Other Public Products`,
4422
+ OSO: `Other Surface Observations`,
4423
+ OSW: `Ocean Surface Winds`,
4424
+ OUA: `Other Upper Air Data`,
4425
+ OZF: `Zone Forecast`,
4426
+ PFM: `Point Forecast Matrices`,
4427
+ PFW: `Fire Weather Point Forecast Matrices`,
4428
+ PLS: `Plain Language Ship Report`,
4429
+ PMD: `Prognostic Meteorological Discussion`,
4430
+ PNS: `Public Information Statement`,
4431
+ POE: `Probability of Exceedance`,
4432
+ PRB: `Heat Index Forecast Tables`,
4433
+ PRC: `Pilot Report Collective`,
4434
+ PRE: `Preliminary Forecasts`,
4435
+ PSH: `Post-Storm Hurricane Report`,
4436
+ PTS: `Probabilistic Outlook Points`,
4437
+ AAG: `Aviation Area Forecast`,
4438
+ PWO: `Public Severe Weather Outlook`,
4439
+ PWS: `Tropical Cyclone Probabilities`,
4440
+ QPF: `Quantitative Precipitation Forecast`,
4441
+ QPS: `Quantitative Precipitation Statement`,
4442
+ RDF: `Revised Digital Forecast`,
4443
+ REC: `Recreational Report`,
4444
+ RER: `Record Report`,
4445
+ RET: `EAS Activation Request`,
4446
+ RFD: `Rangeland Fire Danger Forecast`,
4447
+ RFI: `RFI Observation`,
4448
+ RFR: `Route Forecast`,
4449
+ RFW: `Red Flag Warning`,
4450
+ RHW: `Radiological Hazard Warning`,
4451
+ RMT: `Required Monthly Test`,
4452
+ RNS: `Rain Information Statement`,
4453
+ RR1: `Hydro-Met Data Report Part 1`,
4454
+ RR2: `Hydro-Met Data Report Part 2`,
4455
+ RR3: `Hydro-Met Data Report Part 3`,
4456
+ RR4: `Hydro-Met Data Report Part 4`,
4457
+ RR5: `Hydro-Met Data Report Part 5`,
4458
+ RR6: `Hydro-Met Data Report Part 6`,
4459
+ RR7: `Hydro-Met Data Report Part 7`,
4460
+ RR8: `Hydro-Met Data Report Part 8`,
4461
+ RR9: `Hydro-Met Data Report Part 9`,
4462
+ RRA: `Automated Hydrologic Observation Report`,
4463
+ RRM: `Miscellaneous Hydrologic Data`,
4464
+ RRS: `HADS Data`,
4465
+ RRY: `ASOS Hourly Test Message`,
4466
+ RSD: `Daily SNOTEL Data`,
4467
+ RSM: `Monthly SNOTEL Data`,
4468
+ RTP: `Regional Temperature and Precipitation Table`,
4469
+ RVA: `River Summary`,
4470
+ RVD: `Daily River Forecast`,
4471
+ RVF: `River Forecast`,
4472
+ RVI: `River Ice Statement`,
4473
+ RVM: `Miscellaneous River Product`,
4474
+ RVR: `River Recreation Statement`,
4475
+ RVS: `River Statement`,
4476
+ RWR: `Regional Weather Roundup`,
4477
+ RWS: `Regional Weather Summary`,
4478
+ RWT: `Required Weekly Test`,
4479
+ SAB: `Special Avalanche Bulletin`,
4480
+ SAF: `Agricultural Weather Forecast`,
4481
+ SAG: `Snow Avalanche Guidance`,
4482
+ SAT: `APT Prediction`,
4483
+ SAW: `Preliminary Notice of Watch`,
4484
+ SCC: `Storm Summary`,
4485
+ SCD: `Supplementary Climatological Data`,
4486
+ SCN: `Soil Climate Analysis Network`,
4487
+ SCP: `Satellite Cloud Product`,
4488
+ SCS: `Selected Cities Summary`,
4489
+ SDO: `Supplementary Data Observation`,
4490
+ SDS: `Special Dispersion Statement`,
4491
+ SEL: `Severe Local Storm Watch`,
4492
+ SEV: `SPC Watch Point Information`,
4493
+ SFP: `State Forecast`,
4494
+ SFT: `Tabular State Forecast`,
4495
+ SGL: `Rawinsonde Significant Levels`,
4496
+ SHP: `Surface Ship Report`,
4497
+ SIG: `International SIGMET`,
4498
+ SIM: `Satellite Interpretation Message`,
4499
+ SLS: `Severe Local Storm Outline`,
4500
+ SMF: `Smoke Management Weather Forecast`,
4501
+ SMW: `Special Marine Warning`,
4502
+ SOO: `Science Operations Officer Product`,
4503
+ SPE: `Satellite Precipitation Estimates`,
4504
+ SPF: `Storm Strike Probability Bulletin`,
4505
+ SPS: `Special Weather Statement`,
4506
+ SPW: `Shelter in Place Warning`,
4507
+ SQW: `Snow Squall Warning`,
4508
+ SRD: `Surf Discussion`,
4509
+ SRF: `Surf Forecast`,
4510
+ SRG: `Soaring Guidance`,
4511
+ SSM: `Synoptic Surface Observation`,
4512
+ STA: `Weather Statistical Summary`,
4513
+ STD: `Satellite Tropical Disturbance Summary`,
4514
+ STO: `Road Condition Report`,
4515
+ STP: `State Temperature and Precipitation Table`,
4516
+ STQ: `Spot Forecast Request`,
4517
+ SUM: `Space Weather Message`,
4518
+ SVR: `Severe Thunderstorm Warning`,
4519
+ SVS: `Severe Weather Statement`,
4520
+ SWOMCD: `Mesoscale Discussion`,
4521
+ SWODY1: `Storm Prediction Center Day 1 Outlook`,
4522
+ SWODY2: `Storm Prediction Center Day 2 Outlook`,
4523
+ SWODY3: `Storm Prediction Center Day 3 Outlook`,
4524
+ SWOD48: `Storm Prediction Center Day 4 to 8 Outlook`,
4525
+ SWS: `State Weather Summary`,
4526
+ SYN: `Regional Weather Synopsis`,
4527
+ TAF: `Terminal Aerodrome Forecast`,
4528
+ TAP: `Terminal Alerting Products`,
4529
+ TAV: `Travelers Forecast Table`,
4530
+ TCA: `Tropical Cyclone Advisory`,
4531
+ TCD: `Tropical Cyclone Discussion`,
4532
+ TCE: `Tropical Cyclone Position Estimate`,
4533
+ TCM: `Tropical Cyclone Marine Aviation Advisory`,
4534
+ TCP: `Public Tropical Cyclone Advisory`,
4535
+ TCS: `Satellite Tropical Cyclone Summary`,
4536
+ TCU: `Tropical Cyclone Update`,
4537
+ TCV: `Tropical Cyclone Break Points`,
4538
+ TIB: `Tsunami Bulletin`,
4539
+ TID: `Tide Report`,
4540
+ TMA: `Tsunami Tide Seismic Acknowledgement`,
4541
+ TOE: `Telephone Outage Emergency`,
4542
+ TOR: `Tornado Warning`,
4543
+ TPT: `Temperature Precipitation Table`,
4544
+ TSU: `Tsunami Information Statement`,
4545
+ TUV: `Ultraviolet Index`,
4546
+ TVL: `Travelers Forecast`,
4547
+ TWB: `Transcribed Weather Broadcast`,
4548
+ TWD: `Tropical Weather Discussion`,
4549
+ TWO: `Tropical Weather Outlook`,
4550
+ TWS: `Tropical Weather Summary`,
4551
+ URN: `Aircraft Reconnaissance`,
4552
+ UVI: `Ultraviolet Index`,
4553
+ VAA: `Volcanic Activity Advisory`,
4554
+ VER: `Forecast Verification Statistics`,
4555
+ VFT: `TAF Verification Product`,
4556
+ VOW: `Volcano Warning`,
4557
+ WA0: `AIRMET Pacific`,
4558
+ WA1: `AIRMET Northeast`,
4559
+ WA2: `AIRMET Southeast`,
4560
+ WA3: `AIRMET North Central`,
4561
+ WA4: `AIRMET South Central`,
4562
+ WA5: `AIRMET Rocky Mountains`,
4563
+ WA6: `AIRMET West Coast`,
4564
+ WA7: `AIRMET Juneau, AK`,
4565
+ WA8: `AIRMET Anchorage, AK`,
4566
+ WA9: `AIRMET Fairbanks, AK`,
4567
+ WAR: `Space Environment Warning`,
4568
+ WAT: `Space Environment Watch`,
4569
+ WCN: `Weather Watch Clearance Notification`,
4570
+ WCR: `Weekly Weather and Crop Report`,
4571
+ WDA: `Weekly Data for Agriculture`,
4572
+ WDU: `Warning Decision Update`,
4573
+ WEK: `Space Environment Product Weekly`,
4574
+ WOU: `Watch Outline Update`,
4575
+ WS1: `SIGMET Northeast`,
4576
+ WS2: `SIGMET Southeast`,
4577
+ WS3: `SIGMET North Central`,
4578
+ WS4: `SIGMET South Central`,
4579
+ WS5: `SIGMET Rocky Mountains`,
4580
+ WS6: `SIGMET West Coast`,
4581
+ WST: `Tropical Cyclone SIGMET`,
4582
+ WSV: `Volcanic Activity SIGMET`,
4583
+ WSW: `Winter Weather Warning`,
4584
+ WWA: `Watch Status Report`,
4585
+ WWP: `Watch Probabilities`,
4586
+ ZFP: `Zone Forecast Product`
4581
4587
  };
4582
4588
 
4583
- // src/@modules/@stanza/stanza.getAwipsType.ts
4584
- var getAwipsType = (options) => {
4589
+ // src/@modules/@stanza/GetAwipsType.ts
4590
+ var GetAwipsType = (options) => {
4585
4591
  const attributes = options.attributes;
4586
4592
  if (!attributes.awipsid) {
4587
4593
  return {
4588
4594
  type: null,
4589
- prefix: null
4595
+ prefix: null,
4596
+ discovered: false
4590
4597
  };
4591
4598
  }
4592
- for (const [prefix, type] of Object.entries(dict_awips)) {
4599
+ for (const [prefix, type] of Object.entries(EnumAWIPS)) {
4593
4600
  if (attributes.awipsid.startsWith(prefix)) {
4594
- return { type, prefix };
4601
+ return { type, prefix, discovered: true };
4595
4602
  }
4596
4603
  }
4597
- return { type: null, prefix: null };
4604
+ return { type: options.attributes.awipsid, prefix: options.attributes.awipsid, discovered: false };
4598
4605
  };
4599
4606
 
4600
- // src/@modules/@stanza/stanza.validate.ts
4601
- var validate = (options) => {
4607
+ // src/@modules/@stanza/ValidateStanza.ts
4608
+ var ValidateStanza = (options) => {
4602
4609
  if (options.stanza.is(`message`)) {
4603
4610
  const cb = options.stanza.getChild(`x`);
4604
4611
  if (cb && cb.children) {
@@ -4607,9 +4614,9 @@ var validate = (options) => {
4607
4614
  if (attributes.awipsid && attributes.awipsid.length > 1) {
4608
4615
  const isCapEvent = message.includes(`<?xml`);
4609
4616
  const isCapAreaDescription = message.includes(`<areaDesc>`);
4610
- const isVTEC = message.match(dict_expressions.pvtec) != null;
4611
- const isUGC = message.match(dict_expressions.ugc1) != null;
4612
- const getType = getAwipsType({ attributes });
4617
+ const isVTEC = message.match(EnumExpressions.pvtec) != null;
4618
+ const isUGC = message.match(EnumExpressions.ugc1) != null;
4619
+ const getType = GetAwipsType({ attributes });
4613
4620
  if (getType.type != null) {
4614
4621
  return {
4615
4622
  message,
@@ -4629,8 +4636,8 @@ var validate = (options) => {
4629
4636
  return { isIgnored: true };
4630
4637
  };
4631
4638
 
4632
- // src/@dictionaries/dictionaries.matches.ts
4633
- var dict_matches = {
4639
+ // src/@enums/Matches.ts
4640
+ var EnumMatches = {
4634
4641
  SPS: [
4635
4642
  { match: /STRONG THUNDERSTORM/i, label: "Convective Special Weather Statement", statement: false },
4636
4643
  { match: /SPECIAL WEATHER STATEMENT/i, label: "Special Weather Statement", statement: false }
@@ -4666,15 +4673,20 @@ var dict_matches = {
4666
4673
  ]
4667
4674
  };
4668
4675
 
4669
- // src/@parsers/@text/text.getDescriptionFromProduct.ts
4670
- var getDescriptionFromProduct = (options) => {
4676
+ // src/@parsers/@text/GetDescriptionFromProduct.ts
4677
+ var GetDescriptionFromProduct = (options) => {
4671
4678
  let message = options.message;
4672
- const dates = Array.from(message.matchAll(dict_expressions.dateline));
4679
+ const predefinedEndMarkers = ["&&", "LAT..."];
4680
+ const getEndIndex = (text, fromIndex = 0) => {
4681
+ const indices = predefinedEndMarkers.map((marker) => text.indexOf(marker, fromIndex)).filter((idx) => idx !== -1);
4682
+ return indices.length ? Math.min(...indices) : -1;
4683
+ };
4684
+ const dates = Array.from(message.matchAll(EnumExpressions.dateline));
4673
4685
  if (dates.length) {
4674
4686
  const lastMatch = dates[dates.length - 1][0];
4675
4687
  const sIndx = message.lastIndexOf(lastMatch);
4676
4688
  if (sIndx !== -1) {
4677
- const endIndx = message.indexOf("&&", sIndx);
4689
+ const endIndx = getEndIndex(message, sIndx);
4678
4690
  message = message.substring(sIndx + lastMatch.length, endIndx !== -1 ? endIndx : void 0).trimStart();
4679
4691
  if (message.startsWith("/")) message = message.slice(1).trimStart();
4680
4692
  if (options.handle && message.includes(options.handle)) {
@@ -4688,22 +4700,22 @@ var getDescriptionFromProduct = (options) => {
4688
4700
  if (handleIndx !== -1) {
4689
4701
  let afterHandle = message.substring(handleIndx + options.handle.length).trimStart();
4690
4702
  if (afterHandle.startsWith("/")) afterHandle = afterHandle.slice(1).trimStart();
4691
- const latEnd = afterHandle.indexOf("&&");
4703
+ const latEnd = getEndIndex(afterHandle);
4692
4704
  message = latEnd !== -1 ? afterHandle.substring(0, latEnd).trim() : afterHandle.trim();
4693
4705
  }
4694
4706
  }
4695
4707
  return message.trim();
4696
4708
  };
4697
4709
 
4698
- // src/@parsers/@text/text.getPolygonFromProduct.ts
4710
+ // src/@parsers/@text/GetPolygonFromProduct.ts
4699
4711
  var getPolygonFromProduct = (message) => {
4700
4712
  const coordinates = [];
4701
4713
  const match = message.match(
4702
4714
  /LAT\.\.\.LON\s+([\s\S]*?)(?=\n[A-Z]{2,}(?:\.\.\.|:)|\$\$|&&|$)/i
4703
4715
  );
4704
4716
  if (!match) return coordinates;
4705
- const text2 = match[1];
4706
- const values = text2.match(/\d{4,8}/g);
4717
+ const text = match[1];
4718
+ const values = text.match(/\d{4,8}/g);
4707
4719
  if (!values) return coordinates;
4708
4720
  if (values.every((v) => v.length === 8)) {
4709
4721
  for (const value of values) {
@@ -4728,8 +4740,8 @@ var getPolygonFromProduct = (message) => {
4728
4740
  return coordinates;
4729
4741
  };
4730
4742
 
4731
- // src/@parsers/@text/text.getTextFromProduct.ts
4732
- var getTextFromProduct = (options) => {
4743
+ // src/@parsers/@text/GetTextFromProduct.ts
4744
+ var GetTextFromProduct = (options) => {
4733
4745
  var _a;
4734
4746
  const lines = options.message.split(`
4735
4747
  `);
@@ -4749,8 +4761,8 @@ var getTextFromProduct = (options) => {
4749
4761
  return null;
4750
4762
  };
4751
4763
 
4752
- // src/@dictionaries/dictionaries.icao.ts
4753
- var dict_icao = {
4764
+ // src/@enums/ICAO.ts
4765
+ var EnumICAO = {
4754
4766
  "KLUB": "Lubbock, TX",
4755
4767
  "KLCH": "Lake Charles, LA",
4756
4768
  "TSTL": "St. Louis, MO",
@@ -4991,180 +5003,251 @@ var dict_icao = {
4991
5003
  "PAJK": "Juneau, AK"
4992
5004
  };
4993
5005
 
4994
- // src/@building/building.office.ts
4995
- var getEventOffice = (options) => {
5006
+ // src/@building/GetEventOffice.ts
5007
+ var GetEventOffice = (options) => {
4996
5008
  var _a, _b, _c, _d, _e, _f, _g;
4997
5009
  const office = options.pVtec != null ? (_b = (_a = options.pVtec) == null ? void 0 : _a.tracking) == null ? void 0 : _b.split(`.`)[0] : (_e = (_c = options.attributes) == null ? void 0 : _c.cccc) != null ? _e : options.organization != null ? Array.isArray(options.organization) ? (_d = options.organization) == null ? void 0 : _d[0] : options.organization : null;
4998
- const name = (_g = (_f = dict_icao) == null ? void 0 : _f[office]) != null ? _g : null;
5010
+ const name = (_g = (_f = EnumICAO) == null ? void 0 : _f[office]) != null ? _g : null;
4999
5011
  return { office, name };
5000
5012
  };
5001
5013
 
5002
- // src/@dictionaries/dictionaries.tags.ts
5003
- var dict_tags = {
5004
- "FROSTBITE AND HYPOTHERMIA ARE LIKELY": "Frostbite and Hypothermia Likely",
5005
- "LICKELY BECOME SLICK AND HAZARDOUS": "Slick and Hazardous Roads",
5006
- "SLIPPERY ROAD CONDITIONS": "Slippery Roads",
5007
- "BLOWING SNOW WHICH COULD REDUCE VISIBILITY": "Blowing Snow Reducing Visibility",
5008
- "TRAVEL COULD BE VERY DIFFICULT": "Difficult Travel Conditions",
5009
- "DIFFICULT TRAVEL CONDITIONS": "Difficult Travel Conditions",
5010
- "EXPECT DISRUPTIONS": "Expect Disruptions to Travel",
5011
- "A LARGE AND EXTREMELY DANGEROUS TORNADO": "Large and Dangerous Tornado",
5012
- "THIS IS A PARTICULARLY DANGEROUS SITUATION": "Particularly Dangerous Situation",
5013
- "RADAR INDICATED ROTATION": "Radar Indicated Tornado",
5014
- "WEATHER SPOTTERS CONFIRMED TORNADO": "Confirmed by Storm Spotters",
5015
- "A SEVERE THUNDERSTORM CAPABLE OF PRODUCING A TORNADO": "Developing Tornado",
5016
- "LAW ENFORCEMENT CONFIRMED TORNADO": "Reported by Law Enforcement",
5017
- "A TORNADO IS ON THE GROUND": "Confirmed Tornado",
5018
- "WEATHER SPOTTERS REPORTED FUNNEL CLOUD": "Confirmed Funnel Cloud by Storm Spotters",
5019
- "PUBLIC CONFIRMED TORNADO": "Public reports of Tornado",
5020
- "RADAR CONFIRMED": "Radar Confirmed",
5021
- "TORNADO WAS REPORTED BRIEFLY ON THE GROUND": "Tornado no longer on ground",
5022
- "SPOTTERS INDICATE THAT A FUNNEL CLOUD CONTINUES WITH THIS STORM": "Funnel Cloud Continues",
5023
- "A TORNADO MAY DEVELOP AT ANY TIME": "Potentional still exists for Tornado to form",
5024
- "LIFE-THREATENING SITUATION": "Life Threating Situation",
5025
- "COMPLETE DESTRUCTION IS POSSIBLE": "Extremly Damaging Tornado",
5026
- "POTENTIALLY DEADLY TORNADO": "Deadly Tornado",
5027
- "RADAR INDICATED": "Radar Indicated",
5028
- "HAIL DAMAGE TO VEHICLES IS EXPECTED": "Damaging to Vehicles",
5029
- "EXPECT WIND DAMAGE": "Wind Damage",
5030
- "FREQUENT LIGHTNING": "Frequent Lightning",
5031
- "PEOPLE AND ANIMALS OUTDOORS WILL BE INJURED": "Capable of Injuring People and Animals",
5032
- "TRAINED WEATHER SPOTTERS": "Confirmed by Storm Spotters",
5033
- "SOURCE...PUBLIC": "Confirmed by Public",
5034
- "SMALL CRAFT COULD BE DAMAGED": "Potential Damage to Small Craft",
5035
- "A TORNADO WATCH REMAINS IN EFFECT": "Active Tornado Watch",
5036
- "TENNIS BALL SIZE HAIL": "Tennis Ball Size Hail",
5037
- "BASEBALL SIZE HAIL": "Baseball Size Hail",
5038
- "GOLF BALL SIZE HAIL": "Golf Ball Size Hail",
5039
- "QUARTER SIZE HAIL": "Quarter Size Hail",
5040
- "PING PONG BALL SIZE HAIL": "Ping Pong Ball Size Hail",
5041
- "NICKEL SIZE HAIL": "Nickel Size Hail",
5042
- "DOPPLER RADAR.": "Confirmed by Radar",
5043
- "DOPPLER RADAR AND AUTOMATED GAUGES.": "Confirmed by Radar and Gauges",
5044
- "FLASH FLOODING CAUSED BY THUNDERSTORMS.": "Caused by Thunderstorm",
5045
- "SOURCE...EMERGENCY MANAGEMENT.": "Confirmed by Emergency Management",
5046
- "FLASH FLOODING CAUSED BY HEAVY RAIN.": "Caused by heavy rain",
5047
- "SOURCE...LAW ENFORCEMENT REPORTED.": "Confirmed by Law Enforcement",
5048
- "MINOR FLOODING IS OCCURING": "Minor Flooding Occurring",
5049
- "VERY COLD TEMPERATURES CAN LEAD TO HYPOTHERMIA": "Hypothermia Risk",
5050
- "SENSITIVE VEGETATION AND POSSIBLY DAMAGE UNPROTECTED OUTDOOR": "Vegetation and Outdoor Plumbing Risk",
5051
- "RIP CURRENTS CAN SWEEP EVEN THE BEST SWIMMER": "Hazardous to All Swimmers",
5052
- "HYPOTHERMIA IF PRECAUTIONS ARE NOT TAKEN.": "Hypothermia Risk",
5053
- "FROSTBITE AND HYPOTHERMIA WILL OCCUR IF UNPROTECTED SKIN": "Frostbite and Hypothermia Risk on Unprotected Skin",
5054
- "TEMPERATURES COULD CAUSE RUPTURED WATER PIPES": "Risk of Ruptured Water Pipes",
5055
- "COULD RESULT IN HYPOTHERMIA OR FROSTBITE ON EXPOSED SKIN IF": "Hypothermia or Frostbite Risk on Exposed Skin",
5056
- "WINDS WILL STRENGTHEN": "Strengthening Winds",
5057
- "EXPECT ROADS TO RE-FREEZE": "Roads May Re-Freeze",
5058
- "SLICK AND ICY SPOTS ON ROADS": "Slick and Icy Roads",
5059
- "ICY PATCHES MAY BE MORE COMMON ON BRIDGES": "Icy Patches Likely on Bridges",
5060
- "SLICK SPOTS ON UNTREATED ROADS": "Slick Spots on Untreated Roads",
5061
- "TEMPERATURES ARE EXPECTED TO FALL BELOW FREEZING": "Temperatures Expected Below Freezing",
5062
- "HAZARDOUS ROADWAYS AND BLACK ICE": "Hazardous Roadways and Black Ice",
5063
- "SLOW DOWN AND ALLOW EXTRA TIME": "Slow Down and Allow Extra Time",
5064
- "SHOULD EXERCISE CAUTION": "Should Exercise Caution",
5065
- "LAKE EFFECT SNOW EXPECTED": "Lake Effect Snow Expected",
5066
- "MODERATE LAKE EFFECT SNOWFALL RATES AND BLOWING SNOW": "Moderate Lake Effect Snowfall and Blowing Snow",
5067
- "NO TSUNAMI THREAT": "No Active Tsunami Threat",
5068
- "NO SIGNIFICANT TSUNAMI THREAT": "No Significant Tsunami Threat",
5069
- "NO TSUNAMI IMPACTS ARE EXPECTED": "No Tsunami Impacts Expected",
5070
- "A TSUNAMI THREAT EXISTS": "Tsunami Threat Exists",
5071
- "TSUNAMI THREAT": "Active Tsunami Threat",
5072
- "HEAT ILLNESSES": "Can cause heat illness",
5073
- "WATCH POSSIBLE": "Watch Possible",
5074
- "INTENSIFYING": "Intensifying",
5075
- "CAPABLE OF PRODUCING A LANDSPOUT": "Landspout Possible"
5014
+ // src/@enums/Tags.ts
5015
+ var EnumTags = {
5016
+ SEVERE_WEATHER: [
5017
+ { match: /A Large And Extremely Dangerous Tornado/i, tag: "Large and Dangerous Tornado" },
5018
+ { match: /This Is A Particularly Dangerous Situation/i, tag: "Particularly Dangerous Situation" },
5019
+ { match: /Weather Spotters Confirmed Tornado/i, tag: "Weather Spotters Confirmed Tornado" },
5020
+ { match: /Law Enforcement Confirmed Tornado/i, tag: "Law Enforcement Confirmed Tornado" },
5021
+ { match: /Radar Confirmed/i, tag: "Radar Confirmed" },
5022
+ { match: /Radar Indicated Rotation/i, tag: "Radar Indicated Rotation" },
5023
+ { match: /Radar Indicated(?! Rotation)/i, tag: "Radar Indicated" },
5024
+ { match: /A Tornado Is On The Ground/i, tag: "Tornado On The Ground" },
5025
+ { match: /Tornado Was Reported Briefly On The Ground/i, tag: "Tornado Briefly On Ground" },
5026
+ { match: /Weather Spotters Reported Funnel Cloud/i, tag: "Confirmed Funnel Cloud" },
5027
+ { match: /Spotters Indicate That A Funnel Cloud Continues With This Storm/i, tag: "Funnel Cloud Continues" },
5028
+ { match: /A Severe Thunderstorm Capable Of Producing A Tornado/i, tag: "Tornado Possible" },
5029
+ { match: /A Tornado May Develop At Any Time/i, tag: "Tornado May Develop" },
5030
+ { match: /A Tornado Watch Remains In Effect/i, tag: "Active Tornado Watch" },
5031
+ { match: /Complete Destruction Is Possible/i, tag: "Extremely Damaging Tornado" },
5032
+ { match: /Potentially Deadly Tornado/i, tag: "Deadly Tornado" },
5033
+ { match: /Life-Threatening Situation/i, tag: "Life Threatening Situation" },
5034
+ { match: /Capable Of Producing A Landspout/i, tag: "Landspout Possible" },
5035
+ { match: /Public Confirmed Tornado/i, tag: "Public Confirmed Tornado" },
5036
+ { match: /Expect Wind Damage/i, tag: "Wind Damage" },
5037
+ { match: /Destructive Winds/i, tag: "Destructive Winds" },
5038
+ { match: /Wind Damage With This Storm Will Occur/i, tag: "Immediate Wind Damage Threat" },
5039
+ { match: /Widespread Wind Damage/i, tag: "Widespread Wind Damage" },
5040
+ { match: /Significant Wind Damage/i, tag: "Significant Wind Damage" },
5041
+ { match: /Tornado Like Wind Speeds/i, tag: "Tornado-Like Wind Speeds" },
5042
+ { match: /Winds Will Strengthen/i, tag: "Strengthening Winds" },
5043
+ { match: /Gusty Winds/i, tag: "Gusty Winds" },
5044
+ { match: /Could Knock Down Tree Limbs/i, tag: "Tree Damage Possible" },
5045
+ { match: /Blow Around Unsecured Objects/i, tag: "Loose Object Damage Possible" },
5046
+ { match: /Unsecured lightweight objects blown about/i, tag: "Loose Objects May Blow Around" },
5047
+ { match: /Many large tree limbs broken off/i, tag: "Tree Limb Damage Possible" },
5048
+ { match: /Some fences and roadway signs blown over/i, tag: "Fence and Sign Damage Possible" },
5049
+ { match: /Hazardous driving conditions on bridges/i, tag: "Hazardous Bridge Travel" },
5050
+ { match: /Scattered power and communications outages/i, tag: "Power Outages Possible" },
5051
+ { match: /Hail Damage To Vehicles Is Expected/i, tag: "Vehicle Damaging Hail" },
5052
+ { match: /Extremely Large Hail/i, tag: "Extremely Large Hail" },
5053
+ { match: new RegExp("(?<!Extremely )Large Hail", "i"), tag: "Large Hail" },
5054
+ { match: /Tennis Ball Size Hail/i, tag: "Tennis Ball Size Hail" },
5055
+ { match: /Baseball Size Hail/i, tag: "Baseball Size Hail" },
5056
+ { match: /Golf Ball Size Hail/i, tag: "Golf Ball Size Hail" },
5057
+ { match: /Quarter Size Hail/i, tag: "Quarter Size Hail" },
5058
+ { match: /Ping Pong Ball Size Hail/i, tag: "Ping Pong Ball Size Hail" },
5059
+ { match: /Nickel Size Hail/i, tag: "Nickel Size Hail" },
5060
+ { match: /Hail Driven By Severe Winds/i, tag: "Wind Driven Hail" },
5061
+ { match: /Prepare Immediately For Large Hail/i, tag: "Large Hail" },
5062
+ { match: /Half Inch Hail/i, tag: "Half Inch Hail" },
5063
+ { match: /Frequent Lightning/i, tag: "Frequent Lightning" },
5064
+ { match: /Deadly Cloud To Ground Lightning/i, tag: "Deadly Cloud To Ground Lightning" },
5065
+ { match: /Continuous Cloud To Ground Lightning/i, tag: "Continuous Cloud To Ground Lightning" },
5066
+ { match: /Frequent Cloud To Ground Lightning/i, tag: "Frequent Cloud To Ground Lightning" },
5067
+ { match: /Lightning Can Strike \d+ Miles Away/i, tag: "Lightning Safety Threat" },
5068
+ { match: /Showers and thunderstorms with gusty winds may still occur/i, tag: "Gusty Thunderstorms Possible" }
5069
+ ],
5070
+ FLOOD: [
5071
+ { match: /Flash Flooding Caused By Thunderstorms/i, tag: "Thunderstorm Flash Flooding" },
5072
+ { match: /Flash Flooding Caused By Heavy Rain/i, tag: "Heavy Rain Flash Flooding" },
5073
+ { match: /Torrential Rainfall/i, tag: "Torrential Rainfall" },
5074
+ { match: /May Lead To Flash Flooding/i, tag: "Flash Flooding Possible" },
5075
+ { match: /Minor Flooding Is Occurring/i, tag: "Minor Flooding Occurring" },
5076
+ { match: /Localized Flooding/i, tag: "Localized Flooding Possible" },
5077
+ { match: /Do Not Drive Your Vehicle Through Flooded Roadways/i, tag: "Flooded Roadways" },
5078
+ { match: /No storm surge inundation forecast/i, tag: "No Storm Surge Inundation" },
5079
+ { match: /Localized storm surge possible/i, tag: "Localized Storm Surge Possible" },
5080
+ { match: /Peak Storm Surge Inundation/i, tag: "Storm Surge Inundation Risk" },
5081
+ { match: /Potential for storm surge flooding/i, tag: "Storm Surge Flooding Possible" },
5082
+ { match: /Small streams, creeks, and ditches may become swollen/i, tag: "Small Stream Flooding Risk" },
5083
+ { match: /Rivers and tributaries may quickly rise/i, tag: "Rapid River Rise Possible" },
5084
+ { match: /Flood waters can enter a few structures/i, tag: "Flood Damage Possible" },
5085
+ { match: /Rapid ponding of water occurs/i, tag: "Water Ponding Possible" },
5086
+ { match: /Brief road and bridge closures/i, tag: "Road Closures Possible" }
5087
+ ],
5088
+ WINTER_WEATHER: [
5089
+ { match: /Frostbite And Hypothermia Are Likely/i, tag: "Frostbite and Hypothermia Likely" },
5090
+ { match: /Very Cold Temperatures Can Lead To Hypothermia/i, tag: "Hypothermia Risk" },
5091
+ { match: /Hypothermia If Precautions Are Not Taken/i, tag: "Hypothermia Risk" },
5092
+ { match: /Frostbite And Hypothermia Will Occur If Unprotected Skin/i, tag: "Frostbite Risk" },
5093
+ { match: /Temperatures Could Cause Ruptured Water Pipes/i, tag: "Ruptured Water Pipes Possible" },
5094
+ { match: /Blowing Snow Which Could Reduce Visibility/i, tag: "Reduced Visibility From Blowing Snow" },
5095
+ { match: /Lake Effect Snow Expected/i, tag: "Lake Effect Snow" },
5096
+ { match: /Slick And Icy Spots On Roads/i, tag: "Icy Roads" },
5097
+ { match: /Hazardous Roadways And Black Ice/i, tag: "Black Ice" },
5098
+ { match: /Icy Patches May Be More Common On Bridges/i, tag: "Bridge Icing" }
5099
+ ],
5100
+ COASTAL_MARINE: [
5101
+ { match: /Rip Currents Can Sweep Even The Best Swimmer/i, tag: "Dangerous Rip Currents" },
5102
+ { match: /Small Craft Could Be Damaged/i, tag: "Small Craft Damage Possible" },
5103
+ { match: /No Tsunami Threat/i, tag: "No Tsunami Threat" },
5104
+ { match: /Tsunami Threat Exists/i, tag: "Tsunami Threat Exists" },
5105
+ { match: /TROPICAL STORM WARNING IN EFFECT/i, tag: "Tropical Storm Warning" },
5106
+ { match: /TROPICAL STORM WARNING REMAINS IN EFFECT/i, tag: "Tropical Storm Warning Continues" },
5107
+ { match: /Tropical storm[- ]force winds/i, tag: "Tropical Storm Force Winds" },
5108
+ { match: /hazardous wind/i, tag: "Hazardous Winds" },
5109
+ { match: /hazardous seas/i, tag: "Hazardous Seas" },
5110
+ { match: /could capsize or damage vessels/i, tag: "Vessel Damage Risk" },
5111
+ { match: /reduce visibility/i, tag: "Reduced Visibility" },
5112
+ { match: /Mariners should alter plans/i, tag: "Marine Travel Disruption" },
5113
+ { match: /Remain in port/i, tag: "Remain In Port" },
5114
+ { match: /seek safe harbor/i, tag: "Seek Safe Harbor" },
5115
+ { match: /secure the vessel for severe conditions/i, tag: "Secure Vessel" }
5116
+ ],
5117
+ SAFETY_INFO: [
5118
+ { match: /Seek Shelter Now/i, tag: "Seek Shelter Now" },
5119
+ { match: /Seek Shelter Immediately/i, tag: "Seek Shelter Immediately" },
5120
+ { match: /Move To An Interior Room/i, tag: "Move To Interior Room" },
5121
+ { match: /Move To Safe Shelter Now/i, tag: "Move To Safe Shelter" },
5122
+ { match: /Potentially Deadly Storm/i, tag: "Potentially Deadly Storm" },
5123
+ { match: /Serious Injury And Significant Property Damage/i, tag: "Serious Damage Possible" },
5124
+ { match: /People And Animals Outdoors Will Be Injured/i, tag: "Outdoor Injury Risk" },
5125
+ { match: /IMMINENT DANGEROUS WEATHER CONDITIONS/i, tag: "Imminent Dangerous Weather" },
5126
+ { match: /Follow the instructions of local officials/i, tag: "Follow Local Officials" },
5127
+ { match: /Monitor forecasts/i, tag: "Monitor Forecast Updates" },
5128
+ { match: /Complete preparations.*before conditions become unsafe/i, tag: "Complete Preparations Early" },
5129
+ { match: /Leave immediately if evacuation orders are given/i, tag: "Evacuate If Ordered" },
5130
+ { match: /Heed any flood watches and warnings/i, tag: "Monitor Flood Alerts" },
5131
+ { match: /Listen for changes in the forecast/i, tag: "Stay Weather Aware" },
5132
+ { match: /Travel Could Be Very Difficult/i, tag: "Difficult Travel Conditions" },
5133
+ { match: /Expect Disruptions/i, tag: "Travel Disruptions Expected" },
5134
+ { match: /Trained Weather Spotters/i, tag: "Confirmed By Storm Spotters" },
5135
+ { match: /Doppler Radar/i, tag: "Confirmed By Radar" },
5136
+ { match: /Source\.\.\.Storm Spotters/i, tag: "Confirmed By Storm Spotters" },
5137
+ { match: /Source\.\.\.Doppler Radar/i, tag: "Confirmed By Radar" },
5138
+ { match: /Source\.\.\.Automated Gauges/i, tag: "Confirmed By Automated Gauges" },
5139
+ { match: /Source\.\.\.Radar Confirmed/i, tag: "Confirmed By Radar" },
5140
+ { match: /Source\.\.\.Radar Indicated/i, tag: "Indicated By Radar" },
5141
+ { match: /Source\.\.\.Public/i, tag: "Confirmed By Public" },
5142
+ { match: /Source\.\.\.Amateur Radio/i, tag: "Confirmed By Amateur Radio" },
5143
+ { match: /Source\.\.\.Emergency Management/i, tag: "Confirmed By Emergency Management" },
5144
+ { match: /Source\.\.\.Law Enforcement Reported/i, tag: "Confirmed By Law Enforcement" },
5145
+ { match: /Source\.\.\.Broadcast Media/i, tag: "Confirmed By Broadcast Media" },
5146
+ { match: /Source\.\.\.Media/i, tag: "Confirmed By Media" },
5147
+ { match: /Source\.\.\.Media Reported/i, tag: "Confirmed By Media" },
5148
+ { match: /Doppler Radar And Automated Gauges/i, tag: "Confirmed By Radar and Gauges" },
5149
+ { match: /Potential Impacts:\s*Limited/i, tag: "Limited Impacts Expected" },
5150
+ { match: /Potential Impacts:\s*Little to None/i, tag: "Minimal Impacts Expected" },
5151
+ { match: /Slow Down And Allow Extra Time/i, tag: "Allow Extra Travel Time" },
5152
+ { match: /Should Exercise Caution/i, tag: "Exercise Caution" },
5153
+ { match: /Heat Illnesses/i, tag: "Heat Illness Risk" },
5154
+ { match: /\bIntensifying\b/i, tag: "Intensifying Conditions" }
5155
+ ]
5076
5156
  };
5077
5157
 
5078
- // src/@building/building.tags.ts
5079
- var getEventTags = (message) => {
5080
- return Object.entries(dict_tags).filter(([key]) => message == null ? void 0 : message.toLowerCase().includes(key.toLowerCase())).map(([, value]) => value);
5158
+ // src/@building/GetEventTags.ts
5159
+ var GetEventTags = (message) => {
5160
+ if (!message) return [];
5161
+ return [...new Set(
5162
+ Object.values(EnumTags).flat().filter(({ match }) => match.test(message)).map(({ tag }) => tag)
5163
+ )];
5081
5164
  };
5082
5165
 
5083
- // src/@building/building.properties.ts
5084
- var properties = (options) => {
5166
+ // src/@building/GetEventProperties.ts
5167
+ var GetEventProperties = (options) => {
5085
5168
  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;
5086
- const organization = (_b = (_a = options.message.match(dict_expressions.wmo)) == null ? void 0 : _a[0]) != null ? _b : null;
5169
+ const organization = (_b = (_a = options.message.match(EnumExpressions.wmo)) == null ? void 0 : _a[0]) != null ? _b : null;
5087
5170
  const polygons = getPolygonFromProduct(options.message);
5088
- const properties2 = {
5171
+ const properties = {
5089
5172
  locations: (_e = (_d = (_c = options == null ? void 0 : options.ugc) == null ? void 0 : _c.locations) == null ? void 0 : _d.join(`; `)) != null ? _e : null,
5090
5173
  locations_array: (_g = (_f = options == null ? void 0 : options.ugc) == null ? void 0 : _f.locations) != null ? _g : [],
5091
- description: getDescriptionFromProduct({ message: options.message, handle: (_i = (_h = options == null ? void 0 : options.pVtec) == null ? void 0 : _h.vtec) != null ? _i : null }),
5174
+ description: GetDescriptionFromProduct({ message: options.message, handle: (_i = (_h = options == null ? void 0 : options.pVtec) == null ? void 0 : _h.vtec) != null ? _i : null }),
5092
5175
  attributes: options.attributes,
5093
5176
  geocode: {
5094
- office: getEventOffice({ attributes: options.attributes, organization, pVtec: options.pVtec }),
5177
+ office: GetEventOffice({ attributes: options.attributes, organization, pVtec: options.pVtec }),
5095
5178
  organization,
5096
5179
  ugc: (_k = (_j = options == null ? void 0 : options.ugc) == null ? void 0 : _j.zones) != null ? _k : [],
5097
5180
  polygon: polygons.length > 0 ? Buffer.from(JSON.stringify([polygons])).toString("base64") : null,
5098
5181
  polygon_generated: polygons.length > 0 ? true : false
5099
5182
  },
5100
5183
  parameters: {
5101
- tags: getEventTags(options.message),
5102
- instructions: (_l = getTextFromProduct({ message: options.message, find: [`For your protection`, `do not`, `use extreme caution`], append: `...`, removal: [`.`] })) != null ? _l : null,
5103
- source: (_m = getTextFromProduct({ message: options.message, find: [`SOURCE...`], removal: [`.`] })) != null ? _m : null,
5104
- hazards: (_n = getTextFromProduct({ message: options.message, find: [`HAZARD...`], removal: [`.`] })) != null ? _n : null,
5105
- impacts: (_o = getTextFromProduct({ message: options.message, find: [`IMPACT...`], removal: [`.`] })) != null ? _o : null,
5106
- estimated_hail_size: (_p = getTextFromProduct({ message: options.message, find: [`MAX HAIL SIZE...`, `HAIL...`], removal: ["in"] })) != null ? _p : null,
5107
- estimated_wind_gusts: (_q = getTextFromProduct({ message: options.message, find: [`MAX WIND GUST...`, `WIND...`] })) != null ? _q : null,
5108
- damage_threat: (_r = getTextFromProduct({ message: options.message, find: [`DAMAGE THREAT...`], removal: [] })) != null ? _r : null,
5109
- tornado_threat: (_s = getTextFromProduct({ message: options.message, find: [`TORNADO...`, `WATERSPOUT...`] })) != null ? _s : null,
5110
- flood_threat: (_t = getTextFromProduct({ message: options.message, find: [`FLASH FLOOD...`] })) != null ? _t : null,
5111
- wind_threat: (_u = getTextFromProduct({ message: options.message, find: [`WIND THREAT...`] })) != null ? _u : null,
5112
- hail_threat: (_v = getTextFromProduct({ message: options.message, find: [`HAIL THREAT...`], removal: [] })) != null ? _v : null
5184
+ tags: GetEventTags(options.message),
5185
+ instructions: (_l = GetTextFromProduct({ message: options.message, find: [`For your protection`, `do not`, `use extreme caution`], append: `...`, removal: [`.`] })) != null ? _l : null,
5186
+ source: (_m = GetTextFromProduct({ message: options.message, find: [`SOURCE...`], removal: [`.`] })) != null ? _m : null,
5187
+ hazards: (_n = GetTextFromProduct({ message: options.message, find: [`HAZARD...`], removal: [`.`] })) != null ? _n : null,
5188
+ impacts: (_o = GetTextFromProduct({ message: options.message, find: [`IMPACT...`], removal: [`.`] })) != null ? _o : null,
5189
+ estimated_hail_size: (_p = GetTextFromProduct({ message: options.message, find: [`MAX HAIL SIZE...`, `HAIL...`], removal: ["in"] })) != null ? _p : null,
5190
+ estimated_wind_gusts: (_q = GetTextFromProduct({ message: options.message, find: [`MAX WIND GUST...`, `WIND...`] })) != null ? _q : null,
5191
+ damage_threat: (_r = GetTextFromProduct({ message: options.message, find: [`DAMAGE THREAT...`], removal: [] })) != null ? _r : null,
5192
+ tornado_threat: (_s = GetTextFromProduct({ message: options.message, find: [`TORNADO...`, `WATERSPOUT...`] })) != null ? _s : null,
5193
+ flood_threat: (_t = GetTextFromProduct({ message: options.message, find: [`FLASH FLOOD...`] })) != null ? _t : null,
5194
+ wind_threat: (_u = GetTextFromProduct({ message: options.message, find: [`WIND THREAT...`] })) != null ? _u : null,
5195
+ hail_threat: (_v = GetTextFromProduct({ message: options.message, find: [`HAIL THREAT...`], removal: [] })) != null ? _v : null
5113
5196
  },
5114
5197
  discussion_parameters: {
5115
- discussion_number: (_y = (_x = (_w = getTextFromProduct({ message: options.message, find: [`Mesoscale Discussion `], removal: [`Mesoscale Discussion`, `Number`, `...`] })) == null ? void 0 : _w.toString()) == null ? void 0 : _x.padStart(4, "0")) != null ? _y : null,
5116
- discussion_concerning: (_z = getTextFromProduct({ message: options.message, find: [`Concerning...`] })) != null ? _z : null,
5117
- discussion_max_tornado: (_A = getTextFromProduct({ message: options.message, find: [`MOST PROBABLE PEAK TORNADO INTENSITY...`] })) != null ? _A : null,
5118
- discussion_max_hail: (_B = getTextFromProduct({ message: options.message, find: [`MOST PROBABLE PEAK HAIL SIZE...`] })) != null ? _B : null,
5119
- discussion_max_wind: (_C = getTextFromProduct({ message: options.message, find: [`MOST PROBABLE PEAK WIND GUST...`] })) != null ? _C : null,
5120
- discussion_watch_issuance: (_D = getTextFromProduct({ message: options.message, find: [`Probability of Watch Issuance...`], removal: [`percent`] })) != null ? _D : null
5198
+ discussion_number: (_y = (_x = (_w = GetTextFromProduct({ message: options.message, find: [`Mesoscale Discussion `], removal: [`Mesoscale Discussion`, `Number`, `...`] })) == null ? void 0 : _w.toString()) == null ? void 0 : _x.padStart(4, "0")) != null ? _y : null,
5199
+ discussion_concerning: (_z = GetTextFromProduct({ message: options.message, find: [`Concerning...`] })) != null ? _z : null,
5200
+ discussion_max_tornado: (_A = GetTextFromProduct({ message: options.message, find: [`MOST PROBABLE PEAK TORNADO INTENSITY...`] })) != null ? _A : null,
5201
+ discussion_max_hail: (_B = GetTextFromProduct({ message: options.message, find: [`MOST PROBABLE PEAK HAIL SIZE...`] })) != null ? _B : null,
5202
+ discussion_max_wind: (_C = GetTextFromProduct({ message: options.message, find: [`MOST PROBABLE PEAK WIND GUST...`] })) != null ? _C : null,
5203
+ discussion_watch_issuance: (_D = GetTextFromProduct({ message: options.message, find: [`Probability of Watch Issuance...`], removal: [`percent`] })) != null ? _D : null
5121
5204
  },
5122
5205
  watch_parameters: {
5123
- watch_number: ((_E = options == null ? void 0 : options.pVtec) == null ? void 0 : _E.is_watch) && ((_O = (_N = (_I = (_H = (_G = (_F = getTextFromProduct({ message: options.message, find: [`ITIES FOR`, `UPDATE FOR`, `Watch Number `], removal: [`%`, `<`, `:`] })) == null ? void 0 : _F.replace(/(WT|WS|)/g, "")) == null ? void 0 : _G.trim()) == null ? void 0 : _H.toString()) == null ? void 0 : _I.padStart(4, "0")) != null ? _N : (_M = (_L = (_K = (_J = options == null ? void 0 : options.pVtec) == null ? void 0 : _J.tracking) == null ? void 0 : _K.slice(-4)) == null ? void 0 : _L.toString()) == null ? void 0 : _M.padStart(4, "0")) != null ? _O : null),
5206
+ watch_number: ((_E = options == null ? void 0 : options.pVtec) == null ? void 0 : _E.is_watch) ? (_O = (_N = (_I = (_H = (_G = (_F = GetTextFromProduct({ message: options.message, find: [`ITIES FOR`, `UPDATE FOR`, `Watch Number `], removal: [`%`, `<`, `:`] })) == null ? void 0 : _F.replace(/(WT|WS|)/g, "")) == null ? void 0 : _G.trim()) == null ? void 0 : _H.toString()) == null ? void 0 : _I.padStart(4, "0")) != null ? _N : (_M = (_L = (_K = (_J = options == null ? void 0 : options.pVtec) == null ? void 0 : _J.tracking) == null ? void 0 : _K.slice(-4)) == null ? void 0 : _L.toString()) == null ? void 0 : _M.padStart(4, "0")) != null ? _O : null : null,
5124
5207
  watch_type: options.message.includes(`TORNADO WATCH`) ? `Tornado` : (options == null ? void 0 : options.message.includes(`SEVERE`)) ? `Severe` : null,
5125
- additional_tornadoes_probability: (_P = getTextFromProduct({ message: options.message, find: [`PROB OF 2 OR MORE TORNADOES`], removal: [`%`, `<`, `:`] })) != null ? _P : null,
5126
- strong_tornadoes_probability: (_Q = getTextFromProduct({ message: options.message, find: [`PROB OF 1 OR MORE STRONG /EF2-EF5/ TORNADOES`], removal: [`%`, `<`, `:`] })) != null ? _Q : null,
5127
- severe_wind_probability: (_R = getTextFromProduct({ message: options.message, find: [`PROB OF 10 OR MORE SEVERE WIND EVENTS`], removal: [`%`, `<`, `:`] })) != null ? _R : null,
5128
- severe_hail_probability: (_S = getTextFromProduct({ message: options.message, find: [`PROB OF 10 OR MORE SEVERE HAIL EVENTS`], removal: [`%`, `<`, `:`] })) != null ? _S : null,
5129
- hail_2in_probability: (_T = getTextFromProduct({ message: options.message, find: [`PROB OF 1 OR MORE HAIL EVENTS >= 2 INCHES`], removal: [`%`, `<`, `:`] })) != null ? _T : null,
5130
- combined_hail_wind_probability: (_U = getTextFromProduct({ message: options.message, find: [`PROB OF 6 OR MORE COMBINED SEVERE HAIL/WIND EVENTS`], removal: [`%`, `<`, `:`] })) != null ? _U : null,
5131
- max_hail_in: (_V = getTextFromProduct({ message: options.message, find: [`MAX HAIL /INCHES/`], removal: [`%`, `<`, `:`] })) != null ? _V : null,
5132
- max_wind_surface: (_W = getTextFromProduct({ message: options.message, find: [`MAX WIND GUSTS SURFACE /KNOTS/`], removal: [`%`, `<`, `:`] })) != null ? _W : null,
5133
- max_tops_x100feet: (_X = getTextFromProduct({ message: options.message, find: [`MAX TOPS /X 100 FEET/`], removal: [`%`, `<`, `:`] })) != null ? _X : null,
5134
- pds_watch: getTextFromProduct({ message: options.message, find: [`PARTICULARLY DANGEROUS SITUATION`], removal: [`%`, `<`, `:`] }) === `YES` ? true : null
5208
+ additional_tornadoes_probability: (_P = GetTextFromProduct({ message: options.message, find: [`PROB OF 2 OR MORE TORNADOES`], removal: [`%`, `<`, `:`] })) != null ? _P : null,
5209
+ strong_tornadoes_probability: (_Q = GetTextFromProduct({ message: options.message, find: [`PROB OF 1 OR MORE STRONG /EF2-EF5/ TORNADOES`], removal: [`%`, `<`, `:`] })) != null ? _Q : null,
5210
+ severe_wind_probability: (_R = GetTextFromProduct({ message: options.message, find: [`PROB OF 10 OR MORE SEVERE WIND EVENTS`], removal: [`%`, `<`, `:`] })) != null ? _R : null,
5211
+ severe_hail_probability: (_S = GetTextFromProduct({ message: options.message, find: [`PROB OF 10 OR MORE SEVERE HAIL EVENTS`], removal: [`%`, `<`, `:`] })) != null ? _S : null,
5212
+ hail_2in_probability: (_T = GetTextFromProduct({ message: options.message, find: [`PROB OF 1 OR MORE HAIL EVENTS >= 2 INCHES`], removal: [`%`, `<`, `:`] })) != null ? _T : null,
5213
+ combined_hail_wind_probability: (_U = GetTextFromProduct({ message: options.message, find: [`PROB OF 6 OR MORE COMBINED SEVERE HAIL/WIND EVENTS`], removal: [`%`, `<`, `:`] })) != null ? _U : null,
5214
+ max_hail_in: (_V = GetTextFromProduct({ message: options.message, find: [`MAX HAIL /INCHES/`], removal: [`%`, `<`, `:`] })) != null ? _V : null,
5215
+ max_wind_surface: (_W = GetTextFromProduct({ message: options.message, find: [`MAX WIND GUSTS SURFACE /KNOTS/`], removal: [`%`, `<`, `:`] })) != null ? _W : null,
5216
+ max_tops_x100feet: (_X = GetTextFromProduct({ message: options.message, find: [`MAX TOPS /X 100 FEET/`], removal: [`%`, `<`, `:`] })) != null ? _X : null,
5217
+ pds_watch: GetTextFromProduct({ message: options.message, find: [`PARTICULARLY DANGEROUS SITUATION`], removal: [`%`, `<`, `:`] }) === `YES` ? true : null
5135
5218
  }
5136
5219
  };
5137
- if (isNaN(Number(properties2.watch_parameters.watch_number))) {
5138
- properties2.watch_parameters.watch_number = null;
5220
+ if (isNaN(Number(properties.watch_parameters.watch_number))) {
5221
+ properties.watch_parameters.watch_number = null;
5139
5222
  }
5140
- return properties2;
5223
+ return properties;
5141
5224
  };
5142
5225
 
5143
- // src/@building/building.headers.ts
5144
- var getEventHeader = (options) => {
5226
+ // src/@building/GetEventHeader.ts
5227
+ var GetEventHeader = (options) => {
5145
5228
  var _a, _b, _c;
5146
- const properties2 = options.properties;
5147
- const vtec2 = (_a = options.vtec) != null ? _a : null;
5148
- const ugc2 = properties2.geocode.ugc != null ? properties2.geocode.ugc.join(`-`) : `0`;
5149
- return `ZCZC-ATMOSX-${options.getType.prefix}-${ugc2}-${(_b = vtec2 == null ? void 0 : vtec2.status) != null ? _b : `Issued`}-${(/* @__PURE__ */ new Date()).toISOString().replace(/[-:]/g, "").split(".")[0]}-${(_c = properties2.geocode.office.office) != null ? _c : `KWNS`}`;
5229
+ const properties = options.properties;
5230
+ const vtec = (_a = options.vtec) != null ? _a : null;
5231
+ const ugc = properties.geocode.ugc != null ? properties.geocode.ugc.join(`-`) : `0`;
5232
+ return `ZCZC-ATMOSX-${options.getType.prefix}-${ugc}-${(_b = vtec == null ? void 0 : vtec.status) != null ? _b : `Issued`}-${(/* @__PURE__ */ new Date()).toISOString().replace(/[-:]/g, "").split(".")[0]}-${(_c = properties.geocode.office.office) != null ? _c : `KWNS`}`;
5150
5233
  };
5151
5234
 
5152
- // src/@building/building.tracking.ts
5153
- var getEventTracking = (options) => {
5235
+ // src/@building/GetEventTracking.ts
5236
+ var GetEventTracking = (options) => {
5154
5237
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
5155
- const properties2 = options.properties;
5238
+ const properties = options.properties;
5156
5239
  const attributes = options.attributes;
5157
5240
  const stanza = options.stanza;
5158
- const vtec2 = options.vtec;
5241
+ const vtec = options.vtec;
5159
5242
  if (options.type === `RAW`) {
5160
- const getWatchNumber = (_a = properties2.watch_parameters.watch_number) != null ? _a : null;
5243
+ const getWatchNumber = (_a = properties.watch_parameters.watch_number) != null ? _a : null;
5161
5244
  if (getWatchNumber) {
5162
- return `${properties2.geocode.office.office}.${stanza.getType.prefix}.A.${getWatchNumber}`;
5245
+ return `${properties.geocode.office.office}.${stanza.getType.prefix}.A.${getWatchNumber}`;
5163
5246
  }
5164
- return `${properties2.geocode.office.office}.${attributes.ttaaii}.${(_b = attributes.id.slice(-4).replace(`.`, ``)) != null ? _b : "0"}`;
5247
+ return `${properties.geocode.office.office}.${attributes.ttaaii}.${(_b = attributes.id.slice(-4).replace(`.`, ``)) != null ? _b : "0"}`;
5165
5248
  }
5166
5249
  if (options.type === `VTEC`) {
5167
- return vtec2.tracking;
5250
+ return vtec.tracking;
5168
5251
  }
5169
5252
  if (options.type === `API`) {
5170
5253
  if (options.vtec) {
@@ -5183,37 +5266,39 @@ var getEventTracking = (options) => {
5183
5266
  }
5184
5267
  };
5185
5268
 
5186
- // src/@modules/@utilities/utilities.setDebug.ts
5187
- var setDebug = (options) => {
5188
- var _a, _b, _c, _d;
5269
+ // src/@modules/@utilities/SetDebug.ts
5270
+ var SetDebug = (options) => {
5271
+ var _a, _b;
5189
5272
  const settings = bootstrap.settings;
5190
5273
  bootstrap.listener.emit(`debug`, {
5191
5274
  message: options.message,
5192
- parent: (_b = (_a = options == null ? void 0 : options.title) == null ? void 0 : _a.split(`.`)[0]) == null ? void 0 : _b.replace(`@`, ``),
5193
- function: (_c = options == null ? void 0 : options.title) == null ? void 0 : _c.split(`.`)[1]
5275
+ function: (_a = options.title) != null ? _a : `debug`
5194
5276
  });
5195
5277
  if (settings.EnableDebugging) {
5196
- console.log(`[${bootstrap.ansi_colors.BLUE}${(_d = options.title) != null ? _d : `debug`}${bootstrap.ansi_colors.RESET}] ${options.message}`);
5278
+ console.log(`[${bootstrap.ansi_colors.BLUE}${(_b = options.title) != null ? _b : `debug`}${bootstrap.ansi_colors.RESET}] ${options.message}`);
5197
5279
  }
5198
5280
  };
5199
5281
 
5200
- // src/@events/events.text.ts
5201
- var text = (stanza) => __async(null, null, function* () {
5282
+ // src/@events/ParseText.ts
5283
+ var ParseText = (stanza) => __async(null, null, function* () {
5202
5284
  var _a, _b, _c, _d, _e;
5203
5285
  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 !== "$$");
5204
5286
  if (!getMessages || (getMessages == null ? void 0 : getMessages.length) == 0) return;
5205
5287
  for (const message of getMessages) {
5206
5288
  const tick = performance.now();
5207
5289
  const attributes = stanza == null ? void 0 : stanza.attributes;
5208
- const props = properties({ message, attributes });
5209
- const header = getEventHeader({ properties: props, getType: stanza.getType });
5290
+ const props = GetEventProperties({ message, attributes });
5291
+ const header = GetEventHeader({ properties: props, getType: stanza.getType });
5210
5292
  const issued = new Date(attributes.issue);
5211
5293
  const expires = new Date(issued.getTime() + 12 * 60 * 60 * 1e3);
5212
- const matches = (_d = dict_matches[stanza.getType.prefix]) == null ? void 0 : _d.find((match) => match.match.test(message.toUpperCase()));
5294
+ const matches = (_d = EnumMatches[stanza.getType.prefix]) == null ? void 0 : _d.find((match) => match.match.test(message.toUpperCase()));
5213
5295
  let event = matches == null ? void 0 : matches.label;
5214
5296
  let isStatement = (_e = matches == null ? void 0 : matches.statement) != null ? _e : false;
5215
5297
  if (!event) {
5216
- event = stanza.getType.type.split(`-`).map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase()).join(` `);
5298
+ event = stanza.getType.type;
5299
+ if (!stanza.getType.discovered) {
5300
+ event += ` (AWIPSID)`;
5301
+ }
5217
5302
  isStatement = true;
5218
5303
  }
5219
5304
  bootstrap.cache.processed.push({
@@ -5232,7 +5317,7 @@ var text = (stanza) => __async(null, null, function* () {
5232
5317
  metadata: {
5233
5318
  ms: performance.now() - tick,
5234
5319
  source: `events.text`,
5235
- tracking: getEventTracking({ type: `RAW`, stanza, attributes, properties: props }),
5320
+ tracking: GetEventTracking({ type: `RAW`, stanza, attributes, properties: props }),
5236
5321
  header,
5237
5322
  vtec: null,
5238
5323
  hvtec: null,
@@ -5247,20 +5332,20 @@ var text = (stanza) => __async(null, null, function* () {
5247
5332
  }
5248
5333
  })
5249
5334
  });
5250
- setDebug({ title: `@events.text`, message: `Event process took ${performance.now() - tick} ms` });
5335
+ SetDebug({ title: `ParseText`, message: `${Math.round(performance.now() - tick)}ms` });
5251
5336
  }
5252
5337
  });
5253
5338
 
5254
- // src/@parsers/@ugc/ugc.header.ts
5339
+ // src/@parsers/@ugc/GetUGCHeader.ts
5255
5340
  var getUGCHeader = (message) => {
5256
- const start = message.search(dict_expressions.ugc1);
5341
+ const start = message.search(EnumExpressions.ugc1);
5257
5342
  const sub = message.substring(start);
5258
- const end = sub.search(dict_expressions.ugc2);
5343
+ const end = sub.search(EnumExpressions.ugc2);
5259
5344
  const fin = sub.substring(0, end).replace(/\s+/g, "").slice(0, -1);
5260
5345
  return fin != null ? fin : null;
5261
5346
  };
5262
5347
 
5263
- // src/@parsers/@ugc/ugc.zones.ts
5348
+ // src/@parsers/@ugc/GetZones.ts
5264
5349
  var getZones = (header) => {
5265
5350
  const splits = header.split("-");
5266
5351
  const zones = [];
@@ -5295,8 +5380,8 @@ var getZones = (header) => {
5295
5380
  return zones.filter((item) => item !== "");
5296
5381
  };
5297
5382
 
5298
- // src/@parsers/@ugc/ugc.expiry.ts
5299
- var getExpiry = (message) => {
5383
+ // src/@parsers/@ugc/GetExpiry.ts
5384
+ var GetExpiry = (message) => {
5300
5385
  const match = message.match(/\b(\d{6})-/);
5301
5386
  if (!match) {
5302
5387
  return null;
@@ -5310,12 +5395,12 @@ var getExpiry = (message) => {
5310
5395
  return expires.toISOString();
5311
5396
  };
5312
5397
 
5313
- // src/@parsers/@ugc/ugc.getCache.ts
5398
+ // src/@parsers/@ugc/GetCache.ts
5314
5399
  var getCache = (key) => {
5315
5400
  return bootstrap.cache.ugc.get(key);
5316
5401
  };
5317
5402
 
5318
- // src/@parsers/@ugc/ugc.setCache.ts
5403
+ // src/@parsers/@ugc/SetCache.ts
5319
5404
  var setCache = (key, value) => {
5320
5405
  if (bootstrap.cache.ugc.size >= 5e3) {
5321
5406
  const firstKey = bootstrap.cache.ugc.keys().next().value;
@@ -5324,7 +5409,7 @@ var setCache = (key, value) => {
5324
5409
  bootstrap.cache.ugc.set(key, value);
5325
5410
  };
5326
5411
 
5327
- // src/@parsers/@ugc/ugc.locations.ts
5412
+ // src/@parsers/@ugc/GetLocations.ts
5328
5413
  var getLocations = (zones) => __async(null, null, function* () {
5329
5414
  const uniqueZones = Array.from(new Set(zones));
5330
5415
  const results = [];
@@ -5353,11 +5438,11 @@ var getLocations = (zones) => __async(null, null, function* () {
5353
5438
  return results;
5354
5439
  });
5355
5440
 
5356
- // src/@parsers/@ugc/ugc.extract.ts
5441
+ // src/@parsers/@ugc/UGCExtract.ts
5357
5442
  var ugcExtract = (message) => __async(null, null, function* () {
5358
5443
  const head = getUGCHeader(message);
5359
5444
  const ugcs = getZones(head);
5360
- const expires = getExpiry(message);
5445
+ const expires = GetExpiry(message);
5361
5446
  const areas = yield getLocations(ugcs);
5362
5447
  if (!head || (ugcs == null ? void 0 : ugcs.length) == 0) return;
5363
5448
  return {
@@ -5367,25 +5452,28 @@ var ugcExtract = (message) => __async(null, null, function* () {
5367
5452
  };
5368
5453
  });
5369
5454
 
5370
- // src/@events/events.ugc.ts
5371
- var ugc = (stanza) => __async(null, null, function* () {
5455
+ // src/@events/ParseUGC.ts
5456
+ var ParseUGC = (stanza) => __async(null, null, function* () {
5372
5457
  var _a, _b, _c, _d, _e;
5373
5458
  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 !== "$$");
5374
5459
  if (!getMessages || (getMessages == null ? void 0 : getMessages.length) == 0) return;
5375
5460
  for (const message of getMessages) {
5376
5461
  const tick = performance.now();
5377
5462
  const attributes = stanza == null ? void 0 : stanza.attributes;
5378
- const ugc2 = yield ugcExtract(message);
5379
- if (ugc2 != null) {
5380
- const props = properties({ message, attributes, ugc: ugc2 });
5463
+ const ugc = yield ugcExtract(message);
5464
+ if (ugc != null) {
5465
+ const props = GetEventProperties({ message, attributes, ugc });
5381
5466
  const issued = new Date(attributes.issue);
5382
- const expires = new Date(ugc2.expires);
5383
- const header = getEventHeader({ properties: props, getType: stanza.getType });
5384
- const matches = (_d = dict_matches[stanza.getType.prefix]) == null ? void 0 : _d.find((match) => match.match.test(message.toUpperCase()));
5467
+ const expires = new Date(ugc.expires);
5468
+ const header = GetEventHeader({ properties: props, getType: stanza.getType });
5469
+ const matches = (_d = EnumMatches[stanza.getType.prefix]) == null ? void 0 : _d.find((match) => match.match.test(message.toUpperCase()));
5385
5470
  let event = matches == null ? void 0 : matches.label;
5386
5471
  let isStatement = (_e = matches == null ? void 0 : matches.statement) != null ? _e : false;
5387
5472
  if (!event) {
5388
- event = stanza.getType.type.split(`-`).map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase()).join(` `);
5473
+ event = stanza.getType.type;
5474
+ if (!stanza.getType.discovered) {
5475
+ event += ` (AWIPSID)`;
5476
+ }
5389
5477
  isStatement = true;
5390
5478
  }
5391
5479
  bootstrap.cache.processed.push({
@@ -5404,7 +5492,7 @@ var ugc = (stanza) => __async(null, null, function* () {
5404
5492
  metadata: {
5405
5493
  ms: performance.now() - tick,
5406
5494
  source: `events.ugc`,
5407
- tracking: getEventTracking({ type: `RAW`, stanza, attributes, properties: props }),
5495
+ tracking: GetEventTracking({ type: `RAW`, stanza, attributes, properties: props }),
5408
5496
  header,
5409
5497
  vtec: null,
5410
5498
  hvtec: null,
@@ -5419,21 +5507,21 @@ var ugc = (stanza) => __async(null, null, function* () {
5419
5507
  }
5420
5508
  })
5421
5509
  });
5422
- setDebug({ title: `@events.ugc`, message: `Event process took ${performance.now() - tick} ms` });
5510
+ SetDebug({ title: `ParseUGC`, message: `${Math.round(performance.now() - tick)}ms` });
5423
5511
  }
5424
5512
  }
5425
5513
  });
5426
5514
 
5427
- // src/@dictionaries/dictionaries.products.ts
5428
- var dict_products = {
5515
+ // src/@enums/Products.ts
5516
+ var EnumProducts = {
5429
5517
  "O": "Operational Product",
5430
5518
  "T": "Test Product",
5431
5519
  "E": "Experimental Product",
5432
5520
  "X": "Experimental Product (Non-Operational)"
5433
5521
  };
5434
5522
 
5435
- // src/@dictionaries/dictionaries.events.ts
5436
- var dict_events = {
5523
+ // src/@enums/Events.ts
5524
+ var EnumEvents = {
5437
5525
  "AF": "Ashfall",
5438
5526
  "AS": "Air Stagnation",
5439
5527
  "BH": "Beach Hazard",
@@ -5497,8 +5585,8 @@ var dict_events = {
5497
5585
  "ZY": "Freezing Spray"
5498
5586
  };
5499
5587
 
5500
- // src/@dictionaries/dictionaries.actions.ts
5501
- var dict_actions = {
5588
+ // src/@enums/Actions.ts
5589
+ var EnumActions = {
5502
5590
  "W": "Warning",
5503
5591
  "F": "Forecast",
5504
5592
  "A": "Watch",
@@ -5508,8 +5596,8 @@ var dict_actions = {
5508
5596
  "S": "Statement"
5509
5597
  };
5510
5598
 
5511
- // src/@dictionaries/dictionaries.status.ts
5512
- var dict_status = {
5599
+ // src/@enums/Status.ts
5600
+ var EnumStatus = {
5513
5601
  "NEW": "Issued",
5514
5602
  "CON": "Updated",
5515
5603
  "EXT": "Extended",
@@ -5522,8 +5610,8 @@ var dict_status = {
5522
5610
  "EXP": "Expired"
5523
5611
  };
5524
5612
 
5525
- // src/@parsers/@pvtec/pvtec.expires.ts
5526
- var getExpiry2 = (dates) => {
5613
+ // src/@parsers/@pvtec/GetExpiry.ts
5614
+ var GetExpiry2 = (dates) => {
5527
5615
  if ((dates == null ? void 0 : dates[1]) == `000000T0000Z`) return "Invalid Date Format";
5528
5616
  const expires = `${(/* @__PURE__ */ new Date()).getFullYear().toString().substring(0, 2)}${dates[1].substring(0, 2)}-${dates[1].substring(2, 4)}-${dates[1].substring(4, 6)}T${dates[1].substring(7, 9)}:${dates[1].substring(9, 11)}:00`;
5529
5617
  const local = new Date(new Date(expires).getTime() - 4 * 60 * 6e4);
@@ -5531,24 +5619,24 @@ var getExpiry2 = (dates) => {
5531
5619
  return `${local.getFullYear()}-${pad(local.getMonth() + 1)}-${pad(local.getDate())}T${pad(local.getHours())}:${pad(local.getMinutes())}:00.000-04:00`;
5532
5620
  };
5533
5621
 
5534
- // src/@parsers/@pvtec/pvtec.extract.ts
5535
- var pvExtract = (message) => {
5622
+ // src/@parsers/@pvtec/VTECExtract.ts
5623
+ var VTECExtract = (message) => {
5536
5624
  var _a, _b, _c, _d;
5537
5625
  if (!message) return null;
5538
- const getVTECs = (_a = message.match(dict_expressions.pvtec)) != null ? _a : [];
5626
+ const getVTECs = (_a = message.match(EnumExpressions.pvtec)) != null ? _a : [];
5539
5627
  const vtecs = [];
5540
- for (const vtec2 of getVTECs) {
5541
- const sub = vtec2.split(`.`);
5628
+ for (const vtec of getVTECs) {
5629
+ const sub = vtec.split(`.`);
5542
5630
  if ((sub == null ? void 0 : sub.length) < 7) continue;
5543
5631
  const dates = (_b = sub[6]) == null ? void 0 : _b.split(`-`);
5544
5632
  vtecs.push({
5545
- vtec: vtec2,
5546
- product: dict_products[sub[0]],
5633
+ vtec,
5634
+ product: EnumProducts[sub[0]],
5547
5635
  tracking: `${sub[2]}.${sub[3]}.${sub[4]}.${sub[5]}`,
5548
- event: `${dict_events[sub[3]]} ${dict_actions[sub[4]]}`,
5549
- status: dict_status[sub[1]],
5550
- organization: (_d = (_c = message.match(dict_expressions.wmo)) == null ? void 0 : _c[0]) != null ? _d : null,
5551
- expires: getExpiry2(dates),
5636
+ event: `${EnumEvents[sub[3]]} ${EnumActions[sub[4]]}`,
5637
+ status: EnumStatus[sub[1]],
5638
+ organization: (_d = (_c = message.match(EnumExpressions.wmo)) == null ? void 0 : _c[0]) != null ? _d : null,
5639
+ expires: GetExpiry2(dates),
5552
5640
  is_watch: (sub[4] == `A` || sub[4] == `Y`) && (sub[3] == `TO` || sub[3] == `SV`),
5553
5641
  prediction_center: sub[2] == `KWNS` ? true : false
5554
5642
  });
@@ -5556,8 +5644,8 @@ var pvExtract = (message) => {
5556
5644
  return vtecs.length > 0 ? vtecs : null;
5557
5645
  };
5558
5646
 
5559
- // src/@dictionaries/dictionaries.causes.ts
5560
- var dict_causes = {
5647
+ // src/@enums/Causes.ts
5648
+ var EnumCauses = {
5561
5649
  "SM": "Snow Melt",
5562
5650
  "RS": "Rain/Snow Melt",
5563
5651
  "ER": "Excessive Rain",
@@ -5575,16 +5663,16 @@ var dict_causes = {
5575
5663
  "OT": "Other Effects"
5576
5664
  };
5577
5665
 
5578
- // src/@dictionaries/dictionaries.records.ts
5579
- var dict_records = {
5666
+ // src/@enums/Records.ts
5667
+ var EnumRecords = {
5580
5668
  "NO": "No Record Expected",
5581
5669
  "NR": "Near Record or possible record",
5582
5670
  "UU": "Unknown history of records",
5583
5671
  "OO": "Other"
5584
5672
  };
5585
5673
 
5586
- // src/@dictionaries/dictionaries.severity.ts
5587
- var dict_severity = {
5674
+ // src/@enums/Severity.ts
5675
+ var EnumSeverity = {
5588
5676
  N: "Not Expected",
5589
5677
  0: "Areal Flood or FF Product",
5590
5678
  1: "Minor",
@@ -5593,42 +5681,42 @@ var dict_severity = {
5593
5681
  U: "Unknown"
5594
5682
  };
5595
5683
 
5596
- // src/@parsers/@hvtec/hvtec.extract.ts
5597
- var hvExtract = (message) => {
5684
+ // src/@parsers/@hvtec/HVExtract.ts
5685
+ var HVExtract = (message) => {
5598
5686
  var _a;
5599
- const getHVTECs = (_a = message.match(dict_expressions.hvtec)) != null ? _a : [];
5687
+ const getHVTECs = (_a = message.match(EnumExpressions.hvtec)) != null ? _a : [];
5600
5688
  const vtecs = [];
5601
- for (const vtec2 of getHVTECs) {
5602
- const sub = vtec2.split(`.`);
5689
+ for (const vtec of getHVTECs) {
5690
+ const sub = vtec.split(`.`);
5603
5691
  if (sub.length < 7) continue;
5604
5692
  vtecs.push({
5605
- hvtec: vtec2,
5606
- severity: dict_severity[sub[1]],
5607
- cause: dict_causes[sub[2]],
5608
- record: dict_records[sub[6]]
5693
+ hvtec: vtec,
5694
+ severity: EnumSeverity[sub[1]],
5695
+ cause: EnumCauses[sub[2]],
5696
+ record: EnumRecords[sub[6]]
5609
5697
  });
5610
5698
  }
5611
5699
  return vtecs.length > 0 ? vtecs : null;
5612
5700
  };
5613
5701
 
5614
- // src/@events/events.vtec.ts
5615
- var vtec = (stanza) => __async(null, null, function* () {
5702
+ // src/@events/ParseVTEC.ts
5703
+ var ParseVTEC = (stanza) => __async(null, null, function* () {
5616
5704
  var _a, _b, _c, _d, _e;
5617
5705
  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 !== "$$");
5618
5706
  if (!getMessages || (getMessages == null ? void 0 : getMessages.length) == 0) return;
5619
5707
  for (const message of getMessages) {
5620
5708
  const tick = performance.now();
5621
5709
  const attributes = stanza == null ? void 0 : stanza.attributes;
5622
- const pVtec = pvExtract(message);
5623
- const hVtec = hvExtract(message);
5624
- const ugc2 = yield ugcExtract(message);
5625
- if (pVtec != null && ugc2 != null) {
5710
+ const pVtec = VTECExtract(message);
5711
+ const hVtec = HVExtract(message);
5712
+ const ugc = yield ugcExtract(message);
5713
+ if (pVtec != null && ugc != null) {
5626
5714
  for (const pv of pVtec) {
5627
- const vtec2 = pv;
5628
- const props = properties({ message, attributes, ugc: ugc2, pVtec: vtec2 });
5629
- const header = getEventHeader({ properties: props, getType: stanza.getType, vtec: vtec2 });
5715
+ const vtec = pv;
5716
+ const props = GetEventProperties({ message, attributes, ugc, pVtec: vtec });
5717
+ const header = GetEventHeader({ properties: props, getType: stanza.getType, vtec });
5630
5718
  const issued = (_d = new Date(attributes.issue)) != null ? _d : /* @__PURE__ */ new Date();
5631
- const expires = new Date(vtec2.expires);
5719
+ const expires = new Date(vtec.expires);
5632
5720
  bootstrap.cache.processed.push({
5633
5721
  type: `Feature`,
5634
5722
  geometry: {
@@ -5640,12 +5728,12 @@ var vtec = (stanza) => __async(null, null, function* () {
5640
5728
  parent: pv.event,
5641
5729
  status: pv.status,
5642
5730
  issued: !isNaN(issued.getTime()) ? issued.toISOString() : (/* @__PURE__ */ new Date()).toISOString(),
5643
- expires: !isNaN(expires.getTime()) ? expires.toISOString() : (_e = ugc2.expires) != null ? _e : new Date(issued.getTime() + 60 * 60 * 1e3).toISOString()
5731
+ expires: !isNaN(expires.getTime()) ? expires.toISOString() : (_e = ugc.expires) != null ? _e : new Date(issued.getTime() + 60 * 60 * 1e3).toISOString()
5644
5732
  }, props), {
5645
5733
  metadata: {
5646
5734
  ms: performance.now() - tick,
5647
5735
  source: `events.vtec`,
5648
- tracking: getEventTracking({ type: `VTEC`, stanza, attributes, properties: props, vtec: vtec2 }),
5736
+ tracking: GetEventTracking({ type: `VTEC`, stanza, attributes, properties: props, vtec }),
5649
5737
  header,
5650
5738
  vtec: pv,
5651
5739
  hvtec: hVtec,
@@ -5660,19 +5748,19 @@ var vtec = (stanza) => __async(null, null, function* () {
5660
5748
  }
5661
5749
  })
5662
5750
  });
5663
- setDebug({ title: `@events.vtec`, message: `Event process took ${performance.now() - tick} ms` });
5751
+ SetDebug({ title: `ParseVTEC`, message: `${Math.round(performance.now() - tick)}ms` });
5664
5752
  }
5665
5753
  }
5666
5754
  }
5667
5755
  });
5668
5756
 
5669
- // src/@events/events.api.ts
5670
- var api = (stanza) => __async(null, null, function* () {
5757
+ // src/@events/ParseAPI.ts
5758
+ var ParseAPI = (stanza) => __async(null, null, function* () {
5671
5759
  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, _Ea, _Fa, _Ga, _Ha, _Ia, _Ja, _Ka, _La, _Ma, _Na, _Oa, _Pa, _Qa, _Ra, _Sa, _Ta, _Ua, _Va, _Wa, _Xa, _Ya, _Za, __a, _$a, _ab, _bb, _cb, _db, _eb, _fb, _gb, _hb, _ib, _jb, _kb, _lb, _mb, _nb, _ob, _pb, _qb, _rb, _sb, _tb, _ub;
5672
5760
  const messages = Object.values(JSON.parse(stanza.message).features);
5673
5761
  for (const feature of messages) {
5674
5762
  const tick = performance.now();
5675
- const pVtec = (_d = pvExtract((_c = (_b = (_a = feature == null ? void 0 : feature.properties) == null ? void 0 : _a.parameters) == null ? void 0 : _b.VTEC) == null ? void 0 : _c[0])) != null ? _d : null;
5763
+ const pVtec = (_d = VTECExtract((_c = (_b = (_a = feature == null ? void 0 : feature.properties) == null ? void 0 : _a.parameters) == null ? void 0 : _b.VTEC) == null ? void 0 : _c[0])) != null ? _d : null;
5676
5764
  bootstrap.cache.processed.push({
5677
5765
  type: `Feature`,
5678
5766
  geometry: {
@@ -5692,7 +5780,7 @@ var api = (stanza) => __async(null, null, function* () {
5692
5780
  geocode: {
5693
5781
  office: {
5694
5782
  office: pVtec ? (_w = pVtec == null ? void 0 : pVtec[0]) == null ? void 0 : _w.tracking.split(`.`)[0] : null,
5695
- name: (_y = dict_icao[pVtec ? (_x = pVtec == null ? void 0 : pVtec[0]) == null ? void 0 : _x.tracking.split(`.`)[0] : null]) != null ? _y : null
5783
+ name: (_y = EnumICAO[pVtec ? (_x = pVtec == null ? void 0 : pVtec[0]) == null ? void 0 : _x.tracking.split(`.`)[0] : null]) != null ? _y : null
5696
5784
  },
5697
5785
  organization: (_B = (_A = (_z = feature == null ? void 0 : feature.properties) == null ? void 0 : _z.parameters) == null ? void 0 : _A.WMOidentifier) == null ? void 0 : _B[0],
5698
5786
  ugc: (_E = (_D = (_C = feature == null ? void 0 : feature.properties) == null ? void 0 : _C.geocode) == null ? void 0 : _D.UGC) != null ? _E : [],
@@ -5700,11 +5788,11 @@ var api = (stanza) => __async(null, null, function* () {
5700
5788
  polygon_generated: ((_H = feature == null ? void 0 : feature.geometry) == null ? void 0 : _H.coordinates.length) > 0 ? true : false
5701
5789
  },
5702
5790
  parameters: {
5703
- tags: getEventTags((_I = feature == null ? void 0 : feature.properties) == null ? void 0 : _I.description),
5791
+ tags: GetEventTags((_I = feature == null ? void 0 : feature.properties) == null ? void 0 : _I.description),
5704
5792
  instructions: (_K = (_J = feature == null ? void 0 : feature.properties) == null ? void 0 : _J.instruction) != null ? _K : null,
5705
- source: (_M = getTextFromProduct({ message: (_L = feature == null ? void 0 : feature.properties) == null ? void 0 : _L.description, find: [`SOURCE...`], removal: [`.`] })) != null ? _M : null,
5706
- hazards: (_O = getTextFromProduct({ message: (_N = feature == null ? void 0 : feature.properties) == null ? void 0 : _N.description, find: [`HAZARD...`], removal: [`.`] })) != null ? _O : null,
5707
- impacts: (_Q = getTextFromProduct({ message: (_P = feature == null ? void 0 : feature.properties) == null ? void 0 : _P.description, find: [`IMPACT...`], removal: [`.`] })) != null ? _Q : null,
5793
+ source: (_M = GetTextFromProduct({ message: (_L = feature == null ? void 0 : feature.properties) == null ? void 0 : _L.description, find: [`SOURCE...`], removal: [`.`] })) != null ? _M : null,
5794
+ hazards: (_O = GetTextFromProduct({ message: (_N = feature == null ? void 0 : feature.properties) == null ? void 0 : _N.description, find: [`HAZARD...`], removal: [`.`] })) != null ? _O : null,
5795
+ impacts: (_Q = GetTextFromProduct({ message: (_P = feature == null ? void 0 : feature.properties) == null ? void 0 : _P.description, find: [`IMPACT...`], removal: [`.`] })) != null ? _Q : null,
5708
5796
  estimated_hail_size: (_U = (_T = (_S = (_R = feature == null ? void 0 : feature.properties) == null ? void 0 : _R.parameters) == null ? void 0 : _S.maxHailSize) == null ? void 0 : _T[0]) != null ? _U : null,
5709
5797
  estimated_wind_gusts: (_Y = (_X = (_W = (_V = feature == null ? void 0 : feature.properties) == null ? void 0 : _V.parameters) == null ? void 0 : _W.maxWindGust) == null ? void 0 : _X[0]) != null ? _Y : null,
5710
5798
  damage_threat: (_aa = (_$ = (__ = (_Z = feature == null ? void 0 : feature.properties) == null ? void 0 : _Z.parameters) == null ? void 0 : __.thunderstormDamageThreat) == null ? void 0 : _$[0]) != null ? _aa : null,
@@ -5714,31 +5802,31 @@ var api = (stanza) => __async(null, null, function* () {
5714
5802
  hail_threat: (_qa = (_pa = (_oa = (_na = feature == null ? void 0 : feature.properties) == null ? void 0 : _na.parameters) == null ? void 0 : _oa.hailThreat) == null ? void 0 : _pa[0]) != null ? _qa : null
5715
5803
  },
5716
5804
  discussion_parameters: {
5717
- discussion_number: (_ua = (_ta = (_sa = getTextFromProduct({ message: (_ra = feature == null ? void 0 : feature.properties) == null ? void 0 : _ra.description, find: [`Mesoscale Discussion `], removal: [`Mesoscale Discussion`, `Number`, `...`] })) == null ? void 0 : _sa.toString()) == null ? void 0 : _ta.padStart(4, "0")) != null ? _ua : null,
5718
- discussion_concerning: (_wa = getTextFromProduct({ message: (_va = feature == null ? void 0 : feature.properties) == null ? void 0 : _va.description, find: [`Concerning...`] })) != null ? _wa : null,
5719
- discussion_max_tornado: (_ya = getTextFromProduct({ message: (_xa = feature == null ? void 0 : feature.properties) == null ? void 0 : _xa.description, find: [`MOST PROBABLE PEAK TORNADO INTENSITY...`] })) != null ? _ya : null,
5720
- discussion_max_hail: (_Aa = getTextFromProduct({ message: (_za = feature == null ? void 0 : feature.properties) == null ? void 0 : _za.description, find: [`MOST PROBABLE PEAK HAIL SIZE...`] })) != null ? _Aa : null,
5721
- discussion_max_wind: (_Ca = getTextFromProduct({ message: (_Ba = feature == null ? void 0 : feature.properties) == null ? void 0 : _Ba.description, find: [`MOST PROBABLE PEAK WIND GUST...`] })) != null ? _Ca : null,
5722
- discussion_watch_issuance: (_Ea = getTextFromProduct({ message: (_Da = feature == null ? void 0 : feature.properties) == null ? void 0 : _Da.description, find: [`Probability of Watch Issuance...`], removal: [`percent`] })) != null ? _Ea : null
5805
+ discussion_number: (_ua = (_ta = (_sa = GetTextFromProduct({ message: (_ra = feature == null ? void 0 : feature.properties) == null ? void 0 : _ra.description, find: [`Mesoscale Discussion `], removal: [`Mesoscale Discussion`, `Number`, `...`] })) == null ? void 0 : _sa.toString()) == null ? void 0 : _ta.padStart(4, "0")) != null ? _ua : null,
5806
+ discussion_concerning: (_wa = GetTextFromProduct({ message: (_va = feature == null ? void 0 : feature.properties) == null ? void 0 : _va.description, find: [`Concerning...`] })) != null ? _wa : null,
5807
+ discussion_max_tornado: (_ya = GetTextFromProduct({ message: (_xa = feature == null ? void 0 : feature.properties) == null ? void 0 : _xa.description, find: [`MOST PROBABLE PEAK TORNADO INTENSITY...`] })) != null ? _ya : null,
5808
+ discussion_max_hail: (_Aa = GetTextFromProduct({ message: (_za = feature == null ? void 0 : feature.properties) == null ? void 0 : _za.description, find: [`MOST PROBABLE PEAK HAIL SIZE...`] })) != null ? _Aa : null,
5809
+ discussion_max_wind: (_Ca = GetTextFromProduct({ message: (_Ba = feature == null ? void 0 : feature.properties) == null ? void 0 : _Ba.description, find: [`MOST PROBABLE PEAK WIND GUST...`] })) != null ? _Ca : null,
5810
+ discussion_watch_issuance: (_Ea = GetTextFromProduct({ message: (_Da = feature == null ? void 0 : feature.properties) == null ? void 0 : _Da.description, find: [`Probability of Watch Issuance...`], removal: [`percent`] })) != null ? _Ea : null
5723
5811
  },
5724
5812
  watch_parameters: {
5725
- watch_number: ((_Fa = pVtec == null ? void 0 : pVtec[0]) == null ? void 0 : _Fa.is_watch) && ((_Qa = (_Pa = (_Ka = (_Ja = (_Ia = (_Ha = getTextFromProduct({ message: (_Ga = feature == null ? void 0 : feature.properties) == null ? void 0 : _Ga.description, find: [`ITIES FOR`, `UPDATE FOR`, `Watch Number `], removal: [`%`, `<`, `:`] })) == null ? void 0 : _Ha.replace(/(WT|WS|)/g, "")) == null ? void 0 : _Ia.trim()) == null ? void 0 : _Ja.toString()) == null ? void 0 : _Ka.padStart(4, "0")) != null ? _Pa : (_Oa = (_Na = (_Ma = (_La = pVtec == null ? void 0 : pVtec[0]) == null ? void 0 : _La.tracking) == null ? void 0 : _Ma.slice(-4)) == null ? void 0 : _Na.toString()) == null ? void 0 : _Oa.padStart(4, "0")) != null ? _Qa : null),
5813
+ watch_number: ((_Fa = pVtec == null ? void 0 : pVtec[0]) == null ? void 0 : _Fa.is_watch) && ((_Qa = (_Pa = (_Ka = (_Ja = (_Ia = (_Ha = GetTextFromProduct({ message: (_Ga = feature == null ? void 0 : feature.properties) == null ? void 0 : _Ga.description, find: [`ITIES FOR`, `UPDATE FOR`, `Watch Number `], removal: [`%`, `<`, `:`] })) == null ? void 0 : _Ha.replace(/(WT|WS|)/g, "")) == null ? void 0 : _Ia.trim()) == null ? void 0 : _Ja.toString()) == null ? void 0 : _Ka.padStart(4, "0")) != null ? _Pa : (_Oa = (_Na = (_Ma = (_La = pVtec == null ? void 0 : pVtec[0]) == null ? void 0 : _La.tracking) == null ? void 0 : _Ma.slice(-4)) == null ? void 0 : _Na.toString()) == null ? void 0 : _Oa.padStart(4, "0")) != null ? _Qa : null),
5726
5814
  watch_type: ((_Ra = feature == null ? void 0 : feature.properties) == null ? void 0 : _Ra.description.includes(`TORNADO WATCH`)) ? `Tornado` : ((_Sa = feature == null ? void 0 : feature.properties) == null ? void 0 : _Sa.description.includes(`SEVERE`)) ? `Severe` : null,
5727
- additional_tornadoes_probability: (_Ua = getTextFromProduct({ message: (_Ta = feature == null ? void 0 : feature.properties) == null ? void 0 : _Ta.description, find: [`PROB OF 2 OR MORE TORNADOES`], removal: [`%`, `<`, `:`] })) != null ? _Ua : null,
5728
- strong_tornadoes_probability: (_Wa = getTextFromProduct({ message: (_Va = feature == null ? void 0 : feature.properties) == null ? void 0 : _Va.description, find: [`PROB OF 1 OR MORE STRONG /EF2-EF5/ TORNADOES`], removal: [`%`, `<`, `:`] })) != null ? _Wa : null,
5729
- severe_wind_probability: (_Ya = getTextFromProduct({ message: (_Xa = feature == null ? void 0 : feature.properties) == null ? void 0 : _Xa.description, find: [`PROB OF 10 OR MORE SEVERE WIND EVENTS`], removal: [`%`, `<`, `:`] })) != null ? _Ya : null,
5730
- severe_hail_probability: (__a = getTextFromProduct({ message: (_Za = feature == null ? void 0 : feature.properties) == null ? void 0 : _Za.description, find: [`PROB OF 10 OR MORE SEVERE HAIL EVENTS`], removal: [`%`, `<`, `:`] })) != null ? __a : null,
5731
- hail_2in_probability: (_ab = getTextFromProduct({ message: (_$a = feature == null ? void 0 : feature.properties) == null ? void 0 : _$a.description, find: [`PROB OF 1 OR MORE HAIL EVENTS >= 2 INCHES`], removal: [`%`, `<`, `:`] })) != null ? _ab : null,
5732
- combined_hail_wind_probability: (_cb = getTextFromProduct({ message: (_bb = feature == null ? void 0 : feature.properties) == null ? void 0 : _bb.description, find: [`PROB OF 6 OR MORE COMBINED SEVERE HAIL/WIND EVENTS`], removal: [`%`, `<`, `:`] })) != null ? _cb : null,
5733
- max_hail_in: (_eb = getTextFromProduct({ message: (_db = feature == null ? void 0 : feature.properties) == null ? void 0 : _db.description, find: [`MAX HAIL /INCHES/`], removal: [`%`, `<`, `:`] })) != null ? _eb : null,
5734
- max_wind_surface: (_gb = getTextFromProduct({ message: (_fb = feature == null ? void 0 : feature.properties) == null ? void 0 : _fb.description, find: [`MAX WIND GUSTS SURFACE /KNOTS/`], removal: [`%`, `<`, `:`] })) != null ? _gb : null,
5735
- max_tops_x100feet: (_ib = getTextFromProduct({ message: (_hb = feature == null ? void 0 : feature.properties) == null ? void 0 : _hb.description, find: [`MAX TOPS /X 100 FEET/`], removal: [`%`, `<`, `:`] })) != null ? _ib : null,
5736
- pds_watch: getTextFromProduct({ message: (_jb = feature == null ? void 0 : feature.properties) == null ? void 0 : _jb.description, find: [`PARTICULARLY DANGEROUS SITUATION`], removal: [`%`, `<`, `:`] }) === `YES`
5815
+ additional_tornadoes_probability: (_Ua = GetTextFromProduct({ message: (_Ta = feature == null ? void 0 : feature.properties) == null ? void 0 : _Ta.description, find: [`PROB OF 2 OR MORE TORNADOES`], removal: [`%`, `<`, `:`] })) != null ? _Ua : null,
5816
+ strong_tornadoes_probability: (_Wa = GetTextFromProduct({ message: (_Va = feature == null ? void 0 : feature.properties) == null ? void 0 : _Va.description, find: [`PROB OF 1 OR MORE STRONG /EF2-EF5/ TORNADOES`], removal: [`%`, `<`, `:`] })) != null ? _Wa : null,
5817
+ severe_wind_probability: (_Ya = GetTextFromProduct({ message: (_Xa = feature == null ? void 0 : feature.properties) == null ? void 0 : _Xa.description, find: [`PROB OF 10 OR MORE SEVERE WIND EVENTS`], removal: [`%`, `<`, `:`] })) != null ? _Ya : null,
5818
+ severe_hail_probability: (__a = GetTextFromProduct({ message: (_Za = feature == null ? void 0 : feature.properties) == null ? void 0 : _Za.description, find: [`PROB OF 10 OR MORE SEVERE HAIL EVENTS`], removal: [`%`, `<`, `:`] })) != null ? __a : null,
5819
+ hail_2in_probability: (_ab = GetTextFromProduct({ message: (_$a = feature == null ? void 0 : feature.properties) == null ? void 0 : _$a.description, find: [`PROB OF 1 OR MORE HAIL EVENTS >= 2 INCHES`], removal: [`%`, `<`, `:`] })) != null ? _ab : null,
5820
+ combined_hail_wind_probability: (_cb = GetTextFromProduct({ message: (_bb = feature == null ? void 0 : feature.properties) == null ? void 0 : _bb.description, find: [`PROB OF 6 OR MORE COMBINED SEVERE HAIL/WIND EVENTS`], removal: [`%`, `<`, `:`] })) != null ? _cb : null,
5821
+ max_hail_in: (_eb = GetTextFromProduct({ message: (_db = feature == null ? void 0 : feature.properties) == null ? void 0 : _db.description, find: [`MAX HAIL /INCHES/`], removal: [`%`, `<`, `:`] })) != null ? _eb : null,
5822
+ max_wind_surface: (_gb = GetTextFromProduct({ message: (_fb = feature == null ? void 0 : feature.properties) == null ? void 0 : _fb.description, find: [`MAX WIND GUSTS SURFACE /KNOTS/`], removal: [`%`, `<`, `:`] })) != null ? _gb : null,
5823
+ max_tops_x100feet: (_ib = GetTextFromProduct({ message: (_hb = feature == null ? void 0 : feature.properties) == null ? void 0 : _hb.description, find: [`MAX TOPS /X 100 FEET/`], removal: [`%`, `<`, `:`] })) != null ? _ib : null,
5824
+ pds_watch: GetTextFromProduct({ message: (_jb = feature == null ? void 0 : feature.properties) == null ? void 0 : _jb.description, find: [`PARTICULARLY DANGEROUS SITUATION`], removal: [`%`, `<`, `:`] }) === `YES`
5737
5825
  },
5738
5826
  metadata: {
5739
5827
  ms: performance.now() - tick,
5740
5828
  source: `events.api`,
5741
- tracking: getEventTracking({ type: `API`, organization: { wmoidentifier: (_mb = (_lb = (_kb = feature == null ? void 0 : feature.properties) == null ? void 0 : _kb.parameters) == null ? void 0 : _lb.WMOidentifier) == null ? void 0 : _mb[0], featureId: feature == null ? void 0 : feature.id }, vtec: pVtec == null ? void 0 : pVtec[0] }),
5829
+ tracking: GetEventTracking({ type: `API`, organization: { wmoidentifier: (_mb = (_lb = (_kb = feature == null ? void 0 : feature.properties) == null ? void 0 : _kb.parameters) == null ? void 0 : _lb.WMOidentifier) == null ? void 0 : _mb[0], featureId: feature == null ? void 0 : feature.id }, vtec: pVtec == null ? void 0 : pVtec[0] }),
5742
5830
  header: `ZCZC-ATMOSX-${(_ob = (_nb = feature == null ? void 0 : feature.properties) == null ? void 0 : _nb.parameters) == null ? void 0 : _ob.WMOidentifier}`,
5743
5831
  vtec: pVtec == null ? void 0 : pVtec[0],
5744
5832
  hvtec: null,
@@ -5753,12 +5841,12 @@ var api = (stanza) => __async(null, null, function* () {
5753
5841
  }
5754
5842
  }
5755
5843
  });
5756
- setDebug({ title: `@events.api`, message: `Event process took ${performance.now() - tick} ms` });
5844
+ SetDebug({ title: `ParseAPI`, message: `${Math.round(performance.now() - tick)}ms` });
5757
5845
  }
5758
5846
  });
5759
5847
 
5760
- // src/@dictionaries/dictionaries.enhanced.ts
5761
- var dict_enhanced = {
5848
+ // src/@enums/Enhanced.ts
5849
+ var EnumEnhanced = {
5762
5850
  "Tornado Warning": {
5763
5851
  "Tornado Emergency": { description: "tornado emergency" },
5764
5852
  "PDS Tornado Warning": { description: "particularly dangerous situation", damage: `CONSIDERABLE` },
@@ -5802,19 +5890,15 @@ var dict_enhanced = {
5802
5890
  }
5803
5891
  };
5804
5892
 
5805
- // src/@building/building.enhance.ts
5806
- var getEventEnhancedName = (event) => {
5807
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
5808
- const configurations = bootstrap.settings;
5893
+ // src/@building/GetEventEnhancedName.ts
5894
+ var GetEventEnhancedName = (event) => {
5895
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i;
5809
5896
  let name = (_a = event == null ? void 0 : event.properties) == null ? void 0 : _a.event;
5810
- if (!((_b = configurations == null ? void 0 : configurations.GlobalSettings) == null ? void 0 : _b.BetterEventNames)) {
5811
- return name;
5812
- }
5813
- const damage = (_d = (_c = event == null ? void 0 : event.properties) == null ? void 0 : _c.parameters) == null ? void 0 : _d.damage_threat;
5814
- const tornado = (_f = (_e = event == null ? void 0 : event.properties) == null ? void 0 : _e.parameters) == null ? void 0 : _f.tornado_threat;
5815
- const pdswatch = (_h = (_g = event == null ? void 0 : event.properties) == null ? void 0 : _g.watch_parameters) == null ? void 0 : _h.pds_watch;
5816
- const description = (_j = (_i = event == null ? void 0 : event.properties) == null ? void 0 : _i.description) == null ? void 0 : _j.toLowerCase();
5817
- for (const [eventKey, eventConfig] of Object.entries(dict_enhanced)) {
5897
+ const damage = (_c = (_b = event == null ? void 0 : event.properties) == null ? void 0 : _b.parameters) == null ? void 0 : _c.damage_threat;
5898
+ const tornado = (_e = (_d = event == null ? void 0 : event.properties) == null ? void 0 : _d.parameters) == null ? void 0 : _e.tornado_threat;
5899
+ const pdswatch = (_g = (_f = event == null ? void 0 : event.properties) == null ? void 0 : _f.watch_parameters) == null ? void 0 : _g.pds_watch;
5900
+ const description = (_i = (_h = event == null ? void 0 : event.properties) == null ? void 0 : _h.description) == null ? void 0 : _i.toLowerCase();
5901
+ for (const [eventKey, eventConfig] of Object.entries(EnumEnhanced)) {
5818
5902
  if (eventKey !== name) continue;
5819
5903
  for (const [paramKey, paramValue] of Object.entries(eventConfig)) {
5820
5904
  let matches = true;
@@ -5839,8 +5923,8 @@ var getEventEnhancedName = (event) => {
5839
5923
  return name;
5840
5924
  };
5841
5925
 
5842
- // src/@dictionaries/dictionaries.correlations.ts
5843
- var dict_correlations = [
5926
+ // src/@enums/Correlations.ts
5927
+ var EnumCorrelations = [
5844
5928
  { type: "Statement", name: "Statement", isCancel: false, isUpdate: false, isIssued: true, isStatement: true },
5845
5929
  { type: "Update", name: "Updated", isCancel: false, isUpdate: true, isIssued: false, isStatement: false },
5846
5930
  { type: "Cancel", name: "Cancelled", isCancel: true, isUpdate: false, isIssued: false, isStatement: false },
@@ -5855,8 +5939,8 @@ var dict_correlations = [
5855
5939
  { type: "Routine", name: "Routine", isCancel: false, isUpdate: true, isIssued: false, isStatement: false }
5856
5940
  ];
5857
5941
 
5858
- // src/@dictionaries/dictionaries.cancellation.ts
5859
- var dict_cancellation = [
5942
+ // src/@enums/Cancellation.ts
5943
+ var EnumCancellation = [
5860
5944
  "has been cancelled",
5861
5945
  "subsided sufficiently for the advisory to be cancelled",
5862
5946
  "has been cancelled",
@@ -5869,22 +5953,24 @@ var dict_cancellation = [
5869
5953
  "has weakened below severe"
5870
5954
  ];
5871
5955
 
5872
- // src/@dictionaries/dictionaries.testing.ts
5873
- var dict_testing = [
5956
+ // src/@enums/Testing.ts
5957
+ var EnumTesting = [
5874
5958
  `This is a test message`,
5875
5959
  `Monitoring message only.`,
5876
5960
  `THIS_MESSAGE_IS_FOR_TEST_PURPOSES_ONLY`,
5877
5961
  "TEST MESSAGE"
5878
5962
  ];
5879
5963
 
5880
- // src/@dictionaries/dictionaries.hail.ts
5881
- var dict_hail = {
5964
+ // src/@enums/Hail.ts
5965
+ var EnumHail = {
5966
+ "0.25": "Pea",
5882
5967
  ".25": "Pea",
5968
+ "0.50": "Penny",
5883
5969
  ".50": "Penny",
5884
5970
  ".75": "Penny",
5885
5971
  "Up to .75": "Penny",
5886
- ".88": "Nickel",
5887
5972
  "0.75": "Penny",
5973
+ ".88": "Nickel",
5888
5974
  "0.88": "Nickel",
5889
5975
  "1.00": "Quarter",
5890
5976
  "1.25": "Half Dollar",
@@ -5896,62 +5982,62 @@ var dict_hail = {
5896
5982
  "4.00": "CD/DVD"
5897
5983
  };
5898
5984
 
5899
- // src/@building/building.signature.ts
5900
- var getEventSignature = (event) => {
5985
+ // src/@building/GetEventSignature.ts
5986
+ var GetEventSignature = (event) => {
5901
5987
  var _a, _b, _c, _d, _e, _f, _g, _h;
5902
- const properties2 = event == null ? void 0 : event.properties;
5903
- const vtec2 = (_b = (_a = event == null ? void 0 : event.properties) == null ? void 0 : _a.metadata) == null ? void 0 : _b.vtec;
5904
- const status = dict_correlations.find((c) => c.type === (properties2 == null ? void 0 : properties2.status));
5905
- const csig = dict_cancellation.find((sig) => properties2.description.toLowerCase().includes(sig.toLowerCase()));
5906
- properties2.status_metadata = __spreadProps(__spreadValues({}, properties2.status_metadata), { is_issued: true, is_test: false });
5907
- if ((_c = properties2 == null ? void 0 : properties2.parameters) == null ? void 0 : _c.estimated_hail_size) {
5908
- properties2.parameters.estimated_hail_size += ` (${(_e = dict_hail[(_d = properties2 == null ? void 0 : properties2.parameters) == null ? void 0 : _d.estimated_hail_size]) != null ? _e : "--"})`;
5988
+ const properties = event == null ? void 0 : event.properties;
5989
+ const vtec = (_b = (_a = event == null ? void 0 : event.properties) == null ? void 0 : _a.metadata) == null ? void 0 : _b.vtec;
5990
+ const status = EnumCorrelations.find((c) => c.type === (properties == null ? void 0 : properties.status));
5991
+ const csig = EnumCancellation.find((sig) => properties.description.toLowerCase().includes(sig.toLowerCase()));
5992
+ properties.status_metadata = __spreadProps(__spreadValues({}, properties.status_metadata), { is_issued: true, is_test: false });
5993
+ if ((_c = properties == null ? void 0 : properties.parameters) == null ? void 0 : _c.estimated_hail_size) {
5994
+ properties.parameters.estimated_hail_size += ` (${(_e = EnumHail[(_d = properties == null ? void 0 : properties.parameters) == null ? void 0 : _d.estimated_hail_size]) != null ? _e : "--"})`;
5909
5995
  }
5910
5996
  if (status) {
5911
- properties2.status = (_f = status.name) != null ? _f : properties2.status;
5912
- properties2.status_metadata = __spreadProps(__spreadValues({}, properties2.status_metadata), { is_updated: !!status.isUpdate, is_issued: !!status.isIssued, is_expired: !!status.isCancel, is_statement: !!status.isStatement });
5997
+ properties.status = (_f = status.name) != null ? _f : properties.status;
5998
+ properties.status_metadata = __spreadProps(__spreadValues({}, properties.status_metadata), { is_updated: !!status.isUpdate, is_issued: !!status.isIssued, is_expired: !!status.isCancel, is_statement: !!status.isStatement });
5913
5999
  }
5914
6000
  if (csig) {
5915
- properties2.status_metadata = __spreadProps(__spreadValues({}, properties2.status_metadata), { is_expired: true });
6001
+ properties.status_metadata = __spreadProps(__spreadValues({}, properties.status_metadata), { is_expired: true });
5916
6002
  }
5917
- const getProduct = (_h = (_g = vtec2 == null ? void 0 : vtec2.vtec) == null ? void 0 : _g.split(`.`)[0]) == null ? void 0 : _h.replace(`/`, ``);
5918
- const isTestProduct = dict_products[getProduct] == `Test Product`;
5919
- if (isTestProduct || dict_testing.some((sig) => {
6003
+ const getProduct = (_h = (_g = vtec == null ? void 0 : vtec.vtec) == null ? void 0 : _g.split(`.`)[0]) == null ? void 0 : _h.replace(`/`, ``);
6004
+ const isTestProduct = EnumProducts[getProduct] == `Test Product`;
6005
+ if (isTestProduct || EnumTesting.some((sig) => {
5920
6006
  var _a2, _b2, _c2, _d2;
5921
- return (_d2 = (_a2 = properties2.description) == null ? void 0 : _a2.toLowerCase().includes(sig.toLowerCase())) != null ? _d2 : (_c2 = (_b2 = properties2 == null ? void 0 : properties2.parameters) == null ? void 0 : _b2.instructions) == null ? void 0 : _c2.toLowerCase().includes(sig.toLowerCase());
6007
+ return (_d2 = (_a2 = properties.description) == null ? void 0 : _a2.toLowerCase().includes(sig.toLowerCase())) != null ? _d2 : (_c2 = (_b2 = properties == null ? void 0 : properties.parameters) == null ? void 0 : _b2.instructions) == null ? void 0 : _c2.toLowerCase().includes(sig.toLowerCase());
5922
6008
  })) {
5923
- properties2.status_metadata = __spreadProps(__spreadValues({}, properties2.status_metadata), { is_test: true });
6009
+ properties.status_metadata = __spreadProps(__spreadValues({}, properties.status_metadata), { is_test: true });
5924
6010
  }
5925
- if (new Date(properties2.expires).getTime() < Date.now()) {
5926
- properties2.status_metadata = __spreadProps(__spreadValues({}, properties2.status_metadata), { is_expired: true });
6011
+ if (new Date(properties.expires).getTime() < Date.now()) {
6012
+ properties.status_metadata = __spreadProps(__spreadValues({}, properties.status_metadata), { is_expired: true });
5927
6013
  }
5928
- properties2.status_metadata = __spreadValues({}, properties2.status_metadata);
6014
+ properties.status_metadata = __spreadValues({}, properties.status_metadata);
5929
6015
  return event;
5930
6016
  };
5931
6017
 
5932
- // src/@dictionaries/dictionaries.global.ts
5933
- var dict_global = [
5934
- "spc day 1 outlook",
5935
- "spc day 2 outlook",
5936
- "spc day 3 outlook"
6018
+ // src/@enums/GlobalFilter.ts
6019
+ var EnumGlobalFilter = [
6020
+ "storm prediction center day 1 outlook",
6021
+ "storm prediction center day 2 outlook",
6022
+ "storm prediction center day 3 outlook"
5937
6023
  ];
5938
6024
 
5939
- // src/@manager/manager.setHash.ts
5940
- var setHash = (event, entry) => {
5941
- if (entry) {
5942
- entry.hashes.push(event.properties.metadata.hash);
5943
- entry.expires = event.properties.expires;
5944
- } else {
6025
+ // src/@manager/SetHash.ts
6026
+ var SetHash = (event, entry) => {
6027
+ if (!entry) {
5945
6028
  bootstrap.cache.hashes.push({
5946
6029
  tracking: event.properties.metadata.tracking,
5947
6030
  hashes: [event.properties.metadata.hash],
5948
6031
  expires: event.properties.expires
5949
6032
  });
6033
+ return;
5950
6034
  }
6035
+ entry.hashes.push(event.properties.metadata.hash);
6036
+ entry.expires = event.properties.expires;
5951
6037
  };
5952
6038
 
5953
- // src/@modules/@eas/eas.getWavPCM16.ts
5954
- var getWavPCM16 = (buffer) => {
6039
+ // src/@modules/@eas/GetWavPCM16.ts
6040
+ var GetWavPCM16 = (buffer) => {
5955
6041
  if (buffer.toString("ascii", 0, 4) !== "RIFF" || buffer.toString("ascii", 8, 12) !== "WAVE") {
5956
6042
  return null;
5957
6043
  }
@@ -5979,8 +6065,8 @@ var getWavPCM16 = (buffer) => {
5979
6065
  return { samples: new Int16Array(samples), sampleRate, channels, bitsPerSample };
5980
6066
  };
5981
6067
 
5982
- // src/@modules/@eas/eas.getSampledPCM16.ts
5983
- var getSampledPCM16 = (int16, originalRate, targetRate) => {
6068
+ // src/@modules/@eas/GetSampledPCM16.ts
6069
+ var GetSampledPCM16 = (int16, originalRate, targetRate) => {
5984
6070
  if (originalRate === targetRate) return int16;
5985
6071
  const ratio = targetRate / originalRate;
5986
6072
  const outLen = Math.max(1, Math.round(int16.length * ratio));
@@ -5996,15 +6082,15 @@ var getSampledPCM16 = (int16, originalRate, targetRate) => {
5996
6082
  return out;
5997
6083
  };
5998
6084
 
5999
- // src/@modules/@eas/eas.getPCMToFloat.ts
6000
- var getPCMToFloat = (int16) => {
6085
+ // src/@modules/@eas/GetPCMToFloat.ts
6086
+ var GetPCMToFloat = (int16) => {
6001
6087
  const out = new Float32Array(int16.length);
6002
6088
  for (let i = 0; i < int16.length; i++) out[i] = int16[i] / 32768;
6003
6089
  return out;
6004
6090
  };
6005
6091
 
6006
- // src/@modules/@eas/eas.getFloatPCM16.ts
6007
- var getFloatPCM16 = (float32) => {
6092
+ // src/@modules/@eas/GetFloatPCM16.ts
6093
+ var GetFloatPCM16 = (float32) => {
6008
6094
  const out = new Int16Array(float32.length);
6009
6095
  for (let i = 0; i < float32.length; i++) {
6010
6096
  let v = Math.max(-1, Math.min(1, float32[i]));
@@ -6013,11 +6099,11 @@ var getFloatPCM16 = (float32) => {
6013
6099
  return out;
6014
6100
  };
6015
6101
 
6016
- // src/@modules/@eas/eas.setRadioEffect.ts
6017
- var setRadioEffect = (int16, sampleRate) => {
6102
+ // src/@modules/@eas/SetRadioEffect.ts
6103
+ var SetRadioEffect = (int16, sampleRate) => {
6018
6104
  const hpCut = 3555;
6019
6105
  const lpCut = 1600;
6020
- const x = getPCMToFloat(int16);
6106
+ const x = GetPCMToFloat(int16);
6021
6107
  const dt = 1 / sampleRate;
6022
6108
  const rcHP = 1 / (2 * Math.PI * hpCut);
6023
6109
  const aHP = rcHP / (rcHP + dt);
@@ -6038,11 +6124,11 @@ var setRadioEffect = (int16, sampleRate) => {
6038
6124
  const compGain = 2;
6039
6125
  const norm = Math.tanh(compGain);
6040
6126
  for (let i = 0; i < x.length; i++) x[i] = Math.tanh(x[i] * compGain) / norm;
6041
- return getFloatPCM16(x);
6127
+ return GetFloatPCM16(x);
6042
6128
  };
6043
6129
 
6044
- // src/@modules/@eas/eas.setAFSK.ts
6045
- var setAFSK = (bits, sampleRate) => {
6130
+ // src/@modules/@eas/SetAFSK.ts
6131
+ var SetAFSK = (bits, sampleRate) => {
6046
6132
  const baud = 520.83;
6047
6133
  const markFreq = 2083.3;
6048
6134
  const spaceFreq = 1562.5;
@@ -6073,8 +6159,8 @@ var setAFSK = (bits, sampleRate) => {
6073
6159
  return Int16Array.from(result);
6074
6160
  };
6075
6161
 
6076
- // src/@modules/@eas/eas.setAsciiToBits.ts
6077
- var setAsciiToBits = (str) => {
6162
+ // src/@modules/@eas/SetAsciiToBits.ts
6163
+ var SetAsciiToBits = (str) => {
6078
6164
  const bits = [];
6079
6165
  for (let i = 0; i < str.length; i++) {
6080
6166
  const c = str.charCodeAt(i) & 255;
@@ -6085,8 +6171,8 @@ var setAsciiToBits = (str) => {
6085
6171
  return bits;
6086
6172
  };
6087
6173
 
6088
- // src/@modules/@eas/eas.getMergedPCM16.ts
6089
- var getMergedPCM16 = (arrays) => {
6174
+ // src/@modules/@eas/GetMergedPCM16.ts
6175
+ var GetMergedPCM16 = (arrays) => {
6090
6176
  let total = 0;
6091
6177
  for (const a of arrays) total += a.length;
6092
6178
  const out = new Int16Array(total);
@@ -6098,16 +6184,16 @@ var getMergedPCM16 = (arrays) => {
6098
6184
  return out;
6099
6185
  };
6100
6186
 
6101
- // src/@modules/@eas/eas.setSameHeader.ts
6102
- var setSameHeader = (vtec2, repeats, sampleRate = 8e3, options = {}) => {
6187
+ // src/@modules/@eas/SetSameHeader.ts
6188
+ var SetSameHeader = (vtec, repeats, sampleRate = 8e3, options = {}) => {
6103
6189
  var _a, _b;
6104
6190
  const preMarkSec = (_a = options.preMarkSec) != null ? _a : 0.3;
6105
6191
  const gapSec = (_b = options.gapSec) != null ? _b : 0.1;
6106
6192
  const bursts = [];
6107
6193
  const gap = new Int16Array(Math.floor(gapSec * sampleRate));
6108
6194
  for (let i = 0; i < repeats; i++) {
6109
- const bodyBits = setAsciiToBits(vtec2);
6110
- const body = setAFSK(bodyBits, sampleRate);
6195
+ const bodyBits = SetAsciiToBits(vtec);
6196
+ const body = SetAFSK(bodyBits, sampleRate);
6111
6197
  const extendedBodyDuration = Math.round(preMarkSec * sampleRate);
6112
6198
  const extendedBody = new Int16Array(extendedBodyDuration + gap.length);
6113
6199
  for (let j2 = 0; j2 < extendedBodyDuration; j2++) {
@@ -6117,11 +6203,11 @@ var setSameHeader = (vtec2, repeats, sampleRate = 8e3, options = {}) => {
6117
6203
  bursts.push(extendedBody);
6118
6204
  if (i !== repeats - 1) bursts.push(gap);
6119
6205
  }
6120
- return getMergedPCM16(bursts);
6206
+ return GetMergedPCM16(bursts);
6121
6207
  };
6122
6208
 
6123
- // src/@modules/@eas/eas.setAttentionTone.ts
6124
- var setAttentionTone = (ms, sampleRate) => {
6209
+ // src/@modules/@eas/SetAttentionTone.ts
6210
+ var SetAttentionTone = (ms, sampleRate) => {
6125
6211
  const len = Math.floor(ms * sampleRate);
6126
6212
  const out = new Int16Array(len);
6127
6213
  const f1 = 853;
@@ -6141,18 +6227,18 @@ var setAttentionTone = (ms, sampleRate) => {
6141
6227
  return out;
6142
6228
  };
6143
6229
 
6144
- // src/@modules/@eas/eas.setNoise.ts
6145
- var setNoise = (int16, noiseLevel = 0.02) => {
6146
- const x = getPCMToFloat(int16);
6230
+ // src/@modules/@eas/SetNoise.ts
6231
+ var SetNoise = (int16, noiseLevel = 0.02) => {
6232
+ const x = GetPCMToFloat(int16);
6147
6233
  for (let i = 0; i < x.length; i++) x[i] += (Math.random() * 2 - 1) * noiseLevel;
6148
6234
  let peak = 0;
6149
6235
  for (let i = 0; i < x.length; i++) peak = Math.max(peak, Math.abs(x[i]));
6150
6236
  if (peak > 1) for (let i = 0; i < x.length; i++) x[i] *= 0.98 / peak;
6151
- return getFloatPCM16(x);
6237
+ return GetFloatPCM16(x);
6152
6238
  };
6153
6239
 
6154
- // src/@modules/@eas/eas.getPCM16.ts
6155
- var getPCM16 = (samples, sampleRate) => {
6240
+ // src/@modules/@eas/GetPCM16.ts
6241
+ var GetPCM16 = (samples, sampleRate) => {
6156
6242
  let o = 0;
6157
6243
  const bytesPerSample = 2;
6158
6244
  const blockAlign = 1 * bytesPerSample;
@@ -6192,17 +6278,17 @@ var getPCM16 = (samples, sampleRate) => {
6192
6278
  return buffer;
6193
6279
  };
6194
6280
 
6195
- // src/@modules/@eas/eas.getTTS.ts
6281
+ // src/@modules/@eas/GetTTS.ts
6196
6282
  import { platform } from "os";
6197
6283
  import { writeFileSync } from "fs";
6198
6284
  import { execSync } from "child_process";
6199
- var getTTS = (text2, outputPath) => __async(null, null, function* () {
6285
+ var GetTTS = (text, outputPath) => __async(null, null, function* () {
6200
6286
  const vPlatform = platform();
6201
6287
  switch (vPlatform) {
6202
6288
  case "win32": {
6203
6289
  try {
6204
6290
  const txtPath = outputPath + ".txt";
6205
- writeFileSync(txtPath, text2, "utf8");
6291
+ writeFileSync(txtPath, text, "utf8");
6206
6292
  const command = [
6207
6293
  "Add-Type -AssemblyName System.Speech;",
6208
6294
  `$speak = New-Object System.Speech.Synthesis.SpeechSynthesizer;`,
@@ -6219,7 +6305,7 @@ var getTTS = (text2, outputPath) => __async(null, null, function* () {
6219
6305
  }
6220
6306
  case "linux":
6221
6307
  try {
6222
- execSync(`espeak -w "${outputPath}" "${text2.replace(/"/g, '\\"')}"`);
6308
+ execSync(`espeak -w "${outputPath}" "${text.replace(/"/g, '\\"')}"`);
6223
6309
  } catch (e) {
6224
6310
  }
6225
6311
  break;
@@ -6228,8 +6314,8 @@ var getTTS = (text2, outputPath) => __async(null, null, function* () {
6228
6314
  }
6229
6315
  });
6230
6316
 
6231
- // src/@modules/@eas/eas.getCleanDescription.ts
6232
- var getCleanDescription = (message) => {
6317
+ // src/@modules/@eas/GetCleanDescription.ts
6318
+ var GetCleanDescription = (message) => {
6233
6319
  const patches = [
6234
6320
  { regex: /\.{3,}/g, replacement: ". " },
6235
6321
  { regex: /\bUTC\b/g, replacement: "Coordinated Universal Time" },
@@ -6300,12 +6386,12 @@ var getCleanDescription = (message) => {
6300
6386
  return message.replace(/'/g, "''").replace(/\b(\d{1,2}):(\d{2})\s*(AM|PM)\b/gi, (_, h, m, ap) => fmt(+h, +m, ap.toUpperCase())).replace(/\b(\d{1,2})\s+(\d{2})\s+(AM|PM)\b/gi, (_, h, m, ap) => fmt(+h, +m, ap.toUpperCase())).replace(/\b(\d{2})(\d{2})\s+(AM|PM)\b/gi, (_, hh, mm, ap) => fmt(+hh, +mm, ap.toUpperCase())).replace(/\b(\d{1,2})\s+(AM|PM)\b/gi, (_, h, ap) => fmt(+h, 0, ap.toUpperCase())).replace(/\*+/g, " ").replace(/-/g, " ").replace(/\n/g, " ").trim();
6301
6387
  };
6302
6388
 
6303
- // src/@modules/@eas/eas.setEasTone.ts
6389
+ // src/@modules/@eas/GenerateEASMessage.ts
6304
6390
  import { join } from "path";
6305
6391
  import { existsSync, mkdirSync, readFileSync, writeFileSync as writeFileSync2, unlinkSync } from "fs";
6306
6392
  import { execSync as execSync2 } from "child_process";
6307
6393
  import { platform as platform2 } from "os";
6308
- var setEasTone = (options) => __async(null, null, function* () {
6394
+ var GenerateEASMessage = (options) => __async(null, null, function* () {
6309
6395
  var _a;
6310
6396
  const tick = performance.now();
6311
6397
  const settings = bootstrap.settings;
@@ -6315,7 +6401,7 @@ var setEasTone = (options) => __async(null, null, function* () {
6315
6401
  let header = options.header;
6316
6402
  let title = ((_a = options.title) != null ? _a : `${Math.random().toString(36).substring(2, 15)}-${header.replace(/[^a-zA-Z0-9]/g, "")}`).replace(/[\\:*?"<>|]/g, "_").replace(/\s+/g, " ").trim();
6317
6403
  if (!message || !header) {
6318
- setWarning({
6404
+ SetWarning({
6319
6405
  title: `EAS`,
6320
6406
  message: `Message and header are required to generate an EAS tone.`
6321
6407
  });
@@ -6327,25 +6413,19 @@ var setEasTone = (options) => __async(null, null, function* () {
6327
6413
  if (!existsSync(directory)) {
6328
6414
  mkdirSync(directory, { recursive: true });
6329
6415
  }
6330
- if (!existsSync(join(directory, `/tts`))) {
6331
- mkdirSync(join(directory, `/tts`), { recursive: true });
6332
- }
6333
- if (!existsSync(join(directory, `/encoded`))) {
6334
- mkdirSync(join(directory, `/encoded`), { recursive: true });
6335
- }
6336
- const tmpTTS = join(directory, `/tts/${title}.wav`);
6337
- const outTTS = join(directory, `/encoded/${title}.wav`);
6416
+ const tmpTTS = join(directory, `/${title}-tts.wav`);
6417
+ const outTTS = join(directory, `/${title}.wav`);
6338
6418
  const vPlatform = platform2();
6339
6419
  if (vPlatform === "darwin") {
6340
- setWarning({
6420
+ SetWarning({
6341
6421
  title: `EAS`,
6342
6422
  message: `EAS tone generation is not supported on macOS.`
6343
6423
  });
6344
6424
  return null;
6345
6425
  }
6346
6426
  yield new Promise((resolve6, reject) => {
6347
- const tMsg = getCleanDescription(message);
6348
- getTTS(tMsg, tmpTTS).then(() => {
6427
+ const tMsg = GetCleanDescription(message);
6428
+ GetTTS(tMsg, tmpTTS).then(() => {
6349
6429
  resolve6();
6350
6430
  });
6351
6431
  });
@@ -6353,19 +6433,19 @@ var setEasTone = (options) => __async(null, null, function* () {
6353
6433
  return null;
6354
6434
  }
6355
6435
  buffTTS = readFileSync(tmpTTS);
6356
- const vWav = getWavPCM16(buffTTS);
6357
- const vSamples = getSampledPCM16(vWav.samples, vWav.sampleRate, 8e3);
6358
- const vRadio = setRadioEffect(vSamples, 8e3);
6436
+ const vWav = GetWavPCM16(buffTTS);
6437
+ const vSamples = GetSampledPCM16(vWav.samples, vWav.sampleRate, 8e3);
6438
+ const vRadio = SetRadioEffect(vSamples, 8e3);
6359
6439
  if (existsSync(prefix)) {
6360
6440
  let tBuffer = readFileSync(prefix);
6361
- let tWav = getWavPCM16(tBuffer);
6441
+ let tWav = GetWavPCM16(tBuffer);
6362
6442
  if (tWav == null) {
6363
6443
  try {
6364
- const converted = join(directory, `/tts/${title}.converted.wav`);
6444
+ const converted = join(directory, `/${title}-tts-fixed.wav`);
6365
6445
  execSync2(`ffmpeg -y -i "${prefix}" -ar 8000 -ac 1 -sample_fmt s16 "${converted}"`, { stdio: "ignore" });
6366
6446
  if (existsSync(converted)) {
6367
6447
  tBuffer = readFileSync(converted);
6368
- tWav = getWavPCM16(tBuffer);
6448
+ tWav = GetWavPCM16(tBuffer);
6369
6449
  try {
6370
6450
  unlinkSync(converted);
6371
6451
  } catch (e) {
@@ -6375,41 +6455,41 @@ var setEasTone = (options) => __async(null, null, function* () {
6375
6455
  }
6376
6456
  }
6377
6457
  if (tWav == null) {
6378
- setWarning({ title: `EAS`, message: `Intro tone isn't a valid .WAV file or isn't in PCM 16-bit format. Converted attempt failed; please convert it then try again.` });
6458
+ SetWarning({ title: `EAS`, message: `Intro tone isn't a valid .WAV file or isn't in PCM 16-bit format. Converted attempt failed; please convert it then try again.` });
6379
6459
  return null;
6380
6460
  }
6381
- const tSamples = tWav.sampleRate != 8e3 ? getSampledPCM16(tWav.samples, tWav.sampleRate, 8e3) : tWav.samples;
6382
- buffRadio = setRadioEffect(tSamples, 8e3);
6461
+ const tSamples = tWav.sampleRate != 8e3 ? GetSampledPCM16(tWav.samples, tWav.sampleRate, 8e3) : tWav.samples;
6462
+ buffRadio = SetRadioEffect(tSamples, 8e3);
6383
6463
  }
6384
6464
  buffFull = buffRadio != null ? [buffRadio, new Int16Array(Math.floor(0.5 * 8e3))] : [];
6385
6465
  buffFull.push(
6386
- setSameHeader(header, 3, 8e3, {
6466
+ SetSameHeader(header, 3, 8e3, {
6387
6467
  preMarkSec: 1.1,
6388
6468
  gapSec: 0.5
6389
6469
  }),
6390
6470
  new Int16Array(Math.floor(0.5 * 8e3)),
6391
- setAttentionTone(8, 8e3),
6471
+ SetAttentionTone(8, 8e3),
6392
6472
  new Int16Array(Math.floor(0.5 * 8e3)),
6393
6473
  vRadio
6394
6474
  );
6395
6475
  for (let i = 0; i < 3; i++) {
6396
- buffFull.push(setSameHeader(header, 1, 8e3, { preMarkSec: 0.5, gapSec: 0.1 }));
6476
+ buffFull.push(SetSameHeader(header, 1, 8e3, { preMarkSec: 0.5, gapSec: 0.1 }));
6397
6477
  buffFull.push(new Int16Array(Math.floor(0.5 * 8e3)));
6398
6478
  }
6399
- const aSamples = getMergedPCM16(buffFull);
6400
- const aFinal = setNoise(aSamples, 2e-3);
6401
- const aBuffer = getPCM16(Array.from(aFinal).map((v) => ({ value: v })), 8e3);
6479
+ const aSamples = GetMergedPCM16(buffFull);
6480
+ const aFinal = SetNoise(aSamples, 2e-3);
6481
+ const aBuffer = GetPCM16(Array.from(aFinal).map((v) => ({ value: v })), 8e3);
6402
6482
  writeFileSync2(outTTS, aBuffer);
6403
6483
  try {
6404
6484
  unlinkSync(tmpTTS);
6405
6485
  } catch (e) {
6406
6486
  }
6407
- setDebug({ title: `@eas.setEasTone`, message: `EAS tone generation took ${performance.now() - tick} ms` });
6487
+ SetDebug({ title: `GenerateEASMessage`, message: `${Math.round(performance.now() - tick)}ms` });
6408
6488
  return outTTS;
6409
6489
  });
6410
6490
 
6411
- // src/@parsers/@text/text.getEmbedText.ts
6412
- var getEmebedText = (event) => {
6491
+ // src/@parsers/@text/GetEmbededText.ts
6492
+ var GetEmebedText = (event) => {
6413
6493
  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, _Ea, _Fa, _Ga, _Ha, _Ia, _Ja, _Ka, _La, _Ma, _Na;
6414
6494
  const line = (label, value, condition = true) => condition && value ? `${label} ${value}` : null;
6415
6495
  const isStatement = event.properties.status_metadata.is_statement;
@@ -6446,44 +6526,46 @@ var getEmebedText = (event) => {
6446
6526
  ].filter(Boolean).join("\n");
6447
6527
  };
6448
6528
 
6449
- // src/@parsers/@text/text.getStringText.ts
6450
- var getStringText = (event) => {
6451
- 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;
6529
+ // src/@parsers/@text/GetStringText.ts
6530
+ var GetStringText = (event) => {
6531
+ 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, _Ea;
6532
+ const settings = bootstrap.settings;
6533
+ const timezone = (_a = settings.NotifyServer.Timezone) != null ? _a : `UTC`;
6452
6534
  const line = (label, value, condition = true) => condition && value ? `${label} ${value}` : null;
6453
6535
  const isStatement = event.properties.status_metadata.is_statement;
6454
6536
  const isExpired = event.properties.status_metadata.is_expired;
6455
6537
  return [
6456
- line(`Locations:`, (_b = (_a = event == null ? void 0 : event.properties) == null ? void 0 : _a.locations) == null ? void 0 : _b.slice(0, 100)),
6457
- line(`Issued:`, new Date(event.properties.issued).toUTCString(), !isExpired),
6458
- line(`Expires:`, new Date(event.properties.expires).toUTCString(), !isStatement),
6459
- line(`Damage Threat:`, (_d = (_c = event == null ? void 0 : event.properties) == null ? void 0 : _c.parameters) == null ? void 0 : _d.damage_threat, !isExpired),
6460
- line(`Flood Threat:`, (_f = (_e = event == null ? void 0 : event.properties) == null ? void 0 : _e.parameters) == null ? void 0 : _f.flood_threat, !isExpired),
6461
- line(`Tornado Threat:`, (_h = (_g = event == null ? void 0 : event.properties) == null ? void 0 : _g.parameters) == null ? void 0 : _h.tornado_threat, !isExpired),
6462
- 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),
6463
- 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),
6464
- line(`Discussion:`, (_z = (_y = event == null ? void 0 : event.properties) == null ? void 0 : _y.discussion_parameters) == null ? void 0 : _z.discussion_number, !isExpired),
6465
- line(`Concern:`, (_B = (_A = event == null ? void 0 : event.properties) == null ? void 0 : _A.discussion_parameters) == null ? void 0 : _B.discussion_concerning, !isExpired),
6466
- 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),
6467
- 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),
6468
- 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),
6469
- 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),
6470
- line(`Watch Number:`, (_N = (_M = event == null ? void 0 : event.properties) == null ? void 0 : _M.watch_parameters) == null ? void 0 : _N.watch_number, !isExpired),
6471
- 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),
6472
- 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),
6473
- 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),
6474
- 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),
6475
- 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),
6476
- 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),
6477
- 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),
6478
- 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),
6479
- 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),
6480
- 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),
6481
- line(`Tracking:`, (_Da = (_Ca = event == null ? void 0 : event.properties) == null ? void 0 : _Ca.metadata) == null ? void 0 : _Da.tracking)
6538
+ line(`Locations:`, (_c = (_b = event == null ? void 0 : event.properties) == null ? void 0 : _b.locations) == null ? void 0 : _c.slice(0, 100)),
6539
+ line(`Issued:`, `${new Date(event.properties.issued).toLocaleString([], { timeZone: timezone })} (${timezone.replace(`America/`, ``)})`, !isExpired),
6540
+ line(`Expires:`, `${new Date(event.properties.expires).toLocaleString([], { timeZone: timezone })} (${timezone.replace(`America/`, ``)})`, !isStatement),
6541
+ line(`Damage Threat:`, (_e = (_d = event == null ? void 0 : event.properties) == null ? void 0 : _d.parameters) == null ? void 0 : _e.damage_threat, !isExpired),
6542
+ line(`Flood Threat:`, (_g = (_f = event == null ? void 0 : event.properties) == null ? void 0 : _f.parameters) == null ? void 0 : _g.flood_threat, !isExpired),
6543
+ line(`Tornado Threat:`, (_i = (_h = event == null ? void 0 : event.properties) == null ? void 0 : _h.parameters) == null ? void 0 : _i.tornado_threat, !isExpired),
6544
+ line(`Estimated Wind Gusts:`, `${(_k = (_j = event == null ? void 0 : event.properties) == null ? void 0 : _j.parameters) == null ? void 0 : _k.estimated_wind_gusts} ${((_m = (_l = event == null ? void 0 : event.properties) == null ? void 0 : _l.parameters) == null ? void 0 : _m.wind_threat) ? ` (${(_o = (_n = event == null ? void 0 : event.properties) == null ? void 0 : _n.parameters) == null ? void 0 : _o.wind_threat})` : ""}`, !isExpired && ((_q = (_p = event == null ? void 0 : event.properties) == null ? void 0 : _p.parameters) == null ? void 0 : _q.estimated_wind_gusts) != null),
6545
+ line(`Estimated Hail Size:`, `${(_s = (_r = event == null ? void 0 : event.properties) == null ? void 0 : _r.parameters) == null ? void 0 : _s.estimated_hail_size} ${((_u = (_t = event == null ? void 0 : event.properties) == null ? void 0 : _t.parameters) == null ? void 0 : _u.hail_threat) ? ` (${(_w = (_v = event == null ? void 0 : event.properties) == null ? void 0 : _v.parameters) == null ? void 0 : _w.hail_threat})` : ""}`, !isExpired && ((_y = (_x = event == null ? void 0 : event.properties) == null ? void 0 : _x.parameters) == null ? void 0 : _y.estimated_hail_size) != null),
6546
+ line(`Discussion:`, (_A = (_z = event == null ? void 0 : event.properties) == null ? void 0 : _z.discussion_parameters) == null ? void 0 : _A.discussion_number, !isExpired),
6547
+ line(`Concern:`, (_C = (_B = event == null ? void 0 : event.properties) == null ? void 0 : _B.discussion_parameters) == null ? void 0 : _C.discussion_concerning, !isExpired),
6548
+ line(`SPC Max Tornado Threat:`, (_E = (_D = event == null ? void 0 : event.properties) == null ? void 0 : _D.discussion_parameters) == null ? void 0 : _E.discussion_max_tornado, !isExpired),
6549
+ line(`SPC Max Hail Threat:`, (_G = (_F = event == null ? void 0 : event.properties) == null ? void 0 : _F.discussion_parameters) == null ? void 0 : _G.discussion_max_hail, !isExpired),
6550
+ line(`SPC Max Wind Threat:`, (_I = (_H = event == null ? void 0 : event.properties) == null ? void 0 : _H.discussion_parameters) == null ? void 0 : _I.discussion_max_wind, !isExpired),
6551
+ line(`SPC Watch Issuance Probability:`, ((_K = (_J = event == null ? void 0 : event.properties) == null ? void 0 : _J.discussion_parameters) == null ? void 0 : _K.discussion_watch_issuance) ? `${(_M = (_L = event == null ? void 0 : event.properties) == null ? void 0 : _L.discussion_parameters) == null ? void 0 : _M.discussion_watch_issuance}%` : null, !isExpired),
6552
+ line(`Watch Number:`, (_O = (_N = event == null ? void 0 : event.properties) == null ? void 0 : _N.watch_parameters) == null ? void 0 : _O.watch_number, !isExpired),
6553
+ line(`Strong Tornadoes Probability:`, ((_Q = (_P = event == null ? void 0 : event.properties) == null ? void 0 : _P.watch_parameters) == null ? void 0 : _Q.strong_tornadoes_probability) ? `${(_S = (_R = event == null ? void 0 : event.properties) == null ? void 0 : _R.watch_parameters) == null ? void 0 : _S.strong_tornadoes_probability}%` : null, !isExpired),
6554
+ line(`Additional Tornadoes Probability:`, ((_U = (_T = event == null ? void 0 : event.properties) == null ? void 0 : _T.watch_parameters) == null ? void 0 : _U.additional_tornadoes_probability) ? `${(_W = (_V = event == null ? void 0 : event.properties) == null ? void 0 : _V.watch_parameters) == null ? void 0 : _W.additional_tornadoes_probability}%` : null, !isExpired),
6555
+ line(`Combined Hail/Wind Probability:`, ((_Y = (_X = event == null ? void 0 : event.properties) == null ? void 0 : _X.watch_parameters) == null ? void 0 : _Y.combined_hail_wind_probability) ? `${(__ = (_Z = event == null ? void 0 : event.properties) == null ? void 0 : _Z.watch_parameters) == null ? void 0 : __.combined_hail_wind_probability}%` : null, !isExpired),
6556
+ line(`Severe Hail Probability:`, ((_aa = (_$ = event == null ? void 0 : event.properties) == null ? void 0 : _$.watch_parameters) == null ? void 0 : _aa.severe_hail_probability) ? `${(_ca = (_ba = event == null ? void 0 : event.properties) == null ? void 0 : _ba.watch_parameters) == null ? void 0 : _ca.severe_hail_probability}%` : null, !isExpired),
6557
+ line(`Hail >2in Probability:`, ((_ea = (_da = event == null ? void 0 : event.properties) == null ? void 0 : _da.watch_parameters) == null ? void 0 : _ea.hail_2in_probability) ? `${(_ga = (_fa = event == null ? void 0 : event.properties) == null ? void 0 : _fa.watch_parameters) == null ? void 0 : _ga.hail_2in_probability}%` : null, !isExpired),
6558
+ line(`Max Hail Inches:`, (_ia = (_ha = event == null ? void 0 : event.properties) == null ? void 0 : _ha.watch_parameters) == null ? void 0 : _ia.max_hail_in, !isExpired),
6559
+ line(`Severe Wind Probability:`, ((_ka = (_ja = event == null ? void 0 : event.properties) == null ? void 0 : _ja.watch_parameters) == null ? void 0 : _ka.severe_wind_probability) ? `${(_ma = (_la = event == null ? void 0 : event.properties) == null ? void 0 : _la.watch_parameters) == null ? void 0 : _ma.severe_wind_probability}%` : null, !isExpired),
6560
+ line(`Max Surface Wind:`, (_oa = (_na = event == null ? void 0 : event.properties) == null ? void 0 : _na.watch_parameters) == null ? void 0 : _oa.max_wind_surface, !isExpired),
6561
+ line(`Max Tops (x100 feet):`, (_qa = (_pa = event == null ? void 0 : event.properties) == null ? void 0 : _pa.watch_parameters) == null ? void 0 : _qa.max_tops_x100feet, !isExpired),
6562
+ line(`Sender:`, ((_ta = (_sa = (_ra = event == null ? void 0 : event.properties) == null ? void 0 : _ra.geocode) == null ? void 0 : _sa.office) == null ? void 0 : _ta.name) ? `${(_wa = (_va = (_ua = event == null ? void 0 : event.properties) == null ? void 0 : _ua.geocode) == null ? void 0 : _va.office) == null ? void 0 : _wa.name} (${(_za = (_ya = (_xa = event == null ? void 0 : event.properties) == null ? void 0 : _xa.geocode) == null ? void 0 : _ya.office) == null ? void 0 : _za.office})` : (_Ca = (_Ba = (_Aa = event == null ? void 0 : event.properties) == null ? void 0 : _Aa.geocode) == null ? void 0 : _Ba.office) == null ? void 0 : _Ca.office),
6563
+ line(`Tracking:`, (_Ea = (_Da = event == null ? void 0 : event.properties) == null ? void 0 : _Da.metadata) == null ? void 0 : _Ea.tracking)
6482
6564
  ].filter(Boolean).join("\n");
6483
6565
  };
6484
6566
 
6485
- // src/@modules/@utilities/utilities.createHttp.ts
6486
- var createHttp = (options) => __async(null, null, function* () {
6567
+ // src/@modules/@utilities/CreateHttp.ts
6568
+ var CreateHttp = (options) => __async(null, null, function* () {
6487
6569
  var _a, _b, _c, _d;
6488
6570
  const requestOptions = {
6489
6571
  method: (_a = options.method) != null ? _a : "GET",
@@ -6525,8 +6607,8 @@ var createHttp = (options) => __async(null, null, function* () {
6525
6607
  }
6526
6608
  });
6527
6609
 
6528
- // src/@modules/@utilities/utilities.getMatched.ts
6529
- var getMatched = (strings, string) => {
6610
+ // src/@modules/@utilities/GetMatched.ts
6611
+ var GetMatched = (strings, string) => {
6530
6612
  const isMatched = strings.some((pattern) => {
6531
6613
  if (!pattern) return false;
6532
6614
  const lowerP = pattern.toLowerCase();
@@ -6541,150 +6623,204 @@ var getMatched = (strings, string) => {
6541
6623
  return isMatched;
6542
6624
  };
6543
6625
 
6544
- // src/@manager/manager.updateListener.ts
6545
- import { existsSync as existsSync2, mkdirSync as mkdirSync2, writeFileSync as writeFileSync3, readFileSync as readFileSync2, appendFileSync } from "fs";
6546
- var updateListener = (event) => __async(null, null, function* () {
6547
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p;
6626
+ // src/@manager/Tasks.ts
6627
+ import { mkdir, writeFile, readFile, appendFile } from "fs/promises";
6628
+ var Tasks = (events) => __async(null, null, function* () {
6629
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t;
6548
6630
  const tick = performance.now();
6549
6631
  const settings = bootstrap.settings;
6550
- const listeners2 = settings.ListenerSettings;
6551
- const properties2 = event.properties;
6552
- const metadata = {
6553
- file: null,
6554
- eas: null,
6555
- json: null,
6556
- name: properties2.event,
6557
- status: properties2.status,
6558
- description: properties2.description,
6559
- tracking: properties2.metadata.tracking,
6560
- header: properties2.metadata.header,
6561
- raw: properties2.metadata.raw,
6562
- expired: properties2.status_metadata.is_expired,
6563
- attachments: properties2.metadata.attachments
6564
- };
6565
- for (const listener2 of listeners2) {
6566
- const events = listener2 == null ? void 0 : listener2.Events;
6567
- const webhook = listener2 == null ? void 0 : listener2.Webhook;
6568
- const notify = listener2 == null ? void 0 : listener2.NotificationServer;
6569
- const uploads = listener2 == null ? void 0 : listener2.Uploads;
6570
- const isMatched = getMatched(events != null ? events : [], metadata.name);
6571
- if ((events == null ? void 0 : events.length) == 0 || isMatched) {
6572
- if (uploads == null ? void 0 : uploads.EAS) {
6573
- metadata.eas = yield setEasTone({
6574
- title: `${metadata.name}_${metadata.status}_${metadata.tracking}`,
6575
- message: metadata.description,
6576
- header: metadata.header
6577
- });
6578
- }
6579
- if (uploads == null ? void 0 : uploads.File) {
6580
- const fDestination = settings.GlobalSettings.ArchiveSettings.TextDirectory;
6581
- if (fDestination) {
6582
- const file = `${fDestination}/${metadata.name}_${metadata.tracking}.txt`.replace(/[\\:*?"<>|]/g, "_").replace(/\s+/g, " ").trim();
6583
- if (!existsSync2(fDestination)) {
6584
- mkdirSync2(fDestination, { recursive: true });
6585
- }
6586
- if (existsSync2(file)) {
6587
- appendFileSync(file, `${`
6588
- `.repeat(10)}${metadata.raw}`);
6589
- } else {
6590
- writeFileSync3(file, metadata.raw);
6632
+ const notifyServer = settings.NotifyServer;
6633
+ const actions = settings.ActionSettings;
6634
+ for (const event of events) {
6635
+ const properties = event.properties;
6636
+ const hasActions = Array.isArray(actions) && actions.length > 0;
6637
+ if (!hasActions) {
6638
+ SetDebug({ title: `Tasks`, message: `${Math.round(performance.now() - tick)}ms` });
6639
+ return;
6640
+ }
6641
+ const metadata = {
6642
+ text: null,
6643
+ eas: null,
6644
+ json: null,
6645
+ name: properties.event,
6646
+ status: properties.status,
6647
+ description: properties.description,
6648
+ tracking: properties.metadata.tracking,
6649
+ header: properties.metadata.header,
6650
+ raw: properties.metadata.raw,
6651
+ expired: properties.status_metadata.is_expired,
6652
+ attachments: properties.metadata.attachments
6653
+ };
6654
+ const archiveSettings = (_a = settings.GlobalSettings) == null ? void 0 : _a.ArchiveSettings;
6655
+ const textArchiveDir = archiveSettings == null ? void 0 : archiveSettings.TextDirectory;
6656
+ const jsonArchiveDir = archiveSettings == null ? void 0 : archiveSettings.JSONDirectory;
6657
+ const eventBaseName = `${metadata.name}_${metadata.tracking}`;
6658
+ const easTitle = `${metadata.name}_${metadata.status}_${metadata.tracking}`;
6659
+ const cleanedEventText = JSON.stringify(GetCleanedEvent(event), null, 2);
6660
+ const stringText = GetStringText(event);
6661
+ const embedText = GetEmebedText(event);
6662
+ for (const action of actions) {
6663
+ const events2 = action == null ? void 0 : action.Events;
6664
+ const webhook = action == null ? void 0 : action.Webhook;
6665
+ const notify = action == null ? void 0 : action.NotificationServer;
6666
+ const uploads = action == null ? void 0 : action.Uploads;
6667
+ const isMatched = GetMatched(events2 != null ? events2 : [], metadata.name);
6668
+ if ((events2 == null ? void 0 : events2.length) == 0 || isMatched) {
6669
+ const t = performance.now();
6670
+ if ((uploads == null ? void 0 : uploads.EAS) && !metadata.eas) {
6671
+ metadata.eas = yield GenerateEASMessage({
6672
+ title: easTitle,
6673
+ message: metadata.description,
6674
+ header: metadata.header
6675
+ });
6676
+ SetDebug({
6677
+ title: "Tasks/EAS",
6678
+ message: `${Math.round(performance.now() - t)}ms`
6679
+ });
6680
+ }
6681
+ if ((uploads == null ? void 0 : uploads.TEXT) && metadata.text === null) {
6682
+ const t2 = performance.now();
6683
+ if (textArchiveDir) {
6684
+ const file = `${textArchiveDir}/${eventBaseName}.txt`.replace(/[\\:*?"<>|]/g, "_").replace(/\s+/g, " ").trim();
6685
+ yield mkdir(textArchiveDir, { recursive: true });
6686
+ yield appendFile(file, `${"\n".repeat(7)}${metadata.raw}`);
6687
+ SetDebug({
6688
+ title: "Tasks/TEXT",
6689
+ message: `${Math.round(performance.now() - t2)}ms`
6690
+ });
6591
6691
  }
6692
+ metadata.text = metadata.raw;
6592
6693
  }
6593
- metadata.file = metadata.raw;
6594
- }
6595
- if (uploads == null ? void 0 : uploads.JSON) {
6596
- const eDestination = settings.GlobalSettings.ArchiveSettings.EventDirectory;
6597
- if (eDestination) {
6598
- const file = `${eDestination}/${metadata.name}_${metadata.tracking}.json`.replace(/[\\:*?"<>|]/g, "_").replace(/\s+/g, " ").trim();
6599
- if (!existsSync2(eDestination)) {
6600
- mkdirSync2(eDestination, { recursive: true });
6694
+ if ((uploads == null ? void 0 : uploads.JSON) && metadata.json === null) {
6695
+ const t2 = performance.now();
6696
+ if (jsonArchiveDir) {
6697
+ const file = `${jsonArchiveDir}/${eventBaseName}.json`.replace(/[\\:*?"<>|]/g, "_").replace(/\s+/g, " ").trim();
6698
+ yield mkdir(jsonArchiveDir, { recursive: true });
6699
+ yield writeFile(file, cleanedEventText);
6700
+ SetDebug({
6701
+ title: "Tasks/JSON",
6702
+ message: `${Math.round(performance.now() - t2)}ms`
6703
+ });
6601
6704
  }
6602
- writeFileSync3(file, JSON.stringify(getCleanedEvent(event), null, 2));
6705
+ metadata.json = cleanedEventText;
6603
6706
  }
6604
- metadata.json = JSON.stringify(getCleanedEvent(event), null, 2);
6605
- }
6606
- if (((_a = settings == null ? void 0 : settings.NotifyServer) == null ? void 0 : _a.Enabled) && (notify == null ? void 0 : notify.Enabled) && (notify == null ? void 0 : notify.Topic)) {
6607
- const server = settings == null ? void 0 : settings.NotifyServer;
6608
- const auth = ((_b = server == null ? void 0 : server.Credentials) == null ? void 0 : _b.Username) && ((_c = server == null ? void 0 : server.Credentials) == null ? void 0 : _c.Password) ? { username: (_e = (_d = settings == null ? void 0 : settings.NotifyServer) == null ? void 0 : _d.Credentials) == null ? void 0 : _e.Username, password: (_f = server == null ? void 0 : server.Credentials) == null ? void 0 : _f.Password } : void 0;
6609
- const attachment = metadata.eas && (server == null ? void 0 : server.Attachments) ? `${server == null ? void 0 : server.Attachments}/${metadata.name}_${metadata.status}_${metadata.tracking}.wav` : void 0;
6610
- const isRatelimited = setTimeoutAction({ identifier: metadata.tracking + `notify.server`, interval: 1, max: 1, addTime: true });
6611
- if (!isRatelimited.limited) {
6612
- yield createHttp(__spreadProps(__spreadValues({
6613
- url: `${(_g = server == null ? void 0 : server.Server) == null ? void 0 : _g.replace(/\/$/, "")}/${(_h = listener2 == null ? void 0 : listener2.NotificationServer) == null ? void 0 : _h.Topic}`,
6707
+ if ((notifyServer == null ? void 0 : notifyServer.Enabled) && (notify == null ? void 0 : notify.Enabled) && (notify == null ? void 0 : notify.Topic)) {
6708
+ let buttons = [];
6709
+ const t2 = performance.now();
6710
+ const auth = ((_b = notifyServer == null ? void 0 : notifyServer.Credentials) == null ? void 0 : _b.Username) && ((_c = notifyServer == null ? void 0 : notifyServer.Credentials) == null ? void 0 : _c.Password) ? { username: (_d = notifyServer == null ? void 0 : notifyServer.Credentials) == null ? void 0 : _d.Username, password: (_e = notifyServer == null ? void 0 : notifyServer.Credentials) == null ? void 0 : _e.Password } : void 0;
6711
+ const image = (_f = metadata.attachments) == null ? void 0 : _f.find((a) => a.name === "Image: Graphic");
6712
+ if ((_g = notifyServer == null ? void 0 : notifyServer.MediaStorage) == null ? void 0 : _g.EAS) {
6713
+ if (metadata.eas) {
6714
+ buttons.push({
6715
+ "action": "view",
6716
+ "label": "Listen",
6717
+ "url": `${(_h = notifyServer == null ? void 0 : notifyServer.MediaStorage) == null ? void 0 : _h.EAS}/${metadata.name}_${metadata.status}_${metadata.tracking}.wav`
6718
+ });
6719
+ }
6720
+ }
6721
+ if (metadata.json) {
6722
+ buttons.push({
6723
+ "action": "view",
6724
+ "label": "View JSON",
6725
+ "url": `${(_i = notifyServer == null ? void 0 : notifyServer.MediaStorage) == null ? void 0 : _i.JSON}/${metadata.name}_${metadata.tracking}.json`
6726
+ });
6727
+ }
6728
+ if (metadata.text) {
6729
+ buttons.push({
6730
+ "action": "view",
6731
+ "label": "View Text",
6732
+ "url": `${(_j = notifyServer == null ? void 0 : notifyServer.MediaStorage) == null ? void 0 : _j.TEXT}/${metadata.name}_${metadata.tracking}.txt`
6733
+ });
6734
+ }
6735
+ if (image) {
6736
+ buttons.push({
6737
+ "action": "view",
6738
+ "label": "View Image",
6739
+ "url": image.link
6740
+ });
6741
+ }
6742
+ yield CreateHttp(__spreadProps(__spreadValues({
6743
+ url: `${(_k = notifyServer == null ? void 0 : notifyServer.Server) == null ? void 0 : _k.replace(/\/$/, "")}/${notify.Topic}`,
6614
6744
  timeout: 15e3,
6615
- method: "POST"
6745
+ method: "PUT"
6616
6746
  }, auth && { auth }), {
6617
6747
  headers: __spreadValues({
6618
6748
  "Title": `${metadata.name} (${metadata.status})`,
6619
- "Tags": (_j = (_i = properties2.parameters.tags) == null ? void 0 : _i.join(",")) != null ? _j : "N/A",
6620
- "Expires": new Date(properties2.expires).getTime(),
6621
- "Priority": (notify == null ? void 0 : notify.Priority) ? notify.Priority.toString() : "5"
6622
- }, attachment && { "Attach": attachment }),
6623
- body: getStringText(event)
6749
+ "Tags": (_m = (_l = properties.parameters.tags) == null ? void 0 : _l.join(",")) != null ? _m : "N/A",
6750
+ "Priority": (_n = notify == null ? void 0 : notify.Priority) != null ? _n : "5"
6751
+ }, buttons.length > 0 && { "Actions": JSON.stringify(buttons) }),
6752
+ body: stringText
6624
6753
  }));
6754
+ SetDebug({
6755
+ title: "Tasks/NTFY",
6756
+ message: `${Math.round(performance.now() - t2)}ms`
6757
+ });
6625
6758
  }
6626
- }
6627
- if ((webhook == null ? void 0 : webhook.Enabled) && (webhook == null ? void 0 : webhook.Destination)) {
6628
- const isRatelimited = setTimeoutAction({ identifier: webhook.Destination, interval: ((_k = webhook.Ratelimit) != null ? _k : 2) * 2, max: (_l = webhook.Ratelimit) != null ? _l : 2, addTime: true });
6629
- const form = new FormData();
6630
- const embed = {
6631
- title: `${metadata.name} (${metadata.status})`,
6632
- description: getEmebedText(event),
6633
- fields: [],
6634
- color: 16711680,
6635
- timestamp: (/* @__PURE__ */ new Date()).toISOString(),
6636
- footer: { text: (_m = webhook.Title) != null ? _m : `AtmosphericX` }
6637
- };
6638
- if (isRatelimited.limited) {
6639
- return;
6640
- }
6641
- if (metadata.description && !metadata.expired) {
6642
- if (metadata.description.length > 900) {
6643
- metadata.description = metadata.description.substring(0, 900) + "\n\n[Message truncated due to length]";
6759
+ if ((webhook == null ? void 0 : webhook.Enabled) && (webhook == null ? void 0 : webhook.Destination)) {
6760
+ const t2 = performance.now();
6761
+ const isRatelimited = SetTimeoutAction({ identifier: webhook.Destination, interval: ((_o = webhook.Ratelimit) != null ? _o : 2) * 2, max: (_p = webhook.Ratelimit) != null ? _p : 2, addTime: true });
6762
+ const form = new FormData();
6763
+ const embed = {
6764
+ title: `${metadata.name} (${metadata.status})`,
6765
+ description: embedText,
6766
+ fields: [],
6767
+ color: 16711680,
6768
+ timestamp: (/* @__PURE__ */ new Date()).toISOString(),
6769
+ footer: { text: (_q = webhook.Title) != null ? _q : `AtmosphericX` }
6770
+ };
6771
+ if (isRatelimited.limited) {
6772
+ return;
6773
+ }
6774
+ if (metadata.description && !metadata.expired) {
6775
+ const description = metadata.description.length > 900 ? metadata.description.substring(0, 900) + "\n\n[Message truncated due to length]" : metadata.description;
6776
+ embed.fields.push({
6777
+ name: "Description",
6778
+ value: description ? "```\n" + description.split("\n").map((l) => l.trim()).filter(Boolean).join("\n") + "\n```" : ""
6779
+ });
6780
+ }
6781
+ if (((_r = metadata.attachments) == null ? void 0 : _r.length) > 0) {
6782
+ const attachments = metadata.attachments.slice(0, 5);
6783
+ embed.fields.push({
6784
+ name: "Attachments",
6785
+ value: attachments.map((attachment) => `- [${attachment.name.length > 45 ? attachment.name.substring(0, 45) + "..." : attachment.name}](${attachment.link})`).join("\n")
6786
+ });
6787
+ }
6788
+ if (uploads == null ? void 0 : uploads.TEXT) {
6789
+ form.append("fUpload", new Blob([Buffer.from(metadata.text)], { type: "application/text" }), `${properties.event}_${properties.status}_${properties.metadata.tracking}.txt`);
6790
+ }
6791
+ if (uploads == null ? void 0 : uploads.JSON) {
6792
+ form.append("fUpload2", new Blob([Buffer.from(metadata.json)], { type: "application/json" }), `${properties.event}_${properties.status}_${properties.metadata.tracking}.json`);
6793
+ }
6794
+ if (uploads == null ? void 0 : uploads.EAS) {
6795
+ if (metadata.eas) {
6796
+ const file = yield readFile(metadata.eas);
6797
+ form.append("fEas", new Blob([Buffer.from(file)], { type: "audio/mpeg" }), `${properties.event}_${properties.status}_${properties.metadata.tracking}_eas.mp3`);
6798
+ }
6644
6799
  }
6645
- embed.fields.push({
6646
- name: "Description",
6647
- value: metadata.description ? "```\n" + metadata.description.split("\n").map((l) => l.trim()).filter(Boolean).join("\n") + "\n```" : ""
6800
+ form.append("payload_json", JSON.stringify({
6801
+ username: (_s = webhook.Title) != null ? _s : "AtmosphericX",
6802
+ content: (_t = webhook.Message) != null ? _t : "",
6803
+ embeds: [embed]
6804
+ }));
6805
+ yield CreateHttp({
6806
+ url: webhook.Destination,
6807
+ timeout: 15e3,
6808
+ method: `POST`,
6809
+ body: form
6648
6810
  });
6649
- }
6650
- if (((_n = metadata.attachments) == null ? void 0 : _n.length) > 0) {
6651
- metadata.attachments = metadata.attachments.slice(0, 5);
6652
- embed.fields.push({
6653
- name: "Attachments",
6654
- value: metadata.attachments.map((attachment) => `- [${attachment.name.length > 45 ? attachment.name.substring(0, 45) + "..." : attachment.name}](${attachment.link})`).join("\n")
6811
+ SetDebug({
6812
+ title: "Tasks/Webhook",
6813
+ message: `${Math.round(performance.now() - t2)}ms`
6655
6814
  });
6656
6815
  }
6657
- if (uploads == null ? void 0 : uploads.File) {
6658
- form.append("fUpload", new Blob([Buffer.from(metadata.file)], { type: "application/text" }), `${properties2.event}_${properties2.status}_${properties2.metadata.tracking}.txt`);
6659
- }
6660
- if (uploads == null ? void 0 : uploads.JSON) {
6661
- form.append("fUpload2", new Blob([Buffer.from(metadata.json)], { type: "application/json" }), `${properties2.event}_${properties2.status}_${properties2.metadata.tracking}.json`);
6662
- }
6663
- if (uploads == null ? void 0 : uploads.EAS) {
6664
- if (metadata.eas) {
6665
- const file = readFileSync2(metadata.eas);
6666
- form.append("fEas", new Blob([Buffer.from(file)], { type: "audio/mpeg" }), `${properties2.event}_${properties2.status}_${properties2.metadata.tracking}_eas.mp3`);
6667
- }
6668
- }
6669
- form.append("payload_json", JSON.stringify({
6670
- username: (_o = webhook.Title) != null ? _o : "AtmosphericX",
6671
- content: (_p = webhook.Message) != null ? _p : "",
6672
- embeds: [embed]
6673
- }));
6674
- yield createHttp({
6675
- url: webhook.Destination,
6676
- timeout: 15e3,
6677
- method: `POST`,
6678
- body: form
6679
- });
6680
6816
  }
6681
6817
  }
6682
6818
  }
6683
- setDebug({ title: `@manager.updateListener`, message: `Listener took ${performance.now() - tick} ms` });
6819
+ SetDebug({ title: `Tasks`, message: `${Math.round(performance.now() - tick)}ms` });
6684
6820
  });
6685
6821
 
6686
- // src/@modules/@utilities/utilities.getShapeNearestPoint.ts
6687
- var getShapeNearestPoint = (coordinates, point) => {
6822
+ // src/@modules/@utilities/GetShapeNearestPoint.ts
6823
+ var GetShapeNearestPoint = (coordinates, point) => {
6688
6824
  if (!coordinates || !point) {
6689
6825
  return { proximity: false, point: [0, 0], distance: null };
6690
6826
  }
@@ -6774,18 +6910,21 @@ var getShapeNearestPoint = (coordinates, point) => {
6774
6910
  return { proximity: distanceMiles === 0, point: closestPoint, distance: distanceMiles, distanceKm, distanceMeters };
6775
6911
  };
6776
6912
 
6777
- // src/@building/building.polygon.ts
6778
- var getEventNodes = (event) => __async(null, null, function* () {
6913
+ // src/@building/GetEventNodes.ts
6914
+ var GetEventNodes = (event) => __async(null, null, function* () {
6779
6915
  var _a, _b;
6916
+ const nodes = bootstrap.cache.nodes.features;
6917
+ if (!nodes || nodes.length === 0) {
6918
+ return { nodes: [], filtered: true, updated: Date.now() };
6919
+ }
6780
6920
  const metadata = { nodes: [], proximity: false, filtered: false };
6781
- const geometry = yield getEventGeometry(event);
6921
+ const geometry = yield GetEventGeometry(event);
6782
6922
  if (!geometry || !geometry.coordinates) {
6783
6923
  return { nodes: [], filtered: false, updated: Date.now() };
6784
6924
  }
6785
- const nodes = bootstrap.cache.nodes.features;
6786
6925
  for (const node of nodes) {
6787
6926
  const [longitude, latitude] = node.geometry.coordinates;
6788
- const getPoint = getShapeNearestPoint(geometry.coordinates, [longitude, latitude]);
6927
+ const getPoint = GetShapeNearestPoint(geometry.coordinates, [longitude, latitude]);
6789
6928
  const miles = (_a = getPoint.distance) != null ? _a : null;
6790
6929
  const kilometers = Number((miles * 1.609344).toFixed(3));
6791
6930
  const info = {
@@ -6794,10 +6933,10 @@ var getEventNodes = (event) => __async(null, null, function* () {
6794
6933
  nearest: getPoint.point,
6795
6934
  miles,
6796
6935
  kilometers,
6797
- proximity: getPoint.proximity
6936
+ proximity: false
6798
6937
  };
6799
6938
  metadata.nodes.push(info);
6800
- if (bootstrap.settings.GlobalSettings.EventFiltering.NodeLocationFiltering && miles < bootstrap.settings.GlobalSettings.NodeMinDistance) {
6939
+ if (miles != null && bootstrap.settings.GlobalSettings.EventFiltering.NodeLocationFiltering && miles < bootstrap.settings.GlobalSettings.NodeMaxDistance) {
6801
6940
  metadata.proximity = true;
6802
6941
  info.proximity = true;
6803
6942
  }
@@ -6809,19 +6948,20 @@ var getEventNodes = (event) => __async(null, null, function* () {
6809
6948
  };
6810
6949
  });
6811
6950
 
6812
- // src/@manager/manager.updateNodes.ts
6813
- var updateNode = (selectedEvent) => __async(null, null, function* () {
6951
+ // src/@manager/UpdateNode.ts
6952
+ var UpdateNode = (selectedEvent) => __async(null, null, function* () {
6814
6953
  const events = bootstrap.cache.events.features;
6815
6954
  const ttl = bootstrap.settings.GlobalSettings.NodeTTL * 1e3;
6816
6955
  let total = 0;
6956
+ const TTLEvents = selectedEvent ? [selectedEvent] : events.filter((evt) => {
6957
+ var _a, _b, _c;
6958
+ const lastUpdate = (_c = (_b = (_a = evt == null ? void 0 : evt.properties) == null ? void 0 : _a.metadata) == null ? void 0 : _b.updated) != null ? _c : null;
6959
+ return lastUpdate == null || Date.now() - lastUpdate >= ttl;
6960
+ });
6961
+ if (TTLEvents.length === 0) return;
6817
6962
  function update(evt) {
6818
6963
  return __async(this, null, function* () {
6819
- var _a, _b, _c;
6820
- const lastUpdate = (_c = (_b = (_a = evt == null ? void 0 : evt.properties) == null ? void 0 : _a.metadata) == null ? void 0 : _b.updated) != null ? _c : null;
6821
- if (lastUpdate != null && Date.now() - lastUpdate < ttl) {
6822
- return evt;
6823
- }
6824
- const node = yield getEventNodes(evt);
6964
+ const node = yield GetEventNodes(evt);
6825
6965
  if (node.nodes.length > 0) {
6826
6966
  total++;
6827
6967
  }
@@ -6830,16 +6970,13 @@ var updateNode = (selectedEvent) => __async(null, null, function* () {
6830
6970
  evt.properties.metadata.updated = node.updated;
6831
6971
  });
6832
6972
  }
6833
- if (!selectedEvent) {
6834
- yield Promise.all(events.map((evt) => __async(null, null, function* () {
6835
- yield update(evt);
6836
- })));
6837
- }
6838
- if (selectedEvent) {
6839
- yield update(selectedEvent);
6973
+ const concurrency = 4;
6974
+ for (let index = 0; index < TTLEvents.length; index += concurrency) {
6975
+ const batch = TTLEvents.slice(index, index + concurrency);
6976
+ yield Promise.all(batch.map((evt) => update(evt)));
6840
6977
  }
6841
6978
  if (total > 0) {
6842
- setEventEmit({
6979
+ SetEventEmit({
6843
6980
  event: `onNodeUpdate`,
6844
6981
  metadata: {
6845
6982
  type: `global-update`,
@@ -6849,73 +6986,82 @@ var updateNode = (selectedEvent) => __async(null, null, function* () {
6849
6986
  }
6850
6987
  });
6851
6988
 
6852
- // src/@manager/manager.mkEvent.ts
6853
- var mkEvent = (event) => __async(null, null, function* () {
6989
+ // src/@manager/MakeEvents.ts
6990
+ var MakeEvents = (events) => __async(null, null, function* () {
6854
6991
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w;
6992
+ let tasked = [];
6855
6993
  const settings = bootstrap.settings;
6856
- const features = bootstrap.cache.events.features;
6857
- const getHash = event.properties.metadata.hash;
6858
- const getTracking = event.properties.metadata.tracking;
6859
- const isEntry = (_a = bootstrap.cache.hashes) == null ? void 0 : _a.find((hash) => hash.tracking === getTracking);
6860
- const isHashed = (_c = (_b = isEntry == null ? void 0 : isEntry.hashes) == null ? void 0 : _b.includes(getHash)) != null ? _c : false;
6861
- const getFeature = features.find((feature) => feature.properties.metadata.tracking === getTracking);
6862
- if (isHashed || event.properties.status_metadata.is_expired) return;
6863
- setHash(event, isEntry);
6864
- const isFilteredLocation = yield updateNode(event).then(() => event.properties.metadata.filtered_proximity);
6865
- if (!isFilteredLocation && !dict_global.includes(event.properties.event.toLowerCase()) && settings.GlobalSettings.EventFiltering.NodeLocationFiltering) {
6866
- return;
6867
- }
6868
- const isRatelimited = setTimeoutAction({ identifier: getTracking, interval: 1, max: 1, addTime: true });
6869
- if (!isRatelimited.limited) {
6870
- setEventEmit({
6871
- event: `onEventStatus`,
6872
- metadata: {
6873
- type: getFeature ? `Updated` : `New`,
6874
- event
6875
- },
6876
- message: `[${getFeature ? "Updated" : "New"}] ${event.properties.event} (${event.properties.status}) (${event.properties.metadata.tracking})`
6877
- });
6878
- }
6879
- if (settings.GlobalSettings.EventManagement) {
6880
- if (event.properties.status_metadata.is_issued || event.properties.status_metadata.is_updated) {
6881
- if (getFeature) {
6882
- const getIndex = features.indexOf(getFeature);
6883
- const cHistory = (_f = (_e = (_d = getFeature == null ? void 0 : getFeature.properties) == null ? void 0 : _d.metadata) == null ? void 0 : _e.history) != null ? _f : [];
6884
- const cLocations = (_i = (_h = (_g = getFeature == null ? void 0 : getFeature.properties) == null ? void 0 : _g.locations) == null ? void 0 : _h.split(";").map((l) => l.trim())) != null ? _i : [];
6885
- const cUgc = (_l = (_k = (_j = getFeature == null ? void 0 : getFeature.properties) == null ? void 0 : _j.geocode) == null ? void 0 : _k.ugc) != null ? _l : [];
6886
- const iHistory = (_o = (_n = (_m = event.properties) == null ? void 0 : _m.metadata) == null ? void 0 : _n.history) != null ? _o : [];
6887
- const iLocations = (_r = (_q = (_p = event.properties) == null ? void 0 : _p.locations) == null ? void 0 : _q.split(";").map((l) => l.trim())) != null ? _r : [];
6888
- const iUgc = (_u = (_t = (_s = event.properties) == null ? void 0 : _s.geocode) == null ? void 0 : _t.ugc) != null ? _u : [];
6889
- const mHistory = [...cHistory, ...iHistory].filter((v, i, a) => a.indexOf(v) === i).filter((v, i, a) => a.findIndex((h) => h.description === v.description && h.issued === v.issued) === i);
6890
- const mLocations = [...cLocations, ...iLocations].filter((v, i, a) => a.indexOf(v) === i).join("; ");
6891
- const mUgc = [...cUgc, ...iUgc].filter((v, i, a) => a.indexOf(v) === i);
6892
- bootstrap.cache.events.features[getIndex] = __spreadProps(__spreadValues({}, event), {
6893
- properties: __spreadProps(__spreadValues({}, event.properties), {
6894
- metadata: __spreadProps(__spreadValues({}, (_v = event == null ? void 0 : event.properties) == null ? void 0 : _v.metadata), {
6895
- history: mHistory
6896
- }),
6897
- locations: mLocations,
6898
- geocode: __spreadProps(__spreadValues({}, (_w = event == null ? void 0 : event.properties) == null ? void 0 : _w.geocode), {
6899
- ugc: mUgc
6994
+ if (events.length === 0) return;
6995
+ for (const event of events) {
6996
+ const features = bootstrap.cache.events.features;
6997
+ const getHash = event.properties.metadata.hash;
6998
+ const getTracking = event.properties.metadata.tracking;
6999
+ const isEntry = (_a = bootstrap.cache.hashes) == null ? void 0 : _a.find((hash) => hash.tracking === getTracking);
7000
+ const isHashed = (_c = (_b = isEntry == null ? void 0 : isEntry.hashes) == null ? void 0 : _b.includes(getHash)) != null ? _c : false;
7001
+ const isNodeFiltering = settings.GlobalSettings.EventFiltering.NodeLocationFiltering;
7002
+ const getFeature = features.find((feature) => feature.properties.metadata.tracking === getTracking);
7003
+ if (isHashed || event.properties.status_metadata.is_expired) return;
7004
+ SetHash(event, isEntry);
7005
+ if (isNodeFiltering) {
7006
+ yield UpdateNode(event);
7007
+ if (!event.properties.metadata.filtered_proximity && !EnumGlobalFilter.includes(event.properties.event.toLowerCase())) {
7008
+ return;
7009
+ }
7010
+ }
7011
+ const isRatelimited = SetTimeoutAction({ identifier: getTracking, interval: 1, max: 1, addTime: true });
7012
+ if (!isRatelimited.limited) {
7013
+ SetEventEmit({
7014
+ event: `onEventStatus`,
7015
+ metadata: {
7016
+ type: getFeature ? `Updated` : `New`,
7017
+ event
7018
+ },
7019
+ message: `[${getFeature ? "Updated" : "New"}] ${event.properties.event} (${event.properties.status}) (${event.properties.metadata.tracking})`
7020
+ });
7021
+ }
7022
+ if (settings.GlobalSettings.EventManagement) {
7023
+ if (event.properties.status_metadata.is_issued || event.properties.status_metadata.is_updated) {
7024
+ if (getFeature) {
7025
+ const getIndex = features.indexOf(getFeature);
7026
+ const cHistory = (_f = (_e = (_d = getFeature == null ? void 0 : getFeature.properties) == null ? void 0 : _d.metadata) == null ? void 0 : _e.history) != null ? _f : [];
7027
+ const cLocations = (_i = (_h = (_g = getFeature == null ? void 0 : getFeature.properties) == null ? void 0 : _g.locations) == null ? void 0 : _h.split(";").map((l) => l.trim())) != null ? _i : [];
7028
+ const cUgc = (_l = (_k = (_j = getFeature == null ? void 0 : getFeature.properties) == null ? void 0 : _j.geocode) == null ? void 0 : _k.ugc) != null ? _l : [];
7029
+ const iHistory = (_o = (_n = (_m = event.properties) == null ? void 0 : _m.metadata) == null ? void 0 : _n.history) != null ? _o : [];
7030
+ const iLocations = (_r = (_q = (_p = event.properties) == null ? void 0 : _p.locations) == null ? void 0 : _q.split(";").map((l) => l.trim())) != null ? _r : [];
7031
+ const iUgc = (_u = (_t = (_s = event.properties) == null ? void 0 : _s.geocode) == null ? void 0 : _t.ugc) != null ? _u : [];
7032
+ const mHistory = [...cHistory, ...iHistory].filter((v, i, a) => a.indexOf(v) === i).filter((v, i, a) => a.findIndex((h) => h.description === v.description && h.issued === v.issued) === i);
7033
+ const mLocations = [...cLocations, ...iLocations].filter((v, i, a) => a.indexOf(v) === i).join("; ");
7034
+ const mUgc = [...cUgc, ...iUgc].filter((v, i, a) => a.indexOf(v) === i);
7035
+ bootstrap.cache.events.features[getIndex] = __spreadProps(__spreadValues({}, event), {
7036
+ properties: __spreadProps(__spreadValues({}, event.properties), {
7037
+ metadata: __spreadProps(__spreadValues({}, (_v = event == null ? void 0 : event.properties) == null ? void 0 : _v.metadata), {
7038
+ history: mHistory
7039
+ }),
7040
+ locations: mLocations,
7041
+ geocode: __spreadProps(__spreadValues({}, (_w = event == null ? void 0 : event.properties) == null ? void 0 : _w.geocode), {
7042
+ ugc: mUgc
7043
+ })
6900
7044
  })
6901
- })
6902
- });
6903
- yield updateListener(bootstrap.cache.events.features[getIndex]);
6904
- } else {
6905
- features.push(event);
6906
- yield updateListener(event);
7045
+ });
7046
+ tasked.push(bootstrap.cache.events.features[getIndex]);
7047
+ } else {
7048
+ features.push(event);
7049
+ tasked.push(event);
7050
+ }
6907
7051
  }
6908
7052
  }
6909
7053
  }
7054
+ yield Tasks(tasked);
7055
+ SetEventEmit({ event: `onEventCache`, metadata: bootstrap.cache.events, limited: true });
6910
7056
  });
6911
7057
 
6912
- // src/@dictionaries/dictionaries.strings.ts
6913
- var dict_strings = {
6914
- cancellation: `{EVENT} has been allowed to expire. This product is no longer in effect.`
7058
+ // src/@enums/Strings.ts
7059
+ var EnumStrings = {
7060
+ cancellation: `{EVENT} has been allowed to expire. This event is no longer in effect.`
6915
7061
  };
6916
7062
 
6917
- // src/@manager/manager.rmEvent.ts
6918
- var rmEvent = (event, isTimeBasedExpiration) => __async(null, null, function* () {
7063
+ // src/@manager/RemoveEvent.ts
7064
+ var RemoveEvent = (event, isTimeBasedExpiration) => __async(null, null, function* () {
6919
7065
  const gTracking = event.properties.metadata.tracking;
6920
7066
  const isTrackingEventLogged = bootstrap.cache.events.features.find((f) => {
6921
7067
  var _a, _b;
@@ -6926,35 +7072,35 @@ var rmEvent = (event, isTimeBasedExpiration) => __async(null, null, function* ()
6926
7072
  event.properties.expires = (/* @__PURE__ */ new Date()).toISOString();
6927
7073
  event.properties.status = `Expired`;
6928
7074
  event.properties.status_metadata.is_expired = true;
6929
- const description = isTimeBasedExpiration ? dict_strings.cancellation.replace(`{SENDER}`, event.properties.geocode.office.name).replace(`{EVENT}`, event.properties.event) : event.properties.metadata.raw;
6930
- event.properties.description = event.properties.metadata.raw = description;
7075
+ const description = isTimeBasedExpiration ? EnumStrings.cancellation.replace(`{SENDER}`, event.properties.geocode.office.name).replace(`{EVENT}`, event.properties.event) : event.properties.description;
7076
+ event.properties.description = description;
7077
+ event.properties.metadata.raw = isTimeBasedExpiration ? description : event.properties.metadata.raw;
6931
7078
  event.properties.metadata.history.push({
6932
- description,
7079
+ description: isTimeBasedExpiration ? description : event.properties.description,
6933
7080
  issued: event.properties.expires,
6934
7081
  status: event.properties.status
6935
7082
  });
6936
7083
  bootstrap.cache.events.features.splice(bootstrap.cache.events.features.indexOf(isTrackingEventLogged), 1);
6937
7084
  bootstrap.cache.hashes = bootstrap.cache.hashes.filter((hash) => hash.tracking !== gTracking);
6938
7085
  if (!isStatement) {
6939
- setEventEmit({
7086
+ SetEventEmit({
6940
7087
  event: `onEventStatus`,
6941
7088
  metadata: { type: `Removed`, event },
6942
7089
  message: `[Removed] ${event.properties.event} (${event.properties.status}) (${gTracking})`
6943
7090
  });
6944
- yield updateListener(event);
7091
+ yield Tasks([event]);
6945
7092
  }
6946
- setTimeoutAction({ identifier: gTracking, expire: true });
6947
- setTimeoutAction({ identifier: gTracking + `notify.server`, expire: true });
7093
+ SetTimeoutAction({ identifier: gTracking, expire: true });
6948
7094
  }
6949
- setEventEmit({
7095
+ SetEventEmit({
6950
7096
  event: `onEventCache`,
6951
7097
  metadata: bootstrap.cache.events,
6952
7098
  limited: true
6953
7099
  });
6954
7100
  });
6955
7101
 
6956
- // src/@dictionaries/dictionaries.states.ts
6957
- var dict_states = {
7102
+ // src/@enums/States.ts
7103
+ var EnumStates = {
6958
7104
  "AL": "Alabama",
6959
7105
  "AK": "Alaska",
6960
7106
  "AZ": "Arizona",
@@ -7008,8 +7154,8 @@ var dict_states = {
7008
7154
  "DC": "District of Columbia"
7009
7155
  };
7010
7156
 
7011
- // src/@modules/@utilities/utilities.getLatestIssuance.ts
7012
- var getLatestIssuance = () => {
7157
+ // src/@modules/@utilities/GetLatestIssuance.ts
7158
+ var GetLatestIssuance = () => {
7013
7159
  const now = /* @__PURE__ */ new Date();
7014
7160
  const current = now.getUTCHours() * 100 + now.getUTCMinutes();
7015
7161
  const issuances = [100, 600, 1300, 1630, 2e3];
@@ -7022,11 +7168,12 @@ var getLatestIssuance = () => {
7022
7168
  return latest.toString().padStart(4, "0");
7023
7169
  };
7024
7170
 
7025
- // src/@building/building.attachments.ts
7026
- var getEventAttachments = (event) => {
7171
+ // src/@building/GetEventAttachments.ts
7172
+ var GetEventAttachments = (event) => {
7027
7173
  var _a, _b, _c, _d, _e, _f, _g;
7028
7174
  let attachments = [];
7029
- const issuanceTime = getLatestIssuance();
7175
+ const settings = bootstrap.settings;
7176
+ const issuanceTime = GetLatestIssuance();
7030
7177
  const spcNumber = (_b = (_a = event == null ? void 0 : event.properties) == null ? void 0 : _a.discussion_parameters) == null ? void 0 : _b.discussion_number;
7031
7178
  const watchNumber = (_d = (_c = event == null ? void 0 : event.properties) == null ? void 0 : _c.watch_parameters) == null ? void 0 : _d.watch_number;
7032
7179
  const locations = (_e = event == null ? void 0 : event.properties) == null ? void 0 : _e.locations_array;
@@ -7043,34 +7190,36 @@ var getEventAttachments = (event) => {
7043
7190
  if (events.find((e) => e.target === event.properties.event)) {
7044
7191
  attachments.push({ name: `Image: Graphic`, link: events.find((e) => e.target.toLowerCase() === event.properties.event.toLowerCase()).attachment });
7045
7192
  }
7046
- for (const location of locations) {
7047
- if (dict_expressions.location.test(location)) {
7048
- const lines = [`Northern`, `Southern`, `Eastern`, `Western`, `Inland`, `Costal`, `County`];
7049
- const county = (_f = location == null ? void 0 : location.split(",")[0]) == null ? void 0 : _f.trim().replace(new RegExp(`^(${lines.join("|")}) `), "");
7050
- const state = dict_states[(_g = location == null ? void 0 : location.split(",")[1]) == null ? void 0 : _g.trim()];
7051
- const feeds = bootstrap.database.prepare(`SELECT * FROM broadcastify WHERE state = ? AND county = ?`).all(state, county).sort((a, b) => {
7052
- const typeOrder = ["Other", "Public Safety"];
7053
- const indexA = typeOrder.indexOf(a.type);
7054
- const indexB = typeOrder.indexOf(b.type);
7055
- return indexA - indexB;
7056
- });
7057
- const tags = bootstrap.settings.BroadcastifySettings.BroadcastifyTags;
7058
- const filtered = feeds.filter((feed) => tags.includes(feed.type));
7059
- if (filtered.length > 0) {
7060
- filtered.map((filtered2) => {
7061
- if (!attachments.some((a) => a.link === filtered2.link)) {
7062
- attachments.push({ name: `${filtered2.type}: ${filtered2.feed}`, link: filtered2.link });
7063
- }
7193
+ if (settings.BroadcastifySettings.BroadcastifyAttachments) {
7194
+ for (const location of locations) {
7195
+ if (EnumExpressions.location.test(location)) {
7196
+ const lines = [`Northern`, `Southern`, `Eastern`, `Western`, `Inland`, `Costal`, `County`];
7197
+ const county = (_f = location == null ? void 0 : location.split(",")[0]) == null ? void 0 : _f.trim().replace(new RegExp(`^(${lines.join("|")}) `), "");
7198
+ const state = EnumStates[(_g = location == null ? void 0 : location.split(",")[1]) == null ? void 0 : _g.trim()];
7199
+ const feeds = bootstrap.database.prepare(`SELECT * FROM broadcastify WHERE state = ? AND county = ?`).all(state, county).sort((a, b) => {
7200
+ const typeOrder = ["Other", "Public Safety"];
7201
+ const indexA = typeOrder.indexOf(a.type);
7202
+ const indexB = typeOrder.indexOf(b.type);
7203
+ return indexA - indexB;
7064
7204
  });
7205
+ const tags = bootstrap.settings.BroadcastifySettings.BroadcastifyTags;
7206
+ const filtered = feeds.filter((feed) => tags.includes(feed.type));
7207
+ if (filtered.length > 0) {
7208
+ filtered.map((filtered2) => {
7209
+ if (!attachments.some((a) => a.link === filtered2.link)) {
7210
+ attachments.push({ name: `${filtered2.type}: ${filtered2.feed}`, link: filtered2.link });
7211
+ }
7212
+ });
7213
+ }
7065
7214
  }
7066
7215
  }
7067
7216
  }
7068
7217
  return attachments;
7069
7218
  };
7070
7219
 
7071
- // src/@building/building.validate.ts
7220
+ // src/@manager/ValidateEvents.ts
7072
7221
  import { createHash } from "crypto";
7073
- var validateEvents = (events) => __async(null, null, function* () {
7222
+ var ValidateEvents = (events) => __async(null, null, function* () {
7074
7223
  const tick = performance.now();
7075
7224
  if (events.length === 0) return;
7076
7225
  const configurations = bootstrap.settings;
@@ -7088,21 +7237,21 @@ var validateEvents = (events) => __async(null, null, function* () {
7088
7237
  }
7089
7238
  const isFiltered = (define2) => {
7090
7239
  var _a, _b, _c, _d;
7091
- const properties2 = define2.properties;
7092
- const zones = properties2.geocode.ugc;
7093
- const icao = properties2.geocode.office.office;
7094
- if (properties2.status_metadata.is_test) {
7095
- setEventEmit({ event: `onTestProduct`, metadata: define2 });
7240
+ const properties = define2.properties;
7241
+ const zones = properties.geocode.ugc;
7242
+ const icao = properties.geocode.office.office;
7243
+ if (properties.status_metadata.is_test) {
7244
+ SetEventEmit({ event: `onTestProduct`, metadata: define2 });
7096
7245
  if (bools == null ? void 0 : bools.IgnoreTestProducts) return true;
7097
7246
  }
7098
- if (properties2.status_metadata.is_expired) {
7099
- setEventEmit({ event: `onExpiredProduct`, metadata: define2 });
7100
- rmEvent(define2, false);
7247
+ if (properties.status_metadata.is_expired) {
7248
+ SetEventEmit({ event: `onExpiredProduct`, metadata: define2 });
7249
+ RemoveEvent(define2, false);
7101
7250
  return true;
7102
7251
  }
7103
- if (((_b = (_a = properties2.metadata) == null ? void 0 : _a.vtec) == null ? void 0 : _b.is_watch) && properties2.metadata.source != `events.api`) {
7104
- const isSPC = (_d = (_c = properties2.metadata) == null ? void 0 : _c.vtec) == null ? void 0 : _d.prediction_center;
7105
- setEventEmit({ event: isSPC ? `onStormPredictionWatch` : `onNonStormPredictionWatch`, metadata: define2 });
7252
+ if (((_b = (_a = properties.metadata) == null ? void 0 : _a.vtec) == null ? void 0 : _b.is_watch) && properties.metadata.source != `events.api`) {
7253
+ const isSPC = (_d = (_c = properties.metadata) == null ? void 0 : _c.vtec) == null ? void 0 : _d.prediction_center;
7254
+ SetEventEmit({ event: isSPC ? `onStormPredictionWatch` : `onNonStormPredictionWatch`, metadata: define2 });
7106
7255
  if ((bools == null ? void 0 : bools.SPCWatchesOnly) && !isSPC) {
7107
7256
  return true;
7108
7257
  }
@@ -7113,43 +7262,43 @@ var validateEvents = (events) => __async(null, null, function* () {
7113
7262
  for (const key in sets) {
7114
7263
  const setting = sets[key];
7115
7264
  const values = [...setting];
7116
- if (key === "ListeningEvents" && setting.size > 0 && !getMatched(values, define2.properties.event)) {
7117
- setEventEmit({
7265
+ if (key === "ListeningEvents" && setting.size > 0 && !GetMatched(values, define2.properties.event)) {
7266
+ SetEventEmit({
7118
7267
  event: `onFilteredEvent`,
7119
7268
  metadata: define2
7120
7269
  });
7121
7270
  return true;
7122
7271
  }
7123
- if (key === "IgnoredEvents" && setting.size > 0 && getMatched(values, define2.properties.event)) {
7124
- setEventEmit({
7272
+ if (key === "IgnoredEvents" && setting.size > 0 && GetMatched(values, define2.properties.event)) {
7273
+ SetEventEmit({
7125
7274
  event: `onIgnoredEvent`,
7126
7275
  metadata: define2
7127
7276
  });
7128
7277
  return true;
7129
7278
  }
7130
7279
  if (key === "ListeningICAO" && setting.size > 0 && icao != null && !setting.has(icao.toLowerCase())) {
7131
- setEventEmit({
7280
+ SetEventEmit({
7132
7281
  event: `onFilteredICAO`,
7133
7282
  metadata: define2
7134
7283
  });
7135
7284
  return true;
7136
7285
  }
7137
7286
  if (key === "IgnoredICAO" && setting.size > 0 && icao != null && setting.has(icao.toLowerCase())) {
7138
- setEventEmit({
7287
+ SetEventEmit({
7139
7288
  event: `onIgnoredICAO`,
7140
7289
  metadata: define2
7141
7290
  });
7142
7291
  return true;
7143
7292
  }
7144
- if (key === "ListeningUGC" && setting.size > 0 && zones.length > 0 && !zones.some((ugc2) => setting.has(ugc2.toLowerCase()))) {
7145
- setEventEmit({
7293
+ if (key === "ListeningUGC" && setting.size > 0 && zones.length > 0 && !zones.some((ugc) => setting.has(ugc.toLowerCase()))) {
7294
+ SetEventEmit({
7146
7295
  event: `onFilteredUGC`,
7147
7296
  metadata: define2
7148
7297
  });
7149
7298
  return true;
7150
7299
  }
7151
- if (key === "ListeningStates" && setting.size > 0 && zones.length > 0 && !zones.some((ugc2) => setting.has(ugc2.substring(0, 2).toLowerCase()))) {
7152
- setEventEmit({
7300
+ if (key === "ListeningStates" && setting.size > 0 && zones.length > 0 && !zones.some((ugc) => setting.has(ugc.substring(0, 2).toLowerCase()))) {
7301
+ SetEventEmit({
7153
7302
  event: `onFilteredState`,
7154
7303
  metadata: define2
7155
7304
  });
@@ -7160,37 +7309,28 @@ var validateEvents = (events) => __async(null, null, function* () {
7160
7309
  };
7161
7310
  const filtering = events.filter((event) => {
7162
7311
  bootstrap.cache.processed = bootstrap.cache.processed.filter((e) => e !== event);
7163
- const define2 = getEventSignature(event);
7312
+ const define2 = GetEventSignature(event);
7164
7313
  const pre = __spreadProps(__spreadValues({}, define2), { properties: __spreadProps(__spreadValues({}, define2.properties), { metadata: __spreadValues({}, define2.properties.metadata) }) });
7165
- const properties2 = define2.properties;
7314
+ const properties = define2.properties;
7166
7315
  delete pre.properties.metadata.ms;
7167
7316
  delete pre.properties.metadata.header;
7168
- const enhanced = properties2.event = getEventEnhancedName(event);
7317
+ const enhanced = properties.event = GetEventEnhancedName(event);
7169
7318
  const filtered = isFiltered(define2);
7170
7319
  if (!filtered) {
7171
- event.geometry = !(bools == null ? void 0 : bools.DisableGeometryParsing) ? getEventGeometry(event) : null;
7172
- properties2.metadata.attachments = getEventAttachments(event);
7320
+ event.geometry = !(bools == null ? void 0 : bools.DisableGeometryParsing) ? GetEventGeometry(event) : null;
7321
+ properties.metadata.attachments = GetEventAttachments(event);
7173
7322
  }
7174
- properties2.metadata.hash = createHash("sha256").update(JSON.stringify(pre)).digest("hex");
7175
- setEventEmit({ event: `onProductType${enhanced.replace(/\s+/g, "")}`, metadata: define2 });
7323
+ properties.metadata.hash = createHash("sha256").update(JSON.stringify(pre)).digest("hex");
7324
+ SetEventEmit({ event: `onProductType${enhanced.replace(/\s+/g, "")}`, metadata: define2 });
7176
7325
  return !filtered;
7177
7326
  });
7178
- if (filtering.length > 0) {
7179
- for (const event of filtering) {
7180
- yield mkEvent(event);
7181
- }
7182
- }
7183
- yield updateNode();
7184
- setEventEmit({
7185
- event: `onEventCache`,
7186
- metadata: bootstrap.cache.events,
7187
- limited: true
7188
- });
7189
- setDebug({ title: `@building.validate`, message: `Filtered ${filtering.length} events which took ${performance.now() - tick} ms` });
7327
+ SetDebug({ title: `ValidateEvents (PRE) (${filtering.length}/${events.length})`, message: `${Math.round(performance.now() - tick)}ms` });
7328
+ yield MakeEvents(filtering);
7329
+ SetDebug({ title: `MakeEvents (${filtering.length}/${events.length})`, message: `${Math.round(performance.now() - tick)}ms` });
7190
7330
  });
7191
7331
 
7192
- // src/@building/building.create.ts
7193
- var createEvent = (stanza, ignorePushing) => __async(null, null, function* () {
7332
+ // src/@building/CreateEvent.ts
7333
+ var CreateEvent = (stanza, ignorePushing) => __async(null, null, function* () {
7194
7334
  const settings = bootstrap.settings;
7195
7335
  const StanzaSettings = settings.NOAAWeatherWireServiceSettings.StanzaSettings;
7196
7336
  const isVtecEvent = stanza.isVTEC && stanza.isUGC;
@@ -7199,26 +7339,26 @@ var createEvent = (stanza, ignorePushing) => __async(null, null, function* () {
7199
7339
  const isNWWS = stanza.isNWWS;
7200
7340
  switch (true) {
7201
7341
  case !isNWWS:
7202
- yield api(stanza);
7342
+ yield ParseAPI(stanza);
7203
7343
  break;
7204
7344
  case (isNWWS && !StanzaSettings.DisableVTEC && isVtecEvent):
7205
- yield vtec(stanza);
7345
+ yield ParseVTEC(stanza);
7206
7346
  break;
7207
7347
  case (isNWWS && !StanzaSettings.DisableUGC && isUgcEvent):
7208
- yield ugc(stanza);
7348
+ yield ParseUGC(stanza);
7209
7349
  break;
7210
7350
  case (isNWWS && !StanzaSettings.DisableText && isTextEvent):
7211
- yield text(stanza);
7351
+ yield ParseText(stanza);
7212
7352
  break;
7213
7353
  }
7214
7354
  if (!ignorePushing) {
7215
- validateEvents(bootstrap.cache.processed);
7355
+ yield ValidateEvents(bootstrap.cache.processed);
7216
7356
  }
7217
7357
  return "nothing picked";
7218
7358
  });
7219
7359
 
7220
- // src/@modules/@database/database.stanza.ts
7221
- var importStanza = (stanza) => __async(null, null, function* () {
7360
+ // src/@modules/@database/ImportStanza.ts
7361
+ var ImportStanza = (stanza) => __async(null, null, function* () {
7222
7362
  const settings = bootstrap.settings;
7223
7363
  try {
7224
7364
  if (!settings.NOAAWeatherWireServiceSettings.CacheSettings.Enabled) {
@@ -7234,17 +7374,17 @@ var importStanza = (stanza) => __async(null, null, function* () {
7234
7374
  }
7235
7375
  }
7236
7376
  } catch (error) {
7237
- setWarning({ message: `An error occurred while importing stanza: ${error.message}` });
7377
+ SetWarning({ message: `An error occurred while importing stanza: ${error.message}` });
7238
7378
  }
7239
7379
  });
7240
7380
 
7241
- // src/@modules/@xmpp/xmpp.xStanza.ts
7242
- var xStanza = () => {
7381
+ // src/@modules/@xmpp/StanzaXMPP.ts
7382
+ var StanzaXMPP = () => {
7243
7383
  bootstrap.session_xmpp.on(`stanza`, (stanza) => __async(null, null, function* () {
7244
7384
  var _a, _b, _c, _d;
7245
7385
  const msgFrom = (_b = (_a = stanza == null ? void 0 : stanza.attrs) == null ? void 0 : _a.from) != null ? _b : ``;
7246
7386
  const msgType = (_d = (_c = stanza == null ? void 0 : stanza.attrs) == null ? void 0 : _c.type) != null ? _d : ``;
7247
- setEventEmit({
7387
+ SetEventEmit({
7248
7388
  event: `onServiceStatus`,
7249
7389
  metadata: {
7250
7390
  message: stanza,
@@ -7254,18 +7394,18 @@ var xStanza = () => {
7254
7394
  });
7255
7395
  bootstrap.cache.lastStanza = Date.now();
7256
7396
  if (stanza.is(`message`)) {
7257
- const result = validate({ stanza });
7397
+ const result = ValidateStanza({ stanza });
7258
7398
  const isSkippable = result.isIgnored || result.isCapEvent || result.isCapEvent && !result.isCapAreaDescription;
7259
7399
  if (isSkippable) {
7260
7400
  return;
7261
7401
  }
7262
- yield createEvent(result);
7263
- yield importStanza(result);
7402
+ yield CreateEvent(result);
7403
+ yield ImportStanza(result);
7264
7404
  }
7265
7405
  if (stanza.is(`presence`) && msgFrom.startsWith("nwws@conference.nwws-oi.weather.gov/")) {
7266
7406
  const getOccupant = msgFrom.split(`/`).slice(1).join(`/`);
7267
7407
  const getAvailability = msgType === `unavailable`;
7268
- setEventEmit({
7408
+ SetEventEmit({
7269
7409
  event: `onServiceStatus`,
7270
7410
  metadata: {
7271
7411
  message: `Occupant ${getOccupant} has ${getAvailability ? `left` : `joined`} the room`,
@@ -7278,8 +7418,8 @@ var xStanza = () => {
7278
7418
  }));
7279
7419
  };
7280
7420
 
7281
- // src/@modules/@xmpp/xmpp.xDeploy.ts
7282
- var xDeploy = () => __async(null, null, function* () {
7421
+ // src/@modules/@xmpp/DeployXMPP.ts
7422
+ var DeployXMPP = () => __async(null, null, function* () {
7283
7423
  var _a, _b;
7284
7424
  let session;
7285
7425
  const settings = bootstrap.settings;
@@ -7291,13 +7431,13 @@ var xDeploy = () => __async(null, null, function* () {
7291
7431
  password: settings.NOAAWeatherWireServiceSettings.CredentialSettings.Password
7292
7432
  });
7293
7433
  try {
7294
- yield xOffline();
7295
- yield xError();
7296
- yield xStanza();
7297
- yield xOnline();
7434
+ yield OfflineXMPP();
7435
+ yield ErrorXMPP();
7436
+ yield StanzaXMPP();
7437
+ yield OnlineXMPP();
7298
7438
  yield session.start();
7299
7439
  } catch (error) {
7300
- setEventEmit({
7440
+ SetEventEmit({
7301
7441
  event: `onServiceStatus`,
7302
7442
  metadata: {
7303
7443
  message: `Error occured while starting XMPP Session: ${error}`,
@@ -7309,8 +7449,8 @@ var xDeploy = () => __async(null, null, function* () {
7309
7449
  }
7310
7450
  });
7311
7451
 
7312
- // src/@dictionaries/dictionaries.shapefiles.ts
7313
- var dict_shapefiles = [
7452
+ // src/@enums/Shapefiles.ts
7453
+ var EnumShapefiles = [
7314
7454
  { name: "us_counties", id: "C", link: "https://www.weather.gov/source/gis/Shapefiles/County/c_16ap26.zip" },
7315
7455
  { name: "us_states_territories", id: "Z", link: "https://www.weather.gov/source/gis/Shapefiles/County/s_16ap26.zip" },
7316
7456
  { name: "fire_weather_zones", id: "Z", link: "https://www.weather.gov/source/gis/Shapefiles/WSOM/fz16ap26.zip" },
@@ -7322,8 +7462,8 @@ var dict_shapefiles = [
7322
7462
  { name: "high_seas_marine_zones", id: "Z", link: "https://www.weather.gov/source/gis/Shapefiles/WSOM/hz17fe26.zip" }
7323
7463
  ];
7324
7464
 
7325
- // src/@modules/@utilities/utilities.setSleep.ts
7326
- var setSleep = (options) => __async(null, null, function* () {
7465
+ // src/@modules/@utilities/SetSleep.ts
7466
+ var SetSleep = (options) => __async(null, null, function* () {
7327
7467
  return new Promise((resolve6) => {
7328
7468
  setTimeout(() => {
7329
7469
  resolve6();
@@ -7331,31 +7471,31 @@ var setSleep = (options) => __async(null, null, function* () {
7331
7471
  });
7332
7472
  });
7333
7473
 
7334
- // src/@modules/@database/database.shapefiles.ts
7335
- import { existsSync as existsSync3, mkdirSync as mkdirSync3, writeFileSync as writeFileSync4, unlinkSync as unlinkSync2, rm } from "fs";
7474
+ // src/@modules/@database/ImportShapefiles.ts
7475
+ import { existsSync as existsSync2, mkdirSync as mkdirSync2, writeFileSync as writeFileSync3, unlinkSync as unlinkSync2, rm } from "fs";
7336
7476
  import { resolve as resolve5, extname } from "path";
7337
7477
  import { loadAsync } from "jszip";
7338
7478
  import { read } from "shapefile";
7339
- var importShapefiles = () => __async(null, null, function* () {
7479
+ var ImportShapefiles = () => __async(null, null, function* () {
7340
7480
  var _a, _b;
7341
7481
  const settings = bootstrap.settings;
7342
7482
  try {
7343
7483
  const tShapefiles = bootstrap.database.prepare(`SELECT COUNT(*) AS count FROM shapefiles`).get().count;
7344
7484
  if (tShapefiles === 0) {
7345
- yield setSleep({ timeout: 1e3 });
7346
- for (const shapefile of dict_shapefiles) {
7485
+ yield SetSleep({ timeout: 1e3 });
7486
+ for (const shapefile of EnumShapefiles) {
7347
7487
  const response2 = yield fetch(shapefile.link);
7348
7488
  const arrayBuff = yield response2.arrayBuffer();
7349
7489
  const content = yield loadAsync(arrayBuff);
7350
7490
  const directory = resolve5(__dirname, `../../shapefiles`);
7351
- if (!existsSync3(directory)) {
7352
- mkdirSync3(directory, { recursive: true });
7491
+ if (!existsSync2(directory)) {
7492
+ mkdirSync2(directory, { recursive: true });
7353
7493
  }
7354
7494
  for (const file of Object.keys(content.files)) {
7355
7495
  if (file.endsWith(".shp") || file.endsWith(".dbf")) {
7356
7496
  const data = yield content.files[file].async(`nodebuffer`);
7357
7497
  const output = resolve5(directory, `${(_a = shapefile == null ? void 0 : shapefile.name) != null ? _a : ``}_${(_b = shapefile == null ? void 0 : shapefile.id) != null ? _b : ``}${extname(file)}`);
7358
- writeFileSync4(output, data);
7498
+ writeFileSync3(output, data);
7359
7499
  }
7360
7500
  }
7361
7501
  const filepath = resolve5(__dirname, "../../shapefiles", shapefile.name + "_" + shapefile.id);
@@ -7363,25 +7503,25 @@ var importShapefiles = () => __async(null, null, function* () {
7363
7503
  filepath,
7364
7504
  filepath
7365
7505
  );
7366
- setWarning({ message: `Importing ${features.length} features from ${shapefile.name}_${shapefile.id} for Shapefiles` });
7506
+ SetWarning({ message: `Importing ${features.length} features from ${shapefile.name}_${shapefile.id} for Shapefiles` });
7367
7507
  const insert = bootstrap.database.prepare(`INSERT OR REPLACE INTO shapefiles (id, location, geometry) VALUES (?, ?, ?)`);
7368
7508
  const transaction = bootstrap.database.transaction((entries) => {
7369
7509
  var _a2, _b2, _c;
7370
7510
  for (const entry of entries) {
7371
- const { properties: properties2, geometry } = entry;
7511
+ const { properties, geometry } = entry;
7372
7512
  let final2, location;
7373
- if (properties2.FIPS) {
7374
- final2 = `${properties2.STATE}${shapefile.id}${properties2.FIPS.substring(2)}`;
7375
- location = `${properties2.COUNTYNAME}, ${properties2.STATE}`;
7376
- } else if (properties2.FULLSTAID) {
7377
- final2 = `${properties2.ST}${shapefile.id}${properties2.WFO}`;
7378
- location = `${properties2.CITY}, ${properties2.STATE}`;
7379
- } else if (properties2.STATE) {
7380
- final2 = `${properties2.STATE}${shapefile.id}${(_a2 = properties2.ZONE) != null ? _a2 : properties2.SITE_ID}`;
7381
- location = `${(_b2 = properties2.NAME) != null ? _b2 : `${properties2.RFC_NAME} ${properties2.RFC_CITY}`}, ${properties2.STATE}`;
7513
+ if (properties.FIPS) {
7514
+ final2 = `${properties.STATE}${shapefile.id}${properties.FIPS.substring(2)}`;
7515
+ location = `${properties.COUNTYNAME}, ${properties.STATE}`;
7516
+ } else if (properties.FULLSTAID) {
7517
+ final2 = `${properties.ST}${shapefile.id}${properties.WFO}`;
7518
+ location = `${properties.CITY}, ${properties.STATE}`;
7519
+ } else if (properties.STATE) {
7520
+ final2 = `${properties.STATE}${shapefile.id}${(_a2 = properties.ZONE) != null ? _a2 : properties.SITE_ID}`;
7521
+ location = `${(_b2 = properties.NAME) != null ? _b2 : `${properties.RFC_NAME} ${properties.RFC_CITY}`}, ${properties.STATE}`;
7382
7522
  } else {
7383
- final2 = (_c = properties2.ID) != null ? _c : properties2.WFO;
7384
- location = properties2.NAME;
7523
+ final2 = (_c = properties.ID) != null ? _c : properties.WFO;
7524
+ location = properties.NAME;
7385
7525
  }
7386
7526
  insert.run(final2, location, JSON.stringify(geometry));
7387
7527
  }
@@ -7394,12 +7534,12 @@ var importShapefiles = () => __async(null, null, function* () {
7394
7534
  });
7395
7535
  }
7396
7536
  } catch (error) {
7397
- setWarning({ message: `An error occurred while compiling shapefiles: ${error.message}` });
7537
+ SetWarning({ message: `An error occurred while compiling shapefiles: ${error.message}` });
7398
7538
  }
7399
7539
  });
7400
7540
 
7401
- // src/@modules/@database/database.broadcastify.ts
7402
- var importBroadcastify = () => __async(null, null, function* () {
7541
+ // src/@modules/@database/ImportBroadcastify.ts
7542
+ var ImportBroadcastify = () => __async(null, null, function* () {
7403
7543
  const settings = bootstrap.settings;
7404
7544
  const isBroadcastifyImported = bootstrap.database.prepare(`SELECT name FROM sqlite_master WHERE type='table' AND name='broadcastify';`).get();
7405
7545
  if (!settings.BroadcastifySettings.BroadcastifyAttachments) {
@@ -7408,7 +7548,7 @@ var importBroadcastify = () => __async(null, null, function* () {
7408
7548
  if (isBroadcastifyImported) {
7409
7549
  return;
7410
7550
  }
7411
- const broadcastify = yield createHttp({
7551
+ const broadcastify = yield CreateHttp({
7412
7552
  url: settings.BroadcastifySettings.BroadcastifyDatabase,
7413
7553
  timeout: 5e3
7414
7554
  });
@@ -7423,7 +7563,7 @@ var importBroadcastify = () => __async(null, null, function* () {
7423
7563
  });
7424
7564
  const batch = [];
7425
7565
  for (const state of states) {
7426
- setWarning({ message: `Importing ${state.counties.length} counties from ${state.state} for Broadcastify` });
7566
+ SetWarning({ message: `Importing ${state.counties.length} counties from ${state.state} for Broadcastify` });
7427
7567
  for (const county of state.counties) {
7428
7568
  const countyName = county.county;
7429
7569
  for (const feed of county.feeds) {
@@ -7439,17 +7579,20 @@ var importBroadcastify = () => __async(null, null, function* () {
7439
7579
  }
7440
7580
  transaction(batch);
7441
7581
  }
7582
+ if (broadcastify.error) {
7583
+ SetWarning({ message: `Error importing Broadcastify data: ${broadcastify.message}` });
7584
+ }
7442
7585
  });
7443
7586
 
7444
- // src/@modules/@database/database.init.ts
7445
- import { existsSync as existsSync4, writeFileSync as writeFileSync5 } from "fs";
7587
+ // src/@modules/@database/InitializeDatabase.ts
7588
+ import { existsSync as existsSync3, writeFileSync as writeFileSync4 } from "fs";
7446
7589
  import sqlite3 from "better-sqlite3";
7447
- var initializeDatabase = () => __async(null, null, function* () {
7590
+ var InitializeDatabase = () => __async(null, null, function* () {
7448
7591
  const settings = bootstrap.settings;
7449
7592
  try {
7450
- if (!existsSync4(settings.Database)) {
7451
- writeFileSync5(settings.Database, "");
7452
- setWarning({ message: `Creating new database at ${settings.Database}` });
7593
+ if (!existsSync3(settings.Database)) {
7594
+ writeFileSync4(settings.Database, "");
7595
+ SetWarning({ message: `Creating new database at ${settings.Database}` });
7453
7596
  }
7454
7597
  bootstrap.database = new sqlite3(settings.Database);
7455
7598
  bootstrap.database.prepare(`CREATE TABLE IF NOT EXISTS stanzas ( id INTEGER PRIMARY KEY AUTOINCREMENT, type TEXT, issued TEXT, stanza TEXT )`).run();
@@ -7457,18 +7600,18 @@ var initializeDatabase = () => __async(null, null, function* () {
7457
7600
  const isNeedingShapefiles = bootstrap.database.prepare(`SELECT name FROM sqlite_master WHERE type='table' AND name='shapefiles';`).get();
7458
7601
  const isNeedingBroadcastify = bootstrap.database.prepare(`SELECT name FROM sqlite_master WHERE type='table' AND name='broadcastify';`).get();
7459
7602
  if (!isNeedingShapefiles || !isNeedingBroadcastify) {
7460
- setWarning({ message: `Required database tables are currently building, please ${bootstrap.ansi_colors.RED}DO NOT${bootstrap.ansi_colors.RESET} close your terminal. The building will not finish and will remain incomplete. If you do mess up, you will need to delete ${settings.Database} and restart the application.` });
7461
- yield importBroadcastify();
7462
- yield importShapefiles();
7463
- setWarning({ message: `Building has completed, you can now continue or close the terminal` });
7603
+ SetWarning({ message: `Required database tables are currently building, please ${bootstrap.ansi_colors.RED}DO NOT${bootstrap.ansi_colors.RESET} close your terminal. The building will not finish and will remain incomplete. If you do mess up, you will need to delete ${settings.Database} and restart the application.` });
7604
+ yield ImportBroadcastify();
7605
+ yield ImportShapefiles();
7606
+ SetWarning({ message: `Building has completed, you can now continue or close the terminal` });
7464
7607
  }
7465
7608
  } catch (error) {
7466
- setWarning({ message: `An error occurred while initializing the database: ${error.message}` });
7609
+ SetWarning({ message: `An error occurred while initializing the database: ${error.message}` });
7467
7610
  }
7468
7611
  });
7469
7612
 
7470
- // src/@modules/@database/database.cache.ts
7471
- var getCachedEvents = () => __async(null, null, function* () {
7613
+ // src/@modules/@database/GetCachedEvents.ts
7614
+ var GetCachedEvents = () => __async(null, null, function* () {
7472
7615
  var _a;
7473
7616
  try {
7474
7617
  const settings = bootstrap.settings;
@@ -7476,7 +7619,7 @@ var getCachedEvents = () => __async(null, null, function* () {
7476
7619
  if (settings.NOAAWeatherWireServiceSettings.CacheSettings.Enabled) {
7477
7620
  const max = (_a = settings.NOAAWeatherWireServiceSettings.CacheSettings.MaxRetentionHistory) != null ? _a : 500;
7478
7621
  const get = yield bootstrap.database.prepare(`SELECT * FROM stanzas ORDER BY rowid DESC LIMIT ?`).all(max);
7479
- setWarning({ message: `Fetched ${get.length} cached stanzas from the database in ${Math.floor(performance.now() - tick)} ms` });
7622
+ SetWarning({ message: `Fetched ${get.length} cached stanzas from the database in ${Math.floor(performance.now() - tick)} ms` });
7480
7623
  let events = get.map((row) => JSON.parse(row.stanza)).filter((stanza) => {
7481
7624
  if (!stanza) {
7482
7625
  return;
@@ -7485,21 +7628,21 @@ var getCachedEvents = () => __async(null, null, function* () {
7485
7628
  return !isSkippable;
7486
7629
  });
7487
7630
  events = events.sort((a, b) => b.issued - a.issued);
7488
- yield Promise.all(events.map((event) => createEvent(event, true)));
7489
- setWarning({ message: `Processed ${events.length} cached stanzas in ${Math.floor(performance.now() - tick)} ms` });
7490
- validateEvents(bootstrap.cache.processed);
7631
+ yield Promise.all(events.map((event) => CreateEvent(event, true)));
7632
+ SetWarning({ message: `Processed ${events.length} cached stanzas in ${Math.floor(performance.now() - tick)} ms` });
7633
+ yield ValidateEvents(bootstrap.cache.processed);
7491
7634
  }
7492
7635
  } catch (error) {
7493
- setWarning({ message: `An error occurred while fetching cached stanzas: ${error.message} -> ${error.stack}` });
7636
+ SetWarning({ message: `An error occurred while fetching cached stanzas: ${error.message} -> ${error.stack}` });
7494
7637
  }
7495
7638
  });
7496
7639
 
7497
- // src/@modules/@xmpp/xmpp.xReconnect.ts
7498
- var xReconnect = (interval) => __async(null, null, function* () {
7640
+ // src/@modules/@xmpp/ReconnectXMPP.ts
7641
+ var ReconnectXMPP = (interval) => __async(null, null, function* () {
7499
7642
  const settings = bootstrap.settings;
7500
7643
  const lastStanza = Date.now() - bootstrap.cache.lastStanza;
7501
7644
  if (interval < 15) {
7502
- setWarning({ message: `Reconnection interval of ${interval} seconds is too low, setting to 15 seconds` });
7645
+ SetWarning({ message: `Reconnection interval of ${interval} seconds is too low, setting to 15 seconds` });
7503
7646
  interval = 15;
7504
7647
  bootstrap.settings.NOAAWeatherWireServiceSettings.ReconnectionSettings.ReconnectionInterval = 15;
7505
7648
  }
@@ -7513,7 +7656,7 @@ var xReconnect = (interval) => __async(null, null, function* () {
7513
7656
  bootstrap.cache.isConnected = false;
7514
7657
  bootstrap.cache.tReconnects += 1;
7515
7658
  try {
7516
- setEventEmit({
7659
+ SetEventEmit({
7517
7660
  event: `onServiceStatus`,
7518
7661
  metadata: {
7519
7662
  message: `Attempting to reconnect to XMPP Service (Reconnect Attempt ${bootstrap.cache.tReconnects})`,
@@ -7531,7 +7674,7 @@ var xReconnect = (interval) => __async(null, null, function* () {
7531
7674
  yield bootstrap.session_xmpp.start().catch(() => {
7532
7675
  });
7533
7676
  } catch (error) {
7534
- setWarning({ message: `XMPP Reconnect Failed - ${error.message}` });
7677
+ SetWarning({ message: `XMPP Reconnect Failed - ${error.message}` });
7535
7678
  } finally {
7536
7679
  bootstrap.cache.isReconnecting = false;
7537
7680
  }
@@ -7539,15 +7682,15 @@ var xReconnect = (interval) => __async(null, null, function* () {
7539
7682
  }
7540
7683
  });
7541
7684
 
7542
- // src/@modules/@utilities/utilities.setCronSchedule.ts
7543
- import { readdirSync, unlinkSync as unlinkSync3, statSync, existsSync as existsSync5 } from "fs";
7685
+ // src/@modules/@utilities/SetCronSchedule.ts
7686
+ import { readdirSync, unlinkSync as unlinkSync3, statSync, existsSync as existsSync4 } from "fs";
7544
7687
  import { join as join2 } from "path";
7545
- var setCronSchedule = () => __async(null, null, function* () {
7688
+ var SetCronSchedule = () => __async(null, null, function* () {
7546
7689
  const settings = bootstrap.settings;
7547
7690
  const TTL = settings.GlobalSettings.ArchiveSettings.TTL;
7548
7691
  const TTLCUT = Date.now() - TTL * 1e3;
7549
7692
  const walk = (dir) => {
7550
- if (existsSync5(dir)) {
7693
+ if (existsSync4(dir)) {
7551
7694
  const entries = readdirSync(dir, { withFileTypes: true });
7552
7695
  for (const entry of entries) {
7553
7696
  const fullPath = join2(dir, entry.name);
@@ -7568,20 +7711,20 @@ var setCronSchedule = () => __async(null, null, function* () {
7568
7711
  };
7569
7712
  walk(settings.GlobalSettings.ArchiveSettings.TextDirectory);
7570
7713
  walk(settings.GlobalSettings.ArchiveSettings.EasDirectory);
7571
- walk(settings.GlobalSettings.ArchiveSettings.EventDirectory);
7714
+ walk(settings.GlobalSettings.ArchiveSettings.JSONDirectory);
7572
7715
  if (settings.EnableWireService) {
7573
7716
  if (settings.NOAAWeatherWireServiceSettings.ReconnectionSettings.Enabled) {
7574
- void xReconnect(settings.NOAAWeatherWireServiceSettings.ReconnectionSettings.ReconnectionInterval);
7717
+ void ReconnectXMPP(settings.NOAAWeatherWireServiceSettings.ReconnectionSettings.ReconnectionInterval);
7575
7718
  }
7576
7719
  } else {
7577
- const response2 = yield createHttp({
7720
+ const response2 = yield CreateHttp({
7578
7721
  url: settings.NationalWeatherServiceSettings.EventsEndpoint,
7579
7722
  headers: {
7580
7723
  "User-Agent": "@atmosx/event-product-parser"
7581
7724
  }
7582
7725
  });
7583
7726
  if (response2.error) {
7584
- return setEventEmit({
7727
+ return SetEventEmit({
7585
7728
  event: `onServiceStatus`,
7586
7729
  metadata: {
7587
7730
  type: "fetch-api",
@@ -7591,7 +7734,7 @@ var setCronSchedule = () => __async(null, null, function* () {
7591
7734
  }
7592
7735
  });
7593
7736
  }
7594
- setEventEmit({
7737
+ SetEventEmit({
7595
7738
  event: `onServiceStatus`,
7596
7739
  metadata: {
7597
7740
  message: `Fetched latest events from National Weather Service API`,
@@ -7600,18 +7743,18 @@ var setCronSchedule = () => __async(null, null, function* () {
7600
7743
  error: false
7601
7744
  }
7602
7745
  });
7603
- createEvent({ message: response2.message, isNWWS: false });
7746
+ yield CreateEvent({ message: response2.message, isNWWS: false });
7604
7747
  }
7605
7748
  });
7606
7749
 
7607
- // src/@manager/manager.updateEvents.ts
7608
- var updateEvents = (selectedEvent) => __async(null, null, function* () {
7750
+ // src/@manager/UpdateEvents.ts
7751
+ var UpdateEvents = (selectedEvent) => __async(null, null, function* () {
7609
7752
  const events = bootstrap.cache.events.features;
7610
7753
  function update(event) {
7611
7754
  return __async(this, null, function* () {
7612
7755
  if (new Date(event.properties.expires) < /* @__PURE__ */ new Date()) {
7613
- setEventEmit({ event: `onExpiredProduct`, metadata: event });
7614
- yield rmEvent(event, true);
7756
+ SetEventEmit({ event: `onExpiredProduct`, metadata: event });
7757
+ yield RemoveEvent(event, true);
7615
7758
  }
7616
7759
  });
7617
7760
  }
@@ -7625,41 +7768,41 @@ var updateEvents = (selectedEvent) => __async(null, null, function* () {
7625
7768
  }
7626
7769
  });
7627
7770
 
7628
- // src/@core/core.start.ts
7771
+ // src/@core/StartService.ts
7629
7772
  import { Cron } from "croner";
7630
- var startService = (configurations) => __async(null, null, function* () {
7773
+ var StartService = (configurations) => __async(null, null, function* () {
7631
7774
  if (!bootstrap.isReady) {
7632
- return setWarning({
7775
+ return SetWarning({
7633
7776
  message: `You can not create another instance without shutting down the current one first, please make sure to call the stop() method first!`
7634
7777
  });
7635
7778
  }
7636
- const settings = setSettings(configurations);
7779
+ const settings = SetSettings(configurations);
7637
7780
  bootstrap.isReady = true;
7638
- yield initializeDatabase();
7781
+ yield InitializeDatabase();
7639
7782
  if (settings.EnableWireService) {
7640
7783
  (() => __async(null, null, function* () {
7641
- yield getCachedEvents();
7642
- yield xDeploy();
7784
+ yield GetCachedEvents();
7785
+ yield DeployXMPP();
7643
7786
  }))();
7644
7787
  }
7645
- yield setCronSchedule();
7788
+ yield SetCronSchedule();
7646
7789
  let scheduleInterval = !settings.EnableWireService ? settings.NationalWeatherServiceSettings.CallbackInterval : 1;
7647
7790
  if (!settings.EnableWireService && scheduleInterval < 15) {
7648
- setWarning({ message: `Schedule interval of ${scheduleInterval} seconds is too low, setting to 15 seconds` });
7791
+ SetWarning({ message: `Schedule interval of ${scheduleInterval} seconds is too low, setting to 15 seconds` });
7649
7792
  bootstrap.settings.NationalWeatherServiceSettings.CallbackInterval = 15;
7650
7793
  scheduleInterval = 15;
7651
7794
  }
7652
7795
  bootstrap.cron = new Cron(`*/${scheduleInterval} * * * * *`, () => __async(null, null, function* () {
7653
- yield setCronSchedule();
7796
+ yield SetCronSchedule();
7654
7797
  }));
7655
7798
  bootstrap.cron = new Cron(`* * * * * *`, () => __async(null, null, function* () {
7656
- yield updateNode();
7657
- yield updateEvents();
7799
+ yield UpdateNode();
7800
+ yield UpdateEvents();
7658
7801
  }));
7659
7802
  });
7660
7803
 
7661
- // src/@core/core.stop.ts
7662
- var stopService = () => __async(null, null, function* () {
7804
+ // src/@core/StopService.ts
7805
+ var StopService = () => __async(null, null, function* () {
7663
7806
  if (bootstrap.isReady) {
7664
7807
  bootstrap.isReady = false;
7665
7808
  if (bootstrap.session_xmpp) {
@@ -7674,15 +7817,15 @@ var stopService = () => __async(null, null, function* () {
7674
7817
  }
7675
7818
  });
7676
7819
 
7677
- // src/@core/core.setNode.ts
7678
- var setNode = (options) => {
7820
+ // src/@core/SetNode.ts
7821
+ var SetNode = (options) => {
7679
7822
  const nodes = bootstrap.cache.nodes.features;
7680
7823
  const exists = nodes.find((node) => node.properties.identifier === options.identifier);
7681
7824
  if (options.delete) {
7682
7825
  if (exists) {
7683
7826
  const index = nodes.indexOf(exists);
7684
7827
  nodes.splice(index, 1);
7685
- return setEventEmit({
7828
+ return SetEventEmit({
7686
7829
  event: `onNodeDelete`,
7687
7830
  metadata: {
7688
7831
  type: `node-delete`,
@@ -7690,7 +7833,7 @@ var setNode = (options) => {
7690
7833
  }
7691
7834
  });
7692
7835
  }
7693
- return setWarning({ message: `Node with identifier '${options.identifier}' not found.` });
7836
+ return SetWarning({ message: `Node with identifier '${options.identifier}' not found.` });
7694
7837
  }
7695
7838
  if (exists) {
7696
7839
  const index = nodes.indexOf(exists);
@@ -7700,7 +7843,7 @@ var setNode = (options) => {
7700
7843
  coordinates: [options.coordinates.longitude, options.coordinates.latitude]
7701
7844
  }
7702
7845
  });
7703
- return setEventEmit({
7846
+ return SetEventEmit({
7704
7847
  event: `onNodeUpdate`,
7705
7848
  metadata: {
7706
7849
  type: `node-update`,
@@ -7718,7 +7861,7 @@ var setNode = (options) => {
7718
7861
  identifier: options.identifier
7719
7862
  }
7720
7863
  });
7721
- return setEventEmit({
7864
+ return SetEventEmit({
7722
7865
  event: `onNodeAdd`,
7723
7866
  metadata: {
7724
7867
  type: `node-add`,
@@ -7727,34 +7870,53 @@ var setNode = (options) => {
7727
7870
  });
7728
7871
  };
7729
7872
 
7730
- // src/@core/core.getEvents.ts
7731
- var getEvents = () => {
7873
+ // src/@core/GetEvents.ts
7874
+ var GetEvents = () => {
7732
7875
  return bootstrap.cache.events;
7733
7876
  };
7734
7877
 
7735
- // src/@core/core.getNodes.ts
7736
- var getNodes = () => {
7878
+ // src/@core/GetNodes.ts
7879
+ var GetNodes = () => {
7737
7880
  return bootstrap.cache.nodes;
7738
7881
  };
7739
7882
 
7740
- // src/@core/core.manualEvent.ts
7741
- var manualEvent = (options) => __async(null, null, function* () {
7883
+ // src/@core/ManualEvent.ts
7884
+ var ManualEvent = (options) => __async(null, null, function* () {
7885
+ var _a;
7742
7886
  const isCapEvent = options.message.includes(`<?xml`);
7743
7887
  const isCapAreaDescription = options.message.includes(`<areaDesc>`);
7744
- const isVTEC = options.message.match(dict_expressions.pvtec) != null;
7745
- const isUGC = options.message.match(dict_expressions.ugc1) != null;
7746
- const getType = getAwipsType({ attributes: options.attributes });
7747
- const result = { message: options.message, attributes: options.attributes, isCapEvent, isVTEC, isUGC, isCapAreaDescription, isIgnored: false, isNWWS: true, getType };
7748
- yield createEvent(result);
7888
+ const isVTEC = options.message.match(EnumExpressions.pvtec) != null;
7889
+ const isUGC = options.message.match(EnumExpressions.ugc1) != null;
7890
+ const attributes = {
7891
+ "xmlns": "@atmosx/event-product-parser",
7892
+ "id": "manual_processor.0000",
7893
+ "issue": (/* @__PURE__ */ new Date()).toISOString(),
7894
+ "ttaaii": "XXXXX",
7895
+ "cccc": "XXX",
7896
+ "awipsid": (_a = options.awipsid) != null ? _a : "XXXXXX"
7897
+ };
7898
+ const getType = GetAwipsType({ attributes });
7899
+ const result = {
7900
+ message: options.message,
7901
+ attributes,
7902
+ isCapEvent,
7903
+ isVTEC,
7904
+ isUGC,
7905
+ isCapAreaDescription,
7906
+ isIgnored: false,
7907
+ isNWWS: true,
7908
+ getType
7909
+ };
7910
+ yield CreateEvent(result);
7749
7911
  });
7750
7912
 
7751
- // src/@core/core.getRandomEvent.ts
7752
- var getRandomEvent = () => {
7913
+ // src/@core/GetRandomEvent.ts
7914
+ var GetRandomEvent = () => {
7753
7915
  return bootstrap.cache.events.features[Math.floor(Math.random() * bootstrap.cache.events.features.length)];
7754
7916
  };
7755
7917
 
7756
- // src/@core/core.query.ts
7757
- var query = (options) => __async(null, null, function* () {
7918
+ // src/@core/QueryStanza.ts
7919
+ var QueryStanza = (options) => __async(null, null, function* () {
7758
7920
  var _a;
7759
7921
  const get = yield bootstrap.database.prepare(
7760
7922
  `SELECT * FROM stanzas WHERE stanza LIKE ? LIMIT ?`
@@ -7763,11 +7925,11 @@ var query = (options) => __async(null, null, function* () {
7763
7925
  return events;
7764
7926
  });
7765
7927
 
7766
- // src/@core/core.clearEvents.ts
7767
- var clearEvents = () => {
7928
+ // src/@core/ClearEvents.ts
7929
+ var ClearEvents = () => {
7768
7930
  bootstrap.cache.events.features = [];
7769
7931
  bootstrap.cache.hashes = [];
7770
- setEventEmit({
7932
+ SetEventEmit({
7771
7933
  event: `onEventCache`,
7772
7934
  metadata: bootstrap.cache.events,
7773
7935
  message: `Manually cleared event cache.`
@@ -7778,17 +7940,17 @@ var clearEvents = () => {
7778
7940
  var Manager = class {
7779
7941
  constructor(settings) {
7780
7942
  this.trycatch();
7781
- startService(settings);
7943
+ StartService(settings);
7782
7944
  }
7783
7945
  on(event, callback) {
7784
- createListener(event, callback);
7946
+ CreateListener(event, callback);
7785
7947
  }
7786
7948
  trycatch() {
7787
7949
  process.on("uncaughtException", (err) => {
7788
7950
  var _a, _b;
7789
7951
  const ignored = ["ETIMEDOUT", "ECONNRESET", "EHOSTUNREACH", "ENOTFOUND", "ECONNREFUSED", "EPIPE", "EADDRINUSE", "EALREADY", "EACCES", "EAGAIN", "EHOSTDOWN", "STARTTLS_FAILURE"];
7790
7952
  if (ignored.includes(err == null ? void 0 : err.code)) {
7791
- setEventEmit({
7953
+ SetEventEmit({
7792
7954
  event: `onServiceStatus`,
7793
7955
  metadata: {
7794
7956
  message: `Ignored Critical Error: ${(_a = err == null ? void 0 : err.code) != null ? _a : "Unknown error code"}. This may indicate a connection issue. Attempting to continue...`,
@@ -7799,25 +7961,25 @@ var Manager = class {
7799
7961
  });
7800
7962
  return;
7801
7963
  }
7802
- setWarning({ message: `Uncaught Exception: ${err instanceof Error ? (_b = err.stack) != null ? _b : err.message : String(err)}` });
7964
+ SetWarning({ message: `Uncaught Exception: ${err instanceof Error ? (_b = err.stack) != null ? _b : err.message : String(err)}` });
7803
7965
  });
7804
7966
  }
7805
7967
  };
7806
7968
  var index_default = Manager;
7807
7969
  export {
7970
+ ClearEvents,
7971
+ GenerateEASMessage,
7972
+ GetCleanedEvent,
7973
+ GetEventGeometry,
7974
+ GetEvents,
7975
+ GetNodes,
7976
+ GetRandomEvent,
7808
7977
  Manager,
7809
- clearEvents,
7810
- index_default as default,
7811
- getCleanedEvent,
7812
- getEventGeometry,
7813
- getEvents,
7814
- getNodes,
7815
- getRandomEvent,
7816
- manualEvent,
7817
- query,
7818
- setEasTone,
7819
- setNode,
7820
- setSettings,
7821
- startService,
7822
- stopService
7978
+ ManualEvent,
7979
+ QueryStanza,
7980
+ SetNode,
7981
+ SetSettings,
7982
+ StartService,
7983
+ StopService,
7984
+ index_default as default
7823
7985
  };