1import{R as qe,d as pe,af as Ee,a7 as ye,h as Ce,y as se,r as c,a8 as De,L as Le,P as lt,aN as Oe,_ as be,I as we,aQ as Pe,a as d,b as o,g as m,F as L,p as N,t as r,s as te,E as ee,e as S,q as oe,G as Ae,a5 as Ne,J as ze,f as ve,o as s,a0 as Ve,a3 as st,n as K,aI as z,c as _e,N as rt,u as it,w as dt,A as ct,ak as ut,aX as mt,aH as ft,aO as Re,aF as yt,aB as vt,aP as gt,W as ht,au as _t,X as xt,av as pt}from"./index-DKueJ56C.js";import{U as bt}from"./UiCheckbox-DuCOVXTG.js";import{U as je}from"./UiDropdown-BTMuH8wV.js";import{U as Be}from"./UiTextField-ROeT5wsN.js";import{L as kt}from"./LocationPicker-PFcQ51UV.js";import{T as wt}from"./TimezonePicker-Ct6pZPP9.js";import{C as Ct}from"./circle-alert-k0D78Cqj.js";import{E as St}from"./ellipsis-Cl43hUwk.js";import{C as Mt}from"./calendar-plus-BNNY16up.js";import{C as zt}from"./chevron-up-DfsKOsOM.js";import{C as Et}from"./chevron-down-Cv72UE4P.js";import"./UiButton-D4rLGMnN.js";import"./LocationIcon-D-X4-yp-.js";import"./grip-vertical-DSEHQCUx.js";import"./pencil-BubuoIeh.js";import"./datetime-D2JIYqdq.js";/** 2 * @license @lucide/vue v1.18.0 - ISC 3 * 4 * This source code is licensed under the ISC license. 5 * See the LICENSE file in the root directory of this source tree. 6 */const Dt=[["path",{d:"M21.2 8.4c.5.38.8.97.8 1.6v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V10a2 2 0 0 1 .8-1.6l8-6a2 2 0 0 1 2.4 0l8 6Z",key:"1jhwl8"}],["path",{d:"m22 10-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 10",key:"1qfld7"}]],Lt=qe("mail-open",Dt);/** 7 * @license @lucide/vue v1.18.0 - ISC 8 * 9 * This source code is licensed under the ISC license. 10 * See the LICENSE file in the root directory of this source tree. 11 */const Tt=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],Ft=qe("panel-left",Tt),Ht=pe({__name:"ExternalCalendars",emits:["updateShow","updateCalendars"],setup(Z,{expose:n,emit:T}){const e=T,k=Ee(),b=["#ffd4d5","#fdd6a6","#feeaaf","#c3ebc0","#cff9f8","#acd9ef","#c0d8f3","#c9ccf2","#f3d4e7"],t=c([]),a=c([]),i=c(!1),w=c(!0),g=c(0),U=c(null),I=c(""),J=c(""),Q=c({});ye(i,f=>e("updateShow",f),{immediate:!0}),ye(t,f=>e("updateCalendars",f),{immediate:!0,deep:!0}),Ce(G);function V(){i.value=!i.value,window.localStorage.setItem("sidebar-shared-calendars",i.value?"open":"close")}async function G(){const f=await se("GET","integrations/getExternalCalendars");if(f&&(t.value=f.data.calendars,a.value=f.data.pendings,w.value)){w.value=!1;const x=window.localStorage.getItem("sidebar-shared-calendars"),l=t.value.length>0||a.value.length>0;x?x==="open"&&l&&(i.value=!0):l&&(i.value=!0)}}function q(f){for(const x of f){const l=t.value.find(u=>u.id==x.id);l&&(l.error=x.status==="error")}}function D(f,x,l){U.value=f.id,I.value=x,x==="rename"&&(J.value=f.name==null?"":f.name,l(),De(()=>{var u;return(u=Q.value[`rename-${f.id}`])==null?void 0:u.focus()}))}function R(){U.value=null,I.value=""}async function O(f){if(U.value===f.id&&I.value==="rename")return;const x=f.is_selected==1?0:1;await se("POST","integrations/updateExternalCalendar",{id:f.id,is_selected:x})&&(f.is_selected=x),R()}async function C(f,x){if(x===f.color)return;await se("POST","integrations/updateExternalCalendar",{id:f.id,color:x})&&(f.color=x)}async function X(f){const x=J.value.trim();if(x===f.name){R();return}await se("POST","integrations/updateExternalCalendar",{id:f.id,name:x})&&(f.name=x),R()}async function j(f,x){x(),await se("DELETE","integrations/removeExternalCalendar",{id:f.id})&&(t.value=t.value.filter(u=>u.id!=f.id)),R()}async function ne(f){if(!(g.value>0)){g.value=f.id;try{const x=await se("POST","integrations/sendRequestCalendar",{email:f.email});x?x.data.status==="error"?k.error(x.data.message):x.data.status==="success"&&k.success("Your request has been sent to the email address."):k.error("Could not send the request!")}finally{g.value=0}}}async function re(f){if(!(g.value>0)){g.value=f.id;try{await se("POST","integrations/removeRequestCalendar",{email:f.email})?a.value=a.value.filter(l=>l.email!=f.email):k.error("Could not remove the pending!")}finally{g.value=0}}}n({toggle:V,getExternalCalendar:G,loadExternalCalendar:q});const E={emit:e,toast:k,colors:b,calendars:t,pendings:a,show:i,isFirst:w,pendingLoadingId:g,pickedId:U,pickedMode:I,renameValue:J,renameInputs:Q,toggle:V,getExternalCalendar:G,loadExternalCalendar:q,pickCalendar:D,nopick:R,toggleCalendar:O,updateColor:C,saveRename:X,removeCalendar:j,resendRequest:ne,removeRequest:re,get MoreHorizontal(){return St},get AlertCircle(){return Ct},get ChevronLeft(){return Oe},get Check(){return lt},get Loader2(){return Le},get UiDropdown(){return je}};return Object.defineProperty(E,"__isScriptSetup",{enumerable:!1,value:!0}),E}}),Nt={class:"w-64 shrink-0 border-r border-gray-200 bg-gray-50/60 overflow-y-auto p-4"},Rt=["title"],Ut={class:"text-gray-400 hover:text-blue-600 cursor-pointer"}
11,It=["onClick"],qt=["onClick"],Ot=["onClick"],Pt=["onKeyup","onBlur"],At=["onClick"],Vt={class:"text-xs text-gray-600 truncate"},jt={class:"text-gray-500 hover:text-blue-600 cursor-pointer"},Bt={key:0},Zt=["onClick"],Wt=["onClick"],Jt=["onClick"],Gt={class:"grid grid-cols-5 gap-1.5"},Xt=["onClick"],Yt={class:"text-center px-2 py-3"},Kt={class:"flex items-center justify-center gap-3"},Qt=["onClick"],$t=["onClick"];function eo(Z,n,T,e,k,b){return we((s(),d("div",Nt,[n[7]||(n[7]=o("h5",{class:"font-semibold text-gray-900 mb-3"},"Shared calendars",-1)),m(" Pendings "),(s(!0),d(L,null,N(e.pendings,t=>(s(),d("div",{key:t.id,class:"flex items-center gap-2 py-2"},[n[3]||(n[3]=o("span",{class:"text-[10px] uppercase bg-gray-200 text-gray-600 rounded px-2 py-0.5"},"Pending",-1)),n[4]||(n[4]=o("span",{class:"w-2.5 h-2.5 rounded-full bg-gray-300 shrink-0"},null,-1)),o("span",{class:"flex-1 text-sm text-gray-700 truncate",title:t.email},r(t.email),9,Rt),e.pendingLoadingId===t.id?(s(),te(e.Loader2,{key:0,size:15,class:"animate-spin text-gray-400"})):(s(),te(e.UiDropdown,{key:1,position:"bottom-right",width:"140px"},{toggle:ee(()=>[o("span",Ut,[S(e.MoreHorizontal,{size:16})])]),default:ee(({close:a})=>[o("button",{class:"w-full text-left px-2 py-1.5 rounded text-sm hover:bg-gray-50",onClick:i=>{e.resendRequest(t),a()}},"Resend",8,It),o("button",{class:"w-full text-left px-2 py-1.5 rounded text-sm text-rose-600 hover:bg-rose-50",onClick:i=>{e.removeRequest(t),a()}},"Remove",8,qt)]),_:2},1024))]))),128)),m(" Calendars "),(s(!0),d(L,null,N(e.calendars,t=>(s(),d("div",{key:t.id,class:"flex items-center gap-2 py-2 rounded-md px-1",style:oe(t.is_selected?{backgroundColor:t.color}:{})},[o("div",{class:"flex-1 flex items-center gap-2 overflow-hidden cursor-pointer",onClick:a=>e.toggleCalendar(t)},[t.error?(s(),te(e.AlertCircle,{key:0,size:15,class:"text-white bg-rose-500 rounded-full shrink-0"})):m("v-if",!0),o("span",{class:"w-2.5 h-2.5 rounded-full shrink-0",style:oe({backgroundColor:t.color})},null,4),o("div",{class:"flex-1 overflow-hidden",onClick:n[1]||(n[1]=Ae(()=>{},["stop"]))},[e.pickedId===t.id&&e.pickedMode==="rename"?we((s(),d("input",{key:0,ref_for:!0,ref:a=>e.renameInputs[`rename-${t.id}`]=a,"onUpdate:modelValue":n[0]||(n[0]=a=>e.renameValue=a),type:"text",class:"w-full text-sm font-semibold border border-blue-300 rounded px-1",onKeyup:[Ne(a=>e.saveRename(t),["enter"]),Ne(e.nopick,["esc"])],onBlur:a=>e.saveRename(t)},null,40,Pt)),[[ze,e.renameValue]]):(s(),d(L,{key:1},[o("p",{class:"text-sm font-semibold text-gray-900 truncate",onClick:a=>e.toggleCalendar(t)},r(t.name),9,At),o("p",Vt,r(t.email),1)],64))])],8,Ot),S(e.UiDropdown,{position:"bottom-right",width:"200px",onToggled:n[2]||(n[2]=a=>a&&e.pickedMode!=="rename"&&e.nopick())},{toggle:ee(()=>[o("span",jt,[S(e.MoreHorizontal,{size:16})])]),default:ee(({close:a})=>[m(" menu "),e.pickedMode===""||e.pickedId!==t.id?(s(),d("div",Bt,[o("button",{class:"w-full text-left px-2 py-1.5 rounded text-sm hover:bg-gray-50",onClick:i=>e.pickCalendar(t,"rename",a)},"Rename",8,Zt),o("button",{class:"w-full text-left px-2 py-1.5 rounded text-sm hover:bg-gray-50",onClick:i=>e.pickCalendar(t,"color",a)},"Change color",8,Wt),o("button",{class:"w-full text-left px-2 py-1.5 rounded text-sm text-rose-600 hover:bg-rose-50",onClick:i=>e.pickCalendar(t,"remove",a)},"Remove",8,Jt)])):e.pickedMode==="color"?(s(),d(L,{key:1},[m(" change color "),o("div",null,[o("button",{class:"inline-flex items-center gap-1 text-sm text-gray-600 hover:text-blue-600 mb-2",onClick:e.nopick},[S(e.ChevronLeft,{size:14}),n[5]||(n[5]=ve(" Back",-1))]),o("div",Gt,[(s(),d(L,null,N(e.colors,i=>o("span",{key:i,class:"w-7 h-7 rounded cursor-pointer flex items-center justify-center",style:oe({backgroundColor:i}),onClick:w=>{e.updateColor(t,i),e.nopick()}},[i===t.color?(s(),te(e.Check,{key:0,size:14,class:"text-gray-700"})):m("v-if",!0)],12,Xt)),64))])])],2112)):e.pickedMode==="remove"?(s(),d(L,{key:2},[m(" remove confirm "),o("div",Yt,[n[6]||(n[6]=o("p",{class:"text-sm text-gray-700 mb-3"},"Are you sure you want to remove this calendar?",-1)),o("div",Kt,[o("button",{class:"border border-gray-200 rounded-lg px-3 py-1.5 text-sm",onClick:i=>{e.nopick(),a()}},"No, don't",8,Qt),o("button",{class:"border border-rose-300 text-rose-600 rounded-lg px-3 py-1.5 text-sm hover:bg-rose-50",onClick:i=>e.removeCalendar(t,a)},"Yes, remove",8,$t)])])],2112)):m("v-if",!0)]),_:2}
11,1024)],4))),128))],512)),[[Pe,e.show]])}const to=be(Ht,[["render",eo],["__file","/home/gitlab-runner/weezly-v3/callendo-frontend-v3/src/components/scheduling/ExternalCalendars.vue"]]),oo=pe({__name:"SendRequestCalendar",emits:["close","update"],setup(Z,{expose:n,emit:T}){n();const e=T,{t:k}=Ve(),b=Ee(),t=c(""),a=c(""),i=c(""),w=c("google"),g=c(!1),U=c(null),I=[{key:"google",label:"Google calendar",icon:"/icons/google-calendar.png"},{key:"outlook",label:"Outlook calendar",icon:"/icons/outlook-calendar.png"},{key:"notsure",label:"Not sure",icon:"/icons/calendar-black.png"}],J=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;Ce(()=>{setTimeout(()=>{var D,R;return(R=(D=U.value)==null?void 0:D.focus)==null?void 0:R.call(D)},500)});function Q(){g.value||e("close")}function V(D){w.value=D,i.value=""}async function G(){if(g.value)return;const D=t.value.trim().toLowerCase();let R=!1;if(a.value="",i.value="",D===""?(a.value="This field is required!",R=!0):J.test(D)||(a.value=k("alert.enter_valid_email_adress"),R=!0),w.value||(i.value="Calendar type need to be selected",R=!0),R){De(()=>{var O,C;return(C=(O=U.value)==null?void 0:O.focus)==null?void 0:C.call(O)});return}g.value=!0;try{const O=await se("POST","integrations/sendRequestCalendar",{email:D,type:w.value});O?O.data.status==="error"?b.error(O.data.message):O.data.status==="success"&&(e("update"),b.success("Your request has been sent to the email address.")):b.error("Could not send the request!")}finally{g.value=!1}}const q={emit:e,t:k,toast:b,email:t,emailError:a,typeError:i,integrationType:w,loading:g,emailInput:U,types:I,EMAIL_RE:J,close:Q,selectType:V,send:G,get Loader2(){return Le},get UiModal(){return st},get UiTextField(){return Be}};return Object.defineProperty(q,"__isScriptSetup",{enumerable:!1,value:!0}),q}}),no={class:"mb-5"},ao={class:"mb-5"},lo=["onClick"],so={key:0,class:"w-2 h-2 rounded-full bg-blue-600"},ro=["src"],io={class:"text-sm text-gray-800"},co={key:0,class:"text-rose-500 text-xs"},uo={class:"flex items-center mt-8"},mo=["disabled"];function fo(Z,n,T,e,k,b){return s(),te(e.UiModal,{open:!0,title:"","max-width":"max-w-md","onUpdate:open":n[2]||(n[2]=t=>!t&&e.close())},{default:ee(()=>[n[7]||(n[7]=o("div",{class:"text-center mt-2"},[o("span",{class:"inline-block text-blue-600",style:{"font-size":"64px"}},"ðï¸")],-1)),n[8]||(n[8]=o("h4",{class:"text-lg font-semibold text-center mt-2 mb-6 text-gray-900"},[ve("Send a request to"),o("br"),ve("view someone's calendar")],-1)),m(" Email "),o("div",no,[n[3]||(n[3]=o("p",{class:"text-sm text-gray-700 mb-1"},[ve("Recipient's Email Address for Calendar Access "),o("span",{class:"text-rose-500"},"*")],-1)),S(e.UiTextField,{ref:"emailInput",modelValue:e.email,"onUpdate:modelValue":[n[0]||(n[0]=t=>e.email=t),n[1]||(n[1]=t=>e.emailError="")],placeholder:"[email protected]",error:e.emailError},null,8,["modelValue","error"])]),m(" Calendar type "),o("div",ao,[n[4]||(n[4]=o("p",{class:"text-sm text-gray-700 mb-2"},"Calendar type",-1)),(s(),d(L,null,N(e.types,t=>o("button",{key:t.key,class:"flex items-center gap-2.5 my-2 w-full text-left",onClick:a=>e.selectType(t.key)},[o("span",{class:K(["w-4 h-4 rounded-full border-2 flex items-center justify-center shrink-0",e.integrationType===t.key?"border-blue-600":"border-gray-300"])},[e.integrationType===t.key?(s(),d("span",so)):m("v-if",!0)],2),o("img",{src:t.icon,alt:"",width:"20"},null,8,ro),o("span",io,r(t.label),1)],8,lo)),64)),e.typeError?(s(),d("span",co,r(e.typeError),1)):m("v-if",!0)]),o("div",uo,[o("button",{class:"border border-gray-200 rounded-lg px-4 py-2 text-sm text-gray-700 hover:bg-gray-50",onClick:e.close},"Cancel"),n[6]||(n[6]=o("div",{class:"flex-1"},null,-1)),o("button",{class:"inline-flex items-center gap-2 bg-blue-600 text-white px-5 py-2 rounded-lg text-sm font-medium hover:bg-blue-700 disabled:opacity-50",disabled:e.loading,onClick:e.send},[e.loading?(s(),te(e.Loader2,{key:0,size:14,class:"animate-spin"})):m("v-if",!0),n[5]||(n[5]=ve(" Send ",-1))],8,mo)])]),_:1})}const yo=be(oo,[["render",fo],["__file","/home/gitlab-runner/weezly-v3/callendo-frontend-v3/src/components/scheduling/SendRequestCalendar.vue"]]),he=50,Ue=15,vo=pe({__name:"SingleDay",props:{weekDay:{type:Object,required:!0},callendoEvents:{type:Array,required:!0},calendarEvents:{type:Array,required:!0},duration:{type:Number,required:!0},timezone:{type:String,required:!0},slots:{type:Array,required:!0},nowHeight:{type:Number,required:!0},nowDate:{type:String,required:!0}},emits:["addSlot","clearSlot"],setup(Z,{expose:n,emit:T}){n();const e=Z,k=T,b=c(null),t=c("0px"),a=c({top:0,range_start:"",range_end:"",status:"hide"});function i(){a.value.status="hide"}const w=_e(()=>e.duration*he/60);ye(()=>e.weekDay,()=>{const D=z.now().toFormat("yyyy/MM/dd").localeCompare(e.weekDay.date);D<0?t.value="0px":D>0&&(t.value="100%")},{deep:!0,immediate:!0}),ye(()=>[e.nowHeight,e.nowDate],()=>{e.nowDate===e.weekDay.date&&(t.value=e.nowHeight+"px")},{immediate:!0});const g=()=>z.now();function U(q){if(!b.value)return;const D=b.value.getBoundingClientRect(),R=q.clientY-D.top-10,O=Ue*he/60;let C=Math.round(R/O)*O;C<0&&(C=0),C+w.value>24*he&&(C=24*he-he);const X=C+w.value;let j=g().set({hour:0,minute:0,second:0,millisecond:0});j=j.plus({minutes:C*60/he});const ne=j.toFormat("HH:mm");j=j.plus({minutes:e.duration});const re=j.toFormat("HH:mm");let E="";if(z.fromFormat(e.weekDay.date+" "+ne,"yyyy/MM/dd HH:mm",{zone:e.timezone}).minus({minutes:15}).toMillis()-g().toMillis()<0&&(E="unavailable"),E===""){const x=e.callend
11oEvents.filter(l=>l.date===e.weekDay.date);for(const l of x)if(l.top<X&&l.bottom>C){E="unavailable";break}}if(E===""){const x=e.slots.filter(l=>l.date===e.weekDay.date);for(const l of x){const u=l.top+w.value;if(l.top<X&&u>C){E="hide";break}}}a.value.status=E,a.value.range_start=ne,a.value.range_end=re,a.value.top=C}function I(){a.value.status===""&&(k("addSlot",{date:e.weekDay.date,top:a.value.top,range_start:a.value.range_start,range_end:a.value.range_end,status:a.value.status}),a.value.status="hide")}const J=_e(()=>e.slots.filter(q=>q.date===e.weekDay.date)),Q=_e(()=>e.callendoEvents.filter(q=>q.date===e.weekDay.date)),V=_e(()=>e.calendarEvents.filter(q=>q.date===e.weekDay.date)),G={props:e,emit:k,HLEN:he,STEP:Ue,wrapper:b,passedHeight:t,slot:a,mouseLeave:i,hdu:w,now:g,mouseMove:U,addSlot:I,daySlots:J,dayCallendo:Q,dayCalendar:V};return Object.defineProperty(G,"__isScriptSetup",{enumerable:!1,value:!0}),G}}),go={class:"evt-title"},ho={class:"evt-time"},_o={class:"evt-title"},xo=["onClick"];function po(Z,n,T,e,k,b){return s(),d("div",{ref:"wrapper",class:"oneoff-single-day",onMousemove:e.mouseMove,onMouseleave:e.mouseLeave,onClick:e.addSlot},[m(" Passed time shading "),o("div",{class:"passed-time",style:oe({height:e.passedHeight})},null,4),m(" Existing Weezly events "),(s(!0),d(L,null,N(e.dayCallendo,t=>(s(),d("div",{key:"c"+t.top+t.bottom,class:K(["weezly-event",{passed:t.to<e.now()}]),style:oe({top:t.top+"px",height:t.height+"px"})},[o("p",go,r(t.guest_name)+": "+r(t.event_name),1),o("p",ho,r(t.fr.toFormat("HH:mm"))+" - "+r(t.to.toFormat("HH:mm")),1)],6))),128)),m(" Existing calendar (integration / external) events "),(s(!0),d(L,null,N(e.dayCalendar,t=>(s(),d("div",{key:"k"+t.top+t.bottom,class:K(["weezly-event",[t.type,{passed:t.to<e.now()}]]),style:oe({top:t.top+"px",height:t.height+"px",...t.type==="external_calendar"&&t.color?{backgroundColor:t.color}:{}})},[o("p",_o,r(t.name),1),o("p",{class:K(["evt-time",{sshy:t.type==="external_calendar"}])},r(t.fr.toFormat("HH:mm"))+" - "+r(t.to.toFormat("HH:mm")),3)],6))),128)),m(" Committed one-off slots "),(s(!0),d(L,null,N(e.daySlots,t=>(s(),d("div",{key:"s"+t.top,class:"oneoff-slot",style:oe({top:t.top+"px",height:e.hdu+"px"}),onClick:Ae(a=>e.emit("clearSlot",t),["stop"])},[n[0]||(n[0]=o("span",{class:"remove-icon"},"â",-1)),o("p",null,r(t.range_start)+" - "+r(t.range_end),1)],12,xo))),128)),m(" Tentative slot following the cursor "),o("div",{class:K(["slot-selection",e.slot.status]),style:oe({top:e.slot.top+"px",height:e.hdu+"px"})},r(e.slot.status==="unavailable"?"Unavailable":e.slot.range_start+" - "+e.slot.range_end),7)],544)}const bo=be(vo,[["render",po],["__scopeId","data-v-e27103e4"],["__file","/home/gitlab-runner/weezly-v3/callendo-frontend-v3/src/components/builder/oneoff/SingleDay.vue"]]),Ie=50,ko=pe({__name:"NowLabel",props:{timezone:{type:String,required:!0}},emits:["now-update"],setup(Z,{expose:n,emit:T}){n();const e=Z,k=T,b=c(-10),t=c("");let a;function i(){const g=z.now().setZone(e.timezone),U=(g.hour*60+g.minute)*Ie/60;b.value=U-10,t.value=`${g.hour}:${g.toFormat("mm")}`,k("now-update",{height:U,date:g.toFormat("yyyy/MM/dd")})}Ce(()=>{i(),a=setInterval(i,1e3)}),rt(()=>{a&&clearInterval(a)});const w={props:e,emit:k,HOUR_HEIGHT:Ie,nowTop:b,nowLabel:t,get nowInterval(){return a},set nowInterval(g){a=g},labelNow:i};return Object.defineProperty(w,"__isScriptSetup",{enumerable:!1,value:!0}),w}});function wo(Z,n,T,e,k,b){return e.nowTop>0?(s(),d("div",{key:0,class:"now-label",style:oe({top:e.nowTop+"px"})},[o("span",null,r(e.nowLabel),1)],4)):m("v-if",!0)}const Co=be(ko,[["render",wo],["__scopeId","data-v-9bb60a92"],["__file","/home/gitlab-runner/weezly-v3/callendo-frontend-v3/src/components/builder/oneoff/NowLabel.vue"]]),Y=50,So=pe({__name:"Calendar",props:{timezone:{type:String,required:!0},available:{type:Object,required:!0},duration:{type:Number,required:!0},slots:{type:Array,required:!0},theEvent:{type:null,required:!1}},emits:["addSlot","clearSlot","clearDaySlots","reset","loadWeek","loadExternalCalendar"],setup(Z,{expose:n,emit:T}){const e=Z,k=T;function b(){if(e.timezone){const l=z.now().setZone(e.timezone);if(l.isValid)return l}return z.now()}function t(l){let u;
11try{u=z.now().setZone(l).toFormat("ZZ").substring(0,3)}catch{u=z.now().toFormat("ZZ").substring(0,3)}return["TZ"+u,"1 am","2 am","3 am","4 am","5 am","6 am","7 am","8 am","9 am","10 am","11 am","12 pm","1 pm","2 pm","3 pm","4 pm","5 pm","6 pm","7 pm","8 pm","9 pm","10 pm","11 pm"]}const a=c(t(e.timezone)),i=c([]),w=c(""),g=c([]),U=c([]),I=c([]),J=c([]),Q=c(1),V=c(!1),G=c(null),q=c({height:0,date:""});function D(l){q.value=l}const R=_e(()=>i.value.some(l=>l.date===w.value));Ce(()=>{C();const l=z.now().setZone(e.timezone),u=(l.hour*60+l.minute)*Y/60-200;try{G.value&&(G.value.scrollTop=u)}catch{}if(e.theEvent){let h=[];try{h=JSON.parse(e.theEvent.slots)||[]}catch{h=[]}h.forEach(y=>{const p=z.fromFormat(y,"yyyy/MM/dd HH:mm",{zone:e.theEvent.timezone});if(!p.isValid)return;const M=(p.hour*60+p.minute)*Y/60;k("addSlot",{top:M,range_start:p.toFormat("HH:mm"),range_end:p.plus({minutes:e.duration}).toFormat("HH:mm"),status:"",date:p.toFormat("yyyy/MM/dd")})})}}),ye(()=>e.timezone,()=>{const l=i.value.length&&i.value[0].dt.isValid?i.value[0].dt.toJSDate():!1;C(l),k("reset"),a.value=t(e.timezone)}),ye(()=>e.available,()=>{C("current"),k("reset")}),ye(()=>e.duration,()=>k("reset")),ye(()=>e.theEvent,l=>{if(!l)return;let u=[];try{u=JSON.parse(l.slots)||[]}catch{u=[]}u.forEach(h=>{const y=z.fromFormat(h,"yyyy/MM/dd HH:mm",{zone:l.timezone});if(!y.isValid)return;const p=(y.hour*60+y.minute)*Y/60;k("addSlot",{top:p,range_start:y.toFormat("HH:mm"),range_end:y.plus({minutes:e.duration}).toFormat("HH:mm"),status:"",date:y.toFormat("yyyy/MM/dd")})})});function O(l){return["mon","tue","wed","thu","fri","sat","sun","mon"][l]}function C(l=!1){if(V.value)return;let u;l==="current"?u=i.value.length&&i.value[0].dt.isValid?i.value[0].dt:b():l instanceof Date?u=e.timezone?z.fromJSDate(l).setZone(e.timezone,{keepLocalTime:!0}):z.fromJSDate(l):u=b(),u.isValid||(u=z.now());let h=u.startOf("week");h=h.minus({days:1});const y=[],p=[];for(let A=0;A<=7;A++){const ie=O(A);let ge=[];try{ge=JSON.parse(e.available[ie])||[]}catch{ge=[]}ge.forEach(ue=>{const B=z.fromFormat(h.toFormat("dd/MM/yyyy")+" "+ue.from,"dd/MM/yyyy HH:mm",{zone:e.available.timezone}).setZone(e.timezone),ae=z.fromFormat(h.toFormat("dd/MM/yyyy")+" "+ue.to,"dd/MM/yyyy HH:mm",{zone:e.available.timezone}).setZone(e.timezone);if(!(!B.isValid||!ae.isValid))if(B.toFormat("yyyy/MM/dd")===ae.toFormat("yyyy/MM/dd")){const de=(B.hour*60+B.minute)*Y/60,ce=(ae.hour*60+ae.minute)*Y/60;p.push({top:de,bottom:ce,height:ce-de,fr:B,to:ae,date:B.toFormat("yyyy/MM/dd")})}else{let de=(B.hour*60+B.minute)*Y/60,ce=24*Y;p.push({top:de,bottom:ce,height:ce-de,fr:B,to:ae,date:B.toFormat("yyyy/MM/dd")}),de=0,ce=(ae.hour*60+ae.minute)*Y/60,p.push({top:de,bottom:ce,height:ce-de,fr:B,to:ae,date:ae.toFormat("yyyy/MM/dd")})}}),A>0&&y.push({id:A,ddd:h.toFormat("ccc"),D:h.toFormat("d"),date:h.toFormat("yyyy/MM/dd"),dt:h}),h=h.plus({days:1})}w.value=b().toFormat("yyyy/MM/dd"),i.value=y,g.value=p,ne();const M=y[0].dt,P=y[y.length-1].dt;let W;M.toFormat("MM/yyyy")!==P.toFormat("MM/yyyy")?W=M.toFormat("LLL d")+" - "+P.toFormat("LLL d, yyyy"):W=M.toFormat("LLL d")+" - "+P.toFormat("d, yyyy"),k("loadWeek",{date:y[0].dt.toJSDate(),range:W})}function X(){C()}function j(l=!0){if(i.value.length>0){const u=l?i.value[i.value.length-1].dt.plus({days:2}):i.value[0].dt.minus({days:2});C(u.toJSDate())}else C()}async function ne(){V.value=!0;const l=await se("POST","scheduling/events/getAllEvents",{from:i.value[0].date,to:i.value[i.value.length-1].date,timezone:e.timezone});if(l){const h=[];for(const y of l.data.callendo_events){let p=z.fromFormat(y.booking_date+" "+y.booking_time,"yyyy/MM/dd HH:mm",{zone:y.booking_timezone}).setZone(e.timezone);const M=String(y.event_duration).split("_");let P=p.plus(E(M));if(y.time_before!=null){const W=String(y.time_before).split("_");p=p.minus(E(W))}if(y.time_after!=null){const W=String(y.time_after).split("_");P=P.plus(E(W))}re(h,y,p,P)}U.value=h}const u=await se("POST","scheduling/getDaily?type=timeslot-picker",{startDate:i.value[0].dt.toFormat("yyyy-MM-dd"),endDate:i.value[i.value.length-1].dt.toFormat("yyyy-MM-dd"),timezone_text:e.timezone,timezone_plus:z.now().setZone(e.timezone).toFormat("ZZ")});if(u){const h=[];if(u.data.single){const p=u.data.single.sort((M,P)=>M.times.startTime.localeCompare(P.times.startTime));for(const M of p){const P=z.fromISO(M.times.startTime).setZone(e.timezone),W=z.fromISO(M.times.endTime).setZone(e.timezone);re(h,M,P,W)}}I.value=h;const y=[];if(u.data.allday){const p=u.data.allday.sort((A,ie)=>A.times.startTime.localeCompare(ie.times.startTime));let M=0,P=0;const W=z.fromFormat(i.value[0].date,"yyyy/MM/dd");for(const A of p){const ie=z.fromFormat(A.times.startTime,"yyyy-MM-dd"),ge=z.fromFormat(A.times.endTime,"yyyy-MM-dd"),ue=Math.floor(ie.diff(W,"days").days),B=Math.floor(ge.diff(ie,"days").days);ue<P&&M++,ue+B>P&&(P=ue+B),y.push({...A,left:ue,width:B,level:M})}Q.value=M+1}J.value=y,u.data.calendars&&k("loadExternalCalendar",u.data.calendars)}V.value=!1}function re(l,u,h,y){if(h.toFormat("yyyy/MM/dd")===y.toFormat("yyyy/MM/dd")){const p=(h.hour*60+h.minute)*Y/60,M=(y.hour*60+y.minute)*Y/60;l.push({...u,top:p,bottom:M,height:M-p,fr:h,to:y,date:h.toFormat("yyyy/MM/dd")})}else{let p=(h.hour*60+h.minute)*Y/60,M=24*Y;l.push({...u,top:p,bottom:M,height:M-p,fr:h,to:y,date:h.toFormat("yyyy/MM/dd")}),p=0,M=(y.hour*60+y.minute)*Y/60,l.push({...u,top:p,bottom:M,height:M-p,fr:h,to:y,date:y.toFormat("yyyy/MM/dd")})}}function E(l){const u=Number(l[0]),h=l[1];return h==="h"?{hours:u}:h==="d"?{days:u}:{minutes:u}}function f(l){l.type==="update-color"?I.value.forEach(u=>{u.type==="external_calendar"&&u.connect_id===l.connect_id&&(u.color=l.color)}):l.type==="toggle-display"&&(l.is_selected===0?I.value=I.value.filter(u=>u.type!=="external_calendar"||u.connect_id!==l.connect_id):l.is_selected===1&&C("current"))}
11n({loadToday:X,loadOtherWeek:j,loadWeek:C,updateExternalCalendar:f});const x={props:e,emit:k,HLEN:Y,nowZoned:b,timesInDay:t,timesInDayList:a,weekDays:i,todayDate:w,freeZones:g,callendoEvents:U,calendarEvents:I,calendarAllday:J,alldayLevel:Q,loading:V,viewport:G,nowState:q,onNowUpdate:D,showNowLabel:R,getddd:O,loadWeek:C,loadToday:X,loadOtherWeek:j,loadData:ne,pushEventBlock:re,durationToObj:E,updateExternalCalendar:f,SingleDay:bo,NowLabel:Co};return Object.defineProperty(x,"__isScriptSetup",{enumerable:!1,value:!0}),x}}),Mo={class:"oneoff-calendar"},zo={ref:"viewport",class:"oneoff-viewport"},Eo={class:"calendar-header"},Do={class:"header-cols"},Lo=["onClick"],To={class:"day-labels"},Fo={class:"day-ddd"},Ho={class:"day-num"},No={class:"calendar-body"},Ro={class:"rail"},Uo={class:"rail-hour"},Io={class:"grid-cols"},qo={key:0,class:"oneoff-loading"};function Oo(Z,n,T,e,k,b){return s(),d("div",Mo,[o("div",zo,[m(" Sticky header: clear-times row + day labels + all-day band "),o("div",Eo,[n[2]||(n[2]=o("div",{class:"rail-spacer"},null,-1)),o("div",Do,[m(" Clear-times row "),o("div",{class:"clear-row",style:oe(T.slots.length===0?{marginTop:"-30px"}:void 0)},[(s(!0),d(L,null,N(e.weekDays,t=>(s(),d("div",{key:"cl"+t.id,class:"clear-cell"},[T.slots.filter(a=>a.date===t.date).length>0?(s(),d("span",{key:0,class:"clear-link",onClick:a=>e.emit("clearDaySlots",t.date)},r(Z.$t("text.clear_times")),9,Lo)):m("v-if",!0)]))),128))],4),m(" Day labels "),o("div",To,[(s(!0),d(L,null,N(e.weekDays,t=>(s(),d("div",{key:"dl"+t.id,class:K(["day-label",{active:t.date===e.todayDate}])},[o("span",Fo,r(t.ddd),1),o("h6",Ho,r(t.D),1)],2))),128))]),m(" All-day band "),o("div",{class:"allday-band",style:oe({height:e.alldayLevel*20+1+"px"})},[(s(!0),d(L,null,N(e.weekDays,t=>(s(),d("div",{key:"ad"+t.id,class:"allday-cell"}))),128)),(s(!0),d(L,null,N(e.calendarAllday,(t,a)=>(s(),d("div",{key:"adi"+a,class:"allday-item",style:oe({left:"calc(100% / 7 * "+t.left+")",width:"calc(100% / 7 * "+t.width+")",top:t.level*20+"px"})},[o("div",{class:K(["allday-content",t.type])},r(t.name),3)],4))),128))],4)])]),m(" Grid: time rail + day columns "),o("div",No,[o("div",Ro,[(s(!0),d(L,null,N(e.timesInDayList,(t,a)=>(s(),d("div",{key:"t"+a,class:"rail-item"},[o("span",Uo,r(t),1)]))),128))]),o("div",Io,[(s(!0),d(L,null,N(e.weekDays,t=>(s(),te(e.SingleDay,{key:t.id,"week-day":t,"callendo-events":e.callend
11oEvents,"calendar-events":e.calendarEvents,duration:T.duration,timezone:T.timezone,slots:T.slots,"now-height":e.nowState.height,"now-date":e.nowState.date,onAddSlot:n[0]||(n[0]=a=>e.emit("addSlot",a)),onClearSlot:n[1]||(n[1]=a=>e.emit("clearSlot",a))},null,8,["week-day","callendo-events","calendar-events","duration","timezone","slots","now-height","now-date"]))),128)),e.showNowLabel?(s(),te(e.NowLabel,{key:0,timezone:T.timezone,onNowUpdate:e.onNowUpdate},null,8,["timezone"])):m("v-if",!0)])])],512),e.loading?(s(),d("div",qo,[...n[3]||(n[3]=[o("div",{class:"spinner"},null,-1)])])):m("v-if",!0)])}const Po=be(So,[["render",Oo],["__scopeId","data-v-fb614fb4"],["__file","/home/gitlab-runner/weezly-v3/callendo-frontend-v3/src/components/builder/oneoff/Calendar.vue"]]),Ao=pe({__name:"TimeslotPickerView",props:{asModal:{type:Boolean,required:!1,default:!1},modalEventId:{type:[String,Number,null],required:!1,default:null},isExternal:{type:Boolean,required:!1,default:!1}},emits:["close","new-timeslot"],setup(Z,{expose:n,emit:T}){n();const e=it(),k=dt(),b=ct(),{settings:t,availability:a,pendings:i}=ut(b),w=Ee(),{t:g}=Ve(),{upgradeWall:U}=ft(),I=Z,J=T;function Q(){I.asModal?J("close"):k.push("/")}const V=c(!1),G=c(!1),q=c(!1),D=c([]),R=c(!1),O=c(null),C=c(""),X=c("30"),j=c("m"),ne=c(!1),re=c({}),E=c([]),f=c(!1),x=c(""),l=c(""),u=c(""),h=c(""),y=c([{id:Math.random(),location_type:"",location_value:"",location_custom:""}]),p=c("en"),M=c(!1),P=c(!1),W=c(!1),A=c(null),ie=c(""),ge=_e(()=>j.value==="m"?Number(X.value):Number(X.value)*60),ue=_e(()=>{const _=[],v=[...E.value].sort((H,F)=>H.date.localeCompare(F.date));for(const H of v)if(!_.find(F=>F.date===H.date)){const F=z.fromFormat(H.date,"yyyy/MM/dd");_.push({date:H.date,date_display:F.toFormat("cccc, LLLL d, yyyy"),slots:v.filter(xe=>xe.date===H.date).sort((xe,$)=>xe.top-$.top)})}return _});function B(_){return Re.find(v=>v.key===_)||{key:"",name:"",flag:""}}Ce(async()=>{if((!t.value||t.value.timezone==null)&&await b.fetchSettings(),a.value.length||await b.fetchAvailability(),await b.fetchIntegrations(),C.value=t.value.timezone,a.value.length>0){const v=a.value.find(H=>H.is_default==1);re.value=v||a.value[0]}l.value=g("nav.one_off_meeting");const _=I.modalEventId??e.params.ID;if(_){i.value.length||await b.fetchPendings();const v=i.value.find(H=>H.id==_);if(v){V.value=v,C.value=v.timezone,p.value=v.language;const H=String(v.duration).split("_");X.value=H[0],j.value=H[1],["15_m","30_m","45_m","60_m"].includes(v.duration)||(ne.value=!0),l.value=v.name,h.value=v.description_html,y.value=[{id:Math.random(),location_type:v.location_type,location_value:v.location_value,location_custom:""}],P.value=v.only_business_email}else{w.error(g("alert.something_wrong")),setTimeout(Q,1e3);return}}else p.value=t.value.language||"en";G.value=mt("view-shared-calendars")==="yes",await De()});function ae(_){D.value=_.filter(v=>v.is_selected).map(v=>({email:v.email,is_selected:v.is_selected}))}async function de(){await U("view-shared-calendars")&&(R.value=!0)}function ce(_,v){_==="custom"?ne.value=!0:(X.value=_,j.value="m",ne.value=!1),v()}function Ze(_){A.value&&(_==="today"?A.value.loadToday():_==="previousWeek"?A.value.loadOtherWeek(!1):_==="nextWeek"&&A.value.loadOtherWeek(!0))}function We(_){E.value.push(_)}function Je(_){_==="all"?E.value=[]:E.value=E.value.filter(v=>v.date+v.range_start!==_.date+_.range_start)}function Ge(_){E.value=E.value.filter(v=>v.date!==_)}function Xe(_,v){const H=y.value.find(F=>F.id===_);if(H)for(const F in v)H[F]=v[F]}function Ye(){y.value[0].location_type=""}function Ke(_){x.value=_.range}function Qe(_){!ie.value||!A.value||(A.value.loadWeek(new Date(ie.value)),_())}async function $e(){if(E.value.length===0){w.error(g("alert.pick_one_time_to_continue"));return}u.value="";const _=l.value.trim();if(_===""){u.value=g("alert.cant_be_blank");return}f.value=!0;try{let v=null;if(D.value.length){const $=D.value.filter(me=>me.is_selected).map(me=>me.email);$.length&&(v=$.join(","))}const H={name:_,description:h.value,location_type:y.value[0].location_type,location_value:y.value[0].location_value,duration:X.value+"_"+j.value,timezone:C.value,slots:E.value,language:p.value,include_calendars:v,only_business_email:P.value};let F="scheduling/oneoff/create";V.value&&(F="scheduling/oneoff/update",H.id=V.value.id);const xe=await se("POST",F,H);if(xe){const $=xe.data;V.value?(w.success(g("alert.your_event_has_been_updated")),b.updateEventLocal($.id,$,"oneoff")):(w.success(g("text.your_event_has_been_created")),b.addEventLocal({...$,type:"oneoff"}));const me=String($.duration).split("_");let Fe=me[0]+" ";Fe+=me[1]==="m"?"mins":"hours";const nt=yt()+"/d/"+$.url;let Se=[];try{Se=JSON.parse($.slots)||[]}catch{Se=[]}Se.sort((fe,le)=>String(fe).localeCompare(String(le)));const He=Se.map(fe=>{const le=z.fromFormat(fe,"yyyy/MM/dd HH:mm"),ke=le.plus(me[1]==="h"?{hours:Number(me[0])}:{minutes:Number(me[0])});return{date:le.toFormat("yyyy/MM/dd"),time:le.toFormat("HH:mm")+" - "+ke.toFormat("HH:mm"),slot:le.toFormat("yyyy-MM-dd_HH-mm"),dt:le}}),Me=[];for(const fe of He)if(!Me.find(le=>le.date===fe.date)){const le=z.fromFormat(fe.date,"yyyy/MM/dd");Me.push({date:fe.date,date_display:le.toFormat("cccc, LLLL d, yyyy"),slots:He.filter(ke=>ke.date===fe.date).sort((ke,at)=>ke.dt.toMillis()-at.dt.toMillis())})}W.value={name:$.name,duration:Fe,timezone:$.timezone,url:nt,slots:Me,show:!0},I.isExternal&&J("new-timeslot",W.value)}else w.error(g("alert.something_wrong"))}finally{f.value=!1}}function et(){vt(W.value.url),w.success(g("alert.copied_link"))}function tt(){const _=document.getElementById("email-content");
11if(!_)return;const v=_.cloneNode(!0);v.id="email-clone",v.style.background="#fff",v.style.color="#000",document.body.appendChild(v);try{const H=document.createRange();H.selectNode(v);const F=window.getSelection();F==null||F.removeAllRanges(),F==null||F.addRange(H),document.execCommand("copy"),F==null||F.removeAllRanges(),w.success(g("alert.copied_times_to_email"))}catch{w.error(g("alert.unable_to_copy"))}v.remove()}function ot(){f.value||Q()}const Te={route:e,router:k,scheduling:b,settings:t,availability:a,pendings:i,toast:w,$t:g,upgradeWall:U,props:I,emit:J,goBack:Q,theEvent:V,isAccessCalendars:G,showCalendars:q,includeCalendars:D,openSendRequestCalendar:R,externalCalendarsRef:O,timezone:C,durationNumber:X,durationType:j,durationCustom:ne,available:re,slots:E,loading:f,dateRange:x,name:l,errorName:u,description:h,locations:y,language:p,openOptions:M,onlyBusinessEmail:P,readyData:W,calendar:A,datePicker:ie,durationM:ge,dateSlots:ue,getLanguage:B,updateCalendars:ae,openRequestCalendar:de,selectDuration:ce,loadCalendar:Ze,addSlot:We,clearSlot:Je,clearDaySlots:Ge,updateLocation:Xe,removeLocation:Ye,loadWeek:Ke,onDatePick:Qe,create:$e,copyLink:et,copyToEmail:tt,close:ot,get ChevronLeft(){return Oe},get ChevronRight(){return pt},get ChevronDown(){return Et},get ChevronUp(){return zt},get X(){return xt},get Loader2(){return Le},get ExternalLink(){return _t},get CalendarDays(){return ht},get MailOpen(){return Lt},get PanelLeft(){return Ft},get CalendarPlus(){return Mt},get languages(){return Re},get flagEmoji(){return gt},get UiTextField(){return Be},get UiCheckbox(){return bt},get UiDropdown(){return je},LocationPicker:kt,TimezonePicker:wt,ExternalCalendars:to,SendRequestCalendar:yo,Calendar:Po};return Object.defineProperty(Te,"__isScriptSetup",{enumerable:!1,value:!0}),Te}}),Vo={class:"flex h-full relative"},jo={class:"flex-1 flex flex-col border-r border-gray-200 overflow-hidden relative"},Bo={class:"flex items-center gap-3 px-4 pt-4"},Zo=["title"],Wo={class:"inline-flex items-center rounded-lg border border-gray-300 overflow-hidden shrink-0"},Jo={class:"inline-flex items-center gap-2 border border-gray-300 rounded-lg px-3 py-1.5 text-sm hover:border-gray-400 shrink-0"},Go={class:"p-2"},Xo=["onClick"],Yo={class:"flex-1 mt-4 overflow-hidden"},Ko={class:"w-[400px] shrink-0 flex flex-col bg-white relative"},Qo={class:"flex-1 overflow-hidden flex flex-col"},$o={class:"flex-1 overflow-y-auto px-4 pt-4"},en={class:"mb-5"},tn={class:"mb-5"},on={class:"w-full flex items-center gap-2 border border-gray-300 rounded-lg px-3 py-2 text-sm has-placeholder"},nn={class:"placeholder"},an={key:0,class:"flex-1 text-left"},ln={key:1,class:"flex-1 text-left"},sn=["onClick"],rn=["onClick"],dn={key:0,class:"flex items-center gap-3 mt-3"},cn={class:"flex-1"},un={class:"flex-1"},mn={class:"w-full flex items-center gap-2 border border-gray-300 rounded-lg px-3 py-2 text-sm"},fn={class:"flex-1 text-left"},yn=["onClick"],vn=["onClick"],gn=["placeholder"],hn={key:0,class:"mb-5"},_n={class:"text-sm text-gray-700 flex-1 truncate"},xn={class:"flex-1 text-sm font-semibold text-gray-700 mb-0"},pn={class:"mb-5"},bn={class:"w-full flex items-center gap-2 border border-gray-300 rounded-lg px-3 py-2 text-sm has-placeholder"},kn={class:"placeholder"},wn={class:"flex-1 text-left"},Cn=["onClick"],Sn={class:"flex items-center gap-2 mb-5"},Mn={class:"px-4 py-3"},zn={class:"flex flex-col border-t border-gray-200",style:{"max-height":"50%"}},En={class:"flex items-center px-4 py-3"},Dn={class:"flex-1 text-sm font-semibold text-gray-700 mb-0"},Ln={class:"flex-1 overflow-y-auto px-4 pb-3"},Tn={class:"text-sm text-gray-600 mb-1 capitalize"},Fn={class:"flex flex-wrap gap-1.5"},Hn=["onClick"],Nn={key:1,class:"absolute inset-0 flex items-center justify-center bg-white/60 z-40"},Rn={key:2,class:"absolute inset-0 z-50 bg-white overflow-y-auto"},Un={class:"max-w-2xl mx-auto py-10 px-6"},In={class:"bg-blue-600 rounded-t-2xl p-8 relative text-white"},qn={class:"text-2xl font-bold mb-1"},On={class:"text-blue-100 mb-6"},Pn={class:"flex items-center gap-3 bg-white rounded-xl px-4 py-3"},An={class:"flex-1 truncate text-gray-900 font-medium"},Vn={class:"mt-4"},jn=["href"],Bn={class:"bg-white rounded-b-2xl border border-t-0 border-gray-200 p-8"},Zn={class:"flex items-center gap-4"},Wn={class:"bg-blue-50 rounded-lg p-3 shrink-0"},Jn={class:"flex-1"},Gn={class:"text-sm font-semibold text-gray-900 mb-0"},Xn={class:"text-sm text-gray-500 mb-0"},Yn={class:"mt-6 border border-gray-200 rounded-lg overflow-hidden"},Kn={class:"bg-gray-50 px-5 py-2"},Qn={class:"text-xs font-medium text-gray-400 mb-0 uppercase"},$n={class:"p-5",id:"email-content"},ea={style:{margin:"0"}},ta={style:{margin:"0"}},oa={style:{"font-weight":"bold","margin-top":"15px","margin-bottom":"5px"}},na=["href"];function aa(Z,n,T,e,k,b){return s(),d("div",Vo,[m(" Shared calendars sidebar "),e.isAccessCalendars?(s(),te(e.ExternalCalendars,{key:0,ref:"externalCalendarsRef",onUpdateShow:n[0]||(n[0]=t=>e.showCalendars=t),onUpdateCalendars:e.updateCalendars},null,512)):m("v-if",!0),m(" Left calendar "),o("div",jo,[o("div",Bo,[o("button",{class:"text-sm text-gray-500 hover:text-blue-600",onClick:e.close},"â Events"),e.isAccessCalendars?(s(),d("button",{key:0,class:K(["shrink-0 w-8 h-8 inline-flex items-center justify-center rounded-lg border border-gray-300 hover:bg-gray-50",e.showCalendars?"border-blue-500 text-blue-600":"text-gray-500"]),title:e.showCalendars?"Hide sidebar":"Show sidebar",onClick:n[1]||(n[1]=t=>{var a;return(a=e.externalCalendarsRef)==null?void 0:a.toggle()})},[S(e.PanelLeft,{size:16}
11)],10,Zo)):m("v-if",!0),e.isAccessCalendars?(s(),d("button",{key:1,class:"shrink-0 inline-flex items-center gap-1.5 border border-gray-300 rounded-lg px-3 py-1.5 text-sm hover:border-gray-400",onClick:e.openRequestCalendar},[S(e.CalendarPlus,{size:15,class:"text-gray-500"}),n[19]||(n[19]=ve()),n[20]||(n[20]=o("span",{class:"truncate"},"Request calendar",-1))])):m("v-if",!0),n[21]||(n[21]=o("div",{class:"flex-1 overflow-hidden"},[o("h2",{class:"text-base font-bold text-gray-900 truncate"},"Propose time for a meeting")],-1)),o("div",Wo,[o("button",{class:"px-2 py-1.5 hover:bg-gray-50",title:"Previous week",onClick:n[2]||(n[2]=t=>e.loadCalendar("previousWeek"))},[S(e.ChevronLeft,{size:16})]),o("button",{class:"px-3 py-1.5 text-sm font-medium border-x border-gray-300 hover:bg-gray-50",onClick:n[3]||(n[3]=t=>e.loadCalendar("today"))},r(e.$t("text.today")),1),o("button",{class:"px-2 py-1.5 hover:bg-gray-50",title:"Next week",onClick:n[4]||(n[4]=t=>e.loadCalendar("nextWeek"))},[S(e.ChevronRight,{size:16})])]),S(e.UiDropdown,{position:"bottom-left",width:"240px"},{toggle:ee(()=>[o("button",Jo,[S(e.CalendarDays,{size:16,class:"text-gray-400"}),o("span",null,r(e.dateRange),1),S(e.ChevronDown,{size:14,class:"text-gray-400"})])]),default:ee(({close:t})=>[o("div",Go,[we(o("input",{"onUpdate:modelValue":n[5]||(n[5]=a=>e.datePicker=a),type:"date",class:"w-full border border-gray-200 rounded-md px-2 py-1.5 text-sm"},null,512),[[ze,e.datePicker]]),o("button",{class:"w-full mt-2 bg-blue-600 text-white rounded-md py-1.5 text-sm hover:bg-blue-700",onClick:a=>e.onDatePick(t)}," Go ",8,Xo)])]),_:1}),n[22]||(n[22]=o("a",{href:"https://www.youtube.com/watch?v=DS_aNIuiLp0",target:"_blank",class:"shrink-0 w-8 h-8 inline-flex items-center justify-center rounded-lg border border-gray-300 text-blue-600 hover:bg-gray-50",title:"How to use Timeslot Picker?"}," ? ",-1))]),o("div",Yo,[S(e.Calendar,{ref:"calendar",timezone:e.timezone,available:e.available,duration:e.durationM,slots:e.slots,"the-event":e.theEvent||void 0,onAddSlot:e.addSlot,onClearSlot:e.clearSlot,onClearDaySlots:e.clearDaySlots,onReset:n[6]||(n[6]=t=>e.slots=[]),onLoadWeek:e.loadWeek,onLoadExternalCalendar:n[7]||(n[7]=t=>{var a;return(a=e.externalCalendarsRef)==null?void 0:a.loadExternalCalendar(t)})},null,8,["timezone","available","duration","slots","the-event"])])]),m(" Right panel "),o("div",Ko,[o("div",Qo,[o("div",$o,[m(" TITLE "),o("div",en,[S(e.UiTextField,{modelValue:e.name,"onUpdate:modelValue":[n[8]||(n[8]=t=>e.name=t),n[9]||(n[9]=t=>e.errorName="")],placeholder:e.$t("text.event_name"),error:e.errorName},null,8,["modelValue","placeholder","error"])]),m(" DURATION "),o("div",tn,[S(e.UiDropdown,{class:"block",position:"bottom-left",width:"100%"},{toggle:ee(()=>[o("button",on,[o("span",nn,r(e.$t("text.duration")),1),e.durationCustom?(s(),d("span",an,r(e.$t("text.custom")),1)):(s(),d("span",ln,r(e.durationNumber)+" "+r(e.$t("text.min")),1)),S(e.ChevronDown,{size:16,class:"text-gray-400"})])]),default:ee(({close:t})=>[(s(),d(L,null,N(["15","30","45","60"],a=>o("button",{key:a,class:K(["w-full text-left px-3 py-2 rounded text-sm hover:bg-gray-50",!e.durationCustom&&e.durationNumber===a?"text-blue-600 font-medium":"text-gray-700"]),onClick:i=>e.selectDuration(a,t)},r(a)+" "+r(e.$t("text.min")),11,sn)),64)),o("button",{class:K(["w-full text-left px-3 py-2 rounded text-sm hover:bg-gray-50",e.durationCustom?"text-blue-600 font-medium":"text-gray-700"]),onClick:a=>e.selectDuration("custom",t)},r(e.$t("text.custom")),11,rn)]),_:1}),e.durationCustom?(s(),d("div",dn,[o("div",cn,[S(e.UiTextField,{modelValue:e.durationNumber,"onUpdate:modelValue":n[10]||(n[10]=t=>e.durationNumber=t),placeholder:"0"},null,8,["modelValue"])]),o("div",un,[S(e.UiDropdown,{class:"block",position:"bottom-left",width:"100%"},{toggle:ee(()=>[o("button",mn,[o("span",fn,r(e.durationType==="m"?"min":"hour"),1),S(e.ChevronDown,{size:16,class:"text-gray-400"})])]),default:ee(({close:t})=>[o("button",{class:K(["w-full text-left px-3 py-2 rounded text-sm hover:bg-gray-50",e.durationType==="m"?"text-blue-600 font-medium":"text-gray-700"]),onClick:a=>{e.durationType="m",t()}},r(e.$t("text.min")),11,yn),o("button",{class:K(["w-full text-left px-3 py-2 rounded text-sm hover:bg-gray-50",e.durationType==="h"?"text-blue-600 font-medium":"text-gray-700"]),onClick:a=>{e.durationType="h",t()}},r(e.$t("text.hour")),11,vn)]),_:1})])])):m("v-if",!0)]),m(" LOCATION "),(s(!0),d(L,null,N(e.locations,t=>(s(),te(e.LocationPicker,{key:t.id,class:"mb-5","is-edit":!!e.theEvent,"has-icon":!1,data:t,locations:e.locations,event:e.theEvent,onUpdate:a=>e.updateLocation(t.id,a),onRemove:e.removeLocation},null,8,["is-edit","data","locations","event","onUpdate"]))),128)),m(" DESCRIPTION "),we(o("textarea",{"onUpdate:modelValue":n[11]||(n[11]=t=>e.description=t),rows:"5",class:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm mb-5 focus:outline-none focus:ring-2 focus:ring-blue-500/30",style:{height:"150px"},placeholder:e.$t("text.write_a_summary_invitee_should")},null,8,gn),[[ze,e.description]]),m(" Include in the invitation (selected shared calendars) "),e.includeCalendars.length>0&&e.isAccessCalendars?(s(),d("div",hn,[n[23]||(n[23]=o("h6",{class:"text-sm font-semibold text-gray-700 mb-2"},"Include in the invitation",-1)),(s(!0),d(L,null,N(e.includeCalendars,t=>(s(),d("label",{key:t.email,class:"flex items-center gap-2 my-1.5 cursor-pointer"},[S(e.UiCheckbox,{"model-value":t.is_selected,"onUpdate:modelValue":a=>t.is_selected=!t.is_selected},null,8,["model-value","onUpdate:modelValue"]),o("span",_n,r(t.email),1)]))),128))])):m("v-if",!0),m(" Additional options "),o("div",{class:"flex items-center mb-5 curs
11or-pointer",onClick:n[12]||(n[12]=t=>e.openOptions=!e.openOptions)},[o("h3",xn,r(e.$t("text.additional_options")),1),e.openOptions?(s(),te(e.ChevronUp,{key:1,size:18,class:"text-gray-400"})):(s(),te(e.ChevronDown,{key:0,size:18,class:"text-gray-400"}))]),we(o("div",null,[m(" TIMEZONE "),o("div",pn,[S(e.TimezonePicker,{zone:e.timezone,onSelect:n[13]||(n[13]=t=>e.timezone=t)},null,8,["zone"])]),m(" LANGUAGE "),S(e.UiDropdown,{class:"block mb-5",position:"bottom-left",width:"100%","max-height":"40vh"},{toggle:ee(()=>[o("button",bn,[o("span",kn,r(e.$t("text.language")),1),o("span",null,r(e.flagEmoji(e.getLanguage(e.language).flag)),1),o("span",wn,r(e.getLanguage(e.language).name),1),S(e.ChevronDown,{size:16,class:"text-gray-400"})])]),default:ee(({close:t})=>[(s(!0),d(L,null,N(e.languages,a=>(s(),d("button",{key:a.key,class:K(["w-full flex items-center gap-2 text-left px-3 py-2 rounded text-sm hover:bg-gray-50",a.key===e.language?"text-blue-600 font-medium":"text-gray-700"]),onClick:i=>{e.language=a.key,t()}},[o("span",null,r(e.flagEmoji(a.flag)),1),ve(" "+r(a.name),1)],10,Cn))),128))]),_:1}),m(" ONLY BUSINESS EMAIL "),o("div",Sn,[S(e.UiCheckbox,{"is-checked":e.onlyBusinessEmail,onCheckboxChange:n[14]||(n[14]=t=>e.onlyBusinessEmail=!e.onlyBusinessEmail)},null,8,["is-checked"]),n[24]||(n[24]=o("span",{class:"text-sm text-gray-700"},"Only business emails can book",-1))])],512),[[Pe,e.openOptions]])]),m(" CREATE/EDIT "),o("div",Mn,[o("button",{class:K(["w-full h-12 rounded-xl text-white text-sm font-medium uppercase transition-colors",e.slots.length>0&&e.name.trim()!==""?"bg-blue-600 hover:bg-blue-700":"bg-gray-300 cursor-not-allowed"]),onClick:e.create},r(e.theEvent?e.$t("button.edit"):e.$t("button.create")),3)])]),m(" SELECTED TIMES "),o("div",zn,[o("div",En,[o("h3",Dn,r(e.$t("text.selected_times"))+" ("+r(e.slots.length)+")",1),o("span",{class:"text-sm text-red-500 cursor-pointer hover:underline",onClick:n[15]||(n[15]=t=>e.clearSlot("all"))},r(e.$t("text.clear_all")),1)]),o("div",Ln,[(s(!0),d(L,null,N(e.dateSlots,t=>(s(),d("div",{key:t.date,class:"mb-3"},[o("p",Tn,r(t.date_display),1),o("div",Fn,[(s(!0),d(L,null,N(t.slots,(a,i)=>(s(),d("button",{key:i,class:"inline-flex items-center gap-1 bg-gray-100 hover:bg-red-50 text-gray-700 rounded-md px-2 py-1 text-xs",onClick:w=>e.clearSlot(a)},[o("span",null,r(a.range_start),1),S(e.X,{size:12,class:"text-gray-400"})],8,Hn))),128))])]))),128))])])]),m(" Loading overlay "),e.loading?(s(),d("div",Nn,[S(e.Loader2,{size:32,class:"animate-spin text-blue-600"})])):m("v-if",!0),m(" Ready one-off "),e.readyData?(s(),d("div",Rn,[o("div",Un,[m(" Share header "),o("div",In,[o("button",{class:"absolute top-4 right-4 w-8 h-8 rounded-full bg-white/20 flex items-center justify-center hover:bg-white/30",onClick:e.close},[S(e.X,{size:18})]),o("h2",qn,r(e.$t("text.your_meeting_ready_to_share"))+" ð",1),o("p",On,r(e.$t("text.paste_the_link_message")),1),o("div",Pn,[o("span",An,r(e.readyData.url),1),o("button",{class:"bg-blue-600 text-white rounded-lg px-4 py-2 text-sm font-medium hover:bg-blue-700",onClick:e.copyLink},r(e.$t("button.copy_link")),1)]),o("div",Vn,[o("a",{href:e.readyData.url,target:"_blank",class:"inline-flex items-center gap-2 text-white hover:underline"},[S(e.ExternalLink,{size:16}),ve(" "+r(e.$t("text.view_live_page")),1)],8,jn)])]),m(" Add-times-to-email block "),o("div",Bn,[o("div",Zn,[o("div",Wn,[S(e.MailOpen,{size:28,class:"text-violet-600"})]),o("div",Jn,[o("h3",Gn,r(e.$t("text.add_times_to_email")),1),o("p",Xn,r(e.$t("text.past_times_directly_to_share_email")),1)]),o("span",{class:"text-sm text-blue-600 cursor-pointer hover:underline shrink-0",onClick:n[16]||(n[16]=t=>e.readyData.show=!e.readyData.show)},r(e.readyData.show?e.$t("button.hide"):e.$t("button.show_preview")),1),o("button",{class:"border border-blue-600 text-blue-600 rounded-lg px-4 py-2 text-sm font-medium hover:bg-blue-50 shrink-0",onClick:e.copyToEmail},r(e.$t("button.copy_times")),1)]),o("div",{style:oe(e.readyData.show?"":"height: 0"),class:"overflow-hidden"},[o("div",Yn,[o("div",Kn,[o("h3",Qn,r(e.$t("text.email_preview")),1)]),o("div",$n,[n[25]||(n[25]=o("p",null,null,-1)),n[26]||(n[26]=o("p",{style:{"font-size":"16px","margin-bottom":"0"}},[o("strong",null,"Please select one of the times below to book a meeting.")],-1)),o("p",ea,r(e.readyData.duration),1),o("p",ta,"Timezone: "+r(e.readyData.timezone),1),(s(!0),d(L,null,N(e.readyData.slots,t=>(s(),d("div",{key:t.date},[o("p",oa,r(t.date_display),1),(s(!0),d(L,null,N(t.slots,a=>(s(),d("a",{key:a.slot,href:e.readyData.url+"?slot="+a.slot,style:{border:"1px solid #0090ff",color:"#0090ff","text-decoration":"none","border-radius":"3px","text-align":"center",height:"18px","line-height":"16px",padding:"0 10px","margin-right":"10px"},target:"_blank"},r(a.time),9,na))),128))]))),128))])])],4)])])])):m("v-if",!0),m(" Request calendar access "),e.openSendRequestCalendar?(s(),te(e.SendRequestCalendar,{key:3,onClose:n[17]||(n[17]=t=>e.openSendRequestCalendar=!1),onUpdate:n[18]||(n[18]=t=>{var a;e.openSendRequestCalendar=!1,(a=e.externalCalendarsRef)==null||a.getExternalCalendar(
11)})})):m("v-if",!0)])}const ba=be(Ao,[["render",aa],["__scopeId","data-v-2b1cc51c"],["__file","/home/gitlab-runner/weezly-v3/callendo-frontend-v3/src/views/builder/TimeslotPickerView.vue"]]);export{ba as default};
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.