1import{d as J,t as $,M as x,N as A,A as D,v as Q,f as G,b as H,k as U,l as K,I as s,o as N}from"./vendor.DFAb0jsy.js";import{g as W}from"./listing-api.iB_HsVRM.js";import{a as X,g as Y}from"./app.OtV8efoB.js";import{u as Z}from"./use-facets.7lgoHe1l.js";import{u as ee}from"./use-jobs-listing-page-results.DSXN5Jbn.js";import{u as te}from"./use-listing-page-content-loader-helper.COaKG33U.js";const le=J({__name:"JobsListingPageContentLoader",props:{language:{},initialResults:{}},setup(I){const g=I,n=X(),i=x(),l=A(),p=$(""),{unselectAllFacets:h,facetsSelectedPerGroup:C,selectedFacets:f}=Z(),{facets:b,isLoading:u,jobs:S,orderBy:E,orderDirection:q,pageId:T,pageType:_,paginationCurrentPage:d,paginationPageSize:v,paginationTotalPages:m,totalResultsCount:P,setInitialResults:j}=ee(),{contentLoaderElement:c,isMobileView:y,allowPreviousRouteUpdate:k,shouldScroll:w,toggleFilters:F,watchQueryChanges:r,filtersElement:z}=te();j(g.initialResults),n.on("updateFacetsList",()=>void B()),n.on("clearFilters",()=>void L()),n.on("toggleFilters",()=>F());async function o({currentPage:e,filters:a}){u.value=!0;try{const{data:t}=await W({pageId:T.value,pageIndex:e,pageType:_.value,pageSize:v.value,pageLanguage:g.language,orderBy:E.value,orderDirection:q.value,filters:a});b.value=t.Filters,S.value=t.Pages,d.value=t.PageIndex,m.value=t.TotalPages,v.value=t.PageSize,P.value=t.TotalItems}catch(t){p.value=Y(t)}finally{u.value=!1,r(!0)}}async function B(){!y.value&&w()&&c.value?.scrollIntoView(),r(!1);const e=R();await i.push({query:{...l.query,filters:e||[],currentPage:1}}),await o({currentPage:1,filters:e})}async function M(e){w()&&c.value?.scrollIntoView(),r(!1);const a=R();await i.push({query:{...l.query,currentPage:e}}),await o({currentPage:e,filters:a})}async function L(){h(),r(!1),await i.push({query:{}}),await o({currentPage:1,filters:""})}async function O(e){const{currentPage:a=0,filters:t=""}=e;await o({currentPage:a,filters:t})}function R(){return Object.keys(f.value).map(e=>f.value[e]?.map(t=>`${e}:${t}`).join(":")).join(":")}const V=D(()=>C.value);return Q(()=>l.query,async e=>{k()&&await O(e)}),(e,a)=>(N(),G("div",{ref_key:"contentLoaderElement",ref:c},[H(e.$slots,"default",U(K({countOfSelectedFilters:V.value,error:p.value,isLoading:s(u),isMobileView:s(y),paginationCurrentPage:s(d),paginationTotalPages:s(m),totalResultsCount:s(P),clearFilters:L,toggleFilters:s(F),updateCurrentPage:M,filtersElement:s(z)})))],512))}});export{le 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.