try{!function(){var e="u">typeof window?window:"u">typeof global?global:"u">typeof globalThis?globalThis:"u">typeof self?self:{},s=(new e.Error).stack;s&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[s]="6e367bee-8c8d-48c1-b969-59b22298cfca",e._sentryDebugIdIdentifier="sentry-dbid-6e367bee-8c8d-48c1-b969-59b22298cfca")}()}catch(e){}(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3771],{15343:(e,s,a)=>{"use strict";a.d(s,{B:()=>d});var t=a(12115),r=a(27335),n=a(17546);let i=null,l=null,o=null;function d(e){let s=(0,r.T)(),a=e??s,[d,c]=(0,t.useState)(l===a&&i?i:[]),[m,x]=(0,t.useState)(!(l===a&&i));return(0,t.useEffect)(()=>{let e=!1;if(a){if(l===a&&i){c(i),x(!1);return}return null!==l&&l!==a&&(i=null,o=null),o||(l=a,o=n._.listByPortal({portalId:a}).then(e=>{let s=e.tiers.sort((e,s)=>e.threshold-s.threshold);return l===a&&(i=s),s}).catch(e=>(console.error("Failed to fetch tiers:",e),l=null,o=null,[]))),x(!0),o.then(s=>{e||(c(s),x(!1))}),()=>{e=!0}}},[a]),{tiers:d,loading:m}}},30609:(e,s,a)=>{"use strict";a.r(s),a.d(s,{default:()=>ej});var t=a(95155),r=a(12115),n=a(2834),i=a(89273),l=a(71572),o=a(59319),d=a(99241),c=a(81518),m=a(85410),x=a(97691),h=a(87474),u=a(52115),f=a(15343),p=a(69866);let b=function({show:e,onHide:s}){let{t:a}=(0,m.ok)(),{convert:n,currency:i}=(0,l.H2)(),{tiers:o,loading:d}=(0,f.B)(),c=(0,r.useMemo)(()=>{let e=(0,l.Qn)(i);return o.map(s=>{let t=n(s.threshold,"USD",i).toLocaleString();return{buttonText:(0,p.ND)(s.tier),text:a("dashboard.common.tierReachAmount","-- Reach {{amount}} {{symbol}} total revshare",{amount:t,symbol:e}),class:s.tier.toLowerCase(),percentage:`${s.revsharePercentage}%`}})},[o,n,i,a]);return(0,t.jsx)(u.RF,{open:e,onOpenChange:e=>!e&&s(),title:a("dashboard.earningSection.upgradeTier.title","Move up to the next tier – here's how it works!"),variant:"fixed-width",headerClassName:"items-start",children:(0,t.jsx)(u.xj,{children:d?(0,t.jsx)("div",{className:"flex justify-center p-4",children:(0,t.jsx)("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-sys-bg-brand-primary",children:(0,t.jsx)("span",{className:"sr-only",children:a("common.loading","Loading...")})})}):(0,t.jsx)("div",{className:"flex flex-col gap-3",children:c.map(e=>(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"shrink-0",children:(0,t.jsx)(u.a1,{tier:e.class,name:e.buttonText,size:"sm"})}),(0,t.jsx)("p",{className:"text-xs font-medium text-sys-text-default-secondary flex-1",children:e.text})]},e.buttonText))})})})};var g=a(35137),y=a(87767),j=a(92093);let k=({children:e,mirror:s=!0,className:a})=>{let{direction:r}=(0,y.j)();return(0,t.jsx)("span",{className:(0,j.cn)("inline-flex items-center justify-center","rtl"===r&&s&&"scale-x-[-1]",a),children:e})},N=({size:e=24,className:s=""})=>(0,t.jsx)("div",{className:`flex items-centertier-progress-arrow text-sys-text-default-tertiary ${s}`,children:(0,t.jsx)(k,{children:(0,t.jsx)(g.fOo,{size:e})})}),v=()=>{let[e,s]=(0,r.useState)(!1),{t:a}=(0,m.ok)(),{tiers:n,loading:i}=(0,f.B)(),l=(0,r.useRef)(null),[o,d]=(0,r.useState)(!1),[c,x]=(0,r.useState)(0),[h,g]=(0,r.useState)(0),y=n.length>0?Math.max(...n.map(e=>e.revsharePercentage)):35,j=n.map(e=>({buttonText:(0,p.ND)(e.tier),class:e.tier.toLowerCase(),percentage:`${e.revsharePercentage}%`}));return(0,t.jsxs)("div",{children:[(0,t.jsx)(u.Zp,{className:"hover:shadow-md transition-shadow duration-200",children:(0,t.jsxs)("div",{className:"p-4 flex flex-col gap-4 overflow-hidden",children:[(0,t.jsxs)("div",{className:"text-center flex flex-col gap-2",children:[(0,t.jsx)("h2",{className:"text-sys-text-default-primary font-semibold text-2xl flex flex-wrap justify-center items-center gap-1",children:(0,t.jsx)("span",{children:a("dashboard.earningSection.title","You can earn up to {{percent}} revenue share",{percent:i?"--":`${y}%`})})}),(0,t.jsx)("span",{className:"text-sm text-sys-text-default-secondary font-medium",children:a("dashboard.earningSection.subtitle","Promote games and earn on every player you refer")})]}),(0,t.jsx)("div",{className:"flex justify-center",children:(0,t.jsx)("div",{ref:l,className:`flex gap-1 items-center overflow-x-auto hide-scrollbar ${o?"cursor-grabbing":"cursor-grab"}`,onMouseDown:e=>{l.current&&(d(!0),x(e.pageX-l.current.offsetLeft),g(l.current.scrollLeft))},onMouseMove:e=>{if(!o||!l.current)return;e.preventDefault();let s=e.pageX-l.current.offsetLeft;l.current.scrollLeft=h-(s-c)*2},onMouseUp:()=>{d(!1)},onMouseLeave:()=>{d(!1)},children:j.map((e,s)=>(0,t.jsxs)(r.Fragment,{children:[(0,t.jsxs)(u.Ex,{className:`p-2 font-semibold ${{bronze:"bg-linear-(--gradient-tiers-bronze)",silver:"bg-linear-(--gradient-tiers-silver)",gold:"bg-linear-(--gradient-tiers-gold)",platinum:"bg-linear-(--gradient-tiers-platinum)",diamond:"bg-linear-(--gradient-tiers-diamond)",obsidian:"bg-linear-(--gradient-tiers-obsidian)"}[e.class]||"bg-linear-(--gradient-tiers-bronze)"} ${{bronze:"text-comp-tiers-bronze",silver:"text-comp-tiers-silver",gold:"text-comp-tiers-gold",platinum:"text-comp-tiers-platinum",diamond:"text-comp-tiers-diamond",obsidian:"text-comp-tiers-obsidian"}[e.class]||"text-comp-tiers-bronze"} flex flex-col items-center justify-center gap-1 min-w-[80px]`,children:[(0,t.jsx)("span",{className:"font-bold text-xl",children:e.percentage}),(0,t.jsx)("span",{className:"text-xs",children:a(`dashboard.earningSection.upgradeTier.tiers.${e.class.toLowerCase()}.name`,e.buttonText)})]}),ss(!0),children:a("dashboard.earningSection.moreInfo","More info")})]})]})}),(0,t.jsx)(b,{show:e,onHide:()=>s(!1)})]})};var w=a(50356),C=a(68822);let A=({show:e,onHide:s})=>{let{t:a}=(0,m.ok)(),{tiers:r,loading:n}=(0,f.B)(),i=r.map(e=>({tier:e.tier.toLowerCase(),name:(0,p.ND)(e.tier),percentage:`${e.affiliateRevsharePercentages[0]??e.revsharePercentage}%`}));return(0,t.jsx)(u.RF,{open:e,onOpenChange:e=>!e&&s(),title:a("dashboard.referralsSection.tierBoost.title","Level Up and Earn More"),description:a("dashboard.referralsSection.tierBoost.description","As your rank increases, so does your bonus. Your tier upgrades automatically as you earn more"),variant:"fixed-width",children:(0,t.jsx)(u.xj,{children:n?(0,t.jsx)("div",{className:"flex justify-center p-4",children:(0,t.jsx)("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-sys-bg-brand-primary",children:(0,t.jsx)("span",{className:"sr-only",children:a("common.loading","Loading...")})})}):(0,t.jsx)("div",{className:"flex flex-col gap-2",children:i.map(e=>(0,t.jsx)(u.a1,{tier:e.tier,name:a(`dashboard.referralsSection.tiers.${e.tier}.name`,e.name),percentage:e.percentage,size:"lg"},e.tier))})})})},S=({referralStats:e,handleInvite:s,setReferralLink:a})=>{let{t:n}=(0,m.ok)(),{convert:i,formatWithSymbol:o}=(0,l.H2)(),{direction:d}=(0,y.j)(),c="rtl"===d,[x,h]=(0,r.useState)(!1);return(0,t.jsx)(u.Bc,{children:(0,t.jsxs)("div",{className:"referral-cards",children:[(0,t.jsx)(u.Zp,{className:"rounded-bl-none rounded-br-none",children:(0,t.jsxs)("div",{className:"p-4",children:[(0,t.jsxs)("div",{className:"flex flex-col sm:flex-row justify-center",children:[(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center",children:[(0,t.jsx)("div",{className:"flex justify-center items-center mb-1",children:(0,t.jsxs)("h5",{className:"flex items-center gap-1 text-lg text-sys-text-default-primary font-semibold",children:[n("dashboard.referralsSection.title","Invite Affiliates, Grow Your Network, Boost Your Earnings"),(0,t.jsxs)(u.m_,{children:[(0,t.jsx)(u.k$,{asChild:!0,children:(0,t.jsx)("span",{className:"inline-flex cursor-help shrink-0",children:(0,t.jsx)(C.A,{className:"h-3.5 w-3.5 text-sys-text-default-tertiary"})})}),(0,t.jsx)(u.ZI,{className:"max-w-xs",children:(0,t.jsx)("p",{children:n("dashboard.referralsSection.titleTooltip","Earn a 15-20% platform-paid bonus on partners who sign up directly under you. They keep 100% of their earnings, and your bonus rate automatically grows as you level up.")})})]})]})}),(0,t.jsx)("p",{className:"text-sm text-sys-text-default-secondary",children:n("dashboard.referralsSection.subtitle","The more affiliates you bring in, the higher your earning potential.")}),(0,t.jsx)(u.$n,{variant:"plain",size:"sm",color:"brand",className:"mt-4",onClick:()=>h(!0),children:n("dashboard.referralsSection.howItWorks","How it works")})]}),(0,t.jsxs)(u.$n,{className:"hidden",variant:"filled",onClick:s,children:[(0,t.jsx)("i",{className:"ri-user-add-line mr-1"})," ",n("dashboard.referralsSection.invite.button","Invite Friends")]})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-1 my-6 sm:grid-cols-3",children:[(0,t.jsxs)("div",{className:"col-span-full flex flex-col items-center justify-center rounded-t-xl gap-1 p-3 bg-sys-bg-default-primary sm:rounded-se-none sm:rounded-ss-xl sm:rounded-es-xl sm:col-span-1",children:[(0,t.jsx)("h3",{className:"text-2xl text-sys-text-default-primary font-semibold",children:e.totalRewards}),(0,t.jsx)("p",{className:"text-sm font-medium text-sys-text-default-secondary",children:n("dashboard.referralsSection.stats.totalRewards","Available")})]}),(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center gap-1 sm:flex-col-reverse flex-1 p-3 bg-sys-bg-default-primary rounded-es-xl sm:rounded-none",children:[(0,t.jsx)("p",{className:"text-sys-text-warning-primary text-sm font-medium",children:n("dashboard.referralsSection.stats.pending","Pending")}),(0,t.jsx)("h3",{className:"text-xl text-sys-text-default-primary font-semibold",children:e.pendingRewards})]}),(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center gap-1 flex-1 p-3 bg-sys-bg-default-primary rounded-ee-xl sm:rounded-se-xl sm:rounded-ee-xl",children:[(0,t.jsx)("h3",{className:"text-xl text-sys-text-default-primary font-semibold",children:e.successfulReferrals}),(0,t.jsx)("p",{className:"text-sm text-sys-text-positive-primary font-semibold",children:n("dashboard.referralsSection.stats.joinedViaInvite","Active Affiliates")})]})]}),(0,t.jsx)("div",{className:"text-center mt-4 mx-auto flex justify-center",children:(0,t.jsx)(u.$n,{variant:"filled",size:"md",color:"brand",className:"w-full sm:w-auto",onClick:s,children:(0,t.jsx)("span",{children:n("dashboard.referralsSection.invite.button","Earn More with Affiliates")})})})]})}),(0,t.jsx)(A,{show:x,onHide:()=>h(!1)}),(0,t.jsx)("div",{className:"flex mt-1",children:(0,t.jsxs)("div",{className:"flex justify-center items-center w-full",children:[(0,t.jsxs)("div",{className:(0,j.cn)("flex flex-col items-center justify-center w-full bg-sys-bg-default-secondary px-3 py-2 gap-2 text-center h-full",c?"rounded-br-xl":"rounded-bl-xl"),children:[(0,t.jsx)(u.Ex,{variant:"number",className:"w-5 h-5 rounded-full flex items-center justify-center font-semibold text-sx bg-sys-bg-brand-primary",children:n("dashboard.referralsSection.steps.step1.number","1")}),(0,t.jsx)("p",{className:"text-xs text-sys-text-default-secondary font-medium",children:n("dashboard.referralsSection.steps.step1.text","Share the Link")})]}),(0,t.jsx)(k,{className:"shrink-0",children:(0,t.jsx)("img",{src:"/assets/next.svg",alt:"icon",className:"min-h-[98px] sm:min-h-[76px]"})}),(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center w-full bg-sys-bg-default-secondary px-3 py-2 gap-2 text-center h-full",children:[(0,t.jsx)(u.Ex,{variant:"number",className:"w-5 h-5 rounded-full flex items-center justify-center font-semibold text-sx bg-sys-bg-brand-primary",children:n("dashboard.referralsSection.steps.step2.number","2")}),(0,t.jsx)("p",{className:"text-xs text-sys-text-default-secondary font-medium",children:n("dashboard.referralsSection.steps.step2.text","Affiliate Joins & Earns Revenue")})]}),(0,t.jsx)(k,{className:"shrink-0",children:(0,t.jsx)("img",{src:"/assets/next.svg",alt:"icon",className:"min-h-[98px] sm:min-h-[76px]"})}),(0,t.jsxs)("div",{className:(0,j.cn)("flex flex-col items-center justify-center w-full bg-sys-bg-default-secondary px-3 py-2 gap-2 text-center h-full",c?"rounded-bl-xl":"rounded-br-xl"),children:[(0,t.jsx)(u.Ex,{variant:"number",className:"w-5 h-5 rounded-full flex items-center justify-center font-semibold text-sx bg-sys-bg-brand-primary",children:n("dashboard.referralsSection.steps.step3.number","3")}),(0,t.jsx)("p",{className:"text-xs text-sys-text-default-secondary font-medium",children:n("dashboard.referralsSection.steps.step3.text","Your Commission Follows")})]})]})})]})})};var T=a(5772),L=a(33210);let $=({show:e,onHide:s,task:a,TaskIcon:r})=>{let{t:n}=(0,m.ok)();if(!a)return null;let i=(e=>{switch(e){case"completed":return{badge:"success-transparent",text:n("user.dashboard.sections.tasks.status.completed","Completed")};case"in_progress":return{badge:"info-transparent",text:n("user.dashboard.sections.tasks.status.inProgress","In Progress")};default:return{badge:"secondary-transparent",text:n("user.dashboard.sections.tasks.status.notStarted","Not Started")}}})(a.status),l=[{label:n("user.dashboard.modal.task.subTasks.items.research.label","Research competitor designs"),checked:!0,details:""},{label:n("user.dashboard.modal.task.subTasks.items.wireframes.label","Create wireframes for mobile view"),checked:!1,details:n("user.dashboard.modal.task.subTasks.items.wireframes.details","Due in {{days}} days",{days:3})},{label:n("user.dashboard.modal.task.subTasks.items.testing.label","User testing for main UI elements"),checked:!1,details:""}];return(0,t.jsx)(u.lG,{open:e,onOpenChange:s,children:(0,t.jsx)(u.Cf,{variant:"full-width",className:"max-w-5xl p-0",children:(0,t.jsx)("div",{className:"w-full",children:(0,t.jsxs)(u.Zp,{className:"custom-card",children:[(0,t.jsxs)("div",{className:"flex justify-between items-center bg-transparent p-4 border-b border-sys-border-default-secondary",children:[(0,t.jsx)("h3",{className:"text-sys-text-brand-primary font-semibold",children:n("user.dashboard.modal.task.title","Task Summary")}),(0,t.jsx)("div",{className:"flex gap-2",children:(0,t.jsx)(u.$n,{variant:"filled",color:"brand",size:"sm",onClick:s,iconLeading:(0,t.jsx)(L.A,{className:"size-4"}),children:n("user.dashboard.modal.task.close","Close")})})]}),(0,t.jsxs)("div",{className:"task-modal-content p-6",children:[(0,t.jsxs)("div",{className:"flex items-center mb-4 gap-2 flex-wrap",children:[(0,t.jsx)("div",{className:"size-12 flex items-center justify-center bg-sys-bg-brand-secondary rounded-full mr-2",children:(0,t.jsx)(r,{icon:a.icon,size:24})}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h6",{className:"font-medium mb-2",children:n(`user.dashboard.sections.tasks.types.${a.id}.title`,a.title)}),(0,t.jsxs)("div",{className:"flex items-center",children:[(0,t.jsx)(u.Ex,{variant:"default",children:i.text}),(0,t.jsxs)("span",{className:"text-sys-text-default-secondary text-xs ml-2",children:[(0,t.jsx)("i",{className:"ri-circle-fill text-sys-text-positive-primary mx-2 text-xs"}),n(`user.dashboard.sections.tasks.types.${a.id}.reward`,a.reward)]})]})]})]}),(0,t.jsx)("div",{className:"text-sm font-medium mb-2",children:n("user.dashboard.modal.task.description","Task Description:")}),(0,t.jsx)("p",{className:"text-sys-text-default-secondary",children:n(`user.dashboard.sections.tasks.types.${a.id}.description`,a.description)}),(0,t.jsx)("div",{className:"w-full",children:(0,t.jsx)("div",{className:"mb-3",children:(0,t.jsxs)(u.Zp,{className:"custom-card h-full",children:[(0,t.jsxs)("div",{className:"flex justify-between items-center p-4 border-b border-sys-border-default-secondary",children:[(0,t.jsx)("h4",{className:"text-sys-text-brand-primary font-semibold",children:n("user.dashboard.modal.task.details","Additional Details")}),(0,t.jsx)("div",{children:(0,t.jsx)("div",{className:"h-8 invisible",children:"\xa0"})})]}),(0,t.jsx)("div",{className:"p-0",children:(0,t.jsx)("div",{className:"overflow-x-auto",children:(0,t.jsx)(u.XI,{className:"w-full",children:(0,t.jsxs)(u.BF,{children:[(0,t.jsxs)(u.Hj,{children:[(0,t.jsx)(u.nA,{className:"w-1/4",children:(0,t.jsxs)("span",{className:"flex items-center",children:[(0,t.jsx)("span",{className:"size-6 bg-sys-bg-brand-secondary rounded-full flex items-center justify-center mr-2",children:(0,t.jsx)("i",{className:"ri-file-list-3-line text-xs"})}),(0,t.jsx)("span",{children:n("user.dashboard.modal.task.fields.taskId","Task ID")})]})}),(0,t.jsx)(u.nA,{className:"w-8",children:":"}),(0,t.jsx)(u.nA,{className:"flex-1",children:(0,t.jsx)("span",{children:a.id.toUpperCase()})})]}),(0,t.jsxs)(u.Hj,{children:[(0,t.jsx)(u.nA,{children:(0,t.jsxs)("span",{className:"flex items-center",children:[(0,t.jsx)("span",{className:"size-6 bg-sys-bg-default-secondary rounded-full flex items-center justify-center mr-2",children:(0,t.jsx)("i",{className:"ri-group-line text-xs"})}),(0,t.jsx)("span",{children:n("user.dashboard.modal.task.fields.status","Status")})]})}),(0,t.jsx)(u.nA,{children:":"}),(0,t.jsx)(u.nA,{children:(0,t.jsx)(u.Ex,{variant:"default",children:i.text})})]}),(0,t.jsxs)(u.Hj,{children:[(0,t.jsx)(u.nA,{children:(0,t.jsxs)("span",{className:"flex items-center",children:[(0,t.jsx)("span",{className:"size-6 bg-sys-bg-positive-secondary rounded-full flex items-center justify-center mr-2",children:(0,t.jsx)("i",{className:"ri-coin-line text-xs"})}),(0,t.jsx)("span",{children:n("user.dashboard.modal.task.fields.reward","Reward")})]})}),(0,t.jsx)(u.nA,{children:":"}),(0,t.jsx)(u.nA,{children:(0,t.jsx)("span",{children:a.reward})})]}),(0,t.jsxs)(u.Hj,{children:[(0,t.jsx)(u.nA,{children:(0,t.jsxs)("span",{className:"flex items-center",children:[(0,t.jsx)("span",{className:"size-6 bg-teal-100 rounded-full flex items-center justify-center mr-2",children:(0,t.jsx)("i",{className:"ri-price-tag-3-line text-xs"})}),(0,t.jsx)("span",{children:n("user.dashboard.modal.task.fields.taskType","Task Type")})]})}),(0,t.jsx)(u.nA,{children:":"}),(0,t.jsxs)(u.nA,{children:[(0,t.jsx)(u.Ex,{variant:"label",className:"mr-1",children:a.id}),(0,t.jsx)(u.Ex,{variant:"label",children:n("user.dashboard.modal.task.fields.promotional","Promotional")})]})]})]})})})})]})})}),(0,t.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-4",children:[(0,t.jsx)("div",{className:"lg:col-span-2 mb-3",children:(0,t.jsxs)(u.Zp,{className:"custom-card overflow-hidden h-full",children:[(0,t.jsxs)("div",{className:"flex justify-between items-center p-4 border-b border-sys-border-default-secondary",children:[(0,t.jsx)("h4",{className:"text-sys-text-brand-primary font-semibold",children:n("user.dashboard.modal.task.steps","Steps to Complete")}),(0,t.jsx)("div",{children:(0,t.jsx)("div",{className:"h-8 invisible",children:"\xa0"})})]}),(0,t.jsx)("div",{className:"p-4",children:(0,t.jsx)("div",{className:"space-y-3",children:a.steps&&a.steps.map((e,s)=>(0,t.jsxs)("div",{className:"flex items-center p-3 border border-sys-border-default-secondary rounded-lg",children:[(0,t.jsx)("div",{className:"mr-3 flex items-center justify-center",children:(0,t.jsx)("span",{className:"size-6 bg-sys-bg-brand-secondary rounded-full flex items-center justify-center",children:(0,t.jsx)("i",{className:"ri-checkbox-circle-line text-xs text-sys-text-brand-primary"})})}),(0,t.jsx)("div",{className:"font-medium",children:n(`user.dashboard.sections.tasks.types.${a.id}.steps.${s}`,e)})]},s))})})]})}),(0,t.jsx)("div",{className:"lg:col-span-1 mb-3",children:(0,t.jsxs)(u.Zp,{className:"custom-card overflow-hidden h-full",children:[(0,t.jsxs)("div",{className:"flex justify-between items-center p-4 border-b border-sys-border-default-secondary",children:[(0,t.jsx)("h4",{className:"text-sys-text-brand-primary font-semibold",children:n("user.dashboard.modal.task.subTasks","Sub Tasks")}),(0,t.jsx)("div",{children:(0,t.jsx)(u.$n,{variant:"tinted",color:"positive",size:"sm",iconLeading:(0,t.jsx)("i",{className:"ri-add-line"}),children:"Sub Task"})})]}),(0,t.jsx)("div",{className:"p-4",children:(0,t.jsx)("div",{className:"space-y-3",children:l.map((e,s)=>(0,t.jsxs)("div",{className:"flex items-start p-3 border border-sys-border-default-secondary rounded-lg",children:[(0,t.jsx)("div",{className:"mr-3",children:(0,t.jsx)(u.Sc,{id:`successChecked${s}`,defaultChecked:e.checked})}),(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:`font-medium ${e.checked?"line-through text-sys-text-default-secondary":""}`,children:e.label}),e.details&&(0,t.jsx)("div",{className:"font-medium bg-sys-bg-default-tertiary border border-sys-border-default-secondary px-2 py-2 text-xs mt-2 rounded text-sys-text-default-secondary",children:e.details})]})]},s))})})]})})]})]})]})})})})};var E=a(78340);let G=(0,E.A)("facebook",[["path",{d:"M18 2h-3a5 5 0 0 0-5 5v3H7v4h3v8h4v-8h3l1-4h-4V7a1 1 0 0 1 1-1h3z",key:"1jg4f8"}]]),F=(0,E.A)("twitter",[["path",{d:"M22 4s-.7 2.1-2 3.4c1.6 10-9.4 17.3-18 11.6 2.2.1 4.4-.6 6-2C3 15.5.5 9.6 3 5c2.2 2.6 5.6 4.1 9 4-.9-4.2 4-6.6 7-3.8 1.1 0 3-1.2 3-1.2z",key:"pff0z6"}]]);var I=a(92564);let z=(0,E.A)("instagram",[["rect",{width:"20",height:"20",x:"2",y:"2",rx:"5",ry:"5",key:"2e1cvw"}],["path",{d:"M16 11.37A4 4 0 1 1 12.63 8 4 4 0 0 1 16 11.37z",key:"9exkf1"}],["line",{x1:"17.5",x2:"17.51",y1:"6.5",y2:"6.5",key:"r4j83e"}]]);var M=a(42869),R=a(7810),P=a(47834),B=a(67635),U=a(91958),D=a(27335),_=a(430),H=a(95368),O=a(64469);let W=e=>e[Math.floor(Math.random()*e.length)],Y=["gambling","online casino","bet now","betting","poker","spin & win","casino","online gambling","slots"],K=[{name:"Facebook",icon:(0,t.jsx)(G,{className:"w-6 h-6"}),bgClass:"bg-[#1877F2]/10 text-[#1877F2] hover:bg-[#1877F2]/20"},{name:"X",icon:(0,t.jsx)(F,{className:"w-6 h-6"}),bgClass:"bg-sky-500/10 text-sky-500 hover:bg-sky-500/20"},{name:"WhatsApp",icon:(0,t.jsx)(I.A,{className:"w-6 h-6"}),bgClass:"bg-green-500/10 text-green-500 hover:bg-green-500/20"},{name:"Instagram",icon:(0,t.jsx)(z,{className:"w-6 h-6"}),bgClass:"bg-pink-500/10 text-pink-500 hover:bg-pink-500/20"}],Z={bio:{icon:(0,t.jsx)(M.A,{className:"w-6 h-6 text-[#6353E9]"}),iconBg:"bg-[#0F0A31] border border-[#23147D]",gradient:"",gradientStyle:{background:"linear-gradient(1deg, rgba(99, 83, 233, 0.00) 12.26%, rgba(99, 83, 233, 0.06) 39.92%, rgba(99, 83, 233, 0.14) 60.21%, rgba(99, 83, 233, 0.30) 95.87%, rgba(99, 83, 233, 0.46) 109.39%, rgba(99, 83, 233, 0.70) 129.07%)"},title:"dashboard.generator.bio.title",description:"dashboard.generator.bio.description",showSteps:!0,showPlatforms:!0,showFacebookKeywords:!1},friends:{icon:(0,t.jsx)(R.A,{className:"w-6 h-6 text-[#10B981]"}),iconBg:"bg-[#0F2E22] border border-[#14532D]",gradient:"",gradientStyle:{background:"linear-gradient(1deg, rgba(16, 185, 129, 0.00) 12.26%, rgba(16, 185, 129, 0.06) 39.92%, rgba(16, 185, 129, 0.14) 60.21%, rgba(16, 185, 129, 0.30) 95.87%, rgba(16, 185, 129, 0.46) 109.39%, rgba(16, 185, 129, 0.70) 129.07%)"},title:"dashboard.generator.friends.title",description:"dashboard.generator.friends.description",showSteps:!1,showPlatforms:!0,showFacebookKeywords:!1},facebook:{icon:(0,t.jsx)(G,{className:"w-6 h-6 text-[#1877F2]"}),iconBg:"bg-[#0a1628] border border-[#1e3a5f]",gradient:"",gradientStyle:{background:"linear-gradient(1deg, rgba(24, 119, 242, 0.00) 12.26%, rgba(24, 119, 242, 0.06) 39.92%, rgba(24, 119, 242, 0.14) 60.21%, rgba(24, 119, 242, 0.30) 95.87%, rgba(24, 119, 242, 0.46) 109.39%, rgba(24, 119, 242, 0.70) 129.07%)"},title:"dashboard.generator.facebook.title",description:"dashboard.generator.facebook.description",showSteps:!1,showPlatforms:!1,showFacebookKeywords:!0},share:{icon:(0,t.jsx)(P.A,{className:"w-6 h-6 text-[#6353E9]"}),iconBg:"bg-[#0F0A31] border border-[#23147D]",gradient:"",gradientStyle:{background:"linear-gradient(1deg, rgba(99, 83, 233, 0.00) 12.26%, rgba(99, 83, 233, 0.06) 39.92%, rgba(99, 83, 233, 0.14) 60.21%, rgba(99, 83, 233, 0.30) 95.87%, rgba(99, 83, 233, 0.46) 109.39%, rgba(99, 83, 233, 0.70) 129.07%)"},title:"Share Your Link",titleKey:"dashboard.generator.share.title",description:"Share this tracking link with your audience and start earning!",descriptionKey:"dashboard.generator.share.description",showSteps:!1,showPlatforms:!0,showFacebookKeywords:!1},copy:{icon:(0,t.jsx)(B.A,{className:"w-6 h-6 text-[#6353E9]"}),iconBg:"bg-[#0F0A31] border border-[#23147D]",gradient:"",gradientStyle:{background:"linear-gradient(1deg, rgba(99, 83, 233, 0.00) 12.26%, rgba(99, 83, 233, 0.06) 39.92%, rgba(99, 83, 233, 0.14) 60.21%, rgba(99, 83, 233, 0.30) 95.87%, rgba(99, 83, 233, 0.46) 109.39%, rgba(99, 83, 233, 0.70) 129.07%)"},title:"dashboard.generator.copy.title",description:"dashboard.generator.copy.description",showSteps:!1,showPlatforms:!1,showFacebookKeywords:!1}},q=({show:e,onHide:s,mode:a,taskId:i,selectedBrandName:l,shareUrl:o})=>{let{t:d}=(0,m.ok)(),c=(0,D.FI)(),f=(0,n.d4)(O.nH),p=Z[a],[b,g]=(0,r.useState)(""),[y,k]=(0,r.useState)(""),N=(0,H.U)("(min-width: 640px)"),v=o||b;(0,r.useEffect)(()=>{f&&!o&&g((0,h.F)(f))},[f,o]);let w=(0,r.useCallback)(()=>{let e,s,t,r={name:l||d("dashboard.generator.fallback.brandName",c?.name||"Fortune Galaxy"),url:v||"https://your-personalized-link.com",description:d("dashboard.generator.fallback.description","Online gaming platform")},n="share"===a?"facebook":i||a,o=(e={hooks:[d("contentGeneration.bio.hooks.0","Stop scrolling if you love free cash \uD83D\uDCB0"),d("contentGeneration.bio.hooks.1","Tired of your 9-5? This could be it \uD83D\uDD13"),d("contentGeneration.bio.hooks.2","I just made $150 in my sleep \uD83D\uDE34"),d("contentGeneration.bio.hooks.3","This isn't hype — it's results \uD83D\uDCCA"),d("contentGeneration.bio.hooks.4","Your dream hustle is one click away ✨")],benefits:[d("contentGeneration.bio.benefits.0","Get paid daily with no experience"),d("contentGeneration.bio.benefits.1","Spin & win real money"),d("contentGeneration.bio.benefits.2","Free to try. Fast to win."),d("contentGeneration.bio.benefits.3","Earn while you scroll"),d("contentGeneration.bio.benefits.4","Withdraw in minutes — no cap \uD83E\uDDE2")],callsToAction:[d("contentGeneration.bio.callsToAction.0","Tap the link in bio now"),d("contentGeneration.bio.callsToAction.1","Don't wait - the clock's ticking ⏳"),d("contentGeneration.bio.callsToAction.2","Start in 30 seconds"),d("contentGeneration.bio.callsToAction.3",'DM me "READY" for proof'),d("contentGeneration.bio.callsToAction.4","Your wallet will thank you \uD83D\uDCB8")]},s={openers:[d("contentGeneration.message.openers.0","Yo, this is wild"),d("contentGeneration.message.openers.1","Just stumbled on something crazy"),d("contentGeneration.message.openers.2","Not kidding, this one's \uD83D\uDD25"),d("contentGeneration.message.openers.3","This might be the easiest win online"),d("contentGeneration.message.openers.4","Thought of you when I saw this \uD83D\uDC40"),d("contentGeneration.message.openers.5","I found a real gem here"),d("contentGeneration.message.openers.6","You'll love this one"),d("contentGeneration.message.openers.7","I had to share this with you"),d("contentGeneration.message.openers.8","Look what I just found"),d("contentGeneration.message.openers.9","This site is blowing up rn"),d("contentGeneration.message.openers.10","No joke, this actually works"),d("contentGeneration.message.openers.11","Everyone's talking about this")],benefits:[d("contentGeneration.message.benefits.0","get a welcome bonus instantly — no deposit needed"),d("contentGeneration.message.benefits.1","win real cash and withdraw today"),d("contentGeneration.message.benefits.2","play free and still win rewards"),d("contentGeneration.message.benefits.3","grab your bonus spins and keep what you win"),d("contentGeneration.message.benefits.4","unlock your no-risk spins now"),d("contentGeneration.message.benefits.5","claim your bonus and test your luck"),d("contentGeneration.message.benefits.6","win big without spending a cent"),d("contentGeneration.message.benefits.7","spin & win — fast payouts too"),d("contentGeneration.message.benefits.8","start playing with free credits"),d("contentGeneration.message.benefits.9","cash out your winnings straight to your wallet"),d("contentGeneration.message.benefits.10","no tricks — just real winnings"),d("contentGeneration.message.benefits.11","hit big with just a few taps")],callToAction:[d("contentGeneration.message.callToAction.0","Here's your link – try it out:"),d("contentGeneration.message.callToAction.1","I'm already in – join me:"),d("contentGeneration.message.callToAction.2","Check this before it's gone:"),d("contentGeneration.message.callToAction.3","Go see it yourself:"),d("contentGeneration.message.callToAction.4","You gotta test this one:"),d("contentGeneration.message.callToAction.5","Try it now – let me know how you do:"),d("contentGeneration.message.callToAction.6","Your lucky link is here:"),d("contentGeneration.message.callToAction.7","Click and try your luck:"),d("contentGeneration.message.callToAction.8","If you're down to play, use this:"),d("contentGeneration.message.callToAction.9","Let me know if you win something \uD83C\uDFAF")]},t={hooks:[d("contentGeneration.facebook.hooks.0","Who else wants to earn while relaxing?"),d("contentGeneration.facebook.hooks.1","Tired of 9-5? Try this!"),d("contentGeneration.facebook.hooks.2","Just made $250 in 30 mins \uD83E\uDD11"),d("contentGeneration.facebook.hooks.3","This is NOT your average casino game \uD83C\uDFB2")],benefits:[d("contentGeneration.facebook.benefits.0","Win real money daily"),d("contentGeneration.facebook.benefits.1","Get free spins instantly"),d("contentGeneration.facebook.benefits.2","Withdraw winnings in minutes"),d("contentGeneration.facebook.benefits.3","Zero risk. High rewards.")],callsToAction:[d("contentGeneration.facebook.callsToAction.0","DM me for proof \uD83D\uDD25"),d("contentGeneration.facebook.callsToAction.1","Try it now before it closes!"),d("contentGeneration.facebook.callsToAction.2","Don't miss out!"),d("contentGeneration.facebook.callsToAction.3","Click the link to start winning")]},{bio:()=>{let s=W(e.hooks),a=W(e.benefits),t=W(e.callsToAction);return`✨ ${s} 🔥 ${a} via ${r.name} 👇 ${t} 🔗 ${r.url}`},friends:()=>{let e=W(s.openers),a=W(s.benefits),t=W(s.callToAction);return`${e}. ${r.name} — you can ${a}. ${t} ${r.url}`},facebook:()=>{let e=W(t.hooks),s=W(t.benefits),a=W(t.callsToAction);return`🔥 ${e} 💸 ${s} at ${r.name} 👇 ${a} 🔗 ${r.url}`},copy:()=>{let e=W(s.openers),a=W(s.benefits),t=W(s.callToAction);return`${e}. ${r.name} — you can ${a}. ${t} ${r.url}`}})[n];o&&k(o())},[v,a,i,l,d]);(0,r.useEffect)(()=>{e&&w()},[e,w]);let C=e=>{let s=e===v?d("dashboard.generator.toast.linkCopied","Link copied to clipboard!"):d("dashboard.generator.toast.contentCopied","Content copied to clipboard!");(0,x.l)(e,s)},A=()=>{C(v),S()},S=()=>{s(),k("")},T=()=>{(0,x.l)(v,d("dashboard.generator.toast.linkCopied","Link copied!"))},L=()=>{w(),(0,_.o)({title:d("dashboard.generator.toast.regenerated","Content regenerated!"),variant:"positive"})},$=()=>(0,t.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,t.jsxs)("div",{className:"relative flex flex-col items-center justify-center gap-3 py-6 rounded-2xl overflow-hidden",style:p.gradientStyle,children:[(0,t.jsx)("div",{className:(0,j.cn)("w-14 h-14 rounded-full flex items-center justify-center",p.iconBg),children:p.icon}),(0,t.jsx)("h2",{className:"text-lg font-semibold text-sys-text-default-primary",children:d(p.title,p.title)}),(0,t.jsx)("p",{className:"text-sm text-sys-text-default-secondary text-center px-4",children:d(p.description,p.description)})]}),p.showSteps&&(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("div",{className:"w-6 h-6 rounded-full bg-sys-bg-brand-tertiary flex items-center justify-center text-xs font-semibold text-sys-text-brand-primary",children:"1"}),(0,t.jsx)("span",{className:"text-sm text-sys-text-default-primary",children:d("dashboard.generator.bio.step1","Copy your personalized link")})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("div",{className:"w-6 h-6 rounded-full bg-sys-bg-brand-tertiary flex items-center justify-center text-xs font-semibold text-sys-text-brand-primary",children:"2"}),(0,t.jsx)("span",{className:"text-sm text-sys-text-default-primary",children:d("dashboard.generator.bio.step2","Add it to your social media bio")})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("div",{className:"w-6 h-6 rounded-full bg-sys-bg-brand-tertiary flex items-center justify-center text-xs font-semibold text-sys-text-brand-primary",children:"3"}),(0,t.jsx)("span",{className:"text-sm text-sys-text-default-primary",children:d("dashboard.generator.bio.step3","Start earning from referrals!")})]})]}),p.showFacebookKeywords&&(0,t.jsxs)(u.Zp,{className:"p-4 bg-amber-500/10 border-amber-500/20",children:[(0,t.jsx)("p",{className:"text-sm text-amber-500 font-medium mb-2",children:d("dashboard.generator.facebook.keywordsWarning","Avoid these keywords in your posts:")}),(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:Y.map(e=>(0,t.jsx)("span",{className:"px-2 py-1 text-xs rounded-full bg-amber-500/20 text-amber-500",children:e},e))})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsx)("label",{className:"text-sm font-medium text-sys-text-default-primary",children:d("dashboard.generator.yourLink","Your Link")}),(0,t.jsxs)("div",{className:"flex items-center gap-2 p-3 rounded-lg border border-sys-border-default-secondary bg-sys-bg-default-secondary",children:[(0,t.jsx)("span",{className:"flex-1 text-sm text-sys-text-default-secondary break-all",children:v||d("common.loading","Loading...")}),(0,t.jsx)(u.$n,{variant:"ghost",size:"sm",iconOnly:!0,onClick:T,disabled:!v,children:(0,t.jsx)(B.A,{className:"w-4 h-4"})})]})]}),y&&(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("label",{className:"text-sm font-medium text-sys-text-default-primary",children:d("dashboard.generator.suggestedContent","Suggested Content")}),(0,t.jsxs)(u.$n,{variant:"ghost",size:"sm",onClick:L,className:"text-sys-text-brand-primary",children:[(0,t.jsx)(U.A,{className:"w-4 h-4 mr-1"}),d("dashboard.generator.regenerate","Regenerate")]})]}),(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)("div",{className:"p-4 rounded-lg border border-sys-border-default-secondary bg-sys-bg-default-secondary text-sm text-sys-text-default-primary whitespace-pre-wrap cursor-pointer",onClick:()=>C(y),children:y}),(0,t.jsxs)(u.$n,{variant:"tinted",size:"sm",className:"absolute top-2 right-2",onClick:()=>C(y),children:[(0,t.jsx)(B.A,{className:"w-4 h-4 mr-1"}),d("common.copy","Copy")]})]})]}),p.showPlatforms&&(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsx)("label",{className:"text-sm font-medium text-sys-text-default-primary",children:d("dashboard.generator.shareTo","Share to")}),(0,t.jsx)("div",{className:"flex gap-2",children:K.map(e=>(0,t.jsx)(u.$n,{variant:"ghost",size:"sm",className:(0,j.cn)("flex-1",e.bgClass),onClick:()=>{let s=v||"",a=y||"",t="";switch(e.name){case"Facebook":t=`https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(s)}`;break;case"X":t=`https://twitter.com/intent/tweet?text=${encodeURIComponent(a)}`;break;case"WhatsApp":t=`https://api.whatsapp.com/send?text=${encodeURIComponent(a)}`;break;case"Instagram":(0,x.l)(a,d("dashboard.generator.toast.copiedForInstagram","Copied! Paste in Instagram"));return}t&&window.open(t,"_blank","width=600,height=400")},children:e.icon},e.name))})]}),(0,t.jsxs)("div",{className:"flex gap-2 pt-2",children:[(0,t.jsx)(u.$n,{variant:"outline",color:"neutral",className:"flex-1",onClick:S,children:d("common.close","Close")}),(0,t.jsxs)(u.$n,{variant:"filled",color:"brand",className:"flex-1",onClick:A,disabled:!v,children:[(0,t.jsx)(B.A,{className:"w-4 h-4 mr-1"}),d("dashboard.generator.copyAndClose","Copy Link & Close")]})]})]});return N?(0,t.jsx)(u.lG,{open:e,onOpenChange:e=>!e&&S(),children:(0,t.jsxs)(u.Cf,{className:"w-[90vw] max-w-xl",children:[(0,t.jsx)(u.c7,{className:"mb-2",children:(0,t.jsx)(u.L3,{className:"sr-only",children:d(p.title,p.title)})}),$()]})}):(0,t.jsx)(u._s,{open:e,onOpenChange:e=>!e&&S(),children:(0,t.jsxs)(u.zj,{children:[(0,t.jsx)(u.BE,{className:"sr-only",children:d(p.title,p.title)}),(0,t.jsx)("div",{className:"p-4 pb-8 max-h-[90vh] overflow-y-auto",children:$()})]})})},J=({icon:e,size:s=24})=>(0,t.jsx)(T.default,{src:{"ri-instagram-line":"/icons/base/image.svg","ri-facebook-circle-line":"/icons/display/facebook.svg","ri-window-line":"/icons/base/link.svg","ri-coupon-line":"/icons/base/file.svg","ri-user-shared-line":"/icons/base/share.svg","ri-profile-line":"/icons/base/user.svg"}[e]||"/icons/base/file.svg",alt:"Task icon",width:s,height:s,className:"object-contain"}),V=()=>{let[e,s]=r.useState(null),[a,n]=r.useState(!1),[i,o]=r.useState(!1),[d,c]=r.useState("bio"),[x,h]=r.useState(""),{t:f}=(0,m.ok)(),{formatWithSymbol:p,convert:b}=(0,l.H2)(),g=[{id:"facebook",title:f("user.dashboard.sections.tasks.types.facebook.title","Share in Facebook groups"),icon:"ri-facebook-circle-line",description:f("user.dashboard.sections.tasks.types.facebook.description","Post your referral link in relevant Facebook communities."),status:"not_started",reward:f("user.dashboard.sections.tasks.types.facebook.reward",`${p(b(12,"USD"))} for high-engagement posts`),steps:[f("user.dashboard.sections.tasks.types.facebook.steps.0","Identify relevant Facebook groups"),f("user.dashboard.sections.tasks.types.facebook.steps.1","Create engaging posts with your referral link"),f("user.dashboard.sections.tasks.types.facebook.steps.2","Track clicks and conversions"),f("user.dashboard.sections.tasks.types.facebook.steps.3","Submit high-performing posts for bonus review")]},{id:"friends",title:f("user.dashboard.sections.tasks.types.friends.title","Send to your friends"),icon:"ri-user-shared-line",description:f("user.dashboard.sections.tasks.types.friends.description","Share your referral link directly with friends and family."),status:"completed",reward:f("user.dashboard.sections.tasks.types.friends.reward",`${p(b(5,"USD"))} for each friend who signs up`),steps:[f("user.dashboard.sections.tasks.types.friends.steps.0","Use the 'Share' button to send invitations"),f("user.dashboard.sections.tasks.types.friends.steps.1","Track which friends have signed up"),f("user.dashboard.sections.tasks.types.friends.steps.2","Follow up with reminders if needed")]},{id:"bio",title:f("user.dashboard.sections.tasks.types.bio.title","Add the link to your bio"),icon:"ri-profile-line",description:f("user.dashboard.sections.tasks.types.bio.description","Add your unique referral link to your social media profiles."),status:"not_started",reward:f("user.dashboard.sections.tasks.types.bio.reward",`${p(b(7,"USD"))} one-time bonus`),steps:[f("user.dashboard.sections.tasks.types.bio.steps.0","Copy your referral link"),f("user.dashboard.sections.tasks.types.bio.steps.1","Add it to your Instagram bio"),f("user.dashboard.sections.tasks.types.bio.steps.2","Add it to your other social profiles"),f("user.dashboard.sections.tasks.types.bio.steps.3","Verify completion to receive bonus")]}];return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(u.Zp,{children:(0,t.jsxs)("div",{className:"p-4",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-1 mb-4",children:[(0,t.jsx)("h5",{className:"text-lg font-semibold text-sys-text-default-primary",children:f("user.dashboard.sections.tasks.title","More methods to get exposure")}),(0,t.jsx)("p",{className:"text-sm text-sys-text-default-secondary",children:f("user.dashboard.sections.tasks.subtitle","Effortlessly copy and share content")})]}),(0,t.jsx)("div",{className:"flex flex-col gap-1",children:g.map(e=>(0,t.jsxs)(u.Zp,{variant:"bordered",className:"flex items-center justify-between gap-4 p-4 rounded-none first:rounded-t-xl last:rounded-b-xl cursor-pointer",onClick:()=>{s(e),["bio","friends","facebook"].includes(e.id)?(c(e.id),h(e.id),o(!0)):n(!0)},children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)(J,{icon:e.icon,size:24}),(0,t.jsx)("div",{className:"text-medium text-sys-text-default-primary font-medium tracking-normal",children:e.title})]}),(0,t.jsx)(N,{size:24,className:"text-sys-text-default-tertiary"})]},e.id))})]})}),(0,t.jsx)($,{show:a,onHide:()=>{n(!1)},task:e,TaskIcon:J}),(0,t.jsx)(q,{show:i,onHide:()=>{o(!1),s(null)},mode:d,taskId:x})]})};var X=a(51914),Q=a(94290),ee=a(97233),es=a(53810),ea=a(56018),et=a(68459),er=a(66088),en=a(41585),ei=a(73321),el=a(56732),eo=a(62238),ed=a(86955),ec=a(40612),em=a(24168),ex=a(42400);let eh={US:"/assets/images/flags/us_flag.png",TR:"/assets/images/flags/turkey_flag.png",BR:"/assets/images/flags/brazil_flag.png",ID:"/assets/images/flags/indonesia_flag.png",AR:"/assets/images/flags/argentina_flag.png",EG:"/assets/images/flags/egypt_flag.png",TH:"/assets/images/flags/thailand_flag.png",GC:"/assets/images/flags/gcc_flag.png"};function eu(e,s){return[...e].sort((e,a)=>e===s?-1:a===s?1:e.localeCompare(a))}function ef({code:e,name:s,size:a=20,className:r}){let n=eh[e.toUpperCase()]||null;return n?(0,t.jsx)(T.default,{src:n,alt:s,width:a,height:a,className:(0,j.cn)(`w-[${a}px] h-[${a}px] rounded-full object-cover`,r)}):(0,t.jsx)("span",{className:(0,j.cn)(`w-[${a}px] h-[${a}px] rounded-full bg-sys-bg-default-tertiary`,r)})}function ep({campaigns:e,campaignsLoading:s,selectedCampaign:a,onCampaignChange:r,campaignName:n,onCampaignNameChange:i,canCreateCampaign:l,t:o,inputId:d}){let c=e.length>0,m="new"===a&&l;if(c&&m)return(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(u.pd,{id:d,placeholder:o("dashboard.trackers.form.newCampaignPlaceholder","New campaign name"),value:n,onChange:e=>i(e.target.value),className:"pr-8"}),(0,t.jsx)("button",{type:"button",onClick:()=>{r(e[0].id),i("")},className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 rounded-full hover:bg-sys-bg-default-tertiary text-sys-text-default-tertiary hover:text-sys-text-default-primary transition-colors",title:o("dashboard.trackers.form.selectExisting","Select existing"),children:(0,t.jsx)(L.A,{className:"w-4 h-4"})})]});if(c){let n="new"!==a||l?a:"";return(0,t.jsxs)(u.l6,{value:n,onValueChange:r,disabled:s,children:[(0,t.jsx)(u.bq,{className:"w-full",children:(0,t.jsx)(u.yv,{placeholder:s?o("common.loading","Loading..."):void 0})}),(0,t.jsxs)(u.gC,{children:[e.map(e=>(0,t.jsx)(u.eb,{value:e.id,children:e.name},e.id)),l&&(0,t.jsx)(u.eb,{value:"new",className:"text-sys-text-brand-primary",children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(X.A,{className:"w-4 h-4"}),o("dashboard.trackers.form.addNewCampaign","Add new campaign")]})})]})]})}return l?(0,t.jsx)(u.pd,{id:d,placeholder:o("dashboard.trackers.form.campaignPlaceholder","Campaign name (e.g., summer_promo)"),value:n,onChange:e=>i(e.target.value)}):(0,t.jsx)(u.pd,{id:d,placeholder:o("dashboard.trackers.form.noCampaignsAvailable","No campaigns available"),disabled:!0})}function eb({brands:e,brandsLoading:s,selectedBrandId:a,onBrandChange:n,userCountryCode:i,getCountryName:l,t:o,inputId:d}){let c=(0,r.useMemo)(()=>e.reduce((e,s)=>{let a=s.countryCode||"OTHER";return e[a]||(e[a]=[]),e[a].push(s),e},{}),[e]),m=(0,r.useMemo)(()=>eu(Object.keys(c),i),[c,i]);return(0,t.jsxs)(u.l6,{value:a,onValueChange:n,disabled:s,children:[(0,t.jsx)(u.bq,{id:d,className:"w-full",children:(0,t.jsx)(u.yv,{placeholder:o("dashboard.trackers.form.brandPlaceholder","Select a brand...")})}),(0,t.jsx)(u.gC,{children:m.map(e=>(0,t.jsxs)(u.s3,{children:[(0,t.jsxs)(u.TR,{className:"flex items-center justify-center gap-2 py-2 mt-2 first:mt-0",children:[(0,t.jsx)("span",{className:"text-sys-text-default-tertiary",children:"--"}),(0,t.jsx)(ef,{code:e,name:l(e),size:18}),(0,t.jsx)("span",{className:"font-semibold text-sys-text-default-primary",children:l(e)}),e===i&&(0,t.jsx)(Q.A,{className:"w-3 h-3 text-sys-text-warning-primary"}),(0,t.jsx)("span",{className:"text-sys-text-default-tertiary",children:"--"})]}),c[e].map(e=>(0,t.jsx)(u.eb,{value:e.key,children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[e.logoUrl&&(0,t.jsx)(T.default,{src:e.logoUrl,alt:e.label,width:20,height:20,className:"rounded"}),(0,t.jsx)("span",{children:e.label})]})},e.key))]},e))})]})}let eg=({className:e})=>{let{t:s}=(0,m.ok)(),{countryCode:a,countries:i}=(0,eo.F)(),{org:l,checkUserAccess:d}=(0,o.A)(),{trackers:c,isLoading:h,createTracker:f,deleteTracker:p}=((0,ei.useSearchParams)(),function(){let e=(0,n.d4)(O.nH),[s,a]=(0,r.useState)([]),[t,i]=(0,r.useState)(!0),[l,o]=(0,r.useState)(null),d=(0,r.useCallback)(async(s=!0)=>{if(!e?.id)return void i(!1);try{s&&i(!0),o(null);let t=await el.e.list({orgId:e.id});a(t.trackers??[])}catch(e){console.error("Error fetching trackers:",e),o(e instanceof Error?e.message:"Failed to fetch trackers")}finally{i(!1)}},[e?.id]),c=(0,r.useCallback)(async s=>{if(!e?.id)throw Error("Organization not found");try{let a=await el.e.create({...s,orgId:e.id});if(a)return await d(!1),a}catch(e){throw console.error("Error creating tracker:",e),e}},[e?.id,d]),m=(0,r.useCallback)(async(s,a)=>{if(!e?.id)throw Error("Organization not found");try{let t=await el.e.update({...a,trackerId:s,orgId:e.id});if(t)return await d(!1),t}catch(e){throw console.error("Error updating tracker:",e),e}},[e?.id,d]),x=(0,r.useCallback)(async s=>{if(!e?.id)throw Error("Organization not found");try{return await el.e.deleteTracker({trackerId:s,orgId:e.id}),a(e=>e.filter(e=>e.id!==s)),!0}catch(e){throw console.error("Error deleting tracker:",e),e}},[e?.id]);return(0,r.useEffect)(()=>{d(!0)},[d]),{trackers:s,isLoading:t,error:l,refetch:(0,r.useCallback)(async()=>{await d(!0)},[d]),createTracker:c,updateTracker:m,deleteTracker:x}}()),b=d({requiredPermissions:[em.JjK.TRACKER.CREATE]}),g=d({requiredPermissions:[em.JjK.TRACKER.DELETE]}),y=d({requiredPermissions:[em.JjK.CAMPAIGN.CREATE]}),[k,N]=(0,r.useState)([]),[v,w]=(0,r.useState)(!0),[A,S]=(0,r.useState)(""),[$,E]=(0,r.useState)(""),[G,F]=(0,r.useState)(!1),[I,z]=(0,r.useState)("new"),[M,R]=(0,r.useState)([]),[P,U]=(0,r.useState)(!1),D=e=>{E(e.replace(/\s+/g,"_").replace(/[^a-zA-Z0-9_-]/g,""))},[_,H]=(0,r.useState)(!1),[W,Y]=(0,r.useState)(null),[K,Z]=(0,r.useState)(!1),[J,V]=(0,r.useState)(null),[Q,eh]=(0,r.useState)(!1),[eg,ey]=(0,r.useState)(null),[ej,ek]=(0,r.useState)(new Set),eN=(0,r.useMemo)(()=>{let e=new Map;return k.forEach(s=>{e.set(s.key,s.countryCode)}),e},[k]),ev=(0,r.useMemo)(()=>{let e=new Set;return c.forEach(s=>{let a=eN.get(s.brandKey);a&&e.add(a)}),eu(Array.from(e),a)},[c,eN,a]),ew=(0,r.useMemo)(()=>eg?c.filter(e=>eN.get(e.brandKey)===eg):c,[c,eg,eN]),eC=(0,r.useMemo)(()=>{let e=new Map;return ew.forEach(s=>{let a=eN.get(s.brandKey)||"OTHER",t=e.get(a)||[];e.set(a,[...t,s])}),eu(Array.from(e.keys()),a).map(s=>({countryCode:s,trackers:e.get(s)||[]})).filter(e=>e.trackers.length>0)},[ew,eN,a]),eA=(0,r.useCallback)(async()=>{if(l?.id)try{w(!0);let e=await ed.P.getUserBrands({orgId:l.id});N(e??[])}catch(e){console.error("Error fetching brands:",e)}finally{w(!1)}},[l?.id]);(0,r.useEffect)(()=>{eA()},[eA]),(0,r.useEffect)(()=>{if(!A&&k.length>0&&a){let e=k.find(e=>e.countryCode===a);e&&S(e.key)}},[k,a,A]),(0,r.useEffect)(()=>{l?.id&&(U(!0),ec.a.list({orgId:l.id,status:"active"}).then(e=>{R(e.campaigns),z(e.campaigns.length>0?e.campaigns[0].id:"new")}).catch(e=>{console.error("Error fetching campaigns:",e),R([]),z("new")}).finally(()=>{U(!1)}))},[l?.id]);let eS=(0,r.useCallback)(e=>{let s=i.find(s=>s.code===e);return s?.name||e},[i]),eT=(0,r.useCallback)((e,a,t)=>{let r=c.find(s=>s.brandKey===e&&(a?s.campaignId===a:t?s.campaignName?.toLowerCase()===t.toLowerCase():!s.campaignId&&!s.campaignName));return r?s("dashboard.trackers.validation.duplicateTracker",'A tracker for this brand with campaign "{{campaign}}" already exists',{campaign:r.campaignName||"default"}):null},[c,s]),eL=async()=>{let e;if(!A)return void(0,ex.P0)(s("dashboard.trackers.validation.brandRequired","Please select a brand"),ex.Ck.Error);let a={brandKey:A};"new"===I?(e=$.trim()||void 0)&&(a.campaignName=e):a.campaignId=I;let t=eT(A,a.campaignId,e);if(t)return void(0,ex.P0)(t,ex.Ck.Error);try{F(!0),await f(a),(0,ex.P0)(s("dashboard.trackers.createSuccess","Tracker created successfully!"),ex.Ck.Success),S(""),E(""),z("new")}catch(a){console.error("Error creating tracker:",a);let e=a instanceof Error?a.message:s("dashboard.trackers.createError","Failed to create tracker");(0,ex.P0)(e,ex.Ck.Error)}finally{F(!1)}},e$=(0,r.useCallback)(e=>1===c.filter(s=>s.brandKey===e.brandKey).length,[c]),eE=(0,r.useCallback)(async e=>{try{eh(!0),await p(e),(0,ex.P0)(s("dashboard.trackers.deleteSuccess","Tracker deleted"),ex.Ck.Success),Z(!1),V(null)}catch(e){console.error("Error deleting tracker:",e),(0,ex.P0)(s("dashboard.trackers.deleteError","Failed to delete tracker"),ex.Ck.Error)}finally{eh(!1)}},[p,s]),eG=(0,r.useCallback)(e=>{e$(e)?(V(e),Z(!0)):eE(e.id)},[e$,eE]),eF=(0,r.useCallback)(()=>{J&&eE(J.id)},[J,eE]),eI=!h&&0===c.length,ez=ew;return h&&1?(0,t.jsx)(u.Zp,{className:(0,j.cn)("p-6",e),children:(0,t.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,t.jsx)("div",{className:"h-6 w-48 bg-sys-bg-default-tertiary rounded animate-pulse"}),(0,t.jsx)("div",{className:"h-20 w-full bg-sys-bg-default-tertiary rounded animate-pulse"}),(0,t.jsx)("div",{className:"h-20 w-full bg-sys-bg-default-tertiary rounded animate-pulse"})]})}):eI?b?(0,t.jsx)(u.Zp,{className:(0,j.cn)("p-6 transition-all duration-300 ease-in-out",e),children:(0,t.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"flex items-center justify-center w-12 h-12 rounded-full bg-sys-bg-brand-tertiary",children:(0,t.jsx)(ee.A,{className:"w-6 h-6 text-sys-text-brand-primary"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-xl font-semibold text-sys-text-default-primary",children:s("dashboard.trackers.createFirst.title","Create Your First Tracking Link")}),(0,t.jsx)("p",{className:"text-sm text-sys-text-default-secondary",children:s("dashboard.trackers.createFirst.description","Start earning by sharing your personalized tracking links with your audience.")})]})]}),(0,t.jsxs)("div",{className:"flex flex-col tablet:flex-row gap-4 text-sm text-sys-text-default-secondary",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(u.Ex,{variant:"number",className:"w-6 h-6",children:"1"}),(0,t.jsx)("span",{children:s("dashboard.trackers.createFirst.step1","Select a brand")})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(u.Ex,{variant:"number",className:"w-6 h-6",children:"2"}),(0,t.jsx)("span",{children:s("dashboard.trackers.createFirst.step2","Name your campaign")})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(u.Ex,{variant:"number",className:"w-6 h-6",children:"3"}),(0,t.jsx)("span",{children:s("dashboard.trackers.createFirst.step3","Get your link!")})]})]}),(0,t.jsxs)("div",{className:"flex flex-col tablet:flex-row gap-4",children:[(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)(u.JU,{htmlFor:"brand-select",className:"sr-only",children:s("dashboard.trackers.form.brand","Select Brand")}),(0,t.jsx)(eb,{brands:k,brandsLoading:v,selectedBrandId:A,onBrandChange:S,userCountryCode:a,getCountryName:eS,t:s,inputId:"brand-select"})]}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)(u.JU,{htmlFor:"campaign-input",className:"sr-only",children:s("dashboard.trackers.form.campaign","Campaign Name")}),(0,t.jsx)(ep,{campaigns:M,campaignsLoading:P,selectedCampaign:I,onCampaignChange:z,campaignName:$,onCampaignNameChange:D,canCreateCampaign:y,t:s,inputId:"campaign-input"})]})]}),(0,t.jsx)(u.$n,{color:"brand",size:"lg",onClick:eL,disabled:G||!A,className:"w-full tablet:w-auto tablet:self-start",children:G?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"animate-spin rounded-full h-4 w-4 border-2 border-b-transparent border-current mr-2"}),s("common.creating","Creating...")]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(X.A,{className:"w-4 h-4 mr-2"}),s("dashboard.trackers.createButton","Create My First Tracker")]})})]})}):(0,t.jsx)(u.Zp,{className:(0,j.cn)("p-6 transition-all duration-300 ease-in-out",e),children:(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center gap-4 py-8 text-center",children:[(0,t.jsx)("div",{className:"flex items-center justify-center w-12 h-12 rounded-full bg-sys-bg-default-tertiary",children:(0,t.jsx)(ee.A,{className:"w-6 h-6 text-sys-text-default-tertiary"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-lg font-semibold text-sys-text-default-primary",children:s("dashboard.trackers.noTrackers","No Tracking Links")}),(0,t.jsx)("p",{className:"text-sm text-sys-text-default-secondary",children:s("dashboard.trackers.noTrackersDescription","You don't have any tracking links yet.")})]})]})}):(0,t.jsx)(u.Bc,{children:(0,t.jsxs)(u.Zp,{className:(0,j.cn)("p-6 transition-all duration-300 ease-in-out",e),children:[(0,t.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"flex items-center justify-center w-10 h-10 rounded-full bg-sys-bg-brand-tertiary",children:(0,t.jsx)(ee.A,{className:"w-5 h-5 text-sys-text-brand-primary"})}),(0,t.jsxs)("h3",{className:"flex items-center gap-1 text-lg font-semibold text-sys-text-default-primary",children:[s("dashboard.trackers.title","My Tracking Links"),(0,t.jsxs)(u.m_,{children:[(0,t.jsx)(u.k$,{asChild:!0,children:(0,t.jsx)("span",{className:"inline-flex cursor-help shrink-0",children:(0,t.jsx)(C.A,{className:"h-3.5 w-3.5 text-sys-text-default-tertiary"})})}),(0,t.jsx)(u.ZI,{className:"max-w-sm",children:(0,t.jsx)("p",{className:"whitespace-pre-line",children:s("dashboard.trackers.titleTooltip","Share these custom URLs to automatically link players to your account, track their activity on the Invited Players page, and earn commission from their gameplay.\n\nHow to create your link:\n1. Select a brand: Choose the specific casino you want to promote.\n2. Name your campaign: Add a custom name to track and compare where your traffic comes from.\n3. Get your link: Copy your generated URL and start sharing it with your audience!")})})]})]})]}),ev.length>1&&(0,t.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,t.jsx)("button",{onClick:()=>ey(null),className:(0,j.cn)("flex items-center gap-2 px-4 py-2.5 rounded-xl border-2 transition-all font-medium",null===eg?"bg-sys-bg-brand-primary border-sys-border-brand-primary text-white":"bg-sys-bg-default-secondary border-sys-border-default-secondary text-sys-text-default-primary hover:border-sys-border-default-primary"),children:(0,t.jsx)("span",{children:s("common.all","All")})}),ev.map(e=>(0,t.jsxs)("button",{onClick:()=>ey(e),className:(0,j.cn)("flex items-center gap-2 px-4 py-2.5 rounded-xl border-2 transition-all font-medium",eg===e?"bg-sys-bg-brand-primary border-sys-border-brand-primary text-white":"bg-sys-bg-default-secondary border-sys-border-default-secondary text-sys-text-default-primary hover:border-sys-border-default-primary"),title:eS(e),children:[(0,t.jsx)(ef,{code:e,name:eS(e),size:24,className:"w-6 h-6"}),(0,t.jsx)("span",{children:e})]},e))]}),(0,t.jsxs)("div",{className:"flex flex-col gap-4",children:[0===ez.length&&eg&&(0,t.jsx)("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:(0,t.jsx)("p",{className:"text-sys-text-default-secondary",children:s("dashboard.trackers.noTrackersForCountry","No trackers for this country")})}),eC.map(e=>{let a=ej.has(e.countryCode),r=e.trackers.length>4,n=r&&!a?e.trackers.slice(0,4):e.trackers,i=e.trackers.length-4;return(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(eC.length>1||!eg)&&(0,t.jsxs)("div",{className:"flex items-center gap-2 py-1",children:[(0,t.jsx)(ef,{code:e.countryCode,name:eS(e.countryCode),size:20,className:"w-5 h-5"}),(0,t.jsx)("span",{className:"text-sm font-medium text-sys-text-default-secondary",children:eS(e.countryCode)}),(0,t.jsx)("div",{className:"flex-1 h-px bg-sys-border-default-secondary"})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[n.map(e=>(0,t.jsxs)("div",{className:"flex items-center gap-3 p-3 rounded-lg border border-sys-border-default-secondary bg-sys-bg-default-primary hover:bg-sys-bg-default-secondary transition-colors",children:[(0,t.jsx)("div",{className:"flex-shrink-0 w-10 h-10 rounded-lg bg-sys-bg-default-tertiary flex items-center justify-center overflow-hidden",children:e.brandLogo?(0,t.jsx)(T.default,{src:e.brandLogo,alt:e.brandName||"",width:40,height:40,className:"object-cover"}):(0,t.jsx)(ee.A,{className:"w-5 h-5 text-sys-text-default-tertiary"})}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("div",{className:"flex items-center gap-2",children:(0,t.jsxs)("span",{className:"font-medium text-sys-text-default-primary truncate",children:[e.brandName,e.campaignName?` - ${e.campaignName}`:""]})}),(0,t.jsx)("p",{className:"text-xs text-sys-text-default-tertiary truncate",children:e.generatedUrl||s("dashboard.trackers.noUrlShort","No URL configured")})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsxs)(u.$n,{variant:"tinted",size:"sm",onClick:()=>{e.generatedUrl?(0,x.l)(e.generatedUrl,s("dashboard.trackers.linkCopied","Link copied!")):(0,ex.P0)(s("dashboard.trackers.noUrl","No tracking URL available"),ex.Ck.Warning)},disabled:!e.generatedUrl,children:[(0,t.jsx)(B.A,{className:"w-4 h-4 mr-1"}),s("dashboard.trackers.copy","Copy")]}),(0,t.jsx)(u.$n,{variant:"ghost",size:"sm",iconOnly:!0,onClick:()=>{Y(e),H(!0)},disabled:!e.generatedUrl,title:s("dashboard.trackers.share","Share"),children:(0,t.jsx)(es.A,{className:"w-4 h-4"})}),g&&(0,t.jsxs)(u.rI,{children:[(0,t.jsx)(u.ty,{asChild:!0,children:(0,t.jsx)(u.$n,{variant:"ghost",size:"sm",iconOnly:!0,children:(0,t.jsx)(ea.A,{className:"w-4 h-4"})})}),(0,t.jsx)(u.SQ,{align:"end",children:(0,t.jsxs)(u._2,{onClick:()=>eG(e),className:"text-sys-text-negative-primary",children:[(0,t.jsx)(et.A,{className:"w-4 h-4 mr-2"}),s("dashboard.trackers.delete","Delete")]})})]})]})]},e.id)),r&&(0,t.jsxs)("button",{onClick:()=>{ek(s=>{let a=new Set(s);return a.has(e.countryCode)?a.delete(e.countryCode):a.add(e.countryCode),a})},className:"flex items-center justify-center gap-1 py-2 text-sm text-sys-text-brand-primary hover:text-sys-text-brand-secondary transition-colors",children:[(0,t.jsx)(er.A,{className:(0,j.cn)("w-4 h-4 transition-transform duration-200",a&&"rotate-180")}),a?s("dashboard.trackers.showLess","Show less"):s("dashboard.trackers.showMore","Show {{count}} more",{count:i})]})]})]},e.countryCode)})]}),b&&(0,t.jsxs)("div",{className:"flex flex-col tablet:flex-row gap-3 pt-4 border-t border-sys-border-default-secondary",children:[(0,t.jsx)("div",{className:"flex-1",children:(0,t.jsx)(eb,{brands:k,brandsLoading:v,selectedBrandId:A,onBrandChange:S,userCountryCode:a,getCountryName:eS,t:s})}),(0,t.jsx)("div",{className:"flex-1",children:(0,t.jsx)(ep,{campaigns:M,campaignsLoading:P,selectedCampaign:I,onCampaignChange:z,campaignName:$,onCampaignNameChange:D,canCreateCampaign:y,t:s})}),(0,t.jsx)(u.$n,{color:"brand",onClick:eL,disabled:G||!A,className:"tablet:w-auto",children:G?(0,t.jsx)("div",{className:"animate-spin rounded-full h-4 w-4 border-2 border-b-transparent border-current"}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(X.A,{className:"w-4 h-4 mr-2"}),s("dashboard.trackers.create","Create")]})})]})]}),(0,t.jsx)(q,{show:_,onHide:()=>{H(!1),Y(null)},mode:"share",selectedBrandName:W?.brandName,shareUrl:W?.generatedUrl||void 0}),(0,t.jsx)(u.lG,{open:K,onOpenChange:Z,children:(0,t.jsxs)(u.Cf,{className:"w-[90vw] max-w-xl",children:[(0,t.jsx)(u.c7,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3 text-sys-text-warning-primary",children:[(0,t.jsx)(en.A,{className:"h-8 w-8 shrink-0"}),(0,t.jsx)(u.L3,{className:"text-xl",children:s("trackers.deleteLastTrackerWarning.title","STOP! This is Your Last Tracker for This Brand")})]})}),(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)("p",{className:"text-base font-medium text-sys-text-default-primary",children:s("trackers.deleteLastTrackerWarning.message","You are about to delete your ONLY tracking link for this brand. This is a big deal!")}),(0,t.jsxs)("div",{className:"bg-sys-bg-negative-tertiary border border-sys-border-negative-primary rounded-lg p-4 space-y-3",children:[(0,t.jsxs)("p",{className:"text-sys-text-negative-primary font-semibold",children:[s("common.warning","Warning"),":"]}),(0,t.jsxs)("ul",{className:"space-y-2 text-sm text-sys-text-default-primary",children:[(0,t.jsxs)("li",{className:"flex items-start gap-2",children:[(0,t.jsx)(L.A,{className:"h-5 w-5 text-sys-text-negative-primary shrink-0 mt-0.5"}),(0,t.jsx)("span",{children:s("trackers.deleteLastTrackerWarning.consequence1","All your active revenue share contracts for this brand will be CANCELLED immediately")})]}),(0,t.jsxs)("li",{className:"flex items-start gap-2",children:[(0,t.jsx)(L.A,{className:"h-5 w-5 text-sys-text-negative-primary shrink-0 mt-0.5"}),(0,t.jsx)("span",{children:s("trackers.deleteLastTrackerWarning.consequence2","You will NOT receive any more revenue share payments from this brand")})]}),(0,t.jsxs)("li",{className:"flex items-start gap-2",children:[(0,t.jsx)(L.A,{className:"h-5 w-5 text-sys-text-negative-primary shrink-0 mt-0.5"}),(0,t.jsx)("span",{children:s("trackers.deleteLastTrackerWarning.consequence3","Any players you referred will no longer generate income for you")})]})]})]}),(0,t.jsx)("p",{className:"text-base font-bold text-sys-text-default-primary",children:s("trackers.deleteLastTrackerWarning.confirmQuestion","Are you 100% sure you want to lose your revenue from this brand?")})]}),(0,t.jsxs)(u.Es,{className:"flex-col sm:flex-row sm:justify-between gap-2 pt-4",children:[(0,t.jsx)(u.$n,{variant:"outline",onClick:()=>{Z(!1),V(null)},className:"w-full sm:w-auto",children:s("trackers.deleteLastTrackerWarning.cancelButton","No, Keep My Tracker")}),(0,t.jsx)(u.$n,{variant:"ghost",onClick:eF,disabled:Q,className:"w-full sm:w-auto",children:Q?(0,t.jsx)("div",{className:"animate-spin rounded-full h-4 w-4 border-2 border-b-transparent border-current"}):s("trackers.deleteLastTrackerWarning.confirmButton","Yes, Delete and Cancel My Contracts")})]})]})})]})})};var ey=a(38289);let ej=()=>{let{t:e}=(0,m.ok)(),{formatWithSymbol:s,convert:a}=(0,l.H2)(),[u,f]=(0,r.useState)(!1),[p,b]=(0,r.useState)(!1),[g,y]=(0,r.useState)(""),{org:j}=(0,o.A)(),k=(0,n.d4)(e=>({dashboard:{link:""}})),{totals:N}=(0,d.h)();return((0,r.useEffect)(()=>{j&&y((0,h.F)(j))},[j]),(0,r.useEffect)(()=>{f(!0),setTimeout(()=>{document.body.classList.add("hydrated")},100)},[]),u)?(0,t.jsxs)("div",{className:"min-h-screen bg-sys-bg-default-tertiary font-inter",children:[(0,t.jsx)(c.A,{title:e("influencer.dashboard.title","Dashboard")}),(0,t.jsx)("div",{className:"container p-4",children:(0,t.jsxs)("div",{className:"dashboard flex flex-col gap-4",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-4 lg:grid lg:grid-cols-3",children:[(0,t.jsxs)("div",{className:"lg:col-span-1 lg:order-2 lg:flex lg:flex-col lg:gap-4",children:[(0,t.jsx)(ey.A,{}),(0,t.jsx)("div",{className:"hidden lg:flex lg:flex-col lg:gap-4",children:(0,t.jsx)(V,{})})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-4 lg:col-span-2 lg:order-1",children:[(0,t.jsx)(v,{}),(0,t.jsx)(eg,{}),(0,t.jsx)(S,{referralStats:{totalRewards:s(a(N?.totalRevshare||0)),pendingRewards:s(a(N?.totalPending||0)),friendsInvited:0,successfulReferrals:N?.totalAffiliates||0},handleInvite:()=>{b(!0)},setReferralLink:y}),(0,t.jsx)("div",{className:"flex flex-col gap-4 lg:hidden",children:(0,t.jsx)(V,{})})]})]}),(0,t.jsx)(w.A,{show:p,onHide:()=>b(!1),referralLink:g,onCopyLink:()=>{g&&(0,x.l)(g,e("inviteInfluencer.referralLink.referralLinkCopied","Referral link copied to clipboard!"))}}),j?.id&&k?.dashboard?.link&&(0,t.jsx)(i.A,{tutorialName:"dashboard",videoUrl:k?.dashboard?.link,title:e("tutorial.welcome.dashboard","Welcome to Your Influencer Dashboard"),autoShow:!0})]})})]}):(0,t.jsxs)("div",{className:"min-h-screen bg-sys-bg-default-primary p-2",children:[(0,t.jsx)(c.A,{title:e("influencer.dashboard.title","Dashboard")}),(0,t.jsx)("div",{className:"flex justify-center items-center h-96",children:(0,t.jsx)("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-primary"})})]})}},38289:(e,s,a)=>{"use strict";a.d(s,{A:()=>f});var t=a(95155),r=a(98500),n=a.n(r),i=a(73321),l=a(12115),o=a(52115),d=a(71053),c=a(58440),m=a(26842),x=a(68729),h=a(85410),u=a(47601);let f=({hideTierCard:e=!1})=>{let{t:s}=(0,h.ok)(),{balance:a,inProcess:r,accumulating:f,withdrawal:p,isLoading:b,error:g,refetch:y}=(0,x.A)(),[j,k]=(0,l.useState)(!1),N=(0,i.usePathname)();return(0,t.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,t.jsx)(d.S,{balance:a,inProcess:r,accumulating:f,withdrawal:p,isLoading:b,error:g,enableCurrencyConversion:!0}),(0,t.jsx)(o.Zp,{children:(0,t.jsx)("div",{className:"p-4 flex flex-col gap-3",children:(0,t.jsxs)("div",{className:"flex gap-2",children:["/payments"!==N&&(0,t.jsx)("div",{className:"w-full",children:(0,t.jsx)(n(),{href:"/payments",className:"block",children:(0,t.jsx)(o.$n,{variant:"tinted",size:"md",className:"w-full",children:s("user.dashboard.transactions","Transactions")})})}),(0,t.jsx)("div",{className:"w-full",children:(0,t.jsx)(m.H,{size:"md",balance:a,onClick:()=>k(!0),className:"w-full"})})]})})}),!e&&(0,t.jsx)(c.c,{}),(0,t.jsx)(u.A,{show:j,onHide:()=>k(!1),availableBalance:a.toFixed(2),currency:"$",onSuccess:y})]})}},40612:(e,s,a)=>{"use strict";a.d(s,{a:()=>n});var t=a(37780);class r extends t.W{async list(e){return this.typedGet("/campaigns",e,"Failed to list campaigns")}async create(e){return this.typedPost("/campaigns",e,"Failed to create campaign")}async update(e){let{campaignId:s,...a}=e;return this.typedPut(`/campaigns/${s}`,a,"Failed to update campaign")}async deleteCampaign(e){let{campaignId:s,orgId:a}=e;return this.typedDelete(`/campaigns/${s}?orgId=${encodeURIComponent(a)}`,"Failed to delete campaign")}}let n=new r},41585:(e,s,a)=>{"use strict";a.d(s,{A:()=>t});let t=(0,a(78340).A)("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},42400:(e,s,a)=>{"use strict";a.d(s,{Ck:()=>n,P0:()=>i});var t,r=a(66609),n=((t={}).Success="success",t.Error="error",t.Warning="warning",t.Info="info",t.Loading="loading",t);function i(e,s="info"){switch(s){case"success":return r.oR.success(e);case"error":return r.oR.error(e);case"warning":return r.oR.warning(e);case"loading":return r.oR.loading(e);default:return r.oR.info(e)}}},42869:(e,s,a)=>{"use strict";a.d(s,{A:()=>t});let t=(0,a(78340).A)("user",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]])},47834:(e,s,a)=>{"use strict";a.d(s,{A:()=>t});let t=(0,a(78340).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"}]])},50356:(e,s,a)=>{"use strict";a.d(s,{A:()=>m});var t=a(95155),r=a(12115),n=a(42021),i=a(52115),l=a(85410),o=a(97691),d=a(92093);let c=[{name:"Facebook",icon:(0,t.jsx)(n.ok6,{size:24}),bgClass:"bg-blue-500/10 text-blue-500 hover:bg-blue-500/20"},{name:"X",icon:(0,t.jsx)(n.feZ,{size:24}),bgClass:"bg-sky-500/10 text-sky-500 hover:bg-sky-500/20"},{name:"WhatsApp",icon:(0,t.jsx)(n.EcP,{size:24}),bgClass:"bg-green-500/10 text-green-500 hover:bg-green-500/20"},{name:"Instagram",icon:(0,t.jsx)(n.ao$,{size:24}),bgClass:"bg-pink-500/10 text-pink-500 hover:bg-pink-500/20"}],m=({show:e,onHide:s,referralLink:a})=>{let{t:n}=(0,l.ok)(),[m,x]=(0,r.useState)(!1);(0,r.useEffect)(()=>{let e=()=>{x(window.innerWidth>=640)};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]);let h=()=>{a&&(0,o.l)(a,n("inviteInfluencer.referralLink.referralLinkCopied","Referral link copied to clipboard!"))},u=()=>(0,t.jsx)("div",{className:"relative",children:(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{children:(0,t.jsxs)(i.$n,{onClick:h,variant:"filled",size:"md",color:"brand",className:"w-full flex items-center justify-center gap-2",disabled:!a,children:[(0,t.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"25",height:"24",viewBox:"0 0 25 24",fill:"none",children:(0,t.jsx)("path",{d:"M11.2287 8.84179C11.9114 8.89074 12.5763 9.08656 13.1769 9.41503C13.7774 9.7435 14.3004 10.1977 14.7101 10.7461C14.9578 11.0779 14.8895 11.548 14.5578 11.7959C14.226 12.0434 13.7558 11.9752 13.508 11.6435C13.2269 11.2674 12.8689 10.9556 12.4572 10.7305C12.0454 10.5053 11.5893 10.3714 11.1213 10.3379C10.6535 10.3044 10.1838 10.372 9.74432 10.5361C9.35962 10.6798 9.00609 10.8949 8.70135 11.1689L8.57342 11.29L6.16034 13.706C5.56975 14.323 5.24276 15.1469 5.25018 16.0019C5.2577 16.8613 5.60235 17.6836 6.20916 18.291C6.81594 18.8982 7.63667 19.2425 8.49432 19.25C9.29847 19.257 10.0754 18.9673 10.6779 18.4394L10.7961 18.3301L12.1623 16.9629L12.2199 16.9111C12.5144 16.6708 12.9491 16.6875 13.2238 16.9619C13.5166 17.2547 13.5165 17.7295 13.2238 18.0225L11.8478 19.3994L11.839 19.4092C10.939 20.2793 9.73315 20.7608 8.48162 20.75C7.23 20.7391 6.03248 20.2363 5.14764 19.3506C4.2629 18.4649 3.76105 17.2668 3.75018 16.0146C3.73934 14.7625 4.22075 13.5562 5.09002 12.6553L5.09881 12.6455L7.5119 10.2295L7.69842 10.0537C8.14278 9.6541 8.65872 9.3404 9.21991 9.13086C9.86101 8.89151 10.5462 8.79291 11.2287 8.84179ZM16.5187 3.25C17.7704 3.26088 18.9679 3.76368 19.8527 4.64941C20.7375 5.5351 21.2393 6.73319 21.2502 7.98535L21.2463 8.21972C21.1992 9.38726 20.7252 10.5001 19.9103 11.3447L19.9015 11.3545L17.4875 13.7695L17.4885 13.7705C17.0047 14.255 16.4217 14.6297 15.7805 14.8691C15.1393 15.1085 14.4542 15.2071 13.7717 15.1582C13.0889 15.1093 12.424 14.9134 11.8234 14.585C11.2229 14.2565 10.7 13.8023 10.2902 13.2539C10.0425 12.9221 10.1109 12.452 10.4426 12.2041C10.7743 11.9566 11.2445 12.0248 11.4924 12.3564C11.7735 12.7325 12.1315 13.0444 12.5431 13.2695C12.9549 13.4947 13.4111 13.6286 13.8791 13.6621C14.3469 13.6956 14.8166 13.628 15.256 13.4639C15.6957 13.2997 16.0951 13.0422 16.4269 12.71L18.84 10.2939C19.3935 9.7158 19.7151 8.95614 19.7472 8.15918L19.7502 7.99804C19.7427 7.13873 19.398 6.31641 18.7912 5.70898C18.1844 5.10176 17.3637 4.75749 16.506 4.75C15.6482 4.74253 14.8216 5.07312 14.2043 5.66992L12.8283 7.03906L12.7707 7.09082C12.4755 7.33005 12.0416 7.31126 11.7678 7.03613C11.4756 6.74253 11.4761 6.26775 11.7697 5.97558L13.1535 4.59863L13.1613 4.59082L13.3342 4.43261C14.2128 3.66284 15.3455 3.23984 16.5187 3.25Z",fill:"currentColor"})}),n("common.copyLink","Copy Link")]})}),(0,t.jsx)(i.Zp,{className:"pt-4",children:(0,t.jsx)("div",{className:"grid grid-cols-4 gap-3 items-center justify-center",children:c.map(e=>(0,t.jsx)("div",{className:"flex flex-col items-center flex-1",children:(0,t.jsx)("div",{className:(0,d.cn)("flex justify-center items-center w-full h-full p-2.5 rounded-xl transition-all duration-200 cursor-pointer",e.bgClass),children:e.icon})},e.name))})})]})}),f=()=>(0,t.jsxs)("div",{children:[(0,t.jsx)(i.L3,{className:"text-lg font-semibold text-sys-text-default-primary",children:n("user.dashboard.modal.invite.title","Share Your Referral Link")}),(0,t.jsx)("p",{className:"text-sm font-medium text-sys-text-default-secondary mt-1",children:n("user.dashboard.modal.invite.description","Share your referral link with friends and earn rewards when they join")})]});return m?(0,t.jsx)(i.lG,{open:e,onOpenChange:e=>!e&&s(),children:(0,t.jsxs)(i.Cf,{variant:"fixed-width",children:[(0,t.jsx)(i.c7,{className:"items-start",children:f()}),(0,t.jsx)(i.R4,{className:"pt-6",children:u()})]})}):(0,t.jsx)(i._s,{open:e,onOpenChange:e=>!e&&s(),children:(0,t.jsxs)(i.zj,{children:[(0,t.jsx)(i.BE,{children:f()}),(0,t.jsx)("div",{className:"flex flex-col gap-4 overflow-y-auto pt-6",children:u()})]})})}},51914:(e,s,a)=>{"use strict";a.d(s,{A:()=>t});let t=(0,a(78340).A)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},53810:(e,s,a)=>{"use strict";a.d(s,{A:()=>t});let t=(0,a(78340).A)("share-2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]])},56018:(e,s,a)=>{"use strict";a.d(s,{A:()=>t});let t=(0,a(78340).A)("ellipsis-vertical",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]])},56732:(e,s,a)=>{"use strict";a.d(s,{e:()=>n});var t=a(37780);class r extends t.W{async list(e){return this.typedGet("/trackers",e,"Failed to list trackers")}async getTracker(e){let{trackerId:s}=e;return this.typedGet(`/trackers/${s}`,{},"Failed to get tracker")}async create(e){return this.typedPost("/trackers",e,"Failed to create tracker")}async update(e){let{trackerId:s,...a}=e;return this.typedPut(`/trackers/${s}`,a,"Failed to update tracker")}async deleteTracker(e){let{trackerId:s,orgId:a}=e;return this.typedDelete(`/trackers/${s}?orgId=${encodeURIComponent(a)}`,"Failed to delete tracker")}}let n=new r},67635:(e,s,a)=>{"use strict";a.d(s,{A:()=>t});let t=(0,a(78340).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"}]])},68459:(e,s,a)=>{"use strict";a.d(s,{A:()=>t});let t=(0,a(78340).A)("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]])},86955:(e,s,a)=>{"use strict";a.d(s,{P:()=>n});var t=a(37780);class r extends t.W{async getUserBrands(e){return this.typedGet("/brands",e,"Failed to get user brands")}async getAdminBrands(e={}){return this.typedGet("/brands/admin",e,"Failed to get admin brands")}async getAllBrands(e={}){return this.typedGet("/brands/all",e,"Failed to get all brands")}async getBrandByKey(e){return this.typedGet(`/brands/${encodeURIComponent(e)}`,{},"Failed to get brand by key")}async adminCreateBrand(e){return this.typedPost("/brands/admin",e,"Failed to create brand")}async adminUpdateBrand(e){let{key:s,...a}=e;return this.typedPut(`/brands/admin/${encodeURIComponent(s)}`,a,"Failed to update brand")}}let n=new r},87474:(e,s,a)=>{"use strict";function t(e){return`https://www.fortunegalaxy.io?rId=${e.affiliateId}`}a.d(s,{F:()=>t})},92248:(e,s,a)=>{Promise.resolve().then(a.bind(a,30609))},92564:(e,s,a)=>{"use strict";a.d(s,{A:()=>t});let t=(0,a(78340).A)("message-circle",[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}]])},94290:(e,s,a)=>{"use strict";a.d(s,{A:()=>t});let t=(0,a(78340).A)("star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]])},97233:(e,s,a)=>{"use strict";a.d(s,{A:()=>t});let t=(0,a(78340).A)("link-2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]])},97691:(e,s,a)=>{"use strict";a.d(s,{l:()=>r});var t=a(430);async function r(e,s="Copied to clipboard!",a="Failed to copy to clipboard"){if(!e)return(0,t.o)({title:"Nothing to copy",variant:"negative"}),!1;try{if(navigator.clipboard&&window.isSecureContext)return await navigator.clipboard.writeText(e),(0,t.o)({title:s,variant:"positive"}),!0;{let a=document.createElement("textarea");a.value=e,a.style.position="fixed",a.style.left="-999999px",a.style.top="-999999px",document.body.appendChild(a),a.focus(),a.select();let r=document.execCommand("copy");if(document.body.removeChild(a),r)return(0,t.o)({title:s,variant:"positive"}),!0;throw Error("Copy command failed")}}catch(e){return console.error("Failed to copy text:",e),(0,t.o)({title:a,variant:"negative"}),!1}}},99241:(e,s,a)=>{"use strict";a.d(s,{h:()=>o});var t=a(12115),r=a(2834),n=a(47790),i=a(64469),l=a(86051);let o=()=>{let e=(0,r.d4)(i.nH),{rows:s,isLoading:a,error:o,refetch:d}=(0,n.ef)({reportName:"affiliate-stats",filters:{orgId:e?.id},options:{limit:100,offset:0},enabled:!!e?.id}),{totals:c,isLoading:m,error:x,refetch:h}=(0,n.ef)({reportName:"affiliate-totals",filters:{orgId:e?.id},enabled:!!e?.id}),u=(0,t.useMemo)(()=>s?s.map(e=>{let s=e.email,a=e.name,t=e.joinedDate,r=e.commission||0;return{email:s,firstName:a?.split(" ")[0],lastName:a?.split(" ").slice(1).join(" "),joinedDate:t,platform:"",revshare:(0,l.td)(r),pending:0}}):[],[s]);return{affiliates:u,totals:(0,t.useMemo)(()=>c?{totalAffiliates:Number(c.totalAffiliates??0),totalRevshare:(0,l.td)(Number(c.totalCommission??0)),totalPending:0}:null,[c]),loading:a||m,error:o||x,refetch:(0,t.useCallback)(async()=>{await Promise.all([d(),h()])},[d,h]),rawApiData:{stats:s,totals:c}}}}},e=>{e.O(0,[8465,6446,844,8577,2714,1089,737,5581,5945,6529,7386,8662,9789,647,6985,6688,4850,8441,7806,7358],()=>e(e.s=92248)),_N_E=e.O()}]);