{"version":3,"file":"ParameterBasedVisibility.D_MbNU-C.mjs","names":[],"sources":["https:/framerusercontent.com/modules/FqHP1LP6tSB1za94p4WH/QjRn4GA4JA563MUvsXvG/ParameterBasedVisibility.js"],"sourcesContent":["// This module shows or hides elements based on the presence of URL parameters.\n// Last updated by @joshua on 20241126.\nimport{jsx as _jsx}from\"react/jsx-runtime\";// Code override that displays the wrapped component if 'switch=true' is present in the URL.\nexport function withShowOnSwitch(WrappedComponent){return props=>{// Check if the code is running in a browser environment.\nconst isBrowser=typeof window!==\"undefined\";// Parse URL parameters if in a browser.\nconst urlParams=isBrowser?new URLSearchParams(window.location.search):null;// Determine visibility based on the 'switch' parameter.\nconst isVisible=(urlParams===null||urlParams===void 0?void 0:urlParams.get(\"switch\"))===\"true\";// Define the style to conditionally display the component.\nconst componentStyle={...props.style,display:isVisible?\"flex\":\"none\"};return /*#__PURE__*/_jsx(WrappedComponent,{...props,style:componentStyle});};}// Code override that hides the wrapped component if 'switch=true' is present in the URL.\nexport function withHideOnSwitch(WrappedComponent){return props=>{// Check if the code is running in a browser environment.\nconst isBrowser=typeof window!==\"undefined\";// Parse URL parameters if in a browser.\nconst urlParams=isBrowser?new URLSearchParams(window.location.search):null;// Determine visibility based on the 'switch' parameter.\nconst isHidden=(urlParams===null||urlParams===void 0?void 0:urlParams.get(\"switch\"))===\"true\";// Define the style to conditionally hide the component.\nconst componentStyle={...props.style,display:isHidden?\"none\":\"flex\"};return /*#__PURE__*/_jsx(WrappedComponent,{...props,style:componentStyle});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withShowOnSwitch\":{\"type\":\"reactHoc\",\"name\":\"withShowOnSwitch\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withHideOnSwitch\":{\"type\":\"reactHoc\",\"name\":\"withHideOnSwitch\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ParameterBasedVisibility.map"],"mappings":"qHAGO,SAAS,EAAiB,EAAiB,CAAC,MAAO,CAAA,GAAO,CAIjE,IAHM,EAAiB,WACjB,EAAU,EAAU,IAAI,gBAAgB,EAAO,SAAS,QAAQ,KAChE,EAAuD,AAA5C,GAAsD,IAAI,SAAS,GAAI,OAClF,EAAe,CAAC,GAAG,EAAM,MAAM,QAAQ,EAAU,OAAO,MAAO,EAAC,MAAoB,GAAK,EAAiB,CAAC,GAAG,EAAM,MAAM,CAAe,EAAC,AAAE,CAAE,CAC7I,SAAS,EAAiB,EAAiB,CAAC,MAAO,CAAA,GAAO,CAIjE,IAHM,EAAiB,WACjB,EAAU,EAAU,IAAI,gBAAgB,EAAO,SAAS,QAAQ,KAChE,EAAsD,AAA5C,GAAsD,IAAI,SAAS,GAAI,OACjF,EAAe,CAAC,GAAG,EAAM,MAAM,QAAQ,EAAS,OAAO,MAAO,EAAC,MAAoB,GAAK,EAAiB,CAAC,GAAG,EAAM,MAAM,CAAe,EAAC,AAAE,CAAE,cAVnJ,AAYoD,IAZpD,GAA2C"}