const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-BZGh_npj.js","assets/vendor-D0AQuxPe.js","assets/vendor-DXOeSP1F.css","assets/index-CIFIXL5x.css"])))=>i.map(i=>d[i]);
import{F as D,P as l,_ as i,R as s,a1 as n,T as f,Q as M,W as m,a0 as _,X as y,ai as Q,m as o,r,bU as Y,au as T,b as J,e as t,a2 as I,ae as Z,ac as tt}from"./vendor-D0AQuxPe.js";import{j as et,M as W,bl as st,bG as at,i as it,f as nt,cc as lt,m as B}from"./index-BZGh_npj.js";import{_ as ot,a as ct}from"./wishlist-products-skeleton.vue_vue_type_script_setup_true_lang-BjWs1L1m.js";import"./product-skeleton-grid-C9VyQ0_6.js";const ut={class:"list-summary__content"},rt={key:0},mt=D({__name:"wishlist-summary",props:{list:{}},setup(p){return(d,P)=>{const k=l("VcPriceDisplay"),h=l("VcWidget");return s(),i(h,{id:"list-summary",class:"list-summary",title:d.$t("common.titles.order_summary")},{default:n(()=>[f("div",ut,[f("span",null,_(d.$t("common.labels.subtotal")),1),p.list.subTotal?(s(),M("span",rt,[y(k,{value:p.list.subTotal},null,8,["value"])])):m("",!0)])]),_:1},8,["title"])}}}),_t={class:"shared-list__items"},pt={key:0,class:"shared-list__page-limit"},yt=D({__name:"shared-list",props:{sharingKey:{}},setup(p){const d=p,P=Z(()=>tt(()=>import("./index-BZGh_npj.js").then(e=>e.dv),__vite__mapDeps([0,1,2,3]))),{getModuleSettings:k}=et(W.MODULE_ID),{analytics:h}=st(),{t:N}=Q(),{listLoading:g,list:a,fetchSharedWishList:S}=at(),{cart:A}=it(),{continue_shopping_link:b}=k({[W.CONTINUE_SHOPPING_LINK]:"continue_shopping_link"});nt({title:o(()=>N("pages.account.list_details.meta.title",[a.value?.name]))});const w=o(()=>({item_list_id:"wishlist",item_list_name:`Wishlist "${a.value?.name}"`,related_id:a.value?.id,related_type:"wishlist"})),E=r(),O=r({}),v=r(6),c=r(1),V=r([]),U=o(()=>Y(A.value?.items,"sku")),K=o(()=>V.value.map(e=>lt(e,U.value[e.sku]?.quantity))),L=o(()=>Math.ceil((V.value.length??0)/v.value)),C=o(()=>K.value.slice((c.value-1)*v.value,c.value*v.value)),x=o(()=>C.value.length||v.value);function G(e){e&&h("selectItem",e,w.value)}return T(async()=>{await S(d.sharingKey),c.value=1,V.value=J(a.value?.items)??[]}),T(()=>{const e=a.value?.items?.map(u=>u.product).filter(u=>!!u);e?.length&&h("viewItemList",e,w.value)}),(e,u)=>{const R=l("VcTypography"),H=l("VcPagination"),X=l("VcWidget"),j=l("VcLayout"),$=l("VcButton"),q=l("VcEmptyView"),z=l("VcContainer");return s(),i(z,{class:"shared-list"},{default:n(()=>[t(a)?.name?(s(),i(R,{key:0,tag:"h1",class:"shared-list__name"},{default:n(()=>[I(_(t(a).name),1)]),_:1})):m("",!0),f("div",{ref_key:"listElement",ref:E,class:"shared-list__content"},[t(g)?(s(),i(t(ot),{key:0,itemsCount:x.value},null,8,["itemsCount"])):!t(g)&&t(a)?.items?.length?(s(),i(j,{key:1,"sidebar-position":"right",sticky:""},{sidebar:n(()=>[y(t(mt),{list:t(a)},null,8,["list"])]),default:n(()=>[y(X,{size:"lg"},{default:n(()=>[f("div",_t,[y(t(ct),{items:C.value,"pending-items":O.value,editable:!1,navigatable:!1,onLinkClick:G},null,8,["items","pending-items"]),c.value>=t(B)?(s(),M("p",pt,_(e.$t("ui_kit.reach_limit.page_limit")),1)):m("",!0),L.value>1?(s(),i(H,{key:1,page:c.value,"onUpdate:page":u[0]||(u[0]=F=>c.value=F),pages:Math.min(L.value,t(B)),"scroll-target":E.value,"scroll-offset":60},null,8,["page","pages","scroll-target"])):m("",!0)])]),_:1})]),_:1})):!t(g)&&t(a)?.items?.length===0?(s(),i(q,{key:2,text:e.$t("shared.wishlists.list_details.empty_list"),icon:"outline-lists"},{button:n(()=>[t(b)?(s(),i($,{key:0,"external-link":t(b)},{default:n(()=>[I(_(e.$t("shared.wishlists.list_details.empty_list_button")),1)]),_:1},8,["external-link"])):(s(),i($,{key:1,to:"/"},{default:n(()=>[I(_(e.$t("shared.wishlists.list_details.empty_list_button")),1)]),_:1}))]),_:1},8,["text"])):!t(g)&&!t(a)?(s(),i(t(P),{key:3})):m("",!0)],512)]),_:1})}}});export{yt as default};
//# sourceMappingURL=shared-list-BOKB8pLZ.js.map
