ocearo-ui
Version:
Ocean Robot UI: 3D visualization dashboard for signalk
1 lines • 34 kB
JavaScript
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,87628,e=>{"use strict";var s=e.i(43476),t=e.i(71645),a=e.i(46932);e.i(85269);var r=e.i(22831),l=e.i(83402),n=e.i(67561),d=e.i(18850);let c=({color:e})=>(0,s.jsx)("span",{className:`inline-block w-2.5 h-2.5 rounded-full ${e} animate-pulse ml-2 shrink-0`});e.s(["default",0,({onSave:e})=>{let{t:i,i18n:o}=(0,r.useTranslation)(),{theme:u,setTheme:h}=(0,n.useOcearoContext)(),p=l.default.getAll(),x=l.default.getComputedSignalKUrl(),m=l.default.getBoatsData(),[g,b]=(0,t.useState)(p),[f,j]=(0,t.useState)(p.useAuthentication||!!p.username||!!p.password),[N,v]=(0,t.useState)(p.signalKUrlSet||!1),[k,w]=(0,t.useState)(null),[y,C]=(0,t.useState)(!1),[B,U]=(0,t.useState)({visible:!1,message:""}),[S,T]=(0,t.useState)("system"),A=(0,t.useCallback)(e=>{C(JSON.stringify(e)!==JSON.stringify(p))},[p]);(0,t.useEffect)(()=>{(async()=>{let e=l.default.getAll();b(e),v(e.signalKUrlSet||!1),j(e.useAuthentication||!!e.username||!!e.password),e.selectedBoat&&w(m.find(s=>s.name===e.selectedBoat)||null)})()},[m]);let D=s=>{let t={...g,...s};b(t),A(t);let a={...t};s.theme&&s.theme!==u&&h(s.theme),s.hasOwnProperty("signalKUrlSet")?!1===s.signalKUrlSet&&(a.signalkUrl=x,a.username="",a.password="",a.useAuthentication=!1):N||s.hasOwnProperty("signalkUrl")||(a.signalkUrl=x,a.username="",a.password=""),s.hasOwnProperty("useAuthentication")&&(a.useAuthentication=s.useAuthentication,s.useAuthentication||(a.username="",a.password="")),l.default.saveConfig(a),e?.(a),C(!1),U({visible:!0,message:i("settings.savedAuto")}),setTimeout(()=>U({visible:!1,message:""}),2e3)};return(0,s.jsxs)("div",{className:"p-8 text-hud-main w-full relative",children:[(0,s.jsxs)("header",{className:"mb-10 flex justify-between items-start sm:items-center relative min-h-[4rem]",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h1",{className:"text-3xl font-black uppercase tracking-tighter mb-1",children:i("settings.title")}),(0,s.jsx)("p",{className:"text-hud-secondary text-sm font-medium uppercase tracking-widest",children:i("settings.subtitle")})]}),B.visible&&(0,s.jsx)(a.motion.span,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},className:"absolute right-0 top-0 sm:relative text-xs font-black bg-oGreen/20 text-oGreen border border-oGreen/30 px-4 py-2 rounded-full uppercase tracking-widest whitespace-nowrap",children:B.message})]}),(0,s.jsxs)("div",{className:"flex bg-hud-bg p-1 rounded-xl border border-hud mb-8",children:[(0,s.jsx)("button",{onClick:()=>T("system"),className:`flex-1 py-3 px-6 text-xs font-black uppercase tracking-widest transition-all rounded-lg ${"system"===S?"bg-oBlue text-hud-main shadow-lg shadow-oBlue/20":"text-hud-secondary hover:text-hud-main"}`,children:i("settings.tabSystem")}),(0,s.jsx)("button",{onClick:()=>T("interface"),className:`flex-1 py-3 px-6 text-xs font-black uppercase tracking-widest transition-all rounded-lg ${"interface"===S?"bg-oBlue text-hud-main shadow-lg shadow-oBlue/20":"text-hud-secondary hover:text-hud-main"}`,children:i("settings.tabInterface")})]}),(0,s.jsx)("div",{className:"space-y-8",children:"system"===S?(0,s.jsxs)("div",{className:"space-y-8 animate-in fade-in duration-500",children:[(0,s.jsxs)("section",{className:"tesla-card p-6 space-y-6",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,s.jsx)("h2",{className:"text-lg font-black uppercase tracking-widest text-hud-main/90",children:i("settings.connection")}),(0,s.jsx)("div",{className:"h-[1px] flex-grow bg-hud-border mx-4"})]}),(0,s.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between p-4 rounded-xl bg-hud-bg tesla-hover",children:[(0,s.jsxs)("span",{className:"text-sm font-bold uppercase tracking-widest text-hud-secondary flex items-center",children:[i("settings.signalkServer"),!N&&(0,s.jsx)(c,{color:"bg-oBlue"})]}),(0,s.jsxs)("label",{className:"relative inline-flex items-center cursor-pointer",children:[(0,s.jsx)("input",{type:"checkbox",className:"sr-only peer",checked:N,onChange:e=>{v(e.target.checked),D({signalKUrlSet:e.target.checked})}}),(0,s.jsx)("div",{className:"relative w-11 h-6 bg-hud-bg-elevated peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full rtl:peer-checked:after:-translate-x-full peer-checked:after:border-hud-main after:content-[''] after:absolute after:top-[2px] after:start-[2px] after:bg-hud-main after:border-hud-main after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-oBlue"})]})]}),!N&&(0,s.jsxs)("div",{className:"p-4 rounded-xl bg-hud-bg border border-hud",children:[(0,s.jsx)("span",{className:"text-xs font-bold uppercase tracking-widest text-hud-muted block mb-1",children:i("settings.detectedUrl")}),(0,s.jsx)("span",{className:"text-sm font-mono text-oBlue",children:x})]})]}),N&&(0,s.jsxs)(a.motion.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},className:"space-y-6",children:[(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("label",{className:"text-xs font-black uppercase tracking-widest text-hud-secondary ml-1",children:i("settings.customEndpoint")}),(0,s.jsx)("input",{type:"text",className:"w-full bg-hud-bg border border-hud rounded-xl p-4 text-hud-main focus:outline-none focus:border-oBlue/50 transition-colors font-mono",placeholder:"https://your-signalk-server.local",value:g.signalkUrl||"",onChange:e=>D({signalkUrl:e.target.value})})]}),(0,s.jsxs)("div",{className:"flex items-center justify-between p-4 rounded-xl bg-hud-bg tesla-hover",children:[(0,s.jsxs)("span",{className:"text-sm font-bold uppercase tracking-widest text-hud-secondary flex items-center",children:[i("settings.authentication"),N&&!f&&(0,s.jsx)(c,{color:"bg-oBlue"})]}),(0,s.jsxs)("label",{className:"relative inline-flex items-center cursor-pointer",children:[(0,s.jsx)("input",{type:"checkbox",className:"sr-only peer",checked:f,onChange:e=>{j(e.target.checked),D({useAuthentication:e.target.checked})}}),(0,s.jsx)("div",{className:"relative w-11 h-6 bg-hud-bg-elevated peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full rtl:peer-checked:after:-translate-x-full peer-checked:after:border-hud-main after:content-[''] after:absolute after:top-[2px] after:start-[2px] after:bg-hud-main after:border-hud-main after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-oBlue"})]})]}),f&&(0,s.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("label",{className:"text-xs font-black uppercase tracking-widest text-hud-secondary ml-1",children:i("settings.username")}),(0,s.jsx)("input",{type:"text",className:"w-full bg-hud-bg border border-hud rounded-xl p-4 text-hud-main focus:outline-none focus:border-oBlue/50 transition-colors",value:g.username||"",onChange:e=>D({username:e.target.value})})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("label",{className:"text-xs font-black uppercase tracking-widest text-hud-secondary ml-1",children:i("settings.password")}),(0,s.jsx)("input",{type:"password",className:"w-full bg-hud-bg border border-hud rounded-xl p-4 text-hud-main focus:outline-none focus:border-oBlue/50 transition-colors",value:g.password||"",onChange:e=>D({password:e.target.value})})]})]})]})]}),(0,s.jsxs)("section",{className:"tesla-card p-6 space-y-6",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,s.jsx)("h2",{className:"text-lg font-black uppercase tracking-widest text-hud-main/90",children:i("settings.vessel")}),(0,s.jsx)("div",{className:"h-[1px] flex-grow bg-hud-border mx-4"})]}),(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("label",{className:"text-xs font-black uppercase tracking-widest text-hud-secondary ml-1",children:i("settings.activeProfile")}),(0,s.jsxs)("select",{className:"w-full bg-hud-bg border border-hud rounded-xl p-4 text-hud-main focus:outline-none focus:border-oBlue/50 transition-colors appearance-none cursor-pointer",value:g.selectedBoat||"",onChange:e=>{let s=e.target.value;w(m.find(e=>e.name===s)||null),D({selectedBoat:s})},children:[(0,s.jsx)("option",{value:"",className:"bg-hud-bg",children:i("settings.selectVessel")}),m.map(e=>(0,s.jsx)("option",{value:e.name,className:"bg-hud-bg",children:e.name},e.name))]})]}),k&&(0,s.jsxs)("div",{className:"p-4 rounded-xl bg-oBlue/10 border border-oBlue/20 space-y-1",children:[(0,s.jsx)("div",{className:"text-xs font-black uppercase tracking-widest text-oBlue mb-2",children:i("settings.specifications")}),(0,s.jsxs)("div",{className:"text-sm font-medium",children:[i("settings.model"),": ",(0,s.jsx)("span",{className:"text-hud-main",children:k.modelPath})]}),(0,s.jsxs)("div",{className:"text-sm font-medium",children:[i("settings.capabilities"),": ",(0,s.jsx)("span",{className:"text-hud-main",children:k.capabilities?.join(", ")})]})]})]})]}),(0,s.jsxs)("section",{className:"tesla-card p-6 space-y-6",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,s.jsx)("h2",{className:"text-lg font-black uppercase tracking-widest text-hud-main/90",children:i("settings.advanced")}),(0,s.jsx)("div",{className:"h-[1px] flex-grow bg-hud-border mx-4"})]}),(0,s.jsx)("div",{className:"p-4 rounded-xl bg-hud-bg tesla-hover border border-hud",children:(0,s.jsxs)("label",{className:"flex items-center justify-between cursor-pointer",children:[(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsxs)("span",{className:"text-sm font-bold uppercase tracking-widest text-hud-secondary flex items-center",children:[i("settings.debugMode"),g.debugMode&&(0,s.jsx)(c,{color:"bg-yellow-400"})]}),(0,s.jsx)("p",{className:"text-xs text-hud-muted font-medium uppercase tracking-wider",children:i("settings.debugModeDesc")})]}),(0,s.jsx)("input",{type:"checkbox",className:"sr-only peer",checked:g.debugMode||!1,onChange:e=>{let s={debugMode:e.target.checked};!N&&e.target.checked&&(s.signalkUrl="https://demo.signalk.org:443"),D(s)}}),(0,s.jsx)("div",{className:"relative w-11 h-6 bg-hud-bg-elevated peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full rtl:peer-checked:after:-translate-x-full peer-checked:after:border-hud-main after:content-[''] after:absolute after:top-[2px] after:start-[2px] after:bg-hud-main after:border-hud-main after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-oBlue"})]})})]}),(0,s.jsxs)("section",{className:"tesla-card p-6 border-oRed/10",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-6",children:[(0,s.jsx)("h2",{className:"text-lg font-black uppercase tracking-widest text-oRed/80",children:i("settings.critical")}),(0,s.jsx)("div",{className:"h-[1px] flex-grow bg-oRed/5 mx-4"})]}),(0,s.jsxs)("div",{className:"flex items-center justify-between p-4 rounded-xl bg-oRed/5 border border-oRed/10",children:[(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsx)("span",{className:"text-sm font-bold uppercase tracking-widest text-oRed/80",children:i("settings.factoryReset")}),(0,s.jsx)("p",{className:"text-xs text-oRed/40 font-medium uppercase tracking-wider",children:i("settings.factoryResetDesc")})]}),(0,s.jsx)("button",{onClick:()=>{let e=l.default.getDefaultConfig();b(e),j(!1),e.useAuthentication=!1,v(!1),e.signalKUrlSet=!1,e.showCustomUrls=!1,e.customExternalUrls={},l.default.saveConfig(e),C(!1)},className:"bg-oRed/20 text-oRed border border-oRed/30 px-6 py-2 rounded-xl text-xs font-black uppercase tracking-widest hover:bg-oRed hover:text-hud-main transition-all duration-300 shadow-lg shadow-oRed/10",children:i("common.reset")})]})]})]}):(0,s.jsxs)("div",{className:"space-y-8 animate-in fade-in duration-500",children:[(0,s.jsxs)("section",{className:"tesla-card p-6 space-y-6",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,s.jsx)("h2",{className:"text-lg font-black uppercase tracking-widest text-hud-main/90",children:i("settings.appearance")}),(0,s.jsx)("div",{className:"h-[1px] flex-grow bg-hud-border mx-4"})]}),(0,s.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsx)("label",{className:"text-xs font-black uppercase tracking-widest text-hud-secondary ml-1",children:i("settings.themeMode")}),(0,s.jsx)("div",{className:"flex bg-hud-bg p-1 rounded-xl border border-hud",children:["dark","light"].map(e=>(0,s.jsx)("button",{onClick:()=>D({theme:e}),className:`flex-1 py-3 px-4 rounded-lg text-xs font-black uppercase tracking-widest transition-all ${g.theme===e?"bg-oBlue text-hud-main shadow-lg shadow-oBlue/20":"text-hud-secondary hover:text-hud-main"}`,children:e},e))})]}),(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsx)("label",{className:"text-xs font-black uppercase tracking-widest text-hud-secondary ml-1",children:i("settings.uiAccents")}),(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between p-4 rounded-xl bg-hud-bg tesla-hover self-end h-[60px]",children:[(0,s.jsx)("span",{className:"text-sm font-bold uppercase tracking-widest text-hud-secondary",children:i("settings.metallic")}),(0,s.jsxs)("label",{className:"relative inline-flex items-center cursor-pointer",children:[(0,s.jsx)("input",{type:"checkbox",className:"sr-only peer",checked:g.metallicEffect||!1,onChange:e=>D({metallicEffect:e.target.checked})}),(0,s.jsx)("div",{className:"relative w-11 h-6 bg-hud-bg-elevated peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full rtl:peer-checked:after:-translate-x-full peer-checked:after:border-hud-main after:content-[''] after:absolute after:top-[2px] after:start-[2px] after:bg-hud-main after:border-hud-main after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-oBlue"})]})]}),(0,s.jsxs)("div",{className:"p-2 rounded-xl bg-hud-bg border border-hud flex items-center space-x-4",children:[(0,s.jsx)("input",{type:"color",className:"w-12 h-10 bg-transparent cursor-pointer rounded overflow-hidden border-none",value:g.primaryColor||"#09bfff",onChange:e=>D({primaryColor:e.target.value})}),(0,s.jsx)("span",{className:"text-xs font-mono uppercase text-hud-main/60",children:g.primaryColor||"#09bfff"})]})]})]})]})]}),(0,s.jsxs)("section",{className:"tesla-card p-6 space-y-6",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,s.jsx)("h2",{className:"text-lg font-black uppercase tracking-widest text-hud-main/90",children:i("settings.language")}),(0,s.jsx)("div",{className:"h-[1px] flex-grow bg-hud-border mx-4"})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("label",{className:"text-xs font-black uppercase tracking-widest text-hud-secondary ml-1",children:i("settings.languageDesc")}),(0,s.jsx)("div",{className:"grid grid-cols-3 md:grid-cols-4 gap-1 bg-hud-bg p-1 rounded-xl border border-hud",children:d.SUPPORTED_LANGUAGES.map(e=>(0,s.jsxs)("button",{onClick:()=>{o.changeLanguage(e.code),D({language:e.code})},className:`py-3 px-2 rounded-lg text-xs font-black uppercase tracking-widest transition-all flex items-center justify-center space-x-2 ${(g.language||"en")===e.code?"bg-oBlue text-hud-main shadow-lg shadow-oBlue/20":"text-hud-secondary hover:text-hud-main"}`,children:[(0,s.jsx)("span",{children:e.flag}),(0,s.jsx)("span",{children:e.label})]},e.code))})]})]}),(0,s.jsxs)("section",{className:"tesla-card p-6 space-y-6",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,s.jsx)("h2",{className:"text-lg font-black uppercase tracking-widest text-hud-main/90",children:i("settings.navigationHud")}),(0,s.jsx)("div",{className:"h-[1px] flex-grow bg-hud-border mx-4"})]}),(0,s.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,s.jsx)("div",{className:"p-4 rounded-xl bg-hud-bg tesla-hover border border-hud",children:(0,s.jsxs)("label",{className:"flex items-center justify-between cursor-pointer",children:[(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsx)("span",{className:"text-sm font-bold uppercase tracking-widest text-hud-secondary",children:i("settings.compassOrientation")}),(0,s.jsx)("p",{className:"text-xs text-hud-muted font-medium uppercase tracking-wider",children:g.compassNorthUp?i("settings.northAtTop"):i("settings.northAtBottom")})]}),(0,s.jsx)("input",{type:"checkbox",className:"sr-only peer",checked:g.compassNorthUp||!1,onChange:e=>D({compassNorthUp:e.target.checked})}),(0,s.jsx)("div",{className:"relative w-11 h-6 bg-hud-bg-elevated peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full rtl:peer-checked:after:-translate-x-full peer-checked:after:border-hud-main after:content-[''] after:absolute after:top-[2px] after:start-[2px] after:bg-hud-main after:border-hud-main after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-oBlue"})]})}),(0,s.jsx)("div",{className:"p-4 rounded-xl bg-hud-bg tesla-hover border border-hud",children:(0,s.jsxs)("label",{className:"flex items-center justify-between cursor-pointer",children:[(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsx)("span",{className:"text-sm font-bold uppercase tracking-widest text-hud-secondary",children:i("settings.hide3DCompass")}),(0,s.jsx)("p",{className:"text-xs text-hud-muted font-medium uppercase tracking-wider",children:g.hide3DCompass?i("settings.hidden"):i("settings.visible")})]}),(0,s.jsx)("input",{type:"checkbox",className:"sr-only peer",checked:g.hide3DCompass||!1,onChange:e=>D({hide3DCompass:e.target.checked})}),(0,s.jsx)("div",{className:"relative w-11 h-6 bg-hud-bg-elevated peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full rtl:peer-checked:after:-translate-x-full peer-checked:after:border-hud-main after:content-[''] after:absolute after:top-[2px] after:start-[2px] after:bg-hud-main after:border-hud-main after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-oBlue"})]})}),(0,s.jsx)("div",{className:"p-4 rounded-xl bg-hud-bg tesla-hover border border-hud",children:(0,s.jsxs)("label",{className:"flex items-center justify-between cursor-pointer",children:[(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsx)("span",{className:"text-sm font-bold uppercase tracking-widest text-hud-secondary",children:i("settings.hideTrueWind")}),(0,s.jsx)("p",{className:"text-xs text-hud-muted font-medium uppercase tracking-wider",children:g.hideTrueWind?i("settings.hidden"):i("settings.visible")})]}),(0,s.jsx)("input",{type:"checkbox",className:"sr-only peer",checked:g.hideTrueWind||!1,onChange:e=>D({hideTrueWind:e.target.checked})}),(0,s.jsx)("div",{className:"relative w-11 h-6 bg-hud-bg-elevated peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full rtl:peer-checked:after:-translate-x-full peer-checked:after:border-hud-main after:content-[''] after:absolute after:top-[2px] after:start-[2px] after:bg-hud-main after:border-hud-main after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-oBlue"})]})}),(0,s.jsx)("div",{className:"p-4 rounded-xl bg-hud-bg tesla-hover border border-hud",children:(0,s.jsxs)("label",{className:"flex items-center justify-between cursor-pointer",children:[(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsx)("span",{className:"text-sm font-bold uppercase tracking-widest text-hud-secondary",children:i("settings.attitudeIndicator")}),(0,s.jsx)("p",{className:"text-xs text-hud-muted font-medium uppercase tracking-wider",children:!1!==g.showAttitudeIndicator?i("settings.visible"):i("settings.hidden")})]}),(0,s.jsx)("input",{type:"checkbox",className:"sr-only peer",checked:!1!==g.showAttitudeIndicator,onChange:e=>D({showAttitudeIndicator:e.target.checked})}),(0,s.jsx)("div",{className:"relative w-11 h-6 bg-hud-bg-elevated peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full rtl:peer-checked:after:-translate-x-full peer-checked:after:border-hud-main after:content-[''] after:absolute after:top-[2px] after:start-[2px] after:bg-hud-main after:border-hud-main after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-oBlue"})]})}),(0,s.jsx)("div",{className:"p-4 rounded-xl bg-hud-bg tesla-hover border border-hud",children:(0,s.jsxs)("label",{className:"flex items-center justify-between cursor-pointer",children:[(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsx)("span",{className:"text-sm font-bold uppercase tracking-widest text-hud-secondary",children:i("settings.sailTrimSliders")}),(0,s.jsx)("p",{className:"text-xs text-hud-muted font-medium uppercase tracking-wider",children:!1!==g.showSailTrimSliders?i("settings.visible"):i("settings.hidden")})]}),(0,s.jsx)("input",{type:"checkbox",className:"sr-only peer",checked:!1!==g.showSailTrimSliders,onChange:e=>D({showSailTrimSliders:e.target.checked})}),(0,s.jsx)("div",{className:"relative w-11 h-6 bg-hud-bg-elevated peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full rtl:peer-checked:after:-translate-x-full peer-checked:after:border-hud-main after:content-[''] after:absolute after:top-[2px] after:start-[2px] after:bg-hud-main after:border-hud-main after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-oBlue"})]})}),(0,s.jsx)("div",{className:"p-4 rounded-xl bg-hud-bg tesla-hover border border-hud",children:(0,s.jsxs)("label",{className:"flex items-center justify-between cursor-pointer",children:[(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsx)("span",{className:"text-sm font-bold uppercase tracking-widest text-hud-secondary",children:i("settings.rigging")}),(0,s.jsx)("p",{className:"text-xs text-hud-muted font-medium uppercase tracking-wider",children:!1!==g.showRigging?i("settings.visible"):i("settings.hidden")})]}),(0,s.jsx)("input",{type:"checkbox",className:"sr-only peer",checked:!1!==g.showRigging,onChange:e=>D({showRigging:e.target.checked})}),(0,s.jsx)("div",{className:"relative w-11 h-6 bg-hud-bg-elevated peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full rtl:peer-checked:after:-translate-x-full peer-checked:after:border-hud-main after:content-[''] after:absolute after:top-[2px] after:start-[2px] after:bg-hud-main after:border-hud-main after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-oBlue"})]})})]}),(0,s.jsxs)("div",{className:"space-y-4 pt-2",children:[(0,s.jsxs)("div",{className:"flex justify-between items-end",children:[(0,s.jsxs)("label",{className:"text-xs font-black uppercase tracking-widest text-hud-secondary ml-1",children:[i("settings.aisLengthScaling"),(0,s.jsx)("span",{className:"block text-xs text-hud-muted font-medium mt-1 uppercase",children:i("settings.mapTargetVisibility")})]}),(0,s.jsx)("span",{className:"text-xl font-black text-oBlue bg-oBlue/10 px-3 py-1 rounded-lg",children:g.aisLengthScalingFactor||.7})]}),(0,s.jsx)("input",{type:"range",className:"w-full h-1.5 bg-hud-bg-elevated rounded-lg appearance-none cursor-pointer accent-oBlue",min:"0.1",max:"2.0",step:"0.1",value:g.aisLengthScalingFactor||.7,onChange:e=>D({aisLengthScalingFactor:parseFloat(e.target.value)})})]})]}),(0,s.jsxs)("section",{className:"tesla-card p-6 space-y-6",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,s.jsx)("h2",{className:"text-lg font-black uppercase tracking-widest text-hud-main/90",children:i("settings.unitsValues")}),(0,s.jsx)("div",{className:"h-[1px] flex-grow bg-hud-border mx-4"})]}),(0,s.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("label",{className:"text-xs font-black uppercase tracking-widest text-hud-secondary ml-1",children:i("settings.distanceUnits")}),(0,s.jsxs)("select",{className:"w-full bg-hud-bg border border-hud rounded-xl p-4 text-hud-main focus:outline-none focus:border-oBlue/50 transition-colors appearance-none cursor-pointer",value:g.distanceUnits||"nm",onChange:e=>D({distanceUnits:e.target.value}),children:[(0,s.jsx)("option",{value:"nm",className:"bg-hud-bg",children:"Nautical Miles"}),(0,s.jsx)("option",{value:"km",className:"bg-hud-bg",children:"Kilometres"}),(0,s.jsx)("option",{value:"mi",className:"bg-hud-bg",children:"Miles"})]})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("label",{className:"text-xs font-black uppercase tracking-widest text-hud-secondary ml-1",children:i("settings.depthUnits")}),(0,s.jsxs)("select",{className:"w-full bg-hud-bg border border-hud rounded-xl p-4 text-hud-main focus:outline-none focus:border-oBlue/50 transition-colors appearance-none cursor-pointer",value:g.depthUnits||"m",onChange:e=>D({depthUnits:e.target.value}),children:[(0,s.jsx)("option",{value:"m",className:"bg-hud-bg",children:"metres"}),(0,s.jsx)("option",{value:"ft",className:"bg-hud-bg",children:"feet"}),(0,s.jsx)("option",{value:"fa",className:"bg-hud-bg",children:"fathoms"})]})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("label",{className:"text-xs font-black uppercase tracking-widest text-hud-secondary ml-1",children:i("settings.speedUnits")}),(0,s.jsxs)("select",{className:"w-full bg-hud-bg border border-hud rounded-xl p-4 text-hud-main focus:outline-none focus:border-oBlue/50 transition-colors appearance-none cursor-pointer",value:g.speedUnits||"kn",onChange:e=>D({speedUnits:e.target.value}),children:[(0,s.jsx)("option",{value:"kn",className:"bg-hud-bg",children:"knots"}),(0,s.jsx)("option",{value:"km/h",className:"bg-hud-bg",children:"km/h"}),(0,s.jsx)("option",{value:"mph",className:"bg-hud-bg",children:"mph"}),(0,s.jsx)("option",{value:"m/s",className:"bg-hud-bg",children:"m/s"})]})]})]}),(0,s.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("label",{className:"text-xs font-black uppercase tracking-widest text-hud-secondary ml-1",children:i("settings.temperatureUnits")}),(0,s.jsxs)("select",{className:"w-full bg-hud-bg border border-hud rounded-xl p-4 text-hud-main focus:outline-none focus:border-oBlue/50 transition-colors appearance-none cursor-pointer",value:g.temperatureUnits||"C",onChange:e=>D({temperatureUnits:e.target.value}),children:[(0,s.jsx)("option",{value:"C",className:"bg-hud-bg",children:"Celsius"}),(0,s.jsx)("option",{value:"F",className:"bg-hud-bg",children:"Fahrenheit"})]})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("label",{className:"text-xs font-black uppercase tracking-widest text-hud-secondary ml-1",children:i("settings.positionFormat")}),(0,s.jsxs)("select",{className:"w-full bg-hud-bg border border-hud rounded-xl p-4 text-hud-main focus:outline-none focus:border-oBlue/50 transition-colors appearance-none cursor-pointer",value:g.positionFormat||"DD",onChange:e=>D({positionFormat:e.target.value}),children:[(0,s.jsx)("option",{value:"DD",className:"bg-hud-bg",children:"-128.12345"}),(0,s.jsx)("option",{value:"DM",className:"bg-hud-bg",children:"-128° 07.407'"}),(0,s.jsx)("option",{value:"DMS",className:"bg-hud-bg",children:"-128° 07' 24.4\""})]})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("label",{className:"text-xs font-black uppercase tracking-widest text-hud-secondary ml-1",children:i("settings.preferTrueValues")}),(0,s.jsxs)("select",{className:"w-full bg-hud-bg border border-hud rounded-xl p-4 text-hud-main focus:outline-none focus:border-oBlue/50 transition-colors appearance-none cursor-pointer",value:!1!==g.preferTrueValues?"true":"false",onChange:e=>D({preferTrueValues:"true"===e.target.value}),children:[(0,s.jsx)("option",{value:"true",className:"bg-hud-bg",children:i("settings.preferTrue")}),(0,s.jsx)("option",{value:"false",className:"bg-hud-bg",children:i("settings.preferMagnetic")})]})]})]})]}),(0,s.jsxs)("section",{className:"tesla-card p-6 space-y-6",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,s.jsx)("h2",{className:"text-lg font-black uppercase tracking-widest text-hud-main/90",children:i("settings.preferredPaths")}),(0,s.jsx)("div",{className:"h-[1px] flex-grow bg-hud-border mx-4"})]}),(0,s.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("label",{className:"text-xs font-black uppercase tracking-widest text-hud-secondary ml-1",children:i("settings.trueWindSpeed")}),(0,s.jsx)("div",{className:"space-y-2 p-4 rounded-xl bg-hud-bg border border-hud",children:[{value:"speedTrue",label:i("settings.pathSpeedTrue")},{value:"speedApparent",label:i("settings.pathSpeedApparent")}].map(e=>(0,s.jsxs)("label",{className:"flex items-center space-x-3 cursor-pointer",children:[(0,s.jsx)("input",{type:"radio",name:"preferredWindSpeedPath",value:e.value,checked:(g.preferredWindSpeedPath||"speedTrue")===e.value,onChange:e=>D({preferredWindSpeedPath:e.target.value}),className:"w-4 h-4 accent-oBlue"}),(0,s.jsx)("span",{className:"text-sm text-hud-main",children:e.label})]},e.value))})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("label",{className:"text-xs font-black uppercase tracking-widest text-hud-secondary ml-1",children:i("settings.trueWindDirection")}),(0,s.jsx)("div",{className:"space-y-2 p-4 rounded-xl bg-hud-bg border border-hud",children:[{value:"directionTrue",label:i("settings.pathDirectionTrue")},{value:"angleApparent",label:i("settings.pathAngleApparent")},{value:"angleTrueWater",label:i("settings.pathAngleTrueWater")}].map(e=>(0,s.jsxs)("label",{className:"flex items-center space-x-3 cursor-pointer",children:[(0,s.jsx)("input",{type:"radio",name:"preferredWindDirectionPath",value:e.value,checked:(g.preferredWindDirectionPath||"directionTrue")===e.value,onChange:e=>D({preferredWindDirectionPath:e.target.value}),className:"w-4 h-4 accent-oBlue"}),(0,s.jsx)("span",{className:"text-sm text-hud-main",children:e.label})]},e.value))})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("label",{className:"text-xs font-black uppercase tracking-widest text-hud-secondary ml-1",children:i("settings.headingCog")}),(0,s.jsx)("div",{className:"space-y-2 p-4 rounded-xl bg-hud-bg border border-hud",children:[{value:"courseOverGroundTrue",label:i("settings.pathCourseOverGroundTrue")},{value:"headingTrue",label:i("settings.pathHeadingTrue")},{value:"courseOverGroundMagnetic",label:i("settings.pathCourseOverGroundMagnetic")},{value:"headingMagnetic",label:i("settings.pathHeadingMagnetic")}].map(e=>(0,s.jsxs)("label",{className:"flex items-center space-x-3 cursor-pointer",children:[(0,s.jsx)("input",{type:"radio",name:"preferredHeadingPath",value:e.value,checked:(g.preferredHeadingPath||"courseOverGroundTrue")===e.value,onChange:e=>D({preferredHeadingPath:e.target.value}),className:"w-4 h-4 accent-oBlue"}),(0,s.jsx)("span",{className:"text-sm text-hud-main",children:e.label})]},e.value))})]})]})]}),(0,s.jsxs)("section",{className:"tesla-card p-6 space-y-6",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,s.jsx)("h2",{className:"text-lg font-black uppercase tracking-widest text-hud-main/90",children:i("settings.externalLinks")}),(0,s.jsx)("div",{className:"h-[1px] flex-grow bg-hud-border mx-4"})]}),(0,s.jsx)("div",{className:"p-4 rounded-xl bg-hud-bg tesla-hover border border-hud",children:(0,s.jsxs)("label",{className:"flex items-center justify-between cursor-pointer",children:[(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsx)("span",{className:"text-sm font-bold uppercase tracking-widest text-hud-secondary",children:i("settings.customToolUrls")}),(0,s.jsx)("p",{className:"text-xs text-hud-muted font-medium uppercase tracking-wider",children:i("settings.customToolUrlsDesc")})]}),(0,s.jsx)("input",{type:"checkbox",className:"sr-only peer",checked:g.showCustomUrls||!1,onChange:e=>D({showCustomUrls:e.target.checked})}),(0,s.jsx)("div",{className:"relative w-11 h-6 bg-hud-bg-elevated peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full rtl:peer-checked:after:-translate-x-full peer-checked:after:border-hud-main after:content-[''] after:absolute after:top-[2px] after:start-[2px] after:bg-hud-main after:border-hud-main after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-oBlue"})]})}),g.showCustomUrls&&(0,s.jsx)(a.motion.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},className:"space-y-6 pt-4 border-t border-hud",children:(0,s.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[{id:"navigation",label:i("settings.urlNavigation"),placeholder:"${signalkUrl}/@signalk/freeboard-sk/"},{id:"instrument",label:i("settings.urlInstruments"),placeholder:"${signalkUrl}/@mxtommy/kip/"},{id:"dashboard",label:i("settings.urlMetrics"),placeholder:"${signalkUrl}/grafana"},{id:"webcam1",label:i("settings.urlWebcamAlpha"),placeholder:"https://example.com/stream1"},{id:"webcam2",label:i("settings.urlWebcamBeta"),placeholder:"https://example.com/stream2"},{id:"weather",label:i("settings.urlAtmospheric"),placeholder:"https://windy.com/..."}].map(e=>(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("label",{className:"text-xs font-black uppercase tracking-widest text-hud-secondary ml-1",children:e.label}),(0,s.jsx)("input",{type:"text",className:"w-full bg-hud-bg border border-hud rounded-xl p-4 text-sm text-hud-main focus:outline-none focus:border-oBlue/50 transition-colors font-mono",placeholder:e.placeholder,value:g.customExternalUrls?.[e.id]||"",onChange:s=>{let t={...g.customExternalUrls};t[e.id]=s.target.value,D({customExternalUrls:t})}})]},e.id))})})]})]})})]})}])},34900,e=>{e.n(e.i(87628))}]);