import{j as e,r as b,f as vr,e as js,u as Qt,b as Se,a as wr,k as kr}from"./vendor-react-CVHocMAO.js";import{j as Cr,bU as Ps,F as le,bN as Tt,bn as Te,B as X,O as lt,bV as Sr,bW as $s,bX as Tr,Y as Ns,$ as fn,bw as je,bI as Dt,a2 as Ot,x as vs,y as Ke,z as Qe,bx as Ze,C as Je,bP as Xe,L as Ne,bY as Mr,bZ as Ar,b_ as Ir,b$ as pn,c0 as gn,c1 as bn,c2 as yn,c3 as jn,c4 as Nn,E as vn,J as Er,K as Lr,c5 as Rr,X as Zt,bF as wn,bG as kn,bE as Fr,c6 as Pt,c7 as qs,N as xe,c8 as Dr,c9 as Or,bR as ht,_ as Pr,U as $r,I as Jt,bH as _s,ca as qr,R as zs,Z as _r,u as zr,k as Br,by as Hr,a4 as ts,G as ee,bT as Vr}from"./index-DXdAv5n3.js";import{f as ie,a as ce,F as ft,c as Cn,S as Gr}from"./utils-m29NAvmr.js";import{A as Sn,M as Ur,b as Wr,a as Yr,u as Kr}from"./vendor-maps-BX5dXCaZ.js";import{g as Qr}from"./wishlists-mdsVtVG_.js";import{g as $t,a as qt,P as Zr,b as Ct,f as it,c as Tn,d as _t,e as Jr,h as ss,L as Mn}from"./guestPricing-DaiRwFJy.js";import{f as us}from"./vendor-amplify-BttVyssp.js";import{m as Xr,n as ei,P as ti,j as ns,h as si,b as et,e as Bs,g as ni,i as zt,f as Hs,s as Bt,o as Ht,u as ri,D as ii,L as ai,l as li,V as oi,S as An,a as ws,E as In,p as En,c as Ln,k as ci,C as di}from"./listingBookingMode-CYE7fK7p.js";import{c as Rn,v as ui,o as gt,u as pt,a as ks,n as Et,b as Vt,d as mi,t as Fn,E as xi,e as Cs,f as Mt,m as Me,g as hi,h as fi,i as Ye,s as rs,r as pi,j as kt,k as ut,l as gi,M as Gt,C as bi,V as yi,p as Ut,I as Dn,q as On,w as ms,x as Pn,L as ji,y as Ni,z as vi,A as wi}from"./useCatererMenu-uiyf-sFj.js";import{b as ki,c as Ci,a as Si,d as Ti}from"./listings-C5R8R0UD.js";import{g as Mi}from"./listing-utils-DWgPJQzT.js";import{g as Ai,D as Ss,h as $n}from"./cancellationPolicy-n77Qv4xo.js";import{a as Ii,r as Ei}from"./feeRates-DFYxRksI.js";import{g as Li,h as Vs,M as nt,t as Le,a as Ri,b as Xt,d as Gs,e as Us,m as Fi,v as Ts}from"./availability-D3RguKHT.js";import{i as ot}from"./serviceEventLocation-DUXKtt0v.js";import{u as qn,B as _n}from"./usePendingBooking-De9PPcaJ.js";import{D as xs}from"./date-picker-BM-CR-Ne.js";import{T as hs}from"./time-picker-htHEl7t7.js";import"./confetti.module-B5JVzsfH.js";import{A as zn,m as Wt}from"./vendor-motion-CP2nHqR4.js";import{p as fs}from"./parseISO-BeqhIhSi.js";import{C as Be}from"./circle-check-CJi34ijI.js";import{b as Di}from"./timelineDisplayUtils-D9E_h4yD.js";import{L as rt}from"./loader-circle-CBzAjQAw.js";import{I as xt}from"./ImageWithFallback-BEJkpOin.js";import{B as ge}from"./badge-Ce5c8tpv.js";import{W as Oi}from"./wrench-DaAxYwBN.js";import{S as Pi}from"./shield-JErxfbmm.js";import{C as $i}from"./camera-ClqtkBSu.js";import{S as Ms}from"./star-WZhRtBdg.js";import{M as qi}from"./minus-C_OHdqnb.js";import{P as _i}from"./plus-gZD8KbAO.js";import{C as zi}from"./circle-alert-LH7FIkyX.js";import{i as Bi}from"./listing-Dh6xmhdV.js";import{B as Ws}from"./briefcase-BIW9oRxC.js";import{G as Hi}from"./graduation-cap-Cefzzc1s.js";import{A as Vi}from"./award-TfkAFFEh.js";import{M as Gi}from"./message-circle-IHAKsyw5.js";import{d as Bn}from"./differenceInMinutes-BW4yiO-S.js";import{u as Ui}from"./useSeo-BXYcILQx.js";import"./vendor-radix-Boyzn9qx.js";import"./differenceInDays-st7ugZrd.js";import"./savedVenues-CqTNNALH.js";import"./badge-check-CabiHZCA.js";import"./link-2-DaUeWpKB.js";import"./twitter-BCfeMkxW.js";import"./QuantityStepper-Dhv2rSZr.js";import"./copy--gtFY43f.js";import"./send-sS4rooCm.js";import"./timeUtils-J6UVSYhu.js";import"./parse-BXhUshbw.js";import"./calendar-days-BZ6ScuUG.js";import"./calendar-check-gNY_7O9f.js";/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Wi=Cr("ShoppingBag",[["path",{d:"M6 2 3 6v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6l-3-4Z",key:"hou9p0"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M16 10a4 4 0 0 1-8 0",key:"1ltviw"}]]),Yi=({schedule:t,availability:n,isMobile:s})=>{const r=Li(),o=(i,c)=>{const[d,a]=i.split(":").map(Number),[f,u]=c.split(":").map(Number),m=Number.isFinite(d)&&Number.isFinite(a)&&Number.isFinite(f)&&Number.isFinite(u)&&f*60+u<d*60+a;return`${Vs(i)} – ${Vs(c)}${m?" (next day)":""}`},l=i=>Array.isArray(i==null?void 0:i.windows)&&i.windows.length>0?i.windows.filter(c=>typeof(c==null?void 0:c.from)=="string"&&typeof(c==null?void 0:c.to)=="string").map(c=>({from:c.from,to:c.to})):i!=null&&i.from&&(i!=null&&i.to)?[{from:i.from,to:i.to}]:[];return s?e.jsxs("section",{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-900",children:"Availability & scheduling"}),n.bookingWindowDays&&e.jsxs("span",{className:"text-xs text-muted-foreground",children:["Book up to ",n.bookingWindowDays," days in advance"]})]}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["All times shown in ",r]})]}),e.jsxs("div",{className:"overflow-hidden rounded-2xl border border-border/70 bg-white shadow-sm",children:[e.jsx("div",{className:"divide-y divide-border/80",children:t.length>0?t.map(i=>e.jsxs("div",{className:le("flex items-center justify-between px-4 py-3 text-xs",i!=null&&i.enabled?"bg-white":"bg-muted/40 text-muted-foreground"),children:[e.jsx("span",{className:"font-medium text-gray-900",children:Ps[(i==null?void 0:i.day)??""]??(i==null?void 0:i.day)}),i!=null&&i.enabled&&l(i).length>0?e.jsx("span",{className:"font-medium text-gray-800",children:l(i).map(c=>o(c.from,c.to)).join(", ")}):e.jsx("span",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:"Unavailable"})]},i==null?void 0:i.day)):e.jsx("div",{className:"px-4 py-4 text-xs text-muted-foreground",children:"The host is still finalizing weekly availability. Send an inquiry to confirm your ideal date."})}),e.jsxs("div",{className:"flex items-center justify-between bg-muted/40 px-4 py-3 text-[10px] text-muted-foreground",children:[e.jsxs("span",{children:["Minimum lead time:"," ",n.minimumLeadTimeHours?`${n.minimumLeadTimeHours} hours`:"Flexible"]}),e.jsx("span",{children:n.acceptsInstantBookings===!1?"Booking request required":"Instant booking"})]})]})]}):e.jsxs("section",{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:"Availability & scheduling"}),n.bookingWindowDays&&e.jsxs("span",{className:"text-sm text-muted-foreground",children:["Book up to ",n.bookingWindowDays," days in advance"]})]}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["All times shown in ",r]})]}),e.jsxs("div",{className:"overflow-hidden rounded-[28px] border border-border/70 bg-white shadow-sm",children:[e.jsx("div",{className:"divide-y divide-border/80",children:t.length>0?t.map(i=>e.jsxs("div",{className:le("flex items-center justify-between px-6 py-4 text-sm",i!=null&&i.enabled?"bg-white":"bg-muted/40 text-muted-foreground"),children:[e.jsx("span",{className:"font-medium text-gray-900",children:Ps[(i==null?void 0:i.day)??""]??(i==null?void 0:i.day)}),i!=null&&i.enabled&&l(i).length>0?e.jsx("span",{className:"font-medium text-gray-800",children:l(i).map(c=>o(c.from,c.to)).join(", ")}):e.jsx("span",{className:"text-xs uppercase tracking-wide text-muted-foreground",children:"Unavailable"})]},i==null?void 0:i.day)):e.jsx("div",{className:"px-6 py-6 text-sm text-muted-foreground",children:"The host is still finalizing weekly availability. Send an inquiry to confirm your ideal date."})}),e.jsxs("div",{className:"flex items-center justify-between bg-muted/40 px-6 py-4 text-xs text-muted-foreground",children:[e.jsxs("span",{children:["Minimum lead time:"," ",n.minimumLeadTimeHours?`${n.minimumLeadTimeHours} hours`:"Flexible"]}),e.jsxs("span",{children:["Instant booking"," ",n.acceptsInstantBookings===!1?"off":"on"]})]})]})]})},Hn=({offerings:t,feeInput:n,onViewDetails:s,onSelectPackage:r,isMobile:o})=>t.length===0?null:o?e.jsxs("section",{className:"space-y-4",children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-900",children:"Available Packages"}),e.jsx("div",{className:"space-y-3",children:t.map(l=>{const i=$t(l,n),c=qt(l,n);return e.jsx("button",{type:"button",onClick:()=>s(l),className:"w-full rounded-2xl border border-border/70 bg-white p-4 shadow-sm hover:border-brand/50 hover:shadow-md transition-all text-left",children:e.jsxs("div",{className:"flex gap-4",children:[l.image&&e.jsx("img",{src:l.image,alt:l.name,className:"h-20 w-20 rounded-xl object-cover flex-shrink-0"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("h3",{className:"text-sm font-semibold text-gray-900 mb-1 line-clamp-1",children:l.name}),e.jsxs("div",{className:"text-sm text-gray-900 mb-1.5",children:[e.jsxs("span",{className:"font-medium",children:[ie(c),l.priceType==="per_person"||l.priceType==="per_guest"?" / guest":"",l.priceType==="per_hour"?" / hour":"",l.priceType==="per_event"||l.priceType==="fixed"?" / event":""]}),i&&e.jsxs("span",{className:"text-muted-foreground ml-1",children:["· Minimum ",ie(i)," to book"]})]}),l.description&&e.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2 mb-1 min-w-0 break-words overflow-hidden",children:l.description}),e.jsx("span",{className:"text-xs text-muted-foreground",children:"View Details →"})]})]})},l.id)})})]}):e.jsxs("section",{className:"space-y-6 min-w-0",children:[e.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:"Packages & Offerings"}),e.jsx("div",{className:"space-y-6",children:t.map(l=>{var x,h,g,k,y,v,T;const i=(x=l.guestLimit)==null?void 0:x.min,c=$t(l,n),d=qt(l,n),a=((h=l.duration)==null?void 0:h.hours)??0,f=((g=l.duration)==null?void 0:g.minutes)??0,u=(a>0?`${a} hour${a>1?"s":""}`:"")+(a>0&&f>0?" ":"")+(f>0?`${f} minute${f>1?"s":""}`:""),m=(k=l.guestLimit)!=null&&k.min&&((y=l.guestLimit)!=null&&y.max)?`${l.guestLimit.min} - ${l.guestLimit.max} guests`:(v=l.guestLimit)!=null&&v.min?`${l.guestLimit.min}+ guests`:(T=l.guestLimit)!=null&&T.max?`Up to ${l.guestLimit.max} guests`:null;return e.jsx("div",{className:"rounded-2xl border border-border/70 bg-white p-6 shadow-sm hover:shadow-md transition-all",children:e.jsxs("div",{className:"flex gap-6 items-stretch",children:[l.image&&e.jsx("img",{src:l.image,alt:l.name,className:"h-48 w-48 rounded-xl object-cover flex-shrink-0"}),e.jsxs("div",{className:"flex-1 min-w-0 flex flex-col h-48",children:[e.jsxs("div",{className:"min-w-0 flex-1 overflow-hidden",children:[e.jsx("h3",{className:"text-lg font-semibold text-gray-900 mb-1 break-words",children:l.name}),l.description&&e.jsx("p",{className:"text-sm text-gray-700 line-clamp-3 min-w-0 break-words overflow-hidden",children:l.description})]}),(m||u)&&e.jsxs("div",{className:"flex items-center gap-4 text-sm text-gray-600 flex-shrink-0 mt-1",children:[m&&e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(Tt,{className:"h-4 w-4 flex-shrink-0"}),e.jsx("span",{children:m})]}),u&&e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(Te,{className:"h-4 w-4 flex-shrink-0"}),e.jsx("span",{children:u})]})]}),e.jsxs("div",{className:"flex-shrink-0 mt-1 space-y-0.5",children:[e.jsxs("div",{className:"text-lg font-semibold text-gray-900",children:[ie(d),e.jsxs("span",{className:"text-sm font-normal text-muted-foreground ml-1",children:[l.priceType==="per_person"||l.priceType==="per_guest"?"/ guest":"",l.priceType==="per_hour"?"/ hour":"",l.priceType==="per_event"||l.priceType==="fixed"?"/ event":""]})]}),c&&e.jsxs("p",{className:"text-sm text-gray-600",children:["Minimum ",ie(c),i&&` (${i} guests minimum)`]})]}),e.jsxs("div",{className:"flex items-center gap-3 mt-auto pt-2",children:[e.jsx(X,{variant:"outline",size:"sm",className:"rounded-full",onClick:()=>s(l),children:"View Details"}),e.jsx(X,{size:"sm",className:"rounded-full bg-brand hover:bg-brand-600 text-white",onClick:()=>r(l),children:"Select Package"})]})]})]})},l.id)})})]});function Ys(t,n){const s=String(t);if(typeof n!="string")throw new TypeError("Expected character");let r=0,o=s.indexOf(n);for(;o!==-1;)r++,o=s.indexOf(n,o+n.length);return r}function Ki(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Qi(t,n,s){const o=Rn((s||{}).ignore||[]),l=Zi(n);let i=-1;for(;++i<l.length;)ui(t,"text",c);function c(a,f){let u=-1,m;for(;++u<f.length;){const x=f[u],h=m?m.children:void 0;if(o(x,h?h.indexOf(x):void 0,m))return;m=x}if(m)return d(a,f)}function d(a,f){const u=f[f.length-1],m=l[i][0],x=l[i][1];let h=0;const k=u.children.indexOf(a);let y=!1,v=[];m.lastIndex=0;let T=m.exec(a.value);for(;T;){const L=T.index,M={index:T.index,input:T.input,stack:[...f,a]};let N=x(...T,M);if(typeof N=="string"&&(N=N.length>0?{type:"text",value:N}:void 0),N===!1?m.lastIndex=L+1:(h!==L&&v.push({type:"text",value:a.value.slice(h,L)}),Array.isArray(N)?v.push(...N):N&&v.push(N),h=L+T[0].length,y=!0),!m.global)break;T=m.exec(a.value)}return y?(h<a.value.length&&v.push({type:"text",value:a.value.slice(h)}),u.children.splice(k,1,...v)):v=[a],k+v.length}}function Zi(t){const n=[];if(!Array.isArray(t))throw new TypeError("Expected find and replace tuple or list of tuples");const s=!t[0]||Array.isArray(t[0])?t:[t];let r=-1;for(;++r<s.length;){const o=s[r];n.push([Ji(o[0]),Xi(o[1])])}return n}function Ji(t){return typeof t=="string"?new RegExp(Ki(t),"g"):t}function Xi(t){return typeof t=="function"?t:function(){return t}}const is="phrasing",as=["autolink","link","image","label"];function ea(){return{transforms:[la],enter:{literalAutolink:sa,literalAutolinkEmail:ls,literalAutolinkHttp:ls,literalAutolinkWww:ls},exit:{literalAutolink:aa,literalAutolinkEmail:ia,literalAutolinkHttp:na,literalAutolinkWww:ra}}}function ta(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:is,notInConstruct:as},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:is,notInConstruct:as},{character:":",before:"[ps]",after:"\\/",inConstruct:is,notInConstruct:as}]}}function sa(t){this.enter({type:"link",title:null,url:"",children:[]},t)}function ls(t){this.config.enter.autolinkProtocol.call(this,t)}function na(t){this.config.exit.autolinkProtocol.call(this,t)}function ra(t){this.config.exit.data.call(this,t);const n=this.stack[this.stack.length-1];gt(n.type==="link"),n.url="http://"+this.sliceSerialize(t)}function ia(t){this.config.exit.autolinkEmail.call(this,t)}function aa(t){this.exit(t)}function la(t){Qi(t,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,oa],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),ca]],{ignore:["link","linkReference"]})}function oa(t,n,s,r,o){let l="";if(!Vn(o)||(/^w/i.test(n)&&(s=n+s,n="",l="http://"),!da(s)))return!1;const i=ua(s+r);if(!i[0])return!1;const c={type:"link",title:null,url:l+n+i[0],children:[{type:"text",value:n+i[0]}]};return i[1]?[c,{type:"text",value:i[1]}]:c}function ca(t,n,s,r){return!Vn(r,!0)||/[-\d_]$/.test(s)?!1:{type:"link",title:null,url:"mailto:"+n+"@"+s,children:[{type:"text",value:n+"@"+s}]}}function da(t){const n=t.split(".");return!(n.length<2||n[n.length-1]&&(/_/.test(n[n.length-1])||!/[a-zA-Z\d]/.test(n[n.length-1]))||n[n.length-2]&&(/_/.test(n[n.length-2])||!/[a-zA-Z\d]/.test(n[n.length-2])))}function ua(t){const n=/[!"&'),.:;<>?\]}]+$/.exec(t);if(!n)return[t,void 0];t=t.slice(0,n.index);let s=n[0],r=s.indexOf(")");const o=Ys(t,"(");let l=Ys(t,")");for(;r!==-1&&o>l;)t+=s.slice(0,r+1),s=s.slice(r+1),r=s.indexOf(")"),l++;return[t,s]}function Vn(t,n){const s=t.input.charCodeAt(t.index-1);return(t.index===0||pt(s)||ks(s))&&(!n||s!==47)}Gn.peek=ja;function ma(){this.buffer()}function xa(t){this.enter({type:"footnoteReference",identifier:"",label:""},t)}function ha(){this.buffer()}function fa(t){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},t)}function pa(t){const n=this.resume(),s=this.stack[this.stack.length-1];gt(s.type==="footnoteReference"),s.identifier=Et(this.sliceSerialize(t)).toLowerCase(),s.label=n}function ga(t){this.exit(t)}function ba(t){const n=this.resume(),s=this.stack[this.stack.length-1];gt(s.type==="footnoteDefinition"),s.identifier=Et(this.sliceSerialize(t)).toLowerCase(),s.label=n}function ya(t){this.exit(t)}function ja(){return"["}function Gn(t,n,s,r){const o=s.createTracker(r);let l=o.move("[^");const i=s.enter("footnoteReference"),c=s.enter("reference");return l+=o.move(s.safe(s.associationId(t),{after:"]",before:l})),c(),i(),l+=o.move("]"),l}function Na(){return{enter:{gfmFootnoteCallString:ma,gfmFootnoteCall:xa,gfmFootnoteDefinitionLabelString:ha,gfmFootnoteDefinition:fa},exit:{gfmFootnoteCallString:pa,gfmFootnoteCall:ga,gfmFootnoteDefinitionLabelString:ba,gfmFootnoteDefinition:ya}}}function va(t){let n=!1;return t&&t.firstLineBlank&&(n=!0),{handlers:{footnoteDefinition:s,footnoteReference:Gn},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function s(r,o,l,i){const c=l.createTracker(i);let d=c.move("[^");const a=l.enter("footnoteDefinition"),f=l.enter("label");return d+=c.move(l.safe(l.associationId(r),{before:d,after:"]"})),f(),d+=c.move("]:"),r.children&&r.children.length>0&&(c.shift(4),d+=c.move((n?`
`:" ")+l.indentLines(l.containerFlow(r,c.current()),n?Un:wa))),a(),d}}function wa(t,n,s){return n===0?t:Un(t,n,s)}function Un(t,n,s){return(s?"":"    ")+t}const ka=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Wn.peek=Aa;function Ca(){return{canContainEols:["delete"],enter:{strikethrough:Ta},exit:{strikethrough:Ma}}}function Sa(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:ka}],handlers:{delete:Wn}}}function Ta(t){this.enter({type:"delete",children:[]},t)}function Ma(t){this.exit(t)}function Wn(t,n,s,r){const o=s.createTracker(r),l=s.enter("strikethrough");let i=o.move("~~");return i+=s.containerPhrasing(t,{...o.current(),before:i,after:"~"}),i+=o.move("~~"),l(),i}function Aa(){return"~"}function Ia(t){return t.length}function Ea(t,n){const s=n||{},r=(s.align||[]).concat(),o=s.stringLength||Ia,l=[],i=[],c=[],d=[];let a=0,f=-1;for(;++f<t.length;){const g=[],k=[];let y=-1;for(t[f].length>a&&(a=t[f].length);++y<t[f].length;){const v=La(t[f][y]);if(s.alignDelimiters!==!1){const T=o(v);k[y]=T,(d[y]===void 0||T>d[y])&&(d[y]=T)}g.push(v)}i[f]=g,c[f]=k}let u=-1;if(typeof r=="object"&&"length"in r)for(;++u<a;)l[u]=Ks(r[u]);else{const g=Ks(r);for(;++u<a;)l[u]=g}u=-1;const m=[],x=[];for(;++u<a;){const g=l[u];let k="",y="";g===99?(k=":",y=":"):g===108?k=":":g===114&&(y=":");let v=s.alignDelimiters===!1?1:Math.max(1,d[u]-k.length-y.length);const T=k+"-".repeat(v)+y;s.alignDelimiters!==!1&&(v=k.length+v+y.length,v>d[u]&&(d[u]=v),x[u]=v),m[u]=T}i.splice(1,0,m),c.splice(1,0,x),f=-1;const h=[];for(;++f<i.length;){const g=i[f],k=c[f];u=-1;const y=[];for(;++u<a;){const v=g[u]||"";let T="",L="";if(s.alignDelimiters!==!1){const M=d[u]-(k[u]||0),N=l[u];N===114?T=" ".repeat(M):N===99?M%2?(T=" ".repeat(M/2+.5),L=" ".repeat(M/2-.5)):(T=" ".repeat(M/2),L=T):L=" ".repeat(M)}s.delimiterStart!==!1&&!u&&y.push("|"),s.padding!==!1&&!(s.alignDelimiters===!1&&v==="")&&(s.delimiterStart!==!1||u)&&y.push(" "),s.alignDelimiters!==!1&&y.push(T),y.push(v),s.alignDelimiters!==!1&&y.push(L),s.padding!==!1&&y.push(" "),(s.delimiterEnd!==!1||u!==a-1)&&y.push("|")}h.push(s.delimiterEnd===!1?y.join("").replace(/ +$/,""):y.join(""))}return h.join(`
`)}function La(t){return t==null?"":String(t)}function Ks(t){const n=typeof t=="string"?t.codePointAt(0):0;return n===67||n===99?99:n===76||n===108?108:n===82||n===114?114:0}function Ra(t,n,s,r){const o=s.enter("blockquote"),l=s.createTracker(r);l.move("> "),l.shift(2);const i=s.indentLines(s.containerFlow(t,l.current()),Fa);return o(),i}function Fa(t,n,s){return">"+(s?"":" ")+t}function Da(t,n){return Qs(t,n.inConstruct,!0)&&!Qs(t,n.notInConstruct,!1)}function Qs(t,n,s){if(typeof n=="string"&&(n=[n]),!n||n.length===0)return s;let r=-1;for(;++r<n.length;)if(t.includes(n[r]))return!0;return!1}function Zs(t,n,s,r){let o=-1;for(;++o<s.unsafe.length;)if(s.unsafe[o].character===`
`&&Da(s.stack,s.unsafe[o]))return/[ \t]/.test(r.before)?"":" ";return`\\
`}function Oa(t,n){const s=String(t);let r=s.indexOf(n),o=r,l=0,i=0;if(typeof n!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===o?++l>i&&(i=l):l=1,o=r+n.length,r=s.indexOf(n,o);return i}function Pa(t,n){return!!(n.options.fences===!1&&t.value&&!t.lang&&/[^ \r\n]/.test(t.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(t.value))}function $a(t){const n=t.options.fence||"`";if(n!=="`"&&n!=="~")throw new Error("Cannot serialize code with `"+n+"` for `options.fence`, expected `` ` `` or `~`");return n}function qa(t,n,s,r){const o=$a(s),l=t.value||"",i=o==="`"?"GraveAccent":"Tilde";if(Pa(t,s)){const u=s.enter("codeIndented"),m=s.indentLines(l,_a);return u(),m}const c=s.createTracker(r),d=o.repeat(Math.max(Oa(l,o)+1,3)),a=s.enter("codeFenced");let f=c.move(d);if(t.lang){const u=s.enter(`codeFencedLang${i}`);f+=c.move(s.safe(t.lang,{before:f,after:" ",encode:["`"],...c.current()})),u()}if(t.lang&&t.meta){const u=s.enter(`codeFencedMeta${i}`);f+=c.move(" "),f+=c.move(s.safe(t.meta,{before:f,after:`
`,encode:["`"],...c.current()})),u()}return f+=c.move(`
`),l&&(f+=c.move(l+`
`)),f+=c.move(d),a(),f}function _a(t,n,s){return(s?"":"    ")+t}function As(t){const n=t.options.quote||'"';if(n!=='"'&&n!=="'")throw new Error("Cannot serialize title with `"+n+"` for `options.quote`, expected `\"`, or `'`");return n}function za(t,n,s,r){const o=As(s),l=o==='"'?"Quote":"Apostrophe",i=s.enter("definition");let c=s.enter("label");const d=s.createTracker(r);let a=d.move("[");return a+=d.move(s.safe(s.associationId(t),{before:a,after:"]",...d.current()})),a+=d.move("]: "),c(),!t.url||/[\0- \u007F]/.test(t.url)?(c=s.enter("destinationLiteral"),a+=d.move("<"),a+=d.move(s.safe(t.url,{before:a,after:">",...d.current()})),a+=d.move(">")):(c=s.enter("destinationRaw"),a+=d.move(s.safe(t.url,{before:a,after:t.title?" ":`
`,...d.current()}))),c(),t.title&&(c=s.enter(`title${l}`),a+=d.move(" "+o),a+=d.move(s.safe(t.title,{before:a,after:o,...d.current()})),a+=d.move(o),c()),i(),a}function Ba(t){const n=t.options.emphasis||"*";if(n!=="*"&&n!=="_")throw new Error("Cannot serialize emphasis with `"+n+"` for `options.emphasis`, expected `*`, or `_`");return n}function At(t){return"&#x"+t.toString(16).toUpperCase()+";"}function Yt(t,n,s){const r=Vt(t),o=Vt(n);return r===void 0?o===void 0?s==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:o===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?o===void 0?{inside:!1,outside:!1}:o===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:o===void 0?{inside:!1,outside:!1}:o===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}Yn.peek=Ha;function Yn(t,n,s,r){const o=Ba(s),l=s.enter("emphasis"),i=s.createTracker(r),c=i.move(o);let d=i.move(s.containerPhrasing(t,{after:o,before:c,...i.current()}));const a=d.charCodeAt(0),f=Yt(r.before.charCodeAt(r.before.length-1),a,o);f.inside&&(d=At(a)+d.slice(1));const u=d.charCodeAt(d.length-1),m=Yt(r.after.charCodeAt(0),u,o);m.inside&&(d=d.slice(0,-1)+At(u));const x=i.move(o);return l(),s.attentionEncodeSurroundingInfo={after:m.outside,before:f.outside},c+d+x}function Ha(t,n,s){return s.options.emphasis||"*"}function Va(t,n){let s=!1;return mi(t,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return s=!0,xi}),!!((!t.depth||t.depth<3)&&Fn(t)&&(n.options.setext||s))}function Ga(t,n,s,r){const o=Math.max(Math.min(6,t.depth||1),1),l=s.createTracker(r);if(Va(t,s)){const f=s.enter("headingSetext"),u=s.enter("phrasing"),m=s.containerPhrasing(t,{...l.current(),before:`
`,after:`
`});return u(),f(),m+`
`+(o===1?"=":"-").repeat(m.length-(Math.max(m.lastIndexOf("\r"),m.lastIndexOf(`
`))+1))}const i="#".repeat(o),c=s.enter("headingAtx"),d=s.enter("phrasing");l.move(i+" ");let a=s.containerPhrasing(t,{before:"# ",after:`
`,...l.current()});return/^[\t ]/.test(a)&&(a=At(a.charCodeAt(0))+a.slice(1)),a=a?i+" "+a:i,s.options.closeAtx&&(a+=" "+i),d(),c(),a}Kn.peek=Ua;function Kn(t){return t.value||""}function Ua(){return"<"}Qn.peek=Wa;function Qn(t,n,s,r){const o=As(s),l=o==='"'?"Quote":"Apostrophe",i=s.enter("image");let c=s.enter("label");const d=s.createTracker(r);let a=d.move("![");return a+=d.move(s.safe(t.alt,{before:a,after:"]",...d.current()})),a+=d.move("]("),c(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(c=s.enter("destinationLiteral"),a+=d.move("<"),a+=d.move(s.safe(t.url,{before:a,after:">",...d.current()})),a+=d.move(">")):(c=s.enter("destinationRaw"),a+=d.move(s.safe(t.url,{before:a,after:t.title?" ":")",...d.current()}))),c(),t.title&&(c=s.enter(`title${l}`),a+=d.move(" "+o),a+=d.move(s.safe(t.title,{before:a,after:o,...d.current()})),a+=d.move(o),c()),a+=d.move(")"),i(),a}function Wa(){return"!"}Zn.peek=Ya;function Zn(t,n,s,r){const o=t.referenceType,l=s.enter("imageReference");let i=s.enter("label");const c=s.createTracker(r);let d=c.move("![");const a=s.safe(t.alt,{before:d,after:"]",...c.current()});d+=c.move(a+"]["),i();const f=s.stack;s.stack=[],i=s.enter("reference");const u=s.safe(s.associationId(t),{before:d,after:"]",...c.current()});return i(),s.stack=f,l(),o==="full"||!a||a!==u?d+=c.move(u+"]"):o==="shortcut"?d=d.slice(0,-1):d+=c.move("]"),d}function Ya(){return"!"}Jn.peek=Ka;function Jn(t,n,s){let r=t.value||"",o="`",l=-1;for(;new RegExp("(^|[^`])"+o+"([^`]|$)").test(r);)o+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++l<s.unsafe.length;){const i=s.unsafe[l],c=s.compilePattern(i);let d;if(i.atBreak)for(;d=c.exec(r);){let a=d.index;r.charCodeAt(a)===10&&r.charCodeAt(a-1)===13&&a--,r=r.slice(0,a)+" "+r.slice(d.index+1)}}return o+r+o}function Ka(){return"`"}function Xn(t,n){const s=Fn(t);return!!(!n.options.resourceLink&&t.url&&!t.title&&t.children&&t.children.length===1&&t.children[0].type==="text"&&(s===t.url||"mailto:"+s===t.url)&&/^[a-z][a-z+.-]+:/i.test(t.url)&&!/[\0- <>\u007F]/.test(t.url))}er.peek=Qa;function er(t,n,s,r){const o=As(s),l=o==='"'?"Quote":"Apostrophe",i=s.createTracker(r);let c,d;if(Xn(t,s)){const f=s.stack;s.stack=[],c=s.enter("autolink");let u=i.move("<");return u+=i.move(s.containerPhrasing(t,{before:u,after:">",...i.current()})),u+=i.move(">"),c(),s.stack=f,u}c=s.enter("link"),d=s.enter("label");let a=i.move("[");return a+=i.move(s.containerPhrasing(t,{before:a,after:"](",...i.current()})),a+=i.move("]("),d(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(d=s.enter("destinationLiteral"),a+=i.move("<"),a+=i.move(s.safe(t.url,{before:a,after:">",...i.current()})),a+=i.move(">")):(d=s.enter("destinationRaw"),a+=i.move(s.safe(t.url,{before:a,after:t.title?" ":")",...i.current()}))),d(),t.title&&(d=s.enter(`title${l}`),a+=i.move(" "+o),a+=i.move(s.safe(t.title,{before:a,after:o,...i.current()})),a+=i.move(o),d()),a+=i.move(")"),c(),a}function Qa(t,n,s){return Xn(t,s)?"<":"["}tr.peek=Za;function tr(t,n,s,r){const o=t.referenceType,l=s.enter("linkReference");let i=s.enter("label");const c=s.createTracker(r);let d=c.move("[");const a=s.containerPhrasing(t,{before:d,after:"]",...c.current()});d+=c.move(a+"]["),i();const f=s.stack;s.stack=[],i=s.enter("reference");const u=s.safe(s.associationId(t),{before:d,after:"]",...c.current()});return i(),s.stack=f,l(),o==="full"||!a||a!==u?d+=c.move(u+"]"):o==="shortcut"?d=d.slice(0,-1):d+=c.move("]"),d}function Za(){return"["}function Is(t){const n=t.options.bullet||"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bullet`, expected `*`, `+`, or `-`");return n}function Ja(t){const n=Is(t),s=t.options.bulletOther;if(!s)return n==="*"?"-":"*";if(s!=="*"&&s!=="+"&&s!=="-")throw new Error("Cannot serialize items with `"+s+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(s===n)throw new Error("Expected `bullet` (`"+n+"`) and `bulletOther` (`"+s+"`) to be different");return s}function Xa(t){const n=t.options.bulletOrdered||".";if(n!=="."&&n!==")")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOrdered`, expected `.` or `)`");return n}function sr(t){const n=t.options.rule||"*";if(n!=="*"&&n!=="-"&&n!=="_")throw new Error("Cannot serialize rules with `"+n+"` for `options.rule`, expected `*`, `-`, or `_`");return n}function el(t,n,s,r){const o=s.enter("list"),l=s.bulletCurrent;let i=t.ordered?Xa(s):Is(s);const c=t.ordered?i==="."?")":".":Ja(s);let d=n&&s.bulletLastUsed?i===s.bulletLastUsed:!1;if(!t.ordered){const f=t.children?t.children[0]:void 0;if((i==="*"||i==="-")&&f&&(!f.children||!f.children[0])&&s.stack[s.stack.length-1]==="list"&&s.stack[s.stack.length-2]==="listItem"&&s.stack[s.stack.length-3]==="list"&&s.stack[s.stack.length-4]==="listItem"&&s.indexStack[s.indexStack.length-1]===0&&s.indexStack[s.indexStack.length-2]===0&&s.indexStack[s.indexStack.length-3]===0&&(d=!0),sr(s)===i&&f){let u=-1;for(;++u<t.children.length;){const m=t.children[u];if(m&&m.type==="listItem"&&m.children&&m.children[0]&&m.children[0].type==="thematicBreak"){d=!0;break}}}}d&&(i=c),s.bulletCurrent=i;const a=s.containerFlow(t,r);return s.bulletLastUsed=i,s.bulletCurrent=l,o(),a}function tl(t){const n=t.options.listItemIndent||"one";if(n!=="tab"&&n!=="one"&&n!=="mixed")throw new Error("Cannot serialize items with `"+n+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return n}function sl(t,n,s,r){const o=tl(s);let l=s.bulletCurrent||Is(s);n&&n.type==="list"&&n.ordered&&(l=(typeof n.start=="number"&&n.start>-1?n.start:1)+(s.options.incrementListMarker===!1?0:n.children.indexOf(t))+l);let i=l.length+1;(o==="tab"||o==="mixed"&&(n&&n.type==="list"&&n.spread||t.spread))&&(i=Math.ceil(i/4)*4);const c=s.createTracker(r);c.move(l+" ".repeat(i-l.length)),c.shift(i);const d=s.enter("listItem"),a=s.indentLines(s.containerFlow(t,c.current()),f);return d(),a;function f(u,m,x){return m?(x?"":" ".repeat(i))+u:(x?l:l+" ".repeat(i-l.length))+u}}function nl(t,n,s,r){const o=s.enter("paragraph"),l=s.enter("phrasing"),i=s.containerPhrasing(t,r);return l(),o(),i}const rl=Rn(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function il(t,n,s,r){return(t.children.some(function(i){return rl(i)})?s.containerPhrasing:s.containerFlow).call(s,t,r)}function al(t){const n=t.options.strong||"*";if(n!=="*"&&n!=="_")throw new Error("Cannot serialize strong with `"+n+"` for `options.strong`, expected `*`, or `_`");return n}nr.peek=ll;function nr(t,n,s,r){const o=al(s),l=s.enter("strong"),i=s.createTracker(r),c=i.move(o+o);let d=i.move(s.containerPhrasing(t,{after:o,before:c,...i.current()}));const a=d.charCodeAt(0),f=Yt(r.before.charCodeAt(r.before.length-1),a,o);f.inside&&(d=At(a)+d.slice(1));const u=d.charCodeAt(d.length-1),m=Yt(r.after.charCodeAt(0),u,o);m.inside&&(d=d.slice(0,-1)+At(u));const x=i.move(o+o);return l(),s.attentionEncodeSurroundingInfo={after:m.outside,before:f.outside},c+d+x}function ll(t,n,s){return s.options.strong||"*"}function ol(t,n,s,r){return s.safe(t.value,r)}function cl(t){const n=t.options.ruleRepetition||3;if(n<3)throw new Error("Cannot serialize rules with repetition `"+n+"` for `options.ruleRepetition`, expected `3` or more");return n}function dl(t,n,s){const r=(sr(s)+(s.options.ruleSpaces?" ":"")).repeat(cl(s));return s.options.ruleSpaces?r.slice(0,-1):r}const rr={blockquote:Ra,break:Zs,code:qa,definition:za,emphasis:Yn,hardBreak:Zs,heading:Ga,html:Kn,image:Qn,imageReference:Zn,inlineCode:Jn,link:er,linkReference:tr,list:el,listItem:sl,paragraph:nl,root:il,strong:nr,text:ol,thematicBreak:dl};function ul(){return{enter:{table:ml,tableData:Js,tableHeader:Js,tableRow:hl},exit:{codeText:fl,table:xl,tableData:os,tableHeader:os,tableRow:os}}}function ml(t){const n=t._align;this.enter({type:"table",align:n.map(function(s){return s==="none"?null:s}),children:[]},t),this.data.inTable=!0}function xl(t){this.exit(t),this.data.inTable=void 0}function hl(t){this.enter({type:"tableRow",children:[]},t)}function os(t){this.exit(t)}function Js(t){this.enter({type:"tableCell",children:[]},t)}function fl(t){let n=this.resume();this.data.inTable&&(n=n.replace(/\\([\\|])/g,pl));const s=this.stack[this.stack.length-1];gt(s.type==="inlineCode"),s.value=n,this.exit(t)}function pl(t,n){return n==="|"?n:t}function gl(t){const n=t||{},s=n.tableCellPadding,r=n.tablePipeAlign,o=n.stringLength,l=s?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[	 :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:m,table:i,tableCell:d,tableRow:c}};function i(x,h,g,k){return a(f(x,g,k),x.align)}function c(x,h,g,k){const y=u(x,g,k),v=a([y]);return v.slice(0,v.indexOf(`
`))}function d(x,h,g,k){const y=g.enter("tableCell"),v=g.enter("phrasing"),T=g.containerPhrasing(x,{...k,before:l,after:l});return v(),y(),T}function a(x,h){return Ea(x,{align:h,alignDelimiters:r,padding:s,stringLength:o})}function f(x,h,g){const k=x.children;let y=-1;const v=[],T=h.enter("table");for(;++y<k.length;)v[y]=u(k[y],h,g);return T(),v}function u(x,h,g){const k=x.children;let y=-1;const v=[],T=h.enter("tableRow");for(;++y<k.length;)v[y]=d(k[y],x,h,g);return T(),v}function m(x,h,g){let k=rr.inlineCode(x,h,g);return g.stack.includes("tableCell")&&(k=k.replace(/\|/g,"\\$&")),k}}function bl(){return{exit:{taskListCheckValueChecked:Xs,taskListCheckValueUnchecked:Xs,paragraph:jl}}}function yl(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:Nl}}}function Xs(t){const n=this.stack[this.stack.length-2];gt(n.type==="listItem"),n.checked=t.type==="taskListCheckValueChecked"}function jl(t){const n=this.stack[this.stack.length-2];if(n&&n.type==="listItem"&&typeof n.checked=="boolean"){const s=this.stack[this.stack.length-1];gt(s.type==="paragraph");const r=s.children[0];if(r&&r.type==="text"){const o=n.children;let l=-1,i;for(;++l<o.length;){const c=o[l];if(c.type==="paragraph"){i=c;break}}i===s&&(r.value=r.value.slice(1),r.value.length===0?s.children.shift():s.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,s.position.start=Object.assign({},r.position.start)))}}this.exit(t)}function Nl(t,n,s,r){const o=t.children[0],l=typeof t.checked=="boolean"&&o&&o.type==="paragraph",i="["+(t.checked?"x":" ")+"] ",c=s.createTracker(r);l&&c.move(i);let d=rr.listItem(t,n,s,{...r,...c.current()});return l&&(d=d.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,a)),d;function a(f){return f+i}}function vl(){return[ea(),Na(),Ca(),ul(),bl()]}function wl(t){return{extensions:[ta(),va(t),Sa(),gl(t),yl()]}}const kl={tokenize:Il,partial:!0},ir={tokenize:El,partial:!0},ar={tokenize:Ll,partial:!0},lr={tokenize:Rl,partial:!0},Cl={tokenize:Fl,partial:!0},or={name:"wwwAutolink",tokenize:Ml,previous:dr},cr={name:"protocolAutolink",tokenize:Al,previous:ur},He={name:"emailAutolink",tokenize:Tl,previous:mr},Re={};function Sl(){return{text:Re}}let st=48;for(;st<123;)Re[st]=He,st++,st===58?st=65:st===91&&(st=97);Re[43]=He;Re[45]=He;Re[46]=He;Re[95]=He;Re[72]=[He,cr];Re[104]=[He,cr];Re[87]=[He,or];Re[119]=[He,or];function Tl(t,n,s){const r=this;let o,l;return i;function i(u){return!ps(u)||!mr.call(r,r.previous)||Es(r.events)?s(u):(t.enter("literalAutolink"),t.enter("literalAutolinkEmail"),c(u))}function c(u){return ps(u)?(t.consume(u),c):u===64?(t.consume(u),d):s(u)}function d(u){return u===46?t.check(Cl,f,a)(u):u===45||u===95||Cs(u)?(l=!0,t.consume(u),d):f(u)}function a(u){return t.consume(u),o=!0,d}function f(u){return l&&o&&Mt(r.previous)?(t.exit("literalAutolinkEmail"),t.exit("literalAutolink"),n(u)):s(u)}}function Ml(t,n,s){const r=this;return o;function o(i){return i!==87&&i!==119||!dr.call(r,r.previous)||Es(r.events)?s(i):(t.enter("literalAutolink"),t.enter("literalAutolinkWww"),t.check(kl,t.attempt(ir,t.attempt(ar,l),s),s)(i))}function l(i){return t.exit("literalAutolinkWww"),t.exit("literalAutolink"),n(i)}}function Al(t,n,s){const r=this;let o="",l=!1;return i;function i(u){return(u===72||u===104)&&ur.call(r,r.previous)&&!Es(r.events)?(t.enter("literalAutolink"),t.enter("literalAutolinkHttp"),o+=String.fromCodePoint(u),t.consume(u),c):s(u)}function c(u){if(Mt(u)&&o.length<5)return o+=String.fromCodePoint(u),t.consume(u),c;if(u===58){const m=o.toLowerCase();if(m==="http"||m==="https")return t.consume(u),d}return s(u)}function d(u){return u===47?(t.consume(u),l?a:(l=!0,d)):s(u)}function a(u){return u===null||hi(u)||Me(u)||pt(u)||ks(u)?s(u):t.attempt(ir,t.attempt(ar,f),s)(u)}function f(u){return t.exit("literalAutolinkHttp"),t.exit("literalAutolink"),n(u)}}function Il(t,n,s){let r=0;return o;function o(i){return(i===87||i===119)&&r<3?(r++,t.consume(i),o):i===46&&r===3?(t.consume(i),l):s(i)}function l(i){return i===null?s(i):n(i)}}function El(t,n,s){let r,o,l;return i;function i(a){return a===46||a===95?t.check(lr,d,c)(a):a===null||Me(a)||pt(a)||a!==45&&ks(a)?d(a):(l=!0,t.consume(a),i)}function c(a){return a===95?r=!0:(o=r,r=void 0),t.consume(a),i}function d(a){return o||r||!l?s(a):n(a)}}function Ll(t,n){let s=0,r=0;return o;function o(i){return i===40?(s++,t.consume(i),o):i===41&&r<s?l(i):i===33||i===34||i===38||i===39||i===41||i===42||i===44||i===46||i===58||i===59||i===60||i===63||i===93||i===95||i===126?t.check(lr,n,l)(i):i===null||Me(i)||pt(i)?n(i):(t.consume(i),o)}function l(i){return i===41&&r++,t.consume(i),o}}function Rl(t,n,s){return r;function r(c){return c===33||c===34||c===39||c===41||c===42||c===44||c===46||c===58||c===59||c===63||c===95||c===126?(t.consume(c),r):c===38?(t.consume(c),l):c===93?(t.consume(c),o):c===60||c===null||Me(c)||pt(c)?n(c):s(c)}function o(c){return c===null||c===40||c===91||Me(c)||pt(c)?n(c):r(c)}function l(c){return Mt(c)?i(c):s(c)}function i(c){return c===59?(t.consume(c),r):Mt(c)?(t.consume(c),i):s(c)}}function Fl(t,n,s){return r;function r(l){return t.consume(l),o}function o(l){return Cs(l)?s(l):n(l)}}function dr(t){return t===null||t===40||t===42||t===95||t===91||t===93||t===126||Me(t)}function ur(t){return!Mt(t)}function mr(t){return!(t===47||ps(t))}function ps(t){return t===43||t===45||t===46||t===95||Cs(t)}function Es(t){let n=t.length,s=!1;for(;n--;){const r=t[n][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){s=!0;break}if(r._gfmAutolinkLiteralWalkedInto){s=!1;break}}return t.length>0&&!s&&(t[t.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),s}const Dl={tokenize:Hl,partial:!0};function Ol(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:_l,continuation:{tokenize:zl},exit:Bl}},text:{91:{name:"gfmFootnoteCall",tokenize:ql},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:Pl,resolveTo:$l}}}}function Pl(t,n,s){const r=this;let o=r.events.length;const l=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i;for(;o--;){const d=r.events[o][1];if(d.type==="labelImage"){i=d;break}if(d.type==="gfmFootnoteCall"||d.type==="labelLink"||d.type==="label"||d.type==="image"||d.type==="link")break}return c;function c(d){if(!i||!i._balanced)return s(d);const a=Et(r.sliceSerialize({start:i.end,end:r.now()}));return a.codePointAt(0)!==94||!l.includes(a.slice(1))?s(d):(t.enter("gfmFootnoteCallLabelMarker"),t.consume(d),t.exit("gfmFootnoteCallLabelMarker"),n(d))}}function $l(t,n){let s=t.length;for(;s--;)if(t[s][1].type==="labelImage"&&t[s][0]==="enter"){t[s][1];break}t[s+1][1].type="data",t[s+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},t[s+3][1].start),end:Object.assign({},t[t.length-1][1].end)},o={type:"gfmFootnoteCallMarker",start:Object.assign({},t[s+3][1].end),end:Object.assign({},t[s+3][1].end)};o.end.column++,o.end.offset++,o.end._bufferIndex++;const l={type:"gfmFootnoteCallString",start:Object.assign({},o.end),end:Object.assign({},t[t.length-1][1].start)},i={type:"chunkString",contentType:"string",start:Object.assign({},l.start),end:Object.assign({},l.end)},c=[t[s+1],t[s+2],["enter",r,n],t[s+3],t[s+4],["enter",o,n],["exit",o,n],["enter",l,n],["enter",i,n],["exit",i,n],["exit",l,n],t[t.length-2],t[t.length-1],["exit",r,n]];return t.splice(s,t.length-s+1,...c),t}function ql(t,n,s){const r=this,o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l=0,i;return c;function c(u){return t.enter("gfmFootnoteCall"),t.enter("gfmFootnoteCallLabelMarker"),t.consume(u),t.exit("gfmFootnoteCallLabelMarker"),d}function d(u){return u!==94?s(u):(t.enter("gfmFootnoteCallMarker"),t.consume(u),t.exit("gfmFootnoteCallMarker"),t.enter("gfmFootnoteCallString"),t.enter("chunkString").contentType="string",a)}function a(u){if(l>999||u===93&&!i||u===null||u===91||Me(u))return s(u);if(u===93){t.exit("chunkString");const m=t.exit("gfmFootnoteCallString");return o.includes(Et(r.sliceSerialize(m)))?(t.enter("gfmFootnoteCallLabelMarker"),t.consume(u),t.exit("gfmFootnoteCallLabelMarker"),t.exit("gfmFootnoteCall"),n):s(u)}return Me(u)||(i=!0),l++,t.consume(u),u===92?f:a}function f(u){return u===91||u===92||u===93?(t.consume(u),l++,a):a(u)}}function _l(t,n,s){const r=this,o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l,i=0,c;return d;function d(h){return t.enter("gfmFootnoteDefinition")._container=!0,t.enter("gfmFootnoteDefinitionLabel"),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(h),t.exit("gfmFootnoteDefinitionLabelMarker"),a}function a(h){return h===94?(t.enter("gfmFootnoteDefinitionMarker"),t.consume(h),t.exit("gfmFootnoteDefinitionMarker"),t.enter("gfmFootnoteDefinitionLabelString"),t.enter("chunkString").contentType="string",f):s(h)}function f(h){if(i>999||h===93&&!c||h===null||h===91||Me(h))return s(h);if(h===93){t.exit("chunkString");const g=t.exit("gfmFootnoteDefinitionLabelString");return l=Et(r.sliceSerialize(g)),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(h),t.exit("gfmFootnoteDefinitionLabelMarker"),t.exit("gfmFootnoteDefinitionLabel"),m}return Me(h)||(c=!0),i++,t.consume(h),h===92?u:f}function u(h){return h===91||h===92||h===93?(t.consume(h),i++,f):f(h)}function m(h){return h===58?(t.enter("definitionMarker"),t.consume(h),t.exit("definitionMarker"),o.includes(l)||o.push(l),Ye(t,x,"gfmFootnoteDefinitionWhitespace")):s(h)}function x(h){return n(h)}}function zl(t,n,s){return t.check(fi,n,t.attempt(Dl,n,s))}function Bl(t){t.exit("gfmFootnoteDefinition")}function Hl(t,n,s){const r=this;return Ye(t,o,"gfmFootnoteDefinitionIndent",5);function o(l){const i=r.events[r.events.length-1];return i&&i[1].type==="gfmFootnoteDefinitionIndent"&&i[2].sliceSerialize(i[1],!0).length===4?n(l):s(l)}}function Vl(t){let s=(t||{}).singleTilde;const r={name:"strikethrough",tokenize:l,resolveAll:o};return s==null&&(s=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function o(i,c){let d=-1;for(;++d<i.length;)if(i[d][0]==="enter"&&i[d][1].type==="strikethroughSequenceTemporary"&&i[d][1]._close){let a=d;for(;a--;)if(i[a][0]==="exit"&&i[a][1].type==="strikethroughSequenceTemporary"&&i[a][1]._open&&i[d][1].end.offset-i[d][1].start.offset===i[a][1].end.offset-i[a][1].start.offset){i[d][1].type="strikethroughSequence",i[a][1].type="strikethroughSequence";const f={type:"strikethrough",start:Object.assign({},i[a][1].start),end:Object.assign({},i[d][1].end)},u={type:"strikethroughText",start:Object.assign({},i[a][1].end),end:Object.assign({},i[d][1].start)},m=[["enter",f,c],["enter",i[a][1],c],["exit",i[a][1],c],["enter",u,c]],x=c.parser.constructs.insideSpan.null;x&&rs(m,m.length,0,pi(x,i.slice(a+1,d),c)),rs(m,m.length,0,[["exit",u,c],["enter",i[d][1],c],["exit",i[d][1],c],["exit",f,c]]),rs(i,a-1,d-a+3,m),d=a+m.length-2;break}}for(d=-1;++d<i.length;)i[d][1].type==="strikethroughSequenceTemporary"&&(i[d][1].type="data");return i}function l(i,c,d){const a=this.previous,f=this.events;let u=0;return m;function m(h){return a===126&&f[f.length-1][1].type!=="characterEscape"?d(h):(i.enter("strikethroughSequenceTemporary"),x(h))}function x(h){const g=Vt(a);if(h===126)return u>1?d(h):(i.consume(h),u++,x);if(u<2&&!s)return d(h);const k=i.exit("strikethroughSequenceTemporary"),y=Vt(h);return k._open=!y||y===2&&!!g,k._close=!g||g===2&&!!y,c(h)}}}class Gl{constructor(){this.map=[]}add(n,s,r){Ul(this,n,s,r)}consume(n){if(this.map.sort(function(l,i){return l[0]-i[0]}),this.map.length===0)return;let s=this.map.length;const r=[];for(;s>0;)s-=1,r.push(n.slice(this.map[s][0]+this.map[s][1]),this.map[s][2]),n.length=this.map[s][0];r.push(n.slice()),n.length=0;let o=r.pop();for(;o;){for(const l of o)n.push(l);o=r.pop()}this.map.length=0}}function Ul(t,n,s,r){let o=0;if(!(s===0&&r.length===0)){for(;o<t.map.length;){if(t.map[o][0]===n){t.map[o][1]+=s,t.map[o][2].push(...r);return}o+=1}t.map.push([n,s,r])}}function Wl(t,n){let s=!1;const r=[];for(;n<t.length;){const o=t[n];if(s){if(o[0]==="enter")o[1].type==="tableContent"&&r.push(t[n+1][1].type==="tableDelimiterMarker"?"left":"none");else if(o[1].type==="tableContent"){if(t[n-1][1].type==="tableDelimiterMarker"){const l=r.length-1;r[l]=r[l]==="left"?"center":"right"}}else if(o[1].type==="tableDelimiterRow")break}else o[0]==="enter"&&o[1].type==="tableDelimiterRow"&&(s=!0);n+=1}return r}function Yl(){return{flow:{null:{name:"table",tokenize:Kl,resolveAll:Ql}}}}function Kl(t,n,s){const r=this;let o=0,l=0,i;return c;function c(p){let A=r.events.length-1;for(;A>-1;){const R=r.events[A][1].type;if(R==="lineEnding"||R==="linePrefix")A--;else break}const w=A>-1?r.events[A][1].type:null,E=w==="tableHead"||w==="tableRow"?N:d;return E===N&&r.parser.lazy[r.now().line]?s(p):E(p)}function d(p){return t.enter("tableHead"),t.enter("tableRow"),a(p)}function a(p){return p===124||(i=!0,l+=1),f(p)}function f(p){return p===null?s(p):kt(p)?l>1?(l=0,r.interrupt=!0,t.exit("tableRow"),t.enter("lineEnding"),t.consume(p),t.exit("lineEnding"),x):s(p):ut(p)?Ye(t,f,"whitespace")(p):(l+=1,i&&(i=!1,o+=1),p===124?(t.enter("tableCellDivider"),t.consume(p),t.exit("tableCellDivider"),i=!0,f):(t.enter("data"),u(p)))}function u(p){return p===null||p===124||Me(p)?(t.exit("data"),f(p)):(t.consume(p),p===92?m:u)}function m(p){return p===92||p===124?(t.consume(p),u):u(p)}function x(p){return r.interrupt=!1,r.parser.lazy[r.now().line]?s(p):(t.enter("tableDelimiterRow"),i=!1,ut(p)?Ye(t,h,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(p):h(p))}function h(p){return p===45||p===58?k(p):p===124?(i=!0,t.enter("tableCellDivider"),t.consume(p),t.exit("tableCellDivider"),g):M(p)}function g(p){return ut(p)?Ye(t,k,"whitespace")(p):k(p)}function k(p){return p===58?(l+=1,i=!0,t.enter("tableDelimiterMarker"),t.consume(p),t.exit("tableDelimiterMarker"),y):p===45?(l+=1,y(p)):p===null||kt(p)?L(p):M(p)}function y(p){return p===45?(t.enter("tableDelimiterFiller"),v(p)):M(p)}function v(p){return p===45?(t.consume(p),v):p===58?(i=!0,t.exit("tableDelimiterFiller"),t.enter("tableDelimiterMarker"),t.consume(p),t.exit("tableDelimiterMarker"),T):(t.exit("tableDelimiterFiller"),T(p))}function T(p){return ut(p)?Ye(t,L,"whitespace")(p):L(p)}function L(p){return p===124?h(p):p===null||kt(p)?!i||o!==l?M(p):(t.exit("tableDelimiterRow"),t.exit("tableHead"),n(p)):M(p)}function M(p){return s(p)}function N(p){return t.enter("tableRow"),I(p)}function I(p){return p===124?(t.enter("tableCellDivider"),t.consume(p),t.exit("tableCellDivider"),I):p===null||kt(p)?(t.exit("tableRow"),n(p)):ut(p)?Ye(t,I,"whitespace")(p):(t.enter("data"),D(p))}function D(p){return p===null||p===124||Me(p)?(t.exit("data"),I(p)):(t.consume(p),p===92?S:D)}function S(p){return p===92||p===124?(t.consume(p),D):D(p)}}function Ql(t,n){let s=-1,r=!0,o=0,l=[0,0,0,0],i=[0,0,0,0],c=!1,d=0,a,f,u;const m=new Gl;for(;++s<t.length;){const x=t[s],h=x[1];x[0]==="enter"?h.type==="tableHead"?(c=!1,d!==0&&(en(m,n,d,a,f),f=void 0,d=0),a={type:"table",start:Object.assign({},h.start),end:Object.assign({},h.end)},m.add(s,0,[["enter",a,n]])):h.type==="tableRow"||h.type==="tableDelimiterRow"?(r=!0,u=void 0,l=[0,0,0,0],i=[0,s+1,0,0],c&&(c=!1,f={type:"tableBody",start:Object.assign({},h.start),end:Object.assign({},h.end)},m.add(s,0,[["enter",f,n]])),o=h.type==="tableDelimiterRow"?2:f?3:1):o&&(h.type==="data"||h.type==="tableDelimiterMarker"||h.type==="tableDelimiterFiller")?(r=!1,i[2]===0&&(l[1]!==0&&(i[0]=i[1],u=Lt(m,n,l,o,void 0,u),l=[0,0,0,0]),i[2]=s)):h.type==="tableCellDivider"&&(r?r=!1:(l[1]!==0&&(i[0]=i[1],u=Lt(m,n,l,o,void 0,u)),l=i,i=[l[1],s,0,0])):h.type==="tableHead"?(c=!0,d=s):h.type==="tableRow"||h.type==="tableDelimiterRow"?(d=s,l[1]!==0?(i[0]=i[1],u=Lt(m,n,l,o,s,u)):i[1]!==0&&(u=Lt(m,n,i,o,s,u)),o=0):o&&(h.type==="data"||h.type==="tableDelimiterMarker"||h.type==="tableDelimiterFiller")&&(i[3]=s)}for(d!==0&&en(m,n,d,a,f),m.consume(n.events),s=-1;++s<n.events.length;){const x=n.events[s];x[0]==="enter"&&x[1].type==="table"&&(x[1]._align=Wl(n.events,s))}return t}function Lt(t,n,s,r,o,l){const i=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",c="tableContent";s[0]!==0&&(l.end=Object.assign({},mt(n.events,s[0])),t.add(s[0],0,[["exit",l,n]]));const d=mt(n.events,s[1]);if(l={type:i,start:Object.assign({},d),end:Object.assign({},d)},t.add(s[1],0,[["enter",l,n]]),s[2]!==0){const a=mt(n.events,s[2]),f=mt(n.events,s[3]),u={type:c,start:Object.assign({},a),end:Object.assign({},f)};if(t.add(s[2],0,[["enter",u,n]]),r!==2){const m=n.events[s[2]],x=n.events[s[3]];if(m[1].end=Object.assign({},x[1].end),m[1].type="chunkText",m[1].contentType="text",s[3]>s[2]+1){const h=s[2]+1,g=s[3]-s[2]-1;t.add(h,g,[])}}t.add(s[3]+1,0,[["exit",u,n]])}return o!==void 0&&(l.end=Object.assign({},mt(n.events,o)),t.add(o,0,[["exit",l,n]]),l=void 0),l}function en(t,n,s,r,o){const l=[],i=mt(n.events,s);o&&(o.end=Object.assign({},i),l.push(["exit",o,n])),r.end=Object.assign({},i),l.push(["exit",r,n]),t.add(s+1,0,l)}function mt(t,n){const s=t[n],r=s[0]==="enter"?"start":"end";return s[1][r]}const Zl={name:"tasklistCheck",tokenize:Xl};function Jl(){return{text:{91:Zl}}}function Xl(t,n,s){const r=this;return o;function o(d){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?s(d):(t.enter("taskListCheck"),t.enter("taskListCheckMarker"),t.consume(d),t.exit("taskListCheckMarker"),l)}function l(d){return Me(d)?(t.enter("taskListCheckValueUnchecked"),t.consume(d),t.exit("taskListCheckValueUnchecked"),i):d===88||d===120?(t.enter("taskListCheckValueChecked"),t.consume(d),t.exit("taskListCheckValueChecked"),i):s(d)}function i(d){return d===93?(t.enter("taskListCheckMarker"),t.consume(d),t.exit("taskListCheckMarker"),t.exit("taskListCheck"),c):s(d)}function c(d){return kt(d)?n(d):ut(d)?t.check({tokenize:eo},n,s)(d):s(d)}}function eo(t,n,s){return Ye(t,r,"whitespace");function r(o){return o===null?s(o):n(o)}}function to(t){return gi([Sl(),Ol(),Vl(t),Yl(),Jl()])}const so={};function Kt(t){const n=this,s=t||so,r=n.data(),o=r.micromarkExtensions||(r.micromarkExtensions=[]),l=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),i=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);o.push(to(s)),l.push(vl()),i.push(wl(s))}function tn(t){if(!t||typeof t!="string")return t;const s=t.replace(/\*\*([^*]+?)\s+\*\*/g,"**$1**").replace(/\*([^*]+?)\s+\*/g,"*$1*").replace(/\*\*([^*]+?)\r?\n\s*\*\*/g,"**$1**").split(/\r?\n/),r=[];for(let o=0;o<s.length;o++){const l=s[o];/^\s*\*\*[^*]+\*\*\s*$/.test(l)&&o>0&&r.push("",""),r.push(l)}return r.join(`
`)}const sn=/\*\*([^*]+)\*\*/g;function nn(t){const n=[];let s=0,r=null,o;for(sn.lastIndex=0;(o=sn.exec(t))!==null;){const l=t.slice(s,o.index).trim();(l||r!==null)&&n.push({boldHeading:r,rest:l}),r=o[1].trim(),s=o.index+o[0].length}return(s<t.length||r!==null)&&n.push({boldHeading:r,rest:t.slice(s).trim()}),n.length>0?n:[{boldHeading:null,rest:t}]}const rn="prose prose-sm max-w-none text-gray-700 break-words prose-p:my-2 prose-ul:my-2 prose-ol:my-2 prose-strong:font-semibold prose-strong:text-gray-900",an={ul:({children:t})=>e.jsx("ul",{className:"list-disc pl-6 my-2 space-y-0.5",children:t}),ol:({children:t})=>e.jsx("ol",{className:"list-decimal pl-6 my-2 space-y-0.5",children:t}),li:({children:t})=>e.jsx("li",{className:"pl-1",children:t})},no=({hostDisplayName:t,serviceName:n,serviceTypeInfo:s,hostAvatar:r,hostPublicId:o,onMessageClick:l,aboutMe:i,serviceType:c,serviceData:d,isMobile:a})=>{var m;const f=Array.isArray(i.certifications)&&i.certifications.length>0,{hasAnySocial:u}=Xr(i);return!i.experience&&!i.qualifications&&!i.yearsOfExperience&&!f&&!t&&!u?null:a?e.jsxs("section",{className:"space-y-4",children:[e.jsxs("h2",{className:"text-lg font-semibold text-gray-900",children:["About ",n.split(" ")[n.split(" ").length-1]||n.split(" ")[0]]}),e.jsxs("div",{className:"space-y-3",children:[i.experience&&(()=>{const x=tn(i.experience),h=nn(x);return e.jsxs("div",{className:"rounded-2xl border border-border/70 bg-white p-4 shadow-sm",children:[e.jsx("h3",{className:"text-sm font-semibold text-gray-900 mb-2",children:"Experience"}),e.jsx("div",{className:`space-y-4 ${rn}`,children:h.map((g,k)=>e.jsxs("div",{className:"experience-block block w-full mt-4 first:mt-0",style:{display:"block"},children:[g.boldHeading!=null&&e.jsx("div",{className:"font-semibold text-gray-900 my-2 block w-full",style:{display:"block"},children:g.boldHeading}),g.rest?e.jsx("div",{className:"block w-full",style:{display:"block"},children:e.jsx(Gt,{remarkPlugins:[Kt],components:an,children:g.rest})}):null]},k))})]})})(),i.yearsOfExperience&&e.jsx("div",{className:"rounded-2xl border border-border/70 bg-white p-4 shadow-sm",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"grid h-8 w-8 place-items-center rounded-full bg-brand/10 text-brand flex-shrink-0",children:e.jsx(Be,{className:"h-4 w-4"})}),e.jsx("div",{className:"min-w-0",children:e.jsxs("h3",{className:"text-sm font-semibold text-gray-900",children:[i.yearsOfExperience," years of experience"]})})]})}),i.qualifications&&e.jsx("div",{className:"rounded-2xl border border-border/70 bg-white p-4 shadow-sm",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"grid h-8 w-8 place-items-center rounded-full bg-brand/10 text-brand flex-shrink-0",children:e.jsx(Be,{className:"h-4 w-4"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("h3",{className:"text-sm font-semibold text-gray-900",children:"Qualifications"}),e.jsx("p",{className:"mt-1 text-xs text-gray-700 whitespace-pre-line break-words",children:i.qualifications})]})]})}),f&&e.jsx("div",{className:"flex flex-wrap gap-2",children:i.certifications.map((x,h)=>e.jsx(ge,{variant:"outline",className:"rounded-full text-xs",children:ce(x)},h))}),u&&e.jsxs("div",{className:"rounded-2xl border border-border/70 bg-white p-4 shadow-sm",children:[e.jsx("h3",{className:"text-sm font-semibold text-gray-900 mb-2",children:"Connect online"}),e.jsx(ei,{social:i})]})]})]}):e.jsxs("section",{className:"space-y-6 min-w-0",children:[e.jsxs("h2",{className:"text-2xl font-semibold text-gray-900",children:["Meet your ",((m=s==null?void 0:s.label)==null?void 0:m.toLowerCase())||"service provider"]}),e.jsx("div",{className:"rounded-2xl border border-border/70 bg-white p-8 shadow-sm min-w-0 overflow-hidden",children:e.jsxs("div",{className:"grid gap-8 md:grid-cols-[200px_minmax(0,1fr)] min-w-0",children:[e.jsxs("div",{className:"space-y-4 min-w-0",children:[e.jsx("div",{className:"flex justify-center",children:o?e.jsx("a",{href:`/u/${o}`,target:"_blank",rel:"noopener noreferrer",className:"block w-fit focus:outline-none focus-visible:ring-2 focus-visible:ring-brand focus-visible:ring-offset-2 rounded-full","aria-label":`View ${t||"provider"}'s profile`,children:e.jsx(xt,{src:r||void 0,alt:t,className:"h-32 w-32 rounded-full object-cover ring-2 ring-border",fallback:"/default-profile-icon.png"})}):e.jsx(xt,{src:r||void 0,alt:t,className:"h-32 w-32 rounded-full object-cover ring-2 ring-border",fallback:"/default-profile-icon.png"})}),e.jsxs("div",{className:"text-center",children:[e.jsx("h3",{className:"text-xl font-semibold text-gray-900",children:t||n.split(" ")[n.split(" ").length-1]||n.split(" ")[0]}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:(s==null?void 0:s.label)||"Service Provider"})]}),e.jsx("div",{className:"flex justify-center",children:e.jsxs(ge,{className:"rounded-full bg-brand/10 text-brand border-brand/20 px-3 py-1",children:[e.jsx(Be,{className:"mr-1.5 h-3.5 w-3.5"}),"Verified"]})}),e.jsxs("div",{className:"flex items-center justify-center gap-1 text-sm",children:[e.jsx(Ms,{className:"h-4 w-4 fill-amber-400 text-amber-400"}),e.jsx("span",{className:"font-medium text-gray-900",children:"New"})]}),e.jsxs("div",{className:"pt-2 flex flex-col gap-2",children:[o&&e.jsx(X,{variant:"outline",className:"w-full rounded-full",asChild:!0,children:e.jsx("a",{href:`/u/${o}`,target:"_blank",rel:"noopener noreferrer",children:"View profile"})}),l&&e.jsxs(X,{variant:"outline",className:"w-full rounded-full",onClick:l,children:["Message ",t.split(" ")[0]]})]}),u&&e.jsxs("div",{className:"pt-4 border-t",children:[e.jsx("p",{className:"text-xs font-medium text-gray-500 mb-3 text-center",children:"Connect online"}),e.jsx(ti,{social:i,className:"justify-center"})]})]}),e.jsxs("div",{className:"space-y-6 min-w-0",children:[e.jsx("h3",{className:"text-lg font-semibold text-gray-900",children:"Qualifications & Experience"}),e.jsxs("div",{className:"space-y-5",children:[i.experience&&(()=>{const x=tn(i.experience),h=nn(x);return e.jsxs("div",{className:"flex items-start gap-4",children:[e.jsx("div",{className:"grid h-10 w-10 place-items-center rounded-full bg-brand/10 text-brand flex-shrink-0",children:e.jsx(Ws,{className:"h-5 w-5"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("h4",{className:"text-base font-semibold text-gray-900 mb-2",children:"About"}),e.jsx("div",{className:`space-y-4 ${rn}`,children:h.map((g,k)=>e.jsxs("div",{className:"experience-block block w-full mt-4 first:mt-0",style:{display:"block"},children:[g.boldHeading!=null&&e.jsx("div",{className:"font-semibold text-gray-900 my-2 block w-full",style:{display:"block"},children:g.boldHeading}),g.rest?e.jsx("div",{className:"block w-full",style:{display:"block"},children:e.jsx(Gt,{remarkPlugins:[Kt],components:an,children:g.rest})}):null]},k))})]})]})})(),i.yearsOfExperience&&e.jsxs("div",{className:"flex items-start gap-4",children:[e.jsx("div",{className:"grid h-10 w-10 place-items-center rounded-full bg-brand/10 text-brand flex-shrink-0",children:e.jsx(bi,{className:"h-5 w-5"})}),e.jsx("div",{className:"flex-1 min-w-0",children:e.jsxs("h4",{className:"text-base font-semibold text-gray-900 mb-1",children:[i.yearsOfExperience," years of experience"]})})]}),i.qualifications&&e.jsxs("div",{className:"flex items-start gap-4",children:[e.jsx("div",{className:"grid h-10 w-10 place-items-center rounded-full bg-brand/10 text-brand flex-shrink-0",children:e.jsx(Hi,{className:"h-5 w-5"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("h4",{className:"text-base font-semibold text-gray-900 mb-1",children:"Education and training"}),e.jsx("p",{className:"text-sm text-gray-700 leading-relaxed whitespace-pre-line break-words",children:i.qualifications})]})]}),f&&e.jsxs("div",{className:"flex items-start gap-4",children:[e.jsx("div",{className:"grid h-10 w-10 place-items-center rounded-full bg-brand/10 text-brand flex-shrink-0",children:e.jsx(Vi,{className:"h-5 w-5"})}),e.jsxs("div",{className:"flex-1",children:[e.jsx("h4",{className:"text-base font-semibold text-gray-900 mb-2",children:"Certifications"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:i.certifications.map((x,h)=>e.jsx(ge,{variant:"outline",className:"rounded-full text-xs",children:ce(x)},h))})]})]}),e.jsxs("div",{className:"flex items-start gap-4",children:[e.jsx("div",{className:"grid h-10 w-10 place-items-center rounded-full bg-brand/10 text-brand flex-shrink-0",children:e.jsx(Ws,{className:"h-5 w-5"})}),e.jsxs("div",{className:"flex-1",children:[e.jsx("h4",{className:"text-base font-semibold text-gray-900 mb-2",children:"Specialization"}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[s&&e.jsx(ge,{variant:"secondary",className:"rounded-full px-3 py-1 text-xs bg-gray-100 text-gray-700 border-0",children:s.label}),c==="caterer"&&(d==null?void 0:d.catererServices)&&d.catererServices.length>0&&e.jsx(e.Fragment,{children:d.catererServices.slice(0,4).map((x,h)=>e.jsx(ge,{variant:"secondary",className:"rounded-full px-3 py-1 text-xs bg-gray-100 text-gray-700 border-0",children:ce(x)},h))}),c==="dj"&&(d==null?void 0:d.djEquipment)&&d.djEquipment.length>0&&e.jsx(e.Fragment,{children:d.djEquipment.slice(0,4).map((x,h)=>e.jsx(ge,{variant:"secondary",className:"rounded-full px-3 py-1 text-xs bg-gray-100 text-gray-700 border-0",children:ce(x)},h))})]})]})]})]})]})]})})]})},ro=[{field:"cuisineTypes",label:"Cuisine"},{field:"serviceStyles",label:"Service styles"},{field:"dietaryAccommodations",label:"Dietary"},{field:"staffing",label:"Staffing"},{field:"eventSpecialization",label:"Event specialization"},{field:"additionalServices",label:"Additional services"},{field:"equipmentSetup",label:"Equipment & setup"},{field:"menuServices",label:"Menu services"},{field:"certifications",label:"Certifications"}],io={monday:"Monday",tuesday:"Tuesday",wednesday:"Wednesday",thursday:"Thursday",friday:"Friday",saturday:"Saturday",sunday:"Sunday"},ao={travels_to_you:"Travels to you",you_travel_to_them:"You travel to them",both:"Both"},xr=({serviceData:t,serviceType:n,isMobile:s})=>{var _,Q,V,z;const r=t,o=r.businessHours,l=r.travelPolicy,i=r.djEquipment??[],c=r.catererServices??[],d=r.catererProfile??void 0,a=ro.map(C=>({...C,values:(d==null?void 0:d[C.field])??[]})).filter(C=>C.values.length>0),f=r.musicianData,u=(f==null?void 0:f.genres)??[],m=r.requirements,x=r.photographerData,h=r.videographerData,g=r.bartenderData,k=r.cleanerData,y=r.equipmentRentalData,v=o&&Object.keys(o).length>0&&Object.values(o).some(C=>C&&!C.closed),T=!!l,L=u.length>0,M=i.length>0,N=a.length>0,I=!N&&c.length>0,D=m&&(Array.isArray(m.licenses)&&m.licenses.length>0||m.insurance===!0||Array.isArray(m.certifications)&&m.certifications.length>0),S=x&&(Array.isArray(x.photoStyles)&&x.photoStyles.length>0||Array.isArray(x.eventTypes)&&x.eventTypes.length>0||x.secondShooterAvailable!=null||!!x.shootingLocation),p=h&&(Array.isArray(h.videoStyles)&&h.videoStyles.length>0||Array.isArray(h.eventTypes)&&h.eventTypes.length>0||Array.isArray(h.cameraTypes)&&h.cameraTypes.length>0||h.droneAvailable===!0),A=g&&(!!g.serviceType||Array.isArray(g.equipmentProvided)&&g.equipmentProvided.length>0),w=k&&(Array.isArray(k.cleaningTypes)&&k.cleaningTypes.length>0||!!k.teamSize||!!k.bringsOwnSupplies),E=y&&(Array.isArray(y.rentalCategories)&&y.rentalCategories.length>0||Array.isArray(y.addOnServices)&&y.addOnServices.length>0||y.providesSetup===!0||y.providesBreakdown===!0);if(!(v||T||L||M||I||N||D||S||p||A||w||E))return null;const j=s?"rounded-2xl border border-border/70 bg-white p-4 shadow-sm space-y-4":"rounded-2xl border border-border/70 bg-white p-6 shadow-sm space-y-6",F=s?"text-lg font-semibold text-gray-900":"text-xl font-semibold text-gray-900";return e.jsxs("section",{className:"space-y-6 min-w-0",children:[e.jsx("h2",{className:F,children:"Service details"}),e.jsxs("div",{className:j,children:[v&&e.jsxs("div",{children:[e.jsxs("h3",{className:"flex items-center gap-2 text-sm font-semibold text-gray-900 mb-2",children:[e.jsx(Te,{className:"h-4 w-4 text-muted-foreground"}),"Business hours"]}),e.jsx("ul",{className:"space-y-1.5 text-sm text-gray-700",children:Object.entries(o??{}).map(([C,$])=>e.jsxs("li",{className:"flex justify-between",children:[e.jsx("span",{children:io[C]??C}),$!=null&&$.closed?e.jsx("span",{className:"text-muted-foreground",children:"Closed"}):e.jsxs("span",{children:[($==null?void 0:$.open)??"—"," – ",($==null?void 0:$.close)??"—"]})]},C))})]}),T&&e.jsxs("div",{children:[e.jsxs("h3",{className:"flex items-center gap-2 text-sm font-semibold text-gray-900 mb-1",children:[e.jsx(lt,{className:"h-4 w-4 text-muted-foreground"}),"Travel"]}),e.jsx("p",{className:"text-sm text-gray-700 break-words",children:ao[l]??l})]}),L&&e.jsxs("div",{children:[e.jsxs("h3",{className:"flex items-center gap-2 text-sm font-semibold text-gray-900 mb-2",children:[e.jsx(Sr,{className:"h-4 w-4 text-muted-foreground"}),"Genres"]}),e.jsx("div",{className:"flex flex-wrap gap-2",children:u.map(C=>e.jsx("span",{className:"rounded-full bg-muted/60 px-3 py-1 text-xs text-gray-700",children:ce(C)},C))})]}),M&&e.jsxs("div",{children:[e.jsxs("h3",{className:"flex items-center gap-2 text-sm font-semibold text-gray-900 mb-2",children:[e.jsx(Oi,{className:"h-4 w-4 text-muted-foreground"}),"Equipment & services"]}),e.jsx("div",{className:"flex flex-wrap gap-2",children:i.map(C=>e.jsx("span",{className:"rounded-full bg-muted/60 px-3 py-1 text-xs text-gray-700",children:ce(C)},C))})]}),N&&e.jsxs("div",{children:[e.jsxs("h3",{className:"flex items-center gap-2 text-sm font-semibold text-gray-900 mb-3",children:[e.jsx($s,{className:"h-4 w-4 text-muted-foreground"}),"Catering capabilities"]}),e.jsx("div",{className:"space-y-3",children:a.map(C=>e.jsxs("div",{children:[e.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:C.label}),e.jsx("div",{className:"flex flex-wrap gap-2 mt-1",children:C.values.map($=>e.jsx("span",{className:"rounded-full bg-muted/60 px-3 py-1 text-xs text-gray-700",children:ce($)},$))})]},C.field))})]}),I&&e.jsxs("div",{children:[e.jsxs("h3",{className:"flex items-center gap-2 text-sm font-semibold text-gray-900 mb-2",children:[e.jsx($s,{className:"h-4 w-4 text-muted-foreground"}),"Catering services"]}),e.jsx("div",{className:"flex flex-wrap gap-2",children:c.map(C=>e.jsx("span",{className:"rounded-full bg-muted/60 px-3 py-1 text-xs text-gray-700",children:ce(C)},C))})]}),D&&e.jsxs("div",{children:[e.jsxs("h3",{className:"flex items-center gap-2 text-sm font-semibold text-gray-900 mb-2",children:[e.jsx(Pi,{className:"h-4 w-4 text-muted-foreground"}),"Requirements"]}),e.jsxs("div",{className:"space-y-2",children:[(_=m.licenses)!=null&&_.length?e.jsxs("div",{children:[e.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Licenses"}),e.jsx("div",{className:"flex flex-wrap gap-2 mt-1",children:m.licenses.map(C=>e.jsx("span",{className:"rounded-full bg-muted/60 px-3 py-1 text-xs text-gray-700",children:ce(C)},C))})]}):null,m.insurance===!0?e.jsx("span",{className:"inline-flex rounded-full bg-muted/60 px-3 py-1 text-xs text-gray-700",children:"Insured"}):null,(Q=m.certifications)!=null&&Q.length?e.jsxs("div",{children:[e.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Certifications"}),e.jsx("div",{className:"flex flex-wrap gap-2 mt-1",children:m.certifications.map(C=>e.jsx("span",{className:"rounded-full bg-muted/60 px-3 py-1 text-xs text-gray-700",children:ce(C)},C))})]}):null]})]}),S&&x&&e.jsxs("div",{children:[e.jsxs("h3",{className:"flex items-center gap-2 text-sm font-semibold text-gray-900 mb-2",children:[e.jsx($i,{className:"h-4 w-4 text-muted-foreground"}),"Photography"]}),e.jsxs("div",{className:"space-y-2",children:[Array.isArray(x.photoStyles)&&x.photoStyles.length>0&&e.jsxs("div",{children:[e.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Styles"}),e.jsx("div",{className:"flex flex-wrap gap-2 mt-1",children:x.photoStyles.map(C=>e.jsx("span",{className:"rounded-full bg-muted/60 px-3 py-1 text-xs text-gray-700",children:ce(C)},C))})]}),Array.isArray(x.eventTypes)&&x.eventTypes.length>0&&e.jsxs("div",{children:[e.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Event types"}),e.jsx("div",{className:"flex flex-wrap gap-2 mt-1",children:x.eventTypes.map(C=>e.jsx("span",{className:"rounded-full bg-muted/60 px-3 py-1 text-xs text-gray-700",children:ce(C)},C))})]}),x.secondShooterAvailable===!0&&e.jsx("span",{className:"inline-flex rounded-full bg-muted/60 px-3 py-1 text-xs text-gray-700",children:"Second shooter available"}),x.shootingLocation&&e.jsxs("p",{className:"text-sm text-gray-700",children:[e.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Shooting location: "}),ce(x.shootingLocation)]})]})]}),p&&h&&e.jsxs("div",{children:[e.jsxs("h3",{className:"flex items-center gap-2 text-sm font-semibold text-gray-900 mb-2",children:[e.jsx(yi,{className:"h-4 w-4 text-muted-foreground"}),"Videography"]}),e.jsxs("div",{className:"space-y-2",children:[Array.isArray(h.videoStyles)&&h.videoStyles.length>0&&e.jsxs("div",{children:[e.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Styles"}),e.jsx("div",{className:"flex flex-wrap gap-2 mt-1",children:h.videoStyles.map(C=>e.jsx("span",{className:"rounded-full bg-muted/60 px-3 py-1 text-xs text-gray-700",children:ce(C)},C))})]}),Array.isArray(h.eventTypes)&&h.eventTypes.length>0&&e.jsxs("div",{children:[e.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Event types"}),e.jsx("div",{className:"flex flex-wrap gap-2 mt-1",children:h.eventTypes.map(C=>e.jsx("span",{className:"rounded-full bg-muted/60 px-3 py-1 text-xs text-gray-700",children:ce(C)},C))})]}),Array.isArray(h.cameraTypes)&&h.cameraTypes.length>0||Array.isArray(h.lightingEquipment)&&h.lightingEquipment.length>0?e.jsxs("div",{className:"flex flex-wrap gap-2",children:[(V=h.cameraTypes)==null?void 0:V.map(C=>e.jsx("span",{className:"rounded-full bg-muted/60 px-3 py-1 text-xs text-gray-700",children:ce(C)},C)),(z=h.lightingEquipment)==null?void 0:z.map(C=>e.jsx("span",{className:"rounded-full bg-muted/60 px-3 py-1 text-xs text-gray-700",children:ce(C)},C))]}):null,h.droneAvailable===!0&&e.jsx("span",{className:"inline-flex rounded-full bg-muted/60 px-3 py-1 text-xs text-gray-700",children:"Drone available"})]})]}),A&&g&&e.jsxs("div",{children:[e.jsxs("h3",{className:"flex items-center gap-2 text-sm font-semibold text-gray-900 mb-2",children:[e.jsx(Tr,{className:"h-4 w-4 text-muted-foreground"}),"Bartending"]}),e.jsxs("div",{className:"space-y-2",children:[g.serviceType&&e.jsxs("p",{className:"text-sm text-gray-700",children:[e.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Service type: "}),ce(g.serviceType)]}),Array.isArray(g.equipmentProvided)&&g.equipmentProvided.length>0&&e.jsxs("div",{children:[e.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Equipment provided"}),e.jsx("div",{className:"flex flex-wrap gap-2 mt-1",children:g.equipmentProvided.map(C=>e.jsx("span",{className:"rounded-full bg-muted/60 px-3 py-1 text-xs text-gray-700",children:ce(C)},C))})]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[g.offersSignatureCocktails===!0&&e.jsx("span",{className:"rounded-full bg-muted/60 px-3 py-1 text-xs text-gray-700",children:"Signature cocktails"}),g.offersCustomCocktailMenus===!0&&e.jsx("span",{className:"rounded-full bg-muted/60 px-3 py-1 text-xs text-gray-700",children:"Custom menus"}),g.byobAllowed===!0&&e.jsx("span",{className:"rounded-full bg-muted/60 px-3 py-1 text-xs text-gray-700",children:"BYOB allowed"}),g.providesAlcohol===!0&&e.jsx("span",{className:"rounded-full bg-muted/60 px-3 py-1 text-xs text-gray-700",children:"Provides alcohol"})]})]})]}),w&&k&&e.jsxs("div",{children:[e.jsxs("h3",{className:"flex items-center gap-2 text-sm font-semibold text-gray-900 mb-2",children:[e.jsx(Ns,{className:"h-4 w-4 text-muted-foreground"}),"Cleaning"]}),e.jsxs("div",{className:"space-y-2",children:[Array.isArray(k.cleaningTypes)&&k.cleaningTypes.length>0&&e.jsxs("div",{children:[e.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Cleaning types"}),e.jsx("div",{className:"flex flex-wrap gap-2 mt-1",children:k.cleaningTypes.map(C=>e.jsx("span",{className:"rounded-full bg-muted/60 px-3 py-1 text-xs text-gray-700",children:ce(C)},C))})]}),Array.isArray(k.specializations)&&k.specializations.length>0&&e.jsxs("div",{children:[e.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Event contexts"}),e.jsx("div",{className:"flex flex-wrap gap-2 mt-1",children:k.specializations.map(C=>e.jsx("span",{className:"rounded-full bg-muted/60 px-3 py-1 text-xs text-gray-700",children:ce(C)},C))})]}),k.teamSize&&e.jsxs("p",{className:"text-sm text-gray-700",children:[e.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Team size: "}),ce(k.teamSize)]}),k.bringsOwnSupplies&&e.jsxs("p",{className:"text-sm text-gray-700",children:[e.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Supplies: "}),ce(k.bringsOwnSupplies)]})]})]}),E&&y&&e.jsxs("div",{children:[e.jsxs("h3",{className:"flex items-center gap-2 text-sm font-semibold text-gray-900 mb-2",children:[e.jsx(Zr,{className:"h-4 w-4 text-muted-foreground"}),"Equipment rental"]}),e.jsxs("div",{className:"space-y-2",children:[Array.isArray(y.rentalCategories)&&y.rentalCategories.length>0&&e.jsxs("div",{children:[e.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Categories"}),e.jsx("div",{className:"flex flex-wrap gap-2 mt-1",children:y.rentalCategories.map(C=>e.jsx("span",{className:"rounded-full bg-muted/60 px-3 py-1 text-xs text-gray-700",children:ce(C)},C))})]}),Array.isArray(y.addOnServices)&&y.addOnServices.length>0&&e.jsxs("div",{children:[e.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Operational services"}),e.jsx("div",{className:"flex flex-wrap gap-2 mt-1",children:y.addOnServices.map(C=>e.jsx("span",{className:"rounded-full bg-muted/60 px-3 py-1 text-xs text-gray-700",children:ce(C)},C))})]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[y.providesSetup===!0&&e.jsx("span",{className:"rounded-full bg-muted/60 px-3 py-1 text-xs text-gray-700",children:"Setup included"}),y.providesBreakdown===!0&&e.jsx("span",{className:"rounded-full bg-muted/60 px-3 py-1 text-xs text-gray-700",children:"Breakdown included"})]})]})]})]})]})},lo="AIzaSyATWdF6OVbFX1X_OuYCMZdxWZi7ggnhRWI",oo=({cityCoords:t,radiusMiles:n})=>{const s=Yr(),r=b.useRef(null);return b.useEffect(()=>{if(!s||!t){r.current&&(r.current.setMap(null),r.current=null);return}if(!n||n<=0){r.current&&(r.current.setMap(null),r.current=null);return}const o=n*1609.34;r.current?(r.current.setCenter(t),r.current.setRadius(o)):r.current=new google.maps.Circle({map:s,center:t,radius:o,fillColor:"hsl(6 100% 66%)",fillOpacity:.2,strokeColor:"hsl(6 100% 66%)",strokeOpacity:.5,strokeWeight:2});const l=r.current.getBounds();l&&s.fitBounds(l)},[s,t,n]),null},co=({cityCoords:t,radiusMiles:n,serviceArea:s,isMobile:r})=>{const o=r?"300px":"400px";return t?e.jsxs("section",{className:"space-y-4",children:[e.jsx("h2",{className:r?"text-lg font-semibold text-gray-900":"text-xl font-semibold text-gray-900",children:"Where I'll travel"}),e.jsx("div",{className:le("w-full overflow-hidden rounded-2xl border border-border/70"),style:{height:o},children:e.jsx(Sn,{apiKey:lo,children:e.jsxs(Ur,{mapId:"53e7a282ade2ebddd8c812b0",defaultCenter:t,defaultZoom:n?n>50?8:n>25?9:10:10,gestureHandling:"cooperative",disableDefaultUI:!1,zoomControl:!0,fullscreenControl:!0,mapTypeControl:!1,streetViewControl:!1,scaleControl:!1,rotateControl:!1,children:[e.jsx(oo,{cityCoords:t,radiusMiles:n||(s==null?void 0:s.radiusMiles)||(s==null?void 0:s.radius)}),e.jsx(Wr,{position:t,title:"Service Location",zIndex:1e3,children:e.jsx("div",{className:"flex h-8 w-8 items-center justify-center rounded-full bg-[hsl(var(--brand))] text-white shadow-lg ring-2 ring-white pointer-events-none",children:e.jsx(lt,{className:"h-4 w-4"})})})]})})}),((s==null?void 0:s.cities)||(s==null?void 0:s.radiusMiles)||(s==null?void 0:s.radius)||(s==null?void 0:s.travelFee))&&e.jsxs("div",{className:"space-y-1.5 text-sm",children:[s.cities&&s.cities.length>0&&e.jsxs("p",{className:"font-medium text-gray-900",children:["Serves: ",s.cities.join(", ")]}),(s.radiusMiles||s.radius)&&e.jsxs("p",{className:"text-muted-foreground",children:["Travel radius: ",s.radiusMiles||s.radius," miles"]}),s.travelFee&&e.jsxs("p",{className:"text-muted-foreground",children:["Travel fee: ",ie(s.travelFee)]})]})]}):e.jsx("div",{className:"h-[300px] w-full overflow-hidden rounded-2xl border border-border/70",children:e.jsx("div",{className:"flex h-full items-center justify-center bg-muted/40 text-muted-foreground",children:e.jsxs("div",{className:"text-center",children:[e.jsx(lt,{className:"mx-auto h-12 w-12 mb-4"}),e.jsx("p",{className:"text-sm",children:"Map showing service area"})]})})})},hr=({cancellationPolicy:t=Ss,cancellationNotes:n,isMobile:s})=>{const r=s?"text-xs":"text-sm",o="text-sm";return e.jsxs("section",{className:"space-y-4",children:[e.jsx("h2",{className:s?"text-lg font-semibold text-gray-900":"text-xl font-semibold text-gray-900",children:"Things to know"}),e.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[e.jsx("div",{className:"rounded-2xl border border-border/70 bg-white p-4 shadow-sm",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(fn,{className:"h-5 w-5 text-brand flex-shrink-0 mt-0.5"}),e.jsxs("div",{children:[e.jsx("h3",{className:`${o} font-semibold text-gray-900`,children:"Cancellation"}),e.jsx("p",{className:`mt-1 ${r} text-muted-foreground`,children:Ai(t).shortLabel}),n&&n.trim()&&e.jsx("p",{className:`mt-2 ${r} text-gray-700 leading-relaxed whitespace-pre-wrap`,children:n.trim()})]})]})}),e.jsx("div",{className:"rounded-2xl border border-border/70 bg-white p-4 shadow-sm",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(Ms,{className:"h-5 w-5 text-brand flex-shrink-0 mt-0.5"}),e.jsxs("div",{children:[e.jsx("h3",{className:`${o} font-semibold text-gray-900`,children:"Reviews"}),e.jsx("p",{className:`mt-1 ${r} text-muted-foreground`,children:"New"})]})]})})]})]})},uo="Publish this listing to accept bookings.",mo=({pricingRange:t,minimumBooking:n,onShowDates:s,cancellationPolicy:r=Ss,disabled:o=!1,disabledMessage:l=uo,onRequestCustomQuote:i})=>{const c=$n(r);return e.jsx("div",{className:"rounded-[32px] border border-border/70 bg-white p-6 shadow-xl",children:e.jsxs("div",{className:"space-y-4",children:[t&&e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-baseline gap-2",children:[e.jsxs("span",{className:"text-2xl font-semibold text-gray-900",children:["From ",ie(t.min),t.min!==t.max&&` - ${ie(t.max)}`]}),e.jsxs("span",{className:"text-xs uppercase tracking-wide text-muted-foreground",children:["/ ",t.label||"per guest"]}),c&&e.jsx("div",{className:"ml-auto",children:e.jsxs(ge,{variant:"secondary",className:"rounded-full px-2 py-0.5 text-[10px] bg-green-50 text-green-700 border-green-200 font-semibold",children:[e.jsx(Be,{className:"h-3 w-3 mr-1"}),"Free cancellation"]})})]}),n&&e.jsxs("div",{className:"text-sm text-muted-foreground mt-1",children:["Minimum ",ie(n)," to book"]})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"You won't be charged yet. Share your event details and get a customized proposal."}),e.jsx(je,{}),o?e.jsx("div",{className:"rounded-full py-6 px-4 text-center text-sm text-muted-foreground bg-muted/50 border border-border/70",children:l}):e.jsxs(e.Fragment,{children:[e.jsx(X,{className:"w-full rounded-full py-6 text-base font-semibold bg-brand hover:bg-brand-600 text-white",onClick:s,children:"Show dates"}),i&&e.jsx("button",{type:"button",onClick:i,className:"w-full text-sm text-center text-brand hover:text-brand-600 underline-offset-4 hover:underline mt-1",children:"Request a custom quote"})]}),e.jsx(je,{}),e.jsxs("div",{className:"space-y-2 text-xs text-muted-foreground",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Te,{className:"h-3 w-3 text-brand"}),e.jsx("span",{children:"Response time: Usually within 1 hour"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Be,{className:"h-3 w-3 text-brand"}),e.jsx("span",{children:"Verified partner"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(fn,{className:"h-3 w-3 text-brand"}),e.jsx("span",{children:"Background checked"})]})]})]})})},xo=({hostDisplayName:t,serviceName:n,serviceTypeInfo:s,locationLabel:r,hostAvatar:o,hostPublicId:l,aboutMe:i,tagline:c,isSaved:d,isMessaging:a=!1,onShareClick:f,onSaveClick:u,onMessageClick:m})=>{const x=t||n.split(" ")[n.split(" ").length-1]||n.split(" ")[0],h=l?`/u/${l}`:null,g=e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"flex justify-center",children:e.jsx(xt,{src:o||void 0,alt:t,className:"h-16 w-16 rounded-full object-cover ring-2 ring-border transition-shadow duration-200 group-hover:ring-brand",fallback:"/default-profile-icon.png"})}),e.jsxs("div",{className:"text-center space-y-1.5 min-w-0",children:[e.jsx("h3",{className:"text-base font-semibold text-gray-900 break-words",children:x}),e.jsxs("p",{className:"text-sm text-muted-foreground break-words",children:[(s==null?void 0:s.label)||"Service Provider"," in ",r]})]})]});return e.jsx("div",{className:"rounded-[32px] border border-border/70 bg-white p-6 shadow-xl min-w-0",children:e.jsxs("div",{className:"space-y-3 min-w-0",children:[h?e.jsx("a",{href:h,target:"_blank",rel:"noopener noreferrer",className:"group block focus:outline-none focus-visible:ring-2 focus-visible:ring-brand focus-visible:ring-offset-2 rounded-full w-fit mx-auto","aria-label":`View ${x}'s profile`,children:g}):g,e.jsxs("div",{className:"text-center space-y-1.5 min-w-0",children:[e.jsxs("div",{className:"flex items-center justify-center gap-2 text-sm text-muted-foreground flex-wrap",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(Ms,{className:"h-3.5 w-3.5 fill-amber-400 text-amber-400"}),e.jsx("span",{className:"font-medium text-gray-900",children:"New"})]}),i.yearsOfExperience&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(Tt,{className:"h-3.5 w-3.5"}),e.jsxs("span",{children:[i.yearsOfExperience,"yr"]})]})]})]}),c&&e.jsx("p",{className:"text-sm text-gray-700 leading-relaxed min-w-0 break-words whitespace-pre-line",children:c}),e.jsxs("div",{className:"flex items-center justify-center gap-2 pt-0.5",children:[e.jsx(X,{variant:"outline",size:"icon",className:"h-8 w-8 rounded-full",onClick:f,children:e.jsx(Dt,{className:"h-3.5 w-3.5"})}),u!=null&&e.jsx(X,{variant:"outline",size:"icon",className:le("h-8 w-8 rounded-full",d&&"border-brand text-brand"),onClick:u,children:e.jsx(Ot,{className:le("h-3.5 w-3.5",d&&"fill-current")})}),e.jsx(X,{variant:"outline",size:"icon",className:"h-8 w-8 rounded-full",onClick:m,disabled:a,children:a?e.jsx(rt,{className:"h-3.5 w-3.5 animate-spin"}):e.jsx(Gi,{className:"h-3.5 w-3.5"})})]})]})]})})},ho=({package:t,feeInput:n,isOpen:s,onOpenChange:r,onSelectPackage:o})=>{var f,u;const l=vs(),i=b.useMemo(()=>t?$t(t,n)??null:null,[n,t]),c=b.useMemo(()=>{if(!t)return"";const m=ie(qt(t,n)||0);return t.priceType==="per_person"||t.priceType==="per_guest"?`${m} / per guest`:t.priceType==="per_hour"?`${m} / per hour`:`${m} / per event`},[n,t]),d=b.useMemo(()=>!t||!t.guestLimit?null:t.guestLimit.min&&t.guestLimit.max?`${t.guestLimit.min} - ${t.guestLimit.max} guests`:t.guestLimit.min?`${t.guestLimit.min}+ guests`:t.guestLimit.max?`Up to ${t.guestLimit.max} guests`:null,[t]),a=b.useMemo(()=>{if(!t||!t.duration)return null;const m=[];return t.duration.hours>0&&m.push(`${t.duration.hours} hour${t.duration.hours>1?"s":""}`),t.duration.minutes>0&&m.push(`${t.duration.minutes} minute${t.duration.minutes>1?"s":""}`),m.join(" ")},[t]);return t?l?e.jsx(Ke,{open:s,onOpenChange:r,children:e.jsxs(Qe,{hideCloseButton:!0,mobileBottomSheet:l,children:[t.image&&e.jsx("div",{className:"relative h-48 overflow-hidden -mx-4 -mt-4 mb-4",style:{width:"calc(100% + 2rem)",marginLeft:"-1rem",marginRight:"-1rem"},children:e.jsx("img",{src:t.image,alt:t.name,className:"w-full h-full object-cover"})}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs(Ze,{className:"px-0 pt-0 pb-0 space-y-2",children:[e.jsx(Je,{className:"text-xl font-semibold text-gray-900",children:t.name}),e.jsx(Xe,{children:"Package details and pricing information"}),e.jsx("div",{className:"text-base font-semibold text-brand",children:c})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[d&&e.jsxs("div",{className:"flex items-center gap-3 p-3 bg-gray-50 rounded-xl",children:[e.jsx("div",{className:"p-2 bg-white rounded-lg",children:e.jsx(Tt,{className:"h-4 w-4 text-gray-600"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-gray-500 mb-0.5",children:"Guest range"}),e.jsx("p",{className:"text-sm font-semibold text-gray-900",children:d})]})]}),a&&e.jsxs("div",{className:"flex items-center gap-3 p-3 bg-gray-50 rounded-xl",children:[e.jsx("div",{className:"p-2 bg-white rounded-lg",children:e.jsx(Te,{className:"h-4 w-4 text-gray-600"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-gray-500 mb-0.5",children:"Duration"}),e.jsx("p",{className:"text-sm font-semibold text-gray-900",children:a})]})]})]}),t.includes&&t.includes.length>0&&e.jsxs("div",{className:"space-y-3",children:[e.jsx("h4",{className:"text-sm font-semibold text-gray-900",children:"What's included:"}),e.jsx("ul",{className:"space-y-2",children:t.includes.map((m,x)=>e.jsxs("li",{className:"flex items-start gap-3 text-sm text-gray-700 min-w-0",children:[e.jsx(Be,{className:"h-5 w-5 text-brand flex-shrink-0 mt-0.5"}),e.jsx("span",{className:"break-words",children:m})]},x))})]}),t.description&&e.jsx("div",{className:"pt-2 min-w-0 overflow-visible",children:e.jsx("p",{className:"text-sm text-gray-700 leading-relaxed whitespace-pre-line min-w-0 break-words",children:t.description})}),i&&e.jsx("div",{className:"p-4 bg-brand/5 border border-brand/20 rounded-xl",children:e.jsxs("p",{className:"text-sm text-gray-800 font-medium",children:["Minimum booking: ",ie(i),((f=t.guestLimit)==null?void 0:f.min)&&` (${t.guestLimit.min} guests minimum)`]})}),e.jsx("div",{className:"pt-4 border-t border-gray-200 mt-6",children:e.jsx(X,{className:"w-full rounded-full py-5 text-sm font-semibold bg-brand hover:bg-brand-600 text-white",onClick:o,children:"Select this package"})})]})]})}):e.jsx(Ke,{open:s,onOpenChange:r,children:e.jsxs(Qe,{className:"max-w-2xl max-h-[90vh] overflow-hidden p-0 gap-0 flex flex-col !border-0",children:[t.image&&e.jsx("div",{className:"relative h-64 overflow-hidden flex-shrink-0 -mx-1",children:e.jsx("img",{src:t.image,alt:t.name,className:"w-full h-full object-cover"})}),e.jsxs("div",{className:"flex-1 overflow-y-auto overflow-x-hidden px-6 py-6 space-y-6 min-h-0 min-w-0",children:[e.jsxs(Ze,{className:"space-y-2",children:[e.jsx(Je,{className:"text-2xl font-semibold text-gray-900",children:t.name}),e.jsx(Xe,{children:"Package details and pricing information"}),e.jsx("div",{className:"text-lg font-semibold text-brand",children:c})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[d&&e.jsxs("div",{className:"flex items-center gap-3 p-3 bg-gray-50 rounded-xl",children:[e.jsx("div",{className:"p-2 bg-white rounded-lg",children:e.jsx(Tt,{className:"h-4 w-4 text-gray-600"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-gray-500 mb-0.5",children:"Guest range"}),e.jsx("p",{className:"text-sm font-semibold text-gray-900",children:d})]})]}),a&&e.jsxs("div",{className:"flex items-center gap-3 p-3 bg-gray-50 rounded-xl",children:[e.jsx("div",{className:"p-2 bg-white rounded-lg",children:e.jsx(Te,{className:"h-4 w-4 text-gray-600"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-gray-500 mb-0.5",children:"Duration"}),e.jsx("p",{className:"text-sm font-semibold text-gray-900",children:a})]})]})]}),t.includes&&t.includes.length>0&&e.jsxs("div",{className:"space-y-3",children:[e.jsx("h4",{className:"text-sm font-semibold text-gray-900",children:"What's included:"}),e.jsx("ul",{className:"space-y-2",children:t.includes.map((m,x)=>e.jsxs("li",{className:"flex items-start gap-3 text-sm text-gray-700 min-w-0",children:[e.jsx(Be,{className:"h-5 w-5 text-brand flex-shrink-0 mt-0.5"}),e.jsx("span",{className:"break-words",children:m})]},x))})]}),t.description&&e.jsx("div",{className:"pt-2 min-w-0",children:e.jsx("p",{className:"text-sm text-gray-700 leading-relaxed whitespace-pre-line min-w-0 break-words",children:t.description})}),i&&e.jsx("div",{className:"p-4 bg-brand/5 border border-brand/20 rounded-xl",children:e.jsxs("p",{className:"text-sm text-gray-800 font-medium",children:["Minimum booking: ",ie(i),((u=t.guestLimit)==null?void 0:u.min)&&` (${t.guestLimit.min} guests minimum)`]})})]}),e.jsx("div",{className:"border-t border-gray-200 px-6 py-4 bg-white flex-shrink-0",children:e.jsx(X,{className:"w-full rounded-full py-6 text-base font-semibold bg-brand hover:bg-brand-600 text-white",onClick:o,children:"Select this package"})})]})}):null},fo=({offerings:t,feeInput:n,isOpen:s,onOpenChange:r,onSelectPackage:o,onViewDetails:l})=>{const i=vs();return t.length===0?null:e.jsx(Ke,{open:s,onOpenChange:r,children:e.jsxs(Qe,{className:i?"":"!max-w-2xl w-full max-h-[90vh] overflow-hidden p-0 gap-0 flex flex-col",mobileBottomSheet:i,hideCloseButton:i,children:[e.jsx("div",{className:`${i?"pb-4":"px-6 pt-6 pb-4"} border-b border-gray-200 flex-shrink-0`,children:e.jsxs(Ze,{children:[e.jsx(Je,{className:`${i?"text-xl":"text-2xl"} font-semibold text-gray-900`,children:"Select a Package"}),e.jsx(Xe,{children:"Choose a package that fits your event needs"})]})}),e.jsx("div",{className:`flex-1 overflow-y-auto overflow-x-hidden min-w-0 ${i?"pt-14 pb-4":"px-6 py-6"} space-y-4`,children:t.map((c,d)=>{var g,k,y,v,T;const a=(g=c.guestLimit)==null?void 0:g.min,f=$t(c,n),u=qt(c,n),m=c.duration&&c.duration.hours>0?`${c.duration.hours} hour${c.duration.hours>1?"s":""}`:"",x=(k=c.guestLimit)!=null&&k.min&&((y=c.guestLimit)!=null&&y.max)?`${c.guestLimit.min} - ${c.guestLimit.max} guests`:(v=c.guestLimit)!=null&&v.min?`${c.guestLimit.min}+ guests`:(T=c.guestLimit)!=null&&T.max?`Up to ${c.guestLimit.max} guests`:null,h=e.jsxs(e.Fragment,{children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-base font-semibold text-gray-900 mb-1",children:c.name}),c.description&&e.jsx("p",{className:"text-sm text-gray-600 line-clamp-2 mb-2 min-w-0 break-words overflow-hidden",children:c.description})]}),(x||m)&&e.jsxs("div",{className:"flex items-center gap-4 text-xs text-gray-600",children:[x&&e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(Tt,{className:"h-3 w-3 flex-shrink-0"}),e.jsx("span",{children:x})]}),m&&e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(Te,{className:"h-3 w-3 flex-shrink-0"}),e.jsx("span",{children:m})]})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"text-lg font-semibold text-gray-900",children:[ie(u),e.jsxs("span",{className:"text-sm font-normal text-muted-foreground ml-1",children:[c.priceType==="per_person"||c.priceType==="per_guest"?"/ guest":"",c.priceType==="per_hour"?"/ hour":"",c.priceType==="per_event"||c.priceType==="fixed"?"/ event":""]})]}),f&&e.jsxs("p",{className:"text-xs text-gray-600",children:["Minimum ",ie(f),a&&` (${a} guests minimum)`]})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2 pt-2 min-w-0",children:[e.jsx(X,{variant:"outline",className:"rounded-full text-sm min-w-0 shrink-0",onClick:()=>{l(c),r(!1)},children:"View Details"}),e.jsx(X,{className:"rounded-full text-sm bg-brand hover:bg-brand-600 text-white min-w-0 shrink-0",onClick:()=>{o(c)},children:"Select Package"})]})]});return e.jsx("div",{className:le("min-w-0 rounded-2xl border border-border/70 bg-white p-4 shadow-sm hover:border-brand/50 hover:shadow-md transition-all overflow-hidden",i&&d===0&&"-mt-10"),children:i?e.jsxs(e.Fragment,{children:[c.image&&e.jsx("div",{className:"-mx-4 -mt-4 w-[calc(100%+2rem)] mb-4",children:e.jsx("img",{src:c.image,alt:c.name,className:"w-full aspect-video object-cover rounded-t-2xl"})}),e.jsx("div",{className:"flex flex-col min-w-0 space-y-2",children:h})]}):e.jsxs("div",{className:"flex gap-4 min-w-0",children:[c.image&&e.jsx("img",{src:c.image,alt:c.name,className:"h-24 w-24 rounded-xl object-cover flex-shrink-0"}),e.jsx("div",{className:"flex-1 min-w-0 space-y-2 overflow-hidden",children:h})]})},c.id)})})]})})},po=t=>{if(!(t!=null&&t.options))return{};const n={};for(const s of t.options)s.required&&!s.multiSelect&&s.choices.length>0?n[s.optionId]=[s.choices[0].choiceId]:n[s.optionId]=[];return n},ln=(t,n)=>{if(t.required&&n.length===0)return!1;const s=t.minSelections??(t.required?1:0),r=t.maxSelections??(t.multiSelect?t.choices.length:1);return n.length>=s&&n.length<=r},go=({item:t,open:n,onOpenChange:s,feeInput:r,onAddToCart:o,isMobile:l=!1})=>{const[i,c]=b.useState(1),[d,a]=b.useState({});b.useEffect(()=>{n&&t&&(c(t.minQuantity??1),a(po(t)))},[n,t]);const f=b.useMemo(()=>t!=null&&t.options?t.options.every(N=>ln(N,d[N.optionId]??[])):!0,[t,d]),u=(t==null?void 0:t.minQuantity)??1,m=(t==null?void 0:t.maxQuantity)??999,h=b.useMemo(()=>{if(!t)return 0;let N=0;for(const I of t.options??[]){const D=d[I.optionId]??[];for(const S of D){const p=I.choices.find(A=>A.choiceId===S);p&&(N+=p.priceDelta)}}return t.price+N},[t,d])*i,g=b.useMemo(()=>Ct(h,r)??h/100,[r,h]),k=(N,I)=>{a(D=>{const S=D[N.optionId]??[];if(N.multiSelect){const p=N.maxSelections??N.choices.length,w=S.includes(I)?S.filter(E=>E!==I):S.length<p?[...S,I]:S;return{...D,[N.optionId]:w}}return{...D,[N.optionId]:[I]}})},y=()=>{if(!t||!f)return;const N=Object.entries(d).flatMap(([I,D])=>D.map(S=>({optionId:I,choiceId:S})));o({item:t,quantity:i,selectedChoices:N})};if(!t)return null;const v=t.itemTypeTags??[],T=v.length>0?v.map(N=>Ut(N)).join(" "):null,L=e.jsxs("div",{className:"space-y-5",children:[t.imageUrl?e.jsx("img",{src:t.imageUrl,alt:t.name,className:"w-full h-48 md:h-64 rounded-xl object-cover border border-border/60"}):e.jsx("div",{className:"w-full h-48 md:h-64 rounded-xl bg-muted flex items-center justify-center text-muted-foreground",children:e.jsx(Dn,{className:"h-10 w-10"})}),e.jsxs("div",{className:"space-y-2",children:[t.servesNumPeople||t.unit?e.jsx("p",{className:"text-xs font-semibold text-muted-foreground",children:t.servesNumPeople?`Serves ${t.servesNumPeople}`:On(t.unit)}):null,t.description&&e.jsx("p",{className:"text-sm text-gray-700 leading-6",children:t.description}),(v.length>0||t.foodLabelingTags&&t.foodLabelingTags.length>0)&&e.jsxs("div",{className:"flex flex-wrap gap-1 pt-1",children:[v.map(N=>e.jsx(ge,{variant:"outline",className:"text-xs border-slate-300 text-slate-700",title:Ut(N),children:ms(N)},N)),t.foodLabelingTags.map(N=>e.jsx(ge,{variant:"secondary",className:"text-xs",children:Pn(N)},N))]}),T?e.jsx("p",{className:"text-xs text-muted-foreground",children:T}):null]}),(t.options??[]).length>0&&e.jsx(je,{}),(t.options??[]).map(N=>{const I=d[N.optionId]??[],D=!N.multiSelect,S=ln(N,I);return e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-baseline justify-between gap-2",children:[e.jsxs("div",{children:[e.jsx(Ne,{className:"text-sm font-semibold text-gray-900",children:N.name}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[N.required?"Required":"Optional",N.multiSelect?` · Choose${N.minSelections?` at least ${N.minSelections}`:""}${N.maxSelections?` up to ${N.maxSelections}`:""}`:" · Choose 1"]})]}),!S&&N.required&&e.jsx("span",{className:"text-xs text-destructive",children:"Required"})]}),D?e.jsx(Mr,{value:I[0]??"",onValueChange:p=>k(N,p),className:"space-y-1.5",children:N.choices.map(p=>e.jsxs("label",{className:le("flex items-center justify-between gap-3 rounded-lg border border-border/60 px-3 py-2 cursor-pointer","hover:bg-muted/50 transition-colors",I.includes(p.choiceId)&&"border-brand bg-brand/5"),children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Ar,{value:p.choiceId,id:p.choiceId}),e.jsx("span",{className:"text-sm",children:p.name})]}),p.priceDelta>0&&e.jsxs("span",{className:"text-sm text-muted-foreground",children:["+",ie(Ct(p.priceDelta,r)??p.priceDelta/100)]})]},p.choiceId))}):e.jsx("div",{className:"space-y-1.5",children:N.choices.map(p=>{const A=I.includes(p.choiceId);return e.jsxs("label",{className:le("flex items-center justify-between gap-3 rounded-lg border border-border/60 px-3 py-2 cursor-pointer","hover:bg-muted/50 transition-colors",A&&"border-brand bg-brand/5"),children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Ir,{checked:A,onCheckedChange:()=>k(N,p.choiceId)}),e.jsx("span",{className:"text-sm",children:p.name})]}),p.priceDelta>0&&e.jsxs("span",{className:"text-sm text-muted-foreground",children:["+",ie(Ct(p.priceDelta,r)??p.priceDelta/100)]})]},p.choiceId)})})]},N.optionId)}),e.jsx(je,{}),e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx(Ne,{className:"text-sm font-semibold text-gray-900",children:"Quantity"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(X,{type:"button",variant:"outline",size:"icon",onClick:()=>c(N=>Math.max(u,N-1)),disabled:i<=u,"aria-label":"Decrease quantity",children:e.jsx(qi,{className:"h-4 w-4"})}),e.jsx("span",{className:"w-10 text-center text-sm font-semibold","aria-live":"polite",children:i}),e.jsx(X,{type:"button",variant:"outline",size:"icon",onClick:()=>c(N=>Math.min(m,N+1)),disabled:i>=m,"aria-label":"Increase quantity",children:e.jsx(_i,{className:"h-4 w-4"})})]})]})]}),M=e.jsxs("div",{className:"flex w-full items-center justify-between gap-3",children:[e.jsxs("div",{className:"text-sm",children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:"Total"}),e.jsx("p",{className:"font-semibold text-gray-900",children:ie(g)})]}),e.jsxs(X,{type:"button",onClick:y,disabled:!f,className:"rounded-full px-5",children:["Add ",i," to cart · ",ie(g)]})]});return l?e.jsx(pn,{open:n,onOpenChange:s,children:e.jsxs(gn,{className:"max-h-[92vh]",children:[e.jsxs(bn,{className:"text-left",children:[e.jsx(yn,{children:t.name}),t.description&&e.jsx(jn,{className:"sr-only",children:t.description})]}),e.jsx("div",{className:"px-4 overflow-y-auto",children:L}),e.jsx(Nn,{children:M})]})}):e.jsx(Ke,{open:n,onOpenChange:s,children:e.jsxs(Qe,{className:"max-h-[90vh] overflow-y-auto sm:max-w-lg",children:[e.jsxs(Ze,{children:[e.jsx(Je,{children:t.name}),t.description&&e.jsx(Xe,{className:"sr-only",children:t.description})]}),L,e.jsx(vn,{children:M})]})})},fr=({menu:t,items:n,feeInput:s,onAddToCart:r,menuOrderProgress:o,interactive:l=!0,isMobile:i=!1,isRequestMode:c=!1,requestModeItems:d=[],requestModeSubtotalCents:a=0,onSubmitMenuRequest:f,onRemoveRequestModeItem:u,taxJurisdictionCollected:m=!1})=>{const x=b.useMemo(()=>[...t.categories].sort((S,p)=>S.sortOrder-p.sortOrder||S.name.localeCompare(p.name)),[t.categories]),h=b.useMemo(()=>{const S=new Map;for(const p of n){if(p.status&&p.status!=="active")continue;const A=S.get(p.categoryId)??[];A.push(p),S.set(p.categoryId,A)}for(const[,p]of S)p.sort((A,w)=>A.sortOrder-w.sortOrder||A.name.localeCompare(w.name));return S},[n]),g=b.useMemo(()=>{const S=new Map;for(const p of n)S.set(p.itemId,p);return S},[n]),k=b.useMemo(()=>x.filter(S=>(h.get(S.categoryId)??[]).length>0),[x,h]),[y,v]=b.useState(()=>{var S;return((S=k[0])==null?void 0:S.categoryId)??""});b.useEffect(()=>{!y&&k[0]&&v(k[0].categoryId)},[y,k]);const[T,L]=b.useState(null),M=b.useRef({}),N=b.useRef(null),I=b.useCallback(S=>{const p=M.current[S];if(!p)return;const A=p.getBoundingClientRect().top+window.scrollY-80;window.scrollTo({top:A,behavior:"smooth"}),v(S)},[]);b.useEffect(()=>{if(typeof IntersectionObserver>"u")return;const S=new IntersectionObserver(p=>{const A=p.filter(w=>w.isIntersecting).sort((w,E)=>E.intersectionRatio-w.intersectionRatio)[0];if(A!=null&&A.target.id){const w=A.target.dataset.categoryId;w&&v(w)}},{rootMargin:"-20% 0px -60% 0px",threshold:[.1,.3,.6]});for(const p of k){const A=M.current[p.categoryId];A&&S.observe(A)}return()=>S.disconnect()},[k]);const D=S=>{N.current&&N.current.scrollBy({left:S*200,behavior:"smooth"})};return k.length===0?null:e.jsxs("section",{"aria-labelledby":"catering-menu-heading",className:"space-y-4 min-w-0",children:[e.jsx("div",{className:"flex items-end justify-between gap-3",children:e.jsxs("div",{children:[e.jsx("h2",{id:"catering-menu-heading",className:le("font-semibold text-gray-900",i?"text-lg":"text-xl"),children:t.name||"Catering Menu"}),t.description&&e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:t.description}),(t.minGuests||t.leadTimeHours)&&e.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-2 text-xs text-muted-foreground",children:[t.minGuests?e.jsxs("span",{children:[t.minGuests,"+ guests"]}):null,t.minGuests&&t.leadTimeHours?e.jsx("span",{children:"·"}):null,t.leadTimeHours?e.jsxs("span",{children:[t.leadTimeHours,"h lead time"]}):null]})]})}),l&&!c&&t.minOrderAmount?e.jsx(bo,{feeInput:s,minCents:t.minOrderAmount,progress:o}):null,l&&c&&d.length>0?e.jsx(yo,{selections:d,itemsById:g,subtotalCents:a,feeInput:s,onSubmit:f,onRemove:u,taxJurisdictionCollected:m}):null,e.jsx("div",{className:"sticky top-16 z-10 -mx-2 md:mx-0 bg-white/95 backdrop-blur border-b border-border/60",role:"navigation","aria-label":"Menu categories",children:e.jsxs("div",{className:"flex items-center",children:[e.jsx("button",{type:"button",onClick:()=>D(-1),className:"hidden md:flex h-8 w-8 items-center justify-center text-muted-foreground hover:text-foreground shrink-0","aria-label":"Scroll categories left",children:e.jsx(Er,{className:"h-4 w-4"})}),e.jsx("div",{ref:N,className:"flex-1 flex overflow-x-auto whitespace-nowrap px-2 py-2 scroll-smooth no-scrollbar",children:k.map(S=>{const p=S.categoryId===y;return e.jsx("button",{type:"button",onClick:()=>I(S.categoryId),className:le("relative px-3 py-2 text-sm font-semibold transition-colors shrink-0","border-b-2 -mb-[2px]",p?"text-gray-900 border-brand":"text-muted-foreground border-transparent hover:text-gray-900 hover:bg-muted/40 rounded-t-md"),children:S.name},S.categoryId)})}),e.jsx("button",{type:"button",onClick:()=>D(1),className:"hidden md:flex h-8 w-8 items-center justify-center text-muted-foreground hover:text-foreground shrink-0","aria-label":"Scroll categories right",children:e.jsx(Lr,{className:"h-4 w-4"})})]})}),e.jsx("div",{className:"space-y-8",children:k.map(S=>e.jsx(jo,{category:S,items:h.get(S.categoryId)??[],feeInput:s,innerRef:p=>{M.current[S.categoryId]=p},interactive:l,onItemClick:l?p=>L(p):void 0},S.categoryId))}),e.jsx(go,{item:T,open:T!==null,onOpenChange:S=>{S||L(null)},feeInput:s,onAddToCart:S=>{r==null||r(S),L(null)},isMobile:i})]})},bo=({feeInput:t,minCents:n,progress:s})=>{const r=(s==null?void 0:s.currentCents)??0,o=(s==null?void 0:s.remainingCents)??n,l=(s==null?void 0:s.met)??!1,i=Math.min(100,Math.round(r/Math.max(n,1)*100)),c=it(n,t),d=it(r,t),a=it(o,t);return e.jsxs("div",{className:le("rounded-xl border px-3 py-2.5 flex items-center gap-3",l?"border-green-200 bg-green-50 text-green-900":"border-amber-200 bg-amber-50 text-amber-900"),role:"status",children:[e.jsx("div",{className:"shrink-0",children:l?e.jsx(Be,{className:"h-5 w-5 text-green-700","aria-hidden":!0}):e.jsx(zi,{className:"h-5 w-5 text-amber-700","aria-hidden":!0})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-sm font-semibold",children:l?"Minimum order met":`${c} minimum order`}),e.jsx("p",{className:"text-xs",children:s?l?`Cart total ${d} — ready to check out.`:r>0?`Cart total ${d} — add ${a} more to check out.`:`Add ${c} of items to your cart before checkout.`:"Build your order to this amount before checkout."}),s&&!l?e.jsx("div",{className:"mt-1.5 h-1 w-full rounded-full bg-amber-200/70 overflow-hidden","aria-hidden":!0,children:e.jsx("div",{className:"h-full bg-amber-500 transition-[width] duration-300",style:{width:`${i}%`}})}):null]})]})},yo=({selections:t,itemsById:n,subtotalCents:s,feeInput:r,onSubmit:o,onRemove:l,taxJurisdictionCollected:i=!1})=>{const[c,d]=b.useState(!0),a=t.reduce((g,k)=>g+(k.quantity??0),0),f=Ct(s,r)??0,u=ie(f)??"$0.00",m=Ii(r),x=s>0?Math.round(f*m.serviceFeePercent*100):0,h=s>0?Math.round((f+x/100)*100)/100:0;return e.jsxs("div",{className:"rounded-xl border border-brand/30 bg-brand/5 overflow-hidden",children:[e.jsxs("button",{type:"button",onClick:()=>d(g=>!g),className:"w-full flex items-center gap-3 px-4 py-3 text-left","aria-expanded":c,children:[e.jsx(Wi,{className:"h-5 w-5 text-brand shrink-0","aria-hidden":!0}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("p",{className:"text-sm font-semibold text-gray-900",children:["Your selections · ",a," ",a===1?"item":"items"," · ",u]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:c?"Tap to collapse":"Tap to review"})]}),e.jsx(Rr,{className:le("h-4 w-4 text-muted-foreground shrink-0 transition-transform duration-200",c&&"rotate-180"),"aria-hidden":!0})]}),c&&e.jsxs("div",{className:"border-t border-brand/20 px-4 pb-4 pt-3 space-y-3",children:[e.jsx("ul",{className:"space-y-2","aria-label":"Selected items",children:t.map((g,k)=>{var M;const y=n.get(g.menuItemId),v=g.quantity??0;let T=(y==null?void 0:y.price)??0;for(const N of g.selectedChoices??[]){const I=(M=y==null?void 0:y.options)==null?void 0:M.find(S=>S.optionId===N.optionId),D=I==null?void 0:I.choices.find(S=>S.choiceId===N.choiceId);D&&(T+=D.priceDelta)}const L=T*v;return e.jsxs("li",{className:"flex items-center gap-2 text-sm",children:[e.jsxs("span",{className:"shrink-0 w-5 text-center font-semibold text-brand text-xs",children:["×",v]}),e.jsx("span",{className:"flex-1 min-w-0 text-gray-800 truncate",children:(y==null?void 0:y.name)??g.menuItemId}),e.jsx("span",{className:"shrink-0 text-gray-700 font-medium text-xs tabular-nums",children:it(L,r)}),l&&e.jsx("button",{type:"button",onClick:()=>l(g.menuItemId,g.selectedChoices??[]),className:"shrink-0 rounded-full p-0.5 text-muted-foreground hover:bg-red-50 hover:text-red-500 transition-colors","aria-label":`Remove ${(y==null?void 0:y.name)??g.menuItemId}`,children:e.jsx(Zt,{className:"h-3.5 w-3.5"})})]},`${g.menuItemId}-${k}`)})}),e.jsxs("div",{className:"flex items-center justify-between pt-1 border-t border-brand/20",children:[e.jsx("span",{className:"text-sm text-gray-700",children:"Subtotal"}),e.jsx("span",{className:"text-sm text-gray-700 tabular-nums",children:u})]}),e.jsx(wn,{taxStatus:"calculated_at_checkout",taxJurisdictionCollected:i,className:"text-sm text-gray-600"}),e.jsx(kn,{serviceFeeCents:s>0?x:null,pendingLabel:"Finalized after host approval",className:"text-sm text-gray-600"}),e.jsx(je,{className:"my-1"}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-sm font-semibold text-gray-900",children:"Estimated total"}),e.jsx("span",{className:"text-sm font-semibold text-gray-900 tabular-nums",children:s>0?ie(h):"—"})]}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Pre-tax estimate. Final pricing confirmed by host."}),e.jsx(X,{type:"button",className:"w-full rounded-full",onClick:o,disabled:!o,children:"Submit Request"})]})]})},jo=({category:t,items:n,feeInput:s,innerRef:r,interactive:o,onItemClick:l})=>e.jsxs("section",{ref:r,id:`menu-category-${t.categoryId}`,"data-category-id":t.categoryId,className:"scroll-mt-24",children:[e.jsxs("div",{className:"mb-3 flex items-baseline justify-between gap-2",children:[e.jsx("h3",{className:"text-lg font-semibold text-gray-900",children:t.name}),t.isPackageCategory&&e.jsx(ge,{variant:"outline",className:"text-[10px] uppercase",children:"Packages"})]}),t.description&&e.jsx("p",{className:"mb-3 text-sm text-muted-foreground",children:t.description}),e.jsx("ul",{className:"grid grid-cols-1 gap-3 md:grid-cols-2",children:n.map(i=>e.jsx("li",{children:e.jsx(No,{item:i,feeInput:s,interactive:o,onClick:l?()=>l(i):void 0})},i.itemId))})]}),No=({item:t,feeInput:n,interactive:s,onClick:r})=>{var d;const o=t.itemTypeTags??[],l=o.length>0?o.map(a=>ms(a)).join(" · "):null,i=o.length>0?o.map(a=>Ut(a)).join(" "):null,c=e.jsxs("div",{className:"flex h-full gap-3",children:[e.jsxs("div",{className:"flex-1 min-w-0 space-y-1.5",children:[e.jsx("p",{className:"font-medium text-gray-900 line-clamp-1",children:t.name}),l?e.jsx("p",{className:"text-[11px] font-medium uppercase tracking-[0.08em] text-muted-foreground",children:l}):null,e.jsx("p",{className:"text-xs font-semibold text-muted-foreground",children:t.servesNumPeople?`Serves ${t.servesNumPeople}`:On(t.unit)}),t.description&&e.jsx("p",{className:"text-sm text-muted-foreground leading-6 line-clamp-2",children:t.description}),e.jsxs("div",{className:"flex items-center gap-2 pt-1 flex-wrap",children:[e.jsx("p",{className:"font-semibold text-gray-900",children:it(t.price,n)}),o.map(a=>e.jsx(ge,{variant:"outline",className:"text-[10px] font-medium border-slate-300 text-slate-700",title:Ut(a),children:ms(a)},a)),(d=t.foodLabelingTags)==null?void 0:d.slice(0,3).map(a=>e.jsxs(ge,{variant:"secondary",className:"text-[10px] font-medium gap-1",children:[a==="VEGETARIAN"||a==="VEGAN"?e.jsx(ji,{className:"h-3 w-3 text-green-700"}):null,Pn(a)]},a))]}),i?e.jsx("p",{className:"text-xs text-muted-foreground",children:i}):null]}),t.imageUrl?e.jsx("img",{src:t.imageUrl,alt:t.name,className:"h-24 w-24 md:h-28 md:w-28 rounded-xl object-cover shrink-0 border border-border/60",loading:"lazy"}):e.jsx("div",{className:"h-24 w-24 md:h-28 md:w-28 rounded-xl bg-muted text-muted-foreground flex items-center justify-center shrink-0",children:e.jsx(Dn,{className:"h-6 w-6"})})]});return!s||!r?e.jsx("div",{className:"rounded-2xl border border-border/60 bg-white p-3 md:p-4 h-full",children:c}):e.jsx("button",{type:"button",onClick:r,className:le("w-full text-left rounded-2xl border border-border/60 bg-white p-3 md:p-4 h-full","transition-all hover:border-brand/60 hover:shadow-md focus-visible:outline-none","focus-visible:ring-2 focus-visible:ring-brand/60"),children:c})},vo=({isOpen:t,onClose:n,onConfirm:s,existingDate:r,newDate:o})=>{const l=i=>{try{const c=i.includes("T")?fs(i):new Date(i+"T12:00:00");return xe(c,"EEEE, MMMM d, yyyy")}catch{return i}};return t?e.jsx(zn,{children:e.jsxs("div",{className:"fixed inset-0 z-[10003] flex items-center justify-center pointer-events-none",children:[e.jsx(Wt.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"absolute inset-0 bg-black/50 backdrop-blur-sm pointer-events-auto",onClick:n}),e.jsxs(Wt.div,{initial:{opacity:0,scale:.95,y:20},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:20},className:"relative bg-white rounded-3xl shadow-2xl max-w-md w-full mx-4 overflow-hidden pointer-events-auto flex flex-col max-h-[90vh] my-4",children:[e.jsxs("div",{className:"flex items-center justify-between p-6 border-b border-gray-200 flex-shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"p-2 bg-orange-100 rounded-full",children:e.jsx(Fr,{className:"h-5 w-5 text-orange-600"})}),e.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:"Replace Current Event?"})]}),e.jsx("button",{onClick:n,className:Pt.modal.closeButton.buttonClassName,"aria-label":"Close",children:e.jsx(Zt,{className:Pt.modal.closeButton.iconSize})})]}),e.jsxs("div",{className:"p-6 space-y-6 overflow-y-auto flex-1 min-h-0",style:{maxHeight:"calc(90vh - 240px)"},children:[e.jsx("p",{className:"text-gray-600",children:"You already have items for a different date. Adding this item will replace your current celebration."}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-start gap-4 p-4 bg-gray-50 rounded-xl",children:[e.jsx(qs,{className:"h-5 w-5 text-gray-400 mt-0.5 flex-shrink-0"}),e.jsxs("div",{className:"flex-1",children:[e.jsx("p",{className:"text-sm text-gray-500 mb-1",children:"Current Event"}),e.jsx("p",{className:"font-semibold text-gray-900",children:l(r)})]})]}),e.jsx("div",{className:"flex items-center justify-center",children:e.jsx("div",{className:"h-0.5 w-12 bg-gray-300"})}),e.jsxs("div",{className:"flex items-start gap-4 p-4 bg-brand/5 border border-brand/20 rounded-xl",children:[e.jsx(qs,{className:"h-5 w-5 text-brand mt-0.5 flex-shrink-0"}),e.jsxs("div",{className:"flex-1",children:[e.jsx("p",{className:"text-sm text-brand mb-1",children:"New Event"}),e.jsx("p",{className:"font-semibold text-gray-900",children:l(o)})]})]})]}),e.jsx("div",{className:"p-4 bg-orange-50 border border-orange-200 rounded-xl",children:e.jsx("p",{className:"text-sm text-orange-800",children:"⚠️ This will clear all items in your current cart and start a new celebration."})})]}),e.jsxs("div",{className:"flex gap-3 p-6 border-t border-gray-200 bg-gray-50 flex-shrink-0",children:[e.jsx("button",{onClick:n,className:"flex-1 px-4 py-3 rounded-xl border border-gray-300 text-gray-700 font-medium hover:bg-gray-100 transition-colors",children:"Cancel"}),e.jsx("button",{onClick:s,className:"flex-1 px-4 py-3 rounded-xl bg-gradient-to-r from-brand via-brand-400 to-brand hover:brightness-110 text-white font-medium transition-colors",children:"Replace & Continue"})]})]})]})}):null},wo=({isOpen:t,onClose:n,onAdjustTime:s,onAdjustOtherTime:r,onMessageProvider:o,conflictType:l,venueTimeWindow:i,serviceTimeWindow:c,existingServiceTimes:d})=>{const a=m=>{try{const x=fs(m);return xe(x,"h:mm a")}catch{return m}},f=m=>{try{const x=fs(m);return xe(x,"EEEE, MMMM d, yyyy")}catch{return m}};if(!t)return null;const u=l==="service-to-venue";return e.jsx(zn,{children:e.jsxs("div",{className:"fixed inset-0 z-[10003] flex items-center justify-center pointer-events-none",children:[e.jsx(Wt.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"absolute inset-0 bg-black/50 backdrop-blur-sm pointer-events-auto",onClick:n,onWheel:m=>m.stopPropagation(),onTouchMove:m=>m.stopPropagation()}),e.jsxs(Wt.div,{initial:{opacity:0,scale:.95,y:20},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:20},className:"relative bg-white rounded-3xl shadow-2xl max-w-lg w-full mx-4 overflow-hidden pointer-events-auto flex flex-col max-h-[90vh] my-4",onWheel:m=>m.stopPropagation(),onTouchMove:m=>m.stopPropagation(),children:[e.jsxs("div",{className:"flex items-center justify-between p-6 border-b border-gray-200 flex-shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"p-2 bg-orange-100 rounded-full",children:e.jsx(Te,{className:"h-5 w-5 text-orange-600"})}),e.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:u?"Time Conflict":"Venue Time Conflict"})]}),e.jsx("button",{onClick:n,className:Pt.modal.closeButton.buttonClassName,"aria-label":"Close",children:e.jsx(Zt,{className:Pt.modal.closeButton.iconSize})})]}),e.jsxs("div",{className:"p-6 space-y-6 overflow-y-auto flex-1 min-h-0 overscroll-contain",style:{maxHeight:"calc(90vh - 240px)"},onWheel:m=>{m.stopPropagation()},onTouchMove:m=>{m.stopPropagation()},children:[u&&i&&c?e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"text-gray-600",children:"The service time doesn't fit within your venue's booking window. Please adjust the service time to match your venue availability."}),e.jsxs("div",{className:"p-4 bg-blue-50 border border-blue-200 rounded-xl",children:[e.jsxs("p",{className:"text-sm text-blue-900 font-semibold mb-2",children:["Your Venue: ",i.venueTitle]}),e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm text-blue-800",children:[e.jsx(Te,{className:"h-4 w-4"}),e.jsxs("span",{children:["Date: ",f(i.startTime)]})]}),e.jsxs("div",{className:"flex items-center gap-2 text-sm text-blue-800",children:[e.jsx(Te,{className:"h-4 w-4"}),e.jsxs("span",{children:["Available: ",a(i.startTime)," - ",a(i.endTime)]})]})]})]}),e.jsxs("div",{className:"p-4 bg-orange-50 border border-orange-200 rounded-xl",children:[e.jsxs("p",{className:"text-sm text-orange-900 font-semibold mb-2",children:["Service: ",c.serviceTitle]}),e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm text-orange-800",children:[e.jsx(Te,{className:"h-4 w-4"}),e.jsxs("span",{children:["Date: ",f(c.startTime)]})]}),e.jsxs("div",{className:"flex items-center gap-2 text-sm text-orange-800",children:[e.jsx(Te,{className:"h-4 w-4"}),e.jsxs("span",{children:["Selected: ",a(c.startTime)," - ",a(c.endTime)]})]})]}),f(i.startTime)!==f(c.startTime)?e.jsx("p",{className:"text-xs text-orange-700 mt-2 font-semibold",children:"⚠️ Date mismatch: Service is on a different date than the venue"}):e.jsx("p",{className:"text-xs text-orange-700 mt-2",children:"⚠️ This time extends outside the venue window"})]})]}):!u&&d&&d.length>0?e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"text-gray-600",children:"The venue time doesn't cover all your selected services. Please adjust the venue time to include all service windows, or contact the venue host."}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-sm font-semibold text-gray-900 mb-2",children:"Services that need coverage:"}),d.map((m,x)=>{const h=f(m.startTime),g=i?f(i.startTime):null,k=g&&h!==g;return e.jsxs("div",{className:"p-3 bg-gray-50 rounded-lg",children:[e.jsx("p",{className:"text-sm font-medium text-gray-900",children:m.title}),e.jsxs("div",{className:"space-y-1 mt-1",children:[e.jsxs("div",{className:"flex items-center gap-2 text-xs text-gray-600",children:[e.jsx(Te,{className:"h-3 w-3"}),e.jsxs("span",{children:["Date: ",h]})]}),e.jsxs("div",{className:"flex items-center gap-2 text-xs text-gray-600",children:[e.jsx(Te,{className:"h-3 w-3"}),e.jsxs("span",{children:[a(m.startTime)," - ",a(m.endTime)]})]}),k&&e.jsx("p",{className:"text-xs text-orange-700 font-semibold mt-1",children:"⚠️ Date mismatch: Service is on a different date than the venue"})]})]},x)})]})]}):null,e.jsx("div",{className:"p-4 bg-gray-50 border border-gray-200 rounded-xl",children:e.jsxs("p",{className:"text-sm text-gray-700",children:["You can adjust the time to fit, or message the ",u?"service provider":"venue host"," to discuss alternative arrangements."]})})]}),e.jsxs("div",{className:"flex flex-col gap-3 p-6 border-t border-gray-200 bg-gray-50 flex-shrink-0",children:[u&&e.jsx(X,{onClick:s,className:"w-full bg-gradient-to-r from-brand via-brand-400 to-brand hover:brightness-110 text-white",children:"Adjust Service Time"}),!u&&r&&e.jsx(X,{onClick:r,className:"w-full bg-gradient-to-r from-brand via-brand-400 to-brand hover:brightness-110 text-white",children:"Adjust Service Times"}),e.jsxs(X,{onClick:o,variant:"outline",className:"w-full border-gray-300",children:[e.jsx(Dr,{className:"h-4 w-4 mr-2"}),"Message ",u?"Service Provider":"Venue Host"]}),e.jsx(X,{onClick:n,variant:"ghost",className:"w-full text-gray-600 hover:text-gray-900",children:"Cancel"})]})]})]})})};function ko(t){var S,p,A,w,E,R,j,F,_,Q,V,z;const[n]=vr(),s=n.get("preview")==="true",[r,o]=b.useState(null),[l,i]=b.useState(!0),[c,d]=b.useState(null);b.useEffect(()=>{let C=!0;return(async()=>{var P,O;if(!t){d("Missing service id"),i(!1);return}if(s)try{const U=await ki(t);if(!C)return;if(U.listingKind!=="service"){C&&(d("This listing is not a service. Please use the correct link."),i(!1));return}o(U),i(!1);return}catch(U){if(C){const te=U instanceof Error?U.message:String(U);d(`Failed to load service: ${te}`),i(!1)}return}try{const U=new URLSearchParams({listingId:t,listingKind:"service",limit:"1"}),G=(P=(await Or(`/public/venues?${U.toString()}`)).items)==null?void 0:P.find(B=>B.listingId===t);if(G){if(!C)return;if(G.listingKind!=="service"){C&&(d("This listing is not a service. Please use the correct link."),i(!1));return}o(G),i(!1)}else try{const B=await Ci(t);if(!C)return;if(B.listingKind!=="service"){C&&(d("This listing is not a service. Please use the correct link."),i(!1));return}o(B),i(!1)}catch{let B,K=0;const ae=10;let pe=!1;for(;K<ae;){const de=await Si({listingKind:"service",limit:100,cursor:B}),we=(O=de.items)==null?void 0:O.find(Fe=>Fe.listingId===t);if(we){if(!C)return;if(we.listingKind!=="service"){C&&(d("This listing is not a service. Please use the correct link."),i(!1));return}o(we),i(!1),pe=!0;break}if(!de.nextCursor)break;B=de.nextCursor,K++}if(!C)return;pe||d("Service not found")}}catch(U){if(C){const te=U instanceof Error?U.message:String(U);te.includes("not found")||te.includes("404")?d("We couldn't find that service. It may be unpublished or was removed."):d(`Failed to load service: ${te}`),i(!1)}}finally{C&&i(!1)}})(),()=>{C=!1}},[t,s]);const a=b.useMemo(()=>Mi(r??void 0),[r]),f=b.useMemo(()=>(a==null?void 0:a.serviceData)??{},[a==null?void 0:a.serviceData]),u=a==null?void 0:a.serviceType,m=f.offerings??[],x=(a==null?void 0:a.metadata)??{},h=((S=x==null?void 0:x.policies)==null?void 0:S.cancellationPolicy)??Ss,g=typeof((p=x==null?void 0:x.policies)==null?void 0:p.cancellationNotes)=="string"?x.policies.cancellationNotes:void 0,[k,y]=b.useState(null);b.useEffect(()=>{async function C(){var P;const $=r==null?void 0:r.ownerPublicId;if(!$){r!=null&&r.userId&&console.warn("Listing has userId but no ownerPublicId - profile fetch skipped.");return}try{const O=(a==null?void 0:a.onboardingMetadata)??((P=r==null?void 0:r.draftData)==null?void 0:P.onboardingMetadata),U=(O==null?void 0:O.claimed)===!1;let te;if(U){const ae=O==null?void 0:O.ownerEmail;if(!ae)return;te=ht(`/users/profile?email=${encodeURIComponent(ae)}&checkOnly=true`)}else te=ht(`/users/profile/by-id/${$}`);const G=await fetch(te,{credentials:"include"});if(!G.ok||!(G.headers.get("content-type")||"").includes("application/json"))return;const K=await G.json();y(K.profile??K)}catch(O){console.error("Failed to load host profile",O)}}C()},[r==null?void 0:r.ownerPublicId,r==null?void 0:r.userId,(A=a==null?void 0:a.onboardingMetadata)==null?void 0:A.ownerEmail,(w=a==null?void 0:a.onboardingMetadata)==null?void 0:w.claimed,(R=(E=r==null?void 0:r.draftData)==null?void 0:E.onboardingMetadata)==null?void 0:R.ownerEmail,(F=(j=r==null?void 0:r.draftData)==null?void 0:j.onboardingMetadata)==null?void 0:F.claimed]);const v=(a==null?void 0:a.availability)??x.availability??{},T=(x==null?void 0:x.publishing)??{},L=b.useMemo(()=>{var O,U;const C=ns((O=a==null?void 0:a.availability)==null?void 0:O.acceptsInstantBookings);if(typeof C=="boolean")return C;const $=ns((U=x.availability)==null?void 0:U.acceptsInstantBookings);if(typeof $=="boolean")return $;const P=ns(T.acceptsInstantBookings);return typeof P=="boolean"?P:!0},[(_=a==null?void 0:a.availability)==null?void 0:_.acceptsInstantBookings,(Q=x.availability)==null?void 0:Q.acceptsInstantBookings,T.acceptsInstantBookings]);b.useEffect(()=>{var C,$,P,O;typeof window>"u"||window.localStorage.getItem("debugBookingMode")==="1"&&console.debug("[booking-mode-debug][service-detail]",{listingId:r==null?void 0:r.listingId,status:r==null?void 0:r.status,resolvedAcceptsInstantBookings:L,sources:{effectiveAvailability:(C=a==null?void 0:a.availability)==null?void 0:C.acceptsInstantBookings,metadataAvailability:($=x.availability)==null?void 0:$.acceptsInstantBookings,metadataPublishing:T.acceptsInstantBookings},sourceTypes:{effectiveAvailability:typeof((P=a==null?void 0:a.availability)==null?void 0:P.acceptsInstantBookings),metadataAvailability:typeof((O=x.availability)==null?void 0:O.acceptsInstantBookings),metadataPublishing:typeof T.acceptsInstantBookings}})},[r==null?void 0:r.listingId,r==null?void 0:r.status,L,(V=a==null?void 0:a.availability)==null?void 0:V.acceptsInstantBookings,(z=x.availability)==null?void 0:z.acceptsInstantBookings,T.acceptsInstantBookings]);const M=b.useMemo(()=>{const C=["monday","tuesday","wednesday","thursday","friday","saturday","sunday"],$=Array.isArray(v.weeklySchedule)?v.weeklySchedule:null,P=!Array.isArray(v.weeklySchedule)&&v.weeklySchedule&&typeof v.weeklySchedule=="object"?v.weeklySchedule:null,O=G=>{if(typeof G!="string")return null;const B=G.trim().match(/^(\d{1,2}):(\d{2})/);if(!B)return null;const K=Number(B[1]),ae=Number(B[2]);return Number.isNaN(K)||Number.isNaN(ae)||K<0||K>23||ae<0||ae>59?null:`${String(K).padStart(2,"0")}:${String(ae).padStart(2,"0")}`};if($&&$.length>0)return[...$].sort((G,B)=>{const K=((G==null?void 0:G.day)??"").toLowerCase(),ae=((B==null?void 0:B.day)??"").toLowerCase();return C.indexOf(K)-C.indexOf(ae)}).map(G=>{const B=G,K=Array.isArray(B.windows)?B.windows.map(de=>({from:O(de==null?void 0:de.from),to:O(de==null?void 0:de.to)})).filter(de=>typeof de.from=="string"&&typeof de.to=="string"):[],ae=O(B.from),pe=O(B.to);return{...B,day:(B.day??"").toLowerCase(),enabled:B.enabled===!0,from:ae,to:pe,windows:K.length>0?K:ae&&pe?[{from:ae,to:pe}]:[]}});if(P){const G=C.filter(B=>P[B]).map(B=>({day:B,enabled:P[B].enabled===!0,from:O(P[B].from),to:O(P[B].to),windows:Array.isArray(P[B].windows)?P[B].windows.map(K=>({from:O(K==null?void 0:K.from),to:O(K==null?void 0:K.to)})).filter(K=>typeof K.from=="string"&&typeof K.to=="string"):[]}));if(G.length>0)return G}const U=(a==null?void 0:a.businessHours)??(f==null?void 0:f.businessHours)??{},te=C.filter(G=>U[G]).map(G=>{const B=O(U[G].open??U[G].from),K=O(U[G].close??U[G].to);return{day:G,enabled:U[G].enabled===!0||U[G].closed!==!0,from:B,to:K,windows:B&&K?[{from:B,to:K}]:[]}});return te.length>0?te:[]},[v.weeklySchedule,a,f==null?void 0:f.businessHours]),N=Array.isArray(v.blockedDates)?v.blockedDates.filter(C=>typeof C=="string"):[],{unavailableDates:I}=si(r==null?void 0:r.listingId,{enabled:!0}),D=I.length>0?I:N;return{listing:r,isLoading:l,error:c,effectiveData:a,serviceData:f,serviceType:u,offerings:m,metadata:x,hostProfileData:k,availability:v,acceptsInstantBookings:L,schedule:M,blockedDates:D,cancellationPolicy:h,cancellationNotes:g,isPreviewMode:s}}function Co(t){return t.type==="video"&&typeof t.url=="string"&&t.url.trim().length>0}function So({listing:t,effectiveData:n,serviceData:s,offerings:r,hostProfileData:o,metadata:l,serviceType:i}){var N,I,D,S,p,A;const c=Pr.find(w=>w.id===i),d=s.aboutMe??{},a=b.useMemo(()=>Tn(t,n),[n,t]),f=b.useMemo(()=>{var E,R;if(s.cardTitle)return s.cardTitle;const w=(E=s.businessInfo)==null?void 0:E.businessName;return w||(r.length>0&&r[0].name?r[0].name:`${(c==null?void 0:c.label)||"Service"}${(R=n==null?void 0:n.location)!=null&&R.city?` in ${n.location.city}`:""}`)},[s,r,c,n]),u=b.useMemo(()=>{const w=l.hostProfile??l.host??{},E=w&&typeof w=="object"?w:{},R=(o==null?void 0:o.photoURL)||(o==null?void 0:o.photoUrl)||(o==null?void 0:o.avatar)||(o==null?void 0:o.image)||void 0;return{...E,...o||{},avatar:R}},[l.hostProfile,l.host,o]),m=b.useMemo(()=>{const w=typeof u.firstName=="string"?u.firstName.trim():"",E=typeof u.lastName=="string"?u.lastName.trim():"";return w||E?`${w} ${E}`.trim():typeof u.name=="string"&&u.name.trim().length>0?u.name.trim():f.split(" ")[0]||"Service Provider"},[u.firstName,u.lastName,u.name,f]),x=typeof u.avatar=="string"&&u.avatar?u.avatar:null,h=b.useMemo(()=>{const w=n==null?void 0:n.location;return w!=null&&w.city&&(w!=null&&w.state)?`${w.city}, ${w.state}`:(t==null?void 0:t.locationLabel)||"Location not specified"},[t,n]),g=b.useMemo(()=>{var R,j,F;const w=(R=s.coverImage)==null?void 0:R.trim(),E=(F=(j=n==null?void 0:n.media)==null?void 0:j.coverImage)==null?void 0:F.trim();return w||E||(r.length>0&&r[0].image?r[0].image:ft)},[s.coverImage,(N=n==null?void 0:n.media)==null?void 0:N.coverImage,r]),k=b.useMemo(()=>{var V,z,C,$;const w=new Set,E=new Set,R=P=>{const O=P==null?void 0:P.trim();if(!O||w.has(O))return null;const U=Ti(O);return E.has(U)?null:(w.add(O),E.add(U),O)},j=[],F=(V=s.coverImage)==null?void 0:V.trim(),_=(C=(z=n==null?void 0:n.media)==null?void 0:z.coverImage)==null?void 0:C.trim(),Q=(($=n==null?void 0:n.media)==null?void 0:$.gallery)??[];if(F){const P=R(F);P&&j.push(P)}if(_){const P=R(_);P&&j.push(P)}return Q.forEach(P=>{if(P.type==="photo"&&P.url){const O=R(P.url);O&&j.push(O)}}),r.forEach(P=>{if(P.image){const O=R(P.image);O&&j.push(O)}}),j.length>0?j:[ft]},[s.coverImage,(I=n==null?void 0:n.media)==null?void 0:I.coverImage,(D=n==null?void 0:n.media)==null?void 0:D.gallery,r]),y=b.useMemo(()=>{var E;return(((E=n==null?void 0:n.media)==null?void 0:E.gallery)??[]).filter(Co).sort((R,j)=>(R.order??0)-(j.order??0)).map(R=>R.url.trim())},[(S=n==null?void 0:n.media)==null?void 0:S.gallery]),v=b.useMemo(()=>{var w,E,R,j;return(w=s.description)!=null&&w.trim()?s.description.trim():(E=s.cardDescription)!=null&&E.trim()?s.cardDescription.trim():(j=(R=n==null?void 0:n.basics)==null?void 0:R.description)!=null&&j.trim()?n.basics.description.trim():"No description available."},[s.description,s.cardDescription,(p=n==null?void 0:n.basics)==null?void 0:p.description]),T=b.useMemo(()=>{var w,E,R;return(w=s.tagline)!=null&&w.trim()?s.tagline.trim():(R=(E=n==null?void 0:n.basics)==null?void 0:E.tagline)!=null&&R.trim()?n.basics.tagline.trim():null},[s.tagline,(A=n==null?void 0:n.basics)==null?void 0:A.tagline]),L=b.useMemo(()=>{var _;if(r.length===0)return null;const w=r.map(Q=>_t(Q.price,a)).filter(Q=>typeof Q=="number"&&Q>0);if(w.length===0)return null;const E=Math.min(...w),R=Math.max(...w),j=(_=r[0])==null?void 0:_.priceType;return{min:E,max:R,label:j==="per_person"||j==="per_guest"?"per guest":j==="per_hour"?"per hour":j==="per_event"||j==="fixed"?"per event":""}},[a,r]),M=b.useMemo(()=>{if(r.length===0)return null;const w=r.map(E=>{var F;const R=_t(E.price,a);if(!R)return null;const j=((F=E.guestLimit)==null?void 0:F.min)??1;return E.priceType==="per_person"||E.priceType==="per_guest"?R*j:R}).filter(E=>typeof E=="number"&&E>0);return w.length===0?null:Math.min(...w)},[a,r]);return{serviceName:f,hostDisplayName:m,hostAvatar:x,hostProfile:u,locationLabel:h,coverImage:g,galleryImages:k,galleryVideos:y,description:v,tagline:T,pricingRange:L,minimumBooking:M,aboutMe:d,serviceTypeInfo:c}}const To=t=>Math.round(t*10)/10;function Mo(t){if(!t)return null;const n=Number(t.hours??0),s=Number(t.minutes??0);if(!Number.isFinite(n)||!Number.isFinite(s))return null;const r=Math.max(0,n)+Math.max(0,s)/60;return r<=0?null:r}function es({calculatedHours:t,packageDuration:n,packageName:s}){if(!Number.isFinite(t)||t<=0)return null;const r=Mo(n);return r==null?null:t+1e-4<r?{title:"Duration too short",description:`${s?`"${s}"`:"This package"} requires at least ${To(r)} hour${r===1?"":"s"}.`}:null}function Ao({listing:t,selectedBookingPackage:n,selectedDate:s,startTime:r,endTime:o,guestCount:l,selectedAddOns:i}){var y;const c=b.useMemo(()=>{var v,T;if(!r||!o)return((v=n==null?void 0:n.duration)==null?void 0:v.hours)||1;try{const[L,M]=r.split(":").map(Number),[N,I]=o.split(":").map(Number),D=L*60+(M||0);let p=N*60+(I||0)-D;return p<0&&(p+=1440),p/60}catch{return((T=n==null?void 0:n.duration)==null?void 0:T.hours)||1}},[r,o,n]),d=b.useMemo(()=>{if(!n)return 0;const v=n.price||0,T=n.priceType;return T==="per_person"||T==="per_guest"?v*l:T==="per_hour"?v*c:v},[n,l,c]),a=b.useMemo(()=>{if(!s||!r||!o||r===o)return null;try{const v=xe(s,"yyyy-MM-dd"),{startDateTime:T,endDateTime:L}=et(v,r,o),M=new Date(T),N=new Date(L);return isNaN(M.getTime())||isNaN(N.getTime())||N<=M?null:{startDateTime:T,endDateTime:L}}catch{return null}},[s,r,o]),f=b.useMemo(()=>{var M,N;if(!(t!=null&&t.listingId)||!n||!a||(n.priceType==="per_person"||n.priceType==="per_guest")&&l<1||es({calculatedHours:c,packageDuration:n.duration,packageName:n.name}))return!1;const T=(M=n.guestLimit)==null?void 0:M.min,L=(N=n.guestLimit)==null?void 0:N.max;return!(typeof T=="number"&&T>0&&l<T||typeof L=="number"&&L>0&&l>L)},[t==null?void 0:t.listingId,n,a,l,c]),{data:u,status:m,error:x}=$r({queryKey:["service-pricing-preview",t==null?void 0:t.listingId,n==null?void 0:n.id,a==null?void 0:a.startDateTime,a==null?void 0:a.endDateTime,l,i],queryFn:({signal:v})=>ni({listingId:(t==null?void 0:t.listingId)??"",startTime:(a==null?void 0:a.startDateTime)??"",endTime:(a==null?void 0:a.endDateTime)??"",guestCount:Math.max(l,1),selectedPackageId:(n==null?void 0:n.id)??"",selectedAddOns:i,signal:v}),enabled:f,staleTime:3e4}),h=f?m==="pending"?{status:"loading"}:m==="error"?{status:"error",error:x instanceof Error?x.message:"Failed to fetch pricing preview"}:{status:"success",subtotal:u==null?void 0:u.subtotal,serviceFee:u==null?void 0:u.serviceFee,total:u==null?void 0:u.total,selectionSnapshots:(y=u==null?void 0:u.selectionSnapshots)==null?void 0:y.map(v=>({selectionType:v.selectionType,sourceEntityId:v.sourceEntityId,name:v.name,priceModel:v.priceModel,quantity:v.quantity,unitPrice:v.unitPrice,baseAmount:v.baseAmount,timelineAdjustment:v.timelineAdjustment,finalAmount:v.finalAmount,includesVenueRental:v.includesVenueRental}))}:{status:"idle"},g=h.status==="success"?{subtotal:typeof h.total=="number"&&typeof h.serviceFee=="number"?Ei(h.total-h.serviceFee):h.subtotal,serviceFee:h.serviceFee,total:h.total}:null,k=b.useMemo(()=>n?Bs({authoritative:g,derivedSubtotal:d,derivedServiceFee:null,derivedTotal:null,notes:"Select a date and time to see the total including service fees."}):Bs({notes:"Final total and applicable sales tax are confirmed in cart and checkout."}),[n,d,h]);return{calculatedHours:c,calculatedPrice:d,servicePricingBreakdown:k,previewState:h}}const gs=t=>{var l,i;const n=(l=t==null?void 0:t.guestLimit)==null?void 0:l.min,s=(i=t==null?void 0:t.guestLimit)==null?void 0:i.max,r=zt(n)?Math.max(1,n):1,o=zt(s)?Math.max(r,s):void 0;return{min:r,max:o}},It=t=>{var n,s;return zt((n=t==null?void 0:t.guestLimit)==null?void 0:n.min)||zt((s=t==null?void 0:t.guestLimit)==null?void 0:s.max)},pr=(t,n)=>typeof n.max=="number"?Math.max(n.min,Math.min(n.max,t)):Math.max(n.min,t),Io=t=>{const{enteredValue:n,adjustedValue:s,bounds:r,packageName:o}=t;return n===s?null:typeof r.max=="number"&&n>r.max?`"${o}" allows a maximum of ${r.max} guests. Adjusted to ${s}.`:n<r.min?`"${o}" requires at least ${r.min} guests. Adjusted to ${s}.`:null},Rt=15,at=24*60,Eo=t=>{if(t.length===0)return[];const n=[...t].sort((r,o)=>r.start-o.start),s=[];for(const r of n){const o=s[s.length-1];if(!o){s.push({...r});continue}r.start<=o.end?o.end=Math.max(o.end,r.end):s.push({...r})}return s},Lo=t=>{const n=t.map(r=>{const o=Le(r.from),l=Le(r.to);return l<=o?null:{start:o,end:l}}).filter(r=>r!=null).sort((r,o)=>r.start-o.start);let s=0;for(const r of n){if(r.start>s)break;s=Math.max(s,r.end)}return s},gr=(t,n)=>{var f,u;if(!t)return[];const s=new Date(t.getFullYear(),t.getMonth(),t.getDate());if(Number.isNaN(s.getTime()))return[];const r=Gs(s),o=new Date(s);o.setDate(o.getDate()+1);const l=Gs(o),i=((f=Us(r,n))==null?void 0:f.windows)??[],c=((u=Us(l,n))==null?void 0:u.windows)??[],d=Lo(c),a=[];for(const m of i){const x=Le(m.from),h=Le(m.to);if(x===h)continue;if(h>x){a.push({start:x,end:h});continue}a.push({start:x,end:at});const g=Math.min(h,d);g>0&&a.push({start:at,end:at+g})}return Eo(a)},bs=(t,n)=>{if(n.length===0)return null;const s=n.findIndex(o=>t>=o.start&&t<o.end);if(s<0)return null;let r=n[s].end;for(let o=s+1;o<n.length;o+=1){const l=n[o];if(l.start>r)break;r=Math.max(r,l.end)}return r},cs=(t,{minAbs:n=0,maxAbs:s=Number.POSITIVE_INFINITY,includeEnd:r=!1}={})=>{const o=[];for(const l of t){const i=Math.max(l.start,n),c=Math.min(l.end,s);if(c<=i)continue;const d=Math.ceil(i/Rt)*Rt,a=r?c:c-Rt;for(let f=d;f<=a;f+=Rt)o.push({value:Fi(f),isNextDay:f>=at})}return o},on=t=>[...t].sort((n,s)=>Le(n.value)-Le(s.value));function cn(t){if(!t.startTime||!t.endTime)return null;try{const n=new Date(t.startTime),s=new Date(t.endTime);if(Number.isNaN(n.getTime())||Number.isNaN(s.getTime()))return null;const r=xe(n,"yyyy-MM-dd"),o=`${String(n.getHours()).padStart(2,"0")}:${String(n.getMinutes()).padStart(2,"0")}`,l=`${String(s.getHours()).padStart(2,"0")}:${String(s.getMinutes()).padStart(2,"0")}`;return{dateYmd:r,startHHmm:o,endHHmm:l}}catch{return null}}function dn(t){const n=t.find(r=>(r.listingKind==="venue"||r.type==="venue")&&r.startTime&&r.endTime);return n||(t.find(r=>(r.listingKind==="service"||r.type==="service")&&r.startTime&&r.endTime)??null)}function un(t,n,s,r){if(!n||!s||!t)return!1;if(r.length===0)return!0;const[o,l,i]=t.split("-").map(Number);if(!o||!l||!i)return!1;const c=new Date(o,l-1,i);if(Number.isNaN(c.getTime()))return!1;const d=gr(c,r);if(d.length===0)return!1;const a=Le(n),f=Le(s),u=bs(a,d);if(u==null)return!1;const m=f>a?f:f+at;return!(m>u||a+nt*60>m)}function Ro({offerings:t,schedule:n,blockedDates:s,bookingWindowDays:r,minimumLeadTimeHours:o,cartItems:l,acceptsInstantBookings:i}){var ke,$e,qe,Ie;const[c,d]=b.useState(!1),[a,f]=b.useState(null),[u,m]=b.useState(null),[x,h]=b.useState(""),[g,k]=b.useState(""),[y,v]=b.useState(nt*60),[T,L]=b.useState(0),[M,N]=b.useState(""),[I,D]=b.useState([]),[S,p]=b.useState(null),[A,w]=b.useState(null),[E,R]=b.useState(null),j=b.useRef(!1),F=b.useCallback(H=>h(H),[]),_=b.useCallback(H=>k(H),[]),Q=b.useCallback(H=>{const q=Math.max(nt*60,H);v(q),h(Z=>{if(Z){const se=Hs(Z,q);se&&k(se)}return Z})},[]),V=b.useMemo(()=>{if(!x||!g)return y;const[H,q]=x.split(":").map(Number),[Z,se]=g.split(":").map(Number);if([H,q,Z,se].some(be=>!Number.isFinite(be)))return y;let J=Z*60+(se||0)-(H*60+(q||0));return J<0&&(J+=24*60),J>0?J:y},[x,g,y]);b.useEffect(()=>{if(V<=0)return;const H=Math.max(nt*60,V);H!==y&&v(H)},[V,y]),b.useEffect(()=>{if(!x||g)return;const H=Hs(x,y);H&&k(H)},[x,g]),b.useEffect(()=>{N(T>0?T.toString():"")},[T]),b.useEffect(()=>{if(!a||T>0||!It(a))return;const H=gs(a);L(H.min)},[a,T]);const z=b.useMemo(()=>gr(u,n),[u,n]),C=b.useMemo(()=>z.length===0?[]:cs(z,{maxAbs:at-1,includeEnd:!1}).filter(q=>{const Z=Le(q.value),se=bs(Z,z);return se!=null&&Z+nt*60<=se}),[z]),$=b.useMemo(()=>{if(z.length===0)return[];if(!x)return on(cs(z,{maxAbs:at-1,includeEnd:!0}));const H=Le(x),q=bs(H,z);return q==null?[]:on(cs(z,{minAbs:H+nt*60,maxAbs:q,includeEnd:!0}))},[z,x]),P=(ke=C[0])==null?void 0:ke.value,O=($e=C[C.length-1])==null?void 0:$e.value,U=(qe=$[0])==null?void 0:qe.value,te=(Ie=$[$.length-1])==null?void 0:Ie.value,G=b.useMemo(()=>Ri({schedule:n,blockedDates:s,bookingWindowDays:r,minimumLeadTimeHours:o}),[n,s,r,o]),B=G.minDate,K=G.maxDate,ae=G.disabledDates;b.useEffect(()=>{if(!u)return;const H=u.getTime();if(H<B.getTime()||H>K.getTime()){m(null),F(""),_("");return}const q=xe(u,"yyyy-MM-dd"),Z=n.length>0&&!Xt(u,n);(s.includes(q)||Z)&&(m(null),F(""),_(""))},[u,s,n,B,K,F,_]),b.useEffect(()=>{if(!u)return;const H=new Set(C.map(Z=>Z.value)),q=new Set($.map(Z=>Z.value));if(x&&!H.has(x)){F(""),_("");return}g&&!q.has(g)&&_("")},[u,x,g,C,$,F,_]),b.useEffect(()=>{var q;if(!x||!g)return;new Set($.map(Z=>Z.value)).has(g)||_(((q=$[0])==null?void 0:q.value)??"")},[x,g,$,_]);const pe=b.useRef(!1);b.useEffect(()=>{if(pe.current)return;const H=dn(l),q=H?cn(H):null;if(q&&(!i||un(q.dateYmd,q.startHHmm,q.endHHmm,n)))try{F(q.startHHmm),_(q.endHHmm),pe.current=!0;return}catch{}pe.current=!0},[l,n,i,F,_]);const de=b.useRef(!1),we=b.useRef(u),Fe=b.useRef(x),De=b.useRef(g),ct=b.useRef(T);we.current=u,Fe.current=x,De.current=g,ct.current=T,b.useEffect(()=>{if(!c){de.current=!1,w(null),R(null);return}if(de.current)return;de.current=!0;const H=dn(l),q=H?cn(H):null;let Z=null,se=null,J=null,be=0,re=null;if(i?(q&&H&&(Z=q.dateYmd,be=H.guestCount||0,un(q.dateYmd,q.startHHmm,q.endHHmm,n)&&(se=q.startHHmm,J=q.endHHmm),re={source:"cart",dateYmd:q.dateYmd}),w(re)):(q&&H&&(Z=q.dateYmd,se=q.startHHmm,J=q.endHHmm,be=H.guestCount||0,re={source:"cart",dateYmd:q.dateYmd}),w(re)),Z&&!we.current)try{const[ye,_e,ze]=Z.split("-").map(Number),Ae=new Date(ye,_e-1,ze);isNaN(Ae.getTime())||m(Ae)}catch{}i&&Z?se&&J?(F(se),_(J)):(F(""),_("")):(se&&!Fe.current&&F(se),J&&!De.current?_(J):se&&!De.current&&_("22:00")),be>0&&ct.current===0&&L(be)},[c,l,i,n]),b.useEffect(()=>{var be,re;if(!c){j.current=!1;return}if(j.current||(be=S==null?void 0:S.formattedAddress)!=null&&be.trim()&&(E==null?void 0:E.source)==="cart_venue")return;const H=(u?xe(u,"yyyy-MM-dd"):null)??(A==null?void 0:A.dateYmd)??null,q=l.filter(ye=>ye.listingKind==="venue"||ye.type==="venue"),Z=(H?q.find(ye=>{if(!ye.startTime)return!1;try{return xe(new Date(ye.startTime),"yyyy-MM-dd")===H}catch{return!1}}):void 0)??q[0];if(!(Z!=null&&Z.listingId))return;j.current=!0;let se=!1;const J=(re=Z.location)==null?void 0:re.trim();return J&&!se&&(p({formattedAddress:J}),R({source:"cart_venue"})),(async()=>{var ye,_e,ze,Ae,W,ne,oe,he,Ce,Ue,bt,yt;try{const jt=await fetch(ht(`/public/venues/${encodeURIComponent(Z.listingId)}`));if(!jt.ok||se){!se&&J?(p({formattedAddress:J}),R({source:"cart_venue"})):j.current=!1;return}const Ee=await jt.json(),dt=((_e=(ye=Ee.publishedData)==null?void 0:ye.location)==null?void 0:_e.formatted)||((Ae=(ze=Ee.draftData)==null?void 0:ze.location)==null?void 0:Ae.formatted),Nt=((dt==null?void 0:dt.trim())||J||"").trim();if(!Nt||se){j.current=!1;return}const vt=((ne=(W=Ee.publishedData)==null?void 0:W.location)==null?void 0:ne.latitude)??((he=(oe=Ee.draftData)==null?void 0:oe.location)==null?void 0:he.latitude),wt=((Ue=(Ce=Ee.publishedData)==null?void 0:Ce.location)==null?void 0:Ue.longitude)??((yt=(bt=Ee.draftData)==null?void 0:bt.location)==null?void 0:yt.longitude);p({formattedAddress:Nt,placeId:Ee.googlePlaceId||void 0,lat:typeof vt=="number"?vt:void 0,lng:typeof wt=="number"?wt:void 0}),R({source:"cart_venue"})}catch{if(!se&&J){p({formattedAddress:J}),R({source:"cart_venue"});return}j.current=!1}})(),()=>{se=!0}},[c,l,u,A==null?void 0:A.dateYmd,S==null?void 0:S.formattedAddress,E==null?void 0:E.source]);const Oe=b.useCallback(H=>{D(q=>q.some(se=>se.addOnId===H)?q.filter(se=>se.addOnId!==H):[...q,{addOnId:H,quantity:1}])},[]),Ve=b.useCallback((H,q)=>{D(Z=>q<=0?Z.filter(J=>J.addOnId!==H):Z.some(J=>J.addOnId===H)?Z.map(J=>J.addOnId===H?{...J,quantity:q}:J):[...Z,{addOnId:H,quantity:q}])},[]),Pe=b.useCallback(()=>D([]),[]),tt=b.useCallback(H=>{if(It(H)){const q=gs(H),Z=T>0?pr(T,q):q.min;L(Z)}f(H),d(!0)},[T]),me=b.useCallback(()=>!a&&t.length>0?!1:(d(!0),!0),[a,t.length]),ve=b.useCallback(()=>{m(null),f(null),F(""),_(""),L(0),Pe(),p(null),w(null),j.current=!1},[F,_,Pe]);return{isBookingFlowOpen:c,setIsBookingFlowOpen:d,selectedBookingPackage:a,setSelectedBookingPackage:f,selectedDate:u,setSelectedDate:m,startTime:x,setStartTime:F,endTime:g,setEndTime:_,durationMinutes:y,setDurationMinutes:Q,guestCount:T,setGuestCount:L,guestCountTempValue:M,setGuestCountTempValue:N,handleSelectPackageAndBook:tt,handleShowDates:me,resetBookingState:ve,startTimeOptions:C,endTimeOptions:$,startTimeMinTime:P,startTimeMaxTime:O,endTimeMinTime:U,endTimeMaxTime:te,serviceDatePickerDisabled:ae,datePickerMinDate:B,datePickerMaxDate:K,selectedAddOns:I,toggleAddOn:Oe,setAddOnQuantity:Ve,clearAddOns:Pe,serviceEventLocation:S,setServiceEventLocation:p,bookingAutofillHint:A,addressAutofillHint:E,plannerCalendarHighlights:null}}function br({guestCount:t,packageGuestMin:n,packageGuestMax:s,packageName:r}){const o=r?`"${r}"`:"The selected package";return typeof n=="number"&&n>0&&t<n?{title:"Guest count too low",description:`${o} requires a minimum of ${n} guests.`}:typeof s=="number"&&s>0&&t>s?{title:"Guest count too high",description:`${o} allows a maximum of ${s} guests.`}:null}function Fo({listing:t,selectedBookingPackage:n,selectedDate:s,startTime:r,endTime:o,guestCount:l,calculatedHours:i,calculatedPrice:c,serviceName:d,coverImage:a,schedule:f,selectedAddOns:u,serviceEventLocation:m,charter:x,user:h,toast:g,onSuccess:k}){const y=js(),v=Qt(),[T,L]=b.useState(!1),[M,N]=b.useState(!1),[I,D]=b.useState("");return{handleRequestBooking:b.useCallback(async()=>{var E,R,j,F,_,Q;if(T)return;if(!h){const V=`${v.pathname}${v.search}`;Bt(v.pathname)?Ht(V):y("/auth?returnTo="+encodeURIComponent(V));return}if(!t){g({title:"Error",description:"Listing information is not available",variant:"destructive"});return}const p=!n&&!!x;if(!n&&!p){g({title:"Missing information",description:"Please select a package to book",variant:"destructive"});return}if(t.listingKind!=="service"){g({title:"Error",description:"Invalid listing type.",variant:"destructive"});return}if(!s){g({title:"Missing information",description:"Please select an event date",variant:"destructive"});return}if(f.length>0&&!Xt(s,f)){g({title:"Date not available",description:"The selected date is not available. Please choose a different date.",variant:"destructive"});return}if(p){try{L(!0);const V=xe(s,"yyyy-MM-dd"),{startDateTime:z,endDateTime:C}=et(V,"12:00","13:00"),$={listingId:t.listingId,type:"service",listingTitle:d,startTime:z,endTime:C,guestCount:0,hours:1,imageUrl:a!==ft?a:void 0,...u!=null&&u.length?{selectedAddOns:u}:{},charter:x},O=((R=(E=(await us()).tokens)==null?void 0:E.idToken)==null?void 0:R.toString())||"",U={items:[$],date:V,time:"12:00",duration:1,startTime:z,endTime:C,specialRequests:(I==null?void 0:I.trim())||void 0,eventLocation:m??void 0},G=await(await fetch(ht("/bookings/create"),{method:"POST",headers:{"Content-Type":"application/json",Authorization:O?`Bearer ${O}`:""},credentials:"include",body:JSON.stringify(U)})).json();if(G.mode==="instant_booking"){g({title:"Continue to checkout",description:"This service uses instant booking. Complete your booking and payment at checkout.",variant:"destructive"});return}if(G.mode==="approval_required"){if(G.isIdempotent){g({title:"Request already submitted",description:"You already have a pending request for this date. Manage it from your bookings."}),y("/bookings");return}N(!0),k()}else g({title:"Error",description:G.message||G.error||"Unexpected response from server.",variant:"destructive"})}catch(V){const z=V instanceof Error?V.message:"Failed to submit booking request. Please try again.";g({title:"Error",description:z,variant:"destructive"})}finally{L(!1)}return}if(!r||!o){g({title:"Missing information",description:"Please select both start and end times",variant:"destructive"});return}if(r===o){g({title:"Invalid duration",description:"Start and end time cannot be the same.",variant:"destructive"});return}const A=n.priceType==="per_person"||n.priceType==="per_guest"||It(n);if(A&&(!l||l<1)){g({title:"Missing information",description:"Please enter the number of guests (minimum 1)",variant:"destructive"});return}if(A){const V=br({guestCount:l,packageGuestMin:(j=n.guestLimit)==null?void 0:j.min,packageGuestMax:(F=n.guestLimit)==null?void 0:F.max,packageName:n.name});if(V){g({...V,variant:"destructive"});return}}const w=es({calculatedHours:i,packageDuration:n.duration,packageName:n.name});if(w){g({...w,variant:"destructive"});return}if(!ot(m)){g({title:"Event address required",description:"Choose a full address from the suggestions so we can confirm the service location.",variant:"destructive"});return}try{L(!0);const V=xe(s,"yyyy-MM-dd"),z=Ts(r,o,s,f);if(z){g({title:"Time not available",description:z,variant:"destructive"});return}const{startDateTime:C,endDateTime:$}=et(V,r,o);if(!i||i<=0||!Number.isFinite(i)){g({title:"Invalid duration",description:"Start time must be before end time. Please check your time selection.",variant:"destructive"}),L(!1);return}const P=A?l:l||0,O={listingId:t.listingId,type:"service",listingTitle:d,startTime:C,endTime:$,guestCount:P,hours:i,imageUrl:n.image||(a!==ft?a:void 0),pricePerHour:n.price,price:c,selectedPackageId:n.id,...u!=null&&u.length?{selectedAddOns:u}:{},...x?{charter:x}:{}},te=((Q=(_=(await us()).tokens)==null?void 0:_.idToken)==null?void 0:Q.toString())||"",G={items:[O],date:V,time:r,duration:i,startTime:C,endTime:$,specialRequests:(I==null?void 0:I.trim())||void 0,eventLocation:m},K=await(await fetch(ht("/bookings/create"),{method:"POST",headers:{"Content-Type":"application/json",Authorization:te?`Bearer ${te}`:""},credentials:"include",body:JSON.stringify(G)})).json();if(K.mode==="instant_booking"){g({title:"Continue to checkout",description:"This service uses instant booking. Complete your booking and payment at checkout.",variant:"destructive"});return}if(K.mode==="approval_required"){if(K.isIdempotent){g({title:"Request already submitted",description:"You already have a pending request for this date and time. Manage it from your bookings."}),y("/bookings");return}N(!0),k()}else g({title:"Error",description:K.message||K.error||"Unexpected response from server.",variant:"destructive"})}catch(V){const z=V instanceof Error?V.message:"Failed to submit booking request. Please try again.";g({title:"Error",description:z,variant:"destructive"})}finally{L(!1)}},[T,h,t,n,s,r,o,l,i,c,d,a,f,u,m,x,g,k,y,v,I]),isRequestingBooking:T,showRequestSubmitted:M,setShowRequestSubmitted:N,specialRequests:I,setSpecialRequests:D}}function Do({listing:t,selectedBookingPackage:n,selectedDate:s,startTime:r,endTime:o,guestCount:l,calculatedHours:i,serviceName:c,coverImage:d,schedule:a,toast:f,selectedAddOns:u,serviceEventLocation:m,authoritativePricing:x,charter:h,setIsBookingFlowOpen:g,resetBookingState:k}){const[y,v]=b.useState(!1),[T,L]=b.useState(!1),[M,N]=b.useState(null),[I,D]=b.useState(null),[S,p]=b.useState(!1),[A,w]=b.useState(null),{startCheckout:E}=qn(),R=b.useCallback(async()=>{var C,$;if(!t){f({title:"Error",description:"Listing information is not available",variant:"destructive"});return}const Q=!n&&!!h;if(!n&&!Q){f({title:"Missing information",description:"Please select a package to book",variant:"destructive"});return}if(t.listingKind!=="service"){f({title:"Error",description:"Invalid listing type. This listing cannot be booked as a service.",variant:"destructive"});return}if(!s){f({title:"Missing information",description:"Please select an event date",variant:"destructive"});return}if(a.length>0&&!Xt(s,a)){f({title:"Date not available",description:"The selected date is not available. Please choose a different date.",variant:"destructive"});return}if(Q){v(!0);try{const P=xe(s,"yyyy-MM-dd"),{startDateTime:O,endDateTime:U}=et(P,"12:00","13:00"),te=typeof(x==null?void 0:x.total)=="number"?x.total:void 0,G=typeof(x==null?void 0:x.serviceFee)=="number"?x.serviceFee:void 0,B=typeof(x==null?void 0:x.subtotal)=="number"?x.subtotal:typeof te=="number"&&typeof G=="number"?te-G:void 0,K={listingId:t.listingId,listingTitle:c,listingKind:"service",startTime:O,endTime:U,hours:1,guestCount:0,imageUrl:d!==ft?d:void 0,...m?{location:m.formattedAddress,latitude:m.lat,longitude:m.lng,eventLocation:m}:{},selectedAddOns:u.length>0?u:void 0,total:te,subtotal:B,serviceFee:G,taxStatus:"calculated_at_checkout",charter:h};g(!1),k(),E(K)}catch(P){const O=P instanceof Error?P.message:"Failed to start checkout. Please try again.";f({title:"Unable to start checkout",description:O,variant:"destructive"})}finally{v(!1)}return}if(!r||!o){f({title:"Missing information",description:"Please select both start and end times",variant:"destructive"});return}if(r===o){f({title:"Invalid duration",description:"Start and end time cannot be the same.",variant:"destructive"});return}const V=n.priceType==="per_person"||n.priceType==="per_guest"||It(n);if(V&&(!l||l<1)){f({title:"Missing information",description:"Please enter the number of guests (minimum 1)",variant:"destructive"});return}if(V){const P=br({guestCount:l,packageGuestMin:(C=n.guestLimit)==null?void 0:C.min,packageGuestMax:($=n.guestLimit)==null?void 0:$.max,packageName:n.name});if(P){f({...P,variant:"destructive"});return}}const z=es({calculatedHours:i,packageDuration:n.duration,packageName:n.name});if(z){f({...z,variant:"destructive"});return}if(!ot(m)){f({title:"Event address required",description:"Choose a full address from the suggestions so we can confirm the service location.",variant:"destructive"});return}v(!0);try{const P=xe(s,"yyyy-MM-dd"),O=Ts(r,o,s,a);if(O){f({title:"Time not available",description:O,variant:"destructive"});return}const{startDateTime:U,endDateTime:te}=et(P,r,o);if(!i||i<=0||!Number.isFinite(i)){f({title:"Invalid duration",description:"Start time must be before end time. Please check your time selection.",variant:"destructive"});return}const G=V?l:l||0,B=typeof(x==null?void 0:x.total)=="number"?x.total:void 0,K=typeof(x==null?void 0:x.serviceFee)=="number"?x.serviceFee:void 0,ae=typeof(x==null?void 0:x.subtotal)=="number"?x.subtotal:typeof B=="number"&&typeof K=="number"?B-K:void 0,pe={listingId:t.listingId,listingTitle:c,listingKind:"service",startTime:U,endTime:te,hours:i,guestCount:G,imageUrl:n.image||(d!==ft?d:void 0),location:m.formattedAddress,latitude:m.lat,longitude:m.lng,eventLocation:m,selectedPackageId:n.id,selectedPackageName:n.name,selectedAddOns:u.length>0?u:void 0,total:B,subtotal:ae,serviceFee:K,taxStatus:"calculated_at_checkout",selectionMode:"package",...h?{charter:h}:{},selectedPackages:[{packageId:n.id,packageName:n.name,price:typeof ae=="number"?ae:typeof B=="number"?B:n.price??0}]};g(!1),k(),E(pe)}catch(P){const O=P instanceof Error?P.message:"Failed to start checkout. Please try again.";f({title:"Unable to start checkout",description:O,variant:"destructive"})}finally{v(!1)}},[t,n,s,r,o,l,i,c,d,a,f,u,m,x,h,g,k,E]),j=b.useCallback(async()=>{L(!1),N(null),D(null)},[]),F=b.useCallback(()=>{p(!1),w(null),N(null)},[]),_=b.useCallback(async()=>{p(!1),w(null),N(null)},[]);return{handleAddToCart:R,isAddingToCart:y,handleReplaceConfirm:j,handleAdjustServiceTime:F,handleAdjustVenueTime:_,showReplaceModal:T,setShowReplaceModal:L,compatibilityResult:I,setCompatibilityResult:D,pendingService:M,setPendingService:N,showTimeConflictModal:S,setShowTimeConflictModal:p,timeConflictData:A,setTimeConflictData:w}}function Oo({isMobile:t,isDialogOpen:n}){const s=b.useRef(null),r=b.useRef(null),[o,l]=b.useState(!1);return b.useEffect(()=>{if(!t)return;let i,c;const d=()=>{const a=r.current;if(!a){c=setTimeout(d,100);return}const f=()=>l(a.scrollTop>100);f(),a.addEventListener("scroll",f,{passive:!0}),i=()=>a.removeEventListener("scroll",f)};return d(),()=>{c&&clearTimeout(c),i&&i()}},[t]),{stickyCardRef:s,scrollContainerRef:r,stickyCardPosition:null,isScrolled:o}}const Po="AIzaSyATWdF6OVbFX1X_OuYCMZdxWZi7ggnhRWI",$o=({id:t,label:n,value:s,onChangeText:r,onResolved:o,onClearResolved:l,resolved:i,placeholder:c="Start typing an address…",className:d,disabled:a,inOverlay:f,resolvedMessage:u,suppressUnresolvedWarning:m})=>{const x=Kr("places"),h=b.useRef(null),g=b.useRef(null),k=b.useRef(null),[y,v]=b.useState([]),[T,L]=b.useState(!1),M=b.useRef(null),N=!a&&s.trim().length>0;b.useEffect(()=>{x&&(h.current=new x.AutocompleteService,k.current||(k.current=document.createElement("div")),g.current=new x.PlacesService(k.current))},[x]),b.useEffect(()=>{const A=w=>{M.current&&!M.current.contains(w.target)&&L(!1)};return document.addEventListener("mousedown",A),()=>document.removeEventListener("mousedown",A)},[]);const I=b.useRef(!1);b.useEffect(()=>{var R,j;if(!x)return;if(i){I.current=!1;return}if(!m){I.current=!1;return}if(I.current)return;const A=s.trim();if(!A)return;I.current=!0;const w=typeof window<"u"?(j=(R=window.google)==null?void 0:R.maps)==null?void 0:j.Geocoder:void 0;if(!w)return;new w().geocode({address:A,region:"us"},(F,_)=>{var Q;if(_==="OK"&&F&&F.length>0){const V=F[0],z=(Q=V.geometry)==null?void 0:Q.location,C=typeof(z==null?void 0:z.lat)=="function"?z.lat():void 0,$=typeof(z==null?void 0:z.lng)=="function"?z.lng():void 0;o({formattedAddress:V.formatted_address||A,placeId:V.place_id||void 0,lat:typeof C=="number"?C:void 0,lng:typeof $=="number"?$:void 0})}})},[x,i,m,s,o]);const D=b.useCallback(A=>{if(r(A),i&&l(),!A.trim()||!h.current){v([]),L(!1);return}const w={input:A,componentRestrictions:{country:"us"}};h.current.getPlacePredictions(w,(E,R)=>{R===google.maps.places.PlacesServiceStatus.OK&&E&&E.length>0?(v(E.map(j=>({description:j.description,placeId:j.place_id}))),L(!0)):(v([]),L(!1))})},[r,l,i]),S=b.useCallback(()=>{r(""),l(),v([]),L(!1)},[r,l]),p=b.useCallback(A=>{if(r(A.description),L(!1),v([]),!g.current){o({formattedAddress:A.description,placeId:A.placeId});return}g.current.getDetails({placeId:A.placeId,fields:["formatted_address","geometry","place_id"]},(w,E)=>{var R,j,F,_;if(E===google.maps.places.PlacesServiceStatus.OK&&w){const Q=(j=(R=w.geometry)==null?void 0:R.location)==null?void 0:j.lat(),V=(_=(F=w.geometry)==null?void 0:F.location)==null?void 0:_.lng();o({formattedAddress:w.formatted_address||A.description,placeId:w.place_id||A.placeId,lat:typeof Q=="number"?Q:void 0,lng:typeof V=="number"?V:void 0})}else o({formattedAddress:A.description,placeId:A.placeId})})},[r,o]);return e.jsxs("div",{className:le("space-y-2",d),ref:M,children:[e.jsx(Ne,{htmlFor:t,className:"text-base font-semibold",children:n}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Choose a verified address so your host knows where to provide the service."}),e.jsxs("div",{className:"relative",children:[e.jsx(Jt,{id:t,value:s,disabled:a,onChange:A=>D(A.target.value),onFocus:()=>s.trim().length>1&&y.length>0&&L(!0),placeholder:c,autoComplete:"off",className:le("h-11 rounded-xl pl-10 pr-10",i&&"border-primary/50")}),e.jsx(lt,{className:"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),N&&e.jsx("button",{type:"button","aria-label":"Clear address",className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",onMouseDown:A=>A.preventDefault(),onClick:S,children:e.jsx(Zt,{className:"h-4 w-4"})}),T&&y.length>0&&e.jsx("div",{className:le("absolute z-50 mt-1 max-h-56 w-full overflow-y-auto rounded-xl border border-border bg-card py-1 shadow-lg",f&&"z-[130]"),children:y.map((A,w)=>e.jsxs("button",{type:"button",className:"flex w-full items-start gap-2 px-3 py-2.5 text-left text-sm hover:bg-muted",onMouseDown:E=>E.preventDefault(),onClick:()=>p(A),children:[e.jsx(lt,{className:"mt-0.5 h-4 w-4 shrink-0 text-muted-foreground"}),e.jsx("span",{className:"min-w-0",children:A.description})]},`${A.placeId}-${w}`))})]}),i?e.jsx("p",{className:"text-xs font-medium text-primary",children:u??"Address verified — you can change it by typing a new search."}):s.trim()&&!m?e.jsx("p",{className:"text-xs text-amber-800",children:"Select an address from the list to continue."}):null]})},ys=({eventLocation:t,onEventLocationChange:n,onInputTextChange:s,suppressUnresolvedWarning:r,...o})=>{const[l,i]=b.useState(()=>(t==null?void 0:t.formattedAddress)??"");return b.useEffect(()=>{i((t==null?void 0:t.formattedAddress)??"")},[t==null?void 0:t.formattedAddress]),e.jsx(Sn,{apiKey:Po,children:e.jsx($o,{...o,value:l,onChangeText:c=>{i(c),s==null||s(c)},resolved:!!(t!=null&&t.placeId||(t==null?void 0:t.lat)!=null&&(t==null?void 0:t.lng)!=null),suppressUnresolvedWarning:r,onClearResolved:()=>n(null),onResolved:c=>n(c)})})};function Ft(t,n){const s=n.minMiles??0,r=n.maxMiles??1/0,o=Number.isFinite(t)?Math.max(t,0):0;return Math.min(Math.max(o,s),r)}function qo(t,n){const s=Ft(t,n),r=Math.max(s*n.ratePerMile,n.minimumFare??0);return Math.round(r*100)/100}function mn({vehicles:t,estimatedMiles:n,onChange:s,className:r}){const[o,l]=b.useState(()=>{var y;return((y=t[0])==null?void 0:y.id)??""}),i=t.find(y=>y.id===o)??t[0],c=(i==null?void 0:i.perMile)??{ratePerMile:0},[d,a]=b.useState(()=>Ft(Math.round(n),c)),[f,u]=b.useState(()=>String(d)),[m,x]=b.useState("one_way");b.useEffect(()=>{a(y=>{const v=Ft(y,c);return u(String(v)),v})},[o]);const h=m==="round_trip"?d*2:d,g=b.useMemo(()=>qo(h,c),[h,c]);b.useEffect(()=>{i&&s({miles:d,tripType:m,vehicleClassId:i.id})},[d,m,i,s]);const k=c.maxMiles!=null&&h>c.maxMiles;return e.jsxs("div",{className:le("flex flex-col gap-4",r),children:[e.jsxs("div",{className:"flex flex-col gap-2",role:"radiogroup","aria-label":"Vehicle",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:"Vehicle"}),t.map(y=>{const v=y.id===o;return e.jsxs("button",{type:"button",role:"radio","aria-checked":v,"aria-label":y.displayName,onClick:()=>l(y.id),className:le("flex items-center justify-between gap-3 rounded-lg border px-3 py-2 text-left text-sm transition-colors",v?"border-primary ring-1 ring-primary":"border-input hover:bg-accent"),children:[e.jsx("span",{className:"font-medium",children:y.displayName}),e.jsxs("span",{className:"flex items-center gap-2 text-muted-foreground",children:[y.seatedCapacity!=null&&e.jsxs("span",{className:"tabular-nums",children:[y.seatedCapacity," seats"]}),e.jsxs("span",{className:"tabular-nums",children:["$",y.perMile.ratePerMile,"/mi"]})]})]},y.id)})]}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(Ne,{htmlFor:"charter-miles",className:"text-sm text-muted-foreground",children:"Miles"}),e.jsx(Jt,{id:"charter-miles","data-testid":"charter-miles",type:"number",inputMode:"numeric",min:0,value:f,onChange:y=>{const v=y.target.value;u(v);const T=Number(v);a(v===""||Number.isNaN(T)?0:T)},onBlur:()=>{const y=Ft(d,c);a(y),u(String(y))},className:"[&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none [-moz-appearance:textfield]"})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(X,{type:"button",variant:m==="one_way"?"default":"outline",size:"sm","aria-pressed":m==="one_way",className:"flex-1",onClick:()=>x("one_way"),children:"One way"}),e.jsx(X,{type:"button",variant:m==="round_trip"?"default":"outline",size:"sm","aria-label":"round trip","aria-pressed":m==="round_trip",className:"flex-1",onClick:()=>x("round_trip"),children:"Round trip"})]}),e.jsxs("div",{className:"flex items-baseline justify-between",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:"Estimated total"}),e.jsxs("span",{"data-testid":"charter-total",className:"text-lg font-semibold tabular-nums",children:["$",g.toLocaleString()]})]}),k&&e.jsx("p",{role:"alert",className:"text-sm text-amber-700",children:"Beyond this operator’s maximum — please request a custom quote."})]})}const _o=({isMobile:t,addOns:n,feeInput:s,selectedPackage:r,isPackageDetailOpen:o,setIsPackageDetailOpen:l,offerings:i,isPackageSelectionOpen:c,setIsPackageSelectionOpen:d,bookingFlow:a,pricing:f,cartActions:u,bookingRequest:m,acceptsInstantBookings:x,cartLoading:h,isShareOpen:g,setIsShareOpen:k,onViewPackageDetails:y,handleMessageProvider:v,navigate:T,toast:L,charterVehicles:M,charterEstimatedMiles:N=0,onCharterChange:I,taxJurisdictionCollected:D=!1})=>{const S=Qt(),{isBookingFlowOpen:p,setIsBookingFlowOpen:A,selectedBookingPackage:w,setSelectedBookingPackage:E,selectedDate:R,setSelectedDate:j,startTime:F,setStartTime:_,endTime:Q,setEndTime:V,guestCount:z,setGuestCount:C,guestCountTempValue:$,setGuestCountTempValue:P,handleSelectPackageAndBook:O,startTimeOptions:U,endTimeOptions:te,startTimeMinTime:G,startTimeMaxTime:B,endTimeMinTime:K,endTimeMaxTime:ae,serviceDatePickerDisabled:pe,datePickerMinDate:de,datePickerMaxDate:we,selectedAddOns:Fe,toggleAddOn:De,setAddOnQuantity:ct,serviceEventLocation:Oe,setServiceEventLocation:Ve,durationMinutes:Pe,setDurationMinutes:tt,bookingAutofillHint:me,addressAutofillHint:ve,plannerCalendarHighlights:Ge}=a,{calculatedHours:ke,servicePricingBreakdown:$e}=f,qe=W=>{if(!W)return null;const[ne,oe]=W.split(":").map(Number);if(Number.isNaN(ne)||Number.isNaN(oe))return null;const he=new Date;return he.setHours(ne,oe,0,0),xe(he,"h:mm a")},Ie=b.useMemo(()=>{if(!R)return"Select a date to view available booking hours.";if(U.length===0)return"No booking hours are configured for this date.";const W=U.reduce((ne,oe)=>{const he=qe(oe.value);if(!he)return ne;const Ce=oe.isNextDay?" (next day)":"",Ue=`${he}${Ce}`;return ne.includes(Ue)||ne.push(Ue),ne},[]);return W.length===0?"No booking hours are configured for this date.":`${xe(R,"EEEE")}: starts from ${W[0]}`},[R,U]),H=b.useMemo(()=>{if(!R||!F||!Q)return!1;try{const W=xe(R,"yyyy-MM-dd"),{startDateTime:ne,endDateTime:oe}=et(W,F,Q),he=new Date(ne),Ce=new Date(oe);return Number.isNaN(he.getTime())||Number.isNaN(Ce.getTime())?!1:Ce.toDateString()!==he.toDateString()}catch{return!1}},[R,F,Q]);b.useMemo(()=>{var W;return((W=te.find(ne=>ne.value===Q))==null?void 0:W.isNextDay)===!0},[te,Q]);const q=b.useMemo(()=>w?es({calculatedHours:ke,packageDuration:w.duration,packageName:w.name}):null,[w,ke]),Z=b.useMemo(()=>{if(!F||!Q||!R)return null;if(F===Q)return{title:"Invalid time range",description:"End time must be after start time."};try{const W=xe(R,"yyyy-MM-dd"),{startDateTime:ne,endDateTime:oe}=et(W,F,Q),he=new Date(ne),Ce=new Date(oe);if(isNaN(he.getTime())||isNaN(Ce.getTime()))return null;if(Ce<=he)return{title:"Invalid time range",description:"End time must be after start time."}}catch{return null}return null},[F,Q,R]),se=b.useMemo(()=>typeof window<"u"?`${window.location.origin}${S.pathname}${S.search}`:`${S.pathname}${S.search}`,[S.pathname,S.search]),J=b.useMemo(()=>gs(w),[w]),be=b.useMemo(()=>{const W=w==null?void 0:w.priceType;return W==="per_person"||W==="per_guest"||It(w)},[w]),[re,ye]=b.useState(null),[_e,ze]=b.useState(null),Ae=ri({eventDate:R?xe(R,"yyyy-MM-dd"):"",startTime:F??"",durationMinutes:Pe,guestCount:z,guestMin:1,guestMax:9999,requiresEventLocation:!0,hasVerifiedEventLocation:ot(Oe),requiresPackageSelection:!1,packageSelected:!!w});return e.jsxs(e.Fragment,{children:[e.jsx(ho,{package:r,feeInput:s,isOpen:o,onOpenChange:l,onSelectPackage:()=>{r&&(l(!1),O(r))}}),e.jsx(fo,{offerings:i,feeInput:s,isOpen:c,onOpenChange:d,onSelectPackage:W=>{E(W),d(!1),A(!0)},onViewDetails:W=>{d(!1),y(W)}}),p&&w&&e.jsx(Ke,{open:p,onOpenChange:A,children:e.jsxs(Qe,{className:t?"":"max-w-3xl max-h-[90vh] overflow-y-auto",mobileBottomSheet:t,hideCloseButton:!1,children:[e.jsxs(Ze,{children:[e.jsxs(Je,{className:"text-2xl",children:["Book ",w.name]}),e.jsx(Xe,{children:"Select your date, time, and preferences to add this service to your celebration"})]}),e.jsxs("div",{className:t?"space-y-6":"py-6 space-y-6",children:[e.jsxs("div",{className:t?"space-y-6":"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[e.jsxs("div",{className:"space-y-6",children:[e.jsx(ys,{label:"Where will this service take place?",eventLocation:Oe,onEventLocationChange:Ve,inOverlay:!0,suppressUnresolvedWarning:!!ve,resolvedMessage:(ve==null?void 0:ve.source)==="cart_venue"?"Address verified — pre-filled from your venue booking in cart. Change it if this service is elsewhere.":(ve==null?void 0:ve.source)==="party_package"?"Address verified — pre-filled from your party planner event location. Change it if this service is elsewhere.":void 0}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(Ne,{className:"text-base font-semibold",children:"Event Date"}),R&&me&&xe(R,"yyyy-MM-dd")===me.dateYmd&&e.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-brand-400",children:[e.jsx(Ns,{className:"w-3 h-3"}),me.source==="cart"?"From checkout cart":"From party package"]})]}),e.jsx(xs,{value:R||null,onChange:W=>j(W),placeholder:"Select date",minDate:de,maxDate:we,disabledDates:pe,plannerHighlights:Ge})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(Ne,{className:"text-base font-semibold",children:"Time Window"}),Ie&&e.jsxs("div",{className:"rounded-lg border border-blue-100 bg-blue-50 px-3 py-2 text-xs text-blue-800",children:[e.jsx("span",{className:"font-medium",children:"Availability:"})," ",Ie]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Ne,{className:"text-sm text-gray-700",children:"Start Time"}),e.jsx(hs,{value:F,onChange:_,onInvalidTime:W=>L({title:"Start time unavailable",description:W,variant:"destructive"}),placeholder:"Add time",options:U,minTime:G,maxTime:B})]}),e.jsx(ii,{valueMinutes:Pe,minMinutes:nt*60,maxMinutes:12*60,stepMinutes:30,onChange:tt}),q&&e.jsx("p",{className:"text-sm text-destructive font-medium",children:q.description}),Z&&e.jsx("p",{className:"text-sm text-destructive font-medium",children:Z.description})]}),be&&e.jsxs("div",{className:"space-y-3",children:[e.jsx(Ne,{className:"text-base font-semibold",children:"Number of Guests"}),e.jsx(Jt,{type:"number",min:J.min,max:J.max,value:$,onChange:W=>P(W.target.value),onBlur:()=>{const W=parseInt($,10);if(!isNaN(W)&&W>=0){const ne=pr(W,J);C(ne),P(ne>0?ne.toString():"");const oe=Io({enteredValue:W,adjustedValue:ne,bounds:J,packageName:w.name});ye(oe),oe&&L({title:"Guest count adjusted",description:oe,variant:"destructive"})}else P(z>0?z.toString():""),ye("Guest count must be a valid number.")},onKeyDown:W=>{W.key==="Enter"&&W.currentTarget.blur()},placeholder:"0",className:"w-full h-12 [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none [-moz-appearance:textfield]"}),w.guestLimit&&e.jsxs("p",{className:"text-xs text-gray-500",children:[w.guestLimit.min&&`Minimum: ${w.guestLimit.min} `,w.guestLimit.max&&`Maximum: ${w.guestLimit.max}`]}),re&&e.jsx("p",{className:"text-xs text-amber-700",children:re}),(()=>{const W=J.min,ne=J.max,oe=typeof W=="number"&&W>0&&z<W,he=typeof ne=="number"&&ne>0&&z>ne;return oe?e.jsxs("p",{className:"text-sm text-destructive font-medium",children:['"',w.name,'" requires a minimum of ',W," guests."]}):he?e.jsxs("p",{className:"text-sm text-destructive font-medium",children:['"',w.name,'" allows a maximum of ',ne," guests."]}):null})()]})]}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"border rounded-xl p-4 space-y-3",children:[w.image&&e.jsx("img",{src:w.image,alt:w.name,className:"w-full h-32 object-cover rounded-lg"}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-semibold text-gray-900",children:w.name}),w.description&&e.jsx("p",{className:"text-sm text-gray-600 mt-1 line-clamp-2",children:w.description})]})]}),n.length>0&&e.jsx(ai,{addOns:n,feeInput:s,selectedAddOns:Fe,onToggle:De,onSetQuantity:ct}),M&&M.length>0&&I&&e.jsxs("div",{className:"border rounded-xl p-4 space-y-3",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold text-gray-900",children:"Per-mile charter"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Pick a vehicle and charter it by distance. The operator confirms the final fare based on the route."})]}),e.jsx(mn,{vehicles:M,estimatedMiles:N,onChange:I})]}),e.jsx(Bo,{selectedBookingPackage:w,guestCount:z,calculatedHours:ke,servicePricingBreakdown:$e,acceptsInstantBookings:x,previewState:f.previewState,feeInput:s,taxJurisdictionCollected:D}),!x&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(Ne,{htmlFor:"service-special-requests",className:"text-sm font-medium text-gray-700",children:"Message to host (optional)"}),e.jsx(_s,{id:"service-special-requests",placeholder:"e.g. reason for your request, questions, or special requirements",value:m.specialRequests,onChange:W=>m.setSpecialRequests(W.target.value),className:"min-h-[80px] rounded-xl resize-none",maxLength:500})]})]})]}),e.jsxs("div",{className:`flex gap-3 ${t?"pt-4 border-t border-gray-200 mt-6":"pt-4 border-t"}`,children:[!t&&e.jsx(X,{variant:"outline",onClick:()=>{A(!1),E(null),j(null)},className:"flex-1 rounded-full",children:"Cancel"}),e.jsx(X,{onClick:x?u.handleAddToCart:m.handleRequestBooking,disabled:(()=>{if(!Ae.isValid||!w||!R||!F||be&&(!z||z<1))return!0;const ne=J.min,oe=J.max;return!!(typeof ne=="number"&&ne>0&&z<ne||typeof oe=="number"&&oe>0&&z>oe||q||Z||!ot(Oe)||x&&(u.isAddingToCart||h)||!x&&m.isRequestingBooking)})(),className:"w-full bg-brand hover:bg-brand-600 text-white rounded-full py-6 text-base font-semibold disabled:opacity-50 disabled:cursor-not-allowed",type:"button",children:x?u.isAddingToCart?e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(rt,{className:"animate-spin h-4 w-4"}),"Adding..."]}):"Book now":m.isRequestingBooking?e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(rt,{className:"animate-spin h-4 w-4"}),"Submitting..."]}):"Request Service"}),!Ae.isValid&&Ae.nextMissingRequirement&&e.jsx("p",{className:"mt-2 text-sm text-muted-foreground text-center",children:Ae.nextMissingRequirement})]}),H&&e.jsx("p",{className:"text-xs text-amber-800",children:"Your selected time window crosses midnight and will be booked into the next day."})]})]})}),p&&!w&&M&&M.length>0&&I&&e.jsx(Ke,{open:p,onOpenChange:A,children:e.jsxs(Qe,{className:t?"":"max-w-lg max-h-[90vh] overflow-y-auto",mobileBottomSheet:t,hideCloseButton:!1,children:[e.jsxs(Ze,{children:[e.jsx(Je,{className:"text-2xl",children:"Charter a vehicle"}),e.jsx(Xe,{children:"Pick your date, vehicle, and distance. The operator confirms the final fare."})]}),e.jsxs("div",{className:t?"space-y-6":"py-6 space-y-6",children:[e.jsx(ys,{label:"Where will this trip take place?",eventLocation:Oe,onEventLocationChange:Ve,inOverlay:!0}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(Ne,{className:"text-base font-semibold",children:"Event Date"}),e.jsx(xs,{value:R||null,onChange:W=>j(W),placeholder:"Select date",minDate:de,maxDate:we,plannerHighlights:Ge})]}),e.jsx(mn,{vehicles:M,estimatedMiles:N,onChange:W=>{ze(W),I(W)}}),!x&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(Ne,{htmlFor:"charter-special-requests",className:"text-sm font-medium text-gray-700",children:"Message to host (optional)"}),e.jsx(_s,{id:"charter-special-requests",placeholder:"e.g. pickup details, route, or special requirements",value:m.specialRequests,onChange:W=>m.setSpecialRequests(W.target.value),className:"min-h-[80px] rounded-xl resize-none",maxLength:500})]}),e.jsxs("div",{className:`flex gap-3 ${t?"pt-4 border-t border-gray-200 mt-6":"pt-4 border-t"}`,children:[!t&&e.jsx(X,{variant:"outline",onClick:()=>{A(!1),j(null)},className:"flex-1 rounded-full",children:"Cancel"}),e.jsx(X,{onClick:x?u.handleAddToCart:m.handleRequestBooking,disabled:!!(!R||!_e||x&&(u.isAddingToCart||h)||!x&&m.isRequestingBooking),className:"w-full bg-brand hover:bg-brand-600 text-white rounded-full py-6 text-base font-semibold disabled:opacity-50 disabled:cursor-not-allowed",type:"button",children:x?u.isAddingToCart?e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(rt,{className:"animate-spin h-4 w-4"}),"Adding..."]}):"Book now":m.isRequestingBooking?e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(rt,{className:"animate-spin h-4 w-4"}),"Submitting..."]}):"Request to book"})]})]})]})}),e.jsx(Ke,{open:g,onOpenChange:k,children:e.jsxs(Qe,{className:t?"":"max-w-lg rounded-3xl p-6",mobileBottomSheet:t,elevated:!0,children:[e.jsxs(Ze,{children:[e.jsx(Je,{className:"text-xl font-semibold",children:"Share this service"}),e.jsx(Xe,{children:"Invite your planning team or clients to view this service."})]}),e.jsx("div",{className:t?"space-y-3 text-sm":"mt-4 space-y-3 text-sm",children:e.jsx(li,{shareUrl:se,context:"service"})})]})}),u.compatibilityResult&&e.jsx(vo,{isOpen:u.showReplaceModal,onClose:()=>{u.setShowReplaceModal(!1),u.setPendingService(null),u.setCompatibilityResult(null)},onConfirm:u.handleReplaceConfirm,existingDate:u.compatibilityResult.existingDate||"",newDate:u.compatibilityResult.newDate}),u.timeConflictData&&e.jsx(wo,{isOpen:u.showTimeConflictModal,onClose:()=>{u.setShowTimeConflictModal(!1),u.setTimeConflictData(null),u.setPendingService(null)},onAdjustTime:u.handleAdjustServiceTime,onAdjustOtherTime:u.handleAdjustVenueTime,onMessageProvider:v,conflictType:"service-to-venue",venueTimeWindow:u.timeConflictData.venueTimeWindow,serviceTimeWindow:u.timeConflictData.serviceTimeWindow}),e.jsx(_n,{isOpen:m.showRequestSubmitted,onClose:()=>{m.setShowRequestSubmitted(!1),T("/")}})]})};function zo(t,n,s,r,o){const l=ie(n);switch(t){case"fixed_per_guest":case"per_person":case"per_guest":return`${l}/person × ${s} guest${s===1?"":"s"}`;case"fixed_per_hour":case"per_hour":return`${l}/hr × ${Math.round(r)} hr${Math.round(r)===1?"":"s"}`;case"fixed_per_event":case"per_event":return"flat rate";case"fixed_per_quantity":return o?`${l} × ${o}`:null;default:return null}}const Bo=({selectedBookingPackage:t,guestCount:n,calculatedHours:s,servicePricingBreakdown:r,acceptsInstantBookings:o,previewState:l,feeInput:i,taxJurisdictionCollected:c=!1})=>{var T,L;const d=(T=l.selectionSnapshots)==null?void 0:T.filter(M=>M.selectionType==="add_on"),a=(L=l.selectionSnapshots)==null?void 0:L.find(M=>M.selectionType==="package"),f=Se.useMemo(()=>(d??[]).map(M=>({snapshot:M,guestAmount:ss(M,i)??M.finalAmount,guestUnitPrice:Jr(M,i)??M.unitPrice})),[d,i]),u=f.reduce((M,N)=>M+N.guestAmount,0),m=r.subtotal,h=typeof m=="number"&&Number.isFinite(m)&&typeof u=="number"&&Number.isFinite(u)&&m>=0?Math.max(0,Math.round((m-u)*100)/100):null,g=Se.useMemo(()=>a?ss({finalAmount:a.baseAmount},i)??null:null,[a,i]),k=h??(a?ss(a,i)??a.finalAmount:_t(t.price,i)??null),y=Se.useMemo(()=>{const M=a==null?void 0:a.timelineAdjustment;return!M||g===null||k===null?null:Di(M,g,k)},[a,g,k]),v=_t(t.price,i)??t.price;return e.jsxs("div",{className:"border rounded-xl p-4 bg-gray-50 space-y-3",children:[e.jsx("h4",{className:"font-semibold text-gray-900",children:"Price Breakdown"}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex justify-between text-sm",children:[e.jsx("span",{className:"text-gray-600",children:t.name}),e.jsx("span",{className:"font-medium",children:(()=>{const M=g??k;return M!==null?ie(M):"—"})()})]}),(()=>{const M=ie(v),N=t.priceType;return N==="per_person"||N==="per_guest"?e.jsxs("p",{className:"text-xs text-gray-500",children:[M,"/person × ",n," guest",n===1?"":"s"]}):N==="per_hour"?e.jsxs("p",{className:"text-xs text-gray-500",children:[M,"/hr × ",Math.round(s)," hr",Math.round(s)===1?"":"s"]}):N==="per_event"||N==="fixed"?e.jsx("p",{className:"text-xs text-gray-500",children:"per event"}):null})(),y&&e.jsxs("div",{className:"flex justify-between text-xs text-green-700",children:[e.jsxs("span",{children:[y.label," (",y.pct>0?"+":"",y.pct,"%)"]}),e.jsx("span",{children:ie(y.delta)})]})]}),f.length>0&&f.map(({snapshot:M,guestAmount:N,guestUnitPrice:I})=>e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex justify-between text-sm",children:[e.jsx("span",{className:"text-gray-600",children:M.name}),e.jsx("span",{className:"font-medium",children:ie(N)})]}),(()=>{const D=zo(M.priceModel,I,n,s,M.quantity);return D?e.jsx("p",{className:"text-xs text-gray-500",children:D}):null})()]},M.sourceEntityId)),e.jsxs("div",{className:"flex justify-between text-sm text-gray-600 pt-1 border-t border-gray-200",children:[e.jsx("span",{children:"Subtotal"}),e.jsx("span",{children:m!==null?ie(m):"—"})]}),e.jsx(wn,{taxStatus:"calculated_at_checkout",taxJurisdictionCollected:c,className:"text-sm text-gray-600"}),e.jsx(kn,{serviceFeeCents:r.serviceFee!==null?Math.round(r.serviceFee*100):null,pendingLabel:"Finalized in cart",className:"text-sm text-gray-600"}),e.jsx(je,{className:"my-2"}),e.jsxs("div",{className:"flex justify-between font-semibold text-base",children:[e.jsx("span",{children:l.status==="loading"?"Calculating...":r.isAuthoritative?"Total":"Estimated total"}),e.jsx("span",{className:"text-brand",children:l.status==="loading"?e.jsx(rt,{className:"h-4 w-4 animate-spin text-muted-foreground"}):r.total!==null?ie(r.total):"Request quote"})]}),l.status==="error"&&e.jsx("p",{className:"text-xs text-amber-700",children:"Live pricing unavailable — showing an estimate. Your exact total is confirmed at checkout."}),!o&&e.jsxs("div",{className:"mt-2 inline-flex items-center gap-1.5 rounded-full bg-amber-50 border border-amber-200 px-3 py-1.5",children:[e.jsx(qr,{className:"h-3.5 w-3.5 text-amber-600"}),e.jsx("span",{className:"text-xs font-medium text-amber-800",children:"Booking Request Required — You won't be charged yet."})]}),e.jsx("p",{className:"text-xs text-gray-500 pt-1",children:o?"Final total and applicable sales tax are confirmed in cart and checkout.":"The host will review your request and respond within 24 hours."})]})]})},yr=oi,jr=Yi,Ho=({vm:t,listing:n,offerings:s,feeInput:r,serviceData:o,serviceType:l,effectiveData:i,metadata:c,cancellationPolicy:d,cancellationNotes:a,isScrolled:f,scrollContainerRef:u,navigate:m,isSaved:x,savingService:h,handleSaveService:g,handleViewPackageDetails:k,handleShowDates:y,handleMessageProvider:v,onRequestCustomQuote:T,createConversationPending:L,setIsShareOpen:M,schedule:N,blockedDates:I,availability:D,acceptsInstantBookings:S,selectedDate:p,onAvailabilityDateSelect:A,plannerCalendarHighlights:w,catererMenu:E,catererMenuItems:R,onMenuItemAddToCart:j,catererMenuOrderProgress:F,isRequestMode:_,requestModeItems:Q,requestModeSubtotalCents:V,onSubmitMenuRequest:z,onRemoveRequestModeItem:C})=>{var $,P,O,U,te,G,B,K,ae;return e.jsxs("div",{className:"flex flex-col min-h-screen",children:[e.jsx("div",{className:le("fixed top-0 left-0 right-0 z-50 bg-white border-b transition-all duration-300",f?"translate-y-0 opacity-100 shadow-sm pointer-events-auto":"-translate-y-full opacity-0 pointer-events-none"),children:e.jsxs("div",{className:"px-4 py-3 flex items-center justify-between",children:[e.jsx(X,{variant:"ghost",size:"icon",className:"h-9 w-9 hover:bg-gray-100",onClick:()=>typeof window<"u"&&window.history.length>1?m(-1):m("/services"),children:e.jsx(zs,{className:"h-5 w-5"})}),e.jsxs("div",{className:"flex items-center gap-2",children:[((($=t.hostProfile)==null?void 0:$.publicId)||(n==null?void 0:n.ownerPublicId))&&e.jsx(X,{variant:"ghost",size:"icon",className:"h-9 w-9 hover:bg-gray-100 p-0",asChild:!0,children:e.jsx("a",{href:`/u/${((P=t.hostProfile)==null?void 0:P.publicId)||(n==null?void 0:n.ownerPublicId)}`,target:"_blank",rel:"noopener noreferrer",className:"flex items-center justify-center","aria-label":"View service provider profile",children:e.jsx(xt,{src:t.hostAvatar||void 0,alt:"Servicer avatar",className:"h-8 w-8 rounded-full object-cover border border-gray-200",fallback:"/default-profile-icon.png"})})}),e.jsx(X,{variant:"ghost",size:"icon",className:"h-9 w-9 hover:bg-gray-100",onClick:()=>M(!0),children:e.jsx(Dt,{className:"h-5 w-5"})}),g!=null&&e.jsx(X,{variant:"ghost",size:"icon",className:le("h-9 w-9 hover:bg-gray-100",x&&"text-brand"),onClick:g,disabled:h,children:e.jsx(Ot,{className:le("h-5 w-5",x&&"fill-current")})})]})]})}),e.jsxs("div",{className:"fixed top-0 left-0 right-0 z-30 px-4 pt-4 pb-2 flex items-center justify-between",children:[e.jsx(X,{variant:"ghost",size:"icon",className:"h-10 w-10 rounded-full bg-white/90 backdrop-blur-sm shadow-sm hover:bg-gray-100 hover:text-gray-900",onClick:()=>typeof window<"u"&&window.history.length>1?m(-1):m("/services"),children:e.jsx(zs,{className:"h-5 w-5"})}),e.jsxs("div",{className:"flex items-center gap-2",children:[(((O=t.hostProfile)==null?void 0:O.publicId)||(n==null?void 0:n.ownerPublicId))&&e.jsx(X,{variant:"ghost",size:"icon",className:"h-10 w-10 rounded-full bg-white/90 backdrop-blur-sm shadow-sm hover:bg-gray-100 p-0",asChild:!0,children:e.jsx("a",{href:`/u/${((U=t.hostProfile)==null?void 0:U.publicId)||(n==null?void 0:n.ownerPublicId)}`,target:"_blank",rel:"noopener noreferrer",className:"flex items-center justify-center","aria-label":"View service provider profile",children:e.jsx(xt,{src:t.hostAvatar||void 0,alt:"Servicer avatar",className:"h-9 w-9 rounded-full object-cover border border-gray-200",fallback:"/default-profile-icon.png"})})}),e.jsx(X,{variant:"ghost",size:"icon",className:"h-10 w-10 rounded-full bg-white/90 backdrop-blur-sm shadow-sm hover:bg-brand/10 hover:text-brand",onClick:()=>M(!0),children:e.jsx(Dt,{className:"h-5 w-5"})}),g!=null&&e.jsx(X,{variant:"ghost",size:"icon",className:le("h-10 w-10 rounded-full bg-white/90 backdrop-blur-sm shadow-sm hover:bg-red-50 hover:text-red-500",x&&"text-brand"),onClick:g,disabled:h,children:e.jsx(Ot,{className:le("h-5 w-5",x&&"fill-current")})})]})]}),e.jsx("div",{className:"fixed top-0 left-0 right-0 h-[360px] z-0",children:e.jsx(_r,{originalSrc:t.coverImage,variant:"full",alt:t.serviceName,className:"w-full h-full object-cover",loading:"eager"})}),e.jsxs("div",{ref:u,className:"flex-1 overflow-y-auto pb-32 relative z-10",style:{background:"linear-gradient(to bottom, transparent 0, transparent 360px, white 360px)"},children:[e.jsx("div",{className:"h-[360px] relative z-0"}),e.jsxs("div",{className:"bg-white -mt-8 relative z-20 rounded-t-[32px] pt-8",children:[e.jsxs("div",{className:"px-6 pb-6 space-y-3 text-center",children:[e.jsx("h1",{className:"text-2xl font-semibold tracking-tight text-gray-900",children:t.serviceName}),e.jsxs("div",{className:"flex items-center justify-center gap-2 text-sm text-muted-foreground",children:[e.jsx(lt,{className:"h-4 w-4"}),e.jsx("span",{children:t.locationLabel})]}),e.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-2",children:[t.serviceTypeInfo&&e.jsx(ge,{variant:"secondary",className:"rounded-full px-2.5 py-0.5 text-[10px] bg-gray-100 text-gray-700 border-0",children:t.serviceTypeInfo.label}),t.aboutMe.yearsOfExperience&&e.jsxs(ge,{variant:"secondary",className:"rounded-full px-2.5 py-0.5 text-[10px] bg-gray-100 text-gray-700 border-0",children:[t.aboutMe.yearsOfExperience,"+ years"]}),n&&e.jsx(Mn,{badges:Cn(n),maxDisplay:2})]})]}),e.jsx(je,{}),e.jsxs("div",{className:"px-6 py-6 space-y-8",children:[e.jsx("section",{className:"space-y-3 text-center",children:e.jsx("div",{className:"prose prose-sm prose-gray max-w-none text-gray-700 min-w-0 break-words",children:e.jsx(Gt,{remarkPlugins:[Kt],children:t.description})})}),e.jsx(je,{}),e.jsxs("section",{className:"space-y-4 text-center",children:[e.jsxs("div",{className:"flex flex-col items-center gap-3",children:[e.jsx(xt,{src:t.hostAvatar||void 0,alt:t.hostDisplayName,className:"h-20 w-20 rounded-full object-cover ring-2 ring-white shadow-md",fallback:"/default-profile-icon.png"}),e.jsxs("div",{children:[e.jsxs("h3",{className:"text-lg font-semibold text-gray-900",children:["About ",t.hostDisplayName]}),e.jsxs("p",{className:"text-sm text-muted-foreground mt-1",children:[((te=t.serviceTypeInfo)==null?void 0:te.label)||"Service provider"," • ",t.locationLabel]})]})]}),e.jsx(X,{variant:"outline",className:"w-full rounded-full",onClick:v,disabled:L,children:L?e.jsxs("span",{className:"flex items-center justify-center gap-2",children:[e.jsx(rt,{className:"h-4 w-4 animate-spin"}),"Opening..."]}):`Message ${t.hostDisplayName.split(" ")[0]||"Host"}`})]}),e.jsx(je,{}),e.jsxs("section",{className:"space-y-4",children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-900",children:"Photos"}),e.jsx(An,{images:t.galleryImages,videos:t.galleryVideos??[],serviceName:t.serviceName,isMobile:!0})]}),e.jsx(je,{}),E&&((R==null?void 0:R.length)??0)>0&&e.jsxs(e.Fragment,{children:[e.jsx(fr,{menu:E,items:R??[],feeInput:r,onAddToCart:j,menuOrderProgress:F,isMobile:!0,isRequestMode:_,requestModeItems:Q,requestModeSubtotalCents:V,onSubmitMenuRequest:z,onRemoveRequestModeItem:C,taxJurisdictionCollected:ws((B=(G=n.publishedData)==null?void 0:G.location)==null?void 0:B.country,(ae=(K=n.publishedData)==null?void 0:K.location)==null?void 0:ae.state)}),e.jsx(je,{})]}),e.jsx(In,{slots:En(o.discounts)}),e.jsx(Hn,{offerings:s,feeInput:r,onViewDetails:k,onSelectPackage:k,isMobile:!0}),e.jsx(Ln,{metadata:c,offerings:s,feeInput:r}),l!=="chartered_bus"&&e.jsxs(e.Fragment,{children:[e.jsx(je,{}),e.jsxs("section",{id:"availability",className:"space-y-6",children:[e.jsx(yr,{schedule:N,blockedDates:I,selectedDate:p,onDateSelect:A,bookingWindowDays:(D==null?void 0:D.bookingWindowDays)??365,minimumLeadTimeHours:D==null?void 0:D.minimumLeadTimeHours,plannerHighlights:w}),e.jsx(jr,{schedule:N,availability:{bookingWindowDays:(D==null?void 0:D.bookingWindowDays)??365,minimumLeadTimeHours:D==null?void 0:D.minimumLeadTimeHours,acceptsInstantBookings:S},isMobile:!0})]})]}),e.jsx(je,{}),e.jsx(xr,{serviceData:o,serviceType:l,isMobile:!0}),e.jsx(je,{}),e.jsx(Nr,{serviceData:o,effectiveData:i,isMobile:!0}),e.jsx(hr,{isMobile:!0,cancellationPolicy:d,cancellationNotes:a})]})]})]}),wr.createPortal(e.jsxs("div",{className:"fixed bottom-0 left-0 right-0 z-[9999] bg-white border-t border-border/70 p-6 shadow-lg safe-area-inset-bottom",children:[e.jsxs("div",{className:"space-y-2 mb-3",children:[t.pricingRange&&e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"text-lg font-semibold text-gray-900",children:["From ",ie(t.pricingRange.min),t.pricingRange.min!==t.pricingRange.max&&` - ${ie(t.pricingRange.max)}`,t.pricingRange.label&&` ${t.pricingRange.label}`]}),t.minimumBooking&&e.jsxs("div",{className:"text-xs text-muted-foreground",children:["Minimum ",ie(t.minimumBooking)," to book"]})]}),$n(d)&&e.jsxs(ge,{variant:"secondary",className:"rounded-full px-2.5 py-1 text-[10px] bg-green-50 text-green-700 border-green-200",children:[e.jsx(Be,{className:"h-3 w-3 mr-1"}),"Free cancellation"]})]}),!t.pricingRange&&t.minimumBooking&&e.jsxs("div",{className:"text-xs text-muted-foreground",children:["Minimum ",ie(t.minimumBooking)," to book"]})]}),e.jsx("div",{className:"mb-3"}),e.jsx(X,{className:"w-full bg-brand hover:bg-brand-600 text-white rounded-full py-6 text-base font-semibold",onClick:y,children:"Show dates"}),T&&e.jsx("button",{type:"button",onClick:T,className:"w-full text-sm text-center text-brand hover:text-brand-600 underline-offset-4 hover:underline mt-2",children:"Request a custom quote"})]}),document.body)]})},Nr=({serviceData:t,effectiveData:n,isMobile:s})=>{if(!t.serviceArea&&!(n!=null&&n.location))return null;const r=n==null?void 0:n.location,o=t.serviceArea??{},l=o.cityCoords||(r!=null&&r.latitude&&(r!=null&&r.longitude)?{lat:r.latitude,lng:r.longitude}:null),i=o.radiusMiles||o.radius;return e.jsxs(e.Fragment,{children:[e.jsx(co,{cityCoords:l,radiusMiles:i,serviceArea:o,isMobile:s}),s&&e.jsx(je,{})]})},Vo=({vm:t,listing:n,offerings:s,feeInput:r,serviceData:o,serviceType:l,effectiveData:i,metadata:c,cancellationPolicy:d,cancellationNotes:a,stickyCard:f,isPreviewMode:u,user:m,isSaved:x,handleSaveService:h,handleViewPackageDetails:g,handleShowDates:k,handleMessageProvider:y,onRequestCustomQuote:v,createConversationPending:T,setIsShareOpen:L,schedule:M,blockedDates:N,availability:I,acceptsInstantBookings:D,selectedDate:S,onAvailabilityDateSelect:p,plannerCalendarHighlights:A,catererMenu:w,catererMenuItems:E,onMenuItemAddToCart:R,catererMenuOrderProgress:j,isRequestMode:F,requestModeItems:_,requestModeSubtotalCents:Q,onSubmitMenuRequest:V,onRemoveRequestModeItem:z})=>{var C,$,P,O,U,te;return e.jsx("div",{className:"mx-auto w-full max-w-7xl px-6 pb-24 pt-10 md:px-8",children:e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsxs("div",{className:"flex flex-col gap-3 md:flex-row md:items-start md:justify-between",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground min-w-0",children:[e.jsx(lt,{className:"h-4 w-4 flex-shrink-0"}),e.jsx("span",{className:"break-words",children:t.locationLabel})]}),e.jsx("h1",{className:"mt-2 text-3xl font-semibold tracking-tight text-gray-900 md:text-4xl break-words",children:t.serviceName}),e.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:[t.serviceTypeInfo&&e.jsx(ge,{variant:"secondary",className:"rounded-full px-3 py-1 text-xs bg-gray-100 text-gray-700 border-0",children:t.serviceTypeInfo.label}),t.aboutMe.yearsOfExperience&&e.jsxs(ge,{variant:"secondary",className:"rounded-full px-3 py-1 text-xs bg-gray-100 text-gray-700 border-0",children:[t.aboutMe.yearsOfExperience," years experience"]}),n&&e.jsx(Mn,{badges:Cn(n),maxDisplay:3})]})]}),e.jsxs("div",{className:"flex items-center gap-2 flex-wrap justify-start md:justify-end",children:[e.jsxs(X,{variant:"outline",className:"rounded-full px-4",onClick:()=>L(!0),children:[e.jsx(Dt,{className:"mr-2 h-4 w-4"}),"Share"]}),h!=null&&e.jsxs(X,{variant:"outline",className:le("rounded-full px-4",x&&"border-brand text-brand"),onClick:h,children:[e.jsx(Ot,{className:le("mr-2 h-4 w-4",x&&"fill-current")}),x?"Saved":"Save"]})]})]}),e.jsx(An,{images:t.galleryImages,videos:t.galleryVideos,serviceName:t.serviceName,isMobile:!1,onShareClick:()=>L(!0),onSaveClick:h??void 0,isSaved:x}),e.jsxs("div",{className:"flex flex-col gap-10 lg:flex-row",children:[e.jsxs("div",{className:"flex-1 min-w-0 space-y-10",children:[e.jsx("section",{className:"space-y-4 min-w-0 prose prose-gray max-w-none text-base leading-7 text-gray-700 break-words",children:e.jsx(Gt,{remarkPlugins:[Kt],children:t.description})}),w&&((E==null?void 0:E.length)??0)>0&&e.jsx(fr,{menu:w,items:E??[],feeInput:r,onAddToCart:R,menuOrderProgress:j,isMobile:!1,isRequestMode:F,requestModeItems:_,requestModeSubtotalCents:Q,onSubmitMenuRequest:V,onRemoveRequestModeItem:z,taxJurisdictionCollected:ws(($=(C=n.publishedData)==null?void 0:C.location)==null?void 0:$.country,(O=(P=n.publishedData)==null?void 0:P.location)==null?void 0:O.state)}),e.jsx(In,{slots:En(o.discounts)}),e.jsx(Hn,{offerings:s,feeInput:r,onViewDetails:g,onSelectPackage:g,isMobile:!1}),e.jsx(Ln,{metadata:c,offerings:s,feeInput:r}),l!=="chartered_bus"&&e.jsxs("section",{id:"availability",className:"space-y-6",children:[e.jsx(yr,{schedule:M,blockedDates:N,selectedDate:S,onDateSelect:p,bookingWindowDays:(I==null?void 0:I.bookingWindowDays)??365,minimumLeadTimeHours:I==null?void 0:I.minimumLeadTimeHours,plannerHighlights:A}),e.jsx(jr,{schedule:M,availability:{bookingWindowDays:(I==null?void 0:I.bookingWindowDays)??365,minimumLeadTimeHours:I==null?void 0:I.minimumLeadTimeHours,acceptsInstantBookings:D},isMobile:!1})]}),e.jsx(no,{hostDisplayName:t.hostDisplayName,serviceName:t.serviceName,serviceTypeInfo:t.serviceTypeInfo,hostAvatar:t.hostAvatar,hostPublicId:((U=t.hostProfile)==null?void 0:U.publicId)??(n==null?void 0:n.ownerPublicId),onMessageClick:y,aboutMe:t.aboutMe,serviceType:l,serviceData:o,isMobile:!1}),e.jsx(xr,{serviceData:o,serviceType:l,isMobile:!1}),e.jsx(Nr,{serviceData:o,effectiveData:i,isMobile:!1}),e.jsx(hr,{isMobile:!1,cancellationPolicy:d,cancellationNotes:a})]}),e.jsx("aside",{className:"w-full lg:w-[360px] xl:w-[400px] lg:flex-shrink-0",children:e.jsxs("div",{ref:f.stickyCardRef,className:le("sticky top-24 space-y-6",f.stickyCardPosition&&"!fixed"),style:f.stickyCardPosition?{top:`${f.stickyCardPosition.top}px`,width:`${f.stickyCardPosition.width}px`,zIndex:40}:void 0,children:[e.jsx(xo,{hostDisplayName:t.hostDisplayName,serviceName:t.serviceName,serviceTypeInfo:t.serviceTypeInfo,locationLabel:t.locationLabel,hostAvatar:t.hostAvatar,hostPublicId:((te=t.hostProfile)==null?void 0:te.publicId)??(n==null?void 0:n.ownerPublicId),aboutMe:t.aboutMe,tagline:t.tagline&&t.tagline!==t.description?t.tagline:null,isSaved:x,isMessaging:T,onShareClick:()=>L(!0),onSaveClick:h??void 0,onMessageClick:y}),e.jsx(mo,{pricingRange:t.pricingRange,minimumBooking:t.minimumBooking,onShowDates:k,cancellationPolicy:d,disabled:u||!Bi(n==null?void 0:n.status)||!!(m!=null&&m.publicId&&(n==null?void 0:n.ownerPublicId)===m.publicId),disabledMessage:m!=null&&m.publicId&&(n==null?void 0:n.ownerPublicId)===m.publicId?"You cannot book your own listing.":"Publish this listing to accept bookings.",onRequestCustomQuote:v})]})})]})]})})},St=t=>`${t.menuItemId}|${(t.selectedChoices??[]).map(n=>`${n.optionId}:${n.choiceId}`).sort().join(",")}`;function xn(t,n){const s={menuItemId:n.item.itemId,quantity:n.quantity,selectedChoices:n.selectedChoices},r=St(s);return t.some(l=>St(l)===r)?t.map(l=>St(l)===r?{...l,quantity:(l.quantity??0)+n.quantity}:l):[...t,s]}function Go(t,n){var r;if(!t)return 0;let s=t.price;for(const o of n??[]){const l=(r=t.options)==null?void 0:r.find(c=>c.optionId===o.optionId),i=l==null?void 0:l.choices.find(c=>c.choiceId===o.choiceId);i&&(s+=i.priceDelta)}return s}function ds(t,n){let s=0;for(const r of t){const o=Go(n.get(r.menuItemId),r.selectedChoices);s+=o*(r.quantity??0)}return s}function hn(t,n){const s=typeof n=="number"&&n>0?n:0,r=Math.max(0,s-t);return{currentCents:t,minCents:s,remainingCents:r,met:s===0||t>=s,hasMinimum:s>0}}function Uo({listing:t,catererMenu:n,catererMenuItems:s,serviceName:r,coverImage:o,feeInput:l,acceptsInstantBookings:i,onRequestMenuBooking:c,toast:d}){const[a,f]=b.useState(null),[u,m]=b.useState(!1),[x,h]=b.useState(!1),[g,k]=b.useState([]),[y,v]=b.useState([]),[T,L]=b.useState(null),{startCheckout:M}=qn(),N=b.useMemo(()=>{const j=new Map;for(const F of s)j.set(F.itemId,F);return j},[s]),I=b.useMemo(()=>{const j=ds(y,N);return hn(j,n==null?void 0:n.minOrderAmount)},[y,N,n==null?void 0:n.minOrderAmount]),D=b.useMemo(()=>ds(g,N),[g,N]),S=b.useCallback((j,F)=>{if(!t)return;const _=xn(y,F);v(_),L(j);const Q=Bn(new Date(j.endTime),new Date(j.startTime)),V=Number((Q/60).toFixed(2)),z=ds(_,N),C=hn(z,n==null?void 0:n.minOrderAmount);if(C.hasMinimum&&!C.met){const O=it(C.remainingCents,l),U=it(C.minCents,l);d({title:`Added ${F.quantity} × ${F.item.name}`,description:`Add ${O} more to reach the ${U} minimum.`});return}const $=Ct(z,l),P={listingId:t.listingId,listingTitle:r,listingKind:"service",startTime:j.startTime,endTime:j.endTime,hours:V,guestCount:j.guestCount,imageUrl:o,location:j.eventLocation.formattedAddress,latitude:j.eventLocation.lat,longitude:j.eventLocation.lng,eventLocation:j.eventLocation,selectedMenuItems:_,selectionMode:"menu",subtotal:$,total:$,taxStatus:"calculated_at_checkout"};d({title:`Added ${F.quantity} × ${F.item.name}`,description:"Continuing to checkout."}),M(P)},[t,y,r,o,n,l,N,d,M]),p=b.useCallback(async j=>{if(t){if(!i){k(F=>xn(F,j)),d({title:`${j.quantity} × ${j.item.name} added`,description:"Review your selections and submit your request when ready."});return}if(T){S(T,j);return}f(j),h(!0)}},[i,T,t,S,d]),A=b.useCallback(()=>{g.length!==0&&h(!0)},[g.length]),w=b.useCallback((j,F)=>{const _=St({menuItemId:j,selectedChoices:F});k(Q=>Q.filter(V=>St(V)!==_))},[]),E=b.useCallback(async j=>{if(!i&&g.length===0)return;const F=a;if(i&&!F)return;if(!ot(j.eventLocation)){d({title:"Event address required",description:"Choose a full address from the suggestions so we can confirm the service location.",variant:"destructive"});return}if(!j.startTime||!j.endTime||j.startTime===j.endTime){d({title:"Invalid duration",description:"Please pick a start and end time.",variant:"destructive"});return}const _=et(j.dateYmd,j.startTime,j.endTime),Q={startTime:_.startDateTime,endTime:_.endDateTime,guestCount:j.guestCount,eventLocation:j.eventLocation};if(h(!1),!i){const V=g;k([]),m(!0);try{await c({shell:Q,items:V})}finally{m(!1)}return}f(null),F&&S(Q,F)},[i,c,a,g,S,d]),R=b.useCallback(()=>{f(null),h(!1)},[]);return{isOrderDetailsOpen:x,setOrderDetailsOpen:h,isSubmitting:u,menuOrderProgress:I,isRequestMode:!i,requestModeItems:g,requestModeSubtotalCents:D,handleSubmitMenuRequest:A,removeRequestModeItem:w,handleMenuItemAddToCart:p,confirmOrderDetails:E,pendingAdd:a,cancelPendingAdd:R}}function Wo({listing:t,serviceName:n,coverImage:s,user:r,toast:o,onSuccess:l}){const i=js(),c=Qt(),[d,a]=b.useState(!1),f=b.useCallback(async({shell:m,items:x})=>{var L,M;if(!r){const N=`${c.pathname}${c.search}`;Bt(c.pathname)?Ht(N):i("/auth?returnTo="+encodeURIComponent(N));return}if(!t){o({title:"Error",description:"Listing information is not available.",variant:"destructive"});return}const h=Bn(new Date(m.endTime),new Date(m.startTime)),g=Number((h/60).toFixed(2)),[k,y]=m.startTime.split("T"),v=(y==null?void 0:y.slice(0,5))??"",T={listingId:t.listingId,type:"service",listingTitle:n,startTime:m.startTime,endTime:m.endTime,guestCount:m.guestCount,hours:g,imageUrl:s,price:0,selectedMenuItems:x};try{const I=((M=(L=(await us()).tokens)==null?void 0:L.idToken)==null?void 0:M.toString())??"",D={items:[T],date:k,time:v,duration:g,startTime:m.startTime,endTime:m.endTime,eventLocation:m.eventLocation},p=await(await fetch(ht("/bookings/create"),{method:"POST",headers:{"Content-Type":"application/json",Authorization:I?`Bearer ${I}`:""},credentials:"include",body:JSON.stringify(D)})).json();if(p.mode==="approval_required"){if(p.isIdempotent){o({title:"Request already submitted",description:"You already have a pending request for this date and time. Manage it from your bookings."}),i("/bookings");return}a(!0),l==null||l()}else o({title:"Error",description:p.message??p.error??"Unexpected response from server.",variant:"destructive"})}catch(N){const I=N instanceof Error?N.message:"Failed to submit booking request. Please try again.";o({title:"Error",description:I,variant:"destructive"})}},[t,n,s,r,o,l,i,c]),u=b.useCallback(()=>{a(!1)},[]);return{submitMenuRequest:f,showRequestSubmitted:d,dismissRequestSubmitted:u}}const Yo=({open:t,onOpenChange:n,isMobile:s=!1,isSubmitting:r=!1,defaultDate:o=null,defaultStartTime:l="",defaultEndTime:i="",defaultGuestCount:c=0,defaultEventLocation:d=null,schedule:a,datePickerMinDate:f,datePickerMaxDate:u,serviceDatePickerDisabled:m,minGuests:x,onConfirm:h})=>{const[g,k]=b.useState(o),[y,v]=b.useState(l),[T,L]=b.useState(i),[M,N]=b.useState(c),[I,D]=b.useState(d),[S,p]=b.useState(null);b.useEffect(()=>{t&&(k(o),v(l),L(i),N(c),D(d),p(null))},[t,o,l,i,c,d]);const A=b.useMemo(()=>!g||a.length===0?!1:!Xt(g,a),[g,a]),w=!!g&&!A&&!!y&&!!T&&y!==T&&M>=1&&ot(I),E=async()=>{if(!g){p("Pick an event date.");return}if(A){p("This caterer is not available on the selected day.");return}if(!y||!T||y===T){p("Pick a start and end time.");return}const F=Ts(y,T,g,a);if(F){p(F);return}if(M<1){p("Enter the number of guests.");return}if(x&&M<x){p(`This caterer requires at least ${x} guests.`);return}if(!ot(I)){p("Choose a full address from the suggestions.");return}p(null),await h({dateYmd:xe(g,"yyyy-MM-dd"),startTime:y,endTime:T,guestCount:M,eventLocation:I})},R=e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(Ne,{className:"text-sm font-semibold",children:"Event date"}),e.jsx(xs,{value:g,onChange:k,minDate:f,maxDate:u,disabledDates:m})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(Ne,{className:"text-sm font-semibold",children:"Start time"}),e.jsx(hs,{value:y,onChange:v})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Ne,{className:"text-sm font-semibold",children:"End time"}),e.jsx(hs,{value:T,onChange:L})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Ne,{className:"text-sm font-semibold",children:"Guests"}),e.jsx(Jt,{type:"number",inputMode:"numeric",min:1,value:M>0?M:"",onChange:F=>{const _=parseInt(F.target.value,10);N(Number.isFinite(_)&&_>0?_:0)},placeholder:"Number of guests"}),x?e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Caterer minimum: ",x," guests."]}):null]}),e.jsx("div",{className:"space-y-2",children:e.jsx(ys,{label:"Event address",eventLocation:I,onEventLocationChange:D})}),S&&e.jsx("p",{className:"text-sm text-destructive",role:"alert",children:S})]}),j=e.jsxs("div",{className:"flex w-full items-center justify-end gap-2",children:[e.jsx(X,{type:"button",variant:"ghost",onClick:()=>n(!1),disabled:r,children:"Cancel"}),e.jsx(X,{type:"button",onClick:E,disabled:!w||r,className:"rounded-full px-5",children:r?"Adding…":"Continue"})]});return s?e.jsx(pn,{open:t,onOpenChange:n,children:e.jsxs(gn,{className:"max-h-[92vh]",children:[e.jsxs(bn,{className:"text-left",children:[e.jsx(yn,{children:"Order details"}),e.jsx(jn,{children:"Confirm event date, time, guests, and address before adding menu items to your cart."})]}),e.jsx("div",{className:"px-4 overflow-y-auto",children:R}),e.jsx(Nn,{children:j})]})}):e.jsx(Ke,{open:t,onOpenChange:n,children:e.jsxs(Qe,{className:"max-h-[90vh] overflow-y-auto sm:max-w-md",children:[e.jsxs(Ze,{children:[e.jsx(Je,{children:"Order details"}),e.jsx(Xe,{children:"Confirm event date, time, guests, and address before adding menu items to your cart."})]}),R,e.jsx(vn,{children:j})]})})},Qc=()=>{var ne,oe,he,Ce,Ue,bt,yt,jt,Ee,dt,Nt,vt,wt,Ls,Rs;const{id:t}=kr(),n=Qt(),s=js(),r=zr(),{toast:o}=Vr(),{user:l}=Br(),i=vs(),c=Hr(),d=ko(t),{listing:a,isLoading:f,error:u,effectiveData:m,serviceData:x,offerings:h,metadata:g,hostProfileData:k,acceptsInstantBookings:y,schedule:v,blockedDates:T,cancellationPolicy:L,cancellationNotes:M,isPreviewMode:N,serviceType:I}=d,D=ci(g.pricing),S=So({listing:a,effectiveData:m,serviceData:x,offerings:h,hostProfileData:k,metadata:g,serviceType:I}),p=Se.useMemo(()=>Tn(a,m),[m,a]),A=Se.useMemo(()=>{var ue;return(((ue=x==null?void 0:x.busOperatorData)==null?void 0:ue.vehicleClasses)??[]).filter(fe=>{var We;return(((We=fe.perMile)==null?void 0:We.ratePerMile)??0)>0}).map(fe=>{var We,Fs,Ds,Os;return{id:fe.id,displayName:fe.displayName,seatedCapacity:fe.seatedCapacity,perMile:{ratePerMile:((We=fe.perMile)==null?void 0:We.ratePerMile)??0,minMiles:(Fs=fe.perMile)==null?void 0:Fs.minMiles,maxMiles:(Ds=fe.perMile)==null?void 0:Ds.maxMiles,minimumFare:(Os=fe.perMile)==null?void 0:Os.minimumFare}}})},[(ne=x==null?void 0:x.busOperatorData)==null?void 0:ne.vehicleClasses]),w=A.length>0,[E,R]=b.useState(null),j=Ro({offerings:h,schedule:v,blockedDates:T,bookingWindowDays:typeof((oe=d.availability)==null?void 0:oe.bookingWindowDays)=="number"?d.availability.bookingWindowDays:void 0,minimumLeadTimeHours:typeof((he=d.availability)==null?void 0:he.minimumLeadTimeHours)=="number"?d.availability.minimumLeadTimeHours:void 0,cartItems:[],acceptsInstantBookings:y}),F=Ao({listing:a,selectedBookingPackage:j.selectedBookingPackage,selectedDate:j.selectedDate,startTime:j.startTime,endTime:j.endTime,guestCount:j.guestCount,selectedAddOns:j.selectedAddOns}),_=Se.useMemo(()=>{if(F.previewState.status!=="success")return null;const{subtotal:Y,serviceFee:ue,total:fe}=F.previewState;return{subtotal:typeof fe=="number"&&typeof ue=="number"?Math.round((fe-ue)*100)/100:Y,serviceFee:ue,total:fe}},[F.previewState]),Q=Se.useMemo(()=>{if(!w||!E)return null;const Y=j.serviceEventLocation,ue=Y!=null&&Y.formattedAddress?{label:Y.formattedAddress,...typeof Y.lat=="number"?{lat:Y.lat}:{},...typeof Y.lng=="number"?{lng:Y.lng}:{}}:void 0;return{miles:E.miles,tripType:E.tripType,vehicleClassId:E.vehicleClassId,...ue?{destination:ue}:{}}},[w,E,j.serviceEventLocation]),V=Do({listing:a,selectedBookingPackage:j.selectedBookingPackage,selectedDate:j.selectedDate,startTime:j.startTime,endTime:j.endTime,guestCount:j.guestCount,calculatedHours:F.calculatedHours,serviceName:S.serviceName,coverImage:S.coverImage,schedule:v,toast:o,selectedAddOns:j.selectedAddOns,serviceEventLocation:j.serviceEventLocation,authoritativePricing:_,charter:Q,setIsBookingFlowOpen:j.setIsBookingFlowOpen,resetBookingState:j.resetBookingState}),z=Fo({listing:a,selectedBookingPackage:j.selectedBookingPackage,selectedDate:j.selectedDate,startTime:j.startTime,endTime:j.endTime,guestCount:j.guestCount,calculatedHours:F.calculatedHours,calculatedPrice:F.calculatedPrice,serviceName:S.serviceName,coverImage:S.coverImage,schedule:v,selectedAddOns:j.selectedAddOns,serviceEventLocation:j.serviceEventLocation,charter:Q,user:l,toast:o,onSuccess:()=>{j.setIsBookingFlowOpen(!1),j.resetBookingState(),r.invalidateQueries({queryKey:["guestBookings"]})}}),[C,$]=b.useState(!1),[P,O]=b.useState(!1),U=((Ue=(Ce=m==null?void 0:m.metadata)==null?void 0:Ce.pricing)==null?void 0:Ue.allowCustomQuotes)!==!1&&h.length>0&&!(l!=null&&l.publicId&&(a==null?void 0:a.ownerPublicId)===l.publicId),te=b.useCallback(()=>{if(!l){const Y=`${n.pathname}${n.search}`;Bt(n.pathname)?Ht(Y):s("/auth?returnTo="+encodeURIComponent(Y));return}O(!0)},[l,n,s]),[G,B]=b.useState(null),[K,ae]=b.useState(!1),[pe,de]=b.useState(!1),we=Oo({isMobile:i,isDialogOpen:K||j.isBookingFlowOpen||C||pe}),[Fe,De]=b.useState(!1),[ct,Oe]=b.useState(!1),Ve=b.useCallback(async()=>{if(!(a!=null&&a.listingId)||!l){De(!1);return}try{const Y=await Qr(a.listingId);De(Y.length>0)}catch{De(!1)}},[a==null?void 0:a.listingId,l]);Se.useEffect(()=>{Ve()},[Ve]);const Pe=b.useCallback(()=>{if(a!=null&&a.listingId){if(!l){const Y=`${n.pathname}${n.search}`;Bt(n.pathname)?Ht(Y):s("/auth?returnTo="+encodeURIComponent(Y));return}Oe(!0)}},[a==null?void 0:a.listingId,l,n,s]),tt=b.useCallback(()=>{var ue,fe;if(!a)return;const Y=new URLSearchParams({listing:a.listingId});j.selectedDate&&Y.set("date",xe(j.selectedDate,"yyyy-MM-dd")),j.startTime&&Y.set("start",j.startTime),j.endTime&&Y.set("end",j.endTime),j.guestCount>0&&Y.set("guests",String(j.guestCount)),(ue=j.selectedBookingPackage)!=null&&ue.id&&Y.set("offeringId",j.selectedBookingPackage.id),(fe=j.selectedBookingPackage)!=null&&fe.name&&Y.set("offeringName",j.selectedBookingPackage.name),s(`/send_message?${Y.toString()}`)},[a,j.selectedDate,j.startTime,j.endTime,j.guestCount,j.selectedBookingPackage,s]),me=x.catererMenu,ve=Se.useMemo(()=>{var Y,ue;return!me||!a||!((Y=me.categories)!=null&&Y.length)||!((ue=me.items)!=null&&ue.length)?null:{menuId:me.menuId??`menu_${a.listingId}`,listingId:a.listingId,name:me.name||"Catering Menu",description:me.description,categories:me.categories,minOrderAmount:me.minOrderAmount,minGuests:me.minGuests,leadTimeHours:me.leadTimeHours,cuisineType:me.cuisineType,status:"active"}},[me,a]),Ge=Se.useMemo(()=>(me==null?void 0:me.items)??[],[me]),ke=ve!=null&&Ge.length>0,$e=Ni(!N&&I==="caterer"?a==null?void 0:a.listingId:void 0),qe=vi(N&&I==="caterer"&&!ke?a==null?void 0:a.listingId:void 0),Ie=Se.useMemo(()=>!qe.data||qe.data.length===0?null:[...qe.data].filter(Y=>Y.status!=="archived").sort((Y,ue)=>{const fe=Y.status==="draft"?0:Y.status==="active"?1:2,We=ue.status==="draft"?0:ue.status==="active"?1:2;return fe-We||(Y.sortOrder??0)-(ue.sortOrder??0)||(ue.updatedAt??"").localeCompare(Y.updatedAt??"")})[0]??null,[qe.data]),H=wi(N&&I==="caterer"&&!ke?Ie==null?void 0:Ie.menuId:void 0),q=Se.useMemo(()=>{var Y;return N?ke?ve:Ie:((Y=$e.data)==null?void 0:Y.menu)??ve},[ke,ve,N,Ie,(bt=$e.data)==null?void 0:bt.menu]),Z=Se.useMemo(()=>{var Y;return N?ke?Ge:H.data??[]:((Y=$e.data)==null?void 0:Y.items)??Ge},[ke,Ge,N,H.data,(yt=$e.data)==null?void 0:yt.items]),se=b.useCallback(Y=>{B(Y),ae(!0)},[]),J=b.useCallback(()=>{if(h.length>0){de(!0);return}j.setIsBookingFlowOpen(!0)},[j,h.length]),be=Wo({listing:a,serviceName:S.serviceName,coverImage:S.coverImage,user:l,toast:o}),re=Uo({listing:a,catererMenu:q,catererMenuItems:Z,serviceName:S.serviceName,coverImage:S.coverImage,feeInput:p,acceptsInstantBookings:y,onRequestMenuBooking:be.submitMenuRequest,toast:o}),ye=j.selectedDate?xe(j.selectedDate,"yyyy-MM-dd"):null,_e=b.useCallback(Y=>{try{const ue=new Date(Y+"T12:00:00");Number.isNaN(ue.getTime())||j.setSelectedDate(ue)}catch{}J()},[j,J]),ze=(jt=m==null?void 0:m.location)==null?void 0:jt.city,Ae=S.serviceName?ze?`${S.serviceName} · ${ze} | PLEC`:`${S.serviceName} | PLEC`:"PLEC",W=S.description&&S.description!=="No description available."?S.description.slice(0,155).trimEnd()+(S.description.length>155?"…":""):`Book ${S.serviceName??"this service"} on PLEC.`;if(Ui({title:S.serviceName?Ae:void 0,description:W,image:(Ee=S.galleryImages)==null?void 0:Ee[0],canonical:`https://plec-it.com${n.pathname}`,type:"website"}),f)return e.jsx(ts,{showSearch:!0,showFooter:!0,children:i?e.jsx(Ko,{}):e.jsx(Qo,{})});if(u||!a){const Y=u==null?void 0:u.includes("not a service");return e.jsx(ts,{showSearch:!0,showFooter:!0,children:e.jsxs("div",{className:"mx-auto flex max-w-3xl flex-col items-center gap-6 px-6 py-24 text-center",children:[e.jsx(Ns,{className:"h-12 w-12 text-gray-400"}),e.jsx("h1",{className:"text-3xl font-semibold text-gray-900",children:Y?"Invalid Listing Type":"We couldn't load that service"}),e.jsx("p",{className:"text-sm text-gray-600",children:u||"It may have been unpublished, removed, or the link is incorrect."}),e.jsx(X,{asChild:!0,className:"rounded-full px-6",children:e.jsx("a",{href:Y?"/venues":"/services",children:Y?"Browse Venues":"Back to services"})})]})})}return e.jsxs(ts,{showSearch:!0,showFooter:!0,children:[N&&e.jsx("div",{className:"bg-amber-50 border-b border-amber-200 px-4 py-3 text-center",children:e.jsxs("p",{className:"text-sm text-amber-800",children:[e.jsx("span",{className:"font-semibold",children:"Preview Mode:"})," This is a draft listing preview."]})}),l&&(a==null?void 0:a.hostCancellationWarning)&&e.jsx("div",{className:"bg-yellow-50 border-b border-yellow-200 px-4 py-3 text-center",children:e.jsx("p",{className:"text-sm text-yellow-800",children:"⚠️ This host has a history of last-minute cancellations."})}),i?e.jsx(Ho,{vm:S,listing:a,offerings:h,feeInput:p,serviceData:x,serviceType:I,effectiveData:m,metadata:g,cancellationPolicy:L,cancellationNotes:M,isScrolled:we.isScrolled,scrollContainerRef:we.scrollContainerRef,navigate:s,isSaved:Fe,savingService:!1,handleSaveService:a.status==="published"?Pe:void 0,handleViewPackageDetails:se,handleShowDates:J,handleMessageProvider:tt,onRequestCustomQuote:U?te:void 0,createConversationPending:c.isPending,setIsShareOpen:$,schedule:v,blockedDates:T,availability:d.availability,acceptsInstantBookings:y,selectedDate:ye,onAvailabilityDateSelect:_e,plannerCalendarHighlights:j.plannerCalendarHighlights,catererMenu:q,catererMenuItems:Z,onMenuItemAddToCart:re.handleMenuItemAddToCart,catererMenuOrderProgress:re.menuOrderProgress,isRequestMode:re.isRequestMode,requestModeItems:re.requestModeItems,requestModeSubtotalCents:re.requestModeSubtotalCents,onSubmitMenuRequest:re.handleSubmitMenuRequest,onRemoveRequestModeItem:re.removeRequestModeItem}):e.jsx(Vo,{vm:S,listing:a,offerings:h,feeInput:p,serviceData:x,serviceType:I,effectiveData:m,metadata:g,cancellationPolicy:L,cancellationNotes:M,stickyCard:we,isPreviewMode:N,user:l,isSaved:Fe,handleSaveService:a.status==="published"?Pe:void 0,handleViewPackageDetails:se,handleShowDates:J,handleMessageProvider:tt,onRequestCustomQuote:U?te:void 0,createConversationPending:c.isPending,setIsShareOpen:$,schedule:v,blockedDates:T,availability:d.availability,acceptsInstantBookings:y,selectedDate:ye,onAvailabilityDateSelect:_e,plannerCalendarHighlights:j.plannerCalendarHighlights,catererMenu:q,catererMenuItems:Z,onMenuItemAddToCart:re.handleMenuItemAddToCart,catererMenuOrderProgress:re.menuOrderProgress,isRequestMode:re.isRequestMode,requestModeItems:re.requestModeItems,requestModeSubtotalCents:re.requestModeSubtotalCents,onSubmitMenuRequest:re.handleSubmitMenuRequest,onRemoveRequestModeItem:re.removeRequestModeItem}),a&&e.jsx(di,{open:P,onClose:()=>O(!1),listingId:a.listingId,defaultEventDate:j.selectedDate?xe(j.selectedDate,"yyyy-MM-dd"):void 0,defaultGuestCount:j.guestCount>0?j.guestCount:void 0,defaultStartTime:j.startTime||void 0,defaultEndTime:j.endTime||void 0}),e.jsx(Gr,{open:ct,onOpenChange:Oe,listingId:(a==null?void 0:a.listingId)??"",listingTitle:(S==null?void 0:S.serviceName)??(x==null?void 0:x.cardTitle),listingImageUrl:(x==null?void 0:x.coverImage)??((dt=h==null?void 0:h[0])==null?void 0:dt.image),onSavedChange:()=>{Ve(),window.dispatchEvent(new CustomEvent("savedVenuesChanged"))}}),e.jsx(_o,{isMobile:i,addOns:D,feeInput:p,selectedPackage:G,isPackageDetailOpen:K,setIsPackageDetailOpen:ae,offerings:h,isPackageSelectionOpen:pe,setIsPackageSelectionOpen:de,bookingFlow:j,pricing:F,cartActions:V,bookingRequest:z,acceptsInstantBookings:y,cartLoading:!1,isShareOpen:C,setIsShareOpen:$,onViewPackageDetails:se,handleMessageProvider:tt,navigate:s,toast:o,charterVehicles:w?A:void 0,charterEstimatedMiles:((Nt=A[0])==null?void 0:Nt.perMile.minMiles)??0,onCharterChange:R,taxJurisdictionCollected:ws((wt=(vt=a==null?void 0:a.publishedData)==null?void 0:vt.location)==null?void 0:wt.country,(Rs=(Ls=a==null?void 0:a.publishedData)==null?void 0:Ls.location)==null?void 0:Rs.state)}),e.jsx(Yo,{open:re.isOrderDetailsOpen,onOpenChange:Y=>{Y?re.setOrderDetailsOpen(!0):re.cancelPendingAdd()},isMobile:i,isSubmitting:re.isSubmitting,defaultDate:j.selectedDate,defaultStartTime:j.startTime,defaultEndTime:j.endTime,defaultGuestCount:j.guestCount,defaultEventLocation:j.serviceEventLocation,schedule:v,datePickerMinDate:j.datePickerMinDate,datePickerMaxDate:j.datePickerMaxDate,serviceDatePickerDisabled:j.serviceDatePickerDisabled,minGuests:q==null?void 0:q.minGuests,onConfirm:re.confirmOrderDetails}),e.jsx(_n,{isOpen:be.showRequestSubmitted,onClose:be.dismissRequestSubmitted})]})},Ko=()=>e.jsxs("div",{className:"flex flex-col min-h-screen",children:[e.jsx(ee,{className:"h-[360px] w-full rounded-none shrink-0"}),e.jsxs("div",{className:"bg-card -mt-8 relative z-10 rounded-t-[32px] pt-8 flex-1",children:[e.jsxs("div",{className:"px-6 pb-6 space-y-3 text-center",children:[e.jsx(ee,{className:"h-8 w-3/4 mx-auto"}),e.jsx(ee,{className:"h-4 w-32 mx-auto"}),e.jsxs("div",{className:"flex justify-center gap-2",children:[e.jsx(ee,{className:"h-6 w-16 rounded-full"}),e.jsx(ee,{className:"h-6 w-20 rounded-full"}),e.jsx(ee,{className:"h-6 w-12 rounded-full"})]})]}),e.jsxs("div",{className:"px-6 pb-8 space-y-6",children:[e.jsx(ee,{className:"h-4 w-full"}),e.jsx(ee,{className:"h-4 w-full"}),e.jsx(ee,{className:"h-7 w-28"}),e.jsx("div",{className:"space-y-3",children:[1,2].map(t=>e.jsx(ee,{className:"h-20 w-full rounded-2xl"},t))}),e.jsx(ee,{className:"h-7 w-36"}),e.jsxs("div",{className:"flex gap-4 items-center",children:[e.jsx(ee,{className:"h-14 w-14 rounded-full shrink-0"}),e.jsxs("div",{className:"flex-1 space-y-2",children:[e.jsx(ee,{className:"h-5 w-28"}),e.jsx(ee,{className:"h-4 w-full"})]})]})]})]}),e.jsx("div",{className:"fixed bottom-0 left-0 right-0 z-40 bg-card border-t p-4",children:e.jsx(ee,{className:"h-12 w-full rounded-full"})})]}),Qo=()=>e.jsxs("div",{className:"mx-auto w-full max-w-7xl px-6 pb-24 pt-10 md:px-8",children:[e.jsx(ee,{className:"h-[22rem] w-full rounded-2xl mb-10"}),e.jsxs("div",{className:"flex flex-col gap-10 lg:flex-row",children:[e.jsxs("div",{className:"flex-1 min-w-0 space-y-10",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx(ee,{className:"h-4 w-28 mb-2"}),e.jsx(ee,{className:"h-10 w-2/5 mt-2"}),e.jsxs("div",{className:"flex gap-2 mt-3",children:[e.jsx(ee,{className:"h-7 w-24 rounded-full"}),e.jsx(ee,{className:"h-7 w-28 rounded-full"}),e.jsx(ee,{className:"h-7 w-16 rounded-full"})]})]}),e.jsxs("section",{className:"space-y-4",children:[e.jsx(ee,{className:"h-4 w-full"}),e.jsx(ee,{className:"h-4 w-full max-w-[85%]"})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(ee,{className:"h-7 w-48"}),[1,2,3].map(t=>e.jsx(ee,{className:"h-28 w-full rounded-2xl"},t))]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx(ee,{className:"h-7 w-44"}),e.jsxs("div",{className:"flex gap-4",children:[e.jsx(ee,{className:"h-20 w-20 rounded-full shrink-0"}),e.jsxs("div",{className:"flex-1 space-y-2",children:[e.jsx(ee,{className:"h-5 w-32"}),e.jsx(ee,{className:"h-4 w-full"})]})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(ee,{className:"h-7 w-36"}),e.jsx(ee,{className:"h-[280px] w-full rounded-2xl"})]})]}),e.jsx("aside",{className:"w-full lg:w-[360px] xl:w-[400px] lg:flex-shrink-0",children:e.jsx("div",{className:"sticky top-24 space-y-6",children:e.jsxs("div",{className:"rounded-[32px] border border-border/70 p-6 shadow-xl space-y-4",children:[e.jsx(ee,{className:"h-16 w-16 rounded-full mx-auto"}),e.jsx(ee,{className:"h-5 w-28 mx-auto"}),e.jsx(ee,{className:"h-4 w-40 mx-auto"}),e.jsxs("div",{className:"flex justify-center gap-2 pt-2",children:[e.jsx(ee,{className:"h-8 w-8 rounded-full"}),e.jsx(ee,{className:"h-8 w-8 rounded-full"}),e.jsx(ee,{className:"h-8 w-8 rounded-full"})]}),e.jsx(ee,{className:"h-px w-full"}),e.jsx(ee,{className:"h-12 w-full rounded-full"}),e.jsx(ee,{className:"h-10 w-full rounded-full"})]})})})]})]});export{Qc as default};