1import Q from"./oAEFRstv.js";import{Z as A,aj as U,ad as W,ak as Y,al as Z,am as X,v as ee,i as O,r as b,e as F,d as te,n as ne,u as se,ah as oe,m as le,s as ae,f as k,k as a,w as i,Y as ie,b as L,ai as G,U as re,o as _,V as ce,j as e,J as p,M as I,O as R,c as M,T as S,H as ue,l as B,R as de}from"./a9uo9n0h.js";import me from"./-qlh2h2m.js";import he from"./C7yPuewq.js";import _e from"./JzdQqPjD.js";import pe from"./DlL-uf7y.js";import"./CdAGIxU6.js";import"./D-rIkz48.js";import"./MpWjHFhU.js";import"./CLDzWeKI.js";import"./Bbjwz_OC.js";import"./BNl5-dn5.js";const fe=A` 2 mutation MarkRemainingThemeChallengesNotApplicable($locationId: String!, $themeSlug: String!) { 3 markRemainingThemeChallengesNotApplicable(location_id: $locationId, theme_slug: $themeSlug) 4 } 5`,ge=A` 6 ${U} 7 ${W} 8 ${Y} 9 fragment Theme on Entry_Themes_Theme { 10 title 11 intro 12 more_info_cta_text 13 slug 14 theme_type { 15 label 16 value 17 } 18 blocks { 19 ...Blocks 20 } 21 challenges { 22 ...ChallengeEntry 23 } 24 } 25`,ve=A` 26 ${ge} 27 28 query EntriesThemes($site: String!) { 29 entries(collection: "themes", site: $site) { 30 data { 31 ...Theme 32 } 33 } 34 } 35`,Ce=Z("themes",{state:()=>({themes:null}),getters:{getThemes:o=>o.themes},actions:{setThemes(o){this.themes=o}}}),Te=(o={watch:!0})=>{const E=X(),f=Ce(),u=F({get:()=>f.themes??[],set:l=>f.setThemes(l)}),g=b(!1),v=b(null),d=F(()=>E?.handle??"site-nl"),C=async()=>{if(!u.value.length){u.value.length||(g.value=!0),v.value=null;try{const l=await O(ve,{site:d.value});u.value=l?.data?.entries?.data??[]}catch(l){console.error("Fetching locations failed:",l),v.value=l,u.value=[]}finally{g.value=!1}}};return o.watch&&ee(d,async(l,w)=>{w!==void 0&&l!==w&&(u.value=[]),await C()},{immediate:!0}),{themes:u,isLoadingThemes:g,error:v,fetchThemes:C}},xe={class:"challenge-select__wrapper"},be={class:"challenge-select__header relative pt-20 pb-5"},we={class:"challenge-select__title-wrapper flex items-center justify-between gap-5 pb-3 md:justify-start"},ye={class:"challenge-select__icon-wrapper--completed relative size-12"},ke={class:"text-black-100 absolute top-0 right-0 flex h-full w-full items-center justify-center text-[20px]"},Le=["onClick"],Se={class:"bg-black-100 flex size-12.5 items-center justify-center rounded-xl text-white"},Ee={class:"overflow-hidden"},Ne={class:"challenge-select__category-inner px-7 pb-7"},Me={class:"flex items-center gap-1 pb-6"},Ae={class:"underline"},$e=["onClick"],je=["onClick"],Fe={class:"max-w-[650px] text-[18px] leading-[150%]"},Ge=te({__name:"ChallengeSelect",props:{data:{default:()=>[]},isLoading:{type:Boolean},locationId:{},totalChallenges:{default:0},locationType:{},locationTheme:{}},setup(o){const{session:E}=ne(),{fetchLocations:f}=se({watch:!1}),u=oe(),{themes:g}=Te(),v=le(),{expandedCategories:d}=ae(v),C=b([]),l=b(!1),w=n=>{const t=y(n);C.value=t?.blocks??[],u.setModalOpen(G.CHALLENGE_INFO)},N=o,y=n=>{const t=N.locationTheme?.value?.toLowerCase(),m=n.title?.toLowerCase(),h=g.value.filter(r=>r.theme_type?.value?.toLowerCase()===t);return h.find(r=>r.title?.toLowerCase()===m)??h.find(r=>r.title?.toLowerCase()==="rookvrij")},$=n=>n.id??n.title,T=n=>d.value.includes($(n)),V=n=>{const t=$(n);d.value.includes(t)?d.value=d.value.filter(m=>m!==t):d.value.push(t)},x=b(null),z=n=>{x.value=n},j=()=>{x.value=null},H=async()=>{const n=x.value,t=n?y(n):null;if(!(!n||!t?.slug)){l.value=!0;try{await O(fe,{locationId:N.locationId,themeSlug:t.slug},E.value.token),await D(),j()}catch(m){console.error("markRemainingThemeChallengesNotApplicable failed:",m)}finally{l.value=!1}}},D=async()=>{typeof document<"u"&&"startViewTransition"in document?document.startViewTransition(async()=>{await f(),await de()}):await f()};return(n,t)=>{const m=Q,h=ce,r=re,K=me,q=he,J=_e,P=pe;return _(),k("div",xe,[a(r,null,{default:i(()=>[a(h,null,{default:i(()=>[e("div",be,[e("div",we,[t[0]||(t[0]=e("h2",{class:"font-demibold!"},"Kies je volgende challenge",-1)),e("div",ye,[a(m,{locationType:o.locationType,class:"size-12"},null,8,["locationType"]),e("div",ke,p(o.totalChallenges),1)])])])]),_:1})]),_:1}),a(ie,{name:"fade",mode:"out-in"},{default:i(()=>[a(r,{smallerGap:!0},{default:i(()=>[(_(!0),k(I,null,R(o.data,s=>(_(),M(h,{key:s.id??s.title},{default:i(()=>[s.challenges.length>0?(_(),k("div",{key:0,class:S(["mx-0 overflow-hidden rounded-[28px] bg-[#E8E9E8] transition-[margin] duration-300 ease-in-out",{"md:-mx-7":T(s)}])},[e("button",{type:"button",class:"challenge-select__category flex min-h-26.5 w-full cursor-pointer items-center justify-between px-7 text-left",onClick:c=>V(s)},[e("h4",{class:S(["font-demibold! font-[600] transition-[padding] duration-300 ease-in-out",T(s)?"md:pl-7":""])},p(s.title),3),e("span",Se,[e("span",{class:S([{"rotate-180":T(s)},"transition-transform duration-300 ease-in-out"])},p(T(s)?"-":"+"),3)])],8,Le),e("div",{class:S(["grid transition-[grid-template-rows] duration-300 ease-in-out",T(s)?"grid-rows-[1fr]":"grid-rows-[0fr]"])},[e("div",Ee,[e("div",Ne,[e("p",null,p(y(s)?.intro),1),e("span",Me,[e("p",Ae,[e("button",{onClick:c=>w(s),class:"cursor-pointer underline hover:no-underline"},p(y(s)?.more_info_cta_text),9,$e)]),t[1]||(t[1]=e("span",{class:"description__icon bg-black-100 flex size-4.5 items-center justify-center rounded-full text-white"}," i ",-1))]),a(r,{noMargin:""},{default:i(()=>[(_(!0),k(I,null,R(s.challenges,c=>(_(),M(h,{m:6,l:3,key:c.id??c.title},{default:i(()=>[(_(),M(K,{key:c.id,challenge:{challenge:c},status:"selectable",theme:c.theme.value,"location-id":o.locationId,uri:c.frontend_uri},null,8,["challenge","theme","location-id","uri"]))]),_:2},1024))),128)),a(h,null,{default:i(()=>[e("button",{type:"button",class:"cursor-pointer underline underline-offset-2 hover:no-underline",onClick:c=>
35z(s)}," Alle challenges overslaan ",8,je)]),_:2},1024)]),_:2},1024)])])],2)],2)):ue("",!0)]),_:2},1024))),128))]),_:1})]),_:1}),a(J,{name:L(G).CHALLENGE_INFO},{default:i(()=>[a(q,{data:L(C)},null,8,["data"])]),_:1},8,["name"]),a(P,{open:L(x)!==null,title:"Weet je zeker dat je de resterende challenges wilt overslaan?","confirm-label":"Ja, alles overslaan","cancel-label":"Nee, annuleer",onConfirm:H,onCancel:j},{default:i(()=>[e("p",Fe,[t[2]||(t[2]=B(" Alle resterende challenges binnen ",-1)),e("strong",null,p(L(x)?.title),1),t[3]||(t[3]=B(" worden overgeslagen. ",-1))])]),_:1},8,["open"])])}}}),Qe=Object.assign(Ge,{__name:"LayoutDashboardLocationChallengeSelect"});export{Qe 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.