import{j as e,r as m}from"./client-BbMi5ewG.js";import{u as te,A as ae}from"./ActionButton-CK3Uoxvt.js";import{C as ie}from"./CrudLayout-Cx6KhKUY.js";import{a as P,s as u,u as f}from"./store-jX25q14N.js";import{c as X,a as W,X as ee}from"./utils-Q0fnGDhj.js";import{U as re}from"./User-GlgzYdD2.js";import{w as H,I as y}from"./withIconDefaults-C8UfSjn1.js";import{E as ne}from"./Envelope-B0dIWjoE.js";import{E as le}from"./Edit-C8qVzzd7.js";import{e as de,T as oe,a as $,b as _,c as ce,d as C}from"./Table-DCeFiyCp.js";import{S as me}from"./SkeletonTableRows-BrALmXl-.js";import"./input-DhCVOJC-.js";import"./select-CPHcJnpt.js";import"./Button-1dacbE2T.js";import{u as I,a as M,f as xe,R as ue,g as S}from"./index-CM0LBdHD.js";import{P as he}from"./plus-DcvXjop0.js";import{L as pe}from"./lock-DbcYKLM6.js";import{S as be}from"./save-CE8wXkbA.js";import"./vendor-DDjlQeP6.js";import"./loader-circle--S58donA.js";import"./ArrowLeftIcon-DrGyoHe_.js";import"./lodash-Bd-B7UeG.js";import"./defineProperty-DbXIQDXj.js";import"./typeof-QjJsDpFa.js";import"./apiConfig-D-T4C2Ae.js";import"./index-D59bwJy3.js";import"./toast-1-c8k_LJ.js";import"./skeleton-ImO4uxQ7.js";import"./index-CeptMk_f.js";import"./index-BbWn2ja9.js";import"./check-DMod5j-l.js";import"./preload-helper-Dp1pzeXC.js";import"./CalenderCheck-BuHSX8YD.js";import"./calendar-CjyQ6Zau.js";import"./tag-CvsOfBQf.js";import"./shield-Bmp_421z.js";import"./proxy-DChtKkEh.js";import"./circle-check-big-uMTsaxsq.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 ge=[["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"}]],je=X("monitor",ge);/**
 * @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"}]],ve=X("smartphone",fe);function Ne(){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 ye=H(Ne);function Ce(){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 we=H(Ce);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 Ee=H(_e);function ke(){const n=I(),l=P(u),r=f(s=>s(u).getEmails(),[]),v=f(s=>s(u).emailLoading(),[]),t=f(s=>s(u).getError(),[]),[j,E]=m.useState(""),[b,N]=m.useState("customer"),[d,D]=m.useState("all");m.useEffect(()=>{l.getEmails()},[l]);const h=r.filter(s=>{const x=s.name.toLowerCase().includes(j.toLowerCase())||s.subject.toLowerCase().includes(j.toLowerCase()),i=s.type===b,p=d==="all"||s.event===d;return x&&i&&p}),A=r.filter(s=>s.type==="customer").length,V=r.filter(s=>s.type==="employee").length,k=r.filter(s=>s.type==="admin").length,Z=async(s,x)=>{const i=r.find(F=>F.id===s);if(!i){alert("Template not found");return}const p={...i,enabled:!x};(await l.updateEmailSettings(s,p)).success||alert("Failed to update email status")},R=s=>{n(`${s}/edit/`)},o=s=>{switch(s){case"customer":return"text-primary";case"employee":return"text-purple-700";case"admin":return"text-green-700";default:return"text-title"}},B=[{id:"customer",label:"Customer Emails",count:A,icon:ne},{id:"employee",label:"Employee Emails",count:V,icon:re},{id:"admin",label:"Admin Emails",count:k,icon:ye}];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(M,{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:B.map(s=>{const x=s.icon;return e.jsxs("button",{onClick:()=>N(s.id),className:W("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]",b===s.id?"text-white bg-primary":"hover:bg-[#D9E0F1]"),children:[e.jsx(x,{className:"w-4 h-4"}),e.jsx("span",{className:"font-normal",children:s.label}),s.count>0&&e.jsxs("span",{className:"font-semibold",children:["(",String(s.count).padStart(2,"0"),")"]})]},s.id)})})}),e.jsxs(de,{children:[e.jsx(oe,{children:e.jsxs($,{className:"bg-muted/50",children:[e.jsx(_,{className:"text-title py-3 bg-[#F6F8FA] font-semibold",children:"Template Name"}),e.jsx(_,{className:"text-title py-3 bg-[#F6F8FA] font-semibold",children:"Event Status"}),e.jsx(_,{className:"text-title py-3 bg-[#F6F8FA] font-semibold",children:"Type"}),e.jsx(_,{className:"text-title py-3 bg-[#F6F8FA] font-semibold",children:"Status"}),e.jsx(_,{className:"text-title py-3 bg-[#F6F8FA] font-semibold text-right w-[80px]",children:"Actions"})]})}),e.jsx(ce,{children:v?e.jsx(me,{rowCount:5,columns:[5,3,2,2,1]}):h.length>0?h.map(s=>{var x,i;return e.jsxs($,{className:"hover:bg-muted/30 transition-colors even:bg-[#F6F8FA]",children:[e.jsx(C,{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(M,{className:"w-5 h-5 text-[#1d4ed8]"})}),e.jsxs("div",{children:[e.jsx("div",{className:"font-medium text-title text-[15px]",children:s.name}),e.jsx("div",{className:"text-sm text-small-font mt-0 text-[13px]",children:s.subject})]})]})}),e.jsx(C,{className:"border-t border-border py-3",children:e.jsx("span",{className:W("text-xs font-medium px-3 py-1 border","label-"+(s==null?void 0:s.status)),children:((x=s==null?void 0:s.status)==null?void 0:x.charAt(0).toUpperCase())+((i=s==null?void 0:s.status)==null?void 0:i.slice(1))})}),e.jsx(C,{className:"border-t border-border py-3",children:e.jsx("span",{className:`${o(s.type)} text-[14xp] font-medium`,children:s.type.charAt(0).toUpperCase()+s.type.slice(1)})}),e.jsx(C,{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 ${s.enabled?"bg-green-500":"bg-gray-400"}`}),e.jsx("span",{className:`text-sm font-medium ${s.enabled?"text-green-700":"text-small-font"}`,children:s.enabled?"Active":"Inactive"})]})}),e.jsx(C,{className:"border-t border-border py-3",children:e.jsxs("div",{className:"flex items-center justify-end gap-3",children:[e.jsx("button",{onClick:()=>R(s.id),className:"hover:bg-none hover:text-primary",title:"Edit template",children:e.jsx(le,{className:"w-4 h-4"})}),e.jsx("button",{onClick:p=>{p.stopPropagation(),Z(s.id,s.enabled)},className:"hover:bg-none",children:s.enabled?e.jsx(we,{size:"30px"}):e.jsx(Ee,{size:"30px"})})]})})]},s.id)}):e.jsx($,{children:e.jsx(C,{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(M,{className:"w-8 h-8 text-slate-400"})}),e.jsx("p",{className:"text-title font-medium text-lg mb-1",children:"No templates found"}),e.jsx("p",{className:"text-sm text-small-font",children:j||d!=="all"?"Try adjusting your search or filters":"Get started by creating your first email template"})]})})})})]}),!v&&h.length>0&&e.jsx("div",{className:"mt-4 text-center",children:e.jsxs("p",{className:"text-sm text-slate-600",children:["Showing ",e.jsx("span",{className:"font-medium text-title",children:h.length})," of"," ",e.jsx("span",{className:"font-medium text-title",children:r.filter(s=>s.type===b).length})," templates"]})})]})})}function Fe(){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((n,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((n,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 Se(){var L,F,U,q,O,J,z,Y,G,Q,K;const{id:n}=xe();I();const l=P(u),r=f(a=>a(u).getEmail(n),[n]),v=f(a=>a(u).emailLoading(),[]),[t,j]=m.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:[]}),E=!!((L=window.radius_booking_param)!=null&&L.is_pro),[b,N]=m.useState("desktop"),[d,D]=m.useState(!1),[h,A]=m.useState(""),[V,k]=m.useState(!1),[Z,R]=m.useState(!1);m.useEffect(()=>{n&&l.getEmail(n)},[n,l]),m.useEffect(()=>{r&&j({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 o=(a,c)=>{l.setEmailFormField(a,c)},B=async()=>{if(!h||!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(h)){alert("Please enter a valid email address");return}try{await l.sendTestEmail(n,h),k(!1),D(!0),setTimeout(()=>D(!1),3e3)}catch(a){console.error("Failed to send test email:",a),alert("Failed to send test email. Please try again.")}},s=((F=t.event)==null?void 0:F.includes("meeting"))||((U=t.id)==null?void 0:U.includes("meeting")),x=((q=t.event)==null?void 0:q.includes("event"))||((O=t.id)==null?void 0:O.includes("event")),i=s?{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:"Monday, October 20, 2025",time:"2:00 PM",end_time:"2:30 PM",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"}:x?{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:"Saturday, November 15, 2025",event_date:"Saturday, November 15, 2025",event_time:"9:00 AM - 5:00 PM",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:"Monday, October 20, 2025",time:"2:00 PM",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."},p=a=>{if(!a)return a;let c=a;return Object.keys(i).forEach(g=>{c=c.replace(new RegExp(`{${g}}`,"g"),i[g])}),c};return v?e.jsx(Fe,{}):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:"Test email sent successfully!"}),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:"Send Test Email"}),e.jsx("p",{className:"text-sm text-title2 mb-4",children:"Enter an email address to receive a test version of this template with sample data."}),e.jsx("input",{type:"email",value:h,onChange:a=>A(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:()=>k(!1),className:"px-4 py-2 text-title bg-gray-100 rounded-lg hover:bg-gray-200 transition-colors",children:"Cancel"}),e.jsx("button",{onClick:B,className:"px-4 py-2 bg-green-600 text-white rounded-lg hover:bg-green-700 transition-colors",children:"Send Test"})]})]})}),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:"Template Information"}),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?"● Active":"○ Inactive"})]}),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:"Template"}),e.jsx("p",{className:"text-sm font-semibold text-title",children:t.name||"Untitled Template"})]}),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:"Recipient"}),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:((J=t.type)==null?void 0:J.charAt(0).toUpperCase())+((z=t.type)==null?void 0:z.slice(1))})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-medium text-title2 uppercase mb-1",children:"Event"}),e.jsx("p",{className:"text-xs font-medium text-title",children:(Y=t.event)==null?void 0:Y.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:"Enable template"}),e.jsx("button",{type:"button",onClick:()=>o("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"}`})})]}),(n==null?void 0:n.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:"Send reminder before appointment"}),e.jsx("button",{type:"button",onClick:()=>o("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:"Remind before"}),e.jsxs("select",{value:t.reminder_minutes,onChange:a=>o("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:"5 minutes"}),e.jsx("option",{value:15,children:"15 minutes"}),e.jsx("option",{value:30,children:"30 minutes"}),e.jsx("option",{value:60,children:"1 hour"}),e.jsx("option",{value:120,children:"2 hours"}),e.jsx("option",{value:240,children:"4 hours"}),e.jsx("option",{value:360,children:"6 hours"}),e.jsx("option",{value:720,children:"12 hours"}),e.jsx("option",{value:1440,children:"24 hours"}),e.jsx("option",{value:2880,children:"2 days"}),e.jsx("option",{value:4320,children:"3 days"})]})]}),E?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:"Additional reminders"}),e.jsxs("button",{type:"button",onClick:()=>{const a=t.reminder_times||[];o("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(he,{className:"w-3 h-3"}),"Add"]})]}),(t.reminder_times||[]).length>0&&e.jsx("div",{className:"space-y-2",children:t.reminder_times.map((a,c)=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("select",{value:a,onChange:g=>{const w=[...t.reminder_times];w[c]=parseInt(g.target.value,10),o("reminder_times",w)},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:"5 minutes"}),e.jsx("option",{value:15,children:"15 minutes"}),e.jsx("option",{value:30,children:"30 minutes"}),e.jsx("option",{value:60,children:"1 hour"}),e.jsx("option",{value:120,children:"2 hours"}),e.jsx("option",{value:240,children:"4 hours"}),e.jsx("option",{value:360,children:"6 hours"}),e.jsx("option",{value:720,children:"12 hours"}),e.jsx("option",{value:1440,children:"24 hours"}),e.jsx("option",{value:2880,children:"2 days"}),e.jsx("option",{value:4320,children:"3 days"})]}),e.jsx("button",{type:"button",onClick:()=>{const g=t.reminder_times.filter((w,se)=>se!==c);o("reminder_times",g)},className:"p-1.5 text-red-500 hover:bg-red-50 rounded transition-colors",children:e.jsx(ee,{className:"w-3.5 h-3.5"})})]},c))})]}):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(pe,{className:"w-3.5 h-3.5"}),e.jsx("span",{children:"Multiple reminders available in Pro"})]})]})]})]})]})]}),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:"Email Content"})}),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:["Subject Line",e.jsx(y,{className:"w-4 h-4 text-gray-400"})]}),e.jsx("input",{type:"text",value:t.subject,onChange:a=>o("subject",a.target.value),placeholder:"e.g., Your booking is confirmed - {service_name}",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:["Email Heading",e.jsx(y,{className:"w-4 h-4 text-gray-400"})]}),e.jsx("input",{type:"text",value:t.heading,onChange:a=>o("heading",a.target.value),placeholder:"e.g., Booking Confirmed!",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:["Main Content",e.jsx(y,{className:"w-4 h-4 text-gray-400"})]}),e.jsx("textarea",{value:t.additional_content,onChange:a=>o("additional_content",a.target.value),placeholder:`Hi {customer_name},

Your booking for {service_name} has been confirmed! We look forward to seeing you.`,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:["Footer Text",e.jsx(y,{className:"w-4 h-4 text-gray-400"})]}),e.jsx("textarea",{value:t.footer_text,onChange:a=>o("footer_text",a.target.value),placeholder:"Need to reschedule? Click the button below to manage your 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:["Call-to-Action Button",e.jsx(y,{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=>o("button_text",a.target.value),placeholder:"Button text",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=>o("button_url",a.target.value),placeholder:"Button URL",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(y,{className:"w-4 h-4"}),"Available Variables"]}),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}"})," - Customer name"]}),e.jsxs("div",{children:[e.jsx("code",{className:"bg-blue-100 px-1.5 py-0.5 rounded",children:"{customer_email}"})," - Customer email"]}),e.jsxs("div",{children:[e.jsx("code",{className:"bg-blue-100 px-1.5 py-0.5 rounded",children:"{customer_phone}"})," - Customer phone"]}),e.jsxs("div",{children:[e.jsx("code",{className:"bg-blue-100 px-1.5 py-0.5 rounded",children:"{staff_name}"})," - Staff / Organizer"]}),e.jsxs("div",{children:[e.jsx("code",{className:"bg-blue-100 px-1.5 py-0.5 rounded",children:"{status}"})," - Status"]}),e.jsxs("div",{children:[e.jsx("code",{className:"bg-blue-100 px-1.5 py-0.5 rounded",children:"{booking_id}"})," - Booking ID"]}),x?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}"})," - Event name"]}),e.jsxs("div",{children:[e.jsx("code",{className:"bg-blue-100 px-1.5 py-0.5 rounded",children:"{event_date}"})," - Event date"]}),e.jsxs("div",{children:[e.jsx("code",{className:"bg-blue-100 px-1.5 py-0.5 rounded",children:"{event_time}"})," - Event time"]}),e.jsxs("div",{children:[e.jsx("code",{className:"bg-blue-100 px-1.5 py-0.5 rounded",children:"{event_location}"})," - Location"]}),e.jsxs("div",{children:[e.jsx("code",{className:"bg-blue-100 px-1.5 py-0.5 rounded",children:"{ticket_name}"})," - Ticket type"]}),e.jsxs("div",{children:[e.jsx("code",{className:"bg-blue-100 px-1.5 py-0.5 rounded",children:"{ticket_quantity}"})," - Ticket qty"]}),e.jsxs("div",{children:[e.jsx("code",{className:"bg-blue-100 px-1.5 py-0.5 rounded",children:"{registration_number}"})," - Reg #"]})]}):s?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}"})," - Meeting type"]}),e.jsxs("div",{children:[e.jsx("code",{className:"bg-blue-100 px-1.5 py-0.5 rounded",children:"{meeting_link}"})," - Meeting link"]}),e.jsxs("div",{children:[e.jsx("code",{className:"bg-blue-100 px-1.5 py-0.5 rounded",children:"{booking_date}"})," - Date"]}),e.jsxs("div",{children:[e.jsx("code",{className:"bg-blue-100 px-1.5 py-0.5 rounded",children:"{time}"})," - Time"]}),e.jsxs("div",{children:[e.jsx("code",{className:"bg-blue-100 px-1.5 py-0.5 rounded",children:"{duration}"})," - Duration"]}),e.jsxs("div",{children:[e.jsx("code",{className:"bg-blue-100 px-1.5 py-0.5 rounded",children:"{location}"})," - Location"]})]}):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}"})," - Service name"]}),e.jsxs("div",{children:[e.jsx("code",{className:"bg-blue-100 px-1.5 py-0.5 rounded",children:"{booking_date}"})," - Date"]}),e.jsxs("div",{children:[e.jsx("code",{className:"bg-blue-100 px-1.5 py-0.5 rounded",children:"{time}"})," - Time"]}),e.jsxs("div",{children:[e.jsx("code",{className:"bg-blue-100 px-1.5 py-0.5 rounded",children:"{duration}"})," - Duration"]}),e.jsxs("div",{children:[e.jsx("code",{className:"bg-blue-100 px-1.5 py-0.5 rounded",children:"{location}"})," - Location"]}),e.jsxs("div",{children:[e.jsx("code",{className:"bg-blue-100 px-1.5 py-0.5 rounded",children:"{price}"})," - Price"]})]})]})]})]}),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:"Live Preview"}),e.jsx("span",{className:"text-xs text-title2",children:"Using sample data"})]}),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:()=>N("desktop"),className:`p-2 h-[30px] rounded ${b==="desktop"?"bg-white shadow-sm":"text-title2"}`,title:"Desktop view",children:e.jsx(je,{className:"w-4 h-4"})}),e.jsx("button",{onClick:()=>N("mobile"),className:`p-2 h-[30px] rounded ${b==="mobile"?"bg-white shadow-sm":"text-title2"}`,title:"Mobile view",children:e.jsx(ve,{className:"w-4 h-4"})})]})]}),e.jsx("div",{className:`mx-auto transition-all ${b==="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:((G=r==null?void 0:r.business_settings)==null?void 0:G.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:p(t.heading)||"Email Heading"})}),e.jsx("div",{className:"text-title space-y-1 mb-6 whitespace-pre-line text-sm leading-[1]",children:p(t.additional_content)||"Email content will appear here with dynamic variables..."}),s?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:"Meeting Details"}),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:"Meeting Type:"}),e.jsx("span",{className:"text-title font-semibold",children:i.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:"Host:"}),e.jsx("span",{className:"text-title",children:i.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:"Date:"}),e.jsx("span",{className:"text-title",children:i.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:"Time:"}),e.jsxs("span",{className:"text-title",children:[i.time," - ",i.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:"Duration:"}),e.jsx("span",{className:"text-title",children:i.duration})]}),e.jsxs("div",{className:"flex justify-between pb-4 border-b border-[#CEDEEF]",children:[e.jsx("span",{className:"text-title2 font-medium",children:"Location:"}),e.jsx("span",{className:"text-title",children:i.location})]}),i.meeting_price&&parseFloat(i.meeting_price)>0&&e.jsxs("div",{className:"flex justify-between pt-2",children:[e.jsx("span",{className:"text-title font-bold text-[16px]",children:"Price:"}),e.jsxs("span",{className:"text-primary font-bold text-lg",children:[i.currency_symbol,i.meeting_price," ",e.jsxs("span",{className:"text-sm font-normal text-green-600",children:["(",i.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:"Join Your Meeting"}),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:"Join Google Meet"})]})]}):x?e.jsxs("div",{className:"mb-6 space-y-4",children:[e.jsx("div",{className:"border border-gray-200 rounded-lg overflow-hidden",children:[["Event",i.event_name,!0],["Date",i.event_date],["Time",i.event_time],["Location",i.event_location],["Organizer",i.staff_name]].filter(([,a])=>a).map(([a,c,g],w)=>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 ${g?"font-semibold":""}`,children:c})]},w))}),i.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:"Your Tickets"})}),i.all_tickets.map((a,c)=>e.jsxs("div",{className:`px-4 py-3 ${c>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:"Free"})]}),e.jsx("p",{className:"text-[11px] font-mono text-gray-400 tracking-wider m-0 mt-0.5",children:a.registration_number})]},c))]}),i.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:"Selected Sessions"})}),e.jsx("div",{className:"px-4 py-3",children:e.jsx("p",{className:"text-[13px] text-gray-700 m-0 leading-relaxed",children:i.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:"Booking Details"}),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:"Service:"}),e.jsx("span",{className:"text-title font-semibold",children:i.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:"Date:"}),e.jsx("span",{className:"text-title",children:i.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:"Time:"}),e.jsx("span",{className:"text-title",children:i.time})]}),e.jsxs("div",{className:"flex justify-between pb-4 border-b border-[#CEDEEF]",children:[e.jsx("span",{className:"text-title2 font-medium",children:"Duration:"}),e.jsx("span",{className:"text-title",children:i.duration})]}),e.jsxs("div",{className:"flex justify-between pb-4 border-b border-[#CEDEEF]",children:[e.jsx("span",{className:"text-title2 font-medium",children:"Staff:"}),e.jsx("span",{className:"text-title",children:i.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:"Location:"}),e.jsx("span",{className:"text-title",children:i.location})]}),e.jsxs("div",{className:"flex justify-between pt-2",children:[e.jsx("span",{className:"text-title font-bold text-[16px]",children:"Total Price:"}),e.jsx("span",{className:"text-primary font-bold text-lg",children:i.price})]})]})]}),t.footer_text&&e.jsx("div",{className:"text-title text-[14px] mb-6",children:p(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:["Booking ID: ",i.booking_id]}),e.jsxs("p",{className:"text-sm",children:["Questions? Reply to this email or call us at ",((Q=r==null?void 0:r.business_settings)==null?void 0:Q.phone)??"(555) 555 555 555"]}),e.jsxs("p",{className:"mt-3 text-sm text-small-font",children:["© ",new Date().getFullYear()," ",((K=r==null?void 0:r.business_settings)==null?void 0:K.companyName)??"Your Business Name",". All rights reserved."]})]})]})]})})})]})})]})]})}function Te(){const n=te("/notifications"),{mode:l}=n;I();const r=P(),v=f(d=>d(u).isEmailSaving(),[]),t=f(d=>d(u).getEmail(),[]),j=async()=>{await r(u).updateEmailSettings(t.id,t)},E=()=>{switch(l){case"list":return e.jsx(ke,{});case"edit":return e.jsx(Se,{});case"create":default:return null}},N=({edit:[{key:"update-email",label:"Update",icon:be,onClick:j,loading:v,variant:"primary"},{key:"cancel-email",label:"Cancel",icon:ee,onClick:n.navigateTo.list,variant:"cancel"}]}[l]||[]).map(d=>e.jsx(ae,{label:d.label,icon:d.icon,onClick:d.onClick,loading:d.loading||!1,variant:d.variant||"primary"},d.key));return e.jsx(ie,{title:"Emails",description:"Manage notification emails sent to you and your customers",showBack:l!=="list",onBack:n.navigateTo.list,actions:N,icon:e.jsx(M,{className:"w-5 h-5 text-primary-colordefault"}),children:E()})}const T=m.memo(Te);function ps(){return e.jsxs(ue,{children:[e.jsx(S,{path:"/",element:e.jsx(T,{})}),e.jsx(S,{path:"create",element:e.jsx(T,{})}),e.jsx(S,{path:":id",element:e.jsx(T,{})}),e.jsx(S,{path:":id/edit",element:e.jsx(T,{})})]})}export{ps as default};
//# sourceMappingURL=index-6-QFfM7q.js.map
