{"version":3,"file":"Examples.CSFQnAO0.mjs","names":["useStore","useState","useRef","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/qmYliINAZE7aksvyr4po/esKOs0KtnP2w9vwxvSHE/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{forwardRef,useCallback,useEffect,useRef}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\";// 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 withPhysioConditionalFields(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const rootRef=useRef(null);const selectedServiceRef=useRef(null);const setRefs=useCallback(node=>{rootRef.current=node;if(typeof ref===\"function\"){ref(node);}else if(ref){ref.current=node;}},[ref]);useEffect(()=>{if(typeof window===\"undefined\")return;const rootElement=rootRef.current;if(!rootElement)return;const scopeElement=rootElement;const timers=new Map;const getLegacyTargets=container=>{const wrappers=new Set;const controls=new Set;const dataConditionalWrappers=Array.from(container.querySelectorAll('[data-conditional-field=\"fysiotherapie\"]'));dataConditionalWrappers.forEach(wrapper=>{wrappers.add(wrapper);const nestedControls=wrapper.querySelectorAll(\"input, select, textarea\");nestedControls.forEach(control=>controls.add(control));});const physioFieldNames=[\"Geboortedatum\",\"Huisnummer\",\"Postcode\"];const namedControls=Array.from(container.querySelectorAll(\"input, select, textarea\"));namedControls.forEach(control=>{if(!physioFieldNames.includes(control.name))return;controls.add(control);const wrapper=control.closest(\"label\")??control.parentElement;if(wrapper)wrappers.add(wrapper);});return{wrappers,controls};};const setAnimatedVisibility=(element,isVisible)=>{const existingTimer=timers.get(element);if(existingTimer){window.clearTimeout(existingTimer);timers.delete(element);}element.style.transition=\"opacity 220ms ease, transform 220ms ease\";element.style.willChange=\"opacity, transform\";if(isVisible){element.hidden=false;element.style.display=\"\";element.style.visibility=\"\";element.style.opacity=\"0\";element.style.transform=\"translateY(8px)\";window.requestAnimationFrame(()=>{element.style.opacity=\"1\";element.style.transform=\"translateY(0)\";});}else{element.hidden=true;element.style.display=\"none\";element.style.opacity=\"0\";element.style.transform=\"translateY(8px)\";}};const serviceSlugMap={\"premium-fitness\":\"Premium Fitness\",\"personal-training\":\"Personal Training\",fysiotherapie:\"Fysiotherapie\",\"vso-sportsteunzolen\":\"VSO Sportsteunzolen\",massage:\"Massage\"};const resolveServiceValue=(element,attributeName,idPrefix)=>{const fromData=element.getAttribute(attributeName);if(fromData&&fromData.trim().length>0)return fromData;if(element.id.startsWith(idPrefix)){const slug=element.id.slice(idPrefix.length).toLowerCase();return serviceSlugMap[slug]??slug.replace(/-/g,\" \");}return null;};const serviceChoiceElements=Array.from(scopeElement.querySelectorAll(\"[data-service-choice], [id^='service-choice-']\"));const serviceChoices=serviceChoiceElements.map(element=>({element,value:resolveServiceValue(element,\"data-service-choice\",\"service-choice-\")})).filter(item=>!!item.value);const collectServiceForms=()=>{const serviceFormElements=Array.from(document.querySelectorAll(\"[data-service-form], [id^='service-form-']\"));return serviceFormElements.map(element=>({element,value:resolveServiceValue(element,\"data-service-form\",\"service-form-\")})).filter(item=>!!item.value);};const getSlugFromServiceValue=serviceValue=>{const exact=Object.keys(serviceSlugMap).find(slug=>serviceSlugMap[slug]===serviceValue);if(exact)return exact;return serviceValue.toLowerCase().replace(/\\s+/g,\"-\");};const revealFormByIdIfPresent=(serviceValue,shouldScroll)=>{const slug=getSlugFromServiceValue(serviceValue);const formId=`service-form-${slug}`;const runRevealAttempt=()=>{const candidate=document.getElementById(formId);if(!candidate)return;setAnimatedVisibility(candidate,true);const onderwerpInputs=candidate.querySelectorAll('input[type=\"hidden\"][name=\"Onderwerp\"]');onderwerpInputs.forEach(input=>{input.value=serviceValue;});if(shouldScroll){window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>{candidate.scrollIntoView({behavior:\"smooth\",block:\"start\"});});});}};runRevealAttempt();window.requestAnimationFrame(runRevealAttempt);window.setTimeout(runRevealAttempt,120);};const applyLegacyBehavior=serviceValue=>{const isPhysiotherapie=serviceValue===\"Fysiotherapie\";const legacyTargets=getLegacyTargets(scopeElement);legacyTargets.wrappers.forEach(wrapper=>{wrapper.hidden=!isPhysiotherapie;});legacyTargets.controls.forEach(control=>{control.required=isPhysiotherapie;});};const updateServiceSelection=(serviceValue,shouldScroll=false)=>{selectedServiceRef.current=serviceValue;const serviceForms=collectServiceForms();let matchedFormElement=null;serviceChoices.forEach(choice=>{const isActive=!!serviceValue&&choice.value===serviceValue;choice.element.setAttribute(\"aria-pressed\",isActive?\"true\":\"false\");choice.element.setAttribute(\"data-service-active\",isActive?\"true\":\"false\");});serviceForms.forEach(form=>{const isMatch=!!serviceValue&&form.value===serviceValue;setAnimatedVisibility(form.element,isMatch);if(isMatch){matchedFormElement=form.element;const onderwerpInputs=form.element.querySelectorAll('input[type=\"hidden\"][name=\"Onderwerp\"]');onderwerpInputs.forEach(input=>{input.value=serviceValue;});}});if(serviceValue&&serviceForms.length===0){// If a Framer layer is set to visible=false on canvas, it may not be mounted in DOM at runtime.\n// We still attempt delayed ID lookups for forms that are mounted but initially hidden.\nrevealFormByIdIfPresent(serviceValue,shouldScroll);}else if(shouldScroll&&matchedFormElement){window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>{matchedFormElement?.scrollIntoView({behavior:\"smooth\",block:\"start\"});});});}applyLegacyBehavior(serviceValue);};const onChoiceClick=event=>{const target=event.currentTarget;if(!target)return;updateServiceSelection(resolveServiceValue(target,\"data-service-choice\",\"service-choice-\"),true);};serviceChoices.forEach(choice=>{choice.element.addEventListener(\"click\",onChoiceClick);});if(collectServiceForms().length>0){collectServiceForms().forEach(form=>{form.element.hidden=true;form.element.style.display=\"none\";form.element.style.opacity=\"0\";form.element.style.transform=\"translateY(8px)\";});updateServiceSelection(null);}else{const nearestForm=rootElement.closest(\"form\")??rootElement;const selectElement=nearestForm.querySelector('select[name=\"Onderwerp\"]')??document.querySelector('select[name=\"Onderwerp\"]');const updateFromSelect=()=>{const serviceValue=selectElement?.value??null;applyLegacyBehavior(serviceValue);};updateFromSelect();if(selectElement){selectElement.addEventListener(\"change\",updateFromSelect);}return()=>{if(selectElement){selectElement.removeEventListener(\"change\",updateFromSelect);}timers.forEach(timer=>window.clearTimeout(timer));};}return()=>{serviceChoices.forEach(choice=>{choice.element.removeEventListener(\"click\",onChoiceClick);});timers.forEach(timer=>window.clearTimeout(timer));};},[]);return /*#__PURE__*/_jsx(Component,{ref:setRefs,...props});});}\nexport const __FramerMetadata__ = {\"exports\":{\"withRandomColor\":{\"type\":\"reactHoc\",\"name\":\"withRandomColor\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withHover\":{\"type\":\"reactHoc\",\"name\":\"withHover\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withRotate\":{\"type\":\"reactHoc\",\"name\":\"withRotate\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withPhysioConditionalFields\":{\"type\":\"reactHoc\",\"name\":\"withPhysioConditionalFields\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Examples.map"],"mappings":"sNAA8E,SAAgB,EAAY,EAAO,CACjH,IAAM,EAAU,EAAK,CAAC,MAAM,OAAO,OAAO,CAAC,GAAG,EAAO,CAAC,CAAC,CAAC,CAClD,EAAa,GAAU,CAC1B,OAAO,GAAW,aAAY,EAAS,EAAS,EAAU,MAAM,EAAE,EAAU,MAAM,OAAO,OAAO,CAAC,GAAG,EAAU,MAAM,GAAG,EAAS,CAAC,EAChI,EAAW,OAAO,GAAS,SAAS,OAAO,OAAO,CAAC,GAAG,EAAO,CAAC,CAAC,EAC7D,EAAa,IAAI,IACjB,EAAc,GAAU,CAC3B,OAAO,GAAW,aAAY,EAAS,EAAS,EAAW,EAAE,EAAW,OAAO,GAAW,SAAS,OAAO,OAAO,CAAC,GAAG,EAAW,GAAG,EAAS,CAAC,CAAC,EACjJ,EAAa,QAAQ,GAAQ,EAAO,EAAW,CAAC,EAChD,SAASA,GAAU,CACnB,GA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