PageSourceSearch

https://barebeauty.sa/build/assets/index-DfpYCYh9.js

js barebeauty.sa collected 2026-09-24 14:27:31 UTC 5,425 bytes, 1 lines download raw bytes

1import{u as k,r as d,j as e,e as g,P as b}from"./vendor-DviMR2vF.js";import{P as A}from"./page-template-CgzGw9vz.js";import{C as x,g as p,h,i as u,j as r,k as B,l as E,m as P,X as T,B as _,D as z,n as F,o as H,p as I,L,q as O,s as Q,t as C}from"./ui-BChMl1ia.js";import{A as U}from"./ApprovalQueue-D3RAxjwm.js";import"./utils-nrJLb57x.js";import"./app-layout-C81OBHIe.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";import"./types-B37iJxQP.js";function V(l){switch(l){case"executed":return"success";case"failed":return"destructive";case"rejected":return"secondary";case"expired":return"secondary";default:return"default"}}function me({pending:l,recent:j}){const{t}=k(),[o,w]=d.useState(null),[c,n]=d.useState(null),[f,v]=d.useState(""),[m,i]=d.useState(!1),R=s=>{i(!0),g.post(b("admin.platform-approvals.approve",s.id),{},{preserveScroll:!0,onError:()=>C.error(t("Could not save")),onFinish:()=>i(!1)})},S=s=>{n(s),v("")},y=()=>{c&&(i(!0),g.post(b("admin.platform-approvals.reject",c.id),{reason:f},{preserveScroll:!0,onSuccess:()=>{n(null)},onError:()=>C.error(t("Could not save")),onFinish:()=>i(!1)}))};return e.jsxs(A,{title:t("Approvals"),description:t("Platform team members submitted changes that have not been executed."),url:"/admin/platform-approvals",children:[e.jsxs(x,{className:"mb-4",children:[e.jsx(p,{children:e.jsx(h,{children:t("Wati AI requests awaiting your approval")})}),e.jsx(u,{children:e.jsx(U,{})})]}),e.jsxs(x,{children:[e.jsx(p,{children:e.jsx(h,{children:t("Pending approval")})}),e.jsx(u,{className:"space-y-3",children:l.length===0?e.jsx("div",{className:"rounded-lg border border-dashed p-8 text-center text-sm text-muted-foreground",children:t("Nothing pending.")}):l.map(s=>{var a;return e.jsxs("div",{className:"rounded-lg border p-3",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-[200px] flex-1",children:[e.jsx("div",{className:"font-semibold",children:s.summary}),e.jsx("div",{className:"text-xs text-muted-foreground",children:[s.section_label,s.user,s.created_at].filter(Boolean).join(" · ")}),e.jsxs("div",{className:"mt-1 font-mono text-xs text-muted-foreground",children:[s.method," ",s.uri]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(r,{variant:"outline",size:"sm",onClick:()=>w(o===s.id?null:s.id),children:o===s.id?e.jsx(B,{className:"h-4 w-4"}):e.jsx(E,{className:"h-4 w-4"})}),e.jsxs(r,{size:"sm",onClick:()=>R(s),disabled:m,children:[e.jsx(P,{className:"mr-1 h-4 w-4"}),t("Approve")]}),e.jsxs(r,{variant:"outline",size:"sm",onClick:()=>S(s),disabled:m,className:"text-destructive hover:text-destructive",children:[e.jsx(T,{className:"mr-1 h-4 w-4"}),t("Reject")]})]})]}),o===s.id&&e.jsx("div",{className:"mt-3 overflow-x-auto rounded-md border",children:e.jsx("table",{className:"w-full text-xs",children:e.jsx("tbody",{children:Object.entries((a=s.fields)!=null?a:{}).map(([N,D])=>e.jsxs("tr",{className:"border-b last:border-0",children:[e.jsx("td",{className:"w-1/3 p-2 font-medium text-muted-foreground",children:N}),e.jsx("td",{className:"p-2",children:D})]},N))})})})]},s.id)})})]}),e.jsxs(x,{className:"mt-4",children:[e.jsx(p,{children:e.jsx(h,{children:t("Recent decisions")})}),e.jsx(u,{children:j.length===0?e.jsx("div",{className:"rounded-lg border border-dashed p-8 text-center text-sm text-muted-foreground",children:t("No decisions yet.")}):e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b text-start text-muted-foreground",children:[e.jsx("th",{className:"p-2 text-start font-medium",children:t("Summary")}
1),e.jsx("th",{className:"p-2 text-start font-medium",children:t("Sections")}),e.jsx("th",{className:"p-2 text-start font-medium",children:t("Status")}),e.jsx("th",{className:"p-2 text-start font-medium",children:t("Result")}),e.jsx("th",{className:"p-2 text-start font-medium",children:t("Date")})]})}),e.jsx("tbody",{children:j.map(s=>{var a;return e.jsxs("tr",{className:"border-b last:border-0",children:[e.jsx("td",{className:"p-2 font-medium",children:s.summary}),e.jsx("td",{className:"p-2 text-muted-foreground",children:s.section_label}),e.jsx("td",{className:"p-2",children:e.jsx(_,{variant:V(s.status),children:s.status})}),e.jsx("td",{className:"p-2 text-muted-foreground",children:(a=s.result_message)!=null?a:"—"}),e.jsx("td",{className:"p-2 text-muted-foreground",children:s.created_at})]},s.id)})})]})})})]}),e.jsx(z,{open:!!c,onOpenChange:s=>!s&&n(null),children:e.jsxs(F,{className:"max-w-sm",children:[e.jsx(H,{children:e.jsx(I,{children:t("Reject")})}),e.jsxs("div",{children:[e.jsx(L,{children:t("Reason (optional)")}),e.jsx(O,{value:f,onChange:s=>v(s.target.value),rows:3})]}),e.jsxs(Q,{children:[e.jsx(r,{variant:"outline",onClick:()=>n(null),children:t("Cancel")}),e.jsx(r,{variant:"destructive",onClick:y,disabled:m,children:t("Reject")})]})]})})]})}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.