@orm-plugin/ghg-data-converter 0.1.1 → 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.
@@ -1,3 +1,3 @@
1
- (function(m,p){typeof exports=="object"&&typeof module<"u"?p(exports,require("crypto-js"),require("axios"),require("moment"),require("form-data"),require("fs")):typeof define=="function"&&define.amd?define(["exports","crypto-js","axios","moment","form-data","fs"],p):(m=typeof globalThis<"u"?globalThis:m||self,p(m["idm-plugin-ghg-data-converter"]={},m.CryptoJS,m.axios,m.moment,m.FormData,m.fs))})(this,function(m,p,d,A,H,P){"use strict";var q=Object.defineProperty;var j=(m,p,d)=>p in m?q(m,p,{enumerable:!0,configurable:!0,writable:!0,value:d}):m[p]=d;var f=(m,p,d)=>(j(m,typeof p!="symbol"?p+"":p,d),d);const C={test:{report:"http://eemstest.ccs.org.cn/energyEfficiency/energyDataAccept",delete:"http://eemstest.ccs.org.cn/energyEfficiency/voyageDataDelete2CCS",cii:"http://eemstest.ccs.org.cn/energyEfficiency/energyData2CCS",imoFuel:"http://eemstest.ccs.org.cn/energyEfficiency/imoFuelData"},prod:{report:"http://eems.ccs.org.cn/energyEfficiency/energyDateAccept",delete:"http://eems.ccs.org.cn/energyEfficiency/voyageDataDelete2CCS",cii:"http://eems.ccs.org.cn/energyEfficiency/energyData2CCS",imoFuel:"http://eems.ccs.org.cn/energyEfficiency/imoFuelData"}},U="A5483FA7";class x{constructor(n){f(this,"client");f(this,"urls");if(this.options=n,this.urls=n.test?C.test:C.prod,this.client=d.create({timeout:3e4}),this.licenseType==="company"&&!n.companyLicense)throw new Error("CcsEemsClient缺少license配置");if(this.licenseType==="ship"&&!n.shipLicense)throw new Error("CcsEemsClient缺少shipLicense配置")}get licenseType(){return this.options.licenseType??"company"}generateToken(n,o){const t=p.enc.Utf8.parse(this.options.tokenKey||U),l=this.licenseType==="ship",u=`${n}${l?"S":"C"}${o??(l?this.options.shipLicense:this.options.companyLicense)}`.replace(/[^a-zA-Z0-9.\-*_]/g,a=>a===" "?"+":`%${Buffer.from(a,"utf8").toString("hex").toUpperCase()}`);return p.DES.encrypt(u,t,{iv:t,mode:p.mode.CBC,padding:p.pad.Pkcs7}).ciphertext.toString(p.enc.Hex).toUpperCase()}buildParams(n){const o=String(Date.now()),t=new FormData;return t.append("voyageData",JSON.stringify(n)),t.append("timestamp",o),t.append("token",this.generateToken(o)),this.options.companyCode&&t.append("companyCode",this.options.companyCode),t}async reportVoyageData(n){return(await this.client.post(this.urls.report,this.buildParams(n))).data}async deleteVoyageData(n){const o=String(Date.now()),t=new FormData;return t.append("voyageData",JSON.stringify({deletePorts:n})),t.append("timestamp",o),t.append("token",this.generateToken(o)),(await this.client.post(this.urls.delete,t)).data}}var y=(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))(y||{});const w={1:"高硫重燃油 HS HFO",11:"低硫重燃油 LS HFO",12:"超低硫重燃油 ULS HFO",2:"高硫轻燃油 HS LFO",21:"低硫轻燃油 LS LFO",22:"超低硫轻燃油 ULS LFO",3:"柴油/汽油 MDO/MGO",4:"液化石油气(丙烷)LPG(Propane)",5:"液化石油气(丁烷)LPG(Butane)",6:"液化天然气LNG Otto (dual fuel medium speed)",61:"液化天然气LNG Otto (dual fuel slow speed)",62:"液化天然气LNG Diesel (dual fuel slow speed)",63:"液化天然气LNG-Lean-Burn Spark-Ignited (LBSI)",7:"甲醇(化石)Methanol (fossil)",71:"氢(化石)燃料电池 H2 (fossil)-Fuel Cells",72:"氢(化石)内燃机 H2 (fossil)-ICE",73:"氨(化石)NH3 (fossil)",8:"乙醇 Ethanol",9:"生物柴油 Bio-diesel",81:"氢化植物油 HVO",82:"Bio-LNG Otto (dual fuel medium speed)",83:"Bio-LNG Otto (dual fuel slow speed)",84:"Bio-LNG Diesel (dual fuel slow speed)",85:"Bio-LNG-Lean-Burn Spark-Ignited (LBSI)",86:"Bio-methanol",87:"Other Biofuels",88:"Bio-H2— Fuel Cells",89:"Bio-H2— ICE",101:"e-diesel",102:"e-methanol",103:"e-LNG Otto (dual fuel medium speed)",104:"e-LNG Otto (dual fuel slow speed)",105:"e-LNG Diesel (dual fuel slow speed)",106:"e-LNG-Lean-Burn Spark-Ignited (LBSI)",107:"e-H2—Fuel Cells",108:"e-H2—ICE",109:"e-NH3",110:"e-LPG",111:"e-DME"},k=[{oilId:"1",fields:["BROB_HSFO"]},{oilId:"11",fields:["BROB_VLSFO"]},{oilId:"12",fields:["BROB_ULSFO"]},{oilId:"3",fields:["BROB_VLSDGO","BROB_ULSDGO"]}];var S=(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))(S||{}),g=(e=>(e.PORT="0",e.ANCHORING="1",e.DRIFTING="2",e))(g||{}),N=(e=>(e.NO="0",e.EU="1",e.UK="2",e.EU_OVERSEAS="3",e.EU_SMALL_ISLAND="4",e))(N||{}),F=(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))(F||{}),h=(e=>(e.DEPARTURE="0",e.ARRIVAL="1",e))(h||{}),L=(e=>(e.ANNUAL="0",e.ISM_CHANGE="1",e.NEW_SHIP="2",e.FLAG_CHANGE="3",e))(L||{}),R=(e=>(e.ETS="0",e.FUEL_EU="1",e.CARBON_CAPTURE="2",e))(R||{}),E=(e=>(e.SECURING_SHIP_SAFETY="1",e.SAVING_LIFE_AT_SEA="2",e.SAILING_IN_ICE="3",e))(E||{}),I=(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))(I||{});const D=/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$/,W=["AT","BE","BG","HR","CY","CZ","DK","EE","FI","FR","DE","GR","HU","IE","IT","LV","LT","LU","MT","NL","PL","PT","RO","SK","SI","ES","SE"],$={AUSTRIA:"AT",BELGIUM:"BE",BULGARIA:"BG",CROATIA:"HR",CYPRUS:"CY","CZECH REPUBLIC":"CZ",DENMARK:"DK",ESTONIA:"EE",FINLAND:"FI",FRANCE:"FR",GERMANY:"DE",GREECE:"GR",HUNGARY:"HU",IRELAND:"IE",ITALY:"IT",LATVIA:"LV",LITHUANIA:"LT",LUXEMBOURG:"LU",MALTA:"MT",NETHERLANDS:"NL",POLAND:"PL",PORTUGAL:"PT",ROMANIA:"RO",SLOVAKIA:"SK",SLOVENIA:"SI",SPAIN:"ES",SWEDEN:"SE","UNITED KINGDOM":"GB","GREAT BRITAIN":"GB",UK:"GB"},K=(e,n=2)=>String(e).padStart(n,"0");class B{parsePort(n){var a,s;if(!n)return{name:"",country:"",loCode:"",zone:null};const[o="",t="",l=""]=n.split("|").map(M=>M.trim());let r=t,u=l;/^[A-Za-z]{5}$/.test(r)||(u||(u=r),r="");const i=o.match(/^(.*?)\s*\(([^)]+)\)\s*$/);return{name:((a=i==null?void 0:i[1])==null?void 0:a.trim())||o,country:((s=i==null?void 0:i[2])==null?void 0:s.trim())||"",loCode:r.toUpperCase(),zone:u?this.parseZone(u):null}}parseZone(n){if(!n)return null;const o=Number(String(n).trim());return Number.isFinite(o)?o:null}formatLocalTime(n,o){const t=o??0;return A(n).utcOffset(t).format("YYYY-MM-DD HH:mm:ss")}formatCoordinate(n,o){const t=Number(n);if(!Number.isFinite(t))return"";const l=Math.abs(t);let r=Math.floor(l),u=Math.round((l-r)*60);u===60&&(r+=1,u=0);const i=o==="lat"?t>=0?"N":"S":t>=0?"E":"W";return`${r}°${K(u)}′ ${i}`}mapOilType(n){return{HSFO:"1",VLSFO:"11",ULSFO:"12",MDO:"3"}[n]}mapIsEu(n){const o=String(n||"").trim().toUpperCase();if(!o)return"0";const t=$[o]||o;return W.includes(t)?"1":t==="GB"||t==="UK"?"2":"0"}normalizeImo(n){return String(n??"").trim()}validate(n,o=[]){const t=(r,u,i,a)=>o.push({row:r,field:u,value:i,reason:a}),l=(n==null?void 0:n.voyagePorts)||[];return l.length||t(0,"voyagePorts",void 0,"报文中未包含有效数据(voyagePorts为空)"),l.forEach((r,u)=>{const i=u+1;r.imoNo||t(i,"imoNo",r.imoNo,"船舶识别号必填"),/^[0-9]{7,16}$/.test(r.imoNo)||t(i,"imoNo",r.imoNo,"海船应为IMO号(7位数字)"),/^[0-9a-fA-F]{32}$/.test(r.refCode)||t(i,"refCode",r.refCode,"应为32位GUID字符串"),r.firstVoyageCode||t(i,"firstVoyageCode",r.firstVoyageCode,"航次编号1必填"),r.firstVoyageCode&&r.firstVoyageCode.length>16&&t(i,"firstVoyageCode",r.firstVoyageCode,"最大长度V16"),Object.values(g).includes(r.recordType)||t(i,"recordType",r.recordType,"停泊类型枚举值不合法"),r.portid||t(i,"portid",r.portid,"港口代码必填"),r.portid&&r.recordType==="0"&&r.portid!=="000"&&r.portid.length!==5&&t(i,"portid",r.portid,"停靠港应使用国际港口5位码"),Object.values(N).includes(r.isEu)||t(i,"isEu",r.isEu,"isEu枚举值不合法"),D.test(r.arrTm||"")||t(i,"arrTm",r.arrTm,"抵港时间格式应为yyyy-mm-dd HH:MI:SS(本地时间)"),Number.isFinite(r.arrZone)||t(i,"arrZone",r.arrZone,"抵港时区必填"),D.test(r.deptTm||"")||t(i,"deptTm",r.deptTm,"离港时间格式应为yyyy-mm-dd HH:MI:SS(本地时间)"),Number.isFinite(r.deptZone)||t(i,"deptZone",r.deptZone,"离港时区必填"),["0","1"].includes(r.inPort)||t(i,"inPort",r.inPort,"港界内/外枚举值不合法"),(r.voyagePortloadings||[]).forEach((a,s)=>{Object.values(h).includes(a.loadingType)||t(i,`voyagePortloadings[${s}].loadingType`,a.loadingType,"货物信息类型枚举值不合法"),Number.isFinite(Number(a.cargoTons))||t(i,`voyagePortloadings[${s}].cargoTons`,a.cargoTons,"载货量必填")}),(r.voyagePortoils||[]).forEach((a,s)=>{Object.values(y).includes(a.oilId)||t(i,`voyagePortoils[${s}].oilId`,a.oilId,"燃油代码不正确"),Number.isFinite(Number(a.arrTons))||t(i,`voyagePortoils[${s}].arrTons`,a.arrTons,"抵港存油量必填"),Number.isFinite(Number(a.deptTons))||t(i,`voyagePortoils[${s}].deptTons`,a.deptTons,"离港存油量必填")}),(r.voyageAddoils||[]).forEach((a,s)=>{Object.values(y).includes(a.oilId)||t(i,`voyageAddoils[${s}].oilId`,a.oilId,"燃油代码不正确"),Number.isFinite(Number(a.addTons))||t(i,`voyageAddoils[${s}].addTons`,a.addTons,"加油量必填"),D.test(a.addTm||"")||t(i,`voyageAddoils[${s}].addTm`,a.addTm,"加油时间格式应为yyyy-mm-dd HH:MI:SS(本地时间)"),Number.isFinite(Number(a.viscosity))||t(i,`voyageAddoils[${s}].viscosity`,a.viscosity,"加油燃料粘度必填")}),(r.voyageOutoils||[]).forEach((a,s)=>{Object.values(y).includes(a.oilId)||t(i,`voyageOutoils[${s}].oilId`,a.oilId,"燃油代码不正确"),Number.isFinite(Number(a.outTons))||t(i,`voyageOutoils[${s}].outTons`,a.outTons,"驳出燃料量必填"),D.test(a.outTm||"")||t(i,`voyageOutoils[${s}].outTm`,a.outTm,"驳出时间格式应为yyyy-mm-dd HH:MI:SS(本地时间)")}),(r.voyageSludges||[]).forEach((a,s)=>{Number.isFinite(Number(a.sludgeTons))||t(i,`voyageSludges[${s}].sludgeTons`,a.sludgeTons,"处理油渣量必填"),D.test(a.sludgeOutTm||"")||t(i,`voyageSludges[${s}].sludgeOutTm`,a.sludgeOutTm,"油渣处理时间格式应为yyyy-mm-dd HH:MI:SS(本地时间)")})}),o}}const Y=new B;class z{constructor(n,o,t="https://ovd.veracityapp.com/api"){f(this,"client");f(this,"jwtToken",null);this.accessKey=n,this.companyId=o,this.baseUrl=t,this.client=d.create({timeout:3e4})}async authenticate(){const n="https://ovdadmin.veracityapp.com/token",o=await d.get(n,{headers:{Authorization:`Bearer ${this.accessKey}`}});return this.jwtToken=o.data,this.jwtToken}getHeaders(){return{Authorization:`Bearer ${this.jwtToken}`,"Content-Type":"application/json"}}async uploadData(n,o,t){if(o.length>1001)throw new Error("建议单次上传不超过 1000 行数据");const l={CompanyId:this.companyId,Data:{InterfaceCode:n,Data:o},Tag:t};return(await this.client.post(`${this.baseUrl}/Data/process`,l,{headers:this.getHeaders()})).data}async deleteData(n){return(await this.client.delete(`${this.baseUrl}/Data/process`,{headers:this.getHeaders(),data:{CompanyId:this.companyId,InterfaceCode:n.interfaceCode,VesselIMOs:n.vesselIMOs,UTCDateTimeFrom:n.from,UTCDateTimeTo:n.to,Tag:n.tag}})).data}async uploadDocument(n){const o=new H;o.append("File",P.createReadStream(n.filePath));const t=new URL(`${this.baseUrl}/v1/documents`);return t.searchParams.append("CompanyId",this.companyId),t.searchParams.append("VesselIMO",n.vesselIMO),t.searchParams.append("DocumentType",n.docType),n.bunkerCategory&&t.searchParams.append("BunkerDocumentCategory",n.bunkerCategory),n.bdnNumbers&&n.bdnNumbers.forEach(r=>t.searchParams.append("BdnNumbers",r)),(await this.client.post(t.toString(),o,{headers:{...this.getHeaders(),...o.getHeaders()}})).data}async checkHealth(){return(await d.get("https://ovd.veracityapp.com/health")).data.Status==="Healthy"}}var b=(e=>(e.Date="Date",e.Time="Time",e.DateTime="Date-Time",e.WholeNumber="WholeNumber",e.DecimalNumber="DecimalNumber",e.Text="Text",e))(b||{}),O=(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))(O||{}),v=(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))(v||{}),G=(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))(G||{}),V=(e=>(e.OVDLA="OVDLA",e.OVDBR="OVDBR",e))(V||{});class T{fields(n){return this.fieldDefs(n).map(o=>o.name)}formatCoordinate(n,o){const t=Math.abs(n),l=Math.floor(t),r=(t-l)*60;return{hemisphere:o==="lat"?n>=0?"N":"S":o==="lng"?n>=0?"E":"W":"",degrees:l,minutes:r.toFixed(2)}}mapEvent(n){return{NOON:"Noon (Position) - Sea passage"}[n]||n}mapPortCallPurpose(n){return{DISCHARGE:"UnloadingCargo",DISCHARGING:"UnloadingCargo",DISCH:"UnloadingCargo",UNLOAD:"UnloadingCargo",UNLOADING:"UnloadingCargo",LOAD:"LoadingCargo",LOADING:"LoadingCargo",LOADDISCHARGE:"CargoOperations","LOAD/DISCHARGE":"CargoOperations",BUNKERING:"TakingBunkers",BUNKER:"TakingBunkers",OTHER:"Miscellaneous","CANAL TRANSIT":"PassThrough",TRANSIT:"PassThrough",REPAIRS:"Repair","DRY DOCK":"RepairInDryDock","LAY UP":"LaidUp","CREW CHANGE":"ChangingCrew"}[String(n??"").trim().toUpperCase()]||""}validate(n,o="OVDLA"){const[t,...l]=n,r=new Map(this.fieldDefs(o).map(i=>[i.name,i])),u=[];return l.forEach((i,a)=>{t.forEach((s,M)=>{const _=r.get(s);if(!_)return;const c=String(i[M]??"").trim();if(c){if(_.name==="IMO"||_.rule==="exact7digits"){/^\d{7}$/.test(c)||u.push({row:a+1,field:s,value:c,reason:"must be exactly 7 digits"});return}switch(_.type){case"Date":/^\d{4}-\d{2}-\d{2}$/.test(c)||u.push({row:a+1,field:s,value:c,reason:"expected format yyyy-mm-dd"});break;case"Time":/^\d{2}:\d{2}$/.test(c)||u.push({row:a+1,field:s,value:c,reason:"expected format hh:mm"});break;case"Date-Time":/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}$/.test(c)||u.push({row:a+1,field:s,value:c,reason:"expected format yyyy-mm-dd hh:mm"});break;case"WholeNumber":/^[+-]?\d+$/.test(c)||u.push({row:a+1,field:s,value:c,reason:"expected whole number"});break;case"DecimalNumber":Number.isFinite(Number(c))||u.push({row:a+1,field:s,value:c,reason:"expected decimal number"});break;case"Text":_.maxLength&&c.length>_.maxLength&&u.push({row:a+1,field:s,value:c,reason:`exceeds max length ${_.maxLength}`}),/['"]/.test(c)&&u.push({row:a+1,field:s,value:c,reason:"single/double quotes are not allowed"});break}}})}),u}toCsv(n){const o=n.map(t=>t.map(l=>{const r=String(l);return r.includes(",")||r.includes('"')||r.includes(`
1
+ (function(p,d){typeof exports=="object"&&typeof module<"u"?d(exports,require("crypto-js"),require("axios"),require("moment"),require("form-data"),require("fs")):typeof define=="function"&&define.amd?define(["exports","crypto-js","axios","moment","form-data","fs"],d):(p=typeof globalThis<"u"?globalThis:p||self,d(p["idm-plugin-ghg-data-converter"]={},p.CryptoJS,p.axios,p.moment,p.FormData,p.fs))})(this,function(p,d,C,A,ce,de){"use strict";var Ve=Object.defineProperty;var Ae=(p,d,C)=>d in p?Ve(p,d,{enumerable:!0,configurable:!0,writable:!0,value:C}):p[d]=C;var y=(p,d,C)=>(Ae(p,typeof d!="symbol"?d+"":d,C),C);const W={test:{report:"http://eemstest.ccs.org.cn/energyEfficiency/energyDataAccept",delete:"http://eemstest.ccs.org.cn/energyEfficiency/voyageDataDelete2CCS",cii:"http://eemstest.ccs.org.cn/energyEfficiency/energyData2CCS",imoFuel:"http://eemstest.ccs.org.cn/energyEfficiency/imoFuelData"},prod:{report:"http://eems.ccs.org.cn/energyEfficiency/energyDateAccept",delete:"http://eems.ccs.org.cn/energyEfficiency/voyageDataDelete2CCS",cii:"http://eems.ccs.org.cn/energyEfficiency/energyData2CCS",imoFuel:"http://eems.ccs.org.cn/energyEfficiency/imoFuelData"}},fe="A5483FA7";class ge{constructor(n){y(this,"client");y(this,"urls");if(this.options=n,this.urls=n.test?W.test:W.prod,this.client=C.create({timeout:3e4}),this.licenseType==="company"&&!n.companyLicense)throw new Error("CcsEemsClient缺少license配置");if(this.licenseType==="ship"&&!n.shipLicense)throw new Error("CcsEemsClient缺少shipLicense配置")}get licenseType(){return this.options.licenseType??"company"}generateToken(n,o){const t=d.enc.Utf8.parse(this.options.tokenKey||fe),l=this.licenseType==="ship",m=`${n}${l?"S":"C"}${o??(l?this.options.shipLicense:this.options.companyLicense)}`.replace(/[^a-zA-Z0-9.\-*_]/g,s=>s===" "?"+":`%${Buffer.from(s,"utf8").toString("hex").toUpperCase()}`);return d.DES.encrypt(m,t,{iv:t,mode:d.mode.CBC,padding:d.pad.Pkcs7}).ciphertext.toString(d.enc.Hex).toUpperCase()}buildParams(n){const o=String(Date.now()),t=new FormData;return t.append("voyageData",JSON.stringify(n)),t.append("timestamp",o),t.append("token",this.generateToken(o)),this.options.companyCode&&t.append("companyCode",this.options.companyCode),t}async reportVoyageData(n){return(await this.client.post(this.urls.report,this.buildParams(n))).data}async reportImoFuelData(n){return(await this.client.post(this.urls.imoFuel,this.buildParams(n))).data}async deleteVoyageData(n){const o=String(Date.now()),t=new FormData;return t.append("voyageData",JSON.stringify({deletePorts:n})),t.append("timestamp",o),t.append("token",this.generateToken(o)),(await this.client.post(this.urls.delete,t)).data}}var N=(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))(N||{});const $={1:"高硫重燃油 HS HFO",11:"低硫重燃油 LS HFO",12:"超低硫重燃油 ULS HFO",2:"高硫轻燃油 HS LFO",21:"低硫轻燃油 LS LFO",22:"超低硫轻燃油 ULS LFO",3:"柴油/汽油 MDO/MGO",4:"液化石油气(丙烷)LPG(Propane)",5:"液化石油气(丁烷)LPG(Butane)",6:"液化天然气LNG Otto (dual fuel medium speed)",61:"液化天然气LNG Otto (dual fuel slow speed)",62:"液化天然气LNG Diesel (dual fuel slow speed)",63:"液化天然气LNG-Lean-Burn Spark-Ignited (LBSI)",7:"甲醇(化石)Methanol (fossil)",71:"氢(化石)燃料电池 H2 (fossil)-Fuel Cells",72:"氢(化石)内燃机 H2 (fossil)-ICE",73:"氨(化石)NH3 (fossil)",8:"乙醇 Ethanol",9:"生物柴油 Bio-diesel",81:"氢化植物油 HVO",82:"Bio-LNG Otto (dual fuel medium speed)",83:"Bio-LNG Otto (dual fuel slow speed)",84:"Bio-LNG Diesel (dual fuel slow speed)",85:"Bio-LNG-Lean-Burn Spark-Ignited (LBSI)",86:"Bio-methanol",87:"Other Biofuels",88:"Bio-H2— Fuel Cells",89:"Bio-H2— ICE",101:"e-diesel",102:"e-methanol",103:"e-LNG Otto (dual fuel medium speed)",104:"e-LNG Otto (dual fuel slow speed)",105:"e-LNG Diesel (dual fuel slow speed)",106:"e-LNG-Lean-Burn Spark-Ignited (LBSI)",107:"e-H2—Fuel Cells",108:"e-H2—ICE",109:"e-NH3",110:"e-LPG",111:"e-DME"},T=[{oilId:"1",fields:["BROB_HSFO"]},{oilId:"11",fields:["BROB_VLSFO"]},{oilId:"12",fields:["BROB_ULSFO"]},{oilId:"3",fields:["BROB_VLSDGO","BROB_ULSDGO"]}];var h=(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))(h||{}),b=(e=>(e.PORT="0",e.ANCHORING="1",e.DRIFTING="2",e))(b||{}),v=(e=>(e.NO="0",e.EU="1",e.UK="2",e.EU_OVERSEAS="3",e.EU_SMALL_ISLAND="4",e))(v||{}),Y=(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))(Y||{}),B=(e=>(e.DEPARTURE="0",e.ARRIVAL="1",e))(B||{}),K=(e=>(e.ANNUAL="0",e.ISM_CHANGE="1",e.NEW_SHIP="2",e.FLAG_CHANGE="3",e))(K||{}),z=(e=>(e.ETS="0",e.FUEL_EU="1",e.CARBON_CAPTURE="2",e))(z||{}),Z=(e=>(e.SECURING_SHIP_SAFETY="1",e.SAVING_LIFE_AT_SEA="2",e.SAILING_IN_ICE="3",e))(Z||{}),q=(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))(q||{}),M=(e=>(e.FOSP="1",e.EOSP="2",e))(M||{});const S=/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$/,j=/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}$/,De=["AT","BE","BG","HR","CY","CZ","DK","EE","FI","FR","DE","GR","HU","IE","IT","LV","LT","LU","MT","NL","PL","PT","RO","SK","SI","ES","SE"],Ce={AUSTRIA:"AT",BELGIUM:"BE",BULGARIA:"BG",CROATIA:"HR",CYPRUS:"CY","CZECH REPUBLIC":"CZ",DENMARK:"DK",ESTONIA:"EE",FINLAND:"FI",FRANCE:"FR",GERMANY:"DE",GREECE:"GR",HUNGARY:"HU",IRELAND:"IE",ITALY:"IT",LATVIA:"LV",LITHUANIA:"LT",LUXEMBOURG:"LU",MALTA:"MT",NETHERLANDS:"NL",POLAND:"PL",PORTUGAL:"PT",ROMANIA:"RO",SLOVAKIA:"SK",SLOVENIA:"SI",SPAIN:"ES",SWEDEN:"SE","UNITED KINGDOM":"GB","GREAT BRITAIN":"GB",UK:"GB"},ye=(e,n=2)=>String(e).padStart(n,"0");class H{parsePort(n){var s,a;if(!n)return{name:"",country:"",loCode:"",zone:null};const[o="",t="",l=""]=n.split("|").map(c=>c.trim());let r=t,m=l;/^[A-Za-z]{5}$/.test(r)||(m||(m=r),r="");const i=o.match(/^(.*?)\s*\(([^)]+)\)\s*$/);return{name:((s=i==null?void 0:i[1])==null?void 0:s.trim())||o,country:((a=i==null?void 0:i[2])==null?void 0:a.trim())||"",loCode:r.toUpperCase(),zone:m?this.parseZone(m):null}}parseZone(n){if(!n)return null;const o=Number(String(n).trim());return Number.isFinite(o)?o:null}formatLocalTime(n,o){const t=o??0;return A(n).utcOffset(t).format("YYYY-MM-DD HH:mm:ss")}formatLocalTimeMinute(n,o){const t=o??0;return A(n).utcOffset(t).format("YYYY-MM-DD HH:mm")}formatCoordinate(n,o){const t=Number(n);if(!Number.isFinite(t))return"";const l=Math.abs(t);let r=Math.floor(l),m=Math.round((l-r)*60);m===60&&(r+=1,m=0);const i=o==="lat"?t>=0?"N":"S":t>=0?"E":"W";return`${r}°${ye(m)}′ ${i}`}mapOilType(n){return{HSFO:"1",VLSFO:"11",ULSFO:"12",MDO:"3"}[n]}mapIsEu(n){const o=String(n||"").trim().toUpperCase();if(!o)return"0";const t=Ce[o]||o;return De.includes(t)?"1":t==="GB"||t==="UK"?"2":"0"}normalizeImo(n){return String(n??"").trim()}validate(n,o=[]){const t=(r,m,i,s)=>o.push({row:r,field:m,value:i,reason:s}),l=(n==null?void 0:n.voyagePorts)||[];return l.length||t(0,"voyagePorts",void 0,"报文中未包含有效数据(voyagePorts为空)"),l.forEach((r,m)=>{const i=m+1;r.imoNo||t(i,"imoNo",r.imoNo,"船舶识别号必填"),/^[0-9]{7,16}$/.test(r.imoNo)||t(i,"imoNo",r.imoNo,"海船应为IMO号(7位数字)"),/^[0-9a-fA-F]{32}$/.test(r.refCode)||t(i,"refCode",r.refCode,"应为32位GUID字符串"),r.firstVoyageCode||t(i,"firstVoyageCode",r.firstVoyageCode,"航次编号1必填"),r.firstVoyageCode&&r.firstVoyageCode.length>16&&t(i,"firstVoyageCode",r.firstVoyageCode,"最大长度V16"),Object.values(b).includes(r.recordType)||t(i,"recordType",r.recordType,"停泊类型枚举值不合法"),r.portid||t(i,"portid",r.portid,"港口代码必填"),r.portid&&r.recordType==="0"&&r.portid!=="000"&&r.portid.length!==5&&t(i,"portid",r.portid,"停靠港应使用国际港口5位码"),Object.values(v).includes(r.isEu)||t(i,"isEu",r.isEu,"isEu枚举值不合法"),S.test(r.arrTm||"")||t(i,"arrTm",r.arrTm,"抵港时间格式应为yyyy-mm-dd HH:MI:SS(本地时间)"),Number.isFinite(r.arrZone)||t(i,"arrZone",r.arrZone,"抵港时区必填"),S.test(r.deptTm||"")||t(i,"deptTm",r.deptTm,"离港时间格式应为yyyy-mm-dd HH:MI:SS(本地时间)"),Number.isFinite(r.deptZone)||t(i,"deptZone",r.deptZone,"离港时区必填"),["0","1"].includes(r.inPort)||t(i,"inPort",r.inPort,"港界内/外枚举值不合法"),(r.voyagePortloadings||[]).forEach((s,a)=>{Object.values(B).includes(s.loadingType)||t(i,`voyagePortloadings[${a}].loadingType`,s.loadingType,"货物信息类型枚举值不合法"),Number.isFinite(Number(s.cargoTons))||t(i,`voyagePortloadings[${a}].cargoTons`,s.cargoTons,"载货量必填")}),(r.voyagePortoils||[]).forEach((s,a)=>{Object.values(N).includes(s.oilId)||t(i,`voyagePortoils[${a}].oilId`,s.oilId,"燃油代码不正确"),Number.isFinite(Number(s.arrTons))||t(i,`voyagePortoils[${a}].arrTons`,s.arrTons,"抵港存油量必填"),Number.isFinite(Number(s.deptTons))||t(i,`voyagePortoils[${a}].deptTons`,s.deptTons,"离港存油量必填")}),(r.voyageAddoils||[]).forEach((s,a)=>{Object.values(N).includes(s.oilId)||t(i,`voyageAddoils[${a}].oilId`,s.oilId,"燃油代码不正确"),Number.isFinite(Number(s.addTons))||t(i,`voyageAddoils[${a}].addTons`,s.addTons,"加油量必填"),S.test(s.addTm||"")||t(i,`voyageAddoils[${a}].addTm`,s.addTm,"加油时间格式应为yyyy-mm-dd HH:MI:SS(本地时间)"),Number.isFinite(Number(s.viscosity))||t(i,`voyageAddoils[${a}].viscosity`,s.viscosity,"加油燃料粘度必填")}),(r.voyageOutoils||[]).forEach((s,a)=>{Object.values(N).includes(s.oilId)||t(i,`voyageOutoils[${a}].oilId`,s.oilId,"燃油代码不正确"),Number.isFinite(Number(s.outTons))||t(i,`voyageOutoils[${a}].outTons`,s.outTons,"驳出燃料量必填"),S.test(s.outTm||"")||t(i,`voyageOutoils[${a}].outTm`,s.outTm,"驳出时间格式应为yyyy-mm-dd HH:MI:SS(本地时间)")}),(r.voyageSludges||[]).forEach((s,a)=>{Number.isFinite(Number(s.sludgeTons))||t(i,`voyageSludges[${a}].sludgeTons`,s.sludgeTons,"处理油渣量必填"),S.test(s.sludgeOutTm||"")||t(i,`voyageSludges[${a}].sludgeOutTm`,s.sludgeOutTm,"油渣处理时间格式应为yyyy-mm-dd HH:MI:SS(本地时间)")})}),o}validateImo(n,o=[]){const t=(i,s,a,c)=>o.push({row:i,field:s,value:a,reason:c}),l=(n==null?void 0:n.voyageInfos)||[];l.length||t(0,"voyageInfos",void 0,"报文中未包含有效数据(voyageInfos为空)");const r=/^\d{1,3}°\d{2}′ [NS]$/,m=/^\d{1,3}°\d{2}′ [EW]$/;return l.forEach((i,s)=>{const a=s+1;i.imoNo||t(a,"imoNo",i.imoNo,"船舶识别号必填"),/^[0-9]{7,16}$/.test(i.imoNo||"")||t(a,"imoNo",i.imoNo,"海船应为IMO号(7位数字)"),/^[0-9a-fA-F]{32}$/.test(i.refCode||"")||t(a,"refCode",i.refCode,"应为32位GUID字符串"),j.test(i.ospTm||"")||t(a,"ospTm",i.ospTm,"定速时间格式应为yyyy-mm-dd HH:MI(本地时间)"),Number.isFinite(i.ospZone)||t(a,"ospZone",i.ospZone,"定速时区必填"),Object.values(M).includes(i.ospType)||t(a,"ospType",i.ospType,"定速类型枚举值不合法"),m.test(i.longitude||"")||t(a,"longitude",i.longitude,"经度格式应为39°54′ E/W"),r.test(i.latitude||"")||t(a,"latitude",i.latitude,"纬度格式应为39°54′ N/S"),i.distance!==void 0&&(!Number.isFinite(i.distance)||i.distance<0)&&t(a,"distance",i.distance,"定速航行距离应为非负数字"),(i.voyagePortoils||[]).forEach((u,_)=>{Object.values(N).includes(u.oilId)||t(a,`voyagePortoils[${_}].oilId`,u.oilId,"燃油代码不正确"),(!Number.isFinite(Number(u.stockTons))||Number(u.stockTons)<0)&&t(a,`voyagePortoils[${_}].stockTons`,u.stockTons,"存油量应为非负数字")});const c=new Set;(i.fuelConsumers||[]).forEach((u,_)=>{Object.values(h).includes(u.consumerType)||t(a,`fuelConsumers[${_}].consumerType`,u.consumerType,"排放源类型枚举值不合法"),Object.values(N).includes(u.oilId)||t(a,`fuelConsumers[${_}].oilId`,u.oilId,"燃油代码不正确"),(!Number.isFinite(Number(u.oilTons))||Number(u.oilTons)<0)&&t(a,`fuelConsumers[${_}].oilTons`,u.oilTons,"燃油消耗量应为非负数字");const f=`${u.consumerType}:${u.oilId}`;c.has(f)&&t(a,`fuelConsumers[${_}]`,f,"同一排放源与燃油种类重复"),c.add(f)})}),o}}const Ne=new H,g=new H,U="BOSP",G="EOSP",he="NOON",Me=[{consumerType:h.MAIN_ENGINES,prefix:"MECons"},{consumerType:h.AUXILIARY_ENGINES,prefix:"AECons"},{consumerType:h.BOILERS,prefix:"BoilerCons"},{consumerType:h.INCINERATOR,prefix:"INCINCons"}],X=T.map(({oilId:e,fields:n})=>({oilId:e,suffixes:n.map(o=>o.replace(/^BROB_/,""))})),D=(e,n=2)=>Number(Number(e||0).toFixed(n)),J=e=>d.MD5(e).toString(),Q=(e,n)=>e==null||e===""?"":g.formatCoordinate(e,n);function x(e,n,o,t,l){const r=g.parsePort(n==null?void 0:n.Port),m=o?g.parsePort((o==null?void 0:o.Port)||(n==null?void 0:n.Port)):r,i=g.normalizeImo(n==null?void 0:n.IMO),s=g.formatLocalTime(n==null?void 0:n.Date,r.zone),a=o?g.formatLocalTime(o==null?void 0:o.Date,m.zone):s,c=r.zone??g.parseZone(n==null?void 0:n.Offset)??0,u=m.zone??c,_=l,f=_,E=T.map(({oilId:F,fields:P})=>{const k=$[F],R=D(P.reduce((L,I)=>L+((n==null?void 0:n[I])||0),0)),V=o?D(P.reduce((L,I)=>L+((o==null?void 0:o[I])||0),0)):R;return{oilId:F,oilName:k,arrTons:R,deptTons:V,correctTons:0,correctTm:null}});return{imoNo:i,refCode:J(`${e}:${i}:${s}`),firstVoyageCode:_,secondVoyageCode:f,recordType:b.PORT,portid:r.loCode||"000",porten:r.name,isEu:g.mapIsEu(r.country),arrTm:s,arrZone:c,deptTm:a,deptZone:u,distance:D(t),inPort:"0",shorePower:[{power:0}],voyagePortloadings:[{loadingType:B.ARRIVAL,cargoTons:D(n==null?void 0:n.CargoWeight),ballastTons:D(n==null?void 0:n.Ballast),allBoxNum:0,heavyBoxNum:0,refContainer20Num:0,refContainer40Num:0,peopleNum:0,carsNum:0},{loadingType:B.DEPARTURE,cargoTons:D((o==null?void 0:o.CargoWeight)??(n==null?void 0:n.CargoWeight)),ballastTons:D((o==null?void 0:o.Ballast)??(n==null?void 0:n.Ballast)),allBoxNum:0,heavyBoxNum:0,refContainer20Num:0,refContainer40Num:0,peopleNum:0,carsNum:0}],voyagePortoils:E,voyageAddoils:[],voyageOutoils:[],voyageSludges:[]}}function Ee(e,n,o={}){var i,s;if(!n.length)return{voyagePorts:[]};const t=o.voyageCode??((s=(i=n[0])==null?void 0:i.voyage)==null?void 0:s.number)??"",l=[];let r=null,m=0;for(const a of n)a.Type===G&&a.Port?(r&&l.push(x(e,r,null,m,t)),r=a,m+=a.DistSLR||0):a.Type===he?m+=a.DistSLR||0:a.Type===U&&a.Port&&(l.push(x(e,r||a,a,m,t)),r=null,m=0);return r&&l.push(x(e,r,null,m,t)),{voyagePorts:l}}function Se(e){return T.map(({oilId:n,fields:o})=>({oilId:n,addBillNo:"",stockTons:D(o.reduce((t,l)=>t+((e==null?void 0:e[l])||0),0))})).filter(n=>n.stockTons>0)}function Fe(e,n,o,t,l,r){const m=new Date(o==null?void 0:o.Date).getTime();if(!Number.isFinite(m))return e.map(u=>({row:u,factor:1}));const i=Date.UTC(new Date(m).getUTCFullYear(),0,1),s=new Date(n==null?void 0:n.Date).getTime();if(!Number.isFinite(s)||s>=i)return e.map(u=>({row:u,factor:1}));const a=[];let c=s;for(const u of e){const _=new Date(u.Date).getTime();if(!Number.isFinite(_)){a.push({row:u,factor:1});continue}const f=_<=i?0:c>=i?1:(_-i)/(_-c);f>0&&a.push({row:u,factor:f}),c=_}return a.some(({factor:u})=>u<1)&&(r==null||r("[CCS IMO] 航次 %s 的%s跨年,fuelConsumers仅统计%s UTC之后区间,边界船报按时间线性拆分",t,l===M.EOSP?"EOSP":"FOSP",g.formatLocalTimeMinute(new Date(i),0))),a}function Le(e,n,o){const t=[];for(const{consumerType:r,prefix:m}of Me)for(const{oilId:i,suffixes:s}of X){const a=D(e.reduce((c,{row:u,factor:_})=>c+s.reduce((f,E)=>f+((u==null?void 0:u[`${m}_${E}`])||0)*_,0),0));a>0&&t.push({consumerType:r,oilId:i,oilTons:a})}const l=D(e.reduce((r,{row:m,factor:i})=>r+X.reduce((s,{suffixes:a})=>s+a.reduce((c,u)=>c+((m==null?void 0:m[`OtherCons_${u}`])||0)*i,0),0),0));return l>0&&(o==null||o("[CCS IMO] 航次 %s 的OtherCons消耗 %s 吨无对应CCS排放源类型,未上报",n,l)),t}function Be(e,n,o,t,l,r){const m=g.parsePort(n==null?void 0:n.Port),i=g.parseZone(n==null?void 0:n.Offset),s=m.zone??i??0;m.zone===null&&i===null&&(r==null||r("[CCS IMO] 航次 %s 的%s缺少港口时区与Offset,按0时区上报",e,o));const a=g.normalizeImo(n==null?void 0:n.IMO),c=g.formatLocalTimeMinute(n==null?void 0:n.Date,s),u=t&&l?Fe(t,l,n,e,o,r):[],_=o===M.EOSP&&t?u.reduce((f,{row:E,factor:F})=>f+(E.DistSLR||0)*F,0):void 0;return{imoNo:a,refCode:J(`${e}:${a}:${o}:${c}`),ospTm:c,ospZone:s,ospType:o,pointType:"",longitude:Q(n==null?void 0:n.Lng,"lng"),latitude:Q(n==null?void 0:n.Lat,"lat"),..._!==void 0?{distance:D(_)}:{},voyagePortoils:Se(n),fuelConsumers:Le(u,e,r)}}function Oe(e,n,o={}){const{warn:t}=o,l=[];let r=-1,m=null;return n.forEach((i,s)=>{if(i.Type!==U&&i.Type!==G)return;const a=i.Type===G,c=a?M.EOSP:M.FOSP,u=a?U:G;let _=null;r>=0&&m===u?_=n.slice(r+1,s+1):t==null||t("[CCS IMO] 航次 %s 的%s缺少前序%s,跳过fuelConsumers",e,c,u);const f=_?n[r]:null;l.push(Be(e,i,c,_,f,t)),r=s,m=i.Type}),{voyageInfos:l}}class Re{constructor(n,o,t="https://ovd.veracityapp.com/api"){y(this,"client");y(this,"jwtToken",null);this.accessKey=n,this.companyId=o,this.baseUrl=t,this.client=C.create({timeout:3e4})}async authenticate(){const n="https://ovdadmin.veracityapp.com/token",o=await C.get(n,{headers:{Authorization:`Bearer ${this.accessKey}`}});return this.jwtToken=o.data,this.jwtToken}getHeaders(){return{Authorization:`Bearer ${this.jwtToken}`,"Content-Type":"application/json"}}async uploadData(n,o,t){if(o.length>1001)throw new Error("建议单次上传不超过 1000 行数据");const l={CompanyId:this.companyId,Data:{InterfaceCode:n,Data:o},Tag:t};return(await this.client.post(`${this.baseUrl}/Data/process`,l,{headers:this.getHeaders()})).data}async deleteData(n){return(await this.client.delete(`${this.baseUrl}/Data/process`,{headers:this.getHeaders(),data:{CompanyId:this.companyId,InterfaceCode:n.interfaceCode,VesselIMOs:n.vesselIMOs,UTCDateTimeFrom:n.from,UTCDateTimeTo:n.to,Tag:n.tag}})).data}async uploadDocument(n){const o=new ce;o.append("File",de.createReadStream(n.filePath));const t=new URL(`${this.baseUrl}/v1/documents`);return t.searchParams.append("CompanyId",this.companyId),t.searchParams.append("VesselIMO",n.vesselIMO),t.searchParams.append("DocumentType",n.docType),n.bunkerCategory&&t.searchParams.append("BunkerDocumentCategory",n.bunkerCategory),n.bdnNumbers&&n.bdnNumbers.forEach(r=>t.searchParams.append("BdnNumbers",r)),(await this.client.post(t.toString(),o,{headers:{...this.getHeaders(),...o.getHeaders()}})).data}async checkHealth(){return(await C.get("https://ovd.veracityapp.com/health")).data.Status==="Healthy"}}var ee=(e=>(e.Date="Date",e.Time="Time",e.DateTime="Date-Time",e.WholeNumber="WholeNumber",e.DecimalNumber="DecimalNumber",e.Text="Text",e))(ee||{}),te=(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))(te||{}),ne=(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))(ne||{}),oe=(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))(oe||{}),w=(e=>(e.OVDLA="OVDLA",e.OVDBR="OVDBR",e))(w||{});class re{fields(n){return this.fieldDefs(n).map(o=>o.name)}formatCoordinate(n,o){const t=Math.abs(n),l=Math.floor(t),r=(t-l)*60;return{hemisphere:o==="lat"?n>=0?"N":"S":o==="lng"?n>=0?"E":"W":"",degrees:l,minutes:r.toFixed(2)}}mapEvent(n){return{NOON:"Noon (Position) - Sea passage"}[n]||n}mapPortCallPurpose(n){return{DISCHARGE:"UnloadingCargo",DISCHARGING:"UnloadingCargo",DISCH:"UnloadingCargo",UNLOAD:"UnloadingCargo",UNLOADING:"UnloadingCargo",LOAD:"LoadingCargo",LOADING:"LoadingCargo",LOADDISCHARGE:"CargoOperations","LOAD/DISCHARGE":"CargoOperations",BUNKERING:"TakingBunkers",BUNKER:"TakingBunkers",OTHER:"Miscellaneous","CANAL TRANSIT":"PassThrough",TRANSIT:"PassThrough",REPAIRS:"Repair","DRY DOCK":"RepairInDryDock","LAY UP":"LaidUp","CREW CHANGE":"ChangingCrew"}[String(n??"").trim().toUpperCase()]||""}validate(n,o="OVDLA"){const[t,...l]=n,r=new Map(this.fieldDefs(o).map(i=>[i.name,i])),m=[];return l.forEach((i,s)=>{t.forEach((a,c)=>{const u=r.get(a);if(!u)return;const _=String(i[c]??"").trim();if(_){if(u.name==="IMO"||u.rule==="exact7digits"){/^\d{7}$/.test(_)||m.push({row:s+1,field:a,value:_,reason:"must be exactly 7 digits"});return}switch(u.type){case"Date":/^\d{4}-\d{2}-\d{2}$/.test(_)||m.push({row:s+1,field:a,value:_,reason:"expected format yyyy-mm-dd"});break;case"Time":/^\d{2}:\d{2}$/.test(_)||m.push({row:s+1,field:a,value:_,reason:"expected format hh:mm"});break;case"Date-Time":/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}$/.test(_)||m.push({row:s+1,field:a,value:_,reason:"expected format yyyy-mm-dd hh:mm"});break;case"WholeNumber":/^[+-]?\d+$/.test(_)||m.push({row:s+1,field:a,value:_,reason:"expected whole number"});break;case"DecimalNumber":Number.isFinite(Number(_))||m.push({row:s+1,field:a,value:_,reason:"expected decimal number"});break;case"Text":u.maxLength&&_.length>u.maxLength&&m.push({row:s+1,field:a,value:_,reason:`exceeds max length ${u.maxLength}`}),/['"]/.test(_)&&m.push({row:s+1,field:a,value:_,reason:"single/double quotes are not allowed"});break}}})}),m}toCsv(n){const o=n.map(t=>t.map(l=>{const r=String(l);return r.includes(",")||r.includes('"')||r.includes(`
2
2
  `)?`"${r.replace(/"/g,'""')}"`:r}).join(",")).join(`
3
- `);return Buffer.from(o,"utf-8")}}class Z extends T{constructor(){super(...arguments);f(this,"version","3.13");f(this,"logAbstractDefs",[{name:"Date_UTC",type:"Date",relevantFor:"mandatory for MRV&DCS",mandatory:!0,description:"UTC date"},{name:"Time_UTC",type:"Time",unit:"hh:mm",relevantFor:"mandatory for MRV&DCS",mandatory:!0,description:"UTC time"},{name:"IMO",type:"WholeNumber",rule:"exact7digits",relevantFor:"mandatory for MRV&DCS",mandatory:!0,description:"IMO Number"},{name:"Event",type:"Text",maxLength:30,relevantFor:"mandatory for MRV&DCS",description:'Reported event , see additional sheet "Event types"'},{name:"Voyage_From",type:"Text",maxLength:5,unit:"UN/LOCODE",relevantFor:"mandatory for MRV&DCS",description:"From - port code (Departure port)"},{name:"Voyage_To",type:"Text",maxLength:5,unit:"UN/LOCODE",relevantFor:"mandatory for MRV&DCS",description:"To - port code (Arrival port)"},{name:"Voyage_Number",type:"Text",maxLength:30,relevantFor:"recommended for voyage level verfication schemes",description:"Name or number"},{name:"Voyage_Leg",type:"Text",maxLength:500,relevantFor:"out of scope for GHG verification"},{name:"Voyage_Type",type:"Text",maxLength:30,relevantFor:"for CII correction",description:"E.g. STS (in context of DCS CII Correction Factors), one way, round trip, idle"},{name:"Purposes_Of_Call",type:"Text",maxLength:100,relevantFor:"mandatory for MRV&DCS",description:'Primary purposes of a port call. For supported purposes/keywords see additonal sheet "Port call purposes". Serveral purposes can be separeted by a comma (,). To be reported for each Departure event.'},{name:"Offhire_Reasons",type:"Text",maxLength:100,relevantFor:"for CII correction, voluntary wrt MRV",description:"Please see notes on GHG reporting for details"},{name:"Time_Since_Previous_Report",type:"DecimalNumber",unit:"h",relevantFor:"mandatory for MRV&DCS",mandatory:!0},{name:"Time_Elapsed_Anchoring",type:"DecimalNumber",unit:"h",relevantFor:"mandatory for MRV&DCS",description:"Time at anchor"},{name:"Time_Elapsed_Sailing",type:"DecimalNumber",unit:"h",relevantFor:"DSC only, voluntary wrt MRV",description:"Sailing"},{name:"Time_Elapsed_Drifting",type:"DecimalNumber",unit:"h",relevantFor:"recommended for MRV&DCS",description:"Drifting"},{name:"Time_Elapsed_Maneuvering",type:"DecimalNumber",unit:"h",relevantFor:"recommended for MRV&DCS",description:"Maneuvering"},{name:"Time_Elapsed_Waiting",type:"DecimalNumber",unit:"h",relevantFor:"not in use",description:"Waiting"},{name:"Time_Elapsed_Loading_Unloading",type:"DecimalNumber",unit:"h",relevantFor:"mandatory for MRV",description:"Loading/ Unloading"},{name:"Time_Elapsed_Ice",type:"DecimalNumber",unit:"h",relevantFor:"for CII correction, voluntary wrt MRV",description:"Operating in ice"},{name:"Distance",type:"DecimalNumber",unit:"NM",relevantFor:"mandatory for MRV&DCS"},{name:"Latitude_North_South",type:"Text",maxLength:5,relevantFor:"mandatory for MRV&DCS",description:"North / South"},{name:"Latitude_Degree",type:"WholeNumber",unit:"°",relevantFor:"mandatory for MRV&DCS",description:"Degrees"},{name:"Latitude_Minutes",type:"DecimalNumber",unit:"'",relevantFor:"mandatory for MRV&DCS",description:"Minutes"},{name:"Longitude_East_West",type:"Text",maxLength:5,relevantFor:"mandatory for MRV&DCS",description:"East / West"},{name:"Longitude_Degree",type:"WholeNumber",unit:"°",relevantFor:"mandatory for MRV&DCS",description:"Degrees"},{name:"Longitude_Minutes",type:"DecimalNumber",unit:"'",relevantFor:"mandatory for MRV&DCS",description:"Minutes"},{name:"Cargo_Mt",type:"DecimalNumber",unit:"mt",relevantFor:"mandatory for MRV&DCS",description:"Weight of cargo in mt"},{name:"Cargo_M3",type:"DecimalNumber",unit:"m3",relevantFor:"mandatory for MRV&DCS",description:"Volume of cargo in cubic meters"},{name:"Deadweight_Carried",type:"DecimalNumber",unit:"mt",relevantFor:"mandatory for MRV&DCS",description:"Deadweight carried as per MRV (i.e. excl. bunkers)"},{name:"Cargo_Total_TEU",type:"WholeNumber",unit:"TEU",relevantFor:"DSC only, voluntary wrt MRV",description:"Total"},{name:"Passengers",type:"WholeNumber",relevantFor:"mandatory for MRV&DCS",description:"Number of passengers"},{name:"Crew",type:"WholeNumber",relevantFor:"mandatory for MRV&DCS",description:"Crew"},{name:"Reefer_20_Chilled",type:"WholeNumber",relevantFor:"for CII correction",description:"Reefer 20 ft. Chilled"},{name:"Reefer_40_Chilled",type:"WholeNumber",relevantFor:"for CII correction",description:"Reefer 40 ft. chilled"},{name:"Reefer_20_Frozen",type:"WholeNumber",relevantFor:"for CII correction",description:"Reefer 20 ft. Frozen"},{name:"Reefer_40_Frozen",type:"WholeNumber",relevantFor:"for CII correction",description:"Reefer 40 ft. Frozen"},{name:"Wind_Force_Kn",type:"DecimalNumber",unit:"kn",relevantFor:"out of scope for GHG verification",description:"Speed"},{name:"Wind_Force_Bft",type:"WholeNumber",unit:"Bft",relevantFor:"out of scope for GHG verification",description:"Force"},{name:"ME_Consumption_HFO",type:"DecimalNumber",unit:"mt",relevantFor:"mandatory for MRV&DCS",description:"ME HFO consumption"},{name:"ME_Consumption_LFO",type:"DecimalNumber",unit:"mt",relevantFor:"mandatory for MRV&DCS",description:"ME LFO consumption"},{name:"ME_Consumption_MGO",type:"DecimalNumber",unit:"mt",relevantFor:"mandatory for MRV&DCS",description:"ME MGO consumption"},{name:"ME_Consumption_MDO",type:"DecimalNumber",unit:"mt",relevantFor:"mandatory for MRV&DCS",description:"ME MDO consumption"},{name:"ME_Consumption_O",type:"DecimalNumber",unit:"mt",relevantFor:"mandatory for MRV&DCS",description:"ME other fuels consumption"},{name:"ME_Consumption_O_type",type:"Text",maxLength:30,relevantFor:"mandatory for MRV&DCS",description:"ME other fuels type"},{name:"ME_Consumption_LPGP",type:"DecimalNumber",unit:"mt",relevantFor:"mandatory for MRV&DCS",description:"ME LPG Propane consumption"},{name:"ME_Consumption_LPGB",type:"DecimalNumber",unit:"mt",relevantFor:"mandatory for MRV&DCS",description:"ME LPG Butane consumption"},{name:"ME_Consumption_LNG",type:"DecimalNumber",unit:"mt",relevantFor:"mandatory for MRV&DCS",description:"ME LNG consumption"},{name:"ME_Consumption_M",type:"DecimalNumber",unit:"mt",relevantFor:"mandatory for MRV&DCS",description:"ME Methanol consumption"},{name:"ME_Consumption_E",type:"DecimalNumber",unit:"mt",relevantFor:"mandatory for MRV&DCS",description:"ME Ethanol consumption"},{name:"AE_Consumption_HFO",type:"DecimalNumber",unit:"mt",relevantFor:"mandatory for MRV&DCS",description:"AE HFO consumption"},{name:"AE_Consumption_LFO",type:"DecimalNumber",unit:"mt",relevantFor:"mandatory for MRV&DCS",description:"AE LFO consumption"},{name:"AE_Consumption_MGO",type:"DecimalNumber",unit:"mt",relevantFor:"mandatory for MRV&DCS",description:"AE MGO consumption"},{name:"AE_Consumption_MDO",type:"DecimalNumber",unit:"mt",relevantFor:"mandatory for MRV&DCS",description:"AE MDO consumption"},{name:"AE_Consumption_O",type:"DecimalNumber",unit:"mt",relevantFor:"mandatory for MRV&DCS",description:"AE other fuels consumption"},{name:"AE_Consumption_O_type",type:"Text",maxLength:30,relevantFor:"mandatory for MRV&DCS",description:"AE other fuels type"},{name:"AE_Consumption_LPGP",type:"DecimalNumber",unit:"mt",relevantFor:"mandatory for MRV&DCS",description:"AE LPG Propane consumption"},{name:"AE_Consumption_LPGB",type:"DecimalNumber",unit:"mt",relevantFor:"mandatory for MRV&DCS",description:"AE LPG Butane consumption"},{name:"AE_Consumption_LNG",type:"DecimalNumber",unit:"mt",relevantFor:"mandatory for MRV&DCS",description:"AE LNG consumption"},{name:"AE_Consumption_M",type:"DecimalNumber",unit:"mt",relevantFor:"mandatory for MRV&DCS",description:"AE Methanol consumption"},{name:"AE_Consumption_E",type:"DecimalNumber",unit:"mt",relevantFor:"mandatory for MRV&DCS",description:"AE Ethanol consumption"},{name:"Boiler_Consumption_HFO",type:"DecimalNumber",unit:"mt",relevantFor:"mandatory for MRV&DCS",description:"Boiler HFO consumption"},{name:"Boiler_Consumption_LFO",type:"DecimalNumber",unit:"mt",relevantFor:"mandatory for MRV&DCS",description:"Boiler LFO consumption"},{name:"Boiler_Consumption_MGO",type:"DecimalNumber",unit:"mt",relevantFor:"mandatory for MRV&DCS",description:"Boiler MGO consumption"},{name:"Boiler_Consumption_MDO",type:"DecimalNumber",unit:"mt",relevantFor:"mandatory for MRV&DCS",description:"Boiler MDO consumption"},{name:"Boiler_Consumption_O",type:"DecimalNumber",unit:"mt",relevantFor:"mandatory for MRV&DCS",description:"Boiler other fuels consumption"},{name:"Boiler_Consumption_O_type",type:"Text",maxLength:30,relevantFor:"mandatory for MRV&DCS",description:"Boiler other fuels type"},{name:"Boiler_Consumption_LPGP",type:"DecimalNumber",unit:"mt",relevantFor:"mandatory for MRV&DCS",description:"Boiler LPG Propane consumption"},{name:"Boiler_Consumption_LPGB",type:"DecimalNumber",unit:"mt",relevantFor:"mandatory for MRV&DCS",description:"Boiler LPG Butane consumption"},{name:"Boiler_Consumption_LNG",type:"DecimalNumber",unit:"mt",relevantFor:"mandatory for MRV&DCS",description:"Boiler LNG consumption"},{name:"Boiler_Consumption_M",type:"DecimalNumber",unit:"mt",relevantFor:"mandatory for MRV&DCS",description:"Boiler Methanol consumption"},{name:"Boiler_Consumption_E",type:"DecimalNumber",unit:"mt",relevantFor:"mandatory for MRV&DCS",description:"Boiler Ethanol consumption"},{name:"Inert_gas_Consumption_HFO",type:"DecimalNumber",unit:"mt",relevantFor:"mandatory for MRV&DCS",description:"Inert_gas_Consumption_HFO"},{name:"Inert_gas_Consumption_LFO",type:"DecimalNumber",unit:"mt",relevantFor:"mandatory for MRV&DCS",description:"Inert_gas_Consumption_LFO"},{name:"Inert_gas_Consumption_MGO",type:"DecimalNumber",unit:"mt",relevantFor:"mandatory for MRV&DCS",description:"Inert_gas_Consumption_MGO"},{name:"Inert_gas_Consumption_MDO",type:"DecimalNumber",unit:"mt",relevantFor:"mandatory for MRV&DCS",description:"Inert_gas_Consumption_MDO"},{name:"Inert_gas_Consumption_O",type:"DecimalNumber",unit:"mt",relevantFor:"mandatory for MRV&DCS",description:"Inert_gas_Consumption_O"},{name:"Inert_gas_Consumption_O_type",type:"Text",maxLength:30,relevantFor:"mandatory for MRV&DCS",description:"Inert_gas_Consumption_O_type"},{name:"Inert_gas_Consumption_LPGP",type:"DecimalNumber",unit:"mt",relevantFor:"mandatory for MRV&DCS",description:"Inert_gas_Consumption_LPGP"},{name:"Inert_gas_Consumption_LPGB",type:"DecimalNumber",unit:"mt",relevantFor:"mandatory for MRV&DCS",description:"Inert_gas_Consumption_LPGB"},{name:"Inert_gas_Consumption_LNG",type:"DecimalNumber",unit:"mt",relevantFor:"mandatory for MRV&DCS",description:"Inert_gas_Consumption_LNG"},{name:"Inert_gas_Consumption_M",type:"DecimalNumber",unit:"mt",relevantFor:"mandatory for MRV&DCS",description:"Inert_gas_Consumption_M"},{name:"Inert_gas_Consumption_E",type:"DecimalNumber",unit:"mt",relevantFor:"mandatory for MRV&DCS",description:"Inert_gas_Consumption_E"},{name:"HFO_ROB",type:"DecimalNumber",unit:"MT",relevantFor:"mandatory for MRV&DCS",description:"HFO"},{name:"LFO_ROB",type:"DecimalNumber",unit:"MT",relevantFor:"mandatory for MRV&DCS",description:"LFO"},{name:"MGO_ROB",type:"DecimalNumber",unit:"MT",relevantFor:"mandatory for MRV&DCS",description:"MGO"},{name:"MDO_ROB",type:"DecimalNumber",unit:"MT",relevantFor:"mandatory for MRV&DCS",description:"MDO"},{name:"LPGP_ROB",type:"DecimalNumber",unit:"MT",relevantFor:"mandatory for MRV&DCS",description:"LPG Propane"},{name:"LPGB_ROB",type:"DecimalNumber",unit:"MT",relevantFor:"mandatory for MRV&DCS",description:"LPG Butane"},{name:"LNG_ROB",type:"DecimalNumber",unit:"MT",relevantFor:"mandatory for MRV&DCS",description:"LNG"},{name:"Methanol_ROB",type:"DecimalNumber",unit:"MT",relevantFor:"mandatory for MRV&DCS",description:"Methanol"},{name:"Ethanol_ROB",type:"DecimalNumber",unit:"MT",relevantFor:"mandatory for MRV&DCS",description:"Ethanol"},{name:"O_ROB",type:"DecimalNumber",unit:"MT",relevantFor:"mandatory for MRV&DCS",description:"Other fuel"},{name:"O_ROB_type",type:"Text",maxLength:30,relevantFor:"mandatory for MRV&DCS",description:"Other fuel type"},{name:"Reefer_Work",type:"DecimalNumber",unit:"kWh",relevantFor:"for CII correction, voluntary wrt MRV",description:"Work"},{name:"Reefer_SFOC",type:"DecimalNumber",unit:"g/kWh",relevantFor:"for CII correction, voluntary wrt MRV",description:"SFOC"},{name:"Reefer_Fuel_Type",type:"Text",maxLength:30,relevantFor:"for CII correction, voluntary wrt MRV",description:"Fuel type"},{name:"Reefer_Fuel_BDN",type:"Text",maxLength:50,relevantFor:"for CII correction, voluntary wrt MRV",description:"Fuel BDN"},{name:"Cargo_Cooling_Work",type:"DecimalNumber",unit:"kWh",relevantFor:"for CII correction, voluntary wrt MRV",description:"Work"},{name:"Cargo_Cooling_SFOC",type:"DecimalNumber",unit:"g/kWh",relevantFor:"for CII correction, voluntary wrt MRV",description:"SFOC"},{name:"Cargo_Cooling_Fuel_Type",type:"Text",maxLength:30,relevantFor:"for CII correction, voluntary wrt MRV",description:"Fuel type"},{name:"Cargo_Cooling_Fuel_BDN",type:"Text",maxLength:50,relevantFor:"for CII correction, voluntary wrt MRV",description:"Fuel BDN"},{name:"Discharge_Pump_Work",type:"DecimalNumber",unit:"kWh",relevantFor:"for CII correction, voluntary wrt MRV",description:"Work"},{name:"Discharge_Pump_SFOC",type:"DecimalNumber",unit:"g/kWh",relevantFor:"for CII correction, voluntary wrt MRV",description:"SFOC"},{name:"Discharge_Pump_Fuel_Type",type:"Text",maxLength:30,relevantFor:"for CII correction, voluntary wrt MRV",description:"Fuel type"},{name:"Discharge_Pump_Fuel_BDN",type:"Text",maxLength:50,relevantFor:"for CII correction, voluntary wrt MRV",description:"Fuel BDN"},{name:"Shore_Side_Electricity_Reception",type:"DecimalNumber",unit:"kWh",relevantFor:"mandatory for FEUM and in case of no fuel consumption for any verification",description:"Work"},{name:"Cargo_heating_Consumption_HFO",type:"DecimalNumber",unit:"mt",relevantFor:"for CII correction, voluntary wrt MRV",description:"Cargo heating HFO consumption"},{name:"Cargo_heating_Consumption_LFO",type:"DecimalNumber",unit:"mt",relevantFor:"for CII correction, voluntary wrt MRV",description:"Cargo heating LFO consumption"},{name:"Cargo_heating_Consumption_MGO",type:"DecimalNumber",unit:"mt",relevantFor:"for CII correction, voluntary wrt MRV",description:"Cargo heating MGO consumption"},{name:"Cargo_heating_Consumption_MDO",type:"DecimalNumber",unit:"mt",relevantFor:"for CII correction, voluntary wrt MRV",description:"Cargo heating MDO consumption"},{name:"Cargo_heating_Consumption_LPGP",type:"DecimalNumber",unit:"mt",relevantFor:"for CII correction, voluntary wrt MRV",description:"Cargo heating LPG Propane consumption"},{name:"Cargo_heating_Consumption_LPGB",type:"DecimalNumber",unit:"mt",relevantFor:"for CII correction, voluntary wrt MRV",description:"Cargo heating LPG Butane consumption"},{name:"Cargo_heating_Consumption_LNG",type:"DecimalNumber",unit:"mt",relevantFor:"for CII correction, voluntary wrt MRV",description:"Cargo heating LNG consumption"},{name:"Cargo_heating_Consumption_M",type:"DecimalNumber",unit:"mt",relevantFor:"for CII correction, voluntary wrt MRV",description:"Cargo heating Methanol consumption"},{name:"Cargo_heating_Consumption_E",type:"DecimalNumber",unit:"mt",relevantFor:"for CII correction, voluntary wrt MRV",description:"Cargo heating Ethanol consumption"},{name:"Cargo_heating_Consumption_O",type:"DecimalNumber",unit:"mt",relevantFor:"for CII correction, voluntary wrt MRV",description:"Cargo heating other fuels consumption"},{name:"Cargo_heating_Consumption_O_type",type:"Text",maxLength:30,relevantFor:"for CII correction, voluntary wrt MRV",description:"Cargo heating other fuels type"},{name:"Cargo_Heating_Consumption_BDN",type:"DecimalNumber",unit:"mt",relevantFor:"for CII correction, voluntary wrt MRV",description:"Cargo heating consumption"},{name:"Cargo_Heating_Fuel_BDN",type:"Text",maxLength:50,relevantFor:"for CII correction, voluntary wrt MRV",description:"Fuel BDN used for cargo heating consumption"},{name:"DPP_Cargo_Pump_Consumption_MDO",type:"DecimalNumber",unit:"mt",relevantFor:"for CII correction, voluntary wrt MRV",description:"DPP cargo pump MDO consumption"},{name:"DPP_Cargo_Pump_Consumption_O",type:"DecimalNumber",unit:"mt",relevantFor:"for CII correction, voluntary wrt MRV",description:"DPP cargo pump other fuels consumption"},{name:"DPP_Cargo_Pump_Consumption_O_type",type:"Text",maxLength:30,relevantFor:"for CII correction, voluntary wrt MRV",description:"DPP cargo pump other fuels consumption"},{name:"DPP_Cargo_Pump_Consumption_BDN",type:"DecimalNumber",unit:"mt",relevantFor:"for CII correction, voluntary wrt MRV",description:"DPP cargo pump consumption"},{name:"DPP_Cargo_Pump_Fuel_BDN",type:"Text",maxLength:50,relevantFor:"for CII correction, voluntary wrt MRV",description:"Fuel BDN used for DPP consumption"},{name:"ME_Fuel_BDN",type:"Text",maxLength:50,relevantFor:"mandatory for MRV&DCS",mandatory:!0,description:"Primary fuel"},{name:"ME_Consumption",type:"DecimalNumber",unit:"mt",relevantFor:"mandatory for MRV&DCS",description:"Consumption (sum of all MEs) primary fuel"},{name:"ME_Fuel_BDN_2",type:"Text",maxLength:50,relevantFor:"optional input",description:"2nd fuel"},{name:"ME_Consumption_BDN_2",type:"DecimalNumber",unit:"mt",relevantFor:"optional input",description:"Consumption (sum of all MEs) 2nd fuel"},{name:"ME_Fuel_BDN_3",type:"Text",maxLength:50,relevantFor:"optional input",description:"3rd fuel"},{name:"ME_Consumption_BDN_3",type:"DecimalNumber",unit:"mt",relevantFor:"optional input",description:"Consumption (sum of all MEs) 3rd fuel"},{name:"ME_Fuel_BDN_4",type:"Text",maxLength:50,relevantFor:"optional input",description:"4th fuel"},{name:"ME_Consumption_BDN_4",type:"DecimalNumber",unit:"mt",relevantFor:"optional input",description:"Consumption (sum of all MEs) 4th fuel"},{name:"AE_Fuel_BDN",type:"Text",maxLength:50,relevantFor:"mandatory for MRV&DCS",mandatory:!0,description:"Primary fuel"},{name:"AE_Consumption",type:"DecimalNumber",unit:"mt",relevantFor:"mandatory for MRV&DCS",description:"Consumption (sum of all AEs) primary fuel"},{name:"Boiler_Consumption",type:"DecimalNumber",unit:"mt",relevantFor:"mandatory for MRV&DCS",description:"Boiler consumption (sum of all boilers)"},{name:"DPP_Consumption",type:"DecimalNumber",unit:"mt",relevantFor:"mandatory for MRV&DCS",description:"Consumption (sum of all DPPs) primary fuel"},{name:"IGG_Consumption",type:"DecimalNumber",unit:"mt",relevantFor:"mandatory for MRV&DCS",description:"Consumption (sum of all IGGs) primary fuel"},{name:"GCU_Consumption",type:"DecimalNumber",unit:"mt",relevantFor:"mandatory for MRV&DCS",description:"Consumption (sum of all GCUs) primary fuel"},{name:"Incinerator_Consumption",type:"DecimalNumber",unit:"mt",relevantFor:"mandatory for MRV&DCS",description:"Consumption (sum of all Incinerators) primary fuel"},{name:"AE_Fuel_BDN_2",type:"Text",maxLength:50,relevantFor:"optional input",description:"2nd fuel"},{name:"AE_Consumption_BDN_2",type:"DecimalNumber",unit:"mt",relevantFor:"optional input",description:"Consumption (sum of all AEs) 2nd fuel"},{name:"Boiler_Consumption_BDN_2",type:"DecimalNumber",unit:"mt",relevantFor:"optional input",description:"Consumption (sum of all boilers) 2nd fuel"},{name:"AE_Fuel_BDN_3",type:"Text",maxLength:50,relevantFor:"optional input",description:"3rd fuel"},{name:"AE_Consumption_BDN_3",type:"DecimalNumber",unit:"mt",relevantFor:"optional input",description:"Consumption (sum of all AEs) 3rd fuel"},{name:"Boiler_Consumption_BDN_3",type:"DecimalNumber",unit:"mt",relevantFor:"optional input",description:"Consumption (sum of all boilers) 3rd fuel"},{name:"AE_Fuel_BDN_4",type:"Text",maxLength:50,relevantFor:"optional input",description:"4th fuel"},{name:"AE_Consumption_BDN_4",type:"DecimalNumber",unit:"mt",relevantFor:"optional input",description:"Consumption (sum of all AEs) 4th fuel"},{name:"Boiler_Consumption_BDN_4",type:"DecimalNumber",unit:"mt",relevantFor:"optional input",description:"Consumption (sum of all boilers) 4th fuel"},{name:"ROB_Fuel_BDN",type:"Text",maxLength:50,relevantFor:"mandatory for MRV&DCS",mandatory:!0,description:"Reference number (BDN) from bunker reporting for the fuel used since last report"},{name:"BDN_ROB",type:"DecimalNumber",unit:"MT",relevantFor:"mandatory for MRV&DCS",description:"Only data fields for the fuels actually used since last report need to be included."},{name:"ROB_Fuel_BDN_2",type:"Text",maxLength:50,relevantFor:"optional input"},{name:"BDN_2_ROB",type:"DecimalNumber",unit:"MT",relevantFor:"optional input"},{name:"ROB_Fuel_BDN_3",type:"Text",maxLength:50,relevantFor:"optional input"},{name:"BDN_3_ROB",type:"DecimalNumber",unit:"MT",relevantFor:"optional input"},{name:"ROB_Fuel_BDN_4",type:"Text",maxLength:50,relevantFor:"optional input"},{name:"BDN_4_ROB",type:"DecimalNumber",unit:"MT",relevantFor:"optional input"},{name:"ROB_Fuel_BDN_5",type:"Text",maxLength:50,relevantFor:"optional input"},{name:"BDN_5_ROB",type:"DecimalNumber",unit:"MT",relevantFor:"optional input"},{name:"ROB_Fuel_BDN_6",type:"Text",maxLength:50,relevantFor:"optional input"},{name:"BDN_6_ROB",type:"DecimalNumber",unit:"MT",relevantFor:"optional input"},{name:"ROB_Fuel_BDN_7",type:"Text",maxLength:50,relevantFor:"optional input"},{name:"BDN_7_ROB",type:"DecimalNumber",unit:"MT",relevantFor:"optional input"},{name:"ROB_Fuel_BDN_8",type:"Text",maxLength:50,relevantFor:"optional input"},{name:"BDN_8_ROB",type:"DecimalNumber",unit:"MT",relevantFor:"optional input"},{name:"ROB_Fuel_Total",type:"DecimalNumber",unit:"MT",relevantFor:"mandatory for MRV&DCS",description:"Total fuel ROB (sum of all fuel masses onboard at the event time)"},{name:"Remarks",type:"Text",maxLength:250,relevantFor:"out of scope for GHG verification",description:"Any comment/note/explanation to be recorded"}]);f(this,"bunkerReportDefs",[{name:"IMO",type:"WholeNumber",rule:"exact7digits",relevantFor:"mandatory for MRV&DCS",mandatory:!0,description:"IMO number"},{name:"BDN_Number",type:"Text",maxLength:50,relevantFor:"mandatory for MRV&DCS",mandatory:!0,description:"Bunker Delivery Note Number"},{name:"Used_By_BDN",type:"Text",maxLength:50,unit:"-",relevantFor:"out of scope for GHG verification",mandatory:!0,description:"BDN number of the resulting fuel blend."},{name:"Coming_From_BDN",type:"Text",maxLength:50,relevantFor:"out of scope for GHG verification",mandatory:!0,description:"BDN number of parent fuel"},{name:"Bunker_Delivery_Date",type:"Date",relevantFor:"mandatory for MRV&DCS",mandatory:!0,description:"Bunker Delivery Date"},{name:"Bunker_Delivery_Time",type:"Time",relevantFor:"mandatory for MRV&DCS",mandatory:!0,description:"Bunker Delivery Time"},{name:"Fuel_Type",type:"Text",maxLength:30,relevantFor:"mandatory for MRV&DCS",mandatory:!0,description:"Fuel Type"},{name:"Mass",type:"DecimalNumber",unit:"mt",relevantFor:"mandatory for MRV&DCS",mandatory:!0,description:"Mass"},{name:"EU_Lower_Calorific_Value",type:"DecimalNumber",unit:"MJ/kg",relevantFor:"Mandatory for biofuels for FuelEU Maritime",description:"Lower Calorific Value (EU)"},{name:"EU_GHG_Intensity",type:"DecimalNumber",unit:"gCO2eq/MJ",relevantFor:"Mandatory for biofuels and e-fuels for FuelEU Maritime",description:"EU GHG emission intensity"},{name:"Sustainability",type:"Text",maxLength:256,relevantFor:"Mandatory for biofuels for MRV/DCS and FuelEU Maritime",description:"Sustainability"},{name:"Lower_Heating_Value",type:"DecimalNumber",unit:"MJ/kg",relevantFor:"Mandatory for biofuels for DCS",description:"Lower heating value"},{name:"IMO_GHG_Intensity",type:"DecimalNumber",unit:"gCO2eq/MJ",relevantFor:"Mandatory for biofuels under IMO DCS/CII scheme until LCA guidelines are applied in IMO reporting scheme",description:"IMO GHG emission intensity"},{name:"FLL_Energy_Share",type:"DecimalNumber",unit:"%",relevantFor:"out of scope for GHG verification",description:"Energy share in fuel blend"},{name:"IMO_Fuel_Pathway_Code",type:"Text",maxLength:50,relevantFor:"out of scope for GHG verification",description:"Fuel pathway code"},{name:"Density_At_15dg",type:"DecimalNumber",unit:"mt/m³",relevantFor:"out of scope for GHG verification",description:"Density @ 15 °C"},{name:"Sulphur_Content",type:"DecimalNumber",unit:"% m/m",relevantFor:"out of scope for GHG verification",description:"Sulphur Content"},{name:"Viscosity",type:"DecimalNumber",unit:"cSt",relevantFor:"out of scope for GHG verification",description:"Viscosity"},{name:"Water_Content",type:"DecimalNumber",unit:"% V/V",relevantFor:"out of scope for GHG verification",description:"Water content"},{name:"Higher_Heating_Value",type:"DecimalNumber",unit:"MJ/kg",relevantFor:"out of scope for GHG verification",description:"Higher heating value"},{name:"Bunker_Port",type:"Text",maxLength:5,unit:"UN/LOCODE",relevantFor:"out of scope for GHG verification",description:"Bunker port"},{name:"Grade",type:"Text",maxLength:10,relevantFor:"out of scope for GHG verification",description:"Grade"},{name:"TtW_CO2_CF",type:"DecimalNumber",unit:"gCO2/g",relevantFor:"out of scope for GHG verification",description:"Tank-to-Wake CO2 conversion factor"}])}fieldDefs(o){return o==="OVDBR"?this.bunkerReportDefs:this.logAbstractDefs}}m.CCS_OIL_GROUPS=k,m.CCS_TM_PATTERN=D,m.CcsAdjustType=E,m.CcsConsumerType=S,m.CcsCorrectType=I,m.CcsEemsClient=x,m.CcsEemsTemplate=B,m.CcsExemptionType=R,m.CcsIsEu=N,m.CcsLoadingType=h,m.CcsOilCode=y,m.CcsOilNames=w,m.CcsPeriodType=L,m.CcsPortWork=F,m.CcsRecordType=g,m.DnvOVDClient=z,m.OvdEventType=O,m.OvdFieldType=b,m.OvdFuelType=G,m.OvdInterfaceCode=V,m.OvdPortCallPurpose=v,m.OvdTemplate=T,m.OvdTemplateV313=Z,m.ccsEemsTemplate=Y,Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})});
3
+ `);return Buffer.from(o,"utf-8")}}class ie extends re{constructor(){super(...arguments);y(this,"version","3.13");y(this,"logAbstractDefs",[{name:"Date_UTC",type:"Date",relevantFor:"mandatory for MRV&DCS",mandatory:!0,description:"UTC date"},{name:"Time_UTC",type:"Time",unit:"hh:mm",relevantFor:"mandatory for MRV&DCS",mandatory:!0,description:"UTC time"},{name:"IMO",type:"WholeNumber",rule:"exact7digits",relevantFor:"mandatory for MRV&DCS",mandatory:!0,description:"IMO Number"},{name:"Event",type:"Text",maxLength:30,relevantFor:"mandatory for MRV&DCS",description:'Reported event , see additional sheet "Event types"'},{name:"Voyage_From",type:"Text",maxLength:5,unit:"UN/LOCODE",relevantFor:"mandatory for MRV&DCS",description:"From - port code (Departure port)"},{name:"Voyage_To",type:"Text",maxLength:5,unit:"UN/LOCODE",relevantFor:"mandatory for MRV&DCS",description:"To - port code (Arrival port)"},{name:"Voyage_Number",type:"Text",maxLength:30,relevantFor:"recommended for voyage level verfication schemes",description:"Name or number"},{name:"Voyage_Leg",type:"Text",maxLength:500,relevantFor:"out of scope for GHG verification"},{name:"Voyage_Type",type:"Text",maxLength:30,relevantFor:"for CII correction",description:"E.g. STS (in context of DCS CII Correction Factors), one way, round trip, idle"},{name:"Purposes_Of_Call",type:"Text",maxLength:100,relevantFor:"mandatory for MRV&DCS",description:'Primary purposes of a port call. For supported purposes/keywords see additonal sheet "Port call purposes". Serveral purposes can be separeted by a comma (,). To be reported for each Departure event.'},{name:"Offhire_Reasons",type:"Text",maxLength:100,relevantFor:"for CII correction, voluntary wrt MRV",description:"Please see notes on GHG reporting for details"},{name:"Time_Since_Previous_Report",type:"DecimalNumber",unit:"h",relevantFor:"mandatory for MRV&DCS",mandatory:!0},{name:"Time_Elapsed_Anchoring",type:"DecimalNumber",unit:"h",relevantFor:"mandatory for MRV&DCS",description:"Time at anchor"},{name:"Time_Elapsed_Sailing",type:"DecimalNumber",unit:"h",relevantFor:"DSC only, voluntary wrt MRV",description:"Sailing"},{name:"Time_Elapsed_Drifting",type:"DecimalNumber",unit:"h",relevantFor:"recommended for MRV&DCS",description:"Drifting"},{name:"Time_Elapsed_Maneuvering",type:"DecimalNumber",unit:"h",relevantFor:"recommended for MRV&DCS",description:"Maneuvering"},{name:"Time_Elapsed_Waiting",type:"DecimalNumber",unit:"h",relevantFor:"not in use",description:"Waiting"},{name:"Time_Elapsed_Loading_Unloading",type:"DecimalNumber",unit:"h",relevantFor:"mandatory for MRV",description:"Loading/ Unloading"},{name:"Time_Elapsed_Ice",type:"DecimalNumber",unit:"h",relevantFor:"for CII correction, voluntary wrt MRV",description:"Operating in ice"},{name:"Distance",type:"DecimalNumber",unit:"NM",relevantFor:"mandatory for MRV&DCS"},{name:"Latitude_North_South",type:"Text",maxLength:5,relevantFor:"mandatory for MRV&DCS",description:"North / South"},{name:"Latitude_Degree",type:"WholeNumber",unit:"°",relevantFor:"mandatory for MRV&DCS",description:"Degrees"},{name:"Latitude_Minutes",type:"DecimalNumber",unit:"'",relevantFor:"mandatory for MRV&DCS",description:"Minutes"},{name:"Longitude_East_West",type:"Text",maxLength:5,relevantFor:"mandatory for MRV&DCS",description:"East / West"},{name:"Longitude_Degree",type:"WholeNumber",unit:"°",relevantFor:"mandatory for MRV&DCS",description:"Degrees"},{name:"Longitude_Minutes",type:"DecimalNumber",unit:"'",relevantFor:"mandatory for MRV&DCS",description:"Minutes"},{name:"Cargo_Mt",type:"DecimalNumber",unit:"mt",relevantFor:"mandatory for MRV&DCS",description:"Weight of cargo in mt"},{name:"Cargo_M3",type:"DecimalNumber",unit:"m3",relevantFor:"mandatory for MRV&DCS",description:"Volume of cargo in cubic meters"},{name:"Deadweight_Carried",type:"DecimalNumber",unit:"mt",relevantFor:"mandatory for MRV&DCS",description:"Deadweight carried as per MRV (i.e. excl. bunkers)"},{name:"Cargo_Total_TEU",type:"WholeNumber",unit:"TEU",relevantFor:"DSC only, voluntary wrt MRV",description:"Total"},{name:"Passengers",type:"WholeNumber",relevantFor:"mandatory for MRV&DCS",description:"Number of passengers"},{name:"Crew",type:"WholeNumber",relevantFor:"mandatory for MRV&DCS",description:"Crew"},{name:"Reefer_20_Chilled",type:"WholeNumber",relevantFor:"for CII correction",description:"Reefer 20 ft. Chilled"},{name:"Reefer_40_Chilled",type:"WholeNumber",relevantFor:"for CII correction",description:"Reefer 40 ft. chilled"},{name:"Reefer_20_Frozen",type:"WholeNumber",relevantFor:"for CII correction",description:"Reefer 20 ft. Frozen"},{name:"Reefer_40_Frozen",type:"WholeNumber",relevantFor:"for CII correction",description:"Reefer 40 ft. Frozen"},{name:"Wind_Force_Kn",type:"DecimalNumber",unit:"kn",relevantFor:"out of scope for GHG verification",description:"Speed"},{name:"Wind_Force_Bft",type:"WholeNumber",unit:"Bft",relevantFor:"out of scope for GHG verification",description:"Force"},{name:"ME_Consumption_HFO",type:"DecimalNumber",unit:"mt",relevantFor:"mandatory for MRV&DCS",description:"ME HFO consumption"},{name:"ME_Consumption_LFO",type:"DecimalNumber",unit:"mt",relevantFor:"mandatory for MRV&DCS",description:"ME LFO consumption"},{name:"ME_Consumption_MGO",type:"DecimalNumber",unit:"mt",relevantFor:"mandatory for MRV&DCS",description:"ME MGO consumption"},{name:"ME_Consumption_MDO",type:"DecimalNumber",unit:"mt",relevantFor:"mandatory for MRV&DCS",description:"ME MDO consumption"},{name:"ME_Consumption_O",type:"DecimalNumber",unit:"mt",relevantFor:"mandatory for MRV&DCS",description:"ME other fuels consumption"},{name:"ME_Consumption_O_type",type:"Text",maxLength:30,relevantFor:"mandatory for MRV&DCS",description:"ME other fuels type"},{name:"ME_Consumption_LPGP",type:"DecimalNumber",unit:"mt",relevantFor:"mandatory for MRV&DCS",description:"ME LPG Propane consumption"},{name:"ME_Consumption_LPGB",type:"DecimalNumber",unit:"mt",relevantFor:"mandatory for MRV&DCS",description:"ME LPG Butane consumption"},{name:"ME_Consumption_LNG",type:"DecimalNumber",unit:"mt",relevantFor:"mandatory for MRV&DCS",description:"ME LNG consumption"},{name:"ME_Consumption_M",type:"DecimalNumber",unit:"mt",relevantFor:"mandatory for MRV&DCS",description:"ME Methanol consumption"},{name:"ME_Consumption_E",type:"DecimalNumber",unit:"mt",relevantFor:"mandatory for MRV&DCS",description:"ME Ethanol consumption"},{name:"AE_Consumption_HFO",type:"DecimalNumber",unit:"mt",relevantFor:"mandatory for MRV&DCS",description:"AE HFO consumption"},{name:"AE_Consumption_LFO",type:"DecimalNumber",unit:"mt",relevantFor:"mandatory for MRV&DCS",description:"AE LFO consumption"},{name:"AE_Consumption_MGO",type:"DecimalNumber",unit:"mt",relevantFor:"mandatory for MRV&DCS",description:"AE MGO consumption"},{name:"AE_Consumption_MDO",type:"DecimalNumber",unit:"mt",relevantFor:"mandatory for MRV&DCS",description:"AE MDO consumption"},{name:"AE_Consumption_O",type:"DecimalNumber",unit:"mt",relevantFor:"mandatory for MRV&DCS",description:"AE other fuels consumption"},{name:"AE_Consumption_O_type",type:"Text",maxLength:30,relevantFor:"mandatory for MRV&DCS",description:"AE other fuels type"},{name:"AE_Consumption_LPGP",type:"DecimalNumber",unit:"mt",relevantFor:"mandatory for MRV&DCS",description:"AE LPG Propane consumption"},{name:"AE_Consumption_LPGB",type:"DecimalNumber",unit:"mt",relevantFor:"mandatory for MRV&DCS",description:"AE LPG Butane consumption"},{name:"AE_Consumption_LNG",type:"DecimalNumber",unit:"mt",relevantFor:"mandatory for MRV&DCS",description:"AE LNG consumption"},{name:"AE_Consumption_M",type:"DecimalNumber",unit:"mt",relevantFor:"mandatory for MRV&DCS",description:"AE Methanol consumption"},{name:"AE_Consumption_E",type:"DecimalNumber",unit:"mt",relevantFor:"mandatory for MRV&DCS",description:"AE Ethanol consumption"},{name:"Boiler_Consumption_HFO",type:"DecimalNumber",unit:"mt",relevantFor:"mandatory for MRV&DCS",description:"Boiler HFO consumption"},{name:"Boiler_Consumption_LFO",type:"DecimalNumber",unit:"mt",relevantFor:"mandatory for MRV&DCS",description:"Boiler LFO consumption"},{name:"Boiler_Consumption_MGO",type:"DecimalNumber",unit:"mt",relevantFor:"mandatory for MRV&DCS",description:"Boiler MGO consumption"},{name:"Boiler_Consumption_MDO",type:"DecimalNumber",unit:"mt",relevantFor:"mandatory for MRV&DCS",description:"Boiler MDO consumption"},{name:"Boiler_Consumption_O",type:"DecimalNumber",unit:"mt",relevantFor:"mandatory for MRV&DCS",description:"Boiler other fuels consumption"},{name:"Boiler_Consumption_O_type",type:"Text",maxLength:30,relevantFor:"mandatory for MRV&DCS",description:"Boiler other fuels type"},{name:"Boiler_Consumption_LPGP",type:"DecimalNumber",unit:"mt",relevantFor:"mandatory for MRV&DCS",description:"Boiler LPG Propane consumption"},{name:"Boiler_Consumption_LPGB",type:"DecimalNumber",unit:"mt",relevantFor:"mandatory for MRV&DCS",description:"Boiler LPG Butane consumption"},{name:"Boiler_Consumption_LNG",type:"DecimalNumber",unit:"mt",relevantFor:"mandatory for MRV&DCS",description:"Boiler LNG consumption"},{name:"Boiler_Consumption_M",type:"DecimalNumber",unit:"mt",relevantFor:"mandatory for MRV&DCS",description:"Boiler Methanol consumption"},{name:"Boiler_Consumption_E",type:"DecimalNumber",unit:"mt",relevantFor:"mandatory for MRV&DCS",description:"Boiler Ethanol consumption"},{name:"Inert_gas_Consumption_HFO",type:"DecimalNumber",unit:"mt",relevantFor:"mandatory for MRV&DCS",description:"Inert_gas_Consumption_HFO"},{name:"Inert_gas_Consumption_LFO",type:"DecimalNumber",unit:"mt",relevantFor:"mandatory for MRV&DCS",description:"Inert_gas_Consumption_LFO"},{name:"Inert_gas_Consumption_MGO",type:"DecimalNumber",unit:"mt",relevantFor:"mandatory for MRV&DCS",description:"Inert_gas_Consumption_MGO"},{name:"Inert_gas_Consumption_MDO",type:"DecimalNumber",unit:"mt",relevantFor:"mandatory for MRV&DCS",description:"Inert_gas_Consumption_MDO"},{name:"Inert_gas_Consumption_O",type:"DecimalNumber",unit:"mt",relevantFor:"mandatory for MRV&DCS",description:"Inert_gas_Consumption_O"},{name:"Inert_gas_Consumption_O_type",type:"Text",maxLength:30,relevantFor:"mandatory for MRV&DCS",description:"Inert_gas_Consumption_O_type"},{name:"Inert_gas_Consumption_LPGP",type:"DecimalNumber",unit:"mt",relevantFor:"mandatory for MRV&DCS",description:"Inert_gas_Consumption_LPGP"},{name:"Inert_gas_Consumption_LPGB",type:"DecimalNumber",unit:"mt",relevantFor:"mandatory for MRV&DCS",description:"Inert_gas_Consumption_LPGB"},{name:"Inert_gas_Consumption_LNG",type:"DecimalNumber",unit:"mt",relevantFor:"mandatory for MRV&DCS",description:"Inert_gas_Consumption_LNG"},{name:"Inert_gas_Consumption_M",type:"DecimalNumber",unit:"mt",relevantFor:"mandatory for MRV&DCS",description:"Inert_gas_Consumption_M"},{name:"Inert_gas_Consumption_E",type:"DecimalNumber",unit:"mt",relevantFor:"mandatory for MRV&DCS",description:"Inert_gas_Consumption_E"},{name:"HFO_ROB",type:"DecimalNumber",unit:"MT",relevantFor:"mandatory for MRV&DCS",description:"HFO"},{name:"LFO_ROB",type:"DecimalNumber",unit:"MT",relevantFor:"mandatory for MRV&DCS",description:"LFO"},{name:"MGO_ROB",type:"DecimalNumber",unit:"MT",relevantFor:"mandatory for MRV&DCS",description:"MGO"},{name:"MDO_ROB",type:"DecimalNumber",unit:"MT",relevantFor:"mandatory for MRV&DCS",description:"MDO"},{name:"LPGP_ROB",type:"DecimalNumber",unit:"MT",relevantFor:"mandatory for MRV&DCS",description:"LPG Propane"},{name:"LPGB_ROB",type:"DecimalNumber",unit:"MT",relevantFor:"mandatory for MRV&DCS",description:"LPG Butane"},{name:"LNG_ROB",type:"DecimalNumber",unit:"MT",relevantFor:"mandatory for MRV&DCS",description:"LNG"},{name:"Methanol_ROB",type:"DecimalNumber",unit:"MT",relevantFor:"mandatory for MRV&DCS",description:"Methanol"},{name:"Ethanol_ROB",type:"DecimalNumber",unit:"MT",relevantFor:"mandatory for MRV&DCS",description:"Ethanol"},{name:"O_ROB",type:"DecimalNumber",unit:"MT",relevantFor:"mandatory for MRV&DCS",description:"Other fuel"},{name:"O_ROB_type",type:"Text",maxLength:30,relevantFor:"mandatory for MRV&DCS",description:"Other fuel type"},{name:"Reefer_Work",type:"DecimalNumber",unit:"kWh",relevantFor:"for CII correction, voluntary wrt MRV",description:"Work"},{name:"Reefer_SFOC",type:"DecimalNumber",unit:"g/kWh",relevantFor:"for CII correction, voluntary wrt MRV",description:"SFOC"},{name:"Reefer_Fuel_Type",type:"Text",maxLength:30,relevantFor:"for CII correction, voluntary wrt MRV",description:"Fuel type"},{name:"Reefer_Fuel_BDN",type:"Text",maxLength:50,relevantFor:"for CII correction, voluntary wrt MRV",description:"Fuel BDN"},{name:"Cargo_Cooling_Work",type:"DecimalNumber",unit:"kWh",relevantFor:"for CII correction, voluntary wrt MRV",description:"Work"},{name:"Cargo_Cooling_SFOC",type:"DecimalNumber",unit:"g/kWh",relevantFor:"for CII correction, voluntary wrt MRV",description:"SFOC"},{name:"Cargo_Cooling_Fuel_Type",type:"Text",maxLength:30,relevantFor:"for CII correction, voluntary wrt MRV",description:"Fuel type"},{name:"Cargo_Cooling_Fuel_BDN",type:"Text",maxLength:50,relevantFor:"for CII correction, voluntary wrt MRV",description:"Fuel BDN"},{name:"Discharge_Pump_Work",type:"DecimalNumber",unit:"kWh",relevantFor:"for CII correction, voluntary wrt MRV",description:"Work"},{name:"Discharge_Pump_SFOC",type:"DecimalNumber",unit:"g/kWh",relevantFor:"for CII correction, voluntary wrt MRV",description:"SFOC"},{name:"Discharge_Pump_Fuel_Type",type:"Text",maxLength:30,relevantFor:"for CII correction, voluntary wrt MRV",description:"Fuel type"},{name:"Discharge_Pump_Fuel_BDN",type:"Text",maxLength:50,relevantFor:"for CII correction, voluntary wrt MRV",description:"Fuel BDN"},{name:"Shore_Side_Electricity_Reception",type:"DecimalNumber",unit:"kWh",relevantFor:"mandatory for FEUM and in case of no fuel consumption for any verification",description:"Work"},{name:"Cargo_heating_Consumption_HFO",type:"DecimalNumber",unit:"mt",relevantFor:"for CII correction, voluntary wrt MRV",description:"Cargo heating HFO consumption"},{name:"Cargo_heating_Consumption_LFO",type:"DecimalNumber",unit:"mt",relevantFor:"for CII correction, voluntary wrt MRV",description:"Cargo heating LFO consumption"},{name:"Cargo_heating_Consumption_MGO",type:"DecimalNumber",unit:"mt",relevantFor:"for CII correction, voluntary wrt MRV",description:"Cargo heating MGO consumption"},{name:"Cargo_heating_Consumption_MDO",type:"DecimalNumber",unit:"mt",relevantFor:"for CII correction, voluntary wrt MRV",description:"Cargo heating MDO consumption"},{name:"Cargo_heating_Consumption_LPGP",type:"DecimalNumber",unit:"mt",relevantFor:"for CII correction, voluntary wrt MRV",description:"Cargo heating LPG Propane consumption"},{name:"Cargo_heating_Consumption_LPGB",type:"DecimalNumber",unit:"mt",relevantFor:"for CII correction, voluntary wrt MRV",description:"Cargo heating LPG Butane consumption"},{name:"Cargo_heating_Consumption_LNG",type:"DecimalNumber",unit:"mt",relevantFor:"for CII correction, voluntary wrt MRV",description:"Cargo heating LNG consumption"},{name:"Cargo_heating_Consumption_M",type:"DecimalNumber",unit:"mt",relevantFor:"for CII correction, voluntary wrt MRV",description:"Cargo heating Methanol consumption"},{name:"Cargo_heating_Consumption_E",type:"DecimalNumber",unit:"mt",relevantFor:"for CII correction, voluntary wrt MRV",description:"Cargo heating Ethanol consumption"},{name:"Cargo_heating_Consumption_O",type:"DecimalNumber",unit:"mt",relevantFor:"for CII correction, voluntary wrt MRV",description:"Cargo heating other fuels consumption"},{name:"Cargo_heating_Consumption_O_type",type:"Text",maxLength:30,relevantFor:"for CII correction, voluntary wrt MRV",description:"Cargo heating other fuels type"},{name:"Cargo_Heating_Consumption_BDN",type:"DecimalNumber",unit:"mt",relevantFor:"for CII correction, voluntary wrt MRV",description:"Cargo heating consumption"},{name:"Cargo_Heating_Fuel_BDN",type:"Text",maxLength:50,relevantFor:"for CII correction, voluntary wrt MRV",description:"Fuel BDN used for cargo heating consumption"},{name:"DPP_Cargo_Pump_Consumption_MDO",type:"DecimalNumber",unit:"mt",relevantFor:"for CII correction, voluntary wrt MRV",description:"DPP cargo pump MDO consumption"},{name:"DPP_Cargo_Pump_Consumption_O",type:"DecimalNumber",unit:"mt",relevantFor:"for CII correction, voluntary wrt MRV",description:"DPP cargo pump other fuels consumption"},{name:"DPP_Cargo_Pump_Consumption_O_type",type:"Text",maxLength:30,relevantFor:"for CII correction, voluntary wrt MRV",description:"DPP cargo pump other fuels consumption"},{name:"DPP_Cargo_Pump_Consumption_BDN",type:"DecimalNumber",unit:"mt",relevantFor:"for CII correction, voluntary wrt MRV",description:"DPP cargo pump consumption"},{name:"DPP_Cargo_Pump_Fuel_BDN",type:"Text",maxLength:50,relevantFor:"for CII correction, voluntary wrt MRV",description:"Fuel BDN used for DPP consumption"},{name:"ME_Fuel_BDN",type:"Text",maxLength:50,relevantFor:"mandatory for MRV&DCS",mandatory:!0,description:"Primary fuel"},{name:"ME_Consumption",type:"DecimalNumber",unit:"mt",relevantFor:"mandatory for MRV&DCS",description:"Consumption (sum of all MEs) primary fuel"},{name:"ME_Fuel_BDN_2",type:"Text",maxLength:50,relevantFor:"optional input",description:"2nd fuel"},{name:"ME_Consumption_BDN_2",type:"DecimalNumber",unit:"mt",relevantFor:"optional input",description:"Consumption (sum of all MEs) 2nd fuel"},{name:"ME_Fuel_BDN_3",type:"Text",maxLength:50,relevantFor:"optional input",description:"3rd fuel"},{name:"ME_Consumption_BDN_3",type:"DecimalNumber",unit:"mt",relevantFor:"optional input",description:"Consumption (sum of all MEs) 3rd fuel"},{name:"ME_Fuel_BDN_4",type:"Text",maxLength:50,relevantFor:"optional input",description:"4th fuel"},{name:"ME_Consumption_BDN_4",type:"DecimalNumber",unit:"mt",relevantFor:"optional input",description:"Consumption (sum of all MEs) 4th fuel"},{name:"AE_Fuel_BDN",type:"Text",maxLength:50,relevantFor:"mandatory for MRV&DCS",mandatory:!0,description:"Primary fuel"},{name:"AE_Consumption",type:"DecimalNumber",unit:"mt",relevantFor:"mandatory for MRV&DCS",description:"Consumption (sum of all AEs) primary fuel"},{name:"Boiler_Consumption",type:"DecimalNumber",unit:"mt",relevantFor:"mandatory for MRV&DCS",description:"Boiler consumption (sum of all boilers)"},{name:"DPP_Consumption",type:"DecimalNumber",unit:"mt",relevantFor:"mandatory for MRV&DCS",description:"Consumption (sum of all DPPs) primary fuel"},{name:"IGG_Consumption",type:"DecimalNumber",unit:"mt",relevantFor:"mandatory for MRV&DCS",description:"Consumption (sum of all IGGs) primary fuel"},{name:"GCU_Consumption",type:"DecimalNumber",unit:"mt",relevantFor:"mandatory for MRV&DCS",description:"Consumption (sum of all GCUs) primary fuel"},{name:"Incinerator_Consumption",type:"DecimalNumber",unit:"mt",relevantFor:"mandatory for MRV&DCS",description:"Consumption (sum of all Incinerators) primary fuel"},{name:"AE_Fuel_BDN_2",type:"Text",maxLength:50,relevantFor:"optional input",description:"2nd fuel"},{name:"AE_Consumption_BDN_2",type:"DecimalNumber",unit:"mt",relevantFor:"optional input",description:"Consumption (sum of all AEs) 2nd fuel"},{name:"Boiler_Consumption_BDN_2",type:"DecimalNumber",unit:"mt",relevantFor:"optional input",description:"Consumption (sum of all boilers) 2nd fuel"},{name:"AE_Fuel_BDN_3",type:"Text",maxLength:50,relevantFor:"optional input",description:"3rd fuel"},{name:"AE_Consumption_BDN_3",type:"DecimalNumber",unit:"mt",relevantFor:"optional input",description:"Consumption (sum of all AEs) 3rd fuel"},{name:"Boiler_Consumption_BDN_3",type:"DecimalNumber",unit:"mt",relevantFor:"optional input",description:"Consumption (sum of all boilers) 3rd fuel"},{name:"AE_Fuel_BDN_4",type:"Text",maxLength:50,relevantFor:"optional input",description:"4th fuel"},{name:"AE_Consumption_BDN_4",type:"DecimalNumber",unit:"mt",relevantFor:"optional input",description:"Consumption (sum of all AEs) 4th fuel"},{name:"Boiler_Consumption_BDN_4",type:"DecimalNumber",unit:"mt",relevantFor:"optional input",description:"Consumption (sum of all boilers) 4th fuel"},{name:"ROB_Fuel_BDN",type:"Text",maxLength:50,relevantFor:"mandatory for MRV&DCS",mandatory:!0,description:"Reference number (BDN) from bunker reporting for the fuel used since last report"},{name:"BDN_ROB",type:"DecimalNumber",unit:"MT",relevantFor:"mandatory for MRV&DCS",description:"Only data fields for the fuels actually used since last report need to be included."},{name:"ROB_Fuel_BDN_2",type:"Text",maxLength:50,relevantFor:"optional input"},{name:"BDN_2_ROB",type:"DecimalNumber",unit:"MT",relevantFor:"optional input"},{name:"ROB_Fuel_BDN_3",type:"Text",maxLength:50,relevantFor:"optional input"},{name:"BDN_3_ROB",type:"DecimalNumber",unit:"MT",relevantFor:"optional input"},{name:"ROB_Fuel_BDN_4",type:"Text",maxLength:50,relevantFor:"optional input"},{name:"BDN_4_ROB",type:"DecimalNumber",unit:"MT",relevantFor:"optional input"},{name:"ROB_Fuel_BDN_5",type:"Text",maxLength:50,relevantFor:"optional input"},{name:"BDN_5_ROB",type:"DecimalNumber",unit:"MT",relevantFor:"optional input"},{name:"ROB_Fuel_BDN_6",type:"Text",maxLength:50,relevantFor:"optional input"},{name:"BDN_6_ROB",type:"DecimalNumber",unit:"MT",relevantFor:"optional input"},{name:"ROB_Fuel_BDN_7",type:"Text",maxLength:50,relevantFor:"optional input"},{name:"BDN_7_ROB",type:"DecimalNumber",unit:"MT",relevantFor:"optional input"},{name:"ROB_Fuel_BDN_8",type:"Text",maxLength:50,relevantFor:"optional input"},{name:"BDN_8_ROB",type:"DecimalNumber",unit:"MT",relevantFor:"optional input"},{name:"ROB_Fuel_Total",type:"DecimalNumber",unit:"MT",relevantFor:"mandatory for MRV&DCS",description:"Total fuel ROB (sum of all fuel masses onboard at the event time)"},{name:"Remarks",type:"Text",maxLength:250,relevantFor:"out of scope for GHG verification",description:"Any comment/note/explanation to be recorded"}]);y(this,"bunkerReportDefs",[{name:"IMO",type:"WholeNumber",rule:"exact7digits",relevantFor:"mandatory for MRV&DCS",mandatory:!0,description:"IMO number"},{name:"BDN_Number",type:"Text",maxLength:50,relevantFor:"mandatory for MRV&DCS",mandatory:!0,description:"Bunker Delivery Note Number"},{name:"Used_By_BDN",type:"Text",maxLength:50,unit:"-",relevantFor:"out of scope for GHG verification",mandatory:!0,description:"BDN number of the resulting fuel blend."},{name:"Coming_From_BDN",type:"Text",maxLength:50,relevantFor:"out of scope for GHG verification",mandatory:!0,description:"BDN number of parent fuel"},{name:"Bunker_Delivery_Date",type:"Date",relevantFor:"mandatory for MRV&DCS",mandatory:!0,description:"Bunker Delivery Date"},{name:"Bunker_Delivery_Time",type:"Time",relevantFor:"mandatory for MRV&DCS",mandatory:!0,description:"Bunker Delivery Time"},{name:"Fuel_Type",type:"Text",maxLength:30,relevantFor:"mandatory for MRV&DCS",mandatory:!0,description:"Fuel Type"},{name:"Mass",type:"DecimalNumber",unit:"mt",relevantFor:"mandatory for MRV&DCS",mandatory:!0,description:"Mass"},{name:"EU_Lower_Calorific_Value",type:"DecimalNumber",unit:"MJ/kg",relevantFor:"Mandatory for biofuels for FuelEU Maritime",description:"Lower Calorific Value (EU)"},{name:"EU_GHG_Intensity",type:"DecimalNumber",unit:"gCO2eq/MJ",relevantFor:"Mandatory for biofuels and e-fuels for FuelEU Maritime",description:"EU GHG emission intensity"},{name:"Sustainability",type:"Text",maxLength:256,relevantFor:"Mandatory for biofuels for MRV/DCS and FuelEU Maritime",description:"Sustainability"},{name:"Lower_Heating_Value",type:"DecimalNumber",unit:"MJ/kg",relevantFor:"Mandatory for biofuels for DCS",description:"Lower heating value"},{name:"IMO_GHG_Intensity",type:"DecimalNumber",unit:"gCO2eq/MJ",relevantFor:"Mandatory for biofuels under IMO DCS/CII scheme until LCA guidelines are applied in IMO reporting scheme",description:"IMO GHG emission intensity"},{name:"FLL_Energy_Share",type:"DecimalNumber",unit:"%",relevantFor:"out of scope for GHG verification",description:"Energy share in fuel blend"},{name:"IMO_Fuel_Pathway_Code",type:"Text",maxLength:50,relevantFor:"out of scope for GHG verification",description:"Fuel pathway code"},{name:"Density_At_15dg",type:"DecimalNumber",unit:"mt/m³",relevantFor:"out of scope for GHG verification",description:"Density @ 15 °C"},{name:"Sulphur_Content",type:"DecimalNumber",unit:"% m/m",relevantFor:"out of scope for GHG verification",description:"Sulphur Content"},{name:"Viscosity",type:"DecimalNumber",unit:"cSt",relevantFor:"out of scope for GHG verification",description:"Viscosity"},{name:"Water_Content",type:"DecimalNumber",unit:"% V/V",relevantFor:"out of scope for GHG verification",description:"Water content"},{name:"Higher_Heating_Value",type:"DecimalNumber",unit:"MJ/kg",relevantFor:"out of scope for GHG verification",description:"Higher heating value"},{name:"Bunker_Port",type:"Text",maxLength:5,unit:"UN/LOCODE",relevantFor:"out of scope for GHG verification",description:"Bunker port"},{name:"Grade",type:"Text",maxLength:10,relevantFor:"out of scope for GHG verification",description:"Grade"},{name:"TtW_CO2_CF",type:"DecimalNumber",unit:"gCO2/g",relevantFor:"out of scope for GHG verification",description:"Tank-to-Wake CO2 conversion factor"}])}fieldDefs(o){return o==="OVDBR"?this.bunkerReportDefs:this.logAbstractDefs}}const O=new ie,Ie="BOSP",Te="EOSP";function be(e){const n=O.fields(w.OVDLA);if(!e.length)return[n];const o=[];return e.forEach(t=>{var me,ue,le,pe,_e;const l=A(t.Date).utc(),r=((ue=(me=t.Port)==null?void 0:me.split("|")[1])==null?void 0:ue.trim())||"",m=((pe=(le=t.NextPort)==null?void 0:le.split("|")[1])==null?void 0:pe.trim())||"",i=O.formatCoordinate(t.Lat,"lat"),s=O.formatCoordinate(t.Lng,"lng"),a=t.MECons_HSFO||0,c=(t.MECons_VLSFO||0)+(t.MECons_ULSFO||0),u=(t.MECons_VLSDGO||0)+(t.MECons_ULSDGO||0),_=t.AECons_HSFO||0,f=(t.AECons_VLSFO||0)+(t.AECons_ULSFO||0),E=(t.AECons_VLSDGO||0)+(t.AECons_ULSDGO||0),F=t.BoilerCons_HSFO||0,P=(t.BoilerCons_VLSFO||0)+(t.BoilerCons_ULSFO||0),k=(t.BoilerCons_VLSDGO||0)+(t.BoilerCons_ULSDGO||0),R=t.BROB_HSFO||0,V=(t.BROB_VLSFO||0)+(t.BROB_ULSFO||0),L=(t.BROB_VLSDGO||0)+(t.BROB_ULSDGO||0),I=R+V+L;let ae="",se=m||"";t.Type===Ie&&(t!=null&&t.Port)&&(ae=r||(t==null?void 0:t.Port)),t.Type===Te&&(t!=null&&t.Port)&&(se=r||(t==null?void 0:t.Port));const Ge={Date_UTC:l.format("YYYY-MM-DD"),Time_UTC:l.format("HH:mm"),IMO:t.IMO,Event:O.mapEvent(t.Type),Voyage_From:ae,Voyage_To:se,Voyage_Number:t.VoyNum||((_e=t.voyage)==null?void 0:_e.voyNum)||"",Voyage_Leg:"",Voyage_Type:"",Purposes_Of_Call:O.mapPortCallPurpose(t.PortActivity),Offhire_Reasons:"",Time_Since_Previous_Report:t.TimeSLR||"",Time_Elapsed_Anchoring:"",Time_Elapsed_Sailing:"",Time_Elapsed_Drifting:"",Time_Elapsed_Maneuvering:"",Time_Elapsed_Waiting:"",Time_Elapsed_Loading_Unloading:"",Time_Elapsed_Ice:"",Distance:t.DistSLR||0,Latitude_North_South:i.hemisphere,Latitude_Degree:i.degrees,Latitude_Minutes:i.minutes,Longitude_East_West:s.hemisphere,Longitude_Degree:s.degrees,Longitude_Minutes:s.minutes,Cargo_Mt:t.CargoWeight||"",Cargo_M3:"",Deadweight_Carried:"",Cargo_Total_TEU:"",Passengers:"",Crew:"",Reefer_20_Chilled:"",Reefer_40_Chilled:"",Reefer_20_Frozen:"",Reefer_40_Frozen:"",Wind_Force_Kn:"",Wind_Force_Bft:t.WindBF||"",ME_Consumption_HFO:a,ME_Consumption_LFO:c,ME_Consumption_MGO:u,ME_Consumption_MDO:0,ME_Consumption_O:"",ME_Consumption_O_type:"",ME_Consumption_LPGP:"",ME_Consumption_LPGB:"",ME_Consumption_LNG:"",ME_Consumption_M:"",ME_Consumption_E:"",AE_Consumption_HFO:_,AE_Consumption_LFO:f,AE_Consumption_MGO:E,AE_Consumption_MDO:"",AE_Consumption_O:"",AE_Consumption_O_type:"",AE_Consumption_LPGP:"",AE_Consumption_LPGB:"",AE_Consumption_LNG:"",AE_Consumption_M:"",AE_Consumption_E:"",Boiler_Consumption_HFO:F,Boiler_Consumption_LFO:P,Boiler_Consumption_MGO:k,Boiler_Consumption_MDO:"",Boiler_Consumption_O:"",Boiler_Consumption_O_type:"",Boiler_Consumption_LPGP:"",Boiler_Consumption_LPGB:"",Boiler_Consumption_LNG:"",Boiler_Consumption_M:"",Boiler_Consumption_E:"",Inert_gas_Consumption_HFO:"",Inert_gas_Consumption_LFO:"",Inert_gas_Consumption_MGO:"",Inert_gas_Consumption_MDO:"",Inert_gas_Consumption_O:"",Inert_gas_Consumption_O_type:"",Inert_gas_Consumption_LPGP:"",Inert_gas_Consumption_LPGB:"",Inert_gas_Consumption_LNG:"",Inert_gas_Consumption_M:"",Inert_gas_Consumption_E:"",HFO_ROB:R||0,LFO_ROB:V||0,MGO_ROB:L||0,MDO_ROB:"",LPGP_ROB:"",LPGB_ROB:"",LNG_ROB:"",Methanol_ROB:"",Ethanol_ROB:"",O_ROB:"",O_ROB_type:"",Reefer_Work:"",Reefer_SFOC:"",Reefer_Fuel_Type:"",Reefer_Fuel_BDN:"",Cargo_Cooling_Work:"",Cargo_Cooling_SFOC:"",Cargo_Cooling_Fuel_Type:"",Cargo_Cooling_Fuel_BDN:"",Discharge_Pump_Work:"",Discharge_Pump_SFOC:"",Discharge_Pump_Fuel_Type:"",Discharge_Pump_Fuel_BDN:"",Shore_Side_Electricity_Reception:"",Cargo_heating_Consumption_HFO:"",Cargo_heating_Consumption_LFO:"",Cargo_heating_Consumption_MGO:"",Cargo_heating_Consumption_MDO:"",Cargo_heating_Consumption_LPGP:"",Cargo_heating_Consumption_LPGB:"",Cargo_heating_Consumption_LNG:"",Cargo_heating_Consumption_M:"",Cargo_heating_Consumption_E:"",Cargo_heating_Consumption_O:"",Cargo_heating_Consumption_O_type:"",Cargo_Heating_Consumption_BDN:"",Cargo_Heating_Fuel_BDN:"",DPP_Cargo_Pump_Consumption_MDO:"",DPP_Cargo_Pump_Consumption_O:"",DPP_Cargo_Pump_Consumption_O_type:"",DPP_Cargo_Pump_Consumption_BDN:"",DPP_Cargo_Pump_Fuel_BDN:"",ME_Fuel_BDN:"",ME_Consumption:"",ME_Fuel_BDN_2:"",ME_Consumption_BDN_2:"",ME_Fuel_BDN_3:"",ME_Consumption_BDN_3:"",ME_Fuel_BDN_4:"",ME_Consumption_BDN_4:"",AE_Fuel_BDN:"",AE_Consumption:"",Boiler_Consumption:"",DPP_Consumption:"",IGG_Consumption:"",GCU_Consumption:"",Incinerator_Consumption:"",AE_Fuel_BDN_2:"",AE_Consumption_BDN_2:"",Boiler_Consumption_BDN_2:"",AE_Fuel_BDN_3:"",AE_Consumption_BDN_3:"",Boiler_Consumption_BDN_3:"",AE_Fuel_BDN_4:"",AE_Consumption_BDN_4:"",Boiler_Consumption_BDN_4:"",ROB_Fuel_BDN:"",BDN_ROB:"",ROB_Fuel_BDN_2:"",BDN_2_ROB:"",ROB_Fuel_BDN_3:"",BDN_3_ROB:"",ROB_Fuel_BDN_4:"",BDN_4_ROB:"",ROB_Fuel_BDN_5:"",BDN_5_ROB:"",ROB_Fuel_BDN_6:"",BDN_6_ROB:"",ROB_Fuel_BDN_7:"",BDN_7_ROB:"",ROB_Fuel_BDN_8:"",BDN_8_ROB:"",ROB_Fuel_Total:I,Remarks:t.Remarks||""};o.push(n.map(Pe=>String(Ge[Pe]??"")))}),[n,...o]}p.CCS_OIL_GROUPS=T,p.CCS_TM_MINUTE_PATTERN=j,p.CCS_TM_PATTERN=S,p.CcsAdjustType=Z,p.CcsConsumerType=h,p.CcsCorrectType=q,p.CcsEemsClient=ge,p.CcsEemsTemplate=H,p.CcsExemptionType=z,p.CcsIsEu=v,p.CcsLoadingType=B,p.CcsOilCode=N,p.CcsOilNames=$,p.CcsOspType=M,p.CcsPeriodType=K,p.CcsPortWork=Y,p.CcsRecordType=b,p.DnvOVDClient=Re,p.OvdEventType=te,p.OvdFieldType=ee,p.OvdFuelType=oe,p.OvdInterfaceCode=w,p.OvdPortCallPurpose=ne,p.OvdTemplate=re,p.OvdTemplateV313=ie,p.buildCcsImoVoyageData=Oe,p.buildCcsVoyageData=Ee,p.buildDnvOvdData=be,p.ccsEemsTemplate=Ne,Object.defineProperty(p,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@orm-plugin/ghg-data-converter",
3
3
  "private": false,
4
- "version": "0.1.1",
4
+ "version": "0.1.3",
5
5
  "description": "orm plugin for GHG data conversion & reporting (dnv/ccs)",
6
6
  "type": "module",
7
7
  "keywords": [