1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9075],{11026:(e,s,a)=>{a.d(s,{A:()=>t});let t=(0,a(53029).A)("TicketPercent",[["path",{d:"M2 9a3 3 0 1 1 0 6v2a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-2a3 3 0 1 1 0-6V7a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2Z",key:"1l48ns"}],["path",{d:"M9 9h.01",key:"1q5me6"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"M15 15h.01",key:"lqbp3k"}]])},49075:(e,s,a)=>{a.r(s),a.d(s,{default:()=>j});var t=a(37876),l=a(14232),r=a(11026),i=a(46863),d=a(1231),n=a(86346),c=a(25467),o=a(46623),m=a(74015),x=a(92263),b=a(59970),u=a(72591);let p={title:"",code:"",description:"",discount_type:"fixed",discount_value:"",max_discount_amount:"",min_order_amount:"",visibility:"checkout",public_display_enabled:!0,status:"active"},h=e=>new Intl.NumberFormat("en-IN",{style:"currency",currency:"INR",maximumFractionDigits:2}).format(Number(e||0)),v=e=>e?new Intl.DateTimeFormat("en-IN",{day:"numeric",month:"short",year:"numeric"}).format(new Date(e)):"â",g=e=>String(e||"â").replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase()),j=()=>{let[e,s]=(0,l.useState)(!0),[a,j]=(0,l.useState)(!1),[N,y]=(0,l.useState)(!1),[f,_]=(0,l.useState)(null),[w,k]=(0,l.useState)(null),[C,A]=(0,l.useState)(null),[S,E]=(0,l.useState)([]),[D,M]=(0,l.useState)(null),[P,q]=(0,l.useState)([]),[U,R]=(0,l.useState)(null),[F,T]=(0,l.useState)(null),[H,I]=(0,l.useState)(p),O=(0,l.useCallback)(async()=>{try{s(!0),R(null);let[e,a,t]=await Promise.all([(0,u._dx)(),(0,u.XDl)(),(0,u.wpH)({limit:20})]),l=e?.result||{},r=a?.result||{},i=t?.result||{};A(l?.stats||null),E(Array.isArray(l?.items)?l.items:[]),M(r||null),q(Array.isArray(i?.items)?i.items:[])}catch(e){R(e?.message||"Unable to load promo workspace.")}finally{s(!1)}},[]),L=(0,l.useCallback)(async()=>{try{y(!0);let e=await (0,u.wpH)({limit:20}),s=e?.result||{};q(Array.isArray(s?.items)?s.items:[])}catch(e){R(e?.message||"Unable to refresh wallet transactions.")}finally{y(!1)}},[]);(0,l.useEffect)(()=>{O()},[O]);let V=(0,l.useMemo)(()=>Object.entries(D?.categories||{}),[D?.categories]),$=()=>{I(p),k(null)},z=(e,s)=>{I(a=>({...a,[e]:s}))},B=()=>({title:H.title.trim(),...H.code.trim()?{code:H.code.trim().toUpperCase()}:{},...H.description.trim()?{description:H.description.trim()}:{},discount_type:H.discount_type,discount_value:H.discount_value.trim(),...H.max_discount_amount.trim()?{max_discount_amount:H.max_discount_amount.trim()}:{},...H.min_order_amount.trim()?{min_order_amount:H.min_order_amount.trim()}:{},visibility:H.visibility,public_display_enabled:H.public_display_enabled,status:H.status}),G=async e=>{e.preventDefault();try{j(!0),R(null),T(null),w?(await (0,u.mY2)(String(w),B()),T("Promo code updated.")):(await (0,u.r8R)(B()),T("Promo code created.")),$(),await O()}catch(e){R(e?.message||"Unable to save promo code.")}finally{j(!1)}},W=async e=>{try{_(e),R(null),T(null),await (0,u.EU)(String(e)),T("Promo code deleted."),w===e&&$(),await O()}catch(e){R(e?.message||"Unable to delete promo code.")}finally{_(null)}};return e?(0,t.jsx)("div",{className:"rounded-[1.6rem] border border-[rgba(17,19,57,0.08)] bg-white p-8 text-center text-slate-500 shadow-sm",children:"Loading promo workspace..."}):(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)("section",{className:"surface-card section-shell !p-6",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"section-eyebrow !border-[rgba(17,19,57,0.12)] !bg-[rgba(17,19,57,0.04)] !text-[var(--brand-red)]",children:"Promo workspace"}),(0,t.jsx)("h1",{className:"mt-4 text-3xl font-semibold text-[var(--brand-navy)]",children:"Booking promo codes and promo wallet"}),(0,t.jsx)("p",{className:"mt-2 max-w-3xl text-sm leading-6 text-slate-600",children:"Manage customer-facing booking promo codes and track subscription-only promo wallet credits in one place."})]}),(0,t.jsxs)("div",{className:"rounded-[1.2rem] border border-[rgba(17,19,57,0.08)] bg-[rgba(17,19,57,0.03)] px-5 py-4 shadow-sm",children:[(0,t.jsx)("div",{className:"text-xs font-semibold uppercase tracking-[0.18em] text-slate-500",children:"Available wallet balance"}),(0,t.jsx)("div",{className:"mt-2 text-2xl font-semibold text-[var(--brand-red)]",children:h(D?.available_balance||0)})]})]}),U?(0,t.jsx)("div",{className:"mt-5 rounded-[1rem] border border-[rgba(156,3,5,0.12)] bg-[rgba(156,3,5,0.04)] px-4 py-3 text-sm text-[var(--brand-red)]",children:U}):null,F?(0,t.jsx)("div",{className:"mt-5 rounded-[1rem] border border-emerald-200 bg-emerald-50 px-4 py-3 text-sm text-emerald-700",children:F}):null,(0,t.jsx)("div",{className:"mt-6 grid gap-4 md:grid-cols-2 xl:grid-cols-5",children:[{label:"Total codes",value:Number(C?.total_codes||0),icon:r.A},{label:"Active codes",value:Number(C?.active_codes||0),icon:i.A},{label:"Public codes",value:Number(C?.public_codes||0),icon:d.A},{label:"Redemptions",value:Number(C?.total_redemptions||0),icon:n.A},{label:"Discount funded",value:h(C?.discount_funded||0),icon:c.A}].map(e=>{let s=e.icon;return(0,t.jsxs)("div",{className:"rounded-[1.2rem] border border-[rgba(17,19,57,0.08)] bg-white p-4 shadow-sm",children:[(0,t.jsx)(s,{className:"h-5 w-5 text-[var(--brand-red)]"}),(0,t.jsx)("div",{className:"mt-3 text-xs font-semibold uppercase tracking-[0.18em] text-slate-500",children:e.label}),(0,t.jsx)("div",{className:"mt-2 text-xl font-semibold text-[var(--brand-navy)]",children:e.value})]},e.label)})})]}),(0,t.jsxs)("section",{className:"grid gap-6 xl:grid-cols-[0.95fr_1.05fr]",children:[(0,t.jsxs)("div",{className:"surface-card section-shell !p-6",children:[(0,t.jsxs)("div",{className:"section-heading",children:[(0,t.jsx)("div",{className:"section-eyebrow !border-[rgba(17,19,57,0.12)] !bg-[rgba(17,19,57,0.04)] !text-[var(--brand-red)]",children:"My promo codes"}),(0,t.jsx)("h2",{className:"section-title",children:w?"Edit booking promo code":"Create booking promo code"}),(0,t.jsx)("p",{className:"section-copy",children:"Technician promo codes stay separate from wallet rewards and only affect booking checkout discounts."})]}),(0,t.jsxs)("form",{onSubmit:G,className:"mt-6 space-y-4",children:[(0,t.jsxs)("div",{className:"grid gap-4 md:grid-cols-2",children:[(0,t.jsxs)("label",{className:"block",children:[(0,t.jsx)("span",{className:"text-xs font-semibold uppercase tracking-[0.18em] text-slate-500",children:"Title"}),(0,t.jsx)("input",{required:!0,value:H.title,onChange:e=>z("title",e.target.value),className:"mt-3 w-full rounded-xl border border-[rgba(17,19,57,0.12)] px-4 py-3 text-sm text-slate-800 outline-none",placeholder:"Festival booking offer"})]}),(0,t.jsxs)("label",{className:"block",children:[(0,t.jsx)("span",{className:"text-xs font-semibold uppercase tracking-[0.18em] text-slate-500",children:"Code"}),(0,t.jsx)("input",{value:H.code,onChange:e=>z("code",e.target.value.toUpperCase()),maxLength:6,disabled:!!w,className:"mt-3 w-full rounded-xl border border-[rgba(17,19,57,0.12)] px-4 py-3 text-sm uppercase text-slate-800 outline-none disabled:bg-slate-50",placeholder:"Auto-generate if blank"})]})]}),(0,t.jsxs)("label",{className:"block",children:[(0,t.jsx)("span",{className:"text-xs font-semibold uppercase tracking-[0.18em] text-slate-500",children:"Description"}),(0,t.jsx)("textarea",{value:H.description,onChange:e=>z("description",e.target.value),rows:3,className:"mt-3 w-full rounded-xl border border-[rgba(17,19,57,0.12)] px-4 py-3 text-sm text-slate-800 outline-none",placeholder:"Short note shown in your workspace."})]}),(0,t.jsxs)("div",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-4",children:[(0,t.jsxs)("label",{className:"block",children:[(0,t.jsx)("span",{className:"text-xs font-semibold uppercase tracking-[0.18em] text-slate-500",children:"Discount type"}
1),(0,t.jsxs)("select",{value:H.discount_type,onChange:e=>z("discount_type",e.target.value),className:"mt-3 w-full rounded-xl border border-[rgba(17,19,57,0.12)] px-4 py-3 text-sm text-slate-800 outline-none",children:[(0,t.jsx)("option",{value:"fixed",children:"Fixed amount"}),(0,t.jsx)("option",{value:"percentage",children:"Percentage"})]})]}),(0,t.jsxs)("label",{className:"block",children:[(0,t.jsx)("span",{className:"text-xs font-semibold uppercase tracking-[0.18em] text-slate-500",children:"Discount value"}),(0,t.jsx)("input",{required:!0,type:"number",min:"0.01",step:"0.01",value:H.discount_value,onChange:e=>z("discount_value",e.target.value),className:"mt-3 w-full rounded-xl border border-[rgba(17,19,57,0.12)] px-4 py-3 text-sm text-slate-800 outline-none",placeholder:"100"})]}),(0,t.jsxs)("label",{className:"block",children:[(0,t.jsx)("span",{className:"text-xs font-semibold uppercase tracking-[0.18em] text-slate-500",children:"Max discount"}),(0,t.jsx)("input",{type:"number",min:"0",step:"0.01",value:H.max_discount_amount,onChange:e=>z("max_discount_amount",e.target.value),className:"mt-3 w-full rounded-xl border border-[rgba(17,19,57,0.12)] px-4 py-3 text-sm text-slate-800 outline-none",placeholder:"Optional"})]}),(0,t.jsxs)("label",{className:"block",children:[(0,t.jsx)("span",{className:"text-xs font-semibold uppercase tracking-[0.18em] text-slate-500",children:"Min order"}),(0,t.jsx)("input",{type:"number",min:"0",step:"0.01",value:H.min_order_amount,onChange:e=>z("min_order_amount",e.target.value),className:"mt-3 w-full rounded-xl border border-[rgba(17,19,57,0.12)] px-4 py-3 text-sm text-slate-800 outline-none",placeholder:"Optional"})]})]}),(0,t.jsxs)("div",{className:"grid gap-4 md:grid-cols-3",children:[(0,t.jsxs)("label",{className:"block",children:[(0,t.jsx)("span",{className:"text-xs font-semibold uppercase tracking-[0.18em] text-slate-500",children:"Visibility"}),(0,t.jsxs)("select",{value:H.visibility,onChange:e=>z("visibility",e.target.value),className:"mt-3 w-full rounded-xl border border-[rgba(17,19,57,0.12)] px-4 py-3 text-sm text-slate-800 outline-none",children:[(0,t.jsx)("option",{value:"hidden",children:"Hidden"}),(0,t.jsx)("option",{value:"share_only",children:"Share only"}),(0,t.jsx)("option",{value:"profile",children:"Profile"}),(0,t.jsx)("option",{value:"checkout",children:"Checkout"})]})]}),(0,t.jsxs)("label",{className:"block",children:[(0,t.jsx)("span",{className:"text-xs font-semibold uppercase tracking-[0.18em] text-slate-500",children:"Status"}),(0,t.jsxs)("select",{value:H.status,onChange:e=>z("status",e.target.value),className:"mt-3 w-full rounded-xl border border-[rgba(17,19,57,0.12)] px-4 py-3 text-sm text-slate-800 outline-none",children:[(0,t.jsx)("option",{value:"active",children:"Active"}),(0,t.jsx)("option",{value:"draft",children:"Draft"}),(0,t.jsx)("option",{value:"disabled",children:"Disabled"})]})]}),(0,t.jsxs)("label",{className:"flex items-center gap-3 rounded-xl border border-[rgba(17,19,57,0.08)] bg-[rgba(17,19,57,0.03)] px-4 py-4 text-sm font-medium text-slate-700",children:[(0,t.jsx)("input",{type:"checkbox",checked:H.public_display_enabled,onChange:e=>z("public_display_enabled",e.target.checked),className:"h-4 w-4 rounded border-slate-300"}),"Public display enabled"]})]}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-3",children:[(0,t.jsx)("button",{type:"submit",disabled:a,className:"brand-button !justify-center disabled:cursor-not-allowed disabled:opacity-60",children:a?w?"Saving...":"Creating...":w?"Save promo code":"Create promo code"}),w?(0,t.jsx)("button",{type:"button",onClick:$,className:"brand-button-secondary !justify-center !border-[rgba(17,19,57,0.12)] !bg-[rgba(17,19,57,0.04)] !text-[var(--brand-navy)]",children:"Cancel edit"}):null]})]})]}),(0,t.jsxs)("div",{className:"surface-card section-shell !p-6",children:[(0,t.jsxs)("div",{className:"section-heading",children:[(0,t.jsx)("div",{className:"section-eyebrow !border-[rgba(17,19,57,0.12)] !bg-[rgba(17,19,57,0.04)] !text-[var(--brand-red)]",children:"Active promo list"}),(0,t.jsx)("h2",{className:"section-title",children:"My booking promo codes"}),(0,t.jsx)("p",{className:"section-copy",children:"Customers can only see codes when both visibility and public display are enabled."})]}),(0,t.jsx)("div",{className:"mt-6 space-y-4",children:0===S.length?(0,t.jsx)("div",{className:"rounded-[1.4rem] border border-dashed border-[rgba(17,19,57,0.14)] bg-[rgba(17,19,57,0.02)] p-5 text-sm text-slate-600",children:"No technician promo codes yet. Create one to start sharing booking discounts."}):S.map(e=>(0,t.jsxs)("article",{className:"rounded-[1.4rem] border border-[rgba(17,19,57,0.08)] bg-white p-5 shadow-sm",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)("span",{className:"rounded-full bg-[rgba(156,3,5,0.08)] px-3 py-1 text-xs font-semibold uppercase tracking-[0.16em] text-[var(--brand-red)]",children:e.code}),(0,t.jsx)("span",{className:"rounded-full bg-[rgba(17,19,57,0.05)] px-3 py-1 text-xs font-semibold uppercase tracking-[0.16em] text-slate-600",children:g(e.status)}),(0,t.jsx)("span",{className:"rounded-full bg-[rgba(17,19,57,0.05)] px-3 py-1 text-xs font-semibold uppercase tracking-[0.16em] text-slate-600",children:g(e.visibility)})]}),(0,t.jsx)("h3",{className:"mt-3 text-xl font-semibold text-[var(--brand-navy)]",children:e.title}),e.description?(0,t.jsx)("p",{className:"mt-2 text-sm leading-6 text-slate-600",children:e.description}):null]}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>{k(e.id),T(null),R(null),I({title:e.title||"",code:e.code||"",description:e.description||"",discount_type:e.discount_type||"fixed",discount_value:String(e.discount_value??""),max_discount_amount:null===e.max_discount_amount||void 0===e.max_discount_amount?"":String(e.max_discount_amount),min_order_amount:null===e.min_order_amount||void 0===e.min_order_amount?"":String(e.min_order_amount),visibility:e.visibility||"checkout",public_display_enabled:!!e.public_display_enabled,status:e.status||"active"})},className:"inline-flex items-center gap-2 rounded-xl border border-[rgba(17,19,57,0.12)] px-3 py-2 text-sm font-semibold text-[var(--brand-navy)]",children:[(0,t.jsx)(o.A,{className:"h-4 w-4"}),"Edit"]}),(0,t.jsxs)("button",{type:"button",onClick:()=>W(e.id),disabled:f===e.id,className:"inline-flex items-center gap-2 rounded-xl border border-rose-200 px-3 py-2 text-sm font-semibold text-rose-700 disabled:cursor-not-allowed disabled:opacity-60",children:[(0,t.jsx)(m.A,{className:"h-4 w-4"}),f===e.id?"Deleting...":"Delete"]})]})]}),(0,t.jsxs)("div",{className:"mt-5 grid gap-3 text-sm md:grid-cols-2 xl:grid-cols-4",children:[(0,t.jsxs)("div",{className:"rounded-xl bg-[rgba(17,19,57,0.04)] px-4 py-3",children:[(0,t.jsx)("div",{className:"text-slate-500",children:"Discount"}),(0,t.jsx)("div",{className:"mt-1 font-semibold text-[var(--brand-navy)]",children:"percentage"===e.discount_type?`${e.discount_value}%`:h(e.discount_value)})]}),(0,t.jsxs)("div",{className:"rounded-xl bg-[rgba(17,19,57,0.04)] px-4 py-3",children:[(0,t.jsx)("div",{className:"text-slate-500",children:"Min order"}),(0,t.jsx)("div",{className:"mt-1 font-semibold text-[var(--brand-navy)]",children:e.min_order_amount?h(e.min_order_amount):"â"})]}),(0,t.jsxs)("div",{className:"rounded-xl bg-[rgba(17,19,57,0.04)] px-4 py-3",children:[(0,t.jsx)("div",{className:"text-slate-500",children:"Redemptions"}),(0,t.jsx)("div",{className:"mt-1 font-semibold text-[var(--brand-navy)]",children:Number(e.usage?.total_usages||0)})]}),(0,t.jsxs)("div",{className:"rounded-xl bg-[rgba(17,19,57,0.04)] px-4 py-3",children:[(0,t.jsx)("div",{className:"text-slate-500",children:"Public display"}),(0,t.jsx)("div",{className:"mt-1 inline-flex items-center gap-2 font-semibold text-[var(--brand-navy)]",children:e.public_display_enabled?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(i.A,{className:"h-4 w-4 text-emerald-600"}),"Visible"]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(x.A,{className:"h-4 w-4 text-slate-500"}),"Hidden"]})})]})]}),(0,t.jsxs)("div",{className:"mt-4 grid gap-2 text-xs text-slate-500 md:grid-cols-3",children:[(0,t.jsxs)("div",{children:["Created: ",v(e.created_at)]}),(0,t.jsxs)("div",{children:["Starts: ",v(e.date_window?.start_at)]}),(0,t.jsxs)("div",{children:["Ends: ",v(e.date_window?.end_at)]})]})]},e.id))})]})]}),(0,t.jsxs)("section",{className:"grid gap-6 xl:grid-cols-[0.95fr_1.05fr]",children:[(0,t.jsxs)("div",{className:"surface-card section-shell !p-6",children:[(0,t.jsxs)("div",{className:"section-heading",children:[(0,t.jsx)("div",{className:"section-eyebrow !border-[rgba(17,19,57,0.12)] !bg-[rgba(17,19,57,0.04)] !text-[var(--brand-red)]",children:"Promo wallet"}),(0,t.jsx)("h2",{className:"section-title",children:"Subscription redemption credits"}),(0,t.jsx)("p",{className:"section-copy",children:"Wallet credits reduce technician subscription payments only after plan discount and GST."})]}),(0,t.jsxs)("div",{className:"mt-6 grid gap-4 md:grid-cols-2",children:[(0,t.jsxs)("div",{className:"rounded-[1.3rem] border border-[rgba(17,19,57,0.08)] bg-white p-5 shadow-sm",children:[(0,t.jsx)("div",{className:"text-xs font-semibold uppercase tracking-[0.18em] text-slate-500",children:"Available balance"}),(0,t.jsx)("div",{className:"mt-2 text-2xl font-semibold text-[var(--brand-red)]",children:h(D?.available_balance||0)})]}),(0,t.jsxs)("div",{className:"rounded-[1.3rem] border border-[rgba(17,19,57,0.08)] bg-white p-5 shadow-sm",children:[(0,t.jsx)("div",{className:"text-xs font-semibold uppercase tracking-[0.18em] text-slate-500",children:"Available credits"}),(0,t.jsx)("div",{className:"mt-2 text-2xl font-semibold text-[var(--brand-navy)]",children:Number(D?.available_credit_count||0)})]})]}),(0,t.jsx)("div",{className:"mt-6 grid gap-4",children:0===V.length?(0,t.jsx)("div",{className:"rounded-[1.4rem] border border-dashed border-[rgba(17,19,57,0.14)] bg-[rgba(17,19,57,0.02)] p-5 text-sm text-slate-600",children:"No promo wallet categories available yet."}):V.map(([e,s])=>(0,t.jsxs)("div",{className:"rounded-[1.3rem] border border-[rgba(17,19,57,0.08)] bg-[rgba(17,19,57,0.03)] p-4",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-sm font-semibold text-[var(--brand-navy)]",children:g(e)}),(0,t.jsx)("div",{className:"mt-1 text-sm text-slate-600",children:s.enabled?"Enabled for redemption":"Disabled for redemption"})]}),(0,t.jsxs)("div",{className:"rounded-full bg-white px-3 py-1 text-xs font-semibold uppercase tracking-[0.16em] text-slate-500",children:["Credit value ",h(s.credit_value||0)]})]}),(0,t.jsxs)("div",{className:"mt-4 grid gap-3 text-sm md:grid-cols-2 xl:grid-cols-4",children:[(0,t.jsxs)("div",{className:"rounded-xl bg-white px-3 py-3",children:[(0,t.jsx)("div",{className:"text-slate-500",children:"Available amount"}),(0,t.jsx)("div",{className:"mt-1 font-semibold text-[var(--brand-navy)]",children:h(s.available_amount||0)})]}),(0,t.jsxs)("div",{className:"rounded-xl bg-white px-3 py-3",children:[(0,t.jsx)("div",{className:"text-slate-500",children:"Available count"}),(0,t.jsx)("div",{className:"mt-1 font-semibold text-[var(--brand-navy)]",children:Number(s.available_count||0)})]}),(0,t.jsxs)("div",{className:"rounded-xl bg-white px-3 py-3",children:[(0,t.jsx)("div",{className:"text-slate-500",children:"Monthly redeemed"}),(0,t.jsx)("div",{className:"mt-1 font-semibold text-[var(--brand-navy)]",children:h(s.monthly_redeemed_amount||0)})]}),(0,t.jsxs)("div",{className:"rounded-xl bg-white px-3 py-3",children:[(0,t.jsx)("div",{className:"text-slate-500",children:"Monthly limit"}),(0,t.jsx)("div",{className:"mt-1 font-semibold text-[var(--brand-navy)]",children:s.monthly_limit_amount?h(s.monthly_limit_amount):s.monthly_limit_count?`${s.monthly_limit_count} credits`:"Unlimited"})]})]})]},e))}),(0,t.jsxs)("div",{className:"mt-6 rounded-[1.3rem] border border-[rgba(17,19,57,0.08)] bg-white p-5 shadow-sm",children:[(0,t.jsx)("div",{className:"text-sm font-semibold text-[var(--brand-navy)]",children:"Next expiring credits"}),(0,t.jsx)("div",{className:"mt-4 space-y-3",children:0===(D?.next_expiring_credits||[]).length?(0,t.jsx)("div",{className:"text-sm text-slate-600",children:"No expiring wallet credits right now."}):D?.next_expiring_credits?.map(e=>(0,t.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-3 rounded-xl bg-[rgba(17,19,57,0.04)] px-4 py-3 text-sm",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"font-semibold text-[var(--brand-navy)]",children:g(e.promo_category)}),(0,t.jsxs)("div",{className:"text-slate-500",children:["Expires ",v(e.expires_at)]})]}),(0,t.jsxs)("div",{className:"text-right",children:[(0,t.jsx)("div",{className:"font-semibold text-[var(--brand-red)]",children:h(e.remaining_amount||0)}),(0,t.jsxs)("div",{className:"text-slate-500",children:[Number(e.remaining_count||0)," credits left"]})]})]},e.id))})]})]}),(0,t.jsxs)("div",{className:"surface-card section-shell !p-6",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"section-eyebrow !border-[rgba(17,19,57,0.12)] !bg-[rgba(17,19,57,0.04)] !text-[var(--brand-red)]",children:"Transactions"}),(0,t.jsx)("h2",{className:"mt-4 text-2xl font-semibold text-[var(--brand-navy)]",children:"Promo wallet activity"}),(0,t.jsx)("p",{className:"mt-2 text-sm leading-6 text-slate-600",children:"Every credit and subscription redemption stays auditable here."})]}),(0,t.jsxs)("button",{type:"button",onClick:()=>void L(),disabled:N,className:"inline-flex items-center gap-2 rounded-xl border border-[rgba(17,19,57,0.12)] px-4 py-3 text-sm font-semibold text-[var(--brand-navy)] disabled:cursor-not-allowed disabled:opacity-60",children:[N?(0,t.jsx)(b.A,{className:"h-4 w-4 animate-spin"}):null,"Refresh"]})]}),(0,t.jsx)("div",{className:"mt-6 space-y-3",children:0===P.length?(0,t.jsx)("div",{className:"rounded-[1.4rem] border border-dashed border-[rgba(17,19,57,0.14)] bg-[rgba(17,19,57,0.02)] p-5 text-sm text-slate-600",children:"No promo wallet transactions available yet."}):P.map(e=>(0,t.jsxs)("article",{className:"rounded-[1.3rem] border border-[rgba(17,19,57,0.08)] bg-white p-4 shadow-sm",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)("span",{className:"rounded-full bg-[rgba(17,19,57,0.05)] px-3 py-1 text-xs font-semibold uppercase tracking-[0.16em] text-slate-600",children:g(e.transaction_type)}),(0,t.jsx)("span",{className:`rounded-full px-3 py-1 text-xs font-semibold uppercase tracking-[0.16em] ${"credit"===String(e.direction).toLowerCase()?"bg-emerald-50 text-emerald-700":"bg-amber-50 text-amber-700"}`,children:g(e.direction)})]}),(0,t.jsx)("div",{className:"mt-3 text-base font-semibold text-[var(--brand-navy)]",children:g(e.promo_category)}),(0,t.jsx)("div",{className:"mt-1 text-sm text-slate-500",children:e.remarks||"Promo wallet activity"})]}),(0,t.jsxs)("div",{className:"text-right",children:[(0,t.jsx)("div",{className:"text-lg font-semibold text-[var(--brand-red)]",children:h(e.amount||0)}),(0,t.jsxs)("div",{className:"text-xs text-slate-500",children:["Recorded ",v(e.created_at)]})]})]}),(0,t.jsxs)("div",{className:"mt-4 grid gap-3 text-sm md:grid-cols-2 xl:grid-cols-4",children:[(0,t.jsxs)("div",{className:"rounded-xl bg-[rgba(17,19,57,0.04)] px-3 py-3",children:[(0,t.jsx)("div",{className:"text-slate-500",children:"Credits"}),(0,t.jsx)("div",{className:"mt-1 font-semibold text-[var(--brand-navy)]",children:Number(e.credit_count||0)})]}),(0,t.jsxs)("div",{className:"rounded-xl bg-[rgba(17,19,57,0.04)] px-3 py-3",children:[(0,t.jsx)("div",{className:"text-slate-500",children:"Remaining amount"}),(0,t.jsx)("div",{className:"mt-1 font-semibold text-[var(--brand-navy)]",children:h(e.remaining_amount||0)})]}),(0,t.jsxs)("div",{className:"rounded-xl bg-[rgba(17,19,57,0.04)] px-3 py-3",children:[(0,t.jsx)("div",{cl
1assName:"text-slate-500",children:"Remaining count"}),(0,t.jsx)("div",{className:"mt-1 font-semibold text-[var(--brand-navy)]",children:Number(e.remaining_count||0)})]}),(0,t.jsxs)("div",{className:"rounded-xl bg-[rgba(17,19,57,0.04)] px-3 py-3",children:[(0,t.jsx)("div",{className:"text-slate-500",children:"Expires"}),(0,t.jsx)("div",{className:"mt-1 font-semibold text-[var(--brand-navy)]",children:v(e.expires_at)})]})]})]},e.id))})]})]})]})}},92263:(e,s,a)=>{a.d(s,{A:()=>t});let t=(0,a(53029).A)("EyeOff",[["path",{d:"M9.88 9.88a3 3 0 1 0 4.24 4.24",key:"1jxqfv"}],["path",{d:"M10.73 5.08A10.43 10.43 0 0 1 12 5c7 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68",key:"9wicm4"}],["path",{d:"M6.61 6.61A13.526 13.526 0 0 0 2 12s3 7 10 7a9.74 9.74 0 0 0 5.39-1.61",key:"1jreej"}],["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}]])}}]);
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.