{"version":3,"file":"shared-lib.DWbFlfAT.mjs","names":["useState","useRef"],"sources":["https:/framerusercontent.com/modules/BYKGUbAHdDSCZHjUWrvm/3sxhWSqiH0SFCBtR1iZk/TextGlitch_Prod.js","https:/framerusercontent.com/modules/ydSLhELMjnhSAvtzSUZh/OlRx3zy7waDvW7Lst0qJ/OrxYrHLnf.js","https:/framerusercontent.com/modules/b47bdqrwQnnipndCpv37/IS3AO1EhgRAKsD8ZrXg1/siteMetadata.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useRef,useState}from\"react\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";const DEFAULT_SCRAMBLE_CHARS=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*()_+-=[]{}|;:,.<>?\";/**\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n * @framerIntrinsicWidth 400\n * @framerIntrinsicHeight 200\n * @framerDisableUnlink\n */export default function TextGlitch(props){const{text,font,color,scrambleColor,duration,style,glitch}=props;const[display,setDisplay]=useState(text);const[scrambling,setScrambling]=useState(false);const intervalRef=useRef(null);const timeoutRef=useRef(null);// Use prop or default\nconst chars=(props.scrambleChars||DEFAULT_SCRAMBLE_CHARS).split(\"\");useEffect(()=>{if(!glitch){setDisplay(text);setScrambling(false);return;}if(RenderTarget.current()!==RenderTarget.preview){setDisplay(text);setScrambling(false);return;}if(RenderTarget.current()===RenderTarget.thumbnail){setDisplay(text);setScrambling(false);return;}setDisplay(text);setScrambling(true);let frame=0;const scramble=()=>{const percent=Math.max(0,Math.min(100,props.scramblePercent??100));let scrambled=text.split(\"\").map((c,i)=>{if(c===\" \")return c;if(Math.random()*100>percent)return c;return`<span data-scramble=\"1\">${chars[Math.floor(Math.random()*chars.length)]}</span>`;}).join(\"\");setDisplay(scrambled);frame++;};intervalRef.current=window.setInterval(scramble,props.speed||40);timeoutRef.current=window.setTimeout(()=>{if(intervalRef.current)clearInterval(intervalRef.current);setDisplay(text);setScrambling(false);},duration);return()=>{if(intervalRef.current)clearInterval(intervalRef.current);if(timeoutRef.current)clearTimeout(timeoutRef.current);};},[text,duration,glitch,props.scrambleChars])// Add scrambleChars as dependency\n;function renderText(){const{weight,optical}=props.variable||{weight:400,optical:22};const fontVariation={fontWeight:weight,fontVariationSettings:`'wght' ${weight}, 'opsz' ${optical}`};const styleBase={...font,color,...fontVariation};if(!scrambling)return /*#__PURE__*/_jsx(\"span\",{style:styleBase,children:text});const parts=display.split(/(<span data-scramble=\"1\">.*?<\\/span>)/g);return /*#__PURE__*/_jsx(\"span\",{style:styleBase,children:parts.map((part,i)=>{if(part.startsWith('<span data-scramble=\"1\">')){const letter=part.replace(/<.*?>/g,\"\");return /*#__PURE__*/_jsx(\"span\",{style:{color:scrambleColor},children:letter},i);}return /*#__PURE__*/_jsx(\"span\",{children:part},i);})});}const isFixedWidth=style&&style.width===\"100%\";const isFixedHeight=style&&style.height===\"100%\";return /*#__PURE__*/_jsx(\"div\",{style:{...style,position:\"relative\",width:isFixedWidth?\"100%\":\"max-content\",minWidth:isFixedWidth?undefined:\"max-content\",height:isFixedHeight?\"100%\":undefined},children:renderText()});}TextGlitch.displayName=\"Text Glitch\";addPropertyControls(TextGlitch,{text:{type:ControlType.String,title:\"Text\",defaultValue:\"Scramble Me!\"},font:{type:ControlType.Font,title:\"Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:22,variant:\"Semibold\",letterSpacing:\"-0.01em\",lineHeight:\"1.2em\"}},variable:{type:ControlType.Object,title:\"Variable\",controls:{optical:{type:ControlType.Number,title:\"Optical\",defaultValue:22,min:14,max:32,step:1},weight:{type:ControlType.Number,title:\"Weight\",defaultValue:400,min:100,max:900,step:1}},defaultValue:{optical:22,weight:400}},color:{type:ControlType.Color,title:\"Color\",defaultValue:\"#000000\"},scrambleColor:{type:ControlType.Color,title:\"Scrambled\",defaultValue:\"#8855FF\"},scrambleChars:{// <-- Add the control\ntype:ControlType.String,title:\"Chars\",defaultValue:DEFAULT_SCRAMBLE_CHARS,displayTextArea:true},scramblePercent:{type:ControlType.Number,title:\"Scramble %\",defaultValue:100,min:0,max:100,unit:\"%\",step:1},speed:{type:ControlType.Number,title:\"Speed\",defaultValue:40,min:10,max:200,unit:\"ms\",step:1},duration:{type:ControlType.Number,title:\"Duration\",defaultValue:1200,min:200,max:5e3,unit:\"ms\",step:50},glitch:{type:ControlType.Boolean,title:\"Glitch\",enabledTitle:\"Yes\",disabledTitle:\"No\",defaultValue:true,description:\"More components at [Framer University](https://frameruni.link/cc).\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"TextGlitch\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerContractVersion\":\"1\",\"framerDisableUnlink\":\"\",\"framerIntrinsicWidth\":\"400\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerIntrinsicHeight\":\"200\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./TextGlitch_Prod.map","// Generated by Framer (6964d48)\nimport{fontStore}from\"framer\";fontStore.loadFonts([\"FS;Poppins-regular\",\"FS;Poppins-bold\",\"FS;Poppins-bold italic\",\"FS;Poppins-italic\"]);export const fonts=[{explicitInter:true,fonts:[{cssFamilyName:\"Poppins\",openType:true,source:\"fontshare\",style:\"normal\",uiFamilyName:\"Poppins\",url:\"https://framerusercontent.com/third-party-assets/fontshare/wf/NC2MP33RO4WQTSTEEAWBJLAEXNCNEQVF/7F4U3COKLHQH4WUH3AXPC7N4UELEWJQN/JMWNCAGBH3TLANIVQPVABVAVNV5QERTH.woff2\",weight:\"400\"},{cssFamilyName:\"Poppins\",openType:true,source:\"fontshare\",style:\"normal\",uiFamilyName:\"Poppins\",url:\"https://framerusercontent.com/third-party-assets/fontshare/wf/EOHGWBZYYKO6R4PWP4S2B3FFWHHBEZN6/UWQLMF4AFWLXCJQCFV3WRVYC77KZXPRB/FYG6OCH7XOLUUSZTIZE65ATBZWF623O4.woff2\",weight:\"700\"},{cssFamilyName:\"Poppins\",openType:true,source:\"fontshare\",style:\"italic\",uiFamilyName:\"Poppins\",url:\"https://framerusercontent.com/third-party-assets/fontshare/wf/JQL34MORONR7D7BXOVTX3KBGJGEJQ5BJ/CKUZVY5SFANCFAT7FS3MP6ZL4BMEWCJE/NOLRWF3JBJ434MILPG5RB6R2B4HGRSZB.woff2\",weight:\"700\"},{cssFamilyName:\"Poppins\",openType:true,source:\"fontshare\",style:\"italic\",uiFamilyName:\"Poppins\",url:\"https://framerusercontent.com/third-party-assets/fontshare/wf/7LLTLAW3NRWOADG4II2JGKZC6OSEMBQC/EYFXWX77PEMPU645EAWOTG22E375GULW/SSNNTU67MMJH4CSWT443B4KJ7OB4WFHF.woff2\",weight:\"400\"}]}];export const css=['.framer-iz5vb .framer-styles-preset-1y92u4j:not(.rich-text-wrapper), .framer-iz5vb .framer-styles-preset-1y92u4j.rich-text-wrapper p { --framer-font-family: \"Poppins\", \"Poppins Placeholder\", sans-serif; --framer-font-family-bold: \"Poppins\", \"Poppins Placeholder\", sans-serif; --framer-font-family-bold-italic: \"Poppins\", \"Poppins Placeholder\", sans-serif; --framer-font-family-italic: \"Poppins\", \"Poppins Placeholder\", sans-serif; --framer-font-open-type-features: \\'blwf\\' on, \\'cv09\\' on, \\'cv03\\' on, \\'cv04\\' on, \\'cv11\\' on; --framer-font-size: 14px; --framer-font-style: normal; --framer-font-style-bold: normal; --framer-font-style-bold-italic: italic; --framer-font-style-italic: italic; --framer-font-variation-axes: normal; --framer-font-weight: 400; --framer-font-weight-bold: 700; --framer-font-weight-bold-italic: 700; --framer-font-weight-italic: 400; --framer-letter-spacing: 0em; --framer-line-height: 1.3em; --framer-paragraph-spacing: 20px; --framer-text-alignment: start; --framer-text-color: var(--token-acae0666-90aa-46af-a801-e588bb406a03, #858b94); --framer-text-decoration: none; --framer-text-stroke-color: initial; --framer-text-stroke-width: initial; --framer-text-transform: none; }'];export const className=\"framer-iz5vb\";\nexport const __FramerMetadata__ = {\"exports\":{\"css\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"fonts\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"className\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}","// Generated by Framer (5186692)\nexport default function metadata(params,activeLocale){return{description:\"freyamedia is a Johannesburg-based creative agency specialising in strategic brand and social content. We help businesses around the world put feeling into their brand and build a loyal fanbase.\",favicon:\"https://framerusercontent.com/assets/FJZqclgxpNzOCi8SftxwhLHT2s.png\",robots:\"max-image-preview:large\",socialImage:\"https://framerusercontent.com/assets/HPSy1hKreuDe5cFi0g5hlab1YU.jpg\",title:\"Strategic Brand & Social Content Agency | freyamedia Johannesburg\"};}export const metadataVersion=1;\nexport const __FramerMetadata__ = {\"exports\":{\"metadataVersion\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"default\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}"],"mappings":"oNAMG,SAAwB,EAAW,EAAM,CAAC,GAAK,CAAC,OAAK,OAAK,QAAM,gBAAc,WAAS,QAAM,UAAQ,EAAW,CAAC,EAAQ,GAAYA,EAAS,CAAI,EAAO,CAAC,EAAW,GAAeA,EAAS,EAAK,EAAQ,EAAYC,EAAO,IAAI,EAAQ,EAAWA,EAAO,IAAI,EAC5P,GAAO,EAAM,eAAe,EAAA,CAAwB,MAAM,EAAE,EAAE,MAAc,CAAC,GAAG,CAAC,EAAO,CAAC,EAAW,CAAI,EAAE,EAAc,EAAK,EAAE,MAAO,CAAC,GAAG,EAAa,QAAQ,IAAI,EAAa,QAAQ,CAAC,EAAW,CAAI,EAAE,EAAc,EAAK,EAAE,MAAO,CAAC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