PageSourceSearch

https://www.braunhousehold.com/mobify/bundle/284/pages-account-wishlist-share.js

js braunhousehold.com collected 2026-10-02 04:23:26 UTC 12,225 bytes, 2 lines download raw bytes

1"use strict";(self.__LOADABLE_LOADED_CHUNKS__=self.__LOADABLE_LOADED_CHUNKS__||[]).push([[51],{10636:(e,t,r)=>{r.d(t,{A:()=>k});var o=r(68175),n=r(28407),i=r(77810),l=r(75826),a=r.n(l),s=r(36287),c=r(14893),u=r(41863),d=r(60309),m=r(25635),p=r(40586),v=r(62241),y=r(63363),f=r(77214),g=r(64965),h=r(68644),E=r(68066),b=r(54957),A=r(20877),O=r(20922),I=r(28467),w=r(14905),P=r(8884),_=r(68727);function L(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,o)}return r}function j(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?L(Object(r),!0).forEach((function(t){(0,o.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):L(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const D=({product:e,compactView:t=!1,isBackorder:r=!1})=>{var o;const{data:l}=(0,d.J)(),{toggleNotifyProduct:a,isProductNotified:L,openModal:D}=(0,p.S)(),{data:k}=(0,b.X)(),C=(0,v.useOrigin)(!1),[S,N]=(0,i.useState)(!1),{fetchMCValidToken:T}=(0,_.f)(),[M,x]=(0,i.useState)(null),[R,z]=(0,i.useState)(!1),{locale:B}=(0,E.A)(),{addLayer:W}=(0,A.W)(),V=(0,g.useLocation)(),{isWishlistPage:$,isProductDetail:U}=(0,h.A)().currentPage(V.pathname),G=(0,I.I8)("notShoppableCountry"),K="NotifyMePressed_",F=U?null==e?void 0:e.id:$?null==e?void 0:e.productId:null==e||null===(o=e.representedProduct)||void 0===o?void 0:o.id;(0,i.useEffect)((()=>{const e=(0,f.KW)(`${K}${F}`),t=L(F)||e;z(t)}),[F,L]);const q=function(){var e=(0,n.A)((function*(e){try{if(null==e||!e.email)return void console.error("Email is required for notification");N(!0);const t=yield T(),r={contactKey:null==e?void 0:e.userId,data:{id_gigya:null==e?void 0:e.userId,email:null==e?void 0:e.email,sku:F,EntryDate:(0,f.ux)(new Date),locale:B.id,brand:P.wK}},o=yield fetch(`${C}${y.AH}/trigger-notify-flow-email-event-marketing-cloud`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`},body:JSON.stringify(r)}),n=yield o.json();!0===n.success?(z(!0),(0,f._Y)(`${K}${F}`,F,864e5),a(F)):(x("Email event triggering failed: "+n.error),console.error("Email event triggering failed: "+n.error))}catch(e){console.error("Error during  notify flow:",e),x("Error during notify flow: "+e.message)}finally{N(!1)}}));return function(t){return e.apply(this,arguments)}}(),H=function(){var t=(0,n.A)((function*(t){const r=JSON.parse(localStorage.getItem("DL-NotifyMe-Customer"));try{const o=j(j({},t),{},{userId:(null==l?void 0:l.c_gigyaId)||(null==k?void 0:k.c_gigyaGuestId)||(null==r?void 0:r.c_gigyaId),email:(null==l?void 0:l.email)||(null==r?void 0:r.email),product:e});N(!0),yield W(O.I1.bind(void 0,{event:"stock-alert",items:[{item_name:null==e?void 0:e.c_defaultName,item_id:F,item_category:null==e?void 0:e.c_defaultCategoryName}]})),yield q(o)}catch(e){console.error("Error:",e)}}));return function(e){return t.apply(this,arguments)}}();return i.createElement(s.az,{className:"notify-me-button"},S&&i.createElement(w.A,null),!G&&i.createElement(c.$,{w:"full",onClick:()=>{null!=l&&l.isGuest?D(!0,H):H()},isDisabled:!(null!=l&&l.isGuest)&&R,variant:t?r?"secondary-small":"primary-small":null!=l&&l.isGuest||!R?r?"secondary":"primary":"primary-pressed",leftIcon:t||null!=l&&l.isGuest||!R?void 0:i.createElement(m.CheckIcon,{boxSize:"iconsSize.medium"})},null!=l&&l.isGuest||!R?i.createElement(u.A,{id:"global.notify-me-button",defaultMessage:[{type:0,value:"Notify Me"}]}):i.createElement(u.A,{id:"global.notify-me-button-unsubscribed",defaultMessage:[{type:0,value:"Notified"}]})))};D.propTypes={product:a().oneOfType([a().shape({type:a().object,productType:a().object,representedProduct:a().object,variationAttributes:a().array}),a().arrayOf(a().shape({type:a().object,productType:a().object,representedProduct:a().object,variationAttributes:a().array}))]).isRequired,compactView:a().bool,isBackorder:a().bool},D.displayName="NotifyMeButton";
1const k=D},56032:(e,t,r)=>{r.r(t),r.d(t,{default:()=>E});var o=r(64180),n=r(77810),i=r(41863),l=r(73352),a=r(45915),s=r(14893),c=r(40133),u=r(75712),d=r(87916),m=r(90031),p=r(64965),v=r(19150),y=r(28407),f=r(68066);const g=(e,t,r)=>{const[o,i]=(0,n.useState)(!1),[l,a]=(0,n.useState)([]),s=(0,m.useCommerceApi)(),{getTokenWhenReady:c}=(0,m.useAccessToken)(),{site:u}=(0,f.A)(),d=(0,m.useConfig)();return(0,n.useEffect)((()=>{const o=function(){var r=(0,y.A)((function*(){var r;if(null==t||null===(r=t.productListItems)||void 0===r||!r.length)return;const o=yield c();try{const r=yield Promise.all(t.productListItems.map(function(){var t=(0,y.A)((function*(t){return yield s.shopperCustomers.getProductListItem({parameters:{organizationId:d.organizationId,listId:e,itemId:t.id,siteId:u.id},headers:{Authorization:`Bearer ${o}`}})}));return function(e){return t.apply(this,arguments)}}()));a(r)}catch(e){console.error("Error fetching product list items:",e)}}));return function(){return r.apply(this,arguments)}}();t&&!r&&o()}),[t,r]),(0,n.useEffect)((()=>{!r&&t&&(null==l?void 0:l.length)>0&&i(!0)}),[r,t,l]),{isReady:o,productListItems:l}};var h=r(14905);const E=()=>{var e,t,r;const y=(0,l.o5)("Wishlist"),f=(0,p.useLocation)(),E=new URLSearchParams(f.search).get("wishlistId"),{data:b,isLoading:A}=(0,m.usePublicProductList)({parameters:{listId:E}},{enabled:Boolean(E),onError:e=>console.error("PublicProductList Error:",e)}),{isReady:O,productListItems:I}=g(E,b,A),w=null==I?void 0:I.map((e=>{var t;return null===(t=e.product)||void 0===t?void 0:t.id})),{data:P,isLoading:_}=(0,m.useProducts)({parameters:{ids:null==w?void 0:w.join(","),expand:["availability","images"]},headers:{"x-debug":"wishlist-share-index"}},{enabled:(null==w?void 0:w.length)>0,onError:e=>console.error("UseProduct Error:",e)});if(!O||_)return n.createElement(h.A,null);const L=Boolean((null==b||null===(e=b.productListItems)||void 0===e?void 0:e.length)&&I.length&&(null==P||null===(t=P.data)||void 0===t?void 0:t.length));return n.createElement(a.s,(0,o.A)({},null==y?void 0:y.sharedWishlistContainer,{"data-testid":(L?"":"empty-")+"shared-wishlist-page"}),L?n.createElement(n.Fragment,null,n.createElement(a.s,null==y?void 0:y.sharedWishlistTitleContainer,n.createElement(s.$,{variant:"text-button",as:d.A,to:"/"},n.createElement(i.A,{defaultMessage:[{type:0,value:"Back to homepage"}],id:"login_form.message.back_to_homepage"})),n.createElement(c.E,null==y?void 0:y.wishlistTitle,n.createElement(i.A,{defaultMessage:[{type:0,value:"Shared Wishlist"}],id:"wishlist_share.title.shared_wishlist"})),n.createElement(c.E,null==y?void 0:y.wishlistTextSuggestion,n.createElement(i.A,{defaultMessage:[{type:0,value:"Take a look at my De'Longhi product wishlist below."}],id:"wishlist_share.subtitle.shared_wishlist"}))),n.createElement(u.c,null==y?void 0:y.sharedWishlistDivider),n.createElement(a.s,y.sharedWishlistGrid,null==P||null===(r=P.data)||void 0===r?void 0:r.map((e=>n.createElement(v.A,{key:e.id,product:e,showLoading:!1,primaryAction:null,onItemQuantityChange:()=>{},secondaryActions:null}))))):n.createElement(c.E,null,n.createElement(i.A,{defaultMessage:[{type:0,value:"This wishlist is empty or no longer available."}],id:"wishlist_share.empty_list"})))}},19150:(e,t,r)=>{r.d(t,{A:()=>V});var o=r(64180),n=r(68175),i=r(77810),l=r(75826),a=r.n(l),s=r(34692),c=r(41863),u=r(73352),d=r(42047),m=r(36287),p=r(86400),v=r(45915),y=r(64194),f=r(82070),g=r(40133),h=r(87916),E=r(55981),b=r(70581),A=r(38321),O=r(24961),I=r(53302),w=r(20389),P=r(91332),_=r(8174),L=r(25635),j=r(47642),D=r(10636),k=r(76396),C=r(86639),S=r(62004),N=r(32105),T=r(28467),M=r(14905),x=r(8884),R=r(23397);function z(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,o)}return r}function B(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?z(Object(r),!0).forEach((function(t){(0,n.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):z(Object(r)).forEac
1h((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const W=({product:e,secondaryActions:t,showLoading:r=!1})=>{var n,l,a,z,W,V,$,U,G,K,F,q,H,Y,J,Q;const{currency:X}=(0,I.H2)(),{formatMessage:Z}=(0,s.A)(),ee=(0,u.Vl)("Wishlist"),[te]=(0,d.U)(`(max-width: ${E.f.md})`),re=(0,T.I8)("notShoppableCountry"),[oe,ne]=(0,i.useState)(0),ie=(0,i.useRef)(null),le=(0,R.r)(e),ae="braun"===x.UK?L.InfoLabelIcon:L.InfoIcon,se="braun"===x.UK?L.CloseLabelIcon:L.CloseIcon;e=B(B({},e),le);const{productUrl:ce,priceData:ue}=(0,S.Ay)(e,N.dX),de=(0,T.I8)("showLastItemThreshold");return i.createElement(m.az,(0,o.A)({},null==ee?void 0:ee.itemContainer,{"data-testid":`sf-cart-item-${e.productId?e.productId:e.id}`}),i.createElement(b.A,{variant:e},r&&i.createElement(M.A,null),i.createElement(p.B,null==ee?void 0:ee.flexContainer,i.createElement(p.B,null==ee?void 0:ee.productDetails,i.createElement(h.A,(0,o.A)({to:ce},null==ee?void 0:ee.productImageContainer),i.createElement(A.A,(0,o.A)({},null==ee?void 0:ee.productImage,{imageProps:null==ee?void 0:ee.cartImage})),i.createElement(v.s,null==ee?void 0:ee.removeIcon,t),i.createElement(y.z,ee.badgeGroup,i.createElement(C.Y,{product:e,priceData:ue}))),(null===(n=e)||void 0===n||null===(l=n.inventory)||void 0===l?void 0:l.stockLevel)<=de&&0!==(null===(a=e)||void 0===a||null===(z=a.inventory)||void 0===z?void 0:z.stockLevel)&&i.createElement(_.A,{variant:"lastFewItems",icon:i.createElement(ae,{circleColor:"transparent"}),textMessage:i.createElement(c.A,{id:"use_product.message.low_stock",defaultMessage:[{type:0,value:"Last "},{type:1,value:"quantity"},{type:0,value:" "},{type:1,value:"itemLabel"}],values:{quantity:null===(W=e)||void 0===W||null===(V=W.inventory)||void 0===V?void 0:V.stockLevel,itemLabel:1===(null===($=e)||void 0===$||null===(U=$.inventory)||void 0===U?void 0:U.stockLevel)?i.createElement(c.A,{id:"global.message.item",defaultMessage:[{type:0,value:"item"}]}):i.createElement(c.A,{id:"global.message.items",defaultMessage:[{type:0,value:"items"}]})}})}),0===(null===(G=e)||void 0===G||null===(K=G.inventory)||void 0===K?void 0:K.stockLevel)&&i.createElement(_.A,{variant:"outOfStock",icon:i.createElement(se,null),textMessage:i.createElement(c.A,{id:"use_product.message.out_of_stock",defaultMessage:[{type:0,value:"Out of stock"}]})}),i.createElement(m.az,null==ee?void 0:ee.detailContainer,i.createElement(m.az,null==ee?void 0:ee.headerStack,i.createElement(h.A,{to:ce},i.createElement(O.A,null==ee?void 0:ee.itemName))),i.createElement(v.s,{flexDirection:"column"},i.createElement(w.A,{priceData:ue,currency:X,listPriceProps:B({},ee.productListPrice),currentPriceProps:B({},ee.productDetailPrice),discountProps:{display:"none"},productDetailPriceView:!0,notShoppableCountry:re}),!re&&ue.showOmnibusPriceDiscount&&i.createElement(m.az,ee.productOmnibusWrapper,i.createElement(P.A,{priceData:ue,currency:X,omnibusExpandedView:!0,variant:"recommended"}))),i.createElement(m.az,{ref:ie},oe?i.createElement(f.z,{in:!0},i.createElement(g.E,{color:"text.danger",fontWeight:"semibold",marginBottom:8},oe===k.je.INVENTORY_REMAINING_FOR_PRODUCT?Z(k.tn.INVENTORY_REMAINING_FOR_PRODUCT,{stockLevel:(null===(F=e)||void 0===F||null===(q=F.c_extendVariant)||void 0===q?void 0:q.stock)||0,productName:e.productName}):Z(k.tn.NO_VARIANT_SELECTED))):i.createElement(i.Fragment,null)),!re&&i.createElement(p.B,{w:"full"},0===(null===(H=e)||void 0===H||null===(Y=H.inventory)||void 0===Y?void 0:Y.stockLevel)||null===(null===(J=e)||void 0===J||null===(Q=J.c_extendVariant)||void 0===Q?void 0:Q.stock)?i.createElement(D.A,{product:e}):i.createElement(j.A,{product:e,compactView:te,setShowErrorMessage:ne,errorContainerRef:ie,showUniversalFeedback:!0})))))))};W.propTypes={product:a().object,onItemQuantityChange:a().func,onAddItemToCart:a().func,showLoading:a().bool,isWishlistItem:a().bool,secondaryActions:a().node};const V=W}}]);
2//# sourceMappingURL=pages-account-wishlist-share.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.