import{r as t,c as i,h as e,g as s}from"./p-BIwHMk6j.js";import{n as r}from"./p-B3U_Lxk4.js";import{E as o}from"./p-CwMJvF_Z.js";import{n as a}from"./p-ooVD-6_a.js";const h=class{constructor(e){t(this,e),this.change=i(this,"change"),this.layout="grid",this.handleChangeFilter=t=>{t.stopPropagation(),this.filter=t.detail},this.isIncluded=(t,i)=>this.isSeparator(t)?!(0===i&&!t.text):!this.filter||t.text.toLocaleLowerCase().includes(this.filter.toLocaleLowerCase()),this.isEmptyGroup=(t,i,e)=>{if(!this.isSeparator(t))return!1;const s=e[i+1];return!s||this.isSeparator(s)},this.handleChange=t=>{t.preventDefault(),this.handleItemChange(t.detail)},this.handleKeyDown=t=>{var i;if(t.key!==o)return;const e=null===(i=this.host.shadowRoot)||void 0===i?void 0:i.querySelector("limel-list"),s=this.getItems().filter(a(this.isSeparator));e&&s.length>0&&(e.focus(),this.handleItemChange(s[0]))}}render(){return[e("limel-input-field",{key:"ecc09b391612ed807379fae5e4b175e6b87f4e9f",tabIndex:0,value:this.filter,type:"search","leading-icon":"search",placeholder:this.translator.get("webclient.global-search-route"),onChange:this.handleChangeFilter,onKeyDown:this.handleKeyDown}),e("limel-list",{key:"2e82f8ffdf20ef251967a27e26664519c2f03ca5",items:this.getItems(),type:"selectable",class:{"has-interactive-items":!0,"has-grid-layout":"grid"===this.layout},onChange:this.handleChange})]}isSeparator(t){return!!t&&"object"==typeof t&&"separator"in t}get navigator(){return this.platform.get(r.Navigator)}get translator(){var t;return null===(t=this.platform)||void 0===t?void 0:t.get(r.Translate)}handleItemChange(t){this.change.emit(t),this.filter=void 0,this.navigator.navigate(t.path)}getItems(){return this.items.filter(this.isIncluded).filter(a(this.isEmptyGroup))}static get delegatesFocus(){return!0}get host(){return s(this)}};h.style=":host(limebb-browser){isolation:isolate;display:flex;flex-direction:column;background-color:rgba(var(--contrast-100))}limel-input-field{position:sticky;top:0;z-index:1;padding:0.5rem 0.75rem;background-color:rgba(var(--contrast-100), 0.75);backdrop-filter:blur(0.25rem);-webkit-backdrop-filter:blur(0.25rem)}";export{h as limebb_browser}