Build 574548stable
Module 660184
4,293 characters · in no known chunkDependencies
Source Raw
function(e,t,n){"use strict";n.d(t,{A:()=>P});var i=n(627968),r=n(64700),s=n(503698),a=n.n(s),o=n(508425),l=n(559949),u=n(17928),c=n(36075),d=n(602853),_=n(661531),h=n(614820),f=n(775602),E=n(248778),p=n(945096),m=n(310784),g=n.n(m),A=n(998304),I=n(898985),T=n(824994),S=n(922301),N=n(750656);let C="--custom-display-name-styles-main-color";n(321073);var y=n(308050),O=n(912051),R=n(564039);let v=(0,y.A)();function b(e){let{name:t,emojiClassName:n,letterClassName:s,wordClassName:a,colors:o}=e,l=r.useMemo(()=>{let e=0,r=0,l=[],u=[],c=()=>{if(0===u.length)return;let e=u;u=[],null!=a?l.push((0,i.jsx)("span",{className:a,children:e},`word-${l.length}`)):l.push(...e)};return(0,O.p)(t).forEach((t,a)=>{v.lastIndex=0;let d=v.test(t);if(0===t.trim().length){c(),l.push((0,i.jsx)("span",{children:t},`space-${a}`));return}let _=null!=o&&o.length>0&&!d?o[e%o.length]:void 0,h=null!=_?{color:_}:void 0;null==s||d||(h={...h,"--custom-letter-index":r}),u.push((0,i.jsx)("span",{className:d?n:s,style:h,children:t},a)),!d&&(e++,r++)}),c(),l},[t,o,n,s,a]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("span",{className:R.Q,children:t}),(0,i.jsx)("span",{"aria-hidden":!0,children:l})]})}var L=n(73392),D=n(875358);let w=[l.x.CHERRY_BOMB,l.x.CHICLE],P=r.memo(function(e){let{userName:t,displayNameStyles:n,effectDisplayType:s=S.G.STATIC,inProfile:l=!1,textClassName:m,loop:y=!1,shouldWrap:O=!1,boldFontOpacity:R=1,shouldUnderlineOnHover:v=!1,appendedInlineContent:P}=e,M=(0,E.DW)("UserNameWithEffects"),x=(0,p.sx)(n,M),U=(0,L.a)({displayNameStyles:x}),{useReducedMotion:k}=(0,u.cf)([f.Ay],()=>({useReducedMotion:f.Ay.useReducedMotion})),G=(0,T.W)({location:"UserNameWithEffects"}),V=(0,d.r)(_.A.colors.BACKGROUND_BASE_LOW).hex(),F=x?.effectId??o.z.SOLID,B=(0,h.O)(t),H=(0,c.CR)(B,F===o.z.TOON?D.Zg:void 0),j=function(e){let{displayNameStyles:t,backgroundColor:n}=e,i=(0,u.bG)([f.Ay],()=>f.Ay.desaturateUserColors?f.Ay.saturation:1),s=t?.effectId??o.z.SOLID,a=(0,I._)(s);return r.useMemo(()=>null==t?[]:t.colors.map(e=>(0,A.lZ)({foreground:g()(e),background:s===o.z.TOON?g()("#333"):g()(n),ratio:a.minContrastRatio,saturationFactor:i}).hex()),[t,s,a.minContrastRatio,i,n])}({displayNameStyles:G?x:null,backgroundColor:V});if(!G||null==x)return(0,i.jsxs)(i.Fragment,{children:[t," ",P]});let W=function(e,t){var n,i,r;let{shouldWrap:s=!1,fontOpacity:a=1,nameLength:l=0}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},u={};switch(e){case o.z.GRADIENT:case o.z.GLOW:u=0===(n=t).length?{}:{"--custom-display-name-styles-gradient-stops":1===n.length?`${n[0]}, ${n[0]}`:n.map((e,t)=>`${e} ${10+80*t/(n.length-1)}%`).join(", "),[C]:n[0]};break;case o.z.PRISM:i=t,r=l,u=0===i.length?{}:{"--custom-display-name-styles-prism-stops":Array.from({length:i.length+1},(e,t)=>`${i[t%i.length]} ${(100*t/i.length).toFixed(3)}%`).join(", "),"--custom-display-name-styles-prism-cycle":`max(${r}ch, ${N.LP}px)`,[C]:i[0]};break;case o.z.GUMMY:case o.z.NEON:case o.z.POP:case o.z.TOON:case o.z.SOLID:default:t.length>0&&(u=function(e){let{main:t,light1:n,light2:i,dark1:r,dark2:s,toonStroke:a,neonStroke:o}=(0,p.$0)(e);return{[C]:t,"--custom-display-name-styles-light-1-color":n,"--custom-display-name-styles-light-2-color":i,"--custom-display-name-styles-dark-1-color":r,"--custom-display-name-styles-dark-2-color":s,"--custom-display-name-styles-toon-stroke-color":a,"--custom-display-name-styles-neon-stroke-color":o}}(t[0]))}return{...u,"--custom-display-name-styles-wrap":s?"wrap":"nowrap","--custom-display-name-styles-font-opacity":a}}(F,j,{shouldWrap:O,fontOpacity:w.includes(x.fontId)?R:1,nameLength:B?.length??0}),Y=function(e){switch(e){case o.z.GRADIENT:case o.z.GLOW:return D.D7;case o.z.PRISM:return D.Wj;case o.z.NEON:return D.lw;case o.z.TOON:return D.lQ;case o.z.POP:return D.uY;case o.z.GUMMY:return D.Y0;case o.z.SOLID:default:return D.QJ}}(F),K=s!==S.G.PLAIN,$=s===S.G.ANIMATED&&!k,z=(0,i.jsx)("div",{className:a()(D.kL,U,m,{[D.rD]:K,[D.CS]:$,[D.HW]:y,[D.$E]:l,[D.Tn]:null!=P,[D._j]:O}),style:W,children:(0,i.jsx)("span",{"data-username-with-effects":B,className:a()(D.WH,Y,{[D._W]:v}),children:F===o.z.GUMMY&&K?(0,i.jsx)(b,{name:B??"",emojiClassName:D.Zg,letterClassName:$?D.M4:void 0,wordClassName:D.qf,colors:j}):H})});return null!=P?(0,i.jsxs)("div",{className:D.g8,children:[z,P]}):z})}