1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/cdn/697-67d0/assets/SelectWishlistDialog-B2xWiWSN.js","/cdn/697-67d0/index.js","/cdn/697-67d0/assets/_sentry-release-injection-file-YRfuXXR4.js","/cdn/697-67d0/assets/sdk-wnmt51sX.js","/cdn/697-67d0/assets/InertiaLink-CjBxl-Qf.js","/cdn/697-67d0/assets/SiteLogo-BnS1cXvf.js","/cdn/697-67d0/assets/module-Chzvur6p.js","/cdn/697-67d0/assets/Icons-4s1HMrf0.js","/cdn/697-67d0/assets/TheNile-CuxiSvBJ.js","/cdn/697-67d0/assets/ProductImage-DWbdZD8w.js","/cdn/697-67d0/assets/Auth-KpIntm3z.js","/cdn/697-67d0/assets/auth-MgabRW7W.js","/cdn/697-67d0/assets/InputErrors-CRo_JE3_.js","/cdn/697-67d0/assets/focus-management-BivKVjAi.js","/cdn/697-67d0/assets/portal-CNWenkrq.js","/cdn/697-67d0/assets/use-by-comparator-BgjIzs3D.js","/cdn/697-67d0/assets/SelectMenu-8dFdf8ok.js","/cdn/697-67d0/assets/events-Bd7zD0yM.js","/cdn/697-67d0/assets/Breadcrumbs-Bm3TPWpq.js","/cdn/697-67d0/assets/TheNile-Djvk7yJp.css","/cdn/697-67d0/assets/CreateDialog-D7L-7EFC.js"])))=>i.map(i=>d[i]); 2import{r as o,j as i,_ as w}from"../index.js";import{B as I}from"./InertiaLink-CjBxl-Qf.js";import{u as x,W as k,b as v}from"./Icons-4s1HMrf0.js";import{a1 as P,a2 as j,$ as D,x as W,d as C,m as p}from"./SiteLogo-BnS1cXvf.js";import"./_sentry-release-injection-file-YRfuXXR4.js";import"./sdk-wnmt51sX.js";import"./module-Chzvur6p.js";try{let e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;
2n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="da009e9b-c73b-4ba4-8535-a7e1c7e8edf9",e._sentryDebugIdIdentifier="sentry-dbid-da009e9b-c73b-4ba4-8535-a7e1c7e8edf9")}catch{}const E=o.lazy(()=>w(()=>import("./SelectWishlistDialog-B2xWiWSN.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]),import.meta.url));function B({product:e,as:n}){const l=n||L,r=x(),{checkMap:d,isLoading:y}=P(e.ean),c=j(),u=D(),[a,b]=o.useState([]),[f,m]=o.useState(!1),{notify:h}=W(),{track:g}=C();o.useEffect(()=>{b(d.get(e.ean)??[])},[d]);const _=o.useCallback(async()=>{if(a.length===0){const s=await c.mutateAsync({wishlist_id:0,ean:e.ean});if(s.status==="success"){const t=p(e);g({name:"add_to_wishlist",properties:{wishlist_id:s.data.id.toString(),wishlist_name:s.data.name,currency:t.currency,value:t.price,items:[t]}}),((await r.refetch()).data?.wishlist?.total_wishlists??0)>1?m(!0):h({title:"Item Added",description:`${e.data.name} has been added to your wishlist.`,type:"info",link:{label:"View wishlist",href:s.data.href}})}else s.status==="error"&&s.message==="guest_wishlist_full"&&h({title:"Wishlist Full",description:"To add unlimited items or create additional lists log in or register to use an account.",type:"error",link:{label:"Log in / Register",href:"/login"},duration:1e4});return}if(a.length===1){const s=await u.mutateAsync({wishlist_id:a[0],ean:e.ean});if(s.status==="success"){const t=p(e);g({name:"remove_from_wishlist",properties:{wishlist_id:s.data.id.toString(),wishlist_name:s.data.name,currency:t.currency,value:t.price,items:[t]}}),h({title:"Item Removed",description:`${e.data.name} has been removed from your wishlist.`,type:"info"})}r.refetch();return}if(a.length>1){m(!0);return}},[c,u,e,r]);return i.jsxs(i.Fragment,{children:[i.jsx(l,{onClick:_,isLoading:y||c.isPending||u.isPending,filled:(d.get(e.ean)?.length??0)>0}),f&&i.jsx(E,{open:f,setOpen:m,product:e,inListIds:a,onClose:()=>r.refetch()})]})}function L({onClick:e,isLoading:n,filled:l}){return i.jsx(I,{intent:"unstyled",size:"small",className:"group disabled:opacity-50",onClick:e,disabled:n,children:l?i.jsx(k,{className:"size-7 text-brand-peach-500"}):i.jsx(v,{className:"size-7 group-hover:text-brand-peach-600"})})}export{B as default}; 3//# sourceMappingURL=https://staging.thenile.com.au/build/assets/Heart-VRIjZhaj.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.