PageSourceSearch

https://slive.ai/_next/static/chunks/5866.791729af85874dbd.js

js slive.ai collected 2026-10-05 12:40:28 UTC 21,456 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5866],{1277:(e,t,s)=>{s.d(t,{n:()=>m});var a=s(95155),r=s(12115),l=s(33851),n=s(57420),i=s(86190),d=s(68189),o=s(46403),c=s(1732),u=s(42067);function m({selected:e,onSelect:t,label:s,disabled:x=!1,dateTime:g=!1,allowPastDates:f=!1}){let[h,b]=r.useState(e);return r.useEffect(()=>{h&&t(h)},[h]),(0,a.jsxs)(c.AM,{children:[(0,a.jsx)(c.Wv,{asChild:!0,children:(0,a.jsxs)(d.Button,{variant:"outline",className:(0,i.cn)("w-full justify-start text-left font-normal rounded-md",!h&&"text-muted-foreground"),disabled:x,children:[(0,a.jsx)(n.A,{className:"mr-2 h-4 w-4"}),h?g?(0,l.GP)(h,"Pp"):(0,l.GP)(h,"P"):(0,a.jsx)("span",{children:s})]})}),(0,a.jsxs)(c.hl,{className:"w-auto p-0",children:[(0,a.jsx)(o.V,{mode:"single",selected:h,onSelect:b,captionLayout:"dropdown",fromYear:1900,toYear:new Date().getFullYear()+5,disabled:f?void 0:e=>{let t=new Date;return t.setHours(0,0,0,0),e<t},initialFocus:!0}),g&&(0,a.jsx)("div",{className:"w-full grid grid-cols-2 gap-4 p-5",children:(0,a.jsxs)("div",{className:"grid gap-2",children:[(0,a.jsx)("p",{children:"Start time"}),(0,a.jsx)(u.Input,{type:"time",className:"w-full",value:(0,l.GP)(h,"HH:mm"),onChange:e=>b(t=>new Date(`${(0,l.GP)(h,"yyyy-MM-dd")}T${e.target.value}`))})]})})]})]})}},18101:(e,t,s)=>{s.d(t,{DW:()=>n,Ri:()=>i,Wy:()=>l,n9:()=>u,pi:()=>c,u:()=>o,w4:()=>d,zS:()=>r});var a=s(56533);let r={PLANNED:"bg-muted text-muted-foreground",IN_PROGRESS:"bg-info-tint text-info",COMPLETED:"bg-success-tint text-success",MISSED:"bg-destructive-tint text-destructive"},l={PLANNED:"gray",IN_PROGRESS:"blue",COMPLETED:"emerald",MISSED:"red"},n=["FS-001","FS-002","FS-003","FS-004","FS-005","FS-006","FS-007","FS-008","FS-009","FS-010"],i={SUPERMERCADOS:"TSK-RETAIL-AUDIT",BODEGONES:"TSK-TRADITIONAL-TRADE",FARMACIAS:"TSK-TRADITIONAL-TRADE",LICORERIAS:"TSK-TRADITIONAL-TRADE"},d=[{value:1,key:"mon"},{value:2,key:"tue"},{value:3,key:"wed"},{value:4,key:"thu"},{value:5,key:"fri"},{value:6,key:"sat"},{value:0,key:"sun"}];function o(e){if(!e)return null;try{let t="string"==typeof e?(0,a.H)(e):new Date(e);return Number.isNaN(t.getTime())?null:t}catch{return null}}function c(e){if("COMPLETED"===e.Status||"MISSED"===e.Status||"IN_PROGRESS"===e.Status)return!1;let t=o(e.CheckInAt);if(!t)return"PLANNED"===e.Status;let s=new Date;return s.setHours(0,0,0,0),t>=s||"PLANNED"===e.Status}function u(e,t){if(!e||"ONE_TIME"===e.type)return t("visits.calendar.oneTime");let s=Object.fromEntries(d.map(e=>[e.value,e.key])),a=e=>t(`visits.calendar.weekdays.${s[e]}`),r=e=>(e||[]).slice().sort((e,t)=>e-t).map(a).join(", "),l=Number.isFinite(Number(e.intervalWeeks))?Number(e.intervalWeeks):1,n=l<=1?t("visits.calendar.recurring"):t("visits.calendar.everyNWeeks",{n:l});if(Array.isArray(e.pattern)&&e.pattern.length>1){let s=e.pattern.map((e,s)=>{let a=r(e);return a?`${t("visits.calendar.weekN",{n:s+1})}: ${a}`:null}).filter(Boolean);return`${n} \xb7 ${s.join(" \xb7 ")}`}let i=e.weekdays||e.pattern?.[0]||[];return`${n}: ${r(i)}`}},23501:(e,t,s)=>{s.d(t,{d:()=>i});var a=s(95155),r=s(12115),l=s(88839),n=s(86190);let i=r.forwardRef(({className:e,...t},s)=>(0,a.jsx)(l.bL,{className:(0,n.cn)("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,ref:s,children:(0,a.jsx)(l.zi,{className:(0,n.cn)("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));i.displayName=l.bL.displayName},28506:(e,t,s)=>{s.d(t,{ED:()=>r,OK:()=>d,Re:()=>x,SQ:()=>l,TL:()=>o,Vv:()=>n,Xg:()=>m,_G:()=>i,_N:()=>a,jy:()=>c,tk:()=>u});let a={emerald:"bg-success-tint text-success",blue:"bg-info-tint text-info",amber:"bg-warning-tint text-warning",red:"bg-destructive-tint text-destructive",slate:"bg-muted text-muted-foreground",violet:"bg-violet-100 text-violet-700",orange:"bg-warning-tint text-warning",gray:"bg-muted text-muted-foreground",purple:"bg-purple-100 text-purple-700"},r={OK:"emerald",ATTENTION:"amber",AT_RISK:"red",INACTIVE:"gray"},l={MERCHANDISER:"blue",SALES:"orange",SUPERVISOR:"purple",PROMOTER:"violet"},n={CARRY_IT:"violet",MATCH_PRICE:"amber",MONITOR:"slate"},i={1:"text-warning",2:"text-muted-foreground",3:"text-warning"},d={visits:"#696AC3",sales:"#FFB620"},o={OOS:"#ef4444",PLANOGRAM_MISS:"#8b5cf6",PRICE_OOR:"#f59e0b",LOW_SHARE:"#64748b"},c=["#ef4444","#8b5cf6","#f59e0b","#64748b","#0ea5e9"],u={OK:"#22c55e",ATTENTION:"#eab308",AT_RISK:"#ef4444",INACTIVE:"#9ca3af"},m={OK:"bg-success",ATTENTION:"bg-warning",AT_RISK:"bg-destructive",INACTIVE:"bg-gray-400"},x={SHELF:"bg-success-tint text-success",POP:"bg-warning-tint text-warning",COMPETITOR:"bg-destructive-tint text-destructive",OOS:"bg-destructive-tint text-destructive",
1STOCKOUT:"bg-destructive-tint text-destructive",PLANOGRAM:"bg-info-tint text-info",STORE_FRONT:"bg-indigo-100 text-indigo-700",GENERAL:"bg-muted text-muted-foreground"}},54199:(e,t,s)=>{s.d(t,{A:()=>F});var a=s(95155),r=s(12115),l=s(50910),n=s(33851),i=s(33210),d=s(68459),o=s(68189),c=s(42067),u=s(57657),m=s(70733),x=s(18101),g=s(57350);let f="__none__";function h({status:e,t}){return e?(0,a.jsx)(g.A,{tone:x.Wy[e]||"gray",children:t(`status.${e}`)}):null}function b({visit:e,taskForms:t,agents:s=[],onClose:g,onSave:p,onDelete:v}){let N=(0,l.c)("applications.scout"),[j,y]=(0,r.useState)(!1),[S,w]=(0,r.useState)(!1),C=async()=>{if(!j)try{y(!0),w(!1),await v(e)}finally{y(!1)}},k=(0,r.useMemo)(()=>{if(e.CheckInAt){let t=(0,x.u)(e.CheckInAt);if(t)return(0,n.GP)(t,"yyyy-MM-dd")}let t=e.PlannedWindowStart||e.WeekStart;return t?String(t).slice(0,10):""},[e.CheckInAt,e.PlannedWindowStart,e.WeekStart]),A=(0,r.useMemo)(()=>(0,n.GP)(new Date,"yyyy-MM-dd"),[]),[E,R]=(0,r.useState)(e.AgentCode||""),[O,T]=(0,r.useState)(e.TaskCode||""),[I,D]=(0,r.useState)(k),[P,M]=(0,r.useState)(e.Notes||""),L=(E||"")!==(e.AgentCode||""),_=(O||"")!==(e.TaskCode||""),F=(I||"")!==k,V=(P||"")!==(e.Notes||""),G=!!E||!!O;return(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(h,{status:e.Status,t:N}),(0,a.jsx)("h3",{className:"mt-1 text-lg font-semibold",children:e.StoreName||e.StoreCode}),(0,a.jsx)("div",{className:"text-xs text-muted-foreground",children:e.StoreCode})]}),(0,a.jsx)(o.Button,{type:"button",variant:"ghost",onClick:g,"aria-label":N("visits.calendar.closePanel"),className:"h-auto rounded-full p-1 text-muted-foreground hover:bg-muted",children:(0,a.jsx)(i.A,{className:"h-5 w-5"})})]}),(0,a.jsxs)("div",{className:"rounded-lg border bg-card p-3",children:[(0,a.jsx)("div",{className:"text-xs uppercase tracking-wide text-muted-foreground",children:N("visits.calendar.scheduledFor")}),(0,a.jsx)("div",{className:"text-sm font-medium",children:k?(0,n.GP)((0,x.u)(`${k}T12:00:00`),"EEEE, dd MMM yyyy"):"—"}),(0,a.jsx)("div",{className:"mt-2 text-xs uppercase tracking-wide text-muted-foreground",children:N("visits.calendar.recurrence")}),(0,a.jsx)("div",{className:"text-sm font-medium",children:(0,x.n9)(e.Recurrence,N)})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"mb-1 block text-xs font-semibold text-muted-foreground",children:N("visits.calendar.assignAgent")}),(0,a.jsxs)(m.l6,{value:E||f,onValueChange:e=>R(e===f?"":e),children:[(0,a.jsx)(m.bq,{className:"w-full",children:(0,a.jsx)(m.yv,{placeholder:N("visits.calendar.unassignedAgent")})}),(0,a.jsxs)(m.gC,{children:[(0,a.jsx)(m.eb,{value:f,children:N("visits.calendar.unassignedAgent")}),s&&s.length>0?s.map(e=>(0,a.jsxs)(m.eb,{value:e.Code,children:[e.Name," (",e.Code,")",e.RoleCode?` \xb7 ${e.RoleCode}`:""]},e.Code)):x.DW.map(e=>(0,a.jsx)(m.eb,{value:e,children:e},e))]})]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"mb-1 block text-xs font-semibold text-muted-foreground",children:N("visits.calendar.changeDay")}),(0,a.jsx)(c.Input,{type:"date",value:I,min:A,onChange:e=>D(e.target.value),className:"w-full rounded-lg border border-border bg-card px-3 py-2 text-sm focus:border-primary focus:outline-none"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"mb-1 block text-xs font-semibold text-muted-foreground",children:N("visits.calendar.checklist")}),(0,a.jsxs)(m.l6,{value:O||f,onValueChange:e=>T(e===f?"":e),children:[(0,a.jsx)(m.bq,{className:"w-full",children:(0,a.jsx)(m.yv,{placeholder:N("visits.calendar.selectChecklist")})}),(0,a.jsxs)(m.gC,{children:[(0,a.jsx)(m.eb,{value:f,children:N("visits.calendar.selectChecklist")}),t.map(e=>(0,a.jsx)(m.eb,{value:e.taskCode,children:e.name},e.taskCode))]})]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"mb-1 block text-xs font-semibold text-muted-foreground",children:N("visits.calendar.specialInstructions")}),(0,a.jsx)("textarea",{rows:3,value:P,onChange:e=>M(e.target.value),placeholder:N("visits.calendar.specialInstructionsPlaceholder"),className:"w-full rounded-lg border border-border bg-card px-3 py-2 text-sm focus:border-primary focus:outline-none"})]}),(0,a.jsx)(o.Button,{className:"w-full",onClick:()=>{p(e,{agentCode:E,taskCode:O||null,date:F?I:null,notes:P})},disabled:!(L||_||F||V)||!G,children:N("visits.calendar.saveAssignment")}),e?.Status==="PLANNED"&&v&&(0,a.jsx)(o.Button,{type:"button",variant:"outline",disabled:j,onClick:()=>w(!0),className:"mt-3 h-auto w-full rounded-lg border border-destructive/30 bg-card py-2 text-sm font-medium text-destructive hover:bg-destructive-tint disabled:cursor-not-allowed disabled:opacity-60",children:N("visits.calendar.deleteVisit")}),(0,a.jsx)(u.Dialog,{open:S,onOpenChange:e=>!e&&w(!1),children:(0,a.jsxs)(u.DialogContent,{className:"max-w-md",children:[(0,a.jsxs)(u.DialogHeader,{children:[(0,a.jsxs)(u.DialogTitle,{className:"flex items-center gap-2",children:[(0,a.jsx)(d.A,{className:"h-5 w-5 text-destructive"}),N("visits.calendar.deleteDialog.title")]}),(0,a.jsx)(u.DialogDescription,{children:N("visits.calendar.deleteDialog.description")})]}),(0,a.jsxs)("div",{className:"rounded-md border border-border bg-muted/30 p-3 text-sm",children:[(0,a.jsx)("p",{className:"font-semibold text-foreground",children:e.StoreName||e.StoreCode}),(0,a.jsx)("p",{className:"text-xs font-mono text-muted-foreground",children:e.VisitCode||e.StoreCode})]}),(0,a.jsxs)(u.DialogFooter,{className:"gap-2 sm:gap-2",children:[(0,a.jsx)(o.Button,{variant:"outline",onClick:()=>w(!1),children:N("visits.calendar.deleteDialog.cancel")}),(0,a.jsx)(o.Button,{variant:"destructive",disabled:j,onClick:C,children:N("visits.calendar.deleteDialog.confirm")})]})]})})]})}var p=s(98500),v=s.n(p),N=s(11697),j=s(44478),y=s(62032),S=s(24538),w=s(22164),C=s(99003),k=s(6296),A=s(9339);let E=(0,A.createServerReference)("40afa019f3fd2627e60dd2b9af4c0d448c379a32ee",A.callServer,void 0,A.findSourceMapURL,"getVisitAnswers");var R=s(70620);function O({visitCode:e}){let t=(0,l.c)("applications.scout"),[s,n]=(0,r.useState)(!0),[i,d]=(0,r.useState)(null),o=(0,C.mN)({defaultValues:{additionalFields:{}}});(0,r.useEffect)(()=>{let t=!1;return(async()=>{try{let s=await E(e);if(t)return;d(s?.Error?null:s?.Data??null)}finally{t||n(!1)}})(),()=>{t=!0}},[e]);let c=(0,r.useMemo)(()=>{let e={};for(let t of i?.FormResponses||[]){let s=t?.FieldCode??t?.fieldCode,a=t?.Value??t?.value;s&&(e[s]=a)}return e},[i]);if(s)return(0,a.jsx)("section",{className:"rounded-lg border bg-card p-6",children:(0,a.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,a.jsx)(k.A,{className:"h-4 w-4 animate-spin"}),t("visits.detail.loadingAnswers")]})});let u=i?.Schema||null,m=(i?.FormResponses||[]).length>0;return u&&m?(0,a.jsxs)("section",{className:"rounded-lg border bg-card p-6",children:[(0,a.jsx)("h3",{className:"mb-4 text-lg font-semibold",children:t("visits.detail.checklist")}),(0,a.jsx)(C.Op,{...o,children:(0,a.jsx)("fieldset",{disabled:!0,className:"pointer-events-none opacity-95",children:(0,a.jsx)(R.A,{schema:u,control:o.control,savedValues:c})})})]}):null}var T=s(6467),I=s(28506);function D({photo:e,onOpen:t,t:s}){let[l,n]=(0,r.useState)(!1),i=e.ResourcePath||e.resourcePath||"",d=e.Category||e.category||"GENERAL",c=e.Caption||e.caption||"",u=I.Re[d]||I.Re.GENERAL,m=I.Re[d]?s(`photoCategory.${d}`):d;return(0,a.jsxs)(o.Button,{type:"button",variant:"ghost",onClick:()=>t(i),className:"group block h-auto w-full overflow-hidden rounded-xl border border-border bg-card p-0 text-left shadow-sm transition hover:bg-card hover:shadow-md",children:[(0,a.jsxs)("div",{className:"relative aspect-square w-full bg-muted",children:[!l&&i?(0,a.jsx)("img",{src:i,alt:c||m,loading:"lazy",onError:()=>n(!0),className:"h-full w-full object-cover transition group-hover:scale-105"}):(0,a.jsxs)("div",{className:"flex h-full w-full flex-col items-center justify-center gap-1 text-muted-foreground",children:[(0,a.jsx)(T.A,{className:"h-6 w-6"}),(0,a.jsx)("span",{className:"text-[10px] uppercase tracking-wide",children:s("visits.photos.noImage")})]}),(0,a.jsx)("span",{className:`absolute left-1.5 top-1.5 max-w-[calc(100%-12px)] truncate rounded-full px-1.5 py-0.5 text-[9px] font-semibold uppercase tracking-tight ${u}`,title:m,children:m})]}),c&&(0,a.jsx)("div",{className:"w-full truncate p-2 text-xs text-foreground",title:c,children:c})]})}function P({photos:e=[]}){let[t,s]=(0,r.useState)(null),n=(0,l.c)("applications.scout");return e&&0!==e.length?(0,a.jsxs)("div",{className:"rounded-lg border bg-card p-6",children:[(0,a.jsxs)("h3",{className:"mb-4 text-lg font-semibold",children:[n("visits.photos.title")," (",e.length,")"]}),(0,a.jsx)("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-3 md:grid-cols-4",children:e.map((e,t)=>(0,a.jsx)(D,{photo:e,onOpen:e=>e&&s(e),t:n},e.Code||e.code||t))}),t&&(0,a.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/80 p-6",onClick:()=>s(null),children:[(0,a.jsx)(o.Button,{type:"button",variant:"ghost",size:"icon",onClick:()=>
1s(null),className:"absolute right-4 top-4 rounded-full bg-card/90 p-2 text-foreground shadow hover:bg-card hover:text-foreground","aria-label":n("visits.photos.closePreview"),children:(0,a.jsx)(i.A,{className:"h-5 w-5"})}),(0,a.jsx)("img",{src:t,alt:n("visits.photos.title"),className:"max-h-full max-w-full rounded-lg shadow-2xl",onClick:e=>e.stopPropagation()})]})]}):(0,a.jsx)("div",{className:"rounded-lg border bg-card p-6 text-sm text-muted-foreground",children:n("visits.photos.empty")})}function M({status:e,t}){return e?(0,a.jsx)(g.A,{tone:x.Wy[e]||"gray",children:t(`status.${e}`)}):null}function L({validated:e,distanceMeters:t,t:s}){return null==e?null:e?(0,a.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full bg-success-tint px-2 py-0.5 text-xs font-semibold text-success",children:[(0,a.jsx)(j.A,{className:"h-3 w-3"}),s("visits.calendar.gpsValidated")]}):(0,a.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full bg-warning-tint px-2 py-0.5 text-xs font-semibold text-warning",title:null!=t?s("visits.calendar.gpsDistance",{meters:t}):void 0,children:[(0,a.jsx)(y.A,{className:"h-3 w-3"}),s("visits.calendar.gpsOutOfRange"),null!=t?(0,a.jsxs)("span",{className:"ml-1 font-mono text-[10px] opacity-80",children:[t,"m"]}):null]})}function _({visit:e,onClose:t}){let s=(0,l.c)("applications.scout"),r=(0,N.Ym)(),d=e.CheckInLat??e.Attributes?.check_in_lat??null,o=e.CheckInLng??e.Attributes?.check_in_lng??null,c=e.StoreLat??null,u=e.StoreLng??null,m=(0,x.u)(e.CheckInAt),g=(0,x.u)(e.CheckOutAt);return(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(M,{status:e.Status,t:s}),(0,a.jsx)("h3",{className:"mt-1 text-lg font-semibold",children:e.StoreName||e.StoreCode}),(0,a.jsx)("div",{className:"text-xs text-muted-foreground",children:e.VisitCode})]}),(0,a.jsx)("button",{type:"button",onClick:t,"aria-label":s("visits.calendar.closePanel"),className:"rounded-full p-1 text-muted-foreground hover:bg-muted",children:(0,a.jsx)(i.A,{className:"h-5 w-5"})})]}),e.TaskCode&&(0,a.jsxs)("div",{className:"text-xs",children:[(0,a.jsxs)("span",{className:"text-muted-foreground",children:[s("visits.calendar.taskCodeLabel"),":"]})," ",(0,a.jsx)("span",{className:"inline-block rounded bg-primary/10 px-1.5 py-0.5 font-mono text-[10px] text-primary",children:e.TaskCode})]}),m&&(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2 rounded border p-2 text-xs",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-muted-foreground",children:s("visits.calendar.checkInAt")}),(0,a.jsx)("div",{className:"font-medium",children:(0,n.GP)(m,"dd MMM HH:mm")})]}),(0,a.jsx)(L,{validated:e.GpsValidatedCheckIn,distanceMeters:e.CheckInDistanceMeters,t:s})]}),g&&(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2 rounded border p-2 text-xs",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-muted-foreground",children:s("visits.calendar.checkOutAt")}),(0,a.jsx)("div",{className:"font-medium",children:(0,n.GP)(g,"dd MMM HH:mm")})]}),(0,a.jsx)(L,{validated:e.GpsValidatedCheckOut,distanceMeters:e.CheckOutDistanceMeters,t:s})]}),(0,a.jsxs)("div",{className:"rounded-lg border bg-card p-3",children:[(0,a.jsxs)("div",{className:"mb-1 flex items-center gap-1 text-xs uppercase tracking-wide text-muted-foreground",children:[(0,a.jsx)(S.A,{className:"h-3.5 w-3.5"}),s("visits.calendar.checkInCoords")]}),(0,a.jsx)("div",{className:"text-sm font-medium",children:null!=d&&null!=o?`${d}, ${o}`:s("visits.calendar.noCoords")}),null!=c&&null!=u&&(0,a.jsxs)("div",{className:"mt-1 text-[11px] text-muted-foreground",children:["↔ ",c,", ",u]})]}),e.Notes&&(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"mb-1 text-xs text-muted-foreground",children:s("visits.calendar.notes")}),(0,a.jsx)("p",{className:"whitespace-pre-wrap rounded border bg-muted p-2 text-sm",children:e.Notes})]}),(0,a.jsx)(P,{photos:e.Photos||[]}),e.VisitCode&&(0,a.jsx)(O,{visitCode:e.VisitCode}),e.RelatedSalesOrderCode?(0,a.jsxs)(v(),{href:`/${r}/apps/sales/orders/${e.RelatedSalesOrderCode}`,className:"inline-flex w-full items-center justify-center gap-2 rounded-lg border border-primary/30 bg-primary/5 px-3 py-2 text-sm font-medium text-primary hover:bg-primary/10",children:[(0,a.jsx)(w.A,{className:"h-4 w-4"}),s("visits.calendar.viewSalesOrder",{code:e.RelatedSalesOrderCode})]}):(0,a.jsxs)("button",{type:"button",disabled:!0,title:s("visits.calendar.noSalesOrderTooltip"),className:"flex w-full cursor-not-allowed items-center justify-center gap-2 rounded-lg border border-dashed border-border bg-muted px-3 py-2 text-sm font-medium text-muted-foreground",children:[(0,a.jsx)(w.A,{className:"h-4 w-4"}),s("visits.calendar.noSalesOrder")]})]})}function F({visit:e,open:t,onClose:s,taskForms:l,onSave:n,agents:i=[],onDelete:d}){let[o,c]=(0,r.useState)(null);return(0,r.useEffect)(()=>{e&&c(e)},[e]),(0,r.useEffect)(()=>
1{if(!t)return;let e=e=>{"Escape"===e.key&&s?.()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[t,s]),(0,a.jsx)("div",{className:`fixed inset-0 z-50 flex justify-end transition-colors duration-300 ${t?"bg-black/30":"pointer-events-none bg-transparent"}`,onClick:s,"aria-hidden":!t,children:(0,a.jsx)("div",{role:"dialog","aria-modal":"true","aria-label":o?.StoreName||o?.title||"Visit details",className:`h-full w-full max-w-md overflow-y-auto bg-card p-6 shadow-2xl transition-transform duration-300 ease-out ${t?"translate-x-0":"translate-x-full"}`,onClick:e=>e.stopPropagation(),children:o&&((0,x.pi)(o)?(0,a.jsx)(b,{visit:o,taskForms:l,agents:i,onClose:s,onSave:n,onDelete:d}):(0,a.jsx)(_,{visit:o,onClose:s}))})})}},55938:(e,t,s)=>{s.d(t,{P:()=>r});var a=s(9339);let r=(0,a.createServerReference)("4041e8b793fddb0de956e190d5c7d6494b6b625e07",a.callServer,void 0,a.findSourceMapURL,"assignVisit")},57350:(e,t,s)=>{s.d(t,{A:()=>n,B:()=>i});var a=s(95155),r=s(86190),l=s(28506);function n({tone:e="gray",children:t,className:s}){return(0,a.jsx)("span",{className:(0,r.cn)("inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-semibold whitespace-nowrap",l._N[e]||l._N.gray,s),children:t})}function i(e){let t=Number(e);return Number.isFinite(t)?t<60?"red":t<80?"amber":"emerald":"gray"}},70620:(e,t,s)=>{s.d(t,{A:()=>n});var a=s(95155),r=s(50910),l=s(2485);function n({schema:e,control:t,savedValues:s={}}){let i=(0,r.c)("applications.scout"),d=Array.isArray(e?.sections)?e.sections:[];return 0===d.length?(0,a.jsx)("div",{className:"rounded-lg border bg-card p-6 text-sm text-muted-foreground",children:i("visits.dynamicFields.empty")}):(0,a.jsx)("div",{className:"space-y-4",children:d.map(e=>(0,a.jsxs)("section",{className:"rounded-lg border bg-card p-6",children:[(0,a.jsx)("h3",{className:"mb-4 text-lg font-semibold",children:e.name}),(0,a.jsx)(l.A,{fields:e.fields||[],control:t,savedValues:s,gridLayout:!0})]},e.sectionCode))})}},99393:(e,t,s)=>{s.d(t,{n:()=>r});var a=s(9339);let r=(0,a.createServerReference)("4056fb8c06eb3be7b25d30c44b31f42d2464ef83ea",a.callServer,void 0,a.findSourceMapURL,"getTaskForms")}}]);

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.