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F,EAAa,EAAC,KAAEC,EAAO,IAAOqF,EACtClK,KAAKsG,YAAczB,EACnB7E,KAAK8J,aAAa,CACdnB,OAAO,EACPb,kBAAmBlD,EAAa,GAAK5E,KAAK+F,aAE9C/F,KAAKsG,aAAahE,OAAS,EACrBtC,KAAKuG,YAAYkB,eACjBzH,KAAKuG,YAAYoC,OAC3B,CAAE,MAAOxD,GACLG,QAAQH,MAAMA,EAClB,CACJ,E,kFCnKJ,IAAqCQ,EAArCwE,GAAqCxE,EAArClG,EAAA,OAAqCkG,EAAAC,WAAAD,EAAA,CAAAE,QAAAF,GAJrC,MACMyE,EAAyB,qBAoD9B1K,EAAAA,QA/Cc,MACXC,WAAAA,CAAYmG,GACR9F,KAAK8F,IAAMA,EACPA,GACA9F,KAAKqK,aAEb,CAEAA,WAAAA,GAUI,OATKrK,KAAKsK,YACNtK,KAAKsK,UAAY,IAAIC,EAAAA,QAhBP,gBAgBkC,CAC5CC,aAAcJ,EACdK,YAAaL,EACbM,OAjBkB,wBAkBlBC,mBAAoB,KACpBC,iBAAiB,KAGlB5K,KAAKsK,SAChB,CAEAO,WAAAA,GACI,OAAO7K,KAAKsK,WAAatK,KAAKqK,aAClC,CAEAS,UAAAA,GACIxF,QAAQyF,IAAI/K,KAAK6K,cAAcG,kBACnC,CAEArC,KAAAA,GACI3I,KAAK6K,cAAcI,UACnBjL,KAAKsK,UAAY,IACrB,CAEAY,WAAAA,CAAYC,GACRnL,KAAK6K,cAAcO,SAASD,EAChC,CAEAE,MAAAA,GACIrL,KAAK6K,cAAcQ,QACvB,CAEA5D,YAAAA,GACI,MAAM6C,EAAYtK,KAAK6K,cACvBP,EAAUgB,cACVhB,EAAUe,QACd,E","sources":["webpack://frontendplaceholder/./Src/Scripts/components/JobFilter/Utils.js","webpack://frontendplaceholder/./Src/Scripts/components/jobseeker-hero.js","webpack://frontendplaceholder/./Src/Scripts/components/masonry-utils.js"],"sourcesContent":["import {\n GET_JOBS_URL,\n HIDE_CSS_CLASS,\n URL_PARAMS_SEPERATOR,\n REGION_FILTER_NAME,\n} from './constants';\n\nexport default class Utils {\n constructor({\n disableFetchJobs = false,\n onLoadingCallbacks = [],\n getPagination,\n }) {\n this.fetchIsLoading = false;\n this.disableFetchJobs = disableFetchJobs;\n this.onFetchResultCallbacks = [];\n this.onLoadingCallbacks = onLoadingCallbacks;\n this.getPagination = getPagination;\n this.abortController = new AbortController();\n }\n\n addCallbackToOnFetchResult(callback) {\n this.onFetchResultCallbacks.push(callback);\n }\n\n addCallbackToOnLoading(callback) {\n this.onLoadingCallbacks?.push(callback);\n }\n\n setDisableFetchJobs(val) {\n this.disableFetchJobs = val;\n }\n\n abortFetch() {\n this.abortController?.abort();\n this.fetchIsLoading = false;\n this.abortController = new AbortController();\n }\n\n setFilterBadgeNumbers(filters, number) {\n filters.forEach((filter) => {\n this.setFilterBadgeNumber(filter, number);\n });\n }\n\n setFilterBadgeNumber(filterElement, number) {\n const badge = filterElement.querySelector('.badge');\n const badgeNumber = number;\n badgeNumber && badgeNumber > 0\n ? badge.classList.remove(HIDE_CSS_CLASS)\n : badge.classList.add(HIDE_CSS_CLASS);\n badge.innerHTML = badgeNumber;\n }\n\n getUrlParams() {\n const searchParams = window.location.search;\n return new URLSearchParams(searchParams ? searchParams.toString() : '');\n }\n\n updateURLParams(paramStr = '') {\n const newParams = new URLSearchParams(paramStr);\n const newRelativePathQuery =\n window.location.pathname +\n (paramStr ? '?' + newParams.toString() : '');\n history.pushState(null, '', newRelativePathQuery);\n }\n\n resetFetch() {\n if (this.onFetchResultCallbacks) {\n this.onFetchResultCallbacks.forEach((c) =>\n c(Promise.resolve(null)),\n );\n }\n }\n\n async fetchQuery({ fetchMore = false } = {}) {\n if (this.disableFetchJobs) {\n return;\n }\n // because a user potentially can trigger a lot of requests (by changing each filter type)\n // we have to avoid too many concurrent requests\n if (this.fetchIsLoading) {\n this.abortFetch();\n }\n this.fetchIsLoading = true;\n this.onLoadingCallbacks?.forEach((fun) => fun(true));\n\n const searchParams = this.getUrlParams();\n const { page, pageSize } = this?.getPagination() ?? {\n page: 1,\n pageSize: 10,\n };\n\n // the backend counts from page 0\n searchParams.append('page', page - 1);\n searchParams.append('pageSize', pageSize);\n\n // add language too\n const languageElement = document.querySelector('[data-job-language]');\n const language = languageElement?.innerText;\n if (language) {\n searchParams.append('language', language);\n }\n else {\n searchParams.append(\n 'language',\n window.location.pathname.indexOf('/en/') > -1 ? 'gb' : 'dk',\n );\n } \n\n // Retrieve the job brand from the HTML element\n const jobBrandElement = document.querySelector('[data-job-brand]');\n const jobBrand = jobBrandElement?.innerText;\n if (jobBrand) {\n searchParams.append('brand', jobBrand);\n }\n const signal = this.abortController.signal;\n try {\n const response = await fetch(\n GET_JOBS_URL + (searchParams ? `?${searchParams}` : ''),\n {\n signal,\n },\n );\n if (!response.ok) {\n throw new Error(`HTTP error! Status: ${response.status}`);\n }\n const resultPromise = await response.json();\n\n // ensure to display the selected regions for found jobs\n // if searched by region\n const regionParams = searchParams\n .get(REGION_FILTER_NAME)\n ?.split(URL_PARAMS_SEPERATOR);\n if (regionParams?.length > 0 && resultPromise.totalItems) {\n resultPromise.jobs.forEach((job) => {\n job.location.zipCodes = job.location.zipCodes.filter(\n ({ id }) => regionParams.includes(id.toString()),\n );\n });\n }\n this.onFetchResultCallbacks.forEach((c) =>\n c(resultPromise, fetchMore),\n );\n } catch (error) {\n // no need to log aborts\n if (typeof error !== DOMException && error.name !== 'AbortError') {\n console.error(error);\n }\n this.onFetchResultCallbacks.forEach((c) => c({}, fetchMore));\n } finally {\n this.onLoadingCallbacks?.forEach((fun) => fun(false));\n this.fetchIsLoading = false;\n }\n }\n}\n","import JobFilter from './JobFilter/job-filter';\nimport Utils from './JobFilter/Utils';\nimport MasonryUtils from './masonry-utils';\n\nconst PAGE = 1;\nconst PAGE_SIZE = 4;\n\nexport default class JobseekerHero {\n constructor(elm) {\n this.elm = elm;\n this.breakpoint = window.matchMedia('(min-width:992px)')?.matches;\n\n // Ensure required elements exist\n this.jobFilterNode = elm.querySelector('[data-job-filter-container]');\n this.jobsDisplayNode = elm.querySelector('[data-job-list-view]');\n this.gitterTemplate = elm.querySelector('[data-gitter-template]');\n this.gitterBtnTemplate = elm.querySelector('[data-gitter-btn-template]');\n\n // if they dont exist, stop execution with return\n if (!this.jobFilterNode || !this.jobsDisplayNode || !this.gitterTemplate || !this.gitterBtnTemplate) {\n //console.error('Error: Required elements are missing in the DOM.');\n return;\n }\n\n this.currentJobs = [];\n this.msonryUtils = new MasonryUtils();\n\n this.utils = new Utils({\n getPagination: this.getPagination.bind(this),\n });\n\n this.utils.addCallbackToOnFetchResult(\n this.onFetchJobsResult.bind(this),\n );\n\n this.jobFilters = new JobFilter(this.jobFilterNode, {\n utils: this.utils,\n setFetchResult: this.onFetchJobsResult.bind(this),\n getPagination: this.getPagination.bind(this),\n onReset: this.onResetFilters.bind(this),\n onSearchBtnClick: this.getFindJobUrlMobile.bind(this),\n fetchOnInit: false,\n });\n\n // Check if gitterBtnTemplate has content\n if (this.gitterBtnTemplate.content) {\n const filterLinkElement = this.gitterBtnTemplate.content.querySelector('[data-filter-link]');\n this.findJobUrl = filterLinkElement ? filterLinkElement.href : '';\n } else {\n //console.error('Error: gitterBtnTemplate content is null.');\n this.findJobUrl = ''; // Fallback to an empty string or some default URL\n }\n\n // Initialize masonry layout\n this.msonryUtils.reloadLayout();\n\n // Optionally, add a listener for changes in screen size\n this.setupMediaQueryListener();\n }\n\n setupMediaQueryListener() {\n const mediaQueryList = window.matchMedia('(min-width:992px)');\n mediaQueryList.addEventListener('change', (event) => {\n this.breakpoint = event.matches;\n });\n }\n\n getGitterBtnTemplate(addEmptyContainer = false) {\n const template = document.importNode(\n this.gitterBtnTemplate.content,\n true,\n );\n if (addEmptyContainer) {\n const bodyNode = template.querySelector('[data-container]');\n bodyNode.parentNode.removeChild(bodyNode);\n } else {\n template.querySelector('.see-more').classList.remove('see-more');\n template.querySelector('[data-filter-link]').href =\n this.getFindJobUrl();\n }\n return template;\n }\n\n getFindJobUrl() {\n const jobsFound = this.currentJobs?.length > 0;\n const urlParms = this.utils.getUrlParams()?.toString();\n return `${this.findJobUrl}${urlParms && jobsFound ? '?' + urlParms : ''}`;\n }\n\n getFindJobUrlMobile() {\n window.location.href = this.getFindJobUrl();\n }\n\n scrollToResultSection() {\n this.jobsDisplayNode.scrollIntoView({ behavior: 'smooth' });\n }\n\n onResetFilters() {\n this.jobsDisplayNode.textContent = '';\n this.currentJobs = [];\n this.msonryUtils.reset();\n }\n\n getPagination() {\n return { page: PAGE, pageSize: PAGE_SIZE };\n }\n\n getTemplateNode({\n jobNumber,\n jobType,\n jobTitle,\n jobTeaser,\n location: { zipCodes },\n company: { isAnonymous, name: companyName, logoUrl },\n }) {\n const template = document.importNode(this.gitterTemplate.content, true);\n const companyTitleNode = template.querySelector('[data-company-title]');\n const jobTitleNode = template.querySelector('[data-job-title]');\n const regionNode = template.querySelector('[data-region]');\n const jobTypeNode = template.querySelector('[data-job-type]');\n const companyLogoNode = template.querySelector('[data-logo]');\n const jobTeaserNode = template.querySelector('[data-description]');\n const jobLinkBtn = template.querySelector('[data-job-link]');\n\n companyTitleNode.textContent = isAnonymous ? '' : companyName;\n companyLogoNode.src = isAnonymous ? '' : logoUrl;\n jobTitleNode.textContent = jobTitle;\n regionNode.textContent = zipCodes?.length > 0 ? zipCodes[0].region : '';\n jobTypeNode.textContent = jobType?.length > 0 ? jobType[0].jobType : '';\n jobTeaserNode.textContent = jobTeaser;\n jobLinkBtn.href = jobLinkBtn.href + jobNumber;\n\n return template;\n }\n\n addJobsToDOM({ reset = false, addEmptyContainer = false }) {\n if (reset) {\n this.jobsDisplayNode.textContent = '';\n }\n const fragment = document.createDocumentFragment();\n this.currentJobs?.forEach((job) =>\n fragment.appendChild(this.getTemplateNode(job)),\n );\n\n // always add the see more node in the end\n // this.jobsDisplayNode.appendChild(fragment);\n if (addEmptyContainer) {\n fragment.appendChild(this.getGitterBtnTemplate(addEmptyContainer));\n }\n fragment.appendChild(this.getGitterBtnTemplate());\n this.jobsDisplayNode.appendChild(fragment);\n }\n\n onFetchJobsResult(fetchResult) {\n try {\n const { totalItems = 0, jobs = [] } = fetchResult;\n this.currentJobs = jobs;\n this.addJobsToDOM({\n reset: true,\n addEmptyContainer: totalItems < 2 && this.breakpoint,\n });\n this.currentJobs?.length > 0\n ? this.msonryUtils.reloadLayout()\n : this.msonryUtils.reset();\n } catch (error) {\n console.error(error);\n }\n }\n}\n","const MSONRY_GRID_CLASS = '.masonry-grid';\nconst MSONRY_GRID_ITEM_CLASS = '.masonry-grid-item';\nconst MSONRY_GUTTER_SIZER_CLASS = '.masonry-gutter-sizer';\n\nimport Masonry from 'masonry-layout';\n\nexport default class MasonryUtils {\n constructor(elm) {\n this.elm = elm;\n if (elm) {\n this.initMasonry();\n }\n }\n\n initMasonry() {\n if (!this.msonryObj) {\n this.msonryObj = new Masonry(MSONRY_GRID_CLASS, {\n itemSelector: MSONRY_GRID_ITEM_CLASS,\n columnWidth: MSONRY_GRID_ITEM_CLASS,\n gutter: MSONRY_GUTTER_SIZER_CLASS,\n transitionDuration: '0s',\n percentPosition: true,\n });\n }\n return this.msonryObj;\n }\n\n getMasonObj() {\n return this.msonryObj ?? this.initMasonry();\n }\n\n printItems() {\n console.log(this.getMasonObj().getItemElements());\n }\n\n reset() {\n this.getMasonObj().destroy();\n this.msonryObj = null;\n }\n\n appendNodes(elmNodes) {\n this.getMasonObj().appended(elmNodes);\n }\n\n layout() {\n this.getMasonObj().layout();\n }\n\n reloadLayout() {\n const msonryObj = this.getMasonObj();\n msonryObj.reloadItems();\n msonryObj.layout();\n }\n}\n"],"names":["_constants","require","exports","constructor","_ref","disableFetchJobs","onLoadingCallbacks","getPagination","this","fetchIsLoading","onFetchResultCallbacks","abortController","AbortController","addCallbackToOnFetchResult","callback","push","addCallbackToOnLoading","setDisableFetchJobs","val","abortFetch","abort","setFilterBadgeNumbers","filters","number","forEach","filter","setFilterBadgeNumber","filterElement","badge","querySelector","badgeNumber","classList","remove","HIDE_CSS_CLASS","add","innerHTML","getUrlParams","searchParams","window","location","search","URLSearchParams","toString","updateURLParams","paramStr","arguments","length","undefined","newParams","newRelativePathQuery","pathname","history","pushState","resetFetch","c","Promise","resolve","fetchQuery","fetchMore","fun","page","pageSize","append","languageElement","document","language","innerText","indexOf","jobBrandElement","jobBrand","signal","response","fetch","GET_JOBS_URL","ok","Error","status","resultPromise","json","regionParams","get","REGION_FILTER_NAME","split","URL_PARAMS_SEPERATOR","totalItems","jobs","job","zipCodes","_ref2","id","includes","error","DOMException","name","console","_jobFilter","_interopRequireDefault","_Utils","_masonryUtils","obj","__esModule","default","elm","breakpoint","matchMedia","matches","jobFilterNode","jobsDisplayNode","gitterTemplate","gitterBtnTemplate","currentJobs","msonryUtils","MasonryUtils","utils","Utils","bind","onFetchJobsResult","jobFilters","JobFilter","setFetchResult","onReset","onResetFilters","onSearchBtnClick","getFindJobUrlMobile","fetchOnInit","content","filterLinkElement","findJobUrl","href","reloadLayout","setupMediaQueryListener","addEventListener","event","getGitterBtnTemplate","addEmptyContainer","template","importNode","bodyNode","parentNode","removeChild","getFindJobUrl","jobsFound","urlParms","scrollToResultSection","scrollIntoView","behavior","textContent","reset","getTemplateNode","jobNumber","jobType","jobTitle","jobTeaser","company","isAnonymous","companyName","logoUrl","companyTitleNode","jobTitleNode","regionNode","jobTypeNode","companyLogoNode","jobTeaserNode","jobLinkBtn","src","region","addJobsToDOM","fragment","createDocumentFragment","appendChild","fetchResult","_masonryLayout","MSONRY_GRID_ITEM_CLASS","initMasonry","msonryObj","Masonry","itemSelector","columnWidth","gutter","transitionDuration","percentPosition","getMasonObj","printItems","log","getItemElements","destroy","appendNodes","elmNodes","appended","layout","reloadItems"],"sourceRoot":""}