import{j as e,r as x,_ as s,s as ce}from"./wp-i18n-shim-DUX0OV_V.js";import{u as me,A as xe}from"./ActionButton-Cr4Z2a1F.js";import{C as ue}from"./CrudLayout-DRSWmVk9.js";import{a as R,s as g,u as N}from"./store-rDqSxbzb.js";import{c as ne,a as ae,X as oe}from"./utils-Bl0WAcve.js";import{U as be}from"./User-BsNUo7dD.js";import{w as U,I as k}from"./withIconDefaults-BJCqj2oX.js";import{E as ge}from"./Envelope-B2-E47aK.js";import{E as he}from"./Edit-ChdaRnpE.js";import{e as pe,T as je,a as Z,b as E,c as fe,d as w}from"./Table-p19l2S6r.js";import{S as ve}from"./SkeletonTableRows-yUolPLdf.js";import"./input-Dw-69aYW.js";import"./select-BFNitOb0.js";import"./Button-BveKhP38.js";import{u as q,a as A,d as Ne,R as ye,e as T}from"./index-D01LF5Le.js";import{f as re,a as D}from"./dateTimeFormat-yH4yHSCh.js";import{P as Ce}from"./plus-WPVVS3Qe.js";import{L as ke}from"./lock-ws9wrevH.js";import{S as we}from"./save-BecwuxKD.js";import"./vendor-DDjlQeP6.js";import"./loader-circle-CcSu72zH.js";import"./ArrowLeftIcon-C8q2jgKs.js";import"./lodash-Bd-B7UeG.js";import"./defineProperty-DbXIQDXj.js";import"./typeof-QjJsDpFa.js";import"./apiConfig-BA13wrqF.js";import"./index-CLZ4-rw6.js";import"./toast-1-c8k_LJ.js";import"./skeleton-DfFmlQ5i.js";import"./index-Bl84CzKv.js";import"./Combination-BuKwnoTc.js";import"./preload-helper-Dp1pzeXC.js";import"./CalenderCheck-2TB2QVYq.js";import"./calendar-Cz3-D5io.js";import"./tag-8m_NofXN.js";import"./shield-DVSNyXBB.js";import"./proxy-CtW-P0pQ.js";import"./circle-check-big-Bxgqw2u9.js";/**
 * @license lucide-react v0.525.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const _e=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],Ee=ne("monitor",_e);/**
 * @license lucide-react v0.525.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Fe=[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]],Se=ne("smartphone",Fe);function Te(){return e.jsx("svg",{width:"17",height:"17",viewBox:"0 0 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M8.33301 0C12.9321 0 16.6668 3.73393 16.667 8.33301C16.667 12.9322 12.9322 16.667 8.33301 16.667C3.73393 16.6668 0 12.9321 0 8.33301C0.000176016 3.73404 3.73404 0.000176012 8.33301 0ZM8.33301 11.6279C6.43967 11.628 4.71669 12.3638 3.43457 13.5645C4.71694 14.766 6.43894 15.5038 8.33301 15.5039C10.227 15.5039 11.949 14.7658 13.2314 13.5645C11.9493 12.3639 10.2263 11.6279 8.33301 11.6279ZM8.33301 1.16309C4.3759 1.16326 1.16326 4.3759 1.16309 8.33301C1.16309 9.97797 1.71931 11.4936 2.65234 12.7041C4.14097 11.3154 6.13884 10.4649 8.33301 10.4648C10.5269 10.4648 12.5251 11.3148 14.0137 12.7031C14.9466 11.4927 15.5039 9.97783 15.5039 8.33301C15.5037 4.37579 12.2903 1.16309 8.33301 1.16309ZM8.33301 3.10059C10.1516 3.10059 11.6279 4.5769 11.6279 6.39551C11.6278 8.21404 10.1516 9.68945 8.33301 9.68945C6.51461 9.68928 5.03915 8.21393 5.03906 6.39551C5.03906 4.57701 6.51455 3.10076 8.33301 3.10059ZM8.33301 4.26367C7.15641 4.26385 6.20117 5.21887 6.20117 6.39551C6.20126 7.57207 7.15647 8.52717 8.33301 8.52734C9.5097 8.52734 10.4648 7.57218 10.4648 6.39551C10.4648 5.21876 9.50975 4.26367 8.33301 4.26367Z",fill:"currentColor"})})}const De=U(Te);function Me(){return e.jsxs("svg",{width:"38",height:"20",viewBox:"0 0 38 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("rect",{width:"38",height:"20",rx:"10",fill:"#0046FF"}),e.jsx("rect",{x:"19",y:"2",width:"16",height:"16",rx:"8",fill:"white"})]})}const Ae=U(Me);function $e(){return e.jsxs("svg",{width:"38",height:"20",viewBox:"0 0 38 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("rect",{width:"38",height:"20",rx:"10",fill:"#CBD0D6"}),e.jsx("rect",{x:"3",y:"2",width:"16",height:"16",rx:"8",fill:"white"})]})}const Be=U($e);function Ve(){const o=q(),l=R(g),r=N(i=>i(g).getEmails(),[]),y=N(i=>i(g).emailLoading(),[]),t=N(i=>i(g).getError(),[]),[v,F]=x.useState(""),[p,C]=x.useState("customer"),[d,$]=x.useState("all");x.useEffect(()=>{l.getEmails()},[l]);const h=r.filter(i=>{const u=i.name.toLowerCase().includes(v.toLowerCase())||i.subject.toLowerCase().includes(v.toLowerCase()),b=i.type===p,j=d==="all"||i.event===d;return u&&b&&j}),B=r.filter(i=>i.type==="customer").length,V=r.filter(i=>i.type==="employee").length,S=r.filter(i=>i.type==="admin").length,J=async(i,u)=>{const b=r.find(P=>P.id===i);if(!b){alert(s("Template not found","radius-booking"));return}const j={...b,enabled:!u};(await l.updateEmailSettings(i,j)).success||alert(s("Failed to update email status","radius-booking"))},O=i=>{o(`${i}/edit/`)},c=i=>{switch(i){case"customer":return"text-primary";case"employee":return"text-purple-700";case"admin":return"text-green-700";default:return"text-title"}},L=[{id:"customer",label:s("Customer Emails","radius-booking"),count:B,icon:ge},{id:"employee",label:s("Employee Emails","radius-booking"),count:V,icon:be},{id:"admin",label:s("Admin Emails","radius-booking"),count:S,icon:De}];return e.jsx("div",{className:"min-h-screen",children:e.jsxs("div",{className:"rtrb-card p-[30px]",children:[t&&typeof t=="string"&&e.jsxs("div",{className:"mb-6 bg-gradient-to-r from-red-50 to-white border border-red-200 rounded-xl p-4 flex items-center gap-3 shadow-sm",children:[e.jsx("div",{className:"w-10 h-10 bg-red-100 rounded-lg flex items-center justify-center flex-shrink-0",children:e.jsx(A,{className:"w-5 h-5 text-red-600"})}),e.jsx("p",{className:"text-red-700 text-sm",children:t})]}),e.jsx("div",{className:"mb-7",children:e.jsx("div",{className:"flex gap-1",children:L.map(i=>{const u=i.icon;return e.jsxs("button",{onClick:()=>C(i.id),className:ae("text-title bg-light-bg px-6 py-2 flex items-center justify-center gap-2 text-sm transition-all relative h-[40px] rounded-[4px]",p===i.id?"text-white bg-primary":"hover:bg-[#D9E0F1]"),children:[e.jsx(u,{className:"w-4 h-4"}),e.jsx("span",{className:"font-normal",children:i.label}),i.count>0&&e.jsxs("span",{className:"font-semibold",children:["(",String(i.count).padStart(2,"0"),")"]})]},i.id)})})}),e.jsxs(pe,{children:[e.jsx(je,{children:e.jsxs(Z,{className:"bg-muted/50",children:[e.jsx(E,{className:"text-title py-3 bg-[#F6F8FA] font-semibold",children:s("Template Name","radius-booking")}),e.jsx(E,{className:"text-title py-3 bg-[#F6F8FA] font-semibold",children:s("Event Status","radius-booking")}),e.jsx(E,{className:"text-title py-3 bg-[#F6F8FA] font-semibold",children:s("Type","radius-booking")}),e.jsx(E,{className:"text-title py-3 bg-[#F6F8FA] font-semibold",children:s("Status","radius-booking")}),e.jsx(E,{className:"text-title py-3 bg-[#F6F8FA] font-semibold text-right w-[80px]",children:s("Actions","radius-booking")})]})}),e.jsx(fe,{children:y?e.jsx(ve,{rowCount:5,columns:[5,3,2,2,1]}):h.length>0?h.map(i=>{var u,b;return e.jsxs(Z,{className:"hover:bg-muted/30 transition-colors even:bg-[#F6F8FA]",children:[e.jsx(w,{className:"border-t border-border py-3",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 bg-[#DFEEFB] rounded-[6px] flex items-center justify-center flex-shrink-0",children:e.jsx(A,{className:"w-5 h-5 text-[#1d4ed8]"})}),e.jsxs("div",{children:[e.jsx("div",{className:"font-medium text-title text-[15px]",children:i.name}),e.jsx("div",{className:"text-sm text-small-font mt-0 text-[13px]",children:i.subject})]})]})}),e.jsx(w,{className:"border-t border-border py-3",children:e.jsx("span",{className:ae("text-xs font-medium px-3 py-1 border","label-"+(i==null?void 0:i.status)),children:((u=i==null?void 0:i.status)==null?void 0:u.charAt(0).toUpperCase())+((b=i==null?void 0:i.status)==null?void 0:b.slice(1))})}),e.jsx(w,{className:"border-t border-border py-3",children:e.jsx("span",{className:`${c(i.type)} text-[14xp] font-medium`,children:i.type.charAt(0).toUpperCase()+i.type.slice(1)})}),e.jsx(w,{className:"border-t border-border py-3",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:`w-2 h-2 rounded-full ${i.enabled?"bg-green-500":"bg-gray-400"}`}),e.jsx("span",{className:`text-sm font-medium ${i.enabled?"text-green-700":"text-small-font"}`,children:i.enabled?s("Active","radius-booking"):s("Inactive","radius-booking")})]})}),e.jsx(w,{className:"border-t border-border py-3",children:e.jsxs("div",{className:"flex items-center justify-end gap-3",children:[e.jsx("button",{onClick:()=>O(i.id),className:"hover:bg-none hover:text-primary",title:s("Edit template","radius-booking"),children:e.jsx(he,{className:"w-4 h-4"})}),e.jsx("button",{onClick:j=>{j.stopPropagation(),J(i.id,i.enabled)},className:"hover:bg-none",children:i.enabled?e.jsx(Ae,{size:"30px"}):e.jsx(Be,{size:"30px"})})]})})]},i.id)}):e.jsx(Z,{children:e.jsx(w,{colSpan:5,className:"px-6 py-16 text-center",children:e.jsxs("div",{className:"flex flex-col items-center justify-center",children:[e.jsx("div",{className:"w-16 h-16 bg-gradient-to-br from-slate-100 to-slate-50 rounded-2xl flex items-center justify-center mb-4 border border-border",children:e.jsx(A,{className:"w-8 h-8 text-slate-400"})}),e.jsx("p",{className:"text-title font-medium text-lg mb-1",children:s("No templates found","radius-booking")}),e.jsx("p",{className:"text-sm text-small-font",children:v||d!=="all"?s("Try adjusting your search or filters","radius-booking"):s("Get started by creating your first email template","radius-booking")})]})})})})]}),!y&&h.length>0&&e.jsx("div",{className:"mt-4 text-center",children:e.jsx("p",{className:"text-sm text-slate-600",children:ce(s("Showing %1$s of %2$s templates","radius-booking"),h.length,r.filter(i=>i.type===p).length)})})]})})}function Le(){return e.jsx("div",{className:"min-h-screen",children:e.jsx("div",{className:"mx-auto px-4 sm:px-6 lg:px-8 py-6",children:e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8",children:[e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"bg-white rounded-lg shadow-sm border border-border p-6",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsx("div",{className:"h-6 w-48 bg-gray-200 rounded animate-pulse"}),e.jsx("div",{className:"h-6 w-20 bg-gray-200 rounded-full animate-pulse"})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("div",{className:"h-3 w-20 bg-gray-200 rounded mb-2 animate-pulse"}),e.jsx("div",{className:"h-5 w-40 bg-gray-200 rounded animate-pulse"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsx("div",{className:"h-3 w-16 bg-gray-200 rounded mb-2 animate-pulse"}),e.jsx("div",{className:"h-6 w-24 bg-gray-200 rounded-md animate-pulse"})]}),e.jsxs("div",{children:[e.jsx("div",{className:"h-3 w-12 bg-gray-200 rounded mb-2 animate-pulse"}),e.jsx("div",{className:"h-4 w-32 bg-gray-200 rounded animate-pulse"})]})]}),e.jsx("div",{className:"pt-3 border-t border-border",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("div",{className:"h-4 w-32 bg-gray-200 rounded animate-pulse"}),e.jsx("div",{className:"h-6 w-11 bg-gray-200 rounded-full animate-pulse"})]})})]})]}),e.jsxs("div",{className:"bg-white rounded-lg shadow-sm border border-border p-6",children:[e.jsx("div",{className:"h-6 w-32 bg-gray-200 rounded mb-4 animate-pulse"}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("div",{className:"h-4 w-24 bg-gray-200 rounded mb-2 animate-pulse"}),e.jsx("div",{className:"h-10 w-full bg-gray-200 rounded-lg animate-pulse"})]}),e.jsxs("div",{children:[e.jsx("div",{className:"h-4 w-28 bg-gray-200 rounded mb-2 animate-pulse"}),e.jsx("div",{className:"h-10 w-full bg-gray-200 rounded-lg animate-pulse"})]}),e.jsxs("div",{children:[e.jsx("div",{className:"h-4 w-24 bg-gray-200 rounded mb-2 animate-pulse"}),e.jsx("div",{className:"h-40 w-full bg-gray-200 rounded-lg animate-pulse"})]}),e.jsxs("div",{children:[e.jsx("div",{className:"h-4 w-20 bg-gray-200 rounded mb-2 animate-pulse"}),e.jsx("div",{className:"h-24 w-full bg-gray-200 rounded-lg animate-pulse"})]}),e.jsxs("div",{children:[e.jsx("div",{className:"h-4 w-36 bg-gray-200 rounded mb-2 animate-pulse"}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsx("div",{className:"h-10 bg-gray-200 rounded-lg animate-pulse"}),e.jsx("div",{className:"h-10 bg-gray-200 rounded-lg animate-pulse"})]})]})]})]}),e.jsxs("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-4",children:[e.jsx("div",{className:"h-5 w-40 bg-blue-200 rounded mb-3 animate-pulse"}),e.jsx("div",{className:"grid grid-cols-2 gap-x-4 gap-y-2",children:[...Array(12)].map((o,l)=>e.jsx("div",{className:"h-4 bg-blue-200 rounded animate-pulse"},l))})]})]}),e.jsx("div",{className:"lg:sticky lg:top-24 h-fit",children:e.jsxs("div",{className:"bg-white rounded-lg shadow-sm border border-border p-6",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsx("div",{className:"h-6 w-28 bg-gray-200 rounded animate-pulse"}),e.jsx("div",{className:"h-4 w-32 bg-gray-200 rounded animate-pulse"})]}),e.jsx("div",{className:"mx-auto max-w-full",children:e.jsx("div",{className:"bg-gray-100 rounded-lg p-6 min-h-[600px]",children:e.jsxs("div",{className:"bg-white rounded-lg shadow-lg overflow-hidden",children:[e.jsxs("div",{className:"bg-gradient-to-r from-gray-300 to-gray-400 p-6 text-center animate-pulse",children:[e.jsx("div",{className:"w-16 h-16 bg-gray-200 rounded-lg mx-auto mb-3"}),e.jsx("div",{className:"h-4 w-32 bg-gray-200 rounded mx-auto"})]}),e.jsxs("div",{className:"p-6 space-y-4",children:[e.jsx("div",{className:"h-8 w-3/4 bg-gray-200 rounded mx-auto animate-pulse"}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"h-4 w-full bg-gray-200 rounded animate-pulse"}),e.jsx("div",{className:"h-4 w-full bg-gray-200 rounded animate-pulse"}),e.jsx("div",{className:"h-4 w-3/4 bg-gray-200 rounded animate-pulse"})]}),e.jsxs("div",{className:"bg-gray-100 border border-border rounded-lg p-5 space-y-3",children:[e.jsx("div",{className:"h-5 w-32 bg-gray-200 rounded mx-auto mb-4 animate-pulse"}),[...Array(7)].map((o,l)=>e.jsxs("div",{className:"flex justify-between pb-2 border-b border-border",children:[e.jsx("div",{className:"h-4 w-20 bg-gray-200 rounded animate-pulse"}),e.jsx("div",{className:"h-4 w-32 bg-gray-200 rounded animate-pulse"})]},l))]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"h-4 w-full bg-gray-200 rounded animate-pulse"}),e.jsx("div",{className:"h-4 w-2/3 bg-gray-200 rounded mx-auto animate-pulse"})]}),e.jsx("div",{className:"text-center",children:e.jsx("div",{className:"h-12 w-48 bg-gray-200 rounded-lg mx-auto animate-pulse"})}),e.jsxs("div",{className:"border-t border-border pt-6 mt-6 space-y-2",children:[e.jsx("div",{className:"h-3 w-40 bg-gray-200 rounded mx-auto animate-pulse"}),e.jsx("div",{className:"h-3 w-56 bg-gray-200 rounded mx-auto animate-pulse"}),e.jsx("div",{className:"h-3 w-48 bg-gray-200 rounded mx-auto animate-pulse"})]})]})]})})})]})})]})})})}function He(){var z,Y,G,Q,K,W,X,ee,se,ie,te;const{id:o}=Ne();q();const l=R(g),r=N(a=>a(g).getEmail(o),[o]),y=N(a=>a(g).emailLoading(),[]),[t,v]=x.useState({name:"",type:"customer",event:"appointment_confirmed",subject:"",heading:"",additional_content:"",footer_text:"",button_text:"",button_url:"",enabled:!0,cc_staff:!1,send_reminder:!1,reminder_minutes:30,reminder_times:[]}),F=!!((z=window.radius_booking_param)!=null&&z.is_pro),[p,C]=x.useState("desktop"),[d,$]=x.useState(!1),[h,B]=x.useState(""),[V,S]=x.useState(!1),[J,O]=x.useState(!1);x.useEffect(()=>{o&&l.getEmail(o)},[o,l]),x.useEffect(()=>{r&&v({name:r.name||"",type:r.type||"customer",event:r.event||"appointment_confirmed",subject:r.subject||"",heading:r.heading||"",additional_content:r.additional_content||"",footer_text:r.footer_text||"",button_text:r.button_text||"",button_url:r.button_url||"",enabled:r.enabled??!0,cc_staff:r.cc_staff??!1,send_reminder:r.send_reminder??!1,reminder_minutes:r.reminder_minutes??30,reminder_times:r.reminder_times??[]})},[r]);const c=(a,m)=>{l.setEmailFormField(a,m)},L=async()=>{if(!h||!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(h)){alert(s("Please enter a valid email address","radius-booking"));return}try{await l.sendTestEmail(o,h),S(!1),$(!0),setTimeout(()=>$(!1),3e3)}catch(a){console.error("Failed to send test email:",a),alert(s("Failed to send test email. Please try again.","radius-booking"))}},i=((Y=t.event)==null?void 0:Y.includes("meeting"))||((G=t.id)==null?void 0:G.includes("meeting")),u=((Q=t.event)==null?void 0:Q.includes("event"))||((K=t.id)==null?void 0:K.includes("event")),b=re("2025-10-20"),j=re("2025-11-15"),H=D("14:00"),P=D("14:30"),le=`${D("09:00")} - ${D("17:00")}`,n=i?{customer_name:"John Doe",customer_email:"john@example.com",customer_phone:"+1 (555) 123-4567",meeting_type_name:"30 Min Consultation",staff_name:"Sarah Johnson",staff_email:"sarah@example.com",booking_id:"MT-2025-001",booking_date:b,time:H,end_time:P,duration:"30 minutes",location:"Google Meet",meeting_link:"https://meet.google.com/abc-defg-hij",meeting_price:"50.00",currency_symbol:"$",payment_status:"Paid",status:"Confirmed",notes:"Looking forward to our meeting"}:u?{customer_name:"John Doe",customer_email:"john@example.com",customer_phone:"+1 (555) 123-4567",event_name:"Tech Conference 2025",staff_name:"Sarah Johnson",booking_id:"EVT-2025-001",booking_date:j,event_date:j,event_time:le,event_location:"Convention Center, 456 Main St",ticket_name:"VIP Pass",ticket_quantity:"2",registration_number:"EVT-2025-0042",selected_sessions:"Keynote Speech, Workshop: AI in Action, Networking Mixer",status:"Confirmed",currency_symbol:"$",all_tickets:[{name:"VIP Pass",quantity:2,price:150,registration_number:"EVT-2025-0042"},{name:"General Admission",quantity:1,price:0,registration_number:"EVT-2025-0043"}]}:{customer_name:"John Doe",customer_email:"john@example.com",customer_phone:"+1 (555) 123-4567",service_name:"Hair Cut & Styling",staff_name:"Sarah Johnson",booking_id:"BK-2025-001",booking_date:b,time:H,duration:"60 minutes",location:"123 Main St, Suite 200",price:"$75.00",status:"Confirmed",notes:"Please arrive 10 minutes early",rejection_reason:"The requested time slot is no longer available."},I=a=>{if(!a)return a;let m=a;return Object.keys(n).forEach(f=>{m=m.replace(new RegExp(`{${f}}`,"g"),n[f])}),m};return y?e.jsx(Le,{}):e.jsxs("div",{className:"min-h-screen",children:[e.jsx("div",{className:"mb-4",children:e.jsx("div",{className:"mx-auto px-4 sm:px-6 lg:px-8",children:e.jsx("div",{className:"flex items-center justify-end",children:e.jsx("div",{className:"flex items-center gap-3"})})})}),d&&e.jsx("div",{className:"fixed top-20 right-4 bg-green-600 text-white px-6 py-3 rounded-lg shadow-lg z-50 animate-fade-in",children:s("Test email sent successfully!","radius-booking")}),V&&e.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:e.jsxs("div",{className:"bg-white rounded-lg p-6 max-w-md w-full mx-4",children:[e.jsx("h3",{className:"text-lg font-semibold text-title mb-4",children:s("Send Test Email","radius-booking")}),e.jsx("p",{className:"text-sm text-title2 mb-4",children:s("Enter an email address to receive a test version of this template with sample data.","radius-booking")}),e.jsx("input",{type:"email",value:h,onChange:a=>B(a.target.value),placeholder:"test@example.com",className:"w-full px-3 py-2 border border-border rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent mb-4"}),e.jsxs("div",{className:"flex gap-3 justify-end",children:[e.jsx("button",{onClick:()=>S(!1),className:"px-4 py-2 text-title bg-gray-100 rounded-lg hover:bg-gray-200 transition-colors",children:s("Cancel","radius-booking")}),e.jsx("button",{onClick:L,className:"px-4 py-2 bg-green-600 text-white rounded-lg hover:bg-green-700 transition-colors",children:s("Send Test","radius-booking")})]})]})}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8",children:[e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"rtrb-card overflow-hidden",children:[e.jsxs("div",{className:"bg-lighter-2 h-[50px] pl-[30px] flex items-center border-b border-border",children:[e.jsx("h2",{className:"text-lg font-semibold text-title",children:s("Template Information","radius-booking")}),e.jsx("span",{className:`inline-flex items-center px-2.5 py-1 rounded-full text-xs font-medium ${t.enabled?"bg-green-100 text-green-800":"bg-gray-100 text-gray-800"}`,children:t.enabled?s("● Active","radius-booking"):s("○ Inactive","radius-booking")})]}),e.jsxs("div",{className:"p-[30px] space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-medium text-title2 uppercase mb-1",children:s("Template","radius-booking")}),e.jsx("p",{className:"text-sm font-semibold text-title",children:t.name||s("Untitled Template","radius-booking")})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-medium text-title2 uppercase mb-1",children:s("Recipient","radius-booking")}),e.jsx("span",{className:`inline-flex items-center px-2.5 py-1 rounded-md text-xs font-semibold ${t.type==="customer"?"bg-blue-100 text-primary":t.type==="employee"?"bg-green-100 text-green-800":"bg-purple-100 text-purple-800"}`,children:((W=t.type)==null?void 0:W.charAt(0).toUpperCase())+((X=t.type)==null?void 0:X.slice(1))})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-medium text-title2 uppercase mb-1",children:s("Event","radius-booking")}),e.jsx("p",{className:"text-xs font-medium text-title",children:(ee=t.event)==null?void 0:ee.replace(/_/g," ").replace(/\b\w/g,a=>a.toUpperCase())})]})]}),e.jsxs("div",{className:"pt-3 border-t border-border space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-sm font-medium text-title",children:s("Enable template","radius-booking")}),e.jsx("button",{type:"button",onClick:()=>c("enabled",!t.enabled),className:`relative inline-flex h-6 w-11 items-center rounded-full transition-colors focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 ${t.enabled?"bg-primary":"bg-gray-200"}`,children:e.jsx("span",{className:`inline-block h-4 w-4 transform rounded-full bg-white transition-transform ${t.enabled?"translate-x-6":"translate-x-1"}`})})]}),(o==null?void 0:o.includes("reminder"))&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-sm font-medium text-title",children:s("Send reminder before appointment","radius-booking")}),e.jsx("button",{type:"button",onClick:()=>c("send_reminder",!t.send_reminder),className:`relative inline-flex h-6 w-11 items-center rounded-full transition-colors focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 ${t.send_reminder?"bg-primary":"bg-gray-200"}`,children:e.jsx("span",{className:`inline-block h-4 w-4 transform rounded-full bg-white transition-transform ${t.send_reminder?"translate-x-6":"translate-x-1"}`})})]}),t.send_reminder&&e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-sm font-medium text-title",children:s("Remind before","radius-booking")}),e.jsxs("select",{value:t.reminder_minutes,onChange:a=>c("reminder_minutes",parseInt(a.target.value,10)),className:"px-3 py-1.5 border border-border rounded-lg text-sm focus:ring-2 focus:ring-blue-500 focus:border-transparent",children:[e.jsx("option",{value:5,children:s("5 minutes","radius-booking")}),e.jsx("option",{value:15,children:s("15 minutes","radius-booking")}),e.jsx("option",{value:30,children:s("30 minutes","radius-booking")}),e.jsx("option",{value:60,children:s("1 hour","radius-booking")}),e.jsx("option",{value:120,children:s("2 hours","radius-booking")}),e.jsx("option",{value:240,children:s("4 hours","radius-booking")}),e.jsx("option",{value:360,children:s("6 hours","radius-booking")}),e.jsx("option",{value:720,children:s("12 hours","radius-booking")}),e.jsx("option",{value:1440,children:s("24 hours","radius-booking")}),e.jsx("option",{value:2880,children:s("2 days","radius-booking")}),e.jsx("option",{value:4320,children:s("3 days","radius-booking")})]})]}),F?e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("span",{className:"text-sm font-medium text-title",children:s("Additional reminders","radius-booking")}),e.jsxs("button",{type:"button",onClick:()=>{const a=t.reminder_times||[];c("reminder_times",[...a,60])},className:"inline-flex items-center gap-1 px-2 py-1 text-xs font-medium text-primary bg-blue-50 rounded hover:bg-blue-100 transition-colors",children:[e.jsx(Ce,{className:"w-3 h-3"}),s("Add","radius-booking")]})]}),(t.reminder_times||[]).length>0&&e.jsx("div",{className:"space-y-2",children:t.reminder_times.map((a,m)=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("select",{value:a,onChange:f=>{const _=[...t.reminder_times];_[m]=parseInt(f.target.value,10),c("reminder_times",_)},className:"flex-1 px-3 py-1.5 border border-border rounded-lg text-sm focus:ring-2 focus:ring-blue-500 focus:border-transparent",children:[e.jsx("option",{value:5,children:s("5 minutes","radius-booking")}),e.jsx("option",{value:15,children:s("15 minutes","radius-booking")}),e.jsx("option",{value:30,children:s("30 minutes","radius-booking")}),e.jsx("option",{value:60,children:s("1 hour","radius-booking")}),e.jsx("option",{value:120,children:s("2 hours","radius-booking")}),e.jsx("option",{value:240,children:s("4 hours","radius-booking")}),e.jsx("option",{value:360,children:s("6 hours","radius-booking")}),e.jsx("option",{value:720,children:s("12 hours","radius-booking")}),e.jsx("option",{value:1440,children:s("24 hours","radius-booking")}),e.jsx("option",{value:2880,children:s("2 days","radius-booking")}),e.jsx("option",{value:4320,children:s("3 days","radius-booking")})]}),e.jsx("button",{type:"button",onClick:()=>{const f=t.reminder_times.filter((_,de)=>de!==m);c("reminder_times",f)},className:"p-1.5 text-red-500 hover:bg-red-50 rounded transition-colors",children:e.jsx(oe,{className:"w-3.5 h-3.5"})})]},m))})]}):e.jsxs("div",{className:"flex items-center gap-2 text-xs text-gray-500 bg-gray-50 px-3 py-2 rounded-lg",children:[e.jsx(ke,{className:"w-3.5 h-3.5"}),e.jsx("span",{children:s("Multiple reminders available in Pro","radius-booking")})]})]})]})]})]})]}),e.jsxs("div",{className:"rtrb-card overflow-hidden",children:[e.jsx("div",{className:"bg-lighter-2 h-[50px] pl-[30px] flex items-center border-b border-border",children:e.jsx("h2",{className:"text-lg font-semibold text-title",children:s("Email Content","radius-booking")})}),e.jsxs("div",{className:"p-[30px] space-y-4",children:[e.jsxs("div",{children:[e.jsxs("label",{className:"flex items-center gap-2 text-sm font-medium text-title mb-1",children:[s("Subject Line","radius-booking"),e.jsx(k,{className:"w-4 h-4 text-gray-400"})]}),e.jsx("input",{type:"text",value:t.subject,onChange:a=>c("subject",a.target.value),placeholder:s("e.g., Your booking is confirmed - {service_name}","radius-booking"),className:"w-full px-3 py-2 border border-border rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent"})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"flex items-center gap-2 text-sm font-medium text-title mb-1",children:[s("Email Heading","radius-booking"),e.jsx(k,{className:"w-4 h-4 text-gray-400"})]}),e.jsx("input",{type:"text",value:t.heading,onChange:a=>c("heading",a.target.value),placeholder:s("e.g., Booking Confirmed!","radius-booking"),className:"w-full px-3 py-2 border border-border rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent"})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"flex items-center gap-2 text-sm font-medium text-title mb-1",children:[s("Main Content","radius-booking"),e.jsx(k,{className:"w-4 h-4 text-gray-400"})]}),e.jsx("textarea",{value:t.additional_content,onChange:a=>c("additional_content",a.target.value),placeholder:s(`Hi {customer_name},

Your booking for {service_name} has been confirmed! We look forward to seeing you.`,"radius-booking"),rows:8,className:"w-full px-3 py-2 border border-border rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent font-mono text-sm"})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"flex items-center gap-2 text-sm font-medium text-title mb-1",children:[s("Footer Text","radius-booking"),e.jsx(k,{className:"w-4 h-4 text-gray-400"})]}),e.jsx("textarea",{value:t.footer_text,onChange:a=>c("footer_text",a.target.value),placeholder:s("Need to reschedule? Click the button below to manage your booking.","radius-booking"),rows:3,className:"w-full px-3 py-2 border border-border rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent"})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"flex items-center gap-2 text-sm font-medium text-title mb-1",children:[s("Call-to-Action Button","radius-booking"),e.jsx(k,{className:"w-4 h-4 text-gray-400"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsx("input",{type:"text",value:t.button_text||"",onChange:a=>c("button_text",a.target.value),placeholder:s("Button text","radius-booking"),className:"px-3 py-2 border border-border rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent"}),e.jsx("input",{type:"text",value:t.button_url||"",onChange:a=>c("button_url",a.target.value),placeholder:s("Button URL","radius-booking"),className:"px-3 py-2 border border-border rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent"})]})]})]})]}),e.jsxs("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-4",children:[e.jsxs("h3",{className:"text-sm font-medium text-blue-900 mb-3 flex items-center gap-2",children:[e.jsx(k,{className:"w-4 h-4"}),s("Available Variables","radius-booking")]}),e.jsxs("div",{className:"grid grid-cols-2 gap-x-4 gap-y-2 text-xs text-primary",children:[e.jsxs("div",{children:[e.jsx("code",{className:"bg-blue-100 px-1.5 py-0.5 rounded",children:"{customer_name}"})," - ",s("Customer name","radius-booking")]}),e.jsxs("div",{children:[e.jsx("code",{className:"bg-blue-100 px-1.5 py-0.5 rounded",children:"{customer_email}"})," - ",s("Customer email","radius-booking")]}),e.jsxs("div",{children:[e.jsx("code",{className:"bg-blue-100 px-1.5 py-0.5 rounded",children:"{customer_phone}"})," - ",s("Customer phone","radius-booking")]}),e.jsxs("div",{children:[e.jsx("code",{className:"bg-blue-100 px-1.5 py-0.5 rounded",children:"{staff_name}"})," - ",s("Staff / Organizer","radius-booking")]}),e.jsxs("div",{children:[e.jsx("code",{className:"bg-blue-100 px-1.5 py-0.5 rounded",children:"{status}"})," - ",s("Status","radius-booking")]}),e.jsxs("div",{children:[e.jsx("code",{className:"bg-blue-100 px-1.5 py-0.5 rounded",children:"{booking_id}"})," - ",s("Booking ID","radius-booking")]}),u?e.jsxs(e.Fragment,{children:[e.jsxs("div",{children:[e.jsx("code",{className:"bg-blue-100 px-1.5 py-0.5 rounded",children:"{event_name}"})," - ",s("Event name","radius-booking")]}),e.jsxs("div",{children:[e.jsx("code",{className:"bg-blue-100 px-1.5 py-0.5 rounded",children:"{event_date}"})," - ",s("Event date","radius-booking")]}),e.jsxs("div",{children:[e.jsx("code",{className:"bg-blue-100 px-1.5 py-0.5 rounded",children:"{event_time}"})," - ",s("Event time","radius-booking")]}),e.jsxs("div",{children:[e.jsx("code",{className:"bg-blue-100 px-1.5 py-0.5 rounded",children:"{event_location}"})," - ",s("Location","radius-booking")]}),e.jsxs("div",{children:[e.jsx("code",{className:"bg-blue-100 px-1.5 py-0.5 rounded",children:"{ticket_name}"})," - ",s("Ticket type","radius-booking")]}),e.jsxs("div",{children:[e.jsx("code",{className:"bg-blue-100 px-1.5 py-0.5 rounded",children:"{ticket_quantity}"})," - ",s("Ticket qty","radius-booking")]}),e.jsxs("div",{children:[e.jsx("code",{className:"bg-blue-100 px-1.5 py-0.5 rounded",children:"{registration_number}"})," - ",s("Reg #","radius-booking")]})]}):i?e.jsxs(e.Fragment,{children:[e.jsxs("div",{children:[e.jsx("code",{className:"bg-blue-100 px-1.5 py-0.5 rounded",children:"{meeting_type_name}"})," - ",s("Meeting type","radius-booking")]}),e.jsxs("div",{children:[e.jsx("code",{className:"bg-blue-100 px-1.5 py-0.5 rounded",children:"{meeting_link}"})," - ",s("Meeting link","radius-booking")]}),e.jsxs("div",{children:[e.jsx("code",{className:"bg-blue-100 px-1.5 py-0.5 rounded",children:"{booking_date}"})," - ",s("Date","radius-booking")]}),e.jsxs("div",{children:[e.jsx("code",{className:"bg-blue-100 px-1.5 py-0.5 rounded",children:"{time}"})," - ",s("Time","radius-booking")]}),e.jsxs("div",{children:[e.jsx("code",{className:"bg-blue-100 px-1.5 py-0.5 rounded",children:"{duration}"})," - ",s("Duration","radius-booking")]}),e.jsxs("div",{children:[e.jsx("code",{className:"bg-blue-100 px-1.5 py-0.5 rounded",children:"{location}"})," - ",s("Location","radius-booking")]})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{children:[e.jsx("code",{className:"bg-blue-100 px-1.5 py-0.5 rounded",children:"{service_name}"})," - ",s("Service name","radius-booking")]}),e.jsxs("div",{children:[e.jsx("code",{className:"bg-blue-100 px-1.5 py-0.5 rounded",children:"{booking_date}"})," - ",s("Date","radius-booking")]}),e.jsxs("div",{children:[e.jsx("code",{className:"bg-blue-100 px-1.5 py-0.5 rounded",children:"{time}"})," - ",s("Time","radius-booking")]}),e.jsxs("div",{children:[e.jsx("code",{className:"bg-blue-100 px-1.5 py-0.5 rounded",children:"{duration}"})," - ",s("Duration","radius-booking")]}),e.jsxs("div",{children:[e.jsx("code",{className:"bg-blue-100 px-1.5 py-0.5 rounded",children:"{location}"})," - ",s("Location","radius-booking")]}),e.jsxs("div",{children:[e.jsx("code",{className:"bg-blue-100 px-1.5 py-0.5 rounded",children:"{price}"})," - ",s("Price","radius-booking")]})]})]})]})]}),e.jsx("div",{className:"lg:sticky lg:top-24 h-fit",children:e.jsxs("div",{className:"rtrb-card overflow-hidden",children:[e.jsxs("div",{className:"bg-lighter-2 h-[50px] px-[30px] flex items-center border-b border-border gap-2",children:[e.jsxs("div",{className:"flex gap-4 items-center",children:[e.jsx("h2",{className:"text-lg font-semibold text-title",children:s("Live Preview","radius-booking")}),e.jsx("span",{className:"text-xs text-title2",children:s("Using sample data","radius-booking")})]}),e.jsxs("div",{className:"ml-auto flex items-center gap-1 bg-[#DAE0E6] border border-[#CAD3DB] h-[36px] rounded-lg p-1",children:[e.jsx("button",{onClick:()=>C("desktop"),className:`p-2 h-[30px] rounded ${p==="desktop"?"bg-white shadow-sm":"text-title2"}`,title:s("Desktop view","radius-booking"),children:e.jsx(Ee,{className:"w-4 h-4"})}),e.jsx("button",{onClick:()=>C("mobile"),className:`p-2 h-[30px] rounded ${p==="mobile"?"bg-white shadow-sm":"text-title2"}`,title:s("Mobile view","radius-booking"),children:e.jsx(Se,{className:"w-4 h-4"})})]})]}),e.jsx("div",{className:`mx-auto transition-all ${p==="mobile"?"max-w-sm":"max-w-full"}`,children:e.jsx("div",{className:"bg-white rounded-lg p-6 min-h-[600px]",children:e.jsxs("div",{className:"rtrb-card overflow-hidden",children:[e.jsxs("div",{className:"bg-primary p-6 text-center",children:[e.jsx("div",{className:"",children:e.jsxs("svg",{width:"102",height:"40",viewBox:"0 0 102 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("path",{d:"M20 0C24.5102 0 27.7701 -9.8139e-05 30.3936 0.351563C33.3464 0.747879 35.3387 1.60798 36.8682 3.13184C38.392 4.6557 39.2521 6.65362 39.6484 9.60645C40.0001 12.2299 40 15.4898 40 20C40 24.5102 40.0001 27.7701 39.6484 30.3936C39.2521 33.3464 38.392 35.3387 36.8682 36.8682C35.3443 38.392 33.3464 39.2521 30.3936 39.6484C27.7701 40.0001 24.5102 40 20 40C15.4898 40 12.2299 40.0001 9.60645 39.6484C6.65362 39.2521 4.66128 38.392 3.13184 36.8682C1.60798 35.3443 0.747879 33.3464 0.351563 30.3936C-9.8139e-05 27.7701 0 24.5102 0 20C0 15.4898 -9.8139e-05 12.2299 0.351563 9.60645C0.747879 6.65362 1.60798 4.66128 3.13184 3.13184C4.6557 1.60239 6.65362 0.747879 9.60645 0.351563C12.2299 -9.8139e-05 15.4898 0 20 0ZM68.5664 13.7305C69.6956 13.7305 70.7035 14.0008 71.5898 14.542C72.4804 15.0789 73.182 15.8499 73.6934 16.8555C74.2047 17.8568 74.4599 19.0566 74.46 20.4541C74.46 21.8517 74.2047 23.0539 73.6934 24.0596C73.182 25.061 72.4805 25.8328 71.5898 26.374C70.7036 26.9108 69.6955 27.1787 68.5664 27.1787C67.433 27.1787 66.4208 26.9109 65.5303 26.374C64.644 25.8329 63.9449 25.0593 63.4336 24.0537C62.9222 23.048 62.667 21.8476 62.667 20.4541C62.667 19.0566 62.9223 17.8568 63.4336 16.8555C63.9449 15.8499 64.644 15.0789 65.5303 14.542C66.4208 14.0008 67.433 13.7305 68.5664 13.7305ZM82.3623 13.7305C83.0695 13.7305 83.7277 13.8343 84.3369 14.043C84.9505 14.2518 85.4964 14.5482 85.9736 14.9316C86.4552 15.3152 86.8536 15.7714 87.1689 16.2998C87.4843 16.8239 87.6978 17.4057 87.8086 18.0449H85.7822C85.6586 17.6571 85.492 17.3097 85.2832 17.0029C85.0787 16.6919 84.8334 16.4273 84.5479 16.21C84.2624 15.9885 83.9366 15.8201 83.5703 15.7051C83.2081 15.59 82.8096 15.5322 82.375 15.5322C81.6378 15.5322 80.9732 15.7224 80.3809 16.1016C79.7886 16.4808 79.3198 17.0368 78.9746 17.7695C78.6337 18.4982 78.4629 19.3914 78.4629 20.4482C78.4629 21.5093 78.6353 22.4067 78.9805 23.1396C79.3256 23.8724 79.7988 24.4284 80.3994 24.8076C81.0003 25.1869 81.6851 25.376 82.4521 25.376C83.1636 25.3759 83.7832 25.2311 84.3115 24.9414C84.8442 24.6517 85.2561 24.2432 85.5459 23.7148C85.8269 23.2058 85.9709 22.6109 85.9834 21.9307H82.752V20.3008H87.8975V21.79C87.8975 22.8895 87.6631 23.8446 87.1943 24.6543C86.7299 25.4595 86.0868 26.0816 85.2646 26.5205C84.4466 26.9594 83.5088 27.1787 82.4521 27.1787C81.2675 27.1787 80.2269 26.9058 79.332 26.3604C78.4416 25.8149 77.7475 25.0413 77.249 24.04C76.7505 23.0344 76.501 21.8415 76.501 20.4609C76.501 19.4169 76.6458 18.4794 76.9355 17.6484C77.2253 16.8175 77.6321 16.1118 78.1563 15.5322C78.6846 14.9485 79.305 14.5031 80.0166 14.1963C80.7324 13.8853 81.5144 13.7305 82.3623 13.7305ZM95.8828 13.7305C97.012 13.7305 98.0199 14.0008 98.9063 14.542C99.7968 15.0789 100.498 15.8499 101.01 16.8555C101.521 17.8568 101.776 19.0566 101.776 20.4541C101.776 21.8517 101.521 23.0539 101.01 24.0596C100.498 25.061 99.7969 25.8328 98.9063 26.374C98.02 26.9108 97.0119 27.1787 95.8828 27.1787C94.7494 27.1787 93.7372 26.9109 92.8467 26.374C91.9604 25.8329 91.2614 25.0593 90.75 24.0537C90.2386 23.048 89.9834 21.8476 89.9834 20.4541C89.9835 19.0566 90.2387 17.8568 90.75 16.8555C91.2613 15.8499 91.9604 15.0789 92.8467 14.542C93.7373 14.0008 94.7494 13.7305 95.8828 13.7305ZM55.4131 25.2998H61.3447V27H53.4385V13.9092H55.4131V25.2998ZM68.5664 15.5322C67.8123 15.5323 67.1391 15.7224 66.5469 16.1016C65.9545 16.4766 65.4858 17.0307 65.1406 17.7637C64.7998 18.4922 64.629 19.389 64.6289 20.4541C64.6289 21.5194 64.7997 22.4194 65.1406 23.1523C65.4858 23.8808 65.9547 24.4343 66.5469 24.8135C67.1392 25.1884 67.8122 25.3759 68.5664 25.376C69.3164 25.376 69.9877 25.1885 70.5801 24.8135C71.1765 24.4343 71.6455 23.8808 71.9863 23.1523C72.3315 22.4194 72.5039 21.5194 72.5039 20.4541C72.5039 19.389 72.3314 18.4922 71.9863 17.7637C71.6454 17.0307 71.1767 16.4766 70.5801 16.1016C69.9878 15.7223 69.3164 15.5322 68.5664 15.5322ZM95.8828 15.5322C95.1287 15.5323 94.4555 15.7224 93.8633 16.1016C93.271 16.4766 92.8022 17.0307 92.457 17.7637C92.1162 18.4922 91.9454 19.389 91.9453 20.4541C91.9453 21.5194 92.1161 22.4194 92.457 23.1523C92.8022 23.8808 93.2711 24.4343 93.8633 24.8135C94.4556 25.1884 95.1286 25.3759 95.8828 25.376C96.6328 25.376 97.3042 25.1885 97.8965 24.8135C98.4929 24.4343 98.9619 23.8808 99.3027 23.1523C99.6479 22.4194 99.8203 21.5194 99.8203 20.4541C99.8203 19.389 99.6478 18.4922 99.3027 17.7637C98.9618 17.0307 98.4931 16.4766 97.8965 16.1016C97.3042 15.7223 96.6328 15.5322 95.8828 15.5322Z",fill:"white"}),e.jsx("path",{d:"M24.1251 11.0527C24.3072 11.0527 24.4827 11.125 24.6115 11.2539C24.7402 11.3828 24.8126 11.558 24.8126 11.7402V12.4277H25.9562C26.4199 12.3739 26.8903 12.4255 27.3312 12.5791C27.7722 12.7328 28.1729 12.9849 28.5031 13.3154C28.8332 13.646 29.0849 14.0468 29.2384 14.4883C29.3919 14.9298 29.4435 15.4008 29.3898 15.8652V25.4893C29.4435 25.9537 29.3919 26.4247 29.2384 26.8662C29.0849 27.3077 28.8332 27.7085 28.5031 28.0391C28.1729 28.3696 27.7722 28.6217 27.3312 28.7754C26.8903 28.929 26.4199 28.9806 25.9562 28.9268H14.9699C14.506 28.9806 14.0359 28.9291 13.5949 28.7754C13.1538 28.6217 12.7532 28.3697 12.423 28.0391C12.0928 27.7085 11.8411 27.3077 11.6876 26.8662C11.5341 26.4247 11.4825 25.9537 11.5363 25.4893V15.8652C11.4825 15.4008 11.5341 14.9298 11.6876 14.4883C11.8411 14.0468 12.0928 13.646 12.423 13.3154C12.7532 12.9848 13.1538 12.7328 13.5949 12.5791C14.0359 12.4254 14.506 12.3739 14.9699 12.4277H16.1144V11.7402C16.1144 11.5579 16.1868 11.3828 16.3156 11.2539C16.4443 11.1251 16.6189 11.0528 16.8009 11.0527C16.9829 11.0527 17.1575 11.1251 17.2863 11.2539C17.415 11.3828 17.4874 11.5579 17.4874 11.7402V12.4277H23.4386V11.7402C23.4386 11.5579 23.511 11.3828 23.6398 11.2539C23.7685 11.1251 23.9431 11.0528 24.1251 11.0527ZM12.9103 17.9277V25.4893C12.9103 26.9348 13.526 27.5518 14.9699 27.5518H25.9562C27.4 27.5518 28.0167 26.9348 28.0167 25.4893V17.9277H12.9103ZM22.7501 20.5234C22.8404 20.523 22.9302 20.5399 23.0138 20.5742C23.0973 20.6085 23.1734 20.6589 23.2374 20.7227C23.3012 20.7865 23.3523 20.8629 23.3868 20.9463C23.4213 21.0295 23.4386 21.1189 23.4386 21.209C23.4386 21.2993 23.4214 21.3892 23.3868 21.4727C23.3523 21.556 23.3012 21.6315 23.2374 21.6953L20.1886 24.7559C20.125 24.8198 20.0492 24.8706 19.9659 24.9053C19.8827 24.9399 19.7934 24.958 19.7033 24.958C19.6131 24.958 19.5238 24.9399 19.4406 24.9053C19.3573 24.8706 19.2815 24.8198 19.2179 24.7559L17.6886 23.2256C17.5675 23.0954 17.502 22.923 17.505 22.7451C17.5081 22.567 17.5804 22.3965 17.7062 22.2705C17.832 22.1447 18.002 22.0725 18.1798 22.0693C18.3575 22.0663 18.5293 22.1326 18.6593 22.2539L19.7003 23.2949L22.2638 20.7285C22.3272 20.6639 22.4031 20.6124 22.4865 20.5771C22.5697 20.5419 22.6597 20.5239 22.7501 20.5234ZM14.9699 13.8027C13.526 13.8027 12.9103 14.4197 12.9103 15.8652V16.5527H28.0167V15.8652C28.0167 14.4197 27.4 13.8027 25.9562 13.8027H24.8126V14.4902C24.8126 14.6725 24.7402 14.8477 24.6115 14.9766C24.4827 15.1055 24.3072 15.1777 24.1251 15.1777C23.9432 15.1776 23.7685 15.1053 23.6398 14.9766C23.511 14.8477 23.4386 14.6725 23.4386 14.4902V13.8027H17.4874V14.4902C17.4874 14.6725 17.415 14.8477 17.2863 14.9766C17.1575 15.1053 16.9829 15.1777 16.8009 15.1777C16.6189 15.1777 16.4443 15.1053 16.3156 14.9766C16.1868 14.8477 16.1144 14.6725 16.1144 14.4902V13.8027H14.9699Z",fill:"#0046FF"})]})}),e.jsx("h2",{className:"text-white text-sm font-medium",children:((se=r==null?void 0:r.business_settings)==null?void 0:se.companyName)??""})]}),e.jsxs("div",{className:"p-6",children:[e.jsx("div",{className:"flex items-center justify-center mb-10",children:e.jsx("h1",{className:"text-[18px] font-semibold text-[#16803C] border border-[#90D4A7] rounded-lg bg-[#DCFCE7] inline-flex text-center px-5 py-[9px]",children:I(t.heading)||s("Email Heading","radius-booking")})}),e.jsx("div",{className:"text-title space-y-1 mb-6 whitespace-pre-line text-sm leading-[1]",children:I(t.additional_content)||s("Email content will appear here with dynamic variables...","radius-booking")}),i?e.jsxs("div",{className:"mb-6",children:[e.jsxs("div",{className:"bg-[#F5FAFF] border border-[#BDCFFF] rounded-lg p-[25px_30px] mb-4",children:[e.jsx("h3",{className:"font-semibold text-title mb-4",children:s("Meeting Details","radius-booking")}),e.jsxs("div",{className:"space-y-4 text-sm",children:[e.jsxs("div",{className:"flex justify-between pb-4 border-b border-[#CEDEEF]",children:[e.jsx("span",{className:"text-title2 font-medium",children:s("Meeting Type:","radius-booking")}),e.jsx("span",{className:"text-title font-semibold",children:n.meeting_type_name})]}),e.jsxs("div",{className:"flex justify-between pb-4 border-b border-[#CEDEEF]",children:[e.jsx("span",{className:"text-title2 font-medium",children:s("Host:","radius-booking")}),e.jsx("span",{className:"text-title",children:n.staff_name})]}),e.jsxs("div",{className:"flex justify-between pb-4 border-b border-[#CEDEEF]",children:[e.jsx("span",{className:"text-title2 font-medium",children:s("Date:","radius-booking")}),e.jsx("span",{className:"text-title",children:n.booking_date})]}),e.jsxs("div",{className:"flex justify-between pb-4 border-b border-[#CEDEEF]",children:[e.jsx("span",{className:"text-title2 font-medium",children:s("Time:","radius-booking")}),e.jsxs("span",{className:"text-title",children:[n.time," - ",n.end_time]})]}),e.jsxs("div",{className:"flex justify-between pb-4 border-b border-[#CEDEEF]",children:[e.jsx("span",{className:"text-title2 font-medium",children:s("Duration:","radius-booking")}),e.jsx("span",{className:"text-title",children:n.duration})]}),e.jsxs("div",{className:"flex justify-between pb-4 border-b border-[#CEDEEF]",children:[e.jsx("span",{className:"text-title2 font-medium",children:s("Location:","radius-booking")}),e.jsx("span",{className:"text-title",children:n.location})]}),n.meeting_price&&parseFloat(n.meeting_price)>0&&e.jsxs("div",{className:"flex justify-between pt-2",children:[e.jsx("span",{className:"text-title font-bold text-[16px]",children:s("Price:","radius-booking")}),e.jsxs("span",{className:"text-primary font-bold text-lg",children:[n.currency_symbol,n.meeting_price," ",e.jsxs("span",{className:"text-sm font-normal text-green-600",children:["(",n.payment_status,")"]})]})]})]})]}),e.jsxs("div",{className:"bg-[#EFF6FF] border border-[#BFDBFE] rounded-lg p-4 text-center",children:[e.jsx("p",{className:"text-sm font-semibold text-[#1E40AF] mb-3",children:s("Join Your Meeting","radius-booking")}),e.jsx("a",{href:"#",className:"inline-block px-6 py-2.5 bg-[#2563EB] text-white text-sm font-semibold rounded-lg no-underline",children:s("Join Google Meet","radius-booking")})]})]}):u?e.jsxs("div",{className:"mb-6 space-y-4",children:[e.jsx("div",{className:"border border-gray-200 rounded-lg overflow-hidden",children:[[s("Event","radius-booking"),n.event_name,!0],[s("Date","radius-booking"),n.event_date],[s("Time","radius-booking"),n.event_time],[s("Location","radius-booking"),n.event_location],[s("Organizer","radius-booking"),n.staff_name]].filter(([,a])=>a).map(([a,m,f],_)=>e.jsxs("div",{className:"flex border-b border-gray-100 last:border-b-0",children:[e.jsx("div",{className:"w-[35%] px-4 py-3 text-[13px] font-medium text-gray-500",children:a}),e.jsx("div",{className:`flex-1 px-4 py-3 text-[13px] text-gray-900 ${f?"font-semibold":""}`,children:m})]},_))}),n.all_tickets&&e.jsxs("div",{className:"border border-gray-200 rounded-lg overflow-hidden",children:[e.jsx("div",{className:"px-4 py-2.5 bg-gray-50 border-b border-gray-200",children:e.jsx("p",{className:"text-[11px] font-semibold text-gray-500 uppercase tracking-wider m-0",children:s("Your Tickets","radius-booking")})}),n.all_tickets.map((a,m)=>e.jsxs("div",{className:`px-4 py-3 ${m>0?"border-t border-gray-100":""}`,children:[e.jsxs("p",{className:"text-[13px] font-semibold text-gray-900 m-0",children:[a.quantity,"× ",a.name,a.price>0?e.jsxs("span",{className:"text-gray-500 font-normal ml-1",children:["($",(a.price*a.quantity).toFixed(2),")"]}):e.jsx("span",{className:"text-emerald-600 font-normal ml-1",children:s("Free","radius-booking")})]}),e.jsx("p",{className:"text-[11px] font-mono text-gray-400 tracking-wider m-0 mt-0.5",children:a.registration_number})]},m))]}),n.selected_sessions&&e.jsxs("div",{className:"border border-gray-200 rounded-lg overflow-hidden",children:[e.jsx("div",{className:"px-4 py-2.5 bg-gray-50 border-b border-gray-200",children:e.jsx("p",{className:"text-[11px] font-semibold text-gray-500 uppercase tracking-wider m-0",children:s("Selected Sessions","radius-booking")})}),e.jsx("div",{className:"px-4 py-3",children:e.jsx("p",{className:"text-[13px] text-gray-700 m-0 leading-relaxed",children:n.selected_sessions})})]})]}):e.jsxs("div",{className:"bg-[#F5FAFF] border border-[#BDCFFF] rounded-lg p-[25px_30px] mb-6",children:[e.jsx("h3",{className:"font-semibold text-title mb-4",children:s("Booking Details","radius-booking")}),e.jsxs("div",{className:"space-y-4 text-sm",children:[e.jsxs("div",{className:"flex justify-between pb-4 border-b border-[#CEDEEF]",children:[e.jsx("span",{className:"text-title2 font-medium",children:s("Service:","radius-booking")}),e.jsx("span",{className:"text-title font-semibold",children:n.service_name})]}),e.jsxs("div",{className:"flex justify-between pb-4 border-b border-[#CEDEEF]",children:[e.jsx("span",{className:"text-title2 font-medium",children:s("Date:","radius-booking")}),e.jsx("span",{className:"text-title",children:n.booking_date})]}),e.jsxs("div",{className:"flex justify-between pb-4 border-b border-[#CEDEEF]",children:[e.jsx("span",{className:"text-title2 font-medium",children:s("Time:","radius-booking")}),e.jsx("span",{className:"text-title",children:n.time})]}),e.jsxs("div",{className:"flex justify-between pb-4 border-b border-[#CEDEEF]",children:[e.jsx("span",{className:"text-title2 font-medium",children:s("Duration:","radius-booking")}),e.jsx("span",{className:"text-title",children:n.duration})]}),e.jsxs("div",{className:"flex justify-between pb-4 border-b border-[#CEDEEF]",children:[e.jsx("span",{className:"text-title2 font-medium",children:s("Staff:","radius-booking")}),e.jsx("span",{className:"text-title",children:n.staff_name})]}),e.jsxs("div",{className:"flex justify-between pb-4 border-b border-[#CEDEEF]",children:[e.jsx("span",{className:"text-title2 font-medium",children:s("Location:","radius-booking")}),e.jsx("span",{className:"text-title",children:n.location})]}),e.jsxs("div",{className:"flex justify-between pt-2",children:[e.jsx("span",{className:"text-title font-bold text-[16px]",children:s("Total Price:","radius-booking")}),e.jsx("span",{className:"text-primary font-bold text-lg",children:n.price})]})]})]}),t.footer_text&&e.jsx("div",{className:"text-title text-[14px] mb-6",children:I(t.footer_text)}),t.button_text&&e.jsx("div",{className:"text-center mb-6",children:e.jsx("button",{className:"bg-primary text-white px-8 py-3 rounded-lg font-medium hover:bg-blue-700 transition-colors shadow-md",children:t.button_text})}),e.jsxs("div",{className:"border-t border-border pt-6 mt-6 text-center text-xs text-title",children:[e.jsxs("p",{className:"mb-2 text-sm font-medium",children:[s("Booking ID:","radius-booking")," ",n.booking_id]}),e.jsxs("p",{className:"text-sm",children:[s("Questions? Reply to this email or call us at","radius-booking")," ",((ie=r==null?void 0:r.business_settings)==null?void 0:ie.phone)??"(555) 555 555 555"]}),e.jsxs("p",{className:"mt-3 text-sm text-small-font",children:["© ",new Date().getFullYear()," ",((te=r==null?void 0:r.business_settings)==null?void 0:te.companyName)??s("Your Business Name","radius-booking"),". ",s("All rights reserved.","radius-booking")]})]})]})]})})})]})})]})]})}function Pe(){const o=me("/notifications"),{mode:l}=o;q();const r=R(),y=N(d=>d(g).isEmailSaving(),[]),t=N(d=>d(g).getEmail(),[]),v=async()=>{await r(g).updateEmailSettings(t.id,t)},F=()=>{switch(l){case"list":return e.jsx(Ve,{});case"edit":return e.jsx(He,{});case"create":default:return null}},C=({edit:[{key:"update-email",label:s("Update","radius-booking"),icon:we,onClick:v,loading:y,variant:"primary"},{key:"cancel-email",label:s("Cancel","radius-booking"),icon:oe,onClick:o.navigateTo.list,variant:"cancel"}]}[l]||[]).map(d=>e.jsx(xe,{label:d.label,icon:d.icon,onClick:d.onClick,loading:d.loading||!1,variant:d.variant||"primary"},d.key));return e.jsx(ue,{title:s("Emails","radius-booking"),description:s("Manage notification emails sent to you and your customers","radius-booking"),showBack:l!=="list",onBack:o.navigateTo.list,actions:C,icon:e.jsx(A,{className:"w-5 h-5 text-primary-colordefault"}),children:F()})}const M=x.memo(Pe);function ks(){return e.jsxs(ye,{children:[e.jsx(T,{path:"/",element:e.jsx(M,{})}),e.jsx(T,{path:"create",element:e.jsx(M,{})}),e.jsx(T,{path:":id",element:e.jsx(M,{})}),e.jsx(T,{path:":id/edit",element:e.jsx(M,{})})]})}export{ks as default};
//# sourceMappingURL=index-CvV0pYdf.js.map
