1import{r as l,Q as Me,H as qe,u as De,i as Ue,j as e,aW as ue,w as Te}from"./index-CcaPaFKR.js";import{r as ge}from"./reservationsApi-BGopPkcT.js";import{b as Ve}from"./inquiryUtils-BFmKED-e.js";import{F as Be}from"./BuildingOffice2Icon-9jXAHWMi.js";function Ae({title:y,titleId:x,...c},r){return l.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":x},c),y?l.createElement("title",{id:x},y):null,l.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 16.5V9.75m0 0 3 3m-3-3-3 3M6.75 19.5a4.5 4.5 0 0 1-1.41-8.775 5.25 5.25 0 0 1 10.233-2.33 3 3 0 0 1 3.758 3.848A3.752 3.752 0 0 1 18 19.5H6.75Z"}))}const He=l.forwardRef(Ae);function We({title:y,titleId:x,...c},r){return l.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":x},c),y?l.createElement("title",{id:x},y):null,l.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m2.25 0H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9Z"}))}const Y=l.forwardRef(We),Ke=()=>{const y=Me(),x=qe(),{user:c}=De(),[r,xe]=l.useState(null),[ee,pe]=l.useState([]),[u,he]=l.useState(null),[N,ye]=l.useState(null),[s,H]=l.useState("total"),[C,$]=l.useState(1),[p,te]=l.useState({single:0,double:0,suite:0}),[W,be]=l.useState(""),[G,fe]=l.useState(""),[T,re]=l.useState([]),[P,J]=l.useState(!1),[g,se]=l.useState(null),[je,ae]=l.useState(!1),[ve,Ne]=l.useState(!1),[oe,ie]=l.useState([]),[z,we]=l.useState(null),[Z,_e]=l.useState([]),[ne,ke]=l.useState([]),[L,K]=l.useState({}),[b,F]=l.useState({}),[le,Q]=l.useState(null),V=l.useRef({}),[I,Se]=l.useState(""),[w,Ce]=l.useState(""),[ce,Fe]=l.useState([]);l.useEffect(()=>{Ue.get("/core/currencies/").then(t=>{var a;return Fe(((a=t.data)==null?void 0:a.currencies)||[])}).catch(()=>{})},[]);const R=(c==null?void 0:c.user_type)==="organization_user"||(c==null?void 0:c.user_type)==="organization_admin"||(c==null?void 0:c.user_type)==="travel_consultant";l.useEffect(()=>{(async()=>{var d,m,f,O,E,M;let a=null;if(R){const n=localStorage.getItem("cached_search_data");if(n)try{const i=JSON.parse(n);a=i.client_organization_id||((d=i.client_organization)==null?void 0:d.id)||null}catch{}}let o=a||(c==null?void 0:c.client_organization_id)||localStorage.getItem("client_organization_id");if(!o&&((m=c==null?void 0:c.client_organizations)==null?void 0:m.length)>0&&(o=c.client_organizations[0].id),console.log("RoomPreference: Fetching custom fields for client org:",o),o)try{const n=await ge.getClientOrganizationCustomFields(o);console.log("RoomPreference: Custom fields response:",n),(f=n.project_custom_fields)!=null&&f.fields&&_e(n.project_custom_fields.fields),(O=n.room_guest_custom_fields)!=null&&O.fields&&ke(n.room_guest_custom_fields.fields);const i=[...((E=n.project_custom_fields)==null?void 0:E.fields)||[],...((M=n.room_guest_custom_fields)==null?void 0:M.fields)||[]],_={};i.forEach(k=>{var q,D;const S=k.type==="dropdown"?((D=(q=k.options)==null?void 0:q[0])==null?void 0:D.value)||"":k.default_value||"";S&&(_[k.id]=S)}),K(_)}catch(n){console.error("Error fetching custom fields:",n)}else console.log("RoomPreference: No client org ID available for custom fields")})()},[c==null?void 0:c.client_organization_id,c]),l.useEffect(()=>{var t;if(y.state){const a=y.state;if(a.searchParams&&a.hotelPreferences)if(xe(a.searchParams),pe(a.selectedHotels||[]),he(a.apiResponse||null),ye(a.hotelPreferences),a.groupTravelDetails&&we(a.groupTravelDetails),(t=a.aiInputs)!=null&&t.room_distribution){const o=a.aiInputs.room_distribution;$(o.total_rooms),te(o.room_types),o.room_types&&(o.room_types.single>0||o.room_types.double>0||o.room_types.suite>0)&&H("specific")}else $(a.searchParams.rooms);else x("/group-travel")}else x("/group-travel")},[y.state,x]);const $e=()=>{Oe()},ze=()=>{var d,m;if(!r)return;const t=((d=u==null?void 0:u.search_params)==null?void 0:d.latitude)||r.latitude,a=((m
1=u==null?void 0:u.search_params)==null?void 0:m.longitude)||r.longitude;if(!t||!a){console.error("Missing latitude/longitude - cannot navigate back to search",{apiResponse:u==null?void 0:u.search_params,searchParams:r}),alert("Unable to return to search results. Please start a new search."),x("/search");return}const o=new URLSearchParams({location:r.destination||"",latitude:String(t),longitude:String(a),checkIn:r.checkIn||"",checkOut:r.checkOut||"",guests:String(r.guests||1),rooms:String(r.rooms||1),adults:String(r.adults||r.guests||1),sort:"recommended",sortDir:"asc",bookingType:"group"});r.children&&o.append("children",String(r.children)),x(`/search?${o.toString()}`,{state:{fromSpecialRequirements:!0,specialRequirements:W,uploadedFiles:T,existingSearchParams:r,existingHotelPreferences:N,existingRoomSelection:{type:s,totalRooms:C,roomTypes:p}}})},j=(t,a)=>{te(o=>{const d={...o,[t]:Math.max(0,a)};if(s==="specific"){const m=d.single+d.double+d.suite;$(m)}return d})},Ie=t=>{const a=t.target.files;if(a){const o=[],d=[];Array.from(a).forEach(m=>{m.size>10485760?d.push(`${m.name} (${(m.size/(1024*1024)).toFixed(2)} MB)`):o.push({id:Math.random().toString(36).substr(2,9),name:m.name,size:m.size,type:m.type,file:m})}),d.length>0?(ie(d),t.target.value=""):ie([]),o.length>0&&re(m=>[...m,...o])}},Re=t=>{re(a=>a.filter(o=>o.id!==t))},Le=t=>{se(t),ae(!0)},de=()=>{ae(!1),se(null)},me=t=>{if(t===0)return"0 Bytes";const a=1024,o=["Bytes","KB","MB","GB"],d=Math.floor(Math.log(t)/Math.log(a));return parseFloat((t/Math.pow(a,d)).toFixed(2))+" "+o[d]},Oe=async()=>{var o,d,m,f,O,E,M;const t=r==null?void 0:r.clientOrganization;if(F({}),Q(null),R&&!t){Q("Client organization is required. Please go back to the search page and select a client organization.");return}if(!R&&!(c!=null&&c.client_organization_id)){Q("Client organization information is missing. Please log out and log back in to refresh your session.");return}if(!I||Number(I)<=0||!w){const n={};(!I||Number(I)<=0)&&(n.budget_per_night="Budget per night is required."),w||(n.budget_currency="Currency is required."),F(n),(o=V.current.budget_per_night)==null||o.scrollIntoView({behavior:"smooth",block:"center"});return}const a=[...Z,...ne].filter(n=>{var i;return n.required&&!((i=L[n.id])!=null&&i.trim())});if(a.length>0){const n={};a.forEach(_=>{n[_.id]=`${_.name} is required.`}),F(n);const i=a[0].id;(d=V.current[i])==null||d.scrollIntoView({behavior:"smooth",block:"center"});return}J(!0);try{const n=new FormData,i=(v,h)=>{if(!(h==null||h==="")){if(Array.isArray(h)||typeof h=="object"){n.append(v,JSON.stringify(h));return}n.append(v,String(h))}};i("destination_city",(r==null?void 0:r.destination)||""),i("destination_country",(r==null?void 0:r.destination_country)||""),i("arrival_date",(r==null?void 0:r.checkIn)||""),i("departure_date",(r==null?void 0:r.checkOut)||"");const _=(r==null?void 0:r.guests)||(((m=u==null?void 0:u.search_params)==null?void 0:m.guests_per_room)||1)*(C||(r==null?void 0:r.rooms)||1),k=C||(r==null?void 0:r.rooms)||1;i("total_guests",_),i("total_rooms_needed",k),i("budget_per_night",I),i("budget_currency",w),i("special_requirements",W),R&&G&&i("internal_remarks",G),i("organization_name","SPAR Marketing Force, Inc.");const S=R?t:c==null?void 0:c.client_organization_id;i("client_organization",S),i("requested_by_name",(c==null?void 0:c.email)||"User"),i("status","submitted"),i("travel_type",(r==null?void 0:r.eventType)||"construction"),i("room_preferences",p),i("selected_amenities",(N==null?void 0:N.selectedAmenities)||[]),i("min_star_rating",N==null?void 0:N.minStarRating);const q=Ve(((f=u==null?void 0:u.search_params)==null?void 0:f.latitude)||(r==null?void 0:r.latitude),((O=u==null?void 0:u.search_params)==null?void 0:O.longitude)||(r==null?void 0:r.longitude),r==null?void 0:r.destination);if(q&&i("location_details",q),i("selected_properties",ee.map(v=>v.id)),z!=null&&z.groupName&&z.groupName.trim()&&((r==null?void 0:r.eventType)==="others"||z.travelType==="others")&&i("project_name",z.groupName.trim()),i("selected_property_details",{hotels:ee,hotel_preferences:N||void 0,room_selection:{type:s,totalRooms:C,roomTypes:p},search_metadata:u==null?void 0:u.search_metadata}),Object.keys(L).length>0){const v={};
1Object.entries(L).forEach(([h,B])=>{const U=Z.find(A=>A.id===h);if(U){let A=B;if(U.type==="dropdown"&&U.options){const X=U.options.find(Ee=>Ee.value===B);A=(X==null?void 0:X.label)||B}v[h]={name:U.name,value:B,display_value:A}}}),i("custom_fields",v)}T.forEach((v,h)=>{n.append(`files[${h}]`,v.file)});const D=(E=y.state)==null?void 0:E.assistSessionId;D&&i("assist_session_id",D),await ge.createInquiry(n),J(!1),Ne(!0),setTimeout(()=>{x("/reservations/inquiries")},3e3)}catch(n){console.error("Inquiry submission failed",n),J(!1);let i="Unknown error";(M=n.response)!=null&&M.data?typeof n.response.data=="object"?i=Object.entries(n.response.data).map(([k,S])=>`${k}: ${Array.isArray(S)?S.join(", "):S}`).join(` 2`)||JSON.stringify(n.response.data):i=n.response.data:n.message&&(i=n.message),alert(`Failed to submit request: 3 4${i} 5 6Please try again or contact support.`)}};return r?e.jsxs(ue,{children:[e.jsxs("div",{className:"max-w-4xl mx-auto px-4 sm:px-6 lg:px-8 pt-8 pb-28 bg-white min-h-screen overflow-x-hidden",children:[e.jsxs("div",{className:"mb-8",children:[e.jsx("h1",{className:"text-3xl font-medium text-gray-900 mb-2",children:"Tell us how many rooms you need"}),e.jsx("p",{className:"text-gray-600",children:"Specify room types below, or keep it simple with a single total"})]}),e.jsx("div",{className:"space-y-8",children:e.jsxs("div",{className:"space-y-6",children:[e.jsx("div",{className:`p-3 sm:p-6 border-2 rounded-lg transition-all duration-200 ${s==="total"?"border-primary bg-primary/5":"border-gray-200 hover:border-gray-300"}`,children:e.jsxs("div",{className:"flex items-start space-x-4",children:[e.jsx("input",{type:"radio",id:"total-rooms",name:"room-selection",checked:s==="total",onChange:()=>H("total"),className:"mt-1 h-5 w-5 text-primary focus:ring-primary border-gray-300"}),e.jsxs("div",{className:"flex-1",children:[e.jsx("label",{htmlFor:"total-rooms",className:"block text-lg font-medium text-gray-900 mb-4 cursor-pointer",children:"I have an approximate total number of rooms"}),e.jsxs("div",{className:`flex flex-wrap items-center gap-3 transition-opacity ${s==="specific"?"opacity-50":"opacity-100"}`,children:[e.jsxs("div",{className:"flex items-center space-x-3",children:[e.jsx("div",{className:"w-12 h-12 bg-gray-100 rounded-lg flex items-center justify-center flex-shrink-0",children:e.jsx(Be,{className:"h-6 w-6 text-gray-600"})}),e.jsx("div",{children:e.jsx("p",{className:"font-medium text-gray-900",children:"Total rooms (approx.)"})})]}),e.jsxs("div",{className:"flex items-center space-x-3",children:[e.jsx("button",{onClick:()=>s==="total"&&$(Math.max(1,C-1)),disabled:s==="specific",className:`w-10 h-10 rounded-full border-2 flex items-center justify-center transition-colors ${s==="specific"?"border-gray-200 bg-gray-50 cursor-not-allowed":"border-gray-300 hover:bg-gray-50 hover:border-gray-400"}`,children:e.jsx("span",{className:`text-lg font-medium ${s==="specific"?"text-gray-400":"text-gray-600"}`,children:"-"})}),e.jsx("input",{type:"number",value:C,onChange:t=>s==="total"&&$(Math.max(1,parseInt(t.target.value)||1)),disabled:s==="specific",className:`w-12 sm:w-20 text-center border-2 rounded-lg px-1 sm:px-3 py-2 text-lg font-medium focus:ring-0 ${s==="specific"?"border-gray-200 bg-gray-50 text-gray-400 cursor-not-allowed":"border-gray-300 focus:border-primary"}`,min:"1"}),e.jsx("button",{onClick:()=>s==="total"&&$(C+1),disabled:s==="specific",className:`w-10 h-10 rounded-full border-2 flex items-center justify-center transition-colors ${s==="specific"?"border-gray-200 bg-gray-50 cursor-not-allowed":"border-gray-300 hover:bg-gray-50 hover:border-gray-400"}`,children:e.jsx("span",{className:`text-lg font-medium ${s==="specific"?"text-gray-400":"text-gray-600"}`,children:"+"})})]})]})]})]})}),e.jsx("div",{className:`p-3 sm:p-6 border-2 rounded-lg transition-all duration-200 ${s==="specific"?"border-primary bg-primary/5":"border-gray-200 hover:border-gray-300"}`,children:e.jsxs("div",{className:"flex items-start space-x-4",children:[e.jsx("input",{type:"radio",id:"specific-rooms",name:"room-selection",checked:s==="specific",onChange:()=>H("specific"),className:"mt-1 h-5 w-5 text-primary focus:ring-primary border-gray-300"}),e.jsxs("div",{className:"flex-1",children:[e.jsx("label",{htmlFor:"specific-rooms",className:"block text-lg font-medium text-gray-900 mb-6 cursor-pointer",children:"I know the specific room types I need"}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:`flex flex-col sm:flex-row sm:items-center sm:justify-between p-3 gap-3 border border-gray-200 rounded-lg bg-white transition-opacity ${s==="total"?"opacity-50":"opacity-100"}`,children:[e.jsxs("div",{className:"flex items-center space-x-4",children:[e.jsx("div",{className:"w-12 h-12 bg-gray-100 rounded-lg flex items-center justify-center",children:e.jsx("span",{className:"text-xl",children:"ðï¸"})}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-medium text-gray-900 text-lg",children:"Single rooms"}),e.jsx("p",{className:"text-gray-600",children:"Usually includes 1 bed, 1 bathroom"})]})]}),e.jsxs("div",{className:"flex items-center space-x-3",children:[e.jsx("button",{onClick:()=>s==="specific"&&j("single",p.single-1),disabled:s==="total",className:`w-10 h-10 rounded-full border-2 flex items-center justify-center transition-colors ${s==="total"?"border-gray-200 bg-gray-50 cursor-not-allowed":"border-gray-300 hover:bg-gray-50 hover:border-gray-400"}`,children:e.jsx("span",{className:`text-lg font-medium ${s==="total"?"text-gray-400":"text-gray-600"}`,children:"-"})}),e.jsx("input",{type:"number",value:p.single,onChange:t=>s==="specific"&&j("single",parseInt(t.target.value)||0),disabled:s==="total",className:`w-12 sm:w-20 text-center border-2 rounded-lg px-1 sm:px-3 py-2 text-lg font-medium focus:ring-0 ${s==="total"?"border-gray-200 bg-gray-50 text-gray-400 cursor-not-allowed":"border-gray-300 focus:border-primary"}`,min:"0"}),e.jsx("button",{onClick:()=>s==="specific"&&j("single",p.single+1),disabled:s==="total",className:`w-10 h-10 rounded-full border-2 flex items-center justify-center transition-colors ${s==="total"?"border-gray-200 bg-gray-50 cursor-not-allowed":"border-gray-300 hover:bg-gray-50 hover:border-gray-400"}`,children:e.jsx("span",{className:`text-lg font-medium ${s==="total"?"text-gray-400":"text-gray-600"}`,children:"+"})})]})]}),e.jsxs("div",{className:`flex flex-col sm:flex-row sm:items-center sm:justify-between p-3 gap-3 border border-gray-200 rounded-lg bg-white transition-opacity ${s==="total"?"opacity-50":"opacity-100"}`,children:[e.jsxs("div",{className:"flex items-center space-x-4",children:[e.jsx("div",{className:"w-12 h-12 bg-gray-100 rounded-lg flex items-center justify-center",children:e.jsx("span",{className:"text-xl",children:"ðï¸ðï¸"})}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-medium text-gray-900 text-lg",children:"Twin rooms"}),e.jsx("p",{className:"text-gray-600",children:"Usually includes 2 beds, 1 bathroom"})]})]}),e.jsxs("div",{className:"flex items-center space-x-3",children:[e.jsx("button",{onClick:()=>s==="specific"&&j("double",p.double-1),disabled:s==="total",className:`w-10 h-10 rounded-full border-2 flex items-center justify-center transition-colors ${s==="total"?"border-gray-200 bg-gray-50 cursor-not-allowed":"border-gray-300 hover:bg-gray-50 hover:border-gray-400"}`,children:e.jsx("span",{className:`text-lg font-medium ${s==="total"?"text-gray-400":"text-gray-600"}`,children:"-"})}),e.jsx("input",{type:"number",value:p.double,onChange:t=>s==="specific"&&j("double",parseInt(t.target.value)||0),disabled:s==="total",className:`w-12 sm:w-20 text-center border-2 rounded-lg px-1 sm:px-3 py-2 text-lg font-medium focus:ring-0 ${s==="total"?"border-gray-200 bg-gray-50 text-gray-400 cursor-not-allowed":"border-gray-300 focus:border-primary"}`,min:"0"}),e.jsx("button",{onClick:()=>s==="specific"&&j("double",p.double+1),disabled:s==="total",className:`w-10 h-10 rounded-full border-2 flex items-center justify-center transition-colors ${s==="total"?"border-gray-200 bg-gray-50 cursor-not-allowed":"border-gray-300 hover:bg-gray-50 hover:border-gray-400"}`,children:e.jsx("span",{className:`text-lg font-medium ${s==="total"?"text-gray-400":"text-gray-600"}`,children:"+"})})]})]}),e.jsxs("div",{className:`flex flex-col sm:flex-row sm:items-center sm:justify-between p-3 gap-3 border border-gray-200 rounded-lg bg-white transition-opacity ${s==="total"?"opacity-50":"opacity-100"}`,children:[e.jsxs("div",{className:"flex items-center space-x-4",children:[e.jsx("div",{className:"w-12 h-12 bg-gray-100 rounded-lg flex items-center justify-center",children:e.jsx("span",{className:"text-xl",children:"ð"})}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-medium text-gray-900 text-lg",children:"Suites"}),e.jsx("p",{className:"text-gray-600",children:"Usually includes 1 bed, 1 bathroom, 1 living room"})]})]}),e.jsxs("div",{className:"flex items-center space-x-3",children:[e.jsx("button",{onClick:()=>s==="specific"&&j("suite",p.suite-1),disabled:s==="total",className:`w-10 h-10 rounded-full border-2 flex items-center justify-center transition-colors ${s==="total"?"border-gray-200 bg-gray-50 cursor-not-allowed":"border-gray-300 hover:bg-gray-50 hover:border-gray-400"}`,children:e.jsx("span",{className:`text-lg font-medium ${s==="total"?"text-gray-400":"text-gray-600"}`,children:"-"})}),e.jsx("input",{type:"number",value:p.suite,onChange:t=>s==="specific"&&j("suite",parseInt(t.target.value)||0),disabled:s==="total",className:`w-12 sm:w-20 text-center border-2 rounded-lg px-1 sm:px-3 py-2 text-lg font-medium focus:ring-0 ${s==="total"?"border-gray-200 bg-gray-50 text-gray-400 cursor-not-allowed":"border-gray-300 focus:border-primary"}`,min:"0"}),e.jsx("button",{onClick:()=>s==="specific"&&j("suite",p.suite+1),disabled:s==="total",className:`w-10 h-10 rounded-full border-2 flex items-center justify-center transition-colors ${s==="total"?"border-gray-200 bg-gray-50 cursor-not-allowed":"border-gray-300 hover:bg-gray-50 hover:border-gray-400"}`,children:e.jsx("span",{className:`text-lg font-medium ${s==="total"?"text-gray-400":"text-gray-600"}`,children:"+"})})]})]})]})]})]})}),e.jsxs("div",{className:"mt-8 pt-8 border-t border-gray-200",children:[e.jsx("h2",{className:"text-2xl font-medium text-gray-900 mb-2",children:"Additional Information"}),e.jsx("p",{className:"text-sm text-gray-600 mb-4",children:"Please provide the following information for your group request"}),e.jsxs("div",{className:"space-y-4",children:[[...Z,...ne].map(t=>{var a;return e.jsxs("div",{ref:o=>{V.current[t.id]=o},children:[e.jsxs("label",{htmlFor:`custom-${t.id}`,className:"block text-sm font-medium text-gray-700 mb-1",children:[t.name,t.required&&e.jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),t.type==="text"?e.jsx("input",{type:"text",id:`custom-${t.id}`,value:L[t.id]||"",onChange:o=>{K(d=>({...d,[t.id]:o.target.value})),o.target.value.trim()&&F(d=>{const{[t.id]:m,...f}=d;return f})},className:`w-full px-4 py-3 border rounded-lg focus:ring-2 focus:ring-primary focus:border-transparent text-sm ${b[t.id]?"border-red-500 bg-red-50":"border-gray-300"}`,placeholder:t.placeholder||`Enter ${t.name}`,required:t.required}):t.type==="dropdown"?e.jsxs("select",{id:`custom-${t.id}`,value:L[t.id]||"",onChange:o=>{K(d=>({...d,[t.id]:o.target.value})),o.target.value&&F(d=>{const{[t.id]:m,...f}=d;return f})},className:`w-full px-4 py-3 border rounded-lg focus:ring-2 focus:ring-primary focus:border-transparent text-sm text-gray-900 ${b[t.id]?"border-red-500 bg-red-50":"border-gray-300"}
6`,required:t.required,children:[e.jsxs("option",{value:"",children:["Select ",t.name]}),(a=t.options)==null?void 0:a.map(o=>e.jsx("option",{value:o.value,children:o.label},o.value))]}):null,b[t.id]&&e.jsx("p",{className:"mt-1 text-sm text-red-600",children:b[t.id]}),t.description&&e.jsx("p",{className:"text-xs text-gray-500 mt-1",children:t.description})]},t.id)}),e.jsxs("div",{ref:t=>{V.current.budget_per_night=t},children:[e.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:["Budget per night",e.jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs("select",{value:w,onChange:t=>{Ce(t.target.value),t.target.value&&F(a=>{const{budget_currency:o,...d}=a;return d})},className:`flex-1 px-2 py-3 border rounded-lg focus:ring-2 focus:ring-primary focus:border-transparent text-sm text-gray-900 ${b.budget_currency?"border-red-500 bg-red-50":"border-gray-300"}`,children:[e.jsx("option",{value:"",disabled:!0,children:"Currency"}),w&&!ce.some(t=>t.code===w)&&e.jsx("option",{value:w,children:w}),ce.map(t=>e.jsx("option",{value:t.code,children:t.code},t.code))]}),e.jsx("input",{type:"number",min:0,step:"0.01",value:I,onChange:t=>{Se(t.target.value),t.target.value&&Number(t.target.value)>0&&F(a=>{const{budget_per_night:o,...d}=a;return d})},placeholder:"0.00",className:`flex-1 px-4 py-3 border rounded-lg focus:ring-2 focus:ring-primary focus:border-transparent text-sm ${b.budget_per_night?"border-red-500 bg-red-50":"border-gray-300"}`})]}),(b.budget_per_night||b.budget_currency)&&e.jsx("p",{className:"mt-1 text-sm text-red-600",children:b.budget_per_night||b.budget_currency})]})]})]}),e.jsxs("div",{className:"mt-8 pt-8 border-t border-gray-200",children:[e.jsxs("div",{className:"mb-6",children:[e.jsx("h2",{className:"text-2xl font-medium text-gray-900 mb-2",children:"Remarks"}),e.jsx("p",{className:"text-sm text-gray-600 mb-4",children:"Tell us about any special needs or upload relevant documents for your group"})]}),e.jsxs("div",{className:"space-y-8",children:[e.jsx("div",{children:e.jsx("textarea",{value:W,onChange:t=>be(t.target.value),rows:6,className:"w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary focus:border-transparent resize-none text-sm",placeholder:"e.g., Wheelchair accessible rooms, meeting room requirements, parking needs, etc."})}),R&&e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-medium text-gray-700 mb-2",children:"Internal Remarks"}),e.jsx("textarea",{value:G,onChange:t=>fe(t.target.value),rows:4,className:"w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary focus:border-transparent resize-none text-sm",placeholder:"Internal notes visible to OPS only"})]}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-medium text-gray-900 mb-2",children:"Upload Documents"}),e.jsx("p",{className:"text-sm text-gray-600 mb-4",children:"Upload any relevant documents, contracts, or specifications (PDF, DOC, images)"}),e.jsxs("div",{className:"border-2 border-dashed border-gray-300 rounded-lg p-4 text-center hover:border-gray-400 transition-colors",children:[e.jsx("input",{type:"file",multiple:!0,accept:".pdf,.doc,.docx,.jpg,.jpeg,.png,.gif",onChange:Ie,className:"hidden",id:"file-upload"}),e.jsxs("label",{htmlFor:"file-upload",className:"cursor-pointer",children:[e.jsx(He,{className:"mx-auto h-8 w-8 text-gray-400 mb-2"}),e.jsx("p",{className:"text-base font-medium text-gray-900 mb-1",children:"Click to upload files"}),e.jsx("p",{className:"text-xs text-gray-600",children:"or drag and drop files here"}),e.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"PDF, DOC, DOCX, JPG, PNG, GIF (up to 10MB)"})]})]}),oe.length>0&&e.jsx("p",{className:"mt-2 text-sm text-red-600",children:oe.map((t,a)=>e.jsxs("span",{className:"block",children:[t," exceeds the 10MB limit."]},a))}),T.length>0&&e.jsxs("div",{className:"mt-6",children:[e.jsx("h3",{className:"text-sm font-medium text-gray-900 mb-3",children:"Uploaded Files"}),e.jsx("div",{className:"space-y-2",children:T.map(t=>e.jsxs("div",{className:"flex items-center justify-between p-3 bg-gray-50 rounded-lg",children:[e.jsxs("div",{className:"flex items-center space-x-3 cursor-pointer hover:bg-gray-100 p-2 rounded flex-1",onClick:()=>Le(t),children:[e.jsx(Y,{className:"h-5 w-5 text-gray-400"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-gray-900",children:t.name}),e.jsx("p",{className:"text-xs text-gray-500",children:me(t.size)})]})]}),e.jsx("button",{onClick:()=>Re(t.id),className:"text-red-500 hover:text-red-700 transition-colors ml-2",children:e.jsx(Te,{className:"h-5 w-5"})})]},t.id))})]})]})]})]})]})})]}),le&&e.jsx("div",{className:"mx-6 md:mx-10 mt-4 rounded-md border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-700",children:le}),e.jsxs("div",{className:"flex justify-end gap-3 mt-6 pb-6 pr-6 md:pr-10",children:[e.jsx("button",{onClick:ze,className:"bg-white text-primary border-2 border-primary px-8 py-3 rounded-lg font-medium transition-colors duration-200 shadow-lg hover:bg-gray-100 hover:border-gray-300 hover:text-gray-900",children:"Select Preferred Accommodations"}),e.jsx("button",{onClick:$e,disabled:P,className:`px-8 py-3 rounded-lg font-medium transition-colors duration-200 shadow-lg ${P?"bg-gray-300 text-gray-500 cursor-not-allowed":"bg-primary text-white hover:bg-primary-600"}`,children:P?"Submitting...":"Submit"})]}),je&&g&&e.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 p-4",children:e.jsxs("div",{className:"bg-white rounded-xl max-w-4xl w-full max-h-[90vh] overflow-hidden",children:[e.jsxs("div",{className:"flex items-center justify-between p-6 border-b border-gray-200",children:[e.jsx("h3",{className:"text-xl font-bold text-gray-900",children:"File Viewer"}),e.jsx("button",{onClick:de,className:"text-gray-400 hover:text-gray-600 transition-colors",children:e.jsx("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),e.jsxs("div",{className:"p-6",children:[e.jsxs("div",{className:"mb-4",children:[e.jsx("h4",{className:"text-lg font-semibold text-gray-900 mb-2",children:g.name}),e.jsxs("p",{className:"text-sm text-gray-600",children:["Size: ",me(g.size)]}),e.jsxs("p",{className:"text-sm text-gray-600",children:["Type: ",g.type]})]}),e.jsx("div",{className:"border border-gray-200 rounded-lg p-4 bg-gray-50 min-h-[400px] flex items-center justify-center",children:g.type.startsWith("image/")?e.jsx("img",{src:URL.createObjectURL(g.file),alt:g.
6name,className:"max-w-full max-h-96 object-contain"}):g.type==="application/pdf"?e.jsxs("div",{className:"w-full h-full",children:[e.jsx("iframe",{src:URL.createObjectURL(g.file),className:"w-full h-96 border-0 rounded-lg",title:`PDF Viewer - ${g.name}`,onError:t=>{t.currentTarget.style.display="none";const a=t.currentTarget.nextElementSibling;a&&(a.style.display="block")}}),e.jsxs("div",{className:"hidden text-center",children:[e.jsx(Y,{className:"h-16 w-16 text-gray-400 mx-auto mb-4"}),e.jsx("p",{className:"text-gray-600 mb-4",children:"PDF preview not available"}),e.jsxs("button",{onClick:()=>{const t=document.createElement("a");t.href=URL.createObjectURL(g.file),t.download=g.name,document.body.appendChild(t),t.click(),document.body.removeChild(t),URL.revokeObjectURL(t.href)},className:"inline-flex items-center px-4 py-2 bg-primary text-white rounded-lg hover:bg-primary-600 transition-colors",children:[e.jsx("svg",{className:"w-4 h-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 10v6m0 0l-3-3m3 3l3-3m2 8H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})}),"Download PDF"]})]})]}):e.jsxs("div",{className:"text-center",children:[e.jsx(Y,{className:"h-16 w-16 text-gray-400 mx-auto mb-4"}),e.jsx("p",{className:"text-gray-600 mb-4",children:"File preview not available for this file type"}),e.jsxs("a",{href:URL.createObjectURL(g.file),download:g.name,className:"inline-flex items-center px-4 py-2 bg-primary text-white rounded-lg hover:bg-primary-600 transition-colors",children:[e.jsx("svg",{className:"w-4 h-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 10v6m0 0l-3-3m3 3l3-3m2 8H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})}),"Download File"]})]})})]}),e.jsx("div",{className:"flex justify-end gap-3 p-6 border-t border-gray-200",children:e.jsx("button",{onClick:de,className:"px-4 py-2 text-gray-700 bg-gray-100 hover:bg-gray-200 rounded-lg transition-colors",children:"Close"})})]})}),ve&&e.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center p-4",style:{zIndex:9999},children:e.jsx("div",{className:"bg-white rounded-xl max-w-md w-full overflow-hidden shadow-2xl",children:e.jsxs("div",{className:"p-8 text-center",children:[e.jsx("div",{className:"mx-auto flex items-center justify-center h-16 w-16 rounded-full bg-green-100 mb-4",children:e.jsx("svg",{className:"h-10 w-10 text-green-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})})}),e.jsx("h3",{className:"text-2xl font-bold text-gray-900 mb-2",children:"Request Submitted Successfully!"}),e.jsx("p",{className:"text-gray-600 mb-6",children:"Your travel request has been submitted. Our team will review it and get back to you shortly."}),e.jsxs("div",{className:"flex items-center justify-center space-x-2 text-sm text-gray-500",children:[e.jsxs("svg",{className:"animate-spin h-4 w-4 text-primary",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[e.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),e.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),e.jsx("span",{children:"Redirecting to inquiries page..."})]})]})})})]}):e.jsx(ue,{children:e.jsx("div",{className:"min-h-screen flex items-center justify-center",children:e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"animate-spin rounded-full h-32 w-32 border-b-2 border-primary mx-auto"}),e.jsx("p",{className:"mt-4 text-gray-600",children:"Loading room selection..."}),e.jsx("p",{className:"mt-2 text-sm text-gray-500",children:"If this takes too long, please go back and try again."})]})})})};export{Ke as default};
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.