PageSourceSearch

https://vietusa.com/_next/static/chunks/pages/owner/refunds-05155943a71de2fe.js

js vietusa.com collected 2026-10-10 02:02:46 UTC 24,318 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[449],{20209:(e,t,s)=>{"use strict";s.d(t,{M:()=>r});var a=s(14e3),n=s(14232),l=s(95680);let r=(e,t)=>{let s=(0,a.useRouter)(),r=(0,a.usePathname)(),i=(0,n.useCallback)(()=>{let a=(0,l.Dz)(t||"/".concat(e),{allowPrivileged:!0})||"/".concat(e),n="".concat(window.location.pathname).concat(window.location.search).concat(window.location.hash),r=(0,l.Dz)(n,{allowPrivileged:!0})||a;s.push("/".concat(e,"/login?redirect=").concat(encodeURIComponent(r)))},[t,r,s,e]),o=(0,n.useCallback)(async e=>{let t=await (0,l._R)(e);return 401===e.status||(0,l.$7)(t)?(i(),{handled:!0,payload:t}):{handled:!1,payload:t}},[i]);return{redirectToPrivilegedLogin:i,handlePrivilegedReauth:o}}},60081:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>h});var a=s(37876),n=s(89855),l=s(14232),r=s(66782),i=s(97216),o=s(62097),c=s(88509),d=s(95680),u=s(20209);let m=e=>{let t=(Math.abs(e)/100).toLocaleString(void 0,{style:"currency",currency:"USD"});return e<0?"-".concat(t):t},x=e=>{if(!e)return"n/a";let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString()};function p(){var e;let{adminToken:t}=(0,o.A)(),{t:s}=(0,c.o)(),{handlePrivilegedReauth:n}=(0,u.M)("owner","/owner/refunds"),[p,h]=(0,l.useState)([]),[b,f]=(0,l.useState)(null),[y,w]=(0,l.useState)(!1),[v,j]=(0,l.useState)(null),[N,g]=(0,l.useState)(null),[_,k]=(0,l.useState)(null),[A,R]=(0,l.useState)(null),[P,C]=(0,l.useState)({}),K=(0,l.useRef)(!1),[D,S]=(0,l.useState)(null),[z,M]=(0,l.useState)(null),T=(0,l.useRef)({}),E=(0,l.useMemo)(()=>e=>({customer_request:s("adminPaymentsReasonCustomer"),billing_error:s("adminPaymentsReasonBilling"),duplicate_charge:s("adminPaymentsReasonDuplicate"),service_issue:s("adminPaymentsReasonService"),chargeback:s("adminPaymentsReasonChargeback"),other:s("adminPaymentsReasonOther")})[e]||e,[s]),L=(0,l.useCallback)(e=>{switch(String(e||"").trim().toLowerCase()){case"paid":return s("adminPaymentsStatusPaid");case"pending":return s("adminPaymentsStatusPending");case"void":case"voided":return s("adminPaymentsStatusVoid");case"open":return s("adminPaymentsStatusOpen");default:return e||s("adminPaymentsStatusUnknown")}},[s]),I=(0,l.useCallback)(e=>{switch(String(e||"").trim().toLowerCase()){case"full":return s("adminPaymentsRefundTypeFull");case"partial":return s("adminPaymentsRefundTypePartial");case"credit":return s("adminPaymentsRefundTypeCredit");default:return e||s("adminPaymentsStatusUnknown")}},[s]),q=(0,l.useCallback)(e=>({"payments.refund.requested":s("refundAuditActionQueued"),"payments.refund.request_reused":s("refundAuditActionReused"),"payments.refund.approved":s("refundAuditActionApproved"),"payments.refund.rejected":s("refundAuditActionRejected"),"payments.refund":s("refundAuditActionApplied")})[e]||e,[s]),O=(0,l.useCallback)((e,t)=>{let s="".concat(t,":").concat(e),a=T.current[s];if(a)return a;let n=((e,t)=>{let s="undefined"!=typeof globalThis?globalThis.crypto:void 0,a=s&&"function"==typeof s.randomUUID?s.randomUUID():"".concat(Date.now().toString(36),"-").concat(Math.random().toString(36).slice(2,10));return"refund-".concat(t,"-").concat(e,"-").concat(a).slice(0,120)})(e,t);return T.current[s]=n,n},[]),B=(0,l.useCallback)(async()=>{if(t){w(!0),j(null);try{let[e,a]=await Promise.all([fetch((0,d.y0)("/api/admin/refund_limits"),{headers:t&&"__cookie__"!==t?{Authorization:"Bearer ".concat(t)}:void 0}),fetch((0,d.y0)("/api/admin/refund_requests?status=pending"),{headers:t&&"__cookie__"!==t?{Authorization:"Bearer ".concat(t)}:void 0})]);if(!e.ok){let{handled:t}=await n(e);if(t)return}if(e.ok){let t=await (0,d.s$)(e,null);f(t)}if(!a.ok){let{handled:e}=await n(a);if(e)return;throw Error(s("ownerRefundsLoadError"))}let l=await (0,d.s$)(a,{});h(Array.isArray(l.requests)?l.requests:[])}catch(e){j(e instanceof Error?e.message:s("ownerRefundsLoadError"))}finally{w(!1)}}},[t,n,s]);(0,l.useEffect)(()=>{B()},[B]);let U=async(e,a)=>{if(!t||K.current)return;let l=(P[e]||"").trim();if("reject"===a&&!l)return void k(s("panelRefundRejectNoteRequired"));K.current=!0,g(e),k(null),R(null);let r=O(e,a);try{let i=await fetch((0,d.y0)("/api/admin/refund_requests/".concat(e,"/").concat(a)),{method:"POST",headers:{...t&&"__cookie__"!==t?{Authorization:"Bearer ".concat(t)}:{},"Content-Type":"application/json","Idempotency-Key":r},body:JSON.stringify({idempotency_key:r,..."reject"===a?{review_notes:l}:{}})});if(!i.ok){let{handled:e,payload:t}=await n(i);if(e)return;throw Error("string"==typeof(null==t?void 0:t.error)&&t.error||s("ownerRefundsActionFailed"))}let o=await (0,d.s$)(i,{});h(t=>t.filter(t=>t.id!==e)),M(null),S(null),C(t=>{let s={...t};return delete s[e],s}
1),delete T.current["approve:".concat(e)],delete T.current["reject:".concat(e)],!0===o.idempotent_replay&&R(s("ownerRefundsReplayNotice"))}catch(e){k(e instanceof Error?e.message:s("ownerRefundsActionFailed"))}finally{K.current=!1,g(null)}},F=p.find(e=>e.id===z),G=p.find(e=>e.id===D);return(0,a.jsxs)("section",{className:"panel-page space-y-4",children:[(0,a.jsxs)("header",{className:"panel-page-heading",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h1",{children:s("ownerRefundsHeading")}),(0,a.jsx)("p",{children:s("ownerRefundsSubheading")})]}),(0,a.jsx)("button",{className:"panel-button",onClick:()=>void B(),disabled:y||null!==N,children:s("adminActionRefresh")})]}),v&&(0,a.jsx)("p",{role:"alert",className:"text-sm text-amber-700",children:v}),_&&(0,a.jsx)("p",{role:"alert",className:"text-sm text-rose-700",children:_}),A&&(0,a.jsx)("p",{role:"status",className:"text-sm text-emerald-700",children:A}),(0,a.jsx)(r.K,{listTitle:s("ownerRefundsPendingTitle"),detailTitle:null==F?void 0:F.business_name,emptyDetail:s("adminSplitPickOne"),onClearDetail:()=>M(null),backLabel:s("adminBizBack"),list:(0,a.jsx)("div",{className:"space-y-2",children:y?(0,a.jsx)("p",{children:s("commonLoading")}):0===p.length?(0,a.jsx)("p",{children:s("ownerRefundsPendingEmpty")}):p.map(e=>(0,a.jsx)(r.o,{title:e.business_name,active:z===e.id,onOpen:()=>M(e.id),lines:[(0,a.jsx)("strong",{children:m(e.amount_cents)},"amount"),E(e.reason),e.tx_id,s("ownerRefundsRequestedAt",{when:x(e.requested_at)})]},e.id))}),detail:F?(0,a.jsxs)("div",{className:"space-y-5",children:[(0,a.jsx)("p",{className:"text-3xl font-bold tracking-tight",children:m(F.amount_cents)}),(0,a.jsxs)("p",{className:"panel-status-note",children:[E(F.reason)," \xb7 ",I(F.refund_type)]}),(0,a.jsxs)("p",{className:"text-sm text-slate-600",children:[F.tx_id," \xb7 ",F.requested_by_email,(0,a.jsx)("br",{}),F.notes]}),(0,a.jsxs)("div",{className:"grid gap-4 xl:grid-cols-2",children:[(0,a.jsxs)("div",{className:"space-y-2 border-b border-slate-200 pb-4",children:[(0,a.jsx)("p",{className:"text-xs font-semibold uppercase tracking-wide text-slate-500",children:s("adminPaymentsDetailInvoice")}),F.invoice_id?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("p",{className:"text-sm font-semibold text-slate-900",children:s("adminPaymentsDetailInvoiceHeading",{id:F.invoice_id})}),(0,a.jsx)("p",{className:"text-xs text-slate-600",children:s("adminPaymentsDetailInvoiceMeta",{status:L(F.invoice_status),amount:m(Number(F.invoice_amount_cents||0))})}),F.invoice_description&&(0,a.jsx)("p",{className:"text-xs text-slate-600",children:F.invoice_description})]}):(0,a.jsx)("p",{className:"text-xs text-slate-500",children:s("ownerRefundsInvoiceMissing")})]}),(0,a.jsxs)("div",{className:"space-y-2 border-b border-slate-200 pb-4",children:[(0,a.jsx)("p",{className:"text-xs font-semibold uppercase tracking-wide text-slate-500",children:s("adminPaymentsDetailCreditSnapshot")}),(0,a.jsx)("p",{className:"text-xs text-slate-600",children:s("adminPaymentsDetailCreditBalances",{current:m(Number(F.current_credits_cents||0)),promo:m(Number(F.promo_credits_cents||0))})}),(0,a.jsx)("p",{className:"text-xs text-slate-600",children:s("adminPaymentsDetailCreditLastBalance",{balance:null===F.ledger_last_balance_after||void 0===F.ledger_last_balance_after?"n/a":m(Number(F.ledger_last_balance_after||0))})}),(0,a.jsx)("p",{className:"text-xs font-semibold ".concat(!1===F.ledger_healthy?"text-amber-700":"text-emerald-700"),children:!1===F.ledger_healthy?s("adminPaymentsDetailCreditIssuesNeedReview",{count:Number(F.ledger_issue_count||0)}):!0===F.ledger_healthy?s("adminPaymentsDetailCreditNoIssues"):s("adminValueNA")}),Array.isArray(F.ledger_issues)&&F.ledger_issues.length>0&&(0,a.jsx)("div",{className:"space-y-1",children:F.ledger_issues.map((e,t)=>(0,a.jsx)("p",{className:"text-[11px] text-amber-900",children:e},"".concat(F.id,"-ledger-").concat(t)))})]}),(0,a.jsxs)("div",{className:"space-y-2 border-b border-slate-200 pb-4",children:[(0,a.jsx)("p",{className:"text-xs font-semibold uppercase tracking-wide text-slate-500",children:s("adminPaymentsDetailRecentCreditActivity")}),Array.isArray(F.recent_credit_transactions)&&F.recent_credit_transactions.length>0?(0,a.jsx)("div",{className:"space-y-2",children:F.recent_credit_transactions.map(e=>(0,a.jsxs)("div",{className:"rounded-lg border border-slate-200 bg-slate-50 px-3 py-2",children:[(0,a.jsxs)("p",{className:"text-xs font-semibold text-slate-800",children:[e.transaction_type," - ",m(e.amount_cents)]}),(0,a.jsx)("p",{className:"text-[11px] text-slate-600",children:s("adminPaymentsDetailCreditRowMeta",{balance:m(e.balance_after),createdAt:x(e.created_at)})}),e.description&&(0,a.jsx)("p",{className:"text-[11px] text-slate-600",children:e.description})]},e.id))}):(0,a.jsx)("p",{className:"text-xs text-slate-500",children:s("adminPaymentsDetailNoRecentCreditActivity")})]}),(0,a.jsxs)("div",{className:"space-y-2 border-b border-slate-200 pb-4",children:[(0,a.jsx)("p",{className:"text-xs font-semibold uppercase tracking-wide text-slate-500",children:s("adminPaymentsDetailAuditTrail")}),Array.isArray(F.audit_entries)&&F.audit_entries.length>0?(0,a.jsx)("div",{className:"space-y-2",children:F.audit_entries.map((e,t)=>
1{var n,l,r,i,o,c;let d=null==(n=e.before)?void 0:n.credits_cents,u=null==(l=e.after)?void 0:l.credits_cents,p=null==(r=e.before)?void 0:r.invoice_status,h=null==(i=e.after)?void 0:i.invoice_status,b="number"==typeof(null==(o=e.after)?void 0:o.amount_cents)?e.after.amount_cents:"number"==typeof(null==(c=e.before)?void 0:c.amount_cents)?e.before.amount_cents:null;return(0,a.jsxs)("div",{className:"rounded-lg border border-slate-200 bg-slate-50 px-3 py-2",children:[(0,a.jsx)("p",{className:"text-xs font-semibold text-slate-800",children:q(e.action)}),(0,a.jsx)("p",{className:"text-[11px] text-slate-500",children:x(e.ts)}),null!==b&&(0,a.jsx)("p",{className:"text-[11px] text-slate-600",children:s("adminPaymentsDetailAmount",{amount:m(b)})}),("number"==typeof d||"number"==typeof u)&&(0,a.jsx)("p",{className:"text-[11px] text-slate-600",children:s("adminPaymentsDetailCreditsTransition",{before:m(Number(d||0)),after:m(Number(u||0))})}),("string"==typeof p||"string"==typeof h)&&(0,a.jsx)("p",{className:"text-[11px] text-slate-600",children:s("adminPaymentsDetailInvoiceTransition",{before:L(p||""),after:L(h||"")})})]},"".concat(F.id,"-audit-").concat(t))})}):(0,a.jsx)("p",{className:"text-xs text-slate-500",children:s("adminPaymentsDetailNoAuditTrail")})]}),(0,a.jsxs)("div",{className:"space-y-2 border-b border-slate-200 pb-4 lg:col-span-2",children:[(0,a.jsx)("p",{className:"font-semibold text-slate-700",children:s("ownerRefundsReviewNotesTitle")}),(0,a.jsx)("textarea",{"aria-label":s("ownerRefundsReviewNotesTitle"),value:P[F.id]||"",onChange:e=>C(t=>({...t,[F.id]:e.target.value})),rows:3,className:"w-full rounded-lg border border-slate-200 px-3 py-2 text-sm",placeholder:s("ownerRefundsReviewNotesPlaceholder")})]})]})]}):void 0,detailActions:F?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("button",{className:"panel-button panel-button-danger mr-auto",disabled:null!==N,onClick:()=>void U(F.id,"reject"),children:s("ownerRefundsReject")}),(0,a.jsx)("button",{className:"panel-button panel-button-primary",disabled:null!==N,onClick:()=>{k(null),S(F.id)},children:s("ownerRefundsApprove")})]}):void 0}),(0,a.jsxs)("details",{className:"panel-compact-limits",children:[(0,a.jsx)("summary",{children:s("ownerRefundsLimitOwnerApproval")}),(0,a.jsxs)("div",{className:"mt-3 flex flex-wrap gap-6",children:[(0,a.jsxs)("p",{children:[s("ownerRefundsLimitDailyAmount"),": ",b?m(b.daily_amount_limit):s("adminValueNA")]}),(0,a.jsxs)("p",{children:[s("ownerRefundsLimitDailyCount"),": ",null!=(e=null==b?void 0:b.daily_count_limit)?e:s("adminValueNA")]}),(0,a.jsxs)("p",{children:[s("ownerRefundsLimitOwnerApproval"),": ",b?m(b.owner_threshold):s("adminValueNA")]})]})]}),(0,a.jsx)(i.M,{open:!!G,title:s("panelRefundConfirm"),subtitle:G?"".concat(G.business_name," \xb7 ").concat(G.tx_id," \xb7 ").concat(m(G.amount_cents),". ").concat(s("panelRefundConfirmHelp")):"",confirmLabel:s("ownerRefundsApprove"),cancelLabel:s("adminActionCancel"),confirmDisabled:null!==N,error:_,onCancel:()=>{K.current||S(null)},onConfirm:()=>{G&&U(G.id,"approve")}})]})}function h(){return(0,a.jsx)(n.M,{active:"refunds",children:(0,a.jsx)(p,{})})}},66782:(e,t,s)=>{"use strict";s.d(t,{K:()=>l,o:()=>r});var a=s(37876),n=s(88509);function l(e){let{listTitle:t,list:s,detail:l,detailTitle:r,emptyDetail:i,onClearDetail:o,backLabel:c,detailActions:d}=e,u=!!l,{t:m}=(0,n.o)();return(0,a.jsxs)("div",{className:"panel-split grid gap-4 lg:grid-cols-[minmax(0,4fr),minmax(0,7fr)]","data-testid":"panel-split",children:[(0,a.jsxs)("section",{className:"panel-split-list min-h-0 flex-col ".concat(u?"hidden lg:flex":"flex"),children:[(0,a.jsx)("h2",{className:"panel-list-heading",children:t}),(0,a.jsx)("div",{className:"panel-split-body",children:s})]}),(0,a.jsxs)("section",{className:"panel-split-detail min-h-0 flex-col ".concat(u?"flex":"hidden lg:flex"),children:[r&&(0,a.jsxs)("div",{className:"panel-detail-heading flex items-center gap-3",children:[o&&(0,a.jsxs)("button",{type:"button",onClick:o,className:"text-sky-700 hover:underline lg:hidden",children:["‹ ",c]}),(0,a.jsx)("h2",{className:"min-w-0 flex-1 break-words",children:r}),o&&(0,a.jsx)("button",{type:"button",className:"hidden shrink-0 px-2 py-1 text-slate-500 lg:block",onClick:o,"aria-label":m("adminClose"),children:"\xd7"})]}),(0,a.jsx)("div",{className:"panel-split-body panel-detail-body",children:null!=l?l:(0,a.jsx)("p",{className:"panel-empty-detail",children:i})}),u&&d&&(0,a.jsx)("footer",{className:"panel-detail-actions",children:d})]})]})}function r(e){let{index:t,title:s,lines:n,actions:l,onOpen:r,active:i}=e;return(0,a.jsxs)("div",{role:r?"button":void 0,tabIndex:r?0:void 0,"aria-pressed":r?!!i:void 0,onClick:e=>{var t;if(!r)return;let s=e.target;null!=s&&null!=(t=s.closest)&&t.call(s,"a,button,input,select,textarea,[role='menu']")||r()},onKeyDown:e=>{r&&e.target===e.currentTarget&&("Enter"===e.key||" "===e.key)&&
1(e.preventDefault(),r())},className:"panel-record-row border px-3 py-2.5 text-[13px] leading-[1.55] transition-colors ".concat(r?"cursor-pointer":""," ").concat(i?"is-selected border-sky-300 bg-sky-50/70":"border-slate-200 bg-white hover:border-slate-300 hover:bg-slate-50"," focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-emerald-600"),children:[(0,a.jsxs)("p",{className:"flex min-w-0 items-baseline gap-1 font-bold text-slate-900",children:[null!=t&&(0,a.jsxs)("span",{className:"shrink-0 text-slate-500",children:[t,"."]}),r?(0,a.jsx)("button",{onClick:r,className:"min-w-0 flex-1 truncate text-left hover:underline",children:s}):(0,a.jsx)("span",{className:"min-w-0 flex-1 truncate",children:s})]}),n.map((e,t)=>null==e||""===e?null:(0,a.jsx)("div",{className:"min-w-0 break-words text-slate-700",children:e},t)),l&&(0,a.jsx)("div",{className:"mt-1 flex flex-wrap gap-x-3 text-[13px]",children:l})]})}},89855:(e,t,s)=>{"use strict";s.d(t,{M:()=>C});var a=s(37876),n=s(48230),l=s.n(n),r=s(14e3),i=s(14232),o=s(21174),c=s(41180),d=s(25527),u=s(98746),m=s(69430),x=s(8728),p=s(34213),h=s(46293),b=s(73291),f=s(79282),y=s(87204),w=s(74062),v=s(1328),j=s(36414),N=s(93784),g=s(67915),_=s(62097),k=s(88509),A=s(95680);let R=[{labelKey:"ownerNavGroupBusiness",items:[{labelKey:"ownerNavOverview",icon:(0,a.jsx)(o.A,{size:16}),key:"overview",href:"/owner"},{labelKey:"ownerNavGrowth",icon:(0,a.jsx)(c.A,{size:16}),key:"growth",href:"/owner/growth"},{labelKey:"adminMenuRevenue",icon:(0,a.jsx)(c.A,{size:16}),key:"revenue",href:"/owner/revenue"},{labelKey:"adminMenuPayments",icon:(0,a.jsx)(d.A,{size:16}),key:"payments",href:"/owner/payments"},{labelKey:"adminMenuAnalytics",icon:(0,a.jsx)(u.A,{size:16}),key:"analytics",href:"/owner/analytics"},{labelKey:"adminMenuTrends",icon:(0,a.jsx)(c.A,{size:16}),key:"trends",href:"/owner/trends"},{labelKey:"adminMenuTraffic",icon:(0,a.jsx)(o.A,{size:16}),key:"traffic",href:"/owner/traffic"}]},{labelKey:"ownerNavGroupMoney",items:[{labelKey:"ownerNavMonetization",icon:(0,a.jsx)(u.A,{size:16}),key:"monetization",href:"/owner/monetization"},{labelKey:"ownerNavBanners",icon:(0,a.jsx)(m.A,{size:16}),key:"banners",href:"/owner/banners"},{labelKey:"ownerNavRefunds",icon:(0,a.jsx)(d.A,{size:16}),key:"refunds",href:"/owner/refunds"},{labelKey:"ownerNavNewsletter",icon:(0,a.jsx)(x.A,{size:16}),key:"newsletter",href:"/owner/newsletter"},{labelKey:"ownerNavPromoCodes",icon:(0,a.jsx)(p.A,{size:16}),key:"promocodes",href:"/owner/promocodes"}]},{labelKey:"ownerNavGroupPeople",items:[{labelKey:"ownerNavAdmins",icon:(0,a.jsx)(h.A,{size:16}),key:"admins",href:"/owner/admins"},{labelKey:"ownerNavPermissions",icon:(0,a.jsx)(b.A,{size:16}),key:"permissions",href:"/owner/permissions"}]},{labelKey:"ownerNavGroupSystem",items:[{labelKey:"ownerNavSystem",icon:(0,a.jsx)(f.A,{size:16}),key:"system",href:"/owner/system"},{labelKey:"adminMenuHealth",icon:(0,a.jsx)(y.A,{size:16}),key:"health",href:"/owner/health"},{labelKey:"ownerNavMembers",icon:(0,a.jsx)(h.A,{size:16}),key:"members",href:"/owner/members"},{labelKey:"ownerNavAudit",icon:(0,a.jsx)(w.A,{size:16}),key:"audit",href:"/owner/audit"},{labelKey:"ownerNavBotDetection",icon:(0,a.jsx)(v.A,{size:16}),key:"botdetection",href:"/owner/botdetection"},{labelKey:"adminMenuIpTracker",icon:(0,a.jsx)(o.A,{size:16}),key:"iptracker",href:"/owner/iptracker"},{labelKey:"adminMenuRecovery",icon:(0,a.jsx)(j.A,{size:16}),key:"recovery",href:"/owner/recovery"},{labelKey:"ownerNavEmergency",icon:(0,a.jsx)(N.A,{size:16}),key:"emergency",href:"/owner/emergency"}]}];function P(e){var t;let{active:s,t:n}=e,r=R.flatMap(e=>e.items).find(e=>e.key===s)||(null==(t=R[0])?void 0:t.items[0]);return(0,a.jsx)("div",{className:"border-b border-slate-200 bg-white md:hidden",children:(0,a.jsxs)("details",{className:"group",children:[(0,a.jsxs)("summary",{className:"flex cursor-pointer list-none items-center justify-between gap-3 px-4 py-3",children:[(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("p",{className:"text-[11px] font-semibold uppercase tracking-wide text-slate-500",children:n("ownerMenuTitle")}),(0,a.jsx)("p",{className:"truncate text-sm font-semibold text-slate-900",children:r?n(r.labelKey):n("ownerNavOverview")})]}),(0,a.jsx)("span",{className:"rounded-full border border-slate-200 px-3 py-1 text-xs font-semibold text-slate-600 group-open:bg-slate-50",children:n("businessSidebarShowMenu")})]}),(0,a.jsx)("div",{className:"space-y-4 border-t border-slate-100 px-4 py-4",children:R.map(e=>(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)("p",{className:"text-[11px] font-semibold uppercase tracking-wide text-slate-400",children:n(e.labelKey)}),(0,a.jsx)("div",{className:"grid gap-2",children:e.items.map(e=>(0,a.jsxs)(l(),{href:e.href,className:"flex items-center gap-3 rounded-lg border px-3 py-2 text-sm font-semibold transition ".concat(s===e.ke
1y?"border-slate-300 bg-slate-100 text-slate-900 shadow-sm":"border-slate-200 bg-white text-slate-700 hover:bg-slate-50"),children:[(0,a.jsx)("span",{className:"text-slate-600",children:e.icon}),n(e.labelKey)]},e.key))})]},e.labelKey))})]})})}function C(e){let{active:t,children:s}=e,{user:n,initialized:o,adminAuthed:c,adminAuthChecked:d}=(0,_.A)(),{t:u}=(0,k.o)(),m=(0,r.useRouter)(),x=(0,r.usePathname)();return((0,i.useEffect)(()=>{if(o&&d&&(!n||!c||"owner"!==n.role)){let e="".concat(window.location.pathname).concat(window.location.search).concat(window.location.hash),t=(0,A.Dz)(e,{allowPrivileged:!0})||"/owner";m.push("/owner/login?redirect=".concat(encodeURIComponent(t)))}},[o,d,n,c,m,x]),o&&d&&n&&c&&"owner"===n.role)?(0,a.jsxs)("div",{className:"min-h-screen bg-slate-50 text-slate-900",children:[(0,a.jsx)(g.A,{}),(0,a.jsx)(P,{active:t,t:u}),(0,a.jsxs)("div",{className:"grid min-h-screen md:grid-cols-[260px,1fr]",children:[(0,a.jsx)("aside",{className:"sticky top-0 hidden h-screen bg-white border-r border-slate-200 md:block",children:(0,a.jsxs)("div",{className:"px-4 py-5 space-y-4",children:[(0,a.jsx)("p",{className:"mb-1 text-xs font-semibold tracking-wide uppercase text-slate-500",children:u("ownerMenuTitle")}),R.map(e=>(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsx)("p",{className:"text-[11px] font-semibold text-slate-400 uppercase tracking-wide",children:u(e.labelKey)}),e.items.map(e=>(0,a.jsxs)(l(),{href:e.href,className:"flex items-center gap-3 w-full px-3 py-2 rounded-lg border text-sm font-semibold transition ".concat(t===e.key?"border-slate-300 bg-slate-100 text-slate-900 shadow-sm":"border-transparent hover:bg-slate-50 text-slate-700"),children:[(0,a.jsx)("span",{className:"text-slate-600",children:e.icon}),u(e.labelKey)]},e.key))]},e.labelKey))]})}),(0,a.jsx)("main",{className:"min-w-0 p-4 space-y-4 md:p-6",children:s})]})]}):(0,a.jsxs)("div",{className:"min-h-screen bg-slate-50",children:[(0,a.jsx)(g.A,{}),(0,a.jsx)("div",{className:"max-w-5xl px-4 py-6 mx-auto text-sm text-amber-700",children:u("ownerRedirecting")})]})}},91644:(e,t,s)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/owner/refunds",function(){return s(60081)}])},97216:(e,t,s)=>{"use strict";s.d(t,{M:()=>l});var a=s(37876),n=s(14232);function l(e){let{open:t,title:s,subtitle:l,fields:r,confirmLabel:i,cancelLabel:o,onConfirm:c,onCancel:d,confirmDisabled:u,busy:m=!1,error:x}=e,p=n.useRef(null);return(n.useEffect(()=>{var e,s;if(!t)return;let a=document.activeElement;return null==(s=p.current)||null==(e=s.querySelector("input,button"))||e.focus(),()=>{(null==a?void 0:a.isConnected)&&a.focus()}},[t]),t)?(0,a.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm px-4",children:(0,a.jsxs)("div",{ref:p,role:"dialog","aria-modal":"true","aria-label":s,"aria-busy":m,onKeyDown:e=>{if("Escape"===e.key&&(e.stopPropagation(),m||d()),"Tab"!==e.key)return;let t=Array.from(e.currentTarget.querySelectorAll("input:not(:disabled),button:not(:disabled)")),s=t[0],a=t[t.length-1];e.shiftKey&&document.activeElement===s?(e.preventDefault(),null==a||a.focus()):e.shiftKey||document.activeElement!==a||(e.preventDefault(),null==s||s.focus())},className:"max-h-[90dvh] overflow-y-auto w-full max-w-lg rounded-2xl border border-slate-200 bg-white p-5 shadow-xl space-y-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"text-lg font-bold text-slate-900",children:s}),l&&(0,a.jsx)("p",{className:"text-sm text-slate-600",children:l})]}),r&&r.length>0&&(0,a.jsx)("div",{className:"space-y-3",children:r.map(e=>(0,a.jsxs)("label",{className:"block text-sm text-slate-700",children:[(0,a.jsx)("span",{className:"mb-1 block text-xs font-semibold text-slate-500",children:e.label}),(0,a.jsx)("input",{disabled:m,type:e.type||"text",value:e.value,onChange:t=>e.onChange(t.target.value),placeholder:e.placeholder,className:"w-full rounded-lg border border-slate-200 px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-emerald-500"})]},e.label))}),x&&(0,a.jsx)("p",{role:"alert",className:"text-sm font-semibold text-rose-700",children:x}),(0,a.jsxs)("div",{className:"flex justify-end gap-2 text-sm font-semibold",children:[(0,a.jsx)("button",{type:"button",disabled:m,className:"px-3 py-2 rounded-lg border border-slate-200 hover:bg-slate-50",onClick:d,children:o}),(0,a.jsx)("button",{type:"button",className:"px-3 py-2 rounded-lg bg-emerald-600 text-white hover:bg-emerald-700 disabled:opacity-60",onClick:c,disabled:m||u,children:i})]})]})}):null}}},e=>{e.O(0,[4e3,8224,7915,636,6593,8792],()=>e(e.s=91644)),_N_E=e.O()}]);

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.