1import{P as ee,_ as te}from"./DyhyJT5Q.js";import{a1 as re,c_ as h,c$ as ae,d0 as oe,af as le,r as w,c as u,c3 as se,a3 as ie,D as z,M as n,N as d,ag as l,ai as m,ah as e,al as g,aJ as x,aK as T,a5 as v,ak as ce,aF as $,am as Y,an as L,aA as ne}from"./CqWH0BZP.js";import{g as b}from"./RrNCYXFM.js";import"./C6nNTBQ1.js";import"./Dq_8iFRl.js";import"./CRPoBB0N.js";import"./C3e4t58V.js";import"./DKeuBCMA.js";import"./BoA7liN9.js";const de={class:"close"},pe=["innerHTML"],ge={class:"header"},ue=["aria-label","id","onClick"],me={class:"sort"},fe=["innerHTML"],he=["onClick","id"],ve=["innerHTML"],ye={key:0,class:"price-range-slider"},be={class:"price-range-header"},Ce={class:"price-range-slider-title"},ke=["aria-label"],_e=["innerHTML"],De={key:1,class:"date-filter-section"},Se={class:"date-filter-header"},Pe={class:"date-filter-title"},we=["onKeydown"],xe={class:"clear-text"},Te=["innerHTML"],$e={class:"date-filter-fields"},Re={class:"header"},Me={class:"list-service-categories"},Ve=["onChange"],Fe=["id","checked"],ze=["id"],Ye={class:"bottom-container"},Le=re({__name:"ServicesFilter",props:{categories:{},sortOptions:{},selectedCategories:{default:()=>[]},selectedSort:{default:""},sortType:{default:""},labels:{default:()=>({})},cssVariablePrefix:{default:"cal_services_widget"},fullOverlay:{type:Boolean,default:!0},showSortFirst:{type:Boolean,default:!0},sliderDetails:{},showPriceRange:{type:Boolean,default:!1},currentPriceRange:{},defaultPriceRange:{},showCategory:{type:Boolean,default:!0},compactSort:{type:Boolean,default:!1},showDateFilter:{type:Boolean,default:!1},dateFilterStartDate:{default:""},dateFilterEndDate:{default:""},dateFilterDisabledDates:{type:Function,default:void 0},timezone:{},startDayOfWeek:{default:0}},emits:["close","apply","clearAll","sortChange","priceRangeChange","date-filter-start-change","date-filter-end-change","date-filter-apply","date-filter-clear"],setup(B,{emit:E}){h.extend(ae),h.extend(oe);const{t:s}=le(),t=B,p=E,C=w(!1),k=w(!1),H={sortBy:"sort_by",categories:"categories",clearAll:"clear_all",apply:"apply"},_=u(()=>({...H,...t.labels})),o=se({selectedCategories:[],sortType:"",selectedSort:""});ie(()=>{o.selectedCategories=[...t.selectedCategories],o.selectedSort=t.selectedSort,o.sortType=t.sortType,z(()=>{C.value=!0})});const R=(r,i)=>t.selectedSort===r.split("_")[0]&&t.sortType===i,D=()=>{k.value=!0,setTimeout(()=>{p("close")},200)},N=()=>{o.selectedCategories=[],o.selectedSort="",o.sortType="",p("clearAll"),D()},A=()=>{p("apply",{selectedCategories:[...o.selectedCategories],selectedSort:o.selectedSort,sortType:o.sortType}),t.showDateFilter&&!q.value&&p("date-filter-apply"),D()},O=r=>{o.selectedCategories.includes(r)?o.selectedCategories=o.selectedCategories.filter(i=>i!==r):o.selectedCategories.push(r)},K=(r,i)=>{o.selectedSort=r.split("_")[0],o.sortType=i,p("sortChange",{sortId:r.split("_")[0],sortType:i})},U=u(()=>[{id:"name",name:s("name")},{id:"price",name:s("price")}]),W=r=>{o.selectedSort===r?o.sortType=o.sortType==="asc"?"desc":"asc":(o.selectedSort=r,o.sortType="asc"),p("sortChange",{sortId:o.selectedSort,sortType:o.sortType})},f=u(()=>t.cssVariablePrefix),c=u(()=>({textColor:`var(--${t.cssVariablePrefix}-text-color)`,lightTextColor:`var(--${t.cssVariablePrefix}-light-text-color)`,primaryColor:`var(--${t.cssVariablePrefix}-primary-color)`,borderColor:`var(--${t.cssVariablePrefix}-border-color)`,backgroundColor:`var(--${t.cssVariablePrefix}-background-color)`,lightPrimaryColor:`var(--${t.cssVariablePrefix}-light-primary-color)`})),j=u(()=>!t.currentPriceRange||!t.defaultPriceRange?!1:t.currentPriceRange[0]!==t.defaultPriceRange[0]||t.currentPriceRange[1]!==t.defaultPriceRange[1]),G=()=>{t.defaultPriceRange&&p("priceRangeChange",[...t.defaultPriceRange])},M=u(()=>t.timezone?h().tz(t.timezone).format("YYYY-MM-DD"):h().format("YYYY-MM-DD")),V=w(null),J=u(()=>t.dateFilterStartDate||M.value),q=u(()=>!t.dateFilterStartDate||!t.dateFilterEndDate),I=u(()=>!!t.dateFilterStartDate||!!t.dateFilterEndDate),F=r=>r?t.timezone?h(r).tz(t.timezone).format("YYYY-MM-DD"):h(r).format("YYYY-MM-DD"):"",Q=r=>{const i=F(r);
1if(p("date-filter-start-change",i),t.dateFilterEndDate&&i>t.dateFilterEndDate&&p("date-filter-end-change",i),i){const y=h(i);z(()=>{V.value?.setView(y.month(),y.year())})}},X=r=>{p("date-filter-end-change",F(r))},P=()=>{p("date-filter-clear")};return(r,i)=>{const y=te;return n(),d("div",{class:m(["filter-overlay",{visible:e(C),closing:e(k)}]),style:ne({"--filter-widget-background-color":`var(--${e(f)}-background-color)`,"--filter-widget-text-color":`var(--${e(f)}-text-color)`,"--filter-widget-border-color":`var(--${e(f)}-border-color)`,"--filter-widget-primary-color":`var(--${e(f)}-primary-color)`,"--filter-widget-light-text-color":`var(--${e(f)}-light-text-color)`,"--filter-widget-light-primary-color":`var(--${e(f)}-light-primary-color)`})},[l("div",{class:m(["backdrop",{visible:e(C),closing:e(k)}]),onClick:D},null,2),l("div",{class:m(["services-filter-bottom-sheet",{visible:e(C),closing:e(k)}])},[l("div",de,[l("div",{onClick:D,role:"button",tabindex:"0","aria-label":"Close",class:"close-icon",id:"mobile-close-filter-icon",innerHTML:e(b)({svgName:"close",color:"var(--filter-widget-text-color)"})},null,8,pe)]),l("div",{class:m(["filter-main-container",{"category-first":!r.showSortFirst}])},[l("div",null,[l("div",{class:m(["service-sort-dropdown",{"no-borders":r.showPriceRange}])},[l("div",ge,[l("div",null,g(e(s)(e(_).sortBy)),1)]),t.compactSort?(n(!0),d(x,{key:0},T(e(U),a=>(n(),d("div",{key:a.id,class:m(["single-sort",{"active-sort":e(o).selectedSort===a.id}]),role:"button",tabindex:"0","aria-label":a.name,id:`sort-${a.id}`,onClick:S=>W(a.id)},[l("div",me,g(a.name),1),l("div",{class:m(["sort-direction-arrow",{"sort-desc":e(o).selectedSort===a.id&&e(o).sortType==="desc","sort-active":e(o).selectedSort===a.id}]),innerHTML:e(b)({svgName:"arrowUp",color:e(o).selectedSort===a.id?`var(--${t.cssVariablePrefix}-primary-color)`:`var(--${t.cssVariablePrefix}-light-text-color)`})},null,10,fe)],10,ue))),128)):(n(!0),d(x,{key:1},T(t.sortOptions,(a,S)=>(n(),d("div",{key:S,class:m(["single-sort",{"active-sort":R(a.id,a.sortType)}])},[l("div",{class:"sort",onClick:Z=>K(a.id,a.sortType),role:"button",tabindex:"0",id:`sort-${a.id}`},g(a.name),9,he),R(a.id,a.sortType)?(n(),d("div",{key:0,class:"check-icon",innerHTML:e(b)({svgName:"check",color:`var(--${t.cssVariablePrefix}-primary-color)`})},null,8,ve)):v("",!0)],2))),128))],2),r.showPriceRange?(n(),d("div",ye,[l("div",be,[l("div",Ce,g(e(s)("price_range")),1),e(j)?(n(),d("button",{key:0,onClick:G,class:"reset-price-range-btn",type:"button","aria-label":e(s)("price_range")},[l("div",{class:"reset-icon",innerHTML:e(b)({svgName:"refresh",color:e(c).primaryColor})},null,8,_e),ce(" "+g(e(s)("reset")),1)],8,ke)):v("",!0)]),$(ee,{"model-value":r.sliderDetails?.priceRange,title:e(s)("price_range"),min:0,max:r.sliderDetails.max,step:r.sliderDetails.step,currency:r.sliderDetails.currency,onChange:i[0]||(i[0]=a=>p("priceRangeChange",a)),prefix:e(f)},null,8,["model-value","title","max","step","currency","prefix"])])):v("",!0),r.showDateFilter?(n(),d("div",De,[l("div",Se,[l("div",Pe,g(e(s)("availability")),1),e(I)?(n(),d("div",{key:0,class:"clear-dates",tabindex:"0",onClick:P,onKeydown:[Y(L(P,["prevent"]),["enter"]),Y(L(P,["prevent"]),["space"])],role:"button","aria-label":"Clear dates"},[l("span",xe,g(e(s)("clear")),1),l("div",{class:"clear-icon",innerHTML:e(b)({svgName:"circleCross",color:e(c).lightTextColor})},null,8,Te)],40,we)):v("",!0)]),l("div",$e,[$(y,{"model-value":r.dateFilterStartDate,"onUpdate:modelValue":Q,"show-date":!0,"show-time":!1,"date-picker-label":e(s)("from"),"date-placeholder":e(s)("select_start_date"),"min-date":e(M),"disabled-dates":r.dateFilterDisabledDates,"hide-year-navigation":!0,timezone:r.timezone,"start-day-of-week":r.startDayOfWeek,"text-color":e(c).textColor,"light-text-color":e(c).lightTextColor,"primary-color":e(c).primaryColor,"border-color":e(c).borderColor,"background-color":e(c).backgroundColor,"light-primary-color":e(c).lightPrimaryColor},null,8,["model-value","date-picker-label","date-placeholder","min-date","disabled-dates","timezone","start-day-of-week","text-color","light-text-color","primary-color","border-color","background-color","light-primary-color"]),$(y,{ref_key:"endDatePickerRef",ref:V,"model-value":r.dateFilterEndDate,"onUpdate:modelValue":X,"show-date":!0,"show-time":!1,"date-picker-label":e(s)("to"),"date-placeholder":e(s)("select_end_date"),"min-date":e(J),"disabled-dates":r.dateFilterDisabledDates,"hide-year-navigation":!0,timezone:r.timezone,"start-
1day-of-week":r.startDayOfWeek,"text-color":e(c).textColor,"light-text-color":e(c).lightTextColor,"primary-color":e(c).primaryColor,"border-color":e(c).borderColor,"background-color":e(c).backgroundColor,"light-primary-color":e(c).lightPrimaryColor},null,8,["model-value","date-picker-label","date-placeholder","min-date","disabled-dates","timezone","start-day-of-week","text-color","light-text-color","primary-color","border-color","background-color","light-primary-color"])])])):v("",!0)]),r.showCategory?(n(),d("div",{key:0,class:m(["service-categories-container",{"no-borders":r.showPriceRange}])},[l("div",Re,[l("div",null,g(e(s)(e(_).categories)),1)]),l("div",Me,[(n(!0),d(x,null,T(t.categories,(a,S)=>(n(),d("div",{key:S,class:"single-category",onChange:Z=>O(a.id),role:"button"},[l("input",{type:"checkbox",id:`category-${a.id}`,checked:e(o).selectedCategories.includes(a.id)},null,8,Fe),l("div",{class:"category-name",id:`category-name-${a.id}`},g(a.count!==void 0?`${a.name} (${a.count})`:a.name),9,ze)],40,Ve))),128))])],2)):v("",!0)],2),l("div",Ye,[l("div",{class:"clear-all",onClick:N,role:"button",tabindex:"0"},g(e(s)(e(_).clearAll)),1),l("div",{class:"apply",onClick:A,role:"button",tabindex:"0"},g(e(s)(e(_).apply)),1)])],2)],6)}}}),je=Object.assign(Le,{__name:"PreviewElementsServicesCommonServicesFilter"});export{je 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.