PageSourceSearch

https://epallet.com/_next/static/chunks/pages/shared/wishlist/[uid]-51ac766e3be5b29f.js

js epallet.com collected 2026-10-06 22:37:57 UTC 28,436 bytes, 2 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2872],{4470:function(e,t,s){(window.__NEXT_P=window.__NEXT_P||[]).push(["/shared/wishlist/[uid]",function(){return s(656)}])},656:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return eS}});var n=s(85893),i=s(11163),l=s(67294),a=s(81394),o=s(5172),r=s(72246),c=s(76360),d=s(58218),u=s(41090),h=s(81926),m=s.n(h),p=s(47568),v=s(82670),_=s(97582),g=s(87066),f=s(7898),x=s(83250),S=function(e){var t,s=e.uid,n=e.enabled,i=void 0===n||n,a=e.defaultPostZip,o=e.customerStatus,r=(0,l.useState)(null),c=r[0],u=r[1],h=(0,l.useState)(!0),m=h[0],S=h[1],C=(0,l.useState)(null),y=C[0],j=C[1],b=(0,l.useRef)(null),k=(0,l.useContext)(d.I),N=k.isStatusLoading,w=k.loadingShippingAddresses,L=(t=(0,p.Z)(function(){var e,t,n,i,l,r,c,d;return(0,_.__generator)(this,function(r){switch(r.label){case 0:if(void 0===s||!o)return[2];null===(e=b.current)||void 0===e||e.abort(),t=new AbortController,b.current=t,S(!0),j(null),r.label=1;case 1:return r.trys.push([1,3,4,5]),n={},a&&(0,x.E)(o)&&(n.post_zip=a),i=new URLSearchParams(n).toString(),l="/api/ERP/customer/wishlist/".concat(s).concat(i?"?".concat(i):""),[4,g.Z.get(l,{headers:{sessionId:(0,f.ej)("sessionid")},signal:t.signal})];case 2:return u(r.sent().data),[3,5];case 3:if(c=r.sent(),g.Z.isCancel(c))return[2];return j((0,v.Z)(c,Error)?c:Error("Failed to fetch wishlist")),u(null),[3,5];case 4:return b.current===t&&S(!1),[7];case 5:return[2]}})}),function(){return t.apply(this,arguments)});return(0,l.useEffect)(function(){return!i||w||N||L(),function(){var e;null===(e=b.current)||void 0===e||e.abort(),b.current=null}},[s,i,a,N,w,]),{data:c,loading:m,error:y,refetch:L}},C=function(e,t,s){var n,i=S({uid:e,defaultPostZip:t,customerStatus:s}),l=i.data;return{item:l,refetch:i.refetch,isLoading:i.loading}},y=s(80442),j=s(46041),b=s(21687),k=s(62574),N=s(93967),w=s.n(N),L=s(61198),Z=s(55961),D=s.n(Z),A=s(828),P=s(55940),E=s(54689),T=function(e){var t,s=e.item,n=e.isSharedWishlist,i=(0,l.useContext)(d.I),a=i.shoppingList,o=i.setShoppingListUpdated,r=(0,l.useState)(s),c=r[0],h=r[1],m=(0,l.useState)(!1),v=m[0],x=m[1],S=(0,l.useState)(!1),C=S[0],j=S[1],b=(0,l.useState)(!1),k=b[0],N=b[1],w=(0,l.useRef)(null),L=(0,A.Z)(y.Z.useForm(),1)[0];(0,P.Z)(w,function(){x(!1)}),(0,l.useEffect)(function(){v||h(s)},[s,v]);var Z=(t=(0,p.Z)(function(e){return(0,_.__generator)(this,function(t){switch(t.label){case 0:if(o(!1),x(!1),!((null==e?void 0:e.name)!==(null==c?void 0:c.name)))return[3,4];j(!0),t.label=1;case 1:return t.trys.push([1,3,,4]),[4,g.Z.put("/api/ERP/customer/wishlist/".concat(s.uid),{name:e.name,is_default:!1,headers:{sessionId:(0,f.ej)("sessionid")}}).then(function(e){h(e.data),o(!0),E.Z.success({message:"Name edited successfully.",duration:2}),j(!1)}).catch(function(){E.Z.error({message:(0,u.Q)().General.Messages.SomethingWrongTryAgain,duration:2}),j(!1)})];case 2:return t.sent(),[3,4];case 3:return t.sent(),j(!1),[3,4];case 4:return[2]}})}),function(e){return t.apply(this,arguments)});return{shoppingList:a,currentItem:c,isEditable:v,setIsEditable:x,nameEditLoading:C,showShareDialog:k,setShowShareDialog:N,editContainerRef:w,form:L,postUpdate:Z,isSharedWishlist:n}},I=function(e){var t=e.item,s=e.isSharedWishlist,i=T({item:t,isSharedWishlist:s}),l=i.shoppingList,r=i.currentItem,c=i.isEditable,d=i.setIsEditable,u=i.nameEditLoading,h=i.showShareDialog,m=i.setShowShareDialog,p=i.editContainerRef,v=i.form,_=i.postUpdate;return(0,n.jsxs)("div",{className:D().titleSection,children:[(0,n.jsx)("div",{className:"".concat(D().trimSection," me-4"),children:(0,n.jsx)("div",{className:"".concat(D().trackingID," font-bold-h2"),style:{display:"flex"},ref:p,children:c?(0,n.jsxs)(y.Z,{layout:"inline",name:"Edit ShoppingList",preserve:!1,autoComplete:"off",onFinish:_,onKeyPress:function(e){"Enter"===e.key&&v.submit()},className:D().editNameForm,form:v,children:[(0,n.jsx)(y.Z.Item,{name:"name",validateTrigger:["onChange","onBlur"],hasFeedback:!0,initialValue:null==r?void 0:r.name,rules:[{required:!0,message:"Name is required"},{whitespace:!0},{max:30,message:"Maximum number of characters allowed is 30"},{validator:function(e,t,s){var n;if(!t){s(e.message);return}if(null===(n=null==l?void 0:l.filter(function(e){return e.id!==(null==r?void 0:r.id)}))||void 0===n?void 0:n.some(function(e){return(null==e?void 0:e.name)===t.trim()})){s("Shopping list name should be unique.");return}s()}},],children:(0,n.jsx)(k.Z,{className:w()("my-3 py-4",D().customEditInput)})}),(0,n.jsx)(j.Z,{title:"save",children:(0,n.jsx)("button",{onClick:function(){return v.submit()},"aria-label":"save shopping list",className:"".concat(D().editNameBtn," mt-6"),type:"button",children:(0,n.jsx)(a.Z,{name:"check",width:25,height:25})})})]}):(0,n.jsx)(n.Fragment,{children:u?(0,n.jsx)(b.Z.Input,{active:!0}):(0,n.jsxs)(n.Fragment,{children:[null==r?void 0:r.name,!s&&(0,n.jsx)(j.Z,{title:"edit",children:(0,n.jsx)("button",{onClick:function(){return d(!0)},"aria-label":"Edit shopping list",className:"".concat(D().editNameBtn," mt-2"),type:"button",children:(0,n.jsx)(a.Z,{name:"edit",width:30,height:30})})})]})})})}),!s&&(0,n.jsx)("div",{children:(0,n.jsx)(j.Z,{title:"Share",placement:"bottom",children:(0,n.jsx)(o.Z,{className:"p-0 ".concat(D().shareBtn),onClick:function(){return m(!0)},"aria-label":"Share shopping list",children:(0,n.jsx)(a.Z,{name:"share",width:28,height:28})})})}),(0,n.jsx)(L.Z,{setIsModalOpen:m,isModalOpen:h,isProductShare:!1,shoppingListDetails:r})]})},B=s(32808),M=s(73437),R=s(63975),W=s.n(R),F=function(e){var t=e.onSearch,s=e.setCheckedList,i=e.setCheckAll,a=(0,l.useState)(""),o=a[0],r=a[1],c=function(){t(o)};return(0,l.useEffect)(function(){c(),o&&(s([]),i(!1))},[o]),(0,n.jsx)(y.Z,{layout:"inline",className:W().formWrapper,children:(0,n.jsx)(y.Z.Item,{children:(0,n.jsx)(k.Z,{placeholder:"Search this list",value:o,onChange:function(e){return r(e.target.value)},enterKeyHint:"search",Icon:M.Z,hasIcon:!0,prefix:!0,className:W().searchFormInput})})})},Q=s(43639),O=s.n(Q),V=function(e){var t=e.data,s=e.productData,n=e.setProductData,i=e.checkedList,a=e.setCheckedList,o=e.checkAll,r=e.setCheckAll,c=(0,l.useState)(!1),d=c[0],u=c[1],h=null!=r?r:u,m=(0,l.useState)([]),p=m[0],v=m[1],_=(0,l.useState)(""),g=_[0],f=_[1];(0,l.useEffect)(function(){var e=null==s?void 0:s.map(function(e){return null==e?void 0:e.id});v(null!=e?e:[])},[s]),(0,l.useEffect)(function(){var e,t,n=null!==(e=null==s?void 0:s.length)&&void 0!==e?e:0,l=null!==(t=null==i?void 0:i.length)&&void 0!==t?t:0;h(n>0&&l===n)},[i,s,h]);var x=function(e){null==a||a(e.target.checked?p:[]),h(e.target.checked)},S=function(e){null==a||a(e),(null==e?void 0:e.length)==(null==p?void 0:p.length)?h(!0):(null==e?void 0:e.length)>=0&&h(!1)};return{checkAll:null!=o?o:d,setCheckAll:h,cardCheckList:p,searchValue:g,checkedList:i,setCheckedList:a,onCheckAllChange:x,checkboxChange:S,handleSearch:function(e){if(f(e),e){var s=null==t?void 0:t.filter(function(t){return t.name.toLowerCase().includes(e.toLowerCase())||t.brand_name.toLowerCase().includes(e.toLowerCase())||t.description_short.toLowerCase().includes(e.toLowerCase())});null==n||n(s)}else null==n||n(t)}}},G=function(e){var t,s,i,l,a,r,c,d,h,m,p,v,_,g,f,x,S=e.productData,C=e.guestUser,y=e.isCustomerDataCompleted,j=e.customerStatus,b=e.addToShoppingListStatus,k=e.addToCartStatus,N=e.onAddToList,w=e.onAddToCart,L=e.onDelete,Z=V(e),D=Z.checkAll,A=Z.setCheckAll,P=Z.checkedList,E=Z.onCheckAllChange,T=(Z.checkboxChange,Z.handleSearch);return(0,n.jsxs)("div",{className:O().settingContainer,children:[(null!==(_=null==S?void 0:S.length)&&void 0!==_?_:0)>0&&(0,n.jsxs)("div",{className:O().settingSection,children:[(0,n.jsx)(B.Z,{onChange:E,checked:D,value:"SelectAll",className:"pe-18 ".concat(O().selectAll),children:null===(t=(0,u.Q)())||void 0===t?void 0:null===(s=t.Account)||void 0===s?void 0:s.selectAll}),(D||(null!==(g=null==P?void 0:P.length)&&void 0!==g?g:0)>0)&&!C&&y&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(o.Z,{theme:"secondary",className:"".concat(O().addBtn," px-6 py-5 h-auto "),onClick:N,loading:b,"aria-label":"Add selected items to Shopping List",children:null===(i=(0,u.Q)())||void 0===i?void 0:null===(l=i.General)||void 0===l?void 0:l.addToList}),((null==j?void 0:j.email_verified)||(null==j?void 0:j.is_vendor))&&(0,n.jsx)(o.Z,{theme:"secondary",onClick:w,loading:k,"aria-label":"Add selected items to Cart",className:"".concat(O().addBtn," px-6 py-5 h-auto "),children:null===(a=(0,u.Q)())||void 0===a?void 0:null===(r=a.General)||void 0===r?void 0:r.addToCart}),(D||(null!==(f=null==P?void 0:P.length)&&void 0!==f?f:0)>0)&&(0,n.jsx)(o.Z,{theme:"secondary",className:"px-6 py-5 h-auto ",onClick:L,"aria-label":"Remove selected items from shopping list",children:D?(0,n.jsx)(n.Fragment,{children:null===(c=(0,u.Q)())||void 0===c?void 0:null===(d=c.General)||void 0===d?void 0:d.deleteAll}):(0,n.jsx)(n.Fragment,{children:null===(h=(0,u.Q)())||void 0===h?void 0:null===(m=h.General)||void 0===m?void 0:m.delete})})]})]}),(0,n.jsxs)("div",{className:O().btnGroup,children:[(0,n.jsx)(F,{onSearch:T,setCheckedList:e.setCheckedList,
1setCheckAll:A}),(null!==(x=null==S?void 0:S.length)&&void 0!==x?x:0)>0&&(0,n.jsx)(B.Z,{onChange:E,checked:D,value:"SelectAll",className:O().selectAllForMobile,children:null===(p=(0,u.Q)())||void 0===p?void 0:null===(v=p.Account)||void 0===v?void 0:v.selectAll})]})]})},U=s(71230),q=s(15746),H=s(64187),z=s(31656),X=s.n(z),J=s(98296),K=s.n(J),Y=s(41664),$=s.n(Y),ee=s(94021),et=s(95984),es=s(64671),en=s(8792),ei=s(16067),el=s(64972),ea=s(25524),eo=s(12652),er=s(15473),ec=function(e){var t,s,i,a,r,c,h,m,p,v,_,g,f,x,S=e.item,C=e.uid,y=e.isCustomerDataCompleted,j=e.customerStatus,b=e.className,k=(0,l.useContext)(d.I),N=k.guestUser,w=k.customerStatus,L=k.setShowVerifyModal,Z=k.completeProfileLink,D=null!=j?j:w,A=(0,ei.k4)(D,S),P=(0,l.useState)(!1),E=P[0],T=P[1],I=(0,l.useState)(!1),M=I[0],R=I[1],W=(0,l.useState)(!1),F=W[0],Q=W[1],O=function(e){(null==S?void 0:S.id)&&window.innerWidth>992&&(e.preventDefault(),Q(!0))},V=(0,u.Q)().General.ProductCard,G=(0,er.L)((null==S?void 0:S.main_category)||(null==S?void 0:S.main_category_name)),U=function(){T(!0)},q=(null==S?void 0:S.delivered_case_price)?"$".concat((0,ee.B)(null==S?void 0:S.delivered_case_price)):"—",H=(null==S?void 0:S.per_unit_delivered_price)!=null?"$".concat((0,ee.B)(S.per_unit_delivered_price)):"—",z=function(){return(0,n.jsxs)("div",{className:X().metaRow,children:[(0,n.jsxs)("div",{className:X().metaCol,children:[(0,n.jsx)("span",{className:X().metaLabel,children:"Cases / Pallet"}),(0,n.jsx)("span",{className:X().metaValue,children:null!==(v=null==S?void 0:S.case_per_pallet)&&void 0!==v?v:"—"})]}),(0,n.jsx)("div",{className:X().metaVDivider}),(0,n.jsxs)("div",{className:X().metaCol,children:[(0,n.jsx)("span",{className:X().metaLabel,children:"Pack Size"}),(0,n.jsx)("span",{className:X().metaValue,children:null!==(_=null==S?void 0:S.pack_size)&&void 0!==_?_:"—"})]}),(0,n.jsx)("div",{className:X().metaVDivider}),(0,n.jsxs)("div",{className:X().metaCol,children:[(0,n.jsx)("span",{className:X().metaLabel,children:V.priceCase}),(0,n.jsx)("span",{className:X().priceValue,children:q})]})]})},J=function(){return(0,n.jsxs)("div",{className:X().metaRow,children:[(0,n.jsxs)("div",{className:X().metaCol,children:[(0,n.jsx)("span",{className:X().metaLabel,children:"Cases / Pallet"}),(0,n.jsx)("span",{className:X().metaValue,children:null!==(g=null==S?void 0:S.case_per_pallet)&&void 0!==g?g:"—"})]}),(0,n.jsx)("div",{className:X().metaVDivider}),(0,n.jsxs)("div",{className:X().metaCol,children:[(0,n.jsx)("span",{className:X().metaLabel,children:"Pack Size"}),(0,n.jsx)("span",{className:X().metaValue,children:null!==(f=null==S?void 0:S.pack_size)&&void 0!==f?f:"—"})]}),(0,n.jsx)("div",{className:X().metaVDivider}),(0,n.jsxs)("div",{className:X().metaCol,children:[(0,n.jsx)("span",{className:X().metaLabel,children:"Shipping"}),(0,n.jsx)("span",{className:X().metaValue,children:"FOB"})]})]})},Y=function(){return(0,n.jsxs)("div",{className:X().metaRow,children:[(0,n.jsxs)("div",{className:X().metaCol,children:[(0,n.jsx)("span",{className:X().metaLabel,children:"Cases / Pallet"}),(0,n.jsx)("span",{className:X().metaValue,children:null!==(x=null==S?void 0:S.case_per_pallet)&&void 0!==x?x:"—"})]}),(0,n.jsx)("div",{className:X().metaVDivider}),(0,n.jsxs)("div",{className:X().metaCol,children:[(0,n.jsx)("span",{className:X().metaLabel,children:V.priceCase}),(0,n.jsx)("span",{className:X().priceValue,"data-testid":"product-price-case",children:q})]}),(0,n.jsx)("div",{className:X().metaVDivider}),(0,n.jsxs)("div",{className:X().metaCol,children:[(0,n.jsx)("span",{className:X().metaLabel,children:V.priceUnit}),(0,n.jsx)("span",{className:X().priceValue,"data-testid":"product-price-unit",children:H})]})]})},ec=function(){var e=S.is_prototype,t=S.isCloseOut,s=S.is_available,i=S.isCustomerDataCompleted;return(0,et.Z)(s)&&i&&!e?(0,n.jsx)("p",{className:K().outOfStock,children:(0,u.Q)().PDP.outOfStock}):t?(0,n.jsx)(J,{}):G?(0,n.jsx)(Y,{}):(0,n.jsx)(z,{})};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:[X().card,b].filter(Boolean).join(" "),children:[(0,n.jsx)($(),{href:"/product/".concat(null==S?void 0:S.slug),passHref:!0,children:(0,n.jsx)("a",{className:X().hoverOverlay,onClick:O,children:(0,n.jsx)("span",{className:X().viewDetailsBtn,children:"View Details"})})}),(0,n.jsx)(eo.Z,{isFoodPantry:G,hasPromo:null==S?void 0:S.has_promo,isCloseOut:A,wrapperClassName:K().badgeRowLeft}),(0,n.jsxs)("div",{className:K().checkboxOverlay,children:[(null==S?void 0:S.for_mixed_pallet)&&(0,n.jsx)(ea.Z,{label:"MIXED PALLET",variant:"outline","data-testid":"badge-mixed-pallet"}),(0,n.jsx)(B.Z,{value:C,"aria-label":"Select a product to add it to cart"})]}),(0,n.jsx)("div",{className:X().imageArea,children:(0,n.jsx)($(),{href:"/product/".concat(null==S?void 0:S.slug),passHref:!0,children:(0,n.jsx)("a",{className:X().imageLink,children:(0,n.jsx)("img",{src:(null==S?void 0:S.plp_image_url)||(null==S?void 0:S.thumbnail)||"",alt:null==S?void 0:S.name,className:X().productImage,loading:"lazy"})})})}),(0,n.jsxs)("div",{className:X().details,children:[(0,n.jsx)($(),{href:"/product/".concat(null==S?void 0:S.slug),passHref:!0,children:(0,n.jsx)("a",{className:X().productName,children:null==S?void 0:S.name})}),(0,n.jsx)("hr",{className:X().divider}),(0,n.jsx)(ec,{})]}),(0,n.jsxs)("div",{className:K().actionsSection,children:[!N&&A&&!(null==S?void 0:S.is_prototype)&&y&&!(0,et.Z)(null==S?void 0:S.is_available)&&(0,n.jsx)(o.Z,{theme:"primary",className:"font-bold-base lh-1 w-100",text:null===(t=(0,u.Q)())||void 0===t?void 0:null===(s=t.PLP)||void 0===s?void 0:null===(i=s.RequestToBuy)||void 0===i?void 0:i.button,onClick:function(){return R(!0)}}),!N&&y&&(0,et.Z)(null==S?void 0:S.is_available)&&(0,n.jsx)(o.Z,{className:"font-bold-base lh-1 w-100",text:(0,u.Q)().General.RequestProduct,theme:"primary",onClick:U}),!N&&!y&&(0,n.jsx)($(),{href:(null==D?void 0:D.profile_completed)===!1?Z:"",children:(0,n.jsx)("a",{onClick:function(){(null==D?void 0:D.email_verified)===!1&&L(!0)},style:{textAlign:"center"},children:(0,n.jsx)(o.Z,{className:"w-100 mt-2",theme:"primary",children:(null==D?void 0:D.profile_completed)===!1?null===(a=(0,u.Q)())||void 0===a?void 0:null===(r=a.General)||void 0===r?void 0:null===(c=r.Messages)||void 0===c?void 0:c.CompleteProfile:(null==D?void 0:D.email_verified)===!1&&(null===(h=(0,u.Q)())||void 0===h?void 0:null===(m=h.General)||void 0===m?void 0:null===(p=m.Messages)||void 0===p?void 0:p.VerifyEmail)})})})]}),E&&(0,n.jsx)(es.Z,{setIsModalOpen:T,isModalOpen:E}),(0,n.jsx)(en.Z,{isModalOpen:M,setIsModalOpen:R,product:null==S?void 0:S.slug})]}),(null==S?void 0:S.id)&&(0,n.jsx)(el.Z,{product:S,open:F,onClose:function(){return Q(!1)}})]})},ed=s(66918),eu=s(58004),eh=s.n(eu),em=function(e){var t,s,i,l,a,o,r=e.productData,c=e.isCustomerDataCompleted,d=e.customerStatus,h=e.checkedList,m=e.setCheckedList,p=(e.checkAll,e.setCheckAll),v=e.showDeleteDialog,_=e.setShowDeleteDialog,g=e.productSlugs,f=e.showShoppingListDialog,x=e.setShowToShoppingListDialog,S=e.unwishItems,C=e.addToCartHandler,y=function(e){null==m||m(e)};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(B.Z.Group,{className:"".concat((null!==(a=null==r?void 0:r.length)&&void 0!==a?a:0)>0?"w-100":eh().emptyCheckboxContainer),onChange:y,value:h,children:(null!==(o=null==r?void 0:r.length)&&void 0!==o?o:0)>0?(0,n.jsx)(U.Z,{className:"w-100",gutter:[{xs:0,sm:0,md:16,lg:16},16],children:null==r?void 0:r.map(function(e,t){return(0,n.jsx)(q.Z,{span:24,xl:{span:6},lg:{span:8},md:{span:12},sm:{span:24},xs:{span:24},className:eh().productWrapper,children:(0,n.jsx)(ec,{item:e,uid:e.id,isCustomerDataCompleted:c,customerStatus:d},e.id)},t)})}):(0,n.jsx)("div",{className:"".concat(eh().emptyWishlist," container"),children:(0,n.jsx)("h3",{children:null===(t=(0,u.Q)())||void 0===t?void 0:null===(s=t.Account)||void 0===s?void 0:s.emptyShoppingListMessage})})}),f&&(0,n.jsx)(ed.Z,{setShowToShoppingListDialog:null!=x?x:function(){},isModalOpen:f,gaForWishList:function(){return null==C?void 0:C()},isAddToShoppingList:!0,slugs:g,setCheckedList:m,setCheckAll:p}),(0,n.jsx)(H.Z,{open:v,title:"Delete Confirmation",onCancel:function(){return null==_?void 0:_(!1)},onOk:S,children:(0,n.jsx)("div",{className:eh().closeModal,children:(0,n.jsx)("label",{children:null===(i=(0,u.Q)())||void 0===i?void 0:null===(l=i.Account)||void 0===l?void 0:l.removeItemsConfirmation})})})]})},ep=function(e){var t,s=e.item,n=e.productData,i=e.checkedList,a=e.setCheckedList,o=e.checkAll,r=e.setCheckAll,c=e.customerStatus,h=e.refetch,m=(0,l.useContext)(d.I),v=m.setShoppingListUpdated,x=m.setShoppingListLoading,S=m.getCartCount,C=(0,l.useState)(!1),y=C[0],j=C[1],b=(0,l.useState)(!1),k=b[0],N=b[1],w=(0,l.useState)(),L=w[0],Z=w[1],D=(0,l.useState)(),A=D[0],P=D[1],T=(0,l.useState)(!1),I=T[0],B=T[1];(0,l.useEffect)(function(){L?document.body.style.overflow="hidden":document.body.style.overflow="auto"},[L]);var M,R,W,F=(t=(0,p.Z)(function(){var e,t,l;return(0,_.__generator)(this,function(o){switch(o.label){case 0:return e=[],t=[],null==n||n.map(function(s){null==i||i.map(function(n){n===(null==s?void 0:s.id)&&(e.push({product:null==s?void 0:s.slug}),t.push(null==s?void 0:s.name))})}),l={items:e,wishlist_uids:[null==s?void 0:s.uid]}
1,[4,g.Z.post("/api/ERP/customer/wishlist/unwish",{data:l,headers:{sessionId:(0,f.ej)("sessionid")}}).then(function(){var e;h(),Z(!1),E.Z.success({message:"Selected items removed from your shopping list successfully.",duration:2}),null==window||null===(e=window.dataLayer)||void 0===e||e.push({event:"remove_from_wishlist",selected_item:(null==t?void 0:t.length)>1?null==t?void 0:t.join(" , "):t[0]}),null==r||r(!1),null==a||a([])}).catch(function(){E.Z.error({message:(0,u.Q)().General.Messages.SomethingWrongTryAgain,duration:4})})];case 1:return o.sent(),[2]}})}),function(){return t.apply(this,arguments)}),Q=function(){var e,t,s=[],l=0,a=[];null==n||n.map(function(e){null==i||i.map(function(t){t===(null==e?void 0:e.id)&&a.push(e)})}),null==a||a.forEach(function(e,t){var n;l+=null==e?void 0:e.delivered_price,null==s||s.push({item_id:null==e?void 0:null===(n=e.id)||void 0===n?void 0:n.toString(),item_name:null==e?void 0:e.name,coupon:"",currency:"USD",discount:0,index:t,item_brand:null==e?void 0:e.brand_name,item_category:null==e?void 0:e.main_category_name,item_category2:null==e?void 0:e.sub_category_name,item_list_id:"",item_list_name:"",item_variant:null==e?void 0:e.pack_size,price:null==e?void 0:e.delivered_price,quantity:1})}),null==window||null===(e=window.dataLayer)||void 0===e||e.push({ecommerce:null}),null==window||null===(t=window.dataLayer)||void 0===t||t.push({event:"add_to_cart",ecommerce:{currency:"USD",value:l,items:s}})},O=(M=(0,p.Z)(function(){var e,t,s,l,o;return(0,_.__generator)(this,function(d){switch(d.label){case 0:if(j(!0),e=[],t=[],null==n||n.map(function(s){null==i||i.map(function(n){if(n===(null==s?void 0:s.id)){t.push(s);var i=(0,ei.k4)(c,s);null==s||!s.is_available||(null==s?void 0:s.is_prototype)||i||e.push({product:null==s?void 0:s.slug,quantity:(null==s?void 0:s.sold_in_stack)?2:(null==s?void 0:s.min_pallet_quantity)||1})}})}),s=null==t?void 0:t.filter(function(e){return(null==e?void 0:e.is_available)==!1||(null==e?void 0:e.is_prototype)==!0}),l=null==t?void 0:t.filter(function(e){return(0,ei.k4)(c,e)}),o=null==t?void 0:t.filter(function(e){return(null==e?void 0:e.is_available)&&!(null==e?void 0:e.is_prototype)&&!(0,ei.k4)(c,e)}),!(0,f.Zb)(s,t))return[3,1];return j(!1),E.Z.error({message:(0,u.Q)().General.Messages.SomethingWrongTryAgain,duration:4}),[3,5];case 1:if(!(0===e.length&&(null==l?void 0:l.length)>0))return[3,2];return j(!1),E.Z.error({message:"Closeout products cannot be added to cart. Please use Request to Buy on the product page.",duration:4}),[3,5];case 2:var m;return d.trys.push([2,4,,5]),[4,g.Z.post("/api/ERP/cart/setProductQuantity",{headers:{sessionId:(0,f.ej)("sessionid")},data:{items:e}}).then((m=(0,p.Z)(function(e){var n,i,a;return(0,_.__generator)(this,function(r){return j(!1),i=(0,f.JR)(s,t)||(null==l?void 0:l.length)>0&&(null==o?void 0:o.length)>0,a=[],(0,f.JR)(s,t)&&a.push("out of stock"),(null==l?void 0:l.length)>0&&(null==o?void 0:o.length)>0&&a.push("closeout (use Request to Buy)"),E.Z.success({message:i?"Selected items added to cart successfully. Some items were not added because they are ".concat(a.join(" or "),"."):"Selected items added to cart successfully.",duration:2}),localStorage.setItem("CartID",null==e?void 0:null===(n=e.data)||void 0===n?void 0:n.cartId),[2]})}),function(e){return m.apply(this,arguments)})).catch(function(){j(!1),E.Z.error({message:(0,u.Q)().General.Messages.SomethingWrongTryAgain,duration:4})})];case 3:return d.sent(),[3,5];case 4:return d.sent(),j(!1),E.Z.error({message:(0,u.Q)().General.Messages.SomethingWrongTryAgain,duration:4}),[3,5];case 5:return j(!1),null==r||r(!1),S(),null==a||a([]),h(),[2]}})}),function(){return M.apply(this,arguments)}),V=(R=(0,p.Z)(function(){var e;return(0,_.__generator)(this,function(t){return B(!0),N(!0),x(!0),e=[],null==n||n.map(function(t){null==i||i.map(function(s){s===(null==t?void 0:t.id)&&e.push(null==t?void 0:t.slug)})}),P(e),x(!1),N(!1),[2]})}),function(){return R.apply(this,arguments)}),G=(W=(0,p.Z)(function(){return(0,_.__generator)(this,function(e){switch(e.label){case 0:return[4,O()];case 1:return e.sent(),Q(),[2]}})}),function(){return W.apply(this,arguments)});return{checkAll:o,checkedList:i,addToCartStatus:y,addToShoppingListStatus:k,showDeleteDialog:L,setShowDeleteDialog:Z,productSlugs:A,showShoppingListDialog:I,setShowToShoppingListDialog:B,unwishItems:F,onAddToCart:G,addToShoppingListHandler:V,addToCartHandler:Q,setShoppingListUpdated:v,setCheckedList:a,setCheckAll:r}},ev=function(e){var t,s,c=e.uid,h=e.defaultPostZip,p=e.customerStatus,v=(0,l.useContext)(d.I),_=v.guestUser,g=v.setShoppingListUpdated,f=v.shoppingList,x=(0,i.useRouter)(),S=C(c,h,p),y=S.item,j=S.refetch,b=S.isLoading,k=(0,l.useState)(null==y?void 0:y.products),N=k[0],w=k[1],L=(0,l.useState)([]),Z=L[0],D=L[1],A=(0,l.useState)(!1),P=A[0],E=A[1],T=(0,l.useState)(!1),B=T[0],M=T[1],R=!_&&((null==p?void 0:p.profile_completed)===!0||(null==p?void 0:p.is_vendor)===!0);(0,l.useEffect)(function(){w(null==y?void 0:y.products)},[y]),(0,l.useEffect)(function(){M(!(null==f?void 0:f.some(function(e){return(null==y?void 0:y.uid)===(null==e?void 0:e.uid)})))},[f,y]);var W=ep({item:y,productData:N,checkedList:Z,setCheckedList:D,checkAll:P,setCheckAll:E,customerStatus:p,refetch:j}),F=W.addToCartStatus,Q=W.addToShoppingListStatus,O=W.showDeleteDialog,V=W.setShowDeleteDialog,U=W.productSlugs,q=W.showShoppingListDialog,H=W.setShowToShoppingListDialog,z=W.unwishItems,X=W.onAddToCart,J=W.addToShoppingListHandler,K=W.addToCartHandler;return b?(0,n.jsx)(r.Z,{variant:"card",title:"Please wait while we load your delivered prices"}):(0,n.jsxs)("div",{className:"".concat(m().itemViewSection," pb-30"),children:[(0,n.jsx)(I,{item:y,isSharedWishlist:B}),(0,n.jsx)(G,{data:null==y?void 0:y.products,productData:N,setProductData:w,checkedList:Z,setCheckedList:D,checkAll:P,setCheckAll:E,guestUser:_,isCustomerDataCompleted:R,customerStatus:p,addToShoppingListStatus:Q,addToCartStatus:F,onAddToList:J,onAddToCart:X,onDelete:function(){V(!0),g(!0)}}),(0,n.jsx)(o.Z,{theme:"link",onClick:function(){return x.push("/account/shoppingList")},"aria-label":"Back to shopping list page",icon:(0,n.jsx)(a.Z,{name:"arrow",dir:"bottom"}),className:"my-3 ".concat(m().backToShoppingListPage),children:null===(t=(0,u.Q)())||void 0===t?void 0:null===(s=t.Account)||void 0===s?void 0:s.back}),(0,n.jsx)(em,{item:y,productData:N,checkedList:Z,setCheckedList:D,checkAll:P,setCheckAll:E,isCustomerDataCompleted:R,customerStatus:p,refetch:j,showDeleteDialog:O,setShowDeleteDialog:V,productSlugs:U,showShoppingListDialog:q,setShowToShoppingListDialog:H,unwishItems:z,addToCartHandler:K})]})},e_=(0,c.Z)(ev,"/"),eg=s(37597),ef=s.n(eg),ex=s(34853),eS=function(){var e=(0,i.useRouter)(),t=e.query.uid,s=(0,l.useContext)(d.I),a=s.customerStatus,o=s.defaultPostZip;return(0,l.useEffect)(function(){(null==a?void 0:a.is_vendor)||(null==a?void 0:a.profile_completed)||null==a||!a.is_authenticated||e.push("/")},[null==e?void 0:e.query,a]),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(ex.Z,{title:(0,u.Q)().Wishlist.SEO.title,de
1scription:(0,u.Q)().Wishlist.SEO.description}),(0,n.jsx)("div",{className:"".concat(ef().itemsContainer," bg-white color-dark"),children:(0,n.jsx)("div",{className:"container pt-20",children:(0,n.jsx)(e_,{uid:t,defaultPostZip:o,customerStatus:a})})})]})}},76360:function(e,t,s){"use strict";var n=s(26042),i=s(85893),l=s(67294),a=s(58218),o=s(11163),r=s(72246);t.Z=function(e,t){return function(s){var c=(0,o.useRouter)(),d=(0,l.useContext)(a.I).guestUser;return(0,l.useEffect)(function(){if(d){var e;null==c||c.replace(t||"/?epallet_login=true&source_path=".concat(null==c?void 0:null===(e=c.asPath)||void 0===e?void 0:e.replace(/&/g,"__")))}},[d,c]),d?(0,i.jsx)(r.Z,{}):(0,i.jsx)(e,(0,n.Z)({},s))}}},55961:function(e){e.exports={titleSection:"style_titleSection__KIYXW",trimSection:"style_trimSection__b0qju",shareBtn:"style_shareBtn__sFNvJ",editNameBtn:"style_editNameBtn__BZrRK",editNameForm:"style_editNameForm__PNhkG",customEditInput:"style_customEditInput__0zxKL"}},58004:function(e){e.exports={emptyCheckboxContainer:"style_emptyCheckboxContainer__mph_0",emptyWishlist:"style_emptyWishlist__Ggf4k",productWrapper:"style_productWrapper__22SaU",closeModal:"style_closeModal__EWrMX"}},43639:function(e){e.exports={settingContainer:"style_settingContainer__xoR6D",selectAllForMobile:"style_selectAllForMobile__Fg6dR",settingSection:"style_settingSection__1yks3",selectAll:"style_selectAll__PxwTj",btnGroup:"style_btnGroup__arTve",addBtn:"style_addBtn__eKmS_"}},98296:function(e){e.exports={checkboxOverlay:"card_checkboxOverlay__9b3Y0",badgeRowLeft:"card_badgeRowLeft__erUfp",actionsSection:"card_actionsSection__i4ZA_",buildPalletBtn:"card_buildPalletBtn__f9xaH",outOfStock:"card_outOfStock__usfRJ"}},81926:function(e){e.exports={itemViewSection:"styles_itemViewSection__MEYq_",noBorder:"styles_noBorder__0P05O",search:"styles_search__UIo_i",titleSection:"styles_titleSection__Tqob_",trimSection:"styles_trimSection__HkTsz",shareBtn:"styles_shareBtn__mJbf8",editNameBtn:"styles_editNameBtn__rMCge",emptyCheckboxContainer:"styles_emptyCheckboxContainer__ldcut",backToShoppingListPage:"styles_backToShoppingListPage__loEu1",settingContainer:"styles_settingContainer__jj6pP",selectAllForMobile:"styles_selectAllForMobile__RB1_M",settingSection:"styles_settingSection__8CMXS",selectAll:"styles_selectAll__ssd1p",btnGroup:"styles_btnGroup__2hBca",addBtn:"styles_addBtn___e__R",itemsPerPageContainer:"styles_itemsPerPageContainer__meZQw",buttomContainer:"styles_buttomContainer__LEyD7",image:"styles_image__1n5Mo",discount:"styles_discount__wvUIx",category:"styles_category__vdNXR",editNameForm:"styles_editNameForm__7mcLt",emptyWishlist:"styles_emptyWishlist__agcEH",card__wrapper:"styles_card__wrapper__NJPzC",productWrapper:"styles_productWrapper__e31Dx"}},37597:function(e){e.exports={itemsContainer:"styles_itemsContainer__o5vCQ",emptyWishlist:"styles_emptyWishlist__Wvg_d"}}},function(e){e.O(0,[9774,2888,179],function(){return e(e.s=4470)}),_N_E=e.O()}]);
2//# sourceMappingURL=[uid]-51ac766e3be5b29f.js.map

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.