iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
10 lines • 30.8 kB
JavaScript
export const __rspack_esm_id=67723;export const __rspack_esm_ids=[67723];export const __webpack_modules__={32656(e,t,a){a.a(e,async function(e,t){try{a(74423);var i=a(62826),s=a(5124),o=a(22441),n=a(63672),l=a(1087),r=a(57237),h=a(26300),p=(a(3449),a(606)),d=a(91485),c=e([h,p,d]);[h,p,d]=c.then?(await c)():c;const u="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 g extends s.WF{reportValidity(){const e=this._inputs;return!e||[...e].every(e=>e.reportValidity())}render(){return s.qy` ${this.label?s.qy`<label>${this.label}${this.required?" *":""}</label>`:s.s6} <div class="time-input-wrap-wrap"> <div class="time-input-wrap"> ${this.enableDay?s.qy` <ha-input id="day" type="number" inputmode="numeric" .value="${this.days.toFixed()}" .label="${this.placeholderLabels?"":this.dayLabel}" .placeholder="${this.placeholderLabels?this.dayLabel:""}" name="days" ="${this._valueChanged}" ="${this._onFocus}" without-spin-buttons .required="${this.required}" .autoValidate="${this.autoValidate}" min="0" .disabled="${this.disabled}"> </ha-input> <div class="time-separator">:</div> `:s.s6} <ha-input id="hour" type="number" inputmode="numeric" .value="${this.hours.toFixed()}" .label="${this.placeholderLabels?"":this.hourLabel}" .placeholder="${this.placeholderLabels?this.hourLabel:""}" name="hours" ="${this._valueChanged}" ="${this._onFocus}" without-spin-buttons .required="${this.required}" .autoValidate="${this.autoValidate}" maxlength="2" max="${(0,n.J)(this._hourMax)}" min="0" .disabled="${this.disabled}"> </ha-input> <div class="time-separator">:</div> <ha-input id="min" type="number" inputmode="numeric" .value="${this._formatValue(this.minutes)}" .label="${this.placeholderLabels?"":this.minLabel}" .placeholder="${this.placeholderLabels?this.minLabel:""}" ="${this._valueChanged}" ="${this._onFocus}" name="minutes" without-spin-buttons .required="${this.required}" .autoValidate="${this.autoValidate}" maxlength="2" max="59" min="0" .disabled="${this.disabled}"> </ha-input> ${this.enableSecond?s.qy`<div class="time-separator">:</div>`:s.s6} ${this.enableSecond?s.qy`<ha-input id="sec" type="number" inputmode="decimal" step="any" .value="${this._formatValue(this.seconds)}" .label="${this.placeholderLabels?"":this.secLabel}" .placeholder="${this.placeholderLabels?this.secLabel:""}" ="${this._valueChanged}" ="${this._onFocus}" name="seconds" without-spin-buttons .required="${this.required}" .autoValidate="${this.autoValidate}" max="59" min="0" .disabled="${this.disabled}"> </ha-input> ${this.enableMillisecond?s.qy`<div class="time-separator">:</div>`:s.s6}`:s.s6} ${this.enableMillisecond?s.qy`<ha-input id="millisec" type="number" .value="${this._formatValue(this.milliseconds,3)}" .label="${this.placeholderLabels?"":this.millisecLabel}" .placeholder="${this.placeholderLabels?this.millisecLabel:""}" ="${this._valueChanged}" ="${this._onFocus}" name="milliseconds" without-spin-buttons .required="${this.required}" .autoValidate="${this.autoValidate}" maxlength="3" max="999" min="0" .disabled="${this.disabled}"> </ha-input>`:s.s6} ${24===this.format?s.s6:s.qy`<ha-select .required="${this.required}" .value="${this.amPm}" .disabled="${this.disabled}" .name="${"amPm"}" ="${this._valueChanged}" -after-hide="${r.d}" -hide="${r.d}" .options="${["AM","PM"]}"> </ha-select>`} ${!this.clearable||this.required||this.disabled?s.s6:s.qy`<ha-icon-button label="clear" ="${this._clearValue}" .path="${u}"></ha-icon-button>`} </div> </div> ${this.helper?s.qy`<ha-input-helper-text .disabled="${this.disabled}">${this.helper}</ha-input-helper-text>`:s.s6} `}_clearValue(){(0,l.r)(this,"value-changed")}_valueChanged(e){const t=e.currentTarget;this[t.name||""]="amPm"===t.name?e.detail.value:Number(t.value);const a={hours:this.hours,minutes:this.minutes,seconds:this.seconds,milliseconds:this.milliseconds};this.enableDay&&(a.days=this.days),12===this.format&&(a.amPm=this.amPm),(0,l.r)(this,"value-changed",{value:a})}_onFocus(e){e.currentTarget.select()}_formatValue(e,t=2){const a=e.toString();return a.includes(".")?a:a.padStart(t,"0")}get _hourMax(){if(!this.noHoursLimit)return 12===this.format?12:23}constructor(...e){super(...e),this.autoValidate=!1,this.required=!1,this.format=12,this.disabled=!1,this.days=0,this.hours=0,this.minutes=0,this.seconds=0,this.milliseconds=0,this.dayLabel="",this.hourLabel="",this.minLabel="",this.secLabel="",this.millisecLabel="",this.enableSecond=!1,this.enableMillisecond=!1,this.enableDay=!1,this.noHoursLimit=!1,this.amPm="AM",this.placeholderLabels=!1}}g.shadowRootOptions={...s.WF.shadowRootOptions,delegatesFocus:!0},g.styles=s.AH`:host([clearable]){position:relative}.time-input-wrap-wrap{display:flex}.time-input-wrap{display:flex;flex:var(--time-input-flex,unset);border-radius:var(--mdc-shape-small,var(--ha-border-radius-sm)) var(--mdc-shape-small,var(--ha-border-radius-sm)) var(--ha-border-radius-square) var(--ha-border-radius-square);overflow:hidden;position:relative;direction:ltr;padding-right:3px}ha-input{height:56px;padding:0;width:60px;flex-grow:1}ha-input:first-child{--text-field-border-top-left-radius:var(--mdc-shape-medium)}ha-input:last-child{--text-field-border-top-right-radius:var(--mdc-shape-medium)}ha-input::part(wa-base){padding:var(--ha-space-1)}ha-input:first-child::part(wa-base){padding-inline-start:var(--ha-space-4)}ha-input:last-child::part(wa-base){padding-inline-end:var(--ha-space-4)}ha-input::part(wa-hint){height:0}ha-input::part(wa-input){text-align:center}.time-separator,ha-icon-button{background-color:var(--ha-color-form-background);color:var(--ha-color-text-secondary);border-bottom:1px solid var(--ha-color-border-neutral-loud);box-sizing:border-box;height:56px;margin-inline-start:calc(var(--ha-space-1) * -1)}.time-separator{width:12px;margin-inline-end:calc(var(--ha-space-1) * -1);display:flex;align-items:center;justify-content:center}:host([clearable]) .mdc-select__anchor{padding-inline-end:var(--select-selected-text-padding-end,12px)}ha-icon-button{position:relative;--ha-icon-button-size:36px;border-start-end-radius:var(--ha-border-radius-sm);--mdc-icon-size:20px;direction:var(--direction);display:flex;align-items:center}ha-select{margin-inline:calc(var(--ha-space-1) * -1)}label{-moz-osx-font-smoothing:var(--ha-moz-osx-font-smoothing);-webkit-font-smoothing:var(--ha-font-smoothing);font-family:var(
--mdc-typography-body2-font-family,
var(--mdc-typography-font-family, var(--ha-font-family-body))
);font-size:var(--mdc-typography-body2-font-size, var(--ha-font-size-s));line-height:var(
--mdc-typography-body2-line-height,
var(--ha-line-height-condensed)
);font-weight:var(--mdc-typography-body2-font-weight,var(--ha-font-weight-normal));letter-spacing:var(
--mdc-typography-body2-letter-spacing,
.0178571429em
);text-decoration:var(--mdc-typography-body2-text-decoration,inherit);text-transform:var(--mdc-typography-body2-text-transform,inherit);color:var(--mdc-theme-text-primary-on-background,rgba(0,0,0,.87));padding-left:4px;padding-inline-start:4px;padding-inline-end:initial}ha-input-helper-text{padding-top:8px;line-height:var(--ha-line-height-condensed)}`,(0,i.Cg)([(0,o.MZ)()],g.prototype,"label",void 0),(0,i.Cg)([(0,o.MZ)()],g.prototype,"helper",void 0),(0,i.Cg)([(0,o.MZ)({attribute:"auto-validate",type:Boolean})],g.prototype,"autoValidate",void 0),(0,i.Cg)([(0,o.MZ)({type:Boolean})],g.prototype,"required",void 0),(0,i.Cg)([(0,o.MZ)({type:Number})],g.prototype,"format",void 0),(0,i.Cg)([(0,o.MZ)({type:Boolean})],g.prototype,"disabled",void 0),(0,i.Cg)([(0,o.MZ)({type:Number})],g.prototype,"days",void 0),(0,i.Cg)([(0,o.MZ)({type:Number})],g.prototype,"hours",void 0),(0,i.Cg)([(0,o.MZ)({type:Number})],g.prototype,"minutes",void 0),(0,i.Cg)([(0,o.MZ)({type:Number})],g.prototype,"seconds",void 0),(0,i.Cg)([(0,o.MZ)({type:Number})],g.prototype,"milliseconds",void 0),(0,i.Cg)([(0,o.MZ)({type:String,attribute:"day-label"})],g.prototype,"dayLabel",void 0),(0,i.Cg)([(0,o.MZ)({type:String,attribute:"hour-label"})],g.prototype,"hourLabel",void 0),(0,i.Cg)([(0,o.MZ)({type:String,attribute:"min-label"})],g.prototype,"minLabel",void 0),(0,i.Cg)([(0,o.MZ)({type:String,attribute:"sec-label"})],g.prototype,"secLabel",void 0),(0,i.Cg)([(0,o.MZ)({type:String,attribute:"ms-label"})],g.prototype,"millisecLabel",void 0),(0,i.Cg)([(0,o.MZ)({attribute:"enable-second",type:Boolean})],g.prototype,"enableSecond",void 0),(0,i.Cg)([(0,o.MZ)({attribute:"enable-millisecond",type:Boolean})],g.prototype,"enableMillisecond",void 0),(0,i.Cg)([(0,o.MZ)({attribute:"enable-day",type:Boolean})],g.prototype,"enableDay",void 0),(0,i.Cg)([(0,o.MZ)({attribute:"no-hours-limit",type:Boolean})],g.prototype,"noHoursLimit",void 0),(0,i.Cg)([(0,o.MZ)({attribute:!1})],g.prototype,"amPm",void 0),(0,i.Cg)([(0,o.MZ)({type:Boolean,reflect:!0})],g.prototype,"clearable",void 0),(0,i.Cg)([(0,o.MZ)({attribute:"placeholder-labels",type:Boolean})],g.prototype,"placeholderLabels",void 0),(0,i.Cg)([(0,o.YG)("ha-input")],g.prototype,"_inputs",void 0),g=(0,i.Cg)([(0,o.EM)("ha-base-time-input")],g),t()}catch(e){t(e)}})},50286(e,t,a){a.a(e,async function(e,t){try{var i=a(62826),s=a(5124),o=a(22441),n=a(69543),l=a(1087),r=a(32656),h=e([r]);r=(h.then?(await h)():h)[0];class p extends s.WF{reportValidity(){return this._input?.reportValidity()??!0}render(){const e=(0,n.J)(this.locale);let t=NaN,a=NaN,i=NaN,o=0;if(this.value){const s=this.value?.split(":")||[];a=s[1]?Number(s[1]):0,i=s[2]?Number(s[2]):0,t=s[0]?Number(s[0]):0,o=t,o&&e&&o>12&&o<24&&(t=o-12),e&&0===o&&(t=12)}return s.qy` <ha-base-time-input .label="${this.label}" .hours="${t}" .minutes="${a}" .seconds="${i}" .format="${e?12:24}" .amPm="${e&&o>=12?"PM":"AM"}" .disabled="${this.disabled}" -changed="${this._timeChanged}" .enableSecond="${this.enableSecond}" .required="${this.required}" .clearable="${this.clearable&&void 0!==this.value}" .helper="${this.helper}" .placeholderLabels="${this.placeholderLabels}" .autoValidate="${this.autoValidate}" day-label="dd" hour-label="hh" min-label="mm" sec-label="ss" ms-label="ms"></ha-base-time-input> `}_timeChanged(e){e.stopPropagation();const t=e.detail.value,a=(0,n.J)(this.locale);let i,s=0;if(!(void 0===t||isNaN(t.hours)&&isNaN(t.minutes)&&isNaN(t.seconds))){let e=t.hours||0;t&&a&&(s=e>=12&&e<24?e-12:0===e?12:0,"PM"===t.amPm&&e<12&&(e+=12),"AM"===t.amPm&&12===e&&(e=0)),i=`${e.toString().padStart(2,"0")}:${t.minutes?t.minutes.toString().padStart(2,"0"):"00"}:${t.seconds?t.seconds.toString().padStart(2,"0"):"00"}`}s&&this.updateComplete.then(()=>{const e=this._input;e&&(e.hours=s)}),i!==this.value&&(this.value=i,(0,l.r)(this,"change"),(0,l.r)(this,"value-changed",{value:i}))}constructor(...e){super(...e),this.disabled=!1,this.required=!1,this.autoValidate=!1,this.enableSecond=!1,this.placeholderLabels=!1}}(0,i.Cg)([(0,o.MZ)({attribute:!1})],p.prototype,"locale",void 0),(0,i.Cg)([(0,o.MZ)()],p.prototype,"value",void 0),(0,i.Cg)([(0,o.MZ)()],p.prototype,"label",void 0),(0,i.Cg)([(0,o.MZ)()],p.prototype,"helper",void 0),(0,i.Cg)([(0,o.MZ)({type:Boolean})],p.prototype,"disabled",void 0),(0,i.Cg)([(0,o.MZ)({type:Boolean})],p.prototype,"required",void 0),(0,i.Cg)([(0,o.MZ)({attribute:"auto-validate",type:Boolean})],p.prototype,"autoValidate",void 0),(0,i.Cg)([(0,o.MZ)({type:Boolean,attribute:"enable-second"})],p.prototype,"enableSecond",void 0),(0,i.Cg)([(0,o.MZ)({type:Boolean,reflect:!0})],p.prototype,"clearable",void 0),(0,i.Cg)([(0,o.MZ)({attribute:"placeholder-labels",type:Boolean})],p.prototype,"placeholderLabels",void 0),(0,i.Cg)([(0,o.P)("ha-base-time-input")],p.prototype,"_input",void 0),p=(0,i.Cg)([(0,o.EM)("ha-time-input")],p),t()}catch(e){t(e)}})},67505(e,t,a){var i=a(62826),s=a(5124),o=a(22441),n=a(93421);a(67094);class l extends s.WF{render(){return this._localize?s.qy` <ha-svg-icon .path="${"M12,2A7,7 0 0,1 19,9C19,11.38 17.81,13.47 16,14.74V17A1,1 0 0,1 15,18H9A1,1 0 0,1 8,17V14.74C6.19,13.47 5,11.38 5,9A7,7 0 0,1 12,2M9,21V20H15V21A1,1 0 0,1 14,22H10A1,1 0 0,1 9,21M12,4A5,5 0 0,0 7,9C7,11.05 8.23,12.81 10,13.58V16H14V13.58C15.77,12.81 17,11.05 17,9A5,5 0 0,0 12,4Z"}"></ha-svg-icon> <span class="prefix">${this._localize("ui.panel.config.tips.tip")}</span> <span class="text"><slot></slot></span> `:s.s6}}l.styles=s.AH`:host{display:block;text-align:center}.text{direction:var(--direction);margin-left:2px;margin-inline-start:2px;margin-inline-end:initial;color:var(--secondary-text-color)}.prefix{font-weight:var(--ha-font-weight-medium)}`,(0,i.Cg)([(0,o.wk)(),(0,n.IW)()],l.prototype,"_localize",void 0),l=(0,i.Cg)([(0,o.EM)("ha-tip")],l)},30619(e,t,a){a.a(e,async function(e,t){try{a(74423),a(44114),a(18111),a(22489),a(61701),a(17642),a(58004),a(33853),a(45876),a(32475),a(15024),a(31698);var i=a(62826),s=a(5124),o=a(22441),n=a(96231),l=a(22786),r=a(1087),h=a(71727),p=a(91926),d=a(26300),c=(a(67094),a(59646)),u=(a(28170),a(50723),a(31420)),g=a(44144),m=e([d,c,u]);[d,c,u]=m.then?(await m)():m;const 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",v="M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z",y="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",_="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",f=[];class $ extends s.WF{get _value(){return this.value??f}_description(e){if(e===u.oJ)return this.cloudStatus?.logged_in&&!this.cloudStatus.active_subscription?this.hass.localize("ui.panel.config.backup.agents.cloud_agent_no_subcription"):this.hass.localize("ui.panel.config.backup.agents.cloud_agent_description");const t=[];(0,u.jU)(e)&&t.push(this.hass.localize("ui.panel.config.backup.agents.network_mount_agent_description"));!1===this.agentsConfig?.[e]?.protected&&t.push(s.qy`<div class="unencrypted-warning"> <span class="dot warning"></span> <span> ${this.hass.localize("ui.panel.config.backup.agents.encryption_turned_off")} </span> </div>`);const a=this.agentsConfig?.[e]?.retention;return a&&(null===a.copies&&null===a.days?t.push(this.hass.localize("ui.panel.config.backup.agents.retention_all")):t.push(this.hass.localize("ui.panel.config.backup.agents.retention_"+(a.copies?"backups":"days"),{count:a.copies||a.days}))),(0,n.f)(t,s.qy`<span class="separator"> · </span>`)}_renderAgentIcon(e){if((0,u.Bi)(e))return s.qy` <ha-svg-icon .path="${y}" slot="start"></ha-svg-icon> `;if((0,u.jU)(e))return s.qy`<ha-svg-icon .path="${_}" slot="start"></ha-svg-icon>`;const t=(0,h.m)(e);return s.qy` <img .src="${(0,g.MR)({domain:t,type:"icon",darkOptimized:this.hass.themes?.darkMode},this.hass.auth.data.hassUrl)}" crossorigin="anonymous" referrerpolicy="no-referrer" alt="" slot="start"> `}render(){const e=this._availableAgents(this.agents,this.cloudStatus),t=this._unavailableAgents(this.agents,this._value,this.cloudStatus),a=[...e,...t];return s.qy` ${a.length>0?s.qy` <ha-list-base> ${e.map(e=>{const t=e.agent_id,i=(0,u.q7)(this.hass.localize,t,a),o=this._description(t),n=t===u.oJ&&this.cloudStatus?.logged_in&&!this.cloudStatus.active_subscription;return s.qy` <ha-list-item-base> ${this._renderAgentIcon(t)} <div slot="headline" class="name">${i}</div> ${o?s.qy`<div slot="supporting-text">${o}</div>`:s.s6} ${this.showSettings?s.qy` <ha-icon-button id="${t}" slot="end" path="${b}" ="${this._showAgentSettings}"></ha-icon-button> `:s.s6} <ha-switch slot="end" id="${t}" .checked="${this._value.includes(t)}" .disabled="${n&&!this._value.includes(t)}" ="${this._agentToggled}"></ha-switch> </ha-list-item-base> `})} ${t.length>0&&this.showSettings?s.qy` <p class="heading"> ${this.hass.localize("ui.panel.config.backup.agents.unavailable_agents")} </p> ${t.map(e=>{const t=e.agent_id,i=(0,u.q7)(this.hass.localize,t,a);return s.qy` <ha-list-item-base> ${this._renderAgentIcon(t)} <div slot="headline" class="name">${i}</div> <ha-icon-button id="${t}" slot="end" path="${v}" ="${this._deleteAgent}"></ha-icon-button> </ha-list-item-base> `})} `:s.s6} </ha-list-base> `:s.qy` <p> ${this.hass.localize("ui.panel.config.backup.agents.no_agents")} </p> `} `}_showAgentSettings(e){const t=e.currentTarget.id;(0,p.oo)(`/config/backup/location/${t}`)}_deleteAgent(e){e.stopPropagation();const t=e.currentTarget.id;this.value=this._value.filter(e=>e!==t),(0,r.r)(this,"value-changed",{value:this.value})}_agentToggled(e){e.stopPropagation();const t=e.currentTarget.checked,a=e.currentTarget.id;this.value=t?[...this._value,a]:this._value.filter(e=>e!==a),this.value=[...new Set(this.value)],(0,r.r)(this,"value-changed",{value:this.value})}constructor(...e){super(...e),this.agents=[],this.showSettings=!1,this._availableAgents=(0,l.A)((e,t)=>e.filter(e=>e.agent_id!==u.oJ||t?.logged_in)),this._unavailableAgents=(0,l.A)((e,t,a)=>{const i=this._availableAgents(e,a).map(e=>e.agent_id);return t.filter(e=>!i.includes(e)).map(e=>({agent_id:e,name:e.split(".")[1]||e}))})}}$.styles=s.AH`ha-list-base{--ha-row-item-padding-inline:0}ha-list-item-base .name{word-break:break-word}ha-list-item-base img{width:48px}ha-list-item-base ha-svg-icon[slot=start]{--mdc-icon-size:48px;color:var(--primary-text-color)}ha-list-item-base::part(headline),ha-list-item-base::part(supporting-text){white-space:wrap}ha-list-item-base::part(end){gap:var(--ha-space-2)}.unencrypted-warning{display:flex;align-items:center;gap:var(--ha-space-1)}.dot{display:block;position:relative;width:8px;height:8px;background-color:var(--disabled-color);border-radius:var(--ha-border-radius-circle)}.dot.warning{background-color:var(--warning-color)} all and (max-width:500px){.separator{display:none}ha-list-item-base [slot=supporting-text]{display:flex;align-items:flex-start;flex-direction:column;justify-content:flex-start;gap:var(--ha-space-1)}}`,(0,i.Cg)([(0,o.MZ)({attribute:!1})],$.prototype,"hass",void 0),(0,i.Cg)([(0,o.MZ)({attribute:!1})],$.prototype,"cloudStatus",void 0),(0,i.Cg)([(0,o.MZ)({attribute:!1})],$.prototype,"agents",void 0),(0,i.Cg)([(0,o.MZ)({attribute:!1})],$.prototype,"agentsConfig",void 0),(0,i.Cg)([(0,o.MZ)({type:Boolean,attribute:"show-settings"})],$.prototype,"showSettings",void 0),(0,i.Cg)([(0,o.wk)()],$.prototype,"value",void 0),$=(0,i.Cg)([(0,o.EM)("ha-backup-config-agents")],$),t()}catch(e){t(e)}})},78391(e,t,a){a.a(e,async function(e,t){try{a(18111),a(61701);var i=a(62826),s=a(5124),o=a(22441),n=a(1087),l=a(63004),r=(a(11382),a(606)),h=a(91485),p=(a(28170),a(83892),e([r,h]));[r,h]=p.then?(await p)():p;const d=1,c=9999;const u={copies_3:{copies:3,days:null},forever:{copies:null,days:null},global:null};class g extends s.WF{willUpdate(){this._configLoaded||void 0===this.retention||(this._configLoaded=!0,this.retention?null===this.retention?.days&&null===this.retention?.copies?this._preset="forever":(this._value=this.retention.copies||this.retention.days||3,(this.retention.days||this.locationSpecific||3!==this.retention.copies)&&(this._preset="custom",this._type=this.retention?.copies?"copies":"days")):this._preset="global",this.locationSpecific&&(this.presetOptions=["global","forever","custom"]))}render(){return this._configLoaded?s.qy` <ha-list-item-base> <span slot="headline"> ${this.headline??this.hass.localize("ui.panel.config.backup.schedule.retention")} </span> <span slot="supporting-text"> ${this.hass.localize("ui.panel.config.backup.schedule.retention_description")} </span> <ha-select slot="end" ="${this._retentionPresetChanged}" .value="${this._preset}" .options="${this.presetOptions.map(e=>({value:e,label:this.hass.localize(`ui.panel.config.backup.schedule.retention_presets.${e}`)}))}"></ha-select> </ha-list-item-base> ${"custom"===this._preset?s.qy`<ha-expansion-panel expanded .header="${this.hass.localize("ui.panel.config.backup.schedule.custom_retention")}" outlined> <ha-row-item> <span slot="headline"> ${this.hass.localize("ui.panel.config.backup.schedule.custom_retention_label")} </span> <ha-input slot="end" ="${this._retentionValueChanged}" .value="${this._value.toString()}" id="value" type="number" .min="${d.toString()}" .max="${c.toString()}" step="1"> </ha-input> <ha-select slot="end" ="${this._retentionTypeChanged}" .value="${this._type}" id="type" .options="${[{value:"days",label:this.hass.localize("ui.panel.config.backup.schedule.retention_units.days")},{value:"copies",label:this.hass.localize("ui.panel.config.backup.schedule.retention_units.copies")}]}"></ha-select></ha-row-item></ha-expansion-panel> `:s.s6} `:s.s6}_retentionPresetChanged(e){let t=e.detail.value;if(t&&("custom"!==t||!this.locationSpecific&&"forever"!==this._preset?this._preset=t:(this._preset=t,t="copies_3"),this.locationSpecific||"custom"!==t)){const e=u[t];(0,n.r)(this,"value-changed",{value:e})}}_retentionValueChanged(e){e.stopPropagation();const t=e.currentTarget,a=parseInt(t.value??""),i=(0,l.q)(a,d,c);t.value=i.toString();const s=this._customTypeField?.value;(0,n.r)(this,"value-changed",{value:{copies:"copies"===s?i:null,days:"days"===s?i:null}})}_retentionTypeChanged(e){const t=e.detail.value;if(!t)return;this._type=t;const a=this._customValueField?.value;(0,n.r)(this,"value-changed",{value:{copies:"copies"===t?Number(a):null,days:"days"===t?Number(a):null}})}constructor(...e){super(...e),this.locationSpecific=!1,this._preset="copies_3",this._type="copies",this._value=3,this._configLoaded=!1,this.presetOptions=["copies_3","forever","custom"]}}g.styles=s.AH`ha-list-item-base,ha-row-item{--ha-row-item-padding-inline:0}ha-row-item::part(end){align-items:flex-start}ha-list-item-base::part(headline),ha-list-item-base::part(supporting-text){white-space:wrap}ha-select{min-width:210px} all and (max-width:450px){ha-select{min-width:160px;width:160px}}ha-input#value{min-width:70px}ha-select#type{min-width:100px} all and (max-width:450px){ha-input#value{min-width:60px;margin:0 -8px}ha-select#type{min-width:120px;width:120px}}ha-expansion-panel{--expansion-panel-summary-padding:0 16px;--expansion-panel-content-padding:0 16px;margin-bottom:16px}`,(0,i.Cg)([(0,o.MZ)({attribute:!1})],g.prototype,"hass",void 0),(0,i.Cg)([(0,o.MZ)({attribute:!1})],g.prototype,"retention",void 0),(0,i.Cg)([(0,o.MZ)()],g.prototype,"headline",void 0),(0,i.Cg)([(0,o.MZ)({type:Boolean,attribute:"location-specific"})],g.prototype,"locationSpecific",void 0),(0,i.Cg)([(0,o.wk)()],g.prototype,"_preset",void 0),(0,i.Cg)([(0,o.wk)()],g.prototype,"_type",void 0),(0,i.Cg)([(0,o.wk)()],g.prototype,"_value",void 0),(0,i.Cg)([(0,o.P)("#value")],g.prototype,"_customValueField",void 0),(0,i.Cg)([(0,o.P)("#type")],g.prototype,"_customTypeField",void 0),g=(0,i.Cg)([(0,o.EM)("ha-backup-config-retention")],g),t()}catch(e){t(e)}})},40840(e,t,a){a.a(e,async function(e,t){try{a(74423),a(44114),a(18111),a(61701);var i=a(62826),s=a(5124),o=a(22441),n=a(22786),l=a(30162),r=a(1087),h=(a(9503),a(11382),a(606)),p=a(50286),d=(a(67505),a(28170),a(83892),a(50723),a(31420)),c=a(36918),u=a(78391),g=e([h,p,u,l,d]);[h,p,u,l,d]=g.then?(await g)():g;const m=[d.qk.NEVER,d.qk.DAILY,d.qk.CUSTOM_DAYS],b=["default","custom"],v={recurrence:d.qk.NEVER,time_option:"default",days:[],retention:{copies:3}};class y extends s.WF{_setData(e){this.value={...this.value,schedule:{recurrence:e.recurrence,time:"custom"===e.time_option?e.time:null,days:e.recurrence===d.qk.CUSTOM_DAYS?e.days:[]},retention:e.retention},(0,r.r)(this,"value-changed",{value:this.value})}render(){const e=this._getData(this.value);return s.qy` <ha-list-base> <ha-list-item-base> <span slot="headline"> ${this.hass.localize("ui.panel.config.backup.schedule.schedule")}</span> <span slot="supporting-text"> ${this.hass.localize("ui.panel.config.backup.schedule.schedule_description")} </span> <ha-select slot="end" ="${this._scheduleChanged}" .value="${e.recurrence}" .options="${m.map(e=>({value:e,label:this.hass.localize(`ui.panel.config.backup.schedule.schedule_options.${e}`)}))}"></ha-select> </ha-list-item-base> ${e.recurrence===d.qk.CUSTOM_DAYS?s.qy`<ha-expansion-panel expanded .header="${this.hass.localize("ui.panel.config.backup.schedule.custom_schedule")}" outlined> <ha-row-item class="days"> <span slot="headline"> ${this.hass.localize("ui.panel.config.backup.schedule.backup_every")} </span> <div slot="end"> ${d.T2.map(t=>s.qy` <div> <ha-checkbox ="${this._daysChanged}" .checked="${e.days.includes(t)}" .value="${t}"> ${this.hass.localize(`ui.panel.config.backup.overview.settings.weekdays.${t}`)} </ha-checkbox> </div> `)} </div> </ha-row-item> </ha-expansion-panel>`:s.s6} ${e.recurrence===d.qk.DAILY||e.recurrence===d.qk.CUSTOM_DAYS&&e.days.length>0?s.qy` <ha-list-item-base> <span slot="headline"> ${this.hass.localize("ui.panel.config.backup.schedule.time")}</span> <span slot="supporting-text"> ${this.hass.localize("ui.panel.config.backup.schedule.schedule_time_description",{time_range_start:(0,l.fU)(d.uM,this.hass.locale,this.hass.config),time_range_end:(0,l.fU)(d.pL,this.hass.locale,this.hass.config)})} </span> <ha-select slot="end" ="${this._scheduleTimeChanged}" .value="${e.time_option}" .options="${b.map(e=>({value:e,label:this.hass.localize(`ui.panel.config.backup.schedule.time_options.${e}`)}))}"></ha-select> </ha-list-item-base> ${"custom"===e.time_option?s.qy`<ha-expansion-panel expanded .header="${this.hass.localize("ui.panel.config.backup.schedule.custom_time")}" outlined> <ha-row-item> <span slot="headline"> ${this.hass.localize("ui.panel.config.backup.schedule.custom_time_label")} </span> <span slot="supporting-text"> ${this.hass.localize("ui.panel.config.backup.schedule.custom_time_description",{time:(0,l.fU)(d.uM,this.hass.locale,this.hass.config)})} </span> <ha-time-input slot="end" -changed="${this._timeChanged}" .value="${e.time??void 0}" .locale="${this.hass.locale}"> </ha-time-input> </ha-row-item> </ha-expansion-panel>`:s.s6} `:s.s6} ${this.supervisor?s.qy` <ha-list-item-base> <span slot="headline"> ${this.hass.localize("ui.panel.config.backup.schedule.update_preference.label")} </span> <span slot="supporting-text"> ${this.hass.localize("ui.panel.config.backup.schedule.update_preference.supporting_text")} </span> <ha-select slot="end" ="${this._updatePreferenceChanged}" .value="${this.supervisorUpdateConfig?.core_backup_before_update?.toString()||"false"}" .options="${[{value:"false",label:this.hass.localize("ui.panel.config.backup.schedule.update_preference.skip_backups")},{value:"true",label:this.hass.localize("ui.panel.config.backup.schedule.update_preference.backup_before_update")}]}"></ha-select> </ha-list-item-base> `:s.s6} <ha-backup-config-retention .hass="${this.hass}" .retention="${e.retention}" -changed="${this._retentionChanged}"></ha-backup-config-retention> <ha-tip>${this.hass.localize("ui.panel.config.backup.schedule.tip",{backup_create:s.qy`<a href="${(0,c.o)(this.hass,"/integrations/backup/#action-backupcreate_automatic")}" target="_blank" rel="noopener noreferrer">backup.create_automatic</a>`})}</ha-tip> </ha-list-base> `}_scheduleChanged(e){const t=e.detail.value,a=this._getData(this.value);let i=[...a.days];t===d.qk.CUSTOM_DAYS&&0===a.days.length&&(i=[...d.T2]),this._setData({...a,recurrence:t,days:i})}_scheduleTimeChanged(e){const t=e.detail.value,a=this._getData(this.value);this._setData({...a,time_option:t,time:"custom"===t?"04:45:00":void 0})}_timeChanged(e){e.stopPropagation();const t=this._getData(this.value);this._setData({...t,time:e.detail.value})}_daysChanged(e){e.stopPropagation();const t=e.currentTarget,a=t.value,i=this._getData(this.value),s=[...i.days];t.checked&&!i.days.includes(a)?s.push(a):!t.checked&&i.days.includes(a)&&s.splice(s.indexOf(a),1),(0,d.Ye)(s),this._setData({...i,days:s})}_updatePreferenceChanged(e){const t="true"===e.detail.value;(0,r.r)(this,"update-config-changed",{value:{core_backup_before_update:t}})}_retentionChanged(e){e.stopPropagation();const t=e.detail.value,a={...this._getData(this.value),retention:t};this._setData(a)}constructor(...e){super(...e),this.supervisor=!1,this._getData=(0,n.A)(e=>{if(!e)return v;const t=e;return{recurrence:t.schedule.recurrence,time_option:t.schedule.time?"custom":"default",time:t.schedule.time,days:t.schedule.recurrence===d.qk.CUSTOM_DAYS?t.schedule.days:[],retention:t.retention}})}}y.styles=s.AH`ha-list-base{--ha-row-item-padding-inline:0}ha-list-item-base::part(headline),ha-list-item-base::part(supporting-text),ha-row-item::part(headline),ha-row-item::part(supporting-text){white-space:wrap}ha-select{min-width:210px}ha-time-input{min-width:194px;--time-input-flex:1} all and (max-width:450px){ha-select{min-width:160px;width:160px}ha-time-input{min-width:145px;width:145px}}ha-expansion-panel{margin-bottom:16px}ha-tip{text-align:unset;margin:16px 0}ha-row-item-base.days::part(end){align-items:flex-start}a{color:var(--primary-color)}ha-checkbox{min-height:40px;justify-content:center;padding-right:var(--ha-space-2)}`,(0,i.Cg)([(0,o.MZ)({attribute:!1})],y.prototype,"hass",void 0),(0,i.Cg)([(0,o.MZ)({attribute:!1})],y.prototype,"value",void 0),(0,i.Cg)([(0,o.MZ)({type:Boolean})],y.prototype,"supervisor",void 0),(0,i.Cg)([(0,o.MZ)({attribute:!1})],y.prototype,"supervisorUpdateConfig",void 0),y=(0,i.Cg)([(0,o.EM)("ha-backup-config-schedule")],y),t()}catch(e){t(e)}})}};