import{o as e,t}from"./vue.runtime.esm-BuK-KA7b.js";import{n,o as r}from"./_plugin-vue2_normalizer-D5mCHcOy.js";import{t as i}from"./socketActions-BjlocJGv.js";e();var a=class extends t{get moonrakerServiceName(){return this.$typedState.server.system_info?.instance_ids?.moonraker||`moonraker`}get klipperServiceName(){return this.$typedState.server.system_info?.instance_ids?.klipper||`klipper`}async _klipperReset(){await this.$typedDispatch(`resetKlippy`)}hostReboot(){i.machineReboot()}hostShutdown(){i.machineShutdown()}async serviceRestartKlipper(){this.serviceRestartByName(this.klipperServiceName)}serviceRestartMoonraker(){this.serviceRestartByName(this.moonrakerServiceName)}async serviceRestartByName(e){e===this.moonrakerServiceName?i.serverRestart():(e===this.klipperServiceName&&await this._klipperReset(),i.machineServicesRestart(e))}async serviceStartByName(e){i.machineServicesStart(e)}async serviceStopByName(e){if(e===this.moonrakerServiceName)throw Error(`Stopping the moonraker service is not supported`);e===this.klipperServiceName&&await this._klipperReset(),i.machineServicesStop(e)}async restartKlippy(){await this._klipperReset(),i.printerRestart()}async firmwareRestartKlippy(){await this._klipperReset(),i.printerFirmwareRestart()}};a=n([r],a);var o=a;export{o as t};