@stigg/react-sdk 4.5.3 → 4.5.5
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.
- package/README.md +7 -0
- package/dist/components/checkout/CheckoutContainer.d.ts +4 -2
- package/dist/components/checkout/hooks/useSubscriptionState.d.ts +2 -2
- package/dist/components/checkout/steps/payment/stripe/stripe.utils.d.ts +9 -13
- package/dist/components/checkout/steps/payment/stripe/useSubmit.d.ts +2 -1
- package/dist/components/customerPortal/paywall/CustomerPortalPaywall.d.ts +0 -1
- package/dist/components/customerPortal/paywall/CustomerPortalPaywall.style.d.ts +0 -1
- package/dist/components/paywall/Paywall.d.ts +0 -1
- package/dist/components/paywall/PlanOffering.d.ts +2 -1
- package/dist/components/paywall/PlanOfferingButton.d.ts +1 -2
- package/dist/react-sdk.cjs.development.js +287 -260
- package/dist/react-sdk.cjs.development.js.map +1 -1
- package/dist/react-sdk.cjs.production.min.js +1 -1
- package/dist/react-sdk.cjs.production.min.js.map +1 -1
- package/dist/react-sdk.esm.js +288 -261
- package/dist/react-sdk.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/components/checkout/CheckoutContainer.tsx +13 -3
- package/src/components/checkout/hooks/useSubscriptionState.ts +2 -3
- package/src/components/checkout/steps/payment/stripe/stripe.utils.ts +31 -22
- package/src/components/checkout/steps/payment/stripe/useSubmit.ts +63 -46
- package/src/components/checkout/summary/CheckoutSummary.tsx +1 -0
- package/src/components/customerPortal/CustomerPortalContainer.tsx +5 -8
- package/src/components/customerPortal/paywall/CustomerPortalPaywall.style.ts +0 -10
- package/src/components/customerPortal/paywall/CustomerPortalPaywall.tsx +2 -5
- package/src/components/paywall/Paywall.tsx +36 -20
- package/src/components/paywall/PaywallContainer.tsx +2 -2
- package/src/components/paywall/PlanOffering.tsx +32 -17
- package/src/components/paywall/PlanOfferingButton.tsx +1 -3
- package/src/components/paywall/utils/mapPaywallData.ts +13 -11
- package/src/stories/Checkout.stories.tsx +2 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var t,n=require("@stigg/js-client-sdk"),r=e(n),i=require("react"),a=e(i),o=e(require("@emotion/styled/base")),l=require("styled-typography"),c=require("@emotion/react"),s=require("lodash"),u=e(require("react-spinners/ClipLoader")),d=e(require("color")),m=e(require("lodash/merge")),p=e(require("moment")),g=e(require("lodash/isNil")),h=e(require("classnames")),f=e(require("@mui/material/Grid")),y=e(require("currency-symbol-map")),v=e(require("@mui/material/MenuItem")),b=e(require("@mui/material/OutlinedInput")),x=e(require("@mui/material/Select")),E=e(require("react-switch")),w=require("react-loading-skeleton"),k=e(w),P=e(require("lodash/sortBy")),C=require("styled-components"),S=e(C),T=require("@mui/material/styles"),B=require("@mui/material/Button"),M=e(B),A=e(require("lodash/flatMap")),U=e(require("@mui/material/Box")),L=e(require("@mui/material/Tab")),F=e(require("lodash/isEmpty")),N=e(require("@mui/material/Tabs")),I=require("react-feather"),D=e(require("@mui/material/Link")),O=require("@mui/material/Tooltip"),j=e(O),q=require("@mui/material/LinearProgress"),R=e(q),W=e(require("@mui/material/Divider")),z=e(require("lodash/isUndefined")),_=e(require("lodash/lowerCase")),H=require("immer"),V=e(require("lodash/cloneDeep")),$=e(require("lodash/remove")),Z=e(require("lodash/keyBy")),G=e(require("lodash/compact")),Y=require("@stigg/api-client-js/src/generated/sdk"),Q=require("@stripe/react-stripe-js"),K=e(require("@mui/material/StepIcon")),X=e(require("lodash/partition")),J=e(require("@mui/material/CircularProgress")),ee=e(require("@mui/material/Paper")),te=e(require("@emotion/styled")),ne=e(require("@mui/material/TextField")),re=require("@stripe/stripe-js"),ie=e(require("react-lottie")),ae=e(require("@mui/material/Alert")),oe=e(require("@mui/material/Collapse")),le=e(require("@mui/material/Radio"));function ce(e,t,n,r,i,a,o){try{var l=e[a](o),c=l.value}catch(e){return void n(e)}l.done?t(c):Promise.resolve(c).then(r,i)}function se(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var a=e.apply(t,n);function o(e){ce(a,r,i,o,l,"next",e)}function l(e){ce(a,r,i,o,l,"throw",e)}o(void 0)}))}}function ue(){return(ue=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function de(e,t){if(null==e)return{};var n,r,i={},a=Object.keys(e);for(r=0;r<a.length;r++)t.indexOf(n=a[r])>=0||(i[n]=e[n]);return i}function me(e,t){return t||(t=e.slice(0)),e.raw=t,e}function pe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function ge(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return pe(e,void 0);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?pe(e,void 0):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function he(){return(he=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}require("@mui/material/Chip");var fe=function(e){return i.createElement("svg",he({width:15,height:11,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),t||(t=i.createElement("path",{d:"M5.59 7.99 2.125 4.525A1 1 0 1 0 .71 5.94l4.88 4.88 8.705-8.705a.997.997 0 0 0-1.41-1.41L5.59 7.99Z",fill:"#B2BBD3"})))};function ye(e,t,n){var r=n?" "+n:"";return e&&1!==e||!t?e&&e>1&&t?e+"-"+t+r:e&&e>1?"Minimum "+e+r:"":"Up to "+t+r}var ve=["children","span","style","fontWeight","variant","color","overrideColor","bold"];function be(e,t){switch(t){case"white":return"white";case"primary.main":return e.stigg.palette.primary;case"primary.main.light":return e.stigg.palette.primaryLight;case"warning":return e.stigg.palette.warning;case"error":return e.stigg.palette.error;default:return e.stigg.palette.text[t]}}var xe=o(l.Text,{target:"ewjez2x0"})("margin:0;",(function(e){return e.$span&&"display: inline"}),";");function Ee(e){switch(e){case"bold":return l.FontWeight.Bold;case"normal":default:return l.FontWeight.Normal}}function we(e,t){var n=e.stigg.typography;switch(t){case"h1":return Ee(n.h1.fontWeight);case"h3":return Ee(n.h2.fontWeight);case"h6":return Ee(n.h3.fontWeight);case"body1":return Ee(n.body.fontWeight);case"caption":return Ee(n.caption.fontWeight);default:return l.FontWeight.Normal}}var ke=i.forwardRef((function(e,t){var n=e.children,r=e.span,i=e.style,o=e.fontWeight,s=e.variant,u=void 0===s?"body1":s,d=e.color,m=void 0===d?"primary":d,p=e.overrideColor,g=e.bold,h=de(e,ve),f=c.useTheme(),y=function(e){switch(e){case"h1":return 1;case"h3":return 2;case"h6":return 3;case"body1":return 4;case"caption":return 5;default:return 3}}(u),v="typography-level-"+y;return a.createElement(xe,Object.assign({ref:t},h,{className:e.className?e.className+" "+v:v,style:i,level:y,color:p||be(f,m),fontWeight:null!=o?o:g?l.FontWeight.Bold:we(f,u),$span:r}),n)})),Pe=["displayNameOverride"],Ce=o(ke,{target:"e1mddeqb2"})({name:"ti75j2",styles:"margin:0"}),Se=o("div",{target:"e1mddeqb1"})({name:"s5xdrg",styles:"display:flex;align-items:center"}),Te=o(fe,{target:"e1mddeqb0"})("margin-right:16px;flex-shrink:0;*{fill:",(function(e){return e.theme.stigg.palette.text.disabled}),";}");function Be(e){var t=e.displayNameOverride,r=function(e){var t=e.hasUnlimitedUsage,r=e.feature,i=e.resetPeriod,a=e.usageLimit,o=e.minUnitQuantity,l=e.maxUnitQuantity,c=e.isCustom,s=o||l,u=i&&a?""+function(e){if(!e)return"";switch(e){case n.EntitlementResetPeriod.Day:return"per day";case n.EntitlementResetPeriod.Hour:return"per hour";case n.EntitlementResetPeriod.Week:return"per week";case n.EntitlementResetPeriod.Month:return"per month"}}(i):"";if(t)return"Unlimited "+(null==r?void 0:r.unitsPlural);if(c)return"Custom "+(null==r?void 0:r.unitsPlural);if(a){var d=1===a?null==r?void 0:r.units:null==r?void 0:r.unitsPlural;return function(e){return e.toLocaleString("en-US",{maximumFractionDigits:0})}(a)+" "+d+" "+u}return s?ye(o,l,null==r?void 0:r.unitsPlural):null==r?void 0:r.displayName}(de(e,Pe));return a.createElement(Se,{className:"stigg-entitlement-row-container"},a.createElement(Te,{className:"stigg-entitlement-row-icon"}),a.createElement(Ce,{className:"stigg-entitlement-name",variant:"h6",color:"secondary"},t||r))}var Me,Ae=o("div",{target:"e1yz7zcg0"})({name:"budh8k",styles:"display:flex;flex-direction:column;gap:16px"});function Ue(e){var t,r=e.plan,i=e.billingPeriod,o=e.paywallLocale,l=null==(t=r.pricePoints)?void 0:t.filter((function(e){return e.billingPeriod===i})),c=null==l?void 0:l.map((function(e){var t;return(null==e?void 0:e.minUnitQuantity)&&(null==e?void 0:e.minUnitQuantity)>1||(null==e?void 0:e.maxUnitQuantity)?a.createElement(Be,{key:"priceUnitEntitlement-"+(null==e||null==(t=e.feature)?void 0:t.displayName),feature:null==e?void 0:e.feature,minUnitQuantity:null==e?void 0:e.minUnitQuantity,maxUnitQuantity:null==e?void 0:e.maxUnitQuantity}):null}));return a.createElement(Ae,{className:"stigg-plan-entitlements-container"},a.createElement(ke,{className:"stigg-plan-entitlements-title",color:"secondary",variant:"h6",bold:!0},function(e,t){if(t.entitlementsTitle)return t.entitlementsTitle(e);var n=e.displayName+" includes";return e.basePlan&&(n="Everything in "+e.basePlan.displayName+", plus:"),n}(r,o)),c,r.entitlements.filter((function(e){return!(e.hiddenFromWidgets||[]).includes(n.WidgetType.Paywall)})).map((function(e){var t;return a.createElement(Be,{key:null==(t=e.feature)?void 0:t.id,displayNameOverride:e.displayNameOverride,feature:e.feature,resetPeriod:e.resetPeriod,hasUnlimitedUsage:e.hasUnlimitedUsage,usageLimit:e.usageLimit,isCustom:e.isCustom})})))}(Me=exports.SubscribeIntentionType||(exports.SubscribeIntentionType={})).START_TRIAL="START_TRIAL",Me.UPGRADE_TRIAL_TO_PAID="UPGRADE_TRIAL_TO_PAID",Me.REQUEST_CUSTOM_PLAN_ACCESS="REQUEST_CUSTOM_PLAN_ACCESS",Me.CHANGE_BILLING_PERIOD="CHANGE_BILLING_PERIOD",Me.CHANGE_UNIT_QUANTITY="CHANGE_UNIT_QUANTITY",Me.UPGRADE_PLAN="UPGRADE_PLAN",Me.DOWNGRADE_PLAN="DOWNGRADE_PLAN",Me.CANCEL_SCHEDULED_UPDATES="CANCEL_SCHEDULED_UPDATES";var Le,Fe,Ne=function(e){return{left:"flex-start",center:"center",right:"flex-end"}[e]},Ie=function(e){return p.utc(e).format("MMMM Do, yyyy")};function De(e){var t=e.scheduledUpdate,r=e.subscriptionPrices,i=e.billingPeriodRange,o=e.options,l=void 0===o?{}:o;if(!t)return{};var c=l.withDate,u=l.postfix,d=void 0===u?"":u;switch(t.subscriptionScheduleType){case n.SubscriptionScheduleType.Downgrade:var m,h=c;return g(h)&&null!=i&&i.end&&(h=!p(t.scheduledExecutionTime).isSame(null==i?void 0:i.end,"day")),{line1:a.createElement(a.Fragment,null,"Your subscription will be downgraded to the ",a.createElement("b",null,null==(m=t.targetPackage)?void 0:m.displayName," plan")," ",h?a.createElement(a.Fragment,null,"on ",Ie(t.scheduledExecutionTime)):d,"."),line2:"Until then you still have access to your current plan."};case n.SubscriptionScheduleType.BillingPeriod:var f;return{line1:a.createElement(a.Fragment,null,"Your billing cycle will change to ",a.createElement("b",null,null==(f=t.scheduleVariables.billingPeriod)?void 0:f.toLocaleLowerCase())," ",c?a.createElement(a.Fragment,null,"on ",Ie(t.scheduledExecutionTime)):d,".")};case n.SubscriptionScheduleType.UnitAmount:var y=t.scheduleVariables,v=s.compact(s.map(r,"feature")).find((function(e){return e.id===y.featureId}))||{},b=v.featureUnits,x=1===y.newUnitAmount?b:v.featureUnitsPlural;return{line1:a.createElement(a.Fragment,null,"Your subscription will be updated to ",a.createElement("b",null,y.newUnitAmount)," ",x," ",c?a.createElement(a.Fragment,null,"on ",Ie(t.scheduledExecutionTime)):d,"."),line2:"Until then you still have access to your current "+b+" count."};default:return{}}}function Oe(e){return e.feature&&(1!=e.feature.unitQuantity?e.feature.unitsPlural:e.feature.units)||""}function je(e,t){if(e){var n=[].concat(e);n.sort((function(e,t){return e.upTo-t.upTo}));for(var r,i=ge(n);!(r=i()).done;){var a=r.value;if(t<=a.upTo)return a}return n[n.length-1]}}function qe(e,t,r,i){switch(e.tiersMode){case n.TiersMode.Volume:return(r===n.BillingPeriod.Annually&&i?t.unitPrice.amount/12:t.unitPrice.amount)*t.upTo}return 0}function Re(e,t,r,i){var a=e.pricePoints.filter((function(e){return e.billingPeriod===t&&e.isTieredPrice}));if(1==a.length){var o,l=a[0],c=l.feature.featureId,s=l.tiers[0];if(i[c])s=(null==(o=l.tiers)?void 0:o.find((function(e){return e.upTo===i[c].upTo})))||s;else if(r){var u=r.prices.find((function(e){var t;return e.pricingModel==n.BillingModel.PerUnit&&e.tiersMode&&(null==(t=e.feature)?void 0:t.featureId)===c}));u&&(s=je(l.tiers,u.feature.unitQuantity||1))}var d={};return d[c]=s,d}return{}}!function(e){e[e.Lower=-1]="Lower",e[e.Equal=0]="Equal",e[e.Higher=1]="Higher"}(Le||(Le={}));var We,ze=o(u,{target:"e199qof96"})({name:"1a2afmv",styles:"margin-left:10px"}),_e=o("button",{target:"e199qof95"})("cursor:",(function(e){return e.$disabled?"default":"pointer"}),";padding:8px 12px;background-color:",(function(e){return e.theme.stigg.palette.backgroundButton}),";border:",(function(e){return"1px solid "+e.theme.stigg.palette.outlinedRestingBorder}),";border-radius:10px;display:flex;align-items:center;justify-content:center;min-height:42px;min-width:120px;",(function(e){return e.$disabled&&c.css(Fe||(Fe=me(["\n opacity: 0.5;\n "])))})," &:hover{background-color:",(function(e){var t=e.theme;return e.$disabled?t.stigg.palette.backgroundButton:t.stigg.palette.outlinedHoverBackground}),";}"),He=o(ke,{target:"e199qof94"})({name:"h05omw",styles:"margin:0;font-size:15px"}),Ve=o(ke,{target:"e199qof93"})({name:"1cnls12",styles:"min-height:87px"}),$e=o("button",{target:"e199qof92"})("background:none;border:none;padding:0;color:",(function(e){return e.theme.stigg.palette.text.secondary}),";text-decoration:underline;cursor:pointer;"),Ze=o(ke,{target:"e199qof91"})({name:"1etgg0o",styles:"margin-top:8px;margin-bottom:17px;min-height:20px"}),Ge=o("div",{target:"e199qof90"})("display:flex;flex-direction:column;margin-top:4px;align-self:",(function(e){return Ne(e.theme.stigg.layout.ctaAlignment)}),";width:100%;");function Ye(e){var t=e.isNextPlan,r=e.customer,o=e.plan,l=e.billingPeriod,u=e.isCustomerOnTrial,d=e.onPlanSelected,m=e.paywallLocale,p=e.hasTiersRow,g=e.withTrialLeftRow,h=e.currentSubscription,f=e.selectedTierByFeature,y=c.useTheme(),v=i.useState(!1),b=v[0],x=v[1],E=m.planCTAButton,w=E.currentPlan,k=E.custom,P=E.downgrade,C=E.startTrial,S=E.upgrade,T=E.startNew,B=E.switchToBillingPeriod,M=E.cancelScheduledUpdate,A=s.isFunction(P)?P(o):P,U=s.isFunction(S)?S(o):S,L={title:r?o.isLowerThanCurrentPlan?A:U:T,disabled:!1,intentionType:o.isLowerThanCurrentPlan?exports.SubscribeIntentionType.DOWNGRADE_PLAN:u?exports.SubscribeIntentionType.UPGRADE_TRIAL_TO_PAID:exports.SubscribeIntentionType.UPGRADE_PLAN},F=o.pricingType===n.PricingType.Custom,N=De({scheduledUpdate:o.scheduledUpdate,options:{withDate:!0}}).line1;if(!o.isTriable||o.isCurrentCustomerPlan||u)if(o.isCurrentCustomerPlan&&!u)if(l===o.currentCustomerPlanBillingPeriod||o.pricingType&&[n.PricingType.Free,n.PricingType.Custom].includes(o.pricingType))switch(function(e,t){if(!t||!e)return Le.Equal;var r=t.prices.find((function(e){return e.pricingModel==n.BillingModel.PerUnit&&e.tiersMode}));if(!r)return Le.Equal;var i=r.feature,a=i.unitQuantity;if(!a)return Le.Equal;var o=e[i.featureId];return o?o.upTo<a?Le.Lower:o.upTo>a?Le.Higher:Le.Equal:Le.Equal}(f,h)){case Le.Lower:L.intentionType=exports.SubscribeIntentionType.CHANGE_UNIT_QUANTITY,L.title=A;break;case Le.Higher:L.intentionType=exports.SubscribeIntentionType.CHANGE_UNIT_QUANTITY,L.title=U;break;default:L.title=w,L.disabled=!0}else L.title=B(l),L.intentionType=exports.SubscribeIntentionType.CHANGE_BILLING_PERIOD;else F&&(L.title=k,L.intentionType=exports.SubscribeIntentionType.REQUEST_CUSTOM_PLAN_ACCESS);else L.title=C(o),L.intentionType=exports.SubscribeIntentionType.START_TRIAL;t&&o.scheduledUpdate&&(L.disabled=!1,L.title=M,L.intentionType=exports.SubscribeIntentionType.CANCEL_SCHEDULED_UPDATES);var I=b||L.disabled;return a.createElement(a.Fragment,null,a.createElement(Ge,{className:"stigg-paywall-plan-button-layout"},t&&N?a.createElement(Ve,{color:"secondary",variant:"body1",className:"stigg-paywall-schedule-update-text"},N," ",a.createElement($e,{color:"secondary",onClick:function(){x(!0),Promise.resolve(d(L.intentionType)).finally((function(){return x(!1)}))}},L.title)):a.createElement(a.Fragment,null,a.createElement(_e,{className:"stigg-paywall-plan-button","data-testid":"paywall-card-cta-"+o.displayName,disabled:I,$disabled:I,onClick:function(){x(!0),Promise.resolve(d(L.intentionType)).finally((function(){return x(!1)}))}},a.createElement(He,{className:"stigg-paywall-plan-button-text",variant:"h6",color:"primary.main"},L.title),b&&a.createElement(ze,{color:y.stigg.palette.text.disabled,loading:!0,size:16})),p&&!g?a.createElement("div",{style:{height:"20px"}}):a.createElement(Ze,{className:"stigg-trial-days-left-text",variant:"h6",color:"secondary"},o.isCurrentCustomerPlan&&o.trialDaysLeft&&a.createElement(a.Fragment,null,a.createElement("b",null,o.trialDaysLeft," days")," left on your free trial")))))}function Qe(){return(Qe=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var Ke=function(e){return i.createElement("svg",Qe({width:16,height:16,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),We||(We=i.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.954 1.034A1 1 0 0 1 6.3 2.287a5.666 5.666 0 1 0 7.367 5.406 1 1 0 0 1 2 0c0 .23-.01.458-.03.684.01.072.012.147.006.223l-.004.049a1 1 0 0 1-.078.312A7.668 7.668 0 1 1 5.7.38a1 1 0 0 1 1.254.654Zm.614.239A1 1 0 0 1 8.648.36l.05.004a1 1 0 1 1-.182 1.992l-.037-.003a1 1 0 0 1-.911-1.081Zm4.85 1.636a1 1 0 0 1 1.41.11l.064.076a1 1 0 1 1-1.537 1.28 4.154 4.154 0 0 0-.047-.056 1 1 0 0 1 .11-1.41ZM9 5.334a1 1 0 0 0-2 0V8a1 1 0 0 0 1 1h2.667a1 1 0 1 0 0-2H9V5.334Z",fill:"#7586B0"})))},Xe=function(e){var t=e.amount,r=e.currency,i=e.locale,a=e.maximumFractionDigits,o=void 0===a?5:a,l=e.minimumFractionDigits,c=void 0===l?0:l,s=(void 0===r?n.Currency.Usd:r).toString(),u=y(s),d=new Intl.NumberFormat(i,ue({maximumFractionDigits:o,minimumFractionDigits:c,style:"currency",currency:s},u?{currencyDisplay:"code"}:{})).format(t||0);return u&&(d=d.replace(s,u)),d.replace(/\s/g,"")};function Je(e,t,r,i,a,o){switch(e.pricingType){case n.PricingType.Free:return"function"==typeof r.price.free?r.price.free(e.paywallCurrency):r.price.free;case n.PricingType.Custom:return{price:r.price.custom};case n.PricingType.Paid:var l,c=e.pricePoints.filter((function(e){return e.billingPeriod===t})),s=null==(l=e.paywallCalculatedPricePoints)?void 0:l.find((function(e){return e.billingPeriod===t}));if(!(null!=c&&c.length||s))return{price:r.price.priceNotSet};var u={planPrices:c,paywallCalculatedPrice:s,selectedBillingPeriod:t,selectedTierByFeature:o||{}};return r.price.paid?r.price.paid(ue({},u,{plan:e})):function(e){for(var t,r,i,a=e.planPrices,o=e.selectedBillingPeriod,l=e.locale,c=e.shouldShowMonthlyPriceAmount,s=e.selectedTierByFeature,u=e.paywallCalculatedPrice||a[0],d=u.currency,m=u.amount||0,p=1===a.length,g=o===n.BillingPeriod.Annually&&c?m/12:m,h=e.paywallLocale.price.pricePeriod(c?n.BillingPeriod.Monthly:n.BillingPeriod.Annually),f=h,y=ge(a);!(i=y()).done;){var v=i.value;if(v.isTieredPrice){var b=v.tiers[0];s[v.feature.featureId]&&(b=s[v.feature.featureId]||b,t=v.tiers,r=Oe(v)),g+=qe(v,b,o,c)}}if(p){var x,E=a[0],w=(null==(x=E.feature)?void 0:x.units)||"";E.pricingModel!==n.BillingModel.PerUnit||E.isTieredPrice?E.pricingModel===n.BillingModel.UsageBased&&(f="per "+w):f="per "+w+" "+h}return{price:Xe({amount:g,currency:d,locale:l}),unit:f,tiers:t,tierUnits:r}}(ue({},u,{locale:i,shouldShowMonthlyPriceAmount:a,paywallLocale:r}));default:return{price:""}}}var et=o(x,{target:"eeq8l4e1"})("border-radius:10px;min-height:42px;min-width:120px;&:hover .MuiOutlinedInput-notchedOutline{border-color:",(function(e){return e.theme.stigg.palette.outlinedBorder}),";}"),tt=o(b,{target:"eeq8l4e0"})("& .MuiInputBase-input{padding:10px 12px;}&.Mui-focused .MuiOutlinedInput-notchedOutline{border-color:",(function(e){return e.theme.stigg.palette.primary}),"!important;}");function nt(e){var t=e.componentId,n=e.tiers,r=e.tierUnits,i=e.selectedTier,o=e.handleTierChange;return a.createElement(ke,{className:"stigg-price-tier-select",style:{minHeight:"46px"}},n?a.createElement(et,{value:i?i.upTo.toString():n[0].upTo.toString(),fullWidth:!0,onChange:function(e,t){n&&o(je(n,e.target.value))},id:t,input:a.createElement(tt,null),MenuProps:{MenuListProps:{disablePadding:!0},PaperProps:{sx:{marginTop:"4px",borderRadius:"10px"}}}},s.map(n,(function(e){return a.createElement(v,{className:"stigg-price-tier-menu-item-text",key:e.upTo,value:e.upTo.toString()},a.createElement(ke,{variant:"body1",color:"primary",style:{lineHeight:"unset"}},e.upTo," ",r))}))):a.createElement("div",null))}var rt=o(ke,{target:"e1gsqbi12"})({name:"bfvx8c",styles:"word-break:break-word;width:100%"}),it=o(ke,{target:"e1gsqbi11"})({name:"1bmnxg7",styles:"white-space:nowrap"}),at=o(ke,{target:"e1gsqbi10"})({name:"nurf5y",styles:"white-space:normal;min-height:39px"});function ot(e){var t=e.billingPeriod,n=e.hasMonthlyPrice,r=e.hasAnnuallyPrice,i=e.paywallLocale,o="";return e.plan.pricePoints.find((function(e){return e.billingPeriod===t}))&&n&&r&&(o=(null==i.price.billingPeriod?void 0:i.price.billingPeriod(t))||", billed "+t.toLowerCase()),a.createElement(ke,{span:!0,className:"stigg-price-billing-period-text",variant:"h6",color:"secondary"},o)}var lt=function(e){var t=e.showStartingAt,n=e.withUnitPriceRow,r=e.withStartingAtRow,i=e.withTiersRow,o=e.selectedTierByFeature,l=e.setSelectedTierByFeature,c=e.plan,s=e.billingPeriod,u=e.paywallLocale,d=e.hasMonthlyPrice,m=e.hasAnnuallyPrice,p=Je(c,s,u,e.locale,d,o),g=p.price,h=p.unit,f=p.tiers,y=p.tierUnits,v=c.pricePoints.find((function(e){return e.billingPeriod===s&&e.isTieredPrice})),b=v?v.feature.featureId:void 0,x=b?o[b]:void 0;return a.createElement(rt,{className:"stigg-price-text"},a.createElement(a.Fragment,null,r&&a.createElement(ke,{style:{minHeight:"20px"},className:"stigg-starting-at-text",variant:"body1",color:"secondary"},t?u.price.startingAtCaption:""),a.createElement(at,{variant:"h1"},g),n&&a.createElement(ke,{className:"stigg-price-unit-and-billing-period-text",style:{minHeight:"48px"}},a.createElement(it,{span:!0,variant:"h6",color:"secondary"},h),a.createElement(ot,{plan:c,billingPeriod:s,hasAnnuallyPrice:m,hasMonthlyPrice:d,paywallLocale:u})),i?a.createElement(nt,{componentId:c.id+"_"+b+"_tier",tiers:f,tierUnits:y,selectedTier:x,handleTierChange:function(e){b&&l((function(t){var n;return ue({},t,((n={})[b]=e,n))}))}}):null))},ct=o("div",{target:"eacdu8d8"})("position:relative;background-color:",(function(e){var t=e.theme;return e.$isCurrentPlan?t.stigg.palette.backgroundHighlight:t.stigg.palette.backgroundPaper}),";border:",(function(e){var t=e.theme;return e.$isHighlighted?"3px solid "+t.stigg.palette.primary:"1px solid "+t.stigg.palette.outlinedBorder}),";border-radius:10px;padding:",(function(e){return e.theme.stigg.layout.planPadding}),";display:flex;min-width:",(function(e){return e.theme.stigg.layout.planMinWidth}),";max-width:",(function(e){return e.theme.stigg.layout.planMaxWidth}),";flex-direction:column;align-items:flex-start;justify-content:flex-start;position:relative;"),st=o(ke,{target:"eacdu8d7"})({name:"mpkj0c",styles:"padding-bottom:8px"}),ut=o("div",{target:"eacdu8d6"})("height:2px;width:100%;background-color:",(function(e){return e.theme.stigg.palette.outlinedBorder}),";margin-bottom:40px;"),dt=o(ke,{target:"eacdu8d5"})("text-align:",(function(e){return e.theme.stigg.layout.descriptionAlignment}),";min-height:",(function(e){return e.theme.stigg.layout.descriptionMinHeight}),";"),mt=o("div",{target:"eacdu8d4"})("background-color:",(function(e){return e.theme.stigg.palette.primary}),";border-radius:40px;position:absolute;top:-12px;"),pt=o(ke,{target:"eacdu8d3"})({name:"a8c38r",styles:"margin:0;padding:2px 8px"}),gt=o("div",{target:"eacdu8d2"})("width:100%;display:flex;flex-direction:column;align-items:",(function(e){return Ne(e.theme.stigg.layout.headerAlignment)}),";"),ht=o("div",{target:"eacdu8d1"})("position:absolute;top:0;background-color:",(function(e){return e.theme.stigg.palette.outlinedBorder}),";border-radius:0px 0px 10px 10px;padding:3px 12px;"),ft=o(Ke,{target:"eacdu8d0"})("display:flex;height:100%;margin-right:4px;path{fill:",(function(e){return e.theme.stigg.palette.text.primary}),";}");function yt(e){var t=e.text,n=void 0===t?"Next":t;return a.createElement(ht,null,a.createElement(f,{display:"flex",alignItems:"center",gap:1},a.createElement(ft,{$iconsColor:e.iconsColor}),a.createElement(ke,{color:"primary",variant:"body1"},n)))}function vt(e){var t,n=e.withUnitPriceRow,r=e.withTiersRow,o=e.withTrialLeftRow,l=e.customer,c=e.plan,s=e.billingPeriod,u=e.isHighlighted,d=e.currentSubscription,m=e.shouldShowDescriptionSection,p=e.hasMonthlyPrice,g=e.hasAnnuallyPrice,f=e.isCustomerOnTrial,y=e.onPlanSelected,v=e.paywallLocale,b=e.locale,x=e.withStartingAtRow,E=c.isNextPlan&&c.isNextPlan(s),w=c.pricePoints.filter((function(e){return e.billingPeriod===s})),k=null==(t=c.paywallCalculatedPricePoints)?void 0:t.find((function(e){return e.billingPeriod===s})),P=w.length>1&&!(null==k||!k.additionalChargesMayApply),C=null;E?C=a.createElement(yt,{text:"Next plan"}):u&&v.highlightChip&&(C=a.createElement(mt,{className:"stigg-highlight-badge"},a.createElement(pt,{className:"stigg-highlight-badge-text",color:"white",bold:!0},v.highlightChip)));var S=a.useState(Re(c,s,d,{})),T=S[0],B=S[1];return i.useEffect((function(){B(Re(c,s,d,T))}),[s]),a.createElement(ct,{className:h("stigg-plan-offering-container",{"stigg-current-plan":c.isCurrentCustomerPlan}),$isHighlighted:u,$isCurrentPlan:c.isCurrentCustomerPlan},C,a.createElement(gt,{className:"stigg-header-wrapper"},a.createElement(st,{className:"stigg-plan-header",variant:"h3"},c.displayName),m&&a.createElement(dt,{className:"stigg-plan-description",variant:"h6",color:"secondary"},c.description),a.createElement(lt,{showStartingAt:P,withUnitPriceRow:n,withStartingAtRow:x,withTiersRow:r,selectedTierByFeature:T,setSelectedTierByFeature:B,plan:c,billingPeriod:s,paywallLocale:v,locale:b,hasAnnuallyPrice:g,hasMonthlyPrice:p}),a.createElement(Ye,{isNextPlan:E,customer:l,plan:c,currentSubscription:d,billingPeriod:s,isCustomerOnTrial:f,onPlanSelected:function(e){var t=Object.keys(T).map((function(e){return{featureId:e,quantity:T[e].upTo}}));return y(e,t)},paywallLocale:v,hasTiersRow:r,withTrialLeftRow:o,selectedTierByFeature:T}),a.createElement(ut,{className:"stigg-plan-header-divider"})),a.createElement(Ue,{plan:c,billingPeriod:s,paywallLocale:v}))}var bt,xt=o("div",{target:"esqa6i42"})("height:40px;padding:0 20px;margin-bottom:",(function(e){return e.theme.stigg.layout.switchBottomSpacing}),";border-radius:10px;border:",(function(e){return"1px solid "+e.theme.stigg.palette.outlinedBorder}),";background-color:",(function(e){return e.theme.stigg.palette.backgroundPaper}),";display:flex;align-items:center;justify-content:center;"),Et=o(ke,{target:"esqa6i41"})({name:"zvmrfm",styles:"margin:0 8px"}),wt=o(E,{target:"esqa6i40"})("& .react-switch-bg{border:",(function(e){return"1px solid "+e.theme.stigg.palette.switchBorder}),";background:",(function(e){return e.theme.stigg.palette.switchFill}),"!important;}& .react-switch-handle{box-shadow:",(function(e){return e.theme.stigg.shadows.light}),";background:",(function(e){return e.theme.stigg.palette.switchHandle}),"!important;top:0.5px!important;}");function kt(e){return a.createElement(ke,{variant:"h6",color:e.disabled?"disabled":"primary",className:"stigg-discount-rate-text"},e.discount,"% off")}function Pt(e){var t=e.discountRate,r=e.onBillingPeriodChanged;if(e.availableBillingPeriods.length<=1)return null;var i=e.selectedBillingPeriod===n.BillingPeriod.Monthly;return a.createElement(xt,{className:"stigg-period-picker-container"},a.createElement(Et,{variant:"h6",className:"stigg-monthly-period-text",color:i?"primary":"disabled"},"Monthly"),a.createElement(wt,{className:"stigg-period-switch",uncheckedIcon:!1,checkedIcon:!1,height:16,width:33,onChange:function(e){return r(e?n.BillingPeriod.Annually:n.BillingPeriod.Monthly)},checked:!i,borderRadius:10,handleDiameter:19}),a.createElement(Et,{variant:"h6",className:"stigg-annual-period-text",color:i?"disabled":"primary"},"Annual"),0!==t&&a.createElement(kt,{discount:t,disabled:i}))}function Ct(e,t){var n,r,i,a;if((a=null==(n=e.paywallCalculatedPricePoints)?void 0:n.find((function(e){return e.billingPeriod===t})))||(a=e.pricePoints.find((function(e){return e.billingPeriod===t}))),null==(r=a)||!r.amount){var o=e.pricePoints.find((function(e){return e.isTieredPrice&&e.billingPeriod===t}));if(o)return o.tiers[0].unitPrice.amount}return null==(i=a)?void 0:i.amount}function St(){return(St=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var Tt=o((function(e){return i.createElement("svg",St({width:135,height:16,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),bt||(bt=i.createElement("path",{d:"M.099 3.43v9.558h1.057V9.527h2.81c1.983 0 3.323-1.275 3.323-3.049 0-1.773-1.34-3.048-3.324-3.048H.1Zm1.057 5.127v-4.15h2.889c1.289 0 2.143.855 2.143 2.071 0 1.217-.854 2.079-2.143 2.079h-2.89ZM11.779 13.162c2.129 0 3.873-1.622 3.873-3.78 0-2.165-1.715-3.758-3.844-3.758-2.158 0-3.874 1.622-3.874 3.787 0 2.158 1.687 3.75 3.845 3.75Zm.014-.934c-1.556 0-2.773-1.202-2.773-2.832 0-1.629 1.216-2.83 2.773-2.83 1.528 0 2.773 1.201 2.773 2.83 0 1.63-1.245 2.832-2.773 2.832ZM19.905 12.988l1.572-6.046h.029l1.556 6.046h1.34l2.194-7.183h-1.18l-1.622 6.104h-.03l-1.549-6.104h-1.433l-1.55 6.104h-.029l-1.65-6.104h-1.195l2.208 7.183h1.34ZM34.983 9.425c0-2.121-1.578-3.8-3.83-3.8-2.1 0-3.845 1.556-3.845 3.786 0 2.143 1.6 3.75 3.874 3.75 1.586 0 2.875-.767 3.497-1.969l-.897-.485c-.413.898-1.412 1.528-2.585 1.528-1.673 0-2.694-1.246-2.795-2.513h6.567c.014-.13.014-.18.014-.297ZM31.14 6.551c1.404 0 2.527.948 2.715 2.259h-5.423a2.745 2.745 0 0 1 2.708-2.26ZM39.592 5.682c-1.028 0-1.774.521-2.1 1.253l-.101-1.13h-.905v7.183h1.057V8.564c0-1.115.615-1.789 1.774-1.789h.68V5.682h-.405ZM48.249 9.425c0-2.121-1.579-3.8-3.83-3.8-2.1 0-3.845 1.556-3.845 3.786 0 2.143 1.6 3.75 3.873 3.75 1.586 0 2.875-.767 3.497-1.969l-.897-.485c-.413.898-1.412 1.528-2.585 1.528-1.673 0-2.694-1.246-2.795-2.513h6.567c.015-.13.015-.18.015-.297Zm-3.845-2.874c1.404 0 2.527.948 2.715 2.259h-5.423a2.745 2.745 0 0 1 2.708-2.26ZM55.846 7.029c-.63-.89-1.644-1.398-2.831-1.398-2.093 0-3.773 1.586-3.773 3.765 0 2.18 1.651 3.766 3.744 3.766 1.195 0 2.23-.522 2.867-1.42l.145 1.246h.905V2.56l-1.057.116V7.03Zm-2.817 5.199c-1.498 0-2.7-1.188-2.7-2.832 0-1.643 1.202-2.83 2.7-2.83a2.787 2.787 0 0 1 2.817 2.83 2.787 2.787 0 0 1-2.817 2.832ZM65.731 5.631c-1.194 0-2.222.514-2.86 1.412V2.561l-1.057.116v10.31h.905l.145-1.237c.63.898 1.644 1.412 2.838 1.412 2.093 0 3.773-1.586 3.773-3.766 0-2.179-1.651-3.765-3.744-3.765Zm-.043 6.597a2.787 2.787 0 0 1-2.817-2.832 2.787 2.787 0 0 1 2.817-2.83c1.499 0 2.7 1.187 2.7 2.83 0 1.644-1.201 2.832-2.7 2.832ZM76.219 5.805v4.113c0 1.412-.905 2.266-2.172 2.266-1.26 0-1.97-.738-1.97-2.07V5.804H71.02v4.468c0 1.694 1.115 2.824 2.744 2.824 1.079 0 1.926-.42 2.455-1.116v.913c0 1.267-.956 2.186-2.346 2.186-1.123 0-2.05-.6-2.288-1.65l-.927.477C71.1 15.16 72.308 16 73.858 16c1.955 0 3.418-1.405 3.418-3.208V5.805h-1.057ZM108.672 10.487c0 1.42-1.261 2.3-3.181 2.3-1.027 0-1.857-.184-2.651-.578.074-.449.142-.99.16-1.618.738.43 1.575.64 2.381.64.959 0 1.458-.221 1.458-.689.018-.461-.339-.67-1.772-.947-1.661-.332-2.399-1.021-2.399-2.24 0-1.377 1.261-2.27 3.18-2.27.849 0 1.692.16 2.338.437l-.32 1.544a4.803 4.803 0 0 0-2.018-.43c-.898 0-1.341.221-1.341.658 0 .381.308.541 1.71.83 1.79.382 2.461 1.07 2.461 2.35l-.006.013Zm4.207.609c-.719 0-1.298-.382-1.298-1.39V6.887h1.827l.339-1.63h-2.166v-2.32a9.976 9.976 0 0 1-1.9.345l-.019 6.748c0 1.84 1.101 2.769 2.75 2.769.375 0 .701-.037.978-.105l.363-1.729c-.228.08-.517.136-.874.136v-.006Zm2.086 1.593h1.919V5.258h-1.919v7.43Zm.965-10.47c-.621-.006-1.101.45-1.107 1.052 0 .621.455 1.089 1.071 1.095.621 0 1.082-.437 1.095-1.04.012-.62-.443-1.095-1.052-1.107h-.007Zm10.126 3.039v6.268c0 2.369-1.6 3.999-4.3 3.999-.972 0-2.042-.216-2.762-.628.498-.51.837-.953 1.052-1.273.486.166.996.252 1.519.252 1.71 0 2.578-.947 2.578-2.14v-.24c-.609.7-1.489 1.138-2.541 1.138-2.018 0-3.537-1.501-3.537-3.728 0-2.227 1.661-3.808 3.691-3.808 1.052 0 1.968.381 2.577 1.101l.062-.947h1.667l-.006.006Zm-1.901 3.648c0-1.181-.861-2.08-2.048-2.08-1.188 0-2.061.899-2.061 2.08 0 1.18.861 2.048 2.061 2.048 1.199 0 2.048-.898 2.048-2.048Zm10.839-3.648v6.268c0 2.369-1.6 3.999-4.3 3.999-.972 0-2.042-.216-2.762-.628.498-.51.837-.953 1.052-1.273.486.166.996.252 1.519.252 1.71 0 2.578-.947 2.578-2.14v-.24c-.609.7-1.489 1.138-2.541 1.138-2.017 0-3.537-1.501-3.537-3.728 0-2.227 1.661-3.808 3.691-3.808 1.052 0 1.968.381 2.577 1.101l.062-.947H135l-.006.006Zm-1.901 3.648c0-1.181-.861-2.08-2.048-2.08-1.188 0-2.061.899-2.061 2.08 0 1.18.861 2.048 2.061 2.048 1.199 0 2.048-.898 2.048-2.048ZM95.71 14.982c-.075.037-1.483.659-3.975.542A14.827 14.827 0 0 1 88.512 15l4.312-5.007c.77.197 1.76.381 2.885.436 2.492.123 3.9-.504 3.974-.541l-3.974 5.1v-.007Zm-6.441-9.62c-.708-2.393-.431-3.907-.413-3.987l-4.01 5.07c-.013.08-.29 1.592.412 3.985a14.98 14.98 0 0 0 1.273 3.008l3.845-5.37a15.042 15.042 0 0 1-1.107-2.7v-.006Zm9.996.529a14.561 14.561 0 0 0-1.815-3.882l-3.568 4.546.67 3.217c.4.056.794.092 1.194.117.203.006.406.012.603.012 1.931 0 3.008-.455 3.125-.51l.277-.123c.024-.665-.019-1.84-.48-3.384l-.006.007Zm-2.24-4.208A14.43 14.43 0 0 0 92.83.834c-1.605-.08-2.756.154-3.395.338l-.056.296c-.012.061-.258 1.494.4 3.74.11.381.246.756.394 1.132l3.285-.111 3.574-4.54-.006-.006Z",fill:"#001E6C"})))}),{target:"ee5i8qp1"})("*{fill:",(function(e){return e.theme.stigg.palette.text.secondary}),";}"),Bt=o("div",{target:"ee5i8qp0"})("align-self:",(function(e){return e.$alignSelf||"unset"}),";@media (max-width: 1040px){align-self:center;}");function Mt(e){var t=e.source,n=e.style;return e.showWatermark?a.createElement(Bt,{$alignSelf:e.align,className:"stigg-watermark",style:ue({cursor:"pointer"},void 0===n?{}:n),onClick:function(){var e=window.location.hostname.replace("www.","");window.open("https://www.stigg.io/?utm_source="+e+"&utm_medium=referral&utm_campaign="+t,"_blank")}},a.createElement(Tt,null)):null}function At(e,t){return e.some((function(e){return Ut(e,t)}))}function Ut(e,t){return e.pricePoints.some((function(e){return e.billingPeriod===t}))}var Lt,Ft=o("div",{target:"e19kubi82"})("color:",(function(e){return e.theme.stigg.palette.text.primary}),";display:flex;align-items:stretch;justify-content:center;flex-wrap:wrap;padding:10px 0;gap:",(function(e){return e.theme.stigg.layout.planMargin}),";"),Nt=o("div",{target:"e19kubi81"})({name:"1rdsyw8",styles:"display:flex;flex-direction:column;align-items:center;& *{box-sizing:border-box;}"}),It=o("div",{target:"e19kubi80"})({name:"zigog8",styles:"display:flex;flex-direction:column;align-items:center"}),Dt=function(e){var t=e.plans,r=e.customer,o=e.currentSubscription,l=e.highlightedPlanId,c=e.selectedBillingPeriod,s=e.onBillingPeriodChanged,u=e.availableBillingPeriods,d=e.isCustomerOnTrial,m=e.onPlanSelected,p=e.paywallLocale,h=e.locale,f=Rt().stigg,y=function(e){return e.reduce((function(e,t){var r,i,a=Ct(t,n.BillingPeriod.Monthly),o=(i=Ct(t,n.BillingPeriod.Annually),g(r=a)||g(i)?null:Math.round((r-i/12)/r*100));return o&&(e=Math.max(e,o)),e}),0)}(t),v=t.some((function(e){return!!e.description})),b=At(t,n.BillingPeriod.Monthly),x=At(t,n.BillingPeriod.Annually),E=function(e,t){return e.filter((function(e){return e.pricingType!==n.PricingType.Paid||Ut(e,t)}))}(t,c),w=i.useCallback((function(e,t,n){return m({plan:e,customer:r,subscription:o,intentionType:t,selectedBillingPeriod:c,billableFeatures:n})}),[r,c]),k=E.some((function(e){var t,n=e.pricePoints.filter((function(e){return e.billingPeriod===c})),r=null==(t=e.paywallCalculatedPricePoints)?void 0:t.find((function(e){return e.billingPeriod===c}));return n.length>1&&!(null==r||!r.additionalChargesMayApply)})),P=E.some((function(e){return!!Je(e,c,p,h,b).unit})),C=E.some((function(e){return!!Re(e,c,o,{})})),S=E.some((function(e){return e.isCurrentCustomerPlan&&e.trialDaysLeft}));return a.createElement(Nt,{className:"stigg-paywall-container"},a.createElement(It,{className:"stigg-paywall-layout"},a.createElement(Pt,{onBillingPeriodChanged:s,selectedBillingPeriod:c,availableBillingPeriods:u,discountRate:y}),a.createElement(Ft,{className:"stigg-paywall-plans-layout"},E.map((function(e){return a.createElement(vt,{withUnitPriceRow:P,withTiersRow:C,withTrialLeftRow:S,key:e.id,shouldShowDescriptionSection:v,hasMonthlyPrice:b,hasAnnuallyPrice:x,plan:e,withStartingAtRow:k,currentSubscription:o,billingPeriod:c,isHighlighted:e.id===l,isCustomerOnTrial:d,onPlanSelected:function(t,n){return w(e,t,n)},paywallLocale:p,locale:h,customer:r})}))),a.createElement(Mt,{source:"paywall",align:"end",style:{marginTop:16},showWatermark:f.isWidgetWatermarkEnabled})))},Ot=(function(e){var t=function(e){var t=Object.prototype,n=t.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},i=r.iterator||"@@iterator",a=r.asyncIterator||"@@asyncIterator",o=r.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,n){return e[t]=n}}function c(e,t,n,r){var i=Object.create((t&&t.prototype instanceof d?t:d).prototype),a=new k(r||[]);return i._invoke=function(e,t,n){var r="suspendedStart";return function(i,a){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw a;return{value:void 0,done:!0}}for(n.method=i,n.arg=a;;){var o=n.delegate;if(o){var l=x(o,n);if(l){if(l===u)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var c=s(e,t,n);if("normal"===c.type){if(r=n.done?"completed":"suspendedYield",c.arg===u)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r="completed",n.method="throw",n.arg=c.arg)}}}(e,n,a),i}function s(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var u={};function d(){}function m(){}function p(){}var g={};l(g,i,(function(){return this}));var h=Object.getPrototypeOf,f=h&&h(h(P([])));f&&f!==t&&n.call(f,i)&&(g=f);var y=p.prototype=d.prototype=Object.create(g);function v(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function b(e,t){var r;this._invoke=function(i,a){function o(){return new t((function(r,o){!function r(i,a,o,l){var c=s(e[i],e,a);if("throw"!==c.type){var u=c.arg,d=u.value;return d&&"object"==typeof d&&n.call(d,"__await")?t.resolve(d.__await).then((function(e){r("next",e,o,l)}),(function(e){r("throw",e,o,l)})):t.resolve(d).then((function(e){u.value=e,o(u)}),(function(e){return r("throw",e,o,l)}))}l(c.arg)}(i,a,r,o)}))}return r=r?r.then(o,o):o()}}function x(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,x(e,t),"throw"===t.method))return u;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return u}var r=s(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,u;var i=r.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,u):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,u)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function w(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function k(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function P(e){if(e){var t=e[i];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,a=function t(){for(;++r<e.length;)if(n.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:C}}function C(){return{value:void 0,done:!0}}return m.prototype=p,l(y,"constructor",p),l(p,"constructor",m),m.displayName=l(p,o,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===m||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,l(e,o,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},v(b.prototype),l(b.prototype,a,(function(){return this})),e.AsyncIterator=b,e.async=function(t,n,r,i,a){void 0===a&&(a=Promise);var o=new b(c(t,n,r,i),a);return e.isGeneratorFunction(n)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},v(y),l(y,o,"Generator"),l(y,i,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=P,k.prototype={constructor:k,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(w),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(n,r){return o.type="throw",o.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],o=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var l=n.call(a,"catchLoc"),c=n.call(a,"finallyLoc");if(l&&c){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(l){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return r(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=e,o.arg=t,a?(this.method="next",this.next=a.finallyLoc,u):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),u},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),w(n),u}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;w(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:P(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),u}},e}(e.exports);try{regeneratorRuntime=t}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}}(Lt={exports:{}}),Lt.exports),jt=new(function(){function e(){}var t=e.prototype;return t.error=function(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];console.error(e,t||{},r)},t.log=function(e,t){console.log(e,t||{})},t.debug=function(e,t){console.debug(e,t||{})},e}()),qt=a.createContext(null);qt.displayName="StiggContext";var Rt=function(){var e=i.useContext(qt);if(!e)throw new Error("Could not find Stigg context; You need to wrap your app in an <StiggProvider> component.");return e};function Wt(e,t,r){var i,a=e.flatMap((function(e){return e.pricePoints})).map((function(e){return e.billingPeriod})),o=s.countBy(a),l=s.uniq(a);if(r&&l.includes(r))i=r;else if(t){var c=t.find((function(e){return e.status==n.SubscriptionStatus.Active}));c&&c.prices.length>0&&(i=null==c?void 0:c.prices[0].billingPeriod)}return i||(i=(o[n.BillingPeriod.Monthly]||0)>(o[n.BillingPeriod.Annually]||0)?n.BillingPeriod.Monthly:n.BillingPeriod.Annually),{defaultBillingPeriod:i,availableBillingPeriods:l}}var zt={h1:{fontSize:24,fontWeight:n.FontWeight.Bold},h2:{fontSize:16,fontWeight:n.FontWeight.Normal},h3:{fontSize:16,fontWeight:n.FontWeight.Normal},body:{fontSize:14,fontWeight:n.FontWeight.Normal}};function _t(e,t){if(void 0===t&&(t="px"),e)return""+e+t}function Ht(e,t){if(!t)return e;switch(t){case n.FontWeight.Normal:return"normal";case n.FontWeight.Bold:return"bold";default:return"normal"}}function Vt(e,t){var n,r,i,a,o,l,c,s,u,d,m,p,g,h,f;return{fontFamilyUrl:(null==e?void 0:e.fontFamily)||void 0,h1:{fontSize:_t((null==e||null==(n=e.h1)?void 0:n.fontSize)||(null==t||null==(r=t.h1)?void 0:r.fontSize)),fontWeight:Ht("bold",(null==e||null==(i=e.h1)?void 0:i.fontWeight)||(null==t||null==(a=t.h1)?void 0:a.fontWeight))},h2:{fontSize:_t((null==e||null==(o=e.h2)?void 0:o.fontSize)||(null==t||null==(l=t.h2)?void 0:l.fontSize)),fontWeight:Ht("normal",null==t||null==(c=t.h2)?void 0:c.fontWeight)},h3:{fontSize:_t((null==e||null==(s=e.h3)?void 0:s.fontSize)||(null==t||null==(u=t.h3)?void 0:u.fontSize)),fontWeight:Ht("normal",(null==e||null==(d=e.h3)?void 0:d.fontWeight)||(null==t||null==(m=t.h3)?void 0:m.fontWeight))},body:{fontSize:_t((null==e||null==(p=e.body)?void 0:p.fontSize)||(null==t||null==(g=t.body)?void 0:g.fontSize)),fontWeight:Ht("normal",(null==e||null==(h=e.body)?void 0:h.fontWeight)||(null==t||null==(f=t.body)?void 0:f.fontWeight))}}}function $t(e){if(e)switch(e){case n.Alignment.Left:return"left";case n.Alignment.Center:return"center";case n.Alignment.Right:return"right";default:return}}var Zt,Gt=o("div",{target:"e1f7khji6"})({name:"zigog8",styles:"display:flex;flex-direction:column;align-items:center"}),Yt=o(fe,{target:"e1f7khji5"})({name:"o7nnmj",styles:"margin-right:16px"}),Qt=o("div",{target:"e1f7khji4"})("display:flex;flex-direction:column;align-items:flex-start;gap:20px;border-radius:10px;padding:",(function(e){return e.theme.stigg.layout.planPadding}),";background-color:",(function(e){return e.theme.stigg.palette.backgroundPaper}),";min-width:",(function(e){return e.theme.stigg.layout.planMinWidth}),";max-width:",(function(e){return e.theme.stigg.layout.planMaxWidth}),";min-height:450px;border:",(function(e){return"1px solid "+e.theme.stigg.palette.outlinedBorder}),";"),Kt=o("div",{target:"e1f7khji3"})("display:flex;gap:",(function(e){return e.theme.stigg.layout.planMargin}),";flex-wrap:wrap;justify-content:center;"),Xt=o("div",{target:"e1f7khji2"})({name:"k8xojc",styles:"display:flex;align-items:center;margin-bottom:12px"}),Jt=o("div",{target:"e1f7khji1"})({name:"xdvdnl",styles:"margin-top:auto"}),en=o("div",{target:"e1f7khji0"})("width:150px;margin-bottom:",(function(e){return e.theme.stigg.layout.switchBottomSpacing}),";padding:12px 12px;border-radius:10px;background-color:white;border:",(function(e){return"1px solid "+e.theme.stigg.palette.outlinedBorder}),";");function tn(){return a.createElement(Qt,null,a.createElement(k,{width:120,borderRadius:4}),a.createElement(k,{circle:!0,width:40,height:40}),a.createElement(k,{style:{marginBottom:33},width:120,borderRadius:4}),a.createElement(Xt,null,a.createElement(Yt,null),a.createElement(k,{width:120,borderRadius:4})),a.createElement(Xt,null,a.createElement(Yt,null),a.createElement(k,{width:120,borderRadius:4})),a.createElement(Xt,null,a.createElement(Yt,null),a.createElement(k,{width:120,borderRadius:4})),a.createElement(Jt,null,a.createElement(k,{height:50,borderRadius:4})))}function nn(){return a.createElement(Gt,{className:"stigg-skeleton-loader-container"},a.createElement(en,{className:"stigg-skeleton-loader-billing-period"},a.createElement(k,{borderRadius:4})),a.createElement(Kt,{className:"stigg-skeleton-loader-plans-container"},a.createElement(tn,null),a.createElement(tn,null),a.createElement(tn,null)))}var rn,an=function(e){var t=e.externalFontUrl;return a.createElement(c.Global,{styles:c.css(Zt||(Zt=me(["\n ","\n\n /* latin-ext */\n @font-face {\n font-family: 'DM Sans';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: url(https://fonts.gstatic.com/s/dmsans/v11/rP2Hp2ywxg089UriCZ2IHTWEBlwu8Q.woff2) format('woff2');\n unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F,\n U+A720-A7FF;\n }\n /* latin */\n @font-face {\n font-family: 'DM Sans';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: url(https://fonts.gstatic.com/s/dmsans/v11/rP2Hp2ywxg089UriCZOIHTWEBlw.woff2) format('woff2');\n unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074,\n U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;\n }\n /* latin-ext */\n @font-face {\n font-family: 'DM Sans';\n font-style: normal;\n font-weight: 500;\n font-display: swap;\n src: url(https://fonts.gstatic.com/s/dmsans/v11/rP2Cp2ywxg089UriAWCrCBamC3YU-CnE6Q.woff2) format('woff2');\n unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F,\n U+A720-A7FF;\n }\n /* latin */\n @font-face {\n font-family: 'DM Sans';\n font-style: normal;\n font-weight: 500;\n font-display: swap;\n src: url(https://fonts.gstatic.com/s/dmsans/v11/rP2Cp2ywxg089UriAWCrCBimC3YU-Ck.woff2) format('woff2');\n unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074,\n U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;\n }\n /* latin-ext */\n @font-face {\n font-family: 'DM Sans';\n font-style: normal;\n font-weight: 700;\n font-display: swap;\n src: url(https://fonts.gstatic.com/s/dmsans/v11/rP2Cp2ywxg089UriASitCBamC3YU-CnE6Q.woff2) format('woff2');\n unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F,\n U+A720-A7FF;\n }\n /* latin */\n @font-face {\n font-family: 'DM Sans';\n font-style: normal;\n font-weight: 700;\n font-display: swap;\n src: url(https://fonts.gstatic.com/s/dmsans/v11/rP2Cp2ywxg089UriASitCBimC3YU-Ck.woff2) format('woff2');\n unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074,\n U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;\n }\n "])),t&&"\n @font-face {\n font-family: 'custom-font';\n font-style: normal;\n font-weight: normal;\n src: local('custom-font'), url("+t+") format('woff');\n }\n ")})},on=o("div",{target:"emcdfp60"})((function(e){var t=e.customCss;return t&&c.css(rn||(rn=me(["\n ","\n "])),t)}),";");function ln(e){var t,n,r,i,a,o,l,c,u,p=Rt(),g=s.merge(e,p.theme);return a=d((null==(t=g)||null==(n=t.palette)?void 0:n.primary)||"#327EEE"),o=d((null==t||null==(r=t.palette)||null==(i=r.text)?void 0:i.primary)||"#001E6C"),l=d("#4CAF50"),c=d("#f44336"),u={palette:{primary:a.hex(),primaryDark:a.darken(.3).hex(),primaryLight:a.alpha(.5).toString(),backgroundPaper:"#FFFFFF",backgroundHighlight:"#F5F6F9",backgroundSection:a.alpha(.1).toString(),backgroundButton:a.alpha(.08).toString(),outlinedBorder:"#C4CBDD",outlinedRestingBorder:a.alpha(.5).toString(),outlinedHoverBackground:a.lightness(95).hex(),switchBorder:a.lighten(.1).hex(),switchFill:a.lighten(.5).hex(),switchHandle:a.hex(),warning:"#ed6c02",error:c.hex(),errorDark:c.darken(.3).hex(),success:l.hex(),successDark:l.darken(.3).hex(),white:"#FFFFFF",text:{primary:o.hex(),secondary:o.alpha(.75).toString(),disabled:o.alpha(.5).toString()}},layout:{planMinWidth:"330px",planMaxWidth:"330px",planMargin:"20px",planPadding:"40px",ctaAlignment:"left",headerAlignment:"left",descriptionAlignment:"left",descriptionMinHeight:"80px",switchBottomSpacing:"40px"},shadows:{light:"0px 2px 1px -1px rgba(0, 0, 0, 0.2), 0px 1px 1px rgba(0, 0, 0, 0.14), 0px 1px 3px rgba(0, 0, 0, 0.12)",popover:"0px 4px 5px -2px rgba(0, 30, 108, 0.2), 0px 7px 10px 1px rgba(0, 30, 108, 0.14), 0px 2px 16px 1px rgba(0, 30, 108, 0.12)"},border:{radius:"10px"},typography:{fontFamily:"custom-font, DM Sans, sans-serif",h1:{fontSize:"32px",fontWeight:"bold"},h2:{fontSize:"24px",fontWeight:"normal"},h3:{fontSize:"16px",fontWeight:"normal"},body:{fontSize:"14px",fontWeight:"normal"},caption:{fontSize:"12px",fontWeight:"normal"}},customCss:""},m(u,t)}function cn(e){var t=e.typography,n=Number(t.body.fontSize.replace("px",""))/14;return{pxToRem:function(e){return e/16*n+"rem"},bodyFontFamily:t.fontFamily,headingFontFamily:t.fontFamily,fontSizes:[t.h1.fontSize,t.h2.fontSize,t.h3.fontSize,t.body.fontSize,"12px","10px"]}}var sn=function(e){var t,n=e.children,r=ln(e.componentTheme),i=function(e){return{primary:{main:e.palette.primary}}}(r),o=T.createTheme({palette:i,stigg:r});return a.createElement(T.ThemeProvider,{theme:(t={},t[T.THEME_ID]=o,t)},a.createElement(c.ThemeProvider,{theme:{stigg:r}},a.createElement(on,{customCss:r.customCss},a.createElement(an,{externalFontUrl:r.typography.fontFamilyUrl}),a.createElement(C.ThemeProvider,{theme:{typography:cn(r)}},n))))},un=a.createContext(null);un.displayName="CustomerPortalContext";var dn=function(){var e=i.useContext(un);if(!e)throw new Error("Could not find Customer portal context; You need to wrap your customer portal components in an <CustomerPortalProvider> component.");return e};function mn(e){var t,n,r,o,l,c,s,u=e.children,d=e.textOverrides,p=e.theme,g=e.resourceId,h=e.productId,f=Rt().customerPortalUpdatedAt,y=function(e){var t=e.resourceId,n=e.productId,r=Rt(),a=r.stigg,o=r.customerPortalUpdatedAt,l=i.useState(!1),c=l[0],s=l[1],u=i.useState(),d=u[0],m=u[1];return i.useEffect((function(){!function(){var e=se(Ot.mark((function e(){return Ot.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!a.isCustomerLoaded){e.next=15;break}return e.prev=1,s(!0),e.next=5,a.getCustomerPortal({resourceId:t,productId:n});case 5:m(e.sent),e.next=12;break;case 9:e.prev=9,e.t0=e.catch(1),jt.error("Failed to load customer portal "+(null==e.t0?void 0:e.t0.message),e.t0);case 12:return e.prev=12,s(!1),e.finish(12);case 15:case"end":return e.stop()}}),e,null,[[1,9,12,15]])})));return function(){return e.apply(this,arguments)}}()()}),[a,a.isCustomerLoaded,o,t]),{customerPortal:d,isLoading:c}}({resourceId:g,productId:h}),v=y.customerPortal,b=y.isLoading,x=null!=v&&v.configuration?function(e){var t=e.palette;return{palette:{primary:(null==t?void 0:t.primary)||void 0,backgroundPaper:(null==t?void 0:t.paywallBackgroundColor)||void 0,outlinedBorder:(null==t?void 0:t.borderColor)||void 0,backgroundHighlight:(null==t?void 0:t.currentPlanBackground)||void 0,text:{primary:(null==t?void 0:t.textColor)||void 0}},typography:Vt(e.typography)}}(v.configuration):void 0,E=(t=ln(x),r=null==v?void 0:v.configuration,{sectionTitleColor:(null==(n=p)?void 0:n.sectionTitleColor)||t.palette.text.secondary,planNameColor:(null==n?void 0:n.planNameColor)||t.palette.text.primary,backgroundColor:(null==n?void 0:n.backgroundColor)||(null==r||null==(o=r.palette)?void 0:o.backgroundColor)||"white",borderColor:(null==n?void 0:n.borderColor)||(null==r||null==(l=r.palette)?void 0:l.borderColor)||"rgba(0, 30, 108, 0.15)",listItemBackgroundColor:(null==n?void 0:n.backgroundColor)||(null==r||null==(c=r.palette)?void 0:c.backgroundColor)||"white",tabMaxHeight:(null==n?void 0:n.tabMaxHeight)||"380px",iconsColor:(null==n?void 0:n.iconsColor)||(null==r||null==(s=r.palette)?void 0:s.iconsColor)||void 0,iconsBackgroundColor:null==n?void 0:n.iconsBackgroundColor}),w=m({manageSubscription:"Manage",usageTabTitle:"Usage",addonsTabTitle:"Add-ons",promotionsTabTitle:"Promotions",promotionsSubtitle:"You were granted access to additional functionality at no additional cost.",contactSupportTitle:"Have questions about your subscription?",contactSupportLink:"Contact support",editBilling:"Edit billing details",invoicesTitle:"Invoices",viewInvoiceHistory:"View invoice history",editPaymentDetails:"Edit",paywallSectionTitle:"Plans",cancelScheduledUpdatesButtonTitle:"Cancel"},d);return a.createElement(sn,{componentTheme:x},a.createElement(un.Provider,{key:null==f?void 0:f.toString(),value:{customerPortal:v,isLoading:b,textOverrides:w,theme:E,resourceId:g}},u))}var pn,gn=o(M,{target:"emvioms0"})("border-radius:10px;padding:8px 16px;text-transform:none;&,&:hover{border-color:",(function(e){return e.theme.stigg.palette.outlinedRestingBorder}),";}");function hn(){return(hn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var fn=function(e){return i.createElement("svg",hn({width:20,height:20,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),pn||(pn=i.createElement("path",{clipRule:"evenodd",d:"M13.333 2.5 17.5 6.667 6.667 17.5H2.5v-4.167L13.333 2.5v0Z",stroke:"#327EEE",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})))},yn=o("div",{target:"ewz8krb0"})("display:flex;align-items:center;justify-content:space-between;",(function(e){return!e.$disableMargin&&"\n &:not(:last-child) {\n margin-bottom: 32px;\n }\n "}),";");function vn(e){var t=e.title,n=e.className,r=e.isLoading,i=dn().theme;return r?a.createElement(k,{width:120}):a.createElement(ke,{className:n,overrideColor:i.sectionTitleColor,variant:"h3",bold:!0},t)}var bn=o(fn,{target:"e1fjw26b0"})("path{stroke:",(function(e){return e.theme.stigg.palette.primary}),";}");function xn(e){var t=e.onManageSubscription,n=e.hideManageButton,r=e.textOverrides;return a.createElement(yn,{className:"stigg-customer-portal-overview-header",$disableMargin:!0},a.createElement(vn,{title:"Subscription",className:"stigg-overview-title"}),!n&&a.createElement(gn,{className:"stigg-manage-subscription-button",variant:"outlined",onClick:t},a.createElement(bn,{className:"stigg-manage-subscription-button-image"}),a.createElement(ke,{className:"stigg-manage-subscription-button-text",color:"primary.main",style:{marginLeft:"8px"},variant:"body1"},null==r?void 0:r.manageSubscription)))}function En(){var e=dn().customerPortal,t=A(null==e?void 0:e.subscriptions,(function(e){return e.addons}));return F(t)?null:a.createElement("div",{className:"stigg-addons-list-layout"},t.map((function(e,n){return a.createElement(ke,{key:e.addonId,span:!0,className:"stigg-addon-list-item-text",variant:"body1"},e.quantity>1&&e.quantity+" X ",e.displayName,n===t.length-1?"":", ")})))}var wn=o("div",{target:"e1g6q2f50"})("display:flex;justify-content:space-between;align-items:center;gap:64px;border-bottom:",(function(e){return"1px solid "+e.$borderColor}),";padding:16px 0;&>*:first-child{max-width:60%;}");function kn(){var e=dn(),t=e.customerPortal,n=e.theme,r=null==t?void 0:t.promotionalEntitlements;return a.createElement("div",{style:{display:"flex",flexDirection:"column"}},a.createElement(ke,{color:"secondary"},e.textOverrides.promotionsSubtitle),a.createElement("div",{style:{display:"flex",flexDirection:"column"}},a.createElement(wn,{$borderColor:n.borderColor},a.createElement(ke,{variant:"body1",bold:!0},"Feature"),a.createElement(ke,{variant:"body1",bold:!0},"Expiration date")),null==r?void 0:r.map((function(e){return a.createElement(wn,{$borderColor:n.borderColor},a.createElement(ke,{variant:"body1"},function(e){var t,n=e.displayName;return e.hasUnlimitedUsage?"Unlimited "+n:e.usageLimit?n+" x "+(null==(t=e.usageLimit)?void 0:t.toLocaleString()):n}(e)),a.createElement(ke,{variant:"body1",color:"disabled"},e.endDate?p.utc(e.endDate).format("MMM Do, YYYY"):"None"))}))))}var Pn,Cn,Sn,Tn,Bn,Mn,An,Un,Ln,Fn,Nn,In,Dn,On,jn,qn,Rn=o(N,{target:"exlfw3j3"})({name:"jlwfj4",styles:".MuiTabs-indicator{background-color:#001e6c;}"}),Wn=o("div",{target:"exlfw3j2"})({name:"1dqkbz0",styles:"width:100%;flex:1;margin-top:16px"}),zn=o(U,{target:"exlfw3j1"})("margin-top:16px;max-height:",(function(e){return e.$maxHeight}),";overflow-y:auto;"),_n=function(e,t){switch(e){case"primary":return t.stigg.palette.text.primary;case"secondary":return t.stigg.palette.text.secondary;default:return e}};function Hn(){return(Hn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Vn(){return(Vn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function $n(){return($n=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Zn(){return(Zn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Gn(){return(Gn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Yn(){return(Yn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Qn(){return(Qn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var Kn,Xn,Jn,er,tr,nr,rr,ir,ar,or,lr,cr,sr,ur,dr,mr,pr,gr,hr,fr,yr,vr,br,xr,Er=function(e){return i.createElement("svg",Qn({width:20,height:20,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),qn||(qn=i.createElement("path",{d:"M10.833 2.5a7.5 7.5 0 0 0-7.5 7.5h-2.5l3.242 3.242.058.116L7.5 10H5a5.829 5.829 0 0 1 5.833-5.833A5.83 5.83 0 0 1 16.667 10a5.83 5.83 0 0 1-5.834 5.833 5.786 5.786 0 0 1-4.116-1.716L5.533 15.3a7.462 7.462 0 0 0 5.3 2.2 7.5 7.5 0 0 0 0-15ZM10 6.667v4.166l3.567 2.117.6-1.008-2.917-1.734V6.667H10Z",fill:"#6678A7"})))};function wr(){return(wr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function kr(){return(kr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Pr(){return(Pr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Cr(){return(Cr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Sr(){return(Sr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Tr(){return(Tr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Br(){return(Br=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Mr(){return(Mr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Ar(){return(Ar=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Ur(){return(Ur=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Lr(){return(Lr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Fr(){return(Fr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Nr(){return(Nr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var Ir,Dr,Or,jr={__proto__:null,Addons:function(e){return i.createElement("svg",Hn({width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),Pn||(Pn=i.createElement("g",{clipPath:"url(#addons_svg__a)",stroke:"#7586B0",strokeWidth:1.714,strokeLinecap:"round",strokeLinejoin:"round"},i.createElement("path",{d:"M12 6.857v10.286M6.857 12h10.286M18 .857H6A5.143 5.143 0 0 0 .857 6v12A5.143 5.143 0 0 0 6 23.143h12A5.143 5.143 0 0 0 23.143 18V6A5.143 5.143 0 0 0 18 .857Z"}))),Cn||(Cn=i.createElement("defs",null,i.createElement("clipPath",{id:"addons_svg__a"},i.createElement("path",{fill:"#fff",d:"M0 0h24v24H0z"})))))},BillingInfoCustomer:function(e){return i.createElement("svg",Vn({width:36,height:36,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),Sn||(Sn=i.createElement("rect",{width:36,height:36,rx:10,fill:"#F5F6F9"})),Tn||(Tn=i.createElement("path",{d:"M26 27v-2a4 4 0 0 0-4-4h-8a4 4 0 0 0-4 4v2",stroke:"#7586B0",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),Bn||(Bn=i.createElement("path",{clipRule:"evenodd",d:"M18 17a4 4 0 1 0 0-8 4 4 0 0 0 0 8Z",stroke:"#7586B0",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})))},ContactSupport:function(e){return i.createElement("svg",$n({width:36,height:36,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),Mn||(Mn=i.createElement("rect",{width:36,height:36,rx:10,fill:"#F5F6F9"})),An||(An=i.createElement("path",{d:"M27 18.22C27 12.73 22.74 9 18 9c-4.69 0-9 3.65-9 9.28-.6.34-1 .98-1 1.72v2c0 1.1.9 2 2 2h1v-6.1c0-3.87 3.13-7 7-7s7 3.13 7 7V25h-8v2h8c1.1 0 2-.9 2-2v-1.22c.59-.31 1-.92 1-1.64v-2.3c0-.7-.41-1.31-1-1.62Z",fill:"#7586B0"})),Un||(Un=i.createElement("path",{d:"M15 20a1 1 0 1 0 0-2 1 1 0 0 0 0 2ZM21 20a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z",fill:"#7586B0"})),Ln||(Ln=i.createElement("path",{d:"M24 17.03A6.04 6.04 0 0 0 18.05 12c-3.03 0-6.29 2.51-6.03 6.45a8.075 8.075 0 0 0 4.86-5.89c1.31 2.63 4 4.44 7.12 4.47Z",fill:"#7586B0"})))},CreditCard:function(e){return i.createElement("svg",Zn({width:36,height:36,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),Fn||(Fn=i.createElement("rect",{width:36,height:36,rx:10,fill:"#F5F6F9"})),Nn||(Nn=i.createElement("path",{d:"M26 10H10c-1.11 0-1.99.89-1.99 2L8 24c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V12c0-1.11-.89-2-2-2Zm0 14H10v-6h16v6Zm0-10H10v-2h16v2Z",fill:"#7586B0"})))},DollarCoin:function(e){return i.createElement("svg",Gn({width:21,height:20,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),In||(In=i.createElement("g",{clipPath:"url(#dollar-coin_svg__a)",stroke:"#7586B0",strokeWidth:1.714,strokeLinecap:"round",strokeLinejoin:"round"},i.createElement("path",{d:"M10.334 19.286A9.286 9.286 0 1 0 1.048 10a9.286 9.286 0 0 0 9.286 9.286Z"}),i.createElement("path",{d:"M12.765 7.46a1.903 1.903 0 0 0-1.796-1.27H9.494a1.7 1.7 0 0 0-.363 3.362l2.245.49a1.905 1.905 0 0 1-.407 3.768h-1.27c-.83 0-1.535-.53-1.797-1.27M10.334 6.19V4.287M10.334 15.714V13.81"}))),Dn||(Dn=i.createElement("defs",null,i.createElement("clipPath",{id:"dollar-coin_svg__a"},i.createElement("path",{fill:"#fff",transform:"translate(.333)",d:"M0 0h20v20H0z"})))))},MiniSchedule:Ke,Promotions:function(e){return i.createElement("svg",Yn({width:24,height:25,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),On||(On=i.createElement("g",{clipPath:"url(#promotions_svg__a)",stroke:"#7586B0",strokeWidth:1.714,strokeLinecap:"round",strokeLinejoin:"round"},i.createElement("path",{d:"M21.429 5.325H2.57c-.946 0-1.714.767-1.714 1.714v3.429c0 .947.768 1.714 1.714 1.714H21.43c.946 0 1.714-.768 1.714-1.714V7.039c0-.947-.768-1.714-1.714-1.714ZM21.429 12.182v9.429a1.714 1.714 0 0 1-1.715 1.714H4.286a1.714 1.714 0 0 1-1.714-1.714v-9.429M12 5.325v18M17.143 1.04 12 5.324 6.857 1.039"}))),jn||(jn=i.createElement("defs",null,i.createElement("clipPath",{id:"promotions_svg__a"},i.createElement("path",{fill:"#fff",transform:"translate(0 .182)",d:"M0 0h24v24H0z"})))))},Restore:Er,ScheduleBox:function(e){return i.createElement("svg",wr({width:36,height:36,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),Kn||(Kn=i.createElement("rect",{width:36,height:36,rx:10,fill:"url(#schedule-box_svg__a)"})),Xn||(Xn=i.createElement("rect",{width:36,height:36,rx:10,fill:"#F5F6F9"})),Jn||(Jn=i.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.954 7.7a1 1 0 0 1-.654 1.254 8.998 8.998 0 0 0-1.543 16.523A9 9 0 0 0 27 17.54a1 1 0 1 1 2 0c0 .357-.017.713-.052 1.066.018.089.024.182.017.278l-.004.047a.997.997 0 0 1-.101.361A11 11 0 1 1 14.7 7.046a1 1 0 0 1 1.254.654Zm1.896.252a1 1 0 0 1 1.08-.912l.048.004a1 1 0 1 1-.178 1.992l-.038-.003a1 1 0 0 1-.912-1.081ZM22.858 9.2a1 1 0 0 1 1.391-.254l.078.054a1 1 0 1 1-1.152 1.635 8.98 8.98 0 0 0-.063-.044 1 1 0 0 1-.254-1.391Zm3.748 3.609a1 1 0 0 1 1.332.473l.04.085a1 1 0 1 1-1.813.844l-.014-.031-.019-.039a1 1 0 0 1 .474-1.332ZM19 14a1 1 0 1 0-2 0v4a1 1 0 0 0 1 1h4a1 1 0 1 0 0-2h-3v-3Z",fill:"#7586B0"})),er||(er=i.createElement("defs",null,i.createElement("linearGradient",{id:"schedule-box_svg__a",x1:35.02,y1:1.224,x2:0,y2:36,gradientUnits:"userSpaceOnUse"}))))},ScheduleClock:function(e){return i.createElement("svg",kr({width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),tr||(tr=i.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.954 1.7A1 1 0 0 1 9.3 2.954a8.998 8.998 0 0 0-5.615 12.03A9 9 0 0 0 21 11.54a1 1 0 1 1 2 0c0 .357-.017.713-.052 1.066.018.089.024.182.017.278l-.004.047a.997.997 0 0 1-.101.361A11 11 0 1 1 8.7 1.046a1 1 0 0 1 1.254.654Zm1.896.252a1 1 0 0 1 1.08-.912l.048.004a1 1 0 1 1-.178 1.992l-.039-.003a1 1 0 0 1-.911-1.081ZM16.858 3.2a1 1 0 0 1 1.391-.254l.078.054a1 1 0 1 1-1.152 1.635 9.7 9.7 0 0 0-.063-.044 1 1 0 0 1-.254-1.391Zm3.748 3.608a1 1 0 0 1 1.332.474l.04.085a1 1 0 1 1-1.813.844l-.014-.031-.019-.039a1 1 0 0 1 .474-1.333ZM13 8a1 1 0 1 0-2 0v4a1 1 0 0 0 1 1h4a1 1 0 1 0 0-2h-3V8Z",fill:"#7586B0"})))},RenewSubscription:function(e){return i.createElement("svg",Pr({width:36,height:36,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),nr||(nr=i.createElement("rect",{width:36,height:36,rx:10,fill:"#F5F6F9"})),rr||(rr=i.createElement("path",{clipRule:"evenodd",d:"M9 12a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H11a2 2 0 0 1-2-2V12Z",stroke:"#7586B0",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),ir||(ir=i.createElement("path",{d:"M22 8v4M14 8v4M9 16h18",stroke:"#7586B0",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})))},Trash:function(e){return i.createElement("svg",Cr({width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),ar||(ar=i.createElement("path",{d:"M3 6h18",stroke:"#F88078",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),or||(or=i.createElement("path",{d:"M20 6a1 1 0 1 0-2 0h2ZM6 6a1 1 0 0 0-2 0h2Zm1 0a1 1 0 0 0 2 0H7Zm8 0a1 1 0 1 0 2 0h-2Zm3 0v14h2V6h-2Zm0 14a1 1 0 0 1-1 1v2a3 3 0 0 0 3-3h-2Zm-1 1H7v2h10v-2ZM7 21a1 1 0 0 1-1-1H4a3 3 0 0 0 3 3v-2Zm-1-1V6H4v14h2ZM9 6V4H7v2h2Zm0-2a1 1 0 0 1 1-1V1a3 3 0 0 0-3 3h2Zm1-1h4V1h-4v2Zm4 0a1 1 0 0 1 1 1h2a3 3 0 0 0-3-3v2Zm1 1v2h2V4h-2Z",fill:"#F88078"})),lr||(lr=i.createElement("path",{d:"M10 11v6M14 11v6",stroke:"#F88078",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})))},PaymentMethod:function(e){return i.createElement("svg",Sr({width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),cr||(cr=i.createElement("path",{d:"M21.167 4H2.833C1.821 4 1 4.895 1 6v12c0 1.105.82 2 1.833 2h18.334C22.179 20 23 19.105 23 18V6c0-1.105-.82-2-1.833-2Z",fill:"#C6C6C7"})),sr||(sr=i.createElement("path",{opacity:.3,d:"M19.75 16.429H17.5c-.488 0-.75-.229-.75-.762 0-.534.262-.762.75-.762h2.25c.488 0 .75.228.75.762 0 .533-.262.762-.75.762Zm-4.5 0H13c-.488 0-.75-.229-.75-.762 0-.534.262-.762.75-.762h2.25c.488 0 .75.228.75.762 0 .533-.262.762-.75.762Zm-4.5 0H8.5c-.488 0-.75-.229-.75-.762 0-.534.262-.762.75-.762h2.25c.488 0 .75.228.75.762 0 .533-.262.762-.75.762Zm-4.5 0H4c-.487 0-.75-.229-.75-.762 0-.534.263-.762.75-.762h2.25c.487 0 .75.228.75.762 0 .533-.263.762-.75.762Z",fill:"#000"})))},OutlinedCircle:function(e){return i.createElement("svg",Tr({width:21,height:20,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),ur||(ur=i.createElement("circle",{cx:10.333,cy:10,r:9,fill:"#fff",stroke:"#327EEE",strokeWidth:2})))},OutlinedCheckedCircle:function(e){return i.createElement("svg",Br({width:20,height:20,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),dr||(dr=i.createElement("circle",{cx:10,cy:10,r:9.25,fill:"#327EEE",stroke:"#327EEE",strokeWidth:1.5})),mr||(mr=i.createElement("path",{d:"M5 10.364 8.637 14l4-4 2-2",stroke:"#fff",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})))},OutlinedCheckedCircleDisabled:function(e){return i.createElement("svg",Mr({width:21,height:20,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),pr||(pr=i.createElement("circle",{cx:10.667,cy:10,r:9.25,fill:"#B3BCD3",stroke:"#B3BCD3",strokeWidth:1.5})),gr||(gr=i.createElement("path",{d:"M5.667 10.364 9.304 14l4-4 2-2",stroke:"#fff",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})))},ArrowForward:function(e){return i.createElement("svg",Ar({width:18,height:18,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),hr||(hr=i.createElement("path",{d:"M9 3 7.942 4.058l4.185 4.192H3v1.5h9.127l-4.185 4.193L9 15l6-6-6-6Z",fill:"#fff"})))},Close:function(e){return i.createElement("svg",Ur({width:20,height:20,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),fr||(fr=i.createElement("path",{d:"m15.834 5.342-1.175-1.175L10 8.825 5.342 4.167 4.167 5.342 8.825 10 4.167 14.66l1.175 1.175L10 11.175l4.659 4.659 1.175-1.175L11.175 10l4.659-4.658Z",fill:"#327EEE"})))},Check:function(e){return i.createElement("svg",Lr({width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),yr||(yr=i.createElement("path",{d:"M20 7 9 18l-5-5",stroke:"#F5F6F9",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})))},PayAsYouGoCharge:function(e){return i.createElement("svg",Fr({width:16,height:16,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),vr||(vr=i.createElement("g",{clipPath:"url(#pay-as-you-go-charge_svg__a)",stroke:"#7586B0",strokeWidth:1.714,strokeLinecap:"round",strokeLinejoin:"round"},i.createElement("path",{d:"M11.429 7.426 8 13.14M14.857 13.141a7.428 7.428 0 1 0-13.714 0h13.714Z"}))),br||(br=i.createElement("defs",null,i.createElement("clipPath",{id:"pay-as-you-go-charge_svg__a"},i.createElement("path",{fill:"#fff",d:"M0 0h16v16H0z"})))))},Coupon:function(e){return i.createElement("svg",Nr({width:16,height:16,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),xr||(xr=i.createElement("g",{stroke:"#327EEE",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"},i.createElement("path",{d:"m1.27 11.943 4.787 4.787a.923.923 0 0 0 1.305 0l9.501-9.501A.443.443 0 0 0 17 6.872l-.727-4.714a.455.455 0 0 0-.43-.43l-4.714-.726a.443.443 0 0 0-.357.135L1.27 10.638a.923.923 0 0 0 0 1.305Z"}),i.createElement("path",{d:"M12.555 6.059a.615.615 0 1 1 0-1.23.615.615 0 0 1 0 1.23Z"}))))}},qr=o("div",{target:"e1ds7xyn0"})((function(e){var t=e.$pathColor;return t&&c.css(Ir||(Ir=me(["\n path {\n fill: ",";\n }\n "])),t)})," ",(function(e){var t=e.$rectColor;return t&&c.css(Dr||(Dr=me(["\n svg rect {\n fill: ",";\n }\n "])),t)})," ",(function(e){var t=e.$strokeColor;return t&&c.css(Or||(Or=me(["\n g {\n stroke: ",";\n }\n "])),t)}),";");function Rr(e){var t=e.className,n=e.style,r=e.svgPathColor,i=e.svgRectColor,o=e.svgStrokeColor,l=jr[e.icon],s=c.useTheme();return a.createElement(qr,{className:t,style:n,$pathColor:_n(r,s),$rectColor:_n(i,s),$strokeColor:_n(o,s)},a.createElement(l,null))}var Wr=["children","value","index","maxHeight"];function zr(e){var t=e.children,n=e.value,r=e.index,i=e.maxHeight,o=de(e,Wr);return a.createElement("div",Object.assign({role:"tabpanel",hidden:n!==r},o),n===r&&a.createElement(zn,{$maxHeight:i},t))}function _r(e){var t=e.isSelected,n=e.label,r=t?"primary":"secondary";return a.createElement("div",{style:{display:"flex",gap:8,alignItems:"center"}},a.createElement(Rr,{icon:e.icon,svgStrokeColor:r}),a.createElement(ke,{variant:"h6",bold:t,fontWeight:l.FontWeight.Medium,color:r},n))}function Hr(e){var t=e.customerPortal,n=e.hiddenSections,r=e.textOverrides,o=e.theme,l=function(e){return null==n?void 0:n.some((function(t){return t===e}))},c=A(t.subscriptions,(function(e){return e.addons})).length>0&&!l("addons"),s=t.promotionalEntitlements.length>0&&!l("promotionalEntitlements"),u=i.useState(c?1:2),d=u[0],m=u[1];return c||s?a.createElement(Wn,null,a.createElement(U,{sx:{borderBottom:1,borderColor:"divider"}},a.createElement(Rn,{value:d,onChange:function(e,t){m(t)}},c?a.createElement(L,{sx:{textTransform:"none"},value:1,label:a.createElement(_r,{isSelected:1===d,label:r.addonsTabTitle,icon:"Addons"})}):null,s?a.createElement(L,{sx:{textTransform:"none"},value:2,label:a.createElement(_r,{isSelected:2===d,label:r.promotionsTabTitle,icon:"Promotions"})}):null)),a.createElement(zr,{value:d,index:1,maxHeight:o.tabMaxHeight},a.createElement(En,null)),a.createElement(zr,{value:d,index:2,maxHeight:o.tabMaxHeight},a.createElement(kn,null))):null}var Vr=o("div",{target:"ejq3grd1"})({name:"1eoy87d",styles:"display:flex;justify-content:space-between"}),$r=o("div",{target:"ejq3grd0"})({name:"43cxha",styles:"display:flex;flex-direction:column;gap:32px"});function Zr(){return a.createElement(Vr,{className:"stigg-subscription-overview-skeleton-layout"},a.createElement($r,null,a.createElement(k,{width:120}),a.createElement(k,{width:120})),a.createElement(k,{width:295,height:193}))}function Gr(e){var t=e.scheduleUpdate.targetPackage;return a.createElement(f,{container:!0,alignItems:"center"},a.createElement(f,null,a.createElement(I.ArrowDown,{color:"#D94052",height:20,className:"stigg-scheduled-updates-arrow-down"})),a.createElement(f,{item:!0},a.createElement(ke,{className:"stigg-scheduled-updates-description",variant:"body1"},"Downgrade to the ",a.createElement("b",null,null==t?void 0:t.displayName)," plan")))}function Yr(e){var t=e.scheduleUpdate.scheduleVariables.billingPeriod,r=t===n.BillingPeriod.Monthly?"annually":"monthly",i=t===n.BillingPeriod.Monthly?"monthly":"annually";return a.createElement(f,{container:!0,alignItems:"center"},a.createElement(f,null,a.createElement(I.ArrowDown,{color:"#D94052",height:20,className:"stigg-scheduled-updates-arrow-down"})),a.createElement(f,{item:!0},a.createElement(ke,{className:"stigg-scheduled-updates-description",variant:"body1"},"Change from an ",r," to a ",a.createElement("b",null,i)," billing cycle")))}function Qr(e){var t=e.scheduleUpdate.scheduleVariables,n=t.newUnitAmount,r=t.featureId,i=s.compact(s.map(e.subscription.prices,"feature")).find((function(e){return e.id===r}));if(!i)return null;var o=i.featureUnits,l=1===n?o:i.featureUnitsPlural;return a.createElement(f,{container:!0,alignItems:"flex-start",flexWrap:"nowrap"},a.createElement(f,null,a.createElement(I.ArrowDown,{color:"#D94052",height:20,className:"stigg-scheduled-updates-arrow-down"})),a.createElement(f,{item:!0},a.createElement(ke,{className:"stigg-scheduled-updates-description",variant:"body1"},"Reduce the ",a.createElement("b",null,o)," quantity to ",n," ",l)))}function Kr(e){var t=e.scheduleUpdate,r=e.subscription;switch(t.subscriptionScheduleType){case n.SubscriptionScheduleType.Downgrade:return a.createElement(Gr,{scheduleUpdate:t});case n.SubscriptionScheduleType.BillingPeriod:return a.createElement(Yr,{scheduleUpdate:t});case n.SubscriptionScheduleType.UnitAmount:return a.createElement(Qr,{scheduleUpdate:t,subscription:r});default:return null}}var Xr=o(U,{target:"eju957a2"})("border-bottom:",(function(e){return"1px solid "+e.$borderColor}),";border-top-left-radius:10px;border-top-right-radius:10px;margin:-64px -64px 64px -64px;padding:24px 32px;"),Jr=o(u,{target:"eju957a1"})({name:"158icaa",styles:"margin-left:4px"}),ei=o(Er,{target:"eju957a0"})("color:",(function(e){return e.theme.stigg.palette.primary}),";path{fill:",(function(e){return e.theme.stigg.palette.primary}),";}");function ti(e){var t=e.subscription,n=t.scheduledUpdates;return a.createElement(a.Fragment,null,a.createElement(f,{container:!0,alignItems:"center",justifyContent:"space-between",gap:1},a.createElement(f,null,a.createElement(ke,{className:"stigg-scheduled-updates-description",variant:"body1"},"The following updates will take effect in the next billing cycle:"))),a.createElement(f,null,(n||[]).map((function(e){return a.createElement(Kr,{key:e.subscriptionScheduleType,scheduleUpdate:e,subscription:t})}))))}function ni(e){var t=e.subscription,n=De({scheduledUpdate:(t.scheduledUpdates||[])[0],subscriptionPrices:t.prices,billingPeriodRange:t.billingPeriodRange,options:{postfix:"at the end of the current billing period"}}),r=n.line2;return a.createElement(a.Fragment,null,a.createElement(f,{container:!0,alignItems:"center",justifyContent:"space-between",gap:1},a.createElement(f,null,a.createElement(ke,{className:"stigg-scheduled-updates-title",variant:"body1",color:"primary"},n.line1))),r&&a.createElement(f,null,a.createElement(ke,{className:"stigg-scheduled-updates-subtitle",variant:"body1",color:"secondary"},r)))}function ri(e){var t=e.subscription,n=e.onCancelScheduledUpdates,r=e.theme,o=e.cancelScheduledUpdatesButtonTitle,l=c.useTheme(),s=i.useState(!1),u=s[0],d=s[1],m=t.scheduledUpdates;if(!m||0===m.length)return null;var p=1===m.length;return a.createElement(Xr,{$borderColor:r.borderColor,className:"stigg-scheduled-updates-alert-container"},a.createElement(f,{container:!0,alignItems:p?"center":"flex-start",gap:2},a.createElement(f,{item:!0,display:"flex"},a.createElement(Rr,{icon:"ScheduleBox",svgPathColor:r.iconsColor,svgRectColor:r.iconsBackgroundColor})),a.createElement(f,{item:!0,flex:1},a.createElement(p?ni:ti,{subscription:t})),!!n&&a.createElement(f,{item:!0},a.createElement(gn,{variant:"outlined",onClick:function(){d(!0),Promise.resolve(n(t)).finally((function(){return d(!1)}))}},u?a.createElement(Jr,{loading:!0,size:16,color:l.stigg.palette.text.disabled}):a.createElement(ei,{style:{display:"flex",marginRight:4},className:"stigg-scheduled-updates-cancel-update-button-icon"}),a.createElement(ke,{variant:"body1",color:"primary.main",className:"stigg-scheduled-updates-cancel-update-button"},o)))))}var ii=o("div",{target:"e1kw2z1l0"})("width:100%;display:flex;flex-direction:column;border-radius:10px;background-color:",(function(e){return e.$backgroundColor}),";border:",(function(e){return"1px solid "+e.$borderColor}),";padding:64px;");function ai(e){var t=e.billingPeriod,r=e.rangeEnd,i=e.amount,o=e.currency;return a.createElement(a.Fragment,null,a.createElement(ke,{variant:"h6"},"Next estimated bill"),a.createElement(ke,{variant:"h1"},Xe({amount:i,currency:o,maximumFractionDigits:2})),a.createElement(ke,{variant:"body1",color:"secondary"},"Billed ",t===n.BillingPeriod.Monthly?"monthly":"annually"," on"," ",a.createElement(ke,{variant:"body1",span:!0,color:"primary"},p.utc(r).format("MMM Do, YYYY"))),a.createElement(ke,{variant:"body1",color:"secondary"},"* Additional tax rates may apply"))}function oi(e){var t=e.description;return a.createElement(a.Fragment,null,a.createElement(ke,{variant:"h6",color:"secondary"},"No upcoming bill"),a.createElement(ke,{variant:"body1",color:"secondary"},t))}var li=o("div",{target:"e1ftdtst1"})({name:"1nocm2b",styles:"display:flex;flex-direction:column;align-items:left;gap:8px"}),ci=o(M,{target:"e1ftdtst0"})({name:"1l28f5r",styles:"width:fit-content;&.MuiButton-root{padding:0;&:hover{background:none;}}"});function si(e){var t=e.onContactSupport,n=e.label,r=a.createElement(ke,{color:t?"primary.main":"secondary"},e.linkLabel);return a.createElement(li,{className:"stigg-contact-support-layout"},a.createElement(ke,{className:"stigg-contact-support-label",color:"secondary"},n),t?a.createElement(ci,{className:"stigg-contact-support-button",style:{textTransform:"none"},variant:"text",onClick:t},r):r)}var ui,di,mi=o("div",{target:"e1u4onrr0"})("max-height:278px;display:flex;flex-direction:column;border-radius:10px;background-color:",(function(e){return e.theme.stigg.palette.backgroundSection}),";border:",(function(e){return"1px solid "+e.$borderColor}),";padding:32px;gap:16px;");function pi(e){var t,r,i,o,l=e.subscription,c=e.theme,s=e.textOverrides,u=e.onContactSupport,d=l.pricingType,m=null==(t=null==(r=l.prices)?void 0:r.every((function(e){return e.billingModel!==n.BillingModel.UsageBased})))||t,p=null==(i=l.scheduledUpdates)?void 0:i.find((function(e){var t=e.targetPackage;return e.subscriptionScheduleType===n.SubscriptionScheduleType.Downgrade&&(null==t?void 0:t.pricingType)===n.PricingType.Free}));if(d===n.PricingType.Free)o=a.createElement(oi,{description:"You're on a free plan, so you don’t have any upcoming charges"});else if(d===n.PricingType.Paid)if(p&&m)o=a.createElement(oi,{description:"Your plan will be downgraded to a free plan, so you don’t have any upcoming charges"});else if(l.status===n.SubscriptionStatus.InTrial)o=a.createElement(oi,{description:"You’re on a free trial of the "+l.planName+" plan, so you don’t have any upcoming charges"});else{var g,h,f,y,v=null==(g=l.prices)||null==(h=g[0])?void 0:h.billingPeriod,b=null==(f=l.billingPeriodRange)?void 0:f.end,x=null==(y=l.totalPrice)?void 0:y.total;v&&b&&x&&(o=a.createElement(ai,{billingPeriod:v,rangeEnd:b,amount:x.amount,currency:x.currency}))}else d===n.PricingType.Custom&&(o=a.createElement(si,{onContactSupport:u,label:s.contactSupportTitle,linkLabel:s.contactSupportLink}));return a.createElement(mi,{className:"stigg-subscription-total-price-layout",$borderColor:c.borderColor},o)}function gi(){return(gi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var hi,fi,yi,vi=function(e){return i.createElement("svg",gi({width:16,height:16,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),ui||(ui=i.createElement("path",{d:"M12.947 13.6h-1.013l.001-2.824a.522.522 0 0 0-.18-.392L8.622 7.918l3.134-2.465a.497.497 0 0 0 .18-.392V2.4h1.012c.278 0 .49-.212.49-.49a.481.481 0 0 0-.49-.49H3.053a.481.481 0 0 0-.49.49c0 .278.213.49.49.49h1.013l-.001 2.661c0 .147.065.294.18.392l3.117 2.465-3.117 2.466a.497.497 0 0 0-.18.392V13.6H3.054a.481.481 0 0 0-.49.49c0 .277.213.49.49.49h9.894c.277 0 .49-.213.49-.49a.481.481 0 0 0-.49-.49ZM5.045 2.4h5.91v2.416L8 7.167l-2.955-2.35V2.4Zm0 8.62L8 8.67l2.955 2.334v2.58h-5.91V11.02Z",fill:"#fff"})),di||(di=i.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.053 1.254h9.894c.37 0 .657.287.657.656 0 .37-.287.657-.657.657h-.845L12.1 5.06c0 .214-.088.39-.238.519l-.005.004L8.89 7.918l2.974 2.34c.152.13.238.323.238.518l-.001 2.657h.846c.37 0 .657.287.657.657 0 .37-.288.657-.657.657H3.053a.648.648 0 0 1-.657-.657c0-.37.287-.657.657-.657h.846v-2.657c0-.214.087-.39.237-.519l.005-.004 2.953-2.335L4.136 5.58a.688.688 0 0 1-.238-.519V2.567h-.845a.648.648 0 0 1-.657-.656c0-.37.287-.657.657-.657Zm9.894.333H3.053a.315.315 0 0 0-.323.324c0 .185.138.323.323.323h1.18l-.001 2.827c0 .099.043.198.119.264l3.28 2.593-3.28 2.594a.33.33 0 0 0-.119.264v2.99H3.053a.315.315 0 0 0-.323.324c0 .185.138.323.323.323h9.894a.315.315 0 0 0 .323-.323.315.315 0 0 0-.323-.323h-1.18l.001-2.991a.355.355 0 0 0-.119-.264L8.351 7.918l3.298-2.593a.33.33 0 0 0 .119-.264V2.233h1.18a.315.315 0 0 0 .323-.323.315.315 0 0 0-.324-.323Zm-8.069.646h6.244v2.664L8 7.38 4.878 4.897V2.233Zm.334.334v2.169L8 6.955l2.788-2.22V2.568H5.212ZM8 8.457l3.122 2.467v2.827H4.878v-2.81L8 8.456Zm0 .425-2.788 2.219v2.316h5.576v-2.332L8 8.882Z",fill:"#fff"})))},bi=["children","className","placement"],xi=o((function(e){var t=e.children,n=e.className,r=e.placement,i=void 0===r?"top":r,o=de(e,bi);return a.createElement(j,Object.assign({arrow:!0,placement:i},o,{classes:{popper:n,tooltip:"stigg-tooltip",arrow:"stigg-tooltip-arrow"}}),a.createElement("div",null,t))}),{target:"enddsuj0"})((function(e){var t,n=e.theme,r=e.$padding,i=e.$maxWidth;return(t={})["& ."+O.tooltipClasses.tooltip]={backgroundColor:n.stigg.palette.white,maxWidth:void 0===i?300:i,boxShadow:n.stigg.shadows.popover,padding:void 0===r?8:r,borderRadius:n.stigg.border.radius,color:n.stigg.palette.text.primary},t["& ."+O.tooltipClasses.arrow]={color:n.stigg.palette.white},t}),""),Ei=S(ke)(hi||(hi=me(["\n display: ",";\n -webkit-line-clamp: ",";\n -webkit-box-orient: vertical;\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: normal;\n ","\n\n ","\n"])),(function(e){return e.$display}),(function(e){return e.$maxLines}),(function(e){return e.$wordBreak&&C.css(fi||(fi=me(["\n word-break: break-word;\n "])))}),(function(e){return e.$bold&&C.css(yi||(yi=me(["\n font-weight: bold;\n "])))}));function wi(e){return e&&(e.clientHeight<e.scrollHeight||e.offsetWidth<e.scrollWidth)}var ki=function(e){var t=e.leaveDelay,n=e.children,r=e.variant,o=e.color,l=e.maxLines,c=void 0===l?1:l,s=e.wordBreak,u=e.bold,d=e.tooltipPlacement,m=void 0===d?"top":d,p=e.className,g=e.display,h=void 0===g?"-webkit-box":g,f=e.style,y=e["data-testid"],v=i.useState(!1),b=v[0],x=v[1],E=i.useRef(null),w=a.createElement(Ei,{ref:E,variant:r,color:o,$maxLines:c,$wordBreak:s,$bold:u,className:p,$display:h,style:f,"data-testid":y},n);i.useEffect((function(){if(null!=E&&E.current){var e=wi(E.current);x(e)}}),[E]);var k=(null==E?void 0:E.current)&&wi(E.current);return a.createElement("span",null,b||k?a.createElement(xi,{placement:m,leaveDelay:t,title:a.createElement(ke,{variant:"body1"},n)},w):w)},Pi=o("div",{target:"el5iwyw1"})("width:100%;display:flex;align-items:center;gap:4px;background-color:",(function(e){return e.theme.stigg.palette.warning}),";border-radius:10px;padding:8px 16px;margin-top:16px;"),Ci=o(D,{target:"el5iwyw0"})({name:"69ka7t",styles:"text-decoration-color:white;color:white;cursor:pointer"});function Si(e){var t=e.subscription,r=e.includePlanName,i=e.onManageSubscription;return(null==t?void 0:t.status)!==n.SubscriptionStatus.InTrial?null:a.createElement(Pi,{className:"stigg-subscription-trial-badge"},a.createElement(vi,{className:"stigg-subscription-trial-badge-image"}),a.createElement("div",{style:{flex:1,marginRight:4}},a.createElement(ki,{variant:"body1",className:"stigg-subscription-trial-badge-text",color:"white"},t.trialRemainingDays+" days remaining in trial",r&&" of the "+t.planName+" plan")),a.createElement(Ci,{className:"stigg-subscription-trial-upgrade-button",onClick:i},a.createElement(ke,{color:"white"},"Upgrade plan")))}function Ti(e){var t=e.mainSubscription,n=e.trialSubscription,r=e.onManageSubscription;return a.createElement("div",{className:"stigg-subscription-view-layout"},a.createElement(ke,{className:"stigg-subscription-plan-name",variant:"h1",overrideColor:e.theme.planNameColor,style:{marginTop:8}},t.planName," plan"),a.createElement(Si,{subscription:n,includePlanName:(null==n?void 0:n.planName)!==t.planName,onManageSubscription:r}))}function Bi(e,t){return Math.min(Math.floor(e/t*100),100)}var Mi,Ai=o(R,{target:"e1cbsoof1"})("height:4px;background-color:",(function(e){return d(e.theme.stigg.palette.primary).alpha(.4).string()}),";span{background-color:",(function(e){var t=e.theme;switch(e.$progressStatus){case"standard":return t.stigg.palette.primary;case"warning":return t.stigg.palette.warning;case"error":return t.stigg.palette.error;default:return t.stigg.palette.primary}}),";}"),Ui=o(W,{target:"e1cbsoof0"})("border-style:dotted;border-bottom-width:2px;border-color:",(function(e){return d(e.theme.stigg.palette.outlinedRestingBorder).alpha(.4).string()}),";");function Li(e){var t=e.entitlement;if(t.hasUnlimitedUsage)return a.createElement(Ui,null);var n,r=Bi(t.currentUsage||0,t.usageLimit),i=(n=r)<70?"standard":n<100?"warning":"error";return a.createElement(Ai,{$progressStatus:i,className:"stigg-feature-usage-progress-bar-"+i.toString(),variant:"determinate",value:r})}var Fi=S(M)(Mi||(Mi=me(["\n text-transform: none;\n padding: 0;\n white-space: nowrap;\n"])));function Ni(e){var t=e.entitlement,n=e.feature,r=e.onManageSubscription,i=e.onBuyMore,o=e.canBuyMore,l=e.canUpgradeSubscription;return e.hasCustomSubscription||t.hasUnlimitedUsage||Bi(t.currentUsage||0,t.usageLimit)<70?null:o?i?a.createElement(Fi,{variant:"text",onClick:function(){return i(n,t)}},a.createElement(ke,{color:"primary.main"},"Buy more")):null:l&&r?a.createElement(Fi,{variant:"text",onClick:r},a.createElement(ke,{color:"primary.main"},"Upgrade")):null}function Ii(e){var t,n,r,i=e.amount,o=e.currency,l=e.entitlement,c=e.feature,s=e.hideChargePrice,u=e.onBuyMore,d=e.onManageSubscription,m=e.canUpgradeSubscription,p=e.hasCustomSubscription;return a.createElement("div",{className:"stigg-charge-list-item",style:{display:"flex",flexDirection:"column",gap:12}},a.createElement("div",{style:{display:"flex",justifyContent:"space-between",gap:12}},a.createElement("div",{style:{display:"flex",gap:12}},a.createElement(ki,{variant:"body1",color:"primary"},c.displayName),!s&&a.createElement(ki,{variant:"body1",color:"secondary"},Xe({amount:i,currency:o})," per ",c.featureUnits)),a.createElement("div",{style:{display:"flex",gap:12}},a.createElement(Ni,{entitlement:l,feature:c,canBuyMore:!0,onBuyMore:u,onManageSubscription:d,canUpgradeSubscription:m,hasCustomSubscription:p}),a.createElement(ke,{variant:"body1",color:"primary",style:{whiteSpace:"nowrap"}},l.hasUnlimitedUsage?null==(t=l.currentUsage)?void 0:t.toLocaleString():(null==(n=l.currentUsage)?void 0:n.toLocaleString())+" of "+(null==(r=l.usageLimit)?void 0:r.toLocaleString())))),a.createElement(Li,{entitlement:l}))}function Di(e){var t=e.subscription,r=e.onBuyMore,i=e.onManageSubscription,o=e.hasCustomSubscription,l=e.canUpgradeSubscription,c=s.keyBy(e.entitlements,"feature.refId"),u=t.prices.filter((function(e){var t=e.feature;return!!t&&c[t.refId]&&!!e.price}));return u.length?a.createElement("div",{className:"stigg-charge-list",style:{display:"flex",flexDirection:"column",gap:16,marginTop:32}},u.map((function(e){var t=e.feature,s=e.price;if(!t||!s)return null;var u=c[t.refId];return u&&u.feature?a.createElement(Ii,{key:t.refId,entitlement:u,feature:u.feature,amount:s.amount,currency:s.currency,hideChargePrice:e.billingModel===n.BillingModel.PerUnit,onBuyMore:r,onManageSubscription:i,canUpgradeSubscription:l,hasCustomSubscription:o}):null}))):null}function Oi(e){var t=e.onManageSubscription,r=e.onBuyMore,i=e.onCancelScheduledUpdates,o=e.onContactSupport,l=e.hiddenSections,c=e.cancelScheduledUpdatesButtonTitle,s=dn(),u=s.customerPortal,d=s.textOverrides,m=s.theme,p=s.isLoading||!u,g=u||{},h=g.subscriptions,f=g.entitlements,y=g.canUpgradeSubscription,v=null==h?void 0:h.find((function(e){return e.status===n.SubscriptionStatus.Active})),b=null==h?void 0:h.find((function(e){return e.status===n.SubscriptionStatus.InTrial})),x=(null==v?void 0:v.pricingType)===n.PricingType.Custom,E=v||b;return a.createElement(ii,{className:"stigg-customer-portal-subscriptions-overview",$backgroundColor:m.backgroundColor,$borderColor:m.borderColor},!p&&v&&v.scheduledUpdates&&a.createElement(ri,{theme:m,subscription:v,onCancelScheduledUpdates:i,cancelScheduledUpdatesButtonTitle:c}),p||!E?a.createElement(Zr,null):a.createElement("div",{className:"stigg-overview-layout",style:{display:"flex",alignItems:"flex-start",gap:64}},a.createElement("div",{style:{display:"flex",flexDirection:"column",flex:1}},a.createElement(xn,{onManageSubscription:t,hideManageButton:x,textOverrides:d}),a.createElement(Ti,{mainSubscription:E,trialSubscription:b,theme:m,onManageSubscription:t}),v&&f&&a.createElement(Di,{subscription:v,entitlements:f,onBuyMore:r,onManageSubscription:t,canUpgradeSubscription:!!y,hasCustomSubscription:x}),a.createElement(Hr,{customerPortal:u,hiddenSections:l,textOverrides:d,theme:m})),a.createElement("div",{style:{display:"flex",flexDirection:"column",width:319,gap:24}},a.createElement(pi,{subscription:E,theme:m,onContactSupport:o,textOverrides:d}))))}var ji=o("div",{target:"e2lw8x70"})({name:"7wpci2",styles:"display:flex;width:100%;align-items:flex-end;justify-content:flex-end;margin-bottom:24px"});function qi(e){return a.createElement(ji,{className:"stigg-customer-portal-header-layout"},a.createElement(Mt,{source:"customer_portal",showWatermark:e.showWatermark}))}var Ri=o(ke,{target:"eb0pe7a1"})({name:"kxbue8",styles:"text-transform:none"}),Wi=o(I.ExternalLink,{target:"eb0pe7a0"})("color:",(function(e){return e.theme.stigg.palette.primary}),";");function zi(e){var t=e.text,n=e.url;return a.createElement(gn,{className:e.className,variant:"outlined",startIcon:a.createElement(Wi,{size:20,strokeWidth:2.5}),onClick:function(){window.open(n,"_blank")}},a.createElement(Ri,{color:"primary.main"},t))}var _i,Hi=o("div",{target:"e12mjvl51"})({name:"1hidw77",styles:"display:flex;flex-direction:column;align-items:flex-start;gap:16px;flex:1 0 0"}),Vi=o("div",{target:"e12mjvl50"})({name:"j9hhqa",styles:"display:flex;align-items:flex-start;gap:16px;align-self:stretch"});function $i(e){var t=e.rows;return a.createElement(Hi,null,a.createElement(ke,{variant:"h6",color:"secondary",fontWeight:l.FontWeight.Medium},e.title),t.map((function(e){var t=e.classNamePrefix,n=e.label,r=e.value,i=e.valueTypographyProps;return a.createElement(Vi,{key:n},a.createElement(ke,Object.assign({className:t+"-label",variant:"body1",color:"secondary",style:{width:80}},e.labelTypographyProps),n),a.createElement(ke,Object.assign({className:t+"-text",variant:"body1",color:"secondary"},i),r))})))}function Zi(){return a.createElement(k,{width:220,height:42})}function Gi(){var e=dn(),t=e.customerPortal,n=e.textOverrides,r=e.theme,i=(t||{}).billingInformation,o=!i||e.isLoading,l=[];if(o?l.push.apply(l,[a.createElement(Hi,null,a.createElement(k,{width:220,height:12}),a.createElement(k,{width:220,height:12}),a.createElement(k,{width:220,height:12})),a.createElement(W,{orientation:"vertical",style:{minHeight:93}}),a.createElement(Hi,null,a.createElement(k,{width:220,height:12}),a.createElement(k,{width:220,height:12}),a.createElement(k,{width:220,height:12}))]):(l.push(a.createElement($i,{title:"Billed to",rows:[{classNamePrefix:"stigg-customer-name",label:"Name",value:(null==i?void 0:i.name)||"-",valueTypographyProps:null!=i&&i.name?{}:{color:"disabled"}},{classNamePrefix:"stigg-customer-email",label:"Email",value:(null==i?void 0:i.email)||"-",valueTypographyProps:null!=i&&i.email?{}:{color:"disabled"}}]})),null!=i&&i.defaultPaymentMethodId&&i.defaultPaymentMethodLast4Digits&&i.defaultPaymentExpirationMonth&&i.defaultPaymentExpirationYear&&(l.unshift(a.createElement(W,{orientation:"vertical",style:{minHeight:93}})),l.unshift(a.createElement($i,{title:"Payment method",rows:[{classNamePrefix:"stigg-credit-card",label:"Card",value:"Ending in "+i.defaultPaymentMethodLast4Digits},{classNamePrefix:"stigg-credit-card-expiration",label:"Expires",value:s.padStart(i.defaultPaymentExpirationMonth.toString(),2,"0")+"/"+i.defaultPaymentExpirationYear}]})))),!(o||null!=i&&i.name||null!=i&&i.email||null!=i&&i.defaultPaymentMethodId))return null;var c=o?a.createElement(Zi,null):null!=t&&t.billingPortalUrl?a.createElement(zi,{url:t.billingPortalUrl,text:n.editPaymentDetails,className:"stigg-edit-payment-details-button"}):null;return a.createElement(ii,{className:"stigg-payment-details-section-layout",$backgroundColor:r.backgroundColor,$borderColor:r.borderColor},a.createElement(yn,{className:"stigg-payment-details-section-header"},a.createElement(vn,{isLoading:o,className:"stigg-payment-details-section-title",title:"Payment details"}),c),a.createElement("div",{style:{display:"flex",alignItems:"stretch",gap:64}},l))}var Yi=o(ii,{target:"eqpkdww0"})("position:relative;.stigg-paywall-layout{width:100%;}.stigg-paywall-plans-layout{flex-wrap:nowrap;width:100%;overflow-x:auto;justify-content:unset;padding:10px 0px 0px 0px;}.stigg-paywall-plans-layout .stigg-plan-offering-container:first-of-type{margin-left:auto;}.stigg-paywall-plans-layout .stigg-plan-offering-container:last-child{margin-right:auto;}",(function(e){return e.$hideButtons&&c.css(_i||(_i=me(["\n .stigg-paywall-plan-button:not([disabled]) {\n display: none;\n }\n "])))})," .","stigg-watermark","{display:none;}"),Qi=a.forwardRef((function(e,t){var n=e.paywallComponent,r=e.theme;return n?a.createElement(Yi,{className:"stigg-customer-portal-paywall-section",ref:t,$hideButtons:e.hidePaywallButtons,$backgroundColor:r.backgroundColor,$borderColor:r.borderColor},a.createElement(yn,{className:"stigg-customer-portal-paywall-header"},a.createElement(vn,{isLoading:e.isLoading,className:"stigg-customer-portal-paywall-section-title",title:e.title})),n):null})),Ki=o("div",{target:"e1gjjeod1"})({name:"6xtw2",styles:"width:100%;display:flex;flex-direction:column;align-items:center;& *{box-sizing:border-box;}"}),Xi=o("div",{target:"e1gjjeod0"})({name:"1c31jfu",styles:"width:100%;display:flex;flex-direction:column;align-items:center;row-gap:24px"});function Ji(e,t,n){if(!t&&!n)return e;var r=_(e);return r===_(t||"")||r===_(n||"")?e:e+" ("+n+")"}var ea=o("div",{target:"eqqveb80"})("display:flex;flex-direction:column;padding:24px;border:",(function(e){return"1px solid "+e.$borderColor}),";border-radius:10px;row-gap:16px;height:100%;",(function(e){return e.$highlight&&"background-color: "+e.theme.stigg.palette.backgroundSection}),";");function ta(e){var t,r,i,o,l=e.entitlement,c=e.subscriptionPrice,s=e.onManageSubscription,u=e.onBuyMore,d=e.hasCustomSubscription,m=e.canUpgradeSubscription,g=dn().theme,h=!l.hasUnlimitedUsage&&l.currentUsage>l.usageLimit;return l.feature?a.createElement(ea,{$highlight:!!c,$borderColor:g.borderColor},a.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:16}},a.createElement(ki,{variant:"body1"},l.feature&&Ji((o=l.feature).displayName,o.featureUnits,o.featureUnitsPlural)),c&&a.createElement(xi,{title:a.createElement(ke,{variant:"body1"},c.billingModel===n.BillingModel.PerUnit?"Billed for committed usage":"Billed for actual usage")},a.createElement(Rr,{icon:"DollarCoin",svgStrokeColor:g.iconsColor}))),a.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:8}},a.createElement(ki,{variant:"body1",color:h?"error":"primary","data-testid":"usage-data-"+(null==(t=l.feature)?void 0:t.refId)},null==(r=l.currentUsage)?void 0:r.toLocaleString(),!l.hasUnlimitedUsage&&" / "+(null==(i=l.usageLimit)?void 0:i.toLocaleString())+" ("+Bi(l.currentUsage||0,l.usageLimit)+"%)"),a.createElement(Ni,{entitlement:l,feature:l.feature,onBuyMore:u,canBuyMore:!!c,onManageSubscription:s,canUpgradeSubscription:m,hasCustomSubscription:d})),a.createElement(Li,{entitlement:l}),l.hasUnlimitedUsage||z(l.usageLimit)||z(l.currentUsage)||!l.resetPeriod||!l.nextResetDate?null:a.createElement(ke,{color:"secondary"},function(e){if(!e.resetPeriod||!e.nextResetDate)return null;var t=function(t){return p.utc(e.nextResetDate).diff(p.utc(),t)};switch(e.resetPeriod){case"MONTH":return"Resets monthly - in "+t("days")+" days";case"WEEK":return"Resets weekly - in "+t("days")+" days";case"DAY":return"Resets daily - in "+t("hours")+" hours";case"HOUR":return"Resets hourly - in "+t("minutes")+" minutes";default:return null}}(l)),l.hasUnlimitedUsage&&a.createElement(ke,{color:"secondary"},"In current billing period")):null}var na=o("div",{target:"eoaojje0"})({name:"3hgi0y",styles:"margin-top:32px"});function ra(){return a.createElement(f,{container:!0,spacing:4,className:"stigg-subscription-usage-skeleton-layout"},s.range(6).map((function(e){return a.createElement(f,{key:e,item:!0,xs:4},a.createElement(k,{width:280,height:120}))})))}function ia(e){var t=e.onManageSubscription,r=e.onBuyMore,i=a.useState(!1),o=i[0],l=i[1],c=dn(),u=c.customerPortal,d=c.textOverrides,m=c.theme,p=c.isLoading||!u,g=u||{},h=g.entitlements,y=g.subscriptions,v=null==h?void 0:h.filter((function(e){var t,r;return(null==(t=e.feature)?void 0:t.meterType)===n.MeterType.Fluctuating||(null==(r=e.feature)?void 0:r.meterType)===n.MeterType.Incremental})),b=null==y?void 0:y.find((function(e){return e.status===n.SubscriptionStatus.Active})),x=(null==b?void 0:b.pricingType)===n.PricingType.Custom,E=!(null==u||!u.canUpgradeSubscription),w=s.keyBy(null==b?void 0:b.prices,"feature.refId"),k=s.keyBy(v,"feature.refId"),P=s.compact(null==b?void 0:b.prices.map((function(e){return e.feature&&k[e.feature.refId]}))),C=s.compact(null==v?void 0:v.filter((function(e){return!w[e.feature.refId]}))),S=[].concat(P,C),T=S.length>2?4:6,B=o?S:S.slice(0,6);return p||null!=v&&v.length?a.createElement(ii,{className:"stigg-subscription-usage-layout",$backgroundColor:m.backgroundColor,$borderColor:m.borderColor},a.createElement(yn,null,a.createElement(vn,{title:d.usageTabTitle,className:"stigg-customer-portal-usage-section-title",isLoading:p})),p?a.createElement(ra,null):a.createElement(a.Fragment,null,a.createElement(f,{container:!0,spacing:4},B.map((function(e){return a.createElement(f,{item:!0,xs:T},a.createElement(ta,{key:e.feature.refId,subscriptionPrice:w[e.feature.refId],entitlement:e,onManageSubscription:t,onBuyMore:r,hasCustomSubscription:x,canUpgradeSubscription:E}))}))),S.length>6&&a.createElement(na,null,a.createElement(gn,{className:"stigg-usage-toggle-many-button",variant:"text",startIcon:a.createElement(o?I.Minus:I.Plus,null),onClick:function(){return l((function(e){return!e}))}},o?"Show less":"Show more")))):null}function aa(e){var t=e.onManageSubscription,r=e.onBuyMore,o=e.onCancelScheduledUpdates,l=e.onContactSupport,c=e.paywallComponent,s=e.hiddenSections,u=Rt().stigg,d=dn(),m=d.customerPortal,p=d.textOverrides,g=d.theme,h=d.isLoading,f=i.useRef(null),y=function(){var e;t?t():null==f||null==(e=f.current)||e.scrollIntoView({behavior:"smooth"})},v=null==m?void 0:m.subscriptions.some((function(e){return e.pricingType===n.PricingType.Custom})),b=!(null!=s&&s.some((function(e){return"usage"===e}))),x=!(null!=s&&s.some((function(e){return"paymentDetails"===e||"billingInformation"===e}))),E=!(null!=s&&s.some((function(e){return"invoices"===e||"billingInformation"===e})));return a.createElement(Ki,{className:"stigg-customer-portal-layout"},a.createElement(qi,{showWatermark:u.isWidgetWatermarkEnabled&&!!m}),a.createElement(Xi,{className:"stigg-customer-portal-sections"},a.createElement(Oi,{onCancelScheduledUpdates:o,onBuyMore:r,onManageSubscription:y,onContactSupport:l,hiddenSections:s,cancelScheduledUpdatesButtonTitle:p.cancelScheduledUpdatesButtonTitle}),b&&a.createElement(ia,{onManageSubscription:y,onBuyMore:r}),a.createElement(Qi,{ref:f,paywallComponent:c,hidePaywallButtons:!!v,theme:g,title:p.paywallSectionTitle,isLoading:!m||h}),x&&a.createElement(Gi,null),E&&a.createElement(la,null)))}var oa=["textOverrides","theme","resourceId","productId"];function la(){var e=dn(),t=e.customerPortal,n=e.textOverrides,r=e.theme,i=!t||e.isLoading,o=i?a.createElement(Zi,null):null!=t&&t.billingPortalUrl?a.createElement(zi,{url:t.billingPortalUrl,text:n.viewInvoiceHistory,className:"stigg-view-invoice-history-button"}):null;return i||null!=t&&t.billingPortalUrl?a.createElement(ii,{className:"stigg-invoices-section-layout",$backgroundColor:r.backgroundColor,$borderColor:r.borderColor},a.createElement(yn,{className:"stigg-invoices-section-header"},a.createElement(vn,{isLoading:i,className:"stigg-invoices-section-title",title:n.invoicesTitle}),o)):null}var ca=function(e){return P(e,"addon.displayName")};function sa(e,t){return e.pricePoints.some((function(e){return e.billingPeriod===t}))}function ua(e){var t=e.addon,n=e.currency,r=e.billingCountryCode;return ue({},t,{pricePoints:t.pricePoints.filter((function(e){return e.currency===n&&(!r||e.billingCountryCode===r)}))})}function da(){var e=Na()[1];return function(t){return e((function(e){$(e.addonsStep.addons,(function(e){return e.addon.id===t}))}))}}function ma(){var e=Na()[1];return function(t){return e((function(e){e.widgetState.isValid=t}))}}function pa(){var e,t,n={checkoutState:(e=Na()[0]).checkout,widgetState:e.widgetState,checkoutLocalization:e.checkoutLocalization};return{checkoutState:n.checkoutState,widgetState:n.widgetState,checkoutLocalization:n.checkoutLocalization,setWidgetReadOnly:(t=Na()[1],function(e){return t((function(t){t.widgetState.readOnly=e}))}),setIsValid:ma()}}var ga,ha=function(e,t){return e.minUnitQuantity&&t<e.minUnitQuantity?e.minUnitQuantity:e.maxUnitQuantity&&t>e.maxUnitQuantity?e.maxUnitQuantity:t},fa=function(e,t,n){return e===Y.BillingPeriod.Monthly&&t||e===Y.BillingPeriod.Annually&&n?e:null},ya=function(e){return e.pricingModel===n.BillingModel.PerUnit};function va(){var e=Na()[1];return function(t,n){return e((function(e){var r=e.planStep.billableFeatures.find((function(e){return e.featureId===t}));r?r.quantity=n:e.planStep.billableFeatures.push({featureId:t,quantity:n})}))}}function ba(){var e;return ue({},Na()[0].planStep,{setBillingPeriod:(e=Na()[1],function(t){return e((function(e){e.planStep.billingPeriod=t}))}),setBillableFeature:va()})}!function(e){e.PLAN="PLAN",e.ADDONS="ADDONS",e.PAYMENT="PAYMENT"}(ga||(ga={}));var xa=[{key:ga.PLAN,label:"Plan"},{key:ga.ADDONS,label:"Add-ons"},{key:ga.PAYMENT,label:"Payment details"}],Ea={activeStep:0,completedSteps:[],steps:xa,isDisabled:!1};function wa(){var e=Na()[1];return function(t){return e((function(e){e.progressBar.completedSteps.push(t)}))}}function ka(){var e=Na()[1];return function(){return e((function(e){var t=e.progressBar;t.isDisabled||(t.completedSteps.includes(t.activeStep)||t.completedSteps.push(t.activeStep),t.activeStep<t.steps.length-1&&(t.activeStep+=1))}))}}function Pa(){var e=Na()[1];return function(t){return e((function(e){e.progressBar.isDisabled=!!t}))}}function Ca(){var e,t,n=Na()[0].progressBar;return{currentStep:n.steps[n.activeStep],progressBarState:n,isLastStep:n.activeStep===n.steps.length-1,isCheckoutComplete:(t=n,t.completedSteps.length>=t.steps.length-1),setActiveStep:(e=Na()[1],function(t){return e((function(e){e.progressBar.activeStep=t}))}),markStepAsCompleted:wa(),goNext:ka(),setIsDisabled:Pa()}}function Sa(){var e=Na()[0],t=e.paymentStep;return ue({},e.planStep,{addons:e.addonsStep.addons,promotionCode:e.promotionCode,billingAddress:t.billingAddress,taxPercentage:t.taxPercentage})}function Ta(e){var t=e.billingAddress,n=e.taxPercentage;return t||n?{billingInformation:ue({},t?{billingAddress:t}:{},n?{taxPercentage:n}:{})}:{}}var Ba=function(){var e=se(Ot.mark((function e(t){var n,r,i,a,o,l,c,s,u,d,m,p,g,h,f,y,v,b;return Ot.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.stigg,r=t.customerId,i=t.planId,a=t.resourceId,o=t.promotionCode,l=t.billableFeatures,c=t.billingCountryCode,s=t.billingPeriod,u=t.billingAddress,d=t.taxPercentage,m=t.onMockCheckoutPreview,p=t.addons.map((function(e){return{addonId:e.addon.id,quantity:e.quantity}})),g=null,h=null,e.prev=4,!r||!i){e.next=15;break}if(f=ue({customerId:r,planId:i,resourceId:a,billingCountryCode:c,addons:p,billingPeriod:s,promotionCode:o,billableFeatures:F(l)?void 0:l},Ta({billingAddress:u,taxPercentage:d})),!m){e.next=11;break}e.t0=m(f),e.next=14;break;case 11:return e.next=13,n.previewSubscription(f);case 13:e.t0=e.sent;case 14:g=e.t0;case 15:e.next=21;break;case 17:e.prev=17,e.t1=e.catch(4),v=(null==e.t1||null==(y=e.t1.message)?void 0:y.split("Error:"))||[],h=null==(b=v[1])?void 0:b.trim();case 21:return e.abrupt("return",{subscriptionPreview:g,errorMessage:h});case 22:case"end":return e.stop()}}),e,null,[[4,17]])})));return function(t){return e.apply(this,arguments)}}(),Ma=function(e){var t=(void 0===e?{}:e).onMockCheckoutPreview,n=Rt().stigg,r=Sa(),a=Na()[0].resourceId,o=pa(),l=o.widgetState,c=o.checkoutState||{},s=c.plan,u=c.customer;return{previewSubscriptionAction:i.useCallback(function(){var e=se(Ot.mark((function e(i){var o;return Ot.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=(void 0===i?{}:i).promotionCode,l.isValid){e.next=3;break}return e.abrupt("return",{subscriptionPreview:null,errorMessage:null});case 3:return e.abrupt("return",Ba({stigg:n,customerId:null==u?void 0:u.id,planId:null==s?void 0:s.id,resourceId:a,addons:r.addons,billableFeatures:r.billableFeatures,billingCountryCode:r.billingCountryCode,billingPeriod:r.billingPeriod,billingAddress:r.billingAddress,taxPercentage:r.taxPercentage,promotionCode:null!=o?o:r.promotionCode,onMockCheckoutPreview:t}));case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[n,null==u?void 0:u.id,null==s?void 0:s.id,a,r.addons,r.billableFeatures,r.billingCountryCode,r.billingPeriod,r.billingAddress,r.taxPercentage,r.promotionCode,l.isValid,t])}};function Aa(){var e=Na()[1];return function(t){return e((function(e){e.paymentStep.errorMessage=t}))}}function Ua(){var e=Na()[1];return function(t){return e((function(e){e.paymentStep.billingAddress=t}))}}function La(){var e;return ue({},Na()[0].paymentStep,{setUseNewPaymentMethod:(e=Na()[1],function(t){return e((function(e){e.paymentStep.useNewPaymentMethod=t}))}),setErrorMessage:Aa(),setBillingAddress:Ua()})}var Fa=a.createContext(null);Fa.displayName="CheckoutContext";var Na=function(){var e=i.useContext(Fa);if(!e)throw new Error("Could not find Checkout context; You need to wrap your checkout components in an <CheckoutProvider> component.");return e},Ia=function(e){var t=e.children,n=e.initialState,r=i.useState(n),o=r[0],l=r[1];i.useEffect((function(){l(n)}),[n]);var c=i.useCallback((function(e){return l((function(t){return H.produce(t,(function(t){return e(t)}))}))}),[l]),s=i.useMemo((function(){return[o,c]}),[c,o]);return a.createElement(Fa.Provider,{value:[s[0],s[1]]},t)};function Da(e){var t,r=e.children,o=e.textOverrides,l=e.theme,c=e.preferredBillingPeriod,s=e.billableFeatures,u=e.billingCountryCode,d=e.billingInformation,g=function(e){var t=e.planId,n=e.resourceId,r=e.billingCountryCode,a=e.onMockCheckoutState,o=Rt().stigg,l=i.useState(!0),c=l[0],s=l[1],u=i.useState(),d=u[0],m=u[1];return i.useEffect((function(){var e=function(){var e=se(Ot.mark((function e(){return Ot.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,o.getCheckoutState({planId:t,resourceId:n,billingCountryCode:r});case 3:m(e.sent),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),jt.error("Failed to load checkout "+(null==e.t0?void 0:e.t0.message),e.t0);case 10:return e.prev=10,s(!1),e.finish(10);case 13:case"end":return e.stop()}}),e,null,[[0,7,10,13]])})));return function(){return e.apply(this,arguments)}}();if(a)return s(!1),void m(a({planId:t,resourceId:n,billingCountryCode:r}));o.isCustomerLoaded&&(s(!0),e())}),[o,o.isCustomerLoaded,n,t,r,a]),{checkout:d,isLoading:c}}({resourceId:e.resourceId,planId:e.planId,billingCountryCode:u,onMockCheckoutState:e.onMockCheckoutState}),h=g.checkout,f=g.isLoading,y=null!=h&&h.configuration?function(e){var t=e.palette;return{palette:{primary:(null==t?void 0:t.primary)||void 0,backgroundPaper:(null==t?void 0:t.backgroundColor)||void 0,outlinedBorder:(null==t?void 0:t.borderColor)||void 0,text:{primary:(null==t?void 0:t.textColor)||void 0},backgroundHighlight:(null==t?void 0:t.summaryBackgroundColor)||void 0},typography:Vt(e.typography,zt)}}(h.configuration):{typography:Vt(zt)},v=ln(y),b=i.useMemo((function(){var e,t,r,i,a=function(e,t,n){var r=(e||{}).palette;return{primary:(null==t?void 0:t.primary)||(null==r?void 0:r.primary)||"rgb(50, 126, 238)",textColor:(null==t?void 0:t.textColor)||(null==r?void 0:r.text.primary)||"rgb(0, 30, 108)",backgroundColor:(null==t?void 0:t.backgroundColor)||(null==r?void 0:r.backgroundPaper)||"rgb(255, 255, 255)",borderColor:(null==t?void 0:t.borderColor)||(null==r?void 0:r.outlinedBorder)||"rgb(235, 237, 243)",summaryBackgroundColor:(null==t?void 0:t.summaryBackgroundColor)||(null==r?void 0:r.backgroundHighlight)||"rgb(109, 121, 144)"}}(v,l),g=m({changePlan:"Change",billingPeriodsTitle:"Billing cycle",addAddonText:"Add",newPaymentMethodText:"New payment method",newPaymentMethodBillingAddressTitle:"Billing address",newPaymentMethodCardTitle:"Payment method",summary:{title:"Order summary",planName:function(e){return e.plan.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:function(){return"Base charge"},totalText:"Total",totalDueText:"Total due today",totalBillingPeriodText:function(e){return"Billed "+e.billingPeriod.toLowerCase()},appliedCreditsTitle:"Applied credits",creditsForUnusedTimeText:function(e){return"Your account will be granted credits worth "+e.credits+" for unused time, which will be automatically applied to future payments."},discountText:function(e){var t,r=e.discountDetails;t=r.type===n.DiscountType.Percentage?r.value+"% off":""+Xe({amount:r.value,currency:e.currency});var i="";switch(r.durationType){case n.DiscountDurationType.Once:i=" once";break;case n.DiscountDurationType.Repeating:i=(r.type===n.DiscountType.Fixed?" per month":"")+" for "+r.durationInMonths+" months";break;case n.DiscountDurationType.Forever:default:i=""}return""+t+i},taxTitle:function(e){var t=e.taxDetails;return"Tax ("+(null==t?void 0:t.percentage)+"%)"},changesWillApplyAtEndOfBillingPeriod:function(e){return"Your changes will take effect at the end of your current billing cycle on "+p(e.billingPeriodEnd).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:function(){return"We’re sorry to see you cancel your paid subscription 😭"},freePlanHeader:function(){return"New plan"},freePlanName:function(e){return""+e.plan.displayName},freePlanPriceText:function(){return"Free"},paidPlanHeader:function(){return"Current plan"},paidPlanName:function(e){return""+e.plan.displayName},paidPlanPriceText:function(e){var t=e.billingPeriod;return"Paid plan"+(t?", billed "+t.toLowerCase():"")}}},o),y=function(e){var t=e.plan,n=e.activeSubscription,r=e.billingCountryCode,i=e.preconfiguredBillableFeatures,a=function(e){var t,n,r=e.plan,i=e.activeSubscription,a=e.preferredBillingPeriod,o=null==r?void 0:r.pricePoints.some((function(e){return e.billingPeriod===Y.BillingPeriod.Monthly})),l=null==r?void 0:r.pricePoints.some((function(e){return e.billingPeriod===Y.BillingPeriod.Annually}));if(a){var c=fa(a,o,l);if(c)return c}if((null==i||null==(t=i.plan)?void 0:t.id)===(null==r?void 0:r.id))return(null==i||null==(n=i.price)?void 0:n.billingPeriod)||Y.BillingPeriod.Monthly;if(null!=i&&i.prices&&(null==i?void 0:i.prices.length)>0){var s=fa(null==i?void 0:i.prices[0].billingPeriod,o,l);if(s)return s}return l?Y.BillingPeriod.Annually:Y.BillingPeriod.Monthly}({plan:t,activeSubscription:n,preferredBillingPeriod:e.preferredBillingPeriod}),o=function(e,t,n){var r;if(!t)return[];var i=Z(e,"featureId"),a=Z(G(null==n||null==(r=n.prices)?void 0:r.map((function(e){var t=e.feature;return t&&ya(e)?{featureId:t.featureId,quantity:t.unitQuantity||null}:null}))),"featureId");return G(null==t?void 0:t.map((function(e){var t,n,r,o,l=null==(t=e.feature)?void 0:t.featureId;if(!l||!ya(e))return null;var c=(null==(n=i[l])?void 0:n.quantity)||(null==(r=a[l])?void 0:r.quantity);return o=ha(e,c||1),e.isTieredPrice&&(o=je(e.tiers,o).upTo),{featureId:l,quantity:o}})))}(i,null==t?void 0:t.pricePoints.filter((function(e){return e.billingPeriod===a})),n);return{billingPeriod:a,billableFeatures:o,billingCountryCode:r}}({preferredBillingPeriod:c,plan:null==h?void 0:h.plan,activeSubscription:null==h?void 0:h.activeSubscription,billingCountryCode:u,preconfiguredBillableFeatures:null!=s?s:[]}),b=function(e){var t,r,i=e.activeSubscription,a=e.plan,o=e.billingPeriod,l=e.billingCountryCode,c=[],s=(null==a||null==(t=a.pricePoints)||null==(r=t[0])?void 0:r.currency)||n.Currency.Usd,u=function(e){return P(e,"displayName")}(function(e){var t,n=e.addons,r=e.billingPeriod,i=e.billingCountryCode,a=e.currency;return(null==n||null==(t=n.filter((function(e){return sa(e,r)})))?void 0:t.map((function(e){return ua({addon:e,currency:a,billingCountryCode:i})})))||[]}({addons:null==a?void 0:a.compatibleAddons,billingPeriod:o,billingCountryCode:l,currency:s})),d=function(e){var t,n=e.addons,r=e.billingPeriod,i=e.billingCountryCode,a=e.currency;return(null==n||null==(t=n.filter((function(e){return sa(e.addon,r)})))?void 0:t.map((function(e){return ue({},e,{addon:ua({addon:e.addon,currency:a,billingCountryCode:i})})})))||[]}({addons:null==i?void 0:i.addons,billingPeriod:o,billingCountryCode:l,currency:s});return null!=d&&d.length&&null!=u&&u.length&&(c=ca(d.filter((function(e){return u.some((function(t){return t.id===e.addon.id}))})))),{addons:c,initialAddons:V(c),availableAddons:u}}({plan:null==h?void 0:h.plan,billingPeriod:y.billingPeriod,activeSubscription:null==h?void 0:h.activeSubscription}),x={useNewPaymentMethod:!(null!=(i=(r={customer:null==h?void 0:h.customer,taxPercentage:null==d||null==(e=d.taxDetails)?void 0:e.taxPercentage}).customer)&&i.paymentMethodDetails),taxPercentage:r.taxPercentage},E=function(e){var t=e.availableAddons;return 0===(null==t?void 0:t.length)?ue({},Ea,{steps:xa.filter((function(e){return e.key!==ga.ADDONS}))}):Ea}({availableAddons:f?void 0:b.availableAddons});return{checkout:h,checkoutLocalization:g,stiggTheme:v,theme:a,progressBar:E,planStep:y,addonsStep:b,paymentStep:x,resourceId:null==h||null==(t=h.resource)?void 0:t.id,widgetState:{readOnly:!1,isValid:!0,isLoadingCheckoutData:f}}}),[c,u,h,f,null==d||null==(t=d.taxDetails)?void 0:t.taxPercentage]);return a.createElement(sn,{key:null==h?void 0:h.plan.id,componentTheme:y},a.createElement(Ia,{initialState:b},r))}var Oa,ja=o("div",{target:"ergo9xd2"})("margin:auto;width:100%;min-height:760px;max-width:920px;display:flex;position:relative;flex-direction:column;align-items:center;padding:16px 32px;border-radius:10px;background-color:",(function(e){return e.theme.stigg.palette.backgroundPaper}),";border:",(function(e){return"1px solid "+e.theme.stigg.palette.outlinedBorder}),";& *{box-sizing:border-box;}"),qa=o(U,{target:"ergo9xd1"})({name:"1pdbip7",styles:"display:flex;align-items:flex-start;gap:32px;flex-wrap:wrap;width:100%"}),Ra=o(U,{target:"ergo9xd0"})({name:"fszphw",styles:"display:flex;flex-direction:column;gap:0;flex:2"}),Wa=o(R,{shouldForwardProp:function(e){return!e.startsWith("$")},target:"e9upyia2"})((function(e){var t,n=e.theme,r=e.$disabled;return(t={})["&."+q.linearProgressClasses.root]={borderRadius:n.stigg.border.radius,backgroundColor:n.stigg.palette.outlinedBorder},t["& ."+q.linearProgressClasses.bar]={backgroundColor:r?n.stigg.palette.primaryLight:n.stigg.palette.primary},t}),""),za=o(M,{target:"e9upyia1"})((function(){var e;return(e={})["&."+B.buttonClasses.root]={textTransform:"none",lineHeight:"inherit",justifyContent:"flex-start",padding:"8px 4px"},e}),""),_a=o(Rr,{shouldForwardProp:function(e){return!e.startsWith("$")},target:"e9upyia0"})((function(e){var t=e.theme,n=e.$disabled;return{circle:{stroke:n?t.stigg.palette.primaryLight:t.stigg.palette.primary,fill:e.$shouldFill?n?t.stigg.palette.primaryLight:t.stigg.palette.primary:void 0}}}),""),Ha=o(f,{shouldForwardProp:function(e){return!e.startsWith("$")},target:"e1v7qkry3"})("display:flex;flex-direction:",(function(e){return e.$flexDirection||"row"}),";gap:",(function(e){return e.$gap}),"px;"),Va=o(Ha,{target:"e1v7qkry2"})({name:"o7lzx8",styles:"span{display:flex;flex:1;}"}),$a=o(f,{target:"e1v7qkry1"})("span{display:flex;flex:",(function(e){return e.flex}),";}"),Za=o(k,{target:"e1v7qkry0"})({name:"1u8hqvf",styles:"border-radius:4px"}),Ga=function(){var e=Ca(),t=e.progressBarState,n=e.setActiveStep,r=pa().widgetState,i=r.readOnly,o=r.isLoadingCheckoutData,l=t||{},c=l.activeStep,s=l.completedSteps,u=l.steps;return a.createElement(U,{sx:{width:"100%",mb:3}},a.createElement(Wa,{variant:"determinate",value:100*(c+1)/u.length,$disabled:i}),a.createElement(f,{container:!0,display:"flex"},u.map((function(e,r){var l=e.key,u=e.label,d=s.includes(r),m=i||r>c&&!d&&!s.includes(r-1)||c!==r&&t.isDisabled,p=m?"OutlinedCheckedCircleDisabled":"OutlinedCheckedCircle";return a.createElement(f,{key:l,item:!0,display:"flex",flexDirection:"row",flex:1,justifyContent:"flex-start"},o?a.createElement(Za,{width:120,height:20,style:{marginTop:8}}):a.createElement(za,{onClick:function(){return n(r)},fullWidth:!0,disabled:m},a.createElement(f,{item:!0,display:"flex",flexDirection:"row",alignItems:"center",gap:1},a.createElement(K,{icon:a.createElement(_a,{icon:d?p:"OutlinedCircle",$disabled:m,$shouldFill:d})}),a.createElement(ke,{variant:"h6",color:m?"primary.main.light":"primary.main"},u))))}))))},Ya=[n.BillingModel.FlatFee,n.BillingModel.PerUnit,n.BillingModel.UsageBased],Qa=function(e){return i.useMemo((function(){return function(e){return P(e,[function(e){return Ya.indexOf(e.pricingModel)},function(e){var t;return null==(t=e.feature)?void 0:t.displayName}])}(e)}),[e])},Ka=["variant"],Xa=o(M,{shouldForwardProp:function(e){return!e.startsWith("$")},target:"effv4rq0"})("border-radius:10px;text-transform:none;background-color:",(function(e){var t=e.theme;return e.$success?t.stigg.palette.success:e.$error?t.stigg.palette.error:""}),";&:hover{background-color:",(function(e){var t=e.theme;return e.$success?t.stigg.palette.successDark:e.$error?t.stigg.palette.errorDark:""}),";}"),Ja=function(e){var t=e.variant,n=void 0===t?"outlined":t,r=de(e,Ka);return a.createElement(Xa,Object.assign({variant:n},r))},eo=te(ne)((function(e){var t=e.theme;return{"& .MuiOutlinedInput-root":{height:"42px",borderRadius:t.stigg.border.radius,fieldset:{borderColor:t.stigg.palette.outlinedBorder},"&:not(.Mui-focused):hover fieldset":{borderColor:t.stigg.palette.outlinedRestingBorder}},"& .MuiInputBase-input":ue({padding:"8px 12px",borderRadius:t.stigg.border.radius,fontFamily:t.stigg.typography.fontFamily,color:t.stigg.palette.text.primary},t.stigg.typography.body),"& .Mui-error":{fontFamily:t.stigg.typography.fontFamily}}})),to=o(f,{target:"e1q84ats0"})({name:"1fttcpj",styles:"display:flex;flex-direction:column"});function no(){return a.createElement(to,{container:!0},a.createElement(Ha,{item:!0,$gap:48},a.createElement(Za,{width:120,height:20}),a.createElement(Za,{width:120,height:20})),a.createElement(W,{className:"stigg-checkout-plan-header-divider",sx:{marginY:2}}),a.createElement(to,{item:!0},a.createElement(Za,{width:120,height:20}),a.createElement(Va,{$gap:16,marginTop:3},a.createElement(Za,{height:20}),a.createElement(Za,{height:20})),a.createElement(Ha,{$gap:130,marginTop:3},a.createElement($a,{flex:1},a.createElement(Za,{height:20})),a.createElement($a,{flex:3},a.createElement(Za,{height:20})))))}function ro(){var e;return{promotionCode:Na()[0].promotionCode,setPromotionCode:(e=Na()[1],function(t){return e((function(e){e.promotionCode=t}))})}}function io(){return(io=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var ao=o((function(e){return i.createElement("svg",io({width:20,height:20,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),Oa||(Oa=i.createElement("g",{stroke:"#327EEE",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},i.createElement("path",{d:"M10 4.167v11.666M4.167 10h11.667"}))))}),{shouldForwardProp:function(e){return!e.startsWith("$")},target:"e3hfkj90"})("margin-right:8px;path{stroke:",(function(e){var t=e.theme;return e.$disabled?t.stigg.palette.text.disabled:t.stigg.palette.primary}),";}"),oo=function(e){var t=e.checkoutLocalization,n=e.disabled;return a.createElement(Ja,{disabled:n,fullWidth:!0,className:"stigg-checkout-summary-add-coupon-code-button",sx:{textTransform:"none",justifyContent:"flex-start",color:n?"text.disabled":"primary.main"},variant:"text",size:"medium",onClick:e.onAddClick},a.createElement(ao,{$disabled:n,className:"stigg-checkout-summary-add-coupon-code-button-icon"}),a.createElement(ke,{className:"stigg-checkout-change-plan-button-text",color:n?"disabled":"primary.main",style:{lineHeight:"24px"},variant:"h3"},t.summary.addCouponCodeText))},lo=o(Ja,{target:"e8kocin0"})("padding:4px 10px;min-width:unset;border-radius:",(function(e){return e.theme.stigg.border.radius}),";display:flex;align-items:center;"),co=function(e){var t=e.disabled,n=e.checkoutLocalization,r=e.onMockCheckoutPreview,o=ro().setPromotionCode,l=i.useState(!1),c=l[0],s=l[1],u=a.useState(""),d=u[0],m=u[1],p=a.useState(!1),g=p[0],h=p[1],y=a.useState(""),v=y[0],b=y[1],x=Ma({onMockCheckoutPreview:r}).previewSubscriptionAction,E=function(){var e=se(Ot.mark((function e(){var t,n,r,i;return Ot.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return h(!0),b(""),e.next=4,x({promotionCode:d});case 4:r=(n=e.sent).subscriptionPreview,!(i=n.errorMessage)&&null!=r&&null!=(t=r.immediateInvoice)&&t.discountDetails?(o(d.toUpperCase()),s(!1)):i&&b(i),h(!1);case 9:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return c?a.createElement(f,null,a.createElement(ke,{variant:"body1",color:v?"error":t?"disabled":"primary.main"},n.summary.couponCodeTitle),a.createElement(eo,{disabled:t,autoFocus:!0,variant:"outlined",fullWidth:!0,error:!!v,value:d,onChange:function(e){m(e.target.value)},inputProps:{maxLength:20},onKeyDown:function(e){"Enter"===e.key&&(E(),e.preventDefault())},InputProps:{endAdornment:a.createElement(lo,{variant:"contained",disabled:t,onClick:function(){E()}},g?a.createElement(J,{size:18,sx:{color:"white"}}):a.createElement(Rr,{style:{display:"flex"},icon:"ArrowForward"}))}}),!!v&&a.createElement(ke,{variant:"body1",color:"error"},v)):a.createElement(oo,{disabled:t,onAddClick:function(){return s(!0)},checkoutLocalization:n})},so=o(f,{target:"e1cvrfx31"})("width:auto;display:inline-flex;align-items:center;flex-direction:row;gap:8px;padding:6px 8px;border-radius:",(function(e){return e.theme.stigg.border.radius}),";border:1px solid ",(function(e){return e.theme.stigg.palette.primary}),";"),uo=o(Rr,{shouldForwardProp:function(e){return"style"!==e},target:"e1cvrfx30"})("display:flex;g{stroke:",(function(e){return e.theme.stigg.palette.primary}),";}path{fill:",(function(e){return e.$shouldFill?e.theme.stigg.palette.primary:void 0}),";}"),mo=function(e){var t=e.promotionCode,n=e.onClearPromotionCode;return a.createElement(so,{container:!0},a.createElement(f,{item:!0,display:"flex",gap:1,alignItems:"center"},a.createElement(uo,{icon:"Coupon"}),a.createElement(ke,{variant:"body1",color:"primary.main",lineHeight:"auto"},t)),a.createElement(f,{item:!0},a.createElement(Ja,{variant:"text",sx:{minWidth:"unset",padding:0},onClick:n},a.createElement(uo,{icon:"Close",$shouldFill:!0}))))},po=o("div",{target:"eqejwsl0"})({name:"1k6141t",styles:"margin:16px 0"}),go=function(e){var t=e.disabled,n=e.checkoutLocalization,r=e.onMockCheckoutPreview,i=ro(),o=i.promotionCode,l=i.setPromotionCode,c=o?a.createElement(mo,{promotionCode:o,onClearPromotionCode:function(){l("")}}):a.createElement(co,{disabled:t,checkoutLocalization:n,onMockCheckoutPreview:r});return a.createElement(po,null,c)},ho=["postal_code"];function fo(e){var t,n=e.onBillingAddressChange,r=e.collectPhoneNumber,i=pa(),o=i.checkoutState,l=i.checkoutLocalization,c=i.widgetState,s=i.setWidgetReadOnly,u=La().setBillingAddress,d=o||{},m=d.customer,p=d.configuration,g=c.readOnly,h=!!(null!=r?r:null==p||null==(t=p.content)?void 0:t.collectPhoneNumber);return a.createElement(f,{flexDirection:"column",container:!0,gap:3,padding:"16px",sx:{pointerEvents:g?"none":void 0}},a.createElement(f,{flexDirection:"column",container:!0,gap:2},a.createElement(ke,{variant:"h6"},l.newPaymentMethodBillingAddressTitle),a.createElement(Q.AddressElement,{onChange:function(e){if(e.complete){var t=e.value.address,r=ue({postalCode:t.postal_code},de(t,ho));s(!0),u(r),n?function(){var e=se(Ot.mark((function e(){return Ot.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n({billingAddress:r});case 2:s(!1);case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()():s(!1)}},options:{mode:"billing",fields:{phone:h?"always":"auto"},defaultValues:ue({},(null==m?void 0:m.name)&&{name:m.name})}})),a.createElement(f,{flexDirection:"column",container:!0,gap:2},a.createElement(ke,{variant:"h6"},l.newPaymentMethodCardTitle),a.createElement(Q.PaymentElement,{onChange:function(){},onReady:function(){},options:{readOnly:g,terms:{card:"never"},defaultValues:{billingDetails:ue({},(null==m?void 0:m.name)&&{name:m.name},(null==m?void 0:m.email)&&{email:m.email})}}})))}function yo(e){return vo.apply(this,arguments)}function vo(){return(vo=se(Ot.mark((function e(t){var n,r;return Ot.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.elements){e.next=5;break}return console.error("Stripe elements not initialized"),e.abrupt("return",{success:!1,errorMessage:"Stripe elements not initialized"});case 5:return e.next=7,n.submit();case 7:if(!(r=e.sent.error)){e.next=12;break}return console.log(r.message),e.abrupt("return",{success:!1,errorMessage:r.message||""});case 12:return e.abrupt("return",{success:!0});case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function bo(e){return xo.apply(this,arguments)}function xo(){return(xo=se(Ot.mark((function e(t){var n,r,i,a,o;return Ot.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.elements,i=t.setupIntentClientSecret,(n=t.stripe)&&r&&i){e.next=3;break}return e.abrupt("return",{success:!1});case 3:return e.next=5,ko({stripe:n,elements:r,clientSecret:i});case 5:return e.abrupt("return",{success:!!(o=(a=e.sent).newPaymentMethodId),paymentMethodId:o,errorMessage:a.setupErrorMessage});case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Eo(e){return wo.apply(this,arguments)}function wo(){return(wo=se(Ot.mark((function e(t){var r,i,a,o,l,c,s;return Ot.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(c=null==(o=t.applySubscriptionResults)||null==(r=o.subscription)||null==(i=r.latestInvoice)?void 0:i.paymentSecret,!(l=t.stripe)||!c||(null==o||null==(a=o.subscription)?void 0:a.paymentCollection)!==n.PaymentCollection.ActionRequired){e.next=9;break}return e.next=5,l.handleNextAction({clientSecret:c});case 5:if(!(s=e.sent.error)){e.next=9;break}return e.abrupt("return",{errorMessage:s.message||""});case 9:return e.abrupt("return",{subscription:null==o?void 0:o.subscription});case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ko(e){return Po.apply(this,arguments)}function Po(){return(Po=se(Ot.mark((function e(t){var n,r,i,a,o,l,c;return Ot.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.stripe,r=t.elements,i=t.clientSecret,e.next=3,n.confirmSetup({elements:r,confirmParams:{return_url:window.location.href},redirect:"if_required"});case 3:if(!(l=e.sent.error)){e.next=9;break}"card_error"===l.type||"validation_error"===l.type?"card_error"===l.type&&(o=l.message||""):o="An unexpected error occurred.",e.next=21;break;case 9:return e.prev=9,e.next=12,n.retrieveSetupIntent(i);case 12:null!=(c=e.sent.setupIntent)&&c.payment_method&&(a=c.payment_method),e.next=21;break;case 17:e.prev=17,e.t0=e.catch(9),o="An unexpected error occurred.",console.error(e.t0);case 21:return e.abrupt("return",{newPaymentMethodId:a,setupErrorMessage:o});case 22:case"end":return e.stop()}}),e,null,[[9,17]])})))).apply(this,arguments)}var Co={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:!1},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:!1},{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:!1},{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:!1},{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:!1}],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:!1},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:!1},{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:!1},{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:!1},{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:!1}],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:!1},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:!1},{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:!1},{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:!1},{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:!1}],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:!1},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:!1},{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:!1},{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:!1},{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:!1}],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:!1},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:!1},{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:!1},{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:!1},{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:!1}],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:!1},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:!1},{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:!1},{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:!1},{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:!1}],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:!1},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:!1},{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:!1},{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:!1},{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:!1}],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:!1},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:!1},{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:!1},{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:!1},{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:!1}],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:!1},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:!1},{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:!1},{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:!1},{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:!1}],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:!1},{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:!1},{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:!1},{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:!1}],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:{}},So=o(U,{target:"eeyi5d31"})("@keyframes blurFade{0%{background-color:",(function(e){return d(e.theme.stigg.palette.backgroundPaper).alpha(0).toString()}),";backdrop-filter:blur(0px);}100%{background-color:",(function(e){return d(e.theme.stigg.palette.backgroundPaper).alpha(.9).toString()}),";backdrop-filter:blur(6.5px);}}position:absolute;top:0;left:0;bottom:0;right:0;z-index:5;background-color:",(function(e){return d(e.theme.stigg.palette.backgroundPaper).alpha(.9).toString()}),";animation:blurFade 2s ease-in forwards;display:flex;flex-direction:column;justify-content:center;* rect{fill:transparent;}& path{stroke:",(function(e){return e.theme.stigg.palette.primary}),";}"),To=o(ke,{target:"eeyi5d30"})({name:"1kkk1zv",styles:"@keyframes fadeIn{0%{opacity:0;}75%{opacity:0;}100%{opacity:1;}}align-self:center;animation:fadeIn 5s ease-in forwards"});function Bo(e){var t=e.checkoutLocalization;return a.createElement(So,{className:"stigg-checkout-success-container"},a.createElement(ie,{width:350,height:"auto",isClickToPauseDisabled:!0,options:{loop:!1,autoplay:!0,animationData:Co}}),a.createElement(To,{variant:"h1",color:"primary.main"},t.summary.checkoutSuccessText))}var Mo=function(e){return new Promise((function(t){return setTimeout(t,e)}))},Ao=function(e){var t=e.width,n=e.height,r=e.children;return e.isLoading?a.createElement(Za,{width:void 0===t?50:t,height:void 0===n?16:n}):a.createElement(a.Fragment,null,r)},Uo=function(e){var t,n,r,i,o=e.isFetchingSubscriptionPreview,l=e.checkoutLocalization,c=(e.subscriptionPreview||{}).immediateInvoice;if(null==c||null==(t=c.proration)||null==(n=t.netAmount)||!n.amount||(null==c||null==(r=c.proration)||null==(i=r.netAmount)?void 0:i.amount)>=0)return null;var s=Xe({amount:-1*c.proration.netAmount.amount,currency:c.proration.netAmount.currency,minimumFractionDigits:2});return a.createElement(ke,{variant:"caption",style:{marginTop:14}},a.createElement(Ao,{isLoading:o,width:"100%"},l.summary.creditsForUnusedTimeText({credits:s})))},Lo=function(e){var t=e.subscriptionPreview,n=e.activeSubscription,r=e.isFetchingSubscriptionPreview,i=e.checkoutLocalization;if(null==t||!t.hasScheduledUpdates||null==n||!n.currentBillingPeriodEnd)return null;var o="function"==typeof i.summary.changesWillApplyAtEndOfBillingPeriod?i.summary.changesWillApplyAtEndOfBillingPeriod({billingPeriodEnd:n.currentBillingPeriodEnd}):i.summary.changesWillApplyAtEndOfBillingPeriod;return a.createElement(ke,{variant:"caption",style:{marginTop:14}},a.createElement(Ao,{isLoading:r,width:"100%"},o))},Fo=function(e){var t=e.subscriptionPreview,r=e.activeSubscription,i=e.plan,o=e.isFetchingSubscriptionPreview,l=e.billingPeriod,c=(t||{}).recurringInvoice;if(!t||null==c||!c.total.amount)return null;var s,u,d=t.hasScheduledUpdates?null==r?void 0:r.currentBillingPeriodEnd:null==t?void 0:t.billingPeriodRange.end,m=Xe(ue({},c.total,{minimumFractionDigits:2})),g=null==i?void 0:i.pricePoints.some((function(e){return e.pricingModel===n.BillingModel.UsageBased})),h=null==i?void 0:i.pricePoints.some((function(e){return e.pricingModel!==n.BillingModel.UsageBased})),f="We will bill you ",y=m+" ";switch(g&&(h?y+="+":y="for",y+=" applicable usage-based charges for this subscription "),l){case n.BillingPeriod.Monthly:u="month",s="the "+p(d).format("Do");break;case n.BillingPeriod.Annually:u="year",s=p(d).format("MMMM Do")}return a.createElement(ke,{variant:"body1",style:{marginTop:14}},a.createElement(Ao,{isLoading:o,width:"100%"},f+=y+"for this subscription every "+u+" on "+s+", unless you cancel."))};function No(e){return a.createElement(a.Fragment,null,a.createElement(Uo,Object.assign({},e)),a.createElement(Lo,Object.assign({},e)),a.createElement(Fo,Object.assign({},e)))}var Io=o("div",{target:"e1ultpe61"})({name:"rdmn2i",styles:"&+&{margin-top:8px;}"}),Do=o("div",{target:"e1ultpe60"})({name:"bcffy2",styles:"display:flex;align-items:center;justify-content:space-between"}),Oo=function(e){var t=a.createElement(ke,{variant:"body1"},e.checkoutLocalization.summary.payAsYouGoTooltipText);return a.createElement(xi,{placement:"left",title:t},a.createElement(Rr,{icon:"PayAsYouGoCharge",style:{display:"flex"}}))},jo=function(e){var t,r=e.checkoutLocalization,i=e.label,o=e.quantity,l=e.price,c=l.billingPeriod,s=l.pricingModel===n.BillingModel.UsageBased;return t=l.isTieredPrice?je(l.tiers,o).unitPrice.amount:l.amount,a.createElement(Io,null,a.createElement(Do,{style:{alignItems:"flex-start"}},a.createElement(f,{item:!0},a.createElement(ke,{variant:"body1",color:"secondary"},i),(o>1||c===n.BillingPeriod.Annually)&&a.createElement(ke,{variant:"body1",color:"secondary"},function(e){var t=e.amount,r=e.price,i=e.quantity,a=null;r.billingPeriod===n.BillingPeriod.Annually&&(t/=12,a="12 months");var o=Xe({amount:t,currency:r.currency,minimumFractionDigits:2});return(i>1?i+" x "+o+" each":o)+(a?" x "+a:"")}({amount:t,price:l,quantity:o}))),a.createElement(f,{item:!0,display:"flex",gap:1,alignItems:"center"},s&&a.createElement(Oo,{checkoutLocalization:r}),a.createElement(ke,{variant:"body1",color:"secondary",style:{wordBreak:"break-word"}},Xe({amount:o*t,currency:l.currency,minimumFractionDigits:2}),s&&" / unit"))))},qo=function(e){return a.createElement(Io,null,a.createElement(Do,{style:{alignItems:"flex-end"}},a.createElement(f,{item:!0},a.createElement(ke,{variant:"body1",color:"secondary"},e.label)),a.createElement(f,{item:!0,display:"flex",gap:1,alignItems:"center"},a.createElement(ke,{variant:"body1",color:"secondary",style:{wordBreak:"break-word"}},"Free"))))},Ro=function(e){var t=e.subscriptionPreview,n=e.isFetchingSubscriptionPreview,r=t.recurringInvoice||{},i=r.discount,o=r.discountDetails;return i&&o?a.createElement(Io,null,a.createElement(Do,null,a.createElement(ke,{variant:"body1",color:"secondary"},e.checkoutLocalization.summary.discountText({discountDetails:o,currency:t.immediateInvoice.total.currency})),a.createElement(ke,{variant:"body1",color:"secondary"},n?a.createElement(Za,{width:50,height:16}):Xe({amount:i.amount,currency:i.currency,minimumFractionDigits:2})))):null},Wo=function(e){var t=e.isFetchingSubscriptionPreview,n=((e.subscriptionPreview||{}).immediateInvoice||{}).credits;return!n||!n.used||n.used.amount<=0?null:a.createElement(Io,null,a.createElement(Do,null,a.createElement(ke,{variant:"body1",color:"secondary"},e.checkoutLocalization.summary.appliedCreditsTitle),a.createElement(ke,{variant:"body1",color:"secondary"},a.createElement(Ao,{isLoading:t},Xe({amount:-1*n.used.amount,currency:n.used.currency,minimumFractionDigits:2})))))},zo=function(e){var t=e.tax,n=e.taxDetails,r=e.isFetchingSubscriptionPreview;return!n||!t||(null==t?void 0:t.amount)<=0?null:a.createElement(Io,null,a.createElement(Do,null,a.createElement(ke,{variant:"body1",color:"secondary"},e.checkoutLocalization.summary.taxTitle({taxDetails:n})),a.createElement(ke,{variant:"body1",color:"secondary"},a.createElement(Ao,{isLoading:r},Xe({amount:null==t?void 0:t.amount,currency:null==t?void 0:t.currency,minimumFractionDigits:2})))))},_o=o(U,{target:"e9ji7bp4"})({name:"kj9yp4",styles:"max-width:470px;flex:1.5"}),Ho=o(ee,{target:"e9ji7bp3"})("border-radius:10px;background:",(function(e){return e.theme.stigg.palette.backgroundHighlight}),";padding:16px;");Ho.defaultProps={elevation:0};var Vo,$o,Zo,Go,Yo=o(ke,{target:"e9ji7bp2"})({name:"1jcocwa",styles:"margin-bottom:16px;font-weight:500"}),Qo=o(W,{target:"e9ji7bp1"})({name:"1k6141t",styles:"margin:16px 0"}),Ko=o(ke,{target:"e9ji7bp0"})({name:"5bhc30",styles:"margin-bottom:8px"}),Xo=function(e){var t,r,o,l,c,s=e.onCheckout,u=e.onCheckoutCompleted,d=e.disablePromotionCode,m=e.disableSuccessAnimation,p=e.isFreeDowngrade,g=e.onMockCheckoutPreview,h=i.useState(!1),y=h[0],v=h[1],b=La().setErrorMessage,x=Ca(),E=Sa(),w=pa(),k=w.checkoutLocalization,P=w.checkoutState||{},C=P.plan,S=P.activeSubscription,T=Qa((null==C||null==(t=C.pricePoints)?void 0:t.filter((function(e){return e.billingPeriod===E.billingPeriod})))||[]),B=X(T,(function(e){return e.pricingModel===n.BillingModel.FlatFee})),M=B[1],A=(B[0]||[])[0],U=p||x.isCheckoutComplete&&x.isLastStep,L=function(e){var t=(void 0===e?{}:e).onMockCheckoutPreview,n=i.useState(null),r=n[0],a=n[1],o=i.useState(!1),l=o[0],c=o[1],s=Ma({onMockCheckoutPreview:t}).previewSubscriptionAction;return i.useEffect((function(){var e=function(){var e=se(Ot.mark((function e(){var t;return Ot.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,s();case 2:(t=e.sent.subscriptionPreview)&&a(t),c(!1);case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();c(!0);var t=setTimeout((function(){c(!0),e()}),500);return function(){clearTimeout(t)}}),[s]),{subscriptionPreview:r,isFetchingSubscriptionPreview:l}}({onMockCheckoutPreview:g}),F=L.subscriptionPreview,N=L.isFetchingSubscriptionPreview,I=function(e){var t=e.onCheckout,n=e.onCheckoutCompleted,r=e.onSuccess,i=e.disableSuccessAnimation,a=Rt().stigg,o=La().useNewPaymentMethod,l=function(){var e=Sa(),t=Na()[0].resourceId,n=(pa().checkoutState||{}).plan,r=e.addons.map((function(e){return{addonId:e.addon.id,quantity:e.quantity}}));if(null!=n&&n.id)return ue({resourceId:t,planId:n.id,billingPeriod:e.billingPeriod,billableFeatures:e.billableFeatures,addons:r,promotionCode:e.promotionCode,billingCountryCode:e.billingCountryCode},e.taxPercentage?{billingInformation:{taxPercentage:e.taxPercentage}}:{})}(),c=pa(),s=c.widgetState,u=c.setWidgetReadOnly,d=(c.checkoutState||{}).setupSecret,m=Q.useStripe(),p=Q.useElements();return{handleSubmit:function(){var e=se(Ot.mark((function e(c){var s,g,h,f,y,v,b,x;return Ot.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(c.preventDefault(),l){e.next=3;break}return e.abrupt("return",{success:!1,errorMessage:"Unexpected error, please contact support."});case 3:if(s=ue({},l),y=function(){var e=se(Ot.mark((function e(){var t,n,r,i,l;return Ot.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!o){e.next=13;break}return e.next=3,yo({elements:p});case 3:if(n=(t=e.sent).errorMessage,t.success){e.next=8;break}return e.abrupt("return",{success:!1,errorMessage:n});case 8:return e.next=10,bo({elements:p,stripe:m,setupIntentClientSecret:d});case 10:(r=e.sent).success||(h=r.errorMessage),f=r.paymentMethodId;case 13:if(!h){e.next=15;break}return e.abrupt("return",{success:!1,errorMessage:h});case 15:return s=ue({},s,{paymentMethodId:f}),e.prev=16,e.next=19,a.applySubscription(s);case 19:return i=e.sent,e.next=22,Eo({applySubscriptionResults:i,stripe:m});case 22:return g=l=e.sent,l.errorMessage&&(h=l.errorMessage),e.abrupt("return",{success:!l.errorMessage,errorMessage:l.errorMessage});case 28:return e.prev=28,e.t0=e.catch(16),console.error(e.t0),e.abrupt("return",{success:!1,errorMessage:h=null==e.t0?void 0:e.t0.message});case 33:case"end":return e.stop()}}),e,null,[[16,28]])})));return function(){return e.apply(this,arguments)}}(),u(!0),v=!1,!t){e.next=15;break}return e.next=10,t({checkoutParams:s,checkoutAction:y});case 10:!(b=e.sent).success&&b.errorMessage&&(h=b.errorMessage),v=b.success&&!h,e.next=20;break;case 15:return e.next=17,y();case 17:!(x=e.sent).success&&x.errorMessage&&(h=x.errorMessage),v=x.success&&!h;case 20:if(u(!1),!v||!r){e.next=26;break}if(r(),i){e.next=26;break}return e.next=26,Mo(5e3);case 26:return e.next=28,n({success:v,error:h});case 28:return e.abrupt("return",{results:g,success:!h,errorMessage:h});case 29:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),isLoading:!(null==s||!s.readOnly)}}({disableSuccessAnimation:m,onCheckout:s,onCheckoutCompleted:u,onSuccess:function(){v(!0),x.markStepAsCompleted(x.progressBarState.activeStep)}}),D=I.handleSubmit,O=I.isLoading,j=function(){var e=se(Ot.mark((function e(t){var n;return Ot.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!y){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,D(t);case 4:if(e.t0=e.sent,e.t0){e.next=7;break}e.t0={};case 7:(n=e.t0.errorMessage)?(b(n),v(!1)):b(void 0);case 10:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),q=function(){var e=se(Ot.mark((function e(t){return Ot.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!O){e.next=2;break}return e.abrupt("return");case 2:if(!U){e.next=7;break}return e.next=5,j(t);case 5:e.next=8;break;case 7:x.goNext();case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),R=F||{},W=R.immediateInvoice,z=R.recurringInvoice,_=!(!F||(null==W||!W.proration)&&!F.hasScheduledUpdates),H=!d&&!p,V=!(null==z||!z.discountDetails||p),$=H||V,Z=M.some((function(e){return e.pricingModel===n.BillingModel.UsageBased})),G=Z&&!A&&M.every((function(e){return e.pricingModel===n.BillingModel.UsageBased})),Y="function"==typeof k.summary.baseChargeText?k.summary.baseChargeText({billingPeriod:E.billingPeriod}):k.summary.baseChargeText;return a.createElement(_o,null,a.createElement(Ho,null,a.createElement(Yo,{variant:"h3"},k.summary.title),a.createElement(f,{display:"flex",flexDirection:"row",alignItems:"center",marginY:2},a.createElement(ke,{variant:"h6",color:"primary",style:{paddingRight:"8px"}},k.summary.planName({plan:C})),a.createElement(Qo,{className:"stigg-checkout-summary-divider",sx:{flex:1,margin:"0 !important"}})),A&&a.createElement(jo,{checkoutLocalization:k,label:Y,quantity:1,price:A}),!A&&p?a.createElement(qo,{label:Y}):null,M.map((function(e){var t,n,r,i,o,l=null==(t=E.billableFeatures)?void 0:t.find((function(t){var n;return t.featureId===(null==(n=e.feature)?void 0:n.featureId)}));return a.createElement(jo,{checkoutLocalization:k,key:null==(n=e.feature)?void 0:n.featureId,label:Ji((null==(r=e.feature)?void 0:r.displayName)||"",null==(i=e.feature)?void 0:i.units,null==(o=e.feature)?void 0:o.unitsPlural),quantity:(null==l?void 0:l.quantity)||1,price:e})})),!(null==(r=E.addons)||!r.length)&&a.createElement(a.Fragment,null,a.createElement(f,{display:"flex",flexDirection:"row",alignItems:"center",marginY:2},a.createElement(ke,{variant:"h6",color:"primary",style:{paddingRight:"8px"}},k.summary.addonsSectionTitle),a.createElement(Qo,{className:"stigg-checkout-summary-divider",sx:{flex:1,margin:"0 !important"}})),E.addons.map((function(e){var t,n,r=null==(t=e.addon.pricePoints)?void 0:t.find((function(e){return e.billingPeriod===E.billingPeriod}));return r?a.createElement(jo,{checkoutLocalization:k,key:null==e||null==(n=e.addon)?void 0:n.id,label:e.addon.displayName,quantity:e.quantity&&e.quantity>0?e.quantity:1,price:r}):null}))),!$&&a.createElement(Qo,{className:"stigg-checkout-summary-divider"}),$&&a.createElement(f,{display:"flex",flexDirection:"row",alignItems:"center",marginY:2},a.createElement(ke,{variant:"h6",color:"primary",style:{paddingRight:"8px"}},k.summary.discountsSectionTitle),a.createElement(Qo,{className:"stigg-checkout-summary-divider",sx:{flex:1,margin:"0 !important"}})),H&&a.createElement(go,{disabled:O||N,checkoutLocalization:k,onMockCheckoutPreview:g}),V&&a.createElement(Ro,{subscriptionPreview:F,isFetchingSubscriptionPreview:N,checkoutLocalization:k}),$&&a.createElement(Qo,{className:"stigg-checkout-summary-divider"}),a.createElement(zo,{tax:null==z?void 0:z.tax,taxDetails:null==z?void 0:z.taxDetails,isFetchingSubscriptionPreview:N,checkoutLocalization:k}),p?null:a.createElement(a.Fragment,null,a.createElement(Do,{style:{marginTop:16}},a.createElement(f,{display:"flex",flexDirection:"column",container:!0},a.createElement(f,{item:!0,display:"flex",justifyContent:"space-between"},a.createElement(ke,{variant:"h6"},k.summary.totalText),a.createElement(ke,{variant:"h6"},a.createElement(Ao,{isLoading:N},G?k.summary.onlyPayAsYouGoText:null,!G&&Z?k.summary.startsAtText:null,G?null:Xe(ue({amount:0},null==z?void 0:z.total,{minimumFractionDigits:2}))))),a.createElement(f,{item:!0},a.createElement(ke,{variant:"body1",color:"secondary"},k.summary.totalBillingPeriodText({billingPeriod:E.billingPeriod}))))),a.createElement(Qo,{className:"stigg-checkout-summary-divider"})),null!=W&&null!=(o=W.proration)&&o.hasProrations&&null!=W&&W.subTotal&&(null==W?void 0:W.subTotal.amount)>0?a.createElement(Io,null,a.createElement(Do,null,a.createElement(ke,{variant:"body1",color:"secondary"},k.summary.proratedTotalDueText),a.createElement(ke,{variant:"body1",color:"secondary"},a.createElement(Ao,{isLoading:N},Xe({amount:(null==W||null==(l=W.subTotal)?void 0:l.amount)+((null==W||null==(c=W.tax)?void 0:c.amount)||0),currency:null==W?void 0:W.subTotal.currency,minimumFractionDigits:2}))))):null,a.createElement(Wo,{subscriptionPreview:F,isFetchingSubscriptionPreview:N,checkoutLocalization:k}),a.createElement(Io,null,a.createElement(Do,null,a.createElement(Ko,{variant:"h6"},k.summary.totalDueText),a.createElement(Ko,{variant:"h6"},a.createElement(Ao,{isLoading:N},Xe(ue({amount:0},null==W?void 0:W.total,{minimumFractionDigits:2})))))),a.createElement(No,{plan:C,activeSubscription:S,subscriptionPreview:F,isFetchingSubscriptionPreview:N,checkoutLocalization:k,billingPeriod:E.billingPeriod}),a.createElement(Ja,{$success:y,$error:U&&p,disabled:O||N||x.progressBarState.isDisabled||U&&!_,className:"stigg-checkout-summary-cta-button",sx:{textTransform:"none",borderRadius:"10px",marginTop:"24px",height:"36px"},variant:"contained",size:"medium",onClick:function(e){q(e)},fullWidth:!0},a.createElement(ke,{className:"stigg-checkout-summary-cta-button-text",variant:"h3",color:"white",style:{display:"flex"}},y?a.createElement(Rr,{icon:"Check",style:{display:"contents"}}):O||N?a.createElement(J,{size:20,sx:{color:"white"}}):function(e){var t=e.checkoutLocalization;return e.isLastStep?e.checkoutHasChanges?e.isPlanUpdate?t.checkoutButton.updateText:e.isFreeDowngrade?t.checkoutButton.downgradeToFreeText:t.checkoutButton.upgradeText:t.checkoutButton.noChangesText:t.checkoutButton.nextText}({isLastStep:U,checkoutHasChanges:_,isFreeDowngrade:p,checkoutLocalization:k,isPlanUpdate:!!S&&(null==S?void 0:S.plan.id)===(null==C?void 0:C.id)})))),a.createElement(Mt,{source:"checkout",showWatermark:!0,style:{marginTop:8,display:"flex",justifyContent:"center"}}),!m&&y&&a.createElement(Bo,{checkoutLocalization:k}))},Jo=function(){return a.createElement(_o,null,a.createElement(Ho,null,a.createElement(Ha,{$flexDirection:"column",$gap:24},a.createElement(Za,{width:120,height:20}),a.createElement(Za,{width:120,height:20}),a.createElement(Za,{width:120,height:20}),a.createElement(Za,{width:120,height:20})),a.createElement(Ha,{$flexDirection:"column",$gap:24,marginTop:5},a.createElement(Za,{height:20}),a.createElement(Za,{height:20}),a.createElement(Za,{height:20})),a.createElement($a,{flex:1,marginTop:5},a.createElement(Za,{height:34}))),a.createElement(Mt,{source:"checkout",showWatermark:!0,style:{marginTop:8,display:"flex",justifyContent:"center"}}))},el=o(f,{target:"e1o28dc92"})({name:"1wte80x",styles:"width:100%;gap:8px"}),tl=o(f,{target:"e1o28dc91"})({name:"a3p0fn",styles:"display:flex;justify-content:space-between;align-items:center;height:80px"}),nl=o(Ja,{target:"e1o28dc90"})({name:"156064h",styles:"min-width:unset;width:41px;height:41px;padding:0"});function rl(e){var t,r=e.addon,i=e.billingPeriod,o=e.addonState,l=e.initialAddonState,c=e.setAddon,s=e.removeAddon,u=e.checkoutLocalization,d=e.onAddonsValidationChange,m=e.isValid,p=r.pricePoints.find((function(e){return e.billingPeriod===i})),g=!!o,h=!!o&&!!l&&o.quantity!==l.quantity||!!l&&!o,y=function(e){if(!e||e<=0)return d({addonId:r.id,isValid:!1}),void c(r,null!=e?e:null);d({addonId:r.id,isValid:!0}),c(r,e)};return a.createElement(tl,{container:!0},a.createElement(f,{item:!0},a.createElement(ke,{variant:"h6",lineHeight:"24px"},r.displayName),!!p&&a.createElement(ke,{variant:"body1",lineHeight:"20px",color:"secondary"},Xe({amount:p.amount,currency:p.currency,minimumFractionDigits:2})+"/"+(i===n.BillingPeriod.Annually?"year":"month"))),a.createElement(f,{item:!0},h&&a.createElement(Ja,{variant:"text",size:"small",sx:{padding:"8px",minWidth:"unset"},onClick:function(){l?c(r,l.quantity):s(r.id),d({addonId:r.id,isValid:!0})}},a.createElement(ke,{color:"primary.main",variant:"body1"},"Undo")),g&&a.createElement(a.Fragment,null,a.createElement(eo,{id:r.id+"-input",type:"number",sx:{width:120,marginX:2},value:null!=(t=null==o?void 0:o.quantity)?t:"",error:!m,helperText:m?void 0:"Minimum 1",FormHelperTextProps:{sx:{margin:"4px"}},onChange:function(e){var t,n;return y(null!=e&&null!=(t=e.target)&&t.value?Number(null==e||null==(n=e.target)?void 0:n.value):null)}}),a.createElement(nl,{color:"error",onClick:function(){s(r.id),d({addonId:r.id,isValid:!0})}},a.createElement(Rr,{icon:"Trash",style:{display:"flex"}}))),!g&&a.createElement(Ja,{sx:{paddingX:"22px",paddingY:"8px"},onClick:function(){return y(1)}},a.createElement(ke,{color:"primary.main",variant:"body1"},u.addAddonText))))}function il(){var e,t=pa(),n=t.checkoutLocalization,r=t.setIsValid,o=ba().billingPeriod,l=Ca().setIsDisabled,c=ue({},Na()[0].addonsStep,{setAddon:(e=Na()[1],function(t,n){return e((function(e){var r=e.addonsStep.addons.find((function(e){return e.addon.id===t.id}));r?r.quantity=n:(e.addonsStep.addons.push({addon:t,quantity:n}),e.addonsStep.addons=ca(e.addonsStep.addons))}))}),removeAddon:da()}),s=c.initialAddons,u=c.addons,d=c.availableAddons,m=c.setAddon,p=c.removeAddon,g=i.useState((null==d?void 0:d.reduce((function(e,t){return e[t.id]=!0,e}),{}))||{}),h=g[0],f=g[1];return i.useEffect((function(){var e=Object.values(h).some((function(e){return!e}));l(e),r(!e)}),[h,l,r]),a.createElement(el,{container:!0},null==d?void 0:d.map((function(e){var t=u.find((function(t){return t.addon.id===e.id})),r=null==s?void 0:s.find((function(t){return t.addon.id===e.id}));return a.createElement(rl,{key:e.id,addon:e,billingPeriod:o,addonState:t,initialAddonState:r,setAddon:m,removeAddon:p,checkoutLocalization:n,onAddonsValidationChange:function(e){var t;return f(ue({},h,((t={})[e.addonId]=e.isValid,t)))},isValid:h[e.id]})})))}var al,ol=te(f,{shouldForwardProp:function(e){return!e.startsWith("$")}})(Vo||(Vo=me(["\n padding: 8px;\n border-radius: 10px;\n border: 1px solid ",";\n cursor: ",";\n opacity: ",";\n"])),(function(e){return e.theme.stigg.palette.outlinedBorder}),(function(e){return e.$disabled?"not-allowed":"pointer"}),(function(e){return e.$disabled?.6:1})),ll=te(ol)($o||($o=me(["\n flex-direction: column;\n align-items: unset;\n"]))),cl=te(f)(Zo||(Zo=me(["\n display: flex;\n align-items: center;\n flex: 1;\n gap: 12px;\n"]))),sl=te(f)(Go||(Go=me(["\n display: flex;\n flex-direction: column;\n"])));function ul(e){var t=e.icon,n=e.text,r=e.subtitle;return a.createElement(cl,null,a.createElement(le,{checked:e.checked,disabled:e.readOnly}),a.createElement(Rr,{icon:t,style:{display:"flex"}}),a.createElement(sl,{container:!0},a.createElement(f,{item:!0},n),r&&a.createElement(f,{item:!0},r)))}function dl(e){var t=e.paymentMethodDetails,n=e.readOnly;if(!t)return null;var r=t.expirationMonth,i=t.expirationYear;return a.createElement(ol,{item:!0,onClick:e.onSelect,$disabled:n},a.createElement(ul,{checked:e.checked,readOnly:n,icon:"PaymentMethod",text:a.createElement(ke,{variant:"h6"},"Card ending in "+t.last4Digits),subtitle:!!r&&!!i&&a.createElement(ke,{variant:"body1"},"Expires "+r.toString().padStart(2,"0")+"/"+i)}))}function ml(e){var t=e.checked,n=e.readOnly,r=e.onBillingAddressChange,i=e.collectPhoneNumber;return a.createElement(ll,{item:!0,onClick:e.onSelect,$disabled:n},a.createElement(ul,{checked:t,readOnly:n,icon:"PaymentMethod",text:a.createElement(ke,{variant:"h6"},e.checkoutLocalization.newPaymentMethodText)}),a.createElement(oe,{in:t},a.createElement(fo,{onBillingAddressChange:r,collectPhoneNumber:i})))}var pl=te(f)(al||(al=me(["\n display: flex;\n flex-direction: column;\n gap: 24px;\n"])));function gl(e){var t=e.onBillingAddressChange,n=e.collectPhoneNumber,r=pa(),i=r.checkoutLocalization,o=r.widgetState,l=(r.checkoutState||{}).customer,c=La(),s=c.errorMessage,u=c.useNewPaymentMethod,d=c.setUseNewPaymentMethod,m=o.readOnly,p=function(e){m||d(e)};return a.createElement(pl,{container:!0},!!s&&a.createElement(ae,{severity:"error",sx:{alignItems:"center"}},a.createElement(ke,{overrideColor:"inherit"},s)),a.createElement(dl,{readOnly:m,checked:!u,paymentMethodDetails:null==l?void 0:l.paymentMethodDetails,onSelect:function(){return p(!1)}}),a.createElement(ml,{readOnly:m,checked:u,checkoutLocalization:i,onSelect:function(){return p(!0)},onBillingAddressChange:t,collectPhoneNumber:n}))}var hl=function(e){return a.createElement(M,{className:"stigg-checkout-change-plan-button",sx:{textTransform:"none"},variant:"text",size:e.size,onClick:e.onClick},a.createElement(ke,{className:"stigg-checkout-change-plan-button-text",color:"primary.main",variant:"h3",style:{lineHeight:"24px"}},e.checkoutLocalization.changePlan))};function fl(e){var t=e.allowChangePlan,n=void 0!==t&&t,r=e.onChangePlan,i=pa(),o=i.checkoutLocalization,l=(i.checkoutState||{}).plan;return a.createElement(a.Fragment,null,a.createElement(U,{sx:{marginBottom:"16px"}},a.createElement(ke,{variant:"body1",color:"disabled",style:{opacity:.6,marginBottom:"8px"}},"Selected plan"),a.createElement(U,{sx:{display:"flex",justifyContent:"space-between"}},a.createElement(ke,{variant:"h1"},null==l?void 0:l.displayName),n&&r&&a.createElement(hl,{onClick:function(){r({currentPlan:l})},checkoutLocalization:o,size:"medium"}))),a.createElement(W,{className:"stigg-checkout-plan-header-divider"}))}function yl(e){switch(e){case n.BillingPeriod.Annually:return"Annual";case n.BillingPeriod.Monthly:return"Monthly";default:return""}}var vl,bl=o(U,{target:"ekae5v44"})({name:"1k6141t",styles:"margin:16px 0"}),xl=o("button",{target:"ekae5v43"})("cursor:",(function(e){return e.$disabled||e.$isOnlyBillingPeriod?"default":"pointer"}),";flex:1;display:flex;align-items:center;justify-content:flex-start;padding:2px 8px;border-radius:10px;border:",(function(e){var t=e.theme,n=t.stigg.palette.outlinedBorder;return e.$isOnlyBillingPeriod?n="transparent":e.$isActive&&(n=t.stigg.palette.outlinedRestingBorder),"1px solid "+n}),";background:",(function(e){return e.$isOnlyBillingPeriod?"transparent":e.$isActive?d(e.theme.stigg.palette.primary).alpha(.15).toString():"transparent"}),";text-transform:none;text-align:start;height:36px;&.MuiButton-root{padding:0 16px 0 8px;&:hover{background:none;}}"),El=o(U,{target:"ekae5v42"})({name:"1neb8ay",styles:"display:flex;gap:16px;margin-top:16px"}),wl=function(e){var t=e.billingPeriod,n=e.isOnlyBillingPeriod,r=ba(),i=r.setBillingPeriod,o=r.billingPeriod===t;return a.createElement(xl,{onClick:function(){return i(t)},$isActive:o,$isOnlyBillingPeriod:n},a.createElement(le,{checked:o,onChange:function(){return i(t)},value:t,disabled:n,inputProps:{"aria-label":yl(t)},sx:{padding:0,marginRight:"8px"}}),a.createElement(U,null,a.createElement(ke,{variant:"h3",color:"primary"},yl(t))))};function kl(e){var t=e.plan,r=e.checkoutLocalization,i=s.partition(null==t?void 0:t.pricePoints,(function(e){return e.billingPeriod===n.BillingPeriod.Monthly})),o=i[0],c=i[1],u=!(null==o||!o.length||null==c||!c.length);return u?a.createElement(bl,null,a.createElement(ke,{variant:"h6",color:"primary",fontWeight:l.FontWeight.Medium},r.billingPeriodsTitle),a.createElement(El,null,!(null==o||!o.length)&&a.createElement(wl,{key:n.BillingPeriod.Monthly,billingPeriod:n.BillingPeriod.Monthly,isOnlyBillingPeriod:!u}),!(null==c||!c.length)&&a.createElement(wl,{key:n.BillingPeriod.Annually,billingPeriod:n.BillingPeriod.Annually,isOnlyBillingPeriod:!u}))):null}var Pl=te.div(vl||(vl=me(["\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n min-height: 60px;\n margin-top: 16px;\n"]))),Cl=function(e,t){var n=e.minUnitQuantity,r=e.maxUnitQuantity;return!t||t<(n||1)?"Minimum "+(n||1):r&&t>r?"Maximum "+r:""};function Sl(e){var t,r,i,o,l,c,s=e.charge,u=e.isValid,d=e.setBillableFeature,m=e.billableFeature,p=e.onValidationChange,g=null==(t=s.feature)?void 0:t.featureId,h=!g,f=s.pricingModel===n.BillingModel.UsageBased,y=h?"Base charge":Ji((null==(r=s.feature)?void 0:r.displayName)||"",null==(i=s.feature)?void 0:i.units,null==(o=s.feature)?void 0:o.unitsPlural),v=!!(null!=s&&s.minUnitQuantity||null!=s&&s.maxUnitQuantity);if(h||f)c=""+Xe({amount:s.amount,currency:s.currency,locale:"en-us",minimumFractionDigits:2}),f&&(c+=" / unit");else if(s.isTieredPrice&&g){var b=je(s.tiers,m.quantity||1);c=a.createElement(nt,{componentId:g+"-tiers",tiers:s.tiers,selectedTier:b,handleTierChange:function(e){d(g,e.upTo)}})}else{var x;c=a.createElement(eo,{sx:{width:120},id:g+"-input",type:"number",error:!u,helperText:u?void 0:Cl(s,null==m?void 0:m.quantity),FormHelperTextProps:{sx:{margin:"4px"}},value:null!=(x=null==m?void 0:m.quantity)?x:"",onChange:function(e){var t,n;if(!h&&g){var r=s.minUnitQuantity,i=s.maxUnitQuantity,a=null!=e&&null!=(t=e.target)&&t.value?Number(null==e||null==(n=e.target)?void 0:n.value):null;if(!a||a<=0||r&&a<r||i&&a>i)return p({featureId:g,isValid:!1}),void d(g,null!=a?a:null);p({featureId:g,isValid:!0});var o=ha(s,a);d(g,o)}},onWheel:function(e){return e.target.blur()}})}return a.createElement(Pl,null,a.createElement(U,{display:"flex",flexDirection:"column"},a.createElement(ke,{variant:"h6",color:"primary",lineHeight:"24px"},y),v&&a.createElement(ke,{variant:"body1",color:"secondary",lineHeight:"20px"},ye(s.minUnitQuantity,s.maxUnitQuantity,null==(l=s.feature)?void 0:l.unitsPlural))),a.createElement(ke,{variant:"h6",color:"primary"},c))}function Tl(e){var t,n=e.plan,r=e.billingPeriod,o=ba(),l=o.billableFeatures,c=o.setBillableFeature,s=Ca().setIsDisabled,u=pa().setIsValid,d=Qa((null==n||null==(t=n.pricePoints)?void 0:t.filter((function(e){return e.billingPeriod===r})))||[]),m=i.useState(null==d?void 0:d.reduce((function(e,t){var n;return e[(null==(n=t.feature)?void 0:n.featureId)||"base-charge"]=!0,e}),{})),p=m[0],g=m[1];return i.useEffect((function(){var e=Object.values(p).some((function(e){return!e}));s(e),u(!e)}),[p,s,u]),a.createElement("div",null,null==d?void 0:d.map((function(e){var t,n,r=l.find((function(t){var n;return t.featureId===(null==(n=e.feature)?void 0:n.featureId)}));return a.createElement(Sl,{key:(null==(t=e.feature)?void 0:t.featureId)||"base-charge",charge:e,setBillableFeature:c,billableFeature:r,isValid:p[(null==(n=e.feature)?void 0:n.featureId)||"base-charge"],onValidationChange:function(e){var t=e.featureId,n=e.isValid;return g((function(e){var r;return ue({},e,((r={})[t]=n,r))}))}})})))}var Bl,Ml=o(U,{target:"emtnukp0"})({name:"1d3w5wq",styles:"width:100%"}),Al=function(e){var t=e.onChangePlan,n=pa(),r=n.checkoutLocalization,i=(n.checkoutState||{}).plan,o=ba().billingPeriod;return a.createElement(a.Fragment,null,a.createElement(fl,{allowChangePlan:!0,onChangePlan:t}),a.createElement(Ml,null,a.createElement(kl,{plan:i,checkoutLocalization:r}),a.createElement(Tl,{plan:i,billingPeriod:o})))};function Ul(){return(Ul=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var Ll=o((function(e){return i.createElement("svg",Ul({width:16,height:16,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),Bl||(Bl=i.createElement("g",{stroke:"#7586B0",strokeWidth:1.333,strokeLinecap:"round",strokeLinejoin:"round"},i.createElement("path",{d:"M2.667 8h10.667M9.333 4l4 4-4 4"}))))}),{target:"e8986nu0"})("path{stroke:",(function(e){return e.theme.stigg.palette.text.secondary}),";}"),Fl=o(U,{target:"eaawmuo2"})({name:"zjik7",styles:"display:flex"}),Nl=o(ae,{target:"eaawmuo1"})({name:"18uqayh",styles:"margin-bottom:16px"}),Il=o(U,{target:"eaawmuo0"})("padding:16px;border-radius:10px;width:100%;border:",(function(e){return"1px solid "+e.theme.stigg.palette.outlinedBorder}),";"),Dl=function(e){var t=e.planName,n=e.priceText;return a.createElement(Il,{className:"stigg-checkout-downgrade-to-free-container"},a.createElement(ke,{className:"stigg-checkout-downgrade-to-free-text-header",style:{opacity:.8},variant:"caption",color:"disabled"},e.headerText),a.createElement(ke,{className:"stigg-checkout-downgrade-to-free-plan-name",bold:!0,variant:"h3",color:"primary"},t),a.createElement(ke,{className:"stigg-checkout-downgrade-to-free-price-text",color:"secondary"},n))},Ol=function(e){var t,n=e.checkoutLocalization,r=e.activeSubscription,i=e.freePlan,o=e.allowChangePlan,l=e.onChangePlan;void 0!==o&&o&&l&&(t=a.createElement(hl,{onClick:function(){l({currentPlan:i})},checkoutLocalization:n,size:"small"}));var c=r.prices.length>0?r.prices[0].billingPeriod:void 0;return a.createElement(a.Fragment,null,a.createElement(Nl,{action:t,className:"stigg-checkout-downgrade-to-free-alert",severity:"info"},a.createElement(ke,{span:!0,color:"secondary"},n.downgradeToFree.alertText({plan:r.plan}))),a.createElement(Fl,{className:"stigg-checkout-downgrade-to-free-plans-container"},a.createElement(Dl,{headerText:n.downgradeToFree.paidPlanHeader({plan:r.plan}),planName:n.downgradeToFree.paidPlanName({plan:r.plan}),priceText:n.downgradeToFree.paidPlanPriceText({plan:r.plan,billingPeriod:c})}),a.createElement(Ll,{className:"stigg-checkout-downgrade-to-free-arrow",style:{margin:"auto 16px",minWidth:"16px"}}),a.createElement(Dl,{headerText:n.downgradeToFree.freePlanHeader({plan:i}),planName:n.downgradeToFree.freePlanName({plan:i}),priceText:n.downgradeToFree.freePlanPriceText({plan:i})})))};function jl(e){var t=e.onCheckout,r=e.onCheckoutCompleted,o=e.onChangePlan,l=e.onBillingAddressChange,c=e.collectPhoneNumber,s=e.disablePromotionCode,u=e.disableSuccessAnimation,d=e.onMockCheckoutPreview,m=function(){var e=i.useState(null),t=e[0],r=e[1],a=pa().checkoutState||{},o=a.billingIntegration,l=a.setupSecret;return i.useEffect((function(){if(o){var e=o.credentials;if(o.billingIdentifier!==n.BillingVendorIdentifier.Stripe)return void console.error("Currently only stripe integration is supported");r(re.loadStripe(e.publicKey,{stripeAccount:e.accountId}))}}),[o]),{stripePromise:t,setupIntentClientSecret:l}}(),p=m.stripePromise,g=m.setupIntentClientSecret,h=Na()[0],f=h.stiggTheme,y=h.widgetState,v=Ca().currentStep,b=y.isLoadingCheckoutData,x=pa(),E=x.checkoutLocalization,w=x.checkoutState||{},k=w.plan,P=w.activeSubscription,C=!!k&&k.pricingType===n.PricingType.Free&&!!P&&P.pricingType!==n.PricingType.Free,S=function(e,t){var n=t.onBillingAddressChange,r=t.onChangePlan,i=t.collectPhoneNumber;switch(e.key){case ga.PLAN:return{content:a.createElement(Al,{onChangePlan:r})};case ga.ADDONS:return{content:a.createElement(il,null)};case ga.PAYMENT:return{content:a.createElement(gl,{onBillingAddressChange:n,collectPhoneNumber:i})};default:return{content:null}}}(v,{onBillingAddressChange:l,onChangePlan:o,collectPhoneNumber:c}).content,T=a.createElement(a.Fragment,null,C?a.createElement(Ol,{freePlan:k,activeSubscription:P,allowChangePlan:!0,checkoutLocalization:E,onChangePlan:o}):a.createElement(a.Fragment,null,S)),B=i.useMemo((function(){return g?{clientSecret:g}:{mode:"setup",currency:"usd"}}),[g]);return a.createElement(Q.Elements,{key:g,stripe:p,options:ue({},B,{appearance:{theme:"stripe",variables:{colorText:f.palette.text.primary,colorPrimaryText:f.palette.text.primary,colorTextPlaceholder:f.palette.text.disabled,fontFamily:f.typography.fontFamily}}})},a.createElement(ja,{className:"stigg-checkout-layout"},!C&&a.createElement(Ga,null),a.createElement(qa,null,a.createElement(Ra,null,b?a.createElement(no,null):T),b?a.createElement(Jo,null):a.createElement(Xo,{disablePromotionCode:s,disableSuccessAnimation:u,onCheckout:t,onCheckoutCompleted:r,isFreeDowngrade:C,onMockCheckoutPreview:d}))))}var ql,Rl=["textOverrides","theme","resourceId","planId","preferredBillingPeriod","billingCountryCode","billableFeatures","billingInformation","onMockCheckoutState"];(ql=exports.ProvisionStatus||(exports.ProvisionStatus={})).IN_PROGRESS="IN_PROGRESS",ql.SUCCEEDED="SUCCEEDED",ql.FAILED="FAILED",Object.keys(n).forEach((function(e){"default"!==e&&Object.defineProperty(exports,e,{enumerable:!0,get:function(){return n[e]}})})),exports.AddonsList=En,exports.Checkout=function(e){var t=e.textOverrides,n=e.theme,r=e.resourceId,i=e.planId,o=e.preferredBillingPeriod,l=e.billingCountryCode,c=e.billableFeatures,s=e.billingInformation,u=e.onMockCheckoutState,d=de(e,Rl);return a.createElement(Da,{textOverrides:t,theme:n,resourceId:r,planId:i,preferredBillingPeriod:o,billingCountryCode:l,billableFeatures:c,billingInformation:s,onMockCheckoutState:u},a.createElement(jl,Object.assign({},d)))},exports.CustomerPortal=function(e){var t=e.textOverrides,n=e.theme,r=e.resourceId,i=e.productId,o=de(e,oa);return a.createElement(mn,{textOverrides:t,theme:n,resourceId:r,productId:i},a.createElement(aa,Object.assign({},o)))},exports.CustomerPortalProvider=mn,exports.CustomerUsageData=ia,exports.InvoicesSection=la,exports.PaymentDetailsSection=Gi,exports.Paywall=function(e){var t=e.productId,r=e.resourceId,o=e.highlightedPlanId,l=e.showOnlyEligiblePlans,c=e.textOverrides,s=e.onPlanSelected,u=e.preferredBillingPeriod,d=e.onBillingPeriodChange,h=e.billingCountryCode,f=!!i.useContext(un),y=!1;if(f){var v=dn();y=v.isLoading,r=v.resourceId}var b=function(e){var t=e.productId,r=e.resourceId,a=e.showOnlyEligiblePlans,o=e.billingCountryCode,l=e.preferredBillingPeriod,c=Rt(),s=c.stigg,u=c.locale,d=i.useState(n.BillingPeriod.Annually),m=d[0],h=d[1],f=i.useState([]),y=f[0],v=f[1],b=i.useState(null),x=b[0],E=b[1],w=i.useState(!0),k=w[0],C=w[1];i.useEffect((function(){!function(){var e=se(Ot.mark((function e(){var n,i,a,c;return Ot.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,C(!0),e.next=4,s.waitForInitialization();case 4:return e.next=6,s.getPaywall({productId:t,resourceId:r,billingCountryCode:o});case 6:i=Wt((n=e.sent).plans,n.activeSubscriptions,l),a=i.availableBillingPeriods,c=i.defaultBillingPeriod,E(n),v(a),h(c),e.next=16;break;case 13:e.prev=13,e.t0=e.catch(0),jt.error("Failed to load paywall "+(null==e.t0?void 0:e.t0.message),e.t0);case 16:return e.prev=16,C(!1),e.finish(16);case 19:case"end":return e.stop()}}),e,null,[[0,13,16,19]])})));return function(){return e.apply(this,arguments)}}()()}),[s,t,s.isCustomerLoaded,o,r]);var S=function(e,t){var r,i=e||{},a=i.plans,o=i.currency,l=i.configuration,c=i.customer,s=i.paywallCalculatedPricePoints,u=function(e){var t,r,i,a=!0,o=(null==e?void 0:e.find((function(e){return e.status===n.SubscriptionStatus.InTrial})))||null,l=null==(t=o)?void 0:t.plan,c=null!=(r=o)&&r.trialEndDate?p.utc(o.trialEndDate).diff(p.utc(),"days",!1)+1:void 0;return l||(a=!1,l=null==(i=o=(null==e?void 0:e.find((function(e){return e.status===n.SubscriptionStatus.Active})))||null)?void 0:i.plan),{currentSubscription:o,currentPlan:l,isCustomerOnTrial:a,trialDaysLeft:c}}(i.activeSubscriptions),d=u.currentSubscription,m=u.currentPlan,h=u.isCustomerOnTrial,f=u.trialDaysLeft,y=(null==d?void 0:d.scheduledUpdates)||[],v=null==d||null==(r=d.price)?void 0:r.billingPeriod,b=y.find((function(e){return e.subscriptionScheduleType===n.SubscriptionScheduleType.Downgrade})),x=y.find((function(e){return e.subscriptionScheduleType===n.SubscriptionScheduleType.BillingPeriod})),E=P(a,(function(e){return e.order})).map((function(e){var t,n=null==c||null==(t=c.eligibleForTrial)?void 0:t.find((function(t){return t.productId===e.product.id})),r=e.id===(null==m?void 0:m.id);return ue({},e,{paywallCalculatedPricePoints:null==s?void 0:s.filter((function(t){return t.planId===e.id})),isTriable:!g(e.defaultTrialConfig)&&(!n||n.eligible),isCurrentCustomerPlan:r,currentCustomerPlanBillingPeriod:v,isUpcomingPlan:!1,trialDaysLeft:f,isNextPlan:function(t){var n,i=null==b?void 0:b.scheduleVariables,a=null==x?void 0:x.scheduleVariables,o=e.pricePoints.some((function(e){return e.billingPeriod===t}));return b?(null==(n=b.targetPackage)?void 0:n.refId)===e.id&&(!o||i.billingPeriod===t):!(!x||!r)&&a.billingPeriod===t},paywallCurrency:o,scheduledUpdate:b||x})}));if(a&&m){var w,k=m&&(null==a||null==(w=a.find((function(e){return e.id===(null==m?void 0:m.id)})))?void 0:w.order);g(k)||(E=E.map((function(e){return ue({},e,{isLowerThanCurrentPlan:k>e.order})})),t&&(E=E.filter((function(e){return e.order>k}))))}var C=l?function(e){var t=e.palette,n=e.layout;return{customCss:e.customCss||void 0,palette:{primary:(null==t?void 0:t.primary)||void 0,backgroundPaper:(null==t?void 0:t.backgroundColor)||void 0,outlinedBorder:(null==t?void 0:t.borderColor)||void 0,backgroundHighlight:(null==t?void 0:t.currentPlanBackground)||void 0,text:{primary:(null==t?void 0:t.textColor)||void 0}},typography:Vt(e.typography),layout:{ctaAlignment:$t(null==n?void 0:n.alignment),headerAlignment:$t(null==n?void 0:n.alignment),descriptionAlignment:$t(null==n?void 0:n.alignment),planMaxWidth:_t(null==n?void 0:n.planWidth),planMinWidth:_t(null==n?void 0:n.planWidth),planMargin:_t(null==n?void 0:n.planMargin),planPadding:_t(null==n?void 0:n.planPadding)}}}(l):void 0;return{currentPlan:m,currentSubscription:d,isCustomerOnTrial:h,plans:E,paywallConfiguration:C}}(x,a);return ue({customer:(null==x?void 0:x.customer)||null,isLoading:k,selectedBillingPeriod:m,setSelectedBillingPeriod:h,availableBillingPeriods:y,locale:u,configuration:S.paywallConfiguration},S)}({productId:t,resourceId:r,showOnlyEligiblePlans:l,billingCountryCode:h,preferredBillingPeriod:u}),x=b.plans,E=b.customer,w=b.currentSubscription,k=b.isCustomerOnTrial,C=b.isLoading,S=b.selectedBillingPeriod,T=b.setSelectedBillingPeriod,B=b.availableBillingPeriods,M=b.locale,A=b.configuration,U=m({highlightChip:"Recommended",planCTAButton:{upgrade:"Upgrade",downgrade:"Downgrade",startTrial:function(e){var t;return"Start "+(null==(t=e.defaultTrialConfig)?void 0:t.duration)+" day trial"},custom:"Contact us",currentPlan:"Current plan",startNew:"Get started",switchToBillingPeriod:function(e){return e===n.BillingPeriod.Monthly?"Switch to monthly billing":"Switch to annual billing"},cancelScheduledUpdate:"Cancel"},price:{startingAtCaption:"Starts at",pricePeriod:function(e){return e===n.BillingPeriod.Monthly?"/ month":"/ year"},free:function(e){return{price:(null==e?void 0:e.symbol)+"0"}},custom:"Custom",priceNotSet:"Price not set"}},c),L=!x||C||y?a.createElement(nn,null):a.createElement(Dt,{plans:x,customer:E,currentSubscription:w,selectedBillingPeriod:S,onBillingPeriodChanged:function(e){T(e),d&&d(e)},availableBillingPeriods:B,highlightedPlanId:o,isLoading:C,isCustomerOnTrial:k,onPlanSelected:s,paywallLocale:U,locale:M});return f?L:a.createElement(sn,{componentTheme:A},L)},exports.Promotions=kn,exports.StiggContext=qt,exports.StiggProvider=function(e){var t=e.apiKey,n=e.baseUri,o=e.baseEdgeUri,l=e.enableEdge,c=e.customerId,s=e.customerToken,u=e.resourceId,d=e.theme,m=e.locale,p=e.useEntitlementPolling,g=e.entitlementPollingInterval,h=e.entitlementsFallback,f=e.stiggClient,y=e.children,v=i.useRef(t),b={apiKey:t,customerId:c,customerToken:s,resourceId:u,baseUri:n,baseEdgeUri:o,enableEdge:l,entitlementsFallback:h,useEntitlementPolling:p,entitlementPollingInterval:g},x=i.useState((function(){return{stigg:null!=f?f:r.initialize(ue({},b,{lazyLoad:!0})),locale:m||"en-US",isInitialized:!1,theme:d,refreshData:(e=se(Ot.mark((function e(){return Ot.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return k((function(e){return ue({},e,{customerPortalUpdatedAt:new Date})})),e.next=3,E.stigg.refresh();case 3:case"end":return e.stop()}}),e)}))),function(){return e.apply(this,arguments)})};var e})),E=x[0],k=x[1];return i.useEffect((function(){var e=!0,n=function(t){e&&k(t)},i=function(){return n((function(e){return ue({},e,{updatedAt:new Date})}))},a=function(e){return n((function(t){return t.stigg&&t.stigg.removeListener("entitlementsUpdated",i),e.addListener("entitlementsUpdated",i),ue({},t,{stigg:e,isInitialized:!0,updatedAt:new Date})}))};return function(){var e=se(Ot.mark((function e(){var i;return Ot.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=E.stigg,t!==v.current&&(jt.log("Updating stigg client",{apiKey:t}),v.current=t,i=r.initialize(ue({},b)),n((function(e){return ue({},e,{isInitialized:!1,updatedAt:new Date})}))),e.next=4,i.waitForInitialization();case 4:a(i);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()(),function(){e=!1,E.stigg.removeListener("entitlementsUpdated",i),E.stigg.clearCustomer()}}),[t]),i.useEffect((function(){var e=E.stigg;c?e.setCustomerId(c,s,u):e.clearCustomer()}),[c,s,u]),i.useEffect((function(){k((function(e){return ue({},e,{theme:d})}))}),[d]),a.createElement(qt.Provider,{value:E},a.createElement(w.SkeletonTheme,{baseColor:"#F5F6F9",highlightColor:"#e5e6ea"},y))},exports.SubscriptionsOverview=Oi,exports.useStiggContext=Rt,exports.useWaitForCheckoutCompleted=function(e){var t,n=void 0===e?{}:e,r=n.onProvisionStart,a=n.onProvisionSucceeded,o=n.onProvisionFailed,l=Rt().stigg,c=i.useState(exports.ProvisionStatus.IN_PROGRESS),s=c[0],u=c[1],d=i.useState(!1),m=d[0],p=d[1],g=i.useMemo((function(){var e=new URLSearchParams(window.location.search);return t?e.get(t):e}),[t="checkoutCompleted",window.location.search]);return i.useEffect((function(){!function(){var e=se(Ot.mark((function e(){var t;return Ot.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(g&&"false"!==g.toLowerCase()&&!m){e.next=2;break}return e.abrupt("return");case 2:return p(!0),r&&r(),e.prev=4,e.next=7,l.waitForCheckoutCompleted();case 7:t=e.sent,u(exports.ProvisionStatus.SUCCEEDED),a&&a(t),e.next=17;break;case 12:e.prev=12,e.t0=e.catch(4),console.error("Failed to wait for checkout to complete",e.t0),u(exports.ProvisionStatus.FAILED),o&&o(e.t0);case 17:return e.prev=17,p(!1),e.finish(17);case 20:case"end":return e.stop()}}),e,null,[[4,12,17,20]])})));return function(){return e.apply(this,arguments)}}()()}),[l,g]),{isAwaitingCheckout:m,provisionStatus:s}};
|
|
1
|
+
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var t,n=require("@stigg/js-client-sdk"),r=e(n),i=require("react"),a=e(i),o=e(require("@emotion/styled/base")),l=e(require("classnames")),c=e(require("@mui/material/Grid")),s=require("styled-typography"),u=require("@emotion/react"),d=require("lodash"),m=e(require("react-spinners/ClipLoader")),p=e(require("color")),g=e(require("lodash/merge")),h=e(require("moment")),f=e(require("lodash/isNil")),y=e(require("currency-symbol-map")),v=e(require("@mui/material/MenuItem")),b=e(require("@mui/material/OutlinedInput")),x=e(require("@mui/material/Select")),E=e(require("react-switch")),w=require("react-loading-skeleton"),k=e(w),P=e(require("lodash/sortBy")),C=require("styled-components"),S=e(C),T=require("@mui/material/styles"),B=require("@mui/material/Button"),M=e(B),A=e(require("lodash/flatMap")),U=e(require("@mui/material/Box")),L=e(require("@mui/material/Tab")),F=e(require("lodash/isEmpty")),N=e(require("@mui/material/Tabs")),I=require("react-feather"),D=e(require("@mui/material/Link")),O=require("@mui/material/Tooltip"),j=e(O),q=require("@mui/material/LinearProgress"),R=e(q),W=e(require("@mui/material/Divider")),z=e(require("lodash/isUndefined")),_=e(require("lodash/lowerCase")),H=require("immer"),V=e(require("lodash/cloneDeep")),$=e(require("lodash/remove")),Z=e(require("lodash/keyBy")),G=e(require("lodash/compact")),Y=require("@stigg/api-client-js/src/generated/sdk"),Q=require("@stripe/react-stripe-js"),K=e(require("@mui/material/StepIcon")),X=e(require("lodash/partition")),J=e(require("@mui/material/CircularProgress")),ee=e(require("@mui/material/Paper")),te=e(require("@emotion/styled")),ne=e(require("@mui/material/TextField")),re=require("@stripe/stripe-js"),ie=e(require("react-lottie")),ae=e(require("@mui/material/Alert")),oe=e(require("@mui/material/Collapse")),le=e(require("@mui/material/Radio"));function ce(e,t,n,r,i,a,o){try{var l=e[a](o),c=l.value}catch(e){return void n(e)}l.done?t(c):Promise.resolve(c).then(r,i)}function se(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var a=e.apply(t,n);function o(e){ce(a,r,i,o,l,"next",e)}function l(e){ce(a,r,i,o,l,"throw",e)}o(void 0)}))}}function ue(){return(ue=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function de(e,t){if(null==e)return{};var n,r,i={},a=Object.keys(e);for(r=0;r<a.length;r++)t.indexOf(n=a[r])>=0||(i[n]=e[n]);return i}function me(e,t){return t||(t=e.slice(0)),e.raw=t,e}function pe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function ge(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return pe(e,void 0);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?pe(e,void 0):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function he(){return(he=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}require("@mui/material/Chip");var fe=function(e){return i.createElement("svg",he({width:15,height:11,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),t||(t=i.createElement("path",{d:"M5.59 7.99 2.125 4.525A1 1 0 1 0 .71 5.94l4.88 4.88 8.705-8.705a.997.997 0 0 0-1.41-1.41L5.59 7.99Z",fill:"#B2BBD3"})))};function ye(e,t,n){var r=n?" "+n:"";return e&&1!==e||!t?e&&e>1&&t?e+"-"+t+r:e&&e>1?"Minimum "+e+r:"":"Up to "+t+r}var ve=["children","span","style","fontWeight","variant","color","overrideColor","bold"];function be(e,t){switch(t){case"white":return"white";case"primary.main":return e.stigg.palette.primary;case"primary.main.light":return e.stigg.palette.primaryLight;case"warning":return e.stigg.palette.warning;case"error":return e.stigg.palette.error;default:return e.stigg.palette.text[t]}}var xe=o(s.Text,{target:"ewjez2x0"})("margin:0;",(function(e){return e.$span&&"display: inline"}),";");function Ee(e){switch(e){case"bold":return s.FontWeight.Bold;case"normal":default:return s.FontWeight.Normal}}function we(e,t){var n=e.stigg.typography;switch(t){case"h1":return Ee(n.h1.fontWeight);case"h3":return Ee(n.h2.fontWeight);case"h6":return Ee(n.h3.fontWeight);case"body1":return Ee(n.body.fontWeight);case"caption":return Ee(n.caption.fontWeight);default:return s.FontWeight.Normal}}var ke=i.forwardRef((function(e,t){var n=e.children,r=e.span,i=e.style,o=e.fontWeight,l=e.variant,c=void 0===l?"body1":l,d=e.color,m=void 0===d?"primary":d,p=e.overrideColor,g=e.bold,h=de(e,ve),f=u.useTheme(),y=function(e){switch(e){case"h1":return 1;case"h3":return 2;case"h6":return 3;case"body1":return 4;case"caption":return 5;default:return 3}}(c),v="typography-level-"+y;return a.createElement(xe,Object.assign({ref:t},h,{className:e.className?e.className+" "+v:v,style:i,level:y,color:p||be(f,m),fontWeight:null!=o?o:g?s.FontWeight.Bold:we(f,c),$span:r}),n)})),Pe=["displayNameOverride"],Ce=o(ke,{target:"e1mddeqb2"})({name:"ti75j2",styles:"margin:0"}),Se=o("div",{target:"e1mddeqb1"})({name:"s5xdrg",styles:"display:flex;align-items:center"}),Te=o(fe,{target:"e1mddeqb0"})("margin-right:16px;flex-shrink:0;*{fill:",(function(e){return e.theme.stigg.palette.text.disabled}),";}");function Be(e){var t=e.displayNameOverride,r=function(e){var t=e.hasUnlimitedUsage,r=e.feature,i=e.resetPeriod,a=e.usageLimit,o=e.minUnitQuantity,l=e.maxUnitQuantity,c=e.isCustom,s=o||l,u=i&&a?""+function(e){if(!e)return"";switch(e){case n.EntitlementResetPeriod.Day:return"per day";case n.EntitlementResetPeriod.Hour:return"per hour";case n.EntitlementResetPeriod.Week:return"per week";case n.EntitlementResetPeriod.Month:return"per month"}}(i):"";if(t)return"Unlimited "+(null==r?void 0:r.unitsPlural);if(c)return"Custom "+(null==r?void 0:r.unitsPlural);if(a){var d=1===a?null==r?void 0:r.units:null==r?void 0:r.unitsPlural;return function(e){return e.toLocaleString("en-US",{maximumFractionDigits:0})}(a)+" "+d+" "+u}return s?ye(o,l,null==r?void 0:r.unitsPlural):null==r?void 0:r.displayName}(de(e,Pe));return a.createElement(Se,{className:"stigg-entitlement-row-container"},a.createElement(Te,{className:"stigg-entitlement-row-icon"}),a.createElement(Ce,{className:"stigg-entitlement-name",variant:"h6",color:"secondary"},t||r))}var Me,Ae=o("div",{target:"e1yz7zcg0"})({name:"budh8k",styles:"display:flex;flex-direction:column;gap:16px"});function Ue(e){var t,r=e.plan,i=e.billingPeriod,o=e.paywallLocale,l=null==(t=r.pricePoints)?void 0:t.filter((function(e){return e.billingPeriod===i})),c=null==l?void 0:l.map((function(e){var t;return(null==e?void 0:e.minUnitQuantity)&&(null==e?void 0:e.minUnitQuantity)>1||(null==e?void 0:e.maxUnitQuantity)?a.createElement(Be,{key:"priceUnitEntitlement-"+(null==e||null==(t=e.feature)?void 0:t.displayName),feature:null==e?void 0:e.feature,minUnitQuantity:null==e?void 0:e.minUnitQuantity,maxUnitQuantity:null==e?void 0:e.maxUnitQuantity}):null}));return a.createElement(Ae,{className:"stigg-plan-entitlements-container"},a.createElement(ke,{className:"stigg-plan-entitlements-title",color:"secondary",variant:"h6",bold:!0},function(e,t){if(t.entitlementsTitle)return t.entitlementsTitle(e);var n=e.displayName+" includes";return e.basePlan&&(n="Everything in "+e.basePlan.displayName+", plus:"),n}(r,o)),c,r.entitlements.filter((function(e){return!(e.hiddenFromWidgets||[]).includes(n.WidgetType.Paywall)})).map((function(e){var t;return a.createElement(Be,{key:null==(t=e.feature)?void 0:t.id,displayNameOverride:e.displayNameOverride,feature:e.feature,resetPeriod:e.resetPeriod,hasUnlimitedUsage:e.hasUnlimitedUsage,usageLimit:e.usageLimit,isCustom:e.isCustom})})))}(Me=exports.SubscribeIntentionType||(exports.SubscribeIntentionType={})).START_TRIAL="START_TRIAL",Me.UPGRADE_TRIAL_TO_PAID="UPGRADE_TRIAL_TO_PAID",Me.REQUEST_CUSTOM_PLAN_ACCESS="REQUEST_CUSTOM_PLAN_ACCESS",Me.CHANGE_BILLING_PERIOD="CHANGE_BILLING_PERIOD",Me.CHANGE_UNIT_QUANTITY="CHANGE_UNIT_QUANTITY",Me.UPGRADE_PLAN="UPGRADE_PLAN",Me.DOWNGRADE_PLAN="DOWNGRADE_PLAN",Me.CANCEL_SCHEDULED_UPDATES="CANCEL_SCHEDULED_UPDATES";var Le,Fe,Ne=function(e){return{left:"flex-start",center:"center",right:"flex-end"}[e]},Ie=function(e){return h.utc(e).format("MMMM Do, yyyy")};function De(e){var t=e.scheduledUpdate,r=e.subscriptionPrices,i=e.billingPeriodRange,o=e.options,l=void 0===o?{}:o;if(!t)return{};var c=l.withDate,s=l.postfix,u=void 0===s?"":s;switch(t.subscriptionScheduleType){case n.SubscriptionScheduleType.Downgrade:var m,p=c;return f(p)&&null!=i&&i.end&&(p=!h(t.scheduledExecutionTime).isSame(null==i?void 0:i.end,"day")),{line1:a.createElement(a.Fragment,null,"Your subscription will be downgraded to the ",a.createElement("b",null,null==(m=t.targetPackage)?void 0:m.displayName," plan")," ",p?a.createElement(a.Fragment,null,"on ",Ie(t.scheduledExecutionTime)):u,"."),line2:"Until then you still have access to your current plan."};case n.SubscriptionScheduleType.BillingPeriod:var g;return{line1:a.createElement(a.Fragment,null,"Your billing cycle will change to ",a.createElement("b",null,null==(g=t.scheduleVariables.billingPeriod)?void 0:g.toLocaleLowerCase())," ",c?a.createElement(a.Fragment,null,"on ",Ie(t.scheduledExecutionTime)):u,".")};case n.SubscriptionScheduleType.UnitAmount:var y=t.scheduleVariables,v=d.compact(d.map(r,"feature")).find((function(e){return e.id===y.featureId}))||{},b=v.featureUnits,x=1===y.newUnitAmount?b:v.featureUnitsPlural;return{line1:a.createElement(a.Fragment,null,"Your subscription will be updated to ",a.createElement("b",null,y.newUnitAmount)," ",x," ",c?a.createElement(a.Fragment,null,"on ",Ie(t.scheduledExecutionTime)):u,"."),line2:"Until then you still have access to your current "+b+" count."};default:return{}}}function Oe(e){return e.feature&&(1!=e.feature.unitQuantity?e.feature.unitsPlural:e.feature.units)||""}function je(e,t){if(e){var n=[].concat(e);n.sort((function(e,t){return e.upTo-t.upTo}));for(var r,i=ge(n);!(r=i()).done;){var a=r.value;if(t<=a.upTo)return a}return n[n.length-1]}}function qe(e,t,r,i){switch(e.tiersMode){case n.TiersMode.Volume:return(r===n.BillingPeriod.Annually&&i?t.unitPrice.amount/12:t.unitPrice.amount)*t.upTo}return 0}function Re(e,t,r,i){var a=e.pricePoints.filter((function(e){return e.billingPeriod===t&&e.isTieredPrice}));if(1==a.length){var o,l=a[0],c=l.feature.featureId,s=l.tiers[0];if(i[c])s=(null==(o=l.tiers)?void 0:o.find((function(e){return e.upTo===i[c].upTo})))||s;else if(r){var u=r.prices.find((function(e){var t;return e.pricingModel==n.BillingModel.PerUnit&&e.tiersMode&&(null==(t=e.feature)?void 0:t.featureId)===c}));u&&(s=je(l.tiers,u.feature.unitQuantity||1))}var d={};return d[c]=s,d}return{}}!function(e){e[e.Lower=-1]="Lower",e[e.Equal=0]="Equal",e[e.Higher=1]="Higher"}(Le||(Le={}));var We,ze=o(m,{target:"e199qof96"})({name:"1a2afmv",styles:"margin-left:10px"}),_e=o("button",{target:"e199qof95"})("cursor:",(function(e){return e.$disabled?"default":"pointer"}),";padding:8px 12px;background-color:",(function(e){return e.theme.stigg.palette.backgroundButton}),";border:",(function(e){return"1px solid "+e.theme.stigg.palette.outlinedRestingBorder}),";border-radius:10px;display:flex;align-items:center;justify-content:center;min-height:42px;min-width:120px;",(function(e){return e.$disabled&&u.css(Fe||(Fe=me(["\n opacity: 0.5;\n "])))})," &:hover{background-color:",(function(e){var t=e.theme;return e.$disabled?t.stigg.palette.backgroundButton:t.stigg.palette.outlinedHoverBackground}),";}"),He=o(ke,{target:"e199qof94"})({name:"h05omw",styles:"margin:0;font-size:15px"}),Ve=o(ke,{target:"e199qof93"})({name:"1cnls12",styles:"min-height:87px"}),$e=o("button",{target:"e199qof92"})("background:none;border:none;padding:0;color:",(function(e){return e.theme.stigg.palette.text.secondary}),";text-decoration:underline;cursor:pointer;"),Ze=o(ke,{target:"e199qof91"})({name:"1etgg0o",styles:"margin-top:8px;margin-bottom:17px;min-height:20px"}),Ge=o("div",{target:"e199qof90"})("display:flex;flex-direction:column;margin-top:4px;align-self:",(function(e){return Ne(e.theme.stigg.layout.ctaAlignment)}),";width:100%;");function Ye(e){var t=e.isNextPlan,r=e.customer,o=e.plan,l=e.billingPeriod,c=e.isCustomerOnTrial,s=e.onPlanSelected,m=e.paywallLocale,p=e.withTrialLeftRow,g=e.currentSubscription,h=e.selectedTierByFeature,f=u.useTheme(),y=i.useState(!1),v=y[0],b=y[1],x=m.planCTAButton,E=x.currentPlan,w=x.custom,k=x.downgrade,P=x.startTrial,C=x.upgrade,S=x.startNew,T=x.switchToBillingPeriod,B=x.cancelScheduledUpdate,M=d.isFunction(k)?k(o):k,A=d.isFunction(C)?C(o):C,U={title:r?o.isLowerThanCurrentPlan?M:A:S,disabled:!1,intentionType:o.isLowerThanCurrentPlan?exports.SubscribeIntentionType.DOWNGRADE_PLAN:c?exports.SubscribeIntentionType.UPGRADE_TRIAL_TO_PAID:exports.SubscribeIntentionType.UPGRADE_PLAN},L=o.pricingType===n.PricingType.Custom,F=De({scheduledUpdate:o.scheduledUpdate,options:{withDate:!0}}).line1;if(!o.isTriable||o.isCurrentCustomerPlan||c)if(o.isCurrentCustomerPlan&&!c)if(l===o.currentCustomerPlanBillingPeriod||o.pricingType&&[n.PricingType.Free,n.PricingType.Custom].includes(o.pricingType))switch(function(e,t){if(!t||!e)return Le.Equal;var r=t.prices.find((function(e){return e.pricingModel==n.BillingModel.PerUnit&&e.tiersMode}));if(!r)return Le.Equal;var i=r.feature,a=i.unitQuantity;if(!a)return Le.Equal;var o=e[i.featureId];return o?o.upTo<a?Le.Lower:o.upTo>a?Le.Higher:Le.Equal:Le.Equal}(h,g)){case Le.Lower:U.intentionType=exports.SubscribeIntentionType.CHANGE_UNIT_QUANTITY,U.title=M;break;case Le.Higher:U.intentionType=exports.SubscribeIntentionType.CHANGE_UNIT_QUANTITY,U.title=A;break;default:U.title=E,U.disabled=!0}else U.title=T(l),U.intentionType=exports.SubscribeIntentionType.CHANGE_BILLING_PERIOD;else L&&(U.title=w,U.intentionType=exports.SubscribeIntentionType.REQUEST_CUSTOM_PLAN_ACCESS);else U.title=P(o),U.intentionType=exports.SubscribeIntentionType.START_TRIAL;t&&o.scheduledUpdate&&(U.disabled=!1,U.title=B,U.intentionType=exports.SubscribeIntentionType.CANCEL_SCHEDULED_UPDATES);var N=v||U.disabled;return a.createElement(a.Fragment,null,a.createElement(Ge,{className:"stigg-paywall-plan-button-layout"},t&&F?a.createElement(Ve,{color:"secondary",variant:"body1",className:"stigg-paywall-schedule-update-text"},F," ",a.createElement($e,{color:"secondary",onClick:function(){b(!0),Promise.resolve(s(U.intentionType)).finally((function(){return b(!1)}))}},U.title)):a.createElement(a.Fragment,null,a.createElement(_e,{className:"stigg-paywall-plan-button","data-testid":"paywall-card-cta-"+o.displayName,disabled:N,$disabled:N,onClick:function(){b(!0),Promise.resolve(s(U.intentionType)).finally((function(){return b(!1)}))}},a.createElement(He,{className:"stigg-paywall-plan-button-text",variant:"h6",color:"primary.main"},U.title),v&&a.createElement(ze,{color:f.stigg.palette.text.disabled,loading:!0,size:16})),p?a.createElement(Ze,{className:"stigg-trial-days-left-text",variant:"h6",color:"secondary"},o.isCurrentCustomerPlan&&o.trialDaysLeft&&a.createElement(a.Fragment,null,a.createElement("b",null,o.trialDaysLeft," days")," left on your free trial")):a.createElement("div",{style:{height:"20px"}}))))}function Qe(){return(Qe=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var Ke=function(e){return i.createElement("svg",Qe({width:16,height:16,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),We||(We=i.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.954 1.034A1 1 0 0 1 6.3 2.287a5.666 5.666 0 1 0 7.367 5.406 1 1 0 0 1 2 0c0 .23-.01.458-.03.684.01.072.012.147.006.223l-.004.049a1 1 0 0 1-.078.312A7.668 7.668 0 1 1 5.7.38a1 1 0 0 1 1.254.654Zm.614.239A1 1 0 0 1 8.648.36l.05.004a1 1 0 1 1-.182 1.992l-.037-.003a1 1 0 0 1-.911-1.081Zm4.85 1.636a1 1 0 0 1 1.41.11l.064.076a1 1 0 1 1-1.537 1.28 4.154 4.154 0 0 0-.047-.056 1 1 0 0 1 .11-1.41ZM9 5.334a1 1 0 0 0-2 0V8a1 1 0 0 0 1 1h2.667a1 1 0 1 0 0-2H9V5.334Z",fill:"#7586B0"})))},Xe=function(e){var t=e.amount,r=e.currency,i=e.locale,a=e.maximumFractionDigits,o=void 0===a?5:a,l=e.minimumFractionDigits,c=void 0===l?0:l,s=(void 0===r?n.Currency.Usd:r).toString(),u=y(s),d=new Intl.NumberFormat(i,ue({maximumFractionDigits:o,minimumFractionDigits:c,style:"currency",currency:s},u?{currencyDisplay:"code"}:{})).format(t||0);return u&&(d=d.replace(s,u)),d.replace(/\s/g,"")};function Je(e,t,r,i,a,o){switch(e.pricingType){case n.PricingType.Free:return"function"==typeof r.price.free?r.price.free(e.paywallCurrency):r.price.free;case n.PricingType.Custom:return{price:r.price.custom};case n.PricingType.Paid:var l,c=e.pricePoints.filter((function(e){return e.billingPeriod===t})),s=null==(l=e.paywallCalculatedPricePoints)?void 0:l.find((function(e){return e.billingPeriod===t}));if(!(null!=c&&c.length||s))return{price:r.price.priceNotSet};var u={planPrices:c,paywallCalculatedPrice:s,selectedBillingPeriod:t,selectedTierByFeature:o||{}};return r.price.paid?r.price.paid(ue({},u,{plan:e})):function(e){for(var t,r,i,a=e.planPrices,o=e.selectedBillingPeriod,l=e.locale,c=e.shouldShowMonthlyPriceAmount,s=e.selectedTierByFeature,u=e.paywallCalculatedPrice||a[0],d=u.currency,m=u.amount||0,p=1===a.length,g=o===n.BillingPeriod.Annually&&c?m/12:m,h=e.paywallLocale.price.pricePeriod(c?n.BillingPeriod.Monthly:n.BillingPeriod.Annually),f=h,y=ge(a);!(i=y()).done;){var v=i.value;if(v.isTieredPrice){var b=v.tiers[0];s[v.feature.featureId]&&(b=s[v.feature.featureId]||b,t=v.tiers,r=Oe(v)),g+=qe(v,b,o,c)}}if(p){var x,E=a[0],w=(null==(x=E.feature)?void 0:x.units)||"";E.pricingModel!==n.BillingModel.PerUnit||E.isTieredPrice?E.pricingModel===n.BillingModel.UsageBased&&(f="per "+w):f="per "+w+" "+h}return{price:Xe({amount:g,currency:d,locale:l}),unit:f,tiers:t,tierUnits:r}}(ue({},u,{locale:i,shouldShowMonthlyPriceAmount:a,paywallLocale:r}));default:return{price:""}}}var et=o(x,{target:"eeq8l4e1"})("border-radius:10px;min-height:42px;min-width:120px;&:hover .MuiOutlinedInput-notchedOutline{border-color:",(function(e){return e.theme.stigg.palette.outlinedBorder}),";}"),tt=o(b,{target:"eeq8l4e0"})("& .MuiInputBase-input{padding:10px 12px;}&.Mui-focused .MuiOutlinedInput-notchedOutline{border-color:",(function(e){return e.theme.stigg.palette.primary}),"!important;}");function nt(e){var t=e.componentId,n=e.tiers,r=e.tierUnits,i=e.selectedTier,o=e.handleTierChange;return a.createElement(ke,{className:"stigg-price-tier-select",style:{minHeight:"46px"}},n?a.createElement(et,{value:i?i.upTo.toString():n[0].upTo.toString(),fullWidth:!0,onChange:function(e,t){n&&o(je(n,e.target.value))},id:t,input:a.createElement(tt,null),MenuProps:{MenuListProps:{disablePadding:!0},PaperProps:{sx:{marginTop:"4px",borderRadius:"10px"}}}},d.map(n,(function(e){return a.createElement(v,{className:"stigg-price-tier-menu-item-text",key:e.upTo,value:e.upTo.toString()},a.createElement(ke,{variant:"body1",color:"primary",style:{lineHeight:"unset"}},e.upTo," ",r))}))):a.createElement("div",null))}var rt=o(ke,{target:"e1gsqbi12"})({name:"bfvx8c",styles:"word-break:break-word;width:100%"}),it=o(ke,{target:"e1gsqbi11"})({name:"1bmnxg7",styles:"white-space:nowrap"}),at=o(ke,{target:"e1gsqbi10"})({name:"nurf5y",styles:"white-space:normal;min-height:39px"});function ot(e){var t=e.billingPeriod,n=e.hasMonthlyPrice,r=e.hasAnnuallyPrice,i=e.paywallLocale,o="";return e.plan.pricePoints.find((function(e){return e.billingPeriod===t}))&&n&&r&&(o=(null==i.price.billingPeriod?void 0:i.price.billingPeriod(t))||", billed "+t.toLowerCase()),a.createElement(ke,{span:!0,className:"stigg-price-billing-period-text",variant:"h6",color:"secondary"},o)}var lt=function(e){var t=e.showStartingAt,n=e.withUnitPriceRow,r=e.withStartingAtRow,i=e.withTiersRow,o=e.selectedTierByFeature,l=e.setSelectedTierByFeature,c=e.plan,s=e.billingPeriod,u=e.paywallLocale,d=e.hasMonthlyPrice,m=e.hasAnnuallyPrice,p=Je(c,s,u,e.locale,d,o),g=p.price,h=p.unit,f=p.tiers,y=p.tierUnits,v=c.pricePoints.find((function(e){return e.billingPeriod===s&&e.isTieredPrice})),b=v?v.feature.featureId:void 0,x=b?o[b]:void 0;return a.createElement(rt,{className:"stigg-price-text"},a.createElement(a.Fragment,null,r&&a.createElement(ke,{style:{minHeight:"20px"},className:"stigg-starting-at-text",variant:"body1",color:"secondary"},t?u.price.startingAtCaption:""),a.createElement(at,{variant:"h1"},g),n&&a.createElement(ke,{className:"stigg-price-unit-and-billing-period-text",style:{minHeight:"48px"}},a.createElement(it,{span:!0,variant:"h6",color:"secondary"},h),a.createElement(ot,{plan:c,billingPeriod:s,hasAnnuallyPrice:m,hasMonthlyPrice:d,paywallLocale:u})),i?a.createElement(nt,{componentId:c.id+"_"+b+"_tier",tiers:f,tierUnits:y,selectedTier:x,handleTierChange:function(e){b&&l((function(t){var n;return ue({},t,((n={})[b]=e,n))}))}}):null))},ct=o("div",{target:"eacdu8d8"})("position:relative;background-color:",(function(e){var t=e.theme;return e.$isCurrentPlan?t.stigg.palette.backgroundHighlight:t.stigg.palette.backgroundPaper}),";border:",(function(e){var t=e.theme;return e.$isHighlighted?"3px solid "+t.stigg.palette.primary:"1px solid "+t.stigg.palette.outlinedBorder}),";border-radius:10px;padding:",(function(e){return e.theme.stigg.layout.planPadding}),";display:flex;min-width:",(function(e){return e.theme.stigg.layout.planMinWidth}),";max-width:",(function(e){return e.theme.stigg.layout.planMaxWidth}),";flex-direction:column;align-items:flex-start;justify-content:flex-start;position:relative;"),st=o(ke,{target:"eacdu8d7"})({name:"mpkj0c",styles:"padding-bottom:8px"}),ut=o("div",{target:"eacdu8d6"})("height:2px;width:100%;background-color:",(function(e){return e.theme.stigg.palette.outlinedBorder}),";margin-bottom:40px;"),dt=o(ke,{target:"eacdu8d5"})("text-align:",(function(e){return e.theme.stigg.layout.descriptionAlignment}),";min-height:",(function(e){return e.theme.stigg.layout.descriptionMinHeight}),";"),mt=o("div",{target:"eacdu8d4"})("background-color:",(function(e){return e.theme.stigg.palette.primary}),";border-radius:40px;position:absolute;top:-12px;"),pt=o(ke,{target:"eacdu8d3"})({name:"a8c38r",styles:"margin:0;padding:2px 8px"}),gt=o("div",{target:"eacdu8d2"})("width:100%;display:flex;flex-direction:column;align-items:",(function(e){return Ne(e.theme.stigg.layout.headerAlignment)}),";"),ht=o("div",{target:"eacdu8d1"})("position:absolute;top:0;background-color:",(function(e){return e.theme.stigg.palette.outlinedBorder}),";border-radius:0px 0px 10px 10px;padding:3px 12px;"),ft=o(Ke,{target:"eacdu8d0"})("display:flex;height:100%;margin-right:4px;path{fill:",(function(e){return e.theme.stigg.palette.text.primary}),";}");function yt(e){var t=e.text,n=void 0===t?"Next":t;return a.createElement(ht,null,a.createElement(c,{display:"flex",alignItems:"center",gap:1},a.createElement(ft,{$iconsColor:e.iconsColor}),a.createElement(ke,{color:"primary",variant:"body1"},n)))}function vt(e){var t,r=e.withUnitPriceRow,o=e.withTiersRow,c=e.withTrialLeftRow,s=e.customer,u=e.plan,d=e.billingPeriod,m=e.isHighlighted,p=e.currentSubscription,g=e.shouldShowDescriptionSection,h=e.hasMonthlyPrice,f=e.hasAnnuallyPrice,y=e.isCustomerOnTrial,v=e.onPlanSelected,b=e.paywallLocale,x=e.locale,E=e.withStartingAtRow,w=e.isCustomerInCustomPlan,k=u.isNextPlan&&u.isNextPlan(d),P=u.pricePoints.filter((function(e){return e.billingPeriod===d})),C=null==(t=u.paywallCalculatedPricePoints)?void 0:t.find((function(e){return e.billingPeriod===d})),S=P.length>1&&!(null==C||!C.additionalChargesMayApply),T=!w||u.pricingType===n.PricingType.Custom,B=null;k?B=a.createElement(yt,{text:"Next plan"}):m&&b.highlightChip&&(B=a.createElement(mt,{className:"stigg-highlight-badge"},a.createElement(pt,{className:"stigg-highlight-badge-text",color:"white",bold:!0},b.highlightChip)));var M=a.useState(Re(u,d,p,{})),A=M[0],U=M[1];return i.useEffect((function(){U(Re(u,d,p,A))}),[d,p,u,A]),a.createElement(ct,{className:l("stigg-plan-offering-container",{"stigg-current-plan":u.isCurrentCustomerPlan}),$isHighlighted:m,$isCurrentPlan:u.isCurrentCustomerPlan},B,a.createElement(gt,{className:"stigg-header-wrapper"},a.createElement(st,{className:"stigg-plan-header",variant:"h3"},u.displayName),g&&a.createElement(dt,{className:"stigg-plan-description",variant:"h6",color:"secondary"},u.description),a.createElement(lt,{showStartingAt:S,withUnitPriceRow:r,withStartingAtRow:E,withTiersRow:o,selectedTierByFeature:A,setSelectedTierByFeature:U,plan:u,billingPeriod:d,paywallLocale:b,locale:x,hasAnnuallyPrice:f,hasMonthlyPrice:h}),T?a.createElement(Ye,{isNextPlan:k,customer:s,plan:u,currentSubscription:p,billingPeriod:d,isCustomerOnTrial:y,onPlanSelected:function(e){var t=Object.keys(A).map((function(e){return{featureId:e,quantity:A[e].upTo}}));return v(e,t)},paywallLocale:b,withTrialLeftRow:c,selectedTierByFeature:A}):a.createElement("div",{style:{height:"66px"}}),a.createElement(ut,{className:"stigg-plan-header-divider"})),a.createElement(Ue,{plan:u,billingPeriod:d,paywallLocale:b}))}var bt,xt=o("div",{target:"esqa6i42"})("height:40px;padding:0 20px;margin-bottom:",(function(e){return e.theme.stigg.layout.switchBottomSpacing}),";border-radius:10px;border:",(function(e){return"1px solid "+e.theme.stigg.palette.outlinedBorder}),";background-color:",(function(e){return e.theme.stigg.palette.backgroundPaper}),";display:flex;align-items:center;justify-content:center;"),Et=o(ke,{target:"esqa6i41"})({name:"zvmrfm",styles:"margin:0 8px"}),wt=o(E,{target:"esqa6i40"})("& .react-switch-bg{border:",(function(e){return"1px solid "+e.theme.stigg.palette.switchBorder}),";background:",(function(e){return e.theme.stigg.palette.switchFill}),"!important;}& .react-switch-handle{box-shadow:",(function(e){return e.theme.stigg.shadows.light}),";background:",(function(e){return e.theme.stigg.palette.switchHandle}),"!important;top:0.5px!important;}");function kt(e){return a.createElement(ke,{variant:"h6",color:e.disabled?"disabled":"primary",className:"stigg-discount-rate-text"},e.discount,"% off")}function Pt(e){var t=e.discountRate,r=e.onBillingPeriodChanged;if(e.availableBillingPeriods.length<=1)return null;var i=e.selectedBillingPeriod===n.BillingPeriod.Monthly;return a.createElement(xt,{className:"stigg-period-picker-container"},a.createElement(Et,{variant:"h6",className:"stigg-monthly-period-text",color:i?"primary":"disabled"},"Monthly"),a.createElement(wt,{className:"stigg-period-switch",uncheckedIcon:!1,checkedIcon:!1,height:16,width:33,onChange:function(e){return r(e?n.BillingPeriod.Annually:n.BillingPeriod.Monthly)},checked:!i,borderRadius:10,handleDiameter:19}),a.createElement(Et,{variant:"h6",className:"stigg-annual-period-text",color:i?"disabled":"primary"},"Annual"),0!==t&&a.createElement(kt,{discount:t,disabled:i}))}function Ct(e,t){var n,r,i,a;if((a=null==(n=e.paywallCalculatedPricePoints)?void 0:n.find((function(e){return e.billingPeriod===t})))||(a=e.pricePoints.find((function(e){return e.billingPeriod===t}))),null==(r=a)||!r.amount){var o=e.pricePoints.find((function(e){return e.isTieredPrice&&e.billingPeriod===t}));if(o)return o.tiers[0].unitPrice.amount}return null==(i=a)?void 0:i.amount}function St(){return(St=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var Tt=o((function(e){return i.createElement("svg",St({width:135,height:16,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),bt||(bt=i.createElement("path",{d:"M.099 3.43v9.558h1.057V9.527h2.81c1.983 0 3.323-1.275 3.323-3.049 0-1.773-1.34-3.048-3.324-3.048H.1Zm1.057 5.127v-4.15h2.889c1.289 0 2.143.855 2.143 2.071 0 1.217-.854 2.079-2.143 2.079h-2.89ZM11.779 13.162c2.129 0 3.873-1.622 3.873-3.78 0-2.165-1.715-3.758-3.844-3.758-2.158 0-3.874 1.622-3.874 3.787 0 2.158 1.687 3.75 3.845 3.75Zm.014-.934c-1.556 0-2.773-1.202-2.773-2.832 0-1.629 1.216-2.83 2.773-2.83 1.528 0 2.773 1.201 2.773 2.83 0 1.63-1.245 2.832-2.773 2.832ZM19.905 12.988l1.572-6.046h.029l1.556 6.046h1.34l2.194-7.183h-1.18l-1.622 6.104h-.03l-1.549-6.104h-1.433l-1.55 6.104h-.029l-1.65-6.104h-1.195l2.208 7.183h1.34ZM34.983 9.425c0-2.121-1.578-3.8-3.83-3.8-2.1 0-3.845 1.556-3.845 3.786 0 2.143 1.6 3.75 3.874 3.75 1.586 0 2.875-.767 3.497-1.969l-.897-.485c-.413.898-1.412 1.528-2.585 1.528-1.673 0-2.694-1.246-2.795-2.513h6.567c.014-.13.014-.18.014-.297ZM31.14 6.551c1.404 0 2.527.948 2.715 2.259h-5.423a2.745 2.745 0 0 1 2.708-2.26ZM39.592 5.682c-1.028 0-1.774.521-2.1 1.253l-.101-1.13h-.905v7.183h1.057V8.564c0-1.115.615-1.789 1.774-1.789h.68V5.682h-.405ZM48.249 9.425c0-2.121-1.579-3.8-3.83-3.8-2.1 0-3.845 1.556-3.845 3.786 0 2.143 1.6 3.75 3.873 3.75 1.586 0 2.875-.767 3.497-1.969l-.897-.485c-.413.898-1.412 1.528-2.585 1.528-1.673 0-2.694-1.246-2.795-2.513h6.567c.015-.13.015-.18.015-.297Zm-3.845-2.874c1.404 0 2.527.948 2.715 2.259h-5.423a2.745 2.745 0 0 1 2.708-2.26ZM55.846 7.029c-.63-.89-1.644-1.398-2.831-1.398-2.093 0-3.773 1.586-3.773 3.765 0 2.18 1.651 3.766 3.744 3.766 1.195 0 2.23-.522 2.867-1.42l.145 1.246h.905V2.56l-1.057.116V7.03Zm-2.817 5.199c-1.498 0-2.7-1.188-2.7-2.832 0-1.643 1.202-2.83 2.7-2.83a2.787 2.787 0 0 1 2.817 2.83 2.787 2.787 0 0 1-2.817 2.832ZM65.731 5.631c-1.194 0-2.222.514-2.86 1.412V2.561l-1.057.116v10.31h.905l.145-1.237c.63.898 1.644 1.412 2.838 1.412 2.093 0 3.773-1.586 3.773-3.766 0-2.179-1.651-3.765-3.744-3.765Zm-.043 6.597a2.787 2.787 0 0 1-2.817-2.832 2.787 2.787 0 0 1 2.817-2.83c1.499 0 2.7 1.187 2.7 2.83 0 1.644-1.201 2.832-2.7 2.832ZM76.219 5.805v4.113c0 1.412-.905 2.266-2.172 2.266-1.26 0-1.97-.738-1.97-2.07V5.804H71.02v4.468c0 1.694 1.115 2.824 2.744 2.824 1.079 0 1.926-.42 2.455-1.116v.913c0 1.267-.956 2.186-2.346 2.186-1.123 0-2.05-.6-2.288-1.65l-.927.477C71.1 15.16 72.308 16 73.858 16c1.955 0 3.418-1.405 3.418-3.208V5.805h-1.057ZM108.672 10.487c0 1.42-1.261 2.3-3.181 2.3-1.027 0-1.857-.184-2.651-.578.074-.449.142-.99.16-1.618.738.43 1.575.64 2.381.64.959 0 1.458-.221 1.458-.689.018-.461-.339-.67-1.772-.947-1.661-.332-2.399-1.021-2.399-2.24 0-1.377 1.261-2.27 3.18-2.27.849 0 1.692.16 2.338.437l-.32 1.544a4.803 4.803 0 0 0-2.018-.43c-.898 0-1.341.221-1.341.658 0 .381.308.541 1.71.83 1.79.382 2.461 1.07 2.461 2.35l-.006.013Zm4.207.609c-.719 0-1.298-.382-1.298-1.39V6.887h1.827l.339-1.63h-2.166v-2.32a9.976 9.976 0 0 1-1.9.345l-.019 6.748c0 1.84 1.101 2.769 2.75 2.769.375 0 .701-.037.978-.105l.363-1.729c-.228.08-.517.136-.874.136v-.006Zm2.086 1.593h1.919V5.258h-1.919v7.43Zm.965-10.47c-.621-.006-1.101.45-1.107 1.052 0 .621.455 1.089 1.071 1.095.621 0 1.082-.437 1.095-1.04.012-.62-.443-1.095-1.052-1.107h-.007Zm10.126 3.039v6.268c0 2.369-1.6 3.999-4.3 3.999-.972 0-2.042-.216-2.762-.628.498-.51.837-.953 1.052-1.273.486.166.996.252 1.519.252 1.71 0 2.578-.947 2.578-2.14v-.24c-.609.7-1.489 1.138-2.541 1.138-2.018 0-3.537-1.501-3.537-3.728 0-2.227 1.661-3.808 3.691-3.808 1.052 0 1.968.381 2.577 1.101l.062-.947h1.667l-.006.006Zm-1.901 3.648c0-1.181-.861-2.08-2.048-2.08-1.188 0-2.061.899-2.061 2.08 0 1.18.861 2.048 2.061 2.048 1.199 0 2.048-.898 2.048-2.048Zm10.839-3.648v6.268c0 2.369-1.6 3.999-4.3 3.999-.972 0-2.042-.216-2.762-.628.498-.51.837-.953 1.052-1.273.486.166.996.252 1.519.252 1.71 0 2.578-.947 2.578-2.14v-.24c-.609.7-1.489 1.138-2.541 1.138-2.017 0-3.537-1.501-3.537-3.728 0-2.227 1.661-3.808 3.691-3.808 1.052 0 1.968.381 2.577 1.101l.062-.947H135l-.006.006Zm-1.901 3.648c0-1.181-.861-2.08-2.048-2.08-1.188 0-2.061.899-2.061 2.08 0 1.18.861 2.048 2.061 2.048 1.199 0 2.048-.898 2.048-2.048ZM95.71 14.982c-.075.037-1.483.659-3.975.542A14.827 14.827 0 0 1 88.512 15l4.312-5.007c.77.197 1.76.381 2.885.436 2.492.123 3.9-.504 3.974-.541l-3.974 5.1v-.007Zm-6.441-9.62c-.708-2.393-.431-3.907-.413-3.987l-4.01 5.07c-.013.08-.29 1.592.412 3.985a14.98 14.98 0 0 0 1.273 3.008l3.845-5.37a15.042 15.042 0 0 1-1.107-2.7v-.006Zm9.996.529a14.561 14.561 0 0 0-1.815-3.882l-3.568 4.546.67 3.217c.4.056.794.092 1.194.117.203.006.406.012.603.012 1.931 0 3.008-.455 3.125-.51l.277-.123c.024-.665-.019-1.84-.48-3.384l-.006.007Zm-2.24-4.208A14.43 14.43 0 0 0 92.83.834c-1.605-.08-2.756.154-3.395.338l-.056.296c-.012.061-.258 1.494.4 3.74.11.381.246.756.394 1.132l3.285-.111 3.574-4.54-.006-.006Z",fill:"#001E6C"})))}),{target:"ee5i8qp1"})("*{fill:",(function(e){return e.theme.stigg.palette.text.secondary}),";}"),Bt=o("div",{target:"ee5i8qp0"})("align-self:",(function(e){return e.$alignSelf||"unset"}),";@media (max-width: 1040px){align-self:center;}");function Mt(e){var t=e.source,n=e.style;return e.showWatermark?a.createElement(Bt,{$alignSelf:e.align,className:"stigg-watermark",style:ue({cursor:"pointer"},void 0===n?{}:n),onClick:function(){var e=window.location.hostname.replace("www.","");window.open("https://www.stigg.io/?utm_source="+e+"&utm_medium=referral&utm_campaign="+t,"_blank")}},a.createElement(Tt,null)):null}function At(e,t){return e.some((function(e){return Ut(e,t)}))}function Ut(e,t){return e.pricePoints.some((function(e){return e.billingPeriod===t}))}var Lt,Ft=o("div",{target:"e19kubi82"})("color:",(function(e){return e.theme.stigg.palette.text.primary}),";display:flex;align-items:stretch;justify-content:center;flex-wrap:wrap;padding:10px 0;gap:",(function(e){return e.theme.stigg.layout.planMargin}),";"),Nt=o("div",{target:"e19kubi81"})({name:"1rdsyw8",styles:"display:flex;flex-direction:column;align-items:center;& *{box-sizing:border-box;}"}),It=o("div",{target:"e19kubi80"})({name:"zigog8",styles:"display:flex;flex-direction:column;align-items:center"}),Dt=function(e){var t=e.plans,r=e.customer,o=e.currentSubscription,l=e.highlightedPlanId,c=e.selectedBillingPeriod,s=e.onBillingPeriodChanged,u=e.availableBillingPeriods,d=e.isCustomerOnTrial,m=e.onPlanSelected,p=e.paywallLocale,g=e.locale,h=Rt().stigg,y=function(e){return e.reduce((function(e,t){var r,i,a=Ct(t,n.BillingPeriod.Monthly),o=(i=Ct(t,n.BillingPeriod.Annually),f(r=a)||f(i)?null:Math.round((r-i/12)/r*100));return o&&(e=Math.max(e,o)),e}),0)}(t),v=t.some((function(e){return!!e.description})),b=At(t,n.BillingPeriod.Monthly),x=At(t,n.BillingPeriod.Annually),E=function(e,t){return e.filter((function(e){return e.pricingType!==n.PricingType.Paid||Ut(e,t)}))}(t,c),w=i.useCallback((function(e,t,n){return m({plan:e,customer:r,subscription:o,intentionType:t,selectedBillingPeriod:c,billableFeatures:n})}),[r,c,o,m]),k=!!o&&o.plan.pricingType===n.PricingType.Custom,P=i.useMemo((function(){return E.some((function(e){var t,n=e.pricePoints.filter((function(e){return e.billingPeriod===c})),r=null==(t=e.paywallCalculatedPricePoints)?void 0:t.find((function(e){return e.billingPeriod===c}));return n.length>1&&!(null==r||!r.additionalChargesMayApply)}))}),[c,E]),C=i.useMemo((function(){return E.some((function(e){return!!Je(e,c,p,g,b).unit}))}),[c,b,g,p,E]),S=i.useMemo((function(){return!k&&E.some((function(e){var t=Re(e,c,o,{});return Object.values(t).length>0}))}),[c,o,k,E]),T=E.some((function(e){return e.isCurrentCustomerPlan&&e.trialDaysLeft}));return a.createElement(Nt,{className:"stigg-paywall-container"},a.createElement(It,{className:"stigg-paywall-layout"},a.createElement(Pt,{onBillingPeriodChanged:s,selectedBillingPeriod:c,availableBillingPeriods:u,discountRate:y}),a.createElement(Ft,{className:"stigg-paywall-plans-layout"},E.map((function(e){return a.createElement(vt,{withUnitPriceRow:C,withTiersRow:S,withTrialLeftRow:T,key:e.id,shouldShowDescriptionSection:v,hasMonthlyPrice:b,hasAnnuallyPrice:x,plan:e,withStartingAtRow:P,currentSubscription:o,billingPeriod:c,isHighlighted:e.id===l,isCustomerOnTrial:d,onPlanSelected:function(t,n){return w(e,t,n)},paywallLocale:p,locale:g,customer:r,isCustomerInCustomPlan:k})}))),a.createElement(Mt,{source:"paywall",align:"end",style:{marginTop:16},showWatermark:h.isWidgetWatermarkEnabled})))},Ot=(function(e){var t=function(e){var t=Object.prototype,n=t.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},i=r.iterator||"@@iterator",a=r.asyncIterator||"@@asyncIterator",o=r.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,n){return e[t]=n}}function c(e,t,n,r){var i=Object.create((t&&t.prototype instanceof d?t:d).prototype),a=new k(r||[]);return i._invoke=function(e,t,n){var r="suspendedStart";return function(i,a){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw a;return{value:void 0,done:!0}}for(n.method=i,n.arg=a;;){var o=n.delegate;if(o){var l=x(o,n);if(l){if(l===u)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var c=s(e,t,n);if("normal"===c.type){if(r=n.done?"completed":"suspendedYield",c.arg===u)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r="completed",n.method="throw",n.arg=c.arg)}}}(e,n,a),i}function s(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var u={};function d(){}function m(){}function p(){}var g={};l(g,i,(function(){return this}));var h=Object.getPrototypeOf,f=h&&h(h(P([])));f&&f!==t&&n.call(f,i)&&(g=f);var y=p.prototype=d.prototype=Object.create(g);function v(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function b(e,t){var r;this._invoke=function(i,a){function o(){return new t((function(r,o){!function r(i,a,o,l){var c=s(e[i],e,a);if("throw"!==c.type){var u=c.arg,d=u.value;return d&&"object"==typeof d&&n.call(d,"__await")?t.resolve(d.__await).then((function(e){r("next",e,o,l)}),(function(e){r("throw",e,o,l)})):t.resolve(d).then((function(e){u.value=e,o(u)}),(function(e){return r("throw",e,o,l)}))}l(c.arg)}(i,a,r,o)}))}return r=r?r.then(o,o):o()}}function x(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,x(e,t),"throw"===t.method))return u;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return u}var r=s(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,u;var i=r.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,u):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,u)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function w(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function k(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function P(e){if(e){var t=e[i];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,a=function t(){for(;++r<e.length;)if(n.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:C}}function C(){return{value:void 0,done:!0}}return m.prototype=p,l(y,"constructor",p),l(p,"constructor",m),m.displayName=l(p,o,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===m||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,l(e,o,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},v(b.prototype),l(b.prototype,a,(function(){return this})),e.AsyncIterator=b,e.async=function(t,n,r,i,a){void 0===a&&(a=Promise);var o=new b(c(t,n,r,i),a);return e.isGeneratorFunction(n)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},v(y),l(y,o,"Generator"),l(y,i,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=P,k.prototype={constructor:k,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(w),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(n,r){return o.type="throw",o.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],o=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var l=n.call(a,"catchLoc"),c=n.call(a,"finallyLoc");if(l&&c){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(l){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return r(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=e,o.arg=t,a?(this.method="next",this.next=a.finallyLoc,u):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),u},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),w(n),u}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;w(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:P(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),u}},e}(e.exports);try{regeneratorRuntime=t}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}}(Lt={exports:{}}),Lt.exports),jt=new(function(){function e(){}var t=e.prototype;return t.error=function(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];console.error(e,t||{},r)},t.log=function(e,t){console.log(e,t||{})},t.debug=function(e,t){console.debug(e,t||{})},e}()),qt=a.createContext(null);qt.displayName="StiggContext";var Rt=function(){var e=i.useContext(qt);if(!e)throw new Error("Could not find Stigg context; You need to wrap your app in an <StiggProvider> component.");return e};function Wt(e,t,r){var i,a=e.flatMap((function(e){return e.pricePoints})).map((function(e){return e.billingPeriod})),o=d.countBy(a),l=d.uniq(a);if(r&&l.includes(r))i=r;else if(t){var c=t.find((function(e){return e.status==n.SubscriptionStatus.Active}));c&&c.prices.length>0&&(i=null==c?void 0:c.prices[0].billingPeriod)}return i||(i=(o[n.BillingPeriod.Monthly]||0)>(o[n.BillingPeriod.Annually]||0)?n.BillingPeriod.Monthly:n.BillingPeriod.Annually),{defaultBillingPeriod:i,availableBillingPeriods:l}}var zt={h1:{fontSize:24,fontWeight:n.FontWeight.Bold},h2:{fontSize:16,fontWeight:n.FontWeight.Normal},h3:{fontSize:16,fontWeight:n.FontWeight.Normal},body:{fontSize:14,fontWeight:n.FontWeight.Normal}};function _t(e,t){if(void 0===t&&(t="px"),e)return""+e+t}function Ht(e,t){if(!t)return e;switch(t){case n.FontWeight.Normal:return"normal";case n.FontWeight.Bold:return"bold";default:return"normal"}}function Vt(e,t){var n,r,i,a,o,l,c,s,u,d,m,p,g,h,f;return{fontFamilyUrl:(null==e?void 0:e.fontFamily)||void 0,h1:{fontSize:_t((null==e||null==(n=e.h1)?void 0:n.fontSize)||(null==t||null==(r=t.h1)?void 0:r.fontSize)),fontWeight:Ht("bold",(null==e||null==(i=e.h1)?void 0:i.fontWeight)||(null==t||null==(a=t.h1)?void 0:a.fontWeight))},h2:{fontSize:_t((null==e||null==(o=e.h2)?void 0:o.fontSize)||(null==t||null==(l=t.h2)?void 0:l.fontSize)),fontWeight:Ht("normal",null==t||null==(c=t.h2)?void 0:c.fontWeight)},h3:{fontSize:_t((null==e||null==(s=e.h3)?void 0:s.fontSize)||(null==t||null==(u=t.h3)?void 0:u.fontSize)),fontWeight:Ht("normal",(null==e||null==(d=e.h3)?void 0:d.fontWeight)||(null==t||null==(m=t.h3)?void 0:m.fontWeight))},body:{fontSize:_t((null==e||null==(p=e.body)?void 0:p.fontSize)||(null==t||null==(g=t.body)?void 0:g.fontSize)),fontWeight:Ht("normal",(null==e||null==(h=e.body)?void 0:h.fontWeight)||(null==t||null==(f=t.body)?void 0:f.fontWeight))}}}function $t(e){if(e)switch(e){case n.Alignment.Left:return"left";case n.Alignment.Center:return"center";case n.Alignment.Right:return"right";default:return}}var Zt,Gt=o("div",{target:"e1f7khji6"})({name:"zigog8",styles:"display:flex;flex-direction:column;align-items:center"}),Yt=o(fe,{target:"e1f7khji5"})({name:"o7nnmj",styles:"margin-right:16px"}),Qt=o("div",{target:"e1f7khji4"})("display:flex;flex-direction:column;align-items:flex-start;gap:20px;border-radius:10px;padding:",(function(e){return e.theme.stigg.layout.planPadding}),";background-color:",(function(e){return e.theme.stigg.palette.backgroundPaper}),";min-width:",(function(e){return e.theme.stigg.layout.planMinWidth}),";max-width:",(function(e){return e.theme.stigg.layout.planMaxWidth}),";min-height:450px;border:",(function(e){return"1px solid "+e.theme.stigg.palette.outlinedBorder}),";"),Kt=o("div",{target:"e1f7khji3"})("display:flex;gap:",(function(e){return e.theme.stigg.layout.planMargin}),";flex-wrap:wrap;justify-content:center;"),Xt=o("div",{target:"e1f7khji2"})({name:"k8xojc",styles:"display:flex;align-items:center;margin-bottom:12px"}),Jt=o("div",{target:"e1f7khji1"})({name:"xdvdnl",styles:"margin-top:auto"}),en=o("div",{target:"e1f7khji0"})("width:150px;margin-bottom:",(function(e){return e.theme.stigg.layout.switchBottomSpacing}),";padding:12px 12px;border-radius:10px;background-color:white;border:",(function(e){return"1px solid "+e.theme.stigg.palette.outlinedBorder}),";");function tn(){return a.createElement(Qt,null,a.createElement(k,{width:120,borderRadius:4}),a.createElement(k,{circle:!0,width:40,height:40}),a.createElement(k,{style:{marginBottom:33},width:120,borderRadius:4}),a.createElement(Xt,null,a.createElement(Yt,null),a.createElement(k,{width:120,borderRadius:4})),a.createElement(Xt,null,a.createElement(Yt,null),a.createElement(k,{width:120,borderRadius:4})),a.createElement(Xt,null,a.createElement(Yt,null),a.createElement(k,{width:120,borderRadius:4})),a.createElement(Jt,null,a.createElement(k,{height:50,borderRadius:4})))}function nn(){return a.createElement(Gt,{className:"stigg-skeleton-loader-container"},a.createElement(en,{className:"stigg-skeleton-loader-billing-period"},a.createElement(k,{borderRadius:4})),a.createElement(Kt,{className:"stigg-skeleton-loader-plans-container"},a.createElement(tn,null),a.createElement(tn,null),a.createElement(tn,null)))}var rn,an=function(e){var t=e.externalFontUrl;return a.createElement(u.Global,{styles:u.css(Zt||(Zt=me(["\n ","\n\n /* latin-ext */\n @font-face {\n font-family: 'DM Sans';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: url(https://fonts.gstatic.com/s/dmsans/v11/rP2Hp2ywxg089UriCZ2IHTWEBlwu8Q.woff2) format('woff2');\n unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F,\n U+A720-A7FF;\n }\n /* latin */\n @font-face {\n font-family: 'DM Sans';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: url(https://fonts.gstatic.com/s/dmsans/v11/rP2Hp2ywxg089UriCZOIHTWEBlw.woff2) format('woff2');\n unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074,\n U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;\n }\n /* latin-ext */\n @font-face {\n font-family: 'DM Sans';\n font-style: normal;\n font-weight: 500;\n font-display: swap;\n src: url(https://fonts.gstatic.com/s/dmsans/v11/rP2Cp2ywxg089UriAWCrCBamC3YU-CnE6Q.woff2) format('woff2');\n unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F,\n U+A720-A7FF;\n }\n /* latin */\n @font-face {\n font-family: 'DM Sans';\n font-style: normal;\n font-weight: 500;\n font-display: swap;\n src: url(https://fonts.gstatic.com/s/dmsans/v11/rP2Cp2ywxg089UriAWCrCBimC3YU-Ck.woff2) format('woff2');\n unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074,\n U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;\n }\n /* latin-ext */\n @font-face {\n font-family: 'DM Sans';\n font-style: normal;\n font-weight: 700;\n font-display: swap;\n src: url(https://fonts.gstatic.com/s/dmsans/v11/rP2Cp2ywxg089UriASitCBamC3YU-CnE6Q.woff2) format('woff2');\n unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F,\n U+A720-A7FF;\n }\n /* latin */\n @font-face {\n font-family: 'DM Sans';\n font-style: normal;\n font-weight: 700;\n font-display: swap;\n src: url(https://fonts.gstatic.com/s/dmsans/v11/rP2Cp2ywxg089UriASitCBimC3YU-Ck.woff2) format('woff2');\n unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074,\n U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;\n }\n "])),t&&"\n @font-face {\n font-family: 'custom-font';\n font-style: normal;\n font-weight: normal;\n src: local('custom-font'), url("+t+") format('woff');\n }\n ")})},on=o("div",{target:"emcdfp60"})((function(e){var t=e.customCss;return t&&u.css(rn||(rn=me(["\n ","\n "])),t)}),";");function ln(e){var t,n,r,i,a,o,l,c,s,u=Rt(),m=d.merge(e,u.theme);return a=p((null==(t=m)||null==(n=t.palette)?void 0:n.primary)||"#327EEE"),o=p((null==t||null==(r=t.palette)||null==(i=r.text)?void 0:i.primary)||"#001E6C"),l=p("#4CAF50"),c=p("#f44336"),s={palette:{primary:a.hex(),primaryDark:a.darken(.3).hex(),primaryLight:a.alpha(.5).toString(),backgroundPaper:"#FFFFFF",backgroundHighlight:"#F5F6F9",backgroundSection:a.alpha(.1).toString(),backgroundButton:a.alpha(.08).toString(),outlinedBorder:"#C4CBDD",outlinedRestingBorder:a.alpha(.5).toString(),outlinedHoverBackground:a.lightness(95).hex(),switchBorder:a.lighten(.1).hex(),switchFill:a.lighten(.5).hex(),switchHandle:a.hex(),warning:"#ed6c02",error:c.hex(),errorDark:c.darken(.3).hex(),success:l.hex(),successDark:l.darken(.3).hex(),white:"#FFFFFF",text:{primary:o.hex(),secondary:o.alpha(.75).toString(),disabled:o.alpha(.5).toString()}},layout:{planMinWidth:"330px",planMaxWidth:"330px",planMargin:"20px",planPadding:"40px",ctaAlignment:"left",headerAlignment:"left",descriptionAlignment:"left",descriptionMinHeight:"80px",switchBottomSpacing:"40px"},shadows:{light:"0px 2px 1px -1px rgba(0, 0, 0, 0.2), 0px 1px 1px rgba(0, 0, 0, 0.14), 0px 1px 3px rgba(0, 0, 0, 0.12)",popover:"0px 4px 5px -2px rgba(0, 30, 108, 0.2), 0px 7px 10px 1px rgba(0, 30, 108, 0.14), 0px 2px 16px 1px rgba(0, 30, 108, 0.12)"},border:{radius:"10px"},typography:{fontFamily:"custom-font, DM Sans, sans-serif",h1:{fontSize:"32px",fontWeight:"bold"},h2:{fontSize:"24px",fontWeight:"normal"},h3:{fontSize:"16px",fontWeight:"normal"},body:{fontSize:"14px",fontWeight:"normal"},caption:{fontSize:"12px",fontWeight:"normal"}},customCss:""},g(s,t)}function cn(e){var t=e.typography,n=Number(t.body.fontSize.replace("px",""))/14;return{pxToRem:function(e){return e/16*n+"rem"},bodyFontFamily:t.fontFamily,headingFontFamily:t.fontFamily,fontSizes:[t.h1.fontSize,t.h2.fontSize,t.h3.fontSize,t.body.fontSize,"12px","10px"]}}var sn=function(e){var t,n=e.children,r=ln(e.componentTheme),i=function(e){return{primary:{main:e.palette.primary}}}(r),o=T.createTheme({palette:i,stigg:r});return a.createElement(T.ThemeProvider,{theme:(t={},t[T.THEME_ID]=o,t)},a.createElement(u.ThemeProvider,{theme:{stigg:r}},a.createElement(on,{customCss:r.customCss},a.createElement(an,{externalFontUrl:r.typography.fontFamilyUrl}),a.createElement(C.ThemeProvider,{theme:{typography:cn(r)}},n))))},un=a.createContext(null);un.displayName="CustomerPortalContext";var dn=function(){var e=i.useContext(un);if(!e)throw new Error("Could not find Customer portal context; You need to wrap your customer portal components in an <CustomerPortalProvider> component.");return e};function mn(e){var t,n,r,o,l,c,s,u=e.children,d=e.textOverrides,m=e.theme,p=e.resourceId,h=e.productId,f=Rt().customerPortalUpdatedAt,y=function(e){var t=e.resourceId,n=e.productId,r=Rt(),a=r.stigg,o=r.customerPortalUpdatedAt,l=i.useState(!1),c=l[0],s=l[1],u=i.useState(),d=u[0],m=u[1];return i.useEffect((function(){!function(){var e=se(Ot.mark((function e(){return Ot.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!a.isCustomerLoaded){e.next=15;break}return e.prev=1,s(!0),e.next=5,a.getCustomerPortal({resourceId:t,productId:n});case 5:m(e.sent),e.next=12;break;case 9:e.prev=9,e.t0=e.catch(1),jt.error("Failed to load customer portal "+(null==e.t0?void 0:e.t0.message),e.t0);case 12:return e.prev=12,s(!1),e.finish(12);case 15:case"end":return e.stop()}}),e,null,[[1,9,12,15]])})));return function(){return e.apply(this,arguments)}}()()}),[a,a.isCustomerLoaded,o,t]),{customerPortal:d,isLoading:c}}({resourceId:p,productId:h}),v=y.customerPortal,b=y.isLoading,x=null!=v&&v.configuration?function(e){var t=e.palette;return{palette:{primary:(null==t?void 0:t.primary)||void 0,backgroundPaper:(null==t?void 0:t.paywallBackgroundColor)||void 0,outlinedBorder:(null==t?void 0:t.borderColor)||void 0,backgroundHighlight:(null==t?void 0:t.currentPlanBackground)||void 0,text:{primary:(null==t?void 0:t.textColor)||void 0}},typography:Vt(e.typography)}}(v.configuration):void 0,E=(t=ln(x),r=null==v?void 0:v.configuration,{sectionTitleColor:(null==(n=m)?void 0:n.sectionTitleColor)||t.palette.text.secondary,planNameColor:(null==n?void 0:n.planNameColor)||t.palette.text.primary,backgroundColor:(null==n?void 0:n.backgroundColor)||(null==r||null==(o=r.palette)?void 0:o.backgroundColor)||"white",borderColor:(null==n?void 0:n.borderColor)||(null==r||null==(l=r.palette)?void 0:l.borderColor)||"rgba(0, 30, 108, 0.15)",listItemBackgroundColor:(null==n?void 0:n.backgroundColor)||(null==r||null==(c=r.palette)?void 0:c.backgroundColor)||"white",tabMaxHeight:(null==n?void 0:n.tabMaxHeight)||"380px",iconsColor:(null==n?void 0:n.iconsColor)||(null==r||null==(s=r.palette)?void 0:s.iconsColor)||void 0,iconsBackgroundColor:null==n?void 0:n.iconsBackgroundColor}),w=g({manageSubscription:"Manage",usageTabTitle:"Usage",addonsTabTitle:"Add-ons",promotionsTabTitle:"Promotions",promotionsSubtitle:"You were granted access to additional functionality at no additional cost.",contactSupportTitle:"Have questions about your subscription?",contactSupportLink:"Contact support",editBilling:"Edit billing details",invoicesTitle:"Invoices",viewInvoiceHistory:"View invoice history",editPaymentDetails:"Edit",paywallSectionTitle:"Plans",cancelScheduledUpdatesButtonTitle:"Cancel"},d);return a.createElement(sn,{componentTheme:x},a.createElement(un.Provider,{key:null==f?void 0:f.toString(),value:{customerPortal:v,isLoading:b,textOverrides:w,theme:E,resourceId:p}},u))}var pn,gn=o(M,{target:"emvioms0"})("border-radius:10px;padding:8px 16px;text-transform:none;&,&:hover{border-color:",(function(e){return e.theme.stigg.palette.outlinedRestingBorder}),";}");function hn(){return(hn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var fn=function(e){return i.createElement("svg",hn({width:20,height:20,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),pn||(pn=i.createElement("path",{clipRule:"evenodd",d:"M13.333 2.5 17.5 6.667 6.667 17.5H2.5v-4.167L13.333 2.5v0Z",stroke:"#327EEE",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})))},yn=o("div",{target:"ewz8krb0"})("display:flex;align-items:center;justify-content:space-between;",(function(e){return!e.$disableMargin&&"\n &:not(:last-child) {\n margin-bottom: 32px;\n }\n "}),";");function vn(e){var t=e.title,n=e.className,r=e.isLoading,i=dn().theme;return r?a.createElement(k,{width:120}):a.createElement(ke,{className:n,overrideColor:i.sectionTitleColor,variant:"h3",bold:!0},t)}var bn=o(fn,{target:"e1fjw26b0"})("path{stroke:",(function(e){return e.theme.stigg.palette.primary}),";}");function xn(e){var t=e.onManageSubscription,n=e.hideManageButton,r=e.textOverrides;return a.createElement(yn,{className:"stigg-customer-portal-overview-header",$disableMargin:!0},a.createElement(vn,{title:"Subscription",className:"stigg-overview-title"}),!n&&a.createElement(gn,{className:"stigg-manage-subscription-button",variant:"outlined",onClick:t},a.createElement(bn,{className:"stigg-manage-subscription-button-image"}),a.createElement(ke,{className:"stigg-manage-subscription-button-text",color:"primary.main",style:{marginLeft:"8px"},variant:"body1"},null==r?void 0:r.manageSubscription)))}function En(){var e=dn().customerPortal,t=A(null==e?void 0:e.subscriptions,(function(e){return e.addons}));return F(t)?null:a.createElement("div",{className:"stigg-addons-list-layout"},t.map((function(e,n){return a.createElement(ke,{key:e.addonId,span:!0,className:"stigg-addon-list-item-text",variant:"body1"},e.quantity>1&&e.quantity+" X ",e.displayName,n===t.length-1?"":", ")})))}var wn=o("div",{target:"e1g6q2f50"})("display:flex;justify-content:space-between;align-items:center;gap:64px;border-bottom:",(function(e){return"1px solid "+e.$borderColor}),";padding:16px 0;&>*:first-child{max-width:60%;}");function kn(){var e=dn(),t=e.customerPortal,n=e.theme,r=null==t?void 0:t.promotionalEntitlements;return a.createElement("div",{style:{display:"flex",flexDirection:"column"}},a.createElement(ke,{color:"secondary"},e.textOverrides.promotionsSubtitle),a.createElement("div",{style:{display:"flex",flexDirection:"column"}},a.createElement(wn,{$borderColor:n.borderColor},a.createElement(ke,{variant:"body1",bold:!0},"Feature"),a.createElement(ke,{variant:"body1",bold:!0},"Expiration date")),null==r?void 0:r.map((function(e){return a.createElement(wn,{$borderColor:n.borderColor},a.createElement(ke,{variant:"body1"},function(e){var t,n=e.displayName;return e.hasUnlimitedUsage?"Unlimited "+n:e.usageLimit?n+" x "+(null==(t=e.usageLimit)?void 0:t.toLocaleString()):n}(e)),a.createElement(ke,{variant:"body1",color:"disabled"},e.endDate?h.utc(e.endDate).format("MMM Do, YYYY"):"None"))}))))}var Pn,Cn,Sn,Tn,Bn,Mn,An,Un,Ln,Fn,Nn,In,Dn,On,jn,qn,Rn=o(N,{target:"exlfw3j3"})({name:"jlwfj4",styles:".MuiTabs-indicator{background-color:#001e6c;}"}),Wn=o("div",{target:"exlfw3j2"})({name:"1dqkbz0",styles:"width:100%;flex:1;margin-top:16px"}),zn=o(U,{target:"exlfw3j1"})("margin-top:16px;max-height:",(function(e){return e.$maxHeight}),";overflow-y:auto;"),_n=function(e,t){switch(e){case"primary":return t.stigg.palette.text.primary;case"secondary":return t.stigg.palette.text.secondary;default:return e}};function Hn(){return(Hn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Vn(){return(Vn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function $n(){return($n=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Zn(){return(Zn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Gn(){return(Gn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Yn(){return(Yn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Qn(){return(Qn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var Kn,Xn,Jn,er,tr,nr,rr,ir,ar,or,lr,cr,sr,ur,dr,mr,pr,gr,hr,fr,yr,vr,br,xr,Er=function(e){return i.createElement("svg",Qn({width:20,height:20,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),qn||(qn=i.createElement("path",{d:"M10.833 2.5a7.5 7.5 0 0 0-7.5 7.5h-2.5l3.242 3.242.058.116L7.5 10H5a5.829 5.829 0 0 1 5.833-5.833A5.83 5.83 0 0 1 16.667 10a5.83 5.83 0 0 1-5.834 5.833 5.786 5.786 0 0 1-4.116-1.716L5.533 15.3a7.462 7.462 0 0 0 5.3 2.2 7.5 7.5 0 0 0 0-15ZM10 6.667v4.166l3.567 2.117.6-1.008-2.917-1.734V6.667H10Z",fill:"#6678A7"})))};function wr(){return(wr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function kr(){return(kr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Pr(){return(Pr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Cr(){return(Cr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Sr(){return(Sr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Tr(){return(Tr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Br(){return(Br=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Mr(){return(Mr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Ar(){return(Ar=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Ur(){return(Ur=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Lr(){return(Lr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Fr(){return(Fr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Nr(){return(Nr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var Ir,Dr,Or,jr={__proto__:null,Addons:function(e){return i.createElement("svg",Hn({width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),Pn||(Pn=i.createElement("g",{clipPath:"url(#addons_svg__a)",stroke:"#7586B0",strokeWidth:1.714,strokeLinecap:"round",strokeLinejoin:"round"},i.createElement("path",{d:"M12 6.857v10.286M6.857 12h10.286M18 .857H6A5.143 5.143 0 0 0 .857 6v12A5.143 5.143 0 0 0 6 23.143h12A5.143 5.143 0 0 0 23.143 18V6A5.143 5.143 0 0 0 18 .857Z"}))),Cn||(Cn=i.createElement("defs",null,i.createElement("clipPath",{id:"addons_svg__a"},i.createElement("path",{fill:"#fff",d:"M0 0h24v24H0z"})))))},BillingInfoCustomer:function(e){return i.createElement("svg",Vn({width:36,height:36,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),Sn||(Sn=i.createElement("rect",{width:36,height:36,rx:10,fill:"#F5F6F9"})),Tn||(Tn=i.createElement("path",{d:"M26 27v-2a4 4 0 0 0-4-4h-8a4 4 0 0 0-4 4v2",stroke:"#7586B0",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),Bn||(Bn=i.createElement("path",{clipRule:"evenodd",d:"M18 17a4 4 0 1 0 0-8 4 4 0 0 0 0 8Z",stroke:"#7586B0",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})))},ContactSupport:function(e){return i.createElement("svg",$n({width:36,height:36,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),Mn||(Mn=i.createElement("rect",{width:36,height:36,rx:10,fill:"#F5F6F9"})),An||(An=i.createElement("path",{d:"M27 18.22C27 12.73 22.74 9 18 9c-4.69 0-9 3.65-9 9.28-.6.34-1 .98-1 1.72v2c0 1.1.9 2 2 2h1v-6.1c0-3.87 3.13-7 7-7s7 3.13 7 7V25h-8v2h8c1.1 0 2-.9 2-2v-1.22c.59-.31 1-.92 1-1.64v-2.3c0-.7-.41-1.31-1-1.62Z",fill:"#7586B0"})),Un||(Un=i.createElement("path",{d:"M15 20a1 1 0 1 0 0-2 1 1 0 0 0 0 2ZM21 20a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z",fill:"#7586B0"})),Ln||(Ln=i.createElement("path",{d:"M24 17.03A6.04 6.04 0 0 0 18.05 12c-3.03 0-6.29 2.51-6.03 6.45a8.075 8.075 0 0 0 4.86-5.89c1.31 2.63 4 4.44 7.12 4.47Z",fill:"#7586B0"})))},CreditCard:function(e){return i.createElement("svg",Zn({width:36,height:36,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),Fn||(Fn=i.createElement("rect",{width:36,height:36,rx:10,fill:"#F5F6F9"})),Nn||(Nn=i.createElement("path",{d:"M26 10H10c-1.11 0-1.99.89-1.99 2L8 24c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V12c0-1.11-.89-2-2-2Zm0 14H10v-6h16v6Zm0-10H10v-2h16v2Z",fill:"#7586B0"})))},DollarCoin:function(e){return i.createElement("svg",Gn({width:21,height:20,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),In||(In=i.createElement("g",{clipPath:"url(#dollar-coin_svg__a)",stroke:"#7586B0",strokeWidth:1.714,strokeLinecap:"round",strokeLinejoin:"round"},i.createElement("path",{d:"M10.334 19.286A9.286 9.286 0 1 0 1.048 10a9.286 9.286 0 0 0 9.286 9.286Z"}),i.createElement("path",{d:"M12.765 7.46a1.903 1.903 0 0 0-1.796-1.27H9.494a1.7 1.7 0 0 0-.363 3.362l2.245.49a1.905 1.905 0 0 1-.407 3.768h-1.27c-.83 0-1.535-.53-1.797-1.27M10.334 6.19V4.287M10.334 15.714V13.81"}))),Dn||(Dn=i.createElement("defs",null,i.createElement("clipPath",{id:"dollar-coin_svg__a"},i.createElement("path",{fill:"#fff",transform:"translate(.333)",d:"M0 0h20v20H0z"})))))},MiniSchedule:Ke,Promotions:function(e){return i.createElement("svg",Yn({width:24,height:25,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),On||(On=i.createElement("g",{clipPath:"url(#promotions_svg__a)",stroke:"#7586B0",strokeWidth:1.714,strokeLinecap:"round",strokeLinejoin:"round"},i.createElement("path",{d:"M21.429 5.325H2.57c-.946 0-1.714.767-1.714 1.714v3.429c0 .947.768 1.714 1.714 1.714H21.43c.946 0 1.714-.768 1.714-1.714V7.039c0-.947-.768-1.714-1.714-1.714ZM21.429 12.182v9.429a1.714 1.714 0 0 1-1.715 1.714H4.286a1.714 1.714 0 0 1-1.714-1.714v-9.429M12 5.325v18M17.143 1.04 12 5.324 6.857 1.039"}))),jn||(jn=i.createElement("defs",null,i.createElement("clipPath",{id:"promotions_svg__a"},i.createElement("path",{fill:"#fff",transform:"translate(0 .182)",d:"M0 0h24v24H0z"})))))},Restore:Er,ScheduleBox:function(e){return i.createElement("svg",wr({width:36,height:36,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),Kn||(Kn=i.createElement("rect",{width:36,height:36,rx:10,fill:"url(#schedule-box_svg__a)"})),Xn||(Xn=i.createElement("rect",{width:36,height:36,rx:10,fill:"#F5F6F9"})),Jn||(Jn=i.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.954 7.7a1 1 0 0 1-.654 1.254 8.998 8.998 0 0 0-1.543 16.523A9 9 0 0 0 27 17.54a1 1 0 1 1 2 0c0 .357-.017.713-.052 1.066.018.089.024.182.017.278l-.004.047a.997.997 0 0 1-.101.361A11 11 0 1 1 14.7 7.046a1 1 0 0 1 1.254.654Zm1.896.252a1 1 0 0 1 1.08-.912l.048.004a1 1 0 1 1-.178 1.992l-.038-.003a1 1 0 0 1-.912-1.081ZM22.858 9.2a1 1 0 0 1 1.391-.254l.078.054a1 1 0 1 1-1.152 1.635 8.98 8.98 0 0 0-.063-.044 1 1 0 0 1-.254-1.391Zm3.748 3.609a1 1 0 0 1 1.332.473l.04.085a1 1 0 1 1-1.813.844l-.014-.031-.019-.039a1 1 0 0 1 .474-1.332ZM19 14a1 1 0 1 0-2 0v4a1 1 0 0 0 1 1h4a1 1 0 1 0 0-2h-3v-3Z",fill:"#7586B0"})),er||(er=i.createElement("defs",null,i.createElement("linearGradient",{id:"schedule-box_svg__a",x1:35.02,y1:1.224,x2:0,y2:36,gradientUnits:"userSpaceOnUse"}))))},ScheduleClock:function(e){return i.createElement("svg",kr({width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),tr||(tr=i.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.954 1.7A1 1 0 0 1 9.3 2.954a8.998 8.998 0 0 0-5.615 12.03A9 9 0 0 0 21 11.54a1 1 0 1 1 2 0c0 .357-.017.713-.052 1.066.018.089.024.182.017.278l-.004.047a.997.997 0 0 1-.101.361A11 11 0 1 1 8.7 1.046a1 1 0 0 1 1.254.654Zm1.896.252a1 1 0 0 1 1.08-.912l.048.004a1 1 0 1 1-.178 1.992l-.039-.003a1 1 0 0 1-.911-1.081ZM16.858 3.2a1 1 0 0 1 1.391-.254l.078.054a1 1 0 1 1-1.152 1.635 9.7 9.7 0 0 0-.063-.044 1 1 0 0 1-.254-1.391Zm3.748 3.608a1 1 0 0 1 1.332.474l.04.085a1 1 0 1 1-1.813.844l-.014-.031-.019-.039a1 1 0 0 1 .474-1.333ZM13 8a1 1 0 1 0-2 0v4a1 1 0 0 0 1 1h4a1 1 0 1 0 0-2h-3V8Z",fill:"#7586B0"})))},RenewSubscription:function(e){return i.createElement("svg",Pr({width:36,height:36,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),nr||(nr=i.createElement("rect",{width:36,height:36,rx:10,fill:"#F5F6F9"})),rr||(rr=i.createElement("path",{clipRule:"evenodd",d:"M9 12a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H11a2 2 0 0 1-2-2V12Z",stroke:"#7586B0",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),ir||(ir=i.createElement("path",{d:"M22 8v4M14 8v4M9 16h18",stroke:"#7586B0",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})))},Trash:function(e){return i.createElement("svg",Cr({width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),ar||(ar=i.createElement("path",{d:"M3 6h18",stroke:"#F88078",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),or||(or=i.createElement("path",{d:"M20 6a1 1 0 1 0-2 0h2ZM6 6a1 1 0 0 0-2 0h2Zm1 0a1 1 0 0 0 2 0H7Zm8 0a1 1 0 1 0 2 0h-2Zm3 0v14h2V6h-2Zm0 14a1 1 0 0 1-1 1v2a3 3 0 0 0 3-3h-2Zm-1 1H7v2h10v-2ZM7 21a1 1 0 0 1-1-1H4a3 3 0 0 0 3 3v-2Zm-1-1V6H4v14h2ZM9 6V4H7v2h2Zm0-2a1 1 0 0 1 1-1V1a3 3 0 0 0-3 3h2Zm1-1h4V1h-4v2Zm4 0a1 1 0 0 1 1 1h2a3 3 0 0 0-3-3v2Zm1 1v2h2V4h-2Z",fill:"#F88078"})),lr||(lr=i.createElement("path",{d:"M10 11v6M14 11v6",stroke:"#F88078",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})))},PaymentMethod:function(e){return i.createElement("svg",Sr({width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),cr||(cr=i.createElement("path",{d:"M21.167 4H2.833C1.821 4 1 4.895 1 6v12c0 1.105.82 2 1.833 2h18.334C22.179 20 23 19.105 23 18V6c0-1.105-.82-2-1.833-2Z",fill:"#C6C6C7"})),sr||(sr=i.createElement("path",{opacity:.3,d:"M19.75 16.429H17.5c-.488 0-.75-.229-.75-.762 0-.534.262-.762.75-.762h2.25c.488 0 .75.228.75.762 0 .533-.262.762-.75.762Zm-4.5 0H13c-.488 0-.75-.229-.75-.762 0-.534.262-.762.75-.762h2.25c.488 0 .75.228.75.762 0 .533-.262.762-.75.762Zm-4.5 0H8.5c-.488 0-.75-.229-.75-.762 0-.534.262-.762.75-.762h2.25c.488 0 .75.228.75.762 0 .533-.262.762-.75.762Zm-4.5 0H4c-.487 0-.75-.229-.75-.762 0-.534.263-.762.75-.762h2.25c.487 0 .75.228.75.762 0 .533-.263.762-.75.762Z",fill:"#000"})))},OutlinedCircle:function(e){return i.createElement("svg",Tr({width:21,height:20,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),ur||(ur=i.createElement("circle",{cx:10.333,cy:10,r:9,fill:"#fff",stroke:"#327EEE",strokeWidth:2})))},OutlinedCheckedCircle:function(e){return i.createElement("svg",Br({width:20,height:20,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),dr||(dr=i.createElement("circle",{cx:10,cy:10,r:9.25,fill:"#327EEE",stroke:"#327EEE",strokeWidth:1.5})),mr||(mr=i.createElement("path",{d:"M5 10.364 8.637 14l4-4 2-2",stroke:"#fff",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})))},OutlinedCheckedCircleDisabled:function(e){return i.createElement("svg",Mr({width:21,height:20,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),pr||(pr=i.createElement("circle",{cx:10.667,cy:10,r:9.25,fill:"#B3BCD3",stroke:"#B3BCD3",strokeWidth:1.5})),gr||(gr=i.createElement("path",{d:"M5.667 10.364 9.304 14l4-4 2-2",stroke:"#fff",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})))},ArrowForward:function(e){return i.createElement("svg",Ar({width:18,height:18,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),hr||(hr=i.createElement("path",{d:"M9 3 7.942 4.058l4.185 4.192H3v1.5h9.127l-4.185 4.193L9 15l6-6-6-6Z",fill:"#fff"})))},Close:function(e){return i.createElement("svg",Ur({width:20,height:20,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),fr||(fr=i.createElement("path",{d:"m15.834 5.342-1.175-1.175L10 8.825 5.342 4.167 4.167 5.342 8.825 10 4.167 14.66l1.175 1.175L10 11.175l4.659 4.659 1.175-1.175L11.175 10l4.659-4.658Z",fill:"#327EEE"})))},Check:function(e){return i.createElement("svg",Lr({width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),yr||(yr=i.createElement("path",{d:"M20 7 9 18l-5-5",stroke:"#F5F6F9",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})))},PayAsYouGoCharge:function(e){return i.createElement("svg",Fr({width:16,height:16,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),vr||(vr=i.createElement("g",{clipPath:"url(#pay-as-you-go-charge_svg__a)",stroke:"#7586B0",strokeWidth:1.714,strokeLinecap:"round",strokeLinejoin:"round"},i.createElement("path",{d:"M11.429 7.426 8 13.14M14.857 13.141a7.428 7.428 0 1 0-13.714 0h13.714Z"}))),br||(br=i.createElement("defs",null,i.createElement("clipPath",{id:"pay-as-you-go-charge_svg__a"},i.createElement("path",{fill:"#fff",d:"M0 0h16v16H0z"})))))},Coupon:function(e){return i.createElement("svg",Nr({width:16,height:16,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),xr||(xr=i.createElement("g",{stroke:"#327EEE",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"},i.createElement("path",{d:"m1.27 11.943 4.787 4.787a.923.923 0 0 0 1.305 0l9.501-9.501A.443.443 0 0 0 17 6.872l-.727-4.714a.455.455 0 0 0-.43-.43l-4.714-.726a.443.443 0 0 0-.357.135L1.27 10.638a.923.923 0 0 0 0 1.305Z"}),i.createElement("path",{d:"M12.555 6.059a.615.615 0 1 1 0-1.23.615.615 0 0 1 0 1.23Z"}))))}},qr=o("div",{target:"e1ds7xyn0"})((function(e){var t=e.$pathColor;return t&&u.css(Ir||(Ir=me(["\n path {\n fill: ",";\n }\n "])),t)})," ",(function(e){var t=e.$rectColor;return t&&u.css(Dr||(Dr=me(["\n svg rect {\n fill: ",";\n }\n "])),t)})," ",(function(e){var t=e.$strokeColor;return t&&u.css(Or||(Or=me(["\n g {\n stroke: ",";\n }\n "])),t)}),";");function Rr(e){var t=e.className,n=e.style,r=e.svgPathColor,i=e.svgRectColor,o=e.svgStrokeColor,l=jr[e.icon],c=u.useTheme();return a.createElement(qr,{className:t,style:n,$pathColor:_n(r,c),$rectColor:_n(i,c),$strokeColor:_n(o,c)},a.createElement(l,null))}var Wr=["children","value","index","maxHeight"];function zr(e){var t=e.children,n=e.value,r=e.index,i=e.maxHeight,o=de(e,Wr);return a.createElement("div",Object.assign({role:"tabpanel",hidden:n!==r},o),n===r&&a.createElement(zn,{$maxHeight:i},t))}function _r(e){var t=e.isSelected,n=e.label,r=t?"primary":"secondary";return a.createElement("div",{style:{display:"flex",gap:8,alignItems:"center"}},a.createElement(Rr,{icon:e.icon,svgStrokeColor:r}),a.createElement(ke,{variant:"h6",bold:t,fontWeight:s.FontWeight.Medium,color:r},n))}function Hr(e){var t=e.customerPortal,n=e.hiddenSections,r=e.textOverrides,o=e.theme,l=function(e){return null==n?void 0:n.some((function(t){return t===e}))},c=A(t.subscriptions,(function(e){return e.addons})).length>0&&!l("addons"),s=t.promotionalEntitlements.length>0&&!l("promotionalEntitlements"),u=i.useState(c?1:2),d=u[0],m=u[1];return c||s?a.createElement(Wn,null,a.createElement(U,{sx:{borderBottom:1,borderColor:"divider"}},a.createElement(Rn,{value:d,onChange:function(e,t){m(t)}},c?a.createElement(L,{sx:{textTransform:"none"},value:1,label:a.createElement(_r,{isSelected:1===d,label:r.addonsTabTitle,icon:"Addons"})}):null,s?a.createElement(L,{sx:{textTransform:"none"},value:2,label:a.createElement(_r,{isSelected:2===d,label:r.promotionsTabTitle,icon:"Promotions"})}):null)),a.createElement(zr,{value:d,index:1,maxHeight:o.tabMaxHeight},a.createElement(En,null)),a.createElement(zr,{value:d,index:2,maxHeight:o.tabMaxHeight},a.createElement(kn,null))):null}var Vr=o("div",{target:"ejq3grd1"})({name:"1eoy87d",styles:"display:flex;justify-content:space-between"}),$r=o("div",{target:"ejq3grd0"})({name:"43cxha",styles:"display:flex;flex-direction:column;gap:32px"});function Zr(){return a.createElement(Vr,{className:"stigg-subscription-overview-skeleton-layout"},a.createElement($r,null,a.createElement(k,{width:120}),a.createElement(k,{width:120})),a.createElement(k,{width:295,height:193}))}function Gr(e){var t=e.scheduleUpdate.targetPackage;return a.createElement(c,{container:!0,alignItems:"center"},a.createElement(c,null,a.createElement(I.ArrowDown,{color:"#D94052",height:20,className:"stigg-scheduled-updates-arrow-down"})),a.createElement(c,{item:!0},a.createElement(ke,{className:"stigg-scheduled-updates-description",variant:"body1"},"Downgrade to the ",a.createElement("b",null,null==t?void 0:t.displayName)," plan")))}function Yr(e){var t=e.scheduleUpdate.scheduleVariables.billingPeriod,r=t===n.BillingPeriod.Monthly?"annually":"monthly",i=t===n.BillingPeriod.Monthly?"monthly":"annually";return a.createElement(c,{container:!0,alignItems:"center"},a.createElement(c,null,a.createElement(I.ArrowDown,{color:"#D94052",height:20,className:"stigg-scheduled-updates-arrow-down"})),a.createElement(c,{item:!0},a.createElement(ke,{className:"stigg-scheduled-updates-description",variant:"body1"},"Change from an ",r," to a ",a.createElement("b",null,i)," billing cycle")))}function Qr(e){var t=e.scheduleUpdate.scheduleVariables,n=t.newUnitAmount,r=t.featureId,i=d.compact(d.map(e.subscription.prices,"feature")).find((function(e){return e.id===r}));if(!i)return null;var o=i.featureUnits,l=1===n?o:i.featureUnitsPlural;return a.createElement(c,{container:!0,alignItems:"flex-start",flexWrap:"nowrap"},a.createElement(c,null,a.createElement(I.ArrowDown,{color:"#D94052",height:20,className:"stigg-scheduled-updates-arrow-down"})),a.createElement(c,{item:!0},a.createElement(ke,{className:"stigg-scheduled-updates-description",variant:"body1"},"Reduce the ",a.createElement("b",null,o)," quantity to ",n," ",l)))}function Kr(e){var t=e.scheduleUpdate,r=e.subscription;switch(t.subscriptionScheduleType){case n.SubscriptionScheduleType.Downgrade:return a.createElement(Gr,{scheduleUpdate:t});case n.SubscriptionScheduleType.BillingPeriod:return a.createElement(Yr,{scheduleUpdate:t});case n.SubscriptionScheduleType.UnitAmount:return a.createElement(Qr,{scheduleUpdate:t,subscription:r});default:return null}}var Xr=o(U,{target:"eju957a2"})("border-bottom:",(function(e){return"1px solid "+e.$borderColor}),";border-top-left-radius:10px;border-top-right-radius:10px;margin:-64px -64px 64px -64px;padding:24px 32px;"),Jr=o(m,{target:"eju957a1"})({name:"158icaa",styles:"margin-left:4px"}),ei=o(Er,{target:"eju957a0"})("color:",(function(e){return e.theme.stigg.palette.primary}),";path{fill:",(function(e){return e.theme.stigg.palette.primary}),";}");function ti(e){var t=e.subscription,n=t.scheduledUpdates;return a.createElement(a.Fragment,null,a.createElement(c,{container:!0,alignItems:"center",justifyContent:"space-between",gap:1},a.createElement(c,null,a.createElement(ke,{className:"stigg-scheduled-updates-description",variant:"body1"},"The following updates will take effect in the next billing cycle:"))),a.createElement(c,null,(n||[]).map((function(e){return a.createElement(Kr,{key:e.subscriptionScheduleType,scheduleUpdate:e,subscription:t})}))))}function ni(e){var t=e.subscription,n=De({scheduledUpdate:(t.scheduledUpdates||[])[0],subscriptionPrices:t.prices,billingPeriodRange:t.billingPeriodRange,options:{postfix:"at the end of the current billing period"}}),r=n.line2;return a.createElement(a.Fragment,null,a.createElement(c,{container:!0,alignItems:"center",justifyContent:"space-between",gap:1},a.createElement(c,null,a.createElement(ke,{className:"stigg-scheduled-updates-title",variant:"body1",color:"primary"},n.line1))),r&&a.createElement(c,null,a.createElement(ke,{className:"stigg-scheduled-updates-subtitle",variant:"body1",color:"secondary"},r)))}function ri(e){var t=e.subscription,n=e.onCancelScheduledUpdates,r=e.theme,o=e.cancelScheduledUpdatesButtonTitle,l=u.useTheme(),s=i.useState(!1),d=s[0],m=s[1],p=t.scheduledUpdates;if(!p||0===p.length)return null;var g=1===p.length;return a.createElement(Xr,{$borderColor:r.borderColor,className:"stigg-scheduled-updates-alert-container"},a.createElement(c,{container:!0,alignItems:g?"center":"flex-start",gap:2},a.createElement(c,{item:!0,display:"flex"},a.createElement(Rr,{icon:"ScheduleBox",svgPathColor:r.iconsColor,svgRectColor:r.iconsBackgroundColor})),a.createElement(c,{item:!0,flex:1},a.createElement(g?ni:ti,{subscription:t})),!!n&&a.createElement(c,{item:!0},a.createElement(gn,{variant:"outlined",onClick:function(){m(!0),Promise.resolve(n(t)).finally((function(){return m(!1)}))}},d?a.createElement(Jr,{loading:!0,size:16,color:l.stigg.palette.text.disabled}):a.createElement(ei,{style:{display:"flex",marginRight:4},className:"stigg-scheduled-updates-cancel-update-button-icon"}),a.createElement(ke,{variant:"body1",color:"primary.main",className:"stigg-scheduled-updates-cancel-update-button"},o)))))}var ii=o("div",{target:"e1kw2z1l0"})("width:100%;display:flex;flex-direction:column;border-radius:10px;background-color:",(function(e){return e.$backgroundColor}),";border:",(function(e){return"1px solid "+e.$borderColor}),";padding:64px;");function ai(e){var t=e.billingPeriod,r=e.rangeEnd,i=e.amount,o=e.currency;return a.createElement(a.Fragment,null,a.createElement(ke,{variant:"h6"},"Next estimated bill"),a.createElement(ke,{variant:"h1"},Xe({amount:i,currency:o,maximumFractionDigits:2})),a.createElement(ke,{variant:"body1",color:"secondary"},"Billed ",t===n.BillingPeriod.Monthly?"monthly":"annually"," on"," ",a.createElement(ke,{variant:"body1",span:!0,color:"primary"},h.utc(r).format("MMM Do, YYYY"))),a.createElement(ke,{variant:"body1",color:"secondary"},"* Additional tax rates may apply"))}function oi(e){var t=e.description;return a.createElement(a.Fragment,null,a.createElement(ke,{variant:"h6",color:"secondary"},"No upcoming bill"),a.createElement(ke,{variant:"body1",color:"secondary"},t))}var li=o("div",{target:"e1ftdtst1"})({name:"1nocm2b",styles:"display:flex;flex-direction:column;align-items:left;gap:8px"}),ci=o(M,{target:"e1ftdtst0"})({name:"1l28f5r",styles:"width:fit-content;&.MuiButton-root{padding:0;&:hover{background:none;}}"});function si(e){var t=e.onContactSupport,n=e.label,r=a.createElement(ke,{color:t?"primary.main":"secondary"},e.linkLabel);return a.createElement(li,{className:"stigg-contact-support-layout"},a.createElement(ke,{className:"stigg-contact-support-label",color:"secondary"},n),t?a.createElement(ci,{className:"stigg-contact-support-button",style:{textTransform:"none"},variant:"text",onClick:t},r):r)}var ui,di,mi=o("div",{target:"e1u4onrr0"})("max-height:278px;display:flex;flex-direction:column;border-radius:10px;background-color:",(function(e){return e.theme.stigg.palette.backgroundSection}),";border:",(function(e){return"1px solid "+e.$borderColor}),";padding:32px;gap:16px;");function pi(e){var t,r,i,o,l=e.subscription,c=e.theme,s=e.textOverrides,u=e.onContactSupport,d=l.pricingType,m=null==(t=null==(r=l.prices)?void 0:r.every((function(e){return e.billingModel!==n.BillingModel.UsageBased})))||t,p=null==(i=l.scheduledUpdates)?void 0:i.find((function(e){var t=e.targetPackage;return e.subscriptionScheduleType===n.SubscriptionScheduleType.Downgrade&&(null==t?void 0:t.pricingType)===n.PricingType.Free}));if(d===n.PricingType.Free)o=a.createElement(oi,{description:"You're on a free plan, so you don’t have any upcoming charges"});else if(d===n.PricingType.Paid)if(p&&m)o=a.createElement(oi,{description:"Your plan will be downgraded to a free plan, so you don’t have any upcoming charges"});else if(l.status===n.SubscriptionStatus.InTrial)o=a.createElement(oi,{description:"You’re on a free trial of the "+l.planName+" plan, so you don’t have any upcoming charges"});else{var g,h,f,y,v=null==(g=l.prices)||null==(h=g[0])?void 0:h.billingPeriod,b=null==(f=l.billingPeriodRange)?void 0:f.end,x=null==(y=l.totalPrice)?void 0:y.total;v&&b&&x&&(o=a.createElement(ai,{billingPeriod:v,rangeEnd:b,amount:x.amount,currency:x.currency}))}else d===n.PricingType.Custom&&(o=a.createElement(si,{onContactSupport:u,label:s.contactSupportTitle,linkLabel:s.contactSupportLink}));return a.createElement(mi,{className:"stigg-subscription-total-price-layout",$borderColor:c.borderColor},o)}function gi(){return(gi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var hi,fi,yi,vi=function(e){return i.createElement("svg",gi({width:16,height:16,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),ui||(ui=i.createElement("path",{d:"M12.947 13.6h-1.013l.001-2.824a.522.522 0 0 0-.18-.392L8.622 7.918l3.134-2.465a.497.497 0 0 0 .18-.392V2.4h1.012c.278 0 .49-.212.49-.49a.481.481 0 0 0-.49-.49H3.053a.481.481 0 0 0-.49.49c0 .278.213.49.49.49h1.013l-.001 2.661c0 .147.065.294.18.392l3.117 2.465-3.117 2.466a.497.497 0 0 0-.18.392V13.6H3.054a.481.481 0 0 0-.49.49c0 .277.213.49.49.49h9.894c.277 0 .49-.213.49-.49a.481.481 0 0 0-.49-.49ZM5.045 2.4h5.91v2.416L8 7.167l-2.955-2.35V2.4Zm0 8.62L8 8.67l2.955 2.334v2.58h-5.91V11.02Z",fill:"#fff"})),di||(di=i.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.053 1.254h9.894c.37 0 .657.287.657.656 0 .37-.287.657-.657.657h-.845L12.1 5.06c0 .214-.088.39-.238.519l-.005.004L8.89 7.918l2.974 2.34c.152.13.238.323.238.518l-.001 2.657h.846c.37 0 .657.287.657.657 0 .37-.288.657-.657.657H3.053a.648.648 0 0 1-.657-.657c0-.37.287-.657.657-.657h.846v-2.657c0-.214.087-.39.237-.519l.005-.004 2.953-2.335L4.136 5.58a.688.688 0 0 1-.238-.519V2.567h-.845a.648.648 0 0 1-.657-.656c0-.37.287-.657.657-.657Zm9.894.333H3.053a.315.315 0 0 0-.323.324c0 .185.138.323.323.323h1.18l-.001 2.827c0 .099.043.198.119.264l3.28 2.593-3.28 2.594a.33.33 0 0 0-.119.264v2.99H3.053a.315.315 0 0 0-.323.324c0 .185.138.323.323.323h9.894a.315.315 0 0 0 .323-.323.315.315 0 0 0-.323-.323h-1.18l.001-2.991a.355.355 0 0 0-.119-.264L8.351 7.918l3.298-2.593a.33.33 0 0 0 .119-.264V2.233h1.18a.315.315 0 0 0 .323-.323.315.315 0 0 0-.324-.323Zm-8.069.646h6.244v2.664L8 7.38 4.878 4.897V2.233Zm.334.334v2.169L8 6.955l2.788-2.22V2.568H5.212ZM8 8.457l3.122 2.467v2.827H4.878v-2.81L8 8.456Zm0 .425-2.788 2.219v2.316h5.576v-2.332L8 8.882Z",fill:"#fff"})))},bi=["children","className","placement"],xi=o((function(e){var t=e.children,n=e.className,r=e.placement,i=void 0===r?"top":r,o=de(e,bi);return a.createElement(j,Object.assign({arrow:!0,placement:i},o,{classes:{popper:n,tooltip:"stigg-tooltip",arrow:"stigg-tooltip-arrow"}}),a.createElement("div",null,t))}),{target:"enddsuj0"})((function(e){var t,n=e.theme,r=e.$padding,i=e.$maxWidth;return(t={})["& ."+O.tooltipClasses.tooltip]={backgroundColor:n.stigg.palette.white,maxWidth:void 0===i?300:i,boxShadow:n.stigg.shadows.popover,padding:void 0===r?8:r,borderRadius:n.stigg.border.radius,color:n.stigg.palette.text.primary},t["& ."+O.tooltipClasses.arrow]={color:n.stigg.palette.white},t}),""),Ei=S(ke)(hi||(hi=me(["\n display: ",";\n -webkit-line-clamp: ",";\n -webkit-box-orient: vertical;\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: normal;\n ","\n\n ","\n"])),(function(e){return e.$display}),(function(e){return e.$maxLines}),(function(e){return e.$wordBreak&&C.css(fi||(fi=me(["\n word-break: break-word;\n "])))}),(function(e){return e.$bold&&C.css(yi||(yi=me(["\n font-weight: bold;\n "])))}));function wi(e){return e&&(e.clientHeight<e.scrollHeight||e.offsetWidth<e.scrollWidth)}var ki=function(e){var t=e.leaveDelay,n=e.children,r=e.variant,o=e.color,l=e.maxLines,c=void 0===l?1:l,s=e.wordBreak,u=e.bold,d=e.tooltipPlacement,m=void 0===d?"top":d,p=e.className,g=e.display,h=void 0===g?"-webkit-box":g,f=e.style,y=e["data-testid"],v=i.useState(!1),b=v[0],x=v[1],E=i.useRef(null),w=a.createElement(Ei,{ref:E,variant:r,color:o,$maxLines:c,$wordBreak:s,$bold:u,className:p,$display:h,style:f,"data-testid":y},n);i.useEffect((function(){if(null!=E&&E.current){var e=wi(E.current);x(e)}}),[E]);var k=(null==E?void 0:E.current)&&wi(E.current);return a.createElement("span",null,b||k?a.createElement(xi,{placement:m,leaveDelay:t,title:a.createElement(ke,{variant:"body1"},n)},w):w)},Pi=o("div",{target:"el5iwyw1"})("width:100%;display:flex;align-items:center;gap:4px;background-color:",(function(e){return e.theme.stigg.palette.warning}),";border-radius:10px;padding:8px 16px;margin-top:16px;"),Ci=o(D,{target:"el5iwyw0"})({name:"69ka7t",styles:"text-decoration-color:white;color:white;cursor:pointer"});function Si(e){var t=e.subscription,r=e.includePlanName,i=e.onManageSubscription;return(null==t?void 0:t.status)!==n.SubscriptionStatus.InTrial?null:a.createElement(Pi,{className:"stigg-subscription-trial-badge"},a.createElement(vi,{className:"stigg-subscription-trial-badge-image"}),a.createElement("div",{style:{flex:1,marginRight:4}},a.createElement(ki,{variant:"body1",className:"stigg-subscription-trial-badge-text",color:"white"},t.trialRemainingDays+" days remaining in trial",r&&" of the "+t.planName+" plan")),a.createElement(Ci,{className:"stigg-subscription-trial-upgrade-button",onClick:i},a.createElement(ke,{color:"white"},"Upgrade plan")))}function Ti(e){var t=e.mainSubscription,n=e.trialSubscription,r=e.onManageSubscription;return a.createElement("div",{className:"stigg-subscription-view-layout"},a.createElement(ke,{className:"stigg-subscription-plan-name",variant:"h1",overrideColor:e.theme.planNameColor,style:{marginTop:8}},t.planName," plan"),a.createElement(Si,{subscription:n,includePlanName:(null==n?void 0:n.planName)!==t.planName,onManageSubscription:r}))}function Bi(e,t){return Math.min(Math.floor(e/t*100),100)}var Mi,Ai=o(R,{target:"e1cbsoof1"})("height:4px;background-color:",(function(e){return p(e.theme.stigg.palette.primary).alpha(.4).string()}),";span{background-color:",(function(e){var t=e.theme;switch(e.$progressStatus){case"standard":return t.stigg.palette.primary;case"warning":return t.stigg.palette.warning;case"error":return t.stigg.palette.error;default:return t.stigg.palette.primary}}),";}"),Ui=o(W,{target:"e1cbsoof0"})("border-style:dotted;border-bottom-width:2px;border-color:",(function(e){return p(e.theme.stigg.palette.outlinedRestingBorder).alpha(.4).string()}),";");function Li(e){var t=e.entitlement;if(t.hasUnlimitedUsage)return a.createElement(Ui,null);var n,r=Bi(t.currentUsage||0,t.usageLimit),i=(n=r)<70?"standard":n<100?"warning":"error";return a.createElement(Ai,{$progressStatus:i,className:"stigg-feature-usage-progress-bar-"+i.toString(),variant:"determinate",value:r})}var Fi=S(M)(Mi||(Mi=me(["\n text-transform: none;\n padding: 0;\n white-space: nowrap;\n"])));function Ni(e){var t=e.entitlement,n=e.feature,r=e.onManageSubscription,i=e.onBuyMore,o=e.canBuyMore,l=e.canUpgradeSubscription;return e.hasCustomSubscription||t.hasUnlimitedUsage||Bi(t.currentUsage||0,t.usageLimit)<70?null:o?i?a.createElement(Fi,{variant:"text",onClick:function(){return i(n,t)}},a.createElement(ke,{color:"primary.main"},"Buy more")):null:l&&r?a.createElement(Fi,{variant:"text",onClick:r},a.createElement(ke,{color:"primary.main"},"Upgrade")):null}function Ii(e){var t,n,r,i=e.amount,o=e.currency,l=e.entitlement,c=e.feature,s=e.hideChargePrice,u=e.onBuyMore,d=e.onManageSubscription,m=e.canUpgradeSubscription,p=e.hasCustomSubscription;return a.createElement("div",{className:"stigg-charge-list-item",style:{display:"flex",flexDirection:"column",gap:12}},a.createElement("div",{style:{display:"flex",justifyContent:"space-between",gap:12}},a.createElement("div",{style:{display:"flex",gap:12}},a.createElement(ki,{variant:"body1",color:"primary"},c.displayName),!s&&a.createElement(ki,{variant:"body1",color:"secondary"},Xe({amount:i,currency:o})," per ",c.featureUnits)),a.createElement("div",{style:{display:"flex",gap:12}},a.createElement(Ni,{entitlement:l,feature:c,canBuyMore:!0,onBuyMore:u,onManageSubscription:d,canUpgradeSubscription:m,hasCustomSubscription:p}),a.createElement(ke,{variant:"body1",color:"primary",style:{whiteSpace:"nowrap"}},l.hasUnlimitedUsage?null==(t=l.currentUsage)?void 0:t.toLocaleString():(null==(n=l.currentUsage)?void 0:n.toLocaleString())+" of "+(null==(r=l.usageLimit)?void 0:r.toLocaleString())))),a.createElement(Li,{entitlement:l}))}function Di(e){var t=e.subscription,r=e.onBuyMore,i=e.onManageSubscription,o=e.hasCustomSubscription,l=e.canUpgradeSubscription,c=d.keyBy(e.entitlements,"feature.refId"),s=t.prices.filter((function(e){var t=e.feature;return!!t&&c[t.refId]&&!!e.price}));return s.length?a.createElement("div",{className:"stigg-charge-list",style:{display:"flex",flexDirection:"column",gap:16,marginTop:32}},s.map((function(e){var t=e.feature,s=e.price;if(!t||!s)return null;var u=c[t.refId];return u&&u.feature?a.createElement(Ii,{key:t.refId,entitlement:u,feature:u.feature,amount:s.amount,currency:s.currency,hideChargePrice:e.billingModel===n.BillingModel.PerUnit,onBuyMore:r,onManageSubscription:i,canUpgradeSubscription:l,hasCustomSubscription:o}):null}))):null}function Oi(e){var t=e.onManageSubscription,r=e.onBuyMore,i=e.onCancelScheduledUpdates,o=e.onContactSupport,l=e.hiddenSections,c=e.cancelScheduledUpdatesButtonTitle,s=dn(),u=s.customerPortal,d=s.textOverrides,m=s.theme,p=s.isLoading||!u,g=u||{},h=g.subscriptions,f=g.entitlements,y=g.canUpgradeSubscription,v=null==h?void 0:h.find((function(e){return e.status===n.SubscriptionStatus.Active})),b=null==h?void 0:h.find((function(e){return e.status===n.SubscriptionStatus.InTrial})),x=(null==v?void 0:v.pricingType)===n.PricingType.Custom,E=v||b;return a.createElement(ii,{className:"stigg-customer-portal-subscriptions-overview",$backgroundColor:m.backgroundColor,$borderColor:m.borderColor},!p&&v&&v.scheduledUpdates&&a.createElement(ri,{theme:m,subscription:v,onCancelScheduledUpdates:i,cancelScheduledUpdatesButtonTitle:c}),p||!E?a.createElement(Zr,null):a.createElement("div",{className:"stigg-overview-layout",style:{display:"flex",alignItems:"flex-start",gap:64}},a.createElement("div",{style:{display:"flex",flexDirection:"column",flex:1}},a.createElement(xn,{onManageSubscription:t,hideManageButton:x,textOverrides:d}),a.createElement(Ti,{mainSubscription:E,trialSubscription:b,theme:m,onManageSubscription:t}),v&&f&&a.createElement(Di,{subscription:v,entitlements:f,onBuyMore:r,onManageSubscription:t,canUpgradeSubscription:!!y,hasCustomSubscription:x}),a.createElement(Hr,{customerPortal:u,hiddenSections:l,textOverrides:d,theme:m})),a.createElement("div",{style:{display:"flex",flexDirection:"column",width:319,gap:24}},a.createElement(pi,{subscription:E,theme:m,onContactSupport:o,textOverrides:d}))))}var ji=o("div",{target:"e2lw8x70"})({name:"7wpci2",styles:"display:flex;width:100%;align-items:flex-end;justify-content:flex-end;margin-bottom:24px"});function qi(e){return a.createElement(ji,{className:"stigg-customer-portal-header-layout"},a.createElement(Mt,{source:"customer_portal",showWatermark:e.showWatermark}))}var Ri=o(ke,{target:"eb0pe7a1"})({name:"kxbue8",styles:"text-transform:none"}),Wi=o(I.ExternalLink,{target:"eb0pe7a0"})("color:",(function(e){return e.theme.stigg.palette.primary}),";");function zi(e){var t=e.text,n=e.url;return a.createElement(gn,{className:e.className,variant:"outlined",startIcon:a.createElement(Wi,{size:20,strokeWidth:2.5}),onClick:function(){window.open(n,"_blank")}},a.createElement(Ri,{color:"primary.main"},t))}var _i=o("div",{target:"e12mjvl51"})({name:"1hidw77",styles:"display:flex;flex-direction:column;align-items:flex-start;gap:16px;flex:1 0 0"}),Hi=o("div",{target:"e12mjvl50"})({name:"j9hhqa",styles:"display:flex;align-items:flex-start;gap:16px;align-self:stretch"});function Vi(e){var t=e.rows;return a.createElement(_i,null,a.createElement(ke,{variant:"h6",color:"secondary",fontWeight:s.FontWeight.Medium},e.title),t.map((function(e){var t=e.classNamePrefix,n=e.label,r=e.value,i=e.valueTypographyProps;return a.createElement(Hi,{key:n},a.createElement(ke,Object.assign({className:t+"-label",variant:"body1",color:"secondary",style:{width:80}},e.labelTypographyProps),n),a.createElement(ke,Object.assign({className:t+"-text",variant:"body1",color:"secondary"},i),r))})))}function $i(){return a.createElement(k,{width:220,height:42})}function Zi(){var e=dn(),t=e.customerPortal,n=e.textOverrides,r=e.theme,i=(t||{}).billingInformation,o=!i||e.isLoading,l=[];if(o?l.push.apply(l,[a.createElement(_i,null,a.createElement(k,{width:220,height:12}),a.createElement(k,{width:220,height:12}),a.createElement(k,{width:220,height:12})),a.createElement(W,{orientation:"vertical",style:{minHeight:93}}),a.createElement(_i,null,a.createElement(k,{width:220,height:12}),a.createElement(k,{width:220,height:12}),a.createElement(k,{width:220,height:12}))]):(l.push(a.createElement(Vi,{title:"Billed to",rows:[{classNamePrefix:"stigg-customer-name",label:"Name",value:(null==i?void 0:i.name)||"-",valueTypographyProps:null!=i&&i.name?{}:{color:"disabled"}},{classNamePrefix:"stigg-customer-email",label:"Email",value:(null==i?void 0:i.email)||"-",valueTypographyProps:null!=i&&i.email?{}:{color:"disabled"}}]})),null!=i&&i.defaultPaymentMethodId&&i.defaultPaymentMethodLast4Digits&&i.defaultPaymentExpirationMonth&&i.defaultPaymentExpirationYear&&(l.unshift(a.createElement(W,{orientation:"vertical",style:{minHeight:93}})),l.unshift(a.createElement(Vi,{title:"Payment method",rows:[{classNamePrefix:"stigg-credit-card",label:"Card",value:"Ending in "+i.defaultPaymentMethodLast4Digits},{classNamePrefix:"stigg-credit-card-expiration",label:"Expires",value:d.padStart(i.defaultPaymentExpirationMonth.toString(),2,"0")+"/"+i.defaultPaymentExpirationYear}]})))),!(o||null!=i&&i.name||null!=i&&i.email||null!=i&&i.defaultPaymentMethodId))return null;var c=o?a.createElement($i,null):null!=t&&t.billingPortalUrl?a.createElement(zi,{url:t.billingPortalUrl,text:n.editPaymentDetails,className:"stigg-edit-payment-details-button"}):null;return a.createElement(ii,{className:"stigg-payment-details-section-layout",$backgroundColor:r.backgroundColor,$borderColor:r.borderColor},a.createElement(yn,{className:"stigg-payment-details-section-header"},a.createElement(vn,{isLoading:o,className:"stigg-payment-details-section-title",title:"Payment details"}),c),a.createElement("div",{style:{display:"flex",alignItems:"stretch",gap:64}},l))}var Gi=o(ii,{target:"eqpkdww0"})("position:relative;.stigg-paywall-layout{width:100%;}.stigg-paywall-plans-layout{flex-wrap:nowrap;width:100%;overflow-x:auto;justify-content:unset;padding:10px 0px 0px 0px;}.stigg-paywall-plans-layout .stigg-plan-offering-container:first-of-type{margin-left:auto;}.stigg-paywall-plans-layout .stigg-plan-offering-container:last-child{margin-right:auto;}.","stigg-watermark","{display:none;}"),Yi=a.forwardRef((function(e,t){var n=e.paywallComponent,r=e.theme;return n?a.createElement(Gi,{className:"stigg-customer-portal-paywall-section",ref:t,$backgroundColor:r.backgroundColor,$borderColor:r.borderColor},a.createElement(yn,{className:"stigg-customer-portal-paywall-header"},a.createElement(vn,{isLoading:e.isLoading,className:"stigg-customer-portal-paywall-section-title",title:e.title})),n):null})),Qi=o("div",{target:"e1gjjeod1"})({name:"6xtw2",styles:"width:100%;display:flex;flex-direction:column;align-items:center;& *{box-sizing:border-box;}"}),Ki=o("div",{target:"e1gjjeod0"})({name:"1c31jfu",styles:"width:100%;display:flex;flex-direction:column;align-items:center;row-gap:24px"});function Xi(e,t,n){if(!t&&!n)return e;var r=_(e);return r===_(t||"")||r===_(n||"")?e:e+" ("+n+")"}var Ji=o("div",{target:"eqqveb80"})("display:flex;flex-direction:column;padding:24px;border:",(function(e){return"1px solid "+e.$borderColor}),";border-radius:10px;row-gap:16px;height:100%;",(function(e){return e.$highlight&&"background-color: "+e.theme.stigg.palette.backgroundSection}),";");function ea(e){var t,r,i,o,l=e.entitlement,c=e.subscriptionPrice,s=e.onManageSubscription,u=e.onBuyMore,d=e.hasCustomSubscription,m=e.canUpgradeSubscription,p=dn().theme,g=!l.hasUnlimitedUsage&&l.currentUsage>l.usageLimit;return l.feature?a.createElement(Ji,{$highlight:!!c,$borderColor:p.borderColor},a.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:16}},a.createElement(ki,{variant:"body1"},l.feature&&Xi((o=l.feature).displayName,o.featureUnits,o.featureUnitsPlural)),c&&a.createElement(xi,{title:a.createElement(ke,{variant:"body1"},c.billingModel===n.BillingModel.PerUnit?"Billed for committed usage":"Billed for actual usage")},a.createElement(Rr,{icon:"DollarCoin",svgStrokeColor:p.iconsColor}))),a.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:8}},a.createElement(ki,{variant:"body1",color:g?"error":"primary","data-testid":"usage-data-"+(null==(t=l.feature)?void 0:t.refId)},null==(r=l.currentUsage)?void 0:r.toLocaleString(),!l.hasUnlimitedUsage&&" / "+(null==(i=l.usageLimit)?void 0:i.toLocaleString())+" ("+Bi(l.currentUsage||0,l.usageLimit)+"%)"),a.createElement(Ni,{entitlement:l,feature:l.feature,onBuyMore:u,canBuyMore:!!c,onManageSubscription:s,canUpgradeSubscription:m,hasCustomSubscription:d})),a.createElement(Li,{entitlement:l}),l.hasUnlimitedUsage||z(l.usageLimit)||z(l.currentUsage)||!l.resetPeriod||!l.nextResetDate?null:a.createElement(ke,{color:"secondary"},function(e){if(!e.resetPeriod||!e.nextResetDate)return null;var t=function(t){return h.utc(e.nextResetDate).diff(h.utc(),t)};switch(e.resetPeriod){case"MONTH":return"Resets monthly - in "+t("days")+" days";case"WEEK":return"Resets weekly - in "+t("days")+" days";case"DAY":return"Resets daily - in "+t("hours")+" hours";case"HOUR":return"Resets hourly - in "+t("minutes")+" minutes";default:return null}}(l)),l.hasUnlimitedUsage&&a.createElement(ke,{color:"secondary"},"In current billing period")):null}var ta=o("div",{target:"eoaojje0"})({name:"3hgi0y",styles:"margin-top:32px"});function na(){return a.createElement(c,{container:!0,spacing:4,className:"stigg-subscription-usage-skeleton-layout"},d.range(6).map((function(e){return a.createElement(c,{key:e,item:!0,xs:4},a.createElement(k,{width:280,height:120}))})))}function ra(e){var t=e.onManageSubscription,r=e.onBuyMore,i=a.useState(!1),o=i[0],l=i[1],s=dn(),u=s.customerPortal,m=s.textOverrides,p=s.theme,g=s.isLoading||!u,h=u||{},f=h.entitlements,y=h.subscriptions,v=null==f?void 0:f.filter((function(e){var t,r;return(null==(t=e.feature)?void 0:t.meterType)===n.MeterType.Fluctuating||(null==(r=e.feature)?void 0:r.meterType)===n.MeterType.Incremental})),b=null==y?void 0:y.find((function(e){return e.status===n.SubscriptionStatus.Active})),x=(null==b?void 0:b.pricingType)===n.PricingType.Custom,E=!(null==u||!u.canUpgradeSubscription),w=d.keyBy(null==b?void 0:b.prices,"feature.refId"),k=d.keyBy(v,"feature.refId"),P=d.compact(null==b?void 0:b.prices.map((function(e){return e.feature&&k[e.feature.refId]}))),C=d.compact(null==v?void 0:v.filter((function(e){return!w[e.feature.refId]}))),S=[].concat(P,C),T=S.length>2?4:6,B=o?S:S.slice(0,6);return g||null!=v&&v.length?a.createElement(ii,{className:"stigg-subscription-usage-layout",$backgroundColor:p.backgroundColor,$borderColor:p.borderColor},a.createElement(yn,null,a.createElement(vn,{title:m.usageTabTitle,className:"stigg-customer-portal-usage-section-title",isLoading:g})),g?a.createElement(na,null):a.createElement(a.Fragment,null,a.createElement(c,{container:!0,spacing:4},B.map((function(e){return a.createElement(c,{item:!0,xs:T},a.createElement(ea,{key:e.feature.refId,subscriptionPrice:w[e.feature.refId],entitlement:e,onManageSubscription:t,onBuyMore:r,hasCustomSubscription:x,canUpgradeSubscription:E}))}))),S.length>6&&a.createElement(ta,null,a.createElement(gn,{className:"stigg-usage-toggle-many-button",variant:"text",startIcon:a.createElement(o?I.Minus:I.Plus,null),onClick:function(){return l((function(e){return!e}))}},o?"Show less":"Show more")))):null}function ia(e){var t=e.onManageSubscription,n=e.onBuyMore,r=e.onCancelScheduledUpdates,o=e.onContactSupport,l=e.paywallComponent,c=e.hiddenSections,s=Rt().stigg,u=dn(),d=u.customerPortal,m=u.textOverrides,p=u.theme,g=u.isLoading,h=i.useRef(null),f=function(){var e;t?t():null==h||null==(e=h.current)||e.scrollIntoView({behavior:"smooth"})},y=!(null!=c&&c.some((function(e){return"usage"===e}))),v=!(null!=c&&c.some((function(e){return"paymentDetails"===e||"billingInformation"===e}))),b=!(null!=c&&c.some((function(e){return"invoices"===e||"billingInformation"===e})));return a.createElement(Qi,{className:"stigg-customer-portal-layout"},a.createElement(qi,{showWatermark:s.isWidgetWatermarkEnabled&&!!d}),a.createElement(Ki,{className:"stigg-customer-portal-sections"},a.createElement(Oi,{onCancelScheduledUpdates:r,onBuyMore:n,onManageSubscription:f,onContactSupport:o,hiddenSections:c,cancelScheduledUpdatesButtonTitle:m.cancelScheduledUpdatesButtonTitle}),y&&a.createElement(ra,{onManageSubscription:f,onBuyMore:n}),a.createElement(Yi,{ref:h,paywallComponent:l,theme:p,title:m.paywallSectionTitle,isLoading:!d||g}),v&&a.createElement(Zi,null),b&&a.createElement(oa,null)))}var aa=["textOverrides","theme","resourceId","productId"];function oa(){var e=dn(),t=e.customerPortal,n=e.textOverrides,r=e.theme,i=!t||e.isLoading,o=i?a.createElement($i,null):null!=t&&t.billingPortalUrl?a.createElement(zi,{url:t.billingPortalUrl,text:n.viewInvoiceHistory,className:"stigg-view-invoice-history-button"}):null;return i||null!=t&&t.billingPortalUrl?a.createElement(ii,{className:"stigg-invoices-section-layout",$backgroundColor:r.backgroundColor,$borderColor:r.borderColor},a.createElement(yn,{className:"stigg-invoices-section-header"},a.createElement(vn,{isLoading:i,className:"stigg-invoices-section-title",title:n.invoicesTitle}),o)):null}var la=function(e){return P(e,"addon.displayName")};function ca(e,t){return e.pricePoints.some((function(e){return e.billingPeriod===t}))}function sa(e){var t=e.addon,n=e.currency,r=e.billingCountryCode;return ue({},t,{pricePoints:t.pricePoints.filter((function(e){return e.currency===n&&(!r||e.billingCountryCode===r)}))})}function ua(){var e=Fa()[1];return function(t){return e((function(e){$(e.addonsStep.addons,(function(e){return e.addon.id===t}))}))}}function da(){var e=Fa()[1];return function(t){return e((function(e){e.widgetState.isValid=t}))}}function ma(){var e,t,n={checkoutState:(e=Fa()[0]).checkout,widgetState:e.widgetState,checkoutLocalization:e.checkoutLocalization};return{checkoutState:n.checkoutState,widgetState:n.widgetState,checkoutLocalization:n.checkoutLocalization,setWidgetReadOnly:(t=Fa()[1],function(e){return t((function(t){t.widgetState.readOnly=e}))}),setIsValid:da()}}var pa,ga=function(e,t){return e.minUnitQuantity&&t<e.minUnitQuantity?e.minUnitQuantity:e.maxUnitQuantity&&t>e.maxUnitQuantity?e.maxUnitQuantity:t},ha=function(e,t,n){return e===Y.BillingPeriod.Monthly&&t||e===Y.BillingPeriod.Annually&&n?e:null},fa=function(e){return e.pricingModel===n.BillingModel.PerUnit};function ya(){var e=Fa()[1];return function(t,n){return e((function(e){var r=e.planStep.billableFeatures.find((function(e){return e.featureId===t}));r?r.quantity=n:e.planStep.billableFeatures.push({featureId:t,quantity:n})}))}}function va(){var e;return ue({},Fa()[0].planStep,{setBillingPeriod:(e=Fa()[1],function(t){return e((function(e){e.planStep.billingPeriod=t}))}),setBillableFeature:ya()})}!function(e){e.PLAN="PLAN",e.ADDONS="ADDONS",e.PAYMENT="PAYMENT"}(pa||(pa={}));var ba=[{key:pa.PLAN,label:"Plan"},{key:pa.ADDONS,label:"Add-ons"},{key:pa.PAYMENT,label:"Payment details"}],xa={activeStep:0,completedSteps:[],steps:ba,isDisabled:!1};function Ea(){var e=Fa()[1];return function(t){return e((function(e){e.progressBar.completedSteps.push(t)}))}}function wa(){var e=Fa()[1];return function(){return e((function(e){var t=e.progressBar;t.isDisabled||(t.completedSteps.includes(t.activeStep)||t.completedSteps.push(t.activeStep),t.activeStep<t.steps.length-1&&(t.activeStep+=1))}))}}function ka(){var e=Fa()[1];return function(t){return e((function(e){e.progressBar.isDisabled=!!t}))}}function Pa(){var e,t,n=Fa()[0].progressBar;return{currentStep:n.steps[n.activeStep],progressBarState:n,isLastStep:n.activeStep===n.steps.length-1,isCheckoutComplete:(t=n,t.completedSteps.length>=t.steps.length-1),setActiveStep:(e=Fa()[1],function(t){return e((function(e){e.progressBar.activeStep=t}))}),markStepAsCompleted:Ea(),goNext:wa(),setIsDisabled:ka()}}function Ca(){var e=Fa()[0],t=e.paymentStep;return ue({},e.planStep,{addons:e.addonsStep.addons,promotionCode:e.promotionCode,billingAddress:t.billingAddress,taxPercentage:t.taxPercentage})}function Sa(e){var t=e.billingAddress,n=e.taxPercentage;return t||n?{billingInformation:ue({},t?{billingAddress:t}:{},n?{taxPercentage:n}:{})}:{}}var Ta=function(){var e=se(Ot.mark((function e(t){var n,r,i,a,o,l,c,s,u,d,m,p,g,h,f,y,v,b;return Ot.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.stigg,r=t.customerId,i=t.planId,a=t.resourceId,o=t.promotionCode,l=t.billableFeatures,c=t.billingCountryCode,s=t.billingPeriod,u=t.billingAddress,d=t.taxPercentage,m=t.onMockCheckoutPreview,p=t.addons.map((function(e){return{addonId:e.addon.id,quantity:e.quantity}})),g=null,h=null,e.prev=4,!r||!i){e.next=15;break}if(f=ue({customerId:r,planId:i,resourceId:a,billingCountryCode:c,addons:p,billingPeriod:s,promotionCode:o,billableFeatures:F(l)?void 0:l},Sa({billingAddress:u,taxPercentage:d})),!m){e.next=11;break}e.t0=m(f),e.next=14;break;case 11:return e.next=13,n.previewSubscription(f);case 13:e.t0=e.sent;case 14:g=e.t0;case 15:e.next=21;break;case 17:e.prev=17,e.t1=e.catch(4),v=(null==e.t1||null==(y=e.t1.message)?void 0:y.split("Error:"))||[],h=null==(b=v[1])?void 0:b.trim();case 21:return e.abrupt("return",{subscriptionPreview:g,errorMessage:h});case 22:case"end":return e.stop()}}),e,null,[[4,17]])})));return function(t){return e.apply(this,arguments)}}(),Ba=function(e){var t=(void 0===e?{}:e).onMockCheckoutPreview,n=Rt().stigg,r=Ca(),a=Fa()[0].resourceId,o=ma(),l=o.widgetState,c=o.checkoutState||{},s=c.plan,u=c.customer;return{previewSubscriptionAction:i.useCallback(function(){var e=se(Ot.mark((function e(i){var o;return Ot.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=(void 0===i?{}:i).promotionCode,l.isValid){e.next=3;break}return e.abrupt("return",{subscriptionPreview:null,errorMessage:null});case 3:return e.abrupt("return",Ta({stigg:n,customerId:null==u?void 0:u.id,planId:null==s?void 0:s.id,resourceId:a,addons:r.addons,billableFeatures:r.billableFeatures,billingCountryCode:r.billingCountryCode,billingPeriod:r.billingPeriod,billingAddress:r.billingAddress,taxPercentage:r.taxPercentage,promotionCode:null!=o?o:r.promotionCode,onMockCheckoutPreview:t}));case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[n,null==u?void 0:u.id,null==s?void 0:s.id,a,r.addons,r.billableFeatures,r.billingCountryCode,r.billingPeriod,r.billingAddress,r.taxPercentage,r.promotionCode,l.isValid,t])}};function Ma(){var e=Fa()[1];return function(t){return e((function(e){e.paymentStep.errorMessage=t}))}}function Aa(){var e=Fa()[1];return function(t){return e((function(e){e.paymentStep.billingAddress=t}))}}function Ua(){var e;return ue({},Fa()[0].paymentStep,{setUseNewPaymentMethod:(e=Fa()[1],function(t){return e((function(e){e.paymentStep.useNewPaymentMethod=t}))}),setErrorMessage:Ma(),setBillingAddress:Aa()})}var La=a.createContext(null);La.displayName="CheckoutContext";var Fa=function(){var e=i.useContext(La);if(!e)throw new Error("Could not find Checkout context; You need to wrap your checkout components in an <CheckoutProvider> component.");return e},Na=function(e){var t=e.children,n=e.initialState,r=i.useState(n),o=r[0],l=r[1];i.useEffect((function(){l(n)}),[n]);var c=i.useCallback((function(e){return l((function(t){return H.produce(t,(function(t){return e(t)}))}))}),[l]),s=i.useMemo((function(){return[o,c]}),[c,o]);return a.createElement(La.Provider,{value:[s[0],s[1]]},t)};function Ia(e){var t,r=e.children,o=e.textOverrides,l=e.theme,c=e.preferredBillingPeriod,s=e.billableFeatures,u=e.billingCountryCode,d=e.billingInformation,m=function(e){var t=e.planId,n=e.resourceId,r=e.billingCountryCode,a=e.onMockCheckoutState,o=Rt().stigg,l=i.useState(!0),c=l[0],s=l[1],u=i.useState(),d=u[0],m=u[1];return i.useEffect((function(){var e=function(){var e=se(Ot.mark((function e(){return Ot.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,o.getCheckoutState({planId:t,resourceId:n,billingCountryCode:r});case 3:m(e.sent),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),jt.error("Failed to load checkout "+(null==e.t0?void 0:e.t0.message),e.t0);case 10:return e.prev=10,s(!1),e.finish(10);case 13:case"end":return e.stop()}}),e,null,[[0,7,10,13]])})));return function(){return e.apply(this,arguments)}}();if(a)return s(!1),void m(a({planId:t,resourceId:n,billingCountryCode:r}));o.isCustomerLoaded&&(s(!0),e())}),[o,o.isCustomerLoaded,n,t,r,a]),{checkout:d,isLoading:c}}({resourceId:e.resourceId,planId:e.planId,billingCountryCode:u,onMockCheckoutState:e.onMockCheckoutState}),p=m.checkout,f=m.isLoading,y=null!=p&&p.configuration?function(e){var t=e.palette;return{palette:{primary:(null==t?void 0:t.primary)||void 0,backgroundPaper:(null==t?void 0:t.backgroundColor)||void 0,outlinedBorder:(null==t?void 0:t.borderColor)||void 0,text:{primary:(null==t?void 0:t.textColor)||void 0},backgroundHighlight:(null==t?void 0:t.summaryBackgroundColor)||void 0},typography:Vt(e.typography,zt)}}(p.configuration):{typography:Vt(zt)},v=ln(y),b=i.useMemo((function(){var e,t,r,i,a=function(e,t,n){var r=(e||{}).palette;return{primary:(null==t?void 0:t.primary)||(null==r?void 0:r.primary)||"rgb(50, 126, 238)",textColor:(null==t?void 0:t.textColor)||(null==r?void 0:r.text.primary)||"rgb(0, 30, 108)",backgroundColor:(null==t?void 0:t.backgroundColor)||(null==r?void 0:r.backgroundPaper)||"rgb(255, 255, 255)",borderColor:(null==t?void 0:t.borderColor)||(null==r?void 0:r.outlinedBorder)||"rgb(235, 237, 243)",summaryBackgroundColor:(null==t?void 0:t.summaryBackgroundColor)||(null==r?void 0:r.backgroundHighlight)||"rgb(109, 121, 144)"}}(v,l),m=g({changePlan:"Change",billingPeriodsTitle:"Billing cycle",addAddonText:"Add",newPaymentMethodText:"New payment method",newPaymentMethodBillingAddressTitle:"Billing address",newPaymentMethodCardTitle:"Payment method",summary:{title:"Order summary",planName:function(e){return e.plan.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:function(){return"Base charge"},totalText:"Total",totalDueText:"Total due today",totalBillingPeriodText:function(e){return"Billed "+e.billingPeriod.toLowerCase()},appliedCreditsTitle:"Applied credits",creditsForUnusedTimeText:function(e){return"Your account will be granted credits worth "+e.credits+" for unused time, which will be automatically applied to future payments."},discountText:function(e){var t,r=e.discountDetails;t=r.type===n.DiscountType.Percentage?r.value+"% off":""+Xe({amount:r.value,currency:e.currency});var i="";switch(r.durationType){case n.DiscountDurationType.Once:i=" once";break;case n.DiscountDurationType.Repeating:i=(r.type===n.DiscountType.Fixed?" per month":"")+" for "+r.durationInMonths+" months";break;case n.DiscountDurationType.Forever:default:i=""}return""+t+i},taxTitle:function(e){var t=e.taxDetails;return"Tax ("+(null==t?void 0:t.percentage)+"%)"},changesWillApplyAtEndOfBillingPeriod:function(e){return"Your changes will take effect at the end of your current billing cycle on "+h(e.billingPeriodEnd).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:function(){return"We’re sorry to see you cancel your paid subscription 😭"},freePlanHeader:function(){return"New plan"},freePlanName:function(e){return""+e.plan.displayName},freePlanPriceText:function(){return"Free"},paidPlanHeader:function(){return"Current plan"},paidPlanName:function(e){return""+e.plan.displayName},paidPlanPriceText:function(e){var t=e.billingPeriod;return"Paid plan"+(t?", billed "+t.toLowerCase():"")}}},o),y=function(e){var t=e.plan,n=e.activeSubscription,r=e.billingCountryCode,i=e.preconfiguredBillableFeatures,a=function(e){var t,n,r=e.plan,i=e.activeSubscription,a=e.preferredBillingPeriod,o=null==r?void 0:r.pricePoints.some((function(e){return e.billingPeriod===Y.BillingPeriod.Monthly})),l=null==r?void 0:r.pricePoints.some((function(e){return e.billingPeriod===Y.BillingPeriod.Annually}));if(a){var c=ha(a,o,l);if(c)return c}if((null==i||null==(t=i.plan)?void 0:t.id)===(null==r?void 0:r.id))return(null==i||null==(n=i.price)?void 0:n.billingPeriod)||Y.BillingPeriod.Monthly;if(null!=i&&i.prices&&(null==i?void 0:i.prices.length)>0){var s=ha(null==i?void 0:i.prices[0].billingPeriod,o,l);if(s)return s}return l?Y.BillingPeriod.Annually:Y.BillingPeriod.Monthly}({plan:t,activeSubscription:n,preferredBillingPeriod:e.preferredBillingPeriod}),o=function(e,t,n){var r;if(!t)return[];var i=Z(e,"featureId"),a=Z(G(null==n||null==(r=n.prices)?void 0:r.map((function(e){var t=e.feature;return t&&fa(e)?{featureId:t.featureId,quantity:t.unitQuantity||null}:null}))),"featureId");return G(null==t?void 0:t.map((function(e){var t,n,r,o,l=null==(t=e.feature)?void 0:t.featureId;if(!l||!fa(e))return null;var c=(null==(n=i[l])?void 0:n.quantity)||(null==(r=a[l])?void 0:r.quantity);return o=ga(e,c||1),e.isTieredPrice&&(o=je(e.tiers,o).upTo),{featureId:l,quantity:o}})))}(i,null==t?void 0:t.pricePoints.filter((function(e){return e.billingPeriod===a})),n);return{billingPeriod:a,billableFeatures:o,billingCountryCode:r}}({preferredBillingPeriod:c,plan:null==p?void 0:p.plan,activeSubscription:null==p?void 0:p.activeSubscription,billingCountryCode:u,preconfiguredBillableFeatures:null!=s?s:[]}),b=function(e){var t,r,i=e.activeSubscription,a=e.plan,o=e.billingPeriod,l=e.billingCountryCode,c=[],s=(null==a||null==(t=a.pricePoints)||null==(r=t[0])?void 0:r.currency)||n.Currency.Usd,u=function(e){return P(e,"displayName")}(function(e){var t,n=e.addons,r=e.billingPeriod,i=e.billingCountryCode,a=e.currency;return(null==n||null==(t=n.filter((function(e){return ca(e,r)})))?void 0:t.map((function(e){return sa({addon:e,currency:a,billingCountryCode:i})})))||[]}({addons:null==a?void 0:a.compatibleAddons,billingPeriod:o,billingCountryCode:l,currency:s})),d=function(e){var t,n=e.addons,r=e.billingPeriod,i=e.billingCountryCode,a=e.currency;return(null==n||null==(t=n.filter((function(e){return ca(e.addon,r)})))?void 0:t.map((function(e){return ue({},e,{addon:sa({addon:e.addon,currency:a,billingCountryCode:i})})})))||[]}({addons:null==i?void 0:i.addons,billingPeriod:o,billingCountryCode:l,currency:s});return null!=d&&d.length&&null!=u&&u.length&&(c=la(d.filter((function(e){return u.some((function(t){return t.id===e.addon.id}))})))),{addons:c,initialAddons:V(c),availableAddons:u}}({plan:null==p?void 0:p.plan,billingPeriod:y.billingPeriod,activeSubscription:null==p?void 0:p.activeSubscription}),x={useNewPaymentMethod:!(null!=(i=(r={customer:null==p?void 0:p.customer,taxPercentage:null==d||null==(e=d.taxDetails)?void 0:e.taxPercentage}).customer)&&i.paymentMethodDetails),taxPercentage:r.taxPercentage},E=function(e){var t=e.availableAddons;return 0===(null==t?void 0:t.length)?ue({},xa,{steps:ba.filter((function(e){return e.key!==pa.ADDONS}))}):xa}({availableAddons:f?void 0:b.availableAddons});return{checkout:p,checkoutLocalization:m,stiggTheme:v,theme:a,progressBar:E,planStep:y,addonsStep:b,paymentStep:x,resourceId:null==p||null==(t=p.resource)?void 0:t.id,widgetState:{readOnly:!1,isValid:!0,isLoadingCheckoutData:f}}}),[c,u,p,f,null==d||null==(t=d.taxDetails)?void 0:t.taxPercentage]);return a.createElement(sn,{key:null==p?void 0:p.plan.id,componentTheme:y},a.createElement(Na,{initialState:b},r))}var Da,Oa=o("div",{target:"ergo9xd2"})("margin:auto;width:100%;min-height:760px;max-width:920px;display:flex;position:relative;flex-direction:column;align-items:center;padding:16px 32px;border-radius:10px;background-color:",(function(e){return e.theme.stigg.palette.backgroundPaper}),";border:",(function(e){return"1px solid "+e.theme.stigg.palette.outlinedBorder}),";& *{box-sizing:border-box;}"),ja=o(U,{target:"ergo9xd1"})({name:"1pdbip7",styles:"display:flex;align-items:flex-start;gap:32px;flex-wrap:wrap;width:100%"}),qa=o(U,{target:"ergo9xd0"})({name:"fszphw",styles:"display:flex;flex-direction:column;gap:0;flex:2"}),Ra=o(R,{shouldForwardProp:function(e){return!e.startsWith("$")},target:"e9upyia2"})((function(e){var t,n=e.theme,r=e.$disabled;return(t={})["&."+q.linearProgressClasses.root]={borderRadius:n.stigg.border.radius,backgroundColor:n.stigg.palette.outlinedBorder},t["& ."+q.linearProgressClasses.bar]={backgroundColor:r?n.stigg.palette.primaryLight:n.stigg.palette.primary},t}),""),Wa=o(M,{target:"e9upyia1"})((function(){var e;return(e={})["&."+B.buttonClasses.root]={textTransform:"none",lineHeight:"inherit",justifyContent:"flex-start",padding:"8px 4px"},e}),""),za=o(Rr,{shouldForwardProp:function(e){return!e.startsWith("$")},target:"e9upyia0"})((function(e){var t=e.theme,n=e.$disabled;return{circle:{stroke:n?t.stigg.palette.primaryLight:t.stigg.palette.primary,fill:e.$shouldFill?n?t.stigg.palette.primaryLight:t.stigg.palette.primary:void 0}}}),""),_a=o(c,{shouldForwardProp:function(e){return!e.startsWith("$")},target:"e1v7qkry3"})("display:flex;flex-direction:",(function(e){return e.$flexDirection||"row"}),";gap:",(function(e){return e.$gap}),"px;"),Ha=o(_a,{target:"e1v7qkry2"})({name:"o7lzx8",styles:"span{display:flex;flex:1;}"}),Va=o(c,{target:"e1v7qkry1"})("span{display:flex;flex:",(function(e){return e.flex}),";}"),$a=o(k,{target:"e1v7qkry0"})({name:"1u8hqvf",styles:"border-radius:4px"}),Za=function(){var e=Pa(),t=e.progressBarState,n=e.setActiveStep,r=ma().widgetState,i=r.readOnly,o=r.isLoadingCheckoutData,l=t||{},s=l.activeStep,u=l.completedSteps,d=l.steps;return a.createElement(U,{sx:{width:"100%",mb:3}},a.createElement(Ra,{variant:"determinate",value:100*(s+1)/d.length,$disabled:i}),a.createElement(c,{container:!0,display:"flex"},d.map((function(e,r){var l=e.key,d=e.label,m=u.includes(r),p=i||r>s&&!m&&!u.includes(r-1)||s!==r&&t.isDisabled,g=p?"OutlinedCheckedCircleDisabled":"OutlinedCheckedCircle";return a.createElement(c,{key:l,item:!0,display:"flex",flexDirection:"row",flex:1,justifyContent:"flex-start"},o?a.createElement($a,{width:120,height:20,style:{marginTop:8}}):a.createElement(Wa,{onClick:function(){return n(r)},fullWidth:!0,disabled:p},a.createElement(c,{item:!0,display:"flex",flexDirection:"row",alignItems:"center",gap:1},a.createElement(K,{icon:a.createElement(za,{icon:m?g:"OutlinedCircle",$disabled:p,$shouldFill:m})}),a.createElement(ke,{variant:"h6",color:p?"primary.main.light":"primary.main"},d))))}))))},Ga=[n.BillingModel.FlatFee,n.BillingModel.PerUnit,n.BillingModel.UsageBased],Ya=function(e){return i.useMemo((function(){return function(e){return P(e,[function(e){return Ga.indexOf(e.pricingModel)},function(e){var t;return null==(t=e.feature)?void 0:t.displayName}])}(e)}),[e])},Qa=["variant"],Ka=o(M,{shouldForwardProp:function(e){return!e.startsWith("$")},target:"effv4rq0"})("border-radius:10px;text-transform:none;background-color:",(function(e){var t=e.theme;return e.$success?t.stigg.palette.success:e.$error?t.stigg.palette.error:""}),";&:hover{background-color:",(function(e){var t=e.theme;return e.$success?t.stigg.palette.successDark:e.$error?t.stigg.palette.errorDark:""}),";}"),Xa=function(e){var t=e.variant,n=void 0===t?"outlined":t,r=de(e,Qa);return a.createElement(Ka,Object.assign({variant:n},r))},Ja=te(ne)((function(e){var t=e.theme;return{"& .MuiOutlinedInput-root":{height:"42px",borderRadius:t.stigg.border.radius,fieldset:{borderColor:t.stigg.palette.outlinedBorder},"&:not(.Mui-focused):hover fieldset":{borderColor:t.stigg.palette.outlinedRestingBorder}},"& .MuiInputBase-input":ue({padding:"8px 12px",borderRadius:t.stigg.border.radius,fontFamily:t.stigg.typography.fontFamily,color:t.stigg.palette.text.primary},t.stigg.typography.body),"& .Mui-error":{fontFamily:t.stigg.typography.fontFamily}}})),eo=o(c,{target:"e1q84ats0"})({name:"1fttcpj",styles:"display:flex;flex-direction:column"});function to(){return a.createElement(eo,{container:!0},a.createElement(_a,{item:!0,$gap:48},a.createElement($a,{width:120,height:20}),a.createElement($a,{width:120,height:20})),a.createElement(W,{className:"stigg-checkout-plan-header-divider",sx:{marginY:2}}),a.createElement(eo,{item:!0},a.createElement($a,{width:120,height:20}),a.createElement(Ha,{$gap:16,marginTop:3},a.createElement($a,{height:20}),a.createElement($a,{height:20})),a.createElement(_a,{$gap:130,marginTop:3},a.createElement(Va,{flex:1},a.createElement($a,{height:20})),a.createElement(Va,{flex:3},a.createElement($a,{height:20})))))}function no(){var e;return{promotionCode:Fa()[0].promotionCode,setPromotionCode:(e=Fa()[1],function(t){return e((function(e){e.promotionCode=t}))})}}function ro(){return(ro=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var io=o((function(e){return i.createElement("svg",ro({width:20,height:20,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),Da||(Da=i.createElement("g",{stroke:"#327EEE",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},i.createElement("path",{d:"M10 4.167v11.666M4.167 10h11.667"}))))}),{shouldForwardProp:function(e){return!e.startsWith("$")},target:"e3hfkj90"})("margin-right:8px;path{stroke:",(function(e){var t=e.theme;return e.$disabled?t.stigg.palette.text.disabled:t.stigg.palette.primary}),";}"),ao=function(e){var t=e.checkoutLocalization,n=e.disabled;return a.createElement(Xa,{disabled:n,fullWidth:!0,className:"stigg-checkout-summary-add-coupon-code-button",sx:{textTransform:"none",justifyContent:"flex-start",color:n?"text.disabled":"primary.main"},variant:"text",size:"medium",onClick:e.onAddClick},a.createElement(io,{$disabled:n,className:"stigg-checkout-summary-add-coupon-code-button-icon"}),a.createElement(ke,{className:"stigg-checkout-change-plan-button-text",color:n?"disabled":"primary.main",style:{lineHeight:"24px"},variant:"h3"},t.summary.addCouponCodeText))},oo=o(Xa,{target:"e8kocin0"})("padding:4px 10px;min-width:unset;border-radius:",(function(e){return e.theme.stigg.border.radius}),";display:flex;align-items:center;"),lo=function(e){var t=e.disabled,n=e.checkoutLocalization,r=e.onMockCheckoutPreview,o=no().setPromotionCode,l=i.useState(!1),s=l[0],u=l[1],d=a.useState(""),m=d[0],p=d[1],g=a.useState(!1),h=g[0],f=g[1],y=a.useState(""),v=y[0],b=y[1],x=Ba({onMockCheckoutPreview:r}).previewSubscriptionAction,E=function(){var e=se(Ot.mark((function e(){var t,n,r,i;return Ot.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return f(!0),b(""),e.next=4,x({promotionCode:m});case 4:r=(n=e.sent).subscriptionPreview,!(i=n.errorMessage)&&null!=r&&null!=(t=r.immediateInvoice)&&t.discountDetails?(o(m.toUpperCase()),u(!1)):i&&b(i),f(!1);case 9:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return s?a.createElement(c,null,a.createElement(ke,{variant:"body1",color:v?"error":t?"disabled":"primary.main"},n.summary.couponCodeTitle),a.createElement(Ja,{disabled:t,autoFocus:!0,variant:"outlined",fullWidth:!0,error:!!v,value:m,onChange:function(e){p(e.target.value)},inputProps:{maxLength:20},onKeyDown:function(e){"Enter"===e.key&&(E(),e.preventDefault())},InputProps:{endAdornment:a.createElement(oo,{variant:"contained",disabled:t,onClick:function(){E()}},h?a.createElement(J,{size:18,sx:{color:"white"}}):a.createElement(Rr,{style:{display:"flex"},icon:"ArrowForward"}))}}),!!v&&a.createElement(ke,{variant:"body1",color:"error"},v)):a.createElement(ao,{disabled:t,onAddClick:function(){return u(!0)},checkoutLocalization:n})},co=o(c,{target:"e1cvrfx31"})("width:auto;display:inline-flex;align-items:center;flex-direction:row;gap:8px;padding:6px 8px;border-radius:",(function(e){return e.theme.stigg.border.radius}),";border:1px solid ",(function(e){return e.theme.stigg.palette.primary}),";"),so=o(Rr,{shouldForwardProp:function(e){return"style"!==e},target:"e1cvrfx30"})("display:flex;g{stroke:",(function(e){return e.theme.stigg.palette.primary}),";}path{fill:",(function(e){return e.$shouldFill?e.theme.stigg.palette.primary:void 0}),";}"),uo=function(e){var t=e.promotionCode,n=e.onClearPromotionCode;return a.createElement(co,{container:!0},a.createElement(c,{item:!0,display:"flex",gap:1,alignItems:"center"},a.createElement(so,{icon:"Coupon"}),a.createElement(ke,{variant:"body1",color:"primary.main",lineHeight:"auto"},t)),a.createElement(c,{item:!0},a.createElement(Xa,{variant:"text",sx:{minWidth:"unset",padding:0},onClick:n},a.createElement(so,{icon:"Close",$shouldFill:!0}))))},mo=o("div",{target:"eqejwsl0"})({name:"1k6141t",styles:"margin:16px 0"}),po=function(e){var t=e.disabled,n=e.checkoutLocalization,r=e.onMockCheckoutPreview,i=no(),o=i.promotionCode,l=i.setPromotionCode,c=o?a.createElement(uo,{promotionCode:o,onClearPromotionCode:function(){l("")}}):a.createElement(lo,{disabled:t,checkoutLocalization:n,onMockCheckoutPreview:r});return a.createElement(mo,null,c)},go=["postal_code"];function ho(e){var t,n=e.onBillingAddressChange,r=e.collectPhoneNumber,i=ma(),o=i.checkoutState,l=i.checkoutLocalization,s=i.widgetState,u=i.setWidgetReadOnly,d=Ua().setBillingAddress,m=o||{},p=m.customer,g=m.configuration,h=s.readOnly,f=!!(null!=r?r:null==g||null==(t=g.content)?void 0:t.collectPhoneNumber);return a.createElement(c,{flexDirection:"column",container:!0,gap:3,padding:"16px",sx:{pointerEvents:h?"none":void 0}},a.createElement(c,{flexDirection:"column",container:!0,gap:2},a.createElement(ke,{variant:"h6"},l.newPaymentMethodBillingAddressTitle),a.createElement(Q.AddressElement,{onChange:function(e){if(e.complete){var t=e.value.address,r=ue({postalCode:t.postal_code},de(t,go));u(!0),d(r),n?function(){var e=se(Ot.mark((function e(){return Ot.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n({billingAddress:r});case 2:u(!1);case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()():u(!1)}},options:{mode:"billing",fields:{phone:f?"always":"auto"},defaultValues:ue({},(null==p?void 0:p.name)&&{name:p.name})}})),a.createElement(c,{flexDirection:"column",container:!0,gap:2},a.createElement(ke,{variant:"h6"},l.newPaymentMethodCardTitle),a.createElement(Q.PaymentElement,{onChange:function(){},onReady:function(){},options:{readOnly:h,terms:{card:"never"},defaultValues:{billingDetails:ue({},(null==p?void 0:p.name)&&{name:p.name},(null==p?void 0:p.email)&&{email:p.email})}}})))}function fo(e){return yo.apply(this,arguments)}function yo(){return(yo=se(Ot.mark((function e(t){var n,r;return Ot.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.elements){e.next=5;break}return console.error("Stripe elements not initialized"),e.abrupt("return",{success:!1,errorMessage:"Stripe elements not initialized"});case 5:return e.next=7,n.submit();case 7:if(!(r=e.sent.error)){e.next=12;break}return console.log(r.message),e.abrupt("return",{success:!1,errorMessage:r.message||""});case 12:return e.abrupt("return",{success:!0});case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function vo(e){return bo.apply(this,arguments)}function bo(){return(bo=se(Ot.mark((function e(t){var r,i,a,o,l,c,s;return Ot.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(c=null==(o=t.applySubscriptionResults)||null==(r=o.subscription)||null==(i=r.latestInvoice)?void 0:i.paymentSecret,!(l=t.stripe)||!c||(null==o||null==(a=o.subscription)?void 0:a.paymentCollection)!==n.PaymentCollection.ActionRequired){e.next=9;break}return e.next=5,l.handleNextAction({clientSecret:c});case 5:if(!(s=e.sent.error)){e.next=9;break}return e.abrupt("return",{errorMessage:s.message||""});case 9:return e.abrupt("return",{subscription:null==o?void 0:o.subscription});case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function xo(e){return Eo.apply(this,arguments)}function Eo(){return(Eo=se(Ot.mark((function e(t){var n,r,i,a,o,l,c;return Ot.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.stripe,r=t.elements,i=t.clientSecret,e.next=3,n.confirmSetup({elements:r,confirmParams:{return_url:window.location.href},redirect:"if_required"});case 3:if(!(l=e.sent.error)){e.next=9;break}"card_error"===l.type||"validation_error"===l.type?"card_error"===l.type&&(o=l.message||""):o="An unexpected error occurred.",e.next=21;break;case 9:return e.prev=9,e.next=12,n.retrieveSetupIntent(i);case 12:null!=(c=e.sent.setupIntent)&&c.payment_method&&(a=c.payment_method),e.next=21;break;case 17:e.prev=17,e.t0=e.catch(9),o="An unexpected error occurred.",console.error(e.t0);case 21:return e.abrupt("return",{newPaymentMethodId:a,setupErrorMessage:o});case 22:case"end":return e.stop()}}),e,null,[[9,17]])})))).apply(this,arguments)}function wo(e){return ko.apply(this,arguments)}function ko(){return(ko=se(Ot.mark((function e(t){var n,r,i,a,o,l,c;return Ot.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.elements,i=t.setupIntentClientSecret,(n=t.stripe)&&r&&i){e.next=3;break}return e.abrupt("return",{success:!1});case 3:return e.next=5,fo({elements:r});case 5:if((a=e.sent).success){e.next=8;break}return e.abrupt("return",{success:!1,errorMessage:a.errorMessage});case 8:return e.next=10,xo({stripe:n,elements:r,clientSecret:i});case 10:if(l=(o=e.sent).newPaymentMethodId,!(c=o.setupErrorMessage)&&l){e.next=15;break}return e.abrupt("return",{success:!1,errorMessage:c});case 15:return e.abrupt("return",{success:!0,paymentMethodId:l});case 16:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Po={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:!1},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:!1},{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:!1},{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:!1},{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:!1}],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:!1},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:!1},{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:!1},{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:!1},{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:!1}],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:!1},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:!1},{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:!1},{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:!1},{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:!1}],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:!1},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:!1},{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:!1},{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:!1},{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:!1}],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:!1},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:!1},{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:!1},{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:!1},{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:!1}],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:!1},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:!1},{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:!1},{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:!1},{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:!1}],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:!1},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:!1},{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:!1},{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:!1},{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:!1}],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:!1},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:!1},{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:!1},{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:!1},{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:!1}],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:!1},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:!1},{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:!1},{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:!1},{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:!1}],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:!1},{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:!1},{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:!1},{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:!1}],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:{}},Co=o(U,{target:"eeyi5d31"})("@keyframes blurFade{0%{background-color:",(function(e){return p(e.theme.stigg.palette.backgroundPaper).alpha(0).toString()}),";backdrop-filter:blur(0px);}100%{background-color:",(function(e){return p(e.theme.stigg.palette.backgroundPaper).alpha(.9).toString()}),";backdrop-filter:blur(6.5px);}}position:absolute;top:0;left:0;bottom:0;right:0;z-index:5;background-color:",(function(e){return p(e.theme.stigg.palette.backgroundPaper).alpha(.9).toString()}),";animation:blurFade 2s ease-in forwards;display:flex;flex-direction:column;justify-content:center;* rect{fill:transparent;}& path{stroke:",(function(e){return e.theme.stigg.palette.primary}),";}"),So=o(ke,{target:"eeyi5d30"})({name:"1kkk1zv",styles:"@keyframes fadeIn{0%{opacity:0;}75%{opacity:0;}100%{opacity:1;}}align-self:center;animation:fadeIn 5s ease-in forwards"});function To(e){var t=e.checkoutLocalization;return a.createElement(Co,{className:"stigg-checkout-success-container"},a.createElement(ie,{width:350,height:"auto",isClickToPauseDisabled:!0,options:{loop:!1,autoplay:!0,animationData:Po}}),a.createElement(So,{variant:"h1",color:"primary.main"},t.summary.checkoutSuccessText))}var Bo=function(e){return new Promise((function(t){return setTimeout(t,e)}))},Mo=function(e){var t=e.width,n=e.height,r=e.children;return e.isLoading?a.createElement($a,{width:void 0===t?50:t,height:void 0===n?16:n}):a.createElement(a.Fragment,null,r)},Ao=function(e){var t,n,r,i,o=e.isFetchingSubscriptionPreview,l=e.checkoutLocalization,c=(e.subscriptionPreview||{}).immediateInvoice;if(null==c||null==(t=c.proration)||null==(n=t.netAmount)||!n.amount||(null==c||null==(r=c.proration)||null==(i=r.netAmount)?void 0:i.amount)>=0)return null;var s=Xe({amount:-1*c.proration.netAmount.amount,currency:c.proration.netAmount.currency,minimumFractionDigits:2});return a.createElement(ke,{variant:"caption",style:{marginTop:14}},a.createElement(Mo,{isLoading:o,width:"100%"},l.summary.creditsForUnusedTimeText({credits:s})))},Uo=function(e){var t=e.subscriptionPreview,n=e.activeSubscription,r=e.isFetchingSubscriptionPreview,i=e.checkoutLocalization;if(null==t||!t.hasScheduledUpdates||null==n||!n.currentBillingPeriodEnd)return null;var o="function"==typeof i.summary.changesWillApplyAtEndOfBillingPeriod?i.summary.changesWillApplyAtEndOfBillingPeriod({billingPeriodEnd:n.currentBillingPeriodEnd}):i.summary.changesWillApplyAtEndOfBillingPeriod;return a.createElement(ke,{variant:"caption",style:{marginTop:14}},a.createElement(Mo,{isLoading:r,width:"100%"},o))},Lo=function(e){var t=e.subscriptionPreview,r=e.activeSubscription,i=e.plan,o=e.isFetchingSubscriptionPreview,l=e.billingPeriod,c=(t||{}).recurringInvoice;if(!t||null==c||!c.total.amount)return null;var s,u,d=t.hasScheduledUpdates?null==r?void 0:r.currentBillingPeriodEnd:null==t?void 0:t.billingPeriodRange.end,m=Xe(ue({},c.total,{minimumFractionDigits:2})),p=null==i?void 0:i.pricePoints.some((function(e){return e.pricingModel===n.BillingModel.UsageBased})),g=null==i?void 0:i.pricePoints.some((function(e){return e.pricingModel!==n.BillingModel.UsageBased})),f="We will bill you ",y=m+" ";switch(p&&(g?y+="+":y="for",y+=" applicable usage-based charges for this subscription "),l){case n.BillingPeriod.Monthly:u="month",s="the "+h(d).format("Do");break;case n.BillingPeriod.Annually:u="year",s=h(d).format("MMMM Do")}return a.createElement(ke,{variant:"body1",style:{marginTop:14}},a.createElement(Mo,{isLoading:o,width:"100%"},f+=y+"for this subscription every "+u+" on "+s+", unless you cancel."))};function Fo(e){return a.createElement(a.Fragment,null,a.createElement(Ao,Object.assign({},e)),a.createElement(Uo,Object.assign({},e)),a.createElement(Lo,Object.assign({},e)))}var No=o("div",{target:"e1ultpe61"})({name:"rdmn2i",styles:"&+&{margin-top:8px;}"}),Io=o("div",{target:"e1ultpe60"})({name:"bcffy2",styles:"display:flex;align-items:center;justify-content:space-between"}),Do=function(e){var t=a.createElement(ke,{variant:"body1"},e.checkoutLocalization.summary.payAsYouGoTooltipText);return a.createElement(xi,{placement:"left",title:t},a.createElement(Rr,{icon:"PayAsYouGoCharge",style:{display:"flex"}}))},Oo=function(e){var t,r=e.checkoutLocalization,i=e.label,o=e.quantity,l=e.price,s=l.billingPeriod,u=l.pricingModel===n.BillingModel.UsageBased;return t=l.isTieredPrice?je(l.tiers,o).unitPrice.amount:l.amount,a.createElement(No,null,a.createElement(Io,{style:{alignItems:"flex-start"}},a.createElement(c,{item:!0},a.createElement(ke,{variant:"body1",color:"secondary"},i),(o>1||s===n.BillingPeriod.Annually)&&a.createElement(ke,{variant:"body1",color:"secondary"},function(e){var t=e.amount,r=e.price,i=e.quantity,a=null;r.billingPeriod===n.BillingPeriod.Annually&&(t/=12,a="12 months");var o=Xe({amount:t,currency:r.currency,minimumFractionDigits:2});return(i>1?i+" x "+o+" each":o)+(a?" x "+a:"")}({amount:t,price:l,quantity:o}))),a.createElement(c,{item:!0,display:"flex",gap:1,alignItems:"center"},u&&a.createElement(Do,{checkoutLocalization:r}),a.createElement(ke,{variant:"body1",color:"secondary",style:{wordBreak:"break-word"}},Xe({amount:o*t,currency:l.currency,minimumFractionDigits:2}),u&&" / unit"))))},jo=function(e){return a.createElement(No,null,a.createElement(Io,{style:{alignItems:"flex-end"}},a.createElement(c,{item:!0},a.createElement(ke,{variant:"body1",color:"secondary"},e.label)),a.createElement(c,{item:!0,display:"flex",gap:1,alignItems:"center"},a.createElement(ke,{variant:"body1",color:"secondary",style:{wordBreak:"break-word"}},"Free"))))},qo=function(e){var t=e.subscriptionPreview,n=e.isFetchingSubscriptionPreview,r=t.recurringInvoice||{},i=r.discount,o=r.discountDetails;return i&&o?a.createElement(No,null,a.createElement(Io,null,a.createElement(ke,{variant:"body1",color:"secondary"},e.checkoutLocalization.summary.discountText({discountDetails:o,currency:t.immediateInvoice.total.currency})),a.createElement(ke,{variant:"body1",color:"secondary"},n?a.createElement($a,{width:50,height:16}):Xe({amount:i.amount,currency:i.currency,minimumFractionDigits:2})))):null},Ro=function(e){var t=e.isFetchingSubscriptionPreview,n=((e.subscriptionPreview||{}).immediateInvoice||{}).credits;return!n||!n.used||n.used.amount<=0?null:a.createElement(No,null,a.createElement(Io,null,a.createElement(ke,{variant:"body1",color:"secondary"},e.checkoutLocalization.summary.appliedCreditsTitle),a.createElement(ke,{variant:"body1",color:"secondary"},a.createElement(Mo,{isLoading:t},Xe({amount:-1*n.used.amount,currency:n.used.currency,minimumFractionDigits:2})))))},Wo=function(e){var t=e.tax,n=e.taxDetails,r=e.isFetchingSubscriptionPreview;return!n||!t||(null==t?void 0:t.amount)<=0?null:a.createElement(No,null,a.createElement(Io,null,a.createElement(ke,{variant:"body1",color:"secondary"},e.checkoutLocalization.summary.taxTitle({taxDetails:n})),a.createElement(ke,{variant:"body1",color:"secondary"},a.createElement(Mo,{isLoading:r},Xe({amount:null==t?void 0:t.amount,currency:null==t?void 0:t.currency,minimumFractionDigits:2})))))},zo=o(U,{target:"e9ji7bp4"})({name:"kj9yp4",styles:"max-width:470px;flex:1.5"}),_o=o(ee,{target:"e9ji7bp3"})("border-radius:10px;background:",(function(e){return e.theme.stigg.palette.backgroundHighlight}),";padding:16px;");_o.defaultProps={elevation:0};var Ho,Vo,$o,Zo,Go=o(ke,{target:"e9ji7bp2"})({name:"1jcocwa",styles:"margin-bottom:16px;font-weight:500"}),Yo=o(W,{target:"e9ji7bp1"})({name:"1k6141t",styles:"margin:16px 0"}),Qo=o(ke,{target:"e9ji7bp0"})({name:"5bhc30",styles:"margin-bottom:8px"}),Ko=function(e){var t,r,o,l,s,u=e.onCheckout,d=e.onCheckoutCompleted,m=e.disablePromotionCode,p=e.disableSuccessAnimation,g=e.isFreeDowngrade,h=e.onMockCheckoutPreview,f=i.useState(!1),y=f[0],v=f[1],b=Ua().setErrorMessage,x=Pa(),E=Ca(),w=ma(),k=w.checkoutLocalization,P=w.checkoutState||{},C=P.plan,S=P.activeSubscription,T=Ya((null==C||null==(t=C.pricePoints)?void 0:t.filter((function(e){return e.billingPeriod===E.billingPeriod})))||[]),B=X(T,(function(e){return e.pricingModel===n.BillingModel.FlatFee})),M=B[1],A=(B[0]||[])[0],U=g||x.isCheckoutComplete&&x.isLastStep,L=function(e){var t=(void 0===e?{}:e).onMockCheckoutPreview,n=i.useState(null),r=n[0],a=n[1],o=i.useState(!1),l=o[0],c=o[1],s=Ba({onMockCheckoutPreview:t}).previewSubscriptionAction;return i.useEffect((function(){var e=function(){var e=se(Ot.mark((function e(){var t;return Ot.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,s();case 2:(t=e.sent.subscriptionPreview)&&a(t),c(!1);case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();c(!0);var t=setTimeout((function(){c(!0),e()}),500);return function(){clearTimeout(t)}}),[s]),{subscriptionPreview:r,isFetchingSubscriptionPreview:l}}({onMockCheckoutPreview:h}),F=L.subscriptionPreview,N=L.isFetchingSubscriptionPreview,I=function(e){var t=e.isMocked,n=void 0!==t&&t,r=e.onCheckout,i=e.onCheckoutCompleted,a=e.onSuccess,o=e.disableSuccessAnimation,l=Rt().stigg,c=Ua().useNewPaymentMethod,s=function(){var e=Ca(),t=Fa()[0].resourceId,n=(ma().checkoutState||{}).plan,r=e.addons.map((function(e){return{addonId:e.addon.id,quantity:e.quantity}}));if(null!=n&&n.id)return{resourceId:t,planId:n.id,billingPeriod:e.billingPeriod,billableFeatures:e.billableFeatures,addons:r,promotionCode:e.promotionCode,billingCountryCode:e.billingCountryCode}}(),u=ma(),d=u.widgetState,m=u.setWidgetReadOnly,p=u.checkoutState||{},g=p.setupSecret,h=p.customer,f=Q.useStripe(),y=Q.useElements();return{handleSubmit:function(){var e=se(Ot.mark((function e(t){var u,d,p,v,b,x,E,w,k,P,C;return Ot.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.preventDefault(),s){e.next=3;break}return e.abrupt("return",{success:!1,errorMessage:"Unexpected error, please contact support."});case 3:if(u=!0,p=!1,m(!0),n||!c){e.next=11;break}return e.next=9,wo({elements:y,stripe:f,setupIntentClientSecret:g});case 9:(b=e.sent).success?v=b.paymentMethodId:(d=b.errorMessage,u=!1);case 11:if(x=ue({},s,{paymentMethodId:v}),E=function(){var e=se(Ot.mark((function e(t){var n,r;return Ot.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return p=!0,e.prev=1,e.next=4,l.applySubscription(t);case 4:return n=e.sent,e.next=7,vo({applySubscriptionResults:n,stripe:f});case 7:return e.abrupt("return",{success:!(r=e.sent).errorMessage,errorMessage:r.errorMessage,results:n});case 11:return e.prev=11,e.t0=e.catch(1),console.error(e.t0),e.abrupt("return",{success:!1,errorMessage:d=null==e.t0?void 0:e.t0.message});case 16:case"end":return e.stop()}}),e,null,[[1,11]])})));return function(t){return e.apply(this,arguments)}}(),!u){e.next=34;break}if(!r){e.next=28;break}return e.next=17,r({customerId:h.id,checkoutParams:x,checkoutAction:E});case 17:if((k=e.sent).errorMessage&&(d=k.errorMessage),p||!k.results||!k.success){e.next=24;break}return e.next=22,vo({applySubscriptionResults:k.results,stripe:f});case 22:(P=e.sent).errorMessage&&(d=P.errorMessage,u=!1);case 24:u=u&&k.success&&!d,w=k.results,e.next=34;break;case 28:return e.next=30,E(x);case 30:!(C=e.sent).success&&C.errorMessage&&(d=C.errorMessage),u=C.success&&!d,w=C.results;case 34:if(m(!1),!u||!a){e.next=40;break}if(a(),o){e.next=40;break}return e.next=40,Bo(5e3);case 40:return e.next=42,i({success:u,error:d});case 42:return e.abrupt("return",{results:w,success:!d,errorMessage:d});case 43:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),isLoading:!(null==d||!d.readOnly)}}({isMocked:!!h,disableSuccessAnimation:p,onCheckout:u,onCheckoutCompleted:d,onSuccess:function(){v(!0),x.markStepAsCompleted(x.progressBarState.activeStep)}}),D=I.handleSubmit,O=I.isLoading,j=function(){var e=se(Ot.mark((function e(t){var n;return Ot.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!y){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,D(t);case 4:if(e.t0=e.sent,e.t0){e.next=7;break}e.t0={};case 7:(n=e.t0.errorMessage)?(b(n),v(!1)):b(void 0);case 10:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),q=function(){var e=se(Ot.mark((function e(t){return Ot.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!O){e.next=2;break}return e.abrupt("return");case 2:if(!U){e.next=7;break}return e.next=5,j(t);case 5:e.next=8;break;case 7:x.goNext();case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),R=F||{},W=R.immediateInvoice,z=R.recurringInvoice,_=!(!F||(null==W||!W.proration)&&!F.hasScheduledUpdates),H=!m&&!g,V=!(null==z||!z.discountDetails||g),$=H||V,Z=M.some((function(e){return e.pricingModel===n.BillingModel.UsageBased})),G=Z&&!A&&M.every((function(e){return e.pricingModel===n.BillingModel.UsageBased})),Y="function"==typeof k.summary.baseChargeText?k.summary.baseChargeText({billingPeriod:E.billingPeriod}):k.summary.baseChargeText;return a.createElement(zo,null,a.createElement(_o,null,a.createElement(Go,{variant:"h3"},k.summary.title),a.createElement(c,{display:"flex",flexDirection:"row",alignItems:"center",marginY:2},a.createElement(ke,{variant:"h6",color:"primary",style:{paddingRight:"8px"}},k.summary.planName({plan:C})),a.createElement(Yo,{className:"stigg-checkout-summary-divider",sx:{flex:1,margin:"0 !important"}})),A&&a.createElement(Oo,{checkoutLocalization:k,label:Y,quantity:1,price:A}),!A&&g?a.createElement(jo,{label:Y}):null,M.map((function(e){var t,n,r,i,o,l=null==(t=E.billableFeatures)?void 0:t.find((function(t){var n;return t.featureId===(null==(n=e.feature)?void 0:n.featureId)}));return a.createElement(Oo,{checkoutLocalization:k,key:null==(n=e.feature)?void 0:n.featureId,label:Xi((null==(r=e.feature)?void 0:r.displayName)||"",null==(i=e.feature)?void 0:i.units,null==(o=e.feature)?void 0:o.unitsPlural),quantity:(null==l?void 0:l.quantity)||1,price:e})})),!(null==(r=E.addons)||!r.length)&&a.createElement(a.Fragment,null,a.createElement(c,{display:"flex",flexDirection:"row",alignItems:"center",marginY:2},a.createElement(ke,{variant:"h6",color:"primary",style:{paddingRight:"8px"}},k.summary.addonsSectionTitle),a.createElement(Yo,{className:"stigg-checkout-summary-divider",sx:{flex:1,margin:"0 !important"}})),E.addons.map((function(e){var t,n,r=null==(t=e.addon.pricePoints)?void 0:t.find((function(e){return e.billingPeriod===E.billingPeriod}));return r?a.createElement(Oo,{checkoutLocalization:k,key:null==e||null==(n=e.addon)?void 0:n.id,label:e.addon.displayName,quantity:e.quantity&&e.quantity>0?e.quantity:1,price:r}):null}))),!$&&a.createElement(Yo,{className:"stigg-checkout-summary-divider"}),$&&a.createElement(c,{display:"flex",flexDirection:"row",alignItems:"center",marginY:2},a.createElement(ke,{variant:"h6",color:"primary",style:{paddingRight:"8px"}},k.summary.discountsSectionTitle),a.createElement(Yo,{className:"stigg-checkout-summary-divider",sx:{flex:1,margin:"0 !important"}})),H&&a.createElement(po,{disabled:O||N,checkoutLocalization:k,onMockCheckoutPreview:h}),V&&a.createElement(qo,{subscriptionPreview:F,isFetchingSubscriptionPreview:N,checkoutLocalization:k}),$&&a.createElement(Yo,{className:"stigg-checkout-summary-divider"}),a.createElement(Wo,{tax:null==z?void 0:z.tax,taxDetails:null==z?void 0:z.taxDetails,isFetchingSubscriptionPreview:N,checkoutLocalization:k}),g?null:a.createElement(a.Fragment,null,a.createElement(Io,{style:{marginTop:16}},a.createElement(c,{display:"flex",flexDirection:"column",container:!0},a.createElement(c,{item:!0,display:"flex",justifyContent:"space-between"},a.createElement(ke,{variant:"h6"},k.summary.totalText),a.createElement(ke,{variant:"h6"},a.createElement(Mo,{isLoading:N},G?k.summary.onlyPayAsYouGoText:null,!G&&Z?k.summary.startsAtText:null,G?null:Xe(ue({amount:0},null==z?void 0:z.total,{minimumFractionDigits:2}))))),a.createElement(c,{item:!0},a.createElement(ke,{variant:"body1",color:"secondary"},k.summary.totalBillingPeriodText({billingPeriod:E.billingPeriod}))))),a.createElement(Yo,{className:"stigg-checkout-summary-divider"})),null!=W&&null!=(o=W.proration)&&o.hasProrations&&null!=W&&W.subTotal&&(null==W?void 0:W.subTotal.amount)>0?a.createElement(No,null,a.createElement(Io,null,a.createElement(ke,{variant:"body1",color:"secondary"},k.summary.proratedTotalDueText),a.createElement(ke,{variant:"body1",color:"secondary"},a.createElement(Mo,{isLoading:N},Xe({amount:(null==W||null==(l=W.subTotal)?void 0:l.amount)+((null==W||null==(s=W.tax)?void 0:s.amount)||0),currency:null==W?void 0:W.subTotal.currency,minimumFractionDigits:2}))))):null,a.createElement(Ro,{subscriptionPreview:F,isFetchingSubscriptionPreview:N,checkoutLocalization:k}),a.createElement(No,null,a.createElement(Io,null,a.createElement(Qo,{variant:"h6"},k.summary.totalDueText),a.createElement(Qo,{variant:"h6"},a.createElement(Mo,{isLoading:N},Xe(ue({amount:0},null==W?void 0:W.total,{minimumFractionDigits:2})))))),a.createElement(Fo,{plan:C,activeSubscription:S,subscriptionPreview:F,isFetchingSubscriptionPreview:N,checkoutLocalization:k,billingPeriod:E.billingPeriod}),a.createElement(Xa,{$success:y,$error:U&&g,disabled:O||N||x.progressBarState.isDisabled||U&&!_,className:"stigg-checkout-summary-cta-button",sx:{textTransform:"none",borderRadius:"10px",marginTop:"24px",height:"36px"},variant:"contained",size:"medium",onClick:function(e){q(e)},fullWidth:!0},a.createElement(ke,{className:"stigg-checkout-summary-cta-button-text",variant:"h3",color:"white",style:{display:"flex"}},y?a.createElement(Rr,{icon:"Check",style:{display:"contents"}}):O||N?a.createElement(J,{size:20,sx:{color:"white"}}):function(e){var t=e.checkoutLocalization;return e.isLastStep?e.checkoutHasChanges?e.isPlanUpdate?t.checkoutButton.updateText:e.isFreeDowngrade?t.checkoutButton.downgradeToFreeText:t.checkoutButton.upgradeText:t.checkoutButton.noChangesText:t.checkoutButton.nextText}({isLastStep:U,checkoutHasChanges:_,isFreeDowngrade:g,checkoutLocalization:k,isPlanUpdate:!!S&&(null==S?void 0:S.plan.id)===(null==C?void 0:C.id)})))),a.createElement(Mt,{source:"checkout",showWatermark:!0,style:{marginTop:8,display:"flex",justifyContent:"center"}}),!p&&y&&a.createElement(To,{checkoutLocalization:k}))},Xo=function(){return a.createElement(zo,null,a.createElement(_o,null,a.createElement(_a,{$flexDirection:"column",$gap:24},a.createElement($a,{width:120,height:20}),a.createElement($a,{width:120,height:20}),a.createElement($a,{width:120,height:20}),a.createElement($a,{width:120,height:20})),a.createElement(_a,{$flexDirection:"column",$gap:24,marginTop:5},a.createElement($a,{height:20}),a.createElement($a,{height:20}),a.createElement($a,{height:20})),a.createElement(Va,{flex:1,marginTop:5},a.createElement($a,{height:34}))),a.createElement(Mt,{source:"checkout",showWatermark:!0,style:{marginTop:8,display:"flex",justifyContent:"center"}}))},Jo=o(c,{target:"e1o28dc92"})({name:"1wte80x",styles:"width:100%;gap:8px"}),el=o(c,{target:"e1o28dc91"})({name:"a3p0fn",styles:"display:flex;justify-content:space-between;align-items:center;height:80px"}),tl=o(Xa,{target:"e1o28dc90"})({name:"156064h",styles:"min-width:unset;width:41px;height:41px;padding:0"});function nl(e){var t,r=e.addon,i=e.billingPeriod,o=e.addonState,l=e.initialAddonState,s=e.setAddon,u=e.removeAddon,d=e.checkoutLocalization,m=e.onAddonsValidationChange,p=e.isValid,g=r.pricePoints.find((function(e){return e.billingPeriod===i})),h=!!o,f=!!o&&!!l&&o.quantity!==l.quantity||!!l&&!o,y=function(e){if(!e||e<=0)return m({addonId:r.id,isValid:!1}),void s(r,null!=e?e:null);m({addonId:r.id,isValid:!0}),s(r,e)};return a.createElement(el,{container:!0},a.createElement(c,{item:!0},a.createElement(ke,{variant:"h6",lineHeight:"24px"},r.displayName),!!g&&a.createElement(ke,{variant:"body1",lineHeight:"20px",color:"secondary"},Xe({amount:g.amount,currency:g.currency,minimumFractionDigits:2})+"/"+(i===n.BillingPeriod.Annually?"year":"month"))),a.createElement(c,{item:!0},f&&a.createElement(Xa,{variant:"text",size:"small",sx:{padding:"8px",minWidth:"unset"},onClick:function(){l?s(r,l.quantity):u(r.id),m({addonId:r.id,isValid:!0})}},a.createElement(ke,{color:"primary.main",variant:"body1"},"Undo")),h&&a.createElement(a.Fragment,null,a.createElement(Ja,{id:r.id+"-input",type:"number",sx:{width:120,marginX:2},value:null!=(t=null==o?void 0:o.quantity)?t:"",error:!p,helperText:p?void 0:"Minimum 1",FormHelperTextProps:{sx:{margin:"4px"}},onChange:function(e){var t,n;return y(null!=e&&null!=(t=e.target)&&t.value?Number(null==e||null==(n=e.target)?void 0:n.value):null)}}),a.createElement(tl,{color:"error",onClick:function(){u(r.id),m({addonId:r.id,isValid:!0})}},a.createElement(Rr,{icon:"Trash",style:{display:"flex"}}))),!h&&a.createElement(Xa,{sx:{paddingX:"22px",paddingY:"8px"},onClick:function(){return y(1)}},a.createElement(ke,{color:"primary.main",variant:"body1"},d.addAddonText))))}function rl(){var e,t=ma(),n=t.checkoutLocalization,r=t.setIsValid,o=va().billingPeriod,l=Pa().setIsDisabled,c=ue({},Fa()[0].addonsStep,{setAddon:(e=Fa()[1],function(t,n){return e((function(e){var r=e.addonsStep.addons.find((function(e){return e.addon.id===t.id}));r?r.quantity=n:(e.addonsStep.addons.push({addon:t,quantity:n}),e.addonsStep.addons=la(e.addonsStep.addons))}))}),removeAddon:ua()}),s=c.initialAddons,u=c.addons,d=c.availableAddons,m=c.setAddon,p=c.removeAddon,g=i.useState((null==d?void 0:d.reduce((function(e,t){return e[t.id]=!0,e}),{}))||{}),h=g[0],f=g[1];return i.useEffect((function(){var e=Object.values(h).some((function(e){return!e}));l(e),r(!e)}),[h,l,r]),a.createElement(Jo,{container:!0},null==d?void 0:d.map((function(e){var t=u.find((function(t){return t.addon.id===e.id})),r=null==s?void 0:s.find((function(t){return t.addon.id===e.id}));return a.createElement(nl,{key:e.id,addon:e,billingPeriod:o,addonState:t,initialAddonState:r,setAddon:m,removeAddon:p,checkoutLocalization:n,onAddonsValidationChange:function(e){var t;return f(ue({},h,((t={})[e.addonId]=e.isValid,t)))},isValid:h[e.id]})})))}var il,al=te(c,{shouldForwardProp:function(e){return!e.startsWith("$")}})(Ho||(Ho=me(["\n padding: 8px;\n border-radius: 10px;\n border: 1px solid ",";\n cursor: ",";\n opacity: ",";\n"])),(function(e){return e.theme.stigg.palette.outlinedBorder}),(function(e){return e.$disabled?"not-allowed":"pointer"}),(function(e){return e.$disabled?.6:1})),ol=te(al)(Vo||(Vo=me(["\n flex-direction: column;\n align-items: unset;\n"]))),ll=te(c)($o||($o=me(["\n display: flex;\n align-items: center;\n flex: 1;\n gap: 12px;\n"]))),cl=te(c)(Zo||(Zo=me(["\n display: flex;\n flex-direction: column;\n"])));function sl(e){var t=e.icon,n=e.text,r=e.subtitle;return a.createElement(ll,null,a.createElement(le,{checked:e.checked,disabled:e.readOnly}),a.createElement(Rr,{icon:t,style:{display:"flex"}}),a.createElement(cl,{container:!0},a.createElement(c,{item:!0},n),r&&a.createElement(c,{item:!0},r)))}function ul(e){var t=e.paymentMethodDetails,n=e.readOnly;if(!t)return null;var r=t.expirationMonth,i=t.expirationYear;return a.createElement(al,{item:!0,onClick:e.onSelect,$disabled:n},a.createElement(sl,{checked:e.checked,readOnly:n,icon:"PaymentMethod",text:a.createElement(ke,{variant:"h6"},"Card ending in "+t.last4Digits),subtitle:!!r&&!!i&&a.createElement(ke,{variant:"body1"},"Expires "+r.toString().padStart(2,"0")+"/"+i)}))}function dl(e){var t=e.checked,n=e.readOnly,r=e.onBillingAddressChange,i=e.collectPhoneNumber;return a.createElement(ol,{item:!0,onClick:e.onSelect,$disabled:n},a.createElement(sl,{checked:t,readOnly:n,icon:"PaymentMethod",text:a.createElement(ke,{variant:"h6"},e.checkoutLocalization.newPaymentMethodText)}),a.createElement(oe,{in:t},a.createElement(ho,{onBillingAddressChange:r,collectPhoneNumber:i})))}var ml=te(c)(il||(il=me(["\n display: flex;\n flex-direction: column;\n gap: 24px;\n"])));function pl(e){var t=e.onBillingAddressChange,n=e.collectPhoneNumber,r=ma(),i=r.checkoutLocalization,o=r.widgetState,l=(r.checkoutState||{}).customer,c=Ua(),s=c.errorMessage,u=c.useNewPaymentMethod,d=c.setUseNewPaymentMethod,m=o.readOnly,p=function(e){m||d(e)};return a.createElement(ml,{container:!0},!!s&&a.createElement(ae,{severity:"error",sx:{alignItems:"center"}},a.createElement(ke,{overrideColor:"inherit"},s)),a.createElement(ul,{readOnly:m,checked:!u,paymentMethodDetails:null==l?void 0:l.paymentMethodDetails,onSelect:function(){return p(!1)}}),a.createElement(dl,{readOnly:m,checked:u,checkoutLocalization:i,onSelect:function(){return p(!0)},onBillingAddressChange:t,collectPhoneNumber:n}))}var gl=function(e){return a.createElement(M,{className:"stigg-checkout-change-plan-button",sx:{textTransform:"none"},variant:"text",size:e.size,onClick:e.onClick},a.createElement(ke,{className:"stigg-checkout-change-plan-button-text",color:"primary.main",variant:"h3",style:{lineHeight:"24px"}},e.checkoutLocalization.changePlan))};function hl(e){var t=e.allowChangePlan,n=void 0!==t&&t,r=e.onChangePlan,i=ma(),o=i.checkoutLocalization,l=(i.checkoutState||{}).plan;return a.createElement(a.Fragment,null,a.createElement(U,{sx:{marginBottom:"16px"}},a.createElement(ke,{variant:"body1",color:"disabled",style:{opacity:.6,marginBottom:"8px"}},"Selected plan"),a.createElement(U,{sx:{display:"flex",justifyContent:"space-between"}},a.createElement(ke,{variant:"h1"},null==l?void 0:l.displayName),n&&r&&a.createElement(gl,{onClick:function(){r({currentPlan:l})},checkoutLocalization:o,size:"medium"}))),a.createElement(W,{className:"stigg-checkout-plan-header-divider"}))}function fl(e){switch(e){case n.BillingPeriod.Annually:return"Annual";case n.BillingPeriod.Monthly:return"Monthly";default:return""}}var yl,vl=o(U,{target:"ekae5v44"})({name:"1k6141t",styles:"margin:16px 0"}),bl=o("button",{target:"ekae5v43"})("cursor:",(function(e){return e.$disabled||e.$isOnlyBillingPeriod?"default":"pointer"}),";flex:1;display:flex;align-items:center;justify-content:flex-start;padding:2px 8px;border-radius:10px;border:",(function(e){var t=e.theme,n=t.stigg.palette.outlinedBorder;return e.$isOnlyBillingPeriod?n="transparent":e.$isActive&&(n=t.stigg.palette.outlinedRestingBorder),"1px solid "+n}),";background:",(function(e){return e.$isOnlyBillingPeriod?"transparent":e.$isActive?p(e.theme.stigg.palette.primary).alpha(.15).toString():"transparent"}),";text-transform:none;text-align:start;height:36px;&.MuiButton-root{padding:0 16px 0 8px;&:hover{background:none;}}"),xl=o(U,{target:"ekae5v42"})({name:"1neb8ay",styles:"display:flex;gap:16px;margin-top:16px"}),El=function(e){var t=e.billingPeriod,n=e.isOnlyBillingPeriod,r=va(),i=r.setBillingPeriod,o=r.billingPeriod===t;return a.createElement(bl,{onClick:function(){return i(t)},$isActive:o,$isOnlyBillingPeriod:n},a.createElement(le,{checked:o,onChange:function(){return i(t)},value:t,disabled:n,inputProps:{"aria-label":fl(t)},sx:{padding:0,marginRight:"8px"}}),a.createElement(U,null,a.createElement(ke,{variant:"h3",color:"primary"},fl(t))))};function wl(e){var t=e.plan,r=e.checkoutLocalization,i=d.partition(null==t?void 0:t.pricePoints,(function(e){return e.billingPeriod===n.BillingPeriod.Monthly})),o=i[0],l=i[1],c=!(null==o||!o.length||null==l||!l.length);return c?a.createElement(vl,null,a.createElement(ke,{variant:"h6",color:"primary",fontWeight:s.FontWeight.Medium},r.billingPeriodsTitle),a.createElement(xl,null,!(null==o||!o.length)&&a.createElement(El,{key:n.BillingPeriod.Monthly,billingPeriod:n.BillingPeriod.Monthly,isOnlyBillingPeriod:!c}),!(null==l||!l.length)&&a.createElement(El,{key:n.BillingPeriod.Annually,billingPeriod:n.BillingPeriod.Annually,isOnlyBillingPeriod:!c}))):null}var kl=te.div(yl||(yl=me(["\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n min-height: 60px;\n margin-top: 16px;\n"]))),Pl=function(e,t){var n=e.minUnitQuantity,r=e.maxUnitQuantity;return!t||t<(n||1)?"Minimum "+(n||1):r&&t>r?"Maximum "+r:""};function Cl(e){var t,r,i,o,l,c,s=e.charge,u=e.isValid,d=e.setBillableFeature,m=e.billableFeature,p=e.onValidationChange,g=null==(t=s.feature)?void 0:t.featureId,h=!g,f=s.pricingModel===n.BillingModel.UsageBased,y=h?"Base charge":Xi((null==(r=s.feature)?void 0:r.displayName)||"",null==(i=s.feature)?void 0:i.units,null==(o=s.feature)?void 0:o.unitsPlural),v=!!(null!=s&&s.minUnitQuantity||null!=s&&s.maxUnitQuantity);if(h||f)c=""+Xe({amount:s.amount,currency:s.currency,locale:"en-us",minimumFractionDigits:2}),f&&(c+=" / unit");else if(s.isTieredPrice&&g){var b=je(s.tiers,m.quantity||1);c=a.createElement(nt,{componentId:g+"-tiers",tiers:s.tiers,selectedTier:b,handleTierChange:function(e){d(g,e.upTo)}})}else{var x;c=a.createElement(Ja,{sx:{width:120},id:g+"-input",type:"number",error:!u,helperText:u?void 0:Pl(s,null==m?void 0:m.quantity),FormHelperTextProps:{sx:{margin:"4px"}},value:null!=(x=null==m?void 0:m.quantity)?x:"",onChange:function(e){var t,n;if(!h&&g){var r=s.minUnitQuantity,i=s.maxUnitQuantity,a=null!=e&&null!=(t=e.target)&&t.value?Number(null==e||null==(n=e.target)?void 0:n.value):null;if(!a||a<=0||r&&a<r||i&&a>i)return p({featureId:g,isValid:!1}),void d(g,null!=a?a:null);p({featureId:g,isValid:!0});var o=ga(s,a);d(g,o)}},onWheel:function(e){return e.target.blur()}})}return a.createElement(kl,null,a.createElement(U,{display:"flex",flexDirection:"column"},a.createElement(ke,{variant:"h6",color:"primary",lineHeight:"24px"},y),v&&a.createElement(ke,{variant:"body1",color:"secondary",lineHeight:"20px"},ye(s.minUnitQuantity,s.maxUnitQuantity,null==(l=s.feature)?void 0:l.unitsPlural))),a.createElement(ke,{variant:"h6",color:"primary"},c))}function Sl(e){var t,n=e.plan,r=e.billingPeriod,o=va(),l=o.billableFeatures,c=o.setBillableFeature,s=Pa().setIsDisabled,u=ma().setIsValid,d=Ya((null==n||null==(t=n.pricePoints)?void 0:t.filter((function(e){return e.billingPeriod===r})))||[]),m=i.useState(null==d?void 0:d.reduce((function(e,t){var n;return e[(null==(n=t.feature)?void 0:n.featureId)||"base-charge"]=!0,e}),{})),p=m[0],g=m[1];return i.useEffect((function(){var e=Object.values(p).some((function(e){return!e}));s(e),u(!e)}),[p,s,u]),a.createElement("div",null,null==d?void 0:d.map((function(e){var t,n,r=l.find((function(t){var n;return t.featureId===(null==(n=e.feature)?void 0:n.featureId)}));return a.createElement(Cl,{key:(null==(t=e.feature)?void 0:t.featureId)||"base-charge",charge:e,setBillableFeature:c,billableFeature:r,isValid:p[(null==(n=e.feature)?void 0:n.featureId)||"base-charge"],onValidationChange:function(e){var t=e.featureId,n=e.isValid;return g((function(e){var r;return ue({},e,((r={})[t]=n,r))}))}})})))}var Tl,Bl=o(U,{target:"emtnukp0"})({name:"1d3w5wq",styles:"width:100%"}),Ml=function(e){var t=e.onChangePlan,n=ma(),r=n.checkoutLocalization,i=(n.checkoutState||{}).plan,o=va().billingPeriod;return a.createElement(a.Fragment,null,a.createElement(hl,{allowChangePlan:!0,onChangePlan:t}),a.createElement(Bl,null,a.createElement(wl,{plan:i,checkoutLocalization:r}),a.createElement(Sl,{plan:i,billingPeriod:o})))};function Al(){return(Al=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var Ul=o((function(e){return i.createElement("svg",Al({width:16,height:16,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),Tl||(Tl=i.createElement("g",{stroke:"#7586B0",strokeWidth:1.333,strokeLinecap:"round",strokeLinejoin:"round"},i.createElement("path",{d:"M2.667 8h10.667M9.333 4l4 4-4 4"}))))}),{target:"e8986nu0"})("path{stroke:",(function(e){return e.theme.stigg.palette.text.secondary}),";}"),Ll=o(U,{target:"eaawmuo2"})({name:"zjik7",styles:"display:flex"}),Fl=o(ae,{target:"eaawmuo1"})({name:"18uqayh",styles:"margin-bottom:16px"}),Nl=o(U,{target:"eaawmuo0"})("padding:16px;border-radius:10px;width:100%;border:",(function(e){return"1px solid "+e.theme.stigg.palette.outlinedBorder}),";"),Il=function(e){var t=e.planName,n=e.priceText;return a.createElement(Nl,{className:"stigg-checkout-downgrade-to-free-container"},a.createElement(ke,{className:"stigg-checkout-downgrade-to-free-text-header",style:{opacity:.8},variant:"caption",color:"disabled"},e.headerText),a.createElement(ke,{className:"stigg-checkout-downgrade-to-free-plan-name",bold:!0,variant:"h3",color:"primary"},t),a.createElement(ke,{className:"stigg-checkout-downgrade-to-free-price-text",color:"secondary"},n))},Dl=function(e){var t,n=e.checkoutLocalization,r=e.activeSubscription,i=e.freePlan,o=e.allowChangePlan,l=e.onChangePlan;void 0!==o&&o&&l&&(t=a.createElement(gl,{onClick:function(){l({currentPlan:i})},checkoutLocalization:n,size:"small"}));var c=r.prices.length>0?r.prices[0].billingPeriod:void 0;return a.createElement(a.Fragment,null,a.createElement(Fl,{action:t,className:"stigg-checkout-downgrade-to-free-alert",severity:"info"},a.createElement(ke,{span:!0,color:"secondary"},n.downgradeToFree.alertText({plan:r.plan}))),a.createElement(Ll,{className:"stigg-checkout-downgrade-to-free-plans-container"},a.createElement(Il,{headerText:n.downgradeToFree.paidPlanHeader({plan:r.plan}),planName:n.downgradeToFree.paidPlanName({plan:r.plan}),priceText:n.downgradeToFree.paidPlanPriceText({plan:r.plan,billingPeriod:c})}),a.createElement(Ul,{className:"stigg-checkout-downgrade-to-free-arrow",style:{margin:"auto 16px",minWidth:"16px"}}),a.createElement(Il,{headerText:n.downgradeToFree.freePlanHeader({plan:i}),planName:n.downgradeToFree.freePlanName({plan:i}),priceText:n.downgradeToFree.freePlanPriceText({plan:i})})))};function Ol(e){var t=e.onCheckout,r=e.onCheckoutCompleted,o=e.onChangePlan,l=e.onBillingAddressChange,c=e.collectPhoneNumber,s=e.disablePromotionCode,u=e.disableSuccessAnimation,d=e.onMockCheckoutPreview,m=function(){var e=i.useState(null),t=e[0],r=e[1],a=ma().checkoutState||{},o=a.billingIntegration,l=a.setupSecret;return i.useEffect((function(){if(o){var e=o.credentials;if(o.billingIdentifier!==n.BillingVendorIdentifier.Stripe)return void console.error("Currently only stripe integration is supported");r(re.loadStripe(e.publicKey,{stripeAccount:e.accountId}))}}),[o]),{stripePromise:t,setupIntentClientSecret:l}}(),p=m.stripePromise,g=m.setupIntentClientSecret,h=Fa()[0],f=h.stiggTheme,y=h.widgetState,v=Pa().currentStep,b=y.isLoadingCheckoutData,x=ma(),E=x.checkoutLocalization,w=x.checkoutState||{},k=w.plan,P=w.activeSubscription,C=!!k&&k.pricingType===n.PricingType.Free&&!!P&&P.pricingType!==n.PricingType.Free,S=function(e,t){var n=t.onBillingAddressChange,r=t.onChangePlan,i=t.collectPhoneNumber;switch(e.key){case pa.PLAN:return{content:a.createElement(Ml,{onChangePlan:r})};case pa.ADDONS:return{content:a.createElement(rl,null)};case pa.PAYMENT:return{content:a.createElement(pl,{onBillingAddressChange:n,collectPhoneNumber:i})};default:return{content:null}}}(v,{onBillingAddressChange:l,onChangePlan:o,collectPhoneNumber:c}).content,T=a.createElement(a.Fragment,null,C?a.createElement(Dl,{freePlan:k,activeSubscription:P,allowChangePlan:!0,checkoutLocalization:E,onChangePlan:o}):a.createElement(a.Fragment,null,S)),B=i.useMemo((function(){return g?{clientSecret:g}:{mode:"setup",currency:"usd"}}),[g]);return a.createElement(Q.Elements,{key:g,stripe:p,options:ue({},B,{appearance:{theme:"stripe",variables:{colorText:f.palette.text.primary,colorPrimaryText:f.palette.text.primary,colorTextPlaceholder:f.palette.text.disabled,fontFamily:f.typography.fontFamily}}})},a.createElement(Oa,{className:"stigg-checkout-layout"},!C&&a.createElement(Za,null),a.createElement(ja,null,a.createElement(qa,null,b?a.createElement(to,null):T),b?a.createElement(Xo,null):a.createElement(Ko,{disablePromotionCode:s,disableSuccessAnimation:u,onCheckout:t,onCheckoutCompleted:r,isFreeDowngrade:C,onMockCheckoutPreview:d}))))}var jl,ql=["textOverrides","theme","resourceId","planId","preferredBillingPeriod","billingCountryCode","billableFeatures","billingInformation","onMockCheckoutState"];(jl=exports.ProvisionStatus||(exports.ProvisionStatus={})).IN_PROGRESS="IN_PROGRESS",jl.SUCCEEDED="SUCCEEDED",jl.FAILED="FAILED",Object.keys(n).forEach((function(e){"default"!==e&&Object.defineProperty(exports,e,{enumerable:!0,get:function(){return n[e]}})})),exports.AddonsList=En,exports.Checkout=function(e){var t=e.textOverrides,n=e.theme,r=e.resourceId,i=e.planId,o=e.preferredBillingPeriod,l=e.billingCountryCode,c=e.billableFeatures,s=e.billingInformation,u=e.onMockCheckoutState,d=de(e,ql);return a.createElement(Ia,{textOverrides:t,theme:n,resourceId:r,planId:i,preferredBillingPeriod:o,billingCountryCode:l,billableFeatures:c,billingInformation:s,onMockCheckoutState:u},a.createElement(Ol,Object.assign({},d)))},exports.CustomerPortal=function(e){var t=e.textOverrides,n=e.theme,r=e.resourceId,i=e.productId,o=de(e,aa);return a.createElement(mn,{textOverrides:t,theme:n,resourceId:r,productId:i},a.createElement(ia,Object.assign({},o)))},exports.CustomerPortalProvider=mn,exports.CustomerUsageData=ra,exports.InvoicesSection=oa,exports.PaymentDetailsSection=Zi,exports.Paywall=function(e){var t=e.productId,r=e.resourceId,o=e.highlightedPlanId,l=e.showOnlyEligiblePlans,c=e.textOverrides,s=e.onPlanSelected,u=e.preferredBillingPeriod,d=e.onBillingPeriodChange,m=e.billingCountryCode,p=!!i.useContext(un),y=!1;if(p){var v=dn();y=v.isLoading,r=v.resourceId}var b=function(e){var t=e.productId,r=e.resourceId,a=e.showOnlyEligiblePlans,o=e.billingCountryCode,l=e.preferredBillingPeriod,c=Rt(),s=c.stigg,u=c.locale,d=i.useState(n.BillingPeriod.Annually),m=d[0],p=d[1],g=i.useState([]),y=g[0],v=g[1],b=i.useState(null),x=b[0],E=b[1],w=i.useState(!0),k=w[0],C=w[1];i.useEffect((function(){!function(){var e=se(Ot.mark((function e(){var n,i,a,c;return Ot.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,C(!0),e.next=4,s.waitForInitialization();case 4:return e.next=6,s.getPaywall({productId:t,resourceId:r,billingCountryCode:o});case 6:i=Wt((n=e.sent).plans,n.activeSubscriptions,l),a=i.availableBillingPeriods,c=i.defaultBillingPeriod,E(n),v(a),p(c),e.next=16;break;case 13:e.prev=13,e.t0=e.catch(0),jt.error("Failed to load paywall "+(null==e.t0?void 0:e.t0.message),e.t0);case 16:return e.prev=16,C(!1),e.finish(16);case 19:case"end":return e.stop()}}),e,null,[[0,13,16,19]])})));return function(){return e.apply(this,arguments)}}()()}),[s,t,s.isCustomerLoaded,o,r]);var S=function(e,t){var r,i=e||{},a=i.plans,o=i.currency,l=i.configuration,c=i.customer,s=i.paywallCalculatedPricePoints,u=function(e){var t,r,i,a=!0,o=(null==e?void 0:e.find((function(e){return e.status===n.SubscriptionStatus.InTrial})))||null,l=null==(t=o)?void 0:t.plan,c=null!=(r=o)&&r.trialEndDate?h.utc(o.trialEndDate).diff(h.utc(),"days",!1)+1:void 0;return l||(a=!1,l=null==(i=o=(null==e?void 0:e.find((function(e){return e.status===n.SubscriptionStatus.Active})))||null)?void 0:i.plan),{currentSubscription:o,currentPlan:l,isCustomerOnTrial:a,trialDaysLeft:c}}(i.activeSubscriptions),d=u.currentSubscription,m=u.currentPlan,p=u.isCustomerOnTrial,g=u.trialDaysLeft,y=(null==d?void 0:d.scheduledUpdates)||[],v=null==d||null==(r=d.price)?void 0:r.billingPeriod,b=y.find((function(e){return e.subscriptionScheduleType===n.SubscriptionScheduleType.Downgrade})),x=y.find((function(e){return e.subscriptionScheduleType===n.SubscriptionScheduleType.BillingPeriod})),E=P(a,(function(e){return e.order})).map((function(e){var t,n=null==c||null==(t=c.eligibleForTrial)?void 0:t.find((function(t){return t.productId===e.product.id})),r=e.id===(null==m?void 0:m.id);return ue({},e,{paywallCalculatedPricePoints:null==s?void 0:s.filter((function(t){return t.planId===e.id})),isTriable:!f(e.defaultTrialConfig)&&(!n||n.eligible),isCurrentCustomerPlan:r,currentCustomerPlanBillingPeriod:v,isUpcomingPlan:!1,trialDaysLeft:g,isNextPlan:function(t){var n,i=null==b?void 0:b.scheduleVariables,a=null==x?void 0:x.scheduleVariables,o=e.pricePoints.some((function(e){return e.billingPeriod===t}));return b?(null==(n=b.targetPackage)?void 0:n.refId)===e.id&&(!o||i.billingPeriod===t):!(!x||!r)&&a.billingPeriod===t},paywallCurrency:o,scheduledUpdate:b||x})}));if(a&&m){var w,k=m&&(null==a||null==(w=a.find((function(e){return e.id===(null==m?void 0:m.id)})))?void 0:w.order);f(k)||(E=E.map((function(e){return ue({},e,{isLowerThanCurrentPlan:k>e.order})})),t&&(E=E.filter((function(e){return e.order>=k}))))}var C=l?function(e){var t=e.palette,n=e.layout;return{customCss:e.customCss||void 0,palette:{primary:(null==t?void 0:t.primary)||void 0,backgroundPaper:(null==t?void 0:t.backgroundColor)||void 0,outlinedBorder:(null==t?void 0:t.borderColor)||void 0,backgroundHighlight:(null==t?void 0:t.currentPlanBackground)||void 0,text:{primary:(null==t?void 0:t.textColor)||void 0}},typography:Vt(e.typography),layout:{ctaAlignment:$t(null==n?void 0:n.alignment),headerAlignment:$t(null==n?void 0:n.alignment),descriptionAlignment:$t(null==n?void 0:n.alignment),planMaxWidth:_t(null==n?void 0:n.planWidth),planMinWidth:_t(null==n?void 0:n.planWidth),planMargin:_t(null==n?void 0:n.planMargin),planPadding:_t(null==n?void 0:n.planPadding)}}}(l):void 0;return{currentPlan:m,currentSubscription:d,isCustomerOnTrial:p,plans:E,paywallConfiguration:C}}(x,a);return ue({customer:(null==x?void 0:x.customer)||null,isLoading:k,selectedBillingPeriod:m,setSelectedBillingPeriod:p,availableBillingPeriods:y,locale:u,configuration:S.paywallConfiguration},S)}({productId:t,resourceId:r,showOnlyEligiblePlans:l,billingCountryCode:m,preferredBillingPeriod:u}),x=b.plans,E=b.customer,w=b.currentSubscription,k=b.isCustomerOnTrial,C=b.isLoading,S=b.selectedBillingPeriod,T=b.setSelectedBillingPeriod,B=b.availableBillingPeriods,M=b.locale,A=b.configuration,U=g({highlightChip:"Recommended",planCTAButton:{upgrade:"Upgrade",downgrade:"Downgrade",startTrial:function(e){var t;return"Start "+(null==(t=e.defaultTrialConfig)?void 0:t.duration)+" day trial"},custom:"Contact us",currentPlan:"Current plan",startNew:"Get started",switchToBillingPeriod:function(e){return e===n.BillingPeriod.Monthly?"Switch to monthly billing":"Switch to annual billing"},cancelScheduledUpdate:"Cancel"},price:{startingAtCaption:"Starts at",pricePeriod:function(e){return e===n.BillingPeriod.Monthly?"/ month":"/ year"},free:function(e){return{price:(null==e?void 0:e.symbol)+"0"}},custom:"Custom",priceNotSet:"Price not set"}},c),L=!x||C||y?a.createElement(nn,null):a.createElement(Dt,{plans:x,customer:E,currentSubscription:w,selectedBillingPeriod:S,onBillingPeriodChanged:function(e){T(e),d&&d(e)},availableBillingPeriods:B,highlightedPlanId:o,isCustomerOnTrial:k,onPlanSelected:s,paywallLocale:U,locale:M});return p?L:a.createElement(sn,{componentTheme:A},L)},exports.Promotions=kn,exports.StiggContext=qt,exports.StiggProvider=function(e){var t=e.apiKey,n=e.baseUri,o=e.baseEdgeUri,l=e.enableEdge,c=e.customerId,s=e.customerToken,u=e.resourceId,d=e.theme,m=e.locale,p=e.useEntitlementPolling,g=e.entitlementPollingInterval,h=e.entitlementsFallback,f=e.stiggClient,y=e.children,v=i.useRef(t),b={apiKey:t,customerId:c,customerToken:s,resourceId:u,baseUri:n,baseEdgeUri:o,enableEdge:l,entitlementsFallback:h,useEntitlementPolling:p,entitlementPollingInterval:g},x=i.useState((function(){return{stigg:null!=f?f:r.initialize(ue({},b,{lazyLoad:!0})),locale:m||"en-US",isInitialized:!1,theme:d,refreshData:(e=se(Ot.mark((function e(){return Ot.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return k((function(e){return ue({},e,{customerPortalUpdatedAt:new Date})})),e.next=3,E.stigg.refresh();case 3:case"end":return e.stop()}}),e)}))),function(){return e.apply(this,arguments)})};var e})),E=x[0],k=x[1];return i.useEffect((function(){var e=!0,n=function(t){e&&k(t)},i=function(){return n((function(e){return ue({},e,{updatedAt:new Date})}))},a=function(e){return n((function(t){return t.stigg&&t.stigg.removeListener("entitlementsUpdated",i),e.addListener("entitlementsUpdated",i),ue({},t,{stigg:e,isInitialized:!0,updatedAt:new Date})}))};return function(){var e=se(Ot.mark((function e(){var i;return Ot.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=E.stigg,t!==v.current&&(jt.log("Updating stigg client",{apiKey:t}),v.current=t,i=r.initialize(ue({},b)),n((function(e){return ue({},e,{isInitialized:!1,updatedAt:new Date})}))),e.next=4,i.waitForInitialization();case 4:a(i);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()(),function(){e=!1,E.stigg.removeListener("entitlementsUpdated",i),E.stigg.clearCustomer()}}),[t]),i.useEffect((function(){var e=E.stigg;c?e.setCustomerId(c,s,u):e.clearCustomer()}),[c,s,u]),i.useEffect((function(){k((function(e){return ue({},e,{theme:d})}))}),[d]),a.createElement(qt.Provider,{value:E},a.createElement(w.SkeletonTheme,{baseColor:"#F5F6F9",highlightColor:"#e5e6ea"},y))},exports.SubscriptionsOverview=Oi,exports.useStiggContext=Rt,exports.useWaitForCheckoutCompleted=function(e){var t,n=void 0===e?{}:e,r=n.onProvisionStart,a=n.onProvisionSucceeded,o=n.onProvisionFailed,l=Rt().stigg,c=i.useState(exports.ProvisionStatus.IN_PROGRESS),s=c[0],u=c[1],d=i.useState(!1),m=d[0],p=d[1],g=i.useMemo((function(){var e=new URLSearchParams(window.location.search);return t?e.get(t):e}),[t="checkoutCompleted",window.location.search]);return i.useEffect((function(){!function(){var e=se(Ot.mark((function e(){var t;return Ot.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(g&&"false"!==g.toLowerCase()&&!m){e.next=2;break}return e.abrupt("return");case 2:return p(!0),r&&r(),e.prev=4,e.next=7,l.waitForCheckoutCompleted();case 7:t=e.sent,u(exports.ProvisionStatus.SUCCEEDED),a&&a(t),e.next=17;break;case 12:e.prev=12,e.t0=e.catch(4),console.error("Failed to wait for checkout to complete",e.t0),u(exports.ProvisionStatus.FAILED),o&&o(e.t0);case 17:return e.prev=17,p(!1),e.finish(17);case 20:case"end":return e.stop()}}),e,null,[[4,12,17,20]])})));return function(){return e.apply(this,arguments)}}()()}),[l,g]),{isAwaitingCheckout:m,provisionStatus:s}};
|
|
2
2
|
//# sourceMappingURL=react-sdk.cjs.production.min.js.map
|