1export const __rspack_esm_id=84751;export const __rspack_esm_ids=[84751];export const __webpack_modules__={96891(t,e,i){class o{get enabled(){return this._enabled}set enabled(t){t!==this._enabled&&(this._enabled=t,this._enabled?this._attach():this._detach(),this._host.requestUpdate())}hostUpdated(){this.enabled&&!this._scrollContainer&&this._attach()}hostDisconnected(){this._detach()}_attach(){this._scrollContainer=this._host.renderRoot?.querySelector(this._selector),this._scrollContainer&&this._scrollContainer.addEventListener("mousedown",this._mouseDown)}_detach(){window.removeEventListener("mousemove",this._mouseMove),window.removeEventListener("mouseup",this._mouseUp),this._scrollContainer&&(this._scrollContainer.removeEventListener("mousedown",this._mouseDown),this._scrollContainer=void 0),this.scrolled=!1,this.scrolling=!1,this.mouseIsDown=!1,this.scrollStartX=0,this.scrollLeft=0}constructor(t,{selector:e,enabled:i}){this.mouseIsDown=!1,this.scrolled=!1,this.scrolling=!1,this.scrollStartX=0,this.scrollLeft=0,this._enabled=!0,this._mouseDown=t=>{const e=this._scrollContainer;e&&(this.scrollStartX=t.pageX-e.offsetLeft,this.scrollLeft=e.scrollLeft,this.mouseIsDown=!0,this.scrolled=!1,window.addEventListener("mousemove",this._mouseMove),window.addEventListener("mouseup",this._mouseUp,{once:!0}))},this._mouseUp=()=>{this.mouseIsDown=!1,this.scrolling=!1,this._host.requestUpdate(),window.removeEventListener("mousemove",this._mouseMove)},this._mouseMove=t=>{if(!this.mouseIsDown)return;const e=this._scrollContainer;if(!e)return;const i=t.pageX-e.offsetLeft-this.scrollStartX;this.scrolled||(this.scrolled=Math.abs(i)>1,this.scrolling=this.scrolled,this._host.requestUpdate()),e.scrollLeft=this.scrollLeft-i},this._selector=e,this._host=t,this.enabled=i??!0,t.addController(this)}}i.d(e,{q:()=>o})},90608(t,e,i){i.a(t,async function(t,o){try{var r=i(92684),s=i(47749),a=i(53104),n=t([r,a]);[r,a]=n.then?(await n)():n;const d=(0,s.A)((t,e)=>new Intl.RelativeTimeFormat(t.language,{numeric:"auto",style:e})),c=(t,e,i,o=!0,r="long")=>{const s=(0,a.x)(t,i,e);return o?d(e,r).format(s.value,s.unit):Intl.NumberFormat(e.language,{style:"unit",unit:s.unit,unitDisplay:r}).format(Math.abs(s.value))};i.d(e,{},{K:c}),o()}catch(t){o(t)}})},53104(t,e,i){i.a(t,async function(t,o){try{var r=i(65719),s=i(86451),a=i(55099),n=i(59955);const d=1e3,c=60,l=60*c;function h(t,e=Date.now(),i,o={}){const h={...p,...o||{}},u=(+t-+e)/d;if(Math.abs(u)<h.second)return{value:Math.round(u),unit:"second"};const v=u/c;if(Math.abs(v)<h.minute)return{value:Math.round(v),unit:"minute"};const g=u/l;if(Math.abs(g)<h.hour)return{value:Math.round(g),unit:"hour"};const y=new Date(t),m=new Date(e);y.setHours(0,0,0,0),m.setHours(0,0,0,0);const _=(0,r.c)(y,m);if(0===_)return{value:Math.round(g),unit:"hour"};if(Math.abs(_)<h.day)return{value:_,unit:"day"};const w=(0,n.P)(i),b=(0,s.k)(y,{weekStartsOn:w}),f=(0,s.k)(m,{weekStartsOn:w}),C=(0,a.I)(b,f);if(0===C)return{value:_,unit:"day"};if(Math.abs(C)<h.week)return{value:C,unit:"week"};const x=y.getFullYear()-m.getFullYear(),E=12*x+y.getMonth()-m.getMonth();return 0===E?{value:C,unit:"week"}:Math.abs(E)<h.month||0===x?{value:E,unit:"month"}:{value:Math.round(x),unit:"year"}}const p={second:59,minute:59,hour:22,day:5,week:4,month:11};i.d(e,{x:()=>h}),o()}catch(u){o(u)}})},30753(t,e,i){var o=i(28861),r=i(11467),s=i(82476);class a extends r.WF{render(){return r.qy` ${this.header?r.qy`<h1 class="card-header">${this.header}</h1>`:r.s6} <slot></slot> `}constructor(...t){super(...t),this.raised=!1}}a.styles=r.AH`:host{background:var(--ha-card-background,var(--card-background-color,white));backdrop-filter:var(--ha-card-backdrop-filter,none);
1box-shadow:var(--ha-card-box-shadow,none);box-sizing:border-box;border-radius:var(--ha-card-border-radius,var(--ha-border-radius-lg));border-width:var(--ha-card-border-width,1px);border-style:solid;border-color:var(--ha-card-border-color,var(--divider-color,#e0e0e0));color:var(--primary-text-color);transition:all .3s ease-out;display:block;position:relative}:host([raised]){box-shadow:var(--ha-card-box-shadow,0px 2px 1px -1px #0003, 0px 1px 1px 0px #00000024, 0px 1px 3px 0px #0000001f);border:none}.card-header,:host ::slotted(.card-header){color:var(--ha-card-header-color,var(--primary-text-color));font-family:var(--ha-card-header-font-family,inherit);font-size:var(--ha-card-header-font-size,var(--ha-font-size-2xl));letter-spacing:-.012em;line-height:var(--ha-line-height-expanded);padding:var(--ha-space-3) var(--ha-space-4) var(--ha-space-4);font-weight:var(--ha-font-weight-normal);margin-block:0;display:block}:host ::slotted(.card-content:not(:nth-child(1 of .card-content,.card-header))),slot:not(:first-child)::slotted(.card-content){margin-top:calc(var(--ha-space-2) * -1);padding-top:0}:host ::slotted(.card-content){padding:var(--ha-space-4)}:host ::slotted(.card-actions){border-top:1px solid var(--divider-color,#e8e8e8);padding:var(--ha-space-2)}`,(0,o.Cg)([(0,s.MZ)()],a.prototype,"header",void 0),(0,o.Cg)([(0,s.MZ)({type:Boolean,reflect:!0})],a.prototype,"raised",void 0),a=(0,o.Cg)([(0,s.EM)("ha-card")],a)},19162(t,e,i){i.r(e);var o=i(28861),r=i(82476),s=i(66970),a=i(47551);class n extends a.HaSvgIcon{constructor(...t){super(...t),this.path="rtl"===s.G.document.dir?"M15.41,16.58L10.83,12L15.41,7.41L14,6L8,12L14,18L15.41,16.58Z":"M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z"}}(0,o.Cg)([(0,r.MZ)()],n.prototype,"path",void 0),n=(0,o.Cg)([(0,r.EM)("ha-icon-next")],n),i.d(e,{HaIconNext:()=>n})},82739(t,e,i){var o=i(28861),r=i(35740),s=i(68612),a=i(11467),n=i(82476);i(38753);const d=[s.R,a.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)}md-item{overflow:var(--md-item-overflow,hidden);align-items:var(--md-item-align-items,center);gap:var(--ha-md-list-item-gap,16px)}`];class c extends r.n{renderRipple(){return"text"===this.type?a.s6:a.qy`<ha-ripple part="ripple" for="item" ?disabled=${this.disabled&&"link"!==this.type}></ha-ripple>`}}c.styles=d,c=(0,o.Cg)([(0,n.EM)("ha-md-list-item")],c),i.d(e,{G:()=>c},{J:d})},999(t,e,i){i(18111),i(22489),i(46058);var o=i(28861),r=i(11467),s=i(82476),a=i(62228);class n extends r.WF{updated(t){t.has("disabled")&&(this.disabled?this._destroySortable():this._createSortable())}disconnectedCallback(){super.disconnectedCallback(),this._shouldBeDestroy=!0,setTimeout(()=>{this._shouldBeDestroy&&(this._destroySortable(),this._shouldBeDestroy=!1)},1)}connectedCallback(){super.connectedCallback(),this._shouldBeDestroy=!1,this.hasUpdated&&!this.disabled&&this._createSortable()}createRenderRoot(){return this}render(){return this.noStyle?r.s6:r.qy` <style>.sortable-fallback{display:none!important}.sortable-ghost{box-shadow:0 0 0 2px var(--primary-color);background:rgba(var(--rgb-primary-color), .25);border-radius:var(--ha-border-radius-sm);opacity:.4}.sortable-drag{border-radius:var(--ha-border-radius-sm);opacity:1;background:var(--card-background-color);cursor:grabbing;box-shadow:0 4px 8px 3px #00000026}</style> `}async _createSortable(){if(this._sortable)return;const t=this.children[0];if(!t)return;const e=(await Promise.all([i.e(91414),i.e(10213)]).then(i.bind(i,30404))).default,o={scroll:!0,forceAutoScrollFallback:!0,scrollSpeed:20,animation:150,...this.options,onChoose:this._handleChoose,onStart:this._handleStart,onEnd:this._handleEnd,onUpdate:this._handleUpdate,onAdd:this._handleAdd,onRemove:this._handleRemove};this.draggableSelector&&(o.draggable=this.draggableSelector),this.handleSelector&&(o.handle=this.handleSelector),void 0!==this.invertSwap&&(o.invertSwap=this.invertSwap),this.group&&(o.group=this.group),this.filter&&(o.filter=this.filter),this._sortable=new e(t,o)}_destroySortable(){this._sortable&&(this._sortable.destroy(),this._sortable=void 0)}constructor(...t){super(...t),this.disabled=!1,this.noStyle=!1,this.invertSwap=!1,this.rollback=!0,this._shouldBeDestroy=!1,this._handleUpdate=t=>{(0,a.r)(this,"item-moved",{newIndex:t.newIndex,oldIndex:t.oldIndex})},this._handleAdd=t=>{(0,a.r)(this,"item-added",{index:t.newIndex,data:t.item.sortableData,item:t.item})},this._handleRemove=t=>{(0,a.r)(this,"item-removed",{index:t.oldIndex})},this._handleEnd=async t=>{(0,a.r)(this,"drag-end"),this.rollback&&t.item.placeholder&&(t.item.placeholder.replaceWith(t.item),delete t.item.placeholder)},this._handleStart=()=>{(0,a.r)(this,"drag-start")},this._handleChoose=t=>{this.rollback&&(t.item.placeholder=document.createComment("sort-placeholder"),t.item.after(t.item.placeholder))}}}(0,o.Cg)([(0,s.MZ)({type:Boolean})],n.prototype,"disabled",void 0),(0,o.Cg)([(0,s.MZ)({type:Boolean,attribute:"no-style"})],n.prototype,"noStyle",void 0),(0,o.Cg)([(0,s.MZ)({type:String,attribute:"draggable-selector"})],n.prototype,"draggableSelector",void 0),(0,o.Cg)([(0,s.MZ)({type:String,attribute:"handle-selector"})],n.prototype,"handleSelector",void 0),(0,o.Cg)([(0,s.MZ)({type:String,attribute:"filter"})],n.prototype,"filter",void 0),(0,o.Cg)([(0,s.MZ)({type:String})],n.prototype,"group",void 0),(0,o.Cg)([(0,s.MZ)({type:Boolean,attribute:"invert-swap"})],n.prototype,"invertSwap",void 0),(0,o.Cg)([(0,s.MZ)({attribute:!1})],n.prototype,"options",void 0),(0,o.Cg)([(0,s.MZ)({type:Boolean})],n.prototype,"rollback",void 0),n=(0,o.Cg)([(0,s.EM)("ha-sortable")],n)},95883(t,e,i){i.d(e,{},{q:t=>"string"==typeof t?{type:"entity",entity:t,show_name:!0}:"type"in t&&t.type?t:{type:"entity",...t}})},64108(t,e,i){var o=i(30835),r=i(38563),s=i(84336);i.d(e,{},{E:(t,e,i)=>{const a=(0,s.H)(e);a&&!(0,o.d)(t)||(i?i():(0,r.OE)(a))}})},59087(t,e,i){i.a(t,async function(t,e){try{i(74423);
1var o=i(28861),r=(i(27712),i(11467)),s=i(82476),a=i(5633),n=i(7346),d=i(62228),c=i(6162),l=(i(26e3),i(96007)),h=(i(47551),i(7578)),p=t([c,l]);[c,l]=p.then?(await p)():p;const u="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z",v="M19,3L13,9L15,11L22,4V3M12,12.5A0.5,0.5 0 0,1 11.5,12A0.5,0.5 0 0,1 12,11.5A0.5,0.5 0 0,1 12.5,12A0.5,0.5 0 0,1 12,12.5M6,20A2,2 0 0,1 4,18C4,16.89 4.9,16 6,16A2,2 0 0,1 8,18C8,19.11 7.1,20 6,20M6,8A2,2 0 0,1 4,6C4,4.89 4.9,4 6,4A2,2 0 0,1 8,6C8,7.11 7.1,8 6,8M9.64,7.64C9.87,7.14 10,6.59 10,6A4,4 0 0,0 6,2A4,4 0 0,0 2,6A4,4 0 0,0 6,10C6.59,10 7.14,9.87 7.64,9.64L10,12L7.64,14.36C7.14,14.13 6.59,14 6,14A4,4 0 0,0 2,18A4,4 0 0,0 6,22A4,4 0 0,0 10,18C10,17.41 9.87,16.86 9.64,16.36L12,14L19,21H22V20L9.64,7.64Z",g="M13,6V11H18V7.75L22.25,12L18,16.25V13H13V18H16.25L12,22.25L7.75,18H11V13H6V16.25L1.75,12L6,7.75V11H11V6H7.75L12,1.75L16.25,6H13Z",y="M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z",m="M12,16A2,2 0 0,1 14,18A2,2 0 0,1 12,20A2,2 0 0,1 10,18A2,2 0 0,1 12,16M12,10A2,2 0 0,1 14,12A2,2 0 0,1 12,14A2,2 0 0,1 10,12A2,2 0 0,1 12,10M12,4A2,2 0 0,1 14,6A2,2 0 0,1 12,8A2,2 0 0,1 10,6A2,2 0 0,1 12,4Z",_="M20.71,7.04C21.1,6.65 21.1,6 20.71,5.63L18.37,3.29C18,2.9 17.35,2.9 16.96,3.29L15.12,5.12L18.87,8.87M3,17.25V21H6.75L17.81,9.93L14.06,6.18L3,17.25Z",w="M16,8H14V11H11V13H14V16H16V13H19V11H16M2,12C2,9.21 3.64,6.8 6,5.68V3.5C2.5,4.76 0,8.09 0,12C0,15.91 2.5,19.24 6,20.5V18.32C3.64,17.2 2,14.79 2,12M15,3C10.04,3 6,7.04 6,12C6,16.96 10.04,21 15,21C19.96,21 24,16.96 24,12C24,7.04 19.96,3 15,3M15,19C11.14,19 8,15.86 8,12C8,8.14 11.14,5 15,5C18.86,5 22,8.14 22,12C22,15.86 18.86,19 15,19Z";class b extends r.WF{firstUpdated(){this.addEventListener("focus",()=>{this._focused=!0}),this.addEventListener("blur",()=>{this._focused=!1}),this.addEventListener("touchstart",()=>{this._touchStarted=!0,this._hover=!0,document.addEventListener("click",this._documentClicked)}),this.addEventListener("touchend",()=>{setTimeout(()=>{this._touchStarted=!1},10)}),this.addEventListener("mouseenter",()=>{this._touchStarted||(this._hover=!0)}),this.addEventListener("mouseleave",()=>{this._hover=!1}),this.addEventListener("click",()=>{this._hover=!0,document.addEventListener("click",this._documentClicked)})}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this._documentClicked)}render(){const t=(this._hover||this._focused)&&!this.hiddenOverlay;return r.qy` <div class="card-wrapper" inert><slot></slot></div> <div class="card-overlay ${(0,a.H)({visible:t})}"> ${this.noEdit?r.qy` <div class="control"> <div class="control-overlay"></div> <ha-svg-icon .path=${g}> </ha-svg-icon> </div> `:r.qy` <div class="control" @click=${this._handleOverlayClick} @keydown=${this._handleOverlayClick} tabindex="0"> <div class="control-overlay"></div> <ha-svg-icon .path=${_}> </ha-svg-icon> </div> `} <ha-dropdown class="more" placement="bottom-end" @wa-select=${this._handleDropdownSelect}> <ha-icon-button slot="trigger" .path=${m}> </ha-icon-button> ${this.noEdit?r.s6:r.qy` <ha-dropdown-item value="edit"> <ha-svg-icon slot="icon" .path=${_}></ha-svg-icon> ${this._localize("ui.panel.lovelace.editor.edit_card.edit")} </ha-dropdown-item> `} ${this.noDuplicate?r.s6:r.qy` <ha-dropdown-item value="duplicate"> <ha-svg-icon slot="icon" .path=${w}></ha-svg-icon> ${this._localize("ui.panel.lovelace.editor.edit_card.duplicate")} </ha-dropdown-item> `} ${this.noMove?r.s6:r.qy` <ha-dropdown-item value="copy"> <ha-svg-icon slot="icon" .path=${u}></ha-svg-icon> ${this._localize("ui.panel.lovelace.editor.edit_card.copy")} </ha-dropdown-item> <ha-dropdown-item value="cut"> <ha-svg-icon slot="icon" .path=${v}></ha-svg-icon> ${this._localize("ui.panel.lovelace.editor.edit_card.cut")} </ha-dropdown-item> `} ${this.noDuplicate&&this.noEdit&&this.noMove?r.s6:r.qy`<wa-divider></wa-divider>`} <ha-dropdown-item value="delete" variant="danger"> ${this._localize("ui.panel.lovelace.editor.edit_card.delete")} <ha-svg-icon class="warning" slot="icon" .path=${y}></ha-svg-icon> </ha-dropdown-item> </ha-dropdown> </div> `}_handleOverlayClick(t){t.defaultPrevented||"keydown"===t.type&&"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),t.stopPropagation(),this._editCard())}_handleDropdownSelect(t){const e=t.detail?.item?.value;if(e)switch(e){case"edit":this._editCard();break;case"duplicate":this._duplicateCard();break;case"copy":this._copyCard();break;case"cut":this._cutCard();break;
1case"delete":this._deleteCard()}}_duplicateCard(){(0,d.r)(this,"ll-duplicate-card",{path:this.path})}_editCard(){(0,d.r)(this,"ll-edit-card",{path:this.path})}_cutCard(){(0,d.r)(this,"ll-copy-card",{path:this.path}),(0,d.r)(this,"ll-delete-card",{path:this.path,silent:!0})}_copyCard(){(0,d.r)(this,"ll-copy-card",{path:this.path})}_deleteCard(){(0,d.r)(this,"ll-delete-card",{path:this.path,silent:!1})}static get styles(){return[h.RF,r.AH`.card-overlay{opacity:0;pointer-events:none;justify-content:center;align-items:center;transition:opacity .18s ease-in-out;display:flex;position:absolute;inset:0}.card-overlay.visible{opacity:1;pointer-events:auto}.card-wrapper{z-index:0;height:100%;position:relative}.control{cursor:pointer;border-radius:var(--ha-card-border-radius,var(--ha-border-radius-lg));z-index:0;justify-content:center;align-items:center;display:flex;position:absolute;inset:0;outline:none!important}.control-overlay{opacity:.8;background-color:var(--primary-background-color);border:1px solid var(--divider-color);border-radius:var(--ha-card-border-radius,var(--ha-border-radius-lg));z-index:0;position:absolute;inset:0}.control ha-svg-icon{color:var(--primary-text-color);border-radius:var(--ha-border-radius-circle);background:var(--secondary-background-color);--mdc-icon-size:20px;padding:8px;display:flex;position:relative}.more ha-icon-button{top:-6px;right:-6px;cursor:pointer;border-radius:var(--ha-border-radius-circle);background:var(--secondary-background-color);--ha-icon-button-size:32px;--mdc-icon-size:20px;position:absolute;inset-inline-start:initial;inset-inline-end:-6px}`]}constructor(...t){super(...t),this.hiddenOverlay=!1,this.noEdit=!1,this.noDuplicate=!1,this.noMove=!1,this._hover=!1,this._focused=!1,this._touchStarted=!1,this._documentClicked=t=>{this._hover=t.composedPath().includes(this),document.removeEventListener("click",this._documentClicked)}}}(0,o.Cg)([(0,s.MZ)({attribute:!1})],b.prototype,"lovelace",void 0),(0,o.Cg)([(0,s.MZ)({type:Array})],b.prototype,"path",void 0),(0,o.Cg)([(0,s.MZ)({type:Boolean,attribute:"hidden-overlay"})],b.prototype,"hiddenOverlay",void 0),(0,o.Cg)([(0,s.MZ)({type:Boolean,attribute:"no-edit"})],b.prototype,"noEdit",void 0),(0,o.Cg)([(0,s.MZ)({type:Boolean,attribute:"no-duplicate"})],b.prototype,"noDuplicate",void 0),(0,o.Cg)([(0,s.MZ)({type:Boolean,attribute:"no-move"})],b.prototype,"noMove",void 0),(0,o.Cg)([(0,s.wk)(),(0,n.IW)()],b.prototype,"_localize",void 0),(0,o.Cg)([(0,s.wk)()],b.prototype,"_hover",void 0),(0,o.Cg)([(0,s.wk)()],b.prototype,"_focused",void 0),b=(0,o.Cg)([(0,s.EM)("hui-card-edit-mode")],b),e()}catch(t){e(t)}})},76161(t,e,i){i.a(t,async function(t,o){try{i(17642),i(15024),i(31698);var r=i(30358),s=i(3601),a=t([r]);r=(a.then?(await a)():a)[0];const n=new Set(["grid"]),d={},c=t=>(0,s.Ue)("section",t,n,d);i.d(e,{},{O:c}),o()}catch(t){o(t)}})},11051(t,e,i){var o=i(62228);const r=()=>Promise.all([i.e(80256),i.e(91928),i.e(97621),i.e(5627)]).then(i.bind(i,40630));i.d(e,{},{a:r,u:(t,e)=>{(0,o.r)(t,"show-dialog",{dialogTag:"hui-dialog-create-card",dialogImport:r,dialogParams:e})}})},70579(t,e,i){var o=i(62228);const r=()=>Promise.all([i.e(80256),i.e(84664),i.e(2467)]).then(i.bind(i,61454));i.d(e,{},{O:(t,e)=>{(0,o.r)(t,"show-dialog",{dialogTag:"hui-dialog-edit-card",dialogImport:r,dialogParams:e})},S:r})},16781(t,e,i){i(18111),i(22489),i(61701),i(13579);var o=i(33810);if(59509==i.j)var r=i(95883);if(59509==i.j)var s=i(82095);var a=i(21737);const n=(t,e,i)=>{const o=(0,a.jW)("cards",t,e),r=o?[...o,i]:[i];return(0,a.z7)("cards",t,e,r)},d=(t,e)=>{const{cardIndex:i}=(0,a.gO)(e),o=(0,a.S2)(e),r=((0,a.jW)("cards",t,o)??[]).filter((t,e)=>e!==i);return(0,a.z7)("cards",t,o,r)},c=(t,e,i,o=!1)=>{if(i.path&&e.views.some(t=>t.path===i.path)){if(!o)throw new Error(t.localize("ui.panel.lovelace.editor.edit_view.error_same_url"));i={...i,path:`${i.path}-2`}}return{...e,views:e.views.concat(i)}},l=(t,e)=>({...t,views:t.views.filter((t,i)=>i!==e)}),h=(t,e,i)=>{const o=(0,a.ys)(t,[e]);
1if((0,s.R6)(o))throw new Error("Deleting sections in a strategy is not supported.");const r=o.sections?.filter((t,e)=>e!==i);return(0,a.uZ)(t,[e],{...o,sections:r})},p=(t,e,i,o)=>{const r=(0,a.ys)(t,[e]);if((0,s.R6)(r))throw new Error("Inserting sections in a strategy is not supported.");const n=r.sections?[...r.sections.slice(0,i),o,...r.sections.slice(i)]:[o];return(0,a.uZ)(t,[e],{...r,sections:n})},u=(t,e)=>{const{cardIndex:i}=(0,a.gO)(e),o=(0,a.S2)(e),r=((0,a.jW)("badges",t,o)??[]).filter((t,e)=>e!==i);return(0,a.z7)("badges",t,o,r)};i.d(e,{},{Bl:(t,e,i)=>{const o=t.views[e],r=t.views[i];return{...t,views:t.views.map((t,s)=>s===i?o:s===e?r:t)}},Bn:(t,e,i)=>{const o=(0,a.ys)(t,[e]);if((0,s.R6)(o))throw new Error("Deleting sections in a strategy is not supported.");const r=o.sections?[...o.sections,i]:[i];return(0,a.uZ)(t,[e],{...o,sections:r})},DU:(t,e,i)=>{const o=(0,a.jW)("cards",t,e),r=o?[...o,...i]:[...i];return(0,a.z7)("cards",t,e,r)},Ei:(t,e,i)=>{const{cardIndex:o,viewIndex:r,sectionIndex:s}=(0,a.gO)(e),{viewIndex:c,sectionIndex:l}=(0,a.$P)(i);if(r===c&&s===l)throw new Error("You cannot move a card to the view or section it is in.");const h=(0,a.S2)(e),p=(0,a.jW)("cards",t,h)[o];let u=n(t,i,p);return u=d(u,e),u},GO:d,HQ:(t,e,i)=>{const o=(0,a.jW)("badges",t,e),r=o?[...o,i]:[i];return(0,a.z7)("badges",t,e,r)},Iq:(t,e,i,o)=>{if(o.path&&e.views.some((t,e)=>t.path===o.path&&e!==i))throw new Error(t.localize("ui.panel.lovelace.editor.edit_view.error_same_url"));return{...e,views:e.views.map((t,e)=>e===i?o:t)}},M:(t,e,i)=>{const{cardIndex:o}=(0,a.gO)(e),r=(0,a.S2)(e),s=((0,a.jW)("badges",t,r)??[]).map((t,e)=>e===o?i:t);return(0,a.z7)("badges",t,r,s)},P3:u,RB:(t,e,i)=>{const{cardIndex:o}=(0,a.gO)(e),s=(0,a.S2)(e),n=(0,a.jW)("badges",t,s)[o];let d=u(t,e);return d=((t,e,i)=>{const{cardIndex:o}=(0,a.gO)(e),r=(0,a.S2)(e),s=(0,a.jW)("badges",t,r),n=s?[...s.slice(0,o),i,...s.slice(o)]:[i];return(0,a.z7)("badges",t,r,n)})(d,i,(0,r.q)(n)),d},Sg:(t,e,i,o)=>{const r=e.views[o];return[l(e,o),c(t,i,r,!0)]},bn:(t,e,i)=>{const{cardIndex:o}=(0,a.gO)(e),r=(0,a.S2)(e),s=((0,a.jW)("cards",t,r)??[]).map((t,e)=>e===o?i:t);return(0,a.z7)("cards",t,r,s)},d6:(t,e,i)=>{const{cardIndex:o}=(0,a.gO)(e),r=(0,a.S2)(e),s=(0,a.jW)("cards",t,r),n=s?[...s]:[],d=o,c=Math.max(Math.min(i,n.length-1),0),l=n[d];n.splice(d,1),n.splice(c,0,l);return(0,a.z7)("cards",t,r,n)},fJ:c,gm:n,hB:(t,e,i)=>{const o=(0,a.ys)(t,e);let r=h(t,e[0],e[1]);return r=p(r,i[0],i[1],o),r},lD:l,pk:(t,e,i)=>{const r=(0,a.ys)(t,[e]);if((0,s.R6)(r))throw new Error("Duplicating sections in a strategy is not supported.");const n=(0,o.A)(r.sections[i]);return p(t,e,i+1,n)},sQ:(t,e,i)=>{const{cardIndex:o}=(0,a.gO)(e),r=(0,a.S2)(e),s=(0,a.jW)("cards",t,r)[o];let n=d(t,e);return n=((t,e,i)=>{const{cardIndex:o}=(0,a.gO)(e),r=(0,a.S2)(e),s=(0,a.jW)("cards",t,r),n=s?[...s.slice(0,o),i,...s.slice(o)]:[i];return(0,a.z7)("cards",t,r,n)})(n,i,s),n},tA:h})},78380(t,e,i){var o=i(16781),r=i(62228);async function s(t,e,i){try{const{path:s,silent:a}=i,n=e.config,d=(0,o.GO)(n,s);if(await e.saveConfig(d),a)return;e.showToast({message:t.localize("ui.common.successfully_deleted"),duration:8e3,action:{action:()=>(0,r.r)(window,"undo-change"),text:t.localize("ui.common.undo")}})}catch(i){console.error(i),e.showToast({message:t.localize("ui.common.deleting_failed")})}}i.d(e,{r:()=>s})},21737(t,e,i){i(18111),i(61701);var o=i(59199),r=i(82095);const s=t=>1===t.length?{viewIndex:t[0]}:{viewIndex:t[0],sectionIndex:t[1]};i.d(e,{},{$P:s,S2:t=>t.slice(0,-1),gO:t=>2===t.length?{viewIndex:t[0],cardIndex:t[1]}:{viewIndex:t[0],sectionIndex:t[1],cardIndex:t[2]},jW:(t,e,i)=>{const{viewIndex:a,sectionIndex:n}=s(i),d=e.views[a];if(!d)throw new Error("View does not exist");if((0,r.R6)(d))throw new Error("Can not find cards in a strategy view");if(void 0===n)return d[t];const c=d.sections?.[n];if(!c)throw new Error("Section does not exist");if((0,o.H)(c))throw new Error("Can not find cards in a strategy section");if("cards"===t)return c[t];throw new Error(`${t} is not supported in section`)},uZ:(t,e,i)=>{const{viewIndex:o,sectionIndex:a}=s(e);let n=!1;const d=t.views.map((t,e)=>{if(e!==o)return t;if(void 0===a)return n=!0,i;if((0,r.R6)(t))throw new Error("Can not update section in a strategy view");if(void 0===t.sections)throw new Error("Section does not exist");const s=t.sections.map((t,e)=>e!==a?t:(n=!0,i));return{...t,sections:s}});if(!n)throw new Error("Can not update cards in a non-existing view/section");return{...t,views:d}},ys:(t,e)=>{const{viewIndex:i,sectionIndex:o}=s(e),a=t.views[i];if(!a)throw new Error("View does not exist");if(void 0===o)return a;
1if((0,r.R6)(a))throw new Error("Can not find section in a strategy view");const n=a.sections?.[o];if(!n)throw new Error("Section does not exist");return n},z7:(t,e,i,a)=>{const{viewIndex:n,sectionIndex:d}=s(i);let c=!1;const l=e.views.map((e,i)=>{if(i!==n)return e;if((0,r.R6)(e))throw new Error(`Can not update ${t} in a strategy view`);if(void 0===d)return c=!0,{...e,[t]:a};if(void 0===e.sections)throw new Error("Section does not exist");const s=e.sections.map((e,i)=>{if(i!==d)return e;if((0,o.H)(e))throw new Error(`Can not update ${t} in a strategy section`);return c=!0,{...e,[t]:a}});return{...e,sections:s}});if(!c)throw new Error(`Can not update ${t} in a non-existing view/section`);return{...e,views:l}}})},30358(t,e,i){i.a(t,async function(t,e){try{i(88454),i(29452);var o=i(28861),r=i(11467),s=i(82476),a=i(5633),n=i(93584),d=i(52973),c=i(62228),l=(i(38753),i(999),i(7578)),h=i(53775),p=i(59087),u=i(16781),v=t([p]);p=(v.then?(await v)():v)[0];const g="M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z",y={delay:100,delayOnTouchOnly:!0,direction:"vertical",invertedSwapThreshold:.7,group:"card"},m={...y,sort:!1,group:{name:"card",put:!1}};class _ extends r.WF{setConfig(t){this._config=t}_getKey(t){return this._cardConfigKeys.has(t)||"object"!=typeof t||this._cardConfigKeys.set(t,Math.random().toString()),this._cardConfigKeys.get(t)}render(){if(!this.cards||!this._config)return r.s6;const t=this._config?.cards??[],e=Boolean(this.lovelace?.editMode&&!this.isStrategy),i=this.importOnly?m:y;return r.qy` <ha-sortable .disabled=${!e} @drag-start=${this._dragStart} @drag-end=${this._dragEnd} draggable-selector=".card" .rollback=${!1} .options=${i} @item-moved=${this._cardMoved} @item-added=${this._cardAdded} @item-removed=${this._cardRemoved} invert-swap> <div class="container ${(0,a.H)({"edit-mode":e})}"> ${(0,n.u)(t,t=>this._getKey(t),(t,i)=>{const o=this.cards[i];o.layout="grid";const s=o.getGridOptions(),{rows:n,columns:c}=(0,h.Ns)(s),l=[this.viewIndex,this.index,i];return r.qy` <div style=${(0,d.W)({"--column-size":"number"==typeof c?c:void 0,"--row-size":"number"==typeof n?n:void 0})}; class="card ${(0,a.H)({"fit-rows":"number"==typeof n,"full-width":"full"===c})}" .sortableData=${l}> ${e?r.qy` <hui-card-edit-mode .lovelace=${this.lovelace} .path=${l} .hiddenOverlay=${this._dragging} .noEdit=${this.importOnly} .noDuplicate=${this.importOnly}> ${o} </hui-card-edit-mode> `:o} </div> `})} ${e&&!this.importOnly?r.qy` <button class="add" @click=${this._addCard} aria-label=${this.hass.localize("ui.panel.lovelace.editor.section.add_card")} .title=${this.hass.localize("ui.panel.lovelace.editor.section.add_card")}> <ha-ripple></ha-ripple> <ha-svg-icon .path=${g}></ha-svg-icon> </button> `:r.s6} </div> </ha-sortable> `}_cardMoved(t){t.stopPropagation();const{oldIndex:e,newIndex:i}=t.detail,o=(0,u.sQ)(this.lovelace.config,[this.viewIndex,this.index,e],[this.viewIndex,this.index,i]);this.lovelace.saveConfig(o)}_cardAdded(t){const{index:e,data:i}=t.detail,o=i,r=[this.viewIndex,this.index,e],s=(0,u.sQ)(this.lovelace.config,o,r);this.lovelace.saveConfig(s)}_cardRemoved(t){t.stopPropagation()}_dragStart(){this._dragging=!0}_dragEnd(){this._dragging=!1}_addCard(){(0,c.r)(this,"ll-create-card",{suggested:["tile","heading"]})}static get styles(){return[l.RF,r.AH`:host{--base-column-count:12;--row-gap:var(--ha-section-grid-row-gap,8px);--column-gap:var(--ha-section-grid-column-gap,8px);--row-height:var(--ha-section-grid-row-height,56px);gap:var(--row-gap);flex-direction:column;display:flex}.container{--grid-column-count:calc(var(--base-column-count) * var(--column-span,1));grid-template-columns:repeat(var(--grid-column-count), minmax(0, 1fr));row-gap:var(--row-gap);column-gap:var(--column-gap);grid-auto-rows:auto;margin:0 auto;padding:0;display:grid}.card{border-radius:var(--ha-card-border-radius,var(--ha-border-radius-lg));grid-row:span var(--row-size,1);grid-column:span min(var(--column-size,1), var(--grid-column-count));position:relative}.container.edit-mode .card{min-height:calc((var(--row-height) - var(--row-gap)) / 2)}.card.fit-rows{height:calc((var(--row-size,1) * (var(--row-height) + var(--row-gap))) - var(--row-gap))}.card.full-width{grid-column:1/-1}.card:has(>*){display:block}
1.card:has(>[hidden]){display:none}.add{cursor:pointer;border-radius:var(--ha-card-border-radius,var(--ha-border-radius-lg));border:2px dashed var(--primary-color);height:var(--row-height);--ha-ripple-color:var(--primary-color);--ha-ripple-hover-opacity:.04;--ha-ripple-pressed-opacity:.12;background:0 0;outline:none;order:1;grid-area:span 1/span 3;position:relative}.add:focus{border-style:solid}.sortable-ghost{border-radius:var(--ha-card-border-radius,var(--ha-border-radius-lg))}`]}constructor(...t){super(...t),this.isStrategy=!1,this.cards=[],this.importOnly=!1,this._dragging=!1,this._cardConfigKeys=new WeakMap}}(0,o.Cg)([(0,s.MZ)({attribute:!1})],_.prototype,"hass",void 0),(0,o.Cg)([(0,s.MZ)({attribute:!1})],_.prototype,"lovelace",void 0),(0,o.Cg)([(0,s.MZ)({type:Number})],_.prototype,"index",void 0),(0,o.Cg)([(0,s.MZ)({attribute:!1})],_.prototype,"viewIndex",void 0),(0,o.Cg)([(0,s.MZ)({attribute:!1})],_.prototype,"isStrategy",void 0),(0,o.Cg)([(0,s.MZ)({attribute:!1})],_.prototype,"cards",void 0),(0,o.Cg)([(0,s.MZ)({attribute:"import-only",type:Boolean})],_.prototype,"importOnly",void 0),(0,o.Cg)([(0,s.wk)()],_.prototype,"_config",void 0),(0,o.Cg)([(0,s.wk)()],_.prototype,"_dragging",void 0),_=(0,o.Cg)([(0,s.EM)("hui-grid-section")],_),e()}catch(t){e(t)}})},53705(t,e,i){i.a(t,async function(t,e){try{i(18111),i(81148),i(7588),i(61701);var o=i(28861),r=i(33810),s=i(11467),a=i(82476),n=i(49302),d=i(742),c=i(30713),l=i(62228),h=i(99118),p=(i(47551),i(59199)),u=i(86844),v=i(41005),g=i(67212),y=i(76161),m=i(11051),_=i(70579),w=i(16781),b=i(78380),f=i(21737),C=i(20600),x=t([v,u,g,y]);[v,u,g,y]=x.then?(await x)():x;class E extends((0,u.M)(s.mN)){_createCardElement(t){const e=document.createElement("hui-card");return e.hass=this.hass,e.preview=this.preview,e.config=t,e.addEventListener("card-updated",t=>{t.stopPropagation(),this._cards=[...this._cards]}),e.load(),e}createRenderRoot(){return this}willUpdate(t){super.willUpdate(t);const e=t.get("config");if(t.has("config")&&(!e||this.config!==e))return void this._initializeConfig();if(!t.has("hass"))return;const i=t.get("hass");i&&this.hass&&(0,p.H)(this.config)&&"RUNNING"===this.hass.config.state&&("RUNNING"!==i.config.state||(0,C.X2)("section",this.config.strategy,i,this.hass))&&this._debounceRefreshConfig()}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("card-visibility-changed",this._cardVisibilityChanged)}connectedCallback(){super.connectedCallback(),this._updateVisibility(),this.addEventListener("card-visibility-changed",this._cardVisibilityChanged),this.hass&&this._config?.theme&&(0,c.Q)(this,this.hass.themes,this._config.theme)}update(t){if(super.update(t),this._layoutElement){if(t.has("hass")){this._cards.forEach(t=>{t.hass=this.hass}),this._layoutElement.hass=this.hass;const e=t.get("hass");e&&this.hass.themes===e.themes&&this.hass.selectedTheme===e.selectedTheme||(0,c.Q)(this,this.hass.themes,this._config?.theme)}t.has("lovelace")&&(this._layoutElement.lovelace=this.lovelace),t.has("preview")&&(this._layoutElement.preview=this.preview,this._cards.forEach(t=>{t.preview=this.preview})),t.has("importOnly")&&(this._layoutElement.importOnly=this.importOnly),t.has("_cards")&&(this._layoutElement.cards=this._cards),(t.has("hass")||t.has("preview")||t.has("_cards"))&&this._updateVisibility()}}async _initializeConfig(){let t={...this.config},e=!1;if((0,p.H)(t)&&(e=!0,t=await(0,C.xC)(t,this.hass)),t={...t,type:t.type||"grid"},e&&(0,d.b)(t,this._config))return;this._config=t,(0,c.Q)(this,this.hass.themes,this._config.theme);let i=!1;if(this._layoutElement&&this._layoutElementType===t.type?this._layoutElement.setConfig(t):(i=!0,this._createLayoutElement(this._config)),this._createCards(t),this._layoutElement.isStrategy=e,this._layoutElement.hass=this.hass,this._layoutElement.lovelace=this.lovelace,this._layoutElement.index=this.index,this._layoutElement.viewIndex=this.viewIndex,this._layoutElement.cards=this._cards,i){for(;this.lastChild;)this.removeChild(this.lastChild);this._updateVisibility()}}_updateVisibility(t){if(!this._layoutElement||!this._config)return;if(this.preview)return void this._setElementVisibility(!0);if(this._config.disabled)return void this._setElementVisibility(!1);if(!(t??(!this._config.visibility||(0,g.XH)(this._config.visibility,this.hass,this._conditionContext))))return void this._setElementVisibility(!1);const e=this._cards.length>0&&this._cards.every(t=>t.hidden);this._setElementVisibility(!e)}_setElementVisibility(t){this._layoutElement&&(this.hidden!==!t&&(this.style.setProperty("display",t?"":"none"),this.toggleAttribute("hidden",!t),(0,l.r)(this,"section-visibility-changed",{value:t})),this._layoutElement.parentElement||this.appendChild(this._layoutElement))}_createLayoutElement(t){this._layoutElement=(0,y.O)(t),this._layoutElementType=t.type,this._layoutElement.addEventListener("ll-create-card",t=>{t.stopPropagation(),this.lovelace&&(0,m.u)(this,{lovelaceConfig:this.lovelace.config,saveConfig:this.lovelace.saveConfig,path:[this.viewIndex,this.index],suggestedCards:t.detail?.suggested})}),this._layoutElement.addEventListener("ll-edit-card",t=>{if(t.stopPropagation(),!this.lovelace)return;const{cardIndex:e}=(0,f.gO)(t.detail.path),i=this.config;if((0,p.H)(i))return;const o=i.cards[e];(0,_.O)(this,{lovelaceConfig:this.lovelace.config,saveCardConfig:async t=>{const i=(0,w.bn)(this.lovelace.config,[this.viewIndex,this.index,e],t);await this.lovelace.saveConfig(i)},sectionConfig:i,cardConfig:o})}),this._layoutElement.addEventListener("ll-delete-card",t=>{t.stopPropagation(),this.lovelace&&(0,b.r)(this.hass,this.lovelace,t.detail)}),this._layoutElement.addEventListener("ll-duplicate-card",t=>{if(t.stopPropagation(),!this.lovelace)return;const{cardIndex:e}=(0,f.gO)(t.detail.path),i=this.config;if((0,p.H)(i))return;const o=i.cards[e];(0,_.O)(this,{lovelaceConfig:this.lovelace.config,saveCardConfig:async t=>{const e=(0,w.gm)(this.lovelace.config,[this.viewIndex,this.index],t);await this.lovelace.saveConfig(e)},cardConfig:o,sectionConfig:i,isNew:!0})}),this._layoutElement.addEventListener("ll-copy-card",t=>{if(t.stopPropagation(),!this.lovelace)return;const{cardIndex:e}=(0,f.gO)(t.detail.path),i=this.config;if((0,p.H)(i))return;const o=i.cards[e];this._clipboard=(0,r.A)(o)})}_createCards(t){t&&t.cards&&Array.isArray(t.cards)?this._cards=t.cards.map(t=>this._createCardElement(t)):this._cards=[]}constructor(...t){super(...t),this.preview=!1,this.importOnly=!1,this._cards=[],this._debounceRefreshConfig=(0,h.s)(()=>this._initializeConfig(),200),this._cardVisibilityChanged=()=>{this._updateVisibility()}}}(0,o.Cg)([(0,a.MZ)({attribute:!1})],E.prototype,"hass",void 0),(0,o.Cg)([(0,a.MZ)({attribute:!1})],E.prototype,"config",void 0),(0,o.Cg)([(0,a.MZ)({attribute:!1})],E.prototype,"lovelace",void 0),(0,o.Cg)([(0,a.MZ)({type:Boolean,reflect:!0})],E.prototype,"preview",void 0),(0,o.Cg)([(0,a.MZ)({type:Boolean,attribute:"import-only"})],E.prototype,"importOnly",void 0),(0,o.Cg)([(0,a.MZ)({type:Number})],E.prototype,"index",void 0),(0,o.Cg)([(0,a.MZ)({attribute:!1})],E.prototype,"viewIndex",void 0),(0,o.Cg)([(0,a.wk)()],E.prototype,"_cards",void 0),(0,o.Cg)([(0,n.I)({key:"dashboardCardClipboard",state:!1,subscribe:!1,storage:"sessionStorage"})],E.prototype,"_clipboard",void 0),E=(0,o.Cg)([(0,a.EM)("hui-section")],E),e()}catch(t){e(t)}})},88999(t,e,i){i(74423);i.d(e,{},{o:(t,e)=>`https://${t.config.version.includes("b")?"rc":t.config.version.includes("dev")?"next":"www"}.home-assistant.io${e}`})}}; 2//# sourceMappingURL=84751.8a37e67ccaa2f0ea.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.