@stigg/react-sdk 4.12.1 → 4.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/paywall/Paywall.d.ts +3 -2
- package/dist/components/paywall/PaywallContainer.d.ts +3 -2
- package/dist/components/paywall/PlanOffering.d.ts +3 -2
- package/dist/components/paywall/types.d.ts +3 -0
- package/dist/components/utils/priceTierUtils.d.ts +3 -2
- package/dist/react-sdk.cjs.development.js +28 -20
- 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 +28 -20
- package/dist/react-sdk.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/paywall/Paywall.tsx +10 -1
- package/src/components/paywall/PaywallContainer.tsx +4 -1
- package/src/components/paywall/PlanOffering.tsx +4 -2
- package/src/components/paywall/types.ts +2 -0
- package/src/components/utils/priceTierUtils.ts +5 -3
|
@@ -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=e(require("classnames")),c=e(require("@mui/material/Grid")),u=require("styled-typography"),s=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")),k=require("react-loading-skeleton"),w=e(k),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("lottie-react")),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 ue(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 se(){return(se=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","as"];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(u.Text,{target:"ewjez2x0"})("margin:0;",(function(e){return e.$span&&"display: inline"}),";");function Ee(e){switch(e){case"bold":return u.FontWeight.Bold;case"normal":default:return u.FontWeight.Normal}}function ke(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 u.FontWeight.Normal}}var we=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=e.as,f=void 0===h?"p":h,y=de(e,ve),v=s.useTheme(),b=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),x="typography-level-"+b;return a.createElement(xe,Object.assign({as:f,ref:t},y,{className:e.className?e.className+" "+x:x,style:i,level:b,color:p||be(v,m),fontWeight:null!=o?o:g?u.FontWeight.Bold:ke(v,c),$span:r}),n)})),Pe=["displayNameOverride"],Ce=o(we,{target:"e1mddeqb3"})({name:"ti75j2",styles:"margin:0"}),Se=o("div",{target:"e1mddeqb2"})({name:"gl2qrx",styles:"display:flex;align-items:baseline"}),Te=o("div",{target:"e1mddeqb1"})("display:flex;align-items:center;margin-right:16px;height:",(function(e){return e.theme.stigg.typography.h3.fontSize}),";flex-shrink:0;"),Be=o(fe,{target:"e1mddeqb0"})("flex-shrink:0;*{fill:",(function(e){return e.theme.stigg.palette.text.disabled}),";}");function Me(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,u=o||l,s=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";default:return""}}(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+" "+s}return u?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,null,a.createElement(Be,{className:"stigg-entitlement-row-icon"})),a.createElement(Ce,{className:"stigg-entitlement-name",variant:"h6",color:"secondary"},t||r))}var Ae,Ue=o("div",{target:"e1yz7zcg0"})({name:"budh8k",styles:"display:flex;flex-direction:column;gap:16px"});function Le(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(Me,{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(Ue,{className:"stigg-plan-entitlements-container"},a.createElement(we,{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(Me,{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})})))}(Ae=exports.SubscribeIntentionType||(exports.SubscribeIntentionType={})).START_TRIAL="START_TRIAL",Ae.UPGRADE_TRIAL_TO_PAID="UPGRADE_TRIAL_TO_PAID",Ae.REQUEST_CUSTOM_PLAN_ACCESS="REQUEST_CUSTOM_PLAN_ACCESS",Ae.CHANGE_BILLING_PERIOD="CHANGE_BILLING_PERIOD",Ae.CHANGE_UNIT_QUANTITY="CHANGE_UNIT_QUANTITY",Ae.UPGRADE_PLAN="UPGRADE_PLAN",Ae.DOWNGRADE_PLAN="DOWNGRADE_PLAN",Ae.CANCEL_SCHEDULED_UPDATES="CANCEL_SCHEDULED_UPDATES";var Fe,Ne,Ie=function(e){return{left:"flex-start",center:"center",right:"flex-end"}[e]},De=function(e){return h.utc(e).format("MMMM Do, yyyy")};function Oe(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,s=void 0===u?"":u;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 ",De(t.scheduledExecutionTime)):s,"."),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 ",De(t.scheduledExecutionTime)):s,".")};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 ",De(t.scheduledExecutionTime)):s,"."),line2:"Until then you still have access to your current "+b+" count."};default:return{}}}function je(e){return e.feature&&(1!==e.feature.unitQuantity?e.feature.unitsPlural:e.feature.units)||""}function qe(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 Re(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;default:return 0}}function We(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,u=l.tiers[0];if(i[c])u=(null==(o=l.tiers)?void 0:o.find((function(e){return e.upTo===i[c].upTo})))||u;else if(r){var s=r.prices.find((function(e){var t;return e.pricingModel===n.BillingModel.PerUnit&&e.tiersMode&&(null==(t=e.feature)?void 0:t.featureId)===c}));s&&(u=qe(l.tiers,s.feature.unitQuantity||1))}var d={};return d[c]=u,d}return{}}!function(e){e[e.Lower=-1]="Lower",e[e.Equal=0]="Equal",e[e.Higher=1]="Higher"}(Fe||(Fe={}));var ze,_e=o(m,{target:"e199qof96"})({name:"1a2afmv",styles:"margin-left:10px"}),He=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&&s.css(Ne||(Ne=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}),";}"),Ve=o(we,{target:"e199qof94"})({name:"h05omw",styles:"margin:0;font-size:15px"}),$e=o(we,{target:"e199qof93"})({name:"1cnls12",styles:"min-height:87px"}),Ze=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;"),Ge=o(we,{target:"e199qof91"})({name:"1etgg0o",styles:"margin-top:8px;margin-bottom:17px;min-height:20px"}),Ye=o("div",{target:"e199qof90"})("display:flex;flex-direction:column;margin-top:4px;align-self:",(function(e){return Ie(e.theme.stigg.layout.ctaAlignment)}),";width:100%;");function Qe(e){var t=e.isNextPlan,r=e.customer,o=e.plan,l=e.billingPeriod,c=e.isCustomerOnTrial,u=e.onPlanSelected,m=e.paywallLocale,p=e.withTrialLeftRow,g=e.currentSubscription,h=e.selectedTierByFeature,f=s.useTheme(),y=i.useState(!1),v=y[0],b=y[1],x=m.planCTAButton,E=x.currentPlan,k=x.custom,w=x.downgrade,P=x.startTrial,C=x.upgrade,S=x.startNew,T=x.switchToBillingPeriod,B=x.cancelScheduledUpdate,M=d.isFunction(w)?w(o):w,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=Oe({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 Fe.Equal;var r=t.prices.find((function(e){return e.pricingModel===n.BillingModel.PerUnit&&e.tiersMode}));if(!r)return Fe.Equal;var i=r.feature,a=i.unitQuantity;if(!a)return Fe.Equal;var o=e[i.featureId];return o?o.upTo<a?Fe.Lower:o.upTo>a?Fe.Higher:Fe.Equal:Fe.Equal}(h,g)){case Fe.Lower:U.intentionType=exports.SubscribeIntentionType.CHANGE_UNIT_QUANTITY,U.title=M;break;case Fe.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=k,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(Ye,{className:"stigg-paywall-plan-button-layout"},t&&F?a.createElement($e,{color:"secondary",variant:"body1",className:"stigg-paywall-schedule-update-text"},F," ",a.createElement(Ze,{color:"secondary",onClick:function(){b(!0),Promise.resolve(u(U.intentionType)).finally((function(){return b(!1)}))}},U.title)):a.createElement(a.Fragment,null,a.createElement(He,{className:"stigg-paywall-plan-button","data-testid":"paywall-card-cta-"+o.displayName,disabled:N,$disabled:N,onClick:function(){b(!0),Promise.resolve(u(U.intentionType)).finally((function(){return b(!1)}))}},a.createElement(Ve,{className:"stigg-paywall-plan-button-text",variant:"h6",color:"primary.main"},U.title),v&&a.createElement(_e,{color:f.stigg.palette.text.disabled,loading:!0,size:16})),p?a.createElement(Ge,{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 Ke(){return(Ke=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 Xe=function(e){return i.createElement("svg",Ke({width:16,height:16,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),ze||(ze=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"})))},Je=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,u=(void 0===r?n.Currency.Usd:r).toString(),s=y(u),d=new Intl.NumberFormat(i,se({maximumFractionDigits:o,minimumFractionDigits:c,style:"currency",currency:u},s?{currencyDisplay:"code"}:{})).format(t||0);return s&&(d=d.replace(u,s)),d.replace(/\s/g,"")};function et(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})),u=null==(l=e.paywallCalculatedPricePoints)?void 0:l.find((function(e){return e.billingPeriod===t}));if(!(null!=c&&c.length||u))return{price:r.price.priceNotSet};var s={planPrices:c,paywallCalculatedPrice:u,selectedBillingPeriod:t,selectedTierByFeature:o||{}};return r.price.paid?r.price.paid(se({},s,{plan:e})):function(e){for(var t,r,i,a=e.planPrices,o=e.selectedBillingPeriod,l=e.locale,c=e.shouldShowMonthlyPriceAmount,u=e.selectedTierByFeature,s=e.paywallCalculatedPrice||a[0],d=s.currency,m=s.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];u[v.feature.featureId]&&(b=u[v.feature.featureId]||b,t=v.tiers,r=je(v)),g+=Re(v,b,o,c)}}if(p){var x,E=a[0],k=(null==(x=E.feature)?void 0:x.units)||"";E.pricingModel!==n.BillingModel.PerUnit||E.isTieredPrice?E.pricingModel===n.BillingModel.UsageBased&&(f="per "+k):f="per "+k+" "+h}return{price:Je({amount:g,currency:d,locale:l}),unit:f,tiers:t,tierUnits:r}}(se({},s,{locale:i,shouldShowMonthlyPriceAmount:a,paywallLocale:r}));default:return{price:""}}}var tt=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}),";}"),nt=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 rt(e){var t=e.componentId,n=e.tiers,r=e.tierUnits,i=e.selectedTier,o=e.handleTierChange;return a.createElement(we,{as:"div",className:"stigg-price-tier-select",style:{minHeight:"46px"}},n?a.createElement(tt,{value:i?i.upTo.toString():n[0].upTo.toString(),fullWidth:!0,onChange:function(e,t){n&&o(qe(n,e.target.value))},id:t,input:a.createElement(nt,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(we,{variant:"body1",color:"primary",style:{lineHeight:"unset"}},e.upTo," ",r))}))):a.createElement("div",null))}var it=o(we,{target:"e1gsqbi12"})({name:"bfvx8c",styles:"word-break:break-word;width:100%"}),at=o(we,{target:"e1gsqbi11"})({name:"1bmnxg7",styles:"white-space:nowrap"}),ot=o(we,{target:"e1gsqbi10"})({name:"nurf5y",styles:"white-space:normal;min-height:39px"});function lt(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(we,{span:!0,className:"stigg-price-billing-period-text",variant:"h6",color:"secondary"},o)}var ct=function(e){var t=e.showStartingAt,n=e.withUnitPriceRow,r=e.withStartingAtRow,i=e.withTiersRow,o=e.selectedTierByFeature,l=e.setSelectedTierByFeature,c=e.plan,u=e.billingPeriod,s=e.paywallLocale,d=e.hasMonthlyPrice,m=e.hasAnnuallyPrice,p=et(c,u,s,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===u&&e.isTieredPrice})),b=v?v.feature.featureId:void 0,x=b?o[b]:void 0;return a.createElement(it,{as:"div",className:"stigg-price-text"},a.createElement(a.Fragment,null,r&&a.createElement(we,{style:{minHeight:"20px"},className:"stigg-starting-at-text",variant:"body1",color:"secondary"},t?s.price.startingAtCaption:""),a.createElement(ot,{className:"stigg-price-point",variant:"h1"},g),n&&a.createElement(we,{as:"div",className:"stigg-price-unit-and-billing-period-text",style:{minHeight:"48px"}},a.createElement(at,{className:"stigg-price-unit-text",span:!0,variant:"h6",color:"secondary"},h),a.createElement(lt,{plan:c,billingPeriod:u,hasAnnuallyPrice:m,hasMonthlyPrice:d,paywallLocale:s})),i?a.createElement(rt,{componentId:c.id+"_"+b+"_tier",tiers:f,tierUnits:y,selectedTier:x,handleTierChange:function(e){b&&l((function(t){var n;return se({},t,((n={})[b]=e,n))}))}}):null))},ut=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(we,{target:"eacdu8d7"})({name:"mpkj0c",styles:"padding-bottom:8px"}),dt=o("div",{target:"eacdu8d6"})("height:2px;width:100%;background-color:",(function(e){return e.theme.stigg.palette.outlinedBorder}),";margin-bottom:40px;"),mt=o(we,{target:"eacdu8d5"})("text-align:",(function(e){return e.theme.stigg.layout.descriptionAlignment}),";min-height:",(function(e){return e.theme.stigg.layout.descriptionMinHeight}),";"),pt=o("div",{target:"eacdu8d4"})("background-color:",(function(e){return e.theme.stigg.palette.primary}),";border-radius:40px;position:absolute;top:-12px;"),gt=o(we,{target:"eacdu8d3"})({name:"a8c38r",styles:"margin:0;padding:2px 8px"}),ht=o("div",{target:"eacdu8d2"})("width:100%;display:flex;flex-direction:column;align-items:",(function(e){return Ie(e.theme.stigg.layout.headerAlignment)}),";"),ft=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;"),yt=o(Xe,{target:"eacdu8d0"})("display:flex;height:100%;margin-right:4px;path{fill:",(function(e){return e.theme.stigg.palette.text.primary}),";}");function vt(e){var t=e.text,n=void 0===t?"Next":t;return a.createElement(ft,null,a.createElement(c,{display:"flex",alignItems:"center",gap:1},a.createElement(yt,{$iconsColor:e.iconsColor}),a.createElement(we,{color:"primary",variant:"body1"},n)))}function bt(e){var t,r=e.withUnitPriceRow,o=e.withTiersRow,c=e.withTrialLeftRow,u=e.customer,s=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,k=e.isCustomerInCustomPlan,w=s.isNextPlan&&s.isNextPlan(d),P=s.pricePoints.filter((function(e){return e.billingPeriod===d})),C=null==(t=s.paywallCalculatedPricePoints)?void 0:t.find((function(e){return e.billingPeriod===d})),S=P.length>1&&!(null==C||!C.additionalChargesMayApply),T=!k||s.pricingType===n.PricingType.Custom,B=null;w?B=a.createElement(vt,{text:"Next plan"}):m&&b.highlightChip&&(B=a.createElement(pt,{className:"stigg-highlight-badge"},a.createElement(gt,{className:"stigg-highlight-badge-text",color:"white",bold:!0},b.highlightChip)));var M=a.useState(We(s,d,p,{})),A=M[0],U=M[1];return i.useEffect((function(){U(We(s,d,p,A))}),[d,p,s]),a.createElement(ut,{className:l("stigg-"+s.id,"stigg-plan-offering-container",{"stigg-current-plan":s.isCurrentCustomerPlan}),$isHighlighted:m,$isCurrentPlan:s.isCurrentCustomerPlan},B,a.createElement(ht,{className:"stigg-header-wrapper"},a.createElement(st,{className:"stigg-plan-header",variant:"h3"},s.displayName),g&&a.createElement(mt,{className:"stigg-plan-description",variant:"h6",color:"secondary"},s.description),a.createElement(ct,{showStartingAt:S,withUnitPriceRow:r,withStartingAtRow:E,withTiersRow:o,selectedTierByFeature:A,setSelectedTierByFeature:U,plan:s,billingPeriod:d,paywallLocale:b,locale:x,hasAnnuallyPrice:f,hasMonthlyPrice:h}),T?a.createElement(Qe,{isNextPlan:w,customer:u,plan:s,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(dt,{className:"stigg-plan-header-divider"})),a.createElement(Le,{plan:s,billingPeriod:d,paywallLocale:b}))}var xt,Et=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;"),kt=o(we,{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 Pt(e){return a.createElement(we,{variant:"h6",color:e.disabled?"disabled":"primary",className:"stigg-discount-rate-text"},e.discount,"% off")}function Ct(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(Et,{className:"stigg-period-picker-container"},a.createElement(kt,{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(kt,{variant:"h6",className:"stigg-annual-period-text",color:i?"disabled":"primary"},"Annual"),0!==t&&a.createElement(Pt,{discount:t,disabled:i}))}function St(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 Tt(){return(Tt=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 Bt=o((function(e){return i.createElement("svg",Tt({width:135,height:16,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),xt||(xt=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}),";}"),Mt=o("div",{target:"ee5i8qp0"})("align-self:",(function(e){return e.$alignSelf||"unset"}),";@media (max-width: 1040px){align-self:center;}");function At(e){var t=e.source,n=e.style;return e.showWatermark?a.createElement(Mt,{$alignSelf:e.align,className:"stigg-watermark",style:se({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(Bt,null)):null}function Ut(e,t){return e.pricePoints.some((function(e){return e.billingPeriod===t}))}function Lt(e,t){return e.some((function(e){return Ut(e,t)}))}var Ft,Nt=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}),";"),It=o("div",{target:"e19kubi81"})({name:"1rdsyw8",styles:"display:flex;flex-direction:column;align-items:center;& *{box-sizing:border-box;}"}),Dt=o("div",{target:"e19kubi80"})({name:"zigog8",styles:"display:flex;flex-direction:column;align-items:center"}),Ot=function(e){var t=e.plans,r=e.customer,o=e.currentSubscription,l=e.highlightedPlanId,c=e.selectedBillingPeriod,u=e.onBillingPeriodChanged,s=e.availableBillingPeriods,d=e.isCustomerOnTrial,m=e.onPlanSelected,p=e.paywallLocale,g=e.locale,h=e.shouldHidePlan,y=Wt().stigg,v=function(e){return e.reduce((function(e,t){var r,i,a=St(t,n.BillingPeriod.Monthly),o=(i=St(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),b=t.some((function(e){return!!e.description})),x=Lt(t,n.BillingPeriod.Monthly),E=Lt(t,n.BillingPeriod.Annually),k=function(e,t,r){return e.filter((function(e){return e.pricingType!==n.PricingType.Paid||Ut(e,t)})).filter((function(e){return!r||!r({plan:e})}))}(t,c,h),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]),P=!!o&&o.plan.pricingType===n.PricingType.Custom,C=i.useMemo((function(){return k.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,k]),S=i.useMemo((function(){return k.some((function(e){return!!et(e,c,p,g,x).unit}))}),[c,x,g,p,k]),T=i.useMemo((function(){return!P&&k.some((function(e){var t=We(e,c,o,{});return Object.values(t).length>0}))}),[c,o,P,k]),B=k.some((function(e){return e.isCurrentCustomerPlan&&e.trialDaysLeft}));return a.createElement(It,{className:"stigg-paywall-container"},a.createElement(Dt,{className:"stigg-paywall-layout"},a.createElement(Ct,{onBillingPeriodChanged:u,selectedBillingPeriod:c,availableBillingPeriods:s,discountRate:v}),a.createElement(Nt,{className:"stigg-paywall-plans-layout"},k.map((function(e){return a.createElement(bt,{withUnitPriceRow:S,withTiersRow:T,withTrialLeftRow:B,key:e.id,shouldShowDescriptionSection:b,hasMonthlyPrice:x,hasAnnuallyPrice:E,plan:e,withStartingAtRow:C,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:P})}))),a.createElement(At,{source:"paywall",align:"end",style:{marginTop:16},showWatermark:y.isWidgetWatermarkEnabled})))},jt=(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 w(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===s)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=u(e,t,n);if("normal"===c.type){if(r=n.done?"completed":"suspendedYield",c.arg===s)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 u(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var s={};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=u(e[i],e,a);if("throw"!==c.type){var s=c.arg,d=s.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){s.value=e,o(s)}),(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 s;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return s}var r=u(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,s;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,s):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,s)}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 k(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function w(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,w.prototype={constructor:w,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(k),!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,s):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),s},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),k(n),s}},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;k(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),s}},e}(e.exports);try{regeneratorRuntime=t}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}}(Ft={exports:{}}),Ft.exports),qt=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}()),Rt=a.createContext(null);Rt.displayName="StiggContext";var Wt=function(){var e=i.useContext(Rt);if(!e)throw new Error("Could not find Stigg context; You need to wrap your app in an <StiggProvider> component.");return e};function zt(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 _t={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 Ht(e,t){if(void 0===t&&(t="px"),e)return""+e+t}function Vt(e,t){if(!t)return e;switch(t){case n.FontWeight.Normal:return"normal";case n.FontWeight.Bold:return"bold";default:return"normal"}}function $t(e,t){var n,r,i,a,o,l,c,u,s,d,m,p,g,h,f;return{fontFamilyUrl:(null==e?void 0:e.fontFamily)||void 0,h1:{fontSize:Ht((null==e||null==(n=e.h1)?void 0:n.fontSize)||(null==t||null==(r=t.h1)?void 0:r.fontSize)),fontWeight:Vt("bold",(null==e||null==(i=e.h1)?void 0:i.fontWeight)||(null==t||null==(a=t.h1)?void 0:a.fontWeight))},h2:{fontSize:Ht((null==e||null==(o=e.h2)?void 0:o.fontSize)||(null==t||null==(l=t.h2)?void 0:l.fontSize)),fontWeight:Vt("normal",null==t||null==(c=t.h2)?void 0:c.fontWeight)},h3:{fontSize:Ht((null==e||null==(u=e.h3)?void 0:u.fontSize)||(null==t||null==(s=t.h3)?void 0:s.fontSize)),fontWeight:Vt("normal",(null==e||null==(d=e.h3)?void 0:d.fontWeight)||(null==t||null==(m=t.h3)?void 0:m.fontWeight))},body:{fontSize:Ht((null==e||null==(p=e.body)?void 0:p.fontSize)||(null==t||null==(g=t.body)?void 0:g.fontSize)),fontWeight:Vt("normal",(null==e||null==(h=e.body)?void 0:h.fontWeight)||(null==t||null==(f=t.body)?void 0:f.fontWeight))}}}function Zt(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 Gt,Yt=o("div",{target:"e1f7khji6"})({name:"zigog8",styles:"display:flex;flex-direction:column;align-items:center"}),Qt=o(fe,{target:"e1f7khji5"})({name:"o7nnmj",styles:"margin-right:16px"}),Kt=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}),";"),Xt=o("div",{target:"e1f7khji3"})("display:flex;gap:",(function(e){return e.theme.stigg.layout.planMargin}),";flex-wrap:wrap;justify-content:center;"),Jt=o("div",{target:"e1f7khji2"})({name:"k8xojc",styles:"display:flex;align-items:center;margin-bottom:12px"}),en=o("div",{target:"e1f7khji1"})({name:"xdvdnl",styles:"margin-top:auto"}),tn=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 nn(){return a.createElement(Kt,null,a.createElement(w,{width:120,borderRadius:4}),a.createElement(w,{circle:!0,width:40,height:40}),a.createElement(w,{style:{marginBottom:33},width:120,borderRadius:4}),a.createElement(Jt,null,a.createElement(Qt,null),a.createElement(w,{width:120,borderRadius:4})),a.createElement(Jt,null,a.createElement(Qt,null),a.createElement(w,{width:120,borderRadius:4})),a.createElement(Jt,null,a.createElement(Qt,null),a.createElement(w,{width:120,borderRadius:4})),a.createElement(en,null,a.createElement(w,{height:50,borderRadius:4})))}function rn(){return a.createElement(Yt,{className:"stigg-skeleton-loader-container"},a.createElement(tn,{className:"stigg-skeleton-loader-billing-period"},a.createElement(w,{borderRadius:4})),a.createElement(Xt,{className:"stigg-skeleton-loader-plans-container"},a.createElement(nn,null),a.createElement(nn,null),a.createElement(nn,null)))}var an,on=function(e){var t=e.externalFontUrl;return a.createElement(s.Global,{styles:s.css(Gt||(Gt=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 ")})},ln=o("div",{target:"emcdfp60"})((function(e){var t=e.customCss;return t&&s.css(an||(an=me(["\n ","\n "])),t)}),";");function cn(e){var t,n,r,i,a,o,l,c,u,s=Wt(),m=d.merge(e,s.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"),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:""},g(u,t)}function un(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=cn(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(s.ThemeProvider,{theme:{stigg:r}},a.createElement(ln,{customCss:r.customCss},a.createElement(on,{externalFontUrl:r.typography.fontFamilyUrl}),a.createElement(C.ThemeProvider,{theme:{typography:un(r)}},n))))},dn=a.createContext(null);dn.displayName="CustomerPortalContext";var mn=function(){var e=i.useContext(dn);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 pn(e){var t,n,r,o,l,c,u,s=e.children,d=e.textOverrides,m=e.theme,p=e.resourceId,h=e.productId,f=Wt().customerPortalUpdatedAt,y=function(e){var t=e.resourceId,n=e.productId,r=Wt(),a=r.stigg,o=r.customerPortalUpdatedAt,l=i.useState(!1),c=l[0],u=l[1],s=i.useState(),d=s[0],m=s[1];return i.useEffect((function(){!function(){var e=ue(jt.mark((function e(){return jt.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!a.isCustomerLoaded){e.next=15;break}return e.prev=1,u(!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),qt.error("Failed to load customer portal "+(null==e.t0?void 0:e.t0.message),e.t0);case 12:return e.prev=12,u(!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,n]),{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:$t(e.typography)}}(v.configuration):void 0,E=(t=cn(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==(u=r.palette)?void 0:u.iconsColor)||void 0,iconsBackgroundColor:null==n?void 0:n.iconsBackgroundColor}),k=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(dn.Provider,{key:null==f?void 0:f.toString(),value:{customerPortal:v,isLoading:b,textOverrides:k,theme:E,resourceId:p}},s))}var gn,hn=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 fn(){return(fn=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 yn=function(e){return i.createElement("svg",fn({width:20,height:20,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),gn||(gn=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"})))},vn=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 bn(e){var t=e.title,n=e.className,r=e.isLoading,i=mn().theme;return r?a.createElement(w,{width:120}):a.createElement(we,{className:n,overrideColor:i.sectionTitleColor,variant:"h3",bold:!0},t)}var xn=o(yn,{target:"e1fjw26b0"})("path{stroke:",(function(e){return e.theme.stigg.palette.primary}),";}");function En(e){var t=e.onManageSubscription,n=e.hideManageButton,r=e.textOverrides;return a.createElement(vn,{className:"stigg-customer-portal-overview-header",$disableMargin:!0},a.createElement(bn,{title:"Subscription",className:"stigg-overview-title"}),!n&&a.createElement(hn,{className:"stigg-manage-subscription-button",variant:"outlined",onClick:t},a.createElement(xn,{className:"stigg-manage-subscription-button-image"}),a.createElement(we,{className:"stigg-manage-subscription-button-text",color:"primary.main",style:{marginLeft:"8px"},variant:"body1"},null==r?void 0:r.manageSubscription)))}function kn(){var e=mn().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(we,{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-of-type{max-width:60%;}");function Pn(){var e=mn(),t=e.customerPortal,n=e.theme,r=null==t?void 0:t.promotionalEntitlements;return a.createElement("div",{style:{display:"flex",flexDirection:"column"}},a.createElement(we,{color:"secondary"},e.textOverrides.promotionsSubtitle),a.createElement("div",{style:{display:"flex",flexDirection:"column"}},a.createElement(wn,{$borderColor:n.borderColor},a.createElement(we,{variant:"body1",bold:!0},"Feature"),a.createElement(we,{variant:"body1",bold:!0},"Expiration date")),null==r?void 0:r.map((function(e,t){return a.createElement(wn,{key:e.displayName+"-"+t,$borderColor:n.borderColor},a.createElement(we,{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(we,{variant:"body1",color:"disabled"},e.endDate?h.utc(e.endDate).format("MMM Do, YYYY"):"None"))}))))}var Cn,Sn,Tn,Bn,Mn,An,Un,Ln,Fn,Nn,In,Dn,On,jn,qn,Rn,Wn=o(N,{target:"exlfw3j3"})({name:"jlwfj4",styles:".MuiTabs-indicator{background-color:#001e6c;}"}),zn=o("div",{target:"exlfw3j2"})({name:"1dqkbz0",styles:"width:100%;flex:1;margin-top:16px"}),_n=o(U,{shouldForwardProp:function(e){return!e.startsWith("$")},target:"exlfw3j1"})("margin-top:16px;max-height:",(function(e){return e.$maxHeight}),";overflow-y:auto;"),Hn=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 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)}function Kn(){return(Kn=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 Xn,Jn,er,tr,nr,rr,ir,ar,or,lr,cr,ur,sr,dr,mr,pr,gr,hr,fr,yr,vr,br,xr,Er,kr=function(e){return i.createElement("svg",Kn({width:20,height:20,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),Rn||(Rn=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 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)}function Ir(){return(Ir=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 Dr,Or,jr,qr={__proto__:null,Addons:function(e){return i.createElement("svg",Vn({width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),Cn||(Cn=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"}))),Sn||(Sn=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",$n({width:36,height:36,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),Tn||(Tn=i.createElement("rect",{width:36,height:36,rx:10,fill:"#F5F6F9"})),Bn||(Bn=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"})),Mn||(Mn=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",Zn({width:36,height:36,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),An||(An=i.createElement("rect",{width:36,height:36,rx:10,fill:"#F5F6F9"})),Un||(Un=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"})),Ln||(Ln=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"})),Fn||(Fn=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",Gn({width:36,height:36,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),Nn||(Nn=i.createElement("rect",{width:36,height:36,rx:10,fill:"#F5F6F9"})),In||(In=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",Yn({width:21,height:20,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),Dn||(Dn=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"}))),On||(On=i.createElement("defs",null,i.createElement("clipPath",{id:"dollar-coin_svg__a"},i.createElement("path",{fill:"#fff",transform:"translate(.333)",d:"M0 0h20v20H0z"})))))},MiniSchedule:Xe,Promotions:function(e){return i.createElement("svg",Qn({width:24,height:25,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),jn||(jn=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"}))),qn||(qn=i.createElement("defs",null,i.createElement("clipPath",{id:"promotions_svg__a"},i.createElement("path",{fill:"#fff",transform:"translate(0 .182)",d:"M0 0h24v24H0z"})))))},Restore:kr,ScheduleBox:function(e){return i.createElement("svg",wr({width:36,height:36,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),Xn||(Xn=i.createElement("rect",{width:36,height:36,rx:10,fill:"url(#schedule-box_svg__a)"})),Jn||(Jn=i.createElement("rect",{width:36,height:36,rx:10,fill:"#F5F6F9"})),er||(er=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"})),tr||(tr=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",Pr({width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),nr||(nr=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",Cr({width:36,height:36,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),rr||(rr=i.createElement("rect",{width:36,height:36,rx:10,fill:"#F5F6F9"})),ir||(ir=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"})),ar||(ar=i.createElement("path",{d:"M22 8v4M14 8v4M9 16h18",stroke:"#7586B0",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})))},Trash:function(e){return i.createElement("svg",Sr({width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),or||(or=i.createElement("path",{d:"M3 6h18",stroke:"#F88078",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),lr||(lr=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"})),cr||(cr=i.createElement("path",{d:"M10 11v6M14 11v6",stroke:"#F88078",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})))},PaymentMethod:function(e){return i.createElement("svg",Tr({width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),ur||(ur=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",Br({width:21,height:20,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),dr||(dr=i.createElement("circle",{cx:10.333,cy:10,r:9,fill:"#fff",stroke:"#327EEE",strokeWidth:2})))},OutlinedCheckedCircle:function(e){return i.createElement("svg",Mr({width:20,height:20,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),mr||(mr=i.createElement("circle",{cx:10,cy:10,r:9.25,fill:"#327EEE",stroke:"#327EEE",strokeWidth:1.5})),pr||(pr=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",Ar({width:21,height:20,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),gr||(gr=i.createElement("circle",{cx:10.667,cy:10,r:9.25,fill:"#B3BCD3",stroke:"#B3BCD3",strokeWidth:1.5})),hr||(hr=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",Ur({width:18,height:18,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),fr||(fr=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",Lr({width:20,height:20,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),yr||(yr=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",Fr({width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),vr||(vr=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",Nr({width:16,height:16,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),br||(br=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"}))),xr||(xr=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",Ir({width:16,height:16,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),Er||(Er=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"}))))}},Rr=o("div",{target:"e1ds7xyn0"})((function(e){var t=e.$pathColor;return t&&s.css(Dr||(Dr=me(["\n path {\n fill: ",";\n }\n "])),t)})," ",(function(e){var t=e.$rectColor;return t&&s.css(Or||(Or=me(["\n svg rect {\n fill: ",";\n }\n "])),t)})," ",(function(e){var t=e.$strokeColor;return t&&s.css(jr||(jr=me(["\n g {\n stroke: ",";\n }\n "])),t)}),";");function Wr(e){var t=e.className,n=e.style,r=e.svgPathColor,i=e.svgRectColor,o=e.svgStrokeColor,l=qr[e.icon],c=s.useTheme();return a.createElement(Rr,{className:t,style:n,$pathColor:Hn(r,c),$rectColor:Hn(i,c),$strokeColor:Hn(o,c)},a.createElement(l,null))}var zr=["children","value","index","maxHeight"];function _r(e){var t=e.children,n=e.value,r=e.index,i=e.maxHeight,o=de(e,zr);return a.createElement("div",Object.assign({role:"tabpanel",hidden:n!==r},o),n===r&&a.createElement(_n,{$maxHeight:i},t))}function Hr(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(Wr,{icon:e.icon,svgStrokeColor:r}),a.createElement(we,{variant:"h6",bold:t,fontWeight:u.FontWeight.Medium,color:r},n))}function Vr(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"),u=t.promotionalEntitlements.length>0&&!l("promotionalEntitlements"),s=i.useState(c?1:2),d=s[0],m=s[1];return c||u?a.createElement(zn,null,a.createElement(U,{sx:{borderBottom:1,borderColor:"divider"}},a.createElement(Wn,{value:d,onChange:function(e,t){m(t)}},c?a.createElement(L,{sx:{textTransform:"none"},value:1,label:a.createElement(Hr,{isSelected:1===d,label:r.addonsTabTitle,icon:"Addons"})}):null,u?a.createElement(L,{sx:{textTransform:"none"},value:2,label:a.createElement(Hr,{isSelected:2===d,label:r.promotionsTabTitle,icon:"Promotions"})}):null)),a.createElement(_r,{value:d,index:1,maxHeight:o.tabMaxHeight},a.createElement(kn,null)),a.createElement(_r,{value:d,index:2,maxHeight:o.tabMaxHeight},a.createElement(Pn,null))):null}var $r=o("div",{target:"ejq3grd1"})({name:"1eoy87d",styles:"display:flex;justify-content:space-between"}),Zr=o("div",{target:"ejq3grd0"})({name:"43cxha",styles:"display:flex;flex-direction:column;gap:32px"});function Gr(){return a.createElement($r,{className:"stigg-subscription-overview-skeleton-layout"},a.createElement(Zr,null,a.createElement(w,{width:120}),a.createElement(w,{width:120})),a.createElement(w,{width:295,height:193}))}function Yr(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(we,{className:"stigg-scheduled-updates-description",variant:"body1"},"Downgrade to the ",a.createElement("b",null,null==t?void 0:t.displayName)," plan")))}function Qr(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(we,{className:"stigg-scheduled-updates-description",variant:"body1"},"Change from an ",r," to a ",a.createElement("b",null,i)," billing cycle")))}function Kr(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(we,{className:"stigg-scheduled-updates-description",variant:"body1"},"Reduce the ",a.createElement("b",null,o)," quantity to ",n," ",l)))}function Xr(e){var t=e.scheduleUpdate,r=e.subscription;switch(t.subscriptionScheduleType){case n.SubscriptionScheduleType.Downgrade:return a.createElement(Yr,{scheduleUpdate:t});case n.SubscriptionScheduleType.BillingPeriod:return a.createElement(Qr,{scheduleUpdate:t});case n.SubscriptionScheduleType.UnitAmount:return a.createElement(Kr,{scheduleUpdate:t,subscription:r});default:return null}}var Jr=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;"),ei=o(m,{target:"eju957a1"})({name:"158icaa",styles:"margin-left:4px"}),ti=o(kr,{target:"eju957a0"})("color:",(function(e){return e.theme.stigg.palette.primary}),";path{fill:",(function(e){return e.theme.stigg.palette.primary}),";}");function ni(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(we,{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(Xr,{key:e.subscriptionScheduleType,scheduleUpdate:e,subscription:t})}))))}function ri(e){var t=e.subscription,n=Oe({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(we,{className:"stigg-scheduled-updates-title",variant:"body1",color:"primary"},n.line1))),r&&a.createElement(c,null,a.createElement(we,{className:"stigg-scheduled-updates-subtitle",variant:"body1",color:"secondary"},r)))}function ii(e){var t=e.subscription,n=e.onCancelScheduledUpdates,r=e.theme,o=e.cancelScheduledUpdatesButtonTitle,l=s.useTheme(),u=i.useState(!1),d=u[0],m=u[1],p=t.scheduledUpdates;if(!p||0===p.length)return null;var g=1===p.length;return a.createElement(Jr,{$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(Wr,{icon:"ScheduleBox",svgPathColor:r.iconsColor,svgRectColor:r.iconsBackgroundColor})),a.createElement(c,{item:!0,flex:1},a.createElement(g?ri:ni,{subscription:t})),!!n&&a.createElement(c,{item:!0},a.createElement(hn,{variant:"outlined",onClick:function(){m(!0),Promise.resolve(n(t)).finally((function(){return m(!1)}))}},d?a.createElement(ei,{loading:!0,size:16,color:l.stigg.palette.text.disabled}):a.createElement(ti,{style:{display:"flex",marginRight:4},className:"stigg-scheduled-updates-cancel-update-button-icon"}),a.createElement(we,{variant:"body1",color:"primary.main",className:"stigg-scheduled-updates-cancel-update-button"},o)))))}var ai=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 oi(e){var t=e.billingPeriod,r=e.rangeEnd,i=e.amount,o=e.currency;return a.createElement(a.Fragment,null,a.createElement(we,{variant:"h6"},"Next estimated bill"),a.createElement(we,{variant:"h1"},Je({amount:i,currency:o,maximumFractionDigits:2})),a.createElement(we,{as:"div",variant:"body1",color:"secondary"},"Billed ",t===n.BillingPeriod.Monthly?"monthly":"annually"," on"," ",a.createElement(we,{variant:"body1",span:!0,color:"primary"},h.utc(r).format("MMM Do, YYYY"))),a.createElement(we,{variant:"body1",color:"secondary"},"* Additional tax rates may apply"))}function li(e){var t=e.description;return a.createElement(a.Fragment,null,a.createElement(we,{variant:"h6",color:"secondary"},"No upcoming bill"),a.createElement(we,{variant:"body1",color:"secondary"},t))}var ci=o("div",{target:"e1ftdtst1"})({name:"1nocm2b",styles:"display:flex;flex-direction:column;align-items:left;gap:8px"}),ui=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(we,{color:t?"primary.main":"secondary"},e.linkLabel);return a.createElement(ci,{className:"stigg-contact-support-layout"},a.createElement(we,{className:"stigg-contact-support-label",color:"secondary"},n),t?a.createElement(ui,{className:"stigg-contact-support-button",style:{textTransform:"none"},variant:"text",onClick:t},r):r)}var di,mi,pi=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 gi(e){var t,r,i,o,l=e.subscription,c=e.theme,u=e.textOverrides,s=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(li,{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(li,{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(li,{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(oi,{billingPeriod:v,rangeEnd:b,amount:x.amount,currency:x.currency}))}else d===n.PricingType.Custom&&(o=a.createElement(si,{onContactSupport:s,label:u.contactSupportTitle,linkLabel:u.contactSupportLink}));return a.createElement(pi,{className:"stigg-subscription-total-price-layout",$borderColor:c.borderColor},o)}function hi(){return(hi=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 fi,yi,vi,bi=function(e){return i.createElement("svg",hi({width:16,height:16,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),di||(di=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"})),mi||(mi=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"})))},xi=["children","className","placement"],Ei=o((function(e){var t=e.children,n=e.className,r=e.placement,i=void 0===r?"top":r,o=de(e,xi);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}),""),ki=S(we)(fi||(fi=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(yi||(yi=me(["\n word-break: break-word;\n "])))}),(function(e){return e.$bold&&C.css(vi||(vi=me(["\n font-weight: bold;\n "])))}));function wi(e){return e&&(e.clientHeight<e.scrollHeight||e.offsetWidth<e.scrollWidth)}var Pi=function(e){var t=e.leaveDelay,n=e.children,r=e.variant,o=e.color,l=e.maxLines,c=void 0===l?1:l,u=e.wordBreak,s=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),k=a.createElement(ki,{ref:E,variant:r,color:o,$maxLines:c,$wordBreak:u,$bold:s,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 w=(null==E?void 0:E.current)&&wi(E.current);return a.createElement("span",null,b||w?a.createElement(Ei,{placement:m,leaveDelay:t,title:a.createElement(we,{variant:"body1"},n)},k):k)},Ci=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;"),Si=o(D,{target:"el5iwyw0"})({name:"69ka7t",styles:"text-decoration-color:white;color:white;cursor:pointer"});function Ti(e){var t=e.subscription,r=e.includePlanName,i=e.onManageSubscription;return(null==t?void 0:t.status)!==n.SubscriptionStatus.InTrial?null:a.createElement(Ci,{className:"stigg-subscription-trial-badge"},a.createElement(bi,{className:"stigg-subscription-trial-badge-image"}),a.createElement("div",{style:{flex:1,marginRight:4}},a.createElement(Pi,{variant:"body1",className:"stigg-subscription-trial-badge-text",color:"white"},t.trialRemainingDays+" days remaining in trial",r&&" of the "+t.planName+" plan")),a.createElement(Si,{className:"stigg-subscription-trial-upgrade-button",onClick:i},a.createElement(we,{color:"white"},"Upgrade plan")))}function Bi(e){var t=e.mainSubscription,n=e.trialSubscription,r=e.onManageSubscription;return a.createElement("div",{className:"stigg-subscription-view-layout"},a.createElement(we,{className:"stigg-subscription-plan-name",variant:"h1",overrideColor:e.theme.planNameColor,style:{marginTop:8}},t.planName," plan"),a.createElement(Ti,{subscription:n,includePlanName:(null==n?void 0:n.planName)!==t.planName,onManageSubscription:r}))}function Mi(e,t){return Math.min(Math.floor(e/t*100),100)}var Ai,Ui=o(R,{shouldForwardProp:function(e){return!e.startsWith("$")},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}}),";}"),Li=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 Fi(e){var t=e.entitlement;if(t.hasUnlimitedUsage)return a.createElement(Li,null);var n,r=Mi(t.currentUsage||0,t.usageLimit),i=(n=r)<70?"standard":n<100?"warning":"error";return a.createElement(Ui,{$progressStatus:i,className:"stigg-feature-usage-progress-bar-"+i.toString(),variant:"determinate",value:r})}var Ni=S(M)(Ai||(Ai=me(["\n text-transform: none;\n padding: 0;\n white-space: nowrap;\n"])));function Ii(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||Mi(t.currentUsage||0,t.usageLimit)<70?null:o?i?a.createElement(Ni,{variant:"text",onClick:function(){return i(n,t)}},a.createElement(we,{color:"primary.main"},"Buy more")):null:l&&r?a.createElement(Ni,{variant:"text",onClick:r},a.createElement(we,{color:"primary.main"},"Upgrade")):null}function Di(e){var t,n,r,i=e.amount,o=e.currency,l=e.entitlement,c=e.feature,u=e.hideChargePrice,s=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(Pi,{variant:"body1",color:"primary"},c.displayName),!u&&a.createElement(Pi,{variant:"body1",color:"secondary"},Je({amount:i,currency:o})," per ",c.featureUnits)),a.createElement("div",{style:{display:"flex",gap:12}},a.createElement(Ii,{entitlement:l,feature:c,canBuyMore:!0,onBuyMore:s,onManageSubscription:d,canUpgradeSubscription:m,hasCustomSubscription:p}),a.createElement(we,{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(Fi,{entitlement:l}))}function Oi(e){var t=e.subscription,r=e.onBuyMore,i=e.onManageSubscription,o=e.hasCustomSubscription,l=e.canUpgradeSubscription,c=d.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,u=e.price;if(!t||!u)return null;var s=c[t.refId];return s&&s.feature?a.createElement(Di,{key:t.refId,entitlement:s,feature:s.feature,amount:u.amount,currency:u.currency,hideChargePrice:e.billingModel===n.BillingModel.PerUnit,onBuyMore:r,onManageSubscription:i,canUpgradeSubscription:l,hasCustomSubscription:o}):null}))):null}function ji(e){var t=e.onManageSubscription,r=e.onBuyMore,i=e.onCancelScheduledUpdates,o=e.onContactSupport,l=e.hiddenSections,c=e.cancelScheduledUpdatesButtonTitle,u=mn(),s=u.customerPortal,d=u.textOverrides,m=u.theme,p=u.isLoading||!s,g=s||{},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(ai,{className:"stigg-customer-portal-subscriptions-overview",$backgroundColor:m.backgroundColor,$borderColor:m.borderColor},!p&&v&&v.scheduledUpdates&&a.createElement(ii,{theme:m,subscription:v,onCancelScheduledUpdates:i,cancelScheduledUpdatesButtonTitle:c}),p||!E?a.createElement(Gr,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(En,{onManageSubscription:t,hideManageButton:x,textOverrides:d}),a.createElement(Bi,{mainSubscription:E,trialSubscription:b,theme:m,onManageSubscription:t}),v&&f&&a.createElement(Oi,{subscription:v,entitlements:f,onBuyMore:r,onManageSubscription:t,canUpgradeSubscription:!!y,hasCustomSubscription:x}),a.createElement(Vr,{customerPortal:s,hiddenSections:l,textOverrides:d,theme:m})),a.createElement("div",{style:{display:"flex",flexDirection:"column",width:319,gap:24}},a.createElement(gi,{subscription:E,theme:m,onContactSupport:o,textOverrides:d}))))}var qi=o("div",{target:"e2lw8x70"})({name:"7wpci2",styles:"display:flex;width:100%;align-items:flex-end;justify-content:flex-end;margin-bottom:24px"});function Ri(e){return a.createElement(qi,{className:"stigg-customer-portal-header-layout"},a.createElement(At,{source:"customer_portal",showWatermark:e.showWatermark}))}var Wi=o(we,{target:"eb0pe7a1"})({name:"kxbue8",styles:"text-transform:none"}),zi=o(I.ExternalLink,{target:"eb0pe7a0"})("color:",(function(e){return e.theme.stigg.palette.primary}),";");function _i(e){var t=e.text,n=e.url;return a.createElement(hn,{className:e.className,variant:"outlined",startIcon:a.createElement(zi,{size:20,strokeWidth:2.5}),onClick:function(){window.open(n,"_blank")}},a.createElement(Wi,{color:"primary.main"},t))}var 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(we,{variant:"h6",color:"secondary",fontWeight:u.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(we,Object.assign({className:t+"-label",variant:"body1",color:"secondary",style:{width:80}},e.labelTypographyProps),n),a.createElement(we,Object.assign({className:t+"-text",variant:"body1",color:"secondary"},i),r))})))}function Zi(){return a.createElement(w,{width:220,height:42})}function Gi(){var e=mn(),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,{key:"information-loading-data-top"},a.createElement(w,{width:220,height:12}),a.createElement(w,{width:220,height:12}),a.createElement(w,{width:220,height:12})),a.createElement(W,{key:"information-loading-data-divider",orientation:"vertical",style:{minHeight:93}}),a.createElement(Hi,{key:"information-loading-data-bottom"},a.createElement(w,{width:220,height:12}),a.createElement(w,{width:220,height:12}),a.createElement(w,{width:220,height:12}))]):(l.push(a.createElement($i,{key:"information-billing-data-billed-to",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,{key:"information-billing-data-divider",orientation:"vertical",style:{minHeight:93}})),l.unshift(a.createElement($i,{key:"information-billing-data-payment-method",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(Zi,null):null!=t&&t.billingPortalUrl?a.createElement(_i,{url:t.billingPortalUrl,text:n.editPaymentDetails,className:"stigg-edit-payment-details-button"}):null;return a.createElement(ai,{className:"stigg-payment-details-section-layout",$backgroundColor:r.backgroundColor,$borderColor:r.borderColor},a.createElement(vn,{className:"stigg-payment-details-section-header"},a.createElement(bn,{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(ai,{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;}"),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,$backgroundColor:r.backgroundColor,$borderColor:r.borderColor},a.createElement(vn,{className:"stigg-customer-portal-paywall-header"},a.createElement(bn,{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,u=e.onManageSubscription,s=e.onBuyMore,d=e.hasCustomSubscription,m=e.canUpgradeSubscription,p=mn().theme,g=!l.hasUnlimitedUsage&&l.currentUsage>l.usageLimit;return l.feature?a.createElement(ea,{$highlight:!!c,$borderColor:p.borderColor},a.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:16}},a.createElement(Pi,{variant:"body1"},l.feature&&Ji((o=l.feature).displayName,o.featureUnits,o.featureUnitsPlural)),c&&a.createElement(Ei,{title:a.createElement(we,{variant:"body1"},c.billingModel===n.BillingModel.PerUnit?"Billed for committed usage":"Billed for actual usage")},a.createElement(Wr,{icon:"DollarCoin",svgStrokeColor:p.iconsColor}))),a.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:8}},a.createElement(Pi,{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())+" ("+Mi(l.currentUsage||0,l.usageLimit)+"%)"),a.createElement(Ii,{entitlement:l,feature:l.feature,onBuyMore:s,canBuyMore:!!c,onManageSubscription:u,canUpgradeSubscription:m,hasCustomSubscription:d})),a.createElement(Fi,{entitlement:l}),l.hasUnlimitedUsage||z(l.usageLimit)||z(l.currentUsage)||!l.resetPeriod||!l.nextResetDate?null:a.createElement(we,{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(we,{color:"secondary"},"In current billing period")):null}var na=o("div",{target:"eoaojje0"})({name:"3hgi0y",styles:"margin-top:32px"});function ra(){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(w,{width:280,height:120}))})))}function ia(e){var t=e.onManageSubscription,r=e.onBuyMore,i=a.useState(!1),o=i[0],l=i[1],u=mn(),s=u.customerPortal,m=u.textOverrides,p=u.theme,g=u.isLoading||!s,h=s||{},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==s||!s.canUpgradeSubscription),k=d.keyBy(null==b?void 0:b.prices,"feature.refId"),w=d.keyBy(v,"feature.refId"),P=d.compact(null==b?void 0:b.prices.map((function(e){return e.feature&&w[e.feature.refId]}))),C=d.compact(null==v?void 0:v.filter((function(e){return!k[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(ai,{className:"stigg-subscription-usage-layout",$backgroundColor:p.backgroundColor,$borderColor:p.borderColor},a.createElement(vn,null,a.createElement(bn,{title:m.usageTabTitle,className:"stigg-customer-portal-usage-section-title",isLoading:g})),g?a.createElement(ra,null):a.createElement(a.Fragment,null,a.createElement(c,{container:!0,spacing:4},B.map((function(e){return a.createElement(c,{key:e.feature.refId,item:!0,xs:T},a.createElement(ta,{key:e.feature.refId,subscriptionPrice:k[e.feature.refId],entitlement:e,onManageSubscription:t,onBuyMore:r,hasCustomSubscription:x,canUpgradeSubscription:E}))}))),S.length>6&&a.createElement(na,null,a.createElement(hn,{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,n=e.onBuyMore,r=e.onCancelScheduledUpdates,o=e.onContactSupport,l=e.paywallComponent,c=e.hiddenSections,u=Wt().stigg,s=mn(),d=s.customerPortal,m=s.textOverrides,p=s.theme,g=s.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(Ki,{className:"stigg-customer-portal-layout"},a.createElement(Ri,{showWatermark:u.isWidgetWatermarkEnabled&&!!d}),a.createElement(Xi,{className:"stigg-customer-portal-sections"},a.createElement(ji,{onCancelScheduledUpdates:r,onBuyMore:n,onManageSubscription:f,onContactSupport:o,hiddenSections:c,cancelScheduledUpdatesButtonTitle:m.cancelScheduledUpdatesButtonTitle}),y&&a.createElement(ia,{onManageSubscription:f,onBuyMore:n}),a.createElement(Qi,{ref:h,paywallComponent:l,theme:p,title:m.paywallSectionTitle,isLoading:!d||g}),v&&a.createElement(Gi,null),b&&a.createElement(la,null)))}var oa=["textOverrides","theme","resourceId","productId"];function la(){var e=mn(),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(_i,{url:t.billingPortalUrl,text:n.viewInvoiceHistory,className:"stigg-view-invoice-history-button"}):null;return i||null!=t&&t.billingPortalUrl?a.createElement(ai,{className:"stigg-invoices-section-layout",$backgroundColor:r.backgroundColor,$borderColor:r.borderColor},a.createElement(vn,{className:"stigg-invoices-section-header"},a.createElement(bn,{isLoading:i,className:"stigg-invoices-section-title",title:n.invoicesTitle}),o)):null}var ca=function(e){return P(e,"addon.displayName")};function ua(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 se({},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 se({},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 ka(){var e=Na()[1];return function(t){return e((function(e){e.progressBar.completedSteps.push(t)}))}}function wa(){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:ka(),goNext:wa(),setIsDisabled:Pa()}}function Sa(){var e=Na()[0],t=e.paymentStep;return se({},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:se({},t?{billingAddress:t}:{},n?{taxPercentage:n}:{})}:{}}var Ba=function(){var e=ue(jt.mark((function e(t){var n,r,i,a,o,l,c,u,s,d,m,p,g,h,f,y,v,b;return jt.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,u=t.billingPeriod,s=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=se({customerId:r,planId:i,resourceId:a,billingCountryCode:c,addons:p,billingPeriod:u,promotionCode:o,billableFeatures:F(l)?void 0:l},Ta({billingAddress:s,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=Wt().stigg,r=Sa(),a=Na()[0].resourceId,o=pa(),l=o.widgetState,c=o.checkoutState||{},u=c.plan,s=c.customer;return{previewSubscriptionAction:i.useCallback(function(){var e=ue(jt.mark((function e(i){var o;return jt.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==s?void 0:s.id,planId:null==u?void 0:u.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==s?void 0:s.id,null==u?void 0:u.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 se({},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]),u=i.useMemo((function(){return[o,c]}),[c,o]);return a.createElement(Fa.Provider,{value:[u[0],u[1]]},t)};function Da(e){var t,r=e.children,o=e.textOverrides,l=e.theme,c=e.preferredBillingPeriod,u=e.billableFeatures,s=e.billingCountryCode,d=e.billingInformation,m=function(e){var t=e.planId,n=e.resourceId,r=e.billingCountryCode,a=e.onMockCheckoutState,o=Wt().stigg,l=i.useState(!0),c=l[0],u=l[1],s=i.useState(),d=s[0],m=s[1];return i.useEffect((function(){var e=function(){var e=ue(jt.mark((function e(){return jt.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),qt.error("Failed to load checkout "+(null==e.t0?void 0:e.t0.message),e.t0);case 10:return e.prev=10,u(!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 u(!1),void m(a({planId:t,resourceId:n,billingCountryCode:r}));o.isCustomerLoaded&&(u(!0),e())}),[o,o.isCustomerLoaded,n,t,r,a]),{checkout:d,isLoading:c}}({resourceId:e.resourceId,planId:e.planId,billingCountryCode:s,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:$t(e.typography,_t)}}(p.configuration):{typography:$t(_t)},v=cn(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)",paymentInputBackgroundColor:null==t?void 0:t.paymentInputBackgroundColor,paymentInputBorderColor:null==t?void 0:t.paymentInputBorderColor,paymentInputBorderRadius:null==t?void 0:t.paymentInputBorderRadius}}(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":""+Je({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=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 u=fa(null==i?void 0:i.prices[0].billingPeriod,o,l);if(u)return u}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=qe(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:s,preconfiguredBillableFeatures:null!=u?u:[]}),b=function(e){var t,r,i=e.activeSubscription,a=e.plan,o=e.billingPeriod,l=e.billingCountryCode,c=[],u=(null==a||null==(t=a.pricePoints)||null==(r=t[0])?void 0:r.currency)||n.Currency.Usd,s=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 ua(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:u})),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 ua(e.addon,r)})))?void 0:t.map((function(e){return se({},e,{addon:sa({addon:e.addon,currency:a,billingCountryCode:i})})})))||[]}({addons:null==i?void 0:i.addons,billingPeriod:o,billingCountryCode:l,currency:u});return null!=d&&d.length&&null!=s&&s.length&&(c=ca(d.filter((function(e){return s.some((function(t){return t.id===e.addon.id}))})))),{addons:c,initialAddons:V(c),availableAddons:s}}({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)?se({},Ea,{steps:xa.filter((function(e){return e.key!==ga.ADDONS}))}):Ea}({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,s,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(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(Wr,{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(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;"),Va=o(Ha,{target:"e1v7qkry2"})({name:"o7lzx8",styles:"span{display:flex;flex:1;}"}),$a=o(c,{target:"e1v7qkry1"})("span{display:flex;flex:",(function(e){return e.flex}),";}"),Za=o(w,{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||{},u=l.activeStep,s=l.completedSteps,d=l.steps;return a.createElement(U,{sx:{width:"100%",mb:3}},a.createElement(Wa,{variant:"determinate",value:100*(u+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=s.includes(r),p=i||r>u&&!m&&!s.includes(r-1)||u!==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(Za,{width:120,height:20,style:{marginTop:8}}):a.createElement(za,{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(_a,{icon:m?g:"OutlinedCircle",$disabled:p,$shouldFill:m})}),a.createElement(we,{variant:"h6",color:p?"primary.main.light":"primary.main"},d))))}))))},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":se({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(c,{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(we,{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),u=l[0],s=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=Ma({onMockCheckoutPreview:r}).previewSubscriptionAction,E=function(){var e=ue(jt.mark((function e(){var t,n,r,i;return jt.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()),s(!1)):i&&b(i),f(!1);case 9:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return u?a.createElement(c,null,a.createElement(we,{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:m,onChange:function(e){p(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()}},h?a.createElement(J,{size:18,sx:{color:"white"}}):a.createElement(Wr,{style:{display:"flex"},icon:"ArrowForward"}))}}),!!v&&a.createElement(we,{variant:"body1",color:"error"},v)):a.createElement(oo,{disabled:t,onAddClick:function(){return s(!0)},checkoutLocalization:n})},uo=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(Wr,{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(uo,{container:!0},a.createElement(c,{item:!0,display:"flex",gap:1,alignItems:"center"},a.createElement(so,{icon:"Coupon"}),a.createElement(we,{variant:"body1",color:"primary.main",lineHeight:"auto"},t)),a.createElement(c,{item:!0},a.createElement(Ja,{variant:"text",sx:{minWidth:"unset",padding:0},onClick:n},a.createElement(so,{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,u=i.widgetState,s=i.setWidgetReadOnly,d=La().setBillingAddress,m=o||{},p=m.customer,g=m.configuration,h=u.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(we,{variant:"h6"},l.newPaymentMethodBillingAddressTitle),a.createElement(Q.AddressElement,{onChange:function(e){if(e.complete){var t=e.value.address,r=se({postalCode:t.postal_code},de(t,ho));s(!0),d(r),n?function(){var e=ue(jt.mark((function e(){return jt.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:f?"always":"auto"},defaultValues:se({},(null==p?void 0:p.name)&&{name:p.name})}})),a.createElement(c,{flexDirection:"column",container:!0,gap:2},a.createElement(we,{variant:"h6"},l.newPaymentMethodCardTitle),a.createElement(Q.PaymentElement,{onChange:function(){},onReady:function(){},options:{readOnly:h,terms:{card:"never"},defaultValues:{billingDetails:se({},(null==p?void 0:p.name)&&{name:p.name},(null==p?void 0:p.email)&&{email:p.email})}}})))}function yo(e){return vo.apply(this,arguments)}function vo(){return(vo=ue(jt.mark((function e(t){var n,r;return jt.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=ue(jt.mark((function e(t){var r,i,a,o,l,c,u;return jt.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(!(u=e.sent.error)){e.next=9;break}return e.abrupt("return",{errorMessage:u.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 Eo(e){return ko.apply(this,arguments)}function ko(){return(ko=ue(jt.mark((function e(t){var n,r,i,a,o,l,c;return jt.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 Po.apply(this,arguments)}function Po(){return(Po=ue(jt.mark((function e(t){var n,r,i,a,o,l,c;return jt.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,yo({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,Eo({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 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:"eeyi5d32"})("@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}),";}"),To=o(we,{target:"eeyi5d31"})({name:"1kkk1zv",styles:"@keyframes fadeIn{0%{opacity:0;}75%{opacity:0;}100%{opacity:1;}}align-self:center;animation:fadeIn 5s ease-in forwards"}),Bo=o(ie,{target:"eeyi5d30"})({name:"1p4tykk",styles:"display:flex;justify-content:center;svg{width:350px!important;height:auto!important;}"});function Mo(e){var t=e.checkoutLocalization;return a.createElement(So,{className:"stigg-checkout-success-container"},a.createElement(Bo,{animationData:Co,loop:!1,autoplay:!0}),a.createElement(To,{variant:"h1",color:"primary.main"},t.summary.checkoutSuccessText))}var Ao=function(e){return new Promise((function(t){return setTimeout(t,e)}))},Uo=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)},Lo=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 u=Je({amount:-1*c.proration.netAmount.amount,currency:c.proration.netAmount.currency,minimumFractionDigits:2});return a.createElement(we,{variant:"caption",style:{marginTop:14}},a.createElement(Uo,{isLoading:o,width:"100%"},l.summary.creditsForUnusedTimeText({credits:u})))},Fo=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(we,{variant:"caption",style:{marginTop:14}},a.createElement(Uo,{isLoading:r,width:"100%"},o))},No=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 u,s,d=t.hasScheduledUpdates?null==r?void 0:r.currentBillingPeriodEnd:null==t?void 0:t.billingPeriodRange.end,m=Je(se({},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:s="month",u="the "+h(d).format("Do");break;case n.BillingPeriod.Annually:s="year",u=h(d).format("MMMM Do")}return a.createElement(we,{variant:"body1",style:{marginTop:14}},a.createElement(Uo,{isLoading:o,width:"100%"},f+=y+"for this subscription every "+s+" on "+u+", unless you cancel."))};function Io(e){return a.createElement(a.Fragment,null,a.createElement(Lo,Object.assign({},e)),a.createElement(Fo,Object.assign({},e)),a.createElement(No,Object.assign({},e)))}var Do=o("div",{target:"e1ultpe61"})({name:"rdmn2i",styles:"&+&{margin-top:8px;}"}),Oo=o("div",{target:"e1ultpe60"})({name:"bcffy2",styles:"display:flex;align-items:center;justify-content:space-between"}),jo=function(e){var t=a.createElement(we,{variant:"body1"},e.checkoutLocalization.summary.payAsYouGoTooltipText);return a.createElement(Ei,{placement:"left",title:t},a.createElement(Wr,{icon:"PayAsYouGoCharge",style:{display:"flex"}}))},qo=function(e){var t,r=e.checkoutLocalization,i=e.label,o=e.quantity,l=e.price,u=l.billingPeriod,s=l.pricingModel===n.BillingModel.UsageBased;return t=l.isTieredPrice?qe(l.tiers,o).unitPrice.amount:l.amount,a.createElement(Do,null,a.createElement(Oo,{style:{alignItems:"flex-start"}},a.createElement(c,{item:!0},a.createElement(we,{variant:"body1",color:"secondary"},i),(o>1||u===n.BillingPeriod.Annually)&&a.createElement(we,{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=Je({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"},s&&a.createElement(jo,{checkoutLocalization:r}),a.createElement(we,{variant:"body1",color:"secondary",style:{wordBreak:"break-word"}},Je({amount:o*t,currency:l.currency,minimumFractionDigits:2}),s&&" / unit"))))},Ro=function(e){return a.createElement(Do,null,a.createElement(Oo,{style:{alignItems:"flex-end"}},a.createElement(c,{item:!0},a.createElement(we,{variant:"body1",color:"secondary"},e.label)),a.createElement(c,{item:!0,display:"flex",gap:1,alignItems:"center"},a.createElement(we,{variant:"body1",color:"secondary",style:{wordBreak:"break-word"}},"Free"))))},Wo=function(e){var t=e.subscriptionPreview,n=e.isFetchingSubscriptionPreview,r=t.recurringInvoice||{},i=r.discount,o=r.discountDetails;return i&&o?a.createElement(Do,null,a.createElement(Oo,null,a.createElement(we,{variant:"body1",color:"secondary"},e.checkoutLocalization.summary.discountText({discountDetails:o,currency:t.immediateInvoice.total.currency})),a.createElement(we,{variant:"body1",color:"secondary"},n?a.createElement(Za,{width:50,height:16}):Je({amount:i.amount,currency:i.currency,minimumFractionDigits:2})))):null},zo=function(e){var t=e.isFetchingSubscriptionPreview,n=((e.subscriptionPreview||{}).immediateInvoice||{}).credits;return!n||!n.used||n.used.amount<=0?null:a.createElement(Do,null,a.createElement(Oo,null,a.createElement(we,{variant:"body1",color:"secondary"},e.checkoutLocalization.summary.appliedCreditsTitle),a.createElement(we,{variant:"body1",color:"secondary"},a.createElement(Uo,{isLoading:t},Je({amount:-1*n.used.amount,currency:n.used.currency,minimumFractionDigits:2})))))},_o=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(Do,null,a.createElement(Oo,null,a.createElement(we,{variant:"body1",color:"secondary"},e.checkoutLocalization.summary.taxTitle({taxDetails:n})),a.createElement(we,{variant:"body1",color:"secondary"},a.createElement(Uo,{isLoading:r},Je({amount:null==t?void 0:t.amount,currency:null==t?void 0:t.currency,minimumFractionDigits:2})))))},Ho=o(U,{target:"e9ji7bp4"})({name:"kj9yp4",styles:"max-width:470px;flex:1.5"}),Vo=o(ee,{target:"e9ji7bp3"})("border-radius:10px;background:",(function(e){return e.theme.stigg.palette.backgroundHighlight}),";padding:16px;");Vo.defaultProps={elevation:0};var $o,Zo,Go,Yo,Qo=o(we,{target:"e9ji7bp2"})({name:"1jcocwa",styles:"margin-bottom:16px;font-weight:500"}),Ko=o(W,{target:"e9ji7bp1"})({name:"1k6141t",styles:"margin:16px 0"}),Xo=o(we,{target:"e9ji7bp0"})({name:"5bhc30",styles:"margin-bottom:8px"}),Jo=function(e){var t,r,o,l,u,s=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=La().setErrorMessage,x=Ca(),E=Sa(),k=pa(),w=k.checkoutLocalization,P=k.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=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],u=Ma({onMockCheckoutPreview:t}).previewSubscriptionAction;return i.useEffect((function(){var e=function(){var e=ue(jt.mark((function e(){var t;return jt.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,u();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)}}),[u]),{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=Wt().stigg,c=La().useNewPaymentMethod,u=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{resourceId:t,planId:n.id,billingPeriod:e.billingPeriod,billableFeatures:e.billableFeatures,addons:r,promotionCode:e.promotionCode,billingCountryCode:e.billingCountryCode}}(),s=pa(),d=s.widgetState,m=s.setWidgetReadOnly,p=s.checkoutState||{},g=p.setupSecret,h=p.customer,f=Q.useStripe(),y=Q.useElements();return{handleSubmit:function(){var e=ue(jt.mark((function e(t){var s,d,p,v,b,x,E,k,w,P,C;return jt.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.preventDefault(),u){e.next=3;break}return e.abrupt("return",{success:!1,errorMessage:"Unexpected error, please contact support."});case 3:if(s=!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,s=!1);case 11:if(x=se({},u,{paymentMethodId:v}),E=function(){var e=ue(jt.mark((function e(t){var n,r;return jt.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,bo({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)}}(),!s){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((w=e.sent).errorMessage&&(d=w.errorMessage),p||!w.results||!w.success){e.next=24;break}return e.next=22,bo({applySubscriptionResults:w.results,stripe:f});case 22:(P=e.sent).errorMessage&&(d=P.errorMessage,s=!1);case 24:s=s&&w.success&&!d,k=w.results,e.next=34;break;case 28:return e.next=30,E(x);case 30:!(C=e.sent).success&&C.errorMessage&&(d=C.errorMessage),s=C.success&&!d,k=C.results;case 34:if(m(!1),!s||!a){e.next=40;break}if(a(),o){e.next=40;break}return e.next=40,Ao(5e3);case 40:return e.next=42,i({success:s,error:d});case 42:return e.abrupt("return",{results:k,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:s,onCheckoutCompleted:d,onSuccess:function(){v(!0),x.markStepAsCompleted(x.progressBarState.activeStep)}}),D=I.handleSubmit,O=I.isLoading,j=function(){var e=ue(jt.mark((function e(t){var n;return jt.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=ue(jt.mark((function e(t){return jt.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 w.summary.baseChargeText?w.summary.baseChargeText({billingPeriod:E.billingPeriod}):w.summary.baseChargeText;return a.createElement(Ho,null,a.createElement(Vo,null,a.createElement(Qo,{variant:"h3"},w.summary.title),a.createElement(c,{display:"flex",flexDirection:"row",alignItems:"center",marginY:2},a.createElement(we,{variant:"h6",color:"primary",style:{paddingRight:"8px"}},w.summary.planName({plan:C})),a.createElement(Ko,{className:"stigg-checkout-summary-divider",sx:{flex:1,margin:"0 !important"}})),A&&a.createElement(qo,{checkoutLocalization:w,label:Y,quantity:1,price:A}),!A&&g?a.createElement(Ro,{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(qo,{checkoutLocalization:w,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(c,{display:"flex",flexDirection:"row",alignItems:"center",marginY:2},a.createElement(we,{variant:"h6",color:"primary",style:{paddingRight:"8px"}},w.summary.addonsSectionTitle),a.createElement(Ko,{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(qo,{checkoutLocalization:w,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(Ko,{className:"stigg-checkout-summary-divider"}),$&&a.createElement(c,{display:"flex",flexDirection:"row",alignItems:"center",marginY:2},a.createElement(we,{variant:"h6",color:"primary",style:{paddingRight:"8px"}},w.summary.discountsSectionTitle),a.createElement(Ko,{className:"stigg-checkout-summary-divider",sx:{flex:1,margin:"0 !important"}})),H&&a.createElement(go,{disabled:O||N,checkoutLocalization:w,onMockCheckoutPreview:h}),V&&a.createElement(Wo,{subscriptionPreview:F,isFetchingSubscriptionPreview:N,checkoutLocalization:w}),$&&a.createElement(Ko,{className:"stigg-checkout-summary-divider"}),a.createElement(_o,{tax:null==z?void 0:z.tax,taxDetails:null==z?void 0:z.taxDetails,isFetchingSubscriptionPreview:N,checkoutLocalization:w}),g?null:a.createElement(a.Fragment,null,a.createElement(Oo,{style:{marginTop:16}},a.createElement(c,{display:"flex",flexDirection:"column",container:!0},a.createElement(c,{item:!0,display:"flex",justifyContent:"space-between"},a.createElement(we,{variant:"h6"},w.summary.totalText),a.createElement(we,{variant:"h6"},a.createElement(Uo,{isLoading:N},G?w.summary.onlyPayAsYouGoText:null,!G&&Z?w.summary.startsAtText:null,G?null:Je(se({amount:0},null==z?void 0:z.total,{minimumFractionDigits:2}))))),a.createElement(c,{item:!0},a.createElement(we,{variant:"body1",color:"secondary"},w.summary.totalBillingPeriodText({billingPeriod:E.billingPeriod}))))),a.createElement(Ko,{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(Do,null,a.createElement(Oo,null,a.createElement(we,{variant:"body1",color:"secondary"},w.summary.proratedTotalDueText),a.createElement(we,{variant:"body1",color:"secondary"},a.createElement(Uo,{isLoading:N},Je({amount:(null==W||null==(l=W.subTotal)?void 0:l.amount)+((null==W||null==(u=W.tax)?void 0:u.amount)||0),currency:null==W?void 0:W.subTotal.currency,minimumFractionDigits:2}))))):null,a.createElement(zo,{subscriptionPreview:F,isFetchingSubscriptionPreview:N,checkoutLocalization:w}),a.createElement(Do,null,a.createElement(Oo,null,a.createElement(Xo,{variant:"h6"},w.summary.totalDueText),a.createElement(Xo,{variant:"h6"},a.createElement(Uo,{isLoading:N},Je(se({amount:0},null==W?void 0:W.total,{minimumFractionDigits:2})))))),a.createElement(Io,{plan:C,activeSubscription:S,subscriptionPreview:F,isFetchingSubscriptionPreview:N,checkoutLocalization:w,billingPeriod:E.billingPeriod}),a.createElement(Ja,{$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(we,{className:"stigg-checkout-summary-cta-button-text",variant:"h3",color:"white",style:{display:"flex"}},y?a.createElement(Wr,{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:w,isPlanUpdate:!!S&&(null==S?void 0:S.plan.id)===(null==C?void 0:C.id)})))),a.createElement(At,{source:"checkout",showWatermark:!0,style:{marginTop:8,display:"flex",justifyContent:"center"}}),!p&&y&&a.createElement(Mo,{checkoutLocalization:w}))},el=function(){return a.createElement(Ho,null,a.createElement(Vo,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(At,{source:"checkout",showWatermark:!0,style:{marginTop:8,display:"flex",justifyContent:"center"}}))},tl=o(c,{target:"e1o28dc92"})({name:"1wte80x",styles:"width:100%;gap:8px"}),nl=o(c,{target:"e1o28dc91"})({name:"a3p0fn",styles:"display:flex;justify-content:space-between;align-items:center;height:80px"}),rl=o(Ja,{target:"e1o28dc90"})({name:"156064h",styles:"min-width:unset;width:41px;height:41px;padding:0"});function il(e){var t,r=e.addon,i=e.billingPeriod,o=e.addonState,l=e.initialAddonState,u=e.setAddon,s=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 u(r,null!=e?e:null);m({addonId:r.id,isValid:!0}),u(r,e)};return a.createElement(nl,{container:!0},a.createElement(c,{item:!0},a.createElement(we,{variant:"h6",lineHeight:"24px"},r.displayName),!!g&&a.createElement(we,{variant:"body1",lineHeight:"20px",color:"secondary"},Je({amount:g.amount,currency:g.currency,minimumFractionDigits:2})+"/"+(i===n.BillingPeriod.Annually?"year":"month"))),a.createElement(c,{item:!0},f&&a.createElement(Ja,{variant:"text",size:"small",sx:{padding:"8px",minWidth:"unset"},onClick:function(){l?u(r,l.quantity):s(r.id),m({addonId:r.id,isValid:!0})}},a.createElement(we,{color:"primary.main",variant:"body1"},"Undo")),h&&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:!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(rl,{color:"error",onClick:function(){s(r.id),m({addonId:r.id,isValid:!0})}},a.createElement(Wr,{icon:"Trash",style:{display:"flex"}}))),!h&&a.createElement(Ja,{sx:{paddingX:"22px",paddingY:"8px"},onClick:function(){return y(1)}},a.createElement(we,{color:"primary.main",variant:"body1"},d.addAddonText))))}function al(){var e,t=pa(),n=t.checkoutLocalization,r=t.setIsValid,o=ba().billingPeriod,l=Ca().setIsDisabled,c=se({},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()}),u=c.initialAddons,s=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(tl,{container:!0},null==d?void 0:d.map((function(e){var t=s.find((function(t){return t.addon.id===e.id})),r=null==u?void 0:u.find((function(t){return t.addon.id===e.id}));return a.createElement(il,{key:e.id,addon:e,billingPeriod:o,addonState:t,initialAddonState:r,setAddon:m,removeAddon:p,checkoutLocalization:n,onAddonsValidationChange:function(e){var t;return f(se({},h,((t={})[e.addonId]=e.isValid,t)))},isValid:h[e.id]})})))}var ol,ll=te(c,{shouldForwardProp:function(e){return!e.startsWith("$")}})($o||($o=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})),cl=te(ll)(Zo||(Zo=me(["\n flex-direction: column;\n align-items: unset;\n"]))),ul=te(c)(Go||(Go=me(["\n display: flex;\n align-items: center;\n flex: 1;\n gap: 12px;\n"]))),sl=te(c)(Yo||(Yo=me(["\n display: flex;\n flex-direction: column;\n"])));function dl(e){var t=e.icon,n=e.text,r=e.subtitle;return a.createElement(ul,null,a.createElement(le,{checked:e.checked,disabled:e.readOnly}),a.createElement(Wr,{icon:t,style:{display:"flex"}}),a.createElement(sl,{container:!0},a.createElement(c,{item:!0},n),r&&a.createElement(c,{item:!0},r)))}function ml(e){var t=e.paymentMethodDetails,n=e.readOnly;if(!t)return null;var r=t.expirationMonth,i=t.expirationYear;return a.createElement(ll,{item:!0,onClick:e.onSelect,$disabled:n},a.createElement(dl,{checked:e.checked,readOnly:n,icon:"PaymentMethod",text:a.createElement(we,{variant:"h6"},"Card ending in "+t.last4Digits),subtitle:!!r&&!!i&&a.createElement(we,{variant:"body1"},"Expires "+r.toString().padStart(2,"0")+"/"+i)}))}function pl(e){var t=e.checked,n=e.readOnly,r=e.onBillingAddressChange,i=e.collectPhoneNumber;return a.createElement(cl,{item:!0,onClick:e.onSelect,$disabled:n},a.createElement(dl,{checked:t,readOnly:n,icon:"PaymentMethod",text:a.createElement(we,{variant:"h6"},e.checkoutLocalization.newPaymentMethodText)}),a.createElement(oe,{in:t},a.createElement(fo,{onBillingAddressChange:r,collectPhoneNumber:i})))}var gl=te(c)(ol||(ol=me(["\n display: flex;\n flex-direction: column;\n gap: 24px;\n"])));function hl(e){var t=e.onBillingAddressChange,n=e.collectPhoneNumber,r=pa(),i=r.checkoutLocalization,o=r.widgetState,l=(r.checkoutState||{}).customer,c=La(),u=c.errorMessage,s=c.useNewPaymentMethod,d=c.setUseNewPaymentMethod,m=o.readOnly,p=function(e){m||d(e)};return a.createElement(gl,{container:!0},!!u&&a.createElement(ae,{severity:"error",sx:{alignItems:"center"}},a.createElement(we,{overrideColor:"inherit"},u)),a.createElement(ml,{readOnly:m,checked:!s,paymentMethodDetails:null==l?void 0:l.paymentMethodDetails,onSelect:function(){return p(!1)}}),a.createElement(pl,{readOnly:m,checked:s,checkoutLocalization:i,onSelect:function(){return p(!0)},onBillingAddressChange:t,collectPhoneNumber:n}))}var fl=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(we,{className:"stigg-checkout-change-plan-button-text",color:"primary.main",variant:"h3",style:{lineHeight:"24px"}},e.checkoutLocalization.changePlan))};function yl(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(we,{variant:"body1",color:"disabled",style:{opacity:.6,marginBottom:"8px"}},"Selected plan"),a.createElement(U,{sx:{display:"flex",justifyContent:"space-between"}},a.createElement(we,{variant:"h1"},null==l?void 0:l.displayName),n&&r&&a.createElement(fl,{onClick:function(){r({currentPlan:l})},checkoutLocalization:o,size:"medium"}))),a.createElement(W,{className:"stigg-checkout-plan-header-divider"}))}function vl(e){switch(e){case n.BillingPeriod.Annually:return"Annual";case n.BillingPeriod.Monthly:return"Monthly";default:return""}}var bl,xl=o(U,{target:"ekae5v44"})({name:"1k6141t",styles:"margin:16px 0"}),El=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;}}"),kl=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(El,{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":vl(t)},sx:{padding:0,marginRight:"8px"}}),a.createElement(U,null,a.createElement(we,{variant:"h3",color:"primary"},vl(t))))};function Pl(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(xl,null,a.createElement(we,{variant:"h6",color:"primary",fontWeight:u.FontWeight.Medium},r.billingPeriodsTitle),a.createElement(kl,null,!(null==o||!o.length)&&a.createElement(wl,{key:n.BillingPeriod.Monthly,billingPeriod:n.BillingPeriod.Monthly,isOnlyBillingPeriod:!c}),!(null==l||!l.length)&&a.createElement(wl,{key:n.BillingPeriod.Annually,billingPeriod:n.BillingPeriod.Annually,isOnlyBillingPeriod:!c}))):null}var Cl=te.div(bl||(bl=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"]))),Sl=function(e,t){var n=e.minUnitQuantity,r=e.maxUnitQuantity;return!t||t<(n||1)?"Minimum "+(n||1):r&&t>r?"Maximum "+r:""};function Tl(e){var t,r,i,o,l,c,u=e.charge,s=e.isValid,d=e.setBillableFeature,m=e.billableFeature,p=e.onValidationChange,g=null==(t=u.feature)?void 0:t.featureId,h=!g,f=u.pricingModel===n.BillingModel.UsageBased,y=h?"Base charge":Ji((null==(r=u.feature)?void 0:r.displayName)||"",null==(i=u.feature)?void 0:i.units,null==(o=u.feature)?void 0:o.unitsPlural),v=!!(null!=u&&u.minUnitQuantity||null!=u&&u.maxUnitQuantity);if(h||f)c=""+Je({amount:u.amount,currency:u.currency,locale:"en-us",minimumFractionDigits:2}),f&&(c+=" / unit");else if(u.isTieredPrice&&g){var b=qe(u.tiers,m.quantity||1);c=a.createElement(rt,{componentId:g+"-tiers",tiers:u.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:!s,helperText:s?void 0:Sl(u,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=u.minUnitQuantity,i=u.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(u,a);d(g,o)}},onWheel:function(e){return e.target.blur()}})}return a.createElement(Cl,null,a.createElement(U,{display:"flex",flexDirection:"column"},a.createElement(we,{variant:"h6",color:"primary",lineHeight:"24px"},y),v&&a.createElement(we,{variant:"body1",color:"secondary",lineHeight:"20px"},ye(u.minUnitQuantity,u.maxUnitQuantity,null==(l=u.feature)?void 0:l.unitsPlural))),a.createElement(we,{variant:"h6",color:"primary"},c))}function Bl(e){var t,n=e.plan,r=e.billingPeriod,o=ba(),l=o.billableFeatures,c=o.setBillableFeature,u=Ca().setIsDisabled,s=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}));u(e),s(!e)}),[p,u,s]),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(Tl,{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 se({},e,((r={})[t]=n,r))}))}})})))}var Ml,Al=o(U,{target:"emtnukp0"})({name:"1d3w5wq",styles:"width:100%"}),Ul=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(yl,{allowChangePlan:!0,onChangePlan:t}),a.createElement(Al,null,a.createElement(Pl,{plan:i,checkoutLocalization:r}),a.createElement(Bl,{plan:i,billingPeriod:o})))};function Ll(){return(Ll=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 Fl=o((function(e){return i.createElement("svg",Ll({width:16,height:16,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),Ml||(Ml=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}),";}"),Nl=o(U,{target:"eaawmuo2"})({name:"zjik7",styles:"display:flex"}),Il=o(ae,{target:"eaawmuo1"})({name:"18uqayh",styles:"margin-bottom:16px"}),Dl=o(U,{target:"eaawmuo0"})("padding:16px;border-radius:10px;width:100%;border:",(function(e){return"1px solid "+e.theme.stigg.palette.outlinedBorder}),";"),Ol=function(e){var t=e.planName,n=e.priceText;return a.createElement(Dl,{className:"stigg-checkout-downgrade-to-free-container"},a.createElement(we,{className:"stigg-checkout-downgrade-to-free-text-header",style:{opacity:.8},variant:"caption",color:"disabled"},e.headerText),a.createElement(we,{className:"stigg-checkout-downgrade-to-free-plan-name",bold:!0,variant:"h3",color:"primary"},t),a.createElement(we,{className:"stigg-checkout-downgrade-to-free-price-text",color:"secondary"},n))},jl=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(fl,{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(Il,{action:t,className:"stigg-checkout-downgrade-to-free-alert",severity:"info"},a.createElement(we,{span:!0,color:"secondary"},n.downgradeToFree.alertText({plan:r.plan}))),a.createElement(Nl,{className:"stigg-checkout-downgrade-to-free-plans-container"},a.createElement(Ol,{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(Fl,{className:"stigg-checkout-downgrade-to-free-arrow",style:{margin:"auto 16px",minWidth:"16px"}}),a.createElement(Ol,{headerText:n.downgradeToFree.freePlanHeader({plan:i}),planName:n.downgradeToFree.freePlanName({plan:i}),priceText:n.downgradeToFree.freePlanPriceText({plan:i})})))};function ql(e){var t=e.onCheckout,r=e.onCheckoutCompleted,o=e.onChangePlan,l=e.onBillingAddressChange,c=e.collectPhoneNumber,u=e.disablePromotionCode,s=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=h.theme,b=Ca().currentStep,x=y.isLoadingCheckoutData,E=pa(),k=E.checkoutLocalization,w=E.checkoutState||{},P=w.plan,C=w.activeSubscription,S=!!P&&P.pricingType===n.PricingType.Free&&!!C&&C.pricingType!==n.PricingType.Free,T=function(e,t){var n=t.onBillingAddressChange,r=t.onChangePlan,i=t.collectPhoneNumber;switch(e.key){case ga.PLAN:return{content:a.createElement(Ul,{onChangePlan:r})};case ga.ADDONS:return{content:a.createElement(al,null)};case ga.PAYMENT:return{content:a.createElement(hl,{onBillingAddressChange:n,collectPhoneNumber:i})};default:return{content:null}}}(b,{onBillingAddressChange:l,onChangePlan:o,collectPhoneNumber:c}).content,B=a.createElement(a.Fragment,null,S?a.createElement(jl,{freePlan:P,activeSubscription:C,allowChangePlan:!0,checkoutLocalization:k,onChangePlan:o}):a.createElement(a.Fragment,null,T)),M=i.useMemo((function(){return g?{clientSecret:g}:{mode:"setup",currency:"usd"}}),[g]);return a.createElement(Q.Elements,{key:g,stripe:p,options:se({},M,{appearance:{theme:"stripe",variables:{colorText:f.palette.text.primary,colorPrimaryText:f.palette.text.primary,colorTextPlaceholder:f.palette.text.disabled,fontFamily:f.typography.fontFamily,colorBackground:null==v?void 0:v.paymentInputBackgroundColor,borderRadius:null==v?void 0:v.paymentInputBorderRadius},rules:null!=v&&v.paymentInputBorderColor?{".Input":{borderColor:null==v?void 0:v.paymentInputBorderColor}}:void 0}})},a.createElement(ja,{className:"stigg-checkout-layout"},!S&&a.createElement(Ga,null),a.createElement(qa,null,a.createElement(Ra,null,x?a.createElement(no,null):B),x?a.createElement(el,null):a.createElement(Jo,{disablePromotionCode:u,disableSuccessAnimation:s,onCheckout:t,onCheckoutCompleted:r,isFreeDowngrade:S,onMockCheckoutPreview:d}))))}var Rl,Wl=["textOverrides","theme","resourceId","planId","preferredBillingPeriod","billingCountryCode","billableFeatures","billingInformation","onMockCheckoutState"];(Rl=exports.ProvisionStatus||(exports.ProvisionStatus={})).IN_PROGRESS="IN_PROGRESS",Rl.SUCCEEDED="SUCCEEDED",Rl.FAILED="FAILED",Object.keys(n).forEach((function(e){"default"!==e&&Object.defineProperty(exports,e,{enumerable:!0,get:function(){return n[e]}})})),exports.AddonsList=kn,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,u=e.billingInformation,s=e.onMockCheckoutState,d=de(e,Wl);return a.createElement(Da,{textOverrides:t,theme:n,resourceId:r,planId:i,preferredBillingPeriod:o,billingCountryCode:l,billableFeatures:c,billingInformation:u,onMockCheckoutState:s},a.createElement(ql,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(pn,{textOverrides:t,theme:n,resourceId:r,productId:i},a.createElement(aa,Object.assign({},o)))},exports.CustomerPortalProvider=pn,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,u=e.onPlanSelected,s=e.preferredBillingPeriod,d=e.onBillingPeriodChange,m=e.billingCountryCode,p=e.shouldHidePlan,y=!!i.useContext(dn),v=!1;if(y){var b=mn();v=b.isLoading,r=b.resourceId}var x=function(e){var t=e.productId,r=e.resourceId,a=e.showOnlyEligiblePlans,o=e.billingCountryCode,l=e.preferredBillingPeriod,c=Wt(),u=c.stigg,s=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],k=i.useState(!0),w=k[0],C=k[1];i.useEffect((function(){!function(){var e=ue(jt.mark((function e(){var n,i,a,c;return jt.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,C(!0),e.next=4,u.waitForInitialization();case 4:return e.next=6,u.getPaywall({productId:t,resourceId:r,billingCountryCode:o});case 6:i=zt((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),qt.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)}}()()}),[u,t,u.isCustomerLoaded,o,r,l]);var S=function(e,t){var r,i=e||{},a=i.plans,o=i.currency,l=i.configuration,c=i.customer,u=i.paywallCalculatedPricePoints,s=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=s.currentSubscription,m=s.currentPlan,p=s.isCustomerOnTrial,g=s.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 se({},e,{paywallCalculatedPricePoints:null==u?void 0:u.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 k,w=m&&(null==a||null==(k=a.find((function(e){return e.id===(null==m?void 0:m.id)})))?void 0:k.order);f(w)||(E=E.map((function(e){return se({},e,{isLowerThanCurrentPlan:w>e.order})})),t&&(E=E.filter((function(e){return e.order>=w}))))}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:$t(e.typography),layout:{ctaAlignment:Zt(null==n?void 0:n.alignment),headerAlignment:Zt(null==n?void 0:n.alignment),descriptionAlignment:Zt(null==n?void 0:n.alignment),planMaxWidth:Ht(null==n?void 0:n.planWidth),planMinWidth:Ht(null==n?void 0:n.planWidth),planMargin:Ht(null==n?void 0:n.planMargin),planPadding:Ht(null==n?void 0:n.planPadding)}}}(l):void 0;return{currentPlan:m,currentSubscription:d,isCustomerOnTrial:p,plans:E,paywallConfiguration:C}}(x,a);return se({customer:(null==x?void 0:x.customer)||null,isLoading:w,selectedBillingPeriod:m,setSelectedBillingPeriod:p,availableBillingPeriods:y,locale:s,configuration:S.paywallConfiguration},S)}({productId:t,resourceId:r,showOnlyEligiblePlans:l,billingCountryCode:m,preferredBillingPeriod:s}),E=x.plans,k=x.customer,w=x.currentSubscription,C=x.isCustomerOnTrial,S=x.isLoading,T=x.selectedBillingPeriod,B=x.setSelectedBillingPeriod,M=x.availableBillingPeriods,A=x.locale,U=x.configuration,L=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),F=!E||S||v?a.createElement(rn,null):a.createElement(Ot,{plans:E,customer:k,currentSubscription:w,selectedBillingPeriod:T,onBillingPeriodChanged:function(e){B(e),d&&d(e)},availableBillingPeriods:M,highlightedPlanId:o,isCustomerOnTrial:C,onPlanSelected:u,paywallLocale:L,locale:A,shouldHidePlan:p});return y?F:a.createElement(sn,{componentTheme:U},F)},exports.Promotions=Pn,exports.StiggContext=Rt,exports.StiggProvider=function(e){var t=e.apiKey,n=e.baseUri,o=e.baseEdgeUri,l=e.enableEdge,c=e.customerId,u=e.customerToken,s=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:u,resourceId:s,baseUri:n,baseEdgeUri:o,enableEdge:l,entitlementsFallback:h,useEntitlementPolling:p,entitlementPollingInterval:g},x=i.useState((function(){return{stigg:null!=f?f:r.initialize(se({},b,{lazyLoad:!0})),locale:m||"en-US",isInitialized:!1,theme:d,refreshData:(e=ue(jt.mark((function e(){return jt.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return w((function(e){return se({},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],w=x[1];return i.useEffect((function(){var e=!0,n=function(t){e&&w(t)},i=function(){return n((function(e){return se({},e,{updatedAt:new Date})}))},a=function(e){return n((function(t){return t.stigg&&t.stigg.removeListener("entitlementsUpdated",i),e.addListener("entitlementsUpdated",i),se({},t,{stigg:e,isInitialized:!0,updatedAt:new Date})}))};return function(){var e=ue(jt.mark((function e(){var i;return jt.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=E.stigg,t!==v.current&&(qt.log("Updating stigg client",{apiKey:t}),v.current=t,i=r.initialize(se({},b)),n((function(e){return se({},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,u,s):e.clearCustomer()}),[c,u,s]),i.useEffect((function(){w((function(e){return se({},e,{theme:d})}))}),[d]),a.createElement(Rt.Provider,{value:E},a.createElement(k.SkeletonTheme,{baseColor:"#F5F6F9",highlightColor:"#e5e6ea"},y))},exports.SubscriptionsOverview=ji,exports.useStiggContext=Wt,exports.useWaitForCheckoutCompleted=function(e){var t,n=void 0===e?{}:e,r=n.onProvisionStart,a=n.onProvisionSucceeded,o=n.onProvisionFailed,l=Wt().stigg,c=i.useState(exports.ProvisionStatus.IN_PROGRESS),u=c[0],s=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=ue(jt.mark((function e(){var t;return jt.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,s(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),s(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:u}};
|
|
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")),u=require("styled-typography"),s=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")),k=require("react-loading-skeleton"),w=e(k),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("lottie-react")),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 ue(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 se(){return(se=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","as"];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(u.Text,{target:"ewjez2x0"})("margin:0;",(function(e){return e.$span&&"display: inline"}),";");function Ee(e){switch(e){case"bold":return u.FontWeight.Bold;case"normal":default:return u.FontWeight.Normal}}function ke(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 u.FontWeight.Normal}}var we=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=e.as,f=void 0===h?"p":h,y=de(e,ve),v=s.useTheme(),b=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),x="typography-level-"+b;return a.createElement(xe,Object.assign({as:f,ref:t},y,{className:e.className?e.className+" "+x:x,style:i,level:b,color:p||be(v,m),fontWeight:null!=o?o:g?u.FontWeight.Bold:ke(v,c),$span:r}),n)})),Pe=["displayNameOverride"],Ce=o(we,{target:"e1mddeqb3"})({name:"ti75j2",styles:"margin:0"}),Se=o("div",{target:"e1mddeqb2"})({name:"gl2qrx",styles:"display:flex;align-items:baseline"}),Te=o("div",{target:"e1mddeqb1"})("display:flex;align-items:center;margin-right:16px;height:",(function(e){return e.theme.stigg.typography.h3.fontSize}),";flex-shrink:0;"),Be=o(fe,{target:"e1mddeqb0"})("flex-shrink:0;*{fill:",(function(e){return e.theme.stigg.palette.text.disabled}),";}");function Me(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,u=o||l,s=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";default:return""}}(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+" "+s}return u?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,null,a.createElement(Be,{className:"stigg-entitlement-row-icon"})),a.createElement(Ce,{className:"stigg-entitlement-name",variant:"h6",color:"secondary"},t||r))}var Ae,Ue=o("div",{target:"e1yz7zcg0"})({name:"budh8k",styles:"display:flex;flex-direction:column;gap:16px"});function Le(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(Me,{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(Ue,{className:"stigg-plan-entitlements-container"},a.createElement(we,{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(Me,{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})})))}(Ae=exports.SubscribeIntentionType||(exports.SubscribeIntentionType={})).START_TRIAL="START_TRIAL",Ae.UPGRADE_TRIAL_TO_PAID="UPGRADE_TRIAL_TO_PAID",Ae.REQUEST_CUSTOM_PLAN_ACCESS="REQUEST_CUSTOM_PLAN_ACCESS",Ae.CHANGE_BILLING_PERIOD="CHANGE_BILLING_PERIOD",Ae.CHANGE_UNIT_QUANTITY="CHANGE_UNIT_QUANTITY",Ae.UPGRADE_PLAN="UPGRADE_PLAN",Ae.DOWNGRADE_PLAN="DOWNGRADE_PLAN",Ae.CANCEL_SCHEDULED_UPDATES="CANCEL_SCHEDULED_UPDATES";var Fe,Ne,Ie=function(e){return{left:"flex-start",center:"center",right:"flex-end"}[e]},De=function(e){return h.utc(e).format("MMMM Do, yyyy")};function Oe(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,s=void 0===u?"":u;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 ",De(t.scheduledExecutionTime)):s,"."),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 ",De(t.scheduledExecutionTime)):s,".")};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 ",De(t.scheduledExecutionTime)):s,"."),line2:"Until then you still have access to your current "+b+" count."};default:return{}}}function je(e){return e.feature&&(1!==e.feature.unitQuantity?e.feature.unitsPlural:e.feature.units)||""}function qe(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 Re(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;default:return 0}}function We(e,t,r,i,a){var o=e.pricePoints.filter((function(e){return e.billingPeriod===t&&e.isTieredPrice}));if(1===o.length){var l,c=o[0],u=c.feature.featureId,s=a?a({plan:e}):0,d=c.tiers[s];if(i[u])d=(null==(l=c.tiers)?void 0:l.find((function(e){return e.upTo===i[u].upTo})))||d;else if(r){var m=r.prices.find((function(e){var t;return e.pricingModel===n.BillingModel.PerUnit&&e.tiersMode&&(null==(t=e.feature)?void 0:t.featureId)===u}));m&&(d=qe(c.tiers,m.feature.unitQuantity||1))}var p={};return p[u]=d,p}return{}}!function(e){e[e.Lower=-1]="Lower",e[e.Equal=0]="Equal",e[e.Higher=1]="Higher"}(Fe||(Fe={}));var ze,_e=o(m,{target:"e199qof96"})({name:"1a2afmv",styles:"margin-left:10px"}),He=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&&s.css(Ne||(Ne=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}),";}"),Ve=o(we,{target:"e199qof94"})({name:"h05omw",styles:"margin:0;font-size:15px"}),$e=o(we,{target:"e199qof93"})({name:"1cnls12",styles:"min-height:87px"}),Ze=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;"),Ge=o(we,{target:"e199qof91"})({name:"1etgg0o",styles:"margin-top:8px;margin-bottom:17px;min-height:20px"}),Ye=o("div",{target:"e199qof90"})("display:flex;flex-direction:column;margin-top:4px;align-self:",(function(e){return Ie(e.theme.stigg.layout.ctaAlignment)}),";width:100%;");function Qe(e){var t=e.isNextPlan,r=e.customer,o=e.plan,l=e.billingPeriod,c=e.isCustomerOnTrial,u=e.onPlanSelected,m=e.paywallLocale,p=e.withTrialLeftRow,g=e.currentSubscription,h=e.selectedTierByFeature,f=s.useTheme(),y=i.useState(!1),v=y[0],b=y[1],x=m.planCTAButton,E=x.currentPlan,k=x.custom,w=x.downgrade,P=x.startTrial,C=x.upgrade,S=x.startNew,T=x.switchToBillingPeriod,B=x.cancelScheduledUpdate,M=d.isFunction(w)?w(o):w,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=Oe({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 Fe.Equal;var r=t.prices.find((function(e){return e.pricingModel===n.BillingModel.PerUnit&&e.tiersMode}));if(!r)return Fe.Equal;var i=r.feature,a=i.unitQuantity;if(!a)return Fe.Equal;var o=e[i.featureId];return o?o.upTo<a?Fe.Lower:o.upTo>a?Fe.Higher:Fe.Equal:Fe.Equal}(h,g)){case Fe.Lower:U.intentionType=exports.SubscribeIntentionType.CHANGE_UNIT_QUANTITY,U.title=M;break;case Fe.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=k,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(Ye,{className:"stigg-paywall-plan-button-layout"},t&&F?a.createElement($e,{color:"secondary",variant:"body1",className:"stigg-paywall-schedule-update-text"},F," ",a.createElement(Ze,{color:"secondary",onClick:function(){b(!0),Promise.resolve(u(U.intentionType)).finally((function(){return b(!1)}))}},U.title)):a.createElement(a.Fragment,null,a.createElement(He,{className:"stigg-paywall-plan-button","data-testid":"paywall-card-cta-"+o.displayName,disabled:N,$disabled:N,onClick:function(){b(!0),Promise.resolve(u(U.intentionType)).finally((function(){return b(!1)}))}},a.createElement(Ve,{className:"stigg-paywall-plan-button-text",variant:"h6",color:"primary.main"},U.title),v&&a.createElement(_e,{color:f.stigg.palette.text.disabled,loading:!0,size:16})),p?a.createElement(Ge,{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 Ke(){return(Ke=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 Xe=function(e){return i.createElement("svg",Ke({width:16,height:16,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),ze||(ze=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"})))},Je=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,u=(void 0===r?n.Currency.Usd:r).toString(),s=y(u),d=new Intl.NumberFormat(i,se({maximumFractionDigits:o,minimumFractionDigits:c,style:"currency",currency:u},s?{currencyDisplay:"code"}:{})).format(t||0);return s&&(d=d.replace(u,s)),d.replace(/\s/g,"")};function et(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})),u=null==(l=e.paywallCalculatedPricePoints)?void 0:l.find((function(e){return e.billingPeriod===t}));if(!(null!=c&&c.length||u))return{price:r.price.priceNotSet};var s={planPrices:c,paywallCalculatedPrice:u,selectedBillingPeriod:t,selectedTierByFeature:o||{}};return r.price.paid?r.price.paid(se({},s,{plan:e})):function(e){for(var t,r,i,a=e.planPrices,o=e.selectedBillingPeriod,l=e.locale,c=e.shouldShowMonthlyPriceAmount,u=e.selectedTierByFeature,s=e.paywallCalculatedPrice||a[0],d=s.currency,m=s.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];u[v.feature.featureId]&&(b=u[v.feature.featureId]||b,t=v.tiers,r=je(v)),g+=Re(v,b,o,c)}}if(p){var x,E=a[0],k=(null==(x=E.feature)?void 0:x.units)||"";E.pricingModel!==n.BillingModel.PerUnit||E.isTieredPrice?E.pricingModel===n.BillingModel.UsageBased&&(f="per "+k):f="per "+k+" "+h}return{price:Je({amount:g,currency:d,locale:l}),unit:f,tiers:t,tierUnits:r}}(se({},s,{locale:i,shouldShowMonthlyPriceAmount:a,paywallLocale:r}));default:return{price:""}}}var tt=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}),";}"),nt=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 rt(e){var t=e.componentId,n=e.tiers,r=e.tierUnits,i=e.selectedTier,o=e.handleTierChange;return a.createElement(we,{as:"div",className:"stigg-price-tier-select",style:{minHeight:"46px"}},n?a.createElement(tt,{value:i?i.upTo.toString():n[0].upTo.toString(),fullWidth:!0,onChange:function(e,t){n&&o(qe(n,e.target.value))},id:t,input:a.createElement(nt,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(we,{variant:"body1",color:"primary",style:{lineHeight:"unset"}},e.upTo," ",r))}))):a.createElement("div",null))}var it=o(we,{target:"e1gsqbi12"})({name:"bfvx8c",styles:"word-break:break-word;width:100%"}),at=o(we,{target:"e1gsqbi11"})({name:"1bmnxg7",styles:"white-space:nowrap"}),ot=o(we,{target:"e1gsqbi10"})({name:"nurf5y",styles:"white-space:normal;min-height:39px"});function lt(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(we,{span:!0,className:"stigg-price-billing-period-text",variant:"h6",color:"secondary"},o)}var ct=function(e){var t=e.showStartingAt,n=e.withUnitPriceRow,r=e.withStartingAtRow,i=e.withTiersRow,o=e.selectedTierByFeature,l=e.setSelectedTierByFeature,c=e.plan,u=e.billingPeriod,s=e.paywallLocale,d=e.hasMonthlyPrice,m=e.hasAnnuallyPrice,p=et(c,u,s,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===u&&e.isTieredPrice})),b=v?v.feature.featureId:void 0,x=b?o[b]:void 0;return a.createElement(it,{as:"div",className:"stigg-price-text"},a.createElement(a.Fragment,null,r&&a.createElement(we,{style:{minHeight:"20px"},className:"stigg-starting-at-text",variant:"body1",color:"secondary"},t?s.price.startingAtCaption:""),a.createElement(ot,{className:"stigg-price-point",variant:"h1"},g),n&&a.createElement(we,{as:"div",className:"stigg-price-unit-and-billing-period-text",style:{minHeight:"48px"}},a.createElement(at,{className:"stigg-price-unit-text",span:!0,variant:"h6",color:"secondary"},h),a.createElement(lt,{plan:c,billingPeriod:u,hasAnnuallyPrice:m,hasMonthlyPrice:d,paywallLocale:s})),i?a.createElement(rt,{componentId:c.id+"_"+b+"_tier",tiers:f,tierUnits:y,selectedTier:x,handleTierChange:function(e){b&&l((function(t){var n;return se({},t,((n={})[b]=e,n))}))}}):null))},ut=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(we,{target:"eacdu8d7"})({name:"mpkj0c",styles:"padding-bottom:8px"}),dt=o("div",{target:"eacdu8d6"})("height:2px;width:100%;background-color:",(function(e){return e.theme.stigg.palette.outlinedBorder}),";margin-bottom:40px;"),mt=o(we,{target:"eacdu8d5"})("text-align:",(function(e){return e.theme.stigg.layout.descriptionAlignment}),";min-height:",(function(e){return e.theme.stigg.layout.descriptionMinHeight}),";"),pt=o("div",{target:"eacdu8d4"})("background-color:",(function(e){return e.theme.stigg.palette.primary}),";border-radius:40px;position:absolute;top:-12px;"),gt=o(we,{target:"eacdu8d3"})({name:"a8c38r",styles:"margin:0;padding:2px 8px"}),ht=o("div",{target:"eacdu8d2"})("width:100%;display:flex;flex-direction:column;align-items:",(function(e){return Ie(e.theme.stigg.layout.headerAlignment)}),";"),ft=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;"),yt=o(Xe,{target:"eacdu8d0"})("display:flex;height:100%;margin-right:4px;path{fill:",(function(e){return e.theme.stigg.palette.text.primary}),";}");function vt(e){var t=e.text,n=void 0===t?"Next":t;return a.createElement(ft,null,a.createElement(c,{display:"flex",alignItems:"center",gap:1},a.createElement(yt,{$iconsColor:e.iconsColor}),a.createElement(we,{color:"primary",variant:"body1"},n)))}function bt(e){var t,r=e.withUnitPriceRow,o=e.withTiersRow,c=e.withTrialLeftRow,u=e.customer,s=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,k=e.isCustomerInCustomPlan,w=e.selectDefaultTierIndex,P=s.isNextPlan&&s.isNextPlan(d),C=s.pricePoints.filter((function(e){return e.billingPeriod===d})),S=null==(t=s.paywallCalculatedPricePoints)?void 0:t.find((function(e){return e.billingPeriod===d})),T=C.length>1&&!(null==S||!S.additionalChargesMayApply),B=!k||s.pricingType===n.PricingType.Custom,M=null;P?M=a.createElement(vt,{text:"Next plan"}):m&&b.highlightChip&&(M=a.createElement(pt,{className:"stigg-highlight-badge"},a.createElement(gt,{className:"stigg-highlight-badge-text",color:"white",bold:!0},b.highlightChip)));var A=a.useState(We(s,d,p,{},w)),U=A[0],L=A[1];return i.useEffect((function(){L(We(s,d,p,U))}),[d,p,s]),a.createElement(ut,{className:l("stigg-"+s.id,"stigg-plan-offering-container",{"stigg-current-plan":s.isCurrentCustomerPlan}),$isHighlighted:m,$isCurrentPlan:s.isCurrentCustomerPlan},M,a.createElement(ht,{className:"stigg-header-wrapper"},a.createElement(st,{className:"stigg-plan-header",variant:"h3"},s.displayName),g&&a.createElement(mt,{className:"stigg-plan-description",variant:"h6",color:"secondary"},s.description),a.createElement(ct,{showStartingAt:T,withUnitPriceRow:r,withStartingAtRow:E,withTiersRow:o,selectedTierByFeature:U,setSelectedTierByFeature:L,plan:s,billingPeriod:d,paywallLocale:b,locale:x,hasAnnuallyPrice:f,hasMonthlyPrice:h}),B?a.createElement(Qe,{isNextPlan:P,customer:u,plan:s,currentSubscription:p,billingPeriod:d,isCustomerOnTrial:y,onPlanSelected:function(e){var t=Object.keys(U).map((function(e){return{featureId:e,quantity:U[e].upTo}}));return v(e,t)},paywallLocale:b,withTrialLeftRow:c,selectedTierByFeature:U}):a.createElement("div",{style:{height:"66px"}}),a.createElement(dt,{className:"stigg-plan-header-divider"})),a.createElement(Le,{plan:s,billingPeriod:d,paywallLocale:b}))}var xt,Et=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;"),kt=o(we,{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 Pt(e){return a.createElement(we,{variant:"h6",color:e.disabled?"disabled":"primary",className:"stigg-discount-rate-text"},e.discount,"% off")}function Ct(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(Et,{className:"stigg-period-picker-container"},a.createElement(kt,{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(kt,{variant:"h6",className:"stigg-annual-period-text",color:i?"disabled":"primary"},"Annual"),0!==t&&a.createElement(Pt,{discount:t,disabled:i}))}function St(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 Tt(){return(Tt=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 Bt=o((function(e){return i.createElement("svg",Tt({width:135,height:16,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),xt||(xt=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}),";}"),Mt=o("div",{target:"ee5i8qp0"})("align-self:",(function(e){return e.$alignSelf||"unset"}),";@media (max-width: 1040px){align-self:center;}");function At(e){var t=e.source,n=e.style;return e.showWatermark?a.createElement(Mt,{$alignSelf:e.align,className:"stigg-watermark",style:se({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(Bt,null)):null}function Ut(e,t){return e.pricePoints.some((function(e){return e.billingPeriod===t}))}function Lt(e,t){return e.some((function(e){return Ut(e,t)}))}var Ft,Nt=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}),";"),It=o("div",{target:"e19kubi81"})({name:"1rdsyw8",styles:"display:flex;flex-direction:column;align-items:center;& *{box-sizing:border-box;}"}),Dt=o("div",{target:"e19kubi80"})({name:"zigog8",styles:"display:flex;flex-direction:column;align-items:center"}),Ot=function(e){var t=e.plans,r=e.customer,o=e.currentSubscription,l=e.highlightedPlanId,c=e.selectedBillingPeriod,u=e.onBillingPeriodChanged,s=e.availableBillingPeriods,d=e.isCustomerOnTrial,m=e.onPlanSelected,p=e.paywallLocale,g=e.locale,h=e.shouldHidePlan,y=e.selectDefaultTierIndex,v=Wt().stigg,b=function(e){return e.reduce((function(e,t){var r,i,a=St(t,n.BillingPeriod.Monthly),o=(i=St(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),x=t.some((function(e){return!!e.description})),E=Lt(t,n.BillingPeriod.Monthly),k=Lt(t,n.BillingPeriod.Annually),w=function(e,t,r){return e.filter((function(e){return e.pricingType!==n.PricingType.Paid||Ut(e,t)})).filter((function(e){return!r||!r({plan:e})}))}(t,c,h),P=i.useCallback((function(e,t,n){return m({plan:e,customer:r,subscription:o,intentionType:t,selectedBillingPeriod:c,billableFeatures:n})}),[r,c,o,m]),C=!!o&&o.plan.pricingType===n.PricingType.Custom,S=i.useMemo((function(){return w.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,w]),T=i.useMemo((function(){return w.some((function(e){return!!et(e,c,p,g,E).unit}))}),[c,E,g,p,w]),B=i.useMemo((function(){return!C&&w.some((function(e){var t=We(e,c,o,{});return Object.values(t).length>0}))}),[c,o,C,w]),M=w.some((function(e){return e.isCurrentCustomerPlan&&e.trialDaysLeft}));return a.createElement(It,{className:"stigg-paywall-container"},a.createElement(Dt,{className:"stigg-paywall-layout"},a.createElement(Ct,{onBillingPeriodChanged:u,selectedBillingPeriod:c,availableBillingPeriods:s,discountRate:b}),a.createElement(Nt,{className:"stigg-paywall-plans-layout"},w.map((function(e){return a.createElement(bt,{withUnitPriceRow:T,withTiersRow:B,withTrialLeftRow:M,key:e.id,shouldShowDescriptionSection:x,hasMonthlyPrice:E,hasAnnuallyPrice:k,plan:e,withStartingAtRow:S,currentSubscription:o,billingPeriod:c,isHighlighted:e.id===l,isCustomerOnTrial:d,onPlanSelected:function(t,n){return P(e,t,n)},paywallLocale:p,locale:g,customer:r,isCustomerInCustomPlan:C,selectDefaultTierIndex:y})}))),a.createElement(At,{source:"paywall",align:"end",style:{marginTop:16},showWatermark:v.isWidgetWatermarkEnabled})))},jt=(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 w(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===s)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=u(e,t,n);if("normal"===c.type){if(r=n.done?"completed":"suspendedYield",c.arg===s)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 u(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var s={};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=u(e[i],e,a);if("throw"!==c.type){var s=c.arg,d=s.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){s.value=e,o(s)}),(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 s;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return s}var r=u(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,s;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,s):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,s)}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 k(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function w(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,w.prototype={constructor:w,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(k),!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,s):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),s},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),k(n),s}},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;k(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),s}},e}(e.exports);try{regeneratorRuntime=t}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}}(Ft={exports:{}}),Ft.exports),qt=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}()),Rt=a.createContext(null);Rt.displayName="StiggContext";var Wt=function(){var e=i.useContext(Rt);if(!e)throw new Error("Could not find Stigg context; You need to wrap your app in an <StiggProvider> component.");return e};function zt(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 _t={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 Ht(e,t){if(void 0===t&&(t="px"),e)return""+e+t}function Vt(e,t){if(!t)return e;switch(t){case n.FontWeight.Normal:return"normal";case n.FontWeight.Bold:return"bold";default:return"normal"}}function $t(e,t){var n,r,i,a,o,l,c,u,s,d,m,p,g,h,f;return{fontFamilyUrl:(null==e?void 0:e.fontFamily)||void 0,h1:{fontSize:Ht((null==e||null==(n=e.h1)?void 0:n.fontSize)||(null==t||null==(r=t.h1)?void 0:r.fontSize)),fontWeight:Vt("bold",(null==e||null==(i=e.h1)?void 0:i.fontWeight)||(null==t||null==(a=t.h1)?void 0:a.fontWeight))},h2:{fontSize:Ht((null==e||null==(o=e.h2)?void 0:o.fontSize)||(null==t||null==(l=t.h2)?void 0:l.fontSize)),fontWeight:Vt("normal",null==t||null==(c=t.h2)?void 0:c.fontWeight)},h3:{fontSize:Ht((null==e||null==(u=e.h3)?void 0:u.fontSize)||(null==t||null==(s=t.h3)?void 0:s.fontSize)),fontWeight:Vt("normal",(null==e||null==(d=e.h3)?void 0:d.fontWeight)||(null==t||null==(m=t.h3)?void 0:m.fontWeight))},body:{fontSize:Ht((null==e||null==(p=e.body)?void 0:p.fontSize)||(null==t||null==(g=t.body)?void 0:g.fontSize)),fontWeight:Vt("normal",(null==e||null==(h=e.body)?void 0:h.fontWeight)||(null==t||null==(f=t.body)?void 0:f.fontWeight))}}}function Zt(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 Gt,Yt=o("div",{target:"e1f7khji6"})({name:"zigog8",styles:"display:flex;flex-direction:column;align-items:center"}),Qt=o(fe,{target:"e1f7khji5"})({name:"o7nnmj",styles:"margin-right:16px"}),Kt=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}),";"),Xt=o("div",{target:"e1f7khji3"})("display:flex;gap:",(function(e){return e.theme.stigg.layout.planMargin}),";flex-wrap:wrap;justify-content:center;"),Jt=o("div",{target:"e1f7khji2"})({name:"k8xojc",styles:"display:flex;align-items:center;margin-bottom:12px"}),en=o("div",{target:"e1f7khji1"})({name:"xdvdnl",styles:"margin-top:auto"}),tn=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 nn(){return a.createElement(Kt,null,a.createElement(w,{width:120,borderRadius:4}),a.createElement(w,{circle:!0,width:40,height:40}),a.createElement(w,{style:{marginBottom:33},width:120,borderRadius:4}),a.createElement(Jt,null,a.createElement(Qt,null),a.createElement(w,{width:120,borderRadius:4})),a.createElement(Jt,null,a.createElement(Qt,null),a.createElement(w,{width:120,borderRadius:4})),a.createElement(Jt,null,a.createElement(Qt,null),a.createElement(w,{width:120,borderRadius:4})),a.createElement(en,null,a.createElement(w,{height:50,borderRadius:4})))}function rn(){return a.createElement(Yt,{className:"stigg-skeleton-loader-container"},a.createElement(tn,{className:"stigg-skeleton-loader-billing-period"},a.createElement(w,{borderRadius:4})),a.createElement(Xt,{className:"stigg-skeleton-loader-plans-container"},a.createElement(nn,null),a.createElement(nn,null),a.createElement(nn,null)))}var an,on=function(e){var t=e.externalFontUrl;return a.createElement(s.Global,{styles:s.css(Gt||(Gt=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 ")})},ln=o("div",{target:"emcdfp60"})((function(e){var t=e.customCss;return t&&s.css(an||(an=me(["\n ","\n "])),t)}),";");function cn(e){var t,n,r,i,a,o,l,c,u,s=Wt(),m=d.merge(e,s.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"),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:""},g(u,t)}function un(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=cn(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(s.ThemeProvider,{theme:{stigg:r}},a.createElement(ln,{customCss:r.customCss},a.createElement(on,{externalFontUrl:r.typography.fontFamilyUrl}),a.createElement(C.ThemeProvider,{theme:{typography:un(r)}},n))))},dn=a.createContext(null);dn.displayName="CustomerPortalContext";var mn=function(){var e=i.useContext(dn);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 pn(e){var t,n,r,o,l,c,u,s=e.children,d=e.textOverrides,m=e.theme,p=e.resourceId,h=e.productId,f=Wt().customerPortalUpdatedAt,y=function(e){var t=e.resourceId,n=e.productId,r=Wt(),a=r.stigg,o=r.customerPortalUpdatedAt,l=i.useState(!1),c=l[0],u=l[1],s=i.useState(),d=s[0],m=s[1];return i.useEffect((function(){!function(){var e=ue(jt.mark((function e(){return jt.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!a.isCustomerLoaded){e.next=15;break}return e.prev=1,u(!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),qt.error("Failed to load customer portal "+(null==e.t0?void 0:e.t0.message),e.t0);case 12:return e.prev=12,u(!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,n]),{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:$t(e.typography)}}(v.configuration):void 0,E=(t=cn(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==(u=r.palette)?void 0:u.iconsColor)||void 0,iconsBackgroundColor:null==n?void 0:n.iconsBackgroundColor}),k=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(dn.Provider,{key:null==f?void 0:f.toString(),value:{customerPortal:v,isLoading:b,textOverrides:k,theme:E,resourceId:p}},s))}var gn,hn=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 fn(){return(fn=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 yn=function(e){return i.createElement("svg",fn({width:20,height:20,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),gn||(gn=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"})))},vn=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 bn(e){var t=e.title,n=e.className,r=e.isLoading,i=mn().theme;return r?a.createElement(w,{width:120}):a.createElement(we,{className:n,overrideColor:i.sectionTitleColor,variant:"h3",bold:!0},t)}var xn=o(yn,{target:"e1fjw26b0"})("path{stroke:",(function(e){return e.theme.stigg.palette.primary}),";}");function En(e){var t=e.onManageSubscription,n=e.hideManageButton,r=e.textOverrides;return a.createElement(vn,{className:"stigg-customer-portal-overview-header",$disableMargin:!0},a.createElement(bn,{title:"Subscription",className:"stigg-overview-title"}),!n&&a.createElement(hn,{className:"stigg-manage-subscription-button",variant:"outlined",onClick:t},a.createElement(xn,{className:"stigg-manage-subscription-button-image"}),a.createElement(we,{className:"stigg-manage-subscription-button-text",color:"primary.main",style:{marginLeft:"8px"},variant:"body1"},null==r?void 0:r.manageSubscription)))}function kn(){var e=mn().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(we,{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-of-type{max-width:60%;}");function Pn(){var e=mn(),t=e.customerPortal,n=e.theme,r=null==t?void 0:t.promotionalEntitlements;return a.createElement("div",{style:{display:"flex",flexDirection:"column"}},a.createElement(we,{color:"secondary"},e.textOverrides.promotionsSubtitle),a.createElement("div",{style:{display:"flex",flexDirection:"column"}},a.createElement(wn,{$borderColor:n.borderColor},a.createElement(we,{variant:"body1",bold:!0},"Feature"),a.createElement(we,{variant:"body1",bold:!0},"Expiration date")),null==r?void 0:r.map((function(e,t){return a.createElement(wn,{key:e.displayName+"-"+t,$borderColor:n.borderColor},a.createElement(we,{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(we,{variant:"body1",color:"disabled"},e.endDate?h.utc(e.endDate).format("MMM Do, YYYY"):"None"))}))))}var Cn,Sn,Tn,Bn,Mn,An,Un,Ln,Fn,Nn,In,Dn,On,jn,qn,Rn,Wn=o(N,{target:"exlfw3j3"})({name:"jlwfj4",styles:".MuiTabs-indicator{background-color:#001e6c;}"}),zn=o("div",{target:"exlfw3j2"})({name:"1dqkbz0",styles:"width:100%;flex:1;margin-top:16px"}),_n=o(U,{shouldForwardProp:function(e){return!e.startsWith("$")},target:"exlfw3j1"})("margin-top:16px;max-height:",(function(e){return e.$maxHeight}),";overflow-y:auto;"),Hn=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 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)}function Kn(){return(Kn=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 Xn,Jn,er,tr,nr,rr,ir,ar,or,lr,cr,ur,sr,dr,mr,pr,gr,hr,fr,yr,vr,br,xr,Er,kr=function(e){return i.createElement("svg",Kn({width:20,height:20,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),Rn||(Rn=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 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)}function Ir(){return(Ir=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 Dr,Or,jr,qr={__proto__:null,Addons:function(e){return i.createElement("svg",Vn({width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),Cn||(Cn=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"}))),Sn||(Sn=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",$n({width:36,height:36,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),Tn||(Tn=i.createElement("rect",{width:36,height:36,rx:10,fill:"#F5F6F9"})),Bn||(Bn=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"})),Mn||(Mn=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",Zn({width:36,height:36,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),An||(An=i.createElement("rect",{width:36,height:36,rx:10,fill:"#F5F6F9"})),Un||(Un=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"})),Ln||(Ln=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"})),Fn||(Fn=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",Gn({width:36,height:36,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),Nn||(Nn=i.createElement("rect",{width:36,height:36,rx:10,fill:"#F5F6F9"})),In||(In=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",Yn({width:21,height:20,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),Dn||(Dn=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"}))),On||(On=i.createElement("defs",null,i.createElement("clipPath",{id:"dollar-coin_svg__a"},i.createElement("path",{fill:"#fff",transform:"translate(.333)",d:"M0 0h20v20H0z"})))))},MiniSchedule:Xe,Promotions:function(e){return i.createElement("svg",Qn({width:24,height:25,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),jn||(jn=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"}))),qn||(qn=i.createElement("defs",null,i.createElement("clipPath",{id:"promotions_svg__a"},i.createElement("path",{fill:"#fff",transform:"translate(0 .182)",d:"M0 0h24v24H0z"})))))},Restore:kr,ScheduleBox:function(e){return i.createElement("svg",wr({width:36,height:36,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),Xn||(Xn=i.createElement("rect",{width:36,height:36,rx:10,fill:"url(#schedule-box_svg__a)"})),Jn||(Jn=i.createElement("rect",{width:36,height:36,rx:10,fill:"#F5F6F9"})),er||(er=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"})),tr||(tr=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",Pr({width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),nr||(nr=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",Cr({width:36,height:36,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),rr||(rr=i.createElement("rect",{width:36,height:36,rx:10,fill:"#F5F6F9"})),ir||(ir=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"})),ar||(ar=i.createElement("path",{d:"M22 8v4M14 8v4M9 16h18",stroke:"#7586B0",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})))},Trash:function(e){return i.createElement("svg",Sr({width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),or||(or=i.createElement("path",{d:"M3 6h18",stroke:"#F88078",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),lr||(lr=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"})),cr||(cr=i.createElement("path",{d:"M10 11v6M14 11v6",stroke:"#F88078",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})))},PaymentMethod:function(e){return i.createElement("svg",Tr({width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),ur||(ur=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",Br({width:21,height:20,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),dr||(dr=i.createElement("circle",{cx:10.333,cy:10,r:9,fill:"#fff",stroke:"#327EEE",strokeWidth:2})))},OutlinedCheckedCircle:function(e){return i.createElement("svg",Mr({width:20,height:20,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),mr||(mr=i.createElement("circle",{cx:10,cy:10,r:9.25,fill:"#327EEE",stroke:"#327EEE",strokeWidth:1.5})),pr||(pr=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",Ar({width:21,height:20,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),gr||(gr=i.createElement("circle",{cx:10.667,cy:10,r:9.25,fill:"#B3BCD3",stroke:"#B3BCD3",strokeWidth:1.5})),hr||(hr=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",Ur({width:18,height:18,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),fr||(fr=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",Lr({width:20,height:20,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),yr||(yr=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",Fr({width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),vr||(vr=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",Nr({width:16,height:16,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),br||(br=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"}))),xr||(xr=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",Ir({width:16,height:16,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),Er||(Er=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"}))))}},Rr=o("div",{target:"e1ds7xyn0"})((function(e){var t=e.$pathColor;return t&&s.css(Dr||(Dr=me(["\n path {\n fill: ",";\n }\n "])),t)})," ",(function(e){var t=e.$rectColor;return t&&s.css(Or||(Or=me(["\n svg rect {\n fill: ",";\n }\n "])),t)})," ",(function(e){var t=e.$strokeColor;return t&&s.css(jr||(jr=me(["\n g {\n stroke: ",";\n }\n "])),t)}),";");function Wr(e){var t=e.className,n=e.style,r=e.svgPathColor,i=e.svgRectColor,o=e.svgStrokeColor,l=qr[e.icon],c=s.useTheme();return a.createElement(Rr,{className:t,style:n,$pathColor:Hn(r,c),$rectColor:Hn(i,c),$strokeColor:Hn(o,c)},a.createElement(l,null))}var zr=["children","value","index","maxHeight"];function _r(e){var t=e.children,n=e.value,r=e.index,i=e.maxHeight,o=de(e,zr);return a.createElement("div",Object.assign({role:"tabpanel",hidden:n!==r},o),n===r&&a.createElement(_n,{$maxHeight:i},t))}function Hr(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(Wr,{icon:e.icon,svgStrokeColor:r}),a.createElement(we,{variant:"h6",bold:t,fontWeight:u.FontWeight.Medium,color:r},n))}function Vr(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"),u=t.promotionalEntitlements.length>0&&!l("promotionalEntitlements"),s=i.useState(c?1:2),d=s[0],m=s[1];return c||u?a.createElement(zn,null,a.createElement(U,{sx:{borderBottom:1,borderColor:"divider"}},a.createElement(Wn,{value:d,onChange:function(e,t){m(t)}},c?a.createElement(L,{sx:{textTransform:"none"},value:1,label:a.createElement(Hr,{isSelected:1===d,label:r.addonsTabTitle,icon:"Addons"})}):null,u?a.createElement(L,{sx:{textTransform:"none"},value:2,label:a.createElement(Hr,{isSelected:2===d,label:r.promotionsTabTitle,icon:"Promotions"})}):null)),a.createElement(_r,{value:d,index:1,maxHeight:o.tabMaxHeight},a.createElement(kn,null)),a.createElement(_r,{value:d,index:2,maxHeight:o.tabMaxHeight},a.createElement(Pn,null))):null}var $r=o("div",{target:"ejq3grd1"})({name:"1eoy87d",styles:"display:flex;justify-content:space-between"}),Zr=o("div",{target:"ejq3grd0"})({name:"43cxha",styles:"display:flex;flex-direction:column;gap:32px"});function Gr(){return a.createElement($r,{className:"stigg-subscription-overview-skeleton-layout"},a.createElement(Zr,null,a.createElement(w,{width:120}),a.createElement(w,{width:120})),a.createElement(w,{width:295,height:193}))}function Yr(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(we,{className:"stigg-scheduled-updates-description",variant:"body1"},"Downgrade to the ",a.createElement("b",null,null==t?void 0:t.displayName)," plan")))}function Qr(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(we,{className:"stigg-scheduled-updates-description",variant:"body1"},"Change from an ",r," to a ",a.createElement("b",null,i)," billing cycle")))}function Kr(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(we,{className:"stigg-scheduled-updates-description",variant:"body1"},"Reduce the ",a.createElement("b",null,o)," quantity to ",n," ",l)))}function Xr(e){var t=e.scheduleUpdate,r=e.subscription;switch(t.subscriptionScheduleType){case n.SubscriptionScheduleType.Downgrade:return a.createElement(Yr,{scheduleUpdate:t});case n.SubscriptionScheduleType.BillingPeriod:return a.createElement(Qr,{scheduleUpdate:t});case n.SubscriptionScheduleType.UnitAmount:return a.createElement(Kr,{scheduleUpdate:t,subscription:r});default:return null}}var Jr=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;"),ei=o(m,{target:"eju957a1"})({name:"158icaa",styles:"margin-left:4px"}),ti=o(kr,{target:"eju957a0"})("color:",(function(e){return e.theme.stigg.palette.primary}),";path{fill:",(function(e){return e.theme.stigg.palette.primary}),";}");function ni(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(we,{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(Xr,{key:e.subscriptionScheduleType,scheduleUpdate:e,subscription:t})}))))}function ri(e){var t=e.subscription,n=Oe({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(we,{className:"stigg-scheduled-updates-title",variant:"body1",color:"primary"},n.line1))),r&&a.createElement(c,null,a.createElement(we,{className:"stigg-scheduled-updates-subtitle",variant:"body1",color:"secondary"},r)))}function ii(e){var t=e.subscription,n=e.onCancelScheduledUpdates,r=e.theme,o=e.cancelScheduledUpdatesButtonTitle,l=s.useTheme(),u=i.useState(!1),d=u[0],m=u[1],p=t.scheduledUpdates;if(!p||0===p.length)return null;var g=1===p.length;return a.createElement(Jr,{$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(Wr,{icon:"ScheduleBox",svgPathColor:r.iconsColor,svgRectColor:r.iconsBackgroundColor})),a.createElement(c,{item:!0,flex:1},a.createElement(g?ri:ni,{subscription:t})),!!n&&a.createElement(c,{item:!0},a.createElement(hn,{variant:"outlined",onClick:function(){m(!0),Promise.resolve(n(t)).finally((function(){return m(!1)}))}},d?a.createElement(ei,{loading:!0,size:16,color:l.stigg.palette.text.disabled}):a.createElement(ti,{style:{display:"flex",marginRight:4},className:"stigg-scheduled-updates-cancel-update-button-icon"}),a.createElement(we,{variant:"body1",color:"primary.main",className:"stigg-scheduled-updates-cancel-update-button"},o)))))}var ai=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 oi(e){var t=e.billingPeriod,r=e.rangeEnd,i=e.amount,o=e.currency;return a.createElement(a.Fragment,null,a.createElement(we,{variant:"h6"},"Next estimated bill"),a.createElement(we,{variant:"h1"},Je({amount:i,currency:o,maximumFractionDigits:2})),a.createElement(we,{as:"div",variant:"body1",color:"secondary"},"Billed ",t===n.BillingPeriod.Monthly?"monthly":"annually"," on"," ",a.createElement(we,{variant:"body1",span:!0,color:"primary"},h.utc(r).format("MMM Do, YYYY"))),a.createElement(we,{variant:"body1",color:"secondary"},"* Additional tax rates may apply"))}function li(e){var t=e.description;return a.createElement(a.Fragment,null,a.createElement(we,{variant:"h6",color:"secondary"},"No upcoming bill"),a.createElement(we,{variant:"body1",color:"secondary"},t))}var ci=o("div",{target:"e1ftdtst1"})({name:"1nocm2b",styles:"display:flex;flex-direction:column;align-items:left;gap:8px"}),ui=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(we,{color:t?"primary.main":"secondary"},e.linkLabel);return a.createElement(ci,{className:"stigg-contact-support-layout"},a.createElement(we,{className:"stigg-contact-support-label",color:"secondary"},n),t?a.createElement(ui,{className:"stigg-contact-support-button",style:{textTransform:"none"},variant:"text",onClick:t},r):r)}var di,mi,pi=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 gi(e){var t,r,i,o,l=e.subscription,c=e.theme,u=e.textOverrides,s=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(li,{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(li,{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(li,{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(oi,{billingPeriod:v,rangeEnd:b,amount:x.amount,currency:x.currency}))}else d===n.PricingType.Custom&&(o=a.createElement(si,{onContactSupport:s,label:u.contactSupportTitle,linkLabel:u.contactSupportLink}));return a.createElement(pi,{className:"stigg-subscription-total-price-layout",$borderColor:c.borderColor},o)}function hi(){return(hi=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 fi,yi,vi,bi=function(e){return i.createElement("svg",hi({width:16,height:16,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),di||(di=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"})),mi||(mi=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"})))},xi=["children","className","placement"],Ei=o((function(e){var t=e.children,n=e.className,r=e.placement,i=void 0===r?"top":r,o=de(e,xi);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}),""),ki=S(we)(fi||(fi=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(yi||(yi=me(["\n word-break: break-word;\n "])))}),(function(e){return e.$bold&&C.css(vi||(vi=me(["\n font-weight: bold;\n "])))}));function wi(e){return e&&(e.clientHeight<e.scrollHeight||e.offsetWidth<e.scrollWidth)}var Pi=function(e){var t=e.leaveDelay,n=e.children,r=e.variant,o=e.color,l=e.maxLines,c=void 0===l?1:l,u=e.wordBreak,s=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),k=a.createElement(ki,{ref:E,variant:r,color:o,$maxLines:c,$wordBreak:u,$bold:s,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 w=(null==E?void 0:E.current)&&wi(E.current);return a.createElement("span",null,b||w?a.createElement(Ei,{placement:m,leaveDelay:t,title:a.createElement(we,{variant:"body1"},n)},k):k)},Ci=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;"),Si=o(D,{target:"el5iwyw0"})({name:"69ka7t",styles:"text-decoration-color:white;color:white;cursor:pointer"});function Ti(e){var t=e.subscription,r=e.includePlanName,i=e.onManageSubscription;return(null==t?void 0:t.status)!==n.SubscriptionStatus.InTrial?null:a.createElement(Ci,{className:"stigg-subscription-trial-badge"},a.createElement(bi,{className:"stigg-subscription-trial-badge-image"}),a.createElement("div",{style:{flex:1,marginRight:4}},a.createElement(Pi,{variant:"body1",className:"stigg-subscription-trial-badge-text",color:"white"},t.trialRemainingDays+" days remaining in trial",r&&" of the "+t.planName+" plan")),a.createElement(Si,{className:"stigg-subscription-trial-upgrade-button",onClick:i},a.createElement(we,{color:"white"},"Upgrade plan")))}function Bi(e){var t=e.mainSubscription,n=e.trialSubscription,r=e.onManageSubscription;return a.createElement("div",{className:"stigg-subscription-view-layout"},a.createElement(we,{className:"stigg-subscription-plan-name",variant:"h1",overrideColor:e.theme.planNameColor,style:{marginTop:8}},t.planName," plan"),a.createElement(Ti,{subscription:n,includePlanName:(null==n?void 0:n.planName)!==t.planName,onManageSubscription:r}))}function Mi(e,t){return Math.min(Math.floor(e/t*100),100)}var Ai,Ui=o(R,{shouldForwardProp:function(e){return!e.startsWith("$")},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}}),";}"),Li=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 Fi(e){var t=e.entitlement;if(t.hasUnlimitedUsage)return a.createElement(Li,null);var n,r=Mi(t.currentUsage||0,t.usageLimit),i=(n=r)<70?"standard":n<100?"warning":"error";return a.createElement(Ui,{$progressStatus:i,className:"stigg-feature-usage-progress-bar-"+i.toString(),variant:"determinate",value:r})}var Ni=S(M)(Ai||(Ai=me(["\n text-transform: none;\n padding: 0;\n white-space: nowrap;\n"])));function Ii(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||Mi(t.currentUsage||0,t.usageLimit)<70?null:o?i?a.createElement(Ni,{variant:"text",onClick:function(){return i(n,t)}},a.createElement(we,{color:"primary.main"},"Buy more")):null:l&&r?a.createElement(Ni,{variant:"text",onClick:r},a.createElement(we,{color:"primary.main"},"Upgrade")):null}function Di(e){var t,n,r,i=e.amount,o=e.currency,l=e.entitlement,c=e.feature,u=e.hideChargePrice,s=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(Pi,{variant:"body1",color:"primary"},c.displayName),!u&&a.createElement(Pi,{variant:"body1",color:"secondary"},Je({amount:i,currency:o})," per ",c.featureUnits)),a.createElement("div",{style:{display:"flex",gap:12}},a.createElement(Ii,{entitlement:l,feature:c,canBuyMore:!0,onBuyMore:s,onManageSubscription:d,canUpgradeSubscription:m,hasCustomSubscription:p}),a.createElement(we,{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(Fi,{entitlement:l}))}function Oi(e){var t=e.subscription,r=e.onBuyMore,i=e.onManageSubscription,o=e.hasCustomSubscription,l=e.canUpgradeSubscription,c=d.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,u=e.price;if(!t||!u)return null;var s=c[t.refId];return s&&s.feature?a.createElement(Di,{key:t.refId,entitlement:s,feature:s.feature,amount:u.amount,currency:u.currency,hideChargePrice:e.billingModel===n.BillingModel.PerUnit,onBuyMore:r,onManageSubscription:i,canUpgradeSubscription:l,hasCustomSubscription:o}):null}))):null}function ji(e){var t=e.onManageSubscription,r=e.onBuyMore,i=e.onCancelScheduledUpdates,o=e.onContactSupport,l=e.hiddenSections,c=e.cancelScheduledUpdatesButtonTitle,u=mn(),s=u.customerPortal,d=u.textOverrides,m=u.theme,p=u.isLoading||!s,g=s||{},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(ai,{className:"stigg-customer-portal-subscriptions-overview",$backgroundColor:m.backgroundColor,$borderColor:m.borderColor},!p&&v&&v.scheduledUpdates&&a.createElement(ii,{theme:m,subscription:v,onCancelScheduledUpdates:i,cancelScheduledUpdatesButtonTitle:c}),p||!E?a.createElement(Gr,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(En,{onManageSubscription:t,hideManageButton:x,textOverrides:d}),a.createElement(Bi,{mainSubscription:E,trialSubscription:b,theme:m,onManageSubscription:t}),v&&f&&a.createElement(Oi,{subscription:v,entitlements:f,onBuyMore:r,onManageSubscription:t,canUpgradeSubscription:!!y,hasCustomSubscription:x}),a.createElement(Vr,{customerPortal:s,hiddenSections:l,textOverrides:d,theme:m})),a.createElement("div",{style:{display:"flex",flexDirection:"column",width:319,gap:24}},a.createElement(gi,{subscription:E,theme:m,onContactSupport:o,textOverrides:d}))))}var qi=o("div",{target:"e2lw8x70"})({name:"7wpci2",styles:"display:flex;width:100%;align-items:flex-end;justify-content:flex-end;margin-bottom:24px"});function Ri(e){return a.createElement(qi,{className:"stigg-customer-portal-header-layout"},a.createElement(At,{source:"customer_portal",showWatermark:e.showWatermark}))}var Wi=o(we,{target:"eb0pe7a1"})({name:"kxbue8",styles:"text-transform:none"}),zi=o(I.ExternalLink,{target:"eb0pe7a0"})("color:",(function(e){return e.theme.stigg.palette.primary}),";");function _i(e){var t=e.text,n=e.url;return a.createElement(hn,{className:e.className,variant:"outlined",startIcon:a.createElement(zi,{size:20,strokeWidth:2.5}),onClick:function(){window.open(n,"_blank")}},a.createElement(Wi,{color:"primary.main"},t))}var 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(we,{variant:"h6",color:"secondary",fontWeight:u.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(we,Object.assign({className:t+"-label",variant:"body1",color:"secondary",style:{width:80}},e.labelTypographyProps),n),a.createElement(we,Object.assign({className:t+"-text",variant:"body1",color:"secondary"},i),r))})))}function Zi(){return a.createElement(w,{width:220,height:42})}function Gi(){var e=mn(),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,{key:"information-loading-data-top"},a.createElement(w,{width:220,height:12}),a.createElement(w,{width:220,height:12}),a.createElement(w,{width:220,height:12})),a.createElement(W,{key:"information-loading-data-divider",orientation:"vertical",style:{minHeight:93}}),a.createElement(Hi,{key:"information-loading-data-bottom"},a.createElement(w,{width:220,height:12}),a.createElement(w,{width:220,height:12}),a.createElement(w,{width:220,height:12}))]):(l.push(a.createElement($i,{key:"information-billing-data-billed-to",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,{key:"information-billing-data-divider",orientation:"vertical",style:{minHeight:93}})),l.unshift(a.createElement($i,{key:"information-billing-data-payment-method",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(Zi,null):null!=t&&t.billingPortalUrl?a.createElement(_i,{url:t.billingPortalUrl,text:n.editPaymentDetails,className:"stigg-edit-payment-details-button"}):null;return a.createElement(ai,{className:"stigg-payment-details-section-layout",$backgroundColor:r.backgroundColor,$borderColor:r.borderColor},a.createElement(vn,{className:"stigg-payment-details-section-header"},a.createElement(bn,{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(ai,{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;}"),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,$backgroundColor:r.backgroundColor,$borderColor:r.borderColor},a.createElement(vn,{className:"stigg-customer-portal-paywall-header"},a.createElement(bn,{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,u=e.onManageSubscription,s=e.onBuyMore,d=e.hasCustomSubscription,m=e.canUpgradeSubscription,p=mn().theme,g=!l.hasUnlimitedUsage&&l.currentUsage>l.usageLimit;return l.feature?a.createElement(ea,{$highlight:!!c,$borderColor:p.borderColor},a.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:16}},a.createElement(Pi,{variant:"body1"},l.feature&&Ji((o=l.feature).displayName,o.featureUnits,o.featureUnitsPlural)),c&&a.createElement(Ei,{title:a.createElement(we,{variant:"body1"},c.billingModel===n.BillingModel.PerUnit?"Billed for committed usage":"Billed for actual usage")},a.createElement(Wr,{icon:"DollarCoin",svgStrokeColor:p.iconsColor}))),a.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:8}},a.createElement(Pi,{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())+" ("+Mi(l.currentUsage||0,l.usageLimit)+"%)"),a.createElement(Ii,{entitlement:l,feature:l.feature,onBuyMore:s,canBuyMore:!!c,onManageSubscription:u,canUpgradeSubscription:m,hasCustomSubscription:d})),a.createElement(Fi,{entitlement:l}),l.hasUnlimitedUsage||z(l.usageLimit)||z(l.currentUsage)||!l.resetPeriod||!l.nextResetDate?null:a.createElement(we,{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(we,{color:"secondary"},"In current billing period")):null}var na=o("div",{target:"eoaojje0"})({name:"3hgi0y",styles:"margin-top:32px"});function ra(){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(w,{width:280,height:120}))})))}function ia(e){var t=e.onManageSubscription,r=e.onBuyMore,i=a.useState(!1),o=i[0],l=i[1],u=mn(),s=u.customerPortal,m=u.textOverrides,p=u.theme,g=u.isLoading||!s,h=s||{},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==s||!s.canUpgradeSubscription),k=d.keyBy(null==b?void 0:b.prices,"feature.refId"),w=d.keyBy(v,"feature.refId"),P=d.compact(null==b?void 0:b.prices.map((function(e){return e.feature&&w[e.feature.refId]}))),C=d.compact(null==v?void 0:v.filter((function(e){return!k[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(ai,{className:"stigg-subscription-usage-layout",$backgroundColor:p.backgroundColor,$borderColor:p.borderColor},a.createElement(vn,null,a.createElement(bn,{title:m.usageTabTitle,className:"stigg-customer-portal-usage-section-title",isLoading:g})),g?a.createElement(ra,null):a.createElement(a.Fragment,null,a.createElement(c,{container:!0,spacing:4},B.map((function(e){return a.createElement(c,{key:e.feature.refId,item:!0,xs:T},a.createElement(ta,{key:e.feature.refId,subscriptionPrice:k[e.feature.refId],entitlement:e,onManageSubscription:t,onBuyMore:r,hasCustomSubscription:x,canUpgradeSubscription:E}))}))),S.length>6&&a.createElement(na,null,a.createElement(hn,{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,n=e.onBuyMore,r=e.onCancelScheduledUpdates,o=e.onContactSupport,l=e.paywallComponent,c=e.hiddenSections,u=Wt().stigg,s=mn(),d=s.customerPortal,m=s.textOverrides,p=s.theme,g=s.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(Ki,{className:"stigg-customer-portal-layout"},a.createElement(Ri,{showWatermark:u.isWidgetWatermarkEnabled&&!!d}),a.createElement(Xi,{className:"stigg-customer-portal-sections"},a.createElement(ji,{onCancelScheduledUpdates:r,onBuyMore:n,onManageSubscription:f,onContactSupport:o,hiddenSections:c,cancelScheduledUpdatesButtonTitle:m.cancelScheduledUpdatesButtonTitle}),y&&a.createElement(ia,{onManageSubscription:f,onBuyMore:n}),a.createElement(Qi,{ref:h,paywallComponent:l,theme:p,title:m.paywallSectionTitle,isLoading:!d||g}),v&&a.createElement(Gi,null),b&&a.createElement(la,null)))}var oa=["textOverrides","theme","resourceId","productId"];function la(){var e=mn(),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(_i,{url:t.billingPortalUrl,text:n.viewInvoiceHistory,className:"stigg-view-invoice-history-button"}):null;return i||null!=t&&t.billingPortalUrl?a.createElement(ai,{className:"stigg-invoices-section-layout",$backgroundColor:r.backgroundColor,$borderColor:r.borderColor},a.createElement(vn,{className:"stigg-invoices-section-header"},a.createElement(bn,{isLoading:i,className:"stigg-invoices-section-title",title:n.invoicesTitle}),o)):null}var ca=function(e){return P(e,"addon.displayName")};function ua(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 se({},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 se({},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 ka(){var e=Na()[1];return function(t){return e((function(e){e.progressBar.completedSteps.push(t)}))}}function wa(){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:ka(),goNext:wa(),setIsDisabled:Pa()}}function Sa(){var e=Na()[0],t=e.paymentStep;return se({},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:se({},t?{billingAddress:t}:{},n?{taxPercentage:n}:{})}:{}}var Ba=function(){var e=ue(jt.mark((function e(t){var n,r,i,a,o,l,c,u,s,d,m,p,g,h,f,y,v,b;return jt.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,u=t.billingPeriod,s=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=se({customerId:r,planId:i,resourceId:a,billingCountryCode:c,addons:p,billingPeriod:u,promotionCode:o,billableFeatures:F(l)?void 0:l},Ta({billingAddress:s,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=Wt().stigg,r=Sa(),a=Na()[0].resourceId,o=pa(),l=o.widgetState,c=o.checkoutState||{},u=c.plan,s=c.customer;return{previewSubscriptionAction:i.useCallback(function(){var e=ue(jt.mark((function e(i){var o;return jt.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==s?void 0:s.id,planId:null==u?void 0:u.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==s?void 0:s.id,null==u?void 0:u.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 se({},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]),u=i.useMemo((function(){return[o,c]}),[c,o]);return a.createElement(Fa.Provider,{value:[u[0],u[1]]},t)};function Da(e){var t,r=e.children,o=e.textOverrides,l=e.theme,c=e.preferredBillingPeriod,u=e.billableFeatures,s=e.billingCountryCode,d=e.billingInformation,m=function(e){var t=e.planId,n=e.resourceId,r=e.billingCountryCode,a=e.onMockCheckoutState,o=Wt().stigg,l=i.useState(!0),c=l[0],u=l[1],s=i.useState(),d=s[0],m=s[1];return i.useEffect((function(){var e=function(){var e=ue(jt.mark((function e(){return jt.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),qt.error("Failed to load checkout "+(null==e.t0?void 0:e.t0.message),e.t0);case 10:return e.prev=10,u(!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 u(!1),void m(a({planId:t,resourceId:n,billingCountryCode:r}));o.isCustomerLoaded&&(u(!0),e())}),[o,o.isCustomerLoaded,n,t,r,a]),{checkout:d,isLoading:c}}({resourceId:e.resourceId,planId:e.planId,billingCountryCode:s,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:$t(e.typography,_t)}}(p.configuration):{typography:$t(_t)},v=cn(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)",paymentInputBackgroundColor:null==t?void 0:t.paymentInputBackgroundColor,paymentInputBorderColor:null==t?void 0:t.paymentInputBorderColor,paymentInputBorderRadius:null==t?void 0:t.paymentInputBorderRadius}}(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":""+Je({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=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 u=fa(null==i?void 0:i.prices[0].billingPeriod,o,l);if(u)return u}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=qe(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:s,preconfiguredBillableFeatures:null!=u?u:[]}),b=function(e){var t,r,i=e.activeSubscription,a=e.plan,o=e.billingPeriod,l=e.billingCountryCode,c=[],u=(null==a||null==(t=a.pricePoints)||null==(r=t[0])?void 0:r.currency)||n.Currency.Usd,s=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 ua(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:u})),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 ua(e.addon,r)})))?void 0:t.map((function(e){return se({},e,{addon:sa({addon:e.addon,currency:a,billingCountryCode:i})})})))||[]}({addons:null==i?void 0:i.addons,billingPeriod:o,billingCountryCode:l,currency:u});return null!=d&&d.length&&null!=s&&s.length&&(c=ca(d.filter((function(e){return s.some((function(t){return t.id===e.addon.id}))})))),{addons:c,initialAddons:V(c),availableAddons:s}}({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)?se({},Ea,{steps:xa.filter((function(e){return e.key!==ga.ADDONS}))}):Ea}({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,s,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(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(Wr,{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(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;"),Va=o(Ha,{target:"e1v7qkry2"})({name:"o7lzx8",styles:"span{display:flex;flex:1;}"}),$a=o(c,{target:"e1v7qkry1"})("span{display:flex;flex:",(function(e){return e.flex}),";}"),Za=o(w,{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||{},u=l.activeStep,s=l.completedSteps,d=l.steps;return a.createElement(U,{sx:{width:"100%",mb:3}},a.createElement(Wa,{variant:"determinate",value:100*(u+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=s.includes(r),p=i||r>u&&!m&&!s.includes(r-1)||u!==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(Za,{width:120,height:20,style:{marginTop:8}}):a.createElement(za,{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(_a,{icon:m?g:"OutlinedCircle",$disabled:p,$shouldFill:m})}),a.createElement(we,{variant:"h6",color:p?"primary.main.light":"primary.main"},d))))}))))},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":se({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(c,{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(we,{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),u=l[0],s=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=Ma({onMockCheckoutPreview:r}).previewSubscriptionAction,E=function(){var e=ue(jt.mark((function e(){var t,n,r,i;return jt.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()),s(!1)):i&&b(i),f(!1);case 9:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return u?a.createElement(c,null,a.createElement(we,{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:m,onChange:function(e){p(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()}},h?a.createElement(J,{size:18,sx:{color:"white"}}):a.createElement(Wr,{style:{display:"flex"},icon:"ArrowForward"}))}}),!!v&&a.createElement(we,{variant:"body1",color:"error"},v)):a.createElement(oo,{disabled:t,onAddClick:function(){return s(!0)},checkoutLocalization:n})},uo=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(Wr,{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(uo,{container:!0},a.createElement(c,{item:!0,display:"flex",gap:1,alignItems:"center"},a.createElement(so,{icon:"Coupon"}),a.createElement(we,{variant:"body1",color:"primary.main",lineHeight:"auto"},t)),a.createElement(c,{item:!0},a.createElement(Ja,{variant:"text",sx:{minWidth:"unset",padding:0},onClick:n},a.createElement(so,{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,u=i.widgetState,s=i.setWidgetReadOnly,d=La().setBillingAddress,m=o||{},p=m.customer,g=m.configuration,h=u.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(we,{variant:"h6"},l.newPaymentMethodBillingAddressTitle),a.createElement(Q.AddressElement,{onChange:function(e){if(e.complete){var t=e.value.address,r=se({postalCode:t.postal_code},de(t,ho));s(!0),d(r),n?function(){var e=ue(jt.mark((function e(){return jt.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:f?"always":"auto"},defaultValues:se({},(null==p?void 0:p.name)&&{name:p.name})}})),a.createElement(c,{flexDirection:"column",container:!0,gap:2},a.createElement(we,{variant:"h6"},l.newPaymentMethodCardTitle),a.createElement(Q.PaymentElement,{onChange:function(){},onReady:function(){},options:{readOnly:h,terms:{card:"never"},defaultValues:{billingDetails:se({},(null==p?void 0:p.name)&&{name:p.name},(null==p?void 0:p.email)&&{email:p.email})}}})))}function yo(e){return vo.apply(this,arguments)}function vo(){return(vo=ue(jt.mark((function e(t){var n,r;return jt.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=ue(jt.mark((function e(t){var r,i,a,o,l,c,u;return jt.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(!(u=e.sent.error)){e.next=9;break}return e.abrupt("return",{errorMessage:u.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 Eo(e){return ko.apply(this,arguments)}function ko(){return(ko=ue(jt.mark((function e(t){var n,r,i,a,o,l,c;return jt.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 Po.apply(this,arguments)}function Po(){return(Po=ue(jt.mark((function e(t){var n,r,i,a,o,l,c;return jt.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,yo({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,Eo({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 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:"eeyi5d32"})("@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}),";}"),To=o(we,{target:"eeyi5d31"})({name:"1kkk1zv",styles:"@keyframes fadeIn{0%{opacity:0;}75%{opacity:0;}100%{opacity:1;}}align-self:center;animation:fadeIn 5s ease-in forwards"}),Bo=o(ie,{target:"eeyi5d30"})({name:"1p4tykk",styles:"display:flex;justify-content:center;svg{width:350px!important;height:auto!important;}"});function Mo(e){var t=e.checkoutLocalization;return a.createElement(So,{className:"stigg-checkout-success-container"},a.createElement(Bo,{animationData:Co,loop:!1,autoplay:!0}),a.createElement(To,{variant:"h1",color:"primary.main"},t.summary.checkoutSuccessText))}var Ao=function(e){return new Promise((function(t){return setTimeout(t,e)}))},Uo=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)},Lo=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 u=Je({amount:-1*c.proration.netAmount.amount,currency:c.proration.netAmount.currency,minimumFractionDigits:2});return a.createElement(we,{variant:"caption",style:{marginTop:14}},a.createElement(Uo,{isLoading:o,width:"100%"},l.summary.creditsForUnusedTimeText({credits:u})))},Fo=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(we,{variant:"caption",style:{marginTop:14}},a.createElement(Uo,{isLoading:r,width:"100%"},o))},No=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 u,s,d=t.hasScheduledUpdates?null==r?void 0:r.currentBillingPeriodEnd:null==t?void 0:t.billingPeriodRange.end,m=Je(se({},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:s="month",u="the "+h(d).format("Do");break;case n.BillingPeriod.Annually:s="year",u=h(d).format("MMMM Do")}return a.createElement(we,{variant:"body1",style:{marginTop:14}},a.createElement(Uo,{isLoading:o,width:"100%"},f+=y+"for this subscription every "+s+" on "+u+", unless you cancel."))};function Io(e){return a.createElement(a.Fragment,null,a.createElement(Lo,Object.assign({},e)),a.createElement(Fo,Object.assign({},e)),a.createElement(No,Object.assign({},e)))}var Do=o("div",{target:"e1ultpe61"})({name:"rdmn2i",styles:"&+&{margin-top:8px;}"}),Oo=o("div",{target:"e1ultpe60"})({name:"bcffy2",styles:"display:flex;align-items:center;justify-content:space-between"}),jo=function(e){var t=a.createElement(we,{variant:"body1"},e.checkoutLocalization.summary.payAsYouGoTooltipText);return a.createElement(Ei,{placement:"left",title:t},a.createElement(Wr,{icon:"PayAsYouGoCharge",style:{display:"flex"}}))},qo=function(e){var t,r=e.checkoutLocalization,i=e.label,o=e.quantity,l=e.price,u=l.billingPeriod,s=l.pricingModel===n.BillingModel.UsageBased;return t=l.isTieredPrice?qe(l.tiers,o).unitPrice.amount:l.amount,a.createElement(Do,null,a.createElement(Oo,{style:{alignItems:"flex-start"}},a.createElement(c,{item:!0},a.createElement(we,{variant:"body1",color:"secondary"},i),(o>1||u===n.BillingPeriod.Annually)&&a.createElement(we,{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=Je({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"},s&&a.createElement(jo,{checkoutLocalization:r}),a.createElement(we,{variant:"body1",color:"secondary",style:{wordBreak:"break-word"}},Je({amount:o*t,currency:l.currency,minimumFractionDigits:2}),s&&" / unit"))))},Ro=function(e){return a.createElement(Do,null,a.createElement(Oo,{style:{alignItems:"flex-end"}},a.createElement(c,{item:!0},a.createElement(we,{variant:"body1",color:"secondary"},e.label)),a.createElement(c,{item:!0,display:"flex",gap:1,alignItems:"center"},a.createElement(we,{variant:"body1",color:"secondary",style:{wordBreak:"break-word"}},"Free"))))},Wo=function(e){var t=e.subscriptionPreview,n=e.isFetchingSubscriptionPreview,r=t.recurringInvoice||{},i=r.discount,o=r.discountDetails;return i&&o?a.createElement(Do,null,a.createElement(Oo,null,a.createElement(we,{variant:"body1",color:"secondary"},e.checkoutLocalization.summary.discountText({discountDetails:o,currency:t.immediateInvoice.total.currency})),a.createElement(we,{variant:"body1",color:"secondary"},n?a.createElement(Za,{width:50,height:16}):Je({amount:i.amount,currency:i.currency,minimumFractionDigits:2})))):null},zo=function(e){var t=e.isFetchingSubscriptionPreview,n=((e.subscriptionPreview||{}).immediateInvoice||{}).credits;return!n||!n.used||n.used.amount<=0?null:a.createElement(Do,null,a.createElement(Oo,null,a.createElement(we,{variant:"body1",color:"secondary"},e.checkoutLocalization.summary.appliedCreditsTitle),a.createElement(we,{variant:"body1",color:"secondary"},a.createElement(Uo,{isLoading:t},Je({amount:-1*n.used.amount,currency:n.used.currency,minimumFractionDigits:2})))))},_o=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(Do,null,a.createElement(Oo,null,a.createElement(we,{variant:"body1",color:"secondary"},e.checkoutLocalization.summary.taxTitle({taxDetails:n})),a.createElement(we,{variant:"body1",color:"secondary"},a.createElement(Uo,{isLoading:r},Je({amount:null==t?void 0:t.amount,currency:null==t?void 0:t.currency,minimumFractionDigits:2})))))},Ho=o(U,{target:"e9ji7bp4"})({name:"kj9yp4",styles:"max-width:470px;flex:1.5"}),Vo=o(ee,{target:"e9ji7bp3"})("border-radius:10px;background:",(function(e){return e.theme.stigg.palette.backgroundHighlight}),";padding:16px;");Vo.defaultProps={elevation:0};var $o,Zo,Go,Yo,Qo=o(we,{target:"e9ji7bp2"})({name:"1jcocwa",styles:"margin-bottom:16px;font-weight:500"}),Ko=o(W,{target:"e9ji7bp1"})({name:"1k6141t",styles:"margin:16px 0"}),Xo=o(we,{target:"e9ji7bp0"})({name:"5bhc30",styles:"margin-bottom:8px"}),Jo=function(e){var t,r,o,l,u,s=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=La().setErrorMessage,x=Ca(),E=Sa(),k=pa(),w=k.checkoutLocalization,P=k.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=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],u=Ma({onMockCheckoutPreview:t}).previewSubscriptionAction;return i.useEffect((function(){var e=function(){var e=ue(jt.mark((function e(){var t;return jt.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,u();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)}}),[u]),{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=Wt().stigg,c=La().useNewPaymentMethod,u=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{resourceId:t,planId:n.id,billingPeriod:e.billingPeriod,billableFeatures:e.billableFeatures,addons:r,promotionCode:e.promotionCode,billingCountryCode:e.billingCountryCode}}(),s=pa(),d=s.widgetState,m=s.setWidgetReadOnly,p=s.checkoutState||{},g=p.setupSecret,h=p.customer,f=Q.useStripe(),y=Q.useElements();return{handleSubmit:function(){var e=ue(jt.mark((function e(t){var s,d,p,v,b,x,E,k,w,P,C;return jt.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.preventDefault(),u){e.next=3;break}return e.abrupt("return",{success:!1,errorMessage:"Unexpected error, please contact support."});case 3:if(s=!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,s=!1);case 11:if(x=se({},u,{paymentMethodId:v}),E=function(){var e=ue(jt.mark((function e(t){var n,r;return jt.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,bo({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)}}(),!s){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((w=e.sent).errorMessage&&(d=w.errorMessage),p||!w.results||!w.success){e.next=24;break}return e.next=22,bo({applySubscriptionResults:w.results,stripe:f});case 22:(P=e.sent).errorMessage&&(d=P.errorMessage,s=!1);case 24:s=s&&w.success&&!d,k=w.results,e.next=34;break;case 28:return e.next=30,E(x);case 30:!(C=e.sent).success&&C.errorMessage&&(d=C.errorMessage),s=C.success&&!d,k=C.results;case 34:if(m(!1),!s||!a){e.next=40;break}if(a(),o){e.next=40;break}return e.next=40,Ao(5e3);case 40:return e.next=42,i({success:s,error:d});case 42:return e.abrupt("return",{results:k,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:s,onCheckoutCompleted:d,onSuccess:function(){v(!0),x.markStepAsCompleted(x.progressBarState.activeStep)}}),D=I.handleSubmit,O=I.isLoading,j=function(){var e=ue(jt.mark((function e(t){var n;return jt.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=ue(jt.mark((function e(t){return jt.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 w.summary.baseChargeText?w.summary.baseChargeText({billingPeriod:E.billingPeriod}):w.summary.baseChargeText;return a.createElement(Ho,null,a.createElement(Vo,null,a.createElement(Qo,{variant:"h3"},w.summary.title),a.createElement(c,{display:"flex",flexDirection:"row",alignItems:"center",marginY:2},a.createElement(we,{variant:"h6",color:"primary",style:{paddingRight:"8px"}},w.summary.planName({plan:C})),a.createElement(Ko,{className:"stigg-checkout-summary-divider",sx:{flex:1,margin:"0 !important"}})),A&&a.createElement(qo,{checkoutLocalization:w,label:Y,quantity:1,price:A}),!A&&g?a.createElement(Ro,{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(qo,{checkoutLocalization:w,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(c,{display:"flex",flexDirection:"row",alignItems:"center",marginY:2},a.createElement(we,{variant:"h6",color:"primary",style:{paddingRight:"8px"}},w.summary.addonsSectionTitle),a.createElement(Ko,{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(qo,{checkoutLocalization:w,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(Ko,{className:"stigg-checkout-summary-divider"}),$&&a.createElement(c,{display:"flex",flexDirection:"row",alignItems:"center",marginY:2},a.createElement(we,{variant:"h6",color:"primary",style:{paddingRight:"8px"}},w.summary.discountsSectionTitle),a.createElement(Ko,{className:"stigg-checkout-summary-divider",sx:{flex:1,margin:"0 !important"}})),H&&a.createElement(go,{disabled:O||N,checkoutLocalization:w,onMockCheckoutPreview:h}),V&&a.createElement(Wo,{subscriptionPreview:F,isFetchingSubscriptionPreview:N,checkoutLocalization:w}),$&&a.createElement(Ko,{className:"stigg-checkout-summary-divider"}),a.createElement(_o,{tax:null==z?void 0:z.tax,taxDetails:null==z?void 0:z.taxDetails,isFetchingSubscriptionPreview:N,checkoutLocalization:w}),g?null:a.createElement(a.Fragment,null,a.createElement(Oo,{style:{marginTop:16}},a.createElement(c,{display:"flex",flexDirection:"column",container:!0},a.createElement(c,{item:!0,display:"flex",justifyContent:"space-between"},a.createElement(we,{variant:"h6"},w.summary.totalText),a.createElement(we,{variant:"h6"},a.createElement(Uo,{isLoading:N},G?w.summary.onlyPayAsYouGoText:null,!G&&Z?w.summary.startsAtText:null,G?null:Je(se({amount:0},null==z?void 0:z.total,{minimumFractionDigits:2}))))),a.createElement(c,{item:!0},a.createElement(we,{variant:"body1",color:"secondary"},w.summary.totalBillingPeriodText({billingPeriod:E.billingPeriod}))))),a.createElement(Ko,{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(Do,null,a.createElement(Oo,null,a.createElement(we,{variant:"body1",color:"secondary"},w.summary.proratedTotalDueText),a.createElement(we,{variant:"body1",color:"secondary"},a.createElement(Uo,{isLoading:N},Je({amount:(null==W||null==(l=W.subTotal)?void 0:l.amount)+((null==W||null==(u=W.tax)?void 0:u.amount)||0),currency:null==W?void 0:W.subTotal.currency,minimumFractionDigits:2}))))):null,a.createElement(zo,{subscriptionPreview:F,isFetchingSubscriptionPreview:N,checkoutLocalization:w}),a.createElement(Do,null,a.createElement(Oo,null,a.createElement(Xo,{variant:"h6"},w.summary.totalDueText),a.createElement(Xo,{variant:"h6"},a.createElement(Uo,{isLoading:N},Je(se({amount:0},null==W?void 0:W.total,{minimumFractionDigits:2})))))),a.createElement(Io,{plan:C,activeSubscription:S,subscriptionPreview:F,isFetchingSubscriptionPreview:N,checkoutLocalization:w,billingPeriod:E.billingPeriod}),a.createElement(Ja,{$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(we,{className:"stigg-checkout-summary-cta-button-text",variant:"h3",color:"white",style:{display:"flex"}},y?a.createElement(Wr,{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:w,isPlanUpdate:!!S&&(null==S?void 0:S.plan.id)===(null==C?void 0:C.id)})))),a.createElement(At,{source:"checkout",showWatermark:!0,style:{marginTop:8,display:"flex",justifyContent:"center"}}),!p&&y&&a.createElement(Mo,{checkoutLocalization:w}))},el=function(){return a.createElement(Ho,null,a.createElement(Vo,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(At,{source:"checkout",showWatermark:!0,style:{marginTop:8,display:"flex",justifyContent:"center"}}))},tl=o(c,{target:"e1o28dc92"})({name:"1wte80x",styles:"width:100%;gap:8px"}),nl=o(c,{target:"e1o28dc91"})({name:"a3p0fn",styles:"display:flex;justify-content:space-between;align-items:center;height:80px"}),rl=o(Ja,{target:"e1o28dc90"})({name:"156064h",styles:"min-width:unset;width:41px;height:41px;padding:0"});function il(e){var t,r=e.addon,i=e.billingPeriod,o=e.addonState,l=e.initialAddonState,u=e.setAddon,s=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 u(r,null!=e?e:null);m({addonId:r.id,isValid:!0}),u(r,e)};return a.createElement(nl,{container:!0},a.createElement(c,{item:!0},a.createElement(we,{variant:"h6",lineHeight:"24px"},r.displayName),!!g&&a.createElement(we,{variant:"body1",lineHeight:"20px",color:"secondary"},Je({amount:g.amount,currency:g.currency,minimumFractionDigits:2})+"/"+(i===n.BillingPeriod.Annually?"year":"month"))),a.createElement(c,{item:!0},f&&a.createElement(Ja,{variant:"text",size:"small",sx:{padding:"8px",minWidth:"unset"},onClick:function(){l?u(r,l.quantity):s(r.id),m({addonId:r.id,isValid:!0})}},a.createElement(we,{color:"primary.main",variant:"body1"},"Undo")),h&&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:!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(rl,{color:"error",onClick:function(){s(r.id),m({addonId:r.id,isValid:!0})}},a.createElement(Wr,{icon:"Trash",style:{display:"flex"}}))),!h&&a.createElement(Ja,{sx:{paddingX:"22px",paddingY:"8px"},onClick:function(){return y(1)}},a.createElement(we,{color:"primary.main",variant:"body1"},d.addAddonText))))}function al(){var e,t=pa(),n=t.checkoutLocalization,r=t.setIsValid,o=ba().billingPeriod,l=Ca().setIsDisabled,c=se({},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()}),u=c.initialAddons,s=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(tl,{container:!0},null==d?void 0:d.map((function(e){var t=s.find((function(t){return t.addon.id===e.id})),r=null==u?void 0:u.find((function(t){return t.addon.id===e.id}));return a.createElement(il,{key:e.id,addon:e,billingPeriod:o,addonState:t,initialAddonState:r,setAddon:m,removeAddon:p,checkoutLocalization:n,onAddonsValidationChange:function(e){var t;return f(se({},h,((t={})[e.addonId]=e.isValid,t)))},isValid:h[e.id]})})))}var ol,ll=te(c,{shouldForwardProp:function(e){return!e.startsWith("$")}})($o||($o=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})),cl=te(ll)(Zo||(Zo=me(["\n flex-direction: column;\n align-items: unset;\n"]))),ul=te(c)(Go||(Go=me(["\n display: flex;\n align-items: center;\n flex: 1;\n gap: 12px;\n"]))),sl=te(c)(Yo||(Yo=me(["\n display: flex;\n flex-direction: column;\n"])));function dl(e){var t=e.icon,n=e.text,r=e.subtitle;return a.createElement(ul,null,a.createElement(le,{checked:e.checked,disabled:e.readOnly}),a.createElement(Wr,{icon:t,style:{display:"flex"}}),a.createElement(sl,{container:!0},a.createElement(c,{item:!0},n),r&&a.createElement(c,{item:!0},r)))}function ml(e){var t=e.paymentMethodDetails,n=e.readOnly;if(!t)return null;var r=t.expirationMonth,i=t.expirationYear;return a.createElement(ll,{item:!0,onClick:e.onSelect,$disabled:n},a.createElement(dl,{checked:e.checked,readOnly:n,icon:"PaymentMethod",text:a.createElement(we,{variant:"h6"},"Card ending in "+t.last4Digits),subtitle:!!r&&!!i&&a.createElement(we,{variant:"body1"},"Expires "+r.toString().padStart(2,"0")+"/"+i)}))}function pl(e){var t=e.checked,n=e.readOnly,r=e.onBillingAddressChange,i=e.collectPhoneNumber;return a.createElement(cl,{item:!0,onClick:e.onSelect,$disabled:n},a.createElement(dl,{checked:t,readOnly:n,icon:"PaymentMethod",text:a.createElement(we,{variant:"h6"},e.checkoutLocalization.newPaymentMethodText)}),a.createElement(oe,{in:t},a.createElement(fo,{onBillingAddressChange:r,collectPhoneNumber:i})))}var gl=te(c)(ol||(ol=me(["\n display: flex;\n flex-direction: column;\n gap: 24px;\n"])));function hl(e){var t=e.onBillingAddressChange,n=e.collectPhoneNumber,r=pa(),i=r.checkoutLocalization,o=r.widgetState,l=(r.checkoutState||{}).customer,c=La(),u=c.errorMessage,s=c.useNewPaymentMethod,d=c.setUseNewPaymentMethod,m=o.readOnly,p=function(e){m||d(e)};return a.createElement(gl,{container:!0},!!u&&a.createElement(ae,{severity:"error",sx:{alignItems:"center"}},a.createElement(we,{overrideColor:"inherit"},u)),a.createElement(ml,{readOnly:m,checked:!s,paymentMethodDetails:null==l?void 0:l.paymentMethodDetails,onSelect:function(){return p(!1)}}),a.createElement(pl,{readOnly:m,checked:s,checkoutLocalization:i,onSelect:function(){return p(!0)},onBillingAddressChange:t,collectPhoneNumber:n}))}var fl=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(we,{className:"stigg-checkout-change-plan-button-text",color:"primary.main",variant:"h3",style:{lineHeight:"24px"}},e.checkoutLocalization.changePlan))};function yl(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(we,{variant:"body1",color:"disabled",style:{opacity:.6,marginBottom:"8px"}},"Selected plan"),a.createElement(U,{sx:{display:"flex",justifyContent:"space-between"}},a.createElement(we,{variant:"h1"},null==l?void 0:l.displayName),n&&r&&a.createElement(fl,{onClick:function(){r({currentPlan:l})},checkoutLocalization:o,size:"medium"}))),a.createElement(W,{className:"stigg-checkout-plan-header-divider"}))}function vl(e){switch(e){case n.BillingPeriod.Annually:return"Annual";case n.BillingPeriod.Monthly:return"Monthly";default:return""}}var bl,xl=o(U,{target:"ekae5v44"})({name:"1k6141t",styles:"margin:16px 0"}),El=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;}}"),kl=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(El,{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":vl(t)},sx:{padding:0,marginRight:"8px"}}),a.createElement(U,null,a.createElement(we,{variant:"h3",color:"primary"},vl(t))))};function Pl(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(xl,null,a.createElement(we,{variant:"h6",color:"primary",fontWeight:u.FontWeight.Medium},r.billingPeriodsTitle),a.createElement(kl,null,!(null==o||!o.length)&&a.createElement(wl,{key:n.BillingPeriod.Monthly,billingPeriod:n.BillingPeriod.Monthly,isOnlyBillingPeriod:!c}),!(null==l||!l.length)&&a.createElement(wl,{key:n.BillingPeriod.Annually,billingPeriod:n.BillingPeriod.Annually,isOnlyBillingPeriod:!c}))):null}var Cl=te.div(bl||(bl=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"]))),Sl=function(e,t){var n=e.minUnitQuantity,r=e.maxUnitQuantity;return!t||t<(n||1)?"Minimum "+(n||1):r&&t>r?"Maximum "+r:""};function Tl(e){var t,r,i,o,l,c,u=e.charge,s=e.isValid,d=e.setBillableFeature,m=e.billableFeature,p=e.onValidationChange,g=null==(t=u.feature)?void 0:t.featureId,h=!g,f=u.pricingModel===n.BillingModel.UsageBased,y=h?"Base charge":Ji((null==(r=u.feature)?void 0:r.displayName)||"",null==(i=u.feature)?void 0:i.units,null==(o=u.feature)?void 0:o.unitsPlural),v=!!(null!=u&&u.minUnitQuantity||null!=u&&u.maxUnitQuantity);if(h||f)c=""+Je({amount:u.amount,currency:u.currency,locale:"en-us",minimumFractionDigits:2}),f&&(c+=" / unit");else if(u.isTieredPrice&&g){var b=qe(u.tiers,m.quantity||1);c=a.createElement(rt,{componentId:g+"-tiers",tiers:u.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:!s,helperText:s?void 0:Sl(u,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=u.minUnitQuantity,i=u.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(u,a);d(g,o)}},onWheel:function(e){return e.target.blur()}})}return a.createElement(Cl,null,a.createElement(U,{display:"flex",flexDirection:"column"},a.createElement(we,{variant:"h6",color:"primary",lineHeight:"24px"},y),v&&a.createElement(we,{variant:"body1",color:"secondary",lineHeight:"20px"},ye(u.minUnitQuantity,u.maxUnitQuantity,null==(l=u.feature)?void 0:l.unitsPlural))),a.createElement(we,{variant:"h6",color:"primary"},c))}function Bl(e){var t,n=e.plan,r=e.billingPeriod,o=ba(),l=o.billableFeatures,c=o.setBillableFeature,u=Ca().setIsDisabled,s=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}));u(e),s(!e)}),[p,u,s]),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(Tl,{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 se({},e,((r={})[t]=n,r))}))}})})))}var Ml,Al=o(U,{target:"emtnukp0"})({name:"1d3w5wq",styles:"width:100%"}),Ul=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(yl,{allowChangePlan:!0,onChangePlan:t}),a.createElement(Al,null,a.createElement(Pl,{plan:i,checkoutLocalization:r}),a.createElement(Bl,{plan:i,billingPeriod:o})))};function Ll(){return(Ll=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 Fl=o((function(e){return i.createElement("svg",Ll({width:16,height:16,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),Ml||(Ml=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}),";}"),Nl=o(U,{target:"eaawmuo2"})({name:"zjik7",styles:"display:flex"}),Il=o(ae,{target:"eaawmuo1"})({name:"18uqayh",styles:"margin-bottom:16px"}),Dl=o(U,{target:"eaawmuo0"})("padding:16px;border-radius:10px;width:100%;border:",(function(e){return"1px solid "+e.theme.stigg.palette.outlinedBorder}),";"),Ol=function(e){var t=e.planName,n=e.priceText;return a.createElement(Dl,{className:"stigg-checkout-downgrade-to-free-container"},a.createElement(we,{className:"stigg-checkout-downgrade-to-free-text-header",style:{opacity:.8},variant:"caption",color:"disabled"},e.headerText),a.createElement(we,{className:"stigg-checkout-downgrade-to-free-plan-name",bold:!0,variant:"h3",color:"primary"},t),a.createElement(we,{className:"stigg-checkout-downgrade-to-free-price-text",color:"secondary"},n))},jl=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(fl,{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(Il,{action:t,className:"stigg-checkout-downgrade-to-free-alert",severity:"info"},a.createElement(we,{span:!0,color:"secondary"},n.downgradeToFree.alertText({plan:r.plan}))),a.createElement(Nl,{className:"stigg-checkout-downgrade-to-free-plans-container"},a.createElement(Ol,{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(Fl,{className:"stigg-checkout-downgrade-to-free-arrow",style:{margin:"auto 16px",minWidth:"16px"}}),a.createElement(Ol,{headerText:n.downgradeToFree.freePlanHeader({plan:i}),planName:n.downgradeToFree.freePlanName({plan:i}),priceText:n.downgradeToFree.freePlanPriceText({plan:i})})))};function ql(e){var t=e.onCheckout,r=e.onCheckoutCompleted,o=e.onChangePlan,l=e.onBillingAddressChange,c=e.collectPhoneNumber,u=e.disablePromotionCode,s=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=h.theme,b=Ca().currentStep,x=y.isLoadingCheckoutData,E=pa(),k=E.checkoutLocalization,w=E.checkoutState||{},P=w.plan,C=w.activeSubscription,S=!!P&&P.pricingType===n.PricingType.Free&&!!C&&C.pricingType!==n.PricingType.Free,T=function(e,t){var n=t.onBillingAddressChange,r=t.onChangePlan,i=t.collectPhoneNumber;switch(e.key){case ga.PLAN:return{content:a.createElement(Ul,{onChangePlan:r})};case ga.ADDONS:return{content:a.createElement(al,null)};case ga.PAYMENT:return{content:a.createElement(hl,{onBillingAddressChange:n,collectPhoneNumber:i})};default:return{content:null}}}(b,{onBillingAddressChange:l,onChangePlan:o,collectPhoneNumber:c}).content,B=a.createElement(a.Fragment,null,S?a.createElement(jl,{freePlan:P,activeSubscription:C,allowChangePlan:!0,checkoutLocalization:k,onChangePlan:o}):a.createElement(a.Fragment,null,T)),M=i.useMemo((function(){return g?{clientSecret:g}:{mode:"setup",currency:"usd"}}),[g]);return a.createElement(Q.Elements,{key:g,stripe:p,options:se({},M,{appearance:{theme:"stripe",variables:{colorText:f.palette.text.primary,colorPrimaryText:f.palette.text.primary,colorTextPlaceholder:f.palette.text.disabled,fontFamily:f.typography.fontFamily,colorBackground:null==v?void 0:v.paymentInputBackgroundColor,borderRadius:null==v?void 0:v.paymentInputBorderRadius},rules:null!=v&&v.paymentInputBorderColor?{".Input":{borderColor:null==v?void 0:v.paymentInputBorderColor}}:void 0}})},a.createElement(ja,{className:"stigg-checkout-layout"},!S&&a.createElement(Ga,null),a.createElement(qa,null,a.createElement(Ra,null,x?a.createElement(no,null):B),x?a.createElement(el,null):a.createElement(Jo,{disablePromotionCode:u,disableSuccessAnimation:s,onCheckout:t,onCheckoutCompleted:r,isFreeDowngrade:S,onMockCheckoutPreview:d}))))}var Rl,Wl=["textOverrides","theme","resourceId","planId","preferredBillingPeriod","billingCountryCode","billableFeatures","billingInformation","onMockCheckoutState"];(Rl=exports.ProvisionStatus||(exports.ProvisionStatus={})).IN_PROGRESS="IN_PROGRESS",Rl.SUCCEEDED="SUCCEEDED",Rl.FAILED="FAILED",Object.keys(n).forEach((function(e){"default"!==e&&Object.defineProperty(exports,e,{enumerable:!0,get:function(){return n[e]}})})),exports.AddonsList=kn,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,u=e.billingInformation,s=e.onMockCheckoutState,d=de(e,Wl);return a.createElement(Da,{textOverrides:t,theme:n,resourceId:r,planId:i,preferredBillingPeriod:o,billingCountryCode:l,billableFeatures:c,billingInformation:u,onMockCheckoutState:s},a.createElement(ql,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(pn,{textOverrides:t,theme:n,resourceId:r,productId:i},a.createElement(aa,Object.assign({},o)))},exports.CustomerPortalProvider=pn,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,u=e.onPlanSelected,s=e.preferredBillingPeriod,d=e.onBillingPeriodChange,m=e.billingCountryCode,p=e.shouldHidePlan,y=e.selectDefaultTierIndex,v=!!i.useContext(dn),b=!1;if(v){var x=mn();b=x.isLoading,r=x.resourceId}var E=function(e){var t=e.productId,r=e.resourceId,a=e.showOnlyEligiblePlans,o=e.billingCountryCode,l=e.preferredBillingPeriod,c=Wt(),u=c.stigg,s=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],k=i.useState(!0),w=k[0],C=k[1];i.useEffect((function(){!function(){var e=ue(jt.mark((function e(){var n,i,a,c;return jt.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,C(!0),e.next=4,u.waitForInitialization();case 4:return e.next=6,u.getPaywall({productId:t,resourceId:r,billingCountryCode:o});case 6:i=zt((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),qt.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)}}()()}),[u,t,u.isCustomerLoaded,o,r,l]);var S=function(e,t){var r,i=e||{},a=i.plans,o=i.currency,l=i.configuration,c=i.customer,u=i.paywallCalculatedPricePoints,s=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=s.currentSubscription,m=s.currentPlan,p=s.isCustomerOnTrial,g=s.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 se({},e,{paywallCalculatedPricePoints:null==u?void 0:u.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 k,w=m&&(null==a||null==(k=a.find((function(e){return e.id===(null==m?void 0:m.id)})))?void 0:k.order);f(w)||(E=E.map((function(e){return se({},e,{isLowerThanCurrentPlan:w>e.order})})),t&&(E=E.filter((function(e){return e.order>=w}))))}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:$t(e.typography),layout:{ctaAlignment:Zt(null==n?void 0:n.alignment),headerAlignment:Zt(null==n?void 0:n.alignment),descriptionAlignment:Zt(null==n?void 0:n.alignment),planMaxWidth:Ht(null==n?void 0:n.planWidth),planMinWidth:Ht(null==n?void 0:n.planWidth),planMargin:Ht(null==n?void 0:n.planMargin),planPadding:Ht(null==n?void 0:n.planPadding)}}}(l):void 0;return{currentPlan:m,currentSubscription:d,isCustomerOnTrial:p,plans:E,paywallConfiguration:C}}(x,a);return se({customer:(null==x?void 0:x.customer)||null,isLoading:w,selectedBillingPeriod:m,setSelectedBillingPeriod:p,availableBillingPeriods:y,locale:s,configuration:S.paywallConfiguration},S)}({productId:t,resourceId:r,showOnlyEligiblePlans:l,billingCountryCode:m,preferredBillingPeriod:s}),k=E.plans,w=E.customer,C=E.currentSubscription,S=E.isCustomerOnTrial,T=E.isLoading,B=E.selectedBillingPeriod,M=E.setSelectedBillingPeriod,A=E.availableBillingPeriods,U=E.locale,L=E.configuration,F=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),N=!k||T||b?a.createElement(rn,null):a.createElement(Ot,{plans:k,customer:w,currentSubscription:C,selectedBillingPeriod:B,onBillingPeriodChanged:function(e){M(e),d&&d(e)},availableBillingPeriods:A,highlightedPlanId:o,isCustomerOnTrial:S,onPlanSelected:u,paywallLocale:F,locale:U,shouldHidePlan:p,selectDefaultTierIndex:y});return v?N:a.createElement(sn,{componentTheme:L},N)},exports.Promotions=Pn,exports.StiggContext=Rt,exports.StiggProvider=function(e){var t=e.apiKey,n=e.baseUri,o=e.baseEdgeUri,l=e.enableEdge,c=e.customerId,u=e.customerToken,s=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:u,resourceId:s,baseUri:n,baseEdgeUri:o,enableEdge:l,entitlementsFallback:h,useEntitlementPolling:p,entitlementPollingInterval:g},x=i.useState((function(){return{stigg:null!=f?f:r.initialize(se({},b,{lazyLoad:!0})),locale:m||"en-US",isInitialized:!1,theme:d,refreshData:(e=ue(jt.mark((function e(){return jt.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return w((function(e){return se({},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],w=x[1];return i.useEffect((function(){var e=!0,n=function(t){e&&w(t)},i=function(){return n((function(e){return se({},e,{updatedAt:new Date})}))},a=function(e){return n((function(t){return t.stigg&&t.stigg.removeListener("entitlementsUpdated",i),e.addListener("entitlementsUpdated",i),se({},t,{stigg:e,isInitialized:!0,updatedAt:new Date})}))};return function(){var e=ue(jt.mark((function e(){var i;return jt.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=E.stigg,t!==v.current&&(qt.log("Updating stigg client",{apiKey:t}),v.current=t,i=r.initialize(se({},b)),n((function(e){return se({},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,u,s):e.clearCustomer()}),[c,u,s]),i.useEffect((function(){w((function(e){return se({},e,{theme:d})}))}),[d]),a.createElement(Rt.Provider,{value:E},a.createElement(k.SkeletonTheme,{baseColor:"#F5F6F9",highlightColor:"#e5e6ea"},y))},exports.SubscriptionsOverview=ji,exports.useStiggContext=Wt,exports.useWaitForCheckoutCompleted=function(e){var t,n=void 0===e?{}:e,r=n.onProvisionStart,a=n.onProvisionSucceeded,o=n.onProvisionFailed,l=Wt().stigg,c=i.useState(exports.ProvisionStatus.IN_PROGRESS),u=c[0],s=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=ue(jt.mark((function e(){var t;return jt.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,s(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),s(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:u}};
|
|
2
2
|
//# sourceMappingURL=react-sdk.cjs.production.min.js.map
|