PageSourceSearch

https://www.bestflights.ai/_next/static/chunks/468-604f98c2d96dead6.js

js bestflights.ai collected 2026-10-05 11:51:09 UTC 9,410 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[468],{613:function(e,r,t){var n=t(5893),s=t(7294),a=t(5948),i=t(6849),l=t(7847);let o=e=>{let{setShowPreferences:r,airlinePreferences:t,setAirlinePreferences:i,setPreferenceHeader:o}=e,[c,d]=(0,s.useState)(t.preferred_airlines||["Delta Air Lines","United Airlines","American Airlines","Alaska Airlines","JetBlue Airways","Spirit Airlines"]),[u,p]=(0,s.useState)({question1:t.extra_stop_penalty||200,question2:t.two_hour_penalty||200,question3:t.preferred_airline_penalty||200}),[h,x]=(0,s.useState)(()=>!0===t.non_stop_always?"yes":!1===t.non_stop_always?"no":""),f=e=>{x(e.target.value)},m=(e,r)=>{p({...u,[r]:parseInt(e.target.value,10)})},y=e=>{if(!e.destination)return;let r=Array.from(c),[t]=r.splice(e.source.index,1);r.splice(e.destination.index,0,t),d(r)},g=e=>["bg-green-200","bg-green-100","bg-green-50","bg-red-50","bg-red-100","bg-red-200"][e],j=()=>{let e={...t,preferred_airlines:c,extra_stop_penalty:u.question1,two_hour_penalty:u.question2,preferred_airline_penalty:u.question3,non_stop_always:"yes"===h};i(e),console.log(e),(0,l.J)(e),o("Preferences Saved ✅"),r(!1)};return(0,n.jsxs)("div",{className:"relative ml-3 text-sm bg-white py-2 px-4 shadow rounded-xl mt-3",children:[["How much would you pay to avoid an extra stop?","How much would you pay to save two hours of travel?","How much would you pay to fly your preferred airline over a cheaper alternative?"].map((e,r)=>(0,n.jsxs)("div",{className:"flex flex-col mb-3",children:[(0,n.jsx)("label",{htmlFor:"question".concat(r+1),children:e}),(0,n.jsxs)("div",{className:"items-center justify-center flex",children:[(0,n.jsx)("input",{type:"range",id:"question".concat(r+1),name:"question".concat(r+1),min:"0",max:"400",value:u["question".concat(r+1)],onChange:e=>m(e,"question".concat(r+1)),className:"w-1/2 py-2 custom-slider"}),(0,n.jsxs)("span",{className:"ml-3",children:["$",u["question".concat(r+1)]]})]})]},r)),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{children:"Would you take a one stop flight with your preferred airline if there was a non-stop flight with another airline available?"}),(0,n.jsxs)("div",{className:"py-2 w-full items-center justify-center flex",children:[(0,n.jsxs)("div",{className:"px-3",children:[(0,n.jsx)("input",{type:"radio",id:"yes",name:"question4",value:"yes",checked:"yes"===h,onChange:f}),(0,n.jsx)("label",{htmlFor:"yes",children:"Yes"})]}),(0,n.jsxs)("div",{className:"px-3",children:[(0,n.jsx)("input",{type:"radio",id:"no",name:"question4",value:"no",checked:"no"===h,onChange:f}),(0,n.jsx)("label",{htmlFor:"no",children:"No"})]})]})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{htmlFor:"preferredAirlines",children:"How would you rank your preferred airlines? (drag and drop)"}),(0,n.jsx)(a.Z5,{onDragEnd:y,children:(0,n.jsx)(a.bK,{droppableId:"preferredAirlines",children:e=>(0,n.jsxs)("ul",{...e.droppableProps,ref:e.innerRef,id:"preferredAirlines",className:"flex flex-col items-center justify-center",children:[c.map((e,r)=>(0,n.jsx)(a._l,{draggableId:e,index:r,children:t=>(0,n.jsx)("li",{...t.draggableProps,...t.dragHandleProps,ref:t.innerRef,children:(0,n.jsxs)("div",{className:g(r),children:[r+1,". ",e]})})},e)),e.placeholder]})})})]}),(0,n.jsx)("button",{type:"submit",className:"bg-secondary text-white rounded-xl p-1 mt-5",onClick:j,children:"Submit Preferences"})]})},c=e=>{let{message:r}
1=e,[t,a]=(0,s.useState)(()=>r?r.message.text:""),[l,c]=(0,s.useState)(!0),{airlinePreferences:d,setAirlinePreferences:u}=(0,i.s)(),[p,h]=(0,s.useState)("Preferences Saved ✅");return(0,s.useEffect)(()=>{d.preferred_airlines&&r&&(c(!1),h("Preferences Loaded ✅"))},[]),(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)("div",{className:"col-start-1 col-end-11 p-3 rounded-lg",children:[(0,n.jsx)("div",{className:"flex flex-row items-center justify-center",children:r&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:"flex items-center justify-center h-10 w-10 rounded-full bg-primary text-white flex-shrink-0 text-xs",children:"Marco"}),(0,n.jsx)("div",{className:"relative ml-3 text-sm bg-white py-2 px-4 shadow rounded-xl",children:(0,n.jsx)("div",{children:t})})]})}),l?(0,n.jsx)(o,{setShowPreferences:c,airlinePreferences:d,setAirlinePreferences:u,setPreferenceHeader:h}):(0,n.jsx)("div",{className:"flex flex-row items-center justify-center",children:(0,n.jsx)("div",{className:"relative flex ml-3 text-sm bg-white py-2 px-4 shadow rounded-xl mt-3 hover:cursor-pointer hover:bg-gray-100",onClick:()=>c(!0),children:(0,n.jsx)("div",{className:"relative flex text-center items-center justify-center",children:p})})})]})})};r.Z=c},8547:function(e,r,t){var n=t(5893),s=t(7294),a=t(1664),i=t.n(a),l=t(5675),o=t.n(l),c=t(1163),d=t(3299);let u=e=>{var r;let{setShowNewTrip:t,conversationNames:a,setConversationId:l,hideTripsButton:u}
1=e,[p,h]=(0,s.useState)(!1),[x,f]=(0,s.useState)(!1),m=(0,c.useRouter)(),{data:y,status:g}=(0,d.useSession)(),j=()=>{(0,d.signOut)()};return(0,n.jsxs)("div",{className:"flex justify-between items-center h-[90px] border-b-2 md:px-5 bg-p_black",children:[(0,n.jsx)("div",{className:"flex items-center",children:(0,n.jsx)(i(),{href:"/chat",children:(0,n.jsxs)("div",{onClick:()=>t(!0),children:[(0,n.jsx)("span",{title:"Rocket emoji",className:"w-8 h-8 rounded-full object-cover rocket px-2",children:"\uD83D\uDE80"}),(0,n.jsx)("span",{className:"px-1 text:s md:text-xl m-auto text-white",children:"BestFlights.ai"})]})})}),(0,n.jsx)("div",{className:"flex md:gap-x-8 gap-x-3",children:(0,n.jsx)("div",{className:"flex m-auto gap-x-2",children:(0,n.jsxs)("div",{className:"relative",children:[(0,n.jsxs)("div",{className:"flex",children:[!u&&(0,n.jsx)("div",{className:"bg-secondary rounded-xl text-white flex justify-center px-2",children:(0,n.jsx)("button",{className:"m-auto p-1",onClick:()=>{f(!x),h(!1)},children:"My Trips"})}),(0,n.jsx)("div",{className:p?"flex bg-slate-300 rounded-full px-3 cursor-pointer":"flex hover:bg-slate-300 hover:rounded-full px-3 cursor-pointer",onClick:()=>{h(!p),f(!1)},children:(0,n.jsx)(o(),{src:(null==y?void 0:null===(r=y.user)||void 0===r?void 0:r.image)||"/user-cog.svg",alt:"Profile Image",width:40,height:40,className:"rounded-full "})})]}),p&&(0,n.jsx)("div",{className:"absolute right-0 mt-2 w-48 rounded-md shadow-lg bg-white ring-1 ring-black ring-opacity-5 z-10",children:(0,n.jsxs)("div",{className:"py-1",children:[(0,n.jsx)(i(),{href:"/account",children:(0,n.jsx)("div",{className:"block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100",children:"Account"})}),(0,n.jsx)("div",{className:"block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100",children:(0,n.jsx)("button",{onClick:j,children:"Logout"})})]})}),x&&(0,n.jsx)("div",{className:"absolute right-16 mt-2 w-48 rounded-md shadow-lg bg-white ring-1 ring-black ring-opacity-5 z-10",children:(0,n.jsxs)("div",{className:"py-1",children:[(0,n.jsx)("div",{onClick:()=>{l(-1),t(!0),f(!1),m.push("/chat")},className:"block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100",children:"New Trip"}),Object.entries(a).map(e=>{let[r,s]=e;return(0,n.jsx)("div",{className:"block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100",onClick:()=>{l(parseInt(r)),f(!1),t(!1),m.push("/chat")},children:s},r)})]})})]})})})]})};r.Z=u},7847:function(e,r,t){async function n(e){try{let r=await fetch("/api/marco",{method:"POST",body:JSON.stringify({payload:{airline_preferences:e,type:"write",endPoint:"airline_preferences"}}),headers:{"Content-Type":"application/json"}}),t=await r.json();return console.log("Data from write_airline_preferences:",t),t}catch(n){return console.error("Error writing passenger details:",n),null}}async function s(){try{let e=await fetch("/api/marco",{method:"POST",body:JSON.stringify({payload:{type:"fetch",endPoint:"airline_preferences"}}),headers:{"Content-Type":"application/json"}}),r=await e.json();return r}catch(t){return null}}t.d(r,{J:function(){return n},P:function(){return s}})},6881:function(e,r,t){async function n(e){try{let r=await fetch("/api/marco",{method:"POST",body:JSON.stringify({payload:{airline_passenger_details:e,type:"write",endPoint:"passenger_details"}}),headers:{"Content-Type":"application/json"}}),t=await r.json();return console.log("Data from write_passenger_details:",t),t}catch(n){return console.error("Error writing passenger details:",n),null}}async function s(){try{let e=await fetch("/api/marco",{method:"POST",body:JSON.stringify({payload:{type:"fetch",endPoint:"passenger_details"}}),headers:{"Content-Type":"application/json"}}),r=await e.json();return r}catch(t){return null}}t.d(r,{O:function(){return n},Y:function(){return s}})},200:function(e,r,t){async function n(e){try{let r=await fetch("/api/marco",{method:"POST",body:JSON.stringify({payload:{account:e,type:"write",endPoint:"user_loyalty_account"}}),headers:{"Content-Type":"application/json"}}),t=await r.json();return t}catch(n){return null}}async function s(){try{let e=await fetch("/api/marco",{method:"POST",body:JSON.stringify({payload:{type:"fetch",endPoint:"user_loyalty_account"}}),headers:{"Content-Type":"application/json"}}),r=await e.json();return console.log("Data from fetch_passenger_details:",r),r}catch(t){return console.error("Error fetching passenger details:",t),null}}t.d(r,{A:function(){return s},Z:function(){return n}})},1327:function(e,r,t){t.d(r,{k:function(){return s}});let{v4:n}=t(1982);function s(){return n()}}}]);

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.