1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3774],{20226:(e,t,s)=>{"use strict";s.r(t),s.d(t,{__N_SSP:()=>p,default:()=>w});var i=s(37876),n=s(82851),a=s.n(n),l=s(89099),c=s(29713),o=s(14232),r=s(20206),m=s(87296),u=s(10717),d=s(93789),h=s(53972),g=s(34642),x=s(84549),f=s(1041),p=!0;function w(e){let{metaInfo:t,...s}=e,{t:n}=(0,c.Bd)("common"),p=(0,l.useRouter)(),[w,j]=(0,o.useState)(null),[v,_]=(0,o.useState)(!1),[N,y]=(0,o.useState)(!1),[S,b]=(0,o.useState)(null),[C,k]=(0,o.useState)(!1);(0,o.useEffect)(()=>{let e=(0,f.IA)("user_id"),t=!a().isEmpty(e);if(b(t),!t)return void k(!0);let s=(0,x.PT)();if(!s)return void p.replace("/cheering-message");j(s)},[p]);let T=(0,o.useCallback)(()=>{let e=new URLSearchParams;(null==w?void 0:w.messageType)&&e.set("message-type",w.messageType),(null==w?void 0:w.source)&&e.set("source",w.source),(null==w?void 0:w.utmSource)&&e.set("utm_source",w.utmSource),(null==w?void 0:w.utmMedium)&&e.set("utm_medium",w.utmMedium),(null==w?void 0:w.utmCampaign)&&e.set("utm_campaign",w.utmCampaign);let t=e.toString();p.push("/cheering-message".concat(t?"?".concat(t):""))},[p,w]),M=(0,o.useCallback)(async()=>{if(w){_(!0);try{await (0,g.xC)();let e={athleteName:w.athleteName,nickname:w.nickname,message:w.message};w.messageType&&(e.messageType=w.messageType),w.source&&(e.source=w.source),w.utmSource&&(e.utmSource=w.utmSource),w.utmMedium&&(e.utmMedium=w.utmMedium),w.utmCampaign&&(e.utmCampaign=w.utmCampaign),await (0,h.u)("POST","v2/athlete-messages",null,e),y(!0)}catch(e){console.error("Failed to submit cheering message:",e),alert(n("cheeringMessage.error.submitFailed"))}finally{_(!1)}}},[w]),P=(0,o.useCallback)(()=>{(0,x._3)();let e=(0,x.oz)();if((0,x.dV)(),e&&1)try{let t=new URL(e,window.location.origin),s=window.location.origin;if(t.origin===s&&("https:"===t.protocol||"http:"===t.protocol)){window.location.href=t.toString();return}}catch(e){}p.push("/")},[p]);return null===S||!w&&S?(0,i.jsx)(u.A,{metaInfo:t,...s,children:(0,i.jsx)("div",{className:"flex justify-center items-center min-h-screen",children:(0,i.jsx)("div",{className:"text-white",children:"Loading..."})})}):S?w?(0,i.jsxs)(u.A,{metaInfo:t,...s,children:[(0,i.jsx)(r.Z3,{children:(0,i.jsxs)("div",{className:"flex flex-col min-h-[calc(100dvh-104px)] md:min-h-[calc(100dvh-150px)] lg:min-h-[calc(100dvh-174px)]",children:[(0,i.jsx)(r.f0,{formData:w}),(0,i.jsxs)("div",{className:"flex flex-col items-center mt-auto pt-10",children:[(0,i.jsx)(m.A,{title:n("cheeringMessage.button.send"),onClick:()=>void M(),className:"w-[343px] h-[48px] text-body-md-400",disabled:v}),(0,i.jsx)("button",{className:"text-white text-body-md-400 mt-6",onClick:T,disabled:v,children:n("cheeringMessage.button.edit")})]})]})}),(0,i.jsx)(r.PC,{isVisible:N,onClose:P})]}):(0,i.jsx)(u.A,{metaInfo:t,...s,children:(0,i.jsx)("div",{className:"flex justify-center items-center min-h-screen",children:(0,i.jsx)("div",{className:"text-white",children:"Loading..."})})}):(0,i.jsxs)(u.A,{metaInfo:t,...s,children:[(0,i.jsx)("div",{className:"flex justify-center items-center min-h-screen",children:(0,i.jsx)("div",{className:"text-white",children:"Loading..."})}),(0,i.jsx)(d.A,{isVisible:C,handlePress:e=>{if(k(!1),e)(0,g.Kq)();else{let e=(0,x.oz)();if((0,x.dV)(),e&&1)try{let t=new URL(e,window.location.origin),s=window.location.origin;if(t.origin===s&&("https:"===t.protocol||"http:"===t.protocol)){window.location.href=t.toString();return}}catch(e){}p.push("/")}},...s})]})}},99859:(e,t,s)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/cheering-message/confirm",function(){return s(20226)}])}},e=>{e.O(0,[3510,8230,4587,4e3,6012,350,717,206,636,6593,8792],()=>e(e.s=99859)),_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.