Files
pyMC_Repeater/repeater/web/html/assets/Setup-BpP4xAuC.js
T
2026-05-19 14:45:26 +01:00

1 line
34 KiB
JavaScript

import{B as e,Ct as t,E as n,St as r,V as i,Y as a,c as o,f as s,g as c,j as l,k as u,l as d,m as f,nt as p,o as m,p as h,r as g,s as _,u as v,x as y,xt as b,y as x}from"./runtime-core.esm-bundler-C5QBTNWE.js";import{o as S,s as C,t as w,u as T}from"./runtime-dom.esm-bundler-fKU3dih-.js";import{v as E}from"./api-2atwkqmS.js";import{t as D}from"./_plugin-vue_export-helper-TcpyXLsZ.js";import{t as O}from"./Spinner-CYvUNW0P.js";import{n as k,r as A}from"./index-BSfX6DVt.js";var j=e=>e===``,M=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),N=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),P=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),F=e=>{let t=P(e);return t.charAt(0).toUpperCase()+t.slice(1)},I={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`},L=Symbol(`lucide-icons`);function R(){return y(L,{})}var z=({name:e,iconNode:t,absoluteStrokeWidth:n,"absolute-stroke-width":r,strokeWidth:i,"stroke-width":a,size:o,color:s,...c},{slots:l})=>{let{size:u,color:d,strokeWidth:f=2,absoluteStrokeWidth:p=!1,class:h=``}=R(),g=m(()=>{let e=j(n)||j(r)||n===!0||r===!0||p===!0,t=i||a||f||I[`stroke-width`];return e?Number(t)*24/Number(o??u??I.width):t});return x(`svg`,{...I,...c,width:o??u??I.width,height:o??u??I.height,stroke:s??d??I.stroke,"stroke-width":g.value,class:M(`lucide`,h,...e?[`lucide-${N(F(e))}-icon`,`lucide-${N(e)}`]:[`lucide-icon`])},[...t.map(e=>x(...e)),...l.default?[l.default()]:[]])},B=(e,t)=>(n,{slots:r,attrs:i})=>x(z,{...i,...n,iconNode:t,name:e},r.default?{default:r.default}:void 0),ee=B(`cpu`,[[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M17 20v2`,key:`1rnc9c`}],[`path`,{d:`M17 2v2`,key:`11trls`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M2 17h2`,key:`7oei6x`}],[`path`,{d:`M2 7h2`,key:`asdhe0`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`M20 17h2`,key:`1fpfkl`}],[`path`,{d:`M20 7h2`,key:`1o8tra`}],[`path`,{d:`M7 20v2`,key:`4gnj0m`}],[`path`,{d:`M7 2v2`,key:`1i4yhu`}],[`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`,key:`1vbyd7`}],[`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`1`,key:`z9xiuo`}]]),te=B(`usb`,[[`circle`,{cx:`10`,cy:`7`,r:`1`,key:`dypaad`}],[`circle`,{cx:`4`,cy:`20`,r:`1`,key:`22iqad`}],[`path`,{d:`M4.7 19.3 19 5`,key:`1enqfc`}],[`path`,{d:`m21 3-3 1 2 2Z`,key:`d3ov82`}],[`path`,{d:`M9.26 7.68 5 12l2 5`,key:`1esawj`}],[`path`,{d:`m10 14 5 2 3.5-3.5`,key:`v8oal5`}],[`path`,{d:`m18 12 1-1 1 1-1 1Z`,key:`1bh22v`}]]),ne=B(`wifi`,[[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M2 8.82a15 15 0 0 1 20 0`,key:`dnpr2z`}],[`path`,{d:`M5 12.859a10 10 0 0 1 14 0`,key:`1x1e6c`}],[`path`,{d:`M8.5 16.429a5 5 0 0 1 7 0`,key:`1bycff`}]]),V=E(`setup`,()=>{let e=a(1),t=a(6),n=a(`pyRpt${Math.floor(Math.random()*1e4).toString().padStart(4,`0`)}`),r=a(null),i=a(null),o=a(null),s=a(``),c=a(``),l=a(`/dev/ttyACM0`),u=a(``),d=a(5055),f=a(``),p=a(!1),h=a({frequency:`915.0`,spreading_factor:`7`,bandwidth:`125`,coding_rate:`5`}),g=a([]),_=a([]),v=a(!1),y=a(!1),b=a(null),x=m(()=>{switch(e.value){case 1:return!0;case 2:return n.value.trim().length>0;case 3:return i.value!==null;case 4:{if(!r.value)return!1;let e=r.value.key.toLowerCase();return e===`kiss`||e===`pymc_usb`?l.value.trim().length>0:e===`pymc_tcp`?u.value.trim().length>0:!0}case 5:return p.value?h.value.frequency&&h.value.spreading_factor&&h.value.bandwidth&&h.value.coding_rate:o.value!==null;case 6:return s.value.length>=6&&s.value===c.value;default:return!1}}),S=m(()=>e.value>1),C=m(()=>e.value===t.value);async function w(){v.value=!0,b.value=null;try{let e=await(await fetch(`/api/hardware_options`)).json();if(e.error)throw Error(e.error);g.value=e.hardware||[]}catch(e){b.value=e instanceof Error?e.message:`Failed to load hardware options`,console.error(`Error fetching hardware options:`,e)}finally{v.value=!1}}let T=e=>({title:String(e.title??``),description:String(e.description??``),frequency:String(e.frequency??``),spreading_factor:String(e.spreading_factor??``),bandwidth:String(e.bandwidth??``),coding_rate:String(e.coding_rate??``)});async function E(){v.value=!0,b.value=null;try{try{let e=new AbortController,t=setTimeout(()=>e.abort(),4e3);try{let t=await fetch(`https://api.meshcore.nz/api/v1/config`,{signal:e.signal});if(t.ok){let e=(await t.json())?.config?.suggested_radio_settings?.entries??[];if(e.length>0){_.value=e.map(e=>T(e));return}}}finally{clearTimeout(t)}}catch{}let e=await(await fetch(`/api/radio_presets`)).json();if(e.error)throw Error(e.error);_.value=(e.presets??[]).map(e=>T(e))}catch(e){b.value=e instanceof Error?e.message:`Failed to load radio presets`,console.error(`Error fetching radio presets:`,e)}finally{v.value=!1}}async function D(){if(!x.value)return{success:!1,error:`Please complete all required fields`};y.value=!0,b.value=null;try{let e=p.value?{title:`Custom Configuration`,description:`Custom radio settings`,frequency:h.value.frequency,spreading_factor:h.value.spreading_factor,bandwidth:h.value.bandwidth,coding_rate:h.value.coding_rate}:o.value,t=await(await fetch(`/api/setup_wizard`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({node_name:n.value.trim(),hardware_key:r.value?.key,radio_preset:e,admin_password:s.value,...r.value&&(()=>{let e=r.value.key.toLowerCase();return e===`kiss`?{kiss_port:l.value.trim()||`/dev/ttyUSB0`,kiss_baud_rate:115200}:e===`pymc_usb`?{pymc_usb_port:l.value.trim()||`/dev/ttyACM0`,pymc_usb_baudrate:921600}:e===`pymc_tcp`?{pymc_tcp_host:u.value.trim(),pymc_tcp_port:d.value,pymc_tcp_token:f.value.trim()}:{}})()})})).json();if(!t.success)throw Error(t.error||`Setup failed`);return{success:!0,data:t}}catch(e){let t=e instanceof Error?e.message:`Failed to complete setup`;return b.value=t,{success:!1,error:t}}finally{y.value=!1}}function O(){x.value&&e.value<t.value&&e.value++}function k(){S.value&&e.value--}function A(n){n>=1&&n<=t.value&&(e.value=n)}function j(){e.value=1,n.value=`pyRpt${Math.floor(Math.random()*1e4).toString().padStart(4,`0`)}`,r.value=null,i.value=null,o.value=null,p.value=!1,h.value={frequency:`915.0`,spreading_factor:`7`,bandwidth:`125`,coding_rate:`5`},s.value=``,c.value=``,l.value=`/dev/ttyACM0`,u.value=``,d.value=5055,f.value=``,b.value=null}return{currentStep:e,totalSteps:t,nodeName:n,selectedHardware:r,selectedHardwareConnection:i,selectedRadioPreset:o,useCustomRadio:p,usbPort:l,tcpHost:u,tcpPort:d,tcpToken:f,customRadio:h,adminPassword:s,confirmPassword:c,hardwareOptions:g,radioPresets:_,isLoading:v,isSubmitting:y,error:b,canGoNext:x,canGoBack:S,isLastStep:C,fetchHardwareOptions:w,fetchRadioPresets:E,completeSetup:D,nextStep:O,previousStep:k,goToStep:A,reset:j}}),H={class:`min-h-screen bg-background dark:bg-background overflow-hidden relative flex items-center justify-center p-4`},U={class:`absolute top-4 right-4 z-20`},W={class:`w-full max-w-4xl relative z-10`},G={class:`mb-8`},K={class:`flex justify-between mb-2`},q={class:`text-content-secondary dark:text-content-muted text-sm`},J={class:`text-content-secondary dark:text-content-muted text-sm`},Y={class:`h-2 bg-stroke-subtle dark:bg-stroke/10 rounded-full overflow-hidden`},X={class:`bg-white dark:bg-surface-elevated backdrop-blur-xl border border-stroke-subtle dark:border-white/10 rounded-[20px] p-6 sm:p-8 md:p-12`},Z={class:`flex justify-center mb-8`},re={class:`flex gap-2`},ie={class:`mb-8`},ae={class:`text-2xl sm:text-3xl font-bold text-content-primary dark:text-content-primary mb-2 text-center`},oe={key:0,class:`space-y-6 mt-8`},se={key:1,class:`space-y-6 mt-8`},ce={class:`max-w-md mx-auto`},le={key:2,class:`space-y-6 mt-8`},ue={class:`grid grid-cols-1 md:grid-cols-3 gap-4 max-w-5xl mx-auto`},de=[`onClick`],fe={class:`font-semibold text-lg text-content-primary dark:text-content-primary mb-2`},pe={class:`text-sm text-content-secondary dark:text-content-muted`},me={key:3,class:`mt-8`},he={key:0,class:`text-center text-content-secondary dark:text-content-muted`},ge={key:1,class:`text-center text-content-secondary dark:text-content-muted`},_e={key:2,class:`text-center text-content-secondary dark:text-content-muted`},ve={key:3,class:`max-w-3xl mx-auto space-y-8`},ye={class:`flex items-center gap-3 mb-4`},be={key:0,class:`w-4 h-4`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},xe={key:1},Se={class:`grid grid-cols-1 md:grid-cols-2 gap-3 pl-10`},Ce=[`onClick`],we={class:`flex items-start justify-between gap-2`},Te={class:`font-medium text-content-primary dark:text-content-primary mb-1`},Ee={class:`text-sm text-content-secondary dark:text-content-muted`},De={key:0,class:`text-primary flex-shrink-0 mt-0.5`},Oe={key:0},ke={key:0,class:`pl-10`},Ae={class:`bg-background-mute dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-[12px] p-5 space-y-4`},je={key:1,class:`pl-10`},Me={class:`bg-background-mute dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-[12px] p-5 space-y-4`},Ne={class:`grid grid-cols-2 gap-4`},Pe={key:4,class:`space-y-6 mt-8`},Fe={key:0,class:`text-center text-content-secondary dark:text-content-muted`},Ie={key:1,class:`text-center text-content-secondary dark:text-content-muted`},Le={key:2,class:`max-w-5xl mx-auto`},Re={class:`grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4 mb-4`},ze=[`onClick`],Be={class:`relative z-10`},Ve={class:`font-medium text-content-primary dark:text-content-primary mb-1 flex items-start justify-between gap-2`},He={class:`flex items-center gap-2`},Ue={class:`text-2xl`},We={key:0,class:`text-primary flex-shrink-0`},Ge={class:`text-xs text-content-secondary dark:text-content-muted mb-3`},Ke={class:`grid grid-cols-2 gap-2 text-xs`},qe={class:`bg-gray-50 dark:bg-white/5 rounded px-2 py-1`},Je={class:`text-content-primary dark:text-content-primary/80 font-medium`},Ye={class:`bg-gray-50 dark:bg-white/5 rounded px-2 py-1`},Xe={class:`text-content-primary dark:text-content-primary/80 font-medium`},Ze={class:`bg-gray-50 dark:bg-white/5 rounded px-2 py-1`},Qe={class:`text-content-primary dark:text-content-primary/80 font-medium`},$e={class:`bg-gray-50 dark:bg-white/5 rounded px-2 py-1`},et={class:`text-content-primary dark:text-content-primary/80 font-medium`},tt={class:`border-t border-stroke-subtle dark:border-stroke/10 pt-6`},nt={class:`flex items-center justify-between mb-2`},Q={key:0,class:`text-primary`},rt={key:0,class:`mt-4 grid grid-cols-2 gap-4`},it={key:5,class:`space-y-6 mt-8`},at={class:`max-w-md mx-auto space-y-4`},ot={key:0,class:`text-red-600 dark:text-red-400 text-sm`},st={key:0,class:`mb-6 bg-red-500/10 border border-red-500/30 rounded-lg p-4 text-red-600 dark:text-red-200`},ct={class:`flex justify-between gap-4`},lt={key:1},ut=[`disabled`],dt={key:1},ft={key:2},pt={key:3},mt={key:4,class:`w-4 h-4`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},ht={class:`text-2xl font-bold text-content-primary dark:text-content-primary text-center mb-4`},gt={class:`text-content-secondary dark:text-content-primary/70 text-center mb-6`},$=D(c({name:`SetupView`,__name:`Setup`,setup(c){let y=V(),x=a(!1),E=a(``),D=a(``),j=a(`error`),M=a(!1),N=e=>{let t=e.toLowerCase();return t.includes(`australia`)?`🇦🇺`:t.includes(`eu`)||t.includes(`uk`)?`🇪🇺`:t.includes(`czech`)?`🇨🇿`:t.includes(`new zealand`)?`🇳🇿`:t.includes(`portugal`)?`🇵🇹`:t.includes(`switzerland`)?`🇨🇭`:t.includes(`usa`)||t.includes(`canada`)?`🇺🇸`:t.includes(`vietnam`)?`🇻🇳`:`🌍`};n(async()=>{await Promise.all([y.fetchHardwareOptions(),y.fetchRadioPresets()])});let P=m(()=>y.currentStep/y.totalSteps*100),F=[{key:`gpio`,title:`HAT GPIO Based Device`,description:`Direct SPI/GPIO connected HATs and board-integrated radios.`},{key:`usb`,title:`USB Connection`,description:`USB-attached modems including CH341 and pyMC USB modem.`},{key:`network`,title:`Network Wi-Fi Based`,description:`Remote modem reached over LAN/Wi-Fi using pyMC TCP.`}];function I(e){let t=e.key.toLowerCase();if(t===`kiss`)return`usb`;let n=String(e.config?.connection_type||``).toLowerCase();return n===`usb`||n===`network`||n===`gpio`?n:t.includes(`ch341`)||t===`pymc_usb`?`usb`:t===`pymc_tcp`?`network`:`gpio`}let L=m(()=>{let e=y.selectedHardwareConnection;return e?y.hardwareOptions.filter(t=>I(t)===e):[]});function R(e){y.selectedHardwareConnection=e,y.selectedHardware&&!L.value.some(e=>e.key===y.selectedHardware?.key)&&(y.selectedHardware=null)}async function z(){if(y.isLastStep){let e=await y.completeSetup();e.success?M.value=!0:(j.value=`error`,E.value=`Setup Failed`,D.value=e.error||`An unknown error occurred`,x.value=!0)}else y.nextStep()}function B(){y.previousStep()}function $(){x.value=!1}let _t=[`Welcome`,`Repeater Name`,`Connection Type`,`Hardware & Connection`,`Radio Configuration`,`Security Setup`];return(n,a)=>(u(),v(`div`,H,[_(`div`,U,[f(A)]),a[52]||=_(`div`,{class:`bg-gradient-light dark:bg-gradient-dark absolute rounded-full -rotate-[24.22deg] w-[705px] h-[512px] blur-[120px] opacity-80 animate-pulse-slow -top-[79px] left-[575px] mix-blend-multiply dark:mix-blend-screen pointer-events-none`},null,-1),a[53]||=_(`div`,{class:`bg-gradient-light dark:bg-gradient-dark absolute rounded-full -rotate-[24.22deg] w-[705px] h-[512px] blur-[120px] opacity-75 animate-pulse-slower -top-[94px] -left-[92px] mix-blend-multiply dark:mix-blend-screen pointer-events-none`},null,-1),a[54]||=_(`div`,{class:`bg-gradient-light dark:bg-gradient-dark absolute rounded-full -rotate-[24.22deg] w-[705px] h-[512px] blur-[120px] opacity-80 animate-pulse-slowest top-[373px] left-[246px] mix-blend-multiply dark:mix-blend-screen pointer-events-none`},null,-1),_(`div`,W,[_(`div`,G,[_(`div`,K,[_(`span`,q,`Step `+t(p(y).currentStep)+` of `+t(p(y).totalSteps),1),_(`span`,J,t(Math.round(P.value))+`% Complete`,1)]),_(`div`,Y,[_(`div`,{class:`h-full bg-gradient-to-r from-primary to-primary/80 transition-all duration-500`,style:r({width:`${P.value}%`})},null,4)])]),_(`div`,X,[_(`div`,Z,[_(`div`,re,[(u(!0),v(g,null,l(p(y).totalSteps,e=>(u(),v(`div`,{key:e,class:b([`w-10 h-10 rounded-full flex items-center justify-center text-sm font-medium transition-all`,e===p(y).currentStep?`bg-primary text-white`:e<p(y).currentStep?`bg-primary/30 text-content-secondary dark:text-content-primary/70`:`bg-background-mute dark:bg-stroke/10 text-content-muted dark:text-content-muted`])},t(e),3))),128))])]),_(`div`,ie,[_(`h2`,ae,t(_t[p(y).currentStep-1]),1),p(y).currentStep===1?(u(),v(`div`,oe,[...a[14]||=[s(`<div class="text-center space-y-4" data-v-db86ec4d><div class="w-20 h-20 mx-auto bg-primary/20 rounded-full flex items-center justify-center mb-6" data-v-db86ec4d><svg class="w-10 h-10 text-primary" fill="none" stroke="currentColor" viewBox="0 0 24 24" data-v-db86ec4d><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 10V3L4 14h7v7l9-11h-7z" data-v-db86ec4d></path></svg></div><p class="text-content-secondary dark:text-content-primary/70 text-lg" data-v-db86ec4d> Welcome to your pyMC Repeater! Let&#39;s get you set up in just a few steps. </p><div class="bg-primary/10 border border-primary/30 rounded-lg p-4 text-left" data-v-db86ec4d><p class="text-primary text-sm font-medium mb-2" data-v-db86ec4d>You&#39;ll configure:</p><ul class="space-y-2 text-content-secondary dark:text-content-primary/70 text-sm" data-v-db86ec4d><li class="flex items-center gap-2" data-v-db86ec4d><svg class="w-4 h-4 text-primary" fill="none" stroke="currentColor" viewBox="0 0 24 24" data-v-db86ec4d><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7" data-v-db86ec4d></path></svg> Repeater name and identification </li><li class="flex items-center gap-2" data-v-db86ec4d><svg class="w-4 h-4 text-primary" fill="none" stroke="currentColor" viewBox="0 0 24 24" data-v-db86ec4d><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7" data-v-db86ec4d></path></svg> Hardware board selection </li><li class="flex items-center gap-2" data-v-db86ec4d><svg class="w-4 h-4 text-primary" fill="none" stroke="currentColor" viewBox="0 0 24 24" data-v-db86ec4d><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7" data-v-db86ec4d></path></svg> Radio frequency and settings </li><li class="flex items-center gap-2" data-v-db86ec4d><svg class="w-4 h-4 text-primary" fill="none" stroke="currentColor" viewBox="0 0 24 24" data-v-db86ec4d><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7" data-v-db86ec4d></path></svg> Admin password for secure access </li></ul></div></div>`,1)]])):p(y).currentStep===2?(u(),v(`div`,se,[a[17]||=_(`p`,{class:`text-content-secondary dark:text-content-primary/70 text-center mb-6`},` Choose a unique name for your repeater. This will be used for identification on the mesh network. `,-1),_(`div`,ce,[a[15]||=_(`label`,{class:`block text-content-primary dark:text-content-primary/90 text-sm font-medium mb-2`},`Repeater Name`,-1),i(_(`input`,{"onUpdate:modelValue":a[0]||=e=>p(y).nodeName=e,type:`text`,class:`w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-3 text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent`,placeholder:`e.g., pyRpt0001`,maxlength:`32`},null,512),[[C,p(y).nodeName]]),a[16]||=_(`p`,{class:`text-content-secondary dark:text-content-muted text-xs mt-2`},` Use letters, numbers, hyphens, or underscores (3-32 characters) `,-1)])])):p(y).currentStep===3?(u(),v(`div`,le,[a[18]||=_(`p`,{class:`text-content-secondary dark:text-content-primary/70 text-center mb-6`},` Choose how your radio hardware connects to this repeater. `,-1),_(`div`,ue,[(u(),v(g,null,l(F,e=>_(`button`,{key:e.key,onClick:t=>R(e.key),class:b([`p-6 rounded-[16px] border transition-all duration-300 text-left backdrop-blur-sm min-h-[220px] flex flex-col`,p(y).selectedHardwareConnection===e.key?`bg-gradient-to-r from-primary/20 to-primary/10 border-primary/50 shadow-lg shadow-primary/20`:`bg-background-mute dark:bg-white/5 border-stroke-subtle dark:border-stroke/10 hover:bg-stroke-subtle dark:hover:bg-white/10 hover:border-stroke dark:hover:border-stroke/20`])},[_(`div`,{class:b([`mb-5 w-16 h-16 rounded-2xl flex items-center justify-center border transition-all duration-300`,p(y).selectedHardwareConnection===e.key?`bg-primary/20 border-primary/40 shadow-md shadow-primary/20`:`bg-white/60 dark:bg-white/10 border-stroke-subtle dark:border-stroke/20`])},[e.key===`gpio`?(u(),o(p(ee),{key:0,class:`w-9 h-9 text-primary`,"stroke-width":1.8})):e.key===`usb`?(u(),o(p(te),{key:1,class:`w-9 h-9 text-primary`,"stroke-width":1.8})):(u(),o(p(ne),{key:2,class:`w-9 h-9 text-primary`,"stroke-width":1.8}))],2),_(`div`,fe,t(e.title),1),_(`div`,pe,t(e.description),1)],10,de)),64))])])):p(y).currentStep===4?(u(),v(`div`,me,[p(y).isLoading?(u(),v(`div`,he,` Loading hardware options... `)):p(y).selectedHardwareConnection?L.value.length===0?(u(),v(`div`,_e,` No hardware options available for this connection type `)):(u(),v(`div`,ve,[_(`div`,null,[_(`div`,ye,[_(`div`,{class:b([`w-7 h-7 rounded-full flex items-center justify-center text-sm font-semibold flex-shrink-0 transition-all`,(p(y).selectedHardware,`bg-primary text-white`)])},[p(y).selectedHardware?(u(),v(`svg`,be,[...a[19]||=[_(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2.5`,d:`M5 13l4 4L19 7`},null,-1)]])):(u(),v(`span`,xe,`1`))],2),a[20]||=_(`h3`,{class:`font-semibold text-content-primary dark:text-content-primary`},`Select your hardware board`,-1)]),_(`div`,Se,[(u(!0),v(g,null,l(L.value,e=>(u(),v(`button`,{key:e.key,onClick:t=>p(y).selectedHardware=e,class:b([`p-4 rounded-[12px] border transition-all duration-300 text-left backdrop-blur-sm`,p(y).selectedHardware?.key===e.key?`bg-gradient-to-r from-primary/20 to-primary/10 border-primary/50 shadow-lg shadow-primary/20`:`bg-background-mute dark:bg-white/5 border-stroke-subtle dark:border-stroke/10 hover:bg-stroke-subtle dark:hover:bg-white/10 hover:border-stroke dark:hover:border-stroke/20`])},[_(`div`,we,[_(`div`,null,[_(`div`,Te,t(e.name),1),_(`div`,Ee,t(e.description||e.key),1)]),p(y).selectedHardware?.key===e.key?(u(),v(`div`,De,[...a[21]||=[_(`svg`,{class:`w-5 h-5`,fill:`currentColor`,viewBox:`0 0 20 20`},[_(`path`,{"fill-rule":`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z`,"clip-rule":`evenodd`})],-1)]])):d(``,!0)])],10,Ce))),128))])]),f(w,{name:`slide`},{default:e(()=>[p(y).selectedHardware&&(p(y).selectedHardware.key.toLowerCase()===`kiss`||p(y).selectedHardware.key.toLowerCase()===`pymc_usb`||p(y).selectedHardware.key.toLowerCase()===`pymc_tcp`)?(u(),v(`div`,Oe,[a[30]||=_(`div`,{class:`flex items-center gap-3 mb-4`},[_(`div`,{class:`w-7 h-7 rounded-full bg-primary text-white flex items-center justify-center text-sm font-semibold flex-shrink-0`},` 2 `),_(`h3`,{class:`font-semibold text-content-primary dark:text-content-primary`},` Configure the connection to your modem `)],-1),p(y).selectedHardware.key.toLowerCase()===`kiss`||p(y).selectedHardware.key.toLowerCase()===`pymc_usb`?(u(),v(`div`,ke,[_(`div`,Ae,[_(`div`,null,[a[22]||=_(`label`,{class:`block text-content-primary dark:text-content-primary/90 text-sm font-medium mb-1.5`},` Serial Port `,-1),i(_(`input`,{"onUpdate:modelValue":a[1]||=e=>p(y).usbPort=e,type:`text`,class:`w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-3 text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:ring-2 focus:ring-primary/50 focus:border-transparent transition-all font-mono`,placeholder:`/dev/ttyACM0`},null,512),[[C,p(y).usbPort]]),a[23]||=_(`p`,{class:`text-content-muted dark:text-content-muted text-xs mt-2`},[h(` The USB-CDC device path for your modem. If you have the pyMC udev rule installed it may appear as `),_(`span`,{class:`font-mono`},`/dev/lora-modem`),h(`. `)],-1)])])])):p(y).selectedHardware.key.toLowerCase()===`pymc_tcp`?(u(),v(`div`,je,[_(`div`,Me,[_(`div`,null,[a[24]||=_(`label`,{class:`block text-content-primary dark:text-content-primary/90 text-sm font-medium mb-1.5`},[h(` Modem Hostname or IP Address `),_(`span`,{class:`text-red-500`},`*`)],-1),i(_(`input`,{"onUpdate:modelValue":a[2]||=e=>p(y).tcpHost=e,type:`text`,class:`w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-3 text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:ring-2 focus:ring-primary/50 focus:border-transparent transition-all font-mono`,placeholder:`pymc-3e2834.local`},null,512),[[C,p(y).tcpHost]]),a[25]||=_(`p`,{class:`text-content-muted dark:text-content-muted text-xs mt-2`},` mDNS hostname, LAN IP, or domain name of the pyMC Wi-Fi modem. `,-1)]),_(`div`,Ne,[_(`div`,null,[a[26]||=_(`label`,{class:`block text-content-primary dark:text-content-primary/90 text-sm font-medium mb-1.5`},` Port `,-1),i(_(`input`,{"onUpdate:modelValue":a[3]||=e=>p(y).tcpPort=e,type:`number`,min:`1`,max:`65535`,class:`w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-3 text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:ring-2 focus:ring-primary/50 focus:border-transparent transition-all`,placeholder:`5055`},null,512),[[C,p(y).tcpPort,void 0,{number:!0}]]),a[27]||=_(`p`,{class:`text-content-muted dark:text-content-muted text-xs mt-2`},`Default is 5055.`,-1)]),_(`div`,null,[a[28]||=_(`label`,{class:`block text-content-primary dark:text-content-primary/90 text-sm font-medium mb-1.5`},[h(` Auth Token `),_(`span`,{class:`font-normal text-content-muted ml-1`},`(optional)`)],-1),i(_(`input`,{"onUpdate:modelValue":a[4]||=e=>p(y).tcpToken=e,type:`password`,class:`w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-3 text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:ring-2 focus:ring-primary/50 focus:border-transparent transition-all`,placeholder:`Leave blank if none`},null,512),[[C,p(y).tcpToken]]),a[29]||=_(`p`,{class:`text-content-muted dark:text-content-muted text-xs mt-2`},`Must match the token set in the modem firmware.`,-1)])])])])):d(``,!0)])):d(``,!0)]),_:1})])):(u(),v(`div`,ge,` Choose a connection type first `))])):p(y).currentStep===5?(u(),v(`div`,Pe,[a[45]||=_(`p`,{class:`text-content-secondary dark:text-content-primary/70 text-center mb-6`},` Choose a radio configuration preset for your region or create a custom configuration `,-1),p(y).isLoading?(u(),v(`div`,Fe,` Loading radio presets... `)):p(y).radioPresets.length===0?(u(),v(`div`,Ie,` No radio presets available `)):(u(),v(`div`,Le,[_(`div`,Re,[(u(!0),v(g,null,l(p(y).radioPresets,e=>(u(),v(`button`,{key:e.title,onClick:t=>{p(y).selectedRadioPreset=e,p(y).useCustomRadio=!1},class:b([`p-4 rounded-[12px] border transition-all duration-300 text-left backdrop-blur-sm relative overflow-hidden`,!p(y).useCustomRadio&&p(y).selectedRadioPreset?.title===e.title?`bg-gradient-to-r from-primary/20 to-primary/10 border-primary/50 shadow-lg shadow-primary/20`:`bg-background-mute dark:bg-white/5 border-stroke-subtle dark:border-stroke/10 hover:bg-stroke-subtle dark:hover:bg-white/10 hover:border-stroke dark:hover:border-stroke/20`])},[_(`div`,Be,[_(`div`,Ve,[_(`span`,He,[_(`span`,Ue,t(N(e.title)),1),_(`span`,null,t(e.title),1)]),!p(y).useCustomRadio&&p(y).selectedRadioPreset?.title===e.title?(u(),v(`div`,We,[...a[31]||=[_(`svg`,{class:`w-5 h-5`,fill:`currentColor`,viewBox:`0 0 20 20`},[_(`path`,{"fill-rule":`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z`,"clip-rule":`evenodd`})],-1)]])):d(``,!0)]),_(`div`,Ge,t(e.description),1),_(`div`,Ke,[_(`div`,qe,[a[32]||=_(`div`,{class:`text-content-muted dark:text-content-muted`},`Freq`,-1),_(`div`,Je,t(e.frequency),1)]),_(`div`,Ye,[a[33]||=_(`div`,{class:`text-content-muted dark:text-content-muted`},`BW`,-1),_(`div`,Xe,t(e.bandwidth),1)]),_(`div`,Ze,[a[34]||=_(`div`,{class:`text-content-muted dark:text-content-muted`},`SF`,-1),_(`div`,Qe,t(e.spreading_factor),1)]),_(`div`,$e,[a[35]||=_(`div`,{class:`text-content-muted dark:text-content-muted`},`CR`,-1),_(`div`,et,t(e.coding_rate),1)])])])],10,ze))),128))]),_(`div`,tt,[_(`button`,{onClick:a[5]||=e=>{p(y).useCustomRadio=!p(y).useCustomRadio,p(y).useCustomRadio&&(p(y).selectedRadioPreset=null)},class:b([`w-full p-4 rounded-[12px] border transition-all duration-300 text-left backdrop-blur-sm`,p(y).useCustomRadio?`bg-gradient-to-r from-primary/20 to-primary/10 border-primary/50 shadow-lg shadow-primary/20`:`bg-background-mute dark:bg-white/5 border-stroke-subtle dark:border-stroke/10 hover:bg-stroke-subtle dark:hover:bg-white/10 hover:border-stroke dark:hover:border-stroke/20`])},[_(`div`,nt,[a[37]||=_(`div`,{class:`font-medium text-content-primary dark:text-content-primary flex items-center gap-2`},[_(`svg`,{class:`w-5 h-5`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[_(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M12 6V4m0 2a2 2 0 100 4m0-4a2 2 0 110 4m-6 8a2 2 0 100-4m0 4a2 2 0 110-4m0 4v2m0-6V4m6 6v10m6-2a2 2 0 100-4m0 4a2 2 0 110-4m0 4v2m0-6V4`})]),h(` Custom Configuration `)],-1),p(y).useCustomRadio?(u(),v(`div`,Q,[...a[36]||=[_(`svg`,{class:`w-5 h-5`,fill:`currentColor`,viewBox:`0 0 20 20`},[_(`path`,{"fill-rule":`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z`,"clip-rule":`evenodd`})],-1)]])):d(``,!0)]),a[38]||=_(`div`,{class:`text-xs text-content-secondary dark:text-content-muted`},` Manually configure frequency, bandwidth, spreading factor, and coding rate `,-1)],2),f(w,{name:`slide`},{default:e(()=>[p(y).useCustomRadio?(u(),v(`div`,rt,[_(`div`,null,[a[39]||=_(`label`,{class:`block text-content-primary dark:text-content-primary/90 text-sm font-medium mb-2`},`Frequency (MHz)`,-1),i(_(`input`,{"onUpdate:modelValue":a[6]||=e=>p(y).customRadio.frequency=e,type:`number`,step:`0.1`,class:`w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-[12px] px-4 py-2.5 text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:ring-2 focus:ring-primary/50 focus:border-transparent transition-all`,placeholder:`915.0`},null,512),[[C,p(y).customRadio.frequency]])]),_(`div`,null,[a[40]||=_(`label`,{class:`block text-content-primary dark:text-content-primary/90 text-sm font-medium mb-2`},`Bandwidth (kHz)`,-1),i(_(`input`,{"onUpdate:modelValue":a[7]||=e=>p(y).customRadio.bandwidth=e,type:`number`,class:`w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-[12px] px-4 py-2.5 text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:ring-2 focus:ring-primary/50 focus:border-transparent transition-all`,placeholder:`125`},null,512),[[C,p(y).customRadio.bandwidth]])]),_(`div`,null,[a[42]||=_(`label`,{class:`block text-content-primary dark:text-content-primary/90 text-sm font-medium mb-2`},`Spreading Factor`,-1),i(_(`select`,{"onUpdate:modelValue":a[8]||=e=>p(y).customRadio.spreading_factor=e,class:`w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-[12px] px-4 py-2.5 text-content-primary dark:text-content-primary focus:outline-none focus:ring-2 focus:ring-primary/50 focus:border-transparent transition-all`},[...a[41]||=[_(`option`,{value:`7`},`7`,-1),_(`option`,{value:`8`},`8`,-1),_(`option`,{value:`9`},`9`,-1),_(`option`,{value:`10`},`10`,-1),_(`option`,{value:`11`},`11`,-1),_(`option`,{value:`12`},`12`,-1)]],512),[[S,p(y).customRadio.spreading_factor]])]),_(`div`,null,[a[44]||=_(`label`,{class:`block text-content-primary dark:text-content-primary/90 text-sm font-medium mb-2`},`Coding Rate`,-1),i(_(`select`,{"onUpdate:modelValue":a[9]||=e=>p(y).customRadio.coding_rate=e,class:`w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-[12px] px-4 py-2.5 text-content-primary dark:text-content-primary focus:outline-none focus:ring-2 focus:ring-primary/50 focus:border-transparent transition-all`},[...a[43]||=[_(`option`,{value:`5`},`4/5`,-1),_(`option`,{value:`6`},`4/6`,-1),_(`option`,{value:`7`},`4/7`,-1),_(`option`,{value:`8`},`4/8`,-1)]],512),[[S,p(y).customRadio.coding_rate]])])])):d(``,!0)]),_:1})])]))])):p(y).currentStep===6?(u(),v(`div`,it,[a[49]||=_(`p`,{class:`text-content-secondary dark:text-content-primary/70 text-center mb-6`},` Set a secure admin password to protect your repeater `,-1),_(`div`,at,[_(`div`,null,[a[46]||=_(`label`,{class:`block text-content-primary dark:text-content-primary/90 text-sm font-medium mb-2`},`Admin Password`,-1),i(_(`input`,{"onUpdate:modelValue":a[10]||=e=>p(y).adminPassword=e,type:`password`,class:`w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-3 text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent`,placeholder:`Enter password (min 6 characters)`,minlength:`6`},null,512),[[C,p(y).adminPassword]])]),_(`div`,null,[a[47]||=_(`label`,{class:`block text-content-primary dark:text-content-primary/90 text-sm font-medium mb-2`},`Confirm Password`,-1),i(_(`input`,{"onUpdate:modelValue":a[11]||=e=>p(y).confirmPassword=e,type:`password`,class:`w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-3 text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent`,placeholder:`Confirm password`},null,512),[[C,p(y).confirmPassword]])]),p(y).adminPassword&&p(y).confirmPassword&&p(y).adminPassword!==p(y).confirmPassword?(u(),v(`div`,ot,` Passwords do not match `)):d(``,!0),a[48]||=_(`div`,{class:`bg-yellow-500/10 border border-yellow-500/30 rounded-lg p-3 text-sm text-yellow-800 dark:text-yellow-200`},[_(`strong`,null,`Important:`),h(` Remember this password - you'll need it to access the dashboard. `)],-1)])])):d(``,!0)]),p(y).error?(u(),v(`div`,st,t(p(y).error),1)):d(``,!0),_(`div`,ct,[p(y).canGoBack?(u(),v(`button`,{key:0,onClick:B,class:`px-6 py-3 rounded-[12px] bg-background-mute dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 text-content-primary dark:text-content-primary hover:bg-stroke-subtle dark:hover:bg-white/10 hover:border-stroke dark:hover:border-stroke/20 transition-all duration-300 font-medium`},` Back `)):(u(),v(`div`,lt)),_(`button`,{onClick:z,disabled:!p(y).canGoNext||p(y).isSubmitting,class:b([`px-8 py-3 rounded-[12px] font-semibold transition-all duration-300 flex items-center gap-2 disabled:opacity-50 disabled:cursor-not-allowed`,p(y).canGoNext&&!p(y).isSubmitting?`bg-primary hover:bg-primary/90 text-white border border-primary hover:border-primary/80`:`bg-background-mute dark:bg-stroke/5 text-content-muted dark:text-content-muted border border-stroke-subtle dark:border-stroke/10`])},[p(y).isSubmitting?(u(),o(O,{key:0,size:`sm`,color:`white`})):d(``,!0),p(y).isSubmitting?(u(),v(`span`,dt,`Setting up...`)):p(y).isLastStep?(u(),v(`span`,ft,`Complete Setup`)):(u(),v(`span`,pt,`Next`)),!p(y).isSubmitting&&!p(y).isLastStep?(u(),v(`svg`,mt,[...a[50]||=[_(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M9 5l7 7-7 7`},null,-1)]])):d(``,!0)],10,ut)])])]),f(w,{name:`modal`},{default:e(()=>[x.value?(u(),v(`div`,{key:0,class:`fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/60 backdrop-blur-sm`,onClick:$},[_(`div`,{class:`bg-white dark:bg-surface-elevated backdrop-blur-xl max-w-md w-full p-8 rounded-[24px] border border-stroke-subtle dark:border-white/20 shadow-[0_8px_32px_0_rgba(0,0,0,0.37)]`,onClick:a[12]||=T(()=>{},[`stop`])},[a[51]||=_(`div`,{class:`flex justify-center mb-6`},[_(`div`,{class:`w-16 h-16 rounded-full bg-red-100 dark:bg-red-500/20 flex items-center justify-center`},[_(`svg`,{class:`w-8 h-8 text-red-600 dark:text-red-400`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[_(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M6 18L18 6M6 6l12 12`})])])],-1),_(`h3`,ht,t(E.value),1),_(`p`,gt,t(D.value),1),_(`button`,{onClick:$,class:`w-full px-6 py-3 rounded-lg font-medium transition-colors bg-accent-red/20 hover:bg-accent-red/30 border border-accent-red/50 text-accent-red`},` Close `)])])):d(``,!0)]),_:1}),f(k,{modelValue:M.value,"onUpdate:modelValue":a[13]||=e=>M.value=e,"start-immediately":!0,message:`Setup complete. The service is restarting. This may take up to a minute.`},null,8,[`modelValue`])]))}}),[[`__scopeId`,`data-v-db86ec4d`]]);export{$ as default};