PageSourceSearch

https://hospitalityb2b.co.uk/assets/ExhibitorContact-CJyx2nLd.js

js hospitalityb2b.co.uk collected 2026-09-30 04:17:48 UTC 11,545 bytes, 1 lines download raw bytes

1import{j as e}from"./vendor-ui-Bwz2KwBC.js";import{b3 as B,b4 as P,aK as L,B as F,a2 as w,I as $,aG as q,a3 as O,X,L as Y,s as d,v,i as U,p as J,_ as K,$ as V,q as z,a as Z,b as G,c as H,d as Q,e as W,bv as D,N as ee,bu as A,P as te,F as se}from"./index-Yxar46Qa.js";import{r as c,f as re}from"./vendor-react-B-LUs8MM.js";import"./vendor-dnd-BwFBceOp.js";import"./vendor-editor-B92hpOiY.js";import{c as ae}from"./vendor-data-D3rmSUoE.js";import{b as ie}from"./exhibitorAuth-DUODtFsL.js";import{u as oe,t as ne}from"./zod-DXTOmXJy.js";import"./vendor-charts-C9IGNkSd.js";const le=B({subject:P().min(5,"Subject must be at least 5 characters").max(200),message:P().min(10,"Message must be at least 10 characters").max(5e3)}),M=({exhibitorId:b})=>{const[s,N]=c.useState(!1),[h,g]=c.useState([]),[_,x]=c.useState([]),[f,y]=c.useState(null),{register:E,handleSubmit:C,formState:{errors:j},reset:I}=oe({resolver:ne(le)}),l=r=>{if(r.target.files){const t=Array.from(r.target.files);g(a=>[...a,...t]),x(a=>[...a,...t.map(()=>0)])}},p=r=>{g(t=>t.filter((a,i)=>i!==r)),x(t=>t.filter((a,i)=>i!==r))},m=async()=>{const r=[];for(let t=0;t<h.length;t++){const a=h[t],i=a.name.split(".").pop(),o=`${b}/${Date.now()}-${Math.random().toString(36).substring(7)}.${i}`;x(T=>{const k=[...T];return k[t]=50,k});const{data:n,error:S}=await d.storage.from("support-attachments").upload(o,a);if(S)throw console.error("Error uploading file:",S),v.error(`Failed to upload ${a.name}: ${S.message}`),new Error(`Failed to upload ${a.name}`);const{data:{publicUrl:R}}=d.storage.from("support-attachments").getPublicUrl(o);r.push(R),x(T=>{const k=[...T];return k[t]=100,k})}return r},u=async r=>{N(!0);try{let t=[];h.length>0&&(t=await m());const{data:a,error:i}=await d.from("support_tickets").insert({exhibitor_id:b,subject:r.subject,message:r.message,attachment_urls:t,ticket_number:""}).select().maybeSingle();if(i)throw i;const{error:o}=await d.functions.invoke("send-support-ticket-email",{body:{ticketNumber:a.ticket_number,exhibitorId:b,subject:r.subject,message:r.message,attachmentUrls:t}});o?(console.error("Error sending email:",o),v.error("Ticket created but email notification failed")):v.success(`Support ticket #${a.ticket_number} submitted successfully!`),y(a.ticket_number),I(),g([]),x([])}catch(t){console.error("Error submitting support ticket:",t);let a="Unable to Submit Ticket",i="",o="";if(t instanceof Error){const n=t.message.toLowerCase();n.includes("network")||n.includes("fetch")||n.includes("failed to fetch")?(a="Connection Error",i="Unable to connect to the server.",o="Please check your internet connection and try again."):n.includes("timeout")?(a="Request Timeout",i="The server took too long to respond.",o="Please wait a moment and try again."):n.includes("upload")||n.includes("file")?(a="File Upload Failed",i=t.message,o="Please try removing the attachments and submitting again, or use smaller files."):n.includes("rate limit")||n.includes("too many")?(a="Too Many Requests",i="You've made too many submissions in a short time.",o="Please wait a few minutes before trying again."):n.includes("server")||n.includes("500")||n.includes("internal")?(a="Server Error",i="Something went wrong on our end.",o="Please try again later. If the problem persists, contact support."):n.includes("duplicate")||n.includes("already exists")?(a="Duplicate Submission",i="A similar ticket may have already been submitted.",o="Please check your email for confirmation or try again with a different subject."):(i=t.message,o="Please try again. If the problem continues, contact us directly.")}else i="An unexpected error occurred while submitting your ticket.",o="Please try again. If the problem continues, contact us directly.";v.error(a,{description:`${i} ${o}`,duration:8e3})}finally{N(!1)}};return f?e.jsxs("div",{className:"flex flex-col items-center justify-center py-12 px-4 text-center",children:[e.jsx("div",{className:"mb-6",children:e.jsx(L,{className:"w-20 h-20 text-green-500 mx-auto"})}),e.jsx("h2",{className:"text-2xl font-bold mb-2 text-foreground",children:"Ticket Submitted Successfully!"}),e.jsxs("div",{className:"bg-primary/10 border-2 border-primary rounded-lg p-6 mb-6 max-w-md",children:[e.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:"Your Ticket Number"}),e.jsxs("p",{className:"text-3xl font-bold text-primary",children:["#",f]})]}),e.jsx("p",{className:"text-muted-foreground mb-6 max-w-md",children:"Your support ticket has been submitted and sent to our customer service team. You will receive a copy of this ticket via email. Please reference this ticket number in any future correspondence."}),e.jsx(F,{onClick:()=>y(null),children:"Submit Another Ticket"})]}):e.jsxs("form",{onSubmit:C(u),className:"space-y-6",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(w,{htmlFor:"subject",children:"Subject *"}),e.jsx($,{id:"subject",...E("subject"),placeholder:"Brief description of your issue",disabled:s,className:"bg-background"}),j.subject&&e.jsx("p",{className:"text-sm text-destructive",children:j.subject.message})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(w,{htmlFor:"message",children:"Message *"}),e.jsx(q,{id:"message",...E("message"),placeholder:"Please provide detailed information about your inquiry or issue...",rows:8,disabled:s,className:"bg-background"}),j.message&&e.jsx("p",{className:"text-sm text-destructive",children:j.message.message})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(w,{htmlFor:"attachments",children:"Attachments (Optional)"}),e.jsxs("div",{className:"border-2 border-dashed border-border rounded-lg p-6 text-center hover:border-primary/50 transition-colors",children:[e.jsx("input",{type:"file",id:"attachments",multiple:!0,onChange:l,disabled:s,className:"hidden"}),e.jsxs("label",{htmlFor:"attachments",className:"cursor-pointer flex flex-col items-center justify-center",children:[e.jsx(O,{className:"w-10 h-10 text-muted-foreground mb-2"}),e.jsx("span",{className:"text-sm text-muted-foreground",children:"Click to upload files or drag and drop"}),e.jsx("span",{className:"text-xs text-muted-foreground mt-1",children:"PDF, DOC, DOCX, JPG, PNG (Max 10MB each)"})]})]}),h.length>0&&e.jsx("div",{className:"mt-4 space-y-2",children:h.map((r,t)=>e.jsxs("div",{className:"flex items-center justify-between bg-muted p-3 rounded-lg",children:[e.jsx("span",{className:"text-sm text-foreground truncate flex-1",children:r.name}),e.jsx(F,{type:"button",variant:"ghost",size:"sm",onClick:()=>p(t),disabled:s,children:e.jsx(X,{className:"w-4 h-4"})})]},t))})]}),e.jsx(F,{type:"submit",disabled:s,className:"w-auto",children:s?e.jsxs(e.Fragment,{children:[e.jsx(Y,{className:"mr-2 h-4 w-4 animate-spin"}),"Submitting Ticket..."]}
1):"Submit Support Ticket"}),e.jsx("p",{className:"text-xs text-muted-foreground text-center",children:"* Required fields. A ticket number will be generated for tracking purposes."})]})},fe=()=>{const b=re(),[s,N]=c.useState({}),[h,g]=c.useState(!1),[_,x]=c.useState([]),[f,y]=c.useState(""),[E,C]=c.useState([]);c.useEffect(()=>{(async()=>{const p=sessionStorage.getItem("impersonation_token"),m=sessionStorage.getItem("impersonation_refresh");let u=d;p&&m&&(u=ae("https://difofdwmqtxwuaiqhjvd.supabase.co","eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImRpZm9mZHdtcXR4d3VhaXFoanZkIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NjgyODU3OTMsImV4cCI6MjA4Mzg2MTc5M30.GWtUZpjXokpwRfYDXmKhwQe0pum9KejOwgzvuKcypuc",{auth:{storage:{getItem:()=>null,setItem:()=>{},removeItem:()=>{}},persistSession:!1,autoRefreshToken:!1}}),await u.auth.setSession({access_token:p,refresh_token:m}));const{data:{session:r}}=await u.auth.getSession();if(!r){b("/exhibitor-portal/login");return}if(!p||!m){const{data:i}=await d.from("user_roles").select("role").eq("user_id",r.user.id).in("role",["admin","customer_service","project_manager"]),o=!!(i&&i.length>0);if(g(o),o){const{data:n,error:S}=await d.from("exhibitors").select("id, name, booth_number").eq("is_active",!0).order("name");!S&&n&&(x(n),n.length>0&&y(n[0].id));return}}else g(!1);const{data:t,error:a}=await ie(r.user.id,"id, name, booth_number, logo_url",u);a&&console.error("Error fetching exhibitor:",a),N(t||{id:void 0,name:void 0,booth_number:void 0,logo_url:void 0})})(),j()},[b]);const j=async()=>{try{const{data:l,error:p}=await d.from("user_roles").select("user_id").eq("role","customer_service");if(p||!l||l.length===0)return;const{data:m,error:u}=await d.from("user_profiles").select("display_name, meeting_url, email").in("user_id",l.map(r=>r.user_id));if(u)return;m&&m.length>0&&C(m.map(r=>({name:r.display_name||"Client Relations Manager",email:r.email||"",meetingUrl:r.meeting_url||""})))}catch(l){console.error("Exception in loadClientRelationsManagers:",l)}},I=[{id:"contact-title",component:e.jsx("section",{className:"py-12",children:e.jsxs("div",{className:"container mx-auto px-4",children:[e.jsx(U,{pageName:"exhibitor-contact",sectionName:"title",contentKey:"heading",defaultValue:"Contact Client Relations",className:"text-4xl font-bold mb-4 text-foreground",as:"h1"}),e.jsx(U,{pageName:"exhibitor-contact",sectionName:"title",contentKey:"description",defaultValue:"Submit a support ticket and our client relations team will get back to you as soon as possible.",className:"text-lg text-muted-foreground max-w-3xl",as:"p"})]})})},{id:"contact-form",component:e.jsx("section",{className:"pb-12",children:e.jsx("div",{className:"container mx-auto px-4",children:e.jsxs(J,{className:"max-w-3xl",children:[e.jsx(K,{children:e.jsx(V,{children:"Submit a Support Ticket"})}),e.jsx(z,{children:h?e.jsx(e.Fragment,{children:_.length>0?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"mb-6 p-4 bg-primary/10 border border-primary/20 rounded-lg",children:[e.jsxs("p",{className:"text-sm text-muted-foreground mb-3",children:[e.jsx("strong",{children:"Admin Mode:"})," Select an exhibitor to submit a ticket on their behalf"]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(w,{htmlFor:"exhibitor-select",children:"Select Exhibitor"}),e.jsxs(Z,{value:f,onValueChange:y,children:[e.jsx(G,{id:"exhibitor-select",className:"bg-background",children:e.jsx(H,{placeholder:"Choose an exhibitor"})}),e.jsx(Q,{children:_.map(l=>e.jsxs(W,{value:l.id,children:[l.name," ",l.booth_number?`(Stand #${l.booth_number})`:""]},l.id))})]})]})]}),f&&e.jsx(M,{exhibitorId:f})]}):e.jsx("p",{className:"text-muted-foreground",children:"No active exhibitors found"})}):s.id?e.jsx(M,{exhibitorId:s.id}):e.jsx("p",{className:"text-muted-foreground",children:"Loading..."})})]})})})}];return e.jsxs(e.Fragment,{children:[e.jsx(D,{children:e.jsx("title",{children:"Contact the Team | Exhibitor Portal"})}),e.jsxs("div",{className:"min-h-screen flex flex-col",children:[e.jsx(ee,{}),e.jsx("main",{className:"flex-1 pt-page pb-12",children:e.jsx("div",{className:"container mx-auto px-6",children:e.jsxs("div",{className:"flex gap-8 mt-[60px]",children:[e.jsx("aside",{className:"w-64 flex-shrink-0 sticky top-24 h-fit hidden lg:block",children:e.jsx(A,{exhibitorName:s==null?void 0:s.name,standNumber:s==null?void 0:s.booth_number,logoUrl:s==null?void 0:s.logo_url,renderTrigger:!1,alwaysVisible:!0})}),e.jsx("div",{className:"lg:hidden fixed top-20 left-4 z-50",children:e.jsx(A,{exhibitorName:s==null?void 0:s.name,standNumber:s==null?void 0:s.booth_number,logoUrl:s==null?void 0:s.logo_url,renderTrigger:!0})}),e.jsx("div",{className:"flex-1 min-w-0",children:e.jsx(te,{pageName:"exhibitor-contact",sections:I})})]})})}),e.jsx(se,{})]})]})};export{fe 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.