import Foundation import Observation @MainActor @Observable final class WizardModel { var step: WizardStep = .welcome var device: DeviceState? var supervisionLog: [String] = [] var supervisionRunning: Bool = false var supervisionError: String? var enrollmentLog: [String] = [] var enrollmentRunning: Bool = false var enrollmentError: String? var configureLog: [String] = [] var configureRunning: Bool = false var configureError: String? var cooldownEndsAt: Date? func advance() { if let next = WizardStep(rawValue: step.rawValue + 1) { step = next } } func goTo(_ s: WizardStep) { step = s } func reset() { step = .welcome device = nil supervisionLog = [] enrollmentLog = [] configureLog = [] supervisionError = nil enrollmentError = nil configureError = nil cooldownEndsAt = nil } }