{"version":3,"file":"Examples.C05eKAms.mjs","names":["useState","useRef","useState","useCallback"],"sources":["https:/framerusercontent.com/modules/vj7bFUjvEQFgEzNBkdoG/vf3CKm378wlVcBk7IhSU/createStore.js","https:/framer.com/m/framer/store.js@^1.0.0","https:/framerusercontent.com/modules/28rXvpPsrum7FH6cMELS/1jCAazZw1EGHjrG5Nu5D/Utils.js","https:/framer.com/m/framer/utils.js@^0.9.0","https:/framerusercontent.com/modules/vLQfMJi9PhfCxbinsrIs/EyxtkyXrT1ntDgSI9KE3/Examples.js"],"sourcesContent":["import{useState,useEffect}from\"react\";import{Data,useObserveData}from\"framer\";export function createStore(state1){// Use Data so that a Preview reload resets the state\nconst dataStore=Data({state:Object.freeze({...state1})});// Create a set function that updates the state\nconst setDataStore=newState=>{// If the state is an object, make sure we copy it\nif(typeof newState===\"function\"){newState=newState(dataStore.state);}dataStore.state=Object.freeze({...dataStore.state,...newState});};// Store the initial state, copy the object if it's an object\nlet storeState=typeof state1===\"object\"?Object.freeze({...state1}):state1;// Keep a list of all the listeners, in the form of React hook setters\nconst storeSetters=new Set();// Create a set function that updates all the listeners / setters\nconst setStoreState=newState=>{// If the state is an object, make sure we copy it\nif(typeof newState===\"function\"){newState=newState(storeState);}storeState=typeof newState===\"object\"?Object.freeze({...storeState,...newState}):newState;// Update all the listeners / setters with the new value\nstoreSetters.forEach(setter=>setter(storeState));};// Create the actual hook based on everything above\nfunction useStore(){// Create the hook we are going to use as a listener\nconst[state,setState]=useState(storeState);// If we unmount the component using this hook, we need to remove the listener\n// @ts-ignore\nuseEffect(()=>{// But right now, we need to add the listener\nstoreSetters.add(setState);return()=>storeSetters.delete(setState);},[]);// If Data context exists, use Data, otherwise use vanilla React state\nif(useObserveData()===true){useObserveData();return[dataStore.state,setDataStore];}else{// Return the state and a function to update the central store\nreturn[state,setStoreState];}}return useStore;}\nexport const __FramerMetadata__ = {\"exports\":{\"createStore\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./createStore.map","/*\n * createStore (framer/store@1.0.1)\n *\n * Learn More: https://www.framer.com/asset-urls\n */\n\nexport * from \"https://framerusercontent.com/modules/vj7bFUjvEQFgEzNBkdoG/vf3CKm378wlVcBk7IhSU/createStore.js\"\n","export const centerContent = {\n    display: \"flex\",\n    justifyContent: \"center\",\n    alignItems: \"center\"\n};\nexport const autoSizingText = {\n    width: \"max-content\",\n    wordBreak: \"break-word\",\n    overflowWrap: \"break-word\",\n    overflow: \"hidden\",\n    whiteSpace: \"pre-wrap\",\n    flexShrink: 0\n};\nexport const defaultContainerStyles = {\n    ...centerContent,\n    overflow: \"hidden\"\n};\nexport const containerStyles = defaultContainerStyles;\nexport const randomColor = ()=>\"#\" + Math.floor(Math.random() * 16777215).toString(16)\n;\n\nexport const __FramerMetadata__ = {\"exports\":{\"centerContent\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"containerStyles\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"autoSizingText\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"defaultContainerStyles\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"randomColor\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}}}}\n//# sourceMappingURL=./Utils.map","/*\n * Utils (framer/utils@0.9.0)\n *\n * Learn More: https://www.framer.com/asset-urls\n */\n\nexport * from \"https://framerusercontent.com/modules/28rXvpPsrum7FH6cMELS/1jCAazZw1EGHjrG5Nu5D/Utils.js\"\n","import{jsx as _jsx}from\"react/jsx-runtime\";import{Children,cloneElement,forwardRef,isValidElement,useEffect,useRef,startTransition,useCallback,useMemo,useState}from\"react\";import{createStore}from\"https://framer.com/m/framer/store.js@^1.0.0\";import{randomColor}from\"https://framer.com/m/framer/utils.js@^0.9.0\";import{useReducedMotion}from\"framer-motion\";// Learn more: https://www.framer.com/developers/overrides/\nconst useStore=createStore({background:\"#0099FF\"});export function withRotate(Component){return /*#__PURE__*/forwardRef((props,ref)=>{return /*#__PURE__*/_jsx(Component,{ref:ref,...props,animate:{rotate:90},transition:{duration:2}});});}export function withHover(Component){return /*#__PURE__*/forwardRef((props,ref)=>{return /*#__PURE__*/_jsx(Component,{ref:ref,...props,whileHover:{scale:1.05}});});}export function withRandomColor(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const[store,setStore]=useStore();return /*#__PURE__*/_jsx(Component,{ref:ref,...props,animate:{background:store.background},onClick:()=>{setStore({background:randomColor()});}});});}export function withInteractiveTestMenu(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const[hoveredIndex,setHoveredIndex]=useState(null);const getChildWidthWeight=useCallback(child=>{const widthValue=child?.props?.style?.width??child?.props?.width;if(typeof widthValue===\"number\"&&Number.isFinite(widthValue))return Math.max(widthValue,0);if(typeof widthValue===\"string\"){const parsed=Number.parseFloat(widthValue);if(Number.isFinite(parsed))return Math.max(parsed,0);}return 1;},[]);const isSeparator=useCallback(child=>{const widthValue=child?.props?.style?.width??child?.props?.width;if(typeof widthValue===\"number\")return widthValue<=8;if(typeof widthValue===\"string\"){const parsed=Number.parseFloat(widthValue);return Number.isFinite(parsed)&&parsed<=8;}return false;},[]);const childrenArray=useMemo(()=>Children.toArray(props.children),[props.children]);const enhancedChildren=useMemo(()=>{const nonSeparatorIndexes=childrenArray.reduce((acc,child,index)=>{if(/*#__PURE__*/isValidElement(child)&&!isSeparator(child))acc.push(index);return acc;},[]);const widthWeights=new Map;nonSeparatorIndexes.forEach(index=>{const child=childrenArray[index];widthWeights.set(index,/*#__PURE__*/isValidElement(child)?getChildWidthWeight(child):1);});const totalWeight=nonSeparatorIndexes.reduce((sum,index)=>sum+(widthWeights.get(index)??1),0);const hoveredWeight=hoveredIndex!==null?widthWeights.get(hoveredIndex)??1:1;const nonHoveredWeight=totalWeight-hoveredWeight;const otherScaleX=hoveredIndex===null?1:nonHoveredWeight<=0?1:(totalWeight-1.5*hoveredWeight)/nonHoveredWeight;const clampedOtherScaleX=Math.max(otherScaleX,0);return childrenArray.map((child,index)=>{if(!/*#__PURE__*/isValidElement(child))return child;const separator=isSeparator(child);const anotherItemHovered=hoveredIndex!==null&&hoveredIndex!==index;const isHoveredItem=hoveredIndex===index;const targetScaleX=separator?1:isHoveredItem?1.5:hoveredIndex!==null?clampedOtherScaleX:1;const targetOpacity=separator&&hoveredIndex!==null?.65:child.props.opacity??1;const previousAnimate=child.props.animate&&typeof child.props.animate===\"object\"?child.props.animate:{};const previousTransition=child.props.transition&&typeof child.props.transition===\"object\"?child.props.transition:{};return /*#__PURE__*/cloneElement(child,{animate:{...previousAnimate,scaleX:targetScaleX,scaleY:1,opacity:targetOpacity},transition:{duration:.24,ease:\"easeOut\",...previousTransition},onHoverStart:separator?child.props.onHoverStart:(...args)=>{startTransition(()=>setHoveredIndex(index));child.props.onHoverStart?.(...args);},onHoverEnd:separator?child.props.onHoverEnd:(...args)=>{startTransition(()=>setHoveredIndex(current=>current===index?null:current));child.props.onHoverEnd?.(...args);},onMouseEnter:separator?child.props.onMouseEnter:(...args)=>{startTransition(()=>setHoveredIndex(index));child.props.onMouseEnter?.(...args);},onMouseLeave:separator?child.props.onMouseLeave:(...args)=>{startTransition(()=>setHoveredIndex(current=>current===index?null:current));child.props.onMouseLeave?.(...args);},onPointerEnter:separator?child.props.onPointerEnter:(...args)=>{startTransition(()=>setHoveredIndex(index));child.props.onPointerEnter?.(...args);},onPointerLeave:separator?child.props.onPointerLeave:(...args)=>{startTransition(()=>setHoveredIndex(current=>current===index?null:current));child.props.onPointerLeave?.(...args);},style:{...child.props.style,transformOrigin:child.props.style?.transformOrigin??\"center center\"},\"aria-hidden\":separator&&anotherItemHovered?true:child.props[\"aria-hidden\"]});});},[childrenArray,getChildWidthWeight,hoveredIndex,isSeparator]);return /*#__PURE__*/_jsx(Component,{ref:ref,...props,children:enhancedChildren,onMouseLeave:(...args)=>{startTransition(()=>setHoveredIndex(null));props.onMouseLeave?.(...args);},onPointerLeave:(...args)=>{startTransition(()=>setHoveredIndex(null));props.onPointerLeave?.(...args);}});});}function createImageSequenceFlashComponent(Component,fixedDelay){return /*#__PURE__*/forwardRef((props,ref)=>{const layerRef=useRef(null);const prefersReducedMotion=useReducedMotion();const[sequenceDelay,setSequenceDelay]=useState(Math.max(0,fixedDelay??0));const defaultSlideStep=.44;const assignRef=useCallback(node=>{layerRef.current=node;if(typeof ref===\"function\"){ref(node);}else if(ref&&\"current\"in ref){ref.current=node;}},[ref]);useEffect(()=>{const readDelayFromStyleValue=value=>{if(typeof value===\"number\"&&Number.isFinite(value))return value;if(typeof value===\"string\"){const parsed=Number.parseFloat(value);if(Number.isFinite(parsed))return parsed;}return undefined;};const inferDelayFromLayerName=()=>{const nameCandidates=[props?.name,props?.layerName,props?.[\"data-framer-name\"],props?.[\"data-framer-layer-name\"],props?.[\"framerName\"]];for(const candidate of nameCandidates){if(typeof candidate!==\"string\")continue;const match=candidate.match(/image\\s*([1-6])/i);if(!match)continue;const imageIndex=Number.parseInt(match[1],10);if(Number.isFinite(imageIndex)&&imageIndex>=1&&imageIndex<=6){return(imageIndex-1)*defaultSlideStep;}}return undefined;};const inlineDelayValue=readDelayFromStyleValue(props?.style?.[\"--sequence-delay\"]);let resolvedDelay=inlineDelayValue;if(resolvedDelay===undefined&&typeof window!==\"undefined\"&&layerRef.current){const computedDelay=readDelayFromStyleValue(window.getComputedStyle(layerRef.current).getPropertyValue(\"--sequence-delay\"));resolvedDelay=computedDelay;}if(resolvedDelay===undefined){resolvedDelay=fixedDelay===undefined?inferDelayFromLayerName():fixedDelay;}startTransition(()=>setSequenceDelay(Math.max(0,resolvedDelay??0)));},[fixedDelay,props?.style,props?.name,props?.layerName,props?.[\"data-framer-name\"],props?.[\"data-framer-layer-name\"],props?.[\"framerName\"]]);const fadeDuration=prefersReducedMotion?.02:.12;const visibleHold=prefersReducedMotion?.01:.2;const totalDuration=fadeDuration*2+visibleHold;const previousAnimate=props.animate&&typeof props.animate===\"object\"?props.animate:{};const previousTransition=props.transition&&typeof props.transition===\"object\"?props.transition:{};const previousInitial=props.initial&&typeof props.initial===\"object\"?props.initial:{};return /*#__PURE__*/_jsx(Component,{...props,ref:assignRef,initial:{...previousInitial,opacity:0},animate:{...previousAnimate,opacity:[0,1,1,0]},transition:{...previousTransition,opacity:{times:[0,fadeDuration/totalDuration,(fadeDuration+visibleHold)/totalDuration,1],duration:totalDuration,delay:sequenceDelay,ease:\"linear\"}}});});}export function withImageSequenceFlash(Component){return createImageSequenceFlashComponent(Component);}export function withImageSequenceFlash1(Component){return createImageSequenceFlashComponent(Component,0);}export function withImageSequenceFlash2(Component){return createImageSequenceFlashComponent(Component,.44);}export function withImageSequenceFlash3(Component){return createImageSequenceFlashComponent(Component,.88);}export function withImageSequenceFlash4(Component){return createImageSequenceFlashComponent(Component,1.32);}export function withImageSequenceFlash5(Component){return createImageSequenceFlashComponent(Component,1.76);}export function withImageSequenceFlash6(Component){return createImageSequenceFlashComponent(Component,2.2);}\nexport const __FramerMetadata__ = {\"exports\":{\"withInteractiveTestMenu\":{\"type\":\"reactHoc\",\"name\":\"withInteractiveTestMenu\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withHover\":{\"type\":\"reactHoc\",\"name\":\"withHover\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withRandomColor\":{\"type\":\"reactHoc\",\"name\":\"withRandomColor\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withImageSequenceFlash1\":{\"type\":\"reactHoc\",\"name\":\"withImageSequenceFlash1\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withImageSequenceFlash6\":{\"type\":\"reactHoc\",\"name\":\"withImageSequenceFlash6\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withImageSequenceFlash3\":{\"type\":\"reactHoc\",\"name\":\"withImageSequenceFlash3\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withImageSequenceFlash4\":{\"type\":\"reactHoc\",\"name\":\"withImageSequenceFlash4\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withRotate\":{\"type\":\"reactHoc\",\"name\":\"withRotate\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withImageSequenceFlash\":{\"type\":\"reactHoc\",\"name\":\"withImageSequenceFlash\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withImageSequenceFlash5\":{\"type\":\"reactHoc\",\"name\":\"withImageSequenceFlash5\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withImageSequenceFlash2\":{\"type\":\"reactHoc\",\"name\":\"withImageSequenceFlash2\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Examples.map"],"mappings":"6QAA8E,SAAgB,EAAY,EAAO,CACjH,IAAM,EAAU,EAAK,CAAC,MAAM,OAAO,OAAO,CAAC,GAAG,CAAM,CAAC,CAAC,CAAC,EACjD,EAAa,GAAU,CAC1B,OAAO,GAAW,aAAY,EAAS,EAAS,EAAU,KAAK,GAAG,EAAU,MAAM,OAAO,OAAO,CAAC,GAAG,EAAU,MAAM,GAAG,CAAQ,CAAC,CAAE,EACjI,EAAW,OAAO,GAAS,SAAS,OAAO,OAAO,CAAC,GAAG,CAAM,CAAC,EAAE,EAC7D,EAAa,IAAI,IACjB,EAAc,GAAU,CAC3B,OAAO,GAAW,aAAY,EAAS,EAAS,CAAU,GAAG,EAAW,OAAO,GAAW,SAAS,OAAO,OAAO,CAAC,GAAG,EAAW,GAAG,CAAQ,CAAC,EAAE,EACjJ,EAAa,QAAQ,GAAQ,EAAO,CAAU,CAAC,CAAE,EACjD,SAAS,GAAU,CACnB,GAAK,CAAC,EAAM,GAAUA,EAAS,CAAU,EAKzC,OAHA,OACA,EAAa,IAAI,CAAQ,MAAY,EAAa,OAAO,CAAQ,GAAI,CAAC,CAAC,EACpE,EAAe,IAAI,IAAM,EAAe,EAAQ,CAAC,EAAU,MAAM,CAAY,GAC1E,CAAC,E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