@orm-plugin/ghg-data-converter 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,12 +1,12 @@
1
- var S = Object.defineProperty;
2
- var C = (e, t, o) => t in e ? S(e, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[t] = o;
3
- var p = (e, t, o) => (C(e, typeof t != "symbol" ? t + "" : t, o), o);
4
- import d from "crypto-js";
5
- import f from "axios";
6
- import F from "moment";
7
- import L from "form-data";
8
- import R from "fs";
9
- const y = {
1
+ var te = Object.defineProperty;
2
+ var oe = (e, t, n) => t in e ? te(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
+ var g = (e, t, n) => (oe(e, typeof t != "symbol" ? t + "" : t, n), n);
4
+ import N from "crypto-js";
5
+ import I from "axios";
6
+ import P from "moment";
7
+ import ne from "form-data";
8
+ import re from "fs";
9
+ const K = {
10
10
  test: {
11
11
  report: "http://eemstest.ccs.org.cn/energyEfficiency/energyDataAccept",
12
12
  delete: "http://eemstest.ccs.org.cn/energyEfficiency/voyageDataDelete2CCS",
@@ -19,12 +19,12 @@ const y = {
19
19
  cii: "http://eems.ccs.org.cn/energyEfficiency/energyData2CCS",
20
20
  imoFuel: "http://eems.ccs.org.cn/energyEfficiency/imoFuelData"
21
21
  }
22
- }, E = "A5483FA7";
23
- class q {
22
+ }, ie = "A5483FA7";
23
+ class Ae {
24
24
  constructor(t) {
25
- p(this, "client");
26
- p(this, "urls");
27
- if (this.options = t, this.urls = t.test ? y.test : y.prod, this.client = f.create({ timeout: 3e4 }), this.licenseType === "company" && !t.companyLicense)
25
+ g(this, "client");
26
+ g(this, "urls");
27
+ if (this.options = t, this.urls = t.test ? K.test : K.prod, this.client = I.create({ timeout: 3e4 }), this.licenseType === "company" && !t.companyLicense)
28
28
  throw new Error("CcsEemsClient缺少license配置");
29
29
  if (this.licenseType === "ship" && !t.shipLicense)
30
30
  throw new Error("CcsEemsClient缺少shipLicense配置");
@@ -39,21 +39,21 @@ class q {
39
39
  * 2. DES/CBC/PKCS5Padding,key与IV均为A5483FA7
40
40
  * 3. 输出十六进制大写
41
41
  */
42
- generateToken(t, o) {
43
- const n = d.enc.Utf8.parse(this.options.tokenKey || E), u = this.licenseType === "ship", s = `${t}${u ? "S" : "C"}${o ?? (u ? this.options.shipLicense : this.options.companyLicense)}`.replace(/[^a-zA-Z0-9.\-*_]/g, (a) => a === " " ? "+" : `%${Buffer.from(a, "utf8").toString("hex").toUpperCase()}`);
44
- return d.DES.encrypt(s, n, {
45
- iv: n,
46
- mode: d.mode.CBC,
47
- padding: d.pad.Pkcs7
48
- }).ciphertext.toString(d.enc.Hex).toUpperCase();
42
+ generateToken(t, n) {
43
+ const o = N.enc.Utf8.parse(this.options.tokenKey || ie), l = this.licenseType === "ship", m = `${t}${l ? "S" : "C"}${n ?? (l ? this.options.shipLicense : this.options.companyLicense)}`.replace(/[^a-zA-Z0-9.\-*_]/g, (s) => s === " " ? "+" : `%${Buffer.from(s, "utf8").toString("hex").toUpperCase()}`);
44
+ return N.DES.encrypt(m, o, {
45
+ iv: o,
46
+ mode: N.mode.CBC,
47
+ padding: N.pad.Pkcs7
48
+ }).ciphertext.toString(N.enc.Hex).toUpperCase();
49
49
  }
50
50
  /**
51
51
  * 组装POST参数,接口要求按顺序提交:voyageData、timestamp、token、companyCode
52
52
  * 实测生产接口仅接受multipart/form-data(urlencoded会被网关拒绝)
53
53
  */
54
54
  buildParams(t) {
55
- const o = String(Date.now()), n = new FormData();
56
- return n.append("voyageData", JSON.stringify(t)), n.append("timestamp", o), n.append("token", this.generateToken(o)), this.options.companyCode && n.append("companyCode", this.options.companyCode), n;
55
+ const n = String(Date.now()), o = new FormData();
56
+ return o.append("voyageData", JSON.stringify(t)), o.append("timestamp", n), o.append("token", this.generateToken(n)), this.options.companyCode && o.append("companyCode", this.options.companyCode), o;
57
57
  }
58
58
  /**
59
59
  * 数据上报接口:船舶航次能效数据(覆盖式,船舶号+航次号+航次首港离港年份判断)
@@ -61,16 +61,22 @@ class q {
61
61
  async reportVoyageData(t) {
62
62
  return (await this.client.post(this.urls.report, this.buildParams(t))).data;
63
63
  }
64
+ /**
65
+ * IMO新规数据上报接口:定速航行存油量与各排放源燃油消耗
66
+ */
67
+ async reportImoFuelData(t) {
68
+ return (await this.client.post(this.urls.imoFuel, this.buildParams(t))).data;
69
+ }
64
70
  /**
65
71
  * 数据删除接口:按港口唯一识别码删除
66
72
  */
67
73
  async deleteVoyageData(t) {
68
- const o = String(Date.now()), n = new FormData();
69
- return n.append("voyageData", JSON.stringify({ deletePorts: t })), n.append("timestamp", o), n.append("token", this.generateToken(o)), (await this.client.post(this.urls.delete, n)).data;
74
+ const n = String(Date.now()), o = new FormData();
75
+ return o.append("voyageData", JSON.stringify({ deletePorts: t })), o.append("timestamp", n), o.append("token", this.generateToken(n)), (await this.client.post(this.urls.delete, o)).data;
70
76
  }
71
77
  }
72
- var D = /* @__PURE__ */ ((e) => (e.HSHFO = "1", e.LSHFO = "11", e.ULSHFO = "12", e.HSLFO = "2", e.LSLFO = "21", e.ULSLFO = "22", e.MDO_MGO = "3", e.LPG_PROPANE = "4", e.LPG_BUTANE = "5", e.LNG_OTTO_MS = "6", e.LNG_OTTO_SS = "61", e.LNG_DIESEL_SS = "62", e.LNG_LBSI = "63", e.METHANOL_FOSSIL = "7", e.H2_FOSSIL_FC = "71", e.H2_FOSSIL_ICE = "72", e.NH3_FOSSIL = "73", e.ETHANOL = "8", e.BIODIESEL = "9", e.HVO = "81", e.BIO_LNG_OTTO_MS = "82", e.BIO_LNG_OTTO_SS = "83", e.BIO_LNG_DIESEL_SS = "84", e.BIO_LNG_LBSI = "85", e.BIO_METHANOL = "86", e.OTHER_BIOFUELS = "87", e.BIO_H2_FC = "88", e.BIO_H2_ICE = "89", e.E_DIESEL = "101", e.E_METHANOL = "102", e.E_LNG_OTTO_MS = "103", e.E_LNG_OTTO_SS = "104", e.E_LNG_DIESEL_SS = "105", e.E_LNG_LBSI = "106", e.E_H2_FC = "107", e.E_H2_ICE = "108", e.E_NH3 = "109", e.E_LPG = "110", e.E_DME = "111", e))(D || {});
73
- const j = {
78
+ var h = /* @__PURE__ */ ((e) => (e.HSHFO = "1", e.LSHFO = "11", e.ULSHFO = "12", e.HSLFO = "2", e.LSLFO = "21", e.ULSLFO = "22", e.MDO_MGO = "3", e.LPG_PROPANE = "4", e.LPG_BUTANE = "5", e.LNG_OTTO_MS = "6", e.LNG_OTTO_SS = "61", e.LNG_DIESEL_SS = "62", e.LNG_LBSI = "63", e.METHANOL_FOSSIL = "7", e.H2_FOSSIL_FC = "71", e.H2_FOSSIL_ICE = "72", e.NH3_FOSSIL = "73", e.ETHANOL = "8", e.BIODIESEL = "9", e.HVO = "81", e.BIO_LNG_OTTO_MS = "82", e.BIO_LNG_OTTO_SS = "83", e.BIO_LNG_DIESEL_SS = "84", e.BIO_LNG_LBSI = "85", e.BIO_METHANOL = "86", e.OTHER_BIOFUELS = "87", e.BIO_H2_FC = "88", e.BIO_H2_ICE = "89", e.E_DIESEL = "101", e.E_METHANOL = "102", e.E_LNG_OTTO_MS = "103", e.E_LNG_OTTO_SS = "104", e.E_LNG_DIESEL_SS = "105", e.E_LNG_LBSI = "106", e.E_H2_FC = "107", e.E_H2_ICE = "108", e.E_NH3 = "109", e.E_LPG = "110", e.E_DME = "111", e))(h || {});
79
+ const ae = {
74
80
  1: "高硫重燃油 HS HFO",
75
81
  11: "低硫重燃油 LS HFO",
76
82
  12: "超低硫重燃油 ULS HFO",
@@ -110,14 +116,14 @@ const j = {
110
116
  109: "e-NH3",
111
117
  110: "e-LPG",
112
118
  111: "e-DME"
113
- }, Q = [
119
+ }, v = [
114
120
  { oilId: "1", fields: ["BROB_HSFO"] },
115
121
  { oilId: "11", fields: ["BROB_VLSFO"] },
116
122
  { oilId: "12", fields: ["BROB_ULSFO"] },
117
123
  { oilId: "3", fields: ["BROB_VLSDGO", "BROB_ULSDGO"] }
118
124
  ];
119
- var I = /* @__PURE__ */ ((e) => (e.MAIN_ENGINES = "1", e.AUXILIARY_ENGINES = "2", e.BOILERS = "3", e.INCINERATOR = "4", e.INERT_GAS_GENERATORS = "5", e.CARGO_PUMPS = "6", e.GAS_TURBINES = "7", e))(I || {}), N = /* @__PURE__ */ ((e) => (e.PORT = "0", e.ANCHORING = "1", e.DRIFTING = "2", e))(N || {}), h = /* @__PURE__ */ ((e) => (e.NO = "0", e.EU = "1", e.UK = "2", e.EU_OVERSEAS = "3", e.EU_SMALL_ISLAND = "4", e))(h || {}), B = /* @__PURE__ */ ((e) => (e.LOADING = "0", e.DISCHARGING = "1", e.STS = "2", e.WAITING_BERTH = "3", e.BUNKERING = "4", e.SUPPLY = "5", e.REPAIR = "6", e.CREW_CHANGE = "7", e.SHELTER = "8", e.OTHER = "9", e))(B || {}), M = /* @__PURE__ */ ((e) => (e.DEPARTURE = "0", e.ARRIVAL = "1", e))(M || {}), b = /* @__PURE__ */ ((e) => (e.ANNUAL = "0", e.ISM_CHANGE = "1", e.NEW_SHIP = "2", e.FLAG_CHANGE = "3", e))(b || {}), G = /* @__PURE__ */ ((e) => (e.ETS = "0", e.FUEL_EU = "1", e.CARBON_CAPTURE = "2", e))(G || {}), O = /* @__PURE__ */ ((e) => (e.SECURING_SHIP_SAFETY = "1", e.SAVING_LIFE_AT_SEA = "2", e.SAILING_IN_ICE = "3", e))(O || {}), v = /* @__PURE__ */ ((e) => (e.TANKER_STS = "1", e.REEFER_CONTAINER = "2", e.GAS_CARGO_COOLING = "3", e.TANKER_EDRIVEN_PUMP = "4", e.TANKER_BOILER_CARGO_HEATING = "5", e.INDEPENDENT_DISCHARGE_PUMP = "6", e))(v || {});
120
- const _ = /^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$/, V = [
125
+ var M = /* @__PURE__ */ ((e) => (e.MAIN_ENGINES = "1", e.AUXILIARY_ENGINES = "2", e.BOILERS = "3", e.INCINERATOR = "4", e.INERT_GAS_GENERATORS = "5", e.CARGO_PUMPS = "6", e.GAS_TURBINES = "7", e))(M || {}), H = /* @__PURE__ */ ((e) => (e.PORT = "0", e.ANCHORING = "1", e.DRIFTING = "2", e))(H || {}), J = /* @__PURE__ */ ((e) => (e.NO = "0", e.EU = "1", e.UK = "2", e.EU_OVERSEAS = "3", e.EU_SMALL_ISLAND = "4", e))(J || {}), se = /* @__PURE__ */ ((e) => (e.LOADING = "0", e.DISCHARGING = "1", e.STS = "2", e.WAITING_BERTH = "3", e.BUNKERING = "4", e.SUPPLY = "5", e.REPAIR = "6", e.CREW_CHANGE = "7", e.SHELTER = "8", e.OTHER = "9", e))(se || {}), T = /* @__PURE__ */ ((e) => (e.DEPARTURE = "0", e.ARRIVAL = "1", e))(T || {}), me = /* @__PURE__ */ ((e) => (e.ANNUAL = "0", e.ISM_CHANGE = "1", e.NEW_SHIP = "2", e.FLAG_CHANGE = "3", e))(me || {}), ue = /* @__PURE__ */ ((e) => (e.ETS = "0", e.FUEL_EU = "1", e.CARBON_CAPTURE = "2", e))(ue || {}), le = /* @__PURE__ */ ((e) => (e.SECURING_SHIP_SAFETY = "1", e.SAVING_LIFE_AT_SEA = "2", e.SAILING_IN_ICE = "3", e))(le || {}), pe = /* @__PURE__ */ ((e) => (e.TANKER_STS = "1", e.REEFER_CONTAINER = "2", e.GAS_CARGO_COOLING = "3", e.TANKER_EDRIVEN_PUMP = "4", e.TANKER_BOILER_CARGO_HEATING = "5", e.INDEPENDENT_DISCHARGE_PUMP = "6", e))(pe || {}), S = /* @__PURE__ */ ((e) => (e.FOSP = "1", e.EOSP = "2", e))(S || {});
126
+ const L = /^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$/, _e = /^\d{4}-\d{2}-\d{2} \d{2}:\d{2}$/, ce = [
121
127
  "AT",
122
128
  "BE",
123
129
  "BG",
@@ -145,7 +151,7 @@ const _ = /^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$/, V = [
145
151
  "SI",
146
152
  "ES",
147
153
  "SE"
148
- ], A = {
154
+ ], fe = {
149
155
  AUSTRIA: "AT",
150
156
  BELGIUM: "BE",
151
157
  BULGARIA: "BG",
@@ -176,24 +182,24 @@ const _ = /^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$/, V = [
176
182
  "UNITED KINGDOM": "GB",
177
183
  "GREAT BRITAIN": "GB",
178
184
  UK: "GB"
179
- }, T = (e, t = 2) => String(e).padStart(t, "0");
180
- class H {
185
+ }, de = (e, t = 2) => String(e).padStart(t, "0");
186
+ class X {
181
187
  /**
182
188
  * 解析本系统Port字段:`NEWCASTLE (AUSTRALIA) | AUNTL | +10.0`
183
189
  */
184
190
  parsePort(t) {
185
- var a, m;
191
+ var s, a;
186
192
  if (!t)
187
193
  return { name: "", country: "", loCode: "", zone: null };
188
- const [o = "", n = "", u = ""] = t.split("|").map((g) => g.trim());
189
- let r = n, s = u;
190
- /^[A-Za-z]{5}$/.test(r) || (s || (s = r), r = "");
191
- const i = o.match(/^(.*?)\s*\(([^)]+)\)\s*$/);
194
+ const [n = "", o = "", l = ""] = t.split("|").map((_) => _.trim());
195
+ let r = o, m = l;
196
+ /^[A-Za-z]{5}$/.test(r) || (m || (m = r), r = "");
197
+ const i = n.match(/^(.*?)\s*\(([^)]+)\)\s*$/);
192
198
  return {
193
- name: ((a = i == null ? void 0 : i[1]) == null ? void 0 : a.trim()) || o,
194
- country: ((m = i == null ? void 0 : i[2]) == null ? void 0 : m.trim()) || "",
199
+ name: ((s = i == null ? void 0 : i[1]) == null ? void 0 : s.trim()) || n,
200
+ country: ((a = i == null ? void 0 : i[2]) == null ? void 0 : a.trim()) || "",
195
201
  loCode: r.toUpperCase(),
196
- zone: s ? this.parseZone(s) : null
202
+ zone: m ? this.parseZone(m) : null
197
203
  };
198
204
  }
199
205
  /**
@@ -202,28 +208,35 @@ class H {
202
208
  parseZone(t) {
203
209
  if (!t)
204
210
  return null;
205
- const o = Number(String(t).trim());
206
- return Number.isFinite(o) ? o : null;
211
+ const n = Number(String(t).trim());
212
+ return Number.isFinite(n) ? n : null;
207
213
  }
208
214
  /**
209
215
  * UTC时间转指定时区的本地时间,格式:yyyy-mm-dd 24HH:MI:SS
210
216
  */
211
- formatLocalTime(t, o) {
212
- const n = o ?? 0;
213
- return F(t).utcOffset(n).format("YYYY-MM-DD HH:mm:ss");
217
+ formatLocalTime(t, n) {
218
+ const o = n ?? 0;
219
+ return P(t).utcOffset(o).format("YYYY-MM-DD HH:mm:ss");
220
+ }
221
+ /**
222
+ * UTC时间转指定时区的本地时间,格式:yyyy-mm-dd 24HH:MI(IMO新规接口)
223
+ */
224
+ formatLocalTimeMinute(t, n) {
225
+ const o = n ?? 0;
226
+ return P(t).utcOffset(o).format("YYYY-MM-DD HH:mm");
214
227
  }
215
228
  /**
216
229
  * 十进制度转度分格式:39°54′ N / 122°06′ E
217
230
  */
218
- formatCoordinate(t, o) {
219
- const n = Number(t);
220
- if (!Number.isFinite(n))
231
+ formatCoordinate(t, n) {
232
+ const o = Number(t);
233
+ if (!Number.isFinite(o))
221
234
  return "";
222
- const u = Math.abs(n);
223
- let r = Math.floor(u), s = Math.round((u - r) * 60);
224
- s === 60 && (r += 1, s = 0);
225
- const i = o === "lat" ? n >= 0 ? "N" : "S" : n >= 0 ? "E" : "W";
226
- return `${r}°${T(s)}′ ${i}`;
235
+ const l = Math.abs(o);
236
+ let r = Math.floor(l), m = Math.round((l - r) * 60);
237
+ m === 60 && (r += 1, m = 0);
238
+ const i = n === "lat" ? o >= 0 ? "N" : "S" : o >= 0 ? "E" : "W";
239
+ return `${r}°${de(m)}′ ${i}`;
227
240
  }
228
241
  /**
229
242
  * 附件1:船报油品字段(HSFO/VLSFO/ULSFO/DGO)到CCS燃油代码的映射
@@ -242,11 +255,11 @@ class H {
242
255
  * 支持ISO两位码或英文全名
243
256
  */
244
257
  mapIsEu(t) {
245
- const o = String(t || "").trim().toUpperCase();
246
- if (!o)
258
+ const n = String(t || "").trim().toUpperCase();
259
+ if (!n)
247
260
  return "0";
248
- const n = A[o] || o;
249
- return V.includes(n) ? "1" : n === "GB" || n === "UK" ? "2" : "0";
261
+ const o = fe[n] || n;
262
+ return ce.includes(o) ? "1" : o === "GB" || o === "UK" ? "2" : "0";
250
263
  }
251
264
  /**
252
265
  * 船舶号:海船IMO取7位,内河船为船检识别号
@@ -257,30 +270,199 @@ class H {
257
270
  /**
258
271
  * 报文校验:必填节点、格式与字典值检查
259
272
  */
260
- validate(t, o = []) {
261
- const n = (r, s, i, a) => o.push({ row: r, field: s, value: i, reason: a }), u = (t == null ? void 0 : t.voyagePorts) || [];
262
- return u.length || n(0, "voyagePorts", void 0, "报文中未包含有效数据(voyagePorts为空)"), u.forEach((r, s) => {
263
- const i = s + 1;
264
- r.imoNo || n(i, "imoNo", r.imoNo, "船舶识别号必填"), /^[0-9]{7,16}$/.test(r.imoNo) || n(i, "imoNo", r.imoNo, "海船应为IMO号(7位数字)"), /^[0-9a-fA-F]{32}$/.test(r.refCode) || n(i, "refCode", r.refCode, "应为32位GUID字符串"), r.firstVoyageCode || n(i, "firstVoyageCode", r.firstVoyageCode, "航次编号1必填"), r.firstVoyageCode && r.firstVoyageCode.length > 16 && n(i, "firstVoyageCode", r.firstVoyageCode, "最大长度V16"), Object.values(N).includes(r.recordType) || n(i, "recordType", r.recordType, "停泊类型枚举值不合法"), r.portid || n(i, "portid", r.portid, "港口代码必填"), r.portid && r.recordType === "0" && r.portid !== "000" && r.portid.length !== 5 && n(i, "portid", r.portid, "停靠港应使用国际港口5位码"), Object.values(h).includes(r.isEu) || n(i, "isEu", r.isEu, "isEu枚举值不合法"), _.test(r.arrTm || "") || n(i, "arrTm", r.arrTm, "抵港时间格式应为yyyy-mm-dd HH:MI:SS(本地时间)"), Number.isFinite(r.arrZone) || n(i, "arrZone", r.arrZone, "抵港时区必填"), _.test(r.deptTm || "") || n(i, "deptTm", r.deptTm, "离港时间格式应为yyyy-mm-dd HH:MI:SS(本地时间)"), Number.isFinite(r.deptZone) || n(i, "deptZone", r.deptZone, "离港时区必填"), ["0", "1"].includes(r.inPort) || n(i, "inPort", r.inPort, "港界内/外枚举值不合法"), (r.voyagePortloadings || []).forEach((a, m) => {
265
- Object.values(M).includes(a.loadingType) || n(i, `voyagePortloadings[${m}].loadingType`, a.loadingType, "货物信息类型枚举值不合法"), Number.isFinite(Number(a.cargoTons)) || n(i, `voyagePortloadings[${m}].cargoTons`, a.cargoTons, "载货量必填");
266
- }), (r.voyagePortoils || []).forEach((a, m) => {
267
- Object.values(D).includes(a.oilId) || n(i, `voyagePortoils[${m}].oilId`, a.oilId, "燃油代码不正确"), Number.isFinite(Number(a.arrTons)) || n(i, `voyagePortoils[${m}].arrTons`, a.arrTons, "抵港存油量必填"), Number.isFinite(Number(a.deptTons)) || n(i, `voyagePortoils[${m}].deptTons`, a.deptTons, "离港存油量必填");
268
- }), (r.voyageAddoils || []).forEach((a, m) => {
269
- Object.values(D).includes(a.oilId) || n(i, `voyageAddoils[${m}].oilId`, a.oilId, "燃油代码不正确"), Number.isFinite(Number(a.addTons)) || n(i, `voyageAddoils[${m}].addTons`, a.addTons, "加油量必填"), _.test(a.addTm || "") || n(i, `voyageAddoils[${m}].addTm`, a.addTm, "加油时间格式应为yyyy-mm-dd HH:MI:SS(本地时间)"), Number.isFinite(Number(a.viscosity)) || n(i, `voyageAddoils[${m}].viscosity`, a.viscosity, "加油燃料粘度必填");
270
- }), (r.voyageOutoils || []).forEach((a, m) => {
271
- Object.values(D).includes(a.oilId) || n(i, `voyageOutoils[${m}].oilId`, a.oilId, "燃油代码不正确"), Number.isFinite(Number(a.outTons)) || n(i, `voyageOutoils[${m}].outTons`, a.outTons, "驳出燃料量必填"), _.test(a.outTm || "") || n(i, `voyageOutoils[${m}].outTm`, a.outTm, "驳出时间格式应为yyyy-mm-dd HH:MI:SS(本地时间)");
272
- }), (r.voyageSludges || []).forEach((a, m) => {
273
- Number.isFinite(Number(a.sludgeTons)) || n(i, `voyageSludges[${m}].sludgeTons`, a.sludgeTons, "处理油渣量必填"), _.test(a.sludgeOutTm || "") || n(i, `voyageSludges[${m}].sludgeOutTm`, a.sludgeOutTm, "油渣处理时间格式应为yyyy-mm-dd HH:MI:SS(本地时间)");
273
+ validate(t, n = []) {
274
+ const o = (r, m, i, s) => n.push({ row: r, field: m, value: i, reason: s }), l = (t == null ? void 0 : t.voyagePorts) || [];
275
+ return l.length || o(0, "voyagePorts", void 0, "报文中未包含有效数据(voyagePorts为空)"), l.forEach((r, m) => {
276
+ const i = m + 1;
277
+ r.imoNo || o(i, "imoNo", r.imoNo, "船舶识别号必填"), /^[0-9]{7,16}$/.test(r.imoNo) || o(i, "imoNo", r.imoNo, "海船应为IMO号(7位数字)"), /^[0-9a-fA-F]{32}$/.test(r.refCode) || o(i, "refCode", r.refCode, "应为32位GUID字符串"), r.firstVoyageCode || o(i, "firstVoyageCode", r.firstVoyageCode, "航次编号1必填"), r.firstVoyageCode && r.firstVoyageCode.length > 16 && o(i, "firstVoyageCode", r.firstVoyageCode, "最大长度V16"), Object.values(H).includes(r.recordType) || o(i, "recordType", r.recordType, "停泊类型枚举值不合法"), r.portid || o(i, "portid", r.portid, "港口代码必填"), r.portid && r.recordType === "0" && r.portid !== "000" && r.portid.length !== 5 && o(i, "portid", r.portid, "停靠港应使用国际港口5位码"), Object.values(J).includes(r.isEu) || o(i, "isEu", r.isEu, "isEu枚举值不合法"), L.test(r.arrTm || "") || o(i, "arrTm", r.arrTm, "抵港时间格式应为yyyy-mm-dd HH:MI:SS(本地时间)"), Number.isFinite(r.arrZone) || o(i, "arrZone", r.arrZone, "抵港时区必填"), L.test(r.deptTm || "") || o(i, "deptTm", r.deptTm, "离港时间格式应为yyyy-mm-dd HH:MI:SS(本地时间)"), Number.isFinite(r.deptZone) || o(i, "deptZone", r.deptZone, "离港时区必填"), ["0", "1"].includes(r.inPort) || o(i, "inPort", r.inPort, "港界内/外枚举值不合法"), (r.voyagePortloadings || []).forEach((s, a) => {
278
+ Object.values(T).includes(s.loadingType) || o(i, `voyagePortloadings[${a}].loadingType`, s.loadingType, "货物信息类型枚举值不合法"), Number.isFinite(Number(s.cargoTons)) || o(i, `voyagePortloadings[${a}].cargoTons`, s.cargoTons, "载货量必填");
279
+ }), (r.voyagePortoils || []).forEach((s, a) => {
280
+ Object.values(h).includes(s.oilId) || o(i, `voyagePortoils[${a}].oilId`, s.oilId, "燃油代码不正确"), Number.isFinite(Number(s.arrTons)) || o(i, `voyagePortoils[${a}].arrTons`, s.arrTons, "抵港存油量必填"), Number.isFinite(Number(s.deptTons)) || o(i, `voyagePortoils[${a}].deptTons`, s.deptTons, "离港存油量必填");
281
+ }), (r.voyageAddoils || []).forEach((s, a) => {
282
+ Object.values(h).includes(s.oilId) || o(i, `voyageAddoils[${a}].oilId`, s.oilId, "燃油代码不正确"), Number.isFinite(Number(s.addTons)) || o(i, `voyageAddoils[${a}].addTons`, s.addTons, "加油量必填"), L.test(s.addTm || "") || o(i, `voyageAddoils[${a}].addTm`, s.addTm, "加油时间格式应为yyyy-mm-dd HH:MI:SS(本地时间)"), Number.isFinite(Number(s.viscosity)) || o(i, `voyageAddoils[${a}].viscosity`, s.viscosity, "加油燃料粘度必填");
283
+ }), (r.voyageOutoils || []).forEach((s, a) => {
284
+ Object.values(h).includes(s.oilId) || o(i, `voyageOutoils[${a}].oilId`, s.oilId, "燃油代码不正确"), Number.isFinite(Number(s.outTons)) || o(i, `voyageOutoils[${a}].outTons`, s.outTons, "驳出燃料量必填"), L.test(s.outTm || "") || o(i, `voyageOutoils[${a}].outTm`, s.outTm, "驳出时间格式应为yyyy-mm-dd HH:MI:SS(本地时间)");
285
+ }), (r.voyageSludges || []).forEach((s, a) => {
286
+ Number.isFinite(Number(s.sludgeTons)) || o(i, `voyageSludges[${a}].sludgeTons`, s.sludgeTons, "处理油渣量必填"), L.test(s.sludgeOutTm || "") || o(i, `voyageSludges[${a}].sludgeOutTm`, s.sludgeOutTm, "油渣处理时间格式应为yyyy-mm-dd HH:MI:SS(本地时间)");
287
+ });
288
+ }), n;
289
+ }
290
+ /**
291
+ * IMO新规上报接口报文校验:必填节点、格式与字典值检查
292
+ */
293
+ validateImo(t, n = []) {
294
+ const o = (i, s, a, _) => n.push({ row: i, field: s, value: a, reason: _ }), l = (t == null ? void 0 : t.voyageInfos) || [];
295
+ l.length || o(0, "voyageInfos", void 0, "报文中未包含有效数据(voyageInfos为空)");
296
+ const r = /^\d{1,3}°\d{2}′ [NS]$/, m = /^\d{1,3}°\d{2}′ [EW]$/;
297
+ return l.forEach((i, s) => {
298
+ const a = s + 1;
299
+ i.imoNo || o(a, "imoNo", i.imoNo, "船舶识别号必填"), /^[0-9]{7,16}$/.test(i.imoNo || "") || o(a, "imoNo", i.imoNo, "海船应为IMO号(7位数字)"), /^[0-9a-fA-F]{32}$/.test(i.refCode || "") || o(a, "refCode", i.refCode, "应为32位GUID字符串"), _e.test(i.ospTm || "") || o(a, "ospTm", i.ospTm, "定速时间格式应为yyyy-mm-dd HH:MI(本地时间)"), Number.isFinite(i.ospZone) || o(a, "ospZone", i.ospZone, "定速时区必填"), Object.values(S).includes(i.ospType) || o(a, "ospType", i.ospType, "定速类型枚举值不合法"), m.test(i.longitude || "") || o(a, "longitude", i.longitude, "经度格式应为39°54′ E/W"), r.test(i.latitude || "") || o(a, "latitude", i.latitude, "纬度格式应为39°54′ N/S"), i.distance !== void 0 && (!Number.isFinite(i.distance) || i.distance < 0) && o(a, "distance", i.distance, "定速航行距离应为非负数字"), (i.voyagePortoils || []).forEach((u, p) => {
300
+ Object.values(h).includes(u.oilId) || o(a, `voyagePortoils[${p}].oilId`, u.oilId, "燃油代码不正确"), (!Number.isFinite(Number(u.stockTons)) || Number(u.stockTons) < 0) && o(a, `voyagePortoils[${p}].stockTons`, u.stockTons, "存油量应为非负数字");
301
+ });
302
+ const _ = /* @__PURE__ */ new Set();
303
+ (i.fuelConsumers || []).forEach((u, p) => {
304
+ Object.values(M).includes(u.consumerType) || o(a, `fuelConsumers[${p}].consumerType`, u.consumerType, "排放源类型枚举值不合法"), Object.values(h).includes(u.oilId) || o(a, `fuelConsumers[${p}].oilId`, u.oilId, "燃油代码不正确"), (!Number.isFinite(Number(u.oilTons)) || Number(u.oilTons) < 0) && o(a, `fuelConsumers[${p}].oilTons`, u.oilTons, "燃油消耗量应为非负数字");
305
+ const c = `${u.consumerType}:${u.oilId}`;
306
+ _.has(c) && o(a, `fuelConsumers[${p}]`, c, "同一排放源与燃油种类重复"), _.add(c);
274
307
  });
275
- }), o;
308
+ }), n;
276
309
  }
277
310
  }
278
- const X = new H();
279
- class ee {
280
- constructor(t, o, n = "https://ovd.veracityapp.com/api") {
281
- p(this, "client");
282
- p(this, "jwtToken", null);
283
- this.accessKey = t, this.companyId = o, this.baseUrl = n, this.client = f.create({
311
+ const ve = new X(), f = new X(), A = "BOSP", b = "EOSP", ge = "NOON", De = [
312
+ { consumerType: M.MAIN_ENGINES, prefix: "MECons" },
313
+ { consumerType: M.AUXILIARY_ENGINES, prefix: "AECons" },
314
+ { consumerType: M.BOILERS, prefix: "BoilerCons" },
315
+ { consumerType: M.INCINERATOR, prefix: "INCINCons" }
316
+ ], z = v.map(({ oilId: e, fields: t }) => ({
317
+ oilId: e,
318
+ suffixes: t.map((n) => n.replace(/^BROB_/, ""))
319
+ })), d = (e, t = 2) => Number(Number(e || 0).toFixed(t)), q = (e) => N.MD5(e).toString(), Z = (e, t) => e == null || e === "" ? "" : f.formatCoordinate(e, t);
320
+ function V(e, t, n, o, l) {
321
+ const r = f.parsePort(t == null ? void 0 : t.Port), m = n ? f.parsePort((n == null ? void 0 : n.Port) || (t == null ? void 0 : t.Port)) : r, i = f.normalizeImo(t == null ? void 0 : t.IMO), s = f.formatLocalTime(t == null ? void 0 : t.Date, r.zone), a = n ? f.formatLocalTime(n == null ? void 0 : n.Date, m.zone) : s, _ = r.zone ?? f.parseZone(t == null ? void 0 : t.Offset) ?? 0, u = m.zone ?? _, p = l, c = p, D = v.map(({ oilId: C, fields: O }) => {
322
+ const G = ae[C], F = d(O.reduce((y, E) => y + ((t == null ? void 0 : t[E]) || 0), 0)), R = n ? d(O.reduce((y, E) => y + ((n == null ? void 0 : n[E]) || 0), 0)) : F;
323
+ return { oilId: C, oilName: G, arrTons: F, deptTons: R, correctTons: 0, correctTm: null };
324
+ });
325
+ return {
326
+ imoNo: i,
327
+ refCode: q(`${e}:${i}:${s}`),
328
+ firstVoyageCode: p,
329
+ secondVoyageCode: c,
330
+ recordType: H.PORT,
331
+ portid: r.loCode || "000",
332
+ porten: r.name,
333
+ isEu: f.mapIsEu(r.country),
334
+ arrTm: s,
335
+ arrZone: _,
336
+ deptTm: a,
337
+ deptZone: u,
338
+ distance: d(o),
339
+ inPort: "0",
340
+ shorePower: [{ power: 0 }],
341
+ voyagePortloadings: [
342
+ {
343
+ loadingType: T.ARRIVAL,
344
+ cargoTons: d(t == null ? void 0 : t.CargoWeight),
345
+ ballastTons: d(t == null ? void 0 : t.Ballast),
346
+ allBoxNum: 0,
347
+ heavyBoxNum: 0,
348
+ refContainer20Num: 0,
349
+ refContainer40Num: 0,
350
+ peopleNum: 0,
351
+ carsNum: 0
352
+ },
353
+ {
354
+ loadingType: T.DEPARTURE,
355
+ cargoTons: d((n == null ? void 0 : n.CargoWeight) ?? (t == null ? void 0 : t.CargoWeight)),
356
+ ballastTons: d((n == null ? void 0 : n.Ballast) ?? (t == null ? void 0 : t.Ballast)),
357
+ allBoxNum: 0,
358
+ heavyBoxNum: 0,
359
+ refContainer20Num: 0,
360
+ refContainer40Num: 0,
361
+ peopleNum: 0,
362
+ carsNum: 0
363
+ }
364
+ ],
365
+ voyagePortoils: D,
366
+ voyageAddoils: [],
367
+ voyageOutoils: [],
368
+ voyageSludges: []
369
+ };
370
+ }
371
+ function He(e, t, n = {}) {
372
+ var i, s;
373
+ if (!t.length)
374
+ return { voyagePorts: [] };
375
+ const o = n.voyageCode ?? ((s = (i = t[0]) == null ? void 0 : i.voyage) == null ? void 0 : s.number) ?? "", l = [];
376
+ let r = null, m = 0;
377
+ for (const a of t)
378
+ a.Type === b && a.Port ? (r && l.push(V(e, r, null, m, o)), r = a, m += a.DistSLR || 0) : a.Type === ge ? m += a.DistSLR || 0 : a.Type === A && a.Port && (l.push(V(e, r || a, a, m, o)), r = null, m = 0);
379
+ return r && l.push(V(e, r, null, m, o)), { voyagePorts: l };
380
+ }
381
+ function Ce(e) {
382
+ return v.map(({ oilId: t, fields: n }) => ({
383
+ oilId: t,
384
+ addBillNo: "",
385
+ stockTons: d(n.reduce((o, l) => o + ((e == null ? void 0 : e[l]) || 0), 0))
386
+ })).filter((t) => t.stockTons > 0);
387
+ }
388
+ function ye(e, t, n, o, l, r) {
389
+ const m = new Date(n == null ? void 0 : n.Date).getTime();
390
+ if (!Number.isFinite(m))
391
+ return e.map((u) => ({ row: u, factor: 1 }));
392
+ const i = Date.UTC(new Date(m).getUTCFullYear(), 0, 1), s = new Date(t == null ? void 0 : t.Date).getTime();
393
+ if (!Number.isFinite(s) || s >= i)
394
+ return e.map((u) => ({ row: u, factor: 1 }));
395
+ const a = [];
396
+ let _ = s;
397
+ for (const u of e) {
398
+ const p = new Date(u.Date).getTime();
399
+ if (!Number.isFinite(p)) {
400
+ a.push({ row: u, factor: 1 });
401
+ continue;
402
+ }
403
+ const c = p <= i ? 0 : _ >= i ? 1 : (p - i) / (p - _);
404
+ c > 0 && a.push({ row: u, factor: c }), _ = p;
405
+ }
406
+ return a.some(({ factor: u }) => u < 1) && (r == null || r(
407
+ "[CCS IMO] 航次 %s 的%s跨年,fuelConsumers仅统计%s UTC之后区间,边界船报按时间线性拆分",
408
+ o,
409
+ l === S.EOSP ? "EOSP" : "FOSP",
410
+ f.formatLocalTimeMinute(new Date(i), 0)
411
+ )), a;
412
+ }
413
+ function Ne(e, t, n) {
414
+ const o = [];
415
+ for (const { consumerType: r, prefix: m } of De)
416
+ for (const { oilId: i, suffixes: s } of z) {
417
+ const a = d(
418
+ e.reduce((_, { row: u, factor: p }) => _ + s.reduce((c, D) => c + ((u == null ? void 0 : u[`${m}_${D}`]) || 0) * p, 0), 0)
419
+ );
420
+ a > 0 && o.push({ consumerType: r, oilId: i, oilTons: a });
421
+ }
422
+ const l = d(
423
+ e.reduce(
424
+ (r, { row: m, factor: i }) => r + z.reduce((s, { suffixes: a }) => s + a.reduce((_, u) => _ + ((m == null ? void 0 : m[`OtherCons_${u}`]) || 0) * i, 0), 0),
425
+ 0
426
+ )
427
+ );
428
+ return l > 0 && (n == null || n("[CCS IMO] 航次 %s 的OtherCons消耗 %s 吨无对应CCS排放源类型,未上报", t, l)), o;
429
+ }
430
+ function he(e, t, n, o, l, r) {
431
+ const m = f.parsePort(t == null ? void 0 : t.Port), i = f.parseZone(t == null ? void 0 : t.Offset), s = m.zone ?? i ?? 0;
432
+ m.zone === null && i === null && (r == null || r("[CCS IMO] 航次 %s 的%s缺少港口时区与Offset,按0时区上报", e, n));
433
+ const a = f.normalizeImo(t == null ? void 0 : t.IMO), _ = f.formatLocalTimeMinute(t == null ? void 0 : t.Date, s), u = o && l ? ye(o, l, t, e, n, r) : [], p = n === S.EOSP && o ? u.reduce((c, { row: D, factor: C }) => c + (D.DistSLR || 0) * C, 0) : void 0;
434
+ return {
435
+ imoNo: a,
436
+ refCode: q(`${e}:${a}:${n}:${_}`),
437
+ ospTm: _,
438
+ ospZone: s,
439
+ ospType: n,
440
+ pointType: "",
441
+ longitude: Z(t == null ? void 0 : t.Lng, "lng"),
442
+ latitude: Z(t == null ? void 0 : t.Lat, "lat"),
443
+ ...p !== void 0 ? { distance: d(p) } : {},
444
+ voyagePortoils: Ce(t),
445
+ fuelConsumers: Ne(u, e, r)
446
+ };
447
+ }
448
+ function xe(e, t, n = {}) {
449
+ const { warn: o } = n, l = [];
450
+ let r = -1, m = null;
451
+ return t.forEach((i, s) => {
452
+ if (i.Type !== A && i.Type !== b)
453
+ return;
454
+ const a = i.Type === b, _ = a ? S.EOSP : S.FOSP, u = a ? A : b;
455
+ let p = null;
456
+ r >= 0 && m === u ? p = t.slice(r + 1, s + 1) : o == null || o("[CCS IMO] 航次 %s 的%s缺少前序%s,跳过fuelConsumers", e, _, u);
457
+ const c = p ? t[r] : null;
458
+ l.push(he(e, i, _, p, c, o)), r = s, m = i.Type;
459
+ }), { voyageInfos: l };
460
+ }
461
+ class Ue {
462
+ constructor(t, n, o = "https://ovd.veracityapp.com/api") {
463
+ g(this, "client");
464
+ g(this, "jwtToken", null);
465
+ this.accessKey = t, this.companyId = n, this.baseUrl = o, this.client = I.create({
284
466
  timeout: 3e4
285
467
  });
286
468
  }
@@ -289,10 +471,10 @@ class ee {
289
471
  * 使用 AccessKey 交换有效期 60 分钟的 Token
290
472
  */
291
473
  async authenticate() {
292
- const t = "https://ovdadmin.veracityapp.com/token", o = await f.get(t, {
474
+ const t = "https://ovdadmin.veracityapp.com/token", n = await I.get(t, {
293
475
  headers: { Authorization: `Bearer ${this.accessKey}` }
294
476
  });
295
- return this.jwtToken = o.data, this.jwtToken;
477
+ return this.jwtToken = n.data, this.jwtToken;
296
478
  }
297
479
  /**
298
480
  * 设置通用 Header
@@ -309,18 +491,18 @@ class ee {
309
491
  * @param data 包含表头的数据二维数组
310
492
  * @param tag 可选标签,用于替换旧数据
311
493
  */
312
- async uploadData(t, o, n) {
313
- if (o.length > 1001)
494
+ async uploadData(t, n, o) {
495
+ if (n.length > 1001)
314
496
  throw new Error("建议单次上传不超过 1000 行数据");
315
- const u = {
497
+ const l = {
316
498
  CompanyId: this.companyId,
317
499
  Data: {
318
500
  InterfaceCode: t,
319
- Data: o
501
+ Data: n
320
502
  },
321
- Tag: n
503
+ Tag: o
322
504
  };
323
- return (await this.client.post(`${this.baseUrl}/Data/process`, u, {
505
+ return (await this.client.post(`${this.baseUrl}/Data/process`, l, {
324
506
  headers: this.getHeaders()
325
507
  })).data;
326
508
  }
@@ -344,13 +526,13 @@ class ee {
344
526
  * 上传 OVD 相关文档 (PDF/JPG)
345
527
  */
346
528
  async uploadDocument(t) {
347
- const o = new L();
348
- o.append("File", R.createReadStream(t.filePath));
349
- const n = new URL(`${this.baseUrl}/v1/documents`);
350
- return n.searchParams.append("CompanyId", this.companyId), n.searchParams.append("VesselIMO", t.vesselIMO), n.searchParams.append("DocumentType", t.docType), t.bunkerCategory && n.searchParams.append("BunkerDocumentCategory", t.bunkerCategory), t.bdnNumbers && t.bdnNumbers.forEach((r) => n.searchParams.append("BdnNumbers", r)), (await this.client.post(n.toString(), o, {
529
+ const n = new ne();
530
+ n.append("File", re.createReadStream(t.filePath));
531
+ const o = new URL(`${this.baseUrl}/v1/documents`);
532
+ return o.searchParams.append("CompanyId", this.companyId), o.searchParams.append("VesselIMO", t.vesselIMO), o.searchParams.append("DocumentType", t.docType), t.bunkerCategory && o.searchParams.append("BunkerDocumentCategory", t.bunkerCategory), t.bdnNumbers && t.bdnNumbers.forEach((r) => o.searchParams.append("BdnNumbers", r)), (await this.client.post(o.toString(), n, {
351
533
  headers: {
352
534
  ...this.getHeaders(),
353
- ...o.getHeaders()
535
+ ...n.getHeaders()
354
536
  }
355
537
  })).data;
356
538
  }
@@ -358,23 +540,23 @@ class ee {
358
540
  * 获取服务健康状态
359
541
  */
360
542
  async checkHealth() {
361
- return (await f.get("https://ovd.veracityapp.com/health")).data.Status === "Healthy";
543
+ return (await I.get("https://ovd.veracityapp.com/health")).data.Status === "Healthy";
362
544
  }
363
545
  }
364
- var x = /* @__PURE__ */ ((e) => (e.Date = "Date", e.Time = "Time", e.DateTime = "Date-Time", e.WholeNumber = "WholeNumber", e.DecimalNumber = "DecimalNumber", e.Text = "Text", e))(x || {}), P = /* @__PURE__ */ ((e) => (e.Arrival = "Arrival", e.Departure = "Departure", e.ArrivalSts = "ArrivalSTS", e.DepartureSts = "DepartureSTS", e.Sts = "STS", e.Bosp = "BOSP", e.Eosp = "EOSP", e.BeginOfSeaPassage = "BeginOfSeaPassage", e.EndOfSeaPassage = "EndOfSeaPassage", e.Faop = "FAOP", e.FullAheadOnPassage = "FullAheadOnPassage", e.BeginOfShifting = "BeginOfShifting", e.EndOfShifting = "EndOfShifting", e.BeginCanalPassage = "Begin canal passage", e.EndCanalPassage = "End canal passage", e.BeginAnchoringDrifting = "Begin Anchoring/Drifting", e.EndAnchoringDrifting = "End Anchoring/Drifting", e.NoonSeaPassage = "Noon (Position) - Sea passage", e.NoonPort = "Noon (Position) - Port", e.NoonRiver = "Noon (Position) - River", e.NoonStoppage = "Noon (Position) - Stoppage", e.EtaUpdate = "ETA update", e.BeginFuelChangeOver = "Begin fuel change over", e.EndFuelChangeOver = "End fuel change over", e.ChangeDestinationDeviation = "Change destination (Deviation)", e.BeginOfDeviation = "Begin of deviation", e.EndOfDeviation = "End of deviation", e.EnteringSpecialArea = "Entering special area", e.LeavingSpecialArea = "Leaving special area", e.OtherEvent = "Other event", e.BeginOfOffhire = "Beginofoffhire", e.EndOfOffhire = "Endofoffhire", e.PerformanceSnapshot = "Performance snapshot", e))(P || {}), U = /* @__PURE__ */ ((e) => (e.CargoOperations = "CargoOperations", e.PassengerMovement = "PassengerMovement", e.TakingBunkers = "TakingBunkers", e.ChangingCrew = "ChangingCrew", e.GoodWillVisit = "GoodWillVisit", e.TakingSupplies = "TakingSupplies", e.Repair = "Repair", e.LaidUp = "LaidUp", e.AwaitingOrders = "AwaitingOrders", e.Miscellaneous = "Miscellaneous", e.CrewMovement = "CrewMovement", e.CruiseLeisureRecreation = "CruiseLeisureRecreation", e.UnderGovernmentOrder = "UnderGovernmentOrder", e.QuarantineInspection = "QuarantineInspection", e.Refuge = "Refuge", e.UnloadingCargo = "UnloadingCargo", e.LoadingCargo = "LoadingCargo", e.RepairInDryDock = "RepairInDryDock", e.RepairInWetDock = "RepairInWetDock", e.CargoTankCleaning = "CargoTankCleaning", e.MeansOfTransportCustomsClearance = "MeansOfTransportCustomsClearance", e.DeGassing = "DeGassing", e.WasteDisposal = "WasteDisposal", e.OffshoreMobilizationOperations = "OffshoreMobilizationOperations", e.TransferOfPersonnel = "TransferOfPersonnel", e.PassThrough = "PassThrough", e))(U || {}), w = /* @__PURE__ */ ((e) => (e.HFO = "HFO", e.LFO = "LFO", e.MGO = "MGO", e.MDO = "MDO", e.LPGP = "LPGP", e.LPGB = "LPGB", e.LNG = "LNG", e.LngN2 = "LNGN2", e.Methanol = "Methanol", e.Ethanol = "Ethanol", e.Ethane = "Ethane", e.Blend = "Blend", e.EMdo = "eMDO", e.EMgo = "eMGO", e.ELpg = "eLPG", e.EDme = "eDME", e.HVO = "HVO", e.FAME = "FAME", e.BioDiesel = "BioDiesel", e.BioLNG = "BioLNG", e.ELNG = "eLNG", e.BioMethanol = "BioMethanol", e.EMethanol = "eMethanol", e.NH3 = "NH3", e.H2 = "H2", e.BioH2 = "BioH2", e.EH2 = "eH2", e.ENh3 = "eNH3", e.LBG = "LBG", e.OtherBio = "OtherBio", e.LSHFO = "LSHFO", e.LSLFO = "LSLFO", e.LSMGO = "LSMGO", e.ULSFO2020 = "ULSFO2020", e.ULSLFO2020 = "ULSLFO2020", e.ULSMDO2020 = "ULSMDO2020", e.ULSMGO2020 = "ULSMGO2020", e.VLSFO = "VLSFO", e.VLSFO2020 = "VLSFO2020", e.VLSLFO2020 = "VLSLFO2020", e.B100LFO = "B100LFO", e.B100MGO = "B100MGO", e.B10LFO = "B10LFO", e.B10MGO = "B10MGO", e.B20LFO = "B20LFO", e.B24LFO = "B24LFO", e.B30LFO = "B30LFO", e.B50MGO = "B50MGO", e.BioLFO = "BioLFO", e.BioMGO = "BioMGO", e.Other = "Other", e))(w || {}), k = /* @__PURE__ */ ((e) => (e.OVDLA = "OVDLA", e.OVDBR = "OVDBR", e))(k || {});
365
- class W {
546
+ var Me = /* @__PURE__ */ ((e) => (e.Date = "Date", e.Time = "Time", e.DateTime = "Date-Time", e.WholeNumber = "WholeNumber", e.DecimalNumber = "DecimalNumber", e.Text = "Text", e))(Me || {}), Se = /* @__PURE__ */ ((e) => (e.Arrival = "Arrival", e.Departure = "Departure", e.ArrivalSts = "ArrivalSTS", e.DepartureSts = "DepartureSTS", e.Sts = "STS", e.Bosp = "BOSP", e.Eosp = "EOSP", e.BeginOfSeaPassage = "BeginOfSeaPassage", e.EndOfSeaPassage = "EndOfSeaPassage", e.Faop = "FAOP", e.FullAheadOnPassage = "FullAheadOnPassage", e.BeginOfShifting = "BeginOfShifting", e.EndOfShifting = "EndOfShifting", e.BeginCanalPassage = "Begin canal passage", e.EndCanalPassage = "End canal passage", e.BeginAnchoringDrifting = "Begin Anchoring/Drifting", e.EndAnchoringDrifting = "End Anchoring/Drifting", e.NoonSeaPassage = "Noon (Position) - Sea passage", e.NoonPort = "Noon (Position) - Port", e.NoonRiver = "Noon (Position) - River", e.NoonStoppage = "Noon (Position) - Stoppage", e.EtaUpdate = "ETA update", e.BeginFuelChangeOver = "Begin fuel change over", e.EndFuelChangeOver = "End fuel change over", e.ChangeDestinationDeviation = "Change destination (Deviation)", e.BeginOfDeviation = "Begin of deviation", e.EndOfDeviation = "End of deviation", e.EnteringSpecialArea = "Entering special area", e.LeavingSpecialArea = "Leaving special area", e.OtherEvent = "Other event", e.BeginOfOffhire = "Beginofoffhire", e.EndOfOffhire = "Endofoffhire", e.PerformanceSnapshot = "Performance snapshot", e))(Se || {}), Fe = /* @__PURE__ */ ((e) => (e.CargoOperations = "CargoOperations", e.PassengerMovement = "PassengerMovement", e.TakingBunkers = "TakingBunkers", e.ChangingCrew = "ChangingCrew", e.GoodWillVisit = "GoodWillVisit", e.TakingSupplies = "TakingSupplies", e.Repair = "Repair", e.LaidUp = "LaidUp", e.AwaitingOrders = "AwaitingOrders", e.Miscellaneous = "Miscellaneous", e.CrewMovement = "CrewMovement", e.CruiseLeisureRecreation = "CruiseLeisureRecreation", e.UnderGovernmentOrder = "UnderGovernmentOrder", e.QuarantineInspection = "QuarantineInspection", e.Refuge = "Refuge", e.UnloadingCargo = "UnloadingCargo", e.LoadingCargo = "LoadingCargo", e.RepairInDryDock = "RepairInDryDock", e.RepairInWetDock = "RepairInWetDock", e.CargoTankCleaning = "CargoTankCleaning", e.MeansOfTransportCustomsClearance = "MeansOfTransportCustomsClearance", e.DeGassing = "DeGassing", e.WasteDisposal = "WasteDisposal", e.OffshoreMobilizationOperations = "OffshoreMobilizationOperations", e.TransferOfPersonnel = "TransferOfPersonnel", e.PassThrough = "PassThrough", e))(Fe || {}), Ee = /* @__PURE__ */ ((e) => (e.HFO = "HFO", e.LFO = "LFO", e.MGO = "MGO", e.MDO = "MDO", e.LPGP = "LPGP", e.LPGB = "LPGB", e.LNG = "LNG", e.LngN2 = "LNGN2", e.Methanol = "Methanol", e.Ethanol = "Ethanol", e.Ethane = "Ethane", e.Blend = "Blend", e.EMdo = "eMDO", e.EMgo = "eMGO", e.ELpg = "eLPG", e.EDme = "eDME", e.HVO = "HVO", e.FAME = "FAME", e.BioDiesel = "BioDiesel", e.BioLNG = "BioLNG", e.ELNG = "eLNG", e.BioMethanol = "BioMethanol", e.EMethanol = "eMethanol", e.NH3 = "NH3", e.H2 = "H2", e.BioH2 = "BioH2", e.EH2 = "eH2", e.ENh3 = "eNH3", e.LBG = "LBG", e.OtherBio = "OtherBio", e.LSHFO = "LSHFO", e.LSLFO = "LSLFO", e.LSMGO = "LSMGO", e.ULSFO2020 = "ULSFO2020", e.ULSLFO2020 = "ULSLFO2020", e.ULSMDO2020 = "ULSMDO2020", e.ULSMGO2020 = "ULSMGO2020", e.VLSFO = "VLSFO", e.VLSFO2020 = "VLSFO2020", e.VLSLFO2020 = "VLSLFO2020", e.B100LFO = "B100LFO", e.B100MGO = "B100MGO", e.B10LFO = "B10LFO", e.B10MGO = "B10MGO", e.B20LFO = "B20LFO", e.B24LFO = "B24LFO", e.B30LFO = "B30LFO", e.B50MGO = "B50MGO", e.BioLFO = "BioLFO", e.BioMGO = "BioMGO", e.Other = "Other", e))(Ee || {}), j = /* @__PURE__ */ ((e) => (e.OVDLA = "OVDLA", e.OVDBR = "OVDBR", e))(j || {});
547
+ class Le {
366
548
  /** 表头字段名, 顺序与文档一致 */
367
549
  fields(t) {
368
- return this.fieldDefs(t).map((o) => o.name);
550
+ return this.fieldDefs(t).map((n) => n.name);
369
551
  }
370
552
  /**
371
553
  * 度分格式 + 半球标识 (OVD 要求 dd° mm.mm' N/S/E/W)
372
554
  */
373
- formatCoordinate(t, o) {
374
- const n = Math.abs(t), u = Math.floor(n), r = (n - u) * 60;
555
+ formatCoordinate(t, n) {
556
+ const o = Math.abs(t), l = Math.floor(o), r = (o - l) * 60;
375
557
  return {
376
- hemisphere: o === "lat" ? t >= 0 ? "N" : "S" : o === "lng" ? t >= 0 ? "E" : "W" : "",
377
- degrees: u,
558
+ hemisphere: n === "lat" ? t >= 0 ? "N" : "S" : n === "lng" ? t >= 0 ? "E" : "W" : "",
559
+ degrees: l,
378
560
  minutes: r.toFixed(2)
379
561
  };
380
562
  }
@@ -418,60 +600,60 @@ class W {
418
600
  * 按字段类型校验数据(首行为表头), 返回校验错误列表, 空数组表示通过
419
601
  * 校验规则: 日期/时间格式, 数值类型, 文本长度, 文本中不允许出现单双引号(OVD 3.10 起), IMO 7位整数
420
602
  */
421
- validate(t, o = "OVDLA") {
422
- const [n, ...u] = t, r = new Map(this.fieldDefs(o).map((i) => [i.name, i])), s = [];
423
- return u.forEach((i, a) => {
424
- n.forEach((m, g) => {
425
- const c = r.get(m);
426
- if (!c)
603
+ validate(t, n = "OVDLA") {
604
+ const [o, ...l] = t, r = new Map(this.fieldDefs(n).map((i) => [i.name, i])), m = [];
605
+ return l.forEach((i, s) => {
606
+ o.forEach((a, _) => {
607
+ const u = r.get(a);
608
+ if (!u)
427
609
  return;
428
- const l = String(i[g] ?? "").trim();
429
- if (l) {
430
- if (c.name === "IMO" || c.rule === "exact7digits") {
431
- /^\d{7}$/.test(l) || s.push({ row: a + 1, field: m, value: l, reason: "must be exactly 7 digits" });
610
+ const p = String(i[_] ?? "").trim();
611
+ if (p) {
612
+ if (u.name === "IMO" || u.rule === "exact7digits") {
613
+ /^\d{7}$/.test(p) || m.push({ row: s + 1, field: a, value: p, reason: "must be exactly 7 digits" });
432
614
  return;
433
615
  }
434
- switch (c.type) {
616
+ switch (u.type) {
435
617
  case "Date":
436
- /^\d{4}-\d{2}-\d{2}$/.test(l) || s.push({ row: a + 1, field: m, value: l, reason: "expected format yyyy-mm-dd" });
618
+ /^\d{4}-\d{2}-\d{2}$/.test(p) || m.push({ row: s + 1, field: a, value: p, reason: "expected format yyyy-mm-dd" });
437
619
  break;
438
620
  case "Time":
439
- /^\d{2}:\d{2}$/.test(l) || s.push({ row: a + 1, field: m, value: l, reason: "expected format hh:mm" });
621
+ /^\d{2}:\d{2}$/.test(p) || m.push({ row: s + 1, field: a, value: p, reason: "expected format hh:mm" });
440
622
  break;
441
623
  case "Date-Time":
442
- /^\d{4}-\d{2}-\d{2} \d{2}:\d{2}$/.test(l) || s.push({ row: a + 1, field: m, value: l, reason: "expected format yyyy-mm-dd hh:mm" });
624
+ /^\d{4}-\d{2}-\d{2} \d{2}:\d{2}$/.test(p) || m.push({ row: s + 1, field: a, value: p, reason: "expected format yyyy-mm-dd hh:mm" });
443
625
  break;
444
626
  case "WholeNumber":
445
- /^[+-]?\d+$/.test(l) || s.push({ row: a + 1, field: m, value: l, reason: "expected whole number" });
627
+ /^[+-]?\d+$/.test(p) || m.push({ row: s + 1, field: a, value: p, reason: "expected whole number" });
446
628
  break;
447
629
  case "DecimalNumber":
448
- Number.isFinite(Number(l)) || s.push({ row: a + 1, field: m, value: l, reason: "expected decimal number" });
630
+ Number.isFinite(Number(p)) || m.push({ row: s + 1, field: a, value: p, reason: "expected decimal number" });
449
631
  break;
450
632
  case "Text":
451
- c.maxLength && l.length > c.maxLength && s.push({ row: a + 1, field: m, value: l, reason: `exceeds max length ${c.maxLength}` }), /['"]/.test(l) && s.push({ row: a + 1, field: m, value: l, reason: "single/double quotes are not allowed" });
633
+ u.maxLength && p.length > u.maxLength && m.push({ row: s + 1, field: a, value: p, reason: `exceeds max length ${u.maxLength}` }), /['"]/.test(p) && m.push({ row: s + 1, field: a, value: p, reason: "single/double quotes are not allowed" });
452
634
  break;
453
635
  }
454
636
  }
455
637
  });
456
- }), s;
638
+ }), m;
457
639
  }
458
640
  toCsv(t) {
459
- const o = t.map(
460
- (n) => n.map((u) => {
461
- const r = String(u);
641
+ const n = t.map(
642
+ (o) => o.map((l) => {
643
+ const r = String(l);
462
644
  return r.includes(",") || r.includes('"') || r.includes(`
463
645
  `) ? `"${r.replace(/"/g, '""')}"` : r;
464
646
  }).join(",")
465
647
  ).join(`
466
648
  `);
467
- return Buffer.from(o, "utf-8");
649
+ return Buffer.from(n, "utf-8");
468
650
  }
469
651
  }
470
- class te extends W {
652
+ class Be extends Le {
471
653
  constructor() {
472
654
  super(...arguments);
473
- p(this, "version", "3.13");
474
- p(this, "logAbstractDefs", [
655
+ g(this, "version", "3.13");
656
+ g(this, "logAbstractDefs", [
475
657
  { name: "Date_UTC", type: "Date", relevantFor: "mandatory for MRV&DCS", mandatory: !0, description: "UTC date" },
476
658
  {
477
659
  name: "Time_UTC",
@@ -1400,7 +1582,7 @@ class te extends W {
1400
1582
  }
1401
1583
  ]);
1402
1584
  // Bunker Report (OVDBR), 字段元数据来自文档 Bunker report 工作表
1403
- p(this, "bunkerReportDefs", [
1585
+ g(this, "bunkerReportDefs", [
1404
1586
  { name: "IMO", type: "WholeNumber", rule: "exact7digits", relevantFor: "mandatory for MRV&DCS", mandatory: !0, description: "IMO number" },
1405
1587
  {
1406
1588
  name: "BDN_Number",
@@ -1521,33 +1703,232 @@ class te extends W {
1521
1703
  }
1522
1704
  ]);
1523
1705
  }
1524
- fieldDefs(o) {
1525
- return o === "OVDBR" ? this.bunkerReportDefs : this.logAbstractDefs;
1706
+ fieldDefs(n) {
1707
+ return n === "OVDBR" ? this.bunkerReportDefs : this.logAbstractDefs;
1526
1708
  }
1527
1709
  }
1710
+ const B = new Be(), Oe = "BOSP", Re = "EOSP";
1711
+ function we(e) {
1712
+ const t = B.fields(j.OVDLA);
1713
+ if (!e.length)
1714
+ return [t];
1715
+ const n = [];
1716
+ return e.forEach((o) => {
1717
+ var w, k, $, W, Y;
1718
+ const l = P(o.Date).utc(), r = ((k = (w = o.Port) == null ? void 0 : w.split("|")[1]) == null ? void 0 : k.trim()) || "", m = ((W = ($ = o.NextPort) == null ? void 0 : $.split("|")[1]) == null ? void 0 : W.trim()) || "", i = B.formatCoordinate(o.Lat, "lat"), s = B.formatCoordinate(o.Lng, "lng"), a = o.MECons_HSFO || 0, _ = (o.MECons_VLSFO || 0) + (o.MECons_ULSFO || 0), u = (o.MECons_VLSDGO || 0) + (o.MECons_ULSDGO || 0), p = o.AECons_HSFO || 0, c = (o.AECons_VLSFO || 0) + (o.AECons_ULSFO || 0), D = (o.AECons_VLSDGO || 0) + (o.AECons_ULSDGO || 0), C = o.BoilerCons_HSFO || 0, O = (o.BoilerCons_VLSFO || 0) + (o.BoilerCons_ULSFO || 0), G = (o.BoilerCons_VLSDGO || 0) + (o.BoilerCons_ULSDGO || 0), F = o.BROB_HSFO || 0, R = (o.BROB_VLSFO || 0) + (o.BROB_ULSFO || 0), y = (o.BROB_VLSDGO || 0) + (o.BROB_ULSDGO || 0), E = F + R + y;
1719
+ let x = "", U = m || "";
1720
+ o.Type === Oe && (o != null && o.Port) && (x = r || (o == null ? void 0 : o.Port)), o.Type === Re && (o != null && o.Port) && (U = r || (o == null ? void 0 : o.Port));
1721
+ const Q = {
1722
+ Date_UTC: l.format("YYYY-MM-DD"),
1723
+ Time_UTC: l.format("HH:mm"),
1724
+ IMO: o.IMO,
1725
+ Event: B.mapEvent(o.Type),
1726
+ Voyage_From: x,
1727
+ Voyage_To: U,
1728
+ Voyage_Number: o.VoyNum || ((Y = o.voyage) == null ? void 0 : Y.voyNum) || "",
1729
+ Voyage_Leg: "",
1730
+ Voyage_Type: "",
1731
+ Purposes_Of_Call: B.mapPortCallPurpose(o.PortActivity),
1732
+ Offhire_Reasons: "",
1733
+ // Time
1734
+ Time_Since_Previous_Report: o.TimeSLR || "",
1735
+ Time_Elapsed_Anchoring: "",
1736
+ Time_Elapsed_Sailing: "",
1737
+ Time_Elapsed_Drifting: "",
1738
+ Time_Elapsed_Maneuvering: "",
1739
+ Time_Elapsed_Waiting: "",
1740
+ Time_Elapsed_Loading_Unloading: "",
1741
+ Time_Elapsed_Ice: "",
1742
+ // Position
1743
+ Distance: o.DistSLR || 0,
1744
+ Latitude_North_South: i.hemisphere,
1745
+ Latitude_Degree: i.degrees,
1746
+ Latitude_Minutes: i.minutes,
1747
+ Longitude_East_West: s.hemisphere,
1748
+ Longitude_Degree: s.degrees,
1749
+ Longitude_Minutes: s.minutes,
1750
+ // Cargo
1751
+ Cargo_Mt: o.CargoWeight || "",
1752
+ Cargo_M3: "",
1753
+ Deadweight_Carried: "",
1754
+ Cargo_Total_TEU: "",
1755
+ Passengers: "",
1756
+ Crew: "",
1757
+ Reefer_20_Chilled: "",
1758
+ Reefer_40_Chilled: "",
1759
+ Reefer_20_Frozen: "",
1760
+ Reefer_40_Frozen: "",
1761
+ // Weather / schedule
1762
+ Wind_Force_Kn: "",
1763
+ Wind_Force_Bft: o.WindBF || "",
1764
+ // --- Consumption Block (Flattened) ---
1765
+ ME_Consumption_HFO: a,
1766
+ ME_Consumption_LFO: _,
1767
+ ME_Consumption_MGO: u,
1768
+ ME_Consumption_MDO: 0,
1769
+ ME_Consumption_O: "",
1770
+ ME_Consumption_O_type: "",
1771
+ ME_Consumption_LPGP: "",
1772
+ ME_Consumption_LPGB: "",
1773
+ ME_Consumption_LNG: "",
1774
+ ME_Consumption_M: "",
1775
+ ME_Consumption_E: "",
1776
+ AE_Consumption_HFO: p,
1777
+ AE_Consumption_LFO: c,
1778
+ AE_Consumption_MGO: D,
1779
+ AE_Consumption_MDO: "",
1780
+ AE_Consumption_O: "",
1781
+ AE_Consumption_O_type: "",
1782
+ AE_Consumption_LPGP: "",
1783
+ AE_Consumption_LPGB: "",
1784
+ AE_Consumption_LNG: "",
1785
+ AE_Consumption_M: "",
1786
+ AE_Consumption_E: "",
1787
+ Boiler_Consumption_HFO: C,
1788
+ Boiler_Consumption_LFO: O,
1789
+ Boiler_Consumption_MGO: G,
1790
+ Boiler_Consumption_MDO: "",
1791
+ Boiler_Consumption_O: "",
1792
+ Boiler_Consumption_O_type: "",
1793
+ Boiler_Consumption_LPGP: "",
1794
+ Boiler_Consumption_LPGB: "",
1795
+ Boiler_Consumption_LNG: "",
1796
+ Boiler_Consumption_M: "",
1797
+ Boiler_Consumption_E: "",
1798
+ // Inert Gas / Incin (Not in source, set 0)
1799
+ Inert_gas_Consumption_HFO: "",
1800
+ Inert_gas_Consumption_LFO: "",
1801
+ Inert_gas_Consumption_MGO: "",
1802
+ Inert_gas_Consumption_MDO: "",
1803
+ Inert_gas_Consumption_O: "",
1804
+ Inert_gas_Consumption_O_type: "",
1805
+ Inert_gas_Consumption_LPGP: "",
1806
+ Inert_gas_Consumption_LPGB: "",
1807
+ Inert_gas_Consumption_LNG: "",
1808
+ Inert_gas_Consumption_M: "",
1809
+ Inert_gas_Consumption_E: "",
1810
+ // ROB
1811
+ HFO_ROB: F || 0,
1812
+ LFO_ROB: R || 0,
1813
+ MGO_ROB: y || 0,
1814
+ MDO_ROB: "",
1815
+ LPGP_ROB: "",
1816
+ LPGB_ROB: "",
1817
+ LNG_ROB: "",
1818
+ Methanol_ROB: "",
1819
+ Ethanol_ROB: "",
1820
+ O_ROB: "",
1821
+ O_ROB_type: "",
1822
+ // Special Consumers
1823
+ Reefer_Work: "",
1824
+ Reefer_SFOC: "",
1825
+ Reefer_Fuel_Type: "",
1826
+ Reefer_Fuel_BDN: "",
1827
+ Cargo_Cooling_Work: "",
1828
+ Cargo_Cooling_SFOC: "",
1829
+ Cargo_Cooling_Fuel_Type: "",
1830
+ Cargo_Cooling_Fuel_BDN: "",
1831
+ Discharge_Pump_Work: "",
1832
+ Discharge_Pump_SFOC: "",
1833
+ Discharge_Pump_Fuel_Type: "",
1834
+ Discharge_Pump_Fuel_BDN: "",
1835
+ Shore_Side_Electricity_Reception: "",
1836
+ // Cargo Heating
1837
+ Cargo_heating_Consumption_HFO: "",
1838
+ Cargo_heating_Consumption_LFO: "",
1839
+ Cargo_heating_Consumption_MGO: "",
1840
+ Cargo_heating_Consumption_MDO: "",
1841
+ Cargo_heating_Consumption_LPGP: "",
1842
+ Cargo_heating_Consumption_LPGB: "",
1843
+ Cargo_heating_Consumption_LNG: "",
1844
+ Cargo_heating_Consumption_M: "",
1845
+ Cargo_heating_Consumption_E: "",
1846
+ Cargo_heating_Consumption_O: "",
1847
+ Cargo_heating_Consumption_O_type: "",
1848
+ Cargo_Heating_Consumption_BDN: "",
1849
+ Cargo_Heating_Fuel_BDN: "",
1850
+ DPP_Cargo_Pump_Consumption_MDO: "",
1851
+ DPP_Cargo_Pump_Consumption_O: "",
1852
+ DPP_Cargo_Pump_Consumption_O_type: "",
1853
+ DPP_Cargo_Pump_Consumption_BDN: "",
1854
+ DPP_Cargo_Pump_Fuel_BDN: "",
1855
+ // MRV/DCS BDN Tracking (Totals only, as specifics are unknown)
1856
+ ME_Fuel_BDN: "",
1857
+ ME_Consumption: "",
1858
+ ME_Fuel_BDN_2: "",
1859
+ ME_Consumption_BDN_2: "",
1860
+ ME_Fuel_BDN_3: "",
1861
+ ME_Consumption_BDN_3: "",
1862
+ ME_Fuel_BDN_4: "",
1863
+ ME_Consumption_BDN_4: "",
1864
+ AE_Fuel_BDN: "",
1865
+ AE_Consumption: "",
1866
+ Boiler_Consumption: "",
1867
+ DPP_Consumption: "",
1868
+ IGG_Consumption: "",
1869
+ GCU_Consumption: "",
1870
+ Incinerator_Consumption: "",
1871
+ // Extra BDN slots
1872
+ AE_Fuel_BDN_2: "",
1873
+ AE_Consumption_BDN_2: "",
1874
+ Boiler_Consumption_BDN_2: "",
1875
+ AE_Fuel_BDN_3: "",
1876
+ AE_Consumption_BDN_3: "",
1877
+ Boiler_Consumption_BDN_3: "",
1878
+ AE_Fuel_BDN_4: "",
1879
+ AE_Consumption_BDN_4: "",
1880
+ Boiler_Consumption_BDN_4: "",
1881
+ // ROB BDN slots
1882
+ ROB_Fuel_BDN: "",
1883
+ BDN_ROB: "",
1884
+ ROB_Fuel_BDN_2: "",
1885
+ BDN_2_ROB: "",
1886
+ ROB_Fuel_BDN_3: "",
1887
+ BDN_3_ROB: "",
1888
+ ROB_Fuel_BDN_4: "",
1889
+ BDN_4_ROB: "",
1890
+ ROB_Fuel_BDN_5: "",
1891
+ BDN_5_ROB: "",
1892
+ ROB_Fuel_BDN_6: "",
1893
+ BDN_6_ROB: "",
1894
+ ROB_Fuel_BDN_7: "",
1895
+ BDN_7_ROB: "",
1896
+ ROB_Fuel_BDN_8: "",
1897
+ BDN_8_ROB: "",
1898
+ ROB_Fuel_Total: E,
1899
+ Remarks: o.Remarks || ""
1900
+ };
1901
+ n.push(t.map((ee) => String(Q[ee] ?? "")));
1902
+ }), [t, ...n];
1903
+ }
1528
1904
  export {
1529
- Q as CCS_OIL_GROUPS,
1530
- _ as CCS_TM_PATTERN,
1531
- O as CcsAdjustType,
1532
- I as CcsConsumerType,
1533
- v as CcsCorrectType,
1534
- q as CcsEemsClient,
1535
- H as CcsEemsTemplate,
1536
- G as CcsExemptionType,
1537
- h as CcsIsEu,
1538
- M as CcsLoadingType,
1539
- D as CcsOilCode,
1540
- j as CcsOilNames,
1541
- b as CcsPeriodType,
1542
- B as CcsPortWork,
1543
- N as CcsRecordType,
1544
- ee as DnvOVDClient,
1545
- P as OvdEventType,
1546
- x as OvdFieldType,
1547
- w as OvdFuelType,
1548
- k as OvdInterfaceCode,
1549
- U as OvdPortCallPurpose,
1550
- W as OvdTemplate,
1551
- te as OvdTemplateV313,
1552
- X as ccsEemsTemplate
1905
+ v as CCS_OIL_GROUPS,
1906
+ _e as CCS_TM_MINUTE_PATTERN,
1907
+ L as CCS_TM_PATTERN,
1908
+ le as CcsAdjustType,
1909
+ M as CcsConsumerType,
1910
+ pe as CcsCorrectType,
1911
+ Ae as CcsEemsClient,
1912
+ X as CcsEemsTemplate,
1913
+ ue as CcsExemptionType,
1914
+ J as CcsIsEu,
1915
+ T as CcsLoadingType,
1916
+ h as CcsOilCode,
1917
+ ae as CcsOilNames,
1918
+ S as CcsOspType,
1919
+ me as CcsPeriodType,
1920
+ se as CcsPortWork,
1921
+ H as CcsRecordType,
1922
+ Ue as DnvOVDClient,
1923
+ Se as OvdEventType,
1924
+ Me as OvdFieldType,
1925
+ Ee as OvdFuelType,
1926
+ j as OvdInterfaceCode,
1927
+ Fe as OvdPortCallPurpose,
1928
+ Le as OvdTemplate,
1929
+ Be as OvdTemplateV313,
1930
+ xe as buildCcsImoVoyageData,
1931
+ He as buildCcsVoyageData,
1932
+ we as buildDnvOvdData,
1933
+ ve as ccsEemsTemplate
1553
1934
  };