1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._posthogChunkIds=e._posthogChunkIds||{},e._posthogChunkIds[n]="01a0eccc-6d18-7f21-bd4e-f7063f1d14cf")}catch(e){}}();;!function(){try { var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&((e._debugIds|| (e._debugIds={}))[n]="2fecae56-76e4-51ae-171c-c7c6526a0947")}catch(e){}}(); 2(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,463059,e=>{"use strict";var t=e.i(246349);e.s(["ChevronRight",()=>t.default])},605592,e=>{"use strict";var t=e.i(828595);let r=new Set(["ba.com","avios.com","iag.com","iaggbs.com","iairgroup.com","iagcargo.com","systango.com","iagloyalty.com"]),a=new Set(["systango.com","ba.com","iagloyalty.com","avios.com"]);e.s(["DISABLED_GRAY_BTN",0,"disabled:opacity-100 disabled:bg-gray-200 disabled:text-gray-400 disabled:shadow-none disabled:border-transparent","JOB_ROLE_OPTIONS",0,[{value:"Crew Member",label:"Crew Member"},{value:"Customer Support",label:"Customer Support"},{value:"Booking Agent",label:"Booking Agent"},{value:"Management",label:"Management"},{value:"Other",label:"Other"}],"OTP_LENGTH",0,6,"OTP_RESEND_SECONDS",0,60,"SIGN_UP_CURRENCY",0,"GBP","SIGN_UP_CURRENCY_OPTIONS",0,[{value:"GBP",label:"GBP"}],"isBaStaffEmail",0,function(e){let t=e.split("@")[1]?.toLowerCase();return!!t&&r.has(t)},"isFreeBronzeRegistration",0,function({checkoutUrl:e,selectedPlan:r}){if(e)return!1;let a=r?.trim().toLowerCase();return!a||t.BRONZE_PLAN_NAMES.has(a)},"requiresOtp",0,function(e){let t=e.split("@")[1]?.toLowerCase();return!!t&&a.has(t)}])},381308,13901,e=>{"use strict";var t=e.i(271645),r=e.i(662537),a=e.i(127907);let n=()=>void 0,s=new Promise(e=>{n=e});function i(){n(window.Chargebee??null)}function o(){console.error("[Chargebee] SDK script failed to load."),n(null)}let l=null;function c(e,t){let a=t instanceof Error?t.name:"Error",n=`Chargebee bootstrap failed during ${e}`,s=Error(n);s.name=a,s.stack=`${a}: ${n}`,(0,r.captureException)(s,{tags:{source:"chargebee",stage:e},fingerprint:["chargebee-bootstrap",e]})}async function d(){if(l)return l;let e=window.Chargebee??await new Promise(e=>{let t=setTimeout(()=>{console.error("[Chargebee] SDK did not load in time â is <ChargebeeScriptLoader> mounted on this page?"),e(null)},1e4);s.then(r=>{clearTimeout(t),e(r)})});if(!e)return null;try{l=e.getInstance()}catch{let t,r;try{t=await fetch(a.API_ROUTES.CHARGEBEE.CONFIG)}catch{return null}if(!t.ok)return null;try{r=await t.json()}catch(e){return c("config-parse",e),null}try{l=e.init({site:r.site,enableGTMTracking:!0,iframeOnly:!0})}catch(e){return c("sdk-init",e),null}}return l}function u(){return"u"<typeof document?null:document.getElementById("cb-container")}function m(){let e=u();e&&(e.style.backdropFilter="",e.style.background="",e.style.display="none")}async function p({userId:e,onClose:t}){let r=await d();return!!r&&(r.setPortalSession(async()=>{let t=await fetch(`${a.API_ROUTES.CHARGEBEE.PORTAL}?user_id=${e}`),r=await t.json();if(!t.ok)throw Error("Portal session failed");return r.data??r}),r.createChargebeePortal().open({close(){r.logout(),t?.()}}),!0)}e.s(["getChargebee",0,d,"markChargebeeSdkFailed",0,o,"markChargebeeSdkReady",0,i,"openChargebeeCheckout",0,function(e,t){function r(){window.removeEventListener("popstate",a)}function a(){r();try{e.closeAll()}catch(e){console.error("[Chargebee] closeAll() threw during back-navigation cleanup:",e)}finally{m()}}window.addEventListener("popstate",a),e.openCheckout({...t,loaded:()=>{let e;(e=u())&&(e.style.backdropFilter="blur(2px)"),t.loaded?.()},close:()=>{r(),m(),t.close?.()},success:e=>{r(),t.success?.(e)},error:e=>{r(),m(),t.error?.(e)}})},"openChargebeePortal",0,p],13901);var h=e.i(408234);let g="chargebee-js",f="https://js.chargebee.com/v2/chargebee.js",b=!1;e.s(["ChargebeeScriptLoader",0,function(){return(0,t.useEffect)(()=>
2{if((0,h.installChargebeeChunkErrorGuard)(),(document.getElementById(g)??document.querySelector(`script[src="${f}"]`))||b){window.Chargebee&&i();return}b=!0;let e=document.createElement("script");e.id=g,e.src=f,e.async=!0,e.addEventListener("load",()=>{i(),d()}),e.addEventListener("error",o),document.body.appendChild(e)},[]),null}],381308)},812362,e=>{"use strict";var t=e.i(843476),r=e.i(271645),a=e.i(522016),n=e.i(618566),s=e.i(463059),i=e.i(531278),o=e.i(814567),l=e.i(24472),c=e.i(608777),d=e.i(212203),u=e.i(13901),m=e.i(381308),p=e.i(792268),h=e.i(584521),g=e.i(890037),f=e.i(743155),b=e.i(769086),y=e.i(962183),x=e.i(605592);let N=["17-20","21-29","30-39","40-49","50-59","60-69","70+"],v=["Male","Female","Other","Prefer Not To Say"],j=["1-3","3-6","6+"],C=["Unlikely","Likely","Very Likely"],w=x.JOB_ROLE_OPTIONS.map(e=>e.value);function _(e){return e?e.charAt(0).toUpperCase()+e.slice(1).toLowerCase():""}function A({label:e,required:r,children:a}){return(0,t.jsx)("div",{className:"flex w-full flex-col gap-1",children:(0,t.jsxs)("label",{className:"flex w-full flex-col gap-1",children:[(0,t.jsxs)("span",{className:"text-sm text-gray-600 font-medium",children:[e,r&&(0,t.jsx)("span",{className:"text-error-600",children:"*"})]}),a]})})}function S({label:e,required:r,value:a,onChange:n,placeholder:s,maxLength:i,error:o}){return(0,t.jsxs)(A,{label:e,required:r,children:[(0,t.jsx)("input",{type:"text",value:a,onChange:e=>n(e.target.value),placeholder:s,maxLength:i,className:"h-10 w-full rounded-lg border border-gray-500 px-3.5 text-sm font-bold text-secondary-900 outline-none transition-colors focus:border-primary-900"}),o&&(0,t.jsx)("p",{className:"text-xs text-error-600",children:o})]})}function k({label:e,required:r,value:a,onChange:n,options:s,placeholder:i}){return(0,t.jsx)(A,{label:e,required:r,children:(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsxs)("select",{value:a,onChange:e=>n(e.target.value),className:"h-10 w-full appearance-none rounded-lg border border-gray-500 px-3.5 pr-8 text-sm font-bold text-secondary-900 outline-none transition-colors focus:border-primary-900",children:[(0,t.jsx)("option",{value:"",children:i}),s.map(e=>(0,t.jsx)("option",{value:e,children:e},e))]}),(0,t.jsx)("span",{className:"pointer-events-none absolute right-3 top-1/2 -translate-y-1/2 text-gray-500",children:(0,t.jsx)("svg",{width:"8",height:"5",viewBox:"0 0 8 5",fill:"none","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M1 1l3 3 3-3",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]})})}function E({selectedCode:e,onSelect:a}){let[n,s]=(0,r.useState)(!1),[o,l]=(0,r.useState)(""),c=(0,r.useRef)(null),d=(0,r.useRef)(null),{data:u,isLoading:m}=(0,g.useLocationsSWR)("british-airways",{isOpened:!0}),{data:p,isLoading:h}=(0,g.useLocationsSWR)("iberia-airways",{isOpened:!0}),f=m||h,x=(0,r.useMemo)(()=>{let e=new Map;for(let t of u??[])e.set(t.code,t);for(let t of p??[]){let r=e.get(t.code);if(r){let a=Array.from(new Set([...r.supportedAirlines??[],...t.supportedAirlines??[]]));e.set(t.code,{...r,supportedAirlines:a})}else e.set(t.code,t)}return Array.from(e.values())},[u,p]),N=(0,r.useMemo)(()=>x.map(y.fromLiveAirport),[x]),v=(0,r.useMemo)(()=>N.filter(e=>(0,y.matchesSearch)(e,o)),[N,o]),j=N.find(t=>t.value===e);return(0,r.useEffect)(()=>{function e(e){c.current?.contains(e.target)||s(!1)}return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]),(0,t.jsxs)("div",{className:"relative flex w-full flex-col gap-1",ref:c,children:[(0,t.jsxs)("label",{className:"text-sm text-gray-600 font-medium",children:["My Closest Airport",(0,t.jsx)("span",{className:"text-error-600",children:"*"})]}),(0,t.jsx)("button",{type:"button",onClick:function(){s(!0),l(""),setTimeout(()=>d.current?.focus(),0)},className:"flex h-10 w-full items-center rounded-lg border border-gray-500 px-3.5 text-left transition-colors hover:border-gray-400 focus:border-primary-900 focus:outline-none",children:j?(0,t.jsxs)("div",{className:"flex min-w-0 items-center gap-2 overflow-hidden",children:[(0,t.jsx)(b.default,{countryCode:j.countryCode,emoji:j.countryEmoji,size:16}),(0,t.jsx)("span",{className:"truncate text-sm font-bold text-secondary-900",children:j.cityName})]}):(0,t.jsx)("span",{className:"text-sm font-bold text-secondary-900",children:"Departure"})}),n&&(0,t.jsxs)("div",{className:"absolute top-full z-50 mt-1 w-full max-w-sm overflow-hidden rounded-lg border border-gray-200 bg-white shadow-lg",children:[(0,t.jsx)("div",{className:"border-b border-gray-100 px-3 py-2",children:(0,t.jsx)("input",{ref:d,type:"text",value:o,onChange:e=>l(e.target.value),placeholder:"Search airports...",className:"w-full bg-transparent text-sm outline-none placeholder:text-gray-400"})}),(0,t.jsxs)("div",{className:"max-h-64 overflow-y-auto",children:[f&&(0,t.jsxs)("div",{className:"flex items-center justify-center py-6 text-sm text-gray-500",children:[(0,t.jsx)(i.Loader2,{className:"mr-2 size-4 animate-spin","aria-hidden":"true"}),"Loading airportsâ¦"]}),!f&&0===v.length&&(0,t.jsx)("p",{className:"px-4 py-3 text-sm text-gray-500",children:"No airports found."}),v.map(r=>(0,t.jsx)("button",{type:"button",onClick:()=>{a(r.cityName,r.value),s(!1),l("")},className:`w-full px-4 py-2.5 text-left hover:bg-primary-50 ${r.value===e?"bg-primary-50":""}`,children:(0,t.jsx)(y.AirportRow,{item:r})},r.value))]})]})]})}e.s(["PersonalInfoContent",0,function(){let{userDetails:e,userId:g}=(0,o.useAuth)(),{displayTier:b}=(0,l.useAuth)(),y=!!e?.is_ba_staff,x=(0,n.useRouter)(),A=(0,p.useRefreshUserDetails)(g),[L,R]=(0,r.useState)({firstName:"",lastName:"",airportName:"",airportCode:"",ageBand:"",gender:"",approxFlights:"",travelAbroad:"",jobRole:""}),[O,B]=(0,r.useState)({}),[P,T]=(0,r.useState)(!1),[$,D]=(0,r.useState)("idle"),[F,I]=(0,r.useState)("");function U(e,t){R(r=>({...r,[e]:t})),("firstName"===e||"lastName"===e)&&B(t=>({...t,[e]:void 0})),D("idle")}async function G(e){let t;if(e.preventDefault(),t={},(!L.firstName||L.firstName.length<2)&&(t.firstName="First name must be at least 2 characters."),(!L.lastName||L.lastName.length<2)&&(t.lastName="Last name must be at least 2 characters."),B(t),0!==Object.keys(t).length||!g)return;T(!0),D("idle");let r=L.airportName.trim()?JSON.stringify({name:L.airportName.trim(),value:L.airportCode}):null;try{let e=await fetch(`/api/profile?user_id=${g}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({user:{first_name:L.firstName.trim(),last_name:L.lastName.trim(),airpot_city:r,age_band:L.ageBand||null,gender:L.gender||null,flights_taken_annually:L.approxFlights||null,travelling_abroad_in_next_12_months:L.travelAbroad||null,...y?{job_role:L.jobRole||null}:{}}})});if(!e.ok){let t=await e.json();throw Error(t.error??"Failed to save changes.")}(0,c.captureEvent)(d.default.PROFILE_CHANGED,{firstName:L.firstName||"N/A",lastName:L.lastName||"N/A",homeAirport:L.airportCode||"N/A",ageBand:L.ageBand||"N/A",gender:L.gender||"N/A",avgFlightsAnnual:L.approxFlights||"N/A",travelAbroadFuture:L.travelAbroad||"N/A",JobRole:L.jobRole||"N/A"}),A(),D("success"),I("Your profile has been updated successfully.")}catch(e){D("error"),I(e instanceof Error?e.message:"Failed to save changes.")}finally{T(!1)}}async function z(){g&&await (0,u.openChargebeePortal)({userId:g,onClose:()=>{(0,h.refreshUserDetailsWithBackoff)(g,()=>x.refresh())}})}return(0,r.useEffect)(()=>
2{if(!e)return;let t=function(e){if(!e)return{name:"",code:""};if("string"==typeof e)try{let t=JSON.parse(e);return{name:t?.name??"",code:t?.value??""}}catch{return{name:e,code:""}}return{name:"",code:""}}(e.address?.airpot_city);R({firstName:e.first_name??"",lastName:e.last_name??"",airportName:t.name,airportCode:t.code,ageBand:e.age_band??"",gender:e.gender??"",approxFlights:e.flights_taken_annually??"",travelAbroad:e.travelling_abroad_in_next_12_months??"",jobRole:e.job_role??""})},[e]),(0,t.jsxs)("div",{children:[(0,t.jsx)(m.ChargebeeScriptLoader,{}),(0,t.jsxs)("nav",{className:"mb-2 flex items-center gap-1.5 text-xs font-semibold text-secondary-900/60",children:[(0,t.jsx)(a.default,{href:"/my-account",className:"hover:text-primary-900",children:"Profile"}),(0,t.jsx)(s.ChevronRight,{className:"size-3","aria-hidden":"true"}),(0,t.jsx)("span",{className:"font-semibold text-secondary-900",children:"Personal Info"})]}),(0,t.jsxs)("div",{className:"flex justify-between items-center mb-4 md:mb-8 flex-col md:flex-row gap-4 md:gap-0",children:[(0,t.jsx)("h1",{className:" text-2xl font-bold text-secondary-900 w-full sm:w-auto text-left",children:"Personal Info"}),"bronze"!==b&&(0,t.jsx)(f.Button,{type:"button",hierarchy:"primary",color:"primary",size:"md",weight:"semibold",onClick:z,className:"bg-primary-900 px-10 hover:bg-primary-950",children:"Update Billing Address"})]}),(0,t.jsxs)("form",{onSubmit:G,noValidate:!0,className:"space-y-6",children:[(0,t.jsxs)("div",{className:"grid gap-4 sm:grid-cols-2",children:[(0,t.jsx)(S,{label:"First Name",required:!0,value:L.firstName,onChange:e=>{U("firstName",_(e).trimStart().replace(/[^A-Za-z]/gi,""))},maxLength:20,error:O.firstName}),(0,t.jsx)(S,{label:"Last Name",required:!0,value:L.lastName,onChange:e=>{U("lastName",_(e).trimStart().replace(/[^A-Za-z]/gi,""))},maxLength:20,error:O.lastName})]}),(0,t.jsxs)("div",{className:"grid gap-4 sm:grid-cols-2",children:[(0,t.jsx)(E,{selectedCode:L.airportCode,onSelect:(e,t)=>{U("airportName",e),U("airportCode",t)}}),(0,t.jsxs)("div",{className:"flex gap-4",children:[(0,t.jsx)("div",{className:"w-1/2",children:(0,t.jsx)(k,{label:"Age Band",required:!0,value:L.ageBand,onChange:e=>U("ageBand",e),options:N,placeholder:"Select"})}),(0,t.jsx)("div",{className:"w-1/2",children:(0,t.jsx)(k,{label:"Gender",required:!0,value:L.gender,onChange:e=>U("gender",e),options:v,placeholder:"Select"})})]})]}),(0,t.jsxs)("div",{className:"grid gap-4 sm:grid-cols-2",children:[(0,t.jsx)(k,{label:"Average number of return flights taken a year",required:!0,value:L.approxFlights,onChange:e=>U("approxFlights",e),options:j,placeholder:"Select"}),(0,t.jsx)(k,{label:"Do you plan to travel abroad in the next 12 months?",required:!0,value:L.travelAbroad,onChange:e=>U("travelAbroad",e),options:C,placeholder:"Select"})]}),y&&(0,t.jsx)("div",{className:"grid gap-4 sm:grid-cols-2",children:(0,t.jsx)(k,{label:"Job Role",value:L.jobRole,onChange:e=>U("jobRole",e),options:w,placeholder:"Select Role"})}),"idle"!==$&&(0,t.jsx)("p",{className:"success"===$?"text-sm font-medium text-success-700":"text-sm font-medium text-error-600",children:F}),(0,t.jsxs)(f.Button,{type:"submit",hierarchy:"primary",color:"primary",size:"md",weight:"semibold",disabled:P,className:"bg-primary-900 px-10 hover:bg-primary-950",children:[P&&(0,t.jsx)(i.Loader2,{className:"mr-2 size-4 animate-spin","aria-hidden":"true"}),"Save Changes"]})]})]})}])},890037,e=>{"use strict";var t=e.i(283599);let r=async e=>{let t=await fetch(e);if(!t.ok)throw Error(`Failed to load locations (${t.status})`);return t.json()};e.s(["useLocationsSWR",0,function(e="british-airways",{isOpened:a}={isOpened:!0},n){return(0,t.default)(a?`/api/locations?airline=${encodeURIComponent(e)}`:null,r,n)}])},962183,e=>{"use strict";var t=e.i(843476),r=e.i(769086);function a(e){return(e.label??e.cityName??e.city_name??e.name??"").trim()}function n(e){return[...e].sort((e,t)=>a(e).localeCompare(a(t),void 0,{sensitivity:"base"}))}function s(e){return"number"==typeof e&&Number.isFinite(e)?e:1/0}function i(e){return[...e].sort((e,t)=>s(e.topDestinationRanking??e.top_destination_ranking)-s(t.topDestinationRanking??t.top_destination_ranking))}e.s(["AirportRow",0,function({item:e,showCode:a=!0}){let n=(e.supportedAirlines??[]).map(e=>{let t;return{airline:e,asset:(t=e.toLowerCase()).includes("iberia")||"ib"===t?{src:"/images/icons/iberia-logo.svg",alt:"Iberia",className:"h-4 w-5 shrink-0 object-contain opacity-70"}:t.includes("british")||"ba"===t?{src:"/images/icons/ba-logo.png",alt:"British Airways",className:"h-4 w-5 shrink-0 object-contain opacity-70"}:null}}).filter(e=>null!==e.asset);return(0,t.jsxs)("div",{className:"flex w-full items-center gap-2.5",children:[(0,t.jsx)(r.default,{countryCode:e.countryCode,emoji:e.countryEmoji,size:24}),(0,t.jsxs)("span",{className:"min-w-0 flex-1 truncate text-left text-[14px] font-bold text-secondary-900",children:[e.cityName,a&&(0,t.jsxs)("span",{children:[" (",e.value,")"]})]}),n.length>0&&(0,t.jsx)("span",{className:"flex shrink-0 items-center gap-1.5 pl-1",children:n.map(({airline:e,asset:r})=>(0,t.jsx)("img",{src:r.src,alt:r.alt,className:r.className},e))})]})},"DEFAULT_LONDON_SOURCE_ITEM",0,{value:"LON",label:"London (LON)",cityName:"London",countryEmoji:"ð¬ð§",countryCode:"GB",isTopDestination:!0,topDestinationRanking:1},"filterToRoutedAirports",0,function(e,t){return t&&0!==Object.keys(t).length?e.filter(e=>{let r=e.value??e.code;return!!r&&Object.prototype.hasOwnProperty.call(t,r)}):e},"fromLiveAirport",0,function(e){return{value:e.code,label:`${e.city_name??e.name} (${e.code})`,searchValue:`${e.city_name??""} ${e.name} ${e.code} ${e.country_name??""}`,countryEmoji:e.country_emoji,countryCode:e.country_code,cityName:e.city_name??e.name,isTopDestination:!!e.is_top_destination,topDestinationRanking:e.top_destination_ranking,supp
2ortedAirlines:e.supportedAirlines,airportCodes:e.airports?.map(e=>e.code)}},"groupPopularOther",0,function(e,t,r){let a=n(e),s=i(a.filter(e=>e.isTopDestination)),o=a.filter(e=>!e.isTopDestination),l=[];return s.length&&l.push({label:t,items:s}),o.length&&l.push({label:r,items:o}),l},"matchesSearch",0,function(e,t){return!t||(e.searchValue??e.label).toLowerCase().includes(t.trim().toLowerCase())},"narrowSupportedAirlines",0,function(e,t,r,a){return r?e.map(e=>{let n=e.supportedAirlines;if(!n||n.length<2)return e;let s=n.filter(n=>{let s=t(n);return!s||0===Object.keys(s).length||("destination"===a?(s[r]??[]).includes(e.code):(s[e.code]??[]).includes(r))});return s.length===n.length||0===s.length?e:{...e,supportedAirlines:s}}):e},"sortAirportsByLabel",0,n,"sortByTopDestinationRanking",0,i,"toAirportItem",0,function(e){return{value:e.id,label:`${e.city??e.name} (${e.id})`,searchValue:`${e.city??""} ${e.name} ${e.id} ${e.country??""}`,countryEmoji:e.icon,countryCode:e.countryCode,cityName:e.city??e.name,isTopDestination:!!e.is_top_destination,topDestinationRanking:e.top_destination_ranking,supportedAirlines:e.supportedAirlines}}],962183)},769086,e=>{"use strict";var t=e.i(843476);let r=e.i(271645).default.memo(function({countryCode:e,emoji:r,size:a=24,shape:n="circle",className:s="",alt:i}){let o=e?`https://purecatamphetamine.github.io/country-flag-icons/3x2/${e.toUpperCase()}.svg`:null,l={width:a,height:a},c="rounded"===n?"rounded-sm":"rounded-full";return o?(0,t.jsx)("img",{src:o,alt:i??e??"",loading:"lazy",style:l,className:`shrink-0 ${c} object-cover ring-1 ring-gray-200 ${s}`}):r?(0,t.jsx)("span",{"aria-hidden":"true",style:{...l,fontSize:.8*a,lineHeight:1},className:`inline-flex shrink-0 items-center justify-center ${s}`,children:r}):(0,t.jsx)("span",{"aria-hidden":"true",style:l,className:`inline-block shrink-0 ${c} bg-gray-100 ${s}`})});e.s(["default",0,r])}]); 3 4//# debugId=2fecae56-76e4-51ae-171c-c7c6526a0947 5//# chunkId=01a0eccc-6d18-7f21-bd4e-f7063f1d14cf
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.