@stigg/react-sdk 9.0.0 → 10.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import {e,f,i,j,a,g,b,h,c,p,w,u,v,d,x,y,z,B,G,A,H as H$1,C,I,q,r,K,o,l,m,n,k}from'./chunk-PTY4FPOJ.esm.js';export{s as StiggContext,t as StiggProvider,D as useActiveSubscriptions,x as useBooleanEntitlement,A as useCreditEntitlement,L as useCreditUsage,F as useCustomerPortal,B as useEnumEntitlement,z as useMeteredEntitlement,y as useNumericEntitlement,E as usePaywall,u as useStiggContext}from'./chunk-PTY4FPOJ.esm.js';import {BillingModel,PaymentCollection,SubscriptionStatus,PricingType,BillingPeriod,SubscriptionScheduleType,ThresholdType,DiscountType,DiscountDurationType,Currency,BillingVendorIdentifier,CreditGrantType,WidgetType,BillingCadence,FontWeight,MeterType,EntitlementResetPeriod,TiersMode,Alignment,CreditCadence,SubscriptionProrationBehavior,SubscriptionBillingCycleAnchor}from'@stigg/js-client-sdk';export*from'@stigg/js-client-sdk';import hi,{forwardRef,lazy,useContext,useMemo,useState,useEffect,Suspense,useCallback,useRef,createElement}from'react';import Wu from'classnames';import Re from'@mui/material/Grid/index.js';import xc from'lodash/compact.js';import {NumericFormat,numericFormatter}from'react-number-format';import {jsx,jsxs,Fragment}from'react/jsx-runtime';import Ya from'lodash/isFunction.js';import Fo from'lodash/isNil.js';import iu from'react-spinners/ClipLoader.js';import {css,useTheme}from'@emotion/react';import Bo from'dayjs';import Km from'dayjs/plugin/utc.js';import qm from'dayjs/plugin/relativeTime.js';import Jm from'dayjs/plugin/advancedFormat.js';import ou from'lodash/sum.js';import yu from'currency-symbol-map';import wu from'@mui/material/InputAdornment/index.js';import Pu,{buttonClasses}from'@mui/material/Button/index.js';import Su from'@mui/material/TextField/index.js';import Ml from'@mui/material/Divider/index.js';import Bu from'@mui/material/OutlinedInput/index.js';import Au from'@mui/material/Select/index.js';import Iu from'@mui/material/MenuItem/index.js';import Fu from'lodash/map.js';import ke from'@mui/material/Box/index.js';import hg from'react-switch';import Eg from'lodash/countBy.js';import vg from'lodash/uniq.js';import lc from'lodash/sortBy.js';import Ug from'lodash/merge.js';import Xe from'react-loading-skeleton';import Jg from'lodash/flatMap.js';import qs from'@mui/material/Tab/index.js';import Xg from'lodash/isEmpty.js';import nf from'@mui/material/Tabs/index.js';import cf from'@mui/material/useMediaQuery/index.js';import {ExternalLink,ChevronRight,Info,Minus,Plus,ArrowDown}from'react-feather';import Wf from'@mui/material/Link/index.js';import $f,{tooltipClasses}from'@mui/material/Tooltip/index.js';import Gl from'lodash/keyBy.js';import Ni from'color';import qf,{linearProgressClasses}from'@mui/material/LinearProgress/index.js';import fy from'lodash/padStart.js';import Kl from'lodash/isUndefined.js';import {BillingModel as BillingModel$1,BillingPeriod as BillingPeriod$1}from'@stigg/api-client-js/src/generated/sdk';import jn from'lodash/lowerCase.js';import Ay from'lodash/range.js';import {produce}from'immer';import Uy from'lodash/cloneDeep.js';import _y from'lodash/remove.js';import {Elements,useStripe,useElements,AddressElement,PaymentElement}from'@stripe/react-stripe-js';import $h from'@mui/material/StepIcon/index.js';import Zx from'lodash/partition.js';import Jh from'@mui/material/CircularProgress/index.js';import qx from'@mui/material/Paper/index.js';import Jx from'@mui/material/Alert/index.js';import rC from'@mui/material/Checkbox/index.js';import nC from'@mui/material/FormControlLabel/index.js';import iC from'lodash/isString.js';import YP from'@mui/material/Autocomplete/index.js';import QP from'@mui/material/Collapse/index.js';import {AL,AD,AO,AR,AM,AW,AU,AT,AZ,BS as BS$1,BH,BD,BB,BY,BE,BJ,BO,BA,BR,BG,BF,KH,CM,CA,CV,CL,CN,CO,CD,CR,HR,CY,CZ,DK,DO,EC,EG,SV,EE,ET,EU,FI,FR,GE,DE,GR,GN,HK,HU,IS as IS$1,IN,ID,IE,IL,IT,JP as JP$1,KZ,KE,KG,LA,LV,LI,LT,LU,MY,MT,MR,MX,MD,ME,MA,NP,NL,NZ,NG,MK,NO,OM,PE,PH,PL,PT,RO,RU,SA,SN,RS as RS$1,SG,SK,SI,ZA,KR,ES as ES$1,SR,SE,CH,TW,TJ,TZ,TH,TR,UG,UA,AE,GB,US,UY,UZ,VE,VN,ZM,ZW}from'country-flag-icons/react/3x2';import yd from'lodash/startCase.js';import hd from'lodash/upperCase.js';import mx from'react-lottie';import Vx from'@mui/material/IconButton/index.js';import {styled}from'@mui/material/styles/index.js';import Sb from'@mui/material/Radio/index.js';import vb from'@mui/material/Chip/index.js';import {TableContainer,Table,Divider,TableCell,TableRow,TablePagination,TableBody,TableHead}from'@mui/material';import DS from'@mui/material/TableRow/index.js';function So(e,t,o){let r=o?` ${o}`:"";return (!e||e===1)&&t?`Up to ${t}${r}`:e&&e>1&&t?`${e}-${t}${r}`:e&&e>1?`Minimum ${e}${r}`:""}function se(e,t="en-US"){if(e==null)return;let o={thousandSeparator:t==="en-US"?",":" ",decimalSeparator:".",decimalScale:0,fixedDecimalScale:true};return numericFormatter(String(Math.round(e)),o)}function pn(e,t="en-US"){let o={thousandSeparator:t==="en-US"?",":" ",decimalSeparator:".",decimalScale:2,fixedDecimalScale:true};return numericFormatter(String(e),o)}function Gt(e,t=1){if(e<1e6)return se(e)||"0";let o=[{value:1e12,suffix:"T"},{value:1e9,suffix:"B"},{value:1e6,suffix:"M"}];for(let{value:r,suffix:n}of o)if(e>=r){let a=(e/r).toFixed(t);return a.includes(".")&&(a=a.replace(/\.0+$/,"").replace(/(\.\d*[1-9])0+$/,"$1")),`${a}${n}`}return se(e)||"0"}var Am=e(f)`
1
+ import {e,f,i,j,a,g,b,h,c,p,w,u,v,d,x,y,z,B,G,A,H as H$1,C,I,q,r,K,o,l,m,n,k}from'./chunk-GSQVL6D4.esm.js';export{s as StiggContext,t as StiggProvider,D as useActiveSubscriptions,x as useBooleanEntitlement,A as useCreditEntitlement,L as useCreditUsage,F as useCustomerPortal,B as useEnumEntitlement,z as useMeteredEntitlement,y as useNumericEntitlement,E as usePaywall,u as useStiggContext}from'./chunk-GSQVL6D4.esm.js';import {BillingModel,PaymentCollection,SubscriptionStatus,PricingType,BillingPeriod,SubscriptionScheduleType,ThresholdType,DiscountType,DiscountDurationType,Currency,BillingVendorIdentifier,CreditGrantType,WidgetType,BillingCadence,FontWeight,MeterType,EntitlementResetPeriod,TiersMode,Alignment,CreditCadence,SubscriptionProrationBehavior,SubscriptionBillingCycleAnchor}from'@stigg/js-client-sdk';export*from'@stigg/js-client-sdk';import hi,{forwardRef,lazy,useContext,useMemo,useState,useEffect,Suspense,useCallback,useRef,createElement}from'react';import Wu from'classnames';import Re from'@mui/material/Grid';import xc from'lodash/compact.js';import {NumericFormat,numericFormatter}from'react-number-format';import {jsx,jsxs,Fragment}from'react/jsx-runtime';import Ya from'lodash/isFunction.js';import Fo from'lodash/isNil.js';import iu from'react-spinners/ClipLoader.js';import {css,useTheme}from'@emotion/react';import Bo from'dayjs';import Km from'dayjs/plugin/utc.js';import qm from'dayjs/plugin/relativeTime.js';import Jm from'dayjs/plugin/advancedFormat.js';import ou from'lodash/sum.js';import yu from'currency-symbol-map';import wu from'@mui/material/InputAdornment';import Pu,{buttonClasses}from'@mui/material/Button';import Su from'@mui/material/TextField';import Ml from'@mui/material/Divider';import Bu from'@mui/material/OutlinedInput';import Au from'@mui/material/Select';import Iu from'@mui/material/MenuItem';import Fu from'lodash/map.js';import ke from'@mui/material/Box';import hg from'react-switch';import Eg from'lodash/countBy.js';import vg from'lodash/uniq.js';import lc from'lodash/sortBy.js';import Ug from'lodash/merge.js';import Xe from'react-loading-skeleton';import Jg from'lodash/flatMap.js';import qs from'@mui/material/Tab';import Xg from'lodash/isEmpty.js';import nf from'@mui/material/Tabs';import cf from'@mui/material/useMediaQuery';import {ExternalLink,ChevronRight,Info,Minus,Plus,ArrowDown}from'react-feather';import Wf from'@mui/material/Link';import $f,{tooltipClasses}from'@mui/material/Tooltip';import Gl from'lodash/keyBy.js';import Ni from'color';import qf,{linearProgressClasses}from'@mui/material/LinearProgress';import fy from'lodash/padStart.js';import Kl from'lodash/isUndefined.js';import {BillingModel as BillingModel$1,BillingPeriod as BillingPeriod$1}from'@stigg/api-client-js/src/generated/sdk';import jn from'lodash/lowerCase.js';import Ay from'lodash/range.js';import {produce}from'immer';import Uy from'lodash/cloneDeep.js';import _y from'lodash/remove.js';import {Elements,useStripe,useElements,AddressElement,PaymentElement}from'@stripe/react-stripe-js';import $h from'@mui/material/StepIcon';import Zx from'lodash/partition.js';import Jh from'@mui/material/CircularProgress';import qx from'@mui/material/Paper';import Jx from'@mui/material/Alert';import rC from'@mui/material/Checkbox';import nC from'@mui/material/FormControlLabel';import iC from'lodash/isString.js';import YP from'@mui/material/Autocomplete';import QP from'@mui/material/Collapse';import {AL,AD,AO,AR,AM,AW,AU,AT,AZ,BS as BS$1,BH,BD,BB,BY,BE,BJ,BO,BA,BR,BG,BF,KH,CM,CA,CV,CL,CN,CO,CD,CR,HR,CY,CZ,DK,DO,EC,EG,SV,EE,ET,EU,FI,FR,GE,DE,GR,GN,HK,HU,IS as IS$1,IN,ID,IE,IL,IT,JP as JP$1,KZ,KE,KG,LA,LV,LI,LT,LU,MY,MT,MR,MX,MD,ME,MA,NP,NL,NZ,NG,MK,NO,OM,PE,PH,PL,PT,RO,RU,SA,SN,RS as RS$1,SG,SK,SI,ZA,KR,ES as ES$1,SR,SE,CH,TW,TJ,TZ,TH,TR,UG,UA,AE,GB,US,UY,UZ,VE,VN,ZM,ZW}from'country-flag-icons/react/3x2';import yd from'lodash/startCase.js';import hd from'lodash/upperCase.js';import mx from'react-lottie';import Vx from'@mui/material/IconButton';import {styled}from'@mui/material/styles';import Sb from'@mui/material/Radio';import vb from'@mui/material/Chip';import {TableContainer,Table,Divider,TableCell,TableRow,TablePagination,TableBody,TableHead}from'@mui/material';import DS from'@mui/material/TableRow';function So(e,t,o){let r=o?` ${o}`:"";return (!e||e===1)&&t?`Up to ${t}${r}`:e&&e>1&&t?`${e}-${t}${r}`:e&&e>1?`Minimum ${e}${r}`:""}function se(e,t="en-US"){if(e==null)return;let o={thousandSeparator:t==="en-US"?",":" ",decimalSeparator:".",decimalScale:0,fixedDecimalScale:true};return numericFormatter(String(Math.round(e)),o)}function pn(e,t="en-US"){let o={thousandSeparator:t==="en-US"?",":" ",decimalSeparator:".",decimalScale:2,fixedDecimalScale:true};return numericFormatter(String(e),o)}function Gt(e,t=1){if(e<1e6)return se(e)||"0";let o=[{value:1e12,suffix:"T"},{value:1e9,suffix:"B"},{value:1e6,suffix:"M"}];for(let{value:r,suffix:n}of o)if(e>=r){let a=(e/r).toFixed(t);return a.includes(".")&&(a=a.replace(/\.0+$/,"").replace(/(\.\d*[1-9])0+$/,"$1")),`${a}${n}`}return se(e)||"0"}var Am=e(f)`
2
2
  margin: 0;
3
3
  `,Im=e.div`
4
4
  display: flex;
@@ -74,7 +74,7 @@ import {e,f,i,j,a,g,b,h,c,p,w,u,v,d,x,y,z,B,G,A,H as H$1,C,I,q,r,K,o,l,m,n,k}fro
74
74
  `,te=o=>{var r=o,{variant:e="outlined"}=r,t=c(r,["variant"]);return jsx(xu,a({variant:e},t))};var pe=e(Su)(({theme:e})=>({"& .MuiOutlinedInput-root":{height:"42px",borderRadius:e.stigg.border.radius,fieldset:{borderColor:e.stigg.palette.outlinedBorder},"&:not(.Mui-focused):hover fieldset":{borderColor:e.stigg.palette.outlinedRestingBorder}},"& .MuiInputBase-input":a({padding:"8px 12px",borderRadius:e.stigg.border.radius,fontFamily:e.stigg.typography.fontFamily,color:e.stigg.palette.text.primary},e.stigg.typography.body),"& .Mui-error":{fontFamily:e.stigg.typography.fontFamily},"& .MuiFormHelperText-root":{whiteSpace:"nowrap"}}));var Ja=e(Re)`
75
75
  display: flex;
76
76
  flex-direction: column;
77
- `;function Xa(){return jsxs(Ja,{container:true,children:[jsxs(l,{item:true,$gap:48,children:[jsx(o,{width:120,height:20}),jsx(o,{width:120,height:20})]}),jsx(Ml,{className:"stigg-checkout-plan-header-divider",sx:{marginY:2}}),jsxs(Ja,{item:true,children:[jsx(o,{width:120,height:20}),jsxs(m,{$gap:16,marginTop:3,children:[jsx(o,{height:20}),jsx(o,{height:20})]}),jsxs(l,{$gap:130,marginTop:3,children:[jsx(n,{flex:1,children:jsx(o,{height:20})}),jsx(n,{flex:3,children:jsx(o,{height:20})})]})]})]})}var bt=e=>e.target.blur();function ja({width:e,tierUnits:t,value:o,handleChange:r,errorMessage:n}){return jsx(pe,{type:"number",onWheel:bt,fullWidth:true,error:!!n,sx:{minHeight:"46px",width:e},InputProps:{endAdornment:jsx(wu,{position:"end",children:jsx(f,{variant:"body1",color:"primary",children:t})})},value:o,onChange:i=>{var l,s;let a=(l=i==null?void 0:i.target)!=null&&l.value?Number((s=i==null?void 0:i.target)==null?void 0:s.value):null;a&&r(a);}})}var Eu=e(Au)`
77
+ `;function Xa(){return jsxs(Ja,{container:true,children:[jsxs(l,{$gap:48,children:[jsx(o,{width:120,height:20}),jsx(o,{width:120,height:20})]}),jsx(Ml,{className:"stigg-checkout-plan-header-divider",sx:{marginY:2}}),jsxs(Ja,{children:[jsx(o,{width:120,height:20}),jsxs(m,{$gap:16,marginTop:3,children:[jsx(o,{height:20}),jsx(o,{height:20})]}),jsxs(l,{$gap:130,marginTop:3,children:[jsx(n,{flex:1,children:jsx(o,{height:20})}),jsx(n,{flex:3,children:jsx(o,{height:20})})]})]})]})}var bt=e=>e.target.blur();function ja({width:e,tierUnits:t,value:o,handleChange:r,errorMessage:n}){return jsx(pe,{type:"number",onWheel:bt,fullWidth:true,error:!!n,sx:{minHeight:"46px",width:e},InputProps:{endAdornment:jsx(wu,{position:"end",children:jsx(f,{variant:"body1",color:"primary",children:t})})},value:o,onChange:i=>{var l,s;let a=(l=i==null?void 0:i.target)!=null&&l.value?Number((s=i==null?void 0:i.target)==null?void 0:s.value):null;a&&r(a);}})}var Eu=e(Au)`
78
78
  border-radius: 10px;
79
79
  min-height: 42px;
80
80
  min-width: 120px;
@@ -341,7 +341,7 @@ import {e,f,i,j,a,g,b,h,c,p,w,u,v,d,x,y,z,B,G,A,H as H$1,C,I,q,r,K,o,l,m,n,k}fro
341
341
  display: flex;
342
342
  flex-direction: column;
343
343
  gap: 32px;
344
- `;function ol(){let e=me("md");return jsxs(df,{className:"stigg-subscription-overview-skeleton-layout",children:[jsxs(pf,{children:[jsx(Xe,{width:120}),jsx(Xe,{width:120})]}),jsx(Xe,{width:e?295:260,height:193})]})}function uf({scheduleUpdate:e}){let{targetPackage:t}=e;return jsxs(Re,{container:true,alignItems:"center",children:[jsx(Re,{children:jsx(ArrowDown,{color:"#D94052",height:20,className:"stigg-scheduled-updates-arrow-down"})}),jsx(Re,{item:true,children:jsxs(f,{className:"stigg-scheduled-updates-description",variant:"body1",children:["Downgrade to the ",jsx("b",{children:t==null?void 0:t.displayName})," plan"]})})]})}function gf({scheduleUpdate:e}){let{scheduleVariables:t}=e,{billingPeriod:o}=t,r=o===BillingPeriod.Monthly?"annually":"monthly",n=o===BillingPeriod.Monthly?"monthly":"annually";return jsxs(Re,{container:true,alignItems:"center",children:[jsx(Re,{children:jsx(ArrowDown,{color:"#D94052",height:20,className:"stigg-scheduled-updates-arrow-down"})}),jsx(Re,{item:true,children:jsxs(f,{className:"stigg-scheduled-updates-description",variant:"body1",children:["Change from an ",r," to a ",jsx("b",{children:n})," billing cycle"]})})]})}function ff({subscription:e,scheduleUpdate:t}){let{scheduleVariables:o}=t,{newUnitAmount:r,featureId:n}=o,a=xc(e.prices.map(({feature:u})=>u)).find(u=>u.id===n);if(!a)return null;let{featureUnits:l,featureUnitsPlural:s}=a;return jsxs(Re,{container:true,alignItems:"flex-start",flexWrap:"nowrap",children:[jsx(Re,{children:jsx(ArrowDown,{color:"#D94052",height:20,className:"stigg-scheduled-updates-arrow-down"})}),jsx(Re,{item:true,children:jsxs(f,{className:"stigg-scheduled-updates-description",variant:"body1",children:["Reduce the ",jsx("b",{children:l})," quantity to ",r," ",r===1?l:s]})})]})}function nl({scheduleUpdate:e,subscription:t}){switch(e.subscriptionScheduleType){case SubscriptionScheduleType.Downgrade:return jsx(uf,{scheduleUpdate:e});case SubscriptionScheduleType.BillingPeriod:return jsx(gf,{scheduleUpdate:e});case SubscriptionScheduleType.UnitAmount:return jsx(ff,{scheduleUpdate:e,subscription:t});default:return null}}var xf=e(ke)`
344
+ `;function ol(){let e=me("md");return jsxs(df,{className:"stigg-subscription-overview-skeleton-layout",children:[jsxs(pf,{children:[jsx(Xe,{width:120}),jsx(Xe,{width:120})]}),jsx(Xe,{width:e?295:260,height:193})]})}function uf({scheduleUpdate:e}){let{targetPackage:t}=e;return jsxs(Re,{container:true,alignItems:"center",children:[jsx(Re,{children:jsx(ArrowDown,{color:"#D94052",height:20,className:"stigg-scheduled-updates-arrow-down"})}),jsx(Re,{children:jsxs(f,{className:"stigg-scheduled-updates-description",variant:"body1",children:["Downgrade to the ",jsx("b",{children:t==null?void 0:t.displayName})," plan"]})})]})}function gf({scheduleUpdate:e}){let{scheduleVariables:t}=e,{billingPeriod:o}=t,r=o===BillingPeriod.Monthly?"annually":"monthly",n=o===BillingPeriod.Monthly?"monthly":"annually";return jsxs(Re,{container:true,alignItems:"center",children:[jsx(Re,{children:jsx(ArrowDown,{color:"#D94052",height:20,className:"stigg-scheduled-updates-arrow-down"})}),jsx(Re,{children:jsxs(f,{className:"stigg-scheduled-updates-description",variant:"body1",children:["Change from an ",r," to a ",jsx("b",{children:n})," billing cycle"]})})]})}function ff({subscription:e,scheduleUpdate:t}){let{scheduleVariables:o}=t,{newUnitAmount:r,featureId:n}=o,a=xc(e.prices.map(({feature:u})=>u)).find(u=>u.id===n);if(!a)return null;let{featureUnits:l,featureUnitsPlural:s}=a;return jsxs(Re,{container:true,alignItems:"flex-start",flexWrap:"nowrap",children:[jsx(Re,{children:jsx(ArrowDown,{color:"#D94052",height:20,className:"stigg-scheduled-updates-arrow-down"})}),jsx(Re,{children:jsxs(f,{className:"stigg-scheduled-updates-description",variant:"body1",children:["Reduce the ",jsx("b",{children:l})," quantity to ",r," ",r===1?l:s]})})]})}function nl({scheduleUpdate:e,subscription:t}){switch(e.subscriptionScheduleType){case SubscriptionScheduleType.Downgrade:return jsx(uf,{scheduleUpdate:e});case SubscriptionScheduleType.BillingPeriod:return jsx(gf,{scheduleUpdate:e});case SubscriptionScheduleType.UnitAmount:return jsx(ff,{scheduleUpdate:e,subscription:t});default:return null}}var xf=e(ke)`
345
345
  border-bottom: ${({$borderColor:e})=>`1px solid ${e}`};
346
346
  border-top-left-radius: 10px;
347
347
  border-top-right-radius: 10px;
@@ -354,7 +354,7 @@ import {e,f,i,j,a,g,b,h,c,p,w,u,v,d,x,y,z,B,G,A,H as H$1,C,I,q,r,K,o,l,m,n,k}fro
354
354
  path {
355
355
  fill: ${({theme:e})=>e.stigg.palette.primary};
356
356
  }
357
- `;function Tf({subscription:e}){let{scheduledUpdates:t}=e;return jsxs(Fragment,{children:[jsx(Re,{container:true,alignItems:"center",justifyContent:"space-between",gap:1,children:jsx(Re,{children:jsx(f,{className:"stigg-scheduled-updates-description",variant:"body1",children:"The following updates will take effect in the next billing cycle:"})})}),jsx(Re,{children:(t||[]).map(o=>jsx(nl,{scheduleUpdate:o,subscription:e},o.subscriptionScheduleType))})]})}function kf({subscription:e}){let{scheduledUpdates:t}=e,[o]=t||[],{line1:r,line2:n}=Io({scheduledUpdate:o,subscriptionPrices:e.prices,billingPeriodRange:e.billingPeriodRange,options:{postfix:"at the end of the current billing period"}});return jsxs(Fragment,{children:[jsx(Re,{container:true,alignItems:"center",justifyContent:"space-between",gap:1,children:jsx(Re,{children:jsx(f,{className:"stigg-scheduled-updates-title",variant:"body1",color:"primary",children:r})})}),n&&jsx(Re,{children:jsx(f,{className:"stigg-scheduled-updates-subtitle",variant:"body1",color:"secondary",children:n})})]})}function il({subscription:e,onCancelScheduledUpdates:t,theme:o,cancelScheduledUpdatesButtonTitle:r}){let n=useTheme(),[i$1,a]=useState(false),{scheduledUpdates:l}=e;if(!l||l.length===0)return null;let s=l.length===1;return jsx(xf,{$borderColor:o.borderColor,className:"stigg-scheduled-updates-alert-container",children:jsxs(Re,{container:true,alignItems:s?"center":"flex-start",gap:2,children:[jsx(Re,{item:true,display:"flex",children:jsx(i,{icon:"ScheduleBox",svgPathColor:o.iconsColor,svgRectColor:o.iconsBackgroundColor})}),jsx(Re,{item:true,flex:1,children:s?jsx(kf,{subscription:e}):jsx(Tf,{subscription:e})}),!!t&&jsx(Re,{item:true,children:jsxs(je,{variant:"outlined",onClick:()=>{a(true),Promise.resolve(t(e)).finally(()=>a(false));},children:[i$1?jsx(bf,{loading:true,size:16,color:n.stigg.palette.text.disabled}):jsx(Sf,{style:{display:"flex",marginRight:4},className:"stigg-scheduled-updates-cancel-update-button-icon"}),jsx(f,{variant:"body1",color:"primary.main",className:"stigg-scheduled-updates-cancel-update-button",children:r})]})})]})})}var Ue=e.div`
357
+ `;function Tf({subscription:e}){let{scheduledUpdates:t}=e;return jsxs(Fragment,{children:[jsx(Re,{container:true,alignItems:"center",justifyContent:"space-between",gap:1,children:jsx(Re,{children:jsx(f,{className:"stigg-scheduled-updates-description",variant:"body1",children:"The following updates will take effect in the next billing cycle:"})})}),jsx(Re,{children:(t||[]).map(o=>jsx(nl,{scheduleUpdate:o,subscription:e},o.subscriptionScheduleType))})]})}function kf({subscription:e}){let{scheduledUpdates:t}=e,[o]=t||[],{line1:r,line2:n}=Io({scheduledUpdate:o,subscriptionPrices:e.prices,billingPeriodRange:e.billingPeriodRange,options:{postfix:"at the end of the current billing period"}});return jsxs(Fragment,{children:[jsx(Re,{container:true,alignItems:"center",justifyContent:"space-between",gap:1,children:jsx(Re,{children:jsx(f,{className:"stigg-scheduled-updates-title",variant:"body1",color:"primary",children:r})})}),n&&jsx(Re,{children:jsx(f,{className:"stigg-scheduled-updates-subtitle",variant:"body1",color:"secondary",children:n})})]})}function il({subscription:e,onCancelScheduledUpdates:t,theme:o,cancelScheduledUpdatesButtonTitle:r}){let n=useTheme(),[i$1,a]=useState(false),{scheduledUpdates:l}=e;if(!l||l.length===0)return null;let s=l.length===1;return jsx(xf,{$borderColor:o.borderColor,className:"stigg-scheduled-updates-alert-container",children:jsxs(Re,{container:true,alignItems:s?"center":"flex-start",gap:2,children:[jsx(Re,{display:"flex",children:jsx(i,{icon:"ScheduleBox",svgPathColor:o.iconsColor,svgRectColor:o.iconsBackgroundColor})}),jsx(Re,{flex:1,children:s?jsx(kf,{subscription:e}):jsx(Tf,{subscription:e})}),!!t&&jsx(Re,{children:jsxs(je,{variant:"outlined",onClick:()=>{a(true),Promise.resolve(t(e)).finally(()=>a(false));},children:[i$1?jsx(bf,{loading:true,size:16,color:n.stigg.palette.text.disabled}):jsx(Sf,{style:{display:"flex",marginRight:4},className:"stigg-scheduled-updates-cancel-update-button-icon"}),jsx(f,{variant:"body1",color:"primary.main",className:"stigg-scheduled-updates-cancel-update-button",children:r})]})})]})})}var Ue=e.div`
358
358
  width: 100%;
359
359
  display: flex;
360
360
  flex-direction: column;
@@ -508,9 +508,9 @@ import {e,f,i,j,a,g,b,h,c,p,w,u,v,d,x,y,z,B,G,A,H as H$1,C,I,q,r,K,o,l,m,n,k}fro
508
508
  height: 100%;
509
509
 
510
510
  ${({theme:e,$highlight:t})=>t&&`background-color: ${e.stigg.palette.backgroundSection}`};
511
- `;function ql({entitlement:e,subscriptionPrice:t,onManageSubscription:o,onBuyMore:r,hasCustomSubscription:n,canUpgradeSubscription:i$1}){var s,c,u;let{theme:a}=Y(),l=!e.hasUnlimitedUsage&&e.currentUsage>e.usageLimit;return e.feature?jsxs(sr,{$highlight:!!t,$borderColor:a.borderColor,children:[jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:16},children:[jsx(Ae,{variant:"body1",children:e.feature&&Yl(e.feature)}),t&&jsx(Ze,{title:jsx(f,{variant:"body1",children:t.billingModel===BillingModel$1.PerUnit?"Billed for committed usage":"Billed for actual usage"}),children:jsx(i,{icon:"DollarCoin",svgStrokeColor:a.iconsColor})})]}),jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:8},children:[jsxs(Ae,{variant:"body1",color:l?"error":"primary","data-testid":`usage-data-${(s=e.feature)==null?void 0:s.refId}`,children:[(c=e.currentUsage)==null?void 0:c.toLocaleString(),!e.hasUnlimitedUsage&&` / ${(u=e.usageLimit)==null?void 0:u.toLocaleString()} (${et(e.currentUsage||0,e.usageLimit)}%)`]}),jsx(Xo,{featureEntitlement:e,feature:e.feature,onBuyMore:r,canBuyMore:!!t,onManageSubscription:o,canUpgradeSubscription:i$1,hasCustomSubscription:n})]}),jsx(qo,{entitlement:e}),!e.hasUnlimitedUsage&&!Kl(e.usageLimit)&&!Kl(e.currentUsage)&&e.resetPeriod&&e.usagePeriodEnd?jsx(f,{color:"secondary",children:Tl(e)}):null,e.hasUnlimitedUsage&&jsx(f,{color:"secondary",children:"In current billing period"})]}):null}function ei({currentUsage:e,usageLimit:t}){return jsx(Ko,{currentUsage:e,usageLimit:t,classNamePrefix:"stigg-credit-usage-progress-bar"})}function ti(e){return Z(e).format("MMM D, YYYY h:mmA")}function oi(e){return Z(e).format("MMM D, YYYY")}function wy(e){let t=i=>Math.ceil(Z.utc(e).diff(Z.utc(),i,true)),o=t("days");if(o>1)return `in ${o} days`;let r=t("hours");return r>1?`in ${r} hours`:`in ${t("minutes")} minutes`}function cr(e){let{usagePeriodEnd:t,formatter:o}=e;return !t||t.getTime()<=Date.now()?null:`Refreshes ${o?o(t):wy(t)}`}function dr({creditEntitlement:e}){let{theme:t,textOverrides:o}=Y(),{currency:r,currentUsage:n,usageLimit:i}=e,a=(n!=null?n:0)>(i!=null?i:0),l=et(n!=null?n:0,i!=null?i:0),s=Ql(e),c=cr({usagePeriodEnd:e.usagePeriodEnd?new Date(e.usagePeriodEnd):void 0,formatter:o.formatResetPeriod});return jsxs(sr,{$highlight:false,$borderColor:t.borderColor,className:"stigg-credit-usage-container",children:[jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:16},children:jsx(Ae,{variant:"body1",className:"stigg-credit-usage-title",children:s})}),jsx("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:8},children:jsxs(Ae,{variant:"body1",color:a?"error":"primary",className:"stigg-credit-usage-value","data-testid":`credit-usage-data-${r.currencyId}`,children:[(n!=null?n:0).toLocaleString()," / ",(i!=null?i:0).toLocaleString()," (",l,"%)"]})}),jsx(ei,{currentUsage:n!=null?n:0,usageLimit:i!=null?i:0}),c&&jsx(f,{color:"secondary",children:c})]})}function Xl({featureEntitlements:e,creditEntitlements:t,subscriptionPriceByFeature:o,gridSizeXs:r,onManageSubscription:n,onBuyMore:i,hasCustomSubscription:a,canUpgradeSubscription:l}){return jsxs(Re,{container:true,spacing:4,children:[e.filter(s=>!!s.feature).map(s=>{let c=s.feature;return jsx(Re,{className:`stigg-entitlement-usage-${c.refId}`,item:true,xs:r,children:jsx(ql,{entitlement:s,subscriptionPrice:o[c.refId],onManageSubscription:n,onBuyMore:i,hasCustomSubscription:a,canUpgradeSubscription:l})},c.refId)}),t.map(s=>jsx(Re,{className:`stigg-credit-usage-${s.currency.currencyId}`,item:true,xs:r,children:jsx(dr,{creditEntitlement:s})},s.currency.currencyId))]})}var ec=e.div`
511
+ `;function ql({entitlement:e,subscriptionPrice:t,onManageSubscription:o,onBuyMore:r,hasCustomSubscription:n,canUpgradeSubscription:i$1}){var s,c,u;let{theme:a}=Y(),l=!e.hasUnlimitedUsage&&e.currentUsage>e.usageLimit;return e.feature?jsxs(sr,{$highlight:!!t,$borderColor:a.borderColor,children:[jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:16},children:[jsx(Ae,{variant:"body1",children:e.feature&&Yl(e.feature)}),t&&jsx(Ze,{title:jsx(f,{variant:"body1",children:t.billingModel===BillingModel$1.PerUnit?"Billed for committed usage":"Billed for actual usage"}),children:jsx(i,{icon:"DollarCoin",svgStrokeColor:a.iconsColor})})]}),jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:8},children:[jsxs(Ae,{variant:"body1",color:l?"error":"primary","data-testid":`usage-data-${(s=e.feature)==null?void 0:s.refId}`,children:[(c=e.currentUsage)==null?void 0:c.toLocaleString(),!e.hasUnlimitedUsage&&` / ${(u=e.usageLimit)==null?void 0:u.toLocaleString()} (${et(e.currentUsage||0,e.usageLimit)}%)`]}),jsx(Xo,{featureEntitlement:e,feature:e.feature,onBuyMore:r,canBuyMore:!!t,onManageSubscription:o,canUpgradeSubscription:i$1,hasCustomSubscription:n})]}),jsx(qo,{entitlement:e}),!e.hasUnlimitedUsage&&!Kl(e.usageLimit)&&!Kl(e.currentUsage)&&e.resetPeriod&&e.usagePeriodEnd?jsx(f,{color:"secondary",children:Tl(e)}):null,e.hasUnlimitedUsage&&jsx(f,{color:"secondary",children:"In current billing period"})]}):null}function ei({currentUsage:e,usageLimit:t}){return jsx(Ko,{currentUsage:e,usageLimit:t,classNamePrefix:"stigg-credit-usage-progress-bar"})}function ti(e){return Z(e).format("MMM D, YYYY h:mmA")}function oi(e){return Z(e).format("MMM D, YYYY")}function wy(e){let t=i=>Math.ceil(Z.utc(e).diff(Z.utc(),i,true)),o=t("days");if(o>1)return `in ${o} days`;let r=t("hours");return r>1?`in ${r} hours`:`in ${t("minutes")} minutes`}function cr(e){let{usagePeriodEnd:t,formatter:o}=e;return !t||t.getTime()<=Date.now()?null:`Refreshes ${o?o(t):wy(t)}`}function dr({creditEntitlement:e}){let{theme:t,textOverrides:o}=Y(),{currency:r,currentUsage:n,usageLimit:i}=e,a=(n!=null?n:0)>(i!=null?i:0),l=et(n!=null?n:0,i!=null?i:0),s=Ql(e),c=cr({usagePeriodEnd:e.usagePeriodEnd?new Date(e.usagePeriodEnd):void 0,formatter:o.formatResetPeriod});return jsxs(sr,{$highlight:false,$borderColor:t.borderColor,className:"stigg-credit-usage-container",children:[jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:16},children:jsx(Ae,{variant:"body1",className:"stigg-credit-usage-title",children:s})}),jsx("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:8},children:jsxs(Ae,{variant:"body1",color:a?"error":"primary",className:"stigg-credit-usage-value","data-testid":`credit-usage-data-${r.currencyId}`,children:[(n!=null?n:0).toLocaleString()," / ",(i!=null?i:0).toLocaleString()," (",l,"%)"]})}),jsx(ei,{currentUsage:n!=null?n:0,usageLimit:i!=null?i:0}),c&&jsx(f,{color:"secondary",children:c})]})}function Xl({featureEntitlements:e,creditEntitlements:t,subscriptionPriceByFeature:o,gridSizeXs:r,onManageSubscription:n,onBuyMore:i,hasCustomSubscription:a,canUpgradeSubscription:l}){return jsxs(Re,{container:true,spacing:4,children:[e.filter(s=>!!s.feature).map(s=>{let c=s.feature;return jsx(Re,{className:`stigg-entitlement-usage-${c.refId}`,size:{xs:r},children:jsx(ql,{entitlement:s,subscriptionPrice:o[c.refId],onManageSubscription:n,onBuyMore:i,hasCustomSubscription:a,canUpgradeSubscription:l})},c.refId)}),t.map(s=>jsx(Re,{className:`stigg-credit-usage-${s.currency.currencyId}`,size:{xs:r},children:jsx(dr,{creditEntitlement:s})},s.currency.currencyId))]})}var ec=e.div`
512
512
  margin-top: 32px;
513
- `;function tc(){let e=me("md");return jsx(Re,{container:true,spacing:4,className:"stigg-subscription-usage-skeleton-layout",sx:{flexWrap:"wrap"},children:Ay(6).map(t=>jsx(Re,{item:true,xs:e?4:12,children:jsx(Xe,{width:280,height:120})},t))})}function oc({showAll:e,onToggle:t}){return jsx(ec,{children:jsx(je,{className:"stigg-usage-toggle-many-button",variant:"text",startIcon:e?jsx(Minus,{}):jsx(Plus,{}),onClick:t,children:e?"Show less":"Show more"})})}function ur({onManageSubscription:e,onBuyMore:t,filterEntitlements:o,filterPackageEntitlements:r}){let{textOverrides:n,theme:i}=Y(),{isLoadingData:a,entitlementsToShow:l,creditsToShow:s,subscriptionPriceByFeature:c,gridSizeXs:u,hasCustomSubscription:f,canUpgradeSubscription:y,showAll:p,toggleShowAll:g,hasNoItems:h,showMoreVisible:P}=Zl({filterEntitlements:o,filterPackageEntitlements:r});return h?null:jsxs(Ue,{className:"stigg-subscription-usage-layout",$backgroundColor:i.backgroundColor,$borderColor:i.borderColor,children:[jsx(Ne,{children:jsx(Me,{title:n.usageTabTitle,className:"stigg-customer-portal-usage-section-title",isLoading:a})}),a?jsx(tc,{}):jsxs(Fragment,{children:[jsx(Xl,{featureEntitlements:l,creditEntitlements:s,subscriptionPriceByFeature:c,gridSizeXs:u,onManageSubscription:e,onBuyMore:t,hasCustomSubscription:f,canUpgradeSubscription:y}),P&&jsx(oc,{showAll:p,onToggle:g})]})]})}function ic({onManageSubscription:e,onBuyMore:t,filterEntitlements:o,filterPackageEntitlements:r,onCancelScheduledUpdates:n,onContactSupport:i,paywallComponent:a,hiddenSections:l}){let{customerPortal:s,textOverrides:c,theme:u,isLoading:f,showWatermark:y}=Y(),p=useRef(null),g=({intentionType:x})=>{var A,S;e?e({intentionType:x,customerSubscriptions:(A=s==null?void 0:s.subscriptions)!=null?A:[]}):(S=p==null?void 0:p.current)==null||S.scrollIntoView({behavior:"smooth"});},h=!(l!=null&&l.some(x=>x==="usage")),P=!(l!=null&&l.some(x=>x==="paymentDetails"||x==="billingInformation")),b=!(l!=null&&l.some(x=>x==="invoices"||x==="billingInformation"));return jsxs(_l,{className:"stigg-customer-portal-layout",children:[jsx(vl,{showWatermark:y}),jsxs(Dl,{className:"stigg-customer-portal-sections",children:[jsx(tr,{onCancelScheduledUpdates:n,onBuyMore:t,onManageSubscription:g,onContactSupport:i,hiddenSections:l,cancelScheduledUpdatesButtonTitle:c.cancelScheduledUpdatesButtonTitle}),h&&jsx(ur,{onManageSubscription:g,onBuyMore:t,filterEntitlements:o,filterPackageEntitlements:r}),jsx(Xn,{ref:p,paywallComponent:a,theme:u,title:c.paywallSectionTitle,isLoading:!s||f}),P&&jsx(ar,{}),b&&jsx(gr,{})]})]})}function sc(i){var a$1=i,{textOverrides:e,theme:t,resourceId:o,productId:r}=a$1,n=c(a$1,["textOverrides","theme","resourceId","productId"]);return jsx(Do,{textOverrides:e,theme:t,resourceId:o,productId:r,children:jsx(ic,a({},n))})}function gr(){let{customerPortal:e,isLoading:t,textOverrides:o,theme:r}=Y(),n=!e||t,i=n?jsx(nr,{}):e!=null&&e.billingPortalUrl?jsx(or,{url:e.billingPortalUrl,text:o.viewInvoiceHistory,className:"stigg-view-invoice-history-button"}):null;return !n&&!(e!=null&&e.billingPortalUrl)?null:jsx(Ue,{className:"stigg-invoices-section-layout",$backgroundColor:r.backgroundColor,$borderColor:r.borderColor,children:jsxs(Ne,{className:"stigg-invoices-section-header",children:[jsx(Me,{isLoading:n,className:"stigg-invoices-section-title",title:o.invoicesTitle}),i]})})}var cc=e=>lc(e,"displayName"),ii=e=>lc(e,"addon.displayName");function lt(e){var r,n;let t=(r=e.pricePoints)==null?void 0:r.some(i=>i.amount&&i.amount>0);return !!((n=e.hiddenFromWidgets)!=null&&n.includes(WidgetType.Checkout))&&!t}function Ry(e,t){return e.pricePoints.some(o=>o.billingPeriod===t)}function dc({addon:e,currency:t,billingCountryCode:o}){return b(a({},e),{pricePoints:e.pricePoints.filter(r=>r.currency===t&&(o?r.billingCountryCode===o:true))})}function pc({addons:e,billingCountryCode:t,currency:o}){return (e==null?void 0:e.map(r=>dc({addon:r,currency:o,billingCountryCode:t})))||[]}function mc({addons:e,billingPeriod:t,billingCountryCode:o,currency:r}){var n;return ((n=e==null?void 0:e.filter(i=>Ry(i.addon,t)))==null?void 0:n.map(i=>b(a({},i),{addon:dc({addon:i.addon,currency:r,billingCountryCode:o})})))||[]}function uc({activeSubscription:e,plan:t,billingCountryCode:o,billingPeriod:r}){var c,u;let n=[],i=((u=(c=t==null?void 0:t.pricePoints)==null?void 0:c[0])==null?void 0:u.currency)||Currency.Usd,a=pc({addons:t==null?void 0:t.compatibleAddons,billingCountryCode:o,currency:i}),l=cc(a.filter(f=>!lt(f))),s=mc({addons:e==null?void 0:e.addons,billingPeriod:r,billingCountryCode:o,currency:i});return s!=null&&s.length&&(a!=null&&a.length)&&(n=ii(s.filter(f=>a.some(y=>y.id===f.addon.id)))),{addons:n,initialAddons:Uy(n),availableAddons:l}}function $y(){let[,e]=_();return (t,o)=>e(r=>{if(lt(t))return;let n=r.addonsStep.addons.find(i=>i.addon.id===t.id);if(n){if(lt(n.addon))return;n.quantity=o;}else r.addonsStep.addons.push({addon:t,quantity:o}),r.addonsStep.addons=ii(r.addonsStep.addons);})}function Gy(){let[,e]=_();return t=>e(o=>{let r=o.addonsStep.addons.find(n=>n.addon.id===t);r&&lt(r.addon)||_y(o.addonsStep.addons,n=>n.addon.id===t);})}function Vy(){let[{addonsStep:e}]=_();return e}function gc(){let e=Vy();return b(a({},e),{setAddon:$y(),removeAddon:Gy()})}function zy(){let[{checkout:e,widgetState:t,checkoutLocalization:o,checkoutSuccess:r}]=_();return {checkoutState:e,widgetState:t,checkoutLocalization:o,checkoutSuccess:r}}function Oy(){let[,e]=_();return t=>e(o=>{o.widgetState.readOnly=t;})}function Hy(){let[,e]=_();return t=>e(o=>{o.widgetState.isValid=t;})}function Wy(){let[,e]=_();return t=>e(o=>{o.checkoutSuccess=t;})}function D(){let{checkoutState:e,widgetState:t,checkoutLocalization:o,checkoutSuccess:r}=zy();return {checkoutState:e,widgetState:t,checkoutLocalization:o,checkoutSuccess:r,setWidgetReadOnly:Oy(),setIsValid:Hy(),setCheckoutSuccess:Wy()}}function Qy(e){var t;return (t=e==null?void 0:e.plan)!=null&&t.pricePoints?b(a({},e),{plan:b(a({},e.plan),{pricePoints:e.plan.pricePoints.filter(o=>o.pricingModel!==BillingModel.CreditBased)})}):e}function yc({planId:e,resourceId:t,billingCountryCode:o,onMockCheckoutState:r$1}){let{stigg:n}=u(),[i,a]=useState(true),[l,s]=useState();return useEffect(()=>{let c=()=>d(null,null,function*(){try{let u=yield n.getCheckoutState({planId:e,resourceId:t,billingCountryCode:o});s(Qy(u));}catch(u){r.error(`Failed to load checkout ${u==null?void 0:u.message}`,u);}finally{a(false);}});if(r$1){a(false);let u=r$1({planId:e,resourceId:t,billingCountryCode:o});s(u);return}n.isCustomerLoaded&&(a(true),c());},[n,n.isCustomerLoaded,t,e,o,r$1]),{checkout:l,isLoading:i,showWatermark:n.getShowWatermark()}}var yr=(e,t)=>e.minUnitQuantity&&t<e.minUnitQuantity?e.minUnitQuantity:e.maxUnitQuantity&&t>e.maxUnitQuantity?e.maxUnitQuantity:t;var ai=e=>!!(e!=null&&e.pricePoints.some(t=>t.billingPeriod===BillingPeriod$1.Monthly)),si=e=>!!(e!=null&&e.pricePoints.some(t=>t.billingPeriod===BillingPeriod$1.Annually)),Cc=e=>ai(e)&&si(e);var bc=(e,t,o)=>e===BillingPeriod$1.Monthly&&t||e===BillingPeriod$1.Annually&&o?e:null,Sc=({pricingModel:e})=>e===BillingModel.PerUnit;function qy(e,t,o){var i;if(!t)return [];let r=Gl(e,"featureId"),n=Gl(xc((i=o==null?void 0:o.prices)==null?void 0:i.map(a=>{let{feature:l}=a;return !l||!Sc(a)?null:{featureId:l.featureId,quantity:l.unitQuantity||null}})),"featureId");return xc(t==null?void 0:t.map(a=>{var u,f,y;let l=(u=a.feature)==null?void 0:u.featureId;if(!l||!Sc(a))return null;let s,c=((f=r[l])==null?void 0:f.quantity)||((y=n[l])==null?void 0:y.quantity);return s=yr(a,c||1),a.isTieredPrice&&!Wt(a.tiers)&&(s=xn(a.tiers,s).upTo),{featureId:l,quantity:s}}))}function Jy({plan:e,activeSubscription:t,preferredBillingPeriod:o}){var a,l;let r=ai(e),n=si(e);if(o){let s=bc(o,r,n);if(s)return s}if(((a=t==null?void 0:t.plan)==null?void 0:a.id)===(e==null?void 0:e.id))return ((l=t==null?void 0:t.price)==null?void 0:l.billingPeriod)||BillingPeriod$1.Monthly;if(t!=null&&t.prices&&(t==null?void 0:t.prices.length)>0){let s=bc(t==null?void 0:t.prices[0].billingPeriod,r,n);if(s)return s}return n?BillingPeriod$1.Annually:BillingPeriod$1.Monthly}function Tc({preferredBillingPeriod:e,plan:t,activeSubscription:o,billingCountryCode:r,preconfiguredBillableFeatures:n}){let i=Jy({plan:t,activeSubscription:o,preferredBillingPeriod:e}),a=t==null?void 0:t.pricePoints.filter(s=>s.billingPeriod===i),l=qy(n,a,o);return {billingPeriod:i,billableFeatures:l,billingCountryCode:r}}function Xy(){let[{planStep:e}]=_();return e}function jy(){let[,e]=_();return (t,o)=>e(r=>{let n=r.planStep.billableFeatures.find(i=>i.featureId===t);n?n.quantity=o:r.planStep.billableFeatures.push({featureId:t,quantity:o});})}function eh(){let[,e]=_();return t=>e(o=>{o.planStep.billingPeriod=t,o.addonsStep.addons=o.addonsStep.addons.filter(r=>r.addon.pricePoints.some(n=>n.billingPeriod===t));})}function be(){let e=Xy();return b(a({},e),{setBillingPeriod:eh(),setBillableFeature:jy()})}var wc=[{key:"PLAN",label:"Plan"},{key:"ADDONS",label:"Add-ons"},{key:"PAYMENT",label:"Payment details"}],kc={activeStep:0,completedSteps:[],steps:wc,isDisabled:false},oh=(e,t,o,r)=>{if(Cc(e)&&!r)return false;let n=t.map(a=>a.featureId),i=o.map(a=>a.featureId);return !(n.length!==i.length||!n.every(a=>i.includes(a)))};function Bc({isLoading:e,skipCheckoutSteps:t,plan:o,availableAddons:r,availableCharges:n,preferredBillingPeriod:i,preconfiguredBillableFeatures:a$1}){if(e||!o)return kc;let l=[];return t.includes("PLAN")&&oh(o,n,a$1,i)&&l.push("PLAN"),((r==null?void 0:r.length)===0||t.includes("ADDONS"))&&l.push("ADDONS"),b(a({},kc),{steps:wc.filter(s=>!l.includes(s.key))})}function rh(){let[{progressBar:e}]=_();return e}function nh(){let[e,t]=_();return o=>d(null,null,function*(){let{progressBar:r,planStep:n,addonsStep:i,paymentStep:a,onBeforeStepChange:l}=e;if(o!==r.activeStep&&l){let s=r.steps[r.activeStep],c=r.steps[o];if(s&&c){let u={planStep:n,addonsStep:i,paymentStep:a};if(!(yield l({from:s.key,to:c.key,state:u})))return}}t(({progressBar:s})=>{s.activeStep=o;});})}function ih(){let[,e]=_();return t=>e(({progressBar:o})=>{o.completedSteps.push(t);})}function ah(e){return e.completedSteps.length>=e.steps.length-1}function sh(){let[e,t]=_();return ()=>d(null,null,function*(){let{progressBar:o,planStep:r,addonsStep:n,paymentStep:i,onBeforeStepChange:a}=e;if(o.isDisabled)return;let l=o.steps[o.activeStep],s=o.steps[o.activeStep+1];if(s&&a){let c={planStep:r,addonsStep:n,paymentStep:i};if(!(yield a({from:l.key,to:s.key,state:c})))return}t(({progressBar:c})=>{c.completedSteps.includes(c.activeStep)||c.completedSteps.push(c.activeStep),c.activeStep<c.steps.length-1&&(c.activeStep+=1);});})}function lh(){let[,e]=_();return t=>e(({progressBar:o})=>{o.isDisabled=!!t;})}function _e(){let e=rh();return {currentStep:e.steps[e.activeStep],progressBarState:e,isLastStep:e.activeStep===e.steps.length-1,isCheckoutComplete:ah(e),setActiveStep:nh(),markStepAsCompleted:ih(),goNext:sh(),setIsDisabled:lh()}}function It(){let[{planStep:e,addonsStep:t,promotionCode:o,paymentStep:r}]=_();return b(a({},e),{addons:t.addons,promotionCode:o,billingAddress:r.billingAddress,taxPercentage:r.taxPercentage,taxId:r.taxId})}function hr({billingAddress:e,taxPercentage:t,taxIds:o,prorationBehavior:r}){if(!e&&!t&&!(o!=null&&o.length)&&!r)return {};let n=o!=null&&o.length?o==null?void 0:o.filter(i=>i.value&&i.type):void 0;return {billingInformation:a(b(a(a({},e?{billingAddress:e}:{}),t?{taxPercentage:t}:{}),{taxIds:n}),r?{prorationBehavior:r}:{})}}function ph(e){return e.pricingModel===BillingModel.PerUnit&&e.billingCadence===BillingCadence.Recurring&&!!e.topUpCustomCurrencyId}function mh(e){return e!=null&&e.pricePoints?e.pricePoints.some(ph):false}function Cr({resetBillingPeriod:e,activeSubscription:t}){if(!t)return {};let o=mh(t.plan);return e!==void 0?{billingCycleAnchor:e?SubscriptionBillingCycleAnchor.Now:SubscriptionBillingCycleAnchor.Unchanged,prorationBehavior:o?SubscriptionProrationBehavior.None:void 0}:o?{billingCycleAnchor:SubscriptionBillingCycleAnchor.Now,prorationBehavior:SubscriptionProrationBehavior.None}:{}}var yh=h=>d(null,[h],function*({stigg:e,customerId:t,resourceId:o,promotionCode:r,addons:n,billableFeatures:i,billingCountryCode:a$1,billingPeriod:l,billingAddress:s,taxPercentage:c,taxIds:u,plan:f,activeSubscription:y,resetBillingPeriod:p,onMockCheckoutPreview:g}){var F;let P=n.map(({addon:T,quantity:k})=>({addonId:T.id,quantity:k})),b=null,x=null,{prorationBehavior:A,billingCycleAnchor:S}=Cr({activeSubscription:y,resetBillingPeriod:p});try{if(t&&(f!=null&&f.id)){let T=a(a({customerId:t,planId:f.id,resourceId:o,billingCountryCode:a$1,addons:P,billingPeriod:l,promotionCode:r,billableFeatures:Xg(i)?void 0:i},hr({billingAddress:s,taxPercentage:c,taxIds:u,prorationBehavior:A})),S?{billingCycleAnchor:S}:{});b=g?g(T):yield e.previewSubscription(T);}}catch(T){let[,k]=((F=T==null?void 0:T.message)==null?void 0:F.split("Error:"))||[];x=k==null?void 0:k.trim();}return {subscriptionPreview:b,errorMessage:x}}),di=({onMockCheckoutPreview:e}={})=>{let{stigg:t}=u(),o=It(),[{resourceId:r,resetBillingPeriod:n}]=_(),{checkoutState:i,widgetState:a}=D(),{plan:l,customer:s,activeSubscription:c}=i||{};return {previewSubscriptionAction:useCallback((...y)=>d(null,[...y],function*({promotionCode:f}={}){return a.isValid?yh({stigg:t,customerId:s==null?void 0:s.id,resourceId:r,addons:o.addons,billableFeatures:o.billableFeatures,billingCountryCode:o.billingCountryCode,billingPeriod:o.billingPeriod,billingAddress:o.billingAddress,taxPercentage:o.taxPercentage,promotionCode:f!=null?f:o.promotionCode,taxIds:o.taxId?[o.taxId]:void 0,plan:l,activeSubscription:c,resetBillingPeriod:n,onMockCheckoutPreview:e}):{subscriptionPreview:null,errorMessage:null}}),[t,s==null?void 0:s.id,l,r,n,o.addons,o.billableFeatures,o.billingCountryCode,o.billingPeriod,o.billingAddress,o.taxPercentage,o.taxId,o.promotionCode,a.isValid,c,e])}},hh=500,Ic=({onMockCheckoutPreview:e}={})=>{let[t,o]=useState(null),[r,n]=useState(null),[i,a]=useState(false),{previewSubscriptionAction:l}=di({onMockCheckoutPreview:e});return useEffect(()=>{let s=()=>d(null,null,function*(){let{subscriptionPreview:u,errorMessage:f}=yield l();u&&(o(u),n(null)),f&&(n(f),o(null)),a(false);});a(true);let c=setTimeout(()=>{a(true),s();},hh);return ()=>{clearTimeout(c);}},[l]),{subscriptionPreview:t,isFetchingSubscriptionPreview:i,errorMessage:r}};function Fc({customer:e,taxPercentage:t,taxId:o}){return {useNewPaymentMethod:!(e!=null&&e.paymentMethodDetails),taxPercentage:t,taxId:o}}function Ch(){let[,e]=_();return useCallback(t=>e(o=>{o.paymentStep.useNewPaymentMethod=t;}),[e])}function Ph(){let[,e]=_();return useCallback(t=>e(o=>{o.paymentStep.errorMessage=t;}),[e])}function xh(){let[,e]=_();return useCallback(t=>e(o=>{o.paymentStep.billingAddress=t;}),[e])}function bh(){let[{paymentStep:e}]=_();return e}function Sh(){let[,e]=_();return useCallback(t=>e(o=>{o.paymentStep.taxId=t;}),[e])}function re(){let e=bh();return b(a({},e),{setUseNewPaymentMethod:Ch(),setErrorMessage:Ph(),setBillingAddress:xh(),setTaxId:Sh()})}function vc(e){return Ug({changePlan:"Change",billingPeriodsTitle:"Billing cycle",addAddonText:"Add",addonBillingPeriodNotAvailableText:({planBillingPeriod:o})=>o===BillingPeriod.Monthly?"Exclusively available on annual plans":"Exclusively available on monthly plans",newPaymentMethodText:"New payment method",newPaymentMethodBillingAddressTitle:"Billing address",newPaymentMethodCardTitle:"Payment method",summary:{title:"Order summary",planName:({plan:o})=>`${o.displayName} plan`,addCouponCodeText:"Add promotion code",couponCodeTitle:"Promotion code",addonsSectionTitle:"Add-ons",discountsSectionTitle:"Discounts",onlyPayAsYouGoText:"Varies by usage",startsAtText:"Starts at ",proratedTotalDueText:"Prorated charge today",baseChargeText:()=>"Base charge",totalText:"Total",totalDueText:"Total due today",totalBillingPeriodText:({billingPeriod:o})=>`Billed ${o.toLowerCase()}`,appliedCreditsTitle:"Applied credits",creditsForUnusedTimeText:({credits:o})=>`Your account will be granted credits worth ${o} for unused time, which will be automatically applied to future payments.`,discountText:({discountDetails:o,currency:r})=>{let n=o.type===DiscountType.Percentage?`${o.value}% off`:`${H({amount:o.value,currency:r})}`,i;switch(o.durationType){case DiscountDurationType.Once:{i=" once";break}case DiscountDurationType.Repeating:{i=`${o.type===DiscountType.Fixed?" per month":""} for ${o.durationInMonths} months`;break}case DiscountDurationType.Forever:default:i="";}return `${n}${i}`},taxTitle:({taxDetails:o})=>`Tax (${o==null?void 0:o.percentage}%)`,changesWillApplyAtEndOfBillingPeriod:({billingPeriodEnd:o})=>`Your changes will take effect at the end of your current billing cycle on ${Z(o).format("MMMM D, YYYY")}.`,checkoutSuccessText:"Changes applied",payAsYouGoTooltipText:"Billed according to actual usage"},checkoutButton:{nextText:"Next",noChangesText:"No changes",updateText:"Update subscription",downgradeToFreeText:"Cancel subscription",upgradeText:"Subscribe"},downgradeToFree:{alertText:()=>"We\u2019re sorry to see you cancel your paid subscription \u{1F62D}",freePlanHeader:()=>"New plan",freePlanName:({plan:o})=>`${o.displayName}`,freePlanPriceText:()=>"Free",paidPlanHeader:()=>"Current plan",paidPlanName:({plan:o})=>`${o.displayName}`,paidPlanPriceText:({billingPeriod:o})=>`Paid plan${o?`, billed ${o.toLowerCase()}`:""}`},nextBillingCaption:()=>""},e)}var no={primary:"rgb(50, 126, 238)",textColor:"rgb(0, 30, 108)",backgroundColor:"rgb(255, 255, 255)",borderColor:"rgb(235, 237, 243)",summaryBackgroundColor:"rgb(109, 121, 144)"};function Lc(e,t,o){let{palette:r}=e||{};return {primary:(t==null?void 0:t.primary)||(r==null?void 0:r.primary)||no.primary,textColor:(t==null?void 0:t.textColor)||(r==null?void 0:r.text.primary)||no.textColor,backgroundColor:(t==null?void 0:t.backgroundColor)||(r==null?void 0:r.backgroundPaper)||no.backgroundColor,borderColor:(t==null?void 0:t.borderColor)||(r==null?void 0:r.outlinedBorder)||no.borderColor,summaryBackgroundColor:(t==null?void 0:t.summaryBackgroundColor)||(r==null?void 0:r.backgroundHighlight)||no.summaryBackgroundColor,paymentInputBackgroundColor:t==null?void 0:t.paymentInputBackgroundColor,paymentInputBorderColor:t==null?void 0:t.paymentInputBorderColor,paymentInputBorderRadius:t==null?void 0:t.paymentInputBorderRadius}}var ui=hi.createContext(null);ui.displayName="CheckoutContext";var _=()=>{let e=useContext(ui);if(!e)throw new Error("Could not find Checkout context; You need to wrap your checkout components in an <CheckoutProvider> component.");return e},vh=({children:e,initialState:t})=>{let[o,r]=useState(t);useEffect(()=>{r(t);},[t]);let n=useCallback(l=>r(s=>produce(s,c=>l(c))),[r]),[i,a]=useMemo(()=>[o,n],[n,o]);return jsx(ui.Provider,{value:[i,a],children:e})};function Mc({children:e,textOverrides:t,theme:o,preferredBillingPeriod:r,billableFeatures:n,resourceId:i,planId:a,billingCountryCode:l,billingInformation:s,onMockCheckoutState:c,skipCheckoutSteps:u,onBeforeStepChange:f,resetBillingPeriod:y}){var A;let{checkout:p,isLoading:g,showWatermark:h}=yc({resourceId:i,planId:a,billingCountryCode:l,onMockCheckoutState:c}),P=p!=null&&p.configuration?Ss(p.configuration):{typography:Jt(null,Ro)},b=v(P),x=useMemo(()=>{var L,N;let S=Lc(b,o,p==null?void 0:p.configuration),F=vc(t),T=Tc({preferredBillingPeriod:r,plan:p==null?void 0:p.plan,activeSubscription:p==null?void 0:p.activeSubscription,billingCountryCode:l,preconfiguredBillableFeatures:n!=null?n:[]}),k=uc({plan:p==null?void 0:p.plan,activeSubscription:p==null?void 0:p.activeSubscription,billingPeriod:T.billingPeriod}),w=Fc({customer:p==null?void 0:p.customer,taxPercentage:(L=s==null?void 0:s.taxDetails)==null?void 0:L.taxPercentage}),I=Bc({isLoading:g,skipCheckoutSteps:u!=null?u:[],plan:p==null?void 0:p.plan,availableAddons:k.availableAddons,availableCharges:T.billableFeatures,preferredBillingPeriod:r,preconfiguredBillableFeatures:n!=null?n:[]});return {checkout:p,checkoutLocalization:F,stiggTheme:b,theme:S,progressBar:I,planStep:T,addonsStep:k,paymentStep:w,resourceId:(N=p==null?void 0:p.resource)==null?void 0:N.id,widgetState:{readOnly:false,isValid:true,isLoadingCheckoutData:g},showWatermark:h,checkoutSuccess:false,onBeforeStepChange:f,resetBillingPeriod:y}},[r,l,p,g,u,(A=s==null?void 0:s.taxDetails)==null?void 0:A.taxPercentage,f,y]);return jsx(w,{componentTheme:P,children:jsx(vh,{initialState:x,children:e})},p==null?void 0:p.plan.id)}var Rc="920px",_c=e.div`
513
+ `;function tc(){let e=me("md");return jsx(Re,{container:true,spacing:4,className:"stigg-subscription-usage-skeleton-layout",sx:{flexWrap:"wrap"},children:Ay(6).map(t=>jsx(Re,{size:{xs:e?4:12},children:jsx(Xe,{width:280,height:120})},t))})}function oc({showAll:e,onToggle:t}){return jsx(ec,{children:jsx(je,{className:"stigg-usage-toggle-many-button",variant:"text",startIcon:e?jsx(Minus,{}):jsx(Plus,{}),onClick:t,children:e?"Show less":"Show more"})})}function ur({onManageSubscription:e,onBuyMore:t,filterEntitlements:o,filterPackageEntitlements:r}){let{textOverrides:n,theme:i}=Y(),{isLoadingData:a,entitlementsToShow:l,creditsToShow:s,subscriptionPriceByFeature:c,gridSizeXs:u,hasCustomSubscription:f,canUpgradeSubscription:y,showAll:p,toggleShowAll:g,hasNoItems:h,showMoreVisible:P}=Zl({filterEntitlements:o,filterPackageEntitlements:r});return h?null:jsxs(Ue,{className:"stigg-subscription-usage-layout",$backgroundColor:i.backgroundColor,$borderColor:i.borderColor,children:[jsx(Ne,{children:jsx(Me,{title:n.usageTabTitle,className:"stigg-customer-portal-usage-section-title",isLoading:a})}),a?jsx(tc,{}):jsxs(Fragment,{children:[jsx(Xl,{featureEntitlements:l,creditEntitlements:s,subscriptionPriceByFeature:c,gridSizeXs:u,onManageSubscription:e,onBuyMore:t,hasCustomSubscription:f,canUpgradeSubscription:y}),P&&jsx(oc,{showAll:p,onToggle:g})]})]})}function ic({onManageSubscription:e,onBuyMore:t,filterEntitlements:o,filterPackageEntitlements:r,onCancelScheduledUpdates:n,onContactSupport:i,paywallComponent:a,hiddenSections:l}){let{customerPortal:s,textOverrides:c,theme:u,isLoading:f,showWatermark:y}=Y(),p=useRef(null),g=({intentionType:x})=>{var A,S;e?e({intentionType:x,customerSubscriptions:(A=s==null?void 0:s.subscriptions)!=null?A:[]}):(S=p==null?void 0:p.current)==null||S.scrollIntoView({behavior:"smooth"});},h=!(l!=null&&l.some(x=>x==="usage")),P=!(l!=null&&l.some(x=>x==="paymentDetails"||x==="billingInformation")),b=!(l!=null&&l.some(x=>x==="invoices"||x==="billingInformation"));return jsxs(_l,{className:"stigg-customer-portal-layout",children:[jsx(vl,{showWatermark:y}),jsxs(Dl,{className:"stigg-customer-portal-sections",children:[jsx(tr,{onCancelScheduledUpdates:n,onBuyMore:t,onManageSubscription:g,onContactSupport:i,hiddenSections:l,cancelScheduledUpdatesButtonTitle:c.cancelScheduledUpdatesButtonTitle}),h&&jsx(ur,{onManageSubscription:g,onBuyMore:t,filterEntitlements:o,filterPackageEntitlements:r}),jsx(Xn,{ref:p,paywallComponent:a,theme:u,title:c.paywallSectionTitle,isLoading:!s||f}),P&&jsx(ar,{}),b&&jsx(gr,{})]})]})}function sc(i){var a$1=i,{textOverrides:e,theme:t,resourceId:o,productId:r}=a$1,n=c(a$1,["textOverrides","theme","resourceId","productId"]);return jsx(Do,{textOverrides:e,theme:t,resourceId:o,productId:r,children:jsx(ic,a({},n))})}function gr(){let{customerPortal:e,isLoading:t,textOverrides:o,theme:r}=Y(),n=!e||t,i=n?jsx(nr,{}):e!=null&&e.billingPortalUrl?jsx(or,{url:e.billingPortalUrl,text:o.viewInvoiceHistory,className:"stigg-view-invoice-history-button"}):null;return !n&&!(e!=null&&e.billingPortalUrl)?null:jsx(Ue,{className:"stigg-invoices-section-layout",$backgroundColor:r.backgroundColor,$borderColor:r.borderColor,children:jsxs(Ne,{className:"stigg-invoices-section-header",children:[jsx(Me,{isLoading:n,className:"stigg-invoices-section-title",title:o.invoicesTitle}),i]})})}var cc=e=>lc(e,"displayName"),ii=e=>lc(e,"addon.displayName");function lt(e){var r,n;let t=(r=e.pricePoints)==null?void 0:r.some(i=>i.amount&&i.amount>0);return !!((n=e.hiddenFromWidgets)!=null&&n.includes(WidgetType.Checkout))&&!t}function Ry(e,t){return e.pricePoints.some(o=>o.billingPeriod===t)}function dc({addon:e,currency:t,billingCountryCode:o}){return b(a({},e),{pricePoints:e.pricePoints.filter(r=>r.currency===t&&(o?r.billingCountryCode===o:true))})}function pc({addons:e,billingCountryCode:t,currency:o}){return (e==null?void 0:e.map(r=>dc({addon:r,currency:o,billingCountryCode:t})))||[]}function mc({addons:e,billingPeriod:t,billingCountryCode:o,currency:r}){var n;return ((n=e==null?void 0:e.filter(i=>Ry(i.addon,t)))==null?void 0:n.map(i=>b(a({},i),{addon:dc({addon:i.addon,currency:r,billingCountryCode:o})})))||[]}function uc({activeSubscription:e,plan:t,billingCountryCode:o,billingPeriod:r}){var c,u;let n=[],i=((u=(c=t==null?void 0:t.pricePoints)==null?void 0:c[0])==null?void 0:u.currency)||Currency.Usd,a=pc({addons:t==null?void 0:t.compatibleAddons,billingCountryCode:o,currency:i}),l=cc(a.filter(f=>!lt(f))),s=mc({addons:e==null?void 0:e.addons,billingPeriod:r,billingCountryCode:o,currency:i});return s!=null&&s.length&&(a!=null&&a.length)&&(n=ii(s.filter(f=>a.some(y=>y.id===f.addon.id)))),{addons:n,initialAddons:Uy(n),availableAddons:l}}function $y(){let[,e]=_();return (t,o)=>e(r=>{if(lt(t))return;let n=r.addonsStep.addons.find(i=>i.addon.id===t.id);if(n){if(lt(n.addon))return;n.quantity=o;}else r.addonsStep.addons.push({addon:t,quantity:o}),r.addonsStep.addons=ii(r.addonsStep.addons);})}function Gy(){let[,e]=_();return t=>e(o=>{let r=o.addonsStep.addons.find(n=>n.addon.id===t);r&&lt(r.addon)||_y(o.addonsStep.addons,n=>n.addon.id===t);})}function Vy(){let[{addonsStep:e}]=_();return e}function gc(){let e=Vy();return b(a({},e),{setAddon:$y(),removeAddon:Gy()})}function zy(){let[{checkout:e,widgetState:t,checkoutLocalization:o,checkoutSuccess:r}]=_();return {checkoutState:e,widgetState:t,checkoutLocalization:o,checkoutSuccess:r}}function Oy(){let[,e]=_();return t=>e(o=>{o.widgetState.readOnly=t;})}function Hy(){let[,e]=_();return t=>e(o=>{o.widgetState.isValid=t;})}function Wy(){let[,e]=_();return t=>e(o=>{o.checkoutSuccess=t;})}function D(){let{checkoutState:e,widgetState:t,checkoutLocalization:o,checkoutSuccess:r}=zy();return {checkoutState:e,widgetState:t,checkoutLocalization:o,checkoutSuccess:r,setWidgetReadOnly:Oy(),setIsValid:Hy(),setCheckoutSuccess:Wy()}}function Qy(e){var t;return (t=e==null?void 0:e.plan)!=null&&t.pricePoints?b(a({},e),{plan:b(a({},e.plan),{pricePoints:e.plan.pricePoints.filter(o=>o.pricingModel!==BillingModel.CreditBased)})}):e}function yc({planId:e,resourceId:t,billingCountryCode:o,onMockCheckoutState:r$1}){let{stigg:n}=u(),[i,a]=useState(true),[l,s]=useState();return useEffect(()=>{let c=()=>d(null,null,function*(){try{let u=yield n.getCheckoutState({planId:e,resourceId:t,billingCountryCode:o});s(Qy(u));}catch(u){r.error(`Failed to load checkout ${u==null?void 0:u.message}`,u);}finally{a(false);}});if(r$1){a(false);let u=r$1({planId:e,resourceId:t,billingCountryCode:o});s(u);return}n.isCustomerLoaded&&(a(true),c());},[n,n.isCustomerLoaded,t,e,o,r$1]),{checkout:l,isLoading:i,showWatermark:n.getShowWatermark()}}var yr=(e,t)=>e.minUnitQuantity&&t<e.minUnitQuantity?e.minUnitQuantity:e.maxUnitQuantity&&t>e.maxUnitQuantity?e.maxUnitQuantity:t;var ai=e=>!!(e!=null&&e.pricePoints.some(t=>t.billingPeriod===BillingPeriod$1.Monthly)),si=e=>!!(e!=null&&e.pricePoints.some(t=>t.billingPeriod===BillingPeriod$1.Annually)),Cc=e=>ai(e)&&si(e);var bc=(e,t,o)=>e===BillingPeriod$1.Monthly&&t||e===BillingPeriod$1.Annually&&o?e:null,Sc=({pricingModel:e})=>e===BillingModel.PerUnit;function qy(e,t,o){var i;if(!t)return [];let r=Gl(e,"featureId"),n=Gl(xc((i=o==null?void 0:o.prices)==null?void 0:i.map(a=>{let{feature:l}=a;return !l||!Sc(a)?null:{featureId:l.featureId,quantity:l.unitQuantity||null}})),"featureId");return xc(t==null?void 0:t.map(a=>{var u,f,y;let l=(u=a.feature)==null?void 0:u.featureId;if(!l||!Sc(a))return null;let s,c=((f=r[l])==null?void 0:f.quantity)||((y=n[l])==null?void 0:y.quantity);return s=yr(a,c||1),a.isTieredPrice&&!Wt(a.tiers)&&(s=xn(a.tiers,s).upTo),{featureId:l,quantity:s}}))}function Jy({plan:e,activeSubscription:t,preferredBillingPeriod:o}){var a,l;let r=ai(e),n=si(e);if(o){let s=bc(o,r,n);if(s)return s}if(((a=t==null?void 0:t.plan)==null?void 0:a.id)===(e==null?void 0:e.id))return ((l=t==null?void 0:t.price)==null?void 0:l.billingPeriod)||BillingPeriod$1.Monthly;if(t!=null&&t.prices&&(t==null?void 0:t.prices.length)>0){let s=bc(t==null?void 0:t.prices[0].billingPeriod,r,n);if(s)return s}return n?BillingPeriod$1.Annually:BillingPeriod$1.Monthly}function Tc({preferredBillingPeriod:e,plan:t,activeSubscription:o,billingCountryCode:r,preconfiguredBillableFeatures:n}){let i=Jy({plan:t,activeSubscription:o,preferredBillingPeriod:e}),a=t==null?void 0:t.pricePoints.filter(s=>s.billingPeriod===i),l=qy(n,a,o);return {billingPeriod:i,billableFeatures:l,billingCountryCode:r}}function Xy(){let[{planStep:e}]=_();return e}function jy(){let[,e]=_();return (t,o)=>e(r=>{let n=r.planStep.billableFeatures.find(i=>i.featureId===t);n?n.quantity=o:r.planStep.billableFeatures.push({featureId:t,quantity:o});})}function eh(){let[,e]=_();return t=>e(o=>{o.planStep.billingPeriod=t,o.addonsStep.addons=o.addonsStep.addons.filter(r=>r.addon.pricePoints.some(n=>n.billingPeriod===t));})}function be(){let e=Xy();return b(a({},e),{setBillingPeriod:eh(),setBillableFeature:jy()})}var wc=[{key:"PLAN",label:"Plan"},{key:"ADDONS",label:"Add-ons"},{key:"PAYMENT",label:"Payment details"}],kc={activeStep:0,completedSteps:[],steps:wc,isDisabled:false},oh=(e,t,o,r)=>{if(Cc(e)&&!r)return false;let n=t.map(a=>a.featureId),i=o.map(a=>a.featureId);return !(n.length!==i.length||!n.every(a=>i.includes(a)))};function Bc({isLoading:e,skipCheckoutSteps:t,plan:o,availableAddons:r,availableCharges:n,preferredBillingPeriod:i,preconfiguredBillableFeatures:a$1}){if(e||!o)return kc;let l=[];return t.includes("PLAN")&&oh(o,n,a$1,i)&&l.push("PLAN"),((r==null?void 0:r.length)===0||t.includes("ADDONS"))&&l.push("ADDONS"),b(a({},kc),{steps:wc.filter(s=>!l.includes(s.key))})}function rh(){let[{progressBar:e}]=_();return e}function nh(){let[e,t]=_();return o=>d(null,null,function*(){let{progressBar:r,planStep:n,addonsStep:i,paymentStep:a,onBeforeStepChange:l}=e;if(o!==r.activeStep&&l){let s=r.steps[r.activeStep],c=r.steps[o];if(s&&c){let u={planStep:n,addonsStep:i,paymentStep:a};if(!(yield l({from:s.key,to:c.key,state:u})))return}}t(({progressBar:s})=>{s.activeStep=o;});})}function ih(){let[,e]=_();return t=>e(({progressBar:o})=>{o.completedSteps.push(t);})}function ah(e){return e.completedSteps.length>=e.steps.length-1}function sh(){let[e,t]=_();return ()=>d(null,null,function*(){let{progressBar:o,planStep:r,addonsStep:n,paymentStep:i,onBeforeStepChange:a}=e;if(o.isDisabled)return;let l=o.steps[o.activeStep],s=o.steps[o.activeStep+1];if(s&&a){let c={planStep:r,addonsStep:n,paymentStep:i};if(!(yield a({from:l.key,to:s.key,state:c})))return}t(({progressBar:c})=>{c.completedSteps.includes(c.activeStep)||c.completedSteps.push(c.activeStep),c.activeStep<c.steps.length-1&&(c.activeStep+=1);});})}function lh(){let[,e]=_();return t=>e(({progressBar:o})=>{o.isDisabled=!!t;})}function _e(){let e=rh();return {currentStep:e.steps[e.activeStep],progressBarState:e,isLastStep:e.activeStep===e.steps.length-1,isCheckoutComplete:ah(e),setActiveStep:nh(),markStepAsCompleted:ih(),goNext:sh(),setIsDisabled:lh()}}function It(){let[{planStep:e,addonsStep:t,promotionCode:o,paymentStep:r}]=_();return b(a({},e),{addons:t.addons,promotionCode:o,billingAddress:r.billingAddress,taxPercentage:r.taxPercentage,taxId:r.taxId})}function hr({billingAddress:e,taxPercentage:t,taxIds:o,prorationBehavior:r}){if(!e&&!t&&!(o!=null&&o.length)&&!r)return {};let n=o!=null&&o.length?o==null?void 0:o.filter(i=>i.value&&i.type):void 0;return {billingInformation:a(b(a(a({},e?{billingAddress:e}:{}),t?{taxPercentage:t}:{}),{taxIds:n}),r?{prorationBehavior:r}:{})}}function ph(e){return e.pricingModel===BillingModel.PerUnit&&e.billingCadence===BillingCadence.Recurring&&!!e.topUpCustomCurrencyId}function mh(e){return e!=null&&e.pricePoints?e.pricePoints.some(ph):false}function Cr({resetBillingPeriod:e,activeSubscription:t}){if(!t)return {};let o=mh(t.plan);return e!==void 0?{billingCycleAnchor:e?SubscriptionBillingCycleAnchor.Now:SubscriptionBillingCycleAnchor.Unchanged,prorationBehavior:o?SubscriptionProrationBehavior.None:void 0}:o?{billingCycleAnchor:SubscriptionBillingCycleAnchor.Now,prorationBehavior:SubscriptionProrationBehavior.None}:{}}var yh=h=>d(null,[h],function*({stigg:e,customerId:t,resourceId:o,promotionCode:r,addons:n,billableFeatures:i,billingCountryCode:a$1,billingPeriod:l,billingAddress:s,taxPercentage:c,taxIds:u,plan:f,activeSubscription:y,resetBillingPeriod:p,onMockCheckoutPreview:g}){var F;let P=n.map(({addon:T,quantity:k})=>({addonId:T.id,quantity:k})),b=null,x=null,{prorationBehavior:A,billingCycleAnchor:S}=Cr({activeSubscription:y,resetBillingPeriod:p});try{if(t&&(f!=null&&f.id)){let T=a(a({customerId:t,planId:f.id,resourceId:o,billingCountryCode:a$1,addons:P,billingPeriod:l,promotionCode:r,billableFeatures:Xg(i)?void 0:i},hr({billingAddress:s,taxPercentage:c,taxIds:u,prorationBehavior:A})),S?{billingCycleAnchor:S}:{});b=g?g(T):yield e.previewSubscription(T);}}catch(T){let[,k]=((F=T==null?void 0:T.message)==null?void 0:F.split("Error:"))||[];x=k==null?void 0:k.trim();}return {subscriptionPreview:b,errorMessage:x}}),di=({onMockCheckoutPreview:e}={})=>{let{stigg:t}=u(),o=It(),[{resourceId:r,resetBillingPeriod:n}]=_(),{checkoutState:i,widgetState:a}=D(),{plan:l,customer:s,activeSubscription:c}=i||{};return {previewSubscriptionAction:useCallback((...y)=>d(null,[...y],function*({promotionCode:f}={}){return a.isValid?yh({stigg:t,customerId:s==null?void 0:s.id,resourceId:r,addons:o.addons,billableFeatures:o.billableFeatures,billingCountryCode:o.billingCountryCode,billingPeriod:o.billingPeriod,billingAddress:o.billingAddress,taxPercentage:o.taxPercentage,promotionCode:f!=null?f:o.promotionCode,taxIds:o.taxId?[o.taxId]:void 0,plan:l,activeSubscription:c,resetBillingPeriod:n,onMockCheckoutPreview:e}):{subscriptionPreview:null,errorMessage:null}}),[t,s==null?void 0:s.id,l,r,n,o.addons,o.billableFeatures,o.billingCountryCode,o.billingPeriod,o.billingAddress,o.taxPercentage,o.taxId,o.promotionCode,a.isValid,c,e])}},hh=500,Ic=({onMockCheckoutPreview:e}={})=>{let[t,o]=useState(null),[r,n]=useState(null),[i,a]=useState(false),{previewSubscriptionAction:l}=di({onMockCheckoutPreview:e});return useEffect(()=>{let s=()=>d(null,null,function*(){let{subscriptionPreview:u,errorMessage:f}=yield l();u&&(o(u),n(null)),f&&(n(f),o(null)),a(false);});a(true);let c=setTimeout(()=>{a(true),s();},hh);return ()=>{clearTimeout(c);}},[l]),{subscriptionPreview:t,isFetchingSubscriptionPreview:i,errorMessage:r}};function Fc({customer:e,taxPercentage:t,taxId:o}){return {useNewPaymentMethod:!(e!=null&&e.paymentMethodDetails),taxPercentage:t,taxId:o}}function Ch(){let[,e]=_();return useCallback(t=>e(o=>{o.paymentStep.useNewPaymentMethod=t;}),[e])}function Ph(){let[,e]=_();return useCallback(t=>e(o=>{o.paymentStep.errorMessage=t;}),[e])}function xh(){let[,e]=_();return useCallback(t=>e(o=>{o.paymentStep.billingAddress=t;}),[e])}function bh(){let[{paymentStep:e}]=_();return e}function Sh(){let[,e]=_();return useCallback(t=>e(o=>{o.paymentStep.taxId=t;}),[e])}function re(){let e=bh();return b(a({},e),{setUseNewPaymentMethod:Ch(),setErrorMessage:Ph(),setBillingAddress:xh(),setTaxId:Sh()})}function vc(e){return Ug({changePlan:"Change",billingPeriodsTitle:"Billing cycle",addAddonText:"Add",addonBillingPeriodNotAvailableText:({planBillingPeriod:o})=>o===BillingPeriod.Monthly?"Exclusively available on annual plans":"Exclusively available on monthly plans",newPaymentMethodText:"New payment method",newPaymentMethodBillingAddressTitle:"Billing address",newPaymentMethodCardTitle:"Payment method",summary:{title:"Order summary",planName:({plan:o})=>`${o.displayName} plan`,addCouponCodeText:"Add promotion code",couponCodeTitle:"Promotion code",addonsSectionTitle:"Add-ons",discountsSectionTitle:"Discounts",onlyPayAsYouGoText:"Varies by usage",startsAtText:"Starts at ",proratedTotalDueText:"Prorated charge today",baseChargeText:()=>"Base charge",totalText:"Total",totalDueText:"Total due today",totalBillingPeriodText:({billingPeriod:o})=>`Billed ${o.toLowerCase()}`,appliedCreditsTitle:"Applied credits",creditsForUnusedTimeText:({credits:o})=>`Your account will be granted credits worth ${o} for unused time, which will be automatically applied to future payments.`,discountText:({discountDetails:o,currency:r})=>{let n=o.type===DiscountType.Percentage?`${o.value}% off`:`${H({amount:o.value,currency:r})}`,i;switch(o.durationType){case DiscountDurationType.Once:{i=" once";break}case DiscountDurationType.Repeating:{i=`${o.type===DiscountType.Fixed?" per month":""} for ${o.durationInMonths} months`;break}case DiscountDurationType.Forever:default:i="";}return `${n}${i}`},taxTitle:({taxDetails:o})=>`Tax (${o==null?void 0:o.percentage}%)`,changesWillApplyAtEndOfBillingPeriod:({billingPeriodEnd:o})=>`Your changes will take effect at the end of your current billing cycle on ${Z(o).format("MMMM D, YYYY")}.`,checkoutSuccessText:"Changes applied",payAsYouGoTooltipText:"Billed according to actual usage"},checkoutButton:{nextText:"Next",noChangesText:"No changes",updateText:"Update subscription",downgradeToFreeText:"Cancel subscription",upgradeText:"Subscribe"},downgradeToFree:{alertText:()=>"We\u2019re sorry to see you cancel your paid subscription \u{1F62D}",freePlanHeader:()=>"New plan",freePlanName:({plan:o})=>`${o.displayName}`,freePlanPriceText:()=>"Free",paidPlanHeader:()=>"Current plan",paidPlanName:({plan:o})=>`${o.displayName}`,paidPlanPriceText:({billingPeriod:o})=>`Paid plan${o?`, billed ${o.toLowerCase()}`:""}`},nextBillingCaption:()=>""},e)}var no={primary:"rgb(50, 126, 238)",textColor:"rgb(0, 30, 108)",backgroundColor:"rgb(255, 255, 255)",borderColor:"rgb(235, 237, 243)",summaryBackgroundColor:"rgb(109, 121, 144)"};function Lc(e,t,o){let{palette:r}=e||{};return {primary:(t==null?void 0:t.primary)||(r==null?void 0:r.primary)||no.primary,textColor:(t==null?void 0:t.textColor)||(r==null?void 0:r.text.primary)||no.textColor,backgroundColor:(t==null?void 0:t.backgroundColor)||(r==null?void 0:r.backgroundPaper)||no.backgroundColor,borderColor:(t==null?void 0:t.borderColor)||(r==null?void 0:r.outlinedBorder)||no.borderColor,summaryBackgroundColor:(t==null?void 0:t.summaryBackgroundColor)||(r==null?void 0:r.backgroundHighlight)||no.summaryBackgroundColor,paymentInputBackgroundColor:t==null?void 0:t.paymentInputBackgroundColor,paymentInputBorderColor:t==null?void 0:t.paymentInputBorderColor,paymentInputBorderRadius:t==null?void 0:t.paymentInputBorderRadius}}var ui=hi.createContext(null);ui.displayName="CheckoutContext";var _=()=>{let e=useContext(ui);if(!e)throw new Error("Could not find Checkout context; You need to wrap your checkout components in an <CheckoutProvider> component.");return e},vh=({children:e,initialState:t})=>{let[o,r]=useState(t);useEffect(()=>{r(t);},[t]);let n=useCallback(l=>r(s=>produce(s,c=>l(c))),[r]),[i,a]=useMemo(()=>[o,n],[n,o]);return jsx(ui.Provider,{value:[i,a],children:e})};function Mc({children:e,textOverrides:t,theme:o,preferredBillingPeriod:r,billableFeatures:n,resourceId:i,planId:a,billingCountryCode:l,billingInformation:s,onMockCheckoutState:c,skipCheckoutSteps:u,onBeforeStepChange:f,resetBillingPeriod:y}){var A;let{checkout:p,isLoading:g,showWatermark:h}=yc({resourceId:i,planId:a,billingCountryCode:l,onMockCheckoutState:c}),P=p!=null&&p.configuration?Ss(p.configuration):{typography:Jt(null,Ro)},b=v(P),x=useMemo(()=>{var L,N;let S=Lc(b,o,p==null?void 0:p.configuration),F=vc(t),T=Tc({preferredBillingPeriod:r,plan:p==null?void 0:p.plan,activeSubscription:p==null?void 0:p.activeSubscription,billingCountryCode:l,preconfiguredBillableFeatures:n!=null?n:[]}),k=uc({plan:p==null?void 0:p.plan,activeSubscription:p==null?void 0:p.activeSubscription,billingPeriod:T.billingPeriod}),w=Fc({customer:p==null?void 0:p.customer,taxPercentage:(L=s==null?void 0:s.taxDetails)==null?void 0:L.taxPercentage}),I=Bc({isLoading:g,skipCheckoutSteps:u!=null?u:[],plan:p==null?void 0:p.plan,availableAddons:k.availableAddons,availableCharges:T.billableFeatures,preferredBillingPeriod:r,preconfiguredBillableFeatures:n!=null?n:[]});return {checkout:p,checkoutLocalization:F,stiggTheme:b,theme:S,progressBar:I,planStep:T,addonsStep:k,paymentStep:w,resourceId:(N=p==null?void 0:p.resource)==null?void 0:N.id,widgetState:{readOnly:false,isValid:true,isLoadingCheckoutData:g},showWatermark:h,checkoutSuccess:false,onBeforeStepChange:f,resetBillingPeriod:y}},[r,l,p,g,u,(A=s==null?void 0:s.taxDetails)==null?void 0:A.taxPercentage,f,y]);return jsx(w,{componentTheme:P,children:jsx(vh,{initialState:x,children:e})},p==null?void 0:p.plan.id)}var Rc="920px",_c=e.div`
514
514
  margin: auto;
515
515
  min-height: 760px;
516
516
  max-width: ${Rc};
@@ -553,7 +553,7 @@ import {e,f,i,j,a,g,b,h,c,p,w,u,v,d,x,y,z,B,G,A,H as H$1,C,I,q,r,K,o,l,m,n,k}fro
553
553
  ${oe.md} {
554
554
  width: auto;
555
555
  }
556
- `;var Vc=e(qf,{shouldForwardProp:e=>!e.startsWith("$")})(({theme:e,$disabled:t})=>({[`&.${linearProgressClasses.root}`]:{borderRadius:e.stigg.border.radius,backgroundColor:e.stigg.palette.outlinedBorder},[`& .${linearProgressClasses.bar}`]:{backgroundColor:t?e.stigg.palette.primaryLight:e.stigg.palette.primary}})),zc=e(Pu)({[`&.${buttonClasses.root}`]:{textTransform:"none",lineHeight:"inherit",justifyContent:"flex-start",padding:"8px 4px"}}),Oc=e(i,{shouldForwardProp:e=>!e.startsWith("$")})(({theme:e,$disabled:t,$shouldFill:o})=>({circle:{stroke:t?e.stigg.palette.primaryLight:e.stigg.palette.primary,fill:o?t?e.stigg.palette.primaryLight:e.stigg.palette.primary:void 0}}));var Wc=()=>{let{progressBarState:e,setActiveStep:t,currentStep:o$1}=_e(),{widgetState:r}=D(),n=me("md"),i=useRef(),{readOnly:a,isLoadingCheckoutData:l}=r,{activeStep:s,completedSteps:c,steps:u}=e||{},f$1=(s+1)*100/u.length,[y,p]=hi.useState(o$1);return useEffect(()=>{n||i.current&&o$1!==y&&i.current.scrollIntoView({behavior:"smooth"}),p(o$1);},[o$1,n,y,p]),e.steps.length===1?null:jsxs(ke,{className:"stigg-checkout-progress-container",sx:{width:"100%",mb:3},ref:i,children:[jsx(Vc,{variant:"determinate",value:f$1,$disabled:a}),jsx(Re,{container:true,display:"flex",children:u.map(({key:g,label:h},P)=>{let b=c.includes(P),x=a||P>s&&!b&&!c.includes(P-1)||s!==P&&e.isDisabled;return jsx(Re,{item:true,display:"flex",flexDirection:"row",flex:n?1:"auto",justifyContent:"flex-start",children:l?jsx(o,{width:120,height:20,style:{marginTop:8}}):jsx(zc,{onClick:()=>t(P),fullWidth:true,disabled:x,children:jsxs(Re,{item:true,display:"flex",flexDirection:"row",alignItems:"center",gap:1,children:[jsx($h,{icon:jsx(Oc,{icon:b?x?"OutlinedCheckedCircleDisabled":"OutlinedCheckedCircle":"OutlinedCircle",$disabled:x,$shouldFill:b})}),jsx(f,{variant:"h6",color:x?"primary.main.light":"primary.main",children:h})]})})},g)})})]})};var zh=[BillingModel.FlatFee,BillingModel.PerUnit,BillingModel.UsageBased],Oh=e=>lc(e,[t=>zh.indexOf(t.pricingModel),t=>{var o;return (o=t.feature)==null?void 0:o.displayName}]),xr=e=>useMemo(()=>Oh(e),[e]);function Hh(){let[{promotionCode:e}]=_();return e}function Wh(){let[,e]=_();return t=>e(o=>{o.promotionCode=t;})}function Ft(){return {promotionCode:Hh(),setPromotionCode:Wh()}}var Zh=e=>jsx("svg",b(a({width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:jsxs("g",{id:"plus",children:[jsx("path",{id:"Shape",d:"M10 4.16666V15.8333",stroke:"#327EEE",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),jsx("path",{id:"Shape_2",d:"M4.16699 10H15.8337",stroke:"#327EEE",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})]})})),br=Zh;var Qh=e(br,{shouldForwardProp:e=>!e.startsWith("$")})`
556
+ `;var Vc=e(qf,{shouldForwardProp:e=>!e.startsWith("$")})(({theme:e,$disabled:t})=>({[`&.${linearProgressClasses.root}`]:{borderRadius:e.stigg.border.radius,backgroundColor:e.stigg.palette.outlinedBorder},[`& .${linearProgressClasses.bar}`]:{backgroundColor:t?e.stigg.palette.primaryLight:e.stigg.palette.primary}})),zc=e(Pu)({[`&.${buttonClasses.root}`]:{textTransform:"none",lineHeight:"inherit",justifyContent:"flex-start",padding:"8px 4px"}}),Oc=e(i,{shouldForwardProp:e=>!e.startsWith("$")})(({theme:e,$disabled:t,$shouldFill:o})=>({circle:{stroke:t?e.stigg.palette.primaryLight:e.stigg.palette.primary,fill:o?t?e.stigg.palette.primaryLight:e.stigg.palette.primary:void 0}}));var Wc=()=>{let{progressBarState:e,setActiveStep:t,currentStep:o$1}=_e(),{widgetState:r}=D(),n=me("md"),i=useRef(),{readOnly:a,isLoadingCheckoutData:l}=r,{activeStep:s,completedSteps:c,steps:u}=e||{},f$1=(s+1)*100/u.length,[y,p]=hi.useState(o$1);return useEffect(()=>{n||i.current&&o$1!==y&&i.current.scrollIntoView({behavior:"smooth"}),p(o$1);},[o$1,n,y,p]),e.steps.length===1?null:jsxs(ke,{className:"stigg-checkout-progress-container",sx:{width:"100%",mb:3},ref:i,children:[jsx(Vc,{variant:"determinate",value:f$1,$disabled:a}),jsx(Re,{sx:{display:"flex",width:"100%"},children:u.map(({key:g,label:h},P)=>{let b=c.includes(P),x=a||P>s&&!b&&!c.includes(P-1)||s!==P&&e.isDisabled;return jsx(Re,{display:"flex",flexDirection:"row",flex:n?1:"auto",justifyContent:"flex-start",children:l?jsx(o,{width:120,height:20,style:{marginTop:8}}):jsx(zc,{onClick:()=>t(P),fullWidth:true,disabled:x,children:jsxs(Re,{display:"flex",flexDirection:"row",alignItems:"center",gap:1,children:[jsx($h,{icon:jsx(Oc,{icon:b?x?"OutlinedCheckedCircleDisabled":"OutlinedCheckedCircle":"OutlinedCircle",$disabled:x,$shouldFill:b})}),jsx(f,{variant:"h6",color:x?"primary.main.light":"primary.main",children:h})]})})},g)})})]})};var zh=[BillingModel.FlatFee,BillingModel.PerUnit,BillingModel.UsageBased],Oh=e=>lc(e,[t=>zh.indexOf(t.pricingModel),t=>{var o;return (o=t.feature)==null?void 0:o.displayName}]),xr=e=>useMemo(()=>Oh(e),[e]);function Hh(){let[{promotionCode:e}]=_();return e}function Wh(){let[,e]=_();return t=>e(o=>{o.promotionCode=t;})}function Ft(){return {promotionCode:Hh(),setPromotionCode:Wh()}}var Zh=e=>jsx("svg",b(a({width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:jsxs("g",{id:"plus",children:[jsx("path",{id:"Shape",d:"M10 4.16666V15.8333",stroke:"#327EEE",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),jsx("path",{id:"Shape_2",d:"M4.16699 10H15.8337",stroke:"#327EEE",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})]})})),br=Zh;var Qh=e(br,{shouldForwardProp:e=>!e.startsWith("$")})`
557
557
  margin-right: 8px;
558
558
  path {
559
559
  stroke: ${({theme:e,$disabled:t})=>t?e.stigg.palette.text.disabled:e.stigg.palette.primary};
@@ -583,9 +583,9 @@ import {e,f,i,j,a,g,b,h,c,p,w,u,v,d,x,y,z,B,G,A,H as H$1,C,I,q,r,K,o,l,m,n,k}fro
583
583
  path {
584
584
  fill: ${({theme:e,$shouldFill:t})=>t?e.stigg.palette.primary:void 0};
585
585
  }
586
- `,Jc=({promotionCode:e,onClearPromotionCode:t})=>jsxs(tC,{container:true,children:[jsxs(Re,{item:true,display:"flex",gap:1,alignItems:"center",children:[jsx(Kc,{icon:"Coupon"}),jsx(f,{variant:"body1",color:"primary.main",lineHeight:"auto",children:e})]}),jsx(Re,{item:true,children:jsx(te,{variant:"text",sx:{minWidth:"unset",padding:0},onClick:t,children:jsx(Kc,{icon:"Close",$shouldFill:true})})})]});var oC=e.div`
586
+ `,Jc=({promotionCode:e,onClearPromotionCode:t})=>jsxs(tC,{container:true,children:[jsxs(Re,{display:"flex",gap:1,alignItems:"center",children:[jsx(Kc,{icon:"Coupon"}),jsx(f,{variant:"body1",color:"primary.main",lineHeight:"auto",children:e})]}),jsx(Re,{children:jsx(te,{variant:"text",sx:{minWidth:"unset",padding:0},onClick:t,children:jsx(Kc,{icon:"Close",$shouldFill:true})})})]});var oC=e.div`
587
587
  margin: 16px 0;
588
- `,Xc=({disabled:e,checkoutLocalization:t,onMockCheckoutPreview:o})=>{let{promotionCode:r,setPromotionCode:n}=Ft();return jsx(oC,{children:r?jsx(Jc,{promotionCode:r,onClearPromotionCode:()=>{n("");}}):jsx(Qc,{disabled:e,checkoutLocalization:t,onMockCheckoutPreview:o})})};var jc=({label:e,checked:t,onChange:o,onClick:r,value:n,disabled:i,dataTestId:a})=>jsx(nC,{onClick:r,value:n,control:jsx(rC,{checked:t,onChange:o,disabled:i,"data-testid":a}),label:iC(e)?jsx(f,{variant:"body1",lineHeight:"20px",color:"secondary",children:e}):e});var Ti=[{country:"Albania",countryCode:"AL",taxIdType:"al_tin",FlagComponent:AL,example:"J12345678N"},{country:"Andorra",countryCode:"AD",taxIdType:"ad_nrt",FlagComponent:AD,example:"A-123456-Z"},{country:"Angola",countryCode:"AO",taxIdType:"ao_tin",FlagComponent:AO,example:"5123456789"},{country:"Argentina",countryCode:"AR",taxIdType:"ar_cuit",FlagComponent:AR,example:"12-3456789-01"},{country:"Armenia",countryCode:"AM",taxIdType:"am_tin",FlagComponent:AM,example:"02538904"},{country:"Aruba",countryCode:"AW",taxIdType:"aw_tin",FlagComponent:AW,example:"12345678"},{country:"Australia",countryCode:"AU",taxIdType:"au_abn",FlagComponent:AU,example:"12345678912"},{country:"Australia",countryCode:"AU",taxIdType:"au_arn",FlagComponent:AU,example:"123456789123"},{country:"Austria",countryCode:"AT",taxIdType:"eu_vat",FlagComponent:AT,example:"ATU12345678"},{country:"Azerbaijan",countryCode:"AZ",taxIdType:"az_tin",FlagComponent:AZ,example:"0123456789"},{country:"Bahamas",countryCode:"BS",taxIdType:"bs_tin",FlagComponent:BS$1,example:"123.456.789"},{country:"Bahrain",countryCode:"BH",taxIdType:"bh_vat",FlagComponent:BH,example:"123456789012345"},{country:"Bangladesh",countryCode:"BD",taxIdType:"bd_bin",FlagComponent:BD,example:"123456789-0123"},{country:"Barbados",countryCode:"BB",taxIdType:"bb_tin",FlagComponent:BB,example:"1123456789012"},{country:"Belarus",countryCode:"BY",taxIdType:"by_tin",FlagComponent:BY,example:"123456789"},{country:"Belgium",countryCode:"BE",taxIdType:"eu_vat",FlagComponent:BE,example:"BE0123456789"},{country:"Benin",countryCode:"BJ",taxIdType:"bj_ifu",FlagComponent:BJ,example:"1234567890123"},{country:"Bolivia",countryCode:"BO",taxIdType:"bo_tin",FlagComponent:BO,example:"123456789"},{country:"Bosnia & Herzegovina",countryCode:"BA",taxIdType:"ba_tin",FlagComponent:BA,example:"123456789012"},{country:"Brazil",countryCode:"BR",taxIdType:"br_cnpj",FlagComponent:BR,example:"01.234.456/5432-10"},{country:"Brazil",countryCode:"BR",taxIdType:"br_cpf",FlagComponent:BR,example:"123.456.789-87"},{country:"Bulgaria",countryCode:"BG",taxIdType:"bg_uic",FlagComponent:BG,example:"123456789"},{country:"Bulgaria",countryCode:"BG",taxIdType:"eu_vat",FlagComponent:BG,example:"BG0123456789"},{country:"Burkina Faso",countryCode:"BF",taxIdType:"bf_ifu",FlagComponent:BF,example:"12345678A"},{country:"Cambodia",countryCode:"KH",taxIdType:"kh_tin",FlagComponent:KH,example:"1001-123456789"},{country:"Cameroon",countryCode:"CM",taxIdType:"cm_niu",FlagComponent:CM,example:"M123456789000L"},{country:"Canada",countryCode:"CA",taxIdType:"ca_bn",FlagComponent:CA,example:"123456789"},{country:"Canada",countryCode:"CA",taxIdType:"ca_gst_hst",FlagComponent:CA,example:"123456789RT0002"},{country:"Canada",countryCode:"CA",taxIdType:"ca_pst_bc",FlagComponent:CA,example:"PST-1234-5678"},{country:"Canada",countryCode:"CA",taxIdType:"ca_pst_mb",FlagComponent:CA,example:"123456-7"},{country:"Canada",countryCode:"CA",taxIdType:"ca_pst_sk",FlagComponent:CA,example:"1234567"},{country:"Canada",countryCode:"CA",taxIdType:"ca_qst",FlagComponent:CA,example:"1234567890TQ1234"},{country:"Cape Verde",countryCode:"CV",taxIdType:"cv_nif",FlagComponent:CV,example:"213456789"},{country:"Chile",countryCode:"CL",taxIdType:"cl_tin",FlagComponent:CL,example:"12.345.678-K"},{country:"China",countryCode:"CN",taxIdType:"cn_tin",FlagComponent:CN,example:"123456789012345678"},{country:"Colombia",countryCode:"CO",taxIdType:"co_nit",FlagComponent:CO,example:"123.456.789-0"},{country:"Congo - Kinshasa",countryCode:"CD",taxIdType:"cd_nif",FlagComponent:CD,example:"A0123456M"},{country:"Costa Rica",countryCode:"CR",taxIdType:"cr_tin",FlagComponent:CR,example:"1-234-567890"},{country:"Croatia",countryCode:"HR",taxIdType:"eu_vat",FlagComponent:HR,example:"HR12345678912"},{country:"Croatia",countryCode:"HR",taxIdType:"hr_oib",FlagComponent:HR,example:"12345678901"},{country:"Cyprus",countryCode:"CY",taxIdType:"eu_vat",FlagComponent:CY,example:"CY12345678Z"},{country:"Czech Republic",countryCode:"CZ",taxIdType:"eu_vat",FlagComponent:CZ,example:"CZ1234567890"},{country:"Denmark",countryCode:"DK",taxIdType:"eu_vat",FlagComponent:DK,example:"DK12345678"},{country:"Dominican Republic",countryCode:"DO",taxIdType:"do_rcn",FlagComponent:DO,example:"123-4567890-1"},{country:"Ecuador",countryCode:"EC",taxIdType:"ec_ruc",FlagComponent:EC,example:"1234567890001"},{country:"Egypt",countryCode:"EG",taxIdType:"eg_tin",FlagComponent:EG,example:"123456789"},{country:"El Salvador",countryCode:"SV",taxIdType:"sv_nit",FlagComponent:SV,example:"1234-567890-123-4"},{country:"Estonia",countryCode:"EE",taxIdType:"eu_vat",FlagComponent:EE,example:"EE123456789"},{country:"Ethiopia",countryCode:"ET",taxIdType:"et_tin",FlagComponent:ET,example:"1234567890"},{country:"EU",countryCode:"EU",taxIdType:"eu_oss_vat",FlagComponent:EU,example:"EU123456789"},{country:"Finland",countryCode:"FI",taxIdType:"eu_vat",FlagComponent:FI,example:"FI12345678"},{country:"France",countryCode:"FR",taxIdType:"eu_vat",FlagComponent:FR,example:"FRAB123456789"},{country:"Georgia",countryCode:"GE",taxIdType:"ge_vat",FlagComponent:GE,example:"123456789"},{country:"Germany",countryCode:"DE",taxIdType:"de_stn",FlagComponent:DE,example:"1234567890"},{country:"Germany",countryCode:"DE",taxIdType:"eu_vat",FlagComponent:DE,example:"DE123456789"},{country:"Greece",countryCode:"GR",taxIdType:"eu_vat",FlagComponent:GR,example:"EL123456789"},{country:"Guinea",countryCode:"GN",taxIdType:"gn_nif",FlagComponent:GN,example:"123456789"},{country:"Hong Kong",countryCode:"HK",taxIdType:"hk_br",FlagComponent:HK,example:"12345678"},{country:"Hungary",countryCode:"HU",taxIdType:"eu_vat",FlagComponent:HU,example:"HU12345678"},{country:"Hungary",countryCode:"HU",taxIdType:"hu_tin",FlagComponent:HU,example:"12345678-1-23"},{country:"Iceland",countryCode:"IS",taxIdType:"is_vat",FlagComponent:IS$1,example:"123456"},{country:"India",countryCode:"IN",taxIdType:"in_gst",FlagComponent:IN,example:"12ABCDE3456FGZH"},{country:"Indonesia",countryCode:"ID",taxIdType:"id_npwp",FlagComponent:ID,example:"012.345.678.9-012.345"},{country:"Ireland",countryCode:"IE",taxIdType:"eu_vat",FlagComponent:IE,example:"IE1234567AB"},{country:"Israel",countryCode:"IL",taxIdType:"il_vat",FlagComponent:IL,example:"000012345"},{country:"Italy",countryCode:"IT",taxIdType:"eu_vat",FlagComponent:IT,example:"IT12345678912"},{country:"Japan",countryCode:"JP",taxIdType:"jp_cn",FlagComponent:JP$1,example:"1234567891234"},{country:"Japan",countryCode:"JP",taxIdType:"jp_rn",FlagComponent:JP$1,example:"12345"},{country:"Japan",countryCode:"JP",taxIdType:"jp_trn",FlagComponent:JP$1,example:"T1234567891234"},{country:"Kazakhstan",countryCode:"KZ",taxIdType:"kz_bin",FlagComponent:KZ,example:"123456789012"},{country:"Kenya",countryCode:"KE",taxIdType:"ke_pin",FlagComponent:KE,example:"P000111111A"},{country:"Kyrgyzstan",countryCode:"KG",taxIdType:"kg_tin",FlagComponent:KG,example:"12345678901234"},{country:"Laos",countryCode:"LA",taxIdType:"la_tin",FlagComponent:LA,example:"123456789-000"},{country:"Latvia",countryCode:"LV",taxIdType:"eu_vat",FlagComponent:LV,example:"LV12345678912"},{country:"Liechtenstein",countryCode:"LI",taxIdType:"li_uid",FlagComponent:LI,example:"CHE123456789"},{country:"Liechtenstein",countryCode:"LI",taxIdType:"li_vat",FlagComponent:LI,example:"12345"},{country:"Lithuania",countryCode:"LT",taxIdType:"eu_vat",FlagComponent:LT,example:"LT123456789123"},{country:"Luxembourg",countryCode:"LU",taxIdType:"eu_vat",FlagComponent:LU,example:"LU12345678"},{country:"Malaysia",countryCode:"MY",taxIdType:"my_frp",FlagComponent:MY,example:"12345678"},{country:"Malaysia",countryCode:"MY",taxIdType:"my_itn",FlagComponent:MY,example:"C 1234567890"},{country:"Malaysia",countryCode:"MY",taxIdType:"my_sst",FlagComponent:MY,example:"A12-3456-78912345"},{country:"Malta",countryCode:"MT",taxIdType:"eu_vat",FlagComponent:MT,example:"MT12345678"},{country:"Mauritania",countryCode:"MR",taxIdType:"mr_nif",FlagComponent:MR,example:"12345678"},{country:"Mexico",countryCode:"MX",taxIdType:"mx_rfc",FlagComponent:MX,example:"ABC010203AB9"},{country:"Moldova",countryCode:"MD",taxIdType:"md_vat",FlagComponent:MD,example:"1234567"},{country:"Montenegro",countryCode:"ME",taxIdType:"me_pib",FlagComponent:ME,example:"12345678"},{country:"Morocco",countryCode:"MA",taxIdType:"ma_vat",FlagComponent:MA,example:"12345678"},{country:"Nepal",countryCode:"NP",taxIdType:"np_pan",FlagComponent:NP,example:"123456789"},{country:"Netherlands",countryCode:"NL",taxIdType:"eu_vat",FlagComponent:NL,example:"NL123456789B12"},{country:"New Zealand",countryCode:"NZ",taxIdType:"nz_gst",FlagComponent:NZ,example:"123456789"},{country:"Nigeria",countryCode:"NG",taxIdType:"ng_tin",FlagComponent:NG,example:"12345678-0001"},{country:"North Macedonia",countryCode:"MK",taxIdType:"mk_vat",FlagComponent:MK,example:"MK1234567890123"},{country:"Norway",countryCode:"NO",taxIdType:"no_vat",FlagComponent:NO,example:"123456789MVA"},{country:"Norway",countryCode:"NO",taxIdType:"no_voec",FlagComponent:NO,example:"1234567"},{country:"Oman",countryCode:"OM",taxIdType:"om_vat",FlagComponent:OM,example:"OM1234567890"},{country:"Peru",countryCode:"PE",taxIdType:"pe_ruc",FlagComponent:PE,example:"12345678901"},{country:"Philippines",countryCode:"PH",taxIdType:"ph_tin",FlagComponent:PH,example:"123456789012"},{country:"Poland",countryCode:"PL",taxIdType:"eu_vat",FlagComponent:PL,example:"PL1234567890"},{country:"Portugal",countryCode:"PT",taxIdType:"eu_vat",FlagComponent:PT,example:"PT123456789"},{country:"Romania",countryCode:"RO",taxIdType:"eu_vat",FlagComponent:RO,example:"RO1234567891"},{country:"Romania",countryCode:"RO",taxIdType:"ro_tin",FlagComponent:RO,example:"1234567890123"},{country:"Russia",countryCode:"RU",taxIdType:"ru_inn",FlagComponent:RU,example:"1234567891"},{country:"Russia",countryCode:"RU",taxIdType:"ru_kpp",FlagComponent:RU,example:"123456789"},{country:"Saudi Arabia",countryCode:"SA",taxIdType:"sa_vat",FlagComponent:SA,example:"123456789012345"},{country:"Senegal",countryCode:"SN",taxIdType:"sn_ninea",FlagComponent:SN,example:"12345672A2"},{country:"Serbia",countryCode:"RS",taxIdType:"rs_pib",FlagComponent:RS$1,example:"123456789"},{country:"Singapore",countryCode:"SG",taxIdType:"sg_gst",FlagComponent:SG,example:"M12345678X"},{country:"Singapore",countryCode:"SG",taxIdType:"sg_uen",FlagComponent:SG,example:"123456789F"},{country:"Slovakia",countryCode:"SK",taxIdType:"eu_vat",FlagComponent:SK,example:"SK1234567891"},{country:"Slovenia",countryCode:"SI",taxIdType:"eu_vat",FlagComponent:SI,example:"SI12345678"},{country:"Slovenia",countryCode:"SI",taxIdType:"si_tin",FlagComponent:SI,example:"12345678"},{country:"South Africa",countryCode:"ZA",taxIdType:"za_vat",FlagComponent:ZA,example:"4123456789"},{country:"South Korea",countryCode:"KR",taxIdType:"kr_brn",FlagComponent:KR,example:"123-45-67890"},{country:"Spain",countryCode:"ES",taxIdType:"es_cif",FlagComponent:ES$1,example:"A12345678"},{country:"Spain",countryCode:"ES",taxIdType:"eu_vat",FlagComponent:ES$1,example:"ESA1234567Z"},{country:"Suriname",countryCode:"SR",taxIdType:"sr_fin",FlagComponent:SR,example:"1234567890"},{country:"Sweden",countryCode:"SE",taxIdType:"eu_vat",FlagComponent:SE,example:"SE123456789123"},{country:"Switzerland",countryCode:"CH",taxIdType:"ch_uid",FlagComponent:CH,example:"CHE-123.456.789 HR"},{country:"Switzerland",countryCode:"CH",taxIdType:"ch_vat",FlagComponent:CH,example:"CHE-123.456.789 MWST"},{country:"Taiwan",countryCode:"TW",taxIdType:"tw_vat",FlagComponent:TW,example:"12345678"},{country:"Tajikistan",countryCode:"TJ",taxIdType:"tj_tin",FlagComponent:TJ,example:"123456789"},{country:"Tanzania",countryCode:"TZ",taxIdType:"tz_vat",FlagComponent:TZ,example:"12345678A"},{country:"Thailand",countryCode:"TH",taxIdType:"th_vat",FlagComponent:TH,example:"1234567891234"},{country:"Turkey",countryCode:"TR",taxIdType:"tr_tin",FlagComponent:TR,example:"0123456789"},{country:"Uganda",countryCode:"UG",taxIdType:"ug_tin",FlagComponent:UG,example:"1014751879"},{country:"Ukraine",countryCode:"UA",taxIdType:"ua_vat",FlagComponent:UA,example:"123456789"},{country:"United Arab Emirates",countryCode:"AE",taxIdType:"ae_trn",FlagComponent:AE,example:"123456789012345"},{country:"United Kingdom",countryCode:"GB",taxIdType:"eu_vat",FlagComponent:GB,example:"XI123456789"},{country:"United Kingdom",countryCode:"GB",taxIdType:"gb_vat",FlagComponent:GB,example:"GB123456789"},{country:"United States",countryCode:"US",taxIdType:"us_ein",FlagComponent:US,example:"12-3456789"},{country:"Uruguay",countryCode:"UY",taxIdType:"uy_ruc",FlagComponent:UY,example:"123456789012"},{country:"Uzbekistan",countryCode:"UZ",taxIdType:"uz_tin",FlagComponent:UZ,example:"123456789"},{country:"Uzbekistan",countryCode:"UZ",taxIdType:"uz_vat",FlagComponent:UZ,example:"123456789012"},{country:"Venezuela",countryCode:"VE",taxIdType:"ve_rif",FlagComponent:VE,example:"A-12345678-9"},{country:"Vietnam",countryCode:"VN",taxIdType:"vn_tin",FlagComponent:VN,example:"1234567890"},{country:"Zambia",countryCode:"ZM",taxIdType:"zm_tin",FlagComponent:ZM,example:"1004751879"},{country:"Zimbabwe",countryCode:"ZW",taxIdType:"zw_tin",FlagComponent:ZW,example:"1234567890"}],WP="United States",ZP=" # ",Sr="us_ein",Tr=(e,t)=>`${e}${ZP}${t}`,ki=new Map(Ti.map(e=>[Tr(e.taxIdType,e.country),e])),vt=e=>ki.get(e),kr=Tr(Sr,WP);var wi=e(pe)(()=>({"& .MuiOutlinedInput-root":{borderRadius:"5px",padding:"12px",fieldset:{borderColor:"#e6e6e6"}},"& .MuiInputBase-input":{borderRadius:"5px",fontSize:"16px",padding:"0 0"}}));var JP=e(YP)(()=>({"& .MuiAutocomplete-input":{padding:"0 !important"}})),wr=e(f)({});wr.defaultProps={variant:"body1",color:"secondary"};function Cd(){let[e,t]=useState(false),{billingAddress:o,taxId:r,setTaxId:n}=re(),[i,a$1]=useState(kr),[l,s]=useState(false),c=useCallback((g,h,P)=>{n({type:h,value:P}),a$1(g);},[n,a$1]);useEffect(()=>{s(false);},[o==null?void 0:o.country]),useEffect(()=>{if(!(o!=null&&o.country)||l||!e)return;let g=Ti.find(h=>h.countryCode===o.country);g&&c(Tr(g.taxIdType,g.country),g.taxIdType,"");},[o,e,l,c]);let u=g=>{if(!g)return;let h=vt(g);if(h){if(s(true),r!=null&&r.value){c(g,h.taxIdType,r.value);return}a$1(g),r!=null&&r.type&&n(void 0);}},f$1=useMemo(()=>Array.from(ki.keys()),[]),y=useMemo(()=>f$1.find(g=>g===i)||null,[f$1,i]),p=useMemo(()=>{let g=vt(i);return (g==null?void 0:g.example)||"Add your VAT/GST or local tax ID."},[i]);return useEffect(()=>(e||(s(false),c(kr,Sr,"")),()=>{c(kr,Sr,"");}),[e,c]),jsxs(Re,{flexDirection:"column",container:true,gap:2,children:[jsx(Re,{flexDirection:"row",container:true,gap:2,children:jsx(jc,{checked:e,onChange:()=>t(g=>!g),label:jsx(wr,{children:"I'm purchasing as a business"})})}),jsx(QP,{in:e,children:jsxs(Re,{container:true,spacing:0,sx:{width:"100%"},children:[jsxs(Re,{item:true,xs:6,children:[jsx(wr,{children:"Tax ID Type"}),jsx(JP,{fullWidth:true,options:f$1,value:y,onChange:(g,h)=>u(h),renderInput:g=>jsx(wi,b(a({},g),{id:"id-type",InputProps:g.InputProps})),renderOption:(g,h)=>{let P=vt(h);if(!P)return null;let{taxIdType:b$1,country:x,FlagComponent:A}=P;return createElement(Iu,b(a({},g),{key:h}),jsxs(f,{variant:"body1",lineHeight:"20px",color:"secondary",children:[A&&jsx(A,{width:15,style:{marginRight:"5px",borderRadius:"8%"}}),yd(x)," - ",hd(b$1)]}))},getOptionLabel:g=>{let h=vt(g);return h?`${yd(h.country)} - ${hd(h.taxIdType)}`:g},ListboxProps:{sx:{maxHeight:200}}})]}),jsxs(Re,{item:true,xs:6,paddingLeft:"12px",children:[jsx(wr,{children:"Tax ID"}),jsx(wi,{id:"tax-id-value",placeholder:p,type:"text",fullWidth:true,value:(r==null?void 0:r.value)||"",onChange:g=>{let h=vt(i);h&&c(i,h.taxIdType,g.target.value);}})]})]})})]})}function Pd({onBillingAddressChange:e,collectPhoneNumber:t,collectTaxId:o}){var g;let{checkoutState:r,checkoutLocalization:n,widgetState:i,setWidgetReadOnly:a$1}=D(),{setBillingAddress:l}=re(),{customer:s,configuration:c$1}=r||{},{readOnly:u}=i,f$1=!!(t!=null?t:(g=c$1==null?void 0:c$1.content)!=null&&g.collectPhoneNumber),y=useMemo(()=>o&&!(s!=null&&s.billingId)&&!(s!=null&&s.paymentMethodDetails),[o,s==null?void 0:s.billingId,s==null?void 0:s.paymentMethodDetails]),p=h=>{if(!h.complete)return;let A=h.value.address,{postal_code:P}=A,b=c(A,["postal_code"]),x=a({postalCode:P},b);a$1(true),l(x),e?d(null,null,function*(){yield e({billingAddress:x}),a$1(false);}):a$1(false);};return jsxs(Re,{flexDirection:"column",container:true,gap:3,padding:"16px",sx:{pointerEvents:u?"none":void 0},children:[jsxs(Re,{flexDirection:"column",container:true,gap:2,children:[jsx(f,{variant:"h6",children:n.newPaymentMethodBillingAddressTitle}),jsx(AddressElement,{onChange:p,options:{mode:"billing",fields:{phone:f$1?"always":"auto"},defaultValues:a({},(s==null?void 0:s.name)&&{name:s.name})}})]}),jsxs(Re,{flexDirection:"column",container:true,gap:2,children:[jsx(f,{variant:"h6",children:n.newPaymentMethodCardTitle}),jsx(PaymentElement,{onChange:()=>{},onReady:()=>{},options:{readOnly:u,terms:{card:"never"},defaultValues:{billingDetails:a(a({},(s==null?void 0:s.name)&&{name:s.name}),(s==null?void 0:s.email)&&{email:s.email})}}})]}),y&&jsx(Cd,{})]})}function xd(){let[e,t]=useState(null),{checkoutState:o}=D(),{billingIntegration:r,setupSecret:n}=o||{};return useEffect(()=>{if(r){let{billingIdentifier:i,credentials:a}=r;if(i!==BillingVendorIdentifier.Stripe)return;let{accountId:l,publicKey:s}=a;if(!l||!s){console.error("Stripe account ID or public key is missing");return}import('@stripe/stripe-js').then(({loadStripe:c})=>{t(c(s,{stripeAccount:l}));});}},[r]),{stripePromise:e,setupIntentClientSecret:n}}function Br(){let e=It(),[{resourceId:t,resetBillingPeriod:o}]=_(),{checkoutState:r}=D(),{plan:n,activeSubscription:i}=r||{},a$1=e.addons.map(({addon:c,quantity:u})=>({addonId:c.id,quantity:u}));if(!(n!=null&&n.id))return;let{prorationBehavior:l,billingCycleAnchor:s}=Cr({activeSubscription:i,resetBillingPeriod:o});return a(a({resourceId:t,planId:n.id,billingPeriod:e.billingPeriod,billableFeatures:e.billableFeatures,addons:a$1,promotionCode:e.promotionCode,billingCountryCode:e.billingCountryCode},hr({billingAddress:e.billingAddress,taxIds:e.taxId?[e.taxId]:void 0,prorationBehavior:l})),s?{billingCycleAnchor:s}:{})}var ix=[PaymentCollection.Failed,PaymentCollection.Processing];function ax(t){return d(this,arguments,function*({elements:e}){if(!e){let r="Stripe elements not initialized";return console.error(r),{success:false,errorMessage:r}}let{error:o}=yield e.submit();return o?(console.log(o.message),{success:false,errorMessage:o.message||""}):{success:true}})}function Li(o){return d(this,arguments,function*({applySubscriptionResults:e,stripe:t}){var a,l;let r=e==null?void 0:e.subscription,n=(a=r==null?void 0:r.latestInvoice)==null?void 0:a.paymentSecret,i=r==null?void 0:r.paymentCollection;if(t&&n&&i===PaymentCollection.ActionRequired){let{error:s}=yield t.handleNextAction({clientSecret:n});if(s)return {errorMessage:s.message||""}}else if(i&&ix.includes(i))return {errorMessage:((l=r==null?void 0:r.latestInvoice)==null?void 0:l.errorMessage)||"An error occurred - try again later"};return {subscription:r}})}function sx(r){return d(this,arguments,function*({stripe:e,elements:t,clientSecret:o}){let n,i,{error:a}=yield e.confirmSetup({elements:t,confirmParams:{return_url:window.location.href},redirect:"if_required"});if(a)a.type==="card_error"||a.type==="validation_error"?a.type==="card_error"&&(i=a.message||""):i="An unexpected error occurred.";else try{let{setupIntent:l}=yield e.retrieveSetupIntent(o);l!=null&&l.payment_method&&(n=l.payment_method);}catch(l){i="An unexpected error occurred.",console.error(l);}return {newPaymentMethodId:n,setupErrorMessage:i}})}function bd(r){return d(this,arguments,function*({stripe:e,elements:t,setupIntentClientSecret:o}){if(!e||!t||!o)return {success:false};let n=yield ax({elements:t});if(!n.success)return {success:false,errorMessage:n.errorMessage};let{newPaymentMethodId:i,setupErrorMessage:a}=yield sx({stripe:e,elements:t,clientSecret:o});return a||!i?{success:false,errorMessage:a}:{success:true,paymentMethodId:i}})}var Sd={v:"5.12.1",fr:30,ip:0,op:201,w:700,h:700,nm:"Check",ddd:0,assets:[],layers:[{ddd:0,ind:1,ty:4,nm:"Shape Layer 8",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:315,ix:10},p:{a:0,k:[350,350,0],ix:2,l:2},a:{a:0,k:[-304,91,0],ix:1,l:2},s:{a:0,k:[100,100,100],ix:6,l:2}},ao:0,shapes:[{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[0,0],[0,0]],o:[[0,0],[0,0]],v:[[-304,-241],[-304,-161]],c:false},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:false},{ty:"st",c:{a:0,k:[1,1,1,1],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:9,ix:5},lc:2,lj:1,ml:4,bm:0,nm:"Stroke 1",mn:"ADBE Vector Graphic - Stroke",hd:false},{ty:"tr",p:{a:0,k:[0,0],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Transform"}],nm:"Shape 1",np:3,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:false},{ty:"tm",s:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:135,s:[100]},{t:145.5,s:[0]}],ix:1},e:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:130,s:[100]},{t:139.6005859375,s:[0]}],ix:2},o:{a:0,k:0,ix:3},m:1,ix:2,nm:"Trim Paths 1",mn:"ADBE Vector Filter - Trim",hd:false}],ip:130,op:204,st:-2,ct:1,bm:0},{ddd:0,ind:2,ty:4,nm:"Shape Layer 7",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:270,ix:10},p:{a:0,k:[350,350,0],ix:2,l:2},a:{a:0,k:[-304,91,0],ix:1,l:2},s:{a:0,k:[100,100,100],ix:6,l:2}},ao:0,shapes:[{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[0,0],[0,0]],o:[[0,0],[0,0]],v:[[-304,-241],[-304,-161]],c:false},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:false},{ty:"st",c:{a:0,k:[1,1,1,1],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:9,ix:5},lc:2,lj:1,ml:4,bm:0,nm:"Stroke 1",mn:"ADBE Vector Graphic - Stroke",hd:false},{ty:"tr",p:{a:0,k:[0,0],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Transform"}],nm:"Shape 1",np:3,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:false},{ty:"tm",s:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:135,s:[100]},{t:145.5,s:[0]}],ix:1},e:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:130,s:[100]},{t:139.6005859375,s:[0]}],ix:2},o:{a:0,k:0,ix:3},m:1,ix:2,nm:"Trim Paths 1",mn:"ADBE Vector Filter - Trim",hd:false}],ip:130,op:204,st:-2,ct:1,bm:0},{ddd:0,ind:3,ty:4,nm:"Shape Layer 6",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:225,ix:10},p:{a:0,k:[350,350,0],ix:2,l:2},a:{a:0,k:[-304,91,0],ix:1,l:2},s:{a:0,k:[100,100,100],ix:6,l:2}},ao:0,shapes:[{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[0,0],[0,0]],o:[[0,0],[0,0]],v:[[-304,-241],[-304,-161]],c:false},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:false},{ty:"st",c:{a:0,k:[1,1,1,1],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:9,ix:5},lc:2,lj:1,ml:4,bm:0,nm:"Stroke 1",mn:"ADBE Vector Graphic - Stroke",hd:false},{ty:"tr",p:{a:0,k:[0,0],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Transform"}],nm:"Shape 1",np:3,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:false},{ty:"tm",s:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:135,s:[100]},{t:145.5,s:[0]}],ix:1},e:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:130,s:[100]},{t:139.6005859375,s:[0]}],ix:2},o:{a:0,k:0,ix:3},m:1,ix:2,nm:"Trim Paths 1",mn:"ADBE Vector Filter - Trim",hd:false}],ip:130,op:204,st:-2,ct:1,bm:0},{ddd:0,ind:4,ty:4,nm:"Shape Layer 5",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:180,ix:10},p:{a:0,k:[350,350,0],ix:2,l:2},a:{a:0,k:[-304,91,0],ix:1,l:2},s:{a:0,k:[100,100,100],ix:6,l:2}},ao:0,shapes:[{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[0,0],[0,0]],o:[[0,0],[0,0]],v:[[-304,-241],[-304,-161]],c:false},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:false},{ty:"st",c:{a:0,k:[1,1,1,1],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:9,ix:5},lc:2,lj:1,ml:4,bm:0,nm:"Stroke 1",mn:"ADBE Vector Graphic - Stroke",hd:false},{ty:"tr",p:{a:0,k:[0,0],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Transform"}],nm:"Shape 1",np:3,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:false},{ty:"tm",s:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:135,s:[100]},{t:145.5,s:[0]}],ix:1},e:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:130,s:[100]},{t:139.6005859375,s:[0]}],ix:2},o:{a:0,k:0,ix:3},m:1,ix:2,nm:"Trim Paths 1",mn:"ADBE Vector Filter - Trim",hd:false}],ip:130,op:204,st:-2,ct:1,bm:0},{ddd:0,ind:5,ty:4,nm:"Shape Layer 4",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:135,ix:10},p:{a:0,k:[350,350,0],ix:2,l:2},a:{a:0,k:[-304,91,0],ix:1,l:2},s:{a:0,k:[100,100,100],ix:6,l:2}},ao:0,shapes:[{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[0,0],[0,0]],o:[[0,0],[0,0]],v:[[-304,-241],[-304,-161]],c:false},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:false},{ty:"st",c:{a:0,k:[1,1,1,1],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:9,ix:5},lc:2,lj:1,ml:4,bm:0,nm:"Stroke 1",mn:"ADBE Vector Graphic - Stroke",hd:false},{ty:"tr",p:{a:0,k:[0,0],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Transform"}],nm:"Shape 1",np:3,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:false},{ty:"tm",s:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:135,s:[100]},{t:145.5,s:[0]}],ix:1},e:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:130,s:[100]},{t:139.6005859375,s:[0]}],ix:2},o:{a:0,k:0,ix:3},m:1,ix:2,nm:"Trim Paths 1",mn:"ADBE Vector Filter - Trim",hd:false}],ip:130,op:204,st:-2,ct:1,bm:0},{ddd:0,ind:6,ty:4,nm:"Shape Layer 3",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:90,ix:10},p:{a:0,k:[350,350,0],ix:2,l:2},a:{a:0,k:[-304,91,0],ix:1,l:2},s:{a:0,k:[100,100,100],ix:6,l:2}},ao:0,shapes:[{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[0,0],[0,0]],o:[[0,0],[0,0]],v:[[-304,-241],[-304,-161]],c:false},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:false},{ty:"st",c:{a:0,k:[1,1,1,1],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:9,ix:5},lc:2,lj:1,ml:4,bm:0,nm:"Stroke 1",mn:"ADBE Vector Graphic - Stroke",hd:false},{ty:"tr",p:{a:0,k:[0,0],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Transform"}],nm:"Shape 1",np:3,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:false},{ty:"tm",s:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:135,s:[100]},{t:145.5,s:[0]}],ix:1},e:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:130,s:[100]},{t:139.6005859375,s:[0]}],ix:2},o:{a:0,k:0,ix:3},m:1,ix:2,nm:"Trim Paths 1",mn:"ADBE Vector Filter - Trim",hd:false}],ip:130,op:204,st:-2,ct:1,bm:0},{ddd:0,ind:7,ty:4,nm:"Shape Layer 2",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:45,ix:10},p:{a:0,k:[350,350,0],ix:2,l:2},a:{a:0,k:[-304,91,0],ix:1,l:2},s:{a:0,k:[100,100,100],ix:6,l:2}},ao:0,shapes:[{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[0,0],[0,0]],o:[[0,0],[0,0]],v:[[-304,-241],[-304,-161]],c:false},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:false},{ty:"st",c:{a:0,k:[1,1,1,1],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:9,ix:5},lc:2,lj:1,ml:4,bm:0,nm:"Stroke 1",mn:"ADBE Vector Graphic - Stroke",hd:false},{ty:"tr",p:{a:0,k:[0,0],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Transform"}],nm:"Shape 1",np:3,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:false},{ty:"tm",s:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:135,s:[100]},{t:145.5,s:[0]}],ix:1},e:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:130,s:[100]},{t:139.6005859375,s:[0]}],ix:2},o:{a:0,k:0,ix:3},m:1,ix:2,nm:"Trim Paths 1",mn:"ADBE Vector Filter - Trim",hd:false}],ip:130,op:204,st:-2,ct:1,bm:0},{ddd:0,ind:8,ty:4,nm:"Shape Layer 1",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:0,ix:10},p:{a:0,k:[350,350,0],ix:2,l:2},a:{a:0,k:[-304,91,0],ix:1,l:2},s:{a:0,k:[100,100,100],ix:6,l:2}},ao:0,shapes:[{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[0,0],[0,0]],o:[[0,0],[0,0]],v:[[-304,-241],[-304,-161]],c:false},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:false},{ty:"st",c:{a:0,k:[1,1,1,1],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:9,ix:5},lc:2,lj:1,ml:4,bm:0,nm:"Stroke 1",mn:"ADBE Vector Graphic - Stroke",hd:false},{ty:"tr",p:{a:0,k:[0,0],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Transform"}],nm:"Shape 1",np:3,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:false},{ty:"tm",s:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:135,s:[100]},{t:145.5,s:[0]}],ix:1},e:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:130,s:[100]},{t:139.6005859375,s:[0]}],ix:2},o:{a:0,k:0,ix:3},m:1,ix:2,nm:"Trim Paths 1",mn:"ADBE Vector Filter - Trim",hd:false}],ip:130,op:204,st:-2,ct:1,bm:0},{ddd:0,ind:9,ty:4,nm:"Check v",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:-1.9,ix:10},p:{a:0,k:[352,360,0],ix:2,l:2},a:{a:0,k:[-120.265,116.765,0],ix:1,l:2},s:{a:0,k:[278,278,100],ix:6,l:2}},ao:0,shapes:[{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0]],v:[[-161,123],[-137,148],[-79.531,85.531]],c:false},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:false},{ty:"st",c:{a:0,k:[1,1,1,1],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:5.5,ix:5},lc:2,lj:2,bm:0,nm:"Stroke 1",mn:"ADBE Vector Graphic - Stroke",hd:false},{ty:"tr",p:{a:0,k:[0,0],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Transform"}],nm:"Shape 1",np:3,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:false},{ty:"tm",s:{a:1,k:[{i:{x:[0],y:[1]},o:{x:[.333],y:[0]},t:135,s:[0]},{t:148,s:[100]}],ix:1},e:{a:0,k:0,ix:2},o:{a:0,k:0,ix:3},m:1,ix:2,nm:"Trim Paths 1",mn:"ADBE Vector Filter - Trim",hd:false}],ip:135,op:201,st:-35,ct:1,bm:0},{ddd:0,ind:11,ty:4,nm:"Circle Stroke",sr:1,ks:{o:{a:1,k:[{i:{x:[.833],y:[.833]},o:{x:[.167],y:[.167]},t:0,s:[0]},{t:7,s:[100]}],ix:11},r:{a:0,k:0,ix:10},p:{a:0,k:[350,350,0],ix:2,l:2},a:{a:0,k:[4,-6,0],ix:1,l:2},s:{a:0,k:[132,132,100],ix:6,l:2}},ao:0,shapes:[{ty:"gr",it:[{d:1,ty:"el",s:{a:0,k:[306,306],ix:2},p:{a:0,k:[0,0],ix:3},nm:"Ellipse Path 1",mn:"ADBE Vector Shape - Ellipse",hd:false},{ty:"st",c:{a:1,k:[{i:{x:[.833],y:[.833]},o:{x:[.167],y:[.167]},t:0,s:[1,1,1,1]},{i:{x:[.833],y:[.833]},o:{x:[.167],y:[.167]},t:30,s:[1,1,1,1]},{i:{x:[.833],y:[.833]},o:{x:[.167],y:[.167]},t:61,s:[1,1,1,1]},{i:{x:[.833],y:[.833]},o:{x:[.167],y:[.167]},t:87,s:[1,1,1,1]},{t:136,s:[1,1,1,1]}],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:8,ix:5},lc:2,lj:1,ml:4,bm:0,nm:"Stroke 1",mn:"ADBE Vector Graphic - Stroke",hd:false},{ty:"tr",p:{a:0,k:[4,-6],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Transform"}],nm:"Ellipse 1",np:3,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:false},{ty:"tm",s:{a:1,k:[{i:{x:[.338],y:[1]},o:{x:[.333],y:[0]},t:87,s:[50]},{t:122,s:[100]}],ix:1},e:{a:1,k:[{i:{x:[.338],y:[1]},o:{x:[.333],y:[0]},t:87,s:[45]},{t:122,s:[0]}],ix:2},o:{a:1,k:[{i:{x:[.474],y:[1]},o:{x:[.43],y:[0]},t:0,s:[-170.4]},{t:111,s:[-1250.4]}],ix:3},m:1,ix:2,nm:"Trim Paths 1",mn:"ADBE Vector Filter - Trim",hd:false}],ip:0,op:201,st:0,ct:1,bm:0},{ddd:0,ind:13,ty:1,nm:"Dark Gray Solid 1",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:0,ix:10},p:{a:0,k:[350,350,0],ix:2,l:2},a:{a:0,k:[350,350,0],ix:1,l:2},s:{a:0,k:[100,100,100],ix:6,l:2}},ao:0,sw:700,sh:700,sc:"#2d2d2d",ip:0,op:201,st:0,bm:0}],markers:[],props:{}};var Ar=5e3,ux=e(ke)`
588
+ `,Xc=({disabled:e,checkoutLocalization:t,onMockCheckoutPreview:o})=>{let{promotionCode:r,setPromotionCode:n}=Ft();return jsx(oC,{children:r?jsx(Jc,{promotionCode:r,onClearPromotionCode:()=>{n("");}}):jsx(Qc,{disabled:e,checkoutLocalization:t,onMockCheckoutPreview:o})})};var jc=({label:e,checked:t,onChange:o,onClick:r,value:n,disabled:i,dataTestId:a})=>jsx(nC,{onClick:r,value:n,control:jsx(rC,{checked:t,onChange:o,disabled:i,"data-testid":a}),label:iC(e)?jsx(f,{variant:"body1",lineHeight:"20px",color:"secondary",children:e}):e});var Ti=[{country:"Albania",countryCode:"AL",taxIdType:"al_tin",FlagComponent:AL,example:"J12345678N"},{country:"Andorra",countryCode:"AD",taxIdType:"ad_nrt",FlagComponent:AD,example:"A-123456-Z"},{country:"Angola",countryCode:"AO",taxIdType:"ao_tin",FlagComponent:AO,example:"5123456789"},{country:"Argentina",countryCode:"AR",taxIdType:"ar_cuit",FlagComponent:AR,example:"12-3456789-01"},{country:"Armenia",countryCode:"AM",taxIdType:"am_tin",FlagComponent:AM,example:"02538904"},{country:"Aruba",countryCode:"AW",taxIdType:"aw_tin",FlagComponent:AW,example:"12345678"},{country:"Australia",countryCode:"AU",taxIdType:"au_abn",FlagComponent:AU,example:"12345678912"},{country:"Australia",countryCode:"AU",taxIdType:"au_arn",FlagComponent:AU,example:"123456789123"},{country:"Austria",countryCode:"AT",taxIdType:"eu_vat",FlagComponent:AT,example:"ATU12345678"},{country:"Azerbaijan",countryCode:"AZ",taxIdType:"az_tin",FlagComponent:AZ,example:"0123456789"},{country:"Bahamas",countryCode:"BS",taxIdType:"bs_tin",FlagComponent:BS$1,example:"123.456.789"},{country:"Bahrain",countryCode:"BH",taxIdType:"bh_vat",FlagComponent:BH,example:"123456789012345"},{country:"Bangladesh",countryCode:"BD",taxIdType:"bd_bin",FlagComponent:BD,example:"123456789-0123"},{country:"Barbados",countryCode:"BB",taxIdType:"bb_tin",FlagComponent:BB,example:"1123456789012"},{country:"Belarus",countryCode:"BY",taxIdType:"by_tin",FlagComponent:BY,example:"123456789"},{country:"Belgium",countryCode:"BE",taxIdType:"eu_vat",FlagComponent:BE,example:"BE0123456789"},{country:"Benin",countryCode:"BJ",taxIdType:"bj_ifu",FlagComponent:BJ,example:"1234567890123"},{country:"Bolivia",countryCode:"BO",taxIdType:"bo_tin",FlagComponent:BO,example:"123456789"},{country:"Bosnia & Herzegovina",countryCode:"BA",taxIdType:"ba_tin",FlagComponent:BA,example:"123456789012"},{country:"Brazil",countryCode:"BR",taxIdType:"br_cnpj",FlagComponent:BR,example:"01.234.456/5432-10"},{country:"Brazil",countryCode:"BR",taxIdType:"br_cpf",FlagComponent:BR,example:"123.456.789-87"},{country:"Bulgaria",countryCode:"BG",taxIdType:"bg_uic",FlagComponent:BG,example:"123456789"},{country:"Bulgaria",countryCode:"BG",taxIdType:"eu_vat",FlagComponent:BG,example:"BG0123456789"},{country:"Burkina Faso",countryCode:"BF",taxIdType:"bf_ifu",FlagComponent:BF,example:"12345678A"},{country:"Cambodia",countryCode:"KH",taxIdType:"kh_tin",FlagComponent:KH,example:"1001-123456789"},{country:"Cameroon",countryCode:"CM",taxIdType:"cm_niu",FlagComponent:CM,example:"M123456789000L"},{country:"Canada",countryCode:"CA",taxIdType:"ca_bn",FlagComponent:CA,example:"123456789"},{country:"Canada",countryCode:"CA",taxIdType:"ca_gst_hst",FlagComponent:CA,example:"123456789RT0002"},{country:"Canada",countryCode:"CA",taxIdType:"ca_pst_bc",FlagComponent:CA,example:"PST-1234-5678"},{country:"Canada",countryCode:"CA",taxIdType:"ca_pst_mb",FlagComponent:CA,example:"123456-7"},{country:"Canada",countryCode:"CA",taxIdType:"ca_pst_sk",FlagComponent:CA,example:"1234567"},{country:"Canada",countryCode:"CA",taxIdType:"ca_qst",FlagComponent:CA,example:"1234567890TQ1234"},{country:"Cape Verde",countryCode:"CV",taxIdType:"cv_nif",FlagComponent:CV,example:"213456789"},{country:"Chile",countryCode:"CL",taxIdType:"cl_tin",FlagComponent:CL,example:"12.345.678-K"},{country:"China",countryCode:"CN",taxIdType:"cn_tin",FlagComponent:CN,example:"123456789012345678"},{country:"Colombia",countryCode:"CO",taxIdType:"co_nit",FlagComponent:CO,example:"123.456.789-0"},{country:"Congo - Kinshasa",countryCode:"CD",taxIdType:"cd_nif",FlagComponent:CD,example:"A0123456M"},{country:"Costa Rica",countryCode:"CR",taxIdType:"cr_tin",FlagComponent:CR,example:"1-234-567890"},{country:"Croatia",countryCode:"HR",taxIdType:"eu_vat",FlagComponent:HR,example:"HR12345678912"},{country:"Croatia",countryCode:"HR",taxIdType:"hr_oib",FlagComponent:HR,example:"12345678901"},{country:"Cyprus",countryCode:"CY",taxIdType:"eu_vat",FlagComponent:CY,example:"CY12345678Z"},{country:"Czech Republic",countryCode:"CZ",taxIdType:"eu_vat",FlagComponent:CZ,example:"CZ1234567890"},{country:"Denmark",countryCode:"DK",taxIdType:"eu_vat",FlagComponent:DK,example:"DK12345678"},{country:"Dominican Republic",countryCode:"DO",taxIdType:"do_rcn",FlagComponent:DO,example:"123-4567890-1"},{country:"Ecuador",countryCode:"EC",taxIdType:"ec_ruc",FlagComponent:EC,example:"1234567890001"},{country:"Egypt",countryCode:"EG",taxIdType:"eg_tin",FlagComponent:EG,example:"123456789"},{country:"El Salvador",countryCode:"SV",taxIdType:"sv_nit",FlagComponent:SV,example:"1234-567890-123-4"},{country:"Estonia",countryCode:"EE",taxIdType:"eu_vat",FlagComponent:EE,example:"EE123456789"},{country:"Ethiopia",countryCode:"ET",taxIdType:"et_tin",FlagComponent:ET,example:"1234567890"},{country:"EU",countryCode:"EU",taxIdType:"eu_oss_vat",FlagComponent:EU,example:"EU123456789"},{country:"Finland",countryCode:"FI",taxIdType:"eu_vat",FlagComponent:FI,example:"FI12345678"},{country:"France",countryCode:"FR",taxIdType:"eu_vat",FlagComponent:FR,example:"FRAB123456789"},{country:"Georgia",countryCode:"GE",taxIdType:"ge_vat",FlagComponent:GE,example:"123456789"},{country:"Germany",countryCode:"DE",taxIdType:"de_stn",FlagComponent:DE,example:"1234567890"},{country:"Germany",countryCode:"DE",taxIdType:"eu_vat",FlagComponent:DE,example:"DE123456789"},{country:"Greece",countryCode:"GR",taxIdType:"eu_vat",FlagComponent:GR,example:"EL123456789"},{country:"Guinea",countryCode:"GN",taxIdType:"gn_nif",FlagComponent:GN,example:"123456789"},{country:"Hong Kong",countryCode:"HK",taxIdType:"hk_br",FlagComponent:HK,example:"12345678"},{country:"Hungary",countryCode:"HU",taxIdType:"eu_vat",FlagComponent:HU,example:"HU12345678"},{country:"Hungary",countryCode:"HU",taxIdType:"hu_tin",FlagComponent:HU,example:"12345678-1-23"},{country:"Iceland",countryCode:"IS",taxIdType:"is_vat",FlagComponent:IS$1,example:"123456"},{country:"India",countryCode:"IN",taxIdType:"in_gst",FlagComponent:IN,example:"12ABCDE3456FGZH"},{country:"Indonesia",countryCode:"ID",taxIdType:"id_npwp",FlagComponent:ID,example:"012.345.678.9-012.345"},{country:"Ireland",countryCode:"IE",taxIdType:"eu_vat",FlagComponent:IE,example:"IE1234567AB"},{country:"Israel",countryCode:"IL",taxIdType:"il_vat",FlagComponent:IL,example:"000012345"},{country:"Italy",countryCode:"IT",taxIdType:"eu_vat",FlagComponent:IT,example:"IT12345678912"},{country:"Japan",countryCode:"JP",taxIdType:"jp_cn",FlagComponent:JP$1,example:"1234567891234"},{country:"Japan",countryCode:"JP",taxIdType:"jp_rn",FlagComponent:JP$1,example:"12345"},{country:"Japan",countryCode:"JP",taxIdType:"jp_trn",FlagComponent:JP$1,example:"T1234567891234"},{country:"Kazakhstan",countryCode:"KZ",taxIdType:"kz_bin",FlagComponent:KZ,example:"123456789012"},{country:"Kenya",countryCode:"KE",taxIdType:"ke_pin",FlagComponent:KE,example:"P000111111A"},{country:"Kyrgyzstan",countryCode:"KG",taxIdType:"kg_tin",FlagComponent:KG,example:"12345678901234"},{country:"Laos",countryCode:"LA",taxIdType:"la_tin",FlagComponent:LA,example:"123456789-000"},{country:"Latvia",countryCode:"LV",taxIdType:"eu_vat",FlagComponent:LV,example:"LV12345678912"},{country:"Liechtenstein",countryCode:"LI",taxIdType:"li_uid",FlagComponent:LI,example:"CHE123456789"},{country:"Liechtenstein",countryCode:"LI",taxIdType:"li_vat",FlagComponent:LI,example:"12345"},{country:"Lithuania",countryCode:"LT",taxIdType:"eu_vat",FlagComponent:LT,example:"LT123456789123"},{country:"Luxembourg",countryCode:"LU",taxIdType:"eu_vat",FlagComponent:LU,example:"LU12345678"},{country:"Malaysia",countryCode:"MY",taxIdType:"my_frp",FlagComponent:MY,example:"12345678"},{country:"Malaysia",countryCode:"MY",taxIdType:"my_itn",FlagComponent:MY,example:"C 1234567890"},{country:"Malaysia",countryCode:"MY",taxIdType:"my_sst",FlagComponent:MY,example:"A12-3456-78912345"},{country:"Malta",countryCode:"MT",taxIdType:"eu_vat",FlagComponent:MT,example:"MT12345678"},{country:"Mauritania",countryCode:"MR",taxIdType:"mr_nif",FlagComponent:MR,example:"12345678"},{country:"Mexico",countryCode:"MX",taxIdType:"mx_rfc",FlagComponent:MX,example:"ABC010203AB9"},{country:"Moldova",countryCode:"MD",taxIdType:"md_vat",FlagComponent:MD,example:"1234567"},{country:"Montenegro",countryCode:"ME",taxIdType:"me_pib",FlagComponent:ME,example:"12345678"},{country:"Morocco",countryCode:"MA",taxIdType:"ma_vat",FlagComponent:MA,example:"12345678"},{country:"Nepal",countryCode:"NP",taxIdType:"np_pan",FlagComponent:NP,example:"123456789"},{country:"Netherlands",countryCode:"NL",taxIdType:"eu_vat",FlagComponent:NL,example:"NL123456789B12"},{country:"New Zealand",countryCode:"NZ",taxIdType:"nz_gst",FlagComponent:NZ,example:"123456789"},{country:"Nigeria",countryCode:"NG",taxIdType:"ng_tin",FlagComponent:NG,example:"12345678-0001"},{country:"North Macedonia",countryCode:"MK",taxIdType:"mk_vat",FlagComponent:MK,example:"MK1234567890123"},{country:"Norway",countryCode:"NO",taxIdType:"no_vat",FlagComponent:NO,example:"123456789MVA"},{country:"Norway",countryCode:"NO",taxIdType:"no_voec",FlagComponent:NO,example:"1234567"},{country:"Oman",countryCode:"OM",taxIdType:"om_vat",FlagComponent:OM,example:"OM1234567890"},{country:"Peru",countryCode:"PE",taxIdType:"pe_ruc",FlagComponent:PE,example:"12345678901"},{country:"Philippines",countryCode:"PH",taxIdType:"ph_tin",FlagComponent:PH,example:"123456789012"},{country:"Poland",countryCode:"PL",taxIdType:"eu_vat",FlagComponent:PL,example:"PL1234567890"},{country:"Portugal",countryCode:"PT",taxIdType:"eu_vat",FlagComponent:PT,example:"PT123456789"},{country:"Romania",countryCode:"RO",taxIdType:"eu_vat",FlagComponent:RO,example:"RO1234567891"},{country:"Romania",countryCode:"RO",taxIdType:"ro_tin",FlagComponent:RO,example:"1234567890123"},{country:"Russia",countryCode:"RU",taxIdType:"ru_inn",FlagComponent:RU,example:"1234567891"},{country:"Russia",countryCode:"RU",taxIdType:"ru_kpp",FlagComponent:RU,example:"123456789"},{country:"Saudi Arabia",countryCode:"SA",taxIdType:"sa_vat",FlagComponent:SA,example:"123456789012345"},{country:"Senegal",countryCode:"SN",taxIdType:"sn_ninea",FlagComponent:SN,example:"12345672A2"},{country:"Serbia",countryCode:"RS",taxIdType:"rs_pib",FlagComponent:RS$1,example:"123456789"},{country:"Singapore",countryCode:"SG",taxIdType:"sg_gst",FlagComponent:SG,example:"M12345678X"},{country:"Singapore",countryCode:"SG",taxIdType:"sg_uen",FlagComponent:SG,example:"123456789F"},{country:"Slovakia",countryCode:"SK",taxIdType:"eu_vat",FlagComponent:SK,example:"SK1234567891"},{country:"Slovenia",countryCode:"SI",taxIdType:"eu_vat",FlagComponent:SI,example:"SI12345678"},{country:"Slovenia",countryCode:"SI",taxIdType:"si_tin",FlagComponent:SI,example:"12345678"},{country:"South Africa",countryCode:"ZA",taxIdType:"za_vat",FlagComponent:ZA,example:"4123456789"},{country:"South Korea",countryCode:"KR",taxIdType:"kr_brn",FlagComponent:KR,example:"123-45-67890"},{country:"Spain",countryCode:"ES",taxIdType:"es_cif",FlagComponent:ES$1,example:"A12345678"},{country:"Spain",countryCode:"ES",taxIdType:"eu_vat",FlagComponent:ES$1,example:"ESA1234567Z"},{country:"Suriname",countryCode:"SR",taxIdType:"sr_fin",FlagComponent:SR,example:"1234567890"},{country:"Sweden",countryCode:"SE",taxIdType:"eu_vat",FlagComponent:SE,example:"SE123456789123"},{country:"Switzerland",countryCode:"CH",taxIdType:"ch_uid",FlagComponent:CH,example:"CHE-123.456.789 HR"},{country:"Switzerland",countryCode:"CH",taxIdType:"ch_vat",FlagComponent:CH,example:"CHE-123.456.789 MWST"},{country:"Taiwan",countryCode:"TW",taxIdType:"tw_vat",FlagComponent:TW,example:"12345678"},{country:"Tajikistan",countryCode:"TJ",taxIdType:"tj_tin",FlagComponent:TJ,example:"123456789"},{country:"Tanzania",countryCode:"TZ",taxIdType:"tz_vat",FlagComponent:TZ,example:"12345678A"},{country:"Thailand",countryCode:"TH",taxIdType:"th_vat",FlagComponent:TH,example:"1234567891234"},{country:"Turkey",countryCode:"TR",taxIdType:"tr_tin",FlagComponent:TR,example:"0123456789"},{country:"Uganda",countryCode:"UG",taxIdType:"ug_tin",FlagComponent:UG,example:"1014751879"},{country:"Ukraine",countryCode:"UA",taxIdType:"ua_vat",FlagComponent:UA,example:"123456789"},{country:"United Arab Emirates",countryCode:"AE",taxIdType:"ae_trn",FlagComponent:AE,example:"123456789012345"},{country:"United Kingdom",countryCode:"GB",taxIdType:"eu_vat",FlagComponent:GB,example:"XI123456789"},{country:"United Kingdom",countryCode:"GB",taxIdType:"gb_vat",FlagComponent:GB,example:"GB123456789"},{country:"United States",countryCode:"US",taxIdType:"us_ein",FlagComponent:US,example:"12-3456789"},{country:"Uruguay",countryCode:"UY",taxIdType:"uy_ruc",FlagComponent:UY,example:"123456789012"},{country:"Uzbekistan",countryCode:"UZ",taxIdType:"uz_tin",FlagComponent:UZ,example:"123456789"},{country:"Uzbekistan",countryCode:"UZ",taxIdType:"uz_vat",FlagComponent:UZ,example:"123456789012"},{country:"Venezuela",countryCode:"VE",taxIdType:"ve_rif",FlagComponent:VE,example:"A-12345678-9"},{country:"Vietnam",countryCode:"VN",taxIdType:"vn_tin",FlagComponent:VN,example:"1234567890"},{country:"Zambia",countryCode:"ZM",taxIdType:"zm_tin",FlagComponent:ZM,example:"1004751879"},{country:"Zimbabwe",countryCode:"ZW",taxIdType:"zw_tin",FlagComponent:ZW,example:"1234567890"}],WP="United States",ZP=" # ",Sr="us_ein",Tr=(e,t)=>`${e}${ZP}${t}`,ki=new Map(Ti.map(e=>[Tr(e.taxIdType,e.country),e])),vt=e=>ki.get(e),kr=Tr(Sr,WP);var wi=e(pe)(()=>({"& .MuiOutlinedInput-root":{borderRadius:"5px",padding:"12px",fieldset:{borderColor:"#e6e6e6"}},"& .MuiInputBase-input":{borderRadius:"5px",fontSize:"16px",padding:"0 0"}}));var JP=e(YP)(()=>({"& .MuiAutocomplete-input":{padding:"0 !important"}})),wr=e(f)({});wr.defaultProps={variant:"body1",color:"secondary"};function Cd(){let[e,t]=useState(false),{billingAddress:o,taxId:r,setTaxId:n}=re(),[i,a$1]=useState(kr),[l,s]=useState(false),c=useCallback((g,h,P)=>{n({type:h,value:P}),a$1(g);},[n,a$1]);useEffect(()=>{s(false);},[o==null?void 0:o.country]),useEffect(()=>{if(!(o!=null&&o.country)||l||!e)return;let g=Ti.find(h=>h.countryCode===o.country);g&&c(Tr(g.taxIdType,g.country),g.taxIdType,"");},[o,e,l,c]);let u=g=>{if(!g)return;let h=vt(g);if(h){if(s(true),r!=null&&r.value){c(g,h.taxIdType,r.value);return}a$1(g),r!=null&&r.type&&n(void 0);}},f$1=useMemo(()=>Array.from(ki.keys()),[]),y=useMemo(()=>f$1.find(g=>g===i)||null,[f$1,i]),p=useMemo(()=>{let g=vt(i);return (g==null?void 0:g.example)||"Add your VAT/GST or local tax ID."},[i]);return useEffect(()=>(e||(s(false),c(kr,Sr,"")),()=>{c(kr,Sr,"");}),[e,c]),jsxs(Re,{flexDirection:"column",container:true,gap:2,children:[jsx(Re,{flexDirection:"row",container:true,gap:2,children:jsx(jc,{checked:e,onChange:()=>t(g=>!g),label:jsx(wr,{children:"I'm purchasing as a business"})})}),jsx(QP,{in:e,children:jsxs(Re,{container:true,spacing:0,sx:{width:"100%"},children:[jsxs(Re,{size:{xs:6},children:[jsx(wr,{children:"Tax ID Type"}),jsx(JP,{fullWidth:true,options:f$1,value:y,onChange:(g,h)=>u(h),renderInput:g=>jsx(wi,b(a({},g),{id:"id-type",InputProps:g.InputProps})),renderOption:(g,h)=>{let P=vt(h);if(!P)return null;let{taxIdType:b$1,country:x,FlagComponent:A}=P;return createElement(Iu,b(a({},g),{key:h}),jsxs(f,{variant:"body1",lineHeight:"20px",color:"secondary",children:[A&&jsx(A,{width:15,style:{marginRight:"5px",borderRadius:"8%"}}),yd(x)," - ",hd(b$1)]}))},getOptionLabel:g=>{let h=vt(g);return h?`${yd(h.country)} - ${hd(h.taxIdType)}`:g},ListboxProps:{sx:{maxHeight:200}}})]}),jsxs(Re,{size:{xs:6},sx:{paddingLeft:"12px"},children:[jsx(wr,{children:"Tax ID"}),jsx(wi,{id:"tax-id-value",placeholder:p,type:"text",fullWidth:true,value:(r==null?void 0:r.value)||"",onChange:g=>{let h=vt(i);h&&c(i,h.taxIdType,g.target.value);}})]})]})})]})}function Pd({onBillingAddressChange:e,collectPhoneNumber:t,collectTaxId:o}){var g;let{checkoutState:r,checkoutLocalization:n,widgetState:i,setWidgetReadOnly:a$1}=D(),{setBillingAddress:l}=re(),{customer:s,configuration:c$1}=r||{},{readOnly:u}=i,f$1=!!(t!=null?t:(g=c$1==null?void 0:c$1.content)!=null&&g.collectPhoneNumber),y=useMemo(()=>o&&!(s!=null&&s.billingId)&&!(s!=null&&s.paymentMethodDetails),[o,s==null?void 0:s.billingId,s==null?void 0:s.paymentMethodDetails]),p=h=>{if(!h.complete)return;let A=h.value.address,{postal_code:P}=A,b=c(A,["postal_code"]),x=a({postalCode:P},b);a$1(true),l(x),e?d(null,null,function*(){yield e({billingAddress:x}),a$1(false);}):a$1(false);};return jsxs(Re,{flexDirection:"column",container:true,gap:3,padding:"16px",sx:{pointerEvents:u?"none":void 0},children:[jsxs(Re,{flexDirection:"column",container:true,gap:2,children:[jsx(f,{variant:"h6",children:n.newPaymentMethodBillingAddressTitle}),jsx(AddressElement,{onChange:p,options:{mode:"billing",fields:{phone:f$1?"always":"auto"},defaultValues:a({},(s==null?void 0:s.name)&&{name:s.name})}})]}),jsxs(Re,{flexDirection:"column",container:true,gap:2,children:[jsx(f,{variant:"h6",children:n.newPaymentMethodCardTitle}),jsx(PaymentElement,{onChange:()=>{},onReady:()=>{},options:{readOnly:u,terms:{card:"never"},defaultValues:{billingDetails:a(a({},(s==null?void 0:s.name)&&{name:s.name}),(s==null?void 0:s.email)&&{email:s.email})}}})]}),y&&jsx(Cd,{})]})}function xd(){let[e,t]=useState(null),{checkoutState:o}=D(),{billingIntegration:r,setupSecret:n}=o||{};return useEffect(()=>{if(r){let{billingIdentifier:i,credentials:a}=r;if(i!==BillingVendorIdentifier.Stripe)return;let{accountId:l,publicKey:s}=a;if(!l||!s){console.error("Stripe account ID or public key is missing");return}import('@stripe/stripe-js').then(({loadStripe:c})=>{t(c(s,{stripeAccount:l}));});}},[r]),{stripePromise:e,setupIntentClientSecret:n}}function Br(){let e=It(),[{resourceId:t,resetBillingPeriod:o}]=_(),{checkoutState:r}=D(),{plan:n,activeSubscription:i}=r||{},a$1=e.addons.map(({addon:c,quantity:u})=>({addonId:c.id,quantity:u}));if(!(n!=null&&n.id))return;let{prorationBehavior:l,billingCycleAnchor:s}=Cr({activeSubscription:i,resetBillingPeriod:o});return a(a({resourceId:t,planId:n.id,billingPeriod:e.billingPeriod,billableFeatures:e.billableFeatures,addons:a$1,promotionCode:e.promotionCode,billingCountryCode:e.billingCountryCode},hr({billingAddress:e.billingAddress,taxIds:e.taxId?[e.taxId]:void 0,prorationBehavior:l})),s?{billingCycleAnchor:s}:{})}var ix=[PaymentCollection.Failed,PaymentCollection.Processing];function ax(t){return d(this,arguments,function*({elements:e}){if(!e){let r="Stripe elements not initialized";return console.error(r),{success:false,errorMessage:r}}let{error:o}=yield e.submit();return o?(console.log(o.message),{success:false,errorMessage:o.message||""}):{success:true}})}function Li(o){return d(this,arguments,function*({applySubscriptionResults:e,stripe:t}){var a,l;let r=e==null?void 0:e.subscription,n=(a=r==null?void 0:r.latestInvoice)==null?void 0:a.paymentSecret,i=r==null?void 0:r.paymentCollection;if(t&&n&&i===PaymentCollection.ActionRequired){let{error:s}=yield t.handleNextAction({clientSecret:n});if(s)return {errorMessage:s.message||""}}else if(i&&ix.includes(i))return {errorMessage:((l=r==null?void 0:r.latestInvoice)==null?void 0:l.errorMessage)||"An error occurred - try again later"};return {subscription:r}})}function sx(r){return d(this,arguments,function*({stripe:e,elements:t,clientSecret:o}){let n,i,{error:a}=yield e.confirmSetup({elements:t,confirmParams:{return_url:window.location.href},redirect:"if_required"});if(a)a.type==="card_error"||a.type==="validation_error"?a.type==="card_error"&&(i=a.message||""):i="An unexpected error occurred.";else try{let{setupIntent:l}=yield e.retrieveSetupIntent(o);l!=null&&l.payment_method&&(n=l.payment_method);}catch(l){i="An unexpected error occurred.",console.error(l);}return {newPaymentMethodId:n,setupErrorMessage:i}})}function bd(r){return d(this,arguments,function*({stripe:e,elements:t,setupIntentClientSecret:o}){if(!e||!t||!o)return {success:false};let n=yield ax({elements:t});if(!n.success)return {success:false,errorMessage:n.errorMessage};let{newPaymentMethodId:i,setupErrorMessage:a}=yield sx({stripe:e,elements:t,clientSecret:o});return a||!i?{success:false,errorMessage:a}:{success:true,paymentMethodId:i}})}var Sd={v:"5.12.1",fr:30,ip:0,op:201,w:700,h:700,nm:"Check",ddd:0,assets:[],layers:[{ddd:0,ind:1,ty:4,nm:"Shape Layer 8",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:315,ix:10},p:{a:0,k:[350,350,0],ix:2,l:2},a:{a:0,k:[-304,91,0],ix:1,l:2},s:{a:0,k:[100,100,100],ix:6,l:2}},ao:0,shapes:[{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[0,0],[0,0]],o:[[0,0],[0,0]],v:[[-304,-241],[-304,-161]],c:false},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:false},{ty:"st",c:{a:0,k:[1,1,1,1],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:9,ix:5},lc:2,lj:1,ml:4,bm:0,nm:"Stroke 1",mn:"ADBE Vector Graphic - Stroke",hd:false},{ty:"tr",p:{a:0,k:[0,0],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Transform"}],nm:"Shape 1",np:3,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:false},{ty:"tm",s:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:135,s:[100]},{t:145.5,s:[0]}],ix:1},e:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:130,s:[100]},{t:139.6005859375,s:[0]}],ix:2},o:{a:0,k:0,ix:3},m:1,ix:2,nm:"Trim Paths 1",mn:"ADBE Vector Filter - Trim",hd:false}],ip:130,op:204,st:-2,ct:1,bm:0},{ddd:0,ind:2,ty:4,nm:"Shape Layer 7",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:270,ix:10},p:{a:0,k:[350,350,0],ix:2,l:2},a:{a:0,k:[-304,91,0],ix:1,l:2},s:{a:0,k:[100,100,100],ix:6,l:2}},ao:0,shapes:[{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[0,0],[0,0]],o:[[0,0],[0,0]],v:[[-304,-241],[-304,-161]],c:false},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:false},{ty:"st",c:{a:0,k:[1,1,1,1],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:9,ix:5},lc:2,lj:1,ml:4,bm:0,nm:"Stroke 1",mn:"ADBE Vector Graphic - Stroke",hd:false},{ty:"tr",p:{a:0,k:[0,0],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Transform"}],nm:"Shape 1",np:3,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:false},{ty:"tm",s:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:135,s:[100]},{t:145.5,s:[0]}],ix:1},e:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:130,s:[100]},{t:139.6005859375,s:[0]}],ix:2},o:{a:0,k:0,ix:3},m:1,ix:2,nm:"Trim Paths 1",mn:"ADBE Vector Filter - Trim",hd:false}],ip:130,op:204,st:-2,ct:1,bm:0},{ddd:0,ind:3,ty:4,nm:"Shape Layer 6",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:225,ix:10},p:{a:0,k:[350,350,0],ix:2,l:2},a:{a:0,k:[-304,91,0],ix:1,l:2},s:{a:0,k:[100,100,100],ix:6,l:2}},ao:0,shapes:[{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[0,0],[0,0]],o:[[0,0],[0,0]],v:[[-304,-241],[-304,-161]],c:false},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:false},{ty:"st",c:{a:0,k:[1,1,1,1],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:9,ix:5},lc:2,lj:1,ml:4,bm:0,nm:"Stroke 1",mn:"ADBE Vector Graphic - Stroke",hd:false},{ty:"tr",p:{a:0,k:[0,0],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Transform"}],nm:"Shape 1",np:3,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:false},{ty:"tm",s:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:135,s:[100]},{t:145.5,s:[0]}],ix:1},e:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:130,s:[100]},{t:139.6005859375,s:[0]}],ix:2},o:{a:0,k:0,ix:3},m:1,ix:2,nm:"Trim Paths 1",mn:"ADBE Vector Filter - Trim",hd:false}],ip:130,op:204,st:-2,ct:1,bm:0},{ddd:0,ind:4,ty:4,nm:"Shape Layer 5",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:180,ix:10},p:{a:0,k:[350,350,0],ix:2,l:2},a:{a:0,k:[-304,91,0],ix:1,l:2},s:{a:0,k:[100,100,100],ix:6,l:2}},ao:0,shapes:[{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[0,0],[0,0]],o:[[0,0],[0,0]],v:[[-304,-241],[-304,-161]],c:false},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:false},{ty:"st",c:{a:0,k:[1,1,1,1],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:9,ix:5},lc:2,lj:1,ml:4,bm:0,nm:"Stroke 1",mn:"ADBE Vector Graphic - Stroke",hd:false},{ty:"tr",p:{a:0,k:[0,0],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Transform"}],nm:"Shape 1",np:3,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:false},{ty:"tm",s:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:135,s:[100]},{t:145.5,s:[0]}],ix:1},e:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:130,s:[100]},{t:139.6005859375,s:[0]}],ix:2},o:{a:0,k:0,ix:3},m:1,ix:2,nm:"Trim Paths 1",mn:"ADBE Vector Filter - Trim",hd:false}],ip:130,op:204,st:-2,ct:1,bm:0},{ddd:0,ind:5,ty:4,nm:"Shape Layer 4",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:135,ix:10},p:{a:0,k:[350,350,0],ix:2,l:2},a:{a:0,k:[-304,91,0],ix:1,l:2},s:{a:0,k:[100,100,100],ix:6,l:2}},ao:0,shapes:[{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[0,0],[0,0]],o:[[0,0],[0,0]],v:[[-304,-241],[-304,-161]],c:false},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:false},{ty:"st",c:{a:0,k:[1,1,1,1],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:9,ix:5},lc:2,lj:1,ml:4,bm:0,nm:"Stroke 1",mn:"ADBE Vector Graphic - Stroke",hd:false},{ty:"tr",p:{a:0,k:[0,0],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Transform"}],nm:"Shape 1",np:3,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:false},{ty:"tm",s:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:135,s:[100]},{t:145.5,s:[0]}],ix:1},e:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:130,s:[100]},{t:139.6005859375,s:[0]}],ix:2},o:{a:0,k:0,ix:3},m:1,ix:2,nm:"Trim Paths 1",mn:"ADBE Vector Filter - Trim",hd:false}],ip:130,op:204,st:-2,ct:1,bm:0},{ddd:0,ind:6,ty:4,nm:"Shape Layer 3",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:90,ix:10},p:{a:0,k:[350,350,0],ix:2,l:2},a:{a:0,k:[-304,91,0],ix:1,l:2},s:{a:0,k:[100,100,100],ix:6,l:2}},ao:0,shapes:[{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[0,0],[0,0]],o:[[0,0],[0,0]],v:[[-304,-241],[-304,-161]],c:false},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:false},{ty:"st",c:{a:0,k:[1,1,1,1],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:9,ix:5},lc:2,lj:1,ml:4,bm:0,nm:"Stroke 1",mn:"ADBE Vector Graphic - Stroke",hd:false},{ty:"tr",p:{a:0,k:[0,0],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Transform"}],nm:"Shape 1",np:3,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:false},{ty:"tm",s:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:135,s:[100]},{t:145.5,s:[0]}],ix:1},e:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:130,s:[100]},{t:139.6005859375,s:[0]}],ix:2},o:{a:0,k:0,ix:3},m:1,ix:2,nm:"Trim Paths 1",mn:"ADBE Vector Filter - Trim",hd:false}],ip:130,op:204,st:-2,ct:1,bm:0},{ddd:0,ind:7,ty:4,nm:"Shape Layer 2",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:45,ix:10},p:{a:0,k:[350,350,0],ix:2,l:2},a:{a:0,k:[-304,91,0],ix:1,l:2},s:{a:0,k:[100,100,100],ix:6,l:2}},ao:0,shapes:[{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[0,0],[0,0]],o:[[0,0],[0,0]],v:[[-304,-241],[-304,-161]],c:false},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:false},{ty:"st",c:{a:0,k:[1,1,1,1],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:9,ix:5},lc:2,lj:1,ml:4,bm:0,nm:"Stroke 1",mn:"ADBE Vector Graphic - Stroke",hd:false},{ty:"tr",p:{a:0,k:[0,0],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Transform"}],nm:"Shape 1",np:3,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:false},{ty:"tm",s:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:135,s:[100]},{t:145.5,s:[0]}],ix:1},e:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:130,s:[100]},{t:139.6005859375,s:[0]}],ix:2},o:{a:0,k:0,ix:3},m:1,ix:2,nm:"Trim Paths 1",mn:"ADBE Vector Filter - Trim",hd:false}],ip:130,op:204,st:-2,ct:1,bm:0},{ddd:0,ind:8,ty:4,nm:"Shape Layer 1",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:0,ix:10},p:{a:0,k:[350,350,0],ix:2,l:2},a:{a:0,k:[-304,91,0],ix:1,l:2},s:{a:0,k:[100,100,100],ix:6,l:2}},ao:0,shapes:[{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[0,0],[0,0]],o:[[0,0],[0,0]],v:[[-304,-241],[-304,-161]],c:false},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:false},{ty:"st",c:{a:0,k:[1,1,1,1],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:9,ix:5},lc:2,lj:1,ml:4,bm:0,nm:"Stroke 1",mn:"ADBE Vector Graphic - Stroke",hd:false},{ty:"tr",p:{a:0,k:[0,0],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Transform"}],nm:"Shape 1",np:3,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:false},{ty:"tm",s:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:135,s:[100]},{t:145.5,s:[0]}],ix:1},e:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:130,s:[100]},{t:139.6005859375,s:[0]}],ix:2},o:{a:0,k:0,ix:3},m:1,ix:2,nm:"Trim Paths 1",mn:"ADBE Vector Filter - Trim",hd:false}],ip:130,op:204,st:-2,ct:1,bm:0},{ddd:0,ind:9,ty:4,nm:"Check v",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:-1.9,ix:10},p:{a:0,k:[352,360,0],ix:2,l:2},a:{a:0,k:[-120.265,116.765,0],ix:1,l:2},s:{a:0,k:[278,278,100],ix:6,l:2}},ao:0,shapes:[{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0]],v:[[-161,123],[-137,148],[-79.531,85.531]],c:false},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:false},{ty:"st",c:{a:0,k:[1,1,1,1],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:5.5,ix:5},lc:2,lj:2,bm:0,nm:"Stroke 1",mn:"ADBE Vector Graphic - Stroke",hd:false},{ty:"tr",p:{a:0,k:[0,0],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Transform"}],nm:"Shape 1",np:3,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:false},{ty:"tm",s:{a:1,k:[{i:{x:[0],y:[1]},o:{x:[.333],y:[0]},t:135,s:[0]},{t:148,s:[100]}],ix:1},e:{a:0,k:0,ix:2},o:{a:0,k:0,ix:3},m:1,ix:2,nm:"Trim Paths 1",mn:"ADBE Vector Filter - Trim",hd:false}],ip:135,op:201,st:-35,ct:1,bm:0},{ddd:0,ind:11,ty:4,nm:"Circle Stroke",sr:1,ks:{o:{a:1,k:[{i:{x:[.833],y:[.833]},o:{x:[.167],y:[.167]},t:0,s:[0]},{t:7,s:[100]}],ix:11},r:{a:0,k:0,ix:10},p:{a:0,k:[350,350,0],ix:2,l:2},a:{a:0,k:[4,-6,0],ix:1,l:2},s:{a:0,k:[132,132,100],ix:6,l:2}},ao:0,shapes:[{ty:"gr",it:[{d:1,ty:"el",s:{a:0,k:[306,306],ix:2},p:{a:0,k:[0,0],ix:3},nm:"Ellipse Path 1",mn:"ADBE Vector Shape - Ellipse",hd:false},{ty:"st",c:{a:1,k:[{i:{x:[.833],y:[.833]},o:{x:[.167],y:[.167]},t:0,s:[1,1,1,1]},{i:{x:[.833],y:[.833]},o:{x:[.167],y:[.167]},t:30,s:[1,1,1,1]},{i:{x:[.833],y:[.833]},o:{x:[.167],y:[.167]},t:61,s:[1,1,1,1]},{i:{x:[.833],y:[.833]},o:{x:[.167],y:[.167]},t:87,s:[1,1,1,1]},{t:136,s:[1,1,1,1]}],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:8,ix:5},lc:2,lj:1,ml:4,bm:0,nm:"Stroke 1",mn:"ADBE Vector Graphic - Stroke",hd:false},{ty:"tr",p:{a:0,k:[4,-6],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Transform"}],nm:"Ellipse 1",np:3,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:false},{ty:"tm",s:{a:1,k:[{i:{x:[.338],y:[1]},o:{x:[.333],y:[0]},t:87,s:[50]},{t:122,s:[100]}],ix:1},e:{a:1,k:[{i:{x:[.338],y:[1]},o:{x:[.333],y:[0]},t:87,s:[45]},{t:122,s:[0]}],ix:2},o:{a:1,k:[{i:{x:[.474],y:[1]},o:{x:[.43],y:[0]},t:0,s:[-170.4]},{t:111,s:[-1250.4]}],ix:3},m:1,ix:2,nm:"Trim Paths 1",mn:"ADBE Vector Filter - Trim",hd:false}],ip:0,op:201,st:0,ct:1,bm:0},{ddd:0,ind:13,ty:1,nm:"Dark Gray Solid 1",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:0,ix:10},p:{a:0,k:[350,350,0],ix:2,l:2},a:{a:0,k:[350,350,0],ix:1,l:2},s:{a:0,k:[100,100,100],ix:6,l:2}},ao:0,sw:700,sh:700,sc:"#2d2d2d",ip:0,op:201,st:0,bm:0}],markers:[],props:{}};var Ar=5e3,ux=e(ke)`
589
589
  @keyframes blurFade {
590
590
  0% {
591
591
  background-color: ${({theme:e})=>Ni(e.stigg.palette.backgroundPaper).alpha(0).toString()};
@@ -653,7 +653,7 @@ import {e,f,i,j,a,g,b,h,c,p,w,u,v,d,x,y,z,B,G,A,H as H$1,C,I,q,r,K,o,l,m,n,k}fro
653
653
  align-items: center;
654
654
  justify-content: space-between;
655
655
  }
656
- `,Hx=({checkoutLocalization:e})=>{let t=jsx(f,{variant:"body1",children:e.summary.payAsYouGoTooltipText});return jsx(Ze,{placement:"left",title:t,children:jsx(i,{icon:"PayAsYouGoCharge",style:{display:"flex"}})})},vr=({checkoutLocalization:e,label:t,quantity:o,price:r})=>{let{checkoutState:n}=D(),i=n==null?void 0:n.plan,a=me("lg"),[l,s]=useState(false),c=()=>s(h=>!h),u=r.pricingModel===BillingModel.UsageBased,f$1=r.isTieredPrice?xt(r,o):(r.amount||0)*Math.ceil(o/(r.blockSize||1)),y;r.tiersMode===TiersMode.Graduated&&r.tiers&&!Xg(r.tiers)&&!Fo(r.tiers[0].upTo)&&o>r.tiers[0].upTo&&(y=jsx(Rd,{price:r,unitQuantity:o}));let g=jsx(f,{variant:"body1",color:"secondary",children:t});return y&&(g=jsx(Wf,{onClick:c,underline:"none",style:{cursor:"pointer"},children:g})),jsxs($e,{className:"stigg-checkout-summary-base-charges-container",children:[jsxs(Fe,{style:{alignItems:"flex-start"},children:[jsxs(Re,{item:true,display:"flex",gap:.5,style:{whiteSpace:a?"nowrap":"break-spaces"},children:[g,!Fo(y)&&jsx(Vx,{onClick:c,sx:{padding:0},children:jsx(Ud,{$isOpen:l,$size:16})})]}),jsxs(Re,{item:true,display:"flex",gap:1,alignItems:"center",children:[u&&jsx(Hx,{checkoutLocalization:e}),jsxs(f,{variant:"body1",color:"secondary",style:{whiteSpace:a?"nowrap":"break-spaces"},children:[Md({totalAmount:f$1,quantity:o,currency:r.currency,pricingModel:r.pricingModel,billingPeriod:r.billingPeriod,tiers:r.tiers,tiersMode:r.tiersMode,blockSize:r.blockSize,priceAmount:r.amount,availableBillingPeriods:new Set(i==null?void 0:i.pricePoints.map(h=>h.billingPeriod))}),u&&" / unit"]})]})]}),!Fo(y)&&jsx(QP,{in:l,children:jsx(Ox,{children:y})})]})},_d=({label:e})=>jsx($e,{children:jsxs(Fe,{style:{alignItems:"flex-end"},children:[jsx(Re,{item:true,children:jsx(f,{variant:"body1",color:"secondary",children:e})}),jsx(Re,{item:true,display:"flex",gap:1,alignItems:"center",children:jsx(f,{variant:"body1",color:"secondary",style:{wordBreak:"break-word"},children:"Free"})})]})}),Dd=({subscriptionPreview:e,isFetchingSubscriptionPreview:t,checkoutLocalization:o$1})=>{let{immediateInvoice:r,recurringInvoice:n}=e,{discount:i,discountDetails:a}=n||{};return !i||!a?null:jsx($e,{children:jsxs(Fe,{children:[jsx(f,{variant:"body1",color:"secondary",children:o$1.summary.discountText({discountDetails:a,currency:r.total.currency})}),jsx(f,{variant:"body1",color:"secondary",children:t?jsx(o,{width:50,height:16}):H({amount:i.amount,currency:i.currency,minimumFractionDigits:2})})]})})},$d=({subscriptionPreview:e,isFetchingSubscriptionPreview:t,checkoutLocalization:o})=>{let{immediateInvoice:r}=e||{},{credits:n}=r||{};return !n||!n.used||n.used.amount<=0?null:jsx($e,{children:jsxs(Fe,{children:[jsx(f,{variant:"body1",color:"secondary",children:o.summary.appliedCreditsTitle}),jsx(f,{variant:"body1",color:"secondary",children:jsx(Ie,{isLoading:t,children:H({amount:-1*n.used.amount,currency:n.used.currency,minimumFractionDigits:2})})})]})})},Gd=({tax:e,taxDetails:t,isFetchingSubscriptionPreview:o,checkoutLocalization:r})=>!t||!e||(e==null?void 0:e.amount)<=0?null:jsx($e,{children:jsxs(Fe,{children:[jsx(f,{variant:"body1",color:"secondary",children:r.summary.taxTitle({taxDetails:t})}),jsx(f,{variant:"body1",color:"secondary",children:jsx(Ie,{isLoading:o,children:H({amount:e==null?void 0:e.amount,currency:e==null?void 0:e.currency,minimumFractionDigits:2})})})]})});var Di=e(ke)`
656
+ `,Hx=({checkoutLocalization:e})=>{let t=jsx(f,{variant:"body1",children:e.summary.payAsYouGoTooltipText});return jsx(Ze,{placement:"left",title:t,children:jsx(i,{icon:"PayAsYouGoCharge",style:{display:"flex"}})})},vr=({checkoutLocalization:e,label:t,quantity:o,price:r})=>{let{checkoutState:n}=D(),i=n==null?void 0:n.plan,a=me("lg"),[l,s]=useState(false),c=()=>s(h=>!h),u=r.pricingModel===BillingModel.UsageBased,f$1=r.isTieredPrice?xt(r,o):(r.amount||0)*Math.ceil(o/(r.blockSize||1)),y;r.tiersMode===TiersMode.Graduated&&r.tiers&&!Xg(r.tiers)&&!Fo(r.tiers[0].upTo)&&o>r.tiers[0].upTo&&(y=jsx(Rd,{price:r,unitQuantity:o}));let g=jsx(f,{variant:"body1",color:"secondary",children:t});return y&&(g=jsx(Wf,{onClick:c,underline:"none",style:{cursor:"pointer"},children:g})),jsxs($e,{className:"stigg-checkout-summary-base-charges-container",children:[jsxs(Fe,{style:{alignItems:"flex-start"},children:[jsxs(Re,{display:"flex",gap:.5,style:{whiteSpace:a?"nowrap":"break-spaces"},children:[g,!Fo(y)&&jsx(Vx,{onClick:c,sx:{padding:0},children:jsx(Ud,{$isOpen:l,$size:16})})]}),jsxs(Re,{display:"flex",gap:1,alignItems:"center",children:[u&&jsx(Hx,{checkoutLocalization:e}),jsxs(f,{variant:"body1",color:"secondary",style:{whiteSpace:a?"nowrap":"break-spaces"},children:[Md({totalAmount:f$1,quantity:o,currency:r.currency,pricingModel:r.pricingModel,billingPeriod:r.billingPeriod,tiers:r.tiers,tiersMode:r.tiersMode,blockSize:r.blockSize,priceAmount:r.amount,availableBillingPeriods:new Set(i==null?void 0:i.pricePoints.map(h=>h.billingPeriod))}),u&&" / unit"]})]})]}),!Fo(y)&&jsx(QP,{in:l,children:jsx(Ox,{children:y})})]})},_d=({label:e})=>jsx($e,{children:jsxs(Fe,{style:{alignItems:"flex-end"},children:[jsx(Re,{children:jsx(f,{variant:"body1",color:"secondary",children:e})}),jsx(Re,{display:"flex",gap:1,alignItems:"center",children:jsx(f,{variant:"body1",color:"secondary",style:{wordBreak:"break-word"},children:"Free"})})]})}),Dd=({subscriptionPreview:e,isFetchingSubscriptionPreview:t,checkoutLocalization:o$1})=>{let{immediateInvoice:r,recurringInvoice:n}=e,{discount:i,discountDetails:a}=n||{};return !i||!a?null:jsx($e,{children:jsxs(Fe,{children:[jsx(f,{variant:"body1",color:"secondary",children:o$1.summary.discountText({discountDetails:a,currency:r.total.currency})}),jsx(f,{variant:"body1",color:"secondary",children:t?jsx(o,{width:50,height:16}):H({amount:i.amount,currency:i.currency,minimumFractionDigits:2})})]})})},$d=({subscriptionPreview:e,isFetchingSubscriptionPreview:t,checkoutLocalization:o})=>{let{immediateInvoice:r}=e||{},{credits:n}=r||{};return !n||!n.used||n.used.amount<=0?null:jsx($e,{children:jsxs(Fe,{children:[jsx(f,{variant:"body1",color:"secondary",children:o.summary.appliedCreditsTitle}),jsx(f,{variant:"body1",color:"secondary",children:jsx(Ie,{isLoading:t,children:H({amount:-1*n.used.amount,currency:n.used.currency,minimumFractionDigits:2})})})]})})},Gd=({tax:e,taxDetails:t,isFetchingSubscriptionPreview:o,checkoutLocalization:r})=>!t||!e||(e==null?void 0:e.amount)<=0?null:jsx($e,{children:jsxs(Fe,{children:[jsx(f,{variant:"body1",color:"secondary",children:r.summary.taxTitle({taxDetails:t})}),jsx(f,{variant:"body1",color:"secondary",children:jsx(Ie,{isLoading:o,children:H({amount:e==null?void 0:e.amount,currency:e==null?void 0:e.currency,minimumFractionDigits:2})})})]})});var Di=e(ke)`
657
657
  width: 100%;
658
658
  max-width: 470px;
659
659
  flex: 1.5;
@@ -671,7 +671,7 @@ import {e,f,i,j,a,g,b,h,c,p,w,u,v,d,x,y,z,B,G,A,H as H$1,C,I,q,r,K,o,l,m,n,k}fro
671
671
  margin: 16px 0;
672
672
  `,zd=e(f)`
673
673
  margin-bottom: 8px;
674
- `;function jx({isLastStep:e,checkoutHasChanges:t,isFreeDowngrade:o,checkoutLocalization:r,isPlanUpdate:n}){return e?t?n?r.checkoutButton.updateText:o?r.checkoutButton.downgradeToFreeText:r.checkoutButton.upgradeText:r.checkoutButton.noChangesText:r.checkoutButton.nextText}var Od=({onCheckout:e,onCheckoutCompleted:t,disablePromotionCode:o,disableSuccessAnimation:r,isFreeDowngrade:n,onMockCheckoutPreview:i$1,showWatermark:a$1})=>{var fa,ya,ha,Ca;let[l,s]=useState(false),{setErrorMessage:c,useNewPaymentMethod:u}=re(),f$1=_e(),y=It(),{checkoutState:p,checkoutLocalization:g,checkoutSuccess:h,widgetState:P}=D(),{plan:b$1,activeSubscription:x}=p||{},A=xr(((fa=b$1==null?void 0:b$1.pricePoints)==null?void 0:fa.filter(G=>G.billingPeriod===y.billingPeriod))||[]),[S,F]=Zx(A,G=>G.pricingModel===BillingModel.FlatFee),T=S[0],k=n||f$1.isCheckoutComplete&&f$1.isLastStep,{isZuoraIntegration:w}=Lt(),I=l||h,{subscriptionPreview:E,isFetchingSubscriptionPreview:L,errorMessage:N}=Ic({onMockCheckoutPreview:i$1}),{handleSubmit:$,isLoading:R}=wd({isMocked:!!i$1,disableSuccessAnimation:r,onCheckout:e,onCheckoutCompleted:t,onSuccess:()=>{s(true),f$1.markStepAsCompleted(f$1.progressBarState.activeStep);}}),{handleZuoraSubmit:V}=Ir({onCheckout:e,onCheckoutCompleted:t,disableSuccessAnimation:r,onSuccess:()=>{f$1.markStepAsCompleted(f$1.progressBarState.activeStep);}}),K=G=>d(null,null,function*(){if(I)return;let we;w&&!u?we=yield V():we=yield $(G);let{errorMessage:ye}=we||{};ye?(c(ye),s(false)):c(void 0);}),Oe=w&&!u?P.readOnly:R,ut=G=>d(null,null,function*(){Oe||(k?yield K(G):f$1.goNext());}),{immediateInvoice:z,recurringInvoice:ie}=E||{},ae=!!E&&(!!(z!=null&&z.proration)||!!E.hasScheduledUpdates),Ee=!o&&!n&&!w,ho=!!(ie!=null&&ie.discountDetails)&&!n,gt=Ee||ho,pa=F.some(G=>G.pricingModel===BillingModel.UsageBased),an=pa&&!T&&F.every(G=>G.pricingModel===BillingModel.UsageBased),ma=typeof g.summary.baseChargeText=="function"?g.summary.baseChargeText({billingPeriod:y.billingPeriod}):g.summary.baseChargeText,ua=useMemo(()=>{var G,we;return (we=(G=y.addons)==null?void 0:G.filter(ye=>!lt(ye.addon)))!=null?we:[]},[y.addons]),ga=useMemo(()=>ua.filter(G=>{var ye;return !!((ye=G.addon.pricePoints)==null?void 0:ye.find(ft=>ft.billingPeriod===y.billingPeriod))}).map(G=>{let we=G.addon.pricePoints.find(ft=>ft.billingPeriod===y.billingPeriod),ye=G.quantity&&G.quantity>0?G.quantity:1;return jsx(vr,{checkoutLocalization:g,label:G.addon.displayName,quantity:ye,price:we},G.addon.id)}),[ua,y.billingPeriod,g]);return jsxs(Di,{className:"stigg-checkout-summary-container",children:[jsxs(Lr,{children:[jsx(Xx,{variant:"h3",children:g.summary.title}),jsxs(Re,{className:"stigg-checkout-summary-plan-title-container",display:"flex",flexDirection:"row",alignItems:"center",marginY:2,children:[jsx(f,{variant:"h6",color:"primary",style:{paddingRight:"8px"},children:g.summary.planName({plan:b$1})}),jsx(Nt,{className:"stigg-checkout-summary-divider",sx:{flex:1,margin:"0 !important"}})]}),T&&jsx(vr,{checkoutLocalization:g,label:ma,quantity:1,price:T}),!T&&n?jsx(_d,{label:ma}):null,jsx(Re,{item:true,className:"stigg-checkout-summary-usage-charges-container",children:F.map((G,we)=>{var ft,Pa,xa,ba,Sa;let ye=(ft=y.billableFeatures)==null?void 0:ft.find(bm=>{var Ta;return bm.featureId===((Ta=G.feature)==null?void 0:Ta.featureId)});return jsx(vr,{checkoutLocalization:g,label:Bt(((xa=G.feature)==null?void 0:xa.displayName)||"",(ba=G.feature)==null?void 0:ba.units,(Sa=G.feature)==null?void 0:Sa.unitsPlural),quantity:(ye==null?void 0:ye.quantity)||1,price:G},((Pa=G.feature)==null?void 0:Pa.featureId)||`usage-charge-${we}`)})}),ga.length>0&&jsxs(Fragment,{children:[jsxs(Re,{display:"flex",flexDirection:"row",alignItems:"center",marginY:2,children:[jsx(f,{variant:"h6",color:"primary",style:{paddingRight:"8px"},children:g.summary.addonsSectionTitle}),jsx(Nt,{className:"stigg-checkout-summary-divider",sx:{flex:1,margin:"0 !important"}})]}),ga]}),!gt&&jsx(Nt,{className:"stigg-checkout-summary-divider"}),gt&&jsxs(Re,{display:"flex",flexDirection:"row",alignItems:"center",marginY:2,children:[jsx(f,{variant:"h6",color:"primary",style:{paddingRight:"8px"},children:g.summary.discountsSectionTitle}),jsx(Nt,{className:"stigg-checkout-summary-divider",sx:{flex:1,margin:"0 !important"}})]}),Ee&&jsx(Xc,{disabled:Oe||L,checkoutLocalization:g,onMockCheckoutPreview:i$1}),ho&&E&&jsx(Dd,{subscriptionPreview:E,isFetchingSubscriptionPreview:L,checkoutLocalization:g}),gt&&jsx(Nt,{className:"stigg-checkout-summary-divider"}),jsx(Gd,{tax:ie==null?void 0:ie.tax,taxDetails:ie==null?void 0:ie.taxDetails,isFetchingSubscriptionPreview:L,checkoutLocalization:g}),n?null:jsxs(Fragment,{children:[jsx(Fe,{style:{marginTop:16},children:jsxs(Re,{display:"flex",flexDirection:"column",container:true,children:[jsxs(Re,{item:true,display:"flex",justifyContent:"space-between",children:[jsx(f,{variant:"h6",children:g.summary.totalText}),jsx(f,{variant:"h6",children:jsxs(Ie,{isLoading:L,children:[an?g.summary.onlyPayAsYouGoText:null,!an&&pa?g.summary.startsAtText:null,an?null:H(b(a({amount:0},ie==null?void 0:ie.total),{minimumFractionDigits:2}))]})})]}),jsx(Re,{item:true,children:jsx(f,{variant:"body1",color:"secondary",children:g.summary.totalBillingPeriodText({billingPeriod:y.billingPeriod})})})]})}),jsx(Nt,{className:"stigg-checkout-summary-divider"})]}),(ya=z==null?void 0:z.proration)!=null&&ya.hasProrations&&(z!=null&&z.subTotal)&&(z==null?void 0:z.subTotal.amount)>0?jsx($e,{children:jsxs(Fe,{children:[jsx(f,{variant:"body1",color:"secondary",children:g.summary.proratedTotalDueText}),jsx(f,{variant:"body1",color:"secondary",children:jsx(Ie,{isLoading:L,children:H({amount:Number(((ha=z==null?void 0:z.subTotal)==null?void 0:ha.amount)||0)+Number(((Ca=z==null?void 0:z.tax)==null?void 0:Ca.amount)||0),currency:z==null?void 0:z.subTotal.currency,minimumFractionDigits:2})})})]})}):null,jsx($d,{subscriptionPreview:E,isFetchingSubscriptionPreview:L,checkoutLocalization:g}),jsx($e,{children:jsxs(Fe,{children:[jsx(zd,{variant:"h6",children:g.summary.totalDueText}),jsx(zd,{variant:"h6",children:jsx(Ie,{isLoading:L,children:H(b(a({amount:0},z==null?void 0:z.total),{minimumFractionDigits:2}))})})]})}),jsx(Ld,{plan:b$1,activeSubscription:x,subscriptionPreview:E,isFetchingSubscriptionPreview:L,checkoutLocalization:g,billingPeriod:y.billingPeriod}),(!k||!w||w&&!u)&&jsxs(Fragment,{children:[jsx(te,{$success:I,$error:k&&n,disabled:Oe||L||f$1.progressBarState.isDisabled||k&&!ae||!!N,className:"stigg-checkout-summary-cta-button",sx:{textTransform:"none",borderRadius:"10px",marginTop:"24px",height:"36px"},variant:"contained",size:"medium",onClick:G=>{ut(G);},fullWidth:true,children:jsx(f,{className:"stigg-checkout-summary-cta-button-text",variant:"h3",color:"white",style:{display:"flex"},children:I?jsx(i,{icon:"Check",style:{display:"contents"}}):Oe||L?jsx(Jh,{size:20,sx:{color:"white"}}):jx({isLastStep:k,checkoutHasChanges:ae,isFreeDowngrade:n,checkoutLocalization:g,isPlanUpdate:!!x&&(x==null?void 0:x.plan.id)===(b$1==null?void 0:b$1.id)})})}),N&&jsx(Jx,{severity:"error",sx:{alignItems:"center",marginTop:"12px"},children:jsx(f,{overrideColor:"inherit",children:N})})]})]}),jsx(q,{source:"checkout",showWatermark:a$1,style:{marginTop:8,display:"flex",justifyContent:"center"}}),!r&&I&&jsx(kd,{checkoutLocalization:g})]})};var Hd=({showWatermark:e})=>jsxs(Di,{children:[jsxs(Lr,{children:[jsxs(l,{$flexDirection:"column",$gap:24,children:[jsx(o,{width:120,height:20}),jsx(o,{width:120,height:20}),jsx(o,{width:120,height:20}),jsx(o,{width:120,height:20})]}),jsxs(l,{$flexDirection:"column",$gap:24,marginTop:5,children:[jsx(o,{height:20}),jsx(o,{height:20}),jsx(o,{height:20})]}),jsx(n,{flex:1,marginTop:5,children:jsx(o,{height:34})})]}),jsx(q,{source:"checkout",showWatermark:e,style:{marginTop:8,display:"flex",justifyContent:"center"}})]});var Zd=e(Re)`
674
+ `;function jx({isLastStep:e,checkoutHasChanges:t,isFreeDowngrade:o,checkoutLocalization:r,isPlanUpdate:n}){return e?t?n?r.checkoutButton.updateText:o?r.checkoutButton.downgradeToFreeText:r.checkoutButton.upgradeText:r.checkoutButton.noChangesText:r.checkoutButton.nextText}var Od=({onCheckout:e,onCheckoutCompleted:t,disablePromotionCode:o,disableSuccessAnimation:r,isFreeDowngrade:n,onMockCheckoutPreview:i$1,showWatermark:a$1})=>{var fa,ya,ha,Ca;let[l,s]=useState(false),{setErrorMessage:c,useNewPaymentMethod:u}=re(),f$1=_e(),y=It(),{checkoutState:p,checkoutLocalization:g,checkoutSuccess:h,widgetState:P}=D(),{plan:b$1,activeSubscription:x}=p||{},A=xr(((fa=b$1==null?void 0:b$1.pricePoints)==null?void 0:fa.filter(G=>G.billingPeriod===y.billingPeriod))||[]),[S,F]=Zx(A,G=>G.pricingModel===BillingModel.FlatFee),T=S[0],k=n||f$1.isCheckoutComplete&&f$1.isLastStep,{isZuoraIntegration:w}=Lt(),I=l||h,{subscriptionPreview:E,isFetchingSubscriptionPreview:L,errorMessage:N}=Ic({onMockCheckoutPreview:i$1}),{handleSubmit:$,isLoading:R}=wd({isMocked:!!i$1,disableSuccessAnimation:r,onCheckout:e,onCheckoutCompleted:t,onSuccess:()=>{s(true),f$1.markStepAsCompleted(f$1.progressBarState.activeStep);}}),{handleZuoraSubmit:V}=Ir({onCheckout:e,onCheckoutCompleted:t,disableSuccessAnimation:r,onSuccess:()=>{f$1.markStepAsCompleted(f$1.progressBarState.activeStep);}}),K=G=>d(null,null,function*(){if(I)return;let we;w&&!u?we=yield V():we=yield $(G);let{errorMessage:ye}=we||{};ye?(c(ye),s(false)):c(void 0);}),Oe=w&&!u?P.readOnly:R,ut=G=>d(null,null,function*(){Oe||(k?yield K(G):f$1.goNext());}),{immediateInvoice:z,recurringInvoice:ie}=E||{},ae=!!E&&(!!(z!=null&&z.proration)||!!E.hasScheduledUpdates),Ee=!o&&!n&&!w,ho=!!(ie!=null&&ie.discountDetails)&&!n,gt=Ee||ho,pa=F.some(G=>G.pricingModel===BillingModel.UsageBased),an=pa&&!T&&F.every(G=>G.pricingModel===BillingModel.UsageBased),ma=typeof g.summary.baseChargeText=="function"?g.summary.baseChargeText({billingPeriod:y.billingPeriod}):g.summary.baseChargeText,ua=useMemo(()=>{var G,we;return (we=(G=y.addons)==null?void 0:G.filter(ye=>!lt(ye.addon)))!=null?we:[]},[y.addons]),ga=useMemo(()=>ua.filter(G=>{var ye;return !!((ye=G.addon.pricePoints)==null?void 0:ye.find(ft=>ft.billingPeriod===y.billingPeriod))}).map(G=>{let we=G.addon.pricePoints.find(ft=>ft.billingPeriod===y.billingPeriod),ye=G.quantity&&G.quantity>0?G.quantity:1;return jsx(vr,{checkoutLocalization:g,label:G.addon.displayName,quantity:ye,price:we},G.addon.id)}),[ua,y.billingPeriod,g]);return jsxs(Di,{className:"stigg-checkout-summary-container",children:[jsxs(Lr,{children:[jsx(Xx,{variant:"h3",children:g.summary.title}),jsxs(Re,{className:"stigg-checkout-summary-plan-title-container",display:"flex",flexDirection:"row",alignItems:"center",marginY:2,children:[jsx(f,{variant:"h6",color:"primary",style:{paddingRight:"8px"},children:g.summary.planName({plan:b$1})}),jsx(Nt,{className:"stigg-checkout-summary-divider",sx:{flex:1,margin:"0 !important"}})]}),T&&jsx(vr,{checkoutLocalization:g,label:ma,quantity:1,price:T}),!T&&n?jsx(_d,{label:ma}):null,jsx(Re,{className:"stigg-checkout-summary-usage-charges-container",children:F.map((G,we)=>{var ft,Pa,xa,ba,Sa;let ye=(ft=y.billableFeatures)==null?void 0:ft.find(bm=>{var Ta;return bm.featureId===((Ta=G.feature)==null?void 0:Ta.featureId)});return jsx(vr,{checkoutLocalization:g,label:Bt(((xa=G.feature)==null?void 0:xa.displayName)||"",(ba=G.feature)==null?void 0:ba.units,(Sa=G.feature)==null?void 0:Sa.unitsPlural),quantity:(ye==null?void 0:ye.quantity)||1,price:G},((Pa=G.feature)==null?void 0:Pa.featureId)||`usage-charge-${we}`)})}),ga.length>0&&jsxs(Fragment,{children:[jsxs(Re,{display:"flex",flexDirection:"row",alignItems:"center",marginY:2,children:[jsx(f,{variant:"h6",color:"primary",style:{paddingRight:"8px"},children:g.summary.addonsSectionTitle}),jsx(Nt,{className:"stigg-checkout-summary-divider",sx:{flex:1,margin:"0 !important"}})]}),ga]}),!gt&&jsx(Nt,{className:"stigg-checkout-summary-divider"}),gt&&jsxs(Re,{display:"flex",flexDirection:"row",alignItems:"center",marginY:2,children:[jsx(f,{variant:"h6",color:"primary",style:{paddingRight:"8px"},children:g.summary.discountsSectionTitle}),jsx(Nt,{className:"stigg-checkout-summary-divider",sx:{flex:1,margin:"0 !important"}})]}),Ee&&jsx(Xc,{disabled:Oe||L,checkoutLocalization:g,onMockCheckoutPreview:i$1}),ho&&E&&jsx(Dd,{subscriptionPreview:E,isFetchingSubscriptionPreview:L,checkoutLocalization:g}),gt&&jsx(Nt,{className:"stigg-checkout-summary-divider"}),jsx(Gd,{tax:ie==null?void 0:ie.tax,taxDetails:ie==null?void 0:ie.taxDetails,isFetchingSubscriptionPreview:L,checkoutLocalization:g}),n?null:jsxs(Fragment,{children:[jsx(Fe,{style:{marginTop:16},children:jsxs(Re,{sx:{display:"flex",flexDirection:"column",width:"100%"},children:[jsxs(Re,{display:"flex",justifyContent:"space-between",children:[jsx(f,{variant:"h6",children:g.summary.totalText}),jsx(f,{variant:"h6",children:jsxs(Ie,{isLoading:L,children:[an?g.summary.onlyPayAsYouGoText:null,!an&&pa?g.summary.startsAtText:null,an?null:H(b(a({amount:0},ie==null?void 0:ie.total),{minimumFractionDigits:2}))]})})]}),jsx(Re,{children:jsx(f,{variant:"body1",color:"secondary",children:g.summary.totalBillingPeriodText({billingPeriod:y.billingPeriod})})})]})}),jsx(Nt,{className:"stigg-checkout-summary-divider"})]}),(ya=z==null?void 0:z.proration)!=null&&ya.hasProrations&&(z!=null&&z.subTotal)&&(z==null?void 0:z.subTotal.amount)>0?jsx($e,{children:jsxs(Fe,{children:[jsx(f,{variant:"body1",color:"secondary",children:g.summary.proratedTotalDueText}),jsx(f,{variant:"body1",color:"secondary",children:jsx(Ie,{isLoading:L,children:H({amount:Number(((ha=z==null?void 0:z.subTotal)==null?void 0:ha.amount)||0)+Number(((Ca=z==null?void 0:z.tax)==null?void 0:Ca.amount)||0),currency:z==null?void 0:z.subTotal.currency,minimumFractionDigits:2})})})]})}):null,jsx($d,{subscriptionPreview:E,isFetchingSubscriptionPreview:L,checkoutLocalization:g}),jsx($e,{children:jsxs(Fe,{children:[jsx(zd,{variant:"h6",children:g.summary.totalDueText}),jsx(zd,{variant:"h6",children:jsx(Ie,{isLoading:L,children:H(b(a({amount:0},z==null?void 0:z.total),{minimumFractionDigits:2}))})})]})}),jsx(Ld,{plan:b$1,activeSubscription:x,subscriptionPreview:E,isFetchingSubscriptionPreview:L,checkoutLocalization:g,billingPeriod:y.billingPeriod}),(!k||!w||w&&!u)&&jsxs(Fragment,{children:[jsx(te,{$success:I,$error:k&&n,disabled:Oe||L||f$1.progressBarState.isDisabled||k&&!ae||!!N,className:"stigg-checkout-summary-cta-button",sx:{textTransform:"none",borderRadius:"10px",marginTop:"24px",height:"36px"},variant:"contained",size:"medium",onClick:G=>{ut(G);},fullWidth:true,children:jsx(f,{className:"stigg-checkout-summary-cta-button-text",variant:"h3",color:"white",style:{display:"flex"},children:I?jsx(i,{icon:"Check",style:{display:"contents"}}):Oe||L?jsx(Jh,{size:20,sx:{color:"white"}}):jx({isLastStep:k,checkoutHasChanges:ae,isFreeDowngrade:n,checkoutLocalization:g,isPlanUpdate:!!x&&(x==null?void 0:x.plan.id)===(b$1==null?void 0:b$1.id)})})}),N&&jsx(Jx,{severity:"error",sx:{alignItems:"center",marginTop:"12px"},children:jsx(f,{overrideColor:"inherit",children:N})})]})]}),jsx(q,{source:"checkout",showWatermark:a$1,style:{marginTop:8,display:"flex",justifyContent:"center"}}),!r&&I&&jsx(kd,{checkoutLocalization:g})]})};var Hd=({showWatermark:e})=>jsxs(Di,{children:[jsxs(Lr,{children:[jsxs(l,{$flexDirection:"column",$gap:24,children:[jsx(o,{width:120,height:20}),jsx(o,{width:120,height:20}),jsx(o,{width:120,height:20}),jsx(o,{width:120,height:20})]}),jsxs(l,{$flexDirection:"column",$gap:24,marginTop:5,children:[jsx(o,{height:20}),jsx(o,{height:20}),jsx(o,{height:20})]}),jsx(n,{flex:1,marginTop:5,children:jsx(o,{height:34})})]}),jsx(q,{source:"checkout",showWatermark:e,style:{marginTop:8,display:"flex",justifyContent:"center"}})]});var Zd=e(Re)`
675
675
  width: 100%;
676
676
  gap: 8px;
677
677
  `,Yd=e(Re)`
@@ -700,13 +700,13 @@ import {e,f,i,j,a,g,b,h,c,p,w,u,v,d,x,y,z,B,G,A,H as H$1,C,I,q,r,K,o,l,m,n,k}fro
700
700
  align-items: center;
701
701
  width: 100%;
702
702
  justify-content: flex-end;
703
- `;function Jd({addon:e,addonState:t,hasChanges:o,errorMessage:r,isPriceForBillingPeriodAvailable:n,checkoutLocalization:i$1,handleQuantityChange:a,handleUndo:l,handleRemoveAddon:s}){var y;let c=me("lg"),u=!!t,f$1=e.maxQuantity!==1;return jsxs(tb,{item:true,sx:{gap:"16px"},container:!c,children:[o&&jsx(te,{variant:"text",size:"small",sx:{padding:"8px",minWidth:"unset"},onClick:l,children:jsx(f,{color:"primary.main",variant:"body1",children:"Undo"})}),u&&jsxs(Re,{sx:{display:"flex",width:"100%",justifyContent:"flex-end"},children:[f$1&&jsx(pe,{id:`${e.id}-input`,type:"number",onWheel:bt,sx:c?{marginX:2,width:"100%"}:{flex:1},value:(y=t==null?void 0:t.quantity)!=null?y:"",error:!!r,helperText:r,FormHelperTextProps:{sx:{margin:"4px"}},onChange:p=>{var g,h;return a((g=p==null?void 0:p.target)!=null&&g.value?Number((h=p==null?void 0:p.target)==null?void 0:h.value):null)},onFocus:p=>p.target.select()}),jsx(Qd,{color:"error",onClick:s,children:jsx(i,{icon:"Trash",style:{display:"flex",padding:"8px"}})})]}),!u&&jsx(te,{sx:{paddingX:"22px",paddingY:"8px"},onClick:()=>a(1),disabled:!n,children:jsx(f,{color:n?"primary.main":"disabled",variant:"body1",children:i$1.addAddonText})})]})}var nb=e(Re)`
703
+ `;function Jd({addon:e,addonState:t,hasChanges:o,errorMessage:r,isPriceForBillingPeriodAvailable:n,checkoutLocalization:i$1,handleQuantityChange:a,handleUndo:l,handleRemoveAddon:s}){var y;let c=me("lg"),u=!!t,f$1=e.maxQuantity!==1;return jsxs(tb,{sx:{gap:"16px"},container:!c,children:[o&&jsx(te,{variant:"text",size:"small",sx:{padding:"8px",minWidth:"unset"},onClick:l,children:jsx(f,{color:"primary.main",variant:"body1",children:"Undo"})}),u&&jsxs(Re,{sx:{display:"flex",width:"100%",justifyContent:"flex-end"},children:[f$1&&jsx(pe,{id:`${e.id}-input`,type:"number",onWheel:bt,sx:c?{marginX:2,width:"100%"}:{flex:1},value:(y=t==null?void 0:t.quantity)!=null?y:"",error:!!r,helperText:r,FormHelperTextProps:{sx:{margin:"4px"}},onChange:p=>{var g,h;return a((g=p==null?void 0:p.target)!=null&&g.value?Number((h=p==null?void 0:p.target)==null?void 0:h.value):null)},onFocus:p=>p.target.select()}),jsx(Qd,{color:"error",onClick:s,children:jsx(i,{icon:"Trash",style:{display:"flex",padding:"8px"}})})]}),!u&&jsx(te,{sx:{paddingX:"22px",paddingY:"8px"},onClick:()=>a(1),disabled:!n,children:jsx(f,{color:n?"primary.main":"disabled",variant:"body1",children:i$1.addAddonText})})]})}var nb=e(Re)`
704
704
  display: flex;
705
705
  flex-direction: column;
706
706
  justify-content: center;
707
707
  width: 100%;
708
708
  height: 42px;
709
- `;function Xd({addon:e,billingPeriod:t,checkoutLocalization:o}){let r=e.pricePoints.find(n=>n.billingPeriod===t);return jsxs(nb,{item:true,children:[jsx(f,{variant:"h6",lineHeight:"24px",children:e.displayName}),r?jsx(f,{variant:"body1",lineHeight:"20px",color:"secondary",children:`${H({amount:r.amount,currency:r.currency,minimumFractionDigits:2})}/${t===BillingPeriod.Annually?"year":"month"}`}):jsx(f,{variant:"body1",lineHeight:"20px",color:"secondary",children:o.addonBillingPeriodNotAvailableText({planBillingPeriod:t})})]})}function sb({addon:e,billingPeriod:t,addonState:o,initialAddonState:r,setAddon:n,removeAddon:i,checkoutLocalization:a,onAddonsValidationChange:l,onAddonChange:s}){let[c,u]=useState(void 0),f=!!o&&!!r&&o.quantity!==r.quantity||!!r&&!o,y=e.pricePoints.some(P=>P.billingPeriod===t),p=P=>d(null,null,function*(){if(!P||P<=0){l({addonId:e.id,isValid:false}),u("Minimum 1"),n(e,P!=null?P:null);return}let b=yield s==null?void 0:s({addon:e,quantity:P});u(b==null?void 0:b.errorMessage),l({addonId:e.id,isValid:!(b!=null&&b.disableNextStep)}),n(e,P);}),g=()=>d(null,null,function*(){yield s==null?void 0:s({addon:e,quantity:0}),i(e.id),l({addonId:e.id,isValid:true});});return jsxs(Yd,{children:[jsx(Xd,{addon:e,billingPeriod:t,checkoutLocalization:a}),jsx(Jd,{addon:e,addonState:o,hasChanges:f,handleUndo:()=>d(null,null,function*(){if(r){let P=yield s==null?void 0:s({addon:e,quantity:r.quantity});l({addonId:e.id,isValid:!(P!=null&&P.disableNextStep)}),n(e,r.quantity);}else yield g();l({addonId:e.id,isValid:true});}),errorMessage:c,handleQuantityChange:p,isPriceForBillingPeriodAvailable:y,checkoutLocalization:a,handleRemoveAddon:g})]})}function ep({onAddonChange:e}){let{checkoutLocalization:t,setIsValid:o}=D(),{billingPeriod:r}=be(),{setIsDisabled:n}=_e(),{initialAddons:i,addons:a$1,availableAddons:l,setAddon:s,removeAddon:c}=gc(),[u,f]=useState((l==null?void 0:l.reduce((y,p)=>(y[p.id]=true,y),{}))||{});return useEffect(()=>{let y=Object.values(u).some(p=>!p);n(y),o(!y);},[u,n,o]),jsx(Zd,{container:true,children:l==null?void 0:l.map(y=>{let p=a$1.find(h=>h.addon.id===y.id),g=i==null?void 0:i.find(h=>h.addon.id===y.id);return jsx(sb,{addon:y,billingPeriod:r,addonState:p,initialAddonState:g,setAddon:s,removeAddon:c,checkoutLocalization:t,onAddonsValidationChange:({addonId:h,isValid:P})=>f(b(a({},u),{[h]:P})),onAddonChange:e},y.id)})})}var Vi=e(Re,{shouldForwardProp:e=>!e.startsWith("$")})`
709
+ `;function Xd({addon:e,billingPeriod:t,checkoutLocalization:o}){let r=e.pricePoints.find(n=>n.billingPeriod===t);return jsxs(nb,{children:[jsx(f,{variant:"h6",lineHeight:"24px",children:e.displayName}),r?jsx(f,{variant:"body1",lineHeight:"20px",color:"secondary",children:`${H({amount:r.amount,currency:r.currency,minimumFractionDigits:2})}/${t===BillingPeriod.Annually?"year":"month"}`}):jsx(f,{variant:"body1",lineHeight:"20px",color:"secondary",children:o.addonBillingPeriodNotAvailableText({planBillingPeriod:t})})]})}function sb({addon:e,billingPeriod:t,addonState:o,initialAddonState:r,setAddon:n,removeAddon:i,checkoutLocalization:a,onAddonsValidationChange:l,onAddonChange:s}){let[c,u]=useState(void 0),f=!!o&&!!r&&o.quantity!==r.quantity||!!r&&!o,y=e.pricePoints.some(P=>P.billingPeriod===t),p=P=>d(null,null,function*(){if(!P||P<=0){l({addonId:e.id,isValid:false}),u("Minimum 1"),n(e,P!=null?P:null);return}let b=yield s==null?void 0:s({addon:e,quantity:P});u(b==null?void 0:b.errorMessage),l({addonId:e.id,isValid:!(b!=null&&b.disableNextStep)}),n(e,P);}),g=()=>d(null,null,function*(){yield s==null?void 0:s({addon:e,quantity:0}),i(e.id),l({addonId:e.id,isValid:true});});return jsxs(Yd,{children:[jsx(Xd,{addon:e,billingPeriod:t,checkoutLocalization:a}),jsx(Jd,{addon:e,addonState:o,hasChanges:f,handleUndo:()=>d(null,null,function*(){if(r){let P=yield s==null?void 0:s({addon:e,quantity:r.quantity});l({addonId:e.id,isValid:!(P!=null&&P.disableNextStep)}),n(e,r.quantity);}else yield g();l({addonId:e.id,isValid:true});}),errorMessage:c,handleQuantityChange:p,isPriceForBillingPeriodAvailable:y,checkoutLocalization:a,handleRemoveAddon:g})]})}function ep({onAddonChange:e}){let{checkoutLocalization:t,setIsValid:o}=D(),{billingPeriod:r}=be(),{setIsDisabled:n}=_e(),{initialAddons:i,addons:a$1,availableAddons:l,setAddon:s,removeAddon:c}=gc(),[u,f]=useState((l==null?void 0:l.reduce((y,p)=>(y[p.id]=true,y),{}))||{});return useEffect(()=>{let y=Object.values(u).some(p=>!p);n(y),o(!y);},[u,n,o]),jsx(Zd,{container:true,children:l==null?void 0:l.map(y=>{let p=a$1.find(h=>h.addon.id===y.id),g=i==null?void 0:i.find(h=>h.addon.id===y.id);return jsx(sb,{addon:y,billingPeriod:r,addonState:p,initialAddonState:g,setAddon:s,removeAddon:c,checkoutLocalization:t,onAddonsValidationChange:({addonId:h,isValid:P})=>f(b(a({},u),{[h]:P})),onAddonChange:e},y.id)})})}var Vi=e(Re,{shouldForwardProp:e=>!e.startsWith("$")})`
710
710
  padding: 8px;
711
711
  border-radius: 10px;
712
712
  border: 1px solid ${({theme:e})=>e.stigg.palette.outlinedBorder};
@@ -750,7 +750,7 @@ import {e,f,i,j,a,g,b,h,c,p,w,u,v,d,x,y,z,B,G,A,H as H$1,C,I,q,r,K,o,l,m,n,k}fro
750
750
  flex-direction: column;
751
751
  align-items: center;
752
752
  gap: 12px;
753
- `;function np({onCheckout:e,onCheckoutCompleted:t}){var P,b,x;let{isZuoraIntegration:o,isInitialized:r,createPaymentSession:n}=Lt(),{setErrorMessage:i}=re(),{billingCountryCode:a}=be(),{checkoutState:l,widgetState:s}=D(),{handleZuoraSubmit:c}=Ir({onCheckout:e,onCheckoutCompleted:t}),u=useRef(false),[f,y]=hi.useState(false),p=((x=(b=(P=l==null?void 0:l.plan)==null?void 0:P.pricePoints)==null?void 0:b[0])==null?void 0:x.currency)||Currency.Usd,{publishableKey:g}=l==null?void 0:l.billingIntegration.billingCredentials,h=useCallback(A=>d(null,null,function*(){var S;if(!A.success||!A.paymentMethodId){let F=((S=A.error)==null?void 0:S.message)||"Payment failed";i(F),yield t({success:false,error:F});return}yield c(A.paymentMethodId);}),[c,i,t]);return useEffect(()=>(d(null,null,function*(){if(!(!r||u.current)){y(true),i(void 0);try{u.current=!0;let S=window.Zuora(g),F=Id(n,h,p,a);(yield S.createPaymentForm(F)).mount("#zuora_payment");}catch(S){u.current=false,i("Failed to render Zuora payment form");}finally{y(false);}}}),()=>{u.current=false;}),[r]),o?jsxs(yb,{children:[jsx(hb,{id:"zuora_payment",$showLoading:s.readOnly||f}),(s.readOnly||f)&&jsx(Cb,{children:jsx(Pb,{children:jsx(Jh,{size:28})})})]}):null}function ap({checked:e,text:t,subtitle:o,readOnly:r}){return jsxs(op,{children:[jsx(Sb,{checked:e,disabled:r}),jsxs(rp,{container:true,children:[jsx(Re,{item:true,children:t}),!Fo(o)&&jsx(Re,{item:true,children:o})]})]})}function sp({checked:e,paymentMethodDetails:t,readOnly:o,onSelect:r}){if(!t)return null;let{last4Digits:n,expirationMonth:i,expirationYear:a}=t;return jsx(Vi,{item:true,onClick:r,$disabled:o,children:jsx(ap,{checked:e,readOnly:o,text:jsx(f,{variant:"h6",children:`Card ending in ${n}`}),subtitle:!!i&&!!a&&jsx(f,{variant:"body1",children:`Expires ${i.toString().padStart(2,"0")}/${a}`})})})}function lp({hasExistingPaymentMethod:e,checked:t,onSelect:o,readOnly:r,checkoutLocalization:n,onBillingAddressChange:i,collectPhoneNumber:a,collectTaxId:l,onCheckout:s,onCheckoutCompleted:c}){let{isZuoraIntegration:u}=Lt();return jsxs(tp,{item:true,$hideBorders:!e,onClick:o,$disabled:r,children:[e&&jsx(ap,{checked:t,readOnly:r,text:jsx(f,{variant:"h6",children:n.newPaymentMethodText})}),jsx(QP,{in:t,children:u?jsx(np,{onCheckout:s,onCheckoutCompleted:c}):jsx(Pd,{onBillingAddressChange:i,collectPhoneNumber:a,collectTaxId:l})})]})}var Bb=e(Re)`
753
+ `;function np({onCheckout:e,onCheckoutCompleted:t}){var P,b,x;let{isZuoraIntegration:o,isInitialized:r,createPaymentSession:n}=Lt(),{setErrorMessage:i}=re(),{billingCountryCode:a}=be(),{checkoutState:l,widgetState:s}=D(),{handleZuoraSubmit:c}=Ir({onCheckout:e,onCheckoutCompleted:t}),u=useRef(false),[f,y]=hi.useState(false),p=((x=(b=(P=l==null?void 0:l.plan)==null?void 0:P.pricePoints)==null?void 0:b[0])==null?void 0:x.currency)||Currency.Usd,{publishableKey:g}=l==null?void 0:l.billingIntegration.billingCredentials,h=useCallback(A=>d(null,null,function*(){var S;if(!A.success||!A.paymentMethodId){let F=((S=A.error)==null?void 0:S.message)||"Payment failed";i(F),yield t({success:false,error:F});return}yield c(A.paymentMethodId);}),[c,i,t]);return useEffect(()=>(d(null,null,function*(){if(!(!r||u.current)){y(true),i(void 0);try{u.current=!0;let S=window.Zuora(g),F=Id(n,h,p,a);(yield S.createPaymentForm(F)).mount("#zuora_payment");}catch(S){u.current=false,i("Failed to render Zuora payment form");}finally{y(false);}}}),()=>{u.current=false;}),[r]),o?jsxs(yb,{children:[jsx(hb,{id:"zuora_payment",$showLoading:s.readOnly||f}),(s.readOnly||f)&&jsx(Cb,{children:jsx(Pb,{children:jsx(Jh,{size:28})})})]}):null}function ap({checked:e,text:t,subtitle:o,readOnly:r}){return jsxs(op,{children:[jsx(Sb,{checked:e,disabled:r}),jsxs(rp,{container:true,children:[jsx(Re,{children:t}),!Fo(o)&&jsx(Re,{children:o})]})]})}function sp({checked:e,paymentMethodDetails:t,readOnly:o,onSelect:r}){if(!t)return null;let{last4Digits:n,expirationMonth:i,expirationYear:a}=t;return jsx(Vi,{onClick:r,$disabled:o,children:jsx(ap,{checked:e,readOnly:o,text:jsx(f,{variant:"h6",children:`Card ending in ${n}`}),subtitle:!!i&&!!a&&jsx(f,{variant:"body1",children:`Expires ${i.toString().padStart(2,"0")}/${a}`})})})}function lp({hasExistingPaymentMethod:e,checked:t,onSelect:o,readOnly:r,checkoutLocalization:n,onBillingAddressChange:i,collectPhoneNumber:a,collectTaxId:l,onCheckout:s,onCheckoutCompleted:c}){let{isZuoraIntegration:u}=Lt();return jsxs(tp,{$hideBorders:!e,onClick:o,$disabled:r,children:[e&&jsx(ap,{checked:t,readOnly:r,text:jsx(f,{variant:"h6",children:n.newPaymentMethodText})}),jsx(QP,{in:t,children:u?jsx(np,{onCheckout:s,onCheckoutCompleted:c}):jsx(Pd,{onBillingAddressChange:i,collectPhoneNumber:a,collectTaxId:l})})]})}var Bb=e(Re)`
754
754
  display: flex;
755
755
  flex-direction: column;
756
756
  gap: 24px;
@@ -885,7 +885,7 @@ import {e,f,i,j,a,g,b,h,c,p,w,u,v,d,x,y,z,B,G,A,H as H$1,C,I,q,r,K,o,l,m,n,k}fro
885
885
  border-radius: 8px;
886
886
  border: 1px solid ${({theme:e})=>{var t,o;return (o=(t=e.stigg)==null?void 0:t.palette)==null?void 0:o.outlinedBorder}};
887
887
  background-color: ${({theme:e})=>{var t,o;return (o=(t=e==null?void 0:e.stigg)==null?void 0:t.palette)==null?void 0:o.backgroundPaper}};
888
- `;function Vp({currencyId:e,localization:t,decimalPlaces:o,showUnits:r=true,onAddCredits:n}){let i=he(ee),a$1=u({optional:true}),l=a$1==null?void 0:a$1.theme,{title:s,addCredits:c,formatResetPeriod:u$1}=a(a({},G),t),f$1=A({currencyId:e}),y=jsx(bS,{className:"stigg-credit-balance-container",children:jsxs(SS,{className:"stigg-credit-balance-card",children:[jsxs(Rt,{children:[jsx(f,{variant:"h6",color:"primary",className:"stigg-credit-balance-title",children:s}),n&&!f$1.isFallback&&jsxs(Ut,{type:"button",onClick:()=>n(f$1),className:"stigg-credit-balance-add-credits-button",children:[jsx(Hr,{className:"stigg-credit-balance-add-credits-icon"}),c]})]}),jsx(Gp,{entitlement:f$1,decimalPlaces:o,showUnits:r,formatResetPeriod:u$1})]})});return i?y:jsx(w,{componentTheme:l,children:y})}var wS=lazy(()=>import('./CreditUsageChart-K3QQRDRL.esm.js').then(e=>({default:e.CreditUsageChart})));function Op(e){return jsx(Suspense,{fallback:null,children:jsx(wS,a({},e))})}var BS=(e,t,o)=>o==="primary"?t.palette.primary:e>=100?t.palette.progress.high:e>=75?t.palette.progress.medium:t.palette.progress.low,AS=e.div`
888
+ `;function Vp({currencyId:e,localization:t,decimalPlaces:o,showUnits:r=true,onAddCredits:n}){let i=he(ee),a$1=u({optional:true}),l=a$1==null?void 0:a$1.theme,{title:s,addCredits:c,formatResetPeriod:u$1}=a(a({},G),t),f$1=A({currencyId:e}),y=jsx(bS,{className:"stigg-credit-balance-container",children:jsxs(SS,{className:"stigg-credit-balance-card",children:[jsxs(Rt,{children:[jsx(f,{variant:"h6",color:"primary",className:"stigg-credit-balance-title",children:s}),n&&!f$1.isFallback&&jsxs(Ut,{type:"button",onClick:()=>n(f$1),className:"stigg-credit-balance-add-credits-button",children:[jsx(Hr,{className:"stigg-credit-balance-add-credits-icon"}),c]})]}),jsx(Gp,{entitlement:f$1,decimalPlaces:o,showUnits:r,formatResetPeriod:u$1})]})});return i?y:jsx(w,{componentTheme:l,children:y})}var wS=lazy(()=>import('./CreditUsageChart-IYGRJEHB.esm.js').then(e=>({default:e.CreditUsageChart})));function Op(e){return jsx(Suspense,{fallback:null,children:jsx(wS,a({},e))})}var BS=(e,t,o)=>o==="primary"?t.palette.primary:e>=100?t.palette.progress.high:e>=75?t.palette.progress.medium:t.palette.progress.low,AS=e.div`
889
889
  width: 100%;
890
890
  height: 8px;
891
891
  background-color: ${({theme:e})=>e.stigg.palette.progress.background};