1import{_ as I,f as y,o as n,a as b,w as g,h as o,c,t as d,F as p,m as f,p as _,i as k,b as v,u as N}from"./index-CVcpmTxc.js";import{S as M}from"./SubPageLayout-CdqzzKLQ.js";import{S as K}from"./SubPageTab-CmjtyjoB.js";import{I as T}from"./IniSearchBar-DQa2yoXw.js";import{I as U}from"./IniPagination-_Q51a50x.js";import{i as B}from"./ic_nodata-BsUUqvlF.js";import{b as q}from"./bg_company-SgLilGoQ.js";const u=[{code:"about",labelKey:"MENU.about.1",groups:[{key:"exc",labelKey:"MENU.about.leadership",kind:"exc",link:"/homepage/about/member"},{key:"adv",labelKey:"MENU.about.committess",kind:"adv",link:"/homepage/about/committess"}]},{code:"member",labelKey:"MENU.members.1",groups:[{key:"mem",labelKey:"MENU.members.directory",kind:"mem",link:"/homepage/member/statusList"}]},{code:"edu",labelKey:"MENU.educationInfo.1",groups:[{key:"edu",labelKey:"MENU.educationInfo.training",kind:"board",boardCode:"EDUCATION"}]},{code:"news",labelKey:"MENU.newsroom.1",groups:[{key:"notice",labelKey:"MENU.newsroom.notices",kind:"board",boardCode:"NOTICE"},{key:"press",labelKey:"MENU.newsroom.press",kind:"board",boardCode:"PRESS"},{key:"briefing",labelKey:"MENU.newsroom.briefing",kind:"board",boardCode:"BRIEF"},{key:"activite",labelKey:"MENU.newsroom.activities",kind:"board",boardCode:"ACTIVITY"},{key:"member",labelKey:"MENU.newsroom.member",kind:"memberNews",link:"/homepage/news/member"}]}
1,{code:"resource",labelKey:"MENU.resources.1",groups:[{key:"forum",labelKey:"MENU.resources.forums_seminars",kind:"board",boardCode:"FORUM"},{key:"policies",labelKey:"MENU.resources.policies_guidelines",kind:"board",boardCode:"POLICY"}]}],m=5,L={name:"SearchResultPage",components:{SubPageLayout:M,SubPageTab:K,IniSearchBar:T,IniPagination:U},setup(){const{t:e,te:t,locale:r}=N();return{t:e,te:t,locale:r,icNodata:B,bgCompany:q}},data(){return{keyword:"",searchedKeyword:"",searched:!1,loading:!1,activeCategory:u[0].code,resultsByCategory:{},groupPages:{},GROUP_DISPLAY_LIMIT:m}},watch:{"$route.query.keyword"(e){const t=(e??"").trim();!t||t===this.searchedKeyword||(this.keyword=t,this.runSearch())},activeCategory(e){this.$route.query.category!==e&&this.$router.replace({query:{...this.$route.query,category:e}})},groupPages(e){const t=Object.keys(e).length?JSON.stringify(e):void 0;if((this.$route.query.gp??void 0)===t)return;const r={...this.$route.query};t?r.gp=t:delete r.gp,this.$router.replace({query:r})}},computed:{categoryTabs(){return u.map(e=>({id:e.code,label:this.t(e.labelKey),count:`(${this.categoryCount(e.code)}${this.tr("COM.list.totalUnit","건","")})`}))},activeCategoryLoaded(){return!!this.resultsByCategory[this.activeCategory]},activeGroups(){return u.find(e=>e.code===this.activeCategory)?.groups??[]}},mounted(){const e=this.$route.query.category;e&&u.some(a=>a.code===e)&&(this.activeCategory=e);const t=this.$route.query.gp;if(t)try{const a=JSON.parse(t);a&&typeof a=="object"&&(this.groupPages=a)}catch{}const r=(this.$route.query.keyword??"").trim();r&&(this.keyword=r,this.runSearch({resetPages:!t}))},methods:{tr(e,t,r){return this.te(e)?this.t(e):this.locale==="en"?r:t},categoryCount(e){const t=this.resultsByCategory[e];return t?u.find(a=>a.code===e).groups.reduce((a,l)=>a+(t[l.key]?.length??0),0):0},groupItems(e){return this.resultsByCategory[this.activeCategory]?.[e.key]??[]},groupPage(e){const t=this.groupTotalPages(e);return t===0?1:Math.min(Math.max(this.groupPages[e.key]??1,1),t)},groupTotalPages(e){return Math.ceil(this.groupItems(e).length/m)},pagedGroupItems(e){const r=(this.groupPage(e)-1)*m;return this.groupItems(e).slice(r,r+m)},onGroupPageChange(e,t){const r=window.scrollY;this.groupPages={...this.groupPages,[e.key]:t},this.$nextTick(()=>{requestAnimationFrame(()=>window.scrollTo({top:r,left:0,behavior:"auto"}))})},itemKey(e,t){return t.id??t.executive_id??`${e.key}-${JSON.stringify(t).slice(0,40)}`},itemTitle(e,t){if(e.kind==="exc")return[t.name,t.member_name].filter(Boolean).join(" · ")||"-";if(e.kind==="adv"){const r=t.comp_key?this.t(t.comp_key):"",a=t.post_key?this.t(t.post_key):"",l=[r,a].filter(Boolean).join(" ");
1return[t.name,l].filter(Boolean).join(" · ")||"-"}return e.kind==="mem"?t.member_name||"-":t.title||"-"},escapeHtml(e){return e.replace(/[&<>"']/g,t=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[t])},escapeRegExp(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")},highlightedTitle(e,t){const r=this.escapeHtml(this.itemTitle(e,t)),a=this.searchedKeyword.trim();if(!a)return r;const l=this.escapeRegExp(this.escapeHtml(a));return r.replace(new RegExp(l,"gi"),s=>`<mark class="hl">${s}</mark>`)},itemLink(e,t){return e.kind==="adv"||e.kind==="exc"?{path:e.link,query:{keyword:this.searchedKeyword}}:e.kind==="mem"?{path:e.link,query:{id:t.id}}:e.kind==="memberNews"?{path:e.link,query:{id:t.id}}:{path:`/homepage/news/list/${e.boardCode}`,query:{id:t.id}}},onSearch(e){const t=(e??this.keyword).trim();t&&(this.keyword=t,this.$route.query.keyword!==t&&this.$router.replace({query:{keyword:t}}),this.runSearch())},async runSearch({resetPages:e=!0}={}){const t=this.keyword.trim();if(t){this.searchedKeyword=t,this.searched=!0,this.loading=!0,e&&(this.groupPages={});try{await Promise.all(u.map(r=>this.fetchCategory(r.code,t)))}finally{this.loading=!1}}},async fetchCategory(e,t){try{const{data:r}=await v.get("/api/v1/common/search",{params:{searchCd:e,keyword:t}}),a=r?.data?.result?.[0]??r?.result?.[0]??{};this.resultsByCategory={...this.resultsByCategory,[e]:a}}catch(r){console.error("[SearchResultPage] ê²ì ì¤í¨",e,r),this.resultsByCategory={...this.resultsByCategory,[e]:{}}}}}},R={class:"search-title-bar"},x={class:"search-page-title"},O={class:"search-results"},V={key:0,class:"search-empty"},A=["src"],G=["id"],H={class:"group-header"},j={class:"group-title"},F={key:0,class:"group-count"},Y={key:0,class:"group-loading"},D={class:"group-body"},J={key:0,class:"group-list"},z=["innerHTML"],Q={key:1,class:"group-empty"},W=["src"];function X(e,t,r,a,l,s){const C=y("IniSearchBar"),w=y("SubPageTab"),S=y("RouterLink"),P=y("IniPagination"),E=y("SubPageLayout");return n(),b(E,{"bg-img":a.bgCompany},{"sub-top":g(()=>[o("div",R,[o("h2",x,d(s.tr("SEARCH.pageTitle","íµí© ê²ì","Integrated Search")),1)])]),search:g(()=>[k(C,{modelValue:l.keyword,"onUpdate:modelValue":t[0]||(t[0]=i=>l.keyword=i),class:"search-input",placeholder:a.t("COM.common.searchbar.default"),onSearch:s.onSearch},null,8,["modelValue","placeholder","onSearch"])]),tab:g(()=>[k(w,{modelValue:l.activeCategory,"onUpdate:modelValue":t[1]||(t[1]=i=>l.activeCategory=i),tabs:s.categoryTabs,"early-fold":""},null,8,["modelValue","tabs"])]),default:g(()=>[o("div",O,[l.searched?(n(!0),c(p,{key:1},f(s.activeGroups,i=>(n(),c("section",{key:i.key,id:`group-${i.key}`,class:"result-group"},[o("div",H,[t[2]||(t[2]=o("span",{class:"group-bar","aria-hidden":"true"},null,-1)),o("h3",j,d(a.t(i.labelKey)),1),s.activeCategoryLoaded?(n(),c("span",F,d(s.groupItems(i).length)+d(s.tr("COM.list.totalUnit","ê±´","")),1)):_("",!0)]),s.activeCategoryLoaded?(n(),c(p,{key:1},[o("div",D,[s.groupItems(i).length?(n(),c("ul",J,[(n(!0),c(p,null,f(s.pagedGroupItems(i),h=>(n(),c("li",{key:s.itemKey(i,h)},[k(S,{to:s.itemLink(i,h),class:"group-link"},{default:g(()=>[o("span",{innerHTML:s.highlightedTitle(i,h)},null,8,z)]),_:2},1032,["to"])]))),128))])):(n(),c("div",Q,[o("img",{src:a.icNodata,alt:"",class:"empty-icon"},null,8,W),o("p",null,d(a.t("COM.data.search")),1)]))]),s.groupTotalPages(i)>1?(n(),b(P,{key:0,class:"group-pagination",page:s.groupPage(i),"total-pages":s.groupTotalPages(i),onChange:h=>s.onGroupPageChange(i,h)},null,8,["page","total-pages","onChange"])):_("",!0)],64)):(n(),c("div",Y,[t[3]||(t[3]=o("span",{class:"dot-loader","aria-hidden":"true"},[o("i"),o("i"),o("i"),o("i"),o("i")],-1)),o("p",null,d(s.tr("SEARCH.loading","ì¡°íì¤ì
ëë¤.","Loading...")),1)]))],8,G))),128)):(n(),c("div",V,[o("img",{src:a.icNodata,alt:"",class:"empty-icon"},null,8,A),o("p",null,d(s.tr("SEARCH.beforeSearch","ê²ìì´ë¥¼ ì
ë ¥íê³ ìí° ëë ê²ì ë²í¼ì ëë¬ ì£¼ì¸ì.","Enter a keyword, then press Enter or the search button.")),1)]))])]),_:1},8,["bg-img"])}const oe=I(L,[["render",X],["__scopeId","data-v-e8f3aa7f"]]);export{oe as default};
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.