1import{a as q,b as p,t as u,O as g,j as s,T as w,v as z,B as c,m as o,q as l,a3 as y,f as h,n as C,p as k,y as I,ak as L}from"./index-BjSX7oRZ.js";import{A as M}from"./arrow-left-D2B1BNha.js";import{C as A}from"./circle-x-BK5ScYY5.js";const D=(e,a)=>{const n={inaccurate_estimate:{ar:"اÙÙÙØª اÙÙ
ØØ¯Ø¯ Ù
Ù Ø§ÙØ£ÙÙ ØºÙØ± دÙÙÙ",fr:"Estimation initiale inexacte",en:"Initial estimate inaccurate",zh:"åå§é¢ä¼°ä¸åç¡®"},resource_loss:{ar:"Ø¶ÙØ§Ø¹ ÙÙÙÙØª بسبب اÙÙ
ÙØ§Ø±Ø¯",fr:"Perte de temps بسبب اÙÙ
ÙØ§Ø±Ø¯",en:"Time lost due to resources",zh:"èµæºé®é¢å¯¼è´æ¶é´æå¤±"},lack_of_resources:{ar:"عدÙ
ÙØ¬Ùد اÙÙ
ÙØ§Ø±Ø¯ اÙÙØ§Ø²Ù
Ø©",fr:"Ressources nécessaires indisponibles",en:"Lack of necessary resources",zh:"缺å°å¿
è¦èµæº"},other:{ar:"أسباب أخرÙ",fr:"Autres raisons",en:"Other reasons",zh:"å
¶ä»åå "}};return n[e||"other"]?.[a]||n[e||"other"]?.en||e||"â"},S=(e,a)=>{if(!e)return"â";try{return new Date(e).toLocaleString(a==="ar"?"ar-DZ":a==="zh"?"zh-CN":a==="fr"?"fr-FR":"en-GB",{dateStyle:"medium",timeStyle:"short"})}catch{return String(e)}};function O(){const{language:e}=q(),[a,n]=p.useState({}),[E,i]=p.useState(null),{data:x=[],isLoading:d,refetch:f}=u.interventions.getPendingTimeExtensions.useQuery(void 0,{refetchInterval:15e3}),m=u.interventions.reviewTimeExtension.useMutation({onSuccess:async(t,r)=>{await f(),i(null),g.success(r.status==="approved"?e==="ar"?"تÙ
ت اÙÙ
ÙØ§ÙÙØ© عÙ٠اÙÙÙØª Ø§ÙØ¥Ø¶Ø§ÙÙ ÙØ¥Ø¨Ùاغ اÙÙÙÙ.":e==="fr"?"Prolongation approuvée et technicien informé.":e==="zh"?"å»¶æ¶å·²æ¹åï¼ææ¯åå·²æ¶å°éç¥ã":"Extension approved and technician notified.":e==="ar"?"تÙ
Ø±ÙØ¶ Ø·ÙØ¨ اÙÙÙØª Ø§ÙØ¥Ø¶Ø§ÙÙ ÙØªØ³Ø¬Ù٠اÙÙ
ÙØ§ØØ¸Ø©.":e==="fr"?"Prolongation refusée et décision enregistrée.":e==="zh"?"å»¶æ¶å·²æç»ï¼å³å®å·²è®°å½ã":"Extension rejected and decision recorded.")},onError:t=>{i(null),g.error(t.message)}}),T=e==="ar"?"Ø·ÙØ¨Ø§Øª اÙÙÙØª Ø§ÙØ¥Ø¶Ø§ÙÙ":e==="fr"?"Demandes de prolongation":e==="zh"?"å»¶æ¶ç³è¯·":"Time extension requests",j=e==="ar"?"راجع أسباب ØªØ¬Ø§ÙØ² اÙÙÙØª ÙØ¨Ù اÙÙ
ÙØ§ÙÙØ© Ø£Ù Ø§ÙØ±Ùض. ÙÙ ÙØ±Ø§Ø± ÙØ¨ÙÙ Ù
ØÙÙØ¸Ø§Ù ÙÙ Ø³Ø¬Ù Ø§ÙØªØ¯Ø®Ù.":e==="fr"?"Examinez les causes du dépassement avant dâapprouver ou de refuser. Chaque décision est conservée dans lâhistorique.":e==="zh"?"å®¡æ ¸è¶
æ¶åå 忹忿ç»ï¼ææå³å®é½ä¼ä¿åå¨å¹²é¢åå²ä¸ã":"Review the overtime reason before approving or rejecting. Every decision remains in the intervention history.",R=e==="ar"?"Ø§ÙØ¹Ùدة Ø¥ÙÙ ÙÙØØ© اÙÙ
سؤÙÙ":e==="fr"?"Retour au tableau responsable":e==="zh"?"è¿åè´è´£äººé¢æ¿":"Back to manager dashboard",N=e==="ar"?"ÙØ§ ØªÙØ¬Ø¯ Ø·ÙØ¨Ø§Øª ÙÙØª إضاÙÙ Ù
عÙÙØ©.":e==="fr"?"Aucune demande de prolongation en attente.":e==="zh"?"ææ å¾
å®¡æ ¸å»¶æ¶ç³è¯·ã":"No pending extension requests.";return s.jsx("div",{"data-loc":"client/src/pages/TimeExtensionRequests.tsx:58",className:"min-h-screen bg-slate-50 px-4 py-6 sm:px-6",dir:e==="ar"?"rtl":"ltr",children:s.jsxs("div",{"data-loc":"client/src/pages/TimeExtensionRequests.tsx:59",className:"mx-auto max-w-5xl space-y-6",children:[s.jsxs("div",{"data-loc":"client/src/pages/TimeExtensionRequests.tsx:60",className:"flex flex-wrap items-center justify-between gap-3",children:[s.jsxs("div",{"data-loc":"client/src/pages/TimeExtensionRequests.tsx:61",children:[s.jsxs("div",{"data-loc":"client/src/pages/TimeExtensionRequests.tsx:62",className:"mb-2 flex items-center gap-2 text-orange-600",children:[s.jsx(w,{"data-loc":"client/src/pages/TimeExtensionRequests.tsx:62",className:"h-5 w-5"}),s.jsx("span",{"data-loc":"client/src/pages/TimeExtensionRequests.tsx:62",className:"text-xs font-semibold uppercase tracking-wide",children:e==="ar"?"Ù
راجعة اÙÙ
سؤÙÙ":e==="fr"?"Revue responsable":e==="zh"?"è´è´£äººå®¡æ ¸":"Manager review"})]}),s.jsx("h1",{"data-loc":"client/src/pages/TimeExtensionRequests.tsx:63",className:"text-2xl font-bold text-slate-900",children:T}),s.jsx("p",{"data-loc":"client/src/pages/TimeExtensionRequests.tsx:64",className:"mt-1 max-w-3xl text-sm text-slate-600",children:j})]}),s.jsx(z,{"data-loc":"client/src/pages/TimeExtensionRequests.tsx:66",href:"/manager",children:s.jsxs(c,{"data-loc":"client/src/pages/TimeExtensionRequests.tsx:66",variant:"outline",children:[s.jsx(M,{"data-loc":"client/src/pages/TimeExtensionRequests.tsx:66",className:"mr-2 h-4 w-4"}),R]})})]}),d&&s.jsx(o,{"data-loc":"client/src/pages/TimeExtensionRequests.tsx:69",children:s.jsxs(l,{"data-loc":"client/src/pages/TimeExtensionRequests.tsx:69",className:"flex items-center justify-center gap-2 py-12 text-slate-500",children:[s.jsx(y,{"data-loc":"client/src/pages/TimeExtensionRequests.tsx:69",className:"h-5 w-5 animate-spin"}),e==="ar"?"جار٠تØÙ
ÙÙ Ø§ÙØ·Ùبات...":"Loading requests..."]})}),!d&&x.length===0&&s.jsx(o,{"data-loc":"client/src/pages/TimeExtensionRequests.tsx:70",children:s.jsxs(l,{"data-loc":"client/src/pages/TimeExtensionRequests.tsx:70",className:"py-16 text-center text-slate-500",children:[s.jsx(h,{"data-loc":"client/src/pages/TimeExtensionRequests.tsx:70",className:"mx-auto mb-3 h-10 w-10 text-emerald-500"}),N]})}),s.jsx("div",{"data-loc":"client/src/pages/TimeExtensionRequests.tsx:72",className:"space-y-4",children:x.map(t=>{const r=E===t.id;return s.jsxs(o,{"data-loc":"client/src/pages/TimeExtensionRequests.tsx:76",className:"border-orange-200 shadow-sm",children:[s.jsx(C,{"data-loc":"client/src/pages/TimeExtensionRequests.tsx:77",className:"pb-3",children:s.jsxs("div",{"data-loc":"client/src/pages/TimeExtensionRequests.tsx:78",className:"flex flex-wrap items-start justify-between gap-3",children:[s.jsxs("div",{"data-loc":"client/src/pages/TimeExtensionRequests.tsx:79",children:[s.jsxs(k,{"data-loc":"client/src/pages/TimeExtensionRequests.tsx:80",className:"flex items-center gap-2 text-lg",children:[s.jsx(I,{"data-loc":"client/src/pages/TimeExtensionRequests.tsx:80",className:"h-5 w-5 text-orange-500"}),t.equipement]}),s.jsxs("p",{"data-loc":"client/src/pages/TimeExtensionRequests.tsx:81",className:"mt-1 text-sm text-slate-500",children:[t.atelier," · ",e==="ar"?"Ø§ÙØªØ¯Ø®Ù رÙÙ
":"Intervention"," #",t.id]})]}),s.jsx("span",{"data-loc":"client/src/pages/TimeExtensionRequests.tsx:83",className:"rounded-full border border-orange-300 bg-orange-50 px-3 py-1 text-xs font-semibold text-orange-700",children:e==="ar"?"Ø¨Ø§ÙØªØ¸Ø§Ø± اÙÙØ±Ø§Ø±":e==="fr"?"En attente":e==="zh"?"å¾
å®¡æ ¸":"Pending decision"})]})}),s.jsxs(l,{"data-loc":"client/src/pages/TimeExtensionRequests.tsx:86",className:"space-y-4",children:[s.jsxs("div",{"data-loc":"client/src/pages/TimeExtensionRequests.tsx:87",className:"grid gap-3 text-sm sm:grid-cols-3",children:[s.jsxs("div",{"data-loc":"client/src/pages/TimeExtensionRequests.tsx:88",className:"rounded-xl bg-slate-100 p-3",children:[s.jsx("p",{"data-loc":"client/src/pages/TimeExtensionRequests.tsx:88",className:"text-xs text-slate-500",children:e==="ar"?"اÙÙÙÙ":e==="fr"?"Technicien":e==="zh"?"ææ¯å":"Technician"}),s.jsx("p",{"data-loc":"client/src/pages/TimeExtensionRequests.tsx:88",className:"mt-1 font-semibold text-slate-800",children:t.assignedToId?`#${t.assignedToId}`:"â"})]}),s.jsxs("div",{"data-loc":"client/src/pages/TimeExtensionRequests.tsx:89",className:"rounded-xl bg-slate-100 p-3",children:[s.jsx("p",{"data-loc":"client/src/pages/TimeExtensionRequests.tsx:89",className:"text-xs text-slate-500",children:e==="ar"?"اÙÙÙØª اÙÙ
ØØ¯Ø¯":e==="fr"?"Durée prévue":e==="zh"?"é¢è®¡æ¶é´":"Planned time"}),s.jsxs("p",{"data-loc":"client/src/pages/TimeExtensionRequests.tsx:89",className:"mt-1 font-semibold text-slate-800",children:[t.estimatedDurationMinutes||0," ",e==="ar"?"دÙÙÙØ©":e==="zh"?"åé":"min"]})]}),s.jsxs("div",{"data-loc":"client/src/pages/TimeExtensionRequests.tsx:90",className:"rounded-xl bg-slate-100 p-3",children:[s.jsx("p",{"data-loc":"client/src/pages/TimeExtensionRequests.tsx:90",className:"text-xs text-slate-500",children:e==="ar"?"اÙÙÙØª اÙÙ
Ø·ÙÙØ¨":e==="fr"?"Temps demandé":e==="zh"?"ç³è¯·å»¶æ¶":"Requested extra time"}),s.jsxs("p",{"data-loc":"client/src/pages/TimeExtensionRequests.tsx:90",className:"mt-1 font-semibold text-orange-700",children:["+",t.timeExtensionMinutes||0," ",e==="ar"?"دÙÙÙØ©":e==="zh"?"åé":"min"]})]})]}),s.jsxs("div",{"data-loc":"client/src/pages/TimeExtensionRequests.tsx:92",className:"rounded-xl border border-orange-100 bg-orange-50/60 p-4 text-sm",children:[s.jsx("p",{"data-loc":"client/src/pages/TimeExtensionRequests.tsx:92",className:"font-semibold text-orange-900",children:e==="ar"?"سبب Ø§ÙØªØ¬Ø§Ùز":e==="fr"?"Cause du dépassement":e==="zh"?"è¶
æ¶åå ":"Overtime reason"}),s.jsx("p",{"data-loc":"client/src/pages/TimeExtensionRequests.tsx:92",className:"mt-1 text-orange-800",children:D(t.timeExtensionReason,e)}),t.timeExtensionNote&&s.jsx("p",{"data-loc":"client/src/pages/TimeExtensionRequests.tsx:92",className:"mt-2 whitespace-pre-wrap text-slate-700",children:t.timeExtensionNote})]}),s.jsxs("p",{"data-loc":"client/src/pages/TimeExtensionRequests.tsx:93",className:"text-xs text-slate-500",children:[e==="ar"?"آخر ØªØØ¯ÙØ«":e==="fr"?"Dernière mise à jour":e==="zh"?"æåæ´æ°":"Last updated",": ",S(t.updatedAt,e)]}),s.jsx(L,{"data-loc":"client/src/pages/TimeExtensionRequests.tsx:94",value:a[t.id]||"",onChange:v=>n(b=>({...b,[t.id]:v.target.value})),placeholder:e==="ar"?"Ù
ÙØ§ØØ¸Ø© اÙÙ
سؤÙ٠عÙ٠اÙÙØ±Ø§Ø±...":e==="fr"?"Note du responsable...":e==="zh"?"è´è´£äººå¤æ³¨...":"Manager decision note...",className:"min-h-20"}),s.jsxs("div",{"data-loc":"client/src/pages/TimeExtensionRequests.tsx:95",className:"flex flex-wrap justify-end gap-2",children:[s.jsxs(c,{"data-loc":"client/src/pages/TimeExtensionRequests.tsx:96",variant:"outline",disabled:r,onClick:()=>{i(t.id),m.mutate({interventionId:t.id,status:"rejected",managerNote:a[t.id],managerName:"Manager"})},className:"border-red-300 text-red-700 hover:bg-red-50",children:[s.jsx(A,{"data-loc":"client/src/pages/TimeExtensionRequests.tsx:96",className:"mr-2 h-4 w-4"}),e==="ar"?"Ø±ÙØ¶ Ø§ÙØ·Ùب":e==="fr"?"Refuser":e==="zh"?"æç»":"Reject"]}),s.jsxs(c,{"data-loc":"client/src/pages/TimeExtensionRequests.tsx:97",disabled:r,onClick:()=>{i(t.id),m.mutate({interventionId:t.id,status:"approved",managerNote:a[t.id],managerName:"Manager"})},className:"bg-emerald-600 hover:bg-emerald-700",children:[s.jsx(h,{"data-loc":"client/src/pages/TimeExtensionRequests.tsx:97",className:"mr-2 h-4 w-4"}),e==="ar"?"اÙÙ
ÙØ§ÙÙØ© ÙØ¥Ø¶Ø§ÙØ© اÙÙÙØª":e==="fr"?"Approuver et ajouter":e==="zh"?"æ¹åå¹¶å¢å æ¶é´":"Approve and add time"]})]})]})]},t.id)})})]})})}export{O 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.