{"version":3,"file":"VariantURLAppender.BJH5sDSZ.mjs","names":[],"sources":["https:/framerusercontent.com/modules/tFZGQfPYoznfQdCswbff/aj3KWMtKzAINaAz8vRPk/VariantURLAppender.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useEffect}from\"react\";/**\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n * @framerIntrinsicWidth 1\n * @framerIntrinsicHeight 1\n */export default function VariantURLSetter({enabled=true,parameter=\"s\",value=\"\",delay=0}){useEffect(()=>{if(!enabled||!parameter||!value)return;const updateURL=()=>{try{// Get current URL parameters\nconst urlParams=new URLSearchParams(window.location.search);// Convert value to lowercase\nconst lowercaseValue=value.toLowerCase();// Set or update the parameter\nurlParams.set(parameter,lowercaseValue);// Update URL without page reload\nconst newURL=`${window.location.pathname}?${urlParams.toString()}`;window.history.pushState({},\"\",newURL);}catch(error){console.error(\"VariantURLSetter error:\",error);}};// Execute after delay\nconst timer=setTimeout(updateURL,delay);return()=>clearTimeout(timer);},[enabled,parameter,value,delay]);// Return invisible div\nreturn /*#__PURE__*/_jsx(\"div\",{style:{width:1,height:1,opacity:0,pointerEvents:\"none\"}});}VariantURLSetter.displayName=\"Variant URL Setter\";addPropertyControls(VariantURLSetter,{enabled:{type:ControlType.Boolean,title:\"Enabled\",defaultValue:true},parameter:{type:ControlType.String,title:\"Parameter\",defaultValue:\"s\",description:\"URL parameter name (e.g., 's' for ?s=value)\"},value:{type:ControlType.String,title:\"Value\",defaultValue:\"\",description:\"Parameter value (will be lowercased)\"},delay:{type:ControlType.Number,title:\"Delay (ms)\",defaultValue:0,min:0,max:5e3,step:100,description:\"Delay before setting URL parameter\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"VariantURLSetter\",\"slots\":[],\"annotations\":{\"framerIntrinsicHeight\":\"1\",\"framerContractVersion\":\"1\",\"framerIntrinsicWidth\":\"1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