1import{f as h,j as e,r as i,aN as L,E as m,L as _,Z as U,aC as G,ay as $,aO as q,aP as F,aQ as k}from"./index-DRJEQO02.js";import{M as v,G as Q}from"./managed-booking-shell-lgVNm3UU.js";import{g as W,a as Y,b as K,c as H}from"./time-BOd6s43u.js";import{C as V}from"./calendar-days-um142LAo.js";import{E as Z}from"./earth-BvqSY6gM.js";import{c as J,a as X}from"./tslib.es6-DAWwip3O.js";import{u as y,c as ee}from"./index-CbznEZU4.js";import{R as te,P as oe,O as ne,W as se,C as ae,T as ie,D as re,a as j,c as N,b as le}from"./index-B8wipMC2.js";import"./toki-booking-logo-DIFSoCgt.js";import"./language-switcher-DHdYznL4.js";import"./adaptive-popup-CpS_EhAX.js";import"./icons-BFsqTbl2.js";import"./proxy-Dl7VwbWt.js";import"./public-workspace-shell-BmZUPagO.js";import"./device-WfI4IJBj.js";import"./index-5QxskH2W.js";import"./index-swrCvfL9.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};t.SENTRY_RELEASE={id:"0a6ab30ec39e0291c7f221dd57ec5162e96e4f3f"}}catch{}})();try{(function(){var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new t.Error().stack;o&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[o]="ebd3128e-ad74-444d-83f3-d64e66c7d1e5",t._sentryDebugIdIdentifier="sentry-dbid-ebd3128e-ad74-444d-83f3-d64e66c7d1e5")})()}catch{}const ce=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],de=h("circle-alert",ce);const ue=[["path",{d:"M12 6v6h4",key:"135r8i"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],me=h("clock-3",ue);const pe=[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]],xe=h("user-round",pe);var D="AlertDialog",[ge]=X(D,[N]),l=N(),A=t=>{const{__scopeAlertDialog:o,...n}=t,s=l(o);return e.jsx(te,{...s,...n,modal:!0})};A.displayName=D;var fe="AlertDialogTrigger",be=i.forwardRef((t,o)=>{const{__scopeAlertDialog:n,...s}=t,a=l(n);return e.jsx(le,{...a,...s,ref:o})});be.displayName=fe;var he="AlertDialogPortal",w=t=>{const{__scopeAlertDialog:o,...n}=t,s=l(o);return e.jsx(oe,{...s,...n})};w.displayName=he;var ve="AlertDialogOverlay",C=i.forwardRef((t,o)=>{const{__scopeAlertDialog:n,...s}=t,a=l(n);return e.jsx(ne,{...a,...s,ref:o})});C.displayName=ve;var p="AlertDialogContent",[ke,_e]=ge(p),ye=ee("AlertDialogContent"),B=i.forwardRef((t,o)=>{const{__scopeAlertDialog:n,children:s,...a}=t,c=l(n),r=i.useRef(null),f=y(o,r),d=i.useRef(null);return e.jsx(se,{contentName:p,titleName:R,docsSlug:"alert-dialog",children:e.jsx(ke,{scope:n,cancelRef:d,children:e.jsxs(ae,{role:"alertdialog",...c,...a,ref:f,onOpenAutoFocus:J(a.onOpenAutoFocus,u=>{u.preventDefault(),d.current?.focus({preventScroll:!0})}),onPointerDownOutside:u=>u.preventDefault(),onInteractOutside:u=>u.preventDefault(),children:[e.jsx(ye,{children:s}),e.jsx(Ne,{contentRef:r})]})})})});B.displayName=p;var R="AlertDialogTitle",E=i.forwardRef((t,o)=>{const{__scopeAlertDialog:n,...s}=t,a=l(n);return e.jsx(ie,{...a,...s,ref:o})});E.displayName=R;var P="AlertDialogDescription",S=i.forwardRef((t,o)=>{const{__scopeAlertDialog:n,...s}=t,a=l(n);return e.jsx(re,{...a,...s,ref:o})});S.displayName=P;var je="AlertDialogAction",M=i.forwardRef((t,o)=>{const{__scopeAlertDialog:n,...s}=t,a=l(n);return e.jsx(j,{...a,...s,ref:o})});M.displayName=je;var T="AlertDialogCancel",O=i.forwardRef((t,o)=>{const{__scopeAlertDialog:n,...s}=t,{cancelRef:a}=_e(T,n),c=l(n),r=y(o,a);return e.jsx(j,{...c,...s,ref:r})});O.displayName=T;var Ne=({contentRef:t})=>{const o=`\`${p}\` requires a description for the component to be accessible for screen reader users. 2 3You can add a description to the \`${p}\` by passing a \`${P}\` component as a child, which also benefits sighted users by adding visible context to the dialog. 4 5Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${p}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component. 6 7For more information, see https://radix-ui.com/primitives/docs/components/
7alert-dialog`;return i.useEffect(()=>{document.getElementById(t.current?.getAttribute("aria-describedby"))||console.warn(o)},[o,t]),null},De=A,Ae=w,we=C,Ce=B,Be=M,Re=O,Ee=E,Pe=S;function I(t){return["cancelled","canceled"].includes(t.toLowerCase())}function Se(t,o){return Math.max(0,Math.round((Date.parse(o)-Date.parse(t))/6e4))}function Me(t){if(!t)return null;try{const o=new URL(t);return o.protocol!=="https:"||o.hostname.toLowerCase()!=="meet.google.com"||o.port&&o.port!=="443"||o.username||o.password?null:o.toString()}catch{return null}}function Te({bookingId:t,initialDetail:o}){const n=L({bookingUid:t},{query:{initialData:o,meta:{persist:!1},staleTime:3e4}});return n.isLoading?e.jsx(Oe,{}):n.error||!n.data?e.jsx(Ie,{onRetry:()=>void n.refetch()}):e.jsx(ze,{detail:n.data})}function Oe(){const t=m("Book");return e.jsx(v,{children:e.jsx("div",{className:"flex flex-1 items-center justify-center p-8",role:"status",children:e.jsxs("div",{className:"flex items-center gap-3 text-sm font-medium text-[var(--pb-ink-2)]",children:[e.jsx(_,{className:"size-5 animate-spin","aria-hidden":"true"}),t("booked_loading")]})})})}function Ie({onRetry:t}){const o=m("Book");return e.jsx(v,{children:e.jsx("div",{className:"flex flex-1 items-center justify-center p-6 sm:p-10",children:e.jsxs("div",{className:"max-w-md text-center",children:[e.jsx("span",{className:"mx-auto flex size-11 items-center justify-center rounded-full bg-red-50 text-red-700",children:e.jsx(de,{className:"size-5","aria-hidden":"true"})}),e.jsx("p",{className:"mt-5 text-sm font-semibold text-red-700",children:o("booked_error_status")}),e.jsx("h1",{className:"mt-2 text-2xl font-semibold tracking-normal text-[var(--pb-ink)]",children:o("booked_error_title")}),e.jsx("p",{className:"mt-3 text-sm leading-6 text-[var(--pb-ink-2)]",children:o("booked_error_description")}),e.jsx("button",{className:"mt-6 inline-flex h-10 items-center justify-center rounded-full bg-[var(--pb-ink)] px-5 text-sm font-semibold text-white transition hover:bg-[var(--pb-ink)] focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--pb-ink)] focus-visible:ring-offset-2",type:"button",onClick:t,children:o("booked_retry")})]})})})}function ze({detail:t}){const o=U(),n=I(t.status),s=Date.parse(t.end_at_utc)<=Date.now(),a=Me(t.conference_uri);return e.jsx(v,{children:e.jsxs("section",{className:"grid min-h-0 w-full flex-1 bg-white min-[900px]:grid-cols-[minmax(19rem,0.78fr)_minmax(0,1.45fr)]",style:{"--booking-accent":t.event_color??"#006bff"},children:[e.jsx(Le,{detail:t,locale:o}),e.jsx("div",{className:"flex min-h-0 flex-col overflow-y-auto border-t border-[var(--pb-line)] min-[900px]:border-t-0",children:e.jsx("div",{className:"flex-1 p-6 sm:p-8 min-[900px]:p-10",children:n||s?e.jsx(Ue,{cancelled:n}):e.jsx(Ge,{detail:t,googleMeetUrl:a})})})]})})}function Le({detail:t,locale:o}){const n=m("Book"),s=Se(t.start_at_utc,t.end_at_utc),a=W(t.start_at_utc,t.invitee_timezone),c=I(t.status),r=Date.parse(t.end_at_utc)<=Date.now();return e.jsxs("aside",{className:"flex flex-col border-b border-[var(--pb-line)] bg-white p-6 sm:p-8 min-[900px]:border-b-0 min-[900px]:border-r min-[900px]:p-10",children:[e.jsx($e,{cancelled:c,past:r}),e.jsx("h1",{className:"mt-5 break-words text-2xl font-semibold tracking-tight text-[var(--pb-ink)] sm:text-3xl",children:t.title}),e.jsxs("div",{className:"mt-8 space-y-5",children:[e.jsx(g,{icon:e.jsx(me,{className:"size-5","aria-hidden":"true"}),label:n("booked_time"),children:Y(t.start_at_utc,s,t.invitee_timezone,o)}),e.jsx(g,{icon:e.jsx(V,{className:"size-5","aria-hidden":"true"}),label:n("booked_date"),children:K(a,o)}),e.jsx(g,{icon:e.jsx(Z,{className:"size-5","aria-hidden":"true"}),label:n("booked_timezone"),children:H(t.invitee_timezone)}),e.jsxs(g,{icon:e.jsx(xe,{className:"size-5","aria-hidden":"true"}),label:n("booked_invitee"),children:[e.jsx("span",{className:"block font-medium text-[var(--pb-ink)]",children:t.invitee_name}),e.jsxs("span",{className:"mt-0.5 block break-all text-sm text-[var(--pb-ink-3)]",children:[e.jsxs("span",{className:"sr-only",children:[n("booked_email"),": "]}),t.invitee_email]})]})]})]})}function g({icon:t,label:o,children:n}){return e.jsxs("div",{className:"flex gap-3 text-base leading-6 text-[var(--pb-ink-2)]",children:[e.jsx("span",{className:"mt-0.5 shrink-0 text-[var(--pb-ink-2)]",children:t}),e.jsxs("div",{className:"min-w-0",children:[e.jsxs("span",{className:"sr-only",children:[o,": "]}),n]})]})}function Ue({cancelled:t}){const o=m("Book");return e.jsxs("div",{className:"max-w-xl",children:[e.jsx("h2",{className:"text-2xl font-semibold tracking-tight text-[var(--pb-ink)]",children:o("booked_manage_title")}),t?e.jsx("p",{className:"mt-3 text-sm leading-6 text-[var(--pb-ink-2)]",children:o("booked_cancelled_description")}):null,e.jsx("p",{className:"mt-3 text-sm leading-6 text-[var(--pb-ink-2)]",children:o("booked_actions_unavailable")})]})}
7function Ge({detail:t,googleMeetUrl:o}){const n=m("Book"),{language:s}=G();return e.jsxs("div",{className:"max-w-xl",children:[e.jsx("h2",{className:"text-2xl font-semibold tracking-tight text-[var(--pb-ink)]",children:n("booked_manage_title")}),e.jsx("p",{className:"mt-3 text-sm leading-6 text-[var(--pb-ink-2)]",children:n("booked_confirmed_description")}),o?e.jsxs("a",{className:"mt-7 inline-flex h-11 items-center justify-center gap-2 rounded-full bg-white px-5 text-sm font-semibold text-[var(--pb-ink)] ring-1 ring-inset ring-[var(--pb-line-strong)] transition hover:bg-[var(--pb-surface-2)] focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--pb-ink)] focus-visible:ring-offset-2",href:`/booked/${encodeURIComponent(t.booking_uid)}/google_meet?locale=${encodeURIComponent(s.locale)}`,children:[e.jsx(Q,{className:"size-5","aria-hidden":"true"}),n("booked_join_google_meet")]}):null,e.jsxs("section",{className:"mt-9 border-t border-[var(--pb-line)] pt-8",children:[e.jsx("h3",{className:"text-xl font-semibold text-[var(--pb-ink)]",children:n("booked_cancel_title")}),e.jsx(qe,{detail:t})]})]})}function $e({cancelled:t,past:o}){const n=m("Book"),s=n(t?"booked_status_cancelled":o?"booked_status_past":"booked_status_confirmed");return e.jsx("span",{className:`inline-flex self-start rounded-full px-2.5 py-1 text-xs font-semibold ${t?"bg-red-50 text-red-700":o?"bg-[var(--pb-surface-3)] text-[var(--pb-ink-2)]":"bg-emerald-50 text-emerald-700"}`,children:s})}function qe({detail:t}){const o=$(),n=m("Book"),[s,a]=i.useState(!1),[c,r]=i.useState(null),f=q({bookingUid:t.booking_uid}),d=F();function u(x){o.setQueryData(f,b=>b&&{...b,...x})}async function z(){r(null);try{const x=await d.mutateAsync({pathParams:{bookingUid:t.booking_uid}});a(!1),u({status:x.status})}catch{r(n("booked_cancel_error"))}}return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"mt-4",children:e.jsx("button",{className:"inline-flex h-11 items-center justify-center rounded-full bg-[var(--booking-accent)] px-5 text-sm font-semibold text-white transition hover:opacity-90 focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--booking-accent)] focus-visible:ring-offset-2",type:"button",onClick:()=>{r(null),a(!0)},children:n("booked_cancel")})}),e.jsx(De,{open:s,onOpenChange:a,children:e.jsxs(Ae,{children:[e.jsx(we,{className:"fixed inset-0 z-50 bg-slate-950/45"}),e.jsxs(Ce,{className:"fixed left-1/2 top-1/2 z-50 w-[calc(100%-2rem)] max-w-md -translate-x-1/2 -translate-y-1/2 rounded-xl border border-slate-200 bg-white p-6 shadow-xl focus:outline-none",children:[e.jsx(Ee,{className:"text-lg font-semibold text-slate-950",children:n("booked_cancel_title")}),e.jsx(Pe,{className:"mt-2 text-sm leading-6 text-slate-700",children:n("booked_cancel_description")}),c?e.jsx("p",{className:"mt-3 text-sm font-medium text-red-700",role:"alert",children:c}):null,e.jsxs("div",{className:"mt-6 flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",children:[e.jsx(Re,{asChild:!0,children:e.jsx("button",{className:"inline-flex h-10 items-center justify-center rounded-full border border-slate-200 px-4 text-sm font-semibold text-slate-700 transition hover:bg-slate-50 disabled:opacity-50",disabled:d.isPending,type:"button",children:n("booked_keep_booking")})}),e.jsx(Be,{asChild:!0,children:e.jsxs("button",{className:"inline-flex h-10 items-center justify-center gap-2 rounded-full bg-red-600 px-4 text-sm font-semibold text-white transition hover:bg-red-700 disabled:opacity-50",disabled:d.isPending,type:"button",onClick:x=>{x.preventDefault(),z()},children:[d.isPending?e.jsx(_,{className:"size-4 animate-spin","aria-hidden":"true"}):null,d.isPending?n("booked_cancelling"):n("booked_cancel_confirm")]})})]})]})]})})]})}function rt(){const{bookId:t}=k.useParams(),o=k.useLoaderData()??void 0;return e.jsx(Te,{bookingId:t,initialDetail:o})}export{rt as component};
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.