PageSourceSearch

https://policy.nz/_next/static/chunks/pages/%5Bcampaign%5D/favouri…%5B%5B...election%5D%5D-06d71c653d0c86a5.js

js policy.nz collected 2026-09-24 21:23:21 UTC 12,761 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[393],{8327:function(e,l,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/[campaign]/favourites/[[...election]]",function(){return n(3174)}])},4902:function(e,l){"use strict";l.Z={src:"/_next/static/media/2022-hero.5f409c30.png",height:900,width:1900,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAECAIAAAA8r+mnAAAAbElEQVR42mPwWHXYfeUh71WHDJYfbV2/fNGCnhULJyzqzGUASnisPOS68lDQmmNp0+dsnNJ5dcvGlVPKoRKeKw87rDpUv2j5+ZmVB/vLFzfnMLivOuy58pD9qiOpK3dNmVTf0V7f2dcwq74RANRJNxKdMLQYAAAAAElFTkSuQmCC",blurWidth:8,blurHeight:4}},3310:function(e,l){"use strict";l.Z={src:"/_next/static/media/no-results.e0cc2094.png",height:455,width:492,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAHCAYAAAA1WQxeAAAAxUlEQVR42mOAgZIoBkYQXRXNoFAezaUJYpfG+TMxwEBjXCILiK6OzA/N8HBbCWJX+jOwMGxoTWFc15XJ3Fn5H6y6KefEqobs2y9vMDAwMqCD1TUMlqebqr+25Rz8sHs6gzADCKxrz5Df2p8X3VmTIbmlJ0O21LBqaU3l4puPHj/RZACB+ZUJ0jv6097s6EvY3ldc7ejiOSsrwmNqbHPRNHMGEJjGwMA4ua44eFptbsLZjT1aWxf2Zs6a1F23YvZUXwYGBgYANFtE8pHAr5IAAAAASUVORK5CYII=",blurWidth:8,blurHeight:7}},2693:function(e,l,n){"use strict";n.d(l,{nA:function(){return v},vW:function(){return h},zf:function(){return p}});var i=n(5893),t=n(2794),s=n(9100),o=n(4610),r=n(7831),d=n.n(r),a=n(7328),c=n(4184),u=n.n(c);let p=e=>{let{children:l,className:n}=e;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(o.E,{sm:!1,md:!0,children:(0,i.jsxs)(t.$,{backgroundColour:"primary5",paddingBottom:!1,paddingTop:!1,children:[(0,i.jsx)(a.L,{}),(0,i.jsx)(s.W2,{children:(0,i.jsx)(s.X2,{children:(0,i.jsx)(s.sg,{md:10,offsetMd:1,children:(0,i.jsx)("div",{className:u()(d().pageTop,n),children:l})})})})]})}),(0,i.jsx)(o.E,{sm:!0,md:!1,children:(0,i.jsx)(t.$,{spacing:"small",paddingBottom:!1,children:(0,i.jsx)(s.W2,{children:(0,i.jsx)(s.X2,{children:(0,i.jsx)(s.sg,{md:10,offsetMd:1,children:l})})})})})]})},v=e=>{let{darkMode:l=!1,children:n}=e;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(o.E,{sm:!1,md:!0,children:(0,i.jsx)(t.$,{backgroundColour:"gradient",paddingTop:!1,paddingBottom:!1,darkMode:l,children:(0,i.jsx)(s.W2,{children:(0,i.jsx)(s.X2,{children:(0,i.jsx)(s.sg,{md:10,offsetMd:1,children:(0,i.jsx)("div",{className:d().pageBottom,children:n})})})})})}),(0,i.jsx)(o.E,{sm:!0,md:!1,children:(0,i.jsx)(t.$,{paddingBottom:!1,children:(0,i.jsx)(s.W2,{children:(0,i.jsx)(s.X2,{children:(0,i.jsx)(s.sg,{md:10,offsetMd:1,children:n})})})})})]})},h=e=>{let{children:l}=e;return(0,i.jsx)("div",{className:d().pageBottomSpacing,children:l})}},7434:function(e,l,n){"use strict";n.d(l,{O:function(){return c},X:function(){return u}});var i=n(5893);n(7294);var t=n(4184),s=n.n(t),o=n(1664),r=n.n(o),d=n(7574),a=n.n(d);let c=e=>{let{label:l,link:n,onClick:t,isActive:o}=e;return(0,i.jsxs)(i.Fragment,{children:[n&&(0,i.jsx)(r(),{href:n,scroll:!1,children:(0,i.jsx)("div",{className:s()(a().tab,{[a().active]:o}),children:(0,i.jsx)("h4",{children:l})})}),!n&&t&&(0,i.jsx)("button",{onClick:t,className:s()(a().tab,{[a().active]:o}),children:(0,i.jsx)("h4",{children:l})})]})},u=e=>{let{children:l}=e;return(0,i.jsx)("div",{className:a().tabContainer,children:l})}},3174:function(e,l,n){"use strict";n.r(l),n.d(l,{Favourites:function(){return z},__N_SSP:function(){return H},default:function(){return M}});var i,t,s=n(5893),o=n(3148),r=n(5675),d=n.n(r),a=n(1163),c=n(4902),u=n(3310),p=n(7294),v=n(5430),h=n(1422),x=n(1664),j=n.n(x),g=n(7769),m=n.n(g);let _=e=>{let{results:l,totalPoliciesSelected:n,linkPrefix:i}=e;return(null==l?void 0:l.length)&&n?(0,s.jsx)(s.Fragment,{children:l.map((e,l)=>{let t=(null==e?void 0:e.total)/n*100;return(0,s.jsxs)("div",{className:m().wrapper,children:[(0,s.jsx)("span",{style:{backgroundColor:e.color},className:m().bulletPoint}),(0,s.jsxs)("h4",{children:[(0,s.jsxs)("span",{style:{color:e.color},className:m().percent,children:[t.toFixed(),"%"]}),(0,s.jsx)(j(),{href:"/".concat(i,"/").concat(e.slug),children:e.name})]})]},l)})}):null};var f=n(203),A=n(5690),b=n(621),T=n(5848),w=n(2693),E=n(4184),k=n.n(E),N=n(3927),B=n.n(N),y=n(7033),C=n(3689),L=n(630);let S=e=>{let{policiesByTopic:l,results:n}=e,[i,t]=(0,p.useState)(!1),o=Object.keys(l);return(0,s.jsxs)("div",{className:B().breakdownWrapper,children:[(0,s.jsx)("hr",{className:B().titleBorder}),(0,s.jsx)("div",{className:B().title,children:(0,s.jsxs)("button",{id:"policy-breakdown-button",className:k()(B().breakdownButton,{[B().chevronOpen]:i}),onClick:()=>t(!i),children:[(0,s.jsx)("h5",{children:L.Sl.FULL_POLICY_LIST_TITLE}),(0,s.jsx)(C.Z,{id:"elections-dropdown-svg"})]})}),(0,s.jsx)("hr",{className:B().titleBorder}),(0,s.jsx)("div",{className:k()(B().topicsWrapper,{[B().breakdownOpen]:i}),children:o.map((e,i)=>{var t,o,r,a,c;let u=l[e];return(0,s.jsxs)("div",{className:B().wrapper,children:[(0,s.jsxs)("div",{className:B().topicWrapper,children:[(0,s.jsx)("div",{className:B().imageWrapper,children:(null==u?void 0:null===(t=u.topicData)||void 0===t?void 0:t.image)&&(0,s.jsx)(d(),{src:null==u?void 0:null===(o=u.topicData)||void 0===o?void 0:o.image,loader:y.H,alt:null==u?void 0:null===(r=u.topicData)||void 0===r?void 0:r.name,width:100,height:100,style:{maxWidth:"100%",height:"auto",objectPosition:"center",objectFit:"cover"}})}),(0,s.jsx)("h4",{children:null==u?void 0:null===(a=u.topicData)||void 0===a?void 0:a.name})]}),null===(c=u.policies)||void 0===c?void 0:c.map((e,l)=>{var i;let{candidateName:t,policy:o}=e,r=null===(i=null==n?void 0:n.find(e=>e.name===t))||void 0===i?void 0:i.color;return(0,s.jsxs)("div",{className:B().policyWrapper,children:[(0,s.jsx)("span",{style:{backgroundColor:r},className:B().bulletPoint}),(0,s.jsx)("p",{children:null==o?void 0:o.statement})]},"".concat(l,"-").concat(null==o?void 0:o.reference))})]},i)})})]})};var P=n(7386),I=n(2794),O=n(7328),W=n(7434),U=n(4610),F=n(9100),R=n(5949),D=n(415),X=n(5332);o.kL.register(o.qi,o.u);var H=!0;let z=e=>{var l,n,o,r,x,j,g,m,E,k;let{host:N,election:B,topics:y,tags:C,resources:H,campaign:z}=e,M=(0,a.useRouter)(),{state:V,dispatch:G}=(0,p.useContext)(R.I),[K,Y]=(0,p.useState)(!0),[Z,q]=(0,p.useState)(!1);(0,p.useEffect)(()=>Y(!1),[]),(0,p.useEffect)(()=>
1{if(!B){var e;let l=null===(e=Object.keys(V.elections))||void 0===e?void 0:e[0];l?M.push("/".concat(z.slug,"/").concat(L.kx.FAVOURITES,"/").concat(l)):q(!0)}},[B,z,V,M,q]);let J={...L.Sl,...!!(null==B?void 0:null===(l=B.partiesList)||void 0===l?void 0:l.length)&&{...L.x5},...!!(null==B?void 0:null===(n=B.candidatesList)||void 0===n?void 0:n.length)&&{...L.LO}},Q=null==V?void 0:null===(o=V.elections)||void 0===o?void 0:o[null==B?void 0:B.slug],$=Object.keys(null==V?void 0:V.elections),ee=null!==(k=null==V?void 0:null===(r=V.elections)||void 0===r?void 0:null===(x=r[null==B?void 0:B.slug])||void 0===x?void 0:null===(j=x.selectedPolicies)||void 0===j?void 0:j.length)&&void 0!==k?k:0,el=B?(0,X.Fw)(B):null,en=null==Q?void 0:null===(g=Q.selectedPolicies)||void 0===g?void 0:g.map(e=>{var l,n,i,t;let s=null==el?void 0:el.find(l=>{var n;return null==l?void 0:null===(n=l.policies)||void 0===n?void 0:n.find(l=>l.reference===e)}),o=null===(l=null===(n=null==el?void 0:el.map(l=>{var n;return null==l?void 0:null===(n=l.policies)||void 0===n?void 0:n.find(l=>l.reference===e)}
1))||void 0===n?void 0:n.filter(Boolean))||void 0===l?void 0:l[0],r=s&&"person"in s?"".concat(s.person.firstName," ").concat(s.person.lastName):null==s?void 0:null===(i=s.party)||void 0===i?void 0:i.name,d=s&&"person"in s?"candidates/".concat(s.person.slug):"parties/".concat(null==s?void 0:s.party.slug),a=s&&"party"in s?null==s?void 0:null===(t=s.party)||void 0===t?void 0:t.color:void 0;return{policy:o,candidateName:r,color:a,slug:d}}),ei=(0,X.mC)(en),et=!!(null==Q?void 0:null===(m=Q.selectedCandidates)||void 0===m?void 0:m.length),es=null==en?void 0:en.reduce((e,l)=>{let n=y.find(e=>{var n,i;return e.slug===(null==l?void 0:null===(n=l.policy)||void 0===n?void 0:null===(i=n.topics)||void 0===i?void 0:i[0])});if(n||y.forEach(e=>{if(e.subtopics&&e.subtopics.length>0){n=e.subtopics.find(e=>{var n,i;return e.slug===(null==l?void 0:null===(n=l.policy)||void 0===n?void 0:null===(i=n.topics)||void 0===i?void 0:i[0])});return}}),n&&l){var s,o;null!==(o=(i=e)[t=n.slug])&&void 0!==o||(i[t]={policies:[],topicData:n}),null===(s=e[n.slug].policies)||void 0===s||s.push(l)}return e},{}),eo=!(null==es?void 0:es.length)&&et,er=null==Q?void 0:null===(E=Q.selectedCandidates)||void 0===E?void 0:E.map(e=>{let l=null==el?void 0:el.find(l=>l&&"person"in l&&l.person.slug===e);return{...l.person}}),ed={labels:null==ei?void 0:ei.map(e=>null==e?void 0:e.name),datasets:[{label:"# of votes",data:null==ei?void 0:ei.map(e=>null==e?void 0:e.total),backgroundColor:null==ei?void 0:ei.map(e=>null==e?void 0:e.color),borderColor:null==ei?void 0:ei.map(e=>null==e?void 0:e.color)}]},ea=()=>{G((0,D.oA)()),M.push("/")};return(0,s.jsxs)(T.A,{campaign:z,tags:C,resources:H,children:[(0,s.jsx)(P.H,{host:N,title:J.TITLE,campaign:z.name}),(0,s.jsx)(I.$,{backgroundColour:"accent",image:c.Z,imageOverlay:"light",children:(0,s.jsx)(F.W2,{children:(0,s.jsx)(F.X2,{children:(0,s.jsx)(F.sg,{md:8,offsetMd:1,children:(0,s.jsx)(b.l,{title:J.TITLE,subtitle:J.SUBTITLE})})})})}),(0,s.jsx)(I.$,{paddingBottom:!1,paddingTop:!1,children:!K&&!Z&&$.length>1&&(0,s.jsx)(W.X,{children:$.map((e,l)=>{var n,i;let t="/".concat(z.slug,"/").concat(L.kx.FAVOURITES,"/").concat(e);return(0,s.jsx)(W.O,{label:null==V?void 0:null===(n=V.elections)||void 0===n?void 0:null===(i=n[e])||void 0===i?void 0:i.title,link:t,isActive:M.asPath===t},l)})})}),(0,s.jsx)(w.zf,{children:(0,s.jsx)(F.X2,{justifySm:"center",children:(0,s.jsxs)(F.sg,{children:[(0,s.jsx)("h2",{children:eo?J.CANDIDATES_TITLE:J.POLICIES_TITLE}),(0,s.jsx)("p",{children:eo?J.CANDIDATES_SUBTITLE:J.POLICIES_SUBTITLE})]})})}),(0,s.jsx)(w.nA,{children:(0,s.jsx)(w.vW,{children:(0,s.jsx)(F.X2,{children:(0,s.jsx)(F.sg,{children:!K&&(0,s.jsxs)(s.Fragment,{children:[Z&&!et&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(F.X2,{children:(0,s.jsx)(F.sg,{children:(0,s.jsx)("div",{style:{position:"relative",minHeight:"120px",height:"100%"},children:(0,s.jsx)(d(),{alt:"",src:u.Z,layout:"fill",style:{objectFit:"contain",objectPosition:"center"}})})})}),(0,s.jsx)(F.X2,{children:(0,s.jsx)(F.sg,{alignSm:"center",children:(0,s.jsxs)("div",{style:{textAlign:"center"},children:[(0,s.jsx)("h3",{children:J.NOTHING_HERE_TITLE}),(0,s.jsx)("p",{children:J.NOTHING_HERE_SUBTITLE})]})})})]}),!!ei.length&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(F.X2,{directionSm:"column-reverse",directionLg:"row",children:[(0,s.jsxs)(F.sg,{lg:6,children:[(0,s.jsx)(U.E,{sm:!0,lg:!1,children:(0,s.jsx)(O.L,{})}),(0,s.jsx)(_,{linkPrefix:"".concat(z.slug,"/").concat(B.slug),totalPoliciesSelected:ee,results:ei})]}),(0,s.jsx)(F.sg,{sm:10,offsetSm:1,md:6,offsetMd:3,offsetLg:1,lg:4,alignSm:"center",children:(0,s.jsx)(v.$I,{data:ed})})]}),(0,s.jsx)(S,{policiesByTopic:es,results:ei})]}),et&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(O.L,{size:"small"}),!eo&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("h2",{children:J.CANDIDATES_TITLE}),(0,s.jsx)("p",{children:J.CANDIDATES_SUBTITLE})]}),(0,s.jsx)(O.L,{size:"small"}),(0,s.jsx)(A.i,{}),(0,s.jsx)(O.L,{size:"small"}),(0,s.jsx)(f.gy,{selectedCandidates:er,linkPrefix:"".concat(z.slug,"/").concat(B.slug)})]}),(0,s.jsx)(F.X2,{children:(0,s.jsxs)(F.sg,{alignSm:"center",children:[(0,s.jsx)(O.L,{}),(0,s.jsx)(A.i,{}),(0,s.jsx)(O.L,{}),(0,s.jsx)("h5",{style:{textAlign:"center"},children:J.RESET}),(0,s.jsx)(O.L,{size:"small"}),(0,s.jsx)(h.z,{colour:"gradient-secondary",onClick:ea,children:"Reset"}),(0,s.jsx)(O.L,{size:"small"})]})})]})})})})})]})};var M=z},7769:function(e){e.exports={wrapper:"CandidateResults_wrapper__Kt9S7",bulletPoint:"CandidateResults_bulletPoint__FJVtx",percent:"CandidateResults_percent__fWSkU"}},7831:function(e){e.exports={pageTop:"Page_pageTop__cfbgl",pageBottom:"Page_pageBottom__aGUUK",pageBottomSpacing:"Page_pageBottomSpacing__RxbG0"}},3927:function(e){e.exports={breakdownWrapper:"PolicyBreakdown_breakdownWrapper__tJVik",wrapper:"PolicyBreakdown_wrapper__nAVwC",titleBorder:"PolicyBreakdown_titleBorder__2C6CW",title:"PolicyBreakdown_title__tQzLz",breakdownButton:"PolicyBreakdown_breakdownButton__UT8_4",chevronOpen:"PolicyBreakdown_chevronOpen__MDBHI",topicsWrapper:"PolicyBreakdown_topicsWrapper__KF6HY",breakdownOpen:"PolicyBreakdown_breakdownOpen__EPmkf",topicWrapper:"PolicyBreakdown_topicWrapper__Z2Lqb",policyWrapper:"PolicyBreakdown_policyWrapper__qm_e0",bulletPoint:"PolicyBreakdown_bulletPoint__Iz_dM",imageWrapper:"PolicyBreakdown_imageWrapper__6y2jc"}},7574:function(e){e.exports={tab:"Tab_tab__ptjbY",active:"Tab_active__SQ1Hj",tabContainer:"Tab_tabContainer__iDbgz"}}},function(e){e.O(0,[196,621,853,848,829,774,888,179],function(){return e(e.s=8327)}),_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.