UNPKG

@idmwx/idmui-mapbox3

Version:

idm mapbox 3

1 lines 186 kB
(function(O,G){typeof exports=="object"&&typeof module<"u"?G(exports,require("mapbox-gl"),require("@idmwx/idmui-gl3"),require("vue"),require("element-plus"),require("moment"),require("@idm-plugin/tag"),require("@element-plus/icons-vue"),require("axios"),require("@idm-plugin/geo"),require("echarts"),require("@turf/turf")):typeof define=="function"&&define.amd?define(["exports","mapbox-gl","@idmwx/idmui-gl3","vue","element-plus","moment","@idm-plugin/tag","@element-plus/icons-vue","axios","@idm-plugin/geo","echarts","@turf/turf"],G):(O=typeof globalThis<"u"?globalThis:O||self,G(O["idmui-report"]={},O["mapbox-gl"],O["@idmwx/idmui-gl3"],O.Vue,O["element-plus"],O.moment,O["@idm-plugin/tag"],O["@element-plus/icons-vue"],O.axios,O["@idm-plugin/geo"],O.echarts,O["@turf/turf"]))})(this,function(O,G,je,e,se,w,H,$,W,x,ml,pl){"use strict";function Je(l){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(l){for(const o in l)if(o!=="default"){const a=Object.getOwnPropertyDescriptor(l,o);Object.defineProperty(t,o,a.get?a:{enumerable:!0,get:()=>l[o]})}}return t.default=l,Object.freeze(t)}const q=Je(ml),z=Je(pl),Tr="",Dr="",Rr="",P=(l,t)=>{const o=l.__vccOpts||l;for(const[a,s]of t)o[a]=s;return o},gl={name:"MapInitial",props:{center:{type:Object,default:()=>({})},token:{type:String,default:""}},emits:["initialized"],data(){return{helper:void 0,map:void 0,lngLat:void 0,marker:void 0}},watch:{center:{handler(){this.$nextTick(()=>{var t,o,a,s,n;((o=(t=this.center)==null?void 0:t.position)==null?void 0:o.length)===2&&((a=this.center)!=null&&a.flyTo)&&((n=this.map)==null||n.flyTo({center:(s=this.center)==null?void 0:s.position}));const l=document.getElementById("center-marker");this.marker=new G.Marker(l).setLngLat([this.center.position[0],this.center.position[1]]).addTo(this.map),this.marker._element.style.display="block"})},deep:!0}},mounted(){this.initMap()},methods:{initMap(){this.helper=new je.MapboxHelper(this.token),G.accessToken="pk.eyJ1IjoibmVhdGNoZW5oZW5nIiwiYSI6ImNsdXM3cnBmODBsemgycW1vaXc1bjV6bXMifQ.w6fqHGRbhNhLvm0LnX4ZVw";const l=new G.Map({container:"map",style:{version:8,name:"idm-mapbox-gl3",lights:[],fog:{color:"#ffffff",range:[.5,10],"high-color":"#245cdf","space-color":["interpolate",["linear"],["zoom"],4,"#010b19",7,"#367ab9"],"horizon-blend":["interpolate",["linear"],["zoom"],4,.2,7,.1],"star-intensity":["interpolate",["linear"],["zoom"],5,.35,6,0]},bearing:0,pitch:1,sprite:"https://fontnik.idmwx.com/sprite/sprite",glyphs:"https://fontnik.idmwx.com/{fontstack}/{range}.pbf",projection:{name:"equirectangular"},sources:{composite:this.helper.mapboxCustomer.source,i4:this.helper.i4.source,hi:this.helper.hi.source},layers:[this.helper.mapboxCustomer.layers.water,this.helper.mapboxCustomer.layers.waterDeplth,this.helper.i4.layer,this.helper.hi.layer,this.helper.mapboxCustomer.layers.countryBoundary,this.helper.mapboxCustomer.layers.countryAdmin0Boundary,this.helper.mapboxCustomer.layers.countryAdmin0BoundaryDisputed,this.helper.mapboxCustomer.layers.countryLabel,this.helper.mapboxCustomer.layers.world12nm,this.helper.mapboxCustomer.layers.worldMarineLine,this.helper.mapboxCustomer.layers.worldMarineLabel,this.helper.mapboxCustomer.layers.chinaRouteLine,this.helper.mapboxCustomer.layers.chinaRouteFill,this.helper.mapboxCustomer.layers.chinaRouteLabel]},zoom:2,minZoom:0,maxZoom:16,center:[120,30],maxBounds:[[-720,-85],[720,85]],preserveDrawingBuffer:!0,projection:"mercator",attributionControl:!1});l.on("load",()=>{this.map=l,this.$emit("initialized",this.map),this.initControl()})},initControl(){var t;const l=new G.ScaleControl({maxWidth:80,unit:"imperial"});(t=this.map)==null||t.addControl(l),l.setUnit("metric")},handleAddMarker(l){l.addTo(this.map)}}},fl={class:"initial-map-box"};function yl(l,t,o,a,s,n){return e.openBlock(),e.createElementBlock("div",fl,t[0]||(t[0]=[e.createElementVNode("div",{id:"map"},null,-1),e.createElementVNode("div",{id:"center-marker"},null,-1)]))}const ze=P(gl,[["render",yl],["__scopeId","data-v-62e37626"]]),El=function(l){typeof l=="string"&&(l=Number(l));let t;switch(l){case 7:t="Sun";break;case 1:t="Mon";break;case 2:t="Tue";break;case 3:t="Wed";break;case 4:t="Thu";break;case 5:t="Fri";break;case 6:t="Sat";break;default:t="-"}return t},Br="",kl={name:"MapTimeline",components:{ElScrollbar:se.ElScrollbar},props:{realTime:{type:Object},startDate:{type:Object,default:()=>w().add(-14,"day")},endDate:{type:Object,default:()=>w().add(13,"day")},reset:{type:Number,default:0},interval:{type:Number,default:3},bottom:{type:Number,default:0},top:{type:Number,default:void 0}},emits:["realTime","dateChange","timeZone","startTs"],data(){return{hours:0,paused:!0,animation:void 0,resetTime:!1,startTime:0,progress:0,step:0,frequency:1e3,showTimezone:!1,timeZone:0,hourOptions:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23],offsets:[-12,-11,-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9,10,11,12]}},computed:{dates(){const l=[];if(this.startDate&&this.endDate){const t=this.startDate.clone().utc().set({hour:0,minute:0,second:0,millisecond:0});for(;t.isSameOrBefore(this.endDate);)l.push(t.clone()),t.add(1,"day")}return l},computeTotalHours(){var t;return((t=this.computeOffsetEndDate)==null?void 0:t.diff(this.computeOffsetStartDate,"h",!0))+24||1},computeOffsetStartDate(){return this.$emit("startTs",w(this.dates[0]).format()),this.dates[0]},computeOffsetEndDate(){return this.dates[this.dates.length-1]},computeDate(){return function(l){return`${l==null?void 0:l.utc().format("MMM-DD")} ${El(l==null?void 0:l.utc().format("E"))}`}},totalDays(){return Math.ceil(this.computeTotalHours/24)},defaultDays(){return this.totalDays<7?this.totalDays:7},computedHourWidth(){return Math.ceil((document.body.clientWidth-220)/(this.defaultDays*24))},computedLocalTime(){return w(this.realTime).utc().add(this.timeZone,"h").format("yyyy-MM-DD/HHmm")},computedStep(){return function(l){return l%this.interval===(this.timeZone+12)%this.interval}}},watch:{hours:{handler(){var s,n,r,d,i;const l=(s=this.computeOffsetStartDate)==null?void 0:s.clone().add(this.hours-this.timeZone,"h");this.$emit("realTime",l);const t=document.documentElement.clientWidth-((n=document.getElementsByClassName("buttons")[0])==null?void 0:n.clientWidth),o=(i=(d=(r=this.$refs.scrollBar)==null?void 0:r.$el)==null?void 0:d.firstChild)==null?void 0:i.scrollLeft,a=this.hours*this.computedHourWidth;a<(t-220)/2?this.$refs.scrollBar.setScrollLeft(0):a>=(t-220)/2+o&&this.$refs.scrollBar.setScrollLeft(o+this.computedHourWidth*this.interval)}},step:{handler(){this.hours>=this.computeTotalHours?this.pause():this.step>=0&&(this.hours+=this.interval)}},reset:{handler(){this.reset&&this.handleReset()}}},mounted(){this.timeZone=Number(localStorage.getItem("timeZone"))||0,this.$emit("timeZone",this.timeZone),this.handleReset()},methods:{pause(){this.animation&&cancelAnimationFrame(this.animation),this.paused=!0},resume(){this.resetTime=!0,this.paused=!1,this.animateSpeeds()},animateSpeeds(l){this.resetTime?(this.startTime=performance.now()-this.progress,this.resetTime=!1):this.progress=l-this.startTime,this.step=Math.floor(this.progress/this.frequency),this.animation=requestAnimationFrame(this.animateSpeeds)},handleJump(l,t){if(l>this.computeTotalHours)return!1;l=l<0?0:l,t?this.hours=l:this.hours=Math.ceil((l-(this.timeZone+12)%this.interval)/this.interval)*this.interval+(this.timeZone+12)%this.interval},handleClickHourText(l){},handleReset(){this.pause(),this.resetTime=!0,this.startTime=0,this.progress=0,this.realTime?this.hours=Math.ceil(this.realTime.diff(this.computeOffsetStartDate,"hour",!0)+this.timeZone):this.hours=Math.ceil(w().diff(this.computeOffsetStartDate,"hour",!0)+this.timeZone),setTimeout(()=>{var t;const l=Math.ceil(this.hours/24)-Math.floor(this.defaultDays/2);(t=this.$refs.scrollBar)==null||t.setScrollLeft(this.computedHourWidth*24*l-this.computedHourWidth*(this.hours%24))},500)},setTimezone(l){this.timeZone=l,this.$emit("timeZone",this.timeZone),localStorage.setItem("timeZone",this.timeZone),this.showTimezone=!1,this.handleReset()}}},Vl={class:"timezone"},Nl={key:0,class:"list"},ul=["onClick"],bl={class:"flex-start",style:{"box-shadow":"0px 2px 12px 0px rgba(0, 0, 0, 0.5)"}},xl={class:"flex-col-between-center"},Cl={class:"buttons flex-row-end-center"},Ll={class:"timeline"},_l={key:0,class:"day"},Sl={class:"date flex-row-center-end"},wl={class:"hours flex-row-start-center"},Tl=["onClick"];function Dl(l,t,o,a,s,n){const r=e.resolveComponent("ElScrollbar");return e.openBlock(),e.createElementBlock("div",{ref:"mapTimeline",class:"map-timeline-container",style:e.normalizeStyle({bottom:o.bottom+"px"})},[e.createElementVNode("div",Vl,[s.showTimezone?(e.openBlock(),e.createElementBlock("div",Nl,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.offsets,d=>(e.openBlock(),e.createElementBlock("div",{key:d,class:"item",onClick:i=>n.setTimezone(d)},e.toDisplayString(d<0?d:"+"+d),9,ul))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"btn",onClick:t[0]||(t[0]=d=>s.showTimezone=!s.showTimezone)},"UTC "+e.toDisplayString(s.timeZone<0?s.timeZone:"+"+s.timeZone),1)]),e.createElementVNode("div",bl,[e.createElementVNode("div",xl,[e.createElementVNode("div",Cl,[e.createElementVNode("div",{class:e.normalizeClass(s.hours-o.interval<0?"iconfont button disable":"iconfont button"),style:{transform:"rotate(180deg)"},onClick:t[1]||(t[1]=d=>n.handleJump(s.hours-o.interval,!0))},"  ",2),s.paused?(e.openBlock(),e.createElementBlock("div",{key:0,class:"iconfont button play",onClick:t[2]||(t[2]=(...d)=>n.resume&&n.resume(...d))},"")):(e.openBlock(),e.createElementBlock("div",{key:1,class:"iconfont button play",onClick:t[3]||(t[3]=(...d)=>n.pause&&n.pause(...d))},"")),e.createElementVNode("div",{class:e.normalizeClass(s.hours+o.interval>n.computeTotalHours?"iconfont button disable":"iconfont button"),onClick:t[4]||(t[4]=d=>n.handleJump(s.hours+o.interval,!0))},"  ",2)])]),e.createVNode(r,{ref:"scrollBar",class:"progress-box"},{default:e.withCtx(()=>[e.createElementVNode("div",Ll,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.computeTotalHours,(d,i)=>{var h;return e.openBlock(),e.createElementBlock(e.Fragment,{key:d},[i%24===0?(e.openBlock(),e.createElementBlock("div",_l,[e.createElementVNode("div",Sl,e.toDisplayString(n.computeDate((h=n.computeOffsetStartDate)==null?void 0:h.clone().add(d,"h"))),1),t[6]||(t[6]=e.createElementVNode("div",{style:{width:"2px",height:"50px","background-color":"var(--idm-black-1)",position:"relative","margin-top":"-50px",left:"-1px","z-index":"3"}},null,-1)),e.createElementVNode("div",wl,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.hourOptions,p=>(e.openBlock(),e.createElementBlock("div",{key:d+"-"+p,class:e.normalizeClass(d+p<=s.hours?"hour-bg active":"hour-bg"),style:e.normalizeStyle({width:n.computedHourWidth+"px"}),onClick:c=>n.handleJump(d+p)},[e.createElementVNode("div",{class:e.normalizeClass(["hour",d+p<=s.hours?"active":"",n.computedStep(p+1)?"step":""])},[n.computedStep(p)?(e.openBlock(),e.createElementBlock("span",{key:0,class:"text",style:e.normalizeStyle({marginLeft:n.computedHourWidth*-1+"px"}),onClick:t[5]||(t[5]=(...c)=>n.handleClickHourText&&n.handleClickHourText(...c))},e.toDisplayString(p<10?"0"+p:p),5)):e.createCommentVNode("",!0)],2)],14,Tl))),128))])])):e.createCommentVNode("",!0)],64)}),128))])]),_:1},512)])],4)}const Fe=P(kl,[["render",Dl],["__scopeId","data-v-5edeeab1"]]),Mr="",Rl={name:"MapMeteo",components:{MapboxGL:je.MapboxGL},props:{token:{type:String,default:""},permission:{type:Number,default:0},map:{type:Object,default:void 0},forecastModel:{type:String}},emits:["measurable"],data(){return{showPointRpt:!1,pointQuery:{}}},methods:{handleMore(l){this.pointQuery={...l,d:7,st:6}},handleMeasurableChange(l){this.$emit("measurable",l)}}},Bl={class:"meteo-gl"};function Ml(l,t,o,a,s,n){const r=e.resolveComponent("MapboxGL");return e.openBlock(),e.createElementBlock("div",Bl,[o.map?(e.openBlock(),e.createBlock(r,e.mergeProps({key:0,ref:"mapboxGl3",map:o.map,token:o.token,permission:o.permission,forecastModel:o.forecastModel},l.$attrs),null,16,["map","token","permission","forecastModel"])):e.createCommentVNode("",!0)])}const We=P(Rl,[["render",Ml]]),Or="",Ol={name:"VoyageFleet",components:{ElScrollbar:se.ElScrollbar,CaretBottom:$.CaretBottom,CaretRight:$.CaretRight,Delete:$.Delete,ViewFilter:$.Filter},props:{permission:{type:Number,default:void 0},token:{type:String},voyageId:{type:String,default:void 0},voyageVersion:{type:Number,default:0},route:{type:Object,default:void 0},weights:{type:Object,default:void 0},voyageToggle:{type:Boolean,default:!1},toggleVersion:{type:Number,default:0},isLogin:{type:Boolean,default:void 0}},emits:["login","update","select","voyageToggle","hide","toggleVersion","handlePort","handleCoord","handleOtherVessel","handleCloseAll"],data(){return{right:10,listQuery:{vid:void 0,id:void 0,smp:!0,pid:void 0,pn:1,ps:500},model:"inService",activeStatus:"Underway",filterVersion:0,voyageList:[],followList:[],filterList:[],total:0,voyage:void 0,hide:!1,items:[],placeholder:"Name/IMO",keyword:void 0,gateway:"https://cbe.idmwx.com",CompanyHelper:H.CompanyHelper,showAlertCheckbox:!1,alertTagList:[],alertOption:{weather:H.VoyageHelper.WEATHER_TAG,sailing:H.VoyageHelper.SAILING_TAG},checkParams:{weather:{checkAll:!1,isIndeterminate:!1},sailing:{checkAll:!1,isIndeterminate:!1}}}},computed:{computePosition(){return function(l){return l?x.LngLatHelper.lat2pretty(l==null?void 0:l.lat,2).pretty+" / "+x.LngLatHelper.lng2pretty(l==null?void 0:l.lng,2).pretty:"-"}}},watch:{"route.query.vid":{handler(){var l,t;(t=(l=this.route)==null?void 0:l.query)!=null&&t.vid?this.handleVoyageIdChange():(this.fetchMyActiveVoyage(),this.fetchMyFollows())},immediate:!0},voyageToggle:{handler(){this.voyageToggle&&(this.model="inService",this.fetchMyFollows())}},filterVersion:{handler(){var l,t;if(this.model==="inService"){let o=[];((l=this.alertTagList)==null?void 0:l.length)>0?o=this.voyageList.filter((a,s)=>this.alertTagList.some(n=>a.tag&n)):o=this.voyageList,this.keyword?this.filterList=o.filter((a,s)=>{var c,f,V,N,C,y,b,D,m,k,S,u,T,L,R,g,M;const n=(c=this.keyword)==null?void 0:c.toLowerCase().replace(/\s/g,""),r=(N=(V=(f=a==null?void 0:a.vessel)==null?void 0:f.name)==null?void 0:V.toLowerCase())==null?void 0:N.replace(/\s/g,""),d=(b=(y=(C=a.company)==null?void 0:C.name)==null?void 0:y.toLowerCase())==null?void 0:b.replace(/\s/g,""),i=(S=(k=(m=(D=a==null?void 0:a.vessel)==null?void 0:D.imo)==null?void 0:m.toString())==null?void 0:k.toLowerCase())==null?void 0:S.replace(/\s/g,""),h=(L=(T=(u=a==null?void 0:a.pic)==null?void 0:u.email)==null?void 0:T.toLowerCase())==null?void 0:L.replace(/\s/g,""),p=(M=(g=(R=a==null?void 0:a.pic2)==null?void 0:R.email)==null?void 0:g.toLowerCase())==null?void 0:M.replace(/\s/g,"");return this.permission&this.CompanyHelper.LEVEL.Prime?(r==null?void 0:r.indexOf(n))>-1||(d==null?void 0:d.indexOf(n))>-1||(i==null?void 0:i.indexOf(n))>-1||(h==null?void 0:h.indexOf(n))>-1||(p==null?void 0:p.indexOf(n))>-1:(r==null?void 0:r.indexOf(n))>-1||(i==null?void 0:i.indexOf(n))>-1}):this.filterList=o,this.total=(t=this.voyageList)==null?void 0:t.length,this.$nextTick(()=>{this.filterList.some(a=>a.status==="Underway")?this.activeStatus="Underway":this.filterList.some(a=>a.status==="Reached")?this.activeStatus="Reached":this.filterList.some(a=>a.status==="Ready")?this.activeStatus="Ready":this.activeStatus=""}),this.$emit("update",this.filterList)}else this.keyword?this.filterList=this.followList.filter((o,a)=>{var c,f,V,N,C,y,b,D,m,k,S,u,T,L,R,g,M;const s=(c=this.keyword)==null?void 0:c.toLowerCase().replace(/\s/g,""),n=(N=(V=(f=o==null?void 0:o.vessel)==null?void 0:f.name)==null?void 0:V.toLowerCase())==null?void 0:N.replace(/\s/g,""),r=(D=(b=(y=(C=o==null?void 0:o.vessel)==null?void 0:C.imo)==null?void 0:y.toString())==null?void 0:b.toLowerCase())==null?void 0:D.replace(/\s/g,""),d=this.voyageList.find(A=>{var _;return A.id===((_=o.voyage)==null?void 0:_.id)}),i=(S=(k=(m=d==null?void 0:d.company)==null?void 0:m.name)==null?void 0:k.toLowerCase())==null?void 0:S.replace(/\s/g,""),h=(L=(T=(u=d==null?void 0:d.pic)==null?void 0:u.email)==null?void 0:T.toLowerCase())==null?void 0:L.replace(/\s/g,""),p=(M=(g=(R=d==null?void 0:d.pic2)==null?void 0:R.email)==null?void 0:g.toLowerCase())==null?void 0:M.replace(/\s/g,"");return this.permission&this.CompanyHelper.LEVEL.Prime?(n==null?void 0:n.indexOf(s))>-1||(i==null?void 0:i.indexOf(s))>-1||(r==null?void 0:r.indexOf(s))>-1||(h==null?void 0:h.indexOf(s))>-1||(p==null?void 0:p.indexOf(s))>-1:(n==null?void 0:n.indexOf(s))>-1||(r==null?void 0:r.indexOf(s))>-1}):this.filterList=this.followList,this.total=this.followList.length,this.$emit("update",this.filterList)},immediate:!0},model:{handler(){this.filterVersion=Math.random(),this.model==="myFollows"&&this.fetchMyFollows(),this.voyage={},this.$emit("select",this.voyage)}},keyword:{handler(){this.filterVersion=Math.random()},immediate:!0},voyageVersion:{handler(){if(this.voyageId){let l=0;this.filterList.forEach((o,a)=>{o.id===this.voyageId&&(this.voyage=o,l=a)});const t=document.getElementsByClassName("el-scrollbar")[0].firstChild;t.scrollTop=(l-10)*42}},immediate:!0},toggleVersion:{handler(){this.$nextTick(()=>{var l;this.right=(((l=document.getElementsByClassName("right-bar")[0])==null?void 0:l.clientWidth)||0)+10})},deep:!0,immediate:!0},hide:{handler(){this.hide||this.$emit("update",this.voyageList)}}},mounted(){this.permission&this.CompanyHelper.LEVEL.Prime?this.placeholder="Name/IMO/Company/PIC":this.placeholder="Name/IMO"},methods:{async handleVoyageIdChange(){var o;await this.fetchMyActiveVoyage(),this.$emit("voyageToggle",!1);const l=this.voyageList.filter(a=>{var s,n;return a.id===((n=(s=this.route)==null?void 0:s.query)==null?void 0:n.vid)})[0];this.$emit("select",l);const t=(o=l==null?void 0:l.vessel)==null?void 0:o.imo;this.keyword=t+""},async fetchMyActiveVoyage(){var t,o,a,s;const l=await W.get(`${this.gateway}/api/rsv/voyages/my/active`,{headers:{Authorization:this.token},params:this.listQuery});if(((t=l==null?void 0:l.data)==null?void 0:t.code)===0){const n=H.VoyageHelper.WEATHER_TAG,r=H.VoyageHelper.SAILING_TAG;this.voyageList=(s=(a=(o=l.data)==null?void 0:o.data)==null?void 0:a.rows)==null?void 0:s.map(d=>(d.weatherTag=n.some(i=>d.tag&i.weight),d.sailingTag=r.some(i=>d.tag&i.weight),d)),this.hide||this.$emit("update",this.voyageList),this.filterVersion=Math.random()}},async fetchMyFollows(){var t,o,a,s;const l=await W.get(`${this.gateway}/api/rsv/follows`,{headers:{Authorization:this.token},params:{pn:1,ps:1e4,b:1}});if(((t=l==null?void 0:l.data)==null?void 0:t.code)===0){const n=H.VoyageHelper.WEATHER_TAG,r=H.VoyageHelper.SAILING_TAG;let d=0;this.followList=(s=(a=(o=l.data)==null?void 0:o.data)==null?void 0:a.rows)==null?void 0:s.map(i=>(i.weatherTag=n.some(h=>i.tag&h.weight),i.sailingTag=r.some(h=>i.tag&h.weight),i.watchedIndex=i.voyage?void 0:++d,i.followed=!0,i)),this.filterVersion=Math.random()}},handleFleetHide(l){this.hide=l,this.$emit("hide",l)},handleVoyageClick(l){this.$emit("handleCloseAll"),this.voyage=l,this.$emit("select",this.voyage)},handleRowClick(l){this.$emit("handleCloseAll"),l.voyage?(this.voyage=this.voyageList.find(t=>{var o;return t.id===((o=l.voyage)==null?void 0:o.id)}),this.$emit("select",this.voyage)):l.coordinate?this.$emit("handleCoord",l.coordinate):l.port?this.$emit("handlePort",l.port):l.vessel&&this.$emit("handleOtherVessel",l.vessel)},handleToggleFollow(l){var t,o;l.follow?this.handleCancelFollow((o=l==null?void 0:l.follow)==null?void 0:o.id):this.handleFollow((t=l==null?void 0:l.vessel)==null?void 0:t.id)},async handleFollow(l){await W.post(`${this.gateway}/api/rsv/follows`,{vesselId:l},{headers:{Authorization:this.token}}).then(t=>{var o,a,s,n,r;((o=t.data)==null?void 0:o.code)===0&&(this.fetchMyFollows(),this.voyageList.find(d=>{var i;return((i=d==null?void 0:d.vessel)==null?void 0:i.id)===l}).follow={id:(a=t.data.data)==null?void 0:a.id,voyageId:(s=t.data.data)==null?void 0:s.voyageId,ownerId:(r=(n=t.data.data)==null?void 0:n.owner)==null?void 0:r.id})}),this.filterVersion=Math.random()},handleCancelFollow(l){W.delete(`${this.gateway}/api/rsv/follows/${l}`,{headers:{Authorization:this.token}}).then(t=>{var o;((o=t.data)==null?void 0:o.code)===0&&(this.model==="inService"?this.voyageList.find(a=>{var s;return((s=a.follow)==null?void 0:s.id)===l}).follow=void 0:(this.fetchMyActiveVoyage(),this.followList=this.followList.filter(a=>(a==null?void 0:a.id)!==l)),this.filterVersion=Math.random())})},handleToggle(){this.isLogin?(this.$emit("voyageToggle",!this.voyageToggle),this.$emit("toggleVersion")):this.$emit("login")},handleClose(){this.$emit("voyageToggle",!1)},handleCheckAllChange(l,t){var o,a,s;l?((a=(o=this.alertOption)==null?void 0:o[t])==null||a.forEach(n=>{this.alertTagList.push(n.weight)}),this.alertTagList=[...new Set(this.alertTagList)]):this.alertTagList=(s=this.alertTagList)==null?void 0:s.filter(n=>{var r,d;return!((d=(r=this.alertOption)==null?void 0:r[t])!=null&&d.some(i=>n===i.weight))}),this.checkParams[t].isIndeterminate=!1,this.filterVersion=Math.random()},handleCheckItemChange(l,t){var a,s,n;const o=(a=l==null?void 0:l.filter(r=>this.alertOption[t].some(d=>r===d.weight)))==null?void 0:a.length;this.checkParams[t].checkAll=o===((s=this.alertOption[t])==null?void 0:s.length),this.checkParams[t].isIndeterminate=o>0&&o<((n=this.alertOption[t])==null?void 0:n.length),this.filterVersion=Math.random()}}},Al={class:"voyage-fleet-container"},Il={class:"header-box flex-space"},Hl={style:{"font-size":"14px"}},zl={class:"switch-box flex-space"},Fl={class:"search-box flex-between"},Wl={class:"status-label flex-between"},Pl={class:"flex-start"},Gl=["onClick"],Ul={style:{"font-size":"14px","font-weight":"400"}},Zl={key:0,class:"voyage-list"},$l=["onClick"],ql={class:"flex-start"},jl={class:"vessel-name"},Jl={key:0,class:"iconfont alert-icon"},Kl={key:1,class:"iconfont alert-icon"},Xl=["onClick"],Ql={key:0,class:"iconfont"},Yl={key:1,class:"iconfont"},vl={key:1,class:"voyage-list followed"},es=["onClick"],ts={key:0,class:"flex-space",style:{height:"100%"}},ls={class:"flex-col-space-start"},ss={class:"vessel-name"},ns={class:"flex-start"},os={key:0,class:"iconfont alert-icon"},as={key:1,class:"iconfont alert-icon"},is=["onClick"],rs={key:1,class:"flex-space",style:{height:"100%"}},ds={class:"flex-col-space-start"},cs={class:"vessel-name"},hs=["onClick"],ms={class:"display-box"},ps={style:{"pointer-events":"none"}},gs={class:"content-box"};function fs(l,t,o,a,s,n){var D;const r=e.resolveComponent("ElTooltip"),d=e.resolveComponent("ElInput"),i=e.resolveComponent("ViewFilter"),h=e.resolveComponent("el-icon"),p=e.resolveComponent("CaretBottom"),c=e.resolveComponent("CaretRight"),f=e.resolveComponent("ElScrollbar"),V=e.resolveComponent("Delete"),N=e.resolveComponent("el-checkbox"),C=e.resolveComponent("el-checkbox-group"),y=e.resolveComponent("ElDivider"),b=e.resolveComponent("ElDialog");return e.openBlock(),e.createElementBlock("div",Al,[e.createElementVNode("div",{class:"menu-bar-box",style:e.normalizeStyle({right:s.right+"px"})},[e.createVNode(r,{placement:"left",effect:"light",content:"Fleet","show-after":1e3},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(["toggle",o.voyageToggle?"active":""]),onClick:t[0]||(t[0]=m=>n.handleToggle())},t[21]||(t[21]=[e.createElementVNode("i",{class:"iconfont"},"",-1)]),2)]),_:1})],4),e.createElementVNode("div",{class:"main-box flex-start",style:e.normalizeStyle({right:o.voyageToggle?"0px":"-290px"})},[e.createElementVNode("div",{class:e.normalizeClass(["active-voyages",o.voyageToggle?"right-bar":""])},[e.createElementVNode("div",Il,[e.createElementVNode("label",null,[t[22]||(t[22]=e.createTextVNode("Fleets ")),e.createElementVNode("span",Hl," ( "+e.toDisplayString(s.total)+" )",1)]),e.createElementVNode("div",{class:"iconfont close-btn",onClick:t[1]||(t[1]=(...m)=>n.handleClose&&n.handleClose(...m))},"")]),e.createElementVNode("div",zl,[e.createElementVNode("div",{class:e.normalizeClass(s.model==="inService"?"item active":"item"),onClick:t[2]||(t[2]=m=>s.model="inService")},"In Service",2),e.createElementVNode("div",{class:e.normalizeClass(s.model==="myFollows"?"item active":"item"),onClick:t[3]||(t[3]=m=>s.model="myFollows")},"My Follows",2)]),e.createElementVNode("div",Fl,[e.createVNode(d,{placeholder:s.placeholder,modelValue:s.keyword,"onUpdate:modelValue":t[4]||(t[4]=m=>s.keyword=m),class:"input",style:{flex:"1"},clearable:"",onFocus:t[5]||(t[5]=m=>s.placeholder=""),onBlur:t[6]||(t[6]=m=>s.placeholder="Name/IMO")},null,8,["placeholder","modelValue"]),s.model==="inService"?(e.openBlock(),e.createBlock(h,{key:0,onClick:t[7]||(t[7]=m=>s.showAlertCheckbox=!0),style:{width:"30px"},color:(D=s.alertTagList)!=null&&D.length?"var(--idm-primary-color)":""},{default:e.withCtx(()=>[e.createVNode(i)]),_:1},8,["color"])):e.createCommentVNode("",!0)]),s.model==="inService"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},e.renderList(["Underway","Reached","Ready"],m=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:m},[e.createElementVNode("div",Wl,[e.createElementVNode("div",Pl,[e.createVNode(h,{class:"caret-btn"},{default:e.withCtx(()=>[s.activeStatus===m?(e.openBlock(),e.createBlock(p,{key:0,onClick:t[8]||(t[8]=k=>s.activeStatus="")})):(e.openBlock(),e.createBlock(c,{key:1,onClick:k=>s.activeStatus=m},null,8,["onClick"]))]),_:2},1024),e.createElementVNode("label",{onClick:k=>s.activeStatus=s.activeStatus===""?m:""},[e.createTextVNode(e.toDisplayString(m)+" ",1),e.createElementVNode("span",Ul," ( "+e.toDisplayString(s.filterList.filter(k=>k.status===m).length)+" )",1)],8,Gl)]),m==="Underway"?(e.openBlock(),e.createElementBlock("i",{key:0,class:e.normalizeClass(`iconfont icon ${m}`)},"",2)):e.createCommentVNode("",!0),m==="Reached"?(e.openBlock(),e.createElementBlock("i",{key:1,class:e.normalizeClass(`iconfont icon ${m}`)},"",2)):e.createCommentVNode("",!0),m==="Ready"?(e.openBlock(),e.createElementBlock("i",{key:2,class:e.normalizeClass(`iconfont icon ${m}`)},"",2)):e.createCommentVNode("",!0)]),s.activeStatus===m?(e.openBlock(),e.createElementBlock("div",Zl,[e.createVNode(f,null,{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.filterList.filter(k=>k.status===m),k=>{var S,u;return e.openBlock(),e.createElementBlock("div",{key:k.id,class:e.normalizeClass(((S=s.voyage)==null?void 0:S.id)===k.id?"flex-space voyage-item active":"flex-space voyage-item"),onClick:T=>n.handleVoyageClick(k)},[e.createElementVNode("div",ql,[e.createElementVNode("span",jl,e.toDisplayString((u=k.vessel)==null?void 0:u.name),1),k.weatherTag?(e.openBlock(),e.createElementBlock("span",Jl,"")):e.createCommentVNode("",!0),k.sailingTag?(e.openBlock(),e.createElementBlock("span",Kl,"")):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["follow-icons",k.follow?"active":""]),onClick:e.withModifiers(T=>n.handleToggleFollow(k),["stop"])},[k.follow?(e.openBlock(),e.createElementBlock("span",Ql,"")):(e.openBlock(),e.createElementBlock("span",Yl,""))],10,Xl)],10,$l)}),128))]),_:2},1024)])):e.createCommentVNode("",!0)],64))),64)):(e.openBlock(),e.createElementBlock("div",vl,[e.createVNode(f,null,{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.filterList,m=>{var k,S,u,T,L,R,g;return e.openBlock(),e.createElementBlock("div",{key:m.id||Math.random(),class:e.normalizeClass((k=s.voyage)!=null&&k.id&&((S=s.voyage)==null?void 0:S.id)===((u=m==null?void 0:m.voyage)==null?void 0:u.id)?"voyage-item active":"voyage-item"),onClick:M=>n.handleRowClick(m)},[m.voyage?(e.openBlock(),e.createElementBlock("div",ts,[e.createElementVNode("div",ls,[e.createElementVNode("div",ss,e.toDisplayString((T=m==null?void 0:m.vessel)==null?void 0:T.name),1),e.createElementVNode("div",ns,[e.createElementVNode("span",{class:e.normalizeClass(`status-tag ${(L=m==null?void 0:m.voyage)==null?void 0:L.status}`)},e.toDisplayString((R=m==null?void 0:m.voyage)==null?void 0:R.status),3),m.weatherTag?(e.openBlock(),e.createElementBlock("span",os,"")):e.createCommentVNode("",!0),m.sailingTag?(e.openBlock(),e.createElementBlock("span",as,"")):e.createCommentVNode("",!0)])]),e.createElementVNode("div",{class:"follow-icons active",onClick:e.withModifiers(M=>n.handleCancelFollow(m.id),["stop"])},t[23]||(t[23]=[e.createElementVNode("span",{class:"iconfont"},"",-1)]),8,is)])):m!=null&&m.vessel?(e.openBlock(),e.createElementBlock("div",rs,[e.createElementVNode("div",ds,[e.createElementVNode("div",cs,e.toDisplayString((g=m==null?void 0:m.vessel)==null?void 0:g.name),1),t[24]||(t[24]=e.createElementVNode("div",{class:"flex-start"},[e.createElementVNode("span",{class:"status-tag vessel-tag"},"Followed")],-1))]),e.createElementVNode("div",{class:"delete-icons active",onClick:e.withModifiers(M=>n.handleCancelFollow(m.id),["stop"])},[e.createVNode(h,null,{default:e.withCtx(()=>[e.createVNode(V)]),_:1})],8,hs)])):e.createCommentVNode("",!0)],10,es)}),128))]),_:1})])),e.createElementVNode("view",ms,[t[25]||(t[25]=e.createElementVNode("span",{class:"text"},"Display on the map",-1)),s.hide?(e.openBlock(),e.createElementBlock("span",{key:1,class:"iconfont switch-off",onClick:t[10]||(t[10]=m=>n.handleFleetHide(!1))},"")):(e.openBlock(),e.createElementBlock("span",{key:0,class:"iconfont switch-on",onClick:t[9]||(t[9]=m=>n.handleFleetHide(!0))},""))])],2)],4),e.createElementVNode("div",ps,[e.createVNode(b,{modelValue:s.showAlertCheckbox,"onUpdate:modelValue":t[20]||(t[20]=m=>s.showAlertCheckbox=m),title:"Vessel Under Alert",width:"400",class:"alert-checkbox-dialog",draggable:!0,"show-close":!1,modal:!1,"close-on-click-modal":!1},{default:e.withCtx(()=>[e.createElementVNode("div",{class:"iconfont close-btn",onClick:t[11]||(t[11]=m=>s.showAlertCheckbox=!1)},""),e.createElementVNode("div",gs,[e.createVNode(N,{modelValue:s.checkParams.weather.checkAll,"onUpdate:modelValue":t[12]||(t[12]=m=>s.checkParams.weather.checkAll=m),indeterminate:s.checkParams.weather.isIndeterminate,onChange:t[13]||(t[13]=m=>n.handleCheckAllChange(m,"weather"))},{default:e.withCtx(()=>t[26]||(t[26]=[e.createElementVNode("span",{class:"title"},"Adverse Weather Alert",-1),e.createElementVNode("span",{class:"iconfont alert-icon"},"",-1)])),_:1,__:[26]},8,["modelValue","indeterminate"]),e.createVNode(C,{modelValue:s.alertTagList,"onUpdate:modelValue":t[14]||(t[14]=m=>s.alertTagList=m),onChange:t[15]||(t[15]=m=>n.handleCheckItemChange(m,"weather"))},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.alertOption.weather,m=>{var k,S;return e.openBlock(),e.createBlock(N,{label:(S=(k=m.name)==null?void 0:k.split(" "))==null?void 0:S[2],value:m.weight},null,8,["label","value"])}),256))]),_:1},8,["modelValue"]),e.createVNode(y,{style:{margin:"5px 0","border-top":"none"}}),e.createVNode(N,{modelValue:s.checkParams.sailing.checkAll,"onUpdate:modelValue":t[16]||(t[16]=m=>s.checkParams.sailing.checkAll=m),indeterminate:s.checkParams.sailing.isIndeterminate,onChange:t[17]||(t[17]=m=>n.handleCheckAllChange(m,"sailing"))},{default:e.withCtx(()=>t[27]||(t[27]=[e.createElementVNode("span",{class:"title"},"Sailing Alert",-1),e.createElementVNode("span",{class:"iconfont alert-icon"},"",-1)])),_:1,__:[27]},8,["modelValue","indeterminate"]),e.createVNode(C,{modelValue:s.alertTagList,"onUpdate:modelValue":t[18]||(t[18]=m=>s.alertTagList=m),onChange:t[19]||(t[19]=m=>n.handleCheckItemChange(m,"sailing"))},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.alertOption.sailing,m=>(e.openBlock(),e.createBlock(N,{label:m.name,value:m.weight},null,8,["label","value"]))),256))]),_:1},8,["modelValue"])])]),_:1},8,["modelValue"])])])}const Pe=P(Ol,[["render",fs],["__scopeId","data-v-3a33559e"]]),Ar="",ys={name:"VoyageSummary",components:{ElProgress:se.ElProgress,ElScrollbar:se.ElScrollbar,AlarmClock:$.AlarmClock},props:{voyage:{type:Object,default:void 0},leg:{type:Object,default:void 0},bps:{type:Object,default:void 0},permission:{type:Number},cpList:{type:Array,default:void 0}},emits:["center"],data(){return{rank:1}},computed:{currentLeg(){var l,t;return(t=(l=this.voyage)==null?void 0:l.legs)==null?void 0:t.find(o=>o.rank===this.rank)},computeLat(){return function(l){return`${x.LngLatHelper.lat2pretty(l,2).pretty}`}},computeLng(){return function(l){return`${x.LngLatHelper.lng2pretty(l,2).pretty}`}},computeWayport(){return function(l){return l!=null&&l.name?`[${l.rank}] ${l==null?void 0:l.name}`:`[${l.rank}] ${x.LngLatHelper.lat2pretty(l==null?void 0:l.lat,2).pretty},${x.LngLatHelper.lng2pretty(l==null?void 0:l.lng,2).pretty}`}},computeLegProgress(){return function(l){return l?(l==null?void 0:l.sailingDistance)/((l==null?void 0:l.sailingDistance)+(l==null?void 0:l.remainDistance))*100:0}},computeLocalTime(){return function(l,t,o="MMM-DD,HHmm[LT]"){if(l){const a=t!=null&&t.lng&&(t!=null&&t.lat)?x.LngLatHelper.guessTimeZoneOffset(t==null?void 0:t.lng,t==null?void 0:t.lat):0;return w(l).utcOffset(a).format(o)}return"-"}},computeUTCTime(){return function(l,t="MMM-DD,HHmm[Z]"){return l?w(l).utc().format(t):"-"}},computeUpdateTime(){return function(l){return w.unix(l).fromNow()}},computeTimeOffset(){return function(l){const t=l!=null&&l.lng&&(l!=null&&l.lat)?x.LngLatHelper.guessTimeZoneOffset(l==null?void 0:l.lng,l==null?void 0:l.lat):0;return x.LngLatHelper.prettyTimeZoneOffset(t)}},computeCiiDiscountZ(){return function(l){return x.LngLatHelper.roundPrecision(((l==null?void 0:l.ciiRef)-(l==null?void 0:l.discountCii))/(l==null?void 0:l.ciiRef)*100,0)}},computeRoundPrecision(){return function(l,t=4){return x.LngLatHelper.roundPrecision(l,t)||0}}},mounted(){var l,t,o;this.rank=((o=(t=(l=this.voyage)==null?void 0:l.legs)==null?void 0:t[0])==null?void 0:o.rank)||1},methods:{handleCenter(l){this.$emit("center",l)},toggleLegRight(){var l,t,o,a;this.rank=this.rank+1>((t=(l=this.voyage)==null?void 0:l.legs)==null?void 0:t.length)?(a=(o=this.voyage)==null?void 0:o.legs)==null?void 0:a.length:this.rank+1},toggleLegLeft(){this.rank=this.rank-1<1?1:this.rank-1}}},Es={class:"summary-container"},ks={class:"info-box-item"},Vs={class:"title-box flex-space"},Ns={class:"info"},us={class:"card-box"},bs={class:"flex-space row-item"},xs={class:"flex-space row-item"},Cs={class:"flex-space"},Ls={class:"info-box-item"},_s={class:"title-box flex-space"},Ss={key:0,class:"info flex-end"},ws={key:0,class:"card-box active-leg"},Ts={class:"flex-space"},Ds={class:"port-name"},Rs={class:"port-name"},Bs={class:"flex-center line-grogress"},Ms={class:"flex-space"},Os={class:"wayport sailing"},As={class:"time flex-start"},Is={key:0,style:{"margin-right":"0"}},Hs={key:1,style:{"margin-right":"0"}},zs={style:{"margin-right":"0"}},Fs={class:"time flex-start"},Ws={key:0},Ps={key:1},Gs={key:0,class:"distance flex-start info"},Us={class:"wayport sailing"},Zs={class:"time flex-end"},$s={key:0,style:{"margin-right":"0"}},qs={key:1,style:{"margin-right":"0"}},js={style:{"margin-right":"0"}},Js={class:"time flex-end"},Ks={key:0},Xs={key:1},Qs={key:0,class:"distance flex-end info"},Ys={key:0,class:"flex-center info",style:{"font-size":"14px"}},vs={key:1,class:"card-box active-leg"},en={class:"info-box-item"},tn={class:"card-box realtime-ais"},ln={class:"flex-space row-item"},sn={class:"flex-space row-item"},nn={class:"flex-space row-item"},on={class:"cp"},an={style:{flex:"1"}},rn={style:{flex:"1"}},dn={style:{flex:"1.4"}},cn={style:{flex:"1.2"}},hn={style:{flex:"1"}},mn={class:"info-box-item segs"},pn={key:0,class:"title-box"},gn={key:1},fn={class:"flex-space"},yn={style:{"font-weight":"bold","font-size":"14px"}},En={class:"cp"},kn={class:"flex-space"},Vn={class:"cp"},Nn={class:"flex-space"},un={class:"cii flex-center"},bn={class:"summary"},xn={class:"flex-space row"},Cn={class:"flex"},Ln={class:"flex"},_n={class:"flex"},Sn={class:"flex-space row"},wn={class:"flex"},Tn={class:"flex"},Dn={class:"flex"},Rn={class:"flex-space row"},Bn={class:"flex"},Mn={class:"flex"},On={class:"flex"},An={class:"flex-space row"},In={class:"flex-space row bold"},Hn={class:"summary"},zn={class:"flex-space row"},Fn={class:"flex"},Wn={class:"flex"},Pn={class:"flex"},Gn={class:"flex-space row bold"},Un={class:"flex-space row"},Zn={class:"flex"},$n={class:"flex"},qn={class:"flex"},jn={class:"flex-space row bold"},Jn={key:2,style:{color:"var(--idm-white-7)","margin-top":"20px"}};function Kn(l,t,o,a,s,n){const r=e.resolveComponent("ElDivider"),d=e.resolveComponent("ElProgress"),i=e.resolveComponent("AlarmClock"),h=e.resolveComponent("ElIcon"),p=e.resolveComponent("ElScrollbar");return e.openBlock(),e.createElementBlock("div",Es,[e.createVNode(p,{style:{padding:"10px"}},{default:e.withCtx(()=>{var c,f,V,N,C,y,b,D,m,k,S,u,T,L,R,g,M,A,_,F,I,B,U,j,J,ne,oe,ae,ie,re,de,ce,he,me,pe,ge,fe,ye,Ee,ke,Ve,Ne,ue,be,xe,Ce,Le,_e,Se,we,Te,De,Re,Be,Me,Oe,Ae,Ie,He,K,X,Q,Y,Xe,Qe,Ye,ve,et,tt,lt,st,nt,ot;return[e.createElementVNode("div",ks,[e.createElementVNode("div",Vs,[t[4]||(t[4]=e.createElementVNode("div",{class:"card-title"},"AIS Info",-1)),e.createElementVNode("div",Ns,"Updated at "+e.toDisplayString(n.computeUpdateTime((V=(f=(c=o.voyage)==null?void 0:c.vessel)==null?void 0:f.ais)==null?void 0:V.positionTime)),1)]),e.createElementVNode("div",us,[e.createElementVNode("div",bs,[e.createElementVNode("div",null,[t[5]||(t[5]=e.createElementVNode("label",null,"Status",-1)),e.createElementVNode("span",null,e.toDisplayString((y=(C=(N=o.voyage)==null?void 0:N.vessel)==null?void 0:C.ais)==null?void 0:y.labelEn),1)]),e.createElementVNode("div",null,[t[6]||(t[6]=e.createElementVNode("label",null,"Call Sign",-1)),e.createElementVNode("span",null,e.toDisplayString(((D=(b=o.voyage)==null?void 0:b.vessel)==null?void 0:D.callSign)||"-"),1)])]),e.createElementVNode("div",xs,[e.createElementVNode("div",null,[t[7]||(t[7]=e.createElementVNode("label",null,"Latitude",-1)),e.createElementVNode("span",null,e.toDisplayString(n.computeLat((S=(k=(m=o.voyage)==null?void 0:m.vessel)==null?void 0:k.ais)==null?void 0:S.lat)||"-"),1)]),e.createElementVNode("div",null,[t[8]||(t[8]=e.createElementVNode("label",null,"Longitude",-1)),e.createElementVNode("span",null,e.toDisplayString(n.computeLng((L=(T=(u=o.voyage)==null?void 0:u.vessel)==null?void 0:T.ais)==null?void 0:L.lng)||"-"),1)])]),e.createVNode(r,{style:{margin:"5px 0"}}),e.createElementVNode("div",Cs,[e.createElementVNode("div",null,[t[9]||(t[9]=e.createElementVNode("label",null,"SOG",-1)),e.createElementVNode("div",null,e.toDisplayString(n.computeRoundPrecision((M=(g=(R=o.voyage)==null?void 0:R.vessel)==null?void 0:g.ais)==null?void 0:M.sog,1))+" kts",1)]),e.createElementVNode("div",null,[t[10]||(t[10]=e.createElementVNode("label",null,"COG",-1)),e.createElementVNode("div",null,e.toDisplayString(n.computeRoundPrecision((F=(_=(A=o.voyage)==null?void 0:A.vessel)==null?void 0:_.ais)==null?void 0:F.cog,0))+" deg",1)]),e.createElementVNode("div",null,[t[11]||(t[11]=e.createElementVNode("label",null,"HDG",-1)),e.createElementVNode("div",null,e.toDisplayString(n.computeRoundPrecision((U=(B=(I=o.voyage)==null?void 0:I.vessel)==null?void 0:B.ais)==null?void 0:U.hdg,0))+" deg",1)]),e.createElementVNode("div",null,[t[12]||(t[12]=e.createElementVNode("label",{style:{"margin-right":"0"}},"Draught",-1)),e.createElementVNode("div",null,e.toDisplayString(n.computeRoundPrecision((ne=(J=(j=o.voyage)==null?void 0:j.vessel)==null?void 0:J.ais)==null?void 0:ne.draught,1))+" m",1)])])])]),e.createElementVNode("div",Ls,[e.createElementVNode("div",_s,[t[15]||(t[15]=e.createElementVNode("div",{class:"card-title"},"Leg Info",-1)),((ae=(oe=o.voyage)==null?void 0:oe.legs)==null?void 0:ae.length)>1?(e.openBlock(),e.createElementBlock("div",Ss,[e.createElementVNode("div",{class:e.normalizeClass(s.rank===((re=(ie=o.voyage)==null?void 0:ie.legs)==null?void 0:re.length)?"disabled":"active"),onClick:t[0]||(t[0]=(...E)=>n.toggleLegRight&&n.toggleLegRight(...E))},t[13]||(t[13]=[e.createElementVNode("i",{class:"iconfont"},"",-1)]),2),e.createElementVNode("div",{class:e.normalizeClass(s.rank===1?"disabled":"active"),onClick:t[1]||(t[1]=(...E)=>n.toggleLegLeft&&n.toggleLegLeft(...E))},t[14]||(t[14]=[e.createElementVNode("i",{class:"iconfont"},"",-1)]),2)])):e.createCommentVNode("",!0)]),((ce=(de=o.voyage)==null?void 0:de.legs)==null?void 0:ce.length)>0?(e.openBlock(),e.createElementBlock("div",ws,[e.createElementVNode("div",Ts,[e.createElementVNode("div",{class:"wayport text-ellipsis",onClick:t[2]||(t[2]=E=>{var le,v,ee,te;return n.handleCenter({position:[(v=(le=n.currentLeg)==null?void 0:le.departure)==null?void 0:v.lng,(te=(ee=n.currentLeg)==null?void 0:ee.departure)==null?void 0:te.lat],flyTo:!0})})},[e.createElementVNode("span",Ds,e.toDisplayString(n.computeWayport((he=n.currentLeg)==null?void 0:he.departure)),1)]),t[16]||(t[16]=e.createElementVNode("div",{style:{padding:"0 10px"}},"~",-1)),e.createElementVNode("div",{class:"wayport text-ellipsis",style:{"text-align":"right"},onClick:t[3]||(t[3]=E=>{var le,v,ee,te;return n.handleCenter({position:[(v=(le=n.currentLeg)==null?void 0:le.destination)==null?void 0:v.lng,(te=(ee=n.currentLeg)==null?void 0:ee.destination)==null?void 0:te.lat],flyTo:!0})})},[e.createElementVNode("span",Rs,e.toDisplayString(n.computeWayport((me=n.currentLeg)==null?void 0:me.destination)),1)])]),e.createElementVNode("div",Bs,[e.createVNode(d,{percentage:n.computeLegProgress((pe=n.currentLeg)==null?void 0:pe.line),"show-text":!1,style:{width:"100%"},color:"var(--idm-success-color)"},null,8,["percentage"])]),e.createElementVNode("div",Ms,[e.createElementVNode("div",Os,[e.createElementVNode("div",As,[(ge=n.currentLeg)!=null&&ge.atd?(e.openBlock(),e.createElementBlock("label",Is,"ATD")):(e.openBlock(),e.createElementBlock("label",Hs,"ETD")),e.createElementVNode("label",zs,"( UTC "+e.toDisplayString(n.computeTimeOffset((fe=n.currentLeg)==null?void 0:fe.departure))+" )",1)]),e.createElementVNode("div",Fs,[(ye=n.currentLeg)!=null&&ye.atd?(e.openBlock(),e.createElementBlock("span",Ws,e.toDisplayString(n.computeLocalTime((Ee=n.currentLeg)==null?void 0:Ee.atd,(ke=n.currentLeg)==null?void 0:ke.departure)),1)):(e.openBlock(),e.createElementBlock("span",Ps,e.toDisplayString(n.computeLocalTime((Ve=n.currentLeg)==null?void 0:Ve.etd,(Ne=n.currentLeg)==null?void 0:Ne.departure)),1))]),(ue=n.currentLeg)!=null&&ue.line?(e.openBlock(),e.createElementBlock("div",Gs,[e.createVNode(h,null,{default:e.withCtx(()=>[e.createVNode(i)]),_:1}),e.createElementVNode("span",null,e.toDisplayString(n.computeRoundPrecision((xe=(be=n.currentLeg)==null?void 0:be.line)==null?void 0:xe.sailingTime,0))+"hrs",1),t[17]||(t[17]=e.createElementVNode("label",null,"|",-1)),t[18]||(t[18]=e.createElementVNode("i",{class:"iconfont"},"",-1)),e.createElementVNode("span",null,e.toDisplayString(n.computeRoundPrecision((Le=(Ce=n.currentLeg)==null?void 0:Ce.line)==null?void 0:Le.sailingDistance,0))+"nm",1)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",Us,[e.createElementVNode("div",Zs,[(_e=n.currentLeg)!=null&&_e.ata?(e.openBlock(),e.createElementBlock("label",$s,"ATA")):(e.openBlock(),e.createElementBlock("label",qs,"ETA")),e.createElementVNode("label",js,"( UTC "+e.toDisplayString(n.computeTimeOffset((Se=n.currentLeg)==null?void 0:Se.destination))+" )",1)]),e.createElementVNode("div",Js,[(we=n.currentLeg)!=null&&we.ata?(e.openBlock(),e.createElementBlock("span",Ks,e.toDisplayString(n.computeLocalTime((Te=n.currentLeg)==null?void 0:Te.ata,(De=n.currentLeg)==null?void 0:De.destination)),1)):(e.openBlock(),e.createElementBlock("span",Xs,e.toDisplayString(n.computeLocalTime((Re=n.currentLeg)==null?void 0:Re.eta,(Be=n.currentLeg)==null?void 0:Be.destination)),1))]),(Me=n.currentLeg)!=null&&Me.line?(e.openBlock(),e.createElementBlock("div",Qs,[e.createVNode(h,null,{default:e.withCtx(()=>[e.createVNode(i)]),_:1}),e.createElementVNode("span",null,e.toDisplayString(n.computeRoundPrecision((Ae=(Oe=n.currentLeg)==null?void 0:Oe.line)==null?void 0:Ae.remainTime,0))+"hrs",1),t[19]||(t[19]=e.createElementVNode("label",null,"|",-1)),t[20]||(t[20]=e.createElementVNode("i",{class:"iconfont"},"",-1)),e.createElementVNode("span",null,e.toDisplayString(n.computeRoundPrecision((He=(Ie=n.currentLeg)==null?void 0:Ie.line)==null?void 0:He.remainDistance,0))+"nm",1)])):e.createCommentVNode("",!0)])]),(K=n.currentLeg)!=null&&K.line?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Ys,"Not Enough Data for Now !"))])):(e.openBlock(),e.createElementBlock("div",vs,t[21]||(t[21]=[e.createElementVNode("div",{class:"flex-center",style:{"font-size":"14px"}},"No Active Leg for Now !",-1)])))]),e.createElementVNode("div",en,[t[28]||(t[28]=e.createElementVNode("div",{class:"title-box flex-space"},[e.createElementVNode("div",{class:"card-title"},"Voyage Info")],-1)),e.createElementVNode("div",tn,[e.createElementVNode("div",ln,[e.createElementVNode("div",null,[t[22]||(t[22]=e.createElementVNode("label",null,"Company",-1)),e.createElementVNode("span",null,e.toDisplayString(((Q=(X=o.voyage)==null?void 0:X.company)==null?void 0:Q.name)||"-")+"( "+e.toDisplayString((Xe=(Y=o.voyage)==null?void 0:Y.company)==null?void 0:Xe.code)+" )",1)])]),e.createElementVNode("div",sn,[e.createElementVNode("div",null,[t[23]||(t[23]=e.createElementVNode("label",null,"Voy.Num.",-1)),e.createElementVNode("span",null,e.toDisplayString(((Qe=o.voyage)==null?void 0:Qe.number)||"-"),1)]),e.createElementVNode("div",null,[t[24]||(t[24]=e.createElementVNode("label",null,"LoadCondition",-1)),e.createElementVNode("span",null,e.toDisplayString(((Ye=o.voyage)==null?void 0:Ye.loadCondition)||"-"),1)])]),e.createElementVNode("div",nn,[e.createElementVNode("div",null,[t[25]||(t[25]=e.createElementVNode("label",null,"Service",-1)),e.createElementVNode("span",null,e.toDisplayString(((ve=o.voyage)==null?void 0:ve.serviceType)||"-"),1)]),e.createElementVNode("div",null,[t[26]||(t[26]=e.createElementVNode("label",null,"Status",-1)),e.createElementVNode("span",null,e.toDisplayString(((et=o.voyage)==null?void 0:et.status)||"-"),1)])]),e.createElementVNode("div",on,[t[27]||(t[27]=e.createElementVNode("div",{class:"flex-center"},"CP Terms",-1)),e.createVNode(r,{style:{margin:"5px 0"}}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.cpList,E=>(e.openBlock(),e.createElementBlock("div",{class:"flex-space",key:E.id},[e.createElementVNode("span",an,e.toDisplayString(E==null?void 0:E.loadCondition),1),e.createElementVNode("span",rn,e.toDisplayString(E==null?void 0:E.type),1),e.createElementVNode("span",dn,"SPD "+e.toDisplayString(E==null?void 0:E.speed)+"kts",1),e.createElementVNode("span",cn,"FO "+e.toDisplayString(E==null?void 0:E.fo)+"mt",1),e.createElementVNode("span",hn,"MGO "+e.toDisplayString(E==null?void 0:E.dgo)+"mt",1)]))),128))])])]),e.createElementVNode("div",mn,[(lt=(tt=o.bps)==null?void 0:tt.segments)!=null&&lt.length?(e.openBlock(),e.createElementBlock("div",pn,t[29]||(t[29]=[e.createElementVNode("span",{class:"card-title"},"Performance since BOSP",-1)]))):e.createCommentVNode("",!0),(nt=(st=o.bps)==null?void 0:st.segments)!=null&&nt.length?(e.openBlock(),e.createElementBlock("section",gn,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList((ot=o.bps)==null?void 0:ot.segments,(E,le)=>{var v,ee,te,at,it,rt,dt,ct,ht,mt,pt,gt,ft,yt,Et,kt,Vt,Nt,ut,bt,xt,Ct,Lt,_t,St,wt,Tt,Dt,Rt,Bt,Mt,Ot,At,It,Ht,zt,Ft,Wt,Pt,Gt,Ut,Zt,$t,qt,jt,Jt,Kt,Xt,Qt,Yt,vt,el,tl,ll,sl,nl,ol,al,il;return e.openBlock(),e.createElementBlock("div",{key:le,class:"card-box bps"},[e.createElementVNode("div",fn,[e.createElementVNode("span",yn,"Seg "+e.toDisplayString(E.seg),1),t[31]||(t[31]=e.createElementVNode("label",{class:"based-on"},"Based on",-1)),e.createElementVNode("div",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList((v=E==null?void 0:E.extend)==null?void 0:v.segTimes,(Z,wr)=>{var rl,dl,cl,hl;return e.openBlock(),e.createElementBlock("div",{key:wr+"segTime"},[e.createElementVNode("span",null,e.toDisplayString((rl=Z==null?void 0:Z.departure)==null?void 0:rl.noonType)+" "+e.toDisplayString(n.computeUTCTime((dl=Z==null?void 0:Z.departure)==null?void 0:dl.utcTime)),1),t[30]||(t[30]=e.createElementVNode("span",null,"~",-1)),e.createElementVNode("span",null,e.toDisplayString((cl=Z==null?void 0:Z.arrival)==null?void 0:cl.noonType)+" "+e.toDisplayString(n.computeUTCTime((hl=Z==null?void 0:Z.arrival)==null?void 0:hl.utcTime)),1)])}),128))])]),e.createElementVNode("div",En,[t[32]||(t[32]=e.createElementVNode("div",{class:"flex-center"},"CP Terms",-1)),e.createVNode(r,{style:{margin:"5px 0"}}),e.createElementVNode("div",kn,[e.createElementVNode("span",null,e.toDisplayString((te=(ee=E.extend)==null?void 0:ee.cp)==null?void 0:te.loadCondition),1),e.createElementVNode("span",null,e.toDisplayString((it=(at=E.extend)==null?void 0:at.cp)==null?void 0:it.type),1),e.createElementVNode("span",null,"SPD "+e.toDisplayString((dt=(rt=E.extend)==null?void 0:rt.cp)==null?void 0:dt.speed)+"kts",1),e.createElementVNode("span",null,"FO "+e.toDisplayString((ht=(ct=E.extend)==null?void 0:ct.cp)==null?void 0:ht.fo)+"mt",1),e.createElementVNode("span",null,"MGO "+e.toDisplayString((pt=(mt=E.extend)==null?void 0:mt.cp)==null?void 0:pt.dgo)+"mt",1)])]),e.createElementVNode("div",Vn,[t[34]||(t[34]=e.createElementVNode("div",{class:"flex-center"},"CII Evaluation",-1)),e.createVNode(r,{style:{margin:"5px 0"}}),e.createElementVNode("div",Nn,[e.createElementVNode("span",null,e.toDisplayString(((gt=E.cii)==null?void 0:gt.year)??"-")+" - "+e.toDisplayString(((ft=E.cii)==null?void 0:ft.z)??"-")+"%",1),e.createElementVNode("span",null,"Required "+e.toDisplayString(((yt=E.cii)==null?void 0:yt.requiredCii)??"-"),1),e.createElementVNode("span",null,"Estimated "+e.toDisplayString(((Et=E.cii)==null?void 0:Et.attainedCii)??"-"),1),e.createElementVNode("div",un,[t[