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]="35f3e28f-1f8f-48a1-97c8-c3054fd5c875",e._sentryDebugIdIdentifier="sentry-dbid-35f3e28f-1f8f-48a1-97c8-c3054fd5c875")}catch(e){}(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1315],{22389:(e,t,r)=>{"use strict";r.d(t,{P:()=>z});var n=r(62878),o=r(24556),l=r(99930),a=r(8894),i=r(28342);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:x,shouldLabelBeOutside:g,shouldLabelBeInside:y,isInvalid:w,errorMessage:j,getBaseProps:k,getLabelProps:C,getInputProps:S,getInnerWrapperProps:L,getInputWrapperProps:z,getHelperWrapperProps:E,getDescriptionProps:M,getErrorMessageProps:T,isClearable:_,getClearButtonProps:O}=(0,n.G)({...f,ref:t,isMultiline:!0}),[P,A]=(0,i.useState)(l>1),[F,D]=(0,i.useState)(!1),H=m?(0,R.jsx)("label",{...C(),children:m}):null,W=S(),I=u?(0,R.jsx)("textarea",{...W,style:(0,a.v)(W.style,null!=r?r:{})}):(0,R.jsx)(N,{...W,cacheMeasurements:c,"data-hide-scroll":(0,o.sE)(!F),maxRows:s,minRows:l,style:(0,a.v)(W.style,null!=r?r:{}),onHeightChange:(e,t)=>{1===l&&A(e>=2*t.rowHeight),s>l&&D(e>=s*t.rowHeight),null==d||d(e,t)}}),U=(0,i.useMemo)(()=>_?(0,R.jsx)("button",{...O(),children:(0,R.jsx)(B.o,{})}):null,[_,O]),q=(0,i.useMemo)(()=>b||p?(0,R.jsxs)("div",{...L(),children:[b,I,p]}):(0,R.jsx)("div",{...L(),children:I}),[b,W,p,L]),X=w&&j,G=X||v;return(0,R.jsxs)(h,{...k(),children:[g?H:null,(0,R.jsxs)("div",{...z(),"data-has-multiple-rows":(0,o.sE)(P),children:[y?H:null,q,U]}),x&&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},24890:(e,t,r)=>{"use strict";r.d(t,{BookImage:()=>a});var n=r(28342),o=r(4907),l=r(16863);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,alt:i.alt||"Book cover image"})});a.displayName="BookImage"},29782:(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(29025),o=r(66745),l=r(97818).createServerReference},30520:(e,t,r)=>{"use strict";r.d(t,{BuyBookButton:()=>c});var n=r(83670),o=r(53647),l=r(41423),a=r(71955),i=r(28342),s=r(79015);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:e=>{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"},33787:(e,t,r)=>{"use strict";r.d(t,{ReviewsCarousel:()=>u});var n=r(83670),o=r(28342),l=r(35887);let a=e=>{let[t,r]=(0,o.useState)(!1),n=(0,o.useRef)({x:0,scrollLeft:0}),l=(0,o.useCallback)(t=>{e.current&&(r(!0),n.current={x:"touches"in t?t.touches[0].clientX:t.clientX,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:g,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]),C=(0,o.useCallback)(e=>{(null==e?void 0:e.currentTarget)&&(null==e?void 0:e.target)&&(e.persist(),y(e))},[y]),S=(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-[280px] 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:C,onMouseUp:S,onMouseLeave:S,onMouseMove:k,onTouchStart:C,onTouchEnd:S,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:()=>x("left")}),(0,n.jsx)(c,{direction:"right",show:v,onClick:()=>x("right")})]})]})})},35887:(e,t,r)=>{"use strict";r.d(t,{ReviewCard:()=>m});var n=r(83670),o=r(31801),l=r(3204),a=r(98730),i=r(28342);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.trim(),l=(null==o?void 0:o.startsWith("/"))?o:o?"/".concat(o):void 0;return(0,n.jsxs)("div",{className:"flex mx-auto items-center",children:[l&&(0,n.jsx)(a.Q,{size:"sm",src:l,alt:"Avatar of ".concat(r.name),className:"border border-slate-400"}),(0,n.jsxs)("div",{className:"".concat(l?"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(61543);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,{Z:()=>c});var n=r(70645),o=r(99930),l=r(76213),a=r(24556),i=r(83670),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},51033:(e,t,r)=>{Promise.resolve().then(r.t.bind(r,14579,23)),Promise.resolve().then(r.t.bind(r,30356,23)),Promise.resolve().then(r.bind(r,8823)),Promise.resolve().then(r.bind(r,13542)),Promise.resolve().then(r.bind(r,33787)),Promise.resolve().then(r.bind(r,24890)),Promise.resolve().then(r.bind(r,30520)),Promise.resolve().then(r.bind(r,24714))},76970:(e,t,r)=>{"use strict";r.d(t,{d:()=>c});var n=r(70645),o=r(99930),l=r(76213),a=r(24556),i=r(83670),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},79015:(e,t,r)=>{"use strict";r.d(t,{B:()=>v});var n=r(83670),o=r(53647),l=r(34353),a=r(45595),i=r(49233),s=r(37079),c=r(71955),u=r(56462),d=r(63350),f=r(28342),h=r(40793);let m="/books/preorder",v=f.memo(e=>{let{book:t,isOpen:r,onOpenChange:v}=e,{sendEvent:b}=(0,h.s)(),p=!!(null==t?void 0:t.title),x=(0,f.useMemo)(()=>{if(!p)return[];let e=[];return(t.amazonLink||m)&&e.push({type:"Paperback",href:t.amazonLink||m}),(t.myStoreLink||m)&&e.push({type:"eBook",href:t.myStoreLink||m}),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]),g=(0,f.useCallback)(e=>{null==v||v(e)},[v]);if(!p){let e=Error("BuyBookModal: Book or book title is missing");return console.error(e),o.Cp(e),null}if(0===x.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:g,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:x.map(e=>{let{type:r,href:l}=e;return(0,n.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;b({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),o.Cp(e)}},children:[r,"Audible"===r&&(0,n.jsx)("span",{className:"text-xs",children:"(only on Amazon.com \uD83C\uDDFA\uD83C\uDDF8)"})]},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"})})]})})})});v.displayName="BuyBookModal"}}]);