(window.webpackJsonp=window.webpackJsonp||[]).push([[34],{"2agx":function(e,t,a){},"3f98":function(e,t,a){},"7coR":function(e,t,a){},"8z8T":function(e,t,a){"use strict";var n=a("q1tI"),l=a.n(n),s=(a("Asz6"),a("Wbzz")),o=a("3dzz"),c=a("TSYQ"),r=a.n(c);t.a=function(e){const{children:t,icon:a,outline:n,route:c,primary:i,secondary:m,third:u,fourth:d,fifth:b,large:f,error:g,className:v,onClick:E,loading:h,modLink:p=!1,href:y}=e,N=r()("btn btn--rounded",v,{"btn--icon":!t,"btn--outline":n,"btn--primary":i,"btn--secondary":m,"btn--third":u,"btn--fourth":d,"btn--fifth":b,"btn--large":f,"btn--error":g}),j=p?"a":"button";return l.a.createElement(j,{type:!p&&"button",onClick:function(){return c?void Object(s.navigate)(c):E?void E():void 0},className:N,href:y},a&&l.a.createElement("span",{className:"icon"},a),t&&l.a.createElement("span",{className:"content"},h?l.a.createElement(o.a,{color:m?"#FFA41F":"#fff"}):t))}},ECkX:function(e,t,a){const{createElement:n,useEffect:l,useRef:s}=a("q1tI");e.exports=function(e){let{html:t,dangerouslySetInnerHTML:a,allowRerender:o,...c}=e;const r=s(null),i=s(!0);return l(()=>{if(!t||!r.current)throw new Error("html prop can't be null");if(!i.current)return;i.current=Boolean(o);const e=document.createRange().createContextualFragment(t);r.current.innerHTML="",r.current.appendChild(e)},[t,r]),n("div",{...c,ref:r})}},ahyU:function(e,t,a){},bFmC:function(e,t,a){"use strict";a.r(t);var n=a("q1tI"),l=a.n(n),s=a("YwZP"),o=a("VcRX"),c=a("nll4"),r=a("KQm4"),i=(a("ub8t"),a("9Koi")),m=a("tsAR"),u=a("6/r4"),d=a("KYPV"),b=a("Ys8a");var f=function(e){let{voteLimit:t,votes:a,onClickRemove:n}=e;return l.a.createElement("div",{className:"songlist__votes"},l.a.createElement("h3",{className:"songlist__votes--title"},"Mijn top ",t),(()=>{const e=[];for(let s=0;s<t;s++)e.push(l.a.createElement("div",{className:(a[s]?"active":"")+" vote--row",key:"vote-row-"+s},l.a.createElement("div",{className:"count"},s+1),l.a.createElement("div",{className:"song--info"},l.a.createElement("div",{className:"title"},a.length&&a[s]?a[s].title:"Breng je stem uit"),l.a.createElement("div",{className:"artist"},l.a.createElement("strong",null,a.length&&a[s]?a[s].artist:""))),a.length&&a[s]?l.a.createElement("div",{className:"vote"},l.a.createElement("button",{onClick:()=>n(a.length?a[s].id:null),className:"vote--remove"},l.a.createElement(b.a,{name:"close"}))):""));return e})())},g=a("7MiJ"),v=a("I+5a"),E=a.n(v),h=a("ExVU");const p={page:1,limit:25,total_pages:0};function y(e){let{active:t,onClick:a}=e;return l.a.createElement("button",{className:"vote--btn "+(t?"active":""),onClick:a},t?l.a.createElement(b.a,{name:"check"}):l.a.createElement("span",null,"Stem"))}var N=function(e){let{voteList:t,title:a}=e;const{t:s}=Object(i.a)(),{getListTracks:o,searchListTracks:c}=Object(m.b)(),{0:b,1:v}=Object(n.useState)([]),{0:N}=Object(n.useState)(p),{votes:j,setVotingVotes:k}=Object(g.a)(),{0:O,1:_}=Object(n.useState)("");function w(){0===O.length&&o(t.id,N).then(e=>{N.page=e.page,N.total_pages=e.total_pages,v(e.items)})}return Object(n.useEffect)(w,[t,O]),Object(n.useEffect)(()=>{O.length>=3&&c({query:O,list_id:t.id,timestamp:h.DateTime.local().toISO()}).then(e=>{v(e.filter(e=>e.list_id===t.id))})},[O]),l.a.createElement("div",{className:"songlist__wrap"},l.a.createElement("div",{className:"songlist"},l.a.createElement("div",{className:"songlist__search"},l.a.createElement(d.a,{initialValues:{search:""}},e=>{let{setFieldValue:t}=e;return l.a.createElement("form",{className:"form",onSubmit:e=>e.preventDefault()},l.a.createElement(u.a,{autoFocus:!1,name:"search",placeholder:"Zoek songs",onChange:e=>{t("search",e.target.value),_(e.target.value),window.dataLayer&&window.dataLayer.push({event:"Nostalgie-stemactie",action:"Zoek song - "+a})}}))})),l.a.createElement("div",{className:"songlist__content"},l.a.createElement("div",{className:"content--body"},b.map((e,n)=>{const s=Object(r.a)(j).findIndex(t=>t.id===e.id)>=0;return l.a.createElement("div",{className:"content--row",key:n},l.a.createElement("div",{className:"song--info"},l.a.createElement("div",{className:"title"},e.title),l.a.createElement("div",{className:"artist"},l.a.createElement("strong",null,e.artist))),j.length!==parseInt(t.max_votes)&&l.a.createElement("div",{className:"vote"},l.a.createElement(y,{active:s,onClick:()=>{!function(e){let a=Object(r.a)(j),n=a.findIndex(t=>t.id===e.id);n>=0?a.splice(n,1):j.length<parseInt(t.max_votes)&&a.push(e),k(a)}(e),window.dataLayer&&window.dataLayer.push({event:"Nostalgie-stemactie",action:"Stem op song - "+a})}})))}),0===b.length&&l.a.createElement("div",{className:"search--noresults"},l.a.createElement("p",null,"We vonden niets dat overeen komt met je huidige zoekopdracht"))),0===O.length&&l.a.createElement("div",{className:"content--pagination"},l.a.createElement(E.a,{previousLabel:"",nextLabel:"",breakLabel:"...",breakClassName:"break-me",pageCount:N.total_pages,marginPagesDisplayed:1,pageRangeDisplayed:3,onPageChange:function(e){N.page=e.selected+1,w()},containerClassName:"pagination",activeClassName:"active"})))),l.a.createElement(f,{voteLimit:t.max_votes,votes:j,onClickRemove:e=>function(e){if(e){let t=Object(r.a)(j),a=t.findIndex(t=>t.id===e);e>=0&&(t.splice(a,1),k(t))}}(e)}))};a("3f98");function j(e){var t;let{label:a,children:n,className:s,...o}=e;const[c,r]=Object(d.b)(o);return l.a.createElement("div",{className:`field${r.touched&&r.error?" error":""} ${s}`},!!a&&l.a.createElement("span",{className:"field--label"},a),l.a.createElement("textarea",Object.assign({className:"field--text-area-input",name:c.name,value:null!==(t=c.value)&&void 0!==t?t:"",onChange:c.onChange},o)),r.touched&&r.error?l.a.createElement("div",{className:"field--error"},r.error):null,n)}j.defaultProps={className:""};var k=j,O=(a("VO8b"),a("lksx")),_=a("VaOL"),w=a("gsAb");var S=function(e){let{voteList:t,title:a}=e;const{votes:s,setVotingVotes:o,clearVotingVotes:c,setVotingSuggestions:u,setVotingQuestions:f,clearVotingQuestions:v}=Object(g.a)(),{createVote:E,getMeByAccessToken:h,createQuestions:p}=Object(m.b)(),{0:y,1:N}=Object(n.useState)(!1),{accessToken:j}=Object(_.a)(),{t:S}=Object(i.a)();function C(e){var t;u(e.suggestions),f((t=e,Object.keys(t).map(e=>{if(e.includes("question"))return{question_id:e.replace(/\D/g,""),answer:t[e]}}).filter(e=>e))),j?h(j).then(t=>{if(t&&j){const a=((e,t)=>Object.keys(e).map(a=>{if(a.includes("question"))return{voter_id:t,question_id:a.replace(/\D/g,""),answer:e[a]}}).filter(e=>e))(e,t.id);let n=[];s.map(e=>{n.push(e.id)});const l={voter_id:t.id,list_item_ids:n,comment:e.suggestions};E(l).then(e=>{N(!1),c(),window.location.reload()}),p(a).then(()=>{v()})}else N(!1),w.a.modal.setShowAuthModal(!0)}):(N(!1),w.a.modal.setShowAuthModal(!0))}return l.a.createElement("div",{className:"songlist"},l.a.createElement("div",{className:"songlist__content"},l.a.createElement("div",{className:"content--body"},s.map((e,t)=>l.a.createElement("div",{className:"content--row",key:t},l.a.createElement("div",{className:"song--info"},l.a.createElement("div",{className:"title"},e.title),l.a.createElement("div",{className:"artist"},l.a.createElement("strong",null,e.artist))),l.a.createElement("div",{className:"vote"},l.a.createElement("button",{onClick:()=>function(e){if(e){let t=Object(r.a)(s),a=t.findIndex(t=>t.id===e);e>=0&&(t.splice(a,1),o(t))}}(e.id),className:"vote--remove"},l.a.createElement(b.a,{name:"close"})))))),l.a.createElement("div",{className:"profile"},l.a.createElement(d.a,{initialValues:{suggestions:""},onSubmit:e=>{N(!0),C(e),window.dataLayer&&window.dataLayer.push({event:"Nostalgie-stemactie",action:"Bevestig stem - "+a})}},e=>{let{handleSubmit:a}=e;return l.a.createElement("form",{className:"form",onSubmit:a},l.a.createElement("div",{className:"form--fields"},null!=t&&t.questions?t.questions.map((e,t)=>l.a.createElement(k,{key:t,name:"question-"+e.id,label:e.question})):null),l.a.createElement("h4",{className:"form__intro--subtitle"},"Jouw song niet gevonden?"),l.a.createElement("div",{className:"form--fields"},l.a.createElement(k,{name:"suggestions",placeholder:"Bezorg ons hier je suggestie!"})),l.a.createElement("div",{className:"form--btns"},l.a.createElement(O.a,{large:!0,primary:!0,disabled:parseInt(t.max_votes)<3?s.length!==parseInt(t.max_votes):s.length<3,loading:y},(parseInt(t.max_votes)<3?s.length===parseInt(t.max_votes):s.length>=3)?"Bevestig je stem":S("myVotes.count",{count:t.max_votes-s.length}))))}))))};a("eXQt");var C=function(e){let{voteList:t,title:a}=e;const{votes:s}=Object(g.a)(),{0:o,1:c}=Object(n.useState)("songs"),{0:r,1:i}=Object(n.useState)(!1);return Object(n.useEffect)(()=>{s.length!==parseInt(t.max_votes)||r||"votes"!==o&&(i(!0),c("votes"))},[s,t,r]),l.a.createElement("div",{className:"voting"},l.a.createElement("div",{className:"voting__tabs"},l.a.createElement("button",{onClick:()=>c("songs"),className:"voting__tabs--item "+("songs"===o?"active":"")},"Songs"),l.a.createElement("button",{onClick:()=>c("votes"),className:"voting__tabs--item "+("votes"===o?"active":"")},"Mijn stemmen ",s.length>0&&`(${s.length})`)),"songs"===o&&l.a.createElement(N,{voteList:t,title:a}),"votes"===o&&l.a.createElement(S,{voteList:t,title:a}))},L=a("SZp0"),T=a("nwof"),x=a("KTnM"),V=a("mOSi"),I=(a("ahyU"),a("q5QH"),a("GFXE")),P=a.n(I);var q=e=>{let{text:t,title:a}=e;const{t:s}=Object(i.a)();return Object(n.useEffect)(()=>{window.dataLayer&&window.dataLayer.push({event:"Nostalgie-stemactie",action:"Stem completed - "+a})},[]),l.a.createElement("div",{className:"voting-success"},l.a.createElement("div",{className:"form__intro"},l.a.createElement("div",{className:"form__intro--icon"},l.a.createElement("img",{src:P.a,alt:""})),l.a.createElement("h3",{className:"form__intro--title"},s("votingModal.title")),l.a.createElement("p",{className:"form__intro--body"},t)))};var M=Object(L.a)((function(e){let{slug:t}=e;const{getVotePublicationBySlug:a,setPageInformation:r,getVoteListById:u,checkVotingParticipation:d,getMeByAccessToken:b}=Object(m.b)(),{setLastVoting:f}=Object(g.a)(),{0:v,1:E}=Object(n.useState)(null),{0:h,1:p}=Object(n.useState)(!0),{0:y,1:N}=Object(n.useState)(null),{0:j,1:k}=Object(n.useState)(!0),{t:O}=Object(i.a)(),{accessToken:w}=Object(_.a)(),S=Object(s.useLocation)();return Object(n.useEffect)((function(){a(t).then(e=>{p(!1),r(Object(T.a)(e,"article")),E(e)})}),[t]),Object(n.useEffect)(()=>{S&&f(S.pathname)},[S]),Object(n.useEffect)(()=>{v&&u(Object(x.S)(v.votingmodule_list_id)).then(e=>{N(e),w&&b(w).then(t=>{d(t.id,e.id).then(e=>{k(!e)})})})},[v]),l.a.createElement("div",{className:"vote"},h&&l.a.createElement(o.a,null),v&&l.a.createElement(o.b,{image:v.image,label:O("voteDetail.label"),color:"#f93822"},l.a.createElement(c.a,null,Object(x.O)(v.title)),v.layout&&Array.isArray(v.layout.items)?v.layout.items.map((e,t)=>Object(V.b)(e,t)):null,j?l.a.createElement(l.a.Fragment,null,y&&l.a.createElement(C,{title:Object(x.O)(v.title),voteList:y})):l.a.createElement(q,{text:Object(x.R)(v.vote_submitted_copy),title:Object(x.O)(v.title)})))}),{page:"Stemmen"});t.default=()=>{const{clearVotingVotes:e,clearLastVoting:t}=Object(g.a)();return Object(n.useEffect)(()=>{e(),t()},[]),l.a.createElement(s.Router,null,l.a.createElement(M,{path:"stem/:slug"}))}},eXQt:function(e,t,a){},ik6Q:function(e,t,a){},k9OT:function(e,t,a){"use strict";var n=a("q1tI"),l=a.n(n);a("7coR");t.a=function(e){return l.a.createElement(l.a.Fragment,null,e.html?l.a.createElement("div",{className:"body-content",dangerouslySetInnerHTML:{__html:e.html}}):l.a.createElement("div",{className:"body-content"},e.children))}},mOSi:function(e,t,a){"use strict";a.d(t,"b",(function(){return h})),a.d(t,"a",(function(){return p}));var n=a("q1tI"),l=a.n(n),s=a("OS56"),o=a.n(s),c=(a("toje"),a("sZxp")),r=a.n(c),i=a("CZwz");var m=function(e){const{images:t}=e,a={dots:!1,infinite:!0,speed:300,slidesToShow:1,slidesToScroll:1,swipeToSlide:!1,draggable:!1};return l.a.createElement("div",{className:"carousel image-carousel"},t.length?l.a.createElement(o.a,a,t.map((e,t)=>l.a.createElement("div",{key:t},l.a.createElement("div",{className:"slide",key:t},l.a.createElement("div",{className:"slide__visual"},l.a.createElement("img",{src:Object(i.a)(e,795,520),alt:""})))))):l.a.createElement("div",{className:"slide__visual"},l.a.createElement(r.a,{width:"100%",height:"100%"})))},u=a("k9OT"),d=a("vDqi"),b=a("ECkX"),f=a.n(b);a("2agx");var g=function(e){const{src:t,type:a}=e,{0:s,1:o}=Object(n.useState)(null),{0:c,1:r}=Object(n.useState)(null),{0:i,1:m}=Object(n.useState)(!1);return Object(n.useEffect)(()=>{!async function(e,t){"SoundCloudPost"!==t?await Object(d.get)(`https://mediahuis.pointbreak.dev/api/v1/oembed?url=${p(t,e)}&radio=nostalgie`).then(e=>{o(e.data.html)}):(m(!0),await Object(d.get)(`https://soundcloud.com/oembed?iframe=true&url=${e}&format=json`).then(e=>{o(e.data.html)}))}(t,a)},[a]),l.a.createElement("div",{className:"media-embed"},l.a.createElement("div",{className:"media-embed--"+(null!=a?a:"unknown").toLowerCase()+(i?" soundcloud-embed":"")},s&&l.a.createElement(f.a,{html:s})))},v=a("KTnM"),E=a("8z8T");function h(e,t){if("Text"===e.label&&!e.format)return l.a.createElement(u.a,{key:t,html:e.body});if("Text"===e.label&&e.format){if("H1"===e.format)return l.a.createElement("h2",{className:"h1",key:t},e.body);if("H2"===e.format)return l.a.createElement("h2",{key:t},e.body);if("H3"===e.format)return l.a.createElement("h3",{key:t},e.body);if("H4"===e.format)return l.a.createElement("h4",{key:t},e.body);if("H5"===e.format)return l.a.createElement("h5",{key:t},e.body);if("H6"===e.format)return l.a.createElement("h6",{key:t},e.body)}else if("Asset"===e.label){const a=[],n=[];if(e.items.map(e=>{if("Document"===e.label)n.push(e);else if("Photo"===e.label){const t=Object(v.d)(e.cdn_files);a.push(t)}}),n.length>0&&0===a.length)return n.map(e=>{const a=Object(v.d)(e.cdn_files);return l.a.createElement(E.a,{key:t,onClick:()=>window.open(a,"_blank"),large:!0,primary:!0,icon:l.a.createElement("i",{className:"icon-download"})},""+e.name)});if(a.length>0&&0===n.length)return l.a.createElement(m,{key:t,images:a})}else{if("YouTubePost"===e.label)return l.a.createElement(g,{type:e.label,key:t,src:e.url});if("SpotifyPlaylist"===e.label)return l.a.createElement(g,{type:e.label,key:t,src:e.url});if("TwitterPost"===e.label)return l.a.createElement(g,{type:e.label,key:t,src:e.url});if("InstagramPost"===e.label)return l.a.createElement(g,{type:e.label,key:t,src:e.url});if("SoundCloudPost"===e.label)return l.a.createElement(g,{type:e.label,key:t,src:e.url});if("TikTokPost"===e.label)return l.a.createElement(g,{type:e.label,key:t,src:e.url});if("VimeoPost"===e.label)return l.a.createElement(g,{type:e.label,key:t,src:e.url});if("FacebookPost"===e.label)return l.a.createElement(g,{type:e.label,key:t,src:e.url})}}function p(e,t){return"YouTubePost"===e?`https://www.youtube.com/oembed?url=${t}&format=json`:"SpotifyPlaylist"===e?"https://open.spotify.com/oembed/?url="+t:"TwitterPost"===e?"https://publish.twitter.com/oembed?url="+t:"InstagramPost"===e?"https://graph.facebook.com/v10.0/instagram_oembed?url="+t:"SoundCloudPost"===e?`https://soundcloud.com/oembed?url=${t}&iframe=true`:"TikTokPost"===e?`https://www.tiktok.com/oembed?url=${t}&format=json`:"VimeoPost"===e?` https://vimeo.com/api/oembed.json?url=${t}&format=json`:"FacebookPost"===e?"https://graph.facebook.com/v10.0/oembed_post?url="+t:void 0}},nll4:function(e,t,a){"use strict";var n=a("q1tI"),l=a.n(n);a("ik6Q");t.a=function(e){let{children:t,centered:a,light:n,secondary:s}=e;return s?l.a.createElement("h2",{className:`title--main${a?" center":""}${n?" light":""}`},t):l.a.createElement("h1",{className:`title--main${a?" center":""}${n?" light":""}`},t)}},nwof:function(e,t,a){"use strict";a.d(t,"a",(function(){return s}));var n=a("KTnM"),l=a("CZwz");function s(e,t){if(e)return{page:e.title?e.title.body:"",shareImage:e.image?Object(l.a)(Object(n.E)(e.image),1200,630):"",shareDescription:e.shorttext?Object(n.C)(e.shorttext):"",type:t||"website"}}},toje:function(e,t,a){},ub8t:function(e,t,a){}}]); //# sourceMappingURL=component---src-pages-stem-jsx-23e46f6fdbe274ed8cee.js.map