@idmui/spot 0.0.5 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -609,7 +609,7 @@ const ke = (l, e) => {
609
609
  const J = I(this.pickedDate).clone().add(u, "h").format();
610
610
  this.tableData.hours.push(J);
611
611
  const d = ((l = we.pickHourly(this.meteoData, J)) == null ? void 0 : l[0]) || {};
612
- this.tableData.weatherUrls.push((e = d.weather) == null ? void 0 : e.url), this.tableData.weatherNames.push(((t = d.weather) == null ? void 0 : t.name) ?? "-"), this.tableData.temp.push(this.roundPrecision((h = d.weather) == null ? void 0 : h.temp, 0) ?? "-"), this.tableData.precipProbability.push(this.roundPrecision((m = (s = d.weather) == null ? void 0 : s.precip) == null ? void 0 : m.probability, 0) ?? "-"), this.tableData.precip1h.push(this.roundPrecision((P = (L = d.weather) == null ? void 0 : L.precip) == null ? void 0 : P.sum, 0) ?? "-"), this.tableData.visibility.push(this.roundPrecision((z = d.weather) == null ? void 0 : z.visibility, 0) ?? "-"), this.tableData.humidity.push(this.roundPrecision((S = d.weather) == null ? void 0 : S.rh, 0) ?? "-"), this.tableData.windSpeed.push(this.roundPrecision((C = (M = d.weather) == null ? void 0 : M.wind) == null ? void 0 : C.kts, 1)), this.tableData.windDir.push((k = (f = d.weather) == null ? void 0 : f.wind) == null ? void 0 : k.bearing), this.tableData.windGust.push(this.roundPrecision((r = (a = d.weather) == null ? void 0 : a.wind) == null ? void 0 : r.gusts, 1) ?? "-"), this.tableData.sigwaveHeight.push(this.roundPrecision((W = (H = d.wave) == null ? void 0 : H.sig) == null ? void 0 : W.height, 1) ?? "-"), this.tableData.sigwaveDir.push((R = (T = d.wave) == null ? void 0 : T.sig) == null ? void 0 : R.bearing), this.tableData.windwaveHeight.push(this.roundPrecision((A = (E = d.wave) == null ? void 0 : E.wd) == null ? void 0 : A.height, 1) ?? "-"), this.tableData.windwaveDir.push((F = (G = d.wave) == null ? void 0 : G.wd) == null ? void 0 : F.bearing), this.tableData.windwavePeriod.push(this.roundPrecision((O = (V = d.wave) == null ? void 0 : V.wd) == null ? void 0 : O.period, 1) ?? "-"), this.tableData.swellHeight.push(this.roundPrecision((b = (w = d.wave) == null ? void 0 : w.swell) == null ? void 0 : b.height, 1) ?? "-"), this.tableData.swellDir.push((Z = (N = d.wave) == null ? void 0 : N.swell) == null ? void 0 : Z.bearing), this.tableData.swellPeriod.push(this.roundPrecision((Y = (j = d.wave) == null ? void 0 : j.swell) == null ? void 0 : Y.period, 1) ?? "-"), this.tableData.currentSpeed.push(this.roundPrecision((D = d.current) == null ? void 0 : D.speed, 1) ?? "-"), this.tableData.currentDir.push((B = d.current) == null ? void 0 : B.bearing), this.tableData.seaLevel.push(this.roundPrecision(d.height, 1) ?? "-"), this.tableData.seaTemp.push(this.roundPrecision(d.sst, 1) ?? "-");
612
+ this.tableData.weatherUrls.push((e = d.weather) == null ? void 0 : e.url), this.tableData.weatherNames.push(((t = d.weather) == null ? void 0 : t.name) ?? "-"), this.tableData.temp.push(this.roundPrecision((h = d.weather) == null ? void 0 : h.temp, 0) ?? "-"), this.tableData.precipProbability.push(this.roundPrecision((m = (s = d.weather) == null ? void 0 : s.precip) == null ? void 0 : m.probability, 0) ?? "-"), this.tableData.precip1h.push(this.roundPrecision((P = (L = d.weather) == null ? void 0 : L.precip) == null ? void 0 : P.sum, 0) ?? "-"), this.tableData.visibility.push(this.roundPrecision((z = d.weather) == null ? void 0 : z.visibility, 0) ?? "-"), this.tableData.humidity.push(this.roundPrecision((S = d.weather) == null ? void 0 : S.rh, 0) ?? "-"), this.tableData.windSpeed.push(this.roundPrecision((C = (M = d.weather) == null ? void 0 : M.wind) == null ? void 0 : C.kts, 1)), this.tableData.windDir.push((k = (f = d.weather) == null ? void 0 : f.wind) == null ? void 0 : k.bearing), this.tableData.windGust.push(this.roundPrecision((r = (a = d.weather) == null ? void 0 : a.wind) == null ? void 0 : r.gusts, 1) ?? "-"), this.tableData.sigwaveHeight.push(this.roundPrecision((W = (H = d.wave) == null ? void 0 : H.sig) == null ? void 0 : W.height, 1) ?? "-"), this.tableData.sigwaveDir.push((R = (T = d.wave) == null ? void 0 : T.sig) == null ? void 0 : R.bearing), this.tableData.windwaveHeight.push(this.roundPrecision((A = (E = d.wave) == null ? void 0 : E.wd) == null ? void 0 : A.height, 1) ?? "-"), this.tableData.windwaveDir.push((F = (G = d.wave) == null ? void 0 : G.wd) == null ? void 0 : F.bearing), this.tableData.windwavePeriod.push(this.roundPrecision((O = (V = d.wave) == null ? void 0 : V.wd) == null ? void 0 : O.period, 1) ?? "-"), this.tableData.swellHeight.push(this.roundPrecision((b = (w = d.wave) == null ? void 0 : w.swell) == null ? void 0 : b.height, 1) ?? "-"), this.tableData.swellDir.push((Z = (N = d.wave) == null ? void 0 : N.swell) == null ? void 0 : Z.bearing), this.tableData.swellPeriod.push(this.roundPrecision((Y = (j = d.wave) == null ? void 0 : j.swell) == null ? void 0 : Y.period, 1) ?? "-"), this.tableData.currentSpeed.push(this.roundPrecision((D = d.current) == null ? void 0 : D.speed, 1) ?? "-"), this.tableData.currentDir.push((B = d.current) == null ? void 0 : B.bearing), this.tableData.seaLevel.push(this.roundPrecision(d.height, 1) ?? "-"), this.tableData.seaTemp.push(this.roundPrecision(d.sst, 0) ?? "-");
613
613
  }
614
614
  },
615
615
  initEchart() {
@@ -1441,7 +1441,7 @@ function vt(l, e, t, h, s, m) {
1441
1441
  ])
1442
1442
  ]);
1443
1443
  }
1444
- const yt = /* @__PURE__ */ ke(De, [["render", vt], ["__scopeId", "data-v-7b348412"]]), zt = {
1444
+ const yt = /* @__PURE__ */ ke(De, [["render", vt], ["__scopeId", "data-v-6a06d61a"]]), zt = {
1445
1445
  install(l) {
1446
1446
  l.component("SpotReport", yt);
1447
1447
  }
@@ -1 +1 @@
1
- (function(f,k){typeof exports=="object"&&typeof module<"u"?k(exports,require("moment"),require("moment-timezone"),require("@element-plus/icons-vue"),require("@idm-plugin/geo"),require("echarts"),require("vue"),require("axios")):typeof define=="function"&&define.amd?define(["exports","moment","moment-timezone","@element-plus/icons-vue","@idm-plugin/geo","echarts","vue","axios"],k):(f=typeof globalThis<"u"?globalThis:f||self,k(f["idmui-report"]={},f.moment,f["moment-timezone"],f["@element-plus/icons-vue"],f["@idm-plugin/geo"],f.echarts,f.Vue,f.axios))})(this,function(f,k,O,ie,Y,re,e,X){"use strict";function le(o){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const s in o)if(s!=="default"){const r=Object.getOwnPropertyDescriptor(o,s);Object.defineProperty(t,s,r.get?r:{enumerable:!0,get:()=>o[s]})}}return t.default=o,Object.freeze(t)}const v=le(re);class ${static pickHourly(t,s){var r,a,m,N,B,x,_,E,D,w,y,n,i,z,V,S,L,C,M,P,T,I,H,p,g,b,R,j,G,u,F,h,A,l,U,Z,te,se;const ae=typeof s=="string"?k(s):s,J=t.weather,ot=t.marine,ne=k(J[0].hourly.date).utc(),K=ne.clone().add(J[0].hourly.time.at(0),"h"),it=ne.clone().add(J[0].hourly.time.at(-1),"h"),oe=[];if(ae.isBetween(K,it,"millisecond","[]")){const c=ae.utc().diff(K,"h",!1);let W,q;for(const Q of J){const d=Q.hourly;W={temp:(r=d.temperature_2m)==null?void 0:r.at(c),apparentTemp:(a=d.apparent_temperature)==null?void 0:a.at(c),rh:(m=d.relative_humidity_2m)==null?void 0:m.at(c),dp:(N=d.dew_point_2m)==null?void 0:N.at(c),precip:{probability:(B=d.precipitation_probability)==null?void 0:B.at(c),sum:(x=d.precipitation)==null?void 0:x.at(c)},code:(_=d.weather_code)==null?void 0:_.at(c),visibility:this.m2nm((E=d.visibility)==null?void 0:E.at(c)),wind:{speed:(D=d.wind_speed_10m)==null?void 0:D.at(c),kts:(w=d.wind_speed_10m)==null?void 0:w.at(c),degree:(y=d.wind_direction_10m)==null?void 0:y.at(c),bearing:((n=d.wind_direction_10m)==null?void 0:n.at(c))!==null?(((i=d.wind_direction_10m)==null?void 0:i.at(c))+180)%360:null,gusts:(z=d.wind_gusts_10m)==null?void 0:z.at(c)},isDay:(V=d.is_day)==null?void 0:V.at(c)};const{name:rt,url:lt}=this.parseWeatherCode(W.code,W.isDay);W.name=rt,W.url=lt,W.wind.scale=this.beaufort(this.kts2ms(W.wind.kts)),W.wind.direction=this.degree2Direction(W.wind.degree)}for(const Q of ot){const d=Q.hourly;q={wave:{sig:{height:(S=d.wave_height)==null?void 0:S.at(c),degree:(L=d.wave_direction)==null?void 0:L.at(c),bearing:((C=d.wave_direction)==null?void 0:C.at(c))!==null?(((M=d.wave_direction)==null?void 0:M.at(c))+180)%360:null,period:(P=d.wave_period)==null?void 0:P.at(c)},swell:{height:(T=d.swell_wave_height)==null?void 0:T.at(c),degree:(I=d.swell_wave_direction)==null?void 0:I.at(c),bearing:((H=d.swell_wave_direction)==null?void 0:H.at(c))!==null?(((p=d.swell_wave_direction)==null?void 0:p.at(c))+180)%360:null,period:(g=d.swell_wave_period)==null?void 0:g.at(c),peakPeriod:(b=d.swell_wave_peak_period)==null?void 0:b.at(c)},wd:{height:(R=d.wind_wave_height)==null?void 0:R.at(c),degree:(j=d.wind_wave_direction)==null?void 0:j.at(c),bearing:((G=d.wind_wave_direction)==null?void 0:G.at(c))!==null?(((u=d.wind_wave_direction)==null?void 0:u.at(c))+180)%360:null,period:(F=d.wind_wave_period)==null?void 0:F.at(c),peakPeriod:(h=d.wind_wave_peak_period)==null?void 0:h.at(c)}},current:{speed:(A=d.ocean_current_velocity)==null?void 0:A.at(c),kts:(l=d.ocean_current_velocity)==null?void 0:l.at(c),degree:(U=d.ocean_current_direction)==null?void 0:U.at(c),bearing:((Z=d.ocean_current_direction)==null?void 0:Z.at(c))??null},sst:(te=d.sea_surface_temperature)==null?void 0:te.at(c),height:(se=d.sea_level_height_msl)==null?void 0:se.at(c)},q.wave=this.parseWave(q.wave),q.current.direction=this.degree2Direction(q.current.degree)}oe.push({utc:K.add(c,"h").format(),weather:{...W},...q})}return oe}static pickDaily(t,s){var r,a,m,N,B,x,_,E,D,w,y,n,i,z,V,S,L,C,M,P,T,I,H;const p=typeof s=="string"?k(s):s,g=t.weather,b=t.marine,R=k(g[0].daily.time.at(0)),j=k(g[0].daily.time.at(-1)),G=[];if(p.isBetween(R,j,"millisecond","[]")){let u,F;const h=p.diff(R,"d",!1);for(const A of g){const l=A.daily;u={code:(r=l.weather_code)==null?void 0:r.at(h),temp:{max:(a=l.temperature_2m_max)==null?void 0:a.at(h),min:(m=l.temperature_2m_min)==null?void 0:m.at(h)},apparentTemp:{max:(N=l.apparent_temperature_max)==null?void 0:N.at(h),min:(B=l.apparent_temperature_min)==null?void 0:B.at(h)},precip:{sum:(x=l.precipitation_sum)==null?void 0:x.at(h),hours:(_=l.precipitation_hours)==null?void 0:_.at(h),probability:(E=l.precipitation_probability_max)==null?void 0:E.at(h)},wind:{speed:(D=l.wind_speed_10m_max)==null?void 0:D.at(h),kts:(w=l.wind_speed_10m_max)==null?void 0:w.at(h),degree:(y=l.wind_direction_10m_dominant)==null?void 0:y.at(h),gusts:(n=l.wind_gusts_10m_max)==null?void 0:n.at(h)}};const{name:U,url:Z}=this.parseWeatherCode(u.code,!0);u.name=U,u.url=Z,u.wind.scale=this.beaufort(this.kts2ms(u.wind.kts)),u.wind.direction=this.degree2Direction(u.wind.degree)}for(const A of b){const l=A.daily;F={wave:{sig:{height:(i=l.wave_height_max)==null?void 0:i.at(h),degree:(z=l.wave_direction_dominant)==null?void 0:z.at(h),period:(V=l.wave_period_max)==null?void 0:V.at(h)},swell:{height:(S=l.swell_wave_height_max)==null?void 0:S.at(h),degree:(L=l.wave_direction_dominant)==null?void 0:L.at(h),period:(C=l.swell_wave_period_max)==null?void 0:C.at(h),peakPeriod:(M=l.swell_wave_peak_period_max)==null?void 0:M.at(h)},wd:{height:(P=l.wind_wave_height_max)==null?void 0:P.at(h),degree:(T=l.wind_wave_direction_dominant)==null?void 0:T.at(h),period:(I=l.wind_wave_period_max)==null?void 0:I.at(h),peakPeriod:(H=l.wind_wave_peak_period_max)==null?void 0:H.at(h)}}},F.wave=this.parseWave(F.wave)}G.push({utc:R.add(h,"d").utc().format(),weather:{...u},...F})}return G}static parseWave(t){return t.sig.direction=this.degree2Direction(t.sig.degree),t.swell.direction=this.degree2Direction(t.swell.degree),t.wd.direction=this.degree2Direction(t.wd.degree),t.sig.scale=this.douglas(t.sig.height),t.swell.scale=this.douglas(t.swell.height),t.wd.scale=this.douglas(t.wd.height),t}static parseWeatherCode(t,s){const r=this.weatherCode(t);return s?r.day:r.night}static weatherCode(t){const s={code:t};switch(t){case 0:s.day={name:"Sunny",url:"https://osshz.idmwx.com/asset/weather/01d.svg"},s.night={name:"Clear",url:"https://osshz.idmwx.com/asset/weather/01n.svg"};break;case 1:s.day={name:"Mainly Sunny",url:"https://osshz.idmwx.com/asset/weather/01d.svg"},s.night={name:"Mainly Clear",url:"https://osshz.idmwx.com/asset/weather/01n.svg"};break;case 2:s.day={name:"Partly Cloudy",url:"https://osshz.idmwx.com/asset/weather/02d.svg"},s.night={name:"Partly Cloudy",url:"https://osshz.idmwx.com/asset/weather/02n.svg"};break;case 3:s.day={name:"Cloudy",url:"https://osshz.idmwx.com/asset/weather/03d.svg"},s.night={name:"Cloudy",url:"https://osshz.idmwx.com/asset/weather/03n.svg"};break;case 45:s.day={name:"Foggy",url:"https://osshz.idmwx.com/asset/weather/50d.svg"},s.night={name:"Foggy",url:"https://osshz.idmwx.com/asset/weather/50n.svg"};break;case 48:s.day={name:"Rime Fog",url:"https://osshz.idmwx.com/asset/weather/50d.svg"},s.night={name:"Rime Fog",url:"https://osshz.idmwx.com/asset/weather/50n.svg"};break;case 51:s.day={name:"Light Drizzle",url:"https://osshz.idmwx.com/asset/weather/09d.svg"},s.night={name:"Light Drizzle",url:"https://osshz.idmwx.com/asset/weather/09n.svg"};break;case 53:s.day={name:"Drizzle",url:"https://osshz.idmwx.com/asset/weather/09d.svg"},s.night={name:"Drizzle",url:"https://osshz.idmwx.com/asset/weather/09n.svg"};break;case 55:s.day={name:"Heavy Drizzle",url:"https://osshz.idmwx.com/asset/weather/09d.svg"},s.night={name:"Heavy Drizzle",url:"https://osshz.idmwx.com/asset/weather/09n.svg"};break;case 56:s.day={name:"Light Freezing Drizzle",url:"https://osshz.idmwx.com/asset/weather/09d.svg"},s.night={name:"Light Freezing Drizzle",url:"https://osshz.idmwx.com/asset/weather/09n.svg"};break;case 57:s.day={name:"Freezing Drizzle",url:"https://osshz.idmwx.com/asset/weather/09d.svg"},s.night={name:"Freezing Drizzle",url:"https://osshz.idmwx.com/asset/weather/09n.svg"};break;case 61:s.day={name:"Light Rain",url:"https://osshz.idmwx.com/asset/weather/10d.svg"},s.night={name:"Light Rain",url:"https://osshz.idmwx.com/asset/weather/10n.svg"};break;case 63:s.day={name:"Rain",url:"https://osshz.idmwx.com/asset/weather/10d.svg"},s.night={name:"Rain",url:"https://osshz.idmwx.com/asset/weather/10n.svg"};break;case 65:s.day={name:"Heavy Rain",url:"https://osshz.idmwx.com/asset/weather/10d.svg"},s.night={name:"Heavy Rain",url:"https://osshz.idmwx.com/asset/weather/10n.svg"};break;case 66:s.day={name:"Light Freezing Rain",url:"https://osshz.idmwx.com/asset/weather/10d.svg"},s.night={name:"Light Freezing Rain",url:"https://osshz.idmwx.com/asset/weather/10n.svg"};break;case 67:s.day={name:"Freezing Rain",url:"https://osshz.idmwx.com/asset/weather/10d.svg"},s.night={name:"Freezing Rain",url:"https://osshz.idmwx.com/asset/weather/10n.svg"};break;case 71:s.day={name:"Light Snow",url:"https://osshz.idmwx.com/asset/weather/13d.svg"},s.night={name:"Light Snow",url:"https://osshz.idmwx.com/asset/weather/13n.svg"};break;case 73:s.day={name:"Snow",url:"https://osshz.idmwx.com/asset/weather/13d.svg"},s.night={name:"Snow",url:"https://osshz.idmwx.com/asset/weather/13n.svg"};break;case 75:s.day={name:"Heavy Snow",url:"https://osshz.idmwx.com/asset/weather/13d.svg"},s.night={name:"Heavy Snow",url:"https://osshz.idmwx.com/asset/weather/13n.svg"};break;case 77:s.day={name:"Snow Grains",url:"https://osshz.idmwx.com/asset/weather/13d.svg"},s.night={name:"Snow Grains",url:"https://osshz.idmwx.com/asset/weather/13n.svg"};break;case 80:s.day={name:"Light Showers",url:"https://osshz.idmwx.com/asset/weather/09d.svg"},s.night={name:"Light Showers",url:"https://osshz.idmwx.com/asset/weather/09n.svg"};break;case 81:s.day={name:"Showers",url:"https://osshz.idmwx.com/asset/weather/09d.svg"},s.night={name:"Showers",url:"https://osshz.idmwx.com/asset/weather/09n.svg"};break;case 82:s.day={name:"Heavy Showers",url:"https://osshz.idmwx.com/asset/weather/09d.svg"},s.night={name:"Heavy Showers",url:"https://osshz.idmwx.com/asset/weather/09n.svg"};break;case 85:s.day={name:"Light Snow Showers",url:"https://osshz.idmwx.com/asset/weather/13d.svg"},s.night={name:"Light Snow Showers",url:"https://osshz.idmwx.com/asset/weather/13n.svg"};break;case 86:s.day={name:"Snow Showers",url:"https://osshz.idmwx.com/asset/weather/13d.svg"},s.night={name:"Snow Showers",url:"https://osshz.idmwx.com/asset/weather/13n.svg"};break;case 95:s.day={name:"Thunderstorm",url:"https://osshz.idmwx.com/asset/weather/11d.svg"},s.night={name:"Thunderstorm",url:"https://osshz.idmwx.com/asset/weather/11n.svg"};break;case 96:s.day={name:"Light Thunderstorms With Hail",url:"https://osshz.idmwx.com/asset/weather/11d.svg"},s.night={name:"Light Thunderstorms With Hail",url:"https://osshz.idmwx.com/asset/weather/11n.svg"};break;case 99:s.day={name:"Thunderstorms With Hail",url:"https://osshz.idmwx.com/asset/weather/11d.svg"},s.night={name:"Thunderstorms With Hail",url:"https://osshz.idmwx.com/asset/weather/11n.svg"};break}return s}static kts2ms(t){return isNaN(t)?t:Math.round(t*1852/3600*1e4)/1e4}static kts2kmh(t){return isNaN(t)?t:t*1.852}static m2nm(t){return isNaN(t)?t:Math.round(t/1e3/1.852*1e4)/1e4}static kmh2kts(t){return isNaN(t)?t:this.ms2kts(t*1e3/3600)}static ms2kts(t){return isNaN(t)?t:Math.round(t*3600/1852*1e4)/1e4}static degree2Radian(t){if(isNaN(t)||t===null)return t;let s=t%360/360*2*Math.PI;return s=s<0?s+2*Math.PI:s,s}static degree2Direction(t){const s=this.degree2Radian(t);if(isNaN(s)||s===null)return null;let r="N/A";const a=Math.PI/16;return s<a?r="N":s>=a&&s<3*a?r="NNE":s>=3*a&&s<5*a?r="NE":s>=5*a&&s<7*a?r="ENE":s>=7*a&&s<9*a?r="E":s>=9*a&&s<11*a?r="ESE":s>=11*a&&s<13*a?r="SE":s>=13*a&&s<15*a?r="SSE":s>=15*a&&s<17*a?r="S":s>=17*a&&s<19*a?r="SSW":s>=19*a&&s<21*a?r="SW":s>=21*a&&s<23*a?r="WSW":s>=23*a&&s<25*a?r="W":s>=25*a&&s<27*a?r="WNW":s>=27*a&&s<29*a?r="NW":s>=29*a&&s<31*a?r="NNW":s>=31*a&&s<32*a&&(r="N"),r}static beaufort(t){let s=0;return isNaN(t)||(t=Math.round(t*10)/10,t<=.2?s=0:t<=1.5?s=1:t<=3.3?s=2:t<=5.4?s=3:t<=7.9?s=4:t<=10.7?s=5:t<=13.8?s=6:t<=17.1?s=7:t<=20.7?s=8:t<=22.4?s=9:t<=28.4?s=10:t<=32.6?s=11:t>32.6&&(s=12)),s}static douglas(t){let s="Calm";return isNaN(t)||t<=.1?s="Calm":t<=.5?s="Smooth":t<=1.25?s="Slight":t<=2.5?s="Moderate":t<=4?s="Rough":t<=6?s="VeryRough":t<=9?s="High":t<=14?s="VeryHigh":s="Precipitous",s}}const ct="",ce=(o,t)=>{const s=o.__vccOpts||o;for(const[r,a]of t)s[r]=a;return s},de={name:"SpotReport",props:{token:{type:String,default:""},ts:{type:String,default:k().utc().format()},timeZone:{type:Number,default:8},report:{type:Object,default:()=>({})}},data(){return{placeholder:"search for port name or coordinates",searchName:void 0,rawSearchIcon:e.markRaw(ie.Search),positionGmt:void 0,issuedDate:void 0,meteoData:{},a:void 0,positionList:[],position:void 0,loading:!0,activeIndex:void 0,tableData:{},pickedDate:void 0,pickedWeek:"Today",collectList:[],isCollected:!1}},computed:{computeHourL(){return function(o){return o?`${O(o).tz(this.positionGmt).format("HH")}`:"-"}},computeHourZ(){return function(o){return o?`${k(o).utc().format("HH")}Z`:"-"}},computeWeek(){return function(o){return o?`${O(o).tz(this.positionGmt).format("dddd")}`:"-"}},computeMMMDD(){return function(o){return o?`${O(o).tz(this.positionGmt).format("MMM-DD")}`:"-"}},computeLat(){return function(o,t=4){return Y.LngLatHelper.lat2pretty(o,t).pretty}},computeLng(){return function(o,t=4){return Y.LngLatHelper.lng2pretty(o,t).pretty}},roundPrecision(){return function(o,t=4){return isNaN(o)?"-":Y.LngLatHelper.roundPrecision(o,t)}}},watch:{"report.version":{handler(){var o,t;this.report&&(this.meteoData=this.report,this.position={id:this.report.portId,lat:(o=this.report)==null?void 0:o.lat,lng:(t=this.report)==null?void 0:t.lng,name:this.computeLat(this.report.lat)+","+this.computeLng(this.report.lng)},this.handleRender())}}},methods:{handleRender(){this.initInfo(),this.initTableData(),this.$nextTick(()=>{this.initEchart()})},initInfo(){var o,t;this.loading=!1,this.positionGmt=(t=(o=this.meteoData.weather)==null?void 0:o[0])==null?void 0:t.timezone,this.issuedDate=k(this.ts).utc().format("MMM-DD/HHmm,YYYY[Z]"),this.activeIndex=O(this.ts).tz(this.positionGmt).hour(),this.pickedDate=O(this.ts).tz(this.positionGmt).set({hour:0,minute:0,second:0,millisecond:0}).format(),this.collectList=JSON.parse(localStorage.getItem("idmCollectList")||"[]"),this.positionList=JSON.parse(JSON.stringify(this.collectList)),this.isCollected=this.collectList.some(s=>{var r;return s.name===((r=this.position)==null?void 0:r.name)})},initTableData(){var o,t,s,r,a,m,N,B,x,_,E,D,w,y,n,i,z,V,S,L,C,M,P,T,I,H,p,g,b,R,j,G,u,F;this.tableData={hours:[],utcHours:[],weatherUrls:[],weatherNames:[],temp:[],precipProbability:[],precip1h:[],visibility:[],humidity:[],windSpeed:[],windDir:[],windGust:[],sigwaveHeight:[],sigwaveDir:[],windwaveHeight:[],windwaveDir:[],windwavePeriod:[],swellHeight:[],swellDir:[],swellPeriod:[],currentSpeed:[],currentDir:[],seaLevel:[],seaTemp:[]};for(let h=0;h<24;h++){const A=k(this.pickedDate).clone().add(h,"h").format();this.tableData.hours.push(A);const l=((o=$.pickHourly(this.meteoData,A))==null?void 0:o[0])||{};this.tableData.weatherUrls.push((t=l.weather)==null?void 0:t.url),this.tableData.weatherNames.push(((s=l.weather)==null?void 0:s.name)??"-"),this.tableData.temp.push(this.roundPrecision((r=l.weather)==null?void 0:r.temp,0)??"-"),this.tableData.precipProbability.push(this.roundPrecision((m=(a=l.weather)==null?void 0:a.precip)==null?void 0:m.probability,0)??"-"),this.tableData.precip1h.push(this.roundPrecision((B=(N=l.weather)==null?void 0:N.precip)==null?void 0:B.sum,0)??"-"),this.tableData.visibility.push(this.roundPrecision((x=l.weather)==null?void 0:x.visibility,0)??"-"),this.tableData.humidity.push(this.roundPrecision((_=l.weather)==null?void 0:_.rh,0)??"-"),this.tableData.windSpeed.push(this.roundPrecision((D=(E=l.weather)==null?void 0:E.wind)==null?void 0:D.kts,1)),this.tableData.windDir.push((y=(w=l.weather)==null?void 0:w.wind)==null?void 0:y.bearing),this.tableData.windGust.push(this.roundPrecision((i=(n=l.weather)==null?void 0:n.wind)==null?void 0:i.gusts,1)??"-"),this.tableData.sigwaveHeight.push(this.roundPrecision((V=(z=l.wave)==null?void 0:z.sig)==null?void 0:V.height,1)??"-"),this.tableData.sigwaveDir.push((L=(S=l.wave)==null?void 0:S.sig)==null?void 0:L.bearing),this.tableData.windwaveHeight.push(this.roundPrecision((M=(C=l.wave)==null?void 0:C.wd)==null?void 0:M.height,1)??"-"),this.tableData.windwaveDir.push((T=(P=l.wave)==null?void 0:P.wd)==null?void 0:T.bearing),this.tableData.windwavePeriod.push(this.roundPrecision((H=(I=l.wave)==null?void 0:I.wd)==null?void 0:H.period,1)??"-"),this.tableData.swellHeight.push(this.roundPrecision((g=(p=l.wave)==null?void 0:p.swell)==null?void 0:g.height,1)??"-"),this.tableData.swellDir.push((R=(b=l.wave)==null?void 0:b.swell)==null?void 0:R.bearing),this.tableData.swellPeriod.push(this.roundPrecision((G=(j=l.wave)==null?void 0:j.swell)==null?void 0:G.period,1)??"-"),this.tableData.currentSpeed.push(this.roundPrecision((u=l.current)==null?void 0:u.speed,1)??"-"),this.tableData.currentDir.push((F=l.current)==null?void 0:F.bearing),this.tableData.seaLevel.push(this.roundPrecision(l.height,1)??"-"),this.tableData.seaTemp.push(this.roundPrecision(l.sst,1)??"-")}},initEchart(){var i,z,V,S,L,C,M,P,T,I,H;const o=[],t=[],s=[],r=[],a=[],m=[],N=[],B=[],x=[];for(let p=0;p<7;p++){const g=k(this.pickedDate).clone().add(p,"d");o.push(O(g).tz(this.positionGmt).format("yyyy-MM-DD")),t.push(this.computeMMMDD(g)),s.push(p===0?"Today":this.computeWeek(g));const b=((i=$.pickDaily(this.meteoData,g))==null?void 0:i[0])||{};r.push(this.roundPrecision((V=(z=b.weather)==null?void 0:z.temp)==null?void 0:V.min,0)),a.push(this.roundPrecision((L=(S=b.weather)==null?void 0:S.temp)==null?void 0:L.max,0)),N.push(this.roundPrecision((M=(C=b.weather)==null?void 0:C.wind)==null?void 0:M.kts,1)+" kts"),x.push(this.roundPrecision((T=(P=b.weather)==null?void 0:P.precip)==null?void 0:T.sum,0)+" mm"),m.push({symbol:"image://"+((I=b.weather)==null?void 0:I.url)}),B.push({symbol:"image://"+((H=b.weather)==null?void 0:H.url)})}const _=Math.max(...a.filter(p=>typeof p=="number"&&!isNaN(p)))-Math.min(...r.filter(p=>typeof p=="number"&&!isNaN(p))),E=Math.min(...r.filter(p=>typeof p=="number"&&!isNaN(p)))-1.5*_,D=Math.max(...a.filter(p=>typeof p=="number"&&!isNaN(p)))+2*_,w=4+.5/o.length*92+"%",y=v.init(document.getElementById("weather-chart")),n={grid:{bottom:0,top:0,left:"4%",right:"4%"},tooltip:{trigger:"none",show:!1},legend:{show:!1},xAxis:{left:0,right:0,top:"50%",height:"50%",type:"category",data:o,show:!1},singleAxis:[{left:w,right:w,type:"category",show:!1,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{show:!1},splitLine:{show:!1},boundaryGap:!1,data:o,top:"7%",height:"2%"},{left:w,right:w,type:"category",show:!1,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{show:!1},splitLine:{show:!1},boundaryGap:!1,data:o,top:"16%",height:"2%"},{left:w,right:w,type:"category",show:!1,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{show:!1},splitLine:{show:!1},boundaryGap:!1,data:o,top:"27%",height:"2%"},{left:w,right:w,type:"category",show:!1,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{show:!1},splitLine:{show:!1},boundaryGap:!1,data:o,top:"84%",height:"2%"},{left:w,right:w,type:"category",show:!1,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{show:!1},splitLine:{show:!1},boundaryGap:!1,data:o,top:"93%",height:"2%"}],yAxis:{type:"value",name:"温度(℃)",show:!1,min:E,max:D,axisLabel:{formatter:"{value} °C"}},series:[{singleAxisIndex:0,coordinateSystem:"singleAxis",type:"scatter",data:s,label:{show:!0,color:"#000",fontSize:14,formatter:"{c}"},symbolSize:0},{singleAxisIndex:1,coordinateSystem:"singleAxis",type:"scatter",data:t,label:{show:!0,color:"#000",formatter:"{c}"},symbolSize:0},{singleAxisIndex:2,coordinateSystem:"singleAxis",type:"scatter",data:m,symbolSize:36},{name:"温度(℃)",type:"line",data:r,smooth:!0,itemStyle:{color:"#2a57b7"},label:{show:!0,position:[-10,12],formatter:"{c} °C",fontSize:10},markArea:{itemStyle:{color:"#e1f7ff"},data:[[{x:"4%"},{x:4+1/o.length*92+"%"}]]}},{name:"温度(℃)",type:"line",data:a,smooth:!0,itemStyle:{color:"#a7c4ff"},label:{show:!0,position:[-10,-12],formatter:"{c} °C",fontSize:10}},{singleAxisIndex:3,coordinateSystem:"singleAxis",type:"scatter",data:N,label:{show:!0,color:"#000",formatter:"{c}"},symbolSize:0},{singleAxisIndex:4,coordinateSystem:"singleAxis",type:"scatter",data:x,label:{show:!0,color:"#000",formatter:"{c}"},symbolSize:0}]};y.setOption(n),y.on("click",p=>{const g=p.dataIndex;this.pickedDate=O(o[g]).tz(this.positionGmt).set({hour:0,minute:0,second:0,millisecond:0}).format(),this.pickedWeek=g===0?"Today":this.computeWeek(this.pickedDate),this.initTableData(),n.series[3].markArea={itemStyle:{color:"#e1f7ff"},data:[[{x:4+g/o.length*92+"%"},{x:4+(g+1)/o.length*92+"%"}]]},y.setOption(n)})},handleCollect(){this.isCollected=!this.isCollected,this.isCollected?this.collectList.push({name:this.position.name,lat:this.position.lat,lng:this.position.lng}):this.collectList=this.collectList.filter(o=>o.name!==this.position.name),localStorage.setItem("idmCollectList",JSON.stringify(this.collectList))},async fetchSuggestPosition(o){var r;const t=o.replaceAll(",",",");if(!t)return this.positionList=this.collectList,!1;const s=await X.get(`https://cbe.idmwx.com/api/arc/ports/suggest?n=${t}`,{headers:{Authorization:this.token}});(s==null?void 0:s.data.code)===0&&(this.positionList=(r=s==null?void 0:s.data.data)==null?void 0:r.map(a=>(a.name=a.id?a.name:this.computeLat(a.lat)+", "+this.computeLng(a.lng),a)))},async handleFetchMeteo(){var s,r,a;if(!this.searchName)return!1;this.position={portId:(s=this.positionList.find(m=>m.name===this.searchName))==null?void 0:s.id,lat:(r=this.positionList.find(m=>m.name===this.searchName))==null?void 0:r.lat,lng:(a=this.positionList.find(m=>m.name===this.searchName))==null?void 0:a.lng,name:this.searchName},this.handleClear();const o={lat:this.position.lat,lng:this.position.lng,datetime:this.ts?k(this.ts).utc().add(-1,"d").format():k().add(-1,"d").utc().format(),forecastDays:8,selfHosted:!1},t=await X.post("https://cbe.idmwx.com/api/arc/meteo2/spot/forecast",o,{headers:{Authorization:this.token}});(t==null?void 0:t.data.code)===0&&(this.meteoData={...t==null?void 0:t.data.data}),this.handleRender()},handleClear(){this.loading=!0,this.meteoData={},this.isCollected=!1,v.dispose(document.getElementById("weather-chart"))}}},he={class:"spot-report"},me={class:"header-box flex-between"},pe={class:"bg"},we={class:"search-box flex-start"},ge={class:"content-box"},ke={class:"title-box flex-between"},ye={class:"main-title"},ue={class:"sub-title"},fe={class:"flex-end"},xe={key:0,id:"weather-chart"},_e={key:1,class:"weather-chart flex-center"},be={key:2,class:"weather-chart flex-center"},Ne={key:3,class:"card-box"},Ee={class:"date"},De={class:"basic-table"},Be={class:"day"},ze={class:"hour"},Ve={class:"icon"},Se=["src"],Le={class:"text"},Ce={class:"text"},Me={class:"text"},Pe={class:"text"},Te={class:"text"},Ie={class:"text"},He={key:1},Fe={class:"text"},We={class:"text"},Re={class:"wave-current-table"},Ae={class:"text"},Ge={class:"text"},Oe={key:1},je={class:"text"},qe={class:"text"},Ue={class:"text"},Ze={key:1},Je={class:"text"},Ye={class:"text"},Ke={class:"text"},Qe={key:1},Xe={class:"text"},ve={class:"sea-table"},$e={class:"text"},et={class:"text"},tt={key:4,class:"card-box flex-center"},st={key:5,class:"card-box flex-center"};function at(o,t,s,r,a,m){var _,E,D,w,y;const N=e.resolveComponent("ElOption"),B=e.resolveComponent("ElSelect"),x=e.resolveComponent("ElTooltip");return e.openBlock(),e.createElementBlock("div",he,[e.createElementVNode("div",me,[e.createElementVNode("div",pe,[e.createElementVNode("div",we,[e.createVNode(B,{modelValue:a.searchName,"onUpdate:modelValue":t[0]||(t[0]=n=>a.searchName=n),filterable:"",class:"input",clearable:"",remote:"",placeholder:a.placeholder,autocomplete:"","remote-show-suffix":"",onFocus:t[1]||(t[1]=n=>a.placeholder=""),onBlur:t[2]||(t[2]=n=>a.placeholder="search for port name or coordinates"),"remote-method":m.fetchSuggestPosition,onChange:m.handleFetchMeteo},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.positionList,n=>(e.openBlock(),e.createBlock(N,{key:n.name,label:n.name,value:n.name},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder","remote-method","onChange"])])])]),e.createElementVNode("div",ge,[e.createElementVNode("div",ke,[e.createElementVNode("div",null,[e.createElementVNode("div",ye,"Weather forecast for "+e.toDisplayString(((_=a.position)==null?void 0:_.name)||"-")+" ( "+e.toDisplayString(a.positionGmt)+" )",1),e.createElementVNode("div",ue,"At "+e.toDisplayString((E=a.position)!=null&&E.portId?"port":"coordinates")+", issued "+e.toDisplayString(a.issuedDate),1)]),e.createElementVNode("div",fe,[e.createVNode(x,{placement:"left",effect:"light",content:a.isCollected?"remove the port/coordinate from the search list":"add the port/coordinate to the search list","show-after":1e3},{default:e.withCtx(()=>[a.isCollected?(e.openBlock(),e.createElementBlock("span",{key:0,class:"iconfont icon active",onClick:t[3]||(t[3]=(...n)=>m.handleCollect&&m.handleCollect(...n))},"")):(e.openBlock(),e.createElementBlock("span",{key:1,class:"iconfont icon",onClick:t[4]||(t[4]=(...n)=>m.handleCollect&&m.handleCollect(...n))},""))]),_:1},8,["content"])])]),(D=a.position)!=null&&D.name&&!a.loading?(e.openBlock(),e.createElementBlock("div",xe)):a.loading?(e.openBlock(),e.createElementBlock("div",_e,"Loading....")):a.position.name?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",be,"No Data")),(w=a.position)!=null&&w.name&&!a.loading?(e.openBlock(),e.createElementBlock("div",Ne,[e.createElementVNode("div",Ee,e.toDisplayString(a.pickedWeek)+" "+e.toDisplayString(m.computeMMMDD(a.pickedDate)),1),e.createElementVNode("table",De,[e.createElementVNode("tr",Be,[t[5]||(t[5]=e.createElementVNode("th",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Local time"),e.createElementVNode("span",{class:"unit"},"(LT)")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.hours,(n,i)=>(e.openBlock(),e.createElementBlock("th",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+"local"},e.toDisplayString(m.computeHourL(n)),3))),128))]),e.createElementVNode("tr",ze,[t[6]||(t[6]=e.createElementVNode("th",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("UTC"),e.createElementVNode("span",{class:"unit"})],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.hours,(n,i)=>(e.openBlock(),e.createElementBlock("th",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+"z"},e.toDisplayString(m.computeHourZ(n)),3))),128))]),e.createElementVNode("tr",Ve,[t[7]||(t[7]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Weather"),e.createElementVNode("span",{class:"unit"})],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.weatherUrls,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+"url"},[e.createVNode(x,{placement:"top",effect:"light",content:a.tableData.weatherNames[i],"show-after":500},{default:e.withCtx(()=>[n?(e.openBlock(),e.createElementBlock("img",{key:0,class:"iconfont weather-icon",src:n},null,8,Se)):e.createCommentVNode("",!0)]),_:2},1032,["content"])],2))),128))]),e.createElementVNode("tr",Le,[t[8]||(t[8]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Temperature"),e.createElementVNode("span",{class:"unit"},"°C")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.temp,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},e.toDisplayString(n),3))),128))]),e.createElementVNode("tr",Ce,[t[9]||(t[9]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Precipitation Probability"),e.createElementVNode("span",{class:"unit"},"%")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.precipProbability,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},e.toDisplayString(n),3))),128))]),e.createElementVNode("tr",Me,[t[10]||(t[10]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Precipitation 1h"),e.createElementVNode("span",{class:"unit"},"mm")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.precip1h,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},e.toDisplayString(n),3))),128))]),e.createElementVNode("tr",Pe,[t[11]||(t[11]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Visibility"),e.createElementVNode("span",{class:"unit"},"nm")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.visibility,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},e.toDisplayString(n),3))),128))]),e.createElementVNode("tr",Te,[t[12]||(t[12]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Relative Humidity"),e.createElementVNode("span",{class:"unit"},"%")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.humidity,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},e.toDisplayString(n),3))),128))]),e.createElementVNode("tr",Ie,[t[13]||(t[13]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Wind direction"),e.createElementVNode("span",{class:"unit"})],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.windDir,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},[isNaN(n)?(e.openBlock(),e.createElementBlock("span",He,"-")):(e.openBlock(),e.createElementBlock("span",{key:0,class:"iconfont icon",style:e.normalizeStyle({display:"inline-block",transform:`rotate(${n}deg)`})},"",4))],2))),128))]),e.createElementVNode("tr",Fe,[t[14]||(t[14]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Wind speed"),e.createElementVNode("span",{class:"unit"},"kts")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.windSpeed,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},e.toDisplayString(n),3))),128))]),e.createElementVNode("tr",We,[t[15]||(t[15]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Wind gust"),e.createElementVNode("span",{class:"unit"},"kts")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.windGust,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},e.toDisplayString(n),3))),128))])]),t[27]||(t[27]=e.createElementVNode("div",{style:{"text-align":"center",padding:"3px"}},null,-1)),e.createElementVNode("table",Re,[e.createElementVNode("tr",Ae,[t[16]||(t[16]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Wind wave height"),e.createElementVNode("span",{class:"unit"},"m")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.windwaveHeight,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},e.toDisplayString(n),3))),128))]),e.createElementVNode("tr",Ge,[t[17]||(t[17]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Wind wave direction"),e.createElementVNode("span",{class:"unit"})],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.windwaveDir,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},[isNaN(n)?(e.openBlock(),e.createElementBlock("span",Oe,"-")):(e.openBlock(),e.createElementBlock("span",{key:0,class:"iconfont icon",style:e.normalizeStyle({display:"inline-block",transform:`rotate(${n}deg)`})},"",4))],2))),128))]),e.createElementVNode("tr",je,[t[18]||(t[18]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Wind wave period"),e.createElementVNode("span",{class:"unit"},"s")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.windwavePeriod,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},e.toDisplayString(n),3))),128))]),e.createElementVNode("tr",qe,[t[19]||(t[19]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Swell height"),e.createElementVNode("span",{class:"unit"},"m")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.swellHeight,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},e.toDisplayString(n),3))),128))]),e.createElementVNode("tr",Ue,[t[20]||(t[20]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Swell direction"),e.createElementVNode("span",{class:"unit"})],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.swellDir,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},[isNaN(n)?(e.openBlock(),e.createElementBlock("span",Ze,"-")):(e.openBlock(),e.createElementBlock("span",{key:0,class:"iconfont icon",style:e.normalizeStyle({display:"inline-block",transform:`rotate(${n}deg)`})},"",4))],2))),128))]),e.createElementVNode("tr",Je,[t[21]||(t[21]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Swell period"),e.createElementVNode("span",{class:"unit"},"s")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.swellPeriod,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},e.toDisplayString(n),3))),128))]),e.createElementVNode("tr",Ye,[t[22]||(t[22]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Sig wave height"),e.createElementVNode("span",{class:"unit"},"m")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.sigwaveHeight,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},e.toDisplayString(n),3))),128))]),e.createElementVNode("tr",Ke,[t[23]||(t[23]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Current direction"),e.createElementVNode("span",{class:"unit"})],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.currentDir,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},[isNaN(n)?(e.openBlock(),e.createElementBlock("span",Qe,"-")):(e.openBlock(),e.createElementBlock("span",{key:0,class:"iconfont icon",style:e.normalizeStyle({display:"inline-block",transform:`rotate(${n}deg)`})},"",4))],2))),128))]),e.createElementVNode("tr",Xe,[t[24]||(t[24]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Current speed"),e.createElementVNode("span",{class:"unit"},"kts")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.currentSpeed,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},e.toDisplayString(n),3))),128))])]),t[28]||(t[28]=e.createElementVNode("div",{style:{"text-align":"center",padding:"3px"}},null,-1)),e.createElementVNode("table",ve,[e.createElementVNode("tr",$e,[t[25]||(t[25]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Sea level height"),e.createElementVNode("span",{class:"unit"},"m")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.seaLevel,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},e.toDisplayString(n),3))),128))]),e.createElementVNode("tr",et,[t[26]||(t[26]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Sea surface temperature"),e.createElementVNode("span",{class:"unit"},"°C")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.seaTemp,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},e.toDisplayString(n),3))),128))])])])):a.loading?(e.openBlock(),e.createElementBlock("div",tt,"Loading....")):(y=a.position)!=null&&y.name?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",st,"No Data"))])])}const ee=ce(de,[["render",at],["__scopeId","data-v-7b348412"]]),nt={install(o){o.component("SpotReport",ee)}};f.SpotReport=ee,f.SpotReportPlugin=nt,Object.defineProperty(f,Symbol.toStringTag,{value:"Module"})});
1
+ (function(f,k){typeof exports=="object"&&typeof module<"u"?k(exports,require("moment"),require("moment-timezone"),require("@element-plus/icons-vue"),require("@idm-plugin/geo"),require("echarts"),require("vue"),require("axios")):typeof define=="function"&&define.amd?define(["exports","moment","moment-timezone","@element-plus/icons-vue","@idm-plugin/geo","echarts","vue","axios"],k):(f=typeof globalThis<"u"?globalThis:f||self,k(f["idmui-report"]={},f.moment,f["moment-timezone"],f["@element-plus/icons-vue"],f["@idm-plugin/geo"],f.echarts,f.Vue,f.axios))})(this,function(f,k,O,ie,Y,re,e,X){"use strict";function le(o){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const s in o)if(s!=="default"){const r=Object.getOwnPropertyDescriptor(o,s);Object.defineProperty(t,s,r.get?r:{enumerable:!0,get:()=>o[s]})}}return t.default=o,Object.freeze(t)}const v=le(re);class ${static pickHourly(t,s){var r,a,m,N,B,x,_,E,D,w,y,n,i,z,V,S,L,C,M,P,T,I,H,p,g,b,R,j,G,u,F,h,A,l,U,Z,te,se;const ae=typeof s=="string"?k(s):s,J=t.weather,ot=t.marine,ne=k(J[0].hourly.date).utc(),K=ne.clone().add(J[0].hourly.time.at(0),"h"),it=ne.clone().add(J[0].hourly.time.at(-1),"h"),oe=[];if(ae.isBetween(K,it,"millisecond","[]")){const c=ae.utc().diff(K,"h",!1);let W,q;for(const Q of J){const d=Q.hourly;W={temp:(r=d.temperature_2m)==null?void 0:r.at(c),apparentTemp:(a=d.apparent_temperature)==null?void 0:a.at(c),rh:(m=d.relative_humidity_2m)==null?void 0:m.at(c),dp:(N=d.dew_point_2m)==null?void 0:N.at(c),precip:{probability:(B=d.precipitation_probability)==null?void 0:B.at(c),sum:(x=d.precipitation)==null?void 0:x.at(c)},code:(_=d.weather_code)==null?void 0:_.at(c),visibility:this.m2nm((E=d.visibility)==null?void 0:E.at(c)),wind:{speed:(D=d.wind_speed_10m)==null?void 0:D.at(c),kts:(w=d.wind_speed_10m)==null?void 0:w.at(c),degree:(y=d.wind_direction_10m)==null?void 0:y.at(c),bearing:((n=d.wind_direction_10m)==null?void 0:n.at(c))!==null?(((i=d.wind_direction_10m)==null?void 0:i.at(c))+180)%360:null,gusts:(z=d.wind_gusts_10m)==null?void 0:z.at(c)},isDay:(V=d.is_day)==null?void 0:V.at(c)};const{name:rt,url:lt}=this.parseWeatherCode(W.code,W.isDay);W.name=rt,W.url=lt,W.wind.scale=this.beaufort(this.kts2ms(W.wind.kts)),W.wind.direction=this.degree2Direction(W.wind.degree)}for(const Q of ot){const d=Q.hourly;q={wave:{sig:{height:(S=d.wave_height)==null?void 0:S.at(c),degree:(L=d.wave_direction)==null?void 0:L.at(c),bearing:((C=d.wave_direction)==null?void 0:C.at(c))!==null?(((M=d.wave_direction)==null?void 0:M.at(c))+180)%360:null,period:(P=d.wave_period)==null?void 0:P.at(c)},swell:{height:(T=d.swell_wave_height)==null?void 0:T.at(c),degree:(I=d.swell_wave_direction)==null?void 0:I.at(c),bearing:((H=d.swell_wave_direction)==null?void 0:H.at(c))!==null?(((p=d.swell_wave_direction)==null?void 0:p.at(c))+180)%360:null,period:(g=d.swell_wave_period)==null?void 0:g.at(c),peakPeriod:(b=d.swell_wave_peak_period)==null?void 0:b.at(c)},wd:{height:(R=d.wind_wave_height)==null?void 0:R.at(c),degree:(j=d.wind_wave_direction)==null?void 0:j.at(c),bearing:((G=d.wind_wave_direction)==null?void 0:G.at(c))!==null?(((u=d.wind_wave_direction)==null?void 0:u.at(c))+180)%360:null,period:(F=d.wind_wave_period)==null?void 0:F.at(c),peakPeriod:(h=d.wind_wave_peak_period)==null?void 0:h.at(c)}},current:{speed:(A=d.ocean_current_velocity)==null?void 0:A.at(c),kts:(l=d.ocean_current_velocity)==null?void 0:l.at(c),degree:(U=d.ocean_current_direction)==null?void 0:U.at(c),bearing:((Z=d.ocean_current_direction)==null?void 0:Z.at(c))??null},sst:(te=d.sea_surface_temperature)==null?void 0:te.at(c),height:(se=d.sea_level_height_msl)==null?void 0:se.at(c)},q.wave=this.parseWave(q.wave),q.current.direction=this.degree2Direction(q.current.degree)}oe.push({utc:K.add(c,"h").format(),weather:{...W},...q})}return oe}static pickDaily(t,s){var r,a,m,N,B,x,_,E,D,w,y,n,i,z,V,S,L,C,M,P,T,I,H;const p=typeof s=="string"?k(s):s,g=t.weather,b=t.marine,R=k(g[0].daily.time.at(0)),j=k(g[0].daily.time.at(-1)),G=[];if(p.isBetween(R,j,"millisecond","[]")){let u,F;const h=p.diff(R,"d",!1);for(const A of g){const l=A.daily;u={code:(r=l.weather_code)==null?void 0:r.at(h),temp:{max:(a=l.temperature_2m_max)==null?void 0:a.at(h),min:(m=l.temperature_2m_min)==null?void 0:m.at(h)},apparentTemp:{max:(N=l.apparent_temperature_max)==null?void 0:N.at(h),min:(B=l.apparent_temperature_min)==null?void 0:B.at(h)},precip:{sum:(x=l.precipitation_sum)==null?void 0:x.at(h),hours:(_=l.precipitation_hours)==null?void 0:_.at(h),probability:(E=l.precipitation_probability_max)==null?void 0:E.at(h)},wind:{speed:(D=l.wind_speed_10m_max)==null?void 0:D.at(h),kts:(w=l.wind_speed_10m_max)==null?void 0:w.at(h),degree:(y=l.wind_direction_10m_dominant)==null?void 0:y.at(h),gusts:(n=l.wind_gusts_10m_max)==null?void 0:n.at(h)}};const{name:U,url:Z}=this.parseWeatherCode(u.code,!0);u.name=U,u.url=Z,u.wind.scale=this.beaufort(this.kts2ms(u.wind.kts)),u.wind.direction=this.degree2Direction(u.wind.degree)}for(const A of b){const l=A.daily;F={wave:{sig:{height:(i=l.wave_height_max)==null?void 0:i.at(h),degree:(z=l.wave_direction_dominant)==null?void 0:z.at(h),period:(V=l.wave_period_max)==null?void 0:V.at(h)},swell:{height:(S=l.swell_wave_height_max)==null?void 0:S.at(h),degree:(L=l.wave_direction_dominant)==null?void 0:L.at(h),period:(C=l.swell_wave_period_max)==null?void 0:C.at(h),peakPeriod:(M=l.swell_wave_peak_period_max)==null?void 0:M.at(h)},wd:{height:(P=l.wind_wave_height_max)==null?void 0:P.at(h),degree:(T=l.wind_wave_direction_dominant)==null?void 0:T.at(h),period:(I=l.wind_wave_period_max)==null?void 0:I.at(h),peakPeriod:(H=l.wind_wave_peak_period_max)==null?void 0:H.at(h)}}},F.wave=this.parseWave(F.wave)}G.push({utc:R.add(h,"d").utc().format(),weather:{...u},...F})}return G}static parseWave(t){return t.sig.direction=this.degree2Direction(t.sig.degree),t.swell.direction=this.degree2Direction(t.swell.degree),t.wd.direction=this.degree2Direction(t.wd.degree),t.sig.scale=this.douglas(t.sig.height),t.swell.scale=this.douglas(t.swell.height),t.wd.scale=this.douglas(t.wd.height),t}static parseWeatherCode(t,s){const r=this.weatherCode(t);return s?r.day:r.night}static weatherCode(t){const s={code:t};switch(t){case 0:s.day={name:"Sunny",url:"https://osshz.idmwx.com/asset/weather/01d.svg"},s.night={name:"Clear",url:"https://osshz.idmwx.com/asset/weather/01n.svg"};break;case 1:s.day={name:"Mainly Sunny",url:"https://osshz.idmwx.com/asset/weather/01d.svg"},s.night={name:"Mainly Clear",url:"https://osshz.idmwx.com/asset/weather/01n.svg"};break;case 2:s.day={name:"Partly Cloudy",url:"https://osshz.idmwx.com/asset/weather/02d.svg"},s.night={name:"Partly Cloudy",url:"https://osshz.idmwx.com/asset/weather/02n.svg"};break;case 3:s.day={name:"Cloudy",url:"https://osshz.idmwx.com/asset/weather/03d.svg"},s.night={name:"Cloudy",url:"https://osshz.idmwx.com/asset/weather/03n.svg"};break;case 45:s.day={name:"Foggy",url:"https://osshz.idmwx.com/asset/weather/50d.svg"},s.night={name:"Foggy",url:"https://osshz.idmwx.com/asset/weather/50n.svg"};break;case 48:s.day={name:"Rime Fog",url:"https://osshz.idmwx.com/asset/weather/50d.svg"},s.night={name:"Rime Fog",url:"https://osshz.idmwx.com/asset/weather/50n.svg"};break;case 51:s.day={name:"Light Drizzle",url:"https://osshz.idmwx.com/asset/weather/09d.svg"},s.night={name:"Light Drizzle",url:"https://osshz.idmwx.com/asset/weather/09n.svg"};break;case 53:s.day={name:"Drizzle",url:"https://osshz.idmwx.com/asset/weather/09d.svg"},s.night={name:"Drizzle",url:"https://osshz.idmwx.com/asset/weather/09n.svg"};break;case 55:s.day={name:"Heavy Drizzle",url:"https://osshz.idmwx.com/asset/weather/09d.svg"},s.night={name:"Heavy Drizzle",url:"https://osshz.idmwx.com/asset/weather/09n.svg"};break;case 56:s.day={name:"Light Freezing Drizzle",url:"https://osshz.idmwx.com/asset/weather/09d.svg"},s.night={name:"Light Freezing Drizzle",url:"https://osshz.idmwx.com/asset/weather/09n.svg"};break;case 57:s.day={name:"Freezing Drizzle",url:"https://osshz.idmwx.com/asset/weather/09d.svg"},s.night={name:"Freezing Drizzle",url:"https://osshz.idmwx.com/asset/weather/09n.svg"};break;case 61:s.day={name:"Light Rain",url:"https://osshz.idmwx.com/asset/weather/10d.svg"},s.night={name:"Light Rain",url:"https://osshz.idmwx.com/asset/weather/10n.svg"};break;case 63:s.day={name:"Rain",url:"https://osshz.idmwx.com/asset/weather/10d.svg"},s.night={name:"Rain",url:"https://osshz.idmwx.com/asset/weather/10n.svg"};break;case 65:s.day={name:"Heavy Rain",url:"https://osshz.idmwx.com/asset/weather/10d.svg"},s.night={name:"Heavy Rain",url:"https://osshz.idmwx.com/asset/weather/10n.svg"};break;case 66:s.day={name:"Light Freezing Rain",url:"https://osshz.idmwx.com/asset/weather/10d.svg"},s.night={name:"Light Freezing Rain",url:"https://osshz.idmwx.com/asset/weather/10n.svg"};break;case 67:s.day={name:"Freezing Rain",url:"https://osshz.idmwx.com/asset/weather/10d.svg"},s.night={name:"Freezing Rain",url:"https://osshz.idmwx.com/asset/weather/10n.svg"};break;case 71:s.day={name:"Light Snow",url:"https://osshz.idmwx.com/asset/weather/13d.svg"},s.night={name:"Light Snow",url:"https://osshz.idmwx.com/asset/weather/13n.svg"};break;case 73:s.day={name:"Snow",url:"https://osshz.idmwx.com/asset/weather/13d.svg"},s.night={name:"Snow",url:"https://osshz.idmwx.com/asset/weather/13n.svg"};break;case 75:s.day={name:"Heavy Snow",url:"https://osshz.idmwx.com/asset/weather/13d.svg"},s.night={name:"Heavy Snow",url:"https://osshz.idmwx.com/asset/weather/13n.svg"};break;case 77:s.day={name:"Snow Grains",url:"https://osshz.idmwx.com/asset/weather/13d.svg"},s.night={name:"Snow Grains",url:"https://osshz.idmwx.com/asset/weather/13n.svg"};break;case 80:s.day={name:"Light Showers",url:"https://osshz.idmwx.com/asset/weather/09d.svg"},s.night={name:"Light Showers",url:"https://osshz.idmwx.com/asset/weather/09n.svg"};break;case 81:s.day={name:"Showers",url:"https://osshz.idmwx.com/asset/weather/09d.svg"},s.night={name:"Showers",url:"https://osshz.idmwx.com/asset/weather/09n.svg"};break;case 82:s.day={name:"Heavy Showers",url:"https://osshz.idmwx.com/asset/weather/09d.svg"},s.night={name:"Heavy Showers",url:"https://osshz.idmwx.com/asset/weather/09n.svg"};break;case 85:s.day={name:"Light Snow Showers",url:"https://osshz.idmwx.com/asset/weather/13d.svg"},s.night={name:"Light Snow Showers",url:"https://osshz.idmwx.com/asset/weather/13n.svg"};break;case 86:s.day={name:"Snow Showers",url:"https://osshz.idmwx.com/asset/weather/13d.svg"},s.night={name:"Snow Showers",url:"https://osshz.idmwx.com/asset/weather/13n.svg"};break;case 95:s.day={name:"Thunderstorm",url:"https://osshz.idmwx.com/asset/weather/11d.svg"},s.night={name:"Thunderstorm",url:"https://osshz.idmwx.com/asset/weather/11n.svg"};break;case 96:s.day={name:"Light Thunderstorms With Hail",url:"https://osshz.idmwx.com/asset/weather/11d.svg"},s.night={name:"Light Thunderstorms With Hail",url:"https://osshz.idmwx.com/asset/weather/11n.svg"};break;case 99:s.day={name:"Thunderstorms With Hail",url:"https://osshz.idmwx.com/asset/weather/11d.svg"},s.night={name:"Thunderstorms With Hail",url:"https://osshz.idmwx.com/asset/weather/11n.svg"};break}return s}static kts2ms(t){return isNaN(t)?t:Math.round(t*1852/3600*1e4)/1e4}static kts2kmh(t){return isNaN(t)?t:t*1.852}static m2nm(t){return isNaN(t)?t:Math.round(t/1e3/1.852*1e4)/1e4}static kmh2kts(t){return isNaN(t)?t:this.ms2kts(t*1e3/3600)}static ms2kts(t){return isNaN(t)?t:Math.round(t*3600/1852*1e4)/1e4}static degree2Radian(t){if(isNaN(t)||t===null)return t;let s=t%360/360*2*Math.PI;return s=s<0?s+2*Math.PI:s,s}static degree2Direction(t){const s=this.degree2Radian(t);if(isNaN(s)||s===null)return null;let r="N/A";const a=Math.PI/16;return s<a?r="N":s>=a&&s<3*a?r="NNE":s>=3*a&&s<5*a?r="NE":s>=5*a&&s<7*a?r="ENE":s>=7*a&&s<9*a?r="E":s>=9*a&&s<11*a?r="ESE":s>=11*a&&s<13*a?r="SE":s>=13*a&&s<15*a?r="SSE":s>=15*a&&s<17*a?r="S":s>=17*a&&s<19*a?r="SSW":s>=19*a&&s<21*a?r="SW":s>=21*a&&s<23*a?r="WSW":s>=23*a&&s<25*a?r="W":s>=25*a&&s<27*a?r="WNW":s>=27*a&&s<29*a?r="NW":s>=29*a&&s<31*a?r="NNW":s>=31*a&&s<32*a&&(r="N"),r}static beaufort(t){let s=0;return isNaN(t)||(t=Math.round(t*10)/10,t<=.2?s=0:t<=1.5?s=1:t<=3.3?s=2:t<=5.4?s=3:t<=7.9?s=4:t<=10.7?s=5:t<=13.8?s=6:t<=17.1?s=7:t<=20.7?s=8:t<=22.4?s=9:t<=28.4?s=10:t<=32.6?s=11:t>32.6&&(s=12)),s}static douglas(t){let s="Calm";return isNaN(t)||t<=.1?s="Calm":t<=.5?s="Smooth":t<=1.25?s="Slight":t<=2.5?s="Moderate":t<=4?s="Rough":t<=6?s="VeryRough":t<=9?s="High":t<=14?s="VeryHigh":s="Precipitous",s}}const ct="",ce=(o,t)=>{const s=o.__vccOpts||o;for(const[r,a]of t)s[r]=a;return s},de={name:"SpotReport",props:{token:{type:String,default:""},ts:{type:String,default:k().utc().format()},timeZone:{type:Number,default:8},report:{type:Object,default:()=>({})}},data(){return{placeholder:"search for port name or coordinates",searchName:void 0,rawSearchIcon:e.markRaw(ie.Search),positionGmt:void 0,issuedDate:void 0,meteoData:{},a:void 0,positionList:[],position:void 0,loading:!0,activeIndex:void 0,tableData:{},pickedDate:void 0,pickedWeek:"Today",collectList:[],isCollected:!1}},computed:{computeHourL(){return function(o){return o?`${O(o).tz(this.positionGmt).format("HH")}`:"-"}},computeHourZ(){return function(o){return o?`${k(o).utc().format("HH")}Z`:"-"}},computeWeek(){return function(o){return o?`${O(o).tz(this.positionGmt).format("dddd")}`:"-"}},computeMMMDD(){return function(o){return o?`${O(o).tz(this.positionGmt).format("MMM-DD")}`:"-"}},computeLat(){return function(o,t=4){return Y.LngLatHelper.lat2pretty(o,t).pretty}},computeLng(){return function(o,t=4){return Y.LngLatHelper.lng2pretty(o,t).pretty}},roundPrecision(){return function(o,t=4){return isNaN(o)?"-":Y.LngLatHelper.roundPrecision(o,t)}}},watch:{"report.version":{handler(){var o,t;this.report&&(this.meteoData=this.report,this.position={id:this.report.portId,lat:(o=this.report)==null?void 0:o.lat,lng:(t=this.report)==null?void 0:t.lng,name:this.computeLat(this.report.lat)+","+this.computeLng(this.report.lng)},this.handleRender())}}},methods:{handleRender(){this.initInfo(),this.initTableData(),this.$nextTick(()=>{this.initEchart()})},initInfo(){var o,t;this.loading=!1,this.positionGmt=(t=(o=this.meteoData.weather)==null?void 0:o[0])==null?void 0:t.timezone,this.issuedDate=k(this.ts).utc().format("MMM-DD/HHmm,YYYY[Z]"),this.activeIndex=O(this.ts).tz(this.positionGmt).hour(),this.pickedDate=O(this.ts).tz(this.positionGmt).set({hour:0,minute:0,second:0,millisecond:0}).format(),this.collectList=JSON.parse(localStorage.getItem("idmCollectList")||"[]"),this.positionList=JSON.parse(JSON.stringify(this.collectList)),this.isCollected=this.collectList.some(s=>{var r;return s.name===((r=this.position)==null?void 0:r.name)})},initTableData(){var o,t,s,r,a,m,N,B,x,_,E,D,w,y,n,i,z,V,S,L,C,M,P,T,I,H,p,g,b,R,j,G,u,F;this.tableData={hours:[],utcHours:[],weatherUrls:[],weatherNames:[],temp:[],precipProbability:[],precip1h:[],visibility:[],humidity:[],windSpeed:[],windDir:[],windGust:[],sigwaveHeight:[],sigwaveDir:[],windwaveHeight:[],windwaveDir:[],windwavePeriod:[],swellHeight:[],swellDir:[],swellPeriod:[],currentSpeed:[],currentDir:[],seaLevel:[],seaTemp:[]};for(let h=0;h<24;h++){const A=k(this.pickedDate).clone().add(h,"h").format();this.tableData.hours.push(A);const l=((o=$.pickHourly(this.meteoData,A))==null?void 0:o[0])||{};this.tableData.weatherUrls.push((t=l.weather)==null?void 0:t.url),this.tableData.weatherNames.push(((s=l.weather)==null?void 0:s.name)??"-"),this.tableData.temp.push(this.roundPrecision((r=l.weather)==null?void 0:r.temp,0)??"-"),this.tableData.precipProbability.push(this.roundPrecision((m=(a=l.weather)==null?void 0:a.precip)==null?void 0:m.probability,0)??"-"),this.tableData.precip1h.push(this.roundPrecision((B=(N=l.weather)==null?void 0:N.precip)==null?void 0:B.sum,0)??"-"),this.tableData.visibility.push(this.roundPrecision((x=l.weather)==null?void 0:x.visibility,0)??"-"),this.tableData.humidity.push(this.roundPrecision((_=l.weather)==null?void 0:_.rh,0)??"-"),this.tableData.windSpeed.push(this.roundPrecision((D=(E=l.weather)==null?void 0:E.wind)==null?void 0:D.kts,1)),this.tableData.windDir.push((y=(w=l.weather)==null?void 0:w.wind)==null?void 0:y.bearing),this.tableData.windGust.push(this.roundPrecision((i=(n=l.weather)==null?void 0:n.wind)==null?void 0:i.gusts,1)??"-"),this.tableData.sigwaveHeight.push(this.roundPrecision((V=(z=l.wave)==null?void 0:z.sig)==null?void 0:V.height,1)??"-"),this.tableData.sigwaveDir.push((L=(S=l.wave)==null?void 0:S.sig)==null?void 0:L.bearing),this.tableData.windwaveHeight.push(this.roundPrecision((M=(C=l.wave)==null?void 0:C.wd)==null?void 0:M.height,1)??"-"),this.tableData.windwaveDir.push((T=(P=l.wave)==null?void 0:P.wd)==null?void 0:T.bearing),this.tableData.windwavePeriod.push(this.roundPrecision((H=(I=l.wave)==null?void 0:I.wd)==null?void 0:H.period,1)??"-"),this.tableData.swellHeight.push(this.roundPrecision((g=(p=l.wave)==null?void 0:p.swell)==null?void 0:g.height,1)??"-"),this.tableData.swellDir.push((R=(b=l.wave)==null?void 0:b.swell)==null?void 0:R.bearing),this.tableData.swellPeriod.push(this.roundPrecision((G=(j=l.wave)==null?void 0:j.swell)==null?void 0:G.period,1)??"-"),this.tableData.currentSpeed.push(this.roundPrecision((u=l.current)==null?void 0:u.speed,1)??"-"),this.tableData.currentDir.push((F=l.current)==null?void 0:F.bearing),this.tableData.seaLevel.push(this.roundPrecision(l.height,1)??"-"),this.tableData.seaTemp.push(this.roundPrecision(l.sst,0)??"-")}},initEchart(){var i,z,V,S,L,C,M,P,T,I,H;const o=[],t=[],s=[],r=[],a=[],m=[],N=[],B=[],x=[];for(let p=0;p<7;p++){const g=k(this.pickedDate).clone().add(p,"d");o.push(O(g).tz(this.positionGmt).format("yyyy-MM-DD")),t.push(this.computeMMMDD(g)),s.push(p===0?"Today":this.computeWeek(g));const b=((i=$.pickDaily(this.meteoData,g))==null?void 0:i[0])||{};r.push(this.roundPrecision((V=(z=b.weather)==null?void 0:z.temp)==null?void 0:V.min,0)),a.push(this.roundPrecision((L=(S=b.weather)==null?void 0:S.temp)==null?void 0:L.max,0)),N.push(this.roundPrecision((M=(C=b.weather)==null?void 0:C.wind)==null?void 0:M.kts,1)+" kts"),x.push(this.roundPrecision((T=(P=b.weather)==null?void 0:P.precip)==null?void 0:T.sum,0)+" mm"),m.push({symbol:"image://"+((I=b.weather)==null?void 0:I.url)}),B.push({symbol:"image://"+((H=b.weather)==null?void 0:H.url)})}const _=Math.max(...a.filter(p=>typeof p=="number"&&!isNaN(p)))-Math.min(...r.filter(p=>typeof p=="number"&&!isNaN(p))),E=Math.min(...r.filter(p=>typeof p=="number"&&!isNaN(p)))-1.5*_,D=Math.max(...a.filter(p=>typeof p=="number"&&!isNaN(p)))+2*_,w=4+.5/o.length*92+"%",y=v.init(document.getElementById("weather-chart")),n={grid:{bottom:0,top:0,left:"4%",right:"4%"},tooltip:{trigger:"none",show:!1},legend:{show:!1},xAxis:{left:0,right:0,top:"50%",height:"50%",type:"category",data:o,show:!1},singleAxis:[{left:w,right:w,type:"category",show:!1,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{show:!1},splitLine:{show:!1},boundaryGap:!1,data:o,top:"7%",height:"2%"},{left:w,right:w,type:"category",show:!1,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{show:!1},splitLine:{show:!1},boundaryGap:!1,data:o,top:"16%",height:"2%"},{left:w,right:w,type:"category",show:!1,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{show:!1},splitLine:{show:!1},boundaryGap:!1,data:o,top:"27%",height:"2%"},{left:w,right:w,type:"category",show:!1,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{show:!1},splitLine:{show:!1},boundaryGap:!1,data:o,top:"84%",height:"2%"},{left:w,right:w,type:"category",show:!1,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{show:!1},splitLine:{show:!1},boundaryGap:!1,data:o,top:"93%",height:"2%"}],yAxis:{type:"value",name:"温度(℃)",show:!1,min:E,max:D,axisLabel:{formatter:"{value} °C"}},series:[{singleAxisIndex:0,coordinateSystem:"singleAxis",type:"scatter",data:s,label:{show:!0,color:"#000",fontSize:14,formatter:"{c}"},symbolSize:0},{singleAxisIndex:1,coordinateSystem:"singleAxis",type:"scatter",data:t,label:{show:!0,color:"#000",formatter:"{c}"},symbolSize:0},{singleAxisIndex:2,coordinateSystem:"singleAxis",type:"scatter",data:m,symbolSize:36},{name:"温度(℃)",type:"line",data:r,smooth:!0,itemStyle:{color:"#2a57b7"},label:{show:!0,position:[-10,12],formatter:"{c} °C",fontSize:10},markArea:{itemStyle:{color:"#e1f7ff"},data:[[{x:"4%"},{x:4+1/o.length*92+"%"}]]}},{name:"温度(℃)",type:"line",data:a,smooth:!0,itemStyle:{color:"#a7c4ff"},label:{show:!0,position:[-10,-12],formatter:"{c} °C",fontSize:10}},{singleAxisIndex:3,coordinateSystem:"singleAxis",type:"scatter",data:N,label:{show:!0,color:"#000",formatter:"{c}"},symbolSize:0},{singleAxisIndex:4,coordinateSystem:"singleAxis",type:"scatter",data:x,label:{show:!0,color:"#000",formatter:"{c}"},symbolSize:0}]};y.setOption(n),y.on("click",p=>{const g=p.dataIndex;this.pickedDate=O(o[g]).tz(this.positionGmt).set({hour:0,minute:0,second:0,millisecond:0}).format(),this.pickedWeek=g===0?"Today":this.computeWeek(this.pickedDate),this.initTableData(),n.series[3].markArea={itemStyle:{color:"#e1f7ff"},data:[[{x:4+g/o.length*92+"%"},{x:4+(g+1)/o.length*92+"%"}]]},y.setOption(n)})},handleCollect(){this.isCollected=!this.isCollected,this.isCollected?this.collectList.push({name:this.position.name,lat:this.position.lat,lng:this.position.lng}):this.collectList=this.collectList.filter(o=>o.name!==this.position.name),localStorage.setItem("idmCollectList",JSON.stringify(this.collectList))},async fetchSuggestPosition(o){var r;const t=o.replaceAll(",",",");if(!t)return this.positionList=this.collectList,!1;const s=await X.get(`https://cbe.idmwx.com/api/arc/ports/suggest?n=${t}`,{headers:{Authorization:this.token}});(s==null?void 0:s.data.code)===0&&(this.positionList=(r=s==null?void 0:s.data.data)==null?void 0:r.map(a=>(a.name=a.id?a.name:this.computeLat(a.lat)+", "+this.computeLng(a.lng),a)))},async handleFetchMeteo(){var s,r,a;if(!this.searchName)return!1;this.position={portId:(s=this.positionList.find(m=>m.name===this.searchName))==null?void 0:s.id,lat:(r=this.positionList.find(m=>m.name===this.searchName))==null?void 0:r.lat,lng:(a=this.positionList.find(m=>m.name===this.searchName))==null?void 0:a.lng,name:this.searchName},this.handleClear();const o={lat:this.position.lat,lng:this.position.lng,datetime:this.ts?k(this.ts).utc().add(-1,"d").format():k().add(-1,"d").utc().format(),forecastDays:8,selfHosted:!1},t=await X.post("https://cbe.idmwx.com/api/arc/meteo2/spot/forecast",o,{headers:{Authorization:this.token}});(t==null?void 0:t.data.code)===0&&(this.meteoData={...t==null?void 0:t.data.data}),this.handleRender()},handleClear(){this.loading=!0,this.meteoData={},this.isCollected=!1,v.dispose(document.getElementById("weather-chart"))}}},he={class:"spot-report"},me={class:"header-box flex-between"},pe={class:"bg"},we={class:"search-box flex-start"},ge={class:"content-box"},ke={class:"title-box flex-between"},ye={class:"main-title"},ue={class:"sub-title"},fe={class:"flex-end"},xe={key:0,id:"weather-chart"},_e={key:1,class:"weather-chart flex-center"},be={key:2,class:"weather-chart flex-center"},Ne={key:3,class:"card-box"},Ee={class:"date"},De={class:"basic-table"},Be={class:"day"},ze={class:"hour"},Ve={class:"icon"},Se=["src"],Le={class:"text"},Ce={class:"text"},Me={class:"text"},Pe={class:"text"},Te={class:"text"},Ie={class:"text"},He={key:1},Fe={class:"text"},We={class:"text"},Re={class:"wave-current-table"},Ae={class:"text"},Ge={class:"text"},Oe={key:1},je={class:"text"},qe={class:"text"},Ue={class:"text"},Ze={key:1},Je={class:"text"},Ye={class:"text"},Ke={class:"text"},Qe={key:1},Xe={class:"text"},ve={class:"sea-table"},$e={class:"text"},et={class:"text"},tt={key:4,class:"card-box flex-center"},st={key:5,class:"card-box flex-center"};function at(o,t,s,r,a,m){var _,E,D,w,y;const N=e.resolveComponent("ElOption"),B=e.resolveComponent("ElSelect"),x=e.resolveComponent("ElTooltip");return e.openBlock(),e.createElementBlock("div",he,[e.createElementVNode("div",me,[e.createElementVNode("div",pe,[e.createElementVNode("div",we,[e.createVNode(B,{modelValue:a.searchName,"onUpdate:modelValue":t[0]||(t[0]=n=>a.searchName=n),filterable:"",class:"input",clearable:"",remote:"",placeholder:a.placeholder,autocomplete:"","remote-show-suffix":"",onFocus:t[1]||(t[1]=n=>a.placeholder=""),onBlur:t[2]||(t[2]=n=>a.placeholder="search for port name or coordinates"),"remote-method":m.fetchSuggestPosition,onChange:m.handleFetchMeteo},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.positionList,n=>(e.openBlock(),e.createBlock(N,{key:n.name,label:n.name,value:n.name},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder","remote-method","onChange"])])])]),e.createElementVNode("div",ge,[e.createElementVNode("div",ke,[e.createElementVNode("div",null,[e.createElementVNode("div",ye,"Weather forecast for "+e.toDisplayString(((_=a.position)==null?void 0:_.name)||"-")+" ( "+e.toDisplayString(a.positionGmt)+" )",1),e.createElementVNode("div",ue,"At "+e.toDisplayString((E=a.position)!=null&&E.portId?"port":"coordinates")+", issued "+e.toDisplayString(a.issuedDate),1)]),e.createElementVNode("div",fe,[e.createVNode(x,{placement:"left",effect:"light",content:a.isCollected?"remove the port/coordinate from the search list":"add the port/coordinate to the search list","show-after":1e3},{default:e.withCtx(()=>[a.isCollected?(e.openBlock(),e.createElementBlock("span",{key:0,class:"iconfont icon active",onClick:t[3]||(t[3]=(...n)=>m.handleCollect&&m.handleCollect(...n))},"")):(e.openBlock(),e.createElementBlock("span",{key:1,class:"iconfont icon",onClick:t[4]||(t[4]=(...n)=>m.handleCollect&&m.handleCollect(...n))},""))]),_:1},8,["content"])])]),(D=a.position)!=null&&D.name&&!a.loading?(e.openBlock(),e.createElementBlock("div",xe)):a.loading?(e.openBlock(),e.createElementBlock("div",_e,"Loading....")):a.position.name?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",be,"No Data")),(w=a.position)!=null&&w.name&&!a.loading?(e.openBlock(),e.createElementBlock("div",Ne,[e.createElementVNode("div",Ee,e.toDisplayString(a.pickedWeek)+" "+e.toDisplayString(m.computeMMMDD(a.pickedDate)),1),e.createElementVNode("table",De,[e.createElementVNode("tr",Be,[t[5]||(t[5]=e.createElementVNode("th",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Local time"),e.createElementVNode("span",{class:"unit"},"(LT)")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.hours,(n,i)=>(e.openBlock(),e.createElementBlock("th",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+"local"},e.toDisplayString(m.computeHourL(n)),3))),128))]),e.createElementVNode("tr",ze,[t[6]||(t[6]=e.createElementVNode("th",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("UTC"),e.createElementVNode("span",{class:"unit"})],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.hours,(n,i)=>(e.openBlock(),e.createElementBlock("th",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+"z"},e.toDisplayString(m.computeHourZ(n)),3))),128))]),e.createElementVNode("tr",Ve,[t[7]||(t[7]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Weather"),e.createElementVNode("span",{class:"unit"})],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.weatherUrls,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+"url"},[e.createVNode(x,{placement:"top",effect:"light",content:a.tableData.weatherNames[i],"show-after":500},{default:e.withCtx(()=>[n?(e.openBlock(),e.createElementBlock("img",{key:0,class:"iconfont weather-icon",src:n},null,8,Se)):e.createCommentVNode("",!0)]),_:2},1032,["content"])],2))),128))]),e.createElementVNode("tr",Le,[t[8]||(t[8]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Temperature"),e.createElementVNode("span",{class:"unit"},"°C")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.temp,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},e.toDisplayString(n),3))),128))]),e.createElementVNode("tr",Ce,[t[9]||(t[9]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Precipitation Probability"),e.createElementVNode("span",{class:"unit"},"%")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.precipProbability,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},e.toDisplayString(n),3))),128))]),e.createElementVNode("tr",Me,[t[10]||(t[10]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Precipitation 1h"),e.createElementVNode("span",{class:"unit"},"mm")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.precip1h,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},e.toDisplayString(n),3))),128))]),e.createElementVNode("tr",Pe,[t[11]||(t[11]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Visibility"),e.createElementVNode("span",{class:"unit"},"nm")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.visibility,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},e.toDisplayString(n),3))),128))]),e.createElementVNode("tr",Te,[t[12]||(t[12]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Relative Humidity"),e.createElementVNode("span",{class:"unit"},"%")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.humidity,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},e.toDisplayString(n),3))),128))]),e.createElementVNode("tr",Ie,[t[13]||(t[13]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Wind direction"),e.createElementVNode("span",{class:"unit"})],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.windDir,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},[isNaN(n)?(e.openBlock(),e.createElementBlock("span",He,"-")):(e.openBlock(),e.createElementBlock("span",{key:0,class:"iconfont icon",style:e.normalizeStyle({display:"inline-block",transform:`rotate(${n}deg)`})},"",4))],2))),128))]),e.createElementVNode("tr",Fe,[t[14]||(t[14]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Wind speed"),e.createElementVNode("span",{class:"unit"},"kts")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.windSpeed,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},e.toDisplayString(n),3))),128))]),e.createElementVNode("tr",We,[t[15]||(t[15]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Wind gust"),e.createElementVNode("span",{class:"unit"},"kts")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.windGust,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},e.toDisplayString(n),3))),128))])]),t[27]||(t[27]=e.createElementVNode("div",{style:{"text-align":"center",padding:"3px"}},null,-1)),e.createElementVNode("table",Re,[e.createElementVNode("tr",Ae,[t[16]||(t[16]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Wind wave height"),e.createElementVNode("span",{class:"unit"},"m")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.windwaveHeight,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},e.toDisplayString(n),3))),128))]),e.createElementVNode("tr",Ge,[t[17]||(t[17]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Wind wave direction"),e.createElementVNode("span",{class:"unit"})],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.windwaveDir,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},[isNaN(n)?(e.openBlock(),e.createElementBlock("span",Oe,"-")):(e.openBlock(),e.createElementBlock("span",{key:0,class:"iconfont icon",style:e.normalizeStyle({display:"inline-block",transform:`rotate(${n}deg)`})},"",4))],2))),128))]),e.createElementVNode("tr",je,[t[18]||(t[18]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Wind wave period"),e.createElementVNode("span",{class:"unit"},"s")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.windwavePeriod,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},e.toDisplayString(n),3))),128))]),e.createElementVNode("tr",qe,[t[19]||(t[19]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Swell height"),e.createElementVNode("span",{class:"unit"},"m")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.swellHeight,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},e.toDisplayString(n),3))),128))]),e.createElementVNode("tr",Ue,[t[20]||(t[20]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Swell direction"),e.createElementVNode("span",{class:"unit"})],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.swellDir,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},[isNaN(n)?(e.openBlock(),e.createElementBlock("span",Ze,"-")):(e.openBlock(),e.createElementBlock("span",{key:0,class:"iconfont icon",style:e.normalizeStyle({display:"inline-block",transform:`rotate(${n}deg)`})},"",4))],2))),128))]),e.createElementVNode("tr",Je,[t[21]||(t[21]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Swell period"),e.createElementVNode("span",{class:"unit"},"s")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.swellPeriod,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},e.toDisplayString(n),3))),128))]),e.createElementVNode("tr",Ye,[t[22]||(t[22]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Sig wave height"),e.createElementVNode("span",{class:"unit"},"m")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.sigwaveHeight,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},e.toDisplayString(n),3))),128))]),e.createElementVNode("tr",Ke,[t[23]||(t[23]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Current direction"),e.createElementVNode("span",{class:"unit"})],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.currentDir,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},[isNaN(n)?(e.openBlock(),e.createElementBlock("span",Qe,"-")):(e.openBlock(),e.createElementBlock("span",{key:0,class:"iconfont icon",style:e.normalizeStyle({display:"inline-block",transform:`rotate(${n}deg)`})},"",4))],2))),128))]),e.createElementVNode("tr",Xe,[t[24]||(t[24]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Current speed"),e.createElementVNode("span",{class:"unit"},"kts")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.currentSpeed,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},e.toDisplayString(n),3))),128))])]),t[28]||(t[28]=e.createElementVNode("div",{style:{"text-align":"center",padding:"3px"}},null,-1)),e.createElementVNode("table",ve,[e.createElementVNode("tr",$e,[t[25]||(t[25]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Sea level height"),e.createElementVNode("span",{class:"unit"},"m")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.seaLevel,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},e.toDisplayString(n),3))),128))]),e.createElementVNode("tr",et,[t[26]||(t[26]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Sea surface temperature"),e.createElementVNode("span",{class:"unit"},"°C")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.seaTemp,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},e.toDisplayString(n),3))),128))])])])):a.loading?(e.openBlock(),e.createElementBlock("div",tt,"Loading....")):(y=a.position)!=null&&y.name?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",st,"No Data"))])])}const ee=ce(de,[["render",at],["__scopeId","data-v-6a06d61a"]]),nt={install(o){o.component("SpotReport",ee)}};f.SpotReport=ee,f.SpotReportPlugin=nt,Object.defineProperty(f,Symbol.toStringTag,{value:"Module"})});
package/dist/style.css CHANGED
@@ -1 +1 @@
1
- @page{size:1200px;margin:20px auto 40px}.spot-report[data-v-7b348412]{height:100%;width:1160px;margin:0 auto;padding:0;display:flex;flex-direction:column;color:var(--idm-black-8)}.spot-report .header-box[data-v-7b348412]{width:100%;padding:10px 0;background-color:var(--idm-white)}.spot-report .header-box .search-box .input[data-v-7b348412]{width:300px}.spot-report .header-box .search-box .info[data-v-7b348412]{margin:0 10px;color:var(--idm-info-color);font-size:12px}.spot-report .content-box[data-v-7b348412]{flex:1;width:100%;box-sizing:border-box}.spot-report .content-box .title-box[data-v-7b348412]{margin-top:5px}.spot-report .content-box .title-box .main-title[data-v-7b348412]{font-size:16px;font-weight:700}.spot-report .content-box .title-box .sub-title[data-v-7b348412]{font-size:13px;padding:2px 0}.spot-report .content-box .title-box .icon[data-v-7b348412]{cursor:pointer;margin-left:10px;font-size:16px}.spot-report .content-box .title-box .icon[data-v-7b348412]:hover{color:var(--idm-primary-color)}.spot-report .content-box .title-box .icon.active[data-v-7b348412]{color:var(--idm-warning-color)}.spot-report .content-box #weather-chart[data-v-7b348412],.spot-report .content-box .weather-chart[data-v-7b348412]{height:225px;width:100%;border:1px solid var(--idm-gray-light);box-sizing:border-box}.spot-report .content-box .card-box[data-v-7b348412]{min-height:500px;margin:10px 0;background:var(--idm-gray-light);border-radius:4px;font-size:14px;color:var(--idm-black-8);line-height:26px}.spot-report .content-box .card-box .date[data-v-7b348412]{font-weight:700;padding:2px 10px;background:var(--idm-white)}.spot-report .content-box .card-box .basic-table[data-v-7b348412],.spot-report .content-box .card-box .wave-current-table[data-v-7b348412],.spot-report .content-box .card-box .sea-table[data-v-7b348412]{width:100%;font-size:12px;padding:5px;border-collapse:collapse;border:1px solid var(--idm-gray-light)}.spot-report .content-box .card-box .basic-table .tr-title[data-v-7b348412],.spot-report .content-box .card-box .wave-current-table .tr-title[data-v-7b348412],.spot-report .content-box .card-box .sea-table .tr-title[data-v-7b348412]{width:200px;padding-right:10px;text-align:right!important;background:none}.spot-report .content-box .card-box .basic-table .tr-title .unit[data-v-7b348412],.spot-report .content-box .card-box .wave-current-table .tr-title .unit[data-v-7b348412],.spot-report .content-box .card-box .sea-table .tr-title .unit[data-v-7b348412]{width:20px;padding:0 5px;text-align:left;display:inline-block;color:var(--idm-info-color)}.spot-report .content-box .card-box .basic-table td[data-v-7b348412],.spot-report .content-box .card-box .wave-current-table td[data-v-7b348412],.spot-report .content-box .card-box .sea-table td[data-v-7b348412]{text-align:center;line-height:21px;width:40px;background:var(--idm-white)}.spot-report .content-box .card-box .basic-table td.active[data-v-7b348412],.spot-report .content-box .card-box .wave-current-table td.active[data-v-7b348412],.spot-report .content-box .card-box .sea-table td.active[data-v-7b348412]{background:#e1f7ff}.spot-report .content-box .card-box .basic-table th[data-v-7b348412],.spot-report .content-box .card-box .wave-current-table th[data-v-7b348412],.spot-report .content-box .card-box .sea-table th[data-v-7b348412]{color:var(--idm-info-color);font-weight:400;text-align:center;line-height:21px;width:40px}.spot-report .content-box .card-box .basic-table th.active[data-v-7b348412],.spot-report .content-box .card-box .wave-current-table th.active[data-v-7b348412],.spot-report .content-box .card-box .sea-table th.active[data-v-7b348412]{background:#e1f7ff}.spot-report .content-box .card-box .basic-table .weather-icon[data-v-7b348412],.spot-report .content-box .card-box .wave-current-table .weather-icon[data-v-7b348412],.spot-report .content-box .card-box .sea-table .weather-icon[data-v-7b348412]{width:24px;height:24px;cursor:pointer}
1
+ @page{size:1200px;margin:20px auto 40px}.spot-report[data-v-6a06d61a]{height:100%;width:1160px;margin:0 auto;padding:0;display:flex;flex-direction:column;color:var(--idm-black-8)}.spot-report .header-box[data-v-6a06d61a]{width:100%;padding:10px 0;background-color:var(--idm-white)}.spot-report .header-box .search-box .input[data-v-6a06d61a]{width:300px}.spot-report .header-box .search-box .info[data-v-6a06d61a]{margin:0 10px;color:var(--idm-info-color);font-size:12px}.spot-report .content-box[data-v-6a06d61a]{flex:1;width:100%;box-sizing:border-box}.spot-report .content-box .title-box[data-v-6a06d61a]{margin-top:5px}.spot-report .content-box .title-box .main-title[data-v-6a06d61a]{font-size:16px;font-weight:700}.spot-report .content-box .title-box .sub-title[data-v-6a06d61a]{font-size:13px;padding:2px 0}.spot-report .content-box .title-box .icon[data-v-6a06d61a]{cursor:pointer;margin-left:10px;font-size:16px}.spot-report .content-box .title-box .icon[data-v-6a06d61a]:hover{color:var(--idm-primary-color)}.spot-report .content-box .title-box .icon.active[data-v-6a06d61a]{color:var(--idm-warning-color)}.spot-report .content-box #weather-chart[data-v-6a06d61a],.spot-report .content-box .weather-chart[data-v-6a06d61a]{height:225px;width:100%;border:1px solid var(--idm-gray-light);box-sizing:border-box}.spot-report .content-box .card-box[data-v-6a06d61a]{min-height:500px;margin:10px 0;background:var(--idm-gray-light);border-radius:4px;font-size:14px;color:var(--idm-black-8);line-height:26px}.spot-report .content-box .card-box .date[data-v-6a06d61a]{font-weight:700;padding:2px 10px;background:var(--idm-white)}.spot-report .content-box .card-box .basic-table[data-v-6a06d61a],.spot-report .content-box .card-box .wave-current-table[data-v-6a06d61a],.spot-report .content-box .card-box .sea-table[data-v-6a06d61a]{width:100%;font-size:12px;padding:5px;border-collapse:collapse;border:1px solid var(--idm-gray-light)}.spot-report .content-box .card-box .basic-table .tr-title[data-v-6a06d61a],.spot-report .content-box .card-box .wave-current-table .tr-title[data-v-6a06d61a],.spot-report .content-box .card-box .sea-table .tr-title[data-v-6a06d61a]{width:200px;padding-right:10px;text-align:right!important;background:none}.spot-report .content-box .card-box .basic-table .tr-title .unit[data-v-6a06d61a],.spot-report .content-box .card-box .wave-current-table .tr-title .unit[data-v-6a06d61a],.spot-report .content-box .card-box .sea-table .tr-title .unit[data-v-6a06d61a]{width:20px;padding:0 5px;text-align:left;display:inline-block;color:var(--idm-info-color)}.spot-report .content-box .card-box .basic-table td[data-v-6a06d61a],.spot-report .content-box .card-box .wave-current-table td[data-v-6a06d61a],.spot-report .content-box .card-box .sea-table td[data-v-6a06d61a]{text-align:center;line-height:21px;width:40px;background:var(--idm-white)}.spot-report .content-box .card-box .basic-table td.active[data-v-6a06d61a],.spot-report .content-box .card-box .wave-current-table td.active[data-v-6a06d61a],.spot-report .content-box .card-box .sea-table td.active[data-v-6a06d61a]{background:#e1f7ff}.spot-report .content-box .card-box .basic-table th[data-v-6a06d61a],.spot-report .content-box .card-box .wave-current-table th[data-v-6a06d61a],.spot-report .content-box .card-box .sea-table th[data-v-6a06d61a]{color:var(--idm-info-color);font-weight:400;text-align:center;line-height:21px;width:40px}.spot-report .content-box .card-box .basic-table th.active[data-v-6a06d61a],.spot-report .content-box .card-box .wave-current-table th.active[data-v-6a06d61a],.spot-report .content-box .card-box .sea-table th.active[data-v-6a06d61a]{background:#e1f7ff}.spot-report .content-box .card-box .basic-table .weather-icon[data-v-6a06d61a],.spot-report .content-box .card-box .wave-current-table .weather-icon[data-v-6a06d61a],.spot-report .content-box .card-box .sea-table .weather-icon[data-v-6a06d61a]{width:24px;height:24px;cursor:pointer}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@idmui/spot",
3
3
  "private": false,
4
- "version": "0.0.5",
4
+ "version": "0.0.6",
5
5
  "description": "idm ui spot",
6
6
  "type": "module",
7
7
  "keywords": [