PageSourceSearch

https://sprightly-melba-c7eb28.netlify.app/assets/DetailsPage-Cpz14zMq.js

js sprightly-melba-c7eb28.netlify.app collected 2026-10-03 11:27:02 UTC 48,354 bytes, 1 lines download raw bytes

1import{r as Ye}from"./rolldown-runtime-b3L32Ng1.js";import{cn as qe}from"./vendor-lucide-BFy6u6yt.js";import{t as Xe}from"./vendor-react--8d8tp5c.js";import{c as je,l as We,s as Je,u as Ke}from"./chunk-BV7QT456-DE-vnYdj.js";import{n as Qe}from"./AuthContext-CtwjG4ln.js";import{i as be,t as Ze}from"./Header-BMBNNiKU.js";import{t as Z}from"./useTranslation-BHeiaPko.js";import{t as o}from"./Icon-d9ynruow.js";import{a as et,n as tt,t as Q}from"./dateUtils-BFIpacxO.js";import{t as st}from"./ParkingMap-BDsCX5yy.js";import{a as at,c as rt,i as it,l as nt,n as lt,r as ct,t as ot}from"./services-DUgfdBxX.js";import{t as dt}from"./services-PuRtdvYy.js";import{n as mt,t as xt}from"./SignupModal-CsOC0eag.js";var n=Ye(qe(),1),e=Xe(),pt=({images:c=[],locationName:m})=>{const[v,y]=(0,n.useState)(0),b=c&&c.length>0?c:["https://images.unsplash.com/photo-1506521781263-d8422e82f27a?auto=format&fit=crop&w=800&q=80","https://images.unsplash.com/photo-1573348722427-f1d6819fdf98?auto=format&fit=crop&w=800&q=80","https://images.unsplash.com/photo-1590674899484-d5640e854abe?auto=format&fit=crop&w=800&q=80"];return(0,e.jsx)("div",{"data-component":"parking.ParkingGallery",className:"w-full mb-8",children:(0,e.jsx)("div",{className:"flex overflow-x-auto gap-3 pb-2 snap-x snap-mandatory scrollbar-hide lg:grid lg:grid-cols-3 lg:gap-3",children:b.slice(0,4).map((N,D)=>(0,e.jsxs)("div",{className:`relative rounded-[12px] overflow-hidden bg-grey-100 flex-shrink-0 snap-start cursor-pointer border border-grey-100 transition-all ${D===0?"w-[85%] sm:w-[360px] lg:w-full lg:col-span-2 h-[220px] sm:h-[260px] lg:h-[320px]":"w-[65%] sm:w-[260px] lg:w-full h-[220px] sm:h-[260px] lg:h-[155px]"}`,onClick:()=>y(D),children:[(0,e.jsx)("img",{src:N,alt:`${m} photo ${D+1}`,className:"w-full h-full object-cover hover:scale-105 transition-transform duration-300",loading:D===0?"eager":"lazy"}),D===0&&(0,e.jsxs)("div",{className:"absolute top-3 start-3 bg-white/90 backdrop-blur-sm px-2.5 py-1 rounded-full text-xs font-semibold text-grey-500 shadow-subtle flex items-center gap-1.5",children:[(0,e.jsx)(o,{name:"camera",className:"w-3.5 h-3.5 text-secondary-500"}),(0,e.jsxs)("span",{children:[b.length," Photos"]})]})]},D))})})},ht=({location:c})=>{const{t:m}=Z(),v=[{id:"covered",name:m("parkingDetails.features.covered","Covered Parking"),desc:m("parkingDetails.features.coveredDesc","Protected from direct sunlight and rain"),icon:"shield",active:!0},{id:"cctv",name:m("parkingDetails.features.cctv","24/7 Security & CCTV"),desc:m("parkingDetails.features.cctvDesc","Continuously monitored security perimeter"),icon:"camera",active:!0},{id:"valet",name:m("parkingDetails.features.valet","Valet Service Available"),desc:m("parkingDetails.features.valetDesc","Professional parking assistance at entry"),icon:"key",active:!!c.has_valet},{id:"ev",name:m("parkingDetails.features.ev","EV Charging Station"),desc:m("parkingDetails.features.evDesc","Electric vehicle charging points on-site"),icon:"zap",active:!!c.has_ev_charging},{id:"accessible",name:m("parkingDetails.features.accessible","Accessible Parking"),desc:m("parkingDetails.features.accessibleDesc","Dedicated wide spots near entryways"),icon:"heart",active:!0}];return(0,e.jsxs)("div",{"data-component":"parking.ParkingFeatures",className:"space-y-6",children:[(0,e.jsxs)("div",{children:[(0,e.jsx)("h3",{className:"text-xl font-medium text-grey-500 mb-1",children:m("parkingDetails.features.title","Features & Amenities")}),(0,e.jsx)("p",{className:"text-sm text-grey-300",children:m("parkingDetails.features.subtitle","Verified garage services and facilities")})]}),(0,e.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:v.filter(y=>y.active).map(y=>(0,e.jsxs)("div",{className:"p-4 rounded-[12px] bg-white border border-grey-100 flex items-start gap-3 shadow-subtle",children:[(0,e.jsx)("div",{className:"w-9 h-9 rounded-full bg-secondary-200/60 flex items-center justify-center flex-shrink-0 text-secondary-500",children:(0,e.jsx)(o,{name:y.icon,size:18})}),(0,e.jsxs)("div",{children:[(0,e.jsx)("h4",{className:"text-sm font-semibold text-grey-500",children:y.name}),(0,e.jsx)("p",{className:"text-xs text-grey-300 mt-0.5",children:y.desc})]})]},y.id))}),(0,e.jsxs)("div",{className:"p-4 rounded-[12px] bg-grey-50 border border-grey-100 flex items-center justify-between text-sm",children:[(0,e.jsxs)("div",{className:"flex items-center gap-3",children:[(0,e.jsx)("div",{className:"w-8 h-8 rounded-full bg-grey-100 flex items-center justify-center text-grey-400",children:(0,e.jsx)(o,{name:"truck",size:16})}),(0,e.jsxs)("div",{children:[(0,e.jsx)("span",{className:"font-semibold text-grey-500 block",children:m("parkingDetails.maxHeight","Maximum vehicle height")}),(0,e.jsx)("span",{className:"text-xs text-grey-300",children:m("parkingDetails.heightCheck","Ensure your car meets the entrance clearance")})]})]}),(0,e.jsx)("span",{className:"font-bold text-base text-grey-500 bg-white px-3 py-1 rounded-[8px] border border-grey-100",children:"2.40 m"})]})]})},ut=({arrivalDate:c,arrivalTime:m,departureDate:v,departureTime:y,onArrivalDateChange:b,onArrivalTimeChange:N,onDepartureDateChange:D,onDepartureTimeChange:A,products:i,selectedProduct:r,onSelectProduct:G,priceCalculation:g,isCalculatingPrice:w,onCheckout:T})=>{const{t:u}=Z(),S=g?Number(g.final_price):0,P=g?Number(g.base_price):0,$=g?.surge_multiplier&&g.surge_multiplier>1?g.surge_multiplier:1,L=g?.vat_amount!==void 0?Number(g.vat_amount):Number((P*.14).toFixed(2)),F=g?.service_fee!==void 0?Number(g.service_fee):5;return(0,e.jsxs)("div",{"data-component":"parking.ParkingPricingCard",className:"bg-white rounded-[12px] p-6 border border-grey-100 shadow-raised space-y-6 sticky top-24",children:[(0,e.jsxs)("div",{className:"flex items-center justify-between pb-4 border-b border-grey-100",children:[(0,e.jsxs)("div",{children:[(0,e.jsx)("span",{className:"text-xs text-grey-300 font-medium block",children:u("parkingDetails.pricing.guaranteedSpot","Guaranteed Space Reservation")}),(0,e.jsx)("h3",{className:"text-2xl font-bold text-primary-500 tracking-tight mt-0.5",children:w?(0,e.jsx)("span",{className:"inline-block w-24 h-7 bg-grey-100 rounded-md animate-pulse"}):(0,e.jsxs)(e.Fragment,{children:[S.toFixed(2)," ",(0,e.jsx)("span",{className:"text-sm font-semibold text-grey-500",children:u("common.egp","EGP")})]})}),(0,e.jsx)("span",{className:"text-[11px] text-grey-300 block",children:u("checkout.vatIncluded","Includes 14% VAT")})]}),(0,e.jsx)("div",{className:"text-end",children:(0,e.jsxs)("span",{className:"inline-flex items-center text-[11px] font-semibold text-emerald-600 bg-emerald-50 px-2.5 py-1 rounded-full border border-emerald-100",children:[(0,e.jsx)(o,{name:"check",size:12,className:"me-1"}
1),u("checkout.freeCancellation","Free cancellation")]})})]}),(0,e.jsxs)("div",{className:"space-y-3",children:[(0,e.jsxs)("div",{className:"space-y-1",children:[(0,e.jsx)("label",{htmlFor:"pricing-entry-datetime",className:"text-xs font-semibold text-grey-400 block",children:u("parkingDetails.pricing.arrival","Entry Date & Time")}),(0,e.jsx)(be,{id:"pricing-entry-datetime",name:"pricing_entry_datetime",ariaLabel:u("parkingDetails.pricing.arrival","Entry Date & Time"),dateValue:c,timeValue:m,onDateChange:b,onTimeChange:N})]}),(0,e.jsxs)("div",{className:"space-y-1",children:[(0,e.jsx)("label",{htmlFor:"pricing-exit-datetime",className:"text-xs font-semibold text-grey-400 block",children:u("parkingDetails.pricing.departure","Exit Date & Time")}),(0,e.jsx)(be,{id:"pricing-exit-datetime",name:"pricing_exit_datetime",ariaLabel:u("parkingDetails.pricing.departure","Exit Date & Time"),dateValue:v,timeValue:y,onDateChange:D,onTimeChange:A})]})]}),i&&i.length>0&&(0,e.jsxs)("div",{className:"space-y-2 pt-2 border-t border-grey-100",children:[(0,e.jsx)("label",{className:"text-xs font-semibold text-grey-400 block",children:u("parkingDetails.pricing.selectPass","Pass Type")}),(0,e.jsx)("div",{className:"grid grid-cols-1 gap-2",children:i.map(k=>{const j=r===k.id||!r&&k.id==="default-pass";return(0,e.jsxs)("button",{type:"button",onClick:()=>G(k.id),className:`w-full p-3 rounded-[8px] text-start flex items-center justify-between border transition-all ${j?"bg-secondary-200/40 border-secondary-500":"bg-white border-grey-100 hover:border-grey-200"}`,children:[(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)("div",{className:`w-3.5 h-3.5 rounded-full border flex items-center justify-center ${j?"border-primary-500 bg-primary-500":"border-grey-300 bg-white"}`,children:j&&(0,e.jsx)("div",{className:"w-1.5 h-1.5 rounded-full bg-white"})}),(0,e.jsx)("span",{className:"text-xs font-semibold text-grey-500",children:k.title||"Standard Pass"})]}),(0,e.jsx)("span",{className:"text-xs font-bold text-grey-500",children:k.price_per_day?`${k.price_per_day} EGP/day`:"Standard Rate"})]},k.id)})})]}),g&&(0,e.jsxs)("div",{className:"p-3.5 rounded-[8px] bg-grey-50 border border-grey-100 space-y-2 text-xs",children:[(0,e.jsxs)("div",{className:"flex justify-between text-grey-400",children:[(0,e.jsxs)("span",{children:[u("checkout.baseRate","Base Rate"),":"]}),(0,e.jsxs)("span",{className:"font-semibold text-grey-500",children:[P.toFixed(2)," EGP"]})]}),$>1&&(0,e.jsxs)("div",{className:"flex justify-between text-amber-600",children:[(0,e.jsxs)("span",{className:"flex items-center gap-1",children:[(0,e.jsx)(o,{name:"zap",size:12}),u("checkout.surgeMultiplier","Peak Demand Surge"),":"]}),(0,e.jsxs)("span",{className:"font-semibold",children:[$.toFixed(2),"x"]})]}),(0,e.jsxs)("div",{className:"flex justify-between text-grey-400",children:[(0,e.jsxs)("span",{children:[u("checkout.vat","14% VAT"),":"]}),(0,e.jsxs)("span",{className:"font-semibold text-grey-500",children:[L.toFixed(2)," EGP"]})]}),(0,e.jsxs)("div",{className:"flex justify-between text-grey-400",children:[(0,e.jsxs)("span",{children:[u("checkout.platformFee","Platform Fee"),":"]}),(0,e.jsxs)("span",{className:"font-semibold text-grey-500",children:[F.toFixed(2)," EGP"]})]}),(0,e.jsxs)("div",{className:"pt-2 border-t border-grey-100 flex justify-between font-bold text-grey-500 text-sm",children:[(0,e.jsxs)("span",{children:[u("checkout.total","Total"),":"]}),(0,e.jsxs)("span",{className:"text-primary-500",children:[S.toFixed(2)," EGP"]})]})]}),(0,e.jsxs)("button",{onClick:T,disabled:w||!g,className:"w-full bg-primary-500 hover:bg-primary-600 active:scale-98 text-white font-semibold text-base py-4 rounded-[16px] h-14 shadow-subtle transition-all flex items-center justify-center gap-2 disabled:opacity-50 disabled:cursor-not-allowed cursor-pointer",children:[(0,e.jsx)("span",{children:u("parkingDetails.bookNow","Book Spot Now")}),(0,e.jsx)(o,{name:"arrowRight",size:18})]}),(0,e.jsxs)("div",{className:"flex items-center justify-center gap-2 text-[11px] text-grey-300 pt-1",children:[(0,e.jsx)(o,{name:"shield",size:14,className:"text-secondary-500"}),(0,e.jsx)("span",{children:"Paymob Verified • Instant Reservation"})]})]})},gt=({reviews:c,rating:m=4.8,totalReviews:v=0,isAuthenticated:y,canReview:b,hasReviewed:N,reviewRating:D,reviewComment:A,reviewSubmitting:i,reviewError:r,reviewSuccess:G,reviewsLoading:g,reviewsPage:w,reviewsPerPage:T,onPageChange:u,onRatingChange:S,onCommentChange:P,onSubmitReview:$,onOpenLoginModal:L})=>{const{t:F}=Z(),k=Math.ceil(c.length/T),j=c.slice((w-1)*T,w*T);return(0,e.jsxs)("div",{"data-component":"parking.ParkingReviewsSection",className:"space-y-8 pt-8 border-t border-grey-100",children:[(0,e.jsx)("h2",{className:"text-xl font-medium text-grey-500",children:F("parkingDetails.reviews.title","Customer Reviews")}),(0,e.jsxs)("div",{className:"flex flex-col items-center justify-center p-6 bg-grey-50 rounded-[12px] border border-grey-100",children:[(0,e.jsxs)("div",{className:"text-5xl font-bold text-grey-500 mb-2 flex items-center",children:[m?Number(m).toFixed(1):"5.0",(0,e.jsx)("span",{className:"inline-flex items-center space-x-1 ms-4 text-[#F59E0B]",children:[1,2,3,4,5].map(d=>(0,e.jsx)(o,{name:"star",className:`w-6 h-6 ${d<=Math.round(m||5)?"fill-[#F59
1E0B] text-[#F59E0B]":"text-grey-300"}`},d))})]}),(0,e.jsx)("div",{className:"text-sm text-grey-300 font-medium",children:F("parkingDetails.reviews.basedOn",{count:v||c.length})})]}),(0,e.jsxs)("div",{className:"border-t border-b border-grey-100 py-6 flex items-center justify-around",children:[(0,e.jsxs)("div",{className:"flex flex-col items-center",children:[(0,e.jsx)("div",{className:"flex text-grey-500 space-x-1 mb-1",children:[1,2,3,4,5].map(d=>(0,e.jsx)(o,{name:"star",className:`w-4 h-4 ${d<=4?"fill-[#F59E0B] text-[#F59E0B]":"text-grey-300"}`},d))}),(0,e.jsx)("span",{className:"text-xs text-grey-400 font-medium",children:"Access"})]}),(0,e.jsxs)("div",{className:"flex flex-col items-center",children:[(0,e.jsx)("div",{className:"flex text-grey-500 space-x-1 mb-1",children:[1,2,3,4,5].map(d=>(0,e.jsx)(o,{name:"star",className:"w-4 h-4 fill-[#F59E0B] text-[#F59E0B]"},d))}),(0,e.jsx)("span",{className:"text-xs text-grey-400 font-medium",children:"Facilities"})]}),(0,e.jsxs)("div",{className:"flex flex-col items-center",children:[(0,e.jsx)("div",{className:"flex text-grey-500 space-x-1 mb-1",children:[1,2,3,4,5].map(d=>(0,e.jsx)(o,{name:"star",className:`w-4 h-4 ${d<=4?"fill-[#F59E0B] text-[#F59E0B]":"text-grey-300"}`},d))}),(0,e.jsx)("span",{className:"text-xs text-grey-400 font-medium",children:"Staff"})]})]}),y&&b&&!N&&(0,e.jsxs)("form",{onSubmit:$,className:"bg-white rounded-[12px] p-6 border border-grey-200 shadow-subtle space-y-4",children:[(0,e.jsx)("h3",{className:"font-semibold text-grey-500 text-base",children:"Share Your Experience"}),(0,e.jsxs)("div",{className:"flex items-center gap-3",children:[(0,e.jsx)("span",{className:"text-sm text-grey-400 font-medium",children:"Rating:"}),(0,e.jsx)("div",{className:"flex gap-1",children:[1,2,3,4,5].map(d=>(0,e.jsx)("button",{type:"button",onClick:()=>S(d),className:"p-1 focus:outline-none focus:ring-2 focus:ring-primary-500/20 rounded-md transition-transform active:scale-95",children:(0,e.jsx)(o,{name:"star",className:`w-7 h-7 transition-colors ${d<=D?"fill-[#F59E0B] text-[#F59E0B]":"text-grey-300"}`})},d))})]}),(0,e.jsx)("textarea",{value:A,onChange:d=>P(d.target.value),rows:3,placeholder:"Tell other drivers about your parking experience...",className:"w-full border border-grey-200 rounded-[8px] px-4 py-3 text-sm text-grey-500 focus:outline-none focus:border-primary-500 focus:ring-2 focus:ring-primary-500/10 transition-all resize-none"}),r&&(0,e.jsx)("p",{className:"text-sm text-error-500 font-medium",children:r}),G&&(0,e.jsx)("p",{className:"text-sm text-green-600 font-medium",children:"✓ Review submitted successfully — thank you!"}),(0,e.jsx)("button",{type:"submit",disabled:i,className:"bg-primary-500 hover:bg-primary-400 disabled:opacity-50 text-white font-medium py-3 px-8 rounded-[8px] transition-colors text-sm min-h-[44px]",children:i?"Submitting…":"Submit Review"})]}),!y&&(0,e.jsxs)("div",{className:"bg-grey-50 rounded-[12px] p-6 text-center border border-grey-100",children:[(0,e.jsxs)("p",{className:"text-sm text-grey-400 mb-3",children:["Have you visited this parking location? ",(0,e.jsx)("strong",{children:"Log in"})," to share your verified review."]}),(0,e.jsx)("button",{onClick:L,className:"text-primary-500 font-semibold text-sm hover:text-primary-600 transition-colors",children:"Log in to write a review"})]}),g?(0,e.jsx)("div",{className:"space-y-4",children:[1,2,3].map(d=>(0,e.jsx)("div",{className:"h-24 rounded-[12px] bg-grey-50 border border-grey-100 animate-pulse"},d))}):c.length===0?(0,e.jsx)("div",{className:"p-8 text-center bg-grey-50 rounded-[12px] border border-grey-100",children:(0,e.jsx)("p",{className:"text-sm text-grey-300 italic",children:F("parkingDetails.reviews.empty","No reviews yet. Be the first to park and leave a review!")})}):(0,e.jsxs)("div",{className:"space-y-4",children:[j.map(d=>{const f=d.profiles?.first_name?`${d.profiles.first_name} ${d.profiles.last_name?d.profiles.last_name[0]+".":""}`:"Verified Driver",W=d.review_text;return(0,e.jsxs)("div",{className:"p-5 rounded-[12px] bg-white border border-grey-100 shadow-subtle space-y-2",children:[(0,e.jsxs)("div",{className:"flex items-center justify-between",children:[(0,e.jsxs)("div",{className:"flex items-center gap-3",children:[(0,e.jsx)("div",{className:"w-9 h-9 rounded-full bg-secondary-200/60 text-secondary-500 flex items-center justify-center font-bold text-xs",children:f.charAt(0).toUpperCase()}),(0,e.jsxs)("div",{children:[(0,e.jsx)("div",{className:"text-sm font-semibold text-grey-500",children:f}),(0,e.jsx)("div",{className:"text-xs text-grey-300",children:new Date(d.created_at).toLocaleDateString("en-GB",{day:"2-digit",month:"short",year:"numeric"})})]})]}),(0,e.jsx)("div",{className:"flex text-[#F59E0B] space-x-0.5",children:[1,2,3,4,5].map(E=>(0,e.jsx)(o,{name:"star",className:`w-4 h-4 ${E<=d.rating?"fill-[#F59
1E0B] text-[#F59E0B]":"text-grey-300"}`},E))})]}),W&&(0,e.jsx)("p",{className:"text-sm text-grey-400 leading-relaxed pt-1 whitespace-pre-line",children:W})]},d.id)}),k>1&&(0,e.jsxs)("div",{className:"flex items-center justify-center space-x-4 pt-6",children:[(0,e.jsx)("button",{onClick:()=>u(Math.max(1,w-1)),disabled:w===1,className:`text-sm font-medium transition-colors px-3 py-1.5 rounded-md ${w===1?"text-grey-300 cursor-not-allowed":"text-grey-400 hover:text-primary-500 hover:bg-grey-50"}`,children:"Previous"}),(0,e.jsx)("div",{className:"flex space-x-1",children:Array.from({length:k}).map((d,f)=>(0,e.jsx)("button",{onClick:()=>u(f+1),className:`w-8 h-8 flex items-center justify-center text-sm font-medium rounded-md transition-colors ${w===f+1?"bg-primary-500 text-white font-semibold":"text-grey-500 hover:bg-grey-50"}`,children:f+1},f))}),(0,e.jsx)("button",{onClick:()=>u(Math.min(k,w+1)),disabled:w===k,className:`text-sm font-medium transition-colors px-3 py-1.5 rounded-md ${w===k?"text-grey-300 cursor-not-allowed":"text-grey-400 hover:text-primary-500 hover:bg-grey-50"}`,children:"Next"})]})]})]})},ft=({locationId:c,onBack:m,initialParams:v})=>{const y=je(),{user:b,isAuthenticated:N,addFavoriteLocation:D,removeFavoriteLocation:A}=Qe(),{t:i}=Z(),[r,G]=(0,n.useState)(null),[g,w]=(0,n.useState)(!0),[T,u]=(0,n.useState)(null),[S]=Ke(),P=S.get("date")||v?.date||et(),$=S.get("start_time")||v?.startTime||tt(),L=Q(P,$,1),F=S.get("end_date")||L.date,k=S.get("end_time")||v?.endTime||L.time,[j,d]=(0,n.useState)(P),[f,W]=(0,n.useState)($),[E,O]=(0,n.useState)(F),[R,U]=(0,n.useState)(k),ve=t=>{d(t);const s=Q(t,f,1);O(s.date),U(s.time)},Ne=t=>{W(t);const s=Q(j,t,1);O(s.date),U(s.time)}
1,[we,V]=(0,n.useState)(!1),[ke,ee]=(0,n.useState)(!1),[te,z]=(0,n.useState)(!1),[_,re]=(0,n.useState)([]),[h,H]=(0,n.useState)(null),[De,se]=(0,n.useState)(!1),[M,ie]=(0,n.useState)("One pass"),[Y,ae]=(0,n.useState)(null),[ne,le]=(0,n.useState)(!1),[J,ce]=(0,n.useState)("summary"),[q,_e]=(0,n.useState)(!1),[X,Se]=(0,n.useState)(!1),[Ee,Te]=(0,n.useState)([]),[Ce,oe]=(0,n.useState)(!1),[de,me]=(0,n.useState)(5),[xe,pe]=(0,n.useState)(""),[Pe,he]=(0,n.useState)(!1),[$e,ue]=(0,n.useState)(null),[Fe,Ie]=(0,n.useState)(!1),[Le,ge]=(0,n.useState)(!1),[Re,Me]=(0,n.useState)(!1),[Be,Ae]=(0,n.useState)(1),[Ge,Oe]=(0,n.useState)(null),Ue=3;(0,n.useEffect)(()=>{const t=new IntersectionObserver(a=>{a.forEach(l=>{if(l.isIntersecting&&l.intersectionRatio>0){const x=l.target.id.replace("section-","");ce(x)}})},{rootMargin:"-150px 0px 0px 0px",threshold:.1}),s=document.querySelectorAll('section[id^="section-"]');return s.forEach(a=>t.observe(a)),()=>s.forEach(a=>t.unobserve(a))},[g]);const K=t=>{ce(t);const s=document.getElementById(`section-${t}`);s&&s.scrollIntoView({behavior:"smooth"})};(0,n.useEffect)(()=>{Ve(),fe()},[c]),(0,n.useEffect)(()=>{if(!j||!f||!h||!_.length)return;let t=null,s=0;if(h!=="default-pass")if(h.includes("_")){const[a,l]=h.split("_");t=a,s=parseInt(l,10)}else t=h;if(t){const a=_.find(l=>l.id===t);if(a&&a.pricing_tiers){const l=a.pricing_tiers[s||0];if(l&&l.duration){const x=Number(l.duration),p=Q(j,f,x);(E!==p.date||R!==p.time)&&(O(p.date),U(p.time))}}}},[h,_,j,f]),(0,n.useEffect)(()=>{if(!c||!j||!f||!E||!R)return;let t=null,s=0;if(h&&h!=="default-pass")if(h.includes("_")){const[C,I]=h.split("_");t=C,s=parseInt(I,10)}else t=h;const a=`${j}T${f}:00`,l=`${E}T${R}:00`;le(!0);let x,p;if(t&&_){const C=_.find(I=>I.id===t);if(C&&C.pricing_tiers){const I=C.pricing_tiers[s||0];I&&(x=Number(I.price),p=Number(I.duration))}}else r?.min_price_per_hour&&(x=Number(r.min_price_per_hour));const B=x?{basePrice:x,durationHours:p||1}:void 0;dt(c,v?.spotType||"regular",a,l,t,s,B).then(C=>{C.ok?ae(C.data):ae(null)}).catch(()=>ae(null)).finally(()=>le(!1))},[c,j,f,E,R,h,v?.spotType]),(0,n.useEffect)(()=>{if(!N||!b){ge(!1);return}(async()=>{const s=await ot(c);ge(!!s),s&&Oe(s)})()},[N,b,c]);const Ve=async()=>{w(!0),u(null);try{const{data:t,error:s}=await ct(c);if(s)throw s;if(!t)throw new Error("Parking location not found.");G(t);try{const a=await lt(c);console.log("DEBUG: getLocationProducts returned",a);const{data:l}=a;l&&l.length>0?(console.log("DEBUG: Setting products"),re(l),H(null)):(console.log("DEBUG: Setting default product"),re([{id:"default-pass",title:"Standard Pass",price_per_day:t.hourly_rate?t.hourly_rate*24:120}]),H("default-pass"))}catch(a){console.error("Failed to load products",a)}}catch{u("Failed to load parking details.")}finally{w(!1)}},fe=async()=>{oe(!0);try{const{data:t}=await it(c);Te(t||[]),b&&Me((t||[]).some(s=>s.user_id===b.id))}catch(t){console.error("Failed to load reviews",t)}finally{oe(!1)}},ze=async t=>{if(t.preventDefault(),!N){V(!0);return}he(!0),ue(null);try{const{error:s}=await rt(c,Ge||"",de,xe);if(s)throw new Error(s.message||"Failed to submit review.");Ie(!0),pe(""),me(5),await fe()}catch(s){ue(s.message||"Failed to submit review. Please ensure you have a confirmed booking.")}finally{he(!1)}};(0,n.useEffect)(()=>{N&&b?.favoriteLocations?z(b.favoriteLocations.some(t=>t.location_id===c)):z(at(c))},[N,b?.favoriteLocations,c]);const He=async()=>{if(!N){const t=nt(c);z(t);return}try{if(te){const t=b?.favoriteLocations?.find(s=>s.location_id===c);t&&t.id&&await A(t.id),z(!1)}else r&&(await D({location_id:r.id,name:r.name,address:r.address||"",type:"custom",coordinates:[r.latitude||0,r.longitude||0],averagePrice:25}),z(!0))}catch(t){console.error("Error toggling favorite:",t)}},ye=()=>{const t=new URLSearchParams(S);if(t.set("date",j),t.set("start_time",f),t.set("end_date",E),t.set("end_time",R),h&&h!=="default-pass")if(h.includes("_")){const[s,a]=h.split("_");t.set("product_id",s),t.set("tier_index",a)}else t.set("product_id",h),t.set("tier_index","0");y({pathname:`/checkout/${c}`,search:t.toString()})};return g?(0,e.jsx)("div",{className:"min-h-[100dvh] flex flex-col bg-white pt-16 sm:pt-20",children:(0,e.jsx)("div",{className:"max-w-[1152px] mx-auto px-4 sm:px-6 lg:px-8 py-8 w-full",children:(0,e.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-8",children:[(0,e.jsxs)("div",{className:"lg:col-span-2 space-y-6",children:[(0,e.jsx)("div",{className:"h-6 w-48 rounded-full animate-shimmer"}
1),(0,e.jsx)("div",{className:"h-10 w-64 rounded-full animate-shimmer"}),(0,e.jsx)("div",{className:"rounded-2xl overflow-hidden aspect-video w-full animate-shimmer"})]}),(0,e.jsx)("div",{className:"hidden lg:block",children:(0,e.jsxs)("div",{className:"bg-white rounded-3xl p-6 border border-grey-100 shadow-xl space-y-4",children:[(0,e.jsx)("div",{className:"h-7 w-48 rounded-full animate-shimmer"}),[1,2,3,4].map(t=>(0,e.jsx)("div",{className:"h-12 rounded-xl animate-shimmer",style:{animationDelay:`${t*80}ms`}},t)),(0,e.jsx)("div",{className:"h-14 rounded-full animate-shimmer"})]})})]})})}):T||!r?(0,e.jsx)("div",{className:"p-8 text-center text-error-500",children:T||"Location not found"}):(0,e.jsxs)("div",{"data-component":"driver.ParkingDetailsPage",className:"app-parking-detail min-h-[100dvh] bg-white font-sans",children:[(0,e.jsxs)("main",{className:"container mx-auto px-4 sm:px-6 lg:px-8 pt-20 sm:pt-24 lg:pt-28 pb-28 lg:pb-12 flex flex-col lg:flex-row gap-12 relative",children:[(0,e.jsxs)("section",{className:"w-full lg:w-3/5 xl:w-8/12",children:[(0,e.jsxs)("div",{className:"flex items-center text-sm text-grey-300 mb-6 space-x-2",children:[(0,e.jsx)("span",{className:"cursor-pointer hover:text-primary-500 transition-colors",onClick:m,children:i("parkingDetails.breadcrumbs.home")}),(0,e.jsx)(o,{name:"chevronRight",className:"w-4 h-4"}),(0,e.jsx)("span",{className:"cursor-pointer hover:text-primary-500 transition-colors",onClick:m,children:i("parkingDetails.breadcrumbs.parking")}),(0,e.jsx)(o,{name:"chevronRight",className:"w-4 h-4"}),(0,e.jsx)("span",{className:"cursor-pointer hover:text-primary-500 transition-colors",onClick:m,children:i("parkingDetails.breadcrumbs.parkingIn",{city:r.city_name||"Cairo"})}),(0,e.jsx)(o,{name:"chevronRight",className:"w-4 h-4"}),(0,e.jsx)("span",{className:"text-grey-500 font-medium truncate",children:r.name})]}),(0,e.jsxs)("div",{className:"flex items-start justify-between mb-6",children:[(0,e.jsxs)("div",{children:[(0,e.jsx)("h1",{className:"text-3xl font-medium text-grey-500 mb-2",children:r.name}),(0,e.jsx)("p",{className:"text-grey-300 mb-3 text-sm",children:r.address}),(0,e.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,e.jsxs)("span",{className:"bg-[#FFF4E5] text-[#F59E0B] text-xs font-medium px-2 py-0.5 rounded-xl flex items-center",children:[r.rating," ",(0,e.jsx)(o,{name:"star",className:"w-3 h-3 ms-1 fill-current"})]}),(0,e.jsx)("span",{className:"text-sm text-grey-300 cursor-pointer hover:text-grey-500 transition-colors ms-2",children:i("parkingDetails.rating.readReviews",{count:r.total_reviews})})]})]}),(0,e.jsx)("button",{onClick:He,"aria-label":te?"Remove from favorites":"Add to favorites",className:"p-2.5 rounded-full border border-grey-100 hover:bg-grey-50 transition-colors",children:(0,e.jsx)(o,{name:"heart",className:`h-6 w-6 transition-colors ${te?"fill-error-500 text-error-500":"text-grey-300"}`})})]}),(0,e.jsx)(pt,{images:r.images,locationName:r.name}),(0,e.jsxs)("div",{className:"space-y-12 relative",children:[(0,e.jsx)("div",{className:"hidden lg:block sticky top-16 bg-white z-[9] pt-4 mb-4",children:(0,e.jsxs)("nav",{className:"w-full overflow-x-auto no-scrollbar items-end flex theme-tab border-b border-grey-100",children:[(0,e.jsx)("div",{className:"inline-block",children:(0,e.jsx)("button",{type:"button",onClick:()=>K("summary"),className:`flex gap-2 justify-center items-center px-4 pb-2 transition-colors duration-150 border-b-[3px] ${J==="summary"?"border-primary-500 text-primary-500 font-medium":"border-transparent text-grey-500 font-normal"} text-sm`,children:(0,e.jsx)("span",{children:"Summary"})})}),(0,e.jsx)("div",{className:"inline-block",children:(0,e.jsx)("button",{type:"button",onClick:()=>K("details"),className:`flex gap-2 justify-center items-center px-4 pb-2 transition-colors duration-150 border-b-[3px] ${J==="details"?"border-primary-500 text-primary-500 font-medium":"border-transparent text-grey-500 font-normal"} text-sm`,children:(0,e.jsx)("span",{children:"Details"})})}),(0,e.jsx)("div",{className:"inline-block",children:(0,e.jsx)("button",{type:"button",onClick:()=>
1K("how-to"),className:`flex gap-2 justify-center items-center px-4 pb-2 transition-colors duration-150 border-b-[3px] ${J==="how-to"?"border-primary-500 text-primary-500 font-medium":"border-transparent text-grey-500 font-normal"} text-sm whitespace-nowrap`,children:(0,e.jsx)("span",{children:"How to get there"})})}),(0,e.jsx)("div",{className:"inline-block",children:(0,e.jsx)("button",{type:"button",onClick:()=>K("products"),className:`flex gap-2 justify-center items-center px-4 pb-2 transition-colors duration-150 border-b-[3px] ${J==="products"?"border-primary-500 text-primary-500 font-medium":"border-transparent text-grey-500 font-normal"} text-sm`,children:(0,e.jsx)("span",{children:"Products"})})})]})}),(0,e.jsxs)("section",{id:"section-summary",className:"space-y-12",children:[(0,e.jsxs)("div",{className:"bg-grey-50 p-4 rounded-xl flex items-start space-x-3 text-sm text-grey-500",children:[(0,e.jsx)(o,{name:"alertCircle",className:"w-5 h-5 text-grey-500 flex-shrink-0 mt-0.5"}),(0,e.jsxs)("div",{children:[(0,e.jsx)("span",{className:"font-medium",children:i("parkingDetails.importantInfo.title")})," ",i("parkingDetails.importantInfo.valetNote")]})]}),(0,e.jsxs)("div",{children:[(0,e.jsx)("h2",{className:"text-xl font-medium text-grey-500 mb-6",children:"Accepted vehicle size"}),(0,e.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-y-6 gap-x-4",children:["motorcycle","small_car","medium_car","large_car","van","large_van"].map(t=>{const s=r.available_spot_types?.some(x=>x.spot_type===t),a=t.replace("_"," ").replace(/\b\w/g,x=>x.toUpperCase());let l="car";return t==="motorcycle"&&(l="bike"),t.includes("van")&&(l="caravan"),(0,e.jsxs)("div",{className:`flex items-center space-x-2 text-sm ${s?"text-grey-400":"text-grey-300"}`,children:[(0,e.jsx)(o,{name:l,className:`w-5 h-5 flex-shrink-0 ${s?"text-grey-500":"text-grey-300"}`}),(0,e.jsx)("span",{className:"flex-1",children:a}),(0,e.jsx)(o,{name:"info",className:`w-4 h-4 text-white cursor-pointer ${s?"fill-grey-500":"fill-grey-400"}`}),s?(0,e.jsx)(o,{name:"check",className:"w-4 h-4 text-green-500",strokeWidth:3}):(0,e.jsx)(o,{name:"x",className:"w-4 h-4 text-primary-500",strokeWidth:3})]},t)})})]}),(0,e.jsxs)("div",{children:[(0,e.jsx)("h2",{className:"text-xl font-medium text-grey-500 mb-4",children:i("parkingDetails.carParkHours.title")}),(()=>{const t=r.operating_hours;return t?t.type==="24/7"?(0,e.jsx)("div",{className:"text-sm text-grey-500",children:"Open 24 hours a day"}):t.type==="same_hours"?(0,e.jsxs)("div",{className:"text-sm text-grey-500",children:["Every day: ",t.open," - ",t.close]}):t.type==="custom"&&t.schedule?(0,e.jsx)("div",{className:"grid grid-cols-[120px_1fr] gap-y-2 text-sm text-grey-500 capitalize",children:Object.entries(t.schedule).map(([s,a])=>(0,e.jsxs)(n.Fragment,{children:[(0,e.jsx)("div",{children:s}),(0,e.jsx)("div",{children:a.isClosed?"Closed":`${a.open} - ${a.close}`})]},s))}):(0,e.jsx)("div",{className:"text-sm text-grey-500",children:"Not specified"}):(0,e.jsx)("div",{className:"text-sm text-grey-500",children:"Not specified"})})()]})]}),(0,e.jsxs)("section",{id:"section-details",className:"space-y-12",children:[(0,e.jsxs)("div",{children:[(0,e.jsx)("h2",{className:"text-xl font-medium text-grey-500 mb-4",children:i("parkingDetails.details.title")}),(0,e.jsx)("div",{className:"flex flex-wrap gap-2 mb-6",children:r.features?.slice(0,5).map((t,s)=>(0,e.jsxs)("div",{className:"flex items-center gap-1.5 px-3 py-1.5 rounded-full bg-grey-50 text-xs text-grey-500 font-medium border border-grey-100",title:t,children:[(0,e.jsx)(o,{name:"check",className:"w-3.5 h-3.5 text-primary-500"}),(0,e.jsx)("span",{className:"capitalize",children:t.replace(/_/g," ")})]},s))}),(0,e.jsxs)("div",{className:`relative overflow-hidden transition-[max-height] duration-500 ease-in-out ${q?"max-h-[1000px]":"max-h-[120px]"}`,children:[(0,e.jsx)("p",{className:"text-sm text-grey-500 leading-relaxed max-w-3xl whitespace-pre-wrap",children:r.description||i("parkingDetails.details.description",{city:r.city_name||"Cairo",name:r.name})}),!q&&(0,e.jsx)("div",{className:"absolute bottom-0 left-0 w-full h-12 flex items-end justify-center bg-gradient-to-t from-white to-transparent pointer-events-none"})]}),(0,e.jsxs)("button",{onClick:()=>_e(!q),className:"flex items-center justify-center gap-2 text-secondary-500 text-sm font-medium mt
1-3",children:[q?i("parkingDetails.details.seeLess","See less"):i("parkingDetails.details.seeMore"),(0,e.jsx)(o,{name:"chevronDown",className:`w-4 h-4 transition-transform duration-300 ${q?"rotate-180":""}`})]})]}),(0,e.jsx)(ht,{location:r})]}),(0,e.jsx)("section",{id:"section-how-to",className:"space-y-12",children:(0,e.jsxs)("div",{children:[(0,e.jsx)("h2",{className:"text-xl font-medium text-grey-500 mb-6",children:i("parkingDetails.howToGetThere.title")}),(0,e.jsxs)("p",{className:"text-sm font-medium text-grey-500 mb-4",children:[r.name,(0,e.jsx)("br",{}),(0,e.jsx)("span",{className:"font-normal text-grey-300",children:r.address})]}),(0,e.jsxs)("div",{className:"bg-[#EBECE8] h-48 rounded-2xl relative overflow-hidden mb-6 group",children:[r.latitude&&r.longitude?(0,e.jsxs)("div",{className:"absolute inset-0 z-0",children:[(0,e.jsx)(st,{parkingSpots:[{id:r.id,name:r.name,address:r.address,latitude:r.latitude,longitude:r.longitude,min_price_per_hour:r.min_price_per_hour||0,exact_price:Y?.final_price,rating:r.rating||0,total_reviews:r.total_reviews||0,images:r.images||[],features:r.features||[],available_spots:r.available_spots||0,has_availability:r.has_availability??!0}],center:[r.latitude,r.longitude],freshSearch:!0,durationLabel:Y?.duration_hours?`${Y.duration_hours} hours`:"1 hour"}),(0,e.jsx)("div",{className:"absolute inset-0 pointer-events-none bg-black/5 group-hover:bg-transparent transition-colors z-10"})]}):(0,e.jsx)("img",{src:"https://placehold.co/800x400/EBECE8/EBECE8?text=Map+Background",className:"absolute inset-0 w-full h-full object-cover opacity-50",alt:"Map"}),(0,e.jsxs)("button",{onClick:t=>{t.stopPropagation(),r.latitude&&r.longitude&&window.open(`https://www.google.com/maps/search/?api=1&query=${r.latitude},${r.longitude}`,"_blank")},className:"absolute top-4 start-4 bg-white px-4 py-2.5 rounded-full shadow-lg text-sm font-medium flex items-center space-x-2 hover:scale-105 transition-transform z-20",children:[(0,e.jsx)(o,{name:"mapPin",className:"w-4 h-4 text-primary-500"}),(0,e.jsx)("span",{children:i("parkingDetails.howToGetThere.viewMap")})]})]}),(0,e.jsx)("h3",{className:"font-medium text-grey-500 mb-2",children:i("parkingDetails.howToGetThere.instructionsTitle")}),(0,e.jsxs)("div",{className:`relative overflow-hidden transition-[max-height] duration-500 ease-in-out ${X?"max-h-[1000px]":"max-h-[60px]"}`,children:[(0,e.jsx)("p",{className:"text-sm text-grey-500 leading-relaxed mb-3",children:i("parkingDetails.howToGetThere.instructionsText")}),!X&&(0,e.jsx)("div",{className:"absolute bottom-0 left-0 w-full h-8 flex items-end justify-center bg-gradient-to-t from-white to-transparent pointer-events-none"})]}),(0,e.jsxs)("button",{onClick:()=>Se(!X),className:"flex items-center justify-center gap-2 text-secondary-500 text-sm font-medium mt-1",children:[X?i("parkingDetails.details.seeLess","See less"):i("parkingDetails.details.seeMore"),(0,e.jsx)(o,{name:"chevronDown",className:`w-4 h-4 transition-transform duration-300 ${X?"rotate-180":""}`})]})]})}),(0,e.jsxs)("section",{id:"section-products",className:"space-y-8",children:[_.length===0?(0,e.jsxs)("div",{children:[(0,e.jsx)("h2",{className:"text-xl font-medium text-grey-500 mb-6",children:i("parkingDetails.products.title")}),(0,e.jsx)("div",{className:"text-sm text-grey-400 italic",children:"No products available for this location."})]}):(0,e.jsx)("div",{className:"space-y-4",children:(0,e.jsx)("div",{className:"space-y-3",children:(()=>{const t=_.flatMap(s=>{let a="SINGLE ENTRY AND EXIT";return(s.type==="multiparking"||(s.title||"").toLowerCase().includes("multi"))&&(a="UNLIMITED ENTRY AND EXIT"),(s.type==="unlimited"||(s.title||"").toLowerCase().includes("unlimited"))&&(a="UNLIMITED ENTRIES"),(s.pricing_tiers?.length>0?s.pricing_tiers:[null]).map((l,x)=>({prod:s,tier:l,tIdx:x,typeLabel:a,cardId:`${s.id}_${x}`}))});return(0,e.jsxs)(e.Fragment,{children:[t.slice(0,2).map(({prod:s,tier:a,cardId:l,typeLabel:x})=>{const p=h===l||h===s.id&&(!s.pricing_tiers||s.pricing_tiers.length===1);return(0,e.jsxs)("div",{onClick:()=>H(l),className:`rounded-xl p-4 md:p-5 flex justify-between items-start cursor-pointer transition-colors ${p?"bg-secondary-100 border border-secondary-200":"bg-white border border-grey-100 hover:border-grey-300"}`,children:[(0,e.jsxs)("div",{children:[(0,e.jsx)("div",{className:"text-[15px] font-medium text-grey-500",children:s.title}),(0,e.jsx)("div",{className:"text-[11px] font-medium text-grey-400 uppercase tracking-wide mt-1",children:x})]}),(0,e.jsxs)("div",{className:"flex items-center gap-3",children:[(0,e.jsx)("div",{className:"text-right flex flex-col gap-0.5 items-end mt-[-2px]",children:a?(0,e.jsxs)("div",{className:"flex flex-col items-end",children:[(0,e.jsxs)("div",{className:"text-lg font-medium text-grey-500 leading-tight",children:[a.price," ",(0,e.jsx)("span",{className:"text-sm",children:"EGP"})]}),(0,e.jsxs)("div",{className:"text-[11px] text-grey-400",children:["This product is of ",a.duration," ",a.unit,"(s)"]})]}):(0,e.jsxs)("div",{className:"flex flex-col items-end",children:[(0,e.jsxs)("div",{className:"text-lg font-medium text-grey-500 leading-tight",children:[s.price_per_day," ",(0,e.jsx)("span",{className:"text-sm",children:"EGP"})]}),(0,e.jsx)("div",{className:"text-[11px] text-grey-400",children:"Per day"})]})}),(0,e.jsx)("div",{className:`w-5 h-5 rounded-full border flex items-center justify-center shrink-0 ${p?"border-secondary-500":"border-grey-300"}`,children:p&&(0,e.jsx)("div",{className:"w-2.5 h-2.5 bg-secondary-500 rounded-full"})})]})]},l)}),t.length>2&&(0,e.jsx)("button",{onClick:()=>se(!0),className:"w-full mt-4 py-3.5 rounded-xl bg-secondary-200 text-secondary-500 font-medium text-[15px] hover:bg-secondary-300 transition-colors",children:"View prices"})]})})()})}),_.length>0&&(0,e.jsxs)("div",{className:"pt-2",children:[(0,e.jsx)("h3",{className:"text-[17px] font-medium text-grey-500 mb-4",children:"Irken products"}),(0,e.jsx)("div",{className:"bg-[#F8F9F9] rounded-[20px] p-6 lg:p-8",children:(0,e.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-x-8 gap-y-10",children:[(0,e.jsxs)("div",{className:"flex gap-4",children:[(0,e.jsx)(o,{name:"ticket",className:"w-[22px] h-[22px] text-grey-500 shrink-0 mt-0.5",strokeWidth:1.5}),(0,e.jsxs)("div",{children:[(0,e.jsx)("h4",{className:"font-medium text-[15px] text-grey-500 mb-2",children:"Basic pass"}),(0,e.jsx)("p",{className:"text-[14px] text-grey-500 leading-relaxed opacity-90",children:"During your stay you will only be able to enter and leave the car park once."})]})]}),(0,e.jsxs)("div",{className:"flex gap-4",children:[(0,e.jsx)(o,{name:"ticket",className:"w-[22px] h-[22px] text-grey-500 shrink-0 mt-0.5",strokeWidth:1.5}),(0,e.jsxs)("div",{children:[(0,e.jsx)("h4",{className:"font-medium text-[15px] text-grey-500 mb-2",children:"Multi pass"}),(0,e.jsx)("p",{className:"text-[14px] text-grey-500 leading-relaxed opacity-90",children:"During your stay, you can use all available parking space
1s in Irken."})]})]}),(0,e.jsxs)("div",{className:"flex gap-4",children:[(0,e.jsx)(o,{name:"ticket",className:"w-[22px] h-[22px] text-grey-500 shrink-0 mt-0.5",strokeWidth:1.5}),(0,e.jsxs)("div",{children:[(0,e.jsx)("h4",{className:"font-medium text-[15px] text-grey-500 mb-2",children:"Unlimited Permit"}),(0,e.jsx)("p",{className:"text-[14px] text-grey-500 leading-relaxed opacity-90",children:"During your stay, you can enter and exit the parking lot as many times as you like."})]})]})]})})]})]}),(0,e.jsxs)("div",{children:[(0,e.jsx)("h2",{className:"text-xl font-medium text-grey-500 mb-6",children:i("parkingDetails.guarantees.title")}),(0,e.jsxs)("div",{className:"bg-grey-50 rounded-2xl p-6 grid grid-cols-1 sm:grid-cols-2 gap-y-6 gap-x-8",children:[(0,e.jsxs)("div",{children:[(0,e.jsxs)("div",{className:"flex items-center space-x-2 font-medium text-grey-500 mb-2",children:[(0,e.jsx)(o,{name:"shield",className:"w-4 h-4 text-grey-500"})," ",(0,e.jsx)("span",{children:"Secure payment"})]}),(0,e.jsx)("p",{className:"text-sm text-grey-500 leading-relaxed ps-6",children:i("parkingDetails.guarantees.securePayment.text")})]}),(0,e.jsxs)("div",{children:[(0,e.jsxs)("div",{className:"flex items-center space-x-2 font-medium text-grey-500 mb-2",children:[(0,e.jsx)(o,{name:"clock",className:"w-4 h-4 text-grey-500"})," ",(0,e.jsx)("span",{children:"Modification"})]}),(0,e.jsx)("p",{className:"text-sm text-grey-500 leading-relaxed ps-6",children:i("parkingDetails.guarantees.modification.text")})]}),(0,e.jsxs)("div",{children:[(0,e.jsxs)("div",{className:"flex items-center space-x-2 font-medium text-grey-500 mb-2",children:[(0,e.jsx)(o,{name:"checkCircle",className:"w-4 h-4 text-grey-500"})," ",(0,e.jsx)("span",{children:"Cancelation"})]}),(0,e.jsx)("p",{className:"text-sm text-grey-500 leading-relaxed ps-6",children:i("parkingDetails.guarantees.cancelation.text")})]})]})]}),(0,e.jsx)("div",{id:"section-reviews",children:(0,e.jsx)(gt,{reviews:Ee,rating:r.rating,totalReviews:r.total_reviews,isAuthenticated:N,canReview:Le,hasReviewed:Re,reviewRating:de,reviewComment:xe,reviewSubmitting:Pe,reviewError:$e,reviewSuccess:Fe,reviewsLoading:Ce,reviewsPage:Be,reviewsPerPage:Ue,onPageChange:Ae,onRatingChange:me,onCommentChange:pe,onSubmitReview:ze,onOpenLoginModal:()=>V(!0)})}),(0,e.jsxs)("div",{className:"bg-grey-50 rounded-2xl p-8 mt-12",children:[(0,e.jsx)("h3",{className:"font-medium text-grey-500 mb-6",children:i("parkingDetails.nearby.title",{city:r.city_name||"Cairo"})}),(0,e.jsx)("div",{className:"flex flex-wrap gap-3",children:[i("parkingDetails.nearby.places.place1"),i("parkingDetails.nearby.places.place2"),i("parkingDetails.nearby.places.place3"),i("parkingDetails.nearby.places.place4"),i("parkingDetails.nearby.places.place5"),i("parkingDetails.nearby.places.place6"),i("parkingDetails.nearby.places.place7"),i("parkingDetails.nearby.places.place8")].map(t=>(0,e.jsx)("span",{className:"bg-white border border-grey-100 px-4 py-2 rounded-full text-xs text-grey-500 cursor-pointer hover:border-grey-300 transition-colors shadow-sm",children:t},t))})]})]})]}),(0,e.jsx)("aside",{className:"hidden lg:block lg:w-2/5 xl:w-4/12",children:(0,e.jsx)(ut,{arrivalDate:j,arrivalTime:f,departureDate:E,departureTime:R,onArrivalDateChange:ve,onArrivalTimeChange:Ne,onDepartureDateChange:O,onDepartureTimeChange:U,products:_,selectedProduct:h,onSelectProduct:H,priceCalculation:Y,isCalculatingPrice:ne,onCheckout:ye})})]}),(0,e.jsx)("div",{"data-component":"parking.MobileStickyBookingBar",className:"lg:hidden fixed bottom-0 left-0 right-0 bg-white border-t border-grey-100 p-4 z-[60] flex items-center justify-between shadow-[0_-8px_30px_rgba(0,0,0,0.08)]",children:(()=>{const t=h?.includes("_"),s=t?h.split("_")[0]:h,a=t?parseInt(h.split("_")[1]):0,l=_.find(B=>B.id===s),x=l?.pricing_tiers?.[a],p=ne?"...":Y?.final_price??x?.price??l?.price_per_day??r?.min_price_per_hour??0;return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{children:[(0,e.jsx)("div",{className:"text-xs text-grey-400 font-medium uppercase tracking-wider mb-0.5",children:l?.title||"Standard Pass"}),(0,e.jsxs)("div",{className:"text-xl text-primary-500 font-bold leading-none flex flex-col gap-0.5",children:[(0,e.jsxs)("span",{children:[p," ",i("parkingDetails.widget.currency","EGP")]}),(0,e.jsxs)("span",{className:"text-[11px] font-normal text-grey-300",children:[x?`/ ${x.duration} ${x.unit}(s) • `:"","(14% VAT incl.)"]})]})]}),(0,e.jsx)("button",{onClick:ye,className:"bg-primary-500 hover:bg-primary-600 active:scale-[0.98] text-white font-semibold py-3 px-6 rounded-[8px] transition-all text-sm whitespace-nowrap min-h-[48px] shadow-sm",children:i("par
1kingDetails.widget.continue","Continue")})]})})()}),(0,e.jsx)(mt,{isOpen:we,onClose:()=>V(!1),onSwitchToSignup:()=>{V(!1),ee(!0)}}),(0,e.jsx)(xt,{isOpen:ke,onClose:()=>ee(!1),onSwitchToLogin:()=>{ee(!1),V(!0)}}),De&&(0,e.jsx)("div",{className:"fixed inset-0 z-[1000] flex items-center justify-center p-4 bg-black/50 backdrop-blur-sm",children:(0,e.jsxs)("div",{className:"bg-white w-full max-w-lg rounded-3xl overflow-hidden shadow-2xl flex flex-col max-h-[85vh]",children:[(0,e.jsxs)("div",{className:"p-6 pb-0 border-b border-grey-200 bg-white z-10 shrink-0",children:[(0,e.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,e.jsx)("h2",{className:"text-[22px] font-medium text-grey-500",children:"Available products"}),(0,e.jsx)("button",{onClick:()=>se(!1),className:"p-2 hover:bg-grey-50 rounded-full transition-colors -mr-2",children:(0,e.jsx)(o,{name:"x",className:"w-6 h-6 text-grey-500"})})]}),(0,e.jsxs)("div",{className:"flex gap-6 relative",children:[(0,e.jsxs)("button",{onClick:()=>ie("One pass"),className:`pb-3 text-[15px] transition-colors relative ${M==="One pass"?"text-grey-500 font-medium":"text-grey-500 hover:text-grey-700"}`,children:["One pass",M==="One pass"&&(0,e.jsx)("div",{className:"absolute bottom-[-1px] left-0 right-0 h-[2px] bg-grey-500"})]}),(0,e.jsxs)("button",{onClick:()=>ie("Multipass"),className:`pb-3 text-[15px] transition-colors relative ${M==="Multipass"?"text-grey-500 font-medium":"text-grey-500 hover:text-grey-700"}`,children:["Multipass",M==="Multipass"&&(0,e.jsx)("div",{className:"absolute bottom-[-1px] left-0 right-0 h-[2px] bg-grey-500"})]})]})]}),(0,e.jsxs)("div",{className:"p-6 overflow-y-auto space-y-4",children:[(0,e.jsxs)("div",{className:"flex items-start gap-2.5 mb-2",children:[(0,e.jsx)("div",{className:"w-5 h-5 rounded-full bg-grey-800 text-white flex items-center justify-center shrink-0 mt-[1px]",children:(0,e.jsx)("span",{className:"text-[13px] font-serif font-medium italic",children:"i"})}),(0,e.jsx)("p",{className:"text-[15px] text-grey-800 leading-snug",children:M==="One pass"?"During your stay you will only be able to enter and leave the car park once.":"During your stay, you can enter and exit the parking lot as many times as you like."})]}),(0,e.jsx)("div",{className:"space-y-4",children:(()=>{const t=_.flatMap(s=>{let a="SINGLE ENTRY AND EXIT";return(s.type==="multiparking"||(s.title||"").toLowerCase().includes("multi"))&&(a="UNLIMITED ENTRY AND EXIT"),(s.type==="unlimited"||(s.title||"").toLowerCase().includes("unlimited"))&&(a="UNLIMITED ENTRIES"),(s.pricing_tiers?.length>0?s.pricing_tiers:[null]).map((l,x)=>({prod:s,tier:l,tIdx:x,typeLabel:a,cardId:`${s.id}_${x}`}))}).filter(s=>M==="One pass"?s.typeLabel==="SINGLE ENTRY AND EXIT":s.typeLabel!=="SINGLE ENTRY AND EXIT");return t.length===0?(0,e.jsx)("div",{className:"text-center py-8 text-grey-400",children:"No products available in this category."}):t.map(({prod:s,tier:a,cardId:l,typeLabel:x})=>(0,e.jsxs)("div",{onClick:()=>{H(l),se(!1);const p=new Date(`${j}T${f}:00`);!isNaN(p.getTime())&&a&&(a.unit==="hour"||a.unit==="hours"?p.setHours(p.getHours()+a.duration):a.unit==="day"||a.unit==="days"?p.setDate(p.getDate()+a.duration):(a.unit==="month"||a.unit==="months")&&p.setMonth(p.getMonth()+a.duration),isNaN(p.getTime())||(O(p.toISOString().split("T")[0]),U(p.toTimeString().slice(0,5))))},className:"rounded-[1rem] p-5 flex justify-between items-center cursor-pointer border border-grey-200 hover:border-grey-300 transition-colors bg-white shadow-sm",children:[(0,e.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,e.jsx)("div",{className:"text-[16px] font-medium text-grey-500",children:s.title}),(0,e.jsx)("div",{className:"text-[13px] text-grey-500 uppercase tracking-wide",children:x}),(0,e.jsx)("div",{className:"text-[13px] text-grey-400",children:x==="SINGLE ENTRY AND EXIT"?`ONEPASS ${a?.duration||1} ${a?.unit||"day"}${a?.duration>1?"s":""}`:`MULTIPASS ${a?.duration||1} ${a?.unit||"day"}${a?.duration>1?"s":""}`})]}),(0,e.jsx)("div",{className:"text-primary-500 text-2xl font-medium tracking-tight",children:(()=>{const p=(a?.price||s.price_per_day||0).toString(),B=p.includes(".")?p.split("."):[p,"00"];return(0,e.jsxs)(e.Fragment,{children:[B[0],(0,e.jsxs)("sup",{className:"text-base font-normal ml-[1px]",children:[",",B[1].padEnd(2,"0")]})," ",(0,e.jsx)("span",{className:"text-xl",children:"EGP"})]})})()})]},l))})()})]})]})})]})};function Pt(){const{id:c}=We(),m=je(),v=Je(),y=v.state?.bookingParams;return!c||!(N=>/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(N))(c)?(0,e.jsx)("div",{className:"p-8 text-center text-primary-500 font-semibold",children:"Invalid Location ID"}):(0,e.jsxs)("div",{className:"flex flex-col min-h-[100dvh] w-full",children:[(0,e.jsx)(Ze,{forceScrolledLandingStyle:!0}),(0,e.jsx)("div",{className:"flex-1 w-full bg-white",children:(0,e.jsx)(ft,{locationId:c,onBack:()=>m({pathname:"/search",search:v.search}),initialParams:y})})]})}export{Pt 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.