1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,25256,e=>{"use strict";let t="abcdefghijklmnopqrstuvwxyz0123456789",s="https://chat-cdn.faucetpay.io/sticker_fp/",a=/(@[a-zA-Z0-9_]{2,32})/g,n=/^\u00bb\s*@([a-zA-Z0-9_]{2,32}):\s*"([^"]{0,80})"\n?/;e.s(["buildReplyBody",0,function(e,t,s){let a=t.replace(/\s+/g," ").trim().slice(0,80);return`\u00bb @${e}: "${a}" 2${s}`},"extractReply",0,function(e){let t=e.match(n);return t?{quote:{author:t[1]??"",excerpt:t[2]??""},body:e.slice(t[0].length)}:null},"isAllowedGifUrl",0,function(e){try{let t=new URL(e);return"https:"===t.protocol&&"static.klipy.com"===t.hostname}catch{return!1}},"isAllowedStickerUrl",0,function(e){if(!e||e.length>300||!e.startsWith(s))return!1;let t=e.slice(s.length);return!(!t||t.includes("..")||t.includes("//"))&&!!/^[a-zA-Z0-9\-_./]+$/.test(t)&&/\.(webp|png|gif|avif)$/i.test(t)},"makeMessageId",0,function(){let e="";for(let s=0;s<10;s+=1)e+=t[Math.floor(Math.random()*t.length)];return e},"parseMessageSegments",0,function(e){if(!e)return[];let t=e.replace(/<br\s*\/?>/gi,"\n").replace(/<[^>]*>/g,""),s=[];return t.split("\n").forEach((e,t)=>{let n;t>0&&s.push({kind:"break"});let r=0;for(a.lastIndex=0;null!==(n=a.exec(e));)n.index>r&&s.push({kind:"text",value:e.slice(r,n.index)}),s.push({kind:"mention",value:n[0]}),r=n.index+n[0].length;r<e.length&&s.push({kind:"text",value:e.slice(r)})}),s}])},315089,639381,e=>{"use strict";var t=e.i(843476),s=e.i(271645),a=e.i(45356);let n=e.i(247167).default.env.NEXT_PUBLIC_CHAT_WS_URL||"wss://socket.faucetpay.io/chat/";function r(e,t=""){return"string"==typeof e?e:null==e?t:String(e)}function l(e){return!0===e||1===e||"1"===e}function i(e){return Array.isArray(e)?e.map(e=>r(e)).filter(Boolean):[]}function o(e){if(!Array.isArray(e))return[];let t=[];for(let s of e){if(!s||"object"!=typeof s)continue;let e=r(s.emoji),a=Number(s.count)||0;e&&!(a<=0)&&t.push({emoji:e,count:a,users:i(s.users)})}return t}function c(e){if(!e||"object"!=typeof e)return null;let t=r(e.message_id),s=r(e.user_name,"Anonymous"),a=r(e.profile_picture_url)||"https://www.gravatar.com/avatar/?d=mp&f=y",n=l(e.is_moderator),o=Number(e.created_at),c=Number.isFinite(o)&&o>0?1e3*o:Date.now(),d=r(e.type)||r(e.action);if("gif"===d||"gif_received"===d){let l=r(e.gif_url);return l?{id:t,kind:"gif",userName:s,avatarUrl:a,isModerator:n,gifUrl:l,ts:c}:null}if("sticker"===d||"sticker_received"===d){let l=r(e.sticker_url);return l?{id:t,kind:"sticker",userName:s,avatarUrl:a,isModerator:n,stickerUrl:l,ts:c}:null}if("rain"===d||"rain_received"===d)return{id:t||`rain-${c}`,kind:"rain",userName:"Rain Bot",avatarUrl:a,isModerator:!0,rain:{by:r(e.rain_by,"Someone"),winners:i(e.winners),amount:r(e.amount,"0"),coin:r(e.coin).toUpperCase()},ts:c};if("sponsored_rain"===d||"sponsored_rain_received"===d)return{id:t||`sponsored-${c}`,kind:"sponsored_rain",userName:"Sponsored Rain",avatarUrl:a,isModerator:!0,sponsored:{faucetName:r(e.faucet_name,"A faucet"),faucetLogoUrl:r(e.faucet_logo_url),ctaUrl:r(e.cta_url),amount:r(e.amount,"0"),amountUsd:r(e.amount_usd,""),coin:r(e.coin).toUpperCase(),usersRewarded:Number(e.users_rewarded)||i(e.winners).length,winners:i(e.winners),poolRemaining:r(e.pool_remaining,""),poolTotal:r(e.pool_total,""),message:r(e.message,""),campaignId:Number(e.campaign_id)||0},ts:c};let u=r(e.message);return u||t?{id:t,kind:"text",userName:s,avatarUrl:a,isModerator:n,text:u,ts:c}:null}function d(e){let t,{token:s,onEvent:a}=e,i=e.channel||"English";if("u"<typeof WebSocket)return{sendMessage:()=>{},sendGif:()=>{},sendSticker:()=>{},react:()=>{},changeChannel:()=>{},getOlderMessages:()=>{},rain:()=>{},removeMessage:()=>{},ban:()=>{},mute:()=>{},banForever:()=>{},unban:()=>{},ping:()=>{},close:()=>{}};let d=null,u=!1,x=0,m=e=>{try{d?.send(JSON.stringify(e))}catch{}},p=()=>{u||(x=Math.min(x+1,6),t=window.setTimeout(h,1e3*Math.min(20,2**x)))},h=()=>{if(!u){a({type:"status",status:"connecting"});try{d=new WebSocket(n)}catch{p();return}d.addEventListener("open",()=>{x=0,a({type:"status",status:"open"}),m({type:"initialization",socket_token:s??"",channel:i}),m({type:"get_older_messages",channel:i})}),d.addEventListener("message",e=>{"string"==typeof e.data&&(e=>{let t;try{t=JSON.parse(e)}catch{return}switch(r(t.action)){case"set_user_parameters":a({type:"userParams",isModerator:l(t.chat_moderator)});return;case"message_received":case"gif_received":case"sticker_received":case"rain_received":case"sponsored_rain_received":{let e=c(t);e&&a({type:"message",message:e});return}case"server_message":a({type:"serverMessage",text:r(t.message),removeId:l(t.remove_message)?r(t.message_id):void 0});return;case"update_message":a({type:"updateMessage",id:r(t.message_id),text:r(t.message)});return;case"remove_message":a({type:"removeMessage",id:r(t.message_id)});return;case"last_messages":{let e=Array.isArray(t.messages)?t.messages:[],s=e.map(e=>c(e)).filter(e=>null!==e),n={};for(let t of e){let e=r(t.message_id),s=o(t.reactions);e&&s.length&&(n[e]=s)}a({type:"history",messages:s,reactions:n});return}case"message_reactions":a({type:"reactions",id:r(t.message_id),reactions:o(t.reactions)});return;case"set_active_users_count":a({type:"onlineCount",count:Number(t.count)||0});return;case"refresh_balance":a({type:"refreshBalance"});return;case"force_logout":a({type:"forceLogout",reason:r(t.reason,"security_reason")});return;case"pong":a({type:"pong"});return;default:return}})(e.data)}),d.addEventListener("close",()=>{a({type:"status",status:"closed"}),p()}),d.addEventListener("error",()=>{try{d?.close()}catch{}})}};return h(),{sendMessage:(e,t)=>
2m({type:"send_message",message:e,message_id:t}),sendGif:(e,t)=>m({type:"send_gif",message:e,message_id:t}),sendSticker:(e,t)=>m({type:"send_sticker",message:e,message_id:t}),react:(e,t)=>m({type:"react_message",message_id:e,emoji:t}),changeChannel:e=>{m({type:"change_channel",channel:i=e||"English"}),m({type:"get_older_messages",channel:i})},getOlderMessages:e=>m({type:"get_older_messages",channel:e||i}),rain:(e,t)=>m({type:"rain",coin:e.toUpperCase(),rain_amount:t}),removeMessage:e=>m({type:"remove_message",message_id:e}),ban:(e,t)=>m({type:"ban_user",user:e,time:t}),mute:(e,t)=>m({type:"mute_user",user:e,time:t}),banForever:e=>m({type:"permaban_user",user:e}),unban:e=>m({type:"unban_user",user:e}),ping:()=>m({type:"ping"}),close:()=>{u=!0,t&&window.clearTimeout(t);try{d?.close()}catch{}}}}e.s(["CHAT_MAX_MESSAGE_LEN",0,360,"CHAT_MIN_SEND_INTERVAL_MS",0,350,"RAIN_MIN_USD",0,.008,"connectChat",0,d],639381);var u=e.i(25256),x=e.i(948148);let m=(0,s.createContext)(null),p={name:"English",label:"English",flag:"ð"},h={isOpen:!1,open:()=>{},close:()=>{},toggle:()=>{},status:"closed",connected:!1,channels:[p],currentChannel:p.name,setChannel:()=>{},messages:[],onlineCount:0,isModerator:!1,unread:0,canSend:!1,myName:"",sendText:()=>!1,sendGifUrl:()=>{},sendStickerUrl:()=>{},rain:()=>{},removeMessage:()=>{},modTarget:null,openModTool:()=>{},closeModTool:()=>{},muteUser:()=>{},banUser:()=>{},unbanUser:()=>{},reactions:{},toggleReaction:()=>{},replyTo:null,setReplyTo:()=>{},insertMention:()=>{},composerInsert:null,reportAtBottom:()=>{},markRead:()=>{}};e.s(["ChatProvider",0,function({children:e}){let n=(0,x.useTranslations)("chat"),{user:r,status:l}=(0,a.useAuth)(),i=r?.user_name??"",o="authenticated"===l&&!!i,[c,h]=(0,s.use
2State)(!1),[f,b]=(0,s.useState)("closed"),[g,v]=(0,s.useState)([p]),[j,y]=(0,s.useState)("English"),[N,k]=(0,s.useState)([]),[w,C]=(0,s.useState)(0),[_,S]=(0,s.useState)(!1),[M,R]=(0,s.useState)(0),[U,T]=(0,s.useState)({}),[z,L]=(0,s.useState)(null),[E,A]=(0,s.useState)(null),[P,I]=(0,s.useState)(null),$=(0,s.useRef)(null),B=(0,s.useRef)(!1),F=(0,s.useRef)(i);F.current=i;let D=(0,s.useRef)(c),G=(0,s.useRef)(!0),H=(0,s.useRef)(j),O=(0,s.useRef)(0),q=(0,s.useRef)(0);D.current=c,H.current=j;let X=(0,s.useCallback)(e=>{let t=F.current.toLowerCase();return e.map(e=>({emoji:e.emoji,count:e.count,mine:!!t&&e.users.some(e=>e.toLowerCase()===t)}))},[]),W=(0,s.useCallback)(e=>{switch(e.type){case"status":b(e.status);break;case"userParams":S(e.isModerator);break;case"history":{k(e.messages.slice(-200));let t={};for(let[s,a]of Object.entries(e.reactions))t[s]=X(a);T(t);break}case"reactions":T(t=>{let s={...t},a=X(e.reactions);return a.length?s[e.id]=a:delete s[e.id],s});break;case"message":{let t=e.message;k(e=>{let s=e.findIndex(e=>e.id&&e.id===t.id);if(s>=0){let a=e.slice();return a[s]={...t,pending:!1},a}let a=[...e,t];return a.length>200?a.slice(-200):a}),t.userName===i&&"rain"!==t.kind||D.current&&G.current||R(e=>Math.min(e+1,99));break}case"updateMessage":k(t=>t.map(t=>t.id===e.id?{...t,text:e.text,pending:!1}:t));break;case"removeMessage":k(t=>t.filter(t=>t.id!==e.id));break;case"serverMessage":e.removeId&&k(t=>t.filter(t=>t.id!==e.removeId)),k(t=>{let s=[...t,{id:`srv-${Date.now()}-${Math.random().toString(36).slice(2,6)}`,kind:"server",userName:n("systemUserName"),avatarUrl:"",isModerator:!0,text:e.text,ts:Date.now()}];return s.length>200?s.slice(-200):s});break;case"onlineCount":C(e.count);break;case"refreshBalance":try{window.dispatchEvent(new CustomEvent("fp:balance-refresh"))}catch{}break;case"forceLogout":$.current?.close(),$.current=null,b("closed")}},[i,X]),K=(0,s.useRef)(W);K.current=W;let J=(0,s.useCallback)(async()=>{if(B.current)return;B.current=!0;let e="";if(o)try{let t=await fetch("/app-api/account/get-socket-token"),s=await t.json();s.ok&&s.socket_token&&(e=s.socket_token)}catch{}$.current=d({token:e,channel:H.current,onEvent:e=>K.current(e)})},[o]);(0,s.useEffect)(()=>{if(!o)return;let e=!0;return(async()=>{try{let t=await fetch("/app-api/chat/channels"),s=await t.json();e&&s.ok&&Array.isArray(s.channels)&&s.channels.length&&v(s.channels)}catch{}})(),()=>{e=!1}},[o]),(0,s.useEffect)(()=>{if("open"!==f)return;let e=window.setInterval(()=>$.current?.ping(),25e3);return()=>window.clearInterval(e)},[f]),(0,s.useEffect)(()=>()=>{$.current?.close(),$.current=null},[]);let V=(0,s.useCallback)(()=>{h(!0),J()},[J]),Z=(0,s.useCallback)(()=>h(!1),[]),Y=(0,s.useCallback)(()=>{h(e=>{let t=!e;return t&&J(),t})},[J]),Q=(0,s.useCallback)(()=>R(0),[]),ee=(0,s.useCallback)(e=>{G.current=e,e&&R(0)},[]),et=(0,s.useCallback)(e=>{e!==H.current&&(y(e),k([]),T({}),L(null),$.current?.changeChannel(e))},[]),es=(0,s.useCallback)(e=>{let t=e.trim();if(!t||!o||!$.current)return!1;let s=Date.now();if(s-O.current<350)return!1;let a=z?(0,u.buildReplyBody)(z.userName,z.text??"",t).slice(0,360):t.slice(0,360),n=(0,u.makeMessageId)();O.current=s,$.current.sendMessage(a,n);let r={id:n,kind:"text",userName:i,avatarUrl:"",isModerator:_,text:a,ts:s,pending:!0};return k(e=>{let t=[...e,r];return t.length>200?t.slice(-200):t}),L(null),!0},[o,z,i,_]),ea=(0,s.useCallback)(e=>{if(!o||!$.current||!(0,u.isAllowedGifUrl)(e))return;let t=(0,u.makeMessageId)();$.current.sendGif(e,t)},[o]),en=(0,s.useCallback)(e=>{if(!o||!$.current||!(0,u.isAllowedStickerUrl)(e))return;let t=(0,u.makeMessageId)();$.current.sendSticker(e,t)},[o]),er=(0,s.useCallback)((e,t)=>{o&&$.current&&$.current.rain(e,t)},[o]),el=(0,s.useCallback)(e=>{$.current?.removeMessage(e)},[]),ei=(0,s.useCallback)(e=>{e&&A(e)},[]),eo=(0,s.useCallback)(()=>A(null),[]),ec=(0,s.useCallback)((e,t)=>{let s=Math.max(1,Math.min(720,Math.floor(t)||0));$.current?.mute(e,s)},[]),ed=(0,s.useCallback)(e=>{$.current?.banForever(e)},[]),eu=(0,s.useCallback)(e=>{$.current?.unban(e)},[]),ex=(0,s.useCallback)((e,t)=>{o&&e&&(T(s=>{let a=s[e]?s[e].slice():[],n=a.findIndex(e=>e.emoji===t);if(n>=0){let e=a[n];if(e.mine){let t=e.count-1;t<=0?a.splice(n,1):a[n]={...e,count:t,mine:!1}}else a[n]={...e,count:e.count+1,mine:!0}}else a.push({emoji:t,count:1,mine:!0});return{...s,[e]:a}}),$.current?.react(e,t))},[o]),em=(0,s.useCallback)(e=>{q.current+=1,I({value:`@${e} `,key:q.current}),h(!0),J()},[J]),ep=(0,s.useMemo)(()=>({isOpen:c,open:V,close:Z,toggle:Y,status:f,connected:"open"===f,channels:g,currentChannel:j,setChannel:et,messages:N,onlineCount:w,isModerator:_,unread:M,canSend:o,myName:i,sendText:es,sendGifUrl:ea,sendStickerUrl:en,rain:er,removeMessage:el,modTarget:E,openModTool:ei,closeModTool:eo,muteUser:ec,banUser:ed,unbanUser:eu,reactions:U,toggleReaction:ex,replyTo:z,setReplyTo:L,insertMention:em,composerInsert:P,reportAtBottom:ee,markRead:Q}),[c,V,Z,Y,f,g,j,et,N,w,_,M,o,i,es,ea,en,er,el,E,ei,eo,ec,ed,eu,U,ex,z,em,P,ee,Q]);return(0,t.jsx)(m.Provider,{value:ep,children:e})},"useChat",0,function(){return(0,s.useContext)(m)??h}],315089)},615227,e=>{"use strict";let t=(0,e.i(456420).default)("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"}]]);e.s(["MessageCircle",0,t],615227)},97923,e=>{"use strict";let t=(0,e.i(456420).default)("log-in",[["path",{d:"m10 17 5-5-5-5",key:"1bsop3"}],["path",{d:"M15 12H3",key:"6jk70r"}
2],["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}]]);e.s(["LogIn",0,t],97923)},462446,321207,535902,e=>{"use strict";var t=e.i(456420);let s=(0,t.default)("messages-square",[["path",{d:"M16 10a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 14.286V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z",key:"1n2ejm"}],["path",{d:"M20 9a2 2 0 0 1 2 2v10.286a.71.71 0 0 1-1.212.502l-2.202-2.202A2 2 0 0 0 17.172 19H10a2 2 0 0 1-2-2v-1",key:"1qfcsi"}]]);e.s(["MessagesSquare",0,s],462446);let a=(0,t.default)("smile",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 14s1.5 2 4 2 4-2 4-2",key:"1y1vjs"}],["line",{x1:"9",x2:"9.01",y1:"9",y2:"9",key:"yxxnd0"}],["line",{x1:"15",x2:"15.01",y1:"9",y2:"9",key:"1p4y9e"}]]);e.s(["Smile",0,a],321207);var n=e.i(843476),r=e.i(271645),l=e.i(733209);let i=[{id:"smileys",label:"Smileys",icon:"ð",emojis:["ð","ð","ð","ð","ð","ð
","ð¤£","ð","ð","ð","ð","ð","ð","ð¥°","ð","ð¤©","ð","ð","ð","ð","ð","ð","ð¤ª","ð","ð¤","ð¤","ð¤","ð¤«","ð¤","ð","ð","ð¶","ð","ð","ð","ð¬","ð®âð¨","ð¤¥","ð","ð´","ð","ð¤","ð§","ð¥³","ð","ð¤","ð ","ð¡","ð¤¬","ð","ð¢","ð¥","ð","ð©","ð«","ð¥º","ð±","ð¨","ð°","ð¤¯"]},{id:"gestures",label:"Gestures",icon:"ð",emojis:["ð","ð","ð","ð¤","ð¤","âï¸","ð¤","ð¤","ð¤","ð¤","ð","ð","ð","ð","âï¸","â","ð¤","ðï¸","ð","ð","ð¤","ð","â","ð","ð¤","ð¤","ð","ð","ð","ð¤²","ðª","ð«¶","â¤ï¸","ð§¡","ð","ð","ð","ð","ð¤","ð¤"]},{id:"money",label:"Money & Luck",icon:"ð°",emojis:["ð°","ðµ","ð´","ð¶","ð·","ðª","ð¸","ð³","ð§§","ð¤","ð","ð","ð¥","ð¥","ð¥","ð°","ð²","ð","ð¯","ð","ð¥","â¡","â¨","ð","ð«","ð","ð","ð","ð¹","ð¤"]},{id:"party",label:"Party",icon:"ð",emojis:["ð","ð","ð¥³","ð","ð","ð","ð¾","ð¥","ð»","ðº","ð","âï¸","â
","ð§ï¸","âï¸","âï¸","ð¥","ð","ð","ðª
"]},{id:"animals",label:"Animals",icon:"ð¶",emojis:["ð¶","ð±","ð¦","ð»","ð¼","ð¨","ð¯","ð¦","ð®","ð·","ð¸","ðµ","ð","ð§","ð¦","ð¦","ð","ð¦","ð","ð¦","ð³","ð¬","ð¢","ð","ð¦","ð","ð¦
","ð¦","ðº","ð"]},{id:"food",label:"Food",icon:"ð",emojis:["ð","ð","ð","ð","ð¿","ð§","ð¥","ð¥","ð³","ð¥","ð®","ð¯","ð¥","ð","ð£","ð¤","ð¦","ð©","ðª","ð","ð°","ð§","ð«","ð¬","ð","â","ðµ","ð§","ð¥¤","ð¹"]}];i.flatMap(e=>e.emojis),e.s(["EmojiPicker",0,function({onPick:e,embedded:t=!1}){let[s,a]=(0,r.useState)(i[0].id),o=i.find(e=>e.id===s)??i[0];return(0,n.jsxs)("div",{className:(0,l.cn)(t?"w-full":"w-[280px] overflow-hidden rounded-xl border border-line bg-surface shadow-floating"),children:[(0,n.jsx)("div",{className:"flex items-center gap-0.5 border-b border-line-soft px-1.5 py-1",children:i.map(e=>(0,n.jsx)("button",{type:"button",onClick:()=>a(e.id),"aria-label":e.label,className:(0,l.cn)("rounded-md px-1.5 py-1 text-[16px] transition-colors",e.id===s?"bg-surface-2":"opacity-70 hover:opacity-100"),children:e.icon},e.id))}),(0,n.jsxs)("div",{className:"max-h-[200px] overflow-y-auto p-1.5",children:[(0,n.jsx)("div",{className:"px-1 pb-1 text-[10.5px] font-semibold uppercase tracking-wide text-mute",children:o.label}),(0,n.jsx)("div",{className:"grid grid-cols-8 gap-0.5",children:o.emojis.map((t,s)=>(0,n.jsx)("button",{type:"button",onClick:()=>e(t),className:"rounded-md p-1 text-[18px] leading-none transition-colors hover:bg-surface-2",children:t},`${t}-${s}`))})]})]})}],535902)},484705,e=>{"use strict";var t=e.i(843476),s=e.i(271645),a=e.i(632781),n=e.i(733209),r=e.i(25256),l=e.i(948148);let i=null;e.s(["StickerPicker",0,function({onPick:e,embedded:o=!1}){let c=(0,l.useTranslations)("chat.stickerPicker"),[d,u]=(0,s.useState)(i??[]),[x,m]=(0,s.useState)(null===i);return(0,s.useEffect)(()=>{if(null!==i)return;let e=!0;return(async()=>{try{let t=await fetch("/app-api/chat/stickers"),s=await t.json(),a=(s.ok&&Array.isArray(s.stickers)?s.stickers:[]).filter(e=>e&&"string"==typeof e.url&&(0,r.isAllowedStickerUrl)(e.url));i=a,e&&u(a)}catch{e&&u([])}finally{e&&m(!1)}})(),()=>{e=!1}},[]),(0,t.jsx)("div",{className:(0,n.cn)(o?"w-full":"w-[300px] overflow-hidden rounded-xl border border-line bg-surface shadow-floating"),children:(0,t.jsx)("div",{className:"max-h-[260px] overflow-y-auto p-1.5",children:x?(0,t.jsx)("div",{className:"grid place-items-center py-8",children:(0,t.jsx)(a.Loader2,{size:18,className:"animate-spin text-text-dim"})}):0===d.length?(0,t.jsx)("p",{className:"px-2 py-6 text-center text-[12px] text-text-dim",children:c("noStickers")}):(0,t.jsx)("div",{className:"grid grid-cols-4 gap-1.5",children:d.map(s=>(0,t.jsx)("button",{type:"button",onClick:()=>e(s.url),className:"grid aspect-square place-items-center overflow-hidden rounded-lg border border-transparent p-1 transition-colors hover:border-blue hover:bg-surface-2","aria-label":s.id,title:s.id,children:(0,t.jsx)("img",{src:s.url,alt:s.id,className:"max-h-full max-w-full object-contain",loading:"lazy",referrerPolicy:"no-referrer"})},s.id))})})})}])},646086,e=>{"use strict";var t=e.i(843476),s=e.i(271645),a=e.i(522016),n=e.i(165489),r=e.i(632781),l=e.i(806537);e.i(404121);var i=e.i(746040),o=e.i(676525),c=e.i(880809),d=e.i(733209),u=e.i(315089),x=e.i(948148);
2e.s(["SponsoredRainModal",0,function({open:e,onClose:m}){let{channels:p}=(0,u.useChat)(),{push:h}=(0,c.useToast)(),f=(0,x.useTranslations)("sponsoredRain"),[b,g]=(0,s.useState)(!1),[v,j]=(0,s.useState)(!1),[y,N]=(0,s.useState)([]),[k,w]=(0,s.useState)([]),[C,_]=(0,s.useState)(null),[S,M]=(0,s.useState)(""),[R,U]=(0,s.useState)(""),[T,z]=(0,s.useState)("fixed"),[L,E]=(0,s.useState)(""),[A,P]=(0,s.useState)(""),[I,$]=(0,s.useState)("10"),[B,F]=(0,s.useState)("6"),[D,G]=(0,s.useState)("6"),[H,O]=(0,s.useState)(""),[q,X]=(0,s.useState)(""),[W,K]=(0,s.useState)("");(0,s.useEffect)(()=>{if(!e)return;let t=!0;return g(!0),(async()=>{try{let[e,s]=await Promise.all([fetch("/app-api/wallet/balances"),fetch("/app-api/sponsored-rain/eligible-faucets")]),a=await e.json(),n=await s.json();if(!t)return;let r=a.ok&&a.balances?a.balances:[];w(r);let l=r.find(e=>e.balance>0)??r[0];l&&M(l.coin);let i=n.ok&&n.faucets?n.faucets:[];N(i);let o=i[0];o&&_(o.id)}catch{t&&(w([]),N([]))}finally{t&&g(!1)}})(),()=>{t=!1}},[e]);let J=(0,s.useMemo)(()=>y.find(e=>e.id===C)??null,[y,C]),V=(0,s.useMemo)(()=>k.find(e=>e.coin===S)??null,[k,S]),Z=V?.price??0,Y=Number(R)||0,Q=Number(L)||0,ee="range"===T?Number(A)||0:Q,et=Number(I)||0,es=Number(B)||0,ea=Number(D)||0,en=es>0?Math.floor(3600*ea/es):0,er=Y*Z,el=J?V?Y<=0?f("errors.enterBudget"):Y>V.balance?f("errors.insufficientBalance"):er<1?f("errors.minBudget",{amount:"1.00"}):Q<=0?f("errors.enterReward"):"range"===T&&ee<Q?f("errors.maxGteMin"):Q*Z<.002?f("errors.rewardMin",{amount:"0.002"}):ee*Z>50?f("errors.rewardMax",{amount:"50.00"}):Y<ee?f("errors.budgetCoverReward"):et<1||et>200?f("errors.usersRange",{min:1,max:200}):es<1||es>500?f("errors.wavesRange",{min:1,max:500}):ea<1||ea>336?f("errors.durationRange",{min:1,max:336}):en<60?f("errors.tooManyWaves"):""!==H&&0>Number(H)?f("errors.invalidMinPayout"):"":f("errors.selectCoin"):f("errors.selectFaucet"),ei=!el&&!v&&!b,eo=async()=>{if(ei&&J&&V){j(!0);try{let e=await fetch("/app-api/sponsored-rain/create",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({faucet_id:J.id,coin:V.coin,budget:R,reward_mode:T,reward_min:L,reward_max:"range"===T?A:void 0,users_per_wave:et,total_waves:es,duration_hours:ea,min_payout_usd:H||void 0,channel:q||void 0,message:W.trim()||void 0,client_nonce:function(){try{if("u">typeof crypto&&"randomUUID"in crypto)return crypto.randomUUID()}catch{}return`${Date.now()}-${Math.random().toString(36).slice(2,12)}`}()})}),t=await e.json();t.ok?(h({title:f("toasts.live"),body:f("toasts.liveBody",{budget:R,coin:V.coin,faucet:J.faucet_name}),variant:"success"}),U(""),E(""),P(""),K(""),m()):h({title:f("toasts.couldNotStart"),body:t.message||f("toasts.pleaseTryAgain"),variant:"danger"})}catch{h({title:f("toasts.networkError"),body:f("toasts.pleaseTryAgain"),variant:"danger"})}finally{j(!1)}}},ec="w-full rounded-lg border border-line-soft bg-bg-2 px-3 py-2 text-[13.5px] text-text outline-none focus:border-blue";return(0,t.jsx)(i.Modal,{open:e,onClose:m,size:"md",title:(0,t.jsxs)("span",{className:"flex items-center gap-2",children:[(0,t.jsx)(n.Megaphone,{size:18,className:"text-amber-500"})," ",f("title")]}),description:f("description"),footer:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(o.Button,{variant:"ghost",onClick:m,children:f("cancel")}),(0,t.jsx)(o.Button,{onClick:eo,disabled:!ei,children:v?f("starting"):f("startCampaign")})]}),children:b?(0,t.jsx)("div",{className:"flex items-center justify-center py-10 text-text-dim",children:(0,t.jsx)(r.Loa
2der2,{size:18,className:"animate-spin"})}):0===y.length?(0,t.jsxs)("div",{className:"space-y-3 py-4 text-center",children:[(0,t.jsx)("p",{className:"text-[13.5px] font-medium text-text-2",children:f("noEligibleFaucets")}),(0,t.jsx)("p",{className:"text-[12.5px] text-text-dim",children:f("noEligibleFaucetsBody")}),(0,t.jsx)(a.default,{href:"/faucet/owner",className:"inline-block rounded-lg bg-blue px-4 py-2 text-[13px] font-semibold text-blue-on hover:bg-blue-2",children:f("manageFaucets")})]}):(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"mb-1 block text-[12px] font-medium text-text-2",children:f("faucet")}),(0,t.jsx)("select",{value:C??"",onChange:e=>_(Number(e.target.value)),className:ec,children:y.map(e=>(0,t.jsx)("option",{value:e.id,children:e.faucet_name},e.id))}),J?(0,t.jsxs)("div",{className:"mt-1.5 flex items-center gap-1.5 rounded-lg bg-bg-2 px-2.5 py-1.5 text-[11.5px] text-text-dim",children:[(0,t.jsx)(l.Lock,{size:12,className:"shrink-0 text-amber-500"}),(0,t.jsxs)("span",{className:"truncate",children:[f("ctaLocksTo")," ",(0,t.jsx)("span",{className:"text-text-2",children:J.faucet_url})]})]}):null]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"mb-1 block text-[12px] font-medium text-text-2",children:f("coin")}),(0,t.jsx)("select",{value:S,onChange:e=>M(e.target.value),className:ec,children:k.map(e=>(0,t.jsx)("option",{value:e.coin,children:e.coin},e.coin))})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"mb-1 flex items-center justify-between",children:[(0,t.jsx)("label",{className:"text-[12px] font-medium text-text-2",children:f("budget")}),V?(0,t.jsx)("button",{type:"button",onClick:()=>U(String(V.balance)),className:"text-[11px] font-medium text-blue hover:underline",children:f("max")}):null]}),(0,t.jsx)("input",{value:R,onChange:e=>U(e.target.value.replace(/[^0-9.]/g,"")),inputMode:"decimal",placeholder:"0.00000000",className:(0,d.cn)(ec,"font-mono")})]})]}),(0,t.jsx)("div",{className:"-mt-2 text-[11.5px] text-text-dim",children:V?(0,t.jsxs)(t.Fragment,{children:["â $",er.toFixed(2)," · Balance:"," ",V.balance.toLocaleString("en-US",{maximumFractionDigits:8})," ",V.coin]}):null}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"mb-1 block text-[12px] font-medium text-text-2",children:f("rewardPerUser")}),(0,t.jsx)("div",{className:"mb-2 inline-flex rounded-lg border border-line-soft p-0.5",children:["fixed","range"].map(e=>(0,t.jsx)("button",{type:"button",onClick:()=>z(e),className:(0,d.cn)("rounded-md px-3 py-1 text-[12px] font-medium capitalize transition-colors",T===e?"bg-blue text-blue-on":"text-text-2 hover:text-text"),children:e},e))}),(0,t.jsxs)("div",{className:(0,d.cn)("grid gap-3","range"===T?"grid-cols-2":"grid-cols-1"),children:[(0,t.jsx)("input",{value:L,onChange:e=>E(e.target.value.replace(/[^0-9.]/g,"")),inputMode:"decimal",placeholder:"range"===T?f("min"):f("amount"),className:(0,d.cn)(ec,"font-mono")}),"range"===T?(0,t.jsx)("input",{value:A,onChange:e=>P(e.target.value.replace(/[^0-9.]/g,"")),inputMode:"decimal",placeholder:f("maxPlaceholder"),className:(0,d.cn)(ec,"font-mono")}):null]})]}),(0,t.jsxs)("div",{className:"grid grid-cols-3 gap-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"mb-1 block text-[12px] font-medium text-text-2",children:f("usersPerWave")}),(0,t.jsx)("input",{value:I,onChange:e=>$(e.target.value.replace(/[^0-9]/g,"")),inputMode:"numeric",className:ec})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"mb-1 block text-[12px] font-medium text-text-2",children:f("waves")}),(0,t.jsx)("input",{value:B,onChange:e=>F(e.target.value.replace(/[^0-9]/g,"")),inputMode:"numeric",className:ec})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"mb-1 block text-[12px] font-medium text-text-2",children:f("hours")}),(0,t.jsx)("input",{value:D,onChange:e=>G(e.target.value.replace(/[^0-9]/g,"")),inputMode:"numeric",className:ec})]})]}),(0,t.jsxs)("div",{className:"-mt-2 text-[11.5px] text-text-dim",children:[f("oneWaveEvery",{interval:!Number.isFinite(en)||en<=0?"â":en<3600?`${Math.round(en/60)} min`:`${(en/3600).toFixed(+(en%3600!=0))} h`})," · ",f("upToUsers",{count:et||0})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("label",{className:"mb-1 block text-[12px] font-medium text-text-2",children:[f("minPayoutUsd"),(0,t.jsx)("span",{className:"ml-1 text-text-dim",children:f("opt")}
2)]}),(0,t.jsx)("input",{value:H,onChange:e=>O(e.target.value.replace(/[^0-9.]/g,"")),inputMode:"decimal",placeholder:"0.00",className:(0,d.cn)(ec,"font-mono")})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("label",{className:"mb-1 block text-[12px] font-medium text-text-2",children:[f("channel")," ",(0,t.jsx)("span",{className:"ml-1 text-text-dim",children:f("opt")})]}),(0,t.jsxs)("select",{value:q,onChange:e=>X(e.target.value),className:ec,children:[(0,t.jsx)("option",{value:"",children:f("allChannels")}),p.map(e=>(0,t.jsx)("option",{value:e.name,children:e.name},e.name))]})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("label",{className:"mb-1 block text-[12px] font-medium text-text-2",children:[f("message")," ",(0,t.jsx)("span",{className:"ml-1 text-text-dim",children:f("messageOpt")})]}),(0,t.jsx)("input",{value:W,onChange:e=>K(e.target.value.slice(0,200)),placeholder:f("messagePlaceholder"),className:ec})]}),el?(0,t.jsx)("p",{className:"rounded-lg bg-danger/10 px-3 py-2 text-[12px] font-medium text-danger",children:el}):(0,t.jsx)("p",{className:"rounded-lg bg-bg-2 px-3 py-2 text-[11.5px] text-text-dim",children:f("escrowInfo")})]})})}])},654913,e=>{"use strict";var t=e.i(843476),s=e.i(271645),a=e.i(802114),n=e.i(474544),r=e.i(874410),l=e.i(326150);e.i(404121);var i=e.i(746040),o=e.i(315089),c=e.i(948148);e.s(["ModeratorModal",0,function(){let{modTarget:e,closeModTool:d,muteUser:u,banUser:x,unbanUser:m}=(0,o.useChat)(),p=(0,c.useTranslations)("chat.modTool"),[h,f]=(0,s.useState)("24"),[b,g]=(0,s.useState)(!1);if((0,s.useEffect)(()=>{f("24"),g(!1)},[e]),!e)return null;let v=Math.max(1,Math.min(720,Math.floor(Number(h))||0));return(0,t.jsx)(i.Modal,{open:!0,onClose:d,title:(0,t.jsxs)("span",{className:"inline-flex items-center gap-2",children:[(0,t.jsx)(a.Gavel,{size:16,className:"text-warning"}),p("title")]}),size:"sm",children:(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("p",{className:"text-[13px] text-text-2",children:[p("target")," ",(0,t.jsx)("span",{className:"font-semibold text-text",children:e})]}),(0,t.jsxs)("div",{className:"rounded-lg border border-line-soft p-3",children:[(0,t.jsxs)("div",{className:"mb-1 flex items-center gap-1.5 text-[12.5px] font-semibold text-text",children:[(0,t.jsx)(l.VolumeX,{size:14,className:"text-text-dim"}),p("muteTitle")]}),(0,t.jsx)("p",{className:"mb-2 text-[12px] text-text-dim",children:p("muteHint")}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsxs)("div",{className:"relative w-24",children:[(0,t.jsx)("input",{type:"number",min:1,max:720,value:h,onChange:e=>f(e.target.value),className:"w-full rounded-lg border border-line-soft bg-bg-2 py-1.5 pl-2.5 pr-7 text-[13px] text-text outline-none focus:border-blue","aria-label":p("hours")}),(0,t.jsx)(n.Clock,{size:13,className:"pointer-events-none absolute right-2 top-1/2 -translate-y-1/2 text-text-dim"})]}),(0,t.jsx)("span",{className:"text-[12px] text-text-dim",children:p("hours")}),(0,t.jsx)("button",{type:"button",onClick:()=>{u(e,v),d()},className:"ml-auto rounded-lg bg-warning px-3 py-1.5 text-[12.5px] font-semibold text-black transition-opacity hover:opacity-90",children:p("mute",{hours:v})})]})]}),(0,t.jsxs)("div",{className:"rounded-lg border border-danger/30 p-3",children:[(0,t.jsxs)("div",{className:"mb-1 flex items-center gap-1.5 text-[12.5px] font-semibold text-text",children:[(0,t.jsx)(a.Gavel,{size:14,className:"text-danger"}),p("banTitle")]}),(0,t.jsx)("p",{className:"mb-2 text-[12px] text-text-dim",children:p("banHint")}),(0,t.jsx)("button",{type:"button",onClick:()=>{b?(x(e),d()):g(!0)},className:"w-full rounded-lg bg-danger px-3 py-1.5 text-[12.5px] font-semibold text-white transition-opacity hover:opacity-90",children:p(b?"confirmBan":"ban")})]}),(0,t.jsxs)("div",{className:"rounded-lg border border-line-soft p-3",children:[(0,t.jsxs)("div",{className:"mb-1 flex items-center gap-1.5 text-[12.5px] font-semibold text-text",children:[(0,t.jsx)(r.ShieldOff,{size:14,className:"text-text-dim"}),p("unbanTitle")]}),(0,t.jsx)("p",{className:"mb-2 text-[12px] text-text-dim",children:p("unbanHint")}),(0,t.jsx)("button",{type:"button",onClick:()=>{m(e),d()},className:"w-full rounded-lg border border-line bg-surface-2 px-3 py-1.5 text-[12.5px] font-semibold text-text transition-colors hover:border-blue",children:p("unban")})]})]})})}])},529867,e=>{"use strict";var t=e.i(843476),s=e.i(271645),a=e.i(263676),n=e.i(615227),r=e.i(733209),l=e.i(315089),i=e.i(716327),o=e.i(456420);let c=(0,o.default)("hash",[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}
2]]);function d({flag:e,size:s=16,className:a}){return e&&/^https:\/\//i.test(e)?(0,t.jsx)("img",{src:e,alt:"",width:s,height:s,className:(0,r.cn)("shrink-0 rounded-sm object-cover",a),style:{width:s,height:s},loading:"lazy",referrerPolicy:"no-referrer"}):e?(0,t.jsx)("span",{className:(0,r.cn)("shrink-0 leading-none",a),style:{fontSize:s},children:e}):(0,t.jsx)(c,{size:s-2,className:(0,r.cn)("shrink-0 text-text-dim",a)})}var u=e.i(948148);function x({onPick:e}){let s=(0,u.useTranslations)("chat.channelList"),{channels:a,currentChannel:n,setChannel:i}=(0,l.useChat)();return(0,t.jsx)("nav",{className:"flex flex-col gap-0.5 p-2","aria-label":s("ariaLabel"),children:a.map(s=>{let a=s.name===n;return(0,t.jsxs)("button",{type:"button",onClick:()=>{i(s.name),e?.()},"aria-current":a?"true":void 0,className:(0,r.cn)("flex items-center gap-2.5 rounded-lg px-2.5 py-2 text-left text-[13px] transition-colors",a?"bg-blue/15 font-semibold text-text":"text-text-2 hover:bg-surface-2 hover:text-text"),children:[(0,t.jsx)("span",{className:"grid h-7 w-7 shrink-0 place-items-center overflow-hidden rounded-md bg-surface-2",children:(0,t.jsx)(d,{flag:s.flag,size:16})}),(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate",children:s.label}),a?(0,t.jsx)("span",{className:"h-1.5 w-1.5 rounded-full bg-blue"}):null]},s.name)})})}function m(){let e=(0,u.useTranslations)("chat.channelDropdown"),{channels:a,currentChannel:n}=(0,l.useChat)(),[o,c]=(0,s.useState)(!1),m=(0,s.useRef)(null),p=a.find(e=>e.name===n);return(0,s.useEffect)(()=>{if(!o)return;let e=e=>{m.current?.contains(e.target)||c(!1)},t=e=>{"Escape"===e.key&&c(!1)};return document.addEventListener("mousedown",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("keydown",t)}},[o]),(0,t.jsxs)("div",{ref:m,className:"relative min-w-0",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>c(e=>!e),"aria-haspopup":"listbox","aria-expanded":o,className:(0,r.cn)("flex w-full items-center gap-1.5 rounded-md px-1.5 py-0.5 text-left transition-colors","hover:bg-surface-2"),children:[p?.flag?(0,t.jsx)(d,{flag:p.flag,size:15}):null,(0,t.jsx)("span",{className:"truncate text-[14px] font-semibold text-text",children:p?.label??e("defaultLabel")}),(0,t.jsx)(i.ChevronDown,{size:15,className:(0,r.cn)("shrink-0 text-text-dim transition-transform",o&&"rotate-180")})]}),o?(0,t.jsx)("div",{role:"listbox",className:"absolute left-0 top-[calc(100%+6px)] z-[60] max-h-[340px] w-[230px] overflow-y-auto overscroll-contain rounded-xl border border-line bg-surface shadow-floating",children:(0,t.jsx)(x,{onPick:()=>c(!1)})}):null]})}var p=e.i(635416),h=e.i(462446),f=e.i(522016);let b=(0,o.default)("reply",[["path",{d:"M20 18v-2a4 4 0 0 0-4-4H4",key:"5vmcpk"}],["path",{d:"m9 17-5-5 5-5",key:"nvlc11"}]]);var g=e.i(508734);let v=(0,o.default)("smile-plus",[["path",{d:"M22 11v1a10 10 0 1 1-9-10",key:"ew0xw9"}],["path",{d:"M8 14s1.5 2 4 2 4-2 4-2",key:"1y1vjs"}],["line",{x1:"9",x2:"9.01",y1:"9",y2:"9",key:"yxxnd0"}],["line",{x1:"15",x2:"15.01",y1:"9",y2:"9",key:"1p4y9e"}],["path",{d:"M16 5h6",key:"1vod17"}],["path",{d:"M19 2v6",key:"4bpg5p"}]]);var j=e.i(573474),y=e.i(689664),N=e.i(584026),k=e.i(802114),w=e.i(25256);function C({text:e,myName:a,className:n}){let l=(0,w.parseMessageSegments)(e),i=a?`@${a.toLowerCase()}`:"";return(0,t.jsx)("span",{className:(0,r.cn)("whitespace-pre-wrap break-words",n),children:l.map((e,a)=>{if("break"===e.kind)return(0,t.jsx)("br",{},a);if("mention"===e.kind){let s=i&&e.value.toLowerCase()===i,n=e.value.replace(/^@/,"");return(0,t.jsx)(f.default,{href:`/user/${encodeURIComponent(n)}`,prefetch:!1,className:(0,r.cn)("rounded px-1 font-semibold hover:underline",s?"bg-blue/25 text-blue":"text-blue"),children:e.value},a)}return(0,t.jsx)(s.Fragment,{children:e.value},a)})})}let _=["ð","â¤ï¸","ð","ð¥","ð°","ð®"];function S({msg:e,grouped:a}){let{myName:n,canSend:i,isModerator:o,reactions:c,toggleReaction:d,setReplyTo:x,removeMessage:m,openModTool:p}=(0,l.useChat)(),h=(0,u.useTranslations)("chat.messageBubble"),[M,R]=(0,s.use
2State)(!1),[U,T]=(0,s.useState)(!1);if("rain"===e.kind)return null;if("server"===e.kind)return(0,t.jsx)("div",{className:"px-4 py-1.5 text-center",children:(0,t.jsx)("span",{className:"inline-block rounded-full bg-surface-2 px-3 py-1 text-[11.5px] text-text-dim",children:e.text})});let z=!!n&&e.userName.toLowerCase()===n.toLowerCase(),L="text"===e.kind&&e.text?(0,w.extractReply)(e.text):null,E=L?L.body:e.text??"",A=c[e.id]??[],P=async()=>{try{await navigator.clipboard.writeText("gif"===e.kind?e.gifUrl??"":E),T(!0),window.setTimeout(()=>T(!1),1200)}catch{}},I=t=>{o&&(t.ctrlKey||t.metaKey)&&(t.preventDefault(),p(e.userName))};return(0,t.jsxs)("div",{className:(0,r.cn)("group relative flex gap-2.5 px-3 py-0.5",a?"mt-0":"mt-2"),onMouseLeave:()=>R(!1),children:[(0,t.jsx)("div",{className:"w-8 shrink-0",children:a?null:(0,t.jsx)(f.default,{href:`/user/${encodeURIComponent(e.userName)}`,prefetch:!1,onClick:I,className:"grid h-8 w-8 place-items-center overflow-hidden rounded-full bg-surface-2 text-[12px] font-semibold uppercase text-text-dim transition-shadow hover:ring-2 hover:ring-blue/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue","aria-label":h("viewProfile",{name:e.userName}),children:e.avatarUrl?(0,t.jsx)("img",{src:e.avatarUrl,alt:"",className:"h-full w-full object-cover",loading:"lazy",referrerPolicy:"no-referrer"}):e.userName.charAt(0)||"?"})}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[a?null:(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)(f.default,{href:`/user/${encodeURIComponent(e.userName)}`,prefetch:!1,onClick:I,className:(0,r.cn)("text-[12.5px] font-semibold hover:underline",z?"text-blue":"text-text"),children:e.userName}),e.isModerator?(0,t.jsxs)("span",{className:"inline-flex items-center gap-0.5 rounded bg-warning-bg px-1 py-0.5 text-[9px] font-semibold uppercase text-warning",children:[(0,t.jsx)(N.ShieldCheck,{size:9})," ",h("mod")]}):null,(0,t.jsx)("span",{className:"text-[10.5px] text-text-dim",children:function(e){try{return new Date(e).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"})}catch{return""}}(e.ts)})]}),L?(0,t.jsxs)("div",{className:"mt-0.5 border-l-2 border-blue/50 pl-2 text-[11.5px] text-text-dim",children:[(0,t.jsxs)(f.default,{href:`/user/${encodeURIComponent(L.quote.author)}`,prefetch:!1,className:"font-semibold text-text-2 hover:underline",children:["@",L.quote.author]})," ",(0,t.jsx)("span",{className:"opacity-80",children:L.quote.excerpt})]}):null,(0,t.jsx)("div",{className:(0,r.cn)("mt-0.5 text-[13px] leading-relaxed text-text-2",e.pending&&"opacity-60"),children:"gif"===e.kind&&e.gifUrl&&(0,w.isAllowedGifUrl)(e.gifUrl)?(0,t.jsx)("img",{src:e.gifUrl,alt:"GIF",className:"mt-0.5 max-h-52 w-auto max-w-[240px] rounded-lg",loading:"lazy",referrerPolicy:"no-referrer"}):"sticker"===e.kind&&e.stickerUrl&&(0,w.isAllowedStickerUrl)(e.stickerUrl)?(0,t.jsx)("img",{src:e.stickerUrl,alt:h("sticker"),className:"mt-0.5 h-auto max-h-32 w-auto max-w-[128px]",loading:"lazy",referrerPolicy:"no-referrer"}):(0,t.jsx)(C,{text:E,myName:n})}),A.length?(0,t.jsx)("div",{className:"mt-1 flex flex-wrap gap-1",children:A.map(s=>(0,t.jsxs)("button",{type:"button",onClick:()=>d(e.id,s.emoji),className:(0,r.cn)("inline-flex items-center gap-1 rounded-full border px-1.5 py-0.5 text-[11px] transition-colors",s.mine?"border-blue/50 bg-blue/15 text-blue":"border-line-soft bg-surface text-text-2 hover:border-line"),children:[(0,t.jsx)("span",{children:s.emoji}),(0,t.jsx)("span",{children:s.count})]},s.emoji))}):null]}),(0,t.jsxs)("div",{className:(0,r.cn)("absolute -top-2 right-3 z-10 flex items-center gap-0.5 rounded-md border border-line-soft bg-surface px-0.5 py-0.5 opacity-0 shadow-floating transition-opacity","group-hover:opacity-100 focus-within:opacity-100"),children:[i&&M?(0,t.jsx)("div",{className:"flex items-center gap-0.5 pr-1",children:_.map(s=>(0,t.jsx)("button",{type:"button",onClick:()=>{d(e.id,s),R(!1)},className:"rounded p-0.5 text-[14px] hover:bg-surface-2",children:s},s))}):i?(0,t.jsx)("button",{type:"button",onClick:()=>R(!0),className:"rounded p-1 text-text-dim hover:bg-surface-2 hover:text-text","aria-label":h("react"),children:(0,t.jsx)(v,{size:14})}):null,(0,t.jsx)("button",{type:"button",onClick:()=>x(e),className:"rounded p-1 text-text-dim hover:bg-surface-2 hover:text-text","aria-label":h("reply"),children:(0,t.jsx)(b,{size:14})}),(0,t.jsx)("button",{type:"button",onClick:P,className:"rounded p-1 text-text-dim hover:bg-surface-2 hover:text-text","aria-label":h("copy"),children:U?(0,t.jsx)(y.Check,{size:14,className:"text-success"}):(0,t.jsx)(g.Copy,{size:14})}),o?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("button",{type:"button",onClick:()=>p(e.userName),className:"rounded p-1 text-text-dim hover:bg-warning-bg hover:text-warning","aria-label":h("modTools"),title:h("modTools"),children:(0,t.jsx)(k.Gavel,{size:14})}),(0,t.jsx)("button",{type:"button",onClick:()=>m(e.id),className:"rounded p-1 text-text-dim hover:bg-danger-bg hover:text-danger","aria-label":h("removeMessage"),children:(0,t.jsx)(j.Trash2,{size:14})})]}):null]})]})}let M=(0,o.default)("cloud-rain",[["path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242",key:"1pljnt"}],["path",{d:"M16 14v6",key:"1j4efv"}],["path",{d:"M8 14v6",key:"17c4r9"}],["path",{d:"M12 16v6",key:"c8a4gj"}]]);function R({msg:e,myName:s}){let a=(0,u.useTranslations)("chat.rainMessage"),n=e.rain;if(!n)return null;let l=!!s&&n.winners.some(e=>e.toLowerCase()===s.toLowerCase());return(0,t.jsx)("div",{className:"px-3 py-1.5",children:(0,t.jsxs)("div",{className:(0,r.cn)("relative overflow-hidden rounded-xl border p-3.5","border-blue/40 bg-gradient-to-br from-blue/15 via-surface to-surface","shadow-[0_0_24px_-8px_rgba(91,141,239,0.5)]"),children:[(0,t.jsx)("div",{"aria-hidden":!0,
2className:"pointer-events-none absolute inset-0",children:Array.from({length:14}).map((e,s)=>(0,t.jsx)("span",{className:"chat-rain-drop",style:{left:`${s/14*100+2}%`,animationDelay:`${s%7*.22}s`,animationDuration:`${1.1+s%5*.18}s`}},s))}),(0,t.jsxs)("div",{className:"relative flex items-start gap-3",children:[(0,t.jsx)("div",{className:"grid h-9 w-9 shrink-0 place-items-center rounded-full bg-blue/20 text-blue",children:(0,t.jsx)(M,{size:18})}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-baseline gap-x-2",children:[(0,t.jsx)("span",{className:"text-[13px] font-bold text-text",children:a("raining")}),(0,t.jsxs)("span",{className:"text-[12px] text-text-2",children:[(0,t.jsx)(f.default,{href:`/user/${encodeURIComponent(n.by)}`,prefetch:!1,className:"font-semibold text-text hover:underline",children:n.by})," ",a("madeItRain")]})]}),(0,t.jsxs)("div",{className:"mt-1 flex flex-wrap items-center gap-2",children:[(0,t.jsxs)("span",{className:"rounded-md bg-blue/15 px-2 py-0.5 text-[12.5px] font-semibold text-blue",children:[n.amount," ",n.coin]}),(0,t.jsx)("span",{className:"text-[11.5px] text-text-dim",children:a("eachTo",{count:n.winners.length})})]}),l?(0,t.jsxs)("div",{className:"mt-2 inline-flex items-center gap-1.5 rounded-md bg-success-bg px-2 py-1 text-[12px] font-semibold text-success",children:[(0,t.jsx)(y.Check,{size:13}),a("youReceived",{amount:n.amount,coin:n.coin})]}):null,n.winners.length?(0,t.jsxs)("div",{className:"mt-2 flex flex-wrap gap-1",children:[n.winners.slice(0,12).map((e,a)=>(0,t.jsx)(f.default,{href:`/user/${encodeURIComponent(e)}`,prefetch:!1,className:(0,r.cn)("rounded-full px-2 py-0.5 text-[11px] transition hover:brightness-110",s&&e.toLowerCase()===s.toLowerCase()?"bg-blue/25 font-semibold text-blue":"bg-surface-2 text-text-2"),children:e},`${e}-${a}`)),n.winners.length>12?(0,t.jsxs)("span",{className:"rounded-full bg-surface-2 px-2 py-0.5 text-[11px] text-text-dim",children:["+",n.winners.length-12]}):null]}):null]})]})]})})}var U=e.i(482022),T=e.i(165489);function z({msg:e,myName:s}){let a=(0,u.useTranslations)("chat.sponsoredRain"),n=e.sponsored;if(!n)return null;let l=!!s&&n.winners.some(e=>e.toLowerCase()===s.toLowerCase()),i=function(e){if(!e)return null;try{let t=new URL(e);if("http:"===t.protocol||"https:"===t.protocol)return t.toString()}catch{}return null}(n.ctaUrl),o=i?function(e){try{return new URL(e).hostname.replace(/^www\./,"")}catch{return e}}(i):"",c=n.amountUsd&&Number(n.amountUsd)>0?`â $${Number(n.amountUsd).toFixed(4)}`:"",d=(n.faucetName||"?").trim().charAt(0).toUpperCase();return(0,t.jsx)("div",{className:"px-3 py-1.5",children:(0,t.jsxs)("div",{className:(0,r.cn)("relative overflow-hidden rounded-xl border p-3.5","border-amber-400/40 bg-gradient-to-br from-amber-400/15 via-surface to-surface","shadow-[0_0_24px_-8px_rgba(245,180,80,0.5)]"),children:[(0,t.jsx)("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-0",children:Array.from({length:14}).map((e,s)=>(0,t.jsx)("span",{className:"chat-rain-drop chat-rain-drop--gold",style:{left:`${s/14*100+2}%`,animationDelay:`${s%7*.22}s`,animationDuration:`${1.1+s%5*.18}s`}},s))}),(0,t.jsxs)("div",{className:"relative mb-2 flex items-center gap-1.5",children:[(0,t.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full bg-amber-400/20 px-2 py-0.5 text-[10.5px] font-semibold uppercase tracking-wide text-amber-500",children:[(0,t.jsx)(T.Megaphone,{size:11}),a("sponsored")]}),(0,t.jsxs)("span",{className:"inline-flex items-center gap-1 text-[11px] text-text-dim",children:[(0,t.jsx)(M,{size:12})," ",a("communityRain")]})]}),(0,t.jsxs)("div",{className:"relative flex items-start gap-3",children:[n.faucetLogoUrl?(0,t.jsx)("img",{src:n.faucetLogoUrl,alt:"",className:"h-9 w-9 shrink-0 rounded-full border border-amber-400/30 object-cover"}):(0,t.jsx)("div",{className:"grid h-9 w-9 shrink-0 place-items-center rounded-full bg-amber-400/20 text-[14px] font-bold text-amber-500",children:d}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-baseline gap-x-2",children:[(0,t.jsx)("span",{className:"truncate text-[13px] font-bold text-text",children:n.faucetName}),(0,t.jsx)("span",{className:"text-[12px] text-text-2",children:a("rainingRewards")})]}),(0,t.jsxs)("div",{className:"mt-1 flex flex-wrap items-center gap-2",children:[(0,t.jsxs)("span",{className:"rounded-md bg-amber-400/15 px-2 py-0.5 text-[12.5px] font-semibold text-amber-500",children:[n.amount," ",n.coin]}),c?(0,t.jsx)("span",{className:"text-[11.5px] text-text-dim",children:c}):null,(0,t.jsx)("span",{className:"text-[11.5px] text-text-dim",children:a("eachTo",{count:n.usersRewarded,claimer:a(1===n.usersRewarded?"claimerSingular":"claimerPlural")})})]}),n.message?(0,t.jsxs)("p",{className:"mt-1.5 text-[12px] italic text-text-2",children:["â",n.message,"â"]}):null,l?(0,t.jsxs)("div",{className:"mt-2 inline-flex items-center gap-1.5 rounded-md bg-success-bg px-2 py-1 text-[12px] font-semibold text-success",children:[(0,t.jsx)(y.Check,{size:13}),a("youReceived",{amount:n.amount,coin:n.coin})]}):null,n.winners.length?(0,t.jsxs)("div",{className:"mt-2 flex flex-wrap gap-1",children:[n.winners.slice(0,12).map((e,a)=>(0,t.jsx)(f.default,{href:`/user/${encodeURIComponent(e)}`,prefetch:!1,className:(0,r.cn)("rounded-full px-2 py-0.5 text-[11px] transition hover:brightness-110",s&&e.toLowerCase()===s.toLowerCase()?"bg-amber-400/25 font-semibold text-amber-500":"bg-surface-2 text-text-2"),children:e},`${e}-${a}`)),n.usersRewarded>12?(0,t.jsxs)("span",{className:"rounded-full bg-surface-2 px-2 py-0.5 text-[11px] text-text-dim",children:["+",n.usersRewarded-12]}):null]}):null,i?(0,t.jsxs)("a",{href:i,target:"_blank",rel:"noopener noreferrer nofollow sponsored",className:(0,r.cn)("mt-2.5 inline-flex items-center gap-1.5 rounded-lg px-3 py-1.5 text-[12px] font-semibold","bg-amber-400 text-black transition-transform hover:scale-[1.03]"),children:[o?a("visit",{host:o}):a("visitFallback"),(0,t.jsx)(U.ExternalLink,{size:13})]}):null]})]})]})})}function L(){let{messages:e,myName:a,reportAtBottom:n,unread:i,status:o}=(0,l.useChat)(),c=(0,u.useTranslations)("chat.messageList"),d=(0,s.useRef)(null),[x,m]=(0,s.use
2State)(!0),f=(0,s.useRef)(!0),b=(0,s.useRef)(0),g=()=>{let e=d.current;if(!e)return;let t=e.scrollHeight-e.scrollTop-e.clientHeight<=80;f.current=t,m(t),n(t)},v=(e=!1)=>{let t=d.current;t&&t.scrollTo({top:t.scrollHeight,behavior:e?"smooth":"auto"})};return((0,s.useLayoutEffect)(()=>{let t=e.length>b.current;b.current=e.length,t&&f.current&&(v(),n(!0))},[e,n]),(0,s.useEffect)(()=>{v(),g()},[]),"open"!==o&&0===e.length)?(0,t.jsx)("div",{className:"flex flex-1 items-center justify-center px-6 text-center",children:(0,t.jsx)("p",{className:"text-[13px] text-text-dim",children:c("connecting"===o?"connecting":"reconnecting")})}):0===e.length?(0,t.jsxs)("div",{className:"flex flex-1 flex-col items-center justify-center gap-2 px-6 text-center",children:[(0,t.jsx)(h.MessagesSquare,{size:28,className:"text-text-dim"}),(0,t.jsx)("p",{className:"text-[13px] font-medium text-text-2",children:c("noMessagesYet")}),(0,t.jsx)("p",{className:"text-[12px] text-text-dim",children:c("sayHello")})]}):(0,t.jsxs)("div",{className:"relative flex-1 overflow-hidden",children:[(0,t.jsx)("div",{ref:d,onScroll:g,className:"h-full overflow-y-auto overscroll-contain py-2",children:e.map((s,n)=>{if("rain"===s.kind)return(0,t.jsx)(R,{msg:s,myName:a},s.id||n);if("sponsored_rain"===s.kind)return(0,t.jsx)(z,{msg:s,myName:a},s.id||n);let r=e[n-1],l=!!r&&"rain"!==r.kind&&"sponsored_rain"!==r.kind&&"server"!==r.kind&&"server"!==s.kind&&r.userName===s.userName&&s.ts-r.ts<24e4;return(0,t.jsx)(S,{msg:s,grouped:l},s.id||n)})}),(!x||i>0)&&(0,t.jsxs)("button",{type:"button",onClick:()=>{v(!0),n(!0)},className:(0,r.cn)("absolute bottom-3 right-3 inline-flex items-center gap-1.5 rounded-full border border-line bg-surface px-3 py-1.5 text-[12px] font-medium text-text shadow-floating","transition-transform hover:scale-[1.03]"),children:[i>0?(0,t.jsx)("span",{className:"rounded-full bg-blue px-1.5 text-[11px] font-semibold text-blue-on",children:i}):null,c("newMessages"),(0,t.jsx)(p.ArrowDown,{size:13})]})]})}var E=e.i(321207);let A=(0,o.default)("send-horizontal",[["path",{d:"M3.714 3.048a.498.498 0 0 0-.683.627l2.843 7.627a2 2 0 0 1 0 1.396l-2.842 7.627a.498.498 0 0 0 .682.627l18-8.5a.5.5 0 0 0 0-.904z",key:"117uat"}],["path",{d:"M6 12h16",key:"s4cdu5"}]]);var P=e.i(97923),I=e.i(639381),$=e.i(535902),B=e.i(566595),F=e.i(632781);function D({onPick:e,embedded:a=!1}){let n=(0,u.useTranslations)("chat.gifPicker"),[l,i]=(0,s.useState)(""),[o,c]=(0,s.useState)([]),[d,x]=(0,s.useState)(!1),m=(0,s.useRef)(0);return(0,s.useEffect)(()=>{let e=++m.current,t=l.trim();x(!0);let s=window.setTimeout(async()=>{try{let s=await fetch(t?"/app-api/chat/gif/search":"/app-api/chat/gif/trending",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t?{query:t}:{})}),a=await s.json();e===m.current&&c(a.ok&&a.gifs?a.gifs:[])}catch{e===m.current&&c([])}finally{e===m.current&&x(!1)}},350*!!t);return()=>window.clearTimeout(s)},[l]),(0,t.jsxs)("div",{className:(0,r.cn)(a?"w-full":"w-[300px] overflow-hidden rounded-xl border border-line bg-surface shadow-floating"),children:[(0,t.jsx)("div",{className:"border-b border-line-soft p-2",children:(0,t.jsxs)("div",{className:"flex items-center gap-2 rounded-lg border border-line-soft bg-bg-2 px-2.5 py-1.5",children:[(0,t.jsx)(B.Search,{size:14,className:"text-text-dim"}),(0,t.jsx)("input",{value:l,onChange:e=>i(e.target.value),placeholder:n("searchPlaceholder"),className:"w-full bg-transparent text-[13px] text-text outline-none placeholder:text-text-dim",autoFocus:!0}),d?(0,t.jsx)(F.Loader2,{size:14,className:"animate-spin text-text-dim"}):null]})}),(0,t.jsx)("div",{className:"max-h-[260px] overflow-y-auto p-1.5",children:0!==o.length||d?(0,t.jsx)("div",{className:"columns-2 gap-1.5 [&>*]:mb-1.5",children:o.map(s=>(0,t.jsx)("button",{type:"button",onClick:()=>e(s.url),className:"block w-full overflow-hidden rounded-lg border border-line-soft transition-colors hover:border-blue",children:(0,t.jsx)("img",{src:s.preview,alt:n("gifAlt"),className:"w-full",loading:"lazy",referrerPolicy:"no-referrer"})},s.id))}):(0,t.jsx)("p",{className:"px-2 py-6 text-center text-[12px] text-text-dim",children:n("noGifsFound")})}),(0,t.jsx)("div",{className:"border-t border-line-soft px-2.5 py-1.5 text-[10px] text-text-dim",children:n("poweredBy")})]})}var G=e.i(484705);function H({onPickEmoji:e,onPickGif:a,onPickSticker:n}){let l=(0,u.useTranslations)("chat.mediaPicker"),[i,o]=(0,s.use
2State)("emoji");return(0,t.jsxs)("div",{className:"w-[300px] overflow-hidden rounded-xl border border-line bg-surface shadow-floating",children:[(0,t.jsx)("div",{className:"flex items-center gap-1 border-b border-line-soft p-1.5",children:["emoji","gif","sticker"].map(e=>(0,t.jsx)("button",{type:"button",onClick:()=>o(e),className:(0,r.cn)("flex-1 rounded-md px-2 py-1 text-[12px] font-semibold transition-colors",i===e?"bg-surface-2 text-text":"text-text-dim hover:text-text"),children:"gif"===e?l("gif"):"sticker"===e?l("stickers"):l("emoji")},e))}),"emoji"===i?(0,t.jsx)($.EmojiPicker,{onPick:e,embedded:!0}):"gif"===i?(0,t.jsx)(D,{onPick:a,embedded:!0}):(0,t.jsx)(G.StickerPicker,{onPick:n,embedded:!0})]})}function O({onOpenRain:e,onOpenSponsoredRain:n}){let{canSend:i,sendText:o,sendGifUrl:c,sendStickerUrl:d,replyTo:x,setReplyTo:m,composerInsert:p}=(0,l.useChat)(),h=(0,u.useTranslations)("chat.composer"),[b,g]=(0,s.useState)(""),[v,j]=(0,s.useState)("none"),y=(0,s.useRef)(null),N=(0,s.useRef)(null),k=(0,s.useRef)(0);(0,s.useEffect)(()=>{let e=y.current;e&&(e.style.height="auto",e.style.height=`${Math.min(e.scrollHeight,120)}px`)},[b]),(0,s.useEffect)(()=>{p&&p.key!==k.current&&(k.current=p.key,g(e=>e?`${e.replace(/\s*$/,"")} ${p.value}`:p.value),y.current?.focus())},[p]),(0,s.useEffect)(()=>{if("none"===v)return;let e=e=>{N.current?.contains(e.target)||j("none")};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[v]);let w=()=>{o(b)&&(g(""),j("none"))};if(!i)return(0,t.jsx)("div",{className:"border-t border-line-soft bg-surface p-3",children:(0,t.jsxs)(f.default,{href:"/login",className:"flex items-center justify-center gap-2 rounded-lg bg-blue px-4 py-2.5 text-[13.5px] font-semibold text-blue-on transition-colors hover:bg-blue-2",children:[(0,t.jsx)(P.LogIn,{size:15}),h("loginToChat")]})});let C=I.CHAT_MAX_MESSAGE_LEN-b.length;return(0,t.jsxs)("div",{ref:N,className:"relative border-t border-line-soft bg-surface",children:["media"===v?(0,t.jsx)("div",{className:"absolute bottom-[calc(100%+8px)] left-2 z-20",children:(0,t.jsx)(H,{onPickEmoji:e=>{let t=y.current;if(!t)return void g(t=>t+e);let s=t.selectionStart??b.length,a=t.selectionEnd??b.length;g((b.slice(0,s)+e+b.slice(a)).slice(0,I.CHAT_MAX_MESSAGE_LEN)),requestAnimationFrame(()=>{t.focus();let a=s+e.length;t.setSelectionRange(a,a)})},onPickGif:e=>{c(e),j("none")},onPickSticker:e=>{d(e),j("none")}})}):null,x?(0,t.jsxs)("div",{className:"flex items-center gap-2 border-b border-line-soft px-3 py-1.5",children:[(0,t.jsx)("div",{className:"h-7 w-0.5 rounded-full bg-blue"}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("div",{className:"text-[11px] font-semibold text-blue",children:h("replyingTo",{name:x.userName})}),(0,t.jsx)("div",{className:"truncate text-[11.5px] text-text-dim",children:"gif"===x.kind?h("gif"):x.text})]}),(0,t.jsx)("button",{type:"button",onClick:()=>m(null),className:"rounded p-1 text-text-dim hover:bg-surface-2 hover:text-text","aria-label":h("cancelReply"),children:(0,t.jsx)(a.X,{size:14})})]}):null,(0,t.jsxs)("div",{className:"flex items-end gap-0.5 p-2",children:[(0,t.jsx)("button",{type:"button",onClick:()=>j(e=>"media"===e?"none":"media"),className:(0,r.cn)("shrink-0 rounded-md p-1.5 text-text-dim transition-colors hover:bg-surface-2 hover:text-text","media"===v&&"bg-surface-2 text-text"),"aria-label":h("emojiGif"),title:h("emojiGif"),children:(0,t.jsx)(E.Smile,{size:16})}),(0,t.jsx)("button",{type:"button",onClick:e,className:"shrink-0 rounded-md p-1.5 text-blue transition-colors hover:bg-blue/15","aria-label":h("makeItRain"),title:h("makeItRain"),children:(0,t.jsx)(M,{size:16})}),(0,t.jsx)("button",{type:"button",onClick:n,className:"shrink-0 rounded-md p-1.5 text-amber-500 transition-colors hover:bg-amber-400/15","aria-label":h("sponsoredRain"),title:h("sponsoredRain"),children:(0,t.jsx)(T.Megaphone,{size:16})}),(0,t.jsxs)("div",{className:"relative flex-1",children:[(0,t.jsx)("textarea",{ref:y,value:b,onChange:e=>g(e.target.value.slice(0,I.CHAT_MAX_MESSAGE_LEN)),onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),w())},rows:1,placeholder:h("messagePlaceholder"),className:"block w-full resize-none rounded-lg border border-line-soft bg-bg-2 px-3 py-2 text-[13.5px] text-text outline-none transition-colors placeholder:text-text-dim focus:border-blue"}),C<=60?(0,t.jsx)("span",{className:(0,r.cn)("pointer-events-none absolute bottom-1 right-2 text-[10px]",C<=0?"text-danger":"text-text-dim"),children:C}):null]}),(0,t.jsx)("button",{type:"button",onClick:w,disabled:!b.trim(),className:"shrink-0 rounded-lg bg-blue p-2 text-blue-on transition-colors hover:bg-blue-2 disabled:cursor-not-allowed disabled:opacity-40","aria-label":h("send"),children:(0,t.jsx)(A,{size:16})})]})]})}function q({className:e}){let{onlineCount:s,connected:a}=(0,l.useChat)();return(0,t.jsxs)("span",{className:(0,r.cn)("inline-flex items-center gap-1.5 text-[11.5px] text-text-dim",e),children:[(0,t.jsx)("span",{className:(0,r.cn)("relative inline-flex h-2 w-2 rounded-full",a?"bg-success":"bg-text-dim"),children:a?(0,t.jsx)("span",{className:"absolute inset-0 animate-ping rounded-full bg-success/60"}):null}
2),a?`${s.toLocaleString("en-US")} online`:"offline"]})}e.i(404121);var X=e.i(746040),W=e.i(676525),K=e.i(102231),J=e.i(880809);function V({open:e,onClose:a}){let{rain:n}=(0,l.useChat)(),{push:i}=(0,J.useToast)(),o=(0,u.useTranslations)("chat.rain"),[c,d]=(0,s.useState)([]),[x,m]=(0,s.useState)(!1),[p,h]=(0,s.useState)(""),[f,b]=(0,s.useState)("");(0,s.useEffect)(()=>{if(!e)return;let t=!0;return m(!0),(async()=>{try{let e=await fetch("/app-api/wallet/balances"),s=await e.json();if(!t)return;let a=s.ok&&s.balances?s.balances:[];d(a);let n=a.find(e=>e.balance>0)??a[0];n&&h(n.coin)}catch{t&&d([])}finally{t&&m(!1)}})(),()=>{t=!1}},[e]);let g=(0,s.useMemo)(()=>c.find(e=>e.coin.toLowerCase()===p.toLowerCase()),[c,p]),v=(0,s.useMemo)(()=>c.map(e=>({symbol:e.coin,name:e.name,amountFormatted:e.balance.toLocaleString("en-US",{maximumFractionDigits:8}),usd:e.balance*e.price})),[c]),j=Number(f)||0,y=g?j*g.price:0,N=g?j<=0?"":j>g.balance?o("insufficientBalance"):y<I.RAIN_MIN_USD?o("minRain",{amount:I.RAIN_MIN_USD.toFixed(3)}):"":o("selectCoin"),k=!!g&&j>0&&!N;return(0,t.jsx)(X.Modal,{open:e,onClose:a,size:"sm",title:(0,t.jsxs)("span",{className:"flex items-center gap-2",children:[(0,t.jsx)(M,{size:18,className:"text-blue"})," ",o("title")]}),description:o("description"),footer:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(W.Button,{variant:"ghost",onClick:a,children:o("cancel")}),(0,t.jsx)(W.Button,{onClick:()=>{k&&g&&(n(g.coin,f),i({title:o("makingItRain"),body:o("makingItRainBody",{amount:f,coin:g.coin}),variant:"info"}),b(""),a())},disabled:!k,children:o("makeItRain")})]}),children:x?(0,t.jsx)("div",{className:"flex items-center justify-center py-8 text-text-dim",children:(0,t.jsx)(F.Loader2,{size:18,className:"animate-spin"})}):(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"mb-1 block text-[12px] font-medium text-text-2",children:o("coin")}),(0,t.jsx)(K.CoinComboBox,{value:p,onChange:h,coins:v})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"mb-1 flex items-center justify-between",children:[(0,t.jsx)("label",{className:"text-[12px] font-medium text-text-2",children:o("amount")}),g?(0,t.jsx)("button",{type:"button",onClick:()=>b(String(g.balance)),className:"text-[11px] font-medium text-blue hover:underline",children:o("max")}):null]}),(0,t.jsx)("input",{value:f,onChange:e=>b(e.target.value.replace(/[^0-9.]/g,"")),inputMode:"decimal",placeholder:"0.00000000",className:"w-full rounded-lg border border-line-soft bg-bg-2 px-3 py-2 font-mono text-[13.5px] text-text outline-none focus:border-blue"}),(0,t.jsxs)("div",{className:"mt-1 flex items-center justify-between text-[11.5px]",children:[(0,t.jsx)("span",{className:(0,r.cn)(N?"text-danger":"text-text-dim"),children:N||o("approxUsd",{amount:y.toFixed(4)})}),g?(0,t.jsx)("span",{className:"text-text-dim",children:o("balance",{amount:g.balance.toLocaleString("en-US",{maximumFractionDigits:8})})}):null]})]}),(0,t.jsx)("p",{className:"rounded-lg bg-bg-2 px-3 py-2 text-[11.5px] text-text-dim",children:o("rainHint")})]})})}var Z=e.i(646086),Y=e.i(654913);e.s(["ChatPanel",0,function(){let{isOpen:e,close:i}=(0,l.useChat)(),o=(0,u.useTranslations)("chat.chatPanel"),[c,d]=(0,s.useState)(!1),[x,p]=(0,s.use
2State)(!1);return(0,s.useEffect)(()=>{if(!e)return;let t=e=>{"Escape"!==e.key||c||x||i()};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[e,i,c,x]),(0,t.jsxs)("aside",{role:"complementary","aria-label":o("chat"),"aria-hidden":!e,className:(0,r.cn)("fixed right-0 top-0 z-50 flex h-[100dvh] w-full flex-col border-l border-line bg-surface shadow-floating","transition-transform duration-300 ease-out-soft lg:w-[300px]",e?"translate-x-0":"pointer-events-none translate-x-full"),children:[(0,t.jsxs)("header",{className:"flex shrink-0 items-center gap-2 border-b border-line-soft px-3 py-2.5",children:[(0,t.jsx)("div",{className:"grid h-8 w-8 shrink-0 place-items-center rounded-md bg-blue/15 text-blue",children:(0,t.jsx)(n.MessageCircle,{size:16})}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)(m,{}),(0,t.jsx)("div",{className:"px-1.5",children:(0,t.jsx)(q,{})})]}),(0,t.jsx)("button",{type:"button",onClick:i,className:"grid h-8 w-8 shrink-0 place-items-center rounded-md text-text-2 hover:bg-surface-2 hover:text-text","aria-label":o("closeChat"),children:(0,t.jsx)(a.X,{size:17})})]}),(0,t.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col",children:[(0,t.jsx)(L,{}),(0,t.jsx)(O,{onOpenRain:()=>d(!0),onOpenSponsoredRain:()=>p(!0)})]}),(0,t.jsx)(V,{open:c,onClose:()=>d(!1)}),(0,t.jsx)(Z.SponsoredRainModal,{open:x,onClose:()=>p(!1)}),(0,t.jsx)(Y.ModeratorModal,{})]})}],529867)},317886,e=>{"use strict";var t=e.i(843476),s=e.i(733209),a=e.i(315089);e.s(["ChatDock",0,function({children:e}){let{isOpen:n}=(0,a.useChat)();return(0,t.jsx)("div",{className:(0,s.cn)("transition-[padding] duration-300 ease-out-soft",n&&"lg:pr-[300px]"),children:e})}])},911211,e=>{"use strict";var t=e.i(843476),s=e.i(615227),a=e.i(733209),n=e.i(34060),r=e.i(315089),l=e.i(948148);e.s(["ChatButton",0,function(){let e=(0,l.useTranslations)("chat"),{toggle:i,isOpen:o,unread:c}=(0,r.useChat)();return(0,t.jsx)(n.Tooltip,{label:e("chatButton.chat"),children:(0,t.jsxs)("button",{type:"button","aria-label":e("chatButton.chat"),"aria-haspopup":"dialog","aria-expanded":o,onClick:i,className:(0,a.cn)("relative grid h-[34px] w-[34px] place-items-center rounded-md","border border-transparent bg-transparent text-text-2","transition-[background,border-color,color] duration-fast ease-out-soft","hover:border-line-soft hover:bg-surface hover:text-text","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue focus-visible:ring-offset-2 focus-visible:ring-offset-bg",o&&"border-line-soft bg-surface text-text"),children:[(0,t.jsx)(s.MessageCircle,{size:17}),c>0?(0,t.jsx)("span",{className:"absolute -right-1 -top-1 grid h-[15px] min-w-[15px] place-items-center rounded-full bg-blue px-1 text-[9px] font-bold text-blue-on shadow-[0_0_0_2px_var(--bg)]",children:c>9?"9+":c}):null]})})}])},760929,e=>{"use strict";e.i(315089),e.i(529867),e.i(317886),e.i(911211),e.i(646086),e.i(654913),e.i(484705),e.s([])}]);
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.