PageSourceSearch

https://barebeauty.sa/build/assets/leave-C8ZgGSVO.js

js barebeauty.sa collected 2026-09-24 14:29:02 UTC 4,320 bytes, 1 lines download raw bytes

1import{u as g,h as f,r as N,m as b,j as a,H as S,e as C}from"./vendor-DviMR2vF.js";import{usePortalLang as y,useFlash as L,PortalShell as D,PortalCard as d,Icon as h,StatusPill as P}from"./_portal-ui-2UVuoQv8.js";import"./utils-nrJLb57x.js";import"./page-template-CgzGw9vz.js";import"./app-layout-C81OBHIe.js";import"./ui-BChMl1ia.js";import"./app-shared-CKDgHUBD.js";import"./app-BYrJzvVt.js";/* empty css            *//* empty css                  */import"./language-switcher-C43LMqYv.js";import"./language-DZ9KMQZW.js";import"./motion-DBVl-vA3.js";import"./CompanySupportChatWidget-B0rrjtnP.js";import"./recharts-DMgShWG-.js";import"./input-error-BGT-deR3.js";import"./theme-Bb3szHF7.js";import"./WatilySiteWebPushProvider-DTUrbJW9.js";import"./WebPushOptIn-AUUzvCeP.js";import"./watily-ui-shell-CFP-EonI.js";function W(){var m,u;const{t:s}=g(),{isAr:v}=y(),{shell:x,requests:l,types:i,balances:r}=f().props,n=L(),[c,p]=N.useState(!1),o=e=>v&&(e==null?void 0:e.name_ar)||(e==null?void 0:e.name)||"—",t=b({leave_type_id:"",start_date:"",end_date:"",reason:""}),j=e=>{e.preventDefault(),t.post(route("portal.leave.store"),{preserveScroll:!0,onSuccess:()=>{t.reset(),p(!1)}})},_=e=>{confirm(s("Cancel this request?"))&&C.post(route("portal.leave.cancel",e),{},{preserveScroll:!0})};return a.jsxs(D,{active:"leave",shell:x,children:[a.jsx(S,{title:s("My Leave")}),n.success&&a.jsx("div",{className:"portal-flash ok",children:n.success}),n.error&&a.jsx("div",{className:"portal-flash err",children:n.error}),((m=r==null?void 0:r.length)!=null?m:0)>0&&a.jsx(d,{title:s("Leave Balances"),children:(r!=null?r:[]).map(e=>a.jsxs("div",{className:"portal-row",children:[a.jsx("span",{className:"k",children:o(e.leave_type)}),a.jsxs("span",{className:"v",children:[e.available_days," ",s("days")]})]},e.id))}),a.jsx("button",{className:"portal-btn pt-btn-ic",onClick:()=>p(e=>!e),children:c?s("Close"):a.jsxs(a.Fragment,{children:[a.jsx(h,{name:"plus",size:18})," ",s("Request Leave")]})}),c&&a.jsx(d,{title:s("Request Leave"),children:a.jsxs("form",{onSubmit:j,children:[a.jsxs("div",{className:"portal-field",children:[a.jsx("label",{children:s("Leave Type")}),a.jsxs("select",{className:"portal-select",value:t.data.leave_type_id,onChange:e=>t.setData("leave_type_id",e.target.value),children:[a.jsx("option",{value:"",children:"—"}),(i!=null?i:[]).map(e=>a.jsx("option",{value:String(e.id),children:o(e)},e.id))]}),t.errors.leave_type_id&&a.jsx("span",{className:"portal-flash err",children:t.errors.leave_type_id})]}),a.jsxs("div",{className:"portal-field",children:[a.jsx("label",{children:s("Start Date")}),a.jsx("input",{className:"portal-input",type:"date",value:t.data.start_date,onChange:e=>t.setData("start_date",e.target.value)})]}),a.jsxs("div",{className:"portal-field",children:[a.jsx("label",{children:s("End Date")}),a.jsx("input",{className:"portal-input",type:"date",value:t.data.end_date,onChange:e=>t.setData("end_date",e.target.value)}),t.errors.end_date&&a.jsx("span",{className:"portal-flash err",children:t.errors.end_date})]}),a.jsxs("div",{className:"portal-field",children:[a.jsx("label",{children:s("Reason")}),a.jsx("textarea",{className:"portal-textarea",rows:2,value:t.data.reason,onChange:e=>t.setData("reason",e.target.value)})]}),a.jsx("button",{className:"portal-btn",type:"submit",disabled:t.processing,children:t.processing?s("Sending..."):s("Submit")})]})}),a.jsxs(d,{title:s("My Leave"),children:[((u=l==null?void 0:l.length)!=null?u:0)===0&&a.jsx("div",{className:"portal-empty",children:s("No leave requests yet")}),(l!=null?l:[]).map(e=>a.jsxs("div",{className:"portal-list-item",children:[a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:8},children:[a.jsx("strong",{children:o(e.leave_type)}),a.jsx(P,{status:e.status})]}),a.jsxs("div",{style:{color:"var(--muted)",fontSize:13,marginTop:4},children:[e.start_date," → ",e.end_date," · ",e.days_count," ",s("days")]}),e.decision_note&&a.jsxs("div",{style:{fontSize:13,marginTop:5,display:"flex",alignItems:"center",gap:6,color:"var(--muted)"},children:[a.jsx(h,{name:"note",size:14})," ",e.decision_note]}),e.status==="pending"&&a.jsx("button",{className:"portal-btn portal-btn-ghost",style:{marginTop:8},onClick:()=>_(e.id),children:s("Cancel")})]},e.id))]})]})}export{W 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.