1import{_ as h,o as n,c as l,e as i,w as d,h as L,C as m,F as u,a as f,D as j,d as v}from"./app-index-BGMqnN3C.js";const _={name:"BubJobBoard",data(){return{jobs:[],allJobs:[],fDepartment:"all",fLocation:"all",fOffice:"all",fSource:"all",fSearch:"",departments:[],locations:[],offices:[],sources:[]}},props:{block:{type:Object,required:!0},showEditLinks:{type:Boolean,required:!1,default:!1}},created(){typeof window<"u"&&this.init()},methods:{cmMeta(o,e=0){return{type:this.block.entity_type,id:this.block.entity_id,field:o,delta:e,langcode:this.block.langcode}},formatLocation(o){return o?String(o).split("/").map(e=>e.trim()).filter(e=>e.length).join(", "):""},updateList(){this.jobs=[];for(let o in this.allJobs){let e=this.allJobs[o];e.title.toLowerCase().indexOf(this.fSearch.toLowerCase())!==-1&&this.isLocation(e)&&this.isDepartment(e)&&this.isSource(e)&&this.jobs.push(e)}this.sortJobs()},sortJobs(){this.jobs.sort((o,e)=>o.title<e.title?-1:o.title>e.title?1:0)},isSource(o){return o.source===this.fSource||this.fSource==="all"},isOffice(o){return o.offices[0].name===this.fOffice||this.fOffice==="all"},isLocation(o){return this.fLocation==="all"||o.location.name===this.fLocation},isDepartment(o){if(this.fDepartment==="all")return!0;for(let e in o.departments)if(o.departments[e].name===this.fDepartment)return!0;return!1},async init(){let o;try{o=await fetch("/api/v2/jobs")}catch{return}if(!o||!o.ok)return;let e=await o.json(),a=e&&e.jobs?e.jobs:[];for(let c in a){let t=a[c];this.jobs.push(t),this.allJobs.push(t),t.source&&!this.sources.includes(t.source)&&this.sources.push(t.source),t.location&&t.location.name&&!this.locations.includes(t.location.name)&&this.locations.push(t.location.name);for(let r in t.departments)this.departments.includes(t.departments[r].name)||this.departments.push(t.departments[r].name);t.offices&&t.offices[0]&&!this.offices.includes(t.offices[0].name)&&this.offices.push(t.offices[0].name)}this.sortJobs()}}},M={id:"about-us-app"},H={class:"job-filter"},T={class:"container"},k={class:"job-filter-form",method:"get"},y=["innerHTML"],S=["innerHTML"],w={class:"form-items"},D={class:"form-item select"},g=["value","innerHTML"],B={class:"form-item select"},J=["value","innerHTML"],C={class:"form-item select"},O=["value","innerHTML"],V={class:"form-item input"},x={class:"job-list"},A={class:"container"},U=["id"],q=["innerHTML","href"],E={class:"job-departments"},F=["innerHTML","dep-id"],K=["innerHTML"],N=["innerHTML"];function I(o,e,a,c,t,r){const b=v("editable");return n(),l("div",M,[i("div",H,[i("div",T,[i("form",k,[a.block.field_title&&o.$isBlockHtml(a.block.field_title)?d((n(),l("div",{key:0,class:"form-title",innerHTML:a.block.field_title},null,8,y)),[[b,r.cmMeta("field_title")]]):a.block.field_title?d((n(),l("h2",{key:1,class:"form-title",innerHTML:a.block.field_title},null,8,S)),[[b,r.cmMeta("field_title")]]):L("",!0),i("div",w,[i("div",D,[e[9]||(e[9]=i("label",{class:"t-small",for:"job-source"},"Company",-1)),d(i("select",{id:"job-source","onUpdate:modelValue":e[0]||(e[0]=s=>t.fSource=s),onChange:e[1]||(e[1]=s=>r.updateList())},[e[8]||(e[8]=i("option",{value:"all"},"All",-1)),(n(!0),l(u,null,f(t.sources,s=>(n(),l("option",{value:s,innerHTML:s},null,8,g))),256))],544),[[m,t.fSource]])]),i("div",B,[e[11]||(e[11]=i("label",{class:"t-small",for:"job-department"},"Department",-1)),d(i("select",{id:"job-department","onUpdate:modelValue":e[2]||(e[2]=s=>t.fDepartment=s),onChange:e[3]||(e[3]=s=>r.updateList())},[e[10]||(e[10]=i("option",{value:"all"},"All departments",-1)),(n(!0),l(u,null,f(t.departments,s=>(n(),l("option",{value:s,innerHTML:s},null,8,J))),256))],544),[[m,t.fDepartment]])]),i("div",C,[e[13]||(e[13]=i("label",{class:"t-small",for:"job-location"},"Location",-1)),d(i("select",{id:"job-location","onUpdate:modelValue":e[4]||(e[4]=s=>t.fLocation=s),onChange:e[5]||(e[5]=s=>r.updateList())},[e[12]||(e[12]=i("option",{value:"all"},"All locations",-1)),(n(!0),l(u,null,f(t.locations,s=>(n(),l("option",{value:s,innerHTML:r.formatLocation(s)},null,8,O))),256))],544),[[m,t.fLocation]])]),i("div",V,[e[14]||(e[14]=i("label",{class:"t-small",for:"job-search"},"Keywords",-1)),d(i("input",{id:"job-search",type:"text","onUpdate:modelValue":e[6]||(e[6]=s=>t.fSearch=s),onKeyup:e[7]||(e[7]=s=>r.updateList())},null,544),[[j,t.fSearch]])])])])])]),i("div",x,[i("div",A,[(n(!0),l(u,null,f(t.jobs,s=>
1(n(),l("div",{class:"job-info",id:"job"+s.id},[i("a",{class:"job-title t-subtitle",innerHTML:s.title,href:s.absolute_url,target:"_blank"},null,8,q),i("div",E,[(n(!0),l(u,null,f(s.departments,p=>(n(),l("span",{innerHTML:p.name,"dep-id":"dep"+p.id},null,8,F))),256))]),i("div",{class:"job-location",innerHTML:r.formatLocation(s.location.name)},null,8,K),i("div",{class:"job-source",innerHTML:s.source},null,8,N)],8,U))),256))])])])}const G=h(_,[["render",I]]);export{G 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.