import{I as o,r as t,b as e,d as s,l as i,n as r,s as a,x as l}from"./index-BBP3z-Qn.js";import"./c.qxZmAkQm.js";import{o as n,a as c}from"./c.D1LSBjqQ.js";import"./c.DAMWOaZB.js";import"./c.BJxdrEeL.js";import"./c.Cyu20JQH.js";import"./c.DcpxJ3av.js";import"./c.kam1r7Tp.js";let p=class extends a{constructor(){super(...arguments),this.downloadFactoryFirmware=!0}render(){return l`
      <esphome-process-dialog
        .heading=${`Download ${this.configuration}`}
        .type=${"compile"}
        .spawnParams=${{configuration:this.configuration}}
        @closed=${this._handleClose}
        @process-done=${this._handleProcessDone}
      >
        ${void 0===this._result?"":0===this._result?l`
                <mwc-button
                  slot="secondaryAction"
                  label="Download"
                  @click=${this._handleDownload}
                ></mwc-button>
              `:l`
                <mwc-button
                  slot="secondaryAction"
                  dialogAction="close"
                  label="Retry"
                  @click=${this._handleRetry}
                ></mwc-button>
              `}
      </esphome-process-dialog>
    `}_handleProcessDone(o){this._result=o.detail,0===o.detail&&n(this.configuration,this.platformSupportsWebSerial)}_handleDownload(){n(this.configuration,this.platformSupportsWebSerial)}_handleRetry(){c(this.configuration,this.platformSupportsWebSerial)}_handleClose(){this.parentNode.removeChild(this)}};p.styles=[o,t`
      a {
        text-decoration: none;
      }
    `],e([s()],p.prototype,"configuration",void 0),e([s()],p.prototype,"platformSupportsWebSerial",void 0),e([s()],p.prototype,"downloadFactoryFirmware",void 0),e([i()],p.prototype,"_result",void 0),p=e([r("esphome-compile-dialog")],p);
//# sourceMappingURL=c.1Svrs84B.js.map
