PageSourceSearch

https://www.which.co.uk/static/deliver/static/js/which-static-tool…ools-AnnualFuelCalculator.905e30c6.chunk.js

js which.co.uk collected 2026-09-24 07:23:10 UTC 20,157 bytes, 2 lines download raw bytes

1"use strict";(this.__LOADABLE_LOADED_CHUNKS__=this.__LOADABLE_LOADED_CHUNKS__||[]).push([["which-static-tools-build-tools-AnnualFuelCalculator"],{"../../node_modules/dom-helpers/esm/addClass.js"(e,t,r){function l(e,t){e.classList?e.classList.add(t):function(e,t){return e.classList?!!t&&e.classList.contains(t):-1!==(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")}(e,t)||("string"==typeof e.className?e.className=e.className+" "+t:e.setAttribute("class",(e.className&&e.className.baseVal||"")+" "+t))}r.d(t,{A:()=>l})},"../../node_modules/dom-helpers/esm/removeClass.js"(e,t,r){function l(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function o(e,t){e.classList?e.classList.remove(t):"string"==typeof e.className?e.className=l(e.className,t):e.setAttribute("class",l(e.className&&e.className.baseVal||"",t))}r.d(t,{A:()=>o})},"../static-tools/build/components/ControlledTextField/ControlledTextField.js"(e,t,r){r.d(t,{S:()=>s});var l=r("../../node_modules/react-hook-form/dist/index.esm.mjs"),o=r("../../node_modules/@which/seatbelt/src/index.ts"),a=r("../../node_modules/react/jsx-runtime.js");const n=["className","control","errorMsg","inputType","placeholder","label","name","required","showRequiredText","tooltip","validation"],s=e=>{let t=e.className,r=e.control,s=e.errorMsg,i=e.inputType,c=void 0===i?"text":i,u=e.placeholder,d=e.label,m=e.name,f=e.required,p=void 0===f||f,h=e.showRequiredText,b=void 0===h||h,x=e.tooltip,y=e.validation,g=function(e,t){if(null==e)return{};var r,l,o=function(e,t){if(null==e)return{};var r={};for(var l in e)if({}.hasOwnProperty.call(e,l)){if(-1!==t.indexOf(l))continue;r[l]=e[l]}return r}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(l=0;l<a.length;l++)r=a[l],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,n);const j="currency"===c?y||{required:p,pattern:/(?=.*?\d)(([1-9]\d{0,2}(,\d{3})*)|\d+)?(\.\d{1,2})?$/}:y||{required:p};return(0,a.jsx)(l.xI,{control:r,defaultValue:"",name:m,render:e=>{let r=e.field,l=r.onChange,n=r.onBlur,i=r.value,f=r.ref,h=e.fieldState.error;return(0,a.jsx)(o.zB,{className:t,label:d,labelFor:m,required:p,showRequiredText:b,tooltip:x,...h&&{errorMsg:s},children:"currency"===c?(0,a.jsx)(o.UG,{"aria-invalid":!!h,inputMode:"decimal",inputRef:f,name:m,onBlur:n,onChange:l,value:i,...g}):(0,a.jsx)(o.w_,{"aria-invalid":!!h,inputRef:f,name:m,onBlur:n,onChange:l,placeholder:u,type:c,value:i,...g})})},rules:j})}},"../static-tools/build/components/OnwardJourney/OnwardJourney.js"(e,t,r){r.d(t,{_:()=>f}),r("../../node_modules/react/index.js");var l=r("../../node_modules/@which/seatbelt/src/index.ts"),o=r("../static-tools/build/shared/utils/push-data-layer-click.js"),a=r("../../node_modules/@which/seatbelt/src/components/Icons/Navigational/ChevronRight.tsx"),n=r("../../node_modules/classnames/index.js"),s=r.n(n);const i={commercialToolCTA:"CommercialToolCTA_commercialToolCTA__bSIRu","commercialToolCTA--pink":"CommercialToolCTA_commercialToolCTA--pink__EMw7H",commercialToolCTAGrid:"CommercialToolCTA_commercialToolCTAGrid__0mvrj",commercialToolCTAContentWrapper:"CommercialToolCTA_commercialToolCTAContentWrapper__B8ops",commercialToolCTAButtonWrapper:"CommercialToolCTA_commercialToolCTAButtonWrapper__9Cq4N",commercialToolCTAImageWrapper:"CommercialToolCTA_commercialToolCTAImageWrapper__mmwpa"};var c=r("../../node_modules/react/jsx-runtime.js");const u=e=>{let t=e.image,r=e.overlineText,o=e.title,n=e.description,u=e.linkText,m=e.linkUrl,f=void 0===m?"":m,p=e.backgroundColour,h=e.buttonType,b=e.toolName,x=e.itemGroup;return(0,c.jsx)("aside",{"aria-label":`${r} action`,className:s()(i.commercialToolCTA,p&&i[`commercialToolCTA--${p}`]),"data-testid":"commercial-tool-cta",children:(0,c.jsxs)(l.xA,{className:i.commercialToolCTAGrid,children:[(0,c.jsxs)(l.Ei,{className:i.commercialToolCTAContentWrapper,columnStart:{medium:1,large:1},span:{medium:8,large:8},children:[(0,c.jsx)(l.DZ,{heading:o,headingTag:"h2",headingType:"large",overline:r}),(0,c.jsx)(l.Yx,{textStyle:"sb-text-body-default-regular",children:n}),"signUp"===h?(0,c.jsx)(l.XP,{href:f,onClick:()=>d(b,x,"Subscribe to Which?")}):(0,c.jsx)("div",{className:i.commercialToolCTAButtonWrapper,children:(0,c.jsxs)(l.vx,{appearance:"secondary",href:f,onClick:()=>d(b,x,u),children:[(0,c.jsx)(a.v,{}),u]})})]}),t&&(0,c.jsx)(l.Ei,{className:i.commercialToolCTAImageWrapper,columnStart:{medium:9,large:9},span:{medium:4,large:4},children:(0,c.jsx)(l.VI,{...t,aspectRatioMain:"one-to-one","data-testid":"commercial-cta-image",height:"285",src:t.src,width:"285"})})]})})},d=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return(0,o.M)({toolInfo:{name:e,category:t},itemText:`${r.toLowerCase()} (onward journey - commercial cta)`})},m=["onwardJourneys","aria-label","toolName","itemGroup"],f=e=>{let t=e.onwardJourneys,r=e["aria-label"],o=e.toolName,a=e.itemGroup,n=function(e,t){if(null==e)return{};var r,l,o=function(e,t){if(null==e)return{};var r={};for(var l in e)if({}.hasOwnProperty.call(e,l)){if(-1!==t.indexOf(l))continue;r[l]=e[l]}return r}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(l=0;l<a.length;l++)r=a[l],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,m);return t&&t.menuData&&t.menuData.length?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("nav",{"aria-label":r,className:"OnwardJourney_onwardJourney__p+Noe",...n,children:t.menuData.map(e=>{const t=p(e,o,a);return(0,c.jsx)(l.nq,{...t,className:"OnwardJourney_multiLinkBlock__jSmmr"})})}),t.commercialToolCTA&&t.commercialToolCTA.map((e,t)=>{let r=e.overline_text,l=e.title,n=e.background_brand_colour,s=e.description,i=e.image,d=e.link_text,m=e.link_url,f=e.button_type;return(0,c.jsx)(u,{backgroundColour:n?.colour,buttonType:f,description:s,image:i,itemGroup:a,linkText:d,linkUrl:m,overlineText:r,title:l,toolName:o},t)})]}):null},p=(e,t,r)=>({headerTag:"h2",title:e.label,titleLink:e.url,...e.url&&{titleLinkProps:{onClick:()=>(0,o.M)({toolInfo:{name:t,category:r},itemText:h(e.label)})}},...e.children&&{links:e.children.map(e=>({text:e.label,href:e.url||"",onClick:()=>(0,o.M)({toolInfo:{name:t,category:r},itemText:h(e.label)})}))},key:e.url}),h=e=>`${e.toLowerCase()} (onward journey)`},"../static-tools/build/components/Results/Results.js"(e,t,r){r.d(t,{n:()=>n});var l=r("../../node_modules/react/index.js");var o=r("../../node_modules/react/jsx-runtime.js");const a=["children","aria-label"],n=(0,l.forwardRef)((e,t)=>{let r=e.children,l=e["aria-label"],n=function(e,t){if(null==e)return{};var r,l,o=function(e,t){if(null==e)return{};var r={};for(var l in e)if({}.hasOwnProperty.call(e,l)){if(-1!==t.indexOf(l))continue;r[l]=e[l]}return r}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(l=0;l<a.length;l++)r=a[l],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,a);return(0,o.jsx)("section",{"aria-label":l,className:"Results_results__7sRSn",ref:t,...n,children:r})})},"../static-tools/build/components/ToolBody/ToolBody.js"(e,t,r){r.d(t,{F:()=>a});var l=r("../../node_modules/react/jsx-runtime.js");const o=["children","aria-labelledby"],a=e=>{let t=e.children,r=e["aria-labelledby"],a=function(e,t){if(null==e)return{};var r,l,o=function(e,t){if(null==e)return{};var r={};for(var l in e)if({}.hasOwnProperty.call(e,l)){if(-1!==t.indexOf(l))continue;r[l]=e[l]}return r}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(l=0;l<a.length;l++)r=a[l],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,o);return(0,l.jsx)("section",{"aria-labelledby":r,className:"ToolBody_toolBody__ml+So",...a,children:t})}},"../static-tools/build/components/ToolFrame/ToolFrame.js"(e,t,r){r.d(t,{U:()=>a});var l=r("../../node_modules/react/jsx-runtime.js");const o=["children"],a=e=>{let t=e.children,r=function(e,t){if(null==e)return{};var r,l,o=function(e,t){if(null==e)return{};var r={};for(var l in e)if({}.hasOwnProperty.call(e,l)){if(-1!==t.indexOf(l))continue;r[l]=e[l]}return r}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(l=0;l<a.length;l++)r=a[l],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,o);return(0,l.jsx)("aside",{className:"ToolFrame_toolFrame__j6N2n",...r,children:t})}},"../static-tools/build/components/ToolHeading/ToolHeading.js"(e,t,r){r.d(t,{L:()=>n});var l=r("../../node_modules/@which/seatbelt/src/index.ts");var o=r("../../node_modules/react/jsx-runtime.js");const a=["children"],n=e=>{let t=e.children,r=function(e,t){if(null==e)return{};var r,l,o=function(e,t){if(null==e)return{};var r={};for(var l in e)if({}.hasOwnProperty.call(e,l)){if(-1!==t.indexOf(l))continue;r[l]=e[l]}return r}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(l=0;l<a.length;l++)r=a[l],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,a);return(0,o.jsx)(l.Yx,{className:"ToolHeading_toolHeading__cK3t9",tag:"h2",textStyle:"sb-text-heading-medium",...r,children:t})}},"../static-tools/build/hooks/useTrackedButton.js"(e,t,r){r.d(t,{M:()=>o});var l=r("../static-tools/build/shared/utils/push-data-layer-click.js");const o=e=>{let t=e.trackingState,r=t.trackFirstInteraction,o=t.toolInfo,a=e.trackingName,n=e.onClick;return{onClick:e=>{(0,l.M)({toolInfo:o,itemText:`${a} (button)`}),r(),"function"==typeof n&&n(e)}}}},"../static-tools/build/hooks/useTrackedInput.js"(e,t,r){r.d(t,{I:()=>o});var l=r("../static-tools/build/shared/utils/push-data-layer-click.js");const o=e=>{let t=e.trackingState,r=t.trackFirstInteraction,o=t.toolInfo,a=e.onFocus;return{onFocus:e=>{(0,l.M)({toolInfo:o,itemText:`${e.target?.name} (${e.target?.type} field)`}),r(),"function"==typeof a&&a(e)}}}},"../static-tools/build/hooks/useTracking.js"(e,t,r){r.d(t,{z:()=>n});var l=r("../../node_modules/react/index.js"),o=r("../static-tools/build/shared/utils/push-data-layer-click.js");function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,l=Array(t);r<t;r++)l[r]=e[r];return l}const n=e=>{const t=(s=(0,l.useState)(!1),i=2,function(e){if(Array.isArray(e))return e}(s)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var l,o,a,n,s=[],i=!0,c=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;i=!1}else for(;
1!(i=(l=a.call(r)).done)&&(s.push(l.value),s.length!==t);i=!0);}catch(e){c=!0,o=e}finally{try{if(!i&&null!=r.return&&(n=r.return(),Object(n)!==n))return}finally{if(c)throw o}}return s}}(s,i)||function(e,t){if(e){if("string"==typeof e)return a(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?a(e,t):void 0}}(s,i)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),r=t[0],n=t[1];var s,i;return{trackFirstInteraction:(0,l.useCallback)(()=>{r||((0,o.M)({toolInfo:e,itemText:"tool use"}),n(!0))},[r,e]),toolInfo:e}}},"../static-tools/build/shared/utils/currency-formatter.js"(e,t,r){r.d(t,{y:()=>l});const l=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2;return Intl.NumberFormat("en-GB",{currency:"GBP",minimumFractionDigits:t,maximumFractionDigits:r,style:"currency"}).format(e)}},"../static-tools/build/shared/utils/push-data-layer-click.js"(e,t,r){r.d(t,{M:()=>o});var l=r("../shared/build/esm/utils/dynamic-ga4-datalayer-push.js");const o=e=>{let t=e.toolInfo,r=t.name,o=t.category,a=e.itemText;(0,l.N)({eventName:"click_tool",item_group:o,tool_name:r,item_text:a,event:"static_tool_click"})}},"../static-tools/build/tools/AnnualFuelCalculator/index.js"(e,t,r){r.r(t),r.d(t,{default:()=>T});var l=r("../../node_modules/react/index.js"),o=r("../../node_modules/react-hook-form/dist/index.esm.mjs"),a=r("../../node_modules/react-transition-group/esm/CSSTransition.js"),n=r("../../node_modules/@which/seatbelt/src/index.ts"),s=r("../../node_modules/@which/seatbelt/src/components/Icons/TransitionalPlusMinus/index.ts"),i=r("../static-tools/build/components/ControlledTextField/ControlledTextField.js"),c=r("../static-tools/build/components/OnwardJourney/OnwardJourney.js"),u=r("../static-tools/build/components/Results/Results.js"),d=r("../static-tools/build/components/ToolBody/ToolBody.js"),m=r("../static-tools/build/components/ToolFrame/ToolFrame.js"),f=r("../static-tools/build/components/ToolHeading/ToolHeading.js"),p=r("../static-tools/build/hooks/useTracking.js"),h=r("../static-tools/build/hooks/useTrackedInput.js"),b=r("../static-tools/build/hooks/useTrackedButton.js"),x=r("../static-tools/build/shared/utils/currency-formatter.js");const y={formControlledTextField:"AnnualFuelCalculator_formControlledTextField__rTVE0",formField:"AnnualFuelCalculator_formField__GUFBJ",formFieldInput:"AnnualFuelCalculator_formFieldInput__7gyCx",formFieldSet:"AnnualFuelCalculator_formFieldSet__4Ueha",formFieldSetFlexible:"AnnualFuelCalculator_formFieldSetFlexible__Z0OJr",formLinkButton:"AnnualFuelCalculator_formLinkButton__wCLF5",resultsHeader:"AnnualFuelCalculator_resultsHeader__wD9EP",resultsMessage:"AnnualFuelCalculator_resultsMessage__Jt032",results:"AnnualFuelCalculator_results__i3c3+","results-wrapper":"AnnualFuelCalculator_results-wrapper__Ng4hV","results-wrapper-enter":"AnnualFuelCalculator_results-wrapper-enter__bJ6Bb","results-wrapper-enter-active":"AnnualFuelCalculator_results-wrapper-enter-active__qdPKA","results-wrapper-enter-done":"AnnualFuelCalculator_results-wrapper-enter-done__6FBUi","results-wrapper-exit-done":"AnnualFuelCalculator_results-wrapper-exit-done__XMYBt",resultsSecondCar:"AnnualFuelCalculator_resultsSecondCar__wkm-I"};var g=r("../../node_modules/react/jsx-runtime.js");function j(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var l,o,a,n,s=[],i=!0,c=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;i=!1}else for(;!(i=(l=a.call(r)).done)&&(s.push(l.value),s.length!==t);i=!0);}catch(e){c=!0,o=e}finally{try{if(!i&&null!=r.return&&(n=r.return(),Object(n)!==n))return}finally{if(c)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return _(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_(e,t):void 0}}
1(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,l=Array(t);r<t;r++)l[r]=e[r];return l}const T=e=>{let t=e.onwardJourneys;const r=j((0,l.useState)(!1),2),_=r[0],T=r[1],w=j((0,l.useState)(0),2),A=w[0],F=w[1],S=j((0,l.useState)(0),2),O=S[0],N=S[1],k=(0,l.useRef)(null),M=(0,o.mN)({defaultValues:v,mode:"onBlur"}),P=M.control,I=M.handleSubmit,B=(0,p.z)({name:"Annual fuel cost calculator",category:"Cars"}),L=(0,h.I)({trackingState:B}),E=(0,b.M)({trackingState:B,trackingName:_?"collapseSecondCar":"expandSecondCar",onClick:()=>T(!_)}),G=(0,b.M)({trackingState:B,trackingName:"calculate"});(0,l.useEffect)(()=>{A&&k.current?.focus()},[A]);const R={required:!0,pattern:/^\-?[0-9]+(?:\.[0-9]{1,2})?$/},J=A-O,$=J<0?(0,g.jsxs)(g.Fragment,{children:["The first car provides the better value for money when it comes to fuel consumption, it is"," ",(0,x.y)(-J)," cheaper per year to run."]}):J>0?(0,g.jsxs)(g.Fragment,{children:["The second car provides the better value for money when it comes to fuel consumption, it is"," ",(0,x.y)(J)," cheaper per year to run."]}):(0,g.jsx)(g.Fragment,{children:"Neither car provides better value for money when it comes to fuel consumption, neither is cheaper per year to run."});return(0,g.jsxs)(m.U,{children:[(0,g.jsxs)(d.F,{"aria-labelledby":"annual-fuel-cost-calculator-heading",children:[(0,g.jsx)(f.L,{id:"annual-fuel-cost-calculator-heading",children:"Annual fuel cost calculator"}),(0,g.jsx)(n.Yx,{textStyle:"sb-text-body-default-regular",children:"Enter the fuel consumption details below to compare one or two cars to find out their respective running costs. Please enter whole numbers only."}),(0,g.jsxs)("form",{name:"Annual fuel cost calculator",onSubmit:I(e=>{const t=e.carOneFuelCost,r=e.carOneMilesPerGallon,l=e.carOnePredictedMileage,o=e.carTwoFuelCost,a=e.carTwoMilesPerGallon,n=e.carTwoPredictedMileage;F(0),F(C(t,r,l)),N(C(o,a,n))}),children:[(0,g.jsxs)("fieldset",{className:y.formFieldSet,children:[(0,g.jsx)("legend",{children:(0,g.jsx)(n.Yx,{textStyle:"sb-text-body-default-strong",children:"Car 1"})}),(0,g.jsx)(i.S,{className:y.formControlledTextField,control:P,errorMsg:"Please enter a valid fuel cost (pence per litre) for car 1",inputMode:"decimal",label:"Fuel cost (pence per litre)",name:"carOneFuelCost",validation:R,...L}),(0,g.jsx)(i.S,{className:y.formControlledTextField,control:P,errorMsg:"Please enter a valid miles per gallon for car 1",inputMode:"decimal",label:"Miles per gallon",name:"carOneMilesPerGallon",validation:R,...L}),(0,g.jsx)(i.S,{className:y.formControlledTextField,control:P,errorMsg:"Please enter a valid predicted annual mileage for car 1",inputMode:"decimal",label:"Predicted annual mileage",name:"carOnePredictedMileage",validation:R,...L})]}),(0,g.jsx)(n.z9,{"aria-controls":"field-set-car-two","aria-expanded":!!_,className:y.formLinkButton,icon:()=>(0,g.jsx)(s.U,{"aria-hidden":!0,"aria-label":void 0,height:16,toggle:_,width:16}),...E,children:_?"Remove second car from comparison":"Add another car for comparison"}),_&&(0,g.jsxs)("fieldset",{className:y.formFieldSet,id:"field-set-car-two",children:[(0,g.jsx)("legend",{children:(0,g.jsx)(n.Yx,{textStyle:"sb-text-body-default-strong",children:"Car 2"})}),(0,g.jsx)(i.S,{className:y.formControlledTextField,control:P,errorMsg:"Please enter a valid fuel cost (pence per litre) for car 2",inputMode:"decimal",label:"Fuel cost (pence per litre)",name:"carTwoFuelCost",validation:R,...L}),(0,g.jsx)(i.S,{className:y.formControlledTextField,control:P,errorMsg:"Please enter a valid miles per gallon for car 2",inputMode:"decimal",label:"Miles per gallon",name:"carTwoMilesPerGallon",validation:R,...L}),(0,g.jsx)(i.S,{className:y.formControlledTextField,control:P,errorMsg:"Please enter a valid predicted annual mileage for car 2",inputMode:"decimal",label:"Predicted annual mileage",name:"carTwoPredictedMileage",validation:R,...L})]}),(0,g.jsx)(n.$n,{type:"submit",...G,children:"Calculate costs"})]})]}),(0,g.jsx)(a.A,{classNames:"results-wrapper",in:A>
10,timeout:500,children:(0,g.jsx)(g.Fragment,{children:A>0&&(0,g.jsxs)("div",{className:y.results,children:[(0,g.jsxs)(u.n,{"aria-label":"Annual fuel cost calculator results",ref:k,tabIndex:-1,children:[(0,g.jsx)(n.Yx,{className:y.resultsHeader,tag:"h3",textStyle:"sb-text-body-default-strong",children:"Your results:"}),(0,g.jsxs)(n.Yx,{textStyle:"sb-text-heading-medium",children:["Annual fuel costs for the ",_?"1st":""," car:"," ",(0,x.y)(A)]}),_&&O>0&&(0,g.jsxs)(g.Fragment,{children:[(0,g.jsxs)(n.Yx,{className:y.resultsSecondCar,textStyle:"sb-text-heading-medium",children:["Annual fuel costs for the 2nd car: ",(0,x.y)(O)]}),(0,g.jsx)(n.Yx,{className:y.resetMargin,textStyle:"sb-text-body-default-regular",children:$})]})]}),(0,g.jsx)(c._,{"aria-label":"Annual fuel cost calculator related links",itemGroup:"Cars",onwardJourneys:t,toolName:"Annual fuel cost calculator"})]})})})]})},v={carOneFuelCost:"",carOneMilesPerGallon:"",carOnePredictedMileage:"",carTwoFuelCost:"",carTwoMilesPerGallon:"",carTwoPredictedMileage:""},C=(e,t,r)=>{const l=4.54609*Number(e);return Number(r)/Number(t)*l/100}}}]);
2//# sourceMappingURL=which-static-tools-build-tools-AnnualFuelCalculator.905e30c6.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.