const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-B7qwhRTg.js","assets/vendor-CsGITfgk.js","assets/vendor-DXOeSP1F.css","assets/index-Dd5T_0C2.css"])))=>i.map(i=>d[i]);
import{M as A,U as l,R as i,O as t,V as n,W as f,N as c,a8 as p,Y as h,X as k,$ as ee,E as o,aL as te,r as d,bT as se,ad as B,b as ae,e,Z as P,P as I,Q as N,an as ie,ak as ne,bG as le}from"./vendor-CsGITfgk.js";import{j as oe,M as D,bi as ce,cb as re,i as ue,f as _e,cc as me,n as O}from"./index-B7qwhRTg.js";import{W as de,_ as pe}from"./wishlist-product-item-skeleton-BTYVsZC_.js";import{P as he}from"./product-skeleton-grid-BcT3yZ5L.js";const ge={class:"list-summary__content"},ye={key:0},ve=A({__name:"wishlist-summary",props:{list:{}},setup(L){return(r,w)=>{const V=l("VcPriceDisplay"),g=l("VcWidget");return t(),i(g,{id:"list-summary",class:"list-summary",title:r.$t("common.titles.order_summary")},{default:n(()=>[f("div",ge,[f("span",null,h(r.$t("common.labels.subtotal")),1),r.list.subTotal?(t(),c("span",ye,[k(V,{value:r.list.subTotal},null,8,["value"])])):p("",!0)])]),_:1},8,["title"])}}}),ke={key:0,class:"shared-list__skeleton-mobile"},fe={key:1,class:"shared-list__skeleton-desktop"},Ve={class:"shared-list__items"},be={key:0,class:"shared-list__page-limit"},Ee=A({__name:"shared-list",props:{sharingKey:{}},setup(L){const r=L,w=ie(()=>ne(()=>import("./index-B7qwhRTg.js").then(s=>s.dn),__vite__mapDeps([0,1,2,3]))),{getModuleSettings:V}=oe(D.MODULE_ID),{analytics:g}=ce(),{t:U}=ee(),{listLoading:y,list:a,fetchSharedWishList:G}=re(),{cart:K}=ue(),{continue_shopping_link:E}=V({[D.CONTINUE_SHOPPING_LINK]:"continue_shopping_link"}),R=te(le);_e({title:o(()=>U("pages.account.list_details.meta.title",[a.value?.name]))});const C=o(()=>({item_list_id:"wishlist",item_list_name:`Wishlist "${a.value?.name}"`,related_id:a.value?.id,related_type:"wishlist"})),H=R.smaller("lg"),$=d(),X=d({}),v=d(6),u=d(1),b=d([]),Y=o(()=>se(K.value?.items,"sku")),j=o(()=>b.value.map(s=>me(s,Y.value[s.sku]?.quantity))),W=o(()=>Math.ceil((b.value.length??0)/v.value)),M=o(()=>j.value.slice((u.value-1)*v.value,u.value*v.value)),S=o(()=>M.value.length||v.value);function q(s){s&&g("selectItem",s,C.value)}return B(async()=>{await G(r.sharingKey),u.value=1,b.value=ae(a.value?.items)??[]}),B(()=>{const s=a.value?.items?.map(_=>_.product).filter(_=>!!_);s?.length&&g("viewItemList",s,C.value)}),(s,_)=>{const x=l("VcTypography"),z=l("VcPagination"),F=l("VcWidget"),Q=l("VcLayout"),T=l("VcButton"),Z=l("VcEmptyView"),J=l("VcContainer");return t(),i(J,{class:"shared-list"},{default:n(()=>[e(a)?.name?(t(),i(x,{key:0,tag:"h1",class:"shared-list__name"},{default:n(()=>[P(h(e(a).name),1)]),_:1})):p("",!0),f("div",{ref_key:"listElement",ref:$,class:"shared-list__content"},[e(y)?(t(),c(I,{key:0},[e(H)?(t(),c("div",ke,[(t(!0),c(I,null,N(S.value,m=>(t(),i(e(he),{key:m}))),128))])):(t(),c("div",fe,[(t(!0),c(I,null,N(S.value,m=>(t(),i(e(de),{key:m,class:"shared-list__skeleton-desktop-item"}))),128))]))],64)):!e(y)&&e(a)?.items?.length?(t(),i(Q,{key:1,"sidebar-position":"right","sticky-sidebar":""},{sidebar:n(()=>[k(ve,{list:e(a)},null,8,["list"])]),default:n(()=>[k(F,{size:"lg"},{default:n(()=>[f("div",Ve,[k(e(pe),{items:M.value,"pending-items":X.value,editable:!1,navigatable:!1,onLinkClick:q},null,8,["items","pending-items"]),u.value>=e(O)?(t(),c("p",be,h(s.$t("ui_kit.reach_limit.page_limit")),1)):p("",!0),W.value>1?(t(),i(z,{key:1,page:u.value,"onUpdate:page":_[0]||(_[0]=m=>u.value=m),pages:Math.min(W.value,e(O)),"scroll-target":$.value,"scroll-offset":60},null,8,["page","pages","scroll-target"])):p("",!0)])]),_:1})]),_:1})):!e(y)&&e(a)?.items?.length===0?(t(),i(Z,{key:2,text:s.$t("shared.wishlists.list_details.empty_list"),icon:"outline-lists"},{button:n(()=>[e(E)?(t(),i(T,{key:0,"external-link":e(E)},{default:n(()=>[P(h(s.$t("shared.wishlists.list_details.empty_list_button")),1)]),_:1},8,["external-link"])):(t(),i(T,{key:1,to:"/"},{default:n(()=>[P(h(s.$t("shared.wishlists.list_details.empty_list_button")),1)]),_:1}))]),_:1},8,["text"])):!e(y)&&!e(a)?(t(),i(e(w),{key:3})):p("",!0)],512)]),_:1})}}});export{Ee as default};
//# sourceMappingURL=shared-list-CNTiUmbs.js.map
