export const __rspack_esm_id="51603";export const __rspack_esm_ids=["51603"];export const __webpack_modules__={44830(e,t,i){i.r(t),i.d(t,{CommonControlsSectionStrategy:()=>a});i(44114),i(18111),i(22489),i(61701);var n=i(62826),s=i(96196),c=i(97735),o=i(36312);class a extends s.mN{static async generate(e,t){const i={type:"grid",cards:[]};if(e.heading?i.cards?.push(e.heading):e.title&&i.cards?.push({type:"heading",heading:e.title,icon:e.icon,visibility:e.title_visibilty}),!(0,o.x)(t,"usage_prediction"))return i.cards.push({type:"markdown",content:t.localize("ui.panel.lovelace.strategy.common_controls.not_loaded")}),i.disabled=e.hide_empty,i;const n=await(e=>e.callWS({type:"usage_prediction/common_control"}))(t);let s=n.entities.filter(e=>{if(!(e in t.states))return!1;const i=t.entities[e];return!i?.hidden});e.exclude_entities?.length&&(s=s.filter(t=>!e.exclude_entities.includes(t))),e.include_entities?.length&&(s=s.filter(t=>!e.include_entities.includes(t)),s.unshift(...e.include_entities.filter(e=>e in t.states)));const c=e.limit??8;return s=s.slice(0,c),s.length>0?i.cards.push(...s.map(e=>({type:"tile",entity:e,state_content:["state","area_name"],show_entity_picture:!0}))):(i.cards.push({type:"markdown",content:t.localize("ui.panel.lovelace.strategy.common_controls.no_data")}),i.disabled=e.hide_empty),i}}a=(0,n.Cg)([(0,c.EM)("common-controls-section-strategy")],a)}};
//# sourceMappingURL=51603.00335ef6ba715d20.js.map