PageSourceSearch

https://mfront.homeplus.co.kr/assets/js/map-DmJJtKu8.js

js homeplus.co.kr collected 2026-09-24 10:14:32 UTC 7,696 bytes, 1 lines download raw bytes

1import{dt as e,du as t,y as c,z as a,a9 as n,ae as r,aR as i,a3 as l,dv as s,E as o,F as d,k as m,aa as h,q as g,aQ as u,az as p,eM as y,ab as C,ac as N,G as f}from"./index-Db6MqYYx.js";import{r as b,b as k}from"./vendor-Cqib3ghv.js";import{d as v,R as A,M as x,C as L,S,U as w,a as I,b as R,c as T,e as _,f as B,g as D,h as E}from"./style-CFpMVZZU.js";import{u as U}from"./useRecentCategories-BIwQdeAl.js";import"./AppSettingButtons-CD9-js4_.js";const M=()=>{const{loadValue:o,removeCategory:d,removeAll:m}=U(),{subscribeChannel:h}=e(s.update_recent_category),[g,u]=b.useState([]),p=()=>{u(JSON.parse(o()))};return b.useEffect(()=>{p()},[]),b.useEffect(()=>{const e=h(e=>{e.messageType===t.UPDATE_RECENT_CATEGORY&&setTimeout(()=>{p()},250)});return()=>e()},[h]),c(A,{className:"recentCategoriesArea",children:[a("h2",{children:"최근 본 카테고리"}),a("div",{className:"history",children:(null==g?void 0:g.length)>0?g.map((e,t)=>{var s;return t<10&&c("span",{className:"item",children:[a(n,{otherAttr:{role:"button"},className:"category",to:i.stringifyUrl({url:l.CATEGORY,query:{categoryId:"".concat(e.id),categoryDepth:"".concat(e.depth),...void 0!==t&&{categoryIdx:t}}}),onClick:()=>r.recentCategoresClick("click_category",e.category||""),children:(null==(s=e.category)?void 0:s.length)>8?"".concat(e.category.substr(0,8),"..."):e.category}),a("button",{type:"button",className:"del",onClick:()=>((e,t)=>{r.recentCategoresClick("click_remove_from_category",t||"");const c=JSON.parse(o()).filter(t=>t.id!==e);u(c),d(e)})(e.id,e.category),children:a("img",{src:v,alt:"카테고리 삭제",width:"8"})},t)]},"recent-category-".concat(t))}):a("p",{children:"최근 본 카테고리가 없습니다."})}),0!==g.length&&a("button",{type:"button",className:"etc historyDel",onClick:()=>{r.recentCategoresClick("click_remove_from_category","카테고리전체삭제"),u([]),m()},children:"카테고리 전체삭제"})]})},O=k.memo(()=>{const{map:e,selectedCode:t}=o(({category:e})=>({map:e.map,selectedCode:e.selectedCode}),d),s=m(),h=b.useRef(0),g=b.useRef([]),u=b.useCallback((e,c,a="",n=!1)=>{var i;const l=4*Math.floor(e/4),o=l+4,d=g.current.slice(l,o).map(e=>(null==e?void 0:e.getBoundingClientRect().height)||0),m=Math.max(...d),u=(null==(i=g.current[e])?void 0:i.getBoundingClientRect().height)||0;if(h.current=m-u,n){const e=c===t?-1:c;s.category.setSelectedCode(e),r.categoryView("B",a)}},[s.category,t]);return b.useEffect(()=>{if(-1===t)return;const c=e.findIndex(e=>e.cateCd===t);u(c,t)},[u,e,t]),e.length?c(L,{className:"categoryArea",children:[a("h2",{className:"title",children:"카테고리"}),a(x,{columns:4,space:13,children:!!e.length&&e.map((e,r)=>{var s;const o=e.cateCd===t;return c("li",{className:"mainItem",children:[a("h3",{"aria-expanded":o,children:c(n,{to:i.stringifyUrl({url:l.CATEGORY,query:{categoryId:"".concat(e.cateCd),categoryDepth:"0"}}),unusedAppScheme:!0,gaBannerNm:"리뷰배너",onClick:t=>{t.preventDefault(),u(r,e.cateCd,e.cateNm,!0)},children:[a("span",{className:"imgWrapper",children:a("img",{src:"".concat("https://image.homeplus.kr").concat(null==(s=e[o?"onIconImg":"offIconImg"])?void 0:s.imgUrl),alt:e.cateNm})}),a("span",{className:"text",ref:e=>g.current[r]=e,children:e.cateNm})]})}),a(H,{selectedCategory:e,textHeightDiff:h.current})]},e.cateCd)})})]}):null}),H=({selectedCategory:e,textHeightDiff:t})=>{const s=b.useRef(null),[o,d]=b.useState(0),{cateNm:m,categoryList:h}=e;b.useEffect(()=>{var e;return d((null==(e=s.current)?void 0:e.getBoundingClientRect().height)||0),()=>{d(0)}},[]);const g=b.useCallback((e,t)=>{r.categoryView("M",{...e,mainCategory:t,property:"N"})},[]);return(null==h?void 0:h.length)?a(S,{rectHeight:o,textHeightDiff:t,children:a("div",{className:"subList ".concat(t>0?"multiLine":""),ref:s,children:c("ul",{className:"subListMenu",children:[a("li",{children:a(n,{otherAttr:{role:"button"},className:"subItemLink",to:i.stringifyUrl({url:l.CATEGORY,query:{categoryId:"".concat(e.cateCd),categoryDepth:"0"}}),onClick:()=>g(e,m),children:a("p",{children:"전체보기"})})}),h.map(e=>a("li",{children:a(n,{otherAttr:{role:"button"},className:"subItemLink",to:i.stringifyUrl({url:l.CATEGORY,query:{categoryId:"".concat(e.cateCd),categoryDepth:"L"===e.cateDepth?"1":"M"===e.cateDepth?"2":"3"}}),onClick:()=>g(e,m),children:a("p",{children:e.cateNm})})},e.cateNm+"_"+e.cateCd))]})})}):null},q={2:{width:"162px",height:"70px"},3:{width:"102px",height:"70px"},4:{width:"74px",height:"74px"}},G=k.memo(({title:e,subTitle:t,bannerList:i=[],columns:l,rows:s=4})=>{const[o,d]=b.useState(!1),m=4*l,g=b.useMemo(()=>o?i.slice(0,m):i.slice(0,l*s),[o,i,m,l,s]),u=b.useCallback((e,t)=>{const c="".concat(window.location.origin).concat(h(t));r.bannerClick({...t,index:e,label:"".concat(e,"_").concat(c),category:"테마 배너 클릭",action:"카테고리 NAV - 테마 배너",section:"카테고리배너"})},[]);return i.length?c(I,{className:"categoryTheme",children:[c("div",{className:"titleArea",children:[a("h2",{children:e}),!!t&&a("h3",{children:t})]}),a(w,{columns:l,space:13,imgSize:q[l],children:a("ul",{children:g.map((e,t)=>a("li",{children:a("h3",{children:a(n,{to:h(e),type:e.linkType,onClick:()=>u(t+1,e),data:e,gaBannerNm:"카테고리배너".concat(t+1),bannerIdx:t,children:c("div",{className:"item",children:[a("span",{className:"icon",children:a("img",{src:"".concat("https://image.homeplus.kr").concat(e.imgUrl),alt:e.bannerNm})}),a("span",{className:"label",children:e.bannerNm})]})})})},e.bannerNo))})})]}):null}),P=k.memo(()=>{const{isMobile:e}=g(),{theme:t}=o(({category:e})=>({theme:e.mapTheme}),d);return t&&(null==t?void 0:t.length)?a(R,{children:t.slice(0,3).map(t=>a(G,{title:t.themeNm,subTitle:t.themeMsg,bannerList:t.bannerList,columns:e&&u(t.dispType)||4},t.themeNo))}):null}),V=k.memo(()=>{const{mapBanner:e}=o(({category:e})=>({mapBanner:e.mapBanner}),d),t=m(),c=b.useCallback((e,t)=>{const c="".concat(window.location.origin).concat(h(t));r.bannerClick({...t,index:e,label:"".concat(e,"_").concat(c),category:"마케팅 배너 클릭",action:"카테고리 NAV - 마케팅 배너",section:"하단배너"})},[]);return b.useEffect(()=>{t.main.getBanner()},[t]),e.length?a(T,{children:a("ul",{className:"categoryBanner",children:e.slice(0,3).map((e,t)=>a("li",{className:"item",children:a(n,{to:h(e),type:e.linkType,onClick:()=>c(t+1,e),data:e,gaBannerNm:"하단배너",bannerIdx:t,children:a("img",{src:"".concat("https://image.homeplus.kr").concat(e.imgUrl),alt:(null==e?void 0:e.bannerNm)||""})})},"exh-".concat(t)))})}):null}),j=()=>{const e=m(),{isMobile:t}=g(),[n,r]=b.useState(!1),[i,s]=b.useState(!1),{isLogin:h,isPendingLoginCheck:u,isApp:k,isScrollingUp:v}=o(({common:e,auth:t})=>({isLogin:t.isLogin,isPendingLoginCheck:t.isPendingLoginCheck,isApp:e.device.app,isScrollingUp:e.isScrollingUp}),d);return b.useEffect(()=>{e.address.getAddresses(),e.main.getBanner(),e.category.getMap(),e.common.setIsScrollingUp(!0);const t=window.innerHeight,c=document.body.scrollHeight;k&&c-t>63&&s(!0)},[t]),c(b.Fragment,{children:[c("div",{className:"content-container ".concat(t&&i?"isAppScroll":""),css:_,children:[a("h1",{css:p,children:"매직배송 카테고리"}),a(y,{children:a("div",{className:"categoryHeaderWrap",children:c("header",{className:v?"scrollUp":"scrollDown",children:[!u&&!h&&a(B,{}),!u&&h&&a(D,{}),a(E,{onDeliveryClick:()=>{k?f.openWebView({url:l.FOR_APP,query:{component:"address_list",title:"배송지 목록"}},"배송지 목록"):r(!0)}})]})})}),c("div",{className:"mainArea ".concat(t&&v?"scrollUp":"scrollDown"),children:[a(M,{}),a(O,{}),a(P,{}),a(V,{})]})]}),a(N,{title:"배송지 목록",open:n,onClose:()=>{r(!1)},children:a(C.AddressList,{})})]})};export{j 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.