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]="9c8e4b8f-8c55-4bd2-8f15-c57677e955cc",e._sentryDebugIdIdentifier="sentry-dbid-9c8e4b8f-8c55-4bd2-8f15-c57677e955cc")}catch(e){}(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2718],{1827:(e,t,r)=>{Promise.resolve().then(r.t.bind(r,70744,23)),Promise.resolve().then(r.t.bind(r,67873,23)),Promise.resolve().then(r.bind(r,18809)),Promise.resolve().then(r.bind(r,87041)),Promise.resolve().then(r.bind(r,87054)),Promise.resolve().then(r.bind(r,56787)),Promise.resolve().then(r.bind(r,61211)),Promise.resolve().then(r.bind(r,40377))},51615:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{callServer:function(){return n.callServer},createServerReference:function(){return l},findSourceMapURL:function(){return o.findSourceMapURL}});let n=r(82516),o=r(36424),l=r(52640).createServerReference},99500:(e,t,r)=>{"use strict";r.d(t,{ReviewCard:()=>m});var n=r(3896),o=r(49948),l=r(17429),a=r(99058),i=r(52308);let s=(0,i.memo)(function(e){var t;let{author:r}=e;if(!r)return null;let o=(null===(t=r.image)||void 0===t?void 0:t.startsWith("/"))?r.image:"/".concat(r.image);return(0,n.jsxs)("div",{className:"flex mx-auto items-center",children:[r.image&&(0,n.jsx)(a.Q,{size:"sm",src:o,alt:"Avatar of ".concat(r.name),className:"border border-slate-400"}),(0,n.jsxs)("div",{className:"".concat(r.image?"ml-2":""),children:[(0,n.jsx)("p",{className:"my-0 text-tiny",children:r.name}),r.description&&(0,n.jsx)("p",{className:"my-0 text-[10px] leading-3 text-slate-400",children:r.description})]})]})});var c=r(52863);let u={active:"text-yellow-400 fill-yellow-400",inactive:"text-gray-300",base:"w-5 h-5"},d=(0,i.memo)(function(e){let{rating:t,maxStars:r=5}=e;return(0,n.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,n.jsx)(c.A,{className:"".concat(u.base," ").concat(r{"use strict";r.d(t,{ReviewsCarousel:()=>u});var n=r(3896),o=r(52308),l=r(99500);let a=e=>{let[t,r]=(0,o.useState)(!1),n=(0,o.useRef)({x:0,scrollLeft:0}),l=(0,o.useCallback)(t=>{if(!e.current)return;r(!0);let o="touches"in t?t.touches[0].clientX:t.clientX;n.current={x:o,scrollLeft:e.current.scrollLeft}},[e]),a=(0,o.useCallback)(()=>{r(!1)},[]),i=(0,o.useCallback)(r=>{if(!t||!e.current)return;r.preventDefault();let o="touches"in r?r.touches[0].clientX:r.clientX,l=n.current.x-o;e.current.scrollLeft=n.current.scrollLeft+l},[t,e]);return{isDragging:t,handleDragStart:l,handleDragEnd:a,handleDragMove:i}},i={SCROLL_AMOUNT:300},s=(0,o.memo)(function(e){let{review:t,showRating:r,isLast:o}=e;return(0,n.jsx)("div",{className:"w-48 md:w-64 flex-shrink-0 ".concat(o?"":"mr-4 md:mr-8"),children:(0,n.jsx)(l.ReviewCard,{review:t,showRating:r})})}),c=(0,o.memo)(function(e){let{direction:t,show:r,onClick:o}=e;return(0,n.jsx)("button",{onClick:o,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,o.memo)(function(e){let{reviews:t,showRatings:r,title:l="Some reviews",width:u,height:d}=e,f=(0,o.useRef)(null),[h,m]=(0,o.useState)(!1),[v,b]=(0,o.useState)(!0),p=(0,o.useCallback)(()=>{let e=f.current;if(!e)return;let{scrollLeft:t,scrollWidth:r,clientWidth:n}=e;m(t>0),b(t{let t=f.current;if(!t)return;let r="left"===e?-i.SCROLL_AMOUNT:i.SCROLL_AMOUNT;t.scrollBy({left:r,behavior:"smooth"})},[]),{isDragging:x,handleDragStart:y,handleDragEnd:w,handleDragMove:j}=a(f),k=(0,o.useCallback)(e=>{(null==e?void 0:e.currentTarget)&&(null==e?void 0:e.target)&&(e.persist(),j(e))},[j]),S=(0,o.useCallback)(e=>{(null==e?void 0:e.currentTarget)&&(null==e?void 0:e.target)&&(e.persist(),y(e))},[y]),C=(0,o.useCallback)(e=>{(null==e?void 0:e.currentTarget)&&(null==e?void 0:e.target)&&(e.persist(),w())},[w]),N=t.length<2,B=t.length<3&&"lg"===u;return(0,n.jsxs)("section",{className:"".concat("sm"===d?"mt-0 mb-0 p-0":""," section-separator"),children:[(0,n.jsx)("h3",{className:"text-2xl font-bold mb-4",children:l}),(0,n.jsxs)("div",{className:"w-full relative",children:[(0,n.jsx)("div",{className:"mx-auto mb-4 relative overflow-x-auto scrollbar-hide select-none\n max-w-[300px] sm:max-w-[380px] md:max-w-[420px] ".concat("lg"===u?"lg:max-w-[600px]":"","\n cursor-grab active:cursor-grabbing ").concat(N?"flex justify-center":""),ref:f,onScroll:p,onMouseDown:S,onMouseUp:C,onMouseLeave:C,onMouseMove:k,onTouchStart:S,onTouchEnd:C,onTouchMove:k,children:(0,n.jsx)("div",{className:"flex ".concat(B?"md:justify-center":""),children:t.map((e,o)=>(0,n.jsx)(s,{review:e,showRating:r,isLast:o===t.length-1},"review-".concat(o)))})}),(0,n.jsx)(c,{direction:"left",show:h,onClick:()=>g("left")}),(0,n.jsx)(c,{direction:"right",show:v,onClick:()=>g("right")})]})]})})},56787:(e,t,r)=>{"use strict";r.d(t,{BookImage:()=>a});var n=r(52308),o=r(6643),l=r(32944);let a=(0,n.memo)(e=>{let{maxRetries:t=3,retryDelay:r=1e3,priority:a=!1,...i}=e,[s,c]=(0,n.useState)(0),u=s{if(!u||0===s)return;let e=setTimeout(()=>c(0),r);return()=>clearTimeout(e)},[s,r,u]);let d=(0,n.useCallback)(()=>{u&&c(e=>e+1)},[u]);return(0,n.createElement)(o.W,{...i,key:s,onError:d,as:l.default,priority:a})});a.displayName="BookImage"},61211:(e,t,r)=>{"use strict";r.d(t,{BuyBookButton:()=>c});var n=r(3896),o=r(42363),l=r(16465),a=r(60157),i=r(52308),s=r(19778);let c=(0,i.memo)(e=>{let{book:t,className:r}=e,{isOpen:i,onOpen:c,onOpenChange:u}=(0,l.j)();return t?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(a.T,{color:"primary",onPress:()=>{try{null==c||c()}catch(e){console.error("Error opening modal:",e),o.Cp(e)}},"aria-label":"Buy ".concat(t.title),className:r,children:"Buy Now"}),(0,n.jsx)(s.B,{book:t,isOpen:i,onOpenChange:u})]}):(!function(){let e="BuyBookButton: No book provided";console.warn(e),o.wd(e,{level:"warning",extra:{component:"BuyBookButton"}})}(),null)});c.displayName="BuyBookButton"},19778:(e,t,r)=>{"use strict";r.d(t,{B:()=>m});var n=r(3896),o=r(42363),l=r(85617),a=r(53936),i=r(97406),s=r(32471),c=r(60157),u=r(27240),d=r(60470),f=r(52308);let h="/books/preorder",m=f.memo(e=>{let{book:t,isOpen:r,onOpenChange:m}=e;if(!(null==t?void 0:t.title)){let e=Error("BuyBookModal: Book or book title is missing");return console.error(e),o.Cp(e),null}let v=(0,f.useMemo)(()=>{let e=[];return(t.amazonLink||h)&&e.push({type:"Paperback",href:t.amazonLink||h}),(t.myStoreLink||h)&&e.push({type:"eBook",href:t.myStoreLink||h}),t.hasAudiobook&&t.myStoreLink&&e.push({type:"Audiobook",href:t.myStoreLink}),e},[t.amazonLink,t.myStoreLink,t.hasAudiobook]),b=(0,f.useCallback)(e=>{null==m||m(e)},[m]);if(0===v.length){let e=Error("BuyBookModal: No purchase options available for book: ".concat(t.title));return console.warn(e),o.wd(e.message,{level:"warning"}),null}return(0,n.jsx)(l.Y,{isOpen:r,onOpenChange:b,size:"sm",hideCloseButton:!0,children:(0,n.jsx)(a.g,{className:"pb-0",children:e=>(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(i.c,{className:"flex flex-col gap-1",children:["Buy ",t.title]}),(0,n.jsx)(s.h,{children:v.map(e=>{let{type:r,href:l}=e;return(0,n.jsx)(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;l.startsWith("http")&&window.open(l,"_blank","noopener,noreferrer")}catch(e){console.error("Error handling button press:",e),o.Cp(e)}},children:r},r)})}),(0,n.jsx)(d.q,{children:(0,n.jsx)(c.T,{color:"primary",variant:"light",onPress:()=>{try{null==e||e()}catch(e){console.error("Error closing modal:",e),o.Cp(e)}},className:"shadow-none text-white","aria-label":"Close purchase options modal",children:"Close"})})]})})})});m.displayName="BuyBookModal"},3851:(e,t,r)=>{"use strict";r.d(t,{d:()=>c});var n=r(78468),o=r(28405),l=r(73223),a=r(93288),i=r(3896),s=(0,o.Rf)((e,t)=>{var r;let{as:o,className:s,children:c,...u}=e,d=(0,l.zD)(t),{slots:f,classNames:h}=(0,n.f)(),m=(0,a.$z)(null==h?void 0:h.header,s);return(0,i.jsx)(o||"div",{ref:d,className:null==(r=f.header)?void 0:r.call(f,{class:m}),...u,children:c})});s.displayName="HeroUI.CardHeader";var c=s},77470:(e,t,r)=>{"use strict";r.d(t,{Z:()=>c});var n=r(78468),o=r(28405),l=r(73223),a=r(93288),i=r(3896),s=(0,o.Rf)((e,t)=>{var r;let{as:o,className:s,children:c,...u}=e,d=(0,l.zD)(t),{slots:f,classNames:h}=(0,n.f)(),m=(0,a.$z)(null==h?void 0:h.footer,s);return(0,i.jsx)(o||"div",{ref:d,className:null==(r=f.footer)?void 0:r.call(f,{class:m}),...u,children:c})});s.displayName="HeroUI.CardFooter";var c=s},46187:(e,t,r)=>{"use strict";r.d(t,{P:()=>z});var n=r(45252),o=r(93288),l=r(28405),a=r(91133),i=r(52308);function s(){return(s=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let{style:r,minRows:l=3,maxRows:s=8,cacheMeasurements:c=!1,disableAutosize:u=!1,onHeightChange:d,...f}=e,{Component:h,label:m,description:v,startContent:b,endContent:p,hasHelper:g,shouldLabelBeOutside:x,shouldLabelBeInside:y,isInvalid:w,errorMessage:j,getBaseProps:k,getLabelProps:S,getInputProps:C,getInnerWrapperProps:L,getInputWrapperProps:z,getHelperWrapperProps:E,getDescriptionProps:M,getErrorMessageProps:T,isClearable:O,getClearButtonProps:P}=(0,n.G)({...f,ref:t,isMultiline:!0}),[F,_]=(0,i.useState)(l>1),[A,H]=(0,i.useState)(!1),W=m?(0,R.jsx)("label",{...S(),children:m}):null,I=C(),U=u?(0,R.jsx)("textarea",{...I,style:(0,a.v)(I.style,null!=r?r:{})}):(0,R.jsx)(N,{...I,cacheMeasurements:c,"data-hide-scroll":(0,o.sE)(!A),maxRows:s,minRows:l,style:(0,a.v)(I.style,null!=r?r:{}),onHeightChange:(e,t)=>{1===l&&_(e>=2*t.rowHeight),s>l&&H(e>=s*t.rowHeight),null==d||d(e,t)}}),D=(0,i.useMemo)(()=>O?(0,R.jsx)("button",{...P(),children:(0,R.jsx)(B.o,{})}):null,[O,P]),q=(0,i.useMemo)(()=>b||p?(0,R.jsxs)("div",{...L(),children:[b,U,p]}):(0,R.jsx)("div",{...L(),children:U}),[b,I,p,L]),X=w&&j,G=X||v;return(0,R.jsxs)(h,{...k(),children:[x?W:null,(0,R.jsxs)("div",{...z(),"data-has-multiple-rows":(0,o.sE)(F),children:[y?W:null,q,D]}),g&&G?(0,R.jsx)("div",{...E(),children:X?(0,R.jsx)("div",{...T(),children:j}):(0,R.jsx)("div",{...M(),children:v})}):null]})});L.displayName="HeroUI.Textarea";var z=L}}]);