{"version":3,"file":"shared-lib.fFUZ-MU3.mjs","names":["React.useRef","React.useId","__esmMin","init_npm_react_18_3_1","init_ssg_sandbox_shims","window","ie","c","init_jsx_runtime","ce","de","init_framer_BpuvUAiZ","RenderTarget","useReadingMotion","host","root","motion","area","registry","HighlightSet","activated","firstPaint","animations","copy","frame","refresh","io","entry","entries","el","anim","reset","key","paint","pale","mid","h","bounds","scrollProgress","clamp","entranceProgress","progress","schedule","edge","words","scan","a","names","readingNames","walker","text","str","m","r","titleNames","rescan","obs","HomeReadingMotion","init_HomeReadingMotion","n","arr","s"],"sources":["https:/framerusercontent.com/modules/458f0K1teN1CUphUJQOb/vx4K4Ug9QCh3vURV1Xrg/HomeReadingMotion.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import*as React from\"react\";import{RenderTarget}from\"framer\";const clamp=n=>Math.max(0,Math.min(1,n));const readingNames=[\"areito in their words\",\"the word in context\",\"sisters home lead\",\"sisters home sound\",\"sisters home return\",\"our way home\",\"what we brought back\",\"designing sound together\",\"working in new york\",\"recorded on location\",\"new york journeys\",\"drum and bowls\",\"mimi background\",\"elen background\",\"sessions index description\",\"archive opening note\",\"journal opening\",\"article standfirst\"];const titleNames=[\"the sisters home title\",\"sessions heading\",\"memoria preview title\",\"coming home title\",\"first sound for film\",\"sound through yoga\",\"biography heading mimi\",\"biography heading elen\",\"training our journey\",\"upcoming sessions title\",\"enquiry heading\",\"write a note\",\"the archive\",\"featured story title\",\"journal card title\"];const names=arr=>arr.map(s=>'[data-framer-name=\"'+s+'\"]').join(\",\");function useReadingMotion(root,key){React.useEffect(()=>{const host=root.current;if(!host||RenderTarget.current()===RenderTarget.canvas)return;const motion=matchMedia(\"(prefers-reduced-motion:reduce)\");const area=host.ownerDocument.body,registry=window.CSS?.highlights,HighlightSet=window.Highlight;const activated=new WeakSet;const firstPaint=performance.now();const animations=new Set;let copy=[],frame=0,refresh=0;const io=new IntersectionObserver(entries=>{for(const entry of entries){const el=entry.target;if(!entry.isIntersecting||activated.has(el))continue;activated.add(el);io.unobserve(el);if(!motion.matches){const anim=el.animate([{opacity:.3,translate:\"0 14px\"},{opacity:1,translate:\"0 0\"}],{duration:720,easing:\"cubic-bezier(.22,.61,.36,1)\"});animations.add(anim);anim.onfinish=()=>animations.delete(anim);}}},{threshold:.12,rootMargin:\"0px 0px -3% 0px\"});function reset(){registry?.delete(key);registry?.delete(key+\"mid\");copy.forEach(c=>c.el.style.removeProperty(\"opacity\"));}function paint(){frame=0;if(motion.matches){reset();return;}const pale=[],mid=[],h=window.innerHeight;copy.forEach(({el,words})=>{const bounds=el.getBoundingClientRect();const scrollProgress=clamp((h*.84-bounds.top)/Math.max(h*.22,bounds.height*.95));const entranceProgress=clamp((performance.now()-firstPaint-80)/920);const progress=Math.min(scrollProgress,entranceProgress);if(entranceProgress<1&&scrollProgress>0)schedule();if(registry&&HighlightSet){const edge=progress*(words.length+3);words.forEach((r,i)=>{if(i>=edge)pale.push(r);else if(edge-i<3)mid.push(r);});}else el.style.opacity=String(.64+.36*progress);});if(registry&&HighlightSet){registry.set(key,new HighlightSet(...pale));registry.set(key+\"mid\",new HighlightSet(...mid));}}function schedule(){if(!frame)frame=requestAnimationFrame(paint);}function scan(){refresh=0;reset();copy=[];if(motion.matches){animations.forEach(a=>a.cancel());animations.clear();io.disconnect();return;}area.querySelectorAll(names(readingNames)+\",.areito-gathering-cards article>p,.ar-service-copy>p\").forEach(el=>{if(!el.getClientRects().length)return;const walker=document.createTreeWalker(el,NodeFilter.SHOW_TEXT),words=[];let text;while(text=walker.nextNode()){const str=text.textContent||\"\";for(const m of str.matchAll(/\\S+/g)){const r=document.createRange();r.setStart(text,m.index);r.setEnd(text,m.index+m[0].length);words.push(r);}}copy.push({el,words});});area.querySelectorAll(names(titleNames)+\",.areito-gathering-cards article>h2\").forEach(el=>{if(el.getClientRects().length&&!activated.has(el))io.observe(el);});schedule();}function rescan(){if(!refresh)refresh=requestAnimationFrame(scan);}const obs=new MutationObserver(rescan);obs.observe(area,{childList:true,subtree:true,characterData:true});scan();window.addEventListener(\"scroll\",schedule,{passive:true});window.addEventListener(\"resize\",rescan);motion.addEventListener(\"change\",rescan);return()=>{cancelAnimationFrame(frame);cancelAnimationFrame(refresh);obs.disconnect();io.disconnect();animations.forEach(a=>a.cancel());window.removeEventListener(\"scroll\",schedule);window.removeEventListener(\"resize\",rescan);motion.removeEventListener(\"change\",rescan);reset();};},[key]);}/** @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n */export default function HomeReadingMotion(){const root=React.useRef(null);const key=\"areitoRead\"+React.useId().replace(/[^a-zA-Z0-9]/g,\"\");useReadingMotion(root,key);return /*#__PURE__*/_jsx(\"div\",{\"aria-hidden\":\"true\",ref:root,children:/*#__PURE__*/_jsx(\"style\",{children:`\n ::highlight(${key}){color:#737373}::highlight(${key}mid){color:#454545}\n @keyframes areitoHeroArrival{from{opacity:.45;translate:0 12px}to{opacity:1;translate:0 0}}\n @media(prefers-reduced-motion:no-preference){\n :is([data-framer-name=\"Live practice headline\"],[data-framer-name=\"sisters heading\"],[data-framer-name=\"collaboration heading\"],[data-framer-name=\"sessions script title\"],[data-framer-name=\"memoria handwritten title\"],[data-framer-name=\"journal handwritten title\"],[data-framer-name=\"article title\"]){animation:areitoHeroArrival .75s cubic-bezier(.22,.61,.36,1) backwards}\n :is([data-framer-name=\"masthead introduction\"],[data-framer-name=\"sisters lead\"],[data-framer-name=\"collaboration lead\"],[data-framer-name=\"sessions index description\"],[data-framer-name=\"archive opening note\"],[data-framer-name=\"journal opening\"],[data-framer-name=\"article standfirst\"]){animation:areitoHeroArrival .76s .10s cubic-bezier(.22,.61,.36,1) backwards}\n }\n [data-framer-name=\"areito in their words\"],[data-framer-name=\"areito in their words\"] :is(h2,p,blockquote,span){text-align:center!important;text-wrap:balance}\n [data-framer-name=\"areito in their words\"] blockquote{margin:0;font:inherit}\n [data-framer-name=\"Two individual dancers\"] img{object-fit:contain!important}\n @media (prefers-reduced-motion:reduce){[data-framer-name=\"Two individual dancers\"] [data-framer-name^=\"Quote dancer\"]{transform:none!important}}\n `})});}\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"HomeReadingMotion\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"any\",\"framerSupportedLayoutWidth\":\"any\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./HomeReadingMotion.map"],"mappings":"A,gMAA87B,SAASa,EAAiB,EAAK,EAAI,CAACJ,MAAoB,CAAC,IAAMK,EAAKC,EAAK,QAAQ,GAAG,CAACD,GAAMF,EAAa,QAAQ,IAAIA,EAAa,OAAO,OAAO,IAAMI,EAAO,WAAW,iCAAiC,EAAQC,EAAKH,EAAK,cAAc,KAAKI,EAASb,EAAO,KAAK,WAAWc,EAAad,EAAO,UAAgBe,kBAAU,IAAI,QAAcC,EAAW,YAAY,IAAI,EAAQC,kBAAW,IAAI,IAAQC,EAAK,CAAC,EAAEC,EAAM,EAAEC,EAAQ,EAAQC,EAAG,IAAI,qBAAqB,GAAS,CAAC,IAAI,IAAMC,KAASC,EAAQ,CAAC,IAAMC,EAAGF,EAAM,OAAO,GAAIA,EAAM,gBAAgB,GAAU,IAAIE,CAAE,IAAWT,EAAU,IAAIS,CAAE,EAAEH,EAAG,UAAUG,CAAE,EAAK,CAACb,EAAO,SAAQ,CAAC,IAAMc,EAAKD,EAAG,QAAQ,CAAC,CAAC,QAAQ,GAAG,UAAU,QAAQ,EAAE,CAAC,QAAQ,EAAE,UAAU,KAAK,CAAC,EAAE,CAAC,SAAS,IAAI,OAAO,6BAA6B,CAAC,EAAEP,EAAW,IAAIQ,CAAI,EAAE,EAAK,aAAaR,EAAW,OAAOQ,CAAI,CAAE,CAAC,CAAC,EAAE,CAAC,UAAU,IAAI,WAAW,iBAAiB,CAAC,EAAE,SAASC,GAAO,CAACb,GAAU,OAAOc,CAAG,EAAEd,GAAU,OAAOc,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