1import{d as p,u as w,af as C,h as k,y as b,r as m,L as U,bq as j,_ as z,a as r,b as e,g as o,e as n,F as x,p as S,n as L,t as V,E as q,f as R,o as l}from"./index-DKueJ56C.js";import{U as A}from"./UiButton-D4rLGMnN.js";import{U as B}from"./UiCheckbox-DuCOVXTG.js";import{C as N}from"./circle-alert-k0D78Cqj.js";import{C as E}from"./calendar-DSulLOP0.js";const P=p({__name:"RequestCalendarView",setup(_,{expose:t}){t();const g=w(),s=C(),d=m(""),c=m(!1),a=m([]),i=m("");k(async()=>{d.value=g.query.page,d.value==="calendars"&&(i.value=g.query.uuid,await f())});async function f(){c.value=!0;const u=await b("GET","integrations/getUserCalendars?uuid="+i.value);u?(a.value=u.data,c.value=!1):d.value="error"}async function h(){const u=a.value.filter(v=>v.is_selected);if(u.length===0){s.error("Select at least one calendar to share");return}c.value=!0,await b("POST","integrations/submitUserCalendars",{calendars:u,uuid:i.value})?d.value="thank-you":s.error("Could not send the request"),c.value=!1}const y={route:g,toast:s,page:d,loading:c,calendars:a,uuid:i,getCalendars:f,submit:h,get Calendar(){return E},get CheckCircle(){return j},get AlertCircle(){return N},get Loader2(){return U},get UiButton(){return A},get UiCheckbox(){return B}};return Object.defineProperty(y,"__isScriptSetup",{enumerable:!1,value:!0}),y}}),T={class:"min-h-screen bg-gray-50 flex items-center justify-center px-4 py-12"},O={class:"relative bg-white rounded-xl shadow-lg border border-gray-100 w-full max-w-xl overflow-hidden"},Y={key:0,class:"p-10 text-center"},W={class:"flex justify-center mb-6"},D={class:"w-20 h-20 rounded-full bg-green-50 flex items-center justify-center"},F={class:"p-10 text-center"},G={class:"flex justify-center mb-6"},H={class:"w-20 h-20 rounded-full bg-red-50 flex items-center justify-center"},K={class:"flex justify-center mb-4"},M={class:"p-8"},I={key:0,class:"flex flex-col items-center justify-center py-16 gap-4"},J={key:1,class:"text-center"},Q={class:"flex justify-center mb-6"},X={class:"w-16 h-16 rounded-2xl bg-blue-50 flex items-center justify-center"},Z={class:"inline-block text-left w-full max-w-sm mx-auto mb-6 space-y-3"},$=["onClick"],ee={class:"flex-1 text-sm font-medium text-gray-800"},te={class:"mb-6"},se={class:"p-10 text-center"},ae={class:"flex justify-center mb-4"},oe={class:"w-16 h-16 rounded-full bg-gray-100 flex items-center justify-center"};function re(_,t,g,s,d,c){return l(),r("div",T,[e("div",O,[o(" Weezly powered-by corner badge "),t[9]||(t[9]=e("div",{class:"absolute top-0 right-0 px-3 py-1.5 bg-blue-600 rounded-bl-xl"},[e("span",{class:"text-white text-xs font-semibold tracking-wide"},"Weezly")],-1)),o(" THANK-YOU state "),s.page==="thank-you"?(l(),r("div",Y,[e("div",W,[e("div",D,[n(s.CheckCircle,{size:40,class:"text-green-500"})])]),t[0]||(t[0]=e("h2",{class:"text-xl font-bold text-gray-900 mb-3"},"You have shared your calendar! Awesome!!",-1)),t[1]||(t[1]=e("p",{class:"text-gray-500 text-sm"},"You can close this window now.",-1))])):s.page==="error"?(l(),r(x,{key:1},[o(" ERROR state "),e("div",F,[e("div",G,[e("div",H,[n(s.AlertCircle,{size:40,class:"text-red-400"})])]),o(" Logo area: no dark-mode toggle needed on a standalone public page "),e("div",K,[n(s.Calendar,{size:32,class:"text-blue-600"})]),t[2]||(t[2]=e("h2",{class:"text-xl font-bold text-gray-900 mb-2"},"Something went wrong! Please try again",-1))])],2112)):s.page==="calendars"?(l(),r(x,{key:2},[o(" CALENDARS state "),e("div",M,[o(" Loading "),s.loading?(l(),r("div",I,[n(s.Loader2,{size:32,class:"animate-spin text-blue-600"}),t[3]||(t[3]=e("p",{class:"text-sm text-gray-400"},"Loading your calendars...",-1))])):(l(),r("div",J,[o(" Logo / icon "),e("div",Q,[e("div",X,[n(s.Calendar,{size:28,class:"text-blue-600"})])]),t[5]||(t[5]=e("h2",{class:"text-lg font-bold text-gray-900 mb-1"},"Select calendar(s) which you would like to share:",-1)),t[6]||(t[6]=e("p",{class:"text-sm text-gray-500 mb-6"},"Choose one or more calendars below and click share.",-1)),o(" Calendar list "),e("div",Z,[(l(!0),r(x,null,S(s.calendars,a=>(l(),r("button",{key:a.id,type:"button",class:L(["flex items-center gap-3 w-full rounded-xl border px-4 py-3 transition-colors text-left",a.is_selected?"border-blue-500 bg-blue-50":"border-gray-200 hover:border-gray-300 bg-white"]),onClick:i=>a.is_selected=!a.is_selected},[n(s.UiCheckbox,{"model-value":a.is_selected,"onUpdate:modelValue":i=>a.is_selected=i},null,8,["model-value","onUpdate:modelValue"]),e("span",ee,V(a.name),1)],10,$))),128))]),o(" Submit "),e("div",te,[n(s.UiButton,{loading:s.loading,size:"lg",class:"w-full max-w-sm",onClick:s.submit},{default:q(()=>[...t[4]||(t[4]=[R(" Share my calendar(s) ",-1)])]),_:1},8,["loading"])]),o(" Privacy note "),t[7]||(t[7]=e("p",{class:"text-xs text-gray-400 max-w-sm mx-auto leading-relaxed"}," Note: When you share your calendar, rest assured that no details of your events or calendar titles are shared. Your calendar events will appear as 'busy' with no additional information shared. ",-1))]))])],2112)):(l(),r(x,{key:3},[o(" Empty / unknown state (no page param or unrecognized value) "),e("div",se,[e("div",ae,[e("div",oe,[n(s.Calendar,{size:28,class:"text-gray-400"})])]),t[8]||(t[8]=e("h2",{class:"text-xl font-bold text-gray-900 mb-2"},"Something went wrong! Please try again",-1))])],2112))])])}const ge=z(P,[["render",re],["__file","/home/gitlab-runner/weezly-v3/callendo-frontend-v3/src/views/RequestCalendarView.vue"]]);export{ge 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.