{"version":3,"file":"Code_Functions.KFfBgNOg.mjs","names":["useState","useState","__legacyOverrideHOC_DataObserverContext","_jsx"],"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/jbn2nEQH6odlnNrdGQ9s/eSvHtWbxv0TUJQhItSal/Code_Functions.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,useState,useEffect}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\"});// Storage key used to track if the user has dismissed the popup\nconst AGE_GATE_STORAGE_KEY=\"hasConfirmedAge\";let overColour=\"#ffffff\";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 withPopupVisibility(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const[isVisible,setIsVisible]=useState(false);useEffect(()=>{// Check if the flag already exists in the user's browser\nconst hasSeen=localStorage.getItem(AGE_GATE_STORAGE_KEY);// If they haven't seen it, show the popup\nif(!hasSeen){setIsVisible(true);}},[]);// If the flag exists, do not render the popup layer at all\nif(!isVisible)return null;return /*#__PURE__*/_jsx(Component,{ref:ref,...props});});}export function CMSColourSave(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const rgbValue=JSON.stringify(props.style[\"--variable-reference-KaWoAXHLy-wN8IaGVHe\"]).match(/rgb\\([^)]+\\)/)?.[0];//props.text = rgbValue\noverColour=rgbValue;//const colour = props.headingColour || \"#ffffff\" // CMS colour field\nreturn /*#__PURE__*/_jsx(Component,{ref:ref,...props});});}export function CMSHeadingColour(props){const colour=overColour;console.log(props);useEffect(()=>{const styleId=\"cms-heading-colour\";let style=document.getElementById(styleId);if(!style){style=document.createElement(\"style\");style.id=styleId;document.head.appendChild(style);}style.innerHTML=`\n            .cms-text h4 {\n                color: ${colour}!important;\n            }\n        `;},[colour]);return{...props,className:`cms-text ${props.className}`};}//Nonworking below\nexport function HeadingColour(props){console.log(props);return{style:{[\"--heading-colour\"]:overColour,...props.style},className:`cms-text ${props.className}`,...props};}export function withCloseTrigger(Component){return /*#__PURE__*/forwardRef((props,ref)=>{function handleTap(){// Set the flag in localStorage so it doesn't show next time\nlocalStorage.setItem(AGE_GATE_STORAGE_KEY,\"true\");// Force a page reload or trigger a state shift.\n// Reloading is the cleanest way to immediately unmount the override wrapper.\nwindow.location.reload();}return /*#__PURE__*/_jsx(Component,{ref:ref,...props,onTap:handleTap});});}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()});}});});}import{useContext as __legacyOverrideHOC_useContext}from\"react\";import{DataObserverContext as __legacyOverrideHOC_DataObserverContext}from\"framer\";export function withCMSHeadingColour(C){return props=>{__legacyOverrideHOC_useContext(__legacyOverrideHOC_DataObserverContext);return _jsx(C,{...props,...CMSHeadingColour(props)});};}withCMSHeadingColour.displayName=\"CMSHeadingColour\";export function withHeadingColour(C){return props=>{__legacyOverrideHOC_useContext(__legacyOverrideHOC_DataObserverContext);return _jsx(C,{...props,...HeadingColour(props)});};}withHeadingColour.displayName=\"HeadingColour\";\nexport const __FramerMetadata__ = {\"exports\":{\"withRotate\":{\"type\":\"reactHoc\",\"name\":\"withRotate\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"CMSColourSave\":{\"type\":\"reactHoc\",\"name\":\"CMSColourSave\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withCloseTrigger\":{\"type\":\"reactHoc\",\"name\":\"withCloseTrigger\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withHeadingColour\":{\"type\":\"reactHoc\",\"name\":\"withHeadingColour\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withHover\":{\"type\":\"reactHoc\",\"name\":\"withHover\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withCMSHeadingColour\":{\"type\":\"reactHoc\",\"name\":\"withCMSHeadingColour\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"HeadingColour\":{\"type\":\"override\",\"name\":\"HeadingColour\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withPopupVisibility\":{\"type\":\"reactHoc\",\"name\":\"withPopupVisibility\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"CMSHeadingColour\":{\"type\":\"override\",\"name\":\"CMSHeadingColour\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withRandomColor\":{\"type\":\"reactHoc\",\"name\":\"withRandomColor\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Code_Functions.map"],"mappings":"sNAA8E,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,EAAM,CAAa,CAAG,CAAC,OAAO,CAAS,iBAfT,IAAwC,kCEAhE,EAAgB,CACzB,QAAS,OACT,eAAgB,SAChB,WAAY,QAChB,EAWI,CADA,GAAG,CACO,sBEbuZ,SAAgB,EAAoB,EAAU,CAAC,OAAoB,GAAY,EAAM,IAAM,CAAC,GAAK,CAAC,EAAU,GAAcC,EAAS,EAAK,EAG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