try{let e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="ef181f3d-0498-44f7-963f-557a85b30d93",e._sentryDebugIdIdentifier="sentry-dbid-ef181f3d-0498-44f7-963f-557a85b30d93")}catch(e){}(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7169],{256:(e,t,r)=>{"use strict";r.d(t,{BuyBookButton:()=>c});var o=r(84573),n=r(96582),l=r(9448),a=r(5406),s=r(66601),i=r(10479);let c=(0,s.memo)(e=>{let{book:t,className:r}=e,{isOpen:s,onOpen:c,onOpenChange:u}=(0,l.j)();return t?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(a.T,{color:"primary",onPress:()=>{try{null==c||c()}catch(e){console.error("Error opening modal:",e),n.Cp(e)}},"aria-label":"Buy ".concat(t.title),className:r,children:"Buy Now"}),(0,o.jsx)(i.B,{book:t,isOpen:s,onOpenChange:u})]}):(!function(){let e="BuyBookButton: No book provided";console.warn(e),n.wd(e,{level:"warning",extra:{component:"BuyBookButton"}})}(),null)});c.displayName="BuyBookButton"},10479:(e,t,r)=>{"use strict";r.d(t,{B:()=>b});var o=r(84573),n=r(96582),l=r(59547),a=r(83330),s=r(89392),i=r(88797),c=r(5406),u=r(69048),d=r(88312),m=r(66601),h=r(96961);let f="/books/preorder",b=m.memo(e=>{let{book:t,isOpen:r,onOpenChange:b}=e,{sendEvent:x}=(0,h.s)(),p=!!(null==t?void 0:t.title),g=(0,m.useMemo)(()=>{if(!p)return[];let e=[];return(t.amazonLink||f)&&e.push({type:"Paperback",href:t.amazonLink||f}),(t.myStoreLink||f)&&e.push({type:"eBook",href:t.myStoreLink||f}),t.hasAudiobook&&t.myStoreLink&&e.push({type:"Audiobook",href:t.myStoreLink}),t.hasAudible&&t.amazonLink&&e.push({type:"Audible",href:t.amazonLink}),e},[t,p]),v=(0,m.useCallback)(e=>{null==b||b(e)},[b]);if(!p){let e=Error("BuyBookModal: Book or book title is missing");return console.error(e),n.Cp(e),null}if(0===g.length){let e=Error("BuyBookModal: No purchase options available for book: ".concat(t.title));return console.warn(e),n.wd(e.message,{level:"warning"}),null}return(0,o.jsx)(l.Y,{isOpen:r,onOpenChange:v,size:"sm",hideCloseButton:!0,children:(0,o.jsx)(a.g,{className:"pb-0",children:e=>(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(s.c,{className:"flex flex-col gap-1",children:["Buy ",t.title]}),(0,o.jsx)(i.h,{children:g.map(e=>{let{type:r,href:l}=e;return(0,o.jsxs)(c.T,{as:u.h,href:l,color:"primary",className:"w-full mb-2",isExternal:l.startsWith("http"),"aria-label":"Buy ".concat(r," version of ").concat(t.title),onPress:()=>{try{if(!l)return;x({name:"redirect_to_ext_store_with_intent_to_buy",params:{book_title:t.title,format:r}}),l.startsWith("http")&&window.open(l,"_blank","noopener,noreferrer")}catch(e){console.error("Error handling button press:",e),n.Cp(e)}},children:[r,"Audible"===r&&(0,o.jsx)("span",{className:"text-xs",children:"(only on Amazon.com \uD83C\uDDFA\uD83C\uDDF8)"})]},r)})}),(0,o.jsx)(d.q,{children:(0,o.jsx)(c.T,{color:"primary",variant:"light",onPress:()=>{try{null==e||e()}catch(e){console.error("Error closing modal:",e),n.Cp(e)}},className:"shadow-none text-white","aria-label":"Close purchase options modal",children:"Close"})})]})})})});b.displayName="BuyBookModal"},26380:(e,t,r)=>{"use strict";r.d(t,{ReviewsCarousel:()=>u});var o=r(84573),n=r(66601),l=r(95099);let a=e=>{let[t,r]=(0,n.useState)(!1),o=(0,n.useRef)({x:0,scrollLeft:0}),l=(0,n.useCallback)(t=>{e.current&&(r(!0),o.current={x:"touches"in t?t.touches[0].clientX:t.clientX,scrollLeft:e.current.scrollLeft})},[e]),a=(0,n.useCallback)(()=>{r(!1)},[]),s=(0,n.useCallback)(r=>{if(!t||!e.current)return;r.preventDefault();let n="touches"in r?r.touches[0].clientX:r.clientX,l=o.current.x-n;e.current.scrollLeft=o.current.scrollLeft+l},[t,e]);return{isDragging:t,handleDragStart:l,handleDragEnd:a,handleDragMove:s}},s={SCROLL_AMOUNT:300},i=(0,n.memo)(function(e){let{review:t,showRating:r,isLast:n}=e;return(0,o.jsx)("div",{className:"w-48 md:w-64 flex-shrink-0 ".concat(n?"":"mr-4 md:mr-8"),children:(0,o.jsx)(l.ReviewCard,{review:t,showRating:r})})}),c=(0,n.memo)(function(e){let{direction:t,show:r,onClick:n}=e;return(0,o.jsx)("button",{onClick:n,className:"absolute ".concat(t,"-0 top-0 bottom-0 w-16 bg-transparent\n no-button-style shadow-none focus:ring-0 focus:outline-none active:bg-transparent \n border-none focus:border-none outline-none\n ").concat(r?"bg-gradient-".concat("left"===t?"to-r":"to-l"," from-white to-transparent"):"pointer-events-none"),"aria-label":"Scroll ".concat(t)})}),u=(0,n.memo)(function(e){let{reviews:t,showRatings:r,title:l="Some reviews",width:u,height:d}=e,m=(0,n.useRef)(null),[h,f]=(0,n.useState)(!1),[b,x]=(0,n.useState)(!0),p=(0,n.useCallback)(()=>{let e=m.current;if(!e)return;let{scrollLeft:t,scrollWidth:r,clientWidth:o}=e;f(t>0),x(t{let t=m.current;if(!t)return;let r="left"===e?-s.SCROLL_AMOUNT:s.SCROLL_AMOUNT;t.scrollBy({left:r,behavior:"smooth"})},[]),{isDragging:v,handleDragStart:y,handleDragEnd:w,handleDragMove:k}=a(m),j=(0,n.useCallback)(e=>{(null==e?void 0:e.currentTarget)&&(null==e?void 0:e.target)&&(e.persist(),k(e))},[k]),N=(0,n.useCallback)(e=>{(null==e?void 0:e.currentTarget)&&(null==e?void 0:e.target)&&(e.persist(),y(e))},[y]),C=(0,n.useCallback)(e=>{(null==e?void 0:e.currentTarget)&&(null==e?void 0:e.target)&&(e.persist(),w())},[w]),B=t.length<2,_=t.length<3&&"lg"===u;return(0,o.jsxs)("section",{className:"".concat("sm"===d?"mt-0 mb-0 p-0":""," section-separator"),children:[(0,o.jsx)("h3",{className:"text-2xl font-bold mb-4",children:l}),(0,o.jsxs)("div",{className:"w-full relative",children:[(0,o.jsx)("div",{className:"mx-auto mb-4 relative overflow-x-auto scrollbar-hide select-none\n max-w-[280px] sm:max-w-[380px] md:max-w-[420px] ".concat("lg"===u?"lg:max-w-[600px]":"","\n cursor-grab active:cursor-grabbing ").concat(B?"flex justify-center":""),ref:m,onScroll:p,onMouseDown:N,onMouseUp:C,onMouseLeave:C,onMouseMove:j,onTouchStart:N,onTouchEnd:C,onTouchMove:j,children:(0,o.jsx)("div",{className:"flex ".concat(_?"md:justify-center":""),children:t.map((e,n)=>(0,o.jsx)(i,{review:e,showRating:r,isLast:n===t.length-1},"review-".concat(n)))})}),(0,o.jsx)(c,{direction:"left",show:h,onClick:()=>g("left")}),(0,o.jsx)(c,{direction:"right",show:b,onClick:()=>g("right")})]})]})})},36226:(e,t,r)=>{"use strict";r.d(t,{BookImage:()=>a});var o=r(66601),n=r(57459),l=r(48356);let a=(0,o.memo)(e=>{let{maxRetries:t=3,retryDelay:r=1e3,priority:a=!1,...s}=e,[i,c]=(0,o.useState)(0),u=i{if(!u||0===i)return;let e=setTimeout(()=>c(0),r);return()=>clearTimeout(e)},[i,r,u]);let d=(0,o.useCallback)(()=>{u&&c(e=>e+1)},[u]);return(0,o.createElement)(n.W,{...s,key:i,onError:d,as:l.default,priority:a,alt:s.alt||"Book cover image"})});a.displayName="BookImage"},81414:(e,t,r)=>{Promise.resolve().then(r.t.bind(r,24716,23)),Promise.resolve().then(r.t.bind(r,34445,23)),Promise.resolve().then(r.bind(r,26380)),Promise.resolve().then(r.bind(r,36226)),Promise.resolve().then(r.bind(r,256))},95099:(e,t,r)=>{"use strict";r.d(t,{ReviewCard:()=>f});var o=r(84573),n=r(65641),l=r(13780),a=r(45106),s=r(66601);let i=(0,s.memo)(function(e){var t;let{author:r}=e;if(!r)return null;let n=(null==(t=r.image)?void 0:t.startsWith("/"))?r.image:"/".concat(r.image);return(0,o.jsxs)("div",{className:"flex mx-auto items-center",children:[r.image&&(0,o.jsx)(a.Q,{size:"sm",src:n,alt:"Avatar of ".concat(r.name),className:"border border-slate-400"}),(0,o.jsxs)("div",{className:"".concat(r.image?"ml-2":""),children:[(0,o.jsx)("p",{className:"my-0 text-tiny",children:r.name}),r.description&&(0,o.jsx)("p",{className:"my-0 text-[10px] leading-3 text-slate-400",children:r.description})]})]})});var c=r(64495);let u={active:"text-yellow-400 fill-yellow-400",inactive:"text-gray-300",base:"w-5 h-5"},d=(0,s.memo)(function(e){let{rating:t,maxStars:r=5}=e;return(0,o.jsx)("div",{className:"flex mx-auto mb-2",role:"img","aria-label":"".concat(t," out of ").concat(r," stars"),children:Array.from({length:r},(e,r)=>(0,o.jsx)(c.A,{className:"".concat(u.base," ").concat(r{"use strict";r.d(t,{s:()=>n});var o=r(66601);function n(){return{sendEvent:(0,o.useCallback)(e=>{let{name:t,params:r}=e;window.gtag&&window.gtag("event",t,r)},[])}}}},e=>{var t=t=>e(e.s=t);e.O(0,[915,8206,4445,5406,5507,224,3477,7763,1004,6306,7358],()=>t(81414)),_N_E=e.O()}]);