(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4228],{91637:function(e,t,n){"use strict";var r,a=n(67294);function l(){return(l=Object.assign||function(e){for(var t=1;t{let{type:t=i.v.h3,primaryTitle:n,secondaryTitle:a,variant:u,branding:d,theme:m=c._.Light,children:h}=e,{ref:p,inView:g}=(0,o.YD)({threshold:0,triggerOnce:!0});return(0,r.jsxs)("div",{ref:p,className:"".concat(l()["header-block"]," text-center ").concat(m===c._.Dark?l().light:""," ").concat(g?l()["is-inview"]:""," ").concat(u||""),children:[(0,r.jsx)("div",{className:l().break,children:(0,r.jsx)("hr",{className:"mt-0 mb-3 rounded-3 ".concat(d?(0,s.cb)(d):"")})}),a&&(0,r.jsx)("span",{className:"w-100 d-block h4 fw-normal mb-2",dangerouslySetInnerHTML:{__html:a}}),n&&(0,s.Qf)(t,n),h]})}},91416:function(e,t,n){"use strict";n.d(t,{Z:function(){return r.Z}});var r=n(79858)},47650:function(e,t,n){"use strict";var r=n(85893);n(67294);var a=n(9008),l=n.n(a);t.Z=e=>{let{children:t}=e;return(0,r.jsx)(l(),{children:t})}},74377:function(e,t,n){"use strict";var r,a;n.d(t,{Z:function(){return r}}),(a=r||(r={}))[a.Normal=0]="Normal",a[a.Light=1]="Light",a[a.Dark=2]="Dark"},41900:function(e,t,n){"use strict";var r,a;n.d(t,{_:function(){return r}}),(a=r||(r={}))[a.Light=1]="Light",a[a.Dark=2]="Dark"},24268:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return X}});var r,a,l,s,c,i,o=n(85893),u=n(67294),d=n(70466),m=n(47650),h=n(94184),p=n.n(h),g=n(98234),f=n.n(g),y=n(91637);function x(){return(x=Object.assign||function(e){for(var t=1;t{let{selectedItem:t,selectedType:n,isFocused:r,isLoading:a,isValid:l,totalMileage:s,totalDistance:c,handleItemSave:i,handleCancelEdit:d,handleResetCalculator:m}=e,{register:h,errors:g,handleSubmit:x}=(0,w.cI)(),[j,T]=(0,u.useState)("innit"),[M,O]=(0,u.useState)(1),[S,P]=(0,u.useState)((0,k.mK)(_.f.Weekly)),F=(0,u.useRef)(null),L=(0,u.useRef)(null),R=(0,u.useRef)(null),J=(0,u.useRef)(null),z=(0,u.useRef)(null),q=(0,u.useRef)(null),D=(0,u.useRef)(null),A=(0,u.useRef)(null),W=(0,u.useRef)(null),Z=(0,u.useRef)(null),B=(0,u.useRef)(null),V=(0,u.useRef)(null),H=()=>{F.current.value="0",L.current.value="",R.current.value="",J.current.checked=!0,z.current.value="0",q.current.checked=!0,D.current.checked=!1,A.current.checked=!1,W.current.checked=!0,Z.current.checked=!1,B.current.checked=!1,V.current.value="1",O(1),P((0,k.mK)(_.f.Weekly))},Y=e=>{let t=0;O(t="+"===e?M+1:M-1<1?1:M-1),V.current.value=t.toString()};return(0,u.useEffect)(()=>{t&&(L.current.focus(),F.current.value=t.yearlyMileage.toString(),L.current.value=t.startPostcode,R.current.value=t.endPostcode,J.current.checked=t.returnJourney,z.current.value=t.totalDistance.toString(),q.current.checked=t.journeyType===N.N.Work,D.current.checked=t.journeyType===N.N.Leisure,A.current.checked=t.journeyType===N.N.Other,W.current.checked=t.journeyFrequency===_.f.Weekly,Z.current.checked=t.journeyFrequency===_.f.Monthly,B.current.checked=t.journeyFrequency===_.f.Yearly,V.current.value=t.tripCount.toString(),O(t.tripCount),P((0,k.mK)(t.journeyFrequency)))},[t]),(0,u.useEffect)(()=>{n&&(q.current.checked=n===N.N.Work,D.current.checked=n===N.N.Leisure,A.current.checked=n===N.N.Other)},[n]),(0,u.useEffect)(()=>{a||(T("complete"),F.current.focus())},[a]),(0,u.useEffect)(()=>{Object.keys(g).length&&(0,I.sz)("MileageCalculator","Errors",(0,C.vt)(g))},[g]),(0,o.jsx)("div",{className:"".concat(f()["mileage-calc"]," ").concat(r?f()["is-editing"]:""," p-3"),children:(0,o.jsxs)("form",{onSubmit:x(e=>{T("calculating"),i(e),(0,I.sz)("MileageCalc","Click","Calculate"),t&&H()}),children:[(0,o.jsx)("div",{className:"mb-2",children:l?(0,o.jsx)("span",{className:"d-block text-white",children:"Enter Journey Postcodes"}):(0,o.jsx)("span",{className:"d-block text-danger",children:"There was an issue with the journey postcodes."})}),(0,o.jsxs)("div",{className:"mb-3",children:[(0,o.jsx)("input",{ref:e=>{L.current=e,h(e,{required:!0,pattern:/[A-Z]{1,2}[0-9]{1,2} ?[0-9][A-Z]{2}/i})},type:"text",id:"startPostcode",name:"startPostcode",className:"form-control text-uppercase ".concat(g.startPostcode||!l?"is-invalid":""," rounded-0 mb-2"),placeholder:"Starting Point"}),(0,o.jsx)("input",{ref:e=>{R.current=e,h(e,{required:!0,pattern:/[A-Z]{1,2}[0-9]{1,2} ?[0-9][A-Z]{2}/i})},type:"text",id:"endPostcode",name:"endPostcode",className:"form-control text-uppercase ".concat(g.endPostcode||!l?"is-invalid":""," rounded-0"),placeholder:"Destination"})]}),(0,o.jsxs)("div",{className:"d-flex flex-nowrap justify-content-between align-items-center mb-3",children:[(0,o.jsxs)("label",{htmlFor:"returnJourney",className:"d-flex flex-nowrap justify-content-start align-items-center mb-0",children:[(0,o.jsx)("input",{ref:e=>{h(e),J.current=e},type:"checkbox",id:"returnJourney",name:"returnJourney",className:"d-inline me-2",defaultChecked:!0})," ",(0,o.jsx)("span",{className:"d-inline text-white",children:"Return Journey"})]}),(0,o.jsx)("input",{ref:e=>{h(e),z.current=e},type:"hidden",name:"totalDistance",value:c}),(0,o.jsxs)("span",{className:"text-white",children:[(0,o.jsx)("strong",{className:"text-white",children:(0,E.formatNumber)(c)})," Mile Journey"]})]}),(0,o.jsxs)("div",{className:"mb-3",children:[(0,o.jsx)("span",{className:"d-block mb-2 text-white",children:"Journey Type"}),(0,o.jsxs)("div",{className:"d-flex flex-nowrap justify-content-center align-items-center",role:"group","aria-label":"journeyType",children:[(0,o.jsxs)("label",{htmlFor:"work",className:p()("w-25","btn","btn-fluid","flex-grow-1","px-0","me-2","mb-0",f().button,f()["button--radio"]),children:[(0,o.jsx)("input",{ref:e=>{h(e),q.current=e},type:"radio",id:"work",name:"journeyType",value:N.N.Work}),(0,o.jsx)("span",{children:"Work"})]}),(0,o.jsxs)("label",{htmlFor:"leisure",className:p()("w-25","btn","btn-fluid","flex-grow-1","px-0","me-2","mb-0",f().button,f()["button--radio"]),children:[(0,o.jsx)("input",{ref:e=>{h(e),D.current=e},type:"radio",id:"leisure",name:"journeyType",value:N.N.Leisure}),(0,o.jsx)("span",{children:"Leisure"})]}),(0,o.jsxs)("label",{htmlFor:"home",className:p()("w-25","btn","btn-fluid","flex-grow-1","px-0","me-2","mb-0",f().button,f()["button--radio"]),children:[(0,o.jsx)("input",{ref:e=>{h(e),A.current=e},type:"radio",id:"home",name:"journeyType",value:N.N.Other}),(0,o.jsx)("span",{children:"Other"})]}),(0,o.jsx)("button",{type:"button",className:"w-25 ".concat(f().button," ").concat(f()["button--clear"]," btn btn-fluid flex-grow-1"),onClick:()=>{q.current.checked=!0,D.current.checked=!1,A.current.checked=!1},children:(0,o.jsx)("span",{children:"Clear"})})]})]}),(0,o.jsxs)("div",{className:"mb-3",children:[(0,o.jsx)("span",{className:"d-block mb-2 text-white",children:"Journey Frequency"}),(0,o.jsxs)("div",{className:"d-flex flex-nowrap justify-content-center align-items-center",role:"group","aria-label":"journeyFrequency",children:[(0,o.jsxs)("label",{htmlFor:"weekly",className:p()("w-25","btn","btn-fluid","flex-grow-1","px-0","me-2","mb-0",f().button,f()["button--radio"]),children:[(0,o.jsx)("input",{ref:e=>{h(e),W.current=e},type:"radio",id:"weekly",name:"journeyFrequency",value:_.f.Weekly,defaultChecked:!0,onClick:e=>P((0,k.mK)(parseInt(e.currentTarget.value)))}),(0,o.jsx)("span",{children:"Weekly"})]}),(0,o.jsxs)("label",{htmlFor:"monthly",className:p()("w-25","btn","btn-fluid","flex-grow-1","px-0","me-2","mb-0",f().button,f()["button--radio"]),children:[(0,o.jsx)("input",{ref:e=>{h(e),Z.current=e},type:"radio",id:"monthly",name:"journeyFrequency",value:_.f.Monthly,onClick:e=>P((0,k.mK)(parseInt(e.currentTarget.value)))}),(0,o.jsx)("span",{children:"Monthly"})]}),(0,o.jsxs)("label",{htmlFor:"yearly",className:p()("w-25","btn","btn-fluid","flex-grow-1","px-0","me-2","mb-0",f().button,f()["button--radio"]),children:[(0,o.jsx)("input",{ref:e=>{h(e),B.current=e},type:"radio",id:"yearly",name:"journeyFrequency",value:_.f.Yearly,onClick:e=>P((0,k.mK)(parseInt(e.currentTarget.value)))}),(0,o.jsx)("span",{children:"Yearly"})]}),(0,o.jsx)("button",{type:"button",className:"w-25 ".concat(f().button," ").concat(f()["button--clear"]," btn btn-fluid flex-grow-1"),onClick:()=>{W.current.checked=!0,Z.current.checked=!1,B.current.checked=!1},children:(0,o.jsx)("span",{children:"Clear"})})]})]}),(0,o.jsxs)("div",{className:"mb-3",children:[(0,o.jsxs)("span",{className:"d-block mb-2 text-white",children:["Times Taken Per ",S]}),(0,o.jsx)("input",{ref:e=>{h(e),V.current=e},type:"hidden",name:"tripCount",value:M}),(0,o.jsxs)("div",{className:"d-flex flex-nowrap justify-content-center align-items-center",role:"group","aria-label":"journeyType",children:[(0,o.jsxs)("button",{type:"button",className:"w-25 btn btn-primary btn-fluid flex-grow-1 me-2 mb-0",onClick:()=>Y("+"),children:[(0,o.jsx)("span",{className:"sr-only",children:"Add Trip"}),(0,o.jsx)(b,{className:"fill-white",width:10,height:10})]}),(0,o.jsxs)("button",{type:"button",className:"w-25 btn btn-primary btn-fluid flex-grow-1 me-2 mb-0",onClick:()=>Y("-"),disabled:1===M,children:[(0,o.jsx)("span",{className:"sr-only",children:"Remove Trip"}),(0,o.jsx)(v,{className:"fill-white",width:10,height:10})]}),(0,o.jsxs)("strong",{className:"w-25 btn btn-light btn-fluid bg-transparent text-white flex-grow-1 border-0 me-2 mb-0",children:["x",M]}),(0,o.jsx)("button",{type:"button",className:"w-25 ".concat(f().button," ").concat(f()["button--clear"]," btn btn-fluid flex-grow-1"),onClick:()=>{V.current.value="1",O(1)},children:(0,o.jsx)("span",{children:"Clear"})})]})]}),(0,o.jsxs)("div",{className:"mb-3",children:[(0,o.jsx)("label",{htmlFor:"mileage",className:"text-white p-0",children:"Estimated Yearly Mileage"}),(0,o.jsxs)("div",{className:"input-group h4 mb-3",children:[(0,o.jsx)("input",{ref:e=>{h(e),F.current=e},type:"text",id:"yearlyMileage",name:"yearlyMileage",className:"form-control bg-ink text-white text-normal rounded-0 border-0 ".concat(f()["yearly-mileage"]),"aria-label":"Miles per year","aria-describedby":"mileage-label",value:(0,E.formatNumber)(s),readOnly:!0}),(0,o.jsx)("span",{className:"input-group-text bg-ink text-white border-0",id:"mileage-label",children:"Miles per year"})]})]}),(0,o.jsxs)("div",{className:"d-flex flex-nowrap mt-4 mb-0",children:[(0,o.jsx)("button",{type:"submit",className:p()("btn","btn-warning","btn-fluid","flex-grow-1","w-50","me-3","px-0",f().button,{["".concat(f()["is-calculating"])]:"calculating"==j}),children:"calculating"==j?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(y.Z,{width:"10",height:"10",className:"spin-me fill-white me-1"})," Calculating"]}):t?"Save Edit":"Calculate Journey"}),t&&(0,o.jsx)("button",{type:"button",className:p()("w-50","btn","btn-light","btn-fluid","flex-grow-1","px-0",f().button),onClick:()=>{d(),H()},children:"Cancel Edit"}),!t&&(0,o.jsx)("button",{type:"button",className:p()("w-50","btn","btn-light","btn-fluid","flex-grow-1","px-0",f().button),onClick:()=>{H(),m()},children:"Reset"})]})]})})},M=n(19872),O=n.n(M);function S(){return(S=Object.assign||function(e){for(var t=1;t{let{type:t,selectedItem:n,items:r,onAdd:a,onEdit:l,onRemove:s}=e,[c,i]=(0,u.useState)(0);(0,u.useEffect)(()=>{let e=0;r.map(t=>{e+=t.yearlyMileage}),i(e)},[r]);let d=e=>{l&&l(t,e)},m=e=>{s&&s(t,e)};return(0,o.jsx)("div",{className:"".concat(O()["mileage-table"]),children:(0,o.jsxs)("table",{children:[(0,o.jsx)("thead",{children:(0,o.jsxs)("tr",{children:[(0,o.jsxs)("td",{children:[(0,k.l8)(t)," Journeys"]}),(0,o.jsxs)("td",{children:["Total ",(0,o.jsx)("strong",{className:"d-none d-md-inline",children:"Mileage"})]}),(0,o.jsx)("td",{children:r.length>0?"Edit":"Add"}),r.length>0?(0,o.jsx)("td",{children:"Delete"}):null]})}),(0,o.jsx)("tbody",{children:r.length>0?r.map(e=>(0,o.jsxs)("tr",{className:p()({["".concat(O()["is-editing"])]:n&&(null==n?void 0:n.guid)===e.guid,["".concat(O()["is-deleting"])]:e.isRemoving}),children:[(0,o.jsxs)("td",{children:[e.startPostcode," ",(0,o.jsx)(L,{width:10,height:10,className:"fill-default"})," ",e.endPostcode]}),(0,o.jsxs)("td",{children:[(0,E.formatNumber)(e.yearlyMileage)," Miles"]}),(0,o.jsx)("td",{className:"text-center",children:(0,o.jsx)("button",{type:"button",className:"btn btn-text text-primary",onClick:()=>d(e.guid),"aria-label":"Edit Current Journey",children:(0,o.jsx)(J,{className:"fill-default-hover",width:10,height:10})})}),(0,o.jsx)("td",{className:"text-center",children:(0,o.jsx)("button",{type:"button",className:"btn btn-text px-1",onClick:()=>m(e.guid),"aria-label":"Delete Current Journey",children:(0,o.jsx)(P,{className:"fill-danger-hover",width:10,height:10})})})]},(0,D.x0)())):(0,o.jsxs)("tr",{children:[(0,o.jsxs)("td",{colSpan:2,children:["No ",(0,k.l8)(t).toLowerCase()," journeys added"]}),(0,o.jsx)("td",{className:"text-center",children:(0,o.jsxs)("button",{type:"button",className:"btn btn-text px-1",onClick:()=>{a&&a(t)},"aria-label":"Add New Journey",children:[(0,o.jsxs)("span",{className:"sr-only",children:["Add ",(0,k.l8)(t)," Journey"]}),(0,o.jsx)(q,{width:10,height:10})]})})]})}),r.length>0&&(0,o.jsx)("tfoot",{children:(0,o.jsx)("tr",{children:(0,o.jsxs)("td",{colSpan:4,children:["Total ",(0,k.l8)(t).toLowerCase()," journeys ",(0,o.jsxs)("strong",{children:[(0,E.formatNumber)(c)," miles"]})]})})})]})})},W=n(91416),Z=n(88722),B=n(59661),V=n(49106),H=n(88361);class Y{static getItems(){let e=null;return(e=JSON.parse(localStorage.getItem("mileage")))||(e=[]),e}static getItem(e){let t=this.getItems(),n=t.find(t=>t&&t.guid===e);return n}static updateItem(e){let t=!1,n=this.getItems(),r=n.find(t=>t&&t.guid===e.guid);return r&&(n[n.indexOf(r)]=e,t=this.persistItems(n)),t}static addItem(e){let t=!1,n=this.getItems();return e&&(n.push(e),t=this.persistItems(n)),t}static removeItem(e){let t=!1,n=this.getItems(),r=n.find(t=>t&&t.guid===e);return r&&(n[n.indexOf(r)]=null,t=this.persistItems(n)),t}static persistItems(e){return localStorage.setItem("mileage",JSON.stringify(e)),!0}static clear(){return!(0,H.TF)("mileage")&&(localStorage.removeItem("mileage"),!0)}}class K{static addItem(e){return e&&Y.addItem(e)?e:null}static updateItem(e){if(e){let t=Y.getItem(e.guid);if(t&&Y.updateItem(e))return e}return null}static removeItem(e){return Y.removeItem(e)}static getItems(){let e=Y.getItems();return e&&e.length>0&&(e=e.filter(e=>e)),e}static clear(){Y.clear()}}function X(){let e=(0,u.useRef)(null),t=(0,u.useRef)(null),n=(0,u.useRef)(null),r=(0,u.useRef)(null),[a,l]=(0,u.useState)(!0),[s,c]=(0,u.useState)(!1),[i,d]=(0,u.useState)(!0),[h,p]=(0,u.useState)([]),[g,f]=(0,u.useState)(null),[y,x]=(0,u.useState)(0),[b,j]=(0,u.useState)(0),[v,w]=(0,u.useState)(0),[k,I]=(0,u.useState)(N.N.Work),C=()=>{c(!1),d(!0),f(null),w(0),j(0)};(0,u.useEffect)(()=>{let e=0;h.map(t=>{e+=t.yearlyMileage}),x(e)},[h]),(0,u.useEffect)(()=>{if(g){M(N.N.Work),c(!0);let e=setTimeout(()=>{c(!1)},3500);return()=>clearTimeout(e)}},[g]),(0,u.useEffect)(()=>{p(K.getItems())},[]);let M=t=>{e.current.scrollIntoView({behavior:"smooth",block:"center"}),I(t)},O=(e,t)=>{let n=K.getItems().find(n=>n&&n.journeyType===e&&n.guid===t);n?(w(n.totalDistance),j(n.yearlyMileage),f(n)):(w(0),j(0),f(null))},S=(e,t)=>{let n=K.getItems().find(n=>n&&n.journeyType===e&&n.guid===t);n&&(n.isRemoving=!0,K.updateItem(n),p(K.getItems()),setTimeout(()=>{K.removeItem(n.guid),p(K.getItems())},1e3))};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(m.Z,{children:[(0,o.jsx)("title",{children:"Annual Mileage Calculator | Leasing Options"}),(0,o.jsx)("meta",{name:"description",content:"Use our handy tool to accurately calculate your annual mileage and remove the guesswork when completing your leasing application."}),(0,o.jsx)("meta",{name:"keywords",content:""}),(0,o.jsx)("link",{rel:"canonical",href:(0,B.en)("/mileage-calculator")})]}),(0,o.jsxs)("section",{className:"container-fluid pt-3 pb-4 py-sm-5",children:[(0,o.jsx)("div",{className:"row",children:(0,o.jsx)("div",{className:"col-24",children:(0,o.jsx)("h1",{className:"mb-5",children:"Annual Mileage Calculator"})})}),(0,o.jsxs)("div",{className:"row",children:[(0,o.jsx)("div",{className:"col-24 col-sm-12 col-md-13 offset-md-1 col-lg-15 col-xl-16 order-sm-2 d-flex flex-wrap justify-content-start align-items-start mb-3 mb-md-0",children:(0,o.jsx)(W.Z,{desktopEnabled:!1,children:'

Accurately Calculate Your Annual Car Mileage

One of the key factors you need to consider when looking to lease a new car is the anticipated number of miles you expect to travel on an annual basis.

Typically, the range varies between 5,000, 8,000, 10,000 and 12,000; but we are often asked how to estimate the mileage accurately.

So, we have created this easy-to-use tool that asks you some general questions about your driving routine, and, based on the answers you provide, gives you an accurate estimated annual mileage.

By using our handy tool, you don’t need to make any ‘wild guesses’ and it can help relieve anxiety around under or overestimating your mileage.

So why not give it a try and help make the process of leasing even easier? If you’re still deciding if leasing is right for you, check out our guide on the benefits of car leasing to get all the information you need, then take a look at our top car leasing deals.

'})}),(0,o.jsx)("div",{ref:e,className:"col-24 col-sm-12 col-md-10 col-lg-8 col-xl-7 order-sm-1 d-flex justify-content-start align-items-center",children:(0,o.jsx)(T,{selectedItem:g,selectedType:k,isFocused:s,isLoading:i,isValid:a,totalMileage:b,totalDistance:v,handleItemSave:e=>{d(!0),(0,V.Ew)(e.startPostcode)||(0,V.Ew)(e.endPostcode)||(0,V.Ew)(e.journeyFrequency)||(0,V.Ew)(e.journeyType)||(0,V.Ew)(e.tripCount)?(l(!1),d(!1)):(0,Z.kN)(null==e?void 0:e.startPostcode.replace(/\s/g,""),null==e?void 0:e.endPostcode.replace(/\s/g,"")).then(a=>{var s;if((null==a?void 0:a.Data)!==0&&(null==a?void 0:null===(s=a.Status)||void 0===s?void 0:s.Message)==="OK"){let s=Math.round((null==e?void 0:e.returnJourney)?2*a.Data:null==a?void 0:a.Data),c=0;switch(parseInt(e.journeyFrequency)){case _.f.Weekly:c=s*(52*e.tripCount);break;case _.f.Monthly:c=s*(12*e.tripCount);break;case _.f.Yearly:c=s*e.tripCount}l(!0),w(s),j(c),g?(K.updateItem({guid:g.guid,yearlyMileage:c,startPostcode:(0,V.BV)(e.startPostcode),endPostcode:(0,V.BV)(e.endPostcode),returnJourney:e.returnJourney,totalDistance:parseInt(e.totalDistance),journeyType:parseInt(e.journeyType),journeyFrequency:parseInt(e.journeyFrequency),tripCount:parseInt(e.tripCount)}),C()):K.addItem({guid:(0,V.x$)(),yearlyMileage:c,startPostcode:(0,V.BV)(e.startPostcode),endPostcode:(0,V.BV)(e.endPostcode),returnJourney:e.returnJourney,totalDistance:s,journeyType:parseInt(e.journeyType),journeyFrequency:parseInt(e.journeyFrequency),tripCount:parseInt(e.tripCount)}),p(K.getItems()),d(!1),parseInt(e.journeyType)===N.N.Work?t.current.scrollIntoView({behavior:"smooth",block:"center"}):parseInt(e.journeyType)===N.N.Leisure?n.current.scrollIntoView({behavior:"smooth",block:"center"}):parseInt(e.journeyType)===N.N.Other&&r.current.scrollIntoView({behavior:"smooth",block:"center"})}else d(!1),l(!1)})},handleCancelEdit:()=>C(),handleResetCalculator:C})})]}),(0,o.jsx)("div",{className:"row",children:(0,o.jsxs)("div",{className:"col-24 py-5",children:[(0,o.jsx)("h2",{className:"mb-3",children:"Saved Journeys"}),(0,o.jsxs)("p",{className:"mb-0",children:["Your saved journeys appear in the tables below. ",(0,o.jsx)("strong",{children:"The mileage is rounded to the nearest 1000 miles and only to be used a guide"}),"."]})]})}),y>0&&(0,o.jsxs)("div",{className:"row",children:[(0,o.jsx)("div",{className:"col-24 col-md-20 mt-md-4 d-flex justify-content-start align-items-center",children:(0,o.jsxs)("h3",{className:"mb-0",children:["Total Yearly Mileage: ",(0,o.jsxs)("span",{className:"text-primary",children:[(0,E.formatNumber)(1e3*Math.ceil(y/1e3))," miles"]})]})}),(0,o.jsx)("div",{className:"col-24 col-md-4 mt-3 mt-md-4 d-flex justify-content-start align-items-center",children:(0,o.jsx)("button",{type:"button",className:"btn btn-danger btn-block",onClick:()=>{K.clear(),p([]),f(null),C()},children:"Delete All Journeys"})}),(0,o.jsx)("div",{className:"col-24",children:(0,o.jsx)("hr",{className:"mb-4 mb-md-5"})})]}),(0,o.jsxs)("div",{className:"row",children:[(0,o.jsx)("div",{ref:t,className:"col-24 col-md-8 mb-4 mb-md-0",children:(0,o.jsx)(A,{type:N.N.Work,selectedItem:g,items:h.filter(e=>e.journeyType==N.N.Work),onAdd:M,onEdit:O,onRemove:S})}),(0,o.jsx)("div",{ref:n,className:"col-24 col-md-8 mb-4 mb-md-0",children:(0,o.jsx)(A,{type:N.N.Leisure,selectedItem:g,items:h.filter(e=>e.journeyType==N.N.Leisure),onAdd:M,onEdit:O,onRemove:S})}),(0,o.jsx)("div",{ref:r,className:"col-24 col-md-8",children:(0,o.jsx)(A,{type:N.N.Other,selectedItem:g,items:h.filter(e=>e.journeyType==N.N.Other),onAdd:M,onEdit:O,onRemove:S})})]})]})]})}X.layout=d.Z},64331:function(e){e.exports={"header-block":"header-block_header-block__yOxcd",light:"header-block_light__qhu2m",break:"header-block_break__4bx1l","is-inview":"header-block_is-inview__bzXGl"}},98234:function(e){e.exports={"mileage-calc":"calculator_mileage-calc__MMhUv","is-editing":"calculator_is-editing__xLoFs",blink:"calculator_blink__xYRRH","yearly-mileage":"calculator_yearly-mileage__avGdX",button:"calculator_button__w0IIL","is-calculating":"calculator_is-calculating__XTD31",gradient:"calculator_gradient__IqX9L","button--radio":"calculator_button--radio__Kj0Sd","button--clear":"calculator_button--clear__xgNtq"}},19872:function(e){e.exports={"mileage-table":"journeys_mileage-table__Iw4Bd","is-editing":"journeys_is-editing__cJat2","is-deleting":"journeys_is-deleting__NynbF","loading-stripes":"journeys_loading-stripes__LCMLt"}}},function(e){e.O(0,[8889,1520,8197,7435,1898,466,9858,9774,2888,179],function(){return e(e.s=75034)}),_N_E=e.O()}]);