export const __rspack_esm_id=4604;export const __rspack_esm_ids=[4604];export const __webpack_modules__={50903(e,t,i){i.r(t),i.d(t,{CommonControlsSectionStrategy:()=>r});i(74423),i(44114),i(18111),i(22489),i(61701);var n=i(15697),s=i(57527),c=i(79224),o=i(98295);const a=e=>({type:"tile",entity:e,state_content:["state","area_name"],show_entity_picture:!0});class r extends s.mN{static async generate(e,t){const i={type:"grid",cards:[]};e.heading?i.cards?.push(e.heading):e.title&&i.cards?.push({type:"heading",heading:e.title,icon:e.icon,visibility:e.title_visibilty});const n=e.limit??8,s=(e.include_entities||[]).filter(e=>e in t.states);if(s.length>=n)return i.cards.push(...s.slice(0,n).map(a)),i;if(!(0,o.x)(t.config,"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 c=await(e=>e.callWS({type:"usage_prediction/common_control"}))(t),r=c.entities.filter(i=>i in t.states&&(!t.entities[i]?.hidden&&(!e.exclude_entities?.includes(i)&&!s.includes(i)))),l=[...s,...r].slice(0,n);return 0===l.length?(i.cards.push({type:"markdown",content:t.localize("ui.panel.lovelace.strategy.common_controls.no_data")}),i.disabled=e.hide_empty,i):(i.cards.push(...l.map(a)),i)}}r.registryDependencies=[],r=(0,n.Cg)([(0,c.EM)("common-controls-section-strategy")],r)}};
//# sourceMappingURL=4604.0ec24429276d3bc3.js.map