1!function(){try{var e="u">typeof window?window:"u">typeof global?global:"u">typeof globalThis?globalThis:"u">typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="bc47507c-9bd2-4eeb-929e-6275bedd3a80",e._sentryDebugIdIdentifier="sentry-dbid-bc47507c-9bd2-4eeb-929e-6275bedd3a80")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[560],{13857:e=>{var n={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"PortfolioDetails"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"allowedBrandCodes"}},type:{kind:"ListType",type:{kind:"NamedType",name:{kind:"Name",value:"BrandChoices"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"viewer"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"portfolios"},arguments:[{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"IntValue",value:"10"}},{kind:"Argument",name:{kind:"Name",value:"allowedBrandCodes"},value:{kind:"Variable",name:{kind:"Name",value:"allowedBrandCodes"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"number"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"collectiveBilling"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"accounts"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"totalCount"},arguments:[],directives:[]}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"totalCount"},arguments:[],directives:[]}]}}]}}]}}],loc:{start:0,end:316}};n.loc.source={body:"query PortfolioDetails($allowedBrandCodes: [BrandChoices]) {\n viewer {\n portfolios(first: 10, allowedBrandCodes: $allowedBrandCodes) {\n edges {\n node {\n number\n collectiveBilling\n accounts {\n totalCount\n }\n }\n }\n totalCount\n }\n }\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};var i={};function a(e,n){for(var i=0;i<e.definitions.length;i++){var a=e.definitions[i];if(a.name&&a.name.value==n)return a}}n.definitions.forEach(function(e){if(e.name){var n=new Set;!function e(n,i){if("FragmentSpread"===n.kind)i.add(n.name.value);else if("VariableDefinition"===n.kind){var a=n.type;"NamedType"===a.kind&&i.add(a.name.value)}n.selectionSet&&n.selectionSet.selections.forEach(function(n){e(n,i)}),n.variableDefinitions&&n.variableDefinitions.forEach(function(n){e(n,i)}),n.definitions&&n.definitions.forEach(function(n){e(n,i)})}(e,n),i[e.name.value]=n}}),e.exports=n,e.exports.PortfolioDetails=function(e,n){var t={kind:e.kind,definitions:[a(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var o=i[n]||new Set,r=new Set,d=new Set;for(o.forEach(function(e){d.add(e)});d.size>0;){var l=d;d=new Set,l.forEach(function(e){r.has(e)||(r.add(e),(i[e]||new Set).forEach(function(e){d.add(e)}))})}return r.forEach(function(n){var i=a(e,n);i&&t.definitions.push(i)}),t}(n,"PortfolioDetails")},26084:(e,n,i)=>{"use strict";i.d(n,{W:()=>c});var a=i(84475),t=i(71691),o=i(99201),r=i(13857),d=i.n(r),l=i(12038),s=i(51543);let c=()=>{let{isAuthenticated:e}=(0,t.A)(),{isPortfolioAccount:n}=(0,o.j)(),i=(0,s.Se)();return(0,a.Gp)({queryKey:["portfolioDetails",...i??[]],query:d(),variables:{allowedBrandCodes:i},select:e=>{let n=e.viewer?.portfolios?.edges.filter(e=>e?.node?.accounts.totalCount!==0);return{...e.viewer.portfolios,edges:n}},validateFn:e=>l.w5.validate(e),enabled:!!(e&&n)})}},27683:e=>{var n={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"TotalPortfolioBalance"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"portfolioNumber"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"portfolio"},arguments:[{kind:"Argument",name:{kind:"Name",value:"portfolioNumber"},value:{kind:"Variable",name:{kind:"Name",value:"portfolioNumber"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"accountBalances"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:132}};n.loc.source={body:"query TotalPortfolioBalance($portfolioNumber: String!) {\n portfolio(portfolioNumber: $portfolioNumber) {\n accountBalances\n }\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};var i={};function a(e,n){for(var i=0;i<e.definitions.length;i++){var a=e.definitions[i];if(a.name&&a.name.value==n)return a}}n.definitions.forEach(function(e){if(e.name){var n=new Set;!function e(n,i){if("FragmentSpread"===n.kind)i.add(n.name.value);
1else if("VariableDefinition"===n.kind){var a=n.type;"NamedType"===a.kind&&i.add(a.name.value)}n.selectionSet&&n.selectionSet.selections.forEach(function(n){e(n,i)}),n.variableDefinitions&&n.variableDefinitions.forEach(function(n){e(n,i)}),n.definitions&&n.definitions.forEach(function(n){e(n,i)})}(e,n),i[e.name.value]=n}}),e.exports=n,e.exports.TotalPortfolioBalance=function(e,n){var t={kind:e.kind,definitions:[a(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var o=i[n]||new Set,r=new Set,d=new Set;for(o.forEach(function(e){d.add(e)});d.size>0;){var l=d;d=new Set,l.forEach(function(e){r.has(e)||(r.add(e),(i[e]||new Set).forEach(function(e){d.add(e)}))})}return r.forEach(function(n){var i=a(e,n);i&&t.definitions.push(i)}),t}(n,"TotalPortfolioBalance")},35055:e=>{var n={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"PaginatedPortfolioAccounts"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"portfolioNumber"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"first"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"cursor"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"portfolio"},arguments:[{kind:"Argument",name:{kind:"Name",value:"portfolioNumber"},value:{kind:"Variable",name:{kind:"Name",value:"portfolioNumber"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"accounts"},arguments:[{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"Variable",name:{kind:"Name",value:"first"}}},{kind:"Argument",name:{kind:"Name",value:"after"},value:{kind:"Variable",name:{kind:"Name",value:"cursor"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"cursor"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"node"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"number"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"accountType"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"balance"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"properties"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"address"},arguments:[],directives:[]}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"pageInfo"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"endCursor"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"startCursor"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"hasNextPage"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"hasPreviousPage"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"edgeCount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"totalCount"},arguments:[],directives:[]}]}}]}}]}}],loc:{start:0,end:520}};n.loc.source={body:"query PaginatedPortfolioAccounts(\n $portfolioNumber: String!\n $first: Int!\n $cursor: String\n) {\n portfolio(portfolioNumber: $portfolioNumber) {\n accounts(first: $first, after: $cursor) {\n edges {\n cursor\n node {\n number\n accountType\n balance\n properties {\n address\n }\n }\n }\n pageInfo {\n endCursor\n startCursor\n hasNextPage\n hasPreviousPage\n }\n edgeCount\n totalCount\n }\n }\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};var i={};function a(e,n){for(var i=0;i<e.definitions.length;i++){var a=e.definitions[i];if(a.name&&a.name.value==n)return a}}n.definitions.forEach(function(e){if(e.name){var n=new Set;!function e(n,i){if("FragmentSpread"===n.kind)i.add(n.name.value);
1else if("VariableDefinition"===n.kind){var a=n.type;"NamedType"===a.kind&&i.add(a.name.value)}n.selectionSet&&n.selectionSet.selections.forEach(function(n){e(n,i)}),n.variableDefinitions&&n.variableDefinitions.forEach(function(n){e(n,i)}),n.definitions&&n.definitions.forEach(function(n){e(n,i)})}(e,n),i[e.name.value]=n}}),e.exports=n,e.exports.PaginatedPortfolioAccounts=function(e,n){var t={kind:e.kind,definitions:[a(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var o=i[n]||new Set,r=new Set,d=new Set;for(o.forEach(function(e){d.add(e)});d.size>0;){var l=d;d=new Set,l.forEach(function(e){r.has(e)||(r.add(e),(i[e]||new Set).forEach(function(e){d.add(e)}))})}return r.forEach(function(n){var i=a(e,n);i&&t.definitions.push(i)}),t}(n,"PaginatedPortfolioAccounts")},43527:(e,n,i)=>{"use strict";i.d(n,{a_:()=>t,c3:()=>o,lP:()=>a});let a="Need help logging in?",t="Sorry, your account is not supported online right now - please",o={RATE_LIMIT:"You've tried logging in too many times. Please wait a moment before trying again.",GENERIC:"We cannot sign you in - either your email or password is incorrect",CAPTCHA_NOT_SOLVED:"Please solve the CAPTCHA challenge.",CAPTCHA_VALIDATION_FAILED:"CAPTCHA validation failed. Please try again."}},74723:(e,n,i)=>{"use strict";i.d(n,{V:()=>N});var a=i(6029),t=i(55729),o=i(81278),r=i(84680),d=i(78969),l=i(75155),s=i(43527),c=i(71691),u=i(85303),m=i(99201),f=i(26084),v=i(14572),p=i(12549),g=i(28069),k=i(37948),h=i(90120);let b=()=>(0,a.jsxs)(r.o5,{children:[s.a_," ",(0,a.jsx)(l.A,{href:"https://www.hdcymru.co.uk/help-and-contact/contact-us/",children:"get in touch"})," ","and our team will help you"]}),N=()=>{let{login:e,logout:n,isAuthenticated:i}=(0,c.A)(),{push:r,asPath:l}=(0,o.useRouter)(),s=(0,v.V)(p.T.Portfolio),{PORTFOLIO_OVERVIEW:N,HOME:x}=h.b,{SNOOZE_ACCOUNT_ENRICHMENT:y,SNOOZE_PSR_UPDATE:S}=g.AZ,{isPortfolioAccount:j,isAllowedPortfolioSize:w,isLoading:P}=(0,m.j)(i),{data:E,isLoading:A}=(0,f.W)(),F=E?.edges[0]?.node?.collectiveBilling,T=E&&E.edges.length>1,{setGlobalMessage:C}=(0,u.u)(),D=(0,t.useCallback)(()=>{if((0,d.deleteCookie)(y),(0,d.deleteCookie)(S),j&&s&&w&&!A&&!F&&!T&&l!==N.path)return void r(N.path);let e=(0,k.O)();e?r(e):j||r(x.path)},[y,S,j,s,w,A,F,T,r,x.path,N.path,l]);return(0,t.useEffect)(()=>{A||P||(i&&j&&(F||!s||!w||!A&&!E?.edges.length||T)?(n(),C({message:(0,a.jsx)(b,{}),severity:"error"})):i&&D())},[n,D,j,i,P,s,w,F,A,E?.edges.length,T,C]),{login:e}}},85529:(e,n,i)=>{"use strict";i.d(n,{y:()=>r});var a=i(55729),t=i(81278),o=i(14572);let r=({featureFlag:e,redirectPath:n})=>{let{push:i}=(0,t.useRouter)(),r=(0,o.V)(e);(0,a.useEffect)(()=>{r||i(n)},[r,i,n])}},89578:(e,n,i)=>{"use strict";i.r(n),i.d(n,{default:()=>L});var a=i(6029),t=i(55729),o=i(81278),r=i(84680),d=i(45329),l=i(74723),s=i(96053),c=i(36164),u=i(93251),m=i(22823),f=i(22008),v=i(90120);let p=({address:e,accountType:n})=>e?(0,a.jsx)(c.A,{variant:"h5",component:"span",children:(0,a.jsx)("strong",{children:e})}):(0,a.jsx)(m.A,{accountType:n,variant:"h5",component:"span"}),g=({number:e})=>{let{push:n}=(0,o.useRouter)(),i=(0,u.jE)();return e?(0,a.jsx)(r.$n,{variant:"link",color:"primary","aria-label":`View account ${e}`,onClick:()=>{i.removeQueries(),sessionStorage.setItem(f.W,e),n(v.b.HOME.path)},children:"View account"}):null};var k=i(25033),h=i(86102);let b=({portfolioAccounts:e})=>(0,a.jsx)(r.mc,{component:"section",paddingY:"lg",children:(0,a.jsx)(d.XI,{columns:[{name:"Account",width:15},{name:"Property",width:60},{name:"Balance",width:10},{name:"Actions",width:15,visible:!1}],data:e.map(({node:e})=>{let n=e?.number||"",i=e?.balance,t=e?.properties?.[0]?.address;return{account:n&&(0,a.jsx)(c.A,{textWrap:"nowrap",children:n}),property:(0,a.jsx)(p,{address:t,accountType:e?.accountType}),balance:(0,h.E)(i)&&(0,a.jsx)(c.A,{textWrap:"nowrap",textAlign:"right",children:(0,a.jsx)("strong",{children:(0,k.vv)(i)})}),link:(0,a.jsx)(g,{number:n})}})})}),N=({portfolioAccounts:e})=>(0,a.jsx)(d.XI,{columns:[],data:e.map(({node:e})=>{let n=e?.number||"",i=e?.balance,t=e?.properties?.[0]?.address;return{left:(0,a.jsxs)(r.BJ,{direction:"vertical",alignItems:"flex-start",ga
1p:"xs",children:[n&&(0,a.jsx)(c.A,{textWrap:"nowrap",children:n}),(0,a.jsx)(p,{address:t,accountType:e?.accountType}),(0,a.jsx)(g,{number:n})]}),right:(0,h.E)(i)&&(0,a.jsx)(c.A,{textWrap:"nowrap",textAlign:"right",children:(0,k.vv)(i)})}})});var x=i(99201),y=i(84475),S=i(71691),j=i(35055),w=i.n(j),P=i(26084),E=i(27683),A=i.n(E),F=i(12038),T=i(93402),C=i(85529),D=i(14572),I=i(48081),V=i(68433),B=i(12549);let O=()=>(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(r.bv,{display:"none",md:{display:"block"},children:(0,a.jsx)(r.mc,{component:"section",paddingY:"lg",children:(0,a.jsx)(d.XI,{isLoading:!0,columns:[{name:"",width:10},{name:"",width:50},{name:"",width:10},{name:"",width:30}]})})}),(0,a.jsx)(r.bv,{md:{display:"none"},children:(0,a.jsx)(d.XI,{columns:[],data:[{left:(0,a.jsx)(d.Jz,{}),right:(0,a.jsx)(d.Jz,{})},{left:(0,a.jsx)(d.Jz,{}),right:(0,a.jsx)(d.Jz,{})},{left:(0,a.jsx)(d.Jz,{}),right:(0,a.jsx)(d.Jz,{})}]})})]}),_=()=>(0,a.jsx)(r.mc,{component:"section",marginX:"auto",padding:"md",maxWidth:"lg",md:{padding:"lg"},children:(0,a.jsxs)(r.BJ,{direction:"vertical",gap:"md",md:{gap:"lg"},children:[(0,a.jsx)(d.Xd,{}),(0,a.jsx)(r.Zp,{children:(0,a.jsxs)(r.BJ,{direction:"vertical",alignItems:"center",children:[(0,a.jsx)(d.WS,{}),(0,a.jsx)(d.Xd,{}),(0,a.jsx)(d.Jz,{})]})}),(0,a.jsx)(d.WS,{}),(0,a.jsx)(r.Zp,{padding:"none",children:(0,a.jsx)(O,{})})]})}),L=()=>{let e=(0,D.V)(B.T.PortfolioMoreThanTen),{isPortfolioAccount:n,isLoading:i}=(0,x.j)(),{push:u}=(0,o.useRouter)(),{data:m,isLoading:f,isError:p}=(0,T.G)(),{data:g,isLoading:h,isError:j,fetchNextPage:E,fetchPreviousPage:L,isFetchingNextPage:W,isFetchingPreviousPage:q,totalPortfolioBalance:J,isLoadingTotalPortfolioBalance:$,isTotalPortfolioBalanceError:X}=(({first:e}={})=>{let{isAuthenticated:n}=(0,S.A)(),{data:i}=(0,P.W)(),{data:a,isLoading:t,isError:o}=(()=>{let{isAuthenticated:e}=(0,S.A)(),{data:n}=(0,P.W)(),{number:i}=n?.edges[0]?.node||{};return(0,y.Gp)({queryKey:["totalPortfolioBalance"],query:A(),select:e=>e.portfolio?.accountBalances,validateFn:e=>F.g4.validate(e),enabled:!!(e&&i),variables:{portfolioNumber:i}})})(),{number:r}=i?.edges[0]?.node||{};return{...(0,y.m3)({queryKey:["paginatedPortfolioAccounts"],query:w(),variables:{portfolioNumber:r,first:e},validateFn:async e=>(await F.dh.validate(e)).portfolio.accounts,enabled:!!(n&&r),getNextPageParam:e=>e.pageInfo?.hasNextPage?e.pageInfo.endCursor:void 0,initialPageParam:"0",select:e=>e.pages[0]}),totalPortfolioBalance:a,isLoadingTotalPortfolioBalance:t,isTotalPortfolioBalanceError:o}})({first:10}),{totalNumberOfItems:z,currentPageIndex:H,setCurrentPageIndex:G}=(0,I.W)(g),R=g?.pages[H]?.edges??[];if((0,C.y)({featureFlag:B.T.Portfolio,redirectPath:n?v.b.LOGIN.path:v.b.HOME.path}),(0,t.useEffect)(()=>{i||n||u(v.b.HOME.path)},[n,u,i]),(0,l.V)(),f||h||$||!g)return(0,a.jsx)(_,{});if(p||j||X)return(0,a.jsx)(d.AX,{});let{viewer:M}=m,Y=J||0,Q=Y>0,Z=R?[...R].sort((e,n)=>(e.node?.number??"").localeCompare(n.node?.number??"")):[];return(0,a.jsxs)(r.mc,{component:"section",marginBottom:"lg",marginX:"auto",padding:"md",maxWidth:"lg",md:{padding:"lg"},children:[(0,a.jsx)(V.default,{title:v.b.PORTFOLIO_OVERVIEW.title}),(0,a.jsxs)(r.BJ,{direction:"vertical",gap:"md",md:{gap:"lg"},children:[(0,a.jsxs)(c.A,{variant:"h1",children:["Hello ",M.givenName," ",M.familyName]}),(0,a.jsx)(d.nU,{header:(0,a.jsx)(r.o5,{component:"span",variant:"h2",children:"Your total balance"}),amount:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(c.A,{component:"span",variant:"homepageTitle",children:(0,k.H7)(Y)})," ",(0,a.jsx)(r.o5,{color:Q?"success":"error",component:"span",variant:"body2",children:0===Y?"":Q?"(credit)":"(debit)"})]}),explanation:"You are billed separately for each property and pay each account individually."}),(0,a.jsxs)(r.BJ,{direction:"vertical",gap:"smMd",md:{gap:"md"},children:[(0,a.jsx)(r.o5,{variant:"h2",children:"Accounts"}),(0,a.jsxs)(r.Zp,{padding:"none",children:[W||q?(0,a.jsx)(O,{}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(r.bv,{display:"none",md:{display:"block"},children:(0,a.jsx)(b,{portfolioAccounts:Z})}),(0,a.jsx)(r.bv,{md:{display:"none"},children:(0,a.jsx)(N,{portfolioAccounts:Z})})]}),e&&(0,a.jsx)(s.A,{setCurrentPageIndex:G,paginatedData:g.pages,fetchNextPage:E,fetchPreviousPage:L,totalNumberOfItems:z,maxPageCount:10,currentPageIndex:H,isFetchingNextPage:W,isFetchingPreviousPage:q})]})]})]})]})}},96177:(e,n,i)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/portfolio-overview",function(){return i(89578)}])}},e=>{e.O(0,[636,6593,8792],()=>e(e.s=96177)),_N_E=e.O()}]); 2//# sourceMappingURL=portfolio-overview-8ae66b4fe0906ecd.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.