1import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{t}from"./model-container-Dbo0RwXr.js";import{t as n}from"./landmark-adapter-Dcc5XE8-.js";import{t as r}from"./jsh-module-DkUSoj5t.js";import{t as i}from"./react-DVplv7_D.js";import{t as a}from"./client-msFgu0UU.js";import{t as o}from"./jsx-runtime-B74pBk57.js";import{useAppBridge as s}from"./appBridge-BrhQDzGi.js";import{t as c}from"./dist-DWZrBbLW.js";import{t as l}from"./Dialog-Dht_2XCd.js";var u=a(),d=e(i(),1),f=o();function p({errorMessage:e,isWishListErrorLayerOpen:t,close:r,texts:i}){let a=(0,d.useRef)(null),o=s(),u=(0,d.useMemo)(()=>({FULL:{headline:i.bff_wishlist_error_full_headline,content:i.bff_wishlist_error_full_content,landmark:`wishlist_error_layer--full`},ERROR:{headline:i.bff_wishlist_error_default_headline,content:i.bff_wishlist_error_default_content,landmark:`wishlist_error_layer--default`},DUPLICATE:{headline:i.bff_wishlist_error_default_headline,content:i.bff_wishlist_error_default_content,landmark:`wishlist_error_layer--duplicate`},REMOVE:{headline:i.bff_wishlist_error_remove_headline,content:i.bff_wishlist_error_remove_content,landmark:`wishlist_error_layer--remove`},FALLBACK:{headline:i.bff_wishlist_error_default_headline,content:``,landmark:`wishlist_error_layer--default`}}),[i]);(0,d.useEffect)(()=>{if(t){let t=u[e]?.landmark||u.FALLBACK.landmark;return n.sendLandmark({landmark:`layer_view`,name:t}),setTimeout(()=>{let e=a.current?.querySelector(`a`);e&&e.addEventListener(`click`,p)},0),()=>{}}},[t]);let p=t=>{t.preventDefault();let r=u[e]?.landmark||u.FALLBACK.landmark;n.sendClickLandmark(r+`_toWishlist`),window.location.href=t.currentTarget.href},m=(0,d.useCallback)(()=>{r();let t=u[e]?.landmark||u.FALLBACK.landmark;n.sendClickLandmark(t+`_close`)},[r,u,e]),h=(0,d.useCallback)(()=>{t&&m()},[t,m]);o.useAppResumeListener(h);let{headline:g,content:_}=u[e]||u.FALLBACK;return(0,f.jsxs)(l,{zIndex:99999,isOpen:t,onClose:m,children:[(0,f.jsx)(l.Title,{children:g}),(0,f.jsxs)(l.Content,{children:[(0,f.jsx)(c,{component:`div`,children:(0,f.jsx)(`span`,{ref:a,dangerouslySetInnerHTML:{__html:_}})}),(0,f.jsx)(`br`,{})]}),(0,f.jsx)(l.ButtonSection,{children:(0,f.jsx)(l.PrimaryButton,{onClick:m,children:i.checkout__wishlist_errorlayer_button_close})})]})}var{moduleScope:m}=r(`wishlist/wishlist-error-modal`);m instanceof Element&&(0,u.createRoot)(m).render((0,f.jsx)(()=>{let e=t.get(`wishlistGlobalModel`),[n,r]=(0,d.useState)(!1),[i,a]=(0,d.useState)(`FALLBACK`),o=d.useCallback(e=>{let{error:t}=e.detail||{};t&&a(t),r(!0)},[]),s=d.useCallback(()=>{r(!1)},[]);return d.useEffect(()=>(window.addEventListener(`wishlist-error-modal:open`,o),()=>{window.removeEventListener(`wishlist-error-modal:open`,o)}),[]),(0,f.jsx)(p,{errorMessage:i,isWishListErrorLayerOpen:n,close:s,texts:e?.texts})},{})); 2//# sourceMappingURL=wishlist-error-modal-init-DeJBpwec.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.