@atmosx/event-product-parser 3.0.54 → 3.0.61

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 +1475 -1294
  19. package/dist/esm/index.mjs +1456 -1275
  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 -66
  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/RemoveEvent.ts +70 -0
  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 -32
  74. package/src/@manager/{manager.updateNodes.ts → UpdateNode.ts} +61 -53
  75. package/src/{@building/building.validate.ts → @manager/ValidateEvents.ts} +141 -152
  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 -62
  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.tags.ts +0 -93
  153. package/src/@manager/manager.mkEvent.ts +0 -98
  154. package/src/@manager/manager.rmEvent.ts +0 -59
  155. package/src/@manager/manager.updateListener.ts +0 -177
  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.54`,
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) {
@@ -1358,6 +1362,7 @@ var setTimeoutAction = (options) => {
1358
1362
  }
1359
1363
  if (options == null ? void 0 : options.expire) {
1360
1364
  delete bootstrap.ratelimits[options == null ? void 0 : options.identifier];
1365
+ return { limited: false };
1361
1366
  }
1362
1367
  if ((target == null ? void 0 : target.length) > 0) {
1363
1368
  bootstrap.ratelimits[options == null ? void 0 : options.identifier] = target.filter((ts) => Date.now() - ts < (options == null ? void 0 : options.interval) * 1e3);
@@ -1377,8 +1382,8 @@ var setTimeoutAction = (options) => {
1377
1382
  return { limited: false };
1378
1383
  };
1379
1384
 
1380
- // src/@modules/@utilities/utilities.setWarning.ts
1381
- var setWarning = (options) => {
1385
+ // src/@modules/@utilities/SetWarning.ts
1386
+ var SetWarning = (options) => {
1382
1387
  var _a, _b;
1383
1388
  const settings = bootstrap.settings;
1384
1389
  bootstrap.listener.emit(`log`, `${(_a = options.title) != null ? _a : `[${bootstrap.ansi_colors.YELLOW}@atmosx/product-parser${bootstrap.ansi_colors.RESET}]`} ${options.message}`);
@@ -1387,10 +1392,10 @@ var setWarning = (options) => {
1387
1392
  }
1388
1393
  };
1389
1394
 
1390
- // src/@modules/@utilities/utilities.setEventEmit.ts
1391
- var setEventEmit = (options) => {
1395
+ // src/@modules/@utilities/SetEventEmit.ts
1396
+ var SetEventEmit = (options) => {
1392
1397
  if (options.limited) {
1393
- 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 });
1394
1399
  if (isTimeout.limited) return;
1395
1400
  }
1396
1401
  bootstrap.listener.emit(options.event, options.metadata);
@@ -1398,21 +1403,21 @@ var setEventEmit = (options) => {
1398
1403
  bootstrap.listener.emit(`*`, { event: options.event, data: options.metadata });
1399
1404
  }
1400
1405
  if (options.message) {
1401
- setWarning({ message: options.message });
1406
+ SetWarning({ message: options.message });
1402
1407
  }
1403
1408
  };
1404
1409
 
1405
- // src/@modules/@utilities/utilities.setListener.ts
1406
- var setListener = (options) => {
1410
+ // src/@modules/@utilities/SetListener.ts
1411
+ var SetListener = (options) => {
1407
1412
  bootstrap.listener.on(options.event, options.callback);
1408
1413
  return () => {
1409
1414
  void bootstrap.listener.off(options.event, options.callback);
1410
1415
  };
1411
1416
  };
1412
1417
 
1413
- // src/@core/core.createListener.ts
1414
- var createListener = (event, callback) => {
1415
- setListener({ event, callback });
1418
+ // src/@core/CreateListener.ts
1419
+ var CreateListener = (event, callback) => {
1420
+ SetListener({ event, callback });
1416
1421
  };
1417
1422
 
1418
1423
  // node_modules/@xmpp/xml/index.js
@@ -1801,20 +1806,20 @@ var jid_default = j;
1801
1806
 
1802
1807
  // node_modules/@xmpp/error/index.js
1803
1808
  var XMPPError = class extends Error {
1804
- constructor(condition, text2, application) {
1805
- super(condition + (text2 ? ` - ${text2}` : ""));
1809
+ constructor(condition, text, application) {
1810
+ super(condition + (text ? ` - ${text}` : ""));
1806
1811
  this.name = "XMPPError";
1807
1812
  this.condition = condition;
1808
- this.text = text2;
1813
+ this.text = text;
1809
1814
  this.application = application;
1810
1815
  }
1811
1816
  static fromElement(element) {
1812
1817
  const [condition, second, third] = element.getChildElements();
1813
- let text2;
1818
+ let text;
1814
1819
  let application;
1815
1820
  if (second) {
1816
1821
  if (second.is("text")) {
1817
- text2 = second;
1822
+ text = second;
1818
1823
  } else if (second) {
1819
1824
  application = second;
1820
1825
  }
@@ -1822,7 +1827,7 @@ var XMPPError = class extends Error {
1822
1827
  }
1823
1828
  const error = new this(
1824
1829
  condition.name,
1825
- text2 ? text2.text() : "",
1830
+ text ? text.text() : "",
1826
1831
  application
1827
1832
  );
1828
1833
  error.element = element;
@@ -2740,8 +2745,8 @@ function id() {
2740
2745
 
2741
2746
  // node_modules/@xmpp/middleware/lib/StanzaError.js
2742
2747
  var StanzaError = class extends error_default {
2743
- constructor(condition, text2, application, type) {
2744
- super(condition, text2, application);
2748
+ constructor(condition, text, application, type) {
2749
+ super(condition, text, application);
2745
2750
  this.type = type;
2746
2751
  this.name = "StanzaError";
2747
2752
  }
@@ -4170,8 +4175,8 @@ function setupIfAvailable(module, ...args) {
4170
4175
  return module(...args);
4171
4176
  }
4172
4177
 
4173
- // src/@modules/@xmpp/xmpp.xOnline.ts
4174
- var xOnline = () => {
4178
+ // src/@modules/@xmpp/OnlineXMPP.ts
4179
+ var OnlineXMPP = () => {
4175
4180
  const settings = bootstrap.settings;
4176
4181
  bootstrap.session_xmpp.on(`online`, (address) => __async(null, null, function* () {
4177
4182
  bootstrap.cache.sigHault = false;
@@ -4182,7 +4187,7 @@ var xOnline = () => {
4182
4187
  to: `nwws@conference.nwws-oi.weather.gov/${nickname}`,
4183
4188
  xmlns: "http://jabber.org/protocol/muc"
4184
4189
  }));
4185
- setEventEmit({
4190
+ SetEventEmit({
4186
4191
  event: `onServiceStatus`,
4187
4192
  metadata: {
4188
4193
  message: `Succesfully connected to NOAA Weather Wire Service as "${nickname}"`,
@@ -4195,12 +4200,12 @@ var xOnline = () => {
4195
4200
  }));
4196
4201
  };
4197
4202
 
4198
- // src/@modules/@xmpp/xmpp.xOffline.ts
4199
- var xOffline = () => {
4203
+ // src/@modules/@xmpp/OfflineXMPP.ts
4204
+ var OfflineXMPP = () => {
4200
4205
  bootstrap.session_xmpp.on(`offline`, () => __async(null, null, function* () {
4201
4206
  bootstrap.cache.isConnected = false;
4202
4207
  bootstrap.cache.sigHault = true;
4203
- setEventEmit({
4208
+ SetEventEmit({
4204
4209
  event: `onServiceStatus`,
4205
4210
  metadata: {
4206
4211
  message: `Client has gone offline`,
@@ -4212,16 +4217,16 @@ var xOffline = () => {
4212
4217
  }));
4213
4218
  };
4214
4219
 
4215
- // src/@modules/@xmpp/xmpp.xError.ts
4216
- var xError = () => {
4220
+ // src/@modules/@xmpp/ErrorXMPP.ts
4221
+ var ErrorXMPP = () => {
4217
4222
  bootstrap.session_xmpp.on(`error`, (error) => __async(null, null, function* () {
4218
4223
  bootstrap.cache.isConnected = false;
4219
4224
  bootstrap.cache.sigHault = true;
4220
4225
  }));
4221
4226
  };
4222
4227
 
4223
- // src/@dictionaries/dictionaries.expressions.ts
4224
- var dict_expressions = {
4228
+ // src/@enums/Expressions.ts
4229
+ var EnumExpressions = {
4225
4230
  location: new RegExp(/^([A-Za-z.\-' ]+),\s*([A-Z]{2})$/),
4226
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"),
4227
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"),
@@ -4232,372 +4237,375 @@ var dict_expressions = {
4232
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")
4233
4238
  };
4234
4239
 
4235
- // src/@dictionaries/dictionaries.awips.ts
4236
- var dict_awips = {
4237
- ABV: `rawinsonde-data-above-100-millibars`,
4238
- ADA: `alarm-alert-administrative-message`,
4239
- ADM: `alert-administrative-message`,
4240
- ADR: `nws-administrative-message`,
4241
- ADV: `space-environment-advisory`,
4242
- AFD: `area-forecast-discussion`,
4243
- AFM: `area-forecast-matrices`,
4244
- AFP: `area-forecast-product`,
4245
- AFW: `fire-weather-matrix`,
4246
- AGF: `agricultural-forecast`,
4247
- AGO: `agricultural-observations`,
4248
- ALT: `space-environment-alert`,
4249
- AQA: `air-quality-alert`,
4250
- AQI: `air-quality-index-statement`,
4251
- ASA: `air-stagnation-advisory`,
4252
- AVA: `avalanche-watch`,
4253
- AVG: `avalanche-weather-guidance`,
4254
- AVW: `avalanche-warning`,
4255
- AWO: `area-weather-outlook`,
4256
- AWS: `area-weather-summary`,
4257
- AWU: `area-weather-update`,
4258
- AWW: `airport-weather-warning`,
4259
- BLU: `blue-alert`,
4260
- BOY: `buoy-report`,
4261
- BRG: `coast-guard-observations`,
4262
- BRT: `hourly-roundup-for-weather-radio`,
4263
- CAE: `child-abduction-emergency`,
4264
- CCF: `coded-city-forecast`,
4265
- CDW: `civil-danger-warning`,
4266
- CEM: `civil-emergency-message`,
4267
- CF6: `monthly-daily-climate-data`,
4268
- CFP: `convective-forecast-product`,
4269
- CFW: `coastal-flood-warnings-watches-statements`,
4270
- CGR: `coast-guard-surface-report`,
4271
- CHG: `computer-hurricane-guidance`,
4272
- CLA: `climatological-report-annual`,
4273
- CLI: `climatological-report-daily`,
4274
- CLM: `climatological-report-monthly`,
4275
- CLQ: `climatological-report-quarterly`,
4276
- CLS: `climatological-report-seasonal`,
4277
- CLT: `climate-report`,
4278
- CMM: `coded-climatological-monthly-means`,
4279
- COD: `coded-analysis-and-forecasts`,
4280
- CPF: `great-lakes-port-forecast`,
4281
- CUR: `space-environment-products-routine`,
4282
- CWA: `center-weather-advisory`,
4283
- CWF: `coastal-waters-forecast`,
4284
- CWS: `center-weather-statement`,
4285
- DAY: `space-environment-product-daily`,
4286
- DDO: `daily-dispersion-outlook`,
4287
- DGT: `drought-information-statement`,
4288
- DMO: `practice-demo-warning`,
4289
- DSA: `unnumbered-depression-advisory`,
4290
- DSM: `asos-daily-summary`,
4291
- DSW: `dust-storm-warning`,
4292
- EFP: `extended-forecast-3-to-5-day`,
4293
- EOL: `six-to-ten-day-weather-outlook-local`,
4294
- EQI: `tsunami-bulletin`,
4295
- EQR: `earthquake-report`,
4296
- EQW: `earthquake-warning`,
4297
- ESF: `flood-potential-outlook`,
4298
- ESG: `extended-streamflow-guidance`,
4299
- ESP: `extended-streamflow-prediction`,
4300
- ESS: `water-supply-outlook`,
4301
- EVI: `evacuation-immediate`,
4302
- EWW: `extreme-wind-warning`,
4303
- FA0: `aviation-area-forecast-pacific`,
4304
- FA1: `aviation-area-forecast-northeast`,
4305
- FA2: `aviation-area-forecast-southeast`,
4306
- FA3: `aviation-area-forecast-north-central`,
4307
- FA4: `aviation-area-forecast-south-central`,
4308
- FA5: `aviation-area-forecast-rocky-mountains`,
4309
- FA6: `aviation-area-forecast-west-coast`,
4310
- FA7: `aviation-area-forecast-juneau-ak`,
4311
- FA8: `aviation-area-forecast-anchorage-ak`,
4312
- FA9: `aviation-area-forecast-fairbanks-ak`,
4313
- FD0: `winds-aloft-forecast-24hr-high-altitude`,
4314
- FD1: `winds-aloft-forecast-6hr`,
4315
- FD2: `winds-aloft-forecast-12hr`,
4316
- FD3: `winds-aloft-forecast-24hr`,
4317
- FD4: `winds-aloft-forecast`,
4318
- FD5: `winds-aloft-forecast`,
4319
- FD6: `winds-aloft-forecast`,
4320
- FD7: `winds-aloft-forecast`,
4321
- FD8: `winds-aloft-forecast-6hr-high-altitude`,
4322
- FD9: `winds-aloft-forecast-12hr-high-altitude`,
4323
- FDI: `fire-danger-indices`,
4324
- FFA: `flash-flood-watch`,
4325
- FFG: `flash-flood-guidance`,
4326
- FFH: `headwater-guidance`,
4327
- FFS: `flash-flood-statement`,
4328
- FFW: `flash-flood-warning`,
4329
- FLN: `national-flood-summary`,
4330
- FLS: `flood-statement`,
4331
- FLW: `flood-warning`,
4332
- FOF: `upper-wind-fallout-forecast`,
4333
- FRW: `fire-warning`,
4334
- FSH: `marine-fisheries-service-message`,
4335
- FTM: `radar-outage-notification`,
4336
- FTP: `temp-pop-guidance`,
4337
- FWA: `fire-weather-administrative-message`,
4338
- FWD: `fire-weather-outlook-discussion`,
4339
- FWF: `fire-weather-forecast`,
4340
- FWL: `land-management-forecast`,
4341
- FWM: `miscellaneous-fire-weather-product`,
4342
- FWN: `fire-weather-notification`,
4343
- FWO: `fire-weather-observation`,
4344
- FWS: `fire-weather-spot-forecast`,
4345
- FZL: `freezing-level-data`,
4346
- GLF: `great-lakes-forecast`,
4347
- GLS: `great-lakes-storm-summary`,
4348
- GRE: `green`,
4349
- HD1: `rfc-qpf-data-product`,
4350
- HD2: `rfc-qpf-data-product`,
4351
- HD3: `rfc-qpf-data-product`,
4352
- HD4: `rfc-qpf-data-product`,
4353
- HD7: `rfc-qpf-data-product`,
4354
- HD8: `rfc-qpf-data-product`,
4355
- HD9: `rfc-qpf-data-product`,
4356
- HLS: `hurricane-local-statement`,
4357
- HMD: `hydrometeorological-discussion`,
4358
- HML: `ahps-xml-product`,
4359
- HMW: `hazardous-materials-warning`,
4360
- HP1: `rfc-qpf-verification-product`,
4361
- HP2: `rfc-qpf-verification-product`,
4362
- HP3: `rfc-qpf-verification-product`,
4363
- HP4: `rfc-qpf-verification-product`,
4364
- HP5: `rfc-qpf-verification-product`,
4365
- HP6: `rfc-qpf-verification-product`,
4366
- HP7: `rfc-qpf-verification-product`,
4367
- HP8: `rfc-qpf-verification-product`,
4368
- HRR: `weather-roundup`,
4369
- HSF: `high-seas-forecast`,
4370
- HWO: `hazardous-weather-outlook`,
4371
- HWR: `hourly-weather-roundup`,
4372
- HYD: `daily-hydrometeorological-products`,
4373
- HYM: `monthly-hydrometeorological-product`,
4374
- ICE: `ice-forecast`,
4375
- IDM: `ice-drift-vectors`,
4376
- INI: `administrative-message`,
4377
- IOB: `ice-observation`,
4378
- KPA: `keep-alive-message`,
4379
- LAE: `local-area-emergency`,
4380
- LCD: `preliminary-local-climatological-data`,
4381
- LCO: `local-cooperative-observation`,
4382
- LEW: `law-enforcement-warning`,
4383
- LFP: `local-forecast`,
4384
- LKE: `lake-stages`,
4385
- LLS: `low-level-sounding`,
4386
- LOW: `low-temperatures`,
4387
- LSR: `local-storm-report`,
4388
- LTG: `lightning-data`,
4389
- MAN: `rawinsonde-mandatory-levels`,
4390
- MAP: `mean-areal-precipitation`,
4391
- MAW: `amended-marine-forecast`,
4392
- MFM: `marine-forecast-matrix`,
4393
- MIM: `marine-interpretation-message`,
4394
- MIS: `miscellaneous-local-product`,
4395
- MOB: `marine-observations`,
4396
- MON: `space-environment-product-monthly`,
4397
- MRP: `marine-product-techniques-development`,
4398
- MSM: `asos-monthly-summary-message`,
4399
- MTR: `metar-observation`,
4400
- MTT: `metar-test-message`,
4401
- MVF: `marine-verification-coded-message`,
4402
- MWS: `marine-weather-statement`,
4403
- MWW: `marine-weather-message`,
4404
- NOU: `weather-reconnaissance-flights`,
4405
- NOW: `short-term-forecast`,
4406
- NOX: `data-management-message`,
4407
- NPW: `non-precipitation-warning`,
4408
- NSH: `nearshore-marine-forecast`,
4409
- NUW: `nuclear-power-plant-warning`,
4410
- NWR: `noaa-weather-radio-forecast`,
4411
- OAV: `other-aviation-products`,
4412
- OBS: `observations`,
4413
- OFA: `offshore-aviation-forecast`,
4414
- OFF: `offshore-forecast`,
4415
- OMR: `other-marine-products`,
4416
- OPU: `other-public-products`,
4417
- OSO: `other-surface-observations`,
4418
- OSW: `ocean-surface-winds`,
4419
- OUA: `other-upper-air-data`,
4420
- OZF: `zone-forecast`,
4421
- PFM: `point-forecast-matrices`,
4422
- PFW: `fire-weather-point-forecast-matrices`,
4423
- PLS: `plain-language-ship-report`,
4424
- PMD: `prognostic-meteorological-discussion`,
4425
- PNS: `public-information-statement`,
4426
- POE: `probability-of-exceedance`,
4427
- PRB: `heat-index-forecast-tables`,
4428
- PRC: `pilot-report-collective`,
4429
- PRE: `preliminary-forecasts`,
4430
- PSH: `post-storm-hurricane-report`,
4431
- PTS: `probabilistic-outlook-points`,
4432
- PWO: `public-severe-weather-outlook`,
4433
- PWS: `tropical-cyclone-probabilities`,
4434
- QPF: `quantitative-precipitation-forecast`,
4435
- QPS: `quantitative-precipitation-statement`,
4436
- RDF: `revised-digital-forecast`,
4437
- REC: `recreational-report`,
4438
- RER: `record-report`,
4439
- RET: `eas-activation-request`,
4440
- RFD: `rangeland-fire-danger-forecast`,
4441
- RFI: `rfi-observation`,
4442
- RFR: `route-forecast`,
4443
- RFW: `red-flag-warning`,
4444
- RHW: `radiological-hazard-warning`,
4445
- RMT: `required-monthly-test`,
4446
- RNS: `rain-information-statement`,
4447
- RR1: `hydro-met-data-report-part-1`,
4448
- RR2: `hydro-met-data-report-part-2`,
4449
- RR3: `hydro-met-data-report-part-3`,
4450
- RR4: `hydro-met-data-report-part-4`,
4451
- RR5: `hydro-met-data-report-part-5`,
4452
- RR6: `hydro-met-data-report-part-6`,
4453
- RR7: `hydro-met-data-report-part-7`,
4454
- RR8: `hydro-met-data-report-part-8`,
4455
- RR9: `hydro-met-data-report-part-9`,
4456
- RRA: `automated-hydrologic-observation-report`,
4457
- RRM: `miscellaneous-hydrologic-data`,
4458
- RRS: `hads-data`,
4459
- RRY: `asos-hourly-test-message`,
4460
- RSD: `daily-snotel-data`,
4461
- RSM: `monthly-snotel-data`,
4462
- RTP: `regional-temp-precip-table`,
4463
- RVA: `river-summary`,
4464
- RVD: `daily-river-forecast`,
4465
- RVF: `river-forecast`,
4466
- RVI: `river-ice-statement`,
4467
- RVM: `miscellaneous-river-product`,
4468
- RVR: `river-recreation-statement`,
4469
- RVS: `river-statement`,
4470
- RWR: `regional-weather-roundup`,
4471
- RWS: `regional-weather-summary`,
4472
- RWT: `required-weekly-test`,
4473
- SAB: `special-avalanche-bulletin`,
4474
- SAF: `agricultural-weather-forecast`,
4475
- SAG: `snow-avalanche-guidance`,
4476
- SAT: `apt-prediction`,
4477
- SAW: `preliminary-notice-of-watch`,
4478
- SCC: `storm-summary`,
4479
- SCD: `supplementary-climatological-data`,
4480
- SCN: `soil-climate-analysis-network`,
4481
- SCP: `satellite-cloud-product`,
4482
- SCS: `selected-cities-summary`,
4483
- SDO: `supplementary-data-observation`,
4484
- SDS: `special-dispersion-statement`,
4485
- SEL: `severe-local-storm-watch`,
4486
- SEV: `spc-watch-point-information`,
4487
- SFP: `state-forecast`,
4488
- SFT: `tabular-state-forecast`,
4489
- SGL: `rawinsonde-significant-levels`,
4490
- SHP: `surface-ship-report`,
4491
- SIG: `international-sigmet`,
4492
- SIM: `satellite-interpretation-message`,
4493
- SLS: `severe-local-storm-outline`,
4494
- SMF: `smoke-management-weather-forecast`,
4495
- SMW: `special-marine-warning`,
4496
- SOO: `science-operations-officer-product`,
4497
- SPE: `satellite-precipitation-estimates`,
4498
- SPF: `storm-strike-probability-bulletin`,
4499
- SPS: `special-weather-statement`,
4500
- SPW: `shelter-in-place-warning`,
4501
- SQW: `snow-squall-warning`,
4502
- SRD: `surf-discussion`,
4503
- SRF: `surf-forecast`,
4504
- SRG: `soaring-guidance`,
4505
- SSM: `synoptic-surface-observation`,
4506
- STA: `weather-statistical-summary`,
4507
- STD: `satellite-tropical-disturbance-summary`,
4508
- STO: `road-condition-report`,
4509
- STP: `state-temp-precip-table`,
4510
- STQ: `spot-forecast-request`,
4511
- SUM: `space-weather-message`,
4512
- SVR: `severe-thunderstorm-warning`,
4513
- SVS: `severe-weather-statement`,
4514
- SWOMCD: `mesoscale-discussion`,
4515
- SWODY1: `storm-prediction-center-day-1-outlook`,
4516
- SWODY2: `storm-prediction-center-day-2-outlook`,
4517
- SWODY3: `storm-prediction-center-day-3-outlook`,
4518
- SWS: `state-weather-summary`,
4519
- SYN: `regional-weather-synopsis`,
4520
- TAF: `terminal-aerodrome-forecast`,
4521
- TAP: `terminal-alerting-products`,
4522
- TAV: `travelers-forecast-table`,
4523
- TCA: `tropical-cyclone-advisory`,
4524
- TCD: `tropical-cyclone-discussion`,
4525
- TCE: `tropical-cyclone-position-estimate`,
4526
- TCM: `tropical-cyclone-marine-aviation-advisory`,
4527
- TCP: `public-tropical-cyclone-advisory`,
4528
- TCS: `satellite-tropical-cyclone-summary`,
4529
- TCU: `tropical-cyclone-update`,
4530
- TCV: `tropical-cyclone-break-points`,
4531
- TIB: `tsunami-bulletin`,
4532
- TID: `tide-report`,
4533
- TMA: `tsunami-tide-seismic-acknowledgement`,
4534
- TOE: `telephone-outage-emergency`,
4535
- TOR: `tornado-warning`,
4536
- TPT: `temperature-precipitation-table`,
4537
- TSU: `tsunami-information-statement`,
4538
- TUV: `ultraviolet-index`,
4539
- TVL: `travelers-forecast`,
4540
- TWB: `transcribed-weather-broadcast`,
4541
- TWD: `tropical-weather-discussion`,
4542
- TWO: `tropical-weather-outlook`,
4543
- TWS: `tropical-weather-summary`,
4544
- URN: `aircraft-reconnaissance`,
4545
- UVI: `ultraviolet-index`,
4546
- VAA: `volcanic-activity-advisory`,
4547
- VER: `forecast-verification-statistics`,
4548
- VFT: `taf-verification-product`,
4549
- VOW: `volcano-warning`,
4550
- WA0: `airmet-pacific`,
4551
- WA1: `airmet-northeast`,
4552
- WA2: `airmet-southeast`,
4553
- WA3: `airmet-north-central`,
4554
- WA4: `airmet-south-central`,
4555
- WA5: `airmet-rocky-mountains`,
4556
- WA6: `airmet-west-coast`,
4557
- WA7: `airmet-juneau-ak`,
4558
- WA8: `airmet-anchorage-ak`,
4559
- WA9: `airmet-fairbanks-ak`,
4560
- WAR: `space-environment-warning`,
4561
- WAT: `space-environment-watch`,
4562
- WCN: `weather-watch-clearance-notification`,
4563
- WCR: `weekly-weather-and-crop-report`,
4564
- WDA: `weekly-data-for-agriculture`,
4565
- WDU: `warning-decision-update`,
4566
- WEK: `space-environment-product-weekly`,
4567
- WOU: `watch-outline-update`,
4568
- WS1: `sigmet-northeast`,
4569
- WS2: `sigmet-southeast`,
4570
- WS3: `sigmet-north-central`,
4571
- WS4: `sigmet-south-central`,
4572
- WS5: `sigmet-rocky-mountains`,
4573
- WS6: `sigmet-west-coast`,
4574
- WST: `tropical-cyclone-sigmet`,
4575
- WSV: `volcanic-activity-sigmet`,
4576
- WSW: `winter-weather-warning`,
4577
- WWA: `watch-status-report`,
4578
- WWP: `watch-probabilities`,
4579
- 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`
4580
4587
  };
4581
4588
 
4582
- // src/@modules/@stanza/stanza.getAwipsType.ts
4583
- var getAwipsType = (options) => {
4589
+ // src/@modules/@stanza/GetAwipsType.ts
4590
+ var GetAwipsType = (options) => {
4584
4591
  const attributes = options.attributes;
4585
4592
  if (!attributes.awipsid) {
4586
4593
  return {
4587
4594
  type: null,
4588
- prefix: null
4595
+ prefix: null,
4596
+ discovered: false
4589
4597
  };
4590
4598
  }
4591
- for (const [prefix, type] of Object.entries(dict_awips)) {
4599
+ for (const [prefix, type] of Object.entries(EnumAWIPS)) {
4592
4600
  if (attributes.awipsid.startsWith(prefix)) {
4593
- return { type, prefix };
4601
+ return { type, prefix, discovered: true };
4594
4602
  }
4595
4603
  }
4596
- return { type: null, prefix: null };
4604
+ return { type: options.attributes.awipsid, prefix: options.attributes.awipsid, discovered: false };
4597
4605
  };
4598
4606
 
4599
- // src/@modules/@stanza/stanza.validate.ts
4600
- var validate = (options) => {
4607
+ // src/@modules/@stanza/ValidateStanza.ts
4608
+ var ValidateStanza = (options) => {
4601
4609
  if (options.stanza.is(`message`)) {
4602
4610
  const cb = options.stanza.getChild(`x`);
4603
4611
  if (cb && cb.children) {
@@ -4606,9 +4614,9 @@ var validate = (options) => {
4606
4614
  if (attributes.awipsid && attributes.awipsid.length > 1) {
4607
4615
  const isCapEvent = message.includes(`<?xml`);
4608
4616
  const isCapAreaDescription = message.includes(`<areaDesc>`);
4609
- const isVTEC = message.match(dict_expressions.pvtec) != null;
4610
- const isUGC = message.match(dict_expressions.ugc1) != null;
4611
- 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 });
4612
4620
  if (getType.type != null) {
4613
4621
  return {
4614
4622
  message,
@@ -4628,8 +4636,8 @@ var validate = (options) => {
4628
4636
  return { isIgnored: true };
4629
4637
  };
4630
4638
 
4631
- // src/@dictionaries/dictionaries.matches.ts
4632
- var dict_matches = {
4639
+ // src/@enums/Matches.ts
4640
+ var EnumMatches = {
4633
4641
  SPS: [
4634
4642
  { match: /STRONG THUNDERSTORM/i, label: "Convective Special Weather Statement", statement: false },
4635
4643
  { match: /SPECIAL WEATHER STATEMENT/i, label: "Special Weather Statement", statement: false }
@@ -4665,15 +4673,20 @@ var dict_matches = {
4665
4673
  ]
4666
4674
  };
4667
4675
 
4668
- // src/@parsers/@text/text.getDescriptionFromProduct.ts
4669
- var getDescriptionFromProduct = (options) => {
4676
+ // src/@parsers/@text/GetDescriptionFromProduct.ts
4677
+ var GetDescriptionFromProduct = (options) => {
4670
4678
  let message = options.message;
4671
- 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));
4672
4685
  if (dates.length) {
4673
4686
  const lastMatch = dates[dates.length - 1][0];
4674
4687
  const sIndx = message.lastIndexOf(lastMatch);
4675
4688
  if (sIndx !== -1) {
4676
- const endIndx = message.indexOf("&&", sIndx);
4689
+ const endIndx = getEndIndex(message, sIndx);
4677
4690
  message = message.substring(sIndx + lastMatch.length, endIndx !== -1 ? endIndx : void 0).trimStart();
4678
4691
  if (message.startsWith("/")) message = message.slice(1).trimStart();
4679
4692
  if (options.handle && message.includes(options.handle)) {
@@ -4687,22 +4700,22 @@ var getDescriptionFromProduct = (options) => {
4687
4700
  if (handleIndx !== -1) {
4688
4701
  let afterHandle = message.substring(handleIndx + options.handle.length).trimStart();
4689
4702
  if (afterHandle.startsWith("/")) afterHandle = afterHandle.slice(1).trimStart();
4690
- const latEnd = afterHandle.indexOf("&&");
4703
+ const latEnd = getEndIndex(afterHandle);
4691
4704
  message = latEnd !== -1 ? afterHandle.substring(0, latEnd).trim() : afterHandle.trim();
4692
4705
  }
4693
4706
  }
4694
4707
  return message.trim();
4695
4708
  };
4696
4709
 
4697
- // src/@parsers/@text/text.getPolygonFromProduct.ts
4710
+ // src/@parsers/@text/GetPolygonFromProduct.ts
4698
4711
  var getPolygonFromProduct = (message) => {
4699
4712
  const coordinates = [];
4700
4713
  const match = message.match(
4701
4714
  /LAT\.\.\.LON\s+([\s\S]*?)(?=\n[A-Z]{2,}(?:\.\.\.|:)|\$\$|&&|$)/i
4702
4715
  );
4703
4716
  if (!match) return coordinates;
4704
- const text2 = match[1];
4705
- const values = text2.match(/\d{4,8}/g);
4717
+ const text = match[1];
4718
+ const values = text.match(/\d{4,8}/g);
4706
4719
  if (!values) return coordinates;
4707
4720
  if (values.every((v) => v.length === 8)) {
4708
4721
  for (const value of values) {
@@ -4727,8 +4740,8 @@ var getPolygonFromProduct = (message) => {
4727
4740
  return coordinates;
4728
4741
  };
4729
4742
 
4730
- // src/@parsers/@text/text.getTextFromProduct.ts
4731
- var getTextFromProduct = (options) => {
4743
+ // src/@parsers/@text/GetTextFromProduct.ts
4744
+ var GetTextFromProduct = (options) => {
4732
4745
  var _a;
4733
4746
  const lines = options.message.split(`
4734
4747
  `);
@@ -4748,8 +4761,8 @@ var getTextFromProduct = (options) => {
4748
4761
  return null;
4749
4762
  };
4750
4763
 
4751
- // src/@dictionaries/dictionaries.icao.ts
4752
- var dict_icao = {
4764
+ // src/@enums/ICAO.ts
4765
+ var EnumICAO = {
4753
4766
  "KLUB": "Lubbock, TX",
4754
4767
  "KLCH": "Lake Charles, LA",
4755
4768
  "TSTL": "St. Louis, MO",
@@ -4990,180 +5003,251 @@ var dict_icao = {
4990
5003
  "PAJK": "Juneau, AK"
4991
5004
  };
4992
5005
 
4993
- // src/@building/building.office.ts
4994
- var getEventOffice = (options) => {
5006
+ // src/@building/GetEventOffice.ts
5007
+ var GetEventOffice = (options) => {
4995
5008
  var _a, _b, _c, _d, _e, _f, _g;
4996
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;
4997
- 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;
4998
5011
  return { office, name };
4999
5012
  };
5000
5013
 
5001
- // src/@dictionaries/dictionaries.tags.ts
5002
- var dict_tags = {
5003
- "FROSTBITE AND HYPOTHERMIA ARE LIKELY": "Frostbite and Hypothermia Likely",
5004
- "LICKELY BECOME SLICK AND HAZARDOUS": "Slick and Hazardous Roads",
5005
- "SLIPPERY ROAD CONDITIONS": "Slippery Roads",
5006
- "BLOWING SNOW WHICH COULD REDUCE VISIBILITY": "Blowing Snow Reducing Visibility",
5007
- "TRAVEL COULD BE VERY DIFFICULT": "Difficult Travel Conditions",
5008
- "DIFFICULT TRAVEL CONDITIONS": "Difficult Travel Conditions",
5009
- "EXPECT DISRUPTIONS": "Expect Disruptions to Travel",
5010
- "A LARGE AND EXTREMELY DANGEROUS TORNADO": "Large and Dangerous Tornado",
5011
- "THIS IS A PARTICULARLY DANGEROUS SITUATION": "Particularly Dangerous Situation",
5012
- "RADAR INDICATED ROTATION": "Radar Indicated Tornado",
5013
- "WEATHER SPOTTERS CONFIRMED TORNADO": "Confirmed by Storm Spotters",
5014
- "A SEVERE THUNDERSTORM CAPABLE OF PRODUCING A TORNADO": "Developing Tornado",
5015
- "LAW ENFORCEMENT CONFIRMED TORNADO": "Reported by Law Enforcement",
5016
- "A TORNADO IS ON THE GROUND": "Confirmed Tornado",
5017
- "WEATHER SPOTTERS REPORTED FUNNEL CLOUD": "Confirmed Funnel Cloud by Storm Spotters",
5018
- "PUBLIC CONFIRMED TORNADO": "Public reports of Tornado",
5019
- "RADAR CONFIRMED": "Radar Confirmed",
5020
- "TORNADO WAS REPORTED BRIEFLY ON THE GROUND": "Tornado no longer on ground",
5021
- "SPOTTERS INDICATE THAT A FUNNEL CLOUD CONTINUES WITH THIS STORM": "Funnel Cloud Continues",
5022
- "A TORNADO MAY DEVELOP AT ANY TIME": "Potentional still exists for Tornado to form",
5023
- "LIFE-THREATENING SITUATION": "Life Threating Situation",
5024
- "COMPLETE DESTRUCTION IS POSSIBLE": "Extremly Damaging Tornado",
5025
- "POTENTIALLY DEADLY TORNADO": "Deadly Tornado",
5026
- "RADAR INDICATED": "Radar Indicated",
5027
- "HAIL DAMAGE TO VEHICLES IS EXPECTED": "Damaging to Vehicles",
5028
- "EXPECT WIND DAMAGE": "Wind Damage",
5029
- "FREQUENT LIGHTNING": "Frequent Lightning",
5030
- "PEOPLE AND ANIMALS OUTDOORS WILL BE INJURED": "Capable of Injuring People and Animals",
5031
- "TRAINED WEATHER SPOTTERS": "Confirmed by Storm Spotters",
5032
- "SOURCE...PUBLIC": "Confirmed by Public",
5033
- "SMALL CRAFT COULD BE DAMAGED": "Potential Damage to Small Craft",
5034
- "A TORNADO WATCH REMAINS IN EFFECT": "Active Tornado Watch",
5035
- "TENNIS BALL SIZE HAIL": "Tennis Ball Size Hail",
5036
- "BASEBALL SIZE HAIL": "Baseball Size Hail",
5037
- "GOLF BALL SIZE HAIL": "Golf Ball Size Hail",
5038
- "QUARTER SIZE HAIL": "Quarter Size Hail",
5039
- "PING PONG BALL SIZE HAIL": "Ping Pong Ball Size Hail",
5040
- "NICKEL SIZE HAIL": "Nickel Size Hail",
5041
- "DOPPLER RADAR.": "Confirmed by Radar",
5042
- "DOPPLER RADAR AND AUTOMATED GAUGES.": "Confirmed by Radar and Gauges",
5043
- "FLASH FLOODING CAUSED BY THUNDERSTORMS.": "Caused by Thunderstorm",
5044
- "SOURCE...EMERGENCY MANAGEMENT.": "Confirmed by Emergency Management",
5045
- "FLASH FLOODING CAUSED BY HEAVY RAIN.": "Caused by heavy rain",
5046
- "SOURCE...LAW ENFORCEMENT REPORTED.": "Confirmed by Law Enforcement",
5047
- "MINOR FLOODING IS OCCURING": "Minor Flooding Occurring",
5048
- "VERY COLD TEMPERATURES CAN LEAD TO HYPOTHERMIA": "Hypothermia Risk",
5049
- "SENSITIVE VEGETATION AND POSSIBLY DAMAGE UNPROTECTED OUTDOOR": "Vegetation and Outdoor Plumbing Risk",
5050
- "RIP CURRENTS CAN SWEEP EVEN THE BEST SWIMMER": "Hazardous to All Swimmers",
5051
- "HYPOTHERMIA IF PRECAUTIONS ARE NOT TAKEN.": "Hypothermia Risk",
5052
- "FROSTBITE AND HYPOTHERMIA WILL OCCUR IF UNPROTECTED SKIN": "Frostbite and Hypothermia Risk on Unprotected Skin",
5053
- "TEMPERATURES COULD CAUSE RUPTURED WATER PIPES": "Risk of Ruptured Water Pipes",
5054
- "COULD RESULT IN HYPOTHERMIA OR FROSTBITE ON EXPOSED SKIN IF": "Hypothermia or Frostbite Risk on Exposed Skin",
5055
- "WINDS WILL STRENGTHEN": "Strengthening Winds",
5056
- "EXPECT ROADS TO RE-FREEZE": "Roads May Re-Freeze",
5057
- "SLICK AND ICY SPOTS ON ROADS": "Slick and Icy Roads",
5058
- "ICY PATCHES MAY BE MORE COMMON ON BRIDGES": "Icy Patches Likely on Bridges",
5059
- "SLICK SPOTS ON UNTREATED ROADS": "Slick Spots on Untreated Roads",
5060
- "TEMPERATURES ARE EXPECTED TO FALL BELOW FREEZING": "Temperatures Expected Below Freezing",
5061
- "HAZARDOUS ROADWAYS AND BLACK ICE": "Hazardous Roadways and Black Ice",
5062
- "SLOW DOWN AND ALLOW EXTRA TIME": "Slow Down and Allow Extra Time",
5063
- "SHOULD EXERCISE CAUTION": "Should Exercise Caution",
5064
- "LAKE EFFECT SNOW EXPECTED": "Lake Effect Snow Expected",
5065
- "MODERATE LAKE EFFECT SNOWFALL RATES AND BLOWING SNOW": "Moderate Lake Effect Snowfall and Blowing Snow",
5066
- "NO TSUNAMI THREAT": "No Active Tsunami Threat",
5067
- "NO SIGNIFICANT TSUNAMI THREAT": "No Significant Tsunami Threat",
5068
- "NO TSUNAMI IMPACTS ARE EXPECTED": "No Tsunami Impacts Expected",
5069
- "A TSUNAMI THREAT EXISTS": "Tsunami Threat Exists",
5070
- "TSUNAMI THREAT": "Active Tsunami Threat",
5071
- "HEAT ILLNESSES": "Can cause heat illness",
5072
- "WATCH POSSIBLE": "Watch Possible",
5073
- "INTENSIFYING": "Intensifying",
5074
- "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
+ ]
5075
5156
  };
5076
5157
 
5077
- // src/@building/building.tags.ts
5078
- var getEventTags = (message) => {
5079
- 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
+ )];
5080
5164
  };
5081
5165
 
5082
- // src/@building/building.properties.ts
5083
- var properties = (options) => {
5166
+ // src/@building/GetEventProperties.ts
5167
+ var GetEventProperties = (options) => {
5084
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;
5085
- 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;
5086
5170
  const polygons = getPolygonFromProduct(options.message);
5087
- const properties2 = {
5171
+ const properties = {
5088
5172
  locations: (_e = (_d = (_c = options == null ? void 0 : options.ugc) == null ? void 0 : _c.locations) == null ? void 0 : _d.join(`; `)) != null ? _e : null,
5089
5173
  locations_array: (_g = (_f = options == null ? void 0 : options.ugc) == null ? void 0 : _f.locations) != null ? _g : [],
5090
- 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 }),
5091
5175
  attributes: options.attributes,
5092
5176
  geocode: {
5093
- office: getEventOffice({ attributes: options.attributes, organization, pVtec: options.pVtec }),
5177
+ office: GetEventOffice({ attributes: options.attributes, organization, pVtec: options.pVtec }),
5094
5178
  organization,
5095
5179
  ugc: (_k = (_j = options == null ? void 0 : options.ugc) == null ? void 0 : _j.zones) != null ? _k : [],
5096
5180
  polygon: polygons.length > 0 ? Buffer.from(JSON.stringify([polygons])).toString("base64") : null,
5097
5181
  polygon_generated: polygons.length > 0 ? true : false
5098
5182
  },
5099
5183
  parameters: {
5100
- tags: getEventTags(options.message),
5101
- instructions: (_l = getTextFromProduct({ message: options.message, find: [`For your protection`, `do not`, `use extreme caution`], append: `...`, removal: [`.`] })) != null ? _l : null,
5102
- source: (_m = getTextFromProduct({ message: options.message, find: [`SOURCE...`], removal: [`.`] })) != null ? _m : null,
5103
- hazards: (_n = getTextFromProduct({ message: options.message, find: [`HAZARD...`], removal: [`.`] })) != null ? _n : null,
5104
- impacts: (_o = getTextFromProduct({ message: options.message, find: [`IMPACT...`], removal: [`.`] })) != null ? _o : null,
5105
- estimated_hail_size: (_p = getTextFromProduct({ message: options.message, find: [`MAX HAIL SIZE...`, `HAIL...`], removal: ["in"] })) != null ? _p : null,
5106
- estimated_wind_gusts: (_q = getTextFromProduct({ message: options.message, find: [`MAX WIND GUST...`, `WIND...`] })) != null ? _q : null,
5107
- damage_threat: (_r = getTextFromProduct({ message: options.message, find: [`DAMAGE THREAT...`], removal: [] })) != null ? _r : null,
5108
- tornado_threat: (_s = getTextFromProduct({ message: options.message, find: [`TORNADO...`, `WATERSPOUT...`] })) != null ? _s : null,
5109
- flood_threat: (_t = getTextFromProduct({ message: options.message, find: [`FLASH FLOOD...`] })) != null ? _t : null,
5110
- wind_threat: (_u = getTextFromProduct({ message: options.message, find: [`WIND THREAT...`] })) != null ? _u : null,
5111
- 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
5112
5196
  },
5113
5197
  discussion_parameters: {
5114
- 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,
5115
- discussion_concerning: (_z = getTextFromProduct({ message: options.message, find: [`Concerning...`] })) != null ? _z : null,
5116
- discussion_max_tornado: (_A = getTextFromProduct({ message: options.message, find: [`MOST PROBABLE PEAK TORNADO INTENSITY...`] })) != null ? _A : null,
5117
- discussion_max_hail: (_B = getTextFromProduct({ message: options.message, find: [`MOST PROBABLE PEAK HAIL SIZE...`] })) != null ? _B : null,
5118
- discussion_max_wind: (_C = getTextFromProduct({ message: options.message, find: [`MOST PROBABLE PEAK WIND GUST...`] })) != null ? _C : null,
5119
- 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
5120
5204
  },
5121
5205
  watch_parameters: {
5122
- 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,
5123
5207
  watch_type: options.message.includes(`TORNADO WATCH`) ? `Tornado` : (options == null ? void 0 : options.message.includes(`SEVERE`)) ? `Severe` : null,
5124
- additional_tornadoes_probability: (_P = getTextFromProduct({ message: options.message, find: [`PROB OF 2 OR MORE TORNADOES`], removal: [`%`, `<`, `:`] })) != null ? _P : null,
5125
- strong_tornadoes_probability: (_Q = getTextFromProduct({ message: options.message, find: [`PROB OF 1 OR MORE STRONG /EF2-EF5/ TORNADOES`], removal: [`%`, `<`, `:`] })) != null ? _Q : null,
5126
- severe_wind_probability: (_R = getTextFromProduct({ message: options.message, find: [`PROB OF 10 OR MORE SEVERE WIND EVENTS`], removal: [`%`, `<`, `:`] })) != null ? _R : null,
5127
- severe_hail_probability: (_S = getTextFromProduct({ message: options.message, find: [`PROB OF 10 OR MORE SEVERE HAIL EVENTS`], removal: [`%`, `<`, `:`] })) != null ? _S : null,
5128
- hail_2in_probability: (_T = getTextFromProduct({ message: options.message, find: [`PROB OF 1 OR MORE HAIL EVENTS >= 2 INCHES`], removal: [`%`, `<`, `:`] })) != null ? _T : null,
5129
- combined_hail_wind_probability: (_U = getTextFromProduct({ message: options.message, find: [`PROB OF 6 OR MORE COMBINED SEVERE HAIL/WIND EVENTS`], removal: [`%`, `<`, `:`] })) != null ? _U : null,
5130
- max_hail_in: (_V = getTextFromProduct({ message: options.message, find: [`MAX HAIL /INCHES/`], removal: [`%`, `<`, `:`] })) != null ? _V : null,
5131
- max_wind_surface: (_W = getTextFromProduct({ message: options.message, find: [`MAX WIND GUSTS SURFACE /KNOTS/`], removal: [`%`, `<`, `:`] })) != null ? _W : null,
5132
- max_tops_x100feet: (_X = getTextFromProduct({ message: options.message, find: [`MAX TOPS /X 100 FEET/`], removal: [`%`, `<`, `:`] })) != null ? _X : null,
5133
- 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
5134
5218
  }
5135
5219
  };
5136
- if (isNaN(Number(properties2.watch_parameters.watch_number))) {
5137
- properties2.watch_parameters.watch_number = null;
5220
+ if (isNaN(Number(properties.watch_parameters.watch_number))) {
5221
+ properties.watch_parameters.watch_number = null;
5138
5222
  }
5139
- return properties2;
5223
+ return properties;
5140
5224
  };
5141
5225
 
5142
- // src/@building/building.headers.ts
5143
- var getEventHeader = (options) => {
5226
+ // src/@building/GetEventHeader.ts
5227
+ var GetEventHeader = (options) => {
5144
5228
  var _a, _b, _c;
5145
- const properties2 = options.properties;
5146
- const vtec2 = (_a = options.vtec) != null ? _a : null;
5147
- const ugc2 = properties2.geocode.ugc != null ? properties2.geocode.ugc.join(`-`) : `0`;
5148
- 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`}`;
5149
5233
  };
5150
5234
 
5151
- // src/@building/building.tracking.ts
5152
- var getEventTracking = (options) => {
5235
+ // src/@building/GetEventTracking.ts
5236
+ var GetEventTracking = (options) => {
5153
5237
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
5154
- const properties2 = options.properties;
5238
+ const properties = options.properties;
5155
5239
  const attributes = options.attributes;
5156
5240
  const stanza = options.stanza;
5157
- const vtec2 = options.vtec;
5241
+ const vtec = options.vtec;
5158
5242
  if (options.type === `RAW`) {
5159
- const getWatchNumber = (_a = properties2.watch_parameters.watch_number) != null ? _a : null;
5243
+ const getWatchNumber = (_a = properties.watch_parameters.watch_number) != null ? _a : null;
5160
5244
  if (getWatchNumber) {
5161
- return `${properties2.geocode.office.office}.${stanza.getType.prefix}.A.${getWatchNumber}`;
5245
+ return `${properties.geocode.office.office}.${stanza.getType.prefix}.A.${getWatchNumber}`;
5162
5246
  }
5163
- 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"}`;
5164
5248
  }
5165
5249
  if (options.type === `VTEC`) {
5166
- return vtec2.tracking;
5250
+ return vtec.tracking;
5167
5251
  }
5168
5252
  if (options.type === `API`) {
5169
5253
  if (options.vtec) {
@@ -5182,37 +5266,39 @@ var getEventTracking = (options) => {
5182
5266
  }
5183
5267
  };
5184
5268
 
5185
- // src/@modules/@utilities/utilities.setDebug.ts
5186
- var setDebug = (options) => {
5187
- var _a, _b, _c, _d;
5269
+ // src/@modules/@utilities/SetDebug.ts
5270
+ var SetDebug = (options) => {
5271
+ var _a, _b;
5188
5272
  const settings = bootstrap.settings;
5189
5273
  bootstrap.listener.emit(`debug`, {
5190
5274
  message: options.message,
5191
- parent: (_b = (_a = options == null ? void 0 : options.title) == null ? void 0 : _a.split(`.`)[0]) == null ? void 0 : _b.replace(`@`, ``),
5192
- function: (_c = options == null ? void 0 : options.title) == null ? void 0 : _c.split(`.`)[1]
5275
+ function: (_a = options.title) != null ? _a : `debug`
5193
5276
  });
5194
5277
  if (settings.EnableDebugging) {
5195
- 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}`);
5196
5279
  }
5197
5280
  };
5198
5281
 
5199
- // src/@events/events.text.ts
5200
- var text = (stanza) => __async(null, null, function* () {
5282
+ // src/@events/ParseText.ts
5283
+ var ParseText = (stanza) => __async(null, null, function* () {
5201
5284
  var _a, _b, _c, _d, _e;
5202
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 !== "$$");
5203
5286
  if (!getMessages || (getMessages == null ? void 0 : getMessages.length) == 0) return;
5204
5287
  for (const message of getMessages) {
5205
5288
  const tick = performance.now();
5206
5289
  const attributes = stanza == null ? void 0 : stanza.attributes;
5207
- const props = properties({ message, attributes });
5208
- const header = getEventHeader({ properties: props, getType: stanza.getType });
5290
+ const props = GetEventProperties({ message, attributes });
5291
+ const header = GetEventHeader({ properties: props, getType: stanza.getType });
5209
5292
  const issued = new Date(attributes.issue);
5210
5293
  const expires = new Date(issued.getTime() + 12 * 60 * 60 * 1e3);
5211
- 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()));
5212
5295
  let event = matches == null ? void 0 : matches.label;
5213
5296
  let isStatement = (_e = matches == null ? void 0 : matches.statement) != null ? _e : false;
5214
5297
  if (!event) {
5215
- 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
+ }
5216
5302
  isStatement = true;
5217
5303
  }
5218
5304
  bootstrap.cache.processed.push({
@@ -5231,7 +5317,7 @@ var text = (stanza) => __async(null, null, function* () {
5231
5317
  metadata: {
5232
5318
  ms: performance.now() - tick,
5233
5319
  source: `events.text`,
5234
- tracking: getEventTracking({ type: `RAW`, stanza, attributes, properties: props }),
5320
+ tracking: GetEventTracking({ type: `RAW`, stanza, attributes, properties: props }),
5235
5321
  header,
5236
5322
  vtec: null,
5237
5323
  hvtec: null,
@@ -5246,20 +5332,20 @@ var text = (stanza) => __async(null, null, function* () {
5246
5332
  }
5247
5333
  })
5248
5334
  });
5249
- setDebug({ title: `@events.text`, message: `Event process took ${performance.now() - tick} ms` });
5335
+ SetDebug({ title: `ParseText`, message: `${Math.round(performance.now() - tick)}ms` });
5250
5336
  }
5251
5337
  });
5252
5338
 
5253
- // src/@parsers/@ugc/ugc.header.ts
5339
+ // src/@parsers/@ugc/GetUGCHeader.ts
5254
5340
  var getUGCHeader = (message) => {
5255
- const start = message.search(dict_expressions.ugc1);
5341
+ const start = message.search(EnumExpressions.ugc1);
5256
5342
  const sub = message.substring(start);
5257
- const end = sub.search(dict_expressions.ugc2);
5343
+ const end = sub.search(EnumExpressions.ugc2);
5258
5344
  const fin = sub.substring(0, end).replace(/\s+/g, "").slice(0, -1);
5259
5345
  return fin != null ? fin : null;
5260
5346
  };
5261
5347
 
5262
- // src/@parsers/@ugc/ugc.zones.ts
5348
+ // src/@parsers/@ugc/GetZones.ts
5263
5349
  var getZones = (header) => {
5264
5350
  const splits = header.split("-");
5265
5351
  const zones = [];
@@ -5294,8 +5380,8 @@ var getZones = (header) => {
5294
5380
  return zones.filter((item) => item !== "");
5295
5381
  };
5296
5382
 
5297
- // src/@parsers/@ugc/ugc.expiry.ts
5298
- var getExpiry = (message) => {
5383
+ // src/@parsers/@ugc/GetExpiry.ts
5384
+ var GetExpiry = (message) => {
5299
5385
  const match = message.match(/\b(\d{6})-/);
5300
5386
  if (!match) {
5301
5387
  return null;
@@ -5309,12 +5395,12 @@ var getExpiry = (message) => {
5309
5395
  return expires.toISOString();
5310
5396
  };
5311
5397
 
5312
- // src/@parsers/@ugc/ugc.getCache.ts
5398
+ // src/@parsers/@ugc/GetCache.ts
5313
5399
  var getCache = (key) => {
5314
5400
  return bootstrap.cache.ugc.get(key);
5315
5401
  };
5316
5402
 
5317
- // src/@parsers/@ugc/ugc.setCache.ts
5403
+ // src/@parsers/@ugc/SetCache.ts
5318
5404
  var setCache = (key, value) => {
5319
5405
  if (bootstrap.cache.ugc.size >= 5e3) {
5320
5406
  const firstKey = bootstrap.cache.ugc.keys().next().value;
@@ -5323,7 +5409,7 @@ var setCache = (key, value) => {
5323
5409
  bootstrap.cache.ugc.set(key, value);
5324
5410
  };
5325
5411
 
5326
- // src/@parsers/@ugc/ugc.locations.ts
5412
+ // src/@parsers/@ugc/GetLocations.ts
5327
5413
  var getLocations = (zones) => __async(null, null, function* () {
5328
5414
  const uniqueZones = Array.from(new Set(zones));
5329
5415
  const results = [];
@@ -5352,11 +5438,11 @@ var getLocations = (zones) => __async(null, null, function* () {
5352
5438
  return results;
5353
5439
  });
5354
5440
 
5355
- // src/@parsers/@ugc/ugc.extract.ts
5441
+ // src/@parsers/@ugc/UGCExtract.ts
5356
5442
  var ugcExtract = (message) => __async(null, null, function* () {
5357
5443
  const head = getUGCHeader(message);
5358
5444
  const ugcs = getZones(head);
5359
- const expires = getExpiry(message);
5445
+ const expires = GetExpiry(message);
5360
5446
  const areas = yield getLocations(ugcs);
5361
5447
  if (!head || (ugcs == null ? void 0 : ugcs.length) == 0) return;
5362
5448
  return {
@@ -5366,25 +5452,28 @@ var ugcExtract = (message) => __async(null, null, function* () {
5366
5452
  };
5367
5453
  });
5368
5454
 
5369
- // src/@events/events.ugc.ts
5370
- var ugc = (stanza) => __async(null, null, function* () {
5455
+ // src/@events/ParseUGC.ts
5456
+ var ParseUGC = (stanza) => __async(null, null, function* () {
5371
5457
  var _a, _b, _c, _d, _e;
5372
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 !== "$$");
5373
5459
  if (!getMessages || (getMessages == null ? void 0 : getMessages.length) == 0) return;
5374
5460
  for (const message of getMessages) {
5375
5461
  const tick = performance.now();
5376
5462
  const attributes = stanza == null ? void 0 : stanza.attributes;
5377
- const ugc2 = yield ugcExtract(message);
5378
- if (ugc2 != null) {
5379
- const props = properties({ message, attributes, ugc: ugc2 });
5463
+ const ugc = yield ugcExtract(message);
5464
+ if (ugc != null) {
5465
+ const props = GetEventProperties({ message, attributes, ugc });
5380
5466
  const issued = new Date(attributes.issue);
5381
- const expires = new Date(ugc2.expires);
5382
- const header = getEventHeader({ properties: props, getType: stanza.getType });
5383
- 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()));
5384
5470
  let event = matches == null ? void 0 : matches.label;
5385
5471
  let isStatement = (_e = matches == null ? void 0 : matches.statement) != null ? _e : false;
5386
5472
  if (!event) {
5387
- 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
+ }
5388
5477
  isStatement = true;
5389
5478
  }
5390
5479
  bootstrap.cache.processed.push({
@@ -5403,7 +5492,7 @@ var ugc = (stanza) => __async(null, null, function* () {
5403
5492
  metadata: {
5404
5493
  ms: performance.now() - tick,
5405
5494
  source: `events.ugc`,
5406
- tracking: getEventTracking({ type: `RAW`, stanza, attributes, properties: props }),
5495
+ tracking: GetEventTracking({ type: `RAW`, stanza, attributes, properties: props }),
5407
5496
  header,
5408
5497
  vtec: null,
5409
5498
  hvtec: null,
@@ -5418,21 +5507,21 @@ var ugc = (stanza) => __async(null, null, function* () {
5418
5507
  }
5419
5508
  })
5420
5509
  });
5421
- setDebug({ title: `@events.ugc`, message: `Event process took ${performance.now() - tick} ms` });
5510
+ SetDebug({ title: `ParseUGC`, message: `${Math.round(performance.now() - tick)}ms` });
5422
5511
  }
5423
5512
  }
5424
5513
  });
5425
5514
 
5426
- // src/@dictionaries/dictionaries.products.ts
5427
- var dict_products = {
5515
+ // src/@enums/Products.ts
5516
+ var EnumProducts = {
5428
5517
  "O": "Operational Product",
5429
5518
  "T": "Test Product",
5430
5519
  "E": "Experimental Product",
5431
5520
  "X": "Experimental Product (Non-Operational)"
5432
5521
  };
5433
5522
 
5434
- // src/@dictionaries/dictionaries.events.ts
5435
- var dict_events = {
5523
+ // src/@enums/Events.ts
5524
+ var EnumEvents = {
5436
5525
  "AF": "Ashfall",
5437
5526
  "AS": "Air Stagnation",
5438
5527
  "BH": "Beach Hazard",
@@ -5496,8 +5585,8 @@ var dict_events = {
5496
5585
  "ZY": "Freezing Spray"
5497
5586
  };
5498
5587
 
5499
- // src/@dictionaries/dictionaries.actions.ts
5500
- var dict_actions = {
5588
+ // src/@enums/Actions.ts
5589
+ var EnumActions = {
5501
5590
  "W": "Warning",
5502
5591
  "F": "Forecast",
5503
5592
  "A": "Watch",
@@ -5507,8 +5596,8 @@ var dict_actions = {
5507
5596
  "S": "Statement"
5508
5597
  };
5509
5598
 
5510
- // src/@dictionaries/dictionaries.status.ts
5511
- var dict_status = {
5599
+ // src/@enums/Status.ts
5600
+ var EnumStatus = {
5512
5601
  "NEW": "Issued",
5513
5602
  "CON": "Updated",
5514
5603
  "EXT": "Extended",
@@ -5521,8 +5610,8 @@ var dict_status = {
5521
5610
  "EXP": "Expired"
5522
5611
  };
5523
5612
 
5524
- // src/@parsers/@pvtec/pvtec.expires.ts
5525
- var getExpiry2 = (dates) => {
5613
+ // src/@parsers/@pvtec/GetExpiry.ts
5614
+ var GetExpiry2 = (dates) => {
5526
5615
  if ((dates == null ? void 0 : dates[1]) == `000000T0000Z`) return "Invalid Date Format";
5527
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`;
5528
5617
  const local = new Date(new Date(expires).getTime() - 4 * 60 * 6e4);
@@ -5530,24 +5619,24 @@ var getExpiry2 = (dates) => {
5530
5619
  return `${local.getFullYear()}-${pad(local.getMonth() + 1)}-${pad(local.getDate())}T${pad(local.getHours())}:${pad(local.getMinutes())}:00.000-04:00`;
5531
5620
  };
5532
5621
 
5533
- // src/@parsers/@pvtec/pvtec.extract.ts
5534
- var pvExtract = (message) => {
5622
+ // src/@parsers/@pvtec/VTECExtract.ts
5623
+ var VTECExtract = (message) => {
5535
5624
  var _a, _b, _c, _d;
5536
5625
  if (!message) return null;
5537
- const getVTECs = (_a = message.match(dict_expressions.pvtec)) != null ? _a : [];
5626
+ const getVTECs = (_a = message.match(EnumExpressions.pvtec)) != null ? _a : [];
5538
5627
  const vtecs = [];
5539
- for (const vtec2 of getVTECs) {
5540
- const sub = vtec2.split(`.`);
5628
+ for (const vtec of getVTECs) {
5629
+ const sub = vtec.split(`.`);
5541
5630
  if ((sub == null ? void 0 : sub.length) < 7) continue;
5542
5631
  const dates = (_b = sub[6]) == null ? void 0 : _b.split(`-`);
5543
5632
  vtecs.push({
5544
- vtec: vtec2,
5545
- product: dict_products[sub[0]],
5633
+ vtec,
5634
+ product: EnumProducts[sub[0]],
5546
5635
  tracking: `${sub[2]}.${sub[3]}.${sub[4]}.${sub[5]}`,
5547
- event: `${dict_events[sub[3]]} ${dict_actions[sub[4]]}`,
5548
- status: dict_status[sub[1]],
5549
- organization: (_d = (_c = message.match(dict_expressions.wmo)) == null ? void 0 : _c[0]) != null ? _d : null,
5550
- 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),
5551
5640
  is_watch: (sub[4] == `A` || sub[4] == `Y`) && (sub[3] == `TO` || sub[3] == `SV`),
5552
5641
  prediction_center: sub[2] == `KWNS` ? true : false
5553
5642
  });
@@ -5555,8 +5644,8 @@ var pvExtract = (message) => {
5555
5644
  return vtecs.length > 0 ? vtecs : null;
5556
5645
  };
5557
5646
 
5558
- // src/@dictionaries/dictionaries.causes.ts
5559
- var dict_causes = {
5647
+ // src/@enums/Causes.ts
5648
+ var EnumCauses = {
5560
5649
  "SM": "Snow Melt",
5561
5650
  "RS": "Rain/Snow Melt",
5562
5651
  "ER": "Excessive Rain",
@@ -5574,16 +5663,16 @@ var dict_causes = {
5574
5663
  "OT": "Other Effects"
5575
5664
  };
5576
5665
 
5577
- // src/@dictionaries/dictionaries.records.ts
5578
- var dict_records = {
5666
+ // src/@enums/Records.ts
5667
+ var EnumRecords = {
5579
5668
  "NO": "No Record Expected",
5580
5669
  "NR": "Near Record or possible record",
5581
5670
  "UU": "Unknown history of records",
5582
5671
  "OO": "Other"
5583
5672
  };
5584
5673
 
5585
- // src/@dictionaries/dictionaries.severity.ts
5586
- var dict_severity = {
5674
+ // src/@enums/Severity.ts
5675
+ var EnumSeverity = {
5587
5676
  N: "Not Expected",
5588
5677
  0: "Areal Flood or FF Product",
5589
5678
  1: "Minor",
@@ -5592,42 +5681,42 @@ var dict_severity = {
5592
5681
  U: "Unknown"
5593
5682
  };
5594
5683
 
5595
- // src/@parsers/@hvtec/hvtec.extract.ts
5596
- var hvExtract = (message) => {
5684
+ // src/@parsers/@hvtec/HVExtract.ts
5685
+ var HVExtract = (message) => {
5597
5686
  var _a;
5598
- const getHVTECs = (_a = message.match(dict_expressions.hvtec)) != null ? _a : [];
5687
+ const getHVTECs = (_a = message.match(EnumExpressions.hvtec)) != null ? _a : [];
5599
5688
  const vtecs = [];
5600
- for (const vtec2 of getHVTECs) {
5601
- const sub = vtec2.split(`.`);
5689
+ for (const vtec of getHVTECs) {
5690
+ const sub = vtec.split(`.`);
5602
5691
  if (sub.length < 7) continue;
5603
5692
  vtecs.push({
5604
- hvtec: vtec2,
5605
- severity: dict_severity[sub[1]],
5606
- cause: dict_causes[sub[2]],
5607
- record: dict_records[sub[6]]
5693
+ hvtec: vtec,
5694
+ severity: EnumSeverity[sub[1]],
5695
+ cause: EnumCauses[sub[2]],
5696
+ record: EnumRecords[sub[6]]
5608
5697
  });
5609
5698
  }
5610
5699
  return vtecs.length > 0 ? vtecs : null;
5611
5700
  };
5612
5701
 
5613
- // src/@events/events.vtec.ts
5614
- var vtec = (stanza) => __async(null, null, function* () {
5702
+ // src/@events/ParseVTEC.ts
5703
+ var ParseVTEC = (stanza) => __async(null, null, function* () {
5615
5704
  var _a, _b, _c, _d, _e;
5616
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 !== "$$");
5617
5706
  if (!getMessages || (getMessages == null ? void 0 : getMessages.length) == 0) return;
5618
5707
  for (const message of getMessages) {
5619
5708
  const tick = performance.now();
5620
5709
  const attributes = stanza == null ? void 0 : stanza.attributes;
5621
- const pVtec = pvExtract(message);
5622
- const hVtec = hvExtract(message);
5623
- const ugc2 = yield ugcExtract(message);
5624
- 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) {
5625
5714
  for (const pv of pVtec) {
5626
- const vtec2 = pv;
5627
- const props = properties({ message, attributes, ugc: ugc2, pVtec: vtec2 });
5628
- 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 });
5629
5718
  const issued = (_d = new Date(attributes.issue)) != null ? _d : /* @__PURE__ */ new Date();
5630
- const expires = new Date(vtec2.expires);
5719
+ const expires = new Date(vtec.expires);
5631
5720
  bootstrap.cache.processed.push({
5632
5721
  type: `Feature`,
5633
5722
  geometry: {
@@ -5639,12 +5728,12 @@ var vtec = (stanza) => __async(null, null, function* () {
5639
5728
  parent: pv.event,
5640
5729
  status: pv.status,
5641
5730
  issued: !isNaN(issued.getTime()) ? issued.toISOString() : (/* @__PURE__ */ new Date()).toISOString(),
5642
- 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()
5643
5732
  }, props), {
5644
5733
  metadata: {
5645
5734
  ms: performance.now() - tick,
5646
5735
  source: `events.vtec`,
5647
- tracking: getEventTracking({ type: `VTEC`, stanza, attributes, properties: props, vtec: vtec2 }),
5736
+ tracking: GetEventTracking({ type: `VTEC`, stanza, attributes, properties: props, vtec }),
5648
5737
  header,
5649
5738
  vtec: pv,
5650
5739
  hvtec: hVtec,
@@ -5659,19 +5748,19 @@ var vtec = (stanza) => __async(null, null, function* () {
5659
5748
  }
5660
5749
  })
5661
5750
  });
5662
- setDebug({ title: `@events.vtec`, message: `Event process took ${performance.now() - tick} ms` });
5751
+ SetDebug({ title: `ParseVTEC`, message: `${Math.round(performance.now() - tick)}ms` });
5663
5752
  }
5664
5753
  }
5665
5754
  }
5666
5755
  });
5667
5756
 
5668
- // src/@events/events.api.ts
5669
- var api = (stanza) => __async(null, null, function* () {
5757
+ // src/@events/ParseAPI.ts
5758
+ var ParseAPI = (stanza) => __async(null, null, function* () {
5670
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;
5671
5760
  const messages = Object.values(JSON.parse(stanza.message).features);
5672
5761
  for (const feature of messages) {
5673
5762
  const tick = performance.now();
5674
- 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;
5675
5764
  bootstrap.cache.processed.push({
5676
5765
  type: `Feature`,
5677
5766
  geometry: {
@@ -5691,7 +5780,7 @@ var api = (stanza) => __async(null, null, function* () {
5691
5780
  geocode: {
5692
5781
  office: {
5693
5782
  office: pVtec ? (_w = pVtec == null ? void 0 : pVtec[0]) == null ? void 0 : _w.tracking.split(`.`)[0] : null,
5694
- 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
5695
5784
  },
5696
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],
5697
5786
  ugc: (_E = (_D = (_C = feature == null ? void 0 : feature.properties) == null ? void 0 : _C.geocode) == null ? void 0 : _D.UGC) != null ? _E : [],
@@ -5699,11 +5788,11 @@ var api = (stanza) => __async(null, null, function* () {
5699
5788
  polygon_generated: ((_H = feature == null ? void 0 : feature.geometry) == null ? void 0 : _H.coordinates.length) > 0 ? true : false
5700
5789
  },
5701
5790
  parameters: {
5702
- 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),
5703
5792
  instructions: (_K = (_J = feature == null ? void 0 : feature.properties) == null ? void 0 : _J.instruction) != null ? _K : null,
5704
- source: (_M = getTextFromProduct({ message: (_L = feature == null ? void 0 : feature.properties) == null ? void 0 : _L.description, find: [`SOURCE...`], removal: [`.`] })) != null ? _M : null,
5705
- hazards: (_O = getTextFromProduct({ message: (_N = feature == null ? void 0 : feature.properties) == null ? void 0 : _N.description, find: [`HAZARD...`], removal: [`.`] })) != null ? _O : null,
5706
- 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,
5707
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,
5708
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,
5709
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,
@@ -5713,31 +5802,31 @@ var api = (stanza) => __async(null, null, function* () {
5713
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
5714
5803
  },
5715
5804
  discussion_parameters: {
5716
- 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,
5717
- discussion_concerning: (_wa = getTextFromProduct({ message: (_va = feature == null ? void 0 : feature.properties) == null ? void 0 : _va.description, find: [`Concerning...`] })) != null ? _wa : null,
5718
- 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,
5719
- 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,
5720
- 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,
5721
- 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
5722
5811
  },
5723
5812
  watch_parameters: {
5724
- 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),
5725
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,
5726
- 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,
5727
- 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,
5728
- 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,
5729
- 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,
5730
- 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,
5731
- 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,
5732
- 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,
5733
- 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,
5734
- 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,
5735
- 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`
5736
5825
  },
5737
5826
  metadata: {
5738
5827
  ms: performance.now() - tick,
5739
5828
  source: `events.api`,
5740
- 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] }),
5741
5830
  header: `ZCZC-ATMOSX-${(_ob = (_nb = feature == null ? void 0 : feature.properties) == null ? void 0 : _nb.parameters) == null ? void 0 : _ob.WMOidentifier}`,
5742
5831
  vtec: pVtec == null ? void 0 : pVtec[0],
5743
5832
  hvtec: null,
@@ -5752,12 +5841,12 @@ var api = (stanza) => __async(null, null, function* () {
5752
5841
  }
5753
5842
  }
5754
5843
  });
5755
- setDebug({ title: `@events.api`, message: `Event process took ${performance.now() - tick} ms` });
5844
+ SetDebug({ title: `ParseAPI`, message: `${Math.round(performance.now() - tick)}ms` });
5756
5845
  }
5757
5846
  });
5758
5847
 
5759
- // src/@dictionaries/dictionaries.enhanced.ts
5760
- var dict_enhanced = {
5848
+ // src/@enums/Enhanced.ts
5849
+ var EnumEnhanced = {
5761
5850
  "Tornado Warning": {
5762
5851
  "Tornado Emergency": { description: "tornado emergency" },
5763
5852
  "PDS Tornado Warning": { description: "particularly dangerous situation", damage: `CONSIDERABLE` },
@@ -5795,22 +5884,21 @@ var dict_enhanced = {
5795
5884
  "Considerable Severe Thunderstorm Warning (TPROB)": { damage: `CONSIDERABLE`, tornado: `POSSIBLE` },
5796
5885
  "Considerable Severe Thunderstorm Warning": { damage: `CONSIDERABLE` },
5797
5886
  "Severe Thunderstorm Warning (TPROB)": { tornado: `POSSIBLE` }
5887
+ },
5888
+ "Special Weather Statement": {
5889
+ "Convective Special Weather Statement": { description: "strong thunderstorm" }
5798
5890
  }
5799
5891
  };
5800
5892
 
5801
- // src/@building/building.enhance.ts
5802
- var getEventEnhancedName = (event) => {
5803
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
5804
- const configurations = bootstrap.settings;
5893
+ // src/@building/GetEventEnhancedName.ts
5894
+ var GetEventEnhancedName = (event) => {
5895
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i;
5805
5896
  let name = (_a = event == null ? void 0 : event.properties) == null ? void 0 : _a.event;
5806
- if (!((_b = configurations == null ? void 0 : configurations.GlobalSettings) == null ? void 0 : _b.BetterEventNames)) {
5807
- return name;
5808
- }
5809
- const damage = (_d = (_c = event == null ? void 0 : event.properties) == null ? void 0 : _c.parameters) == null ? void 0 : _d.damage_threat;
5810
- const tornado = (_f = (_e = event == null ? void 0 : event.properties) == null ? void 0 : _e.parameters) == null ? void 0 : _f.tornado_threat;
5811
- const pdswatch = (_h = (_g = event == null ? void 0 : event.properties) == null ? void 0 : _g.watch_parameters) == null ? void 0 : _h.pds_watch;
5812
- const description = (_j = (_i = event == null ? void 0 : event.properties) == null ? void 0 : _i.description) == null ? void 0 : _j.toLowerCase();
5813
- 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)) {
5814
5902
  if (eventKey !== name) continue;
5815
5903
  for (const [paramKey, paramValue] of Object.entries(eventConfig)) {
5816
5904
  let matches = true;
@@ -5835,8 +5923,8 @@ var getEventEnhancedName = (event) => {
5835
5923
  return name;
5836
5924
  };
5837
5925
 
5838
- // src/@dictionaries/dictionaries.correlations.ts
5839
- var dict_correlations = [
5926
+ // src/@enums/Correlations.ts
5927
+ var EnumCorrelations = [
5840
5928
  { type: "Statement", name: "Statement", isCancel: false, isUpdate: false, isIssued: true, isStatement: true },
5841
5929
  { type: "Update", name: "Updated", isCancel: false, isUpdate: true, isIssued: false, isStatement: false },
5842
5930
  { type: "Cancel", name: "Cancelled", isCancel: true, isUpdate: false, isIssued: false, isStatement: false },
@@ -5851,8 +5939,8 @@ var dict_correlations = [
5851
5939
  { type: "Routine", name: "Routine", isCancel: false, isUpdate: true, isIssued: false, isStatement: false }
5852
5940
  ];
5853
5941
 
5854
- // src/@dictionaries/dictionaries.cancellation.ts
5855
- var dict_cancellation = [
5942
+ // src/@enums/Cancellation.ts
5943
+ var EnumCancellation = [
5856
5944
  "has been cancelled",
5857
5945
  "subsided sufficiently for the advisory to be cancelled",
5858
5946
  "has been cancelled",
@@ -5865,22 +5953,24 @@ var dict_cancellation = [
5865
5953
  "has weakened below severe"
5866
5954
  ];
5867
5955
 
5868
- // src/@dictionaries/dictionaries.testing.ts
5869
- var dict_testing = [
5956
+ // src/@enums/Testing.ts
5957
+ var EnumTesting = [
5870
5958
  `This is a test message`,
5871
5959
  `Monitoring message only.`,
5872
5960
  `THIS_MESSAGE_IS_FOR_TEST_PURPOSES_ONLY`,
5873
5961
  "TEST MESSAGE"
5874
5962
  ];
5875
5963
 
5876
- // src/@dictionaries/dictionaries.hail.ts
5877
- var dict_hail = {
5964
+ // src/@enums/Hail.ts
5965
+ var EnumHail = {
5966
+ "0.25": "Pea",
5878
5967
  ".25": "Pea",
5968
+ "0.50": "Penny",
5879
5969
  ".50": "Penny",
5880
5970
  ".75": "Penny",
5881
5971
  "Up to .75": "Penny",
5882
- ".88": "Nickel",
5883
5972
  "0.75": "Penny",
5973
+ ".88": "Nickel",
5884
5974
  "0.88": "Nickel",
5885
5975
  "1.00": "Quarter",
5886
5976
  "1.25": "Half Dollar",
@@ -5892,62 +5982,62 @@ var dict_hail = {
5892
5982
  "4.00": "CD/DVD"
5893
5983
  };
5894
5984
 
5895
- // src/@building/building.signature.ts
5896
- var getEventSignature = (event) => {
5985
+ // src/@building/GetEventSignature.ts
5986
+ var GetEventSignature = (event) => {
5897
5987
  var _a, _b, _c, _d, _e, _f, _g, _h;
5898
- const properties2 = event == null ? void 0 : event.properties;
5899
- const vtec2 = (_b = (_a = event == null ? void 0 : event.properties) == null ? void 0 : _a.metadata) == null ? void 0 : _b.vtec;
5900
- const status = dict_correlations.find((c) => c.type === (properties2 == null ? void 0 : properties2.status));
5901
- const csig = dict_cancellation.find((sig) => properties2.description.toLowerCase().includes(sig.toLowerCase()));
5902
- properties2.status_metadata = __spreadProps(__spreadValues({}, properties2.status_metadata), { is_issued: true, is_test: false });
5903
- if ((_c = properties2 == null ? void 0 : properties2.parameters) == null ? void 0 : _c.estimated_hail_size) {
5904
- 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 : "--"})`;
5905
5995
  }
5906
5996
  if (status) {
5907
- properties2.status = (_f = status.name) != null ? _f : properties2.status;
5908
- 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 });
5909
5999
  }
5910
6000
  if (csig) {
5911
- properties2.status_metadata = __spreadProps(__spreadValues({}, properties2.status_metadata), { is_expired: true });
6001
+ properties.status_metadata = __spreadProps(__spreadValues({}, properties.status_metadata), { is_expired: true });
5912
6002
  }
5913
- const getProduct = (_h = (_g = vtec2 == null ? void 0 : vtec2.vtec) == null ? void 0 : _g.split(`.`)[0]) == null ? void 0 : _h.replace(`/`, ``);
5914
- const isTestProduct = dict_products[getProduct] == `Test Product`;
5915
- 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) => {
5916
6006
  var _a2, _b2, _c2, _d2;
5917
- 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());
5918
6008
  })) {
5919
- properties2.status_metadata = __spreadProps(__spreadValues({}, properties2.status_metadata), { is_test: true });
6009
+ properties.status_metadata = __spreadProps(__spreadValues({}, properties.status_metadata), { is_test: true });
5920
6010
  }
5921
- if (new Date(properties2.expires).getTime() < Date.now()) {
5922
- 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 });
5923
6013
  }
5924
- properties2.status_metadata = __spreadValues({}, properties2.status_metadata);
6014
+ properties.status_metadata = __spreadValues({}, properties.status_metadata);
5925
6015
  return event;
5926
6016
  };
5927
6017
 
5928
- // src/@dictionaries/dictionaries.global.ts
5929
- var dict_global = [
5930
- "spc day 1 outlook",
5931
- "spc day 2 outlook",
5932
- "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"
5933
6023
  ];
5934
6024
 
5935
- // src/@manager/manager.setHash.ts
5936
- var setHash = (event, entry) => {
5937
- if (entry) {
5938
- entry.hashes.push(event.properties.metadata.hash);
5939
- entry.expires = event.properties.expires;
5940
- } else {
6025
+ // src/@manager/SetHash.ts
6026
+ var SetHash = (event, entry) => {
6027
+ if (!entry) {
5941
6028
  bootstrap.cache.hashes.push({
5942
6029
  tracking: event.properties.metadata.tracking,
5943
6030
  hashes: [event.properties.metadata.hash],
5944
6031
  expires: event.properties.expires
5945
6032
  });
6033
+ return;
5946
6034
  }
6035
+ entry.hashes.push(event.properties.metadata.hash);
6036
+ entry.expires = event.properties.expires;
5947
6037
  };
5948
6038
 
5949
- // src/@modules/@eas/eas.getWavPCM16.ts
5950
- var getWavPCM16 = (buffer) => {
6039
+ // src/@modules/@eas/GetWavPCM16.ts
6040
+ var GetWavPCM16 = (buffer) => {
5951
6041
  if (buffer.toString("ascii", 0, 4) !== "RIFF" || buffer.toString("ascii", 8, 12) !== "WAVE") {
5952
6042
  return null;
5953
6043
  }
@@ -5975,8 +6065,8 @@ var getWavPCM16 = (buffer) => {
5975
6065
  return { samples: new Int16Array(samples), sampleRate, channels, bitsPerSample };
5976
6066
  };
5977
6067
 
5978
- // src/@modules/@eas/eas.getSampledPCM16.ts
5979
- var getSampledPCM16 = (int16, originalRate, targetRate) => {
6068
+ // src/@modules/@eas/GetSampledPCM16.ts
6069
+ var GetSampledPCM16 = (int16, originalRate, targetRate) => {
5980
6070
  if (originalRate === targetRate) return int16;
5981
6071
  const ratio = targetRate / originalRate;
5982
6072
  const outLen = Math.max(1, Math.round(int16.length * ratio));
@@ -5992,15 +6082,15 @@ var getSampledPCM16 = (int16, originalRate, targetRate) => {
5992
6082
  return out;
5993
6083
  };
5994
6084
 
5995
- // src/@modules/@eas/eas.getPCMToFloat.ts
5996
- var getPCMToFloat = (int16) => {
6085
+ // src/@modules/@eas/GetPCMToFloat.ts
6086
+ var GetPCMToFloat = (int16) => {
5997
6087
  const out = new Float32Array(int16.length);
5998
6088
  for (let i = 0; i < int16.length; i++) out[i] = int16[i] / 32768;
5999
6089
  return out;
6000
6090
  };
6001
6091
 
6002
- // src/@modules/@eas/eas.getFloatPCM16.ts
6003
- var getFloatPCM16 = (float32) => {
6092
+ // src/@modules/@eas/GetFloatPCM16.ts
6093
+ var GetFloatPCM16 = (float32) => {
6004
6094
  const out = new Int16Array(float32.length);
6005
6095
  for (let i = 0; i < float32.length; i++) {
6006
6096
  let v = Math.max(-1, Math.min(1, float32[i]));
@@ -6009,11 +6099,11 @@ var getFloatPCM16 = (float32) => {
6009
6099
  return out;
6010
6100
  };
6011
6101
 
6012
- // src/@modules/@eas/eas.setRadioEffect.ts
6013
- var setRadioEffect = (int16, sampleRate) => {
6102
+ // src/@modules/@eas/SetRadioEffect.ts
6103
+ var SetRadioEffect = (int16, sampleRate) => {
6014
6104
  const hpCut = 3555;
6015
6105
  const lpCut = 1600;
6016
- const x = getPCMToFloat(int16);
6106
+ const x = GetPCMToFloat(int16);
6017
6107
  const dt = 1 / sampleRate;
6018
6108
  const rcHP = 1 / (2 * Math.PI * hpCut);
6019
6109
  const aHP = rcHP / (rcHP + dt);
@@ -6034,11 +6124,11 @@ var setRadioEffect = (int16, sampleRate) => {
6034
6124
  const compGain = 2;
6035
6125
  const norm = Math.tanh(compGain);
6036
6126
  for (let i = 0; i < x.length; i++) x[i] = Math.tanh(x[i] * compGain) / norm;
6037
- return getFloatPCM16(x);
6127
+ return GetFloatPCM16(x);
6038
6128
  };
6039
6129
 
6040
- // src/@modules/@eas/eas.setAFSK.ts
6041
- var setAFSK = (bits, sampleRate) => {
6130
+ // src/@modules/@eas/SetAFSK.ts
6131
+ var SetAFSK = (bits, sampleRate) => {
6042
6132
  const baud = 520.83;
6043
6133
  const markFreq = 2083.3;
6044
6134
  const spaceFreq = 1562.5;
@@ -6069,8 +6159,8 @@ var setAFSK = (bits, sampleRate) => {
6069
6159
  return Int16Array.from(result);
6070
6160
  };
6071
6161
 
6072
- // src/@modules/@eas/eas.setAsciiToBits.ts
6073
- var setAsciiToBits = (str) => {
6162
+ // src/@modules/@eas/SetAsciiToBits.ts
6163
+ var SetAsciiToBits = (str) => {
6074
6164
  const bits = [];
6075
6165
  for (let i = 0; i < str.length; i++) {
6076
6166
  const c = str.charCodeAt(i) & 255;
@@ -6081,8 +6171,8 @@ var setAsciiToBits = (str) => {
6081
6171
  return bits;
6082
6172
  };
6083
6173
 
6084
- // src/@modules/@eas/eas.getMergedPCM16.ts
6085
- var getMergedPCM16 = (arrays) => {
6174
+ // src/@modules/@eas/GetMergedPCM16.ts
6175
+ var GetMergedPCM16 = (arrays) => {
6086
6176
  let total = 0;
6087
6177
  for (const a of arrays) total += a.length;
6088
6178
  const out = new Int16Array(total);
@@ -6094,16 +6184,16 @@ var getMergedPCM16 = (arrays) => {
6094
6184
  return out;
6095
6185
  };
6096
6186
 
6097
- // src/@modules/@eas/eas.setSameHeader.ts
6098
- var setSameHeader = (vtec2, repeats, sampleRate = 8e3, options = {}) => {
6187
+ // src/@modules/@eas/SetSameHeader.ts
6188
+ var SetSameHeader = (vtec, repeats, sampleRate = 8e3, options = {}) => {
6099
6189
  var _a, _b;
6100
6190
  const preMarkSec = (_a = options.preMarkSec) != null ? _a : 0.3;
6101
6191
  const gapSec = (_b = options.gapSec) != null ? _b : 0.1;
6102
6192
  const bursts = [];
6103
6193
  const gap = new Int16Array(Math.floor(gapSec * sampleRate));
6104
6194
  for (let i = 0; i < repeats; i++) {
6105
- const bodyBits = setAsciiToBits(vtec2);
6106
- const body = setAFSK(bodyBits, sampleRate);
6195
+ const bodyBits = SetAsciiToBits(vtec);
6196
+ const body = SetAFSK(bodyBits, sampleRate);
6107
6197
  const extendedBodyDuration = Math.round(preMarkSec * sampleRate);
6108
6198
  const extendedBody = new Int16Array(extendedBodyDuration + gap.length);
6109
6199
  for (let j2 = 0; j2 < extendedBodyDuration; j2++) {
@@ -6113,11 +6203,11 @@ var setSameHeader = (vtec2, repeats, sampleRate = 8e3, options = {}) => {
6113
6203
  bursts.push(extendedBody);
6114
6204
  if (i !== repeats - 1) bursts.push(gap);
6115
6205
  }
6116
- return getMergedPCM16(bursts);
6206
+ return GetMergedPCM16(bursts);
6117
6207
  };
6118
6208
 
6119
- // src/@modules/@eas/eas.setAttentionTone.ts
6120
- var setAttentionTone = (ms, sampleRate) => {
6209
+ // src/@modules/@eas/SetAttentionTone.ts
6210
+ var SetAttentionTone = (ms, sampleRate) => {
6121
6211
  const len = Math.floor(ms * sampleRate);
6122
6212
  const out = new Int16Array(len);
6123
6213
  const f1 = 853;
@@ -6137,18 +6227,18 @@ var setAttentionTone = (ms, sampleRate) => {
6137
6227
  return out;
6138
6228
  };
6139
6229
 
6140
- // src/@modules/@eas/eas.setNoise.ts
6141
- var setNoise = (int16, noiseLevel = 0.02) => {
6142
- const x = getPCMToFloat(int16);
6230
+ // src/@modules/@eas/SetNoise.ts
6231
+ var SetNoise = (int16, noiseLevel = 0.02) => {
6232
+ const x = GetPCMToFloat(int16);
6143
6233
  for (let i = 0; i < x.length; i++) x[i] += (Math.random() * 2 - 1) * noiseLevel;
6144
6234
  let peak = 0;
6145
6235
  for (let i = 0; i < x.length; i++) peak = Math.max(peak, Math.abs(x[i]));
6146
6236
  if (peak > 1) for (let i = 0; i < x.length; i++) x[i] *= 0.98 / peak;
6147
- return getFloatPCM16(x);
6237
+ return GetFloatPCM16(x);
6148
6238
  };
6149
6239
 
6150
- // src/@modules/@eas/eas.getPCM16.ts
6151
- var getPCM16 = (samples, sampleRate) => {
6240
+ // src/@modules/@eas/GetPCM16.ts
6241
+ var GetPCM16 = (samples, sampleRate) => {
6152
6242
  let o = 0;
6153
6243
  const bytesPerSample = 2;
6154
6244
  const blockAlign = 1 * bytesPerSample;
@@ -6188,17 +6278,17 @@ var getPCM16 = (samples, sampleRate) => {
6188
6278
  return buffer;
6189
6279
  };
6190
6280
 
6191
- // src/@modules/@eas/eas.getTTS.ts
6281
+ // src/@modules/@eas/GetTTS.ts
6192
6282
  import { platform } from "os";
6193
6283
  import { writeFileSync } from "fs";
6194
6284
  import { execSync } from "child_process";
6195
- var getTTS = (text2, outputPath) => __async(null, null, function* () {
6285
+ var GetTTS = (text, outputPath) => __async(null, null, function* () {
6196
6286
  const vPlatform = platform();
6197
6287
  switch (vPlatform) {
6198
6288
  case "win32": {
6199
6289
  try {
6200
6290
  const txtPath = outputPath + ".txt";
6201
- writeFileSync(txtPath, text2, "utf8");
6291
+ writeFileSync(txtPath, text, "utf8");
6202
6292
  const command = [
6203
6293
  "Add-Type -AssemblyName System.Speech;",
6204
6294
  `$speak = New-Object System.Speech.Synthesis.SpeechSynthesizer;`,
@@ -6215,7 +6305,7 @@ var getTTS = (text2, outputPath) => __async(null, null, function* () {
6215
6305
  }
6216
6306
  case "linux":
6217
6307
  try {
6218
- execSync(`espeak -w "${outputPath}" "${text2.replace(/"/g, '\\"')}"`);
6308
+ execSync(`espeak -w "${outputPath}" "${text.replace(/"/g, '\\"')}"`);
6219
6309
  } catch (e) {
6220
6310
  }
6221
6311
  break;
@@ -6224,8 +6314,8 @@ var getTTS = (text2, outputPath) => __async(null, null, function* () {
6224
6314
  }
6225
6315
  });
6226
6316
 
6227
- // src/@modules/@eas/eas.getCleanDescription.ts
6228
- var getCleanDescription = (message) => {
6317
+ // src/@modules/@eas/GetCleanDescription.ts
6318
+ var GetCleanDescription = (message) => {
6229
6319
  const patches = [
6230
6320
  { regex: /\.{3,}/g, replacement: ". " },
6231
6321
  { regex: /\bUTC\b/g, replacement: "Coordinated Universal Time" },
@@ -6296,12 +6386,12 @@ var getCleanDescription = (message) => {
6296
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();
6297
6387
  };
6298
6388
 
6299
- // src/@modules/@eas/eas.setEasTone.ts
6389
+ // src/@modules/@eas/GenerateEASMessage.ts
6300
6390
  import { join } from "path";
6301
6391
  import { existsSync, mkdirSync, readFileSync, writeFileSync as writeFileSync2, unlinkSync } from "fs";
6302
6392
  import { execSync as execSync2 } from "child_process";
6303
6393
  import { platform as platform2 } from "os";
6304
- var setEasTone = (options) => __async(null, null, function* () {
6394
+ var GenerateEASMessage = (options) => __async(null, null, function* () {
6305
6395
  var _a;
6306
6396
  const tick = performance.now();
6307
6397
  const settings = bootstrap.settings;
@@ -6311,7 +6401,7 @@ var setEasTone = (options) => __async(null, null, function* () {
6311
6401
  let header = options.header;
6312
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();
6313
6403
  if (!message || !header) {
6314
- setWarning({
6404
+ SetWarning({
6315
6405
  title: `EAS`,
6316
6406
  message: `Message and header are required to generate an EAS tone.`
6317
6407
  });
@@ -6323,25 +6413,19 @@ var setEasTone = (options) => __async(null, null, function* () {
6323
6413
  if (!existsSync(directory)) {
6324
6414
  mkdirSync(directory, { recursive: true });
6325
6415
  }
6326
- if (!existsSync(join(directory, `/tts`))) {
6327
- mkdirSync(join(directory, `/tts`), { recursive: true });
6328
- }
6329
- if (!existsSync(join(directory, `/encoded`))) {
6330
- mkdirSync(join(directory, `/encoded`), { recursive: true });
6331
- }
6332
- const tmpTTS = join(directory, `/tts/${title}.wav`);
6333
- const outTTS = join(directory, `/encoded/${title}.wav`);
6416
+ const tmpTTS = join(directory, `/${title}-tts.wav`);
6417
+ const outTTS = join(directory, `/${title}.wav`);
6334
6418
  const vPlatform = platform2();
6335
6419
  if (vPlatform === "darwin") {
6336
- setWarning({
6420
+ SetWarning({
6337
6421
  title: `EAS`,
6338
6422
  message: `EAS tone generation is not supported on macOS.`
6339
6423
  });
6340
6424
  return null;
6341
6425
  }
6342
6426
  yield new Promise((resolve6, reject) => {
6343
- const tMsg = getCleanDescription(message);
6344
- getTTS(tMsg, tmpTTS).then(() => {
6427
+ const tMsg = GetCleanDescription(message);
6428
+ GetTTS(tMsg, tmpTTS).then(() => {
6345
6429
  resolve6();
6346
6430
  });
6347
6431
  });
@@ -6349,19 +6433,19 @@ var setEasTone = (options) => __async(null, null, function* () {
6349
6433
  return null;
6350
6434
  }
6351
6435
  buffTTS = readFileSync(tmpTTS);
6352
- const vWav = getWavPCM16(buffTTS);
6353
- const vSamples = getSampledPCM16(vWav.samples, vWav.sampleRate, 8e3);
6354
- 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);
6355
6439
  if (existsSync(prefix)) {
6356
6440
  let tBuffer = readFileSync(prefix);
6357
- let tWav = getWavPCM16(tBuffer);
6441
+ let tWav = GetWavPCM16(tBuffer);
6358
6442
  if (tWav == null) {
6359
6443
  try {
6360
- const converted = join(directory, `/tts/${title}.converted.wav`);
6444
+ const converted = join(directory, `/${title}-tts-fixed.wav`);
6361
6445
  execSync2(`ffmpeg -y -i "${prefix}" -ar 8000 -ac 1 -sample_fmt s16 "${converted}"`, { stdio: "ignore" });
6362
6446
  if (existsSync(converted)) {
6363
6447
  tBuffer = readFileSync(converted);
6364
- tWav = getWavPCM16(tBuffer);
6448
+ tWav = GetWavPCM16(tBuffer);
6365
6449
  try {
6366
6450
  unlinkSync(converted);
6367
6451
  } catch (e) {
@@ -6371,41 +6455,41 @@ var setEasTone = (options) => __async(null, null, function* () {
6371
6455
  }
6372
6456
  }
6373
6457
  if (tWav == null) {
6374
- 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.` });
6375
6459
  return null;
6376
6460
  }
6377
- const tSamples = tWav.sampleRate != 8e3 ? getSampledPCM16(tWav.samples, tWav.sampleRate, 8e3) : tWav.samples;
6378
- buffRadio = setRadioEffect(tSamples, 8e3);
6461
+ const tSamples = tWav.sampleRate != 8e3 ? GetSampledPCM16(tWav.samples, tWav.sampleRate, 8e3) : tWav.samples;
6462
+ buffRadio = SetRadioEffect(tSamples, 8e3);
6379
6463
  }
6380
6464
  buffFull = buffRadio != null ? [buffRadio, new Int16Array(Math.floor(0.5 * 8e3))] : [];
6381
6465
  buffFull.push(
6382
- setSameHeader(header, 3, 8e3, {
6466
+ SetSameHeader(header, 3, 8e3, {
6383
6467
  preMarkSec: 1.1,
6384
6468
  gapSec: 0.5
6385
6469
  }),
6386
6470
  new Int16Array(Math.floor(0.5 * 8e3)),
6387
- setAttentionTone(8, 8e3),
6471
+ SetAttentionTone(8, 8e3),
6388
6472
  new Int16Array(Math.floor(0.5 * 8e3)),
6389
6473
  vRadio
6390
6474
  );
6391
6475
  for (let i = 0; i < 3; i++) {
6392
- 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 }));
6393
6477
  buffFull.push(new Int16Array(Math.floor(0.5 * 8e3)));
6394
6478
  }
6395
- const aSamples = getMergedPCM16(buffFull);
6396
- const aFinal = setNoise(aSamples, 2e-3);
6397
- 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);
6398
6482
  writeFileSync2(outTTS, aBuffer);
6399
6483
  try {
6400
6484
  unlinkSync(tmpTTS);
6401
6485
  } catch (e) {
6402
6486
  }
6403
- setDebug({ title: `@eas.setEasTone`, message: `EAS tone generation took ${performance.now() - tick} ms` });
6487
+ SetDebug({ title: `GenerateEASMessage`, message: `${Math.round(performance.now() - tick)}ms` });
6404
6488
  return outTTS;
6405
6489
  });
6406
6490
 
6407
- // src/@parsers/@text/text.getEmbedText.ts
6408
- var getEmebedText = (event) => {
6491
+ // src/@parsers/@text/GetEmbededText.ts
6492
+ var GetEmebedText = (event) => {
6409
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;
6410
6494
  const line = (label, value, condition = true) => condition && value ? `${label} ${value}` : null;
6411
6495
  const isStatement = event.properties.status_metadata.is_statement;
@@ -6442,44 +6526,46 @@ var getEmebedText = (event) => {
6442
6526
  ].filter(Boolean).join("\n");
6443
6527
  };
6444
6528
 
6445
- // src/@parsers/@text/text.getStringText.ts
6446
- var getStringText = (event) => {
6447
- 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`;
6448
6534
  const line = (label, value, condition = true) => condition && value ? `${label} ${value}` : null;
6449
6535
  const isStatement = event.properties.status_metadata.is_statement;
6450
6536
  const isExpired = event.properties.status_metadata.is_expired;
6451
6537
  return [
6452
- line(`Locations:`, (_b = (_a = event == null ? void 0 : event.properties) == null ? void 0 : _a.locations) == null ? void 0 : _b.slice(0, 100)),
6453
- line(`Issued:`, new Date(event.properties.issued).toUTCString(), !isExpired),
6454
- line(`Expires:`, new Date(event.properties.expires).toUTCString(), !isStatement),
6455
- line(`Damage Threat:`, (_d = (_c = event == null ? void 0 : event.properties) == null ? void 0 : _c.parameters) == null ? void 0 : _d.damage_threat, !isExpired),
6456
- line(`Flood Threat:`, (_f = (_e = event == null ? void 0 : event.properties) == null ? void 0 : _e.parameters) == null ? void 0 : _f.flood_threat, !isExpired),
6457
- line(`Tornado Threat:`, (_h = (_g = event == null ? void 0 : event.properties) == null ? void 0 : _g.parameters) == null ? void 0 : _h.tornado_threat, !isExpired),
6458
- 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),
6459
- 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),
6460
- line(`Discussion:`, (_z = (_y = event == null ? void 0 : event.properties) == null ? void 0 : _y.discussion_parameters) == null ? void 0 : _z.discussion_number, !isExpired),
6461
- line(`Concern:`, (_B = (_A = event == null ? void 0 : event.properties) == null ? void 0 : _A.discussion_parameters) == null ? void 0 : _B.discussion_concerning, !isExpired),
6462
- 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),
6463
- 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),
6464
- 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),
6465
- 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),
6466
- line(`Watch Number:`, (_N = (_M = event == null ? void 0 : event.properties) == null ? void 0 : _M.watch_parameters) == null ? void 0 : _N.watch_number, !isExpired),
6467
- 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),
6468
- 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),
6469
- 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),
6470
- 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),
6471
- 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),
6472
- 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),
6473
- 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),
6474
- 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),
6475
- 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),
6476
- 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),
6477
- 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)
6478
6564
  ].filter(Boolean).join("\n");
6479
6565
  };
6480
6566
 
6481
- // src/@modules/@utilities/utilities.createHttp.ts
6482
- var createHttp = (options) => __async(null, null, function* () {
6567
+ // src/@modules/@utilities/CreateHttp.ts
6568
+ var CreateHttp = (options) => __async(null, null, function* () {
6483
6569
  var _a, _b, _c, _d;
6484
6570
  const requestOptions = {
6485
6571
  method: (_a = options.method) != null ? _a : "GET",
@@ -6521,8 +6607,8 @@ var createHttp = (options) => __async(null, null, function* () {
6521
6607
  }
6522
6608
  });
6523
6609
 
6524
- // src/@modules/@utilities/utilities.getMatched.ts
6525
- var getMatched = (strings, string) => {
6610
+ // src/@modules/@utilities/GetMatched.ts
6611
+ var GetMatched = (strings, string) => {
6526
6612
  const isMatched = strings.some((pattern) => {
6527
6613
  if (!pattern) return false;
6528
6614
  const lowerP = pattern.toLowerCase();
@@ -6537,146 +6623,204 @@ var getMatched = (strings, string) => {
6537
6623
  return isMatched;
6538
6624
  };
6539
6625
 
6540
- // src/@manager/manager.updateListener.ts
6541
- import { existsSync as existsSync2, mkdirSync as mkdirSync2, writeFileSync as writeFileSync3, readFileSync as readFileSync2, appendFileSync } from "fs";
6542
- var updateListener = (event) => __async(null, null, function* () {
6543
- 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;
6544
6630
  const tick = performance.now();
6545
6631
  const settings = bootstrap.settings;
6546
- const listeners2 = settings.ListenerSettings;
6547
- const properties2 = event.properties;
6548
- const metadata = {
6549
- file: null,
6550
- eas: null,
6551
- json: null,
6552
- name: properties2.event,
6553
- status: properties2.status,
6554
- description: properties2.description,
6555
- tracking: properties2.metadata.tracking,
6556
- header: properties2.metadata.header,
6557
- raw: properties2.metadata.raw,
6558
- expired: properties2.status_metadata.is_expired,
6559
- attachments: properties2.metadata.attachments
6560
- };
6561
- for (const listener2 of listeners2) {
6562
- const events = listener2 == null ? void 0 : listener2.Events;
6563
- const webhook = listener2 == null ? void 0 : listener2.Webhook;
6564
- const notify = listener2 == null ? void 0 : listener2.NotificationServer;
6565
- const uploads = listener2 == null ? void 0 : listener2.Uploads;
6566
- const isMatched = getMatched(events != null ? events : [], metadata.name);
6567
- if ((events == null ? void 0 : events.length) == 0 || isMatched) {
6568
- if (uploads == null ? void 0 : uploads.EAS) {
6569
- metadata.eas = yield setEasTone({
6570
- title: `${metadata.name}_${metadata.status}_${metadata.tracking}`,
6571
- message: metadata.description,
6572
- header: metadata.header
6573
- });
6574
- }
6575
- if (uploads == null ? void 0 : uploads.File) {
6576
- const fDestination = settings.GlobalSettings.ArchiveSettings.TextDirectory;
6577
- if (fDestination) {
6578
- const file = `${fDestination}/${metadata.name}_${metadata.status}_${metadata.tracking}.txt`.replace(/[\\:*?"<>|]/g, "_").replace(/\s+/g, " ").trim();
6579
- if (!existsSync2(fDestination)) {
6580
- mkdirSync2(fDestination, { recursive: true });
6581
- }
6582
- if (existsSync2(file)) {
6583
- appendFileSync(file, metadata.raw);
6584
- } else {
6585
- writeFileSync3(file, metadata.raw);
6586
- }
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
+ });
6587
6680
  }
6588
- metadata.file = metadata.raw;
6589
- }
6590
- if (uploads == null ? void 0 : uploads.JSON) {
6591
- const eDestination = settings.GlobalSettings.ArchiveSettings.EventDirectory;
6592
- if (eDestination) {
6593
- const file = `${eDestination}/${metadata.name}_${metadata.status}_${metadata.tracking}.json`.replace(/[\\:*?"<>|]/g, "_").replace(/\s+/g, " ").trim();
6594
- if (!existsSync2(eDestination)) {
6595
- mkdirSync2(eDestination, { recursive: true });
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
+ });
6596
6691
  }
6597
- writeFileSync3(file, JSON.stringify(getCleanedEvent(event), null, 2));
6598
- }
6599
- metadata.json = JSON.stringify(getCleanedEvent(event), null, 2);
6600
- }
6601
- 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)) {
6602
- const server = settings == null ? void 0 : settings.NotifyServer;
6603
- 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;
6604
- 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;
6605
- yield createHttp(__spreadProps(__spreadValues({
6606
- 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}`,
6607
- timeout: 15e3,
6608
- method: "POST"
6609
- }, auth && { auth }), {
6610
- headers: __spreadValues({
6611
- "Title": `${metadata.name} (${metadata.status})`,
6612
- "Tags": (_j = (_i = properties2.parameters.tags) == null ? void 0 : _i.join(",")) != null ? _j : "N/A",
6613
- "Expires": new Date(properties2.expires).getTime(),
6614
- "Priority": (notify == null ? void 0 : notify.Priority) ? notify.Priority.toString() : "5"
6615
- }, attachment && { "Attach": attachment }),
6616
- body: getStringText(event)
6617
- }));
6618
- }
6619
- if ((webhook == null ? void 0 : webhook.Enabled) && (webhook == null ? void 0 : webhook.Destination)) {
6620
- const isRatelimited = setTimeoutAction({ identifier: webhook.Destination, interval: ((_k = webhook.Ratelimit) != null ? _k : 2) * 2, max: (_l = webhook.Ratelimit) != null ? _l : 2, addTime: true });
6621
- const form = new FormData();
6622
- const embed = {
6623
- title: `${metadata.name} (${metadata.status})`,
6624
- description: getEmebedText(event),
6625
- fields: [],
6626
- color: 16711680,
6627
- timestamp: (/* @__PURE__ */ new Date()).toISOString(),
6628
- footer: { text: (_m = webhook.Title) != null ? _m : `AtmosphericX` }
6629
- };
6630
- if (isRatelimited.limited) {
6631
- return;
6692
+ metadata.text = metadata.raw;
6632
6693
  }
6633
- if (metadata.description && !metadata.expired) {
6634
- if (metadata.description.length > 900) {
6635
- metadata.description = metadata.description.substring(0, 900) + "\n\n[Message truncated due to length]";
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
+ });
6636
6704
  }
6637
- embed.fields.push({
6638
- name: "Description",
6639
- value: metadata.description ? "```\n" + metadata.description.split("\n").map((l) => l.trim()).filter(Boolean).join("\n") + "\n```" : ""
6640
- });
6705
+ metadata.json = cleanedEventText;
6641
6706
  }
6642
- if (((_n = metadata.attachments) == null ? void 0 : _n.length) > 0) {
6643
- metadata.attachments = metadata.attachments.slice(0, 5);
6644
- embed.fields.push({
6645
- name: "Attachments",
6646
- value: metadata.attachments.map((attachment) => `- [${attachment.name.length > 45 ? attachment.name.substring(0, 45) + "..." : attachment.name}](${attachment.link})`).join("\n")
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}`,
6744
+ timeout: 15e3,
6745
+ method: "PUT"
6746
+ }, auth && { auth }), {
6747
+ headers: __spreadValues({
6748
+ "Title": `${metadata.name} (${metadata.status})`,
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
6753
+ }));
6754
+ SetDebug({
6755
+ title: "Tasks/NTFY",
6756
+ message: `${Math.round(performance.now() - t2)}ms`
6647
6757
  });
6648
6758
  }
6649
- if (uploads == null ? void 0 : uploads.File) {
6650
- form.append("fUpload", new Blob([Buffer.from(metadata.file)], { type: "application/text" }), `${properties2.event}_${properties2.status}_${properties2.metadata.tracking}.txt`);
6651
- }
6652
- if (uploads == null ? void 0 : uploads.JSON) {
6653
- form.append("fUpload2", new Blob([Buffer.from(metadata.json)], { type: "application/json" }), `${properties2.event}_${properties2.status}_${properties2.metadata.tracking}.json`);
6654
- }
6655
- if (uploads == null ? void 0 : uploads.EAS) {
6656
- if (metadata.eas) {
6657
- const file = readFileSync2(metadata.eas);
6658
- form.append("fEas", new Blob([Buffer.from(file)], { type: "audio/mpeg" }), `${properties2.event}_${properties2.status}_${properties2.metadata.tracking}_eas.mp3`);
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
+ }
6659
6799
  }
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
6810
+ });
6811
+ SetDebug({
6812
+ title: "Tasks/Webhook",
6813
+ message: `${Math.round(performance.now() - t2)}ms`
6814
+ });
6660
6815
  }
6661
- form.append("payload_json", JSON.stringify({
6662
- username: (_o = webhook.Title) != null ? _o : "AtmosphericX",
6663
- content: (_p = webhook.Message) != null ? _p : "",
6664
- embeds: [embed]
6665
- }));
6666
- yield createHttp({
6667
- url: webhook.Destination,
6668
- timeout: 15e3,
6669
- method: `POST`,
6670
- body: form
6671
- });
6672
6816
  }
6673
6817
  }
6674
6818
  }
6675
- setDebug({ title: `@manager.updateListener`, message: `Listener took ${performance.now() - tick} ms` });
6819
+ SetDebug({ title: `Tasks`, message: `${Math.round(performance.now() - tick)}ms` });
6676
6820
  });
6677
6821
 
6678
- // src/@modules/@utilities/utilities.getShapeNearestPoint.ts
6679
- var getShapeNearestPoint = (coordinates, point) => {
6822
+ // src/@modules/@utilities/GetShapeNearestPoint.ts
6823
+ var GetShapeNearestPoint = (coordinates, point) => {
6680
6824
  if (!coordinates || !point) {
6681
6825
  return { proximity: false, point: [0, 0], distance: null };
6682
6826
  }
@@ -6766,18 +6910,21 @@ var getShapeNearestPoint = (coordinates, point) => {
6766
6910
  return { proximity: distanceMiles === 0, point: closestPoint, distance: distanceMiles, distanceKm, distanceMeters };
6767
6911
  };
6768
6912
 
6769
- // src/@building/building.polygon.ts
6770
- var getEventNodes = (event) => __async(null, null, function* () {
6913
+ // src/@building/GetEventNodes.ts
6914
+ var GetEventNodes = (event) => __async(null, null, function* () {
6771
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
+ }
6772
6920
  const metadata = { nodes: [], proximity: false, filtered: false };
6773
- const geometry = yield getEventGeometry(event);
6921
+ const geometry = yield GetEventGeometry(event);
6774
6922
  if (!geometry || !geometry.coordinates) {
6775
6923
  return { nodes: [], filtered: false, updated: Date.now() };
6776
6924
  }
6777
- const nodes = bootstrap.cache.nodes.features;
6778
6925
  for (const node of nodes) {
6779
6926
  const [longitude, latitude] = node.geometry.coordinates;
6780
- const getPoint = getShapeNearestPoint(geometry.coordinates, [longitude, latitude]);
6927
+ const getPoint = GetShapeNearestPoint(geometry.coordinates, [longitude, latitude]);
6781
6928
  const miles = (_a = getPoint.distance) != null ? _a : null;
6782
6929
  const kilometers = Number((miles * 1.609344).toFixed(3));
6783
6930
  const info = {
@@ -6786,10 +6933,10 @@ var getEventNodes = (event) => __async(null, null, function* () {
6786
6933
  nearest: getPoint.point,
6787
6934
  miles,
6788
6935
  kilometers,
6789
- proximity: getPoint.proximity
6936
+ proximity: false
6790
6937
  };
6791
6938
  metadata.nodes.push(info);
6792
- 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) {
6793
6940
  metadata.proximity = true;
6794
6941
  info.proximity = true;
6795
6942
  }
@@ -6801,19 +6948,20 @@ var getEventNodes = (event) => __async(null, null, function* () {
6801
6948
  };
6802
6949
  });
6803
6950
 
6804
- // src/@manager/manager.updateNodes.ts
6805
- var updateNode = (selectedEvent) => __async(null, null, function* () {
6951
+ // src/@manager/UpdateNode.ts
6952
+ var UpdateNode = (selectedEvent) => __async(null, null, function* () {
6806
6953
  const events = bootstrap.cache.events.features;
6807
6954
  const ttl = bootstrap.settings.GlobalSettings.NodeTTL * 1e3;
6808
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;
6809
6962
  function update(evt) {
6810
6963
  return __async(this, null, function* () {
6811
- var _a, _b, _c;
6812
- const lastUpdate = (_c = (_b = (_a = evt == null ? void 0 : evt.properties) == null ? void 0 : _a.metadata) == null ? void 0 : _b.updated) != null ? _c : null;
6813
- if (lastUpdate != null && Date.now() - lastUpdate < ttl) {
6814
- return evt;
6815
- }
6816
- const node = yield getEventNodes(evt);
6964
+ const node = yield GetEventNodes(evt);
6817
6965
  if (node.nodes.length > 0) {
6818
6966
  total++;
6819
6967
  }
@@ -6822,16 +6970,13 @@ var updateNode = (selectedEvent) => __async(null, null, function* () {
6822
6970
  evt.properties.metadata.updated = node.updated;
6823
6971
  });
6824
6972
  }
6825
- if (!selectedEvent) {
6826
- yield Promise.all(events.map((evt) => __async(null, null, function* () {
6827
- yield update(evt);
6828
- })));
6829
- }
6830
- if (selectedEvent) {
6831
- 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)));
6832
6977
  }
6833
6978
  if (total > 0) {
6834
- setEventEmit({
6979
+ SetEventEmit({
6835
6980
  event: `onNodeUpdate`,
6836
6981
  metadata: {
6837
6982
  type: `global-update`,
@@ -6841,103 +6986,121 @@ var updateNode = (selectedEvent) => __async(null, null, function* () {
6841
6986
  }
6842
6987
  });
6843
6988
 
6844
- // src/@manager/manager.mkEvent.ts
6845
- var mkEvent = (event) => __async(null, null, function* () {
6989
+ // src/@manager/MakeEvents.ts
6990
+ var MakeEvents = (events) => __async(null, null, function* () {
6846
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 = [];
6847
6993
  const settings = bootstrap.settings;
6848
- const features = bootstrap.cache.events.features;
6849
- const getHash = event.properties.metadata.hash;
6850
- const getTracking = event.properties.metadata.tracking;
6851
- const isEntry = (_a = bootstrap.cache.hashes) == null ? void 0 : _a.find((hash) => hash.tracking === getTracking);
6852
- const isHashed = (_c = (_b = isEntry == null ? void 0 : isEntry.hashes) == null ? void 0 : _b.includes(getHash)) != null ? _c : false;
6853
- const getFeature = features.find((feature) => feature.properties.metadata.tracking === getTracking);
6854
- if (isHashed || event.properties.status_metadata.is_expired) return;
6855
- setHash(event, isEntry);
6856
- const isFilteredLocation = yield updateNode(event).then(() => event.properties.metadata.filtered_proximity);
6857
- if (!isFilteredLocation && !dict_global.includes(event.properties.event.toLowerCase()) && settings.GlobalSettings.EventFiltering.NodeLocationFiltering) {
6858
- return;
6859
- }
6860
- const isRatelimited = setTimeoutAction({ identifier: getTracking, interval: 1, max: 1, addTime: true });
6861
- if (!isRatelimited.limited) {
6862
- setEventEmit({
6863
- event: `onEventStatus`,
6864
- metadata: {
6865
- type: getFeature ? `Updated` : `New`,
6866
- event
6867
- },
6868
- message: `[${getFeature ? "Updated" : "New"}] ${event.properties.event} (${event.properties.status}) (${event.properties.metadata.tracking})`
6869
- });
6870
- }
6871
- if (settings.GlobalSettings.EventManagement) {
6872
- if (event.properties.status_metadata.is_issued || event.properties.status_metadata.is_updated) {
6873
- if (getFeature) {
6874
- const getIndex = features.indexOf(getFeature);
6875
- const cHistory = (_f = (_e = (_d = getFeature == null ? void 0 : getFeature.properties) == null ? void 0 : _d.metadata) == null ? void 0 : _e.history) != null ? _f : [];
6876
- 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 : [];
6877
- const cUgc = (_l = (_k = (_j = getFeature == null ? void 0 : getFeature.properties) == null ? void 0 : _j.geocode) == null ? void 0 : _k.ugc) != null ? _l : [];
6878
- const iHistory = (_o = (_n = (_m = event.properties) == null ? void 0 : _m.metadata) == null ? void 0 : _n.history) != null ? _o : [];
6879
- const iLocations = (_r = (_q = (_p = event.properties) == null ? void 0 : _p.locations) == null ? void 0 : _q.split(";").map((l) => l.trim())) != null ? _r : [];
6880
- const iUgc = (_u = (_t = (_s = event.properties) == null ? void 0 : _s.geocode) == null ? void 0 : _t.ugc) != null ? _u : [];
6881
- 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);
6882
- const mLocations = [...cLocations, ...iLocations].filter((v, i, a) => a.indexOf(v) === i).join("; ");
6883
- const mUgc = [...cUgc, ...iUgc].filter((v, i, a) => a.indexOf(v) === i);
6884
- bootstrap.cache.events.features[getIndex] = __spreadProps(__spreadValues({}, event), {
6885
- properties: __spreadProps(__spreadValues({}, event.properties), {
6886
- metadata: __spreadProps(__spreadValues({}, (_v = event == null ? void 0 : event.properties) == null ? void 0 : _v.metadata), {
6887
- history: mHistory
6888
- }),
6889
- locations: mLocations,
6890
- geocode: __spreadProps(__spreadValues({}, (_w = event == null ? void 0 : event.properties) == null ? void 0 : _w.geocode), {
6891
- 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
+ })
6892
7044
  })
6893
- })
6894
- });
6895
- yield updateListener(bootstrap.cache.events.features[getIndex]);
6896
- } else {
6897
- features.push(event);
6898
- yield updateListener(event);
7045
+ });
7046
+ tasked.push(bootstrap.cache.events.features[getIndex]);
7047
+ } else {
7048
+ features.push(event);
7049
+ tasked.push(event);
7050
+ }
6899
7051
  }
6900
7052
  }
6901
7053
  }
7054
+ yield Tasks(tasked);
7055
+ SetEventEmit({ event: `onEventCache`, metadata: bootstrap.cache.events, limited: true });
6902
7056
  });
6903
7057
 
6904
- // src/@manager/manager.rmEvent.ts
6905
- var rmEvent = (event) => __async(null, null, function* () {
6906
- const gSelect = event;
6907
- const gEvent = bootstrap.cache.events.features.find((f) => {
6908
- var _a, _b, _c, _d;
6909
- return ((_b = (_a = f == null ? void 0 : f.properties) == null ? void 0 : _a.metadata) == null ? void 0 : _b.tracking) === ((_d = (_c = event == null ? void 0 : event.properties) == null ? void 0 : _c.metadata) == null ? void 0 : _d.tracking);
7058
+ // src/@enums/Strings.ts
7059
+ var EnumStrings = {
7060
+ cancellation: `{EVENT} has been allowed to expire. This event is no longer in effect.`
7061
+ };
7062
+
7063
+ // src/@manager/RemoveEvent.ts
7064
+ var RemoveEvent = (event, isTimeBasedExpiration) => __async(null, null, function* () {
7065
+ const gTracking = event.properties.metadata.tracking;
7066
+ const isTrackingEventLogged = bootstrap.cache.events.features.find((f) => {
7067
+ var _a, _b;
7068
+ return ((_b = (_a = f == null ? void 0 : f.properties) == null ? void 0 : _a.metadata) == null ? void 0 : _b.tracking) === gTracking;
6910
7069
  });
6911
- const gStatement = event.properties.status_metadata.is_statement;
6912
- gSelect.properties.expires = (/* @__PURE__ */ new Date()).toISOString();
6913
- gSelect.properties.status = `Expired`;
6914
- gSelect.properties.status_metadata.is_expired = true;
6915
- if (gEvent) {
6916
- if (!gStatement) {
6917
- setEventEmit({
7070
+ const isStatement = event.properties.status_metadata.is_statement;
7071
+ if (isTrackingEventLogged) {
7072
+ event.properties.expires = (/* @__PURE__ */ new Date()).toISOString();
7073
+ event.properties.status = `Expired`;
7074
+ event.properties.status_metadata.is_expired = true;
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;
7078
+ event.properties.metadata.history.push({
7079
+ description: isTimeBasedExpiration ? description : event.properties.description,
7080
+ issued: event.properties.expires,
7081
+ status: event.properties.status
7082
+ });
7083
+ bootstrap.cache.events.features.splice(bootstrap.cache.events.features.indexOf(isTrackingEventLogged), 1);
7084
+ bootstrap.cache.hashes = bootstrap.cache.hashes.filter((hash) => hash.tracking !== gTracking);
7085
+ if (!isStatement) {
7086
+ SetEventEmit({
6918
7087
  event: `onEventStatus`,
6919
- metadata: {
6920
- type: `Removed`,
6921
- event
6922
- },
6923
- message: `[Removed] ${event.properties.event} (${event.properties.status}) (${event.properties.metadata.tracking})`
7088
+ metadata: { type: `Removed`, event },
7089
+ message: `[Removed] ${event.properties.event} (${event.properties.status}) (${gTracking})`
6924
7090
  });
6925
- setEventEmit({ event: `onExpiredProduct`, metadata: event });
7091
+ yield Tasks([event]);
6926
7092
  }
6927
- bootstrap.cache.events.features.splice(bootstrap.cache.events.features.indexOf(gEvent), 1);
6928
- bootstrap.cache.hashes = bootstrap.cache.hashes.filter((hash) => hash.tracking !== event.properties.metadata.tracking);
6929
- setTimeoutAction({ identifier: event.properties.metadata.tracking, expire: true });
6930
- if (!gStatement) yield updateListener(gSelect);
7093
+ SetTimeoutAction({ identifier: gTracking, expire: true });
6931
7094
  }
6932
- setEventEmit({
7095
+ SetEventEmit({
6933
7096
  event: `onEventCache`,
6934
7097
  metadata: bootstrap.cache.events,
6935
7098
  limited: true
6936
7099
  });
6937
7100
  });
6938
7101
 
6939
- // src/@dictionaries/dictionaries.states.ts
6940
- var dict_states = {
7102
+ // src/@enums/States.ts
7103
+ var EnumStates = {
6941
7104
  "AL": "Alabama",
6942
7105
  "AK": "Alaska",
6943
7106
  "AZ": "Arizona",
@@ -6991,8 +7154,8 @@ var dict_states = {
6991
7154
  "DC": "District of Columbia"
6992
7155
  };
6993
7156
 
6994
- // src/@modules/@utilities/utilities.getLatestIssuance.ts
6995
- var getLatestIssuance = () => {
7157
+ // src/@modules/@utilities/GetLatestIssuance.ts
7158
+ var GetLatestIssuance = () => {
6996
7159
  const now = /* @__PURE__ */ new Date();
6997
7160
  const current = now.getUTCHours() * 100 + now.getUTCMinutes();
6998
7161
  const issuances = [100, 600, 1300, 1630, 2e3];
@@ -7005,11 +7168,12 @@ var getLatestIssuance = () => {
7005
7168
  return latest.toString().padStart(4, "0");
7006
7169
  };
7007
7170
 
7008
- // src/@building/building.attachments.ts
7009
- var getEventAttachments = (event) => {
7171
+ // src/@building/GetEventAttachments.ts
7172
+ var GetEventAttachments = (event) => {
7010
7173
  var _a, _b, _c, _d, _e, _f, _g;
7011
7174
  let attachments = [];
7012
- const issuanceTime = getLatestIssuance();
7175
+ const settings = bootstrap.settings;
7176
+ const issuanceTime = GetLatestIssuance();
7013
7177
  const spcNumber = (_b = (_a = event == null ? void 0 : event.properties) == null ? void 0 : _a.discussion_parameters) == null ? void 0 : _b.discussion_number;
7014
7178
  const watchNumber = (_d = (_c = event == null ? void 0 : event.properties) == null ? void 0 : _c.watch_parameters) == null ? void 0 : _d.watch_number;
7015
7179
  const locations = (_e = event == null ? void 0 : event.properties) == null ? void 0 : _e.locations_array;
@@ -7026,34 +7190,36 @@ var getEventAttachments = (event) => {
7026
7190
  if (events.find((e) => e.target === event.properties.event)) {
7027
7191
  attachments.push({ name: `Image: Graphic`, link: events.find((e) => e.target.toLowerCase() === event.properties.event.toLowerCase()).attachment });
7028
7192
  }
7029
- for (const location of locations) {
7030
- if (dict_expressions.location.test(location)) {
7031
- const lines = [`Northern`, `Southern`, `Eastern`, `Western`, `Inland`, `Costal`, `County`];
7032
- const county = (_f = location == null ? void 0 : location.split(",")[0]) == null ? void 0 : _f.trim().replace(new RegExp(`^(${lines.join("|")}) `), "");
7033
- const state = dict_states[(_g = location == null ? void 0 : location.split(",")[1]) == null ? void 0 : _g.trim()];
7034
- const feeds = bootstrap.database.prepare(`SELECT * FROM broadcastify WHERE state = ? AND county = ?`).all(state, county).sort((a, b) => {
7035
- const typeOrder = ["Other", "Public Safety"];
7036
- const indexA = typeOrder.indexOf(a.type);
7037
- const indexB = typeOrder.indexOf(b.type);
7038
- return indexA - indexB;
7039
- });
7040
- const tags = bootstrap.settings.BroadcastifySettings.BroadcastifyTags;
7041
- const filtered = feeds.filter((feed) => tags.includes(feed.type));
7042
- if (filtered.length > 0) {
7043
- filtered.map((filtered2) => {
7044
- if (!attachments.some((a) => a.link === filtered2.link)) {
7045
- attachments.push({ name: `${filtered2.type}: ${filtered2.feed}`, link: filtered2.link });
7046
- }
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;
7047
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
+ }
7048
7214
  }
7049
7215
  }
7050
7216
  }
7051
7217
  return attachments;
7052
7218
  };
7053
7219
 
7054
- // src/@building/building.validate.ts
7220
+ // src/@manager/ValidateEvents.ts
7055
7221
  import { createHash } from "crypto";
7056
- var validateEvents = (events) => __async(null, null, function* () {
7222
+ var ValidateEvents = (events) => __async(null, null, function* () {
7057
7223
  const tick = performance.now();
7058
7224
  if (events.length === 0) return;
7059
7225
  const configurations = bootstrap.settings;
@@ -7071,21 +7237,21 @@ var validateEvents = (events) => __async(null, null, function* () {
7071
7237
  }
7072
7238
  const isFiltered = (define2) => {
7073
7239
  var _a, _b, _c, _d;
7074
- const properties2 = define2.properties;
7075
- const zones = properties2.geocode.ugc;
7076
- const icao = properties2.geocode.office.office;
7077
- if (properties2.status_metadata.is_test) {
7078
- 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 });
7079
7245
  if (bools == null ? void 0 : bools.IgnoreTestProducts) return true;
7080
7246
  }
7081
- if (properties2.status_metadata.is_expired) {
7082
- setEventEmit({ event: `onExpiredProduct`, metadata: define2 });
7083
- rmEvent(define2);
7247
+ if (properties.status_metadata.is_expired) {
7248
+ SetEventEmit({ event: `onExpiredProduct`, metadata: define2 });
7249
+ RemoveEvent(define2, false);
7084
7250
  return true;
7085
7251
  }
7086
- if (((_b = (_a = properties2.metadata) == null ? void 0 : _a.vtec) == null ? void 0 : _b.is_watch) && properties2.metadata.source != `events.api`) {
7087
- const isSPC = (_d = (_c = properties2.metadata) == null ? void 0 : _c.vtec) == null ? void 0 : _d.prediction_center;
7088
- 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 });
7089
7255
  if ((bools == null ? void 0 : bools.SPCWatchesOnly) && !isSPC) {
7090
7256
  return true;
7091
7257
  }
@@ -7096,43 +7262,43 @@ var validateEvents = (events) => __async(null, null, function* () {
7096
7262
  for (const key in sets) {
7097
7263
  const setting = sets[key];
7098
7264
  const values = [...setting];
7099
- if (key === "ListeningEvents" && setting.size > 0 && !getMatched(values, define2.properties.event)) {
7100
- setEventEmit({
7265
+ if (key === "ListeningEvents" && setting.size > 0 && !GetMatched(values, define2.properties.event)) {
7266
+ SetEventEmit({
7101
7267
  event: `onFilteredEvent`,
7102
7268
  metadata: define2
7103
7269
  });
7104
7270
  return true;
7105
7271
  }
7106
- if (key === "IgnoredEvents" && setting.size > 0 && getMatched(values, define2.properties.event)) {
7107
- setEventEmit({
7272
+ if (key === "IgnoredEvents" && setting.size > 0 && GetMatched(values, define2.properties.event)) {
7273
+ SetEventEmit({
7108
7274
  event: `onIgnoredEvent`,
7109
7275
  metadata: define2
7110
7276
  });
7111
7277
  return true;
7112
7278
  }
7113
7279
  if (key === "ListeningICAO" && setting.size > 0 && icao != null && !setting.has(icao.toLowerCase())) {
7114
- setEventEmit({
7280
+ SetEventEmit({
7115
7281
  event: `onFilteredICAO`,
7116
7282
  metadata: define2
7117
7283
  });
7118
7284
  return true;
7119
7285
  }
7120
7286
  if (key === "IgnoredICAO" && setting.size > 0 && icao != null && setting.has(icao.toLowerCase())) {
7121
- setEventEmit({
7287
+ SetEventEmit({
7122
7288
  event: `onIgnoredICAO`,
7123
7289
  metadata: define2
7124
7290
  });
7125
7291
  return true;
7126
7292
  }
7127
- if (key === "ListeningUGC" && setting.size > 0 && zones.length > 0 && !zones.some((ugc2) => setting.has(ugc2.toLowerCase()))) {
7128
- setEventEmit({
7293
+ if (key === "ListeningUGC" && setting.size > 0 && zones.length > 0 && !zones.some((ugc) => setting.has(ugc.toLowerCase()))) {
7294
+ SetEventEmit({
7129
7295
  event: `onFilteredUGC`,
7130
7296
  metadata: define2
7131
7297
  });
7132
7298
  return true;
7133
7299
  }
7134
- if (key === "ListeningStates" && setting.size > 0 && zones.length > 0 && !zones.some((ugc2) => setting.has(ugc2.substring(0, 2).toLowerCase()))) {
7135
- setEventEmit({
7300
+ if (key === "ListeningStates" && setting.size > 0 && zones.length > 0 && !zones.some((ugc) => setting.has(ugc.substring(0, 2).toLowerCase()))) {
7301
+ SetEventEmit({
7136
7302
  event: `onFilteredState`,
7137
7303
  metadata: define2
7138
7304
  });
@@ -7142,37 +7308,29 @@ var validateEvents = (events) => __async(null, null, function* () {
7142
7308
  return false;
7143
7309
  };
7144
7310
  const filtering = events.filter((event) => {
7145
- var _a;
7146
7311
  bootstrap.cache.processed = bootstrap.cache.processed.filter((e) => e !== event);
7147
- const define2 = getEventSignature(event);
7148
- const properties2 = define2.properties;
7149
- (_a = properties2 == null ? void 0 : properties2.metadata) == null ? true : delete _a.ms;
7150
- const enhanced = properties2.event = getEventEnhancedName(event);
7312
+ const define2 = GetEventSignature(event);
7313
+ const pre = __spreadProps(__spreadValues({}, define2), { properties: __spreadProps(__spreadValues({}, define2.properties), { metadata: __spreadValues({}, define2.properties.metadata) }) });
7314
+ const properties = define2.properties;
7315
+ delete pre.properties.metadata.ms;
7316
+ delete pre.properties.metadata.header;
7317
+ const enhanced = properties.event = GetEventEnhancedName(event);
7151
7318
  const filtered = isFiltered(define2);
7152
7319
  if (!filtered) {
7153
- event.geometry = !(bools == null ? void 0 : bools.DisableGeometryParsing) ? getEventGeometry(event) : null;
7154
- properties2.metadata.attachments = getEventAttachments(event);
7320
+ event.geometry = !(bools == null ? void 0 : bools.DisableGeometryParsing) ? GetEventGeometry(event) : null;
7321
+ properties.metadata.attachments = GetEventAttachments(event);
7155
7322
  }
7156
- properties2.metadata.hash = createHash("sha256").update(JSON.stringify(properties2)).digest("hex");
7157
- 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 });
7158
7325
  return !filtered;
7159
7326
  });
7160
- if (filtering.length > 0) {
7161
- for (const event of filtering) {
7162
- yield mkEvent(event);
7163
- }
7164
- }
7165
- yield updateNode();
7166
- setEventEmit({
7167
- event: `onEventCache`,
7168
- metadata: bootstrap.cache.events,
7169
- limited: true
7170
- });
7171
- 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` });
7172
7330
  });
7173
7331
 
7174
- // src/@building/building.create.ts
7175
- var createEvent = (stanza, ignorePushing) => __async(null, null, function* () {
7332
+ // src/@building/CreateEvent.ts
7333
+ var CreateEvent = (stanza, ignorePushing) => __async(null, null, function* () {
7176
7334
  const settings = bootstrap.settings;
7177
7335
  const StanzaSettings = settings.NOAAWeatherWireServiceSettings.StanzaSettings;
7178
7336
  const isVtecEvent = stanza.isVTEC && stanza.isUGC;
@@ -7181,26 +7339,26 @@ var createEvent = (stanza, ignorePushing) => __async(null, null, function* () {
7181
7339
  const isNWWS = stanza.isNWWS;
7182
7340
  switch (true) {
7183
7341
  case !isNWWS:
7184
- yield api(stanza);
7342
+ yield ParseAPI(stanza);
7185
7343
  break;
7186
7344
  case (isNWWS && !StanzaSettings.DisableVTEC && isVtecEvent):
7187
- yield vtec(stanza);
7345
+ yield ParseVTEC(stanza);
7188
7346
  break;
7189
7347
  case (isNWWS && !StanzaSettings.DisableUGC && isUgcEvent):
7190
- yield ugc(stanza);
7348
+ yield ParseUGC(stanza);
7191
7349
  break;
7192
7350
  case (isNWWS && !StanzaSettings.DisableText && isTextEvent):
7193
- yield text(stanza);
7351
+ yield ParseText(stanza);
7194
7352
  break;
7195
7353
  }
7196
7354
  if (!ignorePushing) {
7197
- validateEvents(bootstrap.cache.processed);
7355
+ yield ValidateEvents(bootstrap.cache.processed);
7198
7356
  }
7199
7357
  return "nothing picked";
7200
7358
  });
7201
7359
 
7202
- // src/@modules/@database/database.stanza.ts
7203
- var importStanza = (stanza) => __async(null, null, function* () {
7360
+ // src/@modules/@database/ImportStanza.ts
7361
+ var ImportStanza = (stanza) => __async(null, null, function* () {
7204
7362
  const settings = bootstrap.settings;
7205
7363
  try {
7206
7364
  if (!settings.NOAAWeatherWireServiceSettings.CacheSettings.Enabled) {
@@ -7216,17 +7374,17 @@ var importStanza = (stanza) => __async(null, null, function* () {
7216
7374
  }
7217
7375
  }
7218
7376
  } catch (error) {
7219
- setWarning({ message: `An error occurred while importing stanza: ${error.message}` });
7377
+ SetWarning({ message: `An error occurred while importing stanza: ${error.message}` });
7220
7378
  }
7221
7379
  });
7222
7380
 
7223
- // src/@modules/@xmpp/xmpp.xStanza.ts
7224
- var xStanza = () => {
7381
+ // src/@modules/@xmpp/StanzaXMPP.ts
7382
+ var StanzaXMPP = () => {
7225
7383
  bootstrap.session_xmpp.on(`stanza`, (stanza) => __async(null, null, function* () {
7226
7384
  var _a, _b, _c, _d;
7227
7385
  const msgFrom = (_b = (_a = stanza == null ? void 0 : stanza.attrs) == null ? void 0 : _a.from) != null ? _b : ``;
7228
7386
  const msgType = (_d = (_c = stanza == null ? void 0 : stanza.attrs) == null ? void 0 : _c.type) != null ? _d : ``;
7229
- setEventEmit({
7387
+ SetEventEmit({
7230
7388
  event: `onServiceStatus`,
7231
7389
  metadata: {
7232
7390
  message: stanza,
@@ -7236,18 +7394,18 @@ var xStanza = () => {
7236
7394
  });
7237
7395
  bootstrap.cache.lastStanza = Date.now();
7238
7396
  if (stanza.is(`message`)) {
7239
- const result = validate({ stanza });
7397
+ const result = ValidateStanza({ stanza });
7240
7398
  const isSkippable = result.isIgnored || result.isCapEvent || result.isCapEvent && !result.isCapAreaDescription;
7241
7399
  if (isSkippable) {
7242
7400
  return;
7243
7401
  }
7244
- yield createEvent(result);
7245
- yield importStanza(result);
7402
+ yield CreateEvent(result);
7403
+ yield ImportStanza(result);
7246
7404
  }
7247
7405
  if (stanza.is(`presence`) && msgFrom.startsWith("nwws@conference.nwws-oi.weather.gov/")) {
7248
7406
  const getOccupant = msgFrom.split(`/`).slice(1).join(`/`);
7249
7407
  const getAvailability = msgType === `unavailable`;
7250
- setEventEmit({
7408
+ SetEventEmit({
7251
7409
  event: `onServiceStatus`,
7252
7410
  metadata: {
7253
7411
  message: `Occupant ${getOccupant} has ${getAvailability ? `left` : `joined`} the room`,
@@ -7260,8 +7418,8 @@ var xStanza = () => {
7260
7418
  }));
7261
7419
  };
7262
7420
 
7263
- // src/@modules/@xmpp/xmpp.xDeploy.ts
7264
- var xDeploy = () => __async(null, null, function* () {
7421
+ // src/@modules/@xmpp/DeployXMPP.ts
7422
+ var DeployXMPP = () => __async(null, null, function* () {
7265
7423
  var _a, _b;
7266
7424
  let session;
7267
7425
  const settings = bootstrap.settings;
@@ -7273,13 +7431,13 @@ var xDeploy = () => __async(null, null, function* () {
7273
7431
  password: settings.NOAAWeatherWireServiceSettings.CredentialSettings.Password
7274
7432
  });
7275
7433
  try {
7276
- yield xOffline();
7277
- yield xError();
7278
- yield xStanza();
7279
- yield xOnline();
7434
+ yield OfflineXMPP();
7435
+ yield ErrorXMPP();
7436
+ yield StanzaXMPP();
7437
+ yield OnlineXMPP();
7280
7438
  yield session.start();
7281
7439
  } catch (error) {
7282
- setEventEmit({
7440
+ SetEventEmit({
7283
7441
  event: `onServiceStatus`,
7284
7442
  metadata: {
7285
7443
  message: `Error occured while starting XMPP Session: ${error}`,
@@ -7291,8 +7449,8 @@ var xDeploy = () => __async(null, null, function* () {
7291
7449
  }
7292
7450
  });
7293
7451
 
7294
- // src/@dictionaries/dictionaries.shapefiles.ts
7295
- var dict_shapefiles = [
7452
+ // src/@enums/Shapefiles.ts
7453
+ var EnumShapefiles = [
7296
7454
  { name: "us_counties", id: "C", link: "https://www.weather.gov/source/gis/Shapefiles/County/c_16ap26.zip" },
7297
7455
  { name: "us_states_territories", id: "Z", link: "https://www.weather.gov/source/gis/Shapefiles/County/s_16ap26.zip" },
7298
7456
  { name: "fire_weather_zones", id: "Z", link: "https://www.weather.gov/source/gis/Shapefiles/WSOM/fz16ap26.zip" },
@@ -7304,8 +7462,8 @@ var dict_shapefiles = [
7304
7462
  { name: "high_seas_marine_zones", id: "Z", link: "https://www.weather.gov/source/gis/Shapefiles/WSOM/hz17fe26.zip" }
7305
7463
  ];
7306
7464
 
7307
- // src/@modules/@utilities/utilities.setSleep.ts
7308
- var setSleep = (options) => __async(null, null, function* () {
7465
+ // src/@modules/@utilities/SetSleep.ts
7466
+ var SetSleep = (options) => __async(null, null, function* () {
7309
7467
  return new Promise((resolve6) => {
7310
7468
  setTimeout(() => {
7311
7469
  resolve6();
@@ -7313,31 +7471,31 @@ var setSleep = (options) => __async(null, null, function* () {
7313
7471
  });
7314
7472
  });
7315
7473
 
7316
- // src/@modules/@database/database.shapefiles.ts
7317
- 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";
7318
7476
  import { resolve as resolve5, extname } from "path";
7319
7477
  import { loadAsync } from "jszip";
7320
7478
  import { read } from "shapefile";
7321
- var importShapefiles = () => __async(null, null, function* () {
7479
+ var ImportShapefiles = () => __async(null, null, function* () {
7322
7480
  var _a, _b;
7323
7481
  const settings = bootstrap.settings;
7324
7482
  try {
7325
7483
  const tShapefiles = bootstrap.database.prepare(`SELECT COUNT(*) AS count FROM shapefiles`).get().count;
7326
7484
  if (tShapefiles === 0) {
7327
- yield setSleep({ timeout: 1e3 });
7328
- for (const shapefile of dict_shapefiles) {
7485
+ yield SetSleep({ timeout: 1e3 });
7486
+ for (const shapefile of EnumShapefiles) {
7329
7487
  const response2 = yield fetch(shapefile.link);
7330
7488
  const arrayBuff = yield response2.arrayBuffer();
7331
7489
  const content = yield loadAsync(arrayBuff);
7332
7490
  const directory = resolve5(__dirname, `../../shapefiles`);
7333
- if (!existsSync3(directory)) {
7334
- mkdirSync3(directory, { recursive: true });
7491
+ if (!existsSync2(directory)) {
7492
+ mkdirSync2(directory, { recursive: true });
7335
7493
  }
7336
7494
  for (const file of Object.keys(content.files)) {
7337
7495
  if (file.endsWith(".shp") || file.endsWith(".dbf")) {
7338
7496
  const data = yield content.files[file].async(`nodebuffer`);
7339
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)}`);
7340
- writeFileSync4(output, data);
7498
+ writeFileSync3(output, data);
7341
7499
  }
7342
7500
  }
7343
7501
  const filepath = resolve5(__dirname, "../../shapefiles", shapefile.name + "_" + shapefile.id);
@@ -7345,25 +7503,25 @@ var importShapefiles = () => __async(null, null, function* () {
7345
7503
  filepath,
7346
7504
  filepath
7347
7505
  );
7348
- 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` });
7349
7507
  const insert = bootstrap.database.prepare(`INSERT OR REPLACE INTO shapefiles (id, location, geometry) VALUES (?, ?, ?)`);
7350
7508
  const transaction = bootstrap.database.transaction((entries) => {
7351
7509
  var _a2, _b2, _c;
7352
7510
  for (const entry of entries) {
7353
- const { properties: properties2, geometry } = entry;
7511
+ const { properties, geometry } = entry;
7354
7512
  let final2, location;
7355
- if (properties2.FIPS) {
7356
- final2 = `${properties2.STATE}${shapefile.id}${properties2.FIPS.substring(2)}`;
7357
- location = `${properties2.COUNTYNAME}, ${properties2.STATE}`;
7358
- } else if (properties2.FULLSTAID) {
7359
- final2 = `${properties2.ST}${shapefile.id}${properties2.WFO}`;
7360
- location = `${properties2.CITY}, ${properties2.STATE}`;
7361
- } else if (properties2.STATE) {
7362
- final2 = `${properties2.STATE}${shapefile.id}${(_a2 = properties2.ZONE) != null ? _a2 : properties2.SITE_ID}`;
7363
- 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}`;
7364
7522
  } else {
7365
- final2 = (_c = properties2.ID) != null ? _c : properties2.WFO;
7366
- location = properties2.NAME;
7523
+ final2 = (_c = properties.ID) != null ? _c : properties.WFO;
7524
+ location = properties.NAME;
7367
7525
  }
7368
7526
  insert.run(final2, location, JSON.stringify(geometry));
7369
7527
  }
@@ -7376,12 +7534,12 @@ var importShapefiles = () => __async(null, null, function* () {
7376
7534
  });
7377
7535
  }
7378
7536
  } catch (error) {
7379
- setWarning({ message: `An error occurred while compiling shapefiles: ${error.message}` });
7537
+ SetWarning({ message: `An error occurred while compiling shapefiles: ${error.message}` });
7380
7538
  }
7381
7539
  });
7382
7540
 
7383
- // src/@modules/@database/database.broadcastify.ts
7384
- var importBroadcastify = () => __async(null, null, function* () {
7541
+ // src/@modules/@database/ImportBroadcastify.ts
7542
+ var ImportBroadcastify = () => __async(null, null, function* () {
7385
7543
  const settings = bootstrap.settings;
7386
7544
  const isBroadcastifyImported = bootstrap.database.prepare(`SELECT name FROM sqlite_master WHERE type='table' AND name='broadcastify';`).get();
7387
7545
  if (!settings.BroadcastifySettings.BroadcastifyAttachments) {
@@ -7390,7 +7548,7 @@ var importBroadcastify = () => __async(null, null, function* () {
7390
7548
  if (isBroadcastifyImported) {
7391
7549
  return;
7392
7550
  }
7393
- const broadcastify = yield createHttp({
7551
+ const broadcastify = yield CreateHttp({
7394
7552
  url: settings.BroadcastifySettings.BroadcastifyDatabase,
7395
7553
  timeout: 5e3
7396
7554
  });
@@ -7405,7 +7563,7 @@ var importBroadcastify = () => __async(null, null, function* () {
7405
7563
  });
7406
7564
  const batch = [];
7407
7565
  for (const state of states) {
7408
- 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` });
7409
7567
  for (const county of state.counties) {
7410
7568
  const countyName = county.county;
7411
7569
  for (const feed of county.feeds) {
@@ -7421,17 +7579,20 @@ var importBroadcastify = () => __async(null, null, function* () {
7421
7579
  }
7422
7580
  transaction(batch);
7423
7581
  }
7582
+ if (broadcastify.error) {
7583
+ SetWarning({ message: `Error importing Broadcastify data: ${broadcastify.message}` });
7584
+ }
7424
7585
  });
7425
7586
 
7426
- // src/@modules/@database/database.init.ts
7427
- 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";
7428
7589
  import sqlite3 from "better-sqlite3";
7429
- var initializeDatabase = () => __async(null, null, function* () {
7590
+ var InitializeDatabase = () => __async(null, null, function* () {
7430
7591
  const settings = bootstrap.settings;
7431
7592
  try {
7432
- if (!existsSync4(settings.Database)) {
7433
- writeFileSync5(settings.Database, "");
7434
- 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}` });
7435
7596
  }
7436
7597
  bootstrap.database = new sqlite3(settings.Database);
7437
7598
  bootstrap.database.prepare(`CREATE TABLE IF NOT EXISTS stanzas ( id INTEGER PRIMARY KEY AUTOINCREMENT, type TEXT, issued TEXT, stanza TEXT )`).run();
@@ -7439,18 +7600,18 @@ var initializeDatabase = () => __async(null, null, function* () {
7439
7600
  const isNeedingShapefiles = bootstrap.database.prepare(`SELECT name FROM sqlite_master WHERE type='table' AND name='shapefiles';`).get();
7440
7601
  const isNeedingBroadcastify = bootstrap.database.prepare(`SELECT name FROM sqlite_master WHERE type='table' AND name='broadcastify';`).get();
7441
7602
  if (!isNeedingShapefiles || !isNeedingBroadcastify) {
7442
- 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.` });
7443
- yield importBroadcastify();
7444
- yield importShapefiles();
7445
- 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` });
7446
7607
  }
7447
7608
  } catch (error) {
7448
- setWarning({ message: `An error occurred while initializing the database: ${error.message}` });
7609
+ SetWarning({ message: `An error occurred while initializing the database: ${error.message}` });
7449
7610
  }
7450
7611
  });
7451
7612
 
7452
- // src/@modules/@database/database.cache.ts
7453
- var getCachedEvents = () => __async(null, null, function* () {
7613
+ // src/@modules/@database/GetCachedEvents.ts
7614
+ var GetCachedEvents = () => __async(null, null, function* () {
7454
7615
  var _a;
7455
7616
  try {
7456
7617
  const settings = bootstrap.settings;
@@ -7458,7 +7619,7 @@ var getCachedEvents = () => __async(null, null, function* () {
7458
7619
  if (settings.NOAAWeatherWireServiceSettings.CacheSettings.Enabled) {
7459
7620
  const max = (_a = settings.NOAAWeatherWireServiceSettings.CacheSettings.MaxRetentionHistory) != null ? _a : 500;
7460
7621
  const get = yield bootstrap.database.prepare(`SELECT * FROM stanzas ORDER BY rowid DESC LIMIT ?`).all(max);
7461
- 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` });
7462
7623
  let events = get.map((row) => JSON.parse(row.stanza)).filter((stanza) => {
7463
7624
  if (!stanza) {
7464
7625
  return;
@@ -7467,21 +7628,21 @@ var getCachedEvents = () => __async(null, null, function* () {
7467
7628
  return !isSkippable;
7468
7629
  });
7469
7630
  events = events.sort((a, b) => b.issued - a.issued);
7470
- yield Promise.all(events.map((event) => createEvent(event, true)));
7471
- setWarning({ message: `Processed ${events.length} cached stanzas in ${Math.floor(performance.now() - tick)} ms` });
7472
- 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);
7473
7634
  }
7474
7635
  } catch (error) {
7475
- 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}` });
7476
7637
  }
7477
7638
  });
7478
7639
 
7479
- // src/@modules/@xmpp/xmpp.xReconnect.ts
7480
- var xReconnect = (interval) => __async(null, null, function* () {
7640
+ // src/@modules/@xmpp/ReconnectXMPP.ts
7641
+ var ReconnectXMPP = (interval) => __async(null, null, function* () {
7481
7642
  const settings = bootstrap.settings;
7482
7643
  const lastStanza = Date.now() - bootstrap.cache.lastStanza;
7483
7644
  if (interval < 15) {
7484
- 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` });
7485
7646
  interval = 15;
7486
7647
  bootstrap.settings.NOAAWeatherWireServiceSettings.ReconnectionSettings.ReconnectionInterval = 15;
7487
7648
  }
@@ -7495,7 +7656,7 @@ var xReconnect = (interval) => __async(null, null, function* () {
7495
7656
  bootstrap.cache.isConnected = false;
7496
7657
  bootstrap.cache.tReconnects += 1;
7497
7658
  try {
7498
- setEventEmit({
7659
+ SetEventEmit({
7499
7660
  event: `onServiceStatus`,
7500
7661
  metadata: {
7501
7662
  message: `Attempting to reconnect to XMPP Service (Reconnect Attempt ${bootstrap.cache.tReconnects})`,
@@ -7513,7 +7674,7 @@ var xReconnect = (interval) => __async(null, null, function* () {
7513
7674
  yield bootstrap.session_xmpp.start().catch(() => {
7514
7675
  });
7515
7676
  } catch (error) {
7516
- setWarning({ message: `XMPP Reconnect Failed - ${error.message}` });
7677
+ SetWarning({ message: `XMPP Reconnect Failed - ${error.message}` });
7517
7678
  } finally {
7518
7679
  bootstrap.cache.isReconnecting = false;
7519
7680
  }
@@ -7521,15 +7682,15 @@ var xReconnect = (interval) => __async(null, null, function* () {
7521
7682
  }
7522
7683
  });
7523
7684
 
7524
- // src/@modules/@utilities/utilities.setCronSchedule.ts
7525
- 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";
7526
7687
  import { join as join2 } from "path";
7527
- var setCronSchedule = () => __async(null, null, function* () {
7688
+ var SetCronSchedule = () => __async(null, null, function* () {
7528
7689
  const settings = bootstrap.settings;
7529
7690
  const TTL = settings.GlobalSettings.ArchiveSettings.TTL;
7530
7691
  const TTLCUT = Date.now() - TTL * 1e3;
7531
7692
  const walk = (dir) => {
7532
- if (existsSync5(dir)) {
7693
+ if (existsSync4(dir)) {
7533
7694
  const entries = readdirSync(dir, { withFileTypes: true });
7534
7695
  for (const entry of entries) {
7535
7696
  const fullPath = join2(dir, entry.name);
@@ -7550,20 +7711,20 @@ var setCronSchedule = () => __async(null, null, function* () {
7550
7711
  };
7551
7712
  walk(settings.GlobalSettings.ArchiveSettings.TextDirectory);
7552
7713
  walk(settings.GlobalSettings.ArchiveSettings.EasDirectory);
7553
- walk(settings.GlobalSettings.ArchiveSettings.EventDirectory);
7714
+ walk(settings.GlobalSettings.ArchiveSettings.JSONDirectory);
7554
7715
  if (settings.EnableWireService) {
7555
7716
  if (settings.NOAAWeatherWireServiceSettings.ReconnectionSettings.Enabled) {
7556
- void xReconnect(settings.NOAAWeatherWireServiceSettings.ReconnectionSettings.ReconnectionInterval);
7717
+ void ReconnectXMPP(settings.NOAAWeatherWireServiceSettings.ReconnectionSettings.ReconnectionInterval);
7557
7718
  }
7558
7719
  } else {
7559
- const response2 = yield createHttp({
7720
+ const response2 = yield CreateHttp({
7560
7721
  url: settings.NationalWeatherServiceSettings.EventsEndpoint,
7561
7722
  headers: {
7562
7723
  "User-Agent": "@atmosx/event-product-parser"
7563
7724
  }
7564
7725
  });
7565
7726
  if (response2.error) {
7566
- return setEventEmit({
7727
+ return SetEventEmit({
7567
7728
  event: `onServiceStatus`,
7568
7729
  metadata: {
7569
7730
  type: "fetch-api",
@@ -7573,7 +7734,7 @@ var setCronSchedule = () => __async(null, null, function* () {
7573
7734
  }
7574
7735
  });
7575
7736
  }
7576
- setEventEmit({
7737
+ SetEventEmit({
7577
7738
  event: `onServiceStatus`,
7578
7739
  metadata: {
7579
7740
  message: `Fetched latest events from National Weather Service API`,
@@ -7582,23 +7743,24 @@ var setCronSchedule = () => __async(null, null, function* () {
7582
7743
  error: false
7583
7744
  }
7584
7745
  });
7585
- createEvent({ message: response2.message, isNWWS: false });
7746
+ yield CreateEvent({ message: response2.message, isNWWS: false });
7586
7747
  }
7587
7748
  });
7588
7749
 
7589
- // src/@manager/manager.updateEvents.ts
7590
- var updateEvents = (selectedEvent) => __async(null, null, function* () {
7750
+ // src/@manager/UpdateEvents.ts
7751
+ var UpdateEvents = (selectedEvent) => __async(null, null, function* () {
7591
7752
  const events = bootstrap.cache.events.features;
7592
- function update(evt) {
7753
+ function update(event) {
7593
7754
  return __async(this, null, function* () {
7594
- if (new Date(evt.properties.expires) < /* @__PURE__ */ new Date()) {
7595
- yield rmEvent(evt);
7755
+ if (new Date(event.properties.expires) < /* @__PURE__ */ new Date()) {
7756
+ SetEventEmit({ event: `onExpiredProduct`, metadata: event });
7757
+ yield RemoveEvent(event, true);
7596
7758
  }
7597
7759
  });
7598
7760
  }
7599
7761
  if (!selectedEvent) {
7600
- yield Promise.all(events.map((evt) => __async(null, null, function* () {
7601
- yield update(evt);
7762
+ yield Promise.all(events.map((event) => __async(null, null, function* () {
7763
+ yield update(event);
7602
7764
  })));
7603
7765
  }
7604
7766
  if (selectedEvent) {
@@ -7606,41 +7768,41 @@ var updateEvents = (selectedEvent) => __async(null, null, function* () {
7606
7768
  }
7607
7769
  });
7608
7770
 
7609
- // src/@core/core.start.ts
7771
+ // src/@core/StartService.ts
7610
7772
  import { Cron } from "croner";
7611
- var startService = (configurations) => __async(null, null, function* () {
7773
+ var StartService = (configurations) => __async(null, null, function* () {
7612
7774
  if (!bootstrap.isReady) {
7613
- return setWarning({
7775
+ return SetWarning({
7614
7776
  message: `You can not create another instance without shutting down the current one first, please make sure to call the stop() method first!`
7615
7777
  });
7616
7778
  }
7617
- const settings = setSettings(configurations);
7779
+ const settings = SetSettings(configurations);
7618
7780
  bootstrap.isReady = true;
7619
- yield initializeDatabase();
7781
+ yield InitializeDatabase();
7620
7782
  if (settings.EnableWireService) {
7621
7783
  (() => __async(null, null, function* () {
7622
- yield getCachedEvents();
7623
- yield xDeploy();
7784
+ yield GetCachedEvents();
7785
+ yield DeployXMPP();
7624
7786
  }))();
7625
7787
  }
7626
- yield setCronSchedule();
7788
+ yield SetCronSchedule();
7627
7789
  let scheduleInterval = !settings.EnableWireService ? settings.NationalWeatherServiceSettings.CallbackInterval : 1;
7628
7790
  if (!settings.EnableWireService && scheduleInterval < 15) {
7629
- 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` });
7630
7792
  bootstrap.settings.NationalWeatherServiceSettings.CallbackInterval = 15;
7631
7793
  scheduleInterval = 15;
7632
7794
  }
7633
7795
  bootstrap.cron = new Cron(`*/${scheduleInterval} * * * * *`, () => __async(null, null, function* () {
7634
- yield setCronSchedule();
7796
+ yield SetCronSchedule();
7635
7797
  }));
7636
7798
  bootstrap.cron = new Cron(`* * * * * *`, () => __async(null, null, function* () {
7637
- yield updateNode();
7638
- yield updateEvents();
7799
+ yield UpdateNode();
7800
+ yield UpdateEvents();
7639
7801
  }));
7640
7802
  });
7641
7803
 
7642
- // src/@core/core.stop.ts
7643
- var stopService = () => __async(null, null, function* () {
7804
+ // src/@core/StopService.ts
7805
+ var StopService = () => __async(null, null, function* () {
7644
7806
  if (bootstrap.isReady) {
7645
7807
  bootstrap.isReady = false;
7646
7808
  if (bootstrap.session_xmpp) {
@@ -7655,15 +7817,15 @@ var stopService = () => __async(null, null, function* () {
7655
7817
  }
7656
7818
  });
7657
7819
 
7658
- // src/@core/core.setNode.ts
7659
- var setNode = (options) => {
7820
+ // src/@core/SetNode.ts
7821
+ var SetNode = (options) => {
7660
7822
  const nodes = bootstrap.cache.nodes.features;
7661
7823
  const exists = nodes.find((node) => node.properties.identifier === options.identifier);
7662
7824
  if (options.delete) {
7663
7825
  if (exists) {
7664
7826
  const index = nodes.indexOf(exists);
7665
7827
  nodes.splice(index, 1);
7666
- return setEventEmit({
7828
+ return SetEventEmit({
7667
7829
  event: `onNodeDelete`,
7668
7830
  metadata: {
7669
7831
  type: `node-delete`,
@@ -7671,7 +7833,7 @@ var setNode = (options) => {
7671
7833
  }
7672
7834
  });
7673
7835
  }
7674
- return setWarning({ message: `Node with identifier '${options.identifier}' not found.` });
7836
+ return SetWarning({ message: `Node with identifier '${options.identifier}' not found.` });
7675
7837
  }
7676
7838
  if (exists) {
7677
7839
  const index = nodes.indexOf(exists);
@@ -7681,7 +7843,7 @@ var setNode = (options) => {
7681
7843
  coordinates: [options.coordinates.longitude, options.coordinates.latitude]
7682
7844
  }
7683
7845
  });
7684
- return setEventEmit({
7846
+ return SetEventEmit({
7685
7847
  event: `onNodeUpdate`,
7686
7848
  metadata: {
7687
7849
  type: `node-update`,
@@ -7699,7 +7861,7 @@ var setNode = (options) => {
7699
7861
  identifier: options.identifier
7700
7862
  }
7701
7863
  });
7702
- return setEventEmit({
7864
+ return SetEventEmit({
7703
7865
  event: `onNodeAdd`,
7704
7866
  metadata: {
7705
7867
  type: `node-add`,
@@ -7708,34 +7870,53 @@ var setNode = (options) => {
7708
7870
  });
7709
7871
  };
7710
7872
 
7711
- // src/@core/core.getEvents.ts
7712
- var getEvents = () => {
7873
+ // src/@core/GetEvents.ts
7874
+ var GetEvents = () => {
7713
7875
  return bootstrap.cache.events;
7714
7876
  };
7715
7877
 
7716
- // src/@core/core.getNodes.ts
7717
- var getNodes = () => {
7878
+ // src/@core/GetNodes.ts
7879
+ var GetNodes = () => {
7718
7880
  return bootstrap.cache.nodes;
7719
7881
  };
7720
7882
 
7721
- // src/@core/core.manualEvent.ts
7722
- var manualEvent = (options) => __async(null, null, function* () {
7883
+ // src/@core/ManualEvent.ts
7884
+ var ManualEvent = (options) => __async(null, null, function* () {
7885
+ var _a;
7723
7886
  const isCapEvent = options.message.includes(`<?xml`);
7724
7887
  const isCapAreaDescription = options.message.includes(`<areaDesc>`);
7725
- const isVTEC = options.message.match(dict_expressions.pvtec) != null;
7726
- const isUGC = options.message.match(dict_expressions.ugc1) != null;
7727
- const getType = getAwipsType({ attributes: options.attributes });
7728
- const result = { message: options.message, attributes: options.attributes, isCapEvent, isVTEC, isUGC, isCapAreaDescription, isIgnored: false, isNWWS: true, getType };
7729
- 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);
7730
7911
  });
7731
7912
 
7732
- // src/@core/core.getRandomEvent.ts
7733
- var getRandomEvent = () => {
7913
+ // src/@core/GetRandomEvent.ts
7914
+ var GetRandomEvent = () => {
7734
7915
  return bootstrap.cache.events.features[Math.floor(Math.random() * bootstrap.cache.events.features.length)];
7735
7916
  };
7736
7917
 
7737
- // src/@core/core.query.ts
7738
- var query = (options) => __async(null, null, function* () {
7918
+ // src/@core/QueryStanza.ts
7919
+ var QueryStanza = (options) => __async(null, null, function* () {
7739
7920
  var _a;
7740
7921
  const get = yield bootstrap.database.prepare(
7741
7922
  `SELECT * FROM stanzas WHERE stanza LIKE ? LIMIT ?`
@@ -7744,11 +7925,11 @@ var query = (options) => __async(null, null, function* () {
7744
7925
  return events;
7745
7926
  });
7746
7927
 
7747
- // src/@core/core.clearEvents.ts
7748
- var clearEvents = () => {
7928
+ // src/@core/ClearEvents.ts
7929
+ var ClearEvents = () => {
7749
7930
  bootstrap.cache.events.features = [];
7750
7931
  bootstrap.cache.hashes = [];
7751
- setEventEmit({
7932
+ SetEventEmit({
7752
7933
  event: `onEventCache`,
7753
7934
  metadata: bootstrap.cache.events,
7754
7935
  message: `Manually cleared event cache.`
@@ -7759,17 +7940,17 @@ var clearEvents = () => {
7759
7940
  var Manager = class {
7760
7941
  constructor(settings) {
7761
7942
  this.trycatch();
7762
- startService(settings);
7943
+ StartService(settings);
7763
7944
  }
7764
7945
  on(event, callback) {
7765
- createListener(event, callback);
7946
+ CreateListener(event, callback);
7766
7947
  }
7767
7948
  trycatch() {
7768
7949
  process.on("uncaughtException", (err) => {
7769
7950
  var _a, _b;
7770
7951
  const ignored = ["ETIMEDOUT", "ECONNRESET", "EHOSTUNREACH", "ENOTFOUND", "ECONNREFUSED", "EPIPE", "EADDRINUSE", "EALREADY", "EACCES", "EAGAIN", "EHOSTDOWN", "STARTTLS_FAILURE"];
7771
7952
  if (ignored.includes(err == null ? void 0 : err.code)) {
7772
- setEventEmit({
7953
+ SetEventEmit({
7773
7954
  event: `onServiceStatus`,
7774
7955
  metadata: {
7775
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...`,
@@ -7780,25 +7961,25 @@ var Manager = class {
7780
7961
  });
7781
7962
  return;
7782
7963
  }
7783
- 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)}` });
7784
7965
  });
7785
7966
  }
7786
7967
  };
7787
7968
  var index_default = Manager;
7788
7969
  export {
7970
+ ClearEvents,
7971
+ GenerateEASMessage,
7972
+ GetCleanedEvent,
7973
+ GetEventGeometry,
7974
+ GetEvents,
7975
+ GetNodes,
7976
+ GetRandomEvent,
7789
7977
  Manager,
7790
- clearEvents,
7791
- index_default as default,
7792
- getCleanedEvent,
7793
- getEventGeometry,
7794
- getEvents,
7795
- getNodes,
7796
- getRandomEvent,
7797
- manualEvent,
7798
- query,
7799
- setEasTone,
7800
- setNode,
7801
- setSettings,
7802
- startService,
7803
- stopService
7978
+ ManualEvent,
7979
+ QueryStanza,
7980
+ SetNode,
7981
+ SetSettings,
7982
+ StartService,
7983
+ StopService,
7984
+ index_default as default
7804
7985
  };