1import{u as J,a as se,hk as ne,hl as ae,hm as X,hn as te,r as k,ho as ie,j as e,$ as le,B as q,m as V,n as p,T as H,A as b,M as U,al as re,bv as M,bw as D,O as ce,g as de,L as W,I as z,E as oe,aO as me,N as ue}from"./index-mbu4rngo.js";import{c as xe}from"./staffAssignee.helper-DV8bhZ0z.js";import{O as Y,a as G,n as Z,b as E}from"./onboardingLabels-omYQNSEt.js";import{K as P,F as ge}from"./_shared-lhQwVeXi.js";import{P as he}from"./PlatformPageHeader-v9IdG0yn.js";import{K as pe}from"./KpiSkeleton-CaZsxaxO.js";import{u as fe}from"./useDrawerFromSearch-CYfft93B.js";import"./staffOrgModel-Clzfx9OX.js";import"./saudiRegistryTerms-DA-filpw.js";import"./PageHeader-Bx5JqCoI.js";function R({error:s,t:d,locale:o}){var v;if(!s)return null;const n=(s==null?void 0:s.code)||((v=s==null?void 0:s.error)==null?void 0:v.code),c=re(s,o)||d("Action failed.","ÙØ´Ù Ø§ÙØ¥Ø¬Ø±Ø§Ø¡.");return e.jsxs("div",{className:"card border-rose-200 bg-rose-50/60 px-3 py-2 text-sm",role:"alert",children:[e.jsx("div",{className:"font-medium text-rose-800",children:c}),n&&e.jsx("div",{className:"text-[11px] font-mono text-rose-600 mt-0.5",children:n})]})}const I=Y,je=s=>({low:s("Low","Ù
ÙØ®Ùض"),medium:s("Medium","Ù
ØªÙØ³Ø·"),high:s("High","Ù
Ø±ØªÙØ¹")});function be({open:s,onClose:d,id:o}){var $;const{t:n,locale:c}=J(),v=se(t=>t.can),T=je(n),f=ne(o),x=ae(),g=X(),N=te(),_=v("platform.onboarding.work"),[A,y]=k.useState(!1),[w,m]=k.useState(!1),[u,C]=k.useState("whatsapp"),[h,S]=k.useState(""),O=ie({status:"active",per_page:100},{enabled:s&&!!o&&_}),L=k.useMemo(()=>{var l;const t=xe(((l=O.data)==null?void 0:l.items)||[],{functionId:"signups",locale:c,t:n});return h&&!t.some(j=>j.value===h)?[{value:h,label:h,staff:null},...t.filter(j=>j.value!==""),t.find(j=>j.value==="")||{value:"",label:n("(Unassigned)","(ØºÙØ± Ù
عÙÙÙ)"),staff:null}]:t},[($=O.data)==null?void 0:$.items,c,n,h]),a=f.data;k.useEffect(()=>{a&&S(a.csm||"")},[a==null?void 0:a.id,a==null?void 0:a.csm,a]);const B=t=>{y(!1);const l=(t==null?void 0:t.data)??t;u==="email"&&(l==null?void 0:l.email_sent)!==!0?M.emit(D.TOAST,{tone:"warning",message_en:`Touchpoint logged, but the email was not sent (${(l==null?void 0:l.email_reason)||"unknown"}).`,message_ar:`تÙ
تسجÙÙ Ø§ÙØªÙØ§ØµÙØ ÙÙÙ ÙÙ
ÙÙØ±Ø³ÙÙ Ø§ÙØ¨Ø±Ùد (${(l==null?void 0:l.email_reason)||"ØºÙØ± Ù
عرÙÙ"}).`}):M.emit(D.TOAST,{tone:"success",message_en:u==="email"?"Touchpoint logged and email queued.":"Touchpoint logged.",message_ar:u==="email"?"تÙ
تسجÙÙ Ø§ÙØªÙØ§ØµÙ ÙØ¥Ø±Ø³Ø§Ù Ø§ÙØ¨Ø±Ùد.":"تÙ
تسجÙÙ Ø§ÙØªÙاصÙ."})};return o?e.jsxs(le,{open:s,onClose:d,width:520,title:a?c==="ar"?a.business_ar||a.business_en:a.business_en||a.business_ar:"â¦",children:[a?e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsxs("header",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx(q,{tone:a.risk==="high"?"danger":a.risk==="medium"?"warning":"success",dot:!0,children:T[a.risk]||a.risk}),e.jsx("span",{className:"text-sm font-semibold flex-1 truncate",children:c==="ar"?a.business_ar:a.business_en}),a.stuck_days>0&&e.jsx(q,{tone:"warning",children:n(`Stuck ${a.stuck_days}d`,`Ù
تÙÙÙ ${a.stuck_days} ÙÙÙ
`)})]}),e.jsxs("div",{className:"card p-4",children:[e.jsx("div",{className:"text-[11px] uppercase tracking-widest rtl:tracking-normal text-ink-600 mb-1",children:n("Funnel","اÙÙ
سار")}),e.jsx("ol",{className:"flex flex-col gap-1.5 mt-1",children:(a.steps||[]).map(t=>{const l=I[t.id]||{en:t.id,ar:t.id};return e.jsxs("li",{"aria-current":t.current?"step":void 0,className:V("flex items-center gap-3 px-3 py-2 rounded",t.current?"bg-ink-900 text-white":t.done?"bg-emerald-50/50 text-emerald-700":"text-ink-600"),children:[e.jsx("span",{"aria-hidden":!0,className:V("w-5 h-5 grid place-items-center rounded-full text-[11px] font-semibold",t.current?"bg-white text-ink-900":t.done?"bg-emerald-500 text-white":"bg-ink-200 text-ink-600"),children:t.done?"â":t.idx}),t.done&&e.jsxs("span",{className:"sr-only",children:[n("Done","Ù
ÙØªÙ
Ù"),": "]}),e.jsx("span",{className:"flex-1 text-sm",children:c==="ar"?l.ar:l.en}),t.current&&a.eta&&e.jsxs("span",{className:"text-xs opacity-80",children:[n("ETA","اÙÙ
ÙØ¹Ø¯ اÙÙ
تÙÙØ¹")," · ",G(a.eta,n,c)]})]},t.id)})})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3 text-sm",children:[e.jsx(F,{label:n("Owner","اÙÙ
اÙÙ"),value:a.owner}),e.jsx(F,{label:n("ETA","اÙÙ
ÙØ¹Ø¯ اÙÙ
تÙÙØ¹"),value:G(a.eta,n,c)||"-"}),e.jsx(F,{label:n("Stuck days","Ø£ÙØ§Ù
Ø§ÙØªØ¹Ø«Ø±"),value:a.stuck_days>0?`${p(a.stuck_days,c)} ${n("days","ÙÙÙ
")}`:n("Moving","ÙØªÙدÙ
")})]}),_&&e.jsxs("div",{className:"card p-3 flex flex-col gap-2",children:[e.jsx(H,{label:n("CSM owner","Ù
Ø¯ÙØ± ÙØ¬Ø§Ø Ø§ÙØ¹Ù
ÙÙ"),value:h,onChange:t=>S(t.target.value),options:L,hint:n("Onboarding team members from signups & onboarding coverage.","أعضاء ÙØ±ÙÙ Ø§ÙØªÙÙØ¦Ø© Ù
Ù ØªØºØ·ÙØ© Ø§ÙØªØ³Ø¬ÙÙ ÙØ§ÙتÙÙØ¦Ø©.")}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(b,{variant:"secondary",size:"sm",loading:N.isPending,disabled:h===(a.csm||""),onClick:()=>N.mutate({id:a.id,csm:h}),children:n("Save CSM","ØÙظ Ù
Ø¯ÙØ± اÙÙØ¬Ø§Ø")}),a.csm&&e.jsx(b,{variant:"ghost",size:"sm",onClick:()=>N.mutate({id:a.id,csm:""}),loading:N.isPending,children:n("Clear","Ø¥Ø²Ø§ÙØ©")})]}),e.jsx(R,{error:N.error,t:n,locale:c})]}),!_&&e.jsx(F,{label:n("CSM","Ù
Ø¯ÙØ± اÙÙØ¬Ø§Ø"),value:a.csm||"-"}),e.jsxs("div",{className:"grid grid-cols-2 gap-2 mt-2",children:[e.jsx(b,{variant:"secondary",onClick:()=>y(!0),children:n("Nudge","ØªÙØ¨ÙÙ")}),e.jsx(b,{variant:"primary",onClick:()=>{x.reset(),m(!0)},disabled:a.current_step==="go_live",children:n("Advance step","ØªÙØ¯ÙÙ
Ø®Ø·ÙØ©")})]}),e.jsx(R,{error:g.error,t:n,locale:c})]}):e.jsx("div",{className:"p-12 text-center text-ink-600 text-sm",children:n("Loadingâ¦","Ø¬Ø§Ø±Ù Ø§ÙØªØÙ
ÙÙâ¦")}),a&&(()=>{const t=(a.steps||[]).findIndex(i=>i.current),l=t>=0?(a.steps||[])[t+1]:null,j=l?I[l.id]?c==="ar"?I[l.id].ar:I[l.id].en:l.id:null;return e.jsx(U,{open:w,onClose:()=>m(!1),size:"sm",title:n("Advance step","ØªÙØ¯ÙÙ
Ø®Ø·ÙØ©"),footer:e.jsxs(e.Fragment,{children:[e.jsx(b,{variant:"secondary",onClick:()=>m(!1),children:n("Cancel","Ø¥ÙØºØ§Ø¡")}),e.jsx(b,{variant:"primary",loading:x.isPending,onClick:()=>x.mutate({id:a.id},{onSuccess:()=>m(!1)}),children:n("Advance","ØªÙØ¯ÙÙ
")})]}),children:e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx("p",{className:"text-sm text-ink-700 leading-relaxed",children:j?n(`Advance this tenant to "${j}"? This resets the stuck counter and is recorded in the audit log. It cannot be undone.`,`ØªÙØ¯ÙÙ
ÙØ°Ù اÙÙ
ÙØ´Ø£Ø© Ø¥ÙÙ "${j}"Ø ÙØ¹Ùد ضبط عداد Ø§ÙØªØ¹Ø«Ø± ÙÙÙØ³Ø¬ÙÙÙ ÙÙ Ø³Ø¬Ù Ø§ÙØªØ¯ÙÙÙ. ÙØ§ ÙÙ
ÙÙ Ø§ÙØªØ±Ø§Ø¬Ø¹.`):n("Advance this tenant to the next step? This resets the stuck counter and is recorded in the audit log. It cannot be undone.","ØªÙØ¯ÙÙ
ÙØ°Ù اÙÙ
ÙØ´Ø£Ø© Ø¥ÙÙ Ø§ÙØ®Ø·ÙØ© Ø§ÙØªØ§ÙÙØ©Ø ÙØ¹Ùد ضبط عداد Ø§ÙØªØ¹Ø«Ø± ÙÙÙØ³Ø¬ÙÙÙ ÙÙ Ø³Ø¬Ù Ø§ÙØªØ¯ÙÙÙ. ÙØ§ ÙÙ
ÙÙ Ø§ÙØªØ±Ø§Ø¬Ø¹.")}),e.jsx(R,{error:x.error,t:n,locale:c})]})})})(),e.jsx(U,{open:A,onClose:()=>y(!1),size:"sm",title:n("Nudge tenant","ØªÙØ¨Ù٠اÙÙ
ÙØ´Ø£Ø©"),footer:e.jsxs(e.Fragment,{children:[e.jsx(b,{variant:"secondary",onClick:()=>y(!1),children:n("Cancel","Ø¥ÙØºØ§Ø¡")}),e.jsx(b,{variant:"primary",onClick:()=>g.mutate({id:a.id,channel:u},{onSuccess:B}),loading:g.isPending,children:n("Send","إرساÙ")})]}),children:e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx(H,{label:n("Channel","اÙÙÙØ§Ø©"),value:u,onChange:t=>C(t.target.value),options:[{value:"whatsapp",label:n("WhatsApp","ÙØ§ØªØ³Ø§Ø¨")},{value:"phone",label:n("Phone call","Ù
ÙØ§ÙÙ
Ø© ÙØ§ØªÙÙØ©")},{value:"email",label:n("Email","Ø§ÙØ¨Ø±Ùد Ø§ÙØ¥ÙÙØªØ±ÙÙÙ")},{value:"sms",label:"SMS"}]}),e.jsx("p",{className:"text-[11px] text-ink-600 leading-relaxed",children:Z(n,u)})]})})]}):null}function F({label:s,value:d}){return e.jsxs("div",{children:[e.jsx("div",{className:"text-[11px] uppercase tracking-wide rtl:tracking-normal text-ink-600",children:s}
1),e.jsx("div",{className:"font-medium mt-0.5",children:d||"-"})]})}const ke={low:"success",medium:"warning",high:"danger"},K=Y,ve=["all","low","medium","high"],Q={high:2,medium:1,low:0},Ne=s=>({all:s("All","اÙÙÙ"),low:s("Low","Ù
ÙØ®Ùض"),medium:s("Medium","Ù
ØªÙØ³Ø·"),high:s("High","Ù
Ø±ØªÙØ¹")});function Ie(){var t,l,j;const{t:s,locale:d,apiError:o}=J(),[n,c]=ce(),[v,T]=k.useState(()=>{const i=n.get("risk");return ve.includes(i)?i:"all"}),[f,x]=k.useState(null),[g,N]=k.useState("whatsapp"),[_,A]=k.useState(()=>n.get("open")),{closeDrawer:y}=fe(_,A),w=i=>{T(i);const r=new URLSearchParams(n);i==="all"?r.delete("risk"):r.set("risk",i),c(r,{replace:!0})},m=i=>{A(String(i));const r=new URLSearchParams(n);r.set("open",String(i)),c(r,{replace:!0})},u=de({risk:v}),C=X(),h=((t=u.data)==null?void 0:t.items)||[],S=((l=u.data)==null?void 0:l.kpis)||{},O=((j=u.data)==null?void 0:j.steps)||[],L=Ne(s),a=v!=="all",B=k.useMemo(()=>[...h].sort((i,r)=>(Q[r.risk]??0)-(Q[i.risk]??0)||(r.stuck_days??0)-(i.stuck_days??0)),[h]),$=i=>{x(null);const r=(i==null?void 0:i.data)??i;g==="email"&&(r==null?void 0:r.email_sent)!==!0?M.emit(D.TOAST,{tone:"warning",message_en:`Touchpoint logged, but the email was not sent (${(r==null?void 0:r.email_reason)||"unknown"}).`,message_ar:`تÙ
تسجÙÙ Ø§ÙØªÙØ§ØµÙØ ÙÙÙ ÙÙ
ÙÙØ±Ø³ÙÙ Ø§ÙØ¨Ø±Ùد (${(r==null?void 0:r.email_reason)||"ØºÙØ± Ù
عرÙÙ"}).`}):M.emit(D.TOAST,{tone:"success",message_en:g==="email"?"Touchpoint logged and email queued.":"Touchpoint logged.",message_ar:g==="email"?"تÙ
تسجÙÙ Ø§ÙØªÙØ§ØµÙ ÙØ¥Ø±Ø³Ø§Ù Ø§ÙØ¨Ø±Ùد.":"تÙ
تسجÙÙ Ø§ÙØªÙاصÙ."})};return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(he,{title:s("Onboarding","تÙÙØ¦Ø© اÙÙ
ÙØ´Ø¢Øª"),subtitle:s("Track new tenants moving through activation · spot stuck accounts before churn.","تتبع اÙÙ
ÙØ´Ø¢Øª Ø§ÙØ¬Ø¯Ùدة Ø®ÙØ§Ù Ø§ÙØªÙعÙ٠· رصد Ø§ÙØØ³Ø§Ø¨Ø§Øª اÙÙ
تعثرة ÙØ¨Ù اÙÙÙØ¯."),actions:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(W,{to:"/app/platform/tenants/new",className:"inline-flex items-center justify-center gap-2 rounded-lg font-medium transition focus:outline-none focus:ring-2 bg-ink-900 text-white hover:bg-ink-600 focus:ring-ink-900/30 px-4 py-2 text-sm",children:[e.jsx(z,{name:"plus",size:14}),s("New tenant","Ù
ÙØ´Ø£Ø© Ø¬Ø¯ÙØ¯Ø©")]}),e.jsxs(W,{to:"/app/platform/signups",className:"inline-flex items-center gap-1.5 text-sm font-medium px-3 py-2 rounded-lg border border-ink-200 hover:bg-ink-50",children:[e.jsx(z,{name:"clipboard-list",size:14}),s("Signup queue","ÙØ§Ø¦Ù
Ø© Ø·ÙØ¨Ø§Øª Ø§ÙØªØ³Ø¬ÙÙ")]})]})}),u.isLoading?e.jsx(pe,{}):e.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3",children:[e.jsx(P,{label:s("At risk","ÙØØªØ§Ø¬ Ù
تابعة"),value:p(S.at_risk||0,d),tone:(S.at_risk||0)>0?"text-rose-600":void 0}),e.jsx(P,{label:s("Stuck (â¥3d)","Ù
تعثر (â¥3 Ø£ÙØ§Ù
)"),value:p(S.stuck||0,d),tone:(S.stuck||0)>0?"text-amber-600":void 0}),e.jsx(P,{label:s("In progress","ÙÙØ¯ Ø§ÙØªÙÙÙØ°"),value:p(S.total||0,d)}),e.jsx(P,{label:s("Avg steps done","Ù
ØªÙØ³Ø· Ø§ÙØ®Ø·Ùات"),value:p(S.avg_steps||0,d),hint:O.length?`${s("of","Ù
Ù")} ${p(O.length,d)} ${s("steps","Ø®Ø·ÙØ§Øª")}`:void 0})]}),e.jsxs("div",{className:"card p-3 flex flex-wrap gap-3 items-center",children:[e.jsx(ge,{label:s("Risk:","Ø§ÙØ®Ø·Ø±:"),value:v,options:["all","low","medium","high"],onChange:w,labelFor:i=>L[i]}),e.jsx("span",{className:"flex-1"}),e.jsxs("span",{className:"text-xs text-ink-600",children:[p(h.length,d)," ",h.length===1?s("account","ØØ³Ø§Ø¨"):s("accounts","ØØ³Ø§Ø¨Ø§Øª")]})]}),u.isError&&e.jsx(oe,{error:u.error,onRetry:u.refetch}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-4",children:u.isLoading?Array.from({length:4}).map((i,r)=>e.jsxs("div",{className:"card p-5 flex flex-col gap-3 animate-pulse",children:[e.jsxs("div",{className:"flex justify-between gap-3",children:[e.jsxs("div",{className:"flex flex-col gap-1.5 flex-1",children:[e.jsx("div",{className:"h-4 w-40 bg-ink-100 rounded"}),e.jsx("div",{className:"h-3 w-28 bg-ink-100 rounded"})]}),e.jsx("div",{className:"h-5 w-14 bg-ink-100 rounded-full"})]}),e.jsx("div",{className:"h-1.5 w-full bg-ink-100 rounded-full"}),e.jsx("div",{className:"h-3 w-32 bg-ink-100 rounded"}),e.jsx("div",{className:"flex gap-1",children:Array.from({length:8}).map((we,ee)=>e.jsx("div",{className:"h-1.5 flex-1 bg-ink-100 rounded-full"},ee))})]},r)):h.length===0?e.jsx("div",{className:"col-span-full",children:e.jsx(me,{title:a?s("No accounts match","ÙØ§ ØªÙØ¬Ø¯ ØØ³Ø§Ø¨Ø§Øª Ù
Ø·Ø§Ø¨ÙØ©"):s("No onboarding accounts","ÙØ§ ØªÙØ¬Ø¯ ØØ³Ø§Ø¨Ø§Øª ÙÙØ¯ Ø§ÙØ¥Ø¹Ø¯Ø§Ø¯"),body:a?s("Try clearing the risk filter.","اÙ
Ø³Ø ØªØµÙÙØ© Ø§ÙØ®Ø·Ø±."):s("Accounts appear here after signup promotion.","ØªØ¸ÙØ± Ø§ÙØØ³Ø§Ø¨Ø§Øª ÙÙØ§ بعد ترÙÙØ© Ø§ÙØªØ³Ø¬ÙÙ."),cta:a?e.jsx(b,{variant:"secondary",onClick:()=>w("all"),children:s("Clear filter","Ù
Ø³Ø Ø¹Ø§Ù
Ù Ø§ÙØªØµÙÙØ©")}):null})}):B.map(i=>e.jsx(_e,{o:i,steps:O,locale:d,t:s,risk:L,onOpen:()=>m(i.id),onNudge:()=>{x(i),N("whatsapp")}},i.id))}),e.jsx(be,{open:!!_,id:_,onClose:y}),e.jsx(U,{open:!!f,onClose:()=>x(null),title:s("Log a touchpoint","تسجÙÙ ØªÙØ§ØµÙ"),size:"sm",footer:e.jsxs(e.Fragment,{children:[e.jsx(b,{variant:"ghost",onClick:()=>x(null),children:s("Cancel","Ø¥ÙØºØ§Ø¡")}),e.jsx(b,{loading:C.isPending,onClick:()=>C.mutate({id:f.id,channel:g},{onSuccess:$}),children:g==="email"?s("Log & email","تسجÙÙ ÙØ¥Ø±Ø³Ø§Ù"):s("Log contact","تسجÙÙ Ø§ÙØªÙاصÙ")})]}),children:f&&e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsxs("div",{className:"rounded-lg bg-ink-50 border border-ink-100 px-3 py-2.5",children:[e.jsx("div",{className:"text-sm font-semibold text-ink-900",children:d==="ar"?f.business_ar:f.business_en}),e.jsx("div",{className:"text-xs text-ink-600 mt-0.5",children:f.owner})]}),e.jsx(H,{label:s("Channel used","اÙÙÙØ§Ø© اÙÙ
ستخدÙ
Ø©"),value:g,onChange:i=>N(i.target.value),options:[{value:"whatsapp",label:E(s).whatsapp},{value:"phone",label:E(s).phone},{value:"email",label:E(s).email},{value:"sms",label:E(s).sms}]}),e.jsx("p",{className:"text-[11px] text-ink-600 leading-relaxed",children:Z(s,g)}),C.isError&&e.jsx("p",{role:"alert",className:"text-[11px] text-rose-700",children:o(C.error)||s("Could not log the touchpoint.","ØªØ¹Ø°ÙØ± تسجÙÙ Ø§ÙØªÙاصÙ.")})]})})]})}const _e=({o:s,steps:d,locale:o,t:n,risk:c,onNudge:v,onOpen:T})=>{const f=s.completed.length,x=d.length,g=x?Math.round(f/x*100):0,N=s.stuck_days>=3,_=o==="ar"?s.business_ar||s.business_en:s.business_en||s.business_ar,A=d.indexOf(s.current_step),y=K[s.current_step]?o==="ar"?K[s.current_step].ar:K[s.current_step].en:s.current_step,w=s.last_nudge_channel?E(n)[s.last_nudge_channel]||s.last_nudge_channel:null;return e.jsxs("div",{role:"button",tabIndex:0,"aria-label":_,className:"card p-5 cursor-pointer hover:border-ink-300 transition focus:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ink-300",onClick:T,onKeyDown:m=>{m.target===m.currentTarget&&(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),T())},children:[e.jsxs("div",{className:"flex items-start justify-between gap-3 mb-3",children:[e.jsxs("div",{children:[e.jsx("div",{className:"font-display font-semibold",children:_}),e.jsxs("div",{className:"text-xs text-ink-600 mt-0.5 flex flex-wrap gap-x-2",children:[e.jsxs("span",{children:[n("Owner","اÙÙ
اÙÙ"),": ",e.jsx("span",{className:"text-ink-600",children:s.owner})]}),s.csm&&e.jsxs("span",{children:[n("CSM","Ù
. اÙÙØ¬Ø§Ø"),": ",e.jsx("span",{className:"text-ink-600",children:s.csm})]})]})]}
1),e.jsx(q,{tone:ke[s.risk],dot:!0,children:c[s.risk]||s.risk})]}),e.jsxs("div",{className:"flex items-baseline justify-between mb-1.5",children:[e.jsxs("span",{className:"text-xs text-ink-600",children:[p(f,o),"/",p(x,o)," ",f===1?n("step","Ø®Ø·ÙØ©"):n("steps","Ø®Ø·ÙØ§Øª")]}),e.jsxs("span",{className:"text-xs font-mono text-ink-600",children:[g,"%"]})]}),e.jsx("div",{className:"h-1.5 bg-ink-100 rounded-full overflow-hidden mb-3","aria-hidden":!0,children:e.jsx("div",{className:"h-full bg-ink-900",style:{width:`${g}%`}})}),e.jsxs("div",{className:"mb-4",children:[e.jsx("div",{className:"text-xs text-ink-700 mb-1.5",children:A>=0?e.jsxs(e.Fragment,{children:[e.jsxs("span",{className:"text-ink-600",children:[n("Step","Ø§ÙØ®Ø·ÙØ©")," ",p(A+1,o),"/",p(x,o),": "]}),e.jsx("span",{className:"font-medium",children:y})]}):e.jsx("span",{className:"font-medium",children:n("All steps complete","Ø§ÙØªÙ
ÙØª ÙÙ Ø§ÙØ®Ø·Ùات")})}),e.jsx("ol",{className:"flex gap-1","aria-hidden":!0,children:d.map(m=>{const u=s.completed.includes(m),C=m===s.current_step;return e.jsx("li",{className:"h-1.5 flex-1 rounded-full "+(u?"bg-emerald-500":C?"bg-ink-900":"bg-ink-100")},m)})})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2 pt-3 border-t border-ink-100",children:[e.jsxs("div",{className:"text-xs flex flex-wrap items-center gap-x-1.5 gap-y-1",children:[e.jsx("span",{className:N?"text-danger font-semibold":"text-ink-600",children:s.stuck_days===0?n("moving","ÙØªÙدÙ
"):`${p(s.stuck_days,o)} ${s.stuck_days===1?n("day stuck","ÙÙÙ
Ù
تعثر"):n("days stuck","Ø£ÙØ§Ù
Ù
تعثرة")}`}),e.jsx("span",{className:"text-ink-600",children:"·"}),e.jsxs("span",{className:"text-ink-600",children:[n("ETA","اÙÙ
ÙØ¹Ø¯ اÙÙ
تÙÙØ¹"),": ",G(s.eta,n,o)||"-"]}),(s.nudge_count??0)>0&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-ink-600",children:"·"}),e.jsxs("span",{className:"text-[10px] font-mono px-1.5 py-0.5 rounded bg-sky-50 text-sky-700",title:s.last_nudged_at?`${n("Last nudge","آخر تذÙÙØ±")}: ${ue(s.last_nudged_at,o)}${w?` (${w})`:""}`:void 0,children:[e.jsx(z,{name:"send",size:12,className:"inline-block align-middle me-1"}),e.jsxs("span",{className:"sr-only",children:[n("Nudges sent","تذÙÙØ±Ø§Øª Ù
Ø±Ø³ÙØ©"),": "]}),p(s.nudge_count,o),w?` · ${w}`:""]})]})]}),e.jsx(b,{size:"sm",variant:"secondary",leadingIcon:e.jsx(z,{name:"check",size:12}),onClick:m=>{m.stopPropagation(),v()},children:n("Mark contacted","Ø³Ø¬Ù Ø§ÙØªÙاصÙ")})]})]})};export{Ie 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.