{"version":3,"file":"LogOutButton.C7csEJs8.mjs","names":["useRef","_Fragment"],"sources":["https:/framerusercontent.com/modules/S9nnUOhZS575Kt2ac63u/86E3ZbSGPB7g9fm1SI5V/LogOutButton.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,Link}from\"framer\";import{useRef}from\"react\";import{StandardButton,standardButtonPropertyControls}from\"https://framerusercontent.com/modules/diyk5889JEo4mM5y5sJr/k488EAt1FhWtVFD0n6vD/ThentyShared.js\";import{thentyAuth}from\"https://cdn.thenty.io/beta/thenty-sdk.min.js\";/**\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any\n * @framerIntrinsicWidth 300\n * @framerDisableUnlink\n */export default function LogOutButton(props){const{text,redirectLink,redirectDelay}=props;const ref=useRef(null);const redirectLinkRef=useRef(null);const onClick=()=>{localStorage.removeItem(thentyAuth.fetchAuthorizationKey());if(redirectLink&&redirectLinkRef.current){if(redirectDelay>0){setTimeout(()=>{redirectLinkRef.current.click();},redirectDelay*1e3);}else{redirectLinkRef.current.click();}}else if(!window.location.origin.endsWith(\".framercanvas.com\")){window.location.reload();}};return /*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(StandardButton,{ref:ref,...props,onClick:onClick,children:text}),redirectLink&&/*#__PURE__*/_jsx(Link,{ref:redirectLinkRef,href:redirectLink,openInNewTab:false,smoothScroll:false,children:/*#__PURE__*/_jsx(\"a\",{style:{display:\"none\"}})})]});}LogOutButton.displayName=\"Log Out Button\";addPropertyControls(LogOutButton,{text:{type:ControlType.String,placeholder:\"Button Text\",defaultValue:\"Log Out\"},redirectLink:{type:ControlType.Link,title:\"Redirect\"},redirectDelay:{type:ControlType.Number,defaultValue:0,min:0,step:.1,displayStepper:true,title:\"Delay\"},...standardButtonPropertyControls({})});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"LogOutButton\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerIntrinsicWidth\":\"300\",\"framerSupportedLayoutHeight\":\"any\",\"framerDisableUnlink\":\"\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}"],"mappings":"sgBAKG,SAAwB,EAAa,EAAM,CAAC,GAAK,CAAC,OAAK,eAAa,iBAAe,EAAY,EAAIA,EAAO,KAAK,CAAO,EAAgBA,EAAO,KAAK,CAAO,MAAY,CAAC,aAAa,WAAW,EAAW,uBAAuB,CAAC,CAAI,GAAc,EAAgB,QAAY,EAAc,EAAG,eAAe,CAAC,EAAgB,QAAQ,OAAO,EAAG,EAAc,IAAI,CAAO,EAAgB,QAAQ,OAAO,CAAY,EAAO,SAAS,OAAO,SAAS,oBAAoB,EAAE,EAAO,SAAS,QAAQ,EAAI,OAAoB,EAAMC,EAAU,CAAC,SAAS,CAAc,EAAK,EAAe,CAAK,MAAI,GAAG,EAAc,UAAQ,SAAS,EAAK,CAAC,CAAC,GAA2B,EAAK,EAAK,CAAC,IAAI,EAAgB,KAAK,EAAa,aAAa,GAAM,aAAa,GAAM,SAAsB,EAAK,IAAI,CAAC,MAAM,CAAC,QAAQ,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,sBAL7sB,IAAyD,IAA0B,IAA2J,IAAqE,CAK4Z,EAAa,YAAY,iBAAiB,EAAoB,EAAa,CAAC,KAAK,CAAC,KAAK,EAAY,OAAO,YAAY,cAAc,aAAa,UAAU,CAAC,aAAa,CAAC,KAAK,EAAY,KAAK,MAAM,WAAW,CAAC,cAAc,CAAC,KAAK,EAAY,OAAO,aAAa,EAAE,IAAI,EAAE,KAAK,GAAG,eAAe,GAAK,MAAM,QAAQ,CAAC,GAAG,EAA+B,EAAE,CAAC,CAAC,CAAC"}