export const __webpack_id__="162";export const __webpack_ids__=["162"];export const __webpack_modules__={60931:function(t,a,o){o.a(t,async function(t,i){try{o.r(a);var e=o(69868),r=o(84922),s=o(11991),n=o(65940),c=o(44017),l=(o(68940),o(17372)),h=(o(60921),o(63625)),u=o(51203),d=o(50809),p=t([l]);l=(p.then?(await p)():p)[0];const _=(0,n.A)(()=>[{name:"default_backup_mount",required:!0,selector:{backup_location:{}}}]);class m extends r.WF{async showDialog(t){this._dialogParams=t}closeDialog(){this._data=void 0,this._error=void 0,this._waiting=void 0,this._dialogParams=void 0,(0,c.r)(this,"dialog-closed",{dialog:this.localName})}render(){return this._dialogParams?r.qy` <ha-dialog open scrimClickAction escapeKeyAction .heading="${this._dialogParams.supervisor.localize("dialog.backup_location.title")}" @closed="${this.closeDialog}"> ${this._error?r.qy`<ha-alert alert-type="error">${this._error}</ha-alert>`:r.s6} <ha-form .hass="${this.hass}" .data="${this._data}" .schema="${_()}" .computeLabel="${this._computeLabelCallback}" .computeHelper="${this._computeHelperCallback}" @value-changed="${this._valueChanged}" dialogInitialFocus></ha-form> <ha-button appearance="plain" slot="secondaryAction" @click="${this.closeDialog}" dialogInitialFocus> ${this._dialogParams.supervisor.localize("common.cancel")} </ha-button> <ha-button .disabled="${this._waiting||!this._data}" slot="primaryAction" @click="${this._changeMount}"> ${this._dialogParams.supervisor.localize("common.save")} </ha-button> </ha-dialog> `:r.s6}_valueChanged(t){const a=t.detail.value.default_backup_mount;this._data={default_backup_mount:"/backup"===a?null:a}}async _changeMount(){if(this._data){this._error=void 0,this._waiting=!0;try{await(0,u.Su)(this.hass,this._data)}catch(t){return this._error=(0,h.VR)(t),void(this._waiting=!1)}this.closeDialog()}}static get styles(){return[d.RF,d.nA,r.AH`.delete-btn{--mdc-theme-primary:var(--error-color)}`]}constructor(...t){super(...t),this._computeLabelCallback=t=>this._dialogParams.supervisor.localize(`dialog.backup_location.options.${t.name}.name`)||t.name,this._computeHelperCallback=t=>this._dialogParams.supervisor.localize(`dialog.backup_location.options.${t.name}.description`)}}(0,e.__decorate)([(0,s.MZ)({attribute:!1})],m.prototype,"hass",void 0),(0,e.__decorate)([(0,s.wk)()],m.prototype,"_dialogParams",void 0),(0,e.__decorate)([(0,s.wk)()],m.prototype,"_data",void 0),(0,e.__decorate)([(0,s.wk)()],m.prototype,"_waiting",void 0),(0,e.__decorate)([(0,s.wk)()],m.prototype,"_error",void 0),m=(0,e.__decorate)([(0,s.EM)("dialog-hassio-backup-location")],m),i()}catch(t){i(t)}})},51203:function(t,a,o){o.d(a,{Su:()=>s,Wu:()=>i,bK:()=>r,h1:()=>e});var i=function(t){return t.BIND="bind",t.CIFS="cifs",t.NFS="nfs",t}({}),e=function(t){return t.BACKUP="backup",t.MEDIA="media",t.SHARE="share",t}({});const r=async t=>t.callWS({type:"supervisor/api",endpoint:"/mounts",method:"get",timeout:null}),s=async(t,a)=>t.callWS({type:"supervisor/api",endpoint:"/mounts/options",method:"post",timeout:null,data:a})},19370:function(t,a,o){var i=o(36233),e=o(38707),r=o(78923),s=o(19799);t.exports=function(t,a){a&&"string"==typeof t||e(t);var o=s(t);return r(e(void 0!==o?i(o,t):t))}},12791:function(t,a,o){var i=o(87642),e=o(36233),r=o(33358),s=o(38707),n=o(78923),c=o(19370),l=o(49866),h=o(25727),u=o(55319),d=o(25008),p=o(66337),_=!u&&!d("flatMap",function(){}),m=!u&&!_&&p("flatMap",TypeError),g=u||_||m,v=l(function(){for(var t,a,o=this.iterator,i=this.mapper;;){if(a=this.inner)try{if(!(t=s(e(a.next,a.iterator))).done)return t.value;this.inner=null}catch(t){h(o,"throw",t)}if(t=s(e(this.next,o)),this.done=!!t.done)return;try{this.inner=c(i(t.value,this.counter++),!1)}catch(t){h(o,"throw",t)}}});i({target:"Iterator",proto:!0,real:!0,forced:g},{flatMap:function(t){s(this);try{r(t)}catch(t){h(this,"throw",t)}return m?e(m,this,t):new v(n(this),{mapper:t,inner:null})}})}};
//# sourceMappingURL=162.715009ea3cc4d106.js.map