PageSourceSearch

https://opencreators.ai/assets/GiftConfirmationPage-43VnMTKk.js

js opencreators.ai collected 2026-10-05 12:24:16 UTC 2,874 bytes, 1 lines download raw bytes

1import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{bt as t,dt as n,pt as r,ut as i,wt as a}from"./vendor-Bb9yCo9K.js";import{t as o}from"./vendor-i18n-C715PcBm.js";import{a as s,t as c}from"./client-Bcq1k1Ig.js";import{d as l}from"./session-CrIHvR3Q.js";import{h as u}from"./index-Bbv-53qk.js";import{t as d}from"./RemoteImage-B6DlP5IB.js";import{t as f}from"./FlatButton-BI8FL2Ro.js";import{n as p}from"./requireAuth-BnC0dj73.js";import{t as m}from"./vendor-lottie-Dx0UtmE2.js";import{t as h}from"./messages-C2YBOuyj.js";var g=e(a(),1),_=e(m(),1),v=`https://assets.opencreators.ai/assets/gift-box-opening-DJTnKtnL.json`,y={page:`_page_1mgj8_1`,sender:`_sender_1mgj8_12`,creatorAvatar:`_creatorAvatar_1mgj8_19`,reward:`_reward_1mgj8_41`,giftAnimation:`_giftAnimation_1mgj8_56`,primaryButton:`_primaryButton_1mgj8_62`},b=t(),x=_.default.default,S=`openReward`;function C(e){let t=new URLSearchParams(e);t.delete(S);let n=t.toString();return n?`?${n}`:``}function w(e,t){let n=new URLSearchParams(t);n.set(S,`1`);let r=n.toString();return`/i/${e}${r?`?${r}`:``}`}function T(){let{t:e}=o(),t=i(),{username:a}=n(),[m]=r(),_=(0,g.useRef)(!1),[T,E]=(0,g.useState)(!1),[D,O]=(0,g.useState)(null),[k,A]=(0,g.useState)(null),j=D?.guid,M=D?.nickname||D?.usernameTK||D?.username||``,N=D?.avatarUrl||``,P=(0,g.useCallback)(async()=>{if(!(!a||!j||T)){E(!0);try{let e=await h(j,m);u(j,{avatarUrl:D?.avatarUrl,creatorName:M,profileUsername:D?.username||a}),t(`/creator-chat/${j}${C(m)}`,{state:{avatarUrl:D?.avatarUrl,creatorName:M,giftMessages:e,profileUsername:D?.username||a}})}catch(e){if(s(e))return;if(e instanceof c&&e.status===401){p(w(a,m));return}throw e}finally{E(!1)}}},[D,j,M,t,T,m,a]);return(0,g.useEffect)(()=>{m.get(S)!==`1`||_.current||!j||(_.current=!0,P())},[j,P,m]),(0,g.useEffect)(()=>{if(!a)return;let e=!1;return l(a).then(t=>{e||O(t)}).catch(()=>{e||O(null)}),()=>{e=!0}},[a]),(0,g.useEffect)(()=>{let e=!1;return fetch(v).then(e=>e.ok?e.json():null).then(t=>{e||A(t)}).catch(()=>{e||A(null)}),()=>{e=!0}},[]),(0,b.jsxs)(`main`,{className:y.page,children:[(0,b.jsxs)(`section`,{className:y.sender,"aria-label":e(`giftConfirmation.senderLabel`),children:[(0,b.jsx)(d,{className:y.creatorAvatar,sources:[N],alt:``,size:52}),(0,b.jsx)(`h1`,{children:M}),(0,b.jsx)(`p`,{children:e(`giftConfirmation.sentGift`)})]}),(0,b.jsxs)(`section`,{className:y.reward,"aria-label":e(`giftConfirmation.rewardLabel`),children:[k?(0,b.jsx)(x,{animationData:k,"aria-hidden":`true`,className:y.giftAnimation,loop:!0,rendererSettings:{preserveAspectRatio:`xMidYMid meet`}}):(0,b.jsx)(`div`,{className:y.giftAnimation,"aria-hidden":`true`}),(0,b.jsx)(`p`,{children:e(`giftConfirmation.waiting`)})]}),(0,b.jsx)(f,{className:y.primaryButton,onClick:()=>void P(),disabled:!j,loading:T,variant:`primary`,children:e(`giftConfirmation.openReward`)})]})}export{T as GiftConfirmationPage};

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.