try{!function(){var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},r=(new e.Error).stack;r&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[r]="d1f87ade-302b-4448-a64f-a5ef4a29f404",e._sentryDebugIdIdentifier="sentry-dbid-d1f87ade-302b-4448-a64f-a5ef4a29f404")}()}catch(e){}"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[888,9962],{212:(e,r,t)=>{t.d(r,{$n:()=>n.$,aF:()=>a.aF,cw:()=>a.cw,$m:()=>a.$m,rQ:()=>a.rQ}),t(29191);var n=t(17581);t(31278),t(99702),t(26294),t(61230),t(12883);var a=t(24392)},1998:(e,r,t)=>{t.d(r,{j:()=>a});var n=t(26294);function a(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],[r,t]=(0,n.useState)(e),a=(0,n.useCallback)(()=>t(!0),[]),o=(0,n.useCallback)(()=>t(!1),[]);return{isOpen:r,onOpen:a,onClose:o,onToggle:(0,n.useCallback)(()=>t(e=>!e),[]),onOpenChange:(0,n.useCallback)(e=>t(e),[])}}},12883:(e,r,t)=>{t.d(r,{P:()=>i});var n=t(99702);t(26294);var a=t(6466);let o={sm:"w-4 h-4",md:"w-6 h-6",lg:"w-8 h-8"},l={primary:"text-primary",secondary:"text-muted",success:"text-success",warning:"text-warning",danger:"text-error"};function i(e){let{size:r="md",color:t="primary",className:i,"aria-label":s="Loading..."}=e;return(0,n.jsx)("div",{className:(0,a.QP)("inline-block",o[r],i),role:"status","aria-label":s,children:(0,n.jsxs)("svg",{className:(0,a.QP)("animate-spin",o[r],l[t]),xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[(0,n.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,n.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})})}},17581:(e,r,t)=>{t.d(r,{$:()=>s});var n=t(99702);t(26294);var a=t(6466);let o={primary:"bg-primary !text-white hover:bg-primary-hover shadow-md hover:shadow-lg font-semibold focus:ring-2 focus:ring-primary focus:ring-offset-2",secondary:"bg-transparent !text-primary border border-primary hover:bg-primary hover:text-white hover:shadow-md focus:ring-2 focus:ring-primary focus:ring-offset-2",outline:"bg-transparent text-gray-700 border border-gray-300 hover:bg-gray-50 focus:ring-2 focus:ring-gray-300 focus:ring-offset-2",ghost:"bg-transparent text-gray-700 hover:bg-gray-100 focus:ring-2 focus:ring-gray-300 focus:ring-offset-2",danger:"bg-error !text-white hover:bg-error-hover shadow-md hover:shadow-lg font-semibold focus:ring-2 focus:ring-error focus:ring-offset-2"},l={sm:"px-3 py-1.5 text-sm rounded-md min-h-[32px]",md:"px-4 py-2 text-base rounded-md min-h-[40px]",lg:"px-6 py-3 text-lg rounded-lg min-h-[48px]"},i=(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:"w-4 h-4 border-2 border-current border-t-transparent rounded-full animate-spin","aria-hidden":"true"}),(0,n.jsx)("span",{children:"Loading..."})]});function s(e){let{children:r,className:t,variant:s="primary",size:c="md",disabled:d=!1,loading:u=!1,"aria-label":m}=e,h=(0,a.QP)("inline-flex items-center justify-center gap-2 transition-all duration-200","focus:outline-none disabled:opacity-50 disabled:cursor-not-allowed","hover:scale-105 active:scale-95 disabled:hover:scale-100","font-medium leading-none",o[s],l[c],t),f=d||u;if("href"in e){let{children:t,className:a,variant:o,size:l,disabled:s,loading:c,"aria-label":d,href:g,target:b,rel:x,onClick:p,...y}=e,v="_blank"===b?[...new Set(["noopener","noreferrer",...(x||"").split(" ")])].filter(Boolean).join(" "):x;return(0,n.jsx)("a",{href:f?void 0:g,className:h,target:f?void 0:b,rel:f?void 0:v,tabIndex:f?-1:void 0,onClick:f?e=>e.preventDefault():p,"aria-label":m,"aria-disabled":f,...y,children:u?i:r})}let{children:g,className:b,variant:x,size:p,disabled:y,loading:v,"aria-label":w,type:k="button",onClick:j,...N}=e;return(0,n.jsx)("button",{className:h,disabled:f,type:k,onClick:f?void 0:j,"aria-label":m,"aria-disabled":f,...N,children:u?i:r})}},24392:(e,r,t)=>{t.d(r,{$m:()=>i,aF:()=>l,cw:()=>c,jl:()=>d,rQ:()=>s});var n=t(99702),a=t(26294),o=t(6466);function l(e){let{children:r,isOpen:t,onOpenChange:l,className:i}=e,s=(0,a.useCallback)(e=>{"Escape"===e.key&&l(!1)},[l]);return((0,a.useEffect)(()=>{if(t)return document.addEventListener("keydown",s),()=>{document.removeEventListener("keydown",s)}},[t,s]),t)?(0,n.jsxs)("div",{className:(0,o.QP)("fixed inset-0 z-50 flex items-center justify-center bg-black/50",i),onClick:e=>{e.target===e.currentTarget&&l(!1)},onKeyDown:e=>{"Escape"===e.key&&l(!1)},role:"button",tabIndex:0,"aria-label":"Click outside or press Escape to close this modal","aria-describedby":"modal-backdrop-description",children:[(0,n.jsx)("div",{id:"modal-backdrop-description",className:"sr-only",children:"Click outside or press Escape to close this modal"}),r]}):null}function i(e){let{children:r,className:t,onOpenChange:a}=e;return(0,n.jsx)("div",{className:(0,o.QP)("relative bg-white rounded-lg shadow-xl max-w-xl w-full mx-4 max-h-[90vh] overflow-hidden",t),children:"function"==typeof r?r(()=>a(!1)):r})}function s(e){let{children:r,className:t}=e;return(0,n.jsx)("div",{className:(0,o.QP)("px-6 py-4 border-b border-gray-200",t),children:r})}function c(e){let{children:r,className:t}=e;return(0,n.jsx)("div",{className:(0,o.QP)("px-6 py-4",t),children:r})}function d(e){let{children:r,className:t}=e;return(0,n.jsx)("div",{className:(0,o.QP)("px-6 py-4 border-t border-gray-200 flex justify-end gap-2",t),children:r})}},29191:(e,r,t)=>{t.d(r,{Zp:()=>c,aR:()=>d,bw:()=>u,wL:()=>m});var n=t(99702),a=t(26294),o=t(6466);let l={default:"bg-white",bordered:"bg-white border border-gray-300",shadow:"bg-white shadow-md border border-gray-300",elevated:"bg-white shadow-lg border border-gray-300"},i={none:"",sm:"p-2",md:"p-4",lg:"p-6"},s={none:"",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl"},c=a.forwardRef(function(e,r){let{children:t,className:a,as:c="div",href:d,onClick:u,variant:m="default",padding:h="md",rounded:f="lg",style:g}=e,b={className:(0,o.QP)("transition-all duration-200",l[m],i[h],s[f],a),...u&&{onClick:u},...d&&{href:d},...g&&{style:g},ref:r};return(0,n.jsx)(c,{...b,children:t})});function d(e){let{children:r,className:t,padding:a="md"}=e;return(0,n.jsx)("div",{className:(0,o.QP)("flex flex-col gap-1",i[a],t),children:r})}function u(e){let{children:r,className:t,padding:a="md",style:l}=e;return(0,n.jsx)("div",{className:(0,o.QP)("flex flex-col gap-2",i[a],t),style:l,children:r})}function m(e){let{children:r,className:t,padding:a="md"}=e;return(0,n.jsx)("div",{className:(0,o.QP)("flex items-center justify-between",i[a],t),children:r})}},31278:(e,r,t)=>{t.d(r,{m:()=>i});var n=t(99702);t(26294);var a=t(6466);let o={sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-xl","2xl":"max-w-2xl","3xl":"max-w-3xl","4xl":"max-w-4xl",full:"max-w-full",none:""},l={none:"",sm:"px-4",md:"px-6",lg:"px-8",xl:"px-12"};function i(e){let{children:r,className:t,as:i="div",maxWidth:s="lg",padding:c="md",centered:d=!0,fluid:u=!1}=e,m=(0,a.QP)("w-full",!u&&"none"!==s&&o[s],!u&&d&&"mx-auto",l[c],t);return(0,n.jsx)(i,{className:m,children:r})}},32704:(e,r,t)=>{t.d(r,{ReviewCard:()=>d});var n=t(99702),a=t(29191),o=t(2987);let l=(0,t(26294).memo)(function(e){var r;let{author:t}=e;if(!t)return null;let a=null==(r=t.image)?void 0:r.trim(),l=(null==a?void 0:a.startsWith("/"))?a:a?"/".concat(a):void 0;return(0,n.jsxs)("div",{className:"flex items-center flex-shrink-0 h-8 text-center",children:[l&&(0,n.jsx)("div",{className:"w-8 h-8 rounded-full border border-slate-400 overflow-hidden shrink-0",children:(0,n.jsx)(o.default,{src:l,alt:"Avatar of ".concat(t.name),width:32,height:32,sizes:"32px",quality:85,className:"w-full h-full object-cover"})}),(0,n.jsxs)("div",{className:"".concat(l?"ml-2":""," flex flex-col justify-center"),children:[(0,n.jsx)("p",{className:"my-0 text-xs leading-none",children:t.name}),t.description&&(0,n.jsx)("p",{className:"my-0 text-[10px] leading-3 text-muted mt-0.5",children:t.description})]})]})});var i=t(43744),s=t(6466);let c={carousel:{base:"w-52 md:w-72 h-48 cursor-pointer",bordered:"border border-border shadow-sm",borderless:"shadow-none"},books:{base:"w-48 md:w-64 h-40",bordered:"border border-border-strong shadow-md",borderless:"shadow-none"}};function d(e){let{review:r,showRating:t=!1,showBorder:o=!0,variant:d="carousel",className:u,onClick:m}=e,h=c[d],f="".concat(h.base," ").concat(o?h.bordered:h.borderless),g=r.content.length,b=(()=>{let e=Math.max(9,Math.min(16,16-(g-60)/8));return{className:"leading-tight tracking-tight",style:{fontSize:"".concat(e,"px"),lineHeight:"1.1"}}})();return(0,n.jsxs)(a.Zp,{variant:o?"bordered":"default",className:(0,s.QP)(f,"py-4 px-6 flex flex-col gap-3 h-full",u),onClick:m,children:[t&&r.rating&&(0,n.jsxs)("div",{className:"flex items-center justify-center gap-1 flex-shrink-0","aria-label":"Rating: ".concat(r.rating," out of 5 stars"),children:[[void 0,void 0,void 0,void 0,void 0].map((e,t)=>(0,n.jsx)(i.A,{className:"w-5 h-5 ".concat(t{t.d(r,{B:()=>u});var n=t(99702),a=t(83332),o=t(212),l=t(26294),i=t(84506),s=t(22360),c=t(96545);let d="/books/preorder",u=l.memo(e=>{let{book:r,isOpen:t,onOpenChange:u}=e,{sendEvent:m}=(0,s.s)(),h=!!(null==r?void 0:r.title),f=(0,l.useMemo)(()=>{if(!h)return[];let e=[];return(r.amazonLink||d)&&e.push({type:"Paperback",href:r.amazonLink||d}),(r.myStoreLink||d)&&e.push({type:"eBook",href:r.myStoreLink||d}),r.hasAudiobook&&r.myStoreLink&&e.push({type:"Audiobook",href:r.myStoreLink}),r.hasAudible&&r.amazonLink&&e.push({type:"Audible",href:r.amazonLink}),e},[r,h]),g=(0,l.useCallback)(e=>{try{!e&&h&&i.qk.modalClose("BuyBookModal"),null==u||u(e)}catch(e){console.error("Error closing modal:",e),a.Cp(e)}},[u,h]);if(!h){let e=Error("BuyBookModal: Book or book title is missing");return console.error(e),a.Cp(e),null}if(0===f.length){let e=Error("BuyBookModal: No purchase options available for book: ".concat(r.title));return console.warn(e),a.wd(e.message,{level:"warning"}),null}return(0,n.jsx)(o.aF,{isOpen:t,onOpenChange:g,children:(0,n.jsx)(o.$m,{className:"pb-0",onOpenChange:g,children:e=>(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(o.rQ,{className:"flex flex-col gap-1",children:(0,n.jsxs)("div",{className:"flex w-full items-center justify-between",children:[(0,n.jsxs)("h4",{children:["Buy ",r.title]}),(0,n.jsx)(o.$n,{variant:"ghost",size:"sm",onClick:e,className:"p-2 h-8 w-8 min-w-0 rounded-full hover:bg-gray-100","aria-label":"Close purchase options modal",children:"✕"})]})}),(0,n.jsx)(o.cw,{children:f.map(e=>{let{type:t,href:l}=e;return(0,n.jsxs)(o.$n,{href:l,variant:"primary",className:"w-full mb-2",target:l.startsWith("http")?"_blank":void 0,"aria-label":"Buy ".concat(t," version of ").concat(r.title),onClick:()=>{try{if(!l)return;i.qk.buttonClick("".concat(t," Purchase"),r.title),i.jU.externalLink(l,"".concat(t," purchase for ").concat(r.title)),m((0,c.Id)({book_title:r.title,format:t})),l.startsWith("http")&&window.open(l,"_blank","noopener,noreferrer")}catch(e){console.error("Error handling button press:",e),a.Cp(e)}},children:[t,"Audible"===t&&(0,n.jsx)("span",{className:"text-xs",children:"(only on Amazon.com \uD83C\uDDFA\uD83C\uDDF8)"})]},t)})})]})})})});u.displayName="BuyBookModal"},61230:(e,r,t)=>{t.d(r,{E:()=>s});var n=t(99702);t(26294);var a=t(6466);let o={default:"bg-gray-100 text-gray-800 border border-gray-200",primary:"bg-primary text-white border border-primary",secondary:"bg-gray-200 text-gray-700 border border-gray-400",success:"bg-success-light text-green-800 border border-success-border",warning:"bg-warning-light text-yellow-800 border border-warning-border",danger:"bg-error-light text-error-heading border border-error-border",info:"bg-info-light text-blue-800 border border-info-border",bordered:"bg-white text-gray-700 border-2 border-gray-400"},l={sm:"px-2 py-1 text-xs",md:"px-3 py-1.5 text-sm",lg:"px-4 py-2 text-base"},i={none:"",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-full"};function s(e){let{children:r,className:t,variant:s="default",size:c="md",rounded:d="md"}=e,u=(0,a.QP)("inline-flex items-center font-medium",o[s],l[c],i[d],t);return(0,n.jsx)("span",{className:u,children:r})}},76739:(e,r,t)=>{t.r(r),t.d(r,{ReviewsCarousel:()=>i});var n=t(99702),a=t(26294),o=t(32704);let l=(0,a.memo)(function(e){var r;let{review:t,showRating:l,showBorder:i,index:s,onCardClick:c}=e,d=(0,a.useCallback)(()=>c(s),[c,s]),u=(0,a.useCallback)(e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),c(s))},[c,s]);return(0,n.jsx)("div",{className:"w-52 md:w-72 h-48 shrink-0 flex snap-center","data-index":s,onClick:d,onKeyDown:u,role:"button",tabIndex:0,"aria-label":"Center review ".concat(s+1," of ").concat((null==(r=t.author)?void 0:r.name)||"anonymous"),children:(0,n.jsx)(o.ReviewCard,{review:t,showRating:l,showBorder:i,className:"h-full"})})}),i=(0,a.memo)(function(e){let{reviews:r,showRatings:t,title:o="Some reviews",width:i,height:s,showBorder:c=!0}=e,d=(0,a.useRef)(null),{isDragging:u,handleDragStart:m,handleDragEnd:h,handleDragMove:f}=(e=>{let[r,t]=(0,a.useState)(!1),n=(0,a.useRef)({x:0,scrollLeft:0}),o=(0,a.useCallback)(r=>{var a,o;e.current&&(t(!0),n.current={x:"touches"in r&&r.touches&&r.touches.length>0&&null!=(o=null==(a=r.touches[0])?void 0:a.clientX)?o:r.clientX,scrollLeft:e.current.scrollLeft})},[e]),l=(0,a.useCallback)(()=>{t(!1)},[]),i=(0,a.useCallback)(t=>{var a,o;if(!r||!e.current)return;t.preventDefault();let l="touches"in t&&t.touches&&t.touches.length>0&&null!=(o=null==(a=t.touches[0])?void 0:a.clientX)?o:t.clientX,i=n.current.x-l;e.current.scrollLeft=n.current.scrollLeft+i},[r,e]);return{isDragging:r,handleDragStart:o,handleDragEnd:l,handleDragMove:i}})(d),g=(0,a.useCallback)(e=>{if(d.current){let r=d.current.children[e];r&&r.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"})}},[d]),b=(0,a.useCallback)(e=>{if(!d.current)return;let r=d.current;r.scrollLeft;let t=r.clientWidth,n=r.querySelector(".carousel-item");if(!n)return;let a=n.getBoundingClientRect().width,o=(t-a*Math.floor(t/a))/(Math.floor(t/a)-1||1),l=a+o;"ArrowRight"===e.key?r.scrollBy({left:l,behavior:"smooth"}):"ArrowLeft"===e.key&&r.scrollBy({left:-l,behavior:"smooth"})},[]),x=(0,a.useCallback)(e=>r=>{(null==r?void 0:r.currentTarget)&&(null==r?void 0:r.target)&&(r.persist(),e(r))},[]),p=r.length<2,y=r.length<3&&"lg"===i;return(0,n.jsxs)("div",{className:"".concat("sm"===s?"mt-0 mb-0 p-0":"")+" p-4",children:[(0,n.jsx)("h3",{className:"text-xl font-semibold mb-4",children:o}),(0,n.jsx)("div",{className:"w-full relative",children:(0,n.jsx)("div",{className:"relative",onKeyDown:b,role:"region",tabIndex:0,"aria-label":"Reviews carousel - use arrow keys to navigate, or drag to scroll",children:(0,n.jsx)("div",{className:"mx-auto mb-4 relative overflow-x-scroll select-none\n max-w-[280px] sm:max-w-[380px] md:max-w-[420px] ".concat("lg"===i?"lg:max-w-[600px]":"","\n cursor-grab active:cursor-grabbing ").concat(p?"flex justify-center":"","\n scrollbar-hide h-48\n scroll-smooth snap-x snap-mandatory"),ref:d,onMouseDown:x(m),onMouseUp:x(h),onMouseLeave:x(h),onMouseMove:x(f),onTouchStart:x(m),onTouchEnd:x(h),onTouchMove:x(f),role:"region","aria-label":"Reviews carousel - drag to scroll or click on a review to center it","aria-live":"polite",children:(0,n.jsx)("div",{className:"flex space-x-4 md:space-x-6 h-full ".concat(y?"md:justify-center":""),children:r.map((e,r)=>(0,n.jsx)(l,{review:e,showRating:t,showBorder:c,index:r,onCardClick:g},"review-".concat(r)))})})})})]})})},84506:(e,r,t)=>{t.d(r,{Nh:()=>s,jU:()=>o,qk:()=>l,r2:()=>i});var n=t(11377);function a(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"user",t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"info",a=arguments.length>3?arguments[3]:void 0;n.Z({message:e,category:r,level:t,data:a?{...a,timestamp:Date.now()}:{timestamp:Date.now()}})}let o={pageView:(e,r)=>{a("Page viewed: ".concat(e),"navigation","info",{path:e,title:r,type:"page_view"})},routeChange:(e,r)=>{a("Route changed from ".concat(e," to ").concat(r),"navigation","info",{from:e,to:r,type:"route_change"})},externalLink:(e,r)=>{a("External link clicked: ".concat(e),"navigation","info",{url:e,context:r,type:"external_link"})}},l={buttonClick:(e,r)=>{a("Button clicked: ".concat(e),"ui","info",{buttonName:e,context:r,type:"button_click"})},formSubmit:(e,r,t)=>{a("Form ".concat(r?"successfully submitted":"submission failed",": ").concat(e),"user",r?"info":"warning",{formName:e,success:r,type:"form_submit",...t})},modalOpen:e=>{a("Modal opened: ".concat(e),"ui","info",{modalName:e,type:"modal_open"})},modalClose:e=>{a("Modal closed: ".concat(e),"ui","info",{modalName:e,type:"modal_close"})},searchQuery:(e,r)=>{a('Search performed: "'.concat(e,'"'),"user","info",{query:e,resultsCount:r,type:"search"})},fileDownload:(e,r)=>{a("File downloaded: ".concat(e),"user","info",{fileName:e,fileType:r,type:"file_download"})},emailSignup:(e,r,t)=>{a("Email signup ".concat(r?"successful":"failed",": ").concat(e),"user",r?"info":"warning",{formType:e,success:r,hasEmail:!!t,type:"email_signup"})}},i={bookView:(e,r)=>{a("Book viewed: ".concat(e),"user","info",{bookTitle:e,bookId:r,type:"book_view"})},buyButtonClick:(e,r)=>{a("Buy button clicked: ".concat(e),"user","info",{bookTitle:e,platform:r,type:"buy_button_click"})},courseEnrollment:(e,r)=>{a("Course enrollment ".concat(r?"successful":"failed",": ").concat(e),"user",r?"info":"warning",{courseName:e,success:r,type:"course_enrollment"})}},s={gameStart:e=>{a("Game started: ".concat(e),"user","info",{gameName:e,type:"game_start"})},gameEnd:(e,r,t)=>{a("Game ended: ".concat(e),"user","info",{gameName:e,score:r,duration:t,type:"game_end"})},gameAction:(e,r,t)=>{a("Game action: ".concat(r," in ").concat(e),"user","info",{gameName:e,action:r,...t,type:"game_action"})}}},92524:(e,r,t)=>{t.d(r,{BuyBookButton:()=>d});var n=t(99702),a=t(83332),o=t(26294),l=t(84506),i=t(17581),s=t(36331),c=t(1998);let d=(0,o.memo)(e=>{let{book:r,className:t}=e,{isOpen:o,onOpen:d,onOpenChange:u}=(0,c.j)();return r?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(i.$,{variant:"primary",onClick:()=>{try{l.r2.buyButtonClick(r.title),l.qk.modalOpen("BuyBookModal"),null==d||d()}catch(e){console.error("Error opening modal:",e),a.Cp(e)}},"aria-label":"Buy ".concat(r.title),className:t,children:"Buy Now"}),(0,n.jsx)(s.B,{book:r,isOpen:o,onOpenChange:u})]}):(a.wd("BuyBookButton: No book provided",{level:"warning"}),null)});d.displayName="BuyBookButton"}}]);