1import{c as R,j as e,r as x,ek as M,d as Z,e as T,X as B}from"./index-CiD0oJwB.js";import{g as E}from"./storybook-covers-D8p2TSeK.js";import{M as O}from"./maximize-2-DlF116In.js";const A=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],L=R("rotate-ccw",A),k={serif:"'Instrument Serif', Georgia, 'Times New Roman', serif",script:"'Great Vibes', 'Brush Script MT', cursive",block:"'Archivo Black', Impact, system-ui, sans-serif"},D="https://fonts.googleapis.com/css2?family=Great+Vibes&family=Archivo+Black&family=Instrument+Serif:wght@400&display=swap";function V(){return e.jsx("link",{rel:"stylesheet",href:D})}function I(t,n){const s=x.useRef(null);return{onTouchStart:c=>{const o=c.touches[0];s.current={x:o.clientX,y:o.clientY}},onTouchEnd:c=>{const o=s.current;if(s.current=null,!o)return;const a=c.changedTouches[0],r=a.clientX-o.x,p=a.clientY-o.y;Math.abs(r)<45||Math.abs(p)>Math.abs(r)||(r<0?t():n())}}}function P({chapter:t,index:n,onClose:s,initialFlipped:c=!1}){const[o,a]=x.useState(c);return x.useEffect(()=>{const r=i=>{i.key==="Escape"&&s(),i.key===" "&&(i.preventDefault(),a(b=>!b))};window.addEventListener("keydown",r);const p=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{window.removeEventListener("keydown",r),document.body.style.overflow=p}},[s]),e.jsxs("div",{className:"fixed inset-0 z-[120] flex items-center justify-center bg-black/90 p-4 backdrop-blur-sm animate-fade-in",onClick:s,children:[e.jsx("button",{type:"button",onClick:s,"aria-label":"Close",className:"absolute right-4 top-4 z-10 rounded-full bg-white/10 p-2 text-white transition-colors hover:bg-white/20",children:e.jsx(B,{className:"h-5 w-5"})}),e.jsxs("div",{className:"w-full max-w-[820px]",style:{perspective:"1600px"},onClick:r=>r.stopPropagation(),children:[e.jsxs("div",{className:"relative transition-transform duration-700 ease-out",style:{transformStyle:"preserve-3d",transform:o?"rotateY(180deg)":"rotateY(0deg)"},children:[e.jsxs("div",{style:{backfaceVisibility:"hidden"},children:[t.image?e.jsx("img",{src:t.image,alt:t.imageAlt??t.title??`Chapter ${n+1}`,className:"mx-auto max-h-[72vh] w-auto max-w-full rounded-sm bg-white p-2 shadow-2xl"}):null,e.jsx("p",{className:"mt-3 text-center text-[12px] uppercase tracking-[0.2em] text-white/60",children:t.date??""})]}),e.jsxs("div",{className:"pg-paper absolute inset-0 flex flex-col rounded-sm bg-[#F7F2E7] p-6 text-neutral-900 shadow-2xl",style:{backfaceVisibility:"hidden",transform:"rotateY(180deg)"},children:[e.jsxs("p",{className:"text-[11px] font-semibold uppercase tracking-[0.24em] text-neutral-500",children:["Chapter ",n+1,t.date?` · ${t.date}`:""]}),t.title?e.jsx("h3",{className:"mt-1 text-[22px] leading-tight",style:{fontFamily:k.serif},children:t.title}):null,e.jsx("div",{className:"mt-3 max-h-[52vh] overflow-y-auto whitespace-pre-line text-[15px] leading-[1.7] text-neutral-700",children:t.caption})]})]}),e.jsx("div",{className:"mt-4 flex justify-center",children:e.jsxs("button",{type:"button",onClick:()=>a(r=>!r),className:"inline-flex items-center gap-2 rounded-full border border-white/25 px-4 py-2 text-[13px] font-medium text-white transition-colors hover:bg-white/10",children:[e.jsx(L,{className:"h-4 w-4"}),o?"Back to the photo":"Read the story"]})})]})]})}function X({index:t,count:n,onPrev:s,onNext:c,onJump:o,light:a,accent:r}){const p=a?"border-neutral-300 text-neutral-800":"border-white/25 text-white",i=a?"bg-neutral-300":"bg-white/25";return e.jsxs("div",{className:"mt-8 flex items-center justify-center gap-4",children:[e.jsx("button",{type:"button",onClick:s,"aria-label":"Previous",className:`rounded-full border p-2 transition-opacity hover:opacity-70 ${p}`,children:e.jsx(Z,{className:"h-4 w-4"})}),e.jsx("div",{className:"flex max-w-[55vw] items-center gap-1.5 overflow-x-auto",children:Array.from({length:n}).map((b,d)=>e.jsx("button",{type:"button","aria-label":`Chapter ${d+1}`,onClick:()=>o(d),className:`h-1.5 shrink-0 rounded-full transition-all duration-300 ${d===t?"w-7":`w-1.5 ${i}`}`,style:d===t?{backgroundColor:r}:void 0},d))}),e.jsx("button",{type:"button",onClick:c,"aria-label":"Next",className:`rounded-full border p-2 transition-opacity hover:opacity-70 ${p}`,children:e.jsx(T,{className:"h-4 w-4"})})]})}function U({data:t,accent:n,darkBg:s,variant:c}){const o=(t?.chapters??[]).filter(f=>f.image||(f.title??"").trim()||(f.caption??"").trim()),[a,r]=x.use
1State(-1),[p,i]=x.useState(0),[b,d]=x.useState(null),[g,y]=x.useState(!1),[m,w]=x.useState("forward"),u=c==="light",l=o.length,h=x.useCallback(f=>{const v=Math.max(-1,Math.min(l,f));w(v>=a?"forward":"backward"),i(v>=0&&v<l?1:0),r(v)},[l,a]),z=I(()=>h(a+1),()=>h(a-1));if(!M(t))return null;const N=t?.mode??"book",_=k[t?.titleFont??"serif"],$=t?.titleColor??"#D4AF37",C=t?.titleSize??38,j=E(t?.cover),S=u?"#FBF7EE":j.paper,F=u?"text-neutral-500":"text-white/55",Y=a>=0&&a<l?o[a]:null;return e.jsxs("section",{className:"overflow-hidden px-4 py-16 md:py-24",style:{backgroundColor:s},...z,children:[e.jsx("style",{children:` 2 @keyframes story-cover-open { 3 0% { transform: rotateY(0deg); opacity: 1; } 4 82% { opacity: 1; } 5 100% { transform: rotateY(-168deg); opacity: 0; } 6 } 7 @keyframes story-page-forward { 8 0% { transform: rotateY(0deg) rotateZ(0deg) scaleY(1); } 9 25% { transform: rotateY(-48deg) rotateZ(-1.2deg) scaleY(1.012); } 10 55% { transform: rotateY(-104deg) rotateZ(-1.6deg) scaleY(1.016); } 11 80% { transform: rotateY(-150deg) rotateZ(-0.7deg) scaleY(1.006); } 12 100% { transform: rotateY(-180deg) rotateZ(0deg) scaleY(1); } 13 } 14 /* Turning back: the leaf already lies on the page and lifts away to the 15 right, so the earlier chapter is never visible before the turn. */ 16 @keyframes story-page-backward { 17 0% { transform: rotateY(0deg) rotateZ(0deg) scaleY(1); } 18 25% { transform: rotateY(48deg) rotateZ(1.2deg) scaleY(1.012); } 19 55% { transform: rotateY(104deg) rotateZ(1.6deg) scaleY(1.016); } 20 80% { transform: rotateY(150deg) rotateZ(0.7deg) scaleY(1.006); } 21 100% { transform: rotateY(180deg) rotateZ(0deg) scaleY(1); } 22 } 23 @keyframes story-leaf-sheen { 24 0% { transform: translateX(0); opacity: 0; } 25 30% { opacity: .55; } 26 100% { transform: translateX(340%); opacity: 0; } 27 } 28 @keyframes story-cast-forward { 29 0% { opacity: .85; transform: scaleX(1); } 30 70% { opacity: .28; transform: scaleX(.45); } 31 100% { opacity: 0; transform: scaleX(.2); } 32 } 33 @keyframes story-cast-backward { 34 0% { opacity: 0; transform: scaleX(.2); } 35 40% { opacity: .5; transform: scaleX(.6); } 36 100% { opacity: 0; transform: scaleX(1); } 37 } 38 @keyframes story-candle { 39 0%, 100% { opacity: .85; transform: translate(-50%, -50%) scale(1); } 40 38% { opacity: 1; transform: translate(-50%, -50%) scale(1.04); } 41 62% { opacity: .74; transform: translate(-50%, -50%) scale(.985); } 42 } 43 @keyframes story-gleam { 44 0%, 62% { transform: translateX(0) rotate(12deg); opacity: 0; } 45 72% { opacity: .5; } 46 100% { transform: translateX(520%) rotate(12deg); opacity: 0; } 47 } 48 49 @keyframes story-flip-over { 50 0%, 8% { transform: rotateY(0deg) translateZ(0); } 51 28% { transform: rotateY(-42deg) translateZ(18px) rotateZ(-.35deg); } 52 52% { transform: rotateY(-112deg) translateZ(30px) rotateZ(-.7deg); } 53 72%, 100% { transform: rotateY(-180deg) translateZ(0) rotateZ(0deg); } 54 } 55 @keyframes story-back-stage { 56 0%, 58% { transform: translateX(0); } 57 100% { transform: translateX(100%); } 58 } 59 @keyframes story-back-shadow { 60 0%, 8% { opacity: .16; transform: translateX(0) scaleX(.2); } 61 46% { opacity: .7; transform: translateX(-48%) scaleX(1); } 62 76%, 100% { opacity: .28; transform: translateX(-96%) scaleX(.45); } 63 } 64 @keyframes story-settle { 65 0% { transform: scale(.9) rotateX(7deg); } 66 55% { transform: scale(1.018) rotateX(1deg); } 67 100% { transform: scale(1) rotateX(0deg); } 68 } 69 @keyframes timeline-forward { 70 0% { opacity: 0; transform: translateX(42%); filter: blur(7px); } 71 62% { opacity: 1; transform: translateX(-2%); filter: blur(0); } 72 100% { opacity: 1; transform: translateX(0); } 73 } 74 @keyframes timeline-backward { 75 0% { opacity: 0; transform: translateX(-42%); filter: blur(7px); } 76 62% { opacity: 1; transform: translateX(2%); filter: blur(0); } 77 100% { opacity: 1; transform: translateX(0); } 78 } 79 @keyframes timeline-streak { 80 0% { transform: translateX(-120%); opacity: 0; } 81 35% { opacity: .75; } 82 100% { transform: translateX(120%); opacity: 0; } 83 } 84 .storybook-open { animation: story-settle 900ms cubic-bezier(.16,.8,.22,1) both; } 85 .storybook-cover-open { animation: story-cover-open 1050ms cubic-bezier(.55,.02,.24,1) both; }
86 .storybook-turn-forward { animation: story-page-forward 980ms cubic-bezier(.38,.03,.2,1) both; } 87 .storybook-turn-backward { animation: story-page-backward 980ms cubic-bezier(.38,.03,.2,1) both; } 88 .storybook-leaf-sheen { 89 background: linear-gradient(100deg, transparent, rgba(255,255,255,.85), transparent); 90 animation: story-leaf-sheen 980ms ease-out both; 91 } 92 .storybook-cast-forward { transform-origin: left center; animation: story-cast-forward 980ms ease-out both; } 93 .storybook-cast-backward { transform-origin: left center; animation: story-cast-backward 980ms ease-in both; } 94 .storybook-candle { animation: story-candle 5200ms ease-in-out infinite; } 95 .storybook-gleam { 96 background: linear-gradient(100deg, transparent, rgba(255,236,190,.16), transparent); 97 animation: story-gleam 7000ms ease-in-out infinite; 98 } 99 .storybook-timeline-forward { animation: timeline-forward 680ms cubic-bezier(.16,.8,.22,1) both; } 100 .storybook-timeline-backward { animation: timeline-backward 680ms cubic-bezier(.16,.8,.22,1) both; } 101 .storybook-back-stage { animation: story-back-stage 1900ms cubic-bezier(.32,.02,.18,1) both; } 102 .storybook-flip-over { transform-origin: left center; animation: story-flip-over 1900ms cubic-bezier(.38,.02,.18,1) both; } 103 .storybook-back-shadow { transform-origin: left center; animation: story-back-shadow 1900ms ease-in-out both; } 104 @media (prefers-reduced-motion: reduce) { 105 .storybook-open, .storybook-cover-open, .storybook-turn-forward, .storybook-turn-backward, 106 .storybook-leaf-sheen, .storybook-cast-forward, .storybook-cast-backward, 107 .storybook-candle, .storybook-gleam, .storybook-flip-over, .storybook-back-stage, .storybook-back-shadow, 108 .storybook-timeline-forward, .storybook-timeline-backward { animation: none !important; } 109 } 110 111 `}),e.jsx(V,{}),e.jsxs("div",{className:N==="timeline"?"mx-auto w-full max-w-[1100px]":"mx-auto w-full max-w-[min(1100px,calc((100svh-250px)*1.5))]",children:[e.jsxs("div",{className:"mb-6 text-center md:mb-10",children:[e.jsx("div",{className:"text-[11px] font-bold uppercase tracking-[0.18em]",style:{color:n},children:"Storybook"}),(t?.heading??"").trim()?e.jsx("h2",{className:`mt-3 break-words font-black uppercase tracking-tight ${u?"text-neutral-900":"text-white"}`,style:{fontSize:"clamp(30px, 8.5vw, 44px)"},children:t.heading}):null]}),N==="timeline"?e.jsx(q,{data:t,chapters:o,pos:Math.max(0,a),go:h,accent:n,light:u,paper:S,onOpen:f=>{y(!1),d(f)},titleFont:_,titleColor:$,titleSize:C,direction:m}):e.jsxs("div",{className:"[perspective:2000px]",children:[e.jsx("div",{className:"transition-transform duration-700 ease-out",style:{transform:p?"scale(1)":"scale(0.92)"},children:Y?e.jsx(K,{chapter:Y,index:a,paper:S,accent:n,cover:j,onOpen:f=>{y(f),d(a)},direction:m},a):a>=l?e.jsx(G,{heading:t?.endHeading||"The end",note:t?.endNote,titleFont:_,titleColor:$,titleSize:C,cover:j,chapter:o[l-1],chapterNumber:l,paper:S,onRestart:()=>h(0)},"back"):e.jsx(W,{title:t?.title||"My story",subtitle:t?.subtitle,titleFont:_,titleColor:$,titleSize:C,closing:!1,cover:j,onOpen:()=>h(0)})}),Y?e.jsx("p",{className:`mt-6 text-center text-[12px] ${F}`,children:`Chapter ${a+1} of ${l}`}):null]}),N==="book"?e.jsx(X,{index:Math.max(0,Math.min(l-1,a)),count:l,onPrev:()=>h(a-1),onNext:()=>h(a+1),onJump:f=>h(f),light:u,accent:n}):null]}),b!==null&&o[b]?e.jsx(P,{chapter:o[b],index:b,initialFlipped:g,onClose:()=>d(null)},`${b}-${g}`):null]})}function W({title:t,subtitle:n,titleFont:s,titleColor:c,titleSize:o,closing:a,cover:r,onOpen:p}){const i=c==="#D4AF37"?r.ink:c,b=r.Ornament;return e.jsxs("div",{className:"relative flex flex-col items-center",children:[e.jsx("span",{"aria-hidden":"true",className:"storybook-candle pointer-events-none absolute left-1/2 top-1/2 h-[520px] w-[520px] -translate-x-1/2 -translate-y-1/2 rounded-full blur-3xl",style:{background:`radial-gradient(circle, ${i}30 0%, ${i}10 38%, transparent 70%)`}}),e.jsxs("button",{type:"button",onClick:p,className:"group relative block w-full max-w-[420px] transition-transform duration-700 ease-out hover:-translate-y-1.5",style:{transform:"rotateX(7deg) rotateZ(-0.6deg)"},children:[e.jsx("span",{className:"absolute inset-y-2 -right-2 w-2.5 rounded-r-[3px] shadow-[inset_0_0_6px_rgba(0,0,0,.35)]",style:{background:r.edge}}),e.jsx("span",{className:"absolute inset-x-6 -bottom-2 h-2 rounded-b-[3px]",style:{background:r.edge,filter:"brightness(.92)"}}),e.jsxs("div",{className:"relative overflow-hidden rounded-l-[3px] border border-black/50 text-center shadow-[0_40px_80px_-20px_rgba(0,0,0,0.95),inset_0_0_60px_rgba(0,0,0,0.4)]",style:{aspectRatio:"3 / 4",borderRadius:`${r.radius}`,borderTopLeftRadius:"3px",borderBottomLeftRadius:"3px",background:r.board},children:[e.jsx("span",{className:"absolute inset-y-0 left-0 w-9",style:{background:r.spine}}),r.bands?[17,37,57,77].map(d=>
111e.jsx("span",{className:"absolute left-0 h-[7px] w-9",style:{top:`${d}%`,background:"linear-gradient(180deg, rgba(255,235,190,.2), rgba(0,0,0,.55))"}},d)):null,e.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 300 400",preserveAspectRatio:"none",className:"pointer-events-none absolute inset-0 h-full w-full",children:e.jsx(b,{ink:i})}),e.jsxs("span",{className:"absolute inset-0 flex flex-col items-center justify-center gap-3 px-10",children:[e.jsx("span",{className:"block leading-[1.08]",style:{fontFamily:s,fontSize:`min(${o}px, 11vw)`,backgroundImage:`linear-gradient(180deg, color-mix(in srgb, ${i} 35%, #fff) 0%, ${i} 44%, color-mix(in srgb, ${i} 55%, #000) 100%)`,WebkitBackgroundClip:"text",backgroundClip:"text",color:"transparent",filter:`drop-shadow(0 1px 0 rgba(0,0,0,.55)) drop-shadow(0 0 10px ${i}45)`},children:t}),n?e.jsx("span",{className:"block text-[11px] uppercase tracking-[0.32em]",style:{color:`${i}cc`},children:n}):null]}),r.clasp?e.jsx("span",{className:"absolute right-[-6px] top-1/2 h-12 w-4 -translate-y-1/2 rounded-sm",style:{background:"linear-gradient(90deg,#7d5f1b,#f2e2ab 42%,#8a6a1f)",boxShadow:"0 2px 6px rgba(0,0,0,.6)"}}):null,e.jsx("span",{"aria-hidden":"true",className:"storybook-gleam pointer-events-none absolute inset-y-[-30%] -left-1/3 w-1/3 rotate-12"}),e.jsx("span",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0",style:{boxShadow:"inset 0 0 90px rgba(0,0,0,.55)"}})]})]}),e.jsx("span",{className:"mt-[-6px] h-10 w-[86%] max-w-[540px] rounded-[50%] blur-lg",style:{background:"rgba(0,0,0,0.62)"}}),e.jsx("button",{type:"button",onClick:p,className:"mt-4 rounded-full px-6 py-2 text-[13px] font-semibold tracking-[0.08em] shadow-[0_8px_24px_-8px_rgba(0,0,0,.8)]",style:{background:`linear-gradient(180deg, color-mix(in srgb, ${i} 40%, #fff), ${i})`,color:"#141210"},children:a?"Read it again":"Open the book"})]})}function G({heading:t,note:n,titleFont:s,titleColor:c,titleSize:o,cover:a,chapter:r,chapterNumber:p,paper:i,onRestart:b}){const d=c==="#D4AF37"?a.ink:c,[g,y]=x.useState(!1);return x.useEffect(()=>{const m=setTimeout(()=>y(!0),1900);return()=>clearTimeout(m)},[]),e.jsxs("div",{className:"relative flex flex-col items-center",children:[e.jsx("span",{"aria-hidden":"true",className:"storybook-candle pointer-events-none absolute left-1/2 top-1/2 h-[520px] w-[520px] -translate-x-1/2 -translate-y-1/2 rounded-full blur-3xl",style:{background:`radial-gradient(circle, ${d}28 0%, ${d}0d 38%, transparent 70%)`}}),e.jsxs("div",{className:`${g?"":"storybook-back-stage"} relative w-full max-w-[420px] [perspective:2400px]`,children:[e.jsxs("div",{"aria-hidden":"true",className:"absolute inset-y-0 right-full w-full rounded-l-[10px] border-y border-l border-black/15 shadow-[0_42px_85px_-30px_rgba(0,0,0,.85)]",style:{background:`linear-gradient(90deg, #e6dbc2 0%, ${i} 5%, ${i} 88%, #ded2b6 100%)`},children:[e.jsx("span",{className:"absolute inset-y-0 right-0 w-16 bg-gradient-to-l from-black/25 to-transparent"}),e.jsx("span",{className:"absolute inset-y-1.5 -left-1.5 w-2 rounded-l-[3px] bg-[#E8DFC9] shadow-[inset_2px_0_4px_rgba(0,0,0,.25)]"})]}),e.jsx("span",{"aria-hidden":"true",className:"storybook-back-shadow pointer-events-none absolute inset-0 z-0 bg-gradient-to-l from-black/60 via-black/25 to-transparent blur-sm"}),e.jsxs("div",{className:g?"relative z-10":"storybook-flip-over relative z-10",style:g?void 0:{transformStyle:"preserve-3d"},children:[e.jsxs("div",{className:`pg-paper absolute inset-0 overflow-hidden rounded-r-[10px] border-y border-r border-black/15 px-6 py-8 shadow-[0_42px_85px_-28px_rgba(0,0,0,.9),inset_0_0_28px_rgba(95,65,30,.12)] ${g?"hidden":""}`,style:{backfaceVisibility:"hidden",backgroundColor:i},children:[e.jsx("span",{className:"absolute inset-y-0 left-0 w-16 bg-gradient-to-r from-black/25 to-transparent"}),e.jsxs("div",{className:"relative z-10 opacity-80",children:[e.jsxs("p",{className:"text-[11px] font-semibold uppercase tracking-[0.24em] text-neutral-500",children:["Chapter ",p]}),r?.title?e.jsx("h3",{className:"mt-1 text-[26px] leading-tight text-neutral-900",style:{fontFamily:k.serif},children:r.title}):null,r?.image?e.jsx("span",{className:"mx-auto mt-6 block max-w-[300px] bg-white p-2 pb-7 shadow-xl",children:e.jsx("img",{src:r.image,alt:"",className:"block aspect-[4/3] w-full object-cover"})}):null]})]}),e.jsxs("div",{className:"relative overflow-hidden border border-black/50 shadow-[0_40px_80px_-20px_rgba(0,0,0,0.95),inset_0_0_60px_rgba(0,0,0,0.4)]",style:{aspectRatio:"3 / 4",borderRadius:`${a.radius}`,borderTopLeftRadius:"3px",borderBottomLeftRadius:"3px",background:a.board,backfaceVisibility:"hidden",transform:g?void 0:"rotateY(180deg)"},children:[e.jsx("span",{className:"absolute inset-y-2 -right-2 w-2.5 rounded-r-[3px] shadow-[inset_0_0_6px_rgba(0,0,0,.35)]",style:{background:a.edge}}
111),e.jsx("span",{className:"absolute inset-y-0 right-0 w-9",style:{background:a.spine}}),a.bands?[17,37,57,77].map(m=>e.jsx("span",{className:"absolute right-0 h-[7px] w-9",style:{top:`${m}%`,background:"linear-gradient(180deg, rgba(255,235,190,.2), rgba(0,0,0,.55))"}},m)):null,e.jsx("div",{className:"absolute inset-0 flex items-center justify-center px-8 pb-6 pr-12",children:e.jsxs("div",{className:"w-full rounded-[6px] px-6 py-7 text-center",style:{background:"linear-gradient(180deg, rgba(255,255,255,.06), rgba(0,0,0,.18))",border:`1px solid ${d}55`,boxShadow:"inset 0 0 26px rgba(0,0,0,.45), 0 0 0 1px rgba(0,0,0,.35)"},children:[e.jsx("div",{className:"leading-[1.1]",style:{fontFamily:s,fontSize:`min(${Math.round(o*.72)}px, 8.5vw)`,backgroundImage:`linear-gradient(180deg, color-mix(in srgb, ${d} 35%, #fff) 0%, ${d} 46%, color-mix(in srgb, ${d} 55%, #000) 100%)`,WebkitBackgroundClip:"text",backgroundClip:"text",color:"transparent",filter:"drop-shadow(0 1px 0 rgba(0,0,0,.55))"},children:t}),n?e.jsx("p",{className:"mx-auto mt-4 max-h-[42vh] max-w-[30ch] overflow-y-auto whitespace-pre-line text-[13px] leading-relaxed",style:{color:`${d}dd`},children:n}):null]})}),e.jsx("span",{"aria-hidden":"true",className:"storybook-gleam pointer-events-none absolute inset-y-[-30%] -left-1/3 w-1/3 rotate-12"}),e.jsx("span",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0",style:{boxShadow:"inset 0 0 90px rgba(0,0,0,.55)"}})]})]})]}),e.jsx("span",{className:"mt-[-6px] h-10 w-[86%] max-w-[540px] rounded-[50%] blur-lg",style:{background:"rgba(0,0,0,0.62)"}}),e.jsx("button",{type:"button",onClick:b,className:"mt-4 rounded-full px-6 py-2 text-[13px] font-semibold tracking-[0.08em] shadow-[0_8px_24px_-8px_rgba(0,0,0,.8)]",style:{background:`linear-gradient(180deg, color-mix(in srgb, ${d} 40%, #fff), ${d})`,color:"#141210"},children:"Read it again"})]})}function K({chapter:t,index:n,paper:s,accent:c,cover:o,onOpen:a,direction:r}){const p="repeating-linear-gradient(0deg, transparent 0 27px, rgba(90,66,36,.07) 28px)";return e.jsxs("div",{className:"storybook-open relative [perspective:2400px]",children:[e.jsx("div",{className:"relative flex justify-end",children:e.jsxs("div",{className:"relative flex w-[200%] shrink-0",children:[e.jsxs("div",{"aria-hidden":"true",className:"relative w-1/2 roun
111ded-l-[10px] border-y border-l border-black/15 shadow-[0_42px_85px_-30px_rgba(0,0,0,0.85)]",style:{background:`linear-gradient(90deg, #e6dbc2 0%, ${s} 5%, ${s} 88%, #ded2b6 100%)`},children:[e.jsx("span",{className:"absolute inset-0 opacity-70",style:{background:p}}),e.jsx("span",{className:"absolute inset-y-1.5 -left-1.5 w-2 rounded-l-[3px] bg-[#E8DFC9] shadow-[inset_2px_0_4px_rgba(0,0,0,.25)]"}),e.jsx("span",{className:"absolute inset-y-0 right-0 w-16 bg-gradient-to-l from-black/25 to-transparent"})]}),e.jsxs("div",{className:"pg-paper relative h-[620px] w-1/2 overflow-hidden rounded-r-[10px] border-y border-r border-black/15 shadow-[0_42px_85px_-28px_rgba(0,0,0,0.9),inset_0_0_28px_rgba(95,65,30,0.12)] md:h-[720px]",style:{backgroundColor:s},children:[e.jsx("span",{"aria-hidden":"true",className:"pointer-events-none absolute inset-y-0 left-0 z-20 w-16 bg-gradient-to-r from-black/25 to-transparent"}),e.jsx("span",{className:"pointer-events-none absolute inset-0 opacity-60",style:{background:p}}),e.jsx("span",{className:"absolute inset-y-1.5 -right-1.5 w-2 rounded-r-[3px] bg-[#E8DFC9] shadow-[inset_-2px_0_4px_rgba(0,0,0,.25)]"}),n===0&&r==="forward"?e.jsxs("span",{"aria-hidden":"true",className:"storybook-cover-open pointer-events-none absolute inset-0 z-40 origin-left overflow-hidden rounded-r-[9px] border border-black/50 shadow-[18px_12px_35px_rgba(0,0,0,.55)]",style:{background:o.board,transformStyle:"preserve-3d"},children:[e.jsx("span",{className:"absolute inset-y-0 left-0 w-7",style:{background:o.spine}}),e.jsx("svg",{viewBox:"0 0 300 400",preserveAspectRatio:"none",className:"absolute inset-0 h-full w-full opacity-80",children:e.jsx(o.Ornament,{ink:o.ink})})]}):null,e.jsxs("div",{className:"relative z-10 flex h-full flex-col px-6 py-8 md:px-10 md:py-12",children:[e.jsxs("p",{className:"text-[11px] font-semibold uppercase tracking-[0.24em] text-neutral-500",children:["Chapter ",n+1]}),t.title?e.jsx("h3",{className:"mt-1 shrink-0 break-words pb-1 leading-[1.2] text-neutral-900",style:{fontFamily:k.serif,fontSize:t.title.length>80?"18px":t.title.length>48?"20px":t.title.length>28?"22px":"26px"},children:t.title}):null,t.image?e.jsx("button",{type:"button",onClick:()=>a(!1),className:"group mt-6 block w-full","aria-label":"Open this photo",children:e.jsxs("span",{className:"pg-polaroid relative mx-auto block max-w-[420px] p-2.5 pb-8 shadow-[0_12px_28px_-12px_rgba(0,0,0,0.6)] transition-transform duration-500 ease-out group-hover:-rotate-1 group-hover:scale-[1.02]",style:{transform:"rotate(-1.4deg)",backgroundColor:"#ffffff"},children:[e.jsx("span",{className:"absolute -top-2 left-1/2 h-5 w-16 -translate-x-1/2 -rotate-2 bg-[#e8dcc0]/80"}),e.jsx("img",{src:t.image,alt:t.imageAlt??t.title??`Chapter ${n+1}`,loading:"lazy",className:"block aspect-[4/3] w-full object-cover"}),e.jsx("span",{className:"absolute right-4 top-4 flex h-7 w-7 items-center justify-center rounded-full bg-black/45 text-white backdrop-blur-sm transition-colors group-hover:bg-black/70",children:e.jsx(O,{className:"h-3.5 w-3.5"})}),e.jsx("span",{className:"absolute bottom-2 left-0 right-0 text-center text-[11px] uppercase tracking-[0.18em] text-neutral-500",children:t.date??""})]})}):null,t.date?e.jsx("p",{className:"mt-6 text-[11px] font-semibold uppercase tracking-[0.24em] text-neutral-500",style:{color:`color-mix(in srgb, ${c} 55%, #171717)`},children:t.date}):null,t.caption?e.jsx("button",{type:"button",onClick:()=>a(!0),className:"mt-3 block w-full text-left","aria-label":"Read the full story",children:e.jsx("span",{className:"line-clamp-5 block whitespace-pre-line text-[15px] leading-[1.75] text-neutral-700",children:t.caption})}):null]}),e.jsxs("span",{"aria-hidden":"true",className:`pointer-events-none absolute inset-0 z-30 ${r==="forward"?"origin-left storybook-turn-forward":"origin-right storybook-turn-backward"}`,style:{transformStyle:"preserve-3d"},children:[e.jsxs("span",{className:"absolute inset-0 overflow-hidden rounded-r-[9px]",style:{backfaceVisibility:"hidden",background:`linear-gradient(96deg, #d8cbaf 0%, ${s} 7%, #fffaf0 44%, ${s} 79%, #e4d8bd 100%)`,boxShadow:"-18px 0 38px rgba(0,0,0,.30)"},children:[e.jsx("span",{className:"absolute inset-0 opacity-30",style:{background:p}}),e.jsx("span",{className:"storybook-leaf-sheen absolute inset-y-0 -left-1/3 w-1/2"})]}),e.jsx("span",{className:"absolute inset-0 overflow-hidden rounded-l-[9px]",style:{transform:"rotateY(180deg)",backfaceVisibility:"hidden",background:`linear-gradient(264deg, #d8cbaf 0%, ${s} 9%, #fdf8ee 50%, ${s} 82%, #e4d8bd 100%)`},children:e.jsx("span",{className:"absolute inset-0 opacity-25",style:{background:p}})})]}),e.jsx("span",{"aria-hidden":"true",className:`pointer-events-none absolute inset-0 z-20 ${r==="forward"?"storybook-cast-forward":"storybook-cast-backward"}`,style:{background:"linear-gradient(90deg, rgba(30,18,4,.5) 0%, rgba(30,18,4,.16) 42%, transparent 74%)"}})]}),e.jsx("span",{"aria-hidden":"true",className:"pointer-events-none absolute inset-y-0 left-1/2 z-20 w-10 -translate-x-1/2",style:{background:"linear-gradient(90deg, rgba(0,0,0,0) 0%, rgba(58,38,18,.30) 46%, rgba(58,38,18,.32) 54%, rgba(0,0,0,0) 100%)"}})]})}),e.jsx("span",{className:"mx-auto block h-5 w-[94%] rounded-b-[50%] bg-black/25 blur-md"})]})}function q({data:t,chapters:n,pos:s,go:c,accent:o,light:a,paper:r,onOpen:p,titleFont:i,titleColor:b,titleSize:d,direction:g}){const y=x.useRef(null),m=n[s]??n[0];x.useEffect(()=>{const u=y.current,l=u?.querySelector(`[data-node="${s}"]`);!u||!l||u.scrollTo({left:l.offsetLeft-u.clientWidth/2+l.clientWidth/2,behavior:"smooth"})},[s]);const w=a?"text-neutral-500":"text-white/55";return e.jsxs("div",{children:[e.jsxs("div",{className:"mb-10 text-center",children:[e.jsx("h2",{className:"leading-tight",style:{fontFamily:i,color:b,fontSize:`min(${d}px, 11vw)`},children:t.title||"My story"}),t.subtitle?e.jsx("p",{className:`mt-2 text-[13px] uppercase tracking-[0.24em] ${w}`,children:t.subtitle}):null]}),e.jsx("div",{ref:y,className:"relative overflow-x-auto pb-14 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:e.jsxs("div",{className:"relative min-w-full px-6",
111style:{width:`${Math.max(n.length*150,300)}px`},children:[e.jsx("span",{className:"absolute left-0 right-0 top-[13px] h-px",style:{backgroundColor:a?"rgba(0,0,0,0.18)":"rgba(255,255,255,0.25)"}}),e.jsx("div",{className:"relative flex items-start",children:n.map((u,l)=>e.jsxs("button",{type:"button","data-node":l,onClick:()=>c(l),className:"relative flex min-w-[150px] flex-1 flex-col items-center gap-2 text-center",children:[e.jsx("span",{className:"mt-[6px] block rounded-full transition-all duration-300",style:{width:l===s?16:9,height:l===s?16:9,backgroundColor:l===s?o:a?"#9c9c9c":"rgba(255,255,255,0.45)",boxShadow:l===s?`0 0 0 5px ${o}22`:void 0}}),e.jsx("span",{className:`text-[11px] uppercase tracking-[0.16em] ${l===s?a?"text-neutral-900":"text-white":w}`,children:u.date||`No. ${l+1}`}),l===s?e.jsx("span",{"aria-hidden":"true",className:"absolute left-1/2 top-[22px] h-16 w-px -translate-x-1/2",style:{background:`linear-gradient(${o}, ${o}22)`}}):null]},l))})]})}),m?e.jsxs("div",{className:`pg-paper relative mx-auto -mt-3 grid max-w-[900px] overflow-hidden rounded-[10px] shadow-[0_30px_60px_-30px_rgba(0,0,0,0.7)] md:grid-cols-[1.1fr_1fr] ${g==="forward"?"storybook-timeline-forward":"storybook-timeline-backward"}`,style:{backgroundColor:r},children:[e.jsx("span",{"aria-hidden":"true",className:"pointer-events-none absolute inset-y-0 left-0 z-20 w-1/3 bg-gradient-to-r from-transparent via-white/30 to-transparent",style:{animation:"timeline-streak 680ms ease-out both"}}),m.image?e.jsx("button",{type:"button",onClick:()=>p(s),className:"group block","aria-label":"Open this photo",children:e.jsx("img",{src:m.image,alt:m.imageAlt??m.title??`Moment ${s+1}`,loading:"lazy",className:"h-full max-h-[420px] w-full object-cover transition-transform duration-700 ease-out group-hover:scale-[1.03]"})}):null,e.jsxs("div",{className:"p-6 md:p-8",children:[e.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-[0.24em]",style:{color:o},children:m.date||`Moment ${s+1}`}),m.title?e.jsx("h3",{className:"mt-1 text-[24px] leading-tight text-neutral-900",style:{fontFamily:k.serif},children:m.title}):null,e.jsx("div",{className:"mt-3 max-h-[36vh] overflow-y-auto whitespace-pre-line text-[15px] leading-[1.75] text-neutral-700",children:m.caption})]})]},s):null,e.jsx(X,{index:s,count:n.length,onPrev:()=>c(Math.max(0,s-1)),onNext:()=>c(Math.min(n.length-1,s+1)),onJump:c,light:a,accent:o})]})}export{D as STORYBOOK_FONTS,V as StorybookFontLink,U as StorybookSection,M as hasStorybook};
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.