1import{t as N,S,N as n,P as V,C as O,_ as P,p as i,q as u,x as m,v as h,H as L,G as c,Q as G,I as E,u as C,F as f,a0 as T,X as R,Y as _,l as k,z as W,Z as y}from"./main-Cz0ounXw.js";import{t as M,a as b}from"./TagFilter-zdl3Wwsv.js";import{B as H}from"./BaseComponent.vue_vue_type_script_lang-YojWfnU5.js";import U from"./TagFilterResetBtn-Dp8uEChR.js";import{C as w}from"./index-spLsW197.js";import{S as $}from"./index-DPoLOxN2.js";import"./tagCategoriesFilterByAppBrand-LjF6ySrf.js";import"./BaseComponent.utils-ADJOHzt3.js";import"./FormItemContext-Ds5pljYr.js";var z=Object.defineProperty,j=Object.getOwnPropertyDescriptor,r=(e,t,s,l)=>{for(var g=l>1?void 0:l?j(t,s):t,p=e.length-1,d;p>=0;p--)(d=e[p])&&(g=(l?d(t,s,g):d(g))||g);return l&&g&&z(t,s,g),g};const q=w.Group,Q=$.Option;let o=class extends H{constructor(){super(...arguments),this.searchInputValue="",this.resTagFilters=[],this.tagsWithCategories=[]}created(){this.searchInputValue="",this.resTagFilters=[],this.tagsWithCategories=[]}get contentRepository(){return this.$locator.get(S.Repositories.Content)}get routingHelper(){return this.$locator.get(S.RoutingHelper)}async mounted(){await this.addCategoriesToTags()}async addCategoriesToTags(){const t=await M(this.contentRepository,this.$store.a
1ppBrand,this.tags.map(s=>s.value.tag._id));this.tagsWithCategories=this.tags.map(s=>{let l;return l=s,l.value.categories="",l}),this.tagsWithCategories.forEach((s,l)=>{s.value.tag.categories=t[l]})}onCheckboxGroupChange(t){if(this.onlyOneActive&&t.length>0){const s=t[t.length-1];this.emitTagChangeEvent([s])}else this.emitTagChangeEvent([...t])}onSelectChange(t){Array.isArray(t)?this.emitTagChangeEvent([...t]):t?this.emitTagChangeEvent([t]):this.emitTagChangeEvent([])}emitTagChangeEvent(t){return{groupId:this.groupId,newTags:t}}getMetaTitle(t){return t.value.icon&&t.value.icon.meta?t.value.icon.meta.title:""}getIconPath(t){return t.value.icon?this.routingHelper.getImagePath(t.value.icon.path):""}scrollToTop(){this.enableScrollToTop&&window.scrollTo({top:0,behavior:"smooth"})}get isButtonLayout(){return this.layoutType.includes(b.BUTTONS)}get isSelectLayout(){return this.layoutType.includes(b.SELECT)}get isLabelLayout(){return this.layoutType.includes(b.LABEL)}get tagFilters(){let t=[];return this.tagsWithCategories.map(s=>{t.push(this.getElementTagValue(s))}),t}filterDisplayText(t){return this.getElementTagValue(t)}triggerSearch(){let t=this.tagsWithCategories;if(this.resTagFilters=[],this.searchInputValue.length>0){const s=new RegExp(this.searchInputValue.toLocaleLowerCase(),"gi");t.forEach(l=>{if(this.getElementTagValue(l).toLocaleLowerCase().match(s)){let g=this.getElementTagValue(l);g=g.replace(/(<span class="search-result__highlight">|<\/span>)/gim,"");const p=g.replace(s,'<span class="search-result__highlight">$&</span>');this.checkedTags.includes(l.value.tag._id)||this.resTagFilters.push(p)}})}}getElementTagValue(t){return t.value.tag.display||t.value.tag.tag||""}resetSearch(){this.searchInputValue="",this.resTagFilters=[]}checkActive(t){let s=t;for(;s.includes('<span class="search-result__highlight">')&&s.includes("</span>");)s=s.replace('<span class="search-result__highlight">',""),s=s.replace("</span>","");let l=this.checkedTags;this.tagsWithCategories.forEach(g=>{const p=g.value.tag;(this.$helper.isCockpitLinkType(p)?p.display:p.tag)===s&&l.push(p._id)}),this.onSelectChange(l),this.resetSearch()}emitSearchDone(){return this.searchInputValue}generateUuid(){return Date.now().toString(36)+Math.random().toString(36).substring(2)}};r([n()],o.prototype,"groupId",2);r([n()],o.prototype,"tags",2);r([n()],o.prototype,"layoutType",2);r([n()],o.prototype,"onlyOneActive",2);r([n()],o.prototype,"groupName",2);r([n({default:()=>[]})],o.prototype,"checkedTags",2);r([n()],o.prototype,"filterButtonsClass",2);r([n()],o.prototype,"selectLabel",2);r([n()],o.prototype,"selectPlaceholder",2);r([n({default:!1})],o.prototype,"enableScrollToTop",2);r([n()],o.prototype,"showSearch",2);r([n()],o.prototype,"searchLabel",2);r([n()],o.prototype,"filterResetBtnClass",2);r([n()],o.prototype,"filterResetBtnText",2);r([n({default:!1})],o.prototype,"filterResetBtnIsActive",2);r([n({default:!1})],o.prototype,"showResetBtn",2);r([n({default:null})],o.prototype,"resetFilters",2);r([V("tagChange")],o.prototype,"emitTagChangeEvent",1);r([V("search")],o.prototype,"emitSearchDone",1);o=r([O({components:{"tag-filter-reset-btn":U,"a-checkbox":w,"a-checkbox-group":q,"a-select":$,"a-select-option":Q}})],o);const X=N(o),Y={key:0,class:"tag-group__name tag-group__item"},Z={key:1,class:"tag-group__search tag-group__item"},J=["for"],K={class:"tag-group__search-input"},x=["id"],ee={key:1,class:"tag-group__search-results"},te={class:"tag-group__search-results-list"},ae=["onClick"],se=["data-src","alt","title"],oe={key:3,class:"tag-filter__select tag-group__item"},re=["for"],le={key:4,class:"tag-filter__label"},ie=["value"];function ne(e,t,s,l,g,p){const d=y("tag-filter-reset-btn"),B=y("a-checkbox"),A=y("a-checkbox-group"),F=y("a-select-option"),D=y("a-select"),v=W("html-fragment");return i(),u("div",{class:C(["tag-group",{"text-center":e.isButtonLayout}])},[e.groupName?m((i(),u("div",Y,null,512)),[[v,e.groupName]]):h("",!0),e.showSearch?(i(),u("div",Z,[e.searchLabel?.trim()?(i(),u("label",{key:0,for:`tag-filter-search-${e.groupId}`,class:"form-label"},L(e.searchLabel),9,J)):h("",!0),c("div",K,[m(c("input",{id:`tag-filter-search-${e.groupId}`,"onUpdate:modelValue":t[0]||(t[0]=a=>e.searchInputValue=a),class:"form-control",type:"text",placeholder:"Suche nac
1h Namen",onInput:t[1]||(t[1]=a=>e.triggerSearch()),onBlur:t[2]||(t[2]=(...a)=>e.emitSearchDone&&e.emitSearchDone(...a))},null,40,x),[[G,e.searchInputValue]]),c("button",{class:C(["btn btn-link",e.searchInputValue.length>0?"active":"search"]),onClick:t[3]||(t[3]=E(a=>e.searchInputValue.length>0?e.resetSearch():e.triggerSearch(),["prevent"]))},[...t[5]||(t[5]=[c("i",{class:"fa-solid fa-magnifying-glass"},null,-1)])],2)]),e.resTagFilters.length>0?(i(),u("div",ee,[c("ul",te,[(i(!0),u(f,null,T(e.resTagFilters,a=>m((i(),u("li",{key:a+e.generateUuid(),class:"tag-group__search-results-item",onClick:E(I=>e.checkActive(a),["prevent"])},null,8,ae)),[[v,a]])),128))])])):h("",!0)])):h("",!0),e.isButtonLayout?(i(),R(A,{key:2,class:"tag-filter__tags tag-group__item btn-group-toggle","data-bs-toggle":"buttons",value:e.checkedTags,onChange:e.onCheckboxGroupChange},{default:_(()=>[k(d,{filterResetBtnClass:e.filterResetBtnClass,filterResetBtnText:e.filterResetBtnText,filterResetBtnIsActive:e.filterResetBtnIsActive,showResetBtn:e.showResetBtn,onClick:e.resetFilters},null,8,["filterResetBtnClass","filterResetBtnText","filterResetBtnIsActive","showResetBtn","onClick"]),(i(!0),u(f,null,T(e.tagsWithCategories,a=>(i(),u("label",{key:a.value?.tag?._id,class:C(["tag-filter__tag-item btn",e.filterButtonsClass,e.checkedTags.includes(a.value?.tag?._id)?"active":"",a.value?.tag?.categories]),onClick:t[4]||(t[4]=(...I)=>e.scrollToTop&&e.scrollToTop(...I))},[a.value.icon?(i(),u("img",{key:0,"data-src":e.getIconPath(a),alt:e.getMetaTitle(a),title:e.getMetaTitle(a),class:"lazy rs_skip img-fluid lc-image"},null,8,se)):h("",!0),k(B,{value:a.value.tag._id},null,8,["value"]),m(c("span",null,null,512),[[v,e.filterDisplayText(a)]])],2))),128))]),_:1},8,["value","onChange"])):h("",!0),e.isSelectLayout?(i(),u("div",oe,[e.selectLabel?.trim()?(i(),u("label",{key:0,for:`tag-filter-group-select-${e.groupId}`,class:"form-label"},L(e.selectLabel),9,re)):h("",!0),k(D,{id:`tag-filter-group-select-${e.groupId}`,allowClear:"",popupClassName:"tag-filter__select-dropdown",style:{width:"100%"},value:e.onlyOneActive?e.checkedTags[0]:e.checkedTags,mode:e.onlyOneActive?"default":"multiple",placeholder:e.selectPlaceholder,onChange:e.onSelectChange},{default:_(()=>[(i(!0),u(f,null,T(e.tags,a=>(i(),R(F,{key:a.value?.tag?._id,value:a.value?.tag?._id},{default:_(()=>[m(c("span",null,null,512),[[v,e.filterDisplayText(a)]])]),_:2},1032,["value"]))),128))]),_:1},8,["id","value","mode","placeholder","onChange"])])):h("",!0),e.isLabelLayout?(i(),u("div",le,[(i(!0),u(f,null,T(e.tags,a=>m((i(),u("span",{key:a.value?.tag?._id,value:a.value?.tag?._id},null,8,ie)),[[v,e.filterDisplayText(a)]])),128))])):h("",!0)],2)}const Te=P(X,[["render",ne],["__scopeId","data-v-f6082c05"]]);export{o as TagGroup,Te as default};
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.