"use strict";(globalThis.webpackChunkwp_event_solution=globalThis.webpackChunkwp_event_solution||[]).push([[760],{73051:(e,t,n)=>{n.d(t,{A:()=>i});var l=n(51609),a=n(54725),r=n(32099);function i(e){const{title:t,...n}=e;return(0,l.createElement)(r.A,{title:t,...n},(0,l.createElement)("span",null,"   ",(0,l.createElement)(a.InfoCircleFilled,{width:16,height:16,fill:"#747474"})))}},73296:(e,t,n)=>{n.d(t,{A:()=>E});var l=n(51609),a=n(86087),r=n(92911),i=n(60742),o=n(79888),s=n(90070),c=n(45708),m=n.n(c),d=n(73051),u=n(48842),p=n(6836),g=n(69815);const E=function(e){const{keyName:t,tooltip:n,label:c,initialValue:E,form:b,sx:v,emailPreset:x=["{%site_name%}","{%site_link%}","{%event_title%}","{%customer_name%}","{%customer_email%}","{%event_date%}","{%event_time%}","{%event_location%}"]}=e||{},f=(0,a.useRef)(),[_,h]=(0,a.useState)(""),A=({target:e})=>{const t=f.current.getEditor(),{index:n}=f?.current?.unprivilegedEditor.getSelection(!0);t?.insertText(n,e.value)},y=e=>{const{url:t}=e,n=f.current.getEditor();n.insertEmbed(n.getSelection().index,"image",t),n.setSelection(n.getSelection().index+1)},k=(0,a.useCallback)(()=>{(0,p.handleWpUploader)(y)},[]);(0,a.useEffect)(()=>{b.setFieldValue(t,E)},[]);const S=g.default.div`
		input {
			max-width: 180px;
			background-color: #f6f8f9;
			border-radius: 6px;
			padding: 5px;
			color: #6b7280;
			text-align: center;
			cursor: pointer;
			&:hover {
				background-color: #f6f8f9;
			}
		}
	`,w={toolbar:{container:[[{header:[1,2,3,4,5,!1]},{font:[]}],["bold","italic","underline","strike","blockquote"],[{list:"ordered"},{list:"bullet"},{indent:"-1"},{indent:"+1"}],["link","image"],["code-block"],[{color:[]},{background:[]}],["clean"]],handlers:{image:k}}};return(0,l.createElement)("div",{style:{borderRadius:"6px",backgroundColor:"white",padding:"15px"}},(0,l.createElement)(r.A,{alignItems:"center",style:{marginBottom:"20px"}},(0,l.createElement)(u.A,{style:{fontSize:"16px",color:"#414454",fontWeight:600}},c),n&&(0,l.createElement)(d.A,{title:n})),(0,l.createElement)(i.A.Item,{name:t},(0,l.createElement)(m(),{theme:"snow",modules:w,formats:["header","bold","italic","underline","strike","blockquote","list","bullet","indent","link","image","code-block","color","background"],value:_,onChange:e=>{h(e)},ref:f,style:{height:"300px",marginBottom:"65px",...v}})),(0,l.createElement)(s.A,{wrap:!0},x?.map((e,t)=>(0,l.createElement)(S,null,(0,l.createElement)(o.A,{readOnly:!0,key:t,value:e,onClick:A})))))}},88760:(e,t,n)=>{n.r(t),n.d(t,{default:()=>S});var l=n(51609),a=n(56427),r=n(86087),i=n(27723),o=n(93832),s=n(69815),c=n(16370),m=n(92911),d=n(60742),u=n(47152),p=n(36492),g=n(47767),E=n(54725),b=n(7638),v=n(75093),x=n(18062),f=n(73296),_=n(10012),h=n(57237),A=n(27154),y=n(64282);const k=s.default.div`
	background-color: #ffffff;
	border: 1px solid #e1e4e9;
	border-radius: 8px;
	padding: 20px 40px;
	margin-top: 40px;
	@media ( max-width: 768px ) {
		padding: 10px;
	}
`;function S(){const[e]=d.A.useForm(),{id:t}=(0,g.useParams)(),n=(0,g.useNavigate)(),[s,S]=(0,r.useState)(!1),w=t||localStorage.getItem("rsvpReportId");return(0,l.createElement)("div",{style:{backgroundColor:"#F3F5F7",marginTop:"-20px",height:"100vh"}},(0,l.createElement)(a.Fill,{name:A.PRIMARY_HEADER_NAME},(0,l.createElement)(m.A,{justify:"space-between",align:"center"},(0,l.createElement)(m.A,{align:"center",gap:16},(0,l.createElement)(b.Ay,{variant:b.Vt,icon:(0,l.createElement)(E.AngleLeftIcon,null),sx:{height:"36px",width:"36px",backgroundColor:"#fafafa",borderColor:"transparent",lineHeight:"1"},onClick:()=>{n(`/rsvp-report/${w}`)}}),(0,l.createElement)(x.A,{title:(0,i.__)("RSVP Reminder","eventin")})))),(0,l.createElement)(u.A,{gutter:[16,10],justify:"center",style:{margin:"20px 0px"}},(0,l.createElement)(c.A,{xs:22,md:14},(0,l.createElement)(h.A,{level:3,style:{fontSize:"24px",height:"32px",fontWeight:500}},(0,i.__)("Send RSVP Reminder Email","eventin")),(0,l.createElement)(k,null,(0,l.createElement)(d.A,{layout:"vertical",form:e,scrollToFirstError:!0,size:"large",onFinish:async()=>{S(!0);try{await e.validateFields();const t=e.getFieldsValue(!0),{from:l,subject:a,body:r,status:i}=t,s=(0,o.addQueryArgs)(`${w}/invitations`,{from:l,subject:a,body:r,status:i});(await y.A.rsvpReport.sendEmail(s)).success&&n(`/rsvp-report/${w}`)}catch(e){console.error("Couldn't send email!"),console.error(e)}finally{S(!1)}}},(0,l.createElement)(u.A,{gutter:[16,0]},(0,l.createElement)(c.A,{xs:24,style:{padding:"0px 20px"}},(0,l.createElement)(_.ks,{name:"from",label:(0,i.__)("Email From","eventin"),rules:[{required:!0,message:"From email is required!"}],placeholder:(0,i.__)("Sender's email","eventin"),size:"large"})),(0,l.createElement)(c.A,{xs:24,style:{padding:"0px 20px"}},(0,l.createElement)(_.ks,{name:"subject",label:(0,i.__)("Email Subject","eventin"),rules:[{required:!0,message:"Email Subject is required!"}],placeholder:(0,i.__)("Your email subject","eventin"),size:"large"})),(0,l.createElement)(c.A,{xs:24,style:{padding:"0px 20px"}},(0,l.createElement)(d.A.Item,{name:"status",label:(0,i.__)("Status","eventin")},(0,l.createElement)(p.A,{options:[{label:"Going",value:"going"},{label:"Not Going",value:"not_going"},{label:"Maybe",value:"maybe"}],size:"large"}))),(0,l.createElement)(c.A,{xs:24},(0,l.createElement)(f.A,{form:e,initialValue:"",keyName:"body",label:(0,i.__)("Email Body","eventin"),sx:{height:"200px"},emailPreset:["{%site_name%}","{%event_name%}","{%event_link%}","{%event_date%}","{%event_time%}","{%event_location%}"]}))),(0,l.createElement)(m.A,{gap:16,style:{marginTop:"10px",padding:"0px 15px"}},(0,l.createElement)(b.Ay,{variant:b.zB,loading:s,htmlType:"submit"},(0,i.__)("Send Email","eventin")),(0,l.createElement)(b.Ay,{variant:b.Rm,htmlType:"reset",onClick:()=>n("/rsvp-report")},(0,i.__)("Cancel","eventin"))))))),(0,l.createElement)(v.FloatingHelpButton,null))}}}]);