1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8518],{82090:(e,t,a)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/event-management/[id]",function(){return a(56015)}])},56015:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>k});var s=a(74848),n=a(86715),r=a(96540),i=a(38869),l=a(87583),c=a(88734),d=a(43033),o=a(13552),m=a(20047),x=a(90497),u=a(62636);let h=()=>{let e=JSON.parse(sessionStorage.getItem("user")||"{}"),t=sessionStorage.getItem("memberType");return{"Content-Type":"application/json",user:JSON.stringify(e),"user-type":t}};function p(e){let{eventId:t,ticketTypes:a=[]}=e,[n,l]=(0,r.useState)([]),[c,d]=(0,r.useState)({total:0,unused:0,reserved:0,used:0}),[o,m]=(0,r.useState)(!0),[p,g]=(0,r.useState)(!1),[y,b]=(0,r.useState)(30),[v,f]=(0,r.useState)(50),[_,N]=(0,r.useState)([]),[j,k]=(0,r.useState)(""),[w,E]=(0,r.useState)(""),[T,I]=(0,r.useState)(null),[A,C]=(0,r.useState)(!1),S=(0,r.useMemo)(()=>(a||[]).filter(e=>Number(e.price)>0),[a]),P=(0,x.h1)(n),D=async()=>{m(!0);try{let e=await fetch("/api/event-vouchers?eventId=".concat(encodeURIComponent(t)),{headers:h()}),a=await e.json();if(!e.ok)throw Error(a.error||"Could not load vouchers");l(a.vouchers||[]),d(a.stats||{total:0,unused:0,reserved:0,used:0})}catch(e){u.Ay.error(e.message||"Could not load vouchers")}finally{m(!1)}};(0,r.useEffect)(()=>{t&&D()},[t]),(0,r.useEffect)(()=>{var e;if(!S.length||_.length)return;let t=S.map(e=>e.name).filter(e=>/member/i.test(e)&&!/organisation|corporate|table|student/i.test(e));N(t.length?t:S.map(e=>e.name)),!w&&(null===(e=S[0])||void 0===e?void 0:e.name)&&E(S[0].name)},[S,_.length,w]),(0,r.useEffect)(()=>{P<1||b(e=>{let t=Number(e);return!Number.isFinite(t)||t<1?Math.min(30,P):Math.min(t,P)})},[P]);let O=e=>{N(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},R=async e=>{e.preventDefault(),g(!0);try{let e=await fetch("/api/event-vouchers/generate",{method:"POST",headers:h(),body:JSON.stringify({eventId:t,count:Number(y),percentOff:Number(v),ticketNames:_})}),a=await e.json();if(!e.ok)throw Error(a.error||"Could not generate vouchers");l(a.vouchers||[]),d(a.stats),u.Ay.success("Created ".concat(a.createdCount," voucher").concat(1===a.createdCount?"":"s"))}catch(e){u.Ay.error(e.message||"Could not generate vouchers")}finally{g(!1)}},B=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=e?n.filter(e=>"unused"===e.status):n;if(!t.length){u.Ay.error(e?"No unused vouchers to download":"No vouchers to download");return}let a=new Blob([(0,x.PT)(t)],{type:"text/csv;charset=utf-8;"}),s=URL.createObjectURL(a),r=document.createElement("a");r.href=s,r.download=e?"event-vouchers-unused.csv":"event-vouchers.csv",r.click(),URL.revokeObjectURL(s)},L=async e=>{e.preventDefault(),C(!0),I(null);try{let e=S.find(e=>e.name===w),a=await fetch("/api/event-vouchers/dry-run",{method:"POST",headers:h(),body:JSON.stringify({eventId:t,code:j,ticketName:w,unitPrice:null==e?void 0:e.price})}),s=await a.json();if(I(s),!a.ok)throw Error(s.error||"Code is not valid");u.Ay.success("Would charge \xa3".concat(Number(s.discountedUnitPrice).toFixed(2)))}catch(e){u.Ay.error(e.message||"Dry run failed")}finally{C(!1)}};return(0,s.jsxs)("div",{className:"bg-white rounded-lg shadow-sm p-6 mb-8",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-4 mb-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h2",{className:"text-lg font-semibold text-gray-900",children:"One-time vouchers"}),(0,s.jsxs)("p",{className:"text-sm text-gray-600 mt-1",children:["Unique codes for this event only. Cap ",x.cf,". A code is marked used after a successful payment."]})]}),(0,s.jsxs)("button",{type:"button",onClick:D,className:"flex items-center px-3 py-2 text-sm border border-gray-300 rounded-lg hover:bg-gray-50",children:[(0,s.jsx)(i.jTZ,{className:"mr-2"}),"Refresh"]})]}),(0,s.jsx)("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3 mb-6",children:[["Total",c.total],["Unused",c.unused],["Reserved",c.reserved],["Used",c.used]].map(e=>{let[t,a]=e;return(0,s.jsxs)("div",{className:"bg-gray-50 rounded-lg p-3",children:[(0,s.jsx)("div",{className:"text-sm text-gray-600",children:t}),(0,s.jsx)("div",{className:"text-2xl font-semibold text-[#13344E]",children:a})]},t)})}),(0,s.jsxs)("form",{onSubmit:R,className:"border border-gray-200 rounded-lg p-4 mb-6 space-y-4",children:[(0,s.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"How many"}),(0,s.jsx)("input",{type:"number",min:"1",max:P||1,value:y,onChange:e=>b(e.target.value),className:"w-full border rounded p-2"}),(0,s.jsxs)("p",{className:"text-xs text-gray-500 mt-1",children:[P," left before the cap"]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Percent off"}),(0,s.jsx)("input",{type:"number",min:"1",max:"100",value:v,onCh
1ange:e=>f(e.target.value),className:"w-full border rounded p-2"})]}),(0,s.jsx)("div",{className:"flex items-end",children:(0,s.jsx)("button",{type:"submit",disabled:p||P<1,className:"w-full px-4 py-2 bg-[#EE5B00] text-white rounded-lg hover:bg-[#D44D00] disabled:bg-gray-400",children:p?"Generatingâ¦":"Generate vouchers"})})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("span",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Valid on ticket types"}),(0,s.jsxs)("div",{className:"flex flex-wrap gap-3",children:[S.map(e=>(0,s.jsxs)("label",{className:"inline-flex items-center text-sm",children:[(0,s.jsx)("input",{type:"checkbox",checked:_.includes(e.name),onChange:()=>O(e.name),className:"mr-2"}),e.name," (\xa3",e.price,")"]},e.name)),!S.length&&(0,s.jsx)("p",{className:"text-sm text-gray-500",children:"Add paid ticket types on this event first."})]})]})]}),(0,s.jsxs)("form",{onSubmit:L,className:"bg-gray-50 rounded-lg p-4 mb-6",children:[(0,s.jsx)("h3",{className:"font-medium text-gray-900 mb-2",children:"Dry run a code"}),(0,s.jsx)("p",{className:"text-sm text-gray-600 mb-3",children:"Checks the code against Salesforce without reserving it."}),(0,s.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-3",children:[(0,s.jsx)("input",{type:"text",value:j,onChange:e=>k(e.target.value.toUpperCase()),placeholder:"AFBE-XXXXXX",className:"border rounded p-2"}),(0,s.jsx)("select",{value:w,onChange:e=>E(e.target.value),className:"border rounded p-2",children:S.map(e=>(0,s.jsxs)("option",{value:e.name,children:[e.name," (\xa3",e.price,")"]},e.name))}),(0,s.jsx)("button",{type:"submit",disabled:A||!j,className:"px-4 py-2 border border-gray-300 rounded-lg hover:bg-white disabled:bg-gray-200",children:A?"Checkingâ¦":"Test code"})]}),T&&(0,s.jsx)("p",{className:"text-sm mt-3 ".concat(T.valid?"text-green-700":"text-red-600"),children:T.valid?"".concat(T.code,": ").concat(T.percentOff,"% off â \xa3").concat(Number(T.discountedUnitPrice).toFixed(2)," (was \xa3").concat(Number(T.originalUnitPrice).toFixed(2),")"):T.error})]}),(0,s.jsxs)("div",{className:"flex flex-wrap gap-3 mb-4",children:[(0,s.jsxs)("button",{type:"button",onClick:()=>B(!1),className:"flex items-center px-4 py-2 bg-white text-gray-700 border border-gray-300 rounded-lg hover:bg-gray-50",children:[(0,s.jsx)(i.a4x,{className:"mr-2"}),"Download all CSV"]}),(0,s.jsxs)("button",{type:"button",onClick:()=>B(!0),className:"flex items-center px-4 py-2 bg-white text-gray-700 border border-gray-300 rounded-lg hover:bg-gray-50",children:[(0,s.jsx)(i.a4x,{className:"mr-2"}),"Download unused CSV"]})]}),o?(0,s.jsx)("p",{className:"text-sm text-gray-500",children:"Loading vouchersâ¦"}):0===n.length?(0,s.jsx)("p",{className:"text-sm text-gray-500",children:"No vouchers yet. Generate a batch to get started."}):(0,s.jsx)("div",{className:"overflow-x-auto max-h-80 border border-gray-200 rounded-lg",children:(0,s.jsxs)("table",{className:"min-w-full text-sm",children:[(0,s.jsx)("thead",{className:"bg-gray-50 sticky top-0",children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{className:"text-left p-2",children:"Code"}),(0,s.jsx)("th",{className:"text-left p-2",children:"%"}),(0,s.jsx)("th",{className:"text-left p-2",children:"Status"}),(0,s.jsx)("th",{className:"text-left p-2",children:"Used by"})]})}),(0,s.jsx)("tbody",{children:n.map(e=>(0,s.jsxs)("tr",{className:"border-t",children:[(0,s.jsx)("td",{className:"p-2 font-mono",children:e.code}),(0,s.jsx)("td",{className:"p-2",children:e.percentOff}),(0,s.jsx)("td",{className:"p-2 capitalize",children:e.status}),(0,s.jsx)("td",{className:"p-2 text-gray-600",children:e.usedByEmail||"â"})]},e.code))})]})})]})}var g=a(94335),y=a(14953),b=a.n(y),v=a(97147),f=a(47686),_=a(32940);let N=b()(()=>a.e(5527).then(a.bind(a,65527)),{loadableGenerated:{webpack:()=>[65527]},ssr:!1,loading:()=>(0,s.jsx)("p",{children:"Loading editor..."})}),j={date:"2024-06-15",time:"09:00 AM",location:"London Conference Center",description:"Join us for a day of discussions and networking focused on diversity in engineering.",status:"active",registrations:[{id:1,name:"John Doe",email:"[email protected]",ticketType:"General Admission",registrationDate:"2024-03-15",checkedIn:!1},{id:2,name:"Jane Smith",email:"[email protected]",ticketType:"VIP",registrationDate:"2024-03-14",checkedIn:!0},{id:3,name:"Bob Johnson",email:"[email protected]",ticketType:"General Admission",registrationDate:"2024-03-13",checkedIn:!1}]};function k(){var e,t;let a=(0,n.useRouter)(),{id:h}=a.query,[y,b]=(0,r.useState)(!0),[k,w]=(0,r.useState)(""),[E,T]=(0,r.useState)(!1),[I,A]=(0,r.useState)({title:"",date:"",time:"",endDate:"",endTime:"",eventType:"offline",location:"",onlineLink:"",description:"",capacity:"",image:null,isPaid:!1,eventOrganiser:"",ticketTypes:[],speakers:[],showOnWebsite:!0,displayOnHomePageEvents:!1,useTotalCapacityOnly:!1}),[C,S]=(0,r.useState)({totalRegistrations:0,ticketSales:0,checkInRate:0}),[P,D]=(0,r.useState)([]),[O,R]=(0,r.useState)([]),[B,L]=(0,r.useState)(!1),[U,M]=(0,r.useState)([]),[F,z]=(0,r.useState)([]),[G,V]=(0,r.useState)(!1),[J,K]=(0,r.useState)(!1),[q,Q]=(0,r.useState)(null),[W,H]=(0,r.useState)(null),[X,Y]=(0,r.useState)(!1),[$,Z]=(0,r.useState)({current:0,total:0,currentName:""}),[ee,et]=(0,r.useState)(!1),[ea,es]=(0,r.useState)(null),[en,er]=(0,r.useState)({}),[ei,el]=(0,r.useState)(!1),[ec,ed]=(0,r.useState)({email:"N/A",name:"N/A"}),[eo,em]=(0,r.useState)(!1);(0,r.useEffect)(()=>{let e=async()=>{try{let c=JSON.parse(sessionStorage.getItem("user")),d=sessionStorage.getItem("memberType");if(!c){a.push("/members/login");return}if("SUPER_ADMIN"!==d){a.push("/login");return}let m=(await g.A.get("/api/getAccessToken")).data.access_token,x=await g.A.get("/api/queryUserEvents?userId=".concat(c.Id,"&allEvents=true"),{headers:{Authorization:"Bearer ".concat(m)}});if(x.data&&x.data.records){let a=x.data.records.find(e=>e.Id===h);if(a){var e,t,s,n,r,i,l;let c=a.Event_Createdby_Email__c||null;c||(c=(null===(n=a.CreatedBy)||void 0===n?void 0:n.Email)||null),
1c||(c=(null===(r=a.CreatedBy)||void 0===r?void 0:r.Username)||null),c||(c=(null===(i=a.CreatedBy)||void 0===i?void 0:i.PersonEmail)||(null===(l=a.CreatedBy)||void 0===l?void 0:l.Email__c)||null);let d=c||"Email not available",x=(null===(e=a.CreatedBy)||void 0===e?void 0:e.Name)||"Unknown";ed({email:d,name:x});let u=a.Event_Start_Date_Time__c,p=a.Event_End_Date_Time__c,y=p&&p!==u;A({title:a.Event_Title__c,date:(null==u?void 0:u.split("T")[0])||"",time:(null==u?void 0:null===(t=u.split("T")[1])||void 0===t?void 0:t.substring(0,5))||"",endDate:y&&(null==p?void 0:p.split("T")[0])||"",endTime:y&&(null==p?void 0:null===(s=p.split("T")[1])||void 0===s?void 0:s.substring(0,5))||"",eventType:a.Event_Type__c||"offline",location:a.Venue_Name__c||"",onlineLink:a.Event_Link_URL__c||"",description:a.Event_Overview__c||"",capacity:a.Number_of_Tickets_For_Event__c||"",image:a.Event_Picture_URL__c,isPaid:!!a.EventTickets__c&&JSON.parse(a.EventTickets__c).length>0,eventOrganiser:a.Event_Organiser__c||"",ticketTypes:a.EventTickets__c?JSON.parse(a.EventTickets__c):[],speakers:(0,o.As)(a.EventSpeakers__c),showOnWebsite:"true"!==String(a.Hide_From_Listing_c__c||"").toLowerCase().trim(),displayOnHomePageEvents:!0===a.Display_on_home_page_events__c,useTotalCapacityOnly:"true"===String(a.Use_Total_Capacity_Only__c||"").toLowerCase().trim()});let b=await g.A.get("/api/queryEventOrders?eventIds=".concat(a.Id),{headers:{Authorization:"Bearer ".concat(m)}});if(b.data&&b.data.records){console.log("All orders fetched:",b.data.records),console.log("Total orders:",b.data.records.length);let e=b.data.records.filter(e=>"No"===e.Paid__c||0===e.Amount_Paid__c||"Free"===e.Payment_Method__c);console.log("Free event orders:",e);let t=b.data.records,s=t.length,n=t.reduce((e,t)=>e+(t.Amount_Paid__c||0),0),r=t.filter(e=>"Checked In"===e.Check_In_Status__c).length;S({totalRegistrations:s,ticketSales:n,checkInRate:s>0?r/s*100:0});let i=(a.EventTickets__c?JSON.parse(a.EventTickets__c):[]).map(e=>{let a=t.filter(t=>t.Ticket_Type__c===e.name&&"REGISTERED"===t.Attendee_Status__c),s=a.length,n=Math.max(0,(e.quantity||0)-s),r=a.reduce((e,t)=>e+(t.Amount_Paid__c||0),0);return{...e,sold:s,remaining:n,revenue:r}});D(i);let l=t.map(e=>{var t,a,s;return{id:e.Id,name:e.Attendee_Name__c,email:e.Attendee_Email__c,phone:e.Attendee_Phone__c,companyInstitution:e.Attendee_Company_Institution__c,ticketType:e.Ticket_Type__c,ticketPrice:e.Ticket_Price__c,amountPaid:e.Amount_Paid__c,paymentStatus:e.Paid__c,paymentMethod:e.Payment_Method__c,paymentVia:e.Payment_via_website_Telephone_In_person__c,orderDate:e.Order_Date__c,orderType:e.Order_Type__c,orderDescription:e.Order_Description__c,orderValue:e.Order_Value__c,stripeCustomerId:e.Stripe_Customer_ID__c,stripePaymentIntentId:e.StripePaymentIntentID__c,isRecurring:e.Is_Recurring__c,eventId:e.Event__c,attendeeStatus:e.Attendee_Status__c,checkInStatus:"Not Checked In",checkInTime:null,dietaryRequirements:null,specialAssistance:null,additionalNotes:null,registrationDate:null===(t=e.Order_Date__c)||void 0===t?void 0:t.split("T")[0],registrationTime:null===(s=e.Order_Date__c)||void 0===s?void 0:null===(a=s.split("T")[1])||void 0===a?void 0:a.substring(0,5)}}),c=JSON.parse(localStorage.getItem("checkIn_".concat(h))||"{}"),d=l.map(e=>{let t=c[e.id];return t?{...e,checkInStatus:t.status,checkInTime:t.time}:e});R(d)}}}b(!1)}catch(e){console.error("Error fetching event details:",e),u.Ay.error("An error occurred while fetching event details."),b(!1)}};h&&e()},[h]);let ex=e=>{let{name:t,value:a,type:s,checked:n}=e.target;if("date"===t){let e=new Date;if(e.setDate(e.getDate()+1),e.setHours(0,0,0,0),new Date(a)<e){u.Ay.error("Event date must be tomorrow or later");return}}A(e=>({...e,[t]:"checkbox"===s?n:a}))},eu=(e,t,a)=>{let s=[...I.ticketTypes];if(s[e]={...s[e],[t]:a},"onlyForMembers"===t&&a&&(s[e].hasLoggedInPrice=!0,s[e].loggedInPrice=s[e].price,s[e].isEarlyBird&&(s[e].loggedInEarlyBirdPrice=s[e].earlyBirdPrice)),"groupSize"===t){let t=parseInt(s[e].quantity)||0;(parseInt(a)||0)>t&&(u.Ay.error("Group size cannot exceed ticket quantity (".concat(t,")")),s[e].groupSize=t)}"price"===t&&s[e].hasLoggedInPrice&&(s[e].loggedInPrice=a),"earlyBirdPrice"===t&&s[e].hasLoggedInPrice&&s[e].isEarlyBird&&(s[e].loggedInEarlyBirdPrice=a),A(e=>({...e,ticketTypes:s}))},eh=async()=>
1{if(I.endDate||I.endTime){let e=I.endDate||I.date,t=I.endTime||I.time;if(!e||!t){u.Ay.error("If you set an end date or time, both end date and end time are required");return}let a=new Date("".concat(I.date,"T").concat(I.time));if(new Date("".concat(e,"T").concat(t))<a){u.Ay.error("End date and time must be on or after start date and time");return}}b(!0);try{let e=JSON.parse(sessionStorage.getItem("user")),t=(await g.A.get("/api/getAccessToken")).data.access_token,a=I.endDate&&I.endTime?"".concat(I.endDate,"T").concat(I.endTime):"".concat(I.date,"T").concat(I.time),s=I.description||"",n={Event_Title__c:I.title,Name:(0,m.f)(I.title,m.R.Name),Unique_Event_URL_Title__c:(0,m.f)(I.title,m.R.Unique_Event_URL_Title__c),Event_Type__c:I.eventType,Number_of_Tickets_For_Event__c:I.capacity,Event_Start_Date_Time__c:"".concat(I.date,"T").concat(I.time),Event_End_Date_Time__c:a,Event_Overview__c:(0,m.f)(s,m.R.Event_Overview__c),Event_Introduction__c:(0,m.f)(s,m.R.Event_Introduction__c),Event_Link_URL__c:I.onlineLink,Venue_Name__c:I.location,Event_Picture_URL__c:(0,m.f)(I.image||"",m.R.Event_Picture_URL__c),Hide_From_Listing_c__c:I.showOnWebsite?"false":"true",Display_on_home_page_events__c:I.displayOnHomePageEvents,Use_Total_Capacity_Only__c:I.useTotalCapacityOnly?"true":"false",Event_Related_To_Account_Id__c:e.Id,EventTickets__c:JSON.stringify(I.ticketTypes),EventSpeakers__c:(0,o.XJ)(I.speakers),Event_Organiser__c:I.eventOrganiser,OrganisationId__c:e.Id},r=await g.A.post("/api/updateEvent",{eventId:h,...n},{headers:{Authorization:"Bearer ".concat(t)}});r.data.success?(u.Ay.success("Event updated successfully"),T(!1)):u.Ay.error(r.data.message||"An error occurred while updating the event")}catch(l){var e,t,a,s,n,r;console.error("Error updating event:",l);let i=(null===(t=l.response)||void 0===t?void 0:null===(e=t.data)||void 0===e?void 0:e.message)||(null===(r=l.response)||void 0===r?void 0:null===(n=r.data)||void 0===n?void 0:null===(s=n.error)||void 0===s?void 0:null===(a=s[0])||void 0===a?void 0:a.message)||"An error occurred while updating the event";u.Ay.error("string"==typeof i?i:"An error occurred while updating the event")}b(!1)},ep=async e=>{var t;let a=e.currentTarget,s=null==a?void 0:null===(t=a.files)||void 0===t?void 0:t[0];if(s){if(s.size>5242880){u.Ay.error("Image size should be less than 5MB"),a.value="";return}if(!s.type.startsWith("image/")){u.Ay.error("Please upload an image file"),a.value="";return}em(!0);try{let e=await new Promise((e,t)=>{let a=new FileReader;a.onloadend=()=>{if(a.error){t(a.error);return}e(a.result)},a.onerror=()=>t(a.error||Error("File read failed")),a.readAsDataURL(s)}),t=await fetch("/api/uploadFile",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({file:e})}),a={};try{a=await t.json()}catch(e){a={}}if(!t.ok||!a.success){let e=a.error||a.message||"Failed to upload image. Please try again.";u.Ay.error("string"==typeof e?e:"Failed to upload image.");return}A(e=>({...e,image:a.url})),u.Ay.success("Image uploaded successfully")}catch(e){console.error("Error uploading image:",e),u.Ay.error("An error occurred while uploading the image")}finally{em(!1),a.value=""}}},eg=e=>{let t=e.split("\n"),a=t[0].split(",").map(e=>e.trim().replace(/"/g,"")),s=[];for(let e=1;e<t.length;e++)if(t[e].trim()){let n=t[e].split(",").map(e=>e.trim().replace(/"/g,""));if(n.length>=a.length){let e={};a.forEach((t,a)=>{e[t]=n[a]||""}),s.push(e)}}M(s),z(s)},ey=async()=>{var e,t,a,s;if(0===F.length){u.Ay.error("No data to import");return}V(!0);try{JSON.parse(sessionStorage.getItem("user"));let a=(await g.A.get("/api/getAccessToken")).data.access_token,s="batch_".concat(Date.now()),n=[];for(let r=0;r<F.length;r++){let i=F[r],l=null,c="NON_MEMBER";try{let e=await g.A.get("/api/getUserIDByEmail?email=".concat(encodeURIComponent(i.email)),{headers:{Authorization:"Bearer ".concat(a)}});e.data.success&&0!==e.data.Id&&(l=e.data.Id,c="a0y4K000000U9IdQAK"===e.data.Membership_Subcategory__c?"INDIVIDUAL":"a0y4K000000U9IcQAK"===e.data.Membership_Subcategory__c?"STUDENT":_.k.includes(e.data.Membership_Subcategory__c)?"ORGANISATION":"NON_MEMBER")}catch(e){console.log("No account found for email:",i.email)}let d={Paid__c:"Yes",Account__c:l,Amount_Paid__c:parseFloat(i.amountPaid)||0,Payment_via_website_Telephone_In_person__c:"Import",Payment_Method__c:i.paymentMethod||"COD",Order_Date__c:i.orderDate||new Date().toISOString().split("T")[0],Order_Type__c:"EVENT_TICKET_PAYMENT",Order_Description__c:"Imported from ".concat(i.source||"External"," - ").concat(i.attendeeName),Order_Value__c:parseFloat(i.ticketPrice)||0,Stripe_Customer_ID__c:null,StripePaymentIntentID__c:"import_".concat(s,"_").concat(String(r).padStart(4,"0")),Is_Recurring__c:!1,Event__c:h,Attendee_Name__c:i.attendeeName,Attendee_Email__c:i.email,Attendee_Phone__c:i.phone||null,Ticket_Type__c:i.ticketType,Ticket_Price__c:parseFloat(i.ticketPrice)||0,Attendee_Status__c:"REGISTERED"};try{await g.A.post("/api/createOrderRecord",d,{headers:{Authorization:"Bearer ".concat(a)}}),n.push({row:r+1,name:i.attendeeName,email:i.email,status:"success",memberType:c})}catch(a){n.push({row:r+1,name:i.attendeeName,email:i.email,status:"error",error:(null===(t=a.response)||void 0===t?void 0:null===(e=t.data)||void 0===e?void 0:e.message)||"Unknown error"})}}let r=n.filter(e=>"success"===e.status).length,i=n.filter(e=>"error"===e.status).length;u.Ay.success("Import completed: ".concat(r," successful, ").concat(i," errors")),window.location.reload()}catch(e){console.error("Import error:",e),u.Ay.error("Import failed: "+((null===(s=e.response)||void 0===s?void 0:null===(a=s.data)||void 0===a?void 0:a.message)||e.message))}finally{V(!1),L(!1)}},eb=e=>{let t="Checked In"===e.checkInStatus?"Not Checked In":"Checked In",a="Checked In"===t?new Date().toISOString():null;R(s=>s.map(s=>s.id===e.id?{...s,checkInStatus:t,checkInTime:a}:s));let s=JSON.parse(localStorage.getItem("checkIn_".concat(h))||"{}");s[e.id]={status:t,time:a,attendeeName:e.name,ticketType:e.ticketType},localStorage.setItem("checkIn_".concat(h),JSON.stringify(s)),u.Ay.success("Status updated to: ".concat(t))},ev=async()=>{let e="Tendayi Munyebvu",t="[email protected]",a="[email protected]";if(window.confirm('â ï¸ This will swap email addresses for "'.concat(e,'":\n- "').concat(t,'" â "').concat(a,'"\n- "').concat(a,'" â "').concat(t,'"\n\nContinue?'))){b(!0);try{let t=await g.A.post("/api/bulkUpdateAttendeeEmail",{eventId:h,targetName:e});t.data.success?(u.Ay.success(t.data.message||"Updated ".concat(t.data.updated," registration(s)")),window.location.reload()):u.Ay.error(t.data.message||"Failed to update emails")}catch(e){var s,n;console.error("Error updating attendee emails:",e),u.Ay.error((null===(n=e.response)||void 0===n?void 0:null===(s=n.data)||void 0===s?void 0:s.message)||"An error occurred while updating emails")}finally{b(!1)}}},ef=async()=>{let e="[email protected]";if(window.confirm('â ï¸ WARNING: This will permanently delete ALL registrations with email:\n"'.concat(e,'"\n\nThis action CANNOT be undone. Are you absolutely sure?'))&&window.confirm('This is your final confirmation. All registrations with email "'.concat(e,'" will be deleted. Click OK to proceed.'))){b(!0);try{let t=await g.A.delete("/api/deleteOrdersByEmail",{data:{eventId:h,email:e}});t.data.success?(u.Ay.success(t.data.message),R([]),localStorage.removeItem("checkIn_".concat(h)),window.location.reload()):u.Ay.error(t.data.message||"Failed to delete registrations")}catch(e){var t,a;console.error("Error deleting orders by email:",e),u.Ay.error((null===(a=e.response)||void 0===a?void 0:null===(t=a.data)||void 0===t?void 0:t.message)||"An error occurred while deleting registrations")}finally{b(!1)}}},e_=async()=>
1{if(window.confirm("â ï¸ WARNING: This will permanently delete ALL registrations for this event from the database. This action CANNOT be undone. Are you absolutely sure you want to continue?")&&window.confirm("This is your final confirmation. Type YES in the console or click OK to proceed with deleting all registrations.")){b(!0);try{JSON.parse(sessionStorage.getItem("user"));let e=(await g.A.get("/api/getAccessToken")).data.access_token,t=await g.A.delete("/api/deleteEventOrders?eventId=".concat(h),{headers:{Authorization:"Bearer ".concat(e)}});t.data.success&&(u.Ay.success(t.data.message),R([]),localStorage.removeItem("checkIn_".concat(h)),window.location.reload())}catch(a){var e,t;console.error("Error deleting registrations:",a),u.Ay.error("Failed to delete registrations: "+((null===(t=a.response)||void 0===t?void 0:null===(e=t.data)||void 0===e?void 0:e.message)||a.message))}finally{b(!1)}}},eN=async e=>{let t={eventId:h,eventName:I.title,ticketId:e.stripePaymentIntentId||e.id,attendeeName:e.name,attendeeEmail:e.email,ticketType:e.ticketType,eventDate:I.date,venue:I.location};try{let e=await l.toDataURL(JSON.stringify(t),{width:200,margin:2,color:{dark:"#13344E",light:"#FFFFFF"}});Q(t),H(e),K(!0)}catch(e){console.error("Error generating QR code:",e),u.Ay.error("Failed to generate QR code")}},ej=e=>{es(e),er({Attendee_Name__c:e.name||"",Attendee_Email__c:e.email||"",Attendee_Phone__c:e.phone||"",Ticket_Type__c:e.ticketType||"",Ticket_Price__c:e.ticketPrice||"",Amount_Paid__c:e.amountPaid||"",Payment_Method__c:e.paymentMethod||"",Payment_via_website_Telephone_In_person__c:e.paymentVia||"",Attendee_Status__c:e.attendeeStatus||"REGISTERED"}),et(!0)},ek=()=>{et(!1),es(null),er({})},ew=e=>{let{name:t,value:a}=e.target;er(e=>({...e,[t]:a}))},eE=async()=>{if(ea){el(!0);try{JSON.parse(sessionStorage.getItem("user"));let e=(await g.A.get("/api/getAccessToken")).data.access_token,t={};Object.keys(en).forEach(e=>{null!==en[e]&&void 0!==en[e]&&""!==en[e]&&(t[e]=en[e])}),(await g.A.patch("/api/updateOrderRecord",{orderId:ea.id,updateData:t},{headers:{Authorization:"Bearer ".concat(e)}})).data.success?(u.Ay.success("Registration updated successfully"),R(e=>e.map(e=>e.id===ea.id?{...e,name:en.Attendee_Name__c||e.name,email:en.Attendee_Email__c||e.email,phone:en.Attendee_Phone__c||e.phone,ticketType:en.Ticket_Type__c||e.ticketType,ticketPrice:en.Ticket_Price__c||e.ticketPrice,amountPaid:en.Amount_Paid__c||e.amountPaid,paymentMethod:en.Payment_Method__c||e.paymentMethod,paymentVia:en.Payment_via_website_Telephone_In_person__c||e.paymentVia,attendeeStatus:en.Attendee_Status__c||e.attendeeStatus}:e)),ek()):u.Ay.error("Failed to update registration")}catch(e){console.error("Error updating registration:",e),u.Ay.error("An error occurred while updating the registration")}finally{el(!1)}}},eT=async e=>{if(window.confirm("Are you sure you want to delete the registration for ".concat(e.name," (").concat(e.email,")? This action cannot be undone.")))try{b(!0);let t=(await g.A.get("/api/getAccessToken")).data.access_token;if((await g.A.delete("/api/deleteOrder?orderId=".concat(e.id),{headers:{Authorization:"Bearer ".concat(t)}})).data.success){u.Ay.success("Registration deleted successfully"),R(t=>t.filter(t=>t.id!==e.id));let a=JSON.parse(sessionStorage.getItem("user")),s=await g.A.get("/api/queryUserEvents?userId=".concat(a.Id,"&allEvents=true"),{headers:{Authorization:"Bearer ".concat(t)}});if(s.data&&s.data.records){let e=s.data.records.find(e=>e.Id===h);if(e){let a=await g.A.get("/api/queryEventOrders?eventIds=".concat(e.Id),{headers:{Authorization:"Bearer ".concat(t)}});if(a.data&&a.data.records){let e=a.data.records,t=e.length,s=e.reduce((e,t)=>e+(t.Amount_Paid__c||0),0),n=e.filter(e=>"Checked In"===e.Check_In_Status__c).length;S({totalRegistrations:t,ticketSales:s,checkInRate:t>0?n/t*100:0});let r=e.map(e=>{var t,a,s;return{id:e.Id,name:e.Attendee_Name__c,email:e.Attendee_Email__c,phone:e.Attendee_Phone__c,ticketType:e.Ticket_Type__c,ticketPrice:e.Ticket_Price__c,amountPaid:e.Amount_Paid__c,paymentStatus:e.Paid__c,paymentMethod:e.Payment_Method__c,paymentVia:e.Payment_via_website_Telephone_In_person__c,orderDate:e.Order_Date__c,orderType:e.Order_Type__c,orderDescription:e.Order_Description__c,orderValue:e.Order_Value__c,stripeCustomerId:e.Stripe_Customer_ID__c,stripePaymentIntentId:e.StripePaymentIntentID__c,isRecurring:e.Is_Recurring__c,eventId:e.Event__c,attendeeStatus:e.Attendee_Status__c,checkInStatus:"Not Checked In",checkInTime:null,dietaryRequirements:null,specialAssistance:null,additionalNotes:null,registrationDate:null===(t=e.Order_Date__c)||void 0===t?void 0:t.split("T")[0],registrationTime:null===(s=e.Order_Date__c)||void 0===s?void 0:null===(a=s.split("T")[1])||void 0===a?void 0:a.substring(0,5)}}),i=JSON.parse(localStorage.getItem("checkIn_".concat(h))||"{}"),l=r.map(e=>{let t=i[e.id];return t?{...e,checkInStatus:t.status,checkInTime:t.time}:e});R(l)}}}}else u.Ay.error("Failed to delete registration")}catch(e){console.error("Error deleting registration:",e),u.Ay.error("An error occurred while deleting the registration")}finally{b(!1)}};return j.registrations.filter(e=>e.name.toLowerCase().includes(k.toLowerCase())||e.email.toLowerCase().includes(k.toLowerCase())),(0,s.jsxs)(c.A,{isLoad:y,children:[(0,s.jsx)("div",{className:"",children:(0,s.jsxs)("div",{className:"max-w-7xl mx-auto",children:[(0,s.jsxs)("div",{className:"flex flex-col justify-start mb-8",children:[(0,s.jsxs)("button",{onClick:()=>{a.push("/admin/event-management")},className:"flex items-center text-gray-600 mb-2 hover:text-[#EE5B00] mr-4",children:[(0,s.jsx)(i.kRp,{className:"mr-2"}),"Back to Events"]}),(0,s.jsxs)("div",{className:"flex justify-between items-center",children:[(0,s.jsx)("h1",{className:"font-extrabold text-[30px] leading-[42px] tracking-[0.01em] text-left mb-2 text-[#13344E]",children:E?"Edit Event":I.title}),(0,s.jsxs)("div",{className:"flex flex-col items-end gap-3",children:[(0,s.jsx)("div",{className:"rounded-md border border-gray-200 bg-gray-50 px-4 py-3 max-w-xl",children:(0,s.jsxs)("label",{className:"flex items-start gap-3 ".concat(E?"cursor-pointer":""),children:[(0,s.jsx)("input",{type:"checkbox",name:"displayOnHomePageEvents",checked:I.displayOnHomePageEvents,onChange:ex,disabled:!E,className:"mt-1 form-checkbox text-[#EE5B00]"}),(0,s.jsxs)("span",{children:[(0,s.jsx)("span",{className:"block text-sm font-medium text-gray-800",children:"Show on homepage upcoming events"}),(0,s.jsx)("span",{className:"block text-sm text-gray-600 mt-0.5",children:"When checked, this event can appear in the upcoming events section on the homepage (future dates only)."})]})]})}),(0,s.jsxs)("button",{onClick:()=>E?eh():T(!0),className:"flex items-center px-4 py-2 bg-[#EE5B00] text-white rounded-lg hover:bg-[#D44D00]",children:[(0,s.jsx)(i.Bc_,{className:"mr-2"}),E?"Save Changes":"Edit Event"]})]})]})]}),(0,s.jsx)("div",{className:"bg-white rounded-lg shadow-sm p-6 mb-8",children:(0,s.jsxs)("div",{className:"space-y-6",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700",children:"Event Title"}),(0,s.jsx)("input",{type:"text",name:"title",value:I.title,onChange:ex,disabled:!E,className:"w-full border rounded p-2"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700",children:"Event Organiser"}),(0,s.jsx)("input",{type:"text",name:"eventOrganiser",value:I.eventOrganiser,onChange:ex,disabled:!E,className:"w-full border rounded p-2"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700",children:"Listing status"}),(0,s.jsx)("p",{className:"text-sm text-gray-500 mb-2",children:"Inactive events do not appear on the public event listing. You can switch this after publishing."}),(0,s.jsxs)("select",{name:"showOnWebsite",value:I.showOnWebsite?"active":"inactive",onChange:e=>A(t=>({...t,showOnWebsite:"active"===e.target.value})),disabled:!E,className:"w-full border rounded p-2 max-w-xs",children:[(0,s.jsx)("option",{value:"active",children:"Active (show on event listing)"}),(0,s.jsx)("option",{value:"inactive",children:"Inactive (hide from event listing)"})]})]}),(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Start date and time"}),(0,s.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs text-gray-500 mb-1",children:"Date"}),(0,s.jsx)("input",{type:"date",name:"date",value:I.date,onChange:ex,min:(()=>{let e=new Date;return e.setDate(e.getDate()+1),e.toISOString().split("T")[0]})(),disabled:!E,className:"w-full border rounded p-2"}),(0,s.jsx)("p",{className:"text-sm text-gray-500 mt-1",children:"Event must be scheduled for tomorrow or later"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs text-gray-500 mb-1",children:"Time"}),(0,s.jsx)("input",{type:"time",name:"time",value:I.time,onChange:ex,disabled:!E,className:"w-full border rounded p-2"})]})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:["End date and time ",(0,s.jsx)("span",{className:"text-gray-400 font-normal",children:"(optional)"})]}),(0,s.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs text-gray-500 mb-1",children:"End date"}),(0,s.jsx)("input",{type:"date",name:"endDate",value:I.endDate,onChange:ex,min:I.date||void 0,disabled:!E,className:"w-full border rounded p-2"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs text-gray-500 mb-1",children:"End time"}),(0,s.jsx)("input",{type:"time",name:"endTime",value:I.endTime,onChange:ex,disabled:!E,className:"w-full border rounded p-2"})]})]}),(0,s.jsx)("p",{className:"text-sm text-gray-500 mt-1",children:"Leave empty to use the same as start date and time"})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700",children:"Event Type"}),(0,s.jsxs)("div",{className:"mt-2 space-x-4",children:[(0,s.jsxs)("label",{className:"inline-flex items-center",children:[(0,s.jsx)("input",{type:"radio",name:"eventType",value:"offline",checked:"offline"===I.eventType,onCh
1ange:ex,disabled:!E,className:"form-radio text-[#EE5B00]"}),(0,s.jsx)("span",{className:"ml-2",children:"In person"})]}),(0,s.jsxs)("label",{className:"inline-flex items-center",children:[(0,s.jsx)("input",{type:"radio",name:"eventType",value:"online",checked:"online"===I.eventType,onChange:ex,disabled:!E,className:"form-radio text-[#EE5B00]"}),(0,s.jsx)("span",{className:"ml-2",children:"Online"})]})]})]}),"offline"===I.eventType?(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700",children:"Location"}),(0,s.jsx)("input",{type:"text",name:"location",value:I.location,onChange:ex,disabled:!E,className:"w-full border rounded p-2"})]}):(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700",children:"Online Event Link"}),(0,s.jsx)("input",{type:"url",name:"onlineLink",value:I.onlineLink,onChange:ex,disabled:!E,placeholder:"https://",className:"w-full border rounded p-2"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700",children:"Capacity"}),(0,s.jsx)("input",{type:"number",name:"capacity",value:I.capacity,onChange:ex,disabled:!E,className:"w-full border rounded p-2"})]}),(null===(e=I.ticketTypes)||void 0===e?void 0:e.length)>0&&(0,s.jsxs)("div",{children:[(0,s.jsxs)("label",{className:"inline-flex items-center",children:[(0,s.jsx)("input",{type:"checkbox",checked:I.useTotalCapacityOnly,onChange:e=>A(t=>({...t,useTotalCapacityOnly:e.target.checked})),disabled:!E,className:"form-checkbox text-[#EE5B00]"}),(0,s.jsx)("span",{className:"ml-2",children:"Use total capacity only (ignore per-ticket limits)"})]}),(0,s.jsx)("p",{className:"text-sm text-gray-500 mt-1",children:"When enabled, only the event capacity is enforced."})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700",children:"Description"}),(0,s.jsx)("div",{className:"border rounded",children:(0,s.jsx)(N,{value:I.description,onChange:e=>{A(t=>({...t,description:e.target.value}))},disabled:!E,containerProps:{className:"prose max-w-none min-h-[200px]"}})})]}),(0,s.jsxs)("div",{className:"bg-white rounded-lg shadow-sm overflow-hidden",children:[(0,s.jsx)("span",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Event Image"}),(0,s.jsxs)("div",{className:"relative w-full",style:{minHeight:"300px",maxHeight:"500px"},children:[I.image?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("img",{src:I.image,alt:"Event banner",className:"w-full h-auto object-cover pointer-events-none select-none",style:{maxHeight:"500px"},onError:e=>{e.target.style.display="none";let t=e.target.nextElementSibling;t&&(t.style.display="flex")}}),(0,s.jsx)("div",{className:"hidden absolute inset-0 z-[5] bg-gray-200 flex items-center justify-center pointer-events-none",children:(0,s.jsx)("p",{className:"text-gray-500",children:"Failed to load image. Please check the URL."})})]}):(0,s.jsx)("div",{className:"w-full bg-gray-200 flex items-center justify-center",style:{minHeight:"300px"},children:(0,s.jsx)("p",{className:"text-gray-500",children:"No image set"})}),E&&(0,s.jsx)("div",{className:"absolute top-4 right-4 z-30",children:(0,s.jsxs)("div",{className:"bg-white rounded-lg p-3 shadow-lg border border-gray-200",children:[(0,s.jsx)("span",{className:"block text-sm font-medium text-gray-700 mb-2",children:eo?"Uploading...":"Replace Image"}),(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,s.jsxs)("label",{htmlFor:"event-edit-banner-upload",className:"cursor-pointer",children:[(0,s.jsx)("input",{id:"event-edit-banner-upload",type:"file",accept:"image/*",onChange:ep,className:"sr-only",disabled:eo}),(0,s.jsxs)("span",{className:"px-4 py-2 bg-[#EE5B00] text-white rounded text-sm hover:bg-[#D44D00] transition-colors inline-flex items-center",children:[(0,s.jsx)(i.B88,{className:"w-4 h-4 mr-2"}),eo?"Uploading...":"Browse File"]})]}),I.image&&(0,s.jsx)("button",{type:"button",onClick:()=>{A(e=>({...e,image:""}))},className:"px-3 py-2 bg-red-500 text-white rounded text-sm hover:bg-red-600 transition-colors",title:"Clear image",disabled:eo,children:(0,s.jsx)(i.yGN,{className:"w-4 h-4"})})]}),I.image&&!I.image.startsWith("data:")&&(0,s.jsxs)("p",{className:"hidden text-xs text-gray-500 mt-2",children:["Current: ",I.image.substring(0,50),"..."]})]})})]})]}),(0,s.jsx)(d.A,{speakers:I.speakers,onChange:e=>A(t=>({...t,speakers:e})),disabled:!E}),E&&(0,s.jsxs)("div",{className:"mt-8",children:[(0,s.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,s.jsx)("h2",{className:"text-lg font-semibold text-gray-900",children:"Ticket Types"}),(0,s.jsxs)("button",{onClick:()=>{A(e=>({...e,ticketTypes:[...e.ticketTypes,{name:"",price:"",quantity:"",description:"",isEarlyBird:!1,earlyBirdPrice:"",earlyBirdEndDate:"",hasExpiration:!1,expirationDateTime:"",hasLoggedInPrice:!1,loggedInMemberType:"",loggedInPrice:"",loggedInEarlyBirdPrice:"",onlyForMembers:!1}]}))},className:"flex items-center px-4 py-2 bg-[#EE5B00] text-white rounded-lg hover:bg-[#D44D00]",children:[(0,s.jsx)(i.GGD,{className:"mr-2"}),"Add Ticket Type"]})]}),I.ticketTypes.map((e,t)=>(0,s.jsxs)("div",{className:"border rounded-lg p-4 mb-4",children:[(0,s.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,s.jsxs)("h3",{className:"text-lg font-medium",children:["Ticket Type ",t+1]}),(0,s.jsx)("button",{onClick:()=>{A(e=>({...e,ticketTypes:e.ticketTypes.filter((e,a)=>a!==t)}))},className:"text-red-600 hover:text-red-800",children:(0,s.jsx)(i.IXo,{})})]}),(0,s.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,s.jsx)("div",{className:"md:col-span-2",children:(0,s.jsxs)("label",{className:"inline-flex items-center",children:[(0,s.jsx)("input",{type:"checkbox",checked:e.onlyForMembers,onChange:e=>eu(t,"onlyForMembers",e.target.checked),className:"form-checkbox text-[#EE5B00]"}),(0,s.jsx)("span",{className:"ml-2",children:"Only for Members"})]})}),(0,s.jsxs)("div",{className:"md:col-span-2",children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700",children:"Name"}),(0,s.jsx)("input",{type:"text",value:e.name,onChange:e=>eu(t,"name",e.target.value),className:"w-full border rounded p-2"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700",children:"Price"}),(0,s.jsx)("input",{type:"text",value:e.price,onChange:e=>eu(t,"price",e.target.value),className:"w-full border rounded p-2"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700",children:"Quantity"}),(0,s.jsx)("input",{type:"number",value:e.quantity,onChange:e=>eu(t,"quantity",e.target.value),className:"w-full border rounded p-2"})]}),(0,s.jsx)("div",{className:"md:col-span-2",children:(0,s.jsxs)("label",{className:"inline-flex items-center",children:[(0,s.jsx)("input",{type:"checkbox",checked:e.hasLoggedInPrice,onChange:e=>eu(t,"hasLoggedInPrice",e.target.checked),disabled:e.onlyForMembers,className:"form-checkbox ".concat(e.onlyForMembers?"text-gray-400":"text-[#EE5B00]")}),(0,s.jsx)("span",{className:"ml-2 ".concat(e.onlyForMembers?"text-gray-400":""),children:"Logged-in User Price"})]})}),e.hasLoggedInPrice&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700",children:"Member Type"}
1),(0,s.jsxs)("select",{value:e.loggedInMemberType,onChange:e=>eu(t,"loggedInMemberType",e.target.value),className:"w-full border rounded p-2",children:[(0,s.jsx)("option",{value:"",children:"Select Member Type"}),(0,s.jsx)("option",{value:"STUDENT",children:"Student"}),(0,s.jsx)("option",{value:"INDIVIDUAL",children:"Individual"}),(0,s.jsx)("option",{value:"ORGANISATION",children:"Organisation"})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700",children:"Logged-in User Price"}),(0,s.jsx)("input",{type:"text",value:e.loggedInPrice,onChange:e=>eu(t,"loggedInPrice",e.target.value),className:"w-full border rounded p-2",readOnly:e.onlyForMembers})]})]}),(0,s.jsx)("div",{className:"md:col-span-2",children:(0,s.jsxs)("label",{className:"inline-flex items-center",children:[(0,s.jsx)("input",{type:"checkbox",checked:e.isEarlyBird,onChange:e=>eu(t,"isEarlyBird",e.target.checked),className:"form-checkbox text-[#EE5B00]"}),(0,s.jsx)("span",{className:"ml-2",children:"Enable Early Bird Pricing"})]})}),e.isEarlyBird&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700",children:"Early Bird Price"}),(0,s.jsx)("input",{type:"text",value:e.earlyBirdPrice,onChange:e=>eu(t,"earlyBirdPrice",e.target.value),className:"w-full border rounded p-2"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700",children:"Early Bird End Date"}),(0,s.jsx)("input",{type:"date",value:e.earlyBirdEndDate,onChange:e=>eu(t,"earlyBirdEndDate",e.target.value),className:"w-full border rounded p-2"})]}),e.hasLoggedInPrice&&(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700",children:"Logged-in User Early Bird Price"}),(0,s.jsx)("input",{type:"text",value:e.loggedInEarlyBirdPrice,onChange:e=>eu(t,"loggedInEarlyBirdPrice",e.target.value),className:"w-full border rounded p-2"})]})]}),(0,s.jsx)("div",{className:"md:col-span-2",children:(0,s.jsxs)("label",{className:"inline-flex items-center",children:[(0,s.jsx)("input",{type:"checkbox",checked:e.isGroupTicket,onChange:e=>eu(t,"isGroupTicket",e.target.checked),className:"form-checkbox text-[#EE5B00]"}),(0,s.jsx)("span",{className:"ml-2",children:"Enable Group Ticket"})]})}),e.isGroupTicket&&(0,s.jsxs)("div",{children:[(0,s.jsxs)("label",{className:"block text-sm font-medium text-gray-700",children:["Number of Group Members (Max: ",e.quantity||0,")"]}),(0,s.jsx)("input",{type:"number",value:e.groupSize,onChange:e=>eu(t,"groupSize",e.target.value),className:"w-full border rounded p-2",min:"2",max:e.quantity||0,placeholder:"Minimum 2 members, maximum ".concat(e.quantity||0," members")})]}),(0,s.jsx)("div",{className:"md:col-span-2",children:(0,s.jsxs)("label",{className:"inline-flex items-center",children:[(0,s.jsx)("input",{type:"checkbox",checked:e.hasExpiration,onChange:e=>eu(t,"hasExpiration",e.target.checked),className:"form-checkbox text-[#EE5B00]"}),(0,s.jsx)("span",{className:"ml-2",children:"Enable Ticket Expiration"})]})}),e.hasExpiration&&(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700",children:"Expiration Date & Time"}),(0,s.jsx)("input",{type:"datetime-local",value:e.expirationDateTime,onChange:e=>eu(t,"expirationDateTime",e.target.value),className:"w-full border rounded p-2"})]}),(0,s.jsxs)("div",{className:"md:col-span-2",children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700",children:"Description"}),(0,s.jsx)("div",{className:"border rounded",children:(0,s.jsx)(N,{value:e.description,onChange:e=>eu(t,"description",e.target.value),containerProps:{className:"prose max-w-none min-h-[100px]"}})})]})]})]},t))]})]})}),(0,s.jsx)("div",{className:"bg-white rounded-lg shadow-sm p-6 mb-8",id:"overview",children:(0,s.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h2",{className:"text-lg font-semibold text-gray-900 mb-4",children:"Event Information"}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsxs)("p",{children:[(0,s.jsx)("span",{className:"font-medium",children:"Start date:"})," ",(0,v.c)(I.date||j.date)]}),(0,s.jsxs)("p",{children:[(0,s.jsx)("span",{className:"font-medium",children:"Start time:"})," ",I.time||j.time]}),(0,s.jsxs)("p",{children:[(0,s.jsx)("span",{className:"font-medium",children:"End date:"})," ",I.endDate?(0,v.c)(I.endDate):I.date?(0,v.c)(I.date):"â"," ",!I.endDate&&I.date&&(0,s.jsx)("span",{className:"text-gray-500",children:"(same as start)"})]}),(0,s.jsxs)("p",{children:[(0,s.jsx)("span",{className:"font-medium",children:"End time:"})," ",I.endTime||I.time||"â"," ",!I.endTime&&I.time&&(0,s.jsx)("span",{className:"text-gray-500",children:"(same as start)"})]}),(0,s.jsxs)("p",{children:[(0,s.jsx)("span",{className:"font-medium",children:"Location:"})," ",I.location||j.location]}),(0,s.jsxs)("p",{children:[(0,s.jsx)("span",{className:"font-medium",children:"Created By:"}),(0,s.jsx)("span",{className:"ml-2 text-gray-600",children:ec.email}),"N/A"!==ec.name&&ec.name!==ec.email&&(0,s.jsxs)("span",{className:"ml-2 text-sm text-gray-500",children:["(",ec.name,")"]})]}),(0,s.jsxs)("p",{children:[(0,s.jsx)("span",{className:"font-medium",children:"Status:"}),(0,s.jsx)("span",{className:"ml-2 px-2 py-1 text-xs font-medium rounded-full ".concat("active"===j.status?"bg-green-100 text-green-800":"bg-gray-100 text-gray-800"),children:j.status})]})]})]}),(0,s.jsxs)("div",{className:"hidden",children:[(0,s.jsx)("h2",{className:"text-lg font-semibold text-gray-900 mb-4",children:"Description"}),(0,s.jsx)("p",{className:"text-gray-600",children:j.description})]})]})}),(0,s.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6 mb-8",children:[(0,s.jsxs)("div",{className:"bg-white p-4 rounded-lg",children:[(0,s.jsx)("h3",{className:"text-lg font-semibold text-gray-700",children:"Total Registrations"}),(0,s.jsxs)("p",{className:"text-3xl font-bold text-[#13344E]",children:[C.totalRegistrations,"/",I.capacity]}),(0,s.jsx)("div",{className:"w-full bg-gray-200 rounded-full h-2 mt-2",children:(0,s.jsx)("div",{className:"bg-[#EE5B00] h-2 rounded-full",style:{width:"".concat(C.totalRegistrations/I.capacity*100,"%")}})})]}),(0,s.jsxs)("div",{className:"bg-white p-4 rounded-lg",children:[(0,s.jsx)("h3",{className:"text-lg font-semibold text-gray-700",children:"Ticket Sales"}),(0,s.jsxs)("p",{className:"text-3xl font-bold text-[#13344E]",children:["\xa3",C.ticketSales.toFixed(2)]})]}),(0,s.jsxs)("div",{className:"bg-white p-4 rounded-lg",children:[(0,s.jsx)("h3",{className:"text-lg font-semibold text-gray-700",children:"Check-in Rate"}),(0,s.jsxs)("p",{className:"text-3xl font-bold text-[#13344E]",children:[C.checkInRate.toFixed(1),"%"]})]})]}),(0,s.jsxs)("div",{className:"bg-white rounded-lg shadow-sm p-6 mb-8",children:[(0,s.jsx)("h2",{className:"text-lg font-semibold text-gray-900 mb-4",children:"Ticket Types"}),(0,s.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:P.map((e,t)=>{let a=I.title?"".concat(window.location.origin,"/events/register/").concat((0,f.J)(I.title),"?buy=ticket").concat(t+1):"";return(0,s.jsxs)("div",{className:"bg-gray-50 p-4 rounded-lg flex flex-col",children:[(0,s.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h3",{className:"font-medium text-gray-900",children:e.name}),(0,s.jsxs)("p",{className:"text-gray-600",children:["\xa3",e.price]})]}),a&&(0,s.jsx)("button",{type:"button",onClick:()=>{navigator.clipboard.writeText(a),u.Ay.success("Registration link for ".concat(e.name," copied"))},className:"flex-shrink-0 p-2 text-gray-500 hover:text-[#EE5B00] hover:bg-gray-200 rounded-lg transition-colors",title:"Copy registration URL for this ticket type",children:(0,s.jsx)(i.nxz,{className:"w-5 h-5"})})]}),(0,s.jsxs)("div",{className:"mt-2",children:[(0,s.jsxs)("div",{className:"flex justify-between text-sm text-gray-600",children:[(0,s.jsxs)("span",{children:["Sold: ",e.sold]}),(0,s.jsxs)("span",{children:["Remaining: ",I.useTotalCapacityOnly?"â":e.remaining]})]}),(0,s.jsx)("div",{className:"w-full bg-gray-200 rounded-full h-2 mt-1",children:(0,s.jsx)("div",{className:"bg-[#EE5B00] h-2 rounded-full",style:{width:(I.useTotalCapacityOnly?Math.min(100,C.totalRegistrations/(Number(I.capacity)||1)*100):e.sold/(e.sold+(e.remaining||1))*100)+"%"}})}),(0,s.jsxs)("div",{className:"mt-2 text-sm text-gray-600",children:["Revenue: \xa3",e.revenue.toFixed(2)]})]})]},t)})})]}),x.c9&&(0,x.ST)(h)&&(0,s.jsx)(p,{eventId:h,ticketTypes:I.ticketTypes}),(0,s.jsxs)("div",{className:"bg-white rounded-lg shadow-sm p-6",children:[(0,s.jsxs)("div",{className:"flex justify-between items-center mb-6",children:[(0,s.jsx)("h2",{className:"text-lg font-semibold text-gray-900",children:"Registrations"}),(0,s.jsxs)("div",{className:"flex space-x-4",children:[(0,s.jsxs)("button",{onClick:()=>{L(!0)},className:"flex items-center px-4 py-2 bg-[#EE5B00] text-white rounded-lg hover:bg-[#D44D00]",children:[(0,s.jsx)(i.B88,{className:"mr-2"}),"Import"]}),(0,s.jsxs)("button",{onClick:()=>
1{if(!O||0===O.length){u.Ay.error("No registrations to download");return}let e=new Blob([[["eventId","eventName","orderId","ticketId","attendeeName","attendeeEmail","phone","companyInstitution","ticketType","ticketPrice","amountPaid","orderValue","paymentStatus","paymentMethod","paymentVia","orderDate","orderType","orderDescription","stripePaymentIntentId","stripeCustomerId","registrationDate","registrationTime","checkInStatus","checkInTime","eventDate","venue"],...O.map(e=>{let t=e.stripePaymentIntentId||e.id||e.stripeCustomerId||"N/A";return[h,I.title,e.id,t,e.name,e.email,e.phone,e.companyInstitution,e.ticketType,e.ticketPrice,e.amountPaid,e.orderValue,e.paymentStatus,e.paymentMethod,e.paymentVia,e.orderDate,e.orderType,e.orderDescription,e.stripePaymentIntentId,e.stripeCustomerId,e.registrationDate,e.registrationTime,e.checkInStatus,e.checkInTime,I.date,I.location]})].map(e=>e.map(e=>'"'.concat(null!=e?e:"",'"')).join(",")).join("\n")],{type:"text/csv;charset=utf-8;"}),t=document.createElement("a"),a=URL.createObjectURL(e);t.setAttribute("href",a),t.setAttribute("download","".concat(I.title.replace(/[^a-z0-9]/gi,"_").toLowerCase(),"_registrations.csv")),t.style.visibility="hidden",document.body.appendChild(t),t.click(),document.body.removeChild(t),u.Ay.success("CSV file downloaded successfully!")},className:"flex items-center px-4 py-2 bg-white text-gray-700 border border-gray-300 rounded-lg hover:bg-gray-50",children:[(0,s.jsx)(i.a4x,{className:"mr-2"}),"Download"]}),(0,s.jsxs)("button",{onClick:()=>{if(!O||0===O.length){u.Ay.error("No registrations to print");return}let e=window.open("","_blank"),t="\n <!DOCTYPE html>\n <html>\n <head>\n <title>Event Registrations - ".concat(I.title,'</title>\n <style>\n body {\n font-family: \'Segoe UI\', Tahoma, Geneva, Verdana, sans-serif;\n margin: 0;\n padding: 20px;\n color: #333;\n background: white;\n }\n .header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n margin-bottom: 30px;\n border-bottom: 3px solid #EE5B00;\n padding-bottom: 20px;\n }\n .logo-section {\n display: flex;\n align-items: center;\n gap: 15px;\n }\n .logo {\n width: 80px;\n height: 80px;\n object-fit: contain;\n }\n .logo-text {\n color: #13344E;\n font-size: 28px;\n font-weight: 900;\n letter-spacing: 1px;\n margin: 0;\n }\n .event-info {\n text-align: right;\n flex: 1;\n }\n .event-title {\n color: #13344E;\n font-size: 24px;\n font-weight: bold;\n margin: 0 0 10px 0;\n }\n .event-details {\n color: #666;\n font-size: 14px;\n line-height: 1.4;\n }\n .event-details p {\n margin: 3px 0;\n }\n .stats {\n display: flex;\n justify-content: space-around;\n margin: 25px 0;\n padding: 20px;\n background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);\n border-radius: 8px;\n border: 1px solid #dee2e6;\n }\n .stat-item {\n text-align: center;\n flex: 1;\n }\n .stat-value {\n font-size: 24px;\n font-weight: 900;\n color: #13344E;\n margin-bottom: 5px;\n }\n .stat-label {\n font-size: 11px;\n color: #666;\n text-transform: uppercase;\n letter-spacing: 0.5px;\n font-weight: 600;\n }\n .table-container {\n margin-top: 25px;\n overflow: hidden;\n }\n table {\n width: 100%;\n border-collapse: collapse;\n font-size: 11px;\n }\n th, td {\n border: 1px solid #dee2e6;\n padding: 10px 8px;\n text-align: left;\n vertical-align: top;\n }\n th {\n background: linear-gradient(135deg, #13344E 0%, #1e4a5f 100%);\n color: white;\n font-weight: 700;\n text-transform: uppercase;\n font-size: 10px;\n letter-spacing: 0.5px;\n }\n tr:nth-child(even) {\n background-color: #f8f9fa;\n }\n tr:hover {\n background-color: #e3f2fd;\n }\n .status-badge {\n padding: 4px 8px;\n border-radius: 4px;\n font-size: 9px;\n font-weight: 700;\n text-transform: uppercase;\n letter-spacing: 0.3px;\n }\n .status-checked-in {\n background-color: #d4edda;\n color: #155724;\n border: 1px solid #c3e6cb;\n }\n .status-not-checked {\n background-color: #fff3cd;\n color: #856404;\n border: 1px solid #ffeaa7;\n }\n .footer {\n margin-top: 30px;\n padding-top: 20px;\n border-top: 2px solid #EE5B00;\n display: flex;\n justify-content: space-between;\n align-items: center;\n }\n .print-date {\n font-size: 10px;\n color: #666;\n font-style: italic;\n }\n .page-break {\n page-break-before: always;\n }\n @media print {\n body { \n margin: 0; \n padding: 15px;\n }\n .no-print { display: none; }\n .stats {\n background: #f8f9fa !important;\n -webkit-print-color-adjust: exact;\n print-color-adjust: exact;\n }\n th {\n background: #13344E !important;\n -webkit-print-color-adjust: exact;\n print-color-adjust: exact;\n }\n }\n </style>\n </head>\n <body>\n <div class="header">\n <div class="logo-section">\n <img src="/assets/logo-AFBE.png" alt="AFBE Logo" style="width:200
1px;" class="logo" onerror="this.style.display=\'none\'; this.nextElementSibling.style.display=\'block\';">\n </div>\n <div class="event-info">\n <h4 class="event-title" style="font-size: 24px; font-weight: 900;">').concat(I.title,'</h4>\n <div class="event-details">\n <p><strong>Event Start:</strong> ').concat(I.date?(0,v.c)(I.date):"N/A"," ").concat(I.time||"","</p>\n ").concat(I.endDate||I.endTime?"<p><strong>Event End:</strong> ".concat(I.endDate?(0,v.c)(I.endDate):(0,v.c)(I.date)," ").concat(I.endTime||I.time||"","</p>"):"","\n <p><strong>Venue:</strong> ").concat(I.location,"</p>\n <p><strong>Organiser:</strong> ").concat(I.eventOrganiser,'</p>\n </div>\n </div>\n </div>\n\n <div class="table-container">\n <table>\n <thead>\n <tr>\n <th>Name</th>\n <th>Email</th>\n <th>Phone</th>\n <th>Company/Institution</th>\n <th>Ticket Type</th>\n <th>Amount Paid</th>\n <th>Payment Status</th>\n <th>Registration Date</th>\n <th>Check-in Status</th>\n </tr>\n </thead>\n <tbody>\n ').concat(O.map(e=>"\n <tr>\n <td><strong>".concat(e.name||"N/A","</strong></td>\n <td>").concat(e.email||"N/A","</td>\n <td>").concat(e.phone||"N/A","</td>\n <td>").concat(e.companyInstitution||"N/A","</td>\n <td>").concat(e.ticketType||"N/A","</td>\n <td><strong>\xa3").concat(e.amountPaid||"0.00","</strong></td>\n <td>").concat(e.paymentStatus||"N/A","</td>\n <td>").concat(e.registrationDate||"N/A",'</td>\n <td>\n <span class="status-badge ').concat("Checked In"===e.checkInStatus?"status-checked-in":"status-not-checked",'">\n ').concat(e.checkInStatus||"Not Checked In","\n </span>\n </td>\n </tr>\n ")).join(""),'\n </tbody>\n </table>\n </div>\n\n <div class="footer">\n <div>\n <p style="margin: 0; font-size: 12px; color: #666;">\n <strong>AFBE-UK</strong> - Association for Black and Minority Ethnic Engineers<br>\n Event Registration Report\n </p>\n </div>\n <div class="print-date">\n Generated on: ').concat(new Date().toLocaleString("en-GB",{weekday:"long",year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit"}),"\n </div>\n </div>\n </body>\n </html>\n ");e.document.write(t),e.document.close(),e.onload=()=>{e.focus(),e.print(),e.close()},u.Ay.success("Print dialog opened")},className:"flex items-center px-4 py-2 bg-white text-gray-700 border border-gray-300 rounded-lg hover:bg-gray-50",children:[(0,s.jsx)(i.Mvz,{className:"mr-2"}),"Print"]}),(0,s.jsxs)("button",{onClick:()=>{window.confirm("Are you sure you want to clear all check-in data for this event?")&&(localStorage.removeItem("checkIn_".concat(h)),R(e=>e.map(e=>({...e,checkInStatus:"Not Checked In",checkInTime:null}))),u.Ay.success("All check-in data cleared"))},className:"hidden flex items-center px-4 py-2 bg-yellow-600 text-white rounded-lg hover:bg-yellow-700",children:[(0,s.jsx)(i.IXo,{className:"mr-2"}),"Clear Check-ins"]}),(0,s.jsxs)("button",{onClick:ev,className:"hidden flex items-center px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700",title:"Update email for Tendayi Munyebvu from [email protected] to [email protected]",children:[(0,s.jsx)(i.Bc_,{className:"mr-2"}),"Update Email"]}),(0,s.jsxs)("button",{onClick:ef,className:"hidden flex items-center px-4 py-2 bg-orange-600 text-white rounded-lg hover:bg-orange-700",title:"â ï¸ Permanently delete all registrations with email [email protected]",children:[(0,s.jsx)(i.IXo,{className:"mr-2"}),"Delete by Email"]}),(0,s.jsxs)("button",{onClick:e_,className:"hidden flex items-center px-4 py-2 bg-red-600 text-white rounded-lg hover:bg-red-700",title:"â ï¸ Permanently delete ALL registrations from database",children:[(0,s.jsx)(i.IXo,{className:"mr-2"}),"Delete All Registrations"]})]})]}),(0,s.jsx)("div",{className:"mb-6",children:(0,s.jsxs)("div",{className:"relative flex-grow max-w-md",children:[(0,s.jsx)(i.CKj,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400"}),(0,s.jsx)("input",{type:"text",placeholder:"Search registrations...",value:k,onChange:e=>w(e.target.value),className:"w-full pl-10 pr-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-[#EE5B00] focu
1s:border-transparent"})]})}),(0,s.jsx)("div",{className:"overflow-x-auto",children:(0,s.jsxs)("table",{className:"min-w-full divide-y divide-gray-200",children:[(0,s.jsx)("thead",{className:"bg-gray-50",children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Name"}),(0,s.jsx)("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Contact Info"}),(0,s.jsx)("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Ticket Details"}),(0,s.jsx)("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Registration Info"}),(0,s.jsx)("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Status"}),(0,s.jsx)("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"QR Code"}),(0,s.jsx)("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Actions"})]})}),(0,s.jsx)("tbody",{className:"bg-white divide-y divide-gray-200",children:O.filter(e=>{var t,a,s;return(null===(t=e.name)||void 0===t?void 0:t.toLowerCase().includes(k.toLowerCase()))||(null===(a=e.email)||void 0===a?void 0:a.toLowerCase().includes(k.toLowerCase()))||(null===(s=e.phone)||void 0===s?void 0:s.toLowerCase().includes(k.toLowerCase()))}).map(e=>(0,s.jsxs)("tr",{className:"hover:bg-gray-50",children:[(0,s.jsxs)("td",{className:"px-6 py-4 whitespace-nowrap",children:[(0,s.jsx)("div",{className:"text-sm font-medium text-gray-900",children:e.name}),(0,s.jsx)("div",{className:"text-sm text-gray-500",children:e.jobTitle}),(0,s.jsx)("div",{className:"text-sm text-gray-500",children:e.organization})]}),(0,s.jsxs)("td",{className:"px-6 py-4 whitespace-nowrap",children:[(0,s.jsx)("div",{className:"text-sm text-gray-900",children:e.email}),(0,s.jsx)("div",{className:"text-sm text-gray-500",children:e.phone}),e.companyInstitution&&(0,s.jsxs)("div",{className:"text-sm text-gray-500",children:["Company/Institution: ",e.companyInstitution]}),(0,s.jsx)("div",{className:"text-sm text-gray-500",children:e.memberType})]}),(0,s.jsxs)("td",{className:"px-6 py-4 whitespace-nowrap",children:[(0,s.jsx)("div",{className:"text-sm text-gray-900",children:e.ticketType}),(0,s.jsxs)("div",{className:"text-sm text-gray-500",children:["\xa3",e.amountPaid]}),(0,s.jsx)("div",{className:"text-sm text-gray-500",children:e.paymentStatus})]}),(0,s.jsxs)("td",{className:"px-6 py-4 whitespace-nowrap",children:[(0,s.jsx)("div",{className:"text-sm text-gray-900",children:e.registrationDate}),(0,s.jsx)("div",{className:"text-sm text-gray-500",children:e.registrationTime}),e.dietaryRequirements&&(0,s.jsxs)("div",{className:"text-sm text-gray-500",children:["Dietary: ",e.dietaryRequirements]}),e.specialAssistance&&(0,s.jsxs)("div",{className:"text-sm text-gray-500",children:["Special: ",e.specialAssistance]})]}),(0,s.jsxs)("td",{className:"px-6 py-4 whitespace-nowrap",children:[(0,s.jsx)("button",{onClick:()=>eb(e),className:"px-2 inline-flex text-xs leading-5 font-semibold rounded-full cursor-pointer hover:opacity-80 transition-opacity ".concat("Checked In"===e.checkInStatus?"bg-green-100 text-green-800 hover:bg-green-200":"bg-yellow-100 text-yellow-800 hover:bg-yellow-200"),title:"Click to toggle check-in status",children:e.checkInStatus||"Not Checked In"}),e.checkInTime&&(0,s.jsx)("div",{className:"text-sm text-gray-500 mt-1",children:new Date(e.checkInTime).toLocaleString()})]}),(0,s.jsx)("td",{className:"px-6 py-4 whitespace-nowrap",children:(0,s.jsx)("button",{onClick:()=>eN(e),className:"text-[#EE5B00] hover:text-[#D44D00] transition-colors",title:"Generate QR Code",children:(0,s.jsx)(i.mkN,{className:"w-5 h-5"})})}),(0,s.jsx)("td",{className:"px-6 py-4 whitespace-nowrap",children:(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,s.jsx)("button",{onClick:()=>ej(e),className:"text-blue-600 hover:text-blue-800 transition-colors",title:"Edit Registration",children:(0,s.jsx)(i.SG1,{className:"w-5 h-5"})}),(0,s.jsx)("button",{onClick:()=>eT(e),className:"text-red-600 hover:text-red-800 transition-colors",title:"Delete Registration",children:(0,s.jsx)(i.IXo,{className:"w-5 h-5"})})]})})]},e.id))})]})})]})]})}),B&&(0,s.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:(0,s.jsxs)("div",{className:"bg-white rounded-lg p-6 w-full max-w-4xl max-h-[90vh] overflow-y-auto",children:[(0,s.jsxs)("div",{className:"flex justify-between items-center mb-6",children:[(0,s.jsx)("h2",{className:"text-xl font-semibold text-gray-900",children:"Import Event Registrations"}),(0,s.jsx)("button",{onClick:()=>L(!1),className:"text-gray-400 hover:text-gray-600",children:(0,s.jsx)(i.yGN,{className:"w-6 h-6"})})]}),(0,s.jsxs)("div",{className:"mb-6",children:[(0,s.jsx)("h3",{className:"text-lg font-medium text-gray-900 mb-4",children:"CSV Format Requirements"}),(0,s.jsxs)("div",{className:"bg-gray-50 p-4 rounded-lg mb-4",children:[(0,s.jsx)("p",{className:"text-sm text-gray-600 mb-2",children:"Your CSV file should have the following columns (in this exact order):"}),(0,s.jsx)("code",{className:"text-sm bg-white p-2 rounded border block",children:"attendeeName,email,ticketType,ticketPrice,amountPaid,paymentMethod,orderDate,source"})]}),(0,s.jsxs)("div",{className:"mb-4",children:[(0,s.jsx)("h4",{className:"font-medium text-gray-900 mb-2",children:"Sample CSV:"}),(0,s.jsxs)("div",{className:"bg-gray-50 p-3 rounded text-sm font-mono",children:[(0,s.jsx)("div",{children:"attendeeName,email,ticketType,ticketPrice,amountPaid,paymentMethod,orderDate,source"}),(0,s.jsx)("div",{children:"John Doe,[email protected],Individual Tickets,170.00,170.00,COD,2025-01-15,Eventbrite"}),(0,s.jsx)("div",{children:"Frank Huitenga,[email protected],Individual Tickets,120.00,120.00,Bank Transfer,2025-01-15,Manual"}),(0,s.jsx)("div",{children:"Test Organisation,[email protected],Tables Tickets,1200.00,1200.00,Cash,2025-01-15,Partner"})]})]}),(0,s.jsxs)("div",{className:"mb-4",children:[(0,s.jsx)("h4",{className:"font-medium text-gray-900 mb-2",children:"Available Ticket Types for this Event:"}),(0,s.jsx)("div",{className:"flex flex-wrap gap-2",children:null===(t=I.ticketTypes)||void 0===t?void 0:t.map((e,t)=>(0,s.jsx)("span",{className:"bg-blue-100 text-blue-800 px-2 py-1 rounded text-sm",children:e.name},t))})]})]}),(0,s.jsxs)("div",{className:"mb-6",children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Upload CSV File"}),(0,s.jsx)("input",{type:"file",accept:".csv",onChange:e=>{let t=e.target.files[0];if(!t)return;let a=new FileReader;a.onload=e=>{eg(e.target.result)},a.readAsText(t)},className:"block w-full text-sm text-gray-500 file:mr-4 file:py-2 file:px-4 file:rounded-full file:border-0 file:text-sm file:font-semibold file:bg-[#EE5B00] file:text-white hover:file:bg-[#D44D00]"})]}),F.length>0&&(0,s.jsxs)("div",{className:"mb-6",children:[(0,s.jsxs)("h3",{className:"text-lg font-medium text-gray-900 mb-4",children:["Preview (",F.length," records)"]}),(0,s.jsx)("div",{className:"overflow-x-auto",children:(0,s.jsxs)("table",{className:"min-w-full divide-y divide-gray-200",children:[(0,s.jsx)("thead",{className:"bg-gray-50",children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Name"}),(0,s.jsx)("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Email"}),(0,s.jsx)("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Ticket Type"}),(0,s.jsx)("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Amount"}),(0,s.jsx)("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Payment Method"}),(0,s.jsx)("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Source"})]})}),(0,s.jsx)("tbody",{className:"bg-white divide-y divide-gray-200",children:F.map((e,t)=>(0,s.jsxs)("tr",{children:[(0,s.jsx)("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-900",children:e.attendeeName}),(0,s.jsx)("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-900",children:e.email}),(0,s.jsx)("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-900",children:e.ticketType}),(0,s.jsxs)("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-900",children:["\xa3",e.amountPaid]}),(0,s.jsx)("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-900",children:e.paymentMethod}),(0,s.jsx)("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-900",children:e.source})]},t))})]})})]}),(0,s.jsxs)("div",{className:"flex justify-end space-x-4",children:[(0,s.jsx)("button",{onClick:()=>L(!1),className:"px-4 py-2 text-gray-700 bg-gray-200 rounded-lg hover:bg-gray-300",disabled:G,children:"Cancel"}),(0,s.jsx)("button",{onClick:ey,disabled:0===F.length||G,className:"px-4 py-2 bg-[#EE5B00] text-white rounded-lg hover:bg-[#D44D00] disabled:opacity-50 disabled:cursor-not-allowed",children:G?"Importing...":"Import ".concat(F.length," Records")})]})]})}),J&&q&&(0,s.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:(0,s.jsxs)("div",{className:"bg-white rounded-lg p-6 w-full max-w-md",children:[(0,s.jsxs)("div",{className:"flex justify-between items-center mb-6",children:[(0,s.jsx)("h2",{className:"text-xl font-semibold text-gray-900",children:"QR Code"}),(0,s.jsx)("button",{onClick:()=>K(!1),className:"text-gray-400 hover:text-gray-600",children:(0,s.jsx)(i.yGN,{className:"w-6 h-6"})})]}),(0,s.jsxs)("div",{className:"text-center",children:[(0,s.jsxs)("div",{className:"mb-4",children:[(0,s.jsx)("h3",{className:"text-lg font-medium text-gray-900 mb-2",children:q.attendeeName}),(0,s.jsx)("p",{className:"text-sm text-gray-600",children:q.ticketType})]}),(0,s.jsxs)("div",{className:"bg-gray-100 p-4 rounded-lg mb-4",children:[(0,s.jsx)("div",{className:"text-xs text-gray-600 mb-2 font-semibold",children:"\uD83D\uDD0D QR Code Contains (Full JSON):"}),(0,s.jsx)("pre",{className:"text-xs bg-white p-2 rounded border text-left overflow-auto max-h-48",children:JSON.stringify(q,null,2)}),(0,s.jsx)("div",{className:"mt-2 text-xs text-blue-600 bg-blue-50 p-2 rounded",children:"â¹ï¸ Note: Your phone may auto-detect the email and show only that. Use a QR scanner app to see the full JSON data."})]}),(0,s.jsxs)("div",{className:"bg-gray-100 p-4 rounded-lg mb-4",children:[(0,s.jsx)("div",{className:"text-sm text-gray-600 mb-2",children:"QR Code:"}),(0,s.jsx)("div",{className:"bg-white p-4 rounded border inline-block",children:W?(0,s.jsx)("img",{src:W,alt:"QR Code",className:"w-48 h-48 mx-auto"}):(0,s.jsx)("div",{className:"w-48 h-48 bg-gray-200 flex items-center justify-center text-gray-500",children:(0,s.jsxs)("div",{className:"text-center",children:[(0,s.jsx)(i.mkN,{className:"w-16 h-16 mx-auto mb-2"}),(0,s.jsx)("div",{className:"text-xs",children:"Generating QR Code..."})]})})})]}),(0,s.jsxs)("div",{className:"flex justify-end space-x-4",children:[(0,s.jsx)("button",{onClick:()=>K(!1),className:"px-4 py-2 text-gray-700 bg-gray-200 rounded-lg hover:bg-gray-300",children:"Close"}),(0,s.jsx)("button",{onClick:()=>{navigator.clipboard.writeText(JSON.stringify(q,null,2)),u.Ay.success("QR data copied to clipboard!")},className:"px-4 py-2 bg-gray-600 text-white rounded-lg hover:bg-gray-700",children:"Copy Data"}),W&&(0,s.jsx)("button",{onClick:()=>{let e=document.createElement("a");e.download="qr-code-".concat(q.attendeeName.replace(/\s+/g,"-"),".png"),e.href=W,e.click(),u.Ay.success("QR code downloaded!")},className:"px-4 py-2 bg-[#EE5B00] text-white rounded-lg hover:bg-[#D44D00]",children:"Download QR"})]})]})]})}),ee&&ea&&(0,s.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:(0,s.jsxs)("div",{className:"bg-white rounded-lg p-6 w-full max-w-2xl max-h-[90vh] overflow-y-auto",children:[(0,s.jsxs)("div",{className:"flex justify-between items-center mb-6",children:[(0,s.jsx)("h2",{className:"text-xl font-semibold text-gray-900",children:"Edit Registration"}),(0,s.jsx)("button",{onClick:ek,className:"text-gray-400 hover:text-gray-600",disabled:ei,children:(0,s.jsx)(i.yGN,{className:"w-6 h-6"})})]}),(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Attendee Name *"}),(0,s.jsx)("input",{type:"text",name:"Attendee_Name__c",value:en.Attendee_Name__c||"",onChange:ew,className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-[#EE5B00] focu
1s:border-transparent",disabled:ei})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Email *"}),(0,s.jsx)("input",{type:"email",name:"Attendee_Email__c",value:en.Attendee_Email__c||"",onChange:ew,className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-[#EE5B00] focus:border-transparent",disabled:ei})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Phone"}),(0,s.jsx)("input",{type:"tel",name:"Attendee_Phone__c",value:en.Attendee_Phone__c||"",onChange:ew,className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-[#EE5B00] focus:border-transparent",disabled:ei})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Ticket Type"}),(0,s.jsxs)("select",{name:"Ticket_Type__c",value:en.Ticket_Type__c||"",onChange:ew,className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-[#EE5B00] focus:border-transparent",disabled:ei,children:[(0,s.jsx)("option",{value:"",children:"Select Ticket Type"}),P.map((e,t)=>(0,s.jsx)("option",{value:e.name,children:e.name},t))]})]}),(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Ticket Price"}),(0,s.jsx)("input",{type:"number",name:"Ticket_Price__c",value:en.Ticket_Price__c||"",onChange:ew,step:"0.01",className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-[#EE5B00] focus:border-transparent",disabled:ei})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Amount Paid"}),(0,s.jsx)("input",{type:"number",name:"Amount_Paid__c",value:en.Amount_Paid__c||"",onChange:ew,step:"0.01",className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-[#EE5B00] focus:border-transparent",disabled:ei})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Payment Method"}),(0,s.jsxs)("select",{name:"Payment_Method__c",value:en.Payment_Method__c||"",onChange:ew,className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-[#EE5B00] focus:border-transparent",disabled:ei,children:[(0,s.jsx)("option",{value:"",children:"Select Payment Method"}),(0,s.jsx)("option",{value:"Credit Card",children:"Credit Card"}),(0,s.jsx)("option",{value:"Debit Card",children:"Debit Card"}),(0,s.jsx)("option",{value:"Bank Transfer",children:"Bank Transfer"}),(0,s.jsx)("option",{value:"Cash",children:"Cash"}),(0,s.jsx)("option",{value:"COD",children:"COD"}),(0,s.jsx)("option",{value:"Stripe",children:"Stripe"}),(0,s.jsx)("option",{value:"PayPal",children:"PayPal"})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Payment Via"}),(0,s.jsxs)("select",{name:"Payment_via_website_Telephone_In_person__c",value:en.Payment_via_website_Telephone_In_person__c||"",onChange:ew,className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-[#EE5B00] focus:border-transparent",disabled:ei,children:[(0,s.jsx)("option",{value:"",children:"Select Payment Via"}),(0,s.jsx)("option",{value:"Website",children:"Website"}),(0,s.jsx)("option",{value:"Telephone",children:"Telephone"}),(0,s.jsx)("option",{value:"In Person",children:"In Person"})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Attendee Status"}),(0,s.jsxs)("select",{name:"Attendee_Status__c",value:en.Attendee_Status__c||"REGISTERED",onChange:ew,className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-[#EE5B00] focus:border-transparent",disabled:ei,children:[(0,s.jsx)("option",{value:"REGISTERED",children:"Registered"}),(0,s.jsx)("option",{value:"CANCELLED",children:"Cancelled"}),(0,s.jsx)("option",{value:"PENDING",children:"Pending"}),(0,s.jsx)("option",{value:"WAITLISTED",children:"Waitlisted"})]})]}),(0,s.jsxs)("div",{className:"flex justify-end gap-3 pt-4 border-t",children:[(0,s.jsx)("button",{onClick:ek,disabled:ei,className:"px-4 py-2 border border-gray-300 rounded-lg text-gray-700 hover:bg-gray-50 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:"Cancel"}),(0,s.jsx)("button",{onClick:eE,disabled:ei||!en.Attendee_Name__c||!en.Attendee_Email__c,className:"px-4 py-2 bg-[#EE5B00] text-white rounded-lg hover:bg-[#D44D00] transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex items-center",children:ei?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("svg",{className:"animate-spin -ml-1 mr-3 h-5 w-5 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[(0,s.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,s.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),"Updating..."]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(i.Bc_,{className:"mr-2"}
1),"Update Registration"]})})]})]})]})})]})}},90497:(e,t,a)=>{"use strict";a.d(t,{PT:()=>d,ST:()=>l,c9:()=>i,cf:()=>n,h1:()=>c,hv:()=>r});let s=["a0vN200000Tv0CJIAZ"];s[0];let n=400,r="This discount code is for 1 ticket only. Please go back and register one person at a time.",i=!1,l=e=>s.includes(String(e||"")),c=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return Math.max(0,n-((null==e?void 0:e.length)||0))},d=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return["Code,Percent Off,Ticket Types,Status,Used At,Used By Email",...e.map(e=>[e.code,e.percentOff,(e.ticketNames||[]).join("; "),e.status,e.usedAt||"",e.usedByEmail||""].map(e=>'"'.concat(String(null!=e?e:"").replace(/"/g,'""'),'"')).join(","))].join("\n")}},97147:(e,t,a)=>{"use strict";a.d(t,{Y:()=>s,c:()=>n});let s=e=>{if(!e)return"";let t=e;"string"==typeof t&&/[+-]\d{4}$/.test(t)&&!/[+-]\d{2}:\d{2}$/.test(t)&&(t=t.replace(/([+-]\d{2})(\d{2})$/,"$1:$2"));let a=t instanceof Date?t:new Date(t);return isNaN(a.getTime())?"":new Intl.DateTimeFormat("en-UK",{day:"2-digit",month:"2-digit",year:"numeric",timeZone:"Europe/London",formatMatcher:"basic"}).format(a).replace(/\//g,"-")},n=e=>{if(!e)return"";let t=e.match(/^(\d{4})-(\d{2})-(\d{2})/);if(t){let[,e,a,s]=t;return"".concat(s,"-").concat(a,"-").concat(e)}return s(e)}},32940:(e,t,a)=>{"use strict";a.d(t,{d:()=>n,k:()=>s});let s=["a0y4K000000U9IfQAK","a0y4K000000U9IgQAK","a0y4K000000U9IhQAK","a0y4K000000U9IiQAK","a0y4K000000U9IjQAK","a0y4K000000U9IkQAK"],n=e=>{if("a0y4K000000U9IcQAK"===e)return"STUDENT";if("a0y4K000000U9IdQAK"===e)return"INDIVIDUAL";if(s.includes(e));else if("a0yN2000008dTlWIAU"===e)return"SUPER_ADMIN";return"ORGANISATION"}},47686:(e,t,a)=>{"use strict";a.d(t,{J:()=>s});let s=e=>e?e.trim().replace(/[&]/g,"_").replace(/\s+/g,"_").replace(/_+/g,"_").replace(/^_+|_+$/g,""):""}},e=>{var t=t=>e(e.s=t);e.O(0,[3465,370,4335,6883,7583,209,6256,9034,636,6593,8792],()=>t(82090)),_N_E=e.O()}]);
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.