PageSourceSearch

https://cowork.livery135.com/assets/ApproveByHostPage-ev0iEh38.js

js livery135.com collected 2026-10-04 03:10:07 UTC 5,951 bytes, 1 lines download raw bytes

1import{j as e}from"./vendor-puck-lPnaRYA0.js";import{d as C,u as H,r as T,L as G}from"./vendor-react-TOOSQ9Q-.js";import{u as L,b as D,bf as U,J as B,L as d,P as f,az as M,A as c,g as z,q as m,a1 as u,l as g,m as F,bp as I}from"./index-wdjyQqoD.js";import{u as _}from"./vendor-i18n-eTj0Pfmx.js";import{a as h,R as $,C as J}from"./vendor-bootstrap-fxQA9rHL.js";import"./vendor-luxon-2n2xc3QM.js";import"./vendor-calendar-WlMSM93F.js";import"./vendor-motion-BX6prKAE.js";var n=(s=>(s.NotRequired="NotRequired",s.Requested="Requested",s.Rejected="Rejected",s.AcceptedAndHold="AcceptedAndHold",s.AcceptedAndGrant="AcceptedAndGrant",s))(n||{});const K={NotRequired:"Approval not required",Requested:"Pending approval",Rejected:"Rejected",AcceptedAndHold:"Accepted & Hold",AcceptedAndGrant:"Accepted & Grant Access"},W={NotRequired:"info",Requested:"warning",Rejected:"danger",AcceptedAndHold:"primary",AcceptedAndGrant:"success"},ae=()=>{const{t:s}=_(),{httpClient:x,business:y}=L(),[v]=C(),b=H(),{getRoutePath:N}=D(),{showNotification:i}=U(),o=v.get("cid"),l=v.get("vid"),[r,j]=T.useState(null),R=o&&l?g.visitors.details(o,l):null,w=F()(["Visitor.Id","Visitor.IdString","Visitor.FullName","Visitor.Email","Visitor.PhoneNumber","Visitor.DefaultAvatarUrl","Visitor.UtcExpectedArrival","Visitor.Notes","Visitor.HostApprovalStatus"]),{resource:E,isLoading:S,hasError:P}=B(x,R?.url??null,{shape:w.fields,method:"get"}),t=E?.Visitor??null,V=a=>{try{return I(new Date(a),"EEE, MMM d, yyyy 'at' h:mm a")}catch{return a}},p=async a=>{if(r){i({title:s("Please wait"),message:s("An action is already being processed. Please wait for it to complete."),type:"info",delay:3e3});return}if(!o||!l){i({title:s("Error"),message:s("Missing required parameters. Please refresh the page or contact support."),type:"error",delay:5e3});return}j(a);try{await x.put(g.visitors.approve(o,l,a).url),a==="AcceptedAndHold"?i({title:s("Visitor approved"),message:s("The visitor has been approved and will hold access."),type:"success",delay:3e3}):a==="AcceptedAndGrant"?i({title:s("Visitor approved"),message:s("The visitor has been approved and granted access."),type:"success",delay:3e3}):a==="Rejected"&&i({title:s("Visitor rejected"),message:s("The visitor has been rejected."),type:"info",delay:3e3}),b(`/${y?.WebAddress}/user/activity/visitors`)}catch{i({title:s("Error"),message:s("Sorry, we could not process this request. Please try again or contact support."),type:"error",delay:5e3})}finally{j(null)}};if(S)return e.jsx(h,{className:"py-5 text-center",children:e.jsx(d,{show:!0})});if(P||!t)return e.jsxs(e.Fragment,{children:[e.jsx(f,{title:s("Visitor approval")}),e.jsx(h,{className:"py-5",children:e.jsx(M,{variant:"warning",children:s("Unable to load visitor details. Please try again later.")})})]});const A=t.HostApprovalStatus===n.Requested,k=t.HostApprovalStatus===n.AcceptedAndHold||t.HostApprovalStatus===n.AcceptedAndGrant,q=t.HostApprovalStatus===n.Rejected;return e.jsxs(e.Fragment,{children:[e.jsx(f,{title:s("Visitor approval")}),e.jsx(h,{className:"long-content-container mt-3",children:e.jsx($,{className:"justify-content-center",children:e.jsxs(J,{xl:12,children:[e.jsx("div",{className:"mb-3",children:e.jsxs(c,{as:G,to:N(z.profile_visitors,void 0,{status:"requested"}),variant:"link",classNames:"text-body fw-light p-0",children:[e.jsx(m,{name:"arrow-left",size:20,className:"me-0 me-md-1"}),e.jsx("span",{className:"d-none d-md-inline",children:s("Back")})]})}),e.jsxs("div",{className:"mb-4",children:[e.jsx("h1",{className:"h3 fw-semibold mb-2",children:s("Visitor approval")}),e.jsx("p",{className:"text-muted mb-0",children:s("Review the visitor details below and take action.")})]}),e.jsx("div",{className:"rounded-4 p-3",style:{backgroundColor:"var(--bs-light)"},children:e.jsx("div",{className:"rounded-3 p-3",style:{backgroundColor:"#ffffff"},children:e.jsxs("div",{className:"d-flex flex-column gap-3",children:[e.jsxs("div",{className:"d-flex align-items-start justify-content-between",children:[e.jsxs("div",{children:[e.jsx("h6",{className:"mb-1 fw-semibold fs-lg",children:t.FullName}),e.jsxs("div",{className:"d-flex flex-column gap-2 text-body-secondary",children:[t.Email&&e.jsxs("a",{href:`mailto:${t.Email}`,className:"text-body-secondary d-flex align-items-center gap-2",style:{textDecoration:"underline"},children:[e.jsx(m,{name:"email",size:16}),t.Email]}),t.PhoneNumber&&e.jsxs("a",{href:`tel:${t.PhoneNumber}`,className:"text-body-secondary d-flex align-items-center gap-2",style:{textDecoration:"underline"},children:[e.jsx(m,{name:"phone",size:16}),t.PhoneNumber]})]})]}),e.jsxs("div",{className:"flex-shrink-0",children:[k&&e.jsx(u,{badgeColor:"success",label:s("Approved")}),q&&e.jsx(u,{badgeColor:"danger",label:s("Rejected")}),A&&e.jsx(u,{badgeColor:W[t.HostApprovalStatus]||"info",label:s(K[t.HostApprovalStatus]||"Unknown")})]})]}),e.jsxs("div",{className:"row g-3",children:[e.jsxs("div",{className:"col-12 col-sm-6",children:[e.jsx("div",{className:"fw-semibold mb-1",children:s("Visit reason")}),e.jsx("div",{className:"text-body-secondary",children:t.Notes||"-"})]}),e.jsxs("div",{className:"col-12 col-sm-6",children:[e.jsx("div",{className:"fw-semibold mb-1",children:s("Arrived")}),e.jsx("div",{className:"text-body-secondary",children:t.UtcExpectedArrival?V(t.UtcExpectedArrival):"-"})]})]}),A&&e.jsxs("div",{className:"d-flex flex-column gap-2",children:[e.jsx(c,{variant:"primary",classNames:"w-100",disabled:r!==null,onClick:()=>p("AcceptedAndHold"),children:r==="AcceptedAndHold"?e.jsx(d,{show:!0}):s("Approve and hold")}),e.jsx(c,{variant:"outline-primary",classNames:"w-100",disabled:r!==null,onClick:()=>p("AcceptedAndGrant"),children:r==="AcceptedAndGrant"?e.jsx(d,{show:!0}):s("Approve and grant access")}),e.jsx(c,{variant:"outline-danger",classNames:"w-100",disabled:r!==null,onClick:()=>p("Rejected"),children:r==="Rejected"?e.jsx(d,{show:!0}):s("Reject")})]})]})})})]})})})]})};export{ae 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.