PageSourceSearch

https://solvook.com/_next/static/chunks/pages/labs/[author]/qna/[id]-23bc09a858910fcc.js

js solvook.com collected 2026-10-09 02:01:36 UTC 12,170 bytes, 2 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5811],{75951:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/labs/[author]/qna/[id]",function(){return n(52823)}])},33590:function(e,t,n){"use strict";var l=n(36492),r=n(11163),i=n(15636),a=n(67847);let s=()=>{let e=(0,r.useRouter)(),{qnaId:t}=e.query,n=(0,a.o)(e=>e.brand.name),{data:s,error:o,isError:c}=(0,l.a)(["qnaItemDetail",n,t],()=>(0,i.Wu)({name:n,postId:t}),{enabled:!!t&&!!n,retry:1,cacheTime:0});return{qnaItemDetail:s,error:o,isError:c}};t.Z=s},52823:function(e,t,n){"use strict";n.r(t),n.d(t,{__N_SSP:function(){return K},default:function(){return W}});var l=n(85893),r=n(35707),i=n(28331),a=n(38138),s=n(93627),o=n(44012),c=n(56746),d=n(73209),u=n(92696),p=n(5616),x=n(15861),m=n(67720),y=n(90948),f=n(48228),h=n(85945),v=n(29204),g=n(25675),C=n.n(g),j=n(11163),b=n(67294),k=n(15636),w=n(67847),T=n(79404),Z=n(68977),B=n(33590),N=n(84956),P=n(2734),A=n(24153),I=n(72313),D=n(10984);let Q=(0,y.ZP)(e=>(0,l.jsx)(D.Z,{multiline:!0,minRows:1,fullWidth:!0,...e}))(e=>{let{theme:t}=e;return{backgroundColor:t.palette.common.white,borderRadius:"6px","& .MuiOutlinedInput-root":{borderRadius:"6px",padding:"12px 16px","& fieldset":{borderColor:t.palette.grey[200]},"&:hover fieldset":{borderColor:t.palette.grey[300]},"&.Mui-focused fieldset":{borderWidth:"1px",borderColor:t.palette.grey[700]},"&.Mui-error":{backgroundColor:t.palette.red[0],"& fieldset":{borderColor:t.palette.status.error}}},"& .MuiOutlinedInput-input":{...t.typography.body1},"& .MuiFormHelperText-root":{marginLeft:"8px",marginTop:"8px"}}}),S=e=>{let{content:t,onChange:n,onCancel:r,onSave:i,error:a}=e;return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(Q,{value:t,onChange:n,placeholder:"댓글을 수정하세요.",error:a,helperText:a?"댓글을 입력해주세요.":""}),(0,l.jsxs)(p.Z,{sx:{display:"flex",justifyContent:"flex-end",gap:"8px"},children:[(0,l.jsx)(u.zx,{variant:"soft",label:"취소",onClick:r}),(0,l.jsx)(u.zx,{variant:"solid",label:"수정",onClick:i})]})]})},O=e=>{let{brandUser:t,userName:n,repliesData:r,onSaveEdit:s,onDeleteReply:o}=e,d=(0,P.Z)(),[u,m]=(0,b.useState)(null),[y,f]=(0,b.useState)(!1),h=(e,t)=>{m({id:e,content:t}),(0,c.f2)("Post Management Button Clicked",{Position:"Brand Q&A comment","Button Name":"수정하기"})},v=()=>{m(null)},g=e=>{if(!(null==u?void 0:u.content.trim())){f(!0);return}s(e,u.content),m(null)},j=e=>{m({...u,content:e.target.value}),y&&f(!1)};return(0,l.jsx)(l.Fragment,{children:null==r?void 0:r.map(e=>(0,l.jsxs)(U,{children:[(0,l.jsxs)(p.Z,{display:"flex",justifyContent:"space-between",children:[(0,l.jsxs)(p.Z,{sx:{display:"flex",alignItems:"center",gap:"4px"},children:[(0,l.jsxs)(x.Z,{variant:"subtitle1",sx:{display:"flex",alignItems:"center",gap:"8px"},children:[(0,l.jsx)(C(),{src:e.writerThumbnailUrl,alt:"".concat(e.writerNickname,"의 프로필 이미지"),width:24,height:24,style:{borderRadius:"50%"}}),e.writerNickname]}),t!==e.writerNickname&&(0,l.jsxs)(x.Z,{variant:"body1",color:"text.secondary",sx:{display:"flex",alignItems:"center",gap:"4px"},children:[(0,l.jsx)(i.Z,{icon:a.oT,size:a.u8.xxsmall,color:d.palette.text.secondary}),A.Fv[e.writerType]]})]}),(null==u?void 0:u.id)!==e.replyId&&!e.isDeleted&&e.isOwn&&(0,l.jsx)(I.Z,{onEditClick:()=>h(e.replyId,e.contents),onDeleteClick:()=>o(e.replyId)})]}),(null==u?void 0:u.id)===e.replyId?(0,l.jsx)(S,{content:u.content,onChange:j,onCancel:v,onSave:()=>g(e.replyId),error:y}):(0,l.jsx)(_,{reply:e})]},e.replyId))})},_=e=>{let{reply:t}=e;return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(x.Z,{variant:"body1",sx:{whiteSpace:"pre-wrap",a:{}},color:t.isDeleted?"grey.300":"text.primary",children:t.isDeleted?"작성자에 의해 삭제된 댓글이에요.":(e=>{let t=[],n=0,r=Array.from(e.matchAll(/((https?:\/\/)?(www\.)?[^\s]+(\.[^\s]+)+)/gi));for(let a of r){var i;let[r]=a,s=null!==(i=a.index)&&void 0!==i?i:0;if(n<s){let l=e.slice(n,s);t.push(l)}let o=r.startsWith("http")?r:"http://".concat(r);t.push((0,l.jsx)(x.Z,{component:"a",href:o,target:"_blank",rel:"noopener noreferrer",color:"secondary.main",children:r},s)),n=s+r.length}return n<e.length&&t.push(e.slice(n)),t})(t.contents)}),(0,l.jsxs)(x.Z,{variant:"body2",color:"text.secondary",sx:{span:{color:"grey.300"}},children:[(0,N.$)(t.createdAt),t.isEdited&&(0,l.jsx)("span",{children:" (수정됨)"})]})]})},U=(0,y.ZP)(p.Z)(e=>{let{theme:t}=e;return{display:"flex",flexDirection:"column",gap:"16px",padding:"32px 0",borderBottom:"1px solid ".concat(t.palette.divider)}}),E={confirm:{title:"Q&A를 삭제할까요?",content:"삭제한 Q&A는 더 이상 노출되지 않으며, 복구할 수 없어요.",okText:"삭제",cancelText:"취소"},success:{title:"Q&A를 삭제했어요.",severity:"success",okText:"확인"},edit:{title:"답변이 완료된 Q&A는 수정 할 수 없어요.",content:"추가 질문이 있다면 댓글로 작성해주세요.",severity:"caution",okText:"확인"},access:{title:"비공개 게시글이에요.",content:"작성자와 브랜드만 열람할 수 있어요.",severity:"caution",okText:"확인"},public:{title:"공개 게시글로 변경할까요?",content:"공개 게시글은 누구나 제한없이 볼 수 있어요.",okText:"변경하기",cancelText:"취소"},private:{title:"비공개 게시글로 변경할까요?",content:"비공개 게시글은 작성자와 브랜드만 열람할 수 있어요.",okText:"변경하기",cancelText:"취소"},delete:{title:"댓글을 삭제할까요?",content:"삭제하면 댓글 내용이 더 이상 표시되지 않아요.",okText:"삭제",cancelText:"취소"},deleted:{title:"삭제된 게시글이에요.",okText:"확인"},error:{title:"다시 한번 확인해주세요.",severity:"caution",okText:"확인"}},R={privateSuccess:{icon:"success",text:"비공개 게시글로 변경했어요."},publicSuccess:{icon:"success",text:"공개 게시글로 변경했어요."},warning:{icon:"warning",text:"문제가 발생했어요. 다시 시도해주세요."},replySuccess:{icon:"success",text:"댓글을 등록했어요."},replyUpdateSuccess:{icon:"success",text:"댓글을 수정했어요."},replyDeleteSuccess:{icon:"success",text:"댓글을 삭제했어요."}},M=()=>{let e=(0,j.useRouter)(),{qnaId:t}=e.query,n=(0,w.o)(e=>e.brand.name),r=(0,w.o)(e=>e.brand.nickname),y=(0,w.o)(e=>e.brand.title),g=(0,w.o)(e=>e.brand.profileImageUrl),{user:N}=(0,o.tN)(),{isOpen:P,open:A,dialogProps:I}=(0,s.Z)(),{isOpen:D,open:S}=(0,s.Z)(),{showSnackbar:_}=(0,Z.NZ)(R),{qnaItemDetail:U,error:M,isError:H}=(0,B.Z)(),J=(null==N?void 0:N.displayName)===r,K=(null==U?void 0:U.isOwn)||J,W=(0,f.D)(k.is),L=(0,f.D)(k.NE),X=(0,f.D)(k.W_),$=(0,f.D)(k.pC),G=(0,f.D)(k.ef),V=(0,h.NL)(),[Y,ee]=(0,b.useState)(""),[et,en]=(0,b.useState)(!1),el={Positon:"Brand Q&A","Brand Name":y,Title:null==U?void 0:U.title},er=()=>{"waiting"===U.status?e.push((0,d.nx)(n,t)):A({...E.edit})},ei=(0,b.useCallback)(()=>{(0,c.f2)("Post Management Button Clicked",{...el,"Button Name":"".concat((null==U?void 0:U.isPrivate)?"공개":"비공개","로 변경하기")}),A({...(null==U?void 0:U.isPrivate)?E.public:E.private,onOk:async()=>{try{let e=await L.mutateAsync({name:n,postId:t,isPrivate:!(null==U?void 0:U.isPrivate)});"OK"===e&&(_((null==U?void 0:U.isPrivate)?"publicSuccess":"privateSuccess"),V.invalidateQueries(["qnaItemDetail",n,t]))}catch(e){_("warning")}}})},[U,n,t,L,V]),ea=()=>{(0,c.f2)("Post Management Button Clicked",{...el,"Button Name":"삭제하기"}),A({...E.confirm,onOk:async()=>{try{let e=await W.mutateAsync({name:n,postId:t});"OK"===e&&S()}catch(t){A({...E.error,onOk:()=>{e.push((0,d.J8)(n))}})}}})},es=async(e,l)=>{(0,c.f2)("Add Comment Button Clicked",{"Post Category":"Brand Q&A","Button Name":"수정",Title:null==U?void 0:U.title,"Brand Name":y,"User Type":J?"브랜드":"질문자"});try{let r=await $.mutateAsync({name:n,postId:t,replyId:e,contents:l});"OK"===r&&(_("replyUpdateSuccess"),V.invalidateQueries(["qnaItemDetail",n,t]),(0,c.f2)("Comment Upload Completed",{"Post Category":"Brand Q&A","Action Type":"Edit",Title:null==U?void 0:U.title,"Brand Name":y,"User Type":J?"브랜드":"질문자"}))}catch(e){_("warning")}},eo=async e=>{(0,c.f2)("Post Management Button Clicked",{...el,Position:"Brand Q&A comment","Button Name":"삭제하기"}),A({...E.delete,onOk:async()=>{try{let l=await G.mutateAsync({name:n,postId:t,replyId:e});"OK"===l&&(_("replyDeleteSuccess"),V.invalidateQueries(["qnaItemDetail",n,t]),(0,c.f2)("Comment Delete Completed",{"Post Category":"Brand Q&A",Title:null==U?void 0:U.title,"Brand Name":y,"User Type":J?"브랜드":"질문자"}))}catch(e){_("warning")}},onCancel:()=>{(0,c.f2)("Popup Button Clicked",{"Button Name":"취소","Popup Title":"댓글을 삭제할까요?","Popup Type":"Delete Q&A Comment","Button URL":null})}})},ec=async()=>
1{if(!Y.trim()){en(!0);return}en(!1),(0,c.f2)("Add Comment Button Clicked",{"Post Category":"Brand Q&A","Button Name":"등록하기",Title:null==U?void 0:U.title,"Brand Name":y,"User Type":J?"브랜드":"질문자"});try{let e=await X.mutateAsync({name:n,postId:t,contents:Y});"OK"===e&&(_("replySuccess"),V.invalidateQueries(["qnaItemDetail",n,t]),ee(""),(0,c.f2)("Comment Upload Completed",{"Post Category":"Brand Q&A","Action Type":"New","Brand Name":y,Title:null==U?void 0:U.title,"User Type":J?"브랜드":"질문자"}))}catch(e){_("warning")}};return((0,b.useEffect)(()=>{if((0,v.IZ)(M)&&!P){var t;let l=null===(t=M.response)||void 0===t?void 0:t.status,r={500:E.access,403:E.access,422:E.deleted}[l]||E.error;A({...r,onOk:()=>e.push((0,d.J8)(n)),onClose:()=>{}})}},[M,H,P,A,e,n]),!U&&H)?(0,l.jsx)(u.QH,{...I}):(0,l.jsxs)(q,{children:[(0,l.jsx)(T.Z,{detailContent:U,onEditClick:er,onDeleteClick:ea,onPrivateClick:ei}),(0,l.jsx)(p.Z,{sx:{display:"flex",justifyContent:"center"},children:(0,l.jsx)(u.zx,{href:(0,d.J8)(n),variant:"strokeSecondary",label:(0,l.jsxs)(x.Z,{variant:"subtitle2",sx:{display:"flex",alignItems:"center",gap:"4px"},children:["Q&A 전체보기",(0,l.jsx)(i.Z,{icon:a.ol,size:a.u8.smallHalf})]}),onClick:()=>{(0,c.f2)("More Button Clicked",{"Button Name":"Q&A 전체보기","Button Type":"Brand Q&A","Button URL":(0,d.J8)(n),"UI Type":"text"})},sx:{width:"fit-content"}})}),(0,l.jsx)(m.Z,{}),(0,l.jsxs)(z,{children:[(0,l.jsxs)(p.Z,{children:[(0,l.jsxs)(x.Z,{variant:"h6",sx:{display:"flex",gap:"6px",span:{color:"blue.400"}},children:["댓글",(0,l.jsx)("span",{children:null==U?void 0:U.replyCount})]}),(0,l.jsx)(x.Z,{variant:"body2",color:"grey.300",children:"질문 작성자와 브랜드만 등록할 수 있어요."})]}),(0,l.jsx)(O,{brandUser:r,userName:null==N?void 0:N.displayName,repliesData:null==U?void 0:U.replies,onSaveEdit:es,onDeleteReply:eo}),K&&(0,l.jsxs)(F,{children:[(0,l.jsxs)(p.Z,{sx:{display:"flex",alignItems:"center",gap:"8px"},children:[(0,l.jsx)(C(),{src:J?g:null==U?void 0:U.writerProfileImageUrl,alt:"user profile image",width:24,height:24,style:{borderRadius:"50%"}}),(0,l.jsx)(x.Z,{variant:"subtitle1",children:"댓글 작성"})]}),(0,l.jsx)(Q,{placeholder:"댓글을 작성해주세요.",value:Y,onChange:e=>{ee(e.target.value),et&&en(!1)},error:et,helperText:et?"댓글을 작성 후 등록해주세요.":""}),(0,l.jsx)(p.Z,{sx:{display:"flex",justifyContent:"flex-end"},children:(0,l.jsx)(u.zx,{variant:"solid",label:"등록하기",onClick:ec})})]})]}),(0,l.jsx)(u.QH,{...I}),(0,l.jsx)(u.QH,{open:D,onOk:()=>e.push((0,d.J8)(n)),...E.success})]})},q=(0,y.ZP)(p.Z)(e=>{let{theme:t}=e;return{display:"flex",flexDirection:"column",gap:"32px",".editable-false":{border:"none",borderRadius:0,".editor-inner":{padding:0}},[t.breakpoints.down("lg")]:{margin:"0 32px"},[t.breakpoints.down("sm")]:{margin:"0 20px"}}}),z=(0,y.ZP)(p.Z)(e=>{let{theme:t}=e;return{display:"flex",flexDirection:"column",gap:"16px"}}),F=(0,y.ZP)(p.Z)(e=>{let{theme:t}=e;return{display:"flex",flexDirection:"column",gap:"16px",borderRadius:"8px"}});var H=n(37565);let J=e=>{let{author:t,labDataResult:n}=e;return(0,l.jsx)(r.z,{config:{...r.O,editable:!1},children:(0,l.jsx)(M,{})})};var K=!0,W=(0,H.xN)(J)}},function(e){e.O(0,[3662,1226,5970,9143,7565,6721,3519,9774,2888,179],function(){return e(e.s=75951)}),_N_E=e.O()}]);
2//# sourceMappingURL=[id]-23bc09a858910fcc.js.map

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.