PageSourceSearch

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

js barebeauty.sa collected 2026-10-02 01:09:16 UTC 9,383 bytes, 1 lines download raw bytes

1import{h as $,r as j,j as e,P as l,L as E,e as p}from"./vendor-CjDHlqhy.js";import{P as O}from"./page-template-DZDekKmP.js";import{C as b,p as g,y as C,z as D,A as o,F as r,J as T,K as n,B as c,aR as W,aS as Z,h as q,ai as J,aq as A,ar as z,as as B,at as F,au as P,av as H,aw as I,ax as L}from"./ui-CNs-pDNo.js";import{u as K}from"./strings-BYSQpf2f.js";import"./utils-nrJLb57x.js";import"./app-layout-VqcNefif.js";import"./app-shared-BRksQZ7A.js";import"./app-D7gEHbXj.js";/* empty css            *//* empty css                  */import"./language-switcher-DIr2GLrQ.js";import"./language-DZ9KMQZW.js";import"./motion-Bvx8bI_5.js";import"./CompanySupportChatWidget-DjUg0DKq.js";import"./recharts-B3sRJ26l.js";import"./input-error-CB2dSVrq.js";import"./theme-DClJHNB7.js";import"./WatilySiteWebPushProvider-D_666GSH.js";import"./WebPushOptIn-CHvvL7UY.js";import"./watily-ui-shell-CFP-EonI.js";const U={connected:"bg-green-100 text-green-700",token_error:"bg-red-100 text-red-700",paused:"bg-amber-100 text-amber-700",uninstalled:"bg-gray-100 text-gray-600"},V={pending:"bg-amber-100 text-amber-700",submitted:"bg-blue-100 text-blue-700",settled:"bg-green-100 text-green-700"};function f(s){return new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2}).format(s)}function pe(){const s=K(),{integrations:N,summary:d,payouts:v,partner:i,seller:y}=$().props,[x,m]=j.useState(null),[u,h]=j.useState(null),[_,S]=j.useState(null),M=t=>{window.confirm(s.deleteConfirm)&&p.delete(l("admin.zid.force-delete",t),{preserveScroll:!0})},k=t=>{S(t),p.post(l("admin.zid.payouts.statement.generate",t),{},{preserveScroll:!0,onFinish:()=>S(null)})},w=(t,a)=>{p.post(l("admin.zid.payouts.statement.status",t),{status:a},{preserveScroll:!0})},R=[{label:s.connectedStores,value:d.connected,tone:"text-green-700"},{label:s.tokenErrors,value:d.token_errors,tone:"text-red-700"},{label:s.uninstalledApps,value:d.uninstalled,tone:"text-gray-600"},{label:s.failedWebhooks24h,value:d.failed_webhooks_24h,tone:"text-amber-700"},{label:s.messagesSent,value:d.messages_total,tone:"text-blue-700"}];return e.jsxs(O,{title:s.title,description:s.indexDesc,url:"/admin/zid",children:[e.jsx("div",{className:"grid grid-cols-2 gap-3 md:grid-cols-5",children:R.map(t=>e.jsx(b,{children:e.jsxs(g,{className:"p-4",children:[e.jsx("div",{className:"text-2xl font-bold ".concat(t.tone),children:t.value}),e.jsx("div",{className:"text-xs text-muted-foreground mt-1",children:t.label})]})},t.label))}),e.jsx(b,{className:"mt-4",children:e.jsxs(g,{className:"p-4",children:[e.jsx("div",{className:"text-base font-bold mb-2",children:s.payoutsTitle}),e.jsx("div",{className:"text-xs text-muted-foreground mb-3",children:s.payoutsCycleNote}),i&&e.jsxs("div",{className:"grid grid-cols-1 gap-2 md:grid-cols-4 text-sm mb-3",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-xs text-muted-foreground",children:s.partnerLegalName}),e.jsx("div",{className:"font-medium",children:i.legal_name_ar}),e.jsx("div",{className:"text-xs text-muted-foreground",children:i.legal_name_en})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-xs text-muted-foreground",children:s.partnerVat}),e.jsx("div",{className:"font-medium",dir:"ltr",children:i.vat||"—"})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-xs text-muted-foreground",children:s.partnerCr}),e.jsx("div",{className:"font-medium",dir:"ltr",children:i.cr||"—"})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-xs text-muted-foreground",children:s.ourCr}),e.jsx("div",{className:"font-medium",dir:"ltr",children:y.cr_number||"—"})]})]}),!y.cr_number&&e.jsx("div",{className:"rounded-md bg-amber-50 border border-amber-200 text-amber-800 text-sm px-3 py-2 mb-3",children:s.ourCrMissing}),v.length===0?e.jsx("div",{className:"text-sm text-muted-foreground py-6 text-center",children:s.noPayoutMonths}):e.jsx("div",{className:"overflow-x-auto",children:e.jsxs(C,{children:[e.jsx(D,{children:e.jsxs(o,{children:[e.jsx(r,{children:s.month}),e.jsx(r,{children:s.subscriptions}),e.jsx(r,{children:s.share}),e.jsx(r,{children:s.vat}),e.jsx(r,{children:s.total}),e.jsx(r,{children:s.individualInvoices}),e.jsx(r,{children:s.bundledInvoice}),e.jsx(r,{children:s.payoutStatus})]})}),e.jsx(T,{children:v.map(t=>e.jsxs(o,{children:[e.jsx(n,{className:"font-medium whitespace-nowrap",children:t.label}),e.jsx(n,{children:t.count}),e.jsx(n,{dir:"ltr",children:f(t.subtotal)}),e.jsx(n,{dir:"ltr",children:f(t.vat_amount)}),e.jsx(n,{dir:"ltr",className:"font-semibold",children:f(t.total)}),e.jsx(n,{children:e.jsx("div",{className:"flex flex-col gap-1",children:t.invoices.map(a=>e.jsxs("div",{className:"flex items-center gap-1 text-xs",children:[e.jsx("button",{type:"button",className:"underline hover:no-underline",onClick:()=>window.open(l("admin.zid.payouts.invoice-pdf",a.id),"_blank"),children:a.number}),e.jsx("span",{className:"text-muted-foreground",children:a.status}),!a.is_partner_format&&e.jsx(c,{className:"bg-gray-100 text-gray-600",children:s.legacyFormatBadge})]},a.id))})}),e.jsx(n,{children:t.statement?e.jsxs("div",{className:"flex flex-col gap-1 text-xs",children:[e.jsx("div",{className:"font-medium",children:t.statement.number}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 underline hover:no-underline",onClick:()=>window.open(l("admin.zid.payouts.statement.pdf",t.month),"_blank"),children:[e.jsx(W,{className:"h-3 w-3"})," ",s.downloadPdf]}),e.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 underline hover:no-underline text-muted-foreground",disabled:_===t.month,onClick:()=>k(t.month),children:[e.jsx(Z,{className:"h-3 w-3"})," ",s.regenerateStatement]})]})]}):e.jsx(q,{type:"button",size:"sm",disabled:_===t.month,onClick:()=>k(t.month),children:s.generateStatement})}),e.jsx(n,{children:t.statement?e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx(c,{className:V[t.statement.status]||"",children:t.statement.status==="settled"?s.payoutSettled:t.statement.status==="submitted"?s.payoutSubmitted:s.payoutPending}),e.jsxs("div",{className:"flex flex-col gap-1",children:[t.statement.status==="pending"&&e.jsx("button",{type:"button",className:"text-xs underline hover:no-underline",onClick:()=>m(t.month),children:s.markSubmitted}),t.statement.status!=="settled"&&e.jsx("button",{type:"button",className:"text-xs underline hover:no-underline",onClick:()=>h(t.month),children:s.markSettled})]})]}):e.jsx("span",{className:"text-xs text-muted-foreground",children:"—"})})]},t.month))})]})})]})}),e.jsx(b,{className:"mt-4",children:e.jsx(g,{className:"p-0",children:e.jsxs(C,{children:[e.jsx(D,{children:e.jsxs(o,{children:[e.jsx(r,{children:s.store}),e.jsx(r,{children:s.company}),e.jsx(r,{children:s.status}),e.jsx(r,{children:s.subscription}),e.jsx(r,{children:s.webhooks}),e.jsx(r,{children:s.messages}),e.jsx(r,{children:s.errors}),e.jsx(r,{children:s.lastWebhook}),e.jsx(r,{className:"w-12 text-end",children:s.actions})]})}),e.jsxs(T,{children:[N.length===0&&e.jsx(o,{children:e.jsx(n,{colSpan:9,className:"text-center text-muted-foreground py-8",children:s.noStores})}),N.map(t=>e.jsxs(o,{className:"cursor-pointer",children:[e.jsxs(n,{children:[e.jsx(E,{href:l("admin.zid.show",t.id),className:"font-medium hover:underline",children:t.store_name||"".concat(s.storeHash).concat(t.zid_store_id)}),e.jsx("div",{className:"text-xs text-muted-foreground",children:t.merchant_email})]}),e.jsx(n,{children:t.company||"—"}),e.jsxs(n,{children:[e.jsx(c,{className:U[t.status]||"",children:t.status}),t.token_expired&&t.status!=="token_error"&&e.jsx(c,{className:"bg-red-100 text-red-700 ms-1",children:s.expired})]}),e.jsxs(n,{children:[e.jsx("div",{children:t.subscription_status}),e.jsxs("div",{className:"text-xs text-muted-foreground",children:[t.plan_name||"—"," ",t.ai_addon?"• ".concat(s.smartReply):""]}),t.subscription_days_left!=null&&e.jsxs("div",{className:"text-xs text-muted-foreground",children:[t.subscription_days_left," ",s.daysLeft]})]}),e.jsxs(n,{children:[t.webhooks_received,t.webhooks_failed>0&&e.jsxs("span",{className:"text-red-600",children:[" / ",t.webhooks_failed," ",s.failed]})]}),e.jsx(n,{children:t.messages_sent}
1),e.jsx(n,{className:t.sync_errors>0?"text-red-600":"",children:t.sync_errors}),e.jsx(n,{className:"text-xs text-muted-foreground",children:t.last_webhook_at||"—"}),e.jsx(n,{className:"text-end",children:e.jsx("button",{type:"button",onClick:()=>M(t.id),title:s.deleteStore,className:"rounded-md p-1.5 text-red-600 transition-colors hover:bg-red-50",children:e.jsx(J,{className:"h-4 w-4"})})})]},t.id))]})]})})}),e.jsx(A,{open:!!x,onOpenChange:t=>!t&&m(null),children:e.jsxs(z,{className:"max-w-sm",children:[e.jsxs(B,{children:[e.jsx(F,{children:s.confirmSubmittedTitle}),e.jsx(P,{children:s.confirmSubmittedDesc})]}),e.jsxs(H,{children:[e.jsx(I,{children:s.cancel}),e.jsx(L,{onClick:t=>{t.preventDefault(),x&&w(x,"submitted"),m(null)},children:s.confirm})]})]})}),e.jsx(A,{open:!!u,onOpenChange:t=>!t&&h(null),children:e.jsxs(z,{className:"max-w-sm",children:[e.jsxs(B,{children:[e.jsx(F,{children:s.confirmSettledTitle}),e.jsx(P,{children:s.confirmSettledDesc})]}),e.jsxs(H,{children:[e.jsx(I,{children:s.cancel}),e.jsx(L,{onClick:t=>{t.preventDefault(),u&&w(u,"settled"),h(null)},children:s.confirm})]})]})})]})}export{pe 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.