1/*! For license information please see 5659.15cb88fc.chunk.js.LICENSE.txt */ 2"use strict";(self.webpackChunkfrontend=self.webpackChunkfrontend||[]).push([[5659],{7365(e,a,s){s.d(a,{A:()=>t});const t=(0,s(77784).A)("settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]])},19690(e,a,s){s.d(a,{Xi:()=>h,av:()=>p,j7:()=>u,tU:()=>x});var t=s(89379),l=s(53986),n=s(65043),i=s(47127),r=s(99766),c=s(70579);const d=["className"],o=["className"],m=["className"],x=i.bL,u=n.forwardRef((e,a)=>{let{className:s}=e,n=(0,l.A)(e,d);return(0,c.jsx)(i.B8,(0,t.A)({ref:a,className:(0,r.cn)("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",s)},n))});u.displayName=i.B8.displayName;const h=n.forwardRef((e,a)=>{let{className:s}=e,n=(0,l.A)(e,o);return(0,c.jsx)(i.l9,(0,t.A)({ref:a,className:(0,r.cn)("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",s)},n))});h.displayName=i.l9.displayName;const p=n.forwardRef((e,a)=>{let{className:s}=e,n=(0,l.A)(e,m);return(0,c.jsx)(i.UC,(0,t.A)({ref:a,className:(0,r.cn)("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",s)},n))});p.displayName=i.UC.displayName},25040(e,a,s){s.d(a,{A:()=>t});const t=(0,s(77784).A)("link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]])},40453(e,a,s){s.d(a,{A:()=>t});const t=(0,s(77784).A)("mouse-pointer",[["path",{d:"M12.586 12.586 19 19",key:"ea5xo7"}],["path",{d:"M3.688 3.037a.497.497 0 0 0-.651.651l6.5 15.999a.501.501 0 0 0 .947-.062l1.569-6.083a2 2 0 0 1 1.448-1.479l6.124-1.579a.5.5 0 0 0 .063-.947z",key:"277e5u"}]])},47127(e,a,s){s.d(a,{B8:()=>D,UC:()=>z,bL:()=>P,l9:()=>V});var t=s(89379),l=s(53986),n=s(65043),i=s(30858),r=s(21862),c=s(96711),d=s(52894),o=s(87914),m=s(14204),x=s(13642),u=s(54490),h=s(70579);const p=["__scopeTabs","value","onValueChange","defaultValue","orientation","dir","activationMode"],f=["__scopeTabs","loop"],j=["__scopeTabs","value","disabled"],v=["__scopeTabs","value","forceMount","children"];var b="Tabs",[g,N]=(0,r.A)(b,[c.RG]),y=(0,c.RG)(),[w,A]=g(b),C=n.forwardRef((e,a)=>{const{__scopeTabs:s,value:n,onValueChange:i,defaultValue:r,orientation:c="horizontal",dir:d,activationMode:f="automatic"}=e,j=(0,l.A)(e,p),v=(0,m.jH)(d),[g,N]=(0,x.i)({prop:n,onChange:i,defaultProp:null!==r&&void 0!==r?r:"",caller:b});return(0,h.jsx)(w,{scope:s,baseId:(0,u.B)(),value:g,onValueChange:N,orientation:c,dir:v,activationMode:f,children:(0,h.jsx)(o.sG.div,(0,t.A)((0,t.A)({dir:v,"data-orientation":c},j),{},{ref:a}))})});C.displayName=b;var k="TabsList",_=n.forwardRef((e,a)=>{const{__scopeTabs:s,loop:n=!0}=e,i=(0,l.A)(e,f),r=A(k,s),d=y(s);return(0,h.jsx)(c.bL,(0,t.A)((0,t.A)({asChild:!0},d),{},{orientation:r.orientation,dir:r.dir,loop:n,children:(0,h.jsx)(o.sG.div,(0,t.A)((0,t.A)({role:"tablist","aria-orientation":r.orientation},i),{},{ref:a}))}))});_.displayName=k;var M="TabsTrigger",R=n.forwardRef((e,a)=>{const{__scopeTabs:s,value:n,disabled:r=!1}=e,d=(0,l.A)(e,j),m=A(M,s),x=y(s),u=L(m.baseId,n),p=S(m.baseId,n),f=n===m.value;return(0,h.jsx)(c.q7,(0,t.A)((0,t.A)({asChild:!0},x),{},{focusable:!r,active:f,children:(0,h.jsx)(o.sG.button,(0,t.A)((0,t.A)({type:"button",role:"tab","aria-selected":f,"aria-controls":p,"data-state":f?"active":"inactive","data-disabled":r?"":void 0,disabled:r,id:u},d),{},{ref:a,onMouseDown:(0,i.mK)(e.onMouseDown,e=>{r||0!==e.button||!1!==e.ctrlKey?e.preventDefault():m.onValueChange(n)}),onKeyDown:(0,i.mK)(e.onKeyDown,e=>
2{[" ","Enter"].includes(e.key)&&m.onValueChange(n)}),onFocus:(0,i.mK)(e.onFocus,()=>{const e="manual"!==m.activationMode;f||r||!e||m.onValueChange(n)})}))}))});R.displayName=M;var U="TabsContent",T=n.forwardRef((e,a)=>{const{__scopeTabs:s,value:i,forceMount:r,children:c}=e,m=(0,l.A)(e,v),x=A(U,s),u=L(x.baseId,i),p=S(x.baseId,i),f=i===x.value,j=n.useRef(f);return n.useEffect(()=>{const e=requestAnimationFrame(()=>j.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,h.jsx)(d.C,{present:r||f,children:s=>{let{present:l}=s;return(0,h.jsx)(o.sG.div,(0,t.A)((0,t.A)({"data-state":f?"active":"inactive","data-orientation":x.orientation,role:"tabpanel","aria-labelledby":u,hidden:!l,id:p,tabIndex:0},m),{},{ref:a,style:(0,t.A)((0,t.A)({},e.style),{},{animationDuration:j.current?"0s":void 0}),children:l&&c}))}})});function L(e,a){return"".concat(e,"-trigger-").concat(a)}function S(e,a){return"".concat(e,"-content-").concat(a)}T.displayName=U;var P=C,D=_,V=R,z=T},50516(e,a,s){s.d(a,{A:()=>t});const t=(0,s(77784).A)("refresh-cw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]])},59938(e,a,s){s.d(a,{J:()=>x});var t=s(89379),l=s(53986),n=s(65043),i=s(65131),r=s(10917),c=s(99766),d=s(70579);const o=["className"],m=(0,r.F)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),x=n.forwardRef((e,a)=>{let{className:s}=e,n=(0,l.A)(e,o);return(0,d.jsx)(i.b,(0,t.A)({ref:a,className:(0,c.cn)(m(),s)},n))});x.displayName=i.b.displayName},62029(e,a,s){s.d(a,{A:()=>t});const t=(0,s(77784).A)("wallet",[["path",{d:"M19 7V4a1 1 0 0 0-1-1H5a2 2 0 0 0 0 4h15a1 1 0 0 1 1 1v4h-3a2 2 0 0 0 0 4h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1",key:"18etb6"}],["path",{d:"M3 5v14a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1v-4",key:"xoc0q4"}]])},65131(e,a,s){s.d(a,{b:()=>m});var t=s(89379),l=s(65043),n=s(53986),i=(s(97950),s(16851)),r=s(70579);const c=["asChild"];var d=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,a)=>{const s=(0,i.TL)("Primitive.".concat(a)),d=l.forwardRef((e,l)=>{const{asChild:i}=e,d=(0,n.A)(e,c),o=i?s:a;return"undefined"!==typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,r.jsx)(o,(0,t.A)((0,t.A)({},d),{},{ref:l}))});return d.displayName="Primitive.".concat(a),(0,t.A)((0,t.A)({},e),{},{[a]:d})},{});var o=l.forwardRef((e,a)=>(0,r.jsx)(d.label,(0,t.A)((0,t.A)({},e),{},{ref:a,onMouseDown:a=>{var s;a.target.closest("button, input, select, textarea")||(null===(s=e.onMouseDown)||void 0===s||s.call(e,a),!a.defaultPrevented&&a.detail>1&&a.preventDefault())}})));o.displayName="Label";var m=o},65659(e,a,s){s.r(a),s.d(a,{default:()=>D});var t=s(89379),l=s(65043),n=s(45029),i=s(53880),r=s(13390),c=s(91140),d=s(92264),o=s(59938),m=s(19690),x=s(27033),u=s(77819),h=s(82054),p=s(67010),f=s(28646),j=s(75088),v=s(72313),b=s(73062),g=s(70764),N=s(25040),y=s(40453),w=s(50516),A=s(7365),C=s(23165),k=s(44919),_=s(7118),M=s(62029),R=s(20073),U=s(56328),T=s(87975),L=s(84370),S=s(70579);const P=e=>{let{affiliateCode:a,copyToClipboard:s,copiedLink:n}=e;const[i,m]=(0,l.useState)({baseUrl:"https://hearclear.in/products",utmSource:"affiliate",utmMedium:"referral",utmCampaign:"",utmContent:""}),[x,u]=(0,l.useState)("");(0,l.useEffect)(()=>{p()},[i,a]);const p=()=>{const e=new URLSearchParams;e.set("ref",a),i.utmSource&&e.set("utm_source",i.utmSource),i.utmMedium&&e.set("utm_medium",i.utmMedium),i.utmCampaign&&e.set("utm_campaign",i.utmCampaign.replace(/\s+/g,"_").toLowerCase()),i.utmContent&&e.set("utm_content",i.utmContent),u("".concat(i.baseUrl,"?").concat(e.toString()))};return(0,S.jsxs)(c.Zp,{children:[(0,S.jsxs)(c.aR,{children:[(0,S.jsxs)(c.ZB,{className:"flex items-center gap-2",children:[(0,S.jsx)(A.A,{className:"w-5 h-5"}),"UTM Campaign Builder"]}),(0,S.jsx)("p",{className:"text-sm text-slate-500",children:"Create custom tracking links for your campaigns"})]}),(0,S.jsxs)(c.Wu,{className:"space-y-6",children:[(0,S.jsxs)("div",{className:"grid md:grid-cols-2 gap-4",children:[(0,S.jsxs)("div",{children:[(0,S.jsx)(o.J,{children:"Landing Page"}),(0,S.jsxs)(L.l6,{value:i.baseUrl,onValueChange:e=>m(a=>(0,t.A)((0,t.A)({},a),{},{baseUrl:e})),children:[(0,S.jsx)(L.bq,{children:(0,S.jsx)(L.yv,{})}),(0,S.jsx)(L.gC,{children:[{label:"Homepage",value:"https://hearclear.in"},{label:"Products",value:"https://hearclear.in/products"},{label:"Book Appointment",value:"https://hearclear.in/book-appointment"},{label:"Signia Hearing Aids",value:"https://hearclear.in/signia-hearing-aids"},{label:"ReSound Hearing Aids",value:"https://hearclear.in/resound-hearing-aids"},{label:"Widex Hearing Aids",value:"https://hearclear.in/widex-hearing-aids"},{label:"Delhi Landing Page",value:"https://hearclear.in/hearing-aids-delhi"},{label:"Bangalore Landing Page",value:"https://hearclear.in/hearing-aids-bangalore"}].map(e=>(0,S.jsx)(L.eb,{value:e.value,children:e.label},e.value))})]})]}),(0,S.jsxs)("div",{children:[(0,S.jsx)(o.J,{children:"UTM Source"}),(0,S.jsxs)(L.l6,{value:i.utmSource,onValueChange:e=>m(a=>(0,t.A)((0,t.A)({},a),{},{utmSource:e})),children:[(0,S.jsx)(L.bq,{children:(0,S.jsx)(L.yv,{})}),(0,S.jsx)(L.gC,{children:["affiliate","partner","influencer","blog","youtube","instagram","facebook","whatsapp"].map(e=>(0,S.jsx)(L.eb,{value:e,children:e},e))})]})]}),(0,S.jsxs)("div",{children:[(0,S.jsx)(o.J,{children:"UTM Medium"}),(0,S.jsxs)(L.l6,{value:i.utmMedium,onValueChange:e=>m(a=>(0,t.A)((0,t.A)({},a),{},{utmMedium:e})),children:[(0,S.jsx)(L.bq,{children:(0,S.jsx)(L.yv,{})}),(0,S.jsx)(L.gC,{children:["referral","social","email","banner","video","bio_link","story","post"].map(e=>(0,S.jsx)(L.eb,{value:e,children:e},e))})]})]}),(0,S.jsxs)("div",{children:[(0,S.jsx)(o.J,{children:"UTM Content (Optional)"}),(0,S.jsxs)(L.l6,{value:i.utmContent||"none",onValueChange:e=>m(a=>(0,t.A)((0,t.A)({},a),{},{utmContent:"none"===e?"":e})),children:[(0,S.jsx)(L.bq,{children:(0,S.jsx)(L.yv,{placeholder:"Select content type"})}),(0,S.jsxs)(L.gC,{children:[(0,S.jsx)(L.eb,{value:"none",children:"None"}),["banner_728x90","banner_300x250","text_link","video_desc","bio_link","story_swipeup","carousel"].map(e=>(0,S.jsx)(L.eb,{value:e,children:e},e))]})]})]})]}),(0,S.jsxs)("div",{children:[(0,S.jsx)(o.J,{children:"Campaign Name"}),(0,S.jsx)(d.p,{value:i.utmCampaign,onChange:e=>m(a=>(0,t.A)((0,t.A)({},a),{},{utmCampaign:e.target.value})),placeholder:"e.g., summer_sale_2025, hearing_aid_review"}),(0,S.jsx)("p",{className:"text-xs text-slate-500 mt-1",children:"Use descriptive names to track performance"})]}),(0,S.jsxs)("div",{className:"bg-slate-50 rounded-lg p-4",children:[(0,S.jsx)(o.J,{className:"text-slate-700",children:"Generated URL"}),(0,S.jsxs)("div",{className:"flex gap-2 mt-2",children:[(0,S.jsx)(d.p,{value:x,readOnly:!0,className:"font-mono text-sm bg-white"}),(0,S.jsxs)(r.$,{onClick:()=>s(x,"utm-url"),className:"gap-2 shrink-0",children:["utm-url"===n?(0,S.jsx)(h.A,{className:"w-4 h-4"}):(0,S.jsx)(v.A,{className:"w-4 h-4"}),"Copy"]})]})]}),(0,S.jsxs)("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-4",children:[(0,S.jsxs)("h4",{className:"font-semibold text-blue-800 mb-2 flex items-center gap-2",children:[(0,S.jsx)(R.A,{className:"w-4 h-4"}),"Pro Tips"]}),(0,S.jsxs)("ul",{className:"text-sm text-blue-700 space-y-1",children:[(0,S.jsx)("li",{children:"\u2022 Use unique campaign names for each promotion to track performance"}),(0,S.jsx)("li",{children:"\u2022 Match UTM source with your actual traffic source (instagram, youtube, blog)"}),(0,S.jsx)("li",{children:"\u2022 Use UTM content to differentiate between ad variations"}),(0,S.jsx)("li",{children:"\u2022 All clicks are tracked with your affiliate code automatically"})]})]})]})]})},D=()=>{var e,a;const[s]=(0,n.ok)(),[t,R]=(0,l.useState)(s.get("code")||""),[L,D]=(0,l.useState)(""),[V,z]=(0,l.useState)(null),[Z,q]=(0,l.useState)(!1),[B,I]=(0,l.useState)(null),[H,J]=(0,l.useState)(null);(0,l.useEffect)(()=>{const e=s.get("code");e&&(R(e),F(e))},[s]);const F=async e=>{if(e){q(!0),I(null);try{const a=await T.nC.get("/affiliate/dashboard/".concat(e));z(a.data)}catch(s){var a;404===(null===(a=s.response)||void 0===a?void 0:a.status)?I("Invalid affiliate code. Please check and try again."):I("Failed to load dashboard. Please try again."),z(null)}finally{q(!1)}}},$=e=>{e.preventDefault(),L.trim()&&(R(L.trim().toUpperCase()),F(L.trim().toUpperCase()),window.history.pushState({},"","/affiliate/dashboard?code=".concat(L.trim().toUpperCase())))},W=(e,a)=>{navigator.clipboard.writeText(e),J(a),U.oR.success("Link copied to clipboard!"),setTimeout(()=>J(null),2e3)},G=e=>new Intl.NumberFormat("en-IN",{style:"currency",currency:"INR",maximumFractionDigits:0}).format(e);if(!V&&!Z)return(0,S.jsxs)("div",{className:"min-h-screen bg-slate-50 py-12",children:[(0,S.jsxs)(i.mg,{children:[(0,S.jsx)("title",{children:"Affiliate Dashboard - HearClear India"}
2),(0,S.jsx)("meta",{name:"description",content:"Access your HearClear affiliate dashboard to track clicks, conversions, and earnings."}),(0,S.jsx)("meta",{name:"robots",content:"noindex, nofollow"})]}),(0,S.jsx)("div",{className:"container-xl",children:(0,S.jsx)("div",{className:"max-w-md mx-auto",children:(0,S.jsxs)(c.Zp,{className:"p-8",children:[(0,S.jsxs)("div",{className:"text-center mb-8",children:[(0,S.jsx)("div",{className:"w-16 h-16 bg-emerald-100 rounded-full flex items-center justify-center mx-auto mb-4",children:(0,S.jsx)(x.A,{className:"w-8 h-8 text-emerald-600"})}),(0,S.jsx)("h1",{className:"text-2xl font-bold text-slate-800 mb-2",children:"Affiliate Dashboard"}),(0,S.jsx)("p",{className:"text-slate-600",children:"Enter your affiliate code to view your stats"})]}),B&&(0,S.jsxs)("div",{className:"bg-red-50 border border-red-200 text-red-700 px-4 py-3 rounded-lg mb-6 flex items-center gap-2",children:[(0,S.jsx)(u.A,{className:"w-5 h-5"}),B]}),(0,S.jsxs)("form",{onSubmit:$,className:"space-y-4",children:[(0,S.jsxs)("div",{children:[(0,S.jsx)(o.J,{htmlFor:"code",children:"Affiliate Code"}),(0,S.jsx)(d.p,{id:"code",value:L,onChange:e=>D(e.target.value.toUpperCase()),placeholder:"e.g., HC12AB34CD",className:"text-center text-lg font-mono tracking-wider","data-testid":"affiliate-code-input"})]}),(0,S.jsx)(r.$,{type:"submit",className:"w-full",size:"lg","data-testid":"view-dashboard-btn",children:"View Dashboard"})]}),(0,S.jsxs)("div",{className:"mt-8 pt-6 border-t text-center",children:[(0,S.jsx)("p",{className:"text-slate-600 text-sm mb-3",children:"Don't have an affiliate code?"}),(0,S.jsx)(n.N_,{to:"/affiliate",children:(0,S.jsxs)(r.$,{variant:"outline",className:"gap-2",children:[(0,S.jsx)(_.A,{className:"w-4 h-4"}),"Join Affiliate Program"]})})]})]})})})]});if(Z)return(0,S.jsx)("div",{className:"min-h-screen bg-slate-50 py-12",children:(0,S.jsx)("div",{className:"container-xl",children:(0,S.jsx)("div",{className:"flex items-center justify-center py-20",children:(0,S.jsx)(w.A,{className:"w-8 h-8 animate-spin text-emerald-600"})})})});const{affiliate:E,stats:K,recent_conversions:X,affiliate_links:O,promo_materials:Y}=V;return(0,S.jsxs)("div",{className:"min-h-screen bg-slate-50 py-8",children:[(0,S.jsxs)(i.mg,{children:[(0,S.jsxs)("title",{children:["Affiliate Dashboard - ",null===E||void 0===E?void 0:E.name," | HearClear India"]}),(0,S.jsx)("meta",{name:"robots",content:"noindex, nofollow"})]}),(0,S.jsxs)("div",{className:"container-xl",children:[(0,S.jsxs)("div",{className:"flex flex-col md:flex-row md:items-center md:justify-between gap-4 mb-8",children:[(0,S.jsxs)("div",{children:[(0,S.jsxs)("div",{className:"flex items-center gap-3 mb-2",children:[(0,S.jsxs)("h1",{className:"text-3xl font-bold text-slate-800",children:["Welcome, ",null===E||void 0===E?void 0:E.name]}),(e=>{const a={pending:{bg:"bg-yellow-100",text:"text-yellow-700",label:"Pending Approval"},approved:{bg:"bg-green-100",text:"text-green-700",label:"Active"},rejected:{bg:"bg-red-100",text:"text-red-700",label:"Rejected"}},s=a[e]||a.pending;return(0,S.jsx)("span",{className:"px-3 py-1 rounded-full text-sm font-medium ".concat(s.bg," ").concat(s.text),children:s.label})})(null===E||void 0===E?void 0:E.status)]}),(0,S.jsxs)("div",{className:"flex items-center gap-4 text-slate-600",children:[(0,S.jsx)("span",{className:"font-mono bg-slate-100 px-3 py-1 rounded",children:t}),(e=>{const a={bronze:{bg:"bg-amber-100",text:"text-amber-700",border:"border-amber-200"},silver:{bg:"bg-slate-100",text:"text-slate-700",border:"border-slate-300"},gold:{bg:"bg-yellow-100",text:"text-yellow-700",border:"border-yellow-300"},platinum:{bg:"bg-purple-100",text:"text-purple-700",border:"border-purple-300"}},s=a[e]||a.bronze;return(0,S.jsx)("span",{className:"px-3 py-1 rounded-full text-sm font-bold uppercase ".concat(s.bg," ").concat(s.text," border ").concat(s.border),children:e})})(null===E||void 0===E?void 0:E.tier),(0,S.jsxs)("span",{className:"text-emerald-600 font-semibold",children:[null===E||void 0===E?void 0:E.commission_rate," Commission"]})]})]}),(0,S.jsxs)(r.$,{onClick:()=>F(t),variant:"outline",className:"gap-2",children:[(0,S.jsx)(w.A,{className:"w-4 h-4"}),"Refresh"]})]}),"pending"===(null===E||void 0===E?void 0:E.status)&&(0,S.jsxs)("div",{className:"bg-yellow-50 border border-yellow-200 rounded-xl p-4 mb-6 flex items-center gap-3",children:[(0,S.jsx)(j.A,{className:"w-6 h-6 text-yellow-600"}),(0,S.jsxs)("div",{children:[(0,S.jsx)("p",{className:"font-medium text-yellow-800",children:"Application Under Review"}),(0,S.jsx)("p",{className:"text-sm text-yellow-700",children:"Your affiliate application is being reviewed. You'll receive an email once approved."})]})]}),(0,S.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 mb-8",children:[(0,S.jsxs)(c.Zp,{className:"p-6",children:[(0,S.jsx)("div",{className:"flex items-center gap-3 mb-3",children:(0,S.jsx)("div",{className:"w-10 h-10 bg-blue-100 rounded-lg flex items-center justify-center",children:(0,S.jsx)(y.A,{className:"w-5 h-5 text-blue-600"})})}),(0,S.jsx)("p",{className:"text-3xl font-bold text-slate-800",children:(null===K||void 0===K?void 0:K.total_clicks)||0}),(0,S.jsx)("p",{className:"text-sm text-slate-500",children:"Total Clicks"}),(0,S.jsxs)("p",{className:"text-xs text-blue-600 mt-1",children:[(null===K||void 0===K?void 0:K.recent_clicks_30d)||0," last 30 days"]})]}),(0,S.jsxs)(c.Zp,{className:"p-6",children:[(0,S.jsx)("div",{className:"flex items-center gap-3 mb-3",children:(0,S.jsx)("div",{className:"w-10 h-10 bg-green-100 rounded-lg flex items-center justify-center",children:(0,S.jsx)(k.A,{className:"w-5 h-5 text-green-600"})})}),(0,S.jsx)("p",{className:"text-3xl font-bold text-slate-800",children:(null===K||void 0===K?void 0:K.total_conversions)||0}),(0,S.jsx)("p",{className:"text-sm text-slate-500",children:"Conversions"}),(0,S.jsxs)("p",{className:"text-xs text-green-600 mt-1",children:[(null===K||void 0===K?void 0:K.conversion_rate)||"0%"," rate"]})]}),(0,S.jsxs)(c.Zp,{className:"p-6",children:[(0,S.jsx)("div",{className:"flex items-center gap-3 mb-3",children:(0,S.jsx)("div",{className:"w-10 h-10 bg-emerald-100 rounded-lg flex items-center justify-center",children:(0,S.jsx)(b.A,{className:"w-5 h-5 text-emerald-600"})})}),(0,S.jsx)("p",{className:"text-3xl font-bold text-slate-800",children:G((null===K||void 0===K?void 0:K.total_earnings)||0)}),(0,S.jsx)("p",{className:"text-sm text-slate-500",children:"Total Earnings"}),(0,S.jsxs)("p",{className:"text-xs text-emerald-600 mt-1",children:[G((null===K||void 0===K?void 0:K.total_sales)||0)," in sales"]})]}),(0,S.jsxs)(c.Zp,{className:"p-6",children:[(0,S.jsx)("div",{className:"flex items-center gap-3 mb-3",children:(0,S.jsx)("div",{className:"w-10 h-10 bg-purple-100 rounded-lg flex items-center justify-center",children:(0,S.jsx)(M.A,{className:"w-5 h-5 text-purple-600"})})}),(0,S.jsx)("p",{className:"text-3xl font-bold text-slate-800",children:G((null===K||void 0===K?void 0:K.pending_payout)||0)}),(0,S.jsx)("p",{className:"text-sm text-slate-500",children:"Pending Payout"}),(0,S.jsxs)("p",{className:"text-xs text-purple-600 mt-1",children:[G((null===K||void 0===K?void 0:K.paid_out)||0)," paid"]})]})]}),(null===E||void 0===E?void 0:E.next_tier)&&(0,S.jsx)(c.Zp,{className:"p-6 mb-8 bg-gradient-to-r from-emerald-50 to-teal-50 border-emerald-200",children:(0,S.jsxs)("div",{className:"flex items-center justify-between",children:[(0,S.jsxs)("div",{children:[(0,S.jsxs)("h3",{className:"font-semibold text-slate-800 mb-1",children:["Unlock ",E.next_tier.tier.toUpperCase()," Tier"]}),(0,S.jsxs)("p",{className:"text-slate-600",children:[E.next_tier.sales_needed," more sales to earn ",E.next_tier.commission," commission"]})]}),(0,S.jsx)("div",{className:"text-right",children:(0,S.jsx)(C.A,{className:"w-8 h-8 text-emerald-600"})})]})}),(0,S.jsxs)(m.tU,{defaultValue:"links",className:"space-y-6",children:[(0,S.jsxs)(m.j7,{className:"bg-white shadow-sm",children:[(0,S.jsxs)(m.Xi,{value:"links",className:"gap-2",children:[(0,S.jsx)(N.A,{className:"w-4 h-4"}),"Affiliate Links"]}),(0,S.jsxs)(m.Xi,{value:"utm",className:"gap-2",children:[(0,S.jsx)(A.A,{className:"w-4 h-4"}),"UTM Builder"]}),(0,S.jsxs)(m.Xi,{value:"conversions",className:"gap-2",children:[(0,S.jsx)(k.A,{className:"w-4 h-4"}),"Conversions"]}),(0,S.jsxs)(m.Xi,{value:"materials",className:"gap-2",children:[(0,S.jsx)(g.A,{className:"w-4 h-4"}),"Promo Materials"]})]}),(0,S.jsx)(m.av,{value:"links",children:(0,S.jsxs)(c.Zp,{children:[(0,S.jsx)(c.aR,{children:(0,S.jsxs)(c.ZB,{className:"flex items-center gap-2",children:[(0,S.jsx)(N.A,{className:"w-5 h-5"}),"Your Affiliate Links"]})}),(0,S.jsx)(c.Wu,{className:"space-y-4",children:O&&Object.entries(O).map(e=>{let[a,s]=e;return(0,S.jsxs)("div",{className:"flex items-center justify-between p-4 bg-slate-50 rounded-lg",children:[(0,S.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,S.jsx)("p",{className:"font-medium text-slate-800 capitalize",children:a.replace(/_/g," ")}),(0,S.jsx)("p",{className:"text-sm text-slate-500 truncate",children:s})]}),(0,S.jsxs)("div",{className:"flex gap-2 ml-4",children:[(0,S.jsxs)(r.$,{variant:"outline",size:"sm",onClick:()=>W(s,a),className:"gap-2",children:[H===a?(0,S.jsx)(h.A,{className:"w-4 h-4 text-green-500"}):(0,S.jsx)(v.A,{className:"w-4 h-4"}),"Copy"]}),(0,S.jsx)("a",{href:s,target:"_blank",rel:"noopener noreferrer",children:(0,S.jsx)(r.$,{variant:"ghost",size:"sm",children:(0,S.jsx)(g.A,{className:"w-4 h-4"})})})]})]},a)})})]})}),(0,S.jsx)(m.av,{value:"utm",children:(0,S.jsx)(P,{affiliateCode:t,copyToClipboard:W,copiedLink:H})}),(0,S.jsx)(m.av,{value:"conversions",children:(0,S.jsxs)(c.Zp,{children:[(0,S.jsx)(c.aR,{children:(0,S.jsxs)(c.ZB,{className:"flex items-center gap-2",children:[(0,S.jsx)(k.A,{className:"w-5 h-5"}),"Recent Conversions"]})}),(0,S.jsx)(c.Wu,{children:X&&X.length>0?(0,S.jsx)("div",{className:"space-y-4",children:X.map((e,a)=>{var s;return(0,S.jsxs)("div",{className:"flex items-center justify-between p-4 bg-slate-50 rounded-lg",children:[(0,S.jsxs)("div",{children:[(0,S.jsxs)("p",{className:"font-medium text-slate-800",children:["Order #",null===(s=e.order_id)||void 0===s?void 0:s.slice(-8)]}),(0,S.jsxs)("p",{className:"text-sm text-slate-500 flex items-center gap-1",children:[(0,S.jsx)(f.A,{className:"w-3 h-3"}),new Date(e.created_at).toLocaleDateString("en-IN")]})]}),(0,S.jsxs)("div",{className:"text-right",children:[(0,S.jsx)("p",{className:"font-bold text-emerald-600",children:G(e.commission)}),(0,S.jsxs)("p",{className:"text-sm text-slate-500",children:[G(e.sale_amount)," sale"]})]})]},a)})}):(0,S.jsxs)("div",{className:"text-center py-12",children:[(0,S.jsx)(k.A,{className:"w-12 h-12 text-slate-300 mx-auto mb-4"}),(0,S.jsx)("p",{className:"text-slate-600",children:"No conversions yet"}),(0,S.jsx)("p",{className:"text-sm text-slate-500",children:"Share your affiliate links to start earning!"})]})})]})}),(0,S.jsx)(m.av,{value:"materials",children:(0,S.jsxs)("div",{className:"space-y-6",children:[(0,S.jsxs)(c.Zp,{children:[(0,S.jsx)(c.aR,{children:(0,S.jsx)(c.ZB,{children:"Banner Ads"})}),(0,S.jsx)(c.Wu,{children:(0,S.jsx)("div",{className:"grid md:grid-cols-3 gap-4",children:null===Y||void 0===Y||null===(e=Y.banners)||void 0===e?void 0:e.map((e,a)=>(0,S.jsxs)("div",{className:"p-4 border rounded-lg text-center",children:[(0,S.jsx)("div",{className:"bg-slate-100 rounded-lg p-4 mb-3 h-24 flex items-center justify-center",children:(0,S.jsx)("span",{className:"text-slate-500 text-sm",children:e.size})}),(0,S.jsxs)(r.$,{variant:"outline",size:"sm",onClick:()=>W(e.url,"banner-".concat(a)),className:"w-full gap-2",children:[H==="banner-".concat(a)?(0,S.jsx)(h.A,{className:"w-4 h-4 text-green-500"}):(0,S.jsx)(v.A,{className:"w-4 h-4"}),"Copy URL"]})]},a))})})]}),(0,S.jsxs)(c.Zp,{children:[(0,S.jsx)(c.aR,{children:(0,S.jsx)(c.ZB,{children:"Ready-to-Use Text Links"})}),(0,S.jsx)(c.Wu,{className:"space-y-4",children:null===Y||void 0===Y||null===(a=Y.text_links)||void 0===a?void 0:a.map((e,a)=>(0,S.jsxs)("div",{className:"flex items-center justify-between p-4 bg-slate-50 rounded-lg",children:[(0,S.jsxs)("div",{className:"flex-1",children:[(0,S.jsx)("p",{className:"font-medium text-slate-800",children:e.text}),(0,S.jsx)("p",{className:"text-sm text-slate-500 truncate",children:e.url})]}),(0,S.jsxs)(r.$,{variant:"outline",size:"sm",onClick:()=>W('<a href="'.concat(e.url,'">').concat(e.text,"</a>"),"text-".concat(a)),className:"gap-2 ml-4",children:[H==="text-".concat(a)?(0,S.jsx)(h.A,{className:"w-4 h-4 text-green-500"}):(0,S.jsx)(v.A,{className:"w-4 h-4"}),"Copy HTML"]})]},a))})]})]})})]}),(0,S.jsx)(c.Zp,{className:"mt-8 p-6 bg-slate-800 text-white",children:(0,S.jsxs)("div",{className:"flex items-center justify-between",children:[(0,S.jsxs)("div",{children:[(0,S.jsx)("h3",{className:"text-lg font-semibold mb-1",children:"Need Help?"}),(0,S.jsx)("p",{className:"text-slate-300",children:"Contact your affiliate manager for support"})]}),(0,S.jsx)("a",{href:"mailto:[email protected]",children:(0,S.jsxs)(r.$,{variant:"secondary",className:"gap-2",children:[(0,S.jsx)(p.A,{className:"w-4 h-4"}),"Contact Support"]})})]})})]})]})}},67010(e,a,s){s.d(a,{A:()=>t});const t=(0,s(77784).A)("arrow-up-right",[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]])},72313(e,a,s){s.d(a,{A:()=>t});
2const t=(0,s(77784).A)("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]])},75088(e,a,s){s.d(a,{A:()=>t});const t=(0,s(77784).A)("clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]])},77819(e,a,s){s.d(a,{A:()=>t});const t=(0,s(77784).A)("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]])},84370(e,a,s){s.d(a,{bq:()=>N,eb:()=>C,gC:()=>A,l6:()=>b,yv:()=>g});var t=s(89379),l=s(53986),n=s(65043),i=s(70962),r=s(36210),c=s(92382),d=s(15711),o=s(99766),m=s(70579);const x=["className","children"],u=["className"],h=["className"],p=["className","children","position"],f=["className"],j=["className","children"],v=["className"],b=i.bL,g=(i.YJ,i.WT),N=n.forwardRef((e,a)=>{let{className:s,children:n}=e,r=(0,l.A)(e,x);return(0,m.jsxs)(i.l9,(0,t.A)((0,t.A)({ref:a,className:(0,o.cn)("flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",s)},r),{},{children:[n,(0,m.jsx)(i.In,{asChild:!0,children:(0,m.jsx)(c.A,{className:"h-4 w-4 opacity-50"})})]}))});N.displayName=i.l9.displayName;const y=n.forwardRef((e,a)=>{let{className:s}=e,n=(0,l.A)(e,u);return(0,m.jsx)(i.PP,(0,t.A)((0,t.A)({ref:a,className:(0,o.cn)("flex cursor-default items-center justify-center py-1",s)},n),{},{children:(0,m.jsx)(d.A,{className:"h-4 w-4"})}))});y.displayName=i.PP.displayName;const w=n.forwardRef((e,a)=>{let{className:s}=e,n=(0,l.A)(e,h);return(0,m.jsx)(i.wn,(0,t.A)((0,t.A)({ref:a,className:(0,o.cn)("flex cursor-default items-center justify-center py-1",s)},n),{},{children:(0,m.jsx)(c.A,{className:"h-4 w-4"})}))});w.displayName=i.wn.displayName;const A=n.forwardRef((e,a)=>{let{className:s,children:n,position:r="popper"}=e,c=(0,l.A)(e,p);return(0,m.jsx)(i.ZL,{children:(0,m.jsxs)(i.UC,(0,t.A)((0,t.A)({ref:a,className:(0,o.cn)("relative z-50 max-h-[--radix-select-content-available-height] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-select-content-transform-origin]","popper"===r&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",s),position:r},c),{},{children:[(0,m.jsx)(y,{}),(0,m.jsx)(i.LM,{className:(0,o.cn)("p-1","popper"===r&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:n}),(0,m.jsx)(w,{})]}))})});A.displayName=i.UC.displayName;n.forwardRef((e,a)=>{let{className:s}=e,n=(0,l.A)(e,f);return(0,m.jsx)(i.JU,(0,t.A)({ref:a,className:(0,o.cn)("px-2 py-1.5 text-sm font-semibold",s)},n))}).displayName=i.JU.displayName;const C=n.forwardRef((e,a)=>{let{className:s,children:n}=e,c=(0,l.A)(e,j);return(0,m.jsxs)(i.q7,(0,t.A)((0,t.A)({ref:a,className:(0,o.cn)("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",s)},c),{},{children:[(0,m.jsx)("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,m.jsx)(i.VF,{children:(0,m.jsx)(r.A,{className:"h-4 w-4"})})}),(0,m.jsx)(i.p4,{children:n})]}))});C.displayName=i.q7.displayName;n.forwardRef((e,a)=>{let{className:s}=e,n=(0,l.A)(e,v);return(0,m.jsx)(i.wv,(0,t.A)({ref:a,className:(0,o.cn)("-mx-1 my-1 h-px bg-muted",s)},n))}).displayName=i.wv.displayName}}]); 3//# sourceMappingURL=5659.15cb88fc.chunk.js.map
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.