1"use strict";(self.webpackChunkhopsl=self.webpackChunkhopsl||[]).push([[918],{29821:function(e,t,s){s.r(t),s.d(t,{default:function(){return ds}});var r=s(68097),n=s(66734),i=s(70579),a=(0,n.A)((0,i.jsx)("path",{d:"M10.09 15.59 11.5 17l5-5-5-5-1.41 1.41L12.67 11H3v2h9.67zM19 3H5c-1.11 0-2 .9-2 2v4h2V5h14v14H5v-4H3v4c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2"}),"ExitToApp"),o=s(23445),l=s(40360),d=s(60446),h=s.n(d),c=s(88564),u=s(65043),p=s(67325),m=s(68130),g=s(43171),b=s(44293),v=s(91788),A=s(42492),x=s(68738),f=s(39652),j=s(91068),y=s(21832),S="Table_clickableRow__D3vrQ",w="Table_hiddenLastRowDivider__hTD0a",C="Table_overflow__q7uVY";const I=({columns:e,data:t,size:s,onRowClick:r,hideLastRowDivider:n,noHeader:a,className:o,rowClassNames:l,additionalRow:d})=>(0,i.jsx)("div",{className:C,children:(0,i.jsxs)(j.A,{className:`${n?w:""} ${o}`,size:s||"small",children:[!a&&(0,i.jsx)(A.A,{children:(0,i.jsx)(x.A,{children:e.map(((e,t)=>(0,i.jsx)(f.A,{align:e.align,style:{width:e.width},children:(0,i.jsx)(v.A,{bold:!0,str:e.label})},t)))})}),(0,i.jsxs)(y.A,{children:[t.map(((t,s)=>{let n;return r&&(n=()=>r(t)),(0,i.jsx)(x.A,{className:`${n?S:""} ${l?l[s]:""}`,hover:!!n,onClick:n,children:e.map(((e,s)=>(0,i.jsx)(f.A,{align:e.align,children:e.render(t)},s)))},s)})),d&&d.length&&(0,i.jsx)(x.A,{children:d.map(((e,t)=>(0,i.jsx)(f.A,{align:e.align,colSpan:e.colspan,children:e.content},t)))})]})]})}),D=({data:e,size:t,onRowClick:s,className:r})=>(0,i.jsx)("div",{className:C,children:(0,i.jsx)(j.A,{size:t||"small",className:r,children:(0,i.jsx)(y.A,{children:e.map(((e,t)=>{let r;return s&&(r=()=>s(e)),(0,i.jsx)(x.A,{className:r?S:void 0,hover:!!r,onClick:r,children:(0,i.jsxs)(u.Fragment,{children:[(0,i.jsx)(f.A,{children:(0,i.jsx)(v.A,{bold:!0,str:e.label})}),(0,i.jsx)(f.A,{children:e.content})]},t)},t)}))})})}),E=e=>(0===e&&(e=0),c.Localisation.formatCurrency(e).replace(c.Localisation.getCurrencySymbol(),""));var M=class{static getByNumber(e){return c.Api.call({url:`/api/local/orders/${e}`}).then((({data:e})=>e))}static getList(e){return c.Api.call({url:"/api/local/orders",params:e}).then((({data:e})=>e))}};const{OrderableTypes:P}=s(88564),R=e=>{switch(e){case P.RailwayProduct:return"Product";case P.DeliveryMethod:return"Delivery";case P.GiftCardInstance:return"Redeemed Gift Card";case P.GiftCardInventory:return"Gift Card";case P.Membership:return"Membership";case P.SeatReservation:return"Seat Reservation";case P.Shares:return"Shares";case P.System:return"Miscellaneous";case P.TicketSession:return"Event Ticket";case P.TicketTravel:return"Travel Ticket";case P.VoucherSale:return"Voucher";case P.TicketProtectionInstance:return"Ticket Protection";default:return e}},T=e=>{switch(e){case P.RailwayProduct:return"#91ADC8";case P.DeliveryMethod:return"lightgray";case P.GiftCardInstance:return"white";case P.GiftCardInventory:return"#EDA35A";case P.Membership:return"white";case P.SeatReservation:return"#EBE8FC";case P.Shares:return"#F5D2D2";case P.System:return"white";case P.TicketSession:return"#F3CFC6";case P.TicketTravel:return"#CADCAE";case P.VoucherSale:return"#FDEFB2";case P.TicketProtectionInstance:return"#FFC0CB";default:return"white"}};var k="OrderDetailsView_orderTable__0Dh6b",N="OrderDetailsView_itemsTable__+5SV-",V="OrderDetailsView_itemType__-jqJ6",O="OrderDetailsView_laterRemoved__+51Qp",$="OrderDetailsView_trNotRelated__78-ix",_="OrderDetailsView_total__nNf9E";const L=({number:e})=>{var t,s;const n=(0,r.Ez)((0,u.useCallback)((()=>M.getByNumber(e)),[e])),a=()=>{const e=n.data,t=[{label:"Order No",content:(0,i.jsx)(r.no,{Number:e.Number,Status:e.Status})},{label:"Date",content:c.Localisation.formatDateTime(e.Timestamp,`${c.Localisation.DateTimeFormats.ShortTime} ${c.Localisation.DateTimeFormats.ShortDate}`)},{label:"Billing Address",content:(0,i.jsx)(F,{order:e,addressKey:"BillingContact"})},{label:"Delivery Address",content:(0,i.jsx)(F,{order:e,addressKey:"DeliveryContact"})}];return(0,i.jsx)(D,{data:t,className:k})},o=()=>{const e=[{label:"Item Type",render:e=>(0,i.jsx)(H,{type:e.Orderable.Type}),width:"16rem"},{label:"Description",render:e=>(e=>{const t=e.replaceAll("<br />\r\n","\n").replaceAll("<br />","\n").replaceAll("<br>","\n");return(0,i.jsx)("span",{style:{whiteSpace:"pre-line"},children:t})})(e.Description)},{label:"Line Price",render:e=>E(z(e)),align:"right",width:"12rem"},{label:"Qty",render:e=>(0,i.jsx)(Q,{order:e}),align:"right",width:"12rem"},{label:"Line VAT",render:e=>E(q(e)),align:"right",width:"12rem"},{label:"Line Total",render:e=>E(W(e)),align:"right",width:"12rem"}],t={};let s=0,r=0,a=0,o=0,l=0;for(const i of n.data.Items)s+=B(i),r+=z(i),a+=q(i),o+=W(i),i.RelatedItemUuid||(t[l]=$),l++;
1const d=[{content:(0,i.jsx)(v.A,{str:"Total"}),colspan:2,align:"right"},{content:(0,i.jsx)(v.A,{bold:!0,str:E(r)}),align:"right"},{content:(0,i.jsx)(v.A,{bold:!0,str:s}),align:"right"},{content:(0,i.jsx)(v.A,{bold:!0,str:E(a)}),align:"right"},{content:(0,i.jsx)(v.A,{bold:!0,str:E(o),className:_}),align:"right"}];return(0,i.jsx)(I,{columns:e,data:n.data.Items,className:N,additionalRow:d,rowClassNames:t})};return(0,i.jsx)(m.A,{children:(0,i.jsxs)(b.A,{error:n.error,loading:(!(null!==(t=n.data)&&void 0!==t&&null!==(s=t.objects)&&void 0!==s&&s.length)||n.error)&&n.loading,onRetry:n.fetch,retryLabel:"Retry",children:[(0,i.jsx)(g.A,{label:"Back to My Orders",startArrow:!0,uri:"/account/orders"}),(0,i.jsx)(m.A,{maxWidth:"60rem",children:(0,i.jsx)(a,{})}),(0,i.jsxs)(m.A,{children:[(0,i.jsx)(v.A,{bold:!0,str:"Items",variant:"h6"}),(0,i.jsx)(o,{})]})]})})},B=e=>e.Quantity,z=e=>e.PriceExVat*e.Quantity,q=e=>e.PriceVat*e.Quantity,W=e=>(e.PriceExVat+e.PriceVat)*e.Quantity,F=({order:e,addressKey:t})=>{var s,r,n,a,o,l,d,h,c,u,m,g,b,v;const A=[];A.push(null===(s=e[t])||void 0===s||null===(r=s.Address)||void 0===r?void 0:r.Address),A.push(null===(n=e[t])||void 0===n||null===(a=n.Address)||void 0===a?void 0:a.City),A.push(null===(o=e[t])||void 0===o||null===(l=o.Address)||void 0===l?void 0:l.County),A.push(null===(d=e[t])||void 0===d||null===(h=d.Address)||void 0===h?void 0:h.Postcode),e.BasketCountry&&A.push(e.BasketCountry.Name);let x="(None)";const f=null===(c=e[t])||void 0===c?void 0:c.PhoneDisplay;void 0!==f&&null!==f&&""!==f&&(x=f);let j="(None)";const y=null===(u=e[t])||void 0===u?void 0:u.Email;if(void 0!==y&&null!==y&&""!==y){const t=p.il.getState().org.NameShort;j=(0,i.jsx)("a",{href:`mailto:${y}&subject=${t} Order ${e.Number}`,children:y})}const S=`${null!==(m=null===(g=e[t])||void 0===g?void 0:g.Fname)&&void 0!==m?m:""} ${null!==(b=null===(v=e[t])||void 0===v?void 0:v.Sname)&&void 0!==b?b:""}`.trim(),w=A.filter((e=>e)).join(", ");return(0,i.jsxs)(i.Fragment,{children:[S?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("u",{children:S}),(0,i.jsx)("br",{})]}):null,w.length?(0,i.jsxs)(i.Fragment,{children:[w,(0,i.jsx)("br",{})]}):null,"Tel: ",x,(0,i.jsx)("br",{}),"Email: ",j]})},H=({type:e})=>(0,i.jsx)("div",{className:V,style:{backgroundColor:T(e)},children:R(e)}),Q=({order:e})=>(0,i.jsxs)(m.A,{children:[B(e),e.QuantityRemoved>0&&(0,i.jsxs)("span",{className:O,children:[e.QuantityRemoved," later removed"]})]});var Y=s(37102),U=s(85442),J=s(90246),G=s(73216);const K=()=>{var e,t,s,n,a;const o=(0,G.Zp)(),l=(0,G.zy)().search,d=(0,U.default)("(max-width: 480px)"),h=(0,u.useRef)({Limit:20,Page:1}),p=(0,u.useMemo)((()=>{const e=J.default.parse(l);return{Page:e.Page?parseInt(e.Page):h.current.Page}}),[l]),g=(0,r.Ez)((0,u.useCallback)((()=>M.getList({...h.current,...p})),[p])),A=(0,u.useCallback)((e=>{const t={...e};for(const s of Object.keys(t))t[s]===h.current[s]&&delete t[s];o(`/account/orders?${J.default.stringify(t)}`)}),[o]),x=(0,u.useCallback)(((e,t)=>A({...p,Page:t})),[p,A]),f=(0,i.jsx)(Y.A,{color:"secondary",count:Math.ceil(((null===(e=g.data)||void 0===e?void 0:e.count)||0)/h.current.Limit),disabled:g.loading,onChange:x,page:p.Page,size:d?"small":"large"});(0,u.useEffect)((()=>{window.scrollTo({top:0})}),[p]);const j=()=>{var e;const t=[{label:"Order No",render(e){const t=`/account/orders/${e.Number}`;return(0,i.jsx)("span",{onClick:()=>o(t),children:(0,i.jsx)(r.no,{Number:e.Number,uri:t,Status:e.Status})})}},{label:"Billing Name",render:e=>Z(e.BillingContact),width:"20rem"},{label:"Delivery Name",render:e=>Z(e.DeliveryContact),width:"20rem"},{label:"Date",render:e=>c.Localisation.formatDateTime(e.Timestamp,c.Localisation.DateTimeFormats.ShortDate)}];return(0,i.jsx)(I,{columns:t,data:null===(e=g.data)||void 0===e?void 0:e.objects})};let y=null;return y=null!==(t=g.data)&&void 0!==t&&null!==(s=t.objects)&&void 0!==s&&s.length?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(j,{}),f]}):(0,i.jsx)(v.A,{str:"No orders available."}),(0,i.jsx)(m.A,{alignItems:"center",justifySelf:"center",maxWidth:"70rem",fullWidth:!0,children:(0,i.jsx)(b.A,{error:g.error,loading:(!(null!==(n=g.data)&&void 0!==n&&null!==(a=n.objects)&&void 0!==a&&a.length)||g.error)&&g.loading,onRetry:g.fetch,retryLabel:"Retry",children:y})})},Z=e=>{var t,s;return e?`${null!==(t=e.Fname)&&void 0!==t?t:""} ${null!==(s=e.Sname)&&void 0!==s?s:""}`.trim():null};var X=class{static getIssues(e,t){return c.Api.call({url:`/api/local/publications/${e}`,params:t}).then((({data:e})=>e))}static getPublications(e){return c.Api.call({url:"/api/local/publications",params:e}).then((({data:e})=>e))}};const ee={MEMBERS:1,SHAREHOLDERS:2};var te=({alwaysRenderedChildren:e,type:t,children:s,state:r})=>{var n,a,o,l;const d=(0,G.Zp)(),h=403===(null===(n=r.error)||void 0===n||null===(a=n.response)||void 0===a?void 0:a.status);let c=null;return h&&t===ee.MEMBERS&&(c="An active membership is required to access members' Publications."),(0,i.jsxs)(m.A,{alignItems:"center",fullWidth:!0,justifySelf:"center",maxWidth:"60rem",children:[(0,i.jsx)(b.A,{error:r.error,errorMessage:c,loading:(!(null!==(o=r.data)&&void 0!==o&&null!==(l=o.objects)&&void 0!==l&&l.length)||r.error)&&r.loading,onRetry:h&&t===ee.MEMBERS?()=>d("/membership"):r.fetch,retryEndArrow:h,retryLabel:h&&t===ee.MEMBERS?"Become a Member":"Retry",children:s}),e]})},se=s(26487),re=s(99427),ne=s(48342),ie="PublicationsViewItem_card__HSuhP",ae="PublicationsViewItem_img__q6Zem",oe="PublicationsViewItem_container__ix67Q",le="PublicationsViewItem_imgContainer__hKNGm";var de=({imgHeight:e="19rem",Publication:t})=>(0,i.jsx)(re.A,{actionAreaComponent:"div",className:ie,uri:t.ViewUri,children:(0,i.jsxs)(ne.A,{className:oe,overflow:"hidden",children:[t.Thumbnail&&(0,i.jsx)("div",{className:le,children:(0,i.jsx)("img",{alt:t.Name,className:ae,src:`${c.Api.baseURL}
1/${t.Thumbnail}`,style:{height:e}})}),(0,i.jsxs)(m.A,{gap:.75,children:[(0,i.jsx)(m.A,{alignItems:"flex-end",columnar:!0,gap:.5,children:(0,i.jsx)(v.A,{bold:!0,color:"primary",str:t.Name,variant:"h6"})}),(0,i.jsxs)(m.A,{columnar:!0,gap:.25,children:[t.VisibleToMembers&&(0,i.jsx)(se.A,{color:"primary",label:"For Members",size:"small"}),t.VisibleToShareholders&&(0,i.jsx)(se.A,{color:"warning",label:"For Shareholders",size:"small"})]}),(0,i.jsx)(g.A,{endArrow:!0,label:"View Issues",uri:`/account/publications/${t.Slug}`})]})]})});var he=({type:e})=>{var t,s,n,a,o,l;const d=(0,G.Zp)(),h=(0,G.zy)().search,c=(0,U.default)("(max-width: 480px)"),p=(0,u.useRef)({Limit:10,Page:1}),m=(0,u.useMemo)((()=>{const e=J.default.parse(h);return{Page:e.Page?parseInt(e.Page):p.current.Page}}),[h]),g=(0,r.Ez)((0,u.useCallback)((()=>X.getPublications({...p.current,...m})),[m,p])),b=m.Page!==p.current.Page,A=(0,u.useCallback)((t=>{const s={...t};for(const e of Object.keys(s))s[e]===p.current[e]&&delete s[e];const r=`/${(e=>{switch(e){case ee.MEMBERS:return"members";case ee.SHAREHOLDERS:return"shareholders";default:return""}})(e)}`;d(`/account/publications${r}?${J.default.stringify(s)}`)}),[d,e]),x=(0,u.useCallback)(((e,t)=>A({...m,Page:t})),[m,A]);return(0,u.useEffect)((()=>{window.scrollTo({top:0})}),[m]),(0,i.jsxs)(te,{alwaysRenderedChildren:!(null===(t=g.data)||void 0===t||null===(s=t.objects)||void 0===s||!s.length)&&(()=>{var e;return(0,i.jsx)(Y.A,{color:"secondary",count:Math.ceil(((null===(e=g.data)||void 0===e?void 0:e.count)||0)/p.current.Limit),disabled:g.loading,onChange:x,page:m.Page,size:c?"small":"large"})})(),state:g,type:e,children:[null===(n=g.data)||void 0===n||null===(a=n.objects)||void 0===a?void 0:a.map(((e,t)=>(0,i.jsx)(de,{Publication:e},t))),!(null!==(o=g.data)&&void 0!==o&&null!==(l=o.objects)&&void 0!==l&&l.length)&&(0,i.jsx)(v.A,{str:b?"No matching Publications available.":"No Publications available."})]})},ce="PublicationsViewIssues_card__0UJxJ",ue="PublicationsViewIssues_img__Q2sub",pe="PublicationsViewIssues_container__C-7cC",me="PublicationsViewIssues_imgContainer__g5f97";var ge=({imgHeight:e="19rem",issue:t})=>{const s=t.History.FirstPublishedTime,r=c.Localisation.formatDateTime(s,c.Localisation.DateTimeFormats.LongDate);return(0,i.jsx)(re.A,{actionAreaComponent:"div",className:ce,uri:t.ViewUri,children:(0,i.jsxs)(ne.A,{className:pe,overflow:"hidden",children:[t.Thumbnail&&(0,i.jsx)("div",{className:me,children:(0,i.jsx)("img",{alt:t.Issue,className:ue,src:`${c.Api.baseURL}/${t.Thumbnail}`,style:{height:e}})}),(0,i.jsxs)(m.A,{gap:.75,children:[(0,i.jsxs)(m.A,{gap:0,children:[(0,i.jsx)(v.A,{bold:!0,color:"primary",str:t.Publication.Name}),(0,i.jsxs)(m.A,{gap:.25,children:[(0,i.jsx)(v.A,{color:"secondary",str:t.Issue,variant:"h5"}),(0,i.jsx)(v.A,{color:"textSecondary",str:`Published ${r}`,variant:"body2"})]})]}),(0,i.jsx)(v.A,{color:"textSecondary",gap:.75,lineHeight:1.8,str:t.Summary}),t.ViewUri&&(0,i.jsx)(g.A,{endArrow:!0,label:"Read Issue",uri:t.ViewUri})]})]})})};var be=({slug:e})=>{var t,s,n,a,o;const l=(0,G.Zp)(),d=(0,G.zy)().search,h=(0,U.default)("(max-width: 480px)"),c=(0,u.useRef)({Limit:20,Page:1}),p=(0,u.useMemo)((()=>{const e=J.default.parse(d);return{Page:e.Page?parseInt(e.Page):c.current.Page}}),[d]),A=(0,r.Ez)((0,u.useCallback)((()=>X.getIssues(e,{...c.current,...p})),[p,e])),x=(0,u.useCallback)((t=>{const s={...t};for(const e of Object.keys(s))s[e]===c.current[e]&&delete s[e];l(`/account/publications/${e}?${J.default.stringify(s)}`)}),[l,e]),f=(0,u.useCallback)(((e,t)=>x({...p,Page:t})),[p,x]),j=(0,i.jsx)(Y.A,{color:"secondary",count:Math.ceil(((null===(t=A.data)||void 0===t?void 0:t.count)||0)/c.current.Limit),disabled:A.loading,onChange:f,page:p.Page,size:h?"small":"large"});(0,u.useEffect)((()=>{window.scrollTo({top:0})}),[p]);let y=null;var S;null!==(s=A.data)&&void 0!==s&&null!==(n=s.objects)&&void 0!==n&&n.length?y=(0,i.jsxs)(m.A,{children:[(0,i.jsx)(g.A,{startArrow:!0,label:"Back to Publications",uri:"/account/publications/"}),null===(S=A.data)||void 0===S?void 0:S.objects.map(((e,t)=>(0,i.jsx)(ge,{issue:e},t))),j]}):y=(0,i.jsx)(v.A,{str:"No issues available."});return(0,i.jsx)(m.A,{alignItems:"center",justifySelf:"center",maxWidth:"70rem",fullWidth:!0,children:(0,i.jsx)(b.A,{error:A.error,loading:(!(null!==(a=A.data)&&void 0!==a&&null!==(o=a.objects)&&void 0!==o&&o.length)||A.error)&&A.loading,onRetry:A.fetch,retryLabel:"Retry",children:y})})},ve=s(17116),Ae=s(22936),xe=s(10647),fe=s(97539),je=s(39336),ye=s(82057);var Se=class{static getById(e){return c.Api.call({url:`/api/local/news/${e}`}).then((({data:e})=>e))}static getByType(e,t){return c.Api.call({url:`/api/local/news?Type=${e}`,params:t}).then((({data:e})=>e))}};const we={INTERNAL:1,MEMBERS:2,SHAREHOLDERS:3,RAILDAYS:4},Ce=e=>(e=parseInt(e),Object.values(we).includes(e)?e:null),Ie=e=>{switch(e){case we.MEMBERS:return"members";case we.SHAREHOLDERS:return"shareholders";case we.RAILDAYS:return"raildays";default:return""}};var De=({alwaysRenderedChildren:e,type:t,children:s,state:r})=>{var n,a,o,l;const d=(0,G.Zp)(),h=403===(null===(n=r.error)||void 0===n||null===(a=n.response)||void 0===a?void 0:a.status);let c=null;return h&&(t===we.MEMBERS?c="An active membership is required to access members' news.":t===we.SHAREHOLDERS&&(c="A shareholding is required to access shareholders' news.")),(0,i.jsxs)(m.A,{alignItems:"center",fullWidth:!0,justifySelf:"center",maxWidth:"60rem",children:[(0,i.jsx)(b.A,{error:r.error,errorMessage:c,loading:(!(null!==(o=r.data)&&void 0!==o&&null!==(l=o.objects)&&void 0!==l&&l.length)||r.error)&&r.loading,onRetry:h&&t===we.MEMBERS?()=>d("/membership"):r.fetch,retryEndArrow:h,retryLabel:h&&t===we.MEMBERS?"Become a Member":"Retry",children:s}),e]})},Ee=s(51436),Me="NewsViewItemHeader_thumbnail__D3KMS";var Pe=({headlineBold:e,headlineColor:t,headlineGap:s,headlineVariant:r,hideReadMoreLink:n,story:a,uri:o})=>{const{org:l}=(0,Ee.A)(),d=1e3*a.History.FirstPublishedTime,h=1e3*a.History.LastUpdatedTime,u=c.Localisation.formatDateTime(d),p=c.Localisation.formatDateTime(d,c.Localisation.DateTimeFormats.LongDate),b=h?c.Localisation.formatDateTime(h,c.Localisation.DateTimeFormats.LongDate):null,A=b&&b!==u?`(Updated ${b})`:null;
1return(0,i.jsxs)(m.A,{fullWidth:!0,gap:.5,children:[a.Thumbnail&&(0,i.jsx)("img",{alt:a.Thumbnail.AltText||a.Headline,className:Me,src:`${c.Api.base}/uploads/public/${l.Id}/media/${a.Thumbnail.Uuid}`}),(0,i.jsxs)(m.A,{gap:s||.25,children:[(0,i.jsx)(v.A,{bold:e,color:t||"primary",str:a.Headline,variant:r||"h6"}),(0,i.jsxs)(m.A,{gap:.25,children:[(0,i.jsx)(v.A,{color:"textSecondary",str:p}),(0,i.jsx)(v.A,{color:"secondary",str:A,variant:"body2"})]})]}),(0,i.jsx)(m.A,{my:.5,children:(0,i.jsx)(v.A,{str:a.Summary})}),o&&!n&&(0,i.jsx)(g.A,{endArrow:!0,label:"Read More",uri:o})]})},Re="NewsStoryView_allNewsLink__nYVOo",Te="NewsStoryView_content__M5Lrf",ke="NewsStoryView_divider__tOzoG";var Ne=({id:e})=>{var t,s,n,a;const o=(0,r.Ez)((0,u.useCallback)((()=>Se.getById(e)),[e])),l=Ce(null===(t=o.data)||void 0===t?void 0:t.Type),d=l!==we.INTERNAL?`/${Ie(l)}`:"";return(0,i.jsxs)(De,{state:o,children:[o.data&&(0,i.jsx)(Ae.A,{title:null===(s=o.data)||void 0===s?void 0:s.Headline,description:null===(n=o.data)||void 0===n?void 0:n.Summary}),(0,i.jsx)(g.A,{className:Re,label:"All News",startArrow:!0,uri:`/account/news${d}`}),(0,i.jsx)(Pe,{headlineBold:!0,headlineColor:"textPrimary",headlineGap:.5,headlineVariant:"h5",hideReadMoreLink:!0,story:o.data}),(0,i.jsx)(je.A,{className:ke}),(0,i.jsx)(m.A,{className:Te,children:(0,i.jsx)(ye.A,{content:(null===(a=o.data)||void 0===a?void 0:a.Content)||""})})]})},Ve=s(3128),Oe="NewsViewItem_root__BracT",$e=({story:e})=>{const t=Ce(e.Type),s=`/account/news${t!==we.INTERNAL?`/${Ie(t)}`:""}/${e.Id}`;return(0,i.jsx)(Ve.A,{className:Oe,uri:s,children:(0,i.jsx)(Pe,{story:e,uri:s})})};var _e=({type:e})=>{var t,s,n,a,o,l;const d=(0,G.Zp)(),h=(0,G.zy)().search,c=(0,U.default)("(max-width: 480px)"),p=(0,u.useRef)({Limit:10,Page:1}),m=(0,u.useMemo)((()=>{const e=J.default.parse(h);return{Page:e.Page?parseInt(e.Page):p.current.Page}}),[h]),g=(0,r.Ez)((0,u.useCallback)((()=>Se.getByType(e,{...p.current,...m})),[m,p,e])),b=m.Page!==p.current.Page,A=(0,u.useCallback)((t=>{const s={...t};for(const e of Object.keys(s))s[e]===p.current[e]&&delete s[e];const r=e!==we.INTERNAL?`/${Ie(e)}`:"";d(`/account/news${r}?${J.default.stringify(s)}`)}),[d,e]),x=(0,u.useCallback)(((e,t)=>A({...m,Page:t})),[m,A]);return(0,u.useEffect)((()=>{window.scrollTo({top:0})}),[m]),(0,i.jsxs)(De,{alwaysRenderedChildren:!(null===(t=g.data)||void 0===t||null===(s=t.objects)||void 0===s||!s.length)&&(()=>{var e;return(0,i.jsx)(Y.A,{color:"secondary",count:Math.ceil(((null===(e=g.data)||void 0===e?void 0:e.count)||0)/p.current.Limit),disabled:g.loading,onChange:x,page:m.Page,size:c?"small":"large"})})(),state:g,type:e,children:[null===(n=g.data)||void 0===n||null===(a=n.objects)||void 0===a?void 0:a.map(((e,t)=>(0,i.jsx)($e,{story:e},t))),!(null!==(o=g.data)&&void 0!==o&&null!==(l=o.objects)&&void 0!==l&&l.length)&&(0,i.jsx)(v.A,{str:b?"No matching news stories available.":"No news stories available."})]})},Le=(0,n.A)((0,i.jsx)("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m-7 3c1.93 0 3.5 1.57 3.5 3.5S13.93 13 12 13s-3.5-1.57-3.5-3.5S10.07 6 12 6m7 13H5v-.23c0-.62.28-1.2.76-1.58C7.47 15.82 9.64 15 12 15s4.53.82 6.24 2.19c.48.38.76.97.76 1.58z"}),"AccountBox"),Be=s(29326),ze=(0,n.A)((0,i.jsx)("path",{d:"M20 2H4c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2m0 14H5.17L4 17.17V4h16zM11 5h2v6h-2zm0 8h2v2h-2z"}),"AnnouncementOutlined"),qe=s(96917),We=s(70394),Fe=s(49630),He=s(71274),Qe=s(87840),Ye=s(83570),Ue=s(34616),Je=()=>(0,i.jsxs)(m.A,{alignItems:"center",children:[(0,i.jsx)(v.A,{bold:!0,centre:!0,str:"Page Not Found",variant:"h6"}),(0,i.jsx)(g.A,{endArrow:!0,label:"User Account",uri:"/account"})]}),Ge=s(1444),Ke=s(71687),Ze=s(63734),Xe=s(5131),et=s(73769);class tt extends et.A{constructor(e){var t,s;super(e),this.handleChangeAddress=(e,t)=>{this.setState({Address:{...this.state.Address,[t]:e}})},this.handleChangeAddressBlock=e=>{this.setState({Address:e})},this.handleKey=e=>{13===e.which&&this.hasChanges&&this.handleSave()},this.handleSave=()=>{var e;if(null!==(e=this.formRef)&&void 0!==e&&e.current.reportValidity()&&this.hasChanges){var t,s,n;this.setState({loading:!0});const e={...this.state.Address,Country:(null===(t=this.state.Address)||void 0===t?void 0:t.Country)||(null===(s=this.props.address)||void 0===s||null===(n=s.Address)||void 0===n?void 0:n.Country)};Object.keys(e).forEach((t=>{null===e[t]&&(e[t]="")})),Ue.A.setAddress(e).then((({status:e,data:t})=>{const s=202===e,n=s?"Your change of address has been initiated.":"Added address.";r.zR.snack(n,"success"),this.props.onChange(t,s),this.setState({AddressOriginal:null===t||void 0===t?void 0:t.Address})}
1)).catch((e=>{r.zR.snack(e,"error")})).finally((()=>{this.setState({loading:!1})}))}},this.state={Address:null===(t=e.address)||void 0===t?void 0:t.Address,AddressOriginal:null===(s=e.address)||void 0===s?void 0:s.Address},this.formRef=u.createRef()}render(){return(0,i.jsxs)(ne.A,{children:[(0,i.jsxs)(ne.A,{alignItems:"center",columns:"max-content 13.5rem",justifyContent:"space-between",mb:.5,children:[(0,i.jsx)(v.A,{bold:!0,str:"Address",variant:"h6"}),!this.props.readOnly&&this.renderSaveButton()]}),(0,i.jsx)("form",{onKeyDown:this.handleKey,onSubmit:this.handleSubmit,ref:this.formRef,children:(0,i.jsx)(Xe.A,{controlled:!0,disabled:this.state.loading,onChange:this.handleChangeAddress,onChangeBlock:this.handleChangeAddressBlock,readOnly:this.props.readOnly,required:!0,values:this.state.Address})}),this.props.addressProposed&&this.renderProposed(),this.noAddress&&this.constructor.renderNoAddress()]})}renderProposed(){return(0,i.jsx)(v.A,{color:"textSecondary",str:this.proposedStr,variant:"body2"})}renderSaveButton(){return(0,i.jsx)(ve.A,{disabled:!this.hasChanges,label:"Save Changes",loading:this.state.loading,onClick:this.handleSave,variant:"contained"})}get hasChanges(){const e=this.state.Address||{},t=Object.keys(e||{})||[];if(1===Object.keys(e).length&&e.Country&&!this.state.AddressOriginal)return!1;if(!this.state.Address&&!this.state.AddressOriginal)return!1;for(let n=0;n<t.length;n++){var s,r;if("Country"===t[n])if(null===(r=this.state.AddressOriginal)||void 0===r||!r.Country)continue;const i=null===(s=this.state.AddressOriginal)||void 0===s?void 0:s[null===t||void 0===t?void 0:t[n]],a=e[t[n]];if(i!==a&&(void 0!==i||null!==a))return!0}return!1}get noAddress(){return!(this.props.address||this.props.addressProposed)}get proposedStr(){var e,t,s,r,n,i,a,o;const l=[null===(e=this.props.addressProposed)||void 0===e||null===(t=e.Address)||void 0===t?void 0:t.Address,null===(s=this.props.addressProposed)||void 0===s||null===(r=s.Address)||void 0===r?void 0:r.City,null===(n=this.props.addressProposed)||void 0===n||null===(i=n.Address)||void 0===i?void 0:i.County,null===(a=this.props.addressProposed)||void 0===a||null===(o=a.Address)||void 0===o?void 0:o.Postcode].filter((e=>e)).join(", ");return l?`Your change of address to ${l} has been initiated.`:"Your change of address has been initiated."}static renderNoAddress(){return(0,i.jsx)(ne.A,{mt:.25,children:(0,i.jsx)(v.A,{color:"error",str:"Please add your address."})})}}var st=tt,rt=(0,n.A)((0,i.jsx)("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zM19 4h-3.5l-1-1h-5l-1 1H5v2h14z"}),"Delete"),nt=(0,n.A)((0,i.jsx)("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6z"}),"Add"),it=s(69392),at=s(71716);class ot extends u.Component{constructor(...e){super(...e),this.handleAction=()=>{this.props.onAction(this.props.value,this.props.name)}}render(){return(0,i.jsxs)(ne.A,{alignItems:"center",gridTemplateRows:"4rem",columns:"1fr max-content",children:[this.props.children,!this.props.readOnly&&this.renderAction()]})}renderAction(){return(0,i.jsx)(ne.A,{children:(0,i.jsx)(it.A,{arrow:!0,title:this.props.title||"",children:(0,i.jsx)("div",{children:(0,i.jsx)(at.A,{color:"secondary",disabled:this.props.disabled,onClick:this.handleAction,children:this.props.icon})})})})}}var lt=ot;class dt extends u.Component{render(){var e;return(0,i.jsxs)(ne.A,{children:[null===(e=this.props.items)||void 0===e?void 0:e.map(((e,t)=>(0,i.jsx)(lt,{disabled:this.props.disabled||this.props.canDeleteItem&&!this.props.canDeleteItem(e),icon:(0,i.jsx)(rt,{}),onAction:this.props.onDelete,readOnly:this.props.readOnly,title:this.getItemActionTooltip(e),value:this.props.getItemValue(e),children:(0,i.jsx)(ne.A,{alignItems:"center",columns:"auto max-content",columnar:!0,ml:1,children:this.renderContent(e)})},t))),!this.props.readOnly&&this.renderInput()]})}renderContent(e){return this.props.renderContent?this.props.renderContent(e):(0,i.jsx)(v.A,{str:this.props.getItemText(e)})}renderInput(){return(0,i.jsx)(lt,{disabled:this.props.disabled,icon:(0,i.jsx)(nt,{}),onAction:this.props.onAdd,children:this.props.renderInput()})}getItemActionTooltip(e){return this.props.getItemActionTooltip?this.props.getItemActionTooltip(e):void 0}}var ht=dt,ct=s(37820);class ut extends et.A{constructor(...e){super(...e),this.state={loading:!1,newValue:""},this.inputRef=u.createRef(),this.handleChangeNewValue=e=>this.setState({newValue:e}),this.handleAdd=()=>{var e;if(null!==(e=this.inputRef)&&void 0!==e&&e.current.reportValidity()){const e=this.state.newValue.trim();if(this.props.emails.find((({Email:t})=>t===e)))return void r.zR.snack("You've already added this email address!","error");this.setState({loading:!0}),Ue.A.addEmailAddress(e).then((e=>{r.zR.snack("Email address added.","success"),this.props.onChange([...this.props.emails,e]),this.setState({newValue:""})})).catch((e=>{var t;400===(null===e||void 0===e||null===(t=e.response)||void 0===t?void 0:t.status)?r.zR.snack("Invalid email address.","error"):r.zR.snack(e,"error"),this.inputRef.current&&setTimeout((()=>this.inputRef.current.focus()))})).finally((()=>{this.setState({loading:!1})}
1))}},this.handleDelete=e=>{this.setState({loading:!0}),Ue.A.deleteEmailAddress(e).then((()=>{r.zR.snack("Email address deleted.","success"),this.props.onChange(this.props.emails.filter((({Id:t})=>t!==e)))})).catch((e=>{r.zR.snack(e,"error")})).finally((()=>{this.setState({loading:!1})}))},this.renderContent=e=>(0,i.jsxs)(u.Fragment,{children:[(0,i.jsx)(v.A,{str:e.Email,style:this.constructor.textStyles}),(0,i.jsx)(se.A,{label:this.constructor.getEmailStatusText(e.Status)})]}),this.renderInput=()=>(0,i.jsx)(ct.A,{controlled:!0,disabled:this.state.loading,inputRef:this.inputRef,label:"Add new email address...",onChange:this.handleChangeNewValue,onEnter:this.handleAdd,required:!0,size:"small",value:this.state.newValue}),this.canDeleteEmail=e=>{const t=this.props.emails.filter((e=>e.Sendable));return!e.Sendable||t.length>1},this.getItemActionTooltip=e=>this.canDeleteEmail(e)?void 0:"You must have at least one valid email address."}render(){var e;return(0,i.jsxs)(Ge.A,{gap:1,label:"Email Addresses",children:[!(null!==(e=this.props.emails)&&void 0!==e&&e.length)&&(0,i.jsx)(ne.A,{ml:1,children:(0,i.jsx)(v.A,{color:"error",str:"Please add an email address."})}),(0,i.jsx)(ht,{canDeleteItem:this.canDeleteEmail,disabled:this.state.loading,getItemActionTooltip:this.getItemActionTooltip,getItemValue:this.constructor.getItemValue,items:this.props.emails,onAdd:this.handleAdd,onDelete:this.handleDelete,readOnly:this.props.readOnly,renderContent:this.renderContent,renderInput:this.renderInput})]})}}ut.getEmailStatusText=e=>{switch(e){case 0:return"Invalid";case 1:return"Awaiting Validation";case 2:case 3:return"Valid";case 4:return"Not Validated";case 5:return"Suspended";case 6:return"New";default:return null}},ut.getItemValue=e=>e.Id,ut.textStyles={overflowX:"auto",whiteSpace:"nowrap"};var pt=ut,mt=s(94143);class gt extends et.A{constructor(...e){super(...e),this.state={loading:!1},this.handleToggle=e=>{this.setState({loading:!0});const t=e.Id,s=this.consentedIds.includes(t);(s?Ue.A.unsetMarketingConsent:Ue.A.setMarketingConsent)(t).then((()=>{s?this.props.onChange(this.props.consents.filter((({Id:e})=>e!==t))):this.props.onChange([...this.props.consents,e]),r.zR.snack("Saved.","success")})).catch((e=>{r.zR.snack(e,"error")})).finally((()=>{this.setState({loading:!1})}))}}render(){return(0,i.jsx)(Ge.A,{gap:1,label:"Marketing Choices",children:(0,i.jsx)(mt.A,{consented:this.props.consents,disabled:this.state.loading,onToggle:this.handleToggle,readOnly:this.props.readOnly})})}get consentedIds(){return this.props.consents.map((({Id:e})=>e))}}var bt=gt,vt=s(18226),At=s(47293),xt=s(91293);class ft extends u.PureComponent{constructor(...e){super(...e),this.state={canSubmit:!1,editing:!1,secqs:null,secqsError:!1,submitting:!1},this.formRef=null,this.handleCanSubmitChange=e=>this.setState({canSubmit:e}),this.handleEditToggle=()=>this.setState({editing:!this.state.editing,secqsError:!1}),this.handleSubmittingChange=e=>this.setState({submitting:e}),this.handleSubmit=()=>{this.formRef&&this.formRef.handleSubmit()},this.storeFormInnerRef=e=>this.formRef=e}componentDidUpdate(e,t){t.editing!==this.state.editing&&(!this.state.editing||this.state.secqs||this.props.securityQuestions||this.loadSecqs())}loadSecqs(){xt.A.getSecurityQuestions().then((e=>{this.setState({secqs:e})})).catch((()=>{this.setState({secqsError:!0})}
1))}render(){return(0,i.jsxs)(m.A,{gap:1,children:[(0,i.jsx)(v.A,{bold:!0,str:"Login Password",variant:"h6"}),(0,i.jsxs)(m.A,{children:[this.state.editing?this.renderEditState():this.renderViewState(),(0,i.jsx)(v.A,{color:"textSecondary",gap:.5,str:At.yj,variant:"body2"})]})]})}renderEditForm(){return(0,i.jsx)(vt.A,{onCanSubmitChange:this.handleCanSubmitChange,onDone:this.handleEditToggle,onLoadingChange:this.handleSubmittingChange,noHelp:!0,innerRef:this.storeFormInnerRef,securityQuestions:this.props.securityQuestions||this.state.secqs})}renderEditState(){return(0,i.jsxs)(m.A,{children:[this.state.secqs||this.props.securityQuestions?this.renderEditForm():(0,i.jsx)(v.A,{color:"textSecondary",str:this.state.secqsError?"Couldn't retrieve your account details.":"Loading..."}),(0,i.jsxs)(m.A,{columnar:!0,children:[(0,i.jsx)(ve.A,{disabled:this.state.submitting||!this.state.secqs&&!this.props.securityQuestions,label:"Save",loading:this.state.submitting,onClick:this.handleSubmit,variant:"contained"}),(0,i.jsx)(ve.A,{disabled:this.state.submitting,label:"Cancel",onClick:this.handleEditToggle,variant:"outlined"})]})]})}renderViewState(){return(0,i.jsx)(g.A,{endArrow:!0,label:"Change Password",onClick:this.handleEditToggle})}}var jt=ft,yt=s(73146);class St extends et.A{constructor(...e){super(...e),this.state={loading:!1,newValue:""},this.inputRef=u.createRef(),this.handleChangeNewValue=e=>this.setState({newValue:e}),this.handleAdd=()=>{var e;if(null!==(e=this.inputRef)&&void 0!==e&&e.current.reportValidity()){const e=this.state.newValue.trim();if(this.props.phones.find((({Phone:t})=>t===e)))return void r.zR.snack("You've already added this phone number!","error");this.setState({loading:!0}),Ue.A.addPhoneNumber(e).then((e=>{r.zR.snack("Phone number added.","success"),this.props.onChange([...this.props.phones,e]),this.setState({newValue:""})})).catch((e=>{var t;400===(null===e||void 0===e||null===(t=e.response)||void 0===t?void 0:t.status)?r.zR.snack("Invalid phone number.","error"):r.zR.snack(e,"error"),this.inputRef.current&&setTimeout((()=>this.inputRef.current.focus()))})).finally((()=>{this.setState({loading:!1})}))}},this.handleDelete=e=>{this.setState({loading:!0}),Ue.A.deletePhoneNumber(e).then((({status:t})=>{const s=202===t,n=s?"Marked for deletion.":"Phone number deleted.";r.zR.snack(n,"success");let i=this.props.phones.filter((({Id:t})=>t!==e));if(s){const t={...this.props.phones.find((({Id:t})=>t===e)),ModeratedDeletionPending:!0};i.push(t),i=i.sort(((e,t)=>e.Id>t.Id?1:t.Id>e.Id?-1:0))}this.props.onChange(i)})).catch((e=>{r.zR.snack(e,"error")})).finally((()=>{this.setState({loading:!1})}))},this.renderContent=e=>(0,i.jsxs)(u.Fragment,{children:[(0,i.jsx)(v.A,{str:e.Phone,style:this.constructor.textStyles}),e.ModeratedDeletionPending&&(0,i.jsx)(se.A,{label:"Marked for Deletion"})]}),this.renderInput=()=>(0,i.jsx)(yt.A,{controlled:!0,disabled:this.state.loading,inputRef:this.inputRef,label:"Add new phone number...",onChange:this.handleChangeNewValue,onEnter:this.handleAdd,required:!0,size:"small",value:this.state.newValue}),this.canDeletePhone=e=>!(null!==e&&void 0!==e&&e.ModeratedDeletionPending)&&this.delPhones,this.getItemActionTooltip=e=>e.ModeratedDeletionPending?"Already marked for deletion.":this.delPhones?void 0:"You must have at least one phone number."}render(){var e;return(0,i.jsxs)(Ge.A,{gap:1,label:"Phone Numbers",children:[!(null!==(e=this.props.phones)&&void 0!==e&&e.length)&&(0,i.jsx)(ne.A,{ml:1,children:(0,i.jsx)(v.A,{color:"error",str:"Please add a phone number."})}),(0,i.jsx)(ht,{canDeleteItem:this.canDeletePhone,disabled:this.state.loading,getItemActionTooltip:this.getItemActionTooltip,getItemValue:this.constructor.getItemValue,items:this.props.phones,onAdd:this.handleAdd,onDelete:this.handleDelete,readOnly:this.props.readOnly,renderContent:this.renderContent,renderInput:this.renderInput})]})}get delPhones(){return this.props.phones.filter((e=>!e.ModeratedDeletionPending)).length>1}}St.getItemValue=e=>e.Id,St.textStyles={overflowX:"auto",whiteSpace:"nowrap"};var wt=St,Ct=s(89556),It=s(53168);class Dt extends u.PureComponent{constructor(...e){super(...e),this.handleChange=e=>{var t;this.props.onChange((null===(t=this.props.questions)||void 0===t?void 0:t.find((t=>
1t.Id===parseInt(e))))||null,this.props.name)},this.reportIndexValue=()=>{var e;this.props.questions&&this.handleChange(null===(e=this.props.questions[this.props.i-1])||void 0===e?void 0:e.Id)}}componentDidMount(){this.props.reportMountIndexValue&&this.reportIndexValue()}componentDidUpdate(e){e.questions!==this.props.questions&&this.props.reportMountIndexValue&&this.reportIndexValue()}render(){var e;return(0,i.jsx)(It.A,{defaultValueLabel:`Question ${this.props.i}`,disabled:this.props.disabled,enabledWhenEmpty:!0,error:this.props.error,getOptionDisabled:this.props.getOptionDisabled,getOptionLabel:e=>e.Text,getOptionValue:e=>e.Id,label:`Question ${this.props.i}`,loading:this.props.loading,name:this.props.name,onChange:this.handleChange,options:this.props.questions||void 0,required:this.props.required,value:null===(e=this.props.value)||void 0===e?void 0:e.Id,variant:this.props.variant})}}var Et=Dt;class Mt extends et.A{constructor(...e){super(...e),this.state={q1:null,q1a:null,q2:null,q2a:null,q3:null,q3a:null,questions:null,error:!1,loading:!0,submitting:!1},this.handleChange=(e,t)=>
1{this.setState({[t]:e})},this.handleSubmit=e=>{e.preventDefault(),this.setState({submitting:!0});const t={Q1:this.state.q1,Q2:this.state.q2,Q3:this.state.q3},s={Q1:{QuestionId:t.Q1.Id,Answer:this.state.q1a},Q2:{QuestionId:t.Q2.Id,Answer:this.state.q2a},Q3:{QuestionId:t.Q3.Id,Answer:this.state.q3a}};xt.A.setSecurityQuestions(s).then((()=>{this.props.onSave(t),r.zR.snack("Security questions saved.","success")})).catch((e=>{r.zR.snack(e,"error")})).finally((()=>{this.setState({submitting:!1})}))}}componentDidMount(){super.componentDidMount(),xt.A.getAvailableSecurityQuestions().then((e=>{this.setState({questions:e})})).catch((()=>{this.setState({error:!0})})).finally((()=>{this.setState({loading:!1})}))}render(){var e,t,s;const r=[null===(e=this.state.q1)||void 0===e?void 0:e.Id,null===(t=this.state.q2)||void 0===t?void 0:t.Id,null===(s=this.state.q3)||void 0===s?void 0:s.Id];return(0,i.jsx)("form",{onSubmit:this.handleSubmit,children:(0,i.jsxs)(m.A,{children:[[1,2,3].map((e=>(0,i.jsxs)(ne.A,{columns:this.props.isMobile?"100%":"1fr 2fr",children:[(0,i.jsx)(Et,{disabled:this.state.submitting,error:this.state.error,getOptionDisabled:t=>{var s;return r.includes(null===t||void 0===t?void 0:t.Id)&&t.Id!==(null===(s=this.state["q"+e])||void 0===s?void 0:s.Id)},i:e,loading:this.state.loading,name:`q${e}`,onChange:this.handleChange,questions:this.state.questions,reportMountIndexValue:!0,required:!0,value:this.state[`q${e}`]}),(0,i.jsx)(Ct.A,{autoComplete:"off",controlled:!0,disabled:this.state.submitting,label:`Question ${e}`,name:`q${e}a`,onChange:this.handleChange,placeholder:"Type your answer...",required:!0,value:this.state[`q${e}a`],varchar:!0})]},e))),(0,i.jsxs)(m.A,{columnar:!0,children:[(0,i.jsx)(ve.A,{label:"Save",loading:this.state.submitting,type:"submit",variant:"contained"}),(0,i.jsx)(ve.A,{disabled:this.state.submitting,label:"Cancel",onClick:this.props.onCancel,variant:"outlined"})]})]})})}}var Pt=(0,r.d1)(Mt),Rt=s(48173);class Tt extends u.PureComponent{constructor(...e){super(...e),this.state={editing:!1},this.handleEditToggle=()=>{this.setState({editing:!this.state.editing})},this.handleSave=e=>{this.props.onSave(e),this.handleEditToggle()}}render(){return(0,i.jsxs)(ne.A,{gap:1,children:[(0,i.jsx)(v.A,{bold:!0,str:"Security Questions",variant:"h6"}),(0,i.jsxs)(ne.A,{children:[this.state.editing?this.renderEditor():this.renderView(),(0,i.jsx)(v.A,{color:"textSecondary",gap:.5,str:Rt.YF.p,variant:"body2"})]})]})}renderEditor(){return(0,i.jsx)(Pt,{onCancel:this.handleEditToggle,onSave:this.handleSave})}renderView(){return(0,i.jsx)(g.A,{endArrow:!0,label:"Set Security Questions",onClick:this.handleEditToggle})}}var kt=Tt,Nt=s(81855),Vt=s(86674),Ot=s(63009),$t=s(16609);class _t extends u.PureComponent{render(){var e,t;return(0,i.jsx)($t.A,{onClose:this.props.onClose,open:this.props.open,title:null===(e=this.error)||void 0===e?void 0:e.title,children:(0,i.jsx)(v.A,{color:"textSecondary",str:null===(t=this.error)||void 0===t?void 0:t.caption})})}get error(){return Rt.JJ.sO[`e${this.props.error}${this.props.errorId?`_${this.props.errorId}`:""}`]||Rt.JJ.sO[`e${this.props.error}`]||Rt.JJ.sO.generic}}var Lt=_t;class Bt extends et.A{constructor(...e){super(...e),this.state={error:null,errorDialog:!1,errorId:null,form:!1,submitting:!1,username:"",password:""},this.handleErrorDialogClose=()=>this.setState({errorDialog:!1}),this.handleFormToggle=()=>this.setState({form:!this.state.form}),this.handleInputChange=(e,t)=>
1this.setState({[t]:e,error:null}),this.handleSubmit=e=>{e.preventDefault(),this.isSameUser?this.setState({error:400}):(this.setState({submitting:!0}),Ue.A.join(this.state.username,this.state.password).then((()=>{r.zR.snack(Rt.JJ.kX,"success"),this.handleFormToggle(),this.setState({username:"",password:""})})).catch((e=>{var t;const s=null===e||void 0===e||null===(t=e.response)||void 0===t?void 0:t.status;if([400,401,404].includes(s))this.setState({error:s});else if([403,409].includes(s)){var n;this.setState({error:s,errorDialog:!0,errorId:null===e||void 0===e||null===(n=e.response)||void 0===n?void 0:n.data})}else r.zR.snack(e,"error")})).finally((()=>{this.setState({submitting:!1})})))}}render(){return(0,i.jsxs)(m.A,{children:[this.state.form?this.renderForm():this.renderView(),this.renderDialog()]})}renderDialog(){return(0,i.jsx)(Lt,{error:this.state.error,errorId:this.state.errorId,onClose:this.handleErrorDialogClose,open:this.state.errorDialog})}renderForm(){return(0,i.jsx)("form",{onSubmit:this.handleSubmit,children:(0,i.jsxs)(m.A,{maxWidth:"64rem",children:[(0,i.jsxs)(m.A,{mb:.5,children:[(0,i.jsx)(v.A,{bold:!0,str:Rt.JJ.Zd.P}),(0,i.jsx)(v.A,{color:"textSecondary",str:Rt.JJ.Zd.p})]}),(0,i.jsx)(Ot.A,{autoFocusOnError:!0,error:[400,404].includes(this.state.error),helperText:400===this.state.error?Rt.JJ.sO.e400:null,loginStatus:[400,404].includes(this.state.error)?this.state.error:null,disabled:this.state.submitting,onChange:this.handleInputChange,value:this.state.username}),(0,i.jsx)(Vt.A,{autoFocusOnError:!0,loginStatus:401===this.state.error?this.state.error:null,disabled:this.state.submitting,onChange:this.handleInputChange,value:this.state.password}),(0,i.jsxs)(m.A,{columnar:!0,mt:.5,children:[(0,i.jsx)(ve.A,{label:"Submit",loading:this.state.submitting,type:"submit",variant:"contained"}),(0,i.jsx)(ve.A,{label:"Cancel",onClick:this.handleFormToggle,variant:"outlined"})]})]})})}renderView(){return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(g.A,{endArrow:!0,label:Rt.JJ.nf.P,onClick:this.handleFormToggle}),(0,i.jsx)(v.A,{color:"textSecondary",str:Rt.JJ.nf.p,variant:"body2"})]})}get isSameUser(){return this.state.username===this.props.auth.Username}}var zt=(0,Nt.A)(Bt),qt=s(96307),Wt=()=>(0,i.jsx)(qt.A,{title:"You can't edit this information",severity:"warning",str:["Please contact us if you need to make any changes.","You don't have permission to change these details yourself."]});class Ft extends u.PureComponent{constructor(e){var t,s;super(e),this.handleAddressChanged=(e,t)=>{const s=t?"AddressProposed":"Address";this.props.onChange({[s]:e})},this.handleDobChanged=e=>this.setState({Dob:e}),this.handleDobSave=()=>{var e;const t=this.state.Dob;t!==this.state.DobCurrent&&null!==(e=this.dobInputRef)&&void 0!==e&&e.current.reportValidity()&&(this.setState({DobLoading:!0}),Ue.A.setDob(t).then((e=>{this.setState({DobCurrent:t}),200===e.status?(this.props.onChange({Dob:t,DobProposed:null}),r.zR.snack("Saved your date of birth.","success")):(this.props.onChange({DobProposed:t}),r.zR.snack("Change initiated.","success"))})).catch((e=>{r.zR.snack(e,"error")})).finally((()=>{this.setState({DobLoading:!1})})))},this.handleEmailsChanged=e=>{this.props.onChange({Emails:e})},this.handlePhonesChanged=e=>{this.props.onChange({Phones:e})},this.handleMarketingChanged=e=>{this.props.onChange({MarketingConsents:e})},this.handleSecurityQuestionsChanged=e=>{this.setState({cachedSecurityQuestions:e})},this.state={Dob:null===(t=e.profile)||void 0===t?void 0:t.Dob,DobCurrent:null===(s=e.profile)||void 0===s?void 0:s.Dob,DobLoading:!1,cachedSecurityQuestions:null},this.dobInputRef=u.createRef()}componentDidUpdate(e){e.profile!==this.props.profile&&this.props.profile&&this.props.profile.Dob&&this.props.profile.DobProposed!==this.state.Dob&&this.setState({Dob:this.props.profile.Dob})}render(){var e,t,s,r,n,a,o,l,d,c,u,p,m,g,b,v;const A=null===(e=new(h())(null===(t=this.props.profile)||void 0===t?void 0:t.DobProposed))||void 0===e?void 0:e.format("DD/MM/YYYY");return(0,i.jsxs)(ne.A,{gap:4,children:[!(null!==(s=this.props.profile)&&void 0!==s&&s.UserEditable)&&this.constructor.renderBannerPermission(),(0,i.jsxs)(Ge.A,{gap:2,label:"Account Details",children:[(0,i.jsxs)(ne.A,{mb:1,gap:1,children:[(0,i.jsx)(Ze.A,{dobDisabled:this.state.DobLoading,dobError:this.dobError?"Please add your date of birth.":null!==(r=this.props.profile)&&void 0!==r&&r.DobProposed?`Your date of birth change to ${A} has been initiated.`:void 0,dobErrorInert:!this.dobError&&!(null===(n=this.props.profile)||void 0===n||!n.DobProposed),dobInputRef:this.dobInputRef,dobReadOnly:!(null!==(a=this.props.profile)&&void 0!==a&&a.UserEditable),dobLoading:null===(o=this.state)||void 0===o?void 0:o.DobLoading,dobCurrent:null===(l=this.state)||void 0===l?void 0:l.DobCurrent,nameHelperText:"Contact us to change your name.",nameReadOnly:!0,onDobSave:this.handleDobSave,onDobChange:this.handleDobChanged,withDob:this.props.org.SavesDob,withName:!0,values:this.profileFormV
1alues}),(0,i.jsx)(zt,{})]}),(0,i.jsx)(ne.A,{mb:1,singleColumn:!0,children:(0,i.jsx)(jt,{securityQuestions:this.state.cachedSecurityQuestions})}),(0,i.jsx)(ne.A,{mb:1,singleColumn:!0,children:(0,i.jsx)(kt,{onSave:this.handleSecurityQuestionsChanged})}),(0,i.jsx)(st,{address:null===(d=this.props.profile)||void 0===d?void 0:d.Address,addressProposed:null===(c=this.props.profile)||void 0===c?void 0:c.AddressProposed,onChange:this.handleAddressChanged,readOnly:!(null!==(u=this.props.profile)&&void 0!==u&&u.UserEditable)})]}),(0,i.jsxs)(ne.A,{columns:this.props.isMobile?null:"repeat(2, 1fr)",gap:4,pb:.5,children:[(0,i.jsx)(pt,{emails:null===(p=this.props.profile)||void 0===p?void 0:p.Emails,onChange:this.handleEmailsChanged,readOnly:!(null!==(m=this.props.profile)&&void 0!==m&&m.UserEditable)}),(0,i.jsx)(wt,{phones:null===(g=this.props.profile)||void 0===g?void 0:g.Phones,onChange:this.handlePhonesChanged,readOnly:!(null!==(b=this.props.profile)&&void 0!==b&&b.UserEditable)}),!(null===(v=this.props.org.MarketingConsents)||void 0===v||!v.length)&&this.renderMarketing()]})]})}renderMarketing(){var e,t;return(0,i.jsx)(bt,{consents:null===(e=this.props.profile)||void 0===e?void 0:e.MarketingConsents,onChange:this.handleMarketingChanged,readOnly:!(null!==(t=this.props.profile)&&void 0!==t&&t.UserEditable)})}get dobError(){var e,t,s;return this.props.org.SavesDob&&!(null!==(e=this.state)&&void 0!==e&&e.Dob)&&!(null!==(t=this.state)&&void 0!==t&&t.DobProposed)&&(null===(s=this.props.profile)||void 0===s?void 0:s.UserEditable)}get profileFormValues(){var e,t,s;return{Name:null===(e=this.props.profile)||void 0===e?void 0:e.Fname,Surname:null===(t=this.props.profile)||void 0===t?void 0:t.Sname,Dob:null===(s=this.state)||void 0===s?void 0:s.Dob}}static renderBannerPermission(){return(0,i.jsx)(ne.A,{mb:-2,children:(0,i.jsx)(Wt,{})})}}var Ht=(0,r.d1)((0,Ke.A)(Ft)),Qt=s(79101);var Yt=class{static arrToStrList(e,t="",s=""){t&&e.length>1&&(t+=", ");const r=e.pop();return`${t}${e.join(", ")}${t||e.length+1>1?" and ":""}${r}${s}`}};class Ut extends u.Component{render(){return(0,i.jsx)(re.A,{hoverTransition:!0,children:(0,i.jsxs)(ne.A,{children:[(0,i.jsxs)(ne.A,{alignItems:"center",columnar:!this.props.isMobile,gap:this.props.isMobile?.5:2,justifyContent:"space-between",children:[(0,i.jsx)(v.A,{bold:!0,str:`${this.props.membership.MembershipType.Name} Membership`}),this.props.membership.No&&this.renderMembershipNo()]}),(0,i.jsx)(v.A,{color:"textSecondary",str:this.membersString}),(0,i.jsxs)(ne.A,{alignItems:"center",columnar:!0,gap:2,justifyContent:"space-between",children:[(0,i.jsx)(v.A,{color:this.isExpired?"error":"primary",str:this.datesString}),this.isExpired&&(0,i.jsx)(v.A,{bold:!0,color:"error",str:"Expired."})]})]})})}renderMembershipNo(){return(0,i.jsx)(v.A,{color:"textSecondary",str:`Membership No. ${this.props.membership.No}`,variant:"body2"})}get datesString(){const e=["Valid from",new(h())(this.props.membership.AttainedDate).format("DD/MM/YYYY")];return this.props.membership.ExpiryDate&&(e.push("to"),e.push(new(h())(this.props.membership.ExpiryDate).format("DD/MM/YYYY"))),e.join(" ").trim()}get membersString(){var e;if(null!==(e=this.props.membership)&&void 0!==e&&e.AdditionalMembers.length){var t;const e=null===(t=this.props.membership)||void 0===t?void 0:t.AdditionalMembers.map((e=>[e.Fname,e.Sname].join(" ").trim()));return Yt.arrToStrList(e,"Membership for yourself",".")}return"Membership for yourself only."}get isExpired(){return!!this.props.membership.ExpiryDate&&new(h())(this.props.membership.ExpiryDate)<new(h())}}var Jt=(0,r.d1)(Ut);class Gt extends u.Component{render(){return(0,i.jsx)(ne.A,{gap:1,children:this.props.memberships.map(((e,t)=>(0,i.jsx)(Jt,{membership:e},t)))})}}var Kt=Gt;class Zt extends u.Component{render(){var e;return null!==(e=this.props.memberships)&&void 0!==e&&e.length?this.renderContent():this.constructor.renderEmpty()}renderContent(){return(0,i.jsx)(Kt,{memberships:this.props.memberships})}static renderEmpty(){return(0,i.jsxs)(ne.A,{children:[(0,i.jsx)(v.A,{color:"textSecondary",str:"You're not a member yet."}),(0,i.jsx)(g.A,{endArrow:!0,label:"Become a Member",uri:Qt.Yu})]})}}var Xt=Zt;var es=({membership:e})=>{const t=(0,G.Zp)(),s=!!e.ExpiryDate&&new(h())(e.ExpiryDate)<new(h()),r=(()=>{const t=e.ExpiryDate,s=new(h())(t);return t&&s.diff(new(h()),"day")<=30})(),n=s?"error":r?"warning":"info",a=s?Rt.Yu.t.DD._7:r?Rt.Yu.t.DD.s_:Rt.Yu.t.DD.ss,o=s?Rt.Yu.t.pG._7:r?Rt.Yu.t.pG.s_:Rt.Yu.t.pG.ss;return(0,i.jsx)(qt.A,{severity:n,str:o,title:a,children:(0,i.jsx)(ve.A,{label:Rt.Yu.t.x6,onClick:()=>{const s=e.MembershipType.Slug;t(`${Qt.Yu}/${s}/renew`)},size:"large",variant:"contained"})})},ts="ProfileViewShareholdingsItem_root__W2NAt";const ss=(0,i.jsx)(ne.A,{children:(0,i.jsx)(v.A,{color:"textSecondary",str:"You do not have any active shareholdings."})}),rs=({shareholdings:e})=>{e.sort(((e,t)=>e.ShareType.Company.Name.localeCompare(t.ShareType.Company.Name)));const t=new Map;for(const r of e){const e=r.ShareType.Company;t.has(e.Id)||t.set(e.Id,{company:e,shareholdings:[]}),t.get(e.Id).shareholdings.push(r)}const s=[];return t.forEach((e=>{s.push((0,i.jsxs)(m.A,{children:[(0,i.jsx)(v.A,{variant:"h5",str:e.company.Name,bold:!0}),e.shareholdings.map((e=>(0,i.jsx)(ns,{shareholding:e},e.Id)))]},e.company.Id))})),(0,i.jsx)(m.A,{className:ts,gap:2,children:s})},ns=({shareholding:e})=>{const t=is(e.HoldingType,e.HoldingTypeText);return(0,i.jsxs)(re.A,{children:[(0,i.jsxs)(m.A,{columnar:!0,style:{justifyContent:"space-between"},children:[(0,i.jsxs)(m.A,{columnar:!0,children:[(0,i.jsx)(v.A,{str:e.ShareType.Name,bold:!0}),(0,i.jsx)(v.A,{str:`Numbered ${e.NumberFrom} - ${e.NumberTo} (${e.NumberTo-e.NumberFrom+1} shares)`})]}),(0,i.jsx)(v.A,{str:`Block number: ${e.Id}`})]}),t&&(0,i.jsx)(v.A,{str:t}),(0,i.jsx)(v.A,{str:`Issued: ${e.Issued?c.Localisation.formatDateTime(e.Issued,c.Localisation.DateTimeFormats.ShortDate):"No."}`})]})},is=(e,t)=>{switch(t=t?` ${t}`:"",e){case c.ShareholderTypes.values.Joint:return`Held jointly with:${as(t)}`;case c.ShareholderTypes.values.OnBehalfOfIndividual:return"";case c.ShareholderTypes.values.OnBehalfOfOrg:return`Controlled on behalf on organisation:${as(t)}`;default:return""}},as=e=>e?` ${e}`:"";var os=()=>{var e;const t=(0,r.Ez)((0,u.useCallback)((()=>c.Api.call({url:"/api/user/shares"}).then((({data:e})=>e))),[]));return(0,i.jsx)(m.A,{alignItems:"center",fullWidth:!0,justifySelf:"center",children:(0,i.jsx)(b.A,{error:t.error,errorMessage:"Failed to load shareholdings.",loading:t.loading,onRetry:t.fetch,children:null!==(e=t.data)&&void 0!==e&&e.length?(0,i.jsx)(rs,{shareholdings:t.data}):ss})})},ls="ProfileView_logout__fg+YX";var ds=()=>{const{isFeatureEnabled:e}=(0,fe.A)(),t=(0,G.zy)(),{isMobile:s}=(0,r.Iu)(),n=(0,G.Zp)(),{data:d,error:c,loading:p}=(0,r.Ez)((0,u.useCallback)((()=>Ue.A.get()),[])),{data:m,error:g,loading:b}=(0,r.Ez)((0,u.useCallback)((()=>Fe.A.getUsersMemberships()),[])),[A,x]=(0,u.useState)(null);(0,u.useEffect)((()=>x(d)),[d]);const f=(0,u.useMemo)((()=>[{uri:"/account",uris:["/account","/account/details"],label:"My Details",caption:"View and change the personal information stored in your account.",icon:Le,disabled:p},{uri:"/account/membership",label:"My Membership",caption:"View your current and past memberships.",icon:Be.A,feature:"Memberships",hidden:!(null!==d&&void 0!==d&&d.HasMembership),disabled:b},{uri:"/account/news/members",uris:["/account/news/members","/account/news","/news"],label:"Members' News",caption:"View the latest news about your membership and the railway's operations.",icon:ze,feature:"Memberships",hidden:!(null!==d&&void 0!==d&&d.HasMembershipCurrent)},{uri:"/account/publications",label:"Publications",caption:"View the publications related to your membership or shareholding.",icon:ze,feature:"Memberships",hidden:!(e("Publications")&&(null!==d&&void 0!==d&&d.HasMembershipCurrent||null!==d&&void 0!==d&&d.HasShareholding))},{uri:"/account/shareholdings",label:"My Shareholdings",caption:"View your shareholdings.",icon:qe.A,feature:"Shares",hidden:!(null!==d&&void 0!==d&&d.HasShareholding)},{uri:"/account/news/shareholders",label:"Shareholders' News",caption:"View the latest news for shareholders.",icon:ze,feature:"Shares",hidden:!(null!==d&&void 0!==d&&d.HasShareholdingCurrent)},{uri:"/account/orders",label:"My Orders",caption:"View your orders.",icon:We.A}].filter((t=>!t.feature||!t.hidden&&e(t.feature)))),[p,d,b,e]),j=e=>x({...A,...e}),y=(0,u.useCallback)((()=>{const e=t.pathname;return S(e)}),[t]),S=e=>e.substring(e.lastIndexOf("/")+1).slice(),w=(0,u.useMemo)((()=>null!==m&&void 0!==m&&m.length?m.find((e=>e.MembershipType.Available)):null),[m]),C=(0,u.useMemo)((()=>
1{if(w){const e=w.ExpiryDate;if(e){return new(h())(e).diff(new(h()),"day")<=30}}return!1}),[w]),I=(0,u.useMemo)((()=>{const e=t.pathname,s=f.find((t=>{var s,r;return t.uri===e||(null===(s=t.uris)||void 0===s||null===(r=s.includes)||void 0===r?void 0:r.call(s,e))}));if(s)return s;const r=y()?e.substring(0,e.lastIndexOf("/")):null,n=f.find((e=>{var t,s;return e.uri===r||(null===(t=e.uris)||void 0===t||null===(s=t.includes)||void 0===s?void 0:s.call(t,r))}));return n||null}),[y,t,f]);return(0,i.jsxs)(Qe.A,{children:[(0,i.jsx)(Ae.A,{title:(null===I||void 0===I?void 0:I.title)||(null===I||void 0===I?void 0:I.label),description:null===I||void 0===I?void 0:I.caption}),(0,i.jsx)(He.A,{label:"User Account",singleColumn:!0,children:(0,i.jsxs)(re.A,{gap:2,children:[(0,i.jsxs)(ne.A,{columns:!s&&"1fr max-content",gap:2,children:[(0,i.jsx)(o.A,{indicatorColor:"primary",onChange:(e,t)=>n(t),textColor:"primary",value:(null===I||void 0===I?void 0:I.uri)||!1,variant:"scrollable",children:f.map(((e,t)=>(0,i.jsx)(l.A,{disabled:e.disabled,label:e.label,tabIndex:0,value:e.uri},t)))}),(0,i.jsx)(ve.A,{classes:{root:ls},label:"Logout",onClick:xe.A,startIcon:(0,i.jsx)(a,{}),variant:"outlined"})]}),C&&(0,i.jsx)(es,{membership:w}),(()=>{if(c)return(0,i.jsx)(Ye.A,{noCentre:!0});if(p)return null;const s=t.pathname;if(s.startsWith("/news/")||s.startsWith("/account/news/")||s.startsWith("/account/news/shareholders/")||s.startsWith("/account/news/members/")){var r;const e=null!==(r=parseInt(y(s)))&&void 0!==r?r:null;if(e)return(0,i.jsx)(Ne,{id:e})}if(s.startsWith("/account/orders/")){const e=y(s);if(e)return(0,i.jsx)(L,{number:e})}if(e("Publications")&&s.startsWith("/account/publications/")){const e=y(s);if(e)return(0,i.jsx)(be,{slug:e})}switch(t.pathname){case"/account":case"/account/details":return(0,i.jsx)(Ht,{onChange:j,profile:A});case"/account/news/members":case"/account/news":case"/news":return(0,i.jsx)(_e,{type:we.MEMBERS});case"/account/publications/members":case"/account/publications":case"/publications":return(0,i.jsx)(he,{type:ee.MEMBERS});case"/account/shareholdings":return null!==d&&void 0!==d&&d.HasShareholding?(0,i.jsx)(os,{}):(0,i.jsx)(v.A,{color:"textSecondary",str:"You do not have any shareholdings."});case"/account/news/shareholders":return(0,i.jsx)(_e,{type:we.SHAREHOLDERS});case"/account/publications/shareholders":return(0,i.jsx)(he,{type:we.SHAREHOLDERS});case"/account/membership":return g?(0,i.jsx)(v.A,{color:"textSecondary",str:"Your membership details aren't available at the moment."}):(0,i.jsx)(Xt,{memberships:m});case"/account/orders":return(0,i.jsx)(K,{});default:return(0,i.jsx)(Je,{})}})()]})})]})}},49630:function(e,t,s){var r=s(88564),n=s(67325);t.A=class{static getMembershipImageUri(e){const t=n.Ay.getState().org.Id;return`${r.Api.baseURL}/uploads/local/${t}/membership_type/${e}`}static getMembershipViewImageUri(e){const t=n.Ay.getState().org.Id;return`${r.Api.baseURL}/uploads/local/${t}/membership_photos/${e}`}static getRegistrationData(){return r.Api.call({url:"/api/local/memberships"}).then((({data:e})=>e))}static getUsersMemberships(){return r.Api.call({url:"/api/memberships/mine"}).then((({data:e})=>e))}}},69827:function(e,t,s){s.d(t,{o0:function(){return p}});var r=function(e,t,s){if(s||2===arguments.length)for(var r,n=0,i=t.length;n<i;n++)!r&&n in t||(r||(r=Array.prototype.slice.call(t,0,n)),r[n]=t[n]);return e.concat(r||Array.prototype.slice.call(t))},n=function(e,t,s){this.name=e,this.version=t,this.os=s,this.type="browser"},i=function(e){this.version=e,this.type="node",this.name="node",this.os=process.platform},a=function(e,t,s,r){this.name=e,this.version=t,this.os=s,this.bot=r,this.type="bot-device"},o=function(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null},l=function(){this.type="react-native",this.name="react-native",this.version=null,this.os=null},d=/(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,h=3,c=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/EdgA?\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["pie",/^Microsoft Pocket Internet Explorer\/(\d+\.\d+)$/],["pie",/^Mozilla\/\d\.\d+\s\(compatible;\s(?:MSP?IE|MSInternet Explorer) (\d+\.\d+);.*Windows CE.*\)$/],["netfront",/^Mozilla\/\d\.\d+.*NetFront\/(\d.\d)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;
1\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FB[AS]V\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["curl",/^curl\/([0-9\.]+)$/],["searchbot",/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/]],u=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Windows CE",/Windows CE|WinCE|Microsoft Pocket Internet Explorer/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]];function p(e){return e?g(e):"undefined"===typeof document&&"undefined"!==typeof navigator&&"ReactNative"===navigator.product?new l:"undefined"!==typeof navigator?g(navigator.userAgent):"undefined"!==typeof process&&process.version?new i(process.version.slice(1)):null}function m(e){return""!==e&&c.reduce((function(t,s){var r=s[0],n=s[1];if(t)return t;var i=n.exec(e);return!!i&&[r,i]}),!1)}function g(e){var t=m(e);if(!t)return null;var s=t[0],i=t[1];if("searchbot"===s)return new o;var l=i[1]&&i[1].split(".").join("_").split("_").slice(0,3);l?l.length<h&&(l=r(r([],l,!0),function(e){for(var t=[],s=0;s<e;s++)t.push("0");return t}(h-l.length),!0)):l=[];var c=l.join("."),p=function(e){for(var t=0,s=u.length;t<s;t++){var r=u[t],n=r[0];if(r[1].exec(e))return n}return null}(e),g=d.exec(e);return g&&g[1]?new a(s,c,p,g[1]):new n(s,c,p)}}}]); 2//# sourceMappingURL=918.9402318c.chunk.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.