1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[702],{2e3:function(e,t,r){Promise.resolve().then(r.bind(r,1692))},1692:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return y}});var a=r(7437),n=r(2265),i=r(7648),s=r(1837),o=r(6321),l=r.n(o),d=r(7666);let c=[{key:"gaming",fr:"Gaming",en:"Gaming"},{key:"esports",fr:"Esports",en:"Esports"},{key:"sports",fr:"Sport",en:"Sports"},{key:"music",fr:"Musique",en:"Music"},{key:"tech",fr:"Tech",en:"Tech"},{key:"food",fr:"Food",en:"Food"},{key:"fashion",fr:"Mode",en:"Fashion"},{key:"fitness",fr:"Fitness",en:"Fitness"},{key:"travel",fr:"Voyage",en:"Travel"},{key:"movies",fr:"Cin\xe9ma",en:"Movies"},{key:"anime",fr:"Anime",en:"Anime"},{key:"cooking",fr:"Cuisine",en:"Cooking"}];function u(e){let{lang:t,onDone:r,onDismiss:i}=e,o="fr"===t,[l,d]=(0,n.useState)(0),[u,g]=(0,n.useState)(""),[b,x]=(0,n.useState)(""),[y,v]=(0,n.useState)([]),[j,S]=(0,n.useState)(!1),[_,w]=(0,n.useState)(0);async function k(e){S(!0);let t=null!=e?e:b,r="under16"===t,a="16-17"===t;try{let e=await s.api.saveProfile({consent:!0,gender:r||a?void 0:u||void 0,age_range:t||void 0,interests:r?void 0:y.length?y:void 0});w(e.credits_awarded),d(4)}catch(e){d(4)}finally{S(!1)}}let C=(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{style:{fontSize:20,marginBottom:8},children:"\uD83D\uDD12"}),(0,a.jsx)("div",{style:{fontWeight:700,fontSize:15,color:"#17181a",marginBottom:10},children:o?"Pubs personnalis\xe9es (optionnel)":"Personalised ads (optional)"}),(0,a.jsx)("p",{style:{fontSize:13,color:"#6060a0",lineHeight:1.6,marginBottom:8},children:o?"Tu as entre 16 et 17 ans. Tu peux choisir de partager tes centres d'int\xe9r\xeat pour voir des pubs plus adapt\xe9es. C'est enti\xe8rement facultatif et tu peux revenir en arri\xe8re \xe0 tout moment.":"You're 16â17. You can choose to share your interests to see more relevant ads. This is fully optional and can be withdrawn at any time."}),(0,a.jsx)("p",{style:{fontSize:11,color:"#9090b0",marginBottom:16},children:o?"Aucune donn\xe9e d'identit\xe9 (genre) ne sera collect\xe9e. Seuls tes centres d'int\xe9r\xeat seront utilis\xe9s pour la personnalisation.":"No identity data (gender) will be collected. Only your interests will be used for personalisation."}),(0,a.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[(0,a.jsx)("button",{onClick:()=>d(3),style:p,children:o?"Oui, partager mes int\xe9r\xeats":"Yes, share my interests"}),(0,a.jsx)("button",{onClick:()=>k("16-17"),disabled:j,style:m,children:o?"Non merci":"No thanks"})]})]},"minor-consent"),T=[(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{style:{fontWeight:800,fontSize:16,color:"#17181a",marginBottom:8},children:o?"Des pubs qui te correspondent":"Ads that match you"}),(0,a.jsx)("p",{style:{fontSize:13,color:"#6060a0",lineHeight:1.6,marginBottom:16},children:o?"R\xe9ponds \xe0 3 questions rapides pour voir des pubs adapt\xe9es \xe0 ton profil. En \xe9change, on te cr\xe9dite ".concat(50," cr\xe9dits. Tes r\xe9ponses ne sont jamais vendues \xe0 des tiers."):"Answer 3 quick questions to see ads relevant to you. In return, you get ".concat(50," credits. Your answers are never sold to third parties.")}),(0,a.jsxs)("p",{style:{fontSize:11,color:"#9090b0",marginBottom:20},children:[o?"En continuant, tu consens au traitement de ces donn\xe9es \xe0 des fins de personnalisation publicitaire, conform\xe9ment \xe0 notre ":"By continuing, you consent to processing this data for ad personalisation, per our ",(0,a.jsx)("a",{href:"/privacy",target:"_blank",style:{color:"var(--purple)",textDecoration:"underline"},children:o?"politique de confidentialit\xe9":"privacy policy"}),"."]}),(0,a.jsxs)("div",{style:{display:"flex",gap:8},children:[(0,a.jsx)("button",{onClick:i,style:m,children:o?"Pas maintenant":"Not now"}),(0,a.jsx)("button",{onClick:()=>d(1),style:p,children:o?"Commencer (+".concat(50," cr\xe9dits)"):"Start (+".concat(50," credits)")})]})]},"consent"),(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{style:{fontWeight:700,fontSize:15,color:"#17181a",marginBottom:14},children:o?"Tu t'identifies comme...":"You identify as..."}),(0,a.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:8,marginBottom:20},children:[{v:"man",fr:"Homme",en:"Man"},{v:"woman",fr:"Femme",en:"Woman"},{v:"nonbinary",fr:"Non-binaire",en:"Non-binary"},{v:"skip",fr:"Pr\xe9f\xe8re ne pas dire",en:"Prefer not to say"}].map(e=>(0,a.jsx)("button",{onClick:()=>{g("skip"===e.v?"":e.v),d(2)},style:f(u===e.v),children:o?e.fr:e.en},e.v))}),(0,a.jsx)(h,{step:1,total:3,fr:o,onSkip:()=>d(2)})]},"gender"),(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{style:{fontWeight:700,fontSize:15,color:"#17181a",marginBottom:14},children:o?"Ton groupe d'\xe2ge":"Your age group"}),(0,a.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:8,marginBottom:20},children:[{v:"under16",label:o?"Moins de 16 ans":"Under 16"},{v:"16-17",label:"16 â 17"},{v:"18-24",label:"18 â 24"},{v:"25-34",label:"25 â 34"},{v:"35-44",label:"35 â 44"},{v:"45+",label:"45+"},{v:"skip",label:o?"Pr\xe9f\xe8re ne pas dire":"Prefer not to say"}].map(e=>(0,a.jsx)("button",{onClick:()=>{"under16"===e.v?(x("under16"),k("under16")):"16-17"===e.v?(x("16-17"),d(2.5)):(x("skip"===e.v?"":e.v),d(3))},style:f(b===e.v),children:e.label},e.v))}),(0,a.jsx)(h,{step:2,total:3,fr:o,onSkip:()=>d(3)})]},"age"),(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{style:{fontWeight:700,fontSize:15,color:"#17181a",marginBottom:4},children:o?"Tes centres d'int\xe9r\xeat":"Your interests"}),(0,a.jsx)("p",{style:{fontSize:12,color:"#9090b0",marginBottom:14},children:o?"S\xe9lectionne autant que tu veux":"Select as many as you like"}),(0,a.jsx)("div",{style:{display:"flex",flexWrap:"wrap",gap:8,marginBottom:20},children:c.map(e=>(0,a.jsx)("button",{onClick:()=>{var t;return t=e.key,void v(e=>e.includes(t)?e.filter(e=>e!==t):[...e,t])},style:{padding:"6px 14px",borderRadius:20,fontSize:13,fontWeight:600,cursor:"pointer",border:y.includes(e.ke
1y)?"2px solid var(--purple)":"2px solid #e0e0ef",background:y.includes(e.key)?"rgba(145,71,255,0.08)":"#fafafa",color:y.includes(e.key)?"var(--purple)":"#555",transition:"all 0.15s"},children:o?e.fr:e.en},e.key))}),(0,a.jsxs)("div",{style:{display:"flex",gap:8},children:[(0,a.jsx)("button",{onClick:()=>k(),disabled:j,style:{...m},children:o?"Passer":"Skip"}),(0,a.jsx)("button",{onClick:()=>k(),disabled:j,style:p,children:j?"â¦":o?"Terminer (+".concat(50," cr\xe9dits)"):"Finish (+".concat(50," credits)")})]})]},"interests"),(0,a.jsxs)("div",{style:{textAlign:"center"},children:[(0,a.jsx)("div",{style:{fontSize:32,marginBottom:8},children:"\uD83C\uDF89"}),(0,a.jsx)("div",{style:{fontWeight:800,fontSize:16,color:"#17181a",marginBottom:6},children:o?"Merci !":"Thank you!"}),(0,a.jsxs)("div",{style:{background:"rgba(145,71,255,0.08)",border:"1.5px solid rgba(145,71,255,0.2)",borderRadius:10,padding:"10px 16px",marginBottom:14},children:[(0,a.jsxs)("span",{style:{fontWeight:800,fontSize:20,color:"var(--purple)"},children:["+",50]}),(0,a.jsx)("span",{style:{fontSize:13,color:"#6060a0",marginLeft:6},children:o?"cr\xe9dits r\xe9serv\xe9s pour le lancement":"credits reserved for launch"})]}),(0,a.jsx)("p",{style:{fontSize:13,color:"#6060a0",marginBottom:16},children:o?"Subi est en b\xeata. Tes cr\xe9dits te seront attribu\xe9s automatiquement au lancement officiel.":"Subi is in beta. Your credits will be awarded automatically at official launch."}),(0,a.jsx)("button",{onClick:()=>r(_),style:p,children:o?"Fermer":"Close"})]},"done")];return(0,a.jsxs)("div",{style:{position:"fixed",bottom:24,right:24,zIndex:9e3,width:320,background:"#fff",borderRadius:16,boxShadow:"0 8px 40px rgba(0,0,0,0.16), 0 2px 8px rgba(0,0,0,0.08)",border:"1px solid #ebebf5",animation:"surveySlideUp 0.3s cubic-bezier(0.34,1.56,0.64,1)"},children:[(0,a.jsx)("style",{children:"\n @keyframes surveySlideUp {\n from { transform: translateY(20px); opacity: 0; }\n to { transform: translateY(0); opacity: 1; }\n }\n "}),(0,a.jsx)("div",{style:{display:"flex",alignItems:"center",justifyContent:"flex-end",padding:"14px 16px 0"},children:l<4&&(0,a.jsx)("button",{onClick:i,style:{background:"none",border:"none",cursor:"pointer",color:"#aaa",fontSize:18,lineHeight:1,padding:0},children:"\xd7"})}),(0,a.jsx)("div",{style:{padding:"12px 16px 16px"},children:2.5===l?C:T[Math.floor(l)]})]})}function h(e){let{step:t,total:r,fr:n,onSkip:i}=e;return(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[(0,a.jsx)("div",{style:{display:"flex",gap:4},children:Array.from({length:r}).map((e,r)=>(0,a.jsx)("div",{style:{width:6,height:6,borderRadius:"50%",background:r<t?"var(--purple)":"#e0e0ef"}},r))}),(0,a.jsx)("button",{onClick:i,style:{background:"none",border:"none",cursor:"pointer",fontSize:12,color:"#9090b0"},children:n?"Passer â":"Skip â"})]})}let p={flex:1,padding:"10px 14px",borderRadius:10,border:"none",background:"var(--purple)",color:"#fff",fontWeight:700,fontSize:13,cursor:"pointer",textAlign:"center"},m={padding:"10px 14px",borderRadius:10,border:"1.5px solid #e0e0ef",background:"#fafafa",color:"#555",fontWeight:600,fontSize:13,cursor:"pointer",whiteSpace:"nowrap"},f=e=>({width:"100%",padding:"11px 14px",borderRadius:10,textAlign:"left",border:e?"2px solid var(--purple)":"2px solid #e0e0ef",background:e?"rgba(145,71,255,0.06)":"#fafafa",color:e?"var(--purple)":"#333",fontWeight:600,fontSize:14,cursor:"pointer",transition:"all 0.15s"}),g="https://api.subi.live",b={en:{loginTitle:"Connect your Twitch account",loginDesc:"Link your Twitch account to start earning credits and redeeming gifted subs.",loginBtn:"Connect with Twitch",tabViewer:"Viewer",tabStreamer:"Streamer",creditsLabel:"Your credits",progressLabel:"Progress to gifted sub",redeemTitle:"Redeem gifted sub",redeemDesc:"Use your credits to gift a Twitch sub to any channel",creditsUnit:"credits",channelLabel:"Twitch channel",channelPlaceholder:"e.g. xqc",processing:"Processingâ¦",redeemBtn:(e,t)=>"Redeem ".concat(e," (").concat(t," credits)"),needMore:(e,t)=>
1"You need ".concat(e," more credits for ").concat(t,"."),subsGifted:"Subs gifted",channelsSupported:"Channels supported",historyTitle:"Credit history",historyEmpty:"No events yet, install the extension and watch some streams!",historyHeaders:["Type","Credits","Ads viewed","Date"],streamerLoading:"Loading streamer dataâ¦",streamerConnectTitle:"Connect your streamer account",streamerConnectDesc:"Connect your approved streamer account to see your earnings and referral link.",streamerApply:"Not in the program yet?",streamerApplyLink:"Apply here first â",streamerConnectBtn:"Connect streamer account",totalEarnings:"Total earnings",available:"Available",referredUsers:"Referred users",referralLink:"Your referral link",copy:"Copy",obsOverlay:"OBS Overlay",obsHint:(e,t)=>"Add as a Browser Source in OBS, width ".concat(e,", height ").concat(t,", transparent background."),requestPayout:"Request payout",payoutAvail:e=>"Available: ".concat(e,", minimum â¬10.00."),payoutPending:"Payout pending",requestingPayout:"Requestingâ¦",withdrawBtn:e=>"Withdraw ".concat(e),payoutEmail:"Payout email (PayPal)",saving:"Savingâ¦",save:"Save",payoutHistory:"Payout history",payoutHeaders:["Amount","Status","Requested"],referredViewers:"Referred viewers",noReferrals:"No referred viewers yet. Share your referral link to start earning!",referralHeaders:["Viewer","Impressions","Joined"],referralTotalImps:(e,t)=>"".concat(e," total impressions across all viewers â ").concat(t," earned"),disconnectStreamer:"Disconnect streamer account"},fr:{loginTitle:"Connecte ton compte Twitch",loginDesc:"Lie ton compte Twitch pour gagner des cr\xe9dits et les \xe9changer contre des abos offerts.",loginBtn:"Connecter avec Twitch",tabViewer:"Viewer",tabStreamer:"Streamer",creditsLabel:"Tes cr\xe9dits",progressLabel:"Progression vers un abo offert",redeemTitle:"\xc9changer contre un abo offert",redeemDesc:"Utilise tes cr\xe9dits pour offrir un abo Twitch \xe0 n'importe quel channel",creditsUnit:"cr\xe9dits",channelLabel:"Channel Twitch",channelPlaceholder:"ex : xqc",processing:"Traitementâ¦",redeemBtn:(e,t)=>"\xc9changer ".concat(e," (").concat(t," cr\xe9dits)"),needMore:(e,t)=>
1"Il te manque ".concat(e," cr\xe9dits pour ").concat(t,"."),subsGifted:"Abos offerts",channelsSupported:"Channels soutenus",historyTitle:"Historique des cr\xe9dits",historyEmpty:"Aucun \xe9v\xe9nement pour l'instant, installe l'extension et regarde des streams !",historyHeaders:["Type","Cr\xe9dits","Pubs vues","Date"],streamerLoading:"Chargement des donn\xe9es streamerâ¦",streamerConnectTitle:"Connecte ton compte streamer",streamerConnectDesc:"Connecte ton compte streamer approuv\xe9 pour voir tes gains et ton lien de parrainage.",streamerApply:"Pas encore dans le programme ?",streamerApplyLink:"Candidater ici d'abord â",streamerConnectBtn:"Connecter le compte streamer",totalEarnings:"Gains totaux",available:"Disponible",referredUsers:"Viewers parrain\xe9s",referralLink:"Ton lien de parrainage",copy:"Copier",obsOverlay:"Overlay OBS",obsHint:(e,t)=>"Ajoute en tant que Source Navigateur dans OBS, largeur ".concat(e,", hauteur ").concat(t,", fond transparent."),requestPayout:"Demander un virement",payoutAvail:e=>"Disponible : ".concat(e,", minimum 10â¬."),payoutPending:"Virement en attente",requestingPayout:"Demandeâ¦",withdrawBtn:e=>"Retirer ".concat(e),payoutEmail:"Email de virement (PayPal)",saving:"Sauvegardeâ¦",save:"Sauvegarder",payoutHistory:"Historique des virements",payoutHeaders:["Montant","Statut","Demand\xe9"],referredViewers:"Viewers parrain\xe9s",noReferrals:"Aucun viewer parrain\xe9 pour l'instant. Partage ton lien de parrainage pour commencer \xe0 gagner !",referralHeaders:["Viewer","Impressions","Inscrit"],referralTotalImps:(e,t)=>"".concat(e," impressions cumul\xe9es sur tous tes viewers â ").concat(t," gagn\xe9s"),disconnectStreamer:"D\xe9connecter le compte streamer"}},x=[{subTier:"1000",label:"Tier 1",price:"â¬4.99",credits:1e3},{subTier:"2000",label:"Tier 2",price:"â¬7.99",credits:2e3},{subTier:"3000",label:"Tier 3",price:"â¬19.99",credits:5e3}];function y(){var e,t,o,c,h,p,m,f;
1let[y,j]=(0,n.useState)(null),[S,_]=(0,n.useState)([]),[w,k]=(0,n.useState)([]),[C,T]=(0,n.useState)(""),[N,B]=(0,n.useState)("1000"),[z,L]=(0,n.useState)(!1),[A,P]=(0,n.useState)(""),[W,R]=(0,n.useState)(!0),[D,q]=(0,n.useState)("viewer"),[I,O]=(0,n.useState)(null),[F]=(0,n.useState)(()=>{let e=new URLSearchParams(window.location.search).get("as");if(!e)return null;try{if(!JSON.parse(atob(e.split(".")[1])).impersonation)return null}catch(e){return null}return e}),[E]=(0,n.useState)(()=>window.location.hash),[H,V]=(0,n.useState)(""),[U,M]=(0,n.useState)(""),[J,G]=(0,n.useState)(null),[Y,Q]=(0,n.useState)([]),[Z,K]=(0,n.useState)([]),[X,$]=(0,n.useState)(""),[ee,et]=(0,n.useState)(!1),[er,ea]=(0,n.useState)(!1),[en,ei]=(0,n.useState)(""),[es,eo]=(0,n.useState)(""),[el,ed]=(0,n.useState)(!1),[ec,eu]=(0,n.useState)("en"),[eh,ep]=(0,n.useState)("fr"),[em,ef]=(0,n.useState)(null),[eg,eb]=(0,n.useState)(""),[ex,ey]=(0,n.useState)(!1),[ev,ej]=(0,n.useState)(!1),[eS,e_]=(0,n.useState)(!0),[ew,ek]=(0,n.useState)(!1),[eC,eT]=(0,n.use
1State)(!1),[eN,eB]=(0,n.useState)(!1),[ez,eL]=(0,n.useState)(!1),[eA,eP]=(0,n.useState)(!1);async function eW(e){ed(!0);try{var t,r,a,n;let[i,s,o]=await Promise.all([fetch("".concat(g,"/streamers/me"),{headers:{Authorization:"Bearer ".concat(e)}}),fetch("".concat(g,"/streamers/referrals"),{headers:{Authorization:"Bearer ".concat(e)}}),fetch("".concat(g,"/streamers/overlay-token"),{method:"POST",headers:{Authorization:"Bearer ".concat(e)}})]);if(!i.ok){localStorage.removeItem("subi_streamer_token"),V("");return}if(o.ok){let{token:e}=await o.json();M(e)}let l=await i.json();if(G(l.streamer),Q(null!==(r=l.payouts)&&void 0!==r?r:[]),$(null!==(a=null===(t=l.streamer)||void 0===t?void 0:t.payout_email)&&void 0!==a?a:""),s.ok){let e=await s.json();K(null!==(n=e.referrals)&&void 0!==n?n:[])}}catch(e){}finally{ed(!1)}}async function eR(){try{let e=await fetch("".concat(g,"/streamers/auth-url?login=1")),{url:t}=await e.json();window.location.href=t}catch(e){eo("Could not reach server.")}}async function eD(e){e.preventDefault(),et(!0),ei(""),eo("");try{await fetch("".concat(g,"/streamers/update-payout-email"),{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(H)},body:JSON.stringify({email:X})}),ei("Payout email saved.")}catch(e){eo("Failed to save email.")}finally{et(!1)}}async function eq(){ea(!0),eo(""),ei("");try{let t=await fetch("".concat(g,"/streamers/payout-request"),{method:"POST",headers:{Authorization:"Bearer ".concat(H)}}),r=await t.json();if(!t.ok){var e;eo(null!==(e=r.error)&&void 0!==e?e:"Failed.");return}ei("Payout request submitted! We will process it within a few business days."),eW(H)}catch(e){eo("Failed to submit payout request.")}finally{ea(!1)}}(0,n.useEffect)(()=>{let e=navigator.language.startsWith("fr")?"fr":"en";ep(e),eu(e)},[]),(0,n.useEffect)(()=>{if(F){if(O(F),window.history.replaceState({},"","/dashboard"+E),"#streamer"===E){R(!1);return}fetch("".concat(g,"/auth/me"),{headers:{Authorization:"Bearer ".concat(F)}}).then(e=>e.ok?e.json():null).then(e=>{(null==e?void 0:e.user)&&j(e.user)}).catch(()=>{}).finally(()=>R(!1));return}s.api.me().then(e=>{let{user:t}=e;j(t),R(!1),Promise.all([s.api.history().catch(()=>({events:[]})),s.api.redemptions().catch(()=>({redemptions:[]})),s.api.getConsents().catch(()=>({consent_analytics:!0}))]).then(e=>{let[{events:t},{redemptions:r},{consent_analytics:a}]=e;_(t),k(r),e_(a),ek(!0)}).catch(()=>{}),s.api.profileStatus().then(e=>{let{profile_completed:t}=e;t||setTimeout(()=>ej(!0),3e3)}).catch(()=>{})}).catch(()=>R(!1));let e=setInterval(()=>{s.api.me().then(e=>{let{user:t}=e;return j(t)}).catch(()=>{})},3e4);return()=>clearInterval(e)},[]),(0,n.useEffect)(()=>{if(E.startsWith("#streamer-error="))eo(decodeURIComponent(E.replace("#streamer-error=",""))||"Streamer login failed."),q("streamer"),window.history.replaceState({},"","/dashboard");else if("#streamer"===E){if(q("streamer"),window.history.replaceState({},"","/dashboard"),F){O(F),V(F),eW(F);return}let e=localStorage.getItem("subi_streamer_token");e&&(V(e),eW(e));return}let e=localStorage.getItem("subi_streamer_token");e&&(V(e),eW(e))},[]);let eI=n.useRef(null);async function eO(){if(C.trim()){L(!0),P(""),ey(!1);try{await s.api.redeem(C.trim(),N);let e=x.find(e=>e.subTier===N);P("".concat(null==e?void 0:e.label," sub gifted to ").concat(C,"!"));let{user:t}=await s.api.me();j(t);let{redemptions:r}=await s.api.redemptions();k(r),T(""),ef(null)}catch(e){P("Error: ".concat(e.message))}finally{L(!1)}}}async function eF(e){eT(!0);try{await s.api.updateConsents(e),e_(e)}catch(e){}finally{eT(!1)}}async function eE(){eP(!0);try{let e=await s.api.downloadMyData(),t=new Blob([JSON.stringify(e,null,2)],{type:"application/json"}),r=URL.createObjectURL(t),a=document.createElement("a");a.href=r,a.download="subi-my-data.json",document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL(r)}catch(e){console.error("Download failed:",e),alert("fr"===eh?"Erreur lors du t\xe9l\xe9chargement. Reconnecte-toi et r\xe9essaie.":"Download failed. Please log in again and retry.")}finally{eP(!1)}}async function eH(){eB(!0);try{await s.api.deleteAccount(),localStorage.removeItem("subi_token"),window.location.href="/"}catch(e){P("Delete failed: ".concat(e.message)),eB(!1),eL(!1)}}async function eV(){let e=localStorage.getItem("subi_ref")||void 0,{url:t}=await s.api.getTwitchUrl(e);window.location.href=t}if(W)return(0,a.jsx)("div",{className:l().loading,children:"Loadingâ¦"});let eU=J?(null!==(e=J.earnings_cents)&&void 0!==e?e:0)-(null!==(t=J.paid_out_cents)&&void 0!==t?t:0):0,eM=b[eh];return(0,a.jsxs)("div",{className:l().shell,children:[I&&(0,a.jsxs)("div",{style:{background:"#f59e0b",color:"#000",padding:"8px 16px",fontSize:13,fontWeight:700,textAlign:"center"},children:["\uD83D\uDC41 Admin view â read-only preview of this ","streamer"===D?"streamer":"user","'s dashboard"]}),(0,a.jsx)(d.default,{}),y||I&&"streamer"===D?(0,a.jsxs)("div",{className:l().content,children:[(0,a.jsxs)("div",{className:l().tabs,children:[(0,a.jsx)("button",{className:"viewer"===D?l().tabActive:l().tab,onClick:()=>q("viewer"),children:eM.tabViewer}),(0,a.jsxs)("button",{className:"streamer"===D?l().tabActive:l().tab,onClick:()=>q("streamer"),children:[eM.tabStreamer,J&&(0,a.jsx)("span",{className:l().tabBadge,children:J.twitch_username})]})]}),"viewer"===D&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:l().grid,children:[(0,a.jsxs)("div",{className:l().creditsCard,children:[(0,a.jsx)("div",{className:l().creditsLabel,children:eM.creditsLabel}),(0,a.jsx)("div",{className:l().creditsValue,children:y.credits.toLocaleStr
1ing()}),(0,a.jsxs)("div",{className:l().progressWrap,children:[(0,a.jsxs)("div",{className:l().progressTop,children:[(0,a.jsx)("span",{children:eM.progressLabel}),(0,a.jsxs)("span",{children:[y.credits.toLocaleString()," / ",x.find(e=>e.subTier===N).credits.toLocaleString()]})]}),(0,a.jsx)("div",{className:l().track,children:(0,a.jsx)("div",{className:l().fill,style:{width:"".concat(Math.min(y.credits/x.find(e=>e.subTier===N).credits*100,100),"%")}})})]})]}),(0,a.jsxs)("div",{className:"card",style:{display:"flex",flexDirection:"column",gap:14},children:[(0,a.jsx)("h2",{style:{fontSize:18,fontWeight:700,color:"#17181a"},children:eM.redeemTitle}),(0,a.jsx)("p",{className:"hint",children:eM.redeemDesc}),(0,a.jsx)("div",{style:{display:"flex",gap:8},children:x.map(e=>{let t=y.credits>=e.credits,r=N===e.subTier;return(0,a.jsxs)("button",{onClick:()=>t&&B(e.subTier),disabled:!t,style:{flex:1,padding:"10px 8px",borderRadius:10,border:r?"2px solid var(--purple)":"2px solid #e0e0ef",background:r?"rgba(100,60,255,0.07)":"#fafafa",cursor:t?"pointer":"not-allowed",opacity:t?1:.45,textAlign:"center"},children:[(0,a.jsx)("div",{style:{fontWeight:700,fontSize:14,color:"#17181a"},children:e.label}),(0,a.jsxs)("div",{style:{fontSize:13,fontWeight:600,color:r?"var(--purple)":"#5050a0",marginTop:4},children:[e.credits.toLocaleString()," ",eM.creditsUnit]})]},e.subTier)})}),(0,a.jsxs)("div",{className:"field",children:[(0,a.jsx)("label",{className:"label",children:eM.channelLabel}),(0,a.jsx)("input",{className:"input",placeholder:eM.channelPlaceholder,value:C,onChange:e=>{var t;T(t=e.target.value),ef(null),eb(""),eI.current&&clearTimeout(eI.current),t.trim()&&(eI.current=setTimeout(()=>{s.api.twitchChannel(t.trim()).then(e=>ef(e)).catch(()=>eb("Channel not found"))},600))}})]}),em&&(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"10px 14px",background:"rgba(145,71,255,0.06)",border:"1.5px solid rgba(145,71,255,0.18)",borderRadius:10},children:[(0,a.jsx)("img",{src:em.profile_image_url,alt:"",style:{width:36,height:36,borderRadius:"50%",objectFit:"cover",flexShrink:0}}),(0,a.jsx)("span",{style:{fontWeight:700,fontSize:14,color:"#17181a"},children:em.display_name}),(0,a.jsxs)("span",{style:{fontSize:12,color:"#8080a0"},children:["twitch.tv/",em.login]})]}),eg&&C.trim()&&(0,a.jsx)("p",{style:{fontSize:12,color:"#c01010",margin:0},children:eg}),(()=>{let e=x.find(e=>e.subTier===N),t=y.credits>=e.credits;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("button",{className:"btn btn-primary",disabled:!t||z||!C.trim(),onClick:()=>ey(!0),children:z?eM.processing:eM.redeemBtn(e.label,e.credits.toLocaleString())}),!t&&(0,a.jsx)("p",{className:"hint",children:eM.needMore((e.credits-y.credits).toLocaleString(),e.label)})]})})(),A&&(0,a.jsx)("p",{style:{fontSize:13,color:A.startsWith("Error")?"#c01010":"#00a854"},children:A}),ex&&(0,a.jsx)("div",{style:{position:"fixed",inset:0,zIndex:9999,background:"rgba(0,0,0,0.55)",display:"flex",alignItems:"center",justifyContent:"center"},children:(0,a.jsxs)("div",{style:{background:"#fff",borderRadius:16,padding:"28px 28px 24px",maxWidth:340,width:"90%",boxShadow:"0 8px 40px rgba(0,0,0,0.18)"},children:[(0,a.jsx)("div",{style:{fontWeight:800,fontSize:17,color:"#17181a",marginBottom:14},children:"fr"===eh?"Confirmer l'\xe9change":"Confirm redemption"}),em&&(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:14},children:[(0,a.jsx)("img",{src:em.profile_image_url,alt:"",style:{width:44,height:44,borderRadius:"50%",objectFit:"cover"}}),(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{style:{fontWeight:700,fontSize:15,color:"#17181a"},children:em.display_name}),(0,a.jsxs)("div",{style:{fontSize:12,color:"#8080a0"},children:["twitch.tv/",em.login]})]})]}),!em&&(0,a.jsx)("p",{style:{fontSize:14,color:"#555",marginBottom:14},children:C}),(0,a.jsx)("p",{style:{fontSize:13,color:"#555",marginBottom:20},children:"fr"===eh?"Tu vas \xe9changer ".concat(x.find(e=>e.subTier===N).credits.toLocaleString()," cr\xe9dits pour un ").concat(x.find(e=>e.subTier===N).label," gift sur cette cha\xeene. Es-tu s\xfbr ?"):"You're spending ".concat(x.find(e=>
1e.subTier===N).credits.toLocaleString()," credits for a gifted ").concat(x.find(e=>e.subTier===N).label," on this channel. Are you sure?")}),(0,a.jsxs)("div",{style:{display:"flex",gap:10},children:[(0,a.jsx)("button",{onClick:()=>ey(!1),style:{flex:1,padding:"10px",borderRadius:8,border:"1.5px solid #e0e0ef",background:"#fafafa",fontWeight:600,fontSize:14,cursor:"pointer",color:"#555"},children:"fr"===eh?"Annuler":"Cancel"}),(0,a.jsx)("button",{onClick:eO,disabled:z,className:"btn btn-primary",style:{flex:1},children:z?eM.processing:"fr"===eh?"Confirmer":"Confirm"})]})]})})]})]}),(0,a.jsxs)("div",{className:l().statsRow,children:[(0,a.jsxs)("div",{className:"stat-card",children:[(0,a.jsx)("div",{className:"stat-value",children:w.length}),(0,a.jsx)("div",{className:"stat-label",children:eM.subsGifted})]}),(0,a.jsxs)("div",{className:"stat-card",children:[(0,a.jsx)("div",{className:"stat-value",children:w.length>0?new Set(w.map(e=>e.twitch_channel)).size:0}),(0,a.jsx)("div",{className:"stat-label",children:eM.channelsSupported})]})]}),(0,a.jsxs)("div",{className:"card",style:{marginTop:16},children:[(0,a.jsx)("h2",{style:{fontSize:16,fontWeight:700,marginBottom:4,color:"#17181a"},children:"fr"===eh?"Confidentialit\xe9 & donn\xe9es":"Privacy & data"}),(0,a.jsx)("p",{className:"hint",style:{marginBottom:16},children:"fr"===eh?"Subi collecte les informations suivantes pour faire fonctionner le service.":"Subi collects the following information to operate the service."}),(0,a.jsxs)("div",{style:{marginBottom:12},children:[(0,a.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",padding:"12px 0",borderTop:"1px solid #f0f0f8"},children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{style:{fontWeight:600,fontSize:14,color:"#17181a"},children:"fr"===eh?"Profil Twitch":"Twitch profile"}),(0,a.jsx)("div",{style:{fontSize:12,color:"#8080a0",marginTop:2},children:"fr"===eh?"Nom d'utilisateur & avatar â requis pour le service":"Username & avatar â required for the service"})]}),(0,a.jsx)("span",{style:{fontSize:12,fontWeight:600,color:"#8080a0",background:"#f0f0f8",padding:"3px 10px",borderRadius:20,flexShrink:0,marginLeft:12},children:"fr"===eh?"Requis":"Required"})]}),(0,a.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",padding:"12px 0",borderTop:"1px solid #f0f0f8"},children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{style:{fontWeight:600,fontSize:14,color:"#17181a"},children:"fr"===eh?"Cr\xe9dits & r\xe9compenses":"Credits & rewards"}),(0,a.jsx)("div",{style:{fontSize:12,color:"#8080a0",marginTop:2},children:"fr"===eh?"Solde et historique des cr\xe9dits â requis pour les \xe9changes":"Balance and credit history â required for redemptions"})]}),(0,a.jsx)("span",{style:{fontSize:12,fontWeight:600,color:"#8080a0",background:"#f0f0f8",padding:"3px 10px",borderRadius:20,flexShrink:0,marginLeft:12},children:"fr"===eh?"Requis":"Required"})]}),(0,a.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",padding:"12px 0",borderTop:"1px solid #f0f0f8"},children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{style:{fontWeight:600,fontSize:14,color:"#17181a"},children:"fr"===eh?"Donn\xe9es de visionnage":"Viewing data"}),(0,a.jsx)("div",{style:{fontSize:12,color:"#8080a0",marginTop:2},children:"fr"===eh?"Canaux regard\xe9s, annonces vues, ciblage publicitaire":"Channels watched, ads seen, ad targeting"})]}),(0,a.jsx)("button",{onClick:()=>eF(!eS),disabled:eC,style:{flexShrink:0,marginLeft:12,width:44,height:24,borderRadius:12,border:"none",cursor:"pointer",background:eS?"var(--purple)":"#ccc",position:"relative",transition:"background 0.2s"},"aria-label":eS?"Disable":"Enable",children:(0,a.jsx)("span",{style:{position:"absolute",top:3,left:eS?23:3,width:18,height:18,borderRadius:"50%",background:"#fff",transition:"left 0.2s",boxShadow:"0 1px 3px rgba(0,0,0,0.2)"}})})]})]}),(0,a.jsxs)("div",{style:{borderTop:"1px solid #f0f0f8",paddingTop:16,marginTop:4},children:[(0,a.jsx)("div",{style:{fontWeight:600,fontSize:14,color:"#17181a",marginBottom:4},children:"fr"===eh?"T\xe9l\xe9charger mes donn\xe9es":"Download my data"}),(0,a.jsx)("p",{style:{fontSize:12,color:"#8080a0",marginBottom:12},children:"fr"===eh?"Exporte toutes tes donn\xe9es personnelles au format JSON.":"Export all your personal data as a JSON file."}),(0,a.jsx)("button",{onClick:eE,disabled:eA,style:{padding:"8px 16px",borderRadius:8,border:"1.5px solid #9147ff",background:"transparent",color:"#9147ff",fontWeight:600,fontSize:13,cursor:"pointer"},children:eA?"fr"===eh?"Pr\xe9parationâ¦":"Preparingâ¦":"fr"===eh?"⬠T\xe9l\xe9charger mes donn\xe9es":"⬠Download my data"})]}
1),(0,a.jsxs)("div",{style:{borderTop:"1px solid #f0f0f8",paddingTop:16,marginTop:4},children:[(0,a.jsx)("div",{style:{fontWeight:600,fontSize:14,color:"#17181a",marginBottom:4},children:"fr"===eh?"Se d\xe9connecter":"Log out"}),(0,a.jsx)("p",{style:{fontSize:12,color:"#8080a0",marginBottom:12},children:"fr"===eh?"D\xe9connecte-toi de ce navigateur.":"Sign out of this browser."}),(0,a.jsx)("button",{onClick:()=>{Promise.resolve().then(r.bind(r,1837)).then(e=>{let{clearToken:t}=e;t(),window.location.reload()})},style:{padding:"8px 16px",borderRadius:8,border:"1.5px solid #8080a0",background:"transparent",color:"#8080a0",fontWeight:600,fontSize:13,cursor:"pointer"},children:"fr"===eh?"Se d\xe9connecter":"Log out"})]}),(0,a.jsxs)("div",{style:{borderTop:"1px solid #f0f0f8",paddingTop:16,marginTop:4},children:[(0,a.jsx)("div",{style:{fontWeight:600,fontSize:14,color:"#c01010",marginBottom:4},children:"fr"===eh?"Supprimer mon compte":"Delete my account"}),(0,a.jsx)("p",{style:{fontSize:12,color:"#8080a0",marginBottom:12},children:"fr"===eh?"Supprime d\xe9finitivement toutes tes donn\xe9es. Tu recevras un email de confirmation avec le r\xe9sum\xe9 des donn\xe9es supprim\xe9es.":"Permanently deletes all your data. You'll receive a confirmation email with a summary of deleted data."}),ez?(0,a.jsxs)("div",{style:{background:"#fff5f5",border:"1.5px solid #fca5a5",borderRadius:10,padding:"14px 16px"},children:[(0,a.jsx)("p",{style:{fontSize:13,fontWeight:600,color:"#c01010",marginBottom:12},children:"fr"===eh?"Es-tu s\xfbr ? Cette action est irr\xe9versible.":"Are you sure? This cannot be undone."}),(0,a.jsxs)("div",{style:{display:"flex",gap:8},children:[(0,a.jsx)("button",{onClick:()=>eL(!1),style:{flex:1,padding:"8px",borderRadius:8,border:"1.5px solid #e0e0ef",background:"#fff",fontWeight:600,fontSize:13,cursor:"pointer",color:"#555"},children:"fr"===eh?"Annuler":"Cancel"}),(0,a.jsx)("button",{onClick:eH,disabled:eN,style:{flex:1,padding:"8px",borderRadius:8,border:"none",background:"#c01010",color:"#fff",fontWeight:700,fontSize:13,cursor:"pointer"},children:eN?"â¦":"fr"===eh?"Oui, supprimer":"Yes, delete"})]})]}):(0,a.jsx)("button",{onClick:()=>eL(!0),style:{padding:"8px 16px",borderRadius:8,border:"1.5px solid #c01010",background:"transparent",color:"#c01010",fontWeight:600,fontSize:13,cursor:"pointer"},children:"fr"===eh?"Supprimer mon compte":"Delete my account"})]})]}),(0,a.jsxs)("div",{className:"card",style:{marginTop:16},children:[(0,a.jsx)("h2",{style:{fontSize:16,fontWeight:700,marginBottom:16,color:"#17181a"},children:eM.historyTitle}),0===S.length?(0,a.jsx)("p",{className:"hint",children:eM.historyEmpty}):(0,a.jsxs)("table",{className:l().table,children:[(0,a.jsx)("thead",{children:(0,a.jsx)("tr",{children:eM.historyHeaders.map(e=>(0,a.jsx)("th",{children:e},e))})}),(0,a.jsx)("tbody",{children:S.map((e,t)=>{var r;return(0,a.jsxs)("tr",{children:[(0,a.jsx)("td",{children:(0,a.jsx)("span",{className:"badge ".concat("impression"===e.type?"badge-active":"badge-pending"),children:e.type})}),(0,a.jsxs)("td",{style:{fontWeight:700,color:e.amount>0?"#00a854":"#c01010"},children:[e.amount>0?"+":"",e.amount]}),(0,a.jsx)("td",{style:{color:"#8080a0",fontSize:12},children:"impression"===e.type&&e.impression_names?"".concat(e.impression_names.length," impressions \xb7 ").concat(e.impression_names.join(", ")):null!==(r=e.campaign_name)&&void 0!==r?r:" "}),(0,a.jsx)("td",{style:{color:"#9090a8",fontSize:12},children:new Date(e.created_at).toLocaleString()})]},t)})})]})]})]}),"streamer"===D&&(0,a.jsxs)(a.Fragment,{children:[es&&(0,a.jsx)("div",{className:l().alertError,children:es}),en&&(0,a.jsx)("div",{className:l().alertSuccess,children:en}),el&&(0,a.jsx)("div",{style:{color:"#8080a0",padding:"40px 0",textAlign:"center"},children:eM.streamerLoading}),!el&&!J&&(0,a.jsxs)("div",{className:"card",style:{textAlign:"center",padding:"48px 32px"},children:[(0,a.jsx)("div",{style:{fontSize:18,fontWeight:800,marginBottom:10,color:"#17181a"},children:eM.streamerConnectTitle}),(0,a.jsxs)("p",{className:"hint",style:{marginBottom:24},children:[eM.streamerConnectDesc,(0,a.jsx)("br",{}),eM.streamerApply," ",(0,a.jsx)(i.default,{href:"/streamer",style:{color:"var(--purple)"},children:eM.streamerApplyLink})]}),(0,a.jsxs)("button",{onClick:eR,className:l().twitchBtn,children:[(0,a.jsx)(v,{})," ",eM.streamerConnectBtn]})]}),!el&&J&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:l().streamerStats,children:[{label:eM.totalEarnings,value:"â¬".concat(((null!==(o=J.earnings_cents)&&void 0!==o?o:0)/100).toFixed(2)),accent:!0},{label:eM.available,value:"â¬".concat((eU/100).toFixed(2)),accent:eU>=1e3},{label:eM.referredUsers,value:(null!==(c=J.referred_users)&&void 0!==c?c:0).toString()}].map(e=>{let{label:t,value:r,accent:n}=e;return(0,a.jsxs)("div",{className:l().streamerStatCard,children:[(0,a.jsx)("div",{className:l().streamerStatValue,style:{color:n?"var(--purple)":"#17181a"},children:r}),(0,a.jsx)("div",{className:l().streamerStatLabel,children:t})]},t)})}),(0,a.jsxs)("div",{className:"card",style:{marginBottom:16},children:[(0,a.jsx)("h2",{style:{fontSize:16,fontWeight:700,marginBottom:14,color:"#17181a"},children:eM.referralLink}),(0,a.jsxs)("div",{className:l().refRow,children:[(0,a.jsxs)("code",{className:l().refCode,children:["https://subi.live/",J.twitch_username.toLowerCase()]}),(0,a.jsx)("button",{onClick:()=>navigator.clipboard.writeText("https://subi.live/".concat(J.twitch_username.toLowerCase())),className:l().copyBtn,children:eM.copy})]})]}),(0,a.jsxs)("div",{className:"card",style:{marginBottom:16},children:[(0,a.jsx)("h2",{style:{fontSize:16,fontWeight:700,marginBottom:10,color:"#17181a"},children:eM.obsOverlay}),(0,a.jsx)("div",{style:{display:"flex",gap:8,marginBottom:14},children:["en","fr"].map(e=>(0,a.jsx)("button",{onClick:()=>eu(e),style:{padding:"4px 14px",borderRadius:6,border:"1.5px solid",borderColor:ec===e?"var(--purple)":"#ddd",background:ec===e?"var(--purple)":"transparent",color:ec===e?"#fff":"#555",fontWeight:600,fontSize:12,cursor:"pointer",textTransform:"uppercase",letterSpacing:"0.5px"},children:"en"===e?"English":"Fran\xe7ais"},e))}),(0,a.jsx)("div",{style:{borderRadius:10,padding:"20px 16px",marginBottom:14,overflow:"hidden",display:"flex",alignItems:"center",minHeight:120},children:(0,a.jsx)("iframe",{src:"/overlay?token=".concat(U,"&lang=").concat(ec),width:600,height:80,scrolling:"no",style:{border:"none",background:"transparent",display:"block",maxWidth:"100%",transformOrigin:"center center"}},"".concat(U,"-").concat(ec))}),(0,a.jsx)("p",{className:"hint",style:{marginBottom:12},children:eM.obsHint(600,80)}),(0,a.jsxs)("div",{className:l().refRow,children:[(0,a.jsx)("code",{className:l().refCode,style:{fontSize:11,wordBreak:"break-all"},children:"https://subi.live/overlay?token=".concat(U,"&lang=").concat(ec)}),(0,a.jsx)("button",{onClick:()=>navigator.clipboard.writeText("https://subi.live/overlay?token=".concat(U,"&lang=").concat(ec)),className:l().copyBtn,children:eM.copy})]})]}),(0,a.jsxs)("div",{className:"card",style:{marginBottom:16},children:[(0,a.jsx)("h2",{style:{fontSize:16,fontWeight:700,marginBottom:10,color:"#17181a"},children:eM.requestPayout}),(0,a.jsxs)("p",{className:"hint",children:[eM.payoutAvail("â¬".concat((eU/100).toFixed(2))),(null!==(h=J.pending_payouts)&&void 0!==h?h:0)>0&&(0,a.jsx)("span",{className:l().pendingBadge,children:eM.payoutPending})]}),(0,a.jsx)("button",{onClick:eq,disabled:er||eU<1e3||(null!==(p=J.pending_payouts)&&void 0!==p?p:0)>
10,className:l().twitchBtn,style:{marginTop:14,opacity:eU<1e3||(null!==(m=J.pending_payouts)&&void 0!==m?m:0)>0?.45:1,cursor:eU<1e3||(null!==(f=J.pending_payouts)&&void 0!==f?f:0)>0?"not-allowed":"pointer"},children:er?eM.requestingPayout:eM.withdrawBtn("â¬".concat((eU/100).toFixed(2)))})]}),(0,a.jsxs)("div",{className:"card",style:{marginBottom:16},children:[(0,a.jsx)("h2",{style:{fontSize:16,fontWeight:700,marginBottom:12,color:"#17181a"},children:eM.payoutEmail}),(0,a.jsxs)("form",{onSubmit:eD,className:l().emailForm,children:[(0,a.jsx)("input",{type:"email",value:X,onChange:e=>$(e.target.value),placeholder:"[email protected]",className:"input",style:{flex:1}}),(0,a.jsx)("button",{type:"submit",disabled:ee,className:l().twitchBtn,children:ee?eM.saving:eM.save})]})]}),Y.length>0&&(0,a.jsxs)("div",{className:"card",style:{marginBottom:16},children:[(0,a.jsx)("h2",{style:{fontSize:16,fontWeight:700,marginBottom:14,color:"#17181a"},children:eM.payoutHistory}),(0,a.jsxs)("table",{className:l().table,children:[(0,a.jsx)("thead",{children:(0,a.jsx)("tr",{children:eM.payoutHeaders.map(e=>(0,a.jsx)("th",{children:e},e))})}),(0,a.jsx)("tbody",{children:Y.map(e=>(0,a.jsxs)("tr",{children:[(0,a.jsxs)("td",{style:{fontWeight:700,color:"var(--purple)"},children:["â¬",(e.amount_cents/100).toFixed(2)]}),(0,a.jsx)("td",{children:(0,a.jsx)("span",{className:"badge ".concat("paid"===e.status?"badge-active":"rejected"===e.status?"badge-expired":"badge-pending"),children:e.status})}),(0,a.jsx)("td",{style:{color:"#8080a0",fontSize:12},children:new Date(e.requested_at).toLocaleDateString()})]},e.id))})]})]}),(0,a.jsxs)("div",{className:"card",style:{marginBottom:16},children:[(0,a.jsxs)("h2",{style:{fontSize:16,fontWeight:700,marginBottom:14,color:"#17181a"},children:[eM.referredViewers,(0,a.jsx)("span",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:22,height:22,padding:"0 7px",marginLeft:10,background:"rgba(145,71,255,0.1)",color:"#9147ff",fontSize:11,fontWeight:700,borderRadius:999,verticalAlign:"middle"},children:Z.length})]}),0===Z.length?(0,a.jsx)("p",{className:"hint",children:eM.noReferrals}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{style:{background:"rgba(145,71,255,0.07)",border:"1.5px solid rgba(145,71,255,0.18)",borderRadius:8,padding:"10px 14px",marginBottom:14,fontSize:13,color:"#17181a"},children:eM.referralTotalImps(Z.reduce((e,t)=>e+t.impression_count,0).toLocaleString(),"â¬".concat((J.earnings_cents/100).toFixed(2)))}),(0,a.jsxs)("table",{className:l().table,children:[(0,a.jsx)("thead",{children:(0,a.jsx)("tr",{children:eM.referralHeaders.map((e,t)=>(0,a.jsx)("th",{style:t>0?{textAlign:"right"}:{},children:e},e))})}),(0,a.jsx)("tbody",{children:Z.map(e=>(0,a.jsxs)("tr",{children:[(0,a.jsx)("td",{children:(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8},children:[e.twitch_avatar?(0,a.jsx)("img",{src:e.twitch_avatar,alt:"",style:{width:24,height:24,borderRadius:"50%",objectFit:"cover",flexShrink:0}}):(0,a.jsx)("div",{style:{width:24,height:24,borderRadius:"50%",background:"rgba(145,71,255,0.15)",color:"#9147ff",fontSize:11,fontWeight:700,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:e.twitch_username[0].toUpperCase()}),(0,a.jsx)("span",{style:{fontSize:13,fontWeight:600,color:"#17181a"},children:e.twitch_username})]})}),(0,a.jsx)("td",{style:{textAlign:"right"},children:(0,a.jsx)("span",{style:{display:"inline-block",background:"rgba(145,71,255,0.08)",color:"#6b21a8",fontSize:12,fontWeight:700,padding:"2px 8px",borderRadius:6},children:e.impression_count.toLocaleString()})}),(0,a.jsx)("td",{style:{textAlign:"right",color:"#9090a8",fontSize:12},children:new Date(e.referred_at).toLocaleDateString()})]},e.twitch_username))})]})]})]}),(0,a.jsx)("button",{onClick:function(){localStorage.removeItem("subi_streamer_token"),V(""),G(null),Q([]),q("viewer")},className:l().logoutStreamer,children:eM.disconnectStreamer})]})]})]}):(0,a.jsx)("div",{className:l().loginWrap,children:(0,a.jsxs)("div",{className:l().loginCard,children:[(0,a.jsx)("img",{src:"/logo-full.png",alt:"Subi",className:l().loginLogo}),(0,a.jsx)("h1",{children:eM.loginTitle}),(0,a.jsx)("p",{children:eM.loginDesc}),(0,a.jsx)("button",{className:"btn btn-primary",style:{width:"100%",marginTop:20},onClick:eV,children:eM.loginBtn})]})}),ev&&y&&(0,a.jsx)(u,{lang:eh,onDismiss:()=>ej(!1),onDone:e=>{ej(!1),e>0&&j(t=>t?{...t,credits:t.credits+e}:t)}})]})}function v(){return(0,a.jsx)("svg",{width:"17",height:"17",viewBox:"0 0 24 24",fill:"
1currentColor",style:{flexShrink:0},children:(0,a.jsx)("path",{d:"M11.571 4.714h1.715v5.143H11.57zm4.715 0H18v5.143h-1.714zM6 0L1.714 4.286v15.428h5.143V24l4.286-4.286h3.428L22.286 12V0zm14.571 11.143l-3.428 3.428h-3.429l-3 3v-3H6.857V1.714h13.714z"})})}},7666:function(e,t,r){"use strict";r.d(t,{default:function(){return d}});var a=r(7437),n=r(7648),i=r(2265),s=r(8757),o=r.n(s);let l={en:{viewers:"For viewers",streamers:"Streamers",advertise:"Advertise",bidMarket:"Bid market",feedback:"Feedback",myCredits:"My credits"},fr:{viewers:"Pour les viewers",streamers:"Streamers",advertise:"Annonceurs",bidMarket:"Ench\xe8res",feedback:"Retour",myCredits:"Mes cr\xe9dits"}};function d(){let[e,t]=(0,i.useState)("fr");(0,i.useEffect)(()=>{t(navigator.language.startsWith("fr")?"fr":"en")},[]);let r=l[e];return(0,a.jsxs)("nav",{className:o().nav,children:[(0,a.jsx)(n.default,{href:"/",className:o().navBrand,children:(0,a.jsx)("img",{src:"/logo-full.png",alt:"Subi",className:o().navLogo})}),(0,a.jsxs)("div",{className:o().navLinks,children:[(0,a.jsx)(n.default,{href:"/#viewers",className:o().navLink,children:r.viewers}),(0,a.jsx)(n.default,{href:"/#streamers",className:o().navLink,children:r.streamers}),(0,a.jsx)(n.default,{href:"/#bid-form",className:o().navLink,children:r.advertise}),(0,a.jsx)(n.default,{href:"/#bids",className:o().navLink,children:r.bidMarket}),(0,a.jsx)(n.default,{href:"/feedback",className:o().navLink,children:r.feedback})]}),(0,a.jsxs)("div",{className:o().navActions,children:[(0,a.jsx)(n.default,{href:"/dashboard",className:o().navBtnCredits,children:r.myCredits}),(0,a.jsx)(n.default,{href:"/advertiser",className:o().navBtnAdvert,children:r.advertise})]})]})}},1837:function(e,t,r){"use strict";function a(){return localStorage.getItem("subi_token")}function n(e){localStorage.setItem("subi_token",e)}function i(){localStorage.removeItem("subi_token")}function s(){return localStorage.getItem("subi_adv_token")}function o(e){localStorage.setItem("subi_adv_token",e)}function l(){localStorage.removeItem("subi_adv_token")}async function d(e,t){var r,a;let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=await fetch("".concat("https://api.subi.live").concat(e),{...n,headers:{...n.body instanceof FormData?{}:{"Content-Type":"application/json"},...t?{Authorization:"Bearer ".concat(t)}:{},...null!==(r=n.headers)&&void 0!==r?r:{}}});if(!i.ok)throw Error(null!==(a=(await i.json().catch(()=>({error:i.statusText}))).error)&&void 0!==a?a:"Request failed");if(204!==i.status)return i.json()}function c(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return d(e,a(),t)}function u(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return d(e,s(),t)}r.r(t),r.d(t,{api:function(){return h},clearAdvToken:function(){return l},clearToken:function(){return i},getAdvToken:function(){return s},getToken:function(){return a},setAdvToken:function(){return o},setToken:function(){return n}});let h={getTwitchUrl:e=>c(e?"/auth/twitch/url?ref=".concat(encodeURIComponent(e)):"/auth/twitch/url"),twitchCallback:(e,t)=>c("/auth/twitch/callback",{method:"POST",body:JSON.stringify({code:e,...t?{ref:t}:{}})}),me:()=>c("/auth/me"),advertiserLogin:async(e,t)=>{let r=await d("/auth/advertiser",null,{method:"POST",body:JSON.stringify({email:e,password:t})});return o(r.token),r},advertiserRegister:async(e,t,r)=>{let a=await d("/auth/advertiser/register",null,{method:"POST",body:JSON.stringify({email:e,name:t,password:r})});return o(a.token),a},balance:()=>c("/credits/balance"),history:()=>c("/credits/history"),redeem:(e,t)=>c("/redeem",{method:"POST",body:JSON.stringify({twitchChannel:e,subTier:t})}),redemptions:()=>c("/redeem"),campaigns:()=>u("/campaigns"),createCampaign:e=>u("/campaigns",{method:"POST",body:e}),campaignStats:e=>u("/campaigns/".concat(e,"/stats")),updateCampaign:(e,t)=>u("/campaigns/".concat(e),{method:"PATCH",body:JSON.stringify(t)}),checkoutUrl:e=>u("/stripe/checkout/".concat(e),{method:"POST"}),profileStatus:()=>c("/auth/profile-status"),saveProfile:e=>c("/auth/profile",{method:"POST",body:JSON.stringify(e)}),twitchChannel:e=>d("/auth/twitch/channel?login=".concat(encodeURIComponent(e)),null),getConsents:()=>c("/auth/consents"),updateConsents:e=>c("/auth/consents",{method:"PATCH",body:JSON.stringify({consent_analytics:e})}),deleteAccount:()=>c("/auth/me",{method:"DELETE"}),downloadMyData:()=>d("/auth/my-data",a()),publicStats:()=>d("/ads/public-stats",null),bidHistory:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"24h";return d("/ads/bid-history?placement=".concat(e,"&period=").concat(t),null)}}},6321:function(e){e.exports={shell:"dashboard_shell__XcD0h",nav:"dashboard_nav__iSP8w",navBrand:"dashboard_navBrand__sMUJF",
1navAccent:"dashboard_navAccent__C7xoS",navLogo:"dashboard_navLogo__gW8uD",navSpacer:"dashboard_navSpacer__vqFpO",userPill:"dashboard_userPill__8p_hU",avatar:"dashboard_avatar__Gfs8m",loading:"dashboard_loading___JK9i",loginWrap:"dashboard_loginWrap__HDllF",loginCard:"dashboard_loginCard__ANOP6",loginLogo:"dashboard_loginLogo__xHJfx",loginLogoAccent:"dashboard_loginLogoAccent__CDqiN",content:"dashboard_content__lgdH3",pageTitle:"dashboard_pageTitle__lFpgv",grid:"dashboard_grid__D9hPf",creditsCard:"dashboard_creditsCard__SJV93",creditsLabel:"dashboard_creditsLabel__TDFKU",creditsValue:"dashboard_creditsValue__2TPo2",progressWrap:"dashboard_progressWrap__lwta5",progressTop:"dashboard_progressTop__IJTeP",track:"dashboard_track__xFjky",fill:"dashboard_fill__rpXuA",statsRow:"dashboard_statsRow__ouWvs",tabs:"dashboard_tabs__H27gN",tab:"dashboard_tab__nvtkC",tabActive:"dashboard_tabActive__Q6T8V",tabBadge:"dashboard_tabBadge__TQxbV",alertError:"dashboard_alertError__3ye56",alertSuccess:"dashboard_alertSuccess___7x2w",twitchBtn:"dashboard_twitchBtn__BMfWq",streamerStats:"dashboard_streamerStats__u2c3r",streamerStatCard:"dashboard_streamerStatCard__0QQwc",streamerStatValue:"dashboard_streamerStatValue__5pd8s",streamerStatLabel:"dashboard_streamerStatLabel__T83Q2",refRow:"dashboard_refRow__dC_1h",refCode:"dashboard_refCode__7ekc4",copyBtn:"dashboard_copyBtn__q7p8j",emailForm:"dashboard_emailForm__Paq8u",pendingBadge:"dashboard_pendingBadge__7riyy",logoutStreamer:"dashboard_logoutStreamer__yVzGS",table:"dashboard_table__qUgyM"}},8757:function(e){e.exports={nav:"GlobalNav_nav__KiV2d",navBrand:"GlobalNav_navBrand__lc4L_",navLogo:"GlobalNav_navLogo__V66Zs",navLinks:"GlobalNav_navLinks__SedS0",navLink:"GlobalNav_navLink___r6_Z",navActions:"GlobalNav_navActions__ZtpI_",navBtnCredits:"GlobalNav_navBtnCredits__bF5S_",navBtnAdvert:"GlobalNav_navBtnAdvert__tBqZf"}}},function(e){e.O(0,[767,524,648,971,117,744],function(){return e(e.s=2e3)}),_N_E=e.O()}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.