PageSourceSearch

https://www.hmix.ai/assets/LoungePublic-BXLIz7Up.js

js hmix.ai collected 2026-10-05 14:35:40 UTC 105,834 bytes, 27 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/pannellum-CN2-yKHH.css"])))=>i.map(i=>d[i]);
2import{a as n,j as e,_ as sa}from"./chunk-three-BTWAGdoL.js";import{b as xr,L as Nt}from"./chunk-router-DABpbG10.js";import{u as hr,a as Z,b as ms}from"./chunk-query-NCR7N3-H.js";import{v as ur,w as gr,x as pr,y as fr,n as C,B as h,i as F,I as D,o as ee,p as te,q as W,r as J,t as le,s as Ie,M as br,z as vr}from"./index-CmZofxmK.js";import{S as jr}from"./slider-C1Iv1xcn.js";import{S as aa}from"./switch-Bl7c15gA.js";import{A as Nr}from"./ARMenuPreview-B68aADlt.js";import{s as ra}from"./smoke-texture-8qz3CDOq.js";import{p as j,au as wt,f as $e,n as be,t as Y,aw as oe,ax as na,aa as Qe,U as Xe,M as ia,ay as yt,aq as xs,P as Ft,e as wr,C as yr,b as E,as as hs,r as us,X as et,az as Fr,aA as Ar,aB as gs,ab as kr,aC as Cr,a3 as la,ah as Dr,ai as Sr,N as Ee,ad as oa,ao as Pr,aD as Mr,q as ca,am as da,aE as ma,o as Ir,A as $r,y as Er,ak as Tr,J as Or,av as Lr}from"./chunk-icons-CmzO8GHu.js";import"./chunk-uppy-Ddo71Xia.js";import"./chunk-charts-D8AvoNRl.js";import"./chunk-utils-CL3reoUV.js";import"./chunk-maps-ByCLyVpA.js";import"./chunk-radix-CYYWsbOs.js";import"./CallServerButton-B9MWVGX3.js";const xa={traditional_hookah_cafe:"Traditional Hookah Cafe",modern_hookah_lounge:"Modern Hookah Lounge",hookah_bar_nightclub:"Hookah Bar & Nightclub Hybrid",hookah_restaurant:"Hookah Restaurant"},ha={premium_tobacco:"Premium Tobacco",dark_leaf:"Dark Leaf Specialty",herbal_nicotine_free:"Herbal - Nicotine Free",custom_mix_craft:"Custom Mix Craft",hookah_cigar:"Hookah + Cigar",hookah_full_bar:"Hookah + Full Bar"};async function ua(m,V){const se=await fetch(m,{...V,headers:{"Content-Type":"application/json",...V?.headers}});if(!se.ok){const o=await se.json().catch(()=>({message:"Request failed"}));throw new Error(o.message||`HTTP ${se.status}`)}return se.json()}const At="hookah_lounge_customer_id",Ze="hookah_lounge_customer_name";function Rr({vrTours:m,vrActiveIndex:V,setVrActiveIndex:se,vrViewerRef:o,vrContainerRef:ce,onClose:tt}){const _=m[V],de=!!_?.imageUrl;return n.useEffect(()=>{if(!de||!ce.current)return;const x=ce.current;return(async()=>{if(window.pannellum||(await sa(()=>Promise.resolve({}),__vite__mapDeps([0])),await sa(()=>import("./chunk-panorama-DpHmzOs_.js"),[])),o.current){try{o.current.destroy()}catch(M){console.warn("Suppressed error:",M)}o.current=null}const B=m.filter(M=>!!M.imageUrl),G={};B.forEach((M,T)=>{const H=M.imageUrl.startsWith("http")?`/api/image-proxy?url=${encodeURIComponent(M.imageUrl)}`:M.imageUrl;G[`scene_${T}`]={title:M.areaLabel||M.title,panorama:H,yaw:M.defaultYaw||0,pitch:M.defaultPitch||0,hfov:110,type:"equirectangular",autoLoad:!0}}),Object.keys(G).length!==0&&(o.current=window.pannellum.viewer(x,{default:{firstScene:"scene_0",sceneFadeDuration:1e3,autoLoad:!0},scenes:G}))})(),()=>{if(o.current){try{o.current.destroy()}catch(B){console.warn("Suppressed error:",B)}o.current=null}}},[de,V]),n.useEffect(()=>{if(!de&&o.current){try{o.current.destroy()}catch(x){console.warn("Suppressed error:",x)}o.current=null}},[de]),e.jsxs("div",{className:"fixed inset-0 z-50 bg-black","data-testid":"vr-tour-overlay",children:[e.jsxs("div",{className:"absolute top-4 left-4 z-10 flex items-center gap-3",children:[e.jsx("button",{onClick:tt,className:"w-10 h-10 rounded-full bg-black/60 backdrop-blur-sm border border-white/20 flex items-center justify-center text-white hover:bg-white/20 transition-colors","data-testid":"button-close-vr",children:e.jsx(et,{className:"w-5 h-5"})}),e.jsx("span",{className:"text-white font-semibold text-sm bg-black/60 backdrop-blur-sm rounded-full px-4 py-2 border border-white/10",children:_?.areaLabel||_?.title||"360° Tour"})]}),de&&e.jsx("div",{ref:ce,className:"w-full h-full","data-testid":"vr-pannellum-container"}),!de&&_?.linkUrl&&e.jsx("iframe",{src:_.linkUrl.includes("matterport.com")?`${_.linkUrl}${_.linkUrl.includes("?")?"&":"?"}play=1&qs=1`:_.linkUrl,className:"w-full h-full border-0",allow:"fullscreen; xr-spatial-tracking",allowFullScreen:!0,title:_.areaLabel||_.title||"Virtual Tour","data-testid":"vr-iframe-container"}),m.length>1&&e.jsx("div",{className:"absolute bottom-6 left-1/2 -translate-x-1/2 z-10 flex items-center gap-2 bg-black/60 backdrop-blur-sm rounded-full px-3 py-2 border border-white/10",children:m.map((x,S)=>e.jsx("button",{onClick:()=>se(S),className:`px-3 py-1.5 rounded-full text-xs font-medium transition-all ${S===V?"bg-emerald-500 text-white":"bg-white/10 text-white/60 hover:bg-white/20"}`,"data-testid":`button-vr-scene-${S}`,children:x.areaLabel||x.title},x.id))})]})}function rn(){const{toast:m}=ur(),V=hr(),[,se]=xr("/lounge/:slug"),o=se?.slug||"",[ce,tt]=n.useState("flavors"),[_,de]=n.useState(0),[x,S]=n.useState([]),[B,G]=n.useState(""),[M,T]=n.useState(!1),[H,Te]=n.useState(!1),[w,kt]=n.useState(""),[st,Ct]=n.useState(""),[at,ve]=n.useState(null),[_r,ga]=n.useState(""),[ps,fs]=n.useState(!1),[ae,je]=n.useState(null),[Br,rt]=n.useState(null),[Dt,Oe]=n.useState(0),[bs,nt]=n.useState(!1),[P,vs]=n.useState(!1),[qr,pa]=n.useState(null),[I,fa]=n.useState(null),[Ne,js]=n.useState(!1),[me,we]=n.useState(null),[Le,Ns]=n.useState(""),[St,re]=n.useState(""),[Re,ws]=n.useState(null),[K,it]=n.useState(null),[O,_e]=n.useState(null),[ye,ys]=n.useState(""),[lt,Fs]=n.useState(""),[Pt,As]=n.useState(""),[Q,ks]=n.useState(""),[Mt,ba]=n.useState(!1),[Cs,va]=n.useState(!0),[Ds,ja]=n.useState(!1),[Na,wa]=n.useState(!1),[ya,Fa]=n.useState(new Set),[Aa,ka]=n.useState({}),Ss=12,[Ca,ot]=n.useState(!1),[L,It]=n.useState(""),[xe,Be]=n.useState(new Set),[Da,ct]=n.useState(!1),[$t,z]=n.useState(!1),[Sa,Et]=n.useState(!1),[Pa,Fe]=n.useState(!1),[qe,Tt]=n.useState(""),[Ot,Lt]=n.useState(""),[Ps,Rt]=n.useState(""),[Ms,Is]=n.useState(!1),[dt,Ue]=n.useState(!1),[Ye,mt]=n.useState(""),[$s,xt]=n.useState(!1),[p,Ve]=n.useState(null),[Es,Ts]=n.useState(!1),[Ma,Os]=n.useState(!1),[Ia,Ls]=n.useState(!1),[$a,Ea]=n.useState(!1),[Ta,Rs]=n.useState(!1),[_t,Oa]=n.useState(""),[Ae,Bt]=n.useState(new Set),[_s,qt]=n.useState(!1),{data:La}=Z({queryKey:["call-server-options",o],queryFn:async()=>{const t=await fetch(`/api/lounges/${o}/call-server-options`);return t.ok?t.json():{types:[]}},enabled:!!o,staleTime:300*1e3}),Bs=La?.types||[],[Ra,_a]=n.useState(!1),[Ba,qa]=n.useState(0),[A,He]=n.useState(!1),[X,ht]=n.useState(!1),[Ua,he]=n.useState(!1),[Ut,ke]=n.useState(null),[Ya,ze]=n.useState(!1),Yt=n.useRef(!1),Vt=n.useRef(!1),Va=n.useRef(null),Ha=n.useRef(null),Ht=n.useRef(null),zt=n.useRef(null),Wt=n.useRef(null),Jt=n.useRef(null),Gt=n.useRef(null),Kt=n.useRef(null);n.useRef(null);const ut=n.useRef(null),Qt=n.useRef(null),qs=n.useRef(null),We=n.useRef(null),[Us,za]=n.useState({left:0,width:0});n.useEffect(()=>{Vt.current=!1;const t=localStorage.getItem(`${At}_${o}`),s=localStorage.getItem(`${Ze}_${o}`);t&&(it(t),_e(s));const a=new URLSearchParams(window.location.search),r=a.get("table");if(r){pa(r),fetch(`/api/lounges/${o}/public/validate-table-id`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({tableId:r})}).then(u=>u.json()).then(u=>{u.valid&&(fa(u.tableLabel),kt(u.tableLabel),ve(!0),ga(u.tableLabel))}).catch(()=>{});const i=new URLSearchParams(a);i.delete("table");const l=i.toString()?`${window.location.pathname}?${i.toString()}`:window.location.pathname;window.history.replaceState({},document.title,l)}if(a.get("aiMode")==="pick2"){He(!0),ke(null),he(!1),ht(!1);const i=new URLSearchParams(a);i.delete("aiMode");const l=i.toString()?`${window.location.pathname}?${i.toString()}`:window.location.pathname;window.history.replaceState({},document.title,l)}},[o]);const{data:Ce,isLoading:Xt,error:Wa}=Z({queryKey:["public-inventory",o],queryFn:()=>ua(`/api/lounges/${o}/public/inventory`),enabled:!!o,staleTime:300*1e3}),{data:Ys}=Z({queryKey:[`/api/lounges/${o}/public/tours`],queryFn:async()=>{const t=await fetch(`/api/lounges/${o}/public/tours`);return t.ok?t.json():[]},enabled:!!o}),{data:Vs=[]}
2=Z({queryKey:["public-vr-tours",o],queryFn:async()=>{const t=await fetch(`/api/lounges/${o}/public/tours?type=panorama`);return t.ok?t.json():[]},enabled:!!o}),{data:gt=[]}=Z({queryKey:["public-influencer-mixes",o],queryFn:async()=>{const t=await fetch(`/api/lounges/${o}/public/influencer-mixes`);return t.ok?t.json():[]},enabled:!!o}),{data:pt=[]}=Z({queryKey:["public-offers",o],queryFn:async()=>{const t=await fetch(`/api/lounges/${o}/public/offers`);return t.ok?t.json():[]},enabled:!!o}),{data:ue}=Z({queryKey:["public-vip-status",o],queryFn:async()=>{const t=await fetch(`/api/lounges/${o}/public/vip-status`,{credentials:"include"});return t.ok?t.json():{isVip:!1,isFavorite:!1}},enabled:!!o}),{data:Ja}=Z({queryKey:["unread-count"],queryFn:()=>fetch("/api/messages/unread-count",{credentials:"include"}).then(t=>t.json()),enabled:!!ue?.isVip,refetchInterval:15e3}),{data:Je=[]}=Z({queryKey:["public-menu-items",o],queryFn:async()=>{const t=await fetch(`/api/lounges/${o}/public/menu-items`);return t.ok?t.json():[]},enabled:!!o}),d=Ce?.lounge,De=d?.id,ft=Ce?.flavors||[],Zt=Ce?.brands||[],ne=ft,Hs=Zt,bt=Ce?.mixes||[],es=Xt,Se=d?.subscriptionPlan==="yearly"||d?.isHonorary,ts=gr(),ss=pr(),{data:zs=[],isLoading:Ga}=fr(o,K),as=ms({mutationFn:async()=>{if(!De)throw new Error("No lounge");const t=await fetch(`/api/vip/favorite-lounges/${De}`,{method:"POST",credentials:"include"});if(!t.ok)throw new Error("Failed to add favorite");return t.json()},onSuccess:()=>{V.invalidateQueries({queryKey:["public-vip-status",o]}),m({title:"Added to Favorites",description:"This lounge has been added to your favorites!"})}}),rs=ms({mutationFn:async()=>{if(!De)throw new Error("No lounge");const t=await fetch(`/api/vip/favorite-lounges/${De}`,{method:"DELETE",credentials:"include"});if(!t.ok)throw new Error("Failed to remove favorite");return t.json()},onSuccess:()=>{V.invalidateQueries({queryKey:["public-vip-status",o]}),m({title:"Removed from Favorites",description:"This lounge has been removed from your favorites."})}}),q=t=>Zt.find(s=>s.id===t)?.name||"",ie=t=>{const s=ft.find(a=>a.id===t);return s?.brandId?q(s.brandId):""},ge=t=>ft.find(s=>s.id===t);n.useEffect(()=>{if(!Ce||Vt.current)return;const t=new URLSearchParams(window.location.search),s=t.get("aiMix"),a=t.get("aiMixes");if(!s&&!a)return;Vt.current=!0;const r=new URLSearchParams(t);r.delete("aiMix"),r.delete("aiMixes");const c=r.toString()?`${window.location.pathname}?${r.toString()}`:window.location.pathname;window.history.replaceState({},document.title,c);const i=v=>{if(!Array.isArray(v.flavors)||v.flavors.length===0)return[];const b=[];for(const y of v.flavors){const g=(y.name||"").toLowerCase().trim();if(!g)continue;let f=ne.find(k=>k.name.toLowerCase().trim()===g);if(f||(f=ne.find(k=>k.name.toLowerCase().trim().includes(g)||g.includes(k.name.toLowerCase().trim()))),!f&&y.brandName){const k=y.brandName.toLowerCase().trim();f=ne.find(U=>q(U.brandId).toLowerCase().trim()===k&&(U.name.toLowerCase().trim().includes(g)||g.includes(U.name.toLowerCase().trim())))}f&&!b.some(k=>k.flavorId===f.id)&&b.push({flavorId:f.id,flavorName:f.name,brandName:f.brandId?q(f.brandId):"",percentage:Number(y.percentage)||0})}if(b.length===0)return[];const Me=b.reduce((y,g)=>y+g.percentage,0);if(Me<=0)return[];if(Me===100)return b;const fe=100/Me;let jt=0;return b.map((y,g)=>{if(g===b.length-1)return{...y,percentage:Math.max(1,100-jt)};const f=b.length-g-1,k=100-jt-f,U=Math.min(k,Math.max(1,Math.round(y.percentage*fe)));return jt+=U,{...y,percentage:U}})};let l=[];try{if(s)l=[JSON.parse(s)];else if(a){const v=JSON.parse(a);l=Array.isArray(v)?v:[]}}catch{m({title:"AI Mix Error",description:"Could not parse AI recommendation data.",variant:"destructive"});return}let u=null,N=[];for(const v of l){const b=i(v);if(b.length>0){u=v,N=b;break}}if(!u||N.length===0){m({title:"Match Error",description:"Could not match the AI flavors to your inventory.",variant:"destructive"});return}if(S(N),G(u.name||""),z(!0),we(null),re(O||L||""),T(!0),a&&l.length>1){m({title:"AI Mix Ready",description:`Applied "${u.name||"AI Mix"}". You can order additional recommendations one by one.`});return}m({title:"AI Mix Ready",description:`"${u.name||"AI Mix"}" is ready to order.`})},[Ce,ne,O,L,q,m]);const Ka=t=>{Fa(s=>{const a=new Set(s);return a.has(t)?a.delete(t):a.add(t),a})},pe=x.reduce((t,s)=>t+s.percentage,0),ns=t=>{if(t===0)return[];const s=Math.floor(100/t/5)*5,a=Array.from({length:t},()=>s);let r=100-s*t;for(let c=t-1;c>=0&&r>0;c--)a[c]+=5,r-=5;return a},Qa=t=>{if(x.find(l=>l.flavorId===t.id)){const l=x.filter(u=>u.flavorId!==t.id);if(l.length===0)S([]);else{const u=ns(l.length);S(l.map((N,v)=>({...N,percentage:u[v]})))}Be(u=>{const N=new Set(u);return N.delete(t.id),N}),z(!1);return}const a=A?2:4;if(x.length>=a){m({title:A?"Pick 2 Mode":"Maximum Reached",description:A?"You can only select 2 flavors in Pick 2 mode. Remove one to change your selection.":"You can only add up to 4 flavors to a mix.",variant:"destructive"});return}const r=x.length+1,c=ns(r),i=[...x.map((l,u)=>({...l,percentage:c[u]})),{flavorId:t.id,flavorName:t.name,brandName:t.brandId?q(t.brandId):"",percentage:c[r-1]}];S(i),z(!1),(!A||r>=2)&&R("create")},Ws=t=>{const s=x.filter(a=>a.flavorId!==t);if(s.length===0)S([]);else{const a=ns(s.length);S(s.map((r,c)=>({...r,percentage:a[c]})))}Be(a=>
2{const r=new Set(a);return r.delete(t),r}),z(!1)},is=(t,s)=>{const a=x.find(g=>g.flavorId===t);if(!a)return;const r=5,c=Math.round(s/5)*5,i=x.filter(g=>g.flavorId!==t&&!xe.has(g.flavorId)),l=x.filter(g=>g.flavorId!==t&&xe.has(g.flavorId)).reduce((g,f)=>g+f.percentage,0);if(i.length===0)return;const u=100-l-i.length*r,N=Math.max(r,Math.min(u,c));if(N-a.percentage===0)return;const b=100-N-l;if(b<i.length*r)return;const Me=i.reduce((g,f)=>g+f.percentage,0);let fe=x.map(g=>{if(g.flavorId===t)return{...g,percentage:N};if(xe.has(g.flavorId))return g;const f=Me>0?g.percentage/Me:1/i.length,k=Math.round(f*b/5)*5;return{...g,percentage:Math.max(r,k)}}),y=100-fe.reduce((g,f)=>g+f.percentage,0);if(y!==0){const g=fe.filter(f=>f.flavorId!==t&&!xe.has(f.flavorId));for(const f of g){if(y===0)break;const k=y>0?Math.min(5,y):Math.max(-5,y);f.percentage+k>=r&&(fe=fe.map(U=>U.flavorId===f.flavorId?{...U,percentage:U.percentage+k}:U),y-=k)}}S(fe),z(!1)},Xa=t=>{Be(s=>{const a=new Set(s);return a.has(t)?a.delete(t):a.add(t),a})},Za=async()=>{if(!ye.trim()||!lt.trim()){m({title:"Required Fields",description:"Please enter your name and email.",variant:"destructive"});return}if(Q){if(Q.length<8){m({title:"Weak Password",description:"Password must be at least 8 characters.",variant:"destructive"});return}if(!/[A-Z]/.test(Q)){m({title:"Weak Password",description:"Password must include an uppercase letter.",variant:"destructive"});return}if(!/[a-z]/.test(Q)){m({title:"Weak Password",description:"Password must include a lowercase letter.",variant:"destructive"});return}if(!/[0-9]/.test(Q)){m({title:"Weak Password",description:"Password must include a number.",variant:"destructive"});return}if(!/[!@#$%^&*()_+\-=[\]{};':"\\|,.<>/?`~]/.test(Q)){m({title:"Weak Password",description:"Password must include a symbol (!@#$%^&*...).",variant:"destructive"});return}}ts.mutate({slug:o,data:{name:ye,email:lt,phone:Pt||void 0,emailNotifications:Cs,smsNotifications:Ds}},{onSuccess:async t=>{if(localStorage.setItem(`${At}_${o}`,t.customer.id),localStorage.setItem(`${Ze}_${o}`,t.customer.name||ye),it(t.customer.id),_e(t.customer.name||ye),wa(!0),Q)try{(await fetch("/api/auth/vip-register",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({email:lt,password:Q,name:ye,phone:Pt||void 0})})).ok&&d&&await fetch(`/api/vip/favorite-lounges/${d.id}`,{method:"POST",credentials:"include"})}catch(s){console.warn("Suppressed error:",s)}ys(""),Fs(""),As(""),ks("")}})},Js=()=>{K||(Tt(L||O||""),Lt(""),Rt(""),Fe(!0))},er=async()=>{if(!qe.trim()||!Ot.trim()){m({title:"Required Fields",description:"Please enter your name and email.",variant:"destructive"});return}Is(!0);try{const t=await fetch(`/api/lounges/${o}/customers/register`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:qe,email:Ot,phone:Ps||void 0,emailNotifications:!0,smsNotifications:!1})});if(!t.ok){const a=await t.json().catch(()=>({message:"Registration failed"}));throw new Error(a.message||"Registration failed")}const s=await t.json();localStorage.setItem(`${At}_${o}`,s.customer.id),localStorage.setItem(`${Ze}_${o}`,s.customer.name||qe),it(s.customer.id),_e(s.customer.name||qe),Fe(!1),m({title:"Welcome to the VIP List! 🎉",description:`You're now a member of ${d?.name||"this lounge"}'s exclusive list.`})}catch(t){m({title:"Registration Failed",description:t instanceof Error?t.message:"Something went wrong. Please try again.",variant:"destructive"})}finally{Is(!1)}},tr=()=>{if(x.length===0){m({title:"No Flavors Selected",description:"Add at least one flavor to save your mix.",variant:"destructive"});return}if(pe!==100){m({title:"Adjust Percentages",description:"Your flavor percentages must add up to 100%.",variant:"destructive"});return}It(O||""),ot(!0)},sr=()=>{if(!L.trim()){m({title:"Name Required",description:"Please enter your name to save this mix.",variant:"destructive"});return}o&&ss.mutate({name:B||`${L}'s Mix`,loungeSlug:o,flavorComposition:x.map(t=>({flavorId:t.flavorId,percentage:t.percentage})),productionDate:new Date().toISOString(),customerName:L,isPublic:!1},{onSuccess:()=>{ot(!1),It(""),z(!0),m({title:"Mix Saved!",description:"Your custom mix has been saved to your profile."}),Js()}})},Pe=ms({mutationFn:t=>ua(`/api/lounges/${o}/public/orders`,{method:"POST",body:JSON.stringify(t)}),onSuccess:(t,s,a)=>{V.invalidateQueries({queryKey:["orders"]}),m({title:"Order Placed!",description:`Your order has been sent to table ${w}. Our staff will prepare it shortly.`});const r=St.trim();r&&r!==O&&(_e(r),localStorage.setItem(`${Ze}_${o}`,r)),T(!1),(w.trim()||I)&&js(!0),we(null),Ns(""),re(""),ws(null),S([]),G(""),Be(new Set),z(!1),Js(),setTimeout(()=>Pe.reset(),0)},onError:t=>{m({title:"Order Failed",description:t.message,variant:"destructive"})}}),ls=t=>{we(t),re(O||L||""),T(!0)},ar=()=>{if(x.length===0){m({title:"No Flavors Selected",description:"Add at least one flavor to create your mix.",variant:"destructive"});return}if(pe!==100){m({title:"Adjust Percentages",description:"Your flavor percentages must add up to 100%.",variant:"destructive"});return}if(!B.trim()||!$t){ct(!0);return}we(null),re(O||L||""),T(!0)},Gs=async t=>{if(x.length===2){ze(!1),ht(!0);try{const s=x[0],a=x[1];let r=`I chose: ${s.flavorName}${s.brandName?` (${s.brandName})`:""} and ${a.flavorName}${a.brandName?` (${a.brandName})`:""}. Include both in every mix. IMPORTANT: Each mix MUST have 4 to 5 total flavors. Add 2-3 more complementary flavors from inventory to complete each mix.`;if(t==="same"){const l=new Set;s.brandName&&l.add(s.brandName),a.brandName&&l.add(a.brandName),l.size>0&&(r+=` IMPORTANT: Only use flavors from these brand(s): ${[...l].join(", ")}. Do NOT use flavors from any other brands.`)}const c=await fetch(`/api/lounges/${o}/ai-recommendations`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mood:r})});if(!c.ok)throw new Error("Failed to get recommendations");const i=await c.json();ke(i),he(!0)}catch{m({title:"AI Error",description:"Failed to get recommendations. Please try again.",variant:"destructive"})}finally{ht(!1)}}},rr=t=>{const s=[];for(const a of t.ingredients||[]){const r=(a.name||"").toLowerCase().trim();let c=ne.find(i=>i.name.toLowerCase().trim()===r);if(c||(c=ne.find(i=>i.name.toLowerCase().trim().includes(r)||r.includes(i.name.toLowerCase().trim()))),!c&&a.brandName){const i=a.brandName.toLowerCase().trim();c=ne.find(l=>q(l.brandId).toLowerCase().trim()===i&&(l.name.toLowerCase().trim().includes(r)||r.includes(l.name.toLowerCase().trim())))}c&&!s.some(i=>i.flavorId===c.id)&&s.push({flavorId:c.id,flavorName:c.name,brandName:c.brandId?q(c.brandId):"",percentage:a.percentage})}if(s.length>0){const a=s.reduce((r,c)=>r+c.percentage,0);if(a!==100&&a>0){const r=100/a;let c=100;
2s.forEach((i,l)=>{l<s.length-1?(i.percentage=Math.round(i.percentage*r/5)*5||5,c-=i.percentage):i.percentage=c})}S(s),G(t.name||""),z(!0),he(!1),He(!1),ke(null),R("create"),m({title:"Mix Applied!",description:`"${t.name}" is ready — tap Order to place it.`})}else m({title:"Match Error",description:"Could not match the AI flavors to your inventory.",variant:"destructive"})},os=n.useRef(null),cs=async t=>{if(!t.trim()){je(null),ve(null),rt(null),Oe(0);return}fs(!0);try{const a=await(await fetch(`/api/lounges/${o}/public/lookup-table-code`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({tableLabel:t.trim()})})).json();a.found?(je(a.code),rt(a.expiresAt),Oe(a.expiresIn||0)):(je(null),rt(null),Oe(0))}catch{je(null),rt(null),Oe(0)}finally{fs(!1)}},nr=n.useCallback(t=>{if(os.current&&clearTimeout(os.current),!t.trim()){je(null),ve(null),Oe(0);return}os.current=setTimeout(()=>{cs(t)},500)},[o]),Ge=async(t=0)=>navigator.geolocation?(Te(!0),new Promise(s=>{navigator.geolocation.getCurrentPosition(async a=>{nt(!0);const r=a.coords.accuracy||20;try{const i=await(await fetch(`/api/lounges/${o}/public/verify-order`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({tableNumber:w||"1",latitude:a.coords.latitude,longitude:a.coords.longitude,accuracy:r})})).json();if(Te(!1),i.valid)vs(!0),m({title:"Location Verified ✓",description:"You're at the lounge! You can now proceed with your order."}),s(!0);else if(r>50&&t===0)m({title:"Poor GPS Signal",description:"Retrying with better accuracy..."}),setTimeout(()=>{Ge(1).then(s)},2e3);else{vs(!1),nt(!1);let l=i.message||"You must be at the lounge to place an order.";i.message&&i.message.includes("m away")&&(l=i.message+" If you believe you're at the lounge, please ask staff for assistance."),m({title:"Location Verification Failed",description:l,variant:"destructive"}),s(!1)}}catch{Te(!1),nt(!1),m({title:"Connection Error",description:"Could not verify location. Please check your internet connection and try again.",variant:"destructive"}),s(!1)}},a=>{Te(!1),nt(!1);let r="Location access was denied.";a.code===1?r="Please enable location access in your browser settings to order. Go to Settings > Privacy > Location Services.":a.code===2?r="Location unavailable. Please ensure GPS/Location is enabled on your device.":a.code===3&&(r="Location request timed out. Please ensure you have a clear view of the sky or strong signal."),m({title:"Location Access Required",description:r,variant:"destructive"}),s(!1)},{enableHighAccuracy:!0,timeout:15e3,maximumAge:0})})):(m({title:"Location Not Supported",description:"Your browser doesn't support location services.",variant:"destructive"}),Te(!1),!1),vt=d?.brandingConfig?.orderVerificationEnabled!==!1,$=d?.geofenceEnabled!==!1,Ks=n.useRef(!1);n.useEffect(()=>{d&&$&&!P&&!H&&!Ks.current&&(Ks.current=!0,Ge())},[d,$,P,H]);const ir=()=>{if(!me&&x.length===0){T(!1),Et(!0);return}if($&&!P){m({title:"Location Required",description:"You must enable location and be at the lounge to place an order.",variant:"destructive"});return}if(!I){if(!(Ne&&w.trim())){if(vt){if(!w.trim()){m({title:"Table Number Required",description:"Please enter your table number.",variant:"destructive"});return}if(!ae){m({title:"Table Not Found",description:"This table number is not recognized. Please check and try again.",variant:"destructive"});return}if(st!==ae){m({title:"Code Mismatch",description:"The code you entered does not match. Please enter the code shown above.",variant:"destructive"});return}}else if(!w.trim()){m({title:"Table Number Required",description:"Please enter your table number.",variant:"destructive"});return}}}if(!De)return;const t={tableNumber:I||w,tableCode:vt&&!I?st:void 0,customerName:St.trim()||O||L||void 0,hookahServiceId:Re||void 0};if(me)t.mixId=me;else{const s=x.map(a=>`${a.flavorName} (${a.percentage}%)`).join(", ");t.notes=`Custom Mix: ${B||"Unnamed"} - ${s}${Le?` | Notes: ${Le}`:""}`,t.flavorIds=x.map(a=>a.flavorId)}if(Le&&me&&(t.notes=Le),P&&bs){navigator.geolocation.getCurrentPosition(s=>{t.latitude=s.coords.latitude,t.longitude=s.coords.longitude,t.accuracy=s.coords.accuracy||20,Pe.mutate(t)},()=>{Pe.mutate(t)},{enableHighAccuracy:!1,timeout:3e3,maximumAge:6e4});return}Pe.mutate(t)},R=n.useCallback(t=>{const a={flavors:Ht,mixes:zt,create:Wt,"ai-mixology":Jt,"influencer-mixes":Gt,"food-drinks":Qt,promotions:Kt,"my-mixes":ut,register:ut}[t];if(a?.current){const r=qs.current?.offsetHeight||60,c=a.current.getBoundingClientRect().top+window.scrollY-r-16;window.scrollTo({top:c,behavior:"smooth"})}tt(t)},[]);if(n.useEffect(()=>{A&&!Yt.current&&(Yt.current=!0,setTimeout(()=>R("flavors"),120)),A||(Yt.current=!1)},[A,R]),n.useEffect(()=>{const t=[{id:"flavors",ref:Ht},{id:"mixes",ref:zt},{id:"create",ref:Wt},{id:"ai-mixology",ref:Jt},{id:"influencer-mixes",ref:Gt},{id:"food-drinks",ref:Qt},{id:"promotions",ref:Kt},{id:"my-mixes",ref:ut}],s=new IntersectionObserver(a=>{for(const r of a)if(r.isIntersecting){const c=r.target.getAttribute("id");c&&tt(c)}}
2,{rootMargin:"-120px 0px -60% 0px",threshold:.1});return t.forEach(({ref:a})=>{a.current&&s.observe(a.current)}),()=>s.disconnect()},[es]),n.useEffect(()=>{const t=new IntersectionObserver(a=>{for(const r of a)r.isIntersecting&&r.target.classList.add("section-visible")},{rootMargin:"0px 0px -80px 0px",threshold:.05});return document.querySelectorAll(".animate-section").forEach(a=>t.observe(a)),()=>t.disconnect()},[es]),n.useEffect(()=>{if(!We.current)return;const t=We.current.querySelector('[data-nav-active="true"]');if(t){const s=We.current.getBoundingClientRect(),a=t.getBoundingClientRect();za({left:a.left-s.left+We.current.scrollLeft,width:a.width})}},[ce]),es)return e.jsx("div",{className:"min-h-screen bg-black flex items-center justify-center",children:e.jsx(j,{className:"w-12 h-12 animate-spin text-[#D4AF37]"})});if(Wa||!d)return e.jsx("div",{className:"min-h-screen bg-black flex items-center justify-center text-center p-6",children:e.jsxs("div",{className:"space-y-4",children:[e.jsx("img",{src:"/images/hmix-logo-new.jpg",alt:"HMIX.AI",className:"h-14 mx-auto object-contain opacity-50"}),e.jsx("h1",{className:"text-2xl font-bold text-white",children:"Lounge Not Found"}),e.jsx("p",{className:"text-gray-400",children:"The lounge you're looking for doesn't exist or the QR code is invalid."})]})});const Ke=d?.brandingConfig?.menuVisibility||{},Qs=Ke.showFlavorMenu!==!1,Xs=Ke.showFeaturedMixes!==!1,Zs=Ke.showAiSommelier!==!1,ea=Ke.showFoodDrinks!==!1,ta=Ke.showInfluencerMixes!==!1,ds=d?.brandingConfig?.bottomBarVisibility||{},lr=ds.showOrderButton!==!1,or=ds.showVrPromoButton!==!1,cr=ds.showTableTentButton!==!1,dr=d?.brandingConfig?.ctaButtons||[],mr=[...Qs?[{id:"flavors",label:"Flavors",icon:e.jsx(wt,{className:"w-4 h-4"})}]:[],...Xs?[{id:"mixes",label:"Featured Mixes",icon:e.jsx($e,{className:"w-4 h-4"})}]:[],{id:"create",label:"Create Mix",icon:e.jsx(be,{className:"w-4 h-4"})},...Zs?[{id:"ai-mixology",label:"AI Mixology",icon:e.jsx(Y,{className:"w-4 h-4"})}]:[],...ta&&gt.length>0?[{id:"influencer-mixes",label:"Influencer Mixes",icon:e.jsx($e,{className:"w-4 h-4"})}]:[],...ea&&Je.length>0?[{id:"food-drinks",label:"Food & Drinks",icon:e.jsx(oe,{className:"w-4 h-4"})}]:[],...pt.length>0?[{id:"promotions",label:"Promotions",icon:e.jsx(na,{className:"w-4 h-4"})}]:[],{id:K?"my-mixes":"register",label:K?"My Mixes":"Join",icon:K?e.jsx(Qe,{className:"w-4 h-4"}):e.jsx(Xe,{className:"w-4 h-4"})}];return e.jsxs("div",{className:"min-h-screen bg-black text-white font-sans selection:bg-[#D4AF37] selection:text-black",children:[e.jsxs("div",{className:"fixed inset-0 z-0 pointer-events-none",children:[e.jsx("div",{className:"absolute inset-0 bg-[radial-gradient(circle_at_top,_var(--tw-gradient-stops))] from-[#1a1a1a] via-[#000000] to-[#000000]"}),e.jsx("div",{className:"absolute inset-0 opacity-15",style:{backgroundImage:`url(${ra})`,backgroundSize:"cover"}})]}),e.jsxs("section",{className:"relative z-10 min-h-[200px] md:min-h-[300px]","data-testid":"section-hero",children:[e.jsx("div",{className:"absolute inset-0 bg-gradient-to-b from-black/40 via-black/60 to-black"}),e.jsx("div",{className:"absolute inset-0 opacity-20",style:{backgroundImage:`url(${ra})`,backgroundSize:"cover"}}),e.jsxs("div",{className:"relative z-10 container mx-auto px-4 py-10 md:py-16 flex flex-col items-center text-center",children:[e.jsx("div",{className:"flex items-center gap-4 mb-4",children:d.brandingConfig?.logoUrl?e.jsx("img",{src:d.brandingConfig.logoUrl,alt:d.name,className:"w-16 h-16 md:w-20 md:h-20 rounded-2xl object-cover border-2 border-[#D4AF37]/30 shadow-lg","data-testid":"img-public-logo"}):e.jsx("img",{src:"/images/hmix-logo-new.jpg",alt:"HMIX.AI",className:"h-16 md:h-20 object-contain"})}),e.jsx("h1",{className:"text-3xl md:text-4xl font-bold text-[#D4AF37] mb-2","data-testid":"text-lounge-name",children:d.name}),d.location&&e.jsxs("p",{className:"text-gray-300 flex items-center gap-2 mb-2","data-testid":"text-lounge-location",children:[e.jsx(ia,{className:"w-4 h-4 text-[#D4AF37]"}),d.location]}),(d.loungeCategory||d.productFocus&&d.productFocus.length>0)&&e.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-2 mb-3",children:[d.loungeCategory&&xa[d.lou
2ngeCategory]&&e.jsxs("span",{className:"inline-flex items-center gap-1.5 px-3 py-1 rounded-full bg-[#D4AF37]/15 border border-[#D4AF37]/30 text-[#D4AF37] text-xs font-semibold","data-testid":"badge-lounge-category",children:[e.jsx($e,{className:"w-3 h-3"}),xa[d.loungeCategory]]}),d.productFocus&&Array.isArray(d.productFocus)&&d.productFocus.map(t=>ha[t]&&e.jsx("span",{className:"inline-flex items-center gap-1 px-2.5 py-1 rounded-full bg-white/5 border border-white/10 text-white/70 text-xs font-medium","data-testid":`badge-product-focus-${t}`,children:ha[t]},t))]}),e.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-4 mt-2 text-sm text-gray-400",children:[d.operatingHours&&typeof d.operatingHours=="object"&&d.operatingHours!==null&&(()=>{try{const t=d.operatingHours,s=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"][new Date().getDay()],a=t[s];if(!a)return null;if(a.closed)return e.jsxs("span",{className:"flex items-center gap-1.5","data-testid":"text-operating-hours",children:[e.jsx(yt,{className:"w-4 h-4 text-[#D4AF37]"}),"Closed Today"]});if(typeof a.open!="string"||typeof a.close!="string")return null;const r=c=>{const[i,l]=c.split(":").map(Number),u=i>=12?"PM":"AM";return`${i%12||12}:${String(l).padStart(2,"0")} ${u}`};return e.jsxs("span",{className:"flex items-center gap-1.5","data-testid":"text-operating-hours",children:[e.jsx(yt,{className:"w-4 h-4 text-[#D4AF37]"}),"Today: ",r(a.open)," - ",r(a.close)]})}catch{return null}})(),d.operatingHours&&typeof d.operatingHours=="string"&&e.jsxs("span",{className:"flex items-center gap-1.5","data-testid":"text-operating-hours",children:[e.jsx(yt,{className:"w-4 h-4 text-[#D4AF37]"}),d.operatingHours]}),d.phone&&e.jsxs("span",{className:"flex items-center gap-1.5","data-testid":"text-phone",children:[e.jsx(xs,{className:"w-4 h-4 text-[#D4AF37]"}),d.phone]})]}),x.length>0&&e.jsxs(C,{className:"mt-4 bg-[#D4AF37] text-black font-bold","data-testid":"badge-mix-count",children:[e.jsx(Y,{className:"w-3 h-3 mr-1"}),x.length," in mix"]}),ue?.isVip&&De&&e.jsx("div",{className:"mt-4","data-testid":"vip-favorite-section",children:ue.isFavorite?e.jsxs(h,{variant:"outline",onClick:()=>rs.mutate(),disabled:rs.isPending,className:"border-[#D4AF37] text-[#D4AF37] hover:bg-[#D4AF37]/10","data-testid":"button-remove-favorite",children:[rs.isPending?e.jsx(j,{className:"w-4 h-4 animate-spin mr-2"}):e.jsx(Qe,{className:"w-4 h-4 mr-2 fill-[#D4AF37]"}),"Remove from Favorites"]}):e.jsxs(h,{onClick:()=>as.mutate(),disabled:as.isPending,className:"bg-[#D4AF37] text-black hover:bg-[#E5C04B] font-semibold","data-testid":"button-add-favorite",children:[as.isPending?e.jsx(j,{className:"w-4 h-4 animate-spin mr-2"}):e.jsx(Qe,{className:"w-4 h-4 mr-2"}),"Add to Favorites"]})})]})]}),e.jsx("nav",{ref:qs,className:"sticky top-0 z-50 bg-black/95 border-b border-[#D4AF37]/20 backdrop-blur-sm","data-testid":"nav-sections",children:e.jsx("div",{className:"container mx-auto px-4",children:e.jsxs("div",{ref:We,className:"relative flex gap-1 overflow-x-auto py-3 scrollbar-hide",children:[e.jsx("div",{className:"absolute bottom-1 h-[3px] bg-[#D4AF37] rounded-full transition-all duration-300 ease-out",style:{left:Us.left,width:Us.width}}),mr.map(t=>e.jsxs("button",{onClick:()=>R(t.id),"data-nav-active":ce===t.id?"true":"false",className:`flex items-center gap-2 px-4 py-2 rounded-full whitespace-nowrap text-sm font-medium transition-all duration-300 ${ce===t.id?"bg-[#D4AF37] text-black":"text-gray-400 hover:text-[#D4AF37] hover:bg-[#D4AF37]/10"}`,"data-testid":`nav-${t.id}`,children:[t.icon,t.label,t.id==="create"&&x.length>0&&e.jsx(C,{className:"ml-1 bg-white text-black text-xs px-1.5 h-5",children:x.length})]},t.id))]})})}),e.jsxs("main",{className:"relative z-10 container mx-auto px-4 py-6 pb-44",children:[Qs&&e.jsxs("section",{ref:Ht,id:"flavors",className:"pb-8 animate-section","data-testid":"section-flavors",children:[e.jsxs("div",{className:"text-center mb-6",children:[e.jsx("h2",{className:"text-2xl font-bold text-white mb-2 animate-heading",children:A?"Pick 2 Flavors":"Flavor Menu"}),e.jsx("div",{className:"w-16 h-1 bg-[#D4AF37] mx-auto rounded-full mb-3 animate-line"}),e.jsx("p",{className:"text-gray-400 text-sm",children:A?"Tap any 2 flavors below, then AI will complete your perfect mix":"Tap a brand to browse flavors, then add to your mix"})]}),Xt?e.jsx("div",{className:"flex justify-center py-12",children:e.jsx(j,{className:"w-8 h-8 animate-spin text-[#D4AF37]"})}):Hs.length===0?e.jsxs("div",{className:"text-center py-12 text-gray-400",children:[e.jsx(Ft,{className:"w-12 h-12 mx-auto mb-4 opacity-30"}),e.jsx("p",{children:"No flavors available at this time."})]}):e.jsx("div",{className:"space-y-3",children:Hs.map(t=>{const s=ne.filter(l=>l.brandId===t.id),a=ya.has(t.id),r=Aa[t.id]||1,c=Math.ceil(s.length/Ss),i=s.slice(0,r*Ss);return e.jsxs("div",{className:"border border-white/10 rounded-xl overflow-hidden bg-gradient-to-br from-[#111] to-black","data-testid":`card-brand-${t.id}`,children:[e.jsxs("button",{onClick:()=>Ka(t.id),className:"w-full flex items-center justify-between p-4 hover:bg-white/5 transition-colors","data-testid":`button-toggle-brand-${t.id}`,children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(Ft,{className:"w-5 h-5 text-[#D4AF37]"}),e.jsxs("div",{className:"text-left",children:[e.jsx("h3",{className:"text-base font-semibold text-white",children:t.name}),e.jsxs("p",{className:"text-xs text-gray-400",children:[s.length," flavor",s.length!==1?"s":""]})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(C,{className:"bg-[#D4AF37]/20 text-[#D4AF37] border-[#D4AF37]/30 text-xs",children:s.length}),a?e.jsx(wr,{className:"w-5 h-5 text-[#D4AF37]"}):e.jsx(yr,{className:"w-5 h-5 text-gray-400"})]})]}),a&&e.jsx("div",{className:"overflow-hidden",children:e.jsxs("div",{className:"px-4 pb-4 pt-2 border-t border-white/5",children:[e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-3",children:i.map(l=>{const u=!!x.find(v=>v.flavorId===l.id),N=A&&x.length>=2&&!u;return e.jsxs("button",{onClick:()=>!N&&Qa(l),disabled:N,className:`p-4 bg-gradient-to-br from-[#0a0a0a] to-[#111] border rounded-xl text-left transition-all ${u?"border-[#D4AF37] shadow-[0_0_15px_rgba(212,175,55,0.3)]":N?"border-white/5 opacity-40 cursor-not-allowed":"border-white/10 hover:border-[#D4AF37]/50"}`,"data-testid":`card-flavor-${l.id}`,children:[e.jsxs("div",{className:"flex justify-between items-start mb-2",children:[e.jsx("h4",{className:`font-semibold text-sm ${N?"text-gray-500":"text-white"}`,children:l.name}),u?e.jsx(E,{className:"w-4 h-4 text-[#D4AF37]"}):null]}),l.description&&e.jsx("p",{className:"text-white/50 text-xs italic mb-1","data-testid":`text-flavor-desc-${l.id}`,children:l.description}),(()=>{if(d?.brandingConfig?.showPricesOnMenu===!1)return null;const v=d?.brandingConfig?.pricingMode;let b=0;return v==="flat_rate"?b=parseFloat(d?.brandingConfig?.flatRate||"0"):v==="by_brand"?b=parseFloat(d?.brandingConfig?.brandPrices?.[l.brandId]||"0"):l.showPrice!==!1&&l.pricePerSession&&(b=parseFloat(l.pricePerSession)),b<=0?null:e.jsxs("p",{className:"text-[#D4AF37] text-sm font-semibold mb-2","data-testid":`text-price-${l.id}`,children:["$",b.toFixed(2),v!=="flat_rate"&&v!=="by_brand"&&l.priceType==="grams"?"/g":""]})})(),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-1 text-xs text-gray-400",children:[e.jsx(hs,{className:"w-3 h-3"}),l.intensity,"/10"]}),N?e.jsx(us,{className:"w-4 h-4 text-gray-600"}):e.jsx(be,{className:"w-4 h-4 text-[#D4AF37] opacity-50"})]})]},l.id)})}),r<c&&e.jsx("div",{className:"flex justify-center mt-4",children:e.jsxs(h,{variant:"outline",size:"sm",className:"border-[#D4AF37]/30 text-[#D4AF37] hover:bg-[#D4AF37]/10",onClick:l=>{l.stopPropagation(),ka(u=>({...u,[t.id]:r+1}))},"data-testid":`button-load-more-${t.id}`,children:["Load More (",s.length-i.length," remaining)"]})})]})})]},t.id)})})]}),Xs&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"border-t border-[#D4AF37]/10 my-4"}),e.jsxs("section",{ref:zt,id:"mixes",className:"pb-8 animate-section","data-testid":"section-mixes",children:[e.jsxs("div",{className:"text-center mb-6",children:[e.jsx("h2",{className:"text-2xl font-bold text-white mb-2 animate-heading",children:"Featured Mixes"}),e.jsx("div",{className:"w-16 h-1 bg-[#D4AF37] mx-auto rounded-full mb-3 animate-line"}),e.jsx("p",{className:"text-gray-400 text-sm",children:"Popular house blends crafted by our experts"})]}),Xt?e.jsx("div",{className:"flex justify-center py-12",children:e.jsx(j,{className:"w-8 h-8 animate-spin text-[#D4AF37]"})}):bt.length===0?e.jsxs("div",{className:"text-center py-12 text-gray-400",children:[e.jsx(Y,{className:"w-12 h-12 mx-auto mb-4 opacity-30"}),e.jsx("p",{children:"No featured mixes available yet."})]}):e.jsx("div",{className:"grid md:grid-cols-2 gap-4",children:bt.map(t=>e.jsxs("div",{className:"bg-gradient-to-br from-[#111] to-black border border-white/10 rounded-xl p-5 hover:border-[#D4AF37]/50 transition-all","data-testid":`card-mix-${t.id}`,children:[e.jsxs("div",{className:"flex justify-between items-start mb-3",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-bold text-white",children:t.name}),(()=>{if(d?.brandingConfig?.showPricesOnMenu===!1)return null;const s=d?.brandingConfig?.pricingMode;if(s==="flat_rate"){const r=parseFloat(d?.brandingConfig?.flatRate||"0");return r>0?e.jsxs("p",{className:"text-[#D4AF37] text-sm font-semibold mt-1","data-testid":`text-mix-price-${t.id}`,children:["$",r.toFixed(2)]}):null}if(s==="by_brand"){const r=d?.brandingConfig?.brandPrices||{},c=t.flavorComposition.map(i=>{const l=ge(i.flavorId);return l?parseFloat(r[l.brandId]||"0"):0}).filter(i=>i>0);return c.length===0?null:e.jsxs("p",{className:"text-[#D4AF37] text-sm font-semibold mt-1","data-testid":`text-mix-price-${t.id}`,children:["Est. $",Math.max(...c).toFixed(2)]})}const a=t.flavorComposition.map(r=>{const c=ge(r.flavorId);return c?.showPrice!==!1&&c?.pricePerSession?parseFloat(c.pricePerSession):0}).filter(r=>r>0);return a.length===0?null:e.jsxs("p",{className:"text-[#D4AF37] text-sm font-semibold mt-1","data-testid":`text-mix-price-${t.id}`,children:["Est. $",Math.max(...a).toFixed(2)]})})()]}),e.jsxs(C,{className:"bg-[#D4AF37]/20 text-[#D4AF37] border-[#D4AF37]/30",children:[e.jsx($e,{className:"w-3 h-3 mr-1 fill-[#D4AF37]"}),parseFloat(t.rating||"0").toFixed(1)]})]}),e.jsxs("div",{className:"mb-4",children:[e.jsx("p",{className:"text-xs text-gray-500 uppercase tracking-wider mb-2",children:"Flavor Composition"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:t.flavorComposition.map((s,a)=>{const r=ge(s.flavorId),c=r?.brandId?q(r.brandId):"";return e.jsxs(C,{variant:"outline",className:"border-white/20 text-gray-300 text-xs","data-testid":`badge-composition-${t.id}-${a}`,children:[r?.name||"Unknown",c&&e.jsxs("span",{className:"text-white/40 ml-1",children:["(",c,")"]})," ",s.percentage,"%"]},a)})})]}),t.tags&&t.tags.length>0&&e.jsx("div",{className:"flex flex-wrap gap-1 mb-4",children:t.tags.map(s=>e.jsx(C,{variant:"outline",className:"border-[#D4AF37]/30 text-[#D4AF37] text-xs",children:s},s))}),e.jsxs(h,{onClick:()=>
2ls(t.id),className:"w-full bg-[#D4AF37] text-black hover:bg-[#E5C04B] font-semibold","data-testid":`button-order-mix-${t.id}`,children:[e.jsx(oe,{className:"w-4 h-4 mr-2"}),"Order This Mix"]})]},t.id))})]})]}),e.jsx("div",{className:"border-t border-[#D4AF37]/10 my-4"}),e.jsxs("section",{ref:Wt,id:"create",className:"pb-8 animate-section","data-testid":"section-create",children:[e.jsxs("div",{className:"text-center mb-6",children:[e.jsx("h2",{className:"text-2xl font-bold text-white mb-2 animate-heading",children:"Create Your Mix"}),e.jsx("div",{className:"w-16 h-1 bg-[#D4AF37] mx-auto rounded-full mb-3 animate-line"}),e.jsx("p",{className:"text-gray-400 text-sm",children:"Build your perfect blend by selecting flavors and adjusting percentages"})]}),A&&e.jsxs("div",{className:"mb-4 bg-[#D4AF37]/10 border border-[#D4AF37]/30 rounded-xl p-4","data-testid":"pick2-mode-banner",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-[#D4AF37] font-semibold",children:"Pick 2 Flavors Mode"}),e.jsx("p",{className:"text-xs text-gray-300",children:x.length<2?`Select ${2-x.length} more flavor${2-x.length===1?"":"s"} to let AI complete your mix.`:"Great choice. Ready for AI to complete your mix."})]}),e.jsxs(C,{className:"bg-[#D4AF37]/20 text-[#D4AF37] border-[#D4AF37]/30",children:[Math.min(x.length,2),"/2 selected"]})]}),e.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",children:[e.jsx(h,{variant:"outline",className:"border-white/20 text-white",onClick:()=>{He(!1),ke(null),he(!1),ht(!1)},"data-testid":"button-cancel-pick2-mode",children:"Cancel Pick 2"}),e.jsxs(h,{onClick:()=>ze(!0),disabled:x.length!==2||X,className:"bg-[#D4AF37] text-black hover:bg-[#E5C04B] font-semibold","data-testid":"button-pick2-ai-complete",children:[X?e.jsx(j,{className:"w-4 h-4 mr-2 animate-spin"}):e.jsx(Y,{className:"w-4 h-4 mr-2"}),"AI Complete Mix"]})]})]}),e.jsxs("div",{className:"bg-gradient-to-br from-[#111] to-black border border-white/10 rounded-xl p-5",children:[e.jsxs("div",{className:"mb-4",children:[e.jsx(F,{htmlFor:"mix-name",className:"text-gray-300 text-sm",children:"Mix Name (Optional)"}),e.jsx(D,{id:"mix-name",value:B,onChange:t=>{G(t.target.value),z(!1)},placeholder:"Give your mix a name...",className:"mt-2 bg-white/5 border-white/10 text-white placeholder:text-gray-500","data-testid":"input-mix-name"})]}),x.length===0?e.jsxs("div",{className:"text-center py-8 text-gray-400",children:[e.jsx(wt,{className:"w-12 h-12 mx-auto mb-4 opacity-30"}),e.jsx("p",{className:"mb-2",children:"No flavors selected yet"}),e.jsx(h,{variant:"outline",className:"border-[#D4AF37]/30 text-[#D4AF37]",onClick:()=>R("flavors"),"data-testid":"button-browse-flavors",children:"Browse Flavors"})]}):e.jsxs("div",{className:"space-y-4",children:[x.map(t=>e.jsx("div",{className:"bg-white/5 rounded-lg p-4","data-testid":`selected-flavor-${t.flavorId}`,children:A?e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-8 h-8 rounded-lg bg-[#D4AF37]/10 border border-[#D4AF37]/30 flex items-center justify-center",children:e.jsx(E,{className:"w-4 h-4 text-[#D4AF37]"})}),e.jsxs("div",{children:[e.jsx("span",{className:"font-semibold text-white",children:t.flavorName}),(t.brandName||ie(t.flavorId))&&e.jsx("p",{className:"text-white/40 text-xs",children:t.brandName||ie(t.flavorId)})]})]}),e.jsx(h,{size:"icon",variant:"ghost",className:"h-8 w-8 text-red-400 hover:text-red-300 hover:bg-red-500/10",onClick:()=>Ws(t.flavorId),"data-testid":`button-remove-flavor-${t.flavorId}`,children:e.jsx(et,{className:"w-4 h-4"})})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex justify-between items-center mb-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(h,{size:"icon",variant:"ghost",className:`h-7 w-7 ${xe.has(t.flavorId)?"text-[#D4AF37] bg-[#D4AF37]/10":"text-gray-500 hover:text-gray-300"}`,onClick:()=>Xa(t.flavorId),"data-testid":`button-lock-flavor-${t.flavorId}`,children:xe.has(t.flavorId)?e.jsx(us,{className:"w-3.5 h-3.5"}):e.jsx(Fr,{className:"w-3.5 h-3.5"})}),e.jsxs("span",{className:`font-semibold ${xe.has(t.flavorId)?"text-[#D4AF37]":"text-white"}`,children:[t.flavorName,(t.brandName||ie(t.flavorId))&&e.jsxs("span",{className:"text-white/40 text-xs font-normal ml-1",children:["(",t.brandName||ie(t.flavorId),")"]})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{className:"text-[#D4AF37] font-mono font-bold",children:[t.percentage,"%"]}),e.jsx(h,{size:"icon",variant:"ghost",className:"h-8 w-8 text-red-400 hover:text-red-300 hover:bg-red-500/10",onClick:()=>Ws(t.flavorId),"data-testid":`button-remove-flavor-${t.flavorId}`,children:e.jsx(et,{className:"w-4 h-4"})})]})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(h,{size:"icon",variant:"outline",className:"h-8 w-8 border-white/20",onClick:()=>is(t.flavorId,Math.max(5,t.percentage-5)),"data-testid":`button-decrease-${t.flavorId}`,children:e.jsx(Ar,{className:"w-4 h-4"})}),e.jsx(jr,{value:[t.percentage],onValueChange:([s])=>is(t.flavorId,s),min:5,max:95,step:5,className:"flex-1","data-testid":`slider-percentage-${t.flavorId}`}),e.jsx(h,{size:"icon",variant:"outline",className:"h-8 w-8 border-white/20",onClick:()=>is(t.flavorId,Math.min(100,t.percentage+5)),"data-testid":`button-increase-${t.flavorId}`,children:e.jsx(be,{className:"w-4 h-4"})})]})]})},t.flavorId)),!A&&e.jsxs("div",{className:"border-t border-white/10 pt-4",children:[e.jsxs("div",{className:"flex justify-between items-center mb-2",children:[e.jsx("span",{className:"text-gray-400",children:"Total"}),e.jsxs("span",{className:`font-mono font-bold text-lg ${pe===100?"text-green-400":"text-red-400"}`,children:[pe,"%"]})]}),pe!==100&&e.jsx("p",{className:"text-xs text-red-400",children:"Adjust percentages to equal 100% before ordering"})]}),!(A&&x.length>=2)&&x.length<4&&e.jsxs(h,{variant:"outline",className:"w-full border-[#D4AF37]/30 text-[#D4AF37]",onClick:()=>R("flavors"),"data-testid":"button-add-more-flavors",children:[e.jsx(be,{className:"w-4 h-4 mr-2"}),"Add More Flavors"]}),A&&x.length>=2?e.jsxs(h,{onClick:()=>ze(!0),disabled:X,className:"w-full bg-[#D4AF37] text-black hover:bg-[#
2E5C04B] font-semibold","data-testid":"button-create-ai-mix",children:[X?e.jsx(j,{className:"w-4 h-4 mr-2 animate-spin"}):e.jsx(Y,{className:"w-4 h-4 mr-2"}),"Create AI Mix"]}):e.jsxs(h,{onClick:tr,disabled:x.length===0||pe!==100||$t,className:"w-full border-[#D4AF37]/50 text-[#D4AF37] hover:bg-[#D4AF37]/10",variant:"outline","data-testid":"button-save-mix",children:[$t?e.jsx(E,{className:"w-4 h-4 mr-2"}):e.jsx(gs,{className:"w-4 h-4 mr-2"}),"Save Mix"]})]})]})]}),e.jsx("div",{className:"border-t border-[#D4AF37]/10 my-4"}),Zs&&e.jsxs(e.Fragment,{children:[e.jsxs("section",{ref:Jt,id:"ai-mixology",className:"pb-8 animate-section","data-testid":"section-ai-mixology",children:[e.jsxs("div",{className:"text-center mb-6",children:[e.jsx("h2",{className:"text-2xl font-bold text-white mb-2 animate-heading",children:"AI Mixology"}),e.jsx("div",{className:"w-16 h-1 bg-[#D4AF37] mx-auto rounded-full mb-3 animate-line"}),e.jsx("p",{className:"text-gray-400 text-sm",children:"Let AI craft the perfect hookah mix for you"})]}),e.jsxs("div",{className:"grid sm:grid-cols-3 gap-4",children:[e.jsxs(Nt,{href:`/lounge/${o}/recommendations?mode=surprise`,className:"group relative overflow-hidden rounded-2xl border border-[#D4AF37]/30 bg-gradient-to-br from-[#D4AF37]/10 via-[#111] to-black p-5 text-left transition-all hover:border-[#D4AF37]/60 hover:shadow-lg hover:shadow-[#D4AF37]/10 no-underline","data-testid":"card-ai-surprise",children:[e.jsx("div",{className:"absolute top-0 right-0 w-20 h-20 bg-[#D4AF37]/5 rounded-full -translate-y-1/2 translate-x-1/2 group-hover:bg-[#D4AF37]/10 transition-colors"}),e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"w-11 h-11 rounded-xl bg-gradient-to-br from-[#D4AF37] to-[#B8860B] flex items-center justify-center mb-3 shadow-lg shadow-[#D4AF37]/20",children:e.jsx(Y,{className:"w-5 h-5 text-black"})}),e.jsx("h3",{className:"text-base font-bold text-white mb-1",children:"Surprise Me"}),e.jsx("p",{className:"text-gray-400 text-xs leading-relaxed",children:"Let AI pick the perfect mix based on what's popular"})]})]}),e.jsxs("button",{onClick:()=>{He(!0),ke(null),he(!1),S([]),G(""),Be(new Set),z(!1),m({title:"Pick 2 Mode Activated",description:"Tap a brand, then pick 2 flavors to let AI complete your mix!"}),R("flavors")},className:"group relative overflow-hidden rounded-2xl border border-white/10 bg-gradient-to-br from-white/5 via-[#111] to-black p-5 text-left transition-all hover:border-[#D4AF37]/40 hover:shadow-lg hover:shadow-[#D4AF37]/5","data-testid":"card-ai-pick2",children:[e.jsx("div",{className:"absolute top-0 right-0 w-20 h-20 bg-white/[0.02] rounded-full -translate-y-1/2 translate-x-1/2 group-hover:bg-[#D4AF37]/5 transition-colors"}),e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"w-11 h-11 rounded-xl bg-gradient-to-br from-white/10 to-white/5 border border-white/10 flex items-center justify-center mb-3 group-hover:from-[#D4AF37]/20 group-hover:to-[#D4AF37]/10 group-hover:border-[#D4AF37]/20 transition-all",children:e.jsx(wt,{className:"w-5 h-5 text-white/70 group-hover:text-[#D4AF37] transition-colors"})}),e.jsx("h3",{className:"text-base font-bold text-white mb-1",children:"Pick 2 Flavors"}),e.jsx("p",{className:"text-gray-400 text-xs leading-relaxed",children:"Choose two favorites and AI will complete the mix"})]})]}),e.jsxs(Nt,{href:`/lounge/${o}/recommendations?mode=sommelier`,className:"group relative overflow-hidden rounded-2xl border border-purple-500/20 bg-gradient-to-br from-purple-500/10 via-[#111] to-black p-5 text-left transition-all hover:border-purple-400/50 hover:shadow-lg hover:shadow-purple-500/10 no-underline","data-testid":"card-ai-sommelier",children:[e.jsx("div",{className:"absolute top-0 right-0 w-20 h-20 bg-purple-500/5 rounded-full -translate-y-1/2 translate-x-1/2 group-hover:bg-purple-500/10 transition-colors"}),e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"w-11 h-11 rounded-xl bg-gradient-to-br from-purple-500 to-indigo-600 flex items-center justify-center mb-3 shadow-lg shadow-purple-500/20",children:e.jsx($e,{className:"w-5 h-5 text-white"})}),e.jsx("h3",{className:"text-base font-bold text-white mb-1",children:"AI Flavor Sommelier"}),e.jsx("p",{className:"text-gray-400 text-xs leading-relaxed",children:"Tell us your preferences for personalized recommendations"})]})]})]})]}),e.jsx("div",{className:"border-t border-[#D4AF37]/10 my-4"})]}),ta&&gt.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"border-t border-[#D4AF37]/10 my-4"}),e.jsxs("section",{ref:Gt,id:"influencer-mixes",className:"pb-8 animate-section","data-testid":"section-influencer-mixes",children:[e.jsxs("div",{className:"text-center mb-6",children:[e.jsx("h2",{className:"text-2xl font-bold text-white mb-2 animate-heading",children:"Influencer Mixes"}),e.jsx("div",{className:"w-16 h-1 bg-[#D4AF37] mx-auto rounded-full mb-3 animate-line"}),e.jsx("p",{className:"text-gray-400 text-sm",children:"Exclusive blends crafted by top influencers"})]}),e.jsx("div",{className:"grid md:grid-cols-2 gap-4",children:gt.map(t=>e.jsxs("div",{className:"bg-gradient-to-br from-[#111] to-black border border-[#D4AF37]/30 rounded-xl p-5 hover:border-[#D4AF37]/60 transition-all","data-testid":`card-influencer-mix-${t.id}`,children:[e.jsxs("div",{className:"flex items-start gap-4 mb-4",children:[t.imageUrl&&e.jsx("img",{src:t.imageUrl,alt:t.influencerName,className:"w-14 h-14 roun
2ded-full object-cover border-2 border-[#D4AF37]/30","data-testid":`img-influencer-${t.id}`}),e.jsxs("div",{className:"flex-1",children:[e.jsx("h3",{className:"text-lg font-bold text-white",children:t.name}),e.jsx("p",{className:"text-[#D4AF37] text-sm font-medium",children:t.influencerName}),t.socialHandle&&e.jsxs("p",{className:"text-gray-400 text-xs","data-testid":`text-social-${t.id}`,children:["@",t.socialHandle]})]})]}),t.bio&&e.jsxs("p",{className:"text-gray-400 text-sm mb-3 italic","data-testid":`text-bio-${t.id}`,children:['"',t.bio,'"']}),t.flavorComposition&&t.flavorComposition.length>0&&e.jsxs("div",{className:"mb-3",children:[e.jsx("p",{className:"text-xs text-gray-500 uppercase tracking-wider mb-2",children:"Flavor Composition"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:t.flavorComposition.map((s,a)=>{const r=ge(s.flavorId);return e.jsxs(C,{variant:"outline",className:"border-white/20 text-gray-300 text-xs",children:[r?.name||s.flavorName||"Unknown",r?.brandId&&q(r.brandId)&&e.jsxs("span",{className:"text-white/40 ml-1",children:["· ",q(r.brandId)]})," ","(",s.percentage,"%)"]},a)})})]}),t.tags&&t.tags.length>0&&e.jsx("div",{className:"flex flex-wrap gap-1 mb-4",children:t.tags.map(s=>e.jsxs(C,{variant:"outline",className:"border-[#D4AF37]/30 text-[#D4AF37] text-xs",children:[e.jsx(kr,{className:"w-3 h-3 mr-1"}),s]},s))}),e.jsx("div",{className:"text-center mb-2",children:e.jsx("span",{className:"text-xs text-yellow-400/70",children:"+$3.00 influencer royalty included"})}),e.jsxs(h,{onClick:()=>ls(t.id),className:"w-full bg-[#D4AF37] text-black hover:bg-[#E5C04B] font-semibold","data-testid":`button-order-influencer-mix-${t.id}`,children:[e.jsx(oe,{className:"w-4 h-4 mr-2"}),"Order This Mix"]})]},t.id))})]})]}),ea&&Je.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"border-t border-[#D4AF37]/10 my-4"}),e.jsxs("section",{ref:Qt,id:"food-drinks",className:"pb-8 animate-section","data-testid":"section-food-drinks",children:[e.jsxs("div",{className:"text-center mb-6",children:[e.jsx("h2",{className:"text-2xl font-bold text-white mb-2 animate-heading",children:"Food & Drinks"}),e.jsx("div",{className:"w-16 h-1 bg-[#D4AF37] mx-auto rounded-full mb-3 animate-line"}),e.jsx("p",{className:"text-gray-400 text-sm",children:"Complement your hookah with our menu selections"})]}),(()=>{const t=Array.from(new Set(Je.map(s=>s.category||"Other")));return e.jsx("div",{className:"space-y-6",children:t.map(s=>e.jsxs("div",{children:[e.jsxs("h3",{className:"text-[#D4AF37] font-semibold mb-3 text-sm uppercase tracking-wider flex items-center gap-2",children:[e.jsx(hs,{className:"w-4 h-4"})," ",s]}),e.jsx("div",{className:"grid sm:grid-cols-2 gap-3",children:Je.filter(a=>(a.category||"Other")===s).map(a=>e.jsx("div",{className:"bg-gradient-to-br from-[#111] to-black border border-white/10 rounded-xl p-4 hover:border-[#D4AF37]/30 transition-all","data-testid":`card-menu-item-${a.id}`,children:e.jsxs("div",{className:"flex justify-between items-start",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("h4",{className:"text-white font-semibold text-sm",children:a.name}),a.description&&e.jsx("p",{className:"text-gray-500 text-xs mt-1 line-clamp-2",children:a.description})]}),d?.brandingConfig?.showPricesOnMenu!==!1&&a.price&&e.jsxs("span",{className:"text-[#D4AF37] font-bold text-sm ml-3 shrink-0",children:["$",a.price]})]})},a.id))})]},s))})})()]})]}),pt.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"border-t border-[#D4AF37]/10 my-4"}),e.jsxs("section",{ref:Kt,id:"promotions",className:"pb-8 animate-section","data-testid":"section-promotions",children:[e.jsxs("div",{className:"text-center mb-6",children:[e.jsx("h2",{className:"text-2xl font-bold text-white mb-2 animate-heading",children:"Promotions"}),e.jsx("div",{className:"w-16 h-1 bg-[#D4AF37] mx-auto rounded-full mb-3 animate-line"}),e.jsx("p",{className:"text-gray-400 text-sm",children:"Current deals and special offers"})]}),e.jsx("div",{className:"grid md:grid-cols-2 gap-4",children:pt.map(t=>e.jsxs("div",{className:"bg-gradient-to-br from-[#D4AF37]/5 to-black border border-[#D4AF37]/30 rounded-xl p-5 hover:border-[#D4AF37]/60 transition-all relative overflow-hidden","data-testid":`card-offer-${t.id}`,children:[e.jsx("div",{className:"absolute top-0 right-0 w-24 h-24 bg-[#D4AF37]/5 rounded-full -translate-y-1/2 translate-x-1/2"}),e.jsxs("div",{className:"relative",children:[e.jsxs("div",{className:"flex items-start gap-3 mb-3",children:[e.jsx("div",{className:"w-10 h-10 bg-[#D4AF37]/20 rounded-lg flex items-center justify-center shrink-0",children:e.jsx(na,{className:"w-5 h-5 text-[#D4AF37]"})}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-bold text-white","data-testid":`text-offer-title-${t.id}`,children:t.title}),t.discountPercentage&&e.jsxs(C,{className:"bg-[#D4AF37] text-black font-bold mt-1",children:[e.jsx(Cr,{className:"w-3 h-3 mr-1"}),t.discountPercentage,"% OFF"]})]})]}),t.description&&e.jsx("p",{className:"text-gray-300 text-sm mb-3","data-testid":`text-offer-desc-${t.id}`,children:t.description}),t.validUntil&&e.jsxs("p",{className:"text-xs text-gray-500 flex items-center gap-1",children:[e.jsx(yt,{className:"w-3 h-3"}),"Valid until ",new Date(t.validUntil).toLocaleDateString()]})]})]},t.id))})]})]}),Ys&&Ys.length>0&&!1,e.jsx("div",{className:"border-t border-[#D4AF37]/10 my-4"}),e.jsx("section",{ref:ut,id:K?"my-mixes":"register",className:"pb-8 animate-section","data-testid":K?"section-my-mixes":"section-register",children:K?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"text-center mb-6",children:[e.jsx("h2",{className:"text-2xl font-bold text-white mb-2 animate-heading",children:"My Saved Mixes"}),e.jsx("div",{className:"w-16 h-1 bg-[#D4AF37] mx-auto rounded-full mb-3 animate-line"}),e.jsx("p",{className:"text-gray-400 text-sm",children:"Your personal collection of custom blends"}),O&&e.jsxs(C,{className:"mt-2 bg-[#D4AF37]/20 text-[#D4AF37] border-[#D4AF37]/30",children:[e.jsx(Xe,{className:"w-3 h-3 mr-1"}),O]})]}),Ga?e.jsx("div",{className:"flex justify-center py-12",children:e.jsx(j,{className:"w-8 h-8 animate-spin text-[#D4AF37]"})}):zs.length===0?e.jsxs("div",{className:"text-center py-12 text-gray-400",children:[e.jsx(Qe,{className:"w-12 h-12 mx-auto mb-4 opacity-30"}),e.jsx("p",{className:"mb-4",children:"You haven't saved any mixes yet."}),e.jsxs(h,{onClick:()=>
2R("create"),className:"bg-[#D4AF37] text-black hover:bg-[#E5C04B]","data-testid":"button-create-first-mix",children:[e.jsx(be,{className:"w-4 h-4 mr-2"}),"Create Your First Mix"]})]}):e.jsx("div",{className:"grid md:grid-cols-2 gap-4",children:zs.map(t=>e.jsxs("div",{className:"bg-gradient-to-br from-[#111] to-black border border-[#D4AF37]/30 rounded-xl p-5","data-testid":`card-my-mix-${t.id}`,children:[e.jsxs("div",{className:"flex justify-between items-start mb-3",children:[e.jsx("h3",{className:"text-lg font-bold text-white",children:t.name}),e.jsxs(C,{className:"bg-[#D4AF37]/20 text-[#D4AF37] border-[#D4AF37]/30",children:[e.jsx(Qe,{className:"w-3 h-3 mr-1 fill-[#D4AF37]"}),"Saved"]})]}),t.createdAt&&e.jsxs("p",{className:"text-xs text-gray-500 mb-3",children:["Created: ",new Date(t.createdAt).toLocaleDateString()]}),e.jsxs("div",{className:"mb-4",children:[e.jsx("p",{className:"text-xs text-gray-500 uppercase tracking-wider mb-2",children:"Flavor Composition"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:t.flavorComposition.map((s,a)=>{const r=ge(s.flavorId),c=r?.brandId?q(r.brandId):"";return e.jsxs(C,{variant:"outline",className:"border-white/20 text-gray-300 text-xs",children:[r?.name||"Unknown",c&&e.jsxs("span",{className:"text-white/40 ml-1",children:["(",c,")"]})," ",s.percentage,"%"]},a)})})]}),e.jsxs(h,{onClick:()=>ls(t.id),className:"w-full bg-[#D4AF37] text-black hover:bg-[#E5C04B] font-semibold","data-testid":`button-order-my-mix-${t.id}`,children:[e.jsx(oe,{className:"w-4 h-4 mr-2"}),"Order This Mix"]})]},t.id))})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"text-center mb-6",children:[e.jsx("h2",{className:"text-2xl font-bold text-white mb-2 animate-heading",children:"Join Our Lounge"}),e.jsx("div",{className:"w-16 h-1 bg-[#D4AF37] mx-auto rounded-full mb-3 animate-line"}),e.jsx("p",{className:"text-gray-400 text-sm",children:"Register to save your favorite mixes and receive special offers"})]}),Na?e.jsxs("div",{className:"bg-gradient-to-br from-[#111] to-black border border-[#D4AF37]/30 rounded-xl p-6 text-center",children:[e.jsx("div",{className:"w-16 h-16 bg-[#D4AF37]/20 rounded-full flex items-center justify-center mx-auto mb-4",children:e.jsx(E,{className:"w-8 h-8 text-[#D4AF37]"})}),e.jsxs("h3",{className:"text-xl font-bold text-white mb-2",children:["Welcome to ",d.name,"!"]}),e.jsx("p",{className:"text-gray-400 mb-4",children:"You've been successfully registered. Start creating and saving your favorite mixes!"}),e.jsxs("div",{className:"flex flex-col gap-3 items-center",children:[e.jsxs(h,{onClick:()=>R("create"),className:"bg-[#D4AF37] text-black hover:bg-[#E5C04B]","data-testid":"button-start-creating",children:[e.jsx(be,{className:"w-4 h-4 mr-2"}),"Start Creating Mixes"]}),e.jsx("a",{href:"/vip/login",className:"text-[#D4AF37] hover:text-[#E5C04B] text-sm underline","data-testid":"link-vip-login",children:"Access your VIP Dashboard"})]})]}):e.jsx("div",{className:"bg-gradient-to-br from-[#111] to-black border border-white/10 rounded-xl p-5",children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsxs(F,{htmlFor:"reg-name",className:"text-gray-300 flex items-center gap-2",children:[e.jsx(Xe,{className:"w-4 h-4 text-[#D4AF37]"}),"Name *"]}),e.jsx(D,{id:"reg-name",value:ye,onChange:t=>ys(t.target.value),placeholder:"Enter your name",className:"mt-2 bg-white/5 border-white/20 text-white placeholder:text-gray-500","data-testid":"input-reg-name"})]}),e.jsxs("div",{children:[e.jsxs(F,{htmlFor:"reg-email",className:"text-gray-300 flex items-center gap-2",children:[e.jsx(la,{className:"w-4 h-4 text-[#D4AF37]"}),"Email *"]}),e.jsx(D,{id:"reg-email",type:"email",value:lt,onChange:t=>Fs(t.target.value),placeholder:"Enter your email",className:"mt-2 bg-white/5 border-white/20 text-white placeholder:text-gray-500","data-testid":"input-reg-email"})]}),e.jsxs("div",{children:[e.jsxs(F,{htmlFor:"reg-phone",className:"text-gray-300 flex items-center gap-2",children:[e.jsx(xs,{className:"w-4 h-4 text-[#D4AF37]"}),"Phone (Optional)"]}
2),e.jsx(D,{id:"reg-phone",type:"tel",value:Pt,onChange:t=>As(t.target.value),placeholder:"Enter your phone number",className:"mt-2 bg-white/5 border-white/20 text-white placeholder:text-gray-500","data-testid":"input-reg-phone"})]}),e.jsxs("div",{className:"border-t border-white/10 pt-4",children:[e.jsxs(F,{htmlFor:"reg-password",className:"text-gray-300 flex items-center gap-2",children:[e.jsx(us,{className:"w-4 h-4 text-[#D4AF37]"}),"VIP Password (Optional)"]}),e.jsx("p",{className:"text-xs text-gray-500 mt-1 mb-2",children:"Set a password to create a VIP account and access your favorites, saved mixes, and promotions from any device."}),e.jsxs("div",{className:"relative",children:[e.jsx(D,{id:"reg-password",type:Mt?"text":"password",value:Q,onChange:t=>ks(t.target.value),placeholder:"Min 6 characters",className:"bg-white/5 border-white/20 text-white placeholder:text-gray-500 pr-10","data-testid":"input-reg-password"}),e.jsx("button",{type:"button",onClick:()=>ba(!Mt),className:"absolute right-3 top-1/2 -translate-y-1/2 text-gray-400 hover:text-[#D4AF37] transition-colors","data-testid":"button-toggle-password",children:Mt?e.jsx(Dr,{className:"w-4 h-4"}):e.jsx(Sr,{className:"w-4 h-4"})})]})]}),e.jsxs("div",{className:"border-t border-white/10 pt-4 space-y-3",children:[e.jsx("p",{className:"text-sm text-gray-400 uppercase tracking-wider",children:"Notification Preferences"}),e.jsxs("div",{className:"flex items-center justify-between py-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Ee,{className:"w-4 h-4 text-[#D4AF37]"}),e.jsx("span",{className:"text-white text-sm",children:"Email Notifications"})]}),e.jsx(aa,{checked:Cs,onCheckedChange:va,"data-testid":"switch-email-notifications"})]}),e.jsxs("div",{className:"flex items-center justify-between py-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(oa,{className:"w-4 h-4 text-[#D4AF37]"}),e.jsx("span",{className:"text-white text-sm",children:"SMS Notifications"})]}),e.jsx(aa,{checked:Ds,onCheckedChange:ja,"data-testid":"switch-sms-notifications"})]})]}),e.jsxs(h,{onClick:Za,disabled:ts.isPending,className:"w-full bg-[#D4AF37] text-black hover:bg-[#E5C04B] font-semibold h-12","data-testid":"button-submit-registration",children:[ts.isPending?e.jsx(j,{className:"w-4 h-4 animate-spin mr-2"}):e.jsx(Xe,{className:"w-4 h-4 mr-2"}),"Join Now"]}),e.jsx("button",{type:"button",onClick:()=>{Ue(!0),Fe(!0)},className:"w-full text-[#D4AF37] hover:text-[#E5C04B] text-sm underline transition-colors text-center mt-2","data-testid":"button-already-customer-register",children:"Already registered?"})]})})]})})]}),e.jsx(ee,{open:M,onOpenChange:T,children:e.jsxs(te,{className:"bg-[#111] border-white/10 text-white max-w-md max-h-[90vh] flex flex-col",children:[e.jsx(W,{children:e.jsxs(J,{className:"text-xl font-bold flex items-center gap-2",children:[e.jsx(oe,{className:"w-5 h-5 text-[#D4AF37]"}),"Place Your Order"]})}),e.jsxs("div",{className:"space-y-4 py-4 overflow-y-auto flex-1",children:[$&&!P&&e.jsx("div",{className:"space-y-3",children:H?e.jsx("div",{className:"bg-yellow-500/10 rounded-lg p-3 border border-yellow-500/30",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(j,{className:"w-4 h-4 text-yellow-400 animate-spin"}),e.jsxs("div",{children:[e.jsx("span",{className:"text-yellow-400 text-sm font-medium",children:"Verifying Location..."}),e.jsx("p",{className:"text-gray-300 text-xs mt-0.5",children:"Checking if you're within the lounge area..."})]})]})}):P?e.jsx("div",{className:"bg-green-500/10 rounded-lg p-3 border border-green-500/30",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(E,{className:"w-4 h-4 text-green-400"}),e.jsxs("div",{children:[e.jsx("span",{className:"text-green-400 text-sm font-medium",children:"Location Verified"}),e.jsx("p",{className:"text-gray-300 text-xs mt-0.5",children:"You're at the lounge - proceed with your order!"})]})]})}):e.jsx("div",{className:"bg-red-500/10 rounded-lg p-4 border border-red-500/30",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(ia,{className:"w-5 h-5 text-red-400 mt-0.5"}),e.jsxs("div",{className:"flex-1",children:[e.jsx("p",{className:"text-red-400 text-sm font-semibold mb-1",children:"Location Required"}),e.jsx("p",{className:"text-gray-300 text-xs mb-3",children:bs?"You're not within the lounge area. Please visit us to place an order.":"You must enable location to verify you're at the lounge before placing an order."}),e.jsxs(h,{onClick:async()=>{await Ge()||navigator.geolocation.getCurrentPosition(async s=>{try{const r=await(await fetch(`/api/lounges/${o}/geofence-debug?lat=${s.coords.latitude}
2&lon=${s.coords.longitude}`)).json();console.log("Geofence Debug Info:",r),r.issues&&r.issues.length>0?m({title:"Location Issue Detected",description:r.issues[0]+". "+(r.recommendations[0]||"Please contact staff for assistance."),variant:"destructive"}):m({title:"Location Required",description:"You must be at the lounge to place an order. Please visit us in person.",variant:"destructive"})}catch(a){console.error("Debug fetch error:",a),m({title:"Location Required",description:"You must be at the lounge to place an order. Please visit us in person.",variant:"destructive"})}},()=>{m({title:"Location Required",description:"You must be at the lounge to place an order. Please visit us in person.",variant:"destructive"})})},disabled:H,className:"w-full bg-red-500 hover:bg-red-600 text-white font-semibold","data-testid":"button-enable-location-required",children:[H?e.jsx(j,{className:"w-4 h-4 mr-2 animate-spin"}):e.jsx(Pr,{className:"w-4 h-4 mr-2"}),H?"Checking Location...":"Try Again"]})]})]})})}),(!$||P)&&e.jsxs(e.Fragment,{children:[(()=>{if(d?.brandingConfig?.showPricesOnMenu===!1)return null;const t=d?.brandingConfig?.pricingMode,s=d?.brandingConfig?.brandPrices||{};if(t==="flat_rate"){const i=parseFloat(d?.brandingConfig?.flatRate||"0");return i<=0?null:e.jsxs("div",{className:"bg-white/5 rounded-lg p-3 border border-[#D4AF37]/20","data-testid":"order-price-summary",children:[e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsx("span",{className:"text-gray-300 text-sm",children:"Hookah"}),e.jsxs("span",{className:"text-[#D4AF37] font-bold text-lg","data-testid":"text-order-estimated-price",children:["$",i.toFixed(2)]})]}),e.jsx("p",{className:"text-gray-500 text-xs mt-1",children:"Final price may vary"})]})}if(t==="by_service"||!t){const l=d?.hookahServices?.find(u=>u.id===Re);if(l){const u=parseFloat(l.price);if(u>0)return e.jsxs("div",{className:"bg-white/5 rounded-lg p-3 border border-[#D4AF37]/20","data-testid":"order-price-summary",children:[e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsx("span",{className:"text-gray-300 text-sm",children:l.name}),e.jsxs("span",{className:"text-[#D4AF37] font-bold text-lg","data-testid":"text-order-estimated-price",children:["$",u.toFixed(2)]})]}),e.jsx("p",{className:"text-gray-500 text-xs mt-1",children:"Final price may vary"})]})}}const a=i=>i?t==="by_brand"?parseFloat(s[i.brandId]||"0"):i.showPrice!==!1&&i.pricePerSession?parseFloat(i.pricePerSession):0:0;let r=0,c="";if(me){const i=bt.find(l=>l.id===me);if(i){c=i.name;const l=i.flavorComposition.map(u=>a(ge(u.flavorId))).filter(u=>u>0);l.length>0&&(r=Math.max(...l))}}else if(x.length>0){c=B||"Custom Blend";const i=x.map(l=>a(ge(l.flavorId))).filter(l=>l>0);i.length>0&&(r=Math.max(...i))}return r<=0?null:e.jsxs("div",{className:"bg-white/5 rounded-lg p-3 border border-[#D4AF37]/20","data-testid":"order-price-summary",children:[e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsx("span",{className:"text-gray-300 text-sm",children:c}),e.jsxs("span",{className:"text-[#D4AF37] font-bold text-lg","data-testid":"text-order-estimated-price",children:["Estimated Bowl Price: $",r.toFixed(2)]})]}),e.jsx("p",{className:"text-gray-500 text-xs mt-1",children:"Each mix is one bowl"}),e.jsx("p",{className:"text-gray-500 text-xs mt-0.5",children:"Final price may vary"})]})})(),(()=>{const t=d?.hookahServices;return!t||t.length===0?null:e.jsxs("div",{"data-testid":"hookah-service-selector",children:[e.jsxs(F,{className:"text-gray-300 mb-2 block flex items-center gap-2",children:[e.jsx("span",{className:"w-6 h-6 rounded-full bg-[#D4AF37]/20 text-[#D4AF37] flex items-center justify-center text-xs font-bold",children:!$||P||I?"1":"2"}),"Select Hookah Type *"]}),e.jsx("div",{className:"grid grid-cols-1 gap-2",children:t.map(s=>e.jsxs("button",{type:"button",onClick:()=>ws(s.id),className:`flex items-center justify-between p-3 rounded-lg border transition-all text-left ${Re===s.id?"border-[#D4AF37] bg-[#D4AF37]/10":"border-white/20 bg-white/5 hover:border-white/40"}`,"data-testid":`service-option-${s.id}`,children:[e.jsxs("div",{children:[e.jsx("span",{className:`text-sm font-medium ${Re===s.id?"text-[#D4AF37]":"text-white/80"}`,children:s.name}),s.description&&e.jsx("p",{className:"text-xs text-white/40 mt-0.5",children:s.description})]}),d?.brandingConfig?.showPricesOnMenu!==!1&&e.jsxs("span",{className:"text-[#D4AF37] font-bold",children:["$",s.price]})]},s.id))})]})})(),I?e.jsxs("div",{className:"bg-green-500/10 rounded-lg p-3 border border-green-500/30","data-testid":"auto-table-confirmed",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(E,{className:"w-4 h-4 text-green-400"}),e.jsx("span",{className:"text-green-400 text-sm font-medium",children:"Table Verified"})]}),e.jsx("p",{className:"text-white font-semibold text-lg mt-1",children:I})]}):Ne&&w.trim()?e.jsxs("div",{className:"bg-green-500/10 rounded-lg p-3 border border-green-500/30","data-testid":"session-table-confirmed",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(E,{className:"w-4 h-4 text-green-400"}),e.jsx("span",{className:"text-green-400 text-sm font-medium",children:"Table Verified"})]}),e.jsxs("p",{className:"text-white font-semibold text-lg mt-1",children:["Table ",w]}),e.jsx("button",{onClick:()=>{js(!1),Ct(""),ve(null),je(null)},className:"text-xs text-gray-400 hover:text-white mt-1 underline","data-testid":"button-change-table",children:"Change table"})]}):vt?e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsxs(F,{htmlFor:"table-number",className:"text-gray-300 flex items-center gap-2",children:[e.jsx("span",{className:"w-6 h-6 rounded-full bg-[#D4AF37]/20 text-[#D4AF37] flex items-center justify-center text-xs font-bold",children:"2"}),"Enter Table Number *"]}),e.jsx(D,{id:"table-number",value:w,onChange:t=>{const s=t.target.value;kt(s),Ct(""),ve(null),nr(s)},onBlur:()=>cs(w),onKeyDown:t=>{t.key==="Enter"&&cs(w)},placeholder:"Enter your table number (e.g. 1, 5, Patio 2)",className:"mt-2 bg-white/5 border-white/20 text-white placeholder:text-gray-500","data-testid":"input-table-number"}),ps&&e.jsxs("p",{className:"text-xs text-gray-400 mt-1 flex items-center gap-1",children:[e.jsx(j,{className:"w-3 h-3 animate-spin"})," Looking up table..."]})]}),ae&&e.jsxs("div",{children:[e.jsxs("div",{className:"bg-[#D4AF37]/10 rounded-lg p-3 border border-[#D4AF37]/30 text-center mb-3",children:[e.jsx("p",{className:"text-gray-400 text-xs uppercase tracking-wider",children:"Your Table Code"}),e.jsx("p",{className:"text-3xl font-mono font-bold text-[#D4AF37] tracking-[0.3em] mt-1","data-testid":"displayed-table-code",children:ae}),Dt>0&&e.jsxs("div",{className:"flex items-center justify-center gap-2 mt-2",children:[e.jsx(Mr,{className:"w-3 h-3 text-gray-400"}),e.jsxs("p",{className:"text-xs text-gray-400",children:["Expires in ",Math.floor(Dt/60),":",String(Dt%60).padStart(2,"0")]})]})]}),e.jsx(F,{htmlFor:"table-code",className:"text-gray-300",children:"Enter the code above to confirm *"}),e.jsx(D,{id:"table-code",value:st,onChange:t=>{const s=t.target.value.replace(/\D/g,"").slice(0,4);Ct(s),ve(s===ae?!0:s.length===4?!1:null)},placeholder:"0000",maxLength:4,className:`mt-2 bg-white/5 text-white placeholder:text-gray-500 text-center text-2xl font-mono tracking-[0.5em] ${at===!0?"border-green-500":at===!1?"border-red-500":"border-white/20"}`,"data-testid":"input-table-code"}),at===!0&&e.jsxs("p",{className:"text-xs text-green-400 mt-1 flex items-center gap-1",children:[e.jsx(E,{className:"w-3 h-3"})," Code confirmed"]}),at===!1&&e.jsxs("p",{className:"text-xs text-red-400 mt-1 flex items-center gap-1",children:[e.jsx(et,{className:"w-3 h-3"})," Code does not match"]})]}),w.trim()&&!ae&&!ps&&e.jsxs("p",{className:"text-xs text-yellow-400 flex items-center gap-1",children:[e.jsx(ca,{className:"w-3 h-3"}
2)," Table not found — check the name and try again"]})]}):e.jsxs("div",{children:[e.jsx(F,{htmlFor:"table-number",className:"text-gray-300",children:"Table Number *"}),e.jsx(D,{id:"table-number",value:w,onChange:t=>kt(t.target.value),placeholder:"Enter your table number",className:"mt-2 bg-white/5 border-white/20 text-white placeholder:text-gray-500","data-testid":"input-table-number"})]}),e.jsxs("div",{children:[e.jsxs(F,{htmlFor:"order-customer-name",className:"text-gray-300 flex items-center gap-2",children:[e.jsx("span",{className:"w-6 h-6 rounded-full bg-[#D4AF37]/20 text-[#D4AF37] flex items-center justify-center text-xs font-bold",children:!$||P||I?"3":"4"}),"Your Name *"]}),e.jsx(D,{id:"order-customer-name",value:St,onChange:t=>re(t.target.value),placeholder:"Enter your name",className:"mt-2 bg-white/5 border-white/20 text-white placeholder:text-gray-500","data-testid":"input-order-customer-name"})]}),e.jsxs("div",{children:[e.jsx(F,{htmlFor:"order-notes",className:"text-gray-300",children:"Additional Notes (Optional)"}),e.jsx(D,{id:"order-notes",value:Le,onChange:t=>Ns(t.target.value),placeholder:"Any special requests...",className:"mt-2 bg-white/5 border-white/20 text-white placeholder:text-gray-500","data-testid":"input-order-notes"})]}),!me&&x.length>0&&e.jsxs("div",{className:"bg-white/5 rounded-lg p-3",children:[e.jsx("p",{className:"text-xs text-gray-400 uppercase tracking-wider mb-2",children:"Your Custom Mix"}),e.jsx("p",{className:"font-semibold text-[#D4AF37] mb-2",children:B||"Custom Blend"}),e.jsx("div",{className:"flex flex-wrap gap-1",children:x.map(t=>e.jsxs(C,{variant:"outline",className:"border-white/20 text-xs",children:[t.flavorName,(t.brandName||ie(t.flavorId))&&e.jsxs("span",{className:"text-white/40 ml-0.5",children:["· ",t.brandName||ie(t.flavorId)]})," ","(",t.percentage,"%)"]},t.flavorId))})]})]})]}),e.jsxs(le,{children:[e.jsx(h,{variant:"outline",onClick:()=>T(!1),className:"border-white/20 text-white","data-testid":"button-cancel-order",children:"Cancel"}),e.jsxs(h,{onClick:ir,disabled:Pe.isPending||$&&!P||vt&&!I&&!Ne&&ae&&st!==ae||(()=>{const t=d?.hookahServices;return!!(t&&t.length>0&&!Re)})(),className:"bg-[#D4AF37] text-black hover:bg-[#E5C04B] font-semibold","data-testid":"button-confirm-order",children:[Pe.isPending?e.jsx(j,{className:"w-4 h-4 animate-spin mr-2"}):e.jsx(E,{className:"w-4 h-4 mr-2"}),$&&!P?"Enable Location First":"Confirm Order"]})]})]})}),e.jsx(ee,{open:Ca,onOpenChange:ot,children:e.jsxs(te,{className:"bg-[#111] border-white/10 text-white max-w-md",children:[e.jsx(W,{children:e.jsxs(J,{className:"text-xl font-bold flex items-center gap-2",children:[e.jsx(gs,{className:"w-5 h-5 text-[#D4AF37]"}),"Save Your Mix"]})}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{children:[e.jsx(F,{htmlFor:"save-mix-name",className:"text-gray-300",children:"Your Name *"}),e.jsx(D,{id:"save-mix-name",value:L,onChange:t=>It(t.target.value),placeholder:"Enter your name",className:"mt-2 bg-white/5 border-white/20 text-white placeholder:text-gray-500","data-testid":"input-save-mix-name"}),e.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"This name will be associated with your saved mix."})]}),e.jsxs("div",{className:"bg-white/5 rounded-lg p-3",children:[e.jsx("p",{className:"text-xs text-gray-400 uppercase tracking-wider mb-2",children:"Mix Details"}),e.jsx("p",{className:"font-semibold text-[#D4AF37] mb-2",children:B||"Custom Blend"}),e.jsx("div",{className:"flex flex-wrap gap-1",children:x.map(t=>e.jsxs(C,{variant:"outline",className:"border-white/20 text-xs",children:[t.flavorName,(t.brandName||ie(t.flavorId))&&e.jsxs("span",{className:"text-white/40 ml-0.5",children:["· ",t.brandName||ie(t.flavorId)]})," ","(",t.percentage,"%)"]},t.flavorId))})]}),!K&&e.jsx("div",{className:"bg-[#D4AF37]/10 border border-[#D4AF37]/30 rounded-lg p-3",children:e.jsxs("p",{className:"text-sm text-[#D4AF37]",children:[e.jsx("span",{className:"font-semibold",children:"Tip:"})," Register with the lounge to easily access your saved mixes next time!"]})})]}),e.jsxs(le,{children:[e.jsx(h,{variant:"outline",onClick:()=>ot(!1),className:"border-white/20 text-white","data-testid":"button-cancel-save-mix",children:"Cancel"}),e.jsxs(h,{onClick:sr,disabled:ss.isPending,className:"bg-[#D4AF37] text-black hover:bg-[#
2E5C04B] font-semibold","data-testid":"button-confirm-save-mix",children:[ss.isPending?e.jsx(j,{className:"w-4 h-4 animate-spin mr-2"}):e.jsx(gs,{className:"w-4 h-4 mr-2"}),"Save Mix"]})]})]})}),e.jsx(ee,{open:Sa,onOpenChange:Et,children:e.jsxs(te,{className:"bg-[#111] border-white/10 text-white max-w-md",children:[e.jsx(W,{children:e.jsxs(J,{className:"text-xl font-bold flex items-center gap-2",children:[e.jsx(ca,{className:"w-5 h-5 text-[#D4AF37]"}),"No Flavors Selected"]})}),e.jsx("div",{className:"py-4",children:e.jsx("p",{className:"text-gray-300 text-sm",children:"You haven't added any flavors to your order yet. Please go back and select at least one flavor before placing your order."})}),e.jsx(le,{children:e.jsxs(h,{onClick:()=>{Et(!1),R("flavors")},className:"bg-[#D4AF37] text-black hover:bg-[#E5C04B] font-semibold","data-testid":"button-empty-order-add-flavors",children:[e.jsx(be,{className:"w-4 h-4 mr-2"}),"Add Flavors"]})})]})}),e.jsx(ee,{open:Da,onOpenChange:ct,children:e.jsxs(te,{className:"bg-[#111] border-white/10 text-white max-w-md",children:[e.jsx(W,{children:e.jsxs(J,{className:"text-xl font-bold flex items-center gap-2",children:[e.jsx(Ee,{className:"w-5 h-5 text-[#D4AF37]"}),"Before You Order"]})}),e.jsx("div",{className:"py-4",children:e.jsx("p",{className:"text-gray-300 text-sm",children:"Your mix doesn't have a name or hasn't been saved yet. Would you like to go back and add a name/save it, or continue to place your order?"})}),e.jsxs(le,{children:[e.jsx(h,{variant:"outline",onClick:()=>{ct(!1),R("create"),setTimeout(()=>{const t=document.getElementById("mix-name");t&&t.focus()},300)},className:"border-white/20 text-white","data-testid":"button-warning-go-back",children:"Go Back"}),e.jsx(h,{onClick:()=>{ct(!1),we(null),re(O||L||""),T(!0)},className:"bg-[#D4AF37] text-black hover:bg-[#E5C04B] font-semibold","data-testid":"button-warning-continue",children:"Continue to Order"})]})]})}),e.jsx(ee,{open:Pa,onOpenChange:t=>{Fe(t),t||(Ue(!1),mt(""),Ve(null),Ts(!1))},children:e.jsx(te,{className:"bg-[#111] border-[#D4AF37]/30 text-white max-w-md","data-testid":"dialog-signup-prompt",children:dt?dt&&!p?e.jsxs(e.Fragment,{children:[e.jsxs(W,{children:[e.jsxs(J,{className:"text-xl font-bold flex items-center gap-2",children:[e.jsx(ma,{className:"w-5 h-5 text-[#D4AF37]"}),"Welcome Back"]}),e.jsx(Ie,{className:"text-gray-400",children:"Enter your email to find your account"})]}),e.jsx("div",{className:"space-y-4 py-2",children:e.jsxs("div",{children:[e.jsx(F,{htmlFor:"lookup-email",className:"text-gray-300 text-sm",children:"Email Address"}),e.jsx(D,{id:"lookup-email",type:"email",value:Ye,onChange:t=>mt(t.target.value),placeholder:"Enter your email",className:"mt-1 bg-white/5 border-white/20 text-white placeholder:text-gray-500",onKeyDown:t=>{t.key==="Enter"&&(t.preventDefault(),Ye.trim()&&(xt(!0),fetch(`/api/lounges/${o}/customers/lookup`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:Ye.trim()})}).then(async s=>{if(!s.ok)throw new Error((await s.json().catch(()=>({}))).message||"Not found");return s.json()}).then(s=>Ve(s.customer)).catch(s=>m({title:"Not Found",description:s.message||"No account found with this email",variant:"destructive"})).finally(()=>xt(!1))))},"data-testid":"input-lookup-email"})]})}),e.jsxs(le,{className:"flex flex-col gap-3",children:[e.jsxs(h,{onClick:()=>{if(!Ye.trim()){m({title:"Email Required",description:"Please enter your email address.",variant:"destructive"});return}xt(!0),fetch(`/api/lounges/${o}/customers/lookup`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:Ye.trim()})}).then(async t=>{if(!t.ok)throw new Error((await t.json().catch(()=>({}))).message||"Not found");return t.json()}).then(t=>Ve(t.customer)).catch(t=>m({title:"Not Found",description:t.message||"No account found with this email",variant:"destructive"})).finally(()=>xt(!1))},disabled:$s,className:"w-full bg-[#D4AF37] text-black hover:bg-[#E5C04B] font-semibold","data-testid":"button-find-account",children:[$s?e.jsx(j,{className:"w-4 h-4 animate-spin mr-2"}):e.jsx(Ir,{className:"w-4 h-4 mr-2"}),"Find My Account"]}),e.jsx("button",{type:"button",onClick:()=>{Ue(!1),mt("")},className:"text-[#D4AF37] hover:text-[#E5C04B] text-sm underline transition-colors text-center","data-testid":"button-new-here-join",children:"New here? Join Now"})]})]}
2):dt&&p&&!Es?e.jsxs(e.Fragment,{children:[e.jsxs(W,{children:[e.jsxs(J,{className:"text-xl font-bold flex items-center gap-2",children:[e.jsx(ma,{className:"w-5 h-5 text-[#D4AF37]"}),"Welcome Back, ",p.name,"!"]}),e.jsx(Ie,{className:"text-gray-400",children:"Is this your account?"})]}),e.jsx("div",{className:"py-2",children:e.jsxs("div",{className:"bg-white/5 border border-white/10 rounded-lg p-4 space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(Xe,{className:"w-4 h-4 text-[#D4AF37] shrink-0"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-gray-500",children:"Name"}),e.jsx("p",{className:"text-white text-sm font-medium","data-testid":"text-found-name",children:p.name})]})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(la,{className:"w-4 h-4 text-[#D4AF37] shrink-0"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-gray-500",children:"Email"}),e.jsx("p",{className:"text-white text-sm font-medium","data-testid":"text-found-email",children:p.email})]})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(xs,{className:"w-4 h-4 text-[#D4AF37] shrink-0"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-gray-500",children:"Phone"}),e.jsx("p",{className:"text-white text-sm font-medium","data-testid":"text-found-phone",children:p.phone||"Not provided"})]})]}),(p.visitCount>0||p.totalSpent)&&e.jsxs("div",{className:"border-t border-white/10 pt-3 flex gap-4",children:[p.visitCount>0&&e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-gray-500",children:"Visits"}),e.jsx("p",{className:"text-[#D4AF37] font-semibold","data-testid":"text-found-visits",children:p.visitCount})]}),p.totalSpent&&Number(p.totalSpent)>0&&e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-gray-500",children:"Total Spent"}),e.jsxs("p",{className:"text-[#D4AF37] font-semibold","data-testid":"text-found-spent",children:["$",Number(p.totalSpent).toFixed(2)]})]})]})]})}),e.jsxs(le,{className:"flex flex-col gap-3",children:[e.jsxs("div",{className:"flex gap-2 w-full",children:[e.jsxs(h,{variant:"outline",onClick:()=>{Ve(null),mt("")},className:"flex-1 border-white/20 text-gray-300 hover:text-white hover:bg-white/5","data-testid":"button-not-me",children:[e.jsx($r,{className:"w-4 h-4 mr-2"}),"Not Me"]}),e.jsxs(h,{onClick:()=>Ts(!0),className:"flex-1 bg-[#D4AF37] text-black hover:bg-[#E5C04B] font-semibold","data-testid":"button-thats-me",children:[e.jsx(E,{className:"w-4 h-4 mr-2"}),"That's Me!"]})]}),e.jsx("button",{type:"button",onClick:()=>{Tt(p.name||""),Lt(p.email||""),Rt(p.phone||""),Ue(!1),Ve(null)},className:"text-gray-400 hover:text-[#D4AF37] text-xs underline transition-colors text-center","data-testid":"button-update-info",children:"Want to update your info?"})]})]}):dt&&p&&Es?e.jsx(e.Fragment,{children:e.jsxs("div",{className:"text-center py-6",children:[e.jsx("div",{className:"w-16 h-16 bg-[#D4AF37]/20 rounded-full flex items-center justify-center mx-auto mb-4",children:e.jsx(E,{className:"w-8 h-8 text-[#D4AF37]"})}),e.jsxs("h3",{className:"text-xl font-bold text-white mb-2","data-testid":"text-welcome-back",children:["Welcome back, ",p.name,"!"]}),e.jsx("p",{className:"text-gray-400 text-sm mb-6",children:"You're all set. Ready to place an order?"}),e.jsxs(h,{onClick:async()=>{localStorage.setItem(`${At}_${o}`,p.id),localStorage.setItem(`${Ze}_${o}`,p.name),it(p.id),_e(p.name);try{await fetch(`/api/lounges/${o}/customers/register`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:p.name,email:p.email,phone:p.phone||void 0,emailNotifications:!0,smsNotifications:!1})})}catch(t){console.warn("Suppressed error:",t)}Fe(!1),re(p.name||""),T(!0)},className:"bg-[#D4AF37] text-black hover:bg-[#E5C04B] font-semibold px-8","data-testid":"button-order-now",children:[e.jsx(oe,{className:"w-4 h-4 mr-2"}),"Order Now"]})]})}):null:e.jsxs(e.Fragment,{children:[e.jsxs(W,{children:[e.jsxs(J,{className:"text-xl font-bold flex items-center gap-2",children:[e.jsx(da,{className:"w-5 h-5 text-[#D4AF37]"}),"Join ",d?.name?`${d.name}'s`:"Our"," VIP List"]}),e.jsx(Ie,{className:"text-gray-400",children:"Get exclusive offers, track your favorite mixes, and enjoy VIP perks"})]}),e.jsxs("div",{className:"space-y-4 py-2",children:[e.jsxs("div",{children:[e.jsx(F,{htmlFor:"signup-name",className:"text-gray-300 text-sm",children:"Name *"}),e.jsx(D,{id:"signup-name",value:qe,onChange:t=>Tt(t.target.value),placeholder:"Enter your name",className:"mt-1 bg-white/5 border-white/20 text-white placeholder:text-gray-500","data-testid":"input-signup-name"})]}),e.jsxs("div",{children:[e.jsx(F,{htmlFor:"signup-email",className:"text-gray-300 text-sm",children:"Email *"}),e.jsx(D,{id:"signup-email",type:"email",value:Ot,onChange:t=>Lt(t.target.value),placeholder:"Enter your email",className:"mt-1 bg-white/5 border-white/20 text-white placeholder:text-gray-500","data-testid":"input-signup-email"})]}),e.jsxs("div",{children:[e.jsx(F,{htmlFor:"signup-phone",className:"text-gray-300 text-sm",children:"Phone (optional)"}),e.jsx(D,{id:"signup-phone",type:"tel",value:Ps,onChange:t=>Rt(t.target.value),placeholder:"Enter your phone number",className:"mt-1 bg-white/5 border-white/20 text-white placeholder:text-gray-500","data-testid":"input-signup-phone"})]})]}),e.jsxs(le,{className:"flex flex-col gap-3",children:[e.jsxs("div",{className:"flex gap-2 w-full sm:justify-end",children:[e.jsx(h,{variant:"ghost",onClick:()=>Fe(!1),className:"border border-white/20 text-gray-400 hover:text-white hover:bg-white/5","data-testid":"button-signup-later",children:"Maybe Later"}),e.jsxs(h,{onClick:er,disabled:Ms,className:"bg-[#D4AF37] text-black hover:bg-[#
2E5C04B] font-semibold","data-testid":"button-signup-join",children:[Ms?e.jsx(j,{className:"w-4 h-4 animate-spin mr-2"}):e.jsx(da,{className:"w-4 h-4 mr-2"}),"Join Now"]})]}),e.jsx("button",{type:"button",onClick:()=>Ue(!0),className:"text-[#D4AF37] hover:text-[#E5C04B] text-sm underline transition-colors text-center","data-testid":"button-already-customer",children:"Already registered?"})]})]})})}),e.jsx(ee,{open:Ma,onOpenChange:Os,children:e.jsxs(te,{className:"bg-[#1a1a1a] border-[#D4AF37]/30 text-white max-w-sm",children:[e.jsxs(W,{children:[e.jsx(J,{className:"text-[#D4AF37] text-center text-xl",children:"VR Tour Not Available"}),e.jsx(Ie,{className:"text-gray-400 text-center pt-2",children:"This lounge hasn't added a virtual tour yet. Check back soon!"})]}),e.jsx("div",{className:"flex justify-center pt-2",children:e.jsx(h,{onClick:()=>Os(!1),className:"bg-[#D4AF37] text-black hover:bg-[#E5C04B] font-semibold px-8","data-testid":"button-vr-unavailable-close",children:"Got It"})})]})}),e.jsx(ee,{open:Ya,onOpenChange:ze,children:e.jsxs(te,{className:"bg-[#111] border-[#D4AF37]/30 text-white max-w-sm",children:[e.jsxs(W,{children:[e.jsxs(J,{className:"text-lg font-bold flex items-center gap-2",children:[e.jsx(Y,{className:"w-5 h-5 text-[#D4AF37]"}),"Brand Preference"]}),e.jsx(Ie,{className:"text-gray-400",children:"How should AI select the remaining flavors for your mix?"})]}),e.jsxs("div",{className:"space-y-3 py-2",children:[e.jsx(h,{onClick:()=>Gs("same"),disabled:X,className:"w-full py-6 bg-gradient-to-r from-[#D4AF37]/20 to-amber-900/20 border border-[#D4AF37]/40 hover:border-[#D4AF37] text-white hover:bg-[#D4AF37]/30 transition-all","data-testid":"button-brand-same",children:e.jsxs("div",{className:"flex flex-col items-center gap-1",children:[e.jsx(Ft,{className:"w-5 h-5 text-[#D4AF37] mb-1"}),e.jsx("span",{className:"font-semibold",children:"Same Brand(s)"}),e.jsxs("span",{className:"text-xs text-gray-400 font-normal",children:["Only use flavors from ",(()=>{const t=new Set;return x.forEach(s=>{s.brandName&&t.add(s.brandName)}),t.size>0?[...t].join(" & "):"selected brands"})()]})]})}),e.jsx(h,{onClick:()=>Gs("all"),disabled:X,className:"w-full py-6 bg-gradient-to-r from-white/5 to-white/10 border border-white/20 hover:border-[#D4AF37]/60 text-white hover:bg-white/15 transition-all","data-testid":"button-brand-all",children:e.jsxs("div",{className:"flex flex-col items-center gap-1",children:[e.jsx(Y,{className:"w-5 h-5 text-amber-400 mb-1"}),e.jsx("span",{className:"font-semibold",children:"All Brands"}),e.jsx("span",{className:"text-xs text-gray-400 font-normal",children:"Mix flavors from any brand in inventory"})]})})]}),X&&e.jsxs("div",{className:"flex items-center justify-center gap-2 py-2",children:[e.jsx(j,{className:"w-4 h-4 animate-spin text-[#D4AF37]"}),e.jsx("span",{className:"text-sm text-gray-400",children:"AI is crafting your mixes..."})]})]})}),e.jsx(ee,{open:Ua,onOpenChange:he,children:e.jsxs(te,{className:"bg-[#111] border-[#D4AF37]/30 text-white max-w-lg max-h-[80vh] overflow-y-auto",children:[e.jsxs(W,{children:[e.jsxs(J,{className:"text-xl font-bold flex items-center gap-2",children:[e.jsx(Y,{className:"w-5 h-5 text-[#D4AF37]"}),"AI Mix Recommendations"]}),e.jsx(Ie,{className:"text-gray-400",children:"Based on your 2 selected flavors, here are AI-crafted mixes"})]}),Ut?.personalNote&&e.jsx("div",{className:"p-3 rounded-lg bg-[#D4AF37]/10 border border-[#D4AF37]/20",children:e.jsx("p",{className:"text-sm text-gray-300 italic",children:Ut.personalNote})}),e.jsx("div",{className:"space-y-4",children:(Ut?.recommendations||[]).map((t,s)=>e.jsxs("div",{className:"bg-white/5 border border-white/10 rounded-xl p-4 space-y-3","data-testid":`pick2-rec-${s}`,children:[e.jsx("h3",{className:"text-white font-bold text-lg",children:t.name}),t.description&&e.jsx("p",{className:"text-gray-400 text-sm",children:t.description}),t.reason&&e.jsxs("p",{className:"text-[#D4AF37]/80 text-sm italic",children:['"',t.reason,'"']}),t.ingredients&&t.ingredients.length>0&&e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("p",{className:"text-xs text-gray-500 uppercase tracking-wider",children:"Ingredients"}),t.ingredients.map((a,r)=>
2e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[e.jsxs("span",{className:"text-gray-300 flex-1",children:[a.name,a.brandName&&e.jsxs("span",{className:"text-gray-500 ml-1",children:["(",a.brandName,")"]})]}),e.jsxs("span",{className:"text-[#D4AF37] font-mono text-xs",children:[a.percentage,"%"]}),e.jsx("div",{className:"w-16 h-1.5 bg-white/5 rounded-full overflow-hidden",children:e.jsx("div",{className:"h-full rounded-full bg-gradient-to-r from-[#D4AF37] to-amber-500",style:{width:`${a.percentage}%`}})})]},r))]}),e.jsxs(h,{onClick:()=>rr(t),className:"w-full bg-[#D4AF37] text-black hover:bg-[#E5C04B] font-semibold","data-testid":`button-use-pick2-mix-${s}`,children:[e.jsx(oe,{className:"w-4 h-4 mr-2"}),"Use This Mix"]})]},s))}),e.jsx(le,{children:e.jsx(h,{variant:"outline",onClick:()=>he(!1),className:"border-white/20 text-white","data-testid":"button-close-pick2-dialog",children:"Close"})})]})}),ue?.isVip&&ue?.vipMemberId&&e.jsxs(e.Fragment,{children:[e.jsx(br,{onClick:()=>Ls(!0),unreadCount:Ja?.count||0}),e.jsx(vr,{isOpen:Ia,onClose:()=>Ls(!1),currentUserType:"vip_member",currentUserId:ue.vipMemberId,currentUserName:ue.vipMemberName||"VIP Member"})]}),A&&e.jsx("div",{className:"fixed top-[60px] left-0 right-0 z-40 bg-gradient-to-r from-[#D4AF37]/20 via-amber-900/30 to-[#D4AF37]/20 border-b border-[#D4AF37]/40 backdrop-blur-md px-4 py-2","data-testid":"pick2-floating-bar",children:e.jsxs("div",{className:"container mx-auto flex items-center justify-between gap-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Y,{className:"w-4 h-4 text-[#D4AF37] shrink-0"}),e.jsx("span",{className:"text-[#D4AF37] text-sm font-semibold",children:"Pick 2 Mode"}),e.jsxs(C,{className:"bg-[#D4AF37]/20 text-[#D4AF37] border-[#D4AF37]/30 text-xs",children:[Math.min(x.length,2),"/2"]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[x.length===2&&e.jsxs(h,{size:"sm",onClick:()=>ze(!0),disabled:X,className:"bg-[#D4AF37] text-black hover:bg-[#E5C04B] font-semibold h-7 text-xs px-3","data-testid":"button-floating-ai-complete",children:[X?e.jsx(j,{className:"w-3 h-3 mr-1 animate-spin"}):e.jsx(Y,{className:"w-3 h-3 mr-1"}),"AI Complete"]}),e.jsx(h,{size:"sm",variant:"ghost",onClick:()=>{He(!1),ke(null)},className:"text-gray-400 hover:text-white h-7 text-xs px-2","data-testid":"button-floating-cancel-pick2",children:e.jsx(et,{className:"w-3 h-3"})})]})]})}),e.jsx("div",{className:"fixed bottom-0 left-0 right-0 z-40 flex justify-center pointer-events-none",style:{paddingBottom:"max(env(safe-area-inset-bottom, 0px), 1.5rem)"},children:e.jsxs("div",{className:"flex items-center gap-2 sm:gap-3 bg-black/80 backdrop-blur-xl border border-white/15 rounded-2xl px-3 sm:px-5 py-2.5 sm:py-3 shadow-2xl shadow-black/60 pointer-events-auto",children:[lr&&e.jsxs("button",{onClick:()=>{if($&&!P){m({title:"Location Required",description:"Verifying your location... please wait.",variant:"destructive"}),H||Ge();return}x.length>0&&pe===100?ar():(we(null),re(O||L||""),T(!0))},className:`group flex flex-col items-center gap-1 cursor-pointer bg-transparent border-none p-0 ${$&&!P?"opacity-50":""}`,"data-testid":"button-order-now",children:[e.jsx("div",{className:"w-10 h-10 sm:w-12 sm:h-12 rounded-xl bg-gradient-to-br from-emerald-500 to-green-600 flex items-center justify-center shadow-lg shadow-emerald-600/30 group-hover:scale-110 transition-transform",children:e.jsx(Er,{className:"w-4 h-4 sm:w-5 sm:h-5 text-white"})}),e.jsx("span",{className:"text-[9px] sm:text-[10px] font-semibold text-white/70 tracking-wide",children:"Order"})]}),e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"w-px h-8 sm:h-10 bg-white/10"}),e.jsxs("button",{onClick:()=>{if(Se){if($&&!P){m({title:"Location Required",description:"Verifying your location... please wait.",variant:"destructive"}),H||Ge();return}Rs(!0)}},className:`group flex flex-col items-center gap-1 bg-transparent border-none p-0 ${Se?`cursor-pointer ${$&&!P?"opacity-50":""}`:"opacity-30 cursor-not-allowed"}`,"data-testid":"button-call-server",disabled:!Se,children:[e.jsx("div",{className:`w-10 h-10 sm:w-12 sm:h-12 rounded-xl flex items-center justify-center shadow-lg transition-transform ${Se?"bg-gradient-to-br from-[#D4AF37] to-[#B8962E] shadow-[#D4AF37]/30 group-hover:scale-110":"bg-gray-700/50 shadow-none"}`,children:e.jsx(Ee,{className:`w-4 h-4 sm:w-5 sm:h-5 ${Se?"text-black":"text-gray-500"}`})}),e.jsx("span",{className:`text-[9px] sm:text-[10px] font-semibold tracking-wide ${Se?"text-white/70":"text-white/30"}`,children:"Call Server"})]})]}),or&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"w-px h-8 sm:h-10 bg-white/10"}),e.jsxs(Nt,{href:`/lounge/${o}/virtual-menu`,className:"group flex flex-col items-center gap-1 no-underline","data-testid":"button-virtual-menu",children:[e.jsx("div",{className:"w-10 h-10 sm:w-12 sm:h-12 rounded-xl bg-gradient-to-br from-cyan-400 to-blue-600 flex items-center justify-center shadow-lg shadow-cyan-500/30 group-hover:scale-110 transition-transform",children:e.jsx(Tr,{className:"w-4 h-4 sm:w-5 sm:h-5 text-white"})}),e.jsx("span",{className:"text-[9px] sm:text-[10px] font-semibold text-white/70 tracking-wide",children:"VR Promo"})]})]}),cr&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"w-px h-8 sm:h-10 bg-white/10"}),e.jsxs(Nt,{href:`/lounge/${o}/table-tent`,className:"group flex flex-col items-center gap-1 no-underline","data-testid":"button-table-tent",children:[e.jsx("div",{className:"w-10 h-10 sm:w-12 sm:h-12 rounded-xl bg-gradient-to-br from-amber-500 to-orange-600 flex items-center justify-center shadow-lg shadow-amber-500/30 group-hover:scale-110 transition-transform",children:e.jsx(Or,{className:"w-4 h-4 sm:w-5 sm:h-5 text-white"})}),e.jsx("span",{className:"text-[9px] sm:text-[10px] font-semibold text-white/70 tracking-wide",children:"Table Tent"})]})]}),dr.map((t,s)=>e.jsxs("span",{className:"contents",children:[e.jsx("div",{className:"w-px h-8 sm:h-10 bg-white/10"}
2),e.jsxs("a",{href:t.url,target:t.url.startsWith("http")?"_blank":void 0,rel:t.url.startsWith("http")?"noopener noreferrer":void 0,className:"group flex flex-col items-center gap-1 no-underline","data-testid":`button-cta-${s}`,children:[e.jsx("div",{className:"w-10 h-10 sm:w-12 sm:h-12 rounded-xl bg-gradient-to-br from-[#D4AF37] to-[#B8962E] flex items-center justify-center shadow-lg shadow-[#D4AF37]/30 group-hover:scale-110 transition-transform",children:s===0?e.jsx(Ee,{className:"w-4 h-4 sm:w-5 sm:h-5 text-black"}):e.jsx($e,{className:"w-4 h-4 sm:w-5 sm:h-5 text-black"})}),e.jsx("span",{className:"text-[9px] sm:text-[10px] font-semibold text-white/70 tracking-wide max-w-[48px] truncate text-center",children:t.label})]})]},`cta-${s}`))]})}),e.jsx(ee,{open:Ta,onOpenChange:t=>{Rs(t),t||(Bt(new Set),qt(!1))},children:e.jsxs(te,{className:"sm:max-w-md bg-[#0a0a0f] border-[#D4AF37]/30 p-0 overflow-hidden",children:[e.jsx("div",{className:"bg-gradient-to-r from-[#D4AF37] to-[#E5C04B] px-6 py-3",children:e.jsx("h2",{className:"text-lg font-black text-black",children:"Call Server"})}),e.jsxs("div",{className:"px-6 py-5 space-y-4",children:[e.jsxs("div",{className:"flex items-end gap-2",children:[!I&&!Ne?e.jsxs("div",{className:"flex-1",children:[e.jsx(F,{className:"text-xs text-gray-400 mb-1.5 block",children:"Your Table"}),e.jsx(D,{value:_t,onChange:t=>Oa(t.target.value.toUpperCase()),placeholder:"e.g. A or 5",className:"bg-black/50 border-gray-700 text-white text-center text-lg font-bold font-mono"})]}):e.jsx("div",{className:"flex-1 bg-green-500/10 rounded-lg p-3 border border-green-500/30",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(E,{className:"w-4 h-4 text-green-400"}),e.jsxs("span",{className:"text-green-400 text-sm font-medium",children:["Table ",I||w]})]})}),e.jsxs(h,{onClick:async()=>{const t=I||(Ne?w:_t.trim());if(!(!t||Ae.size===0)){qt(!0);try{const s=Array.from(Ae);for(const r of s){const c=await fetch(`/api/lounges/${o}/call-server`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({tableNumber:t,requestType:r})});if(c.status===429){m({title:"Rate limited — some requests may not have been sent",variant:"destructive"});break}if(!c.ok){const i=await c.json().catch(()=>({}));throw new Error(i.message||"Failed")}}const a=s.map(r=>[{id:"check",label:"Check"},{id:"hookah_refill",label:"Refill"},{id:"drink_order",label:"Drink"},{id:"water",label:"Water/Tea"},{id:"coal_change",label:"Coal"},{id:"custom",label:"Other"}].find(i=>i.id===r)?.label||r);m({title:"Sent!",description:`${a.join(", ")} — staff notified.`}),Bt(new Set)}catch(s){m({title:"Failed to call server",description:s instanceof Error?s.message:void 0,variant:"destructive"})}finally{qt(!1)}}},disabled:_s||Ae.size===0||!(I||(Ne?w:_t.trim())),className:"bg-[#D4AF37] hover:bg-[#E5C04B] text-black font-bold h-12 px-5 shrink-0","data-testid":"button-send-call-server",children:[_s?e.jsx(j,{className:"w-4 h-4 animate-spin"}):e.jsx(Ee,{className:"w-4 h-4 mr-1"}),"Send",Ae.size>0?` (${Ae.size})`:""]})]}),e.jsx("div",{className:"grid grid-cols-2 gap-3",children:(Bs.length>0?Bs:[{id:"check",label:"Get My Check"},{id:"hookah_refill",label:"Hookah Refill"},{id:"drink_order",label:"Order Drink"},{id:"water",label:"Water / Tea"},{id:"coal_change",label:"Coal Change"},{id:"custom",label:"Other"}]).map(t=>{const a={check:Ft,hookah_refill:wt,drink_order:oe,water:Lr,coal_change:hs,custom:oa}[t.id]||Ee,r=Ae.has(t.id);return e.jsxs("button",{onClick:()=>{Bt(c=>{const i=new Set(c);return i.has(t.id)?i.delete(t.id):i.add(t.id),i})},className:`flex flex-col items-center justify-center p-4 border rounded-xl transition-all active:scale-95 ${r?"bg-[#D4AF37]/15 border-[#D4AF37] text-[#D4AF37]":"bg-black/50 border-gray-800 text-gray-300 hover:border-[#D4AF37]/50 hover:text-[#D4AF37]"}`,"data-testid":`callserver-${t.id}`,children:[e.jsx(a,{size:28,className:"mb-2"}),e.jsx("span",{className:"text-xs font-medium",children:t.label}),r&&e.jsx(E,{className:"w-3.5 h-3.5 mt-1"})]},t.id)})})]})]})}),Ra&&Vs.length>
20&&e.jsx(Rr,{vrTours:Vs,vrActiveIndex:Ba,setVrActiveIndex:qa,vrViewerRef:Ha,vrContainerRef:Va,onClose:()=>_a(!1)}),e.jsx(Nr,{isOpen:$a,onClose:()=>Ea(!1),lounge:{name:d?.name||"",logoUrl:d?.brandingConfig?.logoUrl,hookahServices:d?.hookahServices,operatingHours:typeof d?.operatingHours=="object"?d?.operatingHours:void 0},flavors:ft,brands:Zt,mixes:bt.filter(t=>t.isPublic),menuItems:Je,offers:pt,influencerMixes:gt,onOpenAR:d?.arMenuConfig?.enabled?()=>{window.location.href=`/lounge/${o}/ar-camera`}:void 0}),e.jsx("style",{children:`
3        @keyframes sectionFadeIn {
4          from { opacity: 0; transform: translateY(30px); }
5          to { opacity: 1; transform: translateY(0); }
6        }
7        @keyframes lineGrow {
8          from { transform: scaleX(0); }
9          to { transform: scaleX(1); }
10        }
11        .animate-section {
12          opacity: 0;
13          transform: translateY(30px);
14          transition: opacity 0.6s ease-out, transform 0.6s ease-out;
15        }
16        .animate-section.section-visible {
17          opacity: 1;
18          transform: translateY(0);
19        }
20        .animate-section.section-visible .animate-heading {
21          animation: sectionFadeIn 0.5s ease-out both;
22        }
23        .animate-section.section-visible .animate-line {
24          transform-origin: center;
25          animation: lineGrow 0.6s ease-out 0.2s both;
26        }
27      `})]})}export{rn as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.