1try{let e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},s=(new e.Error).stack;s&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[s]="12e64b14-d43e-438c-af03-f02edfbd5857",e._sentryDebugIdIdentifier="sentry-dbid-12e64b14-d43e-438c-af03-f02edfbd5857")}catch(we){}import{r as e,j as s}from"./CSvdPb0x.js";import{bv as a,a3 as i,a_ as t,jf as r,aL as n,m as l,cf as o,bj as d,f4 as c,jg as m,Y as j,ef as h,jh as f,ji as u,jj as p,ao as x,cN as y,jk as g,B as b,jl as N,b as w,y as k,i6 as v,jm as A,dM as S,bC as D,jn as C,eA as P,aF as $,jo as F,jp as T,dD as E,b5 as L,jq as W,jr as _,js as q,jt as I,ju as M,jv as Y,jw as R,j0 as V}from"./B97aNPiN.js";import{D as z}from"./BNuBEO8a.js";import{A as O,W as Z,u as G,a as U}from"./BIK9Fnp4.js";import{S as B}from"./DvnBTJ75.js";import{g as H,a as J,R as K,A as Q}from"./BLevEieu.js";import{W as X}from"./DphhMgYm.js";import{u as ee}from"./BUR1UsYE.js";import{u as se}from"./C15GIiKm.js";import{S as ae}from"./8-Wf_xIw.js";import{S as ie}from"./DVQ0qK3O.js";import{s as te,a as re}from"./yDRZNcTB.js";import{u as ne}from"./C8Pkfv60.js";import{O as le,N as oe,S as de}from"./C43MIjsr.js";import{t as ce}from"./DoDNGv0-.js";import{F as me}from"./VvIy9uUJ.js";import{F as je}from"./D4ctL2Zp.js";import he from"./B9At0Stx.js";import{S as fe}from"./BGul7UY4.js";import"./D6ESIijv.js";import"./DfAsxV-W.js";import"./CNaVHDLY.js";import"./Cf_NF55G.js";import"./B8CUchad.js";import"./DHHzFKab.js";import"./uHiaOiuY.js";import"./CZCDi26P.js";import"./BGvhRFph.js";const ue=()=>{const[a,i]=e.useState(null);return e.useEffect(()=>{(async()=>{const{success:e,data:s,error:a}=await r.getAffiliateLastSync();e?i(s):n("error",a)})()},[]),s.jsx(X,{className:"m-b-5",content:s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"ff-bold",children:"We update the list below every 24 hours, so the information you see may not always be up to date. Please check back later for the latest updates."}),s.jsxs("div",{className:"c-grey-200 ff-regular",children:["Last sync: ",a?.date?t(a.date).fromNow():"..."]})]})})},pe=[,s.jsx(f,{}),s.jsx(ie,{})],xe=l(N,(e,s)=>({value:s+1,label:e})),ye={[I]:K,[q]:()=>{const a=ee(),[i,f]=e.useState([]),[u,p]=e.useState(4),[x,y]=e.useState(0),[g,b]=e.useState(!1),N=async(e=0,s=10)=>{if(0!==s){b(!0);const{success:t,data:l,error:o}=await r.getAffiliatePayment({offset:e,limit:s});if(!a())return;t?(f([...0===e?[]:i,...l.results]),p(l.totalResults),y(e+10)):n("error",o),b(!1)}},w=e.useCallback(()=>{const e=u-i.length;return e<=10?N(x,Math.max(e,0)):N(x)},[u,i.length,g,x,N]),{ref:k}=se(w,g);return e.useEffect(()=>{N()},[]),s.jsx(ae,{children:i.length?s.jsxs("table",{ref:k,className:"payments",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Date"}),s.jsx("th",{children:"Amount"}),s.jsx("th",{children:"Payment Method"}),s.jsx("th",{children:"Status"})]})}),s.jsx("tbody",{children:l(i,({createdDate:e,amount:a,chargeCurrency:i,paymentMethodType:r,paymentMethodEmail:n,status:l},h)=>s.jsxs("tr",{children:[s.jsx("td",{children:t(e).format(o.default)}),s.jsx("td",{children:`${d(a,{currency:i})} ${i||c}`}),s.jsx("td",{children:s.jsxs("p",{className:"payment-type",children:[pe[r],s.jsx("span",{children:n})]})}),s.jsx("td",{children:s.jsx("span",{className:j("status",m[l]),children:m[l]})})]},h))})]}):s.jsx(h,{className:"empty-data",description:s.jsxs(s.Fragment,{children:[s.jsx("span",{children:"You have No Affiliate yet"}),s.jsx("span",{children:"Get out there and spread the word"})]})})})}},ge={Withdraw:({userAffiliateDetails:{totalEarned:e,totalPaid:a},onClose:i=()=>{}})=>{const{control:t,errors:o,formState:{isSubmitting:c,isValid:m},handleSubmit:j}=ne({mode:"onChange",defaultValues:{[u]:1},resolver:ce(le().shape({[p]:de().email("Must be valid").matches(/^[A-Z0-9+_.-]+@[A-Z0-9.-]+$/i,"Email can only contain Latin letters.").required("Field is required"),[u]:oe().required("Field is required")}))}),h=H(J(e,a)),f=!x(h),N=y(l(h,(e,s)=>`${d(e,{currency:s})} ${s}`)," + "),w=f?`Withdraw ${N}`:"Withdraw",k=f?null:`None of your pending balances have reached the $${g} / â¬${g} / £${g} minimum yet.`;return s.jsxs(Z,{onSubmit:j(async e=>{const{success:s,error:a}=await r.updateAffiliatePayment(e);s?i():n("error",a)}),children:[s.jsx("h2",{children:w}),k&&s.jsx("p",{children:k}),s.jsx("p",{children:"Please add your PayPal/Payoneer email, and we will send your affiliate payment to that email."}),s.jsx("p",{children:"Please allow up to 35 business days to process the payment. After the payment is processed, the status will change to âCompletedâ in your Affiliate Payments table."}
1),s.jsx("p",{children:"The minimum withdrawal amount is 50 per currency ($50 / â¬50 / £50). Each currency is paid out separately, and balances below the minimum stay pending until they reach it."}),s.jsxs("label",{children:[s.jsx("span",{children:"Payment methods"}),s.jsx(je,{name:u,control:t,options:xe})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Email"}),s.jsx(me,{size:"large",errors:o,control:t,name:p})]}),s.jsx(b,{size:"large",type:"primary",htmlType:"submit",disabled:!m||!f,loading:c,children:"Update"})]})},AffiliateDeal:({userAffiliateDetails:t})=>{const[r,n]=e.useState("Copy");return s.jsxs(s.Fragment,{children:[s.jsx("h2",{children:"Your Affiliate Deal"}),s.jsxs(O,{className:"p-0",children:[s.jsx("li",{children:s.jsxs("div",{className:"link-container",children:[s.jsx("p",{children:"Share link with friends"}),s.jsx(a,{value:t.affiliateLink,className:"link-input",suffix:s.jsx(i,{placement:"top",title:r,children:s.jsx("span",{onClick:()=>(n("Copied"),navigator.clipboard.writeText(t.affiliateLink)),children:s.jsx(B,{})})})})]})}),s.jsxs("li",{children:["Your Friend sign up and get a ",2===t.coupon?.couponTarget?"%":"$",t.coupon?.discountAmount||0," discount"]}),s.jsxs("li",{children:["You get ",t.affiliatePayoutPrecentage,"% of their first"," ",30===t.affiliateDuration?"month":t.affiliateDuration+" days "," payment"]})]})]})},ShowAsUser:he},be=s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"ff-bold",children:"Important! Google Ads Restriction"})," ",s.jsx("br",{}),'Affiliates are not allowed to bid on AutoDS-branded search terms (e.g., "AutoDS," "AutoDS dropshipping," etc.). ',s.jsx("span",{className:"ff-bold",children:"Such ads wonât be eligible for commissions"})," and may lead to removal from our affiliate program. We encourage fair affiliate marketingâfocu
1s on bringing in new users, not redirecting existing traffic.",s.jsx("br",{}),"For details, check our guidelines:Â ",s.jsx("a",{href:"https://help.autods.com/general/autods-affiliate-program",className:"link td-underline",target:"_blank",rel:"noreferrer",children:"AutoDS Affiliate Program"})]}),Ne=()=>{const a=w(),t=k(v),{isLoading:r,affiliateDetails:n}=G(),[o,d]=e.useState("Copy"),[c,m]=e.useState(null),j=(t?.permissions||[]).includes("Admin"),h=t?.email,f=()=>m(null),u=c?ge[c]:()=>null,p=l(A,e=>{const a=ye[e];return{key:e,label:e,children:s.jsx(a,{})}}),x=[...j?[{label:"Show as user",onClick:()=>m(R)}]:[],{label:s.jsxs("span",{className:"flex ai-c gap-5",children:[s.jsx(Y,{})," ",M]}),onClick:async()=>a(V())}];return r?s.jsx(S,{}):s.jsxs(U,{children:[s.jsx("header",{children:s.jsxs("div",{className:"container",children:[s.jsx(D,{to:C,children:s.jsx(P,{})}),s.jsx($,{menu:{items:x},placement:"bottomRight",trigger:["click"],children:s.jsxs("div",{children:[s.jsx(fe,{}),s.jsx("span",{className:"ellipsis email",children:h}),s.jsx(z,{})]})})]})}),s.jsx("main",{children:s.jsxs("div",{className:"container",children:[s.jsx(X,{content:be,variant:"danger",className:"m-b-40"}),s.jsxs("div",{className:"stats",children:[s.jsxs("div",{className:"stats-item",children:[s.jsx("div",{className:"info",children:s.jsx(Q,{amounts:n.totalPaid})}),s.jsx("p",{children:"Total Paid"})]}),s.jsxs("div",{className:"stats-item",children:[s.jsxs("div",{className:"info",children:[s.jsx(Q,{amounts:J(n.totalEarned,n.totalPaid)}),s.jsx(b,{type:"link",className:"ff-regular",onClick:()=>m(F),children:"Withdraw"})]}),s.jsx("p",{children:"Total Pending"})]}),s.jsxs("div",{className:"stats-item",children:[s.jsxs("div",{className:"info",children:[s.jsx("h3",{children:"Your link"}),s.jsx(b,{type:"link",className:"ff-regular",onClick:()=>m(T),children:"View your affiliate deal"})]}),s.jsxs("div",{className:"link-container",children:[s.jsx(E,{value:n.affiliateLink,className:"link-input",suffix:s.jsx(i,{placement:"top",title:o,children:s.jsx("span",{onClick:()=>(d("Copied"),navigator.clipboard.writeText(n.affiliateLink)),children:s.jsx(B,{})})})}),l(te,({link:e,icon:a},i)=>s.jsx("span",{onClick:()=>re(e),children:a},i))]})]})]}),s.jsx(ue,{}),s.jsx(L,{items:p})]})}),s.jsx(W,{centered:!0,destroyOnHidden:!0,footer:null,closable:!1,open:!!c,styles:_,onCancel:f,children:s.jsx(u,{onClose:f,userAffiliateDetails:n})})]})};export{Ne as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.