(window.webpackJsonpNewland_Toubiz_Poi_Neos=window.webpackJsonpNewland_Toubiz_Poi_Neos||[]).push([[144],{zBxf:function(e,s,t){"use strict";t.r(s);var a=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",{directives:[{name:"observe-visibility",rawName:"v-observe-visibility",value:e.selectInput,expression:"selectInput"}],staticClass:"tb-w-area-filter"},[t("div",{staticClass:"flex items-center"},[t("label",{staticClass:"hidden",attrs:{for:"tb-w-area-filter__search-"+e._uid}},[e._v("\n            "+e._s(e.label||e.$t("message.searchAreas"))+"\n        ")]),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model",value:e.searchString,expression:"searchString"}],ref:"input",staticClass:"pl-2 pr-8 py-2 w-full text-sm",attrs:{type:"text",id:"tb-w-area-filter__search-"+e._uid,placeholder:e.label||e.$t("message.searchAreas")},domProps:{value:e.searchString},on:{input:function(s){s.target.composing||(e.searchString=s.target.value)}}}),e._v(" "),t("tb-w-icon",{staticClass:"absolute right-4",attrs:{icon:"magnifier",size:"1"}})],1),e._v(" "),t("ul",{staticClass:"h-64 -mr-2 mt-4 overflow-y-scroll"},[e._l(e.optionsToRender,(function(s){return[s.name.toLowerCase().includes(e.searchString)||""===e.searchString?t("li",{key:s.id,staticClass:"border-b border-gray-200 py-2 pr-4 text-sm",class:e.selectedAreas.includes(s.id)?"text-primary-500":"text-gray-800",attrs:{"data-area-name":s.name}},[t("label",{staticClass:"flex justify-between items-center w-full cursor-pointer",attrs:{for:s.id}},[e._v("\n                    "+e._s(s.name)+"\n\n                    "),e.selectedAreas.includes(s.id)?t("tb-w-icon",{attrs:{icon:"checkmark",size:".875"}}):e._e(),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model",value:e.selectedAreas,expression:"selectedAreas"}],staticClass:"hidden",attrs:{type:"checkbox",id:s.id},domProps:{value:s.id,checked:Array.isArray(e.selectedAreas)?e._i(e.selectedAreas,s.id)>-1:e.selectedAreas},on:{change:function(t){var a=e.selectedAreas,r=t.target,i=!!r.checked;if(Array.isArray(a)){var n=s.id,l=e._i(a,n);r.checked?l<0&&(e.selectedAreas=a.concat([n])):l>-1&&(e.selectedAreas=a.slice(0,l).concat(a.slice(l+1)))}else e.selectedAreas=i}}})],1)]):e._e()]}))],2),e._v(" "),t("div",{staticClass:"mt-6 flex justify-between"},[t("tb-w-button",{class:e.selectedAreas.length?"":"cursor-not-allowed",attrs:{variant:"tertiary",disabled:!e.selectedAreas.length},on:{click:e.reset}},[e._v("\n            "+e._s(e.$t("message.reset"))+"\n        ")]),e._v(" "),t("tb-w-button",{on:{click:function(s){return e.$emit("input",e.selectedAreas)}}},[e._v("\n            "+e._s(e.$t("message.apply"))+"\n        ")])],1)])};a._withStripped=!0;var r={name:"TbWAreaFilter",props:{options:{type:Object,required:!0},label:{type:String,default:null},filledOptions:{type:Object,required:!0},elementType:{type:String,required:!0},areaType:{type:String,required:!0}},data:()=>({selectedAreas:[],areas:null,searchString:""}),computed:{optionsToRender(){const e=[];for(const s of Object.keys(this.filledOptions))this.options[s]&&e.push({id:s,name:this.options[s]});return e.sort((e,s)=>e.name>s.name?1:s.name>e.name?-1:0),e}},async created(){this.selectedAreas=this.$store.state.filters[this.elementType].filter[this.areaType]||[],this.unsubscribe=this.$store.subscribe(async(e,s)=>{"setFilter"===e.type&&(this.selectedAreas=s.filters[this.elementType].filter[this.areaType]||[])})},beforeDestroy(){this.unsubscribe()},methods:{reset(){this.selectedAreas=[],this.$emit("input",[])},selectInput(e){e&&this.$refs.input.select()}},i18n:{fallbackLocale:"de",silentFallbackWarn:"undefined"==typeof window,messages:{de:{message:{reset:"Zurücksetzen",apply:"Anwenden",searchAreas:"Regionen suchen"}},en:{message:{reset:"Reset",apply:"Apply",searchAreas:"Search regions"}},fr:{message:{reset:"Réinitialiser",apply:"Appliquer",searchAreas:"Rechercher des régions"}},it:{message:{reset:"Ripristina",apply:"Applicare",searchAreas:"Cerca regioni"}},es:{message:{reset:"Reiniciar",apply:"Aplicar",searchAreas:"Regiones de búsqueda"}},nl:{message:{reset:"Resetten",apply:"Van toepassing zijn",searchAreas:"Search Zoek regio's"}},cz:{message:{reset:"Resetovat",apply:"Aplikovat",searchAreas:"Hledat regiony"}}}}},i=t("KHd+"),n=Object(i.a)(r,a,[],!1,null,null,null);n.options.__file="node_modules/@newland/toubiz-widget/src/components/basic/tb-w-area-filter.vue";s.default=n.exports}}]);