1"use strict";(globalThis.webpackChunkbixjet_ai=globalThis.webpackChunkbixjet_ai||[]).push([[8996],{27781(e,o,t){t.d(o,{F6:()=>i,U9:()=>l,br:()=>r,xI:()=>s});const n=e=>{try{return JSON.parse(localStorage.getItem(e)||"null")}catch{return null}},i=()=>n("userid"),r=()=>n("location_Id"),l=()=>n("business_Id"),s=()=>({userId:i(),locationId:r(),businessId:l()})},8996(e,o,t){t.r(o),t.d(o,{default:()=>Ze});var n=t(9950),i=t(28429),r=t(10300),l=t(16491),s=t(4862),a=t(65429),d=t(82053),c=t(93230),u=t(10226),x=t(46639),h=t(37324),p=t(60899),m=t(8145),f=t(25979),b=t(70006),g=t(23266),v=t(93125),A=t(39919),y=t(58567),j=t(16497),S=t(85815),k=t(2046),w=t(93038),C=t(82917),z=t(83274),I=t(25333),W=t(74616),F=t(46986),R=t(25277),L=t(45546),B=t(74745),T=t(63464),D=t(40033),M=t(28170),E=t(79739),$=t(20544),q=t(92098),P=t(66677),N=t(4983),O=t(69935),U=t(8808),V=t(58531),_=t(21611),H=t(9493),J=t(48863),G=t(18726),K=t(99532),Y=t(26592),Z=t(80504),Q=t(19223),X=t(18727),ee=t(65586),oe=t(52860),te=t(20803),ne=t(83120),ie=t(17033),re=t(88864),le=t(89767),se=t(92613),ae=t(50521),de=t(83094),ce=t(66715),ue=t(77948),xe=t(7771),he=t(64902),pe=t(60552),me=t(63149),fe=t.n(me),be=t(45245),ge=t(81282),ve=t(27781),Ae=t(24921),ye=t(16243),je=t(47359),Se=t(351),ke=t(1050),we=t(90288),Ce=t(36669),ze=t(44414);const Ie=pe.J1` 2 mutation uploadimg($images: [Upload!]) { 3 uploadimg(images: $images) { 4 images 5 } 6 } 7`;async function We(e){var o,t;if(!e)return null;const n=function(){const e={Authorization:`Bearer ${"undefined"!==typeof localStorage?localStorage.getItem("token"):""}`,businessid:"undefined"!==typeof localStorage?JSON.parse(localStorage.getItem("business_Id")||"null"):null,locationid:"undefined"!==typeof localStorage?JSON.parse(localStorage.getItem("location_Id")||"null"):null,"Apollo-Require-Preflight":"true"},o=fe()({uri:ye.A.contactApi,headers:e}),t=new xe.C((o,t)=>(o.setContext({headers:e}),t(o)));return new ue.R({link:t.concat(o),cache:new he.D})}(),i=await n.mutate({mutation:Ie,variables:{images:[e]}});return(null===i||void 0===i||null===(o=i.data)||void 0===o||null===(t=o.uploadimg)||void 0===t?void 0:t.images)||null}const Fe={text:"#0F172A",muted:"#64748B",ph:"#94A3B8",border:"#E2E8F0",focus:"#5B5FEF",bg:"#F8FAFF",err:"#EF4444"},Re="'Plus Jakarta Sans',sans-serif",Le=42,Be={fontSize:12.5,fontWeight:700,color:Fe.text,mb:.5,display:"block",fontFamily:Re,letterSpacing:-.1},Te=e=>({"& .MuiOutlinedInput-root":{height:Le,borderRadius:"10px",bgcolor:Fe.bg,fontSize:13.5,fontFamily:Re,"& fieldset":{borderColor:e?Fe.err:Fe.border,borderWidth:"1.5px"},"&:hover fieldset":{borderColor:e?Fe.err:"#94A3B8"},"&.Mui-focused fieldset":{borderColor:e?Fe.err:Fe.focus,borderWidth:"2px"},"& input":{color:Fe.text,height:Le,boxSizing:"border-box"},"& input::placeholder":{color:Fe.ph,opacity:1}}}),De=(e,o)=>({height:Le,borderRadius:"10px",bgcolor:Fe.bg,fontSize:13.5,fontFamily:Re,color:o?Fe.text:Fe.ph,"& fieldset":{borderColor:e?Fe.err:Fe.border,borderWidth:"1.5px"},"&:hover fieldset":{borderColor:e?Fe.err:"#94A3B8"},"&.Mui-focused fieldset":{borderColor:e?Fe.err:Fe.focus,borderWidth:"2px"}}),Me=["Event Details","Availability","Form Design","Share"],Ee=["Microsoft Teams","Google Meet","Zoom","Skype","Cisco Webex Meetings","GoToMeeting","BlueJeans","Adobe Connect","Slack","Discord","Whereby","Zoho Meeting","Join.me","TeamViewer","Other"],$e=["Microsoft Teams","Google Meet"],qe=[15,30,45,60,90,120],Pe=[{value:5,label:"5 min"},{value:10,label:"10 min"},{value:15,label:"15 min"},{value:30,label:"30 min"},{value:45,label:"45 min"},{value:60,label:"1 hr"},{value:90,label:"1 hr 30 min"},{value:120,label:"2 hr"}],Ne=[{key:"SUN",label:"Sun"},{key:"MON",label:"Mon"},{key:"TUE",label:"Tue"},{key:"WED",label:"Wed"},{key:"THU",label:"Thu"},{key:"FRI",label:"Fri"},{key:"SAT",label:"Sat"}],Oe=()=>{const e={};return Ne.forEach(o=>{e[o.key]={enabled:!["SUN","SAT"].includes(o.key),start:"09:00",end:"17:00"}}),e},Ue={placeholder:"Welcome to my scheduling page\u2026",minHeight:110,toolbarSticky:!1,buttons:["bold","italic","underline","|","ul","ol","|","link","|","undo","redo"],readonly:!1},Ve={1:"Textbox",2:"Multiline",3:"Single checkbox",4:"Multiple checkbox",5:"Dropdown",6:"Radio",7:"Date picker",8:"Number",9:"Phone number",10:"Rating",11:"Divider",12:"Divider",13:"Label",14:"Image",15:"Section"}
7,_e=[{fieldtype:13,name:"Label",objecttype:"Designing",propertyid:"19384760-3380-4e09-a657-9306887098a2",propertyname:"Label",value:"Enter Details"},{dbfieldname:"firstname"},{dbfieldname:"lastname"},{dbfieldname:"primaryemail"},{dbfieldname:"phonenumber"},{dbfieldname:"jobid"},{dbfieldname:"linkedin"},{dbfieldname:"name"},{dbfieldname:"orgwebsite"}],He=[{key:"contact",label:"Contact",icon:ee.A,color:"#5B5FEF"},{key:"organization",label:"Organization",icon:te.A,color:"#8B5CF6"},{key:"deals",label:"Deals",icon:ne.A,color:"#EC4899"},{key:"designing",label:"Design Fields",icon:ie.A,color:"#F59E0B"}],Je=[{propertyid:"design_label_default",propertyname:"Label",name:"Label",objecttype:"designing",fieldtype:13,value:"Enter Details"},{propertyid:"design_section_default",propertyname:"Section",name:"Section",objecttype:"designing",fieldtype:15,value:"Section Header"},{propertyid:"design_divider_default",propertyname:"Divider",name:"Divider",objecttype:"designing",fieldtype:12},{propertyid:"design_image_default",propertyname:"Image",name:"Image",objecttype:"designing",fieldtype:14,value:""}],Ge=new Set(["Section","Divider","Label","Image"]),Ke=new Set(["firstname"]),Ye=e=>Ke.has(((null===e||void 0===e?void 0:e.dbfieldname)||"").toLowerCase());function Ze(){const{id:e}=(0,i.g)(),o=(0,i.Zp)(),t=(0,r.wA)(),d=(0,r.d4)(e=>e.appointments.activeEvent),c=(0,r.d4)(e=>e.appointments.activeEventTimeAvailability),u=(0,r.d4)(e=>e.appointments.saving),{businessId:x,locationId:h}=(0,ve.xI)(),p=JSON.parse(localStorage.getItem("user")),m=!!e,[f,b]=(0,n.useState)(0),[g,v]=(0,n.useState)(e||null),[A,y]=(0,n.useState)(null),[j,S]=(0,n.useState)([]),[k,w]=(0,n.useState)(!1),[C,z]=(0,n.useState)(null);(0,n.useEffect)(()=>{const e=h||(()=>{try{return JSON.parse(localStorage.getItem("location_Id"))}catch{return null}})();e&&(0,Ae.e6)(ye.A.baseURLApi,{query:we.wC,variables:{entityid:e}}).then(e=>{var o,t;const n=null===e||void 0===e||null===(o=e.data)||void 0===o||null===(t=o.entity)||void 0===t?void 0:t.subdomain;n&&z(n)}).catch(()=>{})},[]);const[I,W]=(0,n.useState)(""),[F,R]=(0,n.useState)("Welcome to my scheduling page. Please follow the instructions to add an event to my calendar."),[L,B]=(0,n.useState)("Microsoft Teams"),[T,D]=(0,n.useState)(""),[M,E]=(0,n.useState)(30),[$,q]=(0,n.use
7State)(!0),[P,N]=(0,n.useState)("3"),[O,U]=(0,n.useState)(60),[V,_]=(0,n.useState)(""),[H,J]=(0,n.useState)(""),[G,K]=(0,n.useState)(!1),[Y,Z]=(0,n.useState)("<p>By continuing, you are agreeing to the Terms of Service and Privacy Policy.</p>"),[Q,X]=(0,n.useState)(!0),[ee,oe]=(0,n.useState)(""),[te,ne]=(0,n.useState)(Oe),[ie,re]=(0,n.useState)(15),[le,se]=(0,n.useState)(15),[ae,de]=(0,n.useState)(!1),[ce,ue]=(0,n.useState)(!1),[xe,he]=(0,n.useState)(!0),[pe,me]=(0,n.useState)(!1),[fe,Ce]=(0,n.useState)(_e),[Ie,We]=(0,n.useState)("vertical"),[Le,Be]=(0,n.useState)("vertical"),[Te,De]=(0,n.useState)("#5B5FEF"),[Ee,qe]=(0,n.useState)("#ffffff"),[Pe,Ue]=(0,n.useState)("#0f172a"),[Ve,He]=(0,n.useState)("#000000"),[Je,Ge]=(0,n.useState)("Schedule Event"),[Ke,Ye]=(0,n.useState)("center"),[Ze,eo]=(0,n.useState)("#5B5FEF"),[oo,to]=(0,n.useState)("#ffffff"),[no,io]=(0,n.useState)(!0),[ro,lo]=(0,n.useState)(!1),[uo,xo]=(0,n.useState)(""),[ho,po]=(0,n.useState)([]),[mo,fo]=(0,n.useState)(!1),[go,vo]=(0,n.useState)(!1),[Ao,yo]=(0,n.useState)(""),[jo,So]=(0,n.useState)([]),[ko,wo]=(0,n.useState)(!1),[Co,zo]=(0,n.useState)(""),[Io,Wo]=(0,n.useState)([]),[Fo,Ro]=(0,n.useState)(!1),[Lo,Bo]=(0,n.useState)(""),[To,Do]=(0,n.useState)([]),[Mo,Eo]=(0,n.useState)(!1),[$o,qo]=(0,n.useState)(""),[Po,No]=(0,n.useState)([]),[Oo,Uo]=(0,n.useState)(!1),[Vo,_o]=(0,n.useState)(0);(0,n.useEffect)(()=>{3===f&&h&&(wo(!0),(0,Ae.e6)(ye.A.emailFinderApi,{query:je.B_,variables:{locationid:h}}).then(e=>{var o;So(((null===e||void 0===e||null===(o=e.data)||void 0===o?void 0:o.linkedinAccountByBusiness)||[]).map(e=>({account_id:e.account_id,username:e.username})))}).catch(()=>{}).finally(()=>wo(!1)),fo(!0),(0,Ae.e6)(ye.A.emailFinderApi,{query:Se.bz,variables:{locationid:h}}).then(e=>{var o;po((null===e||void 0===e||null===(o=e.data)||void 0===o?void 0:o.whatsAppAccountByBusiness)||[])}).catch(()=>{}).finally(()=>fo(!1)),Ro(!0),(0,Ae.e6)(ye.A.baseURLApi,{query:ke.aX,variables:{locationid:h,pageNumber:1,pageSize:100}}).then(e=>{var o,t;Wo((null===e||void 0===e||null===(o=e.data)||void 0===o||null===(t=o.workflowAutomationsByLocation)||void 0===t?void 0:t.rows)||[])}).catch(()=>{}).finally(()=>Ro(!1)),Eo(!0),(0,Ae.e6)(ye.A.baseURLApi,{query:je.rg,variables:{locationid:h,pageNumber:1,pageSize:100}}).then(e=>{var o,t;Do((null===e||void 0===e||null===(o=e.data)||void 0===o||null===(t=o.linkedinAutomationsByLocation)||void 0===t?void 0:t.rows)||[])}).catch(()=>{}).finally(()=>Eo(!1)),Uo(!0),(0,Ae.e6)(ye.A.baseURLApi,{query:Se.Rt,variables:{locationid:h,pageNumber:1,pageSize:100}}).then(e=>{var o,t;No((null===e||void 0===e||null===(o=e.data)||void 0===o||null===(t=o.whatsappAutomationsByLocation)||void 0===t?void 0:t.rows)||[])}).catch(()=>{}).finally(()=>Uo(!1)))},[f,h]),(0,n.useEffect)(()=>(e&&(t((0,be.vR)(e)),t((0,be.hN)(e))),()=>t((0,be.K)())),[e,t]),(0,n.useEffect)(()=>{x&&(w(!0),t((0,ge.TQ)({businessid:x,objecttype:["contact","organization","deals"]})).then(e=>{w(!1),null!==e&&void 0!==e&&e.error||S(e.payload||[])}))},[t,x]),(0,n.useEffect)(()=>{var e;if(!d)return;v(d.eventid),W(d.name||""),d.description&&R(d.description),B(d.platform||"Microsoft Teams"),D(d.location||""),E(Number(d.eventduration)||30),q(!1!==d.islinkvisible),N(String(null!==(e=d.eventdaterangtype)&&void 0!==e?e:3)),U(Number(d.scheduleday)||60),_(d.eventstartdate&&"Invalid date"!==d.eventstartdate?d.eventstartdate:""),J(d.eventenddate&&"Invalid date"!==d.eventenddate?d.eventenddate:""),K(!!d.termenable),d.termdesc&&Z(d.termdesc),X(!1!==d.isshowfooterlogo),oe(d.redirecturl||"");const o=Number(d.beforeeventbuffer||0),t=Number(d.aftereventbuffer||0);if(re(o||15),se(t||15),de(o>0),ue(t>0),he(!1!==d.isshowuseravatar),me(!!d.isshowlogo),We(d.radioview||"vertical"),Be(d.checkboxview||"vertical"),d.themecolor&&De(d.themecolor),d.backgroundcolor&&qe(d.backgroundcolor),d.textcolor&&Ue(d.textcolor),d.fieldtextcolor&&He(d.fieldtextcolor),d.calloutbuttontext&&Ge(d.calloutbuttontext),d.calloutbtnposition&&Ye(d.calloutbtnposition),d.btnthemecolor&&eo(d.btnthemecolor),d.btntextcolor&&to(d.btntextcolor),d.formdata)try{const e=JSON.parse(d.formdata);Array.isArray(e)&&e.length>0&&Ce(e)}catch{}io(!1!==d.isemailreminders),lo(!!d.isenablewhatsappreminder),xo(d.whatsappaccountid||""),vo(!!d.isenablelinkedinreminder),yo(d.linkedinaccountid||""),zo(d.workflowid||""),Bo(d.linkedinautomationid||""),qo(d.whatsappautomationid||""),_o(e=>e+1)},[d]),(0,n.useEffect)(()=>
7{if(!Array.isArray(c)||0===c.length)return;const e=Oe();Object.keys(e).forEach(o=>{e[o].enabled=!1}),c.forEach(o=>{null!==o&&void 0!==o&&o.day&&e[o.day]&&(e[o.day]={enabled:!0,start:Xe(o.starttime),end:Xe(o.endtime)})}),ne(e)},[c]);const Ho=(0,n.useCallback)(e=>{const o=[];if(0===e&&(I.trim()||o.push("Event Name is required"),L||o.push("Select platform"),$e.includes(L)||T.trim()||o.push("Location is required"),M||o.push("Pick a duration"),ee&&!/^https?:\/\/.+/.test(ee.trim())&&o.push("Redirect URL must start with http:// or https://")),1===e){Ne.some(e=>te[e.key].enabled)||o.push("Pick at least one weekly day"),Ne.forEach(e=>{const t=te[e.key];t.enabled&&t.start>=t.end&&o.push(`${e.label}: end time must be after start time`)})}if(2===e)if(fe&&0!==fe.length){fe.find(e=>"firstname"===((null===e||void 0===e?void 0:e.dbfieldname)||"").toLowerCase()||((null===e||void 0===e?void 0:e.name)||"").toLowerCase().includes("first name"))||o.push("First Name field is required in form")}else o.push("Please add at least one form field");return o},[I,L,T,M,te,fe,ee]),Jo=(0,n.useCallback)(()=>{const e=/^\d{4}-\d{2}-\d{2}$/,o="2"===String(P)&&e.test(V||"")&&e.test(H||"");return{name:I,eventtype:"One-on-One",location:$e.includes(L)?"":T,description:F,eventduration:Number(M),eventdaterangtype:Number(P),scheduletype:1,scheduleday:Number(O),...o?{eventstartdate:V,eventenddate:H}:{},platform:L,islinkvisible:$,termenable:G,termdesc:G?Y:"",isshowfooterlogo:Q,isshowlogo:pe,fieldtextcolor:Ve,redirecturl:ee||"",timezone:Intl.DateTimeFormat().resolvedOptions().timeZone,username:((null===p||void 0===p?void 0:p.lastname)||"").trim()?`${((null===p||void 0===p?void 0:p.firstname)||"").trim().charAt(0).toLowerCase()}${((null===p||void 0===p?void 0:p.lastname)||"").trim().charAt(0).toLowerCase()}`:((null===p||void 0===p?void 0:p.firstname)||"").trim().toLowerCase().replace(/\s+/g,"")}},[I,L,T,F,M,P,O,V,H,$,G,Y,Q,pe,Ve,ee]),Go=(0,n.useCallback)(()=>({eventid:g,name:I,description:F,platform:L,location:$e.includes(L)?"":T,beforeeventbuffer:ae?Number(ie):0,aftereventbuffer:ce?Number(le):0,isshowphoneicon:!1,isshowwhatsappicon:!1,isshowiosicon:!1,isshowandroidicon:!1,isshowuseravatar:xe,isshowlogo:pe,isshowfooterlogo:Q,termenable:G,termdesc:G?Y:"",fieldtextcolor:Ve,redirecturl:ee||"",username:((null===p||void 0===p?void 0:p.lastname)||"").trim()?`${((null===p||void 0===p?void 0:p.firstname)||"").trim().charAt(0).toLowerCase()}${((null===p||void 0===p?void 0:p.lastname)||"").trim().charAt(0).toLowerCase()}`:((null===p||void 0===p?void 0:p.firstname)||"").trim().toLowerCase().replace(/\s+/g,"")}),[g,I,F,L,T,ie,le,ae,ce,xe,pe,Q,G,Y,Ve,ee]),Ko=(0,n.useCallback)(()=>({eventid:g,name:I,formdata:JSON.stringify(fe),platform:L,location:$e.includes(L)?"":T,themecolor:Te,backgroundcolor:Ee,textcolor:Pe,fieldtextcolor:Ve,radioview:Ie,checkboxview:Le,calloutbuttontext:Je,calloutbtnposition:Ke,btnthemecolor:Ze,btntextcolor:oo,isshowlogo:pe,username:((null===p||void 0===p?void 0:p.lastname)||"").trim()?`${((null===p||void 0===p?void 0:p.firstname)||"").trim().charAt(0).toLowerCase()}${((null===p||void 0===p?void 0:p.lastname)||"").trim().charAt(0).toLowerCase()}`:((null===p||void 0===p?void 0:p.firstname)||"").trim().toLowerCase().replace(/\s+/g,"")}),[g,I,fe,L,T,Te,Ee,Pe,Ve,Ie,Le,Je,Ke,Ze,oo,pe]),Yo=(0,n.useCallback)(()=>Ne.filter(e=>te[e.key].enabled).map(e=>({day:e.key,starttime:te[e.key].start,endtime:te[e.key].end})),[te]),Zo=e=>b(e),Qo=(0,n.useCallback)(async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Reminder settings saved";if(!g)return;const n=await t((0,be.qM)({eventid:g,name:I,platform:L,location:$e.includes(L)?"":T,...e}));n.error?y({severity:"error",message:n.payload||"Couldn't save reminder settings."}):y({severity:"success",message:o})},[t,g,I,L,T]),Xo=(0,n.useCallback)(async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Sequence settings saved";if(!g)return;const n=await t((0,be.qM)({eventid:g,name:I,platform:L,location:$e.includes(L)?"":T,...e}));n.error?y({severity:"error",message:n.payload||"Couldn't save sequence settings."}):y({severity:"success",message:o})},[t,g,I,L,T]),et=(0,n.useMemo)(()=>{const e=C?`https://${C}${ye.A.subDomainUrl||""}`:(null===ye.A||void 0===ye.A?void 0:ye.A.BixUrl)||("undefined"!==typeof window?window.location.origin:"");return null!==d&&void 0!==d&&d.shorturl?`${e}/appointment/${d.shorturl}`:null!==d&&void 0!==d&&d.eventid?`${e}/appointment/${d.eventid}`:null},[d,C]);return(0,ze.jsxs)(l.A,{sx:{display:"flex",flexDirection:"column",minHeight:{xs:"auto",md:"calc(100vh - 70px)"},bgcolor:Fe.bg,fontFamily:Re},children:[(0,ze.jsx)(Qe,{step:f,eventName:I,isEdit:m||!!g,saving:u,onBack:()=>{f===Me.length-1||0===f?o("/app/appointments"):Zo(f-1)},onPrev:f>0?()=>Zo(f-1):null,onNext:async()=>{const e=Ho(f);if(e.length>0)y({severity:"warning",message:e[0]});else{if(0===f&&!g){var n;const e=await t((0,be.lh)(Jo()));if(e.error)return void y({severity:"error",message:e.payload||"Couldn't create event."});const i=null===(n=e.payload)||void 0===n?void 0:n.eventid;return v(i),i&&o(`/app/appointments/event/${i}/edit`,{replace:!0}),y({severity:"success",message:"Event created."}),void Zo(1)}if(0===f){const e=await t((0,be.qM)({eventid:g,...Jo()}));return e.error?void y({severity:"error",message:e.payload||"Couldn't save."}):void Zo(1)}if(1===f){const e=await t((0,be.qM)(Go()));return e.error?void y({severity:"error",message:e.payload||"Couldn't save."}):void Zo(2)}if(2===f){const e=await t((0,be.qM)(Ko()));if(e.error)return void y({severity:"error",message:e.payload||"Couldn't save."});const o=await t((0,be.Ig)({eventid:g,timeavailability:Yo()}));return o.error?void y({severity:"error",message:o.payload||"Couldn't save availability."}):(t((0,be.vR)(g)),void Zo(3))}if(3===f){const e=await t((0,be.qM)({eventid:g,name:I,platform:L,location:$e.includes(L)?"":T,isenablewhatsappreminder:ro,whatsappaccountid:ro&&uo||null,isenablelinkedinreminder:go,linkedinaccountid:go&&Ao||null,workflowid:Co||null,linkedinautomationid:Lo||null,whatsappautomationid:$o||null,username:((null===p||void 0===p?void 0:p.lastname)||"").trim()?`${((null===p||void 0===p?void 0:p.firstname)||"").trim().charAt(0).toLowerCase()}${((null===p||void 0===p?void 0:p.lastname)||"").trim().charAt(0).toLowerCase()}`:((null===p||void 0===p?void 0:p.firstname)||"").trim().toLowerCase().replace(/\s+/g,"")}));if(e.error)return void y({severity:"error",message:e.payload||"Couldn't save."});y({severity:"success",message:"Event saved."}),setTimeout(()=>
7o("/app/appointments"),600)}}}}),(0,ze.jsxs)(l.A,{sx:{flex:1,display:"flex",flexDirection:"column"},children:[0===f&&(0,ze.jsx)(so,{hydrationKey:Vo,eventName:I,setEventName:W,platForm:L,setPlatForm:B,location:T,setLocation:D,eventDuration:M,setEventDuration:E,description:F,setDescription:R,linkVisible:$,setLinkVisible:q,dateRangeValue:P,setDateRangeValue:N,scheduleDay:O,setScheduleDay:U,eventStartDate:V,setEventStartDate:_,eventEndDate:H,setEventEndDate:J,enableTerm:G,setEnableTerm:K,termValue:Y,setTermValue:Z,enablePublicLogo:Q,setEnablePublicLogo:X,redirectUrl:ee,setRedirectUrl:oe}),1===f&&(0,ze.jsx)(ao,{weekly:te,setWeekly:ne,bufferBefore:ie,setBufferBefore:re,bufferAfter:le,setBufferAfter:se,bufferBeforeOn:ae,setBufferBeforeOn:de,bufferAfterOn:ce,setBufferAfterOn:ue,isShowUserAvatar:xe,setIsShowUserAvatar:he,isShowLogo:pe,setIsShowLogo:me}),2===f&&(0,ze.jsx)(co,{content:fe,setContent:Ce,propertyCatalog:j,catalogLoading:k,radioPos:Ie,setRadioPos:We,checkBoxPos:Le,setCheckBoxPos:Be,themecolor:Te,setThemecolor:De,backgroundcolor:Ee,setBackgroundcolor:qe,textcolor:Pe,setTextcolor:Ue,fontColorCode:Ve,setFontColorCode:He,btnName:Je,setBtnName:Ge,btnPos:Ke,setBtnPos:Ye,btnThemeColor:Ze,setBtnThemeColor:eo,btnTextColor:oo,setBtnTextColor:to}),3===f&&(0,ze.jsx)(bo,{eventName:I,publicUrl:et,redirectUrl:ee,activeEmailReminder:no,onToggleReminder:async e=>{if(io(e),!g)return;const o=await t((0,be.qM)({eventid:g,name:I,platform:L,location:$e.includes(L)?"":T,isemailreminders:e}));o.error?(io(!e),y({severity:"error",message:o.payload||"Couldn't update reminder setting."})):y({severity:"success",message:e?"Email reminders enabled":"Email reminders disabled"})},onSnack:y,enableWhatsApp:ro,onToggleWhatsApp:async e=>{lo(e),await Qo({isenablewhatsappreminder:e,whatsappaccountid:e&&uo||null,isenablelinkedinreminder:go,linkedinaccountid:go&&Ao||null},e?"WhatsApp reminder enabled":"WhatsApp reminder disabled")},whatsAppAccountId:uo,onWhatsAppAccountChange:async e=>{xo(e),await Qo({isenablewhatsappreminder:ro,whatsappaccountid:e||null,isenablelinkedinreminder:go,linkedinaccountid:go&&Ao||null},"WhatsApp account updated")},whatsAppAccounts:ho,whatsAppLoading:mo,enableLinkedIn:go,onToggleLinkedIn:async e=>{vo(e),await Qo({isenablewhatsappreminder:ro,whatsappaccountid:ro&&uo||null,isenablelinkedinreminder:e,linkedinaccountid:e&&Ao||null},e?"LinkedIn reminder enabled":"LinkedIn reminder disabled")},linkedInAccountId:Ao,onLinkedInAccountChange:async e=>{yo(e),await Qo({isenablewhatsappreminder:ro,whatsappaccountid:ro&&uo||null,isenablelinkedinreminder:go,linkedinaccountid:e||null},"LinkedIn account updated")},linkedInAccounts:jo,linkedInLoading:ko,workflowId:Co,onWorkflowChange:async e=>{zo(e),await Xo({workflowid:e||null,linkedinautomationid:Lo||null,whatsappautomationid:$o||null},"Workflow automation updated")},workflowList:Io,workflowSeqLoading:Fo,linkedInAutomationId:Lo,onLinkedInAutomationChange:async e=>{Bo(e),await Xo({workflowid:Co||null,linkedinautomationid:e||null,whatsappautomationid:$o||null},"LinkedIn sequence updated")},linkedInAutomations:To,linkedInSeqLoading:Mo,whatsAppAutomationId:$o,onWhatsAppAutomationChange:async e=>{qo(e),await Xo({workflowid:Co||null,linkedinautomationid:Lo||null,whatsappautomationid:e||null},"WhatsApp sequence updated")},whatsAppAutomations:Po,whatsAppSeqLoading:Oo})]}),(0,ze.jsx)(s.A,{open:!!A,autoHideDuration:2800,onClose:()=>y(null),anchorOrigin:{vertical:"bottom",horizontal:"center"},children:A?(0,ze.jsx)(a.A,{severity:A.severity,variant:"filled",onClose:()=>y(null),sx:{borderRadius:2,boxShadow:4,fontFamily:Re},children:A.message}):null})]})}function Qe(e){let{step:o,eventName:t,isEdit:i,saving:r,onBack:s,onPrev:a,onNext:h}=e;return(0,ze.jsxs)(l.A,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:2,px:{xs:2,md:3},py:1.25,bgcolor:"background.paper",borderBottom:"1px solid",borderColor:Fe.border,flexShrink:0},children:[(0,ze.jsxs)(l.A,{sx:{display:"flex",alignItems:"center",gap:1.5,minWidth:0},children:[(0,ze.jsx)(Ce.A,{label:"Back",onClick:s}),(0,ze.jsxs)(l.A,{sx:{minWidth:0,mr:{xs:0,md:2}},children:[(0,ze.jsx)(d.A,{sx:{fontSize:14.5,fontWeight:800,color:Fe.text,lineHeight:1.2,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontFamily:Re,letterSpacing:-.1},children:i?t||"Untitled event":"New Appointment Type"}),(0,ze.jsxs)(d.A,{sx:{fontSize:11,color:Fe.muted,fontFamily:Re},children:["Step ",o+1," of ",Me.length]})]}),(0,ze.jsx)(l.A,{sx:{display:{xs:"none",md:"flex"},gap:.5,alignItems:"center"},children:Me.map((e,t)=>{const i=t<o,r=t===o;return(0,ze.jsxs)(n.Fragment,{children:[(0,ze.jsxs)(l.A,{sx:{display:"flex",alignItems:"center",gap:.75,px:1.25,py:.4,borderRadius:6,bgcolor:r?Fe.focus:i?"rgba(91,95,239,0.1)":"transparent",color:r?"#fff":i?Fe.focus:Fe.muted,border:r?"none":"1px solid",borderColor:i?`${Fe.focus}33`:Fe.border,fontSize:11.5,fontWeight:700,fontFamily:Re,letterSpacing:-.1,whiteSpace:"nowrap"},children:[(0,ze.jsx)(l.A,{sx:{width:16,height:16,borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",bgcolor:r?"rgba(255,255,255,0.25)":i?Fe.focus:Fe.border,color:r||i?"#fff":Fe.muted,fontSize:10,fontWeight:800}
7,children:i?(0,ze.jsx)(N.A,{sx:{fontSize:12}}):t+1}),e]}),t<Me.length-1&&(0,ze.jsx)(l.A,{sx:{width:12,height:"1px",bgcolor:Fe.border}})]},e)})})]}),(0,ze.jsxs)(c.A,{direction:"row",spacing:1,sx:{flexShrink:0},children:[a&&(0,ze.jsx)(u.A,{size:"small",variant:"outlined",onClick:a,sx:{borderRadius:2,textTransform:"none",fontWeight:600,fontFamily:Re,fontSize:12.5,borderColor:Fe.border,color:Fe.muted,"&:hover":{borderColor:Fe.focus,color:Fe.focus,bgcolor:"transparent"}},children:"Back"}),(0,ze.jsx)(u.A,{size:"small",variant:"contained",startIcon:r?(0,ze.jsx)(x.A,{size:14,sx:{color:"#fff"}}):o===Me.length-1?(0,ze.jsx)(N.A,{sx:{fontSize:16}}):(0,ze.jsx)(q.A,{sx:{fontSize:16}}),endIcon:o<Me.length-1?(0,ze.jsx)(P.A,{sx:{fontSize:14}}):null,onClick:h,disabled:r,sx:{borderRadius:2,textTransform:"none",fontWeight:700,px:2.25,py:.65,bgcolor:Fe.focus,fontFamily:Re,fontSize:12.5,boxShadow:"0 4px 12px rgba(91,95,239,0.28)","&:hover":{bgcolor:"#4F53E0",boxShadow:"0 6px 16px rgba(91,95,239,0.35)"}},children:o===Me.length-1?"Finish":"Save & Next"})]})]})}function Xe(e){if(!e||"string"!==typeof e)return"09:00";if(e.includes("T")){const o=new Date(e);if(!isNaN(o))return`${String(o.getHours()).padStart(2,"0")}:${String(o.getMinutes()).padStart(2,"0")}`}const o=e.match(/^(\d{1,2}):(\d{2})/);return o?`${o[1].padStart(2,"0")}:${o[2]}`:"09:00"}function eo(e){const o="designing"===((null===e||void 0===e?void 0:e.objecttype)||"").toLowerCase(),t=((null===e||void 0===e?void 0:e.name)||"").trim();if((o||["Label","Section","Divider","Image"].includes(t))&&["Label","Section","Divider","Image"].includes(t))return t;const n=null===e||void 0===e?void 0:e.fieldtype;return"string"===typeof n&&Number.isNaN(Number(n))?n:Ve[Number(n)]||"Textbox"}function oo(e,o){if(!e||null!=e.fieldtype||e.name)return e;const t=(e.dbfieldname||"").toLowerCase(),n=(o||[]).find(e=>((null===e||void 0===e?void 0:e.dbfieldname)||"").toLowerCase()===t),i=void 0!==e.isrequired;if(n)return{...e,name:n.propertyname,propertyname:n.dbfieldname,objecttype:n.objecttype,fieldtype:n.fieldtype,propertyid:n.propertyid,options:n.options||[],isrequired:i?!!e.isrequired||Ke.has(t):!!n.isrequired||Ke.has(t)};const r="phonenumber"===t?9:1;return{...e,name:to(t),propertyname:t,objecttype:"contact",fieldtype:r,isrequired:i&&!!e.isrequired||Ke.has(t)}}function to(e){return{firstname:"First Name",lastname:"Last Name",primaryemail:"Email",phonenumber:"Phone",jobid:"Job ID",linkedin:"LinkedIn",name:"Organization Name",orgwebsite:"Organization Website"}[e]||(e?e.charAt(0).toUpperCase()+e.slice(1):"Field")}function no(e){let{children:o,required:t}=e;return(0,ze.jsxs)(d.A,{component:"label",sx:Be,children:[o,t&&(0,ze.jsx)(l.A,{component:"span",sx:{color:Fe.err,ml:.4},children:"*"})]})}function io(e){let{title:o,subtitle:t,children:n,sx:i}=e;return(0,ze.jsxs)(l.A,{sx:{mb:2,...i},children:[o&&(0,ze.jsxs)(l.A,{sx:{mb:1},children:[(0,ze.jsx)(d.A,{sx:{fontSize:11,fontWeight:800,color:Fe.muted,textTransform:"uppercase",letterSpacing:.6,fontFamily:Re},children:o}),t&&(0,ze.jsx)(d.A,{sx:{fontSize:12,color:Fe.muted,fontFamily:Re,mt:.25},children:t})]}),n]})}function ro(e){let{label:o,value:t,onChange:n,icon:i,iconColor:r,dense:s}=e;return(0,ze.jsxs)(l.A,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",py:s?.5:.85,px:1.25,borderRadius:2,border:"1px solid",borderColor:t?`${Fe.focus}55`:Fe.border,bgcolor:t?`${Fe.focus}08`:"transparent",transition:"all 0.15s"},children:[(0,ze.jsxs)(l.A,{sx:{display:"flex",alignItems:"center",gap:1},children:[i&&(0,ze.jsx)(l.A,{sx:{width:24,height:24,borderRadius:1.25,display:"flex",alignItems:"center",justifyContent:"center",bgcolor:r?`${r}1a`:"grey.100",color:r||Fe.muted},children:i}),(0,ze.jsx)(d.A,{sx:{fontSize:12.5,fontWeight:600,fontFamily:Re,color:Fe.text},children:o})]}),(0,ze.jsx)(h.A,{size:"small",checked:!!t,onChange:e=>n(e.target.checked),sx:{"& .MuiSwitch-switchBase.Mui-checked":{color:Fe.focus},"& .MuiSwitch-switchBase.Mui-checked + .MuiSwitch-track":{bgcolor:Fe.focus}}})]})}function lo(e){let{label:o,value:t,onChange:n}=e;return(0,ze.jsxs)(l.A,{children:[(0,ze.jsx)(no,{children:o}),(0,ze.jsxs)(l.A,{sx:{display:"flex",alignItems:"center",gap:.75,border:"1px solid",borderColor:Fe.border,borderRadius:"10px",bgcolor:Fe.bg,px:.75,py:.5,height:Le,boxSizing:"border-box"},children:[(0,ze.jsx)(l.A,{component:"input",type:"color",value:t||"#000000",onChange:e=>n(e.target.value),sx:{width:28,height:28,border:"none",padding:0,cursor:"pointer",borderRadius:1,bgcolor:"transparent"}}),(0,ze.jsx)(d.A,{sx:{fontSize:12,fontFamily:"monospace",color:Fe.text,textTransform:"uppercase"},children:t||"\u2014"})]})]})}function so(e){return(0,ze.jsx)(l.A,{sx:{maxWidth:960,width:"100%",mx:"auto",p:{xs:2,md:2.5}},children:(0,ze.jsxs)(p.Ay,{container:!0,spacing:1.5,children:[(0,ze.jsxs)(p.Ay,{item:!0,xs:12,children:[(0,ze.jsx)(no,{required:!0,children:"Event name"}),(0,ze.jsx)(m.A,{fullWidth:!0,size:"small",placeholder:"e.g. 30-min consultation",value:e.eventName,onChange:o=>e.setEventName(o.target.value),inputProps:{maxLength:80},sx:Te(!1)})]}),(0,ze.jsxs)(p.Ay,{item:!0,xs:12,sm:6,children:[(0,ze.jsx)(no,{required:!0,children:"Meeting platform"}),(0,ze.jsx)(f.A,{fullWidth:!0,size:"small",children:(0,ze.jsx)(b.A,{value:e.platForm,onChange:o=>e.setPlatForm(o.target.value),sx:De(!1,!!e.platForm),children:Ee.map(e=>(0,ze.jsx)(g.A,{value:e,children:e},e))})})]}),(0,ze.jsxs)(p.Ay,{item:!0,xs:12,sm:6,children:[(0,ze.jsx)(no,{required:!$e.includes(e.platForm),children:"Location"}),(0,ze.jsx)(m.A,{fullWidth:!0,size:"small",disabled:$e.includes(e.platForm),placeholder:$e.includes(e.platForm)?"Auto-generated meeting link":"Address, room or dial-in",value:e.location,onChange:o=>e.setLocation(o.target.value),sx:Te(!1)})]}),(0,ze.jsxs)(p.Ay,{item:!0,xs:12,children:[(0,ze.jsx)(no,{children:"Duration"}),(0,ze.jsx)(v.A,{value:e.eventDuration,exclusive:!0,onChange:(o,t)=>t&&e.setEventDuration(t),size:"small",sx:{flexWrap:"wrap",gap:.5,"& .MuiToggleButton-root":{border:"1.5px solid !important",borderColor:`${Fe.border} !important`,borderRadius:"9px !important",fontFamily:Re,fontSize:12.5,fontWeight:600,textTransform:"none",px:1.75,py:.45,color:Fe.muted},"& .Mui-selected":{bgcolor:`${Fe.focus} !important`,color:"#fff !important",borderColor:`${Fe.focus} !important`}},children:qe.map(e=>(0,ze.jsxs)(A.A,{value:e,children:[e," min"]},e))})]}),(0,ze.jsxs)(p.Ay,{item:!0,xs:12,children:[(0,ze.jsx)(no,{children:"Welcome message"}),(0,ze.jsx)(l.A,{sx:{border:"1.5px solid",borderColor:Fe.border,borderRadius:"10px",overflow:"hidden",bgcolor:Fe.bg,"& .jodit-container":{borderRadius:"10px",border:"none",bgcolor:"transparent"},"& .jodit-workplace":{minHeight:100}},children:(0,ze.jsx)(ce.A,{value:e.description||"",config:Ue,onBlur:o=>e.setDescription(o)},`description-${e.hydrationKey||0}`)})]}),(0,ze.jsxs)(p.Ay,{item:!0,xs:12,children:[(0,ze.jsx)(no,{children:"Scheduling window"}),(0,ze.jsx)(y.A,{value:e.dateRangeValue,onChange:o=>e.setDateRangeValue(o.target.value),children:(0,ze.jsxs)(c.A,{direction:{xs:"column",sm:"row"},spacing:1,sx:{flexWrap:"wrap"},children:[(0,ze.jsx)(j.A,{value:"1",control:(0,ze.jsx)(S.A,{size:"small",sx:{"&.Mui-checked":{color:Fe.focu
7s}}}),label:(0,ze.jsxs)(l.A,{sx:{display:"flex",alignItems:"center",gap:.75},children:[(0,ze.jsx)(d.A,{sx:{fontSize:12.5,fontFamily:Re},children:"Within"}),(0,ze.jsx)(m.A,{type:"number",size:"small",value:e.scheduleDay,onChange:o=>e.setScheduleDay(Math.max(1,Number(o.target.value)||1)),inputProps:{min:1,max:365},sx:{...Te(!1),width:64}}),(0,ze.jsx)(d.A,{sx:{fontSize:12.5,fontFamily:Re},children:"days"})]})}),(0,ze.jsx)(j.A,{value:"2",control:(0,ze.jsx)(S.A,{size:"small",sx:{"&.Mui-checked":{color:Fe.focus}}}),label:(0,ze.jsx)(d.A,{sx:{fontSize:12.5,fontFamily:Re},children:"Date range"})}),(0,ze.jsx)(j.A,{value:"3",control:(0,ze.jsx)(S.A,{size:"small",sx:{"&.Mui-checked":{color:Fe.focus}}}),label:(0,ze.jsx)(d.A,{sx:{fontSize:12.5,fontFamily:Re},children:"Indefinitely"})})]})}),"2"===e.dateRangeValue&&(0,ze.jsxs)(c.A,{direction:"row",spacing:1,sx:{mt:1},children:[(0,ze.jsx)(l.A,{sx:{flex:1},children:(0,ze.jsx)(m.A,{type:"date",fullWidth:!0,size:"small",InputLabelProps:{shrink:!0},value:e.eventStartDate,onChange:o=>e.setEventStartDate(o.target.value),sx:Te(!1)})}),(0,ze.jsx)(l.A,{sx:{flex:1},children:(0,ze.jsx)(m.A,{type:"date",fullWidth:!0,size:"small",InputLabelProps:{shrink:!0},value:e.eventEndDate,onChange:o=>e.setEventEndDate(o.target.value),sx:Te(!1)})})]})]}),(0,ze.jsxs)(p.Ay,{item:!0,xs:12,children:[(0,ze.jsx)(no,{children:"Redirect URL after booking"}),(0,ze.jsx)(m.A,{fullWidth:!0,size:"small",placeholder:"https://yoursite.com/thank-you",value:e.redirectUrl||"",onChange:o=>e.setRedirectUrl(o.target.value),InputProps:{startAdornment:(0,ze.jsx)(k.A,{position:"start",children:(0,ze.jsx)(U.A,{s
7x:{fontSize:15,color:Fe.muted}})})},helperText:"Leave blank to show the default confirmation screen. Must start with https://",FormHelperTextProps:{sx:{fontFamily:Re,fontSize:11,color:Fe.muted,ml:0}},sx:Te(!1)})]}),(0,ze.jsxs)(p.Ay,{item:!0,xs:12,children:[(0,ze.jsx)(no,{children:"Compliance & footer"}),(0,ze.jsxs)(c.A,{spacing:1,children:[(0,ze.jsx)(ro,{dense:!0,label:"Require Terms & Policy acceptance",value:e.enableTerm,onChange:e.setEnableTerm}),e.enableTerm&&(0,ze.jsx)(l.A,{sx:{border:"1.5px solid",borderColor:Fe.border,borderRadius:"10px",overflow:"hidden",bgcolor:Fe.bg,"& .jodit-container":{borderRadius:"10px",border:"none",bgcolor:"transparent"},"& .jodit-workplace":{minHeight:80}},children:(0,ze.jsx)(ce.A,{value:e.termValue||"",config:{...Ue,minHeight:80,placeholder:"Terms text\u2026"},onBlur:o=>e.setTermValue(o)},`terms-${e.hydrationKey||0}`)}),(0,ze.jsx)(ro,{dense:!0,label:"Show 'Powered by' footer",value:e.enablePublicLogo,onChange:e.setEnablePublicLogo}),(0,ze.jsx)(ro,{dense:!0,label:"Show meeting link to invitee after booking",value:e.linkVisible,onChange:e.setLinkVisible})]})]})]})})}function ao(e){return(0,ze.jsxs)(l.A,{sx:{maxWidth:1100,width:"100%",mx:"auto",p:{xs:2,md:2.5},display:"grid",gridTemplateColumns:{xs:"1fr",md:"1.4fr 1fr"},gap:{xs:0,md:2.5}},children:[(0,ze.jsx)(l.A,{children:(0,ze.jsx)(io,{title:"Weekly hours",subtitle:"When you're available each week. Toggle a day off to mark it unavailable.",children:(0,ze.jsx)(c.A,{spacing:.75,children:Ne.map(o=>(0,ze.jsxs)(l.A,{sx:{display:"grid",gridTemplateColumns:"84px 1fr",gap:1.5,alignItems:"center",p:1,borderRadius:2,border:"1px solid",borderColor:e.weekly[o.key].enabled?`${Fe.focus}55`:Fe.border,bgcolor:e.weekly[o.key].enabled?`${Fe.focus}06`:"transparent"},children:[(0,ze.jsx)(j.A,{sx:{m:0},control:(0,ze.jsx)(w.A,{size:"small",checked:e.weekly[o.key].enabled,onChange:t=>e.setWeekly(e=>({...e,[o.key]:{...e[o.key],enabled:t.target.checked}})),sx:{"&.Mui-checked":{color:Fe.focus},p:.5}}),label:(0,ze.jsx)(d.A,{sx:{fontSize:12.5,fontWeight:700,fontFamily:Re,ml:.25},children:o.label})}),e.weekly[o.key].enabled?(0,ze.jsxs)(c.A,{direction:"row",spacing:.75,sx:{alignItems:"center"},children:[(0,ze.jsx)(m.A,{type:"time",size:"small",value:e.weekly[o.key].start,onChange:t=>e.setWeekly(e=>({...e,[o.key]:{...e[o.key],start:t.target.value}})),sx:{...Te(!1),flex:1,maxWidth:120}}),(0,ze.jsx)(d.A,{sx:{fontSize:12,fontFamily:Re,color:Fe.muted},children:"to"}),(0,ze.jsx)(m.A,{type:"time",size:"small",value:e.weekly[o.key].end,onChange:t=>e.setWeekly(e=>({...e,[o.key]:{...e[o.key],end:t.target.value}})),sx:{...Te(!1),flex:1,maxWidth:120}})]}):(0,ze.jsx)(d.A,{sx:{fontSize:12,color:Fe.muted,fontFamily:Re,fontStyle:"italic"},children:"Unavailable"})]},o.key))})})}),(0,ze.jsxs)(l.A,{children:[(0,ze.jsx)(io,{title:"Buffer between meetings",subtitle:"Pad time around appointments so you're not back-to-back.",children:(0,ze.jsx)(c.A,{spacing:1,children:[{label:"Before event",on:e.bufferBeforeOn,setOn:e.setBufferBeforeOn,val:e.bufferBefore,setVal:e.setBufferBefore},{label:"After event",on:e.bufferAfterOn,setOn:e.setBufferAfterOn,val:e.bufferAfter,setVal:e.setBufferAfter}].map(e=>(0,ze.jsxs)(l.A,{children:[(0,ze.jsxs)(l.A,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mb:.5},children:[(0,ze.jsx)(d.A,{sx:{fontSize:12.5,fontWeight:700,fontFamily:Re},children:e.label}),(0,ze.jsx)(h.A,{size:"small",checked:e.on,onChange:o=>e.setOn(o.target.checked),sx:{"& .MuiSwitch-switchBase.Mui-checked":{color:Fe.focus},"& .MuiSwitch-switchBase.Mui-checked + .MuiSwitch-track":{bgcolor:Fe.focus}}})]}),(0,ze.jsx)(f.A,{fullWidth:!0,size:"small",children:(0,ze.jsx)(b.A,{value:e.val,onChange:o=>e.setVal(Number(o.target.value)),disabled:!e.on,sx:De(!1,!0),children:Pe.map(e=>(0,ze.jsx)(g.A,{value:e.value,children:e.label},e.value))})})]},e.label))})}),(0,ze.jsx)(io,{title:"Public page display",subtitle:"Show your avatar and company logo on the booking page.",children:(0,ze.jsxs)(c.A,{spacing:1,children:[(0,ze.jsx)(ro,{label:"Show host avatar",value:e.isShowUserAvatar,onChange:e.setIsShowUserAvatar,icon:(0,ze.jsx)(ee.A,{sx:{fontSize:14}}
7),iconColor:Fe.focus}),(0,ze.jsx)(ro,{label:"Show company logo",value:e.isShowLogo,onChange:e.setIsShowLogo,icon:(0,ze.jsx)(oe.A,{sx:{fontSize:14}}),iconColor:"#8b5cf6"})]})})]})]})}function co(e){return(0,ze.jsx)(l.A,{sx:{maxWidth:1280,width:"100%",mx:"auto",p:{xs:2,md:2.5}},children:(0,ze.jsx)(uo,{content:e.content,setContent:e.setContent,propertyCatalog:e.propertyCatalog,catalogLoading:e.catalogLoading,radioPos:e.radioPos,setRadioPos:e.setRadioPos,checkBoxPos:e.checkBoxPos,setCheckBoxPos:e.setCheckBoxPos,themecolor:e.themecolor,setThemecolor:e.setThemecolor,backgroundcolor:e.backgroundcolor,setBackgroundcolor:e.setBackgroundcolor,textcolor:e.textcolor,setTextcolor:e.setTextcolor,fontColorCode:e.fontColorCode,setFontColorCode:e.setFontColorCode,btnName:e.btnName,setBtnName:e.setBtnName,btnPos:e.btnPos,setBtnPos:e.setBtnPos,btnThemeColor:e.btnThemeColor,setBtnThemeColor:e.setBtnThemeColor,btnTextColor:e.btnTextColor,setBtnTextColor:e.setBtnTextColor})})}function uo(e){let{content:o,setContent:t,propertyCatalog:i,catalogLoading:r,radioPos:s,setRadioPos:a,checkBoxPos:u,setCheckBoxPos:x,themecolor:f,setThemecolor:b,backgroundcolor:g,setBackgroundcolor:y,textcolor:j,setTextcolor:S,fontColorCode:w,setFontColorCode:W,btnName:F,setBtnName:R,btnPos:L,setBtnPos:B,btnThemeColor:T,setBtnThemeColor:D,btnTextColor:M,setBtnTextColor:E}=e;const[$,q]=n.useState(""),[P,N]=n.useState(null),O=n.useRef(null);n.useEffect(()=>{if(!i||0===i.length)return;(o||[]).some(e=>e&&null==e.fieldtype&&!e.name&&e.dbfieldname)&&t(o.map(e=>oo(e,i)))},[i]);const U=n.useMemo(()=>(o||[]).map(e=>oo(e,i)),[o,i]),V=n.useMemo(()=>new Set(U.map(e=>((null===e||void 0===e?void 0:e.dbfieldname)||"").toLowerCase()).filter(Boolean)),[U]),_=n.useMemo(()=>{const e=$.trim().toLowerCase(),o=o=>!e||((null===o||void 0===o?void 0:o.propertyname)||"").toLowerCase().includes(e);return He.map(e=>{const t="designing"===e.key?Je:(i||[]).filter(o=>((null===o||void 0===o?void 0:o.objecttype)||"").toLowerCase()===e.key);return{...e,items:t.filter(o)}})},[i,$]),H=(e,o)=>{const n=((null===e||void 0===e?void 0:e.dbfieldname)||"").toLowerCase();if(n&&V.has(n))return;const i={name:e.propertyname||e.name,propertyname:e.dbfieldname||e.propertyname,dbfieldname:e.dbfieldname,objecttype:e.objecttype,fieldtype:e.fieldtype,propertyid:e.propertyid,options:e.options||[],value:e.value,isrequired:!!e.isrequired||Ke.has(n)};t(e=>{const t=[...e||[]];return void 0!==o&&o>=0&&o<=t.length?t.splice(o,0,i):t.push(i),t})},J=e=>()=>{O.current={from:"lib",prop:e},N("lib")},G=e=>()=>{O.current={from:"canvas",idx:e},N("canvas")},K=()=>{O.current=null,N(null)},X=e=>e.preventDefault(),ee=e=>n=>{n.preventDefault(),n.stopPropagation();const i=O.current;O.current=null,N(null),i&&("lib"===i.from?H(i.prop,e):"canvas"===i.from&&((e,n)=>{if(e===n)return;const i=[...o],[r]=i.splice(e,1);i.splice(n,0,r),t(i)})(i.idx,e))},oe={"& .MuiToggleButton-root":{fontFamily:Re,fontSize:11,py:.4,textTransform:"none",color:Fe.muted,border:"1px solid !important",borderColor:`${Fe.border} !important`},"& .Mui-selected":{bgcolor:`${Fe.focus} !important`,color:"#fff !important",borderColor:`${Fe.focus} !important`}};return(0,ze.jsxs)(l.A,{sx:{height:{xs:"auto",md:560},display:"grid",gridTemplateColumns:{xs:"1fr",md:"300px 1fr"},gap:2},children:[(0,ze.jsxs)(l.A,{sx:{display:"flex",flexDirection:"column",height:{md:"100%"}},children:[(0,ze.jsx)(m.A,{fullWidth:!0,size:"small",placeholder:"Search properties\u2026",value:$,onChange:e=>q(e.target.value),InputProps:{startAdornment:(0,ze.jsx)(k.A,{position:"start",children:(0,ze.jsx)(Q.A,{sx:{fontSize:16,color:Fe.muted}})}),sx:{fontSize:12.5,borderRadius:"10px",height:Le,bgcolor:Fe.bg,fontFamily:Re,"& fieldset":{borderColor:Fe.border,borderWidth:"1.5px"}}},sx:{mb:1,flexShrink:0}}),(0,ze.jsx)(l.A,{sx:{flex:1,minHeight:0,overflowY:"auto",pr:.5,scrollbarWidth:"thin","&::-webkit-scrollbar":{width:6},"&::-webkit-scrollbar-thumb":{bgcolor:Fe.border,borderRadius:3}},children:(0,ze.jsxs)(c.A,{spacing:1,children:[_.map(e=>(0,ze.jsx)(xo,{group:e,usedDbFields:V,onAdd:H,onDragStart:J,onDragEnd:K},e.key)),r&&(0,ze.jsx)(c.A,{spacing:.5,sx:{p:1},children:Array.from({length:5}).map((e,o)=>(0,ze.jsx)(C.A,{variant:"rounded",height:32},o))}),(0,ze.jsx)(ho,{title:"Layout",color:"#0EA5E9",icon:(0,ze.jsx)(ie.A,{sx:{fontSize:14}}),children:(0,ze.jsx)(c.A,{spacing:1,children:[{label:"Radio layout",val:s,set:a},{label:"Checkbox layout",val:u,set:x}].map(e=>(0,ze.jsxs)(l.A,{children:[(0,ze.jsx)(d.A,{sx:{fontSize:10.5,fontWeight:700,color:Fe.muted,mb:.4,fontFamily:Re,textTransform:"uppercase",letterSpacing:.5},children:e.label}),(0,ze.jsxs)(v.A,{value:e.val,exclusive:!0,size:"small",fullWidth:!0,onChange:(o,t)=>t&&e.set(t),sx:oe,children:[(0,ze.jsx)(A.A,{value:"vertical",children:"Vertical"}),(0,ze.jsx)(A.A,{value:"horizontal",children:"Horizontal"})]})]},e.label))})}),(0,ze.jsx)(ho,{title:"Branding",color:"#10B981",icon:(0,ze.jsx)(re.A,{sx:{fontSize:14}}),children:(0,ze.jsxs)(c.A,{spacing:1,children:[(0,ze.jsx)(lo,{label:"Theme color",value:f,onChange:b}
7),(0,ze.jsx)(lo,{label:"Background",value:g,onChange:y}),(0,ze.jsx)(lo,{label:"Text color",value:j,onChange:S}),(0,ze.jsx)(lo,{label:"Field text",value:w,onChange:W})]})}),(0,ze.jsx)(ho,{title:"Submit Button",color:"#F43F5E",icon:(0,ze.jsx)(le.A,{sx:{fontSize:14}}),children:(0,ze.jsxs)(c.A,{spacing:1,children:[(0,ze.jsxs)(l.A,{children:[(0,ze.jsx)(no,{children:"Button label"}),(0,ze.jsx)(m.A,{fullWidth:!0,size:"small",value:F,onChange:e=>R(e.target.value),sx:Te(!1)})]}),(0,ze.jsxs)(l.A,{children:[(0,ze.jsx)(d.A,{sx:{fontSize:10.5,fontWeight:700,color:Fe.muted,mb:.4,fontFamily:Re,textTransform:"uppercase",letterSpacing:.5},children:"Alignment"}),(0,ze.jsxs)(v.A,{value:L,exclusive:!0,size:"small",fullWidth:!0,onChange:(e,o)=>o&&B(o),sx:oe,children:[(0,ze.jsx)(A.A,{value:"left",children:"Left"}),(0,ze.jsx)(A.A,{value:"center",children:"Center"}),(0,ze.jsx)(A.A,{value:"right",children:"Right"})]})]}),(0,ze.jsx)(lo,{label:"Button color",value:T,onChange:D}),(0,ze.jsx)(lo,{label:"Button text",value:M,onChange:E})]})})]})})]}),(0,ze.jsx)(l.A,{onDragOver:X,onDrop:e=>{e.preventDefault();const o=O.current;O.current=null,N(null),o&&"lib"===o.from&&H(o.prop)},sx:{height:{md:"100%"},overflowY:"auto",borderRadius:3,border:"2px dashed",borderColor:"lib"===P?Fe.focus:Fe.border,p:1.75,bgcolor:"background.paper",transition:"border-color 0.15s",scrollbarWidth:"thin","&::-webkit-scrollbar":{width:6},"&::-webkit-scrollbar-thumb":{bgcolor:Fe.border,borderRadius:3}},children:U&&0!==U.length?(0,ze.jsx)(p.Ay,{container:!0,spacing:1.5,children:U.map((e,n)=>{const i=Ye(e),r=eo(e),s=!Ge.has(r),a=["Multiline","Multiple checkbox","Radio","Section","Divider","Label","Image"].includes(r)?12:6;return(0,ze.jsx)(p.Ay,{item:!0,xs:12,sm:a,onDragOver:X,onDrop:ee(n),children:(0,ze.jsxs)(l.A,{sx:{position:"relative",display:"flex",alignItems:"flex-start",gap:.5,p:.5,borderRadius:2,"&:hover":{bgcolor:`${Fe.focus}06`},transition:"background 0.12s"},children:[(0,ze.jsx)(l.A,{draggable:!0,onDragStart:G(n),onDragEnd:K,sx:{display:"flex",alignItems:"flex-start",pt:3.25,cursor:"grab","&:active":{cursor:"grabbing"}},children:(0,ze.jsx)(Z.A,{sx:{fontSize:14,color:Fe.muted,opacity:.5,"&:hover":{opacity:1}}})}),(0,ze.jsx)(l.A,{sx:{flex:1,minWidth:0},children:(0,ze.jsx)(mo,{elem:e,onUpdateValue:(e,i)=>((e,n,i)=>t(o.map((o,t)=>t===e?{...o,[n]:i}:o)))(n,e,i)})}),s&&(0,ze.jsx)(z.A,{title:i?"Always required":"Required",children:(0,ze.jsx)("span",{children:(0,ze.jsx)(h.A,{size:"small",checked:!(null===e||void 0===e||!e.isrequired),disabled:i,onChange:e=>((e,n)=>t(o.map((o,t)=>t===e?{...o,isrequired:n}:o)))(n,e.target.checked),sx:{mt:3,"& .MuiSwitch-switchBase.Mui-checked":{color:Fe.focus},"& .MuiSwitch-switchBase.Mui-checked + .MuiSwitch-track":{bgcolor:Fe.focus}}})})}),(0,ze.jsx)(z.A,{title:i?"Required \u2014 can't remove":"Remove",children:(0,ze.jsx)("span",{children:(0,ze.jsx)(I.A,{size:"small",disabled:i,color:"error",onClick:()=>(e=>{Ye(U[e])||t(o.filter((o,t)=>t!==e))})(n),sx:{mt:3.25},children:(0,ze.jsx)(Y.A,{sx:{fontSize:15}})})})})]})},`canvas-${n}`)})}):(0,ze.jsxs)(l.A,{sx:{py:8,textAlign:"center",color:Fe.muted,display:"flex",flexDirection:"column",alignItems:"center",gap:1},children:[(0,ze.jsx)(Z.A,{sx:{fontSize:36,opacity:.6}}),(0,ze.jsx)(d.A,{sx:{fontSize:13,fontWeight:700,fontFamily:Re,color:Fe.text},children:"Drag properties from the left"}),(0,ze.jsx)(d.A,{sx:{fontSize:11.5,fontFamily:Re},children:"or click the + button on any property"})]})})]})}function xo(e){let{group:o,usedDbFields:t,onAdd:n,onDragStart:i,onDragEnd:r}=e;const s=o.icon;return(0,ze.jsxs)(W.A,{defaultExpanded:"contact"===o.key,disableGutters:!0,elevation:0,sx:{border:"1px solid",borderColor:Fe.border,borderRadius:"10px !important","&:before":{display:"none"}},children:[(0,ze.jsxs)(F.A,{expandIcon:(0,ze.jsx)(G.A,{sx:{fontSize:18}}),sx:{minHeight:40,px:1.25,"& .MuiAccordionSummary-content":{my:.75,alignItems:"center",gap:1}},children:[(0,ze.jsx)(l.A,{sx:{width:22,height:22,borderRadius:1.25,display:"flex",alignItems:"center",justifyContent:"center",bgcolor:`${o.color}1a`,color:o.color},children:(0,ze.jsx)(s,{sx:{fontSize:14}})}),(0,ze.jsx)(d.A,{sx:{fontSize:12.5,fontWeight:700,fontFamily:Re},children:o.label}),o.items.length>0&&(0,ze.jsx)(R.A,{size:"small",label:o.items.length,sx:{ml:"auto",mr:.5,height:18,fontSize:10,fontWeight:700,bgcolor:o.color,color:"#fff"}})]}),(0,ze.jsx)(L.A,{sx:{pt:0,px:1,pb:1},children:(0,ze.jsx)(c.A,{spacing:.5,children:0===o.items.length?(0,ze.jsx)(d.A,{sx:{p:1,fontSize:11.5,color:Fe.muted,textAlign:"center",fontFamily:Re,fontStyle:"italic"},children:"No matching properties"}):o.items.map(e=>{const s=(e.dbfieldname||"").toLowerCase(),a=!!s&&t.has(s);return(0,ze.jsxs)(l.A,{draggable:!a,onDragStart:i(e),onDragEnd:r,sx:{dis
7play:"flex",alignItems:"center",gap:.5,px:.85,py:.6,borderRadius:1.5,border:"1px solid",borderColor:Fe.border,opacity:a?.45:1,cursor:a?"default":"grab",bgcolor:a?"grey.50":"background.paper",transition:"background 0.12s, border-color 0.12s","&:active":{cursor:a?"default":"grabbing"},"&:hover":{bgcolor:a?"grey.50":`${o.color}08`,borderColor:a?Fe.border:o.color}},children:[(0,ze.jsx)(Z.A,{sx:{fontSize:13,color:Fe.muted}}),(0,ze.jsxs)(l.A,{sx:{flex:1,minWidth:0},children:[(0,ze.jsx)(d.A,{sx:{fontSize:11.5,fontWeight:600,fontFamily:Re,color:Fe.text},noWrap:!0,children:e.propertyname}),(0,ze.jsx)(d.A,{sx:{fontSize:9.5,color:Fe.muted,fontFamily:Re},children:Ve[e.fieldtype]||"Field"})]}),(0,ze.jsx)(I.A,{size:"small",disabled:a,onClick:()=>n(e),sx:{p:.25,color:a?"action.disabled":o.color,"&:hover":{bgcolor:o.color,color:"#fff"}},children:(0,ze.jsx)(K.A,{sx:{fontSize:14}})})]},e.propertyid)})})})]})}function ho(e){let{title:o,color:t,icon:n,children:i}=e;return(0,ze.jsxs)(W.A,{disableGutters:!0,elevation:0,sx:{border:"1px solid",borderColor:Fe.border,borderRadius:"10px !important","&:before":{display:"none"}},children:[(0,ze.jsxs)(F.A,{expandIcon:(0,ze.jsx)(G.A,{sx:{fontSize:18}}),sx:{minHeight:40,px:1.25,"& .MuiAccordionSummary-content":{my:.75,alignItems:"center",gap:1}},children:[(0,ze.jsx)(l.A,{sx:{width:22,height:22,borderRadius:1.25,display:"flex",alignItems:"center",justifyContent:"center",bgcolor:`${t}1a`,color:t},children:n}),(0,ze.jsx)(d.A,{sx:{fontSize:12.5,fontWeight:700,fontFamily:Re},children:o})]}),(0,ze.jsx)(L.A,{sx:{pt:0,px:1,pb:1},children:i})]})}function po(e){let{elem:o,onUpdateValue:t}=e;const[i,r]=n.useState(!1),s=n.useRef(null),a=(null===o||void 0===o?void 0:o.value)||(null===o||void 0===o?void 0:o.imageurl)||"",c={"& .MuiOutlinedInput-root":{height:Le,borderRadius:"10px",bgcolor:"background.paper",fontFamily:Re,fontSize:13.5,"& fieldset":{borderColor:Fe.border,borderWidth:"1.5px"},"&:hover fieldset":{borderColor:"divider"},"&.Mui-focused fieldset":{borderColor:Fe.focus,borderWidth:"2px"}},"& input":{color:Fe.text,height:Le,boxSizing:"border-box"}};return(0,ze.jsxs)(l.A,{sx:{p:1.25,borderRadius:1.5,bgcolor:`${Fe.focus}06`,border:"1px dashed",borderColor:`${Fe.focus}33`},children:[(0,ze.jsx)(d.A,{sx:{fontSize:10,fontWeight:800,color:Fe.muted,textTransform:"uppercase",letterSpacing:.6,fontFamily:Re,mb:.5},children:"Image"}),(0,ze.jsxs)(l.A,{sx:{display:"flex",gap:1,alignItems:"center"},children:[(0,ze.jsx)(m.A,{fullWidth:!0,size:"small",placeholder:"Paste image URL or upload a file",value:a,onChange:e=>t&&t("value",e.target.value),sx:c}),(0,ze.jsx)(l.A,{component:"input",ref:s,type:"file",accept:"image/*",style:{display:"none"},onChange:async e=>{var o;const n=null===(o=e.target.files)||void 0===o?void 0:o[0];if(n){r(!0);try{const e=await We(n);e&&t&&t("value",e)}catch{}finally{r(!1),s.current&&(s.current.value="")}}}}),(0,ze.jsx)(u.A,{size:"small",variant:"outlined",onClick:()=>{var e;return null===(e=s.current)||void 0===e?void 0:e.click()},disabled:i,sx:{whiteSpace:"nowrap",textTransform:"none",borderRadius:"10px",minWidth:80,borderColor:Fe.border,fontSize:12,flexShrink:0,height:Le,fontFamily:Re,color:Fe.muted},children:i?(0,ze.jsx)(x.A,{size:14}):"Upload"})]}),a&&(0,ze.jsx)(l.A,{component:"img",src:a,alt:"Preview",sx:{maxWidth:"100%",maxHeight:140,mt:1,borderRadius:1,border:"1px solid",borderColor:Fe.border,display:"block"},onError:e=>{e.currentTarget.style.display="none"}})]})}function mo(e){let{elem:o,onUpdateValue:t}=e;const n=eo(o),i=(null===o||void 0===o?void 0:o.name)||"",r=!(null===o||void 0===o||!o.isrequired),s="organization"===((null===o||void 0===o?void 0:o.objecttype)||"").toLowerCase(),a={"& .MuiOutlinedInput-root":{height:Le,borderRadius:"10px",bgcolor:Fe.bg,fontFamily:Re,fontSize:13.5,"& fieldset":{borderColor:Fe.border,borderWidth:"1.5px"}},"& .MuiOutlinedInput-input":{px:1.5,height:Le,boxSizing:"border-box",fontSize:13.5,color:Fe.muted,WebkitTextFillColor:Fe.muted}},c={"& .MuiOutlinedInput-root":{height:Le,borderRadius:"10px",bgcolor:"background.paper",fontFamily:Re,fontSize:13.5,"& fieldset":{borderColor:Fe.border,borderWidth:"1.5px"},"&:hover fieldset":{borderColor:"divider"}
7,"&.Mui-focused fieldset":{borderColor:Fe.focus,borderWidth:"2px"}},"& input":{color:Fe.text,height:Le,boxSizing:"border-box"}},u=["Section","Divider","Label","Image"].includes(n);return s&&!u?(0,ze.jsxs)(l.A,{children:[(0,ze.jsx)(no,{required:r,children:i}),(0,ze.jsx)(m.A,{fullWidth:!0,size:"small",disabled:!0,placeholder:`Enter ${(i||"").toLowerCase()}`,sx:a})]}):"Section"===n?(0,ze.jsxs)(l.A,{sx:{p:1.25,borderRadius:1.5,bgcolor:`${Fe.focus}06`,border:"1px dashed",borderColor:`${Fe.focus}33`},children:[(0,ze.jsx)(d.A,{sx:{fontSize:10,fontWeight:800,color:Fe.muted,textTransform:"uppercase",letterSpacing:.6,fontFamily:Re,mb:.5},children:"Section header"}),(0,ze.jsx)(m.A,{fullWidth:!0,size:"small",placeholder:"Section header text",value:(null===o||void 0===o?void 0:o.value)||"",onChange:e=>t&&t("value",e.target.value),sx:c})]}):"Divider"===n?(0,ze.jsxs)(l.A,{sx:{py:1.25},children:[(0,ze.jsx)(d.A,{sx:{fontSize:10,fontWeight:800,color:Fe.muted,textTransform:"uppercase",letterSpacing:.6,fontFamily:Re,mb:.5},children:"Divider"}),(0,ze.jsx)(B.A,{sx:{borderColor:Fe.border,borderBottomWidth:2}})]}):"Label"===n?(0,ze.jsxs)(l.A,{sx:{p:1.25,borderRadius:1.5,bgcolor:`${Fe.focus}06`,border:"1px dashed",borderColor:`${Fe.focus}33`},children:[(0,ze.jsx)(d.A,{sx:{fontSize:10,fontWeight:800,color:Fe.muted,textTransform:"uppercase",letterSpacing:.6,fontFamily:Re,mb:.5},children:"Label"}),(0,ze.jsx)(m.A,{fullWidth:!0,size:"small",placeholder:"Type your message",value:(null===o||void 0===o?void 0:o.value)||"",onChange:e=>t&&t("value",e.target.value),sx:c})]}):"Image"===n?(0,ze.jsx)(po,{elem:o,onUpdateValue:t}):"Multiline"===n?(0,ze.jsxs)(l.A,{children:[(0,ze.jsx)(no,{required:r,children:i}),(0,ze.jsx)(m.A,{fullWidth:!0,size:"small",disabled:!0,multiline:!0,minRows:2,placeholder:"Long text\u2026",sx:{"& .MuiOutlinedInput-root":{minHeight:Le,borderRadius:"10px",bgcolor:Fe.bg,fontFamily:Re,fontSize:13.5,p:"8px 12px","& fieldset":{borderColor:Fe.border,borderWidth:"1.5px"}},"& textarea":{color:Fe.muted,WebkitTextFillColor:Fe.muted,fontFamily:Re}}})]}):"Dropdown"===n?(0,ze.jsxs)(l.A,{children:[(0,ze.jsx)(no,{required:r,children:i}),(0,ze.jsx)(f.A,{fullWidth:!0,size:"small",disabled:!0,children:(0,ze.jsx)(b.A,{displayEmpty:!0,value:"",sx:De(!1,!1),children:(0,ze.jsx)(g.A,{value:"",children:(0,ze.jsx)("em",{style:{fontStyle:"normal",color:Fe.ph},children:"Select an option"})})})})]}):"Date picker"===n?(0,ze.jsxs)(l.A,{children:[(0,ze.jsx)(no,{required:r,children:i}),(0,ze.jsx)(m.A,{fullWidth:!0,size:"small",type:"date",disabled:!0,InputLabelProps:{shrink:!0},sx:a})]}):"Number"===n?(0,ze.jsxs)(l.A,{children:[(0,ze.jsx)(no,{required:r,children:i}),(0,ze.jsx)(m.A,{fullWidth:!0,size:"small",type:"number",disabled:!0,placeholder:"0",sx:a})]}):"Phone number"===n?(0,ze.jsxs)(l.A,{children:[(0,ze.jsx)(no,{required:r,children:i}),(0,ze.jsx)(m.A,{fullWidth:!0,size:"small",disabled:!0,placeholder:"+1 555 010 1234",sx:a,InputProps:{startAdornment:(0,ze.jsx)(k.A,{position:"start",children:(0,ze.jsx)(X.A,{sx:{fontSize:13,color:Fe.muted}})})}})]}):["Single checkbox","Multiple checkbox","Radio"].includes(n)?(0,ze.jsxs)(l.A,{children:[(0,ze.jsx)(no,{required:r,children:`${i} (${n})`}),(0,ze.jsx)(m.A,{fullWidth:!0,size:"small",disabled:!0,placeholder:`${n} options will appear here`,sx:a})]}):(0,ze.jsxs)(l.A,{children:[(0,ze.jsx)(no,{required:r,children:i}),(0,ze.jsx)(m.A,{fullWidth:!0,size:"small",disabled:!0,placeholder:`Enter ${(i||"").toLowerCase()}`,sx:a})]})}function fo(e){let{accounts:o,value:t,onChange:n,loading:i,placeholder:r}=e;return(0,ze.jsx)($.A,{size:"small",fullWidth:!0,disableClearable:!0,loading:i,options:o||[],getOptionLabel:e=>(null===e||void 0===e?void 0:e.username)||(null===e||void 0===e?void 0:e.nickname)||(null===e||void 0===e?void 0:e.name)||"",isOptionEqualToValue:(e,o)=>((null===e||void 0===e?void 0:e.account_id)||(null===e||void 0===e?void 0:e.accountid))===((null===o||void 0===o?void 0:o.account_id)||(null===o||void 0===o?void 0:o.accountid)),value:(o||[]).find(e=>((null===e||void 0===e?void 0:e.account_id)||(null===e||void 0===e?void 0:e.accountid))===t)||null,onChange:(e,o)=>n((null===o||void 0===o?void 0:o.account_id)||(null===o||void 0===o?void 0:o.accountid)||""),renderInput:e=>(0,ze.jsx)(m.A,{...e,size:"small",placeholder:i?"Loading accounts\u2026":r,sx:{"& .MuiOutlinedInput-root":{height:Le,borderRadius:"10px",bgcolor:Fe.bg,fontSize:13.5,fontFamily:Re,"& fieldset":{borderColor:Fe.border,borderWidth:"1.5px"},"&:hover fieldset":{borderColor:"divider"}
7,"&.Mui-focused fieldset":{borderColor:Fe.focus,borderWidth:"2px"}}}})})}function bo(e){let{eventName:o,publicUrl:t,activeEmailReminder:i,onToggleReminder:r,onSnack:s,redirectUrl:a,enableWhatsApp:x,onToggleWhatsApp:f,whatsAppAccountId:b,onWhatsAppAccountChange:g,whatsAppAccounts:v,whatsAppLoading:A,enableLinkedIn:y,onToggleLinkedIn:j,linkedInAccountId:S,onLinkedInAccountChange:k,linkedInAccounts:w,linkedInLoading:C,workflowId:W,onWorkflowChange:F,workflowList:R,workflowSeqLoading:L,linkedInAutomationId:B,onLinkedInAutomationChange:T,linkedInAutomations:D,linkedInSeqLoading:M,whatsAppAutomationId:E,onWhatsAppAutomationChange:q,whatsAppAutomations:P,whatsAppSeqLoading:G}=e;const[K,Y]=(0,n.useState)(!1),Z=W||B||E,Q=i||x||y;return(0,ze.jsxs)(l.A,{sx:{display:"flex",flexDirection:"column",alignItems:"center",p:{xs:2,md:2.5},pb:4},children:[(0,ze.jsxs)(l.A,{sx:{width:"100%",maxWidth:900},children:[(0,ze.jsxs)(l.A,{sx:{textAlign:"center",mb:2.5,p:{xs:2,md:2.5},borderRadius:3,background:`linear-gradient(135deg, ${Fe.focus}0d 0%, #8b5cf60d 100%)`,border:"1px solid",borderColor:`${Fe.focus}33`},children:[(0,ze.jsxs)(l.A,{sx:{display:"inline-flex",alignItems:"center",gap:.75,px:1.5,py:.4,borderRadius:10,mb:1.25,bgcolor:"rgba(34,197,94,0.12)",color:"#15803d",fontSize:11,fontWeight:800,fontFamily:Re,letterSpacing:.2},children:[(0,ze.jsx)(N.A,{sx:{fontSize:13}}),"READY TO ACCEPT BOOKINGS"]}),(0,ze.jsxs)(d.A,{sx:{fontSize:{xs:18,md:22},fontWeight:800,color:Fe.text,fontFamily:Re,letterSpacing:-.4,mb:.4},children:[o||"Your event"," is live"]}),(0,ze.jsx)(d.A,{sx:{fontSize:12.5,color:Fe.muted,fontFamily:Re,mb:2},children:"Share the link, then configure reminders and sequences below."}),t?(0,ze.jsxs)(l.A,{sx:{display:"flex",alignItems:"center",gap:.75,flexWrap:"wrap",p:1,borderRadius:2,border:"1.5px solid",borderColor:Fe.border,bgcolor:"background.paper",maxWidth:620,mx:"auto"},children:[(0,ze.jsx)(V.A,{sx:{fontSize:16,color:Fe.muted,flexShrink:0,ml:.5}}),(0,ze.jsx)(d.A,{sx:{fontSize:12,fontFamily:"monospace",color:Fe.focus,flex:1,minWidth:80,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:t}),(0,ze.jsx)(u.A,{size:"small",variant:"contained",startIcon:(0,ze.jsx)(O.A,{sx:{fontSize:13}}),onClick:()=>{var e;
7t&&(null===(e=navigator.clipboard)||void 0===e||e.writeText(t).catch(()=>{}),null===s||void 0===s||s({severity:"success",message:"Link copied"}))},sx:{borderRadius:1.5,textTransform:"none",fontFamily:Re,fontWeight:700,fontSize:11.5,py:.4,px:1.25,bgcolor:Fe.focus,boxShadow:"none","&:hover":{bgcolor:"#4F53E0",boxShadow:"none"}},children:"Copy"}),(0,ze.jsx)(z.A,{title:"Open in new tab",children:(0,ze.jsx)(I.A,{size:"small",onClick:()=>window.open(t,"_blank","noopener"),sx:{border:"1px solid",borderColor:Fe.border,borderRadius:1.5},children:(0,ze.jsx)(U.A,{sx:{fontSize:14}})})}),(0,ze.jsx)(z.A,{title:"Show QR code",children:(0,ze.jsx)(I.A,{size:"small",onClick:()=>Y(!0),sx:{border:"1px solid",borderColor:Fe.border,borderRadius:1.5},children:(0,ze.jsx)(_.A,{sx:{fontSize:14}})})})]}):(0,ze.jsx)(d.A,{sx:{fontSize:12,color:Fe.muted,fontFamily:Re,fontStyle:"italic"},children:"Booking URL will appear here once saved."})]}),(0,ze.jsxs)(p.Ay,{container:!0,spacing:2,alignItems:"flex-start",children:[(0,ze.jsx)(p.Ay,{item:!0,xs:12,md:5,children:(0,ze.jsxs)(l.A,{sx:{p:2,borderRadius:2.5,border:"1px solid",borderColor:Z?`${Fe.focus}55`:Fe.border,bgcolor:Z?`${Fe.focus}04`:"background.paper",height:"100%"},children:[(0,ze.jsxs)(l.A,{sx:{display:"flex",alignItems:"center",gap:1,mb:2,pb:1.25,borderBottom:"1px solid",borderColor:Fe.border},children:[(0,ze.jsx)(l.A,{sx:{width:30,height:30,borderRadius:1.5,bgcolor:`${Fe.focus}14`,color:Fe.focus,display:"flex",alignItems:"center",justifyContent:"center"},children:(0,ze.jsx)(de.A,{sx:{fontSize:16}})}),(0,ze.jsxs)(l.A,{children:[(0,ze.jsx)(d.A,{sx:{fontSize:13,fontWeight:800,color:Fe.text,fontFamily:Re,lineHeight:1.2},children:"Enrol in Sequence"}),(0,ze.jsx)(d.A,{sx:{fontSize:11,color:Fe.muted,fontFamily:Re},children:"Auto-enrol the contact after booking"})]})]}),(0,ze.jsx)(c.A,{spacing:1.5,children:[{label:"Workflow Automation",color:Fe.focus,icon:(0,ze.jsx)(de.A,{sx:{fontSize:13}}),loading:L,options:R,value:W,onChange:F,getVal:e=>e.workflowid,placeholder:"Select workflow\u2026"},{label:"LinkedIn Sequence",color:"#0A66C2",icon:(0,ze.jsx)(ae.A,{sx:{fontSize:13}}),loading:M,options:D,value:B,onChange:T,getVal:e=>e.automationid,placeholder:"Select LinkedIn sequence\u2026"},{label:"WhatsApp Sequence",color:"#25D366",icon:(0,ze.jsx)(se.A,{sx:{fontSize:13}}),loading:G,options:P,value:E,onChange:q,getVal:e=>e.automationid,placeholder:"Select WhatsApp sequence\u2026"}].map(e=>(0,ze.jsxs)(l.A,{children:[(0,ze.jsxs)(l.A,{sx:{display:"flex",alignItems:"center",gap:.75,mb:.75},children:[(0,ze.jsx)(l.A,{sx:{width:22,height:22,borderRadius:1,bgcolor:`${e.color}1a`,color:e.color,display:"flex",alignItems:"center",justifyContent:"center"},children:e.icon}),(0,ze.jsx)(d.A,{sx:{fontSize:12.5,fontWeight:700,color:Fe.text,fontFamily:Re},children:e.label})]}),(0,ze.jsx)($.A,{size:"small",fullWidth:!0,loading:e.loading,options:e.options,getOptionLabel:e=>e.name||"",isOptionEqualToValue:(o,t)=>e.getVal(o)===e.getVal(t),value:e.options.find(o=>e.getVal(o)===e.value)||null,onChange:(o,t)=>e.onChange(t?e.getVal(t):""),renderInput:o=>(0,ze.jsx)(m.A,{...o,placeholder:e.loading?"Loading\u2026":e.placeholder,sx:{"& .MuiOutlinedInput-root":{height:Le,borderRadius:"10px",bgcolor:Fe.bg,fontSize:13,fontFamily:Re,"& fieldset":{borderColor:Fe.border,borderWidth:"1.5px"},"&:hover fieldset":{borderColor:e.color},"&.Mui-focused fieldset":{borderColor:e.color,borderWidth:"2px"}}}})})]},e.label))})]})}),(0,ze.jsx)(p.Ay,{item:!0,xs:12,md:7,children:(0,ze.jsxs)(l.A,{sx:{p:2,borderRadius:2.5,border:"1px solid",borderColor:Q?`${Fe.focus}33`:Fe.border,bgcolor:"background.paper",height:"100%"},children:[(0,ze.jsxs)(l.A,{sx:{display:"flex",alignItems:"center",gap:1.25,mb:2,pb:1.25,borderBottom:"1px solid",borderColor:Fe.border},children:[(0,ze.jsx)(l.A,{sx:{width:34,height:34,borderRadius:1.75,background:"linear-gradient(135deg, #F59E0B 0%, #D97706 100%)",display:"flex",alignItems:"center",justifyContent:"center",boxShadow:"0 2px 8px rgba(245,158,11,0.35)",flexShrink:0},children:(0,ze.jsx)(J.A,{sx:{fontSize:18,color:"#fff"}})}),(0,ze.jsxs)(l.A,{children:[(0,ze.jsx)(d.A,{sx:{fontSize:15,fontWeight:800,color:Fe.text,fontFamily:Re,lineHeight:1.15,letterSpacing:-.3},children:"Reminders"}),(0,ze.jsx)(d.A,{sx:{fontSize:11,color:Fe.muted,fontFamily:Re,mt:.1},children:"Notify invitees before the meeting"})]})]}),(0,ze.jsxs)(c.A,{spacing:1.25,children:[(0,ze.jsxs)(l.A,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",p:1.25,borderRadius:2,border:"1px solid",borderColor:i?`${Fe.focus}44`:Fe.border,bgcolor:i?`${Fe.focus}06`:"transparent"},children:[(0,ze.jsxs)(l.A,{sx:{display:"flex",alignItems:"center",gap:1},children:[(0,ze.jsx)(l.A,{sx:{width:28,height:28,borderRadius:1.25,bgcolor:"background.paper",color:"#D97706",display:"flex",alignItems:"center",justifyContent:"center"},children:(0,ze.jsx)(J.A,{sx:{fontSize:15}})}),(0,ze.jsxs)(l.A,{children:[(0,ze.jsx)(d.A,{sx:{fontSize:12.5,fontWeight:700,color:Fe.text,fontFamily:Re,lineHeight:1.2},children:"Email reminder"}),(0,ze.jsx)(d.A,{sx:{fontSize:11,color:Fe.muted,fontFamily:Re},children:"30 min before meeting"})]})]}),(0,ze.jsx)(h.A,{size:"small",checked:i,onChange:e=>r(e.target.checked),sx:{"& .MuiSwitch-switchBase.Mui-checked":{color:"#D97706"},"& .MuiSwitch-switchBase.Mui-checked + .MuiSwitch-track":{bgcolor:"#D97706"}}})]}),(0,ze.jsxs)(l.A,{sx:{display:"flex",alignItems:"center",gap:1,p:1.25,borderRadius:2,border:"1px solid",borderColor:Fe.border,bgcolor:"transparent"},children:[(0,ze.jsx)(l.A,{sx:{width:28,height:28,borderRadius:1.25,bgcolor:`${Fe.focus}
714`,color:Fe.focus,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:(0,ze.jsx)(H.A,{sx:{fontSize:15}})}),(0,ze.jsxs)(l.A,{sx:{flex:1,minWidth:0},children:[(0,ze.jsx)(d.A,{sx:{fontSize:12.5,fontWeight:700,color:Fe.text,fontFamily:Re,lineHeight:1.2},children:"Calendar invitation"}),(0,ze.jsx)(d.A,{sx:{fontSize:11,color:Fe.muted,fontFamily:Re},children:"Requires Google / Office 365 connection"})]})]}),[{key:"wa",label:"WhatsApp reminder",sub:"Via connected WA account",color:"#25D366",bg:"rgba(37,211,102,0.06)",border:"rgba(37,211,102,0.40)",icon:(0,ze.jsx)(se.A,{sx:{fontSize:15}}),iconBg:"rgba(37,211,102,0.12)",enabled:x,onToggle:f,accounts:v,accountId:b,onAccountChange:g,loading:A,placeholder:"Select WhatsApp account"},{key:"li",label:"LinkedIn reminder",sub:"Via connected LinkedIn account",color:"#0A66C2",bg:"rgba(10,102,194,0.06)",border:"rgba(10,102,194,0.40)",icon:(0,ze.jsx)(ae.A,{sx:{fontSize:15}}),iconBg:"rgba(10,102,194,0.12)",enabled:y,onToggle:j,accounts:w,accountId:S,onAccountChange:k,loading:C,placeholder:"Select LinkedIn account"}].map(e=>(0,ze.jsxs)(l.A,{sx:{p:1.25,borderRadius:2,border:"1px solid",borderColor:e.enabled?e.border:Fe.border,bgcolor:e.enabled?e.bg:"transparent"},children:[(0,ze.jsxs)(l.A,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mb:e.enabled?1:0},children:[(0,ze.jsxs)(l.A,{sx:{display:"flex",alignItems:"center",gap:1},children:[(0,ze.jsx)(l.A,{sx:{width:28,height:28,borderRadius:1.25,bgcolor:e.iconBg,color:e.color,display:"flex",alignItems:"center",justifyContent:"center"},children:e.icon}),(0,ze.jsxs)(l.A,{children:[(0,ze.jsx)(d.A,{sx:{fontSize:12.5,fontWeight:700,color:Fe.text,fontFamily:Re,lineHeight:1.2},children:e.label}),(0,ze.jsx)(d.A,{sx:{fontSize:11,color:Fe.muted,fontFamily:Re},children:e.sub})]})]}),(0,ze.jsx)(h.A,{size:"small",checked:!!e.enabled,onChange:o=>e.onToggle(o.target.checked),sx:{"& .MuiSwitch-switchBase.Mui-checked":{color:e.color},"& .MuiSwitch-switchBase.Mui-checked + .MuiSwitch-track":{bgcolor:e.color}}})]}),e.enabled&&(0,ze.jsx)(fo,{accounts:e.accounts,value:e.accountId,onChange:e.onAccountChange,loading:e.loading,placeholder:e.placeholder})]},e.key))]})]})})]}),a&&(0,ze.jsxs)(l.A,{sx:{mt:2,p:2,borderRadius:2.5,border:"1px solid",borderColor:`${Fe.focus}55`,bgcolor:`${Fe.focus}06`,display:"flex",alignItems:"flex-start",gap:1.5},children:[(0,ze.jsx)(l.A,{sx:{width:36,height:36,flexShrink:0,borderRadius:2,display:"flex",alignItems:"center",justifyContent:"center",bgcolor:`${Fe.focus}1a`,color:Fe.focus}
7,children:(0,ze.jsx)(U.A,{sx:{fontSize:20}})}),(0,ze.jsxs)(l.A,{sx:{minWidth:0,flex:1},children:[(0,ze.jsx)(d.A,{sx:{fontSize:14,fontWeight:700,color:Fe.text,mb:.25,fontFamily:Re},children:"Post-booking redirect"}),(0,ze.jsx)(d.A,{sx:{fontSize:12,color:Fe.muted,fontFamily:Re,mb:.75,lineHeight:1.55},children:"After confirming, invitees will be redirected to your custom page in 5 seconds."}),(0,ze.jsxs)(l.A,{sx:{display:"flex",alignItems:"center",gap:.75,bgcolor:"background.paper",border:"1px solid",borderColor:Fe.border,borderRadius:1.5,px:1.25,py:.6},children:[(0,ze.jsx)(V.A,{sx:{fontSize:13,color:Fe.muted,flexShrink:0}}),(0,ze.jsx)(d.A,{sx:{fontSize:12,fontFamily:"monospace",color:Fe.focus,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},noWrap:!0,children:a}),(0,ze.jsx)(z.A,{title:"Open redirect URL",children:(0,ze.jsx)(I.A,{size:"small",onClick:()=>window.open(a,"_blank","noopener"),sx:{p:.25,ml:"auto",flexShrink:0},children:(0,ze.jsx)(U.A,{sx:{fontSize:13,color:Fe.muted}})})})]})]})]})]}),(0,ze.jsx)(go,{open:K,url:t,onClose:()=>Y(!1)})]})}function go(e){let{open:o,url:t,onClose:n}=e;const i=t?`https://api.qrserver.com/v1/create-qr-code/?size=260x260&data=${encodeURIComponent(t)}`:null;return(0,ze.jsxs)(T.A,{open:o,onClose:n,maxWidth:"xs",fullWidth:!0,PaperProps:{sx:{borderRadius:3}},children:[(0,ze.jsx)(D.A,{sx:{fontSize:15,fontWeight:700,fontFamily:Re},children:"Scan to book"}),(0,ze.jsx)(M.A,{children:(0,ze.jsx)(l.A,{sx:{textAlign:"center",py:1},children:i?(0,ze.jsxs)(ze.Fragment,{children:[(0,ze.jsx)(l.A,{component:"img",src:i,alt:"QR code",sx:{width:260,height:260,maxWidth:"100%",border:"1px solid",borderColor:Fe.border,borderRadius:2}}),(0,ze.jsx)(d.A,{sx:{fontSize:11.5,color:Fe.muted,mt:1,fontFamily:Re,wordBreak:"break-all"},children:t})]}):(0,ze.jsx)(d.A,{sx:{fontSize:13,color:Fe.muted,py:3,fontFamily:Re},children:"URL not available yet. Save the event first."})})}),(0,ze.jsx)(E.A,{sx:{px:3,pb:2},children:(0,ze.jsx)(u.A,{variant:"contained",onClick:n,sx:{borderRadius:2,textTransform:"none",fontWeight:700,fontFamily:Re,fontSize:12.5,bgcolor:Fe.focus,"&:hover":{bgcolor:"#4F53E0"}},children:"Close"})})]})}},36669(e,o,t){t.d(o,{A:()=>a});t(9950);var n=t(10226),i=t(83274),r=t(25333),l=t(99600),s=t(44414);function a(e){let{label:o="Back",onClick:t,variant:a="default",sx:d}=e;return"text"===a?(0,s.jsx)(n.A,{onClick:t,startIcon:(0,s.jsx)(l.A,{sx:{fontSize:"16px !important"}}),sx:{textTransform:"none",fontWeight:600,fontSize:13,color:"text.secondary",px:0,mb:1.5,minWidth:0,"&:hover":{bgcolor:"transparent",color:"text.primary"},...d},children:o}):(0,s.jsx)(i.A,{title:o,children:(0,s.jsx)(r.A,{onClick:t,size:"small",sx:{border:"1px solid",borderColor:"divider",borderRadius:2,width:36,height:36,"&:hover":{bgcolor:"action.hover"},...d},children:(0,s.jsx)(l.A,{sx:{fontSize:18}})})})}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.