1"use strict";(self.webpackChunkshop_react_web=self.webpackChunkshop_react_web||[]).push([[6884],{17988:(t,e,a)=>{a.d(e,{A:()=>l});var n=a(65043),i=a(86269),r=a(23178),s=a(61183),o=a(65112),c=a(7685),d=a(56743);const l=()=>{const t=(0,r.W)((t=>t.setDefaultErrorToast)),e=sessionStorage.getItem("shopId"),[a,l]=(0,n.useState)(),[g,h]=(0,n.useState)([]),[u,p]=(0,n.useState)([]),[m,x]=(0,n.useState)({shopId:e,title:"",content:""}),[v,w]=(0,n.useState)({title:"",content:"",newImageUrls:[],imageIdsToRemove:[]}),{data:y,refetch:f,isRefetching:j}=(0,i.iw)(a||0),{mutate:A}=(0,i._t)(),{mutate:$}=(0,i.iV)(),{mutate:W}=(0,i.fH)();return(0,n.useEffect)((()=>{a&&f()}),[a]),(0,n.useEffect)((()=>{y&&((async()=>{if(!y||!y.inquiryImages||0!==y.inquiryImages.length)try{const t=y.inquiryImages.map((async t=>{const{data:e}=await o.A.get("s3/view-presigned-url?fileName=".concat(t.url));return{id:t.id,url:t.url,presignedUrl:e}})),e=await Promise.all(t);p(e)}catch(t){console.error("Error",t)}})(),w({title:y.title,content:y.content,newImageUrls:[],imageIdsToRemove:[]}))}),[y]),{postQuestionParams:m,patchQuestionParams:v,updateParams:(t,e)=>{"postQuestionParams"===t&&e.map((t=>x((e=>({...e,[t.valueName]:t.newValue}))))),"putQuestionParams"===t&&e.map((t=>w((e=>({...e,[t.valueName]:t.newValue})))))},postQuestion:async a=>{try{const t=g.length>0?await(0,s.BU)(d.gA.INQUIRY_IMAGE,g):[];A({shopId:e,title:m.title,content:m.content,imageList:t},{onSuccess:()=>{a()}})}catch(n){console.log("error : ",n),t()}},uploadImageList:g,addMultipleImages:t=>{t.map(((t,e)=>h((a=>[...a,{file:t,previewUrl:URL.createObjectURL(t),fileName:(0,c.xc)((0,c.QC)(t),e)}]))))},removeImage:t=>{h(g.filter(((e,a)=>a!==t)))},removeExistImage:t=>{p((e=>e.filter((e=>e.url!==t.url)))),w((e=>({...e,imageIdsToRemove:[...e.imageIdsToRemove,t.id]})))},putQuestion:async e=>{try{const t=g.length>0?await(0,s.BU)(d.gA.SHOP_SERVE_IMAGE,g):[];$({id:a,patchQuestionParams:{title:v.title,content:v.content,newImageUrls:t,imageIdsToRemove:v.imageIdsToRemove}},{onSuccess:()=>{f(),e()}})}catch(n){console.log("error : ",n),t()}},deleteQuestion:t=>{W(a,{onSuccess:()=>{t()}})},setQuestionId:l,data:y,presignedUrlList:u,isRefetching:j}}},46884:(t,e,a)=>{a.r(e),a.d(e,{default:()=>v});var n=a(65043),i=a(73216),r=a(61158),s=a(97605),o=a(399),c=a(59116),d=a(35509),l=a(20524),g=a(48120),h=a(28568),u=a(7685),p=a(17988),m=a(23178),x=a(70579);const v=()=>{const t=(0,i.Zp)(),{questionId:e}=(0,i.g)(),a=(0,m.W)((t=>t.setToast)),{data:v,deleteQuestion:w,setQuestionId:y,presignedUrlList:f,isRefetching:j}=(0,p.A)(),[A,$]=(0,n.useState)(!1),W=()=>{a("1:1 \ubb38\uc758 \uc0ad\uc81c\uac00 \uc644\ub8cc\ub418\uc5c8\uc5b4\uc694.","success"),t("/cs/question",{replace:!0})};return(0,n.useEffect)((()=>{y(Number(e))}),[]),(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(r.A,{title:"1:1 \ubb38\uc758"}),(0,x.jsxs)(s.He,{padding:"12px 24px",margin:"24px 0 0",$marginWt:"20px 0 0 ",$paddingWt:"12px 16px",children:[(0,x.jsxs)(s.pT,{width:"100%",justify:"space-between",align:"start",padding:"8px 0",margin:"0 0 12px",children:[(0,x.jsxs)(s.pT,{gap:"4px",align:"top",children:[(0,x.jsx)(o.V9,{fontSize:c.$N.size20,fontWeight:c.sO.medium,$lineHeight:c.kj.height28,color:"var(--color-gray-600)",$fontSizeWt:c.$N.size16,$fontWeightWt:c.sO.regular,$lineHeightWt:c.kj.height24,children:"Q."}),(0,x.jsx)(o.V9,{fontSize:c.$N.size20,fontWeight:c.sO.medium,$lineHeight:c.kj.height28,color:"var(--color-gray-600)",$fontSizeWt:c.$N.size16,$fontWeightWt:c.sO.regular,$lineHeightWt:c.kj.height24,children:null===v||void 0===v?void 0:v.title})]}),(0,x.jsxs)(s.pT,{gap:"8px",children:[(0,x.jsx)(o.x5,{$whiteSpace:"pre",color:"var(--color-gray-400)",children:(0,u._V)(null===v||void 0===v?void 0:v.createdAt)}),"AWAITING_RESPONSE"!==(null===v||void 0===v?void 0:v.status)?(0,x.jsx)(d.Ex,{border:"unset",radius:g.A.corner40,padding:"3px 8px",background:"var(--color-primary-50)",color:"var(--color-primary-500-main)",children:"\ub2f5\ubcc0 \uc644\ub8cc"}):(0,x.jsx)(d.Ex,{border:"unset",radius:g.A.corner40,padding:"3px 8px",background:"var(--color-gray-100)",color:"var(--color-gray-500)",children:"\ub2f5\ubcc0 \ub300\uae30"})]})]}),(0,x.jsxs)(s.js,{height:"unset",padding:"24px",background:"var(--color-gray-50)",$paddingWt:"16px",children:[(0,x.jsx)(o.ld,{fontWeight:c.sO.regular,color:"var(--color-gray-600)",children:null===v||void 0===v?void 0:v.content}),!j&&v&&v.inquiryImages&&v.inquiryImages.length>0&&f.length>
10&&(0,x.jsxs)(s.pT,{direction:"column",align:"start",gap:"24px",margin:"24px 0 0",width:"100%",children:[(0,x.jsx)(s.pT,{gap:"8px",wrap:"wrap",justify:"start",children:null===f||void 0===f?void 0:f.map(((t,e)=>(0,x.jsx)(l.n,{width:"90px",height:"90px",children:(0,x.jsx)("div",{children:(0,x.jsx)("img",{src:t.presignedUrl,alt:"\uc774\ubbf8\uc9c0"})})},e)))}),(0,x.jsxs)(s.pT,{padding:"12px 16px",background:"var(--color-white)",radius:g.A.corner16,justify:"start",align:"flex-start",gap:"12px",width:"100%",children:[(0,x.jsxs)(o.x5,{color:"var(--color-gray-400)",fontWeight:c.sO.medium,$whiteSpace:"nowrap",children:["\ucca8\ubd80\ud30c\uc77c ",f.length,"\uac74"]}),(0,x.jsx)(s.pT,{wrap:"wrap",width:"100%",justify:"start",children:f.map(((t,e)=>{var a;return(0,x.jsx)(s.pT,{padding:"0 16px 0 0",children:(0,x.jsx)("a",{download:t.presignedUrl,href:t.presignedUrl,title:"ImageName",children:(0,x.jsx)(o.x5,{color:"var(--color-blue-500-main)",$textDecoration:"underline",children:t.url?null===(a=t.url)||void 0===a?void 0:a.replace("announcementImg/",""):""})})},e)}))})]})]})]})]}),"AWAITING_RESPONSE"!==(null===v||void 0===v?void 0:v.status)&&(0,x.jsxs)(s.He,{padding:"12px 24px",margin:"24px 0 0",$marginWt:"0 0 20px",$paddingWt:"12px 16px",children:[(0,x.jsxs)(s.pT,{width:"100%",justify:"space-between",align:"start",padding:"8px 0",margin:"0 0 12px",children:[(0,x.jsxs)(s.pT,{gap:"4px",align:"top",children:[(0,x.jsx)(o.V9,{fontSize:c.$N.size20,fontWeight:c.sO.medium,$lineHeight:c.kj.height28,color:"var(--color-gray-600)",$fontSizeWt:c.$N.size16,$fontWeightWt:c.sO.regular,$lineHeightWt:c.kj.height24,children:"A."}),(0,x.jsx)(o.V9,{fontSize:c.$N.size20,fontWeight:c.sO.medium,$lineHeight:c.kj.height28,color:"var(--color-gray-600)",$fontSizeWt:c.$N.size16,$fontWeightWt:c.sO.regular,$lineHeightWt:c.kj.height24,children:"\ubbf8\uc74c\uc5d0\uc11c \ub2f5\ubcc0\ub4dc\ub824\uc694!"})]}),(0,x.jsx)(s.pT,{gap:"8px",children:(0,x.jsx)(s.bQ,{width:"76px",children:(0,x.jsx)(o.x5,{color:"var(--color-gray-400)",children:(0,u._V)(null===v||void 0===v?void 0:v.answerCreatedAt)})})})]}),(0,x.jsx)(s.js,{height:"unset",padding:"24px",background:"var(--color-gray-50)",$paddingWt:"16px",children:(0,x.jsx)(o.ld,{fontWeight:c.sO.regular,color:"var(--color-gray-600)",children:null===v||void 0===v?void 0:v.answerContent})})]}),"AWAITING_RESPONSE"===(null===v||void 0===v?void 0:v.status)&&(0,x.jsxs)(s.pT,{margin:"56px 0 0",gap:"16px",$marginWt:"40px 0 0",children:[(0,x.jsx)(d.cO,{width:"240px",onClick:()=>$(!0),children:"\uc0ad\uc81c"}),(0,x.jsx)(d.oT,{width:"240px",onClick:()=>t("/cs/question/edit/".concat(e),{replace:!0}),children:"\uc218\uc815"})]}),(0,x.jsx)(h.A,{modal:A,setModal:$,onSubmit:()=>{w(W)},description:"\ubb38\uc758 \uae00\uc744 \uc0ad\uc81c\ud560\uae4c\uc694?",caption:"\uc0ad\uc81c\ub41c \uc815\ubcf4\ub294 \ub418\ub3cc\ub9b4 \uc218 \uc5c6\uc5b4\uc694."})]})}},86269:(t,e,a)=>{a.d(e,{_t:()=>l,fH:()=>h,iV:()=>g,iw:()=>d,qU:()=>c});var n=a(14365),i=a(93747),r=a(47097),s=a(77249);const o=(0,n.DY)("question",{fetchQuestionList:t=>[t],fetchQuestion:t=>[t]}),c=(t,e)=>(0,i.I)({queryKey:o.fetchQuestionList(t).queryKey,queryFn:()=>(0,s.Z$)(t),select:t=>({content:t.content,pagination:{size:t.empty?0:t.size,totalElements:t.empty?0:t.totalElements,totalPages:t.empty?0:t.totalPages,number:t.empty?0:t.number+1}}),enabled:e}),d=t=>(0,i.I)({queryKey:o.fetchQuestion(t).queryKey,queryFn:()=>(0,s.hT)(t),enabled:!1}),l=()=>(0,r.n)({mutationFn:t=>(0,s.RL)(t)}),g=()=>(0,r.n)({mutationFn:t=>(0,s.B8)(t.id,t.patchQuestionParams)}),h=()=>(0,r.n)({mutationFn:t=>(0,s.ul)(t)})},77249:(t,e,a)=>{a.d(e,{B8:()=>w,Op:()=>I,Pv:()=>l,RL:()=>v,Rv:()=>s,Xn:()=>h,Y2:()=>j,Z$:()=>m,ZV:()=>p,bY:()=>c,cc:()=>W,hT:()=>x,hj:()=>g,md:()=>u,nx:()=>A,rA:()=>$,rW:()=>f,sc:()=>d,uF:()=>o,ul:()=>y});var n=a(54451),i=a(65112),r=a(69835);const s=async t=>{const{data:e}=await n.A.get("/announcements",{params:t});return e},o=async t=>{const{data:e}=await n.A.get("/announcements/".concat(t));return e},c=async t=>{const{data:e}=await r.A.post("/admin/announcement",t);return e.data},d=async t=>{const{data:e}=await n.A.delete("/announcements/".concat(t));return e},l=async t=>{const{data:e}=await r.A.get("/faqs",{params:t});return e.data},g=async()=>{const{data:t}=await r.A.get("/faqs/category");return t.data},h=async t=>{const{data:e}=await n.A.post("/faqs",t);return e},u=async t=>{const{data:e}=await n.A.delete("/faqs/".concat(t));return e},p=async(t,e)=>{const{data:a}=await n.A.patch("/faqs/".concat(t),e);return a},m=async t=>{const{data:e}=await r.A.get("/inquiries",{params:t});return e.data},x=async t=>{const{data:e}=await r.A.get("/inquiries/".concat(t));return e.data},v=async t=>{const{data:e}=await r.A.post("/inquiries",t);return e.data},w=async(t,e)=>{const{data:a}=await r.A.patch("/inquiries/".concat(t),e);return a.data},y=async t=>{const{data:e}=await r.A.delete("/inquiries/".concat(t));return e.data},f=async t=>{const{data:e}=await i.A.get("/admin/blog",{params:t});return e},j=async t=>{const{data:e}=await i.A.get("/admin/blog/".concat(t));return e},A=async t=>{const{data:e}=await i.A.get("/admin/blog/tag",{params:t});return e},$=async t=>{const{data:e}=await i.A.post("/admin/blog",t);return e},W=async t=>{const{data:e}=await i.A.delete("/admin/blog/".concat(t));return e},I=async(t,e)=>{const{data:a}=await i.A.put("/admin/blog/".concat(t),e);return a}},20524:(t,e,a)=>{a.d(e,{n:()=>d});var n,i,r=a(57528),s=a(5464),o=a(81293),c=a(48120);const d=s.Ay.div(n||(n=(0,r.A)(["\n\tposition: relative;\n\twidth: ","; /* \ucd5c\ub300 \ub108\ube44\ub97c \uc81c\uac70\ud558\uace0 \uace0\uc815 \ub108\ube44\ub85c \uc124\uc815 */\n\theight: ","; /* \ucd5c\ub300 \ub192\uc774\ub97c \uc81c\uac70\ud558\uace0 \uace0\uc815 \ub192\uc774\ub85c \uc124\uc815 */\n\n\tdiv {\n\t\tposition: relative;\n\t\twidth: 100%; /* div\ub97c FileImgBox\uc640 \uac19\uc740 \ud06c\uae30\ub85c \uc124\uc815 */\n\t\theight: 100%; /* div\ub97c FileImgBox\uc640 \uac19\uc740 \ud06c\uae30\ub85c \uc124\uc815 */\n\t\tborder-radius: ",";\n\t\toverflow: hidden;\n\n\t\timg {\n\t\t\twidth: 100%;\n\t\t\theight: 100%;\n\t\t\tobject-fit: cover; /* \uc774\ubbf8\uc9c0\uac00 div \ud06c\uae30\uc5d0 \ub9de\uac8c \uc798\ub9ac\ub3c4\ub85d \uc124\uc815 */\n\t\t}\n\t}\n\n\t@media (max-width: ",") {\n\t\twidth: ",";\n\t\theight: ",";\n\t}\n"])),(t=>t.width||"120px"),(t=>t.height||"120px"),c.A.corner8,o.A.wideTablet,(t=>{var e;return null!==(e=t.$widthWt)&&void 0!==e?e:t.$widthWt}),(t=>{var e;return null!==(e=t.$heightWt)&&void 0!==e?e:t.$heightWt}));s.Ay.div(i||(i=(0,r.A)(["\n\tmax-width: 120px;\n\tmax-height: 120px;\n\twidth: 100%;\n\theight: 100%;\n\tpadding: 48px;\n\t// margin: 0 auto;\n\tborder: 1px solid var(--color-gray-200);\n\tborder-radius: ",";\n\tbackground: var(--color-gray-100);\n\n\timg {\n\t\twidth: 24px;\n\t\theight: 24px;\n\t}\n"])),c.A.corner8)},61158:(t,e,a)=>{a.d(e,{A:()=>d});var n=a(73216),i=a(97605),r=a(399),s=a(8720),o=a(59116),c=a(70579);const d=t=>{const{title:e,hasOnlyTitle:a,backMode:d,setModal:l,onClose:g}=t,h=(0,n.Zp)();
1return(0,c.jsxs)(i.pT,{justify:"start",gap:"8px",children:[!a&&(0,c.jsx)(s.A,{width:"30px",height:"30px",$widthWt:"24px",$heightWt:"24px",handleBack:()=>{g?g():"formBack"===d?null===l||void 0===l||l(!0):h(-1)}}),(0,c.jsx)(r.V9,{fontSize:o.$N.size24,$lineHeight:o.kj.height32,$fontSizeWt:o.$N.size20,$lineHeightWt:o.kj.height28,$whiteSpace:"nowrap",children:e})]})}}}]); 2//# sourceMappingURL=6884.032682d3.chunk.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.