PageSourceSearch

https://www.wame.is/_next/static/chunks/0a8mzlwjro~mf.js

js wame.is collected 2026-10-09 22:41:40 UTC 82,730 bytes, 1 lines download raw bytes

1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,2764,e=>{"use strict";var t,r,l=e.i(43476),n=e.i(71645),a=e.i(48148),s=e.i(22016),i=e.i(61745),o=e.i(22886),d=((t={}).NOTICE="NOTICE",t.SCHOLAR="SCHOLAR",t.GENERAL="GENERAL",t.LINK="LINK",t),c=((r={}).SUBJECT="TITLE",r.CONTENT="CONTENT",r.NICKNAME="NICK_NAME",r);let u=[{id:1,title:"Notice",type:d.GENERAL},{id:2,title:"Dev Log",type:d.GENERAL},{id:3,title:"Game Guide",type:d.GENERAL},{id:4,title:"Game Review",type:d.GENERAL},{id:5,title:"Game News",type:d.GENERAL},{id:6,title:"Game Event",type:d.GENERAL},{id:7,title:"Discord Notice",type:d.GENERAL}],m={0:"MAIN",1:"NOTICE",2:"DEV_LOG",3:"GAME_GUIDE",4:"GAME_REVIEW",5:"GAME_NEWS",6:"GAME_EVENT",7:"DISCORD_NOTICE",8:"FREE"};function x(e){return e?m[e]??"MAIN":"MAIN"}function h({boardId:e}){let t=(0,a.useTranslations)("info"),r=(0,i.useLocale)();return(0,l.jsx)("div",{className:"w-full",children:(0,l.jsxs)("div",{className:"flex flex-col rounded-2xl bg-white py-3",children:[(0,l.jsx)(s.default,{href:(0,o.getLocalizedPath)(r,"/info"),className:`flex h-14 items-center px-4 rounded-xl hover:bg-neutral-50 transition-colors duration-150 text-lg font-bold ${!e?"text-primary":"text-black"}`,children:t("board.mainBoard")}),u.map(n=>(0,l.jsx)(s.default,{href:(0,o.getLocalizedPath)(r,`/info/${n.id}`),className:`flex h-14 items-center px-4 rounded-xl hover:bg-neutral-50 transition-colors duration-150 text-lg font-bold ${n.id===e?"text-primary":"text-black"}`,children:t(`board.postType.${n.title}`,{defaultValue:n.title})},n.id))]})})}var p=e.i(18566),b=e.i(66027),f=e.i(54616),g=e.i(12598),y=e.i(19273),v=e.i(37727),j=e.i(66610),N=e.i(58466),k=e.i(11549),w=e.i(82115),C=e.i(24700),E=e.i(54511),L=e.i(69952),I=e.i(30440),S=e.i(57688),T=e.i(1851),M=e.i(49001);function A(e){return e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function $({item:e,showPostType:t=!1,isUsingCheckbox:r,isChecked:n,onChangeCheckbox:d}){let c=(0,a.useTranslations)("info"),u=(0,a.useTranslations)("common"),m=(0,i.useLocale)(),x=e.boardId??0,h=(0,o.getLocalizedPath)(m,`/info/post/${x}/${e.id}`),p=e.createdAt?(0,T.format)(new Date(e.createdAt),"yyyy.MM.dd"):"-",b=(0,l.jsxs)("div",{className:`flex h-[86px] w-full cursor-pointer flex-row items-center justify-between rounded-lg border-b border-b-neutral-100 px-2 transition-colors duration-150 hover:bg-neutral-50 last:border-b-transparent md:h-[96px] ${r&&n?"bg-primary/5":""}`,children:[r?(0,l.jsx)("div",{className:"mr-3 flex-shrink-0",children:(0,l.jsx)("div",{className:`flex h-4 w-4 items-center justify-center rounded border-2 transition-colors ${n?"border-primary bg-primary":"border-neutral-300 bg-white"}`,children:n?(0,l.jsx)("svg",{className:"h-2.5 w-2.5 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:3,d:"M5 13l4 4L19 7"})}):null})}):null,(0,l.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,l.jsxs)("div",{className:"mb-1 flex flex-col items-start md:mb-3 md:flex-row md:items-center",children:[(0,l.jsxs)("div",{className:"mb-1 flex items-center md:mb-0",children:[e.pinned?(0,l.jsx)("div",{className:"mr-2 flex h-5 w-6 items-center justify-center rounded-full bg-neutral-100",children:(0,l.jsx)("svg",{className:"h-3 w-3 text-neutral-500",fill:"currentColor",viewBox:"0 0 24 24",children:(0,l.jsx)("path",{d:"M16 12V4h1V2H7v2h1v8l-2 2v2h5.2v6h1.6v-6H18v-2l-2-2z"})})}):null,t?(0,l.jsx)("span",{className:"mr-2 whitespace-nowrap rounded-full bg-neutral-100 px-2 py-1 text-xs font-normal text-neutral-500",children:c(`board.postType.${e.postType}`,{defaultValue:e.postType})}):null,!1===e.published?(0,l.jsx)("span",{className:"mr-2 whitespace-nowrap rounded-full bg-neutral-200 px-2 py-1 text-xs font-normal text-neutral-600",children:c("board.unpublished")}):null,e.requiredRole&&"GUEST"!==e.requiredRole?(0,l.jsx)("span",{className:"mr-2 whitespace-nowrap rounded-full bg-amber-100 px-2 py-1 text-xs font-normal text-amber-700",children:u(`roleLabel.${e.requiredRole}`)}):null]}),(0,l.jsx)("div",{className:"min-w-0 flex-1 text-base font-bold text-black line-clamp-1 group-hover:text-primary transition-colors duration-150",children:e.title})]}),(0,l.jsxs)("div",{className:"flex items-center text-xs font-bold text-neutral-400",children:[e.authorNickname?(0,l.jsxs)("span",{className:"mr-3 inline-flex items-center gap-1",children:[(0,l.jsx)(M.UserAvatar,{name:e.authorNickname,size:16,imageUrl:e.authorProfileImageUrl}),e.authorNickname]}):null,(0,l.jsx)("span",{className:"mr-3",children:p}),(0,l.jsxs)("div",{className:"mr-3 flex items-center gap-0.5",children:[(0,l.jsxs)("svg",{className:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}),(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"})]}),(0,l.jsx)("span",{children:A(e.viewCount)})]}),(0,l.jsxs)("div",{className:"flex items-center gap-0.5",children:[(0,l.jsx)("svg",{className:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z"})}),(0,l.jsx)("span",{children:A(e.likeCount)})]})]})]}),e.thumbnailUrl?(0,l.jsxs)("div",{className:"relative ml-4 flex-shrink-0",children:[(0,l.jsx)(S.default,{src:e.thumbnailUrl,alt:e.title,width:122,height:80,unoptimized:!0,className:"h-10 w-10 rounded-md object-cover md:h-20 md:w-[122px]"}),e.thumbnailCount>1?(0,l.jsx)("div",{className:"absolute bottom-1 right-1 flex min-w-[18px] items-center justify-center rounded bg-black/50 text-xs font-normal text-white",children:e.thumbnailCount}):null]}):null]});return r?(0,l.jsx)("div",{role:"button",tabIndex:0,onClick:()=>d?.(e.id),onKeyDown:t=>"Enter"===t.key&&d?.(e.id),children:b}):(0,l.jsx)(s.default,{href:h,className:"group block",children:b})}let q=[{boardId:0,postType:"MAIN",title:"Main"},{boardId:1,postType:"NOTICE",title:"Notice"},{boardId:2,postType:"DEV_LOG",title:"Dev Log"},{boardId:3,postType:"GAME_GUIDE",title:"Game Guide"},{boardId:4,postType:"GAME_REVIEW",title:"Game Review"},{boardId:5,postType:"GAME_NEWS",title:"Game News"},{boardId:6,postType:"GAME_EVENT",title:"Game Event"},{boardId:7,postType:"DISCORD_NOTICE",title:"Discord Notice"},{boardId:8,postType:"FREE",title:"Free"}];function U(e){return e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function P({boardId:e,initialPage:t=1}){let r=(0,a.useTranslations)("info"),s=(0,a.useTranslations)("common"),d=(0,i.useLocale)(),m=(0,p.useRouter)(),h=(0,g.useQueryClient)(),{isLoggedIn:S,isAdmin:T,isCreator:M,isGameCompany:A,isOutsourcer:R}=(0,C.useAuthStore)(),D=(0,p.useSearchParams)().get("tag")??"",z=(0,E.useFilterStore)(),K=e?`info-${e}`:"info",F=E.useFilterStore.getState().load(K)?.page||void 0,[_,O]=(0,L.usePageParam)("page",F),[G,B]=(0,n.use
1State)(()=>E.useFilterStore.getState().load(K)?.filterType??c.SUBJECT),[H,W]=(0,n.useState)(()=>E.useFilterStore.getState().load(K)?.keyword??""),[Q,V]=(0,n.useState)(()=>E.useFilterStore.getState().load(K)?.keyword??""),[Y,X]=(0,n.useState)(!1),[J,Z]=(0,n.useState)(!1),[ee,et]=(0,n.useState)([]),[er,el]=(0,n.useState)(!1),[en,ea]=(0,n.useState)("NOTICE"),[es,ei]=(0,n.useState)(!1),[eo,ed]=(0,n.useState)(!1),[ec,eu]=(0,n.useState)("publish"),em=(0,n.useMemo)(()=>x(e),[e]),{data:ex,isLoading:eh}=(0,b.useQuery)({queryKey:j.queryKeys.info.articleList(d,{page:_,size:10,postType:em,searchType:G,keyword:Q,tag:D}).queryKey,queryFn:()=>(0,I.fetchInfoArticleList)({page:_,size:10,postType:em,searchType:G,keyword:Q,tag:D}),placeholderData:y.keepPreviousData,staleTime:6e4}),{data:ep}=(0,b.useQuery)({queryKey:j.queryKeys.banner.byPage("INFO").queryKey,queryFn:()=>(0,w.fetchBanners)("INFO"),staleTime:18e5}),[eb,ef]=(0,n.useState)(null);(0,n.useEffect)(()=>{let e=ep?.SIDE_MIDDLE??[];ef(e.length>0?e[Math.floor(Math.random()*e.length)]:null)},[ep]),(0,n.useEffect)(()=>{z.save(K,{page:_,keyword:Q,filterType:G})},[_,Q,G]),(0,n.useEffect)(()=>{let t=E.useFilterStore.getState().load(e?`info-${e}`:"info");t?(O(t.page??1),V(t.keyword??""),W(t.keyword??""),B(t.filterType??c.SUBJECT)):(O(1),V(""),W(""))},[e]);let eg=()=>{(0===H.length||H.length>=2)&&(V(H),O(1))},ey=j.queryKeys.info.articleList(d,{page:_,size:10,postType:em,searchType:G,keyword:Q}).queryKey,ev=()=>{Z(!1),et([])},ej=e=>{et(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},eN=()=>{if(eq)et(e=>e.filter(e=>!eM.some(t=>t.id===e)));else{let e=eM.map(e=>e.id).filter(e=>!ee.includes(e));et(t=>[...t,...e])}},{mutate:ek,isPending:ew}=(0,f.useMutation)({mutationFn:()=>(0,I.bulkDeleteInfoArticles)(ee),onSuccess:()=>{h.invalidateQueries({queryKey:ey}),ev()}}),{mutate:eC,isPending:eE}=(0,f.useMutation)({mutationFn:()=>(0,I.bulkMoveInfoArticles)(ee,en),onSuccess:()=>{h.invalidateQueries({queryKey:ey}),el(!1),ev()}}),{mutate:eL,isPending:eI}=(0,f.useMutation)({mutationFn:()=>(0,I.bulkUpdatePublished)(ee,"publish"===ec),onSuccess:()=>{h.invalidateQueries({queryKey:ey}),ed(!1),ev()}}),eS=(0,n.useMemo)(()=>e?u.find(t=>t.id===e)?.title??null:null,[e]),eT=eS?r(`board.postType.${eS}`,{defaultValue:eS}):r("board.mainBoard"),eM=ex?.content??[],eA=ex?.totalPages??0,e$=ex?.totalElements??0,eq=eM.length>0&&eM.every(e=>ee.includes(e.id)),eU=[{value:c.SUBJECT,label:r("board.filter.title")},{value:c.CONTENT,label:r("board.filter.content")},{value:c.NICKNAME,label:r("board.filter.nickname")}];return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"mb-3 hidden min-h-14 items-center justify-between lg:flex",children:[(0,l.jsxs)("div",{className:"flex items-center gap-3",children:[(0,l.jsx)("h1",{className:"text-2xl font-bold text-black",children:eT}),(0,l.jsx)("span",{className:"text-sm font-normal text-neutral-400",children:U(e$)})]}),(0,l.jsx)("div",{className:"flex items-center gap-2",children:J?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("span",{className:"text-sm text-neutral-500",children:s("selected",{count:ee.length})}),(0,l.jsxs)("button",{type:"button",onClick:eN,className:`flex h-10 items-center gap-1.5 rounded-lg border px-3 text-sm transition-colors ${eq?"border-primary text-primary":"border-neutral-200 text-neutral-600 hover:border-primary hover:text-primary"}`,children:[(0,l.jsx)("div",{className:`flex h-3.5 w-3.5 items-center justify-center rounded border transition-colors ${eq?"border-primary bg-primary":"border-neutral-400 bg-white"}`,children:eq?(0,l.jsx)("svg",{className:"h-2 w-2 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:3,d:"M5 13l4 4L19 7"})}):null}),s("selectAll")]}),(0,l.jsx)("button",{type:"button",onClick:()=>el(!0),disabled:0===ee.length,className:"h-10 rounded-lg border border-neutral-200 px-3 text-sm text-neutral-600 hover:border-primary hover:text-primary disabled:opacity-40 transition-colors",children:r("board.bulk.move")}),(0,l.jsx)("button",{type:"button",onClick:()=>{eu("publish"),ed(!0)},disabled:0===ee.length,className:"h-10 rounded-lg border border-neutral-200 px-3 text-sm text-neutral-600 hover:border-primary hover:text-primary disabled:opacity-40 transition-colors",children:r("board.bulk.publish")}),(0,l.jsx)("button",{type:"button",onClick:()=>{eu("unpublish"),ed(!0)},disabled:0===ee.length,className:"h-10 rounded-lg border border-neutral-200 px-3 text-sm text-neutral-600 hover:border-primary hover:text-primary disabled:opacity-40 transition-colors",children:r("board.bulk.unpublish")}),(0,l.jsx)("button",{type:"button",onClick:()=>ei(!0),disabled:0===ee.length,className:"h-10 rounded-lg border border-neutral-200 px-3 text-sm text-neutral-600 hover:border-red-400 hover:text-red-500 disabled:opacity-40 transition-colors",children:r("board.bulk.delete")}),(0,l.jsx)("button",{type:"button",onClick:ev,className:"h-10 rounded-lg border border-neutral-200 px-3 text-sm text-neutral-500 hover:bg-neutral-50 transition-colors",children:r("board.bulk.cancel")})]}):(0,l.jsxs)(l.Fragment,{children:[(T||M||A||R)&&(0,l.jsx)("button",{type:"button",onClick:()=>
1m.push((0,o.getLocalizedPath)(d,e?`/info/editor/${e}`:"/info/editor")),className:"h-10 rounded-lg bg-primary px-4 text-sm font-medium text-white hover:bg-primary/90 transition-colors",children:r("editor.write")}),T&&(0,l.jsx)("button",{type:"button",onClick:()=>Z(!0),className:"h-10 rounded-lg border border-neutral-200 px-4 text-sm text-neutral-600 hover:border-primary hover:text-primary transition-colors",children:r("board.bulk.select")}),(0,l.jsxs)("div",{className:"relative",children:[(0,l.jsx)("select",{value:G,onChange:e=>B(e.target.value),className:"h-10 appearance-none rounded-lg border border-neutral-200 bg-white pl-3 pr-8 text-sm text-neutral-700 focus:outline-none focus:ring-1 focus:ring-primary",children:eU.map(e=>(0,l.jsx)("option",{value:e.value,children:e.label},e.value))}),(0,l.jsx)("svg",{className:"pointer-events-none absolute right-2.5 top-1/2 h-4 w-4 -translate-y-1/2 text-neutral-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),(0,l.jsxs)("div",{className:"flex h-10 items-center overflow-hidden rounded-lg border border-neutral-200 bg-white",children:[(0,l.jsx)("input",{type:"text",value:H,onChange:e=>W(e.target.value),onKeyDown:e=>"Enter"===e.key&&eg(),placeholder:r("board.search"),className:"h-full w-48 px-3 text-sm focus:outline-none"}),H?(0,l.jsx)("button",{type:"button",onClick:()=>{W(""),V("")},className:"px-2 text-neutral-400 hover:text-neutral-600",children:(0,l.jsx)("svg",{className:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})}):null,(0,l.jsx)("button",{type:"button",onClick:eg,className:"px-3 text-neutral-400 hover:text-primary",children:(0,l.jsx)("svg",{className:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})})})]})]})})]}),D&&(0,l.jsx)("div",{className:"-mt-6 mb-3 hidden lg:block",children:(0,l.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full bg-primary/10 px-2.5 py-1 text-xs font-medium text-primary",children:["#",D,(0,l.jsx)("button",{type:"button",onClick:()=>m.push((0,o.getLocalizedPath)(d,e?`/info/${e}`:"/info")),className:"flex h-3.5 w-3.5 items-center justify-center rounded-full hover:bg-primary/20",children:(0,l.jsx)(v.X,{className:"h-2.5 w-2.5"})})]})}),eb&&(0,l.jsx)("div",{className:"mb-4",children:(0,l.jsx)(k.MiddleBanner,{banner:eb,page:"INFO",location:"SIDE_MIDDLE"})}),(0,l.jsxs)("div",{className:"mb-4 lg:hidden",children:[(0,l.jsxs)("button",{type:"button",onClick:()=>X(!0),className:`${D?"mb-1.5":"mb-3"} flex h-fit w-full items-center justify-between rounded-2xl bg-white px-4 py-4 md:px-5`,children:[(0,l.jsxs)("div",{className:"flex items-center gap-3",children:[(0,l.jsx)("span",{className:"text-lg font-bold text-black md:text-2xl",children:eT}),(0,l.jsx)("span",{className:"text-sm text-neutral-400",children:U(e$)})]}),(0,l.jsx)("svg",{className:"h-4 w-4 text-neutral-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),D&&(0,l.jsx)("div",{className:"mb-2 px-1",children:(0,l.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full bg-primary/10 px-2.5 py-1 text-xs font-medium text-primary",children:["#",D,(0,l.jsx)("button",{type:"button",onClick:()=>m.push((0,o.getLocalizedPath)(d,e?`/info/${e}`:"/info")),className:"flex h-3.5 w-3.5 items-center justify-center rounded-full hover:bg-primary/20",children:(0,l.jsx)(v.X,{className:"h-2.5 w-2.5"})})]})}),J?(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("span",{className:"text-sm text-neutral-500",children:s("selected",{count:ee.length})}),(0,l.jsxs)("button",{type:"button",onClick:eN,className:`flex h-10 items-center gap-1.5 rounded-lg border px-3 text-sm transition-colors ${eq?"border-primary text-primary":"border-neutral-200 text-neutral-600 hover:border-primary hover:text-primary"}`,children:[(0,l.jsx)("div",{className:`flex h-3.5 w-3.5 items-center justify-center rounded border transition-colors ${eq?"border-primary bg-primary":"border-neutral-400 bg-white"}
1`,children:eq?(0,l.jsx)("svg",{className:"h-2 w-2 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:3,d:"M5 13l4 4L19 7"})}):null}),s("selectAllShort")]}),(0,l.jsx)("button",{type:"button",onClick:()=>el(!0),disabled:0===ee.length,className:"h-10 rounded-lg border border-neutral-200 px-3 text-sm text-neutral-600 hover:border-primary hover:text-primary disabled:opacity-40 transition-colors",children:r("board.bulk.move")}),(0,l.jsx)("button",{type:"button",onClick:()=>{eu("publish"),ed(!0)},disabled:0===ee.length,className:"h-10 rounded-lg border border-neutral-200 px-3 text-sm text-neutral-600 hover:border-primary hover:text-primary disabled:opacity-40 transition-colors",children:r("board.bulk.publish")}),(0,l.jsx)("button",{type:"button",onClick:()=>{eu("unpublish"),ed(!0)},disabled:0===ee.length,className:"h-10 rounded-lg border border-neutral-200 px-3 text-sm text-neutral-600 hover:border-primary hover:text-primary disabled:opacity-40 transition-colors",children:r("board.bulk.unpublish")}),(0,l.jsx)("button",{type:"button",onClick:()=>ei(!0),disabled:0===ee.length,className:"h-10 rounded-lg border border-neutral-200 px-3 text-sm text-neutral-600 hover:border-red-400 hover:text-red-500 disabled:opacity-40 transition-colors",children:r("board.bulk.delete")}),(0,l.jsx)("button",{type:"button",onClick:ev,className:"h-10 rounded-lg border border-neutral-200 px-3 text-sm text-neutral-500 hover:bg-neutral-50 transition-colors",children:r("board.bulk.cancel")})]}):(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsxs)("div",{className:"flex h-10 flex-1 items-center overflow-hidden rounded-lg border border-neutral-200 bg-white",children:[(0,l.jsx)("input",{type:"text",value:H,onChange:e=>W(e.target.value),onKeyDown:e=>"Enter"===e.key&&eg(),placeholder:r("board.search"),className:"h-full flex-1 px-3 text-sm focus:outline-none"}),H?(0,l.jsx)("button",{type:"button",onClick:()=>{W(""),V("")},className:"px-2 text-neutral-400",children:(0,l.jsx)("svg",{className:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})}):null,(0,l.jsx)("button",{type:"button",onClick:eg,className:"px-3 text-neutral-400 hover:text-primary",children:(0,l.jsx)("svg",{className:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})})})]}),T&&(0,l.jsx)("button",{type:"button",onClick:()=>Z(!0),className:"flex h-10 shrink-0 items-center justify-center rounded-lg border border-neutral-200 px-3 text-neutral-600 hover:border-primary hover:text-primary transition-colors",children:(0,l.jsx)("svg",{className:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"})})}),(T||M||A||R)&&(0,l.jsx)("button",{type:"button",onClick:()=>m.push((0,o.getLocalizedPath)(d,e?`/info/editor/${e}`:"/info/editor")),className:"flex h-10 shrink-0 items-center justify-center rounded-lg bg-primary px-3 text-white hover:bg-primary/90 transition-colors",children:(0,l.jsx)("svg",{className:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15.232 5.232l3.536 3.536m-2.036-5.036a2.5 2.5 0 113.536 3.536L6.5 21.036H3v-3.572L16.732 3.732z"})})})]})]}),Y?(0,l.jsx)("div",{className:"fixed inset-0 z-50 flex flex-col justify-end lg:hidden",role:"presentation",onClick:()=>X(!1),onKeyDown:e=>{"Escape"===e.key&&X(!1)},children:(0,l.jsxs)("div",{className:"w-full rounded-t-2xl bg-white p-4 shadow-[0_-8px_24px_rgba(0,0,0,0.15)]",role:"presentation",onClick:e=>e.stopPropagation(),children:[(0,l.jsx)("div",{className:"mb-3 h-1 w-10 rounded-full bg-neutral-200 mx-auto"}),(0,l.jsxs)("div",{className:"mb-4 flex items-center justify-between",children:[(0,l.jsx)("span",{className:"text-base font-semibold text-black",children:r("board.menu")}),(0,l.jsx)("button",{type:"button",onClick:()=>X(!1),className:"flex h-8 w-8 items-center justify-center rounded-full bg-neutral-100",children:(0,l.jsx)(v.X,{className:"h-4 w-4 text-neutral-600"})})]}),(0,l.jsx)("button",{className:`w-full py-3 text-left text-lg font-bold ${!e?"text-primary":"text-black"}`,onClick:()=>
1{m.push((0,o.getLocalizedPath)(d,"/info")),X(!1)},children:r("board.mainBoard")}),u.map(t=>(0,l.jsx)("button",{className:`w-full py-3 text-left text-lg font-bold ${t.id===e?"text-primary":"text-black"}`,onClick:()=>{m.push((0,o.getLocalizedPath)(d,`/info/${t.id}`)),X(!1)},children:r(`board.postType.${t.title}`,{defaultValue:t.title})},t.id))]})}):null,e&&"MAIN"!==em&&r.has(`board.boardDescription.${em}`)?(0,l.jsx)("div",{className:"mb-4 rounded-2xl border-l-4 border-primary/30 bg-white px-5 py-4",children:(0,l.jsx)("p",{className:"whitespace-pre-line text-sm leading-relaxed text-neutral-500",children:r(`board.boardDescription.${em}`)})}):null,(0,l.jsxs)("div",{className:"rounded-2xl bg-white px-4 py-2",children:[eh?Array.from({length:5}).map((e,t)=>(0,l.jsx)("div",{className:"flex h-[86px] items-center gap-4 border-b border-neutral-100 md:h-[96px]",children:(0,l.jsxs)("div",{className:"flex-1 space-y-2",children:[(0,l.jsx)("div",{className:"h-4 w-3/4 animate-pulse rounded bg-neutral-100"}),(0,l.jsx)("div",{className:"h-3 w-1/3 animate-pulse rounded bg-neutral-100"})]})},t)):eM.length>0?eM.map(t=>(0,l.jsx)($,{item:t,showPostType:!e,isUsingCheckbox:J,isChecked:ee.includes(t.id),onChangeCheckbox:ej},t.id)):Q&&0===eM.length?(0,l.jsxs)("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[(0,l.jsx)("div",{className:"mb-2 text-4xl",children:"🔍"}),(0,l.jsxs)("p",{className:"font-bold text-black",children:["“",(0,l.jsx)("span",{className:"text-primary",children:Q}),"”"]}),(0,l.jsx)("p",{className:"mt-1 text-sm text-neutral-400",children:r("board.noResultsFor")})]}):(0,l.jsx)("div",{className:"flex flex-col items-center justify-center py-16",children:(0,l.jsx)("p",{className:"text-sm text-neutral-400",children:r("board.noPosts")})}),eA>1?(0,l.jsx)(N.Pagination,{className:"my-6",currentPage:_,totalPages:eA,onChangePage:e=>{O(e)}}):null]}),er?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("div",{className:"fixed inset-0 z-50 bg-black/40",role:"presentation",onClick:()=>el(!1),onKeyDown:e=>{"Escape"===e.key&&el(!1)}}),(0,l.jsxs)("div",{className:"fixed left-1/2 top-1/2 z-50 w-80 -translate-x-1/2 -translate-y-1/2 rounded-2xl bg-white p-6 shadow-2xl",children:[(0,l.jsx)("h3",{className:"mb-4 text-base font-bold text-black",children:r("board.bulk.moveTitle")}),(0,l.jsxs)("div",{className:"relative mb-5",children:[(0,l.jsx)("select",{value:en,onChange:e=>ea(e.target.value),className:"w-full appearance-none rounded-xl border border-neutral-200 bg-white py-2.5 pl-3 pr-8 text-sm text-neutral-700 focus:outline-none focus:ring-1 focus:ring-primary",children:q.filter(e=>e.postType!==em).map(e=>(0,l.jsx)("option",{value:e.postType,children:e.title},e.postType))}),(0,l.jsx)("svg",{className:"pointer-events-none absolute right-2.5 top-1/2 h-4 w-4 -translate-y-1/2 text-neutral-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),(0,l.jsxs)("div",{className:"flex gap-2",children:[(0,l.jsx)("button",{type:"button",onClick:()=>el(!1),className:"flex-1 rounded-xl border border-neutral-200 py-2.5 text-sm text-neutral-600 hover:bg-neutral-50 transition-colors",children:r("board.bulk.cancel")}),(0,l.jsx)("button",{type:"button",onClick:()=>eC(),disabled:eE,className:"flex-1 rounded-xl bg-primary py-2.5 text-sm font-medium text-white hover:bg-primary/90 disabled:opacity-50 transition-colors",children:r("board.bulk.move")})]})]})]}):null,es?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("div",{className:"fixed inset-0 z-50 bg-black/40",role:"presentation",onClick:()=>ei(!1),onKeyDown:e=>{"Escape"===e.key&&ei(!1)}}),(0,l.jsxs)("div",{className:"fixed left-1/2 top-1/2 z-50 w-72 -translate-x-1/2 -translate-y-1/2 rounded-2xl bg-white p-6 shadow-2xl",children:[(0,l.jsx)("h3",{className:"mb-2 text-base font-bold text-black",children:r("board.bulk.delete")}),(0,l.jsx)("p",{className:"mb-5 text-sm text-neutral-500",children:r("board.bulk.confirmDelete",{count:ee.length})}),(0,l.jsxs)("div",{className:"flex gap-2",children:[(0,l.jsx)("button",{type:"button",onClick:()=>ei(!1),className:"flex-1 rounded-xl border border-neutral-200 py-2.5 text-sm text-neutral-600 hover:bg-neutral-50 transition-colors",children:r("board.bulk.cancel")}),(0,l.jsx)("button",{type:"button",onClick:()=>{ei(!1),ek()},disabled:ew,className:"flex-1 rounded-xl bg-red-500 py-2.5 text-sm font-medium text-white hover:bg-red-600 disabled:opacity-50 transition-colors",children:r("board.bulk.delete")})]})]})]}):null,eo?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("div",{className:"fixed inset-0 z-50 bg-black/40",role:"presentation",onClick:()=>ed(!1),onKeyDown:e=>{"Escape"===e.key&&ed(!1)}}),(0,l.jsxs)("div",{className:"fixed left-1/2 top-1/2 z-50 w-72 -translate-x-1/2 -translate-y-1/2 roun
1ded-2xl bg-white p-6 shadow-2xl",children:[(0,l.jsx)("h3",{className:"mb-2 text-base font-bold text-black",children:r("publish"===ec?"board.bulk.publish":"board.bulk.unpublish")}),(0,l.jsx)("p",{className:"mb-5 text-sm text-neutral-500",children:r("publish"===ec?"board.bulk.confirmPublish":"board.bulk.confirmUnpublish",{count:ee.length})}),(0,l.jsxs)("div",{className:"flex gap-2",children:[(0,l.jsx)("button",{type:"button",onClick:()=>ed(!1),className:"flex-1 rounded-xl border border-neutral-200 py-2.5 text-sm text-neutral-600 hover:bg-neutral-50 transition-colors",children:r("board.bulk.cancel")}),(0,l.jsx)("button",{type:"button",onClick:()=>{ed(!1),eL()},disabled:eI,className:"flex-1 rounded-xl bg-primary py-2.5 text-sm font-medium text-white hover:bg-primary/90 disabled:opacity-50 transition-colors",children:r("publish"===ec?"board.bulk.publish":"board.bulk.unpublish")})]})]})]}):null]})}var R=e.i(86536),D=e.i(86311),z=e.i(90597),K=e.i(75254);let F=(0,K.default)("Share2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]);var _=e.i(40433);let O=(0,K.default)("PinOff",[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89",key:"znwnzq"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11",key:"c9qhm2"}]]);var G=e.i(27612),B=e.i(88699),H=e.i(46696),W=e.i(8013),Q=e.i(32171),V=e.i(80724);function Y(e,t){let r=e.id??e.commentId;return null!=r?`${r}`:t}function X({comment:e,articleId:t,currentUserId:r,depth:s=0,itemKey:o}){let d=(0,a.useTranslations)("info"),c=(0,i.useLocale)(),u=(0,g.useQueryClient)(),{user:m,isAdmin:x}=(0,C.useAuthStore)(),[h,p]=(0,n.useState)(!1),[b,y]=(0,n.useState)(""),[v,N]=(0,n.useState)(!1),k=e.createdAt?(0,T.format)(new Date(e.createdAt),"yyyy.MM.dd HH:mm"):"-",{mutate:w}=(0,f.useMutation)({mutationFn:()=>(0,I.deleteInfoComment)(e.commentId??e.id),onSuccess:()=>{u.invalidateQueries({queryKey:j.queryKeys.info.articleDetail(c,t).queryKey})}}),{mutate:E,isPending:L}=(0,f.useMutation)({mutationFn:()=>(0,I.addInfoComment)(t,b,e.commentId??e.id),onSuccess:()=>{y(""),p(!1),u.invalidateQueries({queryKey:j.queryKeys.info.articleDetail(c,t).queryKey})},onError:e=>{H.toast.error((0,W.getErrorMessage)(e))}}),S=x||null!=r&&null!=e.authorId&&e.authorId===r||null!=m&&e.authorNickname===m.nickname;return e.deleted?(0,l.jsxs)("div",{className:`py-4 ${s>0?"ml-8 border-l-2 border-neutral-100 pl-4":"border-b border-neutral-100"}`,children:[(0,l.jsx)("p",{className:"text-sm text-neutral-400 italic",children:d("board.comment.deleted")}),e.children?.map((e,n)=>(0,l.jsx)(X,{itemKey:`${o??"comment"}-deleted-child-${n}`,comment:e,articleId:t,currentUserId:r,depth:s+1},Y(e,`${o??"comment"}-deleted-child-${n}`)))]}):(0,l.jsxs)("div",{className:`${s>0?"ml-8 border-l-2 border-neutral-100 pl-4":"border-b border-neutral-100 last:border-b-0"}`,children:[(0,l.jsxs)("div",{className:"py-4",children:[(0,l.jsxs)("div",{className:"flex items-start justify-between",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)(M.UserAvatar,{name:e.authorNickname,size:32,imageUrl:e.authorProfileImageUrl}),(0,l.jsxs)("div",{children:[(0,l.jsx)("span",{className:"text-sm font-bold text-black",children:e.authorNickname}),(0,l.jsx)("span",{className:"ml-2 text-xs text-neutral-400",children:k})]})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[0===s?(0,l.jsx)("button",{type:"button",onClick:()=>p(!h),className:"text-xs text-neutral-400 hover:text-primary",children:d("board.comment.reply")}):null,S?(0,l.jsx)("button",{type:"button",onClick:()=>N(!0),className:"text-xs text-neutral-400 hover:text-red-500",children:d("board.comment.delete")}):null]})]}),(0,l.jsx)("p",{className:"mt-2 text-sm leading-relaxed text-neutral-700 whitespace-pre-wrap",children:e.content}),h?(0,l.jsxs)("div",{className:"mt-3 flex gap-2",children:[(0,l.jsx)("textarea",{value:b,onChange:e=>y(e.target.value),placeholder:d("board.comment.placeholder"),className:"flex-1 rounded-lg border border-neutral-200 p-3 text-sm focus:outline-none focus:ring-1 focus:ring-primary",rows:2}),(0,l.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,l.jsx)("button",{type:"button",onClick:()=>E(),disabled:!b.trim()||L,className:"rounded-lg bg-primary px-3 py-2 text-xs text-white disabled:opacity-50 hover:bg-primary/90",children:d("board.comment.submit")}),(0,l.jsx)("button",{type:"button",onClick:()=>p(!1),className:"rounded-lg bg-neutral-100 px-3 py-2 text-xs text-neutral-600 hover:bg-neutral-200",children:d("board.comment.cancel")})]})]}):null]}),v?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("div",{className:"fixed inset-0 z-50 bg-black/40",role:"presentation",onClick:()=>N(!1),onKeyDown:e=>{"Escape"===e.key&&N(!1)}}),(0,l.jsxs)("div",{className:"fixed left-1/2 top-1/2 z-50 w-72 -translate-x-1/2 -translate-y-1/2 roun
1ded-2xl bg-white p-6 shadow-2xl",children:[(0,l.jsx)("h3",{className:"mb-2 text-base font-bold text-black",children:d("board.comment.delete")}),(0,l.jsx)("p",{className:"mb-5 text-sm text-neutral-500",children:d("board.comment.confirmDelete")}),(0,l.jsxs)("div",{className:"flex gap-2",children:[(0,l.jsx)("button",{type:"button",onClick:()=>N(!1),className:"flex-1 rounded-xl border border-neutral-200 py-2.5 text-sm text-neutral-600 hover:bg-neutral-50 transition-colors",children:d("board.comment.cancel")}),(0,l.jsx)("button",{type:"button",onClick:()=>{N(!1),w()},className:"flex-1 rounded-xl bg-red-500 py-2.5 text-sm font-medium text-white hover:bg-red-600 transition-colors",children:d("board.comment.delete")})]})]})]}):null,e.children?.map((e,n)=>(0,l.jsx)(X,{itemKey:`${o??"comment"}-child-${n}`,comment:e,articleId:t,currentUserId:r,depth:s+1},Y(e,`${o??"comment"}-child-${n}`)))]})}var J=e.i(46577),Z=e.i(25305);function ee({articleId:e,initialLiked:t,initialLikeCount:r,onLoginRequired:a}){let{isLoggedIn:s}=(0,C.useAuthStore)(),[i,o]=(0,n.useState)(t),[d,c]=(0,n.useState)(r),u=(0,n.useRef)(!1);(0,n.useEffect)(()=>{u.current||(o(t),c(r))},[t,r]);let{mutate:m,isPending:x}=(0,f.useMutation)({mutationFn:t=>t?(0,I.unlikeInfoArticle)(e):(0,I.likeInfoArticle)(e),onMutate:e=>{u.current=!0,o(!e),c(t=>e?t-1:t+1)},onError:(e,t)=>{o(t),c(e=>t?e+1:e-1)}});return(0,l.jsxs)("button",{type:"button",onClick:()=>{s?x||m(i):a()},disabled:x,className:`flex items-center gap-2 rounded-full border px-5 py-2 text-sm font-medium transition-all disabled:opacity-70 ${i?"border-red-300 bg-red-50 text-red-500":"border-neutral-200 bg-white text-neutral-500 hover:border-red-200 hover:text-red-400"}`,children:[(0,l.jsx)(z.Heart,{className:"h-4 w-4",fill:i?"currentColor":"none"}),(0,l.jsx)("span",{children:d})]})}function et({articleId:e,boardId:t}){let r=(0,a.useTranslations)("info"),d=(0,i.useLocale)(),c=(0,p.useRouter)(),m=(0,g.useQueryClient)(),{setLoginModalOpen:x}=(0,Q.useUiStore)(),h=(0,a.useTranslations)("common"),{user:y,isLoggedIn:v,isAdmin:N}
1=(0,C.useAuthStore)(),[E,L]=(0,n.useState)(""),[S,T]=(0,n.useState)(!1),[A,$]=(0,n.useState)(!1),[q,U]=(0,n.useState)(!1),{data:P,isLoading:z,isError:K}=(0,b.useQuery)({queryKey:j.queryKeys.info.articleDetail(d,e).queryKey,queryFn:()=>(0,I.fetchInfoArticleDetail)(e),staleTime:0}),{data:Y}=(0,b.useQuery)({queryKey:j.queryKeys.banner.byPage("INFO").queryKey,queryFn:()=>(0,w.fetchBanners)("INFO"),staleTime:18e5}),[er,el]=(0,n.useState)(null);(0,n.useEffect)(()=>{let e=Y?.SIDE_MIDDLE??[];el(e.length>0?e[Math.floor(Math.random()*e.length)]:null)},[Y]);let en=P?.post,ea=P?.comments??[],{mutate:es}=(0,f.useMutation)({mutationFn:()=>(0,I.deleteInfoArticle)(e),onSuccess:()=>{let e=t?`/info/${t}`:"/info";c.push((0,o.getLocalizedPath)(d,e))}}),{mutate:ei}=(0,f.useMutation)({mutationFn:t=>(0,I.pinInfoArticle)(e,t),onSuccess:()=>{m.invalidateQueries({queryKey:j.queryKeys.info.articleDetail(d,e).queryKey})}}),eo=async()=>{await navigator.clipboard.writeText(window.location.href),H.toast.success(h("linkCopied")),$(!0),setTimeout(()=>$(!1),2e3)},ed=async()=>{if(!v)return void x(!0);if(E.trim()){T(!0);try{await (0,I.addInfoComment)(e,E),L(""),m.invalidateQueries({queryKey:j.queryKeys.info.articleDetail(d,e).queryKey})}catch(e){H.toast.error((0,W.getErrorMessage)(e))}finally{T(!1)}}},ec=(0,o.getLocalizedPath)(d,t?`/info/${t}`:"/info");(()=>{if(!t)return r("board.mainBoard");let e=u.find(e=>e.id===t);return e?r(`board.postType.${e.title}`,{defaultValue:e.title}):r("board.mainBoard")})();let eu=v&&y&&en&&y.id===en.authorId;return z?(0,l.jsxs)("div",{className:"rounded-2xl bg-white p-6",children:[(0,l.jsx)("div",{className:"h-8 w-3/4 animate-pulse rounded bg-neutral-100"}),(0,l.jsx)("div",{className:"mt-4 space-y-2",children:Array.from({length:6}).map((e,t)=>(0,l.jsx)("div",{className:"h-4 animate-pulse rounded bg-neutral-100"},t))})]}):K||!en?(0,l.jsxs)("div",{className:"flex flex-col items-center justify-center rounded-2xl bg-white py-20",children:[(0,l.jsx)("p",{className:"text-neutral-500",children:r("board.notFound")}),(0,l.jsx)(s.default,{href:ec,className:"mt-4 text-sm text-primary hover:underline",children:r("board.backToList")})]}):(0,l.jsxs)("div",{children:[er&&(0,l.jsx)("div",{className:"mb-4",children:(0,l.jsx)(k.MiddleBanner,{banner:er,page:"INFO",location:"SIDE_MIDDLE"})}),(0,l.jsxs)("div",{className:"rounded-2xl bg-white",children:[(0,l.jsxs)("div",{className:"p-5 md:p-6",children:[(0,l.jsxs)("div",{className:"mb-3 flex items-center gap-2",children:[(0,l.jsx)(s.default,{href:ec,className:"rounded-full bg-neutral-100 px-2 py-0.5 text-xs text-neutral-500 transition-colors hover:bg-primary/10 hover:text-primary",children:r(`board.postType.${en.postType}`,{defaultValue:en.postType})}),!1===en.published?(0,l.jsx)("span",{className:"rounded-full bg-neutral-200 px-2 py-0.5 text-xs text-neutral-600",children:r("board.unpublished")}):null,en.pinned?(0,l.jsxs)("span",{className:"rounded-full bg-primary/10 px-2 py-0.5 text-xs text-primary",children:["📌 ",r("board.pinned")]}):null,en.requiredRole&&"GUEST"!==en.requiredRole?(0,l.jsx)("span",{className:"rounded-full bg-amber-100 px-2 py-0.5 text-xs text-amber-700",children:h(`roleLabel.${en.requiredRole}`)}):null]}),(0,l.jsxs)("div",{className:"mb-5 flex items-start justify-between gap-3",children:[(0,l.jsx)("h1",{className:"text-xl font-bold text-black md:text-2xl",children:en.title}),(0,l.jsxs)("div",{className:"relative flex shrink-0 items-center gap-1",children:[(0,l.jsx)("button",{type:"button",onClick:eo,className:"flex h-11 w-11 items-center justify-center rounded-full bg-neutral-100 text-neutral-500 transition-colors hover:bg-neutral-200",title:A?h("copied"):h("copyLink"),children:(0,l.jsx)(F,{className:"h-4 w-4"})}),N||eu?(0,l.jsx)("button",{type:"button",onClick:()=>ei(!en.pinned),className:`flex h-11 w-11 items-center justify-center rounded-full transition-colors ${en.pinned?"bg-primary/10 text-primary hover:bg-primary/20":"bg-neutral-100 text-neutral-500 hover:bg-neutral-200"}`,title:en.pinned?h("unpin"):h("pinPost"),children:en.pinned?(0,l.jsx)(_.Pin,{className:"h-4 w-4"}):(0,l.jsx)(O,{className:"h-4 w-4"})}
1):null,eu||N?(0,l.jsx)(s.default,{href:(0,o.getLocalizedPath)(d,`/info/editor/${t??0}/${e}`),className:"flex h-11 w-11 items-center justify-center rounded-full bg-neutral-100 text-neutral-500 transition-colors hover:bg-primary/10 hover:text-primary",title:r("editor.edit"),children:(0,l.jsx)(B.Pencil,{className:"h-4 w-4"})}):null,eu||N?(0,l.jsx)("button",{type:"button",onClick:()=>U(!0),className:"flex h-11 w-11 items-center justify-center rounded-full bg-neutral-100 text-neutral-500 transition-colors hover:bg-red-50 hover:text-red-500",title:r("board.delete"),children:(0,l.jsx)(G.Trash2,{className:"h-4 w-4"})}):null]})]}),(0,l.jsxs)("div",{className:"flex items-center justify-between border-b border-neutral-100 pb-5",children:[(0,l.jsxs)("div",{className:"flex items-center gap-3",children:[(0,l.jsx)(M.UserAvatar,{name:en.authorNickname,size:32,imageUrl:en.authorProfileImageUrl}),(0,l.jsxs)("div",{children:[(0,l.jsx)("p",{className:"text-sm font-bold text-black",children:en.authorNickname}),(0,l.jsx)("p",{className:"mt-0.5 text-xs text-neutral-400",children:(0,V.formatUtcToLocal)(en.createdTimestamp??en.createdAt)})]})]}),(0,l.jsxs)("div",{className:"flex items-center gap-3 text-xs text-neutral-400",children:[(0,l.jsxs)("span",{className:"flex items-center gap-1",children:[(0,l.jsx)(R.Eye,{className:"h-3.5 w-3.5"}),en.viewCount]}),(0,l.jsxs)("span",{className:"flex items-center gap-1",children:[(0,l.jsx)(D.MessageSquare,{className:"h-3.5 w-3.5"}),en.commentCount||ea.length]})]})]}),(0,l.jsx)("div",{className:"prose max-w-none break-words overflow-x-hidden py-6 text-base leading-relaxed text-neutral-800 [&_p:empty]:min-h-[1em] [&_img]:max-w-full [&_img]:rounded [&_a]:text-primary [&_a]:underline [&_a]:break-all [&_table]:w-full [&_table]:border-collapse [&_td]:border [&_td]:border-neutral-200 [&_td]:p-2 [&_th]:border [&_th]:border-neutral-200 [&_th]:p-2 [&_iframe]:w-full [&_iframe]:aspect-video [&_iframe]:rounded [&_.ql-video]:w-full [&_.ql-video]:aspect-video [&_.ql-video]:rounded [&_pre]:overflow-x-auto",dangerouslySetInnerHTML:{__html:(0,Z.sanitizeRichText)(en.content)}}),en.tags&&en.tags.length>0&&(0,l.jsx)("div",{className:"flex flex-wrap gap-1.5 pb-2",children:en.tags.map(e=>(0,l.jsxs)(s.default,{href:(0,o.getLocalizedPath)(d,t?`/info/${t}?tag=${encodeURIComponent(e.slug)}`:`/info?tag=${encodeURIComponent(e.slug)}`),className:"inline-flex items-center rounded-full border border-primary/30 px-2.5 py-1 text-xs font-medium text-primary/80 transition-colors hover:bg-primary/10 hover:text-primary",children:["#",e.name]},e.id))}),(()=>{if(!en.gameLinks||0===en.gameLinks.length)return null;let e=function(e){let t,r=new Set,l=/class="game-embed-card"[^>]*data-game-id="(\d+)"/g;for(;null!==(t=l.exec(e));){let e=Number(t[1]);e>0&&r.add(e)}return r}(en.content),t=en.gameLinks.filter(t=>!e.has(t.gameId));return 0===t.length?null:(0,l.jsx)("div",{className:"flex flex-wrap gap-2 pb-2",children:t.map(e=>(0,l.jsxs)(s.default,{href:(0,J.gameDetailHref)(d,e.gameId,"POST"),className:"flex items-center gap-2 rounded-lg border border-neutral-200 px-3 py-2 transition-colors hover:border-primary/30 hover:bg-primary/5",children:[e.thumbnailUrl?(0,l.jsx)("img",{src:e.thumbnailUrl,alt:"",className:"h-8 w-8 rounded object-cover"}):(0,l.jsx)("div",{className:"flex h-8 w-8 items-center justify-center rounded bg-neutral-100 text-xs text-neutral-400",children:"G"}),(0,l.jsx)("span",{className:"text-sm font-medium text-neutral-700",children:e.gameName})]},e.gameId))})})(),(()=>{if(!en.contentReferences||0===en.contentReferences.length)return null;let e=function(e){let t,r=new Set,l=/class="sc-embed-card"[^>]*data-sc-id="(\d+)"/g;for(;null!==(t=l.exec(e));){let e=Number(t[1]);e>0&&r.add(e)}return r}(en.content),t=en.contentReferences.filter(t=>!e.has(t.socialContentId));return 0===t.length?null:(0,l.jsxs)("div",{className:"space-y-3 pb-2",children:[(0,l.jsx)("p",{className:"text-sm font-medium text-neutral-500",children:r("board.linkedContent",{defaultMessage:"관련 콘텐츠"})}),t.map(e=>"YOUTUBE"===e.platform&&e.embedHtml?(0,l.jsxs)("div",{className:"overflow-hidden rounded-lg border border-neutral-200",children:[(0,l.jsx)("div",{className:"aspect-video w-full [&_iframe]:h-full [&_iframe]:w-full",dangerouslySetInnerHTML:{__html:(0,Z.sanitizeEmbedHtml)(e.embedHtml)}}),(0,l.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2",children:[(0,l.jsx)("span",{className:"rounded-full bg-red-100 px-1.5 py-0.5 text-[10px] font-medium text-red-600",children:"YouTube"}),(0,l.jsx)("span",{className:"flex-1 truncate text-sm text-neutral-700",children:e.title})]})]},e.socialContentId):(0,l.jsxs)("a",{href:e.sourceUrl,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-3 rounded-lg border border-neutral-200 px-3 py-2 transition-colors hover:border-primary/30 hover:bg-primary/5",children:[e.thumbnailUrl?(0,l.jsx)("img",{src:e.thumbnailUrl,alt:"",className:"h-12 w-12 rounded object-cover"}):(0,l.jsx)("div",{className:"flex h-12 w-12 items-center justify-center rounded bg-neutral-100 text-xs text-neutral-400",children:"SC"}),(0,l.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,l.jsx)("p",{className:"truncate text-sm font-medium text-neutral-700",children:e.title}),(0,l.jsx)("span",{className:"rounded-full bg-neutral-100 px-1.5 py-0.5 text-[10px] text-neutral-500",children:e.platform})]})]},e.socialContentId))]})})(),(0,l.jsxs)("div",{className:"flex items-center justify-between border-t border-neutral-100 pt-5",children:[(0,l.jsx)("div",{}),(0,l.jsx)(ee,{articleId:e,initialLiked:en.liked,initialLikeCount:en.likeCount,onLoginRequired:()=>x(!0)})]})]}),(0,l.jsxs)("div",{className:"border-t border-neutral-100",children:[en.prevId>
10?(0,l.jsxs)(s.default,{href:(0,o.getLocalizedPath)(d,`/info/post/${t??0}/${en.prevId}`),className:"flex items-center gap-2 border-b border-neutral-100 px-6 py-3 text-sm text-neutral-600 hover:bg-neutral-50 transition-colors",children:[(0,l.jsx)("svg",{className:"h-4 w-4 flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 15l7-7 7 7"})}),(0,l.jsx)("span",{className:"text-xs text-neutral-400 flex-shrink-0",children:r("board.prev")})]}):null,en.nextId>0?(0,l.jsxs)(s.default,{href:(0,o.getLocalizedPath)(d,`/info/post/${t??0}/${en.nextId}`),className:"flex items-center gap-2 px-6 py-3 text-sm text-neutral-600 hover:bg-neutral-50 transition-colors",children:[(0,l.jsx)("svg",{className:"h-4 w-4 flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})}),(0,l.jsx)("span",{className:"text-xs text-neutral-400 flex-shrink-0",children:r("board.next")})]}):null]})]}),q?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("div",{className:"fixed inset-0 z-50 bg-black/40",role:"presentation",onClick:()=>U(!1),onKeyDown:e=>{"Escape"===e.key&&U(!1)}}),(0,l.jsxs)("div",{className:"fixed left-1/2 top-1/2 z-50 w-72 -translate-x-1/2 -translate-y-1/2 rounded-2xl bg-white p-6 shadow-2xl",children:[(0,l.jsx)("h3",{className:"mb-2 text-base font-bold text-black",children:r("board.delete")}),(0,l.jsx)("p",{className:"mb-5 text-sm text-neutral-500",children:r("board.confirmDelete")}),(0,l.jsxs)("div",{className:"flex gap-2",children:[(0,l.jsx)("button",{type:"button",onClick:()=>U(!1),className:"flex-1 rounded-xl border border-neutral-200 py-2.5 text-sm text-neutral-600 hover:bg-neutral-50 transition-colors",children:r("board.comment.cancel")}),(0,l.jsx)("button",{type:"button",onClick:()=>{U(!1),es()},className:"flex-1 rounded-xl bg-red-500 py-2.5 text-sm font-medium text-white hover:bg-red-600 transition-colors",children:r("board.delete")})]})]})]}):null,(0,l.jsxs)("div",{className:"mt-4 rounded-2xl bg-white p-5 md:p-6",children:[(0,l.jsxs)("h3",{className:"mb-4 text-base font-bold text-black",children:[r("board.comment.title")," ",(0,l.jsx)("span",{className:"text-primary",children:en.commentCount||ea.length})]}),(0,l.jsxs)("div",{className:"mb-6",children:[(0,l.jsx)("textarea",{value:E,onChange:e=>L(e.target.value),placeholder:v?r("board.comment.placeholder"):r("board.comment.loginRequired"),disabled:!v,onClick:v?void 0:()=>x(!0),className:"w-full rounded-xl border border-neutral-200 p-3 text-sm focus:outline-none focus:ring-1 focus:ring-primary disabled:cursor-pointer disabled:bg-neutral-50",rows:3}),(0,l.jsxs)("div",{className:"mt-2 flex items-center justify-between",children:[(0,l.jsxs)("span",{className:"text-xs text-neutral-400",children:[E.length," / 1000"]}),(0,l.jsx)("button",{type:"button",onClick:ed,disabled:!E.trim()||S,className:"rounded-lg bg-primary px-4 py-2 text-sm font-medium text-white disabled:opacity-50 hover:bg-primary/90 transition-colors",children:r("board.comment.submit")})]})]}),ea.length>0?(0,l.jsx)("div",{className:"border-t border-neutral-100 pt-4",children:ea.map((t,r)=>(0,l.jsx)(X,{itemKey:`root-${r}`,comment:t,articleId:e,currentUserId:y?.id},`${t.id??t.commentId??e}-${r}`))}):(0,l.jsx)("p",{className:"py-8 text-center text-sm text-neutral-400",children:r("board.comment.empty")})]})]})}var er=e.i(70703);let el="snsLinkCard";function en(e){return(e??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function ea(e){return en(e).replace(/"/g,"&quot;")}function es(e){let t=e.getAttribute("href")??"";if(e.dataset.heading||e.dataset.host||e.dataset.image||e.dataset.description)return{url:t,image:e.dataset.image||e.querySelector("img")?.getAttribute("src")||"",heading:e.dataset.heading||"",description:e.dataset.description||"",host:e.dataset.host||""};let r=e.querySelector("img")?.getAttribute("src")||"",l=e.querySelector(":scope > div"),n=l?Array.from(l.querySelectorAll(":scope > div")):[],a="",s="",i="";return n.length>=3?(a=n[0].textContent?.trim()||"",s=n[1].textContent?.trim()||"",i=n[n.length-1].textContent?.trim()||""):2===n.length?(a=n[0].textContent?.trim()||"",i=n[1].textContent?.trim()||""):1===n.length&&(a=n[0].textContent?.trim()||""),{url:t,image:r,heading:a,description:s,host:i}}let ei=!1,eo="gameEmbed";function ed(e){return(e??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function ec(e){return ed(e).replace(/"/g,"&quot;")}function eu(e){return{gameId:Number(e.dataset.gameId)||0,title:e.dataset.title||"",thumbnailUrl:e.dataset.thumbnailUrl||null}}let em=!1,ex="scEmbed";function eh(e){return(e??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function ep(e){return eh(e).replace(/"/g,"&quot;")}let eb={YOUTUBE:"background:#fee2e2;color:#dc2626;",TWITCH:"background:#ede9fe;color:#7c3aed;",BLUESKY:"background:#dbeafe;color:#2563eb;",X:"background:#f5f5f5;color:#333;"};function ef(e){return{scId:Number(e.dataset.scId)||0,title:e.dataset.title||"",thumbnailUrl:e.dataset.thumbnailUrl||null,sourceUrl:e.dataset.sourceUrl||e.getAttribute("href")||"",platform:e.dataset.platform||""}}let eg=!1,ey=(0,er.default)(async()=>{var t;let r,l=await e.A(14357),n=l.default.Quill??(await e.A(76724)).default,a=n.import("attributors/class/size");return a.whitelist=["small","medium","large","huge"],n.register(a,!0),!function(e){if(ei)return;let t=e.import("blots/block/embed");e.register(class extends t{static blotName=el;static tagName="A";static className="sns-link-card";static create(e){let t=super.create();t.setAttribute("href",e.url||"#"),t.setAttribute("target","_blank"),t.setAttribute("rel","noopener noreferrer"),t.setAttribute("style","display:flex;align-items:stretch;max-width:480px;margin:8px 0;border:1px solid #e5e5e5;border-radius:12px;overflow:hidden;text-decoration:none;color:inherit;background:#fff;"),e.image&&(t.dataset.image=e.image),e.heading&&(t.dataset.heading=e.heading),e.description&&(t.dataset.description=e.description),e.host&&(t.dataset.host=e.host);let r="";return e.image&&(r+=`<img src="${ea(e.image)}" alt="${ea(e.heading||"")}" style="width:120px;height:120px;object-fit:cover;flex-shrink:0;" />`),r+='<div style="display:flex;flex-direction:column;justify-content:center;gap:4px;padding:12px 14px;min-width:0;">',e.heading&&(r+=`<div style="font-weight:700;font-size:14px;color:#222;">${en(e.heading)}</div>`),e.description&&(r+=`<div style="font-size:13px;color:#666;line-height:1.4;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;">${en(e.description)}</div>`),e.host&&(r+=`<div style="font-size:12px;color:#999;">${en(e.host)}</div>`),t.innerHTML=r+="</div>",t.addEventListener("click",e=>e.preventDefault()),t}static value(e){return es(e)}},!0),ei=!0}(n),!function(e){if(em)return;let t=e.import("blots/block/embed");e.register(class extends t{static blotName=eo;static tagName="A";static className="game-embed-card";static create(e){let t=super.create();t.setAttribute("href",`/game/${e.gameId}?ref=POST`),t.setAttribute("target","_blank"),t.setAttribute("rel","noopener noreferrer"),t.setAttribute("style","display:flex;align-items:center;gap:12px;max-width:480px;margin:8px 0;padding:10px 14px;border:1px solid #e5e5e5;border-radius:12px;text-decoration:none;color:inherit;background:#fff;"),t.dataset.gameId=String(e.gameId),t.dataset.title=e.title,t.dataset.thumbnailUrl=e.thumbnailUrl||"";let r="";return e.thumbnailUrl?r+=`<img src="${ec(e.thumbnailUrl)}" alt="${ec(e.title)}" style="width:48px;height:48px;border-radius:8px;object-fit:cover;flex-shrink:0;" />
1`:r+='<span style="display:flex;width:48px;height:48px;border-radius:8px;background:#f5f5f5;align-items:center;justify-content:center;flex-shrink:0;font-size:12px;color:#999;">G</span>',t.innerHTML=r+=`<span style="display:block;min-width:0;"><span style="display:block;font-weight:700;font-size:14px;color:#222;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;">${ed(e.title)}</span></span>`,t.addEventListener("click",e=>e.preventDefault()),t}static value(e){return eu(e)}},!0),em=!0}(n),!function(e){if(eg)return;let t=e.import("blots/block/embed");e.register(class extends t{static blotName=ex;static tagName="A";static className="sc-embed-card";static create(e){let t=super.create();t.setAttribute("href",e.sourceUrl||"#"),t.setAttribute("target","_blank"),t.setAttribute("rel","noopener noreferrer"),t.setAttribute("style","display:flex;align-items:center;gap:12px;max-width:480px;margin:8px 0;padding:10px 14px;border:1px solid #e5e5e5;border-radius:12px;text-decoration:none;color:inherit;background:#fff;"),t.dataset.scId=String(e.scId),t.dataset.title=e.title,t.dataset.thumbnailUrl=e.thumbnailUrl||"",t.dataset.sourceUrl=e.sourceUrl,t.dataset.platform=e.platform;let r="";return e.thumbnailUrl?r+=`<img src="${ep(e.thumbnailUrl)}" alt="${ep(e.title)}" style="width:48px;height:48px;border-radius:8px;object-fit:cover;flex-shrink:0;" />`:r+='<span style="display:flex;width:48px;height:48px;border-radius:8px;background:#f5f5f5;align-items:center;justify-content:center;flex-shrink:0;font-size:11px;color:#999;">SC</span>',t.innerHTML=r+=`<span style="display:block;min-width:0;"><span style="display:block;font-weight:700;font-size:14px;color:#222;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;">${eh(e.title)}</span><span style="display:inline-block;margin-top:2px;padding:1px 6px;border-radius:9999px;font-size:10px;font-weight:500;${eb[e.platform]||"background:#f5f5f5;color:#666;"}">${eh(e.platform)}</span></span>`,t.addEventListener("click",e=>e.preventDefault()),t}static value(e){return ef(e)}},!0),eg=!0}(n),r=(t=n).import("blots/block/embed"),t.register(class extends r{static blotName="video";static tagName="IFRAME";static className="ql-video";static create(e){let t=super.create();return t.setAttribute("src",e),t.setAttribute("frameborder","0"),t.setAttribute("allowfullscreen","true"),t.setAttribute("allow","accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"),t}static value(e){return e.getAttribute("src")??""}},!0),l},{loadableGenerated:{modules:[50402]},ssr:!1,loading:()=>(0,l.jsx)("div",{className:"min-h-[320px] rounded-lg border border-neutral-200 bg-white"})});function ev({defaultValue:e="",onChange:t,onUploadImage:r,onRequestGameEmbed:s,onRequestScEmbed:i,embedRef:o,initialEmbeds:d}){let c=(0,a.useTranslations)("common"),u=(0,n.useRef)(null),m=(0,n.useRef)(null),x=(0,n.useRef)(!1),h=(0,n.useRef)(!1),[p,b]=(0,n.useState)(!1),[f,g]=(0,n.useState)(""),y=(0,n.useRef)(null);(0,n.useEffect)(()=>{if(o)return o.current={insertEmbed(e,r){let l=u.current?.getEditor?.();if(!l)return;let n=l.getSelection(!0),a=n?.index??l.getLength()-1,s=l.getContents(a,1);s.ops?.length===1&&"\n"===s.ops[0].insert&&a<l.getLength()-1&&l.deleteText(a,1,"silent"),l.insertEmbed(a,e,r,"user"),l.setSelection(a+1,0),t(l.root.innerHTML)},setContents(e){let t=u.current?.getEditor?.();t&&(h.current=!0,t.setContents([],"silent"),e&&t.clipboard.dangerouslyPasteHTML(0,e,"silent"),requestAnimationFrame(()=>{h.current=!1}))}},()=>{o.current=null}},[o,t]),(0,n.useEffect)(()=>{let e,t=!1,r=()=>{let l;if(t)return;try{l=u.current?.getEditor?.()}catch{}if(!l)return void setTimeout(r,200);let n=".game-embed-card, .sc-embed-card, .sns-link-card",a=e=>{let t=l.scroll.find(e);if(t){let e=l.getIndex(t);l.setSelection(e,1)}},s=e=>{let t=e.target.closest?.(n);t&&(e.preventDefault(),e.stopPropagation(),a(t))},i=e=>{let t=e.target.closest?.(n);t&&(e.preventDefault(),e.stopPropagation(),a(t))},o=e=>{let t=document.getSelection();if(!t?.anchorNode)return;let r=t.anchorNode instanceof Element?t.anchorNode:t.anchorNode.parentElement;r?.closest(n)&&e.preventDefault()},d={capture:!0};l.root.addEventListener("mousedown",s,d),l.root.addEventListener("click",i,d),l.root.addEventListener("beforeinput",o,d),e=()=>{l.root.removeEventListener("mousedown",s,d),l.root.removeEventListener("click",i,d),l.root.removeEventListener("beforeinput",o,d)}};return r(),()=>{t=!0,e?.()}},[]),(0,n.useEffect)(()=>
1{if(!e||x.current)return;let r=!1,l=()=>{let n;if(!r&&!x.current){try{n=u.current?.getEditor?.()}catch{}if(!n)return void setTimeout(l,100);h.current=!0;try{!function(e,t){let r=[],l=0,n=new DOMParser().parseFromString(t,"text/html"),a=(e,t,a)=>{let s=`QLEMB${l++}`;r.push({key:s,type:t,value:a});let i=n.createElement("p");i.textContent=s,e.replaceWith(i)};if(n.querySelectorAll("iframe").forEach(e=>{let t=e.getAttribute("src")??"";t&&a(e,"video",t)}),n.querySelectorAll("a.sns-link-card").forEach(e=>{a(e,el,es(e))}),n.querySelectorAll("a.game-embed-card").forEach(e=>{a(e,eo,eu(e))}),n.querySelectorAll("a.sc-embed-card").forEach(e=>{a(e,ex,ef(e))}),e.clipboard.dangerouslyPasteHTML(n.body.innerHTML),0===r.length)return;for(let{key:t,type:l,value:n}of[...r].reverse()){let r=e.getContents().ops??[],a=0,s=!1;for(let e of r)if("string"==typeof e.insert){let r=e.insert.indexOf(t);if(-1!==r){a+=r,s=!0;break}a+=e.insert.length}else a++;s&&(e.deleteText(a,t.length,"api"),e.insertEmbed(a,l,n,"api"))}let s=e.getContents().ops??[],i=0,o=[];for(let e=0;e<s.length;e++){let t=s[e];if("string"==typeof t.insert)for(let r=0;r<t.insert.length;r++){if("\n"===t.insert[r]&&1===t.insert.length&&e>0&&e<s.length-1){let t=s[e-1],r=s[e+1];"object"==typeof t.insert&&"object"==typeof r.insert&&o.push(i)}i++}else i++}for(let t=o.length-1;t>=0;t--)e.deleteText(o[t],1,"silent")}(n,e)}catch{n.clipboard.dangerouslyPasteHTML(e)}if(d&&d.length>0){for(let{type:e,value:t}of d){let r=n.getLength()-1,l=n.getContents(r,1);l.ops?.length===1&&"\n"===l.ops[0].insert&&r>0?(n.deleteText(r,1,"silent"),n.insertEmbed(n.getLength()-1,e,t,"api")):n.insertEmbed(r,e,t,"api")}t(n.root.innerHTML)}x.current=!0,requestAnimationFrame(()=>{h.current=!1})}};return l(),()=>{r=!0}},[e]);let v=(0,n.useCallback)(()=>{m.current?.click()},[]),j=(0,n.useCallback)(()=>{g(""),b(!0),requestAnimationFrame(()=>y.current?.focus())},[]),N=(0,n.useCallback)(()=>{s?.()},[s]),k=(0,n.useCallback)(()=>{i?.()},[i]),w=(0,n.useCallback)(async e=>{let l=e.target.files?.[0];if(!l||!r)return;let n=u.current?.getEditor?.();if(n)try{let e=await r(l),a=n.getSelection(!0);n.insertEmbed(a?.index??0,"image",e),n.setSelection((a?.index??0)+1,0),t(n.root.innerHTML)}catch{}finally{m.current&&(m.current.value="")}},[t,r]),C=(0,n.useCallback)(()=>{let e,r=u.current?.getEditor?.();if(!r||!f.trim())return void b(!1);let l=(e=ej(f.trim()))?`https://www.youtube.com/embed/${e}`:null;if(!l)return void H.toast.error(c("youtubeInvalidUrl"));let n=r.getSelection(!0);r.insertEmbed(n?.index??0,"video",l),r.setSelection((n?.index??0)+1,0),t(r.root.innerHTML),b(!1)},[f,t,c]),E=(0,n.useMemo)(()=>({key:["Backspace","Delete"],handler(e){if(e.length>0){let t=this.quill.getLength();return 0===e.index&&e.length>=t-1?this.quill.setContents([{insert:"\n"}],"user"):this.quill.deleteText(e.index,e.length,"user"),this.quill.setSelection(Math.min(e.index,this.quill.getLength()-1),0),!1}return!0}}),[]),L=(0,n.useMemo)(()=>({toolbar:{container:[[{font:[]}],[{size:["small",!1,"medium","large","huge"]}],["bold","italic","underline","strike"],[{color:[]},{background:[]}],[{align:[]}],[{list:"ordered"},{list:"bullet"}],["link",...r?["image"]:[],"video",...s?["gameEmbed"]:[],...i?["scEmbed"]:[]]],handlers:{...r?{image:v}:{},video:j,...s?{gameEmbed:N}:{},...i?{scEmbed:k}:{}}},keyboard:{bindings:{selectionDelete:E}}}),[v,j,N,k,r,s,i,E]),I=ej(f);return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(ey,{ref:u,theme:"snow",defaultValue:"",onChange:e=>{h.current||t(e)},modules:L,className:"quill-editor"}),r&&(0,l.jsx)("input",{ref:m,type:"file",accept:"image/*",className:"hidden",onChange:w}),p&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("div",{className:"fixed inset-0 z-50 bg-black/40",role:"presentation",onClick:()=>b(!1),onKeyDown:e=>{"Escape"===e.key&&b(!1)}}),(0,l.jsxs)("div",{className:"fixed left-1/2 top-1/2 z-50 w-96 -translate-x-1/2 -translate-y-1/2 rounded-2xl bg-white p-5 shadow-2xl",children:[(0,l.jsx)("h3",{className:"mb-3 text-sm font-bold text-black",children:"YouTube URL"}),(0,l.jsx)("input",{ref:y,type:"text",value:f,onChange:e=>g(e.target.value),onKeyDown:e=>"Enter"===e.key&&C(),placeholder:"https://www.youtube.com/watch?v=...",className:"w-full rounded-lg border border-neutral-200 px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-primary"}),(0,l.jsx)("div",{className:"mt-3 flex items-center justify-center overflow-hidden rounded-xl bg-neutral-100",style:{minHeight:180},children:I?(0,l.jsx)("iframe",{src:`https://www.youtube.com/embed/${I}`,title:"YouTube preview",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,className:"h-[180px] w-full"}):(0,l.jsx)("span",{className:"text-xs text-neutral-400",children:c("youtubePreview")})}),(0,l.jsxs)("div",{className:"mt-3 flex gap-2",children:[(0,l.jsx)("button",{type:"button",onClick:()=>b(!1),className:"flex-1 rounded-lg border border-neutral-200 py-2 text-sm text-neutral-600 hover:bg-neutral-50 transition-colors",children:c("popup.cancel")}),(0,l.jsx)("button",{type:"button",onClick:C,disabled:!I,className:"flex-1 rounded-lg bg-primary py-2 text-sm font-medium text-white hover:bg-primary/90 transition-colors disabled:opacity-50",children:c("popup.confirm")})]})]})]})]})}function ej(e){try{let t=new URL(e);if(t.hostname.includes("youtube.com")&&t.searchParams.get("v"))return t.searchParams.get("v");if("youtu.be"===t.hostname)return t.pathname.slice(1).split("/")[0];if(t.hostname.includes("youtube.com")){let e=t.pathname.match(/\/(?:embed|v|shorts|live)\/([^/?]+)/);if(e)return e[1]}}catch{}return""}var eN=e.i(12273),ek=e.i(91039);function ew({isOpen:e,onClose:t,onSelectGame:r,onSelectSc:s,gameCount:i,scCount:o,defaultTab:d="game"}){let c=(0,a.useTranslations)("info"),u=(0,a.useTranslations)("common"),m=(0,eN.useIsMobile)(),[x,h]=(0,n.use
1State)(d),[p,b]=(0,n.useState)(""),[f,g]=(0,n.useState)([]),[y,j]=(0,n.useState)([]),[N,k]=(0,n.useState)(!1),w=(0,n.useRef)(void 0),C=(0,n.useRef)(null);(0,n.useEffect)(()=>{e&&(h(d),b(""),g([]),j([]),requestAnimationFrame(()=>C.current?.focus()))},[e,d]);let E=(0,n.useCallback)((e,t)=>{if(w.current&&clearTimeout(w.current),!e.trim()){g([]),j([]);return}w.current=setTimeout(async()=>{k(!0);try{if("game"===t){let t=await (0,ek.fetchGameSearch)(e.trim());g(t.map(e=>({id:e.gameId,title:e.title,thumbnailUrl:e.thumbnailUrl})))}else{let t=await (0,I.searchSocialContentsForEditor)(e.trim());j(t)}}catch{}finally{k(!1)}},300)},[]),L=e=>{h(e),b(""),g([]),j([]),requestAnimationFrame(()=>C.current?.focus())};if(!e)return null;let S=(0,l.jsxs)("div",{className:m?"fixed inset-x-0 bottom-0 z-50 flex max-h-[80vh] flex-col rounded-t-2xl bg-white shadow-2xl":"fixed left-1/2 top-1/2 z-50 flex max-h-[70vh] w-[480px] -translate-x-1/2 -translate-y-1/2 flex-col rounded-2xl bg-white shadow-2xl",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between border-b border-neutral-100 px-5 py-4",children:[(0,l.jsx)("h3",{className:"text-sm font-bold text-black",children:c("editor.embedInsert",{defaultMessage:"임베드 삽입"})}),(0,l.jsx)("button",{type:"button",onClick:t,className:"p-1 text-neutral-400 hover:text-neutral-600",children:(0,l.jsx)(v.X,{className:"h-4 w-4"})})]}),(0,l.jsxs)("div",{className:"flex border-b border-neutral-100",children:[(0,l.jsxs)("button",{type:"button",onClick:()=>L("game"),className:`flex-1 py-2.5 text-sm font-medium transition-colors ${"game"===x?"border-b-2 border-primary text-primary":"text-neutral-400 hover:text-neutral-600"}`,children:[c("editor.games",{defaultMessage:"게임"})," (",i,"/5)"]}),(0,l.jsxs)("button",{type:"button",onClick:()=>L("content"),className:`flex-1 py-2.5 text-sm font-medium transition-colors ${"content"===x?"border-b-2 border-primary text-primary":"text-neutral-400 hover:text-neutral-600"}`,children:[c("editor.socialContents",{defaultMessage:"콘텐츠"})," (",o,"/10)"]})]}),(0,l.jsx)("div",{className:"px-4 pt-3 pb-2",children:(0,l.jsx)("input",{ref:C,type:"text",value:p,onChange:e=>{b(e.target.value),E(e.target.value,x)},placeholder:"game"===x?c("editor.gamesPlaceholder",{defaultMessage:"게임 이름을 검색하세요"}):c("editor.socialContentsPlaceholder",{defaultMessage:"콘텐츠 제목을 검색하세요"}),className:"w-full rounded-lg border border-neutral-200 px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-primary"})}),(0,l.jsxs)("div",{className:"flex-1 overflow-y-auto px-4 pb-4",children:[N&&(0,l.jsx)("div",{className:"py-8 text-center text-sm text-neutral-400",children:u("loading",{defaultMessage:"검색 중..."})}),!N&&"game"===x&&0===f.length&&p.trim()&&(0,l.jsx)("div",{className:"py-8 text-center text-sm text-neutral-400",children:u("noResults",{defaultMessage:"검색 결과가 없습니다"})}),!N&&"content"===x&&0===y.length&&p.trim()&&(0,l.jsx)("div",{className:"py-8 text-center text-sm text-neutral-400",children:u("noResults",{defaultMessage:"검색 결과가 없습니다"})}),"game"===x&&f.map(e=>(0,l.jsxs)("button",{type:"button",disabled:i>=5,onClick:()=>{r({gameId:e.id,title:e.title,thumbnailUrl:e.thumbnailUrl})},className:"flex w-full items-center gap-3 rounded-lg px-2 py-2 text-left transition-colors hover:bg-primary/5 disabled:opacity-50",children:[e.thumbnailUrl?(0,l.jsx)("img",{src:e.thumbnailUrl,alt:"",className:"h-10 w-10 rounded-lg object-cover"}):(0,l.jsx)("div",{className:"flex h-10 w-10 items-center justify-center rounded-lg bg-neutral-100 text-xs text-neutral-400",children:"G"}),(0,l.jsx)("span",{className:"flex-1 truncate text-sm text-neutral-800",children:e.title})]},e.id)),"content"===x&&y.map(e=>(0,l.jsxs)("button",{type:"button",disabled:o>=10,onClick:()=>{s({scId:e.id,title:e.title,thumbnailUrl:e.thumbnailUrl,sourceUrl:e.sourceUrl,platform:e.platform})},className:"flex w-full items-center gap-3 rounded-lg px-2 py-2 text-left transition-colors hover:bg-primary/5 disabled:opacity-50",children:[e.thumbnailUrl?(0,l.jsx)("img",{src:e.thumbnailUrl,alt:"",className:"h-10 w-10 rounded-lg object-cover"}):(0,l.jsx)("div",{className:"flex h-10 w-10 items-center justify-center rounded-lg bg-neutral-100 text-[10px] text-neutral-400",children:"SC"}),(0,l.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,l.jsx)("p",{className:"truncate text-sm text-neutral-800",children:e.title}),(0,l.jsx)("span",{className:"mt-0.5 inline-block rounded-full bg-neutral-100 px-1.5 py-0.5 text-[10px] text-neutral-500",children:e.platform})]})]},e.id))]})]});return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("div",{className:"fixed inset-0 z-50 bg-black/40",role:"presentation",onClick:t,onKeyDown:e=>{"Escape"===e.key&&t()}}),S]})}let eC={title:"",content:"",published:!0};function eE(e){return""!==e.title.trim()&&eI(e.content)}function eL(e){return""!==e.title.trim()}function eI(e){return!!e&&(!!(/<(img|iframe|figure)\b/i.test(e)||/class="(game-embed-card|
1sc-embed-card)"/.test(e))||""!==e.replace(/<[^>]*>/g,"").replace(/&nbsp;/gi," ").trim())}function eS({boardId:e,articleId:t}){let r=(0,a.useTranslations)("info"),s=(0,i.useLocale)(),d=(0,p.useRouter)(),c=(0,g.useQueryClient)(),{setLoginModalOpen:h}=(0,Q.useUiStore)(),{isLoggedIn:y,isAdmin:v,isCreator:N,isGameCompany:k,user:w}=(0,C.useAuthStore)(),E=!!t,L=N||k||v,[S,T]=(0,n.useState)({}),[M,A]=(0,n.useState)(""),[$,q]=(0,n.useState)({}),[U,P]=(0,n.useState)(e),R=(0,n.useMemo)(()=>Object.keys(S),[S]),D=S[M]??eC,z=D.title,K=D.content,F=(0,n.useCallback)(e=>{T(t=>M?{...t,[M]:{...t[M]??eC,...e}}:t)},[M]),_=(0,n.useCallback)(e=>F({title:e}),[F]),O=(0,n.useCallback)(e=>F({content:e}),[F]),G=(0,n.useCallback)(e=>{e!==M&&(A(e),eu.current?.setContents(S[e]?.content??""))},[M,S]),B=(0,n.useCallback)((e,t)=>{if(t){T(t=>t[e]?t:{...t,[e]:{...eC}}),G(e);return}let l=S[e];if((!(l&&(""!==l.title.trim()||eI(l.content)))||window.confirm(r("editor.confirmRemoveLanguage")))&&(T(t=>{let r={...t};return delete r[e],r}),M===e)){let t=Object.keys(S).filter(t=>t!==e)[0]??"";A(t),eu.current?.setContents(S[t]?.content??"")}}
1,[S,M,G,r]),[V,Y]=(0,n.useState)("GUEST"),[X,J]=(0,n.useState)(!E),[Z,ee]=(0,n.useState)([]),[et,er]=(0,n.useState)(""),[el,en]=(0,n.useState)([]),[ea,es]=(0,n.useState)(!1),ei=(0,n.useRef)(null),ed=(0,n.useRef)(null),ec=(0,n.useRef)(void 0),eu=(0,n.useRef)(null),[em,eh]=(0,n.useState)(!1),[ep,eb]=(0,n.useState)("game"),[ef,eg]=(0,n.useState)([]),ey=(0,n.useCallback)(()=>{eb("game"),eh(!0)},[]),ej=(0,n.useCallback)(()=>{eb("content"),eh(!0)},[]),eN=(0,n.useMemo)(()=>eT(K),[K]),ek=(0,n.useCallback)(e=>{if(ec.current&&clearTimeout(ec.current),!e.trim()){en([]),es(!1);return}ec.current=setTimeout(async()=>{try{let t=(await (0,I.searchPostTags)(e.trim())).filter(e=>!Z.includes(e.name));en(t),es(t.length>0)}catch{en([])}},300)},[Z]),eM=(0,n.useCallback)(e=>{let t=e.trim();!t||Z.length>=5||Z.includes(t)||(ee(e=>[...e,t]),er(""),en([]),es(!1))},[Z]),eA=(0,n.useCallback)(e=>{ee(t=>t.filter(t=>t!==e))},[]);(0,n.useEffect)(()=>{let e=e=>{ed.current&&!ed.current.contains(e.target)&&ei.current&&!ei.current.contains(e.target)&&es(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);let{data:e$=[]}=(0,b.useQuery)({queryKey:["supportedLanguages"],queryFn:I.fetchSupportedLanguages,staleTime:18e5});(0,n.useEffect)(()=>{if(E||0===e$.length||Object.keys(S).length>0)return;let e=s.toUpperCase(),t=e$.find(t=>t.code.toUpperCase()===e)?.code??e$[0].code;T({[t]:{...eC}}),A(t)},[e$,E,s]);let{data:eq}=(0,b.useQuery)({queryKey:j.queryKeys.info.articleDetail(s,t??0).queryKey,queryFn:()=>(0,I.fetchInfoArticleDetail)(t),enabled:E,staleTime:0}),{data:eU}=(0,b.useQuery)({queryKey:["info","articleTranslations",t??0],queryFn:()=>(0,I.fetchInfoArticleTranslations)(t),enabled:E,staleTime:0});(0,n.useEffect)(()=>{if(!eU||0===eU.length)return;let e={};for(let t of eU)e[t.language]={title:t.title,content:t.content,published:t.published};q(e),T(e);let t=s.toUpperCase();A(e[t]?t:eU[0].language)},[eU,s]),(0,n.useEffect)(()=>{if(!eq?.post)return;let r=eq.post;if(w&&r.authorId!==w.id&&!v)return void d.replace((0,o.getLocalizedPath)(s,`/info/post/${e??0}/${t}`));P(r.board?.id??function(e){if(!e)return;let t=Object.entries(m).find(([,t])=>t===e);return t?Number(t[0]):void 0}(r.postType)),r.requiredRole&&Y(r.requiredRole),r.tags&&ee(r.tags.map(e=>e.name));let l=r.content.includes("game-embed-card"),n=r.content.includes("sc-embed-card"),a=[];if(r.gameLinks&&r.gameLinks.length>0&&!l)for(let e of r.gameLinks)a.push({type:eo,value:{gameId:e.gameId,title:e.gameName,thumbnailUrl:e.thumbnailUrl}});if(r.contentReferences&&r.contentReferences.length>0&&!n)for(let e of r.contentReferences)a.push({type:ex,value:{scId:e.socialContentId,title:e.title,thumbnailUrl:e.thumbnailUrl,sourceUrl:e.sourceUrl,platform:e.platform}});eg(a),J(!0)},[eq,w,v,d,s,e,t]);let eP=x(U);R.join(",");let eR=(e,t)=>{let r=Object.keys(t),l=t[r[0]]??eC,n=new Set,a=new Set;for(let e of Object.values(t)){let t=function(e){let t=new DOMParser().parseFromString(e,"text/html");return{gameIds:[...new Set([...t.querySelectorAll("a.game-embed-card")].map(e=>Number(e.dataset.gameId)).filter(e=>e>0))],socialContentIds:[...new Set([...t.querySelectorAll("a.sc-embed-card")].map(e=>Number(e.dataset.scId)).filter(e=>e>0))]}}(e.content);t.gameIds.forEach(e=>n.add(e)),t.socialContentIds.forEach(e=>a.add(e))}let s={};for(let[e,r]of Object.entries(t))s[e]={title:r.title,content:r.content,published:r.published};return{title:l.title,content:l.content,postType:eP,language:r.join(","),translations:s,requiredRole:L?V:void 0,published:e,tags:Z.length>0?Z:void 0,gameIds:n.size>0?[...n]:void 0,socialContentIds:a.size>0?[...a]:void 0}},{mutate:eD,isPending:ez}=(0,f.useMutation)({mutationFn:({published:e,drafts:t})=>(0,I.createInfoArticle)(eR(e,t)),onSuccess:e=>{c.invalidateQueries({queryKey:j.queryKeys.info._def});let t=U??0;d.replace((0,o.getLocalizedPath)(s,`/info/post/${t}/${e}`))},onError:e=>{H.toast.error((0,W.getErrorMessage)(e))}}),{mutate:eK,isPending:eF}=(0,f.useMutation)({mutationFn:({published:e,drafts:r})=>(0,I.updateInfoArticle)(t,eR(e,r)),onSuccess:()=>{c.invalidateQueries({queryKey:j.queryKeys.info._def}
1),d.replace((0,o.getLocalizedPath)(s,`/info/post/${U??e??0}/${t}`))},onError:e=>{H.toast.error((0,W.getErrorMessage)(e))}}),e_=async e=>{let t=[...e.matchAll(/<img\s[^>]*src="data:image\/(\w+);base64,([^"]+)"[^>]*>/gi)];if(0===t.length)return e;let r=e;for(let e of t){let[t,l,n]=e,a=atob(n),s=new ArrayBuffer(a.length),i=new Uint8Array(s);for(let e=0;e<a.length;e++)i[e]=a.charCodeAt(e);let o=new File([s],`pasted-image.${l}`,{type:`image/${l}`}),d=await (0,I.uploadInfoPostImage)(o);r=r.replace(t,t.replace(/src="data:image\/\w+;base64,[^"]+"/,`src="${d}"`))}return r},eO=async e=>{if(!y)return void h(!0);if(0===Object.keys(S).length)return;if(e){let e=Object.entries(S).find(([,e])=>!eE(e));if(e){let t=e$.find(t=>t.code===e[0])?.label??e[0];H.toast.error(r("editor.incompleteLanguage",{language:t})),G(e[0]);return}}let t=Object.entries(S).map(([e,t])=>eL(t)?[e,t]:[e,$[e]]).filter(e=>!!e[1]&&eL(e[1])).map(([t,r])=>[t,{...r,published:(e||r.published)&&eE(r)}]);if(0===t.length)return void H.toast.error(r("editor.nothingToSave"));for(let[e,r]of t){let{gameCount:t,scCount:l}=eT(r.content),n=e$.find(t=>t.code===e)?.label??e;if(t>5){H.toast.error(`${n}: 게임 카드는 최대 5개까지 추가할 수 있습니다.`),G(e);return}if(l>10){H.toast.error(`${n}: 소셜 콘텐츠 카드는 최대 10개까지 추가할 수 있습니다.`),G(e);return}}let l=S;try{let e={};for(let[r,l]of t)e[r]={...l,content:await e_(l.content)};l=e,T(e)}catch{H.toast.error(r("editor.imageUploadFailed"));return}E?eK({published:e,drafts:l}):eD({published:e,drafts:l})},eG=ez||eF,eB=Object.values(S).filter(eE).length!==Object.keys(S).length,eH=Object.entries(S).filter(([e,t])=>eL(t)||eL($[e]??eC)).length,eW=eG||!E&&!U||0===R.length,eQ=eW||0===eH,eV=eW||eB,eY=E?(0,o.getLocalizedPath)(s,`/info/post/${U??e??0}/${t}`):(0,o.getLocalizedPath)(s,e?`/info/${e}`:"/info");return(0,l.jsxs)("div",{className:"w-full bg-neutral-50 min-h-screen",children:[(0,l.jsx)("div",{className:"container py-6 md:py-10",children:(0,l.jsxs)("div",{className:"rounded-2xl bg-white p-5 md:p-6",children:[(0,l.jsxs)("div",{className:"mb-6 flex items-center justify-between border-b border-neutral-100 pb-5",children:[(0,l.jsx)("h1",{className:"text-xl font-bold text-black",children:r(E?"editor.edit":"editor.write")}),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("button",{type:"button",onClick:()=>d.push(eY),className:"rounded-lg border border-neutral-200 px-4 py-2 text-sm text-neutral-600 hover:bg-neutral-50 transition-colors",children:r("editor.cancel")}),(0,l.jsx)("button",{type:"button",onClick:()=>eO(!1),disabled:eQ,className:"rounded-lg border border-neutral-200 px-4 py-2 text-sm text-neutral-600 hover:bg-neutral-50 transition-colors disabled:opacity-50",children:eG?r("editor.saving"):r("editor.saveDraft")}),(0,l.jsx)("button",{type:"button",onClick:()=>eO(!0),disabled:eV,className:"rounded-lg bg-primary px-4 py-2 text-sm font-medium text-white disabled:opacity-50 hover:bg-primary/90 transition-colors",children:eG?r("editor.saving"):r("editor.publish")})]})]}),(0,l.jsxs)("div",{className:"relative mb-4",children:[(0,l.jsxs)("select",{value:U??"",onChange:e=>P(e.target.value?Number(e.target.value):void 0),disabled:E,className:"w-full appearance-none rounded-xl border border-neutral-200 pl-3 pr-8 py-2.5 text-sm focus:outline-none focus:ring-1 focus:ring-primary disabled:bg-neutral-50 disabled:cursor-not-allowed",children:[(0,l.jsx)("option",{value:"",children:r("editor.selectBoard")}),u.filter(e=>E||7!==e.id).map(e=>(0,l.jsx)("option",{value:e.id,children:r(`board.postType.${e.title}`,{defaultValue:e.title})},e.id))]}),(0,l.jsx)("svg",{className:"pointer-events-none absolute right-2.5 top-1/2 h-4 w-4 -translate-y-1/2 text-neutral-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),L&&(0,l.jsxs)("div",{className:"relative mb-4",children:[(0,l.jsx)("label",{className:"mb-2 block text-sm font-medium text-neutral-700",children:r("editor.requiredRole")}),(0,l.jsxs)("select",{value:V,onChange:e=>Y(e.target.value),className:"w-full appearance-none rounded-xl border border-neutral-200 pl-3 pr-8 py-2.5 text-sm focus:outline-none focus:ring-1 focus:ring-primary",children:[(0,l.jsx)("option",{value:"GUEST",children:r("editor.roleGuest")}),(0,l.jsx)("option",{value:"USER",children:r("editor.roleUser")}),(0,l.jsx)("option",{value:"CREATOR",children:r("editor.roleCreator")}),(0,l.jsx)("option",{value:"GAME_COMPANY",children:r("editor.roleGameCompany")}),(0,l.jsx)("option",{value:"OUTSOURCER",children:r("editor.roleOutsourcer")})]}),(0,l.jsx)("svg",{className:"pointer-events-none absolute right-2.5 bottom-2.5 h-4 w-4 text-neutral-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),e$.length>0&&(0,l.jsxs)("div",{className:"mb-4",children:[(0,l.jsx)("label",{className:"mb-2 block text-sm font-medium text-neutral-700",children:r("editor.language")}),(0,l.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[e$.filter(e=>R.includes(e.code)).map(e=>{let t=S[e.code]??eC,n=!t.title.trim(),a=!eI(t.content),s=n&&a,i=s?r("editor.missingTitleAndContent"):n?r("editor.missingTitle"):r("editor.missingContent"),o=e.code===M;return(0,l.jsxs)("span",{className:`flex items-center rounded-lg text-sm transition-colors ${o?"bg-neutral-900 text-white":"bg-neutral-100 text-neutral-600 hover:bg-neutral-200"}`,children:[(0,l.jsxs)("button",{type:"button",onClick:()=>G(e.code),className:`flex items-center gap-1.5 rounded-l-lg py-1.5 pl-3 ${R.length>1?"pr-1.5":"pr-3"}`,children:[e.label,(n||a)&&(0,l.jsx)("span",{className:`h-1.5 w-1.5 shrink-0 rounded-full ${s?o?"bg-red-400":"bg-red-500":o?"bg-amber-300":"bg-amber-500"}`,title:i,"aria-label":i})]}),R.length>1&&(0,l.jsx)("button",{type:"button",onClick:()=>B(e.code,!1),"aria-label":r("editor.removeLanguage"),className:`rounded-r-lg py-1.5 pl-1 pr-2.5 text-xs transition-colors ${o?"text-neutral-400 hover:text-white":"text-neutral-400 hover:text-neutral-900"}`,children:"✕"})]},e.code)}),e$.some(e=>!R.includes(e.code))&&(0,l.jsxs)("div",{className:"relative",children:[(0,l.jsxs)("select",{value:"",onChange:e=>{e.target.value&&B(e.target.value,!0)},className:"cursor-pointer appearance-none rounded-lg border border-dashed border-neutral-300 bg-white py-1.5 pl-3 pr-7 text-sm text-neutral-500 hover:border-neutral-400 focus:outline-none focus:ring-1 focus:ring-primary",children:[(0,l.jsxs)("option",{value:"",children:["+ ",r("editor.addLanguage")]}),e$.filter(e=>!R.includes(e.code)).map(e=>(0,l.jsx)("option",{value:e.code,children:e.label},e.code))]}),(0,l.jsx)("svg",{className:"pointer-events-none absolute right-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-neutral-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})]})]}),(0,l.jsxs)("div",{className:"mb-4",children:[(0,l.jsx)("input",{type:"text",value:z,onChange:e=>_(e.target.value),placeholder:r("editor.titlePlaceholder"),maxLength:120,className:"w-full rounded-xl border border-neutral-200 px-4 py-3 text-base focus:outline-none focus:ring-1 focus:ring-primary"}),(0,l.jsxs)("div",{className:"mt-1 text-right text-xs text-neutral-400",children:[z.length," / 120"]})]}),(0,l.jsx)("div",{className:"info-quill-editor",children:X&&(0,l.jsx)(ev,{defaultValue:K,onChange:O,onUploadImage:I.uploadInfoPostImage,onRequestGameEmbed:ey,onRequestScEmbed:ej,embedRef:eu,initialEmbeds:ef},E?`edit-${t}`:"new")}),(0,l.jsxs)("div",{className:"mt-4",children:[(0,l.jsx)("label",{className:"mb-2 block text-sm font-medium text-neutral-700",children:r("editor.tags")}),Z.length>0&&(0,l.jsx)("div",{className:"mb-2 flex flex-wrap gap-1.5",children:Z.map(e=>(0,l.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full bg-primary/10 px-2.5 py-1 text-xs font-medium text-primary",children:["#",e,(0,l.jsx)("button",{type:"button",onClick:()=>eA(e),className:"flex h-3.5 w-3.5 items-center justify-center rounded-full transition-colors hover:bg-primary/20",children:(0,l.jsx)("svg",{className:"h-2.5 w-2.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]},e))}),(0,l.jsxs)("div",{className:"relative",children:[(0,l.jsx)("input",{ref:ei,type:"text",value:et,onChange:e=>{er(e.target.value),ek(e.target.value)},onKeyDown:e=>{!e.nativeEvent.isComposing&&"Enter"===e.key&&et.trim()&&(e.preventDefault(),eM(et))},placeholder:Z.length>=5?r("editor.tagsMax"):r("editor.tagsPlaceholder"),disabled:Z.length>=5,maxLength:100,className:"w-full rounded-xl border border-neutral-200 px-4 py-2.5 text-sm focus:outline-none focus:ring-1 focus:ring-primary disabled:bg-neutral-50 disabled:cursor-not-allowed"}),ea&&(0,l.jsx)("div",{ref:ed,className:"absolute left-0 right-0 top-full z-10 mt-1 max-h-40 overflow-y-auto rounded-xl border border-neutral-200 bg-white shadow-lg",children:el.map(e=>(0,l.jsxs)("button",{type:"button",onClick:()=>eM(e.name),className:"w-full px-4 py-2 text-left text-sm text-neutral-700 hover:bg-primary/5 hover:text-primary transition-colors",children:["#",e.name]},e.id))})]}),(0,l.jsxs)("p",{className:"mt-1 text-xs text-neutral-400",children:[Z.length," / 5"]})]})]})}),(0,l.jsx)(ew,{isOpen:em,onClose:()=>eh(!1),defaultTab:ep,gameCount:eN.gameCount,scCount:eN.scCount,onSelectGame:e=>{eu.current?.insertEmbed(eo,e)},onSelectSc:e=>{eu.current?.insertEmbed(ex,e)}})]})}function eT(e){return{gameCount:(e.match(/class="game-embed-card"/g)||[]).length,scCount:(e.match(/class="sc-embed-card"/g)||[]).length}}e.s(["InfoPageClient",0,function({detail:e,searchParams:t}){(0,a.useTranslations)("info");let r=(0,n.useMemo)(()=>
1{if(!e||0===e.length)return{mode:"list",boardId:void 0,articleId:void 0};if("editor"===e[0]){let t=e[1]?parseInt(e[1]):void 0,r=e[2]?parseInt(e[2]):void 0;return{mode:"editor",boardId:t&&!isNaN(t)?t:void 0,articleId:r&&!isNaN(r)?r:void 0}}if("post"===e[0]){let t=e[1]?parseInt(e[1]):void 0,r=e[2]?parseInt(e[2]):void 0;return{mode:"detail",boardId:t&&!isNaN(t)?t:void 0,articleId:r&&!isNaN(r)?r:void 0}}let t=parseInt(e[0]);return{mode:"list",boardId:isNaN(t)?void 0:t,articleId:void 0}},[e]),s=t?.page&&parseInt(t.page)||1;return"editor"===r.mode?(0,l.jsx)(eS,{boardId:r.boardId,articleId:r.articleId}):(0,l.jsx)("div",{className:"w-full bg-neutral-50 min-h-screen",children:(0,l.jsx)("div",{className:"container py-6 md:py-10",children:(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-6 lg:grid-cols-6 lg:gap-10",children:[(0,l.jsx)("div",{className:"hidden lg:block",children:(0,l.jsx)(h,{boardId:r.boardId})}),(0,l.jsx)("div",{className:"col-span-5",children:"detail"===r.mode&&r.articleId?(0,l.jsx)(et,{articleId:r.articleId,boardId:r.boardId}):(0,l.jsx)(P,{boardId:r.boardId,initialPage:s})})]})})})}],2764)}]);

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.