ocearo-ui
Version:
Ocean Robot UI: 3D visualization dashboard for signalk
1 lines • 23.6 kB
JavaScript
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,76103,e=>{"use strict";var t=e.i(43476),s=e.i(71645),a=e.i(67561),o=e.i(85709),n=e.i(49721),l=e.i(68757),i=e.i(83402),r=e.i(48390),d=e.i(46932),c=e.i(88653);e.i(85269);var u=e.i(22831);e.s(["default",0,()=>{let e,x,m,h,b,g,p,f,N,j,v,{t:k}=(0,u.useTranslation)(),{nightMode:y}=(0,a.useOcearoContext)(),[w,C]=(0,s.useState)("logbook"),A=(0,s.useMemo)(()=>["navigation.position","navigation.courseOverGroundTrue","navigation.headingTrue","navigation.speedOverGround","environment.wind.speedTrue","environment.wind.angleTrueWater","environment.outside.pressure","environment.outside.temperature","navigation.log","propulsion.main.runTime"],[]),S=(0,o.useSignalKPaths)(A),[T,O]=(0,s.useState)([]),[G,B]=(0,s.useState)(!1),[E,I]=(0,s.useState)(null),[R,F]=(0,s.useState)("UTC"),[L,$]=(0,s.useState)(null),[P,D]=(0,s.useState)(!1),[W,z]=(0,s.useState)({text:"",author:"manual"}),[M,U]=(0,s.useState)(!1),[K,J]=(0,s.useState)(null),[Y,H]=(0,s.useState)(null),[V,Z]=(0,s.useState)(!1);i.default.getAll();let q=(0,r.isOcearoCoreEnabled)(),Q=(0,s.useCallback)(async()=>{B(!0),I(null);try{let e=(await (0,r.fetchLogbookEntries)()).map(e=>({...e,date:new Date(e.datetime||e.date),point:e.point?{...e.point,toString:()=>"number"==typeof e.point.latitude&&"number"==typeof e.point.longitude?`${e.point.latitude.toFixed(6)}, ${e.point.longitude.toFixed(6)}`:"Invalid coordinates"}:null}));O(e)}catch(e){"NetworkError"!==e.name&&"TimeoutError"!==e.name&&console.warn("Error fetching logbook entries:",e),I((0,r.handleOcearoCoreError)(e,"Logbook fetch")),i.default.get("debugMode")?O(X()):O([])}finally{B(!1)}},[]),X=()=>[{datetime:new Date().toISOString(),date:new Date,course:45,speed:{sog:6.5},wind:{speed:12,direction:180},observations:{seaState:2,cloudCoverage:3,visibility:7},barometer:1013.2,point:{latitude:46.1591,longitude:-1.1522,toString:()=>"46.159100, -1.152200"},position:{source:"GPS",latitude:46.1591,longitude:-1.1522},log:125.5,engine:{hours:245.2},author:"Captain",text:"Departing La Rochelle, good conditions"},{datetime:new Date(Date.now()-36e5).toISOString(),date:new Date(Date.now()-36e5),heading:42,speed:{sog:7.2},wind:{speed:15,direction:200},observations:{seaState:3,cloudCoverage:2,visibility:8},barometer:1012.8,point:{latitude:46.2591,longitude:-1.2522,toString:()=>"46.259100, -1.252200"},position:{source:"GPS",latitude:46.2591,longitude:-1.2522},log:132.1,engine:{hours:245.8},author:"auto",text:"Wind picking up, adjusting course"}],_=(0,s.useCallback)(()=>{z({text:"",author:"manual"}),D(!0)},[]),ee=(0,s.useCallback)(async()=>{try{let e=S["navigation.position"]||{},t={datetime:new Date().toISOString(),position:{latitude:e.latitude||46.1591,longitude:e.longitude||-1.1522,source:"GPS"},course:S["navigation.courseOverGroundTrue"]||S["navigation.headingTrue"],speed:{sog:S["navigation.speedOverGround"]||0},wind:{speed:S["environment.wind.speedTrue"]||0,direction:S["environment.wind.angleTrueWater"]||0},barometer:S["environment.outside.pressure"]?S["environment.outside.pressure"]/100:1013,log:S["navigation.log"]||0,engine:{hours:S["propulsion.main.runTime"]?S["propulsion.main.runTime"]/3600:0},author:W.author||"manual",text:W.text||"Manual entry"};await (0,r.addLogbookEntry)(t),D(!1),Q()}catch(e){console.warn("Error adding entry:",e),I((0,r.handleOcearoCoreError)(e,"Add logbook entry"))}},[S,Q,W]),et=(0,s.useCallback)(async()=>{if(!q)return void I(k("logbook.ocearoCoreNotEnabled"));try{Z(!0),I(null);let e={position:S["navigation.position"],course:S["navigation.courseOverGroundTrue"]||S["navigation.headingTrue"],speed:S["navigation.speedOverGround"],wind:{speed:S["environment.wind.speedTrue"],direction:S["environment.wind.angleTrueWater"]},weather:{pressure:S["environment.outside.pressure"],temperature:S["environment.outside.temperature"]},engine:{hours:S["propulsion.main.runTime"]},log:S["navigation.log"]},t=await (0,r.generateOcearoCoreLogbookEntry)(e);await Q(),t&&t.analysis&&(J(t.analysis),H("auto-entry"),C("analysis"))}catch(e){I((0,r.handleOcearoCoreError)(e,"OcearoCore entry generation"))}finally{Z(!1)}},[q,S,Q]),es=(0,s.useCallback)(async e=>{if(!q)return void I(k("logbook.ocearoCoreNotEnabled"));try{U(!0),J(null),H(e),I(null),C("analysis");let t=await (0,r.requestAnalysis)(e);J(t),console.log("OcearoCore Analysis:",t)}catch(e){I((0,r.handleOcearoCoreError)(e,"OcearoCore analysis"))}finally{U(!1)}},[q]),ea=(0,s.useCallback)(async()=>{if(!q)return void I(k("logbook.ocearoCoreNotEnabled"));try{U(!0),J(null),H("logbook"),I(null),C("analysis");let e=await (0,r.analyzeLogbookWithOcearoCore)();J(e),console.log("Logbook Analysis:",e)}catch(e){I((0,r.handleOcearoCoreError)(e,"Logbook analysis"))}finally{U(!1)}},[q]),eo=(0,s.useCallback)(e=>{$(e),D(!0)},[]),en=e=>{let t=[];if(e.wind){let s=[];Number.isNaN(Number(e.wind.speed))||s.push(`${e.wind.speed}kt`),Number.isNaN(Number(e.wind.direction))||s.push(`${e.wind.direction}\xb0`),s.length&&t.push(`Wind ${s.join(" ")}`)}return e.observations&&(Number.isNaN(Number(e.observations.seaState))||t.push(`Sea state ${e.observations.seaState}`),Number.isNaN(Number(e.observations.cloudCoverage))||t.push(`Clouds ${e.observations.cloudCoverage}/8`),Number.isNaN(Number(e.observations.visibility))||t.push(`Visibility ${e.observations.visibility+1}`)),t.join(", ")},el=e=>Number.isNaN(Number(e.course))?Number.isNaN(Number(e.heading))?"":`HDT ${e.heading}\xb0`:`${e.course}\xb0`;return(0,s.useEffect)(()=>{Q()},[Q]),(0,t.jsxs)("div",{className:"flex flex-col h-full bg-rightPaneBg overflow-hidden",children:[(0,t.jsx)("div",{className:"flex border-b border-hud bg-hud-bg",children:[{id:"timeline",label:k("logbook.missionTimeline"),icon:l.faTimeline},{id:"logbook",label:k("logbook.tacticalLog"),icon:l.faBook},{id:"analysis",label:k("logbook.fleetIntelligence"),icon:l.faChartLine}].map(e=>(0,t.jsxs)("button",{onClick:()=>C(e.id),className:`flex-1 py-3 px-2 text-xs font-black uppercase flex items-center justify-center transition-all duration-500 ${w===e.id?"text-oGreen border-b-2 border-oGreen bg-hud-bg":"text-hud-secondary hover:text-hud-main tesla-hover"}`,children:[(0,t.jsx)(n.FontAwesomeIcon,{icon:e.icon,className:"mr-2"}),e.label]},e.id))}),(0,t.jsx)("div",{className:"flex-1 flex flex-col min-h-0",children:(0,t.jsx)(c.AnimatePresence,{mode:"wait",children:(0,t.jsxs)(d.motion.div,{initial:{opacity:0,x:10},animate:{opacity:1,x:0},exit:{opacity:0,x:-10},transition:{duration:.4,ease:"easeOut"},className:"h-full overflow-auto scrollbar-hide",children:["logbook"===w&&(0,t.jsxs)("div",{className:"p-4 flex flex-col h-full overflow-hidden",children:[(0,t.jsxs)("div",{className:"flex justify-between items-center mb-6",children:[(0,t.jsxs)("h3",{className:"text-xs font-black text-hud-main uppercase tracking-widest flex items-center",children:[(0,t.jsx)(n.FontAwesomeIcon,{icon:l.faBook,className:"mr-2 text-oBlue text-xs"}),k("logbook.logbookEntries")]}),(0,t.jsxs)("div",{className:"flex space-x-3",children:[q&&(0,t.jsxs)("button",{className:"bg-oGreen/10 text-oGreen hover:bg-oGreen/20 px-3 py-1.5 rounded text-xs font-black uppercase transition-all duration-300 flex items-center shadow-soft border border-oGreen/20 disabled:opacity-50",onClick:et,disabled:V||G,children:[(0,t.jsx)(n.FontAwesomeIcon,{icon:l.faRobot,className:`mr-2 ${V?"animate-spin":""}`}),V?k("logbook.aiEntryGenerating"):k("logbook.aiEntry")]}),(0,t.jsxs)("button",{className:"bg-oBlue hover:bg-blue-600 text-hud-main px-3 py-1.5 rounded text-xs font-black uppercase transition-all duration-300 flex items-center shadow-soft",onClick:_,disabled:G,children:[(0,t.jsx)(n.FontAwesomeIcon,{icon:l.faPlus,className:"mr-2"}),k("logbook.add")]})]})]}),E&&(0,t.jsx)("div",{className:"bg-oRed/10 text-oRed p-3 rounded text-xs font-black uppercase mb-4 animate-soft-pulse border border-oRed/20",children:E}),(0,t.jsx)("div",{className:"tesla-card flex-1 overflow-auto bg-hud-bg",children:(0,t.jsxs)("table",{className:"w-full text-xs font-black uppercase tracking-tight",children:[(0,t.jsx)("thead",{className:"sticky top-0 bg-hud-bg backdrop-blur-md z-10",children:(0,t.jsxs)("tr",{className:"text-hud-secondary border-b border-hud",children:[(0,t.jsx)("th",{className:"p-3 text-left",children:k("logbook.time")}),(0,t.jsx)("th",{className:"p-3 text-left",children:k("logbook.courseCol")}),(0,t.jsx)("th",{className:"p-3 text-left",children:k("logbook.sog")}),(0,t.jsx)("th",{className:"p-3 text-left",children:k("logbook.weatherCol")}),(0,t.jsx)("th",{className:"p-3 text-left",children:k("logbook.baro")}),(0,t.jsx)("th",{className:"p-3 text-left",children:k("logbook.position")}),(0,t.jsx)("th",{className:"p-3 text-left",children:k("logbook.log")}),(0,t.jsx)("th",{className:"p-3 text-left",children:k("logbook.eng")}),(0,t.jsx)("th",{className:"p-3 text-left",children:k("logbook.by")}),(0,t.jsx)("th",{className:"p-3 text-left",children:k("logbook.noteCol")})]})}),(0,t.jsx)("tbody",{className:"divide-y divide-hud",children:T.map((e,s)=>(0,t.jsxs)("tr",{onClick:()=>eo(e),className:"tesla-hover cursor-pointer text-hud-main",children:[(0,t.jsx)("td",{className:"p-3 whitespace-nowrap opacity-60",children:e.date.toLocaleString("en-GB",{day:"2-digit",month:"2-digit",hour:"2-digit",minute:"2-digit",timeZone:R})}),(0,t.jsx)("td",{className:"p-3 gliding-value",children:el(e)}),(0,t.jsx)("td",{className:"p-3 gliding-value",children:e.speed&&!Number.isNaN(Number(e.speed.sog))?`${e.speed.sog}kt`:""}),(0,t.jsx)("td",{className:"p-3 text-hud-secondary font-bold lowercase normal-case",children:en(e)}),(0,t.jsx)("td",{className:"p-3 gliding-value opacity-60",children:e.barometer}),(0,t.jsx)("td",{className:"p-3 text-xs text-hud-muted font-mono tracking-tighter",children:e.point?e.point.toString():"n/a"}),(0,t.jsx)("td",{className:"p-3 gliding-value",children:Number.isNaN(Number(e.log))?"":`${e.log}NM`}),(0,t.jsx)("td",{className:"p-3 gliding-value",children:e.engine&&!Number.isNaN(Number(e.engine.hours))?`${e.engine.hours}h`:""}),(0,t.jsx)("td",{className:"p-3 text-oBlue opacity-80",children:e.author||"auto"}),(0,t.jsx)("td",{className:"p-3 normal-case font-bold text-hud-secondary truncate max-w-xs",children:e.text})]},e.datetime||s))})]})})]}),"timeline"===w&&(e=[...T].reverse(),(0,t.jsxs)("div",{className:"p-4 space-y-6",children:[(0,t.jsxs)("div",{className:"flex justify-between items-center mb-6",children:[(0,t.jsxs)("h3",{className:"text-xs font-black text-hud-main uppercase tracking-widest flex items-center",children:[(0,t.jsx)(n.FontAwesomeIcon,{icon:l.faTimeline,className:"mr-2 text-oGreen text-xs"}),k("logbook.cruiseTimeline")]}),(0,t.jsxs)("div",{className:"flex space-x-3",children:[q&&(0,t.jsxs)("button",{className:"bg-oGreen/10 text-oGreen hover:bg-oGreen/20 px-3 py-1.5 rounded text-xs font-black uppercase transition-all duration-300 flex items-center shadow-soft border border-oGreen/20 disabled:opacity-50",onClick:et,disabled:V||G,children:[(0,t.jsx)(n.FontAwesomeIcon,{icon:l.faRobot,className:`mr-2 ${V?"animate-spin":""}`}),V?k("logbook.aiEntryGenerating"):k("logbook.aiAuto")]}),(0,t.jsxs)("button",{className:"bg-oBlue hover:bg-blue-600 text-hud-main px-3 py-1.5 rounded text-xs font-black uppercase transition-all duration-300 flex items-center shadow-soft",onClick:_,disabled:G,children:[(0,t.jsx)(n.FontAwesomeIcon,{icon:l.faPlus,className:"mr-2"}),k("logbook.add")]})]})]}),E&&(0,t.jsx)("div",{className:"bg-oRed/10 text-oRed p-3 rounded text-xs font-black uppercase mb-4 animate-soft-pulse border border-oRed/20",children:E}),(0,t.jsx)("div",{className:"space-y-4",children:e.map((e,s)=>(0,t.jsxs)("div",{onClick:()=>eo(e),className:"tesla-card tesla-hover cursor-pointer group",children:[(0,t.jsxs)("div",{className:"bg-hud-elevated px-4 py-2 flex justify-between items-center border-b border-hud",children:[(0,t.jsx)("div",{className:"text-xs font-black text-oBlue uppercase tracking-widest group-hover:text-oBlue transition-colors",children:e.author||"system"}),(0,t.jsx)("div",{className:"text-xs font-black text-hud-secondary uppercase tracking-tighter",children:e.date.toLocaleString("en-GB",{day:"2-digit",month:"short",hour:"2-digit",minute:"2-digit",timeZone:R})})]}),(0,t.jsxs)("div",{className:"p-4",children:[(0,t.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 text-xs font-black uppercase mb-4 tracking-tight text-hud-secondary",children:[(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)("span",{className:"text-xs text-hud-dim mb-1",children:k("logbook.courseCol")}),(0,t.jsx)("span",{className:"text-hud-main gliding-value",children:el(e)})]}),(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)("span",{className:"text-xs text-hud-dim mb-1",children:k("logbook.speed")}),(0,t.jsx)("span",{className:"text-hud-main gliding-value",children:e.speed&&!Number.isNaN(Number(e.speed.sog))?`${e.speed.sog}kt`:"N/A"})]}),(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)("span",{className:"text-xs text-hud-dim mb-1",children:k("logbook.log")}),(0,t.jsx)("span",{className:"text-hud-main gliding-value",children:Number.isNaN(Number(e.log))?"N/A":`${e.log}NM`})]}),(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)("span",{className:"text-xs text-hud-dim mb-1",children:k("logbook.coord")}),(0,t.jsx)("span",{className:"text-hud-main text-xs font-mono truncate",children:e.point?e.point.toString():"N/A"})]})]}),e.text&&(0,t.jsx)("div",{className:"p-3 bg-hud-elevated rounded-sm border-l-2 border-oBlue/30 text-xs font-bold text-hud-secondary normal-case leading-relaxed italic",children:e.text}),en(e)&&(0,t.jsxs)("div",{className:"mt-3 flex items-center text-xs font-black text-hud-secondary uppercase tracking-widest",children:[(0,t.jsx)(n.FontAwesomeIcon,{icon:l.faCloudSun,className:"mr-2 text-oYellow opacity-50"}),en(e)]})]})]},e.datetime||s))})]})),"analysis"===w&&(0,t.jsxs)("div",{className:"p-4 space-y-6",children:[(0,t.jsxs)("div",{className:"mb-6",children:[(0,t.jsxs)("h3",{className:"text-xs font-black text-hud-main uppercase tracking-widest flex items-center mb-2",children:[(0,t.jsx)(n.FontAwesomeIcon,{icon:l.faChartLine,className:"mr-2 text-oBlue text-xs"}),k("logbook.fleetIntelligence")]}),(0,t.jsx)("p",{className:"text-hud-secondary text-xs font-black uppercase tracking-tighter",children:k("logbook.aiPoweredAnalysis")})]}),q&&(0,t.jsxs)("div",{className:"tesla-card p-4 mb-6 bg-hud-bg",children:[(0,t.jsx)("h4",{className:"text-xs font-black text-hud-secondary mb-4 uppercase tracking-widest",children:k("logbook.selectOperation")}),(0,t.jsx)("div",{className:"grid grid-cols-2 md:grid-cols-5 gap-3",children:[{id:"logbook",label:"LOGBOOK",icon:l.faBook,color:"bg-purple-600",action:ea},{id:"weather",label:"WEATHER",icon:l.faCloudSun,color:"bg-blue-600",action:()=>es("weather")},{id:"sail",label:"SAIL",icon:l.faCompass,color:"bg-oGreen",action:()=>es("sail")},{id:"alerts",label:"ALERTS",icon:l.faRobot,color:"bg-oRed",action:()=>es("alerts")},{id:"status",label:"STATUS",icon:l.faTachometerAlt,color:"bg-oYellow",action:()=>es("status")}].map(e=>(0,t.jsxs)("button",{className:"tesla-card tesla-hover p-4 flex flex-col items-center justify-center space-y-3 shadow-soft group border border-hud",onClick:e.action,disabled:M,children:[(0,t.jsx)("div",{className:`${e.color} w-10 h-10 rounded-full flex items-center justify-center shadow-lg group-hover:scale-110 transition-transform duration-500`,children:(0,t.jsx)(n.FontAwesomeIcon,{icon:e.icon,className:"text-hud-main text-sm"})}),(0,t.jsx)("span",{className:"text-xs font-black text-hud-main tracking-widest",children:e.label})]},e.id))})]}),E&&(0,t.jsx)("div",{className:"bg-oRed/10 text-oRed p-3 rounded text-xs font-black uppercase mb-4 animate-soft-pulse border border-oRed/20",children:E}),M&&(0,t.jsxs)("div",{className:"tesla-card p-10 text-center bg-hud-bg",children:[(0,t.jsx)(n.FontAwesomeIcon,{icon:l.faRobot,className:"text-4xl text-oGreen mb-6 animate-soft-pulse"}),(0,t.jsx)("h4",{className:"text-xs font-black text-hud-main uppercase tracking-widest mb-4",children:k("logbook.neuralProcessing")}),(0,t.jsx)("div",{className:"w-48 mx-auto bg-hud-elevated h-1 rounded-full overflow-hidden",children:(0,t.jsx)("div",{className:"bg-oGreen h-full animate-progress-indefinite rounded-full",style:{width:"40%"}})}),(0,t.jsxs)("p",{className:"text-hud-muted text-xs font-black uppercase mt-4 tracking-tighter italic",children:[k("logbook.processNode")," ",Y]})]}),K&&!M&&(x=K.analysis&&"object"==typeof K.analysis?K.analysis:null,m="string"==typeof K.analysis?K.analysis:null,h=void 0!==K.settings&&!K.analysis,b=m||x?.text||x?.summary||K.aiAnalysis||("string"==typeof K.summary?K.summary:null)||h&&(K.settings?.analysis?.speech||K.course?.analysis?.speech)||null,g=K.speechText||("string"==typeof K.speech?K.speech:null)||x?.speech||(h?K.settings?.analysis?.speech||K.course?.analysis?.speech:null),f=Array.isArray(p=K.recommendations||x?.recommendations||(h&&K.settings?.adjustments?.length>0?K.settings.adjustments.map(e=>e.action||e.message||JSON.stringify(e)):null))?p:null,j=Array.isArray(N=K.insights||x?.expertAdvice)?N:null,v=K.data||K.weatherData||K.assessment||(h?{course:K.course,settings:K.settings}:null),(0,t.jsxs)("div",{className:"tesla-card p-6 shadow-xl animate-fade-in",children:[(0,t.jsxs)("div",{className:"flex items-center mb-6 border-b border-hud pb-4",children:[(0,t.jsx)(n.FontAwesomeIcon,{icon:l.faChartLine,className:"text-oGreen mr-3 text-sm"}),(0,t.jsxs)("h4",{className:"text-xs font-black text-hud-main uppercase tracking-widest",children:[k("logbook.operationReport")," ",Y]})]}),(0,t.jsxs)("div",{className:"space-y-6",children:[b&&(0,t.jsxs)("div",{className:"tesla-card bg-hud-bg p-4 border-l-2 border-oBlue/30 shadow-subtle",children:[(0,t.jsx)("h5",{className:"text-xs font-black text-oBlue mb-3 uppercase tracking-widest",children:k("logbook.executiveSummary")}),(0,t.jsx)("p",{className:"text-hud-secondary text-xs font-bold leading-relaxed italic normal-case",children:b})]}),(j||f)&&(0,t.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[j&&(0,t.jsxs)("div",{className:"tesla-card bg-hud-bg p-4 shadow-subtle",children:[(0,t.jsxs)("h5",{className:"text-xs font-black text-cyan-400 mb-3 uppercase tracking-widest flex items-center",children:[(0,t.jsx)(n.FontAwesomeIcon,{icon:l.faRobot,className:"mr-2 text-xs"}),k("logbook.strategicInsights")]}),(0,t.jsx)("ul",{className:"space-y-2",children:j.map((e,s)=>(0,t.jsxs)("li",{className:"text-xs font-bold text-hud-secondary normal-case flex items-start",children:[(0,t.jsx)("span",{className:"text-oBlue mr-2 opacity-50",children:"›"}),e]},s))})]}),f&&(0,t.jsxs)("div",{className:"tesla-card bg-hud-bg p-4 shadow-subtle",children:[(0,t.jsxs)("h5",{className:"text-xs font-black text-oGreen mb-3 uppercase tracking-widest flex items-center",children:[(0,t.jsx)(n.FontAwesomeIcon,{icon:l.faChartLine,className:"mr-2 text-xs"}),k("logbook.operationalAdvice")]}),(0,t.jsx)("ul",{className:"space-y-2",children:f.map((e,s)=>(0,t.jsxs)("li",{className:"text-xs font-bold text-hud-secondary normal-case flex items-start",children:[(0,t.jsx)("span",{className:"text-oGreen mr-2 opacity-50",children:"✓"}),"string"==typeof e?e:e.message||JSON.stringify(e)]},s))})]})]}),g&&(0,t.jsxs)("div",{className:"bg-oBlue/5 p-4 rounded-sm border border-oBlue/10 shadow-soft",children:[(0,t.jsxs)("h5",{className:"text-xs font-black text-oBlue mb-2 uppercase tracking-widest flex items-center",children:[(0,t.jsx)(n.FontAwesomeIcon,{icon:l.faRobot,className:"mr-2 animate-soft-pulse"}),k("logbook.voiceTelemetry")]}),(0,t.jsx)("p",{className:"text-hud-secondary text-xs font-bold leading-relaxed italic normal-case",children:g})]}),v&&(0,t.jsxs)("div",{className:"tesla-card bg-hud-bg p-4 border border-hud",children:[(0,t.jsx)("h5",{className:"text-xs font-black text-hud-secondary mb-3 uppercase tracking-widest",children:k("logbook.rawTelemetryData")}),(0,t.jsx)("pre",{className:"text-oGreen/70 text-xs font-mono overflow-auto max-h-40 font-bold scrollbar-thin",children:JSON.stringify(v,null,2)})]}),K.timestamp&&(0,t.jsxs)("div",{className:"text-hud-dim text-xs font-black text-right uppercase tracking-tighter",children:[k("logbook.generated")," ",new Date(K.timestamp).toLocaleString()," // OCEAROCORE V2.4"]})]})]})),!K&&!M&&(0,t.jsx)("div",{className:"tesla-card p-12 text-center bg-hud-bg shadow-inner border border-hud",children:(0,t.jsxs)("div",{className:"text-hud-muted",children:[(0,t.jsx)(n.FontAwesomeIcon,{icon:l.faRobot,size:"3x",className:"mb-6 opacity-20"}),(0,t.jsx)("h4",{className:"text-xs font-black text-hud-main uppercase tracking-widest mb-3",children:k("logbook.diagnosticReady")}),(0,t.jsx)("p",{className:"text-xs font-black uppercase tracking-tight max-w-xs mx-auto leading-relaxed",children:k("logbook.diagnosticReadyDesc")})]})})]})]},w)})}),P&&(0,t.jsx)("div",{className:"fixed inset-0 bg-hud-bg/60 backdrop-blur-sm flex items-center justify-center z-50",onClick:()=>D(!1),children:(0,t.jsxs)("div",{className:"bg-hud-bg backdrop-blur-xl rounded-3xl p-6 sm:p-8 max-w-md w-full mx-4 shadow-2xl border border-hud max-h-[90vh] overflow-y-auto",onClick:e=>e.stopPropagation(),children:[(0,t.jsxs)("div",{className:"flex justify-between items-center mb-8",children:[(0,t.jsxs)("h3",{className:"text-xl font-black text-hud-main flex items-center tracking-tight",children:[(0,t.jsx)(n.FontAwesomeIcon,{icon:l.faBook,className:"mr-3 text-oBlue"}),L?k("logbook.editEntry"):k("logbook.manualEntry")]}),(0,t.jsx)("button",{onClick:()=>D(!1),className:"w-10 h-10 rounded-full flex items-center justify-center text-hud-secondary hover:text-hud-main hover:bg-hud-elevated transition-all duration-300",children:(0,t.jsx)(n.FontAwesomeIcon,{icon:l.faTimes,size:"lg"})})]}),(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("label",{className:"block text-xs font-black uppercase tracking-widest text-hud-secondary mb-2 flex items-center",children:[(0,t.jsx)(n.FontAwesomeIcon,{icon:l.faUser,className:"mr-2 text-oBlue"}),k("logbook.author")]}),(0,t.jsx)("input",{type:"text",value:W.author,onChange:e=>z({...W,author:e.target.value}),className:"w-full bg-hud-elevated text-hud-main px-4 py-3 rounded-xl border border-hud focus:border-oBlue focus:outline-none transition-all duration-300 font-bold",placeholder:k("logbook.authorPlaceholder")})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("label",{className:"block text-xs font-black uppercase tracking-widest text-hud-secondary mb-2 flex items-center",children:[(0,t.jsx)(n.FontAwesomeIcon,{icon:l.faStickyNote,className:"mr-2 text-oYellow"}),k("logbook.note")]}),(0,t.jsx)("textarea",{value:W.text,onChange:e=>z({...W,text:e.target.value}),className:"w-full bg-hud-elevated text-hud-main px-4 py-3 rounded-xl border border-hud focus:border-oBlue focus:outline-none transition-all duration-300 font-bold min-h-[120px]",placeholder:k("logbook.notePlaceholder")})]}),(0,t.jsxs)("div",{className:"flex justify-end space-x-4 pt-6 border-t border-hud",children:[(0,t.jsx)("button",{onClick:()=>D(!1),className:"px-6 py-3 bg-hud-elevated hover:bg-hud-bg text-hud-main font-bold rounded-xl transition-all duration-300",children:k("logbook.cancel")}),(0,t.jsxs)("button",{onClick:ee,className:"px-8 py-3 bg-oBlue hover:bg-blue-600 text-hud-main font-bold rounded-xl transition-all duration-300 flex items-center shadow-lg shadow-oBlue/20",children:[(0,t.jsx)(n.FontAwesomeIcon,{icon:l.faPlus,className:"mr-2"}),k("logbook.saveEntry")]})]})]})]})})]})}])},70127,e=>{e.n(e.i(76103))}]);