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 socketInitializing(){return this.$typedGetters[`socket/getIsInitializing`]}get socketDisconnected(){return this.$typedGetters[`socket/getIsDisconnected`]}get socketConnected(){return this.$typedGetters[`socket/getIsConnected`]}get socketAuthenticating(){return this.$typedGetters[`socket/getIsAuthenticating`]}get socketReady(){return this.$typedGetters[`socket/getIsReady`]}get klippyReady(){return this.$typedGetters[`printer/getKlippyReady`]}get klippyConnected(){return this.$typedGetters[`printer/getKlippyConnected`]}get hasWarnings(){return this.$typedGetters[`printer/getHasWarnings`]}get klippyState(){return this.$typedGetters[`printer/getKlippyState`]}get klippyStateMessage(){return this.$typedGetters[`printer/getKlippyStateMessage`]}get printerState(){return this.$typedGetters[`printer/getPrinterState`]}get printerBusy(){let e=this.printerState;return e===`printing`||e===`paused`||e===`busy`}get printerPaused(){return this.printerState===`paused`}get printerPrinting(){return this.printerState===`printing`}get printerPoweredOff(){if(this.klippyConnected)return!1;let e=this.$typedState.config.uiSettings.general.printerPowerDevice??`printer`;return this.$typedGetters[`power/getDeviceByName`](e)?.status===`off`}hasWait(e){return this.$typedGetters[`wait/hasWait`](e)}get hasWaits(){return this.$typedGetters[`wait/hasWaits`]}hasWaitsBy(e){return this.$typedGetters[`wait/hasWaitsBy`](e)}sendGcode(e,t){i.printerGcodeScript(e,{wait:t}),this.addConsoleEntry(e)}sendMoveGcode(e,t,n=!1,r){let i=this.$typedGetters[`macros/getMacroByName`](`_CLIENT_LINEAR_MOVE`),a=i?`=`:``,o=Object.entries(e).map(([e,t])=>`${e}${a}${t}`).join(` `),s=i?`${i.name.toUpperCase()} ${o} F=${t*60}${n?` ABSOLUTE=1`:``}`:`SAVE_GCODE_STATE NAME=_ui_movement
G9${+!n}
G1 ${o} F${t*60}
RESTORE_GCODE_STATE NAME=_ui_movement`;this.sendGcode(s,r)}sendExtrudeGcode(e,t,n){let r=this.$typedGetters[`macros/getMacroByName`](`_CLIENT_LINEAR_MOVE`),i=r?`${r.name.toUpperCase()} E=${e} F=${t*60}`:`SAVE_GCODE_STATE NAME=_ui_retract
M83
G1 E${e} F${t*60}
RESTORE_GCODE_STATE NAME=_ui_retract`;this.sendGcode(i,n)}addConsoleEntry(e){this.$typedDispatch(`console/onAddConsoleEntry`,{message:e,type:`command`})}async emergencyStop(){(!this.$typedState.config.uiSettings.general.confirmOnEstop||await this.$confirm(this.$tc(`app.general.simple_form.msg.confirm_emergency_stop`),{title:this.$tc(`app.general.label.confirm`),color:`card-heading`,icon:`$error`}))&&i.printerEmergencyStop()}async cancelPrint(){await this.$confirm(this.$tc(`app.general.simple_form.msg.confirm_cancel_print`),{title:this.$tc(`app.general.label.confirm`),color:`card-heading`,icon:`$error`})&&(i.printerPrintCancel(),this.addConsoleEntry(`CANCEL_PRINT`))}pausePrint(){i.printerPrintPause(),this.addConsoleEntry(`PAUSE`)}resumePrint(){i.printerPrintResume(),this.addConsoleEntry(`RESUME`)}homeAll(){this.sendGcode(`G28`,this.$waits.onHomeAll)}};a=n([r],a);var o=a;export{o as t};