{"version":3,"file":"Examples.CJCMS_bq.mjs","names":["useStore","useState","useState"],"sources":["https:/framer.com/m/framer/store.js@^1.0.0","https:/framer.com/m/framer/utils.js@^0.9.0","https:/framerusercontent.com/modules/BcL0eXSRh6azudi9rhwZ/ySsmK4vlx4Sxbb2t4jIf/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","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","import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{forwardRef,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\";// 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()});}});});}// Custom overrides start here\nfunction Eye(){return /*#__PURE__*/_jsxs(\"svg\",{display:\"block\",viewBox:\"0 0 24 24\",xmlns:\"http://www.w3.org/2000/svg\",id:\"1361894804\",width:\"24px\",height:\"24px\",children:[/*#__PURE__*/_jsx(\"path\",{d:\"M 13.875 4.25 C 14.315 5.149 14.5 5.925 14.5 6.25 C 14.5 7.25 12.75 12.5 7.25 12.5 C 6.519 12.5 5.854 12.407 5.25 12.244 M 2.25 10.519 C 0.612 8.919 0 6.841 0 6.25 C 0 5.25 1.75 0 7.25 0 C 9.045 0 10.44 0.559 11.506 1.347\",fill:\"transparent\",height:\"12.5px\",id:\"V4BlFbPfg\",\"stroke-dasharray\":\"\",\"stroke-linecap\":\"round\",\"stroke-linejoin\":\"round\",\"stroke-width\":\"var(--1335ju, 1.5)\",stroke:\"var(--extracted-r6o4lv, rgb(120, 120, 108))\",transform:\"translate(4.75 5.75)\",width:\"14.5px\"}),/*#__PURE__*/_jsx(\"path\",{d:\"M 14.5 0 L 0 14.5\",fill:\"transparent\",height:\"14.5px\",id:\"tMLI8Ipcq\",\"stroke-dasharray\":\"\",\"stroke-linecap\":\"round\",\"stroke-linejoin\":\"round\",\"stroke-width\":\"var(--1335ju, 1.5)\",stroke:\"var(--extracted-r6o4lv, rgb(120, 120, 108))\",transform:\"translate(4.75 4.75)\",width:\"14.5px\"}),/*#__PURE__*/_jsx(\"path\",{d:\"M 0.659 3.841 C -0.22 2.962 -0.22 1.538 0.659 0.659 C 1.538 -0.22 2.962 -0.22 3.841 0.659\",fill:\"transparent\",height:\"3.8410249999999984px\",id:\"bRVAfB6Uq\",\"stroke-dasharray\":\"\",\"stroke-linecap\":\"round\",\"stroke-linejoin\":\"round\",\"stroke-width\":\"var(--1335ju, 1.5)\",stroke:\"var(--extracted-r6o4lv, rgb(120, 120, 108))\",transform:\"translate(9.75 9.75)\",width:\"3.8410024999999983px\"})]});}function EyeHidden(){return /*#__PURE__*/_jsxs(\"svg\",{display:\"block\",viewBox:\"0 0 24 24\",xmlns:\"http://www.w3.org/2000/svg\",id:\"1136442458\",width:\"24px\",height:\"24px\",children:[/*#__PURE__*/_jsx(\"path\",{d:\"M 14.5 6.25 C 14.5 7.25 12.75 12.5 7.25 12.5 C 1.75 12.5 0 7.25 0 6.25 C 0 5.25 1.75 0 7.25 0 C 12.75 0 14.5 5.25 14.5 6.25 Z\",fill:\"transparent\",height:\"12.5px\",id:\"KuDKNszfv\",\"stroke-dasharray\":\"\",\"stroke-linecap\":\"round\",\"stroke-linejoin\":\"round\",\"stroke-width\":\"var(--1335ju, 1.5)\",stroke:\"var(--extracted-r6o4lv, rgb(120, 120, 108))\",transform:\"translate(4.75 5.75)\",width:\"14.5px\"}),/*#__PURE__*/_jsx(\"path\",{d:\"M 0 2.25 C 0 1.007 1.007 0 2.25 0 C 3.493 0 4.5 1.007 4.5 2.25 C 4.5 3.493 3.493 4.5 2.25 4.5 C 1.007 4.5 0 3.493 0 2.25 Z\",fill:\"transparent\",height:\"4.5px\",id:\"dwzTVdd43\",\"stroke-dasharray\":\"\",\"stroke-linecap\":\"round\",\"stroke-linejoin\":\"round\",\"stroke-width\":\"var(--1335ju, 1.5)\",stroke:\"var(--extracted-r6o4lv, rgb(120, 120, 108))\",transform:\"translate(9.75 9.75)\",width:\"4.5px\"})]});}export function withValidationAndPasswordToggle(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const[error,setError]=useState(\"\");const[touched,setTouched]=useState(false);const[showPassword,setShowPassword]=useState(false);// Check if this is a password field based on name\nconst isPasswordField=props.inputName?.toLowerCase()===\"password\";const validateInput=input=>{if(input.validity.valid)return\"\";if(input.validity.valueMissing){return\"Required\";}else if(input.validity.typeMismatch){if(input.type===\"email\"){return\"Invalid email address\";}}else if(input.validity.tooShort){return`Minimum ${input.minLength} characters required`;}else if(input.validity.patternMismatch){return\"Invalid format\";}return\"Invalid value\";};// Determine input type based on password field and toggle state\nconst inputType=isPasswordField?showPassword?\"text\":\"password\":props.type;return /*#__PURE__*/_jsx(\"div\",{style:{position:\"relative\",marginBottom:\"0\",width:\"100%\"},children:/*#__PURE__*/_jsxs(\"div\",{style:{position:\"relative\"},children:[/*#__PURE__*/_jsxs(\"div\",{style:{fontSize:\"12px\",color:\"#E66C4B\",opacity:error&&touched?1:0,transition:\"opacity 0.2s ease\",flex:1,alignSelf:\"center\",textAlign:\"right\",position:\"absolute\",top:\"-24px\",right:\"0\"},children:[error||\"\\xa0\",\" \"]}),/*#__PURE__*/_jsx(Component,{ref:ref,...props,name:props.inputName,type:inputType,autocomplete:isPasswordField?\"current-password\":\"off\",style:{...props.style,paddingRight:isPasswordField?\"40px\":props.style?.paddingRight,marginBottom:\"0\"},onInvalid:e=>{e.preventDefault()// Prevent browser popup\n;setTouched(true);if(e.type===\"invalid\"){setError(validateInput(e.target));}},onBlur:e=>{setTouched(true);props.onBlur?.(e);},onChange:e=>{if(touched){setError(validateInput(e.target));}props.onChange?.(e);}}),isPasswordField&&/*#__PURE__*/_jsx(\"button\",{type:\"button\",onClick:()=>setShowPassword(!showPassword),style:{position:\"absolute\",right:\"8px\",top:\"50%\",transform:\"translateY(-50%)\",border:\"none\",background:\"none\",cursor:\"pointer\",fontSize:\"16px\",zIndex:10},children:showPassword?/*#__PURE__*/_jsx(Eye,{}):/*#__PURE__*/_jsx(EyeHidden,{})})]})});});}\nexport const __FramerMetadata__ = {\"exports\":{\"withRandomColor\":{\"type\":\"reactHoc\",\"name\":\"withRandomColor\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withRotate\":{\"type\":\"reactHoc\",\"name\":\"withRotate\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withHover\":{\"type\":\"reactHoc\",\"name\":\"withHover\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withValidationAndPasswordToggle\":{\"type\":\"reactHoc\",\"name\":\"withValidationAndPasswordToggle\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Examples.map"],"mappings":"4QAA8E,SAAgB,EAAY,EAAO,CACjH,IAAM,EAAU,EAAK,CAAC,MAAM,OAAO,OAAO,CAAC,GAAG,EAAO,CAAC,CAAC,CAAC,CAClD,EAAa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