export const __rspack_esm_id="6839";export const __rspack_esm_ids=["6839"];export const __webpack_modules__={93444(t,a,e){var s=e(62826),i=e(96196),o=e(44457);class n extends i.WF{render(){return i.qy` <footer> <slot name="secondaryAction"></slot> <slot name="primaryAction"></slot> </footer> `}static get styles(){return[i.AH`footer{display:flex;gap:var(--ha-space-3);justify-content:flex-end;align-items:center;width:100%}`]}}n=(0,s.Cg)([(0,o.EM)("ha-dialog-footer")],n)},45100(t,a,e){e.r(a),e.d(a,{HaIconButtonPrev:()=>l});var s=e(62826),i=e(96196),o=e(44457),n=e(63091);e(26300);class l extends i.WF{render(){return i.qy` <ha-icon-button .disabled="${this.disabled}" .label="${this.label||this.hass?.localize("ui.common.back")||"Back"}" .path="${this._icon}"></ha-icon-button> `}constructor(...t){super(...t),this.disabled=!1,this._icon="rtl"===n.G.document.dir?"M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z":"M15.41,16.58L10.83,12L15.41,7.41L14,6L8,12L14,18L15.41,16.58Z"}}(0,s.Cg)([(0,o.MZ)({attribute:!1})],l.prototype,"hass",void 0),(0,s.Cg)([(0,o.MZ)({type:Boolean})],l.prototype,"disabled",void 0),(0,s.Cg)([(0,o.MZ)()],l.prototype,"label",void 0),(0,s.Cg)([(0,o.wk)()],l.prototype,"_icon",void 0),l=(0,s.Cg)([(0,o.EM)("ha-icon-button-prev")],l)},71828(t,a,e){var s=e(62826),i=e(5691),o=e(28522),n=e(96196),l=e(44457);class d extends i.${}d.styles=[o.R,n.AH`:host{--ha-icon-display:block;--md-sys-color-primary:var(--primary-text-color);--md-sys-color-secondary:var(--secondary-text-color);--md-sys-color-surface:var(--card-background-color);--md-sys-color-on-surface:var(--primary-text-color);--md-sys-color-on-surface-variant:var(--secondary-text-color)}`],d=(0,s.Cg)([(0,l.EM)("ha-md-select-option")],d)},37832(t,a,e){var s=e(62826),i=e(73709),o=e(7138),n=e(83538),l=e(96196),d=e(44457);class r extends i.V{}r.styles=[o.R,n.R,l.AH`:host{--ha-icon-display:block;--md-sys-color-primary:var(--primary-text-color);--md-sys-color-secondary:var(--secondary-text-color);--md-sys-color-surface:var(--card-background-color);--md-sys-color-on-surface-variant:var(--secondary-text-color);--md-sys-color-surface-container-highest:var(--input-fill-color);--md-sys-color-on-surface:var(--input-ink-color);--md-sys-color-surface-container:var(--input-fill-color);--md-sys-color-on-secondary-container:var(--primary-text-color);--md-sys-color-secondary-container:var(--input-fill-color);--md-menu-container-color:var(--card-background-color)}`],r=(0,s.Cg)([(0,d.EM)("ha-md-select")],r)},45331(t,a,e){e.a(t,async function(t,a){try{var s=e(62826),i=e(93900),o=e(96196),n=e(44457),l=e(32288),d=e(1087),r=e(59992),h=e(14503),c=e(22348),p=(e(76538),e(26300),t([i]));i=(p.then?(await p)():p)[0];const g="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z";class u extends((0,r.V)(o.WF)){get scrollableElement(){return this.bodyContainer}updated(t){super.updated(t),t.has("open")&&(this._open=this.open)}render(){return o.qy` <wa-dialog .open="${this._open}" .lightDismiss="${!this.preventScrimClose}" without-header aria-labelledby="${(0,l.J)(this.ariaLabelledBy||(void 0!==this.headerTitle?"ha-wa-dialog-title":void 0))}" aria-describedby="${(0,l.J)(this.ariaDescribedBy)}" @wa-show="${this._handleShow}" @wa-after-show="${this._handleAfterShow}" @wa-after-hide="${this._handleAfterHide}"> <slot name="header"> <ha-dialog-header .subtitlePosition="${this.headerSubtitlePosition}" .showBorder="${this._bodyScrolled}"> <slot name="headerNavigationIcon" slot="navigationIcon"> <ha-icon-button data-dialog="close" .label="${this.hass?.localize("ui.common.close")??"Close"}" .path="${g}"></ha-icon-button> </slot> ${void 0!==this.headerTitle?o.qy`<span slot="title" class="title" id="ha-wa-dialog-title"> ${this.headerTitle} </span>`:o.qy`<slot name="headerTitle" slot="title"></slot>`} ${void 0!==this.headerSubtitle?o.qy`<span slot="subtitle">${this.headerSubtitle}</span>`:o.qy`<slot name="headerSubtitle" slot="subtitle"></slot>`} <slot name="headerActionItems" slot="actionItems"></slot> </ha-dialog-header> </slot> <div class="content-wrapper"> <div class="body ha-scrollbar" @scroll="${this._handleBodyScroll}"> <slot></slot> </div> ${this.renderScrollableFades()} </div> <slot name="footer" slot="footer"></slot> </wa-dialog> `}disconnectedCallback(){super.disconnectedCallback(),this._open=!1}_handleBodyScroll(t){this._bodyScrolled=t.target.scrollTop>0}static get styles(){return[...super.styles,h.dp,o.AH`
        wa-dialog {
          --full-width: var(
            --ha-dialog-width-full,
            min(95vw, var(--safe-width))
          );
          --width: min(var(--ha-dialog-width-md, 580px), var(--full-width));
          --spacing: var(--dialog-content-padding, var(--ha-space-6));
          --show-duration: var(--ha-dialog-show-duration, 200ms);
          --hide-duration: var(--ha-dialog-hide-duration, 200ms);
          --ha-dialog-surface-background: var(
            --card-background-color,
            var(--ha-color-surface-default)
          );
          --wa-color-surface-raised: var(
            --ha-dialog-surface-background,
            var(--card-background-color, var(--ha-color-surface-default))
          );
          --wa-panel-border-radius: var(
            --ha-dialog-border-radius,
            var(--ha-border-radius-3xl)
          );
          max-width: var(--ha-dialog-max-width, var(--safe-width));
        }
        @media (prefers-reduced-motion: reduce) {
          wa-dialog {
            --show-duration: 0ms;
            --hide-duration: 0ms;
          }
        }

        :host([width="small"]) wa-dialog {
          --width: min(var(--ha-dialog-width-sm, 320px), var(--full-width));
        }

        :host([width="large"]) wa-dialog {
          --width: min(var(--ha-dialog-width-lg, 1024px), var(--full-width));
        }

        :host([width="full"]) wa-dialog {
          --width: var(--full-width);
        }

        wa-dialog::part(dialog) {
          min-width: var(--width, var(--full-width));
          max-width: var(--width, var(--full-width));
          max-height: var(
            --ha-dialog-max-height,
            calc(var(--safe-height) - var(--ha-space-20))
          );
          min-height: var(--ha-dialog-min-height);
          margin-top: var(--dialog-surface-margin-top, auto);
          /* Used to offset the dialog from the safe areas when space is limited */
          transform: translate(
            calc(
              var(--safe-area-offset-left, 0px) - var(
                  --safe-area-offset-right,
                  0px
                )
            ),
            calc(
              var(--safe-area-offset-top, 0px) - var(
                  --safe-area-offset-bottom,
                  0px
                )
            )
          );
          display: flex;
          flex-direction: column;
          overflow: hidden;
        }

        @media all and (max-width: 450px), all and (max-height: 500px) {
          :host([type="standard"]) {
            --ha-dialog-border-radius: 0;

            wa-dialog {
              /* Make the container fill the whole screen width and not the safe width */
              --full-width: var(--ha-dialog-width-full, 100vw);
              --width: var(--full-width);
            }

            wa-dialog::part(dialog) {
              /* Make the dialog fill the whole screen height and not the safe height */
              min-height: var(--ha-dialog-min-height, 100vh);
              min-height: var(--ha-dialog-min-height, 100dvh);
              max-height: var(--ha-dialog-max-height, 100vh);
              max-height: var(--ha-dialog-max-height, 100dvh);
              margin-top: 0;
              margin-bottom: 0;
              /* Use safe area as padding instead of the container size */
              padding-top: var(--safe-area-inset-top);
              padding-bottom: var(--safe-area-inset-bottom);
              padding-left: var(--safe-area-inset-left);
              padding-right: var(--safe-area-inset-right);
              /* Reset the transform to center the dialog */
              transform: none;
            }
          }
        }

        .header-title-container {
          display: flex;
          align-items: center;
        }

        .header-title {
          margin: 0;
          margin-bottom: 0;
          color: var(--ha-dialog-header-title-color, var(--primary-text-color));
          font-size: var(
            --ha-dialog-header-title-font-size,
            var(--ha-font-size-2xl)
          );
          line-height: var(
            --ha-dialog-header-title-line-height,
            var(--ha-line-height-condensed)
          );
          font-weight: var(
            --ha-dialog-header-title-font-weight,
            var(--ha-font-weight-normal)
          );
          overflow: hidden;
          text-overflow: ellipsis;
          white-space: nowrap;
          margin-right: var(--ha-space-3);
        }

        wa-dialog::part(body) {
          padding: 0;
          display: flex;
          flex-direction: column;
          max-width: 100%;
          overflow: hidden;
        }

        .content-wrapper {
          position: relative;
          flex: 1;
          display: flex;
          flex-direction: column;
          min-height: 0;
        }

        .body {
          position: var(--dialog-content-position, relative);
          padding: var(
            --dialog-content-padding,
            0 var(--ha-space-6) var(--ha-space-6) var(--ha-space-6)
          );
          overflow: auto;
          flex-grow: 1;
        }
        :host([flexcontent]) .body {
          max-width: 100%;
          flex: 1;
          display: flex;
          flex-direction: column;
        }

        wa-dialog::part(footer) {
          padding: 0;
        }

        ::slotted([slot="footer"]) {
          display: flex;
          padding: var(--ha-space-3) var(--ha-space-4) var(--ha-space-4)
            var(--ha-space-4);
          gap: var(--ha-space-3);
          justify-content: flex-end;
          align-items: center;
          width: 100%;
        }
      `]}constructor(...t){super(...t),this.open=!1,this.type="standard",this.width="medium",this.preventScrimClose=!1,this.headerSubtitlePosition="below",this.flexContent=!1,this._open=!1,this._bodyScrolled=!1,this._handleShow=async()=>{this._open=!0,(0,d.r)(this,"opened"),await this.updateComplete,requestAnimationFrame(()=>{if((0,c.V)(this.hass)){const t=this.querySelector("[autofocus]");return void(null!==t&&(t.id||(t.id="ha-wa-dialog-autofocus"),this.hass.auth.external.fireMessage({type:"focus_element",payload:{element_id:t.id}})))}this.querySelector("[autofocus]")?.focus()})},this._handleAfterShow=()=>{(0,d.r)(this,"after-show")},this._handleAfterHide=()=>{this._open=!1,(0,d.r)(this,"closed")}}}(0,s.Cg)([(0,n.MZ)({attribute:!1})],u.prototype,"hass",void 0),(0,s.Cg)([(0,n.MZ)({attribute:"aria-labelledby"})],u.prototype,"ariaLabelledBy",void 0),(0,s.Cg)([(0,n.MZ)({attribute:"aria-describedby"})],u.prototype,"ariaDescribedBy",void 0),(0,s.Cg)([(0,n.MZ)({type:Boolean,reflect:!0})],u.prototype,"open",void 0),(0,s.Cg)([(0,n.MZ)({reflect:!0})],u.prototype,"type",void 0),(0,s.Cg)([(0,n.MZ)({type:String,reflect:!0,attribute:"width"})],u.prototype,"width",void 0),(0,s.Cg)([(0,n.MZ)({type:Boolean,reflect:!0,attribute:"prevent-scrim-close"})],u.prototype,"preventScrimClose",void 0),(0,s.Cg)([(0,n.MZ)({attribute:"header-title"})],u.prototype,"headerTitle",void 0),(0,s.Cg)([(0,n.MZ)({attribute:"header-subtitle"})],u.prototype,"headerSubtitle",void 0),(0,s.Cg)([(0,n.MZ)({type:String,attribute:"header-subtitle-position"})],u.prototype,"headerSubtitlePosition",void 0),(0,s.Cg)([(0,n.MZ)({type:Boolean,reflect:!0,attribute:"flexcontent"})],u.prototype,"flexContent",void 0),(0,s.Cg)([(0,n.wk)()],u.prototype,"_open",void 0),(0,s.Cg)([(0,n.P)(".body")],u.prototype,"bodyContainer",void 0),(0,s.Cg)([(0,n.wk)()],u.prototype,"_bodyScrolled",void 0),(0,s.Cg)([(0,n.Ls)({passive:!0})],u.prototype,"_handleBodyScroll",null),u=(0,s.Cg)([(0,n.EM)("ha-wa-dialog")],u),a()}catch(t){a(t)}})},89859(t,a,e){e.d(a,{xG:()=>l,b3:()=>o,eK:()=>n});e(18111),e(20116);var s=e(62384),i=e(47351);const o=async t=>(0,s.v)(t.config.version,2021,2,4)?t.callWS({type:"supervisor/api",endpoint:"/addons",method:"get"}):(0,i.PS)(await t.callApi("GET","hassio/addons")),n=async(t,a)=>(0,s.v)(t.config.version,2021,2,4)?t.callWS({type:"supervisor/api",endpoint:`/addons/${a}/start`,method:"post",timeout:null}):t.callApi("POST",`hassio/addons/${a}/start`),l=async(t,a)=>{(0,s.v)(t.config.version,2021,2,4)?await t.callWS({type:"supervisor/api",endpoint:`/addons/${a}/install`,method:"post",timeout:null}):await t.callApi("POST",`hassio/addons/${a}/install`)}},15336(t,a,e){e.d(a,{He:()=>r,Ku:()=>o,PB:()=>n,Wq:()=>p,hu:()=>d,mZ:()=>l,v9:()=>h,xY:()=>c});var s=e(62384),i=e(47351);const o=async t=>{if((0,s.v)(t.config.version,2021,2,4))return t.callWS({type:"supervisor/api",endpoint:"/host/info",method:"get"});const a=await t.callApi("GET","hassio/host/info");return(0,i.PS)(a)},n=async t=>(0,s.v)(t.config.version,2021,2,4)?t.callWS({type:"supervisor/api",endpoint:"/os/info",method:"get"}):(0,i.PS)(await t.callApi("GET","hassio/os/info")),l=async t=>(0,s.v)(t.config.version,2021,2,4)?t.callWS({type:"supervisor/api",endpoint:"/host/reboot",method:"post",timeout:null}):t.callApi("POST","hassio/host/reboot"),d=async t=>(0,s.v)(t.config.version,2021,2,4)?t.callWS({type:"supervisor/api",endpoint:"/host/shutdown",method:"post",timeout:null}):t.callApi("POST","hassio/host/shutdown"),r=async(t,a)=>(0,s.v)(t.config.version,2021,2,4)?t.callWS({type:"supervisor/api",endpoint:"/host/options",method:"post",data:a}):t.callApi("POST","hassio/host/options",a),h=async(t,a)=>(0,s.v)(t.config.version,2021,2,4)?t.callWS({type:"supervisor/api",endpoint:"/os/datadisk/move",method:"post",timeout:null,data:{device:a}}):t.callApi("POST","hassio/os/datadisk/move"),c=async t=>(0,s.v)(t.config.version,2021,2,4)?t.callWS({type:"supervisor/api",endpoint:"/os/datadisk/list",method:"get",timeout:null}):(0,i.PS)(await t.callApi("GET","/os/datadisk/list")),p=async t=>(0,s.v)(t.config.version,2021,2,4)?t.callWS({type:"supervisor/api",endpoint:"/host/disks/default/usage",method:"get",timeout:3600,params:{max_depth:3}}):(0,i.PS)(await t.callApi("GET","hassio/host/disks/default/usage"))},59992(t,a,e){e.d(a,{V:()=>d});var s=e(62826),i=e(88696),o=e(96196),n=e(94333),l=e(44457);const d=t=>{class a extends t{get scrollableElement(){return a.DEFAULT_SCROLLABLE_ELEMENT}firstUpdated(t){super.firstUpdated?.(t),this._attachScrollableElement()}updated(t){super.updated?.(t),this._attachScrollableElement()}disconnectedCallback(){this._detachScrollableElement(),super.disconnectedCallback()}renderScrollableFades(t=!1){return o.qy` <div class="${(0,n.H)({"fade-top":!0,rounded:t,visible:this._contentScrolled})}"></div> <div class="${(0,n.H)({"fade-bottom":!0,rounded:t,visible:this._contentScrollable})}"></div> `}static get styles(){const t=Object.getPrototypeOf(this);var a;return[...void 0===(a=t?.styles??[])?[]:Array.isArray(a)?a:[a],o.AH`.fade-bottom,.fade-top{position:absolute;left:0;right:0;height:var(--ha-space-4);pointer-events:none;transition:opacity 180ms ease-in-out;background:linear-gradient(to bottom,var(--shadow-color),transparent);border-radius:var(--ha-border-radius-square);opacity:0}.fade-top{top:0}.fade-bottom{bottom:0;transform:rotate(180deg)}.fade-bottom.visible,.fade-top.visible{opacity:1}.fade-bottom.rounded,.fade-top.rounded{border-radius:var(--ha-card-border-radius,var(--ha-border-radius-lg));border-bottom-left-radius:var(--ha-border-radius-square);border-bottom-right-radius:var(--ha-border-radius-square)}.fade-top.rounded{border-top-left-radius:var(--ha-border-radius-square);border-top-right-radius:var(--ha-border-radius-square)}.fade-bottom.rounded{border-bottom-left-radius:var(--ha-border-radius-square);border-bottom-right-radius:var(--ha-border-radius-square)}`]}_attachScrollableElement(){const t=this.scrollableElement;t!==this._scrollTarget&&(this._detachScrollableElement(),t&&(this._scrollTarget=t,t.addEventListener("scroll",this._onScroll,{passive:!0}),this._resize.observe(t),this._updateScrollableState(t)))}_detachScrollableElement(){this._scrollTarget&&(this._scrollTarget.removeEventListener("scroll",this._onScroll),this._resize.unobserve?.(this._scrollTarget),this._scrollTarget=void 0)}_updateScrollableState(t){const a=parseFloat(getComputedStyle(t).getPropertyValue("--safe-area-inset-bottom"))||0,{scrollHeight:e=0,clientHeight:s=0,scrollTop:i=0}=t;this._contentScrollable=e-s>i+a+this.scrollFadeSafeAreaPadding}constructor(...t){super(...t),this._contentScrolled=!1,this._contentScrollable=!1,this._onScroll=t=>{const a=t.currentTarget;this._contentScrolled=(a.scrollTop??0)>this.scrollFadeThreshold,this._updateScrollableState(a)},this._resize=new i.P(this,{target:null,callback:t=>{const a=t[0]?.target;a&&this._updateScrollableState(a)}}),this.scrollFadeSafeAreaPadding=16,this.scrollFadeThreshold=4}}return a.DEFAULT_SCROLLABLE_ELEMENT=null,(0,s.Cg)([(0,l.wk)()],a.prototype,"_contentScrolled",void 0),(0,s.Cg)([(0,l.wk)()],a.prototype,"_contentScrollable",void 0),a}},59717(t,a,e){e.a(t,async function(t,a){try{e(18111),e(7588),e(13579);var s=e(62826),i=e(96196),o=e(44457),n=e(22786),l=e(36312),d=e(1087),r=(e(38962),e(18350)),h=(e(11382),e(17308),e(2846),e(37832),e(71828),e(65829)),c=(e(59646),e(34127)),p=e(89859),g=e(15336),u=e(46187),m=(e(76127),e(23528)),f=t([r,h,c]);[r,h,c]=f.then?(await f)():f;const v="M19 3H5C3.9 3 3 3.9 3 5V19C3 20.1 3.9 21 5 21H19C20.1 21 21 20.1 21 19V5C21 3.9 20.1 3 19 3M9 17H7V10H9V17M13 17H11V7H13V17M17 17H15V13H17V17Z",b="M12,15.5A3.5,3.5 0 0,1 8.5,12A3.5,3.5 0 0,1 12,8.5A3.5,3.5 0 0,1 15.5,12A3.5,3.5 0 0,1 12,15.5M19.43,12.97C19.47,12.65 19.5,12.33 19.5,12C19.5,11.67 19.47,11.34 19.43,11L21.54,9.37C21.73,9.22 21.78,8.95 21.66,8.73L19.66,5.27C19.54,5.05 19.27,4.96 19.05,5.05L16.56,6.05C16.04,5.66 15.5,5.32 14.87,5.07L14.5,2.42C14.46,2.18 14.25,2 14,2H10C9.75,2 9.54,2.18 9.5,2.42L9.13,5.07C8.5,5.32 7.96,5.66 7.44,6.05L4.95,5.05C4.73,4.96 4.46,5.05 4.34,5.27L2.34,8.73C2.21,8.95 2.27,9.22 2.46,9.37L4.57,11C4.53,11.34 4.5,11.67 4.5,12C4.5,12.33 4.53,12.65 4.57,12.97L2.46,14.63C2.27,14.78 2.21,15.05 2.34,15.27L4.34,18.73C4.46,18.95 4.73,19.03 4.95,18.95L7.44,17.94C7.96,18.34 8.5,18.68 9.13,18.93L9.5,21.58C9.54,21.82 9.75,22 10,22H14C14.25,22 14.46,21.82 14.5,21.58L14.87,18.93C15.5,18.67 16.04,18.34 16.56,17.94L19.05,18.95C19.27,19.03 19.54,18.95 19.66,18.73L21.66,15.27C21.78,15.05 21.73,14.78 21.54,14.63L19.43,12.97Z",_="M10,4H4C2.89,4 2,4.89 2,6V18A2,2 0 0,0 4,20H20A2,2 0 0,0 22,18V8C22,6.89 21.1,6 20,6H12L10,4Z",y="M13,9H11V7H13M13,17H11V11H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z",w="M4,6H2V20A2,2 0 0,0 4,22H18V20H4V6M20,2H8A2,2 0 0,0 6,4V16A2,2 0 0,0 8,18H20A2,2 0 0,0 22,16V4A2,2 0 0,0 20,2M12,14.5V5.5L18,10L12,14.5Z",x="M20.5,11H19V7C19,5.89 18.1,5 17,5H13V3.5A2.5,2.5 0 0,0 10.5,1A2.5,2.5 0 0,0 8,3.5V5H4A2,2 0 0,0 2,7V10.8H3.5C5,10.8 6.2,12 6.2,13.5C6.2,15 5,16.2 3.5,16.2H2V20A2,2 0 0,0 4,22H7.8V20.5C7.8,19 9,17.8 10.5,17.8C12,17.8 13.2,19 13.2,20.5V22H17A2,2 0 0,0 19,20V16H20.5A2.5,2.5 0 0,0 23,13.5A2.5,2.5 0 0,0 20.5,11Z",C={homeassistant:!1,database:!1,media:!1,share:!1,local_addons:!1,addons_mode:"all",addons:[]};class k extends i.WF{firstUpdated(t){super.firstUpdated(t),this._checkDbOption(),(0,l.x)(this.hass,"hassio")&&(this._fetchAddons(),this._fetchStorageInfo())}updated(t){t.has("value")&&(0,l.x)(this.hass,"hassio")&&this.value?.include_addons?.length&&(this._showAddons=!0)}async _fetchAddons(){const{addons:t}=await(0,p.b3)(this.hass);this._addons=t,(0,d.r)(this,"backup-addons-fetched")}async _checkDbOption(){if((0,l.x)(this.hass,"recorder")){const t=await(0,m.Z)(this.hass.connection);this._showDbOption=t.db_in_default_location,!this._showDbOption&&this.value?.include_database&&(this.value.include_database=!1)}else this._showDbOption=!1}async _fetchStorageInfo(){try{this._storageInfo=await(0,g.Wq)(this.hass)}catch(t){this._storageInfo=null}}_hasLocalAddons(t){return t.some(t=>"local"===t.slug)}_setData(t){const a=[...t.media?["media"]:[],...t.share?["share"]:[],...t.local_addons?["addons/local"]:[]],e="custom"===t.addons_mode?t.addons:[];this.value={include_homeassistant:t.homeassistant||t.database||this.forceHomeAssistant,include_addons:e.length?e:void 0,include_all_addons:"all"===t.addons_mode,include_database:t.database,include_folders:a.length?a:void 0},(0,d.r)(this,"value-changed",{value:this.value})}render(){const t=this._getData(this.value,this._showAddons),a=(0,l.x)(this.hass,"hassio");return i.qy` ${this._renderSizeEstimate()} <ha-md-list> <ha-md-list-item> <ha-svg-icon slot="start" .path="${b}"></ha-svg-icon> <span slot="headline"> ${this.hass.localize("ui.panel.config.backup.data.ha_settings")} </span> <span slot="supporting-text"> ${this.forceHomeAssistant?this.hass.localize("ui.panel.config.backup.data.ha_settings_included_description"):this.hass.localize("ui.panel.config.backup.data.ha_settings_description")} </span> <ha-switch id="homeassistant" slot="end" @change="${this._switchChanged}" .checked="${t.homeassistant}" .disabled="${this.forceHomeAssistant||t.database}"></ha-switch> </ha-md-list-item> ${this._showDbOption?i.qy`<ha-md-list-item> <ha-svg-icon slot="start" .path="${v}"></ha-svg-icon> <span slot="headline"> ${this.hass.localize("ui.panel.config.backup.data.history")} </span> <span slot="supporting-text"> ${this.hass.localize("ui.panel.config.backup.data.history_description")} </span> <ha-switch id="database" slot="end" @change="${this._switchChanged}" .checked="${t.database}"></ha-switch> </ha-md-list-item>`:i.s6} ${a?i.qy` <ha-md-list-item> <ha-svg-icon slot="start" .path="${w}"></ha-svg-icon> <span slot="headline"> ${this.hass.localize("ui.panel.config.backup.data.media")} </span> <span slot="supporting-text"> ${this.hass.localize("ui.panel.config.backup.data.media_description")} </span> <ha-switch id="media" slot="end" @change="${this._switchChanged}" .checked="${t.media}"></ha-switch> </ha-md-list-item> <ha-md-list-item> <ha-svg-icon slot="start" .path="${_}"></ha-svg-icon> <span slot="headline"> ${this.hass.localize("ui.panel.config.backup.data.share_folder")} </span> <span slot="supporting-text"> ${this.hass.localize("ui.panel.config.backup.data.share_folder_description")} </span> <ha-switch id="share" slot="end" @change="${this._switchChanged}" .checked="${t.share}"></ha-switch> </ha-md-list-item> ${this._hasLocalAddons(this._addons)?i.qy` <ha-md-list-item> <ha-svg-icon slot="start" .path="${_}"></ha-svg-icon> <span slot="headline"> ${this.hass.localize("ui.panel.config.backup.data.local_addons")} </span> <span slot="supporting-text"> ${this.hass.localize("ui.panel.config.backup.data.local_addons_description")} </span> <ha-switch id="local_addons" slot="end" @change="${this._switchChanged}" .checked="${t.local_addons}"></ha-switch> </ha-md-list-item> `:i.s6} ${this._addons.length?i.qy` <ha-md-list-item> <ha-svg-icon slot="start" .path="${x}"></ha-svg-icon> <span slot="headline"> ${this.hass.localize("ui.panel.config.backup.data.addons")} </span> <span slot="supporting-text"> ${this.hass.localize("ui.panel.config.backup.data.addons_description")} </span> <ha-md-select slot="end" id="addons_mode" @change="${this._selectChanged}" .value="${t.addons_mode}"> <ha-md-select-option value="all"> <div slot="headline"> ${this.hass.localize("ui.panel.config.backup.data.addons_all")} </div> </ha-md-select-option> <ha-md-select-option value="none"> <div slot="headline"> ${this.hass.localize("ui.panel.config.backup.data.addons_none")} </div> </ha-md-select-option> <ha-md-select-option value="custom"> <div slot="headline"> ${this.hass.localize("ui.panel.config.backup.data.addons_custom")} </div> </ha-md-select-option> </ha-md-select> </ha-md-list-item> `:i.s6} `:i.s6} </ha-md-list> ${a&&this._showAddons&&this._addons.length?i.qy` <ha-expansion-panel .header="${"Add-ons"}" outlined expanded> <ha-backup-addons-picker .hass="${this.hass}" .value="${t.addons}" @value-changed="${this._addonsChanged}" .addons="${this._addons}" .hideVersion="${this.hideAddonVersion}"></ha-backup-addons-picker> </ha-expansion-panel> `:i.s6} `}_switchChanged(t){const a=t.currentTarget,e=this._getData(this.value,this._showAddons);this._setData({...e,[a.id]:a.checked})}_selectChanged(t){const a=t.currentTarget,e=this._getData(this.value,this._showAddons);this._setData({...e,[a.id]:a.value}),"addons_mode"===a.id&&(this._showAddons="custom"===a.value)}_addonsChanged(t){t.stopPropagation();const a=t.detail.value,e=this._getData(this.value,this._showAddons);this._setData({...e,addons:a})}_renderSizeEstimate(){if(!(0,l.x)(this.hass,"hassio"))return i.s6;const t=this._getData(this.value,this._showAddons);if(!(t.homeassistant||t.database||t.media||t.share||t.local_addons||"all"===t.addons_mode||"custom"===t.addons_mode&&t.addons.length>0))return i.s6;if(void 0===this._storageInfo)return i.qy` <ha-alert alert-type="info"> <ha-spinner slot="icon"></ha-spinner> ${this.hass.localize("ui.panel.config.backup.data.estimated_size_loading")} </ha-alert> `;if(!this._storageInfo||!this._storageInfo.children)return i.s6;const a=this._estimateBackupSize(t,this._storageInfo,this._addons.length);if(null===a)return i.s6;const{compressedBytes:e,addonsNotAccurate:s}=a;return i.qy` <span class="estimated-size"> <span class="estimated-size-heading"> ${this.hass.localize("ui.panel.config.backup.data.estimated_size")} <ha-svg-icon id="estimated-size-info" .path="${y}"></ha-svg-icon> <ha-tooltip for="estimated-size-info" placement="right"> ${this.hass.localize("ui.panel.config.backup.data.estimated_size_disclaimer")} ${s?i.qy`<br><br>${this.hass.localize("ui.panel.config.backup.data.estimated_size_disclaimer_addons_custom")}`:i.s6} </ha-tooltip> </span> <span class="estimated-size-value"> ${(0,u.A)(e)} </span> </span> `}constructor(...t){super(...t),this.forceHomeAssistant=!1,this.hideAddonVersion=!1,this._addons=[],this._showAddons=!1,this._showDbOption=!0,this._estimateBackupSize=(0,n.A)((t,a,e)=>{if(!a?.children)return null;let s=0;const i={};return a.children.forEach(t=>{i[t.id]=t.used_bytes}),t.homeassistant&&(s+=i.homeassistant??0),t.media&&(s+=i.media??0),t.share&&(s+=i.share??0),("all"===t.addons_mode||"custom"===t.addons_mode&&t.addons.length>0)&&(s+=(i.addons_data??0)+(i.addons_config??0)),{compressedBytes:Math.round(.6*s),addonsNotAccurate:"custom"===t.addons_mode&&t.addons.length>0&&t.addons.length!==e}}),this._getData=(0,n.A)((t,a)=>{if(!t)return C;const e=t,s=e.include_addons?.slice()??[];return{homeassistant:e.include_homeassistant||this.forceHomeAssistant,database:e.include_database,media:e.include_folders?.includes("media")||!1,share:e.include_folders?.includes("share")||!1,local_addons:e.include_folders?.includes("addons/local")||!1,addons_mode:e.include_all_addons?"all":s.length>0||a?"custom":"none",addons:s}})}}k.styles=i.AH`.estimated-size{display:block;margin-top:var(--ha-space-2);font-size:var(--ha-font-size-m)}.estimated-size-heading{font-size:var(--ha-font-size-m);line-height:var(--ha-line-height-expanded)}.estimated-size-heading ha-svg-icon{--mdc-icon-size:16px;color:var(--secondary-text-color);margin-inline-start:var(--ha-space-1);vertical-align:middle}.estimated-size-value{display:block;font-size:var(--ha-font-size-s);color:var(--secondary-text-color)}ha-spinner{--ha-spinner-size:24px}ha-md-list{background:0 0;--md-list-item-leading-space:0;--md-list-item-trailing-space:0}ha-md-list-item{--md-item-overflow:visible}ha-md-select{min-width:210px}@media all and (max-width:450px){ha-md-select{min-width:140px;width:140px;--md-filled-field-content-space:0}}`,(0,s.Cg)([(0,o.MZ)({attribute:!1})],k.prototype,"hass",void 0),(0,s.Cg)([(0,o.MZ)({type:Boolean,attribute:"force-home-assistant"})],k.prototype,"forceHomeAssistant",void 0),(0,s.Cg)([(0,o.MZ)({attribute:"hide-addon-version",type:Boolean})],k.prototype,"hideAddonVersion",void 0),(0,s.Cg)([(0,o.wk)()],k.prototype,"value",void 0),(0,s.Cg)([(0,o.wk)()],k.prototype,"_addons",void 0),(0,s.Cg)([(0,o.wk)()],k.prototype,"_showAddons",void 0),(0,s.Cg)([(0,o.wk)()],k.prototype,"_showDbOption",void 0),(0,s.Cg)([(0,o.wk)()],k.prototype,"_storageInfo",void 0),k=(0,s.Cg)([(0,o.EM)("ha-backup-config-data")],k),a()}catch(t){a(t)}})},76127(t,a,e){e(44114),e(18111),e(22489),e(20116),e(61701);var s=e(62826),i=e(96196),o=e(44457),n=e(22786),l=e(1087),d=e(52220);e(9503),e(6),e(27826);class r extends i.WF{render(){return i.qy` <div class="items"> ${this._addons(this.addons).map(t=>i.qy` <ha-formfield> <ha-backup-formfield-label slot="label" .label="${t.name}" .version="${this.hideVersion?void 0:t.version}" .iconPath="${t.iconPath||"M20.5,11H19V7C19,5.89 18.1,5 17,5H13V3.5A2.5,2.5 0 0,0 10.5,1A2.5,2.5 0 0,0 8,3.5V5H4A2,2 0 0,0 2,7V10.8H3.5C5,10.8 6.2,12 6.2,13.5C6.2,15 5,16.2 3.5,16.2H2V20A2,2 0 0,0 4,22H7.8V20.5C7.8,19 9,17.8 10.5,17.8C12,17.8 13.2,19 13.2,20.5V22H17A2,2 0 0,0 19,20V16H20.5A2.5,2.5 0 0,0 23,13.5A2.5,2.5 0 0,0 20.5,11Z"}" .imageUrl="${this.addons?.find(a=>a.slug===t.slug)?.icon?`/api/hassio/addons/${t.slug}/icon`:void 0}"> </ha-backup-formfield-label> <ha-checkbox .id="${t.slug}" .checked="${this.value?.includes(t.slug)||!1}" @change="${this._checkboxChanged}" .disabled="${this.disabled}"></ha-checkbox> </ha-formfield> `)} </div> `}_checkboxChanged(t){t.stopPropagation();let a=this.value??[];const e=t.currentTarget;e.checked?a.push(e.id):a=a.filter(t=>t!==e.id),(0,l.r)(this,"value-changed",{value:a})}constructor(...t){super(...t),this.hideVersion=!1,this.disabled=!1,this._addons=(0,n.A)(t=>t.sort((t,a)=>(0,d.xL)(t.name,a.name,this.hass?.locale?.language)))}}r.styles=i.AH`.items{display:flex;flex-direction:column}`,(0,s.Cg)([(0,o.MZ)({attribute:!1})],r.prototype,"hass",void 0),(0,s.Cg)([(0,o.MZ)({attribute:!1})],r.prototype,"addons",void 0),(0,s.Cg)([(0,o.MZ)({attribute:!1})],r.prototype,"value",void 0),(0,s.Cg)([(0,o.MZ)({attribute:"hide-version",type:Boolean})],r.prototype,"hideVersion",void 0),(0,s.Cg)([(0,o.MZ)({type:Boolean})],r.prototype,"disabled",void 0),r=(0,s.Cg)([(0,o.EM)("ha-backup-addons-picker")],r)},54164(t,a,e){e.a(t,async function(t,a){try{e(18111),e(61701);var s=e(62826),i=e(96196),o=e(44457),n=e(94333),l=e(1087),d=e(71727),r=(e(9503),e(6),e(67094),e(31420)),h=e(44144),c=t([r]);r=(c.then?(await c)():c)[0];const p="M6,2H18A2,2 0 0,1 20,4V20A2,2 0 0,1 18,22H6A2,2 0 0,1 4,20V4A2,2 0 0,1 6,2M12,4A6,6 0 0,0 6,10C6,13.31 8.69,16 12.1,16L11.22,13.77C10.95,13.29 11.11,12.68 11.59,12.4L12.45,11.9C12.93,11.63 13.54,11.79 13.82,12.27L15.74,14.69C17.12,13.59 18,11.9 18,10A6,6 0 0,0 12,4M12,9A1,1 0 0,1 13,10A1,1 0 0,1 12,11A1,1 0 0,1 11,10A1,1 0 0,1 12,9M7,18A1,1 0 0,0 6,19A1,1 0 0,0 7,20A1,1 0 0,0 8,19A1,1 0 0,0 7,18M12.09,13.27L14.58,19.58L17.17,18.08L12.95,12.77L12.09,13.27Z",g="M4,5C2.89,5 2,5.89 2,7V17C2,18.11 2.89,19 4,19H20C21.11,19 22,18.11 22,17V7C22,5.89 21.11,5 20,5H4M4.5,7A1,1 0 0,1 5.5,8A1,1 0 0,1 4.5,9A1,1 0 0,1 3.5,8A1,1 0 0,1 4.5,7M7,7H20V17H7V7M8,8V16H11V8H8M12,8V16H15V8H12M16,8V16H19V8H16M9,9H10V10H9V9M13,9H14V10H13V9M17,9H18V10H17V9Z";class u extends i.WF{render(){return i.qy` <div class="agents"> ${this.agents.map(t=>this._renderAgent(t))} </div> `}_renderAgent(t){const a=(0,d.m)(t.agent_id),e=(0,r.q7)(this.hass.localize,t.agent_id,this.agents),s=this.disabled||this.disabledAgentIds?.includes(t.agent_id)||!1;return i.qy` <ha-formfield> <span class="label ${(0,n.H)({disabled:s})}" slot="label"> ${(0,r.Bi)(t.agent_id)?i.qy` <ha-svg-icon .path="${p}" slot="start"> </ha-svg-icon> `:(0,r.jU)(t.agent_id)?i.qy` <ha-svg-icon .path="${g}" slot="start"></ha-svg-icon> `:i.qy` <img .src="${(0,h.MR)({domain:a,type:"icon",useFallback:!0,darkOptimized:this.hass.themes?.darkMode})}" crossorigin="anonymous" referrerpolicy="no-referrer" alt="" slot="start"> `} ${e} </span> <ha-checkbox .checked="${this.value.includes(t.agent_id)}" .value="${t.agent_id}" .disabled="${s}" @change="${this._checkboxChanged}"></ha-checkbox> </ha-formfield> `}_checkboxChanged(t){const a=t.target,e=a.value,s=this.value.indexOf(e);a.checked&&-1===s?this.value=[...this.value,e]:a.checked||-1===s||(this.value=[...this.value.slice(0,s),...this.value.slice(s+1)]),(0,l.r)(this,"value-changed",{value:this.value})}constructor(...t){super(...t),this.disabled=!1}}u.styles=i.AH`img{height:24px;width:24px}ha-svg-icon{--mdc-icon-size:24px;color:var(--primary-text-color)}.agents{display:flex;flex-direction:column}.label{display:flex;flex-direction:row;align-items:center;gap:var(--ha-space-4);font-size:var(--ha-font-size-l);font-weight:var(--ha-font-weight-normal);line-height:var(--ha-line-height-normal);letter-spacing:.5px}span.disabled{color:var(--disabled-text-color)}span.disabled ha-svg-icon{color:var(--disabled-text-color)}`,(0,s.Cg)([(0,o.MZ)({attribute:!1})],u.prototype,"hass",void 0),(0,s.Cg)([(0,o.MZ)({type:Boolean})],u.prototype,"disabled",void 0),(0,s.Cg)([(0,o.MZ)({attribute:!1})],u.prototype,"agents",void 0),(0,s.Cg)([(0,o.MZ)({attribute:!1})],u.prototype,"disabledAgentIds",void 0),(0,s.Cg)([(0,o.MZ)({attribute:!1})],u.prototype,"value",void 0),u=(0,s.Cg)([(0,o.EM)("ha-backup-agents-picker")],u),a()}catch(t){a(t)}})},27826(t,a,e){var s=e(62826),i=e(96196),o=e(44457);e(67094);class n extends i.WF{render(){return i.qy` ${this.imageUrl?i.qy`<img loading="lazy" alt="" src="${this.imageUrl}" class="icon">`:this.iconPath?i.qy` <ha-svg-icon .path="${this.iconPath}" class="icon"></ha-svg-icon> `:i.s6} <span class="label"> ${this.label} ${this.version?i.qy`<span class="version">(${this.version})</span>`:i.s6} </span> `}}n.styles=i.AH`:host{display:flex;flex-direction:row;gap:var(--ha-space-4);align-items:center}.label{margin-right:4px;margin-inline-end:4px;margin-inline-start:initial;font-size:var(--ha-font-size-m);font-weight:var(--ha-font-weight-normal);line-height:var(--ha-line-height-normal);letter-spacing:.5px}.version{color:var(--secondary-text-color)}.icon{--mdi-icon-size:24px;width:24px;height:24px}`,(0,s.Cg)([(0,o.MZ)({type:String})],n.prototype,"label",void 0),(0,s.Cg)([(0,o.MZ)({type:String,attribute:"image-url"})],n.prototype,"imageUrl",void 0),(0,s.Cg)([(0,o.MZ)({type:String,attribute:"icon-path"})],n.prototype,"iconPath",void 0),(0,s.Cg)([(0,o.MZ)({type:String})],n.prototype,"version",void 0),n=(0,s.Cg)([(0,o.EM)("ha-backup-formfield-label")],n)},60490(t,a,e){e.a(t,async function(t,s){try{e.r(a);e(18111),e(22489),e(61701);var i=e(62826),o=e(96196),n=e(44457),l=e(36312),d=e(1087),r=(e(38962),e(18350)),h=(e(76538),e(11382),e(26300),e(93444),e(45100),e(45331)),c=(e(17308),e(2846),e(37832),e(71828),e(75709),e(31420)),p=e(14503),g=e(59717),u=e(54164),m=t([r,h,g,u,c]);[r,h,g,u,c]=m.then?(await m)():m;const f="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z",v={data:{include_homeassistant:!0,include_database:!0,include_folders:[],include_all_addons:!0},name:"",agents_mode:"all",agent_ids:[]},b=["data","sync"],_=[c.oJ];class y extends o.WF{showDialog(t){this._step=b[0],this._formData=v,this._params=t,this._open=!0,this._fetchAgents(),this._fetchBackupConfig()}_dialogClosed(){this._params.cancel&&this._params.cancel(),this._open=!1,this._step=void 0,this._formData=void 0,this._agents=[],this._backupConfig=void 0,this._params=void 0,(0,d.r)(this,"dialog-closed",{dialog:this.localName})}async _fetchAgents(){const{agents:t}=await(0,c.P_)(this.hass);this._agents=t.filter(t=>t.agent_id!==c.oJ||this._params?.cloudStatus?.logged_in&&this._params?.cloudStatus?.active_subscription).sort((t,a)=>(0,c.yj)(t.agent_id,a.agent_id))}async _fetchBackupConfig(){const{config:t}=await(0,c.Xm)(this.hass);this._backupConfig=t}closeDialog(){return this._open=!1,!0}_previousStep(){const t=b.indexOf(this._step);0!==t&&(this._step=b[t-1])}_nextStep(){const t=b.indexOf(this._step);t!==b.length-1&&(this._step=b[t+1])}get _allAgentIds(){return this._agents.map(t=>t.agent_id)}willUpdate(t){if(super.willUpdate(t),t.has("_step")&&"sync"===this._step&&this._formData){const t=this._disabledAgentIds();if(t.length){const a=("all"===this._formData.agents_mode?this._allAgentIds:this._formData.agent_ids).filter(a=>!t.includes(a));this._formData={...this._formData,agents_mode:"custom",agent_ids:a}}}}render(){if(!this._step||!this._formData)return o.s6;const t=this.hass.localize(`ui.panel.config.backup.dialogs.generate.${this._step}.title`),a=this._step===b[0],e=this._step===b[b.length-1],s=this._formData.agent_ids;return o.qy` <ha-wa-dialog .hass="${this.hass}" .open="${this._open}" @closed="${this._dialogClosed}"> <ha-dialog-header slot="header"> ${a?o.qy` <ha-icon-button slot="navigationIcon" data-dialog="close" .label="${this.hass.localize("ui.common.close")}" .path="${f}"></ha-icon-button> `:o.qy` <ha-icon-button-prev slot="navigationIcon" @click="${this._previousStep}"></ha-icon-button-prev> `} <span slot="title" .title="${t}"> ${t} </span> </ha-dialog-header> <div class="content"> ${"data"===this._step?this._renderData():this._renderSync()} </div> <ha-dialog-footer slot="footer"> ${a?o.qy` <ha-button slot="secondaryAction" @click="${this.closeDialog}" appearance="plain"> ${this.hass.localize("ui.common.cancel")} </ha-button> `:o.s6} ${e?o.qy` <ha-button slot="primaryAction" @click="${this._submit}" .disabled="${"custom"===this._formData.agents_mode&&!s.length}"> ${this.hass.localize("ui.panel.config.backup.dialogs.generate.actions.create")} </ha-button> `:o.qy` <ha-button slot="primaryAction" @click="${this._nextStep}" .disabled="${"data"===this._step&&this._noDataSelected}"> ${this.hass.localize("ui.common.next")} </ha-button> `} </ha-dialog-footer> </ha-wa-dialog> `}get _noDataSelected(){const t=(0,l.x)(this.hass,"hassio");return!(this._formData?.data.include_homeassistant||this._formData?.data.include_database||t&&this._formData?.data.include_folders?.length||t&&this._formData?.data.include_all_addons||t&&this._formData?.data.include_addons?.length)}_renderData(){return this._formData?o.qy` <ha-backup-config-data .hass="${this.hass}" .value="${this._formData.data}" @value-changed="${this._dataConfigChanged}"></ha-backup-config-data> `:o.s6}_dataConfigChanged(t){t.stopPropagation();const a=t.detail.value;this._formData={...this._formData,data:a}}_renderSync(){if(!this._formData)return o.s6;const t=this._disabledAgentIds();return o.qy` <ha-textfield name="name" .label="${this.hass.localize("ui.panel.config.backup.dialogs.generate.sync.name")}" .value="${this._formData.name}" @change="${this._nameChanged}"> </ha-textfield> <ha-md-list> <ha-md-list-item> <span slot="headline"> ${this.hass.localize("ui.panel.config.backup.dialogs.generate.sync.locations")} </span> <span slot="supporting-text"> ${this.hass.localize("ui.panel.config.backup.dialogs.generate.sync.locations_description")} </span> <ha-md-select slot="end" id="agents_mode" @change="${this._selectChanged}" .value="${this._formData.agents_mode}"> <ha-md-select-option value="all" .disabled="${t.length}"> <div slot="headline"> ${this.hass.localize("ui.panel.config.backup.dialogs.generate.sync.locations_options.all",{count:this._allAgentIds.length})} </div> </ha-md-select-option> <ha-md-select-option value="custom"> <div slot="headline"> ${this.hass.localize("ui.panel.config.backup.dialogs.generate.sync.locations_options.custom")} </div> </ha-md-select-option> </ha-md-select> </ha-md-list-item> </ha-md-list> ${t.length?o.qy` <ha-alert alert-type="info" .title="${this.hass.localize("ui.panel.config.backup.dialogs.generate.sync.ha_cloud_alert.title")}"> ${this.hass.localize("ui.panel.config.backup.dialogs.generate.sync.ha_cloud_alert.description")} </ha-alert> `:o.s6} ${"custom"===this._formData.agents_mode?o.qy` <ha-expansion-panel .header="${this.hass.localize("ui.panel.config.backup.dialogs.generate.sync.locations")}" outlined expanded> <ha-backup-agents-picker .hass="${this.hass}" .value="${this._formData.agent_ids}" @value-changed="${this._agentsChanged}" .agents="${this._agents}" .disabledAgentIds="${t}"></ha-backup-agents-picker> </ha-expansion-panel> `:o.s6} `}_selectChanged(t){const a=t.currentTarget;this._formData={...this._formData,[a.id]:a.value}}_agentsChanged(t){this._formData={...this._formData,agent_ids:t.detail.value}}_nameChanged(t){this._formData={...this._formData,name:t.target.value}}_disabledAgentIds(){if(!this._formData)return[];const t=this._allAgentIds;return this._formData.data.include_homeassistant?[]:_.filter(a=>t.includes(a))}async _submit(){if(!this._formData)return;const{agent_ids:t,agents_mode:a,name:e,data:s}=this._formData,i={name:e,password:this._backupConfig?.create_backup.password||void 0,agent_ids:"all"===a?this._allAgentIds:t,include_homeassistant:s.include_homeassistant||s.include_database,include_database:s.include_database};(0,l.x)(this.hass,"hassio")&&(i.include_folders=s.include_folders,i.include_all_addons=s.include_all_addons,i.include_addons=s.include_addons),i.include_homeassistant||(i.agent_ids=i.agent_ids.filter(t=>!_.includes(t))),this._params.submit?.(i),this.closeDialog()}static get styles(){return[p.RF,p.nA,o.AH`ha-wa-dialog{--dialog-content-padding:24px}ha-md-list{background:0 0;padding:0}ha-md-list-item{--md-list-item-leading-space:0;--md-list-item-trailing-space:0}ha-md-list-item ha-md-select{min-width:210px}@media all and (max-width:450px){ha-md-list-item ha-md-select{min-width:160px;width:160px}}ha-md-list-item ha-md-select>span{text-overflow:ellipsis;overflow:hidden;white-space:nowrap}ha-md-list-item ha-md-select-option{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}ha-textfield{width:100%}.content{padding-top:0}ha-alert{margin-bottom:16px;display:block}`]}constructor(...t){super(...t),this._agents=[],this._open=!1}}(0,i.Cg)([(0,n.MZ)({attribute:!1})],y.prototype,"hass",void 0),(0,i.Cg)([(0,n.wk)()],y.prototype,"_step",void 0),(0,i.Cg)([(0,n.wk)()],y.prototype,"_agents",void 0),(0,i.Cg)([(0,n.wk)()],y.prototype,"_backupConfig",void 0),(0,i.Cg)([(0,n.wk)()],y.prototype,"_params",void 0),(0,i.Cg)([(0,n.wk)()],y.prototype,"_formData",void 0),(0,i.Cg)([(0,n.wk)()],y.prototype,"_open",void 0),y=(0,i.Cg)([(0,n.EM)("ha-dialog-generate-backup")],y),s()}catch(t){s(t)}})},99793(t,a,e){e.d(a,{A:()=>s});const s=e(96196).AH`:host{--width:31rem;--spacing:var(--wa-space-l);--show-duration:200ms;--hide-duration:200ms;display:none}:host([open]){display:block}.dialog{display:flex;flex-direction:column;top:0;right:0;bottom:0;left:0;width:var(--width);max-width:calc(100% - var(--wa-space-2xl));max-height:calc(100% - var(--wa-space-2xl));background-color:var(--wa-color-surface-raised);border-radius:var(--wa-panel-border-radius);border:none;box-shadow:var(--wa-shadow-l);padding:0;margin:auto}.dialog.show{animation:show-dialog var(--show-duration) ease}.dialog.show::backdrop{animation:show-backdrop var(--show-duration,200ms) ease}.dialog.hide{animation:show-dialog var(--hide-duration) ease reverse}.dialog.hide::backdrop{animation:show-backdrop var(--hide-duration,200ms) ease reverse}.dialog.pulse{animation:pulse 250ms ease}.dialog:focus{outline:0}@media screen and (max-width:420px){.dialog{max-height:80vh}}.open{display:flex;opacity:1}.header{flex:0 0 auto;display:flex;flex-wrap:nowrap;padding-inline-start:var(--spacing);padding-block-end:0;padding-inline-end:calc(var(--spacing) - var(--wa-form-control-padding-block));padding-block-start:calc(var(--spacing) - var(--wa-form-control-padding-block))}.title{align-self:center;flex:1 1 auto;font-family:inherit;font-size:var(--wa-font-size-l);font-weight:var(--wa-font-weight-heading);line-height:var(--wa-line-height-condensed);margin:0}.header-actions{align-self:start;display:flex;flex-shrink:0;flex-wrap:wrap;justify-content:end;gap:var(--wa-space-2xs);padding-inline-start:var(--spacing)}.header-actions ::slotted(wa-button),.header-actions wa-button{flex:0 0 auto;display:flex;align-items:center}.body{flex:1 1 auto;display:block;padding:var(--spacing);overflow:auto;-webkit-overflow-scrolling:touch}.body:focus{outline:0}.body:focus-visible{outline:var(--wa-focus-ring);outline-offset:var(--wa-focus-ring-offset)}.footer{flex:0 0 auto;display:flex;flex-wrap:wrap;gap:var(--wa-space-xs);justify-content:end;padding:var(--spacing);padding-block-start:0}.footer ::slotted(wa-button:not(:first-of-type)){margin-inline-start:var(--wa-spacing-xs)}.dialog::backdrop{background-color:var(--wa-color-overlay-modal,rgb(0 0 0 / .25))}@keyframes pulse{0%{scale:1}50%{scale:1.02}100%{scale:1}}@keyframes show-dialog{from{opacity:0;scale:0.8}to{opacity:1;scale:1}}@keyframes show-backdrop{from{opacity:0}to{opacity:1}}@media (forced-colors:active){.dialog{border:solid 1px #fff}}`},93900(t,a,e){e.a(t,async function(t,a){try{var s=e(96196),i=e(44457),o=e(94333),n=e(32288),l=e(17051),d=e(42462),r=e(28438),h=e(98779),c=e(27259),p=e(31247),g=e(97039),u=e(92070),m=e(9395),f=e(32510),v=e(17060),b=e(88496),_=e(99793),y=t([b,v]);[b,v]=y.then?(await y)():y;var w=Object.defineProperty,x=Object.getOwnPropertyDescriptor,C=(t,a,e,s)=>{for(var i,o=s>1?void 0:s?x(a,e):a,n=t.length-1;n>=0;n--)(i=t[n])&&(o=(s?i(a,e,o):i(o))||o);return s&&o&&w(a,e,o),o};let k=class extends f.A{firstUpdated(){this.open&&(this.addOpenListeners(),this.dialog.showModal(),(0,g.JG)(this))}disconnectedCallback(){super.disconnectedCallback(),(0,g.I7)(this),this.removeOpenListeners()}async requestClose(t){const a=new r.L({source:t});if(this.dispatchEvent(a),a.defaultPrevented)return this.open=!0,void(0,c.Ud)(this.dialog,"pulse");this.removeOpenListeners(),await(0,c.Ud)(this.dialog,"hide"),this.open=!1,this.dialog.close(),(0,g.I7)(this);const e=this.originalTrigger;"function"==typeof e?.focus&&setTimeout(()=>e.focus()),this.dispatchEvent(new l.Z)}addOpenListeners(){document.addEventListener("keydown",this.handleDocumentKeyDown)}removeOpenListeners(){document.removeEventListener("keydown",this.handleDocumentKeyDown)}handleDialogCancel(t){t.preventDefault(),this.dialog.classList.contains("hide")||t.target!==this.dialog||this.requestClose(this.dialog)}handleDialogClick(t){const a=t.target.closest('[data-dialog="close"]');a&&(t.stopPropagation(),this.requestClose(a))}async handleDialogPointerDown(t){t.target===this.dialog&&(this.lightDismiss?this.requestClose(this.dialog):await(0,c.Ud)(this.dialog,"pulse"))}handleOpenChange(){this.open&&!this.dialog.open?this.show():!this.open&&this.dialog.open&&(this.open=!0,this.requestClose(this.dialog))}async show(){const t=new h.k;this.dispatchEvent(t),t.defaultPrevented?this.open=!1:(this.addOpenListeners(),this.originalTrigger=document.activeElement,this.open=!0,this.dialog.showModal(),(0,g.JG)(this),requestAnimationFrame(()=>{const t=this.querySelector("[autofocus]");t&&"function"==typeof t.focus?t.focus():this.dialog.focus()}),await(0,c.Ud)(this.dialog,"show"),this.dispatchEvent(new d.q))}render(){const t=!this.withoutHeader,a=this.hasSlotController.test("footer");return s.qy` <dialog aria-labelledby="${this.ariaLabelledby??"title"}" aria-describedby="${(0,n.J)(this.ariaDescribedby)}" part="dialog" class="${(0,o.H)({dialog:!0,open:this.open})}" @cancel="${this.handleDialogCancel}" @click="${this.handleDialogClick}" @pointerdown="${this.handleDialogPointerDown}"> ${t?s.qy` <header part="header" class="header"> <h2 part="title" class="title" id="title"> <slot name="label"> ${this.label.length>0?this.label:String.fromCharCode(8203)} </slot> </h2> <div part="header-actions" class="header-actions"> <slot name="header-actions"></slot> <wa-button part="close-button" exportparts="base:close-button__base" class="close" appearance="plain" @click="${t=>this.requestClose(t.target)}"> <wa-icon name="xmark" label="${this.localize.term("close")}" library="system" variant="solid"></wa-icon> </wa-button> </div> </header> `:""} <div part="body" class="body"><slot></slot></div> ${a?s.qy` <footer part="footer" class="footer"> <slot name="footer"></slot> </footer> `:""} </dialog> `}constructor(){super(...arguments),this.localize=new v.c(this),this.hasSlotController=new u.X(this,"footer","header-actions","label"),this.open=!1,this.label="",this.withoutHeader=!1,this.lightDismiss=!1,this.handleDocumentKeyDown=t=>{"Escape"===t.key&&this.open&&(t.preventDefault(),t.stopPropagation(),this.requestClose(this.dialog))}}};k.css=_.A,C([(0,i.P)(".dialog")],k.prototype,"dialog",2),C([(0,i.MZ)({type:Boolean,reflect:!0})],k.prototype,"open",2),C([(0,i.MZ)({reflect:!0})],k.prototype,"label",2),C([(0,i.MZ)({attribute:"without-header",type:Boolean,reflect:!0})],k.prototype,"withoutHeader",2),C([(0,i.MZ)({attribute:"light-dismiss",type:Boolean})],k.prototype,"lightDismiss",2),C([(0,i.MZ)({attribute:"aria-labelledby"})],k.prototype,"ariaLabelledby",2),C([(0,i.MZ)({attribute:"aria-describedby"})],k.prototype,"ariaDescribedby",2),C([(0,m.w)("open",{waitUntilFirstUpdate:!0})],k.prototype,"handleOpenChange",1),k=C([(0,i.EM)("wa-dialog")],k),document.addEventListener("click",t=>{const a=t.target.closest("[data-dialog]");if(a instanceof Element){const[t,e]=(0,p.v)(a.getAttribute("data-dialog")||"");if("open"===t&&e?.length){const t=a.getRootNode().getElementById(e);"wa-dialog"===t?.localName?t.open=!0:console.warn(`A dialog with an ID of "${e}" could not be found in this document.`)}}}),s.S$||document.addEventListener("pointerdown",()=>{}),a()}catch(t){a(t)}})},91081(t,a,e){function s(t,a){return{top:Math.round(t.getBoundingClientRect().top-a.getBoundingClientRect().top),left:Math.round(t.getBoundingClientRect().left-a.getBoundingClientRect().left)}}e.d(a,{A:()=>s})},31247(t,a,e){e.d(a,{v:()=>s});e(18111),e(22489),e(61701);function s(t){return t.split(" ").map(t=>t.trim()).filter(t=>""!==t)}},97039(t,a,e){e.d(a,{I7:()=>n,JG:()=>o,Rt:()=>l});e(17642),e(58004),e(33853),e(45876),e(32475),e(15024),e(31698);var s=e(91081);const i=new Set;function o(t){if(i.add(t),!document.documentElement.classList.contains("wa-scroll-lock")){const t=function(){const t=document.documentElement.clientWidth;return Math.abs(window.innerWidth-t)}()+function(){const t=Number(getComputedStyle(document.body).paddingRight.replace(/px/,""));return isNaN(t)||!t?0:t}();let a=getComputedStyle(document.documentElement).scrollbarGutter;a&&"auto"!==a||(a="stable"),t<2&&(a=""),document.documentElement.style.setProperty("--wa-scroll-lock-gutter",a),document.documentElement.classList.add("wa-scroll-lock"),document.documentElement.style.setProperty("--wa-scroll-lock-size",`${t}px`)}}function n(t){i.delete(t),0===i.size&&(document.documentElement.classList.remove("wa-scroll-lock"),document.documentElement.style.removeProperty("--wa-scroll-lock-size"))}function l(t,a,e="vertical",i="smooth"){const o=(0,s.A)(t,a),n=o.top+a.scrollTop,l=o.left+a.scrollLeft,d=a.scrollLeft,r=a.scrollLeft+a.offsetWidth,h=a.scrollTop,c=a.scrollTop+a.offsetHeight;"horizontal"!==e&&"both"!==e||(l<d?a.scrollTo({left:l,behavior:i}):l+t.clientWidth>r&&a.scrollTo({left:l-a.offsetWidth+t.clientWidth,behavior:i})),"vertical"!==e&&"both"!==e||(n<h?a.scrollTo({top:n,behavior:i}):n+t.clientHeight>c&&a.scrollTo({top:n-a.offsetHeight+t.clientHeight,behavior:i}))}}};
//# sourceMappingURL=6839.54e49e3c7bf48e7c.js.map