{"version":3,"file":"ConditionalStack.Clv-taRA.mjs","names":[],"sources":["https:/framerusercontent.com/modules/3sSnW0JO8AHZDeUz6qK6/UTcGjdbc4e7UOcZnCzh8/ConditionalStack.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function ConditionalStack(props){const{paramName,rules,children,style}=props;useEffect(()=>{if(typeof window===\"undefined\")return;if(!paramName||!rules||rules.length===0)return;const urlParams=new URLSearchParams(window.location.search);const actual=urlParams.get(paramName);const matchedRules=rules.filter(r=>r.stackName&&r.paramValue===actual);const defaultRules=rules.filter(r=>r.stackName&&r.paramValue===\"*\");const activeRules=matchedRules.length>0?matchedRules:defaultRules;const controlledStacks=new Set;activeRules.forEach(({stackName})=>controlledStacks.add(stackName));const allConfiguredStacks=new Set;rules.forEach(({stackName})=>{if(stackName)allConfiguredStacks.add(stackName);});activeRules.forEach(({stackName,action})=>{const el=document.querySelector(`[data-framer-name=\"${stackName}\"]`);if(!el)return;el.style.display=action===\"show\"?\"\":\"none\";});allConfiguredStacks.forEach(stackName=>{if(controlledStacks.has(stackName))return;const el=document.querySelector(`[data-framer-name=\"${stackName}\"]`);if(!el)return;el.style.display=\"\";});},[paramName,rules]);return /*#__PURE__*/_jsx(\"div\",{style:{...style,width:\"1px\",height:\"1px\",position:\"absolute\",opacity:0,pointerEvents:\"none\"},children:children});}addPropertyControls(ConditionalStack,{paramName:{type:ControlType.String,title:\"URL Parameter\",description:\"Name of the URL parameter to check (e.g. utm_medium)\",defaultValue:\"utm_medium\",placeholder:\"utm_medium\"},rules:{type:ControlType.Array,title:\"Rules\",control:{type:ControlType.Object,controls:{paramValue:{type:ControlType.String,title:\"When Value Is\",description:\"URL param value to match. Use * for default/fallback.\",defaultValue:\"*\",placeholder:\"ceo, hr, * ...\"},stackName:{type:ControlType.String,title:\"Stack Name\",description:\"data-framer-name of the stack\",defaultValue:\"\",placeholder:\"Enter stack name...\"},action:{type:ControlType.Enum,title:\"Action\",options:[\"show\",\"hide\"],optionTitles:[\"Show\",\"Hide\"],defaultValue:\"show\",displaySegmentedControl:true}}},defaultValue:[{paramValue:\"*\",stackName:\"\",action:\"show\"}]},children:{type:ControlType.Slot,title:\"Content\",hidden:()=>true}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ConditionalStack\",\"slots\":[\"children\"],\"annotations\":{\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ConditionalStack.map"],"mappings":"wLAGG,SAAwB,EAAiB,EAAM,CAAC,GAAK,CAAC,YAAU,QAAM,WAAS,SAAO,EAA4+B,OAAt+B,MAAc,CAAuC,GAA5B,IAAS,QAAsB,CAAC,GAAW,CAAC,GAAO,EAAM,SAAS,EAAE,OAAmE,IAAM,EAAlD,IAAI,gBAAgB,EAAO,SAAS,OAAO,CAAwB,IAAI,EAAU,CAAO,EAAa,EAAM,OAAO,GAAG,EAAE,WAAW,EAAE,aAAa,EAAO,CAAO,EAAa,EAAM,OAAO,GAAG,EAAE,WAAW,EAAE,aAAa,IAAI,CAAO,EAAY,EAAa,OAAO,EAAE,EAAa,EAAmB,EAAiB,IAAI,IAAI,EAAY,SAAS,CAAC,eAAa,EAAiB,IAAI,EAAU,CAAC,CAAC,IAAM,EAAoB,IAAI,IAAI,EAAM,SAAS,CAAC,eAAa,CAAI,GAAU,EAAoB,IAAI,EAAU,EAAG,CAAC,EAAY,SAAS,CAAC,YAAU,YAAU,CAAC,IAAM,EAAG,SAAS,cAAc,sBAAsB,EAAU,IAAI,CAAK,IAAU,EAAG,MAAM,QAAQ,IAAS,OAAO,GAAG,SAAS,CAAC,EAAoB,QAAQ,GAA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