import{j as n}from"./query-vendor-CZu0EHPe.js";import{L as ce,r as se}from"./react-vendor-0bvDbF03.js";import{aY as ue,aZ as de,a_ as me,a$ as ge,b0 as ae,b1 as fe,b2 as pe,b3 as he,b4 as ye,b5 as xe,b6 as be,b7 as we,b8 as ve,b9 as je,ba as Se,bb as Ne,bc as I,bd as Ee,be as ke,bf as Te,bg as Ae,b as Oe,m as K,k as Ve,aS as Fe,aT as z,bh as q}from"./index-D1vbIJ-B.js";import{u as ne}from"./i18n-vendor-Cl4-lKeC.js";import"./supabase-vendor-CNV44oIa.js";import"./helmet-vendor-NlTFkN97.js";const Me=(e,t,s)=>{const a=t-e;return((s-e)%a+a)%a+e};function re(e,t){return ue(e)?e[Me(0,e.length,t)]:e}function H(e){return typeof e=="object"&&!Array.isArray(e)}function oe(e,t,s,a){return typeof e=="string"&&H(t)?de(e,s,a):e instanceof NodeList?Array.from(e):Array.isArray(e)?e:[e]}function De(e,t,s){return e*(t+1)}function J(e,t,s,a){return typeof t=="number"?t:t.startsWith("-")||t.startsWith("+")?Math.max(0,e+parseFloat(t)):t==="<"?s:a.get(t)??e}function Re(e,t,s){for(let a=0;a<e.length;a++){const i=e[a];i.at>t&&i.at<s&&(ge(e,i),a--)}}function _e(e,t,s,a,i,o){Re(e,i,o);for(let r=0;r<t.length;r++)e.push({value:t[r],at:me(i,o,a[r]),easing:re(s,r)})}function Le(e,t){for(let s=0;s<e.length;s++)e[s]=e[s]/(t+1)}function ze(e,t){return e.at===t.at?e.value===null?1:t.value===null?-1:0:e.at-t.at}const Ie="easeInOut";function Ce(e,{defaultTransition:t={},...s}={},a,i){const o=t.duration||.3,r=new Map,p=new Map,N={},E=new Map;let O=0,l=0,V=0;for(let k=0;k<e.length;k++){const m=e[k];if(typeof m=="string"){E.set(m,l);continue}else if(!Array.isArray(m)){E.set(m.name,J(l,m.at,O,E));continue}let[x,h,g={}]=m;g.at!==void 0&&(l=J(l,g.at,O,E));let c=0;const y=(u,b,f,w=0,v=0)=>{const d=Be(u),{delay:C=0,times:j=fe(d),type:B="keyframes",repeat:R,repeatType:ct,repeatDelay:ut=0,...le}=b;let{ease:T=t.ease||"easeOut",duration:S}=b;const G=typeof C=="function"?C(w,v):C,P=d.length,W=xe(B)?B:i?.[B];if(P<=2&&W){let F=100;if(P===2&&Ge(d)){const M=d[1]-d[0];F=Math.abs(M)}const _={...le};S!==void 0&&(_.duration=be(S));const L=pe(_,F,W);T=L.ease,S=L.duration}S??(S=o);const Q=l+G;j.length===1&&j[0]===0&&(j[1]=1);const Z=j.length-d.length;if(Z>0&&he(j,Z),d.length===1&&d.unshift(null),R){S=De(S,R);const F=[...d],_=[...j];T=Array.isArray(T)?[...T]:[T];const L=[...T];for(let M=0;M<R;M++){d.push(...F);for(let D=0;D<F.length;D++)j.push(_[D]+(M+1)),T.push(D===0?"linear":re(L,D-1))}Le(j,R)}const $=Q+S;_e(f,d,T,j,Q,$),c=Math.max(G+S,c),V=Math.max($,V)};if(ae(x)){const u=U(x,p);y(h,g,X("default",u))}else{const u=oe(x,h,a,N),b=u.length;for(let f=0;f<b;f++){h=h,g=g;const w=u[f],v=U(w,p);for(const d in h)y(h[d],Ke(g,d),X(d,v),f,b)}}O=l,l+=c}return p.forEach((k,m)=>{for(const x in k){const h=k[x];h.sort(ze);const g=[],c=[],y=[];for(let b=0;b<h.length;b++){const{at:f,value:w,easing:v}=h[b];g.push(w),c.push(ye(0,V,f)),y.push(v||"easeOut")}c[0]!==0&&(c.unshift(0),g.unshift(g[0]),y.unshift(Ie)),c[c.length-1]!==1&&(c.push(1),g.push(null)),r.has(m)||r.set(m,{keyframes:{},transition:{}});const u=r.get(m);u.keyframes[x]=g,u.transition[x]={...t,duration:V,ease:y,times:c,...s}}}),r}function U(e,t){return!t.has(e)&&t.set(e,{}),t.get(e)}function X(e,t){return t[e]||(t[e]=[]),t[e]}function Be(e){return Array.isArray(e)?e:[e]}function Ke(e,t){return e&&e[t]?{...e,...e[t]}:{...e}}const He=e=>typeof e=="number",Ge=e=>e.every(He);function Pe(e,t){return e in t}class We extends we{constructor(){super(...arguments),this.type="object"}readValueFromInstance(t,s){if(Pe(s,t)){const a=t[s];if(typeof a=="string"||typeof a=="number")return a}}getBaseTargetFromProps(){}removeValueFromRenderState(t,s){delete s.output[t]}measureInstanceViewportBox(){return ve()}build(t,s){Object.assign(t.output,s)}renderInstance(t,{output:s}){Object.assign(t,s)}sortInstanceNodePosition(){return 0}}function Qe(e){const t={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},s=je(e)?new Se(t):new Ne(t);s.mount(e),I.set(e,s)}function Ze(e){const t={presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}},s=new We(t);s.mount(e),I.set(e,s)}function $e(e,t){return ae(e)||typeof e=="number"||typeof e=="string"&&!H(t)}function ie(e,t,s,a){const i=[];if($e(e,t))i.push(Ee(e,H(t)&&t.default||t,s&&(s.default||s)));else{const o=oe(e,t,a),r=o.length;for(let p=0;p<r;p++){const N=o[p],E=N instanceof Element?Qe:Ze;I.has(N)||E(N);const O=I.get(N),l={...s};"delay"in l&&typeof l.delay=="function"&&(l.delay=l.delay(p,r)),i.push(...ke(O,{...t,transition:l},{}))}}return i}function qe(e,t,s){const a=[];return Ce(e,t,s,{spring:Te}).forEach(({keyframes:o,transition:r},p)=>{a.push(...ie(p,o,r))}),a}function Je(e){return Array.isArray(e)&&e.some(Array.isArray)}function Ue(e){function t(s,a,i){let o=[];return Je(s)?o=qe(s,a,e):o=ie(s,a,i,e),new Ae(o)}return t}const A=Ue(),Xe="https://cdn.storysparkle.org/ui_elements/FeatherQuill.webp",Y=({className:e=""})=>{const{t}=ne("landing"),{getLocalizedPath:s}=Oe(),a=()=>{window.scrollTo({top:0,behavior:"instant"})};return n.jsx(ce,{to:s("/story-maker"),className:e,onClick:a,children:n.jsxs(K.div,{className:"relative inline-flex flex-col items-center pl-2",whileHover:{scale:1.05},whileTap:{scale:.98},transition:{type:"spring",stiffness:400,damping:17},children:[n.jsx("img",{src:Xe,alt:"Feather quill",className:"absolute -top-16 left-0 w-20 h-auto pointer-events-none z-10 rotate-[-15deg]"}),n.jsx("div",{className:`bg-gradient-to-r from-violet-500 via-purple-500 to-pink-500
pl-12 pr-10 py-4 rounded-full shadow-lg shadow-violet-500/30
hover:shadow-xl hover:shadow-violet-500/40 transition-shadow`,children:n.jsx("span",{className:"text-white font-bold uppercase tracking-widest text-sm md:text-base",children:t("buttons.startCreating")})})]})})},Ye="https://cdn.storysparkle.org/landing_assets/magical-world-ancient-ruins.webp",et="https://cdn.storysparkle.org/landing_assets/magical-world-deep-blue-sea.webp",tt="https://cdn.storysparkle.org/landing_assets/magical-world-deep-forest.webp",st="https://cdn.storysparkle.org/landing_assets/magical-world-floating-island.webp",at="https://cdn.storysparkle.org/landing_assets/magical-world-frozen-tundra.webp",nt="https://cdn.storysparkle.org/landing_assets/magical-world-high-tech-city.webp",rt="https://cdn.storysparkle.org/landing_assets/magical-world-land-of-deserts.webp",ot="https://cdn.storysparkle.org/landing_assets/magical-world-magical-kingdom.webp",it="https://cdn.storysparkle.org/landing_assets/magical-world-mysterious-planet.webp",lt="https://cdn.storysparkle.org/landing_assets/polaroid-photo-frame.webp",ee=[{img:Ye,x:-280,y:-240,rotate:-32,stagger:0,huddle:38},{img:tt,x:-60,y:-300,rotate:5,stagger:.04,huddle:-42},{img:it,x:160,y:-250,rotate:18,stagger:.02,huddle:35},{img:st,x:-300,y:-30,rotate:-22,stagger:.06,huddle:-38},{img:at,x:-100,y:-70,rotate:-6,stagger:.01,huddle:44},{img:ot,x:120,y:-50,rotate:14,stagger:.08,huddle:-33},{img:nt,x:-260,y:150,rotate:28,stagger:.03,huddle:40},{img:et,x:-20,y:140,rotate:10,stagger:.05,huddle:-45},{img:rt,x:180,y:160,rotate:-22,stagger:.07,huddle:36}],te=({img:e,cfg:t,scrollYProgress:s,isMobile:a})=>{const[i,o]=se.useState(0),r=typeof window<"u"&&a&&window.innerWidth>=768,p=a?r?.62:.24:1,N=a?r?260:100:180,E=a?r?325:125:220,O=a?r?33:13:17,l=a?r?21:8:14,V=a?r?218:84:152,k=a?r?213:82:150,m=.15+t.stagger,x=.55+t.stagger,h=z(s,[m,x],[0,t.x*p]),g=z(s,[m,x],[0,t.y*p]),c=z(s,[m,x],[t.huddle,t.rotate]),y=q(0),u=q(1),b=z([c,y],([f,w])=>f+w);return n.jsxs(K.div,{className:"absolute cursor-pointer",style:{width:N,height:E,zIndex:i,x:h,y:g,rotate:b,scale:u},onHoverStart:()=>{o(50);const f=c.get(),v=t.rotate*.3-f;A(y,v,{duration:.3,ease:"easeOut"}),A(u,1.08,{duration:.3,ease:"easeOut"})},onHoverEnd:()=>{A(y,0,{duration:.3,ease:"easeOut"}),A(u,1,{duration:.3,ease:"easeOut"}),setTimeout(()=>o(0),300)},onTouchStart:()=>{o(50);const f=c.get(),v=t.rotate*.3-f;A(y,v,{duration:.3,ease:"easeOut"}),A(u,1.08,{duration:.3,ease:"easeOut"})},onTouchEnd:()=>{A(y,0,{duration:.3,ease:"easeOut"}),A(u,1,{duration:.3,ease:"easeOut"}),setTimeout(()=>o(0),300)},children:[n.jsx("img",{src:e,alt:"Story maker polaroid photo",role:"presentation",className:"absolute object-cover rounded-sm pointer-events-none",style:{top:O,left:l,width:V,height:k}}),n.jsx("img",{src:lt,alt:"Polaroid frame",role:"presentation",className:"absolute inset-0 w-full h-full pointer-events-none",draggable:!1})]})},yt=({flickerWritingImageSrc:e})=>{const t=se.useRef(null),s=Ve(),{t:a}=ne("landing"),{scrollYProgress:i}=Fe({target:t,offset:["start start","end end"]});return n.jsx(n.Fragment,{children:n.jsx("section",{ref:t,className:`relative ${s?"h-[250vh]":"h-[200vh]"}`,style:{background:"#FFE4E6"},children:n.jsx("div",{className:"sticky top-14 h-[calc(100vh-3.5rem)] flex flex-col overflow-hidden relative z-10",style:{background:"#FFE4E6"},children:s?n.jsxs("div",{className:"flex flex-col items-center px-4 pt-2 h-full ipad-portrait:!gap-2",children:[n.jsxs("h2",{className:"section-header text-[22px] ipad-portrait:!text-[28px] mb-1 leading-tight text-center",children:[a("storyMaker.heading"),n.jsx("br",{}),a("storyMaker.headingLine2")]}),n.jsx("p",{className:"section-subtext text-sm ipad-portrait:!text-base mb-1 text-center max-w-xs ipad-portrait:!max-w-[480px] mx-auto",children:a("storyMaker.subtext")}),n.jsx("div",{className:"flex flex-col items-center gap-1 relative z-20",children:e&&n.jsx("img",{src:e,alt:"Flicker writing a story",className:"w-32 ipad-portrait:!w-56 rounded-lg"})}),n.jsx("div",{className:"relative flex-1 ipad-portrait:!flex-none ipad-portrait:!h-[55vh] w-full flex items-center justify-center",children:n.jsx("div",{className:"relative",style:{width:1,height:1,transform:"translate(0px, -120px)"},children:ee.map((o,r)=>n.jsx(te,{img:o.img,cfg:o,scrollYProgress:i,isMobile:s},r))})}),n.jsx("div",{className:"flex flex-col items-center pb-4 -mt-16 ipad-portrait:!mt-4 relative z-20",children:n.jsx(Y,{})})]}):n.jsxs("div",{className:"container mx-auto px-6 grid grid-cols-2 gap-12 items-center h-full",children:[n.jsx("div",{className:"relative flex items-center justify-center",style:{minHeight:600},children:n.jsx("div",{className:"relative",style:{width:1,height:1},children:ee.map((o,r)=>n.jsx(te,{img:o.img,cfg:o,scrollYProgress:i,isMobile:s},r))})}),n.jsxs(K.div,{initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{duration:.6},className:"text-center flex flex-col items-center",children:[n.jsxs("h2",{className:"section-header mb-6 leading-tight",children:[a("storyMaker.heading"),n.jsx("br",{}),a("storyMaker.headingLine2")]}),n.jsx("p",{className:"section-subtext mb-8 max-w-md",children:a("storyMaker.subtext")}),e&&n.jsx("img",{src:e,alt:"Flicker writing a story",className:"w-48 md:w-56 mb-8 rounded-lg"}),n.jsx(Y,{})]})]})})})})};export{yt as default};
//# sourceMappingURL=StoryMakerSection-BJLQvmcw.js.map