1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2463],{3885:(e,t,r)=>{r.d(t,{y:()=>a});let a=["AED","AFN","ALL","AMD","AOA","ARS","AUD","AZN","BAM","BBD","BDT","BGN","BHD","BIF","BND","BOB","BRL","BSD","BTN","BWP","BYN","BZD","CAD","CDF","CHF","CLP","CNY","COP","CRC","CUP","CVE","CZK","DJF","DKK","DOP","DZD","EGP","ERN","ETB","EUR","FJD","GBP","GEL","GHS","GIP","GMD","GNF","GTQ","GYD","HKD","HNL","HTG","HUF","IDR","ILS","INR","IQD","IRR","ISK","JMD","JOD","JPY","KES","KGS","KHR","KMF","KPW","KRW","KWD","KZT","LAK","LBP","LKR","LRD","LSL","LYD","MAD","MDL","MGA","MKD","MMK","MNT","MOP","MRU","MUR","MVR","MWK","MXN","MYR","MZN","NAD","NGN","NIO","NOK","NPR","NZD","OMR","PAB","PEN","PGK","PHP","PKR","PLN","PYG","QAR","RON","RSD","RUB","RWF","SAR","SBD","SCR","SDG","SEK","SGD","SLE","SOS","SRD","SSP","STN","SYP","SZL","THB","TJS","TMT","TND","TOP","TRY","TTD","TWD","TZS","UAH","UGX","USD","UYU","UZS","VES","VND","VUV","WST","XAF","XCD","XOF","YER","ZAR","ZMW","ZWL"]},4474:(e,t,r)=>{r.d(t,{$:()=>d,r:()=>o});var a=r(95155);r(12115);var n=r(42442),s=r(18460),i=r(91337);let o=(0,s.F)("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-11 rounded-md px-6 has-[>svg]:px-4",icon:"size-10","icon-sm":"size-8","icon-lg":"size-11"}},defaultVariants:{variant:"default",size:"default"}});function d({className:e,variant:t,size:r,asChild:s=!1,...l}){let c=s?n.DX:"button";return(0,a.jsx)(c,{"data-slot":"button",className:(0,i.cn)(o({variant:t,size:r,className:e})),...l})}},8678:(e,t,r)=>{r.d(t,{bL:()=>y,zi:()=>j});var a=r(12115),n=r(70379),s=r(47527),i=r(68599),o=r(59322),d=r(63509),l=r(55897),c=r(95155),u=Object.defineProperty,h=(e,t)=>u(e,"name",{value:t,configurable:!0}),g="Switch",[m,p]=(0,i.A)(g),[f,x]=m(g);function b(e){let{__scopeSwitch:t,checked:r,children:n,defaultChecked:s,disabled:i,form:d,name:l,onCheckedChange:u,required:h,value:m="on",internal_do_not_use_render:p}=e,[x,b]=(0,o.i)({prop:r,defaultProp:s??!1,onChange:u,caller:g}),[v,y]=a.useState(null),[j,k]=a.useState(null),N=a.useRef(!1),[_,S]=a.useReducer(e=>e+1,0),C=!v||!!d||!!v.closest("form"),R={checked:x,setChecked:b,disabled:i,control:v,setControl:y,name:l,form:d,value:m,hasConsumerStoppedPropagationRef:N,userInteractionCount:_,onUserInteraction:S,required:h,defaultChecked:s,isFormControl:C,bubbleInput:j,setBubbleInput:k};return(0,c.jsx)(f,{scope:t,...R,children:w(p)?p(R):n})}h(b,"SwitchProvider");var v=a.forwardRef(h(function({__scopeSwitch:e,onClick:t,...r},i){let{control:o,form:d,value:u,disabled:g,checked:m,required:p,setControl:f,setChecked:b,hasConsumerStoppedPropagationRef:v,onUserInteraction:y,isFormControl:j,bubbleInput:k}=x("SwitchTrigger",e),w=(0,s.s)(i,f),_=a.useRef(m);return a.useEffect(()=>{let e=d?o?.ownerDocument.getElementById(d):o?.form;if(e instanceof HTMLFormElement){let t=h(()=>b(_.current),"reset");return e.addEventListener("reset",t),()=>e.removeEventListener("reset",t)}},[o,d,b]),(0,c.jsx)(l.sG.button,{type:"button",role:"switch","aria-checked":m,"aria-required":p,"data-state":N(m),"data-disabled":g?"":void 0,disabled:g,value:u,...r,ref:w,onClick:(0,n.mK)(t,e=>{y(),b(e=>!e),k&&j&&(v.current=e.isPropagationStopped(),v.current||e.stopPropagation())})})},"SwitchTrigger")),y=a.forwardRef(h(function(e,t){let{__scopeSwitch:r,name:a,checked:n,defaultChecked:s,required:i,disabled:o,value:d,onCheckedChange:l,form:u,...h}=e;return(0,c.jsx)(b,{__scopeSwitch:r,checked:n,defaultChecked:s,disabled:o,required:i,onCheckedChange:l,name:a,form:u,value:d,internal_do_not_use_render:({isFormControl:e})=>(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(v,{...h,ref:t,__scopeSwitch:r}),e&&(0,c.jsx)(k,{__scopeSwitch:r})]})})},"Switch")),j=a.forwardRef(h(function(e,t){let{__scopeSwitch:r,...a}=e,n=x("SwitchThumb",r);return(0,c.jsx)(l.sG.span,{"data-state":N(n.checked),"data-disabled":n.disabled?"":void 0,...a,ref:t})},"SwitchThumb")),k=a.forwardRef(h(function({__scopeSwitch:e,onClick:t,...r},i){let{control:o,hasConsumerStoppedPropagationRef:u,userInteractionCount:h,checked:g,defaultChecked:m,required:p,disabled:f,name:b,value:v,form:y,bubbleInput:j,setBubbleInput:k}=x("SwitchBubbleInput",e),w=(0,s.s)(i,k),N=(0,d.X)(o),_=a.useRef(!1),S=a.useRef(g),C=a.useRef(h);a.useEffect(()=>{if(!j)return;let e=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set,t=h!==C.current;C.current=h;let r=S.current!==g;S.current=g;let a=!(t&&u.current);if(r&&e){_.current=!t;let r=new Event("click",{bubbles:a});e.call(j,g),j.dispatchEvent(r),_.current=!1}},[j,g,u,h]);let R=a.useRef(g);return(0,c.jsx)(l.sG.input,{type:"checkbox","aria-hidden":!0,defaultChecked:m??R.current,required:p,disabled:f,name:b,value:v,form:y,...r,tabIndex:-1,ref:w,onClick:(0,n.mK)(t,e=>{_.current&&e.stopPropagation()}),style:{...r.style,...N,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})}
1,"SwitchBubbleInput"));function w(e){return"function"==typeof e}function N(e){return e?"checked":"unchecked"}h(w,"isFunction"),h(N,"getState")},9339:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});var a={callServer:function(){return s.callServer},createServerReference:function(){return o.createServerReference},findSourceMapURL:function(){return i.findSourceMapURL}};for(var n in a)Object.defineProperty(t,n,{enumerable:!0,get:a[n]});let s=r(77304),i=r(4060),o=r(77197)},11720:(e,t,r)=>{function a(e){return e>=new Date().toISOString().split("T")[0]}function n(e){if(!/^\d{4}-\d{2}-\d{2}$/.test(e))return!1;let[t,r,a]=e.split("-").map(Number);if(t<1900||t>2100)return!1;let n=new Date(Date.UTC(t,r-1,a));return n.getUTCFullYear()===t&&n.getUTCMonth()===r-1&&n.getUTCDate()===a}r.d(t,{A:()=>n,L:()=>a})},13386:(e,t,r)=>{r.d(t,{Y:()=>h});var a=r(95155),n=r(12115),s=r(56563),i=r(61878),o=r(94514),d=r(91337),l=r(4474),c=r(75421),u=r(62489);function h({aircraft:e,value:t,onSelect:r,placeholder:g="Select aircraft..."}){let[m,p]=n.useState(!1),[f,x]=n.useState(""),b=e.find(e=>e.id===t),v=n.useMemo(()=>{if(!f)return e.slice(0,20);let t=f.toLowerCase();return e.filter(e=>e.iata_code?.toLowerCase().includes(t)||e.icao_code?.toLowerCase().includes(t)||e.name.toLowerCase().includes(t)||e.manufacturer?.toLowerCase().includes(t)).slice(0,20)},[e,f]);return(0,a.jsxs)(u.AM,{open:m,onOpenChange:p,children:[(0,a.jsx)(u.Wv,{asChild:!0,children:(0,a.jsxs)(l.$,{variant:"outline",role:"combobox","aria-expanded":m,className:"w-full justify-between bg-transparent",children:[b?(0,a.jsx)("span",{className:"truncate",children:b.name}):(0,a.jsx)("span",{className:"text-muted-foreground",children:g}),(0,a.jsx)(s.A,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,a.jsx)(u.hl,{className:"w-[min(300px,90vw)] p-0",align:"start",children:(0,a.jsxs)(c.uB,{shouldFilter:!1,children:[(0,a.jsxs)("div",{className:"flex items-center border-b px-3",children:[(0,a.jsx)(i.A,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),(0,a.jsx)("input",{placeholder:"Search aircraft...",value:f,onChange:e=>x(e.target.value),className:"flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50"})]}),(0,a.jsxs)(c.oI,{children:[(0,a.jsx)(c.xL,{children:"No aircraft found."}),(0,a.jsx)(c.L$,{children:v.map(e=>(0,a.jsxs)(c.h_,{value:e.id,onSelect:()=>{r(e.id===t?null:e.id),p(!1)},children:[(0,a.jsx)(o.A,{className:(0,d.cn)("mr-2 h-4 w-4",t===e.id?"opacity-100":"opacity-0")}),(0,a.jsxs)("div",{className:"flex flex-col",children:[(0,a.jsx)("span",{children:e.name}),(0,a.jsx)("span",{className:"text-xs text-muted-foreground",children:e.manufacturer})]})]},e.id))})]})]})})]})}},13757:(e,t,r)=>{r.d(t,{J:()=>s});var a=r(95155),n=r(39658);function s({id:e,value:t,onChange:r,required:i=!1,className:o,min:d="1900-01-01",max:l="2100-12-31"}){return(0,a.jsx)(n.p,{id:e,type:"date",value:t,onChange:e=>r(e.target.value),required:i,min:d,max:l,className:`bg-white${o?` ${o}`:""}`})}},26518:(e,t,r)=>{r.d(t,{bq:()=>u,eb:()=>g,gC:()=>h,l6:()=>l,yv:()=>c});var a=r(95155);r(12115);var n=r(73051),s=r(66088),i=r(94514),o=r(9921),d=r(91337);function l({...e}){return(0,a.jsx)(n.bL,{"data-slot":"select",...e})}function c({...e}){return(0,a.jsx)(n.WT,{"data-slot":"select-value",...e})}function u({className:e,size:t="default",children:r,...i}){return(0,a.jsxs)(n.l9,{"data-slot":"select-trigger","data-size":t,className:(0,d.cn)("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-10 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...i,children:[r,(0,a.jsx)(n.In,{asChild:!0,children:(0,a.jsx)(s.A,{className:"size-4 opacity-50"})})]})}function h({className:e,children:t,position:r="popper",...s}){return(0,a.jsx)(n.ZL,{children:(0,a.jsxs)(n.UC,{"data-slot":"select-content",className:(0,d.cn)("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:sli
1de-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-[2100] max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md","popper"===r&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:r,...s,children:[(0,a.jsx)(m,{}),(0,a.jsx)(n.LM,{className:(0,d.cn)("p-1","popper"===r&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),(0,a.jsx)(p,{})]})})}function g({className:e,children:t,...r}){return(0,a.jsxs)(n.q7,{"data-slot":"select-item",className:(0,d.cn)("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...r,children:[(0,a.jsx)("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:(0,a.jsx)(n.VF,{children:(0,a.jsx)(i.A,{className:"size-4"})})}),(0,a.jsx)(n.p4,{children:t})]})}function m({className:e,...t}){return(0,a.jsx)(n.PP,{"data-slot":"select-scroll-up-button",className:(0,d.cn)("flex cursor-default items-center justify-center py-1",e),...t,children:(0,a.jsx)(o.A,{className:"size-4"})})}function p({className:e,...t}){return(0,a.jsx)(n.wn,{"data-slot":"select-scroll-down-button",className:(0,d.cn)("flex cursor-default items-center justify-center py-1",e),...t,children:(0,a.jsx)(s.A,{className:"size-4"})})}},39540:(e,t,r)=>{r.d(t,{T:()=>s});var a=r(95155);r(12115);var n=r(91337);function s({className:e,...t}){return(0,a.jsx)("textarea",{"data-slot":"textarea",className:(0,n.cn)("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),...t})}},44053:(e,t,r)=>{r.d(t,{_:()=>n});let a={22008:"One of the dates is not a real date. Please check it and try again.",22007:"One of the dates or times could not be read. Please check it and try again.",23505:"This looks like a duplicate of something you have already saved.",23503:"Something this refers to no longer exists. Try reloading the page.",23514:"Some of these details are outside the range we can save.",42501:"You do not have permission to change this.",PGRST301:"Your session has expired. Please sign in again."};function n(e,t){return(e?.code?a[e.code]:void 0)??t}},49452:(e,t,r)=>{function a(e){return`https://www.google.com/s2/favicons?domain=${e}&sz=64`}r.d(t,{Bz:()=>n,Dm:()=>a,kx:()=>i,md:()=>o,uo:()=>s,xg:()=>l});let n=[{id:"direct",name:"Direct",logo:null},{id:"booking",name:"Booking.com",logo:a("booking.com")},{id:"expedia",name:"Expedia",logo:a("expedia.com")},{id:"hotels_com",name:"Hotels.com",logo:a("hotels.com")},{id:"airbnb",name:"Airbnb",logo:a("airbnb.com")},{id:"agoda",name:"Agoda",logo:a("agoda.com")},{id:"kayak",name:"Kayak",logo:a("kayak.com")},{id:"other",name:"Other",logo:null}];function s(e){return e?n.find(t=>t.id===e)??null:null}let i=[{id:"direct",name:"Airline website",logo:null},{id:"google_flights",name:"Google Flights",logo:a("google.com")},{id:"skyscanner",name:"Skyscanner",logo:a("skyscanner.net")},{id:"kayak",name:"Kayak",logo:a("kayak.com")},{id:"expedia",name:"Expedia",logo:a("expedia.com")},{id:"edreams",name:"eDreams",logo:a("edreams.com")},{id:"opodo",name:"Opodo",logo:a("opodo.com")},{id:"kiwi",name:"Kiwi.com",logo:a("kiwi.com")},{id:"trip_com",name:"Trip.com",logo:a("trip.com")},{id:"bravofly",name:"Bravofly",logo:a("bravofly.com")},{id:"cheaptickets",name:"CheapTickets",logo:a("cheaptickets.com")},{id:"travel_agent",name:"Travel agent",logo:null},{id:"other",name:"Other",logo:null}];function o(e){return e?i.find(t=>
1t.id===e)??null:null}let d=new Set(["direct","other","travel_agent"]);function l(e){return!e||d.has(e)?null:e}},56787:(e,t,r)=>{r.d(t,{N7:()=>m,VB:()=>l,cv:()=>s});class a extends Error{constructor(e,t=400){super(e),this.expected=!0,this.name="ExpectedError",this.status=t}}let n=new Set([401,402,403,404,409,422,429]);function s(e){let t=e?.name??"",r=String(e?.message??e??"");return"ChunkLoadError"===t||/loading chunk \d+ failed/i.test(r)||/failed to fetch dynamically imported module/i.test(r)||/importing a module script failed/i.test(r)}let i=/^(NEXT_HTTP_ERROR_FALLBACK|NEXT_REDIRECT|NEXT_NOT_FOUND)\b/,o=new Set(["invalid_credentials","email_not_confirmed","user_already_exists","email_exists","weak_password","same_password","over_email_send_rate_limit","over_request_rate_limit","otp_expired","session_not_found","refresh_token_not_found"]),d=[/invalid login credentials/i,/email not confirmed/i,/already registered|already exists/i,/password should be at least|password is too weak/i,/rate limit|only request this after|too many requests/i,/invalid or expired|token has expired|link is invalid/i,/new password should be different/i];function l(e){let t=e?.code??"";if(o.has(t))return!0;let r=e?.status;if(null!=r&&n.has(r))return!0;let a=String(e?.message??e??"");return d.some(e=>e.test(a))}let c=/pass|secret|token|key|auth|cookie|session|card|cvc|cvv|iban|ssn/i,u=[[/\b(?:\d[ -]*?){13,19}\b/g,"[card]"],[/\bsk_(?:live|test)_[A-Za-z0-9]+/g,"[stripe-key]"],[/\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+/g,"[jwt]"],[/\bBearer\s+[A-Za-z0-9._~+/-]+=*/gi,"Bearer [redacted]"]],h=new Map,g=0;async function m(e,t){try{if(function(e){let t,r,n;return!!(e instanceof a||e?.expected===!0||(t=e?.name??"",r=String(e?.message??e??""),"AbortError"===t||"TypeError"===t&&/failed to fetch|networkerror|load failed/i.test(r)||/network ?error|the internet connection appears to be offline/i.test(r)||/object not found matching id:\d+, *methodname:/i.test(r)||s(e)))||(n=e?.digest,!!("string"==typeof n&&i.test(n)))}(e))return null;let r=e instanceof Error?e:Error(String(e)),n=function(e){if(!e)return"";for(let t of e.split("\n").slice(1))if(!/node_modules|webpack-internal|<anonymous>/.test(t))return t.trim().replace(/:\d+:\d+\)?$/,"").slice(0,200);return e.split("\n")[1]?.trim().slice(0,200)??""}(r.stack),o=window.location.pathname,d=function(e){let t=e.summary.replace(/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/gi,"<id>").replace(/"[^"]*"/g,'"<v>"').replace(/\d+/g,"<n>").slice(0,200),r=(e.route??"").replace(/\/[0-9a-f]{8}-[0-9a-f-]{20,}/gi,"/<id>").split("?")[0];var a=[e.surface,t,r,e.frame??""].join("|");let n=0x811c9dc5;for(let e=0;e<a.length;e++)n^=a.charCodeAt(e),n=Math.imul(n,0x1000193);return(n>>>0).toString(36)}({surface:t.surface,summary:t.summary,route:o,frame:n}),l=h.get(d)??0;if(l>=3||g>=20)return null;h.set(d,l+1),g++;let m={fingerprint:d,surface:t.surface,summary:t.summary.slice(0,300),severity:t.severity??"normal",context:function e(t,r=0){if(null==t)return t;if(r>6)return"[too deep]";if("string"==typeof t){let e=t.length>2e3?`${t.slice(0,2e3)}⦠[truncated]`:t;for(let[t,r]of u)e=e.replace(t,r);return e}if("number"==typeof t||"boolean"==typeof t)return t;if(Array.isArray(t)){let a=t.slice(0,50).map(t=>e(t,r+1));return t.length>50?[...a,`⦠${t.length-50} more`]:a}if("object"==typeof t){let a={};for(let[n,s]of Object.entries(t))a[n]=c.test(n)?"[redacted]":e(s,r+1);return a}return String(t)}({message:r.message,name:r.name,stack:r.stack?.split("\n").slice(0,20).join("\n"),digest:r.digest,route:o,url:window.location.href,userAgent:"u">typeof navigator?navigator.userAgent:void 0,viewport:`${window.innerWidth}x${window.innerHeight}`,online:"u">typeof navigator?navigator.onLine:void 0,build:"df3667f",occurredAt:new Date().toISOString(),input:t.input,...t.extra})},p=await fetch("/api/errors/report",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(m),keepalive:!0}),f=await p.json().catch(()=>null);return f?.reportId??null}catch{return null}}},60480:(e,t,r)=>{r.d(t,{U:()=>f,w:()=>b});
1var a=r(95155),n=r(12115),s=r(7236),i=r(79984),o=r(39658),d=r(79792),l=r(26518),c=r(90466),u=r(71275),h=r(6296),g=r(61878),m=r(3885),p=r(49452);function f(e,t){return{bookingId:null,flightIds:e?[e]:[],amount:"",currency:t,passengers:"",isAward:!1,pointsUsed:"",bookingReference:"",bookingPlatform:"",purchasedAt:"",enabled:!1}}function x(e,t){return Math.abs(new Date(e).getTime()-new Date(t).getTime())/864e5}function b({flightId:e,departureDate:t,userId:r,airports:f,value:v,onChange:y}){let[j,k]=(0,n.useState)([]),[w,N]=(0,n.useState)(!1),[_,S]=(0,n.useState)(null),C=(0,n.useRef)(!1),R=(0,n.useRef)(!0);(0,n.useEffect)(()=>()=>{R.current=!1},[]);let[A,D]=(0,n.useState)(!1),[T,L]=(0,n.useState)(""),P=e=>y({...v,...e}),M=e?v.flightIds.length-1:v.flightIds.length,E=M>0,B=(0,n.useMemo)(()=>{let e=new Map;for(let t of f)t.iata_code&&e.set(t.id,t.iata_code);return e},[f]);(0,n.useEffect)(()=>{if(!v.enabled||C.current)return;C.current=!0,N(!0);let t=(0,s.U)().from("flights").select("id, flight_number, departure_date, departure_airport_id, arrival_airport_id, booking_id").eq("user_id",r);e&&(t=t.neq("id",e)),t.order("departure_date",{ascending:!1}).then(({data:e,error:t})=>{R.current&&(t&&S(t.message),k(e??[]),N(!1))})},[v.enabled,r,e]);let O=e=>{let t=e.departure_airport_id?B.get(e.departure_airport_id)??"???":"???",r=e.arrival_airport_id?B.get(e.arrival_airport_id)??"???":"???";return`${t} â ${r}`},z=(0,n.useMemo)(()=>j.filter(e=>30>=x(e.departure_date,t)),[j,t]),I=(0,n.useMemo)(()=>{let e=T.trim().toLowerCase();return e?j.filter(t=>`${t.flight_number??""} ${t.departure_date} ${O(t)}`.toLowerCase().includes(e)).slice(0,50):j.slice(0,50)},[j,T,B]),F=j.filter(e=>v.flightIds.includes(e.id)),K=[...F,...(A?I:z).filter(e=>!v.flightIds.includes(e.id))],U=F.filter(e=>x(e.departure_date,t)>183);return(0,a.jsxs)(i.Zp,{children:[(0,a.jsx)(i.aR,{children:(0,a.jsxs)(i.ZB,{className:"flex items-center gap-2 text-lg",children:[(0,a.jsx)(u.A,{className:"h-5 w-5"}),"Price"]})}),(0,a.jsxs)(i.Wu,{className:"space-y-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,a.jsxs)("div",{className:"space-y-0.5",children:[(0,a.jsx)(d.J,{htmlFor:"booking-enabled",children:"Record what this cost"}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:"Enter the price once for the whole ticket, even when it covers several flights."})]}),(0,a.jsx)(c.d,{id:"booking-enabled",checked:v.enabled,onCheckedChange:e=>P({enabled:e})})]}),v.enabled&&(0,a.jsxs)("div",{className:"space-y-4 border-t pt-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,a.jsxs)("div",{className:"space-y-0.5",children:[(0,a.jsx)(d.J,{htmlFor:"booking-award",children:"Paid with points or miles"}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:"Counts as a flight that cost nothing, rather than one with no price recorded."})]}),(0,a.jsx)(c.d,{id:"booking-award",checked:v.isAward,onCheckedChange:e=>P({isAward:e})})]}),v.isAward?(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(d.J,{htmlFor:"booking-points",children:"Points used (optional)"}),(0,a.jsx)(o.p,{id:"booking-points",inputMode:"numeric",placeholder:"e.g., 60000",value:v.pointsUsed,onChange:e=>P({pointsUsed:e.target.value.replace(/[^\d]/g,"")})})]}):(0,a.jsxs)("div",{className:"grid gap-4 sm:grid-cols-[2fr,1fr]",children:[(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(d.J,{htmlFor:"booking-amount",children:"Total paid"}),(0,a.jsx)(o.p,{id:"booking-amount",inputMode:"decimal",placeholder:"e.g., 480.50",value:v.amount,onChange:e=>P({amount:e.target.value})})]}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(d.J,{children:"Currency"}),(0,a.jsxs)(l.l6,{value:v.currency,onValueChange:e=>P({currency:e}),children:[(0,a.jsx)(l.bq,{children:(0,a.jsx)(l.yv,{placeholder:"Currency"})}),(0,a.jsx)(l.gC,{className:"max-h-72",children:m.y.map(e=>(0,a.jsx)(l.eb,{value:e,children:e},e))})]})]})]}),(0,a.jsxs)("div",{className:"grid gap-4 sm:grid-cols-2",children:[(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(d.J,{htmlFor:"booking-passengers",children:"Passengers"}),(0,a.jsx)(o.p,{id:"booking-passengers",inputMode:"numeric",placeholder:"How many people the price covers",value:v.passengers,onChange:e=>P({passengers:e.target.value.replace(/[^\d]/g,"")})}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:"Leave blank if you are not sure â a guess would skew your per-person figures."})]}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(d.J,{children:"Booked through"}),(0,a.jsxs)(l.l6,{value:v.bookingPlatform,onValueChange:e=>P({bookingPlatform:e}),children:[(0,a.jsx)(l.bq,{children:(0,a.jsx)(l.yv,{placeholder:"Where did you book?"})}),(0,a.jsx)(l.gC,{children:p.kx.map(e=>(0,a.jsx)(l.eb,{value:e.id,children:e.name},e.id))})]})]})]}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(d.J,{htmlFor:"booking-reference",children:"Booking reference (optional)"}),(0,a.jsx)(o.p,{id:"booking-reference",placeholder:"e.g., X7K2QP",value:v.bookingReference,onChange:e=>P({bookingReference:e.target.value.toUpperCase()}),maxLength:20})]}),(0,a.jsxs)("div",{className:"space-y-3 border-t pt-4",children:[(0,a.jsx)(d.J,{children:"This price covers"}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsxs)("label",{className:"flex items-center gap-2 text-sm",children:[(0,a.jsx)("input",{type:"radio",name:"booking-scope",className:"accent-primary",checked:!E,onChange:()=>P({flightIds:e?[e]:[]})}),"Only this flight"]}),(0,a.jsxs)("label",{className:"flex items-center gap-2 text-sm",children:[(0,a.jsx)("input",{type:"radio",name:"booking-scope",className:"accent-primary",checked:E,onChange:()=>{}}),"This flight and others on the same ticket"]})]}),w&&(0,a.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,a.jsx)(h.A,{className:"h-4 w-4 animate-spin"})," Loading your flightsâ¦"]}),_&&(0,a.jsxs)("p",{className:"rounded-md bg-destructive/10 p-2 text-xs text-destructive",children:["Your flights could not be loaded: ",_,_.toLowerCase().includes("booking_id")&&(0,a.jsx)(a.Fragment,{children:" â the bookings migration has not been applied to this database yet."})]}),!w&&!_&&(0,a.jsxs)(a.Fragment,{children:[A&&(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)(g.A,{className:"absolute left-2 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),(0,a.jsx)(o.p,{className:"pl-8",placeholder:"Search by route, flight number or dateâ¦",value:T,onChange:e=>L(e.target.value)})]}),(0,a.jsxs)("div",{className:"max-h-64 space-y-1 overflow-y-auto rounded-md border p-2",children:[0===K.length&&(0,a.jsx)("p",{className:"p-2 text-sm text-muted-foreground",children:A?"No flights match that search.":"No other unpriced flights near this date."}),K.map(t=>{let r=v.flightIds.includes(t.id),n=!!t.booking_id&&t.booking_id!==v.bookingId;return(0,a.jsxs)("label",{className:`flex items-center gap-3 rounded px-2 py-1.5 text-sm ${n?"opacity-60":"cursor-pointer hover:bg-muted"}`,children:[(0,a.jsx)("input",{type:"checkbox",className:"accent-primary",checked:r,disabled:n,onChange:r=>{var a;let n;return a=t.id,n=r.target.checked?[...v.flightIds,a]:v.flightIds.filter(e=>e!==a),void P({flightIds:e&&!n.includes(e)?[e,...n]:n})}}),(0,a.jsxs)("span",{className:"flex-1",children:[(0,a.jsx)("span",{className:"font-medium",children:O(t)})," ",(0,a.jsxs)("span",{className:"text-muted-foreground",children:[t.departure_date,t.flight_number?` \xb7 ${t.flight_number}`:""]})]}),n&&(0,a.jsx)("span",{className:"text-xs text-muted-foreground",children:"part of another booking"})]},t.id)})]}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2 text-xs text-muted-foreground",children:[(0,a.jsx)("span",{children:A?`Searching all ${j.length} of your flights`:`Showing ${z.length} flight${1===z.length?"":"s"} within 30 days`}),!A&&(0,a.jsx)("button",{type:"button",onClick:()=>D(!0),className:"underline hover:text-foreground",children:"Search all flights"})]}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:"Only flights you have logged appear here."}),U.length>0&&(0,a.jsx)("p",{className:"rounded-md bg-amber-50 p-2 text-xs text-amber-900 dark:bg-amber-950/40 dark:text-amber-200",children:1===U.length?`One selected flight is ${Math.round(x(U[0].departure_date,t)/30)} months from this one â is that right?`:`${U.length} selected flights are more than six months from this one â is that right?`})]}),E&&(0,a.jsxs)("p",{className:"text-sm text-muted-foreground",children:["This price covers ",M+1," flights. Editing it from any of them changes the same record."]})]})]})]})]})}},71275:(e,t,r)=>{r.d(t,{A:()=>a});let a=(0,r(78340).A)("Wallet",[["path",{d:"M19 7V4a1 1 0 0 0-1-1H5a2 2 0 0 0 0 4h15a1 1 0 0 1 1 1v4h-3a2 2 0 0 0 0 4h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1",key:"18etb6"}],["path",{d:"M3 5v14a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1v-4",key:"xoc0q4"}]])},79984:(e,t,r)=>{r.d(t,{BT:()=>d,Wu:()=>l,ZB:()=>o,Zp:()=>s,aR:()=>i});var a=r(95155);r(12115);var n=r(91337);function s({className:e,...t}){return(0,a.jsx)("div",{"data-slot":"card",className:(0,n.cn)("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...t})}function i({className:e,...t}){return(0,a.jsx)("div",{"data-slot":"card-header",className:(0,n.cn)("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...t})}function o({className:e,...t}){return(0,a.jsx)("div",{"data-slot":"card-title",className:(0,n.cn)("leading-none font-semibold",e),...t})}function d({className:e,...t}){return(0,a.jsx)("div",{"data-slot":"card-description",className:(0,n.cn)("text-muted-foreground text-sm",e),...t})}function l({className:e,...t}){return(0,a.jsx)("div",{"data-slot":"card-content",className:(0,n.cn)("px-6",e),...t})}},86051:(e,t,r)=>{r.d(t,{X:()=>n});var a=r(9339);let n=(0,a.createServerReference)("406be37ffc652a0d1cd52ef6fba701e812eb22742f",a.callServer,void 0,a.findSourceMapURL,"s
1aveBooking")},90466:(e,t,r)=>{r.d(t,{d:()=>i});var a=r(95155);r(12115);var n=r(8678),s=r(91337);function i({className:e,...t}){return(0,a.jsx)(n.bL,{"data-slot":"switch",className:(0,s.cn)("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:(0,a.jsx)(n.zi,{"data-slot":"switch-thumb",className:"bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0"})})}}}]);
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.