PageSourceSearch

https://absoc.be/_next/static/chunks/pages/profile-a9ca5d626e8462e4.js

js absoc.be collected 2026-10-08 10:16:51 UTC 11,037 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[277],{9813:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/profile",function(){return t(6212)}])},6006:function(e,n,t){"use strict";t.d(n,{j:function(){return a}});var i=t(5893),r=t(1194),l=t(8855),s=t(7294),o=t(9114);function a(e){let{value:n,onChange:t,mode:a,required:u=!1,className:d}=e,[c,v]=(0,s.useState)(""),{studyPrograms:h,error:g,loading:f,getStudyProgramLabelById:p}=(0,o.Z)(),m=h.map(e=>({label:p(e.id),value:e.id}));return!h||h.length<1?(0,i.jsx)("span",{children:"loading..."}):"multi"===a?(0,i.jsx)(r.NU,{data:m,value:n,label:"Opleiding",placeholder:"Kies alle opleidingsonderdelen",searchable:!0,searchValue:c,onChange:t,onSearchChange:v,nothingFoundText:"Geen resultaat",className:d,required:u}):(0,i.jsx)(l.Ph,{label:"Opleiding",placeholder:"Kies een opleidingsonderdeel",value:n,data:[{label:"Alle opleidingsonderdelen",value:"all"},...m],onChange:e=>e&&t(e),className:d,required:u})}},8272:function(e,n,t){"use strict";function i(e){return(e/100).toFixed(2)}t.d(n,{n:function(){return i}})},9114:function(e,n,t){"use strict";t.d(n,{Z:function(){return o}});var i=t(4480),r=t(9244);let l=(0,i.cn)({key:"studyProgramsState",default:[]});var s=t(7294);
1function o(){let[e,n]=(0,s.useState)(!1),[t,o]=(0,s.useState)(null),[a,u]=(0,i.FV)(l);(0,s.useEffect)(()=>{if(a&&a.length>1)return;let t=async()=>{if(e)return;n(!0);let t=await fetch("/api/db/product/get-programs"),i=await t.json();t.ok?u(i):o(i),n(!1)};t()},[]);let d=e=>a&&e?a.find(n=>n.id===e):null,c=e=>{if(!a||!e)return null;let n=d(e);return n?(0,r.k)(n.title)+" - "+n.phaseName:null},v=["Bachelor fase 1","Bachelor fase 2","Bachelor fase 3","Master fase 1","Master fase 2"],h=e=>{let n=d(e);return n?v[n.phase-1]:null},g=async(e,n,t)=>{let i=await fetch("/api/db/studyprogram/create",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:e,phase:n,phaseName:t})}),r=await i.json();if(!i.ok)return o(r),null;{let e=[...a,r.studyProgram];return u(e),r.studyProgram}},f=async e=>{let n=await fetch("/api/db/studyprogram/create",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e})}),t=await n.json();if(!n.ok)return o(t),null;{let n=a.filter(n=>n.id!==e);return u(n),t.studyProgram}},p=async(e,n,t,i)=>{let r=await fetch("/api/db/studyprogram/create",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e,title:n,phase:t,phaseName:i})});console.log(r);let l=await r.json();if(!r.ok)return o(l),null;{let n=a.map(n=>n.id===e?l.studyProgram:n);return u(n),l.studyProgram}};return{loading:e,error:t,studyPrograms:a,getStudyProgramById:d,getStudyProgramLabelById:c,getStudyProgramPhaseById:h,createStudyProgram:g,updateStudyProgram:p,deleteStudyProgram:f}}},2597:function(e,n,t){"use strict";async function i(e,n){try{let t=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)});if(t.ok)return t.json();return null}catch(e){return console.error("helpers/post.ts: Error fetching data: ",e),null}}t.d(n,{v:function(){return i}})},4877:function(e,n,t){"use strict";function i(e,n){let t=[...e];return Object.keys(n).forEach(e=>{var i,r;i=t,r=n[e],t=e&&null!=r&&"all"!==r&&i&&"string"==typeof e?i.filter(n=>{let t=null==n?void 0:n[e];return Array.isArray(t)?t.includes(r):t===r}):i}),t}function r(e,n){try{if(!e||e.length<1)return[];let t=n.toLowerCase().trim();return e.filter(n=>Object.keys(e[0]).some(e=>{let i=null==n?void 0:n[e];return"string"==typeof i?i.toLowerCase().includes(t):Array.isArray(i)&&i.every(e=>"string"==typeof e)?i.some(e=>e.toLowerCase().includes(t)):("number"==typeof i||"boolean"==typeof i||i instanceof Date)&&String(i).toLowerCase().includes(t)}))}catch(n){return e}}function l(e,n){var t,i,l,s;let{sortBy:o}=n;return o?"string"==typeof(null==e?void 0:null===(t=e[0])||void 0===t?void 0:t[o])?r([...e].sort((e,t)=>{var i,r;return n.reversed?null==t?void 0:null===(r=t[o])||void 0===r?void 0:r.localeCompare(e[o]):null==e?void 0:null===(i=e[o])||void 0===i?void 0:i.localeCompare(t[o])}),n.search):"number"==typeof(null==e?void 0:null===(i=e[0])||void 0===i?void 0:i[o])||"boolean"==typeof(null==e?void 0:null===(l=e[0])||void 0===l?void 0:l[o])?r([...e].sort((e,t)=>n.reversed?(null==t?void 0:t[o])-e[o]:(null==e?void 0:e[o])-t[o]),n.search):(null==e?void 0:null===(s=e[0])||void 0===s?void 0:s[o])instanceof Date?r([...e].sort((e,t)=>{var i,r,l,s;return n.reversed?(null==t?void 0:null===(l=t[o])||void 0===l?void 0:l.getTime())-(null===(s=e[o])||void 0===s?void 0:s.getTime()):(null==e?void 0:null===(i=e[o])||void 0===i?void 0:i.getTime())-(null===(r=t[o])||void 0===r?void 0:r.getTime())}),n.search):e:r(e,n.search)}t.d(n,{DZ:function(){return i},R0:function(){return l}})},9244:function(e,n,t){"use strict";function i(e){return"string"!=typeof e||0===e.length?e:e.charAt(0).toUpperCase()+e.slice(1)}t.d(n,{k:function(){return i}})},6212:function(e,n,t){"use strict";t.r(n),t.d(n,{__N_SSP:function(){return W},default:function(){return q}});var i=t(5893),r=t(3299),l=t(5345),s=t(2629),o=t(555),a=t(5771),u=t(7913),d=t(3111),c=t(7294),v=t(4552),h=t(5217),g=t(1163),f=t(2597),p=t(1017),m=t(9236),j=t(5117),x=t(2445),b=t(966),y=t(7841),k=t(6006),w=t(4618);let C=e=>{let{title:n,description:t,button:r,children:l}=e;
1return(0,i.jsxs)(p.Z,{shadow:"sm",m:"md",padding:"lg",radius:"md",withBorder:!0,style:{maxWidth:550},children:[(0,i.jsx)(m.D,{order:4,children:n}),(0,i.jsx)(j.x,{children:t}),l,r]})};function _(e){var n,t,l,s;let{setCurrentLink:o}=e,{data:a,update:u}=(0,r.useSession)(),[d,v]=(0,c.useState)(!1),p=(0,h.Y)(()=>{var e,n,t;if((null==a?void 0:null===(e=a.user)||void 0===e?void 0:e.payment_status)!=="open"&&!((null==a?void 0:null===(n=a.user)||void 0===n?void 0:n.payment_status)==="paid"&&!(null==a?void 0:null===(t=a.user)||void 0===t?void 0:t.isPaidForThisSchoolYear)))return p.stop();u()},5e3),m=(0,g.useRouter)();(0,c.useEffect)(()=>(m.query.success&&!a.user.isMember?p.start():p.stop(),p.stop),[]);let j=async()=>{var e;v(!0);let n=null==a?void 0:null===(e=a.user)||void 0===e?void 0:e.email;if(!n)return;let t=await (0,f.v)("/api/pay/membership/checkout",{email:n});console.log(t),t&&t.url&&(window.location.href=t.url),v(!1)},[_,S]=(0,c.useState)((null==a?void 0:null===(n=a.user)||void 0===n?void 0:n.studyProgram.id)||null),{upsert:P}=(0,w.Z)("/api/db/user/upsert-own-profile");return(0,i.jsxs)(x.W,{p:25,children:[(0,i.jsx)("h1",{children:"Profiel"}),!m.query.success||(null==a?void 0:null===(t=a.user)||void 0===t?void 0:t.isMember)?(null==a?void 0:null===(l=a.user)||void 0===l?void 0:l.isMember)?(null==a?void 0:null===(s=a.user)||void 0===s?void 0:s.isMember)?(0,i.jsxs)("div",{children:[m.query.ordersuccess&&(0,i.jsx)(C,{title:"✅ Je bestelling is geplaatst",description:"We verifi\xebren nog even je betaling en sturen je een bevestigingsmail zodra de betaling is afgerond. Bevestiging niet ontvangen? Check dan zeker je spamfolder.",button:(0,i.jsx)(y.z,{onClick:()=>o("bestelgeschiedenis"),mt:25,children:"Naar je besteloverzicht →"})}),(0,i.jsx)(C,{title:"\uD83C\uDF89 Je bent lid van Absoc!",description:"Je kan nu boeken bestellen met korting via de cursusdienst.",button:(0,i.jsx)(y.z,{onClick:()=>m.push("/cursusdienst"),mt:25,children:"Naar de cursusdienst →"})})]}):(0,i.jsx)("p",{children:"Er ging iets mis me je betaling, probeer opnieuw."}):(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(C,{title:"Bijna klaar!",description:"Betaal je lidgeld voor dit schooljaar om toegang te krijgen tot de cursusdienst.",button:(0,i.jsx)(y.z,{onClick:j,loading:d,mt:25,children:"Betaal via mollie →"}),children:(0,i.jsx)(k.j,{value:_,onChange:async e=>{var n;let t=await P({values:{email:null==a?void 0:null===(n=a.user)||void 0===n?void 0:n.email,studyProgramId:e}},"update");t&&S(e)},mode:"single"})})}):(0,i.jsxs)("div",{children:[(0,i.jsx)(b.a,{}),"We verifi\xebren je betaling"]})]})}var S=t(747),P=t(9759),T=t(8272),N=t(6397);let Z=[{name:"createdAt",label:"Wanneer",value:e=>(0,N.p6)(e.createdAt)},{name:"total_price_cents",label:"Prijs",value:e=>"€ ".concat((0,T.n)(e.total_price_cents))},{name:"status",label:"Status",value:e=>e.payment_status},{name:"bestelbevestiging",label:"Bestelbevestiging",value:e=>"paid"===e.payment_status?(0,i.jsx)("a",{href:"/api/invoice?mollieId=".concat(e.mollieId),target:"_blank",children:"Bestelbevestiging"}):null}];function z(e){let{session:n}=e,{data:t,loading:r,error:l}=(0,S.Z)("/api/db/order/get-orders");return r?(0,i.jsxs)("div",{children:[(0,i.jsx)(b.a,{}),"Loading..."]}):l?(0,i.jsxs)("div",{children:["Error: ",l]}):(0,i.jsxs)(x.W,{p:25,children:[(0,i.jsx)("h3",{children:"Bestelgeschiedenis"}),(0,i.jsx)(P.l,{data:t,fields:Z,filters:[],type:"order",upsert:()=>Promise.resolve(!0),Form:null})]})}var E=t(579),O=t(4065);let B=[{link:"overzicht",label:"Overzicht",icon:a.Z},{link:"bestelgeschiedenis",label:"Bestelgeschiedenis",icon:u.Z},{link:"instellingen",label:"Instellingen",icon:d.Z}];function A(e){let{session:n,updateSession:t}=e,[r,h]=(0,c.useState)("overzicht"),g=(0,O.a)("(min-width: 60em)");return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(s.Z,{}),(0,i.jsx)("div",{style:{display:"flex",marginTop:64},children:g?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(l.f,{data:B,active:r,changeActive:e=>h(e)}),(0,i.jsx)("div",{style:{padding:20},children:({overzicht:e=>(0,i.jsx)(_,{setCurrentLink:h}),bestelgeschiedenis:e=>(0,i.jsx)(z,{session:e}),instellingen:e=>(0,i.jsx)("div",{children:(0,i.jsx)(v.Z,{})})})[r](n)})]}):(0,i.jsxs)(E.m,{defaultValue:"overview",children:[(0,i.jsxs)(E.m.List,{children:[(0,i.jsx)(E.m.Tab,{value:"overview",icon:(0,i.jsx)(a.Z,{size:".8rem"}),children:"Overzicht"}),(0,i.jsx)(E.m.Tab,{value:"orders",icon:(0,i.jsx)(u.Z,{size:"0.8rem"}),children:"Orders"}),(0,i.jsx)(E.m.Tab,{value:"settings",icon:(0,i.jsx)(d.Z,{size:"0.8rem"}),children:"Instellingen"})]}),(0,i.jsx)(E.m.Panel,{value:"overview",pt:"xs",children:(0,i.jsx)(_,{setCurrentLink:h})}),(0,i.jsx)(E.m.Panel,{value:"orders",pt:"xs",children:(0,i.jsx)(z,{session:n})}),(0,i.jsx)(E.m.Panel,{value:"settings",pt:"xs",children:(0,i.jsx)(v.Z,{})})]})}),(0,i.jsx)(o.Z,{})]})}var F=t(6981),L=t(5386),D=t(9008),J=t.n(D),W=!0;function q(){let{data:e,status:n,update:t}=(0,r.useSession)(),l=(0,g.useRouter)();return(0,c.useEffect)(()=>{l.query.success&&F.N9.show({title:"Bedankt voor je aankoop!",message:"We verifi\xebren nog even je betaling en sturen je een bevestigingsmail zodra de betaling is afgerond.",color:"teal",autoClose:5e3,icon:(0,i.jsx)(L.Z,{})})},[]),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(J(),{children:[(0,i.jsx)("title",{children:"Account | Absoc"}),(0,i.jsx)("meta",{name:"robots",content:"noindex, nofollow"})]}),(0,i.jsxs)("div",{children:["loading"===n&&(0,i.jsx)("div",{children:"Loading..."}),"authenticated"===n?(0,i.jsx)(A,{session:e,updateSession:t}):(0,i.jsx)("a",{href:"/api/auth/signin",children:"Sign in"})]})]})}}},function(e){e.O(0,[817,61,182,164,340,154,478,994,393,774,888,179],function(){return e(e.s=9813)}),_N_E=e.O()}]);

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.