mirror of
https://github.com/pyMC-dev/pyMC_Repeater.git
synced 2026-07-05 17:32:33 +02:00
1 line
24 KiB
JavaScript
1 line
24 KiB
JavaScript
import{A as e,E as t,K as n,S as r,dt as i,f as a,ft as o,g as s,j as c,l,m as u,o as d,p as f,pt as p,r as m,s as h,u as g,w as _,x as v,z as y}from"./runtime-core.esm-bundler-HnidnMFy.js";import{i as b,o as x}from"./vue-router-Cr0wB7EX.js";import{t as S}from"./_plugin-vue_export-helper-B7aGp3iI.js";import{c as C,d as w,f as T,h as ee,t as te}from"./index-BFltqMtv.js";var ne=x(`setup`,()=>{let e=y(1),t=y(5),n=y(`pyRpt${Math.floor(Math.random()*1e4).toString().padStart(4,`0`)}`),r=y(null),i=y(null),a=y(``),o=y(``),s=y(!1),c=y({frequency:`915.0`,spreading_factor:`7`,bandwidth:`125`,coding_rate:`5`}),l=y([]),u=y([]),f=y(!1),p=y(!1),m=y(null),h=d(()=>{switch(e.value){case 1:return!0;case 2:return n.value.trim().length>0;case 3:return r.value!==null;case 4:return s.value?c.value.frequency&&c.value.spreading_factor&&c.value.bandwidth&&c.value.coding_rate:i.value!==null;case 5:return a.value.length>=6&&a.value===o.value;default:return!1}}),g=d(()=>e.value>1),_=d(()=>e.value===t.value);async function v(){f.value=!0,m.value=null;try{let e=await(await fetch(`/api/hardware_options`)).json();if(e.error)throw Error(e.error);l.value=e.hardware||[]}catch(e){m.value=e instanceof Error?e.message:`Failed to load hardware options`,console.error(`Error fetching hardware options:`,e)}finally{f.value=!1}}async function b(){f.value=!0,m.value=null;try{let e=await(await fetch(`/api/radio_presets`)).json();if(e.error)throw Error(e.error);u.value=e.presets||[]}catch(e){m.value=e instanceof Error?e.message:`Failed to load radio presets`,console.error(`Error fetching radio presets:`,e)}finally{f.value=!1}}async function x(){if(!h.value)return{success:!1,error:`Please complete all required fields`};p.value=!0,m.value=null;try{let e=s.value?{title:`Custom Configuration`,description:`Custom radio settings`,frequency:c.value.frequency,spreading_factor:c.value.spreading_factor,bandwidth:c.value.bandwidth,coding_rate:c.value.coding_rate}:i.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:a.value})})).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 m.value=t,{success:!1,error:t}}finally{p.value=!1}}function S(){h.value&&e.value<t.value&&e.value++}function C(){g.value&&e.value--}function w(n){n>=1&&n<=t.value&&(e.value=n)}function T(){e.value=1,n.value=`pyRpt${Math.floor(Math.random()*1e4).toString().padStart(4,`0`)}`,r.value=null,i.value=null,s.value=!1,c.value={frequency:`915.0`,spreading_factor:`7`,bandwidth:`125`,coding_rate:`5`},a.value=``,o.value=``,m.value=null}return{currentStep:e,totalSteps:t,nodeName:n,selectedHardware:r,selectedRadioPreset:i,useCustomRadio:s,customRadio:c,adminPassword:a,confirmPassword:o,hardwareOptions:l,radioPresets:u,isLoading:f,isSubmitting:p,error:m,canGoNext:h,canGoBack:g,isLastStep:_,fetchHardwareOptions:v,fetchRadioPresets:b,completeSetup:x,nextStep:S,previousStep:C,goToStep:w,reset:T}}),re={class:`min-h-screen bg-background dark:bg-background overflow-hidden relative flex items-center justify-center p-4`},ie={class:`absolute top-4 right-4 z-20`},ae={class:`w-full max-w-4xl relative z-10`},oe={class:`mb-8`},se={class:`flex justify-between mb-2`},ce={class:`text-content-secondary dark:text-content-muted text-sm`},E={class:`text-content-secondary dark:text-content-muted text-sm`},D={class:`h-2 bg-stroke-subtle dark:bg-stroke/10 rounded-full overflow-hidden`},O={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`},k={class:`flex justify-center mb-8`},A={class:`flex gap-2`},j={class:`mb-8`},M={class:`text-2xl sm:text-3xl font-bold text-content-primary dark:text-content-primary mb-2 text-center`},N={key:0,class:`space-y-6 mt-8`},P={key:1,class:`space-y-6 mt-8`},F={class:`max-w-md mx-auto`},I={key:2,class:`space-y-6 mt-8`},L={key:0,class:`text-center text-content-secondary dark:text-content-muted`},R={key:1,class:`text-center text-content-secondary dark:text-content-muted`},z={key:2,class:`grid grid-cols-1 md:grid-cols-2 gap-4 max-w-3xl mx-auto`},B=[`onClick`],V={class:`font-medium text-content-primary dark:text-content-primary mb-1`},H={class:`text-sm text-content-secondary dark:text-content-muted`},U={key:3,class:`space-y-6 mt-8`},W={key:0,class:`text-center text-content-secondary dark:text-content-muted`},G={key:1,class:`text-center text-content-secondary dark:text-content-muted`},le={key:2,class:`max-w-5xl mx-auto`},ue={class:`grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4 mb-4`},de=[`onClick`],fe={class:`relative z-10`},pe={class:`font-medium text-content-primary dark:text-content-primary mb-1 flex items-start justify-between gap-2`},me={class:`flex items-center gap-2`},he={class:`text-2xl`},ge={key:0,class:`text-primary flex-shrink-0`},_e={class:`text-xs text-content-secondary dark:text-content-muted mb-3`},ve={class:`grid grid-cols-2 gap-2 text-xs`},ye={class:`bg-gray-50 dark:bg-white/5 rounded px-2 py-1`},be={class:`text-content-primary dark:text-content-primary/80 font-medium`},xe={class:`bg-gray-50 dark:bg-white/5 rounded px-2 py-1`},Se={class:`text-content-primary dark:text-content-primary/80 font-medium`},Ce={class:`bg-gray-50 dark:bg-white/5 rounded px-2 py-1`},K={class:`text-content-primary dark:text-content-primary/80 font-medium`},we={class:`bg-gray-50 dark:bg-white/5 rounded px-2 py-1`},Te={class:`text-content-primary dark:text-content-primary/80 font-medium`},Ee={class:`border-t border-stroke-subtle dark:border-stroke/10 pt-6`},De={class:`flex items-center justify-between mb-2`},Oe={key:0,class:`text-primary`},ke={key:0,class:`mt-4 grid grid-cols-2 gap-4`},Ae={key:4,class:`space-y-6 mt-8`},je={class:`max-w-md mx-auto space-y-4`},Me={key:0,class:`text-red-600 dark:text-red-400 text-sm`},Ne={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`},Pe={class:`flex justify-between gap-4`},Fe={key:1},Ie=[`disabled`],Le={key:0,class:`w-4 h-4 border-2 border-white border-t-transparent rounded-full animate-spin`},Re={key:1},ze={key:2},Be={key:3},Ve={key:4,class:`w-4 h-4`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},He={class:`flex justify-center mb-6`},Ue={key:0,class:`w-16 h-16 rounded-full bg-green-100 dark:bg-green-500/20 flex items-center justify-center`},We={key:1,class:`w-16 h-16 rounded-full bg-red-100 dark:bg-red-500/20 flex items-center justify-center`},Ge={class:`text-2xl font-bold text-content-primary dark:text-content-primary text-center mb-4`},Ke={class:`text-content-secondary dark:text-content-primary/70 text-center mb-6`},q=S(s({name:`SetupView`,__name:`Setup`,setup(s){let x=ne(),S=b(),q=y(!1),J=y(``),Y=y(``),X=y(`success`),Z=null,qe=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`)?`🇻🇳`:`🌍`};r(async()=>{await Promise.all([x.fetchHardwareOptions(),x.fetchRadioPresets()])});let Q=d(()=>x.currentStep/x.totalSteps*100);async function Je(){if(x.isLastStep){let e=await x.completeSetup();e.success?(X.value=`success`,J.value=`Setup Complete!`,Y.value=`Your repeater has been configured successfully. The service is restarting now...`,q.value=!0,Xe()):(X.value=`error`,J.value=`Setup Failed`,Y.value=e.error||`An unknown error occurred`,q.value=!0)}else x.nextStep()}function Ye(){x.previousStep()}function $(){q.value=!1,X.value===`success`&&(Z||S.push(`/login`))}function Xe(){let e=0;function t(){e++,fetch(`/api/status`,{method:`GET`}).then(e=>{e.ok?(Z=null,q.value=!1,S.push(`/login`)):n()}).catch(()=>{n()})}function n(){e<30?Z=setTimeout(t,1e3):(Z=null,q.value=!1,S.push(`/login`))}Z=setTimeout(t,2e3)}v(()=>{Z&&=(clearTimeout(Z),null)});let Ze=[`Welcome`,`Repeater Name`,`Hardware Selection`,`Radio Configuration`,`Security Setup`];return(r,s)=>(_(),g(`div`,re,[h(`div`,ie,[u(te)]),s[36]||=h(`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),s[37]||=h(`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),s[38]||=h(`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),h(`div`,ae,[h(`div`,oe,[h(`div`,se,[h(`span`,ce,`Step `+p(n(x).currentStep)+` of `+p(n(x).totalSteps),1),h(`span`,E,p(Math.round(Q.value))+`% Complete`,1)]),h(`div`,D,[h(`div`,{class:`h-full bg-gradient-to-r from-primary to-primary/80 transition-all duration-500`,style:o({width:`${Q.value}%`})},null,4)])]),h(`div`,O,[h(`div`,k,[h(`div`,A,[(_(!0),g(m,null,t(n(x).totalSteps,e=>(_(),g(`div`,{key:e,class:i([`w-10 h-10 rounded-full flex items-center justify-center text-sm font-medium transition-all`,e===n(x).currentStep?`bg-primary text-white`:e<n(x).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`])},p(e),3))),128))])]),h(`div`,j,[h(`h2`,M,p(Ze[n(x).currentStep-1]),1),n(x).currentStep===1?(_(),g(`div`,N,[...s[9]||=[a(`<div class="text-center space-y-4" data-v-a201f2f2><div class="w-20 h-20 mx-auto bg-primary/20 rounded-full flex items-center justify-center mb-6" data-v-a201f2f2><svg class="w-10 h-10 text-primary" fill="none" stroke="currentColor" viewBox="0 0 24 24" data-v-a201f2f2><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 10V3L4 14h7v7l9-11h-7z" data-v-a201f2f2></path></svg></div><p class="text-content-secondary dark:text-content-primary/70 text-lg" data-v-a201f2f2> Welcome to your pyMC Repeater! Let'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-a201f2f2><p class="text-primary text-sm font-medium mb-2" data-v-a201f2f2>You'll configure:</p><ul class="space-y-2 text-content-secondary dark:text-content-primary/70 text-sm" data-v-a201f2f2><li class="flex items-center gap-2" data-v-a201f2f2><svg class="w-4 h-4 text-primary" fill="none" stroke="currentColor" viewBox="0 0 24 24" data-v-a201f2f2><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7" data-v-a201f2f2></path></svg> Repeater name and identification </li><li class="flex items-center gap-2" data-v-a201f2f2><svg class="w-4 h-4 text-primary" fill="none" stroke="currentColor" viewBox="0 0 24 24" data-v-a201f2f2><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7" data-v-a201f2f2></path></svg> Hardware board selection </li><li class="flex items-center gap-2" data-v-a201f2f2><svg class="w-4 h-4 text-primary" fill="none" stroke="currentColor" viewBox="0 0 24 24" data-v-a201f2f2><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7" data-v-a201f2f2></path></svg> Radio frequency and settings </li><li class="flex items-center gap-2" data-v-a201f2f2><svg class="w-4 h-4 text-primary" fill="none" stroke="currentColor" viewBox="0 0 24 24" data-v-a201f2f2><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7" data-v-a201f2f2></path></svg> Admin password for secure access </li></ul></div></div>`,1)]])):n(x).currentStep===2?(_(),g(`div`,P,[s[12]||=h(`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),h(`div`,F,[s[10]||=h(`label`,{class:`block text-content-primary dark:text-content-primary/90 text-sm font-medium mb-2`},`Repeater Name`,-1),c(h(`input`,{"onUpdate:modelValue":s[0]||=e=>n(x).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),[[T,n(x).nodeName]]),s[11]||=h(`p`,{class:`text-content-secondary dark:text-content-muted text-xs mt-2`},` Use letters, numbers, hyphens, or underscores (3-32 characters) `,-1)])])):n(x).currentStep===3?(_(),g(`div`,I,[s[13]||=h(`p`,{class:`text-content-secondary dark:text-content-primary/70 text-center mb-6`},` Select your hardware board type `,-1),n(x).isLoading?(_(),g(`div`,L,` Loading hardware options... `)):n(x).hardwareOptions.length===0?(_(),g(`div`,R,` No hardware options available `)):(_(),g(`div`,z,[(_(!0),g(m,null,t(n(x).hardwareOptions,e=>(_(),g(`button`,{key:e.key,onClick:t=>n(x).selectedHardware=e,class:i([`p-4 rounded-[12px] border transition-all duration-300 text-left backdrop-blur-sm`,n(x).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`])},[h(`div`,V,p(e.name),1),h(`div`,H,p(e.description||e.key),1)],10,B))),128))]))])):n(x).currentStep===4?(_(),g(`div`,U,[s[28]||=h(`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),n(x).isLoading?(_(),g(`div`,W,` Loading radio presets... `)):n(x).radioPresets.length===0?(_(),g(`div`,G,` No radio presets available `)):(_(),g(`div`,le,[h(`div`,ue,[(_(!0),g(m,null,t(n(x).radioPresets,e=>(_(),g(`button`,{key:e.title,onClick:t=>{n(x).selectedRadioPreset=e,n(x).useCustomRadio=!1},class:i([`p-4 rounded-[12px] border transition-all duration-300 text-left backdrop-blur-sm relative overflow-hidden`,!n(x).useCustomRadio&&n(x).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`])},[h(`div`,fe,[h(`div`,pe,[h(`span`,me,[h(`span`,he,p(qe(e.title)),1),h(`span`,null,p(e.title),1)]),!n(x).useCustomRadio&&n(x).selectedRadioPreset?.title===e.title?(_(),g(`div`,ge,[...s[14]||=[h(`svg`,{class:`w-5 h-5`,fill:`currentColor`,viewBox:`0 0 20 20`},[h(`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)]])):l(``,!0)]),h(`div`,_e,p(e.description),1),h(`div`,ve,[h(`div`,ye,[s[15]||=h(`div`,{class:`text-content-muted dark:text-content-muted`},`Freq`,-1),h(`div`,be,p(e.frequency),1)]),h(`div`,xe,[s[16]||=h(`div`,{class:`text-content-muted dark:text-content-muted`},`BW`,-1),h(`div`,Se,p(e.bandwidth),1)]),h(`div`,Ce,[s[17]||=h(`div`,{class:`text-content-muted dark:text-content-muted`},`SF`,-1),h(`div`,K,p(e.spreading_factor),1)]),h(`div`,we,[s[18]||=h(`div`,{class:`text-content-muted dark:text-content-muted`},`CR`,-1),h(`div`,Te,p(e.coding_rate),1)])])])],10,de))),128))]),h(`div`,Ee,[h(`button`,{onClick:s[1]||=e=>{n(x).useCustomRadio=!n(x).useCustomRadio,n(x).useCustomRadio&&(n(x).selectedRadioPreset=null)},class:i([`w-full p-4 rounded-[12px] border transition-all duration-300 text-left backdrop-blur-sm`,n(x).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`])},[h(`div`,De,[s[20]||=h(`div`,{class:`font-medium text-content-primary dark:text-content-primary flex items-center gap-2`},[h(`svg`,{class:`w-5 h-5`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[h(`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`})]),f(` Custom Configuration `)],-1),n(x).useCustomRadio?(_(),g(`div`,Oe,[...s[19]||=[h(`svg`,{class:`w-5 h-5`,fill:`currentColor`,viewBox:`0 0 20 20`},[h(`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)]])):l(``,!0)]),s[21]||=h(`div`,{class:`text-xs text-content-secondary dark:text-content-muted`},` Manually configure frequency, bandwidth, spreading factor, and coding rate `,-1)],2),u(C,{name:`slide`},{default:e(()=>[n(x).useCustomRadio?(_(),g(`div`,ke,[h(`div`,null,[s[22]||=h(`label`,{class:`block text-content-primary dark:text-content-primary/90 text-sm font-medium mb-2`},`Frequency (MHz)`,-1),c(h(`input`,{"onUpdate:modelValue":s[2]||=e=>n(x).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),[[T,n(x).customRadio.frequency]])]),h(`div`,null,[s[23]||=h(`label`,{class:`block text-content-primary dark:text-content-primary/90 text-sm font-medium mb-2`},`Bandwidth (kHz)`,-1),c(h(`input`,{"onUpdate:modelValue":s[3]||=e=>n(x).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),[[T,n(x).customRadio.bandwidth]])]),h(`div`,null,[s[25]||=h(`label`,{class:`block text-content-primary dark:text-content-primary/90 text-sm font-medium mb-2`},`Spreading Factor`,-1),c(h(`select`,{"onUpdate:modelValue":s[4]||=e=>n(x).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`},[...s[24]||=[h(`option`,{value:`7`},`7`,-1),h(`option`,{value:`8`},`8`,-1),h(`option`,{value:`9`},`9`,-1),h(`option`,{value:`10`},`10`,-1),h(`option`,{value:`11`},`11`,-1),h(`option`,{value:`12`},`12`,-1)]],512),[[w,n(x).customRadio.spreading_factor]])]),h(`div`,null,[s[27]||=h(`label`,{class:`block text-content-primary dark:text-content-primary/90 text-sm font-medium mb-2`},`Coding Rate`,-1),c(h(`select`,{"onUpdate:modelValue":s[5]||=e=>n(x).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`},[...s[26]||=[h(`option`,{value:`5`},`4/5`,-1),h(`option`,{value:`6`},`4/6`,-1),h(`option`,{value:`7`},`4/7`,-1),h(`option`,{value:`8`},`4/8`,-1)]],512),[[w,n(x).customRadio.coding_rate]])])])):l(``,!0)]),_:1})])]))])):n(x).currentStep===5?(_(),g(`div`,Ae,[s[32]||=h(`p`,{class:`text-content-secondary dark:text-content-primary/70 text-center mb-6`},` Set a secure admin password to protect your repeater `,-1),h(`div`,je,[h(`div`,null,[s[29]||=h(`label`,{class:`block text-content-primary dark:text-content-primary/90 text-sm font-medium mb-2`},`Admin Password`,-1),c(h(`input`,{"onUpdate:modelValue":s[6]||=e=>n(x).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),[[T,n(x).adminPassword]])]),h(`div`,null,[s[30]||=h(`label`,{class:`block text-content-primary dark:text-content-primary/90 text-sm font-medium mb-2`},`Confirm Password`,-1),c(h(`input`,{"onUpdate:modelValue":s[7]||=e=>n(x).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),[[T,n(x).confirmPassword]])]),n(x).adminPassword&&n(x).confirmPassword&&n(x).adminPassword!==n(x).confirmPassword?(_(),g(`div`,Me,` Passwords do not match `)):l(``,!0),s[31]||=h(`div`,{class:`bg-yellow-500/10 border border-yellow-500/30 rounded-lg p-3 text-sm text-yellow-800 dark:text-yellow-200`},[h(`strong`,null,`Important:`),f(` Remember this password - you'll need it to access the dashboard. `)],-1)])])):l(``,!0)]),n(x).error?(_(),g(`div`,Ne,p(n(x).error),1)):l(``,!0),h(`div`,Pe,[n(x).canGoBack?(_(),g(`button`,{key:0,onClick:Ye,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 `)):(_(),g(`div`,Fe)),h(`button`,{onClick:Je,disabled:!n(x).canGoNext||n(x).isSubmitting,class:i([`px-8 py-3 rounded-[12px] font-semibold transition-all duration-300 flex items-center gap-2 disabled:opacity-50 disabled:cursor-not-allowed`,n(x).canGoNext&&!n(x).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`])},[n(x).isSubmitting?(_(),g(`div`,Le)):l(``,!0),n(x).isSubmitting?(_(),g(`span`,Re,`Setting up...`)):n(x).isLastStep?(_(),g(`span`,ze,`Complete Setup`)):(_(),g(`span`,Be,`Next`)),!n(x).isSubmitting&&!n(x).isLastStep?(_(),g(`svg`,Ve,[...s[33]||=[h(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M9 5l7 7-7 7`},null,-1)]])):l(``,!0)],10,Ie)])])]),u(C,{name:`modal`},{default:e(()=>[q.value?(_(),g(`div`,{key:0,class:`fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/60 backdrop-blur-sm`,onClick:$},[h(`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:s[8]||=ee(()=>{},[`stop`])},[h(`div`,He,[X.value===`success`?(_(),g(`div`,Ue,[...s[34]||=[h(`svg`,{class:`w-8 h-8 text-green-600 dark:text-green-400`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[h(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M5 13l4 4L19 7`})],-1)]])):(_(),g(`div`,We,[...s[35]||=[h(`svg`,{class:`w-8 h-8 text-red-600 dark:text-red-400`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[h(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M6 18L18 6M6 6l12 12`})],-1)]]))]),h(`h3`,Ge,p(J.value),1),h(`p`,Ke,p(Y.value),1),h(`button`,{onClick:$,class:i([`w-full px-6 py-3 rounded-lg font-medium transition-all`,X.value===`success`?`bg-primary hover:bg-primary/90 text-white`:`bg-accent-red hover:bg-accent-red/90 text-white`])},p(X.value===`success`?`Continue to Login`:`Close`),3)])])):l(``,!0)]),_:1})]))}}),[[`__scopeId`,`data-v-a201f2f2`]]);export{q as default}; |