@stigg/react-sdk 8.5.0 → 8.7.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/{CreditUsageChart-25PEGAXR.esm.js → CreditUsageChart-BDFRW7BA.esm.js} +1 -1
- package/dist/{CreditUsageChart-MTZLZN5J.cjs.js → CreditUsageChart-T5PAX7TE.cjs.js} +19 -19
- package/dist/{chunk-45WJQS4T.esm.js → chunk-EOAWTHEF.esm.js} +16 -13
- package/dist/{chunk-YAS4WG6F.cjs.js → chunk-IVDIW747.cjs.js} +16 -13
- package/dist/index.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/stigg-sdk.cjs.js +173 -171
- package/dist/stigg-sdk.esm.js +5 -3
- package/package.json +4 -4
package/dist/stigg-sdk.cjs.js
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkIVDIW747_cjs_js=require('./chunk-IVDIW747.cjs.js'),jsClientSdk=require('@stigg/js-client-sdk'),yi=require('react'),zu=require('classnames'),Re=require('@mui/material/Grid'),Cc=require('lodash/compact'),reactNumberFormat=require('react-number-format'),jsxRuntime=require('react/jsx-runtime'),Wa=require('lodash/isFunction'),tu=require('react-spinners/ClipLoader'),react=require('@emotion/react'),Bo=require('dayjs'),Zm=require('dayjs/plugin/utc'),Ym=require('dayjs/plugin/relativeTime'),Qm=require('dayjs/plugin/advancedFormat'),Fo=require('lodash/isNil'),jm=require('lodash/sum'),mu=require('currency-symbol-map'),bu=require('@mui/material/InputAdornment'),fu=require('@mui/material/Button'),Cu=require('@mui/material/TextField'),El=require('@mui/material/Divider'),Su=require('@mui/material/OutlinedInput'),Tu=require('@mui/material/Select'),ku=require('@mui/material/MenuItem'),wu=require('lodash/map'),ke=require('@mui/material/Box'),ug=require('react-switch'),Bg=require('lodash/countBy'),Ag=require('lodash/uniq'),ac=require('lodash/sortBy'),Lg=require('lodash/merge'),Je=require('react-loading-skeleton'),Yg=require('lodash/flatMap'),Qs=require('@mui/material/Tab'),Qg=require('lodash/isEmpty'),ef=require('@mui/material/Tabs'),nf=require('@mui/material/useMediaQuery'),reactFeather=require('react-feather'),zf=require('@mui/material/Link'),Rf=require('@mui/material/Tooltip'),Dl=require('lodash/keyBy'),Li=require('color'),Zf=require('@mui/material/LinearProgress'),py=require('lodash/padStart'),Yl=require('lodash/isUndefined'),sdk=require('@stigg/api-client-js/src/generated/sdk'),Xn=require('lodash/lowerCase'),Ty=require('lodash/range'),immer=require('immer'),Ly=require('lodash/cloneDeep'),Ny=require('lodash/remove'),reactStripeJs=require('@stripe/react-stripe-js'),Rh=require('@mui/material/StepIcon'),Ox=require('lodash/partition'),Yh=require('@mui/material/CircularProgress'),Yx=require('@mui/material/Paper'),Qx=require('@mui/material/Alert'),jh=require('@mui/material/Checkbox'),eC=require('@mui/material/FormControlLabel'),tC=require('lodash/isString'),OP=require('@mui/material/Autocomplete'),HP=require('@mui/material/Collapse'),_3x2=require('country-flag-icons/react/3x2'),gd=require('lodash/startCase'),fd=require('lodash/upperCase'),lx=require('react-lottie'),Dx=require('@mui/material/IconButton'),styles=require('@mui/material/styles'),Pb=require('@mui/material/Radio'),Ab=require('@mui/material/Chip'),rT=require('lodash/capitalize'),material=require('@mui/material'),MS=require('@mui/material/TableRow');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var yi__default=/*#__PURE__*/_interopDefault(yi);var zu__default=/*#__PURE__*/_interopDefault(zu);var Re__default=/*#__PURE__*/_interopDefault(Re);var Cc__default=/*#__PURE__*/_interopDefault(Cc);var Wa__default=/*#__PURE__*/_interopDefault(Wa);var tu__default=/*#__PURE__*/_interopDefault(tu);var Bo__default=/*#__PURE__*/_interopDefault(Bo);var Zm__default=/*#__PURE__*/_interopDefault(Zm);var Ym__default=/*#__PURE__*/_interopDefault(Ym);var Qm__default=/*#__PURE__*/_interopDefault(Qm);var Fo__default=/*#__PURE__*/_interopDefault(Fo);var jm__default=/*#__PURE__*/_interopDefault(jm);var mu__default=/*#__PURE__*/_interopDefault(mu);var bu__default=/*#__PURE__*/_interopDefault(bu);var fu__default=/*#__PURE__*/_interopDefault(fu);var Cu__default=/*#__PURE__*/_interopDefault(Cu);var El__default=/*#__PURE__*/_interopDefault(El);var Su__default=/*#__PURE__*/_interopDefault(Su);var Tu__default=/*#__PURE__*/_interopDefault(Tu);var ku__default=/*#__PURE__*/_interopDefault(ku);var wu__default=/*#__PURE__*/_interopDefault(wu);var ke__default=/*#__PURE__*/_interopDefault(ke);var ug__default=/*#__PURE__*/_interopDefault(ug);var Bg__default=/*#__PURE__*/_interopDefault(Bg);var Ag__default=/*#__PURE__*/_interopDefault(Ag);var ac__default=/*#__PURE__*/_interopDefault(ac);var Lg__default=/*#__PURE__*/_interopDefault(Lg);var Je__default=/*#__PURE__*/_interopDefault(Je);var Yg__default=/*#__PURE__*/_interopDefault(Yg);var Qs__default=/*#__PURE__*/_interopDefault(Qs);var Qg__default=/*#__PURE__*/_interopDefault(Qg);var ef__default=/*#__PURE__*/_interopDefault(ef);var nf__default=/*#__PURE__*/_interopDefault(nf);var zf__default=/*#__PURE__*/_interopDefault(zf);var Rf__default=/*#__PURE__*/_interopDefault(Rf);var Dl__default=/*#__PURE__*/_interopDefault(Dl);var Li__default=/*#__PURE__*/_interopDefault(Li);var Zf__default=/*#__PURE__*/_interopDefault(Zf);var py__default=/*#__PURE__*/_interopDefault(py);var Yl__default=/*#__PURE__*/_interopDefault(Yl);var Xn__default=/*#__PURE__*/_interopDefault(Xn);var Ty__default=/*#__PURE__*/_interopDefault(Ty);var Ly__default=/*#__PURE__*/_interopDefault(Ly);var Ny__default=/*#__PURE__*/_interopDefault(Ny);var Rh__default=/*#__PURE__*/_interopDefault(Rh);var Ox__default=/*#__PURE__*/_interopDefault(Ox);var Yh__default=/*#__PURE__*/_interopDefault(Yh);var Yx__default=/*#__PURE__*/_interopDefault(Yx);var Qx__default=/*#__PURE__*/_interopDefault(Qx);var jh__default=/*#__PURE__*/_interopDefault(jh);var eC__default=/*#__PURE__*/_interopDefault(eC);var tC__default=/*#__PURE__*/_interopDefault(tC);var OP__default=/*#__PURE__*/_interopDefault(OP);var HP__default=/*#__PURE__*/_interopDefault(HP);var gd__default=/*#__PURE__*/_interopDefault(gd);var fd__default=/*#__PURE__*/_interopDefault(fd);var lx__default=/*#__PURE__*/_interopDefault(lx);var Dx__default=/*#__PURE__*/_interopDefault(Dx);var Pb__default=/*#__PURE__*/_interopDefault(Pb);var Ab__default=/*#__PURE__*/_interopDefault(Ab);var rT__default=/*#__PURE__*/_interopDefault(rT);var MS__default=/*#__PURE__*/_interopDefault(MS);function So(e,t,o){let r=o?` ${o}`:"";return (!e||e===1)&&t?`Up to ${t}${r}`:e&&e>1&&t?`${e}-${t}${r}`:e&&e>1?`Minimum ${e}${r}`:""}function se(e,t="en-US"){if(e==null)return;let o={thousandSeparator:t==="en-US"?",":" ",decimalSeparator:".",decimalScale:0,fixedDecimalScale:true};return reactNumberFormat.numericFormatter(String(Math.round(e)),o)}function dn(e,t="en-US"){let o={thousandSeparator:t==="en-US"?",":" ",decimalSeparator:".",decimalScale:2,fixedDecimalScale:true};return reactNumberFormat.numericFormatter(String(e),o)}function Gt(e,t=1){if(e<1e6)return se(e)||"0";let o=[{value:1e12,suffix:"T"},{value:1e9,suffix:"B"},{value:1e6,suffix:"M"}];for(let{value:r,suffix:n}of o)if(e>=r){let a=(e/r).toFixed(t);return a.includes(".")&&(a=a.replace(/\.0+$/,"").replace(/(\.\d*[1-9])0+$/,"$1")),`${a}${n}`}return se(e)||"0"}var km=chunkIVDIW747_cjs_js.e(chunkIVDIW747_cjs_js.f)`
|
|
2
2
|
margin: 0;
|
|
3
|
-
`,wm=
|
|
3
|
+
`,wm=chunkIVDIW747_cjs_js.e.div`
|
|
4
4
|
display: flex;
|
|
5
5
|
align-items: center;
|
|
6
6
|
gap: 16px;
|
|
7
|
-
`,Bm=
|
|
7
|
+
`,Bm=chunkIVDIW747_cjs_js.e.div`
|
|
8
8
|
display: flex;
|
|
9
9
|
align-items: center;
|
|
10
10
|
flex-shrink: 0;
|
|
11
|
-
`,Am=
|
|
11
|
+
`,Am=chunkIVDIW747_cjs_js.e(chunkIVDIW747_cjs_js.i)`
|
|
12
12
|
width: 24px;
|
|
13
13
|
height: 24px;
|
|
14
14
|
color: ${({theme:e})=>e.stigg.palette.primary};
|
|
15
|
-
`;function To({displayName:e,className:t}){return jsxRuntime.jsxs(wm,{className:`stigg-entitlement-row-container ${t}`,children:[jsxRuntime.jsx(Bm,{children:jsxRuntime.jsx(Am,{icon:"EntitlementCheck",className:"stigg-entitlement-row-icon"})}),jsxRuntime.jsx(km,{className:"stigg-entitlement-name",variant:"h6",color:"secondary",children:e})]})}function Fm(e){if(!e)return "";switch(e){case jsClientSdk.EntitlementResetPeriod.Day:return "per day";case jsClientSdk.EntitlementResetPeriod.Hour:return "per hour";case jsClientSdk.EntitlementResetPeriod.Week:return "per week";case jsClientSdk.EntitlementResetPeriod.Month:return "per month";case jsClientSdk.EntitlementResetPeriod.Year:return "per year";default:return ""}}function vm({hasUnlimitedUsage:e,feature:t,resetPeriod:o,usageLimit:r,minUnitQuantity:n,maxUnitQuantity:i,isCustom:a,enumValues:l}){let s=n||i,c=`${o&&r?`${Fm(o)}`:""}`;if(l){let u=l.length===1?t==null?void 0:t.featureUnits:t==null?void 0:t.featureUnitsPlural;return `${l.length} ${u}`}if(e)return `Unlimited ${t==null?void 0:t.featureUnitsPlural}`;if(a)return `Custom ${t==null?void 0:t.featureUnitsPlural}`;if(r){let u=r===1?t==null?void 0:t.featureUnits:t==null?void 0:t.featureUnitsPlural;return `${se(r)} ${u} ${c}`}return s?So(n,i,t==null?void 0:t.featureUnitsPlural):t==null?void 0:t.displayName}function mn(e){let i=e,{displayNameOverride:t,feature:o}=i,r=
|
|
15
|
+
`;function To({displayName:e,className:t}){return jsxRuntime.jsxs(wm,{className:`stigg-entitlement-row-container ${t}`,children:[jsxRuntime.jsx(Bm,{children:jsxRuntime.jsx(Am,{icon:"EntitlementCheck",className:"stigg-entitlement-row-icon"})}),jsxRuntime.jsx(km,{className:"stigg-entitlement-name",variant:"h6",color:"secondary",children:e})]})}function Fm(e){if(!e)return "";switch(e){case jsClientSdk.EntitlementResetPeriod.Day:return "per day";case jsClientSdk.EntitlementResetPeriod.Hour:return "per hour";case jsClientSdk.EntitlementResetPeriod.Week:return "per week";case jsClientSdk.EntitlementResetPeriod.Month:return "per month";case jsClientSdk.EntitlementResetPeriod.Year:return "per year";default:return ""}}function vm({hasUnlimitedUsage:e,feature:t,resetPeriod:o,usageLimit:r,minUnitQuantity:n,maxUnitQuantity:i,isCustom:a,enumValues:l}){let s=n||i,c=`${o&&r?`${Fm(o)}`:""}`;if(l){let u=l.length===1?t==null?void 0:t.featureUnits:t==null?void 0:t.featureUnitsPlural;return `${l.length} ${u}`}if(e)return `Unlimited ${t==null?void 0:t.featureUnitsPlural}`;if(a)return `Custom ${t==null?void 0:t.featureUnitsPlural}`;if(r){let u=r===1?t==null?void 0:t.featureUnits:t==null?void 0:t.featureUnitsPlural;return `${se(r)} ${u} ${c}`}return s?So(n,i,t==null?void 0:t.featureUnitsPlural):t==null?void 0:t.displayName}function mn(e){let i=e,{displayNameOverride:t,feature:o}=i,r=chunkIVDIW747_cjs_js.c(i,["displayNameOverride","feature"]),n=t||vm(chunkIVDIW747_cjs_js.a({feature:o},r))||"";return jsxRuntime.jsx(To,{displayName:n,className:`stigg-entitlement-${o==null?void 0:o.refId}`})}function Lm(e){switch(e){case jsClientSdk.BillingPeriod.Monthly:return "per month";case jsClientSdk.BillingPeriod.Annually:return "per year";default:return ""}}function Nm(e){var c,u,f;let{amount:t,customCurrency:o,displayNameOverride:r,billingPeriod:n}=e,i=t!=null?t:0;if(r)return r;let a=i===1?(c=o.units)==null?void 0:c.singular:(u=o.units)==null?void 0:u.plural,l=`${se(i)} ${a||o.displayName}`;(f=e.dependencyFeature)!=null&&f.featureUnits&&(l=`${l} / ${e.dependencyFeature.featureUnits}`);let s=Lm(n);return s?`${l} ${s}`:l}function un({entitlement:e}){let t=Nm(e);return jsxRuntime.jsx(To,{displayName:t,className:`stigg-credit-entitlement-${e.id}`})}function Vt(e){return e.pricingModel===jsClientSdk.BillingModel.PerUnit&&!!e.topUpCustomCurrencyId}function Um(e){return Vt(e)&&e.billingCadence===jsClientSdk.BillingCadence.OneOff}function Ot(e){return Vt(e)&&e.isTieredPrice}function ko(e,t){return e.pricePoints.find(o=>o.billingPeriod===t&&Ot(o))}function wo(e){var t,o;return ((o=(t=e.tiers)==null?void 0:t.length)!=null?o:0)>1}function _m(e){return e.pricingModel===jsClientSdk.BillingModel.CreditBased}function Ct(e){return !_m(e)&&!Um(e)}function Na(e){var t,o,r;return (t=e.customCurrency)!=null&&t.units?e.customCurrency.units.plural||e.customCurrency.units.singular||e.customCurrency.displayName:((o=e.feature)==null?void 0:o.unitsPlural)||((r=e.feature)==null?void 0:r.units)||""}function zm(e){return e.__typename==="PackageCreditEntitlement"}function Vm(e){switch(e){case jsClientSdk.CreditCadence.Month:return jsClientSdk.BillingPeriod.Monthly;case jsClientSdk.CreditCadence.Year:return jsClientSdk.BillingPeriod.Annually}}var Om=chunkIVDIW747_cjs_js.e.div`
|
|
16
16
|
display: flex;
|
|
17
17
|
flex-direction: column;
|
|
18
18
|
gap: 16px;
|
|
19
|
-
`;function Hm(e,t,o){if(t.entitlementsTitle)return t.entitlementsTitle(e);let r=o?"Includes:":"";return e.basePlan&&(r=`Everything in ${e.basePlan.displayName}${o?", plus:":""}`),r}function _a({plan:e,billingPeriod:t,paywallLocale:o,singleTierCreditCharge:r}){var c,u,f,y;let i=(((c=e.pricePoints)==null?void 0:c.filter(p=>p.billingPeriod===t))||[]).filter(p=>Ct(p)).filter(p=>(p==null?void 0:p.minUnitQuantity)&&(p==null?void 0:p.minUnitQuantity)>1||(p==null?void 0:p.maxUnitQuantity)).map(p=>{var g;return jsxRuntime.jsx(mn,{feature:p!=null&&p.feature?{refId:p.feature.featureId,featureUnits:p.feature.units,featureUnitsPlural:p.feature.unitsPlural,unitQuantity:p.feature.unitQuantity,displayName:p.feature.displayName}:null,minUnitQuantity:p==null?void 0:p.minUnitQuantity,maxUnitQuantity:p==null?void 0:p.maxUnitQuantity},`priceUnitEntitlement-${(g=p==null?void 0:p.feature)==null?void 0:g.displayName}`)}),a=Cc__default.default(e.packageEntitlements).filter(p=>p.isGranted).filter(p=>{var g;return !((g=p.hiddenFromWidgets)!=null&&g.includes(jsClientSdk.WidgetType.Paywall))}),l=!!r,s=i.length>0||a.length>0||l;return jsxRuntime.jsxs(Om,{className:"stigg-plan-entitlements-container",children:[jsxRuntime.jsx(
|
|
19
|
+
`;function Hm(e,t,o){if(t.entitlementsTitle)return t.entitlementsTitle(e);let r=o?"Includes:":"";return e.basePlan&&(r=`Everything in ${e.basePlan.displayName}${o?", plus:":""}`),r}function _a({plan:e,billingPeriod:t,paywallLocale:o,singleTierCreditCharge:r}){var c,u,f,y;let i=(((c=e.pricePoints)==null?void 0:c.filter(p=>p.billingPeriod===t))||[]).filter(p=>Ct(p)).filter(p=>(p==null?void 0:p.minUnitQuantity)&&(p==null?void 0:p.minUnitQuantity)>1||(p==null?void 0:p.maxUnitQuantity)).map(p=>{var g;return jsxRuntime.jsx(mn,{feature:p!=null&&p.feature?{refId:p.feature.featureId,featureUnits:p.feature.units,featureUnitsPlural:p.feature.unitsPlural,unitQuantity:p.feature.unitQuantity,displayName:p.feature.displayName}:null,minUnitQuantity:p==null?void 0:p.minUnitQuantity,maxUnitQuantity:p==null?void 0:p.maxUnitQuantity},`priceUnitEntitlement-${(g=p==null?void 0:p.feature)==null?void 0:g.displayName}`)}),a=Cc__default.default(e.packageEntitlements).filter(p=>p.isGranted).filter(p=>{var g;return !((g=p.hiddenFromWidgets)!=null&&g.includes(jsClientSdk.WidgetType.Paywall))}),l=!!r,s=i.length>0||a.length>0||l;return jsxRuntime.jsxs(Om,{className:"stigg-plan-entitlements-container",children:[jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{className:"stigg-plan-entitlements-title",color:"secondary",variant:"h6",bold:true,children:Hm(e,o,s)}),i,r&&jsxRuntime.jsx(un,{entitlement:{id:r.topUpCustomCurrencyId,amount:(y=(f=(u=r.tiers)==null?void 0:u[0])==null?void 0:f.upTo)!=null?y:0,customCurrency:r.customCurrency,billingPeriod:r.billingCadence===jsClientSdk.BillingCadence.Recurring?t:void 0}},`credit-charge-${r.topUpCustomCurrencyId}`),a.map(p=>zm(p)?jsxRuntime.jsx(un,{entitlement:chunkIVDIW747_cjs_js.b(chunkIVDIW747_cjs_js.a({},p),{billingPeriod:Vm(p.cadence)})},Ua(p)):jsxRuntime.jsx(mn,{displayNameOverride:p.displayNameOverride,feature:p.feature,resetPeriod:p.resetPeriod,hasUnlimitedUsage:p.hasUnlimitedUsage,usageLimit:p.usageLimit,enumValues:p.enumValues,isCustom:p.isCustom},Ua(p)))]})}function Ua(e){return `${e.__typename}:${e.id}`}var gn=(s=>(s.START_TRIAL="START_TRIAL",s.UPGRADE_TRIAL_TO_PAID="UPGRADE_TRIAL_TO_PAID",s.REQUEST_CUSTOM_PLAN_ACCESS="REQUEST_CUSTOM_PLAN_ACCESS",s.CHANGE_BILLING_PERIOD="CHANGE_BILLING_PERIOD",s.CHANGE_UNIT_QUANTITY="CHANGE_UNIT_QUANTITY",s.UPGRADE_PLAN="UPGRADE_PLAN",s.DOWNGRADE_PLAN="DOWNGRADE_PLAN",s.CANCEL_SCHEDULED_UPDATES="CANCEL_SCHEDULED_UPDATES",s))(gn||{});Bo__default.default.extend(Zm__default.default);Bo__default.default.extend(Ym__default.default);Bo__default.default.extend(Qm__default.default);var Z=Bo__default.default;var yn=e=>Z.utc(e).format("MMMM Do, YYYY");function Ao(e){return String(e.scheduledExecutionTime)}function Jm(e){return e!=null&&e.end?String(e.end):void 0}function Io({scheduledUpdate:e,subscriptionPrices:t,billingPeriodRange:o,options:r={}}){var a,l;if(!e)return {};let{withDate:n,postfix:i=""}=r;switch(e.subscriptionScheduleType){case jsClientSdk.SubscriptionScheduleType.Downgrade:{let s=n,c=Jm(o);return Fo__default.default(s)&&c&&(s=!Z(Ao(e)).isSame(Z(c),"day")),{line1:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:["Your subscription will be downgraded to the ",jsxRuntime.jsxs("b",{children:[(a=e.targetPackage)==null?void 0:a.displayName," plan"]})," ",s?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:["on ",yn(Ao(e))]}):i,"."]}),line2:"Until then you still have access to your current plan."}}case jsClientSdk.SubscriptionScheduleType.BillingPeriod:{let s=e.scheduleVariables;return {line1:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:["Your billing cycle will change to ",jsxRuntime.jsx("b",{children:(l=s.billingPeriod)==null?void 0:l.toLocaleLowerCase()})," ",n?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:["on ",yn(Ao(e))]}):i,"."]})}}case jsClientSdk.SubscriptionScheduleType.UnitAmount:{let s=e.scheduleVariables,u=Cc__default.default(t==null?void 0:t.map(({feature:P})=>P)).find(({id:P})=>P===s.featureId),{featureUnits:f,featureUnitsPlural:y}=u||{},p=s.newUnitAmount===1?f:y,g=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:["Your subscription will be updated to ",jsxRuntime.jsx("b",{children:s.newUnitAmount})," ",p," ",n?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:["on ",yn(Ao(e))]}):i,"."]}),h=`Until then you still have access to your current ${f} count.`;return {line1:g,line2:h}}default:return {}}}function za(e){return e.feature&&(e.feature.unitQuantity!==1?e.feature.unitsPlural:e.feature.units)||""}function Pn(e,t){let o=[...e];o.sort((r,n)=>r.upTo?n.upTo?r.upTo-n.upTo:-1:1);for(let r of o)if(r.upTo&&t<=r.upTo)return r;return o[o.length-1]}function Ga(e,t,o){return t===jsClientSdk.BillingPeriod.Annually&&o?e/12:e}function Cn(e,t,o,r){let n=0;if(e.unitPrice){let i=Ga(e.unitPrice.amount,o,r);n+=i*t;}return e.flatPrice&&(n+=Ga(e.flatPrice.amount,o,r)),n}function xn(e,t,o,r){let n=t,i=0,a=0,l=[];for(;n>0&&a<e.length;){let c=e[a],{upTo:u}=c;if(Fo__default.default(u))l.push({unitQuantity:n,amount:Cn(c,n,o,r)}),n=0;else {let f=u-i,y=Math.min(n,f);l.push({unitQuantity:y,amount:Cn(c,y,o,r)}),n-=y,i=u;}a+=1;}let s=jm__default.default(l.map(({amount:c})=>c));return {breakdown:l,total:s}}function xt(e,t,o,r){if(!e.tiers)return 0;switch(e.tiersMode){case jsClientSdk.TiersMode.Volume:{let n=Pn(e.tiers,t);return Cn(n,t,o,r)}case jsClientSdk.TiersMode.Graduated:return xn(e.tiers,t,o,r).total;default:return 0}}function Wt(e){return e==null?void 0:e.some(({unitPrice:t,upTo:o})=>t&&!Fo__default.default(o))}function Va(e){return e==null?void 0:e.every(({unitPrice:t,upTo:o})=>!t||Fo__default.default(o))}function Oa(e,t){return (e==null?void 0:e[0].upTo)&&t<=e[0].upTo}function vo({plan:e,billingPeriod:t,currentSubscription:o,currentSubscriptionOverride:r,selectDefaultTierIndex:n}){let i=e.pricePoints.filter(a=>a.billingPeriod===t&&a.isTieredPrice&&!Ot(a));if(i.length===1){let[a]=i,{featureId:l}=a.feature,s=n?n({plan:e}):0,c=a.tiers[s],u=Wt(a.tiers)?1:c.upTo||1;if(o&&o.plan.id===e.id){let y=o.prices.find(p=>{var g;return p.pricingModel===jsClientSdk.BillingModel.PerUnit&&p.tiersMode&&((g=p.feature)==null?void 0:g.featureId)===l});y&&(u=y.feature.unitQuantity||1);}if((r==null?void 0:r.planId)===e.id){let y=r.billableFeatures.find(p=>p.featureId===l);y&&(u=y.quantity);}let f={};return f[l]=u,f}return {}}function Ha({perUnitQuantityByFeature:e,plan:t,currentSubscription:o,currentSubscriptionOverride:r}){var u,f;if(!o)return 0;let n=o.prices.find(y=>y.pricingModel===jsClientSdk.BillingModel.PerUnit&&y.tiersMode),i=t.id===(r==null?void 0:r.planId);if(i&&(n=(u=t.pricePoints.find(y=>y.pricingModel===jsClientSdk.BillingModel.PerUnit&&y.tiersMode))!=null?u:n),!n)return 0;let{featureId:a,unitQuantity:l}=n.feature,s=l;if(i){let y=(f=r==null?void 0:r.billableFeatures)==null?void 0:f.find(p=>p.featureId===a);y&&(s=y.quantity);}if(Fo__default.default(s))return 0;let c=e[a];return c<s?-1:c>s?1:0}var nu=chunkIVDIW747_cjs_js.e(tu__default.default)`
|
|
20
20
|
margin-left: 10px;
|
|
21
|
-
`,iu=
|
|
21
|
+
`,iu=chunkIVDIW747_cjs_js.e.button`
|
|
22
22
|
cursor: ${({$disabled:e})=>e?"default":"pointer"};
|
|
23
23
|
padding: 8px 12px;
|
|
24
24
|
background-color: ${({theme:e})=>e.stigg.palette.backgroundButton};
|
|
@@ -37,12 +37,12 @@
|
|
|
37
37
|
&:hover {
|
|
38
38
|
background-color: ${({theme:e,$disabled:t})=>t?e.stigg.palette.backgroundButton:e.stigg.palette.outlinedHoverBackground};
|
|
39
39
|
}
|
|
40
|
-
`,au=
|
|
40
|
+
`,au=chunkIVDIW747_cjs_js.e(chunkIVDIW747_cjs_js.f)`
|
|
41
41
|
margin: 0;
|
|
42
42
|
font-size: 15px;
|
|
43
|
-
`,su=
|
|
43
|
+
`,su=chunkIVDIW747_cjs_js.e(chunkIVDIW747_cjs_js.f)`
|
|
44
44
|
min-height: 87px;
|
|
45
|
-
`,lu=
|
|
45
|
+
`,lu=chunkIVDIW747_cjs_js.e.button`
|
|
46
46
|
background: none;
|
|
47
47
|
border: none;
|
|
48
48
|
padding: 0;
|
|
@@ -50,17 +50,17 @@
|
|
|
50
50
|
|
|
51
51
|
text-decoration: underline;
|
|
52
52
|
cursor: pointer;
|
|
53
|
-
`,cu=
|
|
53
|
+
`,cu=chunkIVDIW747_cjs_js.e(chunkIVDIW747_cjs_js.f)`
|
|
54
54
|
margin-top: 8px;
|
|
55
55
|
margin-bottom: 17px;
|
|
56
56
|
min-height: 20px;
|
|
57
|
-
`,du=
|
|
57
|
+
`,du=chunkIVDIW747_cjs_js.e.div`
|
|
58
58
|
display: flex;
|
|
59
59
|
flex-direction: column;
|
|
60
60
|
margin-top: 4px;
|
|
61
|
-
align-self: ${({theme:e})=>
|
|
61
|
+
align-self: ${({theme:e})=>chunkIVDIW747_cjs_js.j(e.stigg.layout.ctaAlignment)};
|
|
62
62
|
width: 100%;
|
|
63
|
-
`;function Za({isNextPlan:e,customer:t,plan:o,billingPeriod:r,isCustomerOnTrial:n,onPlanSelected:i,paywallLocale:a,withTrialLeftRow:l,currentSubscription:s,currentSubscriptionOverride:c,perUnitQuantityByFeature:u}){let f=react.useTheme(),[y,p]=yi.useState(false),{currentPlan:g,custom:h,downgrade:P,startTrial:b,upgrade:x,startNew:A,switchToBillingPeriod:S,cancelScheduledUpdate:F}=a.planCTAButton,T=Wa__default.default(P)?P(o):P,k=Wa__default.default(x)?x(o):x,w={title:t?o.isLowerThanCurrentPlan?T:k:A,disabled:false,intentionType:o.isLowerThanCurrentPlan?"DOWNGRADE_PLAN":n?"UPGRADE_TRIAL_TO_PAID":"UPGRADE_PLAN"},I=o.pricingType===jsClientSdk.PricingType.Custom,{line1:v}=Io({scheduledUpdate:o.scheduledUpdate,options:{withDate:true}});if(o.isTriable&&!o.isCurrentCustomerPlan&&!n)w.title=b(o),w.intentionType="START_TRIAL";else if(o.isCurrentCustomerPlan&&!n)if(r===o.currentCustomerPlanBillingPeriod||o.pricingType&&[jsClientSdk.PricingType.Free,jsClientSdk.PricingType.Custom].includes(o.pricingType))switch(Ha({perUnitQuantityByFeature:u,plan:o,currentSubscription:s,currentSubscriptionOverride:c})){case -1:w.intentionType="CHANGE_UNIT_QUANTITY",w.title=T;break;case 1:w.intentionType="CHANGE_UNIT_QUANTITY",w.title=k;break;default:w.title=g,w.disabled=true;break}else w.title=S(r),w.intentionType="CHANGE_BILLING_PERIOD";else I&&(w.title=typeof h=="function"?h({plan:o,selectedBillingPeriod:r}):h,w.intentionType="REQUEST_CUSTOM_PLAN_ACCESS");e&&o.scheduledUpdate&&(w.disabled=false,w.title=F,w.intentionType="CANCEL_SCHEDULED_UPDATES");let L=y||w.disabled;return jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsx(du,{className:"stigg-paywall-plan-button-layout",children:e&&v?jsxRuntime.jsxs(su,{color:"secondary",variant:"body1",className:"stigg-paywall-schedule-update-text",children:[v," ",jsxRuntime.jsx(lu,{color:"secondary",onClick:()=>{p(true),Promise.resolve(i(w.intentionType)).finally(()=>p(false));},children:w.title})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(iu,{className:"stigg-paywall-plan-button","data-testid":`paywall-card-cta-${o.displayName}`,disabled:L,$disabled:L,onClick:()=>{p(true),Promise.resolve(i(w.intentionType)).finally(()=>p(false));},children:[jsxRuntime.jsx(au,{className:"stigg-paywall-plan-button-text",variant:"h6",color:"primary.main",children:w.title}),y&&jsxRuntime.jsx(nu,{color:f.stigg.palette.text.disabled,loading:true,size:16})]}),l?jsxRuntime.jsx(cu,{className:"stigg-trial-days-left-text",variant:"h6",color:"secondary",children:o.isCurrentCustomerPlan&&o.trialDaysLeft&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("b",{children:[o.trialDaysLeft," days"]})," left on your free trial"]})}):jsxRuntime.jsx("div",{style:{height:"20px"}})]})})})}var H=({amount:e,currency:t=jsClientSdk.Currency.Usd,locale:o,maximumFractionDigits:r=5,minimumFractionDigits:n=0,removeTrailingZero:i})=>{let a=t.toString(),l=mu__default.default(a),s=new Intl.NumberFormat(o,
|
|
63
|
+
`;function Za({isNextPlan:e,customer:t,plan:o,billingPeriod:r,isCustomerOnTrial:n,onPlanSelected:i,paywallLocale:a,withTrialLeftRow:l,currentSubscription:s,currentSubscriptionOverride:c,perUnitQuantityByFeature:u}){let f=react.useTheme(),[y,p]=yi.useState(false),{currentPlan:g,custom:h,downgrade:P,startTrial:b,upgrade:x,startNew:A,switchToBillingPeriod:S,cancelScheduledUpdate:F}=a.planCTAButton,T=Wa__default.default(P)?P(o):P,k=Wa__default.default(x)?x(o):x,w={title:t?o.isLowerThanCurrentPlan?T:k:A,disabled:false,intentionType:o.isLowerThanCurrentPlan?"DOWNGRADE_PLAN":n?"UPGRADE_TRIAL_TO_PAID":"UPGRADE_PLAN"},I=o.pricingType===jsClientSdk.PricingType.Custom,{line1:v}=Io({scheduledUpdate:o.scheduledUpdate,options:{withDate:true}});if(o.isTriable&&!o.isCurrentCustomerPlan&&!n)w.title=b(o),w.intentionType="START_TRIAL";else if(o.isCurrentCustomerPlan&&!n)if(r===o.currentCustomerPlanBillingPeriod||o.pricingType&&[jsClientSdk.PricingType.Free,jsClientSdk.PricingType.Custom].includes(o.pricingType))switch(Ha({perUnitQuantityByFeature:u,plan:o,currentSubscription:s,currentSubscriptionOverride:c})){case -1:w.intentionType="CHANGE_UNIT_QUANTITY",w.title=T;break;case 1:w.intentionType="CHANGE_UNIT_QUANTITY",w.title=k;break;default:w.title=g,w.disabled=true;break}else w.title=S(r),w.intentionType="CHANGE_BILLING_PERIOD";else I&&(w.title=typeof h=="function"?h({plan:o,selectedBillingPeriod:r}):h,w.intentionType="REQUEST_CUSTOM_PLAN_ACCESS");e&&o.scheduledUpdate&&(w.disabled=false,w.title=F,w.intentionType="CANCEL_SCHEDULED_UPDATES");let L=y||w.disabled;return jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsx(du,{className:"stigg-paywall-plan-button-layout",children:e&&v?jsxRuntime.jsxs(su,{color:"secondary",variant:"body1",className:"stigg-paywall-schedule-update-text",children:[v," ",jsxRuntime.jsx(lu,{color:"secondary",onClick:()=>{p(true),Promise.resolve(i(w.intentionType)).finally(()=>p(false));},children:w.title})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(iu,{className:"stigg-paywall-plan-button","data-testid":`paywall-card-cta-${o.displayName}`,disabled:L,$disabled:L,onClick:()=>{p(true),Promise.resolve(i(w.intentionType)).finally(()=>p(false));},children:[jsxRuntime.jsx(au,{className:"stigg-paywall-plan-button-text",variant:"h6",color:"primary.main",children:w.title}),y&&jsxRuntime.jsx(nu,{color:f.stigg.palette.text.disabled,loading:true,size:16})]}),l?jsxRuntime.jsx(cu,{className:"stigg-trial-days-left-text",variant:"h6",color:"secondary",children:o.isCurrentCustomerPlan&&o.trialDaysLeft&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("b",{children:[o.trialDaysLeft," days"]})," left on your free trial"]})}):jsxRuntime.jsx("div",{style:{height:"20px"}})]})})})}var H=({amount:e,currency:t=jsClientSdk.Currency.Usd,locale:o,maximumFractionDigits:r=5,minimumFractionDigits:n=0,removeTrailingZero:i})=>{let a=t.toString(),l=mu__default.default(a),s=new Intl.NumberFormat(o,chunkIVDIW747_cjs_js.a({maximumFractionDigits:r,minimumFractionDigits:n,style:"currency",currency:a,trailingZeroDisplay:i?"stripIfInteger":"auto"},l?{currencyDisplay:"code"}:{})).format(e||0);return l&&(s=s.replace(a,l)),s=s.replace(/\s/g,""),s};function uu(e,t){var o,r;return e.blockSize&&e.blockSize>1?`for ${chunkIVDIW747_cjs_js.k(e.blockSize)} ${(r=(o=t.plural)!=null?o:t.units)!=null?r:""}`:`per ${t.units||""}`}function gu(e,t,o){return Vt(e)?o||1:(t==null?void 0:t[e.feature.featureId])||1}function Qa({planPrices:e,paywallCalculatedPrice:t,selectedBillingPeriod:o,locale:r,shouldShowMonthlyPriceAmount:n,paywallLocale:i,perUnitQuantityByFeature:a,creditChargeQuantity:l}){var A,S,F,T,k,w;let s=e.filter(I=>Ct(I)),c=t||s[0];if(!c)return {price:"",unit:"",tiers:void 0,tierUnits:void 0};let{amount:u,currency:f}=c,y=u||0,p=s.length===1,g=o===jsClientSdk.BillingPeriod.Annually&&n?y/12:y,h,P,b=i.price.pricePeriod(n?jsClientSdk.BillingPeriod.Monthly:jsClientSdk.BillingPeriod.Annually),x=b;for(let I of s)if(I.isTieredPrice&&I.tiers){let v=gu(I,a,l);h=I.tiers,P=za(I),g+=xt(I,v,o,n);}if(p&&s[0]){let I=s[0],v=Vt(I)?{units:(S=(A=I.customCurrency)==null?void 0:A.units)==null?void 0:S.singular,plural:(T=(F=I.customCurrency)==null?void 0:F.units)==null?void 0:T.plural}:{units:(k=I.feature)==null?void 0:k.units,plural:(w=I.feature)==null?void 0:w.unitsPlural},L=uu(I,v);I.pricingModel===jsClientSdk.BillingModel.PerUnit&&!I.isTieredPrice?x=`${L} ${b}`:I.pricingModel===jsClientSdk.BillingModel.UsageBased&&(x=L);}return {price:H({amount:g,currency:f,locale:r,minimumFractionDigits:2,removeTrailingZero:true}),unit:x,tiers:h,tierUnits:P}}function Eo(e,t,o,r,n,i,a){var l;switch(e.pricingType){case jsClientSdk.PricingType.Free:return typeof o.price.free=="function"?o.price.free(e.paywallCurrency):o.price.free;case jsClientSdk.PricingType.Custom:return {price:typeof o.price.custom=="function"?o.price.custom({plan:e,selectedBillingPeriod:t}):o.price.custom};case jsClientSdk.PricingType.Paid:{let s=e.pricePoints.filter(f=>f.billingPeriod===t),c=(l=e.paywallCalculatedPricePoints)==null?void 0:l.find(f=>f.billingPeriod===t);if(!(s!=null&&s.length)&&!c)return {price:o.price.priceNotSet};let u={planPrices:s,paywallCalculatedPrice:c,selectedBillingPeriod:t,perUnitQuantityByFeature:i||{},creditChargeQuantity:a};return o.price.paid?o.price.paid(chunkIVDIW747_cjs_js.b(chunkIVDIW747_cjs_js.a({},u),{plan:e})):Qa(chunkIVDIW747_cjs_js.b(chunkIVDIW747_cjs_js.a({},u),{locale:r,shouldShowMonthlyPriceAmount:n,paywallLocale:o}))}default:return {price:""}}}var yu=chunkIVDIW747_cjs_js.e(fu__default.default,{shouldForwardProp:e=>!e.startsWith("$")})`
|
|
64
64
|
border-radius: 10px;
|
|
65
65
|
text-transform: none;
|
|
66
66
|
font-weight: 300;
|
|
@@ -71,10 +71,10 @@
|
|
|
71
71
|
&:hover {
|
|
72
72
|
background-color: ${({theme:e,$success:t,$error:o})=>t?e.stigg.palette.successDark:o?e.stigg.palette.errorDark:""};
|
|
73
73
|
}
|
|
74
|
-
`,te=o=>{var r=o,{variant:e="outlined"}=r,t=
|
|
74
|
+
`,te=o=>{var r=o,{variant:e="outlined"}=r,t=chunkIVDIW747_cjs_js.c(r,["variant"]);return jsxRuntime.jsx(yu,chunkIVDIW747_cjs_js.a({variant:e},t))};var pe=chunkIVDIW747_cjs_js.e(Cu__default.default)(({theme:e})=>({"& .MuiOutlinedInput-root":{height:"42px",borderRadius:e.stigg.border.radius,fieldset:{borderColor:e.stigg.palette.outlinedBorder},"&:not(.Mui-focused):hover fieldset":{borderColor:e.stigg.palette.outlinedRestingBorder}},"& .MuiInputBase-input":chunkIVDIW747_cjs_js.a({padding:"8px 12px",borderRadius:e.stigg.border.radius,fontFamily:e.stigg.typography.fontFamily,color:e.stigg.palette.text.primary},e.stigg.typography.body),"& .Mui-error":{fontFamily:e.stigg.typography.fontFamily},"& .MuiFormHelperText-root":{whiteSpace:"nowrap"}}));var Ka=chunkIVDIW747_cjs_js.e(Re__default.default)`
|
|
75
75
|
display: flex;
|
|
76
76
|
flex-direction: column;
|
|
77
|
-
`;function qa(){return jsxRuntime.jsxs(Ka,{container:true,children:[jsxRuntime.jsxs(
|
|
77
|
+
`;function qa(){return jsxRuntime.jsxs(Ka,{container:true,children:[jsxRuntime.jsxs(chunkIVDIW747_cjs_js.l,{item:true,$gap:48,children:[jsxRuntime.jsx(chunkIVDIW747_cjs_js.o,{width:120,height:20}),jsxRuntime.jsx(chunkIVDIW747_cjs_js.o,{width:120,height:20})]}),jsxRuntime.jsx(El__default.default,{className:"stigg-checkout-plan-header-divider",sx:{marginY:2}}),jsxRuntime.jsxs(Ka,{item:true,children:[jsxRuntime.jsx(chunkIVDIW747_cjs_js.o,{width:120,height:20}),jsxRuntime.jsxs(chunkIVDIW747_cjs_js.m,{$gap:16,marginTop:3,children:[jsxRuntime.jsx(chunkIVDIW747_cjs_js.o,{height:20}),jsxRuntime.jsx(chunkIVDIW747_cjs_js.o,{height:20})]}),jsxRuntime.jsxs(chunkIVDIW747_cjs_js.l,{$gap:130,marginTop:3,children:[jsxRuntime.jsx(chunkIVDIW747_cjs_js.n,{flex:1,children:jsxRuntime.jsx(chunkIVDIW747_cjs_js.o,{height:20})}),jsxRuntime.jsx(chunkIVDIW747_cjs_js.n,{flex:3,children:jsxRuntime.jsx(chunkIVDIW747_cjs_js.o,{height:20})})]})]})]})}var bt=e=>e.target.blur();function Ja({width:e,tierUnits:t,value:o,handleChange:r,errorMessage:n}){return jsxRuntime.jsx(pe,{type:"number",onWheel:bt,fullWidth:true,error:!!n,sx:{minHeight:"46px",width:e},InputProps:{endAdornment:jsxRuntime.jsx(bu__default.default,{position:"end",children:jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{variant:"body1",color:"primary",children:t})})},value:o,onChange:i=>{var l,s;let a=(l=i==null?void 0:i.target)!=null&&l.value?Number((s=i==null?void 0:i.target)==null?void 0:s.value):null;a&&r(a);}})}var Bu=chunkIVDIW747_cjs_js.e(Tu__default.default)`
|
|
78
78
|
border-radius: 10px;
|
|
79
79
|
min-height: 42px;
|
|
80
80
|
min-width: 120px;
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
&:hover .MuiOutlinedInput-notchedOutline {
|
|
83
83
|
border-color: ${({theme:e})=>e.stigg.palette.outlinedBorder};
|
|
84
84
|
}
|
|
85
|
-
`,Au=
|
|
85
|
+
`,Au=chunkIVDIW747_cjs_js.e(Su__default.default)`
|
|
86
86
|
& .MuiInputBase-input {
|
|
87
87
|
padding: 10px 12px;
|
|
88
88
|
}
|
|
@@ -90,34 +90,34 @@
|
|
|
90
90
|
&.Mui-focused .MuiOutlinedInput-notchedOutline {
|
|
91
91
|
border-color: ${({theme:e})=>e.stigg.palette.primary} !important;
|
|
92
92
|
}
|
|
93
|
-
`;function Xa({value:e,componentId:t,tierUnits:o,tiers:r,handleChange:n,errorMessage:i}){return r?jsxRuntime.jsx(Bu,{value:e.toString(),fullWidth:true,error:!!i,onChange:a=>{var s,c;let l=(s=a==null?void 0:a.target)!=null&&s.value?Number((c=a==null?void 0:a.target)==null?void 0:c.value):null;l&&n(l);},id:t,input:jsxRuntime.jsx(Au,{}),MenuProps:{MenuListProps:{disablePadding:true},PaperProps:{sx:{marginTop:"4px",borderRadius:"10px"}}},children:wu__default.default(r,a=>{var l;return jsxRuntime.jsx(ku__default.default,{className:"stigg-price-tier-menu-item-text",value:(l=a.upTo)==null?void 0:l.toString(),children:jsxRuntime.jsxs(
|
|
93
|
+
`;function Xa({value:e,componentId:t,tierUnits:o,tiers:r,handleChange:n,errorMessage:i}){return r?jsxRuntime.jsx(Bu,{value:e.toString(),fullWidth:true,error:!!i,onChange:a=>{var s,c;let l=(s=a==null?void 0:a.target)!=null&&s.value?Number((c=a==null?void 0:a.target)==null?void 0:c.value):null;l&&n(l);},id:t,input:jsxRuntime.jsx(Au,{}),MenuProps:{MenuListProps:{disablePadding:true},PaperProps:{sx:{marginTop:"4px",borderRadius:"10px"}}},children:wu__default.default(r,a=>{var l;return jsxRuntime.jsx(ku__default.default,{className:"stigg-price-tier-menu-item-text",value:(l=a.upTo)==null?void 0:l.toString(),children:jsxRuntime.jsxs(chunkIVDIW747_cjs_js.f,{variant:"body1",color:"primary",style:{lineHeight:"unset"},children:[se(a.upTo)," ",o]})},a.upTo)})}):null}var vu=chunkIVDIW747_cjs_js.e(chunkIVDIW747_cjs_js.f)`
|
|
94
94
|
min-height: 46px;
|
|
95
|
-
`;function Kt(e){let{tiers:t,errorMessage:o}=e;return jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsxs(ke__default.default,{display:"flex",flexDirection:"column",justifyContent:"center",style:{width:"100%"},children:[jsxRuntime.jsx(vu,{as:"div",className:"stigg-price-tier-select",children:Wt(t)?jsxRuntime.jsx(Ja,
|
|
95
|
+
`;function Kt(e){let{tiers:t,errorMessage:o}=e;return jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsxs(ke__default.default,{display:"flex",flexDirection:"column",justifyContent:"center",style:{width:"100%"},children:[jsxRuntime.jsx(vu,{as:"div",className:"stigg-price-tier-select",children:Wt(t)?jsxRuntime.jsx(Ja,chunkIVDIW747_cjs_js.a({},e)):jsxRuntime.jsx(Xa,chunkIVDIW747_cjs_js.a({},e))}),jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{style:{margin:"4px"},variant:"caption",color:"error",children:o})]})})}var es="\u200E",Nu=chunkIVDIW747_cjs_js.e(chunkIVDIW747_cjs_js.f)`
|
|
96
96
|
word-break: break-word;
|
|
97
97
|
width: 100%;
|
|
98
|
-
`,Mu=
|
|
98
|
+
`,Mu=chunkIVDIW747_cjs_js.e(chunkIVDIW747_cjs_js.f)`
|
|
99
99
|
white-space: nowrap;
|
|
100
|
-
`,Ru=
|
|
100
|
+
`,Ru=chunkIVDIW747_cjs_js.e(chunkIVDIW747_cjs_js.f)`
|
|
101
101
|
white-space: normal;
|
|
102
102
|
min-height: 39px;
|
|
103
|
-
`;function Uu({plan:e,billingPeriod:t,hasMonthlyPrice:o,hasAnnuallyPrice:r,paywallLocale:n}){var l,s;let i=e.pricePoints.find(c=>c.billingPeriod===t),a=es;return i&&o&&r&&(a=((s=(l=n.price).billingPeriod)==null?void 0:s.call(l,t))||`, billed ${t.toLowerCase()}`),jsxRuntime.jsx(
|
|
103
|
+
`;function Uu({plan:e,billingPeriod:t,hasMonthlyPrice:o,hasAnnuallyPrice:r,paywallLocale:n}){var l,s;let i=e.pricePoints.find(c=>c.billingPeriod===t),a=es;return i&&o&&r&&(a=((s=(l=n.price).billingPeriod)==null?void 0:s.call(l,t))||`, billed ${t.toLowerCase()}`),jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{as:"span",className:"stigg-price-billing-period-text",variant:"h6",color:"secondary",children:a})}var ts=({showStartingAt:e,withUnitPriceRow:t,withStartingAtRow:o,withTiersRow:r,withCreditChargeRow:n,creditChargePrice:i,selectedCreditQuantity:a,setSelectedCreditQuantity:l,plan:s,billingPeriod:c,paywallLocale:u,locale:f,hasMonthlyPrice:y,hasAnnuallyPrice:p,perUnitQuantityByFeature:g,setPerUnitQuantityByFeature:h})=>{var w;let{price:P,unit:b,tiers:x,tierUnits:A}=Eo(s,c,u,f,y,g,a),S=s.pricePoints.find(I=>I.billingPeriod===c&&I.isTieredPrice&&!Ot(I)),F=S?S.feature.featureId:void 0,T=(w=g[F||""])!=null?w:1,k=I=>{F&&h(v=>chunkIVDIW747_cjs_js.b(chunkIVDIW747_cjs_js.a({},v),{[F]:I}));};return jsxRuntime.jsx(Nu,{as:"div",className:"stigg-price-text",children:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[o&&jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{style:{minHeight:"20px"},className:"stigg-starting-at-text",variant:"body1",color:"secondary",children:e?u.price.startingAtCaption:es}),jsxRuntime.jsx(Ru,{className:"stigg-price-point",variant:"h1",children:P}),t&&jsxRuntime.jsxs(chunkIVDIW747_cjs_js.f,{as:"div",className:"stigg-price-unit-and-billing-period-text",style:{minHeight:"48px"},children:[jsxRuntime.jsx(Mu,{className:"stigg-price-unit-text",as:"span",variant:"h6",color:"secondary",children:b}),jsxRuntime.jsx(Uu,{plan:s,billingPeriod:c,hasAnnuallyPrice:p,hasMonthlyPrice:y,paywallLocale:u})]}),r?jsxRuntime.jsx(Kt,{componentId:`${s.id}_${F}_tier`,tiers:x,tierUnits:A,tiersMode:S==null?void 0:S.tiersMode,handleChange:k,value:T}):null,n?i?jsxRuntime.jsx(Kt,{componentId:`${s.id}_${i.topUpCustomCurrencyId}_credit_tier`,tiers:i.tiers,tierUnits:Na(i),tiersMode:i.tiersMode,handleChange:l,value:a}):jsxRuntime.jsx("div",{style:{minHeight:"46px",opacity:0}}):null]})})};var Vu=chunkIVDIW747_cjs_js.e(fu__default.default)`
|
|
104
104
|
padding: 0px;
|
|
105
105
|
text-transform: none;
|
|
106
106
|
margin-left: 0px;
|
|
107
|
-
`,Ou=
|
|
107
|
+
`,Ou=chunkIVDIW747_cjs_js.e(chunkIVDIW747_cjs_js.f)`
|
|
108
108
|
font-size: 14px;
|
|
109
109
|
font-weight: 500;
|
|
110
|
-
`,Hu=
|
|
110
|
+
`,Hu=chunkIVDIW747_cjs_js.e.div`
|
|
111
111
|
width: 100%;
|
|
112
112
|
gap: 10px;
|
|
113
|
-
`,Wu=
|
|
113
|
+
`,Wu=chunkIVDIW747_cjs_js.e.div`
|
|
114
114
|
margin-top: 10px;
|
|
115
115
|
overflow: hidden;
|
|
116
116
|
display: flex;
|
|
117
117
|
flex-direction: column;
|
|
118
118
|
gap: 4px;
|
|
119
119
|
width: 100%;
|
|
120
|
-
`,Zu=
|
|
120
|
+
`,Zu=chunkIVDIW747_cjs_js.e.div`
|
|
121
121
|
display: flex;
|
|
122
122
|
flex-direction: row;
|
|
123
123
|
flex-wrap: nowrap;
|
|
@@ -126,26 +126,28 @@
|
|
|
126
126
|
padding: 8px 0px;
|
|
127
127
|
max-height: 44px;
|
|
128
128
|
gap: 16px;
|
|
129
|
-
`,Yu=
|
|
129
|
+
`,Yu=chunkIVDIW747_cjs_js.e(chunkIVDIW747_cjs_js.f)`
|
|
130
130
|
overflow: hidden;
|
|
131
|
-
font-feature-settings:
|
|
131
|
+
font-feature-settings:
|
|
132
|
+
'liga' off,
|
|
133
|
+
'clig' off;
|
|
132
134
|
text-overflow: ellipsis;
|
|
133
135
|
font-family: 'DM Sans';
|
|
134
136
|
letter-spacing: 0.15px;
|
|
135
137
|
white-space: nowrap;
|
|
136
138
|
min-width: 0;
|
|
137
139
|
flex-shrink: 1;
|
|
138
|
-
`,Qu=
|
|
140
|
+
`,Qu=chunkIVDIW747_cjs_js.e(chunkIVDIW747_cjs_js.i)`
|
|
139
141
|
width: 24px;
|
|
140
142
|
height: 24px;
|
|
141
143
|
color: ${({theme:e})=>e.stigg.palette.primary};
|
|
142
|
-
`,Ku=
|
|
144
|
+
`,Ku=chunkIVDIW747_cjs_js.e.div`
|
|
143
145
|
flex: 1;
|
|
144
146
|
min-width: 0;
|
|
145
|
-
`,qu=
|
|
147
|
+
`,qu=chunkIVDIW747_cjs_js.e.div`
|
|
146
148
|
margin-top: 16px;
|
|
147
149
|
display: flex;
|
|
148
|
-
`,An=4;function In({addons:e,paywallLocale:t}){let[o,r]=yi.useState(false);if(!e||e.length===0)return null;let n=e.filter(l=>{var s;return !((s=l.hiddenFromWidgets)!=null&&s.includes(jsClientSdk.WidgetType.Paywall))}),i=()=>{r(!o);},a=o?n:n.slice(0,An);return a.length===0?null:jsxRuntime.jsxs(Hu,{className:"stigg-compatible-addons-container",children:[jsxRuntime.jsx(
|
|
150
|
+
`,An=4;function In({addons:e,paywallLocale:t}){let[o,r]=yi.useState(false);if(!e||e.length===0)return null;let n=e.filter(l=>{var s;return !((s=l.hiddenFromWidgets)!=null&&s.includes(jsClientSdk.WidgetType.Paywall))}),i=()=>{r(!o);},a=o?n:n.slice(0,An);return a.length===0?null:jsxRuntime.jsxs(Hu,{className:"stigg-compatible-addons-container",children:[jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{className:"stigg-compatible-addons-header",color:"secondary",variant:"body1",bold:true,children:t.addonsTitle}),jsxRuntime.jsx(Wu,{className:"stigg-compatible-addons-list",children:a.map(l=>jsxRuntime.jsxs(Zu,{className:zu__default.default(`stigg-compatible-addon--${l.id}`,"stigg-compatible-addon-item"),children:[jsxRuntime.jsx(Qu,{icon:"Add",className:"stigg-compatible-addon-icon"}),jsxRuntime.jsx(Ku,{className:"stigg-compatible-addon-content",children:jsxRuntime.jsx(Yu,{variant:"body1",color:"primary",className:"stigg-compatible-addon-name",children:l.displayName})})]},l.id))}),n.length>An&&jsxRuntime.jsx(qu,{children:jsxRuntime.jsx(Vu,{variant:"text",onClick:i,children:jsxRuntime.jsx(Ou,{color:"primary.main",children:o?"Show less":`Show ${n.length-An} more`})})})]})}var tg="66px",og=chunkIVDIW747_cjs_js.e.div`
|
|
149
151
|
position: relative;
|
|
150
152
|
background-color: ${({theme:e,$isCurrentPlan:t})=>t?e.stigg.palette.backgroundHighlight:e.stigg.palette.backgroundPaper};
|
|
151
153
|
border: ${({theme:e,$isHighlighted:t})=>t?`3px solid ${e.stigg.palette.primary}`:`1px solid ${e.stigg.palette.outlinedBorder}`};
|
|
@@ -158,38 +160,38 @@
|
|
|
158
160
|
align-items: flex-start;
|
|
159
161
|
justify-content: flex-start;
|
|
160
162
|
position: relative;
|
|
161
|
-
`,rg=
|
|
163
|
+
`,rg=chunkIVDIW747_cjs_js.e.div`
|
|
162
164
|
margin-top: ${({$planHasEntitlements:e})=>e?"32px":"0px"};
|
|
163
|
-
`,ng=
|
|
165
|
+
`,ng=chunkIVDIW747_cjs_js.e(chunkIVDIW747_cjs_js.f)`
|
|
164
166
|
padding-bottom: 8px;
|
|
165
|
-
`,ig=
|
|
167
|
+
`,ig=chunkIVDIW747_cjs_js.e.div`
|
|
166
168
|
height: 2px;
|
|
167
169
|
width: 100%;
|
|
168
170
|
background-color: ${({theme:e})=>e.stigg.palette.outlinedBorder};
|
|
169
171
|
margin-bottom: 40px;
|
|
170
|
-
`,ag=
|
|
172
|
+
`,ag=chunkIVDIW747_cjs_js.e(chunkIVDIW747_cjs_js.f)`
|
|
171
173
|
text-align: ${({theme:e})=>e.stigg.layout.descriptionAlignment};
|
|
172
174
|
min-height: ${({theme:e})=>e.stigg.layout.descriptionMinHeight};
|
|
173
|
-
`,sg=
|
|
175
|
+
`,sg=chunkIVDIW747_cjs_js.e.div`
|
|
174
176
|
background-color: ${({theme:e})=>e.stigg.palette.primary};
|
|
175
177
|
border-radius: 40px;
|
|
176
178
|
position: absolute;
|
|
177
179
|
top: -12px;
|
|
178
|
-
`,lg=
|
|
180
|
+
`,lg=chunkIVDIW747_cjs_js.e(chunkIVDIW747_cjs_js.f)`
|
|
179
181
|
margin: 0;
|
|
180
182
|
padding: 2px 8px;
|
|
181
|
-
`,cg=
|
|
183
|
+
`,cg=chunkIVDIW747_cjs_js.e.div`
|
|
182
184
|
width: 100%;
|
|
183
185
|
display: flex;
|
|
184
186
|
flex-direction: column;
|
|
185
|
-
align-items: ${({theme:e})=>
|
|
186
|
-
`,dg=
|
|
187
|
+
align-items: ${({theme:e})=>chunkIVDIW747_cjs_js.j(e.stigg.layout.headerAlignment)};
|
|
188
|
+
`,dg=chunkIVDIW747_cjs_js.e.div`
|
|
187
189
|
position: absolute;
|
|
188
190
|
top: 0;
|
|
189
191
|
background-color: ${({theme:e})=>e.stigg.palette.outlinedBorder};
|
|
190
192
|
border-radius: 0px 0px 10px 10px;
|
|
191
193
|
padding: 3px 12px;
|
|
192
|
-
`,pg=
|
|
194
|
+
`,pg=chunkIVDIW747_cjs_js.e(chunkIVDIW747_cjs_js.g)`
|
|
193
195
|
display: flex;
|
|
194
196
|
height: 100%;
|
|
195
197
|
margin-right: 4px;
|
|
@@ -197,7 +199,7 @@
|
|
|
197
199
|
path {
|
|
198
200
|
fill: ${({theme:e})=>e.stigg.palette.text.primary};
|
|
199
201
|
}
|
|
200
|
-
`;function mg({text:e="Next",iconsColor:t}){return jsxRuntime.jsx(dg,{children:jsxRuntime.jsxs(Re__default.default,{display:"flex",alignItems:"center",gap:1,children:[jsxRuntime.jsx(pg,{$iconsColor:t}),jsxRuntime.jsx(
|
|
202
|
+
`;function mg({text:e="Next",iconsColor:t}){return jsxRuntime.jsx(dg,{children:jsxRuntime.jsxs(Re__default.default,{display:"flex",alignItems:"center",gap:1,children:[jsxRuntime.jsx(pg,{$iconsColor:t}),jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{color:"primary",variant:"body1",children:e})]})})}function ns({withUnitPriceRow:e,withTiersRow:t,withTrialLeftRow:o,withCreditChargeRow:r,customer:n,plan:i,billingPeriod:a,isHighlighted:l,currentSubscription:s,currentSubscriptionOverride:c,shouldShowDescriptionSection:u,hasMonthlyPrice:f,hasAnnuallyPrice:y,isCustomerOnTrial:p,onPlanSelected:g,paywallLocale:h,locale:P,withStartingAtRow:b,isCustomerInCustomPlan:x,selectDefaultTierIndex:A,hideCompatibleAddons:S}){var ut,V,ie;let F=i.isNextPlan&&i.isNextPlan(a),T=i.pricePoints.filter(ae=>ae.billingPeriod===a&&Ct(ae)),k=(ut=i.paywallCalculatedPricePoints)==null?void 0:ut.find(ae=>ae.billingPeriod===a),w=T.length>1&&!!(k!=null&&k.additionalChargesMayApply),I=!x||i.pricingType===jsClientSdk.PricingType.Custom,v=ko(i,a),L=v?wo(v):false,N=null;F?N=jsxRuntime.jsx(mg,{text:"Next plan"}):l&&h.highlightChip&&(N=jsxRuntime.jsx(sg,{className:"stigg-highlight-badge",children:jsxRuntime.jsx(lg,{className:"stigg-highlight-badge-text",color:"white",bold:true,children:h.highlightChip})}));let[$,R]=yi.useState(vo({plan:i,billingPeriod:a,currentSubscription:s,currentSubscriptionOverride:c,selectDefaultTierIndex:A})),[z,K]=yi.useState(()=>{var ae,ve;return ((ve=(ae=v==null?void 0:v.tiers)==null?void 0:ae[0])==null?void 0:ve.upTo)||1});yi.useEffect(()=>{var ae,ve;K(((ve=(ae=v==null?void 0:v.tiers)==null?void 0:ae[0])==null?void 0:ve.upTo)||1);},[a,v==null?void 0:v.tiers]);let Ve=ae=>{let ve=Object.keys($).map(gt=>({featureId:gt,quantity:$[gt]})),ho=v!=null&&v.topUpCustomCurrencyId?[{topUpCustomCurrencyId:v.topUpCustomCurrencyId,quantity:z}]:void 0;return g(ae,ve,ho)};return jsxRuntime.jsxs(og,{className:zu__default.default(`stigg-${i.id}`,"stigg-plan-offering-container",{"stigg-current-plan":i.isCurrentCustomerPlan}),$isHighlighted:l,$isCurrentPlan:i.isCurrentCustomerPlan,children:[N,jsxRuntime.jsxs(cg,{className:"stigg-header-wrapper",children:[jsxRuntime.jsx(ng,{className:"stigg-plan-header",variant:"h3",children:i.displayName}),u&&jsxRuntime.jsx(ag,{className:"stigg-plan-description",variant:"h6",color:"secondary",children:i.description}),jsxRuntime.jsx(ts,{showStartingAt:w,withUnitPriceRow:e,withStartingAtRow:b,withTiersRow:t,withCreditChargeRow:r,creditChargePrice:L?v:void 0,selectedCreditQuantity:z,setSelectedCreditQuantity:K,plan:i,billingPeriod:a,paywallLocale:h,locale:P,hasAnnuallyPrice:y,hasMonthlyPrice:f,setPerUnitQuantityByFeature:R,perUnitQuantityByFeature:$}),I?jsxRuntime.jsx(Za,{isNextPlan:F,customer:n,plan:i,currentSubscription:s,currentSubscriptionOverride:c,billingPeriod:a,isCustomerOnTrial:p,onPlanSelected:Ve,paywallLocale:h,withTrialLeftRow:o,perUnitQuantityByFeature:$}):jsxRuntime.jsx("div",{style:{height:tg}}),jsxRuntime.jsx(ig,{className:"stigg-plan-header-divider"})]}),jsxRuntime.jsx(_a,{plan:i,billingPeriod:a,paywallLocale:h,singleTierCreditCharge:L?void 0:v}),jsxRuntime.jsx(rg,{$planHasEntitlements:((ie=(V=i.packageEntitlements)==null?void 0:V.length)!=null?ie:0)>0,className:"stigg-addons-container",children:!S&&i.compatibleAddons&&i.compatibleAddons.length>0&&jsxRuntime.jsx(In,{addons:i.compatibleAddons,paywallLocale:h})})]})}var gg=chunkIVDIW747_cjs_js.e.div`
|
|
201
203
|
height: 40px;
|
|
202
204
|
padding: 0 20px;
|
|
203
205
|
margin-bottom: ${({theme:e})=>e.stigg.layout.switchBottomSpacing};
|
|
@@ -207,9 +209,9 @@
|
|
|
207
209
|
display: flex;
|
|
208
210
|
align-items: center;
|
|
209
211
|
justify-content: center;
|
|
210
|
-
`,is=
|
|
212
|
+
`,is=chunkIVDIW747_cjs_js.e(chunkIVDIW747_cjs_js.f)`
|
|
211
213
|
margin: 0 8px;
|
|
212
|
-
`,fg=
|
|
214
|
+
`,fg=chunkIVDIW747_cjs_js.e(ug__default.default)`
|
|
213
215
|
& .react-switch-bg {
|
|
214
216
|
border: ${({theme:e})=>`1px solid ${e.stigg.palette.switchBorder}`};
|
|
215
217
|
background: ${({theme:e})=>e.stigg.palette.switchFill} !important;
|
|
@@ -220,7 +222,7 @@
|
|
|
220
222
|
background: ${({theme:e})=>e.stigg.palette.switchHandle} !important;
|
|
221
223
|
top: 0.5px !important;
|
|
222
224
|
}
|
|
223
|
-
`;function yg({discount:e,disabled:t}){return jsxRuntime.jsxs(
|
|
225
|
+
`;function yg({discount:e,disabled:t}){return jsxRuntime.jsxs(chunkIVDIW747_cjs_js.f,{variant:"h6",color:t?"disabled":"primary",className:"stigg-discount-rate-text",children:[e,"% off"]})}function as({discountRate:e,selectedBillingPeriod:t,onBillingPeriodChanged:o,availableBillingPeriods:r}){if(r.length<=1)return null;let n=t===jsClientSdk.BillingPeriod.Monthly;return jsxRuntime.jsxs(gg,{className:"stigg-period-picker-container",children:[jsxRuntime.jsx(is,{variant:"h6",className:"stigg-monthly-period-text",color:n?"primary":"disabled",children:"Monthly"}),jsxRuntime.jsx(fg,{className:"stigg-period-switch",uncheckedIcon:false,checkedIcon:false,height:16,width:33,onChange:i=>o(i?jsClientSdk.BillingPeriod.Annually:jsClientSdk.BillingPeriod.Monthly),checked:!n,borderRadius:10,handleDiameter:19}),jsxRuntime.jsx(is,{variant:"h6",className:"stigg-annual-period-text",color:n?"disabled":"primary",children:"Annual"}),e!==0&&jsxRuntime.jsx(yg,{discount:e,disabled:n})]})}function hg(e,t){if(!Fo__default.default(e)&&!Fo__default.default(t)){let o=t/12;return Math.round((e-o)/e*100)}return null}function ds(e,t){var r;let o;if(o=(r=e.paywallCalculatedPricePoints)==null?void 0:r.find(n=>n.billingPeriod===t),o||(o=e.pricePoints.find(n=>n.billingPeriod===t)),!(o!=null&&o.amount)){let n=e.pricePoints.find(i=>i.isTieredPrice&&i.billingPeriod===t);if(n)return xt(n,1)}return o==null?void 0:o.amount}function ps(e){return e.reduce((t,o)=>{let r=ds(o,jsClientSdk.BillingPeriod.Monthly),n=ds(o,jsClientSdk.BillingPeriod.Annually),i=hg(r,n);return i&&(t=Math.max(t,i)),t},0)}function En(e,t){return e.pricePoints.some(o=>o.billingPeriod===t)}function Ln(e,t){return e.some(o=>En(o,t))}function ms(e,t,o){return e.filter(r=>r.pricingType!==jsClientSdk.PricingType.Paid||En(r,t)).filter(r=>!o||!o({plan:r}))}var bg=chunkIVDIW747_cjs_js.e.div`
|
|
224
226
|
color: ${({theme:e})=>e.stigg.palette.text.primary};
|
|
225
227
|
display: flex;
|
|
226
228
|
align-items: stretch;
|
|
@@ -228,7 +230,7 @@
|
|
|
228
230
|
flex-wrap: wrap;
|
|
229
231
|
padding: 10px 0;
|
|
230
232
|
gap: ${({theme:e})=>e.stigg.layout.planMargin};
|
|
231
|
-
`,Sg=
|
|
233
|
+
`,Sg=chunkIVDIW747_cjs_js.e.div`
|
|
232
234
|
display: flex;
|
|
233
235
|
flex-direction: column;
|
|
234
236
|
align-items: center;
|
|
@@ -236,17 +238,17 @@
|
|
|
236
238
|
& * {
|
|
237
239
|
box-sizing: border-box;
|
|
238
240
|
}
|
|
239
|
-
`,Tg=
|
|
241
|
+
`,Tg=chunkIVDIW747_cjs_js.e.div`
|
|
240
242
|
display: flex;
|
|
241
243
|
flex-direction: column;
|
|
242
244
|
align-items: center;
|
|
243
|
-
`,gs=({plans:e,customer:t,currentSubscription:o,highlightedPlanId:r,selectedBillingPeriod:n,onBillingPeriodChanged:i,availableBillingPeriods:a,isCustomerOnTrial:l,onPlanSelected:s,paywallLocale:c,locale:u,shouldHidePlan:f,selectDefaultTierIndex:y,currentSubscriptionOverride:p,hideCompatibleAddons:g,showWatermark:h})=>{let P=ps(e),b=e.some(N=>!!N.description),x=Ln(e,jsClientSdk.BillingPeriod.Monthly),A=Ln(e,jsClientSdk.BillingPeriod.Annually),S=ms(e,n,f),F=yi.useCallback((N,$,R,z)=>s({plan:N,customer:t,subscription:o,intentionType:$,selectedBillingPeriod:n,billableFeatures:R,billableCredits:z}),[t,n,o,s]),T=!!o&&o.plan.pricingType===jsClientSdk.PricingType.Custom,k=yi.useMemo(()=>S.some(N=>{var z;let $=N.pricePoints.filter(K=>K.billingPeriod===n),R=(z=N.paywallCalculatedPricePoints)==null?void 0:z.find(K=>K.billingPeriod===n);return $.length>1&&!!(R!=null&&R.additionalChargesMayApply)}),[n,S]),w=yi.useMemo(()=>S.some(N=>!!Eo(N,n,c,u,x).unit),[n,x,u,c,S]),I=yi.useMemo(()=>!T&&S.some(N=>{let $=vo({plan:N,billingPeriod:n,currentSubscription:o,currentSubscriptionOverride:p});return Object.values($).length>0}),[n,o,p,T,S]),v=S.some(N=>N.isCurrentCustomerPlan&&N.trialDaysLeft),L=yi.useMemo(()=>S.some(N=>{let $=ko(N,n);return !!$&&wo($)}),[n,S]);return jsxRuntime.jsx(Sg,{className:"stigg-paywall-container",children:jsxRuntime.jsxs(Tg,{className:"stigg-paywall-layout",children:[jsxRuntime.jsx(as,{onBillingPeriodChanged:i,selectedBillingPeriod:n,availableBillingPeriods:a,discountRate:P}),jsxRuntime.jsx(bg,{className:"stigg-paywall-plans-layout",children:S.map(N=>jsxRuntime.jsx(ns,{withUnitPriceRow:w,withTiersRow:I,withTrialLeftRow:v,withCreditChargeRow:L,shouldShowDescriptionSection:b,hasMonthlyPrice:x,hasAnnuallyPrice:A,plan:N,withStartingAtRow:k,currentSubscription:o,currentSubscriptionOverride:p,billingPeriod:n,isHighlighted:N.id===r,isCustomerOnTrial:l,onPlanSelected:($,R,z)=>F(N,$,R,z),paywallLocale:c,locale:u,customer:t,isCustomerInCustomPlan:T,selectDefaultTierIndex:y,hideCompatibleAddons:g},N.id))}),jsxRuntime.jsx(chunkYAS4WG6F_cjs_js.q,{source:"paywall",align:"end",style:{marginTop:16},showWatermark:h})]})})};function fs(e,t,o){let r=e.flatMap(l=>l.pricePoints).map(l=>l.billingPeriod),n=Bg__default.default(r),i=Ag__default.default(r),a;if(o&&i.includes(o))a=o;else if(t){let l=t.find(s=>s.status===jsClientSdk.SubscriptionStatus.Active);l&&l.prices.length>0&&(a=l==null?void 0:l.prices[0].billingPeriod);}return a||(a=(n[jsClientSdk.BillingPeriod.Monthly]||0)>(n[jsClientSdk.BillingPeriod.Annually]||0)?jsClientSdk.BillingPeriod.Monthly:jsClientSdk.BillingPeriod.Annually),{defaultBillingPeriod:a,availableBillingPeriods:i}}function ys(e){return Z.utc(e).diff(Z.utc(),"days",false)+1}var Ro={h1:{fontSize:"24px",fontWeight:"bold",semanticElement:"h1"},h2:{fontSize:"16px",fontWeight:"normal",semanticElement:"h2"},h3:{fontSize:"16px",fontWeight:"normal",semanticElement:"h3"},body:{fontSize:"14px",fontWeight:"normal",semanticElement:"p"}};function qe(e,t="px"){if(e)return `${e}${t}`}function Uo(e){if(!e)return "normal";switch(e){case jsClientSdk.FontWeight.Normal:return "normal";case jsClientSdk.FontWeight.Bold:return "bold";default:return "normal"}}function Jt(e,t){var r,n,i,a,l,s,c,u;let o=t||{h1:{fontSize:"32px",fontWeight:"bold",semanticElement:"h1"},h2:{fontSize:"24px",fontWeight:"normal",semanticElement:"h2"},h3:{fontSize:"16px",fontWeight:"normal",semanticElement:"h3"},body:{fontSize:"14px",fontWeight:"normal",semanticElement:"p"}};return {fontFamilyUrl:(e==null?void 0:e.fontFamily)||void 0,h1:{fontSize:qe((r=e==null?void 0:e.h1)==null?void 0:r.fontSize)||o.h1.fontSize,fontWeight:Uo((n=e==null?void 0:e.h1)==null?void 0:n.fontWeight)||o.h1.fontWeight,semanticElement:o.h1.semanticElement},h2:{fontSize:qe((i=e==null?void 0:e.h2)==null?void 0:i.fontSize)||o.h2.fontSize,fontWeight:Uo((a=e==null?void 0:e.h2)==null?void 0:a.fontWeight)||o.h2.fontWeight,semanticElement:o.h2.semanticElement},h3:{fontSize:qe((l=e==null?void 0:e.h3)==null?void 0:l.fontSize)||o.h3.fontSize,fontWeight:Uo((s=e==null?void 0:e.h3)==null?void 0:s.fontWeight)||o.h3.fontWeight,semanticElement:o.h3.semanticElement},body:{fontSize:qe((c=e==null?void 0:e.body)==null?void 0:c.fontSize)||o.body.fontSize,fontWeight:Uo((u=e==null?void 0:e.body)==null?void 0:u.fontWeight)||o.body.fontWeight,semanticElement:o.body.semanticElement}}}function Mn(e){if(e)switch(e){case jsClientSdk.Alignment.Left:return "left";case jsClientSdk.Alignment.Center:return "center";case jsClientSdk.Alignment.Right:return "right";default:return}}function Cs(e){let{palette:t,customCss:o,typography:r}=e;return {palette:{primary:(t==null?void 0:t.primary)||void 0,backgroundPaper:(t==null?void 0:t.paywallBackgroundColor)||void 0,outlinedBorder:(t==null?void 0:t.borderColor)||void 0,backgroundHighlight:(t==null?void 0:t.currentPlanBackground)||void 0,text:{primary:(t==null?void 0:t.textColor)||void 0}},typography:Jt(r),customCss:o||void 0}}function Ps(e){let{palette:t,layout:o,customCss:r,typography:n}=e;return {customCss:r||void 0,palette:{primary:(t==null?void 0:t.primary)||void 0,backgroundPaper:(t==null?void 0:t.backgroundColor)||void 0,outlinedBorder:(t==null?void 0:t.borderColor)||void 0,backgroundHighlight:(t==null?void 0:t.currentPlanBackground)||void 0,text:{primary:(t==null?void 0:t.textColor)||void 0}},typography:Jt(n),layout:{ctaAlignment:Mn(o==null?void 0:o.alignment),headerAlignment:Mn(o==null?void 0:o.alignment),descriptionAlignment:Mn(o==null?void 0:o.alignment),planMaxWidth:qe(o==null?void 0:o.planWidth),planMinWidth:qe(o==null?void 0:o.planWidth),planMargin:qe(o==null?void 0:o.planMargin),planPadding:qe(o==null?void 0:o.planPadding)}}}function xs(e){let{palette:t,typography:o,customCss:r}=e;return {palette:{primary:(t==null?void 0:t.primary)||void 0,backgroundPaper:(t==null?void 0:t.backgroundColor)||void 0,outlinedBorder:(t==null?void 0:t.borderColor)||void 0,text:{primary:(t==null?void 0:t.textColor)||void 0},backgroundHighlight:(t==null?void 0:t.summaryBackgroundColor)||void 0},typography:Jt(o,Ro),customCss:r||void 0}}function Fg(e){let t=true,o=(e==null?void 0:e.find(i=>i.status===jsClientSdk.SubscriptionStatus.InTrial))||null,r=o==null?void 0:o.plan,n=o!=null&&o.trialEndDate?ys(o.trialEndDate):void 0;return r||(t=false,o=(e==null?void 0:e.find(i=>i.status===jsClientSdk.SubscriptionStatus.Active))||null,r=o==null?void 0:o.plan),{currentSubscription:o,currentPlan:r,isCustomerOnTrial:t,trialDaysLeft:n}}function ks(e,t,o){var S,F;let{plans:r,currency:n,configuration:i,customer:a,activeSubscriptions:l,paywallCalculatedPricePoints:s}=e||{},{currentSubscription:c,currentPlan:u,isCustomerOnTrial:f,trialDaysLeft:y}=Fg(l),p=o==null?void 0:o({currentSubscription:c}),g=(c==null?void 0:c.scheduledUpdates)||[],h=(S=c==null?void 0:c.price)==null?void 0:S.billingPeriod,P=g.find(({subscriptionScheduleType:T})=>T===jsClientSdk.SubscriptionScheduleType.Downgrade),b=g.find(({subscriptionScheduleType:T})=>T===jsClientSdk.SubscriptionScheduleType.BillingPeriod),x=ac__default.default(r,T=>T.order).map(T=>{var v;let k=(v=a==null?void 0:a.eligibleForTrial)==null?void 0:v.find(L=>L.productId===T.product.id),w=p!=null&&p.planId?(p==null?void 0:p.planId)===T.id:T.id===(u==null?void 0:u.id),I=L=>{var z;let N=P==null?void 0:P.scheduleVariables,$=b==null?void 0:b.scheduleVariables,R=T.pricePoints.some(K=>K.billingPeriod===L);return P?((z=P.targetPackage)==null?void 0:z.refId)===T.id&&(!R||N.billingPeriod===L):b&&w?$.billingPeriod===L:false};return chunkYAS4WG6F_cjs_js.b(chunkYAS4WG6F_cjs_js.a({},T),{paywallCalculatedPricePoints:s==null?void 0:s.filter(L=>L.planId===T.id),isTriable:!Fo__default.default(T.defaultTrialConfig)&&(!k||k.eligible),isCurrentCustomerPlan:w,currentCustomerPlanBillingPeriod:h,isUpcomingPlan:false,trialDaysLeft:y,isNextPlan:I,paywallCurrency:n,scheduledUpdate:P||b})});if(r&&u){let T=u&&((F=r==null?void 0:r.find(k=>k.id===(u==null?void 0:u.id)))==null?void 0:F.order);Fo__default.default(T)||(x=x.map(k=>chunkYAS4WG6F_cjs_js.b(chunkYAS4WG6F_cjs_js.a({},k),{isLowerThanCurrentPlan:T>k.order})),t&&(x=x.filter(k=>k.order>=T)));}let A=i?Ps(i):void 0;return {currentPlan:u,currentSubscription:c,currentSubscriptionOverride:p,isCustomerOnTrial:f,plans:x,paywallConfiguration:A}}function ws({productId:e,resourceId:t,showOnlyEligiblePlans:o,billingCountryCode:r,preferredBillingPeriod:n,currentSubscriptionOverrideFn:i}){let{stigg:a,locale:l}=chunkYAS4WG6F_cjs_js.u(),[s,c]=yi.useState(jsClientSdk.BillingPeriod.Annually),[u,f]=yi.useState([]),[y,p]=yi.useState(null),[g,h]=yi.useState(true);yi.useEffect(()=>{chunkYAS4WG6F_cjs_js.d(null,null,function*(){try{h(!0),yield a.waitForInitialization();let x=yield a.getPaywall({productId:e,resourceId:t,billingCountryCode:r}),{availableBillingPeriods:A,defaultBillingPeriod:S}=fs(x.plans,x.activeSubscriptions,n);p(x),f(A),c(S);}catch(x){chunkYAS4WG6F_cjs_js.r.error(`Failed to load paywall ${x==null?void 0:x.message}`,x);}finally{h(false);}});},[a,e,a.isCustomerLoaded,r,t,n]);let P=ks(y,o,i);return chunkYAS4WG6F_cjs_js.a({customer:(y==null?void 0:y.customer)||null,isLoading:g,selectedBillingPeriod:s,setSelectedBillingPeriod:c,availableBillingPeriods:u,locale:l,configuration:P.paywallConfiguration,showWatermark:a.getShowWatermark()},P)}function As(e){return Lg__default.default({highlightChip:"Recommended",addonsTitle:"Available add-ons:",planCTAButton:{upgrade:"Upgrade",downgrade:"Downgrade",startTrial:o=>{var r;return `Start ${(r=o.defaultTrialConfig)==null?void 0:r.duration} day trial`},custom:"Contact us",currentPlan:"Current plan",startNew:"Get started",switchToBillingPeriod:o=>o===jsClientSdk.BillingPeriod.Monthly?"Switch to monthly billing":"Switch to annual billing",cancelScheduledUpdate:"Cancel"},price:{startingAtCaption:"Starts at",pricePeriod:o=>o===jsClientSdk.BillingPeriod.Monthly?"/ month":"/ year",free:o=>({price:`${o==null?void 0:o.symbol}0`}),custom:"Custom",priceNotSet:"Price not set"}},e)}var Ng=e=>jsxRuntime.jsx("svg",chunkYAS4WG6F_cjs_js.b(chunkYAS4WG6F_cjs_js.a({width:15,height:11,viewBox:"0 0 15 11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:jsxRuntime.jsx("path",{d:"M5.59 7.9899L2.125 4.5249C1.73524 4.13514 1.10365 4.13402 0.712509 4.52241V4.52241C0.319409 4.91274 0.318286 5.54819 0.710005 5.9399L5.59 10.8199L14.2948 2.11513C14.6843 1.72565 14.6843 1.09417 14.2948 0.704691V0.704691C13.9055 0.315381 13.2743 0.315184 12.8848 0.70425L5.59 7.9899Z",fill:"#B2BBD3"})})),Fs=Ng;var Mg=chunkYAS4WG6F_cjs_js.e.div`
|
|
245
|
+
`,gs=({plans:e,customer:t,currentSubscription:o,highlightedPlanId:r,selectedBillingPeriod:n,onBillingPeriodChanged:i,availableBillingPeriods:a,isCustomerOnTrial:l,onPlanSelected:s,paywallLocale:c,locale:u,shouldHidePlan:f,selectDefaultTierIndex:y,currentSubscriptionOverride:p,hideCompatibleAddons:g,showWatermark:h})=>{let P=ps(e),b=e.some(N=>!!N.description),x=Ln(e,jsClientSdk.BillingPeriod.Monthly),A=Ln(e,jsClientSdk.BillingPeriod.Annually),S=ms(e,n,f),F=yi.useCallback((N,$,R,z)=>s({plan:N,customer:t,subscription:o,intentionType:$,selectedBillingPeriod:n,billableFeatures:R,billableCredits:z}),[t,n,o,s]),T=!!o&&o.plan.pricingType===jsClientSdk.PricingType.Custom,k=yi.useMemo(()=>S.some(N=>{var z;let $=N.pricePoints.filter(K=>K.billingPeriod===n),R=(z=N.paywallCalculatedPricePoints)==null?void 0:z.find(K=>K.billingPeriod===n);return $.length>1&&!!(R!=null&&R.additionalChargesMayApply)}),[n,S]),w=yi.useMemo(()=>S.some(N=>!!Eo(N,n,c,u,x).unit),[n,x,u,c,S]),I=yi.useMemo(()=>!T&&S.some(N=>{let $=vo({plan:N,billingPeriod:n,currentSubscription:o,currentSubscriptionOverride:p});return Object.values($).length>0}),[n,o,p,T,S]),v=S.some(N=>N.isCurrentCustomerPlan&&N.trialDaysLeft),L=yi.useMemo(()=>S.some(N=>{let $=ko(N,n);return !!$&&wo($)}),[n,S]);return jsxRuntime.jsx(Sg,{className:"stigg-paywall-container",children:jsxRuntime.jsxs(Tg,{className:"stigg-paywall-layout",children:[jsxRuntime.jsx(as,{onBillingPeriodChanged:i,selectedBillingPeriod:n,availableBillingPeriods:a,discountRate:P}),jsxRuntime.jsx(bg,{className:"stigg-paywall-plans-layout",children:S.map(N=>jsxRuntime.jsx(ns,{withUnitPriceRow:w,withTiersRow:I,withTrialLeftRow:v,withCreditChargeRow:L,shouldShowDescriptionSection:b,hasMonthlyPrice:x,hasAnnuallyPrice:A,plan:N,withStartingAtRow:k,currentSubscription:o,currentSubscriptionOverride:p,billingPeriod:n,isHighlighted:N.id===r,isCustomerOnTrial:l,onPlanSelected:($,R,z)=>F(N,$,R,z),paywallLocale:c,locale:u,customer:t,isCustomerInCustomPlan:T,selectDefaultTierIndex:y,hideCompatibleAddons:g},N.id))}),jsxRuntime.jsx(chunkIVDIW747_cjs_js.q,{source:"paywall",align:"end",style:{marginTop:16},showWatermark:h})]})})};function fs(e,t,o){let r=e.flatMap(l=>l.pricePoints).map(l=>l.billingPeriod),n=Bg__default.default(r),i=Ag__default.default(r),a;if(o&&i.includes(o))a=o;else if(t){let l=t.find(s=>s.status===jsClientSdk.SubscriptionStatus.Active);l&&l.prices.length>0&&(a=l==null?void 0:l.prices[0].billingPeriod);}return a||(a=(n[jsClientSdk.BillingPeriod.Monthly]||0)>(n[jsClientSdk.BillingPeriod.Annually]||0)?jsClientSdk.BillingPeriod.Monthly:jsClientSdk.BillingPeriod.Annually),{defaultBillingPeriod:a,availableBillingPeriods:i}}function ys(e){return Z.utc(e).diff(Z.utc(),"days",false)+1}var Ro={h1:{fontSize:"24px",fontWeight:"bold",semanticElement:"h1"},h2:{fontSize:"16px",fontWeight:"normal",semanticElement:"h2"},h3:{fontSize:"16px",fontWeight:"normal",semanticElement:"h3"},body:{fontSize:"14px",fontWeight:"normal",semanticElement:"p"}};function qe(e,t="px"){if(e)return `${e}${t}`}function Uo(e){if(!e)return "normal";switch(e){case jsClientSdk.FontWeight.Normal:return "normal";case jsClientSdk.FontWeight.Bold:return "bold";default:return "normal"}}function Jt(e,t){var r,n,i,a,l,s,c,u;let o=t||{h1:{fontSize:"32px",fontWeight:"bold",semanticElement:"h1"},h2:{fontSize:"24px",fontWeight:"normal",semanticElement:"h2"},h3:{fontSize:"16px",fontWeight:"normal",semanticElement:"h3"},body:{fontSize:"14px",fontWeight:"normal",semanticElement:"p"}};return {fontFamilyUrl:(e==null?void 0:e.fontFamily)||void 0,h1:{fontSize:qe((r=e==null?void 0:e.h1)==null?void 0:r.fontSize)||o.h1.fontSize,fontWeight:Uo((n=e==null?void 0:e.h1)==null?void 0:n.fontWeight)||o.h1.fontWeight,semanticElement:o.h1.semanticElement},h2:{fontSize:qe((i=e==null?void 0:e.h2)==null?void 0:i.fontSize)||o.h2.fontSize,fontWeight:Uo((a=e==null?void 0:e.h2)==null?void 0:a.fontWeight)||o.h2.fontWeight,semanticElement:o.h2.semanticElement},h3:{fontSize:qe((l=e==null?void 0:e.h3)==null?void 0:l.fontSize)||o.h3.fontSize,fontWeight:Uo((s=e==null?void 0:e.h3)==null?void 0:s.fontWeight)||o.h3.fontWeight,semanticElement:o.h3.semanticElement},body:{fontSize:qe((c=e==null?void 0:e.body)==null?void 0:c.fontSize)||o.body.fontSize,fontWeight:Uo((u=e==null?void 0:e.body)==null?void 0:u.fontWeight)||o.body.fontWeight,semanticElement:o.body.semanticElement}}}function Mn(e){if(e)switch(e){case jsClientSdk.Alignment.Left:return "left";case jsClientSdk.Alignment.Center:return "center";case jsClientSdk.Alignment.Right:return "right";default:return}}function Cs(e){let{palette:t,customCss:o,typography:r}=e;return {palette:{primary:(t==null?void 0:t.primary)||void 0,backgroundPaper:(t==null?void 0:t.paywallBackgroundColor)||void 0,outlinedBorder:(t==null?void 0:t.borderColor)||void 0,backgroundHighlight:(t==null?void 0:t.currentPlanBackground)||void 0,text:{primary:(t==null?void 0:t.textColor)||void 0}},typography:Jt(r),customCss:o||void 0}}function Ps(e){let{palette:t,layout:o,customCss:r,typography:n}=e;return {customCss:r||void 0,palette:{primary:(t==null?void 0:t.primary)||void 0,backgroundPaper:(t==null?void 0:t.backgroundColor)||void 0,outlinedBorder:(t==null?void 0:t.borderColor)||void 0,backgroundHighlight:(t==null?void 0:t.currentPlanBackground)||void 0,text:{primary:(t==null?void 0:t.textColor)||void 0}},typography:Jt(n),layout:{ctaAlignment:Mn(o==null?void 0:o.alignment),headerAlignment:Mn(o==null?void 0:o.alignment),descriptionAlignment:Mn(o==null?void 0:o.alignment),planMaxWidth:qe(o==null?void 0:o.planWidth),planMinWidth:qe(o==null?void 0:o.planWidth),planMargin:qe(o==null?void 0:o.planMargin),planPadding:qe(o==null?void 0:o.planPadding)}}}function xs(e){let{palette:t,typography:o,customCss:r}=e;return {palette:{primary:(t==null?void 0:t.primary)||void 0,backgroundPaper:(t==null?void 0:t.backgroundColor)||void 0,outlinedBorder:(t==null?void 0:t.borderColor)||void 0,text:{primary:(t==null?void 0:t.textColor)||void 0},backgroundHighlight:(t==null?void 0:t.summaryBackgroundColor)||void 0},typography:Jt(o,Ro),customCss:r||void 0}}function Fg(e){let t=true,o=(e==null?void 0:e.find(i=>i.status===jsClientSdk.SubscriptionStatus.InTrial))||null,r=o==null?void 0:o.plan,n=o!=null&&o.trialEndDate?ys(o.trialEndDate):void 0;return r||(t=false,o=(e==null?void 0:e.find(i=>i.status===jsClientSdk.SubscriptionStatus.Active))||null,r=o==null?void 0:o.plan),{currentSubscription:o,currentPlan:r,isCustomerOnTrial:t,trialDaysLeft:n}}function ks(e,t,o){var S,F;let{plans:r,currency:n,configuration:i,customer:a,activeSubscriptions:l,paywallCalculatedPricePoints:s}=e||{},{currentSubscription:c,currentPlan:u,isCustomerOnTrial:f,trialDaysLeft:y}=Fg(l),p=o==null?void 0:o({currentSubscription:c}),g=(c==null?void 0:c.scheduledUpdates)||[],h=(S=c==null?void 0:c.price)==null?void 0:S.billingPeriod,P=g.find(({subscriptionScheduleType:T})=>T===jsClientSdk.SubscriptionScheduleType.Downgrade),b=g.find(({subscriptionScheduleType:T})=>T===jsClientSdk.SubscriptionScheduleType.BillingPeriod),x=ac__default.default(r,T=>T.order).map(T=>{var v;let k=(v=a==null?void 0:a.eligibleForTrial)==null?void 0:v.find(L=>L.productId===T.product.id),w=p!=null&&p.planId?(p==null?void 0:p.planId)===T.id:T.id===(u==null?void 0:u.id),I=L=>{var z;let N=P==null?void 0:P.scheduleVariables,$=b==null?void 0:b.scheduleVariables,R=T.pricePoints.some(K=>K.billingPeriod===L);return P?((z=P.targetPackage)==null?void 0:z.refId)===T.id&&(!R||N.billingPeriod===L):b&&w?$.billingPeriod===L:false};return chunkIVDIW747_cjs_js.b(chunkIVDIW747_cjs_js.a({},T),{paywallCalculatedPricePoints:s==null?void 0:s.filter(L=>L.planId===T.id),isTriable:!Fo__default.default(T.defaultTrialConfig)&&(!k||k.eligible),isCurrentCustomerPlan:w,currentCustomerPlanBillingPeriod:h,isUpcomingPlan:false,trialDaysLeft:y,isNextPlan:I,paywallCurrency:n,scheduledUpdate:P||b})});if(r&&u){let T=u&&((F=r==null?void 0:r.find(k=>k.id===(u==null?void 0:u.id)))==null?void 0:F.order);Fo__default.default(T)||(x=x.map(k=>chunkIVDIW747_cjs_js.b(chunkIVDIW747_cjs_js.a({},k),{isLowerThanCurrentPlan:T>k.order})),t&&(x=x.filter(k=>k.order>=T)));}let A=i?Ps(i):void 0;return {currentPlan:u,currentSubscription:c,currentSubscriptionOverride:p,isCustomerOnTrial:f,plans:x,paywallConfiguration:A}}function ws({productId:e,resourceId:t,showOnlyEligiblePlans:o,billingCountryCode:r,preferredBillingPeriod:n,currentSubscriptionOverrideFn:i}){let{stigg:a,locale:l}=chunkIVDIW747_cjs_js.u(),[s,c]=yi.useState(jsClientSdk.BillingPeriod.Annually),[u,f]=yi.useState([]),[y,p]=yi.useState(null),[g,h]=yi.useState(true);yi.useEffect(()=>{chunkIVDIW747_cjs_js.d(null,null,function*(){try{h(!0),yield a.waitForInitialization();let x=yield a.getPaywall({productId:e,resourceId:t,billingCountryCode:r}),{availableBillingPeriods:A,defaultBillingPeriod:S}=fs(x.plans,x.activeSubscriptions,n);p(x),f(A),c(S);}catch(x){chunkIVDIW747_cjs_js.r.error(`Failed to load paywall ${x==null?void 0:x.message}`,x);}finally{h(false);}});},[a,e,a.isCustomerLoaded,r,t,n]);let P=ks(y,o,i);return chunkIVDIW747_cjs_js.a({customer:(y==null?void 0:y.customer)||null,isLoading:g,selectedBillingPeriod:s,setSelectedBillingPeriod:c,availableBillingPeriods:u,locale:l,configuration:P.paywallConfiguration,showWatermark:a.getShowWatermark()},P)}function As(e){return Lg__default.default({highlightChip:"Recommended",addonsTitle:"Available add-ons:",planCTAButton:{upgrade:"Upgrade",downgrade:"Downgrade",startTrial:o=>{var r;return `Start ${(r=o.defaultTrialConfig)==null?void 0:r.duration} day trial`},custom:"Contact us",currentPlan:"Current plan",startNew:"Get started",switchToBillingPeriod:o=>o===jsClientSdk.BillingPeriod.Monthly?"Switch to monthly billing":"Switch to annual billing",cancelScheduledUpdate:"Cancel"},price:{startingAtCaption:"Starts at",pricePeriod:o=>o===jsClientSdk.BillingPeriod.Monthly?"/ month":"/ year",free:o=>({price:`${o==null?void 0:o.symbol}0`}),custom:"Custom",priceNotSet:"Price not set"}},e)}var Ng=e=>jsxRuntime.jsx("svg",chunkIVDIW747_cjs_js.b(chunkIVDIW747_cjs_js.a({width:15,height:11,viewBox:"0 0 15 11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:jsxRuntime.jsx("path",{d:"M5.59 7.9899L2.125 4.5249C1.73524 4.13514 1.10365 4.13402 0.712509 4.52241V4.52241C0.319409 4.91274 0.318286 5.54819 0.710005 5.9399L5.59 10.8199L14.2948 2.11513C14.6843 1.72565 14.6843 1.09417 14.2948 0.704691V0.704691C13.9055 0.315381 13.2743 0.315184 12.8848 0.70425L5.59 7.9899Z",fill:"#B2BBD3"})})),Fs=Ng;var Mg=chunkIVDIW747_cjs_js.e.div`
|
|
244
246
|
display: flex;
|
|
245
247
|
flex-direction: column;
|
|
246
248
|
align-items: center;
|
|
247
|
-
`,Rn=
|
|
249
|
+
`,Rn=chunkIVDIW747_cjs_js.e(Fs)`
|
|
248
250
|
margin-right: 16px;
|
|
249
|
-
`,Rg=
|
|
251
|
+
`,Rg=chunkIVDIW747_cjs_js.e.div`
|
|
250
252
|
display: flex;
|
|
251
253
|
flex-direction: column;
|
|
252
254
|
align-items: flex-start;
|
|
@@ -258,25 +260,25 @@
|
|
|
258
260
|
max-width: ${({theme:e})=>e.stigg.layout.planMaxWidth};
|
|
259
261
|
min-height: 450px;
|
|
260
262
|
border: ${({theme:e})=>`1px solid ${e.stigg.palette.outlinedBorder}`};
|
|
261
|
-
`,Ug=
|
|
263
|
+
`,Ug=chunkIVDIW747_cjs_js.e.div`
|
|
262
264
|
display: flex;
|
|
263
265
|
gap: ${({theme:e})=>e.stigg.layout.planMargin};
|
|
264
266
|
flex-wrap: wrap;
|
|
265
267
|
justify-content: center;
|
|
266
|
-
`,Un=
|
|
268
|
+
`,Un=chunkIVDIW747_cjs_js.e.div`
|
|
267
269
|
display: flex;
|
|
268
270
|
align-items: center;
|
|
269
271
|
margin-bottom: 12px;
|
|
270
|
-
`,_g=
|
|
272
|
+
`,_g=chunkIVDIW747_cjs_js.e.div`
|
|
271
273
|
margin-top: auto;
|
|
272
|
-
`,Dg=
|
|
274
|
+
`,Dg=chunkIVDIW747_cjs_js.e.div`
|
|
273
275
|
width: 150px;
|
|
274
276
|
margin-bottom: ${({theme:e})=>e.stigg.layout.switchBottomSpacing};
|
|
275
277
|
padding: 12px 12px;
|
|
276
278
|
border-radius: 10px;
|
|
277
279
|
background-color: white;
|
|
278
280
|
border: ${({theme:e})=>`1px solid ${e.stigg.palette.outlinedBorder}`};
|
|
279
|
-
`;function $g(){return jsxRuntime.jsxs(Rg,{children:[jsxRuntime.jsx(Je__default.default,{width:120,borderRadius:4}),jsxRuntime.jsx(Je__default.default,{circle:true,width:40,height:40}),jsxRuntime.jsx(Je__default.default,{style:{marginBottom:33},width:120,borderRadius:4}),jsxRuntime.jsxs(Un,{children:[jsxRuntime.jsx(Rn,{}),jsxRuntime.jsx(Je__default.default,{width:120,borderRadius:4})]}),jsxRuntime.jsxs(Un,{children:[jsxRuntime.jsx(Rn,{}),jsxRuntime.jsx(Je__default.default,{width:120,borderRadius:4})]}),jsxRuntime.jsxs(Un,{children:[jsxRuntime.jsx(Rn,{}),jsxRuntime.jsx(Je__default.default,{width:120,borderRadius:4})]}),jsxRuntime.jsx(_g,{children:jsxRuntime.jsx(Je__default.default,{height:50,borderRadius:4})})]})}function vs({skeletonPlanCount:e=3}){return jsxRuntime.jsxs(Mg,{className:"stigg-skeleton-loader-container",children:[jsxRuntime.jsx(Dg,{className:"stigg-skeleton-loader-billing-period",children:jsxRuntime.jsx(Je__default.default,{borderRadius:4})}),jsxRuntime.jsx(Ug,{className:"stigg-skeleton-loader-plans-container",children:Array.from({length:e}).map((t,o)=>jsxRuntime.jsx($g,{},o))})]})}var ee=yi__default.default.createContext(null);ee.displayName="CustomerPortalContext";var Y=()=>{let e=yi.useContext(ee);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 he(e){return !!yi.useContext(e)}var Ls=({productId:e,resourceId:t,highlightedPlanId:o,showOnlyEligiblePlans:r,textOverrides:n,onPlanSelected:i,preferredBillingPeriod:a,onBillingPeriodChange:l,billingCountryCode:s,shouldHidePlan:c,selectDefaultTierIndex:u,currentSubscriptionOverride:f,hideCompatibleAddons:y,skeletonPlanCount:p=3})=>{let g=he(ee),h=false;if(g){let{isLoading:z,resourceId:K}=Y();h=z,t=K;}let{plans:P,customer:b,currentSubscription:x,currentSubscriptionOverride:A,isCustomerOnTrial:S,isLoading:F,selectedBillingPeriod:T,setSelectedBillingPeriod:k,availableBillingPeriods:w,locale:I,configuration:v,showWatermark:L}=ws({productId:e,resourceId:t,showOnlyEligiblePlans:r,billingCountryCode:s,preferredBillingPeriod:a,currentSubscriptionOverrideFn:f}),N=As(n),R=!P||F||h?jsxRuntime.jsx(vs,{skeletonPlanCount:p}):jsxRuntime.jsx(gs,{plans:P,customer:b,currentSubscription:x,currentSubscriptionOverride:A,selectedBillingPeriod:T,onBillingPeriodChanged:z=>{k(z),l&&l(z);},availableBillingPeriods:w,highlightedPlanId:o,isCustomerOnTrial:S,onPlanSelected:i,paywallLocale:N,locale:I,shouldHidePlan:c,selectDefaultTierIndex:u,hideCompatibleAddons:y,showWatermark:L});return g?R:jsxRuntime.jsx(
|
|
281
|
+
`;function $g(){return jsxRuntime.jsxs(Rg,{children:[jsxRuntime.jsx(Je__default.default,{width:120,borderRadius:4}),jsxRuntime.jsx(Je__default.default,{circle:true,width:40,height:40}),jsxRuntime.jsx(Je__default.default,{style:{marginBottom:33},width:120,borderRadius:4}),jsxRuntime.jsxs(Un,{children:[jsxRuntime.jsx(Rn,{}),jsxRuntime.jsx(Je__default.default,{width:120,borderRadius:4})]}),jsxRuntime.jsxs(Un,{children:[jsxRuntime.jsx(Rn,{}),jsxRuntime.jsx(Je__default.default,{width:120,borderRadius:4})]}),jsxRuntime.jsxs(Un,{children:[jsxRuntime.jsx(Rn,{}),jsxRuntime.jsx(Je__default.default,{width:120,borderRadius:4})]}),jsxRuntime.jsx(_g,{children:jsxRuntime.jsx(Je__default.default,{height:50,borderRadius:4})})]})}function vs({skeletonPlanCount:e=3}){return jsxRuntime.jsxs(Mg,{className:"stigg-skeleton-loader-container",children:[jsxRuntime.jsx(Dg,{className:"stigg-skeleton-loader-billing-period",children:jsxRuntime.jsx(Je__default.default,{borderRadius:4})}),jsxRuntime.jsx(Ug,{className:"stigg-skeleton-loader-plans-container",children:Array.from({length:e}).map((t,o)=>jsxRuntime.jsx($g,{},o))})]})}var ee=yi__default.default.createContext(null);ee.displayName="CustomerPortalContext";var Y=()=>{let e=yi.useContext(ee);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 he(e){return !!yi.useContext(e)}var Ls=({productId:e,resourceId:t,highlightedPlanId:o,showOnlyEligiblePlans:r,textOverrides:n,onPlanSelected:i,preferredBillingPeriod:a,onBillingPeriodChange:l,billingCountryCode:s,shouldHidePlan:c,selectDefaultTierIndex:u,currentSubscriptionOverride:f,hideCompatibleAddons:y,skeletonPlanCount:p=3})=>{let g=he(ee),h=false;if(g){let{isLoading:z,resourceId:K}=Y();h=z,t=K;}let{plans:P,customer:b,currentSubscription:x,currentSubscriptionOverride:A,isCustomerOnTrial:S,isLoading:F,selectedBillingPeriod:T,setSelectedBillingPeriod:k,availableBillingPeriods:w,locale:I,configuration:v,showWatermark:L}=ws({productId:e,resourceId:t,showOnlyEligiblePlans:r,billingCountryCode:s,preferredBillingPeriod:a,currentSubscriptionOverrideFn:f}),N=As(n),R=!P||F||h?jsxRuntime.jsx(vs,{skeletonPlanCount:p}):jsxRuntime.jsx(gs,{plans:P,customer:b,currentSubscription:x,currentSubscriptionOverride:A,selectedBillingPeriod:T,onBillingPeriodChanged:z=>{k(z),l&&l(z);},availableBillingPeriods:w,highlightedPlanId:o,isCustomerOnTrial:S,onPlanSelected:i,paywallLocale:N,locale:I,shouldHidePlan:c,selectDefaultTierIndex:u,hideCompatibleAddons:y,showWatermark:L});return g?R:jsxRuntime.jsx(chunkIVDIW747_cjs_js.w,{componentTheme:v,children:R})};function Ms({resourceId:e,productId:t}){let{stigg:o,customerPortalUpdatedAt:r}=chunkIVDIW747_cjs_js.u(),[n,i]=yi.useState(false),[a,l]=yi.useState();return yi.useEffect(()=>{chunkIVDIW747_cjs_js.d(null,null,function*(){if(o.isCustomerLoaded)try{i(!0);let c=yield o.getCustomerPortal({resourceId:e,productId:t});l(c);}catch(c){chunkIVDIW747_cjs_js.r.error(`Failed to load customer portal ${c==null?void 0:c.message}`,c);}finally{i(false);}});},[o,o.isCustomerLoaded,r,e,t]),{customerPortal:a,showWatermark:o.getShowWatermark(),isLoading:n}}function Rs(e){return Lg__default.default({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"},e)}function Us(e,t,o){var n,i,a,l;return {sectionTitleColor:(t==null?void 0:t.sectionTitleColor)||e.palette.text.secondary,planNameColor:(t==null?void 0:t.planNameColor)||e.palette.text.primary,backgroundColor:(t==null?void 0:t.backgroundColor)||((n=o==null?void 0:o.palette)==null?void 0:n.backgroundColor)||"white",borderColor:(t==null?void 0:t.borderColor)||((i=o==null?void 0:o.palette)==null?void 0:i.borderColor)||"rgba(0, 30, 108, 0.15)",listItemBackgroundColor:(t==null?void 0:t.backgroundColor)||((a=o==null?void 0:o.palette)==null?void 0:a.backgroundColor)||"white",tabMaxHeight:(t==null?void 0:t.tabMaxHeight)||"380px",iconsColor:(t==null?void 0:t.iconsColor)||((l=o==null?void 0:o.palette)==null?void 0:l.iconsColor)||void 0,iconsBackgroundColor:t==null?void 0:t.iconsBackgroundColor}}function Do({children:e,textOverrides:t,theme:o,resourceId:r,productId:n}){let{customerPortalUpdatedAt:i}=chunkIVDIW747_cjs_js.u(),{customerPortal:a,isLoading:l,showWatermark:s}=Ms({resourceId:r,productId:n}),c=a!=null&&a.configuration?Cs(a.configuration):void 0,u=chunkIVDIW747_cjs_js.v(c),f=Us(u,o,a==null?void 0:a.configuration),y=Rs(t);return jsxRuntime.jsx(chunkIVDIW747_cjs_js.w,{componentTheme:c,children:jsxRuntime.jsx(ee.Provider,{value:{customerPortal:a,isLoading:l,showWatermark:s,textOverrides:y,theme:f,resourceId:r},children:e},i==null?void 0:i.toString())})}var Xe=chunkIVDIW747_cjs_js.e(fu__default.default)`
|
|
280
282
|
border-radius: 10px;
|
|
281
283
|
padding: 8px 16px;
|
|
282
284
|
text-transform: none;
|
|
@@ -285,7 +287,7 @@
|
|
|
285
287
|
&:hover {
|
|
286
288
|
border-color: ${({theme:e})=>e.stigg.palette.outlinedRestingBorder};
|
|
287
289
|
}
|
|
288
|
-
`;var Hg=e=>jsxRuntime.jsx("svg",
|
|
290
|
+
`;var Hg=e=>jsxRuntime.jsx("svg",chunkIVDIW747_cjs_js.b(chunkIVDIW747_cjs_js.a({width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M13.3333 2.5L17.5 6.66667L6.66667 17.5H2.5V13.3333L13.3333 2.5V2.5Z",stroke:"#327EEE",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})),$s=Hg;var Ne=chunkIVDIW747_cjs_js.e.div`
|
|
289
291
|
display: flex;
|
|
290
292
|
align-items: center;
|
|
291
293
|
justify-content: space-between;
|
|
@@ -295,11 +297,11 @@
|
|
|
295
297
|
margin-bottom: 32px;
|
|
296
298
|
}
|
|
297
299
|
`};
|
|
298
|
-
`;function Me({title:e,className:t,isLoading:o}){let{theme:r}=Y();return o?jsxRuntime.jsx(Je__default.default,{width:120}):jsxRuntime.jsx(
|
|
300
|
+
`;function Me({title:e,className:t,isLoading:o}){let{theme:r}=Y();return o?jsxRuntime.jsx(Je__default.default,{width:120}):jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{className:t,overrideColor:r.sectionTitleColor,variant:"h3",bold:true,children:e})}var Zg=chunkIVDIW747_cjs_js.e($s)`
|
|
299
301
|
path {
|
|
300
302
|
stroke: ${({theme:e})=>e.stigg.palette.primary};
|
|
301
303
|
}
|
|
302
|
-
`;function Os({onManageSubscription:e,hideManageButton:t,textOverrides:o}){return jsxRuntime.jsxs(Ne,{className:"stigg-customer-portal-overview-header",$disableMargin:true,children:[jsxRuntime.jsx(Me,{title:"Subscription",className:"stigg-overview-title"}),!t&&jsxRuntime.jsxs(Xe,{className:"stigg-manage-subscription-button",variant:"outlined",onClick:()=>e({intentionType:"MANAGE_SUBSCRIPTION"}),children:[jsxRuntime.jsx(Zg,{className:"stigg-manage-subscription-button-image"}),jsxRuntime.jsx(
|
|
304
|
+
`;function Os({onManageSubscription:e,hideManageButton:t,textOverrides:o}){return jsxRuntime.jsxs(Ne,{className:"stigg-customer-portal-overview-header",$disableMargin:true,children:[jsxRuntime.jsx(Me,{title:"Subscription",className:"stigg-overview-title"}),!t&&jsxRuntime.jsxs(Xe,{className:"stigg-manage-subscription-button",variant:"outlined",onClick:()=>e({intentionType:"MANAGE_SUBSCRIPTION"}),children:[jsxRuntime.jsx(Zg,{className:"stigg-manage-subscription-button-image"}),jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{className:"stigg-manage-subscription-button-text",color:"primary.main",style:{marginLeft:"8px"},variant:"body1",children:o==null?void 0:o.manageSubscription})]})]})}function $o(){let{customerPortal:e}=Y(),t=Yg__default.default(e==null?void 0:e.subscriptions,o=>o.addons);return Qg__default.default(t)?null:jsxRuntime.jsx("div",{className:"stigg-addons-list-layout",children:t.map((o,r)=>jsxRuntime.jsxs(chunkIVDIW747_cjs_js.f,{as:"span",className:"stigg-addon-list-item-text",variant:"body1",children:[o.quantity>1&&`${o.quantity} X `,o.displayName,r===t.length-1?"":", "]},o.addonId))})}function Jg(e){return String(e.endDate)}var Hs=chunkIVDIW747_cjs_js.e.div`
|
|
303
305
|
display: flex;
|
|
304
306
|
justify-content: space-between;
|
|
305
307
|
align-items: center;
|
|
@@ -310,19 +312,19 @@
|
|
|
310
312
|
& > *:first-of-type {
|
|
311
313
|
max-width: 60%;
|
|
312
314
|
}
|
|
313
|
-
`;function Xg(e){var n;let{displayName:t,usageLimit:o,hasUnlimitedUsage:r}=e;return r?`Unlimited ${t}`:o?`${t} x ${(n=e.usageLimit)==null?void 0:n.toLocaleString()}`:t}function zo(){let{customerPortal:e,textOverrides:t,theme:o}=Y(),r=e==null?void 0:e.promotionalEntitlements;return jsxRuntime.jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[jsxRuntime.jsx(
|
|
315
|
+
`;function Xg(e){var n;let{displayName:t,usageLimit:o,hasUnlimitedUsage:r}=e;return r?`Unlimited ${t}`:o?`${t} x ${(n=e.usageLimit)==null?void 0:n.toLocaleString()}`:t}function zo(){let{customerPortal:e,textOverrides:t,theme:o}=Y(),r=e==null?void 0:e.promotionalEntitlements;return jsxRuntime.jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{color:"secondary",children:t.promotionsSubtitle}),jsxRuntime.jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[jsxRuntime.jsxs(Hs,{$borderColor:o.borderColor,children:[jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{variant:"body1",bold:true,children:"Feature"}),jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{variant:"body1",bold:true,children:"Expiration date"})]}),r==null?void 0:r.map((n,i)=>jsxRuntime.jsxs(Hs,{$borderColor:o.borderColor,children:[jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{variant:"body1",children:Xg(n)}),jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{variant:"body1",color:"disabled",children:n.endDate?Z.utc(Jg(n)).format("MMM Do, YYYY"):"None"})]},`${n.displayName}-${i}`))]})]})}var Ws=chunkIVDIW747_cjs_js.e(ef__default.default)`
|
|
314
316
|
.MuiTabs-indicator {
|
|
315
317
|
background-color: #001e6c;
|
|
316
318
|
}
|
|
317
|
-
`,Zs=
|
|
319
|
+
`,Zs=chunkIVDIW747_cjs_js.e.div`
|
|
318
320
|
width: 100%;
|
|
319
321
|
flex: 1;
|
|
320
322
|
margin-top: 16px;
|
|
321
|
-
`,Ys=
|
|
323
|
+
`,Ys=chunkIVDIW747_cjs_js.e(ke__default.default,{shouldForwardProp:e=>!e.startsWith("$")})`
|
|
322
324
|
margin-top: 16px;
|
|
323
325
|
max-height: ${({$maxHeight:e})=>e};
|
|
324
326
|
overflow-y: auto;
|
|
325
|
-
`;
|
|
327
|
+
`;chunkIVDIW747_cjs_js.e.div`
|
|
326
328
|
display: flex;
|
|
327
329
|
flex-direction: column;
|
|
328
330
|
padding: 24px;
|
|
@@ -331,28 +333,28 @@
|
|
|
331
333
|
margin-bottom: 16px;
|
|
332
334
|
row-gap: 16px;
|
|
333
335
|
background-color: ${({$backgroundColor:e})=>e};
|
|
334
|
-
`;function Ks(e){let a=e,{children:t,value:o,index:r,maxHeight:n}=a,i=
|
|
336
|
+
`;function Ks(e){let a=e,{children:t,value:o,index:r,maxHeight:n}=a,i=chunkIVDIW747_cjs_js.c(a,["children","value","index","maxHeight"]);return jsxRuntime.jsx("div",chunkIVDIW747_cjs_js.b(chunkIVDIW747_cjs_js.a({role:"tabpanel",hidden:o!==r},i),{children:o===r&&jsxRuntime.jsx(Ys,{$maxHeight:n,children:t})}))}function qs({isSelected:e,label:t,icon:o}){let r=e?"primary":"secondary";return jsxRuntime.jsxs("div",{style:{display:"flex",gap:8,alignItems:"center"},children:[jsxRuntime.jsx(chunkIVDIW747_cjs_js.i,{icon:o,svgStrokeColor:r}),jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{variant:"h6",bold:e,color:r,children:t})]})}function Js({customerPortal:e,hiddenSections:t,textOverrides:o,theme:r}){let n=Yg__default.default(e.subscriptions,y=>y.addons),i=y=>t==null?void 0:t.some(p=>p===y),a=n.length>0&&!i("addons"),l=e.promotionalEntitlements.length>0&&!i("promotionalEntitlements"),[s,c]=yi.useState(a?1:2),u=(y,p)=>{c(p);};return a||l?jsxRuntime.jsxs(Zs,{children:[jsxRuntime.jsx(ke__default.default,{sx:{borderBottom:1,borderColor:"divider"},children:jsxRuntime.jsxs(Ws,{value:s,onChange:u,children:[a?jsxRuntime.jsx(Qs__default.default,{sx:{textTransform:"none"},value:1,label:jsxRuntime.jsx(qs,{isSelected:s===1,label:o.addonsTabTitle,icon:"Addons"})}):null,l?jsxRuntime.jsx(Qs__default.default,{sx:{textTransform:"none"},value:2,label:jsxRuntime.jsx(qs,{isSelected:s===2,label:o.promotionsTabTitle,icon:"Promotions"})}):null]})}),jsxRuntime.jsx(Ks,{value:s,index:1,maxHeight:r.tabMaxHeight,children:jsxRuntime.jsx($o,{})}),jsxRuntime.jsx(Ks,{value:s,index:2,maxHeight:r.tabMaxHeight,children:jsxRuntime.jsx(zo,{})})]}):null}var Xs={xs:320,sm:640,md:768,lg:1024,xl:1280,xxl:1536},Gn=e=>`(min-width: ${Xs[e]}px)`,oe=Object.keys(Xs).reduce((e,t)=>chunkIVDIW747_cjs_js.b(chunkIVDIW747_cjs_js.a({},e),{[t]:`@media ${Gn(t)}`}),{});function me(e){return nf__default.default(Gn(e))}var af=chunkIVDIW747_cjs_js.e.div`
|
|
335
337
|
display: flex;
|
|
336
338
|
justify-content: space-between;
|
|
337
339
|
flex-wrap: wrap;
|
|
338
|
-
`,sf=
|
|
340
|
+
`,sf=chunkIVDIW747_cjs_js.e.div`
|
|
339
341
|
display: flex;
|
|
340
342
|
flex-direction: column;
|
|
341
343
|
gap: 32px;
|
|
342
|
-
`;function el(){let e=me("md");return jsxRuntime.jsxs(af,{className:"stigg-subscription-overview-skeleton-layout",children:[jsxRuntime.jsxs(sf,{children:[jsxRuntime.jsx(Je__default.default,{width:120}),jsxRuntime.jsx(Je__default.default,{width:120})]}),jsxRuntime.jsx(Je__default.default,{width:e?295:260,height:193})]})}function cf({scheduleUpdate:e}){let{targetPackage:t}=e;return jsxRuntime.jsxs(Re__default.default,{container:true,alignItems:"center",children:[jsxRuntime.jsx(Re__default.default,{children:jsxRuntime.jsx(reactFeather.ArrowDown,{color:"#D94052",height:20,className:"stigg-scheduled-updates-arrow-down"})}),jsxRuntime.jsx(Re__default.default,{item:true,children:jsxRuntime.jsxs(
|
|
344
|
+
`;function el(){let e=me("md");return jsxRuntime.jsxs(af,{className:"stigg-subscription-overview-skeleton-layout",children:[jsxRuntime.jsxs(sf,{children:[jsxRuntime.jsx(Je__default.default,{width:120}),jsxRuntime.jsx(Je__default.default,{width:120})]}),jsxRuntime.jsx(Je__default.default,{width:e?295:260,height:193})]})}function cf({scheduleUpdate:e}){let{targetPackage:t}=e;return jsxRuntime.jsxs(Re__default.default,{container:true,alignItems:"center",children:[jsxRuntime.jsx(Re__default.default,{children:jsxRuntime.jsx(reactFeather.ArrowDown,{color:"#D94052",height:20,className:"stigg-scheduled-updates-arrow-down"})}),jsxRuntime.jsx(Re__default.default,{item:true,children:jsxRuntime.jsxs(chunkIVDIW747_cjs_js.f,{className:"stigg-scheduled-updates-description",variant:"body1",children:["Downgrade to the ",jsxRuntime.jsx("b",{children:t==null?void 0:t.displayName})," plan"]})})]})}function df({scheduleUpdate:e}){let{scheduleVariables:t}=e,{billingPeriod:o}=t,r=o===jsClientSdk.BillingPeriod.Monthly?"annually":"monthly",n=o===jsClientSdk.BillingPeriod.Monthly?"monthly":"annually";return jsxRuntime.jsxs(Re__default.default,{container:true,alignItems:"center",children:[jsxRuntime.jsx(Re__default.default,{children:jsxRuntime.jsx(reactFeather.ArrowDown,{color:"#D94052",height:20,className:"stigg-scheduled-updates-arrow-down"})}),jsxRuntime.jsx(Re__default.default,{item:true,children:jsxRuntime.jsxs(chunkIVDIW747_cjs_js.f,{className:"stigg-scheduled-updates-description",variant:"body1",children:["Change from an ",r," to a ",jsxRuntime.jsx("b",{children:n})," billing cycle"]})})]})}function pf({subscription:e,scheduleUpdate:t}){let{scheduleVariables:o}=t,{newUnitAmount:r,featureId:n}=o,a=Cc__default.default(e.prices.map(({feature:u})=>u)).find(u=>u.id===n);if(!a)return null;let{featureUnits:l,featureUnitsPlural:s}=a;return jsxRuntime.jsxs(Re__default.default,{container:true,alignItems:"flex-start",flexWrap:"nowrap",children:[jsxRuntime.jsx(Re__default.default,{children:jsxRuntime.jsx(reactFeather.ArrowDown,{color:"#D94052",height:20,className:"stigg-scheduled-updates-arrow-down"})}),jsxRuntime.jsx(Re__default.default,{item:true,children:jsxRuntime.jsxs(chunkIVDIW747_cjs_js.f,{className:"stigg-scheduled-updates-description",variant:"body1",children:["Reduce the ",jsxRuntime.jsx("b",{children:l})," quantity to ",r," ",r===1?l:s]})})]})}function ol({scheduleUpdate:e,subscription:t}){switch(e.subscriptionScheduleType){case jsClientSdk.SubscriptionScheduleType.Downgrade:return jsxRuntime.jsx(cf,{scheduleUpdate:e});case jsClientSdk.SubscriptionScheduleType.BillingPeriod:return jsxRuntime.jsx(df,{scheduleUpdate:e});case jsClientSdk.SubscriptionScheduleType.UnitAmount:return jsxRuntime.jsx(pf,{scheduleUpdate:e,subscription:t});default:return null}}var yf=chunkIVDIW747_cjs_js.e(ke__default.default)`
|
|
343
345
|
border-bottom: ${({$borderColor:e})=>`1px solid ${e}`};
|
|
344
346
|
border-top-left-radius: 10px;
|
|
345
347
|
border-top-right-radius: 10px;
|
|
346
348
|
margin: -64px -64px 64px -64px;
|
|
347
349
|
padding: 24px 32px;
|
|
348
|
-
`,hf=
|
|
350
|
+
`,hf=chunkIVDIW747_cjs_js.e(tu__default.default)`
|
|
349
351
|
margin-left: 4px;
|
|
350
|
-
`,Cf=
|
|
352
|
+
`,Cf=chunkIVDIW747_cjs_js.e(chunkIVDIW747_cjs_js.h)`
|
|
351
353
|
color: ${({theme:e})=>e.stigg.palette.primary};
|
|
352
354
|
path {
|
|
353
355
|
fill: ${({theme:e})=>e.stigg.palette.primary};
|
|
354
356
|
}
|
|
355
|
-
`;function Pf({subscription:e}){let{scheduledUpdates:t}=e;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Re__default.default,{container:true,alignItems:"center",justifyContent:"space-between",gap:1,children:jsxRuntime.jsx(Re__default.default,{children:jsxRuntime.jsx(
|
|
357
|
+
`;function Pf({subscription:e}){let{scheduledUpdates:t}=e;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Re__default.default,{container:true,alignItems:"center",justifyContent:"space-between",gap:1,children:jsxRuntime.jsx(Re__default.default,{children:jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{className:"stigg-scheduled-updates-description",variant:"body1",children:"The following updates will take effect in the next billing cycle:"})})}),jsxRuntime.jsx(Re__default.default,{children:(t||[]).map(o=>jsxRuntime.jsx(ol,{scheduleUpdate:o,subscription:e},o.subscriptionScheduleType))})]})}function xf({subscription:e}){let{scheduledUpdates:t}=e,[o]=t||[],{line1:r,line2:n}=Io({scheduledUpdate:o,subscriptionPrices:e.prices,billingPeriodRange:e.billingPeriodRange,options:{postfix:"at the end of the current billing period"}});return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Re__default.default,{container:true,alignItems:"center",justifyContent:"space-between",gap:1,children:jsxRuntime.jsx(Re__default.default,{children:jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{className:"stigg-scheduled-updates-title",variant:"body1",color:"primary",children:r})})}),n&&jsxRuntime.jsx(Re__default.default,{children:jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{className:"stigg-scheduled-updates-subtitle",variant:"body1",color:"secondary",children:n})})]})}function rl({subscription:e,onCancelScheduledUpdates:t,theme:o,cancelScheduledUpdatesButtonTitle:r}){let n=react.useTheme(),[i,a]=yi.useState(false),{scheduledUpdates:l}=e;if(!l||l.length===0)return null;let s=l.length===1;return jsxRuntime.jsx(yf,{$borderColor:o.borderColor,className:"stigg-scheduled-updates-alert-container",children:jsxRuntime.jsxs(Re__default.default,{container:true,alignItems:s?"center":"flex-start",gap:2,children:[jsxRuntime.jsx(Re__default.default,{item:true,display:"flex",children:jsxRuntime.jsx(chunkIVDIW747_cjs_js.i,{icon:"ScheduleBox",svgPathColor:o.iconsColor,svgRectColor:o.iconsBackgroundColor})}),jsxRuntime.jsx(Re__default.default,{item:true,flex:1,children:s?jsxRuntime.jsx(xf,{subscription:e}):jsxRuntime.jsx(Pf,{subscription:e})}),!!t&&jsxRuntime.jsx(Re__default.default,{item:true,children:jsxRuntime.jsxs(Xe,{variant:"outlined",onClick:()=>{a(true),Promise.resolve(t(e)).finally(()=>a(false));},children:[i?jsxRuntime.jsx(hf,{loading:true,size:16,color:n.stigg.palette.text.disabled}):jsxRuntime.jsx(Cf,{style:{display:"flex",marginRight:4},className:"stigg-scheduled-updates-cancel-update-button-icon"}),jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{variant:"body1",color:"primary.main",className:"stigg-scheduled-updates-cancel-update-button",children:r})]})})]})})}var Ue=chunkIVDIW747_cjs_js.e.div`
|
|
356
358
|
width: 100%;
|
|
357
359
|
display: flex;
|
|
358
360
|
flex-direction: column;
|
|
@@ -370,12 +372,12 @@
|
|
|
370
372
|
${oe.lg} {
|
|
371
373
|
padding: 64px;
|
|
372
374
|
}
|
|
373
|
-
`;function al({billingPeriod:e,rangeEnd:t,amount:o,currency:r}){return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(
|
|
375
|
+
`;function al({billingPeriod:e,rangeEnd:t,amount:o,currency:r}){return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{variant:"h6",children:"Next estimated bill"}),jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{variant:"h1",children:H({amount:o,currency:r,maximumFractionDigits:2})}),jsxRuntime.jsxs(chunkIVDIW747_cjs_js.f,{as:"div",variant:"body1",color:"secondary",children:["Billed ",e===jsClientSdk.BillingPeriod.Monthly?"monthly":"annually"," on"," ",jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{variant:"body1",as:"span",color:"primary",children:Z.utc(t).format("MMM Do, YYYY")})]}),jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{variant:"body1",color:"secondary",children:"* Additional tax rates may apply"})]})}function Ho({description:e}){return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{variant:"h6",color:"secondary",children:"No upcoming bill"}),jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{variant:"body1",color:"secondary",children:e})]})}var Bf=chunkIVDIW747_cjs_js.e.div`
|
|
374
376
|
display: flex;
|
|
375
377
|
flex-direction: column;
|
|
376
378
|
align-items: left;
|
|
377
379
|
gap: 8px;
|
|
378
|
-
`,Af=
|
|
380
|
+
`,Af=chunkIVDIW747_cjs_js.e(fu__default.default)`
|
|
379
381
|
width: fit-content;
|
|
380
382
|
&.MuiButton-root {
|
|
381
383
|
padding: 0;
|
|
@@ -383,7 +385,7 @@
|
|
|
383
385
|
background: none;
|
|
384
386
|
}
|
|
385
387
|
}
|
|
386
|
-
`;function ll({onContactSupport:e,label:t,linkLabel:o}){let r=jsxRuntime.jsx(
|
|
388
|
+
`;function ll({onContactSupport:e,label:t,linkLabel:o}){let r=jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{color:e?"primary.main":"secondary",children:o});return jsxRuntime.jsxs(Bf,{className:"stigg-contact-support-layout",children:[jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{className:"stigg-contact-support-label",color:"secondary",children:t}),e?jsxRuntime.jsx(Af,{className:"stigg-contact-support-button",style:{textTransform:"none"},variant:"text",onClick:e,children:r}):r]})}var Lf=chunkIVDIW747_cjs_js.e.div`
|
|
387
389
|
max-height: 278px;
|
|
388
390
|
display: flex;
|
|
389
391
|
flex-direction: column;
|
|
@@ -392,7 +394,7 @@
|
|
|
392
394
|
border: ${({$borderColor:e})=>`1px solid ${e}`};
|
|
393
395
|
padding: 32px;
|
|
394
396
|
gap: 16px;
|
|
395
|
-
`;function cl({subscription:e,theme:t,textOverrides:o,onContactSupport:r}){var s,c,u,f,y,p,g;let{pricingType:n}=e,i,a=(c=(s=e.prices)==null?void 0:s.every(h=>h.billingModel!==jsClientSdk.BillingModel.UsageBased))!=null?c:true,l=(u=e.scheduledUpdates)==null?void 0:u.find(({subscriptionScheduleType:h,targetPackage:P})=>h===jsClientSdk.SubscriptionScheduleType.Downgrade&&(P==null?void 0:P.pricingType)===jsClientSdk.PricingType.Free);if(n===jsClientSdk.PricingType.Free)i=jsxRuntime.jsx(Ho,{description:"You're on a free plan, so you don\u2019t have any upcoming charges"});else if(n===jsClientSdk.PricingType.Paid)if(l&&a)i=jsxRuntime.jsx(Ho,{description:"Your plan will be downgraded to a free plan, so you don\u2019t have any upcoming charges"});else if(e.status===jsClientSdk.SubscriptionStatus.InTrial)i=jsxRuntime.jsx(Ho,{description:`You\u2019re on a free trial of the ${e.planName} plan, so you don\u2019t have any upcoming charges`});else {let h=(y=(f=e.prices)==null?void 0:f[0])==null?void 0:y.billingPeriod,P=(p=e.billingPeriodRange)==null?void 0:p.end,b=(g=e.totalPrice)==null?void 0:g.total;h&&P&&b&&(i=jsxRuntime.jsx(al,{billingPeriod:h,rangeEnd:P,amount:b.amount,currency:b.currency}));}else n===jsClientSdk.PricingType.Custom&&(i=jsxRuntime.jsx(ll,{onContactSupport:r,label:o.contactSupportTitle,linkLabel:o.contactSupportLink}));return jsxRuntime.jsx(Lf,{className:"stigg-subscription-total-price-layout",$borderColor:t.borderColor,children:i})}var Nf=e=>jsxRuntime.jsxs("svg",
|
|
397
|
+
`;function cl({subscription:e,theme:t,textOverrides:o,onContactSupport:r}){var s,c,u,f,y,p,g;let{pricingType:n}=e,i,a=(c=(s=e.prices)==null?void 0:s.every(h=>h.billingModel!==jsClientSdk.BillingModel.UsageBased))!=null?c:true,l=(u=e.scheduledUpdates)==null?void 0:u.find(({subscriptionScheduleType:h,targetPackage:P})=>h===jsClientSdk.SubscriptionScheduleType.Downgrade&&(P==null?void 0:P.pricingType)===jsClientSdk.PricingType.Free);if(n===jsClientSdk.PricingType.Free)i=jsxRuntime.jsx(Ho,{description:"You're on a free plan, so you don\u2019t have any upcoming charges"});else if(n===jsClientSdk.PricingType.Paid)if(l&&a)i=jsxRuntime.jsx(Ho,{description:"Your plan will be downgraded to a free plan, so you don\u2019t have any upcoming charges"});else if(e.status===jsClientSdk.SubscriptionStatus.InTrial)i=jsxRuntime.jsx(Ho,{description:`You\u2019re on a free trial of the ${e.planName} plan, so you don\u2019t have any upcoming charges`});else {let h=(y=(f=e.prices)==null?void 0:f[0])==null?void 0:y.billingPeriod,P=(p=e.billingPeriodRange)==null?void 0:p.end,b=(g=e.totalPrice)==null?void 0:g.total;h&&P&&b&&(i=jsxRuntime.jsx(al,{billingPeriod:h,rangeEnd:P,amount:b.amount,currency:b.currency}));}else n===jsClientSdk.PricingType.Custom&&(i=jsxRuntime.jsx(ll,{onContactSupport:r,label:o.contactSupportTitle,linkLabel:o.contactSupportLink}));return jsxRuntime.jsx(Lf,{className:"stigg-subscription-total-price-layout",$borderColor:t.borderColor,children:i})}var Nf=e=>jsxRuntime.jsxs("svg",chunkIVDIW747_cjs_js.b(chunkIVDIW747_cjs_js.a({width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:[jsxRuntime.jsx("path",{d:"M12.9469 13.5999H11.9344L11.935 10.7756C11.935 10.6288 11.87 10.4819 11.7557 10.3838L8.62061 7.91816L11.755 5.4532C11.8694 5.35507 11.9344 5.22444 11.9344 5.06132L11.935 2.40004H12.9475C13.225 2.40004 13.4375 2.18755 13.4375 1.91004C13.4375 1.63254 13.225 1.42004 12.9475 1.42004L3.05311 1.42067C2.77561 1.42067 2.56311 1.63316 2.56311 1.91067C2.56311 2.18817 2.77561 2.40067 3.05311 2.40067H4.06561L4.06498 5.06131C4.06498 5.20818 4.12998 5.35505 4.24436 5.45318L7.36244 7.91814L4.245 10.3837C4.13062 10.4819 4.06562 10.6125 4.06562 10.7756V13.5999H3.05313C2.77562 13.5999 2.56313 13.8124 2.56313 14.0899C2.56313 14.3674 2.77562 14.5799 3.05313 14.5799H12.9469C13.2244 14.5799 13.4369 14.3674 13.4369 14.0899C13.4369 13.8124 13.2244 13.5999 12.9469 13.5999ZM5.04498 2.39995H10.9551V4.81627L8.00002 7.16747L5.04498 4.81627V2.39995ZM5.04498 11.0206L8.00002 8.66939L10.9551 11.0044V13.5838H5.04498V11.0206Z",fill:"white"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.05303 1.25404L12.9474 1.25342C13.317 1.25342 13.6041 1.54053 13.6041 1.91008C13.6041 2.27964 13.317 2.56675 12.9474 2.56675H12.1016L12.101 5.06136V5.06136C12.101 5.2747 12.0135 5.45101 11.8635 5.57973L11.8581 5.58436L8.89014 7.9182L11.8642 10.2572C12.0164 10.3878 12.1016 10.5814 12.1016 10.7757L12.101 13.4333H12.9468C13.3164 13.4333 13.6035 13.7204 13.6035 14.09C13.6035 14.4595 13.3164 14.7466 12.9468 14.7466H3.05304C2.68349 14.7466 2.39638 14.4595 2.39638 14.09C2.39638 13.7204 2.68349 13.4333 3.05304 13.4333H3.89887V10.7757C3.89887 10.5623 3.98635 10.386 4.13639 10.2573L4.14144 10.253L7.09365 7.91821L4.13566 5.57982C3.98346 5.44923 3.89823 5.25562 3.89823 5.06135L3.89882 2.56738H3.05303C2.68348 2.56738 2.39636 2.28026 2.39636 1.91071C2.39636 1.54116 2.68348 1.25405 3.05303 1.25404V1.25404ZM12.9474 1.58675L3.05304 1.58738C2.86758 1.58738 2.7297 1.72525 2.7297 1.91071C2.7297 2.09617 2.86757 2.23404 3.05303 2.23404H4.23223L4.23157 5.06135V5.06135C4.23158 5.15983 4.27538 5.25908 4.35053 5.32476L7.63107 7.91815L4.35113 10.5123C4.2739 10.5795 4.23221 10.6639 4.23221 10.7757V13.7666H3.05304C2.86759 13.7666 2.72971 13.9045 2.72971 14.09C2.72971 14.2754 2.86759 14.4133 3.05304 14.4133H12.9468C13.1323 14.4133 13.2701 14.2754 13.2701 14.09C13.2701 13.9045 13.1323 13.7667 12.9468 13.7667H11.7676L11.7683 10.7757V10.7757C11.7683 10.6772 11.7245 10.5781 11.6495 10.5124L8.35092 7.91819L11.6489 5.32461C11.726 5.25743 11.7676 5.17306 11.7676 5.06136L11.7683 2.23342H12.9474C13.1329 2.23342 13.2708 2.09554 13.2708 1.91008C13.2708 1.72463 13.1329 1.58676 12.9474 1.58675V1.58675ZM4.87823 2.23332H11.1216V4.89669L7.99994 7.3805L4.87823 4.89669V2.23332ZM5.21157 2.56666V4.73593L7.99994 6.95452L10.7883 4.73593V2.56666H5.21157ZM7.99958 8.45673L11.1216 10.9237V13.7505H4.87823V10.9403L7.99958 8.45673ZM8.0003 8.88213L5.21157 11.101V13.4172H10.7883V11.0852L8.0003 8.88213Z",fill:"white"})]})),pl=Nf;var We=chunkIVDIW747_cjs_js.e(n=>{var i=n,{children:e,className:t,placement:o="top"}=i,r=chunkIVDIW747_cjs_js.c(i,["children","className","placement"]);return jsxRuntime.jsx(Rf__default.default,chunkIVDIW747_cjs_js.b(chunkIVDIW747_cjs_js.a({arrow:true,placement:o},r),{classes:{popper:t,tooltip:"stigg-tooltip",arrow:"stigg-tooltip-arrow"},children:jsxRuntime.jsx("div",{children:e})}))})(({theme:e,$padding:t=8,$maxWidth:o=300})=>({[`& .${Rf.tooltipClasses.tooltip}`]:{backgroundColor:e.stigg.palette.white,maxWidth:o,boxShadow:e.stigg.shadows.popover,padding:t,borderRadius:e.stigg.border.radius,color:e.stigg.palette.text.primary},[`& .${Rf.tooltipClasses.arrow}`]:{color:e.stigg.palette.white}}));var $f=chunkIVDIW747_cjs_js.e(chunkIVDIW747_cjs_js.f)`
|
|
396
398
|
display: ${({$display:e})=>e};
|
|
397
399
|
-webkit-line-clamp: ${({$maxLines:e})=>e};
|
|
398
400
|
-webkit-box-orient: vertical;
|
|
@@ -406,7 +408,7 @@
|
|
|
406
408
|
${({$bold:e})=>e&&react.css`
|
|
407
409
|
font-weight: bold;
|
|
408
410
|
`}
|
|
409
|
-
`;function fl(e){return e&&(e.clientHeight<e.scrollHeight||e.offsetWidth<e.scrollWidth)}var Ae=({leaveDelay:e,children:t,variant:o,color:r,maxLines:n=1,wordBreak:i,bold:a,tooltipPlacement:l="top",className:s,display:c="-webkit-box",style:u,"data-testid":f})=>{let[y,p]=yi.useState(false),g=yi.useRef(null),h=jsxRuntime.jsx($f,{ref:g,variant:o,color:r,$maxLines:n,$wordBreak:i,$bold:a,className:s,$display:c,style:u,"data-testid":f,children:t});yi.useEffect(()=>{if(g!=null&&g.current){let b=fl(g.current);p(b);}},[g]);let P=(g==null?void 0:g.current)&&fl(g.current);return jsxRuntime.jsx("span",{children:y||P?jsxRuntime.jsx(We,{placement:l,leaveDelay:e,title:jsxRuntime.jsx(
|
|
411
|
+
`;function fl(e){return e&&(e.clientHeight<e.scrollHeight||e.offsetWidth<e.scrollWidth)}var Ae=({leaveDelay:e,children:t,variant:o,color:r,maxLines:n=1,wordBreak:i,bold:a,tooltipPlacement:l="top",className:s,display:c="-webkit-box",style:u,"data-testid":f})=>{let[y,p]=yi.useState(false),g=yi.useRef(null),h=jsxRuntime.jsx($f,{ref:g,variant:o,color:r,$maxLines:n,$wordBreak:i,$bold:a,className:s,$display:c,style:u,"data-testid":f,children:t});yi.useEffect(()=>{if(g!=null&&g.current){let b=fl(g.current);p(b);}},[g]);let P=(g==null?void 0:g.current)&&fl(g.current);return jsxRuntime.jsx("span",{children:y||P?jsxRuntime.jsx(We,{placement:l,leaveDelay:e,title:jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{variant:"body1",children:t}),children:h}):h})};var Vf=chunkIVDIW747_cjs_js.e.div`
|
|
410
412
|
width: 100%;
|
|
411
413
|
display: flex;
|
|
412
414
|
align-items: center;
|
|
@@ -415,48 +417,48 @@
|
|
|
415
417
|
border-radius: 10px;
|
|
416
418
|
padding: 8px 16px;
|
|
417
419
|
margin-top: 16px;
|
|
418
|
-
`,Of=
|
|
420
|
+
`,Of=chunkIVDIW747_cjs_js.e(zf__default.default)`
|
|
419
421
|
text-decoration-color: white;
|
|
420
422
|
color: white;
|
|
421
423
|
cursor: pointer;
|
|
422
|
-
`;function hl({subscription:e,includePlanName:t,onManageSubscription:o}){return (e==null?void 0:e.status)!==jsClientSdk.SubscriptionStatus.InTrial?null:jsxRuntime.jsxs(Vf,{className:"stigg-subscription-trial-badge",children:[jsxRuntime.jsx(pl,{className:"stigg-subscription-trial-badge-image"}),jsxRuntime.jsx("div",{style:{flex:1,marginRight:4},children:jsxRuntime.jsxs(Ae,{variant:"body1",className:"stigg-subscription-trial-badge-text",color:"white",children:[`${e.trialRemainingDays} days remaining in trial`,t&&` of the ${e.planName} plan`]})}),jsxRuntime.jsx(Of,{className:"stigg-subscription-trial-upgrade-button",onClick:()=>o({intentionType:"UPGRADE_TRIAL_PLAN"}),children:jsxRuntime.jsx(
|
|
424
|
+
`;function hl({subscription:e,includePlanName:t,onManageSubscription:o}){return (e==null?void 0:e.status)!==jsClientSdk.SubscriptionStatus.InTrial?null:jsxRuntime.jsxs(Vf,{className:"stigg-subscription-trial-badge",children:[jsxRuntime.jsx(pl,{className:"stigg-subscription-trial-badge-image"}),jsxRuntime.jsx("div",{style:{flex:1,marginRight:4},children:jsxRuntime.jsxs(Ae,{variant:"body1",className:"stigg-subscription-trial-badge-text",color:"white",children:[`${e.trialRemainingDays} days remaining in trial`,t&&` of the ${e.planName} plan`]})}),jsxRuntime.jsx(Of,{className:"stigg-subscription-trial-upgrade-button",onClick:()=>o({intentionType:"UPGRADE_TRIAL_PLAN"}),children:jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{color:"white",children:"Upgrade plan"})})]})}function Pl({mainSubscription:e,trialSubscription:t,onManageSubscription:o,theme:r}){return jsxRuntime.jsxs("div",{className:"stigg-subscription-view-layout",children:[jsxRuntime.jsxs(chunkIVDIW747_cjs_js.f,{className:"stigg-subscription-plan-name",variant:"h1",overrideColor:r.planNameColor,style:{marginTop:8},children:[e.planName," plan"]}),jsxRuntime.jsx(hl,{subscription:t,includePlanName:(t==null?void 0:t.planName)!==e.planName,onManageSubscription:o})]})}var Zn=70;function je(e,t){return t===0?0:Math.min(Math.floor(e/t*100),100)}function xl(e){let t;return e<Zn?t="standard":e<100?t="warning":t="error",t}function Wf(e){return String(e.usagePeriodEnd)}function bl(e){if(!e.resetPeriod||!e.usagePeriodEnd)return null;let t=Wf(e),o=r=>Z.utc(t).diff(Z.utc(),r);switch(e.resetPeriod){case jsClientSdk.EntitlementResetPeriod.Month:return `Resets monthly - in ${o("days")} days`;case jsClientSdk.EntitlementResetPeriod.Week:return `Resets weekly - in ${o("days")} days`;case jsClientSdk.EntitlementResetPeriod.Day:return `Resets daily - in ${o("hours")} hours`;case jsClientSdk.EntitlementResetPeriod.Hour:return `Resets hourly - in ${o("minutes")} minutes`;default:return null}}var Qf=chunkIVDIW747_cjs_js.e(Zf__default.default,{shouldForwardProp:e=>!e.startsWith("$")})`
|
|
423
425
|
height: 4px;
|
|
424
426
|
background-color: ${({theme:e})=>Li__default.default(e.stigg.palette.primary).alpha(.4).string()};
|
|
425
427
|
|
|
426
428
|
span {
|
|
427
429
|
background-color: ${({$progressStatus:e,theme:t})=>{switch(e){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}}};
|
|
428
430
|
}
|
|
429
|
-
`;function Ko({currentUsage:e,usageLimit:t,classNamePrefix:o="stigg-usage-progress-bar"}){let r=je(e,t),n=xl(r);return jsxRuntime.jsx(Qf,{$progressStatus:n,className:`${o} ${o}-${n}`,variant:"determinate",value:r})}var Xf=
|
|
431
|
+
`;function Ko({currentUsage:e,usageLimit:t,classNamePrefix:o="stigg-usage-progress-bar"}){let r=je(e,t),n=xl(r);return jsxRuntime.jsx(Qf,{$progressStatus:n,className:`${o} ${o}-${n}`,variant:"determinate",value:r})}var Xf=chunkIVDIW747_cjs_js.e(El__default.default)`
|
|
430
432
|
border-style: dotted;
|
|
431
433
|
border-bottom-width: 2px;
|
|
432
434
|
border-color: ${({theme:e})=>Li__default.default(e.stigg.palette.outlinedRestingBorder).alpha(.4).string()};
|
|
433
|
-
`;function qo({entitlement:e}){return e.hasUnlimitedUsage?jsxRuntime.jsx(Xf,{}):jsxRuntime.jsx(Ko,{currentUsage:e.currentUsage||0,usageLimit:e.usageLimit,classNamePrefix:"stigg-feature-usage-progress-bar"})}var Tl=
|
|
435
|
+
`;function qo({entitlement:e}){return e.hasUnlimitedUsage?jsxRuntime.jsx(Xf,{}):jsxRuntime.jsx(Ko,{currentUsage:e.currentUsage||0,usageLimit:e.usageLimit,classNamePrefix:"stigg-feature-usage-progress-bar"})}var Tl=chunkIVDIW747_cjs_js.e(fu__default.default)`
|
|
434
436
|
text-transform: none;
|
|
435
437
|
padding: 0;
|
|
436
438
|
white-space: nowrap;
|
|
437
|
-
`;function Xo({featureEntitlement:e,feature:t,onManageSubscription:o,onBuyMore:r,canBuyMore:n,canUpgradeSubscription:i,hasCustomSubscription:a}){return a||e.hasUnlimitedUsage||je(e.currentUsage||0,e.usageLimit)<Zn?null:n?r?jsxRuntime.jsx(Tl,{variant:"text",onClick:()=>r(t,e),children:jsxRuntime.jsx(
|
|
439
|
+
`;function Xo({featureEntitlement:e,feature:t,onManageSubscription:o,onBuyMore:r,canBuyMore:n,canUpgradeSubscription:i,hasCustomSubscription:a}){return a||e.hasUnlimitedUsage||je(e.currentUsage||0,e.usageLimit)<Zn?null:n?r?jsxRuntime.jsx(Tl,{variant:"text",onClick:()=>r(t,e),children:jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{color:"primary.main",children:"Buy more"})}):null:i&&o?jsxRuntime.jsx(Tl,{variant:"text",onClick:()=>o({intentionType:"UPGRADE_PLAN"}),children:jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{color:"primary.main",children:"Upgrade"})}):null}function kl({amount:e,currency:t,blockSize:o,featureEntitlement:r,feature:n,hideChargePrice:i,onBuyMore:a,onManageSubscription:l,canUpgradeSubscription:s,hasCustomSubscription:c}){var u,f,y;return jsxRuntime.jsxs("div",{className:`stigg-charge-list-item stigg-charge-list-item-${r.feature.refId}`,style:{display:"flex",flexDirection:"column",gap:12},children:[jsxRuntime.jsxs("div",{style:{display:"flex",justifyContent:"space-between",gap:12},children:[jsxRuntime.jsxs("div",{style:{display:"flex",gap:12},children:[jsxRuntime.jsx(Ae,{variant:"body1",color:"primary",children:n.displayName}),!i&&jsxRuntime.jsxs(Ae,{variant:"body1",color:"secondary",children:[H({amount:e,currency:t})," per ",o?`${o} `:"",o?n.featureUnitsPlural:n.featureUnits]})]}),jsxRuntime.jsxs("div",{style:{display:"flex",gap:12},children:[jsxRuntime.jsx(Xo,{featureEntitlement:r,feature:n,canBuyMore:true,onBuyMore:a,onManageSubscription:l,canUpgradeSubscription:s,hasCustomSubscription:c}),jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{variant:"body1",color:"primary",style:{whiteSpace:"nowrap"},children:r.hasUnlimitedUsage?(u=r.currentUsage)==null?void 0:u.toLocaleString():`${(f=r.currentUsage)==null?void 0:f.toLocaleString()} of ${(y=r.usageLimit)==null?void 0:y.toLocaleString()}`})]})]}),jsxRuntime.jsx(qo,{entitlement:r})]})}function Bl({subscription:e,entitlements:t,onBuyMore:o,onManageSubscription:r,hasCustomSubscription:n,canUpgradeSubscription:i}){let a=Dl__default.default(t,"feature.refId"),l=e.prices.filter(({feature:s,price:c})=>!!s&&a[s.refId]&&!!c);return l.length?jsxRuntime.jsx("div",{className:"stigg-charge-list",style:{display:"flex",flexDirection:"column",gap:16,marginTop:32},children:l.map(({feature:s,price:c,blockSize:u,billingModel:f})=>{if(!s||!c)return null;let y=a[s.refId];return !y||!y.feature?null:jsxRuntime.jsx(kl,{featureEntitlement:y,feature:y.feature,amount:c.amount,blockSize:u,currency:c.currency,hideChargePrice:f===jsClientSdk.BillingModel.PerUnit,onBuyMore:o,onManageSubscription:r,canUpgradeSubscription:i,hasCustomSubscription:n},s.refId)})}):null}function kt(e){return e.__typename==="FeatureEntitlement"}function er(e){return e.__typename==="CreditEntitlement"}function tr({onManageSubscription:e,onBuyMore:t,onCancelScheduledUpdates:o,onContactSupport:r,hiddenSections:n,cancelScheduledUpdatesButtonTitle:i}){let{customerPortal:a,isLoading:l,textOverrides:s,theme:c}=Y(),u=l||!a,{subscriptions:f,entitlementsV2:y,canUpgradeSubscription:p}=a||{},g=yi.useMemo(()=>y?y.filter(kt):[],[y]),h=f==null?void 0:f.find(({status:A})=>A===jsClientSdk.SubscriptionStatus.Active),P=f==null?void 0:f.find(({status:A})=>A===jsClientSdk.SubscriptionStatus.InTrial),b=(h==null?void 0:h.pricingType)===jsClientSdk.PricingType.Custom,x=h||P;return jsxRuntime.jsxs(Ue,{className:"stigg-customer-portal-subscriptions-overview",$backgroundColor:c.backgroundColor,$borderColor:c.borderColor,children:[!u&&h&&h.scheduledUpdates&&jsxRuntime.jsx(rl,{theme:c,subscription:h,onCancelScheduledUpdates:o,cancelScheduledUpdatesButtonTitle:i}),u||!x?jsxRuntime.jsx(el,{}):jsxRuntime.jsxs("div",{className:"stigg-overview-layout",style:{display:"flex",alignItems:"flex-start",gap:64,flexWrap:"wrap"},children:[jsxRuntime.jsxs("div",{style:{display:"flex",flexDirection:"column",flex:1},children:[jsxRuntime.jsx(Os,{onManageSubscription:e,hideManageButton:b,textOverrides:s}),jsxRuntime.jsx(Pl,{mainSubscription:x,trialSubscription:P,theme:c,onManageSubscription:e}),h&&g.length>0&&jsxRuntime.jsx(Bl,{subscription:h,entitlements:g,onBuyMore:t,onManageSubscription:e,canUpgradeSubscription:!!p,hasCustomSubscription:b}),jsxRuntime.jsx(Js,{customerPortal:a,hiddenSections:n,textOverrides:s,theme:c})]}),jsxRuntime.jsx("div",{style:{display:"flex",flexDirection:"column",width:319,gap:24},children:jsxRuntime.jsx(cl,{subscription:x,theme:c,onContactSupport:r,textOverrides:s})})]})]})}var ny=chunkIVDIW747_cjs_js.e.div`
|
|
438
440
|
display: flex;
|
|
439
441
|
width: 100%;
|
|
440
442
|
align-items: flex-end;
|
|
441
443
|
justify-content: flex-end;
|
|
442
444
|
margin-bottom: 24px;
|
|
443
|
-
`;function Fl({showWatermark:e}){return jsxRuntime.jsx(ny,{className:"stigg-customer-portal-header-layout",children:jsxRuntime.jsx(
|
|
445
|
+
`;function Fl({showWatermark:e}){return jsxRuntime.jsx(ny,{className:"stigg-customer-portal-header-layout",children:jsxRuntime.jsx(chunkIVDIW747_cjs_js.q,{source:"customer_portal",showWatermark:e})})}var ay=chunkIVDIW747_cjs_js.e(chunkIVDIW747_cjs_js.f)`
|
|
444
446
|
text-transform: none;
|
|
445
|
-
`,sy=
|
|
447
|
+
`,sy=chunkIVDIW747_cjs_js.e(reactFeather.ExternalLink)`
|
|
446
448
|
color: ${({theme:e})=>e.stigg.palette.primary};
|
|
447
|
-
`;function or({text:e,url:t,className:o}){return jsxRuntime.jsx(Xe,{className:o,variant:"outlined",startIcon:jsxRuntime.jsx(sy,{size:20,strokeWidth:2.5}),onClick:()=>{window.open(t,"_blank");},children:jsxRuntime.jsx(ay,{color:"primary.main",children:e})})}var rr=
|
|
449
|
+
`;function or({text:e,url:t,className:o}){return jsxRuntime.jsx(Xe,{className:o,variant:"outlined",startIcon:jsxRuntime.jsx(sy,{size:20,strokeWidth:2.5}),onClick:()=>{window.open(t,"_blank");},children:jsxRuntime.jsx(ay,{color:"primary.main",children:e})})}var rr=chunkIVDIW747_cjs_js.e.div`
|
|
448
450
|
display: flex;
|
|
449
451
|
flex-direction: column;
|
|
450
452
|
align-items: flex-start;
|
|
451
453
|
gap: 16px;
|
|
452
454
|
flex: 1 0 0;
|
|
453
|
-
`,ly=
|
|
455
|
+
`,ly=chunkIVDIW747_cjs_js.e.div`
|
|
454
456
|
display: flex;
|
|
455
457
|
align-items: flex-start;
|
|
456
458
|
gap: 16px;
|
|
457
459
|
align-self: stretch;
|
|
458
460
|
flex-wrap: wrap;
|
|
459
|
-
`;function qn({title:e,rows:t}){return jsxRuntime.jsxs(rr,{children:[jsxRuntime.jsx(
|
|
461
|
+
`;function qn({title:e,rows:t}){return jsxRuntime.jsxs(rr,{children:[jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{variant:"h6",color:"secondary",bold:true,children:e}),t.map(({classNamePrefix:o,label:r,value:n,labelTypographyProps:i,valueTypographyProps:a})=>jsxRuntime.jsxs(ly,{children:[jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,chunkIVDIW747_cjs_js.b(chunkIVDIW747_cjs_js.a({className:`${o}-label`,variant:"body1",color:"secondary",style:{width:80}},i),{children:r})),jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,chunkIVDIW747_cjs_js.b(chunkIVDIW747_cjs_js.a({className:`${o}-text`,variant:"body1",color:"secondary"},a),{children:n}))]},r))]})}function nr(){return jsxRuntime.jsx(Je__default.default,{width:220,height:42})}var Ll="-";function ar(){let{customerPortal:e,isLoading:t,textOverrides:o,theme:r}=Y(),n=me("md"),{billingInformation:i}=e||{},a=!i||t,l=[];if(a?l.push(jsxRuntime.jsxs(rr,{children:[jsxRuntime.jsx(Je__default.default,{width:220,height:12}),jsxRuntime.jsx(Je__default.default,{width:220,height:12}),jsxRuntime.jsx(Je__default.default,{width:220,height:12})]},"information-loading-data-top"),jsxRuntime.jsx(El__default.default,{orientation:"vertical",style:{minHeight:93,display:n?"block":"none"}},"information-loading-data-divider"),jsxRuntime.jsxs(rr,{children:[jsxRuntime.jsx(Je__default.default,{width:220,height:12}),jsxRuntime.jsx(Je__default.default,{width:220,height:12}),jsxRuntime.jsx(Je__default.default,{width:220,height:12})]},"information-loading-data-bottom")):(l.push(jsxRuntime.jsx(qn,{title:"Billed to",rows:[{classNamePrefix:"stigg-customer-name",label:"Name",value:(i==null?void 0:i.name)||Ll,valueTypographyProps:i!=null&&i.name?{}:{color:"disabled"}},{classNamePrefix:"stigg-customer-email",label:"Email",value:(i==null?void 0:i.email)||Ll,valueTypographyProps:i!=null&&i.email?{}:{color:"disabled"}}]},"information-billing-data-billed-to")),i!=null&&i.defaultPaymentMethodId&&i.defaultPaymentMethodLast4Digits&&i.defaultPaymentExpirationMonth&&i.defaultPaymentExpirationYear&&(l.unshift(jsxRuntime.jsx(El__default.default,{orientation:"vertical",style:{minHeight:93,display:n?"block":"none"}},"information-billing-data-divider")),l.unshift(jsxRuntime.jsx(qn,{title:"Payment method",rows:[{classNamePrefix:"stigg-credit-card",label:"Card",value:`Ending in ${i.defaultPaymentMethodLast4Digits}`},{classNamePrefix:"stigg-credit-card-expiration",label:"Expires",value:`${py__default.default(i.defaultPaymentExpirationMonth.toString(),2,"0")}/${i.defaultPaymentExpirationYear}`}]},"information-billing-data-payment-method")))),!a&&!(i!=null&&i.name)&&!(i!=null&&i.email)&&!(i!=null&&i.defaultPaymentMethodId))return null;let s=a?jsxRuntime.jsx(nr,{}):e!=null&&e.billingPortalUrl?jsxRuntime.jsx(or,{url:e.billingPortalUrl,text:o.editPaymentDetails,className:"stigg-edit-payment-details-button"}):null;return jsxRuntime.jsxs(Ue,{className:"stigg-payment-details-section-layout",$backgroundColor:r.backgroundColor,$borderColor:r.borderColor,children:[jsxRuntime.jsxs(Ne,{className:"stigg-payment-details-section-header",children:[jsxRuntime.jsx(Me,{isLoading:a,className:"stigg-payment-details-section-title",title:"Payment details"}),s]}),jsxRuntime.jsx("div",{style:{display:"flex",alignItems:"stretch",gap:n?64:32,flexWrap:"wrap"},children:l})]})}var Nl=chunkIVDIW747_cjs_js.e(Ue)`
|
|
460
462
|
position: relative;
|
|
461
463
|
|
|
462
464
|
.stigg-paywall-layout {
|
|
@@ -478,10 +480,10 @@
|
|
|
478
480
|
margin-right: auto;
|
|
479
481
|
}
|
|
480
482
|
|
|
481
|
-
.${
|
|
483
|
+
.${chunkIVDIW747_cjs_js.p} {
|
|
482
484
|
display: none;
|
|
483
485
|
}
|
|
484
|
-
`;var Jn=yi.forwardRef(({paywallComponent:e,theme:t,title:o,isLoading:r},n)=>e?jsxRuntime.jsxs(Nl,{className:"stigg-customer-portal-paywall-section",ref:n,$backgroundColor:t.backgroundColor,$borderColor:t.borderColor,children:[jsxRuntime.jsx(Ne,{className:"stigg-customer-portal-paywall-header",children:jsxRuntime.jsx(Me,{isLoading:r,className:"stigg-customer-portal-paywall-section-title",title:o})}),e]}):null);Jn.displayName="CustomerPortalPaywall";var Rl=
|
|
486
|
+
`;var Jn=yi.forwardRef(({paywallComponent:e,theme:t,title:o,isLoading:r},n)=>e?jsxRuntime.jsxs(Nl,{className:"stigg-customer-portal-paywall-section",ref:n,$backgroundColor:t.backgroundColor,$borderColor:t.borderColor,children:[jsxRuntime.jsx(Ne,{className:"stigg-customer-portal-paywall-header",children:jsxRuntime.jsx(Me,{isLoading:r,className:"stigg-customer-portal-paywall-section-title",title:o})}),e]}):null);Jn.displayName="CustomerPortalPaywall";var Rl=chunkIVDIW747_cjs_js.e.div`
|
|
485
487
|
width: 100%;
|
|
486
488
|
display: flex;
|
|
487
489
|
flex-direction: column;
|
|
@@ -490,13 +492,13 @@
|
|
|
490
492
|
& * {
|
|
491
493
|
box-sizing: border-box;
|
|
492
494
|
}
|
|
493
|
-
`,Ul=
|
|
495
|
+
`,Ul=chunkIVDIW747_cjs_js.e.div`
|
|
494
496
|
width: 100%;
|
|
495
497
|
display: flex;
|
|
496
498
|
flex-direction: column;
|
|
497
499
|
align-items: center;
|
|
498
500
|
row-gap: 24px;
|
|
499
|
-
`;var $l=6;function zl({featureEntitlements:e,creditEntitlements:t,showAll:o}){let r=e.length+t.length,n=o?r:Math.min(r,$l),i=e.slice(0,n),a=n-i.length,l=t.slice(0,Math.max(0,a)),s=r>$l;return {entitlementsToShow:i,creditsToShow:l,totalItemsCount:r,showMoreVisible:s}}function fy(e){var t,o;return ((t=e.feature)==null?void 0:t.meterType)===jsClientSdk.MeterType.Fluctuating||((o=e.feature)==null?void 0:o.meterType)===jsClientSdk.MeterType.Incremental}function Vl(e,t){return t?e>2?4:6:12}function Gl(e){let t=[],o=[];for(let r of e)kt(r)?t.push(r):er(r)&&o.push(r);return {feature:t,credit:o}}function Ol({packageEntitlements:e,activeSubscription:t,filterEntitlements:o,filterPackageEntitlements:r}){var x,A;let{feature:n,credit:i}=Gl(e!=null?e:[]),a=n.filter(fy),l=Dl__default.default((x=t==null?void 0:t.prices)!=null?x:[],"feature.refId"),s=Dl__default.default(a,"feature.refId"),c=((A=t==null?void 0:t.prices)!=null?A:[]).map(S=>S.feature?s[S.feature.refId]:void 0).filter(S=>!!S),u=a.filter(S=>S.feature&&!l[S.feature.refId]),f=[...c,...u].filter(S=>S.usageLimit!==0),y=i.filter(S=>{var F;return ((F=S.usageLimit)!=null?F:0)>0}),p=[...f,...y],g=r?r({entitlements:p}).entitlements:[...o?o(f):f,...y],{feature:h,credit:P}=Gl(g),b=(t==null?void 0:t.pricingType)===jsClientSdk.PricingType.Custom;return {subscriptionPriceByFeature:l,filteredFeatureEntitlements:h,filteredCreditEntitlements:P,hasCustomSubscription:b}}function Hl({filterEntitlements:e,filterPackageEntitlements:t}){let[o,r]=yi.useState(false),n=me("md"),{customerPortal:i,isLoading:a}=Y(),l=yi.useMemo(()=>{var k;let F=i==null?void 0:i.entitlementsV2,T=(k=i==null?void 0:i.subscriptions)==null?void 0:k.find(w=>w.status===jsClientSdk.SubscriptionStatus.Active);return Ol({packageEntitlements:F,activeSubscription:T,filterEntitlements:e,filterPackageEntitlements:t})},[i==null?void 0:i.entitlementsV2,i==null?void 0:i.subscriptions,e,t]),{subscriptionPriceByFeature:s,filteredFeatureEntitlements:c,filteredCreditEntitlements:u,hasCustomSubscription:f}=l,y=a||!i,p=!!(i!=null&&i.canUpgradeSubscription),{entitlementsToShow:g,creditsToShow:h,totalItemsCount:P,showMoreVisible:b}=zl({featureEntitlements:c,creditEntitlements:u,showAll:o}),x=Vl(P,n),A=()=>r(F=>!F),S=!y&&c.length===0&&u.length===0;return {isLoadingData:y,entitlementsToShow:g,creditsToShow:h,subscriptionPriceByFeature:s,totalItemsCount:P,gridSizeXs:x,hasCustomSubscription:f,canUpgradeSubscription:p,showAll:o,toggleShowAll:A,hasNoItems:S,showMoreVisible:b}}function Bt(e,t,o){if(!t&&!o)return e;let r=Xn__default.default(e);return r===Xn__default.default(t||"")||r===Xn__default.default(o||"")?e:`${e} (${o})`}function Wl(e){return Bt(e.displayName,e.featureUnits,e.featureUnitsPlural)}function Zl(e){var t,o,r;return Bt((t=e.currency)==null?void 0:t.displayName,(o=e.currency)==null?void 0:o.unitSingular,(r=e.currency)==null?void 0:r.unitPlural)}var sr=
|
|
501
|
+
`;var $l=6;function zl({featureEntitlements:e,creditEntitlements:t,showAll:o}){let r=e.length+t.length,n=o?r:Math.min(r,$l),i=e.slice(0,n),a=n-i.length,l=t.slice(0,Math.max(0,a)),s=r>$l;return {entitlementsToShow:i,creditsToShow:l,totalItemsCount:r,showMoreVisible:s}}function fy(e){var t,o;return ((t=e.feature)==null?void 0:t.meterType)===jsClientSdk.MeterType.Fluctuating||((o=e.feature)==null?void 0:o.meterType)===jsClientSdk.MeterType.Incremental}function Vl(e,t){return t?e>2?4:6:12}function Gl(e){let t=[],o=[];for(let r of e)kt(r)?t.push(r):er(r)&&o.push(r);return {feature:t,credit:o}}function Ol({packageEntitlements:e,activeSubscription:t,filterEntitlements:o,filterPackageEntitlements:r}){var x,A;let{feature:n,credit:i}=Gl(e!=null?e:[]),a=n.filter(fy),l=Dl__default.default((x=t==null?void 0:t.prices)!=null?x:[],"feature.refId"),s=Dl__default.default(a,"feature.refId"),c=((A=t==null?void 0:t.prices)!=null?A:[]).map(S=>S.feature?s[S.feature.refId]:void 0).filter(S=>!!S),u=a.filter(S=>S.feature&&!l[S.feature.refId]),f=[...c,...u].filter(S=>S.usageLimit!==0),y=i.filter(S=>{var F;return ((F=S.usageLimit)!=null?F:0)>0}),p=[...f,...y],g=r?r({entitlements:p}).entitlements:[...o?o(f):f,...y],{feature:h,credit:P}=Gl(g),b=(t==null?void 0:t.pricingType)===jsClientSdk.PricingType.Custom;return {subscriptionPriceByFeature:l,filteredFeatureEntitlements:h,filteredCreditEntitlements:P,hasCustomSubscription:b}}function Hl({filterEntitlements:e,filterPackageEntitlements:t}){let[o,r]=yi.useState(false),n=me("md"),{customerPortal:i,isLoading:a}=Y(),l=yi.useMemo(()=>{var k;let F=i==null?void 0:i.entitlementsV2,T=(k=i==null?void 0:i.subscriptions)==null?void 0:k.find(w=>w.status===jsClientSdk.SubscriptionStatus.Active);return Ol({packageEntitlements:F,activeSubscription:T,filterEntitlements:e,filterPackageEntitlements:t})},[i==null?void 0:i.entitlementsV2,i==null?void 0:i.subscriptions,e,t]),{subscriptionPriceByFeature:s,filteredFeatureEntitlements:c,filteredCreditEntitlements:u,hasCustomSubscription:f}=l,y=a||!i,p=!!(i!=null&&i.canUpgradeSubscription),{entitlementsToShow:g,creditsToShow:h,totalItemsCount:P,showMoreVisible:b}=zl({featureEntitlements:c,creditEntitlements:u,showAll:o}),x=Vl(P,n),A=()=>r(F=>!F),S=!y&&c.length===0&&u.length===0;return {isLoadingData:y,entitlementsToShow:g,creditsToShow:h,subscriptionPriceByFeature:s,totalItemsCount:P,gridSizeXs:x,hasCustomSubscription:f,canUpgradeSubscription:p,showAll:o,toggleShowAll:A,hasNoItems:S,showMoreVisible:b}}function Bt(e,t,o){if(!t&&!o)return e;let r=Xn__default.default(e);return r===Xn__default.default(t||"")||r===Xn__default.default(o||"")?e:`${e} (${o})`}function Wl(e){return Bt(e.displayName,e.featureUnits,e.featureUnitsPlural)}function Zl(e){var t,o,r;return Bt((t=e.currency)==null?void 0:t.displayName,(o=e.currency)==null?void 0:o.unitSingular,(r=e.currency)==null?void 0:r.unitPlural)}var sr=chunkIVDIW747_cjs_js.e.div`
|
|
500
502
|
display: flex;
|
|
501
503
|
flex-direction: column;
|
|
502
504
|
padding: 24px;
|
|
@@ -506,9 +508,9 @@
|
|
|
506
508
|
height: 100%;
|
|
507
509
|
|
|
508
510
|
${({theme:e,$highlight:t})=>t&&`background-color: ${e.stigg.palette.backgroundSection}`};
|
|
509
|
-
`;function Ql({entitlement:e,subscriptionPrice:t,onManageSubscription:o,onBuyMore:r,hasCustomSubscription:n,canUpgradeSubscription:i}){var s,c,u;let{theme:a}=Y(),l=!e.hasUnlimitedUsage&&e.currentUsage>e.usageLimit;return e.feature?jsxRuntime.jsxs(sr,{$highlight:!!t,$borderColor:a.borderColor,children:[jsxRuntime.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:16},children:[jsxRuntime.jsx(Ae,{variant:"body1",children:e.feature&&Wl(e.feature)}),t&&jsxRuntime.jsx(We,{title:jsxRuntime.jsx(
|
|
511
|
+
`;function Ql({entitlement:e,subscriptionPrice:t,onManageSubscription:o,onBuyMore:r,hasCustomSubscription:n,canUpgradeSubscription:i}){var s,c,u;let{theme:a}=Y(),l=!e.hasUnlimitedUsage&&e.currentUsage>e.usageLimit;return e.feature?jsxRuntime.jsxs(sr,{$highlight:!!t,$borderColor:a.borderColor,children:[jsxRuntime.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:16},children:[jsxRuntime.jsx(Ae,{variant:"body1",children:e.feature&&Wl(e.feature)}),t&&jsxRuntime.jsx(We,{title:jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{variant:"body1",children:t.billingModel===sdk.BillingModel.PerUnit?"Billed for committed usage":"Billed for actual usage"}),children:jsxRuntime.jsx(chunkIVDIW747_cjs_js.i,{icon:"DollarCoin",svgStrokeColor:a.iconsColor})})]}),jsxRuntime.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:8},children:[jsxRuntime.jsxs(Ae,{variant:"body1",color:l?"error":"primary","data-testid":`usage-data-${(s=e.feature)==null?void 0:s.refId}`,children:[(c=e.currentUsage)==null?void 0:c.toLocaleString(),!e.hasUnlimitedUsage&&` / ${(u=e.usageLimit)==null?void 0:u.toLocaleString()} (${je(e.currentUsage||0,e.usageLimit)}%)`]}),jsxRuntime.jsx(Xo,{featureEntitlement:e,feature:e.feature,onBuyMore:r,canBuyMore:!!t,onManageSubscription:o,canUpgradeSubscription:i,hasCustomSubscription:n})]}),jsxRuntime.jsx(qo,{entitlement:e}),!e.hasUnlimitedUsage&&!Yl__default.default(e.usageLimit)&&!Yl__default.default(e.currentUsage)&&e.resetPeriod&&e.usagePeriodEnd?jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{color:"secondary",children:bl(e)}):null,e.hasUnlimitedUsage&&jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{color:"secondary",children:"In current billing period"})]}):null}function jn({currentUsage:e,usageLimit:t}){return jsxRuntime.jsx(Ko,{currentUsage:e,usageLimit:t,classNamePrefix:"stigg-credit-usage-progress-bar"})}function ei(e){return Z(e).format("MMM D, YYYY h:mmA")}function ti(e){return Z(e).format("MMM D, YYYY")}function by(e){let t=i=>Math.ceil(Z.utc(e).diff(Z.utc(),i,true)),o=t("days");if(o>1)return `in ${o} days`;let r=t("hours");return r>1?`in ${r} hours`:`in ${t("minutes")} minutes`}function cr(e){let{usagePeriodEnd:t,formatter:o}=e;return !t||t.getTime()<=Date.now()?null:`Refreshes ${o?o(t):by(t)}`}function dr({creditEntitlement:e}){let{theme:t,textOverrides:o}=Y(),{currency:r,currentUsage:n,usageLimit:i}=e,a=(n!=null?n:0)>(i!=null?i:0),l=je(n!=null?n:0,i!=null?i:0),s=Zl(e),c=cr({usagePeriodEnd:e.usagePeriodEnd?new Date(e.usagePeriodEnd):void 0,formatter:o.formatResetPeriod});return jsxRuntime.jsxs(sr,{$highlight:false,$borderColor:t.borderColor,className:"stigg-credit-usage-container",children:[jsxRuntime.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:16},children:jsxRuntime.jsx(Ae,{variant:"body1",className:"stigg-credit-usage-title",children:s})}),jsxRuntime.jsx("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:8},children:jsxRuntime.jsxs(Ae,{variant:"body1",color:a?"error":"primary",className:"stigg-credit-usage-value","data-testid":`credit-usage-data-${r.currencyId}`,children:[(n!=null?n:0).toLocaleString()," / ",(i!=null?i:0).toLocaleString()," (",l,"%)"]})}),jsxRuntime.jsx(jn,{currentUsage:n!=null?n:0,usageLimit:i!=null?i:0}),c&&jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{color:"secondary",children:c})]})}function ql({featureEntitlements:e,creditEntitlements:t,subscriptionPriceByFeature:o,gridSizeXs:r,onManageSubscription:n,onBuyMore:i,hasCustomSubscription:a,canUpgradeSubscription:l}){return jsxRuntime.jsxs(Re__default.default,{container:true,spacing:4,children:[e.filter(s=>!!s.feature).map(s=>{let c=s.feature;return jsxRuntime.jsx(Re__default.default,{className:`stigg-entitlement-usage-${c.refId}`,item:true,xs:r,children:jsxRuntime.jsx(Ql,{entitlement:s,subscriptionPrice:o[c.refId],onManageSubscription:n,onBuyMore:i,hasCustomSubscription:a,canUpgradeSubscription:l})},c.refId)}),t.map(s=>jsxRuntime.jsx(Re__default.default,{className:`stigg-credit-usage-${s.currency.currencyId}`,item:true,xs:r,children:jsxRuntime.jsx(dr,{creditEntitlement:s})},s.currency.currencyId))]})}var Xl=chunkIVDIW747_cjs_js.e.div`
|
|
510
512
|
margin-top: 32px;
|
|
511
|
-
`;function jl(){let e=me("md");return jsxRuntime.jsx(Re__default.default,{container:true,spacing:4,className:"stigg-subscription-usage-skeleton-layout",sx:{flexWrap:"wrap"},children:Ty__default.default(6).map(t=>jsxRuntime.jsx(Re__default.default,{item:true,xs:e?4:12,children:jsxRuntime.jsx(Je__default.default,{width:280,height:120})},t))})}function ec({showAll:e,onToggle:t}){return jsxRuntime.jsx(Xl,{children:jsxRuntime.jsx(Xe,{className:"stigg-usage-toggle-many-button",variant:"text",startIcon:e?jsxRuntime.jsx(reactFeather.Minus,{}):jsxRuntime.jsx(reactFeather.Plus,{}),onClick:t,children:e?"Show less":"Show more"})})}function ur({onManageSubscription:e,onBuyMore:t,filterEntitlements:o,filterPackageEntitlements:r}){let{textOverrides:n,theme:i}=Y(),{isLoadingData:a,entitlementsToShow:l,creditsToShow:s,subscriptionPriceByFeature:c,gridSizeXs:u,hasCustomSubscription:f,canUpgradeSubscription:y,showAll:p,toggleShowAll:g,hasNoItems:h,showMoreVisible:P}=Hl({filterEntitlements:o,filterPackageEntitlements:r});return h?null:jsxRuntime.jsxs(Ue,{className:"stigg-subscription-usage-layout",$backgroundColor:i.backgroundColor,$borderColor:i.borderColor,children:[jsxRuntime.jsx(Ne,{children:jsxRuntime.jsx(Me,{title:n.usageTabTitle,className:"stigg-customer-portal-usage-section-title",isLoading:a})}),a?jsxRuntime.jsx(jl,{}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(ql,{featureEntitlements:l,creditEntitlements:s,subscriptionPriceByFeature:c,gridSizeXs:u,onManageSubscription:e,onBuyMore:t,hasCustomSubscription:f,canUpgradeSubscription:y}),P&&jsxRuntime.jsx(ec,{showAll:p,onToggle:g})]})]})}function rc({onManageSubscription:e,onBuyMore:t,filterEntitlements:o,filterPackageEntitlements:r,onCancelScheduledUpdates:n,onContactSupport:i,paywallComponent:a,hiddenSections:l}){let{customerPortal:s,textOverrides:c,theme:u,isLoading:f,showWatermark:y}=Y(),p=yi.useRef(null),g=({intentionType:x})=>{var A,S;e?e({intentionType:x,customerSubscriptions:(A=s==null?void 0:s.subscriptions)!=null?A:[]}):(S=p==null?void 0:p.current)==null||S.scrollIntoView({behavior:"smooth"});},h=!(l!=null&&l.some(x=>x==="usage")),P=!(l!=null&&l.some(x=>x==="paymentDetails"||x==="billingInformation")),b=!(l!=null&&l.some(x=>x==="invoices"||x==="billingInformation"));return jsxRuntime.jsxs(Rl,{className:"stigg-customer-portal-layout",children:[jsxRuntime.jsx(Fl,{showWatermark:y}),jsxRuntime.jsxs(Ul,{className:"stigg-customer-portal-sections",children:[jsxRuntime.jsx(tr,{onCancelScheduledUpdates:n,onBuyMore:t,onManageSubscription:g,onContactSupport:i,hiddenSections:l,cancelScheduledUpdatesButtonTitle:c.cancelScheduledUpdatesButtonTitle}),h&&jsxRuntime.jsx(ur,{onManageSubscription:g,onBuyMore:t,filterEntitlements:o,filterPackageEntitlements:r}),jsxRuntime.jsx(Jn,{ref:p,paywallComponent:a,theme:u,title:c.paywallSectionTitle,isLoading:!s||f}),P&&jsxRuntime.jsx(ar,{}),b&&jsxRuntime.jsx(gr,{})]})]})}function ic(i){var a=i,{textOverrides:e,theme:t,resourceId:o,productId:r}=a,n=chunkYAS4WG6F_cjs_js.c(a,["textOverrides","theme","resourceId","productId"]);return jsxRuntime.jsx(Do,{textOverrides:e,theme:t,resourceId:o,productId:r,children:jsxRuntime.jsx(rc,chunkYAS4WG6F_cjs_js.a({},n))})}function gr(){let{customerPortal:e,isLoading:t,textOverrides:o,theme:r}=Y(),n=!e||t,i=n?jsxRuntime.jsx(nr,{}):e!=null&&e.billingPortalUrl?jsxRuntime.jsx(or,{url:e.billingPortalUrl,text:o.viewInvoiceHistory,className:"stigg-view-invoice-history-button"}):null;return !n&&!(e!=null&&e.billingPortalUrl)?null:jsxRuntime.jsx(Ue,{className:"stigg-invoices-section-layout",$backgroundColor:r.backgroundColor,$borderColor:r.borderColor,children:jsxRuntime.jsxs(Ne,{className:"stigg-invoices-section-header",children:[jsxRuntime.jsx(Me,{isLoading:n,className:"stigg-invoices-section-title",title:o.invoicesTitle}),i]})})}var sc=e=>ac__default.default(e,"displayName"),ni=e=>ac__default.default(e,"addon.displayName");function lt(e){var r,n;let t=(r=e.pricePoints)==null?void 0:r.some(i=>i.amount&&i.amount>0);return !!((n=e.hiddenFromWidgets)!=null&&n.includes(jsClientSdk.WidgetType.Checkout))&&!t}function Ey(e,t){return e.pricePoints.some(o=>o.billingPeriod===t)}function lc({addon:e,currency:t,billingCountryCode:o}){return chunkYAS4WG6F_cjs_js.b(chunkYAS4WG6F_cjs_js.a({},e),{pricePoints:e.pricePoints.filter(r=>r.currency===t&&(o?r.billingCountryCode===o:true))})}function cc({addons:e,billingCountryCode:t,currency:o}){return (e==null?void 0:e.map(r=>lc({addon:r,currency:o,billingCountryCode:t})))||[]}function dc({addons:e,billingPeriod:t,billingCountryCode:o,currency:r}){var n;return ((n=e==null?void 0:e.filter(i=>Ey(i.addon,t)))==null?void 0:n.map(i=>chunkYAS4WG6F_cjs_js.b(chunkYAS4WG6F_cjs_js.a({},i),{addon:lc({addon:i.addon,currency:r,billingCountryCode:o})})))||[]}function pc({activeSubscription:e,plan:t,billingCountryCode:o,billingPeriod:r}){var c,u;let n=[],i=((u=(c=t==null?void 0:t.pricePoints)==null?void 0:c[0])==null?void 0:u.currency)||jsClientSdk.Currency.Usd,a=cc({addons:t==null?void 0:t.compatibleAddons,billingCountryCode:o,currency:i}),l=sc(a.filter(f=>!lt(f))),s=dc({addons:e==null?void 0:e.addons,billingPeriod:r,billingCountryCode:o,currency:i});return s!=null&&s.length&&(a!=null&&a.length)&&(n=ni(s.filter(f=>a.some(y=>y.id===f.addon.id)))),{addons:n,initialAddons:Ly__default.default(n),availableAddons:l}}function Ry(){let[,e]=_();return (t,o)=>e(r=>{if(lt(t))return;let n=r.addonsStep.addons.find(i=>i.addon.id===t.id);if(n){if(lt(n.addon))return;n.quantity=o;}else r.addonsStep.addons.push({addon:t,quantity:o}),r.addonsStep.addons=ni(r.addonsStep.addons);})}function Uy(){let[,e]=_();return t=>e(o=>{let r=o.addonsStep.addons.find(n=>n.addon.id===t);r&<(r.addon)||Ny__default.default(o.addonsStep.addons,n=>n.addon.id===t);})}function _y(){let[{addonsStep:e}]=_();return e}function mc(){let e=_y();return chunkYAS4WG6F_cjs_js.b(chunkYAS4WG6F_cjs_js.a({},e),{setAddon:Ry(),removeAddon:Uy()})}function Dy(){let[{checkout:e,widgetState:t,checkoutLocalization:o,checkoutSuccess:r}]=_();return {checkoutState:e,widgetState:t,checkoutLocalization:o,checkoutSuccess:r}}function $y(){let[,e]=_();return t=>e(o=>{o.widgetState.readOnly=t;})}function Gy(){let[,e]=_();return t=>e(o=>{o.widgetState.isValid=t;})}function zy(){let[,e]=_();return t=>e(o=>{o.checkoutSuccess=t;})}function D(){let{checkoutState:e,widgetState:t,checkoutLocalization:o,checkoutSuccess:r}=Dy();return {checkoutState:e,widgetState:t,checkoutLocalization:o,checkoutSuccess:r,setWidgetReadOnly:$y(),setIsValid:Gy(),setCheckoutSuccess:zy()}}function Hy(e){var t;return (t=e==null?void 0:e.plan)!=null&&t.pricePoints?chunkYAS4WG6F_cjs_js.b(chunkYAS4WG6F_cjs_js.a({},e),{plan:chunkYAS4WG6F_cjs_js.b(chunkYAS4WG6F_cjs_js.a({},e.plan),{pricePoints:e.plan.pricePoints.filter(o=>o.pricingModel!==jsClientSdk.BillingModel.CreditBased)})}):e}function gc({planId:e,resourceId:t,billingCountryCode:o,onMockCheckoutState:r}){let{stigg:n}=chunkYAS4WG6F_cjs_js.u(),[i,a]=yi.useState(true),[l,s]=yi.useState();return yi.useEffect(()=>{let c=()=>chunkYAS4WG6F_cjs_js.d(null,null,function*(){try{let u=yield n.getCheckoutState({planId:e,resourceId:t,billingCountryCode:o});s(Hy(u));}catch(u){chunkYAS4WG6F_cjs_js.r.error(`Failed to load checkout ${u==null?void 0:u.message}`,u);}finally{a(false);}});if(r){a(false);let u=r({planId:e,resourceId:t,billingCountryCode:o});s(u);return}n.isCustomerLoaded&&(a(true),c());},[n,n.isCustomerLoaded,t,e,o,r]),{checkout:l,isLoading:i,showWatermark:n.getShowWatermark()}}var yr=(e,t)=>e.minUnitQuantity&&t<e.minUnitQuantity?e.minUnitQuantity:e.maxUnitQuantity&&t>e.maxUnitQuantity?e.maxUnitQuantity:t;var ii=e=>!!(e!=null&&e.pricePoints.some(t=>t.billingPeriod===sdk.BillingPeriod.Monthly)),ai=e=>!!(e!=null&&e.pricePoints.some(t=>t.billingPeriod===sdk.BillingPeriod.Annually)),yc=e=>ii(e)&&ai(e);var Pc=(e,t,o)=>e===sdk.BillingPeriod.Monthly&&t||e===sdk.BillingPeriod.Annually&&o?e:null,xc=({pricingModel:e})=>e===jsClientSdk.BillingModel.PerUnit;function Zy(e,t,o){var i;if(!t)return [];let r=Dl__default.default(e,"featureId"),n=Dl__default.default(Cc__default.default((i=o==null?void 0:o.prices)==null?void 0:i.map(a=>{let{feature:l}=a;return !l||!xc(a)?null:{featureId:l.featureId,quantity:l.unitQuantity||null}})),"featureId");return Cc__default.default(t==null?void 0:t.map(a=>{var u,f,y;let l=(u=a.feature)==null?void 0:u.featureId;if(!l||!xc(a))return null;let s,c=((f=r[l])==null?void 0:f.quantity)||((y=n[l])==null?void 0:y.quantity);return s=yr(a,c||1),a.isTieredPrice&&!Wt(a.tiers)&&(s=Pn(a.tiers,s).upTo),{featureId:l,quantity:s}}))}function Yy({plan:e,activeSubscription:t,preferredBillingPeriod:o}){var a,l;let r=ii(e),n=ai(e);if(o){let s=Pc(o,r,n);if(s)return s}if(((a=t==null?void 0:t.plan)==null?void 0:a.id)===(e==null?void 0:e.id))return ((l=t==null?void 0:t.price)==null?void 0:l.billingPeriod)||sdk.BillingPeriod.Monthly;if(t!=null&&t.prices&&(t==null?void 0:t.prices.length)>0){let s=Pc(t==null?void 0:t.prices[0].billingPeriod,r,n);if(s)return s}return n?sdk.BillingPeriod.Annually:sdk.BillingPeriod.Monthly}function bc({preferredBillingPeriod:e,plan:t,activeSubscription:o,billingCountryCode:r,preconfiguredBillableFeatures:n}){let i=Yy({plan:t,activeSubscription:o,preferredBillingPeriod:e}),a=t==null?void 0:t.pricePoints.filter(s=>s.billingPeriod===i),l=Zy(n,a,o);return {billingPeriod:i,billableFeatures:l,billingCountryCode:r}}function Qy(){let[{planStep:e}]=_();return e}function Ky(){let[,e]=_();return (t,o)=>e(r=>{let n=r.planStep.billableFeatures.find(i=>i.featureId===t);n?n.quantity=o:r.planStep.billableFeatures.push({featureId:t,quantity:o});})}function qy(){let[,e]=_();return t=>e(o=>{o.planStep.billingPeriod=t,o.addonsStep.addons=o.addonsStep.addons.filter(r=>r.addon.pricePoints.some(n=>n.billingPeriod===t));})}function be(){let e=Qy();return chunkYAS4WG6F_cjs_js.b(chunkYAS4WG6F_cjs_js.a({},e),{setBillingPeriod:qy(),setBillableFeature:Ky()})}var Tc=[{key:"PLAN",label:"Plan"},{key:"ADDONS",label:"Add-ons"},{key:"PAYMENT",label:"Payment details"}],Sc={activeStep:0,completedSteps:[],steps:Tc,isDisabled:false},Xy=(e,t,o,r)=>{if(yc(e)&&!r)return false;let n=t.map(a=>a.featureId),i=o.map(a=>a.featureId);return !(n.length!==i.length||!n.every(a=>i.includes(a)))};function kc({isLoading:e,skipCheckoutSteps:t,plan:o,availableAddons:r,availableCharges:n,preferredBillingPeriod:i,preconfiguredBillableFeatures:a}){if(e||!o)return Sc;let l=[];return t.includes("PLAN")&&Xy(o,n,a,i)&&l.push("PLAN"),((r==null?void 0:r.length)===0||t.includes("ADDONS"))&&l.push("ADDONS"),chunkYAS4WG6F_cjs_js.b(chunkYAS4WG6F_cjs_js.a({},Sc),{steps:Tc.filter(s=>!l.includes(s.key))})}function jy(){let[{progressBar:e}]=_();return e}function eh(){let[e,t]=_();return o=>chunkYAS4WG6F_cjs_js.d(null,null,function*(){let{progressBar:r,planStep:n,addonsStep:i,paymentStep:a,onBeforeStepChange:l}=e;if(o!==r.activeStep&&l){let s=r.steps[r.activeStep],c=r.steps[o];if(s&&c){let u={planStep:n,addonsStep:i,paymentStep:a};if(!(yield l({from:s.key,to:c.key,state:u})))return}}t(({progressBar:s})=>{s.activeStep=o;});})}function th(){let[,e]=_();return t=>e(({progressBar:o})=>{o.completedSteps.push(t);})}function oh(e){return e.completedSteps.length>=e.steps.length-1}function rh(){let[e,t]=_();return ()=>chunkYAS4WG6F_cjs_js.d(null,null,function*(){let{progressBar:o,planStep:r,addonsStep:n,paymentStep:i,onBeforeStepChange:a}=e;if(o.isDisabled)return;let l=o.steps[o.activeStep],s=o.steps[o.activeStep+1];if(s&&a){let c={planStep:r,addonsStep:n,paymentStep:i};if(!(yield a({from:l.key,to:s.key,state:c})))return}t(({progressBar:c})=>{c.completedSteps.includes(c.activeStep)||c.completedSteps.push(c.activeStep),c.activeStep<c.steps.length-1&&(c.activeStep+=1);});})}function nh(){let[,e]=_();return t=>e(({progressBar:o})=>{o.isDisabled=!!t;})}function _e(){let e=jy();return {currentStep:e.steps[e.activeStep],progressBarState:e,isLastStep:e.activeStep===e.steps.length-1,isCheckoutComplete:oh(e),setActiveStep:eh(),markStepAsCompleted:th(),goNext:rh(),setIsDisabled:nh()}}function It(){let[{planStep:e,addonsStep:t,promotionCode:o,paymentStep:r}]=_();return chunkYAS4WG6F_cjs_js.b(chunkYAS4WG6F_cjs_js.a({},e),{addons:t.addons,promotionCode:o,billingAddress:r.billingAddress,taxPercentage:r.taxPercentage,taxId:r.taxId})}function hr({billingAddress:e,taxPercentage:t,taxIds:o,prorationBehavior:r}){if(!e&&!t&&!(o!=null&&o.length)&&!r)return {};let n=o!=null&&o.length?o==null?void 0:o.filter(i=>i.value&&i.type):void 0;return {billingInformation:chunkYAS4WG6F_cjs_js.a(chunkYAS4WG6F_cjs_js.b(chunkYAS4WG6F_cjs_js.a(chunkYAS4WG6F_cjs_js.a({},e?{billingAddress:e}:{}),t?{taxPercentage:t}:{}),{taxIds:n}),r?{prorationBehavior:r}:{})}}function sh(e){return e.pricingModel===jsClientSdk.BillingModel.PerUnit&&e.billingCadence===jsClientSdk.BillingCadence.Recurring&&!!e.topUpCustomCurrencyId}function lh(e){return e!=null&&e.pricePoints?e.pricePoints.some(sh):false}function Cr({resetBillingPeriod:e,activeSubscription:t}){if(!t)return {};let o=lh(t.plan);return e!==void 0?{billingCycleAnchor:e?jsClientSdk.SubscriptionBillingCycleAnchor.Now:jsClientSdk.SubscriptionBillingCycleAnchor.Unchanged,prorationBehavior:o?jsClientSdk.SubscriptionProrationBehavior.None:void 0}:o?{billingCycleAnchor:jsClientSdk.SubscriptionBillingCycleAnchor.Now,prorationBehavior:jsClientSdk.SubscriptionProrationBehavior.None}:{}}var mh=h=>chunkYAS4WG6F_cjs_js.d(null,[h],function*({stigg:e,customerId:t,resourceId:o,promotionCode:r,addons:n,billableFeatures:i,billingCountryCode:a,billingPeriod:l,billingAddress:s,taxPercentage:c,taxIds:u,plan:f,activeSubscription:y,resetBillingPeriod:p,onMockCheckoutPreview:g}){var F;let P=n.map(({addon:T,quantity:k})=>({addonId:T.id,quantity:k})),b=null,x=null,{prorationBehavior:A,billingCycleAnchor:S}=Cr({activeSubscription:y,resetBillingPeriod:p});try{if(t&&(f!=null&&f.id)){let T=chunkYAS4WG6F_cjs_js.a(chunkYAS4WG6F_cjs_js.a({customerId:t,planId:f.id,resourceId:o,billingCountryCode:a,addons:P,billingPeriod:l,promotionCode:r,billableFeatures:Qg__default.default(i)?void 0:i},hr({billingAddress:s,taxPercentage:c,taxIds:u,prorationBehavior:A})),S?{billingCycleAnchor:S}:{});b=g?g(T):yield e.previewSubscription(T);}}catch(T){let[,k]=((F=T==null?void 0:T.message)==null?void 0:F.split("Error:"))||[];x=k==null?void 0:k.trim();}return {subscriptionPreview:b,errorMessage:x}}),ci=({onMockCheckoutPreview:e}={})=>{let{stigg:t}=chunkYAS4WG6F_cjs_js.u(),o=It(),[{resourceId:r,resetBillingPeriod:n}]=_(),{checkoutState:i,widgetState:a}=D(),{plan:l,customer:s,activeSubscription:c}=i||{};return {previewSubscriptionAction:yi.useCallback((...y)=>chunkYAS4WG6F_cjs_js.d(null,[...y],function*({promotionCode:f}={}){return a.isValid?mh({stigg:t,customerId:s==null?void 0:s.id,resourceId:r,addons:o.addons,billableFeatures:o.billableFeatures,billingCountryCode:o.billingCountryCode,billingPeriod:o.billingPeriod,billingAddress:o.billingAddress,taxPercentage:o.taxPercentage,promotionCode:f!=null?f:o.promotionCode,taxIds:o.taxId?[o.taxId]:void 0,plan:l,activeSubscription:c,resetBillingPeriod:n,onMockCheckoutPreview:e}):{subscriptionPreview:null,errorMessage:null}}),[t,s==null?void 0:s.id,l,r,n,o.addons,o.billableFeatures,o.billingCountryCode,o.billingPeriod,o.billingAddress,o.taxPercentage,o.taxId,o.promotionCode,a.isValid,c,e])}},uh=500,Bc=({onMockCheckoutPreview:e}={})=>{let[t,o]=yi.useState(null),[r,n]=yi.useState(null),[i,a]=yi.useState(false),{previewSubscriptionAction:l}=ci({onMockCheckoutPreview:e});return yi.useEffect(()=>{let s=()=>chunkYAS4WG6F_cjs_js.d(null,null,function*(){let{subscriptionPreview:u,errorMessage:f}=yield l();u&&(o(u),n(null)),f&&(n(f),o(null)),a(false);});a(true);let c=setTimeout(()=>{a(true),s();},uh);return ()=>{clearTimeout(c);}},[l]),{subscriptionPreview:t,isFetchingSubscriptionPreview:i,errorMessage:r}};function Ac({customer:e,taxPercentage:t,taxId:o}){return {useNewPaymentMethod:!(e!=null&&e.paymentMethodDetails),taxPercentage:t,taxId:o}}function gh(){let[,e]=_();return yi.useCallback(t=>e(o=>{o.paymentStep.useNewPaymentMethod=t;}),[e])}function fh(){let[,e]=_();return yi.useCallback(t=>e(o=>{o.paymentStep.errorMessage=t;}),[e])}function yh(){let[,e]=_();return yi.useCallback(t=>e(o=>{o.paymentStep.billingAddress=t;}),[e])}function hh(){let[{paymentStep:e}]=_();return e}function Ch(){let[,e]=_();return yi.useCallback(t=>e(o=>{o.paymentStep.taxId=t;}),[e])}function re(){let e=hh();return chunkYAS4WG6F_cjs_js.b(chunkYAS4WG6F_cjs_js.a({},e),{setUseNewPaymentMethod:gh(),setErrorMessage:fh(),setBillingAddress:yh(),setTaxId:Ch()})}function Fc(e){return Lg__default.default({changePlan:"Change",billingPeriodsTitle:"Billing cycle",addAddonText:"Add",addonBillingPeriodNotAvailableText:({planBillingPeriod:o})=>o===jsClientSdk.BillingPeriod.Monthly?"Exclusively available on annual plans":"Exclusively available on monthly plans",newPaymentMethodText:"New payment method",newPaymentMethodBillingAddressTitle:"Billing address",newPaymentMethodCardTitle:"Payment method",summary:{title:"Order summary",planName:({plan:o})=>`${o.displayName} plan`,addCouponCodeText:"Add promotion code",couponCodeTitle:"Promotion code",addonsSectionTitle:"Add-ons",discountsSectionTitle:"Discounts",onlyPayAsYouGoText:"Varies by usage",startsAtText:"Starts at ",proratedTotalDueText:"Prorated charge today",baseChargeText:()=>"Base charge",totalText:"Total",totalDueText:"Total due today",totalBillingPeriodText:({billingPeriod:o})=>`Billed ${o.toLowerCase()}`,appliedCreditsTitle:"Applied credits",creditsForUnusedTimeText:({credits:o})=>`Your account will be granted credits worth ${o} for unused time, which will be automatically applied to future payments.`,discountText:({discountDetails:o,currency:r})=>{let n="";o.type===jsClientSdk.DiscountType.Percentage?n=`${o.value}% off`:n=`${H({amount:o.value,currency:r})}`;let i="";switch(o.durationType){case jsClientSdk.DiscountDurationType.Once:{i=" once";break}case jsClientSdk.DiscountDurationType.Repeating:{i=`${o.type===jsClientSdk.DiscountType.Fixed?" per month":""} for ${o.durationInMonths} months`;break}case jsClientSdk.DiscountDurationType.Forever:default:i="";}return `${n}${i}`},taxTitle:({taxDetails:o})=>`Tax (${o==null?void 0:o.percentage}%)`,changesWillApplyAtEndOfBillingPeriod:({billingPeriodEnd:o})=>`Your changes will take effect at the end of your current billing cycle on ${Z(o).format("MMMM D, YYYY")}.`,checkoutSuccessText:"Changes applied",payAsYouGoTooltipText:"Billed according to actual usage"},checkoutButton:{nextText:"Next",noChangesText:"No changes",updateText:"Update subscription",downgradeToFreeText:"Cancel subscription",upgradeText:"Subscribe"},downgradeToFree:{alertText:()=>"We\u2019re sorry to see you cancel your paid subscription \u{1F62D}",freePlanHeader:()=>"New plan",freePlanName:({plan:o})=>`${o.displayName}`,freePlanPriceText:()=>"Free",paidPlanHeader:()=>"Current plan",paidPlanName:({plan:o})=>`${o.displayName}`,paidPlanPriceText:({billingPeriod:o})=>`Paid plan${o?`, billed ${o.toLowerCase()}`:""}`},nextBillingCaption:()=>""},e)}var no={primary:"rgb(50, 126, 238)",textColor:"rgb(0, 30, 108)",backgroundColor:"rgb(255, 255, 255)",borderColor:"rgb(235, 237, 243)",summaryBackgroundColor:"rgb(109, 121, 144)"};function vc(e,t,o){let{palette:r}=e||{};return {primary:(t==null?void 0:t.primary)||(r==null?void 0:r.primary)||no.primary,textColor:(t==null?void 0:t.textColor)||(r==null?void 0:r.text.primary)||no.textColor,backgroundColor:(t==null?void 0:t.backgroundColor)||(r==null?void 0:r.backgroundPaper)||no.backgroundColor,borderColor:(t==null?void 0:t.borderColor)||(r==null?void 0:r.outlinedBorder)||no.borderColor,summaryBackgroundColor:(t==null?void 0:t.summaryBackgroundColor)||(r==null?void 0:r.backgroundHighlight)||no.summaryBackgroundColor,paymentInputBackgroundColor:t==null?void 0:t.paymentInputBackgroundColor,paymentInputBorderColor:t==null?void 0:t.paymentInputBorderColor,paymentInputBorderRadius:t==null?void 0:t.paymentInputBorderRadius}}var mi=yi__default.default.createContext(null);mi.displayName="CheckoutContext";var _=()=>{let e=yi.useContext(mi);if(!e)throw new Error("Could not find Checkout context; You need to wrap your checkout components in an <CheckoutProvider> component.");return e},Ah=({children:e,initialState:t})=>{let[o,r]=yi.useState(t);yi.useEffect(()=>{r(t);},[t]);let n=yi.useCallback(l=>r(s=>immer.produce(s,c=>l(c))),[r]),[i,a]=yi.useMemo(()=>[o,n],[n,o]);return jsxRuntime.jsx(mi.Provider,{value:[i,a],children:e})};function Lc({children:e,textOverrides:t,theme:o,preferredBillingPeriod:r,billableFeatures:n,resourceId:i,planId:a,billingCountryCode:l,billingInformation:s,onMockCheckoutState:c,skipCheckoutSteps:u,onBeforeStepChange:f,resetBillingPeriod:y}){var A;let{checkout:p,isLoading:g,showWatermark:h}=gc({resourceId:i,planId:a,billingCountryCode:l,onMockCheckoutState:c}),P=p!=null&&p.configuration?xs(p.configuration):{typography:Jt(null,Ro)},b=chunkYAS4WG6F_cjs_js.v(P),x=yi.useMemo(()=>{var L,N;let S=vc(b,o,p==null?void 0:p.configuration),F=Fc(t),T=bc({preferredBillingPeriod:r,plan:p==null?void 0:p.plan,activeSubscription:p==null?void 0:p.activeSubscription,billingCountryCode:l,preconfiguredBillableFeatures:n!=null?n:[]}),k=pc({plan:p==null?void 0:p.plan,activeSubscription:p==null?void 0:p.activeSubscription,billingPeriod:T.billingPeriod}),w=Ac({customer:p==null?void 0:p.customer,taxPercentage:(L=s==null?void 0:s.taxDetails)==null?void 0:L.taxPercentage}),I=kc({isLoading:g,skipCheckoutSteps:u!=null?u:[],plan:p==null?void 0:p.plan,availableAddons:k.availableAddons,availableCharges:T.billableFeatures,preferredBillingPeriod:r,preconfiguredBillableFeatures:n!=null?n:[]});return {checkout:p,checkoutLocalization:F,stiggTheme:b,theme:S,progressBar:I,planStep:T,addonsStep:k,paymentStep:w,resourceId:(N=p==null?void 0:p.resource)==null?void 0:N.id,widgetState:{readOnly:false,isValid:true,isLoadingCheckoutData:g},showWatermark:h,checkoutSuccess:false,onBeforeStepChange:f,resetBillingPeriod:y}},[r,l,p,g,u,(A=s==null?void 0:s.taxDetails)==null?void 0:A.taxPercentage,f,y]);return jsxRuntime.jsx(chunkYAS4WG6F_cjs_js.w,{componentTheme:P,children:jsxRuntime.jsx(Ah,{initialState:x,children:e})},p==null?void 0:p.plan.id)}var Nc="920px",Rc=chunkYAS4WG6F_cjs_js.e.div`
|
|
513
|
+
`;function jl(){let e=me("md");return jsxRuntime.jsx(Re__default.default,{container:true,spacing:4,className:"stigg-subscription-usage-skeleton-layout",sx:{flexWrap:"wrap"},children:Ty__default.default(6).map(t=>jsxRuntime.jsx(Re__default.default,{item:true,xs:e?4:12,children:jsxRuntime.jsx(Je__default.default,{width:280,height:120})},t))})}function ec({showAll:e,onToggle:t}){return jsxRuntime.jsx(Xl,{children:jsxRuntime.jsx(Xe,{className:"stigg-usage-toggle-many-button",variant:"text",startIcon:e?jsxRuntime.jsx(reactFeather.Minus,{}):jsxRuntime.jsx(reactFeather.Plus,{}),onClick:t,children:e?"Show less":"Show more"})})}function ur({onManageSubscription:e,onBuyMore:t,filterEntitlements:o,filterPackageEntitlements:r}){let{textOverrides:n,theme:i}=Y(),{isLoadingData:a,entitlementsToShow:l,creditsToShow:s,subscriptionPriceByFeature:c,gridSizeXs:u,hasCustomSubscription:f,canUpgradeSubscription:y,showAll:p,toggleShowAll:g,hasNoItems:h,showMoreVisible:P}=Hl({filterEntitlements:o,filterPackageEntitlements:r});return h?null:jsxRuntime.jsxs(Ue,{className:"stigg-subscription-usage-layout",$backgroundColor:i.backgroundColor,$borderColor:i.borderColor,children:[jsxRuntime.jsx(Ne,{children:jsxRuntime.jsx(Me,{title:n.usageTabTitle,className:"stigg-customer-portal-usage-section-title",isLoading:a})}),a?jsxRuntime.jsx(jl,{}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(ql,{featureEntitlements:l,creditEntitlements:s,subscriptionPriceByFeature:c,gridSizeXs:u,onManageSubscription:e,onBuyMore:t,hasCustomSubscription:f,canUpgradeSubscription:y}),P&&jsxRuntime.jsx(ec,{showAll:p,onToggle:g})]})]})}function rc({onManageSubscription:e,onBuyMore:t,filterEntitlements:o,filterPackageEntitlements:r,onCancelScheduledUpdates:n,onContactSupport:i,paywallComponent:a,hiddenSections:l}){let{customerPortal:s,textOverrides:c,theme:u,isLoading:f,showWatermark:y}=Y(),p=yi.useRef(null),g=({intentionType:x})=>{var A,S;e?e({intentionType:x,customerSubscriptions:(A=s==null?void 0:s.subscriptions)!=null?A:[]}):(S=p==null?void 0:p.current)==null||S.scrollIntoView({behavior:"smooth"});},h=!(l!=null&&l.some(x=>x==="usage")),P=!(l!=null&&l.some(x=>x==="paymentDetails"||x==="billingInformation")),b=!(l!=null&&l.some(x=>x==="invoices"||x==="billingInformation"));return jsxRuntime.jsxs(Rl,{className:"stigg-customer-portal-layout",children:[jsxRuntime.jsx(Fl,{showWatermark:y}),jsxRuntime.jsxs(Ul,{className:"stigg-customer-portal-sections",children:[jsxRuntime.jsx(tr,{onCancelScheduledUpdates:n,onBuyMore:t,onManageSubscription:g,onContactSupport:i,hiddenSections:l,cancelScheduledUpdatesButtonTitle:c.cancelScheduledUpdatesButtonTitle}),h&&jsxRuntime.jsx(ur,{onManageSubscription:g,onBuyMore:t,filterEntitlements:o,filterPackageEntitlements:r}),jsxRuntime.jsx(Jn,{ref:p,paywallComponent:a,theme:u,title:c.paywallSectionTitle,isLoading:!s||f}),P&&jsxRuntime.jsx(ar,{}),b&&jsxRuntime.jsx(gr,{})]})]})}function ic(i){var a=i,{textOverrides:e,theme:t,resourceId:o,productId:r}=a,n=chunkIVDIW747_cjs_js.c(a,["textOverrides","theme","resourceId","productId"]);return jsxRuntime.jsx(Do,{textOverrides:e,theme:t,resourceId:o,productId:r,children:jsxRuntime.jsx(rc,chunkIVDIW747_cjs_js.a({},n))})}function gr(){let{customerPortal:e,isLoading:t,textOverrides:o,theme:r}=Y(),n=!e||t,i=n?jsxRuntime.jsx(nr,{}):e!=null&&e.billingPortalUrl?jsxRuntime.jsx(or,{url:e.billingPortalUrl,text:o.viewInvoiceHistory,className:"stigg-view-invoice-history-button"}):null;return !n&&!(e!=null&&e.billingPortalUrl)?null:jsxRuntime.jsx(Ue,{className:"stigg-invoices-section-layout",$backgroundColor:r.backgroundColor,$borderColor:r.borderColor,children:jsxRuntime.jsxs(Ne,{className:"stigg-invoices-section-header",children:[jsxRuntime.jsx(Me,{isLoading:n,className:"stigg-invoices-section-title",title:o.invoicesTitle}),i]})})}var sc=e=>ac__default.default(e,"displayName"),ni=e=>ac__default.default(e,"addon.displayName");function lt(e){var r,n;let t=(r=e.pricePoints)==null?void 0:r.some(i=>i.amount&&i.amount>0);return !!((n=e.hiddenFromWidgets)!=null&&n.includes(jsClientSdk.WidgetType.Checkout))&&!t}function Ey(e,t){return e.pricePoints.some(o=>o.billingPeriod===t)}function lc({addon:e,currency:t,billingCountryCode:o}){return chunkIVDIW747_cjs_js.b(chunkIVDIW747_cjs_js.a({},e),{pricePoints:e.pricePoints.filter(r=>r.currency===t&&(o?r.billingCountryCode===o:true))})}function cc({addons:e,billingCountryCode:t,currency:o}){return (e==null?void 0:e.map(r=>lc({addon:r,currency:o,billingCountryCode:t})))||[]}function dc({addons:e,billingPeriod:t,billingCountryCode:o,currency:r}){var n;return ((n=e==null?void 0:e.filter(i=>Ey(i.addon,t)))==null?void 0:n.map(i=>chunkIVDIW747_cjs_js.b(chunkIVDIW747_cjs_js.a({},i),{addon:lc({addon:i.addon,currency:r,billingCountryCode:o})})))||[]}function pc({activeSubscription:e,plan:t,billingCountryCode:o,billingPeriod:r}){var c,u;let n=[],i=((u=(c=t==null?void 0:t.pricePoints)==null?void 0:c[0])==null?void 0:u.currency)||jsClientSdk.Currency.Usd,a=cc({addons:t==null?void 0:t.compatibleAddons,billingCountryCode:o,currency:i}),l=sc(a.filter(f=>!lt(f))),s=dc({addons:e==null?void 0:e.addons,billingPeriod:r,billingCountryCode:o,currency:i});return s!=null&&s.length&&(a!=null&&a.length)&&(n=ni(s.filter(f=>a.some(y=>y.id===f.addon.id)))),{addons:n,initialAddons:Ly__default.default(n),availableAddons:l}}function Ry(){let[,e]=_();return (t,o)=>e(r=>{if(lt(t))return;let n=r.addonsStep.addons.find(i=>i.addon.id===t.id);if(n){if(lt(n.addon))return;n.quantity=o;}else r.addonsStep.addons.push({addon:t,quantity:o}),r.addonsStep.addons=ni(r.addonsStep.addons);})}function Uy(){let[,e]=_();return t=>e(o=>{let r=o.addonsStep.addons.find(n=>n.addon.id===t);r&<(r.addon)||Ny__default.default(o.addonsStep.addons,n=>n.addon.id===t);})}function _y(){let[{addonsStep:e}]=_();return e}function mc(){let e=_y();return chunkIVDIW747_cjs_js.b(chunkIVDIW747_cjs_js.a({},e),{setAddon:Ry(),removeAddon:Uy()})}function Dy(){let[{checkout:e,widgetState:t,checkoutLocalization:o,checkoutSuccess:r}]=_();return {checkoutState:e,widgetState:t,checkoutLocalization:o,checkoutSuccess:r}}function $y(){let[,e]=_();return t=>e(o=>{o.widgetState.readOnly=t;})}function Gy(){let[,e]=_();return t=>e(o=>{o.widgetState.isValid=t;})}function zy(){let[,e]=_();return t=>e(o=>{o.checkoutSuccess=t;})}function D(){let{checkoutState:e,widgetState:t,checkoutLocalization:o,checkoutSuccess:r}=Dy();return {checkoutState:e,widgetState:t,checkoutLocalization:o,checkoutSuccess:r,setWidgetReadOnly:$y(),setIsValid:Gy(),setCheckoutSuccess:zy()}}function Hy(e){var t;return (t=e==null?void 0:e.plan)!=null&&t.pricePoints?chunkIVDIW747_cjs_js.b(chunkIVDIW747_cjs_js.a({},e),{plan:chunkIVDIW747_cjs_js.b(chunkIVDIW747_cjs_js.a({},e.plan),{pricePoints:e.plan.pricePoints.filter(o=>o.pricingModel!==jsClientSdk.BillingModel.CreditBased)})}):e}function gc({planId:e,resourceId:t,billingCountryCode:o,onMockCheckoutState:r}){let{stigg:n}=chunkIVDIW747_cjs_js.u(),[i,a]=yi.useState(true),[l,s]=yi.useState();return yi.useEffect(()=>{let c=()=>chunkIVDIW747_cjs_js.d(null,null,function*(){try{let u=yield n.getCheckoutState({planId:e,resourceId:t,billingCountryCode:o});s(Hy(u));}catch(u){chunkIVDIW747_cjs_js.r.error(`Failed to load checkout ${u==null?void 0:u.message}`,u);}finally{a(false);}});if(r){a(false);let u=r({planId:e,resourceId:t,billingCountryCode:o});s(u);return}n.isCustomerLoaded&&(a(true),c());},[n,n.isCustomerLoaded,t,e,o,r]),{checkout:l,isLoading:i,showWatermark:n.getShowWatermark()}}var yr=(e,t)=>e.minUnitQuantity&&t<e.minUnitQuantity?e.minUnitQuantity:e.maxUnitQuantity&&t>e.maxUnitQuantity?e.maxUnitQuantity:t;var ii=e=>!!(e!=null&&e.pricePoints.some(t=>t.billingPeriod===sdk.BillingPeriod.Monthly)),ai=e=>!!(e!=null&&e.pricePoints.some(t=>t.billingPeriod===sdk.BillingPeriod.Annually)),yc=e=>ii(e)&&ai(e);var Pc=(e,t,o)=>e===sdk.BillingPeriod.Monthly&&t||e===sdk.BillingPeriod.Annually&&o?e:null,xc=({pricingModel:e})=>e===jsClientSdk.BillingModel.PerUnit;function Zy(e,t,o){var i;if(!t)return [];let r=Dl__default.default(e,"featureId"),n=Dl__default.default(Cc__default.default((i=o==null?void 0:o.prices)==null?void 0:i.map(a=>{let{feature:l}=a;return !l||!xc(a)?null:{featureId:l.featureId,quantity:l.unitQuantity||null}})),"featureId");return Cc__default.default(t==null?void 0:t.map(a=>{var u,f,y;let l=(u=a.feature)==null?void 0:u.featureId;if(!l||!xc(a))return null;let s,c=((f=r[l])==null?void 0:f.quantity)||((y=n[l])==null?void 0:y.quantity);return s=yr(a,c||1),a.isTieredPrice&&!Wt(a.tiers)&&(s=Pn(a.tiers,s).upTo),{featureId:l,quantity:s}}))}function Yy({plan:e,activeSubscription:t,preferredBillingPeriod:o}){var a,l;let r=ii(e),n=ai(e);if(o){let s=Pc(o,r,n);if(s)return s}if(((a=t==null?void 0:t.plan)==null?void 0:a.id)===(e==null?void 0:e.id))return ((l=t==null?void 0:t.price)==null?void 0:l.billingPeriod)||sdk.BillingPeriod.Monthly;if(t!=null&&t.prices&&(t==null?void 0:t.prices.length)>0){let s=Pc(t==null?void 0:t.prices[0].billingPeriod,r,n);if(s)return s}return n?sdk.BillingPeriod.Annually:sdk.BillingPeriod.Monthly}function bc({preferredBillingPeriod:e,plan:t,activeSubscription:o,billingCountryCode:r,preconfiguredBillableFeatures:n}){let i=Yy({plan:t,activeSubscription:o,preferredBillingPeriod:e}),a=t==null?void 0:t.pricePoints.filter(s=>s.billingPeriod===i),l=Zy(n,a,o);return {billingPeriod:i,billableFeatures:l,billingCountryCode:r}}function Qy(){let[{planStep:e}]=_();return e}function Ky(){let[,e]=_();return (t,o)=>e(r=>{let n=r.planStep.billableFeatures.find(i=>i.featureId===t);n?n.quantity=o:r.planStep.billableFeatures.push({featureId:t,quantity:o});})}function qy(){let[,e]=_();return t=>e(o=>{o.planStep.billingPeriod=t,o.addonsStep.addons=o.addonsStep.addons.filter(r=>r.addon.pricePoints.some(n=>n.billingPeriod===t));})}function be(){let e=Qy();return chunkIVDIW747_cjs_js.b(chunkIVDIW747_cjs_js.a({},e),{setBillingPeriod:qy(),setBillableFeature:Ky()})}var Tc=[{key:"PLAN",label:"Plan"},{key:"ADDONS",label:"Add-ons"},{key:"PAYMENT",label:"Payment details"}],Sc={activeStep:0,completedSteps:[],steps:Tc,isDisabled:false},Xy=(e,t,o,r)=>{if(yc(e)&&!r)return false;let n=t.map(a=>a.featureId),i=o.map(a=>a.featureId);return !(n.length!==i.length||!n.every(a=>i.includes(a)))};function kc({isLoading:e,skipCheckoutSteps:t,plan:o,availableAddons:r,availableCharges:n,preferredBillingPeriod:i,preconfiguredBillableFeatures:a}){if(e||!o)return Sc;let l=[];return t.includes("PLAN")&&Xy(o,n,a,i)&&l.push("PLAN"),((r==null?void 0:r.length)===0||t.includes("ADDONS"))&&l.push("ADDONS"),chunkIVDIW747_cjs_js.b(chunkIVDIW747_cjs_js.a({},Sc),{steps:Tc.filter(s=>!l.includes(s.key))})}function jy(){let[{progressBar:e}]=_();return e}function eh(){let[e,t]=_();return o=>chunkIVDIW747_cjs_js.d(null,null,function*(){let{progressBar:r,planStep:n,addonsStep:i,paymentStep:a,onBeforeStepChange:l}=e;if(o!==r.activeStep&&l){let s=r.steps[r.activeStep],c=r.steps[o];if(s&&c){let u={planStep:n,addonsStep:i,paymentStep:a};if(!(yield l({from:s.key,to:c.key,state:u})))return}}t(({progressBar:s})=>{s.activeStep=o;});})}function th(){let[,e]=_();return t=>e(({progressBar:o})=>{o.completedSteps.push(t);})}function oh(e){return e.completedSteps.length>=e.steps.length-1}function rh(){let[e,t]=_();return ()=>chunkIVDIW747_cjs_js.d(null,null,function*(){let{progressBar:o,planStep:r,addonsStep:n,paymentStep:i,onBeforeStepChange:a}=e;if(o.isDisabled)return;let l=o.steps[o.activeStep],s=o.steps[o.activeStep+1];if(s&&a){let c={planStep:r,addonsStep:n,paymentStep:i};if(!(yield a({from:l.key,to:s.key,state:c})))return}t(({progressBar:c})=>{c.completedSteps.includes(c.activeStep)||c.completedSteps.push(c.activeStep),c.activeStep<c.steps.length-1&&(c.activeStep+=1);});})}function nh(){let[,e]=_();return t=>e(({progressBar:o})=>{o.isDisabled=!!t;})}function _e(){let e=jy();return {currentStep:e.steps[e.activeStep],progressBarState:e,isLastStep:e.activeStep===e.steps.length-1,isCheckoutComplete:oh(e),setActiveStep:eh(),markStepAsCompleted:th(),goNext:rh(),setIsDisabled:nh()}}function It(){let[{planStep:e,addonsStep:t,promotionCode:o,paymentStep:r}]=_();return chunkIVDIW747_cjs_js.b(chunkIVDIW747_cjs_js.a({},e),{addons:t.addons,promotionCode:o,billingAddress:r.billingAddress,taxPercentage:r.taxPercentage,taxId:r.taxId})}function hr({billingAddress:e,taxPercentage:t,taxIds:o,prorationBehavior:r}){if(!e&&!t&&!(o!=null&&o.length)&&!r)return {};let n=o!=null&&o.length?o==null?void 0:o.filter(i=>i.value&&i.type):void 0;return {billingInformation:chunkIVDIW747_cjs_js.a(chunkIVDIW747_cjs_js.b(chunkIVDIW747_cjs_js.a(chunkIVDIW747_cjs_js.a({},e?{billingAddress:e}:{}),t?{taxPercentage:t}:{}),{taxIds:n}),r?{prorationBehavior:r}:{})}}function sh(e){return e.pricingModel===jsClientSdk.BillingModel.PerUnit&&e.billingCadence===jsClientSdk.BillingCadence.Recurring&&!!e.topUpCustomCurrencyId}function lh(e){return e!=null&&e.pricePoints?e.pricePoints.some(sh):false}function Cr({resetBillingPeriod:e,activeSubscription:t}){if(!t)return {};let o=lh(t.plan);return e!==void 0?{billingCycleAnchor:e?jsClientSdk.SubscriptionBillingCycleAnchor.Now:jsClientSdk.SubscriptionBillingCycleAnchor.Unchanged,prorationBehavior:o?jsClientSdk.SubscriptionProrationBehavior.None:void 0}:o?{billingCycleAnchor:jsClientSdk.SubscriptionBillingCycleAnchor.Now,prorationBehavior:jsClientSdk.SubscriptionProrationBehavior.None}:{}}var mh=h=>chunkIVDIW747_cjs_js.d(null,[h],function*({stigg:e,customerId:t,resourceId:o,promotionCode:r,addons:n,billableFeatures:i,billingCountryCode:a,billingPeriod:l,billingAddress:s,taxPercentage:c,taxIds:u,plan:f,activeSubscription:y,resetBillingPeriod:p,onMockCheckoutPreview:g}){var F;let P=n.map(({addon:T,quantity:k})=>({addonId:T.id,quantity:k})),b=null,x=null,{prorationBehavior:A,billingCycleAnchor:S}=Cr({activeSubscription:y,resetBillingPeriod:p});try{if(t&&(f!=null&&f.id)){let T=chunkIVDIW747_cjs_js.a(chunkIVDIW747_cjs_js.a({customerId:t,planId:f.id,resourceId:o,billingCountryCode:a,addons:P,billingPeriod:l,promotionCode:r,billableFeatures:Qg__default.default(i)?void 0:i},hr({billingAddress:s,taxPercentage:c,taxIds:u,prorationBehavior:A})),S?{billingCycleAnchor:S}:{});b=g?g(T):yield e.previewSubscription(T);}}catch(T){let[,k]=((F=T==null?void 0:T.message)==null?void 0:F.split("Error:"))||[];x=k==null?void 0:k.trim();}return {subscriptionPreview:b,errorMessage:x}}),ci=({onMockCheckoutPreview:e}={})=>{let{stigg:t}=chunkIVDIW747_cjs_js.u(),o=It(),[{resourceId:r,resetBillingPeriod:n}]=_(),{checkoutState:i,widgetState:a}=D(),{plan:l,customer:s,activeSubscription:c}=i||{};return {previewSubscriptionAction:yi.useCallback((...y)=>chunkIVDIW747_cjs_js.d(null,[...y],function*({promotionCode:f}={}){return a.isValid?mh({stigg:t,customerId:s==null?void 0:s.id,resourceId:r,addons:o.addons,billableFeatures:o.billableFeatures,billingCountryCode:o.billingCountryCode,billingPeriod:o.billingPeriod,billingAddress:o.billingAddress,taxPercentage:o.taxPercentage,promotionCode:f!=null?f:o.promotionCode,taxIds:o.taxId?[o.taxId]:void 0,plan:l,activeSubscription:c,resetBillingPeriod:n,onMockCheckoutPreview:e}):{subscriptionPreview:null,errorMessage:null}}),[t,s==null?void 0:s.id,l,r,n,o.addons,o.billableFeatures,o.billingCountryCode,o.billingPeriod,o.billingAddress,o.taxPercentage,o.taxId,o.promotionCode,a.isValid,c,e])}},uh=500,Bc=({onMockCheckoutPreview:e}={})=>{let[t,o]=yi.useState(null),[r,n]=yi.useState(null),[i,a]=yi.useState(false),{previewSubscriptionAction:l}=ci({onMockCheckoutPreview:e});return yi.useEffect(()=>{let s=()=>chunkIVDIW747_cjs_js.d(null,null,function*(){let{subscriptionPreview:u,errorMessage:f}=yield l();u&&(o(u),n(null)),f&&(n(f),o(null)),a(false);});a(true);let c=setTimeout(()=>{a(true),s();},uh);return ()=>{clearTimeout(c);}},[l]),{subscriptionPreview:t,isFetchingSubscriptionPreview:i,errorMessage:r}};function Ac({customer:e,taxPercentage:t,taxId:o}){return {useNewPaymentMethod:!(e!=null&&e.paymentMethodDetails),taxPercentage:t,taxId:o}}function gh(){let[,e]=_();return yi.useCallback(t=>e(o=>{o.paymentStep.useNewPaymentMethod=t;}),[e])}function fh(){let[,e]=_();return yi.useCallback(t=>e(o=>{o.paymentStep.errorMessage=t;}),[e])}function yh(){let[,e]=_();return yi.useCallback(t=>e(o=>{o.paymentStep.billingAddress=t;}),[e])}function hh(){let[{paymentStep:e}]=_();return e}function Ch(){let[,e]=_();return yi.useCallback(t=>e(o=>{o.paymentStep.taxId=t;}),[e])}function re(){let e=hh();return chunkIVDIW747_cjs_js.b(chunkIVDIW747_cjs_js.a({},e),{setUseNewPaymentMethod:gh(),setErrorMessage:fh(),setBillingAddress:yh(),setTaxId:Ch()})}function Fc(e){return Lg__default.default({changePlan:"Change",billingPeriodsTitle:"Billing cycle",addAddonText:"Add",addonBillingPeriodNotAvailableText:({planBillingPeriod:o})=>o===jsClientSdk.BillingPeriod.Monthly?"Exclusively available on annual plans":"Exclusively available on monthly plans",newPaymentMethodText:"New payment method",newPaymentMethodBillingAddressTitle:"Billing address",newPaymentMethodCardTitle:"Payment method",summary:{title:"Order summary",planName:({plan:o})=>`${o.displayName} plan`,addCouponCodeText:"Add promotion code",couponCodeTitle:"Promotion code",addonsSectionTitle:"Add-ons",discountsSectionTitle:"Discounts",onlyPayAsYouGoText:"Varies by usage",startsAtText:"Starts at ",proratedTotalDueText:"Prorated charge today",baseChargeText:()=>"Base charge",totalText:"Total",totalDueText:"Total due today",totalBillingPeriodText:({billingPeriod:o})=>`Billed ${o.toLowerCase()}`,appliedCreditsTitle:"Applied credits",creditsForUnusedTimeText:({credits:o})=>`Your account will be granted credits worth ${o} for unused time, which will be automatically applied to future payments.`,discountText:({discountDetails:o,currency:r})=>{let n="";o.type===jsClientSdk.DiscountType.Percentage?n=`${o.value}% off`:n=`${H({amount:o.value,currency:r})}`;let i="";switch(o.durationType){case jsClientSdk.DiscountDurationType.Once:{i=" once";break}case jsClientSdk.DiscountDurationType.Repeating:{i=`${o.type===jsClientSdk.DiscountType.Fixed?" per month":""} for ${o.durationInMonths} months`;break}case jsClientSdk.DiscountDurationType.Forever:default:i="";}return `${n}${i}`},taxTitle:({taxDetails:o})=>`Tax (${o==null?void 0:o.percentage}%)`,changesWillApplyAtEndOfBillingPeriod:({billingPeriodEnd:o})=>`Your changes will take effect at the end of your current billing cycle on ${Z(o).format("MMMM D, YYYY")}.`,checkoutSuccessText:"Changes applied",payAsYouGoTooltipText:"Billed according to actual usage"},checkoutButton:{nextText:"Next",noChangesText:"No changes",updateText:"Update subscription",downgradeToFreeText:"Cancel subscription",upgradeText:"Subscribe"},downgradeToFree:{alertText:()=>"We\u2019re sorry to see you cancel your paid subscription \u{1F62D}",freePlanHeader:()=>"New plan",freePlanName:({plan:o})=>`${o.displayName}`,freePlanPriceText:()=>"Free",paidPlanHeader:()=>"Current plan",paidPlanName:({plan:o})=>`${o.displayName}`,paidPlanPriceText:({billingPeriod:o})=>`Paid plan${o?`, billed ${o.toLowerCase()}`:""}`},nextBillingCaption:()=>""},e)}var no={primary:"rgb(50, 126, 238)",textColor:"rgb(0, 30, 108)",backgroundColor:"rgb(255, 255, 255)",borderColor:"rgb(235, 237, 243)",summaryBackgroundColor:"rgb(109, 121, 144)"};function vc(e,t,o){let{palette:r}=e||{};return {primary:(t==null?void 0:t.primary)||(r==null?void 0:r.primary)||no.primary,textColor:(t==null?void 0:t.textColor)||(r==null?void 0:r.text.primary)||no.textColor,backgroundColor:(t==null?void 0:t.backgroundColor)||(r==null?void 0:r.backgroundPaper)||no.backgroundColor,borderColor:(t==null?void 0:t.borderColor)||(r==null?void 0:r.outlinedBorder)||no.borderColor,summaryBackgroundColor:(t==null?void 0:t.summaryBackgroundColor)||(r==null?void 0:r.backgroundHighlight)||no.summaryBackgroundColor,paymentInputBackgroundColor:t==null?void 0:t.paymentInputBackgroundColor,paymentInputBorderColor:t==null?void 0:t.paymentInputBorderColor,paymentInputBorderRadius:t==null?void 0:t.paymentInputBorderRadius}}var mi=yi__default.default.createContext(null);mi.displayName="CheckoutContext";var _=()=>{let e=yi.useContext(mi);if(!e)throw new Error("Could not find Checkout context; You need to wrap your checkout components in an <CheckoutProvider> component.");return e},Ah=({children:e,initialState:t})=>{let[o,r]=yi.useState(t);yi.useEffect(()=>{r(t);},[t]);let n=yi.useCallback(l=>r(s=>immer.produce(s,c=>l(c))),[r]),[i,a]=yi.useMemo(()=>[o,n],[n,o]);return jsxRuntime.jsx(mi.Provider,{value:[i,a],children:e})};function Lc({children:e,textOverrides:t,theme:o,preferredBillingPeriod:r,billableFeatures:n,resourceId:i,planId:a,billingCountryCode:l,billingInformation:s,onMockCheckoutState:c,skipCheckoutSteps:u,onBeforeStepChange:f,resetBillingPeriod:y}){var A;let{checkout:p,isLoading:g,showWatermark:h}=gc({resourceId:i,planId:a,billingCountryCode:l,onMockCheckoutState:c}),P=p!=null&&p.configuration?xs(p.configuration):{typography:Jt(null,Ro)},b=chunkIVDIW747_cjs_js.v(P),x=yi.useMemo(()=>{var L,N;let S=vc(b,o,p==null?void 0:p.configuration),F=Fc(t),T=bc({preferredBillingPeriod:r,plan:p==null?void 0:p.plan,activeSubscription:p==null?void 0:p.activeSubscription,billingCountryCode:l,preconfiguredBillableFeatures:n!=null?n:[]}),k=pc({plan:p==null?void 0:p.plan,activeSubscription:p==null?void 0:p.activeSubscription,billingPeriod:T.billingPeriod}),w=Ac({customer:p==null?void 0:p.customer,taxPercentage:(L=s==null?void 0:s.taxDetails)==null?void 0:L.taxPercentage}),I=kc({isLoading:g,skipCheckoutSteps:u!=null?u:[],plan:p==null?void 0:p.plan,availableAddons:k.availableAddons,availableCharges:T.billableFeatures,preferredBillingPeriod:r,preconfiguredBillableFeatures:n!=null?n:[]});return {checkout:p,checkoutLocalization:F,stiggTheme:b,theme:S,progressBar:I,planStep:T,addonsStep:k,paymentStep:w,resourceId:(N=p==null?void 0:p.resource)==null?void 0:N.id,widgetState:{readOnly:false,isValid:true,isLoadingCheckoutData:g},showWatermark:h,checkoutSuccess:false,onBeforeStepChange:f,resetBillingPeriod:y}},[r,l,p,g,u,(A=s==null?void 0:s.taxDetails)==null?void 0:A.taxPercentage,f,y]);return jsxRuntime.jsx(chunkIVDIW747_cjs_js.w,{componentTheme:P,children:jsxRuntime.jsx(Ah,{initialState:x,children:e})},p==null?void 0:p.plan.id)}var Nc="920px",Rc=chunkIVDIW747_cjs_js.e.div`
|
|
512
514
|
margin: auto;
|
|
513
515
|
min-height: 760px;
|
|
514
516
|
max-width: ${Nc};
|
|
@@ -530,7 +532,7 @@
|
|
|
530
532
|
border-radius: 10px;
|
|
531
533
|
width: ${Nc};
|
|
532
534
|
}
|
|
533
|
-
`,Uc=
|
|
535
|
+
`,Uc=chunkIVDIW747_cjs_js.e(ke__default.default)`
|
|
534
536
|
display: flex;
|
|
535
537
|
align-items: flex-start;
|
|
536
538
|
gap: 32px;
|
|
@@ -541,7 +543,7 @@
|
|
|
541
543
|
${oe.md} {
|
|
542
544
|
flex-direction: row;
|
|
543
545
|
}
|
|
544
|
-
`,_c=
|
|
546
|
+
`,_c=chunkIVDIW747_cjs_js.e(ke__default.default)`
|
|
545
547
|
display: flex;
|
|
546
548
|
flex-direction: column;
|
|
547
549
|
gap: 0;
|
|
@@ -551,18 +553,18 @@
|
|
|
551
553
|
${oe.md} {
|
|
552
554
|
width: auto;
|
|
553
555
|
}
|
|
554
|
-
`;var $c=
|
|
556
|
+
`;var $c=chunkIVDIW747_cjs_js.e(Zf__default.default,{shouldForwardProp:e=>!e.startsWith("$")})(({theme:e,$disabled:t})=>({[`&.${Zf.linearProgressClasses.root}`]:{borderRadius:e.stigg.border.radius,backgroundColor:e.stigg.palette.outlinedBorder},[`& .${Zf.linearProgressClasses.bar}`]:{backgroundColor:t?e.stigg.palette.primaryLight:e.stigg.palette.primary}})),Gc=chunkIVDIW747_cjs_js.e(fu__default.default)({[`&.${fu.buttonClasses.root}`]:{textTransform:"none",lineHeight:"inherit",justifyContent:"flex-start",padding:"8px 4px"}}),zc=chunkIVDIW747_cjs_js.e(chunkIVDIW747_cjs_js.i,{shouldForwardProp:e=>!e.startsWith("$")})(({theme:e,$disabled:t,$shouldFill:o})=>({circle:{stroke:t?e.stigg.palette.primaryLight:e.stigg.palette.primary,fill:o?t?e.stigg.palette.primaryLight:e.stigg.palette.primary:void 0}}));var Oc=()=>{let{progressBarState:e,setActiveStep:t,currentStep:o}=_e(),{widgetState:r}=D(),n=me("md"),i=yi.useRef(),{readOnly:a,isLoadingCheckoutData:l}=r,{activeStep:s,completedSteps:c,steps:u}=e||{},f=(s+1)*100/u.length,[y,p]=yi__default.default.useState(o);return yi.useEffect(()=>{n||i.current&&o!==y&&i.current.scrollIntoView({behavior:"smooth"}),p(o);},[o,n,y,p]),e.steps.length===1?null:jsxRuntime.jsxs(ke__default.default,{className:"stigg-checkout-progress-container",sx:{width:"100%",mb:3},ref:i,children:[jsxRuntime.jsx($c,{variant:"determinate",value:f,$disabled:a}),jsxRuntime.jsx(Re__default.default,{container:true,display:"flex",children:u.map(({key:g,label:h},P)=>{let b=c.includes(P),x=a||P>s&&!b&&!c.includes(P-1)||s!==P&&e.isDisabled;return jsxRuntime.jsx(Re__default.default,{item:true,display:"flex",flexDirection:"row",flex:n?1:"auto",justifyContent:"flex-start",children:l?jsxRuntime.jsx(chunkIVDIW747_cjs_js.o,{width:120,height:20,style:{marginTop:8}}):jsxRuntime.jsx(Gc,{onClick:()=>t(P),fullWidth:true,disabled:x,children:jsxRuntime.jsxs(Re__default.default,{item:true,display:"flex",flexDirection:"row",alignItems:"center",gap:1,children:[jsxRuntime.jsx(Rh__default.default,{icon:jsxRuntime.jsx(zc,{icon:b?x?"OutlinedCheckedCircleDisabled":"OutlinedCheckedCircle":"OutlinedCircle",$disabled:x,$shouldFill:b})}),jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{variant:"h6",color:x?"primary.main.light":"primary.main",children:h})]})})},g)})})]})};var Dh=[jsClientSdk.BillingModel.FlatFee,jsClientSdk.BillingModel.PerUnit,jsClientSdk.BillingModel.UsageBased],$h=e=>ac__default.default(e,[t=>Dh.indexOf(t.pricingModel),t=>{var o;return (o=t.feature)==null?void 0:o.displayName}]),xr=e=>yi.useMemo(()=>$h(e),[e]);function Gh(){let[{promotionCode:e}]=_();return e}function zh(){let[,e]=_();return t=>e(o=>{o.promotionCode=t;})}function Ft(){return {promotionCode:Gh(),setPromotionCode:zh()}}var Vh=e=>jsxRuntime.jsx("svg",chunkIVDIW747_cjs_js.b(chunkIVDIW747_cjs_js.a({width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:jsxRuntime.jsxs("g",{id:"plus",children:[jsxRuntime.jsx("path",{id:"Shape",d:"M10 4.16666V15.8333",stroke:"#327EEE",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx("path",{id:"Shape_2",d:"M4.16699 10H15.8337",stroke:"#327EEE",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})]})})),br=Vh;var Hh=chunkIVDIW747_cjs_js.e(br,{shouldForwardProp:e=>!e.startsWith("$")})`
|
|
555
557
|
margin-right: 8px;
|
|
556
558
|
path {
|
|
557
559
|
stroke: ${({theme:e,$disabled:t})=>t?e.stigg.palette.text.disabled:e.stigg.palette.primary};
|
|
558
560
|
}
|
|
559
|
-
`,Wc=({onAddClick:e,checkoutLocalization:t,disabled:o})=>jsxRuntime.jsxs(te,{disabled:o,fullWidth:true,className:"stigg-checkout-summary-add-coupon-code-button",sx:{textTransform:"none",justifyContent:"flex-start",color:o?"text.disabled":"primary.main"},variant:"text",size:"medium",onClick:e,children:[jsxRuntime.jsx(Hh,{$disabled:o,className:"stigg-checkout-summary-add-coupon-code-button-icon"}),jsxRuntime.jsx(
|
|
561
|
+
`,Wc=({onAddClick:e,checkoutLocalization:t,disabled:o})=>jsxRuntime.jsxs(te,{disabled:o,fullWidth:true,className:"stigg-checkout-summary-add-coupon-code-button",sx:{textTransform:"none",justifyContent:"flex-start",color:o?"text.disabled":"primary.main"},variant:"text",size:"medium",onClick:e,children:[jsxRuntime.jsx(Hh,{$disabled:o,className:"stigg-checkout-summary-add-coupon-code-button-icon"}),jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{className:"stigg-checkout-change-plan-button-text",color:o?"disabled":"primary.main",style:{lineHeight:"24px"},variant:"h3",children:t.summary.addCouponCodeText})]});var Kh=chunkIVDIW747_cjs_js.e(te)`
|
|
560
562
|
padding: 4px 10px;
|
|
561
563
|
min-width: unset;
|
|
562
564
|
border-radius: ${({theme:e})=>e.stigg.border.radius};
|
|
563
565
|
display: flex;
|
|
564
566
|
align-items: center;
|
|
565
|
-
`,Zc=({disabled:e,checkoutLocalization:t,onMockCheckoutPreview:o})=>{let{setPromotionCode:r}=Ft(),[n,i]=yi.useState(false),[a,l]=yi__default.default.useState(""),[s,c]=yi__default.default.useState(false),[u,f]=yi__default.default.useState(""),{previewSubscriptionAction:y}=ci({onMockCheckoutPreview:o}),p=()=>
|
|
567
|
+
`,Zc=({disabled:e,checkoutLocalization:t,onMockCheckoutPreview:o})=>{let{setPromotionCode:r}=Ft(),[n,i]=yi.useState(false),[a,l]=yi__default.default.useState(""),[s,c]=yi__default.default.useState(false),[u,f]=yi__default.default.useState(""),{previewSubscriptionAction:y}=ci({onMockCheckoutPreview:o}),p=()=>chunkIVDIW747_cjs_js.d(null,null,function*(){var P;c(true),f("");let{subscriptionPreview:g,errorMessage:h}=yield y({promotionCode:a});!h&&((P=g==null?void 0:g.immediateInvoice)!=null&&P.discountDetails)?(r(a.toUpperCase()),i(false)):h&&f(h),c(false);});return n?jsxRuntime.jsxs(Re__default.default,{children:[jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{variant:"body1",color:u?"error":e?"disabled":"primary.main",children:t.summary.couponCodeTitle}),jsxRuntime.jsx(pe,{disabled:e,autoFocus:true,variant:"outlined",fullWidth:true,error:!!u,value:a,onChange:g=>{l(g.target.value);},inputProps:{maxLength:20},onKeyDown:g=>{g.key==="Enter"&&(p(),g.preventDefault());},InputProps:{endAdornment:jsxRuntime.jsx(Kh,{variant:"contained",disabled:e,onClick:()=>{p();},children:s?jsxRuntime.jsx(Yh__default.default,{size:18,sx:{color:"white"}}):jsxRuntime.jsx(chunkIVDIW747_cjs_js.i,{style:{display:"flex"},icon:"ArrowForward"})})}}),!!u&&jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{variant:"body1",color:"error",children:u})]}):jsxRuntime.jsx(Wc,{disabled:e,onAddClick:()=>i(true),checkoutLocalization:t})};var Jh=chunkIVDIW747_cjs_js.e(Re__default.default)`
|
|
566
568
|
width: auto;
|
|
567
569
|
display: inline-flex;
|
|
568
570
|
align-items: center;
|
|
@@ -571,7 +573,7 @@
|
|
|
571
573
|
padding: 6px 8px;
|
|
572
574
|
border-radius: ${({theme:e})=>e.stigg.border.radius};
|
|
573
575
|
border: 1px solid ${({theme:e})=>e.stigg.palette.primary};
|
|
574
|
-
`,Yc=
|
|
576
|
+
`,Yc=chunkIVDIW747_cjs_js.e(chunkIVDIW747_cjs_js.i,{shouldForwardProp:e=>e!=="style"})`
|
|
575
577
|
display: flex;
|
|
576
578
|
|
|
577
579
|
g {
|
|
@@ -581,9 +583,9 @@
|
|
|
581
583
|
path {
|
|
582
584
|
fill: ${({theme:e,$shouldFill:t})=>t?e.stigg.palette.primary:void 0};
|
|
583
585
|
}
|
|
584
|
-
`,Kc=({promotionCode:e,onClearPromotionCode:t})=>jsxRuntime.jsxs(Jh,{container:true,children:[jsxRuntime.jsxs(Re__default.default,{item:true,display:"flex",gap:1,alignItems:"center",children:[jsxRuntime.jsx(Yc,{icon:"Coupon"}),jsxRuntime.jsx(
|
|
586
|
+
`,Kc=({promotionCode:e,onClearPromotionCode:t})=>jsxRuntime.jsxs(Jh,{container:true,children:[jsxRuntime.jsxs(Re__default.default,{item:true,display:"flex",gap:1,alignItems:"center",children:[jsxRuntime.jsx(Yc,{icon:"Coupon"}),jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{variant:"body1",color:"primary.main",lineHeight:"auto",children:e})]}),jsxRuntime.jsx(Re__default.default,{item:true,children:jsxRuntime.jsx(te,{variant:"text",sx:{minWidth:"unset",padding:0},onClick:t,children:jsxRuntime.jsx(Yc,{icon:"Close",$shouldFill:true})})})]});var Xh=chunkIVDIW747_cjs_js.e.div`
|
|
585
587
|
margin: 16px 0;
|
|
586
|
-
`,qc=({disabled:e,checkoutLocalization:t,onMockCheckoutPreview:o})=>{let{promotionCode:r,setPromotionCode:n}=Ft();return jsxRuntime.jsx(Xh,{children:r?jsxRuntime.jsx(Kc,{promotionCode:r,onClearPromotionCode:()=>{n("");}}):jsxRuntime.jsx(Zc,{disabled:e,checkoutLocalization:t,onMockCheckoutPreview:o})})};var Jc=({label:e,checked:t,onChange:o,onClick:r,value:n,disabled:i,dataTestId:a})=>jsxRuntime.jsx(eC__default.default,{onClick:r,value:n,control:jsxRuntime.jsx(jh__default.default,{checked:t,onChange:o,disabled:i,"data-testid":a}),label:tC__default.default(e)?jsxRuntime.jsx(chunkYAS4WG6F_cjs_js.f,{variant:"body1",lineHeight:"20px",color:"secondary",children:e}):e});var Si=[{country:"Albania",countryCode:"AL",taxIdType:"al_tin",FlagComponent:_3x2.AL,example:"J12345678N"},{country:"Andorra",countryCode:"AD",taxIdType:"ad_nrt",FlagComponent:_3x2.AD,example:"A-123456-Z"},{country:"Angola",countryCode:"AO",taxIdType:"ao_tin",FlagComponent:_3x2.AO,example:"5123456789"},{country:"Argentina",countryCode:"AR",taxIdType:"ar_cuit",FlagComponent:_3x2.AR,example:"12-3456789-01"},{country:"Armenia",countryCode:"AM",taxIdType:"am_tin",FlagComponent:_3x2.AM,example:"02538904"},{country:"Aruba",countryCode:"AW",taxIdType:"aw_tin",FlagComponent:_3x2.AW,example:"12345678"},{country:"Australia",countryCode:"AU",taxIdType:"au_abn",FlagComponent:_3x2.AU,example:"12345678912"},{country:"Australia",countryCode:"AU",taxIdType:"au_arn",FlagComponent:_3x2.AU,example:"123456789123"},{country:"Austria",countryCode:"AT",taxIdType:"eu_vat",FlagComponent:_3x2.AT,example:"ATU12345678"},{country:"Azerbaijan",countryCode:"AZ",taxIdType:"az_tin",FlagComponent:_3x2.AZ,example:"0123456789"},{country:"Bahamas",countryCode:"BS",taxIdType:"bs_tin",FlagComponent:_3x2.BS,example:"123.456.789"},{country:"Bahrain",countryCode:"BH",taxIdType:"bh_vat",FlagComponent:_3x2.BH,example:"123456789012345"},{country:"Bangladesh",countryCode:"BD",taxIdType:"bd_bin",FlagComponent:_3x2.BD,example:"123456789-0123"},{country:"Barbados",countryCode:"BB",taxIdType:"bb_tin",FlagComponent:_3x2.BB,example:"1123456789012"},{country:"Belarus",countryCode:"BY",taxIdType:"by_tin",FlagComponent:_3x2.BY,example:"123456789"},{country:"Belgium",countryCode:"BE",taxIdType:"eu_vat",FlagComponent:_3x2.BE,example:"BE0123456789"},{country:"Benin",countryCode:"BJ",taxIdType:"bj_ifu",FlagComponent:_3x2.BJ,example:"1234567890123"},{country:"Bolivia",countryCode:"BO",taxIdType:"bo_tin",FlagComponent:_3x2.BO,example:"123456789"},{country:"Bosnia & Herzegovina",countryCode:"BA",taxIdType:"ba_tin",FlagComponent:_3x2.BA,example:"123456789012"},{country:"Brazil",countryCode:"BR",taxIdType:"br_cnpj",FlagComponent:_3x2.BR,example:"01.234.456/5432-10"},{country:"Brazil",countryCode:"BR",taxIdType:"br_cpf",FlagComponent:_3x2.BR,example:"123.456.789-87"},{country:"Bulgaria",countryCode:"BG",taxIdType:"bg_uic",FlagComponent:_3x2.BG,example:"123456789"},{country:"Bulgaria",countryCode:"BG",taxIdType:"eu_vat",FlagComponent:_3x2.BG,example:"BG0123456789"},{country:"Burkina Faso",countryCode:"BF",taxIdType:"bf_ifu",FlagComponent:_3x2.BF,example:"12345678A"},{country:"Cambodia",countryCode:"KH",taxIdType:"kh_tin",FlagComponent:_3x2.KH,example:"1001-123456789"},{country:"Cameroon",countryCode:"CM",taxIdType:"cm_niu",FlagComponent:_3x2.CM,example:"M123456789000L"},{country:"Canada",countryCode:"CA",taxIdType:"ca_bn",FlagComponent:_3x2.CA,example:"123456789"},{country:"Canada",countryCode:"CA",taxIdType:"ca_gst_hst",FlagComponent:_3x2.CA,example:"123456789RT0002"},{country:"Canada",countryCode:"CA",taxIdType:"ca_pst_bc",FlagComponent:_3x2.CA,example:"PST-1234-5678"},{country:"Canada",countryCode:"CA",taxIdType:"ca_pst_mb",FlagComponent:_3x2.CA,example:"123456-7"},{country:"Canada",countryCode:"CA",taxIdType:"ca_pst_sk",FlagComponent:_3x2.CA,example:"1234567"},{country:"Canada",countryCode:"CA",taxIdType:"ca_qst",FlagComponent:_3x2.CA,example:"1234567890TQ1234"},{country:"Cape Verde",countryCode:"CV",taxIdType:"cv_nif",FlagComponent:_3x2.CV,example:"213456789"},{country:"Chile",countryCode:"CL",taxIdType:"cl_tin",FlagComponent:_3x2.CL,example:"12.345.678-K"},{country:"China",countryCode:"CN",taxIdType:"cn_tin",FlagComponent:_3x2.CN,example:"123456789012345678"},{country:"Colombia",countryCode:"CO",taxIdType:"co_nit",FlagComponent:_3x2.CO,example:"123.456.789-0"},{country:"Congo - Kinshasa",countryCode:"CD",taxIdType:"cd_nif",FlagComponent:_3x2.CD,example:"A0123456M"},{country:"Costa Rica",countryCode:"CR",taxIdType:"cr_tin",FlagComponent:_3x2.CR,example:"1-234-567890"},{country:"Croatia",countryCode:"HR",taxIdType:"eu_vat",FlagComponent:_3x2.HR,example:"HR12345678912"},{country:"Croatia",countryCode:"HR",taxIdType:"hr_oib",FlagComponent:_3x2.HR,example:"12345678901"},{country:"Cyprus",countryCode:"CY",taxIdType:"eu_vat",FlagComponent:_3x2.CY,example:"CY12345678Z"},{country:"Czech Republic",countryCode:"CZ",taxIdType:"eu_vat",FlagComponent:_3x2.CZ,example:"CZ1234567890"},{country:"Denmark",countryCode:"DK",taxIdType:"eu_vat",FlagComponent:_3x2.DK,example:"DK12345678"},{country:"Dominican Republic",countryCode:"DO",taxIdType:"do_rcn",FlagComponent:_3x2.DO,example:"123-4567890-1"},{country:"Ecuador",countryCode:"EC",taxIdType:"ec_ruc",FlagComponent:_3x2.EC,example:"1234567890001"},{country:"Egypt",countryCode:"EG",taxIdType:"eg_tin",FlagComponent:_3x2.EG,example:"123456789"},{country:"El Salvador",countryCode:"SV",taxIdType:"sv_nit",FlagComponent:_3x2.SV,example:"1234-567890-123-4"},{country:"Estonia",countryCode:"EE",taxIdType:"eu_vat",FlagComponent:_3x2.EE,example:"EE123456789"},{country:"Ethiopia",countryCode:"ET",taxIdType:"et_tin",FlagComponent:_3x2.ET,example:"1234567890"},{country:"EU",countryCode:"EU",taxIdType:"eu_oss_vat",FlagComponent:_3x2.EU,example:"EU123456789"},{country:"Finland",countryCode:"FI",taxIdType:"eu_vat",FlagComponent:_3x2.FI,example:"FI12345678"},{country:"France",countryCode:"FR",taxIdType:"eu_vat",FlagComponent:_3x2.FR,example:"FRAB123456789"},{country:"Georgia",countryCode:"GE",taxIdType:"ge_vat",FlagComponent:_3x2.GE,example:"123456789"},{country:"Germany",countryCode:"DE",taxIdType:"de_stn",FlagComponent:_3x2.DE,example:"1234567890"},{country:"Germany",countryCode:"DE",taxIdType:"eu_vat",FlagComponent:_3x2.DE,example:"DE123456789"},{country:"Greece",countryCode:"GR",taxIdType:"eu_vat",FlagComponent:_3x2.GR,example:"EL123456789"},{country:"Guinea",countryCode:"GN",taxIdType:"gn_nif",FlagComponent:_3x2.GN,example:"123456789"},{country:"Hong Kong",countryCode:"HK",taxIdType:"hk_br",FlagComponent:_3x2.HK,example:"12345678"},{country:"Hungary",countryCode:"HU",taxIdType:"eu_vat",FlagComponent:_3x2.HU,example:"HU12345678"},{country:"Hungary",countryCode:"HU",taxIdType:"hu_tin",FlagComponent:_3x2.HU,example:"12345678-1-23"},{country:"Iceland",countryCode:"IS",taxIdType:"is_vat",FlagComponent:_3x2.IS,example:"123456"},{country:"India",countryCode:"IN",taxIdType:"in_gst",FlagComponent:_3x2.IN,example:"12ABCDE3456FGZH"},{country:"Indonesia",countryCode:"ID",taxIdType:"id_npwp",FlagComponent:_3x2.ID,example:"012.345.678.9-012.345"},{country:"Ireland",countryCode:"IE",taxIdType:"eu_vat",FlagComponent:_3x2.IE,example:"IE1234567AB"},{country:"Israel",countryCode:"IL",taxIdType:"il_vat",FlagComponent:_3x2.IL,example:"000012345"},{country:"Italy",countryCode:"IT",taxIdType:"eu_vat",FlagComponent:_3x2.IT,example:"IT12345678912"},{country:"Japan",countryCode:"JP",taxIdType:"jp_cn",FlagComponent:_3x2.JP,example:"1234567891234"},{country:"Japan",countryCode:"JP",taxIdType:"jp_rn",FlagComponent:_3x2.JP,example:"12345"},{country:"Japan",countryCode:"JP",taxIdType:"jp_trn",FlagComponent:_3x2.JP,example:"T1234567891234"},{country:"Kazakhstan",countryCode:"KZ",taxIdType:"kz_bin",FlagComponent:_3x2.KZ,example:"123456789012"},{country:"Kenya",countryCode:"KE",taxIdType:"ke_pin",FlagComponent:_3x2.KE,example:"P000111111A"},{country:"Kyrgyzstan",countryCode:"KG",taxIdType:"kg_tin",FlagComponent:_3x2.KG,example:"12345678901234"},{country:"Laos",countryCode:"LA",taxIdType:"la_tin",FlagComponent:_3x2.LA,example:"123456789-000"},{country:"Latvia",countryCode:"LV",taxIdType:"eu_vat",FlagComponent:_3x2.LV,example:"LV12345678912"},{country:"Liechtenstein",countryCode:"LI",taxIdType:"li_uid",FlagComponent:_3x2.LI,example:"CHE123456789"},{country:"Liechtenstein",countryCode:"LI",taxIdType:"li_vat",FlagComponent:_3x2.LI,example:"12345"},{country:"Lithuania",countryCode:"LT",taxIdType:"eu_vat",FlagComponent:_3x2.LT,example:"LT123456789123"},{country:"Luxembourg",countryCode:"LU",taxIdType:"eu_vat",FlagComponent:_3x2.LU,example:"LU12345678"},{country:"Malaysia",countryCode:"MY",taxIdType:"my_frp",FlagComponent:_3x2.MY,example:"12345678"},{country:"Malaysia",countryCode:"MY",taxIdType:"my_itn",FlagComponent:_3x2.MY,example:"C 1234567890"},{country:"Malaysia",countryCode:"MY",taxIdType:"my_sst",FlagComponent:_3x2.MY,example:"A12-3456-78912345"},{country:"Malta",countryCode:"MT",taxIdType:"eu_vat",FlagComponent:_3x2.MT,example:"MT12345678"},{country:"Mauritania",countryCode:"MR",taxIdType:"mr_nif",FlagComponent:_3x2.MR,example:"12345678"},{country:"Mexico",countryCode:"MX",taxIdType:"mx_rfc",FlagComponent:_3x2.MX,example:"ABC010203AB9"},{country:"Moldova",countryCode:"MD",taxIdType:"md_vat",FlagComponent:_3x2.MD,example:"1234567"},{country:"Montenegro",countryCode:"ME",taxIdType:"me_pib",FlagComponent:_3x2.ME,example:"12345678"},{country:"Morocco",countryCode:"MA",taxIdType:"ma_vat",FlagComponent:_3x2.MA,example:"12345678"},{country:"Nepal",countryCode:"NP",taxIdType:"np_pan",FlagComponent:_3x2.NP,example:"123456789"},{country:"Netherlands",countryCode:"NL",taxIdType:"eu_vat",FlagComponent:_3x2.NL,example:"NL123456789B12"},{country:"New Zealand",countryCode:"NZ",taxIdType:"nz_gst",FlagComponent:_3x2.NZ,example:"123456789"},{country:"Nigeria",countryCode:"NG",taxIdType:"ng_tin",FlagComponent:_3x2.NG,example:"12345678-0001"},{country:"North Macedonia",countryCode:"MK",taxIdType:"mk_vat",FlagComponent:_3x2.MK,example:"MK1234567890123"},{country:"Norway",countryCode:"NO",taxIdType:"no_vat",FlagComponent:_3x2.NO,example:"123456789MVA"},{country:"Norway",countryCode:"NO",taxIdType:"no_voec",FlagComponent:_3x2.NO,example:"1234567"},{country:"Oman",countryCode:"OM",taxIdType:"om_vat",FlagComponent:_3x2.OM,example:"OM1234567890"},{country:"Peru",countryCode:"PE",taxIdType:"pe_ruc",FlagComponent:_3x2.PE,example:"12345678901"},{country:"Philippines",countryCode:"PH",taxIdType:"ph_tin",FlagComponent:_3x2.PH,example:"123456789012"},{country:"Poland",countryCode:"PL",taxIdType:"eu_vat",FlagComponent:_3x2.PL,example:"PL1234567890"},{country:"Portugal",countryCode:"PT",taxIdType:"eu_vat",FlagComponent:_3x2.PT,example:"PT123456789"},{country:"Romania",countryCode:"RO",taxIdType:"eu_vat",FlagComponent:_3x2.RO,example:"RO1234567891"},{country:"Romania",countryCode:"RO",taxIdType:"ro_tin",FlagComponent:_3x2.RO,example:"1234567890123"},{country:"Russia",countryCode:"RU",taxIdType:"ru_inn",FlagComponent:_3x2.RU,example:"1234567891"},{country:"Russia",countryCode:"RU",taxIdType:"ru_kpp",FlagComponent:_3x2.RU,example:"123456789"},{country:"Saudi Arabia",countryCode:"SA",taxIdType:"sa_vat",FlagComponent:_3x2.SA,example:"123456789012345"},{country:"Senegal",countryCode:"SN",taxIdType:"sn_ninea",FlagComponent:_3x2.SN,example:"12345672A2"},{country:"Serbia",countryCode:"RS",taxIdType:"rs_pib",FlagComponent:_3x2.RS,example:"123456789"},{country:"Singapore",countryCode:"SG",taxIdType:"sg_gst",FlagComponent:_3x2.SG,example:"M12345678X"},{country:"Singapore",countryCode:"SG",taxIdType:"sg_uen",FlagComponent:_3x2.SG,example:"123456789F"},{country:"Slovakia",countryCode:"SK",taxIdType:"eu_vat",FlagComponent:_3x2.SK,example:"SK1234567891"},{country:"Slovenia",countryCode:"SI",taxIdType:"eu_vat",FlagComponent:_3x2.SI,example:"SI12345678"},{country:"Slovenia",countryCode:"SI",taxIdType:"si_tin",FlagComponent:_3x2.SI,example:"12345678"},{country:"South Africa",countryCode:"ZA",taxIdType:"za_vat",FlagComponent:_3x2.ZA,example:"4123456789"},{country:"South Korea",countryCode:"KR",taxIdType:"kr_brn",FlagComponent:_3x2.KR,example:"123-45-67890"},{country:"Spain",countryCode:"ES",taxIdType:"es_cif",FlagComponent:_3x2.ES,example:"A12345678"},{country:"Spain",countryCode:"ES",taxIdType:"eu_vat",FlagComponent:_3x2.ES,example:"ESA1234567Z"},{country:"Suriname",countryCode:"SR",taxIdType:"sr_fin",FlagComponent:_3x2.SR,example:"1234567890"},{country:"Sweden",countryCode:"SE",taxIdType:"eu_vat",FlagComponent:_3x2.SE,example:"SE123456789123"},{country:"Switzerland",countryCode:"CH",taxIdType:"ch_uid",FlagComponent:_3x2.CH,example:"CHE-123.456.789 HR"},{country:"Switzerland",countryCode:"CH",taxIdType:"ch_vat",FlagComponent:_3x2.CH,example:"CHE-123.456.789 MWST"},{country:"Taiwan",countryCode:"TW",taxIdType:"tw_vat",FlagComponent:_3x2.TW,example:"12345678"},{country:"Tajikistan",countryCode:"TJ",taxIdType:"tj_tin",FlagComponent:_3x2.TJ,example:"123456789"},{country:"Tanzania",countryCode:"TZ",taxIdType:"tz_vat",FlagComponent:_3x2.TZ,example:"12345678A"},{country:"Thailand",countryCode:"TH",taxIdType:"th_vat",FlagComponent:_3x2.TH,example:"1234567891234"},{country:"Turkey",countryCode:"TR",taxIdType:"tr_tin",FlagComponent:_3x2.TR,example:"0123456789"},{country:"Uganda",countryCode:"UG",taxIdType:"ug_tin",FlagComponent:_3x2.UG,example:"1014751879"},{country:"Ukraine",countryCode:"UA",taxIdType:"ua_vat",FlagComponent:_3x2.UA,example:"123456789"},{country:"United Arab Emirates",countryCode:"AE",taxIdType:"ae_trn",FlagComponent:_3x2.AE,example:"123456789012345"},{country:"United Kingdom",countryCode:"GB",taxIdType:"eu_vat",FlagComponent:_3x2.GB,example:"XI123456789"},{country:"United Kingdom",countryCode:"GB",taxIdType:"gb_vat",FlagComponent:_3x2.GB,example:"GB123456789"},{country:"United States",countryCode:"US",taxIdType:"us_ein",FlagComponent:_3x2.US,example:"12-3456789"},{country:"Uruguay",countryCode:"UY",taxIdType:"uy_ruc",FlagComponent:_3x2.UY,example:"123456789012"},{country:"Uzbekistan",countryCode:"UZ",taxIdType:"uz_tin",FlagComponent:_3x2.UZ,example:"123456789"},{country:"Uzbekistan",countryCode:"UZ",taxIdType:"uz_vat",FlagComponent:_3x2.UZ,example:"123456789012"},{country:"Venezuela",countryCode:"VE",taxIdType:"ve_rif",FlagComponent:_3x2.VE,example:"A-12345678-9"},{country:"Vietnam",countryCode:"VN",taxIdType:"vn_tin",FlagComponent:_3x2.VN,example:"1234567890"},{country:"Zambia",countryCode:"ZM",taxIdType:"zm_tin",FlagComponent:_3x2.ZM,example:"1004751879"},{country:"Zimbabwe",countryCode:"ZW",taxIdType:"zw_tin",FlagComponent:_3x2.ZW,example:"1234567890"}],zP="United States",VP=" # ",Sr="us_ein",Tr=(e,t)=>`${e}${VP}${t}`,Ti=new Map(Si.map(e=>[Tr(e.taxIdType,e.country),e])),Et=e=>Ti.get(e),kr=Tr(Sr,zP);var ki=chunkYAS4WG6F_cjs_js.e(pe)(()=>({"& .MuiOutlinedInput-root":{borderRadius:"5px",padding:"12px",fieldset:{borderColor:"#e6e6e6"}},"& .MuiInputBase-input":{borderRadius:"5px",fontSize:"16px",padding:"0 0"}}));var YP=chunkYAS4WG6F_cjs_js.e(OP__default.default)(()=>({"& .MuiAutocomplete-input":{padding:"0 !important"}})),wr=chunkYAS4WG6F_cjs_js.e(chunkYAS4WG6F_cjs_js.f)({});wr.defaultProps={variant:"body1",color:"secondary"};function yd(){let[e,t]=yi.useState(false),{billingAddress:o,taxId:r,setTaxId:n}=re(),[i,a]=yi.useState(kr),[l,s]=yi.useState(false),c=yi.useCallback((g,h,P)=>{n({type:h,value:P}),a(g);},[n,a]);yi.useEffect(()=>{s(false);},[o==null?void 0:o.country]),yi.useEffect(()=>{if(!(o!=null&&o.country)||l||!e)return;let g=Si.find(h=>h.countryCode===o.country);g&&c(Tr(g.taxIdType,g.country),g.taxIdType,"");},[o,e,l,c]);let u=g=>{if(!g)return;let h=Et(g);if(h){if(s(true),r!=null&&r.value){c(g,h.taxIdType,r.value);return}a(g),r!=null&&r.type&&n(void 0);}},f=yi.useMemo(()=>Array.from(Ti.keys()),[]),y=yi.useMemo(()=>f.find(g=>g===i)||null,[f,i]),p=yi.useMemo(()=>{let g=Et(i);return (g==null?void 0:g.example)||"Add your VAT/GST or local tax ID."},[i]);return yi.useEffect(()=>(e||(s(false),c(kr,Sr,"")),()=>{c(kr,Sr,"");}),[e,c]),jsxRuntime.jsxs(Re__default.default,{flexDirection:"column",container:true,gap:2,children:[jsxRuntime.jsx(Re__default.default,{flexDirection:"row",container:true,gap:2,children:jsxRuntime.jsx(Jc,{checked:e,onChange:()=>t(g=>!g),label:jsxRuntime.jsx(wr,{children:"I'm purchasing as a business"})})}),jsxRuntime.jsx(HP__default.default,{in:e,children:jsxRuntime.jsxs(Re__default.default,{container:true,spacing:0,sx:{width:"100%"},children:[jsxRuntime.jsxs(Re__default.default,{item:true,xs:6,children:[jsxRuntime.jsx(wr,{children:"Tax ID Type"}),jsxRuntime.jsx(YP,{fullWidth:true,options:f,value:y,onChange:(g,h)=>u(h),renderInput:g=>jsxRuntime.jsx(ki,chunkYAS4WG6F_cjs_js.b(chunkYAS4WG6F_cjs_js.a({},g),{id:"id-type",InputProps:g.InputProps})),renderOption:(g,h)=>{let P=Et(h);if(!P)return null;let{taxIdType:b,country:x,FlagComponent:A}=P;return yi.createElement(ku__default.default,chunkYAS4WG6F_cjs_js.b(chunkYAS4WG6F_cjs_js.a({},g),{key:h}),jsxRuntime.jsxs(chunkYAS4WG6F_cjs_js.f,{variant:"body1",lineHeight:"20px",color:"secondary",children:[A&&jsxRuntime.jsx(A,{width:15,style:{marginRight:"5px",borderRadius:"8%"}}),gd__default.default(x)," - ",fd__default.default(b)]}))},getOptionLabel:g=>{let h=Et(g);return h?`${gd__default.default(h.country)} - ${fd__default.default(h.taxIdType)}`:g},ListboxProps:{sx:{maxHeight:200}}})]}),jsxRuntime.jsxs(Re__default.default,{item:true,xs:6,paddingLeft:"12px",children:[jsxRuntime.jsx(wr,{children:"Tax ID"}),jsxRuntime.jsx(ki,{id:"tax-id-value",placeholder:p,type:"text",fullWidth:true,value:(r==null?void 0:r.value)||"",onChange:g=>{let h=Et(i);h&&c(i,h.taxIdType,g.target.value);}})]})]})})]})}function hd({onBillingAddressChange:e,collectPhoneNumber:t,collectTaxId:o}){var g;let{checkoutState:r,checkoutLocalization:n,widgetState:i,setWidgetReadOnly:a}=D(),{setBillingAddress:l}=re(),{customer:s,configuration:c}=r||{},{readOnly:u}=i,f=!!(t!=null?t:(g=c==null?void 0:c.content)!=null&&g.collectPhoneNumber),y=yi.useMemo(()=>o&&!(s!=null&&s.billingId)&&!(s!=null&&s.paymentMethodDetails),[o,s==null?void 0:s.billingId,s==null?void 0:s.paymentMethodDetails]),p=h=>{if(!h.complete)return;let A=h.value.address,{postal_code:P}=A,b=chunkYAS4WG6F_cjs_js.c(A,["postal_code"]),x=chunkYAS4WG6F_cjs_js.a({postalCode:P},b);a(true),l(x),e?chunkYAS4WG6F_cjs_js.d(null,null,function*(){yield e({billingAddress:x}),a(false);}):a(false);};return jsxRuntime.jsxs(Re__default.default,{flexDirection:"column",container:true,gap:3,padding:"16px",sx:{pointerEvents:u?"none":void 0},children:[jsxRuntime.jsxs(Re__default.default,{flexDirection:"column",container:true,gap:2,children:[jsxRuntime.jsx(chunkYAS4WG6F_cjs_js.f,{variant:"h6",children:n.newPaymentMethodBillingAddressTitle}),jsxRuntime.jsx(reactStripeJs.AddressElement,{onChange:p,options:{mode:"billing",fields:{phone:f?"always":"auto"},defaultValues:chunkYAS4WG6F_cjs_js.a({},(s==null?void 0:s.name)&&{name:s.name})}})]}),jsxRuntime.jsxs(Re__default.default,{flexDirection:"column",container:true,gap:2,children:[jsxRuntime.jsx(chunkYAS4WG6F_cjs_js.f,{variant:"h6",children:n.newPaymentMethodCardTitle}),jsxRuntime.jsx(reactStripeJs.PaymentElement,{onChange:()=>{},onReady:()=>{},options:{readOnly:u,terms:{card:"never"},defaultValues:{billingDetails:chunkYAS4WG6F_cjs_js.a(chunkYAS4WG6F_cjs_js.a({},(s==null?void 0:s.name)&&{name:s.name}),(s==null?void 0:s.email)&&{email:s.email})}}})]}),y&&jsxRuntime.jsx(yd,{})]})}function Cd(){let[e,t]=yi.useState(null),{checkoutState:o}=D(),{billingIntegration:r,setupSecret:n}=o||{};return yi.useEffect(()=>{if(r){let{billingIdentifier:i,credentials:a}=r;if(i!==jsClientSdk.BillingVendorIdentifier.Stripe)return;let{accountId:l,publicKey:s}=a;if(!l||!s){console.error("Stripe account ID or public key is missing");return}import('@stripe/stripe-js').then(({loadStripe:c})=>{t(c(s,{stripeAccount:l}));});}},[r]),{stripePromise:e,setupIntentClientSecret:n}}function Br(){let e=It(),[{resourceId:t,resetBillingPeriod:o}]=_(),{checkoutState:r}=D(),{plan:n,activeSubscription:i}=r||{},a=e.addons.map(({addon:c,quantity:u})=>({addonId:c.id,quantity:u}));if(!(n!=null&&n.id))return;let{prorationBehavior:l,billingCycleAnchor:s}=Cr({activeSubscription:i,resetBillingPeriod:o});return chunkYAS4WG6F_cjs_js.a(chunkYAS4WG6F_cjs_js.a({resourceId:t,planId:n.id,billingPeriod:e.billingPeriod,billableFeatures:e.billableFeatures,addons:a,promotionCode:e.promotionCode,billingCountryCode:e.billingCountryCode},hr({billingAddress:e.billingAddress,taxIds:e.taxId?[e.taxId]:void 0,prorationBehavior:l})),s?{billingCycleAnchor:s}:{})}var tx=[jsClientSdk.PaymentCollection.Failed,jsClientSdk.PaymentCollection.Processing];function ox(t){return chunkYAS4WG6F_cjs_js.d(this,arguments,function*({elements:e}){if(!e){let r="Stripe elements not initialized";return console.error(r),{success:false,errorMessage:r}}let{error:o}=yield e.submit();return o?(console.log(o.message),{success:false,errorMessage:o.message||""}):{success:true}})}function Ei(o){return chunkYAS4WG6F_cjs_js.d(this,arguments,function*({applySubscriptionResults:e,stripe:t}){var a,l;let r=e==null?void 0:e.subscription,n=(a=r==null?void 0:r.latestInvoice)==null?void 0:a.paymentSecret,i=r==null?void 0:r.paymentCollection;if(t&&n&&i===jsClientSdk.PaymentCollection.ActionRequired){let{error:s}=yield t.handleNextAction({clientSecret:n});if(s)return {errorMessage:s.message||""}}else if(i&&tx.includes(i))return {errorMessage:((l=r==null?void 0:r.latestInvoice)==null?void 0:l.errorMessage)||"An error occurred - try again later"};return {subscription:r}})}function rx(r){return chunkYAS4WG6F_cjs_js.d(this,arguments,function*({stripe:e,elements:t,clientSecret:o}){let n,i,{error:a}=yield e.confirmSetup({elements:t,confirmParams:{return_url:window.location.href},redirect:"if_required"});if(a)a.type==="card_error"||a.type==="validation_error"?a.type==="card_error"&&(i=a.message||""):i="An unexpected error occurred.";else try{let{setupIntent:l}=yield e.retrieveSetupIntent(o);l!=null&&l.payment_method&&(n=l.payment_method);}catch(l){i="An unexpected error occurred.",console.error(l);}return {newPaymentMethodId:n,setupErrorMessage:i}})}function Pd(r){return chunkYAS4WG6F_cjs_js.d(this,arguments,function*({stripe:e,elements:t,setupIntentClientSecret:o}){if(!e||!t||!o)return {success:false};let n=yield ox({elements:t});if(!n.success)return {success:false,errorMessage:n.errorMessage};let{newPaymentMethodId:i,setupErrorMessage:a}=yield rx({stripe:e,elements:t,clientSecret:o});return a||!i?{success:false,errorMessage:a}:{success:true,paymentMethodId:i}})}var xd={v:"5.12.1",fr:30,ip:0,op:201,w:700,h:700,nm:"Check",ddd:0,assets:[],layers:[{ddd:0,ind:1,ty:4,nm:"Shape Layer 8",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:315,ix:10},p:{a:0,k:[350,350,0],ix:2,l:2},a:{a:0,k:[-304,91,0],ix:1,l:2},s:{a:0,k:[100,100,100],ix:6,l:2}},ao:0,shapes:[{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[0,0],[0,0]],o:[[0,0],[0,0]],v:[[-304,-241],[-304,-161]],c:false},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:false},{ty:"st",c:{a:0,k:[1,1,1,1],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:9,ix:5},lc:2,lj:1,ml:4,bm:0,nm:"Stroke 1",mn:"ADBE Vector Graphic - Stroke",hd:false},{ty:"tr",p:{a:0,k:[0,0],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Transform"}],nm:"Shape 1",np:3,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:false},{ty:"tm",s:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:135,s:[100]},{t:145.5,s:[0]}],ix:1},e:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:130,s:[100]},{t:139.6005859375,s:[0]}],ix:2},o:{a:0,k:0,ix:3},m:1,ix:2,nm:"Trim Paths 1",mn:"ADBE Vector Filter - Trim",hd:false}],ip:130,op:204,st:-2,ct:1,bm:0},{ddd:0,ind:2,ty:4,nm:"Shape Layer 7",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:270,ix:10},p:{a:0,k:[350,350,0],ix:2,l:2},a:{a:0,k:[-304,91,0],ix:1,l:2},s:{a:0,k:[100,100,100],ix:6,l:2}},ao:0,shapes:[{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[0,0],[0,0]],o:[[0,0],[0,0]],v:[[-304,-241],[-304,-161]],c:false},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:false},{ty:"st",c:{a:0,k:[1,1,1,1],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:9,ix:5},lc:2,lj:1,ml:4,bm:0,nm:"Stroke 1",mn:"ADBE Vector Graphic - Stroke",hd:false},{ty:"tr",p:{a:0,k:[0,0],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Transform"}],nm:"Shape 1",np:3,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:false},{ty:"tm",s:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:135,s:[100]},{t:145.5,s:[0]}],ix:1},e:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:130,s:[100]},{t:139.6005859375,s:[0]}],ix:2},o:{a:0,k:0,ix:3},m:1,ix:2,nm:"Trim Paths 1",mn:"ADBE Vector Filter - Trim",hd:false}],ip:130,op:204,st:-2,ct:1,bm:0},{ddd:0,ind:3,ty:4,nm:"Shape Layer 6",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:225,ix:10},p:{a:0,k:[350,350,0],ix:2,l:2},a:{a:0,k:[-304,91,0],ix:1,l:2},s:{a:0,k:[100,100,100],ix:6,l:2}},ao:0,shapes:[{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[0,0],[0,0]],o:[[0,0],[0,0]],v:[[-304,-241],[-304,-161]],c:false},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:false},{ty:"st",c:{a:0,k:[1,1,1,1],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:9,ix:5},lc:2,lj:1,ml:4,bm:0,nm:"Stroke 1",mn:"ADBE Vector Graphic - Stroke",hd:false},{ty:"tr",p:{a:0,k:[0,0],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Transform"}],nm:"Shape 1",np:3,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:false},{ty:"tm",s:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:135,s:[100]},{t:145.5,s:[0]}],ix:1},e:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:130,s:[100]},{t:139.6005859375,s:[0]}],ix:2},o:{a:0,k:0,ix:3},m:1,ix:2,nm:"Trim Paths 1",mn:"ADBE Vector Filter - Trim",hd:false}],ip:130,op:204,st:-2,ct:1,bm:0},{ddd:0,ind:4,ty:4,nm:"Shape Layer 5",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:180,ix:10},p:{a:0,k:[350,350,0],ix:2,l:2},a:{a:0,k:[-304,91,0],ix:1,l:2},s:{a:0,k:[100,100,100],ix:6,l:2}},ao:0,shapes:[{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[0,0],[0,0]],o:[[0,0],[0,0]],v:[[-304,-241],[-304,-161]],c:false},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:false},{ty:"st",c:{a:0,k:[1,1,1,1],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:9,ix:5},lc:2,lj:1,ml:4,bm:0,nm:"Stroke 1",mn:"ADBE Vector Graphic - Stroke",hd:false},{ty:"tr",p:{a:0,k:[0,0],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Transform"}],nm:"Shape 1",np:3,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:false},{ty:"tm",s:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:135,s:[100]},{t:145.5,s:[0]}],ix:1},e:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:130,s:[100]},{t:139.6005859375,s:[0]}],ix:2},o:{a:0,k:0,ix:3},m:1,ix:2,nm:"Trim Paths 1",mn:"ADBE Vector Filter - Trim",hd:false}],ip:130,op:204,st:-2,ct:1,bm:0},{ddd:0,ind:5,ty:4,nm:"Shape Layer 4",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:135,ix:10},p:{a:0,k:[350,350,0],ix:2,l:2},a:{a:0,k:[-304,91,0],ix:1,l:2},s:{a:0,k:[100,100,100],ix:6,l:2}},ao:0,shapes:[{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[0,0],[0,0]],o:[[0,0],[0,0]],v:[[-304,-241],[-304,-161]],c:false},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:false},{ty:"st",c:{a:0,k:[1,1,1,1],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:9,ix:5},lc:2,lj:1,ml:4,bm:0,nm:"Stroke 1",mn:"ADBE Vector Graphic - Stroke",hd:false},{ty:"tr",p:{a:0,k:[0,0],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Transform"}],nm:"Shape 1",np:3,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:false},{ty:"tm",s:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:135,s:[100]},{t:145.5,s:[0]}],ix:1},e:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:130,s:[100]},{t:139.6005859375,s:[0]}],ix:2},o:{a:0,k:0,ix:3},m:1,ix:2,nm:"Trim Paths 1",mn:"ADBE Vector Filter - Trim",hd:false}],ip:130,op:204,st:-2,ct:1,bm:0},{ddd:0,ind:6,ty:4,nm:"Shape Layer 3",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:90,ix:10},p:{a:0,k:[350,350,0],ix:2,l:2},a:{a:0,k:[-304,91,0],ix:1,l:2},s:{a:0,k:[100,100,100],ix:6,l:2}},ao:0,shapes:[{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[0,0],[0,0]],o:[[0,0],[0,0]],v:[[-304,-241],[-304,-161]],c:false},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:false},{ty:"st",c:{a:0,k:[1,1,1,1],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:9,ix:5},lc:2,lj:1,ml:4,bm:0,nm:"Stroke 1",mn:"ADBE Vector Graphic - Stroke",hd:false},{ty:"tr",p:{a:0,k:[0,0],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Transform"}],nm:"Shape 1",np:3,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:false},{ty:"tm",s:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:135,s:[100]},{t:145.5,s:[0]}],ix:1},e:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:130,s:[100]},{t:139.6005859375,s:[0]}],ix:2},o:{a:0,k:0,ix:3},m:1,ix:2,nm:"Trim Paths 1",mn:"ADBE Vector Filter - Trim",hd:false}],ip:130,op:204,st:-2,ct:1,bm:0},{ddd:0,ind:7,ty:4,nm:"Shape Layer 2",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:45,ix:10},p:{a:0,k:[350,350,0],ix:2,l:2},a:{a:0,k:[-304,91,0],ix:1,l:2},s:{a:0,k:[100,100,100],ix:6,l:2}},ao:0,shapes:[{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[0,0],[0,0]],o:[[0,0],[0,0]],v:[[-304,-241],[-304,-161]],c:false},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:false},{ty:"st",c:{a:0,k:[1,1,1,1],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:9,ix:5},lc:2,lj:1,ml:4,bm:0,nm:"Stroke 1",mn:"ADBE Vector Graphic - Stroke",hd:false},{ty:"tr",p:{a:0,k:[0,0],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Transform"}],nm:"Shape 1",np:3,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:false},{ty:"tm",s:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:135,s:[100]},{t:145.5,s:[0]}],ix:1},e:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:130,s:[100]},{t:139.6005859375,s:[0]}],ix:2},o:{a:0,k:0,ix:3},m:1,ix:2,nm:"Trim Paths 1",mn:"ADBE Vector Filter - Trim",hd:false}],ip:130,op:204,st:-2,ct:1,bm:0},{ddd:0,ind:8,ty:4,nm:"Shape Layer 1",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:0,ix:10},p:{a:0,k:[350,350,0],ix:2,l:2},a:{a:0,k:[-304,91,0],ix:1,l:2},s:{a:0,k:[100,100,100],ix:6,l:2}},ao:0,shapes:[{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[0,0],[0,0]],o:[[0,0],[0,0]],v:[[-304,-241],[-304,-161]],c:false},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:false},{ty:"st",c:{a:0,k:[1,1,1,1],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:9,ix:5},lc:2,lj:1,ml:4,bm:0,nm:"Stroke 1",mn:"ADBE Vector Graphic - Stroke",hd:false},{ty:"tr",p:{a:0,k:[0,0],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Transform"}],nm:"Shape 1",np:3,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:false},{ty:"tm",s:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:135,s:[100]},{t:145.5,s:[0]}],ix:1},e:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:130,s:[100]},{t:139.6005859375,s:[0]}],ix:2},o:{a:0,k:0,ix:3},m:1,ix:2,nm:"Trim Paths 1",mn:"ADBE Vector Filter - Trim",hd:false}],ip:130,op:204,st:-2,ct:1,bm:0},{ddd:0,ind:9,ty:4,nm:"Check v",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:-1.9,ix:10},p:{a:0,k:[352,360,0],ix:2,l:2},a:{a:0,k:[-120.265,116.765,0],ix:1,l:2},s:{a:0,k:[278,278,100],ix:6,l:2}},ao:0,shapes:[{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0]],v:[[-161,123],[-137,148],[-79.531,85.531]],c:false},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:false},{ty:"st",c:{a:0,k:[1,1,1,1],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:5.5,ix:5},lc:2,lj:2,bm:0,nm:"Stroke 1",mn:"ADBE Vector Graphic - Stroke",hd:false},{ty:"tr",p:{a:0,k:[0,0],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Transform"}],nm:"Shape 1",np:3,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:false},{ty:"tm",s:{a:1,k:[{i:{x:[0],y:[1]},o:{x:[.333],y:[0]},t:135,s:[0]},{t:148,s:[100]}],ix:1},e:{a:0,k:0,ix:2},o:{a:0,k:0,ix:3},m:1,ix:2,nm:"Trim Paths 1",mn:"ADBE Vector Filter - Trim",hd:false}],ip:135,op:201,st:-35,ct:1,bm:0},{ddd:0,ind:11,ty:4,nm:"Circle Stroke",sr:1,ks:{o:{a:1,k:[{i:{x:[.833],y:[.833]},o:{x:[.167],y:[.167]},t:0,s:[0]},{t:7,s:[100]}],ix:11},r:{a:0,k:0,ix:10},p:{a:0,k:[350,350,0],ix:2,l:2},a:{a:0,k:[4,-6,0],ix:1,l:2},s:{a:0,k:[132,132,100],ix:6,l:2}},ao:0,shapes:[{ty:"gr",it:[{d:1,ty:"el",s:{a:0,k:[306,306],ix:2},p:{a:0,k:[0,0],ix:3},nm:"Ellipse Path 1",mn:"ADBE Vector Shape - Ellipse",hd:false},{ty:"st",c:{a:1,k:[{i:{x:[.833],y:[.833]},o:{x:[.167],y:[.167]},t:0,s:[1,1,1,1]},{i:{x:[.833],y:[.833]},o:{x:[.167],y:[.167]},t:30,s:[1,1,1,1]},{i:{x:[.833],y:[.833]},o:{x:[.167],y:[.167]},t:61,s:[1,1,1,1]},{i:{x:[.833],y:[.833]},o:{x:[.167],y:[.167]},t:87,s:[1,1,1,1]},{t:136,s:[1,1,1,1]}],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:8,ix:5},lc:2,lj:1,ml:4,bm:0,nm:"Stroke 1",mn:"ADBE Vector Graphic - Stroke",hd:false},{ty:"tr",p:{a:0,k:[4,-6],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Transform"}],nm:"Ellipse 1",np:3,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:false},{ty:"tm",s:{a:1,k:[{i:{x:[.338],y:[1]},o:{x:[.333],y:[0]},t:87,s:[50]},{t:122,s:[100]}],ix:1},e:{a:1,k:[{i:{x:[.338],y:[1]},o:{x:[.333],y:[0]},t:87,s:[45]},{t:122,s:[0]}],ix:2},o:{a:1,k:[{i:{x:[.474],y:[1]},o:{x:[.43],y:[0]},t:0,s:[-170.4]},{t:111,s:[-1250.4]}],ix:3},m:1,ix:2,nm:"Trim Paths 1",mn:"ADBE Vector Filter - Trim",hd:false}],ip:0,op:201,st:0,ct:1,bm:0},{ddd:0,ind:13,ty:1,nm:"Dark Gray Solid 1",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:0,ix:10},p:{a:0,k:[350,350,0],ix:2,l:2},a:{a:0,k:[350,350,0],ix:1,l:2},s:{a:0,k:[100,100,100],ix:6,l:2}},ao:0,sw:700,sh:700,sc:"#2d2d2d",ip:0,op:201,st:0,bm:0}],markers:[],props:{}};var Ar=5e3,cx=chunkYAS4WG6F_cjs_js.e(ke__default.default)`
|
|
588
|
+
`,qc=({disabled:e,checkoutLocalization:t,onMockCheckoutPreview:o})=>{let{promotionCode:r,setPromotionCode:n}=Ft();return jsxRuntime.jsx(Xh,{children:r?jsxRuntime.jsx(Kc,{promotionCode:r,onClearPromotionCode:()=>{n("");}}):jsxRuntime.jsx(Zc,{disabled:e,checkoutLocalization:t,onMockCheckoutPreview:o})})};var Jc=({label:e,checked:t,onChange:o,onClick:r,value:n,disabled:i,dataTestId:a})=>jsxRuntime.jsx(eC__default.default,{onClick:r,value:n,control:jsxRuntime.jsx(jh__default.default,{checked:t,onChange:o,disabled:i,"data-testid":a}),label:tC__default.default(e)?jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{variant:"body1",lineHeight:"20px",color:"secondary",children:e}):e});var Si=[{country:"Albania",countryCode:"AL",taxIdType:"al_tin",FlagComponent:_3x2.AL,example:"J12345678N"},{country:"Andorra",countryCode:"AD",taxIdType:"ad_nrt",FlagComponent:_3x2.AD,example:"A-123456-Z"},{country:"Angola",countryCode:"AO",taxIdType:"ao_tin",FlagComponent:_3x2.AO,example:"5123456789"},{country:"Argentina",countryCode:"AR",taxIdType:"ar_cuit",FlagComponent:_3x2.AR,example:"12-3456789-01"},{country:"Armenia",countryCode:"AM",taxIdType:"am_tin",FlagComponent:_3x2.AM,example:"02538904"},{country:"Aruba",countryCode:"AW",taxIdType:"aw_tin",FlagComponent:_3x2.AW,example:"12345678"},{country:"Australia",countryCode:"AU",taxIdType:"au_abn",FlagComponent:_3x2.AU,example:"12345678912"},{country:"Australia",countryCode:"AU",taxIdType:"au_arn",FlagComponent:_3x2.AU,example:"123456789123"},{country:"Austria",countryCode:"AT",taxIdType:"eu_vat",FlagComponent:_3x2.AT,example:"ATU12345678"},{country:"Azerbaijan",countryCode:"AZ",taxIdType:"az_tin",FlagComponent:_3x2.AZ,example:"0123456789"},{country:"Bahamas",countryCode:"BS",taxIdType:"bs_tin",FlagComponent:_3x2.BS,example:"123.456.789"},{country:"Bahrain",countryCode:"BH",taxIdType:"bh_vat",FlagComponent:_3x2.BH,example:"123456789012345"},{country:"Bangladesh",countryCode:"BD",taxIdType:"bd_bin",FlagComponent:_3x2.BD,example:"123456789-0123"},{country:"Barbados",countryCode:"BB",taxIdType:"bb_tin",FlagComponent:_3x2.BB,example:"1123456789012"},{country:"Belarus",countryCode:"BY",taxIdType:"by_tin",FlagComponent:_3x2.BY,example:"123456789"},{country:"Belgium",countryCode:"BE",taxIdType:"eu_vat",FlagComponent:_3x2.BE,example:"BE0123456789"},{country:"Benin",countryCode:"BJ",taxIdType:"bj_ifu",FlagComponent:_3x2.BJ,example:"1234567890123"},{country:"Bolivia",countryCode:"BO",taxIdType:"bo_tin",FlagComponent:_3x2.BO,example:"123456789"},{country:"Bosnia & Herzegovina",countryCode:"BA",taxIdType:"ba_tin",FlagComponent:_3x2.BA,example:"123456789012"},{country:"Brazil",countryCode:"BR",taxIdType:"br_cnpj",FlagComponent:_3x2.BR,example:"01.234.456/5432-10"},{country:"Brazil",countryCode:"BR",taxIdType:"br_cpf",FlagComponent:_3x2.BR,example:"123.456.789-87"},{country:"Bulgaria",countryCode:"BG",taxIdType:"bg_uic",FlagComponent:_3x2.BG,example:"123456789"},{country:"Bulgaria",countryCode:"BG",taxIdType:"eu_vat",FlagComponent:_3x2.BG,example:"BG0123456789"},{country:"Burkina Faso",countryCode:"BF",taxIdType:"bf_ifu",FlagComponent:_3x2.BF,example:"12345678A"},{country:"Cambodia",countryCode:"KH",taxIdType:"kh_tin",FlagComponent:_3x2.KH,example:"1001-123456789"},{country:"Cameroon",countryCode:"CM",taxIdType:"cm_niu",FlagComponent:_3x2.CM,example:"M123456789000L"},{country:"Canada",countryCode:"CA",taxIdType:"ca_bn",FlagComponent:_3x2.CA,example:"123456789"},{country:"Canada",countryCode:"CA",taxIdType:"ca_gst_hst",FlagComponent:_3x2.CA,example:"123456789RT0002"},{country:"Canada",countryCode:"CA",taxIdType:"ca_pst_bc",FlagComponent:_3x2.CA,example:"PST-1234-5678"},{country:"Canada",countryCode:"CA",taxIdType:"ca_pst_mb",FlagComponent:_3x2.CA,example:"123456-7"},{country:"Canada",countryCode:"CA",taxIdType:"ca_pst_sk",FlagComponent:_3x2.CA,example:"1234567"},{country:"Canada",countryCode:"CA",taxIdType:"ca_qst",FlagComponent:_3x2.CA,example:"1234567890TQ1234"},{country:"Cape Verde",countryCode:"CV",taxIdType:"cv_nif",FlagComponent:_3x2.CV,example:"213456789"},{country:"Chile",countryCode:"CL",taxIdType:"cl_tin",FlagComponent:_3x2.CL,example:"12.345.678-K"},{country:"China",countryCode:"CN",taxIdType:"cn_tin",FlagComponent:_3x2.CN,example:"123456789012345678"},{country:"Colombia",countryCode:"CO",taxIdType:"co_nit",FlagComponent:_3x2.CO,example:"123.456.789-0"},{country:"Congo - Kinshasa",countryCode:"CD",taxIdType:"cd_nif",FlagComponent:_3x2.CD,example:"A0123456M"},{country:"Costa Rica",countryCode:"CR",taxIdType:"cr_tin",FlagComponent:_3x2.CR,example:"1-234-567890"},{country:"Croatia",countryCode:"HR",taxIdType:"eu_vat",FlagComponent:_3x2.HR,example:"HR12345678912"},{country:"Croatia",countryCode:"HR",taxIdType:"hr_oib",FlagComponent:_3x2.HR,example:"12345678901"},{country:"Cyprus",countryCode:"CY",taxIdType:"eu_vat",FlagComponent:_3x2.CY,example:"CY12345678Z"},{country:"Czech Republic",countryCode:"CZ",taxIdType:"eu_vat",FlagComponent:_3x2.CZ,example:"CZ1234567890"},{country:"Denmark",countryCode:"DK",taxIdType:"eu_vat",FlagComponent:_3x2.DK,example:"DK12345678"},{country:"Dominican Republic",countryCode:"DO",taxIdType:"do_rcn",FlagComponent:_3x2.DO,example:"123-4567890-1"},{country:"Ecuador",countryCode:"EC",taxIdType:"ec_ruc",FlagComponent:_3x2.EC,example:"1234567890001"},{country:"Egypt",countryCode:"EG",taxIdType:"eg_tin",FlagComponent:_3x2.EG,example:"123456789"},{country:"El Salvador",countryCode:"SV",taxIdType:"sv_nit",FlagComponent:_3x2.SV,example:"1234-567890-123-4"},{country:"Estonia",countryCode:"EE",taxIdType:"eu_vat",FlagComponent:_3x2.EE,example:"EE123456789"},{country:"Ethiopia",countryCode:"ET",taxIdType:"et_tin",FlagComponent:_3x2.ET,example:"1234567890"},{country:"EU",countryCode:"EU",taxIdType:"eu_oss_vat",FlagComponent:_3x2.EU,example:"EU123456789"},{country:"Finland",countryCode:"FI",taxIdType:"eu_vat",FlagComponent:_3x2.FI,example:"FI12345678"},{country:"France",countryCode:"FR",taxIdType:"eu_vat",FlagComponent:_3x2.FR,example:"FRAB123456789"},{country:"Georgia",countryCode:"GE",taxIdType:"ge_vat",FlagComponent:_3x2.GE,example:"123456789"},{country:"Germany",countryCode:"DE",taxIdType:"de_stn",FlagComponent:_3x2.DE,example:"1234567890"},{country:"Germany",countryCode:"DE",taxIdType:"eu_vat",FlagComponent:_3x2.DE,example:"DE123456789"},{country:"Greece",countryCode:"GR",taxIdType:"eu_vat",FlagComponent:_3x2.GR,example:"EL123456789"},{country:"Guinea",countryCode:"GN",taxIdType:"gn_nif",FlagComponent:_3x2.GN,example:"123456789"},{country:"Hong Kong",countryCode:"HK",taxIdType:"hk_br",FlagComponent:_3x2.HK,example:"12345678"},{country:"Hungary",countryCode:"HU",taxIdType:"eu_vat",FlagComponent:_3x2.HU,example:"HU12345678"},{country:"Hungary",countryCode:"HU",taxIdType:"hu_tin",FlagComponent:_3x2.HU,example:"12345678-1-23"},{country:"Iceland",countryCode:"IS",taxIdType:"is_vat",FlagComponent:_3x2.IS,example:"123456"},{country:"India",countryCode:"IN",taxIdType:"in_gst",FlagComponent:_3x2.IN,example:"12ABCDE3456FGZH"},{country:"Indonesia",countryCode:"ID",taxIdType:"id_npwp",FlagComponent:_3x2.ID,example:"012.345.678.9-012.345"},{country:"Ireland",countryCode:"IE",taxIdType:"eu_vat",FlagComponent:_3x2.IE,example:"IE1234567AB"},{country:"Israel",countryCode:"IL",taxIdType:"il_vat",FlagComponent:_3x2.IL,example:"000012345"},{country:"Italy",countryCode:"IT",taxIdType:"eu_vat",FlagComponent:_3x2.IT,example:"IT12345678912"},{country:"Japan",countryCode:"JP",taxIdType:"jp_cn",FlagComponent:_3x2.JP,example:"1234567891234"},{country:"Japan",countryCode:"JP",taxIdType:"jp_rn",FlagComponent:_3x2.JP,example:"12345"},{country:"Japan",countryCode:"JP",taxIdType:"jp_trn",FlagComponent:_3x2.JP,example:"T1234567891234"},{country:"Kazakhstan",countryCode:"KZ",taxIdType:"kz_bin",FlagComponent:_3x2.KZ,example:"123456789012"},{country:"Kenya",countryCode:"KE",taxIdType:"ke_pin",FlagComponent:_3x2.KE,example:"P000111111A"},{country:"Kyrgyzstan",countryCode:"KG",taxIdType:"kg_tin",FlagComponent:_3x2.KG,example:"12345678901234"},{country:"Laos",countryCode:"LA",taxIdType:"la_tin",FlagComponent:_3x2.LA,example:"123456789-000"},{country:"Latvia",countryCode:"LV",taxIdType:"eu_vat",FlagComponent:_3x2.LV,example:"LV12345678912"},{country:"Liechtenstein",countryCode:"LI",taxIdType:"li_uid",FlagComponent:_3x2.LI,example:"CHE123456789"},{country:"Liechtenstein",countryCode:"LI",taxIdType:"li_vat",FlagComponent:_3x2.LI,example:"12345"},{country:"Lithuania",countryCode:"LT",taxIdType:"eu_vat",FlagComponent:_3x2.LT,example:"LT123456789123"},{country:"Luxembourg",countryCode:"LU",taxIdType:"eu_vat",FlagComponent:_3x2.LU,example:"LU12345678"},{country:"Malaysia",countryCode:"MY",taxIdType:"my_frp",FlagComponent:_3x2.MY,example:"12345678"},{country:"Malaysia",countryCode:"MY",taxIdType:"my_itn",FlagComponent:_3x2.MY,example:"C 1234567890"},{country:"Malaysia",countryCode:"MY",taxIdType:"my_sst",FlagComponent:_3x2.MY,example:"A12-3456-78912345"},{country:"Malta",countryCode:"MT",taxIdType:"eu_vat",FlagComponent:_3x2.MT,example:"MT12345678"},{country:"Mauritania",countryCode:"MR",taxIdType:"mr_nif",FlagComponent:_3x2.MR,example:"12345678"},{country:"Mexico",countryCode:"MX",taxIdType:"mx_rfc",FlagComponent:_3x2.MX,example:"ABC010203AB9"},{country:"Moldova",countryCode:"MD",taxIdType:"md_vat",FlagComponent:_3x2.MD,example:"1234567"},{country:"Montenegro",countryCode:"ME",taxIdType:"me_pib",FlagComponent:_3x2.ME,example:"12345678"},{country:"Morocco",countryCode:"MA",taxIdType:"ma_vat",FlagComponent:_3x2.MA,example:"12345678"},{country:"Nepal",countryCode:"NP",taxIdType:"np_pan",FlagComponent:_3x2.NP,example:"123456789"},{country:"Netherlands",countryCode:"NL",taxIdType:"eu_vat",FlagComponent:_3x2.NL,example:"NL123456789B12"},{country:"New Zealand",countryCode:"NZ",taxIdType:"nz_gst",FlagComponent:_3x2.NZ,example:"123456789"},{country:"Nigeria",countryCode:"NG",taxIdType:"ng_tin",FlagComponent:_3x2.NG,example:"12345678-0001"},{country:"North Macedonia",countryCode:"MK",taxIdType:"mk_vat",FlagComponent:_3x2.MK,example:"MK1234567890123"},{country:"Norway",countryCode:"NO",taxIdType:"no_vat",FlagComponent:_3x2.NO,example:"123456789MVA"},{country:"Norway",countryCode:"NO",taxIdType:"no_voec",FlagComponent:_3x2.NO,example:"1234567"},{country:"Oman",countryCode:"OM",taxIdType:"om_vat",FlagComponent:_3x2.OM,example:"OM1234567890"},{country:"Peru",countryCode:"PE",taxIdType:"pe_ruc",FlagComponent:_3x2.PE,example:"12345678901"},{country:"Philippines",countryCode:"PH",taxIdType:"ph_tin",FlagComponent:_3x2.PH,example:"123456789012"},{country:"Poland",countryCode:"PL",taxIdType:"eu_vat",FlagComponent:_3x2.PL,example:"PL1234567890"},{country:"Portugal",countryCode:"PT",taxIdType:"eu_vat",FlagComponent:_3x2.PT,example:"PT123456789"},{country:"Romania",countryCode:"RO",taxIdType:"eu_vat",FlagComponent:_3x2.RO,example:"RO1234567891"},{country:"Romania",countryCode:"RO",taxIdType:"ro_tin",FlagComponent:_3x2.RO,example:"1234567890123"},{country:"Russia",countryCode:"RU",taxIdType:"ru_inn",FlagComponent:_3x2.RU,example:"1234567891"},{country:"Russia",countryCode:"RU",taxIdType:"ru_kpp",FlagComponent:_3x2.RU,example:"123456789"},{country:"Saudi Arabia",countryCode:"SA",taxIdType:"sa_vat",FlagComponent:_3x2.SA,example:"123456789012345"},{country:"Senegal",countryCode:"SN",taxIdType:"sn_ninea",FlagComponent:_3x2.SN,example:"12345672A2"},{country:"Serbia",countryCode:"RS",taxIdType:"rs_pib",FlagComponent:_3x2.RS,example:"123456789"},{country:"Singapore",countryCode:"SG",taxIdType:"sg_gst",FlagComponent:_3x2.SG,example:"M12345678X"},{country:"Singapore",countryCode:"SG",taxIdType:"sg_uen",FlagComponent:_3x2.SG,example:"123456789F"},{country:"Slovakia",countryCode:"SK",taxIdType:"eu_vat",FlagComponent:_3x2.SK,example:"SK1234567891"},{country:"Slovenia",countryCode:"SI",taxIdType:"eu_vat",FlagComponent:_3x2.SI,example:"SI12345678"},{country:"Slovenia",countryCode:"SI",taxIdType:"si_tin",FlagComponent:_3x2.SI,example:"12345678"},{country:"South Africa",countryCode:"ZA",taxIdType:"za_vat",FlagComponent:_3x2.ZA,example:"4123456789"},{country:"South Korea",countryCode:"KR",taxIdType:"kr_brn",FlagComponent:_3x2.KR,example:"123-45-67890"},{country:"Spain",countryCode:"ES",taxIdType:"es_cif",FlagComponent:_3x2.ES,example:"A12345678"},{country:"Spain",countryCode:"ES",taxIdType:"eu_vat",FlagComponent:_3x2.ES,example:"ESA1234567Z"},{country:"Suriname",countryCode:"SR",taxIdType:"sr_fin",FlagComponent:_3x2.SR,example:"1234567890"},{country:"Sweden",countryCode:"SE",taxIdType:"eu_vat",FlagComponent:_3x2.SE,example:"SE123456789123"},{country:"Switzerland",countryCode:"CH",taxIdType:"ch_uid",FlagComponent:_3x2.CH,example:"CHE-123.456.789 HR"},{country:"Switzerland",countryCode:"CH",taxIdType:"ch_vat",FlagComponent:_3x2.CH,example:"CHE-123.456.789 MWST"},{country:"Taiwan",countryCode:"TW",taxIdType:"tw_vat",FlagComponent:_3x2.TW,example:"12345678"},{country:"Tajikistan",countryCode:"TJ",taxIdType:"tj_tin",FlagComponent:_3x2.TJ,example:"123456789"},{country:"Tanzania",countryCode:"TZ",taxIdType:"tz_vat",FlagComponent:_3x2.TZ,example:"12345678A"},{country:"Thailand",countryCode:"TH",taxIdType:"th_vat",FlagComponent:_3x2.TH,example:"1234567891234"},{country:"Turkey",countryCode:"TR",taxIdType:"tr_tin",FlagComponent:_3x2.TR,example:"0123456789"},{country:"Uganda",countryCode:"UG",taxIdType:"ug_tin",FlagComponent:_3x2.UG,example:"1014751879"},{country:"Ukraine",countryCode:"UA",taxIdType:"ua_vat",FlagComponent:_3x2.UA,example:"123456789"},{country:"United Arab Emirates",countryCode:"AE",taxIdType:"ae_trn",FlagComponent:_3x2.AE,example:"123456789012345"},{country:"United Kingdom",countryCode:"GB",taxIdType:"eu_vat",FlagComponent:_3x2.GB,example:"XI123456789"},{country:"United Kingdom",countryCode:"GB",taxIdType:"gb_vat",FlagComponent:_3x2.GB,example:"GB123456789"},{country:"United States",countryCode:"US",taxIdType:"us_ein",FlagComponent:_3x2.US,example:"12-3456789"},{country:"Uruguay",countryCode:"UY",taxIdType:"uy_ruc",FlagComponent:_3x2.UY,example:"123456789012"},{country:"Uzbekistan",countryCode:"UZ",taxIdType:"uz_tin",FlagComponent:_3x2.UZ,example:"123456789"},{country:"Uzbekistan",countryCode:"UZ",taxIdType:"uz_vat",FlagComponent:_3x2.UZ,example:"123456789012"},{country:"Venezuela",countryCode:"VE",taxIdType:"ve_rif",FlagComponent:_3x2.VE,example:"A-12345678-9"},{country:"Vietnam",countryCode:"VN",taxIdType:"vn_tin",FlagComponent:_3x2.VN,example:"1234567890"},{country:"Zambia",countryCode:"ZM",taxIdType:"zm_tin",FlagComponent:_3x2.ZM,example:"1004751879"},{country:"Zimbabwe",countryCode:"ZW",taxIdType:"zw_tin",FlagComponent:_3x2.ZW,example:"1234567890"}],zP="United States",VP=" # ",Sr="us_ein",Tr=(e,t)=>`${e}${VP}${t}`,Ti=new Map(Si.map(e=>[Tr(e.taxIdType,e.country),e])),Et=e=>Ti.get(e),kr=Tr(Sr,zP);var ki=chunkIVDIW747_cjs_js.e(pe)(()=>({"& .MuiOutlinedInput-root":{borderRadius:"5px",padding:"12px",fieldset:{borderColor:"#e6e6e6"}},"& .MuiInputBase-input":{borderRadius:"5px",fontSize:"16px",padding:"0 0"}}));var YP=chunkIVDIW747_cjs_js.e(OP__default.default)(()=>({"& .MuiAutocomplete-input":{padding:"0 !important"}})),wr=chunkIVDIW747_cjs_js.e(chunkIVDIW747_cjs_js.f)({});wr.defaultProps={variant:"body1",color:"secondary"};function yd(){let[e,t]=yi.useState(false),{billingAddress:o,taxId:r,setTaxId:n}=re(),[i,a]=yi.useState(kr),[l,s]=yi.useState(false),c=yi.useCallback((g,h,P)=>{n({type:h,value:P}),a(g);},[n,a]);yi.useEffect(()=>{s(false);},[o==null?void 0:o.country]),yi.useEffect(()=>{if(!(o!=null&&o.country)||l||!e)return;let g=Si.find(h=>h.countryCode===o.country);g&&c(Tr(g.taxIdType,g.country),g.taxIdType,"");},[o,e,l,c]);let u=g=>{if(!g)return;let h=Et(g);if(h){if(s(true),r!=null&&r.value){c(g,h.taxIdType,r.value);return}a(g),r!=null&&r.type&&n(void 0);}},f=yi.useMemo(()=>Array.from(Ti.keys()),[]),y=yi.useMemo(()=>f.find(g=>g===i)||null,[f,i]),p=yi.useMemo(()=>{let g=Et(i);return (g==null?void 0:g.example)||"Add your VAT/GST or local tax ID."},[i]);return yi.useEffect(()=>(e||(s(false),c(kr,Sr,"")),()=>{c(kr,Sr,"");}),[e,c]),jsxRuntime.jsxs(Re__default.default,{flexDirection:"column",container:true,gap:2,children:[jsxRuntime.jsx(Re__default.default,{flexDirection:"row",container:true,gap:2,children:jsxRuntime.jsx(Jc,{checked:e,onChange:()=>t(g=>!g),label:jsxRuntime.jsx(wr,{children:"I'm purchasing as a business"})})}),jsxRuntime.jsx(HP__default.default,{in:e,children:jsxRuntime.jsxs(Re__default.default,{container:true,spacing:0,sx:{width:"100%"},children:[jsxRuntime.jsxs(Re__default.default,{item:true,xs:6,children:[jsxRuntime.jsx(wr,{children:"Tax ID Type"}),jsxRuntime.jsx(YP,{fullWidth:true,options:f,value:y,onChange:(g,h)=>u(h),renderInput:g=>jsxRuntime.jsx(ki,chunkIVDIW747_cjs_js.b(chunkIVDIW747_cjs_js.a({},g),{id:"id-type",InputProps:g.InputProps})),renderOption:(g,h)=>{let P=Et(h);if(!P)return null;let{taxIdType:b,country:x,FlagComponent:A}=P;return yi.createElement(ku__default.default,chunkIVDIW747_cjs_js.b(chunkIVDIW747_cjs_js.a({},g),{key:h}),jsxRuntime.jsxs(chunkIVDIW747_cjs_js.f,{variant:"body1",lineHeight:"20px",color:"secondary",children:[A&&jsxRuntime.jsx(A,{width:15,style:{marginRight:"5px",borderRadius:"8%"}}),gd__default.default(x)," - ",fd__default.default(b)]}))},getOptionLabel:g=>{let h=Et(g);return h?`${gd__default.default(h.country)} - ${fd__default.default(h.taxIdType)}`:g},ListboxProps:{sx:{maxHeight:200}}})]}),jsxRuntime.jsxs(Re__default.default,{item:true,xs:6,paddingLeft:"12px",children:[jsxRuntime.jsx(wr,{children:"Tax ID"}),jsxRuntime.jsx(ki,{id:"tax-id-value",placeholder:p,type:"text",fullWidth:true,value:(r==null?void 0:r.value)||"",onChange:g=>{let h=Et(i);h&&c(i,h.taxIdType,g.target.value);}})]})]})})]})}function hd({onBillingAddressChange:e,collectPhoneNumber:t,collectTaxId:o}){var g;let{checkoutState:r,checkoutLocalization:n,widgetState:i,setWidgetReadOnly:a}=D(),{setBillingAddress:l}=re(),{customer:s,configuration:c}=r||{},{readOnly:u}=i,f=!!(t!=null?t:(g=c==null?void 0:c.content)!=null&&g.collectPhoneNumber),y=yi.useMemo(()=>o&&!(s!=null&&s.billingId)&&!(s!=null&&s.paymentMethodDetails),[o,s==null?void 0:s.billingId,s==null?void 0:s.paymentMethodDetails]),p=h=>{if(!h.complete)return;let A=h.value.address,{postal_code:P}=A,b=chunkIVDIW747_cjs_js.c(A,["postal_code"]),x=chunkIVDIW747_cjs_js.a({postalCode:P},b);a(true),l(x),e?chunkIVDIW747_cjs_js.d(null,null,function*(){yield e({billingAddress:x}),a(false);}):a(false);};return jsxRuntime.jsxs(Re__default.default,{flexDirection:"column",container:true,gap:3,padding:"16px",sx:{pointerEvents:u?"none":void 0},children:[jsxRuntime.jsxs(Re__default.default,{flexDirection:"column",container:true,gap:2,children:[jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{variant:"h6",children:n.newPaymentMethodBillingAddressTitle}),jsxRuntime.jsx(reactStripeJs.AddressElement,{onChange:p,options:{mode:"billing",fields:{phone:f?"always":"auto"},defaultValues:chunkIVDIW747_cjs_js.a({},(s==null?void 0:s.name)&&{name:s.name})}})]}),jsxRuntime.jsxs(Re__default.default,{flexDirection:"column",container:true,gap:2,children:[jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{variant:"h6",children:n.newPaymentMethodCardTitle}),jsxRuntime.jsx(reactStripeJs.PaymentElement,{onChange:()=>{},onReady:()=>{},options:{readOnly:u,terms:{card:"never"},defaultValues:{billingDetails:chunkIVDIW747_cjs_js.a(chunkIVDIW747_cjs_js.a({},(s==null?void 0:s.name)&&{name:s.name}),(s==null?void 0:s.email)&&{email:s.email})}}})]}),y&&jsxRuntime.jsx(yd,{})]})}function Cd(){let[e,t]=yi.useState(null),{checkoutState:o}=D(),{billingIntegration:r,setupSecret:n}=o||{};return yi.useEffect(()=>{if(r){let{billingIdentifier:i,credentials:a}=r;if(i!==jsClientSdk.BillingVendorIdentifier.Stripe)return;let{accountId:l,publicKey:s}=a;if(!l||!s){console.error("Stripe account ID or public key is missing");return}import('@stripe/stripe-js').then(({loadStripe:c})=>{t(c(s,{stripeAccount:l}));});}},[r]),{stripePromise:e,setupIntentClientSecret:n}}function Br(){let e=It(),[{resourceId:t,resetBillingPeriod:o}]=_(),{checkoutState:r}=D(),{plan:n,activeSubscription:i}=r||{},a=e.addons.map(({addon:c,quantity:u})=>({addonId:c.id,quantity:u}));if(!(n!=null&&n.id))return;let{prorationBehavior:l,billingCycleAnchor:s}=Cr({activeSubscription:i,resetBillingPeriod:o});return chunkIVDIW747_cjs_js.a(chunkIVDIW747_cjs_js.a({resourceId:t,planId:n.id,billingPeriod:e.billingPeriod,billableFeatures:e.billableFeatures,addons:a,promotionCode:e.promotionCode,billingCountryCode:e.billingCountryCode},hr({billingAddress:e.billingAddress,taxIds:e.taxId?[e.taxId]:void 0,prorationBehavior:l})),s?{billingCycleAnchor:s}:{})}var tx=[jsClientSdk.PaymentCollection.Failed,jsClientSdk.PaymentCollection.Processing];function ox(t){return chunkIVDIW747_cjs_js.d(this,arguments,function*({elements:e}){if(!e){let r="Stripe elements not initialized";return console.error(r),{success:false,errorMessage:r}}let{error:o}=yield e.submit();return o?(console.log(o.message),{success:false,errorMessage:o.message||""}):{success:true}})}function Ei(o){return chunkIVDIW747_cjs_js.d(this,arguments,function*({applySubscriptionResults:e,stripe:t}){var a,l;let r=e==null?void 0:e.subscription,n=(a=r==null?void 0:r.latestInvoice)==null?void 0:a.paymentSecret,i=r==null?void 0:r.paymentCollection;if(t&&n&&i===jsClientSdk.PaymentCollection.ActionRequired){let{error:s}=yield t.handleNextAction({clientSecret:n});if(s)return {errorMessage:s.message||""}}else if(i&&tx.includes(i))return {errorMessage:((l=r==null?void 0:r.latestInvoice)==null?void 0:l.errorMessage)||"An error occurred - try again later"};return {subscription:r}})}function rx(r){return chunkIVDIW747_cjs_js.d(this,arguments,function*({stripe:e,elements:t,clientSecret:o}){let n,i,{error:a}=yield e.confirmSetup({elements:t,confirmParams:{return_url:window.location.href},redirect:"if_required"});if(a)a.type==="card_error"||a.type==="validation_error"?a.type==="card_error"&&(i=a.message||""):i="An unexpected error occurred.";else try{let{setupIntent:l}=yield e.retrieveSetupIntent(o);l!=null&&l.payment_method&&(n=l.payment_method);}catch(l){i="An unexpected error occurred.",console.error(l);}return {newPaymentMethodId:n,setupErrorMessage:i}})}function Pd(r){return chunkIVDIW747_cjs_js.d(this,arguments,function*({stripe:e,elements:t,setupIntentClientSecret:o}){if(!e||!t||!o)return {success:false};let n=yield ox({elements:t});if(!n.success)return {success:false,errorMessage:n.errorMessage};let{newPaymentMethodId:i,setupErrorMessage:a}=yield rx({stripe:e,elements:t,clientSecret:o});return a||!i?{success:false,errorMessage:a}:{success:true,paymentMethodId:i}})}var xd={v:"5.12.1",fr:30,ip:0,op:201,w:700,h:700,nm:"Check",ddd:0,assets:[],layers:[{ddd:0,ind:1,ty:4,nm:"Shape Layer 8",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:315,ix:10},p:{a:0,k:[350,350,0],ix:2,l:2},a:{a:0,k:[-304,91,0],ix:1,l:2},s:{a:0,k:[100,100,100],ix:6,l:2}},ao:0,shapes:[{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[0,0],[0,0]],o:[[0,0],[0,0]],v:[[-304,-241],[-304,-161]],c:false},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:false},{ty:"st",c:{a:0,k:[1,1,1,1],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:9,ix:5},lc:2,lj:1,ml:4,bm:0,nm:"Stroke 1",mn:"ADBE Vector Graphic - Stroke",hd:false},{ty:"tr",p:{a:0,k:[0,0],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Transform"}],nm:"Shape 1",np:3,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:false},{ty:"tm",s:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:135,s:[100]},{t:145.5,s:[0]}],ix:1},e:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:130,s:[100]},{t:139.6005859375,s:[0]}],ix:2},o:{a:0,k:0,ix:3},m:1,ix:2,nm:"Trim Paths 1",mn:"ADBE Vector Filter - Trim",hd:false}],ip:130,op:204,st:-2,ct:1,bm:0},{ddd:0,ind:2,ty:4,nm:"Shape Layer 7",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:270,ix:10},p:{a:0,k:[350,350,0],ix:2,l:2},a:{a:0,k:[-304,91,0],ix:1,l:2},s:{a:0,k:[100,100,100],ix:6,l:2}},ao:0,shapes:[{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[0,0],[0,0]],o:[[0,0],[0,0]],v:[[-304,-241],[-304,-161]],c:false},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:false},{ty:"st",c:{a:0,k:[1,1,1,1],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:9,ix:5},lc:2,lj:1,ml:4,bm:0,nm:"Stroke 1",mn:"ADBE Vector Graphic - Stroke",hd:false},{ty:"tr",p:{a:0,k:[0,0],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Transform"}],nm:"Shape 1",np:3,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:false},{ty:"tm",s:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:135,s:[100]},{t:145.5,s:[0]}],ix:1},e:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:130,s:[100]},{t:139.6005859375,s:[0]}],ix:2},o:{a:0,k:0,ix:3},m:1,ix:2,nm:"Trim Paths 1",mn:"ADBE Vector Filter - Trim",hd:false}],ip:130,op:204,st:-2,ct:1,bm:0},{ddd:0,ind:3,ty:4,nm:"Shape Layer 6",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:225,ix:10},p:{a:0,k:[350,350,0],ix:2,l:2},a:{a:0,k:[-304,91,0],ix:1,l:2},s:{a:0,k:[100,100,100],ix:6,l:2}},ao:0,shapes:[{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[0,0],[0,0]],o:[[0,0],[0,0]],v:[[-304,-241],[-304,-161]],c:false},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:false},{ty:"st",c:{a:0,k:[1,1,1,1],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:9,ix:5},lc:2,lj:1,ml:4,bm:0,nm:"Stroke 1",mn:"ADBE Vector Graphic - Stroke",hd:false},{ty:"tr",p:{a:0,k:[0,0],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Transform"}],nm:"Shape 1",np:3,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:false},{ty:"tm",s:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:135,s:[100]},{t:145.5,s:[0]}],ix:1},e:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:130,s:[100]},{t:139.6005859375,s:[0]}],ix:2},o:{a:0,k:0,ix:3},m:1,ix:2,nm:"Trim Paths 1",mn:"ADBE Vector Filter - Trim",hd:false}],ip:130,op:204,st:-2,ct:1,bm:0},{ddd:0,ind:4,ty:4,nm:"Shape Layer 5",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:180,ix:10},p:{a:0,k:[350,350,0],ix:2,l:2},a:{a:0,k:[-304,91,0],ix:1,l:2},s:{a:0,k:[100,100,100],ix:6,l:2}},ao:0,shapes:[{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[0,0],[0,0]],o:[[0,0],[0,0]],v:[[-304,-241],[-304,-161]],c:false},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:false},{ty:"st",c:{a:0,k:[1,1,1,1],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:9,ix:5},lc:2,lj:1,ml:4,bm:0,nm:"Stroke 1",mn:"ADBE Vector Graphic - Stroke",hd:false},{ty:"tr",p:{a:0,k:[0,0],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Transform"}],nm:"Shape 1",np:3,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:false},{ty:"tm",s:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:135,s:[100]},{t:145.5,s:[0]}],ix:1},e:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:130,s:[100]},{t:139.6005859375,s:[0]}],ix:2},o:{a:0,k:0,ix:3},m:1,ix:2,nm:"Trim Paths 1",mn:"ADBE Vector Filter - Trim",hd:false}],ip:130,op:204,st:-2,ct:1,bm:0},{ddd:0,ind:5,ty:4,nm:"Shape Layer 4",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:135,ix:10},p:{a:0,k:[350,350,0],ix:2,l:2},a:{a:0,k:[-304,91,0],ix:1,l:2},s:{a:0,k:[100,100,100],ix:6,l:2}},ao:0,shapes:[{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[0,0],[0,0]],o:[[0,0],[0,0]],v:[[-304,-241],[-304,-161]],c:false},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:false},{ty:"st",c:{a:0,k:[1,1,1,1],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:9,ix:5},lc:2,lj:1,ml:4,bm:0,nm:"Stroke 1",mn:"ADBE Vector Graphic - Stroke",hd:false},{ty:"tr",p:{a:0,k:[0,0],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Transform"}],nm:"Shape 1",np:3,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:false},{ty:"tm",s:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:135,s:[100]},{t:145.5,s:[0]}],ix:1},e:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:130,s:[100]},{t:139.6005859375,s:[0]}],ix:2},o:{a:0,k:0,ix:3},m:1,ix:2,nm:"Trim Paths 1",mn:"ADBE Vector Filter - Trim",hd:false}],ip:130,op:204,st:-2,ct:1,bm:0},{ddd:0,ind:6,ty:4,nm:"Shape Layer 3",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:90,ix:10},p:{a:0,k:[350,350,0],ix:2,l:2},a:{a:0,k:[-304,91,0],ix:1,l:2},s:{a:0,k:[100,100,100],ix:6,l:2}},ao:0,shapes:[{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[0,0],[0,0]],o:[[0,0],[0,0]],v:[[-304,-241],[-304,-161]],c:false},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:false},{ty:"st",c:{a:0,k:[1,1,1,1],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:9,ix:5},lc:2,lj:1,ml:4,bm:0,nm:"Stroke 1",mn:"ADBE Vector Graphic - Stroke",hd:false},{ty:"tr",p:{a:0,k:[0,0],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Transform"}],nm:"Shape 1",np:3,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:false},{ty:"tm",s:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:135,s:[100]},{t:145.5,s:[0]}],ix:1},e:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:130,s:[100]},{t:139.6005859375,s:[0]}],ix:2},o:{a:0,k:0,ix:3},m:1,ix:2,nm:"Trim Paths 1",mn:"ADBE Vector Filter - Trim",hd:false}],ip:130,op:204,st:-2,ct:1,bm:0},{ddd:0,ind:7,ty:4,nm:"Shape Layer 2",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:45,ix:10},p:{a:0,k:[350,350,0],ix:2,l:2},a:{a:0,k:[-304,91,0],ix:1,l:2},s:{a:0,k:[100,100,100],ix:6,l:2}},ao:0,shapes:[{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[0,0],[0,0]],o:[[0,0],[0,0]],v:[[-304,-241],[-304,-161]],c:false},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:false},{ty:"st",c:{a:0,k:[1,1,1,1],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:9,ix:5},lc:2,lj:1,ml:4,bm:0,nm:"Stroke 1",mn:"ADBE Vector Graphic - Stroke",hd:false},{ty:"tr",p:{a:0,k:[0,0],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Transform"}],nm:"Shape 1",np:3,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:false},{ty:"tm",s:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:135,s:[100]},{t:145.5,s:[0]}],ix:1},e:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:130,s:[100]},{t:139.6005859375,s:[0]}],ix:2},o:{a:0,k:0,ix:3},m:1,ix:2,nm:"Trim Paths 1",mn:"ADBE Vector Filter - Trim",hd:false}],ip:130,op:204,st:-2,ct:1,bm:0},{ddd:0,ind:8,ty:4,nm:"Shape Layer 1",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:0,ix:10},p:{a:0,k:[350,350,0],ix:2,l:2},a:{a:0,k:[-304,91,0],ix:1,l:2},s:{a:0,k:[100,100,100],ix:6,l:2}},ao:0,shapes:[{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[0,0],[0,0]],o:[[0,0],[0,0]],v:[[-304,-241],[-304,-161]],c:false},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:false},{ty:"st",c:{a:0,k:[1,1,1,1],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:9,ix:5},lc:2,lj:1,ml:4,bm:0,nm:"Stroke 1",mn:"ADBE Vector Graphic - Stroke",hd:false},{ty:"tr",p:{a:0,k:[0,0],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Transform"}],nm:"Shape 1",np:3,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:false},{ty:"tm",s:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:135,s:[100]},{t:145.5,s:[0]}],ix:1},e:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:130,s:[100]},{t:139.6005859375,s:[0]}],ix:2},o:{a:0,k:0,ix:3},m:1,ix:2,nm:"Trim Paths 1",mn:"ADBE Vector Filter - Trim",hd:false}],ip:130,op:204,st:-2,ct:1,bm:0},{ddd:0,ind:9,ty:4,nm:"Check v",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:-1.9,ix:10},p:{a:0,k:[352,360,0],ix:2,l:2},a:{a:0,k:[-120.265,116.765,0],ix:1,l:2},s:{a:0,k:[278,278,100],ix:6,l:2}},ao:0,shapes:[{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0]],v:[[-161,123],[-137,148],[-79.531,85.531]],c:false},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:false},{ty:"st",c:{a:0,k:[1,1,1,1],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:5.5,ix:5},lc:2,lj:2,bm:0,nm:"Stroke 1",mn:"ADBE Vector Graphic - Stroke",hd:false},{ty:"tr",p:{a:0,k:[0,0],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Transform"}],nm:"Shape 1",np:3,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:false},{ty:"tm",s:{a:1,k:[{i:{x:[0],y:[1]},o:{x:[.333],y:[0]},t:135,s:[0]},{t:148,s:[100]}],ix:1},e:{a:0,k:0,ix:2},o:{a:0,k:0,ix:3},m:1,ix:2,nm:"Trim Paths 1",mn:"ADBE Vector Filter - Trim",hd:false}],ip:135,op:201,st:-35,ct:1,bm:0},{ddd:0,ind:11,ty:4,nm:"Circle Stroke",sr:1,ks:{o:{a:1,k:[{i:{x:[.833],y:[.833]},o:{x:[.167],y:[.167]},t:0,s:[0]},{t:7,s:[100]}],ix:11},r:{a:0,k:0,ix:10},p:{a:0,k:[350,350,0],ix:2,l:2},a:{a:0,k:[4,-6,0],ix:1,l:2},s:{a:0,k:[132,132,100],ix:6,l:2}},ao:0,shapes:[{ty:"gr",it:[{d:1,ty:"el",s:{a:0,k:[306,306],ix:2},p:{a:0,k:[0,0],ix:3},nm:"Ellipse Path 1",mn:"ADBE Vector Shape - Ellipse",hd:false},{ty:"st",c:{a:1,k:[{i:{x:[.833],y:[.833]},o:{x:[.167],y:[.167]},t:0,s:[1,1,1,1]},{i:{x:[.833],y:[.833]},o:{x:[.167],y:[.167]},t:30,s:[1,1,1,1]},{i:{x:[.833],y:[.833]},o:{x:[.167],y:[.167]},t:61,s:[1,1,1,1]},{i:{x:[.833],y:[.833]},o:{x:[.167],y:[.167]},t:87,s:[1,1,1,1]},{t:136,s:[1,1,1,1]}],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:8,ix:5},lc:2,lj:1,ml:4,bm:0,nm:"Stroke 1",mn:"ADBE Vector Graphic - Stroke",hd:false},{ty:"tr",p:{a:0,k:[4,-6],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Transform"}],nm:"Ellipse 1",np:3,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:false},{ty:"tm",s:{a:1,k:[{i:{x:[.338],y:[1]},o:{x:[.333],y:[0]},t:87,s:[50]},{t:122,s:[100]}],ix:1},e:{a:1,k:[{i:{x:[.338],y:[1]},o:{x:[.333],y:[0]},t:87,s:[45]},{t:122,s:[0]}],ix:2},o:{a:1,k:[{i:{x:[.474],y:[1]},o:{x:[.43],y:[0]},t:0,s:[-170.4]},{t:111,s:[-1250.4]}],ix:3},m:1,ix:2,nm:"Trim Paths 1",mn:"ADBE Vector Filter - Trim",hd:false}],ip:0,op:201,st:0,ct:1,bm:0},{ddd:0,ind:13,ty:1,nm:"Dark Gray Solid 1",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:0,ix:10},p:{a:0,k:[350,350,0],ix:2,l:2},a:{a:0,k:[350,350,0],ix:1,l:2},s:{a:0,k:[100,100,100],ix:6,l:2}},ao:0,sw:700,sh:700,sc:"#2d2d2d",ip:0,op:201,st:0,bm:0}],markers:[],props:{}};var Ar=5e3,cx=chunkIVDIW747_cjs_js.e(ke__default.default)`
|
|
587
589
|
@keyframes blurFade {
|
|
588
590
|
0% {
|
|
589
591
|
background-color: ${({theme:e})=>Li__default.default(e.stigg.palette.backgroundPaper).alpha(0).toString()};
|
|
@@ -614,7 +616,7 @@
|
|
|
614
616
|
& path {
|
|
615
617
|
stroke: ${({theme:e})=>e.stigg.palette.primary};
|
|
616
618
|
}
|
|
617
|
-
`,dx=
|
|
619
|
+
`,dx=chunkIVDIW747_cjs_js.e(chunkIVDIW747_cjs_js.f)`
|
|
618
620
|
@keyframes fadeIn {
|
|
619
621
|
0% {
|
|
620
622
|
opacity: 0;
|
|
@@ -629,19 +631,19 @@
|
|
|
629
631
|
|
|
630
632
|
align-self: center;
|
|
631
633
|
animation: fadeIn 5s ease-in forwards;
|
|
632
|
-
`;function Sd({checkoutLocalization:e}){let t=yi.useRef();return yi.useEffect(()=>{t.current&&t.current.scrollIntoView({behavior:"smooth",block:"center",inline:"center"});},[]),jsxRuntime.jsxs(cx,{className:"stigg-checkout-success-container",ref:t,children:[jsxRuntime.jsx(lx__default.default,{options:{animationData:xd,loop:false,autoplay:true},width:350,height:"auto",style:{display:"flex",justifyContent:"center"}}),jsxRuntime.jsx(dx,{variant:"h1",color:"primary.main",children:e.summary.checkoutSuccessText})]})}var gx=e=>new Promise(t=>setTimeout(t,e));function Td({isMocked:e=false,onCheckout:t,onCheckoutCompleted:o,onSuccess:r,disableSuccessAnimation:n}){let{stigg:i}=
|
|
634
|
+
`;function Sd({checkoutLocalization:e}){let t=yi.useRef();return yi.useEffect(()=>{t.current&&t.current.scrollIntoView({behavior:"smooth",block:"center",inline:"center"});},[]),jsxRuntime.jsxs(cx,{className:"stigg-checkout-success-container",ref:t,children:[jsxRuntime.jsx(lx__default.default,{options:{animationData:xd,loop:false,autoplay:true},width:350,height:"auto",style:{display:"flex",justifyContent:"center"}}),jsxRuntime.jsx(dx,{variant:"h1",color:"primary.main",children:e.summary.checkoutSuccessText})]})}var gx=e=>new Promise(t=>setTimeout(t,e));function Td({isMocked:e=false,onCheckout:t,onCheckoutCompleted:o,onSuccess:r,disableSuccessAnimation:n}){let{stigg:i}=chunkIVDIW747_cjs_js.u(),{useNewPaymentMethod:a}=re(),l=Br(),{checkoutState:s,widgetState:c,setWidgetReadOnly:u}=D(),{setupSecret:f,customer:y}=s||{},p=reactStripeJs.useStripe(),g=reactStripeJs.useElements();return {handleSubmit:P=>chunkIVDIW747_cjs_js.d(null,null,function*(){if(P.preventDefault(),!l)return {success:false,errorMessage:"Unexpected error, please contact support."};let b=true,x,A=false,S;if(u(true),!e&&a){let w=yield Pd({elements:g,stripe:p,setupIntentClientSecret:f});w.success?S=w.paymentMethodId:(x=w.errorMessage,b=false);}let F=chunkIVDIW747_cjs_js.b(chunkIVDIW747_cjs_js.a({},l),{paymentMethodId:S}),T=w=>chunkIVDIW747_cjs_js.d(null,null,function*(){A=true;try{let I=yield i.applySubscription(w),v=yield Ei({applySubscriptionResults:I,stripe:p});return {success:!v.errorMessage,errorMessage:v.errorMessage,results:I}}catch(I){return console.error(I),x=I==null?void 0:I.message,{success:false,errorMessage:x}}}),k;if(b)if(t){let w=yield t({customerId:y.id,checkoutParams:F,checkoutAction:T});if(w.errorMessage&&(x=w.errorMessage),!A&&w.results&&w.success){let I=yield Ei({applySubscriptionResults:w.results,stripe:p});I.errorMessage&&(x=I.errorMessage,b=false);}b=b&&w.success&&!x,k=w.results;}else {let w=yield T(F);!w.success&&w.errorMessage&&(x=w.errorMessage),b=w.success&&!x,k=w.results;}return u(false),b&&r&&(r(),n||(yield gx(Ar))),yield o({success:b,error:x}),{results:k,success:!x,errorMessage:x}}),isLoading:!!(c!=null&&c.readOnly)}}function kd(){return !!window.Zuora}function wd(){let e=document.createElement("script");e.type="text/javascript",e.src="https://js.zuora.com/payment/v3/zuora.js",e.async=true,e.onerror=()=>{throw new Error("Failed to load Zuora library")},document.head.appendChild(e);}function Bd(e,t,o,r){return {locale:r||"en",region:(r==null?void 0:r.toUpperCase())||"US",currency:o,amount:"1",createPaymentSession:e,onComplete:t}}function Lt(){let{stigg:e}=chunkIVDIW747_cjs_js.u(),{setErrorMessage:t}=re(),{billingCountryCode:o}=be(),[r,n]=yi.useState(false),{checkoutState:i}=D(),{billingIntegration:a}=i||{},l=yi.useCallback(()=>chunkIVDIW747_cjs_js.d(null,null,function*(){if(!(i!=null&&i.customer.id)||!(i!=null&&i.plan.id))throw new Error("Customer and plan are required");let{token:u}=yield e.createPaymentSession({planId:i.plan.id,billingCountryCode:o});return u}),[i,e,o]),s=yi.useCallback(()=>{try{kd()||wd(),n(!0);}catch(u){t("Failed to initialize Zuora");}},[n,t]);return yi.useEffect(()=>{if(a){let{billingIdentifier:u}=a;u===jsClientSdk.BillingVendorIdentifier.Zuora&&s();}},[a,s]),{isZuoraIntegration:(a==null?void 0:a.billingIdentifier)===jsClientSdk.BillingVendorIdentifier.Zuora,isInitialized:r,createPaymentSession:l}}var Cx=e=>new Promise(t=>setTimeout(t,e));function Ir({onCheckout:e,onCheckoutCompleted:t,onSuccess:o,disableSuccessAnimation:r}){let{stigg:n}=chunkIVDIW747_cjs_js.u(),i=Br(),{checkoutState:a,setWidgetReadOnly:l,setCheckoutSuccess:s}=D(),{setErrorMessage:c}=re();return {handleZuoraSubmit:yi.useCallback(f=>chunkIVDIW747_cjs_js.d(null,null,function*(){l(true);let y=true,p,g=i;if(!g)y=false,p="Unexpected error, please contact support.";else {let h=chunkIVDIW747_cjs_js.b(chunkIVDIW747_cjs_js.a({},g),{paymentMethodId:f}),P=b=>chunkIVDIW747_cjs_js.d(null,null,function*(){try{return {success:!0,results:yield n.applySubscription(b)}}catch(x){return console.error(x),{success:false,errorMessage:(x==null?void 0:x.message)||"Failed to apply subscription"}}});try{if(e){let b=yield e({customerId:a.customer.id,checkoutParams:h,checkoutAction:P});b.errorMessage&&(p=b.errorMessage),y=y&&b.success&&!p;}else {let b=yield P(h);!b.success&&b.errorMessage&&(p=b.errorMessage),y=b.success&&!p;}}catch(b){y=false,p=b.message||"Failed to process checkout";}}return y?(s(true),o&&(o(),r||(yield Cx(Ar)))):c(p),l(false),yield t({success:y,error:p}),{success:y,errorMessage:p}}),[n,i,a,e,t,o,r,l,s,c])}}var Ie=({isLoading:e,width:t=50,height:o=16,children:r})=>e?jsxRuntime.jsx(chunkIVDIW747_cjs_js.o,{width:t,height:o}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:r});var bx=({subscriptionPreview:e,isFetchingSubscriptionPreview:t,checkoutLocalization:o})=>{var a,l,s,c;let{immediateInvoice:r}=e||{};if(!((l=(a=r==null?void 0:r.proration)==null?void 0:a.netAmount)!=null&&l.amount)||((c=(s=r==null?void 0:r.proration)==null?void 0:s.netAmount)==null?void 0:c.amount)>=0)return null;let n=r.proration.netAmount.amount*-1,i=H({amount:n,currency:r.proration.netAmount.currency,minimumFractionDigits:2});return jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{variant:"body1",style:{marginTop:14},className:"stigg-checkout-summary-captions-remaining-credits",children:jsxRuntime.jsx(Ie,{isLoading:t,width:"100%",children:o.summary.creditsForUnusedTimeText({credits:i})})})},Sx=({subscriptionPreview:e,activeSubscription:t,isFetchingSubscriptionPreview:o,checkoutLocalization:r})=>{if(!(e!=null&&e.hasScheduledUpdates)||!(t!=null&&t.currentBillingPeriodEnd))return null;let{currentBillingPeriodEnd:n}=t,i=typeof r.summary.changesWillApplyAtEndOfBillingPeriod=="function"?r.summary.changesWillApplyAtEndOfBillingPeriod({billingPeriodEnd:n}):r.summary.changesWillApplyAtEndOfBillingPeriod;return jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{variant:"body1",style:{marginTop:14},className:"stigg-checkout-summary-captions-scheduled-updates",children:jsxRuntime.jsx(Ie,{isLoading:o,width:"100%",children:i})})},Tx=({subscriptionPreview:e,activeSubscription:t,plan:o,isFetchingSubscriptionPreview:r,billingPeriod:n,checkoutLocalization:i})=>{let{promotionCode:a}=Ft();if(!e)return null;let l=i.nextBillingCaption({plan:o,subscriptionPreview:e,billingPeriod:n,activeSubscription:t,promotionCode:a});return jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{variant:"body1",style:{marginTop:14},className:"stigg-checkout-summary-captions-next-billing",children:jsxRuntime.jsx(Ie,{isLoading:r,width:"100%",children:l})})};function vd(e){return jsxRuntime.jsxs(ke__default.default,{className:"stigg-checkout-summary-captions",children:[jsxRuntime.jsx(bx,chunkIVDIW747_cjs_js.a({},e)),jsxRuntime.jsx(Sx,chunkIVDIW747_cjs_js.a({},e)),e.plan&&jsxRuntime.jsx(Tx,chunkIVDIW747_cjs_js.a({},e))]})}function Ni({quantity:e,totalAmount:t,pricingModel:o,billingPeriod:r,currency:n,blockSize:i,priceAmount:a,availableBillingPeriods:l}){let s=l==null?void 0:l.has(jsClientSdk.BillingPeriod.Monthly),c=o===jsClientSdk.BillingModel.PerUnit,u=i||1,f=r===jsClientSdk.BillingPeriod.Annually&&s,y=e&&(c||e>1)?`${chunkIVDIW747_cjs_js.k(e)} ${u>1?"for":"x"} `:"",p=f?" x 12 months":"",g=(a||t/e)/(f?12:1),h=H({amount:g,currency:n,minimumFractionDigits:2}),P=H({amount:t,currency:n,minimumFractionDigits:2});return `${y}${h}${p} ${p||y?` = ${P}`:""}`}function Ld(e){let{totalAmount:t,quantity:o,tiersMode:r,tiers:n,currency:i}=e;if(Va(n)||r===jsClientSdk.TiersMode.Graduated&&!Oa(n,o)){let a=H({amount:t,currency:i,minimumFractionDigits:2});return `${chunkIVDIW747_cjs_js.k(o)} for ${a}`}return Ni(e)}function Ix(e,t){let{unitPrice:o,upTo:r}=e[t];if(!o)return "";if(t===0)return `First ${r}`;let i=(e[t-1].upTo||0)+1;return Fo__default.default(r)?`${chunkIVDIW747_cjs_js.k(i)} and above`:`Next ${chunkIVDIW747_cjs_js.k(i)} to ${chunkIVDIW747_cjs_js.k(r)}`}function Nd({price:e,unitQuantity:t}){let o=e.tiers||[],{checkoutState:r}=D(),n=r==null?void 0:r.plan,{breakdown:i}=xn(o,t);return i.length===1?null:jsxRuntime.jsx(jsxRuntime.Fragment,{children:i.map(({unitQuantity:a,amount:l},s)=>jsxRuntime.jsx($e,{children:jsxRuntime.jsxs(Fe,{style:{alignItems:"flex-start"},children:[jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{variant:"body1",color:"tertiary",style:{whiteSpace:"nowrap"},children:Ix(o,s)}),jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{variant:"body1",color:"tertiary",style:{whiteSpace:"nowrap"},children:Ni({quantity:a,totalAmount:l,currency:e.currency,pricingModel:e.pricingModel,billingPeriod:e.billingPeriod,tiers:e.tiers,tiersMode:e.tiersMode,blockSize:e.blockSize,priceAmount:e.amount,availableBillingPeriods:new Set(n==null?void 0:n.pricePoints.map(c=>c.billingPeriod))})})]})},s))})}var Md=chunkIVDIW747_cjs_js.e(reactFeather.ChevronRight)`
|
|
633
635
|
height: ${({$size:e=24})=>`${e}px`};
|
|
634
636
|
width: ${({$size:e=24})=>`${e}px`};
|
|
635
637
|
transition: all 0.2s ease-in;
|
|
636
638
|
${({$isOpen:e})=>e&&"transform: rotate(90deg)"}
|
|
637
|
-
`;var $e=
|
|
639
|
+
`;var $e=chunkIVDIW747_cjs_js.e.div`
|
|
638
640
|
& + & {
|
|
639
641
|
margin-top: 16px;
|
|
640
642
|
}
|
|
641
|
-
`,Gx=
|
|
643
|
+
`,Gx=chunkIVDIW747_cjs_js.e.div`
|
|
642
644
|
margin-top: 16px;
|
|
643
645
|
margin-left: 16px;
|
|
644
|
-
`,Fe=
|
|
646
|
+
`,Fe=chunkIVDIW747_cjs_js.e.div`
|
|
645
647
|
display: flex;
|
|
646
648
|
flex-direction: column;
|
|
647
649
|
gap: 16px;
|
|
@@ -651,28 +653,28 @@
|
|
|
651
653
|
align-items: center;
|
|
652
654
|
justify-content: space-between;
|
|
653
655
|
}
|
|
654
|
-
`,zx=({checkoutLocalization:e})=>{let t=jsxRuntime.jsx(
|
|
656
|
+
`,zx=({checkoutLocalization:e})=>{let t=jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{variant:"body1",children:e.summary.payAsYouGoTooltipText});return jsxRuntime.jsx(We,{placement:"left",title:t,children:jsxRuntime.jsx(chunkIVDIW747_cjs_js.i,{icon:"PayAsYouGoCharge",style:{display:"flex"}})})},Er=({checkoutLocalization:e,label:t,quantity:o,price:r})=>{let{checkoutState:n}=D(),i=n==null?void 0:n.plan,a=me("lg"),[l,s]=yi.useState(false),c=()=>s(h=>!h),u=r.pricingModel===jsClientSdk.BillingModel.UsageBased,f=r.isTieredPrice?xt(r,o):(r.amount||0)*Math.ceil(o/(r.blockSize||1)),y;r.tiersMode===jsClientSdk.TiersMode.Graduated&&!!r.tiers&&!Qg__default.default(r.tiers)&&!Fo__default.default(r.tiers[0].upTo)&&o>r.tiers[0].upTo&&(y=jsxRuntime.jsx(Nd,{price:r,unitQuantity:o}));let g=jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{variant:"body1",color:"secondary",children:t});return y&&(g=jsxRuntime.jsx(zf__default.default,{onClick:c,underline:"none",style:{cursor:"pointer"},children:g})),jsxRuntime.jsxs($e,{className:"stigg-checkout-summary-base-charges-container",children:[jsxRuntime.jsxs(Fe,{style:{alignItems:"flex-start"},children:[jsxRuntime.jsxs(Re__default.default,{item:true,display:"flex",gap:.5,style:{whiteSpace:a?"nowrap":"break-spaces"},children:[g,y&&jsxRuntime.jsx(Dx__default.default,{onClick:c,sx:{padding:0},children:jsxRuntime.jsx(Md,{$isOpen:l,$size:16})})]}),jsxRuntime.jsxs(Re__default.default,{item:true,display:"flex",gap:1,alignItems:"center",children:[u&&jsxRuntime.jsx(zx,{checkoutLocalization:e}),jsxRuntime.jsxs(chunkIVDIW747_cjs_js.f,{variant:"body1",color:"secondary",style:{whiteSpace:a?"nowrap":"break-spaces"},children:[Ld({totalAmount:f,quantity:o,currency:r.currency,pricingModel:r.pricingModel,billingPeriod:r.billingPeriod,tiers:r.tiers,tiersMode:r.tiersMode,blockSize:r.blockSize,priceAmount:r.amount,availableBillingPeriods:new Set(i==null?void 0:i.pricePoints.map(h=>h.billingPeriod))}),u&&" / unit"]})]})]}),y&&jsxRuntime.jsx(HP__default.default,{in:l,children:jsxRuntime.jsx(Gx,{children:y})})]})},Rd=({label:e})=>jsxRuntime.jsx($e,{children:jsxRuntime.jsxs(Fe,{style:{alignItems:"flex-end"},children:[jsxRuntime.jsx(Re__default.default,{item:true,children:jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{variant:"body1",color:"secondary",children:e})}),jsxRuntime.jsx(Re__default.default,{item:true,display:"flex",gap:1,alignItems:"center",children:jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{variant:"body1",color:"secondary",style:{wordBreak:"break-word"},children:"Free"})})]})}),Ud=({subscriptionPreview:e,isFetchingSubscriptionPreview:t,checkoutLocalization:o})=>{let{immediateInvoice:r,recurringInvoice:n}=e,{discount:i,discountDetails:a}=n||{};return !i||!a?null:jsxRuntime.jsx($e,{children:jsxRuntime.jsxs(Fe,{children:[jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{variant:"body1",color:"secondary",children:o.summary.discountText({discountDetails:a,currency:r.total.currency})}),jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{variant:"body1",color:"secondary",children:t?jsxRuntime.jsx(chunkIVDIW747_cjs_js.o,{width:50,height:16}):H({amount:i.amount,currency:i.currency,minimumFractionDigits:2})})]})})},_d=({subscriptionPreview:e,isFetchingSubscriptionPreview:t,checkoutLocalization:o})=>{let{immediateInvoice:r}=e||{},{credits:n}=r||{};return !n||!n.used||n.used.amount<=0?null:jsxRuntime.jsx($e,{children:jsxRuntime.jsxs(Fe,{children:[jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{variant:"body1",color:"secondary",children:o.summary.appliedCreditsTitle}),jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{variant:"body1",color:"secondary",children:jsxRuntime.jsx(Ie,{isLoading:t,children:H({amount:-1*n.used.amount,currency:n.used.currency,minimumFractionDigits:2})})})]})})},Dd=({tax:e,taxDetails:t,isFetchingSubscriptionPreview:o,checkoutLocalization:r})=>!t||!e||(e==null?void 0:e.amount)<=0?null:jsxRuntime.jsx($e,{children:jsxRuntime.jsxs(Fe,{children:[jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{variant:"body1",color:"secondary",children:r.summary.taxTitle({taxDetails:t})}),jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{variant:"body1",color:"secondary",children:jsxRuntime.jsx(Ie,{isLoading:o,children:H({amount:e==null?void 0:e.amount,currency:e==null?void 0:e.currency,minimumFractionDigits:2})})})]})});var Ui=chunkIVDIW747_cjs_js.e(ke__default.default)`
|
|
655
657
|
width: 100%;
|
|
656
658
|
max-width: 470px;
|
|
657
659
|
flex: 1.5;
|
|
658
|
-
`,Lr=
|
|
660
|
+
`,Lr=chunkIVDIW747_cjs_js.e(Yx__default.default)`
|
|
659
661
|
background: ${({theme:e})=>e.stigg.palette.backgroundHighlight};
|
|
660
662
|
padding: 16px;
|
|
661
663
|
|
|
662
664
|
${oe.md} {
|
|
663
665
|
border-radius: 10px;
|
|
664
666
|
}
|
|
665
|
-
`;Lr.defaultProps={elevation:0};var Kx=
|
|
667
|
+
`;Lr.defaultProps={elevation:0};var Kx=chunkIVDIW747_cjs_js.e(chunkIVDIW747_cjs_js.f)`
|
|
666
668
|
margin-bottom: 16px;
|
|
667
669
|
font-weight: 500;
|
|
668
|
-
`,Nt=
|
|
670
|
+
`,Nt=chunkIVDIW747_cjs_js.e(El__default.default)`
|
|
669
671
|
margin: 16px 0;
|
|
670
|
-
`,Gd=
|
|
672
|
+
`,Gd=chunkIVDIW747_cjs_js.e(chunkIVDIW747_cjs_js.f)`
|
|
671
673
|
margin-bottom: 8px;
|
|
672
|
-
`;function qx({isLastStep:e,checkoutHasChanges:t,isFreeDowngrade:o,checkoutLocalization:r,isPlanUpdate:n}){return e?t?n?r.checkoutButton.updateText:o?r.checkoutButton.downgradeToFreeText:r.checkoutButton.upgradeText:r.checkoutButton.noChangesText:r.checkoutButton.nextText}var zd=({onCheckout:e,onCheckoutCompleted:t,disablePromotionCode:o,disableSuccessAnimation:r,isFreeDowngrade:n,onMockCheckoutPreview:i,showWatermark:a})=>{var ua,ga,fa,ya;let[l,s]=yi.useState(false),{setErrorMessage:c,useNewPaymentMethod:u}=re(),f=_e(),y=It(),{checkoutState:p,checkoutLocalization:g,checkoutSuccess:h,widgetState:P}=D(),{plan:b,activeSubscription:x}=p||{},A=xr(((ua=b==null?void 0:b.pricePoints)==null?void 0:ua.filter(G=>G.billingPeriod===y.billingPeriod))||[]),[S,F]=Ox__default.default(A,G=>G.pricingModel===jsClientSdk.BillingModel.FlatFee),T=S[0],k=n||f.isCheckoutComplete&&f.isLastStep,{isZuoraIntegration:w}=Lt(),I=l||h,{subscriptionPreview:v,isFetchingSubscriptionPreview:L,errorMessage:N}=Bc({onMockCheckoutPreview:i}),{handleSubmit:$,isLoading:R}=Td({isMocked:!!i,disableSuccessAnimation:r,onCheckout:e,onCheckoutCompleted:t,onSuccess:()=>{s(true),f.markStepAsCompleted(f.progressBarState.activeStep);}}),{handleZuoraSubmit:z}=Ir({onCheckout:e,onCheckoutCompleted:t,disableSuccessAnimation:r,onSuccess:()=>{f.markStepAsCompleted(f.progressBarState.activeStep);}}),K=G=>
|
|
674
|
+
`;function qx({isLastStep:e,checkoutHasChanges:t,isFreeDowngrade:o,checkoutLocalization:r,isPlanUpdate:n}){return e?t?n?r.checkoutButton.updateText:o?r.checkoutButton.downgradeToFreeText:r.checkoutButton.upgradeText:r.checkoutButton.noChangesText:r.checkoutButton.nextText}var zd=({onCheckout:e,onCheckoutCompleted:t,disablePromotionCode:o,disableSuccessAnimation:r,isFreeDowngrade:n,onMockCheckoutPreview:i,showWatermark:a})=>{var ua,ga,fa,ya;let[l,s]=yi.useState(false),{setErrorMessage:c,useNewPaymentMethod:u}=re(),f=_e(),y=It(),{checkoutState:p,checkoutLocalization:g,checkoutSuccess:h,widgetState:P}=D(),{plan:b,activeSubscription:x}=p||{},A=xr(((ua=b==null?void 0:b.pricePoints)==null?void 0:ua.filter(G=>G.billingPeriod===y.billingPeriod))||[]),[S,F]=Ox__default.default(A,G=>G.pricingModel===jsClientSdk.BillingModel.FlatFee),T=S[0],k=n||f.isCheckoutComplete&&f.isLastStep,{isZuoraIntegration:w}=Lt(),I=l||h,{subscriptionPreview:v,isFetchingSubscriptionPreview:L,errorMessage:N}=Bc({onMockCheckoutPreview:i}),{handleSubmit:$,isLoading:R}=Td({isMocked:!!i,disableSuccessAnimation:r,onCheckout:e,onCheckoutCompleted:t,onSuccess:()=>{s(true),f.markStepAsCompleted(f.progressBarState.activeStep);}}),{handleZuoraSubmit:z}=Ir({onCheckout:e,onCheckoutCompleted:t,disableSuccessAnimation:r,onSuccess:()=>{f.markStepAsCompleted(f.progressBarState.activeStep);}}),K=G=>chunkIVDIW747_cjs_js.d(null,null,function*(){if(I)return;let we;w&&!u?we=yield z():we=yield $(G);let{errorMessage:ye}=we||{};ye?(c(ye),s(false)):c(void 0);}),Ve=w&&!u?P.readOnly:R,ut=G=>chunkIVDIW747_cjs_js.d(null,null,function*(){Ve||(k?yield K(G):f.goNext());}),{immediateInvoice:V,recurringInvoice:ie}=v||{},ae=!!v&&(!!(V!=null&&V.proration)||!!v.hasScheduledUpdates),ve=!o&&!n&&!w,ho=!!(ie!=null&&ie.discountDetails)&&!n,gt=ve||ho,ca=F.some(G=>G.pricingModel===jsClientSdk.BillingModel.UsageBased),nn=ca&&!T&&F.every(G=>G.pricingModel===jsClientSdk.BillingModel.UsageBased),da=typeof g.summary.baseChargeText=="function"?g.summary.baseChargeText({billingPeriod:y.billingPeriod}):g.summary.baseChargeText,pa=yi.useMemo(()=>{var G,we;return (we=(G=y.addons)==null?void 0:G.filter(ye=>!lt(ye.addon)))!=null?we:[]},[y.addons]),ma=yi.useMemo(()=>pa.filter(G=>{var ye;return !!((ye=G.addon.pricePoints)==null?void 0:ye.find(ft=>ft.billingPeriod===y.billingPeriod))}).map(G=>{let we=G.addon.pricePoints.find(ft=>ft.billingPeriod===y.billingPeriod),ye=G.quantity&&G.quantity>0?G.quantity:1;return jsxRuntime.jsx(Er,{checkoutLocalization:g,label:G.addon.displayName,quantity:ye,price:we},G.addon.id)}),[pa,y.billingPeriod,g]);return jsxRuntime.jsxs(Ui,{className:"stigg-checkout-summary-container",children:[jsxRuntime.jsxs(Lr,{children:[jsxRuntime.jsx(Kx,{variant:"h3",children:g.summary.title}),jsxRuntime.jsxs(Re__default.default,{className:"stigg-checkout-summary-plan-title-container",display:"flex",flexDirection:"row",alignItems:"center",marginY:2,children:[jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{variant:"h6",color:"primary",style:{paddingRight:"8px"},children:g.summary.planName({plan:b})}),jsxRuntime.jsx(Nt,{className:"stigg-checkout-summary-divider",sx:{flex:1,margin:"0 !important"}})]}),T&&jsxRuntime.jsx(Er,{checkoutLocalization:g,label:da,quantity:1,price:T}),!T&&n?jsxRuntime.jsx(Rd,{label:da}):null,jsxRuntime.jsx(Re__default.default,{item:true,className:"stigg-checkout-summary-usage-charges-container",children:F.map((G,we)=>{var ft,ha,Ca,Pa,xa;let ye=(ft=y.billableFeatures)==null?void 0:ft.find(Cm=>{var ba;return Cm.featureId===((ba=G.feature)==null?void 0:ba.featureId)});return jsxRuntime.jsx(Er,{checkoutLocalization:g,label:Bt(((Ca=G.feature)==null?void 0:Ca.displayName)||"",(Pa=G.feature)==null?void 0:Pa.units,(xa=G.feature)==null?void 0:xa.unitsPlural),quantity:(ye==null?void 0:ye.quantity)||1,price:G},((ha=G.feature)==null?void 0:ha.featureId)||`usage-charge-${we}`)})}),ma.length>0&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(Re__default.default,{display:"flex",flexDirection:"row",alignItems:"center",marginY:2,children:[jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{variant:"h6",color:"primary",style:{paddingRight:"8px"},children:g.summary.addonsSectionTitle}),jsxRuntime.jsx(Nt,{className:"stigg-checkout-summary-divider",sx:{flex:1,margin:"0 !important"}})]}),ma]}),!gt&&jsxRuntime.jsx(Nt,{className:"stigg-checkout-summary-divider"}),gt&&jsxRuntime.jsxs(Re__default.default,{display:"flex",flexDirection:"row",alignItems:"center",marginY:2,children:[jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{variant:"h6",color:"primary",style:{paddingRight:"8px"},children:g.summary.discountsSectionTitle}),jsxRuntime.jsx(Nt,{className:"stigg-checkout-summary-divider",sx:{flex:1,margin:"0 !important"}})]}),ve&&jsxRuntime.jsx(qc,{disabled:Ve||L,checkoutLocalization:g,onMockCheckoutPreview:i}),ho&&v&&jsxRuntime.jsx(Ud,{subscriptionPreview:v,isFetchingSubscriptionPreview:L,checkoutLocalization:g}),gt&&jsxRuntime.jsx(Nt,{className:"stigg-checkout-summary-divider"}),jsxRuntime.jsx(Dd,{tax:ie==null?void 0:ie.tax,taxDetails:ie==null?void 0:ie.taxDetails,isFetchingSubscriptionPreview:L,checkoutLocalization:g}),n?null:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Fe,{style:{marginTop:16},children:jsxRuntime.jsxs(Re__default.default,{display:"flex",flexDirection:"column",container:true,children:[jsxRuntime.jsxs(Re__default.default,{item:true,display:"flex",justifyContent:"space-between",children:[jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{variant:"h6",children:g.summary.totalText}),jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{variant:"h6",children:jsxRuntime.jsxs(Ie,{isLoading:L,children:[nn?g.summary.onlyPayAsYouGoText:null,!nn&&ca?g.summary.startsAtText:null,nn?null:H(chunkIVDIW747_cjs_js.b(chunkIVDIW747_cjs_js.a({amount:0},ie==null?void 0:ie.total),{minimumFractionDigits:2}))]})})]}),jsxRuntime.jsx(Re__default.default,{item:true,children:jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{variant:"body1",color:"secondary",children:g.summary.totalBillingPeriodText({billingPeriod:y.billingPeriod})})})]})}),jsxRuntime.jsx(Nt,{className:"stigg-checkout-summary-divider"})]}),(ga=V==null?void 0:V.proration)!=null&&ga.hasProrations&&(V!=null&&V.subTotal)&&(V==null?void 0:V.subTotal.amount)>0?jsxRuntime.jsx($e,{children:jsxRuntime.jsxs(Fe,{children:[jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{variant:"body1",color:"secondary",children:g.summary.proratedTotalDueText}),jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{variant:"body1",color:"secondary",children:jsxRuntime.jsx(Ie,{isLoading:L,children:H({amount:Number(((fa=V==null?void 0:V.subTotal)==null?void 0:fa.amount)||0)+Number(((ya=V==null?void 0:V.tax)==null?void 0:ya.amount)||0),currency:V==null?void 0:V.subTotal.currency,minimumFractionDigits:2})})})]})}):null,jsxRuntime.jsx(_d,{subscriptionPreview:v,isFetchingSubscriptionPreview:L,checkoutLocalization:g}),jsxRuntime.jsx($e,{children:jsxRuntime.jsxs(Fe,{children:[jsxRuntime.jsx(Gd,{variant:"h6",children:g.summary.totalDueText}),jsxRuntime.jsx(Gd,{variant:"h6",children:jsxRuntime.jsx(Ie,{isLoading:L,children:H(chunkIVDIW747_cjs_js.b(chunkIVDIW747_cjs_js.a({amount:0},V==null?void 0:V.total),{minimumFractionDigits:2}))})})]})}),jsxRuntime.jsx(vd,{plan:b,activeSubscription:x,subscriptionPreview:v,isFetchingSubscriptionPreview:L,checkoutLocalization:g,billingPeriod:y.billingPeriod}),(!k||!w||w&&!u)&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(te,{$success:I,$error:k&&n,disabled:Ve||L||f.progressBarState.isDisabled||k&&!ae||!!N,className:"stigg-checkout-summary-cta-button",sx:{textTransform:"none",borderRadius:"10px",marginTop:"24px",height:"36px"},variant:"contained",size:"medium",onClick:G=>{ut(G);},fullWidth:true,children:jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{className:"stigg-checkout-summary-cta-button-text",variant:"h3",color:"white",style:{display:"flex"},children:I?jsxRuntime.jsx(chunkIVDIW747_cjs_js.i,{icon:"Check",style:{display:"contents"}}):Ve||L?jsxRuntime.jsx(Yh__default.default,{size:20,sx:{color:"white"}}):qx({isLastStep:k,checkoutHasChanges:ae,isFreeDowngrade:n,checkoutLocalization:g,isPlanUpdate:!!x&&(x==null?void 0:x.plan.id)===(b==null?void 0:b.id)})})}),N&&jsxRuntime.jsx(Qx__default.default,{severity:"error",sx:{alignItems:"center",marginTop:"12px"},children:jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{overrideColor:"inherit",children:N})})]})]}),jsxRuntime.jsx(chunkIVDIW747_cjs_js.q,{source:"checkout",showWatermark:a,style:{marginTop:8,display:"flex",justifyContent:"center"}}),!r&&I&&jsxRuntime.jsx(Sd,{checkoutLocalization:g})]})};var Vd=({showWatermark:e})=>jsxRuntime.jsxs(Ui,{children:[jsxRuntime.jsxs(Lr,{children:[jsxRuntime.jsxs(chunkIVDIW747_cjs_js.l,{$flexDirection:"column",$gap:24,children:[jsxRuntime.jsx(chunkIVDIW747_cjs_js.o,{width:120,height:20}),jsxRuntime.jsx(chunkIVDIW747_cjs_js.o,{width:120,height:20}),jsxRuntime.jsx(chunkIVDIW747_cjs_js.o,{width:120,height:20}),jsxRuntime.jsx(chunkIVDIW747_cjs_js.o,{width:120,height:20})]}),jsxRuntime.jsxs(chunkIVDIW747_cjs_js.l,{$flexDirection:"column",$gap:24,marginTop:5,children:[jsxRuntime.jsx(chunkIVDIW747_cjs_js.o,{height:20}),jsxRuntime.jsx(chunkIVDIW747_cjs_js.o,{height:20}),jsxRuntime.jsx(chunkIVDIW747_cjs_js.o,{height:20})]}),jsxRuntime.jsx(chunkIVDIW747_cjs_js.n,{flex:1,marginTop:5,children:jsxRuntime.jsx(chunkIVDIW747_cjs_js.o,{height:34})})]}),jsxRuntime.jsx(chunkIVDIW747_cjs_js.q,{source:"checkout",showWatermark:e,style:{marginTop:8,display:"flex",justifyContent:"center"}})]});var Hd=chunkIVDIW747_cjs_js.e(Re__default.default)`
|
|
673
675
|
width: 100%;
|
|
674
676
|
gap: 8px;
|
|
675
|
-
`,Wd=
|
|
677
|
+
`,Wd=chunkIVDIW747_cjs_js.e(Re__default.default)`
|
|
676
678
|
display: flex;
|
|
677
679
|
flex-direction: column;
|
|
678
680
|
gap: 16px;
|
|
@@ -687,7 +689,7 @@
|
|
|
687
689
|
padding-top: 16px;
|
|
688
690
|
padding-bottom: 16px;
|
|
689
691
|
}
|
|
690
|
-
`,Zd=
|
|
692
|
+
`,Zd=chunkIVDIW747_cjs_js.e(te)`
|
|
691
693
|
min-width: unset;
|
|
692
694
|
width: 41px;
|
|
693
695
|
height: 41px;
|
|
@@ -698,40 +700,40 @@
|
|
|
698
700
|
align-items: center;
|
|
699
701
|
width: 100%;
|
|
700
702
|
justify-content: flex-end;
|
|
701
|
-
`;function Kd({addon:e,addonState:t,hasChanges:o,errorMessage:r,isPriceForBillingPeriodAvailable:n,checkoutLocalization:i,handleQuantityChange:a,handleUndo:l,handleRemoveAddon:s}){var y;let c=me("lg"),u=!!t,f=e.maxQuantity!==1;return jsxRuntime.jsxs(Xx,{item:true,sx:{gap:"16px"},container:!c,children:[o&&jsxRuntime.jsx(te,{variant:"text",size:"small",sx:{padding:"8px",minWidth:"unset"},onClick:l,children:jsxRuntime.jsx(
|
|
703
|
+
`;function Kd({addon:e,addonState:t,hasChanges:o,errorMessage:r,isPriceForBillingPeriodAvailable:n,checkoutLocalization:i,handleQuantityChange:a,handleUndo:l,handleRemoveAddon:s}){var y;let c=me("lg"),u=!!t,f=e.maxQuantity!==1;return jsxRuntime.jsxs(Xx,{item:true,sx:{gap:"16px"},container:!c,children:[o&&jsxRuntime.jsx(te,{variant:"text",size:"small",sx:{padding:"8px",minWidth:"unset"},onClick:l,children:jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{color:"primary.main",variant:"body1",children:"Undo"})}),u&&jsxRuntime.jsxs(Re__default.default,{sx:{display:"flex",width:"100%",justifyContent:"flex-end"},children:[f&&jsxRuntime.jsx(pe,{id:`${e.id}-input`,type:"number",onWheel:bt,sx:c?{marginX:2,width:"100%"}:{flex:1},value:(y=t==null?void 0:t.quantity)!=null?y:"",error:!!r,helperText:r,FormHelperTextProps:{sx:{margin:"4px"}},onChange:p=>{var g,h;return a((g=p==null?void 0:p.target)!=null&&g.value?Number((h=p==null?void 0:p.target)==null?void 0:h.value):null)},onFocus:p=>p.target.select()}),jsxRuntime.jsx(Zd,{color:"error",onClick:s,children:jsxRuntime.jsx(chunkIVDIW747_cjs_js.i,{icon:"Trash",style:{display:"flex",padding:"8px"}})})]}),!u&&jsxRuntime.jsx(te,{sx:{paddingX:"22px",paddingY:"8px"},onClick:()=>a(1),disabled:!n,children:jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{color:n?"primary.main":"disabled",variant:"body1",children:i.addAddonText})})]})}var tb=chunkIVDIW747_cjs_js.e(Re__default.default)`
|
|
702
704
|
display: flex;
|
|
703
705
|
flex-direction: column;
|
|
704
706
|
justify-content: center;
|
|
705
707
|
width: 100%;
|
|
706
708
|
height: 42px;
|
|
707
|
-
`;function qd({addon:e,billingPeriod:t,checkoutLocalization:o}){let r=e.pricePoints.find(n=>n.billingPeriod===t);return jsxRuntime.jsxs(tb,{item:true,children:[jsxRuntime.jsx(
|
|
709
|
+
`;function qd({addon:e,billingPeriod:t,checkoutLocalization:o}){let r=e.pricePoints.find(n=>n.billingPeriod===t);return jsxRuntime.jsxs(tb,{item:true,children:[jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{variant:"h6",lineHeight:"24px",children:e.displayName}),r?jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{variant:"body1",lineHeight:"20px",color:"secondary",children:`${H({amount:r.amount,currency:r.currency,minimumFractionDigits:2})}/${t===jsClientSdk.BillingPeriod.Annually?"year":"month"}`}):jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{variant:"body1",lineHeight:"20px",color:"secondary",children:o.addonBillingPeriodNotAvailableText({planBillingPeriod:t})})]})}function nb({addon:e,billingPeriod:t,addonState:o,initialAddonState:r,setAddon:n,removeAddon:i,checkoutLocalization:a,onAddonsValidationChange:l,onAddonChange:s}){let[c,u]=yi.useState(void 0),f=!!o&&!!r&&o.quantity!==r.quantity||!!r&&!o,y=e.pricePoints.some(P=>P.billingPeriod===t),p=P=>chunkIVDIW747_cjs_js.d(null,null,function*(){if(!P||P<=0){l({addonId:e.id,isValid:false}),u("Minimum 1"),n(e,P!=null?P:null);return}let b=yield s==null?void 0:s({addon:e,quantity:P});u(b==null?void 0:b.errorMessage),l({addonId:e.id,isValid:!(b!=null&&b.disableNextStep)}),n(e,P);}),g=()=>chunkIVDIW747_cjs_js.d(null,null,function*(){yield s==null?void 0:s({addon:e,quantity:0}),i(e.id),l({addonId:e.id,isValid:true});});return jsxRuntime.jsxs(Wd,{children:[jsxRuntime.jsx(qd,{addon:e,billingPeriod:t,checkoutLocalization:a}),jsxRuntime.jsx(Kd,{addon:e,addonState:o,hasChanges:f,handleUndo:()=>chunkIVDIW747_cjs_js.d(null,null,function*(){if(r){let P=yield s==null?void 0:s({addon:e,quantity:r.quantity});l({addonId:e.id,isValid:!(P!=null&&P.disableNextStep)}),n(e,r.quantity);}else yield g();l({addonId:e.id,isValid:true});}),errorMessage:c,handleQuantityChange:p,isPriceForBillingPeriodAvailable:y,checkoutLocalization:a,handleRemoveAddon:g})]})}function Xd({onAddonChange:e}){let{checkoutLocalization:t,setIsValid:o}=D(),{billingPeriod:r}=be(),{setIsDisabled:n}=_e(),{initialAddons:i,addons:a,availableAddons:l,setAddon:s,removeAddon:c}=mc(),[u,f]=yi.useState((l==null?void 0:l.reduce((y,p)=>(y[p.id]=true,y),{}))||{});return yi.useEffect(()=>{let y=Object.values(u).some(p=>!p);n(y),o(!y);},[u,n,o]),jsxRuntime.jsx(Hd,{container:true,children:l==null?void 0:l.map(y=>{let p=a.find(h=>h.addon.id===y.id),g=i==null?void 0:i.find(h=>h.addon.id===y.id);return jsxRuntime.jsx(nb,{addon:y,billingPeriod:r,addonState:p,initialAddonState:g,setAddon:s,removeAddon:c,checkoutLocalization:t,onAddonsValidationChange:({addonId:h,isValid:P})=>f(chunkIVDIW747_cjs_js.b(chunkIVDIW747_cjs_js.a({},u),{[h]:P})),onAddonChange:e},y.id)})})}var $i=chunkIVDIW747_cjs_js.e(Re__default.default,{shouldForwardProp:e=>!e.startsWith("$")})`
|
|
708
710
|
padding: 8px;
|
|
709
711
|
border-radius: 10px;
|
|
710
712
|
border: 1px solid ${({theme:e})=>e.stigg.palette.outlinedBorder};
|
|
711
713
|
cursor: ${({$disabled:e})=>e?"not-allowed":"pointer"};
|
|
712
714
|
opacity: ${({$disabled:e})=>e?.6:1};
|
|
713
|
-
`,jd=
|
|
715
|
+
`,jd=chunkIVDIW747_cjs_js.e($i)`
|
|
714
716
|
flex-direction: column;
|
|
715
717
|
align-items: unset;
|
|
716
718
|
${({$hideBorders:e})=>e&&react.css`
|
|
717
719
|
border: none;
|
|
718
720
|
padding: 0;
|
|
719
721
|
`}
|
|
720
|
-
`,ep=
|
|
722
|
+
`,ep=chunkIVDIW747_cjs_js.e(Re__default.default)`
|
|
721
723
|
display: flex;
|
|
722
724
|
align-items: center;
|
|
723
725
|
flex: 1;
|
|
724
726
|
gap: 12px;
|
|
725
|
-
`,tp=
|
|
727
|
+
`,tp=chunkIVDIW747_cjs_js.e(Re__default.default)`
|
|
726
728
|
display: flex;
|
|
727
729
|
flex-direction: column;
|
|
728
|
-
`;var ub=
|
|
730
|
+
`;var ub=chunkIVDIW747_cjs_js.e(ke__default.default)`
|
|
729
731
|
position: relative;
|
|
730
732
|
max-width: 500px;
|
|
731
|
-
`,gb=
|
|
733
|
+
`,gb=chunkIVDIW747_cjs_js.e(ke__default.default)`
|
|
732
734
|
opacity: ${({$showLoading:e})=>e?.6:1};
|
|
733
735
|
pointer-events: ${({$showLoading:e})=>e?"none":"auto"};
|
|
734
|
-
`,fb=
|
|
736
|
+
`,fb=chunkIVDIW747_cjs_js.e(ke__default.default)`
|
|
735
737
|
position: absolute;
|
|
736
738
|
top: 40px;
|
|
737
739
|
left: 0;
|
|
@@ -743,18 +745,18 @@
|
|
|
743
745
|
justify-content: center;
|
|
744
746
|
border-radius: 4px;
|
|
745
747
|
z-index: 10;
|
|
746
|
-
`,yb=
|
|
748
|
+
`,yb=chunkIVDIW747_cjs_js.e(ke__default.default)`
|
|
747
749
|
display: flex;
|
|
748
750
|
flex-direction: column;
|
|
749
751
|
align-items: center;
|
|
750
752
|
gap: 12px;
|
|
751
|
-
`;function op({onCheckout:e,onCheckoutCompleted:t}){var P,b,x;let{isZuoraIntegration:o,isInitialized:r,createPaymentSession:n}=Lt(),{setErrorMessage:i}=re(),{billingCountryCode:a}=be(),{checkoutState:l,widgetState:s}=D(),{handleZuoraSubmit:c}=Ir({onCheckout:e,onCheckoutCompleted:t}),u=yi.useRef(false),[f,y]=yi__default.default.useState(false),p=((x=(b=(P=l==null?void 0:l.plan)==null?void 0:P.pricePoints)==null?void 0:b[0])==null?void 0:x.currency)||jsClientSdk.Currency.Usd,{publishableKey:g}=l==null?void 0:l.billingIntegration.billingCredentials,h=yi.useCallback(A=>
|
|
753
|
+
`;function op({onCheckout:e,onCheckoutCompleted:t}){var P,b,x;let{isZuoraIntegration:o,isInitialized:r,createPaymentSession:n}=Lt(),{setErrorMessage:i}=re(),{billingCountryCode:a}=be(),{checkoutState:l,widgetState:s}=D(),{handleZuoraSubmit:c}=Ir({onCheckout:e,onCheckoutCompleted:t}),u=yi.useRef(false),[f,y]=yi__default.default.useState(false),p=((x=(b=(P=l==null?void 0:l.plan)==null?void 0:P.pricePoints)==null?void 0:b[0])==null?void 0:x.currency)||jsClientSdk.Currency.Usd,{publishableKey:g}=l==null?void 0:l.billingIntegration.billingCredentials,h=yi.useCallback(A=>chunkIVDIW747_cjs_js.d(null,null,function*(){var S;if(!A.success||!A.paymentMethodId){let F=((S=A.error)==null?void 0:S.message)||"Payment failed";i(F),yield t({success:false,error:F});return}yield c(A.paymentMethodId);}),[c,i,t]);return yi.useEffect(()=>(chunkIVDIW747_cjs_js.d(null,null,function*(){if(!(!r||u.current)){y(true),i(void 0);try{u.current=!0;let S=window.Zuora(g),F=Bd(n,h,p,a);(yield S.createPaymentForm(F)).mount("#zuora_payment");}catch(S){u.current=false,i("Failed to render Zuora payment form");}finally{y(false);}}}),()=>{u.current=false;}),[r]),o?jsxRuntime.jsxs(ub,{children:[jsxRuntime.jsx(gb,{id:"zuora_payment",$showLoading:s.readOnly||f}),(s.readOnly||f)&&jsxRuntime.jsx(fb,{children:jsxRuntime.jsx(yb,{children:jsxRuntime.jsx(Yh__default.default,{size:28})})})]}):null}function np({checked:e,text:t,subtitle:o,readOnly:r}){return jsxRuntime.jsxs(ep,{children:[jsxRuntime.jsx(Pb__default.default,{checked:e,disabled:r}),jsxRuntime.jsxs(tp,{container:true,children:[jsxRuntime.jsx(Re__default.default,{item:true,children:t}),o&&jsxRuntime.jsx(Re__default.default,{item:true,children:o})]})]})}function ip({checked:e,paymentMethodDetails:t,readOnly:o,onSelect:r}){if(!t)return null;let{last4Digits:n,expirationMonth:i,expirationYear:a}=t;return jsxRuntime.jsx($i,{item:true,onClick:r,$disabled:o,children:jsxRuntime.jsx(np,{checked:e,readOnly:o,text:jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{variant:"h6",children:`Card ending in ${n}`}),subtitle:!!i&&!!a&&jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{variant:"body1",children:`Expires ${i.toString().padStart(2,"0")}/${a}`})})})}function ap({hasExistingPaymentMethod:e,checked:t,onSelect:o,readOnly:r,checkoutLocalization:n,onBillingAddressChange:i,collectPhoneNumber:a,collectTaxId:l,onCheckout:s,onCheckoutCompleted:c}){let{isZuoraIntegration:u}=Lt();return jsxRuntime.jsxs(jd,{item:true,$hideBorders:!e,onClick:o,$disabled:r,children:[e&&jsxRuntime.jsx(np,{checked:t,readOnly:r,text:jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{variant:"h6",children:n.newPaymentMethodText})}),jsxRuntime.jsx(HP__default.default,{in:t,children:u?jsxRuntime.jsx(op,{onCheckout:s,onCheckoutCompleted:c}):jsxRuntime.jsx(hd,{onBillingAddressChange:i,collectPhoneNumber:a,collectTaxId:l})})]})}var Sb=chunkIVDIW747_cjs_js.e(Re__default.default)`
|
|
752
754
|
display: flex;
|
|
753
755
|
flex-direction: column;
|
|
754
756
|
gap: 24px;
|
|
755
|
-
`;function sp({onBillingAddressChange:e,collectPhoneNumber:t,collectTaxId:o,onCheckout:r,onCheckoutCompleted:n}){let{checkoutState:i,checkoutLocalization:a,widgetState:l}=D(),{customer:s}=i||{},{errorMessage:c,useNewPaymentMethod:u,setUseNewPaymentMethod:f}=re(),{readOnly:y}=l,p=g=>{y||f(g);};return jsxRuntime.jsxs(Sb,{container:true,children:[!!c&&jsxRuntime.jsx(Qx__default.default,{severity:"error",sx:{alignItems:"center"},children:jsxRuntime.jsx(
|
|
757
|
+
`;function sp({onBillingAddressChange:e,collectPhoneNumber:t,collectTaxId:o,onCheckout:r,onCheckoutCompleted:n}){let{checkoutState:i,checkoutLocalization:a,widgetState:l}=D(),{customer:s}=i||{},{errorMessage:c,useNewPaymentMethod:u,setUseNewPaymentMethod:f}=re(),{readOnly:y}=l,p=g=>{y||f(g);};return jsxRuntime.jsxs(Sb,{container:true,children:[!!c&&jsxRuntime.jsx(Qx__default.default,{severity:"error",sx:{alignItems:"center"},children:jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{overrideColor:"inherit",children:c})}),jsxRuntime.jsx(ip,{readOnly:y,checked:!u,paymentMethodDetails:s==null?void 0:s.paymentMethodDetails,onSelect:()=>p(false)}),jsxRuntime.jsx(ap,{hasExistingPaymentMethod:!!(s!=null&&s.paymentMethodDetails),readOnly:y,checked:u,checkoutLocalization:a,onSelect:()=>p(true),onBillingAddressChange:e,collectPhoneNumber:t,collectTaxId:o,onCheckout:r,onCheckoutCompleted:n})]})}var Dr=({onClick:e,checkoutLocalization:t,size:o})=>jsxRuntime.jsx(fu__default.default,{className:"stigg-checkout-change-plan-button",sx:{textTransform:"none"},variant:"text",size:o,onClick:e,children:jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{className:"stigg-checkout-change-plan-button-text",color:"primary.main",variant:"h3",style:{lineHeight:"24px"},children:t.changePlan})});function dp({allowChangePlan:e=false,onChangePlan:t}){let{checkoutState:o,checkoutLocalization:r}=D(),{plan:n}=o||{};return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(ke__default.default,{sx:{marginBottom:"16px"},children:[jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{variant:"body1",color:"disabled",style:{opacity:.6,marginBottom:"8px"},children:"Selected plan"}),jsxRuntime.jsxs(ke__default.default,{sx:{display:"flex",justifyContent:"space-between"},children:[jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{variant:"h1",children:n==null?void 0:n.displayName}),e&&t&&jsxRuntime.jsx(Dr,{onClick:()=>{t({currentPlan:n});},checkoutLocalization:r,size:"medium"})]})]}),jsxRuntime.jsx(El__default.default,{className:"stigg-checkout-plan-header-divider"})]})}function Vi(e){switch(e){case jsClientSdk.BillingPeriod.Annually:return "Annual";case jsClientSdk.BillingPeriod.Monthly:return "Monthly";default:return ""}}var up=chunkIVDIW747_cjs_js.e(ke__default.default)`
|
|
756
758
|
margin: 16px 0;
|
|
757
|
-
`,gp=
|
|
759
|
+
`,gp=chunkIVDIW747_cjs_js.e.button`
|
|
758
760
|
cursor: ${({$disabled:e,$isOnlyBillingPeriod:t})=>e||t?"default":"pointer"};
|
|
759
761
|
flex: 1;
|
|
760
762
|
display: flex;
|
|
@@ -774,19 +776,19 @@
|
|
|
774
776
|
background: none;
|
|
775
777
|
}
|
|
776
778
|
}
|
|
777
|
-
`,fp=
|
|
779
|
+
`,fp=chunkIVDIW747_cjs_js.e(ke__default.default)`
|
|
778
780
|
display: flex;
|
|
779
781
|
gap: 16px;
|
|
780
782
|
margin-top: 16px;
|
|
781
|
-
`;
|
|
783
|
+
`;chunkIVDIW747_cjs_js.e.div`
|
|
782
784
|
display: flex;
|
|
783
785
|
align-items: baseline;
|
|
784
786
|
gap: 8px;
|
|
785
|
-
`;
|
|
787
|
+
`;chunkIVDIW747_cjs_js.e(Ab__default.default)`
|
|
786
788
|
& .MuiChip-label {
|
|
787
789
|
font-size: 12px;
|
|
788
790
|
}
|
|
789
|
-
`;var yp=({billingPeriod:e,isOnlyBillingPeriod:t})=>{let{billingPeriod:o,setBillingPeriod:r}=be(),n=o===e;return jsxRuntime.jsxs(gp,{onClick:()=>r(e),$isActive:n,$isOnlyBillingPeriod:t,children:[jsxRuntime.jsx(Pb__default.default,{checked:n,onChange:()=>r(e),value:e,disabled:t,inputProps:{"aria-label":Vi(e)},sx:{padding:0,marginRight:"8px"}}),jsxRuntime.jsx(ke__default.default,{children:jsxRuntime.jsx(
|
|
791
|
+
`;var yp=({billingPeriod:e,isOnlyBillingPeriod:t})=>{let{billingPeriod:o,setBillingPeriod:r}=be(),n=o===e;return jsxRuntime.jsxs(gp,{onClick:()=>r(e),$isActive:n,$isOnlyBillingPeriod:t,children:[jsxRuntime.jsx(Pb__default.default,{checked:n,onChange:()=>r(e),value:e,disabled:t,inputProps:{"aria-label":Vi(e)},sx:{padding:0,marginRight:"8px"}}),jsxRuntime.jsx(ke__default.default,{children:jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{variant:"h3",color:"primary",children:Vi(e)})})]})};function hp({plan:e,checkoutLocalization:t}){let[o,r]=Ox__default.default(e==null?void 0:e.pricePoints,i=>i.billingPeriod===jsClientSdk.BillingPeriod.Monthly),n=!!(o!=null&&o.length)&&!!(r!=null&&r.length);return n?jsxRuntime.jsxs(up,{children:[jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{variant:"h6",color:"primary",children:t.billingPeriodsTitle}),jsxRuntime.jsxs(fp,{children:[!!(o!=null&&o.length)&&jsxRuntime.jsx(yp,{billingPeriod:jsClientSdk.BillingPeriod.Monthly,isOnlyBillingPeriod:!n},jsClientSdk.BillingPeriod.Monthly),!!(r!=null&&r.length)&&jsxRuntime.jsx(yp,{billingPeriod:jsClientSdk.BillingPeriod.Annually,isOnlyBillingPeriod:!n},jsClientSdk.BillingPeriod.Annually)]})]}):null}var Rb=chunkIVDIW747_cjs_js.e.div`
|
|
790
792
|
display: flex;
|
|
791
793
|
min-height: 60px;
|
|
792
794
|
margin-top: 16px;
|
|
@@ -797,39 +799,39 @@
|
|
|
797
799
|
align-items: flex-start;
|
|
798
800
|
justify-content: space-between;
|
|
799
801
|
}
|
|
800
|
-
`,Ub=
|
|
802
|
+
`,Ub=chunkIVDIW747_cjs_js.e(ke__default.default)`
|
|
801
803
|
display: flex;
|
|
802
804
|
flex-direction: column;
|
|
803
805
|
justify-content: center;
|
|
804
806
|
width: 100%;
|
|
805
807
|
height: 42px;
|
|
806
|
-
`,_b=
|
|
808
|
+
`,_b=chunkIVDIW747_cjs_js.e(chunkIVDIW747_cjs_js.f)`
|
|
807
809
|
display: flex;
|
|
808
810
|
align-items: center;
|
|
809
811
|
justify-content: flex-end;
|
|
810
812
|
width: 100%;
|
|
811
813
|
min-height: 42px;
|
|
812
|
-
`,Db=(e,t)=>{let{minUnitQuantity:o,maxUnitQuantity:r}=e;return !t||t<(o||1)?`Minimum ${o||1}`:r&&t>r?`Maximum ${r}`:""};function $b({charge:e,setBillableFeature:t,billableFeature:o,onValidationChange:r,onBillableFeatureChange:n}){var g,h,P,b,x,A;let[i,a]=yi.useState(void 0),l=(g=e.feature)==null?void 0:g.featureId,s=!l,c=e.pricingModel===jsClientSdk.BillingModel.UsageBased,u=s?"Base charge":Bt(((h=e.feature)==null?void 0:h.displayName)||"",(P=e.feature)==null?void 0:P.units,(b=e.feature)==null?void 0:b.unitsPlural),f=!!(e!=null&&e.minUnitQuantity||e!=null&&e.maxUnitQuantity),y=S=>
|
|
814
|
+
`,Db=(e,t)=>{let{minUnitQuantity:o,maxUnitQuantity:r}=e;return !t||t<(o||1)?`Minimum ${o||1}`:r&&t>r?`Maximum ${r}`:""};function $b({charge:e,setBillableFeature:t,billableFeature:o,onValidationChange:r,onBillableFeatureChange:n}){var g,h,P,b,x,A;let[i,a]=yi.useState(void 0),l=(g=e.feature)==null?void 0:g.featureId,s=!l,c=e.pricingModel===jsClientSdk.BillingModel.UsageBased,u=s?"Base charge":Bt(((h=e.feature)==null?void 0:h.displayName)||"",(P=e.feature)==null?void 0:P.units,(b=e.feature)==null?void 0:b.unitsPlural),f=!!(e!=null&&e.minUnitQuantity||e!=null&&e.maxUnitQuantity),y=S=>chunkIVDIW747_cjs_js.d(null,null,function*(){var v,L;if(s||!l)return;let{minUnitQuantity:F,maxUnitQuantity:T}=e,k=(v=S==null?void 0:S.target)!=null&&v.value?Number((L=S==null?void 0:S.target)==null?void 0:L.value):null;if(!k||k<=0||F&&k<F||T&&k>T){r({featureId:l,isValid:false}),a(Db(e,k!=null?k:void 0)),t(l,k!=null?k:null);return}let w=yr(e,k),I=yield n==null?void 0:n({feature:e.feature,quantity:w});a(I==null?void 0:I.errorMessage),r({featureId:l,isValid:!(I!=null&&I.disableNextStep)}),t(l,w);}),p;if(s||c)p=`${H({amount:e.amount,currency:e.currency,locale:"en-us",minimumFractionDigits:2})}`,c&&(p+=" / unit");else if(e.isTieredPrice&&e.tiersMode&&l){let S=(o==null?void 0:o.quantity)||1;p=jsxRuntime.jsx(Kt,{componentId:`${l}-tiers`,tiers:e.tiers,tiersMode:e.tiersMode,value:S,errorMessage:i,handleChange:F=>chunkIVDIW747_cjs_js.d(null,null,function*(){let T=yield n==null?void 0:n({feature:e.feature,quantity:F});a(T==null?void 0:T.errorMessage),r({featureId:l,isValid:!(T!=null&&T.disableNextStep)}),t(l,F);}),width:"100%"});}else p=jsxRuntime.jsx(pe,{sx:{width:"100%"},id:`${l}-input`,type:"number",onWheel:bt,error:!!i,helperText:i,FormHelperTextProps:{sx:{margin:"4px"}},value:(x=o==null?void 0:o.quantity)!=null?x:"",onChange:y});return jsxRuntime.jsxs(Rb,{children:[jsxRuntime.jsxs(Ub,{children:[jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{variant:"h6",color:"primary",lineHeight:"24px",children:u}),f&&jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{variant:"body1",color:"secondary",lineHeight:"20px",children:So(e.minUnitQuantity,e.maxUnitQuantity,(A=e.feature)==null?void 0:A.unitsPlural)})]}),jsxRuntime.jsx(_b,{variant:"h6",color:"primary",children:p})]})}function xp({plan:e,billingPeriod:t,onBillableFeatureChange:o}){var u;let{billableFeatures:r,setBillableFeature:n}=be(),{setIsDisabled:i}=_e(),{setIsValid:a}=D(),l=xr(((u=e==null?void 0:e.pricePoints)==null?void 0:u.filter(f=>f.billingPeriod===t))||[]),[s,c]=yi.useState(l==null?void 0:l.reduce((f,y)=>{var p;return f[((p=y.feature)==null?void 0:p.featureId)||"base-charge"]=true,f},{}));return yi.useEffect(()=>{let f=Object.values(s).some(y=>!y);i(f),a(!f);},[s,i,a]),jsxRuntime.jsx(jsxRuntime.Fragment,{children:l==null?void 0:l.map(f=>{var p;let y=r.find(g=>{var h;return g.featureId===((h=f.feature)==null?void 0:h.featureId)});return jsxRuntime.jsx($b,{charge:f,setBillableFeature:n,billableFeature:y,onValidationChange:({featureId:g,isValid:h})=>c(P=>chunkIVDIW747_cjs_js.b(chunkIVDIW747_cjs_js.a({},P),{[g]:h})),onBillableFeatureChange:o},((p=f.feature)==null?void 0:p.featureId)||"base-charge")})})}var bp=chunkIVDIW747_cjs_js.e(ke__default.default)`
|
|
813
815
|
width: 100%;
|
|
814
|
-
`;var Tp=({onChangePlan:e,onBillableFeatureChange:t})=>{let{checkoutState:o,checkoutLocalization:r}=D(),{plan:n}=o||{},{billingPeriod:i}=be();return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(dp,{allowChangePlan:true,onChangePlan:e}),jsxRuntime.jsxs(bp,{children:[jsxRuntime.jsx(hp,{plan:n,checkoutLocalization:r}),jsxRuntime.jsx(xp,{plan:n,billingPeriod:i,onBillableFeatureChange:t})]})]})};var Ob=e=>jsxRuntime.jsx("svg",
|
|
816
|
+
`;var Tp=({onChangePlan:e,onBillableFeatureChange:t})=>{let{checkoutState:o,checkoutLocalization:r}=D(),{plan:n}=o||{},{billingPeriod:i}=be();return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(dp,{allowChangePlan:true,onChangePlan:e}),jsxRuntime.jsxs(bp,{children:[jsxRuntime.jsx(hp,{plan:n,checkoutLocalization:r}),jsxRuntime.jsx(xp,{plan:n,billingPeriod:i,onBillableFeatureChange:t})]})]})};var Ob=e=>jsxRuntime.jsx("svg",chunkIVDIW747_cjs_js.b(chunkIVDIW747_cjs_js.a({width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:jsxRuntime.jsxs("g",{id:"arrow-right",children:[jsxRuntime.jsx("path",{id:"Shape",d:"M2.66699 8H13.3337",stroke:"#7586B0",strokeWidth:1.33333,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx("path",{id:"Shape_2",d:"M9.33301 4L13.333 8L9.33301 12",stroke:"#7586B0",strokeWidth:1.33333,strokeLinecap:"round",strokeLinejoin:"round"})]})})),kp=Ob;var wp=chunkIVDIW747_cjs_js.e(kp)`
|
|
815
817
|
path {
|
|
816
818
|
stroke: ${({theme:e})=>e.stigg.palette.text.secondary};
|
|
817
819
|
}
|
|
818
|
-
`;var Zb=
|
|
820
|
+
`;var Zb=chunkIVDIW747_cjs_js.e(ke__default.default)`
|
|
819
821
|
display: flex;
|
|
820
|
-
`,Yb=
|
|
822
|
+
`,Yb=chunkIVDIW747_cjs_js.e(Qx__default.default)`
|
|
821
823
|
margin-bottom: 16px;
|
|
822
|
-
`,Qb=
|
|
824
|
+
`,Qb=chunkIVDIW747_cjs_js.e(ke__default.default)`
|
|
823
825
|
padding: 16px;
|
|
824
826
|
border-radius: 10px;
|
|
825
827
|
width: 100%;
|
|
826
828
|
border: ${({theme:e})=>`1px solid ${e.stigg.palette.outlinedBorder}`};
|
|
827
|
-
`,Bp=({headerText:e,planName:t,priceText:o})=>jsxRuntime.jsxs(Qb,{className:"stigg-checkout-downgrade-to-free-container",children:[jsxRuntime.jsx(
|
|
829
|
+
`,Bp=({headerText:e,planName:t,priceText:o})=>jsxRuntime.jsxs(Qb,{className:"stigg-checkout-downgrade-to-free-container",children:[jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{className:"stigg-checkout-downgrade-to-free-text-header",style:{opacity:.8},variant:"caption",color:"disabled",children:e}),jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{className:"stigg-checkout-downgrade-to-free-plan-name",bold:true,variant:"h3",color:"primary",children:t}),jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{className:"stigg-checkout-downgrade-to-free-price-text",color:"secondary",children:o})]}),Ip=({checkoutLocalization:e,activeSubscription:t,freePlan:o,allowChangePlan:r=false,onChangePlan:n})=>{let i;r&&n&&(i=jsxRuntime.jsx(Dr,{onClick:()=>{n({currentPlan:o});},checkoutLocalization:e,size:"small"}));let a=t.prices.length>0?t.prices[0].billingPeriod:void 0;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Yb,{action:i,className:"stigg-checkout-downgrade-to-free-alert",severity:"info",children:jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{as:"span",color:"secondary",children:e.downgradeToFree.alertText({plan:t.plan})})}),jsxRuntime.jsxs(Zb,{className:"stigg-checkout-downgrade-to-free-plans-container",children:[jsxRuntime.jsx(Bp,{headerText:e.downgradeToFree.paidPlanHeader({plan:t.plan}),planName:e.downgradeToFree.paidPlanName({plan:t.plan}),priceText:e.downgradeToFree.paidPlanPriceText({plan:t.plan,billingPeriod:a})}),jsxRuntime.jsx(wp,{className:"stigg-checkout-downgrade-to-free-arrow",style:{margin:"auto 16px",minWidth:"16px"}}),jsxRuntime.jsx(Bp,{headerText:e.downgradeToFree.freePlanHeader({plan:o}),planName:e.downgradeToFree.freePlanName({plan:o}),priceText:e.downgradeToFree.freePlanPriceText({plan:o})})]})]})};var Xb=(e,{onBillingAddressChange:t,onChangePlan:o,onBillableFeatureChange:r,onAddonChange:n,collectPhoneNumber:i,collectTaxId:a,onCheckout:l,onCheckoutCompleted:s})=>{switch(e.key){case "PLAN":return {content:jsxRuntime.jsx(Tp,{onChangePlan:o,onBillableFeatureChange:r})};case "ADDONS":return {content:jsxRuntime.jsx(Xd,{onAddonChange:n})};case "PAYMENT":return {content:jsxRuntime.jsx(sp,{onBillingAddressChange:t,collectPhoneNumber:i,collectTaxId:a,onCheckout:l,onCheckoutCompleted:s})};default:return {content:null}}};function Lp({onCheckout:e,onCheckoutCompleted:t,onChangePlan:o,onBillingAddressChange:r,onBillableFeatureChange:n,onAddonChange:i,collectPhoneNumber:a,collectTaxId:l,disablePromotionCode:s,disableSuccessAnimation:c,onMockCheckoutPreview:u}){let{stripePromise:f,setupIntentClientSecret:y}=Cd(),[{stiggTheme:p,widgetState:g,theme:h,showWatermark:P}]=_(),{currentStep:b}=_e(),{isLoadingCheckoutData:x}=g,{checkoutState:A,checkoutLocalization:S}=D(),{plan:F,activeSubscription:T}=A||{},k=!!F&&F.pricingType===jsClientSdk.PricingType.Free&&!!T&&T.pricingType!==jsClientSdk.PricingType.Free,{content:w}=Xb(b,{onBillingAddressChange:r,onChangePlan:o,onBillableFeatureChange:n,onAddonChange:i,collectPhoneNumber:a,collectTaxId:l,onCheckout:e,onCheckoutCompleted:t}),I=jsxRuntime.jsx(jsxRuntime.Fragment,{children:k?jsxRuntime.jsx(Ip,{freePlan:F,activeSubscription:T,allowChangePlan:true,checkoutLocalization:S,onChangePlan:o}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:w})}),v=yi.useMemo(()=>y?{clientSecret:y}:{mode:"setup",currency:"usd"},[y]);return jsxRuntime.jsx(reactStripeJs.Elements,{stripe:f,options:chunkIVDIW747_cjs_js.b(chunkIVDIW747_cjs_js.a({},v),{appearance:{theme:"stripe",variables:{colorText:p.palette.text.primary,colorPrimaryText:p.palette.text.primary,colorTextPlaceholder:p.palette.text.disabled,fontFamily:p.typography.fontFamily,colorBackground:h==null?void 0:h.paymentInputBackgroundColor,borderRadius:h==null?void 0:h.paymentInputBorderRadius},rules:h!=null&&h.paymentInputBorderColor?{".Input":{borderColor:h==null?void 0:h.paymentInputBorderColor}}:void 0}}),children:jsxRuntime.jsxs(Rc,{className:"stigg-checkout-layout",children:[!k&&jsxRuntime.jsx(Oc,{}),jsxRuntime.jsxs(Uc,{children:[jsxRuntime.jsx(_c,{children:x?jsxRuntime.jsx(qa,{}):I}),x?jsxRuntime.jsx(Vd,{showWatermark:P}):jsxRuntime.jsx(zd,{disablePromotionCode:s,disableSuccessAnimation:c,onCheckout:e,onCheckoutCompleted:t,isFreeDowngrade:k,onMockCheckoutPreview:u,showWatermark:P})]})]})},y)}var Mp=p=>{var g=p,{textOverrides:e,theme:t,resourceId:o,planId:r,preferredBillingPeriod:n,billingCountryCode:i,billableFeatures:a,billingInformation:l,onMockCheckoutState:s,skipCheckoutSteps:c,onBeforeStepChange:u,resetBillingPeriod:f}=g,y=chunkIVDIW747_cjs_js.c(g,["textOverrides","theme","resourceId","planId","preferredBillingPeriod","billingCountryCode","billableFeatures","billingInformation","onMockCheckoutState","skipCheckoutSteps","onBeforeStepChange","resetBillingPeriod"]);return jsxRuntime.jsx(Lc,{textOverrides:e,theme:t,resourceId:o,planId:r,preferredBillingPeriod:n,billingCountryCode:i,billableFeatures:a,billingInformation:l,onMockCheckoutState:s,skipCheckoutSteps:c,onBeforeStepChange:u,resetBillingPeriod:f,children:jsxRuntime.jsx(Lp,chunkIVDIW747_cjs_js.a({},y))})};function tS(e){return yi.useMemo(()=>{let t=new URLSearchParams(window.location.search);return t.get(e)},[e,window.location.search])}var Yi=(r=>(r.IN_PROGRESS="IN_PROGRESS",r.SUCCEEDED="SUCCEEDED",r.FAILED="FAILED",r))(Yi||{}),Up=({onProvisionStart:e,onProvisionSucceeded:t,onProvisionFailed:o}={})=>{let{stigg:r}=chunkIVDIW747_cjs_js.u(),[n,i]=yi.useState("IN_PROGRESS"),[a,l]=yi.useState(false),s=tS("checkoutCompleted");return yi.useEffect(()=>{chunkIVDIW747_cjs_js.d(null,null,function*(){if(!(!s||s.toLowerCase()==="false"||a)){l(true),e&&e();try{let u=yield r.waitForCheckoutCompleted();i("SUCCEEDED"),t&&t(u);}catch(u){console.error("Failed to wait for checkout to complete",u),i("FAILED"),o&&o(u);}finally{l(false);}}});},[r,s]),{isAwaitingCheckout:a,provisionStatus:n}};function oS(r){var n=r,{noAccessComponent:e,children:t}=n,o=chunkIVDIW747_cjs_js.c(n,["noAccessComponent","children"]);let{hasAccess:i}=chunkIVDIW747_cjs_js.x(o);return i?t:jsxRuntime.jsx(jsxRuntime.Fragment,{children:e!=null?e:null})}function iS(r){var n=r,{noAccessComponent:e,children:t}=n,o=chunkIVDIW747_cjs_js.c(n,["noAccessComponent","children"]);let{hasAccess:i}=chunkIVDIW747_cjs_js.y(o);return i?t:jsxRuntime.jsx(jsxRuntime.Fragment,{children:e!=null?e:null})}function lS(r){var n=r,{noAccessComponent:e,children:t}=n,o=chunkIVDIW747_cjs_js.c(n,["noAccessComponent","children"]);let{hasAccess:i}=chunkIVDIW747_cjs_js.z(o);return i?t:jsxRuntime.jsx(jsxRuntime.Fragment,{children:e!=null?e:null})}function pS(r){var n=r,{noAccessComponent:e,children:t}=n,o=chunkIVDIW747_cjs_js.c(n,["noAccessComponent","children"]);let{hasAccess:i}=chunkIVDIW747_cjs_js.B(o);return i?t:jsxRuntime.jsx(jsxRuntime.Fragment,{children:e!=null?e:null})}var Rt=chunkIVDIW747_cjs_js.e.div`
|
|
828
830
|
display: flex;
|
|
829
831
|
align-items: center;
|
|
830
832
|
justify-content: space-between;
|
|
831
833
|
width: 100%;
|
|
832
|
-
`;var Ut=
|
|
834
|
+
`;var Ut=chunkIVDIW747_cjs_js.e.button`
|
|
833
835
|
display: flex;
|
|
834
836
|
align-items: center;
|
|
835
837
|
gap: 4px;
|
|
@@ -855,27 +857,27 @@
|
|
|
855
857
|
outline: 2px solid ${({theme:e})=>{var t,o;return (o=(t=e.stigg)==null?void 0:t.palette)==null?void 0:o.primary}};
|
|
856
858
|
outline-offset: 2px;
|
|
857
859
|
}
|
|
858
|
-
`;var rt=(e,t)=>e?
|
|
860
|
+
`;var rt=(e,t)=>e?chunkIVDIW747_cjs_js.k(e,{maximumFractionDigits:t!=null?t:void 0}):0,Gr=(e,t=true)=>{let{remaining:o,currency:r}=e,n=(o===1?r.unitSingular:r.unitPlural)||null,i=n!=null?n:r.displayName;return t&&i!=null?i:""},zr=(e,t)=>t===0?0:Math.min(e/t*100,100);function Vr({usagePeriodEnd:e,formatResetPeriod:t,className:o}){let r=cr({usagePeriodEnd:e,formatter:t});return r?jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{variant:"caption",color:"secondary",className:o,children:r}):null}var fS=chunkIVDIW747_cjs_js.e.div`
|
|
859
861
|
display: flex;
|
|
860
862
|
flex-direction: column;
|
|
861
863
|
gap: 4px;
|
|
862
|
-
`,yS=
|
|
864
|
+
`,yS=chunkIVDIW747_cjs_js.e.div`
|
|
863
865
|
display: flex;
|
|
864
866
|
flex-direction: row;
|
|
865
867
|
gap: 4px;
|
|
866
868
|
align-items: baseline;
|
|
867
|
-
`;function Dp({entitlement:e,decimalPlaces:t=null,showUnits:o=true,formatResetPeriod:r}){if(e.isFallback)return jsxRuntime.jsx(
|
|
869
|
+
`;function Dp({entitlement:e,decimalPlaces:t=null,showUnits:o=true,formatResetPeriod:r}){if(e.isFallback)return jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{variant:"body1",color:"disabled",className:"stigg-credit-balance-value-no-balance",children:"No balance data available"});let n=Gr(e,o);return jsxRuntime.jsxs(fS,{children:[jsxRuntime.jsxs(yS,{children:[jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{variant:"h3",color:"primary",bold:true,className:"stigg-credit-balance-value-amount",children:rt(e.remaining,t)}),jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{variant:"caption",color:"secondary",className:"stigg-credit-balance-value-suffix",children:n})]}),jsxRuntime.jsx(Vr,{usagePeriodEnd:e.usagePeriodEnd,formatResetPeriod:r,className:"stigg-credit-balance-reset-period"})]})}var Hr=chunkIVDIW747_cjs_js.e(br)`
|
|
868
870
|
width: 16px;
|
|
869
871
|
height: 16px;
|
|
870
872
|
path {
|
|
871
873
|
stroke: ${({theme:e})=>{var t,o,r;return (r=(o=(t=e.stigg)==null?void 0:t.palette)==null?void 0:o.text)==null?void 0:r.primary}};
|
|
872
874
|
}
|
|
873
|
-
`;var hS=
|
|
875
|
+
`;var hS=chunkIVDIW747_cjs_js.e.div`
|
|
874
876
|
display: flex;
|
|
875
877
|
flex-direction: column;
|
|
876
878
|
gap: 8px;
|
|
877
879
|
width: 100%;
|
|
878
|
-
`,CS=
|
|
880
|
+
`,CS=chunkIVDIW747_cjs_js.e.div`
|
|
879
881
|
display: flex;
|
|
880
882
|
flex-direction: column;
|
|
881
883
|
gap: 8px;
|
|
@@ -883,40 +885,40 @@
|
|
|
883
885
|
border-radius: 8px;
|
|
884
886
|
border: 1px solid ${({theme:e})=>{var t,o;return (o=(t=e.stigg)==null?void 0:t.palette)==null?void 0:o.outlinedBorder}};
|
|
885
887
|
background-color: ${({theme:e})=>{var t,o;return (o=(t=e==null?void 0:e.stigg)==null?void 0:t.palette)==null?void 0:o.backgroundPaper}};
|
|
886
|
-
`;function $p({currencyId:e,localization:t,decimalPlaces:o,showUnits:r=true,onAddCredits:n}){let i=he(ee),a=
|
|
888
|
+
`;function $p({currencyId:e,localization:t,decimalPlaces:o,showUnits:r=true,onAddCredits:n}){let i=he(ee),a=chunkIVDIW747_cjs_js.u({optional:true}),l=a==null?void 0:a.theme,{title:s,addCredits:c,formatResetPeriod:u}=chunkIVDIW747_cjs_js.a(chunkIVDIW747_cjs_js.a({},chunkIVDIW747_cjs_js.G),t),f=chunkIVDIW747_cjs_js.A({currencyId:e}),y=jsxRuntime.jsx(hS,{className:"stigg-credit-balance-container",children:jsxRuntime.jsxs(CS,{className:"stigg-credit-balance-card",children:[jsxRuntime.jsxs(Rt,{children:[jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{variant:"h6",color:"primary",className:"stigg-credit-balance-title",children:s}),n&&!f.isFallback&&jsxRuntime.jsxs(Ut,{type:"button",onClick:()=>n(f),className:"stigg-credit-balance-add-credits-button",children:[jsxRuntime.jsx(Hr,{className:"stigg-credit-balance-add-credits-icon"}),c]})]}),jsxRuntime.jsx(Dp,{entitlement:f,decimalPlaces:o,showUnits:r,formatResetPeriod:u})]})});return i?y:jsxRuntime.jsx(chunkIVDIW747_cjs_js.w,{componentTheme:l,children:y})}var bS=yi.lazy(()=>import('./CreditUsageChart-T5PAX7TE.cjs.js').then(e=>({default:e.CreditUsageChart})));function zp(e){return jsxRuntime.jsx(yi.Suspense,{fallback:null,children:jsxRuntime.jsx(bS,chunkIVDIW747_cjs_js.a({},e))})}var SS=(e,t,o)=>o==="primary"?t.palette.primary:e>=100?t.palette.progress.high:e>=75?t.palette.progress.medium:t.palette.progress.low,TS=chunkIVDIW747_cjs_js.e.div`
|
|
887
889
|
width: 100%;
|
|
888
890
|
height: 8px;
|
|
889
891
|
background-color: ${({theme:e})=>e.stigg.palette.progress.background};
|
|
890
892
|
border-radius: 4px;
|
|
891
893
|
overflow: hidden;
|
|
892
|
-
`,kS=
|
|
894
|
+
`,kS=chunkIVDIW747_cjs_js.e.div`
|
|
893
895
|
height: 100%;
|
|
894
896
|
width: ${({percentage:e})=>Math.max(0,Math.min(100,e))}%;
|
|
895
897
|
background-color: ${({theme:e,percentage:t,variant:o})=>SS(t,e.stigg,o)};
|
|
896
898
|
border-radius: 4px;
|
|
897
899
|
transition: width 0.3s ease-in-out;
|
|
898
|
-
`;function Wr({percentage:e,className:t,variant:o="utilization"}){return jsxRuntime.jsx(TS,{className:t,children:jsxRuntime.jsx(kS,{percentage:e,variant:o})})}var wS=
|
|
900
|
+
`;function Wr({percentage:e,className:t,variant:o="utilization"}){return jsxRuntime.jsx(TS,{className:t,children:jsxRuntime.jsx(kS,{percentage:e,variant:o})})}var wS=chunkIVDIW747_cjs_js.e.div`
|
|
899
901
|
display: flex;
|
|
900
902
|
flex-direction: row;
|
|
901
903
|
justify-content: space-between;
|
|
902
904
|
align-items: baseline;
|
|
903
905
|
width: 100%;
|
|
904
|
-
`,BS=
|
|
906
|
+
`,BS=chunkIVDIW747_cjs_js.e.div`
|
|
905
907
|
display: flex;
|
|
906
908
|
flex-direction: row;
|
|
907
909
|
gap: 4px;
|
|
908
910
|
align-items: baseline;
|
|
909
|
-
`,AS=
|
|
911
|
+
`,AS=chunkIVDIW747_cjs_js.e.div`
|
|
910
912
|
display: flex;
|
|
911
913
|
flex-direction: row;
|
|
912
914
|
gap: 4px;
|
|
913
915
|
align-items: baseline;
|
|
914
|
-
`,IS=({currentUsage:e,usageLimit:t})=>{let o=zr(e,t);return jsxRuntime.jsx(Wr,{percentage:o,className:"stigg-credit-utilization-progress"})};function Op({entitlement:e,decimalPlaces:t=null,showUnits:o=true,remainingLabel:r=
|
|
916
|
+
`,IS=({currentUsage:e,usageLimit:t})=>{let o=zr(e,t);return jsxRuntime.jsx(Wr,{percentage:o,className:"stigg-credit-utilization-progress"})};function Op({entitlement:e,decimalPlaces:t=null,showUnits:o=true,remainingLabel:r=chunkIVDIW747_cjs_js.H.remaining,formatResetPeriod:n}){if(e.isFallback)return jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{variant:"body1",color:"disabled",className:"stigg-credit-utilization-value-no-balance",children:"No balance data available"});let{remaining:i,currentUsage:a,usageLimit:l}=e,s=Gr(e,o);return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(wS,{children:[jsxRuntime.jsxs(BS,{children:[jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{variant:"h3",color:"primary",bold:true,className:"stigg-credit-utilization-usage",children:rt(a,t)}),jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{variant:"h3",color:"primary",className:"stigg-credit-utilization-separator",children:"/"}),jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{variant:"h3",color:"primary",className:"stigg-credit-utilization-total",children:rt(l,t)}),jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{variant:"caption",color:"secondary",className:"stigg-credit-utilization-suffix",children:s})]}),jsxRuntime.jsxs(AS,{children:[jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{variant:"caption",color:"secondary",className:"stigg-credit-utilization-remaining-label",children:r}),jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{variant:"caption",color:"primary",bold:true,className:"stigg-credit-utilization-remaining-value",children:rt(i,t)})]})]}),jsxRuntime.jsx(IS,{currentUsage:a,usageLimit:l}),jsxRuntime.jsx(Vr,{usagePeriodEnd:e.usagePeriodEnd,formatResetPeriod:n,className:"stigg-credit-utilization-reset-period"})]})}var vS=chunkIVDIW747_cjs_js.e.div`
|
|
915
917
|
display: flex;
|
|
916
918
|
flex-direction: column;
|
|
917
919
|
gap: 8px;
|
|
918
920
|
width: 100%;
|
|
919
|
-
`,ES=
|
|
921
|
+
`,ES=chunkIVDIW747_cjs_js.e.div`
|
|
920
922
|
display: flex;
|
|
921
923
|
flex-direction: column;
|
|
922
924
|
gap: 16px;
|
|
@@ -925,7 +927,7 @@
|
|
|
925
927
|
border: 1px solid ${({theme:e})=>{var t,o;return (o=(t=e.stigg)==null?void 0:t.palette)==null?void 0:o.outlinedBorder}};
|
|
926
928
|
background-color: ${({theme:e})=>{var t,o;return (o=(t=e==null?void 0:e.stigg)==null?void 0:t.palette)==null?void 0:o.backgroundPaper}};
|
|
927
929
|
min-height: 90px;
|
|
928
|
-
`;function Hp({currencyId:e,localization:t,decimalPlaces:o,showUnits:r=true,onAddCredits:n}){let i=he(ee),a=
|
|
930
|
+
`;function Hp({currencyId:e,localization:t,decimalPlaces:o,showUnits:r=true,onAddCredits:n}){let i=he(ee),a=chunkIVDIW747_cjs_js.u({optional:true}),l=a==null?void 0:a.theme,s=chunkIVDIW747_cjs_js.A({currencyId:e}),{title:c,remaining:u,addCredits:f,formatResetPeriod:y}=chunkIVDIW747_cjs_js.a(chunkIVDIW747_cjs_js.a({},chunkIVDIW747_cjs_js.H),t),p=jsxRuntime.jsx(vS,{className:"stigg-credit-utilization-container",children:jsxRuntime.jsxs(ES,{className:"stigg-credit-utilization-card",children:[jsxRuntime.jsxs(Rt,{children:[jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{variant:"h6",color:"primary",className:"stigg-credit-utilization-title",children:c}),n&&!s.isFallback&&jsxRuntime.jsxs(Ut,{type:"button",onClick:()=>n(s),className:"stigg-credit-utilization-add-credits-button",children:[jsxRuntime.jsx(Hr,{className:"stigg-credit-utilization-add-credits-icon"}),f]})]}),jsxRuntime.jsx(Op,{entitlement:s,decimalPlaces:o,showUnits:r,remainingLabel:u,formatResetPeriod:y})]})});return i?p:jsxRuntime.jsx(chunkIVDIW747_cjs_js.w,{componentTheme:l,children:p})}function Yr(e){let t=chunkIVDIW747_cjs_js.u(),o=t==null?void 0:t.stigg,r=t==null?void 0:t.updatedAt,n=yi.useCallback(()=>chunkIVDIW747_cjs_js.d(null,null,function*(){if(!o||!o.isCustomerLoaded)return null;try{return o.getCreditGrants({currencyId:e.currencyId,paging:e.paging})}catch(s){throw console.error("Error fetching credit grants:",s),s}}),[o,e.currencyId,e.paging,r]),{data:i,error:a,isLoading:l}=chunkIVDIW747_cjs_js.C({func:n});return yi.useMemo(()=>({creditGrants:(i==null?void 0:i.data)||[],paging:i==null?void 0:i.pageInfo,totalCount:i==null?void 0:i.totalCount,isLoading:l,error:a}),[i,a,l])}function qi({skeletonRows:e,visibleHeadCells:t,hideLastRowBorder:o}){return jsxRuntime.jsx(jsxRuntime.Fragment,{children:Array.from({length:e}).map((r,n)=>jsxRuntime.jsx(MS__default.default,{children:t.map(i=>jsxRuntime.jsx(_t,{$alignment:i.alignment,$width:i.width,$maxWidth:i.maxWidth,$minWidth:i.minWidth,$isLastRow:n===e-1,$hideLastRowBorder:o,children:jsxRuntime.jsx(Je__default.default,{width:i.width?parseInt(i.width.replace("px",""))-40:100,height:20})},String(i.id)))},n))})}function Ji({data:e,visibleHeadCells:t,onRowClick:o,hideLastRowBorder:r}){return jsxRuntime.jsx(jsxRuntime.Fragment,{children:e.map((n,i)=>jsxRuntime.jsx(Xi,{$clickable:!!o,onClick:()=>o&&o(n),children:t.map(a=>jsxRuntime.jsx(_t,{$alignment:a.alignment,$width:a.width,$maxWidth:a.maxWidth,$minWidth:a.minWidth,$isLastRow:i===e.length-1,$hideLastRowBorder:r,onClick:a.disableClick?l=>l.stopPropagation():void 0,children:jsxRuntime.jsx(ji,{$alignment:a.alignment,children:a.render(n)})},String(a.id)))},i))})}function qr({errorMessage:e,className:t}){return e===void 0||typeof e=="string"?jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{variant:"body1",color:"error",className:t,children:e||"An error occurred"}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:e})}function Jr({message:e,className:t}){return e===void 0||typeof e=="string"?jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{variant:"body1",color:"secondary",className:t,children:e||"No data available"}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:e})}var YS=chunkIVDIW747_cjs_js.e(material.TableContainer)`
|
|
929
931
|
border-radius: 8px;
|
|
930
932
|
border: 1px solid ${({theme:e})=>e.stigg.palette.outlinedBorder};
|
|
931
933
|
background-color: ${({theme:e})=>e.stigg.palette.backgroundPaper};
|
|
@@ -938,13 +940,13 @@
|
|
|
938
940
|
align-items: center;
|
|
939
941
|
justify-content: center;
|
|
940
942
|
`}
|
|
941
|
-
`,QS=
|
|
943
|
+
`,QS=chunkIVDIW747_cjs_js.e(material.Table)`
|
|
942
944
|
min-width: 600px;
|
|
943
945
|
table-layout: auto;
|
|
944
946
|
width: 100%;
|
|
945
|
-
`,KS=
|
|
947
|
+
`,KS=chunkIVDIW747_cjs_js.e(material.Divider)`
|
|
946
948
|
border-color: ${({theme:e})=>e.stigg.palette.outlinedBorder};
|
|
947
|
-
`,_t=
|
|
949
|
+
`,_t=chunkIVDIW747_cjs_js.e(material.TableCell)`
|
|
948
950
|
padding: 8px 12px;
|
|
949
951
|
border-bottom: 1px solid ${({theme:e})=>e.stigg.palette.outlinedBorder};
|
|
950
952
|
text-align: ${({$alignment:e})=>e||"left"};
|
|
@@ -957,38 +959,38 @@
|
|
|
957
959
|
${({$minWidth:e})=>e&&`min-width: ${e};`}
|
|
958
960
|
|
|
959
961
|
${({$isLastRow:e,$hideLastRowBorder:t})=>e&&t&&"border-bottom: none;"}
|
|
960
|
-
`,qS=
|
|
962
|
+
`,qS=chunkIVDIW747_cjs_js.e(_t)`
|
|
961
963
|
background-color: transparent;
|
|
962
|
-
`,Xi=
|
|
964
|
+
`,Xi=chunkIVDIW747_cjs_js.e(material.TableRow)`
|
|
963
965
|
${({$clickable:e,theme:t})=>e&&`
|
|
964
966
|
cursor: pointer;
|
|
965
967
|
&:hover {
|
|
966
968
|
background-color: ${t.stigg.palette.backgroundHighlight};
|
|
967
969
|
}
|
|
968
970
|
`}
|
|
969
|
-
`,ji=
|
|
971
|
+
`,ji=chunkIVDIW747_cjs_js.e.div`
|
|
970
972
|
display: flex;
|
|
971
973
|
align-items: center;
|
|
972
974
|
justify-content: ${({$alignment:e})=>{switch(e){case "center":return "center";case "right":return "flex-end";default:return "flex-start"}}};
|
|
973
975
|
width: 100%;
|
|
974
|
-
`,JS=
|
|
976
|
+
`,JS=chunkIVDIW747_cjs_js.e(material.TablePagination)`
|
|
975
977
|
color: ${({theme:e})=>e.stigg.palette.text.secondary};
|
|
976
|
-
`;function XS({visibleHeadCells:e}){return jsxRuntime.jsx(material.TableHead,{children:jsxRuntime.jsx(material.TableRow,{children:e.map(t=>jsxRuntime.jsx(qS,{$alignment:t.alignment,$width:t.width,$maxWidth:t.maxWidth,$minWidth:t.minWidth,children:jsxRuntime.jsx(
|
|
978
|
+
`;function XS({visibleHeadCells:e}){return jsxRuntime.jsx(material.TableHead,{children:jsxRuntime.jsx(material.TableRow,{children:e.map(t=>jsxRuntime.jsx(qS,{$alignment:t.alignment,$width:t.width,$maxWidth:t.maxWidth,$minWidth:t.minWidth,children:jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{variant:"caption",children:t.label})},String(t.id)))})})}function Xr({data:e,headCells:t,isLoading:o=false,error:r=null,emptyMessage:n,errorMessage:i,onRowClick:a,className:l,skeletonRows:s=3,hideLastRowBorder:c=true,pageSize:u,pageNum:f,totalCount:y,onPageChange:p}){let g=t.filter(P=>P.visible!==false),h=!!r||!o&&e.length===0;return jsxRuntime.jsx(YS,{className:l,$hasMinHeight:h,children:r?jsxRuntime.jsx(qr,{errorMessage:i,className:`${l}-error`}):!o&&e.length===0?jsxRuntime.jsx(Jr,{message:n,className:`${l}-empty`}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(QS,{children:[jsxRuntime.jsx(XS,{visibleHeadCells:g}),jsxRuntime.jsx(material.TableBody,{children:o?jsxRuntime.jsx(qi,{skeletonRows:s,visibleHeadCells:g,hideLastRowBorder:c}):jsxRuntime.jsx(Ji,{data:e,visibleHeadCells:g,onRowClick:a,hideLastRowBorder:c})})]}),!!(e!=null&&e.length)&&p&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(KS,{}),jsxRuntime.jsx(JS,{component:"div",rowsPerPage:u!=null?u:e.length,rowsPerPageOptions:[u!=null?u:e.length],count:y!=null?y:e.length,page:f!=null?f:1,onPageChange:p,labelDisplayedRows:({from:P,to:b,count:x})=>`${se(P)}-${se(b)} of ${x!==-1?se(x):`more than ${se(b)}`}`})]})]})})}var eT=chunkIVDIW747_cjs_js.e(Ab__default.default)`
|
|
977
979
|
font-size: 0.75rem;
|
|
978
980
|
height: 24px;
|
|
979
981
|
border-radius: 4px;
|
|
980
982
|
border: none;
|
|
981
983
|
background-color: ${({theme:e,$variant:t})=>{var o,r,n,i;return (i=(n=(r=(o=e==null?void 0:e.stigg)==null?void 0:o.palette)==null?void 0:r.statusChips)==null?void 0:n[t])==null?void 0:i.background}};
|
|
982
984
|
color: ${({theme:e,$variant:t})=>{var o,r,n,i;return (i=(n=(r=(o=e==null?void 0:e.stigg)==null?void 0:o.palette)==null?void 0:r.statusChips)==null?void 0:n[t])==null?void 0:i.text}};
|
|
983
|
-
`;function uo(i){var a=i,{variant:e,label:t,className:o,size:r="small"}=a,n=
|
|
985
|
+
`;function uo(i){var a=i,{variant:e,label:t,className:o,size:r="small"}=a,n=chunkIVDIW747_cjs_js.c(a,["variant","label","className","size"]);return jsxRuntime.jsx(eT,chunkIVDIW747_cjs_js.a({label:t,size:r,$variant:e,className:o},n))}function Kp(e){let t=Z(),o=Z(e.effectiveAt),r=e.expireAt?Z(e.expireAt):null;return o.isAfter(t)?"SCHEDULED":r&&r.isBefore(t)?"EXPIRED":"AVAILABLE"}function qp(e,t){return `${rt(e.consumedAmount,t)} / ${e.amount}`}var oa=e=>{switch(e){case "AVAILABLE":return "success";case "SCHEDULED":return "warning";case "EXPIRED":return "error";default:return "neutral"}},Jp=e=>{if(e.automaticRechargeConfigurationId)return "Automatic recharge";switch(e.grantType){case jsClientSdk.CreditGrantType.Promotional:return "Promotional";case jsClientSdk.CreditGrantType.Paid:return "Top-up";case jsClientSdk.CreditGrantType.Recurring:return "Recurring";default:return "Unknown"}};function Xp({creditGrants:e,isLoading:t,error:o,localization:r,decimalPlaces:n,pageSize:i,pageNum:a,totalCount:l,onPageChange:s}){let c=e.map(f=>chunkIVDIW747_cjs_js.b(chunkIVDIW747_cjs_js.a({},f),{status:Kp(f)})),u=[{id:"effectiveAt",label:r.receivedAt,width:"205px",render:({effectiveAt:f})=>jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{variant:"body1",className:"stigg-credit-grants-effective-date",children:ei(f)})},{id:"grantType",label:r.grantType,width:"205px",render:f=>jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{variant:"body1",className:"stigg-credit-grants-grant-type",children:Jp(f)})},{id:"status",label:r.status,width:"205px",render:({status:f})=>{let y=rT__default.default(f),p=oa(f);return jsxRuntime.jsx(uo,{label:y,variant:p,className:"stigg-credit-grants-status-chip"})}},{id:"amount",label:r.balance,width:"205px",render:f=>jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{variant:"body1",className:"stigg-credit-grants-balance",children:qp(f,n)})},{id:"expireAt",label:r.expiryDate,width:"205px",render:({expireAt:f})=>jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{variant:"body1",className:"stigg-credit-grants-expiry-date",children:f?ti(f):"-"})}];return jsxRuntime.jsx(Xr,{data:c,headCells:u,isLoading:t,error:o,emptyMessage:r.emptyState,loadingMessage:r.loadingState,errorMessage:r.errorState,className:"stigg-credit-grants-table",skeletonRows:(c==null?void 0:c.length)||3,pageNum:a,pageSize:i,totalCount:l,onPageChange:s})}var em=(e,t,o)=>{let[r,n]=yi.useState(0),[i,a]=yi.useState(0);return {pageNumber:i,lastVisitedPage:r,pageChangeFunc:(s,c)=>{let u=c>i?{after:e==null?void 0:e.endCursor,first:o}:{before:e==null?void 0:e.startCursor,last:o};t(u),n(i),a(c);}}};var iT=10,aT=chunkIVDIW747_cjs_js.e.div`
|
|
984
986
|
display: flex;
|
|
985
987
|
flex-direction: column;
|
|
986
988
|
gap: 8px;
|
|
987
|
-
`,sT=
|
|
989
|
+
`,sT=chunkIVDIW747_cjs_js.e.div`
|
|
988
990
|
display: flex;
|
|
989
991
|
flex-direction: column;
|
|
990
992
|
gap: 16px;
|
|
991
|
-
`;function tm({currencyId:e,localization:t,decimalPlaces:o,pageSize:r=iT}){let n=
|
|
993
|
+
`;function tm({currencyId:e,localization:t,decimalPlaces:o,pageSize:r=iT}){let n=chunkIVDIW747_cjs_js.u({optional:true}),i=n==null?void 0:n.stigg,a=n==null?void 0:n.theme,l=chunkIVDIW747_cjs_js.a(chunkIVDIW747_cjs_js.a({},chunkIVDIW747_cjs_js.I),t),[s,c]=yi.useState({first:r}),{creditGrants:u,isLoading:f,error:y,paging:p,totalCount:g}=Yr({currencyId:e,pageSize:r,paging:s}),{pageNumber:h,pageChangeFunc:P}=em(p,c,r);return jsxRuntime.jsx(chunkIVDIW747_cjs_js.w,{componentTheme:a,children:jsxRuntime.jsxs(aT,{className:"stigg-credit-grants-container",children:[jsxRuntime.jsx(sT,{className:"stigg-credit-grants-card",children:jsxRuntime.jsx(Xp,{creditGrants:u,isLoading:f,error:y,localization:l,decimalPlaces:o,pageSize:r,pageNum:h,totalCount:g,onPageChange:P})}),jsxRuntime.jsx(chunkIVDIW747_cjs_js.q,{source:"grant_list",align:"end",smallScreenAlign:"end",style:{marginTop:0},showWatermark:i==null?void 0:i.getShowWatermark()})]})})}var om=chunkIVDIW747_cjs_js.e.div`
|
|
992
994
|
display: flex;
|
|
993
995
|
flex-direction: column;
|
|
994
996
|
gap: 16px;
|
|
@@ -997,16 +999,16 @@
|
|
|
997
999
|
border: 1px solid ${({theme:e})=>{var t,o;return (o=(t=e.stigg)==null?void 0:t.palette)==null?void 0:o.outlinedBorder}};
|
|
998
1000
|
background-color: ${({theme:e})=>{var t,o;return (o=(t=e==null?void 0:e.stigg)==null?void 0:t.palette)==null?void 0:o.backgroundPaper}};
|
|
999
1001
|
min-height: 90px;
|
|
1000
|
-
`;var rm=
|
|
1002
|
+
`;var rm=chunkIVDIW747_cjs_js.e.div`
|
|
1001
1003
|
display: flex;
|
|
1002
1004
|
align-items: center;
|
|
1003
1005
|
gap: 4px;
|
|
1004
|
-
`;var ra=
|
|
1006
|
+
`;var ra=chunkIVDIW747_cjs_js.e.div`
|
|
1005
1007
|
display: flex;
|
|
1006
1008
|
flex-direction: column;
|
|
1007
1009
|
gap: 4px;
|
|
1008
1010
|
width: 100%;
|
|
1009
|
-
`;var nm=
|
|
1011
|
+
`;var nm=chunkIVDIW747_cjs_js.e.div`
|
|
1010
1012
|
display: flex;
|
|
1011
1013
|
align-items: center;
|
|
1012
1014
|
justify-content: center;
|
|
@@ -1014,26 +1016,26 @@
|
|
|
1014
1016
|
min-height: 60px;
|
|
1015
1017
|
border: 1px dashed ${({theme:e})=>{var t,o;return (o=(t=e.stigg)==null?void 0:t.palette)==null?void 0:o.outlinedBorder}};
|
|
1016
1018
|
border-radius: 8px;
|
|
1017
|
-
`;function en(e){let t=
|
|
1019
|
+
`;function en(e){let t=chunkIVDIW747_cjs_js.u(),o=t==null?void 0:t.stigg,r=t==null?void 0:t.updatedAt,n=yi.useCallback(()=>chunkIVDIW747_cjs_js.d(null,null,function*(){if(!o)throw new Error("Stigg SDK is not initialized. Please check your API configuration.");if(!o.isCustomerLoaded)return null;try{let s={customerId:e.customerId,currencyId:e.currencyId};return yield o.getAutomaticRechargeConfiguration(s)}catch(s){throw console.error("Error fetching automatic recharge configuration:",s),s}}),[o,e.customerId,e.currencyId,r]),{data:i,error:a,isLoading:l}=chunkIVDIW747_cjs_js.C({func:n});return {config:i,isLoading:l,error:a}}function im({customerId:e,currencyId:t}){let{config:o,isLoading:r,error:n}=en({customerId:e,currencyId:t}),i=yi.useMemo(()=>{if(!o)return {isConfigured:false,isEnabled:false,thresholdValue:0,targetBalance:0,currentMonthlySpend:0,maxSpendLimit:0,spendPercentage:0,showActiveState:false};let a=o.maxSpendLimit&&o.maxSpendLimit>0?zr(o.currentMonthlySpend||0,o.maxSpendLimit):0,l=true,s=l&&o.isEnabled;return {isConfigured:l,isEnabled:o.isEnabled,thresholdValue:o.thresholdValue||0,targetBalance:o.targetBalance||0,currentMonthlySpend:o.currentMonthlySpend||0,maxSpendLimit:o.maxSpendLimit||0,spendPercentage:a,showActiveState:s}},[o]);return chunkIVDIW747_cjs_js.b(chunkIVDIW747_cjs_js.a({},i),{isLoading:r,error:n})}var am=chunkIVDIW747_cjs_js.e(om)`
|
|
1018
1020
|
width: 406px;
|
|
1019
1021
|
box-shadow: 0px 1px 1px 0px rgba(0, 0, 0, 0.05);
|
|
1020
1022
|
box-sizing: border-box;
|
|
1021
|
-
`,sm=
|
|
1023
|
+
`,sm=chunkIVDIW747_cjs_js.e.div`
|
|
1022
1024
|
display: flex;
|
|
1023
1025
|
align-items: center;
|
|
1024
1026
|
justify-content: flex-start;
|
|
1025
|
-
`;function lm(e,t){return e?Object.entries(t).reduce((o,[r,n])=>{let i=new RegExp(`{{\\s*${r}\\s*}}`,"g"),l=String(n!=null?n:"").replace(/\$/g,"$$$$");return o.replace(i,l)},e):""}function cm({customerId:e,currencyId:t,currencyUnit:o="Credits",billingCurrency:r="$",onManageClick:n,className:i,localization:a}){let{thresholdValue:l,targetBalance:s,currentMonthlySpend:c,maxSpendLimit:u,spendPercentage:f,showActiveState:y,isLoading:p,error:g}=im({customerId:e,currencyId:t}),h=
|
|
1027
|
+
`;function lm(e,t){return e?Object.entries(t).reduce((o,[r,n])=>{let i=new RegExp(`{{\\s*${r}\\s*}}`,"g"),l=String(n!=null?n:"").replace(/\$/g,"$$$$");return o.replace(i,l)},e):""}function cm({customerId:e,currencyId:t,currencyUnit:o="Credits",billingCurrency:r="$",onManageClick:n,className:i,localization:a}){let{thresholdValue:l,targetBalance:s,currentMonthlySpend:c,maxSpendLimit:u,spendPercentage:f,showActiveState:y,isLoading:p,error:g}=im({customerId:e,currencyId:t}),h=chunkIVDIW747_cjs_js.a(chunkIVDIW747_cjs_js.a({},chunkIVDIW747_cjs_js.K),a&&Object.fromEntries(Object.entries(a).filter(([x,A])=>A!==void 0))),P=lm(h.descriptionTemplate,{target:Gt(s),unit:o,threshold:Gt(l)}),b=lm(h.spendTemplate,{currency:r,current:Gt(c),limit:Gt(u)});return g?jsxRuntime.jsx(am,{className:`stigg-auto-recharge-status stigg-auto-recharge-status-error ${i||""}`,children:jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{variant:"body1",color:"error",children:g.message||"Failed to load auto-recharge status"})}):jsxRuntime.jsxs(am,{className:`stigg-auto-recharge-status ${i||""}`,children:[jsxRuntime.jsxs(Rt,{children:[jsxRuntime.jsxs(rm,{children:[jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{variant:"h6",color:"primary",className:"stigg-auto-recharge-title",children:h.title}),!p&&y&&jsxRuntime.jsx(uo,{variant:"success",label:h.activeLabel,className:"stigg-auto-recharge-status-chip",size:"small"})]}),p?jsxRuntime.jsx(Je__default.default,{width:70,height:38,borderRadius:10}):jsxRuntime.jsx(Ut,{type:"button",onClick:n,className:"stigg-auto-recharge-manage-button","aria-label":`${h.manageButton} auto-recharge settings`,children:h.manageButton})]}),p?jsxRuntime.jsxs(ra,{children:[jsxRuntime.jsx(Je__default.default,{width:"100%",height:20}),jsxRuntime.jsx(Je__default.default,{width:"100%",height:8,borderRadius:0}),jsxRuntime.jsx(sm,{children:jsxRuntime.jsx(Je__default.default,{width:200,height:16})})]}):y?jsxRuntime.jsxs(ra,{children:[jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{variant:"body1",color:"primary",className:"stigg-auto-recharge-description",children:P}),jsxRuntime.jsx(Wr,{percentage:f,variant:"primary",className:"stigg-auto-recharge-progress"}),jsxRuntime.jsx(sm,{children:jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{variant:"caption",color:"tertiary",className:"stigg-auto-recharge-spend",children:u>0?b:h.unlimitedSpendLimit})})]}):jsxRuntime.jsx(nm,{className:"stigg-auto-recharge-empty",children:jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{variant:"caption",color:"tertiary",className:"stigg-auto-recharge-empty-text",children:h.emptyStateMessage})})]})}var pT=chunkIVDIW747_cjs_js.e.div`
|
|
1026
1028
|
display: flex;
|
|
1027
1029
|
flex-direction: column;
|
|
1028
1030
|
gap: 8px;
|
|
1029
1031
|
width: 100%;
|
|
1030
|
-
`;function dm(e){let t=he(ee),o=
|
|
1032
|
+
`;function dm(e){let t=he(ee),o=chunkIVDIW747_cjs_js.u({optional:true}),r=o==null?void 0:o.theme,n=jsxRuntime.jsx(pT,{className:"stigg-auto-recharge-status-container",children:jsxRuntime.jsx(cm,chunkIVDIW747_cjs_js.a({},e))});return t?n:jsxRuntime.jsx(chunkIVDIW747_cjs_js.w,{componentTheme:r,children:n})}function pm(e){return Lg__default.default({},{title:"Auto recharge settings",enableLabel:"Recharge credits automatically when balance is low",enableDescription:"Allow auto-recharge",thresholdFieldPrefix:"When",thresholdFieldSuffix:"balance goes below",thresholdTooltip:"The credit balance threshold that triggers an automatic recharge",thresholdFieldPlaceholder:"Enter threshold amount",thresholdFieldHint:"Current threshold: {{value}}",thresholdRequired:"Threshold amount is required",thresholdMin:"Threshold must be at least 0",thresholdMax:"Threshold must be less than {{max}}",targetFieldPrefix:"Then",targetFieldSuffix:"recharge balance up to",targetBalanceTooltip:"The target credit balance to reach after a recharge",targetFieldPlaceholder:"Enter target balance",targetFieldHint:"Current target: {{value}}",targetRequired:"Target balance is required",targetMin:"Target must be greater than threshold",targetMax:"Target cannot exceed {{max}}",spendLimitFieldPrefix:"Limit",spendLimitFieldSuffix:"total spend",spendLimitFieldPlaceholder:"0.00",spendLimitHelpText:"Limit recharging to spending cap when enabled",spendLimitPeriod:"month",spendLimitPositive:"Spend limit must be greater than 0",spendLimitMin:"Spend limit must be at least {{min}}",spendLimitMax:"Spend limit cannot exceed {{max}}",immediateRechargeWarning:"Recharge will run immediately after saving. Current balance is below threshold {{threshold}} {{currencyUnit}}.",spendLimitTooLowWarning:"Auto-recharge may not run. Current monthly spend (${{currentSpend}} USD) is approaching or exceeds the spend limit (${{spendLimit}} USD).",cancelButton:"Cancel",saveButton:"Save settings",editButton:"Edit",loadingState:"Loading automatic recharge settings...",errorState:"Failed to load automatic recharge settings",emptyState:"No automatic recharge configuration found"},e)}function nt(e,t={},o){var a,l,s,c;let r={};if(!e.enabled)return r;let n=parseFloat(e.thresholdAmount);!e.thresholdAmount||e.thresholdAmount.trim()===""?r.thresholdAmount=o.thresholdRequired||"Threshold amount is required":isNaN(n)?r.thresholdAmount="Threshold must be a valid number":n<0?r.thresholdAmount=o.thresholdMin||"Threshold must be at least 0":t.poolSize!==void 0&&n>=t.poolSize&&(r.thresholdAmount=((a=o.thresholdMax)==null?void 0:a.replace("{{max}}",String(t.poolSize)))||`Threshold must be less than ${t.poolSize}`);let i=parseFloat(e.targetBalance);if(!e.targetBalance||e.targetBalance.trim()===""?r.targetBalance=o.targetRequired||"Target balance is required":isNaN(i)?r.targetBalance="Target balance must be a valid number":!isNaN(n)&&i<=n?r.targetBalance=o.targetMin||"Target balance must be greater than threshold":t.poolSize!==void 0&&i>t.poolSize&&(r.targetBalance=((l=o.targetMax)==null?void 0:l.replace("{{max}}",String(t.poolSize)))||`Target balance cannot exceed ${t.poolSize}`),e.maxSpendLimit&&e.maxSpendLimit.trim()!==""){let u=parseFloat(e.maxSpendLimit);isNaN(u)?r.maxSpendLimit="Spend limit must be a valid number":u<=0?r.maxSpendLimit=o.spendLimitPositive||"Spend limit must be greater than 0":t.minSpendLimit!==void 0&&u<t.minSpendLimit?r.maxSpendLimit=((s=o.spendLimitMin)==null?void 0:s.replace("{{min}}",String(t.minSpendLimit)))||`Spend limit must be at least ${t.minSpendLimit}`:t.maxSpendLimit!==void 0&&u>t.maxSpendLimit&&(r.maxSpendLimit=((c=o.spendLimitMax)==null?void 0:c.replace("{{max}}",String(t.maxSpendLimit)))||`Spend limit cannot exceed ${t.maxSpendLimit}`);}return r}function on({initialData:e,poolSize:t,localization:o}){var P,b,x,A,S,F,T,k,w,I,v,L,N,$;let[r,n]=yi.useState({enabled:(P=e==null?void 0:e.enabled)!=null?P:false,thresholdAmount:(x=(b=e==null?void 0:e.thresholdAmount)==null?void 0:b.toString())!=null?x:"",targetBalance:(S=(A=e==null?void 0:e.targetBalance)==null?void 0:A.toString())!=null?S:"",maxSpendLimit:(T=(F=e==null?void 0:e.maxSpendLimit)==null?void 0:F.toString())!=null?T:""}),[i,a]=yi.useState({thresholdAmount:true,targetBalance:true,maxSpendLimit:true}),l=nt({enabled:(k=e==null?void 0:e.enabled)!=null?k:false,thresholdAmount:(I=(w=e==null?void 0:e.thresholdAmount)==null?void 0:w.toString())!=null?I:"",targetBalance:(L=(v=e==null?void 0:e.targetBalance)==null?void 0:v.toString())!=null?L:"",maxSpendLimit:($=(N=e==null?void 0:e.maxSpendLimit)==null?void 0:N.toString())!=null?$:""},{poolSize:t},o),[s,c]=yi.useState(l);return {formData:r,errors:s,touched:i,handleEnabledChange:R=>{let z=R.target.checked;if(n(K=>chunkIVDIW747_cjs_js.b(chunkIVDIW747_cjs_js.a({},K),{enabled:z})),!z)c({}),a({});else {let K=nt(chunkIVDIW747_cjs_js.b(chunkIVDIW747_cjs_js.a({},r),{enabled:true}),{poolSize:t},o);c(K),a({thresholdAmount:true,targetBalance:true,maxSpendLimit:true});}},handleFieldChange:R=>z=>{let K=z.target.value,Ve=chunkIVDIW747_cjs_js.b(chunkIVDIW747_cjs_js.a({},r),{[R]:K});n(Ve),a(V=>chunkIVDIW747_cjs_js.b(chunkIVDIW747_cjs_js.a({},V),{[R]:true}));let ut=nt(Ve,{poolSize:t},o);c(ut);},handleFieldBlur:R=>()=>{a(K=>chunkIVDIW747_cjs_js.b(chunkIVDIW747_cjs_js.a({},K),{[R]:true}));let z=nt(r,{poolSize:t},o);c(z);},getFieldError:R=>i[R]?s[R]:void 0,validate:()=>{let R=nt(r,{poolSize:t},o);return c(R),r.enabled&&a({thresholdAmount:true,targetBalance:true,maxSpendLimit:true}),Object.keys(R).length===0},getFormValues:()=>{var R,z,K;return {enabled:r.enabled,thresholdAmount:(R=r.thresholdAmount)!=null&&R.trim()?parseFloat(r.thresholdAmount.trim()):void 0,targetBalance:(z=r.targetBalance)!=null&&z.trim()?parseFloat(r.targetBalance.trim()):void 0,maxSpendLimit:(K=r.maxSpendLimit)!=null&&K.trim()?parseFloat(r.maxSpendLimit.trim()):void 0}}}}var fo=chunkIVDIW747_cjs_js.e.div`
|
|
1031
1033
|
display: flex;
|
|
1032
1034
|
flex-direction: column;
|
|
1033
1035
|
gap: 16px;
|
|
1034
1036
|
width: 100%;
|
|
1035
1037
|
max-width: 506px;
|
|
1036
|
-
`,yo=
|
|
1038
|
+
`,yo=chunkIVDIW747_cjs_js.e.div`
|
|
1037
1039
|
display: flex;
|
|
1038
1040
|
flex-direction: column;
|
|
1039
1041
|
gap: 8px;
|
|
@@ -1042,12 +1044,12 @@
|
|
|
1042
1044
|
border: 1px solid ${({theme:e})=>{var t,o;return (o=(t=e.stigg)==null?void 0:t.palette)==null?void 0:o.outlinedBorder}};
|
|
1043
1045
|
background-color: ${({theme:e})=>{var t,o;return (o=(t=e.stigg)==null?void 0:t.palette)==null?void 0:o.backgroundPaper}};
|
|
1044
1046
|
box-shadow: 1px 6px 14px 0px rgba(26, 26, 26, 0.1);
|
|
1045
|
-
`,aa=
|
|
1047
|
+
`,aa=chunkIVDIW747_cjs_js.e(reactFeather.Info)`
|
|
1046
1048
|
width: 12px;
|
|
1047
1049
|
height: 12px;
|
|
1048
1050
|
color: ${({theme:e})=>{var t,o,r;return (r=(o=(t=e.stigg)==null?void 0:t.palette)==null?void 0:o.text)==null?void 0:r.secondary}};
|
|
1049
1051
|
cursor: help;
|
|
1050
|
-
`,sa=
|
|
1052
|
+
`,sa=chunkIVDIW747_cjs_js.e(Qx__default.default)`
|
|
1051
1053
|
font-family: custom-font, 'DM Sans', sans-serif;
|
|
1052
1054
|
align-items: center;
|
|
1053
|
-
`;function rn({customerId:e,currencyId:t,initialData:o,currencyUnit:r,poolSize:n,currentBalance:i,currentMonthlySpend:a,readOnly:l=false,localization:s,onSave:c,onCancel:u}){var v,L,N;let f=he(ee),y=chunkYAS4WG6F_cjs_js.u({optional:true}),p=y==null?void 0:y.theme,g=yi.useMemo(()=>pm(s),[s]),{formData:h,errors:P,handleEnabledChange:b,handleFieldChange:x,handleFieldBlur:A,getFieldError:S,validate:F,getFormValues:T}=on({initialData:o,poolSize:n,localization:g}),k=yi.useMemo(()=>h.enabled?Object.keys(P).length>0:false,[P,h.enabled]),w=yi.useCallback(()=>{if(F()&&c){let $=T();c(chunkYAS4WG6F_cjs_js.a({customerId:e,currencyId:t},$));}},[F,c,T,e,t]),I=jsxRuntime.jsx(fo,{className:"stigg-automatic-recharge-form-container",children:jsxRuntime.jsxs(yo,{className:"stigg-automatic-recharge-form-card",children:[jsxRuntime.jsxs(ke__default.default,{display:"flex",flexDirection:"column",gap:.5,children:[jsxRuntime.jsx(chunkYAS4WG6F_cjs_js.f,{variant:"h3",color:"primary",className:"stigg-automatic-recharge-form-title",children:g.title}),jsxRuntime.jsx(chunkYAS4WG6F_cjs_js.f,{variant:"body1",color:"secondary",className:"stigg-automatic-recharge-form-subtitle",children:g.enableLabel})]}),jsxRuntime.jsx(ke__default.default,{display:"flex",flexDirection:"column",gap:1,children:jsxRuntime.jsx(eC__default.default,{control:jsxRuntime.jsx(jh__default.default,{checked:h.enabled,onChange:b,disabled:l}),label:jsxRuntime.jsx(chunkYAS4WG6F_cjs_js.f,{variant:"body1",color:"primary",children:g.enableDescription}),className:"stigg-automatic-recharge-form-enable-checkbox"})}),jsxRuntime.jsxs(ke__default.default,{display:"flex",flexDirection:"column",gap:1,className:"stigg-automatic-recharge-form-threshold-field",children:[jsxRuntime.jsxs(ke__default.default,{display:"flex",alignItems:"center",gap:1,children:[jsxRuntime.jsxs(chunkYAS4WG6F_cjs_js.f,{variant:"body1",color:"primary",children:[jsxRuntime.jsx(ke__default.default,{component:"span",fontWeight:"bold",children:g.thresholdFieldPrefix})," ",g.thresholdFieldSuffix]}),jsxRuntime.jsx(We,{title:g.thresholdTooltip,children:jsxRuntime.jsx(aa,{})})]}),jsxRuntime.jsx(reactNumberFormat.NumericFormat,{customInput:pe,fullWidth:true,thousandSeparator:true,value:h.thresholdAmount,onValueChange:$=>{let R={target:{value:$.value}};x("thresholdAmount")(R);},onBlur:A("thresholdAmount"),placeholder:g.thresholdFieldPlaceholder,error:!!S("thresholdAmount"),helperText:(v=S("thresholdAmount"))!=null?v:"",disabled:l||!h.enabled,InputProps:{endAdornment:r?jsxRuntime.jsx(chunkYAS4WG6F_cjs_js.f,{variant:"body1",color:"secondary",style:{whiteSpace:"nowrap"},children:r}):void 0},className:"stigg-automatic-recharge-form-threshold-input"})]}),jsxRuntime.jsxs(ke__default.default,{display:"flex",flexDirection:"column",gap:1,className:"stigg-automatic-recharge-form-target-field",children:[jsxRuntime.jsxs(ke__default.default,{display:"flex",alignItems:"center",gap:1,children:[jsxRuntime.jsxs(chunkYAS4WG6F_cjs_js.f,{variant:"body1",color:"primary",children:[jsxRuntime.jsx(ke__default.default,{component:"span",fontWeight:"bold",children:g.targetFieldPrefix})," ",g.targetFieldSuffix]}),jsxRuntime.jsx(We,{title:g.targetBalanceTooltip,children:jsxRuntime.jsx(aa,{})})]}),jsxRuntime.jsx(reactNumberFormat.NumericFormat,{customInput:pe,fullWidth:true,thousandSeparator:true,value:h.targetBalance,onValueChange:$=>{let R={target:{value:$.value}};x("targetBalance")(R);},onBlur:A("targetBalance"),placeholder:g.targetFieldPlaceholder,error:!!S("targetBalance"),helperText:(L=S("targetBalance"))!=null?L:"",disabled:l||!h.enabled,InputProps:{endAdornment:r?jsxRuntime.jsx(chunkYAS4WG6F_cjs_js.f,{variant:"body1",color:"secondary",style:{whiteSpace:"nowrap"},children:r}):void 0},className:"stigg-automatic-recharge-form-target-input"})]}),jsxRuntime.jsxs(ke__default.default,{display:"flex",flexDirection:"column",gap:1,className:"stigg-automatic-recharge-form-spend-limit-field",children:[jsxRuntime.jsxs(ke__default.default,{display:"flex",flexDirection:"column",gap:.5,children:[jsxRuntime.jsxs(chunkYAS4WG6F_cjs_js.f,{variant:"body1",color:"primary",children:[jsxRuntime.jsx(ke__default.default,{component:"span",fontWeight:"bold",children:g.spendLimitFieldPrefix})," ",g.spendLimitFieldSuffix]}),jsxRuntime.jsx(chunkYAS4WG6F_cjs_js.f,{variant:"caption",color:"secondary",style:{fontSize:"12px"},children:g.spendLimitHelpText})]}),jsxRuntime.jsx(reactNumberFormat.NumericFormat,{customInput:pe,fullWidth:true,thousandSeparator:true,value:h.maxSpendLimit,onValueChange:$=>{let R={target:{value:$.value}};x("maxSpendLimit")(R);},onBlur:A("maxSpendLimit"),placeholder:g.spendLimitFieldPlaceholder,error:!!S("maxSpendLimit"),helperText:(N=S("maxSpendLimit"))!=null?N:"",disabled:l||!h.enabled,InputProps:{startAdornment:jsxRuntime.jsx(chunkYAS4WG6F_cjs_js.f,{variant:"body1",color:"secondary",children:"$"}),endAdornment:jsxRuntime.jsxs(chunkYAS4WG6F_cjs_js.f,{variant:"body1",color:"secondary",style:{whiteSpace:"nowrap"},children:["/ ",g.spendLimitPeriod]})},className:"stigg-automatic-recharge-form-spend-limit-input"})]}),!l&&h.enabled&&h.thresholdAmount&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[i!==void 0&&i<=parseFloat(h.thresholdAmount)&&jsxRuntime.jsx(sa,{severity:"warning",className:"stigg-automatic-recharge-form-warning",children:g.immediateRechargeWarning.replace("{{threshold}}",se(parseFloat(h.thresholdAmount))||"0").replace("{{currencyUnit}}",r||"")}),h.maxSpendLimit&&h.maxSpendLimit.trim()!==""&&parseFloat(h.maxSpendLimit)>0&&a!==void 0&&a+0>=parseFloat(h.maxSpendLimit)&&jsxRuntime.jsx(sa,{severity:"warning",className:"stigg-automatic-recharge-form-spend-limit-warning",children:g.spendLimitTooLowWarning.replace("{{currentSpend}}",dn(a)).replace("{{spendLimit}}",dn(parseFloat(h.maxSpendLimit)))})]}),!l&&jsxRuntime.jsxs(ke__default.default,{display:"flex",justifyContent:"flex-end",gap:1,pt:2,className:"stigg-automatic-recharge-form-actions",children:[u&&jsxRuntime.jsx(te,{variant:"outlined",onClick:u,className:"stigg-automatic-recharge-form-cancel-button",children:g.cancelButton}),c&&jsxRuntime.jsx(te,{variant:"contained",onClick:w,disabled:k,className:"stigg-automatic-recharge-form-save-button",children:g.saveButton})]})]})});return f?I:jsxRuntime.jsx(chunkYAS4WG6F_cjs_js.w,{componentTheme:p,children:I})}function gm(){let e=chunkYAS4WG6F_cjs_js.u(),t=e==null?void 0:e.stigg,[o,r]=yi.useState(false),[n,i]=yi.useState(null);return {updateConfig:yi.useCallback(l=>chunkYAS4WG6F_cjs_js.d(null,null,function*(){var s,c,u;if(!t||!t.isCustomerLoaded){let f=new Error("Stigg SDK not initialized or customer not loaded");throw i(f),f}r(true),i(null);try{let f={customerId:l.customerId,currencyId:l.currencyId,isEnabled:l.enabled,thresholdValue:(s=l.thresholdAmount)!=null?s:0,thresholdType:jsClientSdk.ThresholdType.CreditAmount,targetBalance:(c=l.targetBalance)!=null?c:0,maxSpendLimit:(u=l.maxSpendLimit)!=null?u:null},y=yield t.saveAutomaticRechargeConfiguration(f);return yield t.refresh(),r(!1),y}catch(f){let y=f instanceof Error?f:new Error("Failed to save automatic recharge configuration");throw console.error("Error saving automatic recharge configuration:",y),i(y),r(false),y}}),[t]),isLoading:o,error:n}}function hm({customerId:e,currencyId:t,currencyUnit:o,poolSize:r,readOnly:n=false,localization:i,onSave:a,onCancel:l}){var T;let s=he(ee),c=chunkYAS4WG6F_cjs_js.u({optional:true}),u=c==null?void 0:c.theme,{config:f,isLoading:y,error:p}=en({customerId:e,currencyId:t}),g=chunkYAS4WG6F_cjs_js.A({currencyId:t}),{updateConfig:h,isLoading:P,error:b}=gm(),x=yi.useCallback(k=>chunkYAS4WG6F_cjs_js.d(null,null,function*(){try{yield h(k),a&&a(k);}catch(w){console.error("Failed to save automatic recharge configuration:",w);}}),[h,a]),A=f?{id:"",enabled:f.isEnabled,thresholdAmount:f.thresholdValue,targetBalance:f.targetBalance,maxSpendLimit:(T=f.maxSpendLimit)!=null?T:void 0,currencyId:f.currencyId,customerId:f.customerId}:void 0;if(y){let k=jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx(Je__default.default,{width:300,height:24,style:{marginBottom:"16px"}}),jsxRuntime.jsx(Je__default.default,{width:400,height:200})]});return s?k:jsxRuntime.jsx(chunkYAS4WG6F_cjs_js.w,{componentTheme:u,children:k})}if(p){let k=jsxRuntime.jsx(fo,{className:"stigg-automatic-recharge-form-container",children:jsxRuntime.jsx(yo,{className:"stigg-automatic-recharge-form-card",children:jsxRuntime.jsx(chunkYAS4WG6F_cjs_js.f,{variant:"body1",color:"error",children:p.message||"Failed to load automatic recharge configuration"})})});return s?k:jsxRuntime.jsx(chunkYAS4WG6F_cjs_js.w,{componentTheme:u,children:k})}if(g.isFallback){let k=jsxRuntime.jsx(fo,{className:"stigg-automatic-recharge-form-container",children:jsxRuntime.jsx(yo,{className:"stigg-automatic-recharge-form-card",children:jsxRuntime.jsx(chunkYAS4WG6F_cjs_js.f,{variant:"body1",color:"error",children:"Failed to load credit balance"})})});return s?k:jsxRuntime.jsx(chunkYAS4WG6F_cjs_js.w,{componentTheme:u,children:k})}let S=o||g.currency.unitPlural||g.currency.displayName||"Credits",F=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[b&&jsxRuntime.jsx(chunkYAS4WG6F_cjs_js.f,{variant:"body1",color:"error",style:{marginBottom:"16px"},children:b.message||"Failed to save automatic recharge configuration"}),jsxRuntime.jsx(rn,{customerId:e,currencyId:t,initialData:A,currencyUnit:S,poolSize:r,currentBalance:g.remaining,currentMonthlySpend:f==null?void 0:f.currentMonthlySpend,readOnly:n||P,localization:i,onSave:x,onCancel:l})]});return s?F:jsxRuntime.jsx(chunkYAS4WG6F_cjs_js.w,{componentTheme:u,children:F})}Object.defineProperty(exports,"StiggContext",{enumerable:true,get:function(){return chunkYAS4WG6F_cjs_js.s}});Object.defineProperty(exports,"StiggProvider",{enumerable:true,get:function(){return chunkYAS4WG6F_cjs_js.t}});Object.defineProperty(exports,"useActiveSubscriptions",{enumerable:true,get:function(){return chunkYAS4WG6F_cjs_js.D}});Object.defineProperty(exports,"useBooleanEntitlement",{enumerable:true,get:function(){return chunkYAS4WG6F_cjs_js.x}});Object.defineProperty(exports,"useCreditEntitlement",{enumerable:true,get:function(){return chunkYAS4WG6F_cjs_js.A}});Object.defineProperty(exports,"useCreditUsage",{enumerable:true,get:function(){return chunkYAS4WG6F_cjs_js.L}});Object.defineProperty(exports,"useCustomerPortal",{enumerable:true,get:function(){return chunkYAS4WG6F_cjs_js.F}});Object.defineProperty(exports,"useEnumEntitlement",{enumerable:true,get:function(){return chunkYAS4WG6F_cjs_js.B}});Object.defineProperty(exports,"useMeteredEntitlement",{enumerable:true,get:function(){return chunkYAS4WG6F_cjs_js.z}});Object.defineProperty(exports,"useNumericEntitlement",{enumerable:true,get:function(){return chunkYAS4WG6F_cjs_js.y}});Object.defineProperty(exports,"usePaywall",{enumerable:true,get:function(){return chunkYAS4WG6F_cjs_js.E}});Object.defineProperty(exports,"useStiggContext",{enumerable:true,get:function(){return chunkYAS4WG6F_cjs_js.u}});exports.AddonsList=$o;exports.AutoRechargeStatus=dm;exports.AutomaticRechargeConfig=hm;exports.AutomaticRechargeConfigForm=rn;exports.BooleanEntitlementGuard=oS;exports.Checkout=Mp;exports.CreditBalance=$p;exports.CreditGrants=tm;exports.CreditUsageChart=zp;exports.CreditUtilization=Hp;exports.CustomerPortal=ic;exports.CustomerPortalProvider=Do;exports.CustomerUsageData=ur;exports.EmptyState=Jr;exports.EnumEntitlementGuard=pS;exports.ErrorState=qr;exports.GenericTable=Xr;exports.InvoicesSection=gr;exports.MeteredEntitlementGuard=lS;exports.NumericEntitlementGuard=iS;exports.PaymentDetailsSection=ar;exports.Paywall=Ls;exports.Promotions=zo;exports.ProvisionStatus=Yi;exports.StatusChip=uo;exports.SubscribeIntentionType=gn;exports.SubscriptionsOverview=tr;exports.formatDateOnly=ti;exports.formatDateTime=ei;exports.isCreditEntitlement=er;exports.isFeatureEntitlement=kt;exports.mapCreditGrantStatusToVariant=oa;exports.useAutomaticRechargeForm=on;exports.useCreditGrants=Yr;exports.useWaitForCheckoutCompleted=Up;exports.validateAutomaticRechargeForm=nt;Object.keys(jsClientSdk).forEach(function(k){if(k!=='default'&&!Object.prototype.hasOwnProperty.call(exports,k))Object.defineProperty(exports,k,{enumerable:true,get:function(){return jsClientSdk[k]}})});
|
|
1055
|
+
`;function rn({customerId:e,currencyId:t,initialData:o,currencyUnit:r,poolSize:n,currentBalance:i,currentMonthlySpend:a,readOnly:l=false,localization:s,onSave:c,onCancel:u}){var v,L,N;let f=he(ee),y=chunkIVDIW747_cjs_js.u({optional:true}),p=y==null?void 0:y.theme,g=yi.useMemo(()=>pm(s),[s]),{formData:h,errors:P,handleEnabledChange:b,handleFieldChange:x,handleFieldBlur:A,getFieldError:S,validate:F,getFormValues:T}=on({initialData:o,poolSize:n,localization:g}),k=yi.useMemo(()=>h.enabled?Object.keys(P).length>0:false,[P,h.enabled]),w=yi.useCallback(()=>{if(F()&&c){let $=T();c(chunkIVDIW747_cjs_js.a({customerId:e,currencyId:t},$));}},[F,c,T,e,t]),I=jsxRuntime.jsx(fo,{className:"stigg-automatic-recharge-form-container",children:jsxRuntime.jsxs(yo,{className:"stigg-automatic-recharge-form-card",children:[jsxRuntime.jsxs(ke__default.default,{display:"flex",flexDirection:"column",gap:.5,children:[jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{variant:"h3",color:"primary",className:"stigg-automatic-recharge-form-title",children:g.title}),jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{variant:"body1",color:"secondary",className:"stigg-automatic-recharge-form-subtitle",children:g.enableLabel})]}),jsxRuntime.jsx(ke__default.default,{display:"flex",flexDirection:"column",gap:1,children:jsxRuntime.jsx(eC__default.default,{control:jsxRuntime.jsx(jh__default.default,{checked:h.enabled,onChange:b,disabled:l}),label:jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{variant:"body1",color:"primary",children:g.enableDescription}),className:"stigg-automatic-recharge-form-enable-checkbox"})}),jsxRuntime.jsxs(ke__default.default,{display:"flex",flexDirection:"column",gap:1,className:"stigg-automatic-recharge-form-threshold-field",children:[jsxRuntime.jsxs(ke__default.default,{display:"flex",alignItems:"center",gap:1,children:[jsxRuntime.jsxs(chunkIVDIW747_cjs_js.f,{variant:"body1",color:"primary",children:[jsxRuntime.jsx(ke__default.default,{component:"span",fontWeight:"bold",children:g.thresholdFieldPrefix})," ",g.thresholdFieldSuffix]}),jsxRuntime.jsx(We,{title:g.thresholdTooltip,children:jsxRuntime.jsx(aa,{})})]}),jsxRuntime.jsx(reactNumberFormat.NumericFormat,{customInput:pe,fullWidth:true,thousandSeparator:true,value:h.thresholdAmount,onValueChange:$=>{let R={target:{value:$.value}};x("thresholdAmount")(R);},onBlur:A("thresholdAmount"),placeholder:g.thresholdFieldPlaceholder,error:!!S("thresholdAmount"),helperText:(v=S("thresholdAmount"))!=null?v:"",disabled:l||!h.enabled,InputProps:{endAdornment:r?jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{variant:"body1",color:"secondary",style:{whiteSpace:"nowrap"},children:r}):void 0},className:"stigg-automatic-recharge-form-threshold-input"})]}),jsxRuntime.jsxs(ke__default.default,{display:"flex",flexDirection:"column",gap:1,className:"stigg-automatic-recharge-form-target-field",children:[jsxRuntime.jsxs(ke__default.default,{display:"flex",alignItems:"center",gap:1,children:[jsxRuntime.jsxs(chunkIVDIW747_cjs_js.f,{variant:"body1",color:"primary",children:[jsxRuntime.jsx(ke__default.default,{component:"span",fontWeight:"bold",children:g.targetFieldPrefix})," ",g.targetFieldSuffix]}),jsxRuntime.jsx(We,{title:g.targetBalanceTooltip,children:jsxRuntime.jsx(aa,{})})]}),jsxRuntime.jsx(reactNumberFormat.NumericFormat,{customInput:pe,fullWidth:true,thousandSeparator:true,value:h.targetBalance,onValueChange:$=>{let R={target:{value:$.value}};x("targetBalance")(R);},onBlur:A("targetBalance"),placeholder:g.targetFieldPlaceholder,error:!!S("targetBalance"),helperText:(L=S("targetBalance"))!=null?L:"",disabled:l||!h.enabled,InputProps:{endAdornment:r?jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{variant:"body1",color:"secondary",style:{whiteSpace:"nowrap"},children:r}):void 0},className:"stigg-automatic-recharge-form-target-input"})]}),jsxRuntime.jsxs(ke__default.default,{display:"flex",flexDirection:"column",gap:1,className:"stigg-automatic-recharge-form-spend-limit-field",children:[jsxRuntime.jsxs(ke__default.default,{display:"flex",flexDirection:"column",gap:.5,children:[jsxRuntime.jsxs(chunkIVDIW747_cjs_js.f,{variant:"body1",color:"primary",children:[jsxRuntime.jsx(ke__default.default,{component:"span",fontWeight:"bold",children:g.spendLimitFieldPrefix})," ",g.spendLimitFieldSuffix]}),jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{variant:"caption",color:"secondary",style:{fontSize:"12px"},children:g.spendLimitHelpText})]}),jsxRuntime.jsx(reactNumberFormat.NumericFormat,{customInput:pe,fullWidth:true,thousandSeparator:true,value:h.maxSpendLimit,onValueChange:$=>{let R={target:{value:$.value}};x("maxSpendLimit")(R);},onBlur:A("maxSpendLimit"),placeholder:g.spendLimitFieldPlaceholder,error:!!S("maxSpendLimit"),helperText:(N=S("maxSpendLimit"))!=null?N:"",disabled:l||!h.enabled,InputProps:{startAdornment:jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{variant:"body1",color:"secondary",children:"$"}),endAdornment:jsxRuntime.jsxs(chunkIVDIW747_cjs_js.f,{variant:"body1",color:"secondary",style:{whiteSpace:"nowrap"},children:["/ ",g.spendLimitPeriod]})},className:"stigg-automatic-recharge-form-spend-limit-input"})]}),!l&&h.enabled&&h.thresholdAmount&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[i!==void 0&&i<=parseFloat(h.thresholdAmount)&&jsxRuntime.jsx(sa,{severity:"warning",className:"stigg-automatic-recharge-form-warning",children:g.immediateRechargeWarning.replace("{{threshold}}",se(parseFloat(h.thresholdAmount))||"0").replace("{{currencyUnit}}",r||"")}),h.maxSpendLimit&&h.maxSpendLimit.trim()!==""&&parseFloat(h.maxSpendLimit)>0&&a!==void 0&&a+0>=parseFloat(h.maxSpendLimit)&&jsxRuntime.jsx(sa,{severity:"warning",className:"stigg-automatic-recharge-form-spend-limit-warning",children:g.spendLimitTooLowWarning.replace("{{currentSpend}}",dn(a)).replace("{{spendLimit}}",dn(parseFloat(h.maxSpendLimit)))})]}),!l&&jsxRuntime.jsxs(ke__default.default,{display:"flex",justifyContent:"flex-end",gap:1,pt:2,className:"stigg-automatic-recharge-form-actions",children:[u&&jsxRuntime.jsx(te,{variant:"outlined",onClick:u,className:"stigg-automatic-recharge-form-cancel-button",children:g.cancelButton}),c&&jsxRuntime.jsx(te,{variant:"contained",onClick:w,disabled:k,className:"stigg-automatic-recharge-form-save-button",children:g.saveButton})]})]})});return f?I:jsxRuntime.jsx(chunkIVDIW747_cjs_js.w,{componentTheme:p,children:I})}function gm(){let e=chunkIVDIW747_cjs_js.u(),t=e==null?void 0:e.stigg,[o,r]=yi.useState(false),[n,i]=yi.useState(null);return {updateConfig:yi.useCallback(l=>chunkIVDIW747_cjs_js.d(null,null,function*(){var s,c,u;if(!t||!t.isCustomerLoaded){let f=new Error("Stigg SDK not initialized or customer not loaded");throw i(f),f}r(true),i(null);try{let f={customerId:l.customerId,currencyId:l.currencyId,isEnabled:l.enabled,thresholdValue:(s=l.thresholdAmount)!=null?s:0,thresholdType:jsClientSdk.ThresholdType.CreditAmount,targetBalance:(c=l.targetBalance)!=null?c:0,maxSpendLimit:(u=l.maxSpendLimit)!=null?u:null},y=yield t.saveAutomaticRechargeConfiguration(f);return yield t.refresh(),r(!1),y}catch(f){let y=f instanceof Error?f:new Error("Failed to save automatic recharge configuration");throw console.error("Error saving automatic recharge configuration:",y),i(y),r(false),y}}),[t]),isLoading:o,error:n}}function hm({customerId:e,currencyId:t,currencyUnit:o,poolSize:r,readOnly:n=false,localization:i,onSave:a,onCancel:l}){var T;let s=he(ee),c=chunkIVDIW747_cjs_js.u({optional:true}),u=c==null?void 0:c.theme,{config:f,isLoading:y,error:p}=en({customerId:e,currencyId:t}),g=chunkIVDIW747_cjs_js.A({currencyId:t}),{updateConfig:h,isLoading:P,error:b}=gm(),x=yi.useCallback(k=>chunkIVDIW747_cjs_js.d(null,null,function*(){try{yield h(k),a&&a(k);}catch(w){console.error("Failed to save automatic recharge configuration:",w);}}),[h,a]),A=f?{id:"",enabled:f.isEnabled,thresholdAmount:f.thresholdValue,targetBalance:f.targetBalance,maxSpendLimit:(T=f.maxSpendLimit)!=null?T:void 0,currencyId:f.currencyId,customerId:f.customerId}:void 0;if(y){let k=jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx(Je__default.default,{width:300,height:24,style:{marginBottom:"16px"}}),jsxRuntime.jsx(Je__default.default,{width:400,height:200})]});return s?k:jsxRuntime.jsx(chunkIVDIW747_cjs_js.w,{componentTheme:u,children:k})}if(p){let k=jsxRuntime.jsx(fo,{className:"stigg-automatic-recharge-form-container",children:jsxRuntime.jsx(yo,{className:"stigg-automatic-recharge-form-card",children:jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{variant:"body1",color:"error",children:p.message||"Failed to load automatic recharge configuration"})})});return s?k:jsxRuntime.jsx(chunkIVDIW747_cjs_js.w,{componentTheme:u,children:k})}if(g.isFallback){let k=jsxRuntime.jsx(fo,{className:"stigg-automatic-recharge-form-container",children:jsxRuntime.jsx(yo,{className:"stigg-automatic-recharge-form-card",children:jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{variant:"body1",color:"error",children:"Failed to load credit balance"})})});return s?k:jsxRuntime.jsx(chunkIVDIW747_cjs_js.w,{componentTheme:u,children:k})}let S=o||g.currency.unitPlural||g.currency.displayName||"Credits",F=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[b&&jsxRuntime.jsx(chunkIVDIW747_cjs_js.f,{variant:"body1",color:"error",style:{marginBottom:"16px"},children:b.message||"Failed to save automatic recharge configuration"}),jsxRuntime.jsx(rn,{customerId:e,currencyId:t,initialData:A,currencyUnit:S,poolSize:r,currentBalance:g.remaining,currentMonthlySpend:f==null?void 0:f.currentMonthlySpend,readOnly:n||P,localization:i,onSave:x,onCancel:l})]});return s?F:jsxRuntime.jsx(chunkIVDIW747_cjs_js.w,{componentTheme:u,children:F})}Object.defineProperty(exports,"StiggContext",{enumerable:true,get:function(){return chunkIVDIW747_cjs_js.s}});Object.defineProperty(exports,"StiggProvider",{enumerable:true,get:function(){return chunkIVDIW747_cjs_js.t}});Object.defineProperty(exports,"useActiveSubscriptions",{enumerable:true,get:function(){return chunkIVDIW747_cjs_js.D}});Object.defineProperty(exports,"useBooleanEntitlement",{enumerable:true,get:function(){return chunkIVDIW747_cjs_js.x}});Object.defineProperty(exports,"useCreditEntitlement",{enumerable:true,get:function(){return chunkIVDIW747_cjs_js.A}});Object.defineProperty(exports,"useCreditUsage",{enumerable:true,get:function(){return chunkIVDIW747_cjs_js.L}});Object.defineProperty(exports,"useCustomerPortal",{enumerable:true,get:function(){return chunkIVDIW747_cjs_js.F}});Object.defineProperty(exports,"useEnumEntitlement",{enumerable:true,get:function(){return chunkIVDIW747_cjs_js.B}});Object.defineProperty(exports,"useMeteredEntitlement",{enumerable:true,get:function(){return chunkIVDIW747_cjs_js.z}});Object.defineProperty(exports,"useNumericEntitlement",{enumerable:true,get:function(){return chunkIVDIW747_cjs_js.y}});Object.defineProperty(exports,"usePaywall",{enumerable:true,get:function(){return chunkIVDIW747_cjs_js.E}});Object.defineProperty(exports,"useStiggContext",{enumerable:true,get:function(){return chunkIVDIW747_cjs_js.u}});exports.AddonsList=$o;exports.AutoRechargeStatus=dm;exports.AutomaticRechargeConfig=hm;exports.AutomaticRechargeConfigForm=rn;exports.BooleanEntitlementGuard=oS;exports.Checkout=Mp;exports.CreditBalance=$p;exports.CreditGrants=tm;exports.CreditUsageChart=zp;exports.CreditUtilization=Hp;exports.CustomerPortal=ic;exports.CustomerPortalProvider=Do;exports.CustomerUsageData=ur;exports.EmptyState=Jr;exports.EnumEntitlementGuard=pS;exports.ErrorState=qr;exports.GenericTable=Xr;exports.InvoicesSection=gr;exports.MeteredEntitlementGuard=lS;exports.NumericEntitlementGuard=iS;exports.PaymentDetailsSection=ar;exports.Paywall=Ls;exports.Promotions=zo;exports.ProvisionStatus=Yi;exports.StatusChip=uo;exports.SubscribeIntentionType=gn;exports.SubscriptionsOverview=tr;exports.formatDateOnly=ti;exports.formatDateTime=ei;exports.isCreditEntitlement=er;exports.isFeatureEntitlement=kt;exports.mapCreditGrantStatusToVariant=oa;exports.useAutomaticRechargeForm=on;exports.useCreditGrants=Yr;exports.useWaitForCheckoutCompleted=Up;exports.validateAutomaticRechargeForm=nt;Object.keys(jsClientSdk).forEach(function(k){if(k!=='default'&&!Object.prototype.hasOwnProperty.call(exports,k))Object.defineProperty(exports,k,{enumerable:true,get:function(){return jsClientSdk[k]}})});
|