{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/A0cSh0OMYPnn7nOpMrps/GQUEO4d0xxmHaXwxZUtm/ThentyOrderButton.js"],
  "sourcesContent": ["import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{useMemo,useState}from\"react\";import{addPropertyControls,ControlType,withCSS}from\"framer\";import{motion}from\"framer-motion\";import{useThenty}from\"https://framer.com/m/ThentyHelpers-I0Oh.js\";import{thentyAuth}from\"https://cdn.thenty.io/beta/thenty-sdk.min.js\";const useBorder=({borderRadius,customBorderRadius,topLeftRadius,topRightRadius,bottomRightRadius,bottomLeftRadius,borderColor,borderWidth})=>{const borderStyle=useMemo(()=>({border:`${borderWidth}px solid ${borderColor}`,borderRadius:customBorderRadius?`${topLeftRadius}px ${topRightRadius}px ${bottomRightRadius}px ${bottomLeftRadius}px`:`${borderRadius}px`}),[borderRadius,customBorderRadius,topLeftRadius,topRightRadius,bottomRightRadius,bottomLeftRadius,borderColor,borderWidth]);return borderStyle;};const useInputStyles=({textColor,buttonFill,hoverButtonFill,hoverTextColor,customPadding,padding,paddingTop,paddingRight,paddingBottom,paddingLeft})=>{const inputStyles=useMemo(()=>({padding:customPadding?`${paddingTop}px ${paddingRight}px ${paddingBottom}px ${paddingLeft}px`:`${padding}px`,background:buttonFill,color:textColor,\"&: hover\":{background:hoverButtonFill,color:hoverTextColor}}),[textColor,buttonFill,hoverButtonFill,hoverTextColor,customPadding,padding,paddingTop,paddingRight,paddingBottom,paddingLeft]);return inputStyles;};/**\n * These annotations control how your component sizes\n * Learn more: https://www.framer.com/developers/#code-components-auto-sizing\n *\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n */const ThentyOrderButton=withCSS(function ThentyOrderButton(props){const{authorization,siteMeta}=useThenty();const[isLoading,setIsLoading]=useState(null);const{colorPalette,border,font,customPadding,paddingTop,paddingRight,paddingBottom,paddingLeft,padding,tierId,align,label}=props;const{buttonFill,textColor,hoverButtonFill,hoverTextColor,borderColor}=colorPalette;const paddingProps={customPadding,paddingTop,paddingRight,paddingBottom,paddingLeft,padding};const inputBorderStyle=useBorder(border);const inputStyle=useInputStyles({...colorPalette,...paddingProps});const containerTokens={\"--rhkt-subscribe-button-padding\":inputStyle.padding,\"--rhkt-subscribe-button-border-radius\":inputBorderStyle.borderRadius,\"--rhkt-subscribe-button-border\":inputBorderStyle.border,\"--rhkt-subscribe-button-color\":inputStyle.color,\"--rhkt-subscribe-button-fill\":inputStyle.background,\"--rhkt-subscribe-button-align\":align,\"--rhkt-subscribe-button-color-hover\":hoverTextColor,\"--rhkt-subscribe-button-fill-hover\":hoverButtonFill};const onSubmit=data=>{var _window_Rewardful,_window,_authorization_authorization;setIsLoading(true);if(!authorization){if(siteMeta===null||siteMeta===void 0?void 0:siteMeta.sign_up_redirect_path){window.location.href=`/${siteMeta===null||siteMeta===void 0?void 0:siteMeta.sign_up_redirect_path}?planID=${tierId}`;return;}else{console.error(\"No login redirect patch configured in thenty dashboard\");}return;}let params=\"\";if((_window=window)===null||_window===void 0?void 0:(_window_Rewardful=_window.Rewardful)===null||_window_Rewardful===void 0?void 0:_window_Rewardful.referral){params=`?rewardfulClientReferenceId=${window.Rewardful.referral}`;}thentyAuth.fetchGeneric(`/payments/order/${tierId}${params}`,\"GET\",null,authorization===null||authorization===void 0?void 0:(_authorization_authorization=authorization.authorization)===null||_authorization_authorization===void 0?void 0:_authorization_authorization.key).then(responseBody=>{setIsLoading(false);window.open(responseBody.redirect_url,\"_self\");}).catch(err=>{setIsLoading(false);if(err.redirect_url)window.location.href=err.redirect_url;});};return /*#__PURE__*/_jsx(\"button\",{className:\"rhkt-subscribe-button\",style:{width:\"100%\",height:\"100%\",...font,...containerTokens},onClick:onSubmit,children:isLoading?/*#__PURE__*/_jsx(motion.div,{style:{...containerTokens,position:\"relative\",width:\"100%\",height:\"100%\",display:\"flex\",justifyContent:\"center\",alignItems:\"center\",flexDirection:\"column\"},children:/*#__PURE__*/_jsx(Spinner,{size:\"large\"})}):/*#__PURE__*/_jsx(_Fragment,{children:label})});},[`.rhkt-subscribe-button {\n            cursor: pointer;\n            margin: 0;\n            \n            padding: var(--rhkt-subscribe-button-padding);\n            border-radius: var(--rhkt-subscribe-button-border-radius);\n            border: var(--rhkt-subscribe-button-border);\n            color: var(--rhkt-subscribe-button-color);\n            background-color: var(--rhkt-subscribe-button-fill);\n            text-align: var(--rhkt-subscribe-button-align);\n            outline: none;\n            transition: 0.1s ease-in\n      }`,`.rhkt-subscribe-button:hover {\n            cursor: pointer;\n            color: var(--rhkt-subscribe-button-color-hover);\n            background-color: var(--rhkt-subscribe-button-fill-hover);\n      }`]);function Spinner({size=\"small\"}){const{width,height}={small:{width:16,height:16},large:{width:32,height:32}}[size];return /*#__PURE__*/_jsx(motion.div,{initial:{rotate:0},animate:{rotate:360},transition:{duration:2,repeat:Infinity},children:/*#__PURE__*/_jsxs(\"svg\",{xmlns:\"http://www.w3.org/2000/svg\",style:{height,width},viewBox:\"0 0 16 16\",children:[/*#__PURE__*/_jsx(\"path\",{d:\"M 8 0 C 3.582 0 0 3.582 0 8 C 0 12.419 3.582 16 8 16 C 12.418 16 16 12.419 16 8 C 15.999 3.582 12.418 0 8 0 Z M 8 14 C 4.687 14 2 11.314 2 8 C 2 4.687 4.687 2 8 2 C 11.314 2 14 4.687 14 8 C 14 11.314 11.314 14 8 14 Z\",fill:\"currentColor\",opacity:\"0.2\"}),/*#__PURE__*/_jsx(\"path\",{d:\"M 8 0 C 12.418 0 15.999 3.582 16 8 C 16 8 16 9 15 9 C 14 9 14 8 14 8 C 14 4.687 11.314 2 8 2 C 4.687 2 2 4.687 2 8 C 2 8 2 9 1 9 C 0 9 0 8 0 8 C 0 3.582 3.582 0 8 0 Z\",fill:\"currentColor\"})]})});}// Styles are written in object syntax\n// Learn more: https://reactjs.org/docs/dom-elements.html#style\nThentyOrderButton.defaultProps={label:\"Subscribe\",tierId:\"xxxxxxx\",colorPalette:{buttonFill:\"#000000\",textColor:\"#ffffff\",hoverButtonFill:\"#E8E8E8\",hoverTextColor:\"#C70000\"},border:{borderRadius:8,borderWidth:0,borderColor:\"#FAFAFA\",customBorderRadius:false},align:\"center\",padding:15,customPadding:false};addPropertyControls(ThentyOrderButton,{label:{title:\"Button Text\",type:ControlType.String,defaultValue:\"Subscribe\"},tierId:{title:\"Product ID\",type:ControlType.String,defaultValue:\"xxxxxxxx\"},colorPalette:{title:\"Color Palette\",type:ControlType.Object,controls:{buttonFill:{title:\"Button Fill\",type:ControlType.Color,defaultValue:\"#000000\"},textColor:{title:\"Text Color\",type:ControlType.Color,defaultValue:\"#FFFFFF\"},hoverButtonFill:{title:\"Hover Button Fill\",type:ControlType.Color,defaultValue:\"#ffffff\"},hoverTextColor:{title:\"Hover Text Color\",type:ControlType.Color,defaultValue:\"#000000\"}}},border:{title:\"Border\",type:ControlType.Object,controls:{borderRadius:{title:\"Radius\",type:ControlType.FusedNumber,toggleKey:\"customBorderRadius\",toggleTitles:[\"Radius\",\"Custom radius\"],valueKeys:[\"topLeftRadius\",\"topRightRadius\",\"bottomRightRadius\",\"bottomLeftRadius\"],valueLabels:[\"Top Left\",\"Top Right\",\"Bottom Right\",\"Bottom Left\"],min:0},borderWidth:{title:\"Width\",type:ControlType.Number,displayStepper:true,defaultValue:0,min:0},borderColor:{title:\"Color\",type:ControlType.Color,defaultValue:\"#FAFAFA\"}}},align:{type:ControlType.Enum,defaultValue:\"center\",displaySegmentedControl:true,segmentedControlDirection:\"vertical\",options:[\"center\",\"left\",\"right\"],optionTitles:[\"Center\",\"Left\",\"Right\"]},padding:{type:ControlType.FusedNumber,toggleKey:\"customPadding\",toggleTitles:[\"Padding\",\"Custom padding\"],valueKeys:[\"paddingTop\",\"paddingRight\",\"paddingBottom\",\"paddingLeft\"],valueLabels:[\"Top\",\"Right\",\"Bottom\",\"Left\"],min:0,title:\"Input Inner Padding\"},font:{type:\"font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:14,lineHeight:1.5}}});export default ThentyOrderButton;\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ThentyOrderButton\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any\",\"framerSupportedLayoutHeight\":\"any\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ThentyOrderButton.map"],
  "mappings": "6NAAwV,IAAMA,EAAU,CAAC,CAAC,aAAAC,EAAa,mBAAAC,EAAmB,cAAAC,EAAc,eAAAC,EAAe,kBAAAC,EAAkB,iBAAAC,EAAiB,YAAAC,EAAY,YAAAC,CAAW,IAAuBC,EAAQ,KAAK,CAAC,OAAO,GAAGD,CAAW,YAAYD,CAAW,GAAG,aAAaL,EAAmB,GAAGC,CAAa,MAAMC,CAAc,MAAMC,CAAiB,MAAMC,CAAgB,KAAK,GAAGL,CAAY,IAAI,GAAG,CAACA,EAAaC,EAAmBC,EAAcC,EAAeC,EAAkBC,EAAiBC,EAAYC,CAAW,CAAC,EAA6BE,EAAe,CAAC,CAAC,UAAAC,EAAU,WAAAC,EAAW,gBAAAC,EAAgB,eAAAC,EAAe,cAAAC,EAAc,QAAAC,EAAQ,WAAAC,EAAW,aAAAC,EAAa,cAAAC,EAAc,YAAAC,CAAW,IAAuBX,EAAQ,KAAK,CAAC,QAAQM,EAAc,GAAGE,CAAU,MAAMC,CAAY,MAAMC,CAAa,MAAMC,CAAW,KAAK,GAAGJ,CAAO,KAAK,WAAWJ,EAAW,MAAMD,EAAU,WAAW,CAAC,WAAWE,EAAgB,MAAMC,CAAc,CAAC,GAAG,CAACH,EAAUC,EAAWC,EAAgBC,EAAeC,EAAcC,EAAQC,EAAWC,EAAaC,EAAcC,CAAW,CAAC,EAM90CC,EAAkBC,EAAQ,SAA2BC,EAAM,CAAC,GAAK,CAAC,cAAAC,EAAc,SAAAC,CAAQ,EAAEC,EAAU,EAAO,CAACC,EAAUC,CAAY,EAAE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AAE,MAAM,CAAC,KAAKA,EAAY,KAAK,aAAa,SAAS,wBAAwB,GAAK,0BAA0B,WAAW,QAAQ,CAAC,SAAS,OAAO,OAAO,EAAE,aAAa,CAAC,SAAS,OAAO,OAAO,CAAC,EAAE,QAAQ,CAAC,KAAKA,EAAY,YAAY,UAAU,gBAAgB,aAAa,CAAC,UAAU,gBAAgB,EAAE,UAAU,CAAC,aAAa,eAAe,gBAAgB,aAAa,EAAE,YAAY,CAAC,MAAM,QAAQ,SAAS,MAAM,EAAE,IAAI,EAAE,MAAM,qBAAqB,EAAE,KAAK,CAAC,KAAK,OAAO,SAAS,WAAW,gBAAgB,aAAa,aAAa,CAAC,SAAS,GAAG,WAAW,GAAG,CAAC,CAAC,CAAC,EAAE,IAAOC,GAAQvC",
  "names": ["useBorder", "borderRadius", "customBorderRadius", "topLeftRadius", "topRightRadius", "bottomRightRadius", "bottomLeftRadius", "borderColor", "borderWidth", "se", "useInputStyles", "textColor", "buttonFill", "hoverButtonFill", "hoverTextColor", "customPadding", "padding", "paddingTop", "paddingRight", "paddingBottom", "paddingLeft", "ThentyOrderButton", "withCSS", "props", "authorization", "siteMeta", "useThenty", "isLoading", "setIsLoading", "ye", "colorPalette", "border", "font", "tierId", "align", "label", "paddingProps", "inputBorderStyle", "inputStyle", "containerTokens", "onSubmit", "data", "_window_Rewardful", "_window", "_authorization_authorization", "window", "params", "thentyAuth", "responseBody", "err", "p", "motion", "Spinner", "l", "size", "width", "height", "u", "addPropertyControls", "ControlType", "ThentyOrderButton_default"]
}
