1import{b as re,a as y,u as C,r as d,j as e,Y as oe,Z as me,B as b,_ as ue,$ as he,a0 as pe,a1 as xe,T as ee,t as S,D as Z,C as I,n as w,f as L,h as ce,g as J,d as E,o as ae,v as fe,w as je,A as ye,x as De,N as K,X as de}from"./index-CUCg6Zxa.js";import{I as R}from"./input-DVOpVeNL.js";import{L as u}from"./label-Bkx2rHip.js";import{T as ve}from"./textarea-BuzAFgHC.js";import{C as ge}from"./checkbox-BGiOje3e.js";import{A as se,b as te}from"./alert-B6JDymVo.js";import{S as H,a as P,b as O,c as k,d as T}from"./select-Dg4yzCDt.js";import{l as X,h as le,e as _e,a as Ne}from"./employee-labels-Bh18CJkP.js";import{P as be}from"./pencil-DDLNQ3oW.js";import{C as Ce}from"./cancel-approved-leave-dialog-ownLDaIK.js";import{U as Se}from"./umbrella-CGHveUfv.js";import"./index-DeTWvO78.js";function ie(){const r=re(y.leaveRequests.createLeaveRequest),i=C(y.employees.listEmployeesWithNames),o=C(y.employees.getCurrentEmployee),[m,p]=d.useState(!1),[c,v]=d.useState(""),[n,h]=d.useState(""),[x,g]=d.useState("paid_leave"),[l,q]=d.useState(!1),[a,_]=d.useState("morning"),[V,z]=d.useState(""),[A,M]=d.useState("none"),[F,$]=d.useState(!1),f=!l&&c&&n?((t,N)=>{const s=new Date(t),j=new Date(N);if(j<s)return 0;let U=0;const B=new Date(s);for(;B<=j;){const W=B.getDay();W!==0&&W!==6&&U++,B.setDate(B.getDate()+1)}return U})(c,n):null,Y=C(y.leaveRequests.getLeaveConflicts,c&&n?{startDate:new Date(c).toISOString(),endDate:new Date(n).toISOString()}:"skip"),D=async t=>{t.preventDefault(),$(!0);try{await r({startDate:new Date(c).toISOString(),endDate:l?new Date(c).toISOString():new Date(n).toISOString(),leaveType:x,isHalfDay:l||void 0,halfDayPeriod:l?a:void 0,reason:V||void 0,interimById:A!=="none"?A:void 0}),S.success("Demande de congé créée avec succès"),p(!1),v(""),h(""),g("paid_leave"),q(!1),_("morning"),z(""),M("none")}catch(N){N instanceof Error?S.error(N.message):S.error("Erreur lors de la création de la demande")}finally{$(!1)}};return e.jsxs(oe,{"data-hercules-id":"src/pages/leaves/_components/leave-request-form.tsx:114:4","data-hercules-name":"Dialog",open:m,onOpenChange:p,children:[e.jsx(me,{"data-hercules-id":"src/pages/leaves/_components/leave-request-form.tsx:115:6","data-hercules-name":"DialogTrigger",asChild:!0,children:e.jsx(b,{"data-hercules-id":"src/pages/leaves/_components/leave-request-form.tsx:116:8","data-hercules-name":"Button",children:"Nouvelle demande"})}),e.jsxs(ue,{"data-hercules-id":"src/pages/leaves/_components/leave-request-form.tsx:118:6","data-hercules-name":"DialogContent",className:"sm:max-w-[500px]",children:[e.jsxs(he,{"data-hercules-id":"src/pages/leaves/_components/leave-request-form.tsx:119:8","data-hercules-name":"DialogHeader",children:[e.jsx(pe,{"data-hercules-id":"src/pages/leaves/_components/leave-request-form.tsx:120:10","data-hercules-name":"DialogTitle",children:"Nouvelle demande de congé"}),e.jsx(xe,{"data-hercules-id":"src/pages/leaves/_components/leave-request-form.tsx:121:10","data-hercules-name":"DialogDescription",children:"Remplissez les informations pour créer une demande de congé"})]}),e.jsxs("form",{"data-hercules-id":"src/pages/leaves/_components/leave-request-form.tsx:125:8","data-hercules-name":"form",onSubmit:D,className:"space-y-4",children:[e.jsxs("div",{"data-hercules-id":"src/pages/leaves/_components/leave-request-form.tsx:126:10","data-hercules-name":"div",className:"space-y-2",children:[e.jsx(u,{"data-hercules-id":"src/pages/leaves/_components/leave-request-form.tsx:127:12","data-hercules-name":"Label",htmlFor:"leaveType",children:"Type de congé"}),e.jsxs(H,{"data-hercules-id":"src/pages/leaves/_components/leave-request-form.tsx:128:12","data-hercules-name":"Select",value:x,onValueChange:t=>g(t),children:[e.jsx(P,{"data-hercules-id":"src/pages/leaves/_components/leave-request-form.tsx:129:14","data-hercules-name":"SelectTrigger",id:"leaveType",children:e.jsx(O,{"data-hercules-id":"src/pages/leaves/_components/leave-request-form.tsx:130:16","data-hercules-name":"SelectValue"})}),e.jsx(k,{"data-hercules-id":"src/pages/leaves/_components/leave-request-form.tsx:132:14","data-hercules-name":"SelectContent",children:Object.entries(X).map(([t,N])=>e.jsx(T,{"data-hercules-id":"src/pages/leaves/_components/leave-request-form.tsx:134:18","data-hercules-name":"SelectItem",value:t,children:N},t))})]})]}),e.jsxs("div",{"data-hercules-id":"src/pages/leaves/_components/leave-request-form.tsx:142:10","data-hercules-name":"div",className:"flex items-center space-x-2",children:[e.jsx(ge,{"data-hercules-id":"src/pages/leaves/_components/leave-request-form.tsx:143:12","data-hercules-name":"Checkbox",id:"isHalfDay",checked:l,onCheckedChange:t=>{q(t===!0),t===!0&&h(c)}}),e.jsx(u,{"data-hercules-id":"src/pages/leaves/_components/leave-request-form.tsx:153:12","data-hercules-name":"Label",htmlFor:"isHalfDay",className:"text-sm font-normal cursor-pointer",children:"Demi-journée"})]}),l?e.jsxs("div",{"data-hercules-id":"src/pages/leaves/_components/leave-request-form.tsx:159:12","data-hercules-name":"div",className:"space-y-4",children:[e.jsxs("div",{"data-hercules-id":"src/pages/leaves/_components/leave-request-form.tsx:160:14","data-hercules-name":"div",className:"space-y-2",children:[e.jsx(u,{"data-hercules-id":"src/pages/leaves/_components/leave-request-form.tsx:161:16","data-hercules-name":"Label",htmlFor:"startDate",children:"Date"}),e.jsx(R,{"data-hercules-id":"src/pages/leaves/_components/leave-request-form.tsx:162:16","data-hercules-name":"Input",id:"startDate",type:"date",value:c,onChange:t=>{v(t.target.value),h(t.target.value)},required:!0})]}),e.jsxs("div",{"data-hercules-id":"src/pages/leaves/_components/leave-request-form.tsx:173:14","data-hercules-name":"div",className:"space-y-2",children:[e.jsx(u,{"data-hercules-id":"src/pages/leaves/_components/leave-request-form.tsx:174:16","data-hercules-name":"Label",htmlFor:"halfDayPeriod",children:"Période"}),e.jsxs(H,{"data-hercules-id":"src/pages/leaves/_components/leave-request-form.tsx:175:16","data-hercules-name":"Select",value:a,onValueChange:t=>_(t),children:[e.jsx(P,{"data-hercules-id":"src/pages/leaves/_components/leave-request-form.tsx:176:18","data-hercules-name":"SelectTrigger",id:"halfDayPeriod",children:e.jsx(O,{"data-hercules-id":"src/pages/leaves/_components/leave-request-form.tsx:177:20","data-hercules-name":"SelectValue"})}),e.jsx(k,{"data-hercules-id":"src/pages/leaves/_components/leave-request-form.tsx:179:18","data-hercules-name":"SelectContent",children:Object.entries(le).map(([t,N])=>e.jsx(T,{"data-hercules-id":"src/pages/leaves/_components/leave-request-form.tsx:181:22","data-hercules-name":"SelectItem",value:t,children:N},t))})]})]})]}):e.jsxs("div",{"data-hercules-id":"src/pages/leaves/_components/leave-request-form.tsx:190:12","data-hercules-name":"div",className:"grid gap-4 md:grid-cols-2",children:[e.jsxs("div",{"data-hercules-id":"src/pages/leaves/_components/leave-request-form.tsx:191:14","data-hercules-name":"div",className:"space-y-2",children:[e.jsx(u,{"data-hercules-id":"src/pages/leaves/_components/leave-request-form.tsx:192:16","data-hercules-name":"Label",htmlFor:"startDate",children:"Date de début"}),e.jsx(R,{"data-hercules-id":"src/pages/leaves/_components/leave-request-form.tsx:193:16","data-hercules-name":"Input",id:"startDate",type:"date",value:c,onChange:t=>v(t.target.value),required:!0})]}),e.jsxs("div",{"data-hercules-id":"src/pages/leaves/_components/leave-request-form.tsx:202:14","data-hercules-name":"div",className:"space-y-2",children:[e.jsx(u,{"data-hercules-id":"src/pages/leaves/_components/leave-request-form.tsx:203:16","data-hercules-name":"Label",htmlFor:"endDate",children:"Date de fin"}),e.jsx(R,{"data-hercules-id":"src/pages/leaves/_components/leave-request-form.tsx:204:16","data-hercules-name":"Input",id:"endDate",type:"date",value:n,onChange:t=>h(t.target.value),required:!0})]})]}),Y&&Y.hasConflict&&e.jsxs(se,{"data-hercules-id":"src/pages/leaves/_components/leave-request-form.tsx:216:12","data-hercules-name":"Alert",variant:"destructive",children:[e.jsx(ee,{"data-hercules-id":"src/pages/leaves/_components/leave-request-form.tsx:217:14","data-hercules-name":"AlertTriangleIcon",className:"h-4 w-4"}),e.jsxs(te,{"data-hercules-id":"src/pages/leaves/_components/leave-request-form.tsx:218:14","data-hercules-name":"AlertDescription",children:[e.jsx("strong",{"data-hercules-id":"src/pages/leaves/_components/leave-request-form.tsx:219:16","data-hercules-name":"strong",children:"Attention :"})," ",Y.conflictingCount," personne(s) seront absentes pendant cette période : ",Y.conflictingEmployees.join(", ")
1]})]}),f!==null&&f>0&&e.jsxs("div",{"data-hercules-id":"src/pages/leaves/_components/leave-request-form.tsx:225:12","data-hercules-name":"div",className:"rounded-md bg-muted px-3 py-2 text-sm text-muted-foreground",children:[e.jsx("strong",{"data-hercules-id":"src/pages/leaves/_components/leave-request-form.tsx:226:14","data-hercules-name":"strong",children:f})," jour",f>1?"s":""," ouvrable",f>1?"s":""," sera",f>1?"ont":""," décompté",f>1?"s":""," (weekends exclus)"]}),f!==null&&f===0&&c&&n&&e.jsxs(se,{"data-hercules-id":"src/pages/leaves/_components/leave-request-form.tsx:231:12","data-hercules-name":"Alert",variant:"destructive",children:[e.jsx(ee,{"data-hercules-id":"src/pages/leaves/_components/leave-request-form.tsx:232:14","data-hercules-name":"AlertTriangleIcon",className:"h-4 w-4"}),e.jsx(te,{"data-hercules-id":"src/pages/leaves/_components/leave-request-form.tsx:233:14","data-hercules-name":"AlertDescription",children:"La période sélectionnée ne contient aucun jour ouvrable (lundi-vendredi)."})]}),e.jsxs("div",{"data-hercules-id":"src/pages/leaves/_components/leave-request-form.tsx:239:10","data-hercules-name":"div",className:"space-y-2",children:[e.jsx(u,{"data-hercules-id":"src/pages/leaves/_components/leave-request-form.tsx:240:12","data-hercules-name":"Label",htmlFor:"reason",children:"Motif (optionnel)"}),e.jsx(ve,{"data-hercules-id":"src/pages/leaves/_components/leave-request-form.tsx:241:12","data-hercules-name":"Textarea",id:"reason",placeholder:"Expliquez brièvement le motif de votre demande...",rows:3,value:V,onChange:t=>z(t.target.value)})]}),e.jsxs("div",{"data-hercules-id":"src/pages/leaves/_components/leave-request-form.tsx:250:10","data-hercules-name":"div",className:"space-y-2",children:[e.jsx(u,{"data-hercules-id":"src/pages/leaves/_components/leave-request-form.tsx:251:12","data-hercules-name":"Label",htmlFor:"interimById",children:"Personne assurant l'intérim (optionnel)"}),e.jsxs(H,{"data-hercules-id":"src/pages/leaves/_components/leave-request-form.tsx:252:12","data-hercules-name":"Select",value:A,onValueChange:t=>M(t),children:[e.jsx(P,{"data-hercules-id":"src/pages/leaves/_components/leave-request-form.tsx:253:14","data-hercules-name":"SelectTrigger",id:"interimById",children:e.jsx(O,{"data-hercules-id":"src/pages/leaves/_components/leave-request-form.tsx:254:16","data-hercules-name":"SelectValue",placeholder:"Sélectionnez un employé"})}),e.jsxs(k,{"data-hercules-id":"src/pages/leaves/_components/leave-request-form.tsx:256:14","data-hercules-name":"SelectContent",children:[e.jsx(T,{"data-hercules-id":"src/pages/leaves/_components/leave-request-form.tsx:257:16","data-hercules-name":"SelectItem",value:"none",children:"Aucun"}),i?.map(t=>t.employeeId===o?.employee?._id?null:e.jsx(T,{"data-hercules-id":"src/pages/leaves/_components/leave-request-form.tsx:262:20","data-hercules-name":"SelectItem",value:t.employeeId,children:t.firstName&&t.lastName?`${t.firstName} ${t.lastName}`:t.userName||t.userEmail},t.employeeId))]})]})]}),e.jsxs("div",{"data-hercules-id":"src/pages/leaves/_components/leave-request-form.tsx:273:10","data-hercules-name":"div",className:"flex gap-3 justify-end",children:[e.jsx(b,{"data-hercules-id":"src/pages/leaves/_components/leave-request-form.tsx:274:12","data-hercules-name":"Button",type:"button",variant:"secondary",onClick:()=>p(!1),disabled:F,children:"Annuler"}),e.jsx(b,{"data-hercules-id":"src/pages/leaves/_components/leave-request-form.tsx:277:12","data-hercules-name":"Button",type:"submit",disabled:F,children:F?"En cours...":"Créer la demande"})]})]})]})]})}function Ie({request:r}){const i=re(y.leaveRequests.updateLeaveRequest),o=C(y.employees.listEmployeesWithNames),m=C(y.employees.getCurrentEmployee),[p,c]=d.useState(!1),v=s=>new Date(s).toISOString().split("T")[0],[n,h]=d.useState(v(r.startDate)),[x,g]=d.useState(v(r.endDate)),[l,q]=d.useState(r.leaveType),[a,_]=d.useState(r.isHalfDay??!1),[V,z]=d.useState(r.halfDayPeriod??"morning"),[A,M]=d.useState(r.reason??""),[F,$]=d.useState(r.interimById??"none"),[G,f]=d.useState(!1),D=!a&&n&&x?((s,j)=>{const U=new Date(s),B=new Date(j);if(B<U)return 0;let W=0;const Q=new Date(U);for(;Q<=B;){const ne=Q.getDay();ne!==0&&ne!==6&&W++,Q.setDate(Q.getDate()+1)}return W})(n,x):null,t=async s=>{s.preventDefault(),f(!0);try{await i({requestId:r._id,startDate:new Date(n).toISOString(),endDate:a?new Date(n).toISOString():new Date(x).toISOString(),leaveType:l,isHalfDay:a||void 0,halfDayPeriod:a?V:void 0,reason:A||void 0,interimById:F!=="none"?F:void 0}),S.success("Demande modifiée avec succès"),c(!1)}catch(j){j instanceof Error?S.error(j.message):S.error("Erreur lors de la modification")}finally{f(!1)}},N=s=>{s&&(h(v(r.startDate)),g(v(r.endDate)),q(r.leaveType),_(r.isHalfDay??!1),z(r.halfDayPeriod??"morning"),M(r.reason??""),$(r.interimById??"none")),c(s)};return e.jsxs(oe,{"data-hercules-id":"src/pages/leaves/_components/leave-edit-form.tsx:129:4","data-hercules-name":"Dialog",open:p,onOpenChange:N,children:[e.jsx(me,{"data-hercules-id":"src/pages/leaves/_components/leave-edit-form.tsx:130:6","data-hercules-name":"DialogTrigger",asChild:!0,children:e.jsx(b,{"data-hercules-id":"src/pages/leaves/_components/leave-edit-form.tsx:131:8","data-hercules-name":"Button",variant:"ghost",size:"sm",className:"cursor-pointer",children:e.jsx(be,{"data-hercules-id":"src/pages/leaves/_components/leave-edit-form.tsx:132:10","data-hercules-name":"PencilIcon",className:"h-4 w-4"})})}),e.jsxs(ue,{"data-hercules-id":"src/pages/leaves/_components/leave-edit-form.tsx:135:6","data-hercules-name":"DialogContent",className:"sm:max-w-[500px]",children:[e.jsxs(he,{"data-hercules-id":"src/pages/leaves/_components/leave-edit-form.tsx:136:8","data-hercules-name":"DialogHeader",children:[e.jsx(pe,{"data-hercules-id":"src/pages/leaves/_components/leave-edit-form.tsx:137:10","data-hercules-name":"DialogTitle",children:"Modifier la demande de congé"}),e.jsx(xe,{"data-hercules-id":"src/pages/leaves/_components/leave-edit-form.tsx:138:10","data-hercules-name":"DialogDescription",children:"Vous pouvez modifier votre demande tant qu'elle n'a pas été validée"})]}),e.jsxs("form",{"data-hercules-id":"src/pages/leaves/_components/leave-edit-form.tsx:142:8","data-hercules-name":"form",onSubmit:t,className:"space-y-4",children:[e.jsxs("div",{"data-hercules-id":"src/pages/leaves/_components/leave-edit-form.tsx:143:10","data-hercules-name":"div",className:"space-y-2",children:[e.jsx(u,{"data-hercules-id":"src/pages/leaves/_components/leave-edit-form.tsx:144:12","data-hercules-name":"Label",htmlFor:"edit-leaveType",children:"Type de congé"}),e.jsxs(H,{"data-hercules-id":"src/pages/leaves/_components/leave-edit-form.tsx:145:12","data-hercules-name":"Select",value:l,onValueChange:s=>q(s),children:[e.jsx(P,{"data-hercules-id":"src/pages/leaves/_components/leave-edit-form.tsx:146:14","data-hercules-name":"SelectTrigger",id:"edit-leaveType",children:e.jsx(O,{"data-hercules-id":"src/pages/leaves/_components/leave-edit-form.tsx:147:16","data-hercules-name":"SelectValue"})}),e.jsx(k,{"data-hercules-id":"src/pages/leaves/_components/leave-edit-form.tsx:149:14","data-hercules-name":"SelectContent",children:Object.entries(X).map(([s,j])=>e.jsx(T,{"data-hercules-id":"src/pages/leaves/_components/leave-edit-form.tsx:151:18","data-hercules-name":"SelectItem",value:s,children:j},s))})]})]}),e.jsxs("div",{"data-hercules-id":"src/pages/leaves/_components/leave-edit-form.tsx:159:10","data-hercules-name":"div",className:"flex items-center space-x-2",children:[e.jsx(ge,{"data-hercules-id":"src/pages/leaves/_components/leave-edit-form.tsx:160:12","data-hercules-name":"Checkbox",id:"edit-isHalfDay",checked:a,onCheckedChange:s=>{_(s===!0),s===!0&&g(n)}}),e.jsx(u,{"data-hercules-id":"src/pages/leaves/_components/leave-edit-form.tsx:170:12","data-hercules-name":"Label",htmlFor:"edit-isHalfDay",className:"text-sm font-normal cursor-pointer",children:"Demi-journée"})]}),a?e.jsxs("div",{"data-hercules-id":"src/pages/leaves/_components/leave-edit-form.tsx:176:12","data-hercules-name":"div",className:"space-y-4",children:[e.jsxs("div",{"data-hercules-id":"src/pages/leaves/_components/leave-edit-form.tsx:177:14","data-hercules-name":"div",className:"space-y-2",children:[e.jsx(u,{"data-hercules-id":"src/pages/leaves/_components/leave-edit-form.tsx:178:16","data-hercules-name":"Label",htmlFor:"edit-startDate",children:"Date"}),e.jsx(R,{"data-hercules-id":"src/pages/leaves/_components/leave-edit-form.tsx:179:16","data-hercules-name":"Input",id:"edit-startDate",type:"date",value:n,onChange:s=>{h(s.target.value),g(s.target.value)},required:!0})]}),e.jsxs("div",{"data-hercules-id":"src/pages/leaves/_components/leave-edit-form.tsx:190:14","data-hercules-name":"div",className:"space-y-2",children:[e.jsx(u,{"data-hercules-id":"src/pages/leaves/_components/leave-edit-form.tsx:191:16","data-hercules-name":"Label",htmlFor:"edit-halfDayPeriod",children:"Période"}),e.jsxs(H,{"data-hercules-id":"src/pages/leaves/_components/leave-edit-form.tsx:192:16","data-hercules-name":"Select",value:V,onValueChange:s=>
1z(s),children:[e.jsx(P,{"data-hercules-id":"src/pages/leaves/_components/leave-edit-form.tsx:193:18","data-hercules-name":"SelectTrigger",id:"edit-halfDayPeriod",children:e.jsx(O,{"data-hercules-id":"src/pages/leaves/_components/leave-edit-form.tsx:194:20","data-hercules-name":"SelectValue"})}),e.jsx(k,{"data-hercules-id":"src/pages/leaves/_components/leave-edit-form.tsx:196:18","data-hercules-name":"SelectContent",children:Object.entries(le).map(([s,j])=>e.jsx(T,{"data-hercules-id":"src/pages/leaves/_components/leave-edit-form.tsx:198:22","data-hercules-name":"SelectItem",value:s,children:j},s))})]})]})]}):e.jsxs("div",{"data-hercules-id":"src/pages/leaves/_components/leave-edit-form.tsx:207:12","data-hercules-name":"div",className:"grid gap-4 md:grid-cols-2",children:[e.jsxs("div",{"data-hercules-id":"src/pages/leaves/_components/leave-edit-form.tsx:208:14","data-hercules-name":"div",className:"space-y-2",children:[e.jsx(u,{"data-hercules-id":"src/pages/leaves/_components/leave-edit-form.tsx:209:16","data-hercules-name":"Label",htmlFor:"edit-startDate",children:"Date de début"}),e.jsx(R,{"data-hercules-id":"src/pages/leaves/_components/leave-edit-form.tsx:210:16","data-hercules-name":"Input",id:"edit-startDate",type:"date",value:n,onChange:s=>h(s.target.value),required:!0})]}),e.jsxs("div",{"data-hercules-id":"src/pages/leaves/_components/leave-edit-form.tsx:218:14","data-hercules-name":"div",className:"space-y-2",children:[e.jsx(u,{"data-hercules-id":"src/pages/leaves/_components/leave-edit-form.tsx:219:16","data-hercules-name":"Label",htmlFor:"edit-endDate",children:"Date de fin"}),e.jsx(R,{"data-hercules-id":"src/pages/leaves/_components/leave-edit-form.tsx:220:16","data-hercules-name":"Input",id:"edit-endDate",type:"date",value:x,onChange:s=>g(s.target.value),required:!0})]})]}),D!==null&&D>0&&e.jsxs("div",{"data-hercules-id":"src/pages/leaves/_components/leave-edit-form.tsx:232:12","data-hercules-name":"div",className:"rounded-md bg-muted px-3 py-2 text-sm text-muted-foreground",children:[e.jsx("strong",{"data-hercules-id":"src/pages/leaves/_components/leave-edit-form.tsx:233:14","data-hercules-name":"strong",children:D})," jour",D>1?"s":""," ouvrable",D>1?"s":""," sera",D>1?"ont":""," décompté",D>1?"s":""," (weekends exclus)"]}),D!==null&&D===0&&n&&x&&e.jsxs(se,{"data-hercules-id":"src/pages/leaves/_components/leave-edit-form.tsx:238:12","data-hercules-name":"Alert",variant:"destructive",children:[e.jsx(ee,{"data-hercules-id":"src/pages/leaves/_components/leave-edit-form.tsx:239:14","data-hercules-name":"AlertTriangleIcon",className:"h-4 w-4"}),e.jsx(te,{"data-hercules-id":"src/pages/leaves/_components/leave-edit-form.tsx:240:14","data-hercules-name":"AlertDescription",children:"La période sélectionnée ne contient aucun jour ouvrable (lundi-vendredi)."})]}),e.jsxs("div",{"data-hercules-id":"src/pages/leaves/_components/leave-edit-form.tsx:246:10","data-hercules-name":"div",className:"space-y-2",children:[e.jsx(u,{"data-hercules-id":"src/pages/leaves/_components/leave-edit-form.tsx:247:12","data-hercules-name":"Label",htmlFor:"edit-reason",children:"Motif (optionnel)"}),e.jsx(ve,{"data-hercules-id":"src/pages/leaves/_components/leave-edit-form.tsx:248:12","data-hercules-name":"Textarea",id:"edit-reason",placeholder:"Expliquez brièvement le motif de votre demande...",rows:3,value:A,onChange:s=>M(s.target.value)})]}),e.jsxs("div",{"data-hercules-id":"src/pages/leaves/_components/leave-edit-form.tsx:257:10","data-hercules-name":"div",className:"space-y-2",children:[e.jsx(u,{"data-hercules-id":"src/pages/leaves/_components/leave-edit-form.tsx:258:12","data-hercules-name":"Label",htmlFor:"edit-interimById",children:"Personne assurant l'intérim (optionnel)"}),e.jsxs(H,{"data-hercules-id":"src/pages/leaves/_components/leave-edit-form.tsx:259:12","data-hercules-name":"Select",value:F,onValueChange:s=>$(s),children:[e.jsx(P,{"data-hercules-id":"src/pages/leaves/_components/leave-edit-form.tsx:260:14","data-hercules-name":"SelectTrigger",id:"edit-interimById",children:e.jsx(O,{"data-hercules-id":"src/pages/leaves/_components/leave-edit-form.tsx:261:16","data-hercules-name":"SelectValue",placeholder:"Sélectionnez un employé"})}),e.jsxs(k,{"data-hercules-id":"src/pages/leaves/_components/leave-edit-form.tsx:263:14","data-hercules-name":"SelectContent",children:[e.jsx(T,{"data-hercules-id":"src/pages/leaves/_components/leave-edit-form.tsx:264:16","data-hercules-name":"SelectItem",value:"none",children:"Aucun"}),o?.map(s=>s.employeeId===m?.employee?._id?null:e.jsx(T,{"data-hercules-id":"src/pages/leaves/_components/leave-edit-form.tsx:268:20","data-hercules-name":"SelectItem",value:s.employeeId,children:s.firstName&&s.lastName?`${s.firstName} ${s.lastName}`:s.userName||s.userEmail},s.employeeId))]})]})]}),e.jsxs("div",{"data-hercules-id":"src/pages/leaves/_components/leave-edit-form.tsx:279:10","data-hercules-name":"div",className:"flex gap-3 justify-end",children:[e.jsx(b,{"data-hercules-id":"src/pages/leaves/_components/leave-edit-form.tsx:280:12","data-hercules-name":"Button",type:"button",variant:"secondary",onClick:()=>c(!1),disabled:G,children:"Annuler"}),e.jsx(b,{"data-hercules-id":"src/pages/leaves/_components/leave-edit-form.tsx:283:12","data-hercules-name":"Button",type:"submit",disabled:G,children:G?"En cours...":"Enregistrer les modifications"})]})]})]})]})}
1function we(){const r=new Date,[i,o]=d.useState(r.getMonth()),[m,p]=d.useState(r.getFullYear()),c=new Date(m,i,1).toISOString(),v=new Date(m,i+1,0).toISOString(),n=C(y.leaveRequests.getLeaveCalendar,{startDate:c,endDate:v}),h=()=>{i===0?(o(11),p(m-1)):o(i-1)},x=()=>{i===11?(o(0),p(m+1)):o(i+1)},g=["Janvier","Février","Mars","Avril","Mai","Juin","Juillet","Août","Septembre","Octobre","Novembre","Décembre"];return n?e.jsxs(I,{"data-hercules-id":"src/pages/leaves/_components/leave-calendar.tsx:53:4","data-hercules-name":"Card",children:[e.jsx(w,{"data-hercules-id":"src/pages/leaves/_components/leave-calendar.tsx:54:6","data-hercules-name":"CardHeader",children:e.jsxs("div",{"data-hercules-id":"src/pages/leaves/_components/leave-calendar.tsx:55:8","data-hercules-name":"div",className:"flex items-center justify-between",children:[e.jsxs("div",{"data-hercules-id":"src/pages/leaves/_components/leave-calendar.tsx:56:10","data-hercules-name":"div",children:[e.jsxs(L,{"data-hercules-id":"src/pages/leaves/_components/leave-calendar.tsx:57:12","data-hercules-name":"CardTitle",className:"flex items-center gap-2",children:[e.jsx(ce,{"data-hercules-id":"src/pages/leaves/_components/leave-calendar.tsx:58:14","data-hercules-name":"CalendarIcon",className:"h-5 w-5"}),"Calendrier d'équipe"]}),e.jsx(J,{"data-hercules-id":"src/pages/leaves/_components/leave-calendar.tsx:61:12","data-hercules-name":"CardDescription",children:"Absences planifiées de l'équipe"})]}),e.jsxs("div",{"data-hercules-id":"src/pages/leaves/_components/leave-calendar.tsx:63:10","data-hercules-name":"div",className:"flex items-center gap-2",children:[e.jsx(b,{"data-hercules-id":"src/pages/leaves/_components/leave-calendar.tsx:64:12","data-hercules-name":"Button",variant:"ghost",size:"sm",onClick:h,children:"â Précédent"}),e.jsxs("span",{"data-hercules-id":"src/pages/leaves/_components/leave-calendar.tsx:67:12","data-hercules-name":"span",className:"font-medium text-sm",children:[g[i]," ",m]}),e.jsx(b,{"data-hercules-id":"src/pages/leaves/_components/leave-calendar.tsx:70:12","data-hercules-name":"Button",variant:"ghost",size:"sm",onClick:x,children:"Suivant â"})]})]})}),e.jsx(E,{"data-hercules-id":"src/pages/leaves/_components/leave-calendar.tsx:76:6","data-hercules-name":"CardContent",children:n.length===0?e.jsxs("div",{"data-hercules-id":"src/pages/leaves/_components/leave-calendar.tsx:78:10","data-hercules-name":"div",className:"text-center py-12 text-muted-foreground",children:[e.jsx(ce,{"data-hercules-id":"src/pages/leaves/_components/leave-calendar.tsx:79:12","data-hercules-name":"CalendarIcon",className:"h-12 w-12 mx-auto mb-4 opacity-50"}),e.jsx("p",{"data-hercules-id":"src/pages/leaves/_components/leave-calendar.tsx:80:12","data-hercules-name":"p",children:"Aucune absence planifiée ce mois-ci"})]}):e.jsx("div",{"data-hercules-id":"src/pages/leaves/_components/leave-calendar.tsx:83:10","data-hercules-name":"div",className:"space-y-3",children:n.map(l=>e.jsx("div",{"data-hercules-id":"src/pages/leaves/_components/leave-calendar.tsx:85:14","data-hercules-name":"div",className:"flex items-start justify-between p-3 border rounded-lg bg-muted/30",children:e.jsxs("div",{"data-hercules-id":"src/pages/leaves/_components/leave-calendar.tsx:89:16","data-hercules-name":"div",className:"flex-1",children:[e.jsxs("div",{"data-hercules-id":"src/pages/leaves/_components/leave-calendar.tsx:90:18","data-hercules-name":"div",className:"flex items-center gap-2 mb-1",children:[e.jsx("span",{"data-hercules-id":"src/pages/leaves/_components/leave-calendar.tsx:91:20","data-hercules-name":"span",className:"font-medium",children:l.employeeName}),e.jsx(ae,{"data-hercules-id":"src/pages/leaves/_components/leave-calendar.tsx:92:20","data-hercules-name":"Badge",variant:"secondary",className:"text-xs",children:_e[l.employeeType]})]}),e.jsxs("div",{"data-hercules-id":"src/pages/leaves/_components/leave-calendar.tsx:96:18","data-hercules-name":"div",className:"flex items-center gap-2 text-sm text-muted-foreground",children:[e.jsx("span",{"data-hercules-id":"src/pages/leaves/_components/leave-calendar.tsx:97:20","data-hercules-name":"span",children:X[l.leaveType]}),e.jsx("span",{"data-hercules-id":"src/pages/leaves/_components/leave-calendar.tsx:100:20","data-hercules-name":"span",children:"â¢"}),e.jsx("span",{"data-hercules-id":"src/pages/leaves/_components/leave-calendar.tsx:101:20","data-hercules-name":"span",children:l.isHalfDay?e.jsxs(e.Fragment,{children:[new Date(l.startDate).toLocaleDateString("fr-FR",{day:"numeric",month:"short"})," (",l.halfDayPeriod==="morning"?"matin":"après-midi",")"]}):e.jsxs(e.Fragment,{children:[new Date(l.startDate).toLocaleDateString("fr-FR",{day:"numeric",month:"short"})," ","au"," ",new Date(l.endDate).toLocaleDateString("fr-FR",{day:"numeric",month:"short"})]})}),e.jsx("span",{"data-hercules-id":"src/pages/leaves/_components/leave-calendar.tsx:123:20","data-hercules-name":"span",children:"â¢"}),e.jsxs("span",{"data-hercules-id":"src/pages/leaves/_components/leave-calendar.tsx:124:20","data-hercules-name":"span",className:"font-medium",children:[l.numberOfDays," jour",l.numberOfDays>1?"s":""]})]})]})},l._id))})})]}):e.jsx(Z,{"data-hercules-id":"src/pages/leaves/_components/leave-calendar.tsx:49:11","data-hercules-name":"Skeleton",className:"h-96 w-full"})}function Le({interimById:r}){const o=C(y.employees.listEmployeesWithNames)?.find(p=>p.employeeId===r);if(!o)return null;const m=o.firstName&&o.lastName?`${o.firstName} ${o.lastName}`:o.userName||o.userEmail;return e.jsxs("p",{"data-hercules-id":"src/pages/leaves/page.tsx:31:4","data-hercules-name":"p",className:"text-sm text-muted-foreground mb-2",children:[e.jsx("strong",{"data-hercules-id":"src/pages/leaves/page.tsx:32:6","data-hercules-name":"strong",children:"Intérim assuré par :"})," ",m]})}function Te(){const r=C(y.employees.getCurrentEmployee),i=C(y.leaveRequests.getMyLeaveRequests),o=re(y.leaveRequests.cancelLeaveRequest),[m,p]=d.useState(null);if(!r||!i)return e.jsxs("div",{"data-hercules-id":"src/pages/leaves/page.tsx:68:6","data-hercules-name":"div",className:"container mx-auto px-4 py-8 space-y-6 max-w-6xl",children:[e.jsx(Z,{"data-hercules-id":"src/pages/leaves/page.tsx:69:8","data-hercules-name":"Skeleton",className:"h-32 w-full"}),e.jsx(Z,{"data-hercules-id":"src/pages/leaves/page.tsx:70:8","data-hercules-name":"Skeleton",className:"h-96 w-full"})]});const{employee:c}=r;if(!c)return e.jsx("div",{"data-hercules-id":"src/pages/leaves/page.tsx:79:6","data-hercules-name":"div",className:"flex-1 bg-background",children:e.jsx("div",{"data-hercules-id":"src/pages/leaves/page.tsx:80:8","data-hercules-name":"div",className:"container mx-auto px-4 py-8 max-w-6xl",children:e.jsx(I,{"data-hercules-id":"src/pages/leaves/page.tsx:81:10","data-hercules-name":"Card",children:e.jsxs(w,{"data-hercules-id":"src/pages/leaves/page.tsx:82:12","data-hercules-name":"CardHeader",children:[e.jsx(L,{"data-hercules-id":"src/pages/leaves/page.tsx:83:14","data-hercules-name":"CardTitle",children:"Profil incomplet"}),e.jsx(J,{"data-hercules-id":"src/pages/leaves/page.tsx:84:14","data-hercules-name":"CardDescription",children:"Veuillez compléter votre profil pour accéder à la gestion des congés"})]})})})});const v=new Date(c.startDate),n=new Date,h=new Date(v);h.setFullYear(h.getFullYear()+1);const x=n>=h,g=h.toLocaleDateString("fr-FR",{day:"numeric",month:"long",year:"numeric"}),l={pending:"bg-yellow-500",approved:"bg-green-500",rejected:"bg-red-500",cancelled:"bg-gray-500"},q=async a=>{try{await o({requestId:a}),S.success("Demande annulée avec succès")}catch(_){_ instanceof Error?S.error(_.message):S.error("Erreur lors de l'annulation")}};return e.jsxs("div",{"data-hercules-id":"src/pages/leaves/page.tsx:127:4","data-hercules-name":"div",className:"flex-1 bg-background",children:[e.jsxs("div",{"data-hercules-id":"src/pages/leaves/page.tsx:128:6","data-hercules-name":"div",className:"container mx-auto px-4 py-8 space-y-6 max-w-6xl",children:[e.jsxs("div",{"data-hercules-id":"src/pages/leaves/page.tsx:130:6","data-hercules-name":"div",className:"flex items-center justify-between",children:[e.jsxs("div",{"data-hercules-id":"src/pages/leaves/page.tsx:131:8","data-hercules-name":"div",children:[e.jsx("h1",{"data-hercules-id":"src/pages/leaves/page.tsx:132:10","data-hercules-name":"h1",className:"text-3xl font-bold tracking-tight",children:"Mes Congés"}),e.jsx("p",{"data-hercules-id":"src/pages/leaves/page.tsx:133:10","data-hercules-name":"p",className:"text-muted-foreground",children:"Gérez vos demandes de congés et consultez votre solde"})]}),e.jsx(ie,{"data-hercules-id":"src/pages/leaves/page.tsx:137:8","data-hercules-name":"LeaveRequestForm"})]}),!x&&e.jsx(I,{"data-hercules-id":"src/pages/leaves/page.tsx:142:8","data-hercules-name":"Card",className:"border-amber-200 bg-amber-50",children:e.jsxs(w,{"data-hercules-id":"src/pages/leaves/page.tsx:143:10","data-hercules-name":"CardHeader",children:[e.jsx(L,{"data-hercules-id":"src/pages/leaves/page.tsx:144:12","data-hercules-name":"CardTitle",className:"text-amber-900",children:"Droits aux congés non acquis"}),e.jsxs(J,{"data-hercules-id":"src/pages/leaves/page.tsx:145:12","data-hercules-name":"CardDescription",className:"text-amber-700",children:["Les droits aux congés payés sont acquis après 1 an d'ancienneté au sein du cabinet.",e.jsx("br",{"data-hercules-id":"src/pages/leaves/page.tsx:147:14","data-hercules-name":"br"}),e.jsxs("strong",{"data-hercules-id":"src/pages/leaves/page.tsx:148:14","data-hercules-name":"strong",children:["Vos droits seront disponibles à partir du ",g,"."]}),e.jsx("br",{"data-hercules-id":"src/pages/leaves/page.tsx:149:14","data-hercules-name":"br"}),e.jsx("span",{"data-hercules-id":"src/pages/leaves/page.tsx:150:14","data-hercules-name":"span",className:"text-sm mt-2 inline-block",children:"Vous pouvez néanmoins demander d'autres types de congés (maladie, sans solde, exceptionnel, etc.)."})]})]})}),e.jsxs("div",{"data-hercules-id":"src/pages/leaves/page.tsx:159:6","data-hercules-name":"div",className:"grid gap-4 md:grid-cols-3",children:[e.jsxs(I,{"data-hercules-id":"src/pages/leaves/page.tsx:160:8","data-hercules-name":"Card",children:[e.jsxs(w,{"data-hercules-id":"src/pages/leaves/page.tsx:161:10","data-hercules-name":"CardHeader",className:"flex flex-row items-center space-y-0 pb-2",children:[e.jsx(Se,{"data-hercules-id":"src/pages/leaves/page.tsx:162:12","data-hercules-name":"UmbrellaIcon",className:"h-5 w-5 text-muted-foreground mr-2"}),e.jsx(L,{"data-hercules-id":"src/pages/leaves/page.tsx:163:12","data-hercules-name":"CardTitle",className:"text-sm font-medium",children:"Jours disponibles"})]}),e.jsxs(E,{"data-hercules-id":"src/pages/leaves/page.tsx:165:10","data-hercules-name":"CardContent",children:[e.jsx("div",{"data-hercules-id":"src/pages/leaves/page.tsx:166:12","data-hercules-name":"div",className:"text-2xl font-bold",children:c.remainingLeaveDays}),e.jsxs("p",{"data-hercules-id":"src/pages/leaves/page.tsx:167:12","data-hercules-name":"p",className:"text-xs text-muted-foreground mt-1",children:["sur ",c.annualLeaveDays," jours annuels"]}),!x&&e.jsxs("p",{"data-hercules-id":"src/pages/leaves/page.tsx:171:14","data-hercules-name":"p",className:"text-xs text-amber-600 mt-1",children:["Disponibles à partir du ",g]})]})]}),e.jsxs(I,{"data-hercules-id":"src/pages/leaves/page.tsx:178:8","data-hercules-name":"Card",children:[e.jsxs(w,{"data-hercules-id":"src/pages/leaves/page.tsx:179:10","data-hercules-name":"CardHeader",className:"flex flex-row items-center space-y-0 pb-2",children:[e.jsx(K,{"data-hercules-id":"src/pages/leaves/page.tsx:180:12","data-hercules-name":"CalendarDaysIcon",className:"h-5 w-5 text-muted-foreground mr-2"}),e.jsx(L,{"data-hercules-id":"src/pages/leaves/page.tsx:181:12","data-hercules-name":"CardTitle",className:"text-sm font-medium",children:"En attente"})]}),e.jsxs(E,{"data-hercules-id":"src/pages/leaves/page.tsx:183:10","data-hercules-name":"CardContent",children:[e.jsx("div",{"data-hercules-id":"src/pages/leaves/page.tsx:184:12","data-hercules-name":"div",className:"text-2xl font-bold",children:i.filter(a=>a.status==="pending").length}),e.jsx("p",{"data-hercules-id":"src/pages/leaves/page.tsx:187:12","data-hercules-name":"p",className:"text-xs text-muted-foreground mt-1",children:"demandes"})]})]}),e.jsxs(I,{"data-hercules-id":"src/pages/leaves/page.tsx:191:8","data-hercules-name":"Card",children:[e.jsxs(w,{"data-hercules-id":"src/pages/leaves/page.tsx:192:10","data-hercules-name":"CardHeader",className:"flex flex-row items-center space-y-0 pb-2",children:[e.jsx(K,{"data-hercules-id":"src/pages/leaves/page.tsx:193:12","data-hercules-name":"CalendarDaysIcon",className:"h-5 w-5 text-muted-foreground mr-2"}),e.jsx(L,{"data-hercules-id":"src/pages/leaves/page.tsx:194:12","data-hercules-name":"CardTitle",className:"text-sm font-medium",children:"Approuvés"})]}),e.jsxs(E,{"data-hercules-id":"src/pages/leaves/page.tsx:196:10","data-hercules-name":"CardContent",children:[e.jsx("div",{"data-hercules-id":"src/pages/leaves/page.tsx:197:12","data-hercules-name":"div",className:"text-2xl font-bold",children:i.filter(a=>a.status==="approved").reduce((a,_)=>a+_.numberOfDays,0)}),e.jsx("p",{"data-hercules-id":"src/pages/leaves/page.tsx:200:12","data-hercules-name":"p",className:"text-xs text-muted-foreground mt-1",children:"jours cette année"})]})]})]}),e.jsx(we,{"data-hercules-id":"src/pages/leaves/page.tsx:206:6","data-hercules-name":"LeaveCalendar"}),e.jsxs(I,{"data-hercules-id":"src/pages/leaves/page.tsx:209:6","data-hercules-name":"Card",children:[e.jsxs(w,{"data-hercules-id":"src/pages/leaves/page.tsx:210:8","data-hercules-name":"CardHeader",children:[e.jsx(L,{"data-hercules-id":"src/pages/leaves/page.tsx:211:10","data-hercules-name":"CardTitle",children:"Mes demandes"}),e.jsx(J,{"data-hercules-id":"src/pages/leaves/page.tsx:212:10","data-hercules-name":"CardDescription",children:"Historique de vos demandes de congés"})]}),e.jsx(E,{"data-hercules-id":"src/pages/leaves/page.tsx:214:8","data-hercules-name":"CardContent",children:i.length===0?e.jsxs("div",{"data-hercules-id":"src/pages/leaves/page.tsx:216:12","data-hercules-name":"div",className:"text-center py-12",children:[e.jsx(K,{"data-hercules-id":"src/pages/leaves/page.tsx:217:14","data-hercules-name":"CalendarDaysIcon",className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),e.jsx("h3",{"data-hercules-id":"src/pages/leaves/page.tsx:218:14","data-hercules-name":"h3",className:"text-lg font-medium mb-2",children:"Aucune demande"}),e.jsx("p",{"data-hercules-id":"src/pages/leaves/page.tsx:219:14","data-hercules-name":"p",className:"text-sm text-muted-foreground mb-4",children:"Vous n'avez pas encore fait de demande de congé"}),e.jsx(ie,{"data-hercules-id":"src/pages/leaves/page.tsx:222:14","data-hercules-name":"LeaveRequestForm"})]}):e.jsx("div",{"data-hercules-id":"src/pages/leaves/page.tsx:225:12","data-hercules-name":"div",className:"space-y-4",children:i.map(a=>e.jsxs("div",{"data-hercules-id":"src/pages/leaves/page.tsx:227:16","data-hercules-name":"div",className:"flex items-start justify-between p-4 border rounded-lg",children:[e.jsxs("div",{"data-hercules-id":"src/pages/leaves/page.tsx:231:18","data-hercules-name":"div",className:"flex-1",children:[e.jsxs("div",{"data-hercules-id":"src/pages/leaves/page.tsx:232:20","data-hercules-name":"div",className:"flex items-center gap-2 mb-2",children:[e.jsx(ae,{"data-hercules-id":"src/pages/leaves/page.tsx:233:22","data-hercules-name":"Badge",className:l[a.status],children:Ne[a.status]}),e.jsx("span",{"data-hercules-id":"src/pages/leaves/page.tsx:236:22","data-hercules-name":"span",className:"text-sm font-medium",children:X[a.leaveType]}),a.isHalfDay&&a.halfDayPeriod&&e.jsx(ae,{"data-hercules-id":"src/pages/leaves/page.tsx:240:24","data-hercules-name":"Badge",variant:"secondary",children:le[a.halfDayPeriod]})]}),e.jsx("p",{"data-hercules-id":"src/pages/leaves/page.tsx:245:20","data-hercules-name":"p",className:"text-sm text-muted-foreground mb-1",children:a.isHalfDay?e.jsxs(e.Fragment,{children:["Le"," ",new Date(a.startDate).toLocaleDateString("fr-FR",{day:"numeric",month:"long",year:"numeric"})]}):e.jsxs(e.Fragment,{children:["Du"," ",new Date(a.startDate).toLocaleDateString("fr-FR",{day:"numeric",month:"long",year:"numeric"})," ","au",
1" ",new Date(a.endDate).toLocaleDateString("fr-FR",{day:"numeric",month:"long",year:"numeric"})]})}),e.jsxs("p",{"data-hercules-id":"src/pages/leaves/page.tsx:272:20","data-hercules-name":"p",className:"text-sm font-medium mb-2",children:[a.numberOfDays," jour",a.numberOfDays>1?"s":""]}),a.reason&&e.jsxs("p",{"data-hercules-id":"src/pages/leaves/page.tsx:276:22","data-hercules-name":"p",className:"text-sm text-muted-foreground italic mb-2",children:["Motif : ",a.reason]}),a.interimById&&e.jsx(Le,{"data-hercules-id":"src/pages/leaves/page.tsx:281:22","data-hercules-name":"InterimDisplay",interimById:a.interimById}),a.status==="rejected"&&a.rejectionReason&&e.jsxs("p",{"data-hercules-id":"src/pages/leaves/page.tsx:284:22","data-hercules-name":"p",className:"text-sm text-red-600 mt-2 p-2 bg-red-50 rounded border border-red-200",children:[e.jsx("strong",{"data-hercules-id":"src/pages/leaves/page.tsx:285:24","data-hercules-name":"strong",children:"Motif du rejet :"})," ",a.rejectionReason]}),a.managerComments&&e.jsxs("p",{"data-hercules-id":"src/pages/leaves/page.tsx:289:22","data-hercules-name":"p",className:"text-sm text-muted-foreground mt-2 p-2 bg-muted rounded",children:[e.jsx("strong",{"data-hercules-id":"src/pages/leaves/page.tsx:290:24","data-hercules-name":"strong",children:"Commentaire du manager :"})," ",a.managerComments]}),a.reviewedAt&&e.jsxs("p",{"data-hercules-id":"src/pages/leaves/page.tsx:294:22","data-hercules-name":"p",className:"text-xs text-muted-foreground mt-1",children:["Traité le"," ",new Date(a.reviewedAt).toLocaleDateString("fr-FR",{day:"numeric",month:"long",year:"numeric"})]})]}),a.status==="pending"&&e.jsxs("div",{"data-hercules-id":"src/pages/leaves/page.tsx:305:20","data-hercules-name":"div",className:"flex items-center gap-1",children:[e.jsx(Ie,{"data-hercules-id":"src/pages/leaves/page.tsx:306:22","data-hercules-name":"LeaveEditForm",request:a}),e.jsx(b,{"data-hercules-id":"src/pages/leaves/page.tsx:307:22","data-hercules-name":"Button",variant:"ghost",size:"sm",onClick:()=>q(a._id),className:"cursor-pointer",children:e.jsx(de,{"data-hercules-id":"src/pages/leaves/page.tsx:313:24","data-hercules-name":"XIcon",className:"h-4 w-4"})})]}),a.status==="approved"&&e.jsxs(b,{"data-hercules-id":"src/pages/leaves/page.tsx:318:20","data-hercules-name":"Button",variant:"ghost",size:"sm",onClick:()=>p({id:a._id,description:`Congé ${X[a.leaveType]} du ${new Date(a.startDate).toLocaleDateString("fr-FR")} au ${new Date(a.endDate).toLocaleDateString("fr-FR")}`}),className:"cursor-pointer text-destructive hover:text-destructive",children:[e.jsx(de,{"data-hercules-id":"src/pages/leaves/page.tsx:329:22","data-hercules-name":"XIcon",className:"h-4 w-4 mr-1"}),"Annuler"]})]},a._id))})})]})]}),m&&e.jsx(Ce,{"data-hercules-id":"src/pages/leaves/page.tsx:342:8","data-hercules-name":"CancelApprovedLeaveDialog",requestId:m.id,description:m.description,open:m!==null,onOpenChange:a=>{a||p(null)}})]})}function Me(){return e.jsxs(e.Fragment,{children:[e.jsx(fe,{"data-hercules-id":"src/pages/leaves/page.tsx:358:6","data-hercules-name":"Unauthenticated",children:e.jsx("div",{"data-hercules-id":"src/pages/leaves/page.tsx:359:8","data-hercules-name":"div",className:"min-h-screen flex items-center justify-center bg-background",children:e.jsxs(I,{"data-hercules-id":"src/pages/leaves/page.tsx:360:10","data-hercules-name":"Card",className:"w-full max-w-md",children:[e.jsxs(w,{"data-hercules-id":"src/pages/leaves/page.tsx:361:12","data-hercules-name":"CardHeader",children:[e.jsx(L,{"data-hercules-id":"src/pages/leaves/page.tsx:362:14","data-hercules-name":"CardTitle",children:"Connexion requise"}),e.jsx(J,{"data-hercules-id":"src/pages/leaves/page.tsx:363:14","data-hercules-name":"CardDescription",children:"Veuillez vous connecter pour accéder à vos congés"})]}),e.jsx(E,{"data-hercules-id":"src/pages/leaves/page.tsx:367:12","data-hercules-name":"CardContent",children:e.jsx(je,{"data-hercules-id":"src/pages/leaves/page.tsx:368:14","data-hercules-name":"SignInButton"})})]})})}),e.jsx(ye,{"data-hercules-id":"src/pages/leaves/page.tsx:373:6","data-hercules-name":"AuthLoading",children:e.jsx("div",{"data-hercules-id":"src/pages/leaves/page.tsx:374:8","data-hercules-name":"div",className:"min-h-screen flex items-center justify-center",children:e.jsx(Z,{"data-hercules-id":"src/pages/leaves/page.tsx:375:10","data-hercules-name":"Skeleton",className:"h-96 w-full max-w-6xl"})})}),e.jsx(De,{"data-hercules-id":"src/pages/leaves/page.tsx:378:6","data-hercules-name":"Authenticated",children:e.jsx(Te,{"data-hercules-id":"src/pages/leaves/page.tsx:379:8","data-hercules-name":"LeavesPageContent"})})]})}export{Me 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.