const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-CsCqMgta.js","assets/vendor-CsGITfgk.js","assets/vendor-DXOeSP1F.css","assets/index-DhsNQ5a8.css"])))=>i.map(i=>d[i]);
import{M as A,U as n,R as i,O as t,V as l,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 le,bG as ne}from"./vendor-CsGITfgk.js";import{j as oe,M as D,bi as ce,ce as re,i as ue,f as _e,cf as me,n as O}from"./index-CsCqMgta.js";import{W as de,_ as pe}from"./wishlist-product-item-skeleton-QBxQdbnP.js";import{P as he}from"./product-skeleton-grid-DM9bsmii.js";const ge={class:"list-summary__content"},ye={key:0},ve=A({__name:"wishlist-summary",props:{list:{}},setup(L){return(r,w)=>{const V=n("VcPriceDisplay"),g=n("VcWidget");return t(),i(g,{id:"list-summary",class:"list-summary",title:r.$t("common.titles.order_summary")},{default:l(()=>[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(()=>le(()=>import("./index-CsCqMgta.js").then(s=>s.dq),__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(ne);_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"})),q=R.smaller("lg"),$=d(),H=d({}),v=d(6),u=d(1),b=d([]),X=o(()=>se(K.value?.items,"sku")),Y=o(()=>b.value.map(s=>me(s,X.value[s.sku]?.quantity))),W=o(()=>Math.ceil((b.value.length??0)/v.value)),M=o(()=>Y.value.slice((u.value-1)*v.value,u.value*v.value)),S=o(()=>M.value.length||v.value);function j(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=n("VcTypography"),z=n("VcPagination"),F=n("VcWidget"),Q=n("VcLayout"),T=n("VcButton"),Z=n("VcEmptyView"),J=n("VcContainer");return t(),i(J,{class:"shared-list"},{default:l(()=>[e(a)?.name?(t(),i(x,{key:0,tag:"h1",class:"shared-list__name"},{default:l(()=>[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(q)?(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:l(()=>[k(ve,{list:e(a)},null,8,["list"])]),default:l(()=>[k(F,{size:"lg"},{default:l(()=>[f("div",Ve,[k(e(pe),{items:M.value,"pending-items":H.value,editable:!1,navigatable:!1,onLinkClick:j},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:l(()=>[e(E)?(t(),i(T,{key:0,"external-link":e(E)},{default:l(()=>[P(h(s.$t("shared.wishlists.list_details.empty_list_button")),1)]),_:1},8,["external-link"])):(t(),i(T,{key:1,to:"/"},{default:l(()=>[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-e74HloBw.js.map
