PageSourceSearch

https://www.gibs.co.za/_nuxt/C54V2lpy.js

js gibs.co.za collected 2026-10-02 10:40:05 UTC 11,646 bytes, 2 lines download raw bytes

1import{_ as ce,a as ue}from"./Y3lLSd9F.js";import{A as t,d as pe,r as u,B as ge,t as fe,D as be,w as Q,o as d,c as v,b as s,k as l,F as C,v as P,l as _,m as w,p as W,V as A,e as k,K as F,I as L,_ as X,N as me,i as ye,L as ve}from"./DZvVyvV2.js";import{_ as _e}from"./B2wIYN_4.js";import{_ as he}from"./85abcHjB.js";import{u as Te}from"./BcALLq0j.js";import{u as we}from"./BYUvMyQg.js";import{e as Ae}from"./D9G8laJa.js";import"./Cr81l61U.js";const xe=t.object({Label:t.string(),LinkType:t.string(),Url:t.string(),ImageUrl:t.nullable(t.string()),CroppedImageUrl:t.nullable(t.string())}),Ce=t.object({Media:t.nullable(xe)}),Fe=t.object({DownloadButtonType:t.nullable(t.string()),ButtonType:t.nullable(t.string()),Name:t.nullable(t.string()),Target:t.nullable(t.string()),Url:t.nullable(t.string())}),Y=t.object({Buttons:t.nullable(Fe)}),Le=t.object({ArticleUrl:t.string()}),Ie=t.object({Title:t.string(),PostedDate:t.string(),Synopsis:t.string(),NewsType:t.string(),NewsTypeId:t.number(),InterestArea:t.string(),InterestAreaId:t.number(),FuncinOrg:t.string(),LevelsinOrg:t.string(),Url:t.string(),SortOrder:t.number(),PDF:t.nullable(Y),Podcast:t.nullable(Y),Video:t.nullable(Ce),Article:t.nullable(Le),static:t.boolean().optional(),SEOTitle:t.string().nullable().optional(),MetaKeywords:t.string().nullable().optional(),MetaDesc:t.string().nullable().optional(),seoPublishedTime:t.string().nullable().optional(),seoBrochureURL:t.string().nullable().optional(),seoAuthor:t.string().nullable().optional(),seoType:t.string().nullable().optional(),seoImage:t.string().nullable().optional()}),Ee=t.array(Ie),Ve={id:"gibs-course-listing-page",class:"gibs-course-listing-page gibs-content-body"},ke={class:"gibs-page-layout"},Se={class:"gibs-course-listing-top-content"},Ne=s("h1",{class:"gibs-listing-title"}," Content Hub ",-1),Me=["innerHTML"],$e={class:"gibs-listing-section"},De={key:0,class:"gibs-listing-filter-container"},Pe={key:1,class:"gibs-listing-filter-container-mobile"},Be=s("span",{id:"button-text"}," Filters ",-1),Re={id:"gibs-listing-filter-dropdown-tabs",class:"gibs-listing-filter-dropdown-tabs hidden"},Ue={key:2,class:"gibs-h-divider"},He={class:"gibs-listing-courses-container"},Oe={class:"gibs-listing-courses-wrapper"},je=["id"],ze={class:"gibs-programme-group-card-header"},Ge={class:"flex flex-row"},Je={class:"gibs-news-type-download"},Ke={class:"gibs-programme-group-card-heading-text"},qe=["title"],Qe={class:"gibs-programme-group-h-divider"},We={class:"gibs-programme-group-card-body-text gibs-content-hub-synopsis"},Xe={class:"gibs-text-3line-ellipsis"},Ye=["id"],Ze={class:"gibs-programme-group-card-header"},et={class:"flex flex-row"},tt={class:"gibs-news-type-download"},it={class:"gibs-programme-group-card-heading-text"},st=["title"],nt={class:"gibs-programme-group-h-divider"},ot={class:"gibs-programme-group-card-body-text gibs-content-hub-synopsis"},rt={class:"gibs-text-3line-ellipsis"},bt=pe({__name:"index",props:["windowView"],async setup(Z){let B,R;const g=L(),S=Z,ee=u({}),te=u([]),f=Te(),U=u(!1),I=u(),E=u(),N=u(!1),p=u(new Array),ie=ge();let x=u([]),y=u(x.value),V=u([]),$=u([]);async function se(){try{x.value=await ye("news-listings/list").then(e=>{let i=ve(Ee,e);return i=i.filter(n=>n.PDF===null&&n.Podcast===null&&n.Video===null&&n.Article===null?(console.error("Error: Invalid news item:",JSON.stringify(n,null,2)),!1):!0),i.sort((n,r)=>{const c=H(n.PostedDate);return H(r.PostedDate).getTime()-c.getTime()}),i})}catch(e){console.error("Error fetching news:",e)}}async function ne(){const[e,i,n]=await Promise.all([f.fetchContentHubInterestAreaReferences(),f.fetchMediaReferences(),se()]);V=u(e.map(r=>({filterType:g.$EnumCourseListingFilterType.InterestAreas,id:r.id.toString(),itemText:r.name,selected:!1,colour:r.text}))),$=u(i.map(r=>({filterType:g.$EnumCourseListingFilterType.MediaType,id:r.id.toString(),itemText:r.text})))}[B,R]=fe(()=>ne()),await B,R();function H(e){return new Date(e)}const h=we(),O=u(!1);function oe(e){if(e.Video&&e.Video.Media){h.addVideoUrl(e.Video.Media.Url),h.addVideoType(e.Video.Media.LinkType),(h.getVideoModal.src===""||h.getVideoModal.src!==e.Video.Media.Url)&&(h.addVideoUrl(e.Video.Media.Url),h.addVideoType(e.Video.Media.LinkType)),O.value=!0,h.isOpenVideoModal(!0);return}console.error("The news item passed to openModal is null : "+JSON.stringify(e,null,2))}async function re(e){var i,n,r,c,b,a,T,m;if(e.NewsType=="Article"&&await ie.push(Ae(e.Url)),e.NewsType=="PDF"&&(n=(i=e.PDF)==null?void 0:i.Buttons)!=null&&n.Url&&(c=(r=e.PDF)==null?void 0:r.Buttons)!=null&&c.Target){window.open(e.PDF.Buttons.Url,e.PDF.Buttons.Target);return}if(e.NewsType=="Podcast"&&(a=(b=e.Podcast)==null?void 0:b.Buttons)!=null&&a.Url&&(m=(T=e.Podcast)==null?void 0:T.Buttons)!=null&&m.Target){window.open(e.Podcast.Buttons.Url,e.Podcast.Buttons.Target);return}}async function le(){try{const e=await f.findNewsInterestAreaReference();e.forEach(i=>
1{ee.value[i.id]=i}),te.value=e}catch(e){console.error("Error fetching interest areas:",e)}}function j(e){let i="";return e==L().$EnumNewsType.Article?i="media-types/gibs-media-article":e==L().$EnumNewsType.PDF?i="media-types/gibs-media-pdf":e==L().$EnumNewsType.Video?i="media-types/gibs-media-video":e==L().$EnumNewsType.Podcast?i="media-types/gibs-media-podcast":e==L().$EnumNewsType.ExternalLink&&(i="media-types/gibs-media-external-link"),i}function z(){if(typeof V.value<"u"){const e=document.getElementById("gibs-listing-showings");let i=!0;return I.value=V.value.filter(n=>n.selected).map(n=>{const r=n.colour||"",c=i?"":'<span class="pipe-separator">|</span>',b=i?"Showing: ":"";return i=!1,`${b}${c}<span class="${r} text-xs uppercase">${n.itemText}</span>`}).join(""),I.value.length>0?e.classList.add("h-fit"):e.classList.remove("h-fit"),I.value}else return I.value=""}function D(){K(p.value)}D();function M(e){z(),ae(e);const i=p.value.findIndex(n=>n.itemText==="view all");if(i!==-1&&p.value.splice(i,1),e.itemText==="view all"){const n=p.value.findIndex(r=>r.filterType===g.$EnumCourseListingFilterType.MediaType);n!==-1&&p.value.splice(n,1)}K(p.value)}function ae(e){const i=u(-1),n=u(!1);return e.filterType==g.$EnumCourseListingFilterType.MediaType&&(e.id===""&&(n.value=!0),p.value.forEach(function(r,c){r.filterType==g.$EnumCourseListingFilterType.MediaType&&(i.value=c)}),n.value===!0?p.value.splice(i.value,1):i.value==-1?p.value.splice(0,0,e):p.value[i.value]=e),e.filterType==g.$EnumCourseListingFilterType.InterestAreas&&e.selected===!0&&p.value.push(e),p.value=p.value.filter(r=>{if(r.selected===!0)return r}),p.value}function G(){const e=document.getElementById("gibs-listing-filter-dropdown-tabs");e.classList.toggle("hidden"),U.value=!e.classList.contains("hidden")}function J(){var e;y.value.length===1?((e=y.value[0])==null?void 0:e.static)===!0?E.value=!0:E.value=!1:y.value.length===0?E.value=!0:E.value=!1}function K(e){const i=new Set,n=new Set;let r=!1;if(e.forEach(a=>{a.filterType===g.$EnumCourseListingFilterType.MediaType?a.id!==""&&a.itemText!=="view all"?n.add(a.id):a.itemText==="view all"&&(n.clear(),r=!0):a.filterType===g.$EnumCourseListingFilterType.InterestAreas&&i.add(a.id)}),e.length<1||r)return y.value=x.value,p.value=e.filter(a=>a.itemText==="view all"),J(),y.value;const c=x.value.filter(a=>e.every(m=>{if(m.filterType===g.$EnumCourseListingFilterType.MediaType&&m.itemText!=="view all")switch(m.itemText){case"Article":return!!a.Article;case"Podcast":return!!a.Podcast;case"Video":return!!a.Video;case"PDF":return!!a.PDF;default:return!0}return!0})),b=x.value.filter(a=>e.some(m=>m.filterType===g.$EnumCourseListingFilterType.InterestAreas?a.InterestAreaId==Number(m.id):!1));if(n.size===0&&i.size>0)y.value=b;else if(i.size===0&&n.size>0)y.value=c;else{const a=b.filter(T=>c.includes(T));y.value=a}return J(),y.value}return be(async()=>{await le(),D(),z()}),Q(()=>h.getVideoModal.isOpen,()=>{h.getVideoModal.isOpen===!1&&(O.value=!1)}),Q(()=>S.windowView.view,()=>{setTimeout(()=>{N.value=!N.value},10),D();const e=document.getElementById("gibs-listing-filter-dropdown-tabs");e&&!e.classList.contains("hidden")&&G()}),(e,i)=>{const n=ce,r=ue,c=X,b=X,a=me,T=_e,m=he;return d(),v("div",Ve,[s("div",ke,[s("div",Se,[Ne,s("p",{id:"gibs-listing-showings",class:"gibs-listing-showings",innerHTML:l(I)},null,8,Me)]),s("div",$e,[S.windowView.view!=="mobile"?(d(),v("div",De,[(d(),v(C,null,P(["DeliveryType","InterestAreas"],o=>(d(),v(C,null,[o==l(g).$EnumCourseListingFilterType.InterestAreas?(d(),_(n,{key:0,options:l(V),resetFilter:l(N),onCheckboxSelection:M},null,8,["options","resetFilter"])):w("",!0),o==l(g).$EnumCourseListingFilterType.DeliveryType?(d(),_(r,{key:1,options:l($),onRadioSelection:M,filterHeading:"Media Type"},null,8,["options"])):w("",!0)],64))),64))])):S.windowView.view==="mobile"?(d(),v("div",Pe,[s("button",{onClick:G,class:"gibs-listing-filter-dropdown-button",type:"button"},[Be,l(U)?(d(),_(c,{key:0,class:"gibs-filter-icon",name:"buttons/up-arrow"})):(d(),_(c,{key:1,class:"gibs-filter-icon",name:"buttons/down-arrow"}))]),s("div",Re,[(d(),v(C,null,P(["DeliveryType","InterestAreas"],o=>(d(),v(C,null,[o==l(g).$EnumCourseListingFilterType.InterestAreas?(d(),_(n,{key:0,options:l(V),resetFilter:l(N),onCheckboxSelection:M},null,8,["options","resetFilter"])):w("",!0),o==l(g).$EnumCourseListingFilterType.DeliveryType?(d(),_(r,{key:1,options:l($),onRadioSelection:M},null,8,["options"])):w("",!0)],64))),64))])])):w("",!0),S.windowView.view==="mobile"?(d(),v("hr",Ue)):w("",!0),s("div",He,[s("div",Oe,[(d(!0),v(C,null,P(l(y),(o,q)=>(d(),v(C,null,[o.NewsType=="Video"?(d(),_(a,{key:0,onClick:de=>oe(o)},{default:W(()=>[s("div",{id:`news-card-${q}`,class:A(["gibs-programme-group-card mb-7.5",l(f).findContentHubReference(o.InterestAreaId.toString()).border])},[s("div",ze,[s("div",Ge,[s("div",{class:A(["gibs-icon-round-bg",l(f).findContentHubReference(o.InterestAreaId.toString()).background])},[k(b,{name:l(f).findContentHubReference(o.InterestAreaId.toString()).icon},null,8,["name"])],2),s("div",{class:A(["gibs-text-capitalise",l(f).findContentHubReference(o.InterestAreaId.toString()).text])},[s("span",null,F(o.InterestArea),1)],2)]),s("div",Je,[k(b,{name:j(o.NewsType)},null,8,["name"])])]),s("div",Ke,[s("h5",{class:"gibs-text-2line-ellipsis",title:o.Title},F(o.Title),9,qe)]),s("div",Qe,[s("hr",{class:A(["gibs-h-divider",l(f).findContentHubReference(o.InterestAreaId.toString()).background])},null,2)]),s("div",We,[s("p",Xe,F(o.Synopsis),1)])],10,je)]),_:2},1032,["onClick"])):(d(),_(a,{key:1,onClick:de=>re(o)},{default:W(()=>[s("div",{id:`news-card-${q}`,class:A(["gibs-programme-group-card mb-7.5",l(f).findContentHubReference(o.InterestAreaId.toString()).border])}
1,[s("div",Ze,[s("div",et,[s("div",{class:A(["gibs-icon-round-bg",l(f).findContentHubReference(o.InterestAreaId.toString()).background])},[k(b,{name:l(f).findContentHubReference(o.InterestAreaId.toString()).icon},null,8,["name"])],2),s("div",{class:A(["gibs-text-capitalise",l(f).findContentHubReference(o.InterestAreaId.toString()).text])},[s("span",null,F(o.InterestArea),1)],2)]),s("div",tt,[k(b,{name:j(o.NewsType)},null,8,["name"])])]),s("div",it,[s("h5",{class:"gibs-text-2line-ellipsis",title:o.Title},F(o.Title),9,st)]),s("div",nt,[s("hr",{class:A(["gibs-h-divider",l(f).findContentHubReference(o.InterestAreaId.toString()).background])},null,2)]),s("div",ot,[s("p",rt,F(o.Synopsis),1)])],10,Ye)]),_:2},1032,["onClick"])),l(x).length==0?(d(),_(T,{key:2,programme:"item",offerings:"content hub"})):w("",!0)],64))),256))]),l(E)?(d(),_(T,{key:0,programme:"item",offerings:"content hub"})):w("",!0),k(m)])])])])}}});export{bt as default};
2//# sourceMappingURL=C54V2lpy.js.map

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.