@stigg/react-sdk 7.26.0 → 7.26.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,53 +1,24 @@
1
- 'use strict';var ah=require('@stigg/js-client-sdk'),Fc=require('react'),fp=require('@emotion/styled'),sP=require('classnames'),Se=require('@mui/material/Grid'),nf=require('lodash/compact'),reactNumberFormat=require('react-number-format'),react=require('@emotion/react'),jsxRuntime=require('react/jsx-runtime'),lodash=require('lodash'),S2=require('react-spinners/ClipLoader'),Do=require('color'),f2=require('lodash/merge'),fc=require('moment'),Ar=require('lodash/isNil'),L2=require('currency-symbol-map'),V2=require('@mui/material/InputAdornment'),B2=require('@mui/material/Button'),N2=require('@mui/material/TextField'),fg=require('@mui/material/Divider'),ro=require('react-loading-skeleton'),$2=require('@mui/material/OutlinedInput'),H2=require('@mui/material/Select'),W2=require('@mui/material/MenuItem'),material=require('@mui/material'),LP=require('react-switch'),Gg=require('lodash/sortBy'),styles=require('@mui/material/styles'),DS=require('lodash/flatMap'),Ua=require('@mui/material/Box'),Fh=require('@mui/material/Tab'),NS=require('lodash/isEmpty'),HS=require('@mui/material/Tabs'),reactFeather=require('react-feather'),IT=require('@mui/material/Link'),kT=require('@mui/material/Tooltip'),BT=require('@mui/material/LinearProgress'),Tg=require('lodash/keyBy'),Fg=require('lodash/isUndefined'),sdk=require('@stigg/api-client-js/src/generated/sdk'),hc=require('lodash/lowerCase'),immer=require('immer'),Ck=require('lodash/cloneDeep'),Pk=require('lodash/remove'),reactStripeJs=require('@stripe/react-stripe-js'),xw=require('@mui/material/StepIcon'),J3=require('lodash/partition'),Iw=require('@mui/material/CircularProgress'),n5=require('@mui/material/Paper'),i5=require('@mui/material/Alert'),C=require('country-flag-icons/react/3x2'),x3=require('react-lottie'),X3=require('@mui/material/Collapse'),M5=require('@mui/material/Radio'),N5=require('@mui/material/Chip'),U9=require('lodash/debounce');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var ah__default=/*#__PURE__*/_interopDefault(ah);var Fc__default=/*#__PURE__*/_interopDefault(Fc);var fp__default=/*#__PURE__*/_interopDefault(fp);var sP__default=/*#__PURE__*/_interopDefault(sP);var Se__default=/*#__PURE__*/_interopDefault(Se);var nf__default=/*#__PURE__*/_interopDefault(nf);var S2__default=/*#__PURE__*/_interopDefault(S2);var Do__default=/*#__PURE__*/_interopDefault(Do);var f2__default=/*#__PURE__*/_interopDefault(f2);var fc__default=/*#__PURE__*/_interopDefault(fc);var Ar__default=/*#__PURE__*/_interopDefault(Ar);var L2__default=/*#__PURE__*/_interopDefault(L2);var V2__default=/*#__PURE__*/_interopDefault(V2);var B2__default=/*#__PURE__*/_interopDefault(B2);var N2__default=/*#__PURE__*/_interopDefault(N2);var fg__default=/*#__PURE__*/_interopDefault(fg);var ro__default=/*#__PURE__*/_interopDefault(ro);var $2__default=/*#__PURE__*/_interopDefault($2);var H2__default=/*#__PURE__*/_interopDefault(H2);var W2__default=/*#__PURE__*/_interopDefault(W2);var LP__default=/*#__PURE__*/_interopDefault(LP);var Gg__default=/*#__PURE__*/_interopDefault(Gg);var DS__default=/*#__PURE__*/_interopDefault(DS);var Ua__default=/*#__PURE__*/_interopDefault(Ua);var Fh__default=/*#__PURE__*/_interopDefault(Fh);var NS__default=/*#__PURE__*/_interopDefault(NS);var HS__default=/*#__PURE__*/_interopDefault(HS);var IT__default=/*#__PURE__*/_interopDefault(IT);var kT__default=/*#__PURE__*/_interopDefault(kT);var BT__default=/*#__PURE__*/_interopDefault(BT);var Tg__default=/*#__PURE__*/_interopDefault(Tg);var Fg__default=/*#__PURE__*/_interopDefault(Fg);var hc__default=/*#__PURE__*/_interopDefault(hc);var Ck__default=/*#__PURE__*/_interopDefault(Ck);var Pk__default=/*#__PURE__*/_interopDefault(Pk);var xw__default=/*#__PURE__*/_interopDefault(xw);var J3__default=/*#__PURE__*/_interopDefault(J3);var Iw__default=/*#__PURE__*/_interopDefault(Iw);var n5__default=/*#__PURE__*/_interopDefault(n5);var i5__default=/*#__PURE__*/_interopDefault(i5);var C__namespace=/*#__PURE__*/_interopNamespace(C);var x3__default=/*#__PURE__*/_interopDefault(x3);var X3__default=/*#__PURE__*/_interopDefault(X3);var M5__default=/*#__PURE__*/_interopDefault(M5);var N5__default=/*#__PURE__*/_interopDefault(N5);var U9__default=/*#__PURE__*/_interopDefault(U9);var mp=Object.defineProperty,mC=Object.defineProperties;var hC=Object.getOwnPropertyDescriptors;var br=Object.getOwnPropertySymbols;var hp=Object.prototype.hasOwnProperty,gp=Object.prototype.propertyIsEnumerable;var pp=(e,t,o)=>t in e?mp(e,t,{enumerable:true,configurable:true,writable:true,value:o}):e[t]=o,S=(e,t)=>{for(var o in t||(t={}))hp.call(t,o)&&pp(e,o,t[o]);if(br)for(var o of br(t))gp.call(t,o)&&pp(e,o,t[o]);return e},A=(e,t)=>mC(e,hC(t));var ot=(e,t)=>{var o={};for(var n in e)hp.call(e,n)&&t.indexOf(n)<0&&(o[n]=e[n]);if(e!=null&&br)for(var n of br(e))t.indexOf(n)<0&&gp.call(e,n)&&(o[n]=e[n]);return o};var gC=(e,t)=>{for(var o in t)mp(e,o,{get:t[o],enumerable:true});};var R=(e,t,o)=>new Promise((n,i)=>{var r=l=>{try{s(o.next(l));}catch(c){i(c);}},a=l=>{try{s(o.throw(l));}catch(c){i(c);}},s=l=>l.done?n(l.value):Promise.resolve(l.value).then(r,a);s((o=o.apply(e,t)).next());});var yp={shouldForwardProp:e=>!e.startsWith("$")},xp=e=>fp__default.default(e,yp),fC=["div","span","button","input","form","p","h1","h2","h3","h4","h5","h6","a","img","ul","ol","li","table","thead","tbody","tr","td","th"];fC.forEach(e=>{xp[e]=fp__default.default(e,yp);});var y=xp;function Cr(e,t,o){let n=o?` ${o}`:"";return (!e||e===1)&&t?`Up to ${t}${n}`:e&&e>1&&t?`${e}-${t}${n}`:e&&e>1?`Minimum ${e}${n}`:""}function At(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 gl(e,t="en-US"){let o={thousandSeparator:t==="en-US"?",":" ",decimalSeparator:".",decimalScale:2,fixedDecimalScale:true};return reactNumberFormat.numericFormatter(String(e),o)}function di(e,t=1){if(e<1e6)return At(e)||"0";let o=[{value:1e12,suffix:"T"},{value:1e9,suffix:"B"},{value:1e6,suffix:"M"}];for(let{value:n,suffix:i}of o)if(e>=n){let a=(e/n).toFixed(t);return a.includes(".")&&(a=a.replace(/\.0+$/,"").replace(/(\.\d*[1-9])0+$/,"$1")),`${a}${i}`}return At(e)||"0"}function bC(e,t){let o=e.stigg.palette;switch(t){case "white":return "white";case "primary.main":return o.primary;case "primary.main.light":return o.primaryLight;case "warning":return o.warning;case "error":return o.error;default:return o.text[t]||o.text.primary}}function fl(e,t="body1"){let o=e.stigg.typography,n={h1:o.h1,h3:o.h2,h6:o.h3,body1:o.body,caption:o.caption};return n[t]||n.body1}var CC=y.div`
1
+ 'use strict';var chunkMY4ZIUAV_cjs_js=require('./chunk-MY4ZIUAV.cjs.js'),jsClientSdk=require('@stigg/js-client-sdk'),ii=require('react'),xu=require('classnames'),Me=require('@mui/material/Grid'),ac=require('lodash/compact'),reactNumberFormat=require('react-number-format'),jsxRuntime=require('react/jsx-runtime'),Ma=require('lodash/isFunction'),Rm=require('react-spinners/ClipLoader'),react=require('@emotion/react'),ho=require('dayjs'),Bm=require('dayjs/plugin/utc'),Am=require('dayjs/plugin/relativeTime'),Im=require('dayjs/plugin/advancedFormat'),Po=require('lodash/isNil'),Nm=require('lodash/sum'),Zm=require('currency-symbol-map'),jm=require('@mui/material/InputAdornment'),Ym=require('@mui/material/Button'),qm=require('@mui/material/TextField'),xl=require('@mui/material/Divider'),eu=require('@mui/material/OutlinedInput'),tu=require('@mui/material/Select'),ou=require('@mui/material/MenuItem'),ru=require('lodash/map'),ke=require('@mui/material/Box'),Wu=require('react-switch'),ng=require('lodash/countBy'),ig=require('lodash/uniq'),Ql=require('lodash/sortBy'),dg=require('lodash/merge'),Qe=require('react-loading-skeleton'),wg=require('lodash/flatMap'),Us=require('@mui/material/Tab'),Bg=require('lodash/isEmpty'),Lg=require('@mui/material/Tabs'),Ug=require('@mui/material/useMediaQuery'),reactFeather=require('react-feather'),xf=require('@mui/material/Link'),uf=require('@mui/material/Tooltip'),Bl=require('lodash/keyBy'),bi=require('color'),kf=require('@mui/material/LinearProgress'),Hf=require('lodash/padStart'),Rl=require('lodash/isUndefined'),sdk=require('@stigg/api-client-js/src/generated/sdk'),Vn=require('lodash/lowerCase'),ty=require('lodash/range'),immer=require('immer'),dy=require('lodash/cloneDeep'),py=require('lodash/remove'),reactStripeJs=require('@stripe/react-stripe-js'),sh=require('@mui/material/StepIcon'),hP=require('lodash/partition'),xh=require('@mui/material/CircularProgress'),bP=require('@mui/material/Paper'),SP=require('@mui/material/Alert'),wh=require('@mui/material/Checkbox'),Bh=require('@mui/material/FormControlLabel'),Ah=require('lodash/isString'),fx=require('@mui/material/Autocomplete'),yx=require('@mui/material/Collapse'),_3x2=require('country-flag-icons/react/3x2'),td=require('lodash/startCase'),od=require('lodash/upperCase'),mP=require('@mui/material/IconButton'),styles=require('@mui/material/styles'),YP=require('@mui/material/Radio'),tb=require('@mui/material/Chip'),RS=require('lodash/capitalize'),material=require('@mui/material'),mS=require('@mui/material/TableRow');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var ii__default=/*#__PURE__*/_interopDefault(ii);var xu__default=/*#__PURE__*/_interopDefault(xu);var Me__default=/*#__PURE__*/_interopDefault(Me);var ac__default=/*#__PURE__*/_interopDefault(ac);var Ma__default=/*#__PURE__*/_interopDefault(Ma);var Rm__default=/*#__PURE__*/_interopDefault(Rm);var ho__default=/*#__PURE__*/_interopDefault(ho);var Bm__default=/*#__PURE__*/_interopDefault(Bm);var Am__default=/*#__PURE__*/_interopDefault(Am);var Im__default=/*#__PURE__*/_interopDefault(Im);var Po__default=/*#__PURE__*/_interopDefault(Po);var Nm__default=/*#__PURE__*/_interopDefault(Nm);var Zm__default=/*#__PURE__*/_interopDefault(Zm);var jm__default=/*#__PURE__*/_interopDefault(jm);var Ym__default=/*#__PURE__*/_interopDefault(Ym);var qm__default=/*#__PURE__*/_interopDefault(qm);var xl__default=/*#__PURE__*/_interopDefault(xl);var eu__default=/*#__PURE__*/_interopDefault(eu);var tu__default=/*#__PURE__*/_interopDefault(tu);var ou__default=/*#__PURE__*/_interopDefault(ou);var ru__default=/*#__PURE__*/_interopDefault(ru);var ke__default=/*#__PURE__*/_interopDefault(ke);var Wu__default=/*#__PURE__*/_interopDefault(Wu);var ng__default=/*#__PURE__*/_interopDefault(ng);var ig__default=/*#__PURE__*/_interopDefault(ig);var Ql__default=/*#__PURE__*/_interopDefault(Ql);var dg__default=/*#__PURE__*/_interopDefault(dg);var Qe__default=/*#__PURE__*/_interopDefault(Qe);var wg__default=/*#__PURE__*/_interopDefault(wg);var Us__default=/*#__PURE__*/_interopDefault(Us);var Bg__default=/*#__PURE__*/_interopDefault(Bg);var Lg__default=/*#__PURE__*/_interopDefault(Lg);var Ug__default=/*#__PURE__*/_interopDefault(Ug);var xf__default=/*#__PURE__*/_interopDefault(xf);var uf__default=/*#__PURE__*/_interopDefault(uf);var Bl__default=/*#__PURE__*/_interopDefault(Bl);var bi__default=/*#__PURE__*/_interopDefault(bi);var kf__default=/*#__PURE__*/_interopDefault(kf);var Hf__default=/*#__PURE__*/_interopDefault(Hf);var Rl__default=/*#__PURE__*/_interopDefault(Rl);var Vn__default=/*#__PURE__*/_interopDefault(Vn);var ty__default=/*#__PURE__*/_interopDefault(ty);var dy__default=/*#__PURE__*/_interopDefault(dy);var py__default=/*#__PURE__*/_interopDefault(py);var sh__default=/*#__PURE__*/_interopDefault(sh);var hP__default=/*#__PURE__*/_interopDefault(hP);var xh__default=/*#__PURE__*/_interopDefault(xh);var bP__default=/*#__PURE__*/_interopDefault(bP);var SP__default=/*#__PURE__*/_interopDefault(SP);var wh__default=/*#__PURE__*/_interopDefault(wh);var Bh__default=/*#__PURE__*/_interopDefault(Bh);var Ah__default=/*#__PURE__*/_interopDefault(Ah);var fx__default=/*#__PURE__*/_interopDefault(fx);var yx__default=/*#__PURE__*/_interopDefault(yx);var td__default=/*#__PURE__*/_interopDefault(td);var od__default=/*#__PURE__*/_interopDefault(od);var mP__default=/*#__PURE__*/_interopDefault(mP);var YP__default=/*#__PURE__*/_interopDefault(YP);var tb__default=/*#__PURE__*/_interopDefault(tb);var RS__default=/*#__PURE__*/_interopDefault(RS);var mS__default=/*#__PURE__*/_interopDefault(mS);function go(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 ie(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 jr(e,t="en-US"){let o={thousandSeparator:t==="en-US"?",":" ",decimalSeparator:".",decimalScale:2,fixedDecimalScale:true};return reactNumberFormat.numericFormatter(String(e),o)}function Dt(e,t=1){if(e<1e6)return ie(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 s=(e/r).toFixed(t);return s.includes(".")&&(s=s.replace(/\.0+$/,"").replace(/(\.\d*[1-9])0+$/,"$1")),`${s}${n}`}return ie(e)||"0"}var dm=chunkMY4ZIUAV_cjs_js.e(chunkMY4ZIUAV_cjs_js.f)`
2
2
  margin: 0;
3
- ${({$isInline:e})=>e&&"display: inline"};
4
-
5
- /* Apply typography styles from theme */
6
- font-family: ${({theme:e})=>e.stigg.typography.fontFamily};
7
- color: ${({$color:e})=>e};
8
- font-weight: ${({$bold:e,theme:t,$variant:o})=>e?"bold":fl(t,o).fontWeight};
9
- font-size: ${({theme:e,$variant:t})=>fl(e,t).fontSize};
10
- ${({$lineHeight:e})=>e&&`line-height: ${e};`}
11
- `,P=Fc.forwardRef((e,t)=>{let f=e,{children:o,style:n,variant:i="body1",color:r="primary",overrideColor:a,bold:s=false,as:l,className:c,lineHeight:d}=f,u=ot(f,["children","style","variant","color","overrideColor","bold","as","className","lineHeight"]),p=react.useTheme(),h=fl(p,i),m=l||h.semanticElement,g=a||bC(p,r);return jsxRuntime.jsx(CC,A(S({as:m,ref:t},u),{className:c,style:n,$variant:i,$bold:s,$color:g,$lineHeight:d,$isInline:m==="span",children:o}))});P.displayName="Typography";var Pr=(e,t)=>{switch(e){case "primary":return t.stigg.palette.text.primary;case "secondary":return t.stigg.palette.text.secondary;default:return e}};var Pl={};gC(Pl,{Add:()=>em,Addons:()=>Pp,ArrowForward:()=>Yp,BillingInfoCustomer:()=>Tp,Check:()=>Kp,Close:()=>Xp,ContactSupport:()=>wp,Coupon:()=>Jp,CreditCard:()=>_p,DollarCoin:()=>Mp,EntitlementCheck:()=>rm,MiniSchedule:()=>Sr,OutlinedCheckedCircle:()=>Wp,OutlinedCheckedCircleDisabled:()=>Gp,OutlinedCircle:()=>Hp,PayAsYouGoCharge:()=>Qp,PaymentMethod:()=>Vp,Promotions:()=>Fp,Remove:()=>nm,RenewSubscription:()=>Up,Restore:()=>Tr,ScheduleBox:()=>Bp,ScheduleClock:()=>Dp,Trash:()=>Op});var SC=e=>jsxRuntime.jsxs("svg",A(S({width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:[jsxRuntime.jsxs("g",{clipPath:"url(#clip0_834_118930)",children:[jsxRuntime.jsx("path",{d:"M12 6.85712V17.1428",stroke:"#7586B0",strokeWidth:1.71429,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx("path",{d:"M6.85712 12H17.1428",stroke:"#7586B0",strokeWidth:1.71429,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx("path",{d:"M18 0.857117H5.99997C3.15966 0.857117 0.857117 3.15966 0.857117 5.99997V18C0.857117 20.8404 3.15966 23.1428 5.99997 23.1428H18C20.8404 23.1428 23.1428 20.8404 23.1428 18V5.99997C23.1428 3.15966 20.8404 0.857117 18 0.857117Z",stroke:"#7586B0",strokeWidth:1.71429,strokeLinecap:"round",strokeLinejoin:"round"})]}),jsxRuntime.jsx("defs",{children:jsxRuntime.jsx("clipPath",{id:"clip0_834_118930",children:jsxRuntime.jsx("rect",{width:24,height:24,fill:"white"})})})]})),Pp=SC;var TC=e=>jsxRuntime.jsxs("svg",A(S({width:36,height:36,viewBox:"0 0 36 36",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:[jsxRuntime.jsx("rect",{width:36,height:36,rx:10,fill:"#F5F6F9"}),jsxRuntime.jsx("path",{d:"M26 27V25C26 22.7909 24.2091 21 22 21H14C11.7909 21 10 22.7909 10 25V27",stroke:"#7586B0",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M18 17C20.2091 17 22 15.2091 22 13C22 10.7909 20.2091 9 18 9C15.7909 9 14 10.7909 14 13C14 15.2091 15.7909 17 18 17Z",stroke:"#7586B0",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx("defs",{children:jsxRuntime.jsxs("linearGradient",{id:"paint0_linear_67_8545",x1:35.0204,y1:1.22449,x2:0,y2:36,gradientUnits:"userSpaceOnUse",children:[jsxRuntime.jsx("stop",{stopColor:"#56ACF6"}),jsxRuntime.jsx("stop",{offset:1,stopColor:"#1559E6"})]})})]})),Tp=TC;var kC=e=>jsxRuntime.jsxs("svg",A(S({width:36,height:36,viewBox:"0 0 36 36",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:[jsxRuntime.jsx("rect",{width:36,height:36,rx:10,fill:"#F5F6F9"}),jsxRuntime.jsx("path",{d:"M27 18.22C27 12.73 22.74 9 18 9C13.31 9 9 12.65 9 18.28C8.4 18.62 8 19.26 8 20V22C8 23.1 8.9 24 10 24H11V17.9C11 14.03 14.13 10.9 18 10.9C21.87 10.9 25 14.03 25 17.9V25H17V27H25C26.1 27 27 26.1 27 25V23.78C27.59 23.47 28 22.86 28 22.14V19.84C28 19.14 27.59 18.53 27 18.22Z",fill:"#7586B0"}),jsxRuntime.jsx("path",{d:"M15 20C15.5523 20 16 19.5523 16 19C16 18.4477 15.5523 18 15 18C14.4477 18 14 18.4477 14 19C14 19.5523 14.4477 20 15 20Z",fill:"#7586B0"}),jsxRuntime.jsx("path",{d:"M21 20C21.5523 20 22 19.5523 22 19C22 18.4477 21.5523 18 21 18C20.4477 18 20 18.4477 20 19C20 19.5523 20.4477 20 21 20Z",fill:"#7586B0"}),jsxRuntime.jsx("path",{d:"M24 17.03C23.52 14.18 21.04 12 18.05 12C15.02 12 11.76 14.51 12.02 18.45C14.49 17.44 16.35 15.24 16.88 12.56C18.19 15.19 20.88 17 24 17.03Z",fill:"#7586B0"}),jsxRuntime.jsx("defs",{children:jsxRuntime.jsxs("linearGradient",{id:"paint0_linear_267_19310",x1:35.0204,y1:1.22449,x2:0,y2:36,gradientUnits:"userSpaceOnUse",children:[jsxRuntime.jsx("stop",{stopColor:"#56ACF6"}),jsxRuntime.jsx("stop",{offset:1,stopColor:"#1559E6"})]})})]})),wp=kC;var wC=e=>jsxRuntime.jsxs("svg",A(S({width:36,height:36,viewBox:"0 0 36 36",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:[jsxRuntime.jsx("rect",{width:36,height:36,rx:10,fill:"#F5F6F9"}),jsxRuntime.jsx("path",{d:"M26 10H10C8.89 10 8.01 10.89 8.01 12L8 24C8 25.11 8.89 26 10 26H26C27.11 26 28 25.11 28 24V12C28 10.89 27.11 10 26 10ZM26 24H10V18H26V24ZM26 14H10V12H26V14Z",fill:"#7586B0"}),jsxRuntime.jsx("defs",{children:jsxRuntime.jsxs("linearGradient",{id:"paint0_linear_67_8556",x1:35.0204,y1:1.22449,x2:0,y2:36,gradientUnits:"userSpaceOnUse",children:[jsxRuntime.jsx("stop",{stopColor:"#56ACF6"}),jsxRuntime.jsx("stop",{offset:1,stopColor:"#1559E6"})]})})]})),_p=wC;var vC=e=>jsxRuntime.jsxs("svg",A(S({width:21,height:20,viewBox:"0 0 21 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:[jsxRuntime.jsxs("g",{clipPath:"url(#clip0_834_120339)",children:[jsxRuntime.jsx("path",{d:"M10.3336 19.2858C15.462 19.2858 19.6193 15.1285 19.6193 10.0001C19.6193 4.87171 15.462 0.714355 10.3336 0.714355C5.20521 0.714355 1.04785 4.87171 1.04785 10.0001C1.04785 15.1285 5.20521 19.2858 10.3336 19.2858Z",stroke:"#7586B0",strokeWidth:1.71429,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx("path",{d:"M12.7649 7.46052C12.6813 7.22393 12.5523 7.0088 12.3883 6.8256C12.0395 6.43592 11.5327 6.19067 10.9685 6.19067H9.4942C8.55517 6.19067 7.79395 6.9519 7.79395 7.89093C7.79395 8.68995 8.3503 9.38116 9.13086 9.5519L11.3756 10.0429C12.25 10.2342 12.8733 11.0091 12.8733 11.9043C12.8733 12.9562 12.0205 13.8097 10.9685 13.8097H9.6987C8.86936 13.8097 8.16382 13.2797 7.90233 12.5399",stroke:"#7586B0",strokeWidth:1.71429,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx("path",{d:"M10.3335 6.19065V4.28589",stroke:"#7586B0",strokeWidth:1.71429,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx("path",{d:"M10.3335 15.7144V13.8096",stroke:"#7586B0",strokeWidth:1.71429,strokeLinecap:"round",strokeLinejoin:"round"})]}),jsxRuntime.jsx("defs",{children:jsxRuntime.jsx("clipPath",{id:"clip0_834_120339",children:jsxRuntime.jsx("rect",{width:20,height:20,fill:"white",transform:"translate(0.333496)"})})})]})),Mp=vC;var _C=e=>jsxRuntime.jsx("svg",A(S({width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.95392 1.03353C7.1196 1.56038 6.82682 2.12178 6.29997 2.28746C5.79034 2.44773 5.30237 2.68036 4.85175 2.98146C3.76168 3.70982 2.95789 4.79361 2.57732 6.04817C2.19675 7.30273 2.26296 8.65044 2.76466 9.86166C3.26637 11.0729 4.17252 12.0727 5.32873 12.6907C6.48494 13.3087 7.81967 13.5067 9.10549 13.2509C10.3913 12.9951 11.5487 12.3014 12.3804 11.288C13.2121 10.2746 13.6666 9.00413 13.6666 7.69312C13.6666 7.14083 14.1144 6.69312 14.6666 6.69312C15.2189 6.69312 15.6666 7.14083 15.6666 7.69312C15.6666 7.92228 15.6564 8.15052 15.6361 8.37721C15.6465 8.44937 15.6492 8.52379 15.6432 8.59952L15.6392 8.64883C15.6298 8.75932 15.6028 8.86407 15.5612 8.96057C15.3409 10.2743 14.7807 11.5158 13.9264 12.5568C12.8012 13.9279 11.2353 14.8664 9.49568 15.2125C7.75603 15.5585 5.95022 15.2906 4.38594 14.4545C2.82166 13.6184 1.59568 12.2657 0.916905 10.627C0.238131 8.98832 0.148554 7.16495 0.663439 5.4676C1.17832 3.77025 2.26581 2.30394 3.74061 1.31852C4.35023 0.911179 5.01049 0.596408 5.69999 0.379577C6.22684 0.213898 6.78824 0.506683 6.95392 1.03353ZM7.56761 1.27284C7.61434 0.722538 8.09832 0.314306 8.64863 0.361031L8.69791 0.365373C9.24791 0.415584 9.65307 0.902149 9.60286 1.45215C9.55265 2.00214 9.06608 2.4073 8.51608 2.35709L8.47942 2.35386C7.92912 2.30714 7.52089 1.82315 7.56761 1.27284ZM12.4186 2.90891C12.8384 2.55014 13.4697 2.59967 13.8284 3.01954C13.8498 3.04454 13.871 3.06967 13.892 3.09494C14.2454 3.51937 14.1878 4.14991 13.7634 4.50329C13.339 4.85667 12.7084 4.79906 12.355 4.37463C12.3395 4.35592 12.3238 4.33731 12.3079 4.31879C11.9492 3.89892 11.9987 3.26769 12.4186 2.90891ZM8.99998 5.33352C8.99998 4.78124 8.55226 4.33352 7.99998 4.33352C7.44769 4.33352 6.99998 4.78124 6.99998 5.33352V8.00019C6.99998 8.55247 7.44769 9.00019 7.99998 9.00019H10.6666C11.2189 9.00019 11.6666 8.55247 11.6666 8.00019C11.6666 7.4479 11.2189 7.00019 10.6666 7.00019H8.99998V5.33352Z",fill:"#7586B0"})})),Sr=_C;var AC=e=>jsxRuntime.jsxs("svg",A(S({width:24,height:25,viewBox:"0 0 24 25",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:[jsxRuntime.jsxs("g",{clipPath:"url(#clip0_834_116282)",children:[jsxRuntime.jsx("path",{d:"M21.4286 5.32483H2.57146C1.62469 5.32483 0.857178 6.09235 0.857178 7.03911V10.4677C0.857178 11.4145 1.62469 12.182 2.57146 12.182H21.4286C22.3754 12.182 23.1429 11.4145 23.1429 10.4677V7.03911C23.1429 6.09235 22.3754 5.32483 21.4286 5.32483Z",stroke:"#7586B0",strokeWidth:1.71429,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx("path",{d:"M21.4287 12.182V21.6106C21.4287 22.0652 21.248 22.5013 20.9266 22.8227C20.6051 23.1442 20.169 23.3249 19.7144 23.3249H4.28582C3.83116 23.3249 3.39513 23.1442 3.07363 22.8227C2.75215 22.5013 2.57153 22.0652 2.57153 21.6106V12.182",stroke:"#7586B0",strokeWidth:1.71429,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx("path",{d:"M12 5.32483V23.3248",stroke:"#7586B0",strokeWidth:1.71429,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx("path",{d:"M17.1429 1.03912L12 5.32484L6.85718 1.03912",stroke:"#7586B0",strokeWidth:1.71429,strokeLinecap:"round",strokeLinejoin:"round"})]}),jsxRuntime.jsx("defs",{children:jsxRuntime.jsx("clipPath",{id:"clip0_834_116282",children:jsxRuntime.jsx("rect",{width:24,height:24,fill:"white",transform:"translate(0 0.182007)"})})})]})),Fp=AC;var MC=e=>jsxRuntime.jsx("svg",A(S({width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:jsxRuntime.jsx("path",{d:"M10.8333 2.5C6.69168 2.5 3.33334 5.85833 3.33334 10H0.833344L4.07501 13.2417L4.13334 13.3583L7.50001 10H5.00001C5.00001 6.775 7.60834 4.16667 10.8333 4.16667C14.0583 4.16667 16.6667 6.775 16.6667 10C16.6667 13.225 14.0583 15.8333 10.8333 15.8333C9.22501 15.8333 7.76668 15.175 6.71668 14.1167L5.53334 15.3C6.89168 16.6583 8.75834 17.5 10.8333 17.5C14.975 17.5 18.3333 14.1417 18.3333 10C18.3333 5.85833 14.975 2.5 10.8333 2.5ZM10 6.66667V10.8333L13.5667 12.95L14.1667 11.9417L11.25 10.2083V6.66667H10Z",fill:"#6678A7"})})),Tr=MC;var IC=e=>jsxRuntime.jsxs("svg",A(S({width:36,height:36,viewBox:"0 0 36 36",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:[jsxRuntime.jsx("rect",{width:36,height:36,rx:10,fill:"url(#paint0_linear_834_118583)"}),jsxRuntime.jsx("rect",{width:36,height:36,rx:10,fill:"#F5F6F9"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.9539 7.70028C16.1196 8.22713 15.8268 8.78853 15.3 8.95421C14.4906 9.20875 13.7155 9.57824 12.9999 10.0564C11.2686 11.2132 9.99197 12.9346 9.38754 14.9271C8.78311 16.9196 8.88826 19.0601 9.68509 20.9838C10.4819 22.9075 11.9211 24.4954 13.7574 25.477C15.5938 26.4585 17.7136 26.7729 19.7558 26.3667C21.798 25.9605 23.6362 24.8588 24.9571 23.2492C26.278 21.6396 27 19.6219 27 17.5397C27 16.9874 27.4477 16.5397 28 16.5397C28.5523 16.5397 29 16.9874 29 17.5397C29 17.8969 28.9826 18.2526 28.9483 18.6056C28.9662 18.6949 28.9722 18.7883 28.9645 18.8837L28.9606 18.9309C28.9496 19.0607 28.9143 19.1825 28.8595 19.2924C28.5513 21.2017 27.7432 23.007 26.5031 24.518C24.8886 26.4852 22.642 27.8318 20.146 28.3283C17.65 28.8248 15.059 28.4405 12.8146 27.2408C10.5702 26.0411 8.81122 24.1004 7.83733 21.7492C6.86343 19.398 6.73491 16.7819 7.47366 14.3465C8.21241 11.9112 9.77272 9.80737 11.8887 8.3935C12.7634 7.80905 13.7107 7.35743 14.7 7.04633C15.2269 6.88065 15.7883 7.17343 15.9539 7.70028ZM17.8497 7.95155C17.8964 7.40125 18.3804 6.99302 18.9307 7.03974L18.9779 7.04385C19.528 7.0929 19.9342 7.57861 19.8851 8.12871C19.8361 8.67881 19.3503 9.085 18.8002 9.03595L18.7615 9.03257C18.2112 8.98585 17.8029 8.50186 17.8497 7.95155ZM22.8579 9.19953C23.172 8.74525 23.7949 8.63161 24.2492 8.9457C24.2751 8.96361 24.3009 8.98162 24.3266 8.99974C24.7782 9.31772 24.8865 9.94155 24.5685 10.3931C24.2505 10.8447 23.6267 10.953 23.1751 10.635C23.1541 10.6202 23.1329 10.6054 23.1118 10.5908C22.6575 10.2767 22.5438 9.6538 22.8579 9.19953ZM26.6058 12.8085C27.1045 12.5712 27.7011 12.7831 27.9384 13.2818C27.9519 13.3102 27.9653 13.3387 27.9786 13.3672C28.2116 13.868 27.9946 14.4628 27.4939 14.6958C26.9931 14.9288 26.3983 14.7117 26.1653 14.211L26.1506 14.1796L26.1324 14.1411C25.8951 13.6424 26.1071 13.0458 26.6058 12.8085ZM19 14.0003C19 13.448 18.5523 13.0003 18 13.0003C17.4477 13.0003 17 13.448 17 14.0003V18.0003C17 18.5526 17.4477 19.0003 18 19.0003H22C22.5523 19.0003 23 18.5526 23 18.0003C23 17.448 22.5523 17.0003 22 17.0003H19V14.0003Z",fill:"#7586B0"}),jsxRuntime.jsx("defs",{children:jsxRuntime.jsx("linearGradient",{id:"paint0_linear_834_118583",x1:35.0204,y1:1.22449,x2:0,y2:36,gradientUnits:"userSpaceOnUse"})})]})),Bp=IC;var FC=e=>jsxRuntime.jsx("svg",A(S({width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.95394 1.70028C10.1196 2.22713 9.82684 2.78853 9.29999 2.95421C8.49057 3.20875 7.71555 3.57824 6.99987 4.05644C5.26859 5.21324 3.99197 6.93456 3.38754 8.9271C2.78311 10.9196 2.88826 13.0601 3.68509 14.9838C4.48191 16.9075 5.9211 18.4954 7.75743 19.477C9.59377 20.4585 11.7136 20.7729 13.7558 20.3667C15.798 19.9605 17.6362 18.8588 18.9571 17.2492C20.278 15.6396 21 13.6219 21 11.5397C21 10.9874 21.4477 10.5397 22 10.5397C22.5523 10.5397 23 10.9874 23 11.5397C23 11.8969 22.9826 12.2526 22.9483 12.6056C22.9662 12.6949 22.9722 12.7883 22.9645 12.8837L22.9606 12.9309C22.9496 13.0607 22.9143 13.1825 22.8595 13.2924C22.5513 15.2017 21.7432 17.007 20.5031 18.518C18.8886 20.4852 16.642 21.8318 14.146 22.3283C11.65 22.8248 9.05905 22.4405 6.81464 21.2408C4.57023 20.0411 2.81122 18.1004 1.83733 15.7492C0.863434 13.398 0.734911 10.7819 1.47366 8.34653C2.21241 5.91121 3.77272 3.80737 5.88873 2.3935C6.76341 1.80905 7.71072 1.35743 8.70001 1.04633C9.22686 0.880646 9.78826 1.17343 9.95394 1.70028ZM11.8497 1.95155C11.8964 1.40125 12.3804 0.993017 12.9307 1.03974L12.9779 1.04385C13.528 1.0929 13.9342 1.57861 13.8851 2.12871C13.8361 2.67881 13.3503 3.085 12.8002 3.03595L12.7615 3.03257C12.2112 2.98585 11.8029 2.50186 11.8497 1.95155ZM16.8579 3.19953C17.172 2.74525 17.7949 2.63161 18.2492 2.9457C18.2751 2.96361 18.3009 2.98162 18.3266 2.99974C18.7782 3.31772 18.8865 3.94155 18.5685 4.39311C18.2505 4.84467 17.6267 4.95296 17.1751 4.63498C17.1541 4.62016 17.1329 4.60542 17.1118 4.59078C16.6575 4.27669 16.5438 3.6538 16.8579 3.19953ZM20.6058 6.80846C21.1045 6.57117 21.7011 6.78308 21.9384 7.28179C21.9519 7.3102 21.9653 7.33869 21.9786 7.36723C22.2116 7.86796 21.9946 8.46276 21.4939 8.69577C20.9931 8.92877 20.3983 8.71174 20.1653 8.21101L20.1506 8.17957L20.1324 8.14112C19.8951 7.64241 20.1071 7.04576 20.6058 6.80846ZM13 8.00027C13 7.44798 12.5523 7.00027 12 7.00027C11.4477 7.00027 11 7.44798 11 8.00027V12.0003C11 12.5526 11.4477 13.0003 12 13.0003H16C16.5523 13.0003 17 12.5526 17 12.0003C17 11.448 16.5523 11.0003 16 11.0003H13V8.00027Z",fill:"#7586B0"})})),Dp=FC;var LC=e=>jsxRuntime.jsxs("svg",A(S({width:36,height:36,viewBox:"0 0 36 36",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:[jsxRuntime.jsx("rect",{width:36,height:36,rx:10,fill:"#F5F6F9"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9 12C9 10.8954 9.89543 10 11 10H25C26.1046 10 27 10.8954 27 12V26C27 27.1046 26.1046 28 25 28H11C9.89543 28 9 27.1046 9 26V12Z",stroke:"#7586B0",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx("path",{d:"M22 8V12",stroke:"#7586B0",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx("path",{d:"M14 8V12",stroke:"#7586B0",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx("path",{d:"M9 16H27",stroke:"#7586B0",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx("defs",{children:jsxRuntime.jsxs("linearGradient",{id:"paint0_linear_45_8861",x1:35.0204,y1:1.22449,x2:0,y2:36,gradientUnits:"userSpaceOnUse",children:[jsxRuntime.jsx("stop",{stopColor:"#56ACF6"}),jsxRuntime.jsx("stop",{offset:1,stopColor:"#1559E6"})]})})]})),Up=LC;var BC=e=>jsxRuntime.jsx("svg",A(S({width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:jsxRuntime.jsxs("g",{id:"trash-2",children:[jsxRuntime.jsx("path",{id:"Shape",d:"M3 6H5H21",stroke:"#F88078",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx("path",{id:"Shape_2",d:"M20 6C20 5.44772 19.5523 5 19 5C18.4477 5 18 5.44772 18 6H20ZM6 6C6 5.44772 5.55228 5 5 5C4.44772 5 4 5.44772 4 6H6ZM7 6C7 6.55228 7.44772 7 8 7C8.55228 7 9 6.55228 9 6H7ZM15 6C15 6.55228 15.4477 7 16 7C16.5523 7 17 6.55228 17 6H15ZM18 6V20H20V6H18ZM18 20C18 20.5523 17.5523 21 17 21V23C18.6569 23 20 21.6569 20 20H18ZM17 21H7V23H17V21ZM7 21C6.44772 21 6 20.5523 6 20H4C4 21.6569 5.34315 23 7 23V21ZM6 20V6H4V20H6ZM9 6V4H7V6H9ZM9 4C9 3.44772 9.44772 3 10 3V1C8.34315 1 7 2.34315 7 4H9ZM10 3H14V1H10V3ZM14 3C14.5523 3 15 3.44772 15 4H17C17 2.34315 15.6569 1 14 1V3ZM15 4V6H17V4H15Z",fill:"#F88078"}),jsxRuntime.jsx("path",{id:"Shape_3",d:"M10 11V17",stroke:"#F88078",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx("path",{id:"Shape_4",d:"M14 11V17",stroke:"#F88078",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})]})})),Op=BC;var DC=e=>jsxRuntime.jsxs("svg",A(S({width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:[jsxRuntime.jsx("path",{d:"M21.1667 4H2.83333C1.82081 4 1 4.89543 1 6V18C1 19.1046 1.82081 20 2.83333 20H21.1667C22.1792 20 23 19.1046 23 18V6C23 4.89543 22.1792 4 21.1667 4Z",fill:"#C6C6C7"}),jsxRuntime.jsx("path",{opacity:.3,d:"M19.75 16.4286H17.5C17.0125 16.4286 16.75 16.2 16.75 15.6667C16.75 15.1334 17.0125 14.9048 17.5 14.9048H19.75C20.2375 14.9048 20.5 15.1334 20.5 15.6667C20.5 16.2 20.2375 16.4286 19.75 16.4286ZM15.25 16.4286H13C12.5125 16.4286 12.25 16.2 12.25 15.6667C12.25 15.1334 12.5125 14.9048 13 14.9048H15.25C15.7375 14.9048 16 15.1334 16 15.6667C16 16.2 15.7375 16.4286 15.25 16.4286ZM10.75 16.4286H8.5C8.0125 16.4286 7.75 16.2 7.75 15.6667C7.75 15.1334 8.0125 14.9048 8.5 14.9048H10.75C11.2375 14.9048 11.5 15.1334 11.5 15.6667C11.5 16.2 11.2375 16.4286 10.75 16.4286ZM6.25 16.4286H4C3.5125 16.4286 3.25 16.2 3.25 15.6667C3.25 15.1334 3.5125 14.9048 4 14.9048H6.25C6.7375 14.9048 7 15.1334 7 15.6667C7 16.2 6.7375 16.4286 6.25 16.4286Z",fill:"black"})]})),Vp=DC;var UC=e=>jsxRuntime.jsx("svg",A(S({width:21,height:20,viewBox:"0 0 21 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:jsxRuntime.jsx("circle",{cx:10.333,cy:10,r:9,fill:"white",stroke:"#327EEE",strokeWidth:2})})),Hp=UC;var OC=e=>jsxRuntime.jsx("svg",A(S({width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:jsxRuntime.jsxs("g",{id:"Group 16159",children:[jsxRuntime.jsx("circle",{id:"Ellipse 5",cx:10,cy:10,r:9.25,fill:"#327EEE",stroke:"#327EEE",strokeWidth:1.5}),jsxRuntime.jsx("path",{id:"Shape",d:"M5 10.3636L8.63667 14L12.637 10L14.6372 8",stroke:"white",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})]})})),Wp=OC;var VC=e=>jsxRuntime.jsx("svg",A(S({width:21,height:20,viewBox:"0 0 21 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:jsxRuntime.jsxs("g",{id:"Stepper indicators",children:[jsxRuntime.jsx("circle",{id:"Ellipse 5",cx:10.667,cy:10,r:9.25,fill:"#B3BCD3",stroke:"#B3BCD3",strokeWidth:1.5}),jsxRuntime.jsx("path",{id:"Shape",d:"M5.66699 10.3636L9.30366 14L13.304 10L15.3042 8",stroke:"white",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})]})})),Gp=VC;var HC=e=>jsxRuntime.jsx("svg",A(S({width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:jsxRuntime.jsx("path",{d:"M9 3L7.9425 4.0575L12.1275 8.25H3V9.75H12.1275L7.9425 13.9425L9 15L15 9L9 3Z",fill:"white"})})),Yp=HC;var WC=e=>jsxRuntime.jsx("svg",A(S({width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:jsxRuntime.jsx("path",{d:"M15.8337 5.34199L14.6587 4.16699L10.0003 8.82533L5.34199 4.16699L4.16699 5.34199L8.82533 10.0003L4.16699 14.6587L5.34199 15.8337L10.0003 11.1753L14.6587 15.8337L15.8337 14.6587L11.1753 10.0003L15.8337 5.34199Z",fill:"#327EEE"})})),Xp=WC;var GC=e=>jsxRuntime.jsx("svg",A(S({width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:jsxRuntime.jsx("g",{id:"check",children:jsxRuntime.jsx("path",{id:"Shape",d:"M20 7L9 18L4 13",stroke:"#F5F6F9",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})})),Kp=GC;var jC=e=>jsxRuntime.jsxs("svg",A(S({width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:[jsxRuntime.jsxs("g",{clipPath:"url(#clip0_1889_12169)",children:[jsxRuntime.jsx("path",{d:"M11.4286 7.42578L8 13.1401",stroke:"#7586B0",strokeWidth:1.71429,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx("path",{d:"M14.857 13.1412C15.3274 12.0123 15.5118 10.7848 15.3938 9.56751C15.2758 8.35027 14.8592 7.18097 14.1808 6.16341C13.5024 5.14585 12.5833 4.31152 11.5051 3.73446C10.4268 3.1574 9.22281 2.85547 7.99986 2.85547C6.77691 2.85547 5.57288 3.1574 4.49463 3.73446C3.41639 4.31152 2.49729 5.14585 1.81892 6.16341C1.14055 7.18097 0.723889 8.35027 0.605928 9.56751C0.487968 10.7848 0.672354 12.0123 1.14272 13.1412H14.857Z",stroke:"#7586B0",strokeWidth:1.71429,strokeLinecap:"round",strokeLinejoin:"round"})]}),jsxRuntime.jsx("defs",{children:jsxRuntime.jsx("clipPath",{id:"clip0_1889_12169",children:jsxRuntime.jsx("rect",{width:16,height:16,fill:"white"})})})]})),Qp=jC;var YC=e=>jsxRuntime.jsx("svg",A(S({width:16,height:16,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:jsxRuntime.jsxs("g",{id:"tag--tags-bookmark-favorite",children:[jsxRuntime.jsx("path",{id:"Vector",d:"M1.26995 11.9426L6.05743 16.7301C6.2305 16.903 6.4651 17.0001 6.7097 17.0001C6.95431 17.0001 7.18891 16.903 7.36198 16.7301L16.8631 7.22895C16.9108 7.18332 16.9478 7.12758 16.9712 7.06583C16.9946 7.00408 17.0039 6.93787 16.9985 6.87205L16.2724 2.15839C16.2664 2.04607 16.2192 1.93992 16.1396 1.86038C16.0601 1.78085 15.9539 1.73357 15.8416 1.72764L11.128 1.00152C11.0622 0.996055 10.9959 1.00538 10.9342 1.0288C10.8724 1.05222 10.8167 1.08916 10.7711 1.1369L1.26995 10.638C1.09709 10.8111 1 11.0457 1 11.2903C1 11.5349 1.09709 11.7695 1.26995 11.9426Z",stroke:"#327EEE",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx("path",{id:"Vector_2",d:"M12.5548 6.05884C12.3916 6.05884 12.2351 5.99401 12.1197 5.87861C12.0043 5.76321 11.9395 5.60669 11.9395 5.44348C11.9395 5.28028 12.0043 5.12376 12.1197 5.00836C12.2351 4.89296 12.3916 4.82812 12.5548 4.82812C12.718 4.82812 12.8745 4.89296 12.9899 5.00836C13.1053 5.12376 13.1702 5.28028 13.1702 5.44348C13.1702 5.60669 13.1053 5.76321 12.9899 5.87861C12.8745 5.99401 12.718 6.05884 12.5548 6.05884Z",stroke:"#327EEE",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})]})})),Jp=YC;var XC=e=>jsxRuntime.jsx("svg",A(S({width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:jsxRuntime.jsx("path",{d:"M12 3V21.0001M3 11.9446H21",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})),em=XC;var KC=e=>jsxRuntime.jsx("svg",A(S({width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:jsxRuntime.jsx("path",{d:"M3 12H21",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})),nm=KC;var qC=e=>jsxRuntime.jsx("svg",A(S({width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:jsxRuntime.jsx("path",{d:"M3 11.1429L9.71572 17.8586C9.79383 17.9367 9.92046 17.9367 9.99856 17.8586L21.8571 6",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round"})})),rm=qC;var JC=y.div`
12
- ${({$pathColor:e})=>e&&react.css`
13
- path {
14
- fill: ${e};
15
- }
16
- `}
17
-
18
- ${({$rectColor:e})=>e&&react.css`
19
- svg rect {
20
- fill: ${e};
21
- }
22
- `}
23
-
24
-
25
- ${({$strokeColor:e})=>e&&react.css`
26
- g {
27
- stroke: ${e};
28
- }
29
- `}
30
- `;function mt({icon:e,className:t,style:o,svgPathColor:n,svgRectColor:i,svgStrokeColor:r}){let a=Pl[e],s=react.useTheme();return jsxRuntime.jsx(JC,{className:t,style:o,$pathColor:Pr(n,s),$rectColor:Pr(i,s),$strokeColor:Pr(r,s),children:jsxRuntime.jsx(a,{})})}var t2=y(P)`
31
- margin: 0;
32
- `,e2=y.div`
3
+ `,pm=chunkMY4ZIUAV_cjs_js.e.div`
33
4
  display: flex;
34
5
  align-items: center;
35
6
  gap: 16px;
36
- `,o2=y.div`
7
+ `,mm=chunkMY4ZIUAV_cjs_js.e.div`
37
8
  display: flex;
38
9
  align-items: center;
39
10
  flex-shrink: 0;
40
- `,n2=y(mt)`
11
+ `,um=chunkMY4ZIUAV_cjs_js.e(chunkMY4ZIUAV_cjs_js.i)`
41
12
  width: 24px;
42
13
  height: 24px;
43
14
  color: ${({theme:e})=>e.stigg.palette.primary};
44
- `;function kr({displayName:e,className:t}){return jsxRuntime.jsxs(e2,{className:`stigg-entitlement-row-container ${t}`,children:[jsxRuntime.jsx(o2,{children:jsxRuntime.jsx(n2,{icon:"EntitlementCheck",className:"stigg-entitlement-row-icon"})}),jsxRuntime.jsx(t2,{className:"stigg-entitlement-name",variant:"h6",color:"secondary",children:e})]})}function r2(e){if(!e)return "";switch(e){case ah.EntitlementResetPeriod.Day:return "per day";case ah.EntitlementResetPeriod.Hour:return "per hour";case ah.EntitlementResetPeriod.Week:return "per week";case ah.EntitlementResetPeriod.Month:return "per month";case ah.EntitlementResetPeriod.Year:return "per year";default:return ""}}function a2({hasUnlimitedUsage:e,feature:t,resetPeriod:o,usageLimit:n,minUnitQuantity:i,maxUnitQuantity:r,isCustom:a,enumValues:s}){let l=i||r,c=`${o&&n?`${r2(o)}`:""}`;if(s){let d=s.length===1?t==null?void 0:t.featureUnits:t==null?void 0:t.featureUnitsPlural;return `${s.length} ${d}`}if(e)return `Unlimited ${t==null?void 0:t.featureUnitsPlural}`;if(a)return `Custom ${t==null?void 0:t.featureUnitsPlural}`;if(n){let d=n===1?t==null?void 0:t.featureUnits:t==null?void 0:t.featureUnitsPlural;return `${At(n)} ${d} ${c}`}return l?Cr(i,r,t==null?void 0:t.featureUnitsPlural):t==null?void 0:t.displayName}function kl(e){let r=e,{displayNameOverride:t,feature:o}=r,n=ot(r,["displayNameOverride","feature"]),i=t||a2(S({feature:o},n))||"";return jsxRuntime.jsx(kr,{displayName:i,className:`stigg-entitlement-${o==null?void 0:o.refId}`})}function l2(e){var a,s;let{amount:t,customCurrency:o,displayNameOverride:n}=e,i=t!=null?t:0;if(n)return n;let r=i===1?(a=o.units)==null?void 0:a.singular:(s=o.units)==null?void 0:s.plural;return `${At(i)} ${r||o.displayName}`}function sm({entitlement:e}){let t=l2(e);return jsxRuntime.jsx(kr,{displayName:t,className:`stigg-credit-entitlement-${e.id}`})}function p2(e){return e.__typename==="PackageCreditEntitlement"}var m2=y.div`
15
+ `;function fo({displayName:e,className:t}){return jsxRuntime.jsxs(pm,{className:`stigg-entitlement-row-container ${t}`,children:[jsxRuntime.jsx(mm,{children:jsxRuntime.jsx(um,{icon:"EntitlementCheck",className:"stigg-entitlement-row-icon"})}),jsxRuntime.jsx(dm,{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 ym({hasUnlimitedUsage:e,feature:t,resetPeriod:o,usageLimit:r,minUnitQuantity:n,maxUnitQuantity:i,isCustom:s,enumValues:l}){let a=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(s)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 `${ie(r)} ${u} ${c}`}return a?go(n,i,t==null?void 0:t.featureUnitsPlural):t==null?void 0:t.displayName}function tn(e){let i=e,{displayNameOverride:t,feature:o}=i,r=chunkMY4ZIUAV_cjs_js.c(i,["displayNameOverride","feature"]),n=t||ym(chunkMY4ZIUAV_cjs_js.a({feature:o},r))||"";return jsxRuntime.jsx(fo,{displayName:n,className:`stigg-entitlement-${o==null?void 0:o.refId}`})}function Cm(e){var s,l;let{amount:t,customCurrency:o,displayNameOverride:r}=e,n=t!=null?t:0;if(r)return r;let i=n===1?(s=o.units)==null?void 0:s.singular:(l=o.units)==null?void 0:l.plural;return `${ie(n)} ${i||o.displayName}`}function ka({entitlement:e}){let t=Cm(e);return jsxRuntime.jsx(fo,{displayName:t,className:`stigg-credit-entitlement-${e.id}`})}function Sm(e){return e.__typename==="PackageCreditEntitlement"}var Tm=chunkMY4ZIUAV_cjs_js.e.div`
45
16
  display: flex;
46
17
  flex-direction: column;
47
18
  gap: 16px;
48
- `;function h2(e,t,o){if(t.entitlementsTitle)return t.entitlementsTitle(e);let n=o?"Includes:":"";return e.basePlan&&(n=`Everything in ${e.basePlan.displayName}${o?", plus:":""}`),n}function cm({plan:e,billingPeriod:t,paywallLocale:o}){var s;let i=(((s=e.pricePoints)==null?void 0:s.filter(l=>l.billingPeriod===t))||[]).filter(l=>(l==null?void 0:l.minUnitQuantity)&&(l==null?void 0:l.minUnitQuantity)>1||(l==null?void 0:l.maxUnitQuantity)).map(l=>{var c;return jsxRuntime.jsx(kl,{feature:l!=null&&l.feature?{refId:l.feature.featureId,featureUnits:l.feature.units,featureUnitsPlural:l.feature.unitsPlural,unitQuantity:l.feature.unitQuantity,displayName:l.feature.displayName}:null,minUnitQuantity:l==null?void 0:l.minUnitQuantity,maxUnitQuantity:l==null?void 0:l.maxUnitQuantity},`priceUnitEntitlement-${(c=l==null?void 0:l.feature)==null?void 0:c.displayName}`)}),r=nf__default.default(e.packageEntitlements).filter(l=>l.isGranted).filter(l=>{var c;return !((c=l.hiddenFromWidgets)!=null&&c.includes(ah.WidgetType.Paywall))}),a=i.length>0||r.length>0;return jsxRuntime.jsxs(m2,{className:"stigg-plan-entitlements-container",children:[jsxRuntime.jsx(P,{className:"stigg-plan-entitlements-title",color:"secondary",variant:"h6",bold:true,children:h2(e,o,a)}),i,r.map(l=>p2(l)?jsxRuntime.jsx(sm,{entitlement:l},lm(l)):jsxRuntime.jsx(kl,{displayNameOverride:l.displayNameOverride,feature:l.feature,resetPeriod:l.resetPeriod,hasUnlimitedUsage:l.hasUnlimitedUsage,usageLimit:l.usageLimit,enumValues:l.enumValues,isCustom:l.isCustom},lm(l)))]})}function lm(e){return `${e.__typename}:${e.id}`}var wl=(l=>(l.START_TRIAL="START_TRIAL",l.UPGRADE_TRIAL_TO_PAID="UPGRADE_TRIAL_TO_PAID",l.REQUEST_CUSTOM_PLAN_ACCESS="REQUEST_CUSTOM_PLAN_ACCESS",l.CHANGE_BILLING_PERIOD="CHANGE_BILLING_PERIOD",l.CHANGE_UNIT_QUANTITY="CHANGE_UNIT_QUANTITY",l.UPGRADE_PLAN="UPGRADE_PLAN",l.DOWNGRADE_PLAN="DOWNGRADE_PLAN",l.CANCEL_SCHEDULED_UPDATES="CANCEL_SCHEDULED_UPDATES",l))(wl||{});var vr=e=>({left:"flex-start",center:"center",right:"flex-end"})[e],dm=e=>{var c,d,u;let t=Do__default.default(((c=e==null?void 0:e.palette)==null?void 0:c.primary)||"#327EEE"),o=Do__default.default(((u=(d=e==null?void 0:e.palette)==null?void 0:d.text)==null?void 0:u.primary)||"#001E6C"),n=Do__default.default("#4CAF50"),i=Do__default.default("#f44336"),r=Do__default.default("#ff9800"),a=Do__default.default("#2196f3"),s=Do__default.default("#9e9e9e"),l={palette:{primary:t.hex(),primaryDark:t.darken(.3).hex(),primaryLight:t.alpha(.5).toString(),backgroundPaper:"#FFFFFF",backgroundHighlight:"#F5F6F9",backgroundSection:t.alpha(.1).toString(),backgroundButton:t.alpha(.08).toString(),outlinedBorder:"#C4CBDD",outlinedRestingBorder:t.alpha(.5).toString(),outlinedHoverBackground:t.lightness(95).hex(),switchBorder:t.lighten(.1).hex(),switchFill:t.lighten(.5).hex(),switchHandle:t.hex(),warning:"#ed6c02",error:i.hex(),errorDark:i.darken(.3).hex(),success:n.hex(),successDark:n.darken(.3).hex(),white:"#FFFFFF",text:{primary:o.hex(),secondary:o.alpha(.75).toString(),tertiary:o.alpha(.5).toString(),disabled:o.alpha(.35).toString()},statusChips:{success:{background:n.alpha(.15).toString(),text:n.darken(.2).hex(),border:"transparent"},warning:{background:r.alpha(.15).toString(),text:r.darken(.2).hex(),border:"transparent"},error:{background:i.alpha(.15).toString(),text:i.darken(.1).hex(),border:"transparent"},info:{background:a.alpha(.15).toString(),text:a.darken(.2).hex(),border:"transparent"},neutral:{background:s.alpha(.15).toString(),text:s.darken(.2).hex(),border:"transparent"}},progress:{background:"#e0e0e0",low:"#4caf50",medium:"#ff9800",high:"#f44336"}},layout:{planMinWidth:"330px",planMaxWidth:"330px",planMargin:"20px",planPadding:"40px",ctaAlignment:"left",headerAlignment:"left",descriptionAlignment:"left",descriptionMinHeight:"80px",switchBottomSpacing:"40px"},shadows:{light:"0px 2px 1px -1px rgba(0, 0, 0, 0.2), 0px 1px 1px rgba(0, 0, 0, 0.14), 0px 1px 3px rgba(0, 0, 0, 0.12)",popover:"0px 4px 5px -2px rgba(0, 30, 108, 0.2), 0px 7px 10px 1px rgba(0, 30, 108, 0.14), 0px 2px 16px 1px rgba(0, 30, 108, 0.12)"},border:{radius:"10px"},typography:{fontFamily:"custom-font, DM Sans, sans-serif",h1:{fontSize:"32px",fontWeight:"bold",semanticElement:"h1"},h2:{fontSize:"24px",fontWeight:"normal",semanticElement:"h2"},h3:{fontSize:"16px",fontWeight:"normal",semanticElement:"h3"},body:{fontSize:"14px",fontWeight:"normal",semanticElement:"p"},caption:{fontSize:"12px",fontWeight:"normal",semanticElement:"span"}},customCss:""};return f2__default.default(l,e)};var _l=e=>fc__default.default.utc(e).format("MMMM Do, yyyy");function _r({scheduledUpdate:e,subscriptionPrices:t,billingPeriodRange:o,options:n={}}){var a,s;if(!e)return {};let{withDate:i,postfix:r=""}=n;switch(e.subscriptionScheduleType){case ah.SubscriptionScheduleType.Downgrade:{let l=i;return lodash.isNil(l)&&(o!=null&&o.end)&&(l=!fc__default.default(e.scheduledExecutionTime).isSame(o==null?void 0:o.end,"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"]})," ",l?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:["on ",_l(e.scheduledExecutionTime)]}):r,"."]}),line2:"Until then you still have access to your current plan."}}case ah.SubscriptionScheduleType.BillingPeriod:{let l=e.scheduleVariables;return {line1:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:["Your billing cycle will change to ",jsxRuntime.jsx("b",{children:(s=l.billingPeriod)==null?void 0:s.toLocaleLowerCase()})," ",i?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:["on ",_l(e.scheduledExecutionTime)]}):r,"."]})}}case ah.SubscriptionScheduleType.UnitAmount:{let l=e.scheduleVariables,d=lodash.compact(t==null?void 0:t.map(({feature:f})=>f)).find(({id:f})=>f===l.featureId),{featureUnits:u,featureUnitsPlural:p}=d||{},h=l.newUnitAmount===1?u:p,m=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:["Your subscription will be updated to ",jsxRuntime.jsx("b",{children:l.newUnitAmount})," ",h," ",i?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:["on ",_l(e.scheduledExecutionTime)]}):r,"."]}),g=`Until then you still have access to your current ${u} count.`;return {line1:m,line2:g}}default:return {}}}function gm(e){return e.feature&&(e.feature.unitQuantity!==1?e.feature.unitsPlural:e.feature.units)||""}function Il(e,t){let o=[...e];o.sort((n,i)=>n.upTo?i.upTo?n.upTo-i.upTo:-1:1);for(let n of o)if(n.upTo&&t<=n.upTo)return n;return o[o.length-1]}function hm(e,t,o){return t===ah.BillingPeriod.Annually&&o?e/12:e}function Ml(e,t,o,n){let i=0;if(e.unitPrice){let r=hm(e.unitPrice.amount,o,n);i+=r*t;}return e.flatPrice&&(i+=hm(e.flatPrice.amount,o,n)),i}function El(e,t,o,n){let i=t,r=0,a=0,s=[];for(;i>0&&a<e.length;){let c=e[a],{upTo:d}=c;if(Ar__default.default(d))s.push({unitQuantity:i,amount:Ml(c,i,o,n)}),i=0;else {let u=d-r,p=Math.min(i,u);s.push({unitQuantity:p,amount:Ml(c,p,o,n)}),i-=p,r=d;}a+=1;}let l=lodash.sum(s.map(({amount:c})=>c));return {breakdown:s,total:l}}function Cn(e,t,o,n){if(!e.tiers)return 0;switch(e.tiersMode){case ah.TiersMode.Volume:{let i=Il(e.tiers,t);return Ml(i,t,o,n)}case ah.TiersMode.Graduated:return El(e.tiers,t,o,n).total;default:return 0}}function fi(e){return e==null?void 0:e.some(({unitPrice:t,upTo:o})=>t&&!Ar__default.default(o))}function fm(e){return e==null?void 0:e.every(({unitPrice:t,upTo:o})=>!t||Ar__default.default(o))}function ym(e,t){return (e==null?void 0:e[0].upTo)&&t<=e[0].upTo}function Mr({plan:e,billingPeriod:t,currentSubscription:o,currentSubscriptionOverride:n,selectDefaultTierIndex:i}){let r=e.pricePoints.filter(a=>a.billingPeriod===t&&a.isTieredPrice);if(r.length===1){let[a]=r,{featureId:s}=a.feature,l=i?i({plan:e}):0,c=a.tiers[l],d=fi(a.tiers)?1:c.upTo||1;if(o&&o.plan.id===e.id){let p=o.prices.find(h=>{var m;return h.pricingModel===ah.BillingModel.PerUnit&&h.tiersMode&&((m=h.feature)==null?void 0:m.featureId)===s});p&&(d=p.feature.unitQuantity||1);}if((n==null?void 0:n.planId)===e.id){let p=n.billableFeatures.find(h=>h.featureId===s);p&&(d=p.quantity);}let u={};return u[s]=d,u}return {}}function xm({perUnitQuantityByFeature:e,plan:t,currentSubscription:o,currentSubscriptionOverride:n}){var d,u;if(!o)return 0;let i=o.prices.find(p=>p.pricingModel===ah.BillingModel.PerUnit&&p.tiersMode),r=t.id===(n==null?void 0:n.planId);if(r&&(i=(d=t.pricePoints.find(p=>p.pricingModel===ah.BillingModel.PerUnit&&p.tiersMode))!=null?d:i),!i)return 0;let{featureId:a,unitQuantity:s}=i.feature,l=s;if(r){let p=(u=n==null?void 0:n.billableFeatures)==null?void 0:u.find(h=>h.featureId===a);p&&(l=p.quantity);}if(Ar__default.default(l))return 0;let c=e[a];return c<l?-1:c>l?1:0}var w2=y(S2__default.default)`
19
+ `;function km(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 Ba({plan:e,billingPeriod:t,paywallLocale:o}){var l;let n=(((l=e.pricePoints)==null?void 0:l.filter(a=>a.billingPeriod===t))||[]).filter(a=>(a==null?void 0:a.minUnitQuantity)&&(a==null?void 0:a.minUnitQuantity)>1||(a==null?void 0:a.maxUnitQuantity)).map(a=>{var c;return jsxRuntime.jsx(tn,{feature:a!=null&&a.feature?{refId:a.feature.featureId,featureUnits:a.feature.units,featureUnitsPlural:a.feature.unitsPlural,unitQuantity:a.feature.unitQuantity,displayName:a.feature.displayName}:null,minUnitQuantity:a==null?void 0:a.minUnitQuantity,maxUnitQuantity:a==null?void 0:a.maxUnitQuantity},`priceUnitEntitlement-${(c=a==null?void 0:a.feature)==null?void 0:c.displayName}`)}),i=ac__default.default(e.packageEntitlements).filter(a=>a.isGranted).filter(a=>{var c;return !((c=a.hiddenFromWidgets)!=null&&c.includes(jsClientSdk.WidgetType.Paywall))}),s=n.length>0||i.length>0;return jsxRuntime.jsxs(Tm,{className:"stigg-plan-entitlements-container",children:[jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.f,{className:"stigg-plan-entitlements-title",color:"secondary",variant:"h6",bold:true,children:km(e,o,s)}),n,i.map(a=>Sm(a)?jsxRuntime.jsx(ka,{entitlement:a},wa(a)):jsxRuntime.jsx(tn,{displayNameOverride:a.displayNameOverride,feature:a.feature,resetPeriod:a.resetPeriod,hasUnlimitedUsage:a.hasUnlimitedUsage,usageLimit:a.usageLimit,enumValues:a.enumValues,isCustom:a.isCustom},wa(a)))]})}function wa(e){return `${e.__typename}:${e.id}`}var on=(a=>(a.START_TRIAL="START_TRIAL",a.UPGRADE_TRIAL_TO_PAID="UPGRADE_TRIAL_TO_PAID",a.REQUEST_CUSTOM_PLAN_ACCESS="REQUEST_CUSTOM_PLAN_ACCESS",a.CHANGE_BILLING_PERIOD="CHANGE_BILLING_PERIOD",a.CHANGE_UNIT_QUANTITY="CHANGE_UNIT_QUANTITY",a.UPGRADE_PLAN="UPGRADE_PLAN",a.DOWNGRADE_PLAN="DOWNGRADE_PLAN",a.CANCEL_SCHEDULED_UPDATES="CANCEL_SCHEDULED_UPDATES",a))(on||{});ho__default.default.extend(Bm__default.default);ho__default.default.extend(Am__default.default);ho__default.default.extend(Im__default.default);var Q=ho__default.default;var nn=e=>Q.utc(e).format("MMMM Do, YYYY");function Co(e){return String(e.scheduledExecutionTime)}function Em(e){return e!=null&&e.end?String(e.end):void 0}function xo({scheduledUpdate:e,subscriptionPrices:t,billingPeriodRange:o,options:r={}}){var s,l;if(!e)return {};let{withDate:n,postfix:i=""}=r;switch(e.subscriptionScheduleType){case jsClientSdk.SubscriptionScheduleType.Downgrade:{let a=n,c=Em(o);return Po__default.default(a)&&c&&(a=!Q(Co(e)).isSame(Q(c),"day")),{line1:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:["Your subscription will be downgraded to the ",jsxRuntime.jsxs("b",{children:[(s=e.targetPackage)==null?void 0:s.displayName," plan"]})," ",a?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:["on ",nn(Co(e))]}):i,"."]}),line2:"Until then you still have access to your current plan."}}case jsClientSdk.SubscriptionScheduleType.BillingPeriod:{let a=e.scheduleVariables;return {line1:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:["Your billing cycle will change to ",jsxRuntime.jsx("b",{children:(l=a.billingPeriod)==null?void 0:l.toLocaleLowerCase()})," ",n?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:["on ",nn(Co(e))]}):i,"."]})}}case jsClientSdk.SubscriptionScheduleType.UnitAmount:{let a=e.scheduleVariables,u=ac__default.default(t==null?void 0:t.map(({feature:C})=>C)).find(({id:C})=>C===a.featureId),{featureUnits:f,featureUnitsPlural:p}=u||{},h=a.newUnitAmount===1?f:p,g=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:["Your subscription will be updated to ",jsxRuntime.jsx("b",{children:a.newUnitAmount})," ",h," ",n?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:["on ",nn(Co(e))]}):i,"."]}),y=`Until then you still have access to your current ${f} count.`;return {line1:g,line2:y}}default:return {}}}function va(e){return e.feature&&(e.feature.unitQuantity!==1?e.feature.unitsPlural:e.feature.units)||""}function ln(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 Fa(e,t,o){return t===jsClientSdk.BillingPeriod.Annually&&o?e/12:e}function sn(e,t,o,r){let n=0;if(e.unitPrice){let i=Fa(e.unitPrice.amount,o,r);n+=i*t;}return e.flatPrice&&(n+=Fa(e.flatPrice.amount,o,r)),n}function cn(e,t,o,r){let n=t,i=0,s=0,l=[];for(;n>0&&s<e.length;){let c=e[s],{upTo:u}=c;if(Po__default.default(u))l.push({unitQuantity:n,amount:sn(c,n,o,r)}),n=0;else {let f=u-i,p=Math.min(n,f);l.push({unitQuantity:p,amount:sn(c,p,o,r)}),n-=p,i=u;}s+=1;}let a=Nm__default.default(l.map(({amount:c})=>c));return {breakdown:l,total:a}}function ht(e,t,o,r){if(!e.tiers)return 0;switch(e.tiersMode){case jsClientSdk.TiersMode.Volume:{let n=ln(e.tiers,t);return sn(n,t,o,r)}case jsClientSdk.TiersMode.Graduated:return cn(e.tiers,t,o,r).total;default:return 0}}function Gt(e){return e==null?void 0:e.some(({unitPrice:t,upTo:o})=>t&&!Po__default.default(o))}function Ea(e){return e==null?void 0:e.every(({unitPrice:t,upTo:o})=>!t||Po__default.default(o))}function La(e,t){return (e==null?void 0:e[0].upTo)&&t<=e[0].upTo}function bo({plan:e,billingPeriod:t,currentSubscription:o,currentSubscriptionOverride:r,selectDefaultTierIndex:n}){let i=e.pricePoints.filter(s=>s.billingPeriod===t&&s.isTieredPrice);if(i.length===1){let[s]=i,{featureId:l}=s.feature,a=n?n({plan:e}):0,c=s.tiers[a],u=Gt(s.tiers)?1:c.upTo||1;if(o&&o.plan.id===e.id){let p=o.prices.find(h=>{var g;return h.pricingModel===jsClientSdk.BillingModel.PerUnit&&h.tiersMode&&((g=h.feature)==null?void 0:g.featureId)===l});p&&(u=p.feature.unitQuantity||1);}if((r==null?void 0:r.planId)===e.id){let p=r.billableFeatures.find(h=>h.featureId===l);p&&(u=p.quantity);}let f={};return f[l]=u,f}return {}}function Na({perUnitQuantityByFeature:e,plan:t,currentSubscription:o,currentSubscriptionOverride:r}){var u,f;if(!o)return 0;let n=o.prices.find(p=>p.pricingModel===jsClientSdk.BillingModel.PerUnit&&p.tiersMode),i=t.id===(r==null?void 0:r.planId);if(i&&(n=(u=t.pricePoints.find(p=>p.pricingModel===jsClientSdk.BillingModel.PerUnit&&p.tiersMode))!=null?u:n),!n)return 0;let{featureId:s,unitQuantity:l}=n.feature,a=l;if(i){let p=(f=r==null?void 0:r.billableFeatures)==null?void 0:f.find(h=>h.featureId===s);p&&(a=p.quantity);}if(Po__default.default(a))return 0;let c=e[s];return c<a?-1:c>a?1:0}var Dm=chunkMY4ZIUAV_cjs_js.e(Rm__default.default)`
49
20
  margin-left: 10px;
50
- `,v2=y.button`
21
+ `,$m=chunkMY4ZIUAV_cjs_js.e.button`
51
22
  cursor: ${({$disabled:e})=>e?"default":"pointer"};
52
23
  padding: 8px 12px;
53
24
  background-color: ${({theme:e})=>e.stigg.palette.backgroundButton};
@@ -66,12 +37,12 @@
66
37
  &:hover {
67
38
  background-color: ${({theme:e,$disabled:t})=>t?e.stigg.palette.backgroundButton:e.stigg.palette.outlinedHoverBackground};
68
39
  }
69
- `,_2=y(P)`
40
+ `,Gm=chunkMY4ZIUAV_cjs_js.e(chunkMY4ZIUAV_cjs_js.f)`
70
41
  margin: 0;
71
42
  font-size: 15px;
72
- `,A2=y(P)`
43
+ `,zm=chunkMY4ZIUAV_cjs_js.e(chunkMY4ZIUAV_cjs_js.f)`
73
44
  min-height: 87px;
74
- `,M2=y.button`
45
+ `,Vm=chunkMY4ZIUAV_cjs_js.e.button`
75
46
  background: none;
76
47
  border: none;
77
48
  padding: 0;
@@ -79,17 +50,17 @@
79
50
 
80
51
  text-decoration: underline;
81
52
  cursor: pointer;
82
- `,I2=y(P)`
53
+ `,Hm=chunkMY4ZIUAV_cjs_js.e(chunkMY4ZIUAV_cjs_js.f)`
83
54
  margin-top: 8px;
84
55
  margin-bottom: 17px;
85
56
  min-height: 20px;
86
- `,E2=y.div`
57
+ `,Om=chunkMY4ZIUAV_cjs_js.e.div`
87
58
  display: flex;
88
59
  flex-direction: column;
89
60
  margin-top: 4px;
90
- align-self: ${({theme:e})=>vr(e.stigg.layout.ctaAlignment)};
61
+ align-self: ${({theme:e})=>chunkMY4ZIUAV_cjs_js.j(e.stigg.layout.ctaAlignment)};
91
62
  width: 100%;
92
- `;function Cm({isNextPlan:e,customer:t,plan:o,billingPeriod:n,isCustomerOnTrial:i,onPlanSelected:r,paywallLocale:a,withTrialLeftRow:s,currentSubscription:l,currentSubscriptionOverride:c,perUnitQuantityByFeature:d}){let u=react.useTheme(),[p,h]=Fc.useState(false),{currentPlan:m,custom:g,downgrade:f,startTrial:x,upgrade:b,startNew:T,switchToBillingPeriod:k,cancelScheduledUpdate:w}=a.planCTAButton,v=lodash.isFunction(f)?f(o):f,_=lodash.isFunction(b)?b(o):b,M={title:t?o.isLowerThanCurrentPlan?v:_:T,disabled:false,intentionType:o.isLowerThanCurrentPlan?"DOWNGRADE_PLAN":i?"UPGRADE_TRIAL_TO_PAID":"UPGRADE_PLAN"},I=o.pricingType===ah.PricingType.Custom,{line1:F}=_r({scheduledUpdate:o.scheduledUpdate,options:{withDate:true}});if(o.isTriable&&!o.isCurrentCustomerPlan&&!i)M.title=x(o),M.intentionType="START_TRIAL";else if(o.isCurrentCustomerPlan&&!i)if(n===o.currentCustomerPlanBillingPeriod||o.pricingType&&[ah.PricingType.Free,ah.PricingType.Custom].includes(o.pricingType))switch(xm({perUnitQuantityByFeature:d,plan:o,currentSubscription:l,currentSubscriptionOverride:c})){case -1:M.intentionType="CHANGE_UNIT_QUANTITY",M.title=v;break;case 1:M.intentionType="CHANGE_UNIT_QUANTITY",M.title=_;break;default:M.title=m,M.disabled=true;break}else M.title=k(n),M.intentionType="CHANGE_BILLING_PERIOD";else I&&(M.title=typeof g=="function"?g({plan:o,selectedBillingPeriod:n}):g,M.intentionType="REQUEST_CUSTOM_PLAN_ACCESS");e&&o.scheduledUpdate&&(M.disabled=false,M.title=w,M.intentionType="CANCEL_SCHEDULED_UPDATES");let E=p||M.disabled;return jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsx(E2,{className:"stigg-paywall-plan-button-layout",children:e&&F?jsxRuntime.jsxs(A2,{color:"secondary",variant:"body1",className:"stigg-paywall-schedule-update-text",children:[F," ",jsxRuntime.jsx(M2,{color:"secondary",onClick:()=>{h(true),Promise.resolve(r(M.intentionType)).finally(()=>h(false));},children:M.title})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(v2,{className:"stigg-paywall-plan-button","data-testid":`paywall-card-cta-${o.displayName}`,disabled:E,$disabled:E,onClick:()=>{h(true),Promise.resolve(r(M.intentionType)).finally(()=>h(false));},children:[jsxRuntime.jsx(_2,{className:"stigg-paywall-plan-button-text",variant:"h6",color:"primary.main",children:M.title}),p&&jsxRuntime.jsx(w2,{color:u.stigg.palette.text.disabled,loading:true,size:16})]}),s?jsxRuntime.jsx(I2,{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 at=({amount:e,currency:t=ah.Currency.Usd,locale:o,maximumFractionDigits:n=5,minimumFractionDigits:i=0,removeTrailingZero:r})=>{let a=t.toString(),s=L2__default.default(a),l=new Intl.NumberFormat(o,S({maximumFractionDigits:n,minimumFractionDigits:i,style:"currency",currency:a,trailingZeroDisplay:r?"stripIfInteger":"auto"},s?{currencyDisplay:"code"}:{})).format(e||0);return s&&(l=l.replace(a,s)),l=l.replace(/\s/g,""),l};function ft(e,{locale:t,maximumFractionDigits:o}={}){return new Intl.NumberFormat(t,{maximumFractionDigits:o}).format(e)}function Sm({planPrices:e,paywallCalculatedPrice:t,selectedBillingPeriod:o,locale:n,shouldShowMonthlyPriceAmount:i,paywallLocale:r,perUnitQuantityByFeature:a}){var f,x,b;let{amount:s,currency:l}=t||e[0],c=s||0,d=e.length===1,u=o===ah.BillingPeriod.Annually&&i?c/12:c,p,h,m=r.price.pricePeriod(i?ah.BillingPeriod.Monthly:ah.BillingPeriod.Annually),g=m;for(let T of e)if(T.isTieredPrice&&T.tiers){let k=(a==null?void 0:a[T.feature.featureId])||1;p=T.tiers,h=gm(T),u+=Cn(T,k,o,i);}if(d){let T=e[0],k=T.blockSize&&T.blockSize>1?`for ${ft(T.blockSize)} ${((f=T.feature)==null?void 0:f.unitsPlural)||((x=T.feature)==null?void 0:x.units)||""}`:`per ${((b=T.feature)==null?void 0:b.units)||""}`;T.pricingModel===ah.BillingModel.PerUnit&&!T.isTieredPrice?g=`${k} ${m}`:T.pricingModel===ah.BillingModel.UsageBased&&(g=`${k}`);}return {price:at({amount:u,currency:l,locale:n,minimumFractionDigits:2,removeTrailingZero:true}),unit:g,tiers:p,tierUnits:h}}function Ir(e,t,o,n,i,r){var a;switch(e.pricingType){case ah.PricingType.Free:return typeof o.price.free=="function"?o.price.free(e.paywallCurrency):o.price.free;case ah.PricingType.Custom:return {price:typeof o.price.custom=="function"?o.price.custom({plan:e,selectedBillingPeriod:t}):o.price.custom};case ah.PricingType.Paid:{let s=e.pricePoints.filter(d=>d.billingPeriod===t),l=(a=e.paywallCalculatedPricePoints)==null?void 0:a.find(d=>d.billingPeriod===t);if(!(s!=null&&s.length)&&!l)return {price:o.price.priceNotSet};let c={planPrices:s,paywallCalculatedPrice:l,selectedBillingPeriod:t,perUnitQuantityByFeature:r||{}};return o.price.paid?o.price.paid(A(S({},c),{plan:e})):Sm(A(S({},c),{locale:n,shouldShowMonthlyPriceAmount:i,paywallLocale:o}))}default:return {price:""}}}var R2=y(B2__default.default)`
63
+ `;function Ra({isNextPlan:e,customer:t,plan:o,billingPeriod:r,isCustomerOnTrial:n,onPlanSelected:i,paywallLocale:s,withTrialLeftRow:l,currentSubscription:a,currentSubscriptionOverride:c,perUnitQuantityByFeature:u}){let f=react.useTheme(),[p,h]=ii.useState(false),{currentPlan:g,custom:y,downgrade:C,startTrial:b,upgrade:x,startNew:S,switchToBillingPeriod:T,cancelScheduledUpdate:F}=s.planCTAButton,w=Ma__default.default(C)?C(o):C,I=Ma__default.default(x)?x(o):x,k={title:t?o.isLowerThanCurrentPlan?w:I:S,disabled:false,intentionType:o.isLowerThanCurrentPlan?"DOWNGRADE_PLAN":n?"UPGRADE_TRIAL_TO_PAID":"UPGRADE_PLAN"},L=o.pricingType===jsClientSdk.PricingType.Custom,{line1:E}=xo({scheduledUpdate:o.scheduledUpdate,options:{withDate:true}});if(o.isTriable&&!o.isCurrentCustomerPlan&&!n)k.title=b(o),k.intentionType="START_TRIAL";else if(o.isCurrentCustomerPlan&&!n)if(r===o.currentCustomerPlanBillingPeriod||o.pricingType&&[jsClientSdk.PricingType.Free,jsClientSdk.PricingType.Custom].includes(o.pricingType))switch(Na({perUnitQuantityByFeature:u,plan:o,currentSubscription:a,currentSubscriptionOverride:c})){case -1:k.intentionType="CHANGE_UNIT_QUANTITY",k.title=w;break;case 1:k.intentionType="CHANGE_UNIT_QUANTITY",k.title=I;break;default:k.title=g,k.disabled=true;break}else k.title=T(r),k.intentionType="CHANGE_BILLING_PERIOD";else L&&(k.title=typeof y=="function"?y({plan:o,selectedBillingPeriod:r}):y,k.intentionType="REQUEST_CUSTOM_PLAN_ACCESS");e&&o.scheduledUpdate&&(k.disabled=false,k.title=F,k.intentionType="CANCEL_SCHEDULED_UPDATES");let A=p||k.disabled;return jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsx(Om,{className:"stigg-paywall-plan-button-layout",children:e&&E?jsxRuntime.jsxs(zm,{color:"secondary",variant:"body1",className:"stigg-paywall-schedule-update-text",children:[E," ",jsxRuntime.jsx(Vm,{color:"secondary",onClick:()=>{h(true),Promise.resolve(i(k.intentionType)).finally(()=>h(false));},children:k.title})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs($m,{className:"stigg-paywall-plan-button","data-testid":`paywall-card-cta-${o.displayName}`,disabled:A,$disabled:A,onClick:()=>{h(true),Promise.resolve(i(k.intentionType)).finally(()=>h(false));},children:[jsxRuntime.jsx(Gm,{className:"stigg-paywall-plan-button-text",variant:"h6",color:"primary.main",children:k.title}),p&&jsxRuntime.jsx(Dm,{color:f.stigg.palette.text.disabled,loading:true,size:16})]}),l?jsxRuntime.jsx(Hm,{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 s=t.toString(),l=Zm__default.default(s),a=new Intl.NumberFormat(o,chunkMY4ZIUAV_cjs_js.a({maximumFractionDigits:r,minimumFractionDigits:n,style:"currency",currency:s,trailingZeroDisplay:i?"stripIfInteger":"auto"},l?{currencyDisplay:"code"}:{})).format(e||0);return l&&(a=a.replace(s,l)),a=a.replace(/\s/g,""),a};function _a({planPrices:e,paywallCalculatedPrice:t,selectedBillingPeriod:o,locale:r,shouldShowMonthlyPriceAmount:n,paywallLocale:i,perUnitQuantityByFeature:s}){var C,b,x;let{amount:l,currency:a}=t||e[0],c=l||0,u=e.length===1,f=o===jsClientSdk.BillingPeriod.Annually&&n?c/12:c,p,h,g=i.price.pricePeriod(n?jsClientSdk.BillingPeriod.Monthly:jsClientSdk.BillingPeriod.Annually),y=g;for(let S of e)if(S.isTieredPrice&&S.tiers){let T=(s==null?void 0:s[S.feature.featureId])||1;p=S.tiers,h=va(S),f+=ht(S,T,o,n);}if(u){let S=e[0],T=S.blockSize&&S.blockSize>1?`for ${chunkMY4ZIUAV_cjs_js.k(S.blockSize)} ${((C=S.feature)==null?void 0:C.unitsPlural)||((b=S.feature)==null?void 0:b.units)||""}`:`per ${((x=S.feature)==null?void 0:x.units)||""}`;S.pricingModel===jsClientSdk.BillingModel.PerUnit&&!S.isTieredPrice?y=`${T} ${g}`:S.pricingModel===jsClientSdk.BillingModel.UsageBased&&(y=`${T}`);}return {price:H({amount:f,currency:a,locale:r,minimumFractionDigits:2,removeTrailingZero:true}),unit:y,tiers:p,tierUnits:h}}function So(e,t,o,r,n,i){var s;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 l=e.pricePoints.filter(u=>u.billingPeriod===t),a=(s=e.paywallCalculatedPricePoints)==null?void 0:s.find(u=>u.billingPeriod===t);if(!(l!=null&&l.length)&&!a)return {price:o.price.priceNotSet};let c={planPrices:l,paywallCalculatedPrice:a,selectedBillingPeriod:t,perUnitQuantityByFeature:i||{}};return o.price.paid?o.price.paid(chunkMY4ZIUAV_cjs_js.b(chunkMY4ZIUAV_cjs_js.a({},c),{plan:e})):_a(chunkMY4ZIUAV_cjs_js.b(chunkMY4ZIUAV_cjs_js.a({},c),{locale:r,shouldShowMonthlyPriceAmount:n,paywallLocale:o}))}default:return {price:""}}}var Qm=chunkMY4ZIUAV_cjs_js.e(Ym__default.default,{shouldForwardProp:e=>!e.startsWith("$")})`
93
64
  border-radius: 10px;
94
65
  text-transform: none;
95
66
  font-weight: 300;
@@ -100,26 +71,10 @@
100
71
  &:hover {
101
72
  background-color: ${({theme:e,$success:t,$error:o})=>t?e.stigg.palette.successDark:o?e.stigg.palette.errorDark:""};
102
73
  }
103
- `,kt=o=>{var n=o,{variant:e="outlined"}=n,t=ot(n,["variant"]);return jsxRuntime.jsx(R2,S({variant:e},t))};var Rt=y(N2__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":S({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 Oo=y(Se__default.default)`
104
- display: flex;
105
- flex-direction: ${({$flexDirection:e})=>e||"row"};
106
- gap: ${({$gap:e})=>e}px;
107
- `,km=y(Oo)`
108
- span {
109
- display: flex;
110
- flex: 1;
111
- }
112
- `,xi=y(Se__default.default)`
113
- span {
114
- display: flex;
115
- flex: ${({flex:e})=>e};
116
- }
117
- `,dt=y(ro__default.default)`
118
- border-radius: 4px;
119
- `;var wm=y(Se__default.default)`
74
+ `,te=o=>{var r=o,{variant:e="outlined"}=r,t=chunkMY4ZIUAV_cjs_js.c(r,["variant"]);return jsxRuntime.jsx(Qm,chunkMY4ZIUAV_cjs_js.a({variant:e},t))};var ce=chunkMY4ZIUAV_cjs_js.e(qm__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":chunkMY4ZIUAV_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 Da=chunkMY4ZIUAV_cjs_js.e(Me__default.default)`
120
75
  display: flex;
121
76
  flex-direction: column;
122
- `;function vm(){return jsxRuntime.jsxs(wm,{container:true,children:[jsxRuntime.jsxs(Oo,{item:true,$gap:48,children:[jsxRuntime.jsx(dt,{width:120,height:20}),jsxRuntime.jsx(dt,{width:120,height:20})]}),jsxRuntime.jsx(fg__default.default,{className:"stigg-checkout-plan-header-divider",sx:{marginY:2}}),jsxRuntime.jsxs(wm,{item:true,children:[jsxRuntime.jsx(dt,{width:120,height:20}),jsxRuntime.jsxs(km,{$gap:16,marginTop:3,children:[jsxRuntime.jsx(dt,{height:20}),jsxRuntime.jsx(dt,{height:20})]}),jsxRuntime.jsxs(Oo,{$gap:130,marginTop:3,children:[jsxRuntime.jsx(xi,{flex:1,children:jsxRuntime.jsx(dt,{height:20})}),jsxRuntime.jsx(xi,{flex:3,children:jsxRuntime.jsx(dt,{height:20})})]})]})]})}var Pn=e=>e.target.blur();function _m({width:e,tierUnits:t,value:o,handleChange:n,errorMessage:i}){return jsxRuntime.jsx(Rt,{type:"number",onWheel:Pn,fullWidth:true,error:!!i,sx:{minHeight:"46px",width:e},InputProps:{endAdornment:jsxRuntime.jsx(V2__default.default,{position:"end",children:jsxRuntime.jsx(P,{variant:"body1",color:"primary",children:t})})},value:o,onChange:r=>{var s,l;let a=(s=r==null?void 0:r.target)!=null&&s.value?Number((l=r==null?void 0:r.target)==null?void 0:l.value):null;a&&n(a);}})}var j2=y(H2__default.default)`
77
+ `;function $a(){return jsxRuntime.jsxs(Da,{container:true,children:[jsxRuntime.jsxs(chunkMY4ZIUAV_cjs_js.l,{item:true,$gap:48,children:[jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.o,{width:120,height:20}),jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.o,{width:120,height:20})]}),jsxRuntime.jsx(xl__default.default,{className:"stigg-checkout-plan-header-divider",sx:{marginY:2}}),jsxRuntime.jsxs(Da,{item:true,children:[jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.o,{width:120,height:20}),jsxRuntime.jsxs(chunkMY4ZIUAV_cjs_js.m,{$gap:16,marginTop:3,children:[jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.o,{height:20}),jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.o,{height:20})]}),jsxRuntime.jsxs(chunkMY4ZIUAV_cjs_js.l,{$gap:130,marginTop:3,children:[jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.n,{flex:1,children:jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.o,{height:20})}),jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.n,{flex:3,children:jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.o,{height:20})})]})]})]})}var Ct=e=>e.target.blur();function Ga({width:e,tierUnits:t,value:o,handleChange:r,errorMessage:n}){return jsxRuntime.jsx(ce,{type:"number",onWheel:Ct,fullWidth:true,error:!!n,sx:{minHeight:"46px",width:e},InputProps:{endAdornment:jsxRuntime.jsx(jm__default.default,{position:"end",children:jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.f,{variant:"body1",color:"primary",children:t})})},value:o,onChange:i=>{var l,a;let s=(l=i==null?void 0:i.target)!=null&&l.value?Number((a=i==null?void 0:i.target)==null?void 0:a.value):null;s&&r(s);}})}var nu=chunkMY4ZIUAV_cjs_js.e(tu__default.default)`
123
78
  border-radius: 10px;
124
79
  min-height: 42px;
125
80
  min-width: 120px;
@@ -127,7 +82,7 @@
127
82
  &:hover .MuiOutlinedInput-notchedOutline {
128
83
  border-color: ${({theme:e})=>e.stigg.palette.outlinedBorder};
129
84
  }
130
- `,Y2=y($2__default.default)`
85
+ `,iu=chunkMY4ZIUAV_cjs_js.e(eu__default.default)`
131
86
  & .MuiInputBase-input {
132
87
  padding: 10px 12px;
133
88
  }
@@ -135,34 +90,34 @@
135
90
  &.Mui-focused .MuiOutlinedInput-notchedOutline {
136
91
  border-color: ${({theme:e})=>e.stigg.palette.primary} !important;
137
92
  }
138
- `;function Am({value:e,componentId:t,tierUnits:o,tiers:n,handleChange:i,errorMessage:r}){return n?jsxRuntime.jsx(j2,{value:e.toString(),fullWidth:true,error:!!r,onChange:a=>{var l,c;let s=(l=a==null?void 0:a.target)!=null&&l.value?Number((c=a==null?void 0:a.target)==null?void 0:c.value):null;s&&i(s);},id:t,input:jsxRuntime.jsx(Y2,{}),MenuProps:{MenuListProps:{disablePadding:true},PaperProps:{sx:{marginTop:"4px",borderRadius:"10px"}}},children:lodash.map(n,a=>{var s;return jsxRuntime.jsx(W2__default.default,{className:"stigg-price-tier-menu-item-text",value:(s=a.upTo)==null?void 0:s.toString(),children:jsxRuntime.jsxs(P,{variant:"body1",color:"primary",style:{lineHeight:"unset"},children:[At(a.upTo)," ",o]})},a.upTo)})}):null}var K2=y(P)`
93
+ `;function za({value:e,componentId:t,tierUnits:o,tiers:r,handleChange:n,errorMessage:i}){return r?jsxRuntime.jsx(nu,{value:e.toString(),fullWidth:true,error:!!i,onChange:s=>{var a,c;let l=(a=s==null?void 0:s.target)!=null&&a.value?Number((c=s==null?void 0:s.target)==null?void 0:c.value):null;l&&n(l);},id:t,input:jsxRuntime.jsx(iu,{}),MenuProps:{MenuListProps:{disablePadding:true},PaperProps:{sx:{marginTop:"4px",borderRadius:"10px"}}},children:ru__default.default(r,s=>{var l;return jsxRuntime.jsx(ou__default.default,{className:"stigg-price-tier-menu-item-text",value:(l=s.upTo)==null?void 0:l.toString(),children:jsxRuntime.jsxs(chunkMY4ZIUAV_cjs_js.f,{variant:"body1",color:"primary",style:{lineHeight:"unset"},children:[ie(s.upTo)," ",o]})},s.upTo)})}):null}var lu=chunkMY4ZIUAV_cjs_js.e(chunkMY4ZIUAV_cjs_js.f)`
139
94
  min-height: 46px;
140
- `;function Er(e){let{tiers:t,errorMessage:o}=e;return jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsxs(material.Box,{display:"flex",flexDirection:"column",justifyContent:"center",style:{width:"100%"},children:[jsxRuntime.jsx(K2,{as:"div",className:"stigg-price-tier-select",children:fi(t)?jsxRuntime.jsx(_m,S({},e)):jsxRuntime.jsx(Am,S({},e))}),jsxRuntime.jsx(P,{style:{margin:"4px"},variant:"caption",color:"error",children:o})]})})}var Im="\u200E",J2=y(P)`
95
+ `;function To(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(lu,{as:"div",className:"stigg-price-tier-select",children:Gt(t)?jsxRuntime.jsx(Ga,chunkMY4ZIUAV_cjs_js.a({},e)):jsxRuntime.jsx(za,chunkMY4ZIUAV_cjs_js.a({},e))}),jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.f,{style:{margin:"4px"},variant:"caption",color:"error",children:o})]})})}var Ha="\u200E",pu=chunkMY4ZIUAV_cjs_js.e(chunkMY4ZIUAV_cjs_js.f)`
141
96
  word-break: break-word;
142
97
  width: 100%;
143
- `,tP=y(P)`
98
+ `,mu=chunkMY4ZIUAV_cjs_js.e(chunkMY4ZIUAV_cjs_js.f)`
144
99
  white-space: nowrap;
145
- `,eP=y(P)`
100
+ `,uu=chunkMY4ZIUAV_cjs_js.e(chunkMY4ZIUAV_cjs_js.f)`
146
101
  white-space: normal;
147
102
  min-height: 39px;
148
- `;function oP({plan:e,billingPeriod:t,hasMonthlyPrice:o,hasAnnuallyPrice:n,paywallLocale:i}){var s,l;let r=e.pricePoints.find(c=>c.billingPeriod===t),a=Im;return r&&o&&n&&(a=((l=(s=i.price).billingPeriod)==null?void 0:l.call(s,t))||`, billed ${t.toLowerCase()}`),jsxRuntime.jsx(P,{as:"span",className:"stigg-price-billing-period-text",variant:"h6",color:"secondary",children:a})}var Em=({showStartingAt:e,withUnitPriceRow:t,withStartingAtRow:o,withTiersRow:n,plan:i,billingPeriod:r,paywallLocale:a,locale:s,hasMonthlyPrice:l,hasAnnuallyPrice:c,perUnitQuantityByFeature:d,setPerUnitQuantityByFeature:u})=>{var k;let{price:p,unit:h,tiers:m,tierUnits:g}=Ir(i,r,a,s,l,d),f=i.pricePoints.find(w=>w.billingPeriod===r&&w.isTieredPrice),x=f?f.feature.featureId:void 0,b=(k=d[x||""])!=null?k:1,T=w=>{x&&u(v=>A(S({},v),{[x]:w}));};return jsxRuntime.jsx(J2,{as:"div",className:"stigg-price-text",children:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[o&&jsxRuntime.jsx(P,{style:{minHeight:"20px"},className:"stigg-starting-at-text",variant:"body1",color:"secondary",children:e?a.price.startingAtCaption:Im}),jsxRuntime.jsx(eP,{className:"stigg-price-point",variant:"h1",children:p}),t&&jsxRuntime.jsxs(P,{as:"div",className:"stigg-price-unit-and-billing-period-text",style:{minHeight:"48px"},children:[jsxRuntime.jsx(tP,{className:"stigg-price-unit-text",as:"span",variant:"h6",color:"secondary",children:h}),jsxRuntime.jsx(oP,{plan:i,billingPeriod:r,hasAnnuallyPrice:c,hasMonthlyPrice:l,paywallLocale:a})]}),n?jsxRuntime.jsx(Er,{componentId:`${i.id}_${x}_tier`,tiers:m,tierUnits:g,tiersMode:f==null?void 0:f.tiersMode,handleChange:T,value:b}):null]})})};var lP=y(B2__default.default)`
103
+ `;function gu({plan:e,billingPeriod:t,hasMonthlyPrice:o,hasAnnuallyPrice:r,paywallLocale:n}){var l,a;let i=e.pricePoints.find(c=>c.billingPeriod===t),s=Ha;return i&&o&&r&&(s=((a=(l=n.price).billingPeriod)==null?void 0:a.call(l,t))||`, billed ${t.toLowerCase()}`),jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.f,{as:"span",className:"stigg-price-billing-period-text",variant:"h6",color:"secondary",children:s})}var Oa=({showStartingAt:e,withUnitPriceRow:t,withStartingAtRow:o,withTiersRow:r,plan:n,billingPeriod:i,paywallLocale:s,locale:l,hasMonthlyPrice:a,hasAnnuallyPrice:c,perUnitQuantityByFeature:u,setPerUnitQuantityByFeature:f})=>{var T;let{price:p,unit:h,tiers:g,tierUnits:y}=So(n,i,s,l,a,u),C=n.pricePoints.find(F=>F.billingPeriod===i&&F.isTieredPrice),b=C?C.feature.featureId:void 0,x=(T=u[b||""])!=null?T:1,S=F=>{b&&f(w=>chunkMY4ZIUAV_cjs_js.b(chunkMY4ZIUAV_cjs_js.a({},w),{[b]:F}));};return jsxRuntime.jsx(pu,{as:"div",className:"stigg-price-text",children:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[o&&jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.f,{style:{minHeight:"20px"},className:"stigg-starting-at-text",variant:"body1",color:"secondary",children:e?s.price.startingAtCaption:Ha}),jsxRuntime.jsx(uu,{className:"stigg-price-point",variant:"h1",children:p}),t&&jsxRuntime.jsxs(chunkMY4ZIUAV_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:h}),jsxRuntime.jsx(gu,{plan:n,billingPeriod:i,hasAnnuallyPrice:c,hasMonthlyPrice:a,paywallLocale:s})]}),r?jsxRuntime.jsx(To,{componentId:`${n.id}_${b}_tier`,tiers:g,tierUnits:y,tiersMode:C==null?void 0:C.tiersMode,handleChange:S,value:x}):null]})})};var Pu=chunkMY4ZIUAV_cjs_js.e(Ym__default.default)`
149
104
  padding: 0px;
150
105
  text-transform: none;
151
106
  margin-left: 0px;
152
- `,cP=y(P)`
107
+ `,bu=chunkMY4ZIUAV_cjs_js.e(chunkMY4ZIUAV_cjs_js.f)`
153
108
  font-size: 14px;
154
109
  font-weight: 500;
155
- `,dP=y.div`
110
+ `,Su=chunkMY4ZIUAV_cjs_js.e.div`
156
111
  width: 100%;
157
112
  gap: 10px;
158
- `,uP=y.div`
113
+ `,Tu=chunkMY4ZIUAV_cjs_js.e.div`
159
114
  margin-top: 10px;
160
115
  overflow: hidden;
161
116
  display: flex;
162
117
  flex-direction: column;
163
118
  gap: 4px;
164
119
  width: 100%;
165
- `,pP=y.div`
120
+ `,ku=chunkMY4ZIUAV_cjs_js.e.div`
166
121
  display: flex;
167
122
  flex-direction: row;
168
123
  flex-wrap: nowrap;
@@ -171,7 +126,7 @@
171
126
  padding: 8px 0px;
172
127
  max-height: 44px;
173
128
  gap: 16px;
174
- `,mP=y(P)`
129
+ `,wu=chunkMY4ZIUAV_cjs_js.e(chunkMY4ZIUAV_cjs_js.f)`
175
130
  overflow: hidden;
176
131
  font-feature-settings: 'liga' off, 'clig' off;
177
132
  text-overflow: ellipsis;
@@ -180,17 +135,17 @@
180
135
  white-space: nowrap;
181
136
  min-width: 0;
182
137
  flex-shrink: 1;
183
- `,hP=y(mt)`
138
+ `,Bu=chunkMY4ZIUAV_cjs_js.e(chunkMY4ZIUAV_cjs_js.i)`
184
139
  width: 24px;
185
140
  height: 24px;
186
141
  color: ${({theme:e})=>e.stigg.palette.primary};
187
- `,gP=y.div`
142
+ `,Au=chunkMY4ZIUAV_cjs_js.e.div`
188
143
  flex: 1;
189
144
  min-width: 0;
190
- `,fP=y.div`
145
+ `,Iu=chunkMY4ZIUAV_cjs_js.e.div`
191
146
  margin-top: 16px;
192
147
  display: flex;
193
- `,Ul=4;function Ol({addons:e,paywallLocale:t}){let[o,n]=Fc.useState(false);if(!e||e.length===0)return null;let i=e.filter(s=>{var l;return !((l=s.hiddenFromWidgets)!=null&&l.includes(ah.WidgetType.Paywall))}),r=()=>{n(!o);},a=o?i:i.slice(0,Ul);return a.length===0?null:jsxRuntime.jsxs(dP,{className:"stigg-compatible-addons-container",children:[jsxRuntime.jsx(P,{className:"stigg-compatible-addons-header",color:"secondary",variant:"body1",bold:true,children:t.addonsTitle}),jsxRuntime.jsx(uP,{className:"stigg-compatible-addons-list",children:a.map(s=>jsxRuntime.jsxs(pP,{className:sP__default.default(`stigg-compatible-addon--${s.id}`,"stigg-compatible-addon-item"),children:[jsxRuntime.jsx(hP,{icon:"Add",className:"stigg-compatible-addon-icon"}),jsxRuntime.jsx(gP,{className:"stigg-compatible-addon-content",children:jsxRuntime.jsx(mP,{variant:"body1",color:"primary",className:"stigg-compatible-addon-name",children:s.displayName})})]},s.id))}),i.length>Ul&&jsxRuntime.jsx(fP,{children:jsxRuntime.jsx(lP,{variant:"text",onClick:r,children:jsxRuntime.jsx(cP,{color:"primary.main",children:o?"Show less":`Show ${i.length-Ul} more`})})})]})}var PP="66px",SP=y.div`
148
+ `,yn=4;function hn({addons:e,paywallLocale:t}){let[o,r]=ii.useState(false);if(!e||e.length===0)return null;let n=e.filter(l=>{var a;return !((a=l.hiddenFromWidgets)!=null&&a.includes(jsClientSdk.WidgetType.Paywall))}),i=()=>{r(!o);},s=o?n:n.slice(0,yn);return s.length===0?null:jsxRuntime.jsxs(Su,{className:"stigg-compatible-addons-container",children:[jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.f,{className:"stigg-compatible-addons-header",color:"secondary",variant:"body1",bold:true,children:t.addonsTitle}),jsxRuntime.jsx(Tu,{className:"stigg-compatible-addons-list",children:s.map(l=>jsxRuntime.jsxs(ku,{className:xu__default.default(`stigg-compatible-addon--${l.id}`,"stigg-compatible-addon-item"),children:[jsxRuntime.jsx(Bu,{icon:"Add",className:"stigg-compatible-addon-icon"}),jsxRuntime.jsx(Au,{className:"stigg-compatible-addon-content",children:jsxRuntime.jsx(wu,{variant:"body1",color:"primary",className:"stigg-compatible-addon-name",children:l.displayName})})]},l.id))}),n.length>yn&&jsxRuntime.jsx(Iu,{children:jsxRuntime.jsx(Pu,{variant:"text",onClick:i,children:jsxRuntime.jsx(bu,{color:"primary.main",children:o?"Show less":`Show ${n.length-yn} more`})})})]})}var Nu="66px",Mu=chunkMY4ZIUAV_cjs_js.e.div`
194
149
  position: relative;
195
150
  background-color: ${({theme:e,$isCurrentPlan:t})=>t?e.stigg.palette.backgroundHighlight:e.stigg.palette.backgroundPaper};
196
151
  border: ${({theme:e,$isHighlighted:t})=>t?`3px solid ${e.stigg.palette.primary}`:`1px solid ${e.stigg.palette.outlinedBorder}`};
@@ -203,38 +158,38 @@
203
158
  align-items: flex-start;
204
159
  justify-content: flex-start;
205
160
  position: relative;
206
- `,TP=y.div`
161
+ `,Ru=chunkMY4ZIUAV_cjs_js.e.div`
207
162
  margin-top: ${({$planHasEntitlements:e})=>e?"32px":"0px"};
208
- `,kP=y(P)`
163
+ `,Uu=chunkMY4ZIUAV_cjs_js.e(chunkMY4ZIUAV_cjs_js.f)`
209
164
  padding-bottom: 8px;
210
- `,wP=y.div`
165
+ `,_u=chunkMY4ZIUAV_cjs_js.e.div`
211
166
  height: 2px;
212
167
  width: 100%;
213
168
  background-color: ${({theme:e})=>e.stigg.palette.outlinedBorder};
214
169
  margin-bottom: 40px;
215
- `,vP=y(P)`
170
+ `,Du=chunkMY4ZIUAV_cjs_js.e(chunkMY4ZIUAV_cjs_js.f)`
216
171
  text-align: ${({theme:e})=>e.stigg.layout.descriptionAlignment};
217
172
  min-height: ${({theme:e})=>e.stigg.layout.descriptionMinHeight};
218
- `,_P=y.div`
173
+ `,$u=chunkMY4ZIUAV_cjs_js.e.div`
219
174
  background-color: ${({theme:e})=>e.stigg.palette.primary};
220
175
  border-radius: 40px;
221
176
  position: absolute;
222
177
  top: -12px;
223
- `,AP=y(P)`
178
+ `,Gu=chunkMY4ZIUAV_cjs_js.e(chunkMY4ZIUAV_cjs_js.f)`
224
179
  margin: 0;
225
180
  padding: 2px 8px;
226
- `,MP=y.div`
181
+ `,zu=chunkMY4ZIUAV_cjs_js.e.div`
227
182
  width: 100%;
228
183
  display: flex;
229
184
  flex-direction: column;
230
- align-items: ${({theme:e})=>vr(e.stigg.layout.headerAlignment)};
231
- `,IP=y.div`
185
+ align-items: ${({theme:e})=>chunkMY4ZIUAV_cjs_js.j(e.stigg.layout.headerAlignment)};
186
+ `,Vu=chunkMY4ZIUAV_cjs_js.e.div`
232
187
  position: absolute;
233
188
  top: 0;
234
189
  background-color: ${({theme:e})=>e.stigg.palette.outlinedBorder};
235
190
  border-radius: 0px 0px 10px 10px;
236
191
  padding: 3px 12px;
237
- `,EP=y(Sr)`
192
+ `,Hu=chunkMY4ZIUAV_cjs_js.e(chunkMY4ZIUAV_cjs_js.g)`
238
193
  display: flex;
239
194
  height: 100%;
240
195
  margin-right: 4px;
@@ -242,7 +197,7 @@
242
197
  path {
243
198
  fill: ${({theme:e})=>e.stigg.palette.text.primary};
244
199
  }
245
- `;function FP({text:e="Next",iconsColor:t}){return jsxRuntime.jsx(IP,{children:jsxRuntime.jsxs(Se__default.default,{display:"flex",alignItems:"center",gap:1,children:[jsxRuntime.jsx(EP,{$iconsColor:t}),jsxRuntime.jsx(P,{color:"primary",variant:"body1",children:e})]})})}function Lm({withUnitPriceRow:e,withTiersRow:t,withTrialLeftRow:o,customer:n,plan:i,billingPeriod:r,isHighlighted:a,currentSubscription:s,currentSubscriptionOverride:l,shouldShowDescriptionSection:c,hasMonthlyPrice:d,hasAnnuallyPrice:u,isCustomerOnTrial:p,onPlanSelected:h,paywallLocale:m,locale:g,withStartingAtRow:f,isCustomerInCustomPlan:x,selectDefaultTierIndex:b,hideCompatibleAddons:T}){var O,U,L;let k=i.isNextPlan&&i.isNextPlan(r),w=i.pricePoints.filter(V=>V.billingPeriod===r),v=(O=i.paywallCalculatedPricePoints)==null?void 0:O.find(V=>V.billingPeriod===r),_=w.length>1&&!!(v!=null&&v.additionalChargesMayApply),M=!x||i.pricingType===ah.PricingType.Custom,I=null;k?I=jsxRuntime.jsx(FP,{text:"Next plan"}):a&&m.highlightChip&&(I=jsxRuntime.jsx(_P,{className:"stigg-highlight-badge",children:jsxRuntime.jsx(AP,{className:"stigg-highlight-badge-text",color:"white",bold:true,children:m.highlightChip})}));let[F,E]=Fc.useState(Mr({plan:i,billingPeriod:r,currentSubscription:s,currentSubscriptionOverride:l,selectDefaultTierIndex:b})),B=V=>{let J=Object.keys(F).map(Bt=>({featureId:Bt,quantity:F[Bt]}));return h(V,J)};return jsxRuntime.jsxs(SP,{className:sP__default.default(`stigg-${i.id}`,"stigg-plan-offering-container",{"stigg-current-plan":i.isCurrentCustomerPlan}),$isHighlighted:a,$isCurrentPlan:i.isCurrentCustomerPlan,children:[I,jsxRuntime.jsxs(MP,{className:"stigg-header-wrapper",children:[jsxRuntime.jsx(kP,{className:"stigg-plan-header",variant:"h3",children:i.displayName}),c&&jsxRuntime.jsx(vP,{className:"stigg-plan-description",variant:"h6",color:"secondary",children:i.description}),jsxRuntime.jsx(Em,{showStartingAt:_,withUnitPriceRow:e,withStartingAtRow:f,withTiersRow:t,plan:i,billingPeriod:r,paywallLocale:m,locale:g,hasAnnuallyPrice:u,hasMonthlyPrice:d,setPerUnitQuantityByFeature:E,perUnitQuantityByFeature:F}),M?jsxRuntime.jsx(Cm,{isNextPlan:k,customer:n,plan:i,currentSubscription:s,currentSubscriptionOverride:l,billingPeriod:r,isCustomerOnTrial:p,onPlanSelected:B,paywallLocale:m,withTrialLeftRow:o,perUnitQuantityByFeature:F}):jsxRuntime.jsx("div",{style:{height:PP}}),jsxRuntime.jsx(wP,{className:"stigg-plan-header-divider"})]}),jsxRuntime.jsx(cm,{plan:i,billingPeriod:r,paywallLocale:m}),jsxRuntime.jsx(TP,{$planHasEntitlements:((L=(U=i.packageEntitlements)==null?void 0:U.length)!=null?L:0)>0,className:"stigg-addons-container",children:!T&&i.compatibleAddons&&i.compatibleAddons.length>0&&jsxRuntime.jsx(Ol,{addons:i.compatibleAddons,paywallLocale:m})})]})}var BP=y.div`
200
+ `;function Ou({text:e="Next",iconsColor:t}){return jsxRuntime.jsx(Vu,{children:jsxRuntime.jsxs(Me__default.default,{display:"flex",alignItems:"center",gap:1,children:[jsxRuntime.jsx(Hu,{$iconsColor:t}),jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.f,{color:"primary",variant:"body1",children:e})]})})}function Za({withUnitPriceRow:e,withTiersRow:t,withTrialLeftRow:o,customer:r,plan:n,billingPeriod:i,isHighlighted:s,currentSubscription:l,currentSubscriptionOverride:a,shouldShowDescriptionSection:c,hasMonthlyPrice:u,hasAnnuallyPrice:f,isCustomerOnTrial:p,onPlanSelected:h,paywallLocale:g,locale:y,withStartingAtRow:C,isCustomerInCustomPlan:b,selectDefaultTierIndex:x,hideCompatibleAddons:S}){var $,_,z;let T=n.isNextPlan&&n.isNextPlan(i),F=n.pricePoints.filter(q=>q.billingPeriod===i),w=($=n.paywallCalculatedPricePoints)==null?void 0:$.find(q=>q.billingPeriod===i),I=F.length>1&&!!(w!=null&&w.additionalChargesMayApply),k=!b||n.pricingType===jsClientSdk.PricingType.Custom,L=null;T?L=jsxRuntime.jsx(Ou,{text:"Next plan"}):s&&g.highlightChip&&(L=jsxRuntime.jsx($u,{className:"stigg-highlight-badge",children:jsxRuntime.jsx(Gu,{className:"stigg-highlight-badge-text",color:"white",bold:true,children:g.highlightChip})}));let[E,A]=ii.useState(bo({plan:n,billingPeriod:i,currentSubscription:l,currentSubscriptionOverride:a,selectDefaultTierIndex:x})),Z=q=>{let Ge=Object.keys(E).map(pt=>({featureId:pt,quantity:E[pt]}));return h(q,Ge)};return jsxRuntime.jsxs(Mu,{className:xu__default.default(`stigg-${n.id}`,"stigg-plan-offering-container",{"stigg-current-plan":n.isCurrentCustomerPlan}),$isHighlighted:s,$isCurrentPlan:n.isCurrentCustomerPlan,children:[L,jsxRuntime.jsxs(zu,{className:"stigg-header-wrapper",children:[jsxRuntime.jsx(Uu,{className:"stigg-plan-header",variant:"h3",children:n.displayName}),c&&jsxRuntime.jsx(Du,{className:"stigg-plan-description",variant:"h6",color:"secondary",children:n.description}),jsxRuntime.jsx(Oa,{showStartingAt:I,withUnitPriceRow:e,withStartingAtRow:C,withTiersRow:t,plan:n,billingPeriod:i,paywallLocale:g,locale:y,hasAnnuallyPrice:f,hasMonthlyPrice:u,setPerUnitQuantityByFeature:A,perUnitQuantityByFeature:E}),k?jsxRuntime.jsx(Ra,{isNextPlan:T,customer:r,plan:n,currentSubscription:l,currentSubscriptionOverride:a,billingPeriod:i,isCustomerOnTrial:p,onPlanSelected:Z,paywallLocale:g,withTrialLeftRow:o,perUnitQuantityByFeature:E}):jsxRuntime.jsx("div",{style:{height:Nu}}),jsxRuntime.jsx(_u,{className:"stigg-plan-header-divider"})]}),jsxRuntime.jsx(Ba,{plan:n,billingPeriod:i,paywallLocale:g}),jsxRuntime.jsx(Ru,{$planHasEntitlements:((z=(_=n.packageEntitlements)==null?void 0:_.length)!=null?z:0)>0,className:"stigg-addons-container",children:!S&&n.compatibleAddons&&n.compatibleAddons.length>0&&jsxRuntime.jsx(hn,{addons:n.compatibleAddons,paywallLocale:g})})]})}var Zu=chunkMY4ZIUAV_cjs_js.e.div`
246
201
  height: 40px;
247
202
  padding: 0 20px;
248
203
  margin-bottom: ${({theme:e})=>e.stigg.layout.switchBottomSpacing};
@@ -252,9 +207,9 @@
252
207
  display: flex;
253
208
  align-items: center;
254
209
  justify-content: center;
255
- `,Bm=y(P)`
210
+ `,Ya=chunkMY4ZIUAV_cjs_js.e(chunkMY4ZIUAV_cjs_js.f)`
256
211
  margin: 0 8px;
257
- `,RP=y(LP__default.default)`
212
+ `,Yu=chunkMY4ZIUAV_cjs_js.e(Wu__default.default)`
258
213
  & .react-switch-bg {
259
214
  border: ${({theme:e})=>`1px solid ${e.stigg.palette.switchBorder}`};
260
215
  background: ${({theme:e})=>e.stigg.palette.switchFill} !important;
@@ -265,17 +220,7 @@
265
220
  background: ${({theme:e})=>e.stigg.palette.switchHandle} !important;
266
221
  top: 0.5px !important;
267
222
  }
268
- `;function DP({discount:e,disabled:t}){return jsxRuntime.jsxs(P,{variant:"h6",color:t?"disabled":"primary",className:"stigg-discount-rate-text",children:[e,"% off"]})}function Rm({discountRate:e,selectedBillingPeriod:t,onBillingPeriodChanged:o,availableBillingPeriods:n}){if(n.length<=1)return null;let i=t===ah.BillingPeriod.Monthly;return jsxRuntime.jsxs(BP,{className:"stigg-period-picker-container",children:[jsxRuntime.jsx(Bm,{variant:"h6",className:"stigg-monthly-period-text",color:i?"primary":"disabled",children:"Monthly"}),jsxRuntime.jsx(RP,{className:"stigg-period-switch",uncheckedIcon:false,checkedIcon:false,height:16,width:33,onChange:r=>o(r?ah.BillingPeriod.Annually:ah.BillingPeriod.Monthly),checked:!i,borderRadius:10,handleDiameter:19}),jsxRuntime.jsx(Bm,{variant:"h6",className:"stigg-annual-period-text",color:i?"disabled":"primary",children:"Annual"}),e!==0&&jsxRuntime.jsx(DP,{discount:e,disabled:i})]})}function NP(e,t){if(!Ar__default.default(e)&&!Ar__default.default(t)){let o=t/12;return Math.round((e-o)/e*100)}return null}function Om(e,t){var n;let o;if(o=(n=e.paywallCalculatedPricePoints)==null?void 0:n.find(i=>i.billingPeriod===t),o||(o=e.pricePoints.find(i=>i.billingPeriod===t)),!(o!=null&&o.amount)){let i=e.pricePoints.find(r=>r.isTieredPrice&&r.billingPeriod===t);if(i)return Cn(i,1)}return o==null?void 0:o.amount}function zm(e){return e.reduce((t,o)=>{let n=Om(o,ah.BillingPeriod.Monthly),i=Om(o,ah.BillingPeriod.Annually),r=NP(n,i);return r&&(t=Math.max(t,r)),t},0)}var UP=e=>jsxRuntime.jsxs("svg",A(S({width:135,height:16,viewBox:"0 0 135 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:[jsxRuntime.jsx("path",{d:"M0.0987549 3.43016V12.9878H1.15589V9.52681H3.96527C5.94922 9.52681 7.28874 8.25245 7.28874 6.47848C7.28874 4.70452 5.94922 3.43016 3.96527 3.43016H0.0987549ZM1.15589 8.55656V4.40765H4.04492C5.33376 4.40765 6.18816 5.26205 6.18816 6.47848C6.18816 7.69492 5.33376 8.55656 4.04492 8.55656H1.15589Z",fill:"#001E6C"}),jsxRuntime.jsx("path",{d:"M11.7787 13.1616C13.9075 13.1616 15.6525 11.5397 15.6525 9.38199C15.6525 7.21703 13.9365 5.62408 11.8077 5.62408C9.64999 5.62408 7.93395 7.24599 7.93395 9.41095C7.93395 11.5687 9.62103 13.1616 11.7787 13.1616ZM11.7932 12.2276C10.2365 12.2276 9.02005 11.0256 9.02005 9.39647C9.02005 7.76732 10.2365 6.56537 11.7932 6.56537C13.321 6.56537 14.5664 7.76732 14.5664 9.39647C14.5664 11.0256 13.321 12.2276 11.7932 12.2276Z",fill:"#001E6C"}),jsxRuntime.jsx("path",{d:"M19.9054 12.9878L21.4766 6.94189H21.5056L23.0623 12.9878H24.4018L26.5958 5.8051H25.4155L23.7936 11.909H23.7647L22.2152 5.8051H20.7815L19.232 11.909H19.203L17.5522 5.8051H16.3575L18.5659 12.9878H19.9054Z",fill:"#001E6C"}),jsxRuntime.jsx("path",{d:"M34.9835 9.42544C34.9835 7.30392 33.4051 5.62408 31.1532 5.62408C29.0534 5.62408 27.3084 7.18083 27.3084 9.41095C27.3084 11.5542 28.9086 13.1616 31.1822 13.1616C32.7679 13.1616 34.0567 12.3941 34.6794 11.1922L33.7816 10.707C33.3688 11.6049 32.3696 12.2348 31.1966 12.2348C29.5241 12.2348 28.5031 10.9894 28.4017 9.7223H34.969C34.9835 9.59197 34.9835 9.54129 34.9835 9.42544ZM31.1387 6.55089C32.5434 6.55089 33.6657 7.49942 33.854 8.80998H28.4307C28.6552 7.5501 29.7558 6.55089 31.1387 6.55089Z",fill:"#001E6C"}),jsxRuntime.jsx("path",{d:"M39.5922 5.68201C38.564 5.68201 37.8182 6.20334 37.4924 6.93464L37.391 5.8051H36.486V12.9878H37.5431V8.5638C37.5431 7.44873 38.1585 6.77535 39.3171 6.77535H39.9977V5.68201H39.5922Z",fill:"#001E6C"}),jsxRuntime.jsx("path",{d:"M48.2486 9.42544C48.2486 7.30392 46.6702 5.62408 44.4183 5.62408C42.3185 5.62408 40.5735 7.18083 40.5735 9.41095C40.5735 11.5542 42.1737 13.1616 44.4473 13.1616C46.033 13.1616 47.3218 12.3941 47.9445 11.1922L47.0467 10.707C46.634 11.6049 45.6348 12.2348 44.4618 12.2348C42.7892 12.2348 41.7682 10.9894 41.6669 9.7223H48.2342C48.2486 9.59197 48.2486 9.54129 48.2486 9.42544ZM44.4039 6.55089C45.8085 6.55089 46.9308 7.49942 47.1191 8.80998H41.6958C41.9203 7.5501 43.0209 6.55089 44.4039 6.55089Z",fill:"#001E6C"}),jsxRuntime.jsx("path",{d:"M55.846 7.02877C55.2161 6.13817 54.2024 5.63132 53.0149 5.63132C50.9224 5.63132 49.2425 7.21703 49.2425 9.39647C49.2425 11.5759 50.8934 13.1616 52.986 13.1616C54.1807 13.1616 55.2161 12.6403 55.8533 11.7425L55.9981 12.9878H56.9032V2.56128L55.846 2.67713V7.02877ZM53.0294 12.2276C51.5306 12.2276 50.3286 11.0401 50.3286 9.39647C50.3286 7.75284 51.5306 6.56537 53.0294 6.56537C54.5789 6.56537 55.846 7.76732 55.846 9.39647C55.846 11.0256 54.5789 12.2276 53.0294 12.2276Z",fill:"#001E6C"}),jsxRuntime.jsx("path",{d:"M65.7314 5.63132C64.5367 5.63132 63.5085 6.14541 62.8713 7.04325V2.56128L61.8142 2.67713V12.9878H62.7192L62.8641 11.7497C63.494 12.6475 64.5077 13.1616 65.7024 13.1616C67.795 13.1616 69.4748 11.5759 69.4748 9.39647C69.4748 7.21703 67.8239 5.63132 65.7314 5.63132ZM65.6879 12.2276C64.1384 12.2276 62.8713 11.0256 62.8713 9.39647C62.8713 7.76732 64.1384 6.56537 65.6879 6.56537C67.1867 6.56537 68.3887 7.75284 68.3887 9.39647C68.3887 11.0401 67.1867 12.2276 65.6879 12.2276Z",fill:"#001E6C"}),jsxRuntime.jsx("path",{d:"M76.2187 5.8051V9.9178C76.2187 11.3297 75.3136 12.1841 74.0465 12.1841C72.7866 12.1841 72.077 11.4456 72.077 10.1133V5.8051H71.0199V10.2726C71.0199 11.9669 72.1349 13.0965 73.7641 13.0965C74.843 13.0965 75.6901 12.6765 76.2187 11.9814V12.8937C76.2187 14.1608 75.2629 15.0804 73.8727 15.0804C72.7504 15.0804 71.8236 14.4794 71.5847 13.4295L70.6579 13.9074C71.0995 15.16 72.3087 16 73.8582 16C75.8132 16 77.2758 14.5953 77.2758 12.7923V5.8051H76.2187Z",fill:"#001E6C"}),jsxRuntime.jsx("path",{d:"M108.672 10.4867C108.672 11.9077 107.411 12.7873 105.491 12.7873C104.464 12.7873 103.634 12.6028 102.84 12.2091C102.914 11.76 102.982 11.2187 103 10.5913C103.738 11.0219 104.575 11.231 105.381 11.231C106.34 11.231 106.839 11.0096 106.839 10.5421C106.857 10.0807 106.5 9.87155 105.067 9.59473C103.406 9.26255 102.668 8.57359 102.668 7.35559C102.668 5.97767 103.929 5.0857 105.848 5.0857C106.697 5.0857 107.54 5.24564 108.186 5.52246L107.866 7.06647C107.226 6.7712 106.537 6.63587 105.848 6.63587C104.95 6.63587 104.507 6.85733 104.507 7.29408C104.507 7.67547 104.815 7.83541 106.217 8.12453C108.007 8.50592 108.678 9.19488 108.678 10.4744L108.672 10.4867ZM112.879 11.0957C112.16 11.0957 111.581 10.7143 111.581 9.70546V6.88808H113.408L113.747 5.25794H111.581V2.93884C111.157 3.06187 110.517 3.2095 109.681 3.28332L109.662 10.0315C109.662 11.8708 110.763 12.7996 112.412 12.7996C112.787 12.7996 113.113 12.7627 113.39 12.6951L113.753 10.9665C113.525 11.0465 113.236 11.1018 112.879 11.1018V11.0957ZM114.965 12.6889H116.884V5.25794H114.965V12.6889ZM115.93 2.21912C115.309 2.21297 114.829 2.66817 114.823 3.27102C114.823 3.89232 115.278 4.35983 115.894 4.36598C116.515 4.36598 116.976 3.92923 116.989 3.32638C117.001 2.70508 116.546 2.23142 115.937 2.21912H115.93ZM126.056 5.25794V11.5263C126.056 13.8946 124.456 15.5247 121.756 15.5247C120.784 15.5247 119.714 15.3094 118.994 14.8973C119.492 14.3867 119.831 13.9438 120.046 13.6239C120.532 13.79 121.042 13.8762 121.565 13.8762C123.275 13.8762 124.143 12.9288 124.143 11.7354V11.4955C123.534 12.1968 122.654 12.6336 121.602 12.6336C119.584 12.6336 118.065 11.1326 118.065 8.90577C118.065 6.67893 119.726 5.098 121.756 5.098C122.808 5.098 123.724 5.4794 124.333 6.19912L124.395 5.25179H126.062L126.056 5.25794ZM124.155 8.90577C124.155 7.72468 123.294 6.82657 122.107 6.82657C120.919 6.82657 120.046 7.72468 120.046 8.90577C120.046 10.0868 120.907 10.9542 122.107 10.9542C123.306 10.9542 124.155 10.0561 124.155 8.90577ZM134.994 5.25794V11.5263C134.994 13.8946 133.394 15.5247 130.694 15.5247C129.722 15.5247 128.652 15.3094 127.932 14.8973C128.43 14.3867 128.769 13.9438 128.984 13.6239C129.47 13.79 129.98 13.8762 130.503 13.8762C132.213 13.8762 133.081 12.9288 133.081 11.7354V11.4955C132.472 12.1968 131.592 12.6336 130.54 12.6336C128.523 12.6336 127.003 11.1326 127.003 8.90577C127.003 6.67893 128.664 5.098 130.694 5.098C131.746 5.098 132.662 5.4794 133.271 6.19912L133.333 5.25179H135L134.994 5.25794ZM133.093 8.90577C133.093 7.72468 132.232 6.82657 131.045 6.82657C129.857 6.82657 128.984 7.72468 128.984 8.90577C128.984 10.0868 129.845 10.9542 131.045 10.9542C132.244 10.9542 133.093 10.0561 133.093 8.90577Z",fill:"#001E6C"}),jsxRuntime.jsx("path",{d:"M95.7092 14.9825C95.6354 15.0194 94.2267 15.6407 91.7353 15.5238C90.4374 15.4623 89.3117 15.2224 88.512 15.0009L92.8241 9.99361C93.5931 10.1905 94.5835 10.375 95.7092 10.4304C98.2005 10.5534 99.6092 9.92594 99.683 9.88903L95.7092 14.9886V14.9825ZM89.2686 5.36155C88.5612 2.96863 88.838 1.45537 88.8564 1.3754L84.8457 6.44421C84.8334 6.52418 84.5566 8.03744 85.2578 10.4304C85.6269 11.673 86.1252 12.7126 86.5312 13.4384L90.3759 8.0682C90.0068 7.36693 89.5885 6.44421 89.2686 5.3677V5.36155ZM99.2647 5.89058C98.6988 3.97132 97.813 2.55033 97.4501 2.009L93.8822 6.55494L94.5527 9.77216C94.9526 9.82752 95.3462 9.86443 95.7461 9.88903C95.9491 9.89518 96.1521 9.90134 96.3489 9.90134C98.2805 9.90134 99.357 9.44613 99.4739 9.39076L99.7507 9.26773C99.7753 8.60338 99.7322 7.42844 99.2709 5.88443L99.2647 5.89058ZM97.0256 1.68297C96.4166 1.45537 94.8295 0.932493 92.8303 0.83407C91.2248 0.754101 90.0744 0.987856 89.4347 1.1724L89.3793 1.46767C89.367 1.52919 89.121 2.96248 89.7792 5.20777C89.8899 5.58916 90.0252 5.9644 90.1729 6.33964L93.4577 6.22891L97.0318 1.68912L97.0256 1.68297Z",fill:"#001E6C"})]})),Vm=UP;var $l="stigg-watermark",zP=y(Vm)`
269
- * {
270
- fill: ${({theme:e})=>e.stigg.palette.text.secondary};
271
- }
272
- `,VP=y.div`
273
- align-self: ${({$alignSelf:e})=>e||"unset"};
274
-
275
- @media (max-width: 1040px) {
276
- ${({$smallScreenAlign:e})=>e&&`align-self: ${e};`}
277
- }
278
- `;function Jt({source:e,showWatermark:t,align:o,smallScreenAlign:n="center",style:i={}}){if(!t)return null;let r=()=>{let a=window.location.hostname.replace("www.","");window.open(`https://www.stigg.io/?utm_source=${a}&utm_medium=referral&utm_campaign=${e}`,"_blank");};return jsxRuntime.jsx(VP,{$alignSelf:o,$smallScreenAlign:n,className:$l,style:S({cursor:"pointer"},i),onClick:r,children:jsxRuntime.jsx(zP,{})})}function Hl(e,t){return e.pricePoints.some(o=>o.billingPeriod===t)}function Wl(e,t){return e.some(o=>Hl(o,t))}function Hm(e,t,o){return e.filter(n=>n.pricingType!==ah.PricingType.Paid||Hl(n,t)).filter(n=>!o||!o({plan:n}))}var GP=y.div`
223
+ `;function Qu({discount:e,disabled:t}){return jsxRuntime.jsxs(chunkMY4ZIUAV_cjs_js.f,{variant:"h6",color:t?"disabled":"primary",className:"stigg-discount-rate-text",children:[e,"% off"]})}function Qa({discountRate:e,selectedBillingPeriod:t,onBillingPeriodChanged:o,availableBillingPeriods:r}){if(r.length<=1)return null;let n=t===jsClientSdk.BillingPeriod.Monthly;return jsxRuntime.jsxs(Zu,{className:"stigg-period-picker-container",children:[jsxRuntime.jsx(Ya,{variant:"h6",className:"stigg-monthly-period-text",color:n?"primary":"disabled",children:"Monthly"}),jsxRuntime.jsx(Yu,{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(Ya,{variant:"h6",className:"stigg-annual-period-text",color:n?"disabled":"primary",children:"Annual"}),e!==0&&jsxRuntime.jsx(Qu,{discount:e,disabled:n})]})}function Ku(e,t){if(!Po__default.default(e)&&!Po__default.default(t)){let o=t/12;return Math.round((e-o)/e*100)}return null}function Xa(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 ht(n,1)}return o==null?void 0:o.amount}function ja(e){return e.reduce((t,o)=>{let r=Xa(o,jsClientSdk.BillingPeriod.Monthly),n=Xa(o,jsClientSdk.BillingPeriod.Annually),i=Ku(r,n);return i&&(t=Math.max(t,i)),t},0)}function Pn(e,t){return e.pricePoints.some(o=>o.billingPeriod===t)}function bn(e,t){return e.some(o=>Pn(o,t))}function es(e,t,o){return e.filter(r=>r.pricingType!==jsClientSdk.PricingType.Paid||Pn(r,t)).filter(r=>!o||!o({plan:r}))}var ju=chunkMY4ZIUAV_cjs_js.e.div`
279
224
  color: ${({theme:e})=>e.stigg.palette.text.primary};
280
225
  display: flex;
281
226
  align-items: stretch;
@@ -283,7 +228,7 @@
283
228
  flex-wrap: wrap;
284
229
  padding: 10px 0;
285
230
  gap: ${({theme:e})=>e.stigg.layout.planMargin};
286
- `,jP=y.div`
231
+ `,eg=chunkMY4ZIUAV_cjs_js.e.div`
287
232
  display: flex;
288
233
  flex-direction: column;
289
234
  align-items: center;
@@ -291,17 +236,17 @@
291
236
  & * {
292
237
  box-sizing: border-box;
293
238
  }
294
- `,YP=y.div`
239
+ `,tg=chunkMY4ZIUAV_cjs_js.e.div`
295
240
  display: flex;
296
241
  flex-direction: column;
297
242
  align-items: center;
298
- `,Gm=({plans:e,customer:t,currentSubscription:o,highlightedPlanId:n,selectedBillingPeriod:i,onBillingPeriodChanged:r,availableBillingPeriods:a,isCustomerOnTrial:s,onPlanSelected:l,paywallLocale:c,locale:d,shouldHidePlan:u,selectDefaultTierIndex:p,currentSubscriptionOverride:h,hideCompatibleAddons:m,showWatermark:g})=>{let f=zm(e),x=e.some(E=>!!E.description),b=Wl(e,ah.BillingPeriod.Monthly),T=Wl(e,ah.BillingPeriod.Annually),k=Hm(e,i,u),w=Fc.useCallback((E,B,O)=>l({plan:E,customer:t,subscription:o,intentionType:B,selectedBillingPeriod:i,billableFeatures:O}),[t,i,o,l]),v=!!o&&o.plan.pricingType===ah.PricingType.Custom,_=Fc.useMemo(()=>k.some(E=>{var U;let B=E.pricePoints.filter(L=>L.billingPeriod===i),O=(U=E.paywallCalculatedPricePoints)==null?void 0:U.find(L=>L.billingPeriod===i);return B.length>1&&!!(O!=null&&O.additionalChargesMayApply)}),[i,k]),M=Fc.useMemo(()=>k.some(E=>!!Ir(E,i,c,d,b).unit),[i,b,d,c,k]),I=Fc.useMemo(()=>!v&&k.some(E=>{let B=Mr({plan:E,billingPeriod:i,currentSubscription:o,currentSubscriptionOverride:h});return Object.values(B).length>0}),[i,o,h,v,k]),F=k.some(E=>E.isCurrentCustomerPlan&&E.trialDaysLeft);return jsxRuntime.jsx(jP,{className:"stigg-paywall-container",children:jsxRuntime.jsxs(YP,{className:"stigg-paywall-layout",children:[jsxRuntime.jsx(Rm,{onBillingPeriodChanged:r,selectedBillingPeriod:i,availableBillingPeriods:a,discountRate:f}),jsxRuntime.jsx(GP,{className:"stigg-paywall-plans-layout",children:k.map(E=>jsxRuntime.jsx(Lm,{withUnitPriceRow:M,withTiersRow:I,withTrialLeftRow:F,shouldShowDescriptionSection:x,hasMonthlyPrice:b,hasAnnuallyPrice:T,plan:E,withStartingAtRow:_,currentSubscription:o,currentSubscriptionOverride:h,billingPeriod:i,isHighlighted:E.id===n,isCustomerOnTrial:s,onPlanSelected:(B,O)=>w(E,B,O),paywallLocale:c,locale:d,customer:t,isCustomerInCustomPlan:v,selectDefaultTierIndex:p,hideCompatibleAddons:m},E.id))}),jsxRuntime.jsx(Jt,{source:"paywall",align:"end",style:{marginTop:16},showWatermark:g})]})})};var jl=class{error(t,o,...n){console.error(t,o||{},n);}log(t,o){console.log(t,o||{});}debug(t,o){console.debug(t,o||{});}},no=new jl;function jm(e,t,o){let n=e.flatMap(s=>s.pricePoints).map(s=>s.billingPeriod),i=lodash.countBy(n),r=lodash.uniq(n),a;if(o&&r.includes(o))a=o;else if(t){let s=t.find(l=>l.status===ah.SubscriptionStatus.Active);s&&s.prices.length>0&&(a=s==null?void 0:s.prices[0].billingPeriod);}return a||(a=(i[ah.BillingPeriod.Monthly]||0)>(i[ah.BillingPeriod.Annually]||0)?ah.BillingPeriod.Monthly:ah.BillingPeriod.Annually),{defaultBillingPeriod:a,availableBillingPeriods:r}}function Zm(e){return fc__default.default.utc(e).diff(fc__default.default.utc(),"days",false)+1}var Br={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 io(e,t="px"){if(e)return `${e}${t}`}function Rr(e){if(!e)return "normal";switch(e){case ah.FontWeight.Normal:return "normal";case ah.FontWeight.Bold:return "bold";default:return "normal"}}function Si(e,t){var n,i,r,a,s,l,c,d;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:io((n=e==null?void 0:e.h1)==null?void 0:n.fontSize)||o.h1.fontSize,fontWeight:Rr((i=e==null?void 0:e.h1)==null?void 0:i.fontWeight)||o.h1.fontWeight,semanticElement:o.h1.semanticElement},h2:{fontSize:io((r=e==null?void 0:e.h2)==null?void 0:r.fontSize)||o.h2.fontSize,fontWeight:Rr((a=e==null?void 0:e.h2)==null?void 0:a.fontWeight)||o.h2.fontWeight,semanticElement:o.h2.semanticElement},h3:{fontSize:io((s=e==null?void 0:e.h3)==null?void 0:s.fontSize)||o.h3.fontSize,fontWeight:Rr((l=e==null?void 0:e.h3)==null?void 0:l.fontWeight)||o.h3.fontWeight,semanticElement:o.h3.semanticElement},body:{fontSize:io((c=e==null?void 0:e.body)==null?void 0:c.fontSize)||o.body.fontSize,fontWeight:Rr((d=e==null?void 0:e.body)==null?void 0:d.fontWeight)||o.body.fontWeight,semanticElement:o.body.semanticElement}}}function Zl(e){if(e)switch(e){case ah.Alignment.Left:return "left";case ah.Alignment.Center:return "center";case ah.Alignment.Right:return "right";default:return}}function Km(e){let{palette:t,customCss:o,typography:n}=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:Si(n),customCss:o||void 0}}function qm(e){let{palette:t,layout:o,customCss:n,typography:i}=e;return {customCss:n||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:Si(i),layout:{ctaAlignment:Zl(o==null?void 0:o.alignment),headerAlignment:Zl(o==null?void 0:o.alignment),descriptionAlignment:Zl(o==null?void 0:o.alignment),planMaxWidth:io(o==null?void 0:o.planWidth),planMinWidth:io(o==null?void 0:o.planWidth),planMargin:io(o==null?void 0:o.planMargin),planPadding:io(o==null?void 0:o.planPadding)}}}function Qm(e){let{palette:t,typography:o,customCss:n}=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:Si(o,Br),customCss:n||void 0}}function JP(e){let t=true,o=(e==null?void 0:e.find(r=>r.status===ah.SubscriptionStatus.InTrial))||null,n=o==null?void 0:o.plan,i=o!=null&&o.trialEndDate?Zm(o.trialEndDate):void 0;return n||(t=false,o=(e==null?void 0:e.find(r=>r.status===ah.SubscriptionStatus.Active))||null,n=o==null?void 0:o.plan),{currentSubscription:o,currentPlan:n,isCustomerOnTrial:t,trialDaysLeft:i}}function oh(e,t,o){var k,w;let{plans:n,currency:i,configuration:r,customer:a,activeSubscriptions:s,paywallCalculatedPricePoints:l}=e||{},{currentSubscription:c,currentPlan:d,isCustomerOnTrial:u,trialDaysLeft:p}=JP(s),h=o==null?void 0:o({currentSubscription:c}),m=(c==null?void 0:c.scheduledUpdates)||[],g=(k=c==null?void 0:c.price)==null?void 0:k.billingPeriod,f=m.find(({subscriptionScheduleType:v})=>v===ah.SubscriptionScheduleType.Downgrade),x=m.find(({subscriptionScheduleType:v})=>v===ah.SubscriptionScheduleType.BillingPeriod),b=Gg__default.default(n,v=>v.order).map(v=>{var F;let _=(F=a==null?void 0:a.eligibleForTrial)==null?void 0:F.find(E=>E.productId===v.product.id),M=h!=null&&h.planId?(h==null?void 0:h.planId)===v.id:v.id===(d==null?void 0:d.id),I=E=>{var L;let B=f==null?void 0:f.scheduleVariables,O=x==null?void 0:x.scheduleVariables,U=v.pricePoints.some(V=>V.billingPeriod===E);return f?((L=f.targetPackage)==null?void 0:L.refId)===v.id&&(!U||B.billingPeriod===E):x&&M?O.billingPeriod===E:false};return A(S({},v),{paywallCalculatedPricePoints:l==null?void 0:l.filter(E=>E.planId===v.id),isTriable:!Ar__default.default(v.defaultTrialConfig)&&(!_||_.eligible),isCurrentCustomerPlan:M,currentCustomerPlanBillingPeriod:g,isUpcomingPlan:false,trialDaysLeft:p,isNextPlan:I,paywallCurrency:i,scheduledUpdate:f||x})});if(n&&d){let v=d&&((w=n==null?void 0:n.find(_=>_.id===(d==null?void 0:d.id)))==null?void 0:w.order);Ar__default.default(v)||(b=b.map(_=>A(S({},_),{isLowerThanCurrentPlan:v>_.order})),t&&(b=b.filter(_=>_.order>=v)));}let T=r?qm(r):void 0;return {currentPlan:d,currentSubscription:c,currentSubscriptionOverride:h,isCustomerOnTrial:u,plans:b,paywallConfiguration:T}}var ih="7.26.0";var rh="@stigg/react-sdk";var Ti=Fc__default.default.createContext(null);Ti.displayName="StiggContext";var iS="en-US",rS=({apiKey:e,baseUri:t,baseEdgeUri:o,enableEdge:n,customerId:i,customerToken:r,resourceId:a,theme:s,locale:l,cacheTtlMs:c,useEntitlementPolling:d,entitlementPollingInterval:u,entitlementsFallback:p,stiggClient:h,children:m,offline:g,clientName:f=rh,clientVersion:x=ih})=>{let b=Fc.useRef(e),T={apiKey:e,customerId:i,customerToken:r,resourceId:a,baseUri:t,baseEdgeUri:o,enableEdge:n,entitlementsFallback:p,cacheTtlMs:c,useEntitlementPolling:d,entitlementPollingInterval:u,clientName:f,clientVersion:x,offline:g},[k,w]=Fc.useState(()=>({stigg:h!=null?h:ah__default.default.initialize(A(S({},T),{lazyLoad:true})),locale:l||iS,isInitialized:false,theme:s,refreshData:()=>R(null,null,function*(){w(v=>A(S({},v),{customerPortalUpdatedAt:new Date})),yield k.stigg.refresh();})}));return Fc.useEffect(()=>{let v=true,_=E=>{v&&w(E);},M=()=>_(E=>A(S({},E),{updatedAt:new Date})),I=E=>_(B=>(B.stigg&&B.stigg.removeListener("entitlementsUpdated",M),E.addListener("entitlementsUpdated",M),A(S({},B),{stigg:E,isInitialized:true,updatedAt:new Date})));return R(null,null,function*(){let E=k.stigg;e!==b.current&&(no.log("Updating stigg client",{apiKey:e}),b.current=e,E=ah__default.default.initialize(S({},T)),_(B=>A(S({},B),{isInitialized:false,updatedAt:new Date}))),yield E.waitForInitialization(),I(E);}),()=>{v=false,k.stigg.removeListener("entitlementsUpdated",M),k.stigg.clearCustomer();}},[e]),Fc.useEffect(()=>{let v=k.stigg;i?v.setCustomerId(i,r,a):v.clearCustomer();},[i,r,a]),Fc.useEffect(()=>{w(v=>A(S({},v),{theme:s}));},[s]),jsxRuntime.jsx(Ti.Provider,{value:k,children:jsxRuntime.jsx(ro.SkeletonTheme,{baseColor:"#F5F6F9",highlightColor:"#e5e6ea",children:m})})};function D(e){let{optional:t}=e||{},o=Fc.useContext(Ti);if(!o&&!t)throw new Error("Could not find Stigg context; You need to wrap your app in an <StiggProvider> component.");return o}function lh({productId:e,resourceId:t,showOnlyEligiblePlans:o,billingCountryCode:n,preferredBillingPeriod:i,currentSubscriptionOverrideFn:r}){let{stigg:a,locale:s}=D(),[l,c]=Fc.useState(ah.BillingPeriod.Annually),[d,u]=Fc.useState([]),[p,h]=Fc.useState(null),[m,g]=Fc.useState(true);Fc.useEffect(()=>{R(null,null,function*(){try{g(!0),yield a.waitForInitialization();let b=yield a.getPaywall({productId:e,resourceId:t,billingCountryCode:n}),{availableBillingPeriods:T,defaultBillingPeriod:k}=jm(b.plans,b.activeSubscriptions,i);h(b),u(T),c(k);}catch(b){no.error(`Failed to load paywall ${b==null?void 0:b.message}`,b);}finally{g(false);}});},[a,e,a.isCustomerLoaded,n,t,i]);let f=oh(p,o,r);return S({customer:(p==null?void 0:p.customer)||null,isLoading:m,selectedBillingPeriod:l,setSelectedBillingPeriod:c,availableBillingPeriods:d,locale:s,configuration:f.paywallConfiguration,showWatermark:a.getShowWatermark()},f)}function dh(e){return f2__default.default({highlightChip:"Recommended",addonsTitle:"Available add-ons:",planCTAButton:{upgrade:"Upgrade",downgrade:"Downgrade",startTrial:o=>{var n;return `Start ${(n=o.defaultTrialConfig)==null?void 0:n.duration} day trial`},custom:"Contact us",currentPlan:"Current plan",startNew:"Get started",switchToBillingPeriod:o=>o===ah.BillingPeriod.Monthly?"Switch to monthly billing":"Switch to annual billing",cancelScheduledUpdate:"Cancel"},price:{startingAtCaption:"Starts at",pricePeriod:o=>o===ah.BillingPeriod.Monthly?"/ month":"/ year",free:o=>({price:`${o==null?void 0:o.symbol}0`}),custom:"Custom",priceNotSet:"Price not set"}},e)}var dS=e=>jsxRuntime.jsx("svg",A(S({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"})})),ph=dS;var uS=y.div`
243
+ `,os=({plans:e,customer:t,currentSubscription:o,highlightedPlanId:r,selectedBillingPeriod:n,onBillingPeriodChanged:i,availableBillingPeriods:s,isCustomerOnTrial:l,onPlanSelected:a,paywallLocale:c,locale:u,shouldHidePlan:f,selectDefaultTierIndex:p,currentSubscriptionOverride:h,hideCompatibleAddons:g,showWatermark:y})=>{let C=ja(e),b=e.some(A=>!!A.description),x=bn(e,jsClientSdk.BillingPeriod.Monthly),S=bn(e,jsClientSdk.BillingPeriod.Annually),T=es(e,n,f),F=ii.useCallback((A,Z,$)=>a({plan:A,customer:t,subscription:o,intentionType:Z,selectedBillingPeriod:n,billableFeatures:$}),[t,n,o,a]),w=!!o&&o.plan.pricingType===jsClientSdk.PricingType.Custom,I=ii.useMemo(()=>T.some(A=>{var _;let Z=A.pricePoints.filter(z=>z.billingPeriod===n),$=(_=A.paywallCalculatedPricePoints)==null?void 0:_.find(z=>z.billingPeriod===n);return Z.length>1&&!!($!=null&&$.additionalChargesMayApply)}),[n,T]),k=ii.useMemo(()=>T.some(A=>!!So(A,n,c,u,x).unit),[n,x,u,c,T]),L=ii.useMemo(()=>!w&&T.some(A=>{let Z=bo({plan:A,billingPeriod:n,currentSubscription:o,currentSubscriptionOverride:h});return Object.values(Z).length>0}),[n,o,h,w,T]),E=T.some(A=>A.isCurrentCustomerPlan&&A.trialDaysLeft);return jsxRuntime.jsx(eg,{className:"stigg-paywall-container",children:jsxRuntime.jsxs(tg,{className:"stigg-paywall-layout",children:[jsxRuntime.jsx(Qa,{onBillingPeriodChanged:i,selectedBillingPeriod:n,availableBillingPeriods:s,discountRate:C}),jsxRuntime.jsx(ju,{className:"stigg-paywall-plans-layout",children:T.map(A=>jsxRuntime.jsx(Za,{withUnitPriceRow:k,withTiersRow:L,withTrialLeftRow:E,shouldShowDescriptionSection:b,hasMonthlyPrice:x,hasAnnuallyPrice:S,plan:A,withStartingAtRow:I,currentSubscription:o,currentSubscriptionOverride:h,billingPeriod:n,isHighlighted:A.id===r,isCustomerOnTrial:l,onPlanSelected:(Z,$)=>F(A,Z,$),paywallLocale:c,locale:u,customer:t,isCustomerInCustomPlan:w,selectDefaultTierIndex:p,hideCompatibleAddons:g},A.id))}),jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.q,{source:"paywall",align:"end",style:{marginTop:16},showWatermark:y})]})})};function rs(e,t,o){let r=e.flatMap(l=>l.pricePoints).map(l=>l.billingPeriod),n=ng__default.default(r),i=ig__default.default(r),s;if(o&&i.includes(o))s=o;else if(t){let l=t.find(a=>a.status===jsClientSdk.SubscriptionStatus.Active);l&&l.prices.length>0&&(s=l==null?void 0:l.prices[0].billingPeriod);}return s||(s=(n[jsClientSdk.BillingPeriod.Monthly]||0)>(n[jsClientSdk.BillingPeriod.Annually]||0)?jsClientSdk.BillingPeriod.Monthly:jsClientSdk.BillingPeriod.Annually),{defaultBillingPeriod:s,availableBillingPeriods:i}}function ns(e){return Q.utc(e).diff(Q.utc(),"days",false)+1}var Bo={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 Ye(e,t="px"){if(e)return `${e}${t}`}function Ao(e){if(!e)return "normal";switch(e){case jsClientSdk.FontWeight.Normal:return "normal";case jsClientSdk.FontWeight.Bold:return "bold";default:return "normal"}}function Wt(e,t){var r,n,i,s,l,a,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:Ye((r=e==null?void 0:e.h1)==null?void 0:r.fontSize)||o.h1.fontSize,fontWeight:Ao((n=e==null?void 0:e.h1)==null?void 0:n.fontWeight)||o.h1.fontWeight,semanticElement:o.h1.semanticElement},h2:{fontSize:Ye((i=e==null?void 0:e.h2)==null?void 0:i.fontSize)||o.h2.fontSize,fontWeight:Ao((s=e==null?void 0:e.h2)==null?void 0:s.fontWeight)||o.h2.fontWeight,semanticElement:o.h2.semanticElement},h3:{fontSize:Ye((l=e==null?void 0:e.h3)==null?void 0:l.fontSize)||o.h3.fontSize,fontWeight:Ao((a=e==null?void 0:e.h3)==null?void 0:a.fontWeight)||o.h3.fontWeight,semanticElement:o.h3.semanticElement},body:{fontSize:Ye((c=e==null?void 0:e.body)==null?void 0:c.fontSize)||o.body.fontSize,fontWeight:Ao((u=e==null?void 0:e.body)==null?void 0:u.fontWeight)||o.body.fontWeight,semanticElement:o.body.semanticElement}}}function kn(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 as(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:Wt(r),customCss:o||void 0}}function ss(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:Wt(n),layout:{ctaAlignment:kn(o==null?void 0:o.alignment),headerAlignment:kn(o==null?void 0:o.alignment),descriptionAlignment:kn(o==null?void 0:o.alignment),planMaxWidth:Ye(o==null?void 0:o.planWidth),planMinWidth:Ye(o==null?void 0:o.planWidth),planMargin:Ye(o==null?void 0:o.planMargin),planPadding:Ye(o==null?void 0:o.planPadding)}}}function ls(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:Wt(o,Bo),customCss:r||void 0}}function sg(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?ns(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 ms(e,t,o){var T,F;let{plans:r,currency:n,configuration:i,customer:s,activeSubscriptions:l,paywallCalculatedPricePoints:a}=e||{},{currentSubscription:c,currentPlan:u,isCustomerOnTrial:f,trialDaysLeft:p}=sg(l),h=o==null?void 0:o({currentSubscription:c}),g=(c==null?void 0:c.scheduledUpdates)||[],y=(T=c==null?void 0:c.price)==null?void 0:T.billingPeriod,C=g.find(({subscriptionScheduleType:w})=>w===jsClientSdk.SubscriptionScheduleType.Downgrade),b=g.find(({subscriptionScheduleType:w})=>w===jsClientSdk.SubscriptionScheduleType.BillingPeriod),x=Ql__default.default(r,w=>w.order).map(w=>{var E;let I=(E=s==null?void 0:s.eligibleForTrial)==null?void 0:E.find(A=>A.productId===w.product.id),k=h!=null&&h.planId?(h==null?void 0:h.planId)===w.id:w.id===(u==null?void 0:u.id),L=A=>{var z;let Z=C==null?void 0:C.scheduleVariables,$=b==null?void 0:b.scheduleVariables,_=w.pricePoints.some(q=>q.billingPeriod===A);return C?((z=C.targetPackage)==null?void 0:z.refId)===w.id&&(!_||Z.billingPeriod===A):b&&k?$.billingPeriod===A:false};return chunkMY4ZIUAV_cjs_js.b(chunkMY4ZIUAV_cjs_js.a({},w),{paywallCalculatedPricePoints:a==null?void 0:a.filter(A=>A.planId===w.id),isTriable:!Po__default.default(w.defaultTrialConfig)&&(!I||I.eligible),isCurrentCustomerPlan:k,currentCustomerPlanBillingPeriod:y,isUpcomingPlan:false,trialDaysLeft:p,isNextPlan:L,paywallCurrency:n,scheduledUpdate:C||b})});if(r&&u){let w=u&&((F=r==null?void 0:r.find(I=>I.id===(u==null?void 0:u.id)))==null?void 0:F.order);Po__default.default(w)||(x=x.map(I=>chunkMY4ZIUAV_cjs_js.b(chunkMY4ZIUAV_cjs_js.a({},I),{isLowerThanCurrentPlan:w>I.order})),t&&(x=x.filter(I=>I.order>=w)));}let S=i?ss(i):void 0;return {currentPlan:u,currentSubscription:c,currentSubscriptionOverride:h,isCustomerOnTrial:f,plans:x,paywallConfiguration:S}}function us({productId:e,resourceId:t,showOnlyEligiblePlans:o,billingCountryCode:r,preferredBillingPeriod:n,currentSubscriptionOverrideFn:i}){let{stigg:s,locale:l}=chunkMY4ZIUAV_cjs_js.u(),[a,c]=ii.useState(jsClientSdk.BillingPeriod.Annually),[u,f]=ii.useState([]),[p,h]=ii.useState(null),[g,y]=ii.useState(true);ii.useEffect(()=>{chunkMY4ZIUAV_cjs_js.d(null,null,function*(){try{y(!0),yield s.waitForInitialization();let x=yield s.getPaywall({productId:e,resourceId:t,billingCountryCode:r}),{availableBillingPeriods:S,defaultBillingPeriod:T}=rs(x.plans,x.activeSubscriptions,n);h(x),f(S),c(T);}catch(x){chunkMY4ZIUAV_cjs_js.r.error(`Failed to load paywall ${x==null?void 0:x.message}`,x);}finally{y(false);}});},[s,e,s.isCustomerLoaded,r,t,n]);let C=ms(p,o,i);return chunkMY4ZIUAV_cjs_js.a({customer:(p==null?void 0:p.customer)||null,isLoading:g,selectedBillingPeriod:a,setSelectedBillingPeriod:c,availableBillingPeriods:u,locale:l,configuration:C.paywallConfiguration,showWatermark:s.getShowWatermark()},C)}function fs(e){return dg__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 pg=e=>jsxRuntime.jsx("svg",chunkMY4ZIUAV_cjs_js.b(chunkMY4ZIUAV_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"})})),hs=pg;var mg=chunkMY4ZIUAV_cjs_js.e.div`
299
244
  display: flex;
300
245
  flex-direction: column;
301
246
  align-items: center;
302
- `,Kl=y(ph)`
247
+ `,wn=chunkMY4ZIUAV_cjs_js.e(hs)`
303
248
  margin-right: 16px;
304
- `,pS=y.div`
249
+ `,ug=chunkMY4ZIUAV_cjs_js.e.div`
305
250
  display: flex;
306
251
  flex-direction: column;
307
252
  align-items: flex-start;
@@ -313,99 +258,25 @@
313
258
  max-width: ${({theme:e})=>e.stigg.layout.planMaxWidth};
314
259
  min-height: 450px;
315
260
  border: ${({theme:e})=>`1px solid ${e.stigg.palette.outlinedBorder}`};
316
- `,mS=y.div`
261
+ `,gg=chunkMY4ZIUAV_cjs_js.e.div`
317
262
  display: flex;
318
263
  gap: ${({theme:e})=>e.stigg.layout.planMargin};
319
264
  flex-wrap: wrap;
320
265
  justify-content: center;
321
- `,ql=y.div`
266
+ `,Bn=chunkMY4ZIUAV_cjs_js.e.div`
322
267
  display: flex;
323
268
  align-items: center;
324
269
  margin-bottom: 12px;
325
- `,hS=y.div`
270
+ `,fg=chunkMY4ZIUAV_cjs_js.e.div`
326
271
  margin-top: auto;
327
- `,gS=y.div`
272
+ `,yg=chunkMY4ZIUAV_cjs_js.e.div`
328
273
  width: 150px;
329
274
  margin-bottom: ${({theme:e})=>e.stigg.layout.switchBottomSpacing};
330
275
  padding: 12px 12px;
331
276
  border-radius: 10px;
332
277
  background-color: white;
333
278
  border: ${({theme:e})=>`1px solid ${e.stigg.palette.outlinedBorder}`};
334
- `;function fS(){return jsxRuntime.jsxs(pS,{children:[jsxRuntime.jsx(ro__default.default,{width:120,borderRadius:4}),jsxRuntime.jsx(ro__default.default,{circle:true,width:40,height:40}),jsxRuntime.jsx(ro__default.default,{style:{marginBottom:33},width:120,borderRadius:4}),jsxRuntime.jsxs(ql,{children:[jsxRuntime.jsx(Kl,{}),jsxRuntime.jsx(ro__default.default,{width:120,borderRadius:4})]}),jsxRuntime.jsxs(ql,{children:[jsxRuntime.jsx(Kl,{}),jsxRuntime.jsx(ro__default.default,{width:120,borderRadius:4})]}),jsxRuntime.jsxs(ql,{children:[jsxRuntime.jsx(Kl,{}),jsxRuntime.jsx(ro__default.default,{width:120,borderRadius:4})]}),jsxRuntime.jsx(hS,{children:jsxRuntime.jsx(ro__default.default,{height:50,borderRadius:4})})]})}function mh({skeletonPlanCount:e=3}){return jsxRuntime.jsxs(uS,{className:"stigg-skeleton-loader-container",children:[jsxRuntime.jsx(gS,{className:"stigg-skeleton-loader-billing-period",children:jsxRuntime.jsx(ro__default.default,{borderRadius:4})}),jsxRuntime.jsx(mS,{className:"stigg-skeleton-loader-plans-container",children:Array.from({length:e}).map((t,o)=>jsxRuntime.jsx(fS,{},o))})]})}var hh=({externalFontUrl:e})=>jsxRuntime.jsx(react.Global,{styles:react.css`
335
- ${e&&`
336
- @font-face {
337
- font-family: 'custom-font';
338
- font-style: normal;
339
- font-weight: normal;
340
- src: local('custom-font'), url(${e}) format('woff');
341
- }
342
- `}
343
-
344
- /* latin-ext */
345
- @font-face {
346
- font-family: 'DM Sans';
347
- font-style: normal;
348
- font-weight: 400;
349
- font-display: swap;
350
- src: url(https://fonts.gstatic.com/s/dmsans/v11/rP2Hp2ywxg089UriCZ2IHTWEBlwu8Q.woff2) format('woff2');
351
- unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F,
352
- U+A720-A7FF;
353
- }
354
- /* latin */
355
- @font-face {
356
- font-family: 'DM Sans';
357
- font-style: normal;
358
- font-weight: 400;
359
- font-display: swap;
360
- src: url(https://fonts.gstatic.com/s/dmsans/v11/rP2Hp2ywxg089UriCZOIHTWEBlw.woff2) format('woff2');
361
- unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074,
362
- U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
363
- }
364
- /* latin-ext */
365
- @font-face {
366
- font-family: 'DM Sans';
367
- font-style: normal;
368
- font-weight: 500;
369
- font-display: swap;
370
- src: url(https://fonts.gstatic.com/s/dmsans/v11/rP2Cp2ywxg089UriAWCrCBamC3YU-CnE6Q.woff2) format('woff2');
371
- unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F,
372
- U+A720-A7FF;
373
- }
374
- /* latin */
375
- @font-face {
376
- font-family: 'DM Sans';
377
- font-style: normal;
378
- font-weight: 500;
379
- font-display: swap;
380
- src: url(https://fonts.gstatic.com/s/dmsans/v11/rP2Cp2ywxg089UriAWCrCBimC3YU-Ck.woff2) format('woff2');
381
- unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074,
382
- U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
383
- }
384
- /* latin-ext */
385
- @font-face {
386
- font-family: 'DM Sans';
387
- font-style: normal;
388
- font-weight: 700;
389
- font-display: swap;
390
- src: url(https://fonts.gstatic.com/s/dmsans/v11/rP2Cp2ywxg089UriASitCBamC3YU-CnE6Q.woff2) format('woff2');
391
- unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F,
392
- U+A720-A7FF;
393
- }
394
- /* latin */
395
- @font-face {
396
- font-family: 'DM Sans';
397
- font-style: normal;
398
- font-weight: 700;
399
- font-display: swap;
400
- src: url(https://fonts.gstatic.com/s/dmsans/v11/rP2Cp2ywxg089UriASitCBimC3YU-Ck.woff2) format('woff2');
401
- unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074,
402
- U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
403
- }
404
- `});var vS=y.div`
405
- ${({$customCss:e})=>e&&react.css`
406
- ${e}
407
- `}
408
- `;function Vo(e){let{theme:t}=D(),o=f2__default.default(e,t);return dm(o)}var _S=e=>({primary:{main:e.palette.primary}}),ht=({children:e,componentTheme:t})=>{let o=Vo(t),n=_S(o),i=styles.createTheme({palette:n,stigg:o});return jsxRuntime.jsx(styles.ThemeProvider,{theme:{[styles.THEME_ID]:i},children:jsxRuntime.jsx(react.ThemeProvider,{theme:{stigg:o},children:jsxRuntime.jsxs(vS,{$customCss:o.customCss,children:[jsxRuntime.jsx(hh,{externalFontUrl:o.typography.fontFamilyUrl}),e]})})})};var St=Fc__default.default.createContext(null);St.displayName="CustomerPortalContext";var ut=()=>{let e=Fc.useContext(St);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 jt(e){return !!Fc.useContext(e)}var fh=({productId:e,resourceId:t,highlightedPlanId:o,showOnlyEligiblePlans:n,textOverrides:i,onPlanSelected:r,preferredBillingPeriod:a,onBillingPeriodChange:s,billingCountryCode:l,shouldHidePlan:c,selectDefaultTierIndex:d,currentSubscriptionOverride:u,hideCompatibleAddons:p,skeletonPlanCount:h=3})=>{let m=jt(St),g=false;if(m){let{isLoading:L,resourceId:V}=ut();g=L,t=V;}let{plans:f,customer:x,currentSubscription:b,currentSubscriptionOverride:T,isCustomerOnTrial:k,isLoading:w,selectedBillingPeriod:v,setSelectedBillingPeriod:_,availableBillingPeriods:M,locale:I,configuration:F,showWatermark:E}=lh({productId:e,resourceId:t,showOnlyEligiblePlans:n,billingCountryCode:l,preferredBillingPeriod:a,currentSubscriptionOverrideFn:u}),B=dh(i),U=!f||w||g?jsxRuntime.jsx(mh,{skeletonPlanCount:h}):jsxRuntime.jsx(Gm,{plans:f,customer:x,currentSubscription:b,currentSubscriptionOverride:T,selectedBillingPeriod:v,onBillingPeriodChanged:L=>{_(L),s&&s(L);},availableBillingPeriods:M,highlightedPlanId:o,isCustomerOnTrial:k,onPlanSelected:r,paywallLocale:B,locale:I,shouldHidePlan:c,selectDefaultTierIndex:d,hideCompatibleAddons:p,showWatermark:E});return m?U:jsxRuntime.jsx(ht,{componentTheme:F,children:U})};function xh({resourceId:e,productId:t}){let{stigg:o,customerPortalUpdatedAt:n}=D(),[i,r]=Fc.useState(false),[a,s]=Fc.useState();return Fc.useEffect(()=>{R(null,null,function*(){if(o.isCustomerLoaded)try{r(!0);let c=yield o.getCustomerPortal({resourceId:e,productId:t});s(c);}catch(c){no.error(`Failed to load customer portal ${c==null?void 0:c.message}`,c);}finally{r(false);}});},[o,o.isCustomerLoaded,n,e,t]),{customerPortal:a,showWatermark:o.getShowWatermark(),isLoading:i}}function bh(e){return f2__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 Ch(e,t,o){var i,r,a,s;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)||((i=o==null?void 0:o.palette)==null?void 0:i.backgroundColor)||"white",borderColor:(t==null?void 0:t.borderColor)||((r=o==null?void 0:o.palette)==null?void 0:r.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)||((s=o==null?void 0:o.palette)==null?void 0:s.iconsColor)||void 0,iconsBackgroundColor:t==null?void 0:t.iconsBackgroundColor}}function Nr({children:e,textOverrides:t,theme:o,resourceId:n,productId:i}){let{customerPortalUpdatedAt:r}=D(),{customerPortal:a,isLoading:s,showWatermark:l}=xh({resourceId:n,productId:i}),c=a!=null&&a.configuration?Km(a.configuration):void 0,d=Vo(c),u=Ch(d,o,a==null?void 0:a.configuration),p=bh(t);return jsxRuntime.jsx(ht,{componentTheme:c,children:jsxRuntime.jsx(St.Provider,{value:{customerPortal:a,isLoading:s,showWatermark:l,textOverrides:p,theme:u,resourceId:n},children:e},r==null?void 0:r.toString())})}var ao=y(B2__default.default)`
279
+ `;function hg(){return jsxRuntime.jsxs(ug,{children:[jsxRuntime.jsx(Qe__default.default,{width:120,borderRadius:4}),jsxRuntime.jsx(Qe__default.default,{circle:true,width:40,height:40}),jsxRuntime.jsx(Qe__default.default,{style:{marginBottom:33},width:120,borderRadius:4}),jsxRuntime.jsxs(Bn,{children:[jsxRuntime.jsx(wn,{}),jsxRuntime.jsx(Qe__default.default,{width:120,borderRadius:4})]}),jsxRuntime.jsxs(Bn,{children:[jsxRuntime.jsx(wn,{}),jsxRuntime.jsx(Qe__default.default,{width:120,borderRadius:4})]}),jsxRuntime.jsxs(Bn,{children:[jsxRuntime.jsx(wn,{}),jsxRuntime.jsx(Qe__default.default,{width:120,borderRadius:4})]}),jsxRuntime.jsx(fg,{children:jsxRuntime.jsx(Qe__default.default,{height:50,borderRadius:4})})]})}function Cs({skeletonPlanCount:e=3}){return jsxRuntime.jsxs(mg,{className:"stigg-skeleton-loader-container",children:[jsxRuntime.jsx(yg,{className:"stigg-skeleton-loader-billing-period",children:jsxRuntime.jsx(Qe__default.default,{borderRadius:4})}),jsxRuntime.jsx(gg,{className:"stigg-skeleton-loader-plans-container",children:Array.from({length:e}).map((t,o)=>jsxRuntime.jsx(hg,{},o))})]})}var ee=ii__default.default.createContext(null);ee.displayName="CustomerPortalContext";var W=()=>{let e=ii.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 fe(e){return !!ii.useContext(e)}var Ps=({productId:e,resourceId:t,highlightedPlanId:o,showOnlyEligiblePlans:r,textOverrides:n,onPlanSelected:i,preferredBillingPeriod:s,onBillingPeriodChange:l,billingCountryCode:a,shouldHidePlan:c,selectDefaultTierIndex:u,currentSubscriptionOverride:f,hideCompatibleAddons:p,skeletonPlanCount:h=3})=>{let g=fe(ee),y=false;if(g){let{isLoading:z,resourceId:q}=W();y=z,t=q;}let{plans:C,customer:b,currentSubscription:x,currentSubscriptionOverride:S,isCustomerOnTrial:T,isLoading:F,selectedBillingPeriod:w,setSelectedBillingPeriod:I,availableBillingPeriods:k,locale:L,configuration:E,showWatermark:A}=us({productId:e,resourceId:t,showOnlyEligiblePlans:r,billingCountryCode:a,preferredBillingPeriod:s,currentSubscriptionOverrideFn:f}),Z=fs(n),_=!C||F||y?jsxRuntime.jsx(Cs,{skeletonPlanCount:h}):jsxRuntime.jsx(os,{plans:C,customer:b,currentSubscription:x,currentSubscriptionOverride:S,selectedBillingPeriod:w,onBillingPeriodChanged:z=>{I(z),l&&l(z);},availableBillingPeriods:k,highlightedPlanId:o,isCustomerOnTrial:T,onPlanSelected:i,paywallLocale:Z,locale:L,shouldHidePlan:c,selectDefaultTierIndex:u,hideCompatibleAddons:p,showWatermark:A});return g?_:jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.w,{componentTheme:E,children:_})};function Ss({resourceId:e,productId:t}){let{stigg:o,customerPortalUpdatedAt:r}=chunkMY4ZIUAV_cjs_js.u(),[n,i]=ii.useState(false),[s,l]=ii.useState();return ii.useEffect(()=>{chunkMY4ZIUAV_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){chunkMY4ZIUAV_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:s,showWatermark:o.getShowWatermark(),isLoading:n}}function Ts(e){return dg__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 ks(e,t,o){var n,i,s,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)||((s=o==null?void 0:o.palette)==null?void 0:s.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 Fo({children:e,textOverrides:t,theme:o,resourceId:r,productId:n}){let{customerPortalUpdatedAt:i}=chunkMY4ZIUAV_cjs_js.u(),{customerPortal:s,isLoading:l,showWatermark:a}=Ss({resourceId:r,productId:n}),c=s!=null&&s.configuration?as(s.configuration):void 0,u=chunkMY4ZIUAV_cjs_js.v(c),f=ks(u,o,s==null?void 0:s.configuration),p=Ts(t);return jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.w,{componentTheme:c,children:jsxRuntime.jsx(ee.Provider,{value:{customerPortal:s,isLoading:l,showWatermark:a,textOverrides:p,theme:f,resourceId:r},children:e},i==null?void 0:i.toString())})}var Ke=chunkMY4ZIUAV_cjs_js.e(Ym__default.default)`
409
280
  border-radius: 10px;
410
281
  padding: 8px 16px;
411
282
  text-transform: none;
@@ -414,7 +285,7 @@
414
285
  &:hover {
415
286
  border-color: ${({theme:e})=>e.stigg.palette.outlinedRestingBorder};
416
287
  }
417
- `;var LS=e=>jsxRuntime.jsx("svg",A(S({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"})})),Th=LS;var Ce=y.div`
288
+ `;var Sg=e=>jsxRuntime.jsx("svg",chunkMY4ZIUAV_cjs_js.b(chunkMY4ZIUAV_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"})})),As=Sg;var Le=chunkMY4ZIUAV_cjs_js.e.div`
418
289
  display: flex;
419
290
  align-items: center;
420
291
  justify-content: space-between;
@@ -424,11 +295,11 @@
424
295
  margin-bottom: 32px;
425
296
  }
426
297
  `};
427
- `;function Pe({title:e,className:t,isLoading:o}){let{theme:n}=ut();return o?jsxRuntime.jsx(ro__default.default,{width:120}):jsxRuntime.jsx(P,{className:t,overrideColor:n.sectionTitleColor,variant:"h3",bold:true,children:e})}var RS=y(Th)`
298
+ `;function Ne({title:e,className:t,isLoading:o}){let{theme:r}=W();return o?jsxRuntime.jsx(Qe__default.default,{width:120}):jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.f,{className:t,overrideColor:r.sectionTitleColor,variant:"h3",bold:true,children:e})}var kg=chunkMY4ZIUAV_cjs_js.e(As)`
428
299
  path {
429
300
  stroke: ${({theme:e})=>e.stigg.palette.primary};
430
301
  }
431
- `;function _h({onManageSubscription:e,hideManageButton:t,textOverrides:o}){return jsxRuntime.jsxs(Ce,{className:"stigg-customer-portal-overview-header",$disableMargin:true,children:[jsxRuntime.jsx(Pe,{title:"Subscription",className:"stigg-overview-title"}),!t&&jsxRuntime.jsxs(ao,{className:"stigg-manage-subscription-button",variant:"outlined",onClick:()=>e({intentionType:"MANAGE_SUBSCRIPTION"}),children:[jsxRuntime.jsx(RS,{className:"stigg-manage-subscription-button-image"}),jsxRuntime.jsx(P,{className:"stigg-manage-subscription-button-text",color:"primary.main",style:{marginLeft:"8px"},variant:"body1",children:o==null?void 0:o.manageSubscription})]})]})}function Ur(){let{customerPortal:e}=ut(),t=DS__default.default(e==null?void 0:e.subscriptions,o=>o.addons);return NS__default.default(t)?null:jsxRuntime.jsx("div",{className:"stigg-addons-list-layout",children:t.map((o,n)=>jsxRuntime.jsxs(P,{as:"span",className:"stigg-addon-list-item-text",variant:"body1",children:[o.quantity>1&&`${o.quantity} X `,o.displayName,n===t.length-1?"":", "]},o.addonId))})}var Ah=y.div`
302
+ `;function Es({onManageSubscription:e,hideManageButton:t,textOverrides:o}){return jsxRuntime.jsxs(Le,{className:"stigg-customer-portal-overview-header",$disableMargin:true,children:[jsxRuntime.jsx(Ne,{title:"Subscription",className:"stigg-overview-title"}),!t&&jsxRuntime.jsxs(Ke,{className:"stigg-manage-subscription-button",variant:"outlined",onClick:()=>e({intentionType:"MANAGE_SUBSCRIPTION"}),children:[jsxRuntime.jsx(kg,{className:"stigg-manage-subscription-button-image"}),jsxRuntime.jsx(chunkMY4ZIUAV_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 vo(){let{customerPortal:e}=W(),t=wg__default.default(e==null?void 0:e.subscriptions,o=>o.addons);return Bg__default.default(t)?null:jsxRuntime.jsx("div",{className:"stigg-addons-list-layout",children:t.map((o,r)=>jsxRuntime.jsxs(chunkMY4ZIUAV_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 Fg(e){return String(e.endDate)}var Ls=chunkMY4ZIUAV_cjs_js.e.div`
432
303
  display: flex;
433
304
  justify-content: space-between;
434
305
  align-items: center;
@@ -439,19 +310,19 @@
439
310
  & > *:first-of-type {
440
311
  max-width: 60%;
441
312
  }
442
- `;function VS(e){var i;let{displayName:t,usageLimit:o,hasUnlimitedUsage:n}=e;return n?`Unlimited ${t}`:o?`${t} x ${(i=e.usageLimit)==null?void 0:i.toLocaleString()}`:t}function zr(){let{customerPortal:e,textOverrides:t,theme:o}=ut(),n=e==null?void 0:e.promotionalEntitlements;return jsxRuntime.jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[jsxRuntime.jsx(P,{color:"secondary",children:t.promotionsSubtitle}),jsxRuntime.jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[jsxRuntime.jsxs(Ah,{$borderColor:o.borderColor,children:[jsxRuntime.jsx(P,{variant:"body1",bold:true,children:"Feature"}),jsxRuntime.jsx(P,{variant:"body1",bold:true,children:"Expiration date"})]}),n==null?void 0:n.map((i,r)=>jsxRuntime.jsxs(Ah,{$borderColor:o.borderColor,children:[jsxRuntime.jsx(P,{variant:"body1",children:VS(i)}),jsxRuntime.jsx(P,{variant:"body1",color:"disabled",children:i.endDate?fc__default.default.utc(i.endDate).format("MMM Do, YYYY"):"None"})]},`${i.displayName}-${r}`))]})]})}var Mh=y(HS__default.default)`
313
+ `;function vg(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 Lo(){let{customerPortal:e,textOverrides:t,theme:o}=W(),r=e==null?void 0:e.promotionalEntitlements;return jsxRuntime.jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.f,{color:"secondary",children:t.promotionsSubtitle}),jsxRuntime.jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[jsxRuntime.jsxs(Ls,{$borderColor:o.borderColor,children:[jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.f,{variant:"body1",bold:true,children:"Feature"}),jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.f,{variant:"body1",bold:true,children:"Expiration date"})]}),r==null?void 0:r.map((n,i)=>jsxRuntime.jsxs(Ls,{$borderColor:o.borderColor,children:[jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.f,{variant:"body1",children:vg(n)}),jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.f,{variant:"body1",color:"disabled",children:n.endDate?Q.utc(Fg(n)).format("MMM Do, YYYY"):"None"})]},`${n.displayName}-${i}`))]})]})}var Ns=chunkMY4ZIUAV_cjs_js.e(Lg__default.default)`
443
314
  .MuiTabs-indicator {
444
315
  background-color: #001e6c;
445
316
  }
446
- `,Ih=y.div`
317
+ `,Ms=chunkMY4ZIUAV_cjs_js.e.div`
447
318
  width: 100%;
448
319
  flex: 1;
449
320
  margin-top: 16px;
450
- `,Eh=y(Ua__default.default)`
321
+ `,Rs=chunkMY4ZIUAV_cjs_js.e(ke__default.default,{shouldForwardProp:e=>!e.startsWith("$")})`
451
322
  margin-top: 16px;
452
323
  max-height: ${({$maxHeight:e})=>e};
453
324
  overflow-y: auto;
454
- `;y.div`
325
+ `;chunkMY4ZIUAV_cjs_js.e.div`
455
326
  display: flex;
456
327
  flex-direction: column;
457
328
  padding: 24px;
@@ -460,28 +331,28 @@
460
331
  margin-bottom: 16px;
461
332
  row-gap: 16px;
462
333
  background-color: ${({$backgroundColor:e})=>e};
463
- `;function Lh(e){let a=e,{children:t,value:o,index:n,maxHeight:i}=a,r=ot(a,["children","value","index","maxHeight"]);return jsxRuntime.jsx("div",A(S({role:"tabpanel",hidden:o!==n},r),{children:o===n&&jsxRuntime.jsx(Eh,{$maxHeight:i,children:t})}))}function Bh({isSelected:e,label:t,icon:o}){let n=e?"primary":"secondary";return jsxRuntime.jsxs("div",{style:{display:"flex",gap:8,alignItems:"center"},children:[jsxRuntime.jsx(mt,{icon:o,svgStrokeColor:n}),jsxRuntime.jsx(P,{variant:"h6",bold:e,color:n,children:t})]})}function Rh({customerPortal:e,hiddenSections:t,textOverrides:o,theme:n}){let i=DS__default.default(e.subscriptions,p=>p.addons),r=p=>t==null?void 0:t.some(h=>h===p),a=i.length>0&&!r("addons"),s=e.promotionalEntitlements.length>0&&!r("promotionalEntitlements"),[l,c]=Fc.useState(a?1:2),d=(p,h)=>{c(h);};return a||s?jsxRuntime.jsxs(Ih,{children:[jsxRuntime.jsx(Ua__default.default,{sx:{borderBottom:1,borderColor:"divider"},children:jsxRuntime.jsxs(Mh,{value:l,onChange:d,children:[a?jsxRuntime.jsx(Fh__default.default,{sx:{textTransform:"none"},value:1,label:jsxRuntime.jsx(Bh,{isSelected:l===1,label:o.addonsTabTitle,icon:"Addons"})}):null,s?jsxRuntime.jsx(Fh__default.default,{sx:{textTransform:"none"},value:2,label:jsxRuntime.jsx(Bh,{isSelected:l===2,label:o.promotionsTabTitle,icon:"Promotions"})}):null]})}),jsxRuntime.jsx(Lh,{value:l,index:1,maxHeight:n.tabMaxHeight,children:jsxRuntime.jsx(Ur,{})}),jsxRuntime.jsx(Lh,{value:l,index:2,maxHeight:n.tabMaxHeight,children:jsxRuntime.jsx(zr,{})})]}):null}var Dh={xs:320,sm:640,md:768,lg:1024,xl:1280,xxl:1536},oc=e=>`(min-width: ${Dh[e]}px)`,wt=Object.keys(Dh).reduce((e,t)=>A(S({},e),{[t]:`@media ${oc(t)}`}),{});function Dt(e){return material.useMediaQuery(oc(e))}var ZS=y.div`
334
+ `;function _s(e){let s=e,{children:t,value:o,index:r,maxHeight:n}=s,i=chunkMY4ZIUAV_cjs_js.c(s,["children","value","index","maxHeight"]);return jsxRuntime.jsx("div",chunkMY4ZIUAV_cjs_js.b(chunkMY4ZIUAV_cjs_js.a({role:"tabpanel",hidden:o!==r},i),{children:o===r&&jsxRuntime.jsx(Rs,{$maxHeight:n,children:t})}))}function Ds({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(chunkMY4ZIUAV_cjs_js.i,{icon:o,svgStrokeColor:r}),jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.f,{variant:"h6",bold:e,color:r,children:t})]})}function $s({customerPortal:e,hiddenSections:t,textOverrides:o,theme:r}){let n=wg__default.default(e.subscriptions,p=>p.addons),i=p=>t==null?void 0:t.some(h=>h===p),s=n.length>0&&!i("addons"),l=e.promotionalEntitlements.length>0&&!i("promotionalEntitlements"),[a,c]=ii.useState(s?1:2),u=(p,h)=>{c(h);};return s||l?jsxRuntime.jsxs(Ms,{children:[jsxRuntime.jsx(ke__default.default,{sx:{borderBottom:1,borderColor:"divider"},children:jsxRuntime.jsxs(Ns,{value:a,onChange:u,children:[s?jsxRuntime.jsx(Us__default.default,{sx:{textTransform:"none"},value:1,label:jsxRuntime.jsx(Ds,{isSelected:a===1,label:o.addonsTabTitle,icon:"Addons"})}):null,l?jsxRuntime.jsx(Us__default.default,{sx:{textTransform:"none"},value:2,label:jsxRuntime.jsx(Ds,{isSelected:a===2,label:o.promotionsTabTitle,icon:"Promotions"})}):null]})}),jsxRuntime.jsx(_s,{value:a,index:1,maxHeight:r.tabMaxHeight,children:jsxRuntime.jsx(vo,{})}),jsxRuntime.jsx(_s,{value:a,index:2,maxHeight:r.tabMaxHeight,children:jsxRuntime.jsx(Lo,{})})]}):null}var Gs={xs:320,sm:640,md:768,lg:1024,xl:1280,xxl:1536},vn=e=>`(min-width: ${Gs[e]}px)`,oe=Object.keys(Gs).reduce((e,t)=>chunkMY4ZIUAV_cjs_js.b(chunkMY4ZIUAV_cjs_js.a({},e),{[t]:`@media ${vn(t)}`}),{});function de(e){return Ug__default.default(vn(e))}var _g=chunkMY4ZIUAV_cjs_js.e.div`
464
335
  display: flex;
465
336
  justify-content: space-between;
466
337
  flex-wrap: wrap;
467
- `,XS=y.div`
338
+ `,Dg=chunkMY4ZIUAV_cjs_js.e.div`
468
339
  display: flex;
469
340
  flex-direction: column;
470
341
  gap: 32px;
471
- `;function Uh(){let e=Dt("md");return jsxRuntime.jsxs(ZS,{className:"stigg-subscription-overview-skeleton-layout",children:[jsxRuntime.jsxs(XS,{children:[jsxRuntime.jsx(ro__default.default,{width:120}),jsxRuntime.jsx(ro__default.default,{width:120})]}),jsxRuntime.jsx(ro__default.default,{width:e?295:260,height:193})]})}function qS({scheduleUpdate:e}){let{targetPackage:t}=e;return jsxRuntime.jsxs(Se__default.default,{container:true,alignItems:"center",children:[jsxRuntime.jsx(Se__default.default,{children:jsxRuntime.jsx(reactFeather.ArrowDown,{color:"#D94052",height:20,className:"stigg-scheduled-updates-arrow-down"})}),jsxRuntime.jsx(Se__default.default,{item:true,children:jsxRuntime.jsxs(P,{className:"stigg-scheduled-updates-description",variant:"body1",children:["Downgrade to the ",jsxRuntime.jsx("b",{children:t==null?void 0:t.displayName})," plan"]})})]})}function QS({scheduleUpdate:e}){let{scheduleVariables:t}=e,{billingPeriod:o}=t,n=o===ah.BillingPeriod.Monthly?"annually":"monthly",i=o===ah.BillingPeriod.Monthly?"monthly":"annually";return jsxRuntime.jsxs(Se__default.default,{container:true,alignItems:"center",children:[jsxRuntime.jsx(Se__default.default,{children:jsxRuntime.jsx(reactFeather.ArrowDown,{color:"#D94052",height:20,className:"stigg-scheduled-updates-arrow-down"})}),jsxRuntime.jsx(Se__default.default,{item:true,children:jsxRuntime.jsxs(P,{className:"stigg-scheduled-updates-description",variant:"body1",children:["Change from an ",n," to a ",jsxRuntime.jsx("b",{children:i})," billing cycle"]})})]})}function JS({subscription:e,scheduleUpdate:t}){let{scheduleVariables:o}=t,{newUnitAmount:n,featureId:i}=o,a=lodash.compact(e.prices.map(({feature:d})=>d)).find(d=>d.id===i);if(!a)return null;let{featureUnits:s,featureUnitsPlural:l}=a;return jsxRuntime.jsxs(Se__default.default,{container:true,alignItems:"flex-start",flexWrap:"nowrap",children:[jsxRuntime.jsx(Se__default.default,{children:jsxRuntime.jsx(reactFeather.ArrowDown,{color:"#D94052",height:20,className:"stigg-scheduled-updates-arrow-down"})}),jsxRuntime.jsx(Se__default.default,{item:true,children:jsxRuntime.jsxs(P,{className:"stigg-scheduled-updates-description",variant:"body1",children:["Reduce the ",jsxRuntime.jsx("b",{children:s})," quantity to ",n," ",n===1?s:l]})})]})}function zh({scheduleUpdate:e,subscription:t}){switch(e.subscriptionScheduleType){case ah.SubscriptionScheduleType.Downgrade:return jsxRuntime.jsx(qS,{scheduleUpdate:e});case ah.SubscriptionScheduleType.BillingPeriod:return jsxRuntime.jsx(QS,{scheduleUpdate:e});case ah.SubscriptionScheduleType.UnitAmount:return jsxRuntime.jsx(JS,{scheduleUpdate:e,subscription:t});default:return null}}var iT=y(Ua__default.default)`
342
+ `;function Vs(){let e=de("md");return jsxRuntime.jsxs(_g,{className:"stigg-subscription-overview-skeleton-layout",children:[jsxRuntime.jsxs(Dg,{children:[jsxRuntime.jsx(Qe__default.default,{width:120}),jsxRuntime.jsx(Qe__default.default,{width:120})]}),jsxRuntime.jsx(Qe__default.default,{width:e?295:260,height:193})]})}function Gg({scheduleUpdate:e}){let{targetPackage:t}=e;return jsxRuntime.jsxs(Me__default.default,{container:true,alignItems:"center",children:[jsxRuntime.jsx(Me__default.default,{children:jsxRuntime.jsx(reactFeather.ArrowDown,{color:"#D94052",height:20,className:"stigg-scheduled-updates-arrow-down"})}),jsxRuntime.jsx(Me__default.default,{item:true,children:jsxRuntime.jsxs(chunkMY4ZIUAV_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 zg({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(Me__default.default,{container:true,alignItems:"center",children:[jsxRuntime.jsx(Me__default.default,{children:jsxRuntime.jsx(reactFeather.ArrowDown,{color:"#D94052",height:20,className:"stigg-scheduled-updates-arrow-down"})}),jsxRuntime.jsx(Me__default.default,{item:true,children:jsxRuntime.jsxs(chunkMY4ZIUAV_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 Vg({subscription:e,scheduleUpdate:t}){let{scheduleVariables:o}=t,{newUnitAmount:r,featureId:n}=o,s=ac__default.default(e.prices.map(({feature:u})=>u)).find(u=>u.id===n);if(!s)return null;let{featureUnits:l,featureUnitsPlural:a}=s;return jsxRuntime.jsxs(Me__default.default,{container:true,alignItems:"flex-start",flexWrap:"nowrap",children:[jsxRuntime.jsx(Me__default.default,{children:jsxRuntime.jsx(reactFeather.ArrowDown,{color:"#D94052",height:20,className:"stigg-scheduled-updates-arrow-down"})}),jsxRuntime.jsx(Me__default.default,{item:true,children:jsxRuntime.jsxs(chunkMY4ZIUAV_cjs_js.f,{className:"stigg-scheduled-updates-description",variant:"body1",children:["Reduce the ",jsxRuntime.jsx("b",{children:l})," quantity to ",r," ",r===1?l:a]})})]})}function Os({scheduleUpdate:e,subscription:t}){switch(e.subscriptionScheduleType){case jsClientSdk.SubscriptionScheduleType.Downgrade:return jsxRuntime.jsx(Gg,{scheduleUpdate:e});case jsClientSdk.SubscriptionScheduleType.BillingPeriod:return jsxRuntime.jsx(zg,{scheduleUpdate:e});case jsClientSdk.SubscriptionScheduleType.UnitAmount:return jsxRuntime.jsx(Vg,{scheduleUpdate:e,subscription:t});default:return null}}var Yg=chunkMY4ZIUAV_cjs_js.e(ke__default.default)`
472
343
  border-bottom: ${({$borderColor:e})=>`1px solid ${e}`};
473
344
  border-top-left-radius: 10px;
474
345
  border-top-right-radius: 10px;
475
346
  margin: -64px -64px 64px -64px;
476
347
  padding: 24px 32px;
477
- `,rT=y(S2__default.default)`
348
+ `,Qg=chunkMY4ZIUAV_cjs_js.e(Rm__default.default)`
478
349
  margin-left: 4px;
479
- `,aT=y(Tr)`
350
+ `,Kg=chunkMY4ZIUAV_cjs_js.e(chunkMY4ZIUAV_cjs_js.h)`
480
351
  color: ${({theme:e})=>e.stigg.palette.primary};
481
352
  path {
482
353
  fill: ${({theme:e})=>e.stigg.palette.primary};
483
354
  }
484
- `;function sT({subscription:e}){let{scheduledUpdates:t}=e;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Se__default.default,{container:true,alignItems:"center",justifyContent:"space-between",gap:1,children:jsxRuntime.jsx(Se__default.default,{children:jsxRuntime.jsx(P,{className:"stigg-scheduled-updates-description",variant:"body1",children:"The following updates will take effect in the next billing cycle:"})})}),jsxRuntime.jsx(Se__default.default,{children:(t||[]).map(o=>jsxRuntime.jsx(zh,{scheduleUpdate:o,subscription:e},o.subscriptionScheduleType))})]})}function lT({subscription:e}){let{scheduledUpdates:t}=e,[o]=t||[],{line1:n,line2:i}=_r({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(Se__default.default,{container:true,alignItems:"center",justifyContent:"space-between",gap:1,children:jsxRuntime.jsx(Se__default.default,{children:jsxRuntime.jsx(P,{className:"stigg-scheduled-updates-title",variant:"body1",color:"primary",children:n})})}),i&&jsxRuntime.jsx(Se__default.default,{children:jsxRuntime.jsx(P,{className:"stigg-scheduled-updates-subtitle",variant:"body1",color:"secondary",children:i})})]})}function Vh({subscription:e,onCancelScheduledUpdates:t,theme:o,cancelScheduledUpdatesButtonTitle:n}){let i=react.useTheme(),[r,a]=Fc.useState(false),{scheduledUpdates:s}=e;if(!s||s.length===0)return null;let l=s.length===1;return jsxRuntime.jsx(iT,{$borderColor:o.borderColor,className:"stigg-scheduled-updates-alert-container",children:jsxRuntime.jsxs(Se__default.default,{container:true,alignItems:l?"center":"flex-start",gap:2,children:[jsxRuntime.jsx(Se__default.default,{item:true,display:"flex",children:jsxRuntime.jsx(mt,{icon:"ScheduleBox",svgPathColor:o.iconsColor,svgRectColor:o.iconsBackgroundColor})}),jsxRuntime.jsx(Se__default.default,{item:true,flex:1,children:l?jsxRuntime.jsx(lT,{subscription:e}):jsxRuntime.jsx(sT,{subscription:e})}),!!t&&jsxRuntime.jsx(Se__default.default,{item:true,children:jsxRuntime.jsxs(ao,{variant:"outlined",onClick:()=>{a(true),Promise.resolve(t(e)).finally(()=>a(false));},children:[r?jsxRuntime.jsx(rT,{loading:true,size:16,color:i.stigg.palette.text.disabled}):jsxRuntime.jsx(aT,{style:{display:"flex",marginRight:4},className:"stigg-scheduled-updates-cancel-update-button-icon"}),jsxRuntime.jsx(P,{variant:"body1",color:"primary.main",className:"stigg-scheduled-updates-cancel-update-button",children:n})]})})]})})}var Te=y.div`
355
+ `;function qg({subscription:e}){let{scheduledUpdates:t}=e;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Me__default.default,{container:true,alignItems:"center",justifyContent:"space-between",gap:1,children:jsxRuntime.jsx(Me__default.default,{children:jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.f,{className:"stigg-scheduled-updates-description",variant:"body1",children:"The following updates will take effect in the next billing cycle:"})})}),jsxRuntime.jsx(Me__default.default,{children:(t||[]).map(o=>jsxRuntime.jsx(Os,{scheduleUpdate:o,subscription:e},o.subscriptionScheduleType))})]})}function Jg({subscription:e}){let{scheduledUpdates:t}=e,[o]=t||[],{line1:r,line2:n}=xo({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(Me__default.default,{container:true,alignItems:"center",justifyContent:"space-between",gap:1,children:jsxRuntime.jsx(Me__default.default,{children:jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.f,{className:"stigg-scheduled-updates-title",variant:"body1",color:"primary",children:r})})}),n&&jsxRuntime.jsx(Me__default.default,{children:jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.f,{className:"stigg-scheduled-updates-subtitle",variant:"body1",color:"secondary",children:n})})]})}function Ws({subscription:e,onCancelScheduledUpdates:t,theme:o,cancelScheduledUpdatesButtonTitle:r}){let n=react.useTheme(),[i,s]=ii.useState(false),{scheduledUpdates:l}=e;if(!l||l.length===0)return null;let a=l.length===1;return jsxRuntime.jsx(Yg,{$borderColor:o.borderColor,className:"stigg-scheduled-updates-alert-container",children:jsxRuntime.jsxs(Me__default.default,{container:true,alignItems:a?"center":"flex-start",gap:2,children:[jsxRuntime.jsx(Me__default.default,{item:true,display:"flex",children:jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.i,{icon:"ScheduleBox",svgPathColor:o.iconsColor,svgRectColor:o.iconsBackgroundColor})}),jsxRuntime.jsx(Me__default.default,{item:true,flex:1,children:a?jsxRuntime.jsx(Jg,{subscription:e}):jsxRuntime.jsx(qg,{subscription:e})}),!!t&&jsxRuntime.jsx(Me__default.default,{item:true,children:jsxRuntime.jsxs(Ke,{variant:"outlined",onClick:()=>{s(true),Promise.resolve(t(e)).finally(()=>s(false));},children:[i?jsxRuntime.jsx(Qg,{loading:true,size:16,color:n.stigg.palette.text.disabled}):jsxRuntime.jsx(Kg,{style:{display:"flex",marginRight:4},className:"stigg-scheduled-updates-cancel-update-button-icon"}),jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.f,{variant:"body1",color:"primary.main",className:"stigg-scheduled-updates-cancel-update-button",children:r})]})})]})})}var Re=chunkMY4ZIUAV_cjs_js.e.div`
485
356
  width: 100%;
486
357
  display: flex;
487
358
  flex-direction: column;
@@ -490,21 +361,21 @@
490
361
  border: ${({$borderColor:e})=>`1px solid ${e}`};
491
362
 
492
363
  padding: 16px;
493
- ${wt.sm} {
364
+ ${oe.sm} {
494
365
  padding: 32px;
495
366
  }
496
- ${wt.md} {
367
+ ${oe.md} {
497
368
  padding: 48px;
498
369
  }
499
- ${wt.lg} {
370
+ ${oe.lg} {
500
371
  padding: 64px;
501
372
  }
502
- `;function Wh({billingPeriod:e,rangeEnd:t,amount:o,currency:n}){return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(P,{variant:"h6",children:"Next estimated bill"}),jsxRuntime.jsx(P,{variant:"h1",children:at({amount:o,currency:n,maximumFractionDigits:2})}),jsxRuntime.jsxs(P,{as:"div",variant:"body1",color:"secondary",children:["Billed ",e===ah.BillingPeriod.Monthly?"monthly":"annually"," on"," ",jsxRuntime.jsx(P,{variant:"body1",as:"span",color:"primary",children:fc__default.default.utc(t).format("MMM Do, YYYY")})]}),jsxRuntime.jsx(P,{variant:"body1",color:"secondary",children:"* Additional tax rates may apply"})]})}function Hr({description:e}){return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(P,{variant:"h6",color:"secondary",children:"No upcoming bill"}),jsxRuntime.jsx(P,{variant:"body1",color:"secondary",children:e})]})}var gT=y.div`
373
+ `;function Qs({billingPeriod:e,rangeEnd:t,amount:o,currency:r}){return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.f,{variant:"h6",children:"Next estimated bill"}),jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.f,{variant:"h1",children:H({amount:o,currency:r,maximumFractionDigits:2})}),jsxRuntime.jsxs(chunkMY4ZIUAV_cjs_js.f,{as:"div",variant:"body1",color:"secondary",children:["Billed ",e===jsClientSdk.BillingPeriod.Monthly?"monthly":"annually"," on"," ",jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.f,{variant:"body1",as:"span",color:"primary",children:Q.utc(t).format("MMM Do, YYYY")})]}),jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.f,{variant:"body1",color:"secondary",children:"* Additional tax rates may apply"})]})}function Ro({description:e}){return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.f,{variant:"h6",color:"secondary",children:"No upcoming bill"}),jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.f,{variant:"body1",color:"secondary",children:e})]})}var rf=chunkMY4ZIUAV_cjs_js.e.div`
503
374
  display: flex;
504
375
  flex-direction: column;
505
376
  align-items: left;
506
377
  gap: 8px;
507
- `,fT=y(B2__default.default)`
378
+ `,nf=chunkMY4ZIUAV_cjs_js.e(Ym__default.default)`
508
379
  width: fit-content;
509
380
  &.MuiButton-root {
510
381
  padding: 0;
@@ -512,7 +383,7 @@
512
383
  background: none;
513
384
  }
514
385
  }
515
- `;function jh({onContactSupport:e,label:t,linkLabel:o}){let n=jsxRuntime.jsx(P,{color:e?"primary.main":"secondary",children:o});return jsxRuntime.jsxs(gT,{className:"stigg-contact-support-layout",children:[jsxRuntime.jsx(P,{className:"stigg-contact-support-label",color:"secondary",children:t}),e?jsxRuntime.jsx(fT,{className:"stigg-contact-support-button",style:{textTransform:"none"},variant:"text",onClick:e,children:n}):n]})}var PT=y.div`
386
+ `;function qs({onContactSupport:e,label:t,linkLabel:o}){let r=jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.f,{color:e?"primary.main":"secondary",children:o});return jsxRuntime.jsxs(rf,{className:"stigg-contact-support-layout",children:[jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.f,{className:"stigg-contact-support-label",color:"secondary",children:t}),e?jsxRuntime.jsx(nf,{className:"stigg-contact-support-button",style:{textTransform:"none"},variant:"text",onClick:e,children:r}):r]})}var df=chunkMY4ZIUAV_cjs_js.e.div`
516
387
  max-height: 278px;
517
388
  display: flex;
518
389
  flex-direction: column;
@@ -521,7 +392,7 @@
521
392
  border: ${({$borderColor:e})=>`1px solid ${e}`};
522
393
  padding: 32px;
523
394
  gap: 16px;
524
- `;function Yh({subscription:e,theme:t,textOverrides:o,onContactSupport:n}){var l,c,d,u,p,h,m;let{pricingType:i}=e,r,a=(c=(l=e.prices)==null?void 0:l.every(g=>g.billingModel!==ah.BillingModel.UsageBased))!=null?c:true,s=(d=e.scheduledUpdates)==null?void 0:d.find(({subscriptionScheduleType:g,targetPackage:f})=>g===ah.SubscriptionScheduleType.Downgrade&&(f==null?void 0:f.pricingType)===ah.PricingType.Free);if(i===ah.PricingType.Free)r=jsxRuntime.jsx(Hr,{description:"You're on a free plan, so you don\u2019t have any upcoming charges"});else if(i===ah.PricingType.Paid)if(s&&a)r=jsxRuntime.jsx(Hr,{description:"Your plan will be downgraded to a free plan, so you don\u2019t have any upcoming charges"});else if(e.status===ah.SubscriptionStatus.InTrial)r=jsxRuntime.jsx(Hr,{description:`You\u2019re on a free trial of the ${e.planName} plan, so you don\u2019t have any upcoming charges`});else {let g=(p=(u=e.prices)==null?void 0:u[0])==null?void 0:p.billingPeriod,f=(h=e.billingPeriodRange)==null?void 0:h.end,x=(m=e.totalPrice)==null?void 0:m.total;g&&f&&x&&(r=jsxRuntime.jsx(Wh,{billingPeriod:g,rangeEnd:f,amount:x.amount,currency:x.currency}));}else i===ah.PricingType.Custom&&(r=jsxRuntime.jsx(jh,{onContactSupport:n,label:o.contactSupportTitle,linkLabel:o.contactSupportLink}));return jsxRuntime.jsx(PT,{className:"stigg-subscription-total-price-layout",$borderColor:t.borderColor,children:r})}var ST=e=>jsxRuntime.jsxs("svg",A(S({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"})]})),Xh=ST;var Be=y(i=>{var r=i,{children:e,className:t,placement:o="top"}=r,n=ot(r,["children","className","placement"]);return jsxRuntime.jsx(kT__default.default,A(S({arrow:true,placement:o},n),{classes:{popper:t,tooltip:"stigg-tooltip",arrow:"stigg-tooltip-arrow"},children:jsxRuntime.jsx("div",{children:e})}))})(({theme:e,$padding:t=8,$maxWidth:o=300})=>({[`& .${kT.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},[`& .${kT.tooltipClasses.arrow}`]:{color:e.stigg.palette.white}}));var AT=y(P)`
395
+ `;function Js({subscription:e,theme:t,textOverrides:o,onContactSupport:r}){var a,c,u,f,p,h,g;let{pricingType:n}=e,i,s=(c=(a=e.prices)==null?void 0:a.every(y=>y.billingModel!==jsClientSdk.BillingModel.UsageBased))!=null?c:true,l=(u=e.scheduledUpdates)==null?void 0:u.find(({subscriptionScheduleType:y,targetPackage:C})=>y===jsClientSdk.SubscriptionScheduleType.Downgrade&&(C==null?void 0:C.pricingType)===jsClientSdk.PricingType.Free);if(n===jsClientSdk.PricingType.Free)i=jsxRuntime.jsx(Ro,{description:"You're on a free plan, so you don\u2019t have any upcoming charges"});else if(n===jsClientSdk.PricingType.Paid)if(l&&s)i=jsxRuntime.jsx(Ro,{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(Ro,{description:`You\u2019re on a free trial of the ${e.planName} plan, so you don\u2019t have any upcoming charges`});else {let y=(p=(f=e.prices)==null?void 0:f[0])==null?void 0:p.billingPeriod,C=(h=e.billingPeriodRange)==null?void 0:h.end,b=(g=e.totalPrice)==null?void 0:g.total;y&&C&&b&&(i=jsxRuntime.jsx(Qs,{billingPeriod:y,rangeEnd:C,amount:b.amount,currency:b.currency}));}else n===jsClientSdk.PricingType.Custom&&(i=jsxRuntime.jsx(qs,{onContactSupport:r,label:o.contactSupportTitle,linkLabel:o.contactSupportLink}));return jsxRuntime.jsx(df,{className:"stigg-subscription-total-price-layout",$borderColor:t.borderColor,children:i})}var pf=e=>jsxRuntime.jsxs("svg",chunkMY4ZIUAV_cjs_js.b(chunkMY4ZIUAV_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"})]})),js=pf;var Ve=chunkMY4ZIUAV_cjs_js.e(n=>{var i=n,{children:e,className:t,placement:o="top"}=i,r=chunkMY4ZIUAV_cjs_js.c(i,["children","className","placement"]);return jsxRuntime.jsx(uf__default.default,chunkMY4ZIUAV_cjs_js.b(chunkMY4ZIUAV_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})=>({[`& .${uf.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},[`& .${uf.tooltipClasses.arrow}`]:{color:e.stigg.palette.white}}));var hf=chunkMY4ZIUAV_cjs_js.e(chunkMY4ZIUAV_cjs_js.f)`
525
396
  display: ${({$display:e})=>e};
526
397
  -webkit-line-clamp: ${({$maxLines:e})=>e};
527
398
  -webkit-box-orient: vertical;
@@ -535,7 +406,7 @@
535
406
  ${({$bold:e})=>e&&react.css`
536
407
  font-weight: bold;
537
408
  `}
538
- `;function Jh(e){return e&&(e.clientHeight<e.scrollHeight||e.offsetWidth<e.scrollWidth)}var ue=({leaveDelay:e,children:t,variant:o,color:n,maxLines:i=1,wordBreak:r,bold:a,tooltipPlacement:s="top",className:l,display:c="-webkit-box",style:d,"data-testid":u})=>{let[p,h]=Fc.useState(false),m=Fc.useRef(null),g=jsxRuntime.jsx(AT,{ref:m,variant:o,color:n,$maxLines:i,$wordBreak:r,$bold:a,className:l,$display:c,style:d,"data-testid":u,children:t});Fc.useEffect(()=>{if(m!=null&&m.current){let x=Jh(m.current);h(x);}},[m]);let f=(m==null?void 0:m.current)&&Jh(m.current);return jsxRuntime.jsx("span",{children:p||f?jsxRuntime.jsx(Be,{placement:s,leaveDelay:e,title:jsxRuntime.jsx(P,{variant:"body1",children:t}),children:g}):g})};var ET=y.div`
409
+ `;function rl(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:s,tooltipPlacement:l="top",className:a,display:c="-webkit-box",style:u,"data-testid":f})=>{let[p,h]=ii.useState(false),g=ii.useRef(null),y=jsxRuntime.jsx(hf,{ref:g,variant:o,color:r,$maxLines:n,$wordBreak:i,$bold:s,className:a,$display:c,style:u,"data-testid":f,children:t});ii.useEffect(()=>{if(g!=null&&g.current){let b=rl(g.current);h(b);}},[g]);let C=(g==null?void 0:g.current)&&rl(g.current);return jsxRuntime.jsx("span",{children:p||C?jsxRuntime.jsx(Ve,{placement:l,leaveDelay:e,title:jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.f,{variant:"body1",children:t}),children:y}):y})};var Pf=chunkMY4ZIUAV_cjs_js.e.div`
539
410
  width: 100%;
540
411
  display: flex;
541
412
  align-items: center;
@@ -544,48 +415,48 @@
544
415
  border-radius: 10px;
545
416
  padding: 8px 16px;
546
417
  margin-top: 16px;
547
- `,FT=y(IT__default.default)`
418
+ `,bf=chunkMY4ZIUAV_cjs_js.e(xf__default.default)`
548
419
  text-decoration-color: white;
549
420
  color: white;
550
421
  cursor: pointer;
551
- `;function eg({subscription:e,includePlanName:t,onManageSubscription:o}){return (e==null?void 0:e.status)!==ah.SubscriptionStatus.InTrial?null:jsxRuntime.jsxs(ET,{className:"stigg-subscription-trial-badge",children:[jsxRuntime.jsx(Xh,{className:"stigg-subscription-trial-badge-image"}),jsxRuntime.jsx("div",{style:{flex:1,marginRight:4},children:jsxRuntime.jsxs(ue,{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(FT,{className:"stigg-subscription-trial-upgrade-button",onClick:()=>o({intentionType:"UPGRADE_TRIAL_PLAN"}),children:jsxRuntime.jsx(P,{color:"white",children:"Upgrade plan"})})]})}function ng({mainSubscription:e,trialSubscription:t,onManageSubscription:o,theme:n}){return jsxRuntime.jsxs("div",{className:"stigg-subscription-view-layout",children:[jsxRuntime.jsxs(P,{className:"stigg-subscription-plan-name",variant:"h1",overrideColor:n.planNameColor,style:{marginTop:8},children:[e.planName," plan"]}),jsxRuntime.jsx(eg,{subscription:t,includePlanName:(t==null?void 0:t.planName)!==e.planName,onManageSubscription:o})]})}var lc=70;function so(e,t){return t===0?0:Math.min(Math.floor(e/t*100),100)}function rg(e){let t;return e<lc?t="standard":e<100?t="warning":t="error",t}function ag(e){if(!e.resetPeriod||!e.usagePeriodEnd)return null;let t=o=>fc__default.default.utc(e.usagePeriodEnd).diff(fc__default.default.utc(),o);switch(e.resetPeriod){case ah.EntitlementResetPeriod.Month:return `Resets monthly - in ${t("days")} days`;case ah.EntitlementResetPeriod.Week:return `Resets weekly - in ${t("days")} days`;case ah.EntitlementResetPeriod.Day:return `Resets daily - in ${t("hours")} hours`;case ah.EntitlementResetPeriod.Hour:return `Resets hourly - in ${t("minutes")} minutes`;default:return null}}var DT=y(BT__default.default)`
422
+ `;function il({subscription:e,includePlanName:t,onManageSubscription:o}){return (e==null?void 0:e.status)!==jsClientSdk.SubscriptionStatus.InTrial?null:jsxRuntime.jsxs(Pf,{className:"stigg-subscription-trial-badge",children:[jsxRuntime.jsx(js,{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(bf,{className:"stigg-subscription-trial-upgrade-button",onClick:()=>o({intentionType:"UPGRADE_TRIAL_PLAN"}),children:jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.f,{color:"white",children:"Upgrade plan"})})]})}function sl({mainSubscription:e,trialSubscription:t,onManageSubscription:o,theme:r}){return jsxRuntime.jsxs("div",{className:"stigg-subscription-view-layout",children:[jsxRuntime.jsxs(chunkMY4ZIUAV_cjs_js.f,{className:"stigg-subscription-plan-name",variant:"h1",overrideColor:r.planNameColor,style:{marginTop:8},children:[e.planName," plan"]}),jsxRuntime.jsx(il,{subscription:t,includePlanName:(t==null?void 0:t.planName)!==e.planName,onManageSubscription:o})]})}var Un=70;function qe(e,t){return t===0?0:Math.min(Math.floor(e/t*100),100)}function ll(e){let t;return e<Un?t="standard":e<100?t="warning":t="error",t}function Tf(e){return String(e.usagePeriodEnd)}function cl(e){if(!e.resetPeriod||!e.usagePeriodEnd)return null;let t=Tf(e),o=r=>Q.utc(t).diff(Q.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 Bf=chunkMY4ZIUAV_cjs_js.e(kf__default.default,{shouldForwardProp:e=>!e.startsWith("$")})`
552
423
  height: 4px;
553
- background-color: ${({theme:e})=>Do__default.default(e.stigg.palette.primary).alpha(.4).string()};
424
+ background-color: ${({theme:e})=>bi__default.default(e.stigg.palette.primary).alpha(.4).string()};
554
425
 
555
426
  span {
556
427
  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}}};
557
428
  }
558
- `;function Zr({currentUsage:e,usageLimit:t,classNamePrefix:o="stigg-usage-progress-bar"}){let n=so(e,t),i=rg(n);return jsxRuntime.jsx(DT,{$progressStatus:i,className:`${o} ${o}-${i}`,variant:"determinate",value:n})}var zT=y(fg__default.default)`
429
+ `;function Go({currentUsage:e,usageLimit:t,classNamePrefix:o="stigg-usage-progress-bar"}){let r=qe(e,t),n=ll(r);return jsxRuntime.jsx(Bf,{$progressStatus:n,className:`${o} ${o}-${n}`,variant:"determinate",value:r})}var vf=chunkMY4ZIUAV_cjs_js.e(xl__default.default)`
559
430
  border-style: dotted;
560
431
  border-bottom-width: 2px;
561
- border-color: ${({theme:e})=>Do__default.default(e.stigg.palette.outlinedRestingBorder).alpha(.4).string()};
562
- `;function Xr({entitlement:e}){return e.hasUnlimitedUsage?jsxRuntime.jsx(zT,{}):jsxRuntime.jsx(Zr,{currentUsage:e.currentUsage||0,usageLimit:e.usageLimit,classNamePrefix:"stigg-feature-usage-progress-bar"})}var lg=y(B2__default.default)`
432
+ border-color: ${({theme:e})=>bi__default.default(e.stigg.palette.outlinedRestingBorder).alpha(.4).string()};
433
+ `;function zo({entitlement:e}){return e.hasUnlimitedUsage?jsxRuntime.jsx(vf,{}):jsxRuntime.jsx(Go,{currentUsage:e.currentUsage||0,usageLimit:e.usageLimit,classNamePrefix:"stigg-feature-usage-progress-bar"})}var pl=chunkMY4ZIUAV_cjs_js.e(Ym__default.default)`
563
434
  text-transform: none;
564
435
  padding: 0;
565
436
  white-space: nowrap;
566
- `;function qr({featureEntitlement:e,feature:t,onManageSubscription:o,onBuyMore:n,canBuyMore:i,canUpgradeSubscription:r,hasCustomSubscription:a}){return a||e.hasUnlimitedUsage||so(e.currentUsage||0,e.usageLimit)<lc?null:i?n?jsxRuntime.jsx(lg,{variant:"text",onClick:()=>n(t,e),children:jsxRuntime.jsx(P,{color:"primary.main",children:"Buy more"})}):null:r&&o?jsxRuntime.jsx(lg,{variant:"text",onClick:()=>o({intentionType:"UPGRADE_PLAN"}),children:jsxRuntime.jsx(P,{color:"primary.main",children:"Upgrade"})}):null}function cg({amount:e,currency:t,blockSize:o,featureEntitlement:n,feature:i,hideChargePrice:r,onBuyMore:a,onManageSubscription:s,canUpgradeSubscription:l,hasCustomSubscription:c}){var d,u,p;return jsxRuntime.jsxs("div",{className:`stigg-charge-list-item stigg-charge-list-item-${n.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(ue,{variant:"body1",color:"primary",children:i.displayName}),!r&&jsxRuntime.jsxs(ue,{variant:"body1",color:"secondary",children:[at({amount:e,currency:t})," per ",o?`${o} `:"",o?i.featureUnitsPlural:i.featureUnits]})]}),jsxRuntime.jsxs("div",{style:{display:"flex",gap:12},children:[jsxRuntime.jsx(qr,{featureEntitlement:n,feature:i,canBuyMore:true,onBuyMore:a,onManageSubscription:s,canUpgradeSubscription:l,hasCustomSubscription:c}),jsxRuntime.jsx(P,{variant:"body1",color:"primary",style:{whiteSpace:"nowrap"},children:n.hasUnlimitedUsage?(d=n.currentUsage)==null?void 0:d.toLocaleString():`${(u=n.currentUsage)==null?void 0:u.toLocaleString()} of ${(p=n.usageLimit)==null?void 0:p.toLocaleString()}`})]})]}),jsxRuntime.jsx(Xr,{entitlement:n})]})}function ug({subscription:e,entitlements:t,onBuyMore:o,onManageSubscription:n,hasCustomSubscription:i,canUpgradeSubscription:r}){let a=lodash.keyBy(t,"feature.refId"),s=e.prices.filter(({feature:l,price:c})=>!!l&&a[l.refId]&&!!c);return s.length?jsxRuntime.jsx("div",{className:"stigg-charge-list",style:{display:"flex",flexDirection:"column",gap:16,marginTop:32},children:s.map(({feature:l,price:c,blockSize:d,billingModel:u})=>{if(!l||!c)return null;let p=a[l.refId];return !p||!p.feature?null:jsxRuntime.jsx(cg,{featureEntitlement:p,feature:p.feature,amount:c.amount,blockSize:d,currency:c.currency,hideChargePrice:u===ah.BillingModel.PerUnit,onBuyMore:o,onManageSubscription:n,canUpgradeSubscription:r,hasCustomSubscription:i},l.refId)})}):null}function kn(e){return e.__typename==="FeatureEntitlement"}function Jr(e){return e.__typename==="CreditEntitlement"}function ta({onManageSubscription:e,onBuyMore:t,onCancelScheduledUpdates:o,onContactSupport:n,hiddenSections:i,cancelScheduledUpdatesButtonTitle:r}){let{customerPortal:a,isLoading:s,textOverrides:l,theme:c}=ut(),d=s||!a,{subscriptions:u,entitlementsV2:p,canUpgradeSubscription:h}=a||{},m=Fc.useMemo(()=>p?p.filter(kn):[],[p]),g=u==null?void 0:u.find(({status:T})=>T===ah.SubscriptionStatus.Active),f=u==null?void 0:u.find(({status:T})=>T===ah.SubscriptionStatus.InTrial),x=(g==null?void 0:g.pricingType)===ah.PricingType.Custom,b=g||f;return jsxRuntime.jsxs(Te,{className:"stigg-customer-portal-subscriptions-overview",$backgroundColor:c.backgroundColor,$borderColor:c.borderColor,children:[!d&&g&&g.scheduledUpdates&&jsxRuntime.jsx(Vh,{theme:c,subscription:g,onCancelScheduledUpdates:o,cancelScheduledUpdatesButtonTitle:r}),d||!b?jsxRuntime.jsx(Uh,{}):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(_h,{onManageSubscription:e,hideManageButton:x,textOverrides:l}),jsxRuntime.jsx(ng,{mainSubscription:b,trialSubscription:f,theme:c,onManageSubscription:e}),g&&m.length>0&&jsxRuntime.jsx(ug,{subscription:g,entitlements:m,onBuyMore:t,onManageSubscription:e,canUpgradeSubscription:!!h,hasCustomSubscription:x}),jsxRuntime.jsx(Rh,{customerPortal:a,hiddenSections:i,textOverrides:l,theme:c})]}),jsxRuntime.jsx("div",{style:{display:"flex",flexDirection:"column",width:319,gap:24},children:jsxRuntime.jsx(Yh,{subscription:b,theme:c,onContactSupport:n,textOverrides:l})})]})]})}var jT=y.div`
437
+ `;function Ho({featureEntitlement:e,feature:t,onManageSubscription:o,onBuyMore:r,canBuyMore:n,canUpgradeSubscription:i,hasCustomSubscription:s}){return s||e.hasUnlimitedUsage||qe(e.currentUsage||0,e.usageLimit)<Un?null:n?r?jsxRuntime.jsx(pl,{variant:"text",onClick:()=>r(t,e),children:jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.f,{color:"primary.main",children:"Buy more"})}):null:i&&o?jsxRuntime.jsx(pl,{variant:"text",onClick:()=>o({intentionType:"UPGRADE_PLAN"}),children:jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.f,{color:"primary.main",children:"Upgrade"})}):null}function ml({amount:e,currency:t,blockSize:o,featureEntitlement:r,feature:n,hideChargePrice:i,onBuyMore:s,onManageSubscription:l,canUpgradeSubscription:a,hasCustomSubscription:c}){var u,f,p;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(Ho,{featureEntitlement:r,feature:n,canBuyMore:true,onBuyMore:s,onManageSubscription:l,canUpgradeSubscription:a,hasCustomSubscription:c}),jsxRuntime.jsx(chunkMY4ZIUAV_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 ${(p=r.usageLimit)==null?void 0:p.toLocaleString()}`})]})]}),jsxRuntime.jsx(zo,{entitlement:r})]})}function gl({subscription:e,entitlements:t,onBuyMore:o,onManageSubscription:r,hasCustomSubscription:n,canUpgradeSubscription:i}){let s=Bl__default.default(t,"feature.refId"),l=e.prices.filter(({feature:a,price:c})=>!!a&&s[a.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:a,price:c,blockSize:u,billingModel:f})=>{if(!a||!c)return null;let p=s[a.refId];return !p||!p.feature?null:jsxRuntime.jsx(ml,{featureEntitlement:p,feature:p.feature,amount:c.amount,blockSize:u,currency:c.currency,hideChargePrice:f===jsClientSdk.BillingModel.PerUnit,onBuyMore:o,onManageSubscription:r,canUpgradeSubscription:i,hasCustomSubscription:n},a.refId)})}):null}function bt(e){return e.__typename==="FeatureEntitlement"}function Wo(e){return e.__typename==="CreditEntitlement"}function Zo({onManageSubscription:e,onBuyMore:t,onCancelScheduledUpdates:o,onContactSupport:r,hiddenSections:n,cancelScheduledUpdatesButtonTitle:i}){let{customerPortal:s,isLoading:l,textOverrides:a,theme:c}=W(),u=l||!s,{subscriptions:f,entitlementsV2:p,canUpgradeSubscription:h}=s||{},g=ii.useMemo(()=>p?p.filter(bt):[],[p]),y=f==null?void 0:f.find(({status:S})=>S===jsClientSdk.SubscriptionStatus.Active),C=f==null?void 0:f.find(({status:S})=>S===jsClientSdk.SubscriptionStatus.InTrial),b=(y==null?void 0:y.pricingType)===jsClientSdk.PricingType.Custom,x=y||C;return jsxRuntime.jsxs(Re,{className:"stigg-customer-portal-subscriptions-overview",$backgroundColor:c.backgroundColor,$borderColor:c.borderColor,children:[!u&&y&&y.scheduledUpdates&&jsxRuntime.jsx(Ws,{theme:c,subscription:y,onCancelScheduledUpdates:o,cancelScheduledUpdatesButtonTitle:i}),u||!x?jsxRuntime.jsx(Vs,{}):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(Es,{onManageSubscription:e,hideManageButton:b,textOverrides:a}),jsxRuntime.jsx(sl,{mainSubscription:x,trialSubscription:C,theme:c,onManageSubscription:e}),y&&g.length>0&&jsxRuntime.jsx(gl,{subscription:y,entitlements:g,onBuyMore:t,onManageSubscription:e,canUpgradeSubscription:!!h,hasCustomSubscription:b}),jsxRuntime.jsx($s,{customerPortal:s,hiddenSections:n,textOverrides:a,theme:c})]}),jsxRuntime.jsx("div",{style:{display:"flex",flexDirection:"column",width:319,gap:24},children:jsxRuntime.jsx(Js,{subscription:x,theme:c,onContactSupport:r,textOverrides:a})})]})]})}var Uf=chunkMY4ZIUAV_cjs_js.e.div`
567
438
  display: flex;
568
439
  width: 100%;
569
440
  align-items: flex-end;
570
441
  justify-content: flex-end;
571
442
  margin-bottom: 24px;
572
- `;function hg({showWatermark:e}){return jsxRuntime.jsx(jT,{className:"stigg-customer-portal-header-layout",children:jsxRuntime.jsx(Jt,{source:"customer_portal",showWatermark:e})})}var ZT=y(P)`
443
+ `;function hl({showWatermark:e}){return jsxRuntime.jsx(Uf,{className:"stigg-customer-portal-header-layout",children:jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.q,{source:"customer_portal",showWatermark:e})})}var Df=chunkMY4ZIUAV_cjs_js.e(chunkMY4ZIUAV_cjs_js.f)`
573
444
  text-transform: none;
574
- `,XT=y(reactFeather.ExternalLink)`
445
+ `,$f=chunkMY4ZIUAV_cjs_js.e(reactFeather.ExternalLink)`
575
446
  color: ${({theme:e})=>e.stigg.palette.primary};
576
- `;function ea({text:e,url:t,className:o}){return jsxRuntime.jsx(ao,{className:o,variant:"outlined",startIcon:jsxRuntime.jsx(XT,{size:20,strokeWidth:2.5}),onClick:()=>{window.open(t,"_blank");},children:jsxRuntime.jsx(ZT,{color:"primary.main",children:e})})}var oa=y.div`
447
+ `;function Yo({text:e,url:t,className:o}){return jsxRuntime.jsx(Ke,{className:o,variant:"outlined",startIcon:jsxRuntime.jsx($f,{size:20,strokeWidth:2.5}),onClick:()=>{window.open(t,"_blank");},children:jsxRuntime.jsx(Df,{color:"primary.main",children:e})})}var Qo=chunkMY4ZIUAV_cjs_js.e.div`
577
448
  display: flex;
578
449
  flex-direction: column;
579
450
  align-items: flex-start;
580
451
  gap: 16px;
581
452
  flex: 1 0 0;
582
- `,KT=y.div`
453
+ `,Gf=chunkMY4ZIUAV_cjs_js.e.div`
583
454
  display: flex;
584
455
  align-items: flex-start;
585
456
  gap: 16px;
586
457
  align-self: stretch;
587
458
  flex-wrap: wrap;
588
- `;function pc({title:e,rows:t}){return jsxRuntime.jsxs(oa,{children:[jsxRuntime.jsx(P,{variant:"h6",color:"secondary",bold:true,children:e}),t.map(({classNamePrefix:o,label:n,value:i,labelTypographyProps:r,valueTypographyProps:a})=>jsxRuntime.jsxs(KT,{children:[jsxRuntime.jsx(P,A(S({className:`${o}-label`,variant:"body1",color:"secondary",style:{width:80}},r),{children:n})),jsxRuntime.jsx(P,A(S({className:`${o}-text`,variant:"body1",color:"secondary"},a),{children:i}))]},n))]})}function na(){return jsxRuntime.jsx(ro__default.default,{width:220,height:42})}var yg="-";function ra(){let{customerPortal:e,isLoading:t,textOverrides:o,theme:n}=ut(),i=Dt("md"),{billingInformation:r}=e||{},a=!r||t,s=[];if(a?s.push(jsxRuntime.jsxs(oa,{children:[jsxRuntime.jsx(ro__default.default,{width:220,height:12}),jsxRuntime.jsx(ro__default.default,{width:220,height:12}),jsxRuntime.jsx(ro__default.default,{width:220,height:12})]},"information-loading-data-top"),jsxRuntime.jsx(fg__default.default,{orientation:"vertical",style:{minHeight:93,display:i?"block":"none"}},"information-loading-data-divider"),jsxRuntime.jsxs(oa,{children:[jsxRuntime.jsx(ro__default.default,{width:220,height:12}),jsxRuntime.jsx(ro__default.default,{width:220,height:12}),jsxRuntime.jsx(ro__default.default,{width:220,height:12})]},"information-loading-data-bottom")):(s.push(jsxRuntime.jsx(pc,{title:"Billed to",rows:[{classNamePrefix:"stigg-customer-name",label:"Name",value:(r==null?void 0:r.name)||yg,valueTypographyProps:r!=null&&r.name?{}:{color:"disabled"}},{classNamePrefix:"stigg-customer-email",label:"Email",value:(r==null?void 0:r.email)||yg,valueTypographyProps:r!=null&&r.email?{}:{color:"disabled"}}]},"information-billing-data-billed-to")),r!=null&&r.defaultPaymentMethodId&&r.defaultPaymentMethodLast4Digits&&r.defaultPaymentExpirationMonth&&r.defaultPaymentExpirationYear&&(s.unshift(jsxRuntime.jsx(fg__default.default,{orientation:"vertical",style:{minHeight:93,display:i?"block":"none"}},"information-billing-data-divider")),s.unshift(jsxRuntime.jsx(pc,{title:"Payment method",rows:[{classNamePrefix:"stigg-credit-card",label:"Card",value:`Ending in ${r.defaultPaymentMethodLast4Digits}`},{classNamePrefix:"stigg-credit-card-expiration",label:"Expires",value:`${lodash.padStart(r.defaultPaymentExpirationMonth.toString(),2,"0")}/${r.defaultPaymentExpirationYear}`}]},"information-billing-data-payment-method")))),!a&&!(r!=null&&r.name)&&!(r!=null&&r.email)&&!(r!=null&&r.defaultPaymentMethodId))return null;let l=a?jsxRuntime.jsx(na,{}):e!=null&&e.billingPortalUrl?jsxRuntime.jsx(ea,{url:e.billingPortalUrl,text:o.editPaymentDetails,className:"stigg-edit-payment-details-button"}):null;return jsxRuntime.jsxs(Te,{className:"stigg-payment-details-section-layout",$backgroundColor:n.backgroundColor,$borderColor:n.borderColor,children:[jsxRuntime.jsxs(Ce,{className:"stigg-payment-details-section-header",children:[jsxRuntime.jsx(Pe,{isLoading:a,className:"stigg-payment-details-section-title",title:"Payment details"}),l]}),jsxRuntime.jsx("div",{style:{display:"flex",alignItems:"stretch",gap:i?64:32,flexWrap:"wrap"},children:s})]})}var xg=y(Te)`
459
+ `;function Gn({title:e,rows:t}){return jsxRuntime.jsxs(Qo,{children:[jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.f,{variant:"h6",color:"secondary",bold:true,children:e}),t.map(({classNamePrefix:o,label:r,value:n,labelTypographyProps:i,valueTypographyProps:s})=>jsxRuntime.jsxs(Gf,{children:[jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.f,chunkMY4ZIUAV_cjs_js.b(chunkMY4ZIUAV_cjs_js.a({className:`${o}-label`,variant:"body1",color:"secondary",style:{width:80}},i),{children:r})),jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.f,chunkMY4ZIUAV_cjs_js.b(chunkMY4ZIUAV_cjs_js.a({className:`${o}-text`,variant:"body1",color:"secondary"},s),{children:n}))]},r))]})}function Ko(){return jsxRuntime.jsx(Qe__default.default,{width:220,height:42})}var Pl="-";function Jo(){let{customerPortal:e,isLoading:t,textOverrides:o,theme:r}=W(),n=de("md"),{billingInformation:i}=e||{},s=!i||t,l=[];if(s?l.push(jsxRuntime.jsxs(Qo,{children:[jsxRuntime.jsx(Qe__default.default,{width:220,height:12}),jsxRuntime.jsx(Qe__default.default,{width:220,height:12}),jsxRuntime.jsx(Qe__default.default,{width:220,height:12})]},"information-loading-data-top"),jsxRuntime.jsx(xl__default.default,{orientation:"vertical",style:{minHeight:93,display:n?"block":"none"}},"information-loading-data-divider"),jsxRuntime.jsxs(Qo,{children:[jsxRuntime.jsx(Qe__default.default,{width:220,height:12}),jsxRuntime.jsx(Qe__default.default,{width:220,height:12}),jsxRuntime.jsx(Qe__default.default,{width:220,height:12})]},"information-loading-data-bottom")):(l.push(jsxRuntime.jsx(Gn,{title:"Billed to",rows:[{classNamePrefix:"stigg-customer-name",label:"Name",value:(i==null?void 0:i.name)||Pl,valueTypographyProps:i!=null&&i.name?{}:{color:"disabled"}},{classNamePrefix:"stigg-customer-email",label:"Email",value:(i==null?void 0:i.email)||Pl,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(xl__default.default,{orientation:"vertical",style:{minHeight:93,display:n?"block":"none"}},"information-billing-data-divider")),l.unshift(jsxRuntime.jsx(Gn,{title:"Payment method",rows:[{classNamePrefix:"stigg-credit-card",label:"Card",value:`Ending in ${i.defaultPaymentMethodLast4Digits}`},{classNamePrefix:"stigg-credit-card-expiration",label:"Expires",value:`${Hf__default.default(i.defaultPaymentExpirationMonth.toString(),2,"0")}/${i.defaultPaymentExpirationYear}`}]},"information-billing-data-payment-method")))),!s&&!(i!=null&&i.name)&&!(i!=null&&i.email)&&!(i!=null&&i.defaultPaymentMethodId))return null;let a=s?jsxRuntime.jsx(Ko,{}):e!=null&&e.billingPortalUrl?jsxRuntime.jsx(Yo,{url:e.billingPortalUrl,text:o.editPaymentDetails,className:"stigg-edit-payment-details-button"}):null;return jsxRuntime.jsxs(Re,{className:"stigg-payment-details-section-layout",$backgroundColor:r.backgroundColor,$borderColor:r.borderColor,children:[jsxRuntime.jsxs(Le,{className:"stigg-payment-details-section-header",children:[jsxRuntime.jsx(Ne,{isLoading:s,className:"stigg-payment-details-section-title",title:"Payment details"}),a]}),jsxRuntime.jsx("div",{style:{display:"flex",alignItems:"stretch",gap:n?64:32,flexWrap:"wrap"},children:l})]})}var bl=chunkMY4ZIUAV_cjs_js.e(Re)`
589
460
  position: relative;
590
461
 
591
462
  .stigg-paywall-layout {
@@ -607,10 +478,10 @@
607
478
  margin-right: auto;
608
479
  }
609
480
 
610
- .${$l} {
481
+ .${chunkMY4ZIUAV_cjs_js.p} {
611
482
  display: none;
612
483
  }
613
- `;var mc=Fc.forwardRef(({paywallComponent:e,theme:t,title:o,isLoading:n},i)=>e?jsxRuntime.jsxs(xg,{className:"stigg-customer-portal-paywall-section",ref:i,$backgroundColor:t.backgroundColor,$borderColor:t.borderColor,children:[jsxRuntime.jsx(Ce,{className:"stigg-customer-portal-paywall-header",children:jsxRuntime.jsx(Pe,{isLoading:n,className:"stigg-customer-portal-paywall-section-title",title:o})}),e]}):null);mc.displayName="CustomerPortalPaywall";var Cg=y.div`
484
+ `;var zn=ii.forwardRef(({paywallComponent:e,theme:t,title:o,isLoading:r},n)=>e?jsxRuntime.jsxs(bl,{className:"stigg-customer-portal-paywall-section",ref:n,$backgroundColor:t.backgroundColor,$borderColor:t.borderColor,children:[jsxRuntime.jsx(Le,{className:"stigg-customer-portal-paywall-header",children:jsxRuntime.jsx(Ne,{isLoading:r,className:"stigg-customer-portal-paywall-section-title",title:o})}),e]}):null);zn.displayName="CustomerPortalPaywall";var Tl=chunkMY4ZIUAV_cjs_js.e.div`
614
485
  width: 100%;
615
486
  display: flex;
616
487
  flex-direction: column;
@@ -619,13 +490,13 @@
619
490
  & * {
620
491
  box-sizing: border-box;
621
492
  }
622
- `,Pg=y.div`
493
+ `,kl=chunkMY4ZIUAV_cjs_js.e.div`
623
494
  width: 100%;
624
495
  display: flex;
625
496
  flex-direction: column;
626
497
  align-items: center;
627
498
  row-gap: 24px;
628
- `;var kg=6;function vg({featureEntitlements:e,creditEntitlements:t,showAll:o}){let n=e.length+t.length,i=o?n:Math.min(n,kg),r=e.slice(0,i),a=i-r.length,s=t.slice(0,Math.max(0,a)),l=n>kg;return {entitlementsToShow:r,creditsToShow:s,totalItemsCount:n,showMoreVisible:l}}function nk(e){var t,o;return ((t=e.feature)==null?void 0:t.meterType)===ah.MeterType.Fluctuating||((o=e.feature)==null?void 0:o.meterType)===ah.MeterType.Incremental}function _g(e,t){return t?e>2?4:6:12}function wg(e){let t=[],o=[];for(let n of e)kn(n)?t.push(n):Jr(n)&&o.push(n);return {feature:t,credit:o}}function Ag({packageEntitlements:e,activeSubscription:t,filterEntitlements:o,filterPackageEntitlements:n}){var b,T;let{feature:i,credit:r}=wg(e!=null?e:[]),a=i.filter(nk),s=Tg__default.default((b=t==null?void 0:t.prices)!=null?b:[],"feature.refId"),l=Tg__default.default(a,"feature.refId"),c=((T=t==null?void 0:t.prices)!=null?T:[]).map(k=>k.feature?l[k.feature.refId]:void 0).filter(k=>!!k),d=a.filter(k=>k.feature&&!s[k.feature.refId]),u=[...c,...d].filter(k=>k.usageLimit!==0),p=r.filter(k=>{var w;return ((w=k.usageLimit)!=null?w:0)>0}),h=[...u,...p],m=n?n({entitlements:h}).entitlements:[...o?o(u):u,...p],{feature:g,credit:f}=wg(m),x=(t==null?void 0:t.pricingType)===ah.PricingType.Custom;return {subscriptionPriceByFeature:s,filteredFeatureEntitlements:g,filteredCreditEntitlements:f,hasCustomSubscription:x}}function Mg({filterEntitlements:e,filterPackageEntitlements:t}){let[o,n]=Fc.useState(false),i=Dt("md"),{customerPortal:r,isLoading:a}=ut(),s=Fc.useMemo(()=>{var _;let w=r==null?void 0:r.entitlementsV2,v=(_=r==null?void 0:r.subscriptions)==null?void 0:_.find(M=>M.status===ah.SubscriptionStatus.Active);return Ag({packageEntitlements:w,activeSubscription:v,filterEntitlements:e,filterPackageEntitlements:t})},[r==null?void 0:r.entitlementsV2,r==null?void 0:r.subscriptions,e,t]),{subscriptionPriceByFeature:l,filteredFeatureEntitlements:c,filteredCreditEntitlements:d,hasCustomSubscription:u}=s,p=a||!r,h=!!(r!=null&&r.canUpgradeSubscription),{entitlementsToShow:m,creditsToShow:g,totalItemsCount:f,showMoreVisible:x}=vg({featureEntitlements:c,creditEntitlements:d,showAll:o}),b=_g(f,i),T=()=>n(w=>!w),k=!p&&c.length===0&&d.length===0;return {isLoadingData:p,entitlementsToShow:m,creditsToShow:g,subscriptionPriceByFeature:l,totalItemsCount:f,gridSizeXs:b,hasCustomSubscription:u,canUpgradeSubscription:h,showAll:o,toggleShowAll:T,hasNoItems:k,showMoreVisible:x}}function vn(e,t,o){if(!t&&!o)return e;let n=hc__default.default(e);return n===hc__default.default(t||"")||n===hc__default.default(o||"")?e:`${e} (${o})`}function Ig(e){return vn(e.displayName,e.featureUnits,e.featureUnitsPlural)}function Eg(e){var t,o,n;return vn((t=e.currency)==null?void 0:t.displayName,(o=e.currency)==null?void 0:o.unitSingular,(n=e.currency)==null?void 0:n.unitPlural)}var aa=y.div`
499
+ `;var Al=6;function Fl({featureEntitlements:e,creditEntitlements:t,showAll:o}){let r=e.length+t.length,n=o?r:Math.min(r,Al),i=e.slice(0,n),s=n-i.length,l=t.slice(0,Math.max(0,s)),a=r>Al;return {entitlementsToShow:i,creditsToShow:l,totalItemsCount:r,showMoreVisible:a}}function Yf(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 Il(e){let t=[],o=[];for(let r of e)bt(r)?t.push(r):Wo(r)&&o.push(r);return {feature:t,credit:o}}function El({packageEntitlements:e,activeSubscription:t,filterEntitlements:o,filterPackageEntitlements:r}){var x,S;let{feature:n,credit:i}=Il(e!=null?e:[]),s=n.filter(Yf),l=Bl__default.default((x=t==null?void 0:t.prices)!=null?x:[],"feature.refId"),a=Bl__default.default(s,"feature.refId"),c=((S=t==null?void 0:t.prices)!=null?S:[]).map(T=>T.feature?a[T.feature.refId]:void 0).filter(T=>!!T),u=s.filter(T=>T.feature&&!l[T.feature.refId]),f=[...c,...u].filter(T=>T.usageLimit!==0),p=i.filter(T=>{var F;return ((F=T.usageLimit)!=null?F:0)>0}),h=[...f,...p],g=r?r({entitlements:h}).entitlements:[...o?o(f):f,...p],{feature:y,credit:C}=Il(g),b=(t==null?void 0:t.pricingType)===jsClientSdk.PricingType.Custom;return {subscriptionPriceByFeature:l,filteredFeatureEntitlements:y,filteredCreditEntitlements:C,hasCustomSubscription:b}}function Ll({filterEntitlements:e,filterPackageEntitlements:t}){let[o,r]=ii.useState(false),n=de("md"),{customerPortal:i,isLoading:s}=W(),l=ii.useMemo(()=>{var I;let F=i==null?void 0:i.entitlementsV2,w=(I=i==null?void 0:i.subscriptions)==null?void 0:I.find(k=>k.status===jsClientSdk.SubscriptionStatus.Active);return El({packageEntitlements:F,activeSubscription:w,filterEntitlements:e,filterPackageEntitlements:t})},[i==null?void 0:i.entitlementsV2,i==null?void 0:i.subscriptions,e,t]),{subscriptionPriceByFeature:a,filteredFeatureEntitlements:c,filteredCreditEntitlements:u,hasCustomSubscription:f}=l,p=s||!i,h=!!(i!=null&&i.canUpgradeSubscription),{entitlementsToShow:g,creditsToShow:y,totalItemsCount:C,showMoreVisible:b}=Fl({featureEntitlements:c,creditEntitlements:u,showAll:o}),x=vl(C,n),S=()=>r(F=>!F),T=!p&&c.length===0&&u.length===0;return {isLoadingData:p,entitlementsToShow:g,creditsToShow:y,subscriptionPriceByFeature:a,totalItemsCount:C,gridSizeXs:x,hasCustomSubscription:f,canUpgradeSubscription:h,showAll:o,toggleShowAll:S,hasNoItems:T,showMoreVisible:b}}function Tt(e,t,o){if(!t&&!o)return e;let r=Vn__default.default(e);return r===Vn__default.default(t||"")||r===Vn__default.default(o||"")?e:`${e} (${o})`}function Nl(e){return Tt(e.displayName,e.featureUnits,e.featureUnitsPlural)}function Ml(e){var t,o,r;return Tt((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 Xo=chunkMY4ZIUAV_cjs_js.e.div`
629
500
  display: flex;
630
501
  flex-direction: column;
631
502
  padding: 24px;
@@ -635,12 +506,12 @@
635
506
  height: 100%;
636
507
 
637
508
  ${({theme:e,$highlight:t})=>t&&`background-color: ${e.stigg.palette.backgroundSection}`};
638
- `;function Lg({entitlement:e,subscriptionPrice:t,onManageSubscription:o,onBuyMore:n,hasCustomSubscription:i,canUpgradeSubscription:r}){var l,c,d;let{theme:a}=ut(),s=!e.hasUnlimitedUsage&&e.currentUsage>e.usageLimit;return e.feature?jsxRuntime.jsxs(aa,{$highlight:!!t,$borderColor:a.borderColor,children:[jsxRuntime.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:16},children:[jsxRuntime.jsx(ue,{variant:"body1",children:e.feature&&Ig(e.feature)}),t&&jsxRuntime.jsx(Be,{title:jsxRuntime.jsx(P,{variant:"body1",children:t.billingModel===sdk.BillingModel.PerUnit?"Billed for committed usage":"Billed for actual usage"}),children:jsxRuntime.jsx(mt,{icon:"DollarCoin",svgStrokeColor:a.iconsColor})})]}),jsxRuntime.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:8},children:[jsxRuntime.jsxs(ue,{variant:"body1",color:s?"error":"primary","data-testid":`usage-data-${(l=e.feature)==null?void 0:l.refId}`,children:[(c=e.currentUsage)==null?void 0:c.toLocaleString(),!e.hasUnlimitedUsage&&` / ${(d=e.usageLimit)==null?void 0:d.toLocaleString()} (${so(e.currentUsage||0,e.usageLimit)}%)`]}),jsxRuntime.jsx(qr,{featureEntitlement:e,feature:e.feature,onBuyMore:n,canBuyMore:!!t,onManageSubscription:o,canUpgradeSubscription:r,hasCustomSubscription:i})]}),jsxRuntime.jsx(Xr,{entitlement:e}),!e.hasUnlimitedUsage&&!Fg__default.default(e.usageLimit)&&!Fg__default.default(e.currentUsage)&&e.resetPeriod&&e.usagePeriodEnd?jsxRuntime.jsx(P,{color:"secondary",children:ag(e)}):null,e.hasUnlimitedUsage&&jsxRuntime.jsx(P,{color:"secondary",children:"In current billing period"})]}):null}function gc({currentUsage:e,usageLimit:t}){return jsxRuntime.jsx(Zr,{currentUsage:e,usageLimit:t,classNamePrefix:"stigg-credit-usage-progress-bar"})}function yc(e){return fc__default.default(e).format("MMM D, YYYY h:mmA")}function xc(e){return fc__default.default(e).format("MMM D, YYYY")}function ck(e){return fc__default.default(e).fromNow()}function la(e){let{usagePeriodEnd:t,formatter:o}=e;return !t||t.getTime()<=Date.now()?null:`Resets ${o?o(t):ck(t)}.`}function ca({creditEntitlement:e}){let{theme:t}=ut(),{currency:o,currentUsage:n,usageLimit:i}=e,r=(n!=null?n:0)>(i!=null?i:0),a=so(n!=null?n:0,i!=null?i:0),s=Eg(e),l=la({usagePeriodEnd:e.usagePeriodEnd?new Date(e.usagePeriodEnd):void 0});return jsxRuntime.jsxs(aa,{$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(ue,{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(ue,{variant:"body1",color:r?"error":"primary",className:"stigg-credit-usage-value","data-testid":`credit-usage-data-${o.currencyId}`,children:[(n!=null?n:0).toLocaleString()," / ",(i!=null?i:0).toLocaleString()," (",a,"%)"]})}),jsxRuntime.jsx(gc,{currentUsage:n!=null?n:0,usageLimit:i!=null?i:0}),l&&jsxRuntime.jsx(P,{color:"secondary",children:l})]})}function Rg({featureEntitlements:e,creditEntitlements:t,subscriptionPriceByFeature:o,gridSizeXs:n,onManageSubscription:i,onBuyMore:r,hasCustomSubscription:a,canUpgradeSubscription:s}){return jsxRuntime.jsxs(Se__default.default,{container:true,spacing:4,children:[e.filter(l=>!!l.feature).map(l=>{let c=l.feature;return jsxRuntime.jsx(Se__default.default,{className:`stigg-entitlement-usage-${c.refId}`,item:true,xs:n,children:jsxRuntime.jsx(Lg,{entitlement:l,subscriptionPrice:o[c.refId],onManageSubscription:i,onBuyMore:r,hasCustomSubscription:a,canUpgradeSubscription:s})},c.refId)}),t.map(l=>jsxRuntime.jsx(Se__default.default,{className:`stigg-credit-usage-${l.currency.currencyId}`,item:true,xs:n,children:jsxRuntime.jsx(ca,{creditEntitlement:l})},l.currency.currencyId))]})}var Ng=y.div`
509
+ `;function Ul({entitlement:e,subscriptionPrice:t,onManageSubscription:o,onBuyMore:r,hasCustomSubscription:n,canUpgradeSubscription:i}){var a,c,u;let{theme:s}=W(),l=!e.hasUnlimitedUsage&&e.currentUsage>e.usageLimit;return e.feature?jsxRuntime.jsxs(Xo,{$highlight:!!t,$borderColor:s.borderColor,children:[jsxRuntime.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:16},children:[jsxRuntime.jsx(Ae,{variant:"body1",children:e.feature&&Nl(e.feature)}),t&&jsxRuntime.jsx(Ve,{title:jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.f,{variant:"body1",children:t.billingModel===sdk.BillingModel.PerUnit?"Billed for committed usage":"Billed for actual usage"}),children:jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.i,{icon:"DollarCoin",svgStrokeColor:s.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-${(a=e.feature)==null?void 0:a.refId}`,children:[(c=e.currentUsage)==null?void 0:c.toLocaleString(),!e.hasUnlimitedUsage&&` / ${(u=e.usageLimit)==null?void 0:u.toLocaleString()} (${qe(e.currentUsage||0,e.usageLimit)}%)`]}),jsxRuntime.jsx(Ho,{featureEntitlement:e,feature:e.feature,onBuyMore:r,canBuyMore:!!t,onManageSubscription:o,canUpgradeSubscription:i,hasCustomSubscription:n})]}),jsxRuntime.jsx(zo,{entitlement:e}),!e.hasUnlimitedUsage&&!Rl__default.default(e.usageLimit)&&!Rl__default.default(e.currentUsage)&&e.resetPeriod&&e.usagePeriodEnd?jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.f,{color:"secondary",children:cl(e)}):null,e.hasUnlimitedUsage&&jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.f,{color:"secondary",children:"In current billing period"})]}):null}function Hn({currentUsage:e,usageLimit:t}){return jsxRuntime.jsx(Go,{currentUsage:e,usageLimit:t,classNamePrefix:"stigg-credit-usage-progress-bar"})}function On(e){return Q(e).format("MMM D, YYYY h:mmA")}function Wn(e){return Q(e).format("MMM D, YYYY")}function jf(e){return Q(e).fromNow()}function er(e){let{usagePeriodEnd:t,formatter:o}=e;return !t||t.getTime()<=Date.now()?null:`Resets ${o?o(t):jf(t)}.`}function tr({creditEntitlement:e}){let{theme:t}=W(),{currency:o,currentUsage:r,usageLimit:n}=e,i=(r!=null?r:0)>(n!=null?n:0),s=qe(r!=null?r:0,n!=null?n:0),l=Ml(e),a=er({usagePeriodEnd:e.usagePeriodEnd?new Date(e.usagePeriodEnd):void 0});return jsxRuntime.jsxs(Xo,{$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:l})}),jsxRuntime.jsx("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:8},children:jsxRuntime.jsxs(Ae,{variant:"body1",color:i?"error":"primary",className:"stigg-credit-usage-value","data-testid":`credit-usage-data-${o.currencyId}`,children:[(r!=null?r:0).toLocaleString()," / ",(n!=null?n:0).toLocaleString()," (",s,"%)"]})}),jsxRuntime.jsx(Hn,{currentUsage:r!=null?r:0,usageLimit:n!=null?n:0}),a&&jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.f,{color:"secondary",children:a})]})}function Dl({featureEntitlements:e,creditEntitlements:t,subscriptionPriceByFeature:o,gridSizeXs:r,onManageSubscription:n,onBuyMore:i,hasCustomSubscription:s,canUpgradeSubscription:l}){return jsxRuntime.jsxs(Me__default.default,{container:true,spacing:4,children:[e.filter(a=>!!a.feature).map(a=>{let c=a.feature;return jsxRuntime.jsx(Me__default.default,{className:`stigg-entitlement-usage-${c.refId}`,item:true,xs:r,children:jsxRuntime.jsx(Ul,{entitlement:a,subscriptionPrice:o[c.refId],onManageSubscription:n,onBuyMore:i,hasCustomSubscription:s,canUpgradeSubscription:l})},c.refId)}),t.map(a=>jsxRuntime.jsx(Me__default.default,{className:`stigg-credit-usage-${a.currency.currencyId}`,item:true,xs:r,children:jsxRuntime.jsx(tr,{creditEntitlement:a})},a.currency.currencyId))]})}var Gl=chunkMY4ZIUAV_cjs_js.e.div`
639
510
  margin-top: 32px;
640
- `;function Ug(){let e=Dt("md");return jsxRuntime.jsx(Se__default.default,{container:true,spacing:4,className:"stigg-subscription-usage-skeleton-layout",sx:{flexWrap:"wrap"},children:lodash.range(6).map(t=>jsxRuntime.jsx(Se__default.default,{item:true,xs:e?4:12,children:jsxRuntime.jsx(ro__default.default,{width:280,height:120})},t))})}function Og({showAll:e,onToggle:t}){return jsxRuntime.jsx(Ng,{children:jsxRuntime.jsx(ao,{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 pa({onManageSubscription:e,onBuyMore:t,filterEntitlements:o,filterPackageEntitlements:n}){let{textOverrides:i,theme:r}=ut(),{isLoadingData:a,entitlementsToShow:s,creditsToShow:l,subscriptionPriceByFeature:c,gridSizeXs:d,hasCustomSubscription:u,canUpgradeSubscription:p,showAll:h,toggleShowAll:m,hasNoItems:g,showMoreVisible:f}=Mg({filterEntitlements:o,filterPackageEntitlements:n});return g?null:jsxRuntime.jsxs(Te,{className:"stigg-subscription-usage-layout",$backgroundColor:r.backgroundColor,$borderColor:r.borderColor,children:[jsxRuntime.jsx(Ce,{children:jsxRuntime.jsx(Pe,{title:i.usageTabTitle,className:"stigg-customer-portal-usage-section-title",isLoading:a})}),a?jsxRuntime.jsx(Ug,{}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Rg,{featureEntitlements:s,creditEntitlements:l,subscriptionPriceByFeature:c,gridSizeXs:d,onManageSubscription:e,onBuyMore:t,hasCustomSubscription:u,canUpgradeSubscription:p}),f&&jsxRuntime.jsx(Og,{showAll:h,onToggle:m})]})]})}function $g({onManageSubscription:e,onBuyMore:t,filterEntitlements:o,filterPackageEntitlements:n,onCancelScheduledUpdates:i,onContactSupport:r,paywallComponent:a,hiddenSections:s}){let{customerPortal:l,textOverrides:c,theme:d,isLoading:u,showWatermark:p}=ut(),h=Fc.useRef(null),m=({intentionType:b})=>{var T,k;e?e({intentionType:b,customerSubscriptions:(T=l==null?void 0:l.subscriptions)!=null?T:[]}):(k=h==null?void 0:h.current)==null||k.scrollIntoView({behavior:"smooth"});},g=!(s!=null&&s.some(b=>b==="usage")),f=!(s!=null&&s.some(b=>b==="paymentDetails"||b==="billingInformation")),x=!(s!=null&&s.some(b=>b==="invoices"||b==="billingInformation"));return jsxRuntime.jsxs(Cg,{className:"stigg-customer-portal-layout",children:[jsxRuntime.jsx(hg,{showWatermark:p}),jsxRuntime.jsxs(Pg,{className:"stigg-customer-portal-sections",children:[jsxRuntime.jsx(ta,{onCancelScheduledUpdates:i,onBuyMore:t,onManageSubscription:m,onContactSupport:r,hiddenSections:s,cancelScheduledUpdatesButtonTitle:c.cancelScheduledUpdatesButtonTitle}),g&&jsxRuntime.jsx(pa,{onManageSubscription:m,onBuyMore:t,filterEntitlements:o,filterPackageEntitlements:n}),jsxRuntime.jsx(mc,{ref:h,paywallComponent:a,theme:d,title:c.paywallSectionTitle,isLoading:!l||u}),f&&jsxRuntime.jsx(ra,{}),x&&jsxRuntime.jsx(ma,{})]})]})}function Wg(r){var a=r,{textOverrides:e,theme:t,resourceId:o,productId:n}=a,i=ot(a,["textOverrides","theme","resourceId","productId"]);return jsxRuntime.jsx(Nr,{textOverrides:e,theme:t,resourceId:o,productId:n,children:jsxRuntime.jsx($g,S({},i))})}function ma(){let{customerPortal:e,isLoading:t,textOverrides:o,theme:n}=ut(),i=!e||t,r=i?jsxRuntime.jsx(na,{}):e!=null&&e.billingPortalUrl?jsxRuntime.jsx(ea,{url:e.billingPortalUrl,text:o.viewInvoiceHistory,className:"stigg-view-invoice-history-button"}):null;return !i&&!(e!=null&&e.billingPortalUrl)?null:jsxRuntime.jsx(Te,{className:"stigg-invoices-section-layout",$backgroundColor:n.backgroundColor,$borderColor:n.borderColor,children:jsxRuntime.jsxs(Ce,{className:"stigg-invoices-section-header",children:[jsxRuntime.jsx(Pe,{isLoading:i,className:"stigg-invoices-section-title",title:o.invoicesTitle}),r]})})}var jg=e=>Gg__default.default(e,"displayName"),Pc=e=>Gg__default.default(e,"addon.displayName");function $o(e){var n,i;let t=(n=e.pricePoints)==null?void 0:n.some(r=>r.amount&&r.amount>0);return !!((i=e.hiddenFromWidgets)!=null&&i.includes(ah.WidgetType.Checkout))&&!t}function bk(e,t){return e.pricePoints.some(o=>o.billingPeriod===t)}function Yg({addon:e,currency:t,billingCountryCode:o}){return A(S({},e),{pricePoints:e.pricePoints.filter(n=>n.currency===t&&(o?n.billingCountryCode===o:true))})}function Zg({addons:e,billingCountryCode:t,currency:o}){return (e==null?void 0:e.map(n=>Yg({addon:n,currency:o,billingCountryCode:t})))||[]}function Xg({addons:e,billingPeriod:t,billingCountryCode:o,currency:n}){var i;return ((i=e==null?void 0:e.filter(r=>bk(r.addon,t)))==null?void 0:i.map(r=>A(S({},r),{addon:Yg({addon:r.addon,currency:n,billingCountryCode:o})})))||[]}function Kg({activeSubscription:e,plan:t,billingCountryCode:o,billingPeriod:n}){var c,d;let i=[],r=((d=(c=t==null?void 0:t.pricePoints)==null?void 0:c[0])==null?void 0:d.currency)||ah.Currency.Usd,a=Zg({addons:t==null?void 0:t.compatibleAddons,billingCountryCode:o,currency:r}),s=jg(a.filter(u=>!$o(u))),l=Xg({addons:e==null?void 0:e.addons,billingPeriod:n,billingCountryCode:o,currency:r});return l!=null&&l.length&&(a!=null&&a.length)&&(i=Pc(l.filter(u=>a.some(p=>p.id===u.addon.id)))),{addons:i,initialAddons:Ck__default.default(i),availableAddons:s}}function Tk(){let[,e]=j();return (t,o)=>e(n=>{if($o(t))return;let i=n.addonsStep.addons.find(r=>r.addon.id===t.id);if(i){if($o(i.addon))return;i.quantity=o;}else n.addonsStep.addons.push({addon:t,quantity:o}),n.addonsStep.addons=Pc(n.addonsStep.addons);})}function kk(){let[,e]=j();return t=>e(o=>{let n=o.addonsStep.addons.find(i=>i.addon.id===t);n&&$o(n.addon)||Pk__default.default(o.addonsStep.addons,i=>i.addon.id===t);})}function wk(){let[{addonsStep:e}]=j();return e}function qg(){let e=wk();return A(S({},e),{setAddon:Tk(),removeAddon:kk()})}function vk(){let[{checkout:e,widgetState:t,checkoutLocalization:o,checkoutSuccess:n}]=j();return {checkoutState:e,widgetState:t,checkoutLocalization:o,checkoutSuccess:n}}function _k(){let[,e]=j();return t=>e(o=>{o.widgetState.readOnly=t;})}function Ak(){let[,e]=j();return t=>e(o=>{o.widgetState.isValid=t;})}function Mk(){let[,e]=j();return t=>e(o=>{o.checkoutSuccess=t;})}function Y(){let{checkoutState:e,widgetState:t,checkoutLocalization:o,checkoutSuccess:n}=vk();return {checkoutState:e,widgetState:t,checkoutLocalization:o,checkoutSuccess:n,setWidgetReadOnly:_k(),setIsValid:Ak(),setCheckoutSuccess:Mk()}}function Jg({planId:e,resourceId:t,billingCountryCode:o,onMockCheckoutState:n}){let{stigg:i}=D(),[r,a]=Fc.useState(true),[s,l]=Fc.useState();return Fc.useEffect(()=>{let c=()=>R(null,null,function*(){try{let d=yield i.getCheckoutState({planId:e,resourceId:t,billingCountryCode:o});l(d);}catch(d){no.error(`Failed to load checkout ${d==null?void 0:d.message}`,d);}finally{a(false);}});if(n){a(false),l(n({planId:e,resourceId:t,billingCountryCode:o}));return}i.isCustomerLoaded&&(a(true),c());},[i,i.isCustomerLoaded,t,e,o,n]),{checkout:s,isLoading:r,showWatermark:i.getShowWatermark()}}var ga=(e,t)=>e.minUnitQuantity&&t<e.minUnitQuantity?e.minUnitQuantity:e.maxUnitQuantity&&t>e.maxUnitQuantity?e.maxUnitQuantity:t;var Sc=e=>!!(e!=null&&e.pricePoints.some(t=>t.billingPeriod===sdk.BillingPeriod.Monthly)),Tc=e=>!!(e!=null&&e.pricePoints.some(t=>t.billingPeriod===sdk.BillingPeriod.Annually)),ef=e=>Sc(e)&&Tc(e);var rf=(e,t,o)=>e===sdk.BillingPeriod.Monthly&&t||e===sdk.BillingPeriod.Annually&&o?e:null,af=({pricingModel:e})=>e===ah.BillingModel.PerUnit;function Fk(e,t,o){var r;if(!t)return [];let n=Tg__default.default(e,"featureId"),i=Tg__default.default(nf__default.default((r=o==null?void 0:o.prices)==null?void 0:r.map(a=>{let{feature:s}=a;return !s||!af(a)?null:{featureId:s.featureId,quantity:s.unitQuantity||null}})),"featureId");return nf__default.default(t==null?void 0:t.map(a=>{var d,u,p;let s=(d=a.feature)==null?void 0:d.featureId;if(!s||!af(a))return null;let l,c=((u=n[s])==null?void 0:u.quantity)||((p=i[s])==null?void 0:p.quantity);return l=ga(a,c||1),a.isTieredPrice&&!fi(a.tiers)&&(l=Il(a.tiers,l).upTo),{featureId:s,quantity:l}}))}function Lk({plan:e,activeSubscription:t,preferredBillingPeriod:o}){var a,s;let n=Sc(e),i=Tc(e);if(o){let l=rf(o,n,i);if(l)return l}if(((a=t==null?void 0:t.plan)==null?void 0:a.id)===(e==null?void 0:e.id))return ((s=t==null?void 0:t.price)==null?void 0:s.billingPeriod)||sdk.BillingPeriod.Monthly;if(t!=null&&t.prices&&(t==null?void 0:t.prices.length)>0){let l=rf(t==null?void 0:t.prices[0].billingPeriod,n,i);if(l)return l}return i?sdk.BillingPeriod.Annually:sdk.BillingPeriod.Monthly}function sf({preferredBillingPeriod:e,plan:t,activeSubscription:o,billingCountryCode:n,preconfiguredBillableFeatures:i}){let r=Lk({plan:t,activeSubscription:o,preferredBillingPeriod:e}),a=t==null?void 0:t.pricePoints.filter(l=>l.billingPeriod===r),s=Fk(i,a,o);return {billingPeriod:r,billableFeatures:s,billingCountryCode:n}}function Bk(){let[{planStep:e}]=j();return e}function Rk(){let[,e]=j();return (t,o)=>e(n=>{let i=n.planStep.billableFeatures.find(r=>r.featureId===t);i?i.quantity=o:n.planStep.billableFeatures.push({featureId:t,quantity:o});})}function Dk(){let[,e]=j();return t=>e(o=>{o.planStep.billingPeriod=t,o.addonsStep.addons=o.addonsStep.addons.filter(n=>n.addon.pricePoints.some(i=>i.billingPeriod===t));})}function te(){let e=Bk();return A(S({},e),{setBillingPeriod:Dk(),setBillableFeature:Rk()})}var cf=[{key:"PLAN",label:"Plan"},{key:"ADDONS",label:"Add-ons"},{key:"PAYMENT",label:"Payment details"}],lf={activeStep:0,completedSteps:[],steps:cf,isDisabled:false},Uk=(e,t,o,n)=>{if(ef(e)&&!n)return false;let i=t.map(a=>a.featureId),r=o.map(a=>a.featureId);return !(i.length!==r.length||!i.every(a=>r.includes(a)))};function df({isLoading:e,skipCheckoutSteps:t,plan:o,availableAddons:n,availableCharges:i,preferredBillingPeriod:r,preconfiguredBillableFeatures:a}){if(e||!o)return lf;let s=[];return t.includes("PLAN")&&Uk(o,i,a,r)&&s.push("PLAN"),((n==null?void 0:n.length)===0||t.includes("ADDONS"))&&s.push("ADDONS"),A(S({},lf),{steps:cf.filter(l=>!s.includes(l.key))})}function Ok(){let[{progressBar:e}]=j();return e}function zk(){let[e,t]=j();return o=>R(null,null,function*(){let{progressBar:n,planStep:i,addonsStep:r,paymentStep:a,onBeforeStepChange:s}=e;if(o!==n.activeStep&&s){let l=n.steps[n.activeStep],c=n.steps[o];if(l&&c){let d={planStep:i,addonsStep:r,paymentStep:a};if(!(yield s({from:l.key,to:c.key,state:d})))return}}t(({progressBar:l})=>{l.activeStep=o;});})}function Vk(){let[,e]=j();return t=>e(({progressBar:o})=>{o.completedSteps.push(t);})}function $k(e){return e.completedSteps.length>=e.steps.length-1}function Hk(){let[e,t]=j();return ()=>R(null,null,function*(){let{progressBar:o,planStep:n,addonsStep:i,paymentStep:r,onBeforeStepChange:a}=e;if(o.isDisabled)return;let s=o.steps[o.activeStep],l=o.steps[o.activeStep+1];if(l&&a){let c={planStep:n,addonsStep:i,paymentStep:r};if(!(yield a({from:s.key,to:l.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 Wk(){let[,e]=j();return t=>e(({progressBar:o})=>{o.isDisabled=!!t;})}function ke(){let e=Ok();return {currentStep:e.steps[e.activeStep],progressBarState:e,isLastStep:e.activeStep===e.steps.length-1,isCheckoutComplete:$k(e),setActiveStep:zk(),markStepAsCompleted:Vk(),goNext:Hk(),setIsDisabled:Wk()}}function An(){let[{planStep:e,addonsStep:t,promotionCode:o,paymentStep:n}]=j();return A(S({},e),{addons:t.addons,promotionCode:o,billingAddress:n.billingAddress,taxPercentage:n.taxPercentage,taxId:n.taxId})}function fa({billingAddress:e,taxPercentage:t,taxIds:o}){if(!e&&!t&&!(o!=null&&o.length))return {};let n=o!=null&&o.length?o==null?void 0:o.filter(i=>i.value&&i.type):void 0;return {billingInformation:A(S(S({},e?{billingAddress:e}:{}),t?{taxPercentage:t}:{}),{taxIds:n})}}var Zk=h=>R(null,[h],function*({stigg:e,customerId:t,planId:o,resourceId:n,promotionCode:i,addons:r,billableFeatures:a,billingCountryCode:s,billingPeriod:l,billingAddress:c,taxPercentage:d,taxIds:u,onMockCheckoutPreview:p}){var x;let m=r.map(({addon:b,quantity:T})=>({addonId:b.id,quantity:T})),g=null,f=null;try{if(t&&o){let b=S({customerId:t,planId:o,resourceId:n,billingCountryCode:s,addons:m,billingPeriod:l,promotionCode:i,billableFeatures:NS__default.default(a)?void 0:a},fa({billingAddress:c,taxPercentage:d,taxIds:u}));g=p?p(b):yield e.previewSubscription(b);}}catch(b){let[,T]=((x=b==null?void 0:b.message)==null?void 0:x.split("Error:"))||[];f=T==null?void 0:T.trim();}return {subscriptionPreview:g,errorMessage:f}}),wc=({onMockCheckoutPreview:e}={})=>{let{stigg:t}=D(),o=An(),[{resourceId:n}]=j(),{checkoutState:i,widgetState:r}=Y(),{plan:a,customer:s}=i||{};return {previewSubscriptionAction:Fc.useCallback((...d)=>R(null,[...d],function*({promotionCode:c}={}){return r.isValid?Zk({stigg:t,customerId:s==null?void 0:s.id,planId:a==null?void 0:a.id,resourceId:n,addons:o.addons,billableFeatures:o.billableFeatures,billingCountryCode:o.billingCountryCode,billingPeriod:o.billingPeriod,billingAddress:o.billingAddress,taxPercentage:o.taxPercentage,promotionCode:c!=null?c:o.promotionCode,taxIds:o.taxId?[o.taxId]:void 0,onMockCheckoutPreview:e}):{subscriptionPreview:null,errorMessage:null}}),[t,s==null?void 0:s.id,a==null?void 0:a.id,n,o.addons,o.billableFeatures,o.billingCountryCode,o.billingPeriod,o.billingAddress,o.taxPercentage,o.taxId,o.promotionCode,r.isValid,e])}},Xk=500,uf=({onMockCheckoutPreview:e}={})=>{let[t,o]=Fc.useState(null),[n,i]=Fc.useState(null),[r,a]=Fc.useState(false),{previewSubscriptionAction:s}=wc({onMockCheckoutPreview:e});return Fc.useEffect(()=>{let l=()=>R(null,null,function*(){let{subscriptionPreview:d,errorMessage:u}=yield s();d&&(o(d),i(null)),u&&(i(u),o(null)),a(false);});a(true);let c=setTimeout(()=>{a(true),l();},Xk);return ()=>{clearTimeout(c);}},[s]),{subscriptionPreview:t,isFetchingSubscriptionPreview:r,errorMessage:n}};function pf({customer:e,taxPercentage:t,taxId:o}){return {useNewPaymentMethod:!(e!=null&&e.paymentMethodDetails),taxPercentage:t,taxId:o}}function Kk(){let[,e]=j();return Fc.useCallback(t=>e(o=>{o.paymentStep.useNewPaymentMethod=t;}),[e])}function qk(){let[,e]=j();return Fc.useCallback(t=>e(o=>{o.paymentStep.errorMessage=t;}),[e])}function Qk(){let[,e]=j();return Fc.useCallback(t=>e(o=>{o.paymentStep.billingAddress=t;}),[e])}function Jk(){let[{paymentStep:e}]=j();return e}function tw(){let[,e]=j();return Fc.useCallback(t=>e(o=>{o.paymentStep.taxId=t;}),[e])}function vt(){let e=Jk();return A(S({},e),{setUseNewPaymentMethod:Kk(),setErrorMessage:qk(),setBillingAddress:Qk(),setTaxId:tw()})}function hf(e){return f2__default.default({changePlan:"Change",billingPeriodsTitle:"Billing cycle",addAddonText:"Add",addonBillingPeriodNotAvailableText:({planBillingPeriod:o})=>o===ah.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:n})=>{let i="";o.type===ah.DiscountType.Percentage?i=`${o.value}% off`:i=`${at({amount:o.value,currency:n})}`;let r="";switch(o.durationType){case ah.DiscountDurationType.Once:{r=" once";break}case ah.DiscountDurationType.Repeating:{r=`${o.type===ah.DiscountType.Fixed?" per month":""} for ${o.durationInMonths} months`;break}case ah.DiscountDurationType.Forever:default:r="";}return `${i}${r}`},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 ${fc__default.default(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 Ii={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 gf(e,t,o){let{palette:n}=e||{};return {primary:(t==null?void 0:t.primary)||(n==null?void 0:n.primary)||Ii.primary,textColor:(t==null?void 0:t.textColor)||(n==null?void 0:n.text.primary)||Ii.textColor,backgroundColor:(t==null?void 0:t.backgroundColor)||(n==null?void 0:n.backgroundPaper)||Ii.backgroundColor,borderColor:(t==null?void 0:t.borderColor)||(n==null?void 0:n.outlinedBorder)||Ii.borderColor,summaryBackgroundColor:(t==null?void 0:t.summaryBackgroundColor)||(n==null?void 0:n.backgroundHighlight)||Ii.summaryBackgroundColor,paymentInputBackgroundColor:t==null?void 0:t.paymentInputBackgroundColor,paymentInputBorderColor:t==null?void 0:t.paymentInputBorderColor,paymentInputBorderRadius:t==null?void 0:t.paymentInputBorderRadius}}var Ac=Fc__default.default.createContext(null);Ac.displayName="CheckoutContext";var j=()=>{let e=Fc.useContext(Ac);if(!e)throw new Error("Could not find Checkout context; You need to wrap your checkout components in an <CheckoutProvider> component.");return e},dw=({children:e,initialState:t})=>{let[o,n]=Fc.useState(t);Fc.useEffect(()=>{n(t);},[t]);let i=Fc.useCallback(s=>n(l=>immer.produce(l,c=>s(c))),[n]),[r,a]=Fc.useMemo(()=>[o,i],[i,o]);return jsxRuntime.jsx(Ac.Provider,{value:[r,a],children:e})};function yf({children:e,textOverrides:t,theme:o,preferredBillingPeriod:n,billableFeatures:i,resourceId:r,planId:a,billingCountryCode:s,billingInformation:l,onMockCheckoutState:c,skipCheckoutSteps:d,onBeforeStepChange:u}){var b;let{checkout:p,isLoading:h,showWatermark:m}=Jg({resourceId:r,planId:a,billingCountryCode:s,onMockCheckoutState:c}),g=p!=null&&p.configuration?Qm(p.configuration):{typography:Si(null,Br)},f=Vo(g),x=Fc.useMemo(()=>{var F,E;let T=gf(f,o,p==null?void 0:p.configuration),k=hf(t),w=sf({preferredBillingPeriod:n,plan:p==null?void 0:p.plan,activeSubscription:p==null?void 0:p.activeSubscription,billingCountryCode:s,preconfiguredBillableFeatures:i!=null?i:[]}),v=Kg({plan:p==null?void 0:p.plan,activeSubscription:p==null?void 0:p.activeSubscription,billingPeriod:w.billingPeriod}),_=pf({customer:p==null?void 0:p.customer,taxPercentage:(F=l==null?void 0:l.taxDetails)==null?void 0:F.taxPercentage}),M=df({isLoading:h,skipCheckoutSteps:d!=null?d:[],plan:p==null?void 0:p.plan,availableAddons:v.availableAddons,availableCharges:w.billableFeatures,preferredBillingPeriod:n,preconfiguredBillableFeatures:i!=null?i:[]});return {checkout:p,checkoutLocalization:k,stiggTheme:f,theme:T,progressBar:M,planStep:w,addonsStep:v,paymentStep:_,resourceId:(E=p==null?void 0:p.resource)==null?void 0:E.id,widgetState:{readOnly:false,isValid:true,isLoadingCheckoutData:h},showWatermark:m,checkoutSuccess:false,onBeforeStepChange:u}},[n,s,p,h,d,(b=l==null?void 0:l.taxDetails)==null?void 0:b.taxPercentage,u]);return jsxRuntime.jsx(ht,{componentTheme:g,children:jsxRuntime.jsx(dw,{initialState:x,children:e})},p==null?void 0:p.plan.id)}var xf="920px",Cf=y.div`
511
+ `;function zl(){let e=de("md");return jsxRuntime.jsx(Me__default.default,{container:true,spacing:4,className:"stigg-subscription-usage-skeleton-layout",sx:{flexWrap:"wrap"},children:ty__default.default(6).map(t=>jsxRuntime.jsx(Me__default.default,{item:true,xs:e?4:12,children:jsxRuntime.jsx(Qe__default.default,{width:280,height:120})},t))})}function Vl({showAll:e,onToggle:t}){return jsxRuntime.jsx(Gl,{children:jsxRuntime.jsx(Ke,{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 nr({onManageSubscription:e,onBuyMore:t,filterEntitlements:o,filterPackageEntitlements:r}){let{textOverrides:n,theme:i}=W(),{isLoadingData:s,entitlementsToShow:l,creditsToShow:a,subscriptionPriceByFeature:c,gridSizeXs:u,hasCustomSubscription:f,canUpgradeSubscription:p,showAll:h,toggleShowAll:g,hasNoItems:y,showMoreVisible:C}=Ll({filterEntitlements:o,filterPackageEntitlements:r});return y?null:jsxRuntime.jsxs(Re,{className:"stigg-subscription-usage-layout",$backgroundColor:i.backgroundColor,$borderColor:i.borderColor,children:[jsxRuntime.jsx(Le,{children:jsxRuntime.jsx(Ne,{title:n.usageTabTitle,className:"stigg-customer-portal-usage-section-title",isLoading:s})}),s?jsxRuntime.jsx(zl,{}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Dl,{featureEntitlements:l,creditEntitlements:a,subscriptionPriceByFeature:c,gridSizeXs:u,onManageSubscription:e,onBuyMore:t,hasCustomSubscription:f,canUpgradeSubscription:p}),C&&jsxRuntime.jsx(Vl,{showAll:h,onToggle:g})]})]})}function Wl({onManageSubscription:e,onBuyMore:t,filterEntitlements:o,filterPackageEntitlements:r,onCancelScheduledUpdates:n,onContactSupport:i,paywallComponent:s,hiddenSections:l}){let{customerPortal:a,textOverrides:c,theme:u,isLoading:f,showWatermark:p}=W(),h=ii.useRef(null),g=({intentionType:x})=>{var S,T;e?e({intentionType:x,customerSubscriptions:(S=a==null?void 0:a.subscriptions)!=null?S:[]}):(T=h==null?void 0:h.current)==null||T.scrollIntoView({behavior:"smooth"});},y=!(l!=null&&l.some(x=>x==="usage")),C=!(l!=null&&l.some(x=>x==="paymentDetails"||x==="billingInformation")),b=!(l!=null&&l.some(x=>x==="invoices"||x==="billingInformation"));return jsxRuntime.jsxs(Tl,{className:"stigg-customer-portal-layout",children:[jsxRuntime.jsx(hl,{showWatermark:p}),jsxRuntime.jsxs(kl,{className:"stigg-customer-portal-sections",children:[jsxRuntime.jsx(Zo,{onCancelScheduledUpdates:n,onBuyMore:t,onManageSubscription:g,onContactSupport:i,hiddenSections:l,cancelScheduledUpdatesButtonTitle:c.cancelScheduledUpdatesButtonTitle}),y&&jsxRuntime.jsx(nr,{onManageSubscription:g,onBuyMore:t,filterEntitlements:o,filterPackageEntitlements:r}),jsxRuntime.jsx(zn,{ref:h,paywallComponent:s,theme:u,title:c.paywallSectionTitle,isLoading:!a||f}),C&&jsxRuntime.jsx(Jo,{}),b&&jsxRuntime.jsx(ir,{})]})]})}function Yl(i){var s=i,{textOverrides:e,theme:t,resourceId:o,productId:r}=s,n=chunkMY4ZIUAV_cjs_js.c(s,["textOverrides","theme","resourceId","productId"]);return jsxRuntime.jsx(Fo,{textOverrides:e,theme:t,resourceId:o,productId:r,children:jsxRuntime.jsx(Wl,chunkMY4ZIUAV_cjs_js.a({},n))})}function ir(){let{customerPortal:e,isLoading:t,textOverrides:o,theme:r}=W(),n=!e||t,i=n?jsxRuntime.jsx(Ko,{}):e!=null&&e.billingPortalUrl?jsxRuntime.jsx(Yo,{url:e.billingPortalUrl,text:o.viewInvoiceHistory,className:"stigg-view-invoice-history-button"}):null;return !n&&!(e!=null&&e.billingPortalUrl)?null:jsxRuntime.jsx(Re,{className:"stigg-invoices-section-layout",$backgroundColor:r.backgroundColor,$borderColor:r.borderColor,children:jsxRuntime.jsxs(Le,{className:"stigg-invoices-section-header",children:[jsxRuntime.jsx(Ne,{isLoading:n,className:"stigg-invoices-section-title",title:o.invoicesTitle}),i]})})}var Kl=e=>Ql__default.default(e,"displayName"),Qn=e=>Ql__default.default(e,"addon.displayName");function at(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 cy(e,t){return e.pricePoints.some(o=>o.billingPeriod===t)}function ql({addon:e,currency:t,billingCountryCode:o}){return chunkMY4ZIUAV_cjs_js.b(chunkMY4ZIUAV_cjs_js.a({},e),{pricePoints:e.pricePoints.filter(r=>r.currency===t&&(o?r.billingCountryCode===o:true))})}function Jl({addons:e,billingCountryCode:t,currency:o}){return (e==null?void 0:e.map(r=>ql({addon:r,currency:o,billingCountryCode:t})))||[]}function Xl({addons:e,billingPeriod:t,billingCountryCode:o,currency:r}){var n;return ((n=e==null?void 0:e.filter(i=>cy(i.addon,t)))==null?void 0:n.map(i=>chunkMY4ZIUAV_cjs_js.b(chunkMY4ZIUAV_cjs_js.a({},i),{addon:ql({addon:i.addon,currency:r,billingCountryCode:o})})))||[]}function jl({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,s=Jl({addons:t==null?void 0:t.compatibleAddons,billingCountryCode:o,currency:i}),l=Kl(s.filter(f=>!at(f))),a=Xl({addons:e==null?void 0:e.addons,billingPeriod:r,billingCountryCode:o,currency:i});return a!=null&&a.length&&(s!=null&&s.length)&&(n=Qn(a.filter(f=>s.some(p=>p.id===f.addon.id)))),{addons:n,initialAddons:dy__default.default(n),availableAddons:l}}function uy(){let[,e]=R();return (t,o)=>e(r=>{if(at(t))return;let n=r.addonsStep.addons.find(i=>i.addon.id===t.id);if(n){if(at(n.addon))return;n.quantity=o;}else r.addonsStep.addons.push({addon:t,quantity:o}),r.addonsStep.addons=Qn(r.addonsStep.addons);})}function gy(){let[,e]=R();return t=>e(o=>{let r=o.addonsStep.addons.find(n=>n.addon.id===t);r&&at(r.addon)||py__default.default(o.addonsStep.addons,n=>n.addon.id===t);})}function fy(){let[{addonsStep:e}]=R();return e}function ec(){let e=fy();return chunkMY4ZIUAV_cjs_js.b(chunkMY4ZIUAV_cjs_js.a({},e),{setAddon:uy(),removeAddon:gy()})}function yy(){let[{checkout:e,widgetState:t,checkoutLocalization:o,checkoutSuccess:r}]=R();return {checkoutState:e,widgetState:t,checkoutLocalization:o,checkoutSuccess:r}}function hy(){let[,e]=R();return t=>e(o=>{o.widgetState.readOnly=t;})}function Cy(){let[,e]=R();return t=>e(o=>{o.widgetState.isValid=t;})}function xy(){let[,e]=R();return t=>e(o=>{o.checkoutSuccess=t;})}function U(){let{checkoutState:e,widgetState:t,checkoutLocalization:o,checkoutSuccess:r}=yy();return {checkoutState:e,widgetState:t,checkoutLocalization:o,checkoutSuccess:r,setWidgetReadOnly:hy(),setIsValid:Cy(),setCheckoutSuccess:xy()}}function oc({planId:e,resourceId:t,billingCountryCode:o,onMockCheckoutState:r}){let{stigg:n}=chunkMY4ZIUAV_cjs_js.u(),[i,s]=ii.useState(true),[l,a]=ii.useState();return ii.useEffect(()=>{let c=()=>chunkMY4ZIUAV_cjs_js.d(null,null,function*(){try{let u=yield n.getCheckoutState({planId:e,resourceId:t,billingCountryCode:o});a(u);}catch(u){chunkMY4ZIUAV_cjs_js.r.error(`Failed to load checkout ${u==null?void 0:u.message}`,u);}finally{s(false);}});if(r){s(false),a(r({planId:e,resourceId:t,billingCountryCode:o}));return}n.isCustomerLoaded&&(s(true),c());},[n,n.isCustomerLoaded,t,e,o,r]),{checkout:l,isLoading:i,showWatermark:n.getShowWatermark()}}var sr=(e,t)=>e.minUnitQuantity&&t<e.minUnitQuantity?e.minUnitQuantity:e.maxUnitQuantity&&t>e.maxUnitQuantity?e.maxUnitQuantity:t;var Kn=e=>!!(e!=null&&e.pricePoints.some(t=>t.billingPeriod===sdk.BillingPeriod.Monthly)),qn=e=>!!(e!=null&&e.pricePoints.some(t=>t.billingPeriod===sdk.BillingPeriod.Annually)),nc=e=>Kn(e)&&qn(e);var sc=(e,t,o)=>e===sdk.BillingPeriod.Monthly&&t||e===sdk.BillingPeriod.Annually&&o?e:null,lc=({pricingModel:e})=>e===jsClientSdk.BillingModel.PerUnit;function Sy(e,t,o){var i;if(!t)return [];let r=Bl__default.default(e,"featureId"),n=Bl__default.default(ac__default.default((i=o==null?void 0:o.prices)==null?void 0:i.map(s=>{let{feature:l}=s;return !l||!lc(s)?null:{featureId:l.featureId,quantity:l.unitQuantity||null}})),"featureId");return ac__default.default(t==null?void 0:t.map(s=>{var u,f,p;let l=(u=s.feature)==null?void 0:u.featureId;if(!l||!lc(s))return null;let a,c=((f=r[l])==null?void 0:f.quantity)||((p=n[l])==null?void 0:p.quantity);return a=sr(s,c||1),s.isTieredPrice&&!Gt(s.tiers)&&(a=ln(s.tiers,a).upTo),{featureId:l,quantity:a}}))}function Ty({plan:e,activeSubscription:t,preferredBillingPeriod:o}){var s,l;let r=Kn(e),n=qn(e);if(o){let a=sc(o,r,n);if(a)return a}if(((s=t==null?void 0:t.plan)==null?void 0:s.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 a=sc(t==null?void 0:t.prices[0].billingPeriod,r,n);if(a)return a}return n?sdk.BillingPeriod.Annually:sdk.BillingPeriod.Monthly}function cc({preferredBillingPeriod:e,plan:t,activeSubscription:o,billingCountryCode:r,preconfiguredBillableFeatures:n}){let i=Ty({plan:t,activeSubscription:o,preferredBillingPeriod:e}),s=t==null?void 0:t.pricePoints.filter(a=>a.billingPeriod===i),l=Sy(n,s,o);return {billingPeriod:i,billableFeatures:l,billingCountryCode:r}}function ky(){let[{planStep:e}]=R();return e}function wy(){let[,e]=R();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 By(){let[,e]=R();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 Pe(){let e=ky();return chunkMY4ZIUAV_cjs_js.b(chunkMY4ZIUAV_cjs_js.a({},e),{setBillingPeriod:By(),setBillableFeature:wy()})}var pc=[{key:"PLAN",label:"Plan"},{key:"ADDONS",label:"Add-ons"},{key:"PAYMENT",label:"Payment details"}],dc={activeStep:0,completedSteps:[],steps:pc,isDisabled:false},Iy=(e,t,o,r)=>{if(nc(e)&&!r)return false;let n=t.map(s=>s.featureId),i=o.map(s=>s.featureId);return !(n.length!==i.length||!n.every(s=>i.includes(s)))};function mc({isLoading:e,skipCheckoutSteps:t,plan:o,availableAddons:r,availableCharges:n,preferredBillingPeriod:i,preconfiguredBillableFeatures:s}){if(e||!o)return dc;let l=[];return t.includes("PLAN")&&Iy(o,n,s,i)&&l.push("PLAN"),((r==null?void 0:r.length)===0||t.includes("ADDONS"))&&l.push("ADDONS"),chunkMY4ZIUAV_cjs_js.b(chunkMY4ZIUAV_cjs_js.a({},dc),{steps:pc.filter(a=>!l.includes(a.key))})}function Fy(){let[{progressBar:e}]=R();return e}function vy(){let[e,t]=R();return o=>chunkMY4ZIUAV_cjs_js.d(null,null,function*(){let{progressBar:r,planStep:n,addonsStep:i,paymentStep:s,onBeforeStepChange:l}=e;if(o!==r.activeStep&&l){let a=r.steps[r.activeStep],c=r.steps[o];if(a&&c){let u={planStep:n,addonsStep:i,paymentStep:s};if(!(yield l({from:a.key,to:c.key,state:u})))return}}t(({progressBar:a})=>{a.activeStep=o;});})}function Ey(){let[,e]=R();return t=>e(({progressBar:o})=>{o.completedSteps.push(t);})}function Ly(e){return e.completedSteps.length>=e.steps.length-1}function Ny(){let[e,t]=R();return ()=>chunkMY4ZIUAV_cjs_js.d(null,null,function*(){let{progressBar:o,planStep:r,addonsStep:n,paymentStep:i,onBeforeStepChange:s}=e;if(o.isDisabled)return;let l=o.steps[o.activeStep],a=o.steps[o.activeStep+1];if(a&&s){let c={planStep:r,addonsStep:n,paymentStep:i};if(!(yield s({from:l.key,to:a.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 My(){let[,e]=R();return t=>e(({progressBar:o})=>{o.isDisabled=!!t;})}function Ue(){let e=Fy();return {currentStep:e.steps[e.activeStep],progressBarState:e,isLastStep:e.activeStep===e.steps.length-1,isCheckoutComplete:Ly(e),setActiveStep:vy(),markStepAsCompleted:Ey(),goNext:Ny(),setIsDisabled:My()}}function wt(){let[{planStep:e,addonsStep:t,promotionCode:o,paymentStep:r}]=R();return chunkMY4ZIUAV_cjs_js.b(chunkMY4ZIUAV_cjs_js.a({},e),{addons:t.addons,promotionCode:o,billingAddress:r.billingAddress,taxPercentage:r.taxPercentage,taxId:r.taxId})}function lr({billingAddress:e,taxPercentage:t,taxIds:o}){if(!e&&!t&&!(o!=null&&o.length))return {};let r=o!=null&&o.length?o==null?void 0:o.filter(n=>n.value&&n.type):void 0;return {billingInformation:chunkMY4ZIUAV_cjs_js.b(chunkMY4ZIUAV_cjs_js.a(chunkMY4ZIUAV_cjs_js.a({},e?{billingAddress:e}:{}),t?{taxPercentage:t}:{}),{taxIds:r})}}var Dy=h=>chunkMY4ZIUAV_cjs_js.d(null,[h],function*({stigg:e,customerId:t,planId:o,resourceId:r,promotionCode:n,addons:i,billableFeatures:s,billingCountryCode:l,billingPeriod:a,billingAddress:c,taxPercentage:u,taxIds:f,onMockCheckoutPreview:p}){var b;let g=i.map(({addon:x,quantity:S})=>({addonId:x.id,quantity:S})),y=null,C=null;try{if(t&&o){let x=chunkMY4ZIUAV_cjs_js.a({customerId:t,planId:o,resourceId:r,billingCountryCode:l,addons:g,billingPeriod:a,promotionCode:n,billableFeatures:Bg__default.default(s)?void 0:s},lr({billingAddress:c,taxPercentage:u,taxIds:f}));y=p?p(x):yield e.previewSubscription(x);}}catch(x){let[,S]=((b=x==null?void 0:x.message)==null?void 0:b.split("Error:"))||[];C=S==null?void 0:S.trim();}return {subscriptionPreview:y,errorMessage:C}}),Xn=({onMockCheckoutPreview:e}={})=>{let{stigg:t}=chunkMY4ZIUAV_cjs_js.u(),o=wt(),[{resourceId:r}]=R(),{checkoutState:n,widgetState:i}=U(),{plan:s,customer:l}=n||{};return {previewSubscriptionAction:ii.useCallback((...u)=>chunkMY4ZIUAV_cjs_js.d(null,[...u],function*({promotionCode:c}={}){return i.isValid?Dy({stigg:t,customerId:l==null?void 0:l.id,planId: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:c!=null?c:o.promotionCode,taxIds:o.taxId?[o.taxId]:void 0,onMockCheckoutPreview:e}):{subscriptionPreview:null,errorMessage:null}}),[t,l==null?void 0:l.id,s==null?void 0:s.id,r,o.addons,o.billableFeatures,o.billingCountryCode,o.billingPeriod,o.billingAddress,o.taxPercentage,o.taxId,o.promotionCode,i.isValid,e])}},$y=500,uc=({onMockCheckoutPreview:e}={})=>{let[t,o]=ii.useState(null),[r,n]=ii.useState(null),[i,s]=ii.useState(false),{previewSubscriptionAction:l}=Xn({onMockCheckoutPreview:e});return ii.useEffect(()=>{let a=()=>chunkMY4ZIUAV_cjs_js.d(null,null,function*(){let{subscriptionPreview:u,errorMessage:f}=yield l();u&&(o(u),n(null)),f&&(n(f),o(null)),s(false);});s(true);let c=setTimeout(()=>{s(true),a();},$y);return ()=>{clearTimeout(c);}},[l]),{subscriptionPreview:t,isFetchingSubscriptionPreview:i,errorMessage:r}};function gc({customer:e,taxPercentage:t,taxId:o}){return {useNewPaymentMethod:!(e!=null&&e.paymentMethodDetails),taxPercentage:t,taxId:o}}function Gy(){let[,e]=R();return ii.useCallback(t=>e(o=>{o.paymentStep.useNewPaymentMethod=t;}),[e])}function zy(){let[,e]=R();return ii.useCallback(t=>e(o=>{o.paymentStep.errorMessage=t;}),[e])}function Vy(){let[,e]=R();return ii.useCallback(t=>e(o=>{o.paymentStep.billingAddress=t;}),[e])}function Hy(){let[{paymentStep:e}]=R();return e}function Oy(){let[,e]=R();return ii.useCallback(t=>e(o=>{o.paymentStep.taxId=t;}),[e])}function re(){let e=Hy();return chunkMY4ZIUAV_cjs_js.b(chunkMY4ZIUAV_cjs_js.a({},e),{setUseNewPaymentMethod:Gy(),setErrorMessage:zy(),setBillingAddress:Vy(),setTaxId:Oy()})}function yc(e){return dg__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 ${Q(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 Xt={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 hc(e,t,o){let{palette:r}=e||{};return {primary:(t==null?void 0:t.primary)||(r==null?void 0:r.primary)||Xt.primary,textColor:(t==null?void 0:t.textColor)||(r==null?void 0:r.text.primary)||Xt.textColor,backgroundColor:(t==null?void 0:t.backgroundColor)||(r==null?void 0:r.backgroundPaper)||Xt.backgroundColor,borderColor:(t==null?void 0:t.borderColor)||(r==null?void 0:r.outlinedBorder)||Xt.borderColor,summaryBackgroundColor:(t==null?void 0:t.summaryBackgroundColor)||(r==null?void 0:r.backgroundHighlight)||Xt.summaryBackgroundColor,paymentInputBackgroundColor:t==null?void 0:t.paymentInputBackgroundColor,paymentInputBorderColor:t==null?void 0:t.paymentInputBorderColor,paymentInputBorderRadius:t==null?void 0:t.paymentInputBorderRadius}}var ti=ii__default.default.createContext(null);ti.displayName="CheckoutContext";var R=()=>{let e=ii.useContext(ti);if(!e)throw new Error("Could not find Checkout context; You need to wrap your checkout components in an <CheckoutProvider> component.");return e},jy=({children:e,initialState:t})=>{let[o,r]=ii.useState(t);ii.useEffect(()=>{r(t);},[t]);let n=ii.useCallback(l=>r(a=>immer.produce(a,c=>l(c))),[r]),[i,s]=ii.useMemo(()=>[o,n],[n,o]);return jsxRuntime.jsx(ti.Provider,{value:[i,s],children:e})};function xc({children:e,textOverrides:t,theme:o,preferredBillingPeriod:r,billableFeatures:n,resourceId:i,planId:s,billingCountryCode:l,billingInformation:a,onMockCheckoutState:c,skipCheckoutSteps:u,onBeforeStepChange:f}){var x;let{checkout:p,isLoading:h,showWatermark:g}=oc({resourceId:i,planId:s,billingCountryCode:l,onMockCheckoutState:c}),y=p!=null&&p.configuration?ls(p.configuration):{typography:Wt(null,Bo)},C=chunkMY4ZIUAV_cjs_js.v(y),b=ii.useMemo(()=>{var E,A;let S=hc(C,o,p==null?void 0:p.configuration),T=yc(t),F=cc({preferredBillingPeriod:r,plan:p==null?void 0:p.plan,activeSubscription:p==null?void 0:p.activeSubscription,billingCountryCode:l,preconfiguredBillableFeatures:n!=null?n:[]}),w=jl({plan:p==null?void 0:p.plan,activeSubscription:p==null?void 0:p.activeSubscription,billingPeriod:F.billingPeriod}),I=gc({customer:p==null?void 0:p.customer,taxPercentage:(E=a==null?void 0:a.taxDetails)==null?void 0:E.taxPercentage}),k=mc({isLoading:h,skipCheckoutSteps:u!=null?u:[],plan:p==null?void 0:p.plan,availableAddons:w.availableAddons,availableCharges:F.billableFeatures,preferredBillingPeriod:r,preconfiguredBillableFeatures:n!=null?n:[]});return {checkout:p,checkoutLocalization:T,stiggTheme:C,theme:S,progressBar:k,planStep:F,addonsStep:w,paymentStep:I,resourceId:(A=p==null?void 0:p.resource)==null?void 0:A.id,widgetState:{readOnly:false,isValid:true,isLoadingCheckoutData:h},showWatermark:g,checkoutSuccess:false,onBeforeStepChange:f}},[r,l,p,h,u,(x=a==null?void 0:a.taxDetails)==null?void 0:x.taxPercentage,f]);return jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.w,{componentTheme:y,children:jsxRuntime.jsx(jy,{initialState:b,children:e})},p==null?void 0:p.plan.id)}var Pc="920px",Sc=chunkMY4ZIUAV_cjs_js.e.div`
641
512
  margin: auto;
642
513
  min-height: 760px;
643
- max-width: ${xf};
514
+ max-width: ${Pc};
644
515
  display: flex;
645
516
  position: relative;
646
517
  flex-direction: column;
@@ -654,12 +525,12 @@
654
525
  }
655
526
 
656
527
  padding: 16px 16px;
657
- ${wt.md} {
528
+ ${oe.md} {
658
529
  padding: 32px;
659
530
  border-radius: 10px;
660
- width: ${xf};
531
+ width: ${Pc};
661
532
  }
662
- `,Pf=y(Ua__default.default)`
533
+ `,Tc=chunkMY4ZIUAV_cjs_js.e(ke__default.default)`
663
534
  display: flex;
664
535
  align-items: flex-start;
665
536
  gap: 32px;
@@ -667,31 +538,31 @@
667
538
  width: 100%;
668
539
 
669
540
  flex-direction: column;
670
- ${wt.md} {
541
+ ${oe.md} {
671
542
  flex-direction: row;
672
543
  }
673
- `,Sf=y(Ua__default.default)`
544
+ `,kc=chunkMY4ZIUAV_cjs_js.e(ke__default.default)`
674
545
  display: flex;
675
546
  flex-direction: column;
676
547
  gap: 0;
677
548
  flex: 2;
678
549
 
679
550
  width: 100%;
680
- ${wt.md} {
551
+ ${oe.md} {
681
552
  width: auto;
682
553
  }
683
- `;var kf=y(BT__default.default)(({theme:e,$disabled:t})=>({[`&.${BT.linearProgressClasses.root}`]:{borderRadius:e.stigg.border.radius,backgroundColor:e.stigg.palette.outlinedBorder},[`& .${BT.linearProgressClasses.bar}`]:{backgroundColor:t?e.stigg.palette.primaryLight:e.stigg.palette.primary}})),wf=y(B2__default.default)({[`&.${B2.buttonClasses.root}`]:{textTransform:"none",lineHeight:"inherit",justifyContent:"flex-start",padding:"8px 4px"}}),vf=y(mt)(({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 Af=()=>{let{progressBarState:e,setActiveStep:t,currentStep:o}=ke(),{widgetState:n}=Y(),i=Dt("md"),r=Fc.useRef(),{readOnly:a,isLoadingCheckoutData:s}=n,{activeStep:l,completedSteps:c,steps:d}=e||{},u=(l+1)*100/d.length,[p,h]=Fc__default.default.useState(o);return Fc.useEffect(()=>{i||r.current&&o!==p&&r.current.scrollIntoView({behavior:"smooth"}),h(o);},[o,i,p,h]),e.steps.length===1?null:jsxRuntime.jsxs(Ua__default.default,{className:"stigg-checkout-progress-container",sx:{width:"100%",mb:3},ref:r,children:[jsxRuntime.jsx(kf,{variant:"determinate",value:u,$disabled:a}),jsxRuntime.jsx(Se__default.default,{container:true,display:"flex",children:d.map(({key:m,label:g},f)=>{let x=c.includes(f),b=a||f>l&&!x&&!c.includes(f-1)||l!==f&&e.isDisabled;return jsxRuntime.jsx(Se__default.default,{item:true,display:"flex",flexDirection:"row",flex:i?1:"auto",justifyContent:"flex-start",children:s?jsxRuntime.jsx(dt,{width:120,height:20,style:{marginTop:8}}):jsxRuntime.jsx(wf,{onClick:()=>t(f),fullWidth:true,disabled:b,children:jsxRuntime.jsxs(Se__default.default,{item:true,display:"flex",flexDirection:"row",alignItems:"center",gap:1,children:[jsxRuntime.jsx(xw__default.default,{icon:jsxRuntime.jsx(vf,{icon:x?b?"OutlinedCheckedCircleDisabled":"OutlinedCheckedCircle":"OutlinedCircle",$disabled:b,$shouldFill:x})}),jsxRuntime.jsx(P,{variant:"h6",color:b?"primary.main.light":"primary.main",children:g})]})})},m)})})]})};var Pw=[ah.BillingModel.FlatFee,ah.BillingModel.PerUnit,ah.BillingModel.UsageBased],Sw=e=>Gg__default.default(e,[t=>Pw.indexOf(t.pricingModel),t=>{var o;return (o=t.feature)==null?void 0:o.displayName}]),xa=e=>Fc.useMemo(()=>Sw(e),[e]);function Tw(){let[{promotionCode:e}]=j();return e}function kw(){let[,e]=j();return t=>e(o=>{o.promotionCode=t;})}function Mn(){return {promotionCode:Tw(),setPromotionCode:kw()}}var ww=e=>jsxRuntime.jsx("svg",A(S({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"})]})})),ba=ww;var _w=y(ba)`
554
+ `;var Bc=chunkMY4ZIUAV_cjs_js.e(kf__default.default,{shouldForwardProp:e=>!e.startsWith("$")})(({theme:e,$disabled:t})=>({[`&.${kf.linearProgressClasses.root}`]:{borderRadius:e.stigg.border.radius,backgroundColor:e.stigg.palette.outlinedBorder},[`& .${kf.linearProgressClasses.bar}`]:{backgroundColor:t?e.stigg.palette.primaryLight:e.stigg.palette.primary}})),Ac=chunkMY4ZIUAV_cjs_js.e(Ym__default.default)({[`&.${Ym.buttonClasses.root}`]:{textTransform:"none",lineHeight:"inherit",justifyContent:"flex-start",padding:"8px 4px"}}),Ic=chunkMY4ZIUAV_cjs_js.e(chunkMY4ZIUAV_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 vc=()=>{let{progressBarState:e,setActiveStep:t,currentStep:o}=Ue(),{widgetState:r}=U(),n=de("md"),i=ii.useRef(),{readOnly:s,isLoadingCheckoutData:l}=r,{activeStep:a,completedSteps:c,steps:u}=e||{},f=(a+1)*100/u.length,[p,h]=ii__default.default.useState(o);return ii.useEffect(()=>{n||i.current&&o!==p&&i.current.scrollIntoView({behavior:"smooth"}),h(o);},[o,n,p,h]),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(Bc,{variant:"determinate",value:f,$disabled:s}),jsxRuntime.jsx(Me__default.default,{container:true,display:"flex",children:u.map(({key:g,label:y},C)=>{let b=c.includes(C),x=s||C>a&&!b&&!c.includes(C-1)||a!==C&&e.isDisabled;return jsxRuntime.jsx(Me__default.default,{item:true,display:"flex",flexDirection:"row",flex:n?1:"auto",justifyContent:"flex-start",children:l?jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.o,{width:120,height:20,style:{marginTop:8}}):jsxRuntime.jsx(Ac,{onClick:()=>t(C),fullWidth:true,disabled:x,children:jsxRuntime.jsxs(Me__default.default,{item:true,display:"flex",flexDirection:"row",alignItems:"center",gap:1,children:[jsxRuntime.jsx(sh__default.default,{icon:jsxRuntime.jsx(Ic,{icon:b?x?"OutlinedCheckedCircleDisabled":"OutlinedCheckedCircle":"OutlinedCircle",$disabled:x,$shouldFill:b})}),jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.f,{variant:"h6",color:x?"primary.main.light":"primary.main",children:y})]})})},g)})})]})};var dh=[jsClientSdk.BillingModel.FlatFee,jsClientSdk.BillingModel.PerUnit,jsClientSdk.BillingModel.UsageBased],ph=e=>Ql__default.default(e,[t=>dh.indexOf(t.pricingModel),t=>{var o;return (o=t.feature)==null?void 0:o.displayName}]),dr=e=>ii.useMemo(()=>ph(e),[e]);function mh(){let[{promotionCode:e}]=R();return e}function uh(){let[,e]=R();return t=>e(o=>{o.promotionCode=t;})}function Bt(){return {promotionCode:mh(),setPromotionCode:uh()}}var gh=e=>jsxRuntime.jsx("svg",chunkMY4ZIUAV_cjs_js.b(chunkMY4ZIUAV_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"})]})})),pr=gh;var yh=chunkMY4ZIUAV_cjs_js.e(pr,{shouldForwardProp:e=>!e.startsWith("$")})`
684
555
  margin-right: 8px;
685
556
  path {
686
557
  stroke: ${({theme:e,$disabled:t})=>t?e.stigg.palette.text.disabled:e.stigg.palette.primary};
687
558
  }
688
- `,If=({onAddClick:e,checkoutLocalization:t,disabled:o})=>jsxRuntime.jsxs(kt,{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(_w,{$disabled:o,className:"stigg-checkout-summary-add-coupon-code-button-icon"}),jsxRuntime.jsx(P,{className:"stigg-checkout-change-plan-button-text",color:o?"disabled":"primary.main",style:{lineHeight:"24px"},variant:"h3",children:t.summary.addCouponCodeText})]});var Fw=y(kt)`
559
+ `,Lc=({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(yh,{$disabled:o,className:"stigg-checkout-summary-add-coupon-code-button-icon"}),jsxRuntime.jsx(chunkMY4ZIUAV_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 bh=chunkMY4ZIUAV_cjs_js.e(te)`
689
560
  padding: 4px 10px;
690
561
  min-width: unset;
691
562
  border-radius: ${({theme:e})=>e.stigg.border.radius};
692
563
  display: flex;
693
564
  align-items: center;
694
- `,Ef=({disabled:e,checkoutLocalization:t,onMockCheckoutPreview:o})=>{let{setPromotionCode:n}=Mn(),[i,r]=Fc.useState(false),[a,s]=Fc__default.default.useState(""),[l,c]=Fc__default.default.useState(false),[d,u]=Fc__default.default.useState(""),{previewSubscriptionAction:p}=wc({onMockCheckoutPreview:o}),h=()=>R(null,null,function*(){var f;c(true),u("");let{subscriptionPreview:m,errorMessage:g}=yield p({promotionCode:a});!g&&((f=m==null?void 0:m.immediateInvoice)!=null&&f.discountDetails)?(n(a.toUpperCase()),r(false)):g&&u(g),c(false);});return i?jsxRuntime.jsxs(Se__default.default,{children:[jsxRuntime.jsx(P,{variant:"body1",color:d?"error":e?"disabled":"primary.main",children:t.summary.couponCodeTitle}),jsxRuntime.jsx(Rt,{disabled:e,autoFocus:true,variant:"outlined",fullWidth:true,error:!!d,value:a,onChange:m=>{s(m.target.value);},inputProps:{maxLength:20},onKeyDown:m=>{m.key==="Enter"&&(h(),m.preventDefault());},InputProps:{endAdornment:jsxRuntime.jsx(Fw,{variant:"contained",disabled:e,onClick:()=>{h();},children:l?jsxRuntime.jsx(Iw__default.default,{size:18,sx:{color:"white"}}):jsxRuntime.jsx(mt,{style:{display:"flex"},icon:"ArrowForward"})})}}),!!d&&jsxRuntime.jsx(P,{variant:"body1",color:"error",children:d})]}):jsxRuntime.jsx(If,{disabled:e,onAddClick:()=>r(true),checkoutLocalization:t})};var Bw=y(Se__default.default)`
565
+ `,Nc=({disabled:e,checkoutLocalization:t,onMockCheckoutPreview:o})=>{let{setPromotionCode:r}=Bt(),[n,i]=ii.useState(false),[s,l]=ii__default.default.useState(""),[a,c]=ii__default.default.useState(false),[u,f]=ii__default.default.useState(""),{previewSubscriptionAction:p}=Xn({onMockCheckoutPreview:o}),h=()=>chunkMY4ZIUAV_cjs_js.d(null,null,function*(){var C;c(true),f("");let{subscriptionPreview:g,errorMessage:y}=yield p({promotionCode:s});!y&&((C=g==null?void 0:g.immediateInvoice)!=null&&C.discountDetails)?(r(s.toUpperCase()),i(false)):y&&f(y),c(false);});return n?jsxRuntime.jsxs(Me__default.default,{children:[jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.f,{variant:"body1",color:u?"error":e?"disabled":"primary.main",children:t.summary.couponCodeTitle}),jsxRuntime.jsx(ce,{disabled:e,autoFocus:true,variant:"outlined",fullWidth:true,error:!!u,value:s,onChange:g=>{l(g.target.value);},inputProps:{maxLength:20},onKeyDown:g=>{g.key==="Enter"&&(h(),g.preventDefault());},InputProps:{endAdornment:jsxRuntime.jsx(bh,{variant:"contained",disabled:e,onClick:()=>{h();},children:a?jsxRuntime.jsx(xh__default.default,{size:18,sx:{color:"white"}}):jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.i,{style:{display:"flex"},icon:"ArrowForward"})})}}),!!u&&jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.f,{variant:"body1",color:"error",children:u})]}):jsxRuntime.jsx(Lc,{disabled:e,onAddClick:()=>i(true),checkoutLocalization:t})};var Th=chunkMY4ZIUAV_cjs_js.e(Me__default.default)`
695
566
  width: auto;
696
567
  display: inline-flex;
697
568
  align-items: center;
@@ -700,7 +571,7 @@
700
571
  padding: 6px 8px;
701
572
  border-radius: ${({theme:e})=>e.stigg.border.radius};
702
573
  border: 1px solid ${({theme:e})=>e.stigg.palette.primary};
703
- `,Ff=y(mt)`
574
+ `,Mc=chunkMY4ZIUAV_cjs_js.e(chunkMY4ZIUAV_cjs_js.i,{shouldForwardProp:e=>e!=="style"})`
704
575
  display: flex;
705
576
 
706
577
  g {
@@ -710,16 +581,16 @@
710
581
  path {
711
582
  fill: ${({theme:e,$shouldFill:t})=>t?e.stigg.palette.primary:void 0};
712
583
  }
713
- `,Bf=({promotionCode:e,onClearPromotionCode:t})=>jsxRuntime.jsxs(Bw,{container:true,children:[jsxRuntime.jsxs(Se__default.default,{item:true,display:"flex",gap:1,alignItems:"center",children:[jsxRuntime.jsx(Ff,{icon:"Coupon"}),jsxRuntime.jsx(P,{variant:"body1",color:"primary.main",lineHeight:"auto",children:e})]}),jsxRuntime.jsx(Se__default.default,{item:true,children:jsxRuntime.jsx(kt,{variant:"text",sx:{minWidth:"unset",padding:0},onClick:t,children:jsxRuntime.jsx(Ff,{icon:"Close",$shouldFill:true})})})]});var Rw=y.div`
584
+ `,Uc=({promotionCode:e,onClearPromotionCode:t})=>jsxRuntime.jsxs(Th,{container:true,children:[jsxRuntime.jsxs(Me__default.default,{item:true,display:"flex",gap:1,alignItems:"center",children:[jsxRuntime.jsx(Mc,{icon:"Coupon"}),jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.f,{variant:"body1",color:"primary.main",lineHeight:"auto",children:e})]}),jsxRuntime.jsx(Me__default.default,{item:true,children:jsxRuntime.jsx(te,{variant:"text",sx:{minWidth:"unset",padding:0},onClick:t,children:jsxRuntime.jsx(Mc,{icon:"Close",$shouldFill:true})})})]});var kh=chunkMY4ZIUAV_cjs_js.e.div`
714
585
  margin: 16px 0;
715
- `,Rf=({disabled:e,checkoutLocalization:t,onMockCheckoutPreview:o})=>{let{promotionCode:n,setPromotionCode:i}=Mn();return jsxRuntime.jsx(Rw,{children:n?jsxRuntime.jsx(Bf,{promotionCode:n,onClearPromotionCode:()=>{i("");}}):jsxRuntime.jsx(Ef,{disabled:e,checkoutLocalization:t,onMockCheckoutPreview:o})})};var Df=({label:e,checked:t,onChange:o,onClick:n,value:i,disabled:r,dataTestId:a})=>jsxRuntime.jsx(material.FormControlLabel,{onClick:n,value:i,control:jsxRuntime.jsx(material.Checkbox,{checked:t,onChange:o,disabled:r,"data-testid":a}),label:lodash.isString(e)?jsxRuntime.jsx(P,{variant:"body1",lineHeight:"20px",color:"secondary",children:e}):e});var Dc=[{country:"Albania",countryCode:"AL",taxIdType:"al_tin",FlagComponent:C__namespace.AL,example:"J12345678N"},{country:"Andorra",countryCode:"AD",taxIdType:"ad_nrt",FlagComponent:C__namespace.AD,example:"A-123456-Z"},{country:"Angola",countryCode:"AO",taxIdType:"ao_tin",FlagComponent:C__namespace.AO,example:"5123456789"},{country:"Argentina",countryCode:"AR",taxIdType:"ar_cuit",FlagComponent:C__namespace.AR,example:"12-3456789-01"},{country:"Armenia",countryCode:"AM",taxIdType:"am_tin",FlagComponent:C__namespace.AM,example:"02538904"},{country:"Aruba",countryCode:"AW",taxIdType:"aw_tin",FlagComponent:C__namespace.AW,example:"12345678"},{country:"Australia",countryCode:"AU",taxIdType:"au_abn",FlagComponent:C__namespace.AU,example:"12345678912"},{country:"Australia",countryCode:"AU",taxIdType:"au_arn",FlagComponent:C__namespace.AU,example:"123456789123"},{country:"Austria",countryCode:"AT",taxIdType:"eu_vat",FlagComponent:C__namespace.AT,example:"ATU12345678"},{country:"Azerbaijan",countryCode:"AZ",taxIdType:"az_tin",FlagComponent:C__namespace.AZ,example:"0123456789"},{country:"Bahamas",countryCode:"BS",taxIdType:"bs_tin",FlagComponent:C__namespace.BS,example:"123.456.789"},{country:"Bahrain",countryCode:"BH",taxIdType:"bh_vat",FlagComponent:C__namespace.BH,example:"123456789012345"},{country:"Bangladesh",countryCode:"BD",taxIdType:"bd_bin",FlagComponent:C__namespace.BD,example:"123456789-0123"},{country:"Barbados",countryCode:"BB",taxIdType:"bb_tin",FlagComponent:C__namespace.BB,example:"1123456789012"},{country:"Belarus",countryCode:"BY",taxIdType:"by_tin",FlagComponent:C__namespace.BY,example:"123456789"},{country:"Belgium",countryCode:"BE",taxIdType:"eu_vat",FlagComponent:C__namespace.BE,example:"BE0123456789"},{country:"Benin",countryCode:"BJ",taxIdType:"bj_ifu",FlagComponent:C__namespace.BJ,example:"1234567890123"},{country:"Bolivia",countryCode:"BO",taxIdType:"bo_tin",FlagComponent:C__namespace.BO,example:"123456789"},{country:"Bosnia & Herzegovina",countryCode:"BA",taxIdType:"ba_tin",FlagComponent:C__namespace.BA,example:"123456789012"},{country:"Brazil",countryCode:"BR",taxIdType:"br_cnpj",FlagComponent:C__namespace.BR,example:"01.234.456/5432-10"},{country:"Brazil",countryCode:"BR",taxIdType:"br_cpf",FlagComponent:C__namespace.BR,example:"123.456.789-87"},{country:"Bulgaria",countryCode:"BG",taxIdType:"bg_uic",FlagComponent:C__namespace.BG,example:"123456789"},{country:"Bulgaria",countryCode:"BG",taxIdType:"eu_vat",FlagComponent:C__namespace.BG,example:"BG0123456789"},{country:"Burkina Faso",countryCode:"BF",taxIdType:"bf_ifu",FlagComponent:C__namespace.BF,example:"12345678A"},{country:"Cambodia",countryCode:"KH",taxIdType:"kh_tin",FlagComponent:C__namespace.KH,example:"1001-123456789"},{country:"Cameroon",countryCode:"CM",taxIdType:"cm_niu",FlagComponent:C__namespace.CM,example:"M123456789000L"},{country:"Canada",countryCode:"CA",taxIdType:"ca_bn",FlagComponent:C__namespace.CA,example:"123456789"},{country:"Canada",countryCode:"CA",taxIdType:"ca_gst_hst",FlagComponent:C__namespace.CA,example:"123456789RT0002"},{country:"Canada",countryCode:"CA",taxIdType:"ca_pst_bc",FlagComponent:C__namespace.CA,example:"PST-1234-5678"},{country:"Canada",countryCode:"CA",taxIdType:"ca_pst_mb",FlagComponent:C__namespace.CA,example:"123456-7"},{country:"Canada",countryCode:"CA",taxIdType:"ca_pst_sk",FlagComponent:C__namespace.CA,example:"1234567"},{country:"Canada",countryCode:"CA",taxIdType:"ca_qst",FlagComponent:C__namespace.CA,example:"1234567890TQ1234"},{country:"Cape Verde",countryCode:"CV",taxIdType:"cv_nif",FlagComponent:C__namespace.CV,example:"213456789"},{country:"Chile",countryCode:"CL",taxIdType:"cl_tin",FlagComponent:C__namespace.CL,example:"12.345.678-K"},{country:"China",countryCode:"CN",taxIdType:"cn_tin",FlagComponent:C__namespace.CN,example:"123456789012345678"},{country:"Colombia",countryCode:"CO",taxIdType:"co_nit",FlagComponent:C__namespace.CO,example:"123.456.789-0"},{country:"Congo - Kinshasa",countryCode:"CD",taxIdType:"cd_nif",FlagComponent:C__namespace.CD,example:"A0123456M"},{country:"Costa Rica",countryCode:"CR",taxIdType:"cr_tin",FlagComponent:C__namespace.CR,example:"1-234-567890"},{country:"Croatia",countryCode:"HR",taxIdType:"eu_vat",FlagComponent:C__namespace.HR,example:"HR12345678912"},{country:"Croatia",countryCode:"HR",taxIdType:"hr_oib",FlagComponent:C__namespace.HR,example:"12345678901"},{country:"Cyprus",countryCode:"CY",taxIdType:"eu_vat",FlagComponent:C__namespace.CY,example:"CY12345678Z"},{country:"Czech Republic",countryCode:"CZ",taxIdType:"eu_vat",FlagComponent:C__namespace.CZ,example:"CZ1234567890"},{country:"Denmark",countryCode:"DK",taxIdType:"eu_vat",FlagComponent:C__namespace.DK,example:"DK12345678"},{country:"Dominican Republic",countryCode:"DO",taxIdType:"do_rcn",FlagComponent:C__namespace.DO,example:"123-4567890-1"},{country:"Ecuador",countryCode:"EC",taxIdType:"ec_ruc",FlagComponent:C__namespace.EC,example:"1234567890001"},{country:"Egypt",countryCode:"EG",taxIdType:"eg_tin",FlagComponent:C__namespace.EG,example:"123456789"},{country:"El Salvador",countryCode:"SV",taxIdType:"sv_nit",FlagComponent:C__namespace.SV,example:"1234-567890-123-4"},{country:"Estonia",countryCode:"EE",taxIdType:"eu_vat",FlagComponent:C__namespace.EE,example:"EE123456789"},{country:"Ethiopia",countryCode:"ET",taxIdType:"et_tin",FlagComponent:C__namespace.ET,example:"1234567890"},{country:"EU",countryCode:"EU",taxIdType:"eu_oss_vat",FlagComponent:C__namespace.EU,example:"EU123456789"},{country:"Finland",countryCode:"FI",taxIdType:"eu_vat",FlagComponent:C__namespace.FI,example:"FI12345678"},{country:"France",countryCode:"FR",taxIdType:"eu_vat",FlagComponent:C__namespace.FR,example:"FRAB123456789"},{country:"Georgia",countryCode:"GE",taxIdType:"ge_vat",FlagComponent:C__namespace.GE,example:"123456789"},{country:"Germany",countryCode:"DE",taxIdType:"de_stn",FlagComponent:C__namespace.DE,example:"1234567890"},{country:"Germany",countryCode:"DE",taxIdType:"eu_vat",FlagComponent:C__namespace.DE,example:"DE123456789"},{country:"Greece",countryCode:"GR",taxIdType:"eu_vat",FlagComponent:C__namespace.GR,example:"EL123456789"},{country:"Guinea",countryCode:"GN",taxIdType:"gn_nif",FlagComponent:C__namespace.GN,example:"123456789"},{country:"Hong Kong",countryCode:"HK",taxIdType:"hk_br",FlagComponent:C__namespace.HK,example:"12345678"},{country:"Hungary",countryCode:"HU",taxIdType:"eu_vat",FlagComponent:C__namespace.HU,example:"HU12345678"},{country:"Hungary",countryCode:"HU",taxIdType:"hu_tin",FlagComponent:C__namespace.HU,example:"12345678-1-23"},{country:"Iceland",countryCode:"IS",taxIdType:"is_vat",FlagComponent:C__namespace.IS,example:"123456"},{country:"India",countryCode:"IN",taxIdType:"in_gst",FlagComponent:C__namespace.IN,example:"12ABCDE3456FGZH"},{country:"Indonesia",countryCode:"ID",taxIdType:"id_npwp",FlagComponent:C__namespace.ID,example:"012.345.678.9-012.345"},{country:"Ireland",countryCode:"IE",taxIdType:"eu_vat",FlagComponent:C__namespace.IE,example:"IE1234567AB"},{country:"Israel",countryCode:"IL",taxIdType:"il_vat",FlagComponent:C__namespace.IL,example:"000012345"},{country:"Italy",countryCode:"IT",taxIdType:"eu_vat",FlagComponent:C__namespace.IT,example:"IT12345678912"},{country:"Japan",countryCode:"JP",taxIdType:"jp_cn",FlagComponent:C__namespace.JP,example:"1234567891234"},{country:"Japan",countryCode:"JP",taxIdType:"jp_rn",FlagComponent:C__namespace.JP,example:"12345"},{country:"Japan",countryCode:"JP",taxIdType:"jp_trn",FlagComponent:C__namespace.JP,example:"T1234567891234"},{country:"Kazakhstan",countryCode:"KZ",taxIdType:"kz_bin",FlagComponent:C__namespace.KZ,example:"123456789012"},{country:"Kenya",countryCode:"KE",taxIdType:"ke_pin",FlagComponent:C__namespace.KE,example:"P000111111A"},{country:"Kyrgyzstan",countryCode:"KG",taxIdType:"kg_tin",FlagComponent:C__namespace.KG,example:"12345678901234"},{country:"Laos",countryCode:"LA",taxIdType:"la_tin",FlagComponent:C__namespace.LA,example:"123456789-000"},{country:"Latvia",countryCode:"LV",taxIdType:"eu_vat",FlagComponent:C__namespace.LV,example:"LV12345678912"},{country:"Liechtenstein",countryCode:"LI",taxIdType:"li_uid",FlagComponent:C__namespace.LI,example:"CHE123456789"},{country:"Liechtenstein",countryCode:"LI",taxIdType:"li_vat",FlagComponent:C__namespace.LI,example:"12345"},{country:"Lithuania",countryCode:"LT",taxIdType:"eu_vat",FlagComponent:C__namespace.LT,example:"LT123456789123"},{country:"Luxembourg",countryCode:"LU",taxIdType:"eu_vat",FlagComponent:C__namespace.LU,example:"LU12345678"},{country:"Malaysia",countryCode:"MY",taxIdType:"my_frp",FlagComponent:C__namespace.MY,example:"12345678"},{country:"Malaysia",countryCode:"MY",taxIdType:"my_itn",FlagComponent:C__namespace.MY,example:"C 1234567890"},{country:"Malaysia",countryCode:"MY",taxIdType:"my_sst",FlagComponent:C__namespace.MY,example:"A12-3456-78912345"},{country:"Malta",countryCode:"MT",taxIdType:"eu_vat",FlagComponent:C__namespace.MT,example:"MT12345678"},{country:"Mauritania",countryCode:"MR",taxIdType:"mr_nif",FlagComponent:C__namespace.MR,example:"12345678"},{country:"Mexico",countryCode:"MX",taxIdType:"mx_rfc",FlagComponent:C__namespace.MX,example:"ABC010203AB9"},{country:"Moldova",countryCode:"MD",taxIdType:"md_vat",FlagComponent:C__namespace.MD,example:"1234567"},{country:"Montenegro",countryCode:"ME",taxIdType:"me_pib",FlagComponent:C__namespace.ME,example:"12345678"},{country:"Morocco",countryCode:"MA",taxIdType:"ma_vat",FlagComponent:C__namespace.MA,example:"12345678"},{country:"Nepal",countryCode:"NP",taxIdType:"np_pan",FlagComponent:C__namespace.NP,example:"123456789"},{country:"Netherlands",countryCode:"NL",taxIdType:"eu_vat",FlagComponent:C__namespace.NL,example:"NL123456789B12"},{country:"New Zealand",countryCode:"NZ",taxIdType:"nz_gst",FlagComponent:C__namespace.NZ,example:"123456789"},{country:"Nigeria",countryCode:"NG",taxIdType:"ng_tin",FlagComponent:C__namespace.NG,example:"12345678-0001"},{country:"North Macedonia",countryCode:"MK",taxIdType:"mk_vat",FlagComponent:C__namespace.MK,example:"MK1234567890123"},{country:"Norway",countryCode:"NO",taxIdType:"no_vat",FlagComponent:C__namespace.NO,example:"123456789MVA"},{country:"Norway",countryCode:"NO",taxIdType:"no_voec",FlagComponent:C__namespace.NO,example:"1234567"},{country:"Oman",countryCode:"OM",taxIdType:"om_vat",FlagComponent:C__namespace.OM,example:"OM1234567890"},{country:"Peru",countryCode:"PE",taxIdType:"pe_ruc",FlagComponent:C__namespace.PE,example:"12345678901"},{country:"Philippines",countryCode:"PH",taxIdType:"ph_tin",FlagComponent:C__namespace.PH,example:"123456789012"},{country:"Poland",countryCode:"PL",taxIdType:"eu_vat",FlagComponent:C__namespace.PL,example:"PL1234567890"},{country:"Portugal",countryCode:"PT",taxIdType:"eu_vat",FlagComponent:C__namespace.PT,example:"PT123456789"},{country:"Romania",countryCode:"RO",taxIdType:"eu_vat",FlagComponent:C__namespace.RO,example:"RO1234567891"},{country:"Romania",countryCode:"RO",taxIdType:"ro_tin",FlagComponent:C__namespace.RO,example:"1234567890123"},{country:"Russia",countryCode:"RU",taxIdType:"ru_inn",FlagComponent:C__namespace.RU,example:"1234567891"},{country:"Russia",countryCode:"RU",taxIdType:"ru_kpp",FlagComponent:C__namespace.RU,example:"123456789"},{country:"Saudi Arabia",countryCode:"SA",taxIdType:"sa_vat",FlagComponent:C__namespace.SA,example:"123456789012345"},{country:"Senegal",countryCode:"SN",taxIdType:"sn_ninea",FlagComponent:C__namespace.SN,example:"12345672A2"},{country:"Serbia",countryCode:"RS",taxIdType:"rs_pib",FlagComponent:C__namespace.RS,example:"123456789"},{country:"Singapore",countryCode:"SG",taxIdType:"sg_gst",FlagComponent:C__namespace.SG,example:"M12345678X"},{country:"Singapore",countryCode:"SG",taxIdType:"sg_uen",FlagComponent:C__namespace.SG,example:"123456789F"},{country:"Slovakia",countryCode:"SK",taxIdType:"eu_vat",FlagComponent:C__namespace.SK,example:"SK1234567891"},{country:"Slovenia",countryCode:"SI",taxIdType:"eu_vat",FlagComponent:C__namespace.SI,example:"SI12345678"},{country:"Slovenia",countryCode:"SI",taxIdType:"si_tin",FlagComponent:C__namespace.SI,example:"12345678"},{country:"South Africa",countryCode:"ZA",taxIdType:"za_vat",FlagComponent:C__namespace.ZA,example:"4123456789"},{country:"South Korea",countryCode:"KR",taxIdType:"kr_brn",FlagComponent:C__namespace.KR,example:"123-45-67890"},{country:"Spain",countryCode:"ES",taxIdType:"es_cif",FlagComponent:C__namespace.ES,example:"A12345678"},{country:"Spain",countryCode:"ES",taxIdType:"eu_vat",FlagComponent:C__namespace.ES,example:"ESA1234567Z"},{country:"Suriname",countryCode:"SR",taxIdType:"sr_fin",FlagComponent:C__namespace.SR,example:"1234567890"},{country:"Sweden",countryCode:"SE",taxIdType:"eu_vat",FlagComponent:C__namespace.SE,example:"SE123456789123"},{country:"Switzerland",countryCode:"CH",taxIdType:"ch_uid",FlagComponent:C__namespace.CH,example:"CHE-123.456.789 HR"},{country:"Switzerland",countryCode:"CH",taxIdType:"ch_vat",FlagComponent:C__namespace.CH,example:"CHE-123.456.789 MWST"},{country:"Taiwan",countryCode:"TW",taxIdType:"tw_vat",FlagComponent:C__namespace.TW,example:"12345678"},{country:"Tajikistan",countryCode:"TJ",taxIdType:"tj_tin",FlagComponent:C__namespace.TJ,example:"123456789"},{country:"Tanzania",countryCode:"TZ",taxIdType:"tz_vat",FlagComponent:C__namespace.TZ,example:"12345678A"},{country:"Thailand",countryCode:"TH",taxIdType:"th_vat",FlagComponent:C__namespace.TH,example:"1234567891234"},{country:"Turkey",countryCode:"TR",taxIdType:"tr_tin",FlagComponent:C__namespace.TR,example:"0123456789"},{country:"Uganda",countryCode:"UG",taxIdType:"ug_tin",FlagComponent:C__namespace.UG,example:"1014751879"},{country:"Ukraine",countryCode:"UA",taxIdType:"ua_vat",FlagComponent:C__namespace.UA,example:"123456789"},{country:"United Arab Emirates",countryCode:"AE",taxIdType:"ae_trn",FlagComponent:C__namespace.AE,example:"123456789012345"},{country:"United Kingdom",countryCode:"GB",taxIdType:"eu_vat",FlagComponent:C__namespace.GB,example:"XI123456789"},{country:"United Kingdom",countryCode:"GB",taxIdType:"gb_vat",FlagComponent:C__namespace.GB,example:"GB123456789"},{country:"United States",countryCode:"US",taxIdType:"us_ein",FlagComponent:C__namespace.US,example:"12-3456789"},{country:"Uruguay",countryCode:"UY",taxIdType:"uy_ruc",FlagComponent:C__namespace.UY,example:"123456789012"},{country:"Uzbekistan",countryCode:"UZ",taxIdType:"uz_tin",FlagComponent:C__namespace.UZ,example:"123456789"},{country:"Uzbekistan",countryCode:"UZ",taxIdType:"uz_vat",FlagComponent:C__namespace.UZ,example:"123456789012"},{country:"Venezuela",countryCode:"VE",taxIdType:"ve_rif",FlagComponent:C__namespace.VE,example:"A-12345678-9"},{country:"Vietnam",countryCode:"VN",taxIdType:"vn_tin",FlagComponent:C__namespace.VN,example:"1234567890"},{country:"Zambia",countryCode:"ZM",taxIdType:"zm_tin",FlagComponent:C__namespace.ZM,example:"1004751879"},{country:"Zimbabwe",countryCode:"ZW",taxIdType:"zw_tin",FlagComponent:C__namespace.ZW,example:"1234567890"}],Ow="United States",zw=" # ",Ca="us_ein",Pa=(e,t)=>`${e}${zw}${t}`,Nc=new Map(Dc.map(e=>[Pa(e.taxIdType,e.country),e])),In=e=>Nc.get(e),Sa=Pa(Ca,Ow);var Uc=y(Rt)(()=>({"& .MuiOutlinedInput-root":{borderRadius:"5px",padding:"12px",fieldset:{borderColor:"#e6e6e6"}},"& .MuiInputBase-input":{borderRadius:"5px",fontSize:"16px",padding:"0 0"}}));var Gw=y(material.Autocomplete)(()=>({"& .MuiAutocomplete-input":{padding:"0 !important"}})),Ta=y(P)({});Ta.defaultProps={variant:"body1",color:"secondary"};function Of(){let[e,t]=Fc.useState(false),{billingAddress:o,taxId:n,setTaxId:i}=vt(),[r,a]=Fc.useState(Sa),[s,l]=Fc.useState(false),c=Fc.useCallback((m,g,f)=>{i({type:g,value:f}),a(m);},[i,a]);Fc.useEffect(()=>{l(false);},[o==null?void 0:o.country]),Fc.useEffect(()=>{if(!(o!=null&&o.country)||s||!e)return;let m=Dc.find(g=>g.countryCode===o.country);m&&c(Pa(m.taxIdType,m.country),m.taxIdType,"");},[o,e,s,c]);let d=m=>{if(!m)return;let g=In(m);if(g){if(l(true),n!=null&&n.value){c(m,g.taxIdType,n.value);return}a(m),n!=null&&n.type&&i(void 0);}},u=Fc.useMemo(()=>Array.from(Nc.keys()),[]),p=Fc.useMemo(()=>u.find(m=>m===r)||null,[u,r]),h=Fc.useMemo(()=>{let m=In(r);return (m==null?void 0:m.example)||"Add your VAT/GST or local tax ID."},[r]);return Fc.useEffect(()=>(e||(l(false),c(Sa,Ca,"")),()=>{c(Sa,Ca,"");}),[e,c]),jsxRuntime.jsxs(Se__default.default,{flexDirection:"column",container:true,gap:2,children:[jsxRuntime.jsx(Se__default.default,{flexDirection:"row",container:true,gap:2,children:jsxRuntime.jsx(Df,{checked:e,onChange:()=>t(m=>!m),label:jsxRuntime.jsx(Ta,{children:"I'm purchasing as a business"})})}),jsxRuntime.jsx(material.Collapse,{in:e,children:jsxRuntime.jsxs(Se__default.default,{container:true,spacing:0,sx:{width:"100%"},children:[jsxRuntime.jsxs(Se__default.default,{item:true,xs:6,children:[jsxRuntime.jsx(Ta,{children:"Tax ID Type"}),jsxRuntime.jsx(Gw,{fullWidth:true,options:u,value:p,onChange:(m,g)=>d(g),renderInput:m=>jsxRuntime.jsx(Uc,A(S({},m),{id:"id-type",InputProps:m.InputProps})),renderOption:(m,g)=>{let f=In(g);if(!f)return null;let{taxIdType:x,country:b,FlagComponent:T}=f;return Fc.createElement(material.MenuItem,A(S({},m),{key:g}),jsxRuntime.jsxs(P,{variant:"body1",lineHeight:"20px",color:"secondary",children:[T&&jsxRuntime.jsx(T,{width:15,style:{marginRight:"5px",borderRadius:"8%"}}),lodash.startCase(b)," - ",lodash.upperCase(x)]}))},getOptionLabel:m=>{let g=In(m);return g?`${lodash.startCase(g.country)} - ${lodash.upperCase(g.taxIdType)}`:m},ListboxProps:{sx:{maxHeight:200}}})]}),jsxRuntime.jsxs(Se__default.default,{item:true,xs:6,paddingLeft:"12px",children:[jsxRuntime.jsx(Ta,{children:"Tax ID"}),jsxRuntime.jsx(Uc,{id:"tax-id-value",placeholder:h,type:"text",fullWidth:true,value:(n==null?void 0:n.value)||"",onChange:m=>{let g=In(r);g&&c(r,g.taxIdType,m.target.value);}})]})]})})]})}function zf({onBillingAddressChange:e,collectPhoneNumber:t,collectTaxId:o}){var m;let{checkoutState:n,checkoutLocalization:i,widgetState:r,setWidgetReadOnly:a}=Y(),{setBillingAddress:s}=vt(),{customer:l,configuration:c}=n||{},{readOnly:d}=r,u=!!(t!=null?t:(m=c==null?void 0:c.content)!=null&&m.collectPhoneNumber),p=Fc.useMemo(()=>o&&!(l!=null&&l.billingId)&&!(l!=null&&l.paymentMethodDetails),[o,l==null?void 0:l.billingId,l==null?void 0:l.paymentMethodDetails]),h=g=>{if(!g.complete)return;let T=g.value.address,{postal_code:f}=T,x=ot(T,["postal_code"]),b=S({postalCode:f},x);a(true),s(b),e?R(null,null,function*(){yield e({billingAddress:b}),a(false);}):a(false);};return jsxRuntime.jsxs(Se__default.default,{flexDirection:"column",container:true,gap:3,padding:"16px",sx:{pointerEvents:d?"none":void 0},children:[jsxRuntime.jsxs(Se__default.default,{flexDirection:"column",container:true,gap:2,children:[jsxRuntime.jsx(P,{variant:"h6",children:i.newPaymentMethodBillingAddressTitle}),jsxRuntime.jsx(reactStripeJs.AddressElement,{onChange:h,options:{mode:"billing",fields:{phone:u?"always":"auto"},defaultValues:S({},(l==null?void 0:l.name)&&{name:l.name})}})]}),jsxRuntime.jsxs(Se__default.default,{flexDirection:"column",container:true,gap:2,children:[jsxRuntime.jsx(P,{variant:"h6",children:i.newPaymentMethodCardTitle}),jsxRuntime.jsx(reactStripeJs.PaymentElement,{onChange:()=>{},onReady:()=>{},options:{readOnly:d,terms:{card:"never"},defaultValues:{billingDetails:S(S({},(l==null?void 0:l.name)&&{name:l.name}),(l==null?void 0:l.email)&&{email:l.email})}}})]}),p&&jsxRuntime.jsx(Of,{})]})}function Vf(){let[e,t]=Fc.useState(null),{checkoutState:o}=Y(),{billingIntegration:n,setupSecret:i}=o||{};return Fc.useEffect(()=>{if(n){let{billingIdentifier:r,credentials:a}=n;if(r!==ah.BillingVendorIdentifier.Stripe)return;let{accountId:s,publicKey:l}=a;if(!s||!l){console.error("Stripe account ID or public key is missing");return}import('@stripe/stripe-js').then(({loadStripe:c})=>{t(c(l,{stripeAccount:s}));});}},[n]),{stripePromise:e,setupIntentClientSecret:i}}function ka(e){var n;let t=D({optional:true}),o=t==null?void 0:t.stigg;return o?o.getBooleanEntitlement(e):S(S({},ah.BOOLEAN_DEFAULT_FALLBACK_ENTITLEMENT),(n=e.options)==null?void 0:n.fallback)}function wa(e){var n;let t=D({optional:true}),o=t==null?void 0:t.stigg;return o?o.getNumericEntitlement(e):S(S({},ah.NUMERIC_DEFAULT_FALLBACK_ENTITLEMENT),(n=e.options)==null?void 0:n.fallback)}function va(e){var n;let t=D({optional:true}),o=t==null?void 0:t.stigg;return o?o.getMeteredEntitlement(e):S(S({},ah.METERED_DEFAULT_FALLBACK_ENTITLEMENT),(n=e.options)==null?void 0:n.fallback)}function _a(e){var n;let t=D({optional:true}),o=t==null?void 0:t.stigg;return o?o.getEnumEntitlement(e):S(S({},ah.ENUM_DEFAULT_FALLBACK_ENTITLEMENT),(n=e.options)==null?void 0:n.fallback)}function Ut({func:e}){let[t,o]=Fc.useState(true),[n,i]=Fc.useState(null),[r,a]=Fc.useState(null),s=Fc.useRef(false);return Fc.useEffect(()=>{R(null,null,function*(){s.current||o(true);try{let c=yield e();a(c),i(null),c!==null&&(s.current=!0);}catch(c){i(c),s.current=true;}finally{s.current?o(false):o(true);}});},[e]),{isLoading:t,error:n,data:r}}function $f(e){let t=D({optional:true}),o=t==null?void 0:t.stigg,n=Fc.useCallback(()=>o?o.getActiveSubscriptions(e):Promise.resolve([]),[e,o]),{data:i,error:r,isLoading:a}=Ut({func:n});return Fc.useMemo(()=>({activeSubscriptions:i,isLoading:a,error:r}),[i,r,a])}function Hf(e){let t=D({optional:true}),o=t==null?void 0:t.stigg,n=Fc.useCallback(()=>o?o.getPaywall(e):Promise.resolve(null),[e,o]),{data:i,error:r,isLoading:a}=Ut({func:n});return Fc.useMemo(()=>({paywall:i,isLoading:a,error:r}),[i,r,a])}function Wf(e){let t=D({optional:true}),o=t==null?void 0:t.stigg,n=Fc.useCallback(()=>o?o.getCustomerPortal(e):Promise.resolve(null),[e,o]),{data:i,error:r,isLoading:a}=Ut({func:n});return Fc.useMemo(()=>({customerPortal:i,isLoading:a,error:r}),[i,r,a])}function Aa(){let e=An(),[{resourceId:t}]=j(),{checkoutState:o}=Y(),{plan:n}=o||{},i=e.addons.map(({addon:r,quantity:a})=>({addonId:r.id,quantity:a}));if(n!=null&&n.id)return S({resourceId:t,planId:n.id,billingPeriod:e.billingPeriod,billableFeatures:e.billableFeatures,addons:i,promotionCode:e.promotionCode,billingCountryCode:e.billingCountryCode},fa({taxIds:e.taxId?[e.taxId]:void 0}))}var u3=[ah.PaymentCollection.Failed,ah.PaymentCollection.Processing];function p3(t){return R(this,arguments,function*({elements:e}){if(!e){let n="Stripe elements not initialized";return console.error(n),{success:false,errorMessage:n}}let{error:o}=yield e.submit();return o?(console.log(o.message),{success:false,errorMessage:o.message||""}):{success:true}})}function jc(o){return R(this,arguments,function*({applySubscriptionResults:e,stripe:t}){var a,s;let n=e==null?void 0:e.subscription,i=(a=n==null?void 0:n.latestInvoice)==null?void 0:a.paymentSecret,r=n==null?void 0:n.paymentCollection;if(t&&i&&r===ah.PaymentCollection.ActionRequired){let{error:l}=yield t.handleNextAction({clientSecret:i});if(l)return {errorMessage:l.message||""}}else if(r&&u3.includes(r))return {errorMessage:((s=n==null?void 0:n.latestInvoice)==null?void 0:s.errorMessage)||"An error occurred - try again later"};return {subscription:n}})}function m3(n){return R(this,arguments,function*({stripe:e,elements:t,clientSecret:o}){let i,r,{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"&&(r=a.message||""):r="An unexpected error occurred.";else try{let{setupIntent:s}=yield e.retrieveSetupIntent(o);s!=null&&s.payment_method&&(i=s.payment_method);}catch(s){r="An unexpected error occurred.",console.error(s);}return {newPaymentMethodId:i,setupErrorMessage:r}})}function Gf(n){return R(this,arguments,function*({stripe:e,elements:t,setupIntentClientSecret:o}){if(!e||!t||!o)return {success:false};let i=yield p3({elements:t});if(!i.success)return {success:false,errorMessage:i.errorMessage};let{newPaymentMethodId:r,setupErrorMessage:a}=yield m3({stripe:e,elements:t,clientSecret:o});return a||!r?{success:false,errorMessage:a}:{success:true,paymentMethodId:r}})}var jf={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 Ma=5e3,b3=y(Ua__default.default)`
586
+ `,_c=({disabled:e,checkoutLocalization:t,onMockCheckoutPreview:o})=>{let{promotionCode:r,setPromotionCode:n}=Bt();return jsxRuntime.jsx(kh,{children:r?jsxRuntime.jsx(Uc,{promotionCode:r,onClearPromotionCode:()=>{n("");}}):jsxRuntime.jsx(Nc,{disabled:e,checkoutLocalization:t,onMockCheckoutPreview:o})})};var Dc=({label:e,checked:t,onChange:o,onClick:r,value:n,disabled:i,dataTestId:s})=>jsxRuntime.jsx(Bh__default.default,{onClick:r,value:n,control:jsxRuntime.jsx(wh__default.default,{checked:t,onChange:o,disabled:i,"data-testid":s}),label:Ah__default.default(e)?jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.f,{variant:"body1",lineHeight:"20px",color:"secondary",children:e}):e});var pi=[{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"}],ux="United States",gx=" # ",mr="us_ein",ur=(e,t)=>`${e}${gx}${t}`,mi=new Map(pi.map(e=>[ur(e.taxIdType,e.country),e])),It=e=>mi.get(e),gr=ur(mr,ux);var ui=chunkMY4ZIUAV_cjs_js.e(ce)(()=>({"& .MuiOutlinedInput-root":{borderRadius:"5px",padding:"12px",fieldset:{borderColor:"#e6e6e6"}},"& .MuiInputBase-input":{borderRadius:"5px",fontSize:"16px",padding:"0 0"}}));var xx=chunkMY4ZIUAV_cjs_js.e(fx__default.default)(()=>({"& .MuiAutocomplete-input":{padding:"0 !important"}})),fr=chunkMY4ZIUAV_cjs_js.e(chunkMY4ZIUAV_cjs_js.f)({});fr.defaultProps={variant:"body1",color:"secondary"};function rd(){let[e,t]=ii.useState(false),{billingAddress:o,taxId:r,setTaxId:n}=re(),[i,s]=ii.useState(gr),[l,a]=ii.useState(false),c=ii.useCallback((g,y,C)=>{n({type:y,value:C}),s(g);},[n,s]);ii.useEffect(()=>{a(false);},[o==null?void 0:o.country]),ii.useEffect(()=>{if(!(o!=null&&o.country)||l||!e)return;let g=pi.find(y=>y.countryCode===o.country);g&&c(ur(g.taxIdType,g.country),g.taxIdType,"");},[o,e,l,c]);let u=g=>{if(!g)return;let y=It(g);if(y){if(a(true),r!=null&&r.value){c(g,y.taxIdType,r.value);return}s(g),r!=null&&r.type&&n(void 0);}},f=ii.useMemo(()=>Array.from(mi.keys()),[]),p=ii.useMemo(()=>f.find(g=>g===i)||null,[f,i]),h=ii.useMemo(()=>{let g=It(i);return (g==null?void 0:g.example)||"Add your VAT/GST or local tax ID."},[i]);return ii.useEffect(()=>(e||(a(false),c(gr,mr,"")),()=>{c(gr,mr,"");}),[e,c]),jsxRuntime.jsxs(Me__default.default,{flexDirection:"column",container:true,gap:2,children:[jsxRuntime.jsx(Me__default.default,{flexDirection:"row",container:true,gap:2,children:jsxRuntime.jsx(Dc,{checked:e,onChange:()=>t(g=>!g),label:jsxRuntime.jsx(fr,{children:"I'm purchasing as a business"})})}),jsxRuntime.jsx(yx__default.default,{in:e,children:jsxRuntime.jsxs(Me__default.default,{container:true,spacing:0,sx:{width:"100%"},children:[jsxRuntime.jsxs(Me__default.default,{item:true,xs:6,children:[jsxRuntime.jsx(fr,{children:"Tax ID Type"}),jsxRuntime.jsx(xx,{fullWidth:true,options:f,value:p,onChange:(g,y)=>u(y),renderInput:g=>jsxRuntime.jsx(ui,chunkMY4ZIUAV_cjs_js.b(chunkMY4ZIUAV_cjs_js.a({},g),{id:"id-type",InputProps:g.InputProps})),renderOption:(g,y)=>{let C=It(y);if(!C)return null;let{taxIdType:b,country:x,FlagComponent:S}=C;return ii.createElement(ou__default.default,chunkMY4ZIUAV_cjs_js.b(chunkMY4ZIUAV_cjs_js.a({},g),{key:y}),jsxRuntime.jsxs(chunkMY4ZIUAV_cjs_js.f,{variant:"body1",lineHeight:"20px",color:"secondary",children:[S&&jsxRuntime.jsx(S,{width:15,style:{marginRight:"5px",borderRadius:"8%"}}),td__default.default(x)," - ",od__default.default(b)]}))},getOptionLabel:g=>{let y=It(g);return y?`${td__default.default(y.country)} - ${od__default.default(y.taxIdType)}`:g},ListboxProps:{sx:{maxHeight:200}}})]}),jsxRuntime.jsxs(Me__default.default,{item:true,xs:6,paddingLeft:"12px",children:[jsxRuntime.jsx(fr,{children:"Tax ID"}),jsxRuntime.jsx(ui,{id:"tax-id-value",placeholder:h,type:"text",fullWidth:true,value:(r==null?void 0:r.value)||"",onChange:g=>{let y=It(i);y&&c(i,y.taxIdType,g.target.value);}})]})]})})]})}function nd({onBillingAddressChange:e,collectPhoneNumber:t,collectTaxId:o}){var g;let{checkoutState:r,checkoutLocalization:n,widgetState:i,setWidgetReadOnly:s}=U(),{setBillingAddress:l}=re(),{customer:a,configuration:c}=r||{},{readOnly:u}=i,f=!!(t!=null?t:(g=c==null?void 0:c.content)!=null&&g.collectPhoneNumber),p=ii.useMemo(()=>o&&!(a!=null&&a.billingId)&&!(a!=null&&a.paymentMethodDetails),[o,a==null?void 0:a.billingId,a==null?void 0:a.paymentMethodDetails]),h=y=>{if(!y.complete)return;let S=y.value.address,{postal_code:C}=S,b=chunkMY4ZIUAV_cjs_js.c(S,["postal_code"]),x=chunkMY4ZIUAV_cjs_js.a({postalCode:C},b);s(true),l(x),e?chunkMY4ZIUAV_cjs_js.d(null,null,function*(){yield e({billingAddress:x}),s(false);}):s(false);};return jsxRuntime.jsxs(Me__default.default,{flexDirection:"column",container:true,gap:3,padding:"16px",sx:{pointerEvents:u?"none":void 0},children:[jsxRuntime.jsxs(Me__default.default,{flexDirection:"column",container:true,gap:2,children:[jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.f,{variant:"h6",children:n.newPaymentMethodBillingAddressTitle}),jsxRuntime.jsx(reactStripeJs.AddressElement,{onChange:h,options:{mode:"billing",fields:{phone:f?"always":"auto"},defaultValues:chunkMY4ZIUAV_cjs_js.a({},(a==null?void 0:a.name)&&{name:a.name})}})]}),jsxRuntime.jsxs(Me__default.default,{flexDirection:"column",container:true,gap:2,children:[jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.f,{variant:"h6",children:n.newPaymentMethodCardTitle}),jsxRuntime.jsx(reactStripeJs.PaymentElement,{onChange:()=>{},onReady:()=>{},options:{readOnly:u,terms:{card:"never"},defaultValues:{billingDetails:chunkMY4ZIUAV_cjs_js.a(chunkMY4ZIUAV_cjs_js.a({},(a==null?void 0:a.name)&&{name:a.name}),(a==null?void 0:a.email)&&{email:a.email})}}})]}),p&&jsxRuntime.jsx(rd,{})]})}function id(){let[e,t]=ii.useState(null),{checkoutState:o}=U(),{billingIntegration:r,setupSecret:n}=o||{};return ii.useEffect(()=>{if(r){let{billingIdentifier:i,credentials:s}=r;if(i!==jsClientSdk.BillingVendorIdentifier.Stripe)return;let{accountId:l,publicKey:a}=s;if(!l||!a){console.error("Stripe account ID or public key is missing");return}import('@stripe/stripe-js').then(({loadStripe:c})=>{t(c(a,{stripeAccount:l}));});}},[r]),{stripePromise:e,setupIntentClientSecret:n}}function yr(){let e=wt(),[{resourceId:t}]=R(),{checkoutState:o}=U(),{plan:r}=o||{},n=e.addons.map(({addon:i,quantity:s})=>({addonId:i.id,quantity:s}));if(r!=null&&r.id)return chunkMY4ZIUAV_cjs_js.a({resourceId:t,planId:r.id,billingPeriod:e.billingPeriod,billableFeatures:e.billableFeatures,addons:n,promotionCode:e.promotionCode,billingCountryCode:e.billingCountryCode},lr({taxIds:e.taxId?[e.taxId]:void 0}))}var Ax=[jsClientSdk.PaymentCollection.Failed,jsClientSdk.PaymentCollection.Processing];function Ix(t){return chunkMY4ZIUAV_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 Pi(o){return chunkMY4ZIUAV_cjs_js.d(this,arguments,function*({applySubscriptionResults:e,stripe:t}){var s,l;let r=e==null?void 0:e.subscription,n=(s=r==null?void 0:r.latestInvoice)==null?void 0:s.paymentSecret,i=r==null?void 0:r.paymentCollection;if(t&&n&&i===jsClientSdk.PaymentCollection.ActionRequired){let{error:a}=yield t.handleNextAction({clientSecret:n});if(a)return {errorMessage:a.message||""}}else if(i&&Ax.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 Fx(r){return chunkMY4ZIUAV_cjs_js.d(this,arguments,function*({stripe:e,elements:t,clientSecret:o}){let n,i,{error:s}=yield e.confirmSetup({elements:t,confirmParams:{return_url:window.location.href},redirect:"if_required"});if(s)s.type==="card_error"||s.type==="validation_error"?s.type==="card_error"&&(i=s.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 ad(r){return chunkMY4ZIUAV_cjs_js.d(this,arguments,function*({stripe:e,elements:t,setupIntentClientSecret:o}){if(!e||!t||!o)return {success:false};let n=yield Ix({elements:t});if(!n.success)return {success:false,errorMessage:n.errorMessage};let{newPaymentMethodId:i,setupErrorMessage:s}=yield Fx({stripe:e,elements:t,clientSecret:o});return s||!i?{success:false,errorMessage:s}:{success:true,paymentMethodId:i}})}var sd={v:"5.12.1",fr:30,ip:0,op:201,w:700,h:700,nm:"Check",ddd:0,assets:[],layers:[{ddd:0,ind:1,ty:4,nm:"Shape Layer 8",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:315,ix:10},p:{a:0,k:[350,350,0],ix:2,l:2},a:{a:0,k:[-304,91,0],ix:1,l:2},s:{a:0,k:[100,100,100],ix:6,l:2}},ao:0,shapes:[{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[0,0],[0,0]],o:[[0,0],[0,0]],v:[[-304,-241],[-304,-161]],c:false},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:false},{ty:"st",c:{a:0,k:[1,1,1,1],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:9,ix:5},lc:2,lj:1,ml:4,bm:0,nm:"Stroke 1",mn:"ADBE Vector Graphic - Stroke",hd:false},{ty:"tr",p:{a:0,k:[0,0],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Transform"}],nm:"Shape 1",np:3,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:false},{ty:"tm",s:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:135,s:[100]},{t:145.5,s:[0]}],ix:1},e:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:130,s:[100]},{t:139.6005859375,s:[0]}],ix:2},o:{a:0,k:0,ix:3},m:1,ix:2,nm:"Trim Paths 1",mn:"ADBE Vector Filter - Trim",hd:false}],ip:130,op:204,st:-2,ct:1,bm:0},{ddd:0,ind:2,ty:4,nm:"Shape Layer 7",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:270,ix:10},p:{a:0,k:[350,350,0],ix:2,l:2},a:{a:0,k:[-304,91,0],ix:1,l:2},s:{a:0,k:[100,100,100],ix:6,l:2}},ao:0,shapes:[{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[0,0],[0,0]],o:[[0,0],[0,0]],v:[[-304,-241],[-304,-161]],c:false},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:false},{ty:"st",c:{a:0,k:[1,1,1,1],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:9,ix:5},lc:2,lj:1,ml:4,bm:0,nm:"Stroke 1",mn:"ADBE Vector Graphic - Stroke",hd:false},{ty:"tr",p:{a:0,k:[0,0],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Transform"}],nm:"Shape 1",np:3,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:false},{ty:"tm",s:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:135,s:[100]},{t:145.5,s:[0]}],ix:1},e:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:130,s:[100]},{t:139.6005859375,s:[0]}],ix:2},o:{a:0,k:0,ix:3},m:1,ix:2,nm:"Trim Paths 1",mn:"ADBE Vector Filter - Trim",hd:false}],ip:130,op:204,st:-2,ct:1,bm:0},{ddd:0,ind:3,ty:4,nm:"Shape Layer 6",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:225,ix:10},p:{a:0,k:[350,350,0],ix:2,l:2},a:{a:0,k:[-304,91,0],ix:1,l:2},s:{a:0,k:[100,100,100],ix:6,l:2}},ao:0,shapes:[{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[0,0],[0,0]],o:[[0,0],[0,0]],v:[[-304,-241],[-304,-161]],c:false},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:false},{ty:"st",c:{a:0,k:[1,1,1,1],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:9,ix:5},lc:2,lj:1,ml:4,bm:0,nm:"Stroke 1",mn:"ADBE Vector Graphic - Stroke",hd:false},{ty:"tr",p:{a:0,k:[0,0],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Transform"}],nm:"Shape 1",np:3,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:false},{ty:"tm",s:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:135,s:[100]},{t:145.5,s:[0]}],ix:1},e:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:130,s:[100]},{t:139.6005859375,s:[0]}],ix:2},o:{a:0,k:0,ix:3},m:1,ix:2,nm:"Trim Paths 1",mn:"ADBE Vector Filter - Trim",hd:false}],ip:130,op:204,st:-2,ct:1,bm:0},{ddd:0,ind:4,ty:4,nm:"Shape Layer 5",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:180,ix:10},p:{a:0,k:[350,350,0],ix:2,l:2},a:{a:0,k:[-304,91,0],ix:1,l:2},s:{a:0,k:[100,100,100],ix:6,l:2}},ao:0,shapes:[{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[0,0],[0,0]],o:[[0,0],[0,0]],v:[[-304,-241],[-304,-161]],c:false},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:false},{ty:"st",c:{a:0,k:[1,1,1,1],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:9,ix:5},lc:2,lj:1,ml:4,bm:0,nm:"Stroke 1",mn:"ADBE Vector Graphic - Stroke",hd:false},{ty:"tr",p:{a:0,k:[0,0],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Transform"}],nm:"Shape 1",np:3,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:false},{ty:"tm",s:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:135,s:[100]},{t:145.5,s:[0]}],ix:1},e:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:130,s:[100]},{t:139.6005859375,s:[0]}],ix:2},o:{a:0,k:0,ix:3},m:1,ix:2,nm:"Trim Paths 1",mn:"ADBE Vector Filter - Trim",hd:false}],ip:130,op:204,st:-2,ct:1,bm:0},{ddd:0,ind:5,ty:4,nm:"Shape Layer 4",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:135,ix:10},p:{a:0,k:[350,350,0],ix:2,l:2},a:{a:0,k:[-304,91,0],ix:1,l:2},s:{a:0,k:[100,100,100],ix:6,l:2}},ao:0,shapes:[{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[0,0],[0,0]],o:[[0,0],[0,0]],v:[[-304,-241],[-304,-161]],c:false},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:false},{ty:"st",c:{a:0,k:[1,1,1,1],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:9,ix:5},lc:2,lj:1,ml:4,bm:0,nm:"Stroke 1",mn:"ADBE Vector Graphic - Stroke",hd:false},{ty:"tr",p:{a:0,k:[0,0],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Transform"}],nm:"Shape 1",np:3,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:false},{ty:"tm",s:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:135,s:[100]},{t:145.5,s:[0]}],ix:1},e:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:130,s:[100]},{t:139.6005859375,s:[0]}],ix:2},o:{a:0,k:0,ix:3},m:1,ix:2,nm:"Trim Paths 1",mn:"ADBE Vector Filter - Trim",hd:false}],ip:130,op:204,st:-2,ct:1,bm:0},{ddd:0,ind:6,ty:4,nm:"Shape Layer 3",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:90,ix:10},p:{a:0,k:[350,350,0],ix:2,l:2},a:{a:0,k:[-304,91,0],ix:1,l:2},s:{a:0,k:[100,100,100],ix:6,l:2}},ao:0,shapes:[{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[0,0],[0,0]],o:[[0,0],[0,0]],v:[[-304,-241],[-304,-161]],c:false},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:false},{ty:"st",c:{a:0,k:[1,1,1,1],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:9,ix:5},lc:2,lj:1,ml:4,bm:0,nm:"Stroke 1",mn:"ADBE Vector Graphic - Stroke",hd:false},{ty:"tr",p:{a:0,k:[0,0],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Transform"}],nm:"Shape 1",np:3,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:false},{ty:"tm",s:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:135,s:[100]},{t:145.5,s:[0]}],ix:1},e:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:130,s:[100]},{t:139.6005859375,s:[0]}],ix:2},o:{a:0,k:0,ix:3},m:1,ix:2,nm:"Trim Paths 1",mn:"ADBE Vector Filter - Trim",hd:false}],ip:130,op:204,st:-2,ct:1,bm:0},{ddd:0,ind:7,ty:4,nm:"Shape Layer 2",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:45,ix:10},p:{a:0,k:[350,350,0],ix:2,l:2},a:{a:0,k:[-304,91,0],ix:1,l:2},s:{a:0,k:[100,100,100],ix:6,l:2}},ao:0,shapes:[{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[0,0],[0,0]],o:[[0,0],[0,0]],v:[[-304,-241],[-304,-161]],c:false},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:false},{ty:"st",c:{a:0,k:[1,1,1,1],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:9,ix:5},lc:2,lj:1,ml:4,bm:0,nm:"Stroke 1",mn:"ADBE Vector Graphic - Stroke",hd:false},{ty:"tr",p:{a:0,k:[0,0],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Transform"}],nm:"Shape 1",np:3,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:false},{ty:"tm",s:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:135,s:[100]},{t:145.5,s:[0]}],ix:1},e:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:130,s:[100]},{t:139.6005859375,s:[0]}],ix:2},o:{a:0,k:0,ix:3},m:1,ix:2,nm:"Trim Paths 1",mn:"ADBE Vector Filter - Trim",hd:false}],ip:130,op:204,st:-2,ct:1,bm:0},{ddd:0,ind:8,ty:4,nm:"Shape Layer 1",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:0,ix:10},p:{a:0,k:[350,350,0],ix:2,l:2},a:{a:0,k:[-304,91,0],ix:1,l:2},s:{a:0,k:[100,100,100],ix:6,l:2}},ao:0,shapes:[{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[0,0],[0,0]],o:[[0,0],[0,0]],v:[[-304,-241],[-304,-161]],c:false},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:false},{ty:"st",c:{a:0,k:[1,1,1,1],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:9,ix:5},lc:2,lj:1,ml:4,bm:0,nm:"Stroke 1",mn:"ADBE Vector Graphic - Stroke",hd:false},{ty:"tr",p:{a:0,k:[0,0],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Transform"}],nm:"Shape 1",np:3,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:false},{ty:"tm",s:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:135,s:[100]},{t:145.5,s:[0]}],ix:1},e:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:130,s:[100]},{t:139.6005859375,s:[0]}],ix:2},o:{a:0,k:0,ix:3},m:1,ix:2,nm:"Trim Paths 1",mn:"ADBE Vector Filter - Trim",hd:false}],ip:130,op:204,st:-2,ct:1,bm:0},{ddd:0,ind:9,ty:4,nm:"Check v",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:-1.9,ix:10},p:{a:0,k:[352,360,0],ix:2,l:2},a:{a:0,k:[-120.265,116.765,0],ix:1,l:2},s:{a:0,k:[278,278,100],ix:6,l:2}},ao:0,shapes:[{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0]],v:[[-161,123],[-137,148],[-79.531,85.531]],c:false},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:false},{ty:"st",c:{a:0,k:[1,1,1,1],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:5.5,ix:5},lc:2,lj:2,bm:0,nm:"Stroke 1",mn:"ADBE Vector Graphic - Stroke",hd:false},{ty:"tr",p:{a:0,k:[0,0],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Transform"}],nm:"Shape 1",np:3,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:false},{ty:"tm",s:{a:1,k:[{i:{x:[0],y:[1]},o:{x:[.333],y:[0]},t:135,s:[0]},{t:148,s:[100]}],ix:1},e:{a:0,k:0,ix:2},o:{a:0,k:0,ix:3},m:1,ix:2,nm:"Trim Paths 1",mn:"ADBE Vector Filter - Trim",hd:false}],ip:135,op:201,st:-35,ct:1,bm:0},{ddd:0,ind:11,ty:4,nm:"Circle Stroke",sr:1,ks:{o:{a:1,k:[{i:{x:[.833],y:[.833]},o:{x:[.167],y:[.167]},t:0,s:[0]},{t:7,s:[100]}],ix:11},r:{a:0,k:0,ix:10},p:{a:0,k:[350,350,0],ix:2,l:2},a:{a:0,k:[4,-6,0],ix:1,l:2},s:{a:0,k:[132,132,100],ix:6,l:2}},ao:0,shapes:[{ty:"gr",it:[{d:1,ty:"el",s:{a:0,k:[306,306],ix:2},p:{a:0,k:[0,0],ix:3},nm:"Ellipse Path 1",mn:"ADBE Vector Shape - Ellipse",hd:false},{ty:"st",c:{a:1,k:[{i:{x:[.833],y:[.833]},o:{x:[.167],y:[.167]},t:0,s:[1,1,1,1]},{i:{x:[.833],y:[.833]},o:{x:[.167],y:[.167]},t:30,s:[1,1,1,1]},{i:{x:[.833],y:[.833]},o:{x:[.167],y:[.167]},t:61,s:[1,1,1,1]},{i:{x:[.833],y:[.833]},o:{x:[.167],y:[.167]},t:87,s:[1,1,1,1]},{t:136,s:[1,1,1,1]}],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:8,ix:5},lc:2,lj:1,ml:4,bm:0,nm:"Stroke 1",mn:"ADBE Vector Graphic - Stroke",hd:false},{ty:"tr",p:{a:0,k:[4,-6],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Transform"}],nm:"Ellipse 1",np:3,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:false},{ty:"tm",s:{a:1,k:[{i:{x:[.338],y:[1]},o:{x:[.333],y:[0]},t:87,s:[50]},{t:122,s:[100]}],ix:1},e:{a:1,k:[{i:{x:[.338],y:[1]},o:{x:[.333],y:[0]},t:87,s:[45]},{t:122,s:[0]}],ix:2},o:{a:1,k:[{i:{x:[.474],y:[1]},o:{x:[.43],y:[0]},t:0,s:[-170.4]},{t:111,s:[-1250.4]}],ix:3},m:1,ix:2,nm:"Trim Paths 1",mn:"ADBE Vector Filter - Trim",hd:false}],ip:0,op:201,st:0,ct:1,bm:0},{ddd:0,ind:13,ty:1,nm:"Dark Gray Solid 1",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:0,ix:10},p:{a:0,k:[350,350,0],ix:2,l:2},a:{a:0,k:[350,350,0],ix:1,l:2},s:{a:0,k:[100,100,100],ix:6,l:2}},ao:0,sw:700,sh:700,sc:"#2d2d2d",ip:0,op:201,st:0,bm:0}],markers:[],props:{}};var Ux=ii.lazy(()=>import('react-lottie')),hr=5e3,_x=chunkMY4ZIUAV_cjs_js.e(ke__default.default)`
716
587
  @keyframes blurFade {
717
588
  0% {
718
- background-color: ${({theme:e})=>Do__default.default(e.stigg.palette.backgroundPaper).alpha(0).toString()};
589
+ background-color: ${({theme:e})=>bi__default.default(e.stigg.palette.backgroundPaper).alpha(0).toString()};
719
590
  backdrop-filter: blur(0px);
720
591
  }
721
592
  100% {
722
- background-color: ${({theme:e})=>Do__default.default(e.stigg.palette.backgroundPaper).alpha(.9).toString()};
593
+ background-color: ${({theme:e})=>bi__default.default(e.stigg.palette.backgroundPaper).alpha(.9).toString()};
723
594
  backdrop-filter: blur(6.5px);
724
595
  }
725
596
  }
@@ -730,7 +601,7 @@
730
601
  bottom: 0;
731
602
  right: 0;
732
603
  z-index: 5;
733
- background-color: ${({theme:e})=>Do__default.default(e.stigg.palette.backgroundPaper).alpha(.9).toString()};
604
+ background-color: ${({theme:e})=>bi__default.default(e.stigg.palette.backgroundPaper).alpha(.9).toString()};
734
605
  animation: blurFade 2s ease-in forwards;
735
606
  display: flex;
736
607
  flex-direction: column;
@@ -743,7 +614,7 @@
743
614
  & path {
744
615
  stroke: ${({theme:e})=>e.stigg.palette.primary};
745
616
  }
746
- `,C3=y(P)`
617
+ `,Dx=chunkMY4ZIUAV_cjs_js.e(chunkMY4ZIUAV_cjs_js.f)`
747
618
  @keyframes fadeIn {
748
619
  0% {
749
620
  opacity: 0;
@@ -758,56 +629,56 @@
758
629
 
759
630
  align-self: center;
760
631
  animation: fadeIn 5s ease-in forwards;
761
- `;function Zf({checkoutLocalization:e}){let t=Fc.useRef();return Fc.useEffect(()=>{t.current&&t.current.scrollIntoView({behavior:"smooth",block:"center",inline:"center"});},[]),jsxRuntime.jsxs(b3,{className:"stigg-checkout-success-container",ref:t,children:[jsxRuntime.jsx(x3__default.default,{options:{animationData:jf,loop:false,autoplay:true},width:350,height:"auto",style:{display:"flex",justifyContent:"center"}}),jsxRuntime.jsx(C3,{variant:"h1",color:"primary.main",children:e.summary.checkoutSuccessText})]})}var k3=e=>new Promise(t=>setTimeout(t,e));function Xf({isMocked:e=false,onCheckout:t,onCheckoutCompleted:o,onSuccess:n,disableSuccessAnimation:i}){let{stigg:r}=D(),{useNewPaymentMethod:a}=vt(),s=Aa(),{checkoutState:l,widgetState:c,setWidgetReadOnly:d}=Y(),{setupSecret:u,customer:p}=l||{},h=reactStripeJs.useStripe(),m=reactStripeJs.useElements();return {handleSubmit:f=>R(null,null,function*(){if(f.preventDefault(),!s)return {success:false,errorMessage:"Unexpected error, please contact support."};let x=true,b,T=false,k;if(d(true),!e&&a){let M=yield Gf({elements:m,stripe:h,setupIntentClientSecret:u});M.success?k=M.paymentMethodId:(b=M.errorMessage,x=false);}let w=A(S({},s),{paymentMethodId:k}),v=M=>R(null,null,function*(){T=true;try{let I=yield r.applySubscription(M),F=yield jc({applySubscriptionResults:I,stripe:h});return {success:!F.errorMessage,errorMessage:F.errorMessage,results:I}}catch(I){return console.error(I),b=I==null?void 0:I.message,{success:false,errorMessage:b}}}),_;if(x)if(t){let M=yield t({customerId:p.id,checkoutParams:w,checkoutAction:v});if(M.errorMessage&&(b=M.errorMessage),!T&&M.results&&M.success){let I=yield jc({applySubscriptionResults:M.results,stripe:h});I.errorMessage&&(b=I.errorMessage,x=false);}x=x&&M.success&&!b,_=M.results;}else {let M=yield v(w);!M.success&&M.errorMessage&&(b=M.errorMessage),x=M.success&&!b,_=M.results;}return d(false),x&&n&&(n(),i||(yield k3(Ma))),yield o({success:x,error:b}),{results:_,success:!b,errorMessage:b}}),isLoading:!!(c!=null&&c.readOnly)}}function Kf(){return !!window.Zuora}function qf(){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 Qf(e,t,o,n){return {locale:n||"en",region:(n==null?void 0:n.toUpperCase())||"US",currency:o,amount:"1",createPaymentSession:e,onComplete:t}}function En(){let{stigg:e}=D(),{setErrorMessage:t}=vt(),{billingCountryCode:o}=te(),[n,i]=Fc.useState(false),{checkoutState:r}=Y(),{billingIntegration:a}=r||{},s=Fc.useCallback(()=>R(null,null,function*(){if(!(r!=null&&r.customer.id)||!(r!=null&&r.plan.id))throw new Error("Customer and plan are required");let{token:d}=yield e.createPaymentSession({planId:r.plan.id,billingCountryCode:o});return d}),[r,e,o]),l=Fc.useCallback(()=>{try{Kf()||qf(),i(!0);}catch(d){t("Failed to initialize Zuora");}},[i,t]);return Fc.useEffect(()=>{if(a){let{billingIdentifier:d}=a;d===ah.BillingVendorIdentifier.Zuora&&l();}},[a,l]),{isZuoraIntegration:(a==null?void 0:a.billingIdentifier)===ah.BillingVendorIdentifier.Zuora,isInitialized:n,createPaymentSession:s}}var A3=e=>new Promise(t=>setTimeout(t,e));function Ia({onCheckout:e,onCheckoutCompleted:t,onSuccess:o,disableSuccessAnimation:n}){let{stigg:i}=D(),r=Aa(),{checkoutState:a,setWidgetReadOnly:s,setCheckoutSuccess:l}=Y(),{setErrorMessage:c}=vt();return {handleZuoraSubmit:Fc.useCallback(u=>R(null,null,function*(){s(true);let p=true,h,m=r;if(!m)p=false,h="Unexpected error, please contact support.";else {let g=A(S({},m),{paymentMethodId:u}),f=x=>R(null,null,function*(){try{return {success:!0,results:yield i.applySubscription(x)}}catch(b){return console.error(b),{success:false,errorMessage:(b==null?void 0:b.message)||"Failed to apply subscription"}}});try{if(e){let x=yield e({customerId:a.customer.id,checkoutParams:g,checkoutAction:f});x.errorMessage&&(h=x.errorMessage),p=p&&x.success&&!h;}else {let x=yield f(g);!x.success&&x.errorMessage&&(h=x.errorMessage),p=x.success&&!h;}}catch(x){p=false,h=x.message||"Failed to process checkout";}}return p?(l(true),o&&(o(),n||(yield A3(Ma)))):c(h),s(false),yield t({success:p,error:h}),{success:p,errorMessage:h}}),[i,r,a,e,t,o,n,s,l,c])}}var pe=({isLoading:e,width:t=50,height:o=16,children:n})=>e?jsxRuntime.jsx(dt,{width:t,height:o}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:n});var E3=({subscriptionPreview:e,isFetchingSubscriptionPreview:t,checkoutLocalization:o})=>{var a,s,l,c;let{immediateInvoice:n}=e||{};if(!((s=(a=n==null?void 0:n.proration)==null?void 0:a.netAmount)!=null&&s.amount)||((c=(l=n==null?void 0:n.proration)==null?void 0:l.netAmount)==null?void 0:c.amount)>=0)return null;let i=n.proration.netAmount.amount*-1,r=at({amount:i,currency:n.proration.netAmount.currency,minimumFractionDigits:2});return jsxRuntime.jsx(P,{variant:"body1",style:{marginTop:14},className:"stigg-checkout-summary-captions-remaining-credits",children:jsxRuntime.jsx(pe,{isLoading:t,width:"100%",children:o.summary.creditsForUnusedTimeText({credits:r})})})},F3=({subscriptionPreview:e,activeSubscription:t,isFetchingSubscriptionPreview:o,checkoutLocalization:n})=>{if(!(e!=null&&e.hasScheduledUpdates)||!(t!=null&&t.currentBillingPeriodEnd))return null;let{currentBillingPeriodEnd:i}=t,r=typeof n.summary.changesWillApplyAtEndOfBillingPeriod=="function"?n.summary.changesWillApplyAtEndOfBillingPeriod({billingPeriodEnd:i}):n.summary.changesWillApplyAtEndOfBillingPeriod;return jsxRuntime.jsx(P,{variant:"body1",style:{marginTop:14},className:"stigg-checkout-summary-captions-scheduled-updates",children:jsxRuntime.jsx(pe,{isLoading:o,width:"100%",children:r})})},L3=({subscriptionPreview:e,activeSubscription:t,plan:o,isFetchingSubscriptionPreview:n,billingPeriod:i,checkoutLocalization:r})=>{let{promotionCode:a}=Mn();if(!e)return null;let s=r.nextBillingCaption({plan:o,subscriptionPreview:e,billingPeriod:i,activeSubscription:t,promotionCode:a});return jsxRuntime.jsx(P,{variant:"body1",style:{marginTop:14},className:"stigg-checkout-summary-captions-next-billing",children:jsxRuntime.jsx(pe,{isLoading:n,width:"100%",children:s})})};function oy(e){return jsxRuntime.jsxs(material.Box,{className:"stigg-checkout-summary-captions",children:[jsxRuntime.jsx(E3,S({},e)),jsxRuntime.jsx(F3,S({},e)),e.plan&&jsxRuntime.jsx(L3,S({},e))]})}function Zc({quantity:e,totalAmount:t,pricingModel:o,billingPeriod:n,currency:i,blockSize:r,priceAmount:a,availableBillingPeriods:s}){let l=s==null?void 0:s.has(ah.BillingPeriod.Monthly),c=o===ah.BillingModel.PerUnit,d=r||1,u=n===ah.BillingPeriod.Annually&&l,p=e&&(c||e>1)?`${ft(e)} ${d>1?"for":"x"} `:"",h=u?" x 12 months":"",m=(a||t/e)/(u?12:1),g=at({amount:m,currency:i,minimumFractionDigits:2}),f=at({amount:t,currency:i,minimumFractionDigits:2});return `${p}${g}${h} ${h||p?` = ${f}`:""}`}function iy(e){let{totalAmount:t,quantity:o,tiersMode:n,tiers:i,currency:r}=e;if(fm(i)||n===ah.TiersMode.Graduated&&!ym(i,o)){let a=at({amount:t,currency:r,minimumFractionDigits:2});return `${ft(o)} for ${a}`}return Zc(e)}function U3(e,t){let{unitPrice:o,upTo:n}=e[t];if(!o)return "";if(t===0)return `First ${n}`;let r=(e[t-1].upTo||0)+1;return Ar__default.default(n)?`${ft(r)} and above`:`Next ${ft(r)} to ${ft(n)}`}function ry({price:e,unitQuantity:t}){let o=e.tiers||[],{checkoutState:n}=Y(),i=n==null?void 0:n.plan,{breakdown:r}=El(o,t);return r.length===1?null:jsxRuntime.jsx(jsxRuntime.Fragment,{children:r.map(({unitQuantity:a,amount:s},l)=>jsxRuntime.jsx(ve,{children:jsxRuntime.jsxs(me,{style:{alignItems:"flex-start"},children:[jsxRuntime.jsx(P,{variant:"body1",color:"tertiary",style:{whiteSpace:"nowrap"},children:U3(o,l)}),jsxRuntime.jsx(P,{variant:"body1",color:"tertiary",style:{whiteSpace:"nowrap"},children:Zc({quantity:a,totalAmount:s,currency:e.currency,pricingModel:e.pricingModel,billingPeriod:e.billingPeriod,tiers:e.tiers,tiersMode:e.tiersMode,blockSize:e.blockSize,priceAmount:e.amount,availableBillingPeriods:new Set(i==null?void 0:i.pricePoints.map(c=>c.billingPeriod))})})]})},l))})}var ay=y(reactFeather.ChevronRight)`
632
+ `;function ld({checkoutLocalization:e}){let t=ii.useRef();return ii.useEffect(()=>{t.current&&t.current.scrollIntoView({behavior:"smooth",block:"center",inline:"center"});},[]),jsxRuntime.jsxs(_x,{className:"stigg-checkout-success-container",ref:t,children:[jsxRuntime.jsx(ii.Suspense,{fallback:null,children:jsxRuntime.jsx(Ux,{options:{animationData:sd,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 Vx=e=>new Promise(t=>setTimeout(t,e));function cd({isMocked:e=false,onCheckout:t,onCheckoutCompleted:o,onSuccess:r,disableSuccessAnimation:n}){let{stigg:i}=chunkMY4ZIUAV_cjs_js.u(),{useNewPaymentMethod:s}=re(),l=yr(),{checkoutState:a,widgetState:c,setWidgetReadOnly:u}=U(),{setupSecret:f,customer:p}=a||{},h=reactStripeJs.useStripe(),g=reactStripeJs.useElements();return {handleSubmit:C=>chunkMY4ZIUAV_cjs_js.d(null,null,function*(){if(C.preventDefault(),!l)return {success:false,errorMessage:"Unexpected error, please contact support."};let b=true,x,S=false,T;if(u(true),!e&&s){let k=yield ad({elements:g,stripe:h,setupIntentClientSecret:f});k.success?T=k.paymentMethodId:(x=k.errorMessage,b=false);}let F=chunkMY4ZIUAV_cjs_js.b(chunkMY4ZIUAV_cjs_js.a({},l),{paymentMethodId:T}),w=k=>chunkMY4ZIUAV_cjs_js.d(null,null,function*(){S=true;try{let L=yield i.applySubscription(k),E=yield Pi({applySubscriptionResults:L,stripe:h});return {success:!E.errorMessage,errorMessage:E.errorMessage,results:L}}catch(L){return console.error(L),x=L==null?void 0:L.message,{success:false,errorMessage:x}}}),I;if(b)if(t){let k=yield t({customerId:p.id,checkoutParams:F,checkoutAction:w});if(k.errorMessage&&(x=k.errorMessage),!S&&k.results&&k.success){let L=yield Pi({applySubscriptionResults:k.results,stripe:h});L.errorMessage&&(x=L.errorMessage,b=false);}b=b&&k.success&&!x,I=k.results;}else {let k=yield w(F);!k.success&&k.errorMessage&&(x=k.errorMessage),b=k.success&&!x,I=k.results;}return u(false),b&&r&&(r(),n||(yield Vx(hr))),yield o({success:b,error:x}),{results:I,success:!x,errorMessage:x}}),isLoading:!!(c!=null&&c.readOnly)}}function dd(){return !!window.Zuora}function pd(){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 md(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 Ft(){let{stigg:e}=chunkMY4ZIUAV_cjs_js.u(),{setErrorMessage:t}=re(),{billingCountryCode:o}=Pe(),[r,n]=ii.useState(false),{checkoutState:i}=U(),{billingIntegration:s}=i||{},l=ii.useCallback(()=>chunkMY4ZIUAV_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]),a=ii.useCallback(()=>{try{dd()||pd(),n(!0);}catch(u){t("Failed to initialize Zuora");}},[n,t]);return ii.useEffect(()=>{if(s){let{billingIdentifier:u}=s;u===jsClientSdk.BillingVendorIdentifier.Zuora&&a();}},[s,a]),{isZuoraIntegration:(s==null?void 0:s.billingIdentifier)===jsClientSdk.BillingVendorIdentifier.Zuora,isInitialized:r,createPaymentSession:l}}var Zx=e=>new Promise(t=>setTimeout(t,e));function Cr({onCheckout:e,onCheckoutCompleted:t,onSuccess:o,disableSuccessAnimation:r}){let{stigg:n}=chunkMY4ZIUAV_cjs_js.u(),i=yr(),{checkoutState:s,setWidgetReadOnly:l,setCheckoutSuccess:a}=U(),{setErrorMessage:c}=re();return {handleZuoraSubmit:ii.useCallback(f=>chunkMY4ZIUAV_cjs_js.d(null,null,function*(){l(true);let p=true,h,g=i;if(!g)p=false,h="Unexpected error, please contact support.";else {let y=chunkMY4ZIUAV_cjs_js.b(chunkMY4ZIUAV_cjs_js.a({},g),{paymentMethodId:f}),C=b=>chunkMY4ZIUAV_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:s.customer.id,checkoutParams:y,checkoutAction:C});b.errorMessage&&(h=b.errorMessage),p=p&&b.success&&!h;}else {let b=yield C(y);!b.success&&b.errorMessage&&(h=b.errorMessage),p=b.success&&!h;}}catch(b){p=false,h=b.message||"Failed to process checkout";}}return p?(a(true),o&&(o(),r||(yield Zx(hr)))):c(h),l(false),yield t({success:p,error:h}),{success:p,errorMessage:h}}),[n,i,s,e,t,o,r,l,a,c])}}var Ie=({isLoading:e,width:t=50,height:o=16,children:r})=>e?jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.o,{width:t,height:o}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:r});var Kx=({subscriptionPreview:e,isFetchingSubscriptionPreview:t,checkoutLocalization:o})=>{var s,l,a,c;let{immediateInvoice:r}=e||{};if(!((l=(s=r==null?void 0:r.proration)==null?void 0:s.netAmount)!=null&&l.amount)||((c=(a=r==null?void 0:r.proration)==null?void 0:a.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(chunkMY4ZIUAV_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})})})},qx=({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(chunkMY4ZIUAV_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})})},Jx=({subscriptionPreview:e,activeSubscription:t,plan:o,isFetchingSubscriptionPreview:r,billingPeriod:n,checkoutLocalization:i})=>{let{promotionCode:s}=Bt();if(!e)return null;let l=i.nextBillingCaption({plan:o,subscriptionPreview:e,billingPeriod:n,activeSubscription:t,promotionCode:s});return jsxRuntime.jsx(chunkMY4ZIUAV_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 yd(e){return jsxRuntime.jsxs(ke__default.default,{className:"stigg-checkout-summary-captions",children:[jsxRuntime.jsx(Kx,chunkMY4ZIUAV_cjs_js.a({},e)),jsxRuntime.jsx(qx,chunkMY4ZIUAV_cjs_js.a({},e)),e.plan&&jsxRuntime.jsx(Jx,chunkMY4ZIUAV_cjs_js.a({},e))]})}function Ti({quantity:e,totalAmount:t,pricingModel:o,billingPeriod:r,currency:n,blockSize:i,priceAmount:s,availableBillingPeriods:l}){let a=l==null?void 0:l.has(jsClientSdk.BillingPeriod.Monthly),c=o===jsClientSdk.BillingModel.PerUnit,u=i||1,f=r===jsClientSdk.BillingPeriod.Annually&&a,p=e&&(c||e>1)?`${chunkMY4ZIUAV_cjs_js.k(e)} ${u>1?"for":"x"} `:"",h=f?" x 12 months":"",g=(s||t/e)/(f?12:1),y=H({amount:g,currency:n,minimumFractionDigits:2}),C=H({amount:t,currency:n,minimumFractionDigits:2});return `${p}${y}${h} ${h||p?` = ${C}`:""}`}function Cd(e){let{totalAmount:t,quantity:o,tiersMode:r,tiers:n,currency:i}=e;if(Ea(n)||r===jsClientSdk.TiersMode.Graduated&&!La(n,o)){let s=H({amount:t,currency:i,minimumFractionDigits:2});return `${chunkMY4ZIUAV_cjs_js.k(o)} for ${s}`}return Ti(e)}function oP(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 Po__default.default(r)?`${chunkMY4ZIUAV_cjs_js.k(i)} and above`:`Next ${chunkMY4ZIUAV_cjs_js.k(i)} to ${chunkMY4ZIUAV_cjs_js.k(r)}`}function xd({price:e,unitQuantity:t}){let o=e.tiers||[],{checkoutState:r}=U(),n=r==null?void 0:r.plan,{breakdown:i}=cn(o,t);return i.length===1?null:jsxRuntime.jsx(jsxRuntime.Fragment,{children:i.map(({unitQuantity:s,amount:l},a)=>jsxRuntime.jsx(De,{children:jsxRuntime.jsxs(Fe,{style:{alignItems:"flex-start"},children:[jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.f,{variant:"body1",color:"tertiary",style:{whiteSpace:"nowrap"},children:oP(o,a)}),jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.f,{variant:"body1",color:"tertiary",style:{whiteSpace:"nowrap"},children:Ti({quantity:s,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))})})]})},a))})}var Pd=chunkMY4ZIUAV_cjs_js.e(reactFeather.ChevronRight)`
762
633
  height: ${({$size:e=24})=>`${e}px`};
763
634
  width: ${({$size:e=24})=>`${e}px`};
764
635
  transition: all 0.2s ease-in;
765
636
  ${({$isOpen:e})=>e&&"transform: rotate(90deg)"}
766
- `;var ve=y.div`
637
+ `;var De=chunkMY4ZIUAV_cjs_js.e.div`
767
638
  & + & {
768
639
  margin-top: 16px;
769
640
  }
770
- `,K3=y.div`
641
+ `,gP=chunkMY4ZIUAV_cjs_js.e.div`
771
642
  margin-top: 16px;
772
643
  margin-left: 16px;
773
- `,me=y.div`
644
+ `,Fe=chunkMY4ZIUAV_cjs_js.e.div`
774
645
  display: flex;
775
646
  flex-direction: column;
776
647
  gap: 16px;
777
648
 
778
- ${wt.lg} {
649
+ ${oe.lg} {
779
650
  flex-direction: row;
780
651
  align-items: center;
781
652
  justify-content: space-between;
782
653
  }
783
- `,q3=({checkoutLocalization:e})=>{let t=jsxRuntime.jsx(P,{variant:"body1",children:e.summary.payAsYouGoTooltipText});return jsxRuntime.jsx(Be,{placement:"left",title:t,children:jsxRuntime.jsx(mt,{icon:"PayAsYouGoCharge",style:{display:"flex"}})})},La=({checkoutLocalization:e,label:t,quantity:o,price:n})=>{let{checkoutState:i}=Y(),r=i==null?void 0:i.plan,a=Dt("lg"),[s,l]=Fc.useState(false),c=()=>l(g=>!g),d=n.pricingModel===ah.BillingModel.UsageBased,u=n.isTieredPrice?Cn(n,o):(n.amount||0)*Math.ceil(o/(n.blockSize||1)),p;n.tiersMode===ah.TiersMode.Graduated&&!!n.tiers&&!NS__default.default(n.tiers)&&!Ar__default.default(n.tiers[0].upTo)&&o>n.tiers[0].upTo&&(p=jsxRuntime.jsx(ry,{price:n,unitQuantity:o}));let m=jsxRuntime.jsx(P,{variant:"body1",color:"secondary",children:t});return p&&(m=jsxRuntime.jsx(IT__default.default,{onClick:c,underline:"none",style:{cursor:"pointer"},children:m})),jsxRuntime.jsxs(ve,{className:"stigg-checkout-summary-base-charges-container",children:[jsxRuntime.jsxs(me,{style:{alignItems:"flex-start"},children:[jsxRuntime.jsxs(Se__default.default,{item:true,display:"flex",gap:.5,style:{whiteSpace:a?"nowrap":"break-spaces"},children:[m,p&&jsxRuntime.jsx(material.IconButton,{onClick:c,sx:{padding:0},children:jsxRuntime.jsx(ay,{$isOpen:s,$size:16})})]}),jsxRuntime.jsxs(Se__default.default,{item:true,display:"flex",gap:1,alignItems:"center",children:[d&&jsxRuntime.jsx(q3,{checkoutLocalization:e}),jsxRuntime.jsxs(P,{variant:"body1",color:"secondary",style:{whiteSpace:a?"nowrap":"break-spaces"},children:[iy({totalAmount:u,quantity:o,currency:n.currency,pricingModel:n.pricingModel,billingPeriod:n.billingPeriod,tiers:n.tiers,tiersMode:n.tiersMode,blockSize:n.blockSize,priceAmount:n.amount,availableBillingPeriods:new Set(r==null?void 0:r.pricePoints.map(g=>g.billingPeriod))}),d&&" / unit"]})]})]}),p&&jsxRuntime.jsx(X3__default.default,{in:s,children:jsxRuntime.jsx(K3,{children:p})})]})},sy=({label:e})=>jsxRuntime.jsx(ve,{children:jsxRuntime.jsxs(me,{style:{alignItems:"flex-end"},children:[jsxRuntime.jsx(Se__default.default,{item:true,children:jsxRuntime.jsx(P,{variant:"body1",color:"secondary",children:e})}),jsxRuntime.jsx(Se__default.default,{item:true,display:"flex",gap:1,alignItems:"center",children:jsxRuntime.jsx(P,{variant:"body1",color:"secondary",style:{wordBreak:"break-word"},children:"Free"})})]})}),ly=({subscriptionPreview:e,isFetchingSubscriptionPreview:t,checkoutLocalization:o})=>{let{immediateInvoice:n,recurringInvoice:i}=e,{discount:r,discountDetails:a}=i||{};return !r||!a?null:jsxRuntime.jsx(ve,{children:jsxRuntime.jsxs(me,{children:[jsxRuntime.jsx(P,{variant:"body1",color:"secondary",children:o.summary.discountText({discountDetails:a,currency:n.total.currency})}),jsxRuntime.jsx(P,{variant:"body1",color:"secondary",children:t?jsxRuntime.jsx(dt,{width:50,height:16}):at({amount:r.amount,currency:r.currency,minimumFractionDigits:2})})]})})},cy=({subscriptionPreview:e,isFetchingSubscriptionPreview:t,checkoutLocalization:o})=>{let{immediateInvoice:n}=e||{},{credits:i}=n||{};return !i||!i.used||i.used.amount<=0?null:jsxRuntime.jsx(ve,{children:jsxRuntime.jsxs(me,{children:[jsxRuntime.jsx(P,{variant:"body1",color:"secondary",children:o.summary.appliedCreditsTitle}),jsxRuntime.jsx(P,{variant:"body1",color:"secondary",children:jsxRuntime.jsx(pe,{isLoading:t,children:at({amount:-1*i.used.amount,currency:i.used.currency,minimumFractionDigits:2})})})]})})},dy=({tax:e,taxDetails:t,isFetchingSubscriptionPreview:o,checkoutLocalization:n})=>!t||!e||(e==null?void 0:e.amount)<=0?null:jsxRuntime.jsx(ve,{children:jsxRuntime.jsxs(me,{children:[jsxRuntime.jsx(P,{variant:"body1",color:"secondary",children:n.summary.taxTitle({taxDetails:t})}),jsxRuntime.jsx(P,{variant:"body1",color:"secondary",children:jsxRuntime.jsx(pe,{isLoading:o,children:at({amount:e==null?void 0:e.amount,currency:e==null?void 0:e.currency,minimumFractionDigits:2})})})]})});var qc=y(Ua__default.default)`
654
+ `,fP=({checkoutLocalization:e})=>{let t=jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.f,{variant:"body1",children:e.summary.payAsYouGoTooltipText});return jsxRuntime.jsx(Ve,{placement:"left",title:t,children:jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.i,{icon:"PayAsYouGoCharge",style:{display:"flex"}})})},br=({checkoutLocalization:e,label:t,quantity:o,price:r})=>{let{checkoutState:n}=U(),i=n==null?void 0:n.plan,s=de("lg"),[l,a]=ii.useState(false),c=()=>a(y=>!y),u=r.pricingModel===jsClientSdk.BillingModel.UsageBased,f=r.isTieredPrice?ht(r,o):(r.amount||0)*Math.ceil(o/(r.blockSize||1)),p;r.tiersMode===jsClientSdk.TiersMode.Graduated&&!!r.tiers&&!Bg__default.default(r.tiers)&&!Po__default.default(r.tiers[0].upTo)&&o>r.tiers[0].upTo&&(p=jsxRuntime.jsx(xd,{price:r,unitQuantity:o}));let g=jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.f,{variant:"body1",color:"secondary",children:t});return p&&(g=jsxRuntime.jsx(xf__default.default,{onClick:c,underline:"none",style:{cursor:"pointer"},children:g})),jsxRuntime.jsxs(De,{className:"stigg-checkout-summary-base-charges-container",children:[jsxRuntime.jsxs(Fe,{style:{alignItems:"flex-start"},children:[jsxRuntime.jsxs(Me__default.default,{item:true,display:"flex",gap:.5,style:{whiteSpace:s?"nowrap":"break-spaces"},children:[g,p&&jsxRuntime.jsx(mP__default.default,{onClick:c,sx:{padding:0},children:jsxRuntime.jsx(Pd,{$isOpen:l,$size:16})})]}),jsxRuntime.jsxs(Me__default.default,{item:true,display:"flex",gap:1,alignItems:"center",children:[u&&jsxRuntime.jsx(fP,{checkoutLocalization:e}),jsxRuntime.jsxs(chunkMY4ZIUAV_cjs_js.f,{variant:"body1",color:"secondary",style:{whiteSpace:s?"nowrap":"break-spaces"},children:[Cd({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(y=>y.billingPeriod))}),u&&" / unit"]})]})]}),p&&jsxRuntime.jsx(yx__default.default,{in:l,children:jsxRuntime.jsx(gP,{children:p})})]})},bd=({label:e})=>jsxRuntime.jsx(De,{children:jsxRuntime.jsxs(Fe,{style:{alignItems:"flex-end"},children:[jsxRuntime.jsx(Me__default.default,{item:true,children:jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.f,{variant:"body1",color:"secondary",children:e})}),jsxRuntime.jsx(Me__default.default,{item:true,display:"flex",gap:1,alignItems:"center",children:jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.f,{variant:"body1",color:"secondary",style:{wordBreak:"break-word"},children:"Free"})})]})}),Sd=({subscriptionPreview:e,isFetchingSubscriptionPreview:t,checkoutLocalization:o})=>{let{immediateInvoice:r,recurringInvoice:n}=e,{discount:i,discountDetails:s}=n||{};return !i||!s?null:jsxRuntime.jsx(De,{children:jsxRuntime.jsxs(Fe,{children:[jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.f,{variant:"body1",color:"secondary",children:o.summary.discountText({discountDetails:s,currency:r.total.currency})}),jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.f,{variant:"body1",color:"secondary",children:t?jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.o,{width:50,height:16}):H({amount:i.amount,currency:i.currency,minimumFractionDigits:2})})]})})},Td=({subscriptionPreview:e,isFetchingSubscriptionPreview:t,checkoutLocalization:o})=>{let{immediateInvoice:r}=e||{},{credits:n}=r||{};return !n||!n.used||n.used.amount<=0?null:jsxRuntime.jsx(De,{children:jsxRuntime.jsxs(Fe,{children:[jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.f,{variant:"body1",color:"secondary",children:o.summary.appliedCreditsTitle}),jsxRuntime.jsx(chunkMY4ZIUAV_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})})})]})})},kd=({tax:e,taxDetails:t,isFetchingSubscriptionPreview:o,checkoutLocalization:r})=>!t||!e||(e==null?void 0:e.amount)<=0?null:jsxRuntime.jsx(De,{children:jsxRuntime.jsxs(Fe,{children:[jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.f,{variant:"body1",color:"secondary",children:r.summary.taxTitle({taxDetails:t})}),jsxRuntime.jsx(chunkMY4ZIUAV_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 Bi=chunkMY4ZIUAV_cjs_js.e(ke__default.default)`
784
655
  width: 100%;
785
656
  max-width: 470px;
786
657
  flex: 1.5;
787
- `,Ba=y(n5__default.default)`
658
+ `,Sr=chunkMY4ZIUAV_cjs_js.e(bP__default.default)`
788
659
  background: ${({theme:e})=>e.stigg.palette.backgroundHighlight};
789
660
  padding: 16px;
790
661
 
791
- ${wt.md} {
662
+ ${oe.md} {
792
663
  border-radius: 10px;
793
664
  }
794
- `;Ba.defaultProps={elevation:0};var r5=y(P)`
665
+ `;Sr.defaultProps={elevation:0};var TP=chunkMY4ZIUAV_cjs_js.e(chunkMY4ZIUAV_cjs_js.f)`
795
666
  margin-bottom: 16px;
796
667
  font-weight: 500;
797
- `,Fn=y(fg__default.default)`
668
+ `,vt=chunkMY4ZIUAV_cjs_js.e(xl__default.default)`
798
669
  margin: 16px 0;
799
- `,py=y(P)`
670
+ `,Bd=chunkMY4ZIUAV_cjs_js.e(chunkMY4ZIUAV_cjs_js.f)`
800
671
  margin-bottom: 8px;
801
- `;function a5({isLastStep:e,checkoutHasChanges:t,isFreeDowngrade:o,checkoutLocalization:n,isPlanUpdate:i}){return e?t?i?n.checkoutButton.updateText:o?n.checkoutButton.downgradeToFreeText:n.checkoutButton.upgradeText:n.checkoutButton.noChangesText:n.checkoutButton.nextText}var my=({onCheckout:e,onCheckoutCompleted:t,disablePromotionCode:o,disableSuccessAnimation:n,isFreeDowngrade:i,onMockCheckoutPreview:r,showWatermark:a})=>{var np,ip,rp,ap;let[s,l]=Fc.useState(false),{setErrorMessage:c,useNewPaymentMethod:d}=vt(),u=ke(),p=An(),{checkoutState:h,checkoutLocalization:m,checkoutSuccess:g,widgetState:f}=Y(),{plan:x,activeSubscription:b}=h||{},T=xa(((np=x==null?void 0:x.pricePoints)==null?void 0:np.filter(q=>q.billingPeriod===p.billingPeriod))||[]),[k,w]=J3__default.default(T,q=>q.pricingModel===ah.BillingModel.FlatFee),v=k[0],_=i||u.isCheckoutComplete&&u.isLastStep,{isZuoraIntegration:M}=En(),I=s||g,{subscriptionPreview:F,isFetchingSubscriptionPreview:E,errorMessage:B}=uf({onMockCheckoutPreview:r}),{handleSubmit:O,isLoading:U}=Xf({isMocked:!!r,disableSuccessAnimation:n,onCheckout:e,onCheckoutCompleted:t,onSuccess:()=>{l(true),u.markStepAsCompleted(u.progressBarState.activeStep);}}),{handleZuoraSubmit:L}=Ia({onCheckout:e,onCheckoutCompleted:t,disableSuccessAnimation:n,onSuccess:()=>{u.markStepAsCompleted(u.progressBarState.activeStep);}}),V=q=>R(null,null,function*(){if(I)return;let ce;M&&!d?ce=yield L():ce=yield O(q);let{errorMessage:Gt}=ce||{};Gt?(c(Gt),l(false)):c(void 0);}),J=M&&!d?f.readOnly:U,Bt=q=>R(null,null,function*(){J||(_?yield V(q):u.goNext());}),{immediateInvoice:tt,recurringInvoice:bt}=F||{},Eo=!!F&&(!!(tt!=null&&tt.proration)||!!F.hasScheduledUpdates),Fe=!o&&!i&&!M,Je=!!(bt!=null&&bt.discountDetails)&&!i,Fo=Fe||Je,gn=w.some(q=>q.pricingModel===ah.BillingModel.UsageBased),Lo=gn&&!v&&w.every(q=>q.pricingModel===ah.BillingModel.UsageBased),tp=typeof m.summary.baseChargeText=="function"?m.summary.baseChargeText({billingPeriod:p.billingPeriod}):m.summary.baseChargeText,ep=Fc.useMemo(()=>{var q,ce;return (ce=(q=p.addons)==null?void 0:q.filter(Gt=>!$o(Gt.addon)))!=null?ce:[]},[p.addons]),op=Fc.useMemo(()=>ep.filter(q=>{var Gt;return !!((Gt=q.addon.pricePoints)==null?void 0:Gt.find(fn=>fn.billingPeriod===p.billingPeriod))}).map(q=>{let ce=q.addon.pricePoints.find(fn=>fn.billingPeriod===p.billingPeriod),Gt=q.quantity&&q.quantity>0?q.quantity:1;return jsxRuntime.jsx(La,{checkoutLocalization:m,label:q.addon.displayName,quantity:Gt,price:ce},q.addon.id)}),[ep,p.billingPeriod,m]);return jsxRuntime.jsxs(qc,{className:"stigg-checkout-summary-container",children:[jsxRuntime.jsxs(Ba,{children:[jsxRuntime.jsx(r5,{variant:"h3",children:m.summary.title}),jsxRuntime.jsxs(Se__default.default,{className:"stigg-checkout-summary-plan-title-container",display:"flex",flexDirection:"row",alignItems:"center",marginY:2,children:[jsxRuntime.jsx(P,{variant:"h6",color:"primary",style:{paddingRight:"8px"},children:m.summary.planName({plan:x})}),jsxRuntime.jsx(Fn,{className:"stigg-checkout-summary-divider",sx:{flex:1,margin:"0 !important"}})]}),v&&jsxRuntime.jsx(La,{checkoutLocalization:m,label:tp,quantity:1,price:v}),!v&&i?jsxRuntime.jsx(sy,{label:tp}):null,jsxRuntime.jsx(Se__default.default,{item:true,className:"stigg-checkout-summary-usage-charges-container",children:w.map((q,ce)=>{var fn,sp,lp,cp,dp;let Gt=(fn=p.billableFeatures)==null?void 0:fn.find(pC=>{var up;return pC.featureId===((up=q.feature)==null?void 0:up.featureId)});return jsxRuntime.jsx(La,{checkoutLocalization:m,label:vn(((lp=q.feature)==null?void 0:lp.displayName)||"",(cp=q.feature)==null?void 0:cp.units,(dp=q.feature)==null?void 0:dp.unitsPlural),quantity:(Gt==null?void 0:Gt.quantity)||1,price:q},((sp=q.feature)==null?void 0:sp.featureId)||`usage-charge-${ce}`)})}),op.length>0&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(Se__default.default,{display:"flex",flexDirection:"row",alignItems:"center",marginY:2,children:[jsxRuntime.jsx(P,{variant:"h6",color:"primary",style:{paddingRight:"8px"},children:m.summary.addonsSectionTitle}),jsxRuntime.jsx(Fn,{className:"stigg-checkout-summary-divider",sx:{flex:1,margin:"0 !important"}})]}),op]}),!Fo&&jsxRuntime.jsx(Fn,{className:"stigg-checkout-summary-divider"}),Fo&&jsxRuntime.jsxs(Se__default.default,{display:"flex",flexDirection:"row",alignItems:"center",marginY:2,children:[jsxRuntime.jsx(P,{variant:"h6",color:"primary",style:{paddingRight:"8px"},children:m.summary.discountsSectionTitle}),jsxRuntime.jsx(Fn,{className:"stigg-checkout-summary-divider",sx:{flex:1,margin:"0 !important"}})]}),Fe&&jsxRuntime.jsx(Rf,{disabled:J||E,checkoutLocalization:m,onMockCheckoutPreview:r}),Je&&F&&jsxRuntime.jsx(ly,{subscriptionPreview:F,isFetchingSubscriptionPreview:E,checkoutLocalization:m}),Fo&&jsxRuntime.jsx(Fn,{className:"stigg-checkout-summary-divider"}),jsxRuntime.jsx(dy,{tax:bt==null?void 0:bt.tax,taxDetails:bt==null?void 0:bt.taxDetails,isFetchingSubscriptionPreview:E,checkoutLocalization:m}),i?null:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(me,{style:{marginTop:16},children:jsxRuntime.jsxs(Se__default.default,{display:"flex",flexDirection:"column",container:true,children:[jsxRuntime.jsxs(Se__default.default,{item:true,display:"flex",justifyContent:"space-between",children:[jsxRuntime.jsx(P,{variant:"h6",children:m.summary.totalText}),jsxRuntime.jsx(P,{variant:"h6",children:jsxRuntime.jsxs(pe,{isLoading:E,children:[Lo?m.summary.onlyPayAsYouGoText:null,!Lo&&gn?m.summary.startsAtText:null,Lo?null:at(A(S({amount:0},bt==null?void 0:bt.total),{minimumFractionDigits:2}))]})})]}),jsxRuntime.jsx(Se__default.default,{item:true,children:jsxRuntime.jsx(P,{variant:"body1",color:"secondary",children:m.summary.totalBillingPeriodText({billingPeriod:p.billingPeriod})})})]})}),jsxRuntime.jsx(Fn,{className:"stigg-checkout-summary-divider"})]}),(ip=tt==null?void 0:tt.proration)!=null&&ip.hasProrations&&(tt!=null&&tt.subTotal)&&(tt==null?void 0:tt.subTotal.amount)>0?jsxRuntime.jsx(ve,{children:jsxRuntime.jsxs(me,{children:[jsxRuntime.jsx(P,{variant:"body1",color:"secondary",children:m.summary.proratedTotalDueText}),jsxRuntime.jsx(P,{variant:"body1",color:"secondary",children:jsxRuntime.jsx(pe,{isLoading:E,children:at({amount:Number(((rp=tt==null?void 0:tt.subTotal)==null?void 0:rp.amount)||0)+Number(((ap=tt==null?void 0:tt.tax)==null?void 0:ap.amount)||0),currency:tt==null?void 0:tt.subTotal.currency,minimumFractionDigits:2})})})]})}):null,jsxRuntime.jsx(cy,{subscriptionPreview:F,isFetchingSubscriptionPreview:E,checkoutLocalization:m}),jsxRuntime.jsx(ve,{children:jsxRuntime.jsxs(me,{children:[jsxRuntime.jsx(py,{variant:"h6",children:m.summary.totalDueText}),jsxRuntime.jsx(py,{variant:"h6",children:jsxRuntime.jsx(pe,{isLoading:E,children:at(A(S({amount:0},tt==null?void 0:tt.total),{minimumFractionDigits:2}))})})]})}),jsxRuntime.jsx(oy,{plan:x,activeSubscription:b,subscriptionPreview:F,isFetchingSubscriptionPreview:E,checkoutLocalization:m,billingPeriod:p.billingPeriod}),(!_||!M||M&&!d)&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(kt,{$success:I,$error:_&&i,disabled:J||E||u.progressBarState.isDisabled||_&&!Eo||!!B,className:"stigg-checkout-summary-cta-button",sx:{textTransform:"none",borderRadius:"10px",marginTop:"24px",height:"36px"},variant:"contained",size:"medium",onClick:q=>{Bt(q);},fullWidth:true,children:jsxRuntime.jsx(P,{className:"stigg-checkout-summary-cta-button-text",variant:"h3",color:"white",style:{display:"flex"},children:I?jsxRuntime.jsx(mt,{icon:"Check",style:{display:"contents"}}):J||E?jsxRuntime.jsx(Iw__default.default,{size:20,sx:{color:"white"}}):a5({isLastStep:_,checkoutHasChanges:Eo,isFreeDowngrade:i,checkoutLocalization:m,isPlanUpdate:!!b&&(b==null?void 0:b.plan.id)===(x==null?void 0:x.id)})})}),B&&jsxRuntime.jsx(i5__default.default,{severity:"error",sx:{alignItems:"center",marginTop:"12px"},children:jsxRuntime.jsx(P,{overrideColor:"inherit",children:B})})]})]}),jsxRuntime.jsx(Jt,{source:"checkout",showWatermark:a,style:{marginTop:8,display:"flex",justifyContent:"center"}}),!n&&I&&jsxRuntime.jsx(Zf,{checkoutLocalization:m})]})};var hy=({showWatermark:e})=>jsxRuntime.jsxs(qc,{children:[jsxRuntime.jsxs(Ba,{children:[jsxRuntime.jsxs(Oo,{$flexDirection:"column",$gap:24,children:[jsxRuntime.jsx(dt,{width:120,height:20}),jsxRuntime.jsx(dt,{width:120,height:20}),jsxRuntime.jsx(dt,{width:120,height:20}),jsxRuntime.jsx(dt,{width:120,height:20})]}),jsxRuntime.jsxs(Oo,{$flexDirection:"column",$gap:24,marginTop:5,children:[jsxRuntime.jsx(dt,{height:20}),jsxRuntime.jsx(dt,{height:20}),jsxRuntime.jsx(dt,{height:20})]}),jsxRuntime.jsx(xi,{flex:1,marginTop:5,children:jsxRuntime.jsx(dt,{height:34})})]}),jsxRuntime.jsx(Jt,{source:"checkout",showWatermark:e,style:{marginTop:8,display:"flex",justifyContent:"center"}})]});var fy=y(Se__default.default)`
672
+ `;function kP({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 Ad=({onCheckout:e,onCheckoutCompleted:t,disablePromotionCode:o,disableSuccessAnimation:r,isFreeDowngrade:n,onMockCheckoutPreview:i,showWatermark:s})=>{var aa,sa,la,ca;let[l,a]=ii.useState(false),{setErrorMessage:c,useNewPaymentMethod:u}=re(),f=Ue(),p=wt(),{checkoutState:h,checkoutLocalization:g,checkoutSuccess:y,widgetState:C}=U(),{plan:b,activeSubscription:x}=h||{},S=dr(((aa=b==null?void 0:b.pricePoints)==null?void 0:aa.filter(D=>D.billingPeriod===p.billingPeriod))||[]),[T,F]=hP__default.default(S,D=>D.pricingModel===jsClientSdk.BillingModel.FlatFee),w=T[0],I=n||f.isCheckoutComplete&&f.isLastStep,{isZuoraIntegration:k}=Ft(),L=l||y,{subscriptionPreview:E,isFetchingSubscriptionPreview:A,errorMessage:Z}=uc({onMockCheckoutPreview:i}),{handleSubmit:$,isLoading:_}=cd({isMocked:!!i,disableSuccessAnimation:r,onCheckout:e,onCheckoutCompleted:t,onSuccess:()=>{a(true),f.markStepAsCompleted(f.progressBarState.activeStep);}}),{handleZuoraSubmit:z}=Cr({onCheckout:e,onCheckoutCompleted:t,disableSuccessAnimation:r,onSuccess:()=>{f.markStepAsCompleted(f.progressBarState.activeStep);}}),q=D=>chunkMY4ZIUAV_cjs_js.d(null,null,function*(){if(L)return;let we;k&&!u?we=yield z():we=yield $(D);let{errorMessage:ge}=we||{};ge?(c(ge),a(false)):c(void 0);}),Ge=k&&!u?C.readOnly:_,pt=D=>chunkMY4ZIUAV_cjs_js.d(null,null,function*(){Ge||(I?yield q(D):f.goNext());}),{immediateInvoice:V,recurringInvoice:xe}=E||{},ji=!!E&&(!!(V!=null&&V.proration)||!!E.hasScheduledUpdates),ea=!o&&!n&&!k,ta=!!(xe!=null&&xe.discountDetails)&&!n,Yr=ea||ta,oa=F.some(D=>D.pricingModel===jsClientSdk.BillingModel.UsageBased),Qr=oa&&!w&&F.every(D=>D.pricingModel===jsClientSdk.BillingModel.UsageBased),ra=typeof g.summary.baseChargeText=="function"?g.summary.baseChargeText({billingPeriod:p.billingPeriod}):g.summary.baseChargeText,na=ii.useMemo(()=>{var D,we;return (we=(D=p.addons)==null?void 0:D.filter(ge=>!at(ge.addon)))!=null?we:[]},[p.addons]),ia=ii.useMemo(()=>na.filter(D=>{var ge;return !!((ge=D.addon.pricePoints)==null?void 0:ge.find(mt=>mt.billingPeriod===p.billingPeriod))}).map(D=>{let we=D.addon.pricePoints.find(mt=>mt.billingPeriod===p.billingPeriod),ge=D.quantity&&D.quantity>0?D.quantity:1;return jsxRuntime.jsx(br,{checkoutLocalization:g,label:D.addon.displayName,quantity:ge,price:we},D.addon.id)}),[na,p.billingPeriod,g]);return jsxRuntime.jsxs(Bi,{className:"stigg-checkout-summary-container",children:[jsxRuntime.jsxs(Sr,{children:[jsxRuntime.jsx(TP,{variant:"h3",children:g.summary.title}),jsxRuntime.jsxs(Me__default.default,{className:"stigg-checkout-summary-plan-title-container",display:"flex",flexDirection:"row",alignItems:"center",marginY:2,children:[jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.f,{variant:"h6",color:"primary",style:{paddingRight:"8px"},children:g.summary.planName({plan:b})}),jsxRuntime.jsx(vt,{className:"stigg-checkout-summary-divider",sx:{flex:1,margin:"0 !important"}})]}),w&&jsxRuntime.jsx(br,{checkoutLocalization:g,label:ra,quantity:1,price:w}),!w&&n?jsxRuntime.jsx(bd,{label:ra}):null,jsxRuntime.jsx(Me__default.default,{item:true,className:"stigg-checkout-summary-usage-charges-container",children:F.map((D,we)=>{var mt,da,pa,ma,ua;let ge=(mt=p.billableFeatures)==null?void 0:mt.find(nm=>{var ga;return nm.featureId===((ga=D.feature)==null?void 0:ga.featureId)});return jsxRuntime.jsx(br,{checkoutLocalization:g,label:Tt(((pa=D.feature)==null?void 0:pa.displayName)||"",(ma=D.feature)==null?void 0:ma.units,(ua=D.feature)==null?void 0:ua.unitsPlural),quantity:(ge==null?void 0:ge.quantity)||1,price:D},((da=D.feature)==null?void 0:da.featureId)||`usage-charge-${we}`)})}),ia.length>0&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(Me__default.default,{display:"flex",flexDirection:"row",alignItems:"center",marginY:2,children:[jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.f,{variant:"h6",color:"primary",style:{paddingRight:"8px"},children:g.summary.addonsSectionTitle}),jsxRuntime.jsx(vt,{className:"stigg-checkout-summary-divider",sx:{flex:1,margin:"0 !important"}})]}),ia]}),!Yr&&jsxRuntime.jsx(vt,{className:"stigg-checkout-summary-divider"}),Yr&&jsxRuntime.jsxs(Me__default.default,{display:"flex",flexDirection:"row",alignItems:"center",marginY:2,children:[jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.f,{variant:"h6",color:"primary",style:{paddingRight:"8px"},children:g.summary.discountsSectionTitle}),jsxRuntime.jsx(vt,{className:"stigg-checkout-summary-divider",sx:{flex:1,margin:"0 !important"}})]}),ea&&jsxRuntime.jsx(_c,{disabled:Ge||A,checkoutLocalization:g,onMockCheckoutPreview:i}),ta&&E&&jsxRuntime.jsx(Sd,{subscriptionPreview:E,isFetchingSubscriptionPreview:A,checkoutLocalization:g}),Yr&&jsxRuntime.jsx(vt,{className:"stigg-checkout-summary-divider"}),jsxRuntime.jsx(kd,{tax:xe==null?void 0:xe.tax,taxDetails:xe==null?void 0:xe.taxDetails,isFetchingSubscriptionPreview:A,checkoutLocalization:g}),n?null:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Fe,{style:{marginTop:16},children:jsxRuntime.jsxs(Me__default.default,{display:"flex",flexDirection:"column",container:true,children:[jsxRuntime.jsxs(Me__default.default,{item:true,display:"flex",justifyContent:"space-between",children:[jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.f,{variant:"h6",children:g.summary.totalText}),jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.f,{variant:"h6",children:jsxRuntime.jsxs(Ie,{isLoading:A,children:[Qr?g.summary.onlyPayAsYouGoText:null,!Qr&&oa?g.summary.startsAtText:null,Qr?null:H(chunkMY4ZIUAV_cjs_js.b(chunkMY4ZIUAV_cjs_js.a({amount:0},xe==null?void 0:xe.total),{minimumFractionDigits:2}))]})})]}),jsxRuntime.jsx(Me__default.default,{item:true,children:jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.f,{variant:"body1",color:"secondary",children:g.summary.totalBillingPeriodText({billingPeriod:p.billingPeriod})})})]})}),jsxRuntime.jsx(vt,{className:"stigg-checkout-summary-divider"})]}),(sa=V==null?void 0:V.proration)!=null&&sa.hasProrations&&(V!=null&&V.subTotal)&&(V==null?void 0:V.subTotal.amount)>0?jsxRuntime.jsx(De,{children:jsxRuntime.jsxs(Fe,{children:[jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.f,{variant:"body1",color:"secondary",children:g.summary.proratedTotalDueText}),jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.f,{variant:"body1",color:"secondary",children:jsxRuntime.jsx(Ie,{isLoading:A,children:H({amount:Number(((la=V==null?void 0:V.subTotal)==null?void 0:la.amount)||0)+Number(((ca=V==null?void 0:V.tax)==null?void 0:ca.amount)||0),currency:V==null?void 0:V.subTotal.currency,minimumFractionDigits:2})})})]})}):null,jsxRuntime.jsx(Td,{subscriptionPreview:E,isFetchingSubscriptionPreview:A,checkoutLocalization:g}),jsxRuntime.jsx(De,{children:jsxRuntime.jsxs(Fe,{children:[jsxRuntime.jsx(Bd,{variant:"h6",children:g.summary.totalDueText}),jsxRuntime.jsx(Bd,{variant:"h6",children:jsxRuntime.jsx(Ie,{isLoading:A,children:H(chunkMY4ZIUAV_cjs_js.b(chunkMY4ZIUAV_cjs_js.a({amount:0},V==null?void 0:V.total),{minimumFractionDigits:2}))})})]})}),jsxRuntime.jsx(yd,{plan:b,activeSubscription:x,subscriptionPreview:E,isFetchingSubscriptionPreview:A,checkoutLocalization:g,billingPeriod:p.billingPeriod}),(!I||!k||k&&!u)&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(te,{$success:L,$error:I&&n,disabled:Ge||A||f.progressBarState.isDisabled||I&&!ji||!!Z,className:"stigg-checkout-summary-cta-button",sx:{textTransform:"none",borderRadius:"10px",marginTop:"24px",height:"36px"},variant:"contained",size:"medium",onClick:D=>{pt(D);},fullWidth:true,children:jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.f,{className:"stigg-checkout-summary-cta-button-text",variant:"h3",color:"white",style:{display:"flex"},children:L?jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.i,{icon:"Check",style:{display:"contents"}}):Ge||A?jsxRuntime.jsx(xh__default.default,{size:20,sx:{color:"white"}}):kP({isLastStep:I,checkoutHasChanges:ji,isFreeDowngrade:n,checkoutLocalization:g,isPlanUpdate:!!x&&(x==null?void 0:x.plan.id)===(b==null?void 0:b.id)})})}),Z&&jsxRuntime.jsx(SP__default.default,{severity:"error",sx:{alignItems:"center",marginTop:"12px"},children:jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.f,{overrideColor:"inherit",children:Z})})]})]}),jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.q,{source:"checkout",showWatermark:s,style:{marginTop:8,display:"flex",justifyContent:"center"}}),!r&&L&&jsxRuntime.jsx(ld,{checkoutLocalization:g})]})};var Id=({showWatermark:e})=>jsxRuntime.jsxs(Bi,{children:[jsxRuntime.jsxs(Sr,{children:[jsxRuntime.jsxs(chunkMY4ZIUAV_cjs_js.l,{$flexDirection:"column",$gap:24,children:[jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.o,{width:120,height:20}),jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.o,{width:120,height:20}),jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.o,{width:120,height:20}),jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.o,{width:120,height:20})]}),jsxRuntime.jsxs(chunkMY4ZIUAV_cjs_js.l,{$flexDirection:"column",$gap:24,marginTop:5,children:[jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.o,{height:20}),jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.o,{height:20}),jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.o,{height:20})]}),jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.n,{flex:1,marginTop:5,children:jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.o,{height:34})})]}),jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.q,{source:"checkout",showWatermark:e,style:{marginTop:8,display:"flex",justifyContent:"center"}})]});var vd=chunkMY4ZIUAV_cjs_js.e(Me__default.default)`
802
673
  width: 100%;
803
674
  gap: 8px;
804
- `,yy=y(Se__default.default)`
675
+ `,Ed=chunkMY4ZIUAV_cjs_js.e(Me__default.default)`
805
676
  display: flex;
806
677
  flex-direction: column;
807
678
  gap: 16px;
808
679
  width: 100%;
809
680
 
810
- ${wt.md} {
681
+ ${oe.md} {
811
682
  gap: 0;
812
683
  flex-direction: row;
813
684
  justify-content: space-between;
@@ -816,51 +687,51 @@
816
687
  padding-top: 16px;
817
688
  padding-bottom: 16px;
818
689
  }
819
- `,xy=y(kt)`
690
+ `,Ld=chunkMY4ZIUAV_cjs_js.e(te)`
820
691
  min-width: unset;
821
692
  width: 41px;
822
693
  height: 41px;
823
694
  padding: 0;
824
- `;var l5=material.styled(material.Grid)`
695
+ `;var BP=styles.styled(Me__default.default)`
825
696
  display: flex;
826
697
  flex-direction: row;
827
698
  align-items: center;
828
699
  width: 100%;
829
700
  justify-content: flex-end;
830
- `;function Py({addon:e,addonState:t,hasChanges:o,errorMessage:n,isPriceForBillingPeriodAvailable:i,checkoutLocalization:r,handleQuantityChange:a,handleUndo:s,handleRemoveAddon:l}){var p;let c=Dt("lg"),d=!!t,u=e.maxQuantity!==1;return jsxRuntime.jsxs(l5,{item:true,sx:{gap:"16px"},container:!c,children:[o&&jsxRuntime.jsx(kt,{variant:"text",size:"small",sx:{padding:"8px",minWidth:"unset"},onClick:s,children:jsxRuntime.jsx(P,{color:"primary.main",variant:"body1",children:"Undo"})}),d&&jsxRuntime.jsxs(material.Grid,{sx:{display:"flex",width:"100%",justifyContent:"flex-end"},children:[u&&jsxRuntime.jsx(Rt,{id:`${e.id}-input`,type:"number",onWheel:Pn,sx:c?{marginX:2,width:"100%"}:{flex:1},value:(p=t==null?void 0:t.quantity)!=null?p:"",error:!!n,helperText:n,FormHelperTextProps:{sx:{margin:"4px"}},onChange:h=>{var m,g;return a((m=h==null?void 0:h.target)!=null&&m.value?Number((g=h==null?void 0:h.target)==null?void 0:g.value):null)},onFocus:h=>h.target.select()}),jsxRuntime.jsx(xy,{color:"error",onClick:l,children:jsxRuntime.jsx(mt,{icon:"Trash",style:{display:"flex",padding:"8px"}})})]}),!d&&jsxRuntime.jsx(kt,{sx:{paddingX:"22px",paddingY:"8px"},onClick:()=>a(1),disabled:!i,children:jsxRuntime.jsx(P,{color:i?"primary.main":"disabled",variant:"body1",children:r.addAddonText})})]})}var u5=y(material.Grid)`
701
+ `;function Rd({addon:e,addonState:t,hasChanges:o,errorMessage:r,isPriceForBillingPeriodAvailable:n,checkoutLocalization:i,handleQuantityChange:s,handleUndo:l,handleRemoveAddon:a}){var p;let c=de("lg"),u=!!t,f=e.maxQuantity!==1;return jsxRuntime.jsxs(BP,{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(chunkMY4ZIUAV_cjs_js.f,{color:"primary.main",variant:"body1",children:"Undo"})}),u&&jsxRuntime.jsxs(Me__default.default,{sx:{display:"flex",width:"100%",justifyContent:"flex-end"},children:[f&&jsxRuntime.jsx(ce,{id:`${e.id}-input`,type:"number",onWheel:Ct,sx:c?{marginX:2,width:"100%"}:{flex:1},value:(p=t==null?void 0:t.quantity)!=null?p:"",error:!!r,helperText:r,FormHelperTextProps:{sx:{margin:"4px"}},onChange:h=>{var g,y;return s((g=h==null?void 0:h.target)!=null&&g.value?Number((y=h==null?void 0:h.target)==null?void 0:y.value):null)},onFocus:h=>h.target.select()}),jsxRuntime.jsx(Ld,{color:"error",onClick:a,children:jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.i,{icon:"Trash",style:{display:"flex",padding:"8px"}})})]}),!u&&jsxRuntime.jsx(te,{sx:{paddingX:"22px",paddingY:"8px"},onClick:()=>s(1),disabled:!n,children:jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.f,{color:n?"primary.main":"disabled",variant:"body1",children:i.addAddonText})})]})}var FP=chunkMY4ZIUAV_cjs_js.e(Me__default.default)`
831
702
  display: flex;
832
703
  flex-direction: column;
833
704
  justify-content: center;
834
705
  width: 100%;
835
706
  height: 42px;
836
- `;function Sy({addon:e,billingPeriod:t,checkoutLocalization:o}){let n=e.pricePoints.find(i=>i.billingPeriod===t);return jsxRuntime.jsxs(u5,{item:true,children:[jsxRuntime.jsx(P,{variant:"h6",lineHeight:"24px",children:e.displayName}),n?jsxRuntime.jsx(P,{variant:"body1",lineHeight:"20px",color:"secondary",children:`${at({amount:n.amount,currency:n.currency,minimumFractionDigits:2})}/${t===ah.BillingPeriod.Annually?"year":"month"}`}):jsxRuntime.jsx(P,{variant:"body1",lineHeight:"20px",color:"secondary",children:o.addonBillingPeriodNotAvailableText({planBillingPeriod:t})})]})}function h5({addon:e,billingPeriod:t,addonState:o,initialAddonState:n,setAddon:i,removeAddon:r,checkoutLocalization:a,onAddonsValidationChange:s,onAddonChange:l}){let[c,d]=Fc.useState(void 0),u=!!o&&!!n&&o.quantity!==n.quantity||!!n&&!o,p=e.pricePoints.some(f=>f.billingPeriod===t),h=f=>R(null,null,function*(){if(!f||f<=0){s({addonId:e.id,isValid:false}),d("Minimum 1"),i(e,f!=null?f:null);return}let x=yield l==null?void 0:l({addon:e,quantity:f});d(x==null?void 0:x.errorMessage),s({addonId:e.id,isValid:!(x!=null&&x.disableNextStep)}),i(e,f);}),m=()=>R(null,null,function*(){yield l==null?void 0:l({addon:e,quantity:0}),r(e.id),s({addonId:e.id,isValid:true});});return jsxRuntime.jsxs(yy,{children:[jsxRuntime.jsx(Sy,{addon:e,billingPeriod:t,checkoutLocalization:a}),jsxRuntime.jsx(Py,{addon:e,addonState:o,hasChanges:u,handleUndo:()=>R(null,null,function*(){if(n){let f=yield l==null?void 0:l({addon:e,quantity:n.quantity});s({addonId:e.id,isValid:!(f!=null&&f.disableNextStep)}),i(e,n.quantity);}else yield m();s({addonId:e.id,isValid:true});}),errorMessage:c,handleQuantityChange:h,isPriceForBillingPeriodAvailable:p,checkoutLocalization:a,handleRemoveAddon:m})]})}function ky({onAddonChange:e}){let{checkoutLocalization:t,setIsValid:o}=Y(),{billingPeriod:n}=te(),{setIsDisabled:i}=ke(),{initialAddons:r,addons:a,availableAddons:s,setAddon:l,removeAddon:c}=qg(),[d,u]=Fc.useState((s==null?void 0:s.reduce((p,h)=>(p[h.id]=true,p),{}))||{});return Fc.useEffect(()=>{let p=Object.values(d).some(h=>!h);i(p),o(!p);},[d,i,o]),jsxRuntime.jsx(fy,{container:true,children:s==null?void 0:s.map(p=>{let h=a.find(g=>g.addon.id===p.id),m=r==null?void 0:r.find(g=>g.addon.id===p.id);return jsxRuntime.jsx(h5,{addon:p,billingPeriod:n,addonState:h,initialAddonState:m,setAddon:l,removeAddon:c,checkoutLocalization:t,onAddonsValidationChange:({addonId:g,isValid:f})=>u(A(S({},d),{[g]:f})),onAddonChange:e},p.id)})})}var td=y(Se__default.default)`
707
+ `;function Ud({addon:e,billingPeriod:t,checkoutLocalization:o}){let r=e.pricePoints.find(n=>n.billingPeriod===t);return jsxRuntime.jsxs(FP,{item:true,children:[jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.f,{variant:"h6",lineHeight:"24px",children:e.displayName}),r?jsxRuntime.jsx(chunkMY4ZIUAV_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(chunkMY4ZIUAV_cjs_js.f,{variant:"body1",lineHeight:"20px",color:"secondary",children:o.addonBillingPeriodNotAvailableText({planBillingPeriod:t})})]})}function LP({addon:e,billingPeriod:t,addonState:o,initialAddonState:r,setAddon:n,removeAddon:i,checkoutLocalization:s,onAddonsValidationChange:l,onAddonChange:a}){let[c,u]=ii.useState(void 0),f=!!o&&!!r&&o.quantity!==r.quantity||!!r&&!o,p=e.pricePoints.some(C=>C.billingPeriod===t),h=C=>chunkMY4ZIUAV_cjs_js.d(null,null,function*(){if(!C||C<=0){l({addonId:e.id,isValid:false}),u("Minimum 1"),n(e,C!=null?C:null);return}let b=yield a==null?void 0:a({addon:e,quantity:C});u(b==null?void 0:b.errorMessage),l({addonId:e.id,isValid:!(b!=null&&b.disableNextStep)}),n(e,C);}),g=()=>chunkMY4ZIUAV_cjs_js.d(null,null,function*(){yield a==null?void 0:a({addon:e,quantity:0}),i(e.id),l({addonId:e.id,isValid:true});});return jsxRuntime.jsxs(Ed,{children:[jsxRuntime.jsx(Ud,{addon:e,billingPeriod:t,checkoutLocalization:s}),jsxRuntime.jsx(Rd,{addon:e,addonState:o,hasChanges:f,handleUndo:()=>chunkMY4ZIUAV_cjs_js.d(null,null,function*(){if(r){let C=yield a==null?void 0:a({addon:e,quantity:r.quantity});l({addonId:e.id,isValid:!(C!=null&&C.disableNextStep)}),n(e,r.quantity);}else yield g();l({addonId:e.id,isValid:true});}),errorMessage:c,handleQuantityChange:h,isPriceForBillingPeriodAvailable:p,checkoutLocalization:s,handleRemoveAddon:g})]})}function Dd({onAddonChange:e}){let{checkoutLocalization:t,setIsValid:o}=U(),{billingPeriod:r}=Pe(),{setIsDisabled:n}=Ue(),{initialAddons:i,addons:s,availableAddons:l,setAddon:a,removeAddon:c}=ec(),[u,f]=ii.useState((l==null?void 0:l.reduce((p,h)=>(p[h.id]=true,p),{}))||{});return ii.useEffect(()=>{let p=Object.values(u).some(h=>!h);n(p),o(!p);},[u,n,o]),jsxRuntime.jsx(vd,{container:true,children:l==null?void 0:l.map(p=>{let h=s.find(y=>y.addon.id===p.id),g=i==null?void 0:i.find(y=>y.addon.id===p.id);return jsxRuntime.jsx(LP,{addon:p,billingPeriod:r,addonState:h,initialAddonState:g,setAddon:a,removeAddon:c,checkoutLocalization:t,onAddonsValidationChange:({addonId:y,isValid:C})=>f(chunkMY4ZIUAV_cjs_js.b(chunkMY4ZIUAV_cjs_js.a({},u),{[y]:C})),onAddonChange:e},p.id)})})}var Fi=chunkMY4ZIUAV_cjs_js.e(Me__default.default,{shouldForwardProp:e=>!e.startsWith("$")})`
837
708
  padding: 8px;
838
709
  border-radius: 10px;
839
710
  border: 1px solid ${({theme:e})=>e.stigg.palette.outlinedBorder};
840
711
  cursor: ${({$disabled:e})=>e?"not-allowed":"pointer"};
841
712
  opacity: ${({$disabled:e})=>e?.6:1};
842
- `,wy=y(td)`
713
+ `,$d=chunkMY4ZIUAV_cjs_js.e(Fi)`
843
714
  flex-direction: column;
844
715
  align-items: unset;
845
716
  ${({$hideBorders:e})=>e&&react.css`
846
717
  border: none;
847
718
  padding: 0;
848
719
  `}
849
- `,vy=y(Se__default.default)`
720
+ `,Gd=chunkMY4ZIUAV_cjs_js.e(Me__default.default)`
850
721
  display: flex;
851
722
  align-items: center;
852
723
  flex: 1;
853
724
  gap: 12px;
854
- `,_y=y(Se__default.default)`
725
+ `,zd=chunkMY4ZIUAV_cjs_js.e(Me__default.default)`
855
726
  display: flex;
856
727
  flex-direction: column;
857
- `;var T5=y(Ua__default.default)`
728
+ `;var zP=chunkMY4ZIUAV_cjs_js.e(ke__default.default)`
858
729
  position: relative;
859
730
  max-width: 500px;
860
- `,k5=y(Ua__default.default)`
731
+ `,VP=chunkMY4ZIUAV_cjs_js.e(ke__default.default)`
861
732
  opacity: ${({$showLoading:e})=>e?.6:1};
862
733
  pointer-events: ${({$showLoading:e})=>e?"none":"auto"};
863
- `,w5=y(Ua__default.default)`
734
+ `,HP=chunkMY4ZIUAV_cjs_js.e(ke__default.default)`
864
735
  position: absolute;
865
736
  top: 40px;
866
737
  left: 0;
@@ -872,18 +743,18 @@
872
743
  justify-content: center;
873
744
  border-radius: 4px;
874
745
  z-index: 10;
875
- `,v5=y(Ua__default.default)`
746
+ `,OP=chunkMY4ZIUAV_cjs_js.e(ke__default.default)`
876
747
  display: flex;
877
748
  flex-direction: column;
878
749
  align-items: center;
879
750
  gap: 12px;
880
- `;function Ay({onCheckout:e,onCheckoutCompleted:t}){var f,x,b;let{isZuoraIntegration:o,isInitialized:n,createPaymentSession:i}=En(),{setErrorMessage:r}=vt(),{billingCountryCode:a}=te(),{checkoutState:s,widgetState:l}=Y(),{handleZuoraSubmit:c}=Ia({onCheckout:e,onCheckoutCompleted:t}),d=Fc.useRef(false),[u,p]=Fc__default.default.useState(false),h=((b=(x=(f=s==null?void 0:s.plan)==null?void 0:f.pricePoints)==null?void 0:x[0])==null?void 0:b.currency)||ah.Currency.Usd,{publishableKey:m}=s==null?void 0:s.billingIntegration.billingCredentials,g=Fc.useCallback(T=>R(null,null,function*(){var k;if(!T.success||!T.paymentMethodId){let w=((k=T.error)==null?void 0:k.message)||"Payment failed";r(w),yield t({success:false,error:w});return}yield c(T.paymentMethodId);}),[c,r,t]);return Fc.useEffect(()=>(R(null,null,function*(){if(!(!n||d.current)){p(true),r(void 0);try{d.current=!0;let k=window.Zuora(m),w=Qf(i,g,h,a);(yield k.createPaymentForm(w)).mount("#zuora_payment");}catch(k){d.current=false,r("Failed to render Zuora payment form");}finally{p(false);}}}),()=>{d.current=false;}),[n]),o?jsxRuntime.jsxs(T5,{children:[jsxRuntime.jsx(k5,{id:"zuora_payment",$showLoading:l.readOnly||u}),(l.readOnly||u)&&jsxRuntime.jsx(w5,{children:jsxRuntime.jsx(v5,{children:jsxRuntime.jsx(Iw__default.default,{size:28})})})]}):null}function Iy({checked:e,text:t,subtitle:o,readOnly:n}){return jsxRuntime.jsxs(vy,{children:[jsxRuntime.jsx(M5__default.default,{checked:e,disabled:n}),jsxRuntime.jsxs(_y,{container:true,children:[jsxRuntime.jsx(Se__default.default,{item:true,children:t}),o&&jsxRuntime.jsx(Se__default.default,{item:true,children:o})]})]})}function Ey({checked:e,paymentMethodDetails:t,readOnly:o,onSelect:n}){if(!t)return null;let{last4Digits:i,expirationMonth:r,expirationYear:a}=t;return jsxRuntime.jsx(td,{item:true,onClick:n,$disabled:o,children:jsxRuntime.jsx(Iy,{checked:e,readOnly:o,text:jsxRuntime.jsx(P,{variant:"h6",children:`Card ending in ${i}`}),subtitle:!!r&&!!a&&jsxRuntime.jsx(P,{variant:"body1",children:`Expires ${r.toString().padStart(2,"0")}/${a}`})})})}function Fy({hasExistingPaymentMethod:e,checked:t,onSelect:o,readOnly:n,checkoutLocalization:i,onBillingAddressChange:r,collectPhoneNumber:a,collectTaxId:s,onCheckout:l,onCheckoutCompleted:c}){let{isZuoraIntegration:d}=En();return jsxRuntime.jsxs(wy,{item:true,$hideBorders:!e,onClick:o,$disabled:n,children:[e&&jsxRuntime.jsx(Iy,{checked:t,readOnly:n,text:jsxRuntime.jsx(P,{variant:"h6",children:i.newPaymentMethodText})}),jsxRuntime.jsx(X3__default.default,{in:t,children:d?jsxRuntime.jsx(Ay,{onCheckout:l,onCheckoutCompleted:c}):jsxRuntime.jsx(zf,{onBillingAddressChange:r,collectPhoneNumber:a,collectTaxId:s})})]})}var F5=y(Se__default.default)`
751
+ `;function Vd({onCheckout:e,onCheckoutCompleted:t}){var C,b,x;let{isZuoraIntegration:o,isInitialized:r,createPaymentSession:n}=Ft(),{setErrorMessage:i}=re(),{billingCountryCode:s}=Pe(),{checkoutState:l,widgetState:a}=U(),{handleZuoraSubmit:c}=Cr({onCheckout:e,onCheckoutCompleted:t}),u=ii.useRef(false),[f,p]=ii__default.default.useState(false),h=((x=(b=(C=l==null?void 0:l.plan)==null?void 0:C.pricePoints)==null?void 0:b[0])==null?void 0:x.currency)||jsClientSdk.Currency.Usd,{publishableKey:g}=l==null?void 0:l.billingIntegration.billingCredentials,y=ii.useCallback(S=>chunkMY4ZIUAV_cjs_js.d(null,null,function*(){var T;if(!S.success||!S.paymentMethodId){let F=((T=S.error)==null?void 0:T.message)||"Payment failed";i(F),yield t({success:false,error:F});return}yield c(S.paymentMethodId);}),[c,i,t]);return ii.useEffect(()=>(chunkMY4ZIUAV_cjs_js.d(null,null,function*(){if(!(!r||u.current)){p(true),i(void 0);try{u.current=!0;let T=window.Zuora(g),F=md(n,y,h,s);(yield T.createPaymentForm(F)).mount("#zuora_payment");}catch(T){u.current=false,i("Failed to render Zuora payment form");}finally{p(false);}}}),()=>{u.current=false;}),[r]),o?jsxRuntime.jsxs(zP,{children:[jsxRuntime.jsx(VP,{id:"zuora_payment",$showLoading:a.readOnly||f}),(a.readOnly||f)&&jsxRuntime.jsx(HP,{children:jsxRuntime.jsx(OP,{children:jsxRuntime.jsx(xh__default.default,{size:28})})})]}):null}function Od({checked:e,text:t,subtitle:o,readOnly:r}){return jsxRuntime.jsxs(Gd,{children:[jsxRuntime.jsx(YP__default.default,{checked:e,disabled:r}),jsxRuntime.jsxs(zd,{container:true,children:[jsxRuntime.jsx(Me__default.default,{item:true,children:t}),o&&jsxRuntime.jsx(Me__default.default,{item:true,children:o})]})]})}function Wd({checked:e,paymentMethodDetails:t,readOnly:o,onSelect:r}){if(!t)return null;let{last4Digits:n,expirationMonth:i,expirationYear:s}=t;return jsxRuntime.jsx(Fi,{item:true,onClick:r,$disabled:o,children:jsxRuntime.jsx(Od,{checked:e,readOnly:o,text:jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.f,{variant:"h6",children:`Card ending in ${n}`}),subtitle:!!i&&!!s&&jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.f,{variant:"body1",children:`Expires ${i.toString().padStart(2,"0")}/${s}`})})})}function Zd({hasExistingPaymentMethod:e,checked:t,onSelect:o,readOnly:r,checkoutLocalization:n,onBillingAddressChange:i,collectPhoneNumber:s,collectTaxId:l,onCheckout:a,onCheckoutCompleted:c}){let{isZuoraIntegration:u}=Ft();return jsxRuntime.jsxs($d,{item:true,$hideBorders:!e,onClick:o,$disabled:r,children:[e&&jsxRuntime.jsx(Od,{checked:t,readOnly:r,text:jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.f,{variant:"h6",children:n.newPaymentMethodText})}),jsxRuntime.jsx(yx__default.default,{in:t,children:u?jsxRuntime.jsx(Vd,{onCheckout:a,onCheckoutCompleted:c}):jsxRuntime.jsx(nd,{onBillingAddressChange:i,collectPhoneNumber:s,collectTaxId:l})})]})}var qP=chunkMY4ZIUAV_cjs_js.e(Me__default.default)`
881
752
  display: flex;
882
753
  flex-direction: column;
883
754
  gap: 24px;
884
- `;function Ly({onBillingAddressChange:e,collectPhoneNumber:t,collectTaxId:o,onCheckout:n,onCheckoutCompleted:i}){let{checkoutState:r,checkoutLocalization:a,widgetState:s}=Y(),{customer:l}=r||{},{errorMessage:c,useNewPaymentMethod:d,setUseNewPaymentMethod:u}=vt(),{readOnly:p}=s,h=m=>{p||u(m);};return jsxRuntime.jsxs(F5,{container:true,children:[!!c&&jsxRuntime.jsx(i5__default.default,{severity:"error",sx:{alignItems:"center"},children:jsxRuntime.jsx(P,{overrideColor:"inherit",children:c})}),jsxRuntime.jsx(Ey,{readOnly:p,checked:!d,paymentMethodDetails:l==null?void 0:l.paymentMethodDetails,onSelect:()=>h(false)}),jsxRuntime.jsx(Fy,{hasExistingPaymentMethod:!!(l!=null&&l.paymentMethodDetails),readOnly:p,checked:d,checkoutLocalization:a,onSelect:()=>h(true),onBillingAddressChange:e,collectPhoneNumber:t,collectTaxId:o,onCheckout:n,onCheckoutCompleted:i})]})}var za=({onClick:e,checkoutLocalization:t,size:o})=>jsxRuntime.jsx(B2__default.default,{className:"stigg-checkout-change-plan-button",sx:{textTransform:"none"},variant:"text",size:o,onClick:e,children:jsxRuntime.jsx(P,{className:"stigg-checkout-change-plan-button-text",color:"primary.main",variant:"h3",style:{lineHeight:"24px"},children:t.changePlan})});function Dy({allowChangePlan:e=false,onChangePlan:t}){let{checkoutState:o,checkoutLocalization:n}=Y(),{plan:i}=o||{};return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(Ua__default.default,{sx:{marginBottom:"16px"},children:[jsxRuntime.jsx(P,{variant:"body1",color:"disabled",style:{opacity:.6,marginBottom:"8px"},children:"Selected plan"}),jsxRuntime.jsxs(Ua__default.default,{sx:{display:"flex",justifyContent:"space-between"},children:[jsxRuntime.jsx(P,{variant:"h1",children:i==null?void 0:i.displayName}),e&&t&&jsxRuntime.jsx(za,{onClick:()=>{t({currentPlan:i});},checkoutLocalization:n,size:"medium"})]})]}),jsxRuntime.jsx(fg__default.default,{className:"stigg-checkout-plan-header-divider"})]})}function nd(e){switch(e){case ah.BillingPeriod.Annually:return "Annual";case ah.BillingPeriod.Monthly:return "Monthly";default:return ""}}var Oy=y(Ua__default.default)`
755
+ `;function Yd({onBillingAddressChange:e,collectPhoneNumber:t,collectTaxId:o,onCheckout:r,onCheckoutCompleted:n}){let{checkoutState:i,checkoutLocalization:s,widgetState:l}=U(),{customer:a}=i||{},{errorMessage:c,useNewPaymentMethod:u,setUseNewPaymentMethod:f}=re(),{readOnly:p}=l,h=g=>{p||f(g);};return jsxRuntime.jsxs(qP,{container:true,children:[!!c&&jsxRuntime.jsx(SP__default.default,{severity:"error",sx:{alignItems:"center"},children:jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.f,{overrideColor:"inherit",children:c})}),jsxRuntime.jsx(Wd,{readOnly:p,checked:!u,paymentMethodDetails:a==null?void 0:a.paymentMethodDetails,onSelect:()=>h(false)}),jsxRuntime.jsx(Zd,{hasExistingPaymentMethod:!!(a!=null&&a.paymentMethodDetails),readOnly:p,checked:u,checkoutLocalization:s,onSelect:()=>h(true),onBillingAddressChange:e,collectPhoneNumber:t,collectTaxId:o,onCheckout:r,onCheckoutCompleted:n})]})}var Ir=({onClick:e,checkoutLocalization:t,size:o})=>jsxRuntime.jsx(Ym__default.default,{className:"stigg-checkout-change-plan-button",sx:{textTransform:"none"},variant:"text",size:o,onClick:e,children:jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.f,{className:"stigg-checkout-change-plan-button-text",color:"primary.main",variant:"h3",style:{lineHeight:"24px"},children:t.changePlan})});function qd({allowChangePlan:e=false,onChangePlan:t}){let{checkoutState:o,checkoutLocalization:r}=U(),{plan:n}=o||{};return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(ke__default.default,{sx:{marginBottom:"16px"},children:[jsxRuntime.jsx(chunkMY4ZIUAV_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(chunkMY4ZIUAV_cjs_js.f,{variant:"h1",children:n==null?void 0:n.displayName}),e&&t&&jsxRuntime.jsx(Ir,{onClick:()=>{t({currentPlan:n});},checkoutLocalization:r,size:"medium"})]})]}),jsxRuntime.jsx(xl__default.default,{className:"stigg-checkout-plan-header-divider"})]})}function Li(e){switch(e){case jsClientSdk.BillingPeriod.Annually:return "Annual";case jsClientSdk.BillingPeriod.Monthly:return "Monthly";default:return ""}}var jd=chunkMY4ZIUAV_cjs_js.e(ke__default.default)`
885
756
  margin: 16px 0;
886
- `,zy=y.button`
757
+ `,ep=chunkMY4ZIUAV_cjs_js.e.button`
887
758
  cursor: ${({$disabled:e,$isOnlyBillingPeriod:t})=>e||t?"default":"pointer"};
888
759
  flex: 1;
889
760
  display: flex;
@@ -891,8 +762,8 @@
891
762
  justify-content: flex-start;
892
763
  padding: 2px 8px;
893
764
  border-radius: 10px;
894
- border: ${({theme:e,$isActive:t,$isOnlyBillingPeriod:o})=>{let n=e.stigg.palette.outlinedBorder;return o?n="transparent":t&&(n=e.stigg.palette.outlinedRestingBorder),`1px solid ${n}`}};
895
- background: ${({theme:e,$isActive:t,$isOnlyBillingPeriod:o})=>o?"transparent":t?Do__default.default(e.stigg.palette.primary).alpha(.15).toString():"transparent"};
765
+ border: ${({theme:e,$isActive:t,$isOnlyBillingPeriod:o})=>{let r=e.stigg.palette.outlinedBorder;return o?r="transparent":t&&(r=e.stigg.palette.outlinedRestingBorder),`1px solid ${r}`}};
766
+ background: ${({theme:e,$isActive:t,$isOnlyBillingPeriod:o})=>o?"transparent":t?bi__default.default(e.stigg.palette.primary).alpha(.15).toString():"transparent"};
896
767
  text-transform: none;
897
768
  text-align: start;
898
769
  height: 36px;
@@ -903,62 +774,62 @@
903
774
  background: none;
904
775
  }
905
776
  }
906
- `,Vy=y(Ua__default.default)`
777
+ `,tp=chunkMY4ZIUAV_cjs_js.e(ke__default.default)`
907
778
  display: flex;
908
779
  gap: 16px;
909
780
  margin-top: 16px;
910
- `;y.div`
781
+ `;chunkMY4ZIUAV_cjs_js.e.div`
911
782
  display: flex;
912
783
  align-items: baseline;
913
784
  gap: 8px;
914
- `;y(N5__default.default)`
785
+ `;chunkMY4ZIUAV_cjs_js.e(tb__default.default)`
915
786
  & .MuiChip-label {
916
787
  font-size: 12px;
917
788
  }
918
- `;var $y=({billingPeriod:e,isOnlyBillingPeriod:t})=>{let{billingPeriod:o,setBillingPeriod:n}=te(),i=o===e;return jsxRuntime.jsxs(zy,{onClick:()=>n(e),$isActive:i,$isOnlyBillingPeriod:t,children:[jsxRuntime.jsx(M5__default.default,{checked:i,onChange:()=>n(e),value:e,disabled:t,inputProps:{"aria-label":nd(e)},sx:{padding:0,marginRight:"8px"}}),jsxRuntime.jsx(Ua__default.default,{children:jsxRuntime.jsx(P,{variant:"h3",color:"primary",children:nd(e)})})]})};function Hy({plan:e,checkoutLocalization:t}){let[o,n]=lodash.partition(e==null?void 0:e.pricePoints,r=>r.billingPeriod===ah.BillingPeriod.Monthly),i=!!(o!=null&&o.length)&&!!(n!=null&&n.length);return i?jsxRuntime.jsxs(Oy,{children:[jsxRuntime.jsx(P,{variant:"h6",color:"primary",children:t.billingPeriodsTitle}),jsxRuntime.jsxs(Vy,{children:[!!(o!=null&&o.length)&&jsxRuntime.jsx($y,{billingPeriod:ah.BillingPeriod.Monthly,isOnlyBillingPeriod:!i},ah.BillingPeriod.Monthly),!!(n!=null&&n.length)&&jsxRuntime.jsx($y,{billingPeriod:ah.BillingPeriod.Annually,isOnlyBillingPeriod:!i},ah.BillingPeriod.Annually)]})]}):null}var G5=y.div`
789
+ `;var op=({billingPeriod:e,isOnlyBillingPeriod:t})=>{let{billingPeriod:o,setBillingPeriod:r}=Pe(),n=o===e;return jsxRuntime.jsxs(ep,{onClick:()=>r(e),$isActive:n,$isOnlyBillingPeriod:t,children:[jsxRuntime.jsx(YP__default.default,{checked:n,onChange:()=>r(e),value:e,disabled:t,inputProps:{"aria-label":Li(e)},sx:{padding:0,marginRight:"8px"}}),jsxRuntime.jsx(ke__default.default,{children:jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.f,{variant:"h3",color:"primary",children:Li(e)})})]})};function rp({plan:e,checkoutLocalization:t}){let[o,r]=hP__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(jd,{children:[jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.f,{variant:"h6",color:"primary",children:t.billingPeriodsTitle}),jsxRuntime.jsxs(tp,{children:[!!(o!=null&&o.length)&&jsxRuntime.jsx(op,{billingPeriod:jsClientSdk.BillingPeriod.Monthly,isOnlyBillingPeriod:!n},jsClientSdk.BillingPeriod.Monthly),!!(r!=null&&r.length)&&jsxRuntime.jsx(op,{billingPeriod:jsClientSdk.BillingPeriod.Annually,isOnlyBillingPeriod:!n},jsClientSdk.BillingPeriod.Annually)]})]}):null}var cb=chunkMY4ZIUAV_cjs_js.e.div`
919
790
  display: flex;
920
791
  min-height: 60px;
921
792
  margin-top: 16px;
922
793
  flex-direction: column;
923
794
 
924
- ${wt.md} {
795
+ ${oe.md} {
925
796
  flex-direction: row;
926
797
  align-items: flex-start;
927
798
  justify-content: space-between;
928
799
  }
929
- `,j5=y(Ua__default.default)`
800
+ `,db=chunkMY4ZIUAV_cjs_js.e(ke__default.default)`
930
801
  display: flex;
931
802
  flex-direction: column;
932
803
  justify-content: center;
933
804
  width: 100%;
934
805
  height: 42px;
935
- `,Y5=y(P)`
806
+ `,pb=chunkMY4ZIUAV_cjs_js.e(chunkMY4ZIUAV_cjs_js.f)`
936
807
  display: flex;
937
808
  align-items: center;
938
809
  justify-content: flex-end;
939
810
  width: 100%;
940
811
  min-height: 42px;
941
- `,Z5=(e,t)=>{let{minUnitQuantity:o,maxUnitQuantity:n}=e;return !t||t<(o||1)?`Minimum ${o||1}`:n&&t>n?`Maximum ${n}`:""};function X5({charge:e,setBillableFeature:t,billableFeature:o,onValidationChange:n,onBillableFeatureChange:i}){var m,g,f,x,b,T;let[r,a]=Fc.useState(void 0),s=(m=e.feature)==null?void 0:m.featureId,l=!s,c=e.pricingModel===ah.BillingModel.UsageBased,d=l?"Base charge":vn(((g=e.feature)==null?void 0:g.displayName)||"",(f=e.feature)==null?void 0:f.units,(x=e.feature)==null?void 0:x.unitsPlural),u=!!(e!=null&&e.minUnitQuantity||e!=null&&e.maxUnitQuantity),p=k=>R(null,null,function*(){var F,E;if(l||!s)return;let{minUnitQuantity:w,maxUnitQuantity:v}=e,_=(F=k==null?void 0:k.target)!=null&&F.value?Number((E=k==null?void 0:k.target)==null?void 0:E.value):null;if(!_||_<=0||w&&_<w||v&&_>v){n({featureId:s,isValid:false}),a(Z5(e,_!=null?_:void 0)),t(s,_!=null?_:null);return}let M=ga(e,_),I=yield i==null?void 0:i({feature:e.feature,quantity:M});a(I==null?void 0:I.errorMessage),n({featureId:s,isValid:!(I!=null&&I.disableNextStep)}),t(s,M);}),h;if(l||c)h=`${at({amount:e.amount,currency:e.currency,locale:"en-us",minimumFractionDigits:2})}`,c&&(h+=" / unit");else if(e.isTieredPrice&&e.tiersMode&&s){let k=(o==null?void 0:o.quantity)||1;h=jsxRuntime.jsx(Er,{componentId:`${s}-tiers`,tiers:e.tiers,tiersMode:e.tiersMode,value:k,errorMessage:r,handleChange:w=>R(null,null,function*(){let v=yield i==null?void 0:i({feature:e.feature,quantity:w});a(v==null?void 0:v.errorMessage),n({featureId:s,isValid:!(v!=null&&v.disableNextStep)}),t(s,w);}),width:"100%"});}else h=jsxRuntime.jsx(Rt,{sx:{width:"100%"},id:`${s}-input`,type:"number",onWheel:Pn,error:!!r,helperText:r,FormHelperTextProps:{sx:{margin:"4px"}},value:(b=o==null?void 0:o.quantity)!=null?b:"",onChange:p});return jsxRuntime.jsxs(G5,{children:[jsxRuntime.jsxs(j5,{children:[jsxRuntime.jsx(P,{variant:"h6",color:"primary",lineHeight:"24px",children:d}),u&&jsxRuntime.jsx(P,{variant:"body1",color:"secondary",lineHeight:"20px",children:Cr(e.minUnitQuantity,e.maxUnitQuantity,(T=e.feature)==null?void 0:T.unitsPlural)})]}),jsxRuntime.jsx(Y5,{variant:"h6",color:"primary",children:h})]})}function jy({plan:e,billingPeriod:t,onBillableFeatureChange:o}){var d;let{billableFeatures:n,setBillableFeature:i}=te(),{setIsDisabled:r}=ke(),{setIsValid:a}=Y(),s=xa(((d=e==null?void 0:e.pricePoints)==null?void 0:d.filter(u=>u.billingPeriod===t))||[]),[l,c]=Fc.useState(s==null?void 0:s.reduce((u,p)=>{var h;return u[((h=p.feature)==null?void 0:h.featureId)||"base-charge"]=true,u},{}));return Fc.useEffect(()=>{let u=Object.values(l).some(p=>!p);r(u),a(!u);},[l,r,a]),jsxRuntime.jsx(jsxRuntime.Fragment,{children:s==null?void 0:s.map(u=>{var h;let p=n.find(m=>{var g;return m.featureId===((g=u.feature)==null?void 0:g.featureId)});return jsxRuntime.jsx(X5,{charge:u,setBillableFeature:i,billableFeature:p,onValidationChange:({featureId:m,isValid:g})=>c(f=>A(S({},f),{[m]:g})),onBillableFeatureChange:o},((h=u.feature)==null?void 0:h.featureId)||"base-charge")})})}var Yy=y(Ua__default.default)`
812
+ `,mb=(e,t)=>{let{minUnitQuantity:o,maxUnitQuantity:r}=e;return !t||t<(o||1)?`Minimum ${o||1}`:r&&t>r?`Maximum ${r}`:""};function ub({charge:e,setBillableFeature:t,billableFeature:o,onValidationChange:r,onBillableFeatureChange:n}){var g,y,C,b,x,S;let[i,s]=ii.useState(void 0),l=(g=e.feature)==null?void 0:g.featureId,a=!l,c=e.pricingModel===jsClientSdk.BillingModel.UsageBased,u=a?"Base charge":Tt(((y=e.feature)==null?void 0:y.displayName)||"",(C=e.feature)==null?void 0:C.units,(b=e.feature)==null?void 0:b.unitsPlural),f=!!(e!=null&&e.minUnitQuantity||e!=null&&e.maxUnitQuantity),p=T=>chunkMY4ZIUAV_cjs_js.d(null,null,function*(){var E,A;if(a||!l)return;let{minUnitQuantity:F,maxUnitQuantity:w}=e,I=(E=T==null?void 0:T.target)!=null&&E.value?Number((A=T==null?void 0:T.target)==null?void 0:A.value):null;if(!I||I<=0||F&&I<F||w&&I>w){r({featureId:l,isValid:false}),s(mb(e,I!=null?I:void 0)),t(l,I!=null?I:null);return}let k=sr(e,I),L=yield n==null?void 0:n({feature:e.feature,quantity:k});s(L==null?void 0:L.errorMessage),r({featureId:l,isValid:!(L!=null&&L.disableNextStep)}),t(l,k);}),h;if(a||c)h=`${H({amount:e.amount,currency:e.currency,locale:"en-us",minimumFractionDigits:2})}`,c&&(h+=" / unit");else if(e.isTieredPrice&&e.tiersMode&&l){let T=(o==null?void 0:o.quantity)||1;h=jsxRuntime.jsx(To,{componentId:`${l}-tiers`,tiers:e.tiers,tiersMode:e.tiersMode,value:T,errorMessage:i,handleChange:F=>chunkMY4ZIUAV_cjs_js.d(null,null,function*(){let w=yield n==null?void 0:n({feature:e.feature,quantity:F});s(w==null?void 0:w.errorMessage),r({featureId:l,isValid:!(w!=null&&w.disableNextStep)}),t(l,F);}),width:"100%"});}else h=jsxRuntime.jsx(ce,{sx:{width:"100%"},id:`${l}-input`,type:"number",onWheel:Ct,error:!!i,helperText:i,FormHelperTextProps:{sx:{margin:"4px"}},value:(x=o==null?void 0:o.quantity)!=null?x:"",onChange:p});return jsxRuntime.jsxs(cb,{children:[jsxRuntime.jsxs(db,{children:[jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.f,{variant:"h6",color:"primary",lineHeight:"24px",children:u}),f&&jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.f,{variant:"body1",color:"secondary",lineHeight:"20px",children:go(e.minUnitQuantity,e.maxUnitQuantity,(S=e.feature)==null?void 0:S.unitsPlural)})]}),jsxRuntime.jsx(pb,{variant:"h6",color:"primary",children:h})]})}function ap({plan:e,billingPeriod:t,onBillableFeatureChange:o}){var u;let{billableFeatures:r,setBillableFeature:n}=Pe(),{setIsDisabled:i}=Ue(),{setIsValid:s}=U(),l=dr(((u=e==null?void 0:e.pricePoints)==null?void 0:u.filter(f=>f.billingPeriod===t))||[]),[a,c]=ii.useState(l==null?void 0:l.reduce((f,p)=>{var h;return f[((h=p.feature)==null?void 0:h.featureId)||"base-charge"]=true,f},{}));return ii.useEffect(()=>{let f=Object.values(a).some(p=>!p);i(f),s(!f);},[a,i,s]),jsxRuntime.jsx(jsxRuntime.Fragment,{children:l==null?void 0:l.map(f=>{var h;let p=r.find(g=>{var y;return g.featureId===((y=f.feature)==null?void 0:y.featureId)});return jsxRuntime.jsx(ub,{charge:f,setBillableFeature:n,billableFeature:p,onValidationChange:({featureId:g,isValid:y})=>c(C=>chunkMY4ZIUAV_cjs_js.b(chunkMY4ZIUAV_cjs_js.a({},C),{[g]:y})),onBillableFeatureChange:o},((h=f.feature)==null?void 0:h.featureId)||"base-charge")})})}var sp=chunkMY4ZIUAV_cjs_js.e(ke__default.default)`
942
813
  width: 100%;
943
- `;var Xy=({onChangePlan:e,onBillableFeatureChange:t})=>{let{checkoutState:o,checkoutLocalization:n}=Y(),{plan:i}=o||{},{billingPeriod:r}=te();return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Dy,{allowChangePlan:true,onChangePlan:e}),jsxRuntime.jsxs(Yy,{children:[jsxRuntime.jsx(Hy,{plan:i,checkoutLocalization:n}),jsxRuntime.jsx(jy,{plan:i,billingPeriod:r,onBillableFeatureChange:t})]})]})};var J5=e=>jsxRuntime.jsx("svg",A(S({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"})]})})),Ky=J5;var qy=y(Ky)`
814
+ `;var cp=({onChangePlan:e,onBillableFeatureChange:t})=>{let{checkoutState:o,checkoutLocalization:r}=U(),{plan:n}=o||{},{billingPeriod:i}=Pe();return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(qd,{allowChangePlan:true,onChangePlan:e}),jsxRuntime.jsxs(sp,{children:[jsxRuntime.jsx(rp,{plan:n,checkoutLocalization:r}),jsxRuntime.jsx(ap,{plan:n,billingPeriod:i,onBillableFeatureChange:t})]})]})};var hb=e=>jsxRuntime.jsx("svg",chunkMY4ZIUAV_cjs_js.b(chunkMY4ZIUAV_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"})]})})),dp=hb;var pp=chunkMY4ZIUAV_cjs_js.e(dp)`
944
815
  path {
945
816
  stroke: ${({theme:e})=>e.stigg.palette.text.secondary};
946
817
  }
947
- `;var ov=y(Ua__default.default)`
818
+ `;var Pb=chunkMY4ZIUAV_cjs_js.e(ke__default.default)`
948
819
  display: flex;
949
- `,nv=y(i5__default.default)`
820
+ `,bb=chunkMY4ZIUAV_cjs_js.e(SP__default.default)`
950
821
  margin-bottom: 16px;
951
- `,iv=y(Ua__default.default)`
822
+ `,Sb=chunkMY4ZIUAV_cjs_js.e(ke__default.default)`
952
823
  padding: 16px;
953
824
  border-radius: 10px;
954
825
  width: 100%;
955
826
  border: ${({theme:e})=>`1px solid ${e.stigg.palette.outlinedBorder}`};
956
- `,Qy=({headerText:e,planName:t,priceText:o})=>jsxRuntime.jsxs(iv,{className:"stigg-checkout-downgrade-to-free-container",children:[jsxRuntime.jsx(P,{className:"stigg-checkout-downgrade-to-free-text-header",style:{opacity:.8},variant:"caption",color:"disabled",children:e}),jsxRuntime.jsx(P,{className:"stigg-checkout-downgrade-to-free-plan-name",bold:true,variant:"h3",color:"primary",children:t}),jsxRuntime.jsx(P,{className:"stigg-checkout-downgrade-to-free-price-text",color:"secondary",children:o})]}),t1=({checkoutLocalization:e,activeSubscription:t,freePlan:o,allowChangePlan:n=false,onChangePlan:i})=>{let r;n&&i&&(r=jsxRuntime.jsx(za,{onClick:()=>{i({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(nv,{action:r,className:"stigg-checkout-downgrade-to-free-alert",severity:"info",children:jsxRuntime.jsx(P,{as:"span",color:"secondary",children:e.downgradeToFree.alertText({plan:t.plan})})}),jsxRuntime.jsxs(ov,{className:"stigg-checkout-downgrade-to-free-plans-container",children:[jsxRuntime.jsx(Qy,{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(qy,{className:"stigg-checkout-downgrade-to-free-arrow",style:{margin:"auto 16px",minWidth:"16px"}}),jsxRuntime.jsx(Qy,{headerText:e.downgradeToFree.freePlanHeader({plan:o}),planName:e.downgradeToFree.freePlanName({plan:o}),priceText:e.downgradeToFree.freePlanPriceText({plan:o})})]})]})};var lv=(e,{onBillingAddressChange:t,onChangePlan:o,onBillableFeatureChange:n,onAddonChange:i,collectPhoneNumber:r,collectTaxId:a,onCheckout:s,onCheckoutCompleted:l})=>{switch(e.key){case "PLAN":return {content:jsxRuntime.jsx(Xy,{onChangePlan:o,onBillableFeatureChange:n})};case "ADDONS":return {content:jsxRuntime.jsx(ky,{onAddonChange:i})};case "PAYMENT":return {content:jsxRuntime.jsx(Ly,{onBillingAddressChange:t,collectPhoneNumber:r,collectTaxId:a,onCheckout:s,onCheckoutCompleted:l})};default:return {content:null}}};function i1({onCheckout:e,onCheckoutCompleted:t,onChangePlan:o,onBillingAddressChange:n,onBillableFeatureChange:i,onAddonChange:r,collectPhoneNumber:a,collectTaxId:s,disablePromotionCode:l,disableSuccessAnimation:c,onMockCheckoutPreview:d}){let{stripePromise:u,setupIntentClientSecret:p}=Vf(),[{stiggTheme:h,widgetState:m,theme:g,showWatermark:f}]=j(),{currentStep:x}=ke(),{isLoadingCheckoutData:b}=m,{checkoutState:T,checkoutLocalization:k}=Y(),{plan:w,activeSubscription:v}=T||{},_=!!w&&w.pricingType===ah.PricingType.Free&&!!v&&v.pricingType!==ah.PricingType.Free,{content:M}=lv(x,{onBillingAddressChange:n,onChangePlan:o,onBillableFeatureChange:i,onAddonChange:r,collectPhoneNumber:a,collectTaxId:s,onCheckout:e,onCheckoutCompleted:t}),I=jsxRuntime.jsx(jsxRuntime.Fragment,{children:_?jsxRuntime.jsx(t1,{freePlan:w,activeSubscription:v,allowChangePlan:true,checkoutLocalization:k,onChangePlan:o}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:M})}),F=Fc.useMemo(()=>p?{clientSecret:p}:{mode:"setup",currency:"usd"},[p]);return jsxRuntime.jsx(reactStripeJs.Elements,{stripe:u,options:A(S({},F),{appearance:{theme:"stripe",variables:{colorText:h.palette.text.primary,colorPrimaryText:h.palette.text.primary,colorTextPlaceholder:h.palette.text.disabled,fontFamily:h.typography.fontFamily,colorBackground:g==null?void 0:g.paymentInputBackgroundColor,borderRadius:g==null?void 0:g.paymentInputBorderRadius},rules:g!=null&&g.paymentInputBorderColor?{".Input":{borderColor:g==null?void 0:g.paymentInputBorderColor}}:void 0}}),children:jsxRuntime.jsxs(Cf,{className:"stigg-checkout-layout",children:[!_&&jsxRuntime.jsx(Af,{}),jsxRuntime.jsxs(Pf,{children:[jsxRuntime.jsx(Sf,{children:b?jsxRuntime.jsx(vm,{}):I}),b?jsxRuntime.jsx(hy,{showWatermark:f}):jsxRuntime.jsx(my,{disablePromotionCode:l,disableSuccessAnimation:c,onCheckout:e,onCheckoutCompleted:t,isFreeDowngrade:_,onMockCheckoutPreview:d,showWatermark:f})]})]})},p)}var a1=p=>{var h=p,{textOverrides:e,theme:t,resourceId:o,planId:n,preferredBillingPeriod:i,billingCountryCode:r,billableFeatures:a,billingInformation:s,onMockCheckoutState:l,skipCheckoutSteps:c,onBeforeStepChange:d}=h,u=ot(h,["textOverrides","theme","resourceId","planId","preferredBillingPeriod","billingCountryCode","billableFeatures","billingInformation","onMockCheckoutState","skipCheckoutSteps","onBeforeStepChange"]);return jsxRuntime.jsx(yf,{textOverrides:e,theme:t,resourceId:o,planId:n,preferredBillingPeriod:i,billingCountryCode:r,billableFeatures:a,billingInformation:s,onMockCheckoutState:l,skipCheckoutSteps:c,onBeforeStepChange:d,children:jsxRuntime.jsx(i1,S({},u))})};function uv(e){return Fc.useMemo(()=>{let t=new URLSearchParams(window.location.search);return t.get(e)},[e,window.location.search])}var ld=(n=>(n.IN_PROGRESS="IN_PROGRESS",n.SUCCEEDED="SUCCEEDED",n.FAILED="FAILED",n))(ld||{}),l1=({onProvisionStart:e,onProvisionSucceeded:t,onProvisionFailed:o}={})=>{let{stigg:n}=D(),[i,r]=Fc.useState("IN_PROGRESS"),[a,s]=Fc.useState(false),l=uv("checkoutCompleted");return Fc.useEffect(()=>{R(null,null,function*(){if(!(!l||l.toLowerCase()==="false"||a)){s(true),e&&e();try{let d=yield n.waitForCheckoutCompleted();r("SUCCEEDED"),t&&t(d);}catch(d){console.error("Failed to wait for checkout to complete",d),r("FAILED"),o&&o(d);}finally{s(false);}}});},[n,l]),{isAwaitingCheckout:a,provisionStatus:i}};function pv(n){var i=n,{noAccessComponent:e,children:t}=i,o=ot(i,["noAccessComponent","children"]);let{hasAccess:r}=ka(o);return r?t:jsxRuntime.jsx(jsxRuntime.Fragment,{children:e!=null?e:null})}function gv(n){var i=n,{noAccessComponent:e,children:t}=i,o=ot(i,["noAccessComponent","children"]);let{hasAccess:r}=wa(o);return r?t:jsxRuntime.jsx(jsxRuntime.Fragment,{children:e!=null?e:null})}function xv(n){var i=n,{noAccessComponent:e,children:t}=i,o=ot(i,["noAccessComponent","children"]);let{hasAccess:r}=va(o);return r?t:jsxRuntime.jsx(jsxRuntime.Fragment,{children:e!=null?e:null})}function Pv(n){var i=n,{noAccessComponent:e,children:t}=i,o=ot(i,["noAccessComponent","children"]);let{hasAccess:r}=_a(o);return r?t:jsxRuntime.jsx(jsxRuntime.Fragment,{children:e!=null?e:null})}function po(e){let t=D(),o=t==null?void 0:t.stigg,n=t==null?void 0:t.updatedAt,i=Fc.useCallback(()=>R(null,null,function*(){if(!o||!o.isCustomerLoaded)return null;try{let l={currencyId:e.currencyId},[c,d]=yield Promise.allSettled([o.getCreditBalance(l),o.getCreditEntitlement({currencyId:e.currencyId})]);if(c.status==="rejected")throw c.reason;let u=c.value,p=d.status==="fulfilled"?d.value:null;if(u.balances&&u.balances.length>0){let{currentBalance:h,totalConsumed:m,totalGranted:g,currency:{currencyId:f,displayName:x,units:b,symbol:T}}=u.balances[0];return {currentBalance:h,totalConsumed:m,totalGranted:g,currencyId:f,displayName:x,units:b,symbol:T,usagePeriodEnd:p!=null&&p.usagePeriodEnd?new Date(p.usagePeriodEnd):void 0}}return {currencyId:e.currencyId,currentBalance:0,totalConsumed:0,totalGranted:0,usagePeriodEnd:p!=null&&p.usagePeriodEnd?new Date(p.usagePeriodEnd):void 0}}catch(l){throw console.error(l),l}}),[o,e.currencyId,n]),{data:r,error:a,isLoading:s}=Ut({func:i});return Fc.useMemo(()=>({balance:r,isLoading:s,error:a}),[r,a,s])}var Bn=y.div`
827
+ `,mp=({headerText:e,planName:t,priceText:o})=>jsxRuntime.jsxs(Sb,{className:"stigg-checkout-downgrade-to-free-container",children:[jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.f,{className:"stigg-checkout-downgrade-to-free-text-header",style:{opacity:.8},variant:"caption",color:"disabled",children:e}),jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.f,{className:"stigg-checkout-downgrade-to-free-plan-name",bold:true,variant:"h3",color:"primary",children:t}),jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.f,{className:"stigg-checkout-downgrade-to-free-price-text",color:"secondary",children:o})]}),gp=({checkoutLocalization:e,activeSubscription:t,freePlan:o,allowChangePlan:r=false,onChangePlan:n})=>{let i;r&&n&&(i=jsxRuntime.jsx(Ir,{onClick:()=>{n({currentPlan:o});},checkoutLocalization:e,size:"small"}));let s=t.prices.length>0?t.prices[0].billingPeriod:void 0;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(bb,{action:i,className:"stigg-checkout-downgrade-to-free-alert",severity:"info",children:jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.f,{as:"span",color:"secondary",children:e.downgradeToFree.alertText({plan:t.plan})})}),jsxRuntime.jsxs(Pb,{className:"stigg-checkout-downgrade-to-free-plans-container",children:[jsxRuntime.jsx(mp,{headerText:e.downgradeToFree.paidPlanHeader({plan:t.plan}),planName:e.downgradeToFree.paidPlanName({plan:t.plan}),priceText:e.downgradeToFree.paidPlanPriceText({plan:t.plan,billingPeriod:s})}),jsxRuntime.jsx(pp,{className:"stigg-checkout-downgrade-to-free-arrow",style:{margin:"auto 16px",minWidth:"16px"}}),jsxRuntime.jsx(mp,{headerText:e.downgradeToFree.freePlanHeader({plan:o}),planName:e.downgradeToFree.freePlanName({plan:o}),priceText:e.downgradeToFree.freePlanPriceText({plan:o})})]})]})};var Bb=(e,{onBillingAddressChange:t,onChangePlan:o,onBillableFeatureChange:r,onAddonChange:n,collectPhoneNumber:i,collectTaxId:s,onCheckout:l,onCheckoutCompleted:a})=>{switch(e.key){case "PLAN":return {content:jsxRuntime.jsx(cp,{onChangePlan:o,onBillableFeatureChange:r})};case "ADDONS":return {content:jsxRuntime.jsx(Dd,{onAddonChange:n})};case "PAYMENT":return {content:jsxRuntime.jsx(Yd,{onBillingAddressChange:t,collectPhoneNumber:i,collectTaxId:s,onCheckout:l,onCheckoutCompleted:a})};default:return {content:null}}};function Cp({onCheckout:e,onCheckoutCompleted:t,onChangePlan:o,onBillingAddressChange:r,onBillableFeatureChange:n,onAddonChange:i,collectPhoneNumber:s,collectTaxId:l,disablePromotionCode:a,disableSuccessAnimation:c,onMockCheckoutPreview:u}){let{stripePromise:f,setupIntentClientSecret:p}=id(),[{stiggTheme:h,widgetState:g,theme:y,showWatermark:C}]=R(),{currentStep:b}=Ue(),{isLoadingCheckoutData:x}=g,{checkoutState:S,checkoutLocalization:T}=U(),{plan:F,activeSubscription:w}=S||{},I=!!F&&F.pricingType===jsClientSdk.PricingType.Free&&!!w&&w.pricingType!==jsClientSdk.PricingType.Free,{content:k}=Bb(b,{onBillingAddressChange:r,onChangePlan:o,onBillableFeatureChange:n,onAddonChange:i,collectPhoneNumber:s,collectTaxId:l,onCheckout:e,onCheckoutCompleted:t}),L=jsxRuntime.jsx(jsxRuntime.Fragment,{children:I?jsxRuntime.jsx(gp,{freePlan:F,activeSubscription:w,allowChangePlan:true,checkoutLocalization:T,onChangePlan:o}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:k})}),E=ii.useMemo(()=>p?{clientSecret:p}:{mode:"setup",currency:"usd"},[p]);return jsxRuntime.jsx(reactStripeJs.Elements,{stripe:f,options:chunkMY4ZIUAV_cjs_js.b(chunkMY4ZIUAV_cjs_js.a({},E),{appearance:{theme:"stripe",variables:{colorText:h.palette.text.primary,colorPrimaryText:h.palette.text.primary,colorTextPlaceholder:h.palette.text.disabled,fontFamily:h.typography.fontFamily,colorBackground:y==null?void 0:y.paymentInputBackgroundColor,borderRadius:y==null?void 0:y.paymentInputBorderRadius},rules:y!=null&&y.paymentInputBorderColor?{".Input":{borderColor:y==null?void 0:y.paymentInputBorderColor}}:void 0}}),children:jsxRuntime.jsxs(Sc,{className:"stigg-checkout-layout",children:[!I&&jsxRuntime.jsx(vc,{}),jsxRuntime.jsxs(Tc,{children:[jsxRuntime.jsx(kc,{children:x?jsxRuntime.jsx($a,{}):L}),x?jsxRuntime.jsx(Id,{showWatermark:C}):jsxRuntime.jsx(Ad,{disablePromotionCode:a,disableSuccessAnimation:c,onCheckout:e,onCheckoutCompleted:t,isFreeDowngrade:I,onMockCheckoutPreview:u,showWatermark:C})]})]})},p)}var Pp=p=>{var h=p,{textOverrides:e,theme:t,resourceId:o,planId:r,preferredBillingPeriod:n,billingCountryCode:i,billableFeatures:s,billingInformation:l,onMockCheckoutState:a,skipCheckoutSteps:c,onBeforeStepChange:u}=h,f=chunkMY4ZIUAV_cjs_js.c(h,["textOverrides","theme","resourceId","planId","preferredBillingPeriod","billingCountryCode","billableFeatures","billingInformation","onMockCheckoutState","skipCheckoutSteps","onBeforeStepChange"]);return jsxRuntime.jsx(xc,{textOverrides:e,theme:t,resourceId:o,planId:r,preferredBillingPeriod:n,billingCountryCode:i,billableFeatures:s,billingInformation:l,onMockCheckoutState:a,skipCheckoutSteps:c,onBeforeStepChange:u,children:jsxRuntime.jsx(Cp,chunkMY4ZIUAV_cjs_js.a({},f))})};function Fb(e){return ii.useMemo(()=>{let t=new URLSearchParams(window.location.search);return t.get(e)},[e,window.location.search])}var _i=(r=>(r.IN_PROGRESS="IN_PROGRESS",r.SUCCEEDED="SUCCEEDED",r.FAILED="FAILED",r))(_i||{}),Sp=({onProvisionStart:e,onProvisionSucceeded:t,onProvisionFailed:o}={})=>{let{stigg:r}=chunkMY4ZIUAV_cjs_js.u(),[n,i]=ii.useState("IN_PROGRESS"),[s,l]=ii.useState(false),a=Fb("checkoutCompleted");return ii.useEffect(()=>{chunkMY4ZIUAV_cjs_js.d(null,null,function*(){if(!(!a||a.toLowerCase()==="false"||s)){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,a]),{isAwaitingCheckout:s,provisionStatus:n}};function vb(r){var n=r,{noAccessComponent:e,children:t}=n,o=chunkMY4ZIUAV_cjs_js.c(n,["noAccessComponent","children"]);let{hasAccess:i}=chunkMY4ZIUAV_cjs_js.x(o);return i?t:jsxRuntime.jsx(jsxRuntime.Fragment,{children:e!=null?e:null})}function Nb(r){var n=r,{noAccessComponent:e,children:t}=n,o=chunkMY4ZIUAV_cjs_js.c(n,["noAccessComponent","children"]);let{hasAccess:i}=chunkMY4ZIUAV_cjs_js.y(o);return i?t:jsxRuntime.jsx(jsxRuntime.Fragment,{children:e!=null?e:null})}function Ub(r){var n=r,{noAccessComponent:e,children:t}=n,o=chunkMY4ZIUAV_cjs_js.c(n,["noAccessComponent","children"]);let{hasAccess:i}=chunkMY4ZIUAV_cjs_js.z(o);return i?t:jsxRuntime.jsx(jsxRuntime.Fragment,{children:e!=null?e:null})}function $b(r){var n=r,{noAccessComponent:e,children:t}=n,o=chunkMY4ZIUAV_cjs_js.c(n,["noAccessComponent","children"]);let{hasAccess:i}=chunkMY4ZIUAV_cjs_js.A(o);return i?t:jsxRuntime.jsx(jsxRuntime.Fragment,{children:e!=null?e:null})}function et(e){let t=chunkMY4ZIUAV_cjs_js.u(),o=t==null?void 0:t.stigg,r=t==null?void 0:t.updatedAt,n=ii.useCallback(()=>chunkMY4ZIUAV_cjs_js.d(null,null,function*(){if(!o||!o.isCustomerLoaded)return null;try{let a={currencyId:e.currencyId},[c,u]=yield Promise.allSettled([o.getCreditBalance(a),o.getCreditEntitlement({currencyId:e.currencyId})]);if(c.status==="rejected")throw c.reason;let f=c.value,p=u.status==="fulfilled"?u.value:null;if(f.balances&&f.balances.length>0){let{currentBalance:h,totalConsumed:g,totalGranted:y,currency:{currencyId:C,displayName:b,units:x,symbol:S}}=f.balances[0];return {currentBalance:h,totalConsumed:g,totalGranted:y,currencyId:C,displayName:b,units:x,symbol:S,usagePeriodEnd:p!=null&&p.usagePeriodEnd?new Date(p.usagePeriodEnd):void 0}}return {currencyId:e.currencyId,currentBalance:0,totalConsumed:0,totalGranted:0,usagePeriodEnd:p!=null&&p.usagePeriodEnd?new Date(p.usagePeriodEnd):void 0}}catch(a){throw console.error(a),a}}),[o,e.currencyId,r]),{data:i,error:s,isLoading:l}=chunkMY4ZIUAV_cjs_js.B({func:n});return ii.useMemo(()=>({balance:i,isLoading:l,error:s}),[i,s,l])}var Lt=chunkMY4ZIUAV_cjs_js.e.div`
957
828
  display: flex;
958
829
  align-items: center;
959
830
  justify-content: space-between;
960
831
  width: 100%;
961
- `;var Rn=y.button`
832
+ `;var Nt=chunkMY4ZIUAV_cjs_js.e.button`
962
833
  display: flex;
963
834
  align-items: center;
964
835
  gap: 4px;
@@ -973,7 +844,7 @@
973
844
  font-size: 14px;
974
845
  font-weight: 400;
975
846
  letter-spacing: 0.15px;
976
- color: ${({theme:e})=>{var t,o,n;return (n=(o=(t=e.stigg)==null?void 0:t.palette)==null?void 0:o.text)==null?void 0:n.primary}};
847
+ 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.primary}};
977
848
  transition: background-color 0.2s;
978
849
 
979
850
  &:hover:not(:disabled) {
@@ -984,27 +855,27 @@
984
855
  outline: 2px solid ${({theme:e})=>{var t,o;return (o=(t=e.stigg)==null?void 0:t.palette)==null?void 0:o.primary}};
985
856
  outline-offset: 2px;
986
857
  }
987
- `;var mo=(e,t)=>e?ft(e,{maximumFractionDigits:t!=null?t:void 0}):0,$a=(e,t=true,o=false)=>{let{currentBalance:n,displayName:i,units:r,symbol:a}=e,s=o&&a,l=r?n===1?r.singular:r.plural:null,c=l!=null?l:i;return [s,t?c:""].filter(Boolean).join(" ")},Ha=(e,t)=>t===0?0:Math.min(e/t*100,100);function Wa({usagePeriodEnd:e,formatResetPeriod:t,className:o}){let n=la({usagePeriodEnd:e,formatter:t});return n?jsxRuntime.jsx(P,{variant:"caption",color:"secondary",className:o,children:n}):null}var Av=y.div`
858
+ `;var tt=(e,t)=>e?chunkMY4ZIUAV_cjs_js.k(e,{maximumFractionDigits:t!=null?t:void 0}):0,vr=(e,t=true,o=false)=>{let{currentBalance:r,displayName:n,units:i,symbol:s}=e,l=o&&s,a=i?r===1?i.singular:i.plural:null,c=a!=null?a:n;return [l,t?c:""].filter(Boolean).join(" ")},Er=(e,t)=>t===0?0:Math.min(e/t*100,100);function Lr({usagePeriodEnd:e,formatResetPeriod:t,className:o}){let r=er({usagePeriodEnd:e,formatter:t});return r?jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.f,{variant:"caption",color:"secondary",className:o,children:r}):null}var Zb=chunkMY4ZIUAV_cjs_js.e.div`
988
859
  display: flex;
989
860
  flex-direction: column;
990
861
  gap: 4px;
991
- `,Mv=y.div`
862
+ `,Yb=chunkMY4ZIUAV_cjs_js.e.div`
992
863
  display: flex;
993
864
  flex-direction: row;
994
865
  gap: 4px;
995
866
  align-items: baseline;
996
- `;function d1({balance:e,isLoading:t,error:o,decimalPlaces:n=null,showUnits:i=true,showSymbol:r=false}){if(o)return jsxRuntime.jsx(P,{variant:"body1",color:"error",className:"stigg-credit-balance-value-error",children:o.message||"Failed to load balance"});if(t)return jsxRuntime.jsx(ro__default.default,{width:120,height:24,className:"stigg-credit-balance-value-loading"});if(e){let a=$a(e,i,r);return jsxRuntime.jsxs(Av,{children:[jsxRuntime.jsxs(Mv,{children:[jsxRuntime.jsx(P,{variant:"h3",color:"primary",bold:true,className:"stigg-credit-balance-value-amount",children:mo(e.currentBalance,n)}),jsxRuntime.jsx(P,{variant:"caption",color:"secondary",className:"stigg-credit-balance-value-suffix",children:a})]}),jsxRuntime.jsx(Wa,{usagePeriodEnd:e.usagePeriodEnd,className:"stigg-credit-balance-reset-period"})]})}return jsxRuntime.jsx(P,{variant:"body1",color:"disabled",className:"stigg-credit-balance-value-no-balance",children:"No balance data available"})}var u1={title:"Credit balance",addCredits:"Add credits"},Ga={title:"Credit utilization",remaining:"Remaining",addCredits:"Add credits"},p1={receivedAt:"Received",effectiveAt:"Effective At",grantType:"Grant Type",status:"State",balance:"Balance",expiryDate:"Expires",emptyState:"No credit grants found",loadingState:"Loading credit grants...",errorState:"Failed to load credit grants"},m1={title:"Usage",totalSpend:"Total spend"},h1={title:"Auto-recharge",activeLabel:"Active",manageButton:"Manage",descriptionTemplate:"Recharge to {{target}} {{unit}} when balance drops to {{threshold}}",emptyStateMessage:"Manage auto-recharge to avoid running out.",spendTemplate:"Spend: {{currency}}{{current}} / {{currency}}{{limit}} per month",unlimitedSpendLimit:"Unlimited spend."};var ja=y(ba)`
867
+ `;function kp({balance:e,isLoading:t,error:o,decimalPlaces:r=null,showUnits:n=true,showSymbol:i=false}){if(o)return jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.f,{variant:"body1",color:"error",className:"stigg-credit-balance-value-error",children:o.message||"Failed to load balance"});if(t)return jsxRuntime.jsx(Qe__default.default,{width:120,height:24,className:"stigg-credit-balance-value-loading"});if(e){let s=vr(e,n,i);return jsxRuntime.jsxs(Zb,{children:[jsxRuntime.jsxs(Yb,{children:[jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.f,{variant:"h3",color:"primary",bold:true,className:"stigg-credit-balance-value-amount",children:tt(e.currentBalance,r)}),jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.f,{variant:"caption",color:"secondary",className:"stigg-credit-balance-value-suffix",children:s})]}),jsxRuntime.jsx(Lr,{usagePeriodEnd:e.usagePeriodEnd,className:"stigg-credit-balance-reset-period"})]})}return jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.f,{variant:"body1",color:"disabled",className:"stigg-credit-balance-value-no-balance",children:"No balance data available"})}var Nr=chunkMY4ZIUAV_cjs_js.e(pr)`
997
868
  width: 16px;
998
869
  height: 16px;
999
870
  path {
1000
- stroke: ${({theme:e})=>{var t,o,n;return (n=(o=(t=e.stigg)==null?void 0:t.palette)==null?void 0:o.text)==null?void 0:n.primary}};
871
+ 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}};
1001
872
  }
1002
- `;var Iv=y.div`
873
+ `;var Qb=chunkMY4ZIUAV_cjs_js.e.div`
1003
874
  display: flex;
1004
875
  flex-direction: column;
1005
876
  gap: 8px;
1006
877
  width: 100%;
1007
- `,Ev=y.div`
878
+ `,Kb=chunkMY4ZIUAV_cjs_js.e.div`
1008
879
  display: flex;
1009
880
  flex-direction: column;
1010
881
  gap: 8px;
@@ -1012,158 +883,40 @@
1012
883
  border-radius: 8px;
1013
884
  border: 1px solid ${({theme:e})=>{var t,o;return (o=(t=e.stigg)==null?void 0:t.palette)==null?void 0:o.outlinedBorder}};
1014
885
  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}};
1015
- `;function g1({currencyId:e,localization:t,decimalPlaces:o,showUnits:n=true,showSymbol:i=false,onAddCredits:r}){let a=jt(St),s=D({optional:true}),l=s==null?void 0:s.theme,{balance:c,isLoading:d,error:u}=po({currencyId:e}),{title:p,addCredits:h}=S(S({},u1),t),m=jsxRuntime.jsx(Iv,{className:"stigg-credit-balance-container",children:jsxRuntime.jsxs(Ev,{className:"stigg-credit-balance-card",children:[jsxRuntime.jsxs(Bn,{children:[jsxRuntime.jsx(P,{variant:"h6",color:"primary",className:"stigg-credit-balance-title",children:p}),r&&c&&!u&&jsxRuntime.jsxs(Rn,{type:"button",onClick:()=>r(c),className:"stigg-credit-balance-add-credits-button",children:[jsxRuntime.jsx(ja,{className:"stigg-credit-balance-add-credits-icon"}),h]})]}),jsxRuntime.jsx(d1,{balance:c,isLoading:d,error:u,decimalPlaces:o,showUnits:n,showSymbol:i})]})});return a?m:jsxRuntime.jsx(ht,{componentTheme:l,children:m})}function he(){}var fd=(function(){let e=0;return function(){return e++}})();function W(e){return e===null||typeof e=="undefined"}function Z(e){if(Array.isArray&&Array.isArray(e))return true;let t=Object.prototype.toString.call(e);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function z(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}var lt=e=>(typeof e=="number"||e instanceof Number)&&isFinite(+e);function Ot(e,t){return lt(e)?e:t}function N(e,t){return typeof e=="undefined"?t:e}var yd=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100:e/t,ts=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*t:+e;function X(e,t,o){if(e&&typeof e.call=="function")return e.apply(o,t)}function K(e,t,o,n){let i,r,a;if(Z(e))if(r=e.length,n);else for(i=0;i<r;i++)t.call(o,e[i],i);else if(z(e))for(a=Object.keys(e),r=a.length,i=0;i<r;i++)t.call(o,e[a[i]],a[i]);}function Vn(e,t){let o,n,i,r;if(!e||!t||e.length!==t.length)return false;for(o=0,n=e.length;o<n;++o)if(i=e[o],r=t[o],i.datasetIndex!==r.datasetIndex||i.index!==r.index)return false;return true}function Oi(e){if(Z(e))return e.map(Oi);if(z(e)){let t=Object.create(null),o=Object.keys(e),n=o.length,i=0;for(;i<n;++i)t[o[i]]=Oi(e[o[i]]);return t}return e}function M1(e){return ["__proto__","prototype","constructor"].indexOf(e)===-1}function I1(e,t,o,n){if(!M1(e))return;let i=t[e],r=o[e];z(i)&&z(r)?Xt(i,r,n):t[e]=Oi(r);}function Xt(e,t,o){let n=Z(t)?t:[t],i=n.length;if(!z(e))return e;o=o||{};let r=o.merger||I1;for(let a=0;a<i;++a){if(t=n[a],!z(t))continue;let s=Object.keys(t);for(let l=0,c=s.length;l<c;++l)r(s[l],e,t,o);}return e}function Ko(e,t){return Xt(e,t,{merger:E1})}function E1(e,t,o){if(!M1(e))return;let n=t[e],i=o[e];z(n)&&z(i)?Ko(n,i):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=Oi(i));}var f1={"":e=>e,x:e=>e.x,y:e=>e.y};function Ae(e,t){return (f1[t]||(f1[t]=Fv(t)))(e)}function Fv(e){let t=F1(e);return o=>{for(let n of t){if(n==="")break;o=o&&o[n];}return o}}function F1(e){let t=e.split("."),o=[],n="";for(let i of t)n+=i,n.endsWith("\\")?n=n.slice(0,-1)+".":(o.push(n),n="");return o}function Vi(e){return e.charAt(0).toUpperCase()+e.slice(1)}var st=e=>typeof e!="undefined",Tt=e=>typeof e=="function",es=(e,t)=>{if(e.size!==t.size)return false;for(let o of e)if(!t.has(o))return false;return true};function xd(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}var G=Math.PI,Q=2*G,L1=Q+G,zi=Number.POSITIVE_INFINITY,$i=G/180,et=G/2,ie=G/4,Un=G*2/3,zt=Math.log10,re=Math.sign;function os(e){let t=Math.round(e);e=qo(e,t,e/1e3)?t:e;let o=Math.pow(10,Math.floor(zt(e))),n=e/o;return (n<=1?1:n<=2?2:n<=5?5:10)*o}function bd(e){let t=[],o=Math.sqrt(e),n;for(n=1;n<o;n++)e%n===0&&(t.push(n),t.push(e/n));return o===(o|0)&&t.push(o),t.sort((i,r)=>i-r).pop(),t}function Kt(e){return !isNaN(parseFloat(e))&&isFinite(e)}function qo(e,t,o){return Math.abs(e-t)<o}function Cd(e,t){let o=Math.round(e);return o-t<=e&&o+t>=e}function ns(e,t,o){let n,i,r;for(n=0,i=e.length;n<i;n++)r=e[n][o],isNaN(r)||(t.min=Math.min(t.min,r),t.max=Math.max(t.max,r));}function gt(e){return e*(G/180)}function Qo(e){return e*(180/G)}function is(e){if(!lt(e))return;let t=1,o=0;for(;Math.round(e*t)/t!==e;)t*=10,o++;return o}function rs(e,t){let o=t.x-e.x,n=t.y-e.y,i=Math.sqrt(o*o+n*n),r=Math.atan2(n,o);return r<-0.5*G&&(r+=Q),{angle:r,distance:i}}function Ve(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function B1(e,t){return (e-t+L1)%Q-G}function Ft(e){return (e%Q+Q)%Q}function Jo(e,t,o,n){let i=Ft(e),r=Ft(t),a=Ft(o),s=Ft(r-i),l=Ft(a-i),c=Ft(i-r),d=Ft(i-a);return i===r||i===a||n&&r===a||s>l&&c<d}function Ct(e,t,o){return Math.max(t,Math.min(o,e))}function Pd(e){return Ct(e,-32768,32767)}function ge(e,t,o,n=1e-6){return e>=Math.min(t,o)-n&&e<=Math.max(t,o)+n}function Hi(e,t,o){o=o||(a=>e[a]<t);let n=e.length-1,i=0,r;for(;n-i>1;)r=i+n>>1,o(r)?i=r:n=r;return {lo:i,hi:n}}var ze=(e,t,o,n)=>Hi(e,o,n?i=>e[i][t]<=o:i=>e[i][t]<o),Sd=(e,t,o)=>Hi(e,o,n=>e[n][t]>=o);function Td(e,t,o){let n=0,i=e.length;for(;n<i&&e[n]<t;)n++;for(;i>n&&e[i-1]>o;)i--;return n>0||i<e.length?e.slice(n,i):e}var R1=["push","pop","shift","splice","unshift"];function kd(e,t){if(e._chartjs){e._chartjs.listeners.push(t);return}Object.defineProperty(e,"_chartjs",{configurable:true,enumerable:false,value:{listeners:[t]}}),R1.forEach(o=>{let n="_onData"+Vi(o),i=e[o];Object.defineProperty(e,o,{configurable:true,enumerable:false,value(...r){let a=i.apply(this,r);return e._chartjs.listeners.forEach(s=>{typeof s[n]=="function"&&s[n](...r);}),a}});});}function as(e,t){let o=e._chartjs;if(!o)return;let n=o.listeners,i=n.indexOf(t);i!==-1&&n.splice(i,1),!(n.length>0)&&(R1.forEach(r=>{delete e[r];}),delete e._chartjs);}function ss(e){let t=new Set,o,n;for(o=0,n=e.length;o<n;++o)t.add(e[o]);return t.size===n?e:Array.from(t)}var ls=(function(){return typeof window=="undefined"?function(e){return e()}:window.requestAnimationFrame})();function cs(e,t,o){let n=o||(a=>Array.prototype.slice.call(a)),i=false,r=[];return function(...a){r=n(a),i||(i=true,ls.call(window,()=>{i=false,e.apply(t,r);}));}}function wd(e,t){let o;return function(...n){return t?(clearTimeout(o),o=setTimeout(e,t,n)):e.apply(this,n),t}}var Wi=e=>e==="start"?"left":e==="end"?"right":"center",Pt=(e,t,o)=>e==="start"?t:e==="end"?o:(t+o)/2,vd=(e,t,o,n)=>e===(n?"left":"right")?o:e==="center"?(t+o)/2:t;function ds(e,t,o){let n=t.length,i=0,r=n;if(e._sorted){let{iScale:a,_parsed:s}=e,l=a.axis,{min:c,max:d,minDefined:u,maxDefined:p}=a.getUserBounds();u&&(i=Ct(Math.min(ze(s,a.axis,c).lo,o?n:ze(t,l,a.getPixelForValue(c)).lo),0,n-1)),p?r=Ct(Math.max(ze(s,a.axis,d,true).hi+1,o?0:ze(t,l,a.getPixelForValue(d),true).hi+1),i,n)-i:r=n-i;}return {start:i,count:r}}function us(e){let{xScale:t,yScale:o,_scaleRanges:n}=e,i={xmin:t.min,xmax:t.max,ymin:o.min,ymax:o.max};if(!n)return e._scaleRanges=i,true;let r=n.xmin!==t.min||n.xmax!==t.max||n.ymin!==o.min||n.ymax!==o.max;return Object.assign(n,i),r}var Ya=e=>e===0||e===1,y1=(e,t,o)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*Q/o)),x1=(e,t,o)=>Math.pow(2,-10*e)*Math.sin((e-t)*Q/o)+1,Yo={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>-e*(e-2),easeInOutQuad:e=>(e/=.5)<1?.5*e*e:-0.5*(--e*(e-2)-1),easeInCubic:e=>e*e*e,easeOutCubic:e=>(e-=1)*e*e+1,easeInOutCubic:e=>(e/=.5)<1?.5*e*e*e:.5*((e-=2)*e*e+2),easeInQuart:e=>e*e*e*e,easeOutQuart:e=>-((e-=1)*e*e*e-1),easeInOutQuart:e=>(e/=.5)<1?.5*e*e*e*e:-0.5*((e-=2)*e*e*e-2),easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>(e-=1)*e*e*e*e+1,easeInOutQuint:e=>(e/=.5)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2),easeInSine:e=>-Math.cos(e*et)+1,easeOutSine:e=>Math.sin(e*et),easeInOutSine:e=>-0.5*(Math.cos(G*e)-1),easeInExpo:e=>e===0?0:Math.pow(2,10*(e-1)),easeOutExpo:e=>e===1?1:-Math.pow(2,-10*e)+1,easeInOutExpo:e=>Ya(e)?e:e<.5?.5*Math.pow(2,10*(e*2-1)):.5*(-Math.pow(2,-10*(e*2-1))+2),easeInCirc:e=>e>=1?e:-(Math.sqrt(1-e*e)-1),easeOutCirc:e=>Math.sqrt(1-(e-=1)*e),easeInOutCirc:e=>(e/=.5)<1?-0.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1),easeInElastic:e=>Ya(e)?e:y1(e,.075,.3),easeOutElastic:e=>Ya(e)?e:x1(e,.075,.3),easeInOutElastic(e){return Ya(e)?e:e<.5?.5*y1(e*2,.1125,.45):.5+.5*x1(e*2-1,.1125,.45)},easeInBack(e){return e*e*((1.70158+1)*e-1.70158)},easeOutBack(e){return (e-=1)*e*((1.70158+1)*e+1.70158)+1},easeInOutBack(e){let t=1.70158;return (e/=.5)<1?.5*(e*e*(((t*=1.525)+1)*e-t)):.5*((e-=2)*e*(((t*=1.525)+1)*e+t)+2)},easeInBounce:e=>1-Yo.easeOutBounce(1-e),easeOutBounce(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},easeInOutBounce:e=>e<.5?Yo.easeInBounce(e*2)*.5:Yo.easeOutBounce(e*2-1)*.5+.5};function Gi(e){return e+.5|0}var ho=(e,t,o)=>Math.max(Math.min(e,o),t);function Ni(e){return ho(Gi(e*2.55),0,255)}function go(e){return ho(Gi(e*255),0,255)}function Ue(e){return ho(Gi(e/2.55)/100,0,1)}function b1(e){return ho(Gi(e*100),0,100)}var ne={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},md=[..."0123456789ABCDEF"],Lv=e=>md[e&15],Bv=e=>md[(e&240)>>4]+md[e&15],Za=e=>(e&240)>>4===(e&15),Rv=e=>Za(e.r)&&Za(e.g)&&Za(e.b)&&Za(e.a);function Dv(e){var t=e.length,o;return e[0]==="#"&&(t===4||t===5?o={r:255&ne[e[1]]*17,g:255&ne[e[2]]*17,b:255&ne[e[3]]*17,a:t===5?ne[e[4]]*17:255}:(t===7||t===9)&&(o={r:ne[e[1]]<<4|ne[e[2]],g:ne[e[3]]<<4|ne[e[4]],b:ne[e[5]]<<4|ne[e[6]],a:t===9?ne[e[7]]<<4|ne[e[8]]:255})),o}var Nv=(e,t)=>e<255?t(e):"";function Uv(e){var t=Rv(e)?Lv:Bv;return e?"#"+t(e.r)+t(e.g)+t(e.b)+Nv(e.a,t):void 0}var Ov=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function D1(e,t,o){let n=t*Math.min(o,1-o),i=(r,a=(r+e/30)%12)=>o-n*Math.max(Math.min(a-3,9-a,1),-1);return [i(0),i(8),i(4)]}function zv(e,t,o){let n=(i,r=(i+e/60)%6)=>o-o*t*Math.max(Math.min(r,4-r,1),0);return [n(5),n(3),n(1)]}function Vv(e,t,o){let n=D1(e,1,.5),i;for(t+o>1&&(i=1/(t+o),t*=i,o*=i),i=0;i<3;i++)n[i]*=1-t-o,n[i]+=t;return n}function $v(e,t,o,n,i){return e===i?(t-o)/n+(t<o?6:0):t===i?(o-e)/n+2:(e-t)/n+4}function _d(e){let o=e.r/255,n=e.g/255,i=e.b/255,r=Math.max(o,n,i),a=Math.min(o,n,i),s=(r+a)/2,l,c,d;return r!==a&&(d=r-a,c=s>.5?d/(2-r-a):d/(r+a),l=$v(o,n,i,d,r),l=l*60+.5),[l|0,c||0,s]}function Ad(e,t,o,n){return (Array.isArray(t)?e(t[0],t[1],t[2]):e(t,o,n)).map(go)}function Md(e,t,o){return Ad(D1,e,t,o)}function Hv(e,t,o){return Ad(Vv,e,t,o)}function Wv(e,t,o){return Ad(zv,e,t,o)}function N1(e){return (e%360+360)%360}function Gv(e){let t=Ov.exec(e),o=255,n;if(!t)return;t[5]!==n&&(o=t[6]?Ni(+t[5]):go(+t[5]));let i=N1(+t[2]),r=+t[3]/100,a=+t[4]/100;return t[1]==="hwb"?n=Hv(i,r,a):t[1]==="hsv"?n=Wv(i,r,a):n=Md(i,r,a),{r:n[0],g:n[1],b:n[2],a:o}}function jv(e,t){var o=_d(e);o[0]=N1(o[0]+t),o=Md(o),e.r=o[0],e.g=o[1],e.b=o[2];}function Yv(e){if(!e)return;let t=_d(e),o=t[0],n=b1(t[1]),i=b1(t[2]);return e.a<255?`hsla(${o}, ${n}%, ${i}%, ${Ue(e.a)})`:`hsl(${o}, ${n}%, ${i}%)`}var C1={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},P1={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function Zv(){let e={},t=Object.keys(P1),o=Object.keys(C1),n,i,r,a,s;for(n=0;n<t.length;n++){for(a=s=t[n],i=0;i<o.length;i++)r=o[i],s=s.replace(r,C1[r]);r=parseInt(P1[a],16),e[s]=[r>>16&255,r>>8&255,r&255];}return e}var Xa;function Xv(e){Xa||(Xa=Zv(),Xa.transparent=[0,0,0,0]);let t=Xa[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}var Kv=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function qv(e){let t=Kv.exec(e),o=255,n,i,r;if(t){if(t[7]!==n){let a=+t[7];o=t[8]?Ni(a):ho(a*255,0,255);}return n=+t[1],i=+t[3],r=+t[5],n=255&(t[2]?Ni(n):ho(n,0,255)),i=255&(t[4]?Ni(i):ho(i,0,255)),r=255&(t[6]?Ni(r):ho(r,0,255)),{r:n,g:i,b:r,a:o}}}function Qv(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${Ue(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}var dd=e=>e<=.0031308?e*12.92:Math.pow(e,1/2.4)*1.055-.055,Nn=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);function Jv(e,t,o){let n=Nn(Ue(e.r)),i=Nn(Ue(e.g)),r=Nn(Ue(e.b));return {r:go(dd(n+o*(Nn(Ue(t.r))-n))),g:go(dd(i+o*(Nn(Ue(t.g))-i))),b:go(dd(r+o*(Nn(Ue(t.b))-r))),a:e.a+o*(t.a-e.a)}}function Ka(e,t,o){if(e){let n=_d(e);n[t]=Math.max(0,Math.min(n[t]+n[t]*o,t===0?360:1)),n=Md(n),e.r=n[0],e.g=n[1],e.b=n[2];}}function U1(e,t){return e&&Object.assign(t||{},e)}function S1(e){var t={r:0,g:0,b:0,a:255};return Array.isArray(e)?e.length>=3&&(t={r:e[0],g:e[1],b:e[2],a:255},e.length>3&&(t.a=go(e[3]))):(t=U1(e,{r:0,g:0,b:0,a:1}),t.a=go(t.a)),t}function t6(e){return e.charAt(0)==="r"?qv(e):Gv(e)}var hd=class e{constructor(t){if(t instanceof e)return t;let o=typeof t,n;o==="object"?n=S1(t):o==="string"&&(n=Dv(t)||Xv(t)||t6(t)),this._rgb=n,this._valid=!!n;}get valid(){return this._valid}get rgb(){var t=U1(this._rgb);return t&&(t.a=Ue(t.a)),t}set rgb(t){this._rgb=S1(t);}rgbString(){return this._valid?Qv(this._rgb):void 0}hexString(){return this._valid?Uv(this._rgb):void 0}hslString(){return this._valid?Yv(this._rgb):void 0}mix(t,o){if(t){let n=this.rgb,i=t.rgb,r,a=o===r?.5:o,s=2*a-1,l=n.a-i.a,c=((s*l===-1?s:(s+l)/(1+s*l))+1)/2;r=1-c,n.r=255&c*n.r+r*i.r+.5,n.g=255&c*n.g+r*i.g+.5,n.b=255&c*n.b+r*i.b+.5,n.a=a*n.a+(1-a)*i.a,this.rgb=n;}return this}interpolate(t,o){return t&&(this._rgb=Jv(this._rgb,t._rgb,o)),this}clone(){return new e(this.rgb)}alpha(t){return this._rgb.a=go(t),this}clearer(t){let o=this._rgb;return o.a*=1-t,this}greyscale(){let t=this._rgb,o=Gi(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=o,this}opaquer(t){let o=this._rgb;return o.a*=1+t,this}negate(){let t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return Ka(this._rgb,2,t),this}darken(t){return Ka(this._rgb,2,-t),this}saturate(t){return Ka(this._rgb,1,t),this}desaturate(t){return Ka(this._rgb,1,-t),this}rotate(t){return jv(this._rgb,t),this}};function O1(e){return new hd(e)}function Id(e){if(e&&typeof e=="object"){let t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return false}function tn(e){return Id(e)?e:O1(e)}function Qa(e){return Id(e)?e:O1(e).saturate(.5).darken(.1).hexString()}var yo=Object.create(null),ps=Object.create(null);function Ui(e,t){if(!t)return e;let o=t.split(".");for(let n=0,i=o.length;n<i;++n){let r=o[n];e=e[r]||(e[r]=Object.create(null));}return e}function ud(e,t,o){return typeof t=="string"?Xt(Ui(e,t),o):Xt(Ui(e,""),t)}var gd=class{constructor(t){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=o=>o.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(o,n)=>Qa(n.backgroundColor),this.hoverBorderColor=(o,n)=>Qa(n.borderColor),this.hoverColor=(o,n)=>Qa(n.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:true,includeInvisible:false},this.maintainAspectRatio=true,this.onHover=null,this.onClick=null,this.parsing=true,this.plugins={},this.responsive=true,this.scale=void 0,this.scales={},this.showLine=true,this.drawActiveElementsOnTop=true,this.describe(t);}set(t,o){return ud(this,t,o)}get(t){return Ui(this,t)}describe(t,o){return ud(ps,t,o)}override(t,o){return ud(yo,t,o)}route(t,o,n,i){let r=Ui(this,t),a=Ui(this,n),s="_"+o;Object.defineProperties(r,{[s]:{value:r[o],writable:true},[o]:{enumerable:true,get(){let l=this[s],c=a[i];return z(l)?Object.assign({},c,l):N(l,c)},set(l){this[s]=l;}}});}},H=new gd({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:false,_indexable:false}});function z1(e){return !e||W(e.size)||W(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function On(e,t,o,n,i){let r=t[i];return r||(r=t[i]=e.measureText(i).width,o.push(i)),r>n&&(n=r),n}function Ed(e,t,o,n){n=n||{};let i=n.data=n.data||{},r=n.garbageCollect=n.garbageCollect||[];n.font!==t&&(i=n.data={},r=n.garbageCollect=[],n.font=t),e.save(),e.font=t;let a=0,s=o.length,l,c,d,u,p;for(l=0;l<s;l++)if(u=o[l],u!=null&&Z(u)!==true)a=On(e,i,r,a,u);else if(Z(u))for(c=0,d=u.length;c<d;c++)p=u[c],p!=null&&!Z(p)&&(a=On(e,i,r,a,p));e.restore();let h=r.length/2;if(h>o.length){for(l=0;l<h;l++)delete i[r[l]];r.splice(0,h);}return a}function $e(e,t,o){let n=e.currentDevicePixelRatio,i=o!==0?Math.max(o/2,.5):0;return Math.round((t-i)*n)/n+i}function ms(e,t){t=t||e.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore();}function ji(e,t,o,n){hs(e,t,o,n,null);}function hs(e,t,o,n,i){let r,a,s,l,c,d,u=t.pointStyle,p=t.rotation,h=t.radius,m=(p||0)*$i;if(u&&typeof u=="object"&&(r=u.toString(),r==="[object HTMLImageElement]"||r==="[object HTMLCanvasElement]")){e.save(),e.translate(o,n),e.rotate(m),e.drawImage(u,-u.width/2,-u.height/2,u.width,u.height),e.restore();return}if(!(isNaN(h)||h<=0)){switch(e.beginPath(),u){default:i?e.ellipse(o,n,i/2,h,0,0,Q):e.arc(o,n,h,0,Q),e.closePath();break;case "triangle":e.moveTo(o+Math.sin(m)*h,n-Math.cos(m)*h),m+=Un,e.lineTo(o+Math.sin(m)*h,n-Math.cos(m)*h),m+=Un,e.lineTo(o+Math.sin(m)*h,n-Math.cos(m)*h),e.closePath();break;case "rectRounded":c=h*.516,l=h-c,a=Math.cos(m+ie)*l,s=Math.sin(m+ie)*l,e.arc(o-a,n-s,c,m-G,m-et),e.arc(o+s,n-a,c,m-et,m),e.arc(o+a,n+s,c,m,m+et),e.arc(o-s,n+a,c,m+et,m+G),e.closePath();break;case "rect":if(!p){l=Math.SQRT1_2*h,d=i?i/2:l,e.rect(o-d,n-l,2*d,2*l);break}m+=ie;case "rectRot":a=Math.cos(m)*h,s=Math.sin(m)*h,e.moveTo(o-a,n-s),e.lineTo(o+s,n-a),e.lineTo(o+a,n+s),e.lineTo(o-s,n+a),e.closePath();break;case "crossRot":m+=ie;case "cross":a=Math.cos(m)*h,s=Math.sin(m)*h,e.moveTo(o-a,n-s),e.lineTo(o+a,n+s),e.moveTo(o+s,n-a),e.lineTo(o-s,n+a);break;case "star":a=Math.cos(m)*h,s=Math.sin(m)*h,e.moveTo(o-a,n-s),e.lineTo(o+a,n+s),e.moveTo(o+s,n-a),e.lineTo(o-s,n+a),m+=ie,a=Math.cos(m)*h,s=Math.sin(m)*h,e.moveTo(o-a,n-s),e.lineTo(o+a,n+s),e.moveTo(o+s,n-a),e.lineTo(o-s,n+a);break;case "line":a=i?i/2:Math.cos(m)*h,s=Math.sin(m)*h,e.moveTo(o-a,n-s),e.lineTo(o+a,n+s);break;case "dash":e.moveTo(o,n),e.lineTo(o+Math.cos(m)*h,n+Math.sin(m)*h);break}e.fill(),t.borderWidth>0&&e.stroke();}}function Xo(e,t,o){return o=o||.5,!t||e&&e.x>t.left-o&&e.x<t.right+o&&e.y>t.top-o&&e.y<t.bottom+o}function xo(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip();}function bo(e){e.restore();}function Fd(e,t,o,n,i){if(!t)return e.lineTo(o.x,o.y);if(i==="middle"){let r=(t.x+o.x)/2;e.lineTo(r,t.y),e.lineTo(r,o.y);}else i==="after"!=!!n?e.lineTo(t.x,o.y):e.lineTo(o.x,t.y);e.lineTo(o.x,o.y);}function Ld(e,t,o,n){if(!t)return e.lineTo(o.x,o.y);e.bezierCurveTo(n?t.cp1x:t.cp2x,n?t.cp1y:t.cp2y,n?o.cp2x:o.cp1x,n?o.cp2y:o.cp1y,o.x,o.y);}function He(e,t,o,n,i,r={}){let a=Z(t)?t:[t],s=r.strokeWidth>0&&r.strokeColor!=="",l,c;for(e.save(),e.font=i.string,e6(e,r),l=0;l<a.length;++l)c=a[l],s&&(r.strokeColor&&(e.strokeStyle=r.strokeColor),W(r.strokeWidth)||(e.lineWidth=r.strokeWidth),e.strokeText(c,o,n,r.maxWidth)),e.fillText(c,o,n,r.maxWidth),o6(e,o,n,c,r),n+=i.lineHeight;e.restore();}function e6(e,t){t.translation&&e.translate(t.translation[0],t.translation[1]),W(t.rotation)||e.rotate(t.rotation),t.color&&(e.fillStyle=t.color),t.textAlign&&(e.textAlign=t.textAlign),t.textBaseline&&(e.textBaseline=t.textBaseline);}function o6(e,t,o,n,i){if(i.strikethrough||i.underline){let r=e.measureText(n),a=t-r.actualBoundingBoxLeft,s=t+r.actualBoundingBoxRight,l=o-r.actualBoundingBoxAscent,c=o+r.actualBoundingBoxDescent,d=i.strikethrough?(l+c)/2:c;e.strokeStyle=e.fillStyle,e.beginPath(),e.lineWidth=i.decorationWidth||2,e.moveTo(a,d),e.lineTo(s,d),e.stroke();}}function We(e,t){let{x:o,y:n,w:i,h:r,radius:a}=t;e.arc(o+a.topLeft,n+a.topLeft,a.topLeft,-et,G,true),e.lineTo(o,n+r-a.bottomLeft),e.arc(o+a.bottomLeft,n+r-a.bottomLeft,a.bottomLeft,G,et,true),e.lineTo(o+i-a.bottomRight,n+r),e.arc(o+i-a.bottomRight,n+r-a.bottomRight,a.bottomRight,et,0,true),e.lineTo(o+i,n+a.topRight),e.arc(o+i-a.topRight,n+a.topRight,a.topRight,0,-et,true),e.lineTo(o+a.topLeft,n);}var n6=new RegExp(/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/),i6=new RegExp(/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/);function V1(e,t){let o=(""+e).match(n6);if(!o||o[1]==="normal")return t*1.2;switch(e=+o[2],o[3]){case "px":return e;case "%":e/=100;break}return t*e}var r6=e=>+e||0;function Yi(e,t){let o={},n=z(t),i=n?Object.keys(t):t,r=z(e)?n?a=>N(e[a],e[t[a]]):a=>e[a]:()=>e;for(let a of i)o[a]=r6(r(a));return o}function gs(e){return Yi(e,{top:"y",right:"x",bottom:"y",left:"x"})}function fe(e){return Yi(e,["topLeft","topRight","bottomLeft","bottomRight"])}function pt(e){let t=gs(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function it(e,t){e=e||{},t=t||H.font;let o=N(e.size,t.size);typeof o=="string"&&(o=parseInt(o,10));let n=N(e.style,t.style);n&&!(""+n).match(i6)&&(console.warn('Invalid font style specified: "'+n+'"'),n="");let i={family:N(e.family,t.family),lineHeight:V1(N(e.lineHeight,t.lineHeight),o),size:o,style:n,weight:N(e.weight,t.weight),string:""};return i.string=z1(i),i}function rt(e,t,o,n){let r,a,s;for(r=0,a=e.length;r<a;++r)if(s=e[r],s!==void 0&&(t!==void 0&&typeof s=="function"&&(s=s(t),false),o!==void 0&&Z(s)&&(s=s[o%s.length],false),s!==void 0))return s}function Bd(e,t,o){let{min:n,max:i}=e,r=ts(t,(i-n)/2),a=(s,l)=>o&&s===0?0:s+l;return {min:a(n,-Math.abs(r)),max:a(i,r)}}function Me(e,t){return Object.assign(Object.create(e),t)}function Zi(e,t=[""],o=e,n,i=()=>e[0]){st(n)||(n=W1("_fallback",e));let r={[Symbol.toStringTag]:"Object",_cacheable:true,_scopes:e,_rootScopes:o,_fallback:n,_getTarget:i,override:a=>Zi([a,...e],t,o,n)};return new Proxy(r,{deleteProperty(a,s){return delete a[s],delete a._keys,delete e[0][s],true},get(a,s){return $1(a,s,()=>m6(s,t,e,a))},getOwnPropertyDescriptor(a,s){return Reflect.getOwnPropertyDescriptor(a._scopes[0],s)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(a,s){return k1(a).includes(s)},ownKeys(a){return k1(a)},set(a,s,l){let c=a._storage||(a._storage=i());return a[s]=c[s]=l,delete a._keys,true}})}function fo(e,t,o,n){let i={_cacheable:false,_proxy:e,_context:t,_subProxy:o,_stack:new Set,_descriptors:fs(e,n),setContext:r=>fo(e,r,o,n),override:r=>fo(e.override(r),t,o,n)};return new Proxy(i,{deleteProperty(r,a){return delete r[a],delete e[a],true},get(r,a,s){return $1(r,a,()=>s6(r,a,s))},getOwnPropertyDescriptor(r,a){return r._descriptors.allKeys?Reflect.has(e,a)?{enumerable:true,configurable:true}:void 0:Reflect.getOwnPropertyDescriptor(e,a)},getPrototypeOf(){return Reflect.getPrototypeOf(e)},has(r,a){return Reflect.has(e,a)},ownKeys(){return Reflect.ownKeys(e)},set(r,a,s){return e[a]=s,delete r[a],true}})}function fs(e,t={scriptable:true,indexable:true}){let{_scriptable:o=t.scriptable,_indexable:n=t.indexable,_allKeys:i=t.allKeys}=e;return {allKeys:i,scriptable:o,indexable:n,isScriptable:Tt(o)?o:()=>o,isIndexable:Tt(n)?n:()=>n}}var a6=(e,t)=>e?e+Vi(t):t,Rd=(e,t)=>z(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function $1(e,t,o){if(Object.prototype.hasOwnProperty.call(e,t))return e[t];let n=o();return e[t]=n,n}function s6(e,t,o){let{_proxy:n,_context:i,_subProxy:r,_descriptors:a}=e,s=n[t];return Tt(s)&&a.isScriptable(t)&&(s=l6(t,s,e,o)),Z(s)&&s.length&&(s=c6(t,s,e,a.isIndexable)),Rd(t,s)&&(s=fo(s,i,r&&r[t],a)),s}function l6(e,t,o,n){let{_proxy:i,_context:r,_subProxy:a,_stack:s}=o;if(s.has(e))throw new Error("Recursion detected: "+Array.from(s).join("->")+"->"+e);return s.add(e),t=t(r,a||n),s.delete(e),Rd(e,t)&&(t=Dd(i._scopes,i,e,t)),t}function c6(e,t,o,n){let{_proxy:i,_context:r,_subProxy:a,_descriptors:s}=o;if(st(r.index)&&n(e))t=t[r.index%t.length];else if(z(t[0])){let l=t,c=i._scopes.filter(d=>d!==l);t=[];for(let d of l){let u=Dd(c,i,e,d);t.push(fo(u,r,a&&a[e],s));}}return t}function H1(e,t,o){return Tt(e)?e(t,o):e}var d6=(e,t)=>e===true?t:typeof e=="string"?Ae(t,e):void 0;function u6(e,t,o,n,i){for(let r of t){let a=d6(o,r);if(a){e.add(a);let s=H1(a._fallback,o,i);if(st(s)&&s!==o&&s!==n)return s}else if(a===false&&st(n)&&o!==n)return null}return false}function Dd(e,t,o,n){let i=t._rootScopes,r=H1(t._fallback,o,n),a=[...e,...i],s=new Set;s.add(n);let l=T1(s,a,o,r||o,n);return l===null||st(r)&&r!==o&&(l=T1(s,a,r,l,n),l===null)?false:Zi(Array.from(s),[""],i,r,()=>p6(t,o,n))}function T1(e,t,o,n,i){for(;o;)o=u6(e,t,o,n,i);return o}function p6(e,t,o){let n=e._getTarget();t in n||(n[t]={});let i=n[t];return Z(i)&&z(o)?o:i}function m6(e,t,o,n){let i;for(let r of t)if(i=W1(a6(r,e),o),st(i))return Rd(e,i)?Dd(o,n,e,i):i}function W1(e,t){for(let o of t){if(!o)continue;let n=o[e];if(st(n))return n}}function k1(e){let t=e._keys;return t||(t=e._keys=h6(e._scopes)),t}function h6(e){let t=new Set;for(let o of e)for(let n of Object.keys(o).filter(i=>!i.startsWith("_")))t.add(n);return Array.from(t)}function ys(e,t,o,n){let{iScale:i}=e,{key:r="r"}=this._parsing,a=new Array(n),s,l,c,d;for(s=0,l=n;s<l;++s)c=s+o,d=t[c],a[s]={r:i.parse(Ae(d,r),c)};return a}var g6=Number.EPSILON||1e-14,zn=(e,t)=>t<e.length&&!e[t].skip&&e[t],G1=e=>e==="x"?"y":"x";function j1(e,t,o,n){let i=e.skip?t:e,r=t,a=o.skip?t:o,s=Ve(r,i),l=Ve(a,r),c=s/(s+l),d=l/(s+l);c=isNaN(c)?0:c,d=isNaN(d)?0:d;let u=n*c,p=n*d;return {previous:{x:r.x-u*(a.x-i.x),y:r.y-u*(a.y-i.y)},next:{x:r.x+p*(a.x-i.x),y:r.y+p*(a.y-i.y)}}}function f6(e,t,o){let n=e.length,i,r,a,s,l,c=zn(e,0);for(let d=0;d<n-1;++d)if(l=c,c=zn(e,d+1),!(!l||!c)){if(qo(t[d],0,g6)){o[d]=o[d+1]=0;continue}i=o[d]/t[d],r=o[d+1]/t[d],s=Math.pow(i,2)+Math.pow(r,2),!(s<=9)&&(a=3/Math.sqrt(s),o[d]=i*a*t[d],o[d+1]=r*a*t[d]);}}function y6(e,t,o="x"){let n=G1(o),i=e.length,r,a,s,l=zn(e,0);for(let c=0;c<i;++c){if(a=s,s=l,l=zn(e,c+1),!s)continue;let d=s[o],u=s[n];a&&(r=(d-a[o])/3,s[`cp1${o}`]=d-r,s[`cp1${n}`]=u-r*t[c]),l&&(r=(l[o]-d)/3,s[`cp2${o}`]=d+r,s[`cp2${n}`]=u+r*t[c]);}}function Y1(e,t="x"){let o=G1(t),n=e.length,i=Array(n).fill(0),r=Array(n),a,s,l,c=zn(e,0);for(a=0;a<n;++a)if(s=l,l=c,c=zn(e,a+1),!!l){if(c){let d=c[t]-l[t];i[a]=d!==0?(c[o]-l[o])/d:0;}r[a]=s?c?re(i[a-1])!==re(i[a])?0:(i[a-1]+i[a])/2:i[a-1]:i[a];}f6(e,i,r),y6(e,r,t);}function qa(e,t,o){return Math.max(Math.min(e,o),t)}function x6(e,t){let o,n,i,r,a,s=Xo(e[0],t);for(o=0,n=e.length;o<n;++o)a=r,r=s,s=o<n-1&&Xo(e[o+1],t),r&&(i=e[o],a&&(i.cp1x=qa(i.cp1x,t.left,t.right),i.cp1y=qa(i.cp1y,t.top,t.bottom)),s&&(i.cp2x=qa(i.cp2x,t.left,t.right),i.cp2y=qa(i.cp2y,t.top,t.bottom)));}function Nd(e,t,o,n,i){let r,a,s,l;if(t.spanGaps&&(e=e.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")Y1(e,i);else {let c=n?e[e.length-1]:e[0];for(r=0,a=e.length;r<a;++r)s=e[r],l=j1(c,s,e[Math.min(r+1,a-(n?0:1))%a],t.tension),s.cp1x=l.previous.x,s.cp1y=l.previous.y,s.cp2x=l.next.x,s.cp2y=l.next.y,c=s;}t.capBezierPoints&&x6(e,o);}function xs(){return typeof window!="undefined"&&typeof document!="undefined"}function Xi(e){let t=e.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function Ja(e,t,o){let n;return typeof e=="string"?(n=parseInt(e,10),e.indexOf("%")!==-1&&(n=n/100*t.parentNode[o])):n=e,n}var bs=e=>window.getComputedStyle(e,null);function Z1(e,t){return bs(e).getPropertyValue(t)}var b6=["top","right","bottom","left"];function Zo(e,t,o){let n={};o=o?"-"+o:"";for(let i=0;i<4;i++){let r=b6[i];n[r]=parseFloat(e[t+"-"+r+o])||0;}return n.width=n.left+n.right,n.height=n.top+n.bottom,n}var C6=(e,t,o)=>(e>0||t>0)&&(!o||!o.shadowRoot);function P6(e,t){let o=e.touches,n=o&&o.length?o[0]:e,{offsetX:i,offsetY:r}=n,a=false,s,l;if(C6(i,r,e.target))s=i,l=r;else {let c=t.getBoundingClientRect();s=n.clientX-c.left,l=n.clientY-c.top,a=true;}return {x:s,y:l,box:a}}function Ge(e,t){if("native"in e)return e;let{canvas:o,currentDevicePixelRatio:n}=t,i=bs(o),r=i.boxSizing==="border-box",a=Zo(i,"padding"),s=Zo(i,"border","width"),{x:l,y:c,box:d}=P6(e,o),u=a.left+(d&&s.left),p=a.top+(d&&s.top),{width:h,height:m}=t;return r&&(h-=a.width+s.width,m-=a.height+s.height),{x:Math.round((l-u)/h*o.width/n),y:Math.round((c-p)/m*o.height/n)}}function S6(e,t,o){let n,i;if(t===void 0||o===void 0){let r=Xi(e);if(!r)t=e.clientWidth,o=e.clientHeight;else {let a=r.getBoundingClientRect(),s=bs(r),l=Zo(s,"border","width"),c=Zo(s,"padding");t=a.width-c.width-l.width,o=a.height-c.height-l.height,n=Ja(s.maxWidth,r,"clientWidth"),i=Ja(s.maxHeight,r,"clientHeight");}}return {width:t,height:o,maxWidth:n||zi,maxHeight:i||zi}}var pd=e=>Math.round(e*10)/10;function Ud(e,t,o,n){let i=bs(e),r=Zo(i,"margin"),a=Ja(i.maxWidth,e,"clientWidth")||zi,s=Ja(i.maxHeight,e,"clientHeight")||zi,l=S6(e,t,o),{width:c,height:d}=l;if(i.boxSizing==="content-box"){let u=Zo(i,"border","width"),p=Zo(i,"padding");c-=p.width+u.width,d-=p.height+u.height;}return c=Math.max(0,c-r.width),d=Math.max(0,n?Math.floor(c/n):d-r.height),c=pd(Math.min(c,a,l.maxWidth)),d=pd(Math.min(d,s,l.maxHeight)),c&&!d&&(d=pd(c/2)),{width:c,height:d}}function Cs(e,t,o){let n=t||1,i=Math.floor(e.height*n),r=Math.floor(e.width*n);e.height=i/n,e.width=r/n;let a=e.canvas;return a.style&&(o||!a.style.height&&!a.style.width)&&(a.style.height=`${e.height}px`,a.style.width=`${e.width}px`),e.currentDevicePixelRatio!==n||a.height!==i||a.width!==r?(e.currentDevicePixelRatio=n,a.height=i,a.width=r,e.ctx.setTransform(n,0,0,n,0,0),true):false}var Od=(function(){let e=false;try{let t={get passive(){return e=!0,!1}};window.addEventListener("test",null,t),window.removeEventListener("test",null,t);}catch(t){}return e})();function Ps(e,t){let o=Z1(e,t),n=o&&o.match(/^(\d+)(\.\d+)?px$/);return n?+n[1]:void 0}function Oe(e,t,o,n){return {x:e.x+o*(t.x-e.x),y:e.y+o*(t.y-e.y)}}function zd(e,t,o,n){return {x:e.x+o*(t.x-e.x),y:n==="middle"?o<.5?e.y:t.y:n==="after"?o<1?e.y:t.y:o>0?t.y:e.y}}function Vd(e,t,o,n){let i={x:e.cp2x,y:e.cp2y},r={x:t.cp1x,y:t.cp1y},a=Oe(e,i,o),s=Oe(i,r,o),l=Oe(r,t,o),c=Oe(a,s,o),d=Oe(s,l,o);return Oe(c,d,o)}var w1=new Map;function T6(e,t){t=t||{};let o=e+JSON.stringify(t),n=w1.get(o);return n||(n=new Intl.NumberFormat(e,t),w1.set(o,n)),n}function en(e,t,o){return T6(t,o).format(e)}var k6=function(e,t){return {x(o){return e+e+t-o},setWidth(o){t=o;},textAlign(o){return o==="center"?o:o==="right"?"left":"right"},xPlus(o,n){return o-n},leftForLtr(o,n){return o-n}}},w6=function(){return {x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function Co(e,t,o){return e?k6(t,o):w6()}function Ss(e,t){let o,n;(t==="ltr"||t==="rtl")&&(o=e.canvas.style,n=[o.getPropertyValue("direction"),o.getPropertyPriority("direction")],o.setProperty("direction",t,"important"),e.prevTextDirection=n);}function Ts(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]));}function X1(e){return e==="angle"?{between:Jo,compare:B1,normalize:Ft}:{between:ge,compare:(t,o)=>t-o,normalize:t=>t}}function v1({start:e,end:t,count:o,loop:n,style:i}){return {start:e%o,end:t%o,loop:n&&(t-e+1)%o===0,style:i}}function v6(e,t,o){let{property:n,start:i,end:r}=o,{between:a,normalize:s}=X1(n),l=t.length,{start:c,end:d,loop:u}=e,p,h;if(u){for(c+=l,d+=l,p=0,h=l;p<h&&a(s(t[c%l][n]),i,r);++p)c--,d--;c%=l,d%=l;}return d<c&&(d+=l),{start:c,end:d,loop:u,style:e.style}}function ks(e,t,o){if(!o)return [e];let{property:n,start:i,end:r}=o,a=t.length,{compare:s,between:l,normalize:c}=X1(n),{start:d,end:u,loop:p,style:h}=v6(e,t,o),m=[],g=false,f=null,x,b,T,k=()=>l(i,T,x)&&s(i,T)!==0,w=()=>s(r,x)===0||l(r,T,x),v=()=>g||k(),_=()=>!g||w();for(let M=d,I=d;M<=u;++M)b=t[M%a],!b.skip&&(x=c(b[n]),x!==T&&(g=l(x,i,r),f===null&&v()&&(f=s(x,i)===0?M:I),f!==null&&_()&&(m.push(v1({start:f,end:M,loop:p,count:a,style:h})),f=null),I=M,T=x));return f!==null&&m.push(v1({start:f,end:u,loop:p,count:a,style:h})),m}function ws(e,t){let o=[],n=e.segments;for(let i=0;i<n.length;i++){let r=ks(n[i],e.points,t);r.length&&o.push(...r);}return o}function _6(e,t,o,n){let i=0,r=t-1;if(o&&!n)for(;i<t&&!e[i].skip;)i++;for(;i<t&&e[i].skip;)i++;for(i%=t,o&&(r+=i);r>i&&e[r%t].skip;)r--;return r%=t,{start:i,end:r}}function A6(e,t,o,n){let i=e.length,r=[],a=t,s=e[t],l;for(l=t+1;l<=o;++l){let c=e[l%i];c.skip||c.stop?s.skip||(n=false,r.push({start:t%i,end:(l-1)%i,loop:n}),t=a=c.stop?l:null):(a=l,s.skip&&(t=l)),s=c;}return a!==null&&r.push({start:t%i,end:a%i,loop:n}),r}function $d(e,t){let o=e.points,n=e.options.spanGaps,i=o.length;if(!i)return [];let r=!!e._loop,{start:a,end:s}=_6(o,i,r,n);if(n===true)return _1(e,[{start:a,end:s,loop:r}],o,t);let l=s<a?s+i:s,c=!!e._fullLoop&&a===0&&s===i-1;return _1(e,A6(o,a,l,c),o,t)}function _1(e,t,o,n){return !n||!n.setContext||!o?t:M6(e,t,o,n)}function M6(e,t,o,n){let i=e._chart.getContext(),r=A1(e.options),{_datasetIndex:a,options:{spanGaps:s}}=e,l=o.length,c=[],d=r,u=t[0].start,p=u;function h(m,g,f,x){let b=s?-1:1;if(m!==g){for(m+=l;o[m%l].skip;)m-=b;for(;o[g%l].skip;)g+=b;m%l!==g%l&&(c.push({start:m%l,end:g%l,loop:f,style:x}),d=x,u=g%l);}}for(let m of t){u=s?u:m.start;let g=o[u%l],f;for(p=u+1;p<=m.end;p++){let x=o[p%l];f=A1(n.setContext(Me(i,{type:"segment",p0:g,p1:x,p0DataIndex:(p-1)%l,p1DataIndex:p%l,datasetIndex:a}))),I6(f,d)&&h(u,p-1,m.loop,d),g=x,d=f;}u<p-1&&h(u,p-1,m.loop,d);}return c}function A1(e){return {backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function I6(e,t){return t&&JSON.stringify(e)!==JSON.stringify(t)}var Qd=class{constructor(){this._request=null,this._charts=new Map,this._running=false,this._lastDate=void 0;}_notify(t,o,n,i){let r=o.listeners[i],a=o.duration;r.forEach(s=>s({chart:t,initial:o.initial,numSteps:a,currentStep:Math.min(n-o.start,a)}));}_refresh(){this._request||(this._running=true,this._request=ls.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh();}));}_update(t=Date.now()){let o=0;this._charts.forEach((n,i)=>{if(!n.running||!n.items.length)return;let r=n.items,a=r.length-1,s=false,l;for(;a>=0;--a)l=r[a],l._active?(l._total>n.duration&&(n.duration=l._total),l.tick(t),s=true):(r[a]=r[r.length-1],r.pop());s&&(i.draw(),this._notify(i,n,t,"progress")),r.length||(n.running=false,this._notify(i,n,t,"complete"),n.initial=false),o+=r.length;}),this._lastDate=t,o===0&&(this._running=false);}_getAnims(t){let o=this._charts,n=o.get(t);return n||(n={running:false,initial:true,items:[],listeners:{complete:[],progress:[]}},o.set(t,n)),n}listen(t,o,n){this._getAnims(t).listeners[o].push(n);}add(t,o){!o||!o.length||this._getAnims(t).items.push(...o);}has(t){return this._getAnims(t).items.length>0}start(t){let o=this._charts.get(t);o&&(o.running=true,o.start=Date.now(),o.duration=o.items.reduce((n,i)=>Math.max(n,i._duration),0),this._refresh());}running(t){if(!this._running)return false;let o=this._charts.get(t);return !(!o||!o.running||!o.items.length)}stop(t){let o=this._charts.get(t);if(!o||!o.items.length)return;let n=o.items,i=n.length-1;for(;i>=0;--i)n[i].cancel();o.items=[],this._notify(t,o,Date.now(),"complete");}remove(t){return this._charts.delete(t)}},je=new Qd,K1="transparent",E6={boolean(e,t,o){return o>.5?t:e},color(e,t,o){let n=tn(e||K1),i=n.valid&&tn(t||K1);return i&&i.valid?i.mix(n,o).hexString():t},number(e,t,o){return e+(t-e)*o}},Jd=class{constructor(t,o,n,i){let r=o[n];i=rt([t.to,i,r,t.from]);let a=rt([t.from,r,i]);this._active=true,this._fn=t.fn||E6[t.type||typeof a],this._easing=Yo[t.easing]||Yo.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=o,this._prop=n,this._from=a,this._to=i,this._promises=void 0;}active(){return this._active}update(t,o,n){if(this._active){this._notify(false);let i=this._target[this._prop],r=n-this._start,a=this._duration-r;this._start=n,this._duration=Math.floor(Math.max(a,t.duration)),this._total+=r,this._loop=!!t.loop,this._to=rt([t.to,o,i,t.from]),this._from=rt([t.from,i,o]);}}cancel(){this._active&&(this.tick(Date.now()),this._active=false,this._notify(false));}tick(t){let o=t-this._start,n=this._duration,i=this._prop,r=this._from,a=this._loop,s=this._to,l;if(this._active=r!==s&&(a||o<n),!this._active){this._target[i]=s,this._notify(true);return}if(o<0){this._target[i]=r;return}l=o/n%2,l=a&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[i]=this._fn(r,s,l);}wait(){let t=this._promises||(this._promises=[]);return new Promise((o,n)=>{t.push({res:o,rej:n});})}_notify(t){let o=t?"res":"rej",n=this._promises||[];for(let i=0;i<n.length;i++)n[i][o]();}},F6=["x","y","borderWidth","radius","tension"],L6=["color","borderColor","backgroundColor"];H.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0});var B6=Object.keys(H.animation);H.describe("animation",{_fallback:false,_indexable:false,_scriptable:e=>e!=="onProgress"&&e!=="onComplete"&&e!=="fn"});H.set("animations",{colors:{type:"color",properties:L6},numbers:{type:"number",properties:F6}});H.describe("animations",{_fallback:"animation"});H.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:e=>e|0}}}});var Wn=class{constructor(t,o){this._chart=t,this._properties=new Map,this.configure(o);}configure(t){if(!z(t))return;let o=this._properties;Object.getOwnPropertyNames(t).forEach(n=>{let i=t[n];if(!z(i))return;let r={};for(let a of B6)r[a]=i[a];(Z(i.properties)&&i.properties||[n]).forEach(a=>{(a===n||!o.has(a))&&o.set(a,r);});});}_animateOptions(t,o){let n=o.options,i=D6(t,n);if(!i)return [];let r=this._createAnimations(i,n);return n.$shared&&R6(t.options.$animations,n).then(()=>{t.options=n;},()=>{}),r}_createAnimations(t,o){let n=this._properties,i=[],r=t.$animations||(t.$animations={}),a=Object.keys(o),s=Date.now(),l;for(l=a.length-1;l>=0;--l){let c=a[l];if(c.charAt(0)==="$")continue;if(c==="options"){i.push(...this._animateOptions(t,o));continue}let d=o[c],u=r[c],p=n.get(c);if(u)if(p&&u.active()){u.update(p,d,s);continue}else u.cancel();if(!p||!p.duration){t[c]=d;continue}r[c]=u=new Jd(p,t,c,d),i.push(u);}return i}update(t,o){if(this._properties.size===0){Object.assign(t,o);return}let n=this._createAnimations(t,o);if(n.length)return je.add(this._chart,n),true}};function R6(e,t){let o=[],n=Object.keys(t);for(let i=0;i<n.length;i++){let r=e[n[i]];r&&r.active()&&o.push(r.wait());}return Promise.all(o)}function D6(e,t){if(!t)return;let o=e.options;if(!o){e.options=t;return}return o.$shared&&(e.options=o=Object.assign({},o,{$shared:false,$animations:{}})),o}function q1(e,t){let o=e&&e.options||{},n=o.reverse,i=o.min===void 0?t:0,r=o.max===void 0?t:0;return {start:n?r:i,end:n?i:r}}function N6(e,t,o){if(o===false)return false;let n=q1(e,o),i=q1(t,o);return {top:i.end,right:n.end,bottom:i.start,left:n.start}}function U6(e){let t,o,n,i;return z(e)?(t=e.top,o=e.right,n=e.bottom,i=e.left):t=o=n=i=e,{top:t,right:o,bottom:n,left:i,disabled:e===false}}function z0(e,t){let o=[],n=e._getSortedDatasetMetas(t),i,r;for(i=0,r=n.length;i<r;++i)o.push(n[i].index);return o}function Q1(e,t,o,n={}){let i=e.keys,r=n.mode==="single",a,s,l,c;if(t!==null){for(a=0,s=i.length;a<s;++a){if(l=+i[a],l===o){if(n.all)continue;break}c=e.values[l],lt(c)&&(r||t===0||re(t)===re(c))&&(t+=c);}return t}}function O6(e){let t=Object.keys(e),o=new Array(t.length),n,i,r;for(n=0,i=t.length;n<i;++n)r=t[n],o[n]={x:r,y:e[r]};return o}function J1(e,t){let o=e&&e.options.stacked;return o||o===void 0&&t.stack!==void 0}function z6(e,t,o){return `${e.id}.${t.id}.${o.stack||o.type}`}function V6(e){let{min:t,max:o,minDefined:n,maxDefined:i}=e.getUserBounds();return {min:n?t:Number.NEGATIVE_INFINITY,max:i?o:Number.POSITIVE_INFINITY}}function $6(e,t,o){let n=e[t]||(e[t]={});return n[o]||(n[o]={})}function t0(e,t,o,n){for(let i of t.getMatchingVisibleMetas(n).reverse()){let r=e[i.index];if(o&&r>0||!o&&r<0)return i.index}return null}function e0(e,t){let{chart:o,_cachedMeta:n}=e,i=o._stacks||(o._stacks={}),{iScale:r,vScale:a,index:s}=n,l=r.axis,c=a.axis,d=z6(r,a,n),u=t.length,p;for(let h=0;h<u;++h){let m=t[h],{[l]:g,[c]:f}=m,x=m._stacks||(m._stacks={});p=x[c]=$6(i,d,g),p[s]=f,p._top=t0(p,a,true,n.type),p._bottom=t0(p,a,false,n.type);}}function Hd(e,t){let o=e.scales;return Object.keys(o).filter(n=>o[n].axis===t).shift()}function H6(e,t){return Me(e,{active:false,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function W6(e,t,o){return Me(e,{active:false,dataIndex:t,parsed:void 0,raw:void 0,element:o,index:t,mode:"default",type:"data"})}function Ki(e,t){let o=e.controller.index,n=e.vScale&&e.vScale.axis;if(n){t=t||e._parsed;for(let i of t){let r=i._stacks;if(!r||r[n]===void 0||r[n][o]===void 0)return;delete r[n][o];}}}var Wd=e=>e==="reset"||e==="none",o0=(e,t)=>t?e:Object.assign({},e),G6=(e,t,o)=>e&&!t.hidden&&t._stacked&&{keys:z0(o,true),values:null},qt=class{constructor(t,o){this.chart=t,this._ctx=t.ctx,this.index=o,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=false,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=false,this.supportsDecimation=false,this.$context=void 0,this._syncList=[],this.initialize();}initialize(){let t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=J1(t.vScale,t),this.addElements();}updateIndex(t){this.index!==t&&Ki(this._cachedMeta),this.index=t;}linkScales(){let t=this.chart,o=this._cachedMeta,n=this.getDataset(),i=(u,p,h,m)=>u==="x"?p:u==="r"?m:h,r=o.xAxisID=N(n.xAxisID,Hd(t,"x")),a=o.yAxisID=N(n.yAxisID,Hd(t,"y")),s=o.rAxisID=N(n.rAxisID,Hd(t,"r")),l=o.indexAxis,c=o.iAxisID=i(l,r,a,s),d=o.vAxisID=i(l,a,r,s);o.xScale=this.getScaleForId(r),o.yScale=this.getScaleForId(a),o.rScale=this.getScaleForId(s),o.iScale=this.getScaleForId(c),o.vScale=this.getScaleForId(d);}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){let o=this._cachedMeta;return t===o.iScale?o.vScale:o.iScale}reset(){this._update("reset");}_destroy(){let t=this._cachedMeta;this._data&&as(this._data,this),t._stacked&&Ki(t);}_dataCheck(){let t=this.getDataset(),o=t.data||(t.data=[]),n=this._data;if(z(o))this._data=O6(o);else if(n!==o){if(n){as(n,this);let i=this._cachedMeta;Ki(i),i._parsed=[];}o&&Object.isExtensible(o)&&kd(o,this),this._syncList=[],this._data=o;}}addElements(){let t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType);}buildOrUpdateElements(t){let o=this._cachedMeta,n=this.getDataset(),i=false;this._dataCheck();let r=o._stacked;o._stacked=J1(o.vScale,o),o.stack!==n.stack&&(i=true,Ki(o),o.stack=n.stack),this._resyncElements(t),(i||r!==o._stacked)&&e0(this,o._parsed);}configure(){let t=this.chart.config,o=t.datasetScopeKeys(this._type),n=t.getOptionScopes(this.getDataset(),o,true);this.options=t.createResolver(n,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={};}parse(t,o){let{_cachedMeta:n,_data:i}=this,{iScale:r,_stacked:a}=n,s=r.axis,l=t===0&&o===i.length?true:n._sorted,c=t>0&&n._parsed[t-1],d,u,p;if(this._parsing===false)n._parsed=i,n._sorted=true,p=i;else {Z(i[t])?p=this.parseArrayData(n,i,t,o):z(i[t])?p=this.parseObjectData(n,i,t,o):p=this.parsePrimitiveData(n,i,t,o);let h=()=>u[s]===null||c&&u[s]<c[s];for(d=0;d<o;++d)n._parsed[d+t]=u=p[d],l&&(h()&&(l=false),c=u);n._sorted=l;}a&&e0(this,p);}parsePrimitiveData(t,o,n,i){let{iScale:r,vScale:a}=t,s=r.axis,l=a.axis,c=r.getLabels(),d=r===a,u=new Array(i),p,h,m;for(p=0,h=i;p<h;++p)m=p+n,u[p]={[s]:d||r.parse(c[m],m),[l]:a.parse(o[m],m)};return u}parseArrayData(t,o,n,i){let{xScale:r,yScale:a}=t,s=new Array(i),l,c,d,u;for(l=0,c=i;l<c;++l)d=l+n,u=o[d],s[l]={x:r.parse(u[0],d),y:a.parse(u[1],d)};return s}parseObjectData(t,o,n,i){let{xScale:r,yScale:a}=t,{xAxisKey:s="x",yAxisKey:l="y"}=this._parsing,c=new Array(i),d,u,p,h;for(d=0,u=i;d<u;++d)p=d+n,h=o[p],c[d]={x:r.parse(Ae(h,s),p),y:a.parse(Ae(h,l),p)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,o,n){let i=this.chart,r=this._cachedMeta,a=o[t.axis],s={keys:z0(i,true),values:o._stacks[t.axis]};return Q1(s,a,r.index,{mode:n})}updateRangeFromParsed(t,o,n,i){let r=n[o.axis],a=r===null?NaN:r,s=i&&n._stacks[o.axis];i&&s&&(i.values=s,a=Q1(i,r,this._cachedMeta.index)),t.min=Math.min(t.min,a),t.max=Math.max(t.max,a);}getMinMax(t,o){let n=this._cachedMeta,i=n._parsed,r=n._sorted&&t===n.iScale,a=i.length,s=this._getOtherScale(t),l=G6(o,n,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:d,max:u}=V6(s),p,h;function m(){h=i[p];let g=h[s.axis];return !lt(h[t.axis])||d>g||u<g}for(p=0;p<a&&!(!m()&&(this.updateRangeFromParsed(c,t,h,l),r));++p);if(r){for(p=a-1;p>=0;--p)if(!m()){this.updateRangeFromParsed(c,t,h,l);break}}return c}getAllParsedValues(t){let o=this._cachedMeta._parsed,n=[],i,r,a;for(i=0,r=o.length;i<r;++i)a=o[i][t.axis],lt(a)&&n.push(a);return n}getMaxOverflow(){return false}getLabelAndValue(t){let o=this._cachedMeta,n=o.iScale,i=o.vScale,r=this.getParsed(t);return {label:n?""+n.getLabelForValue(r[n.axis]):"",value:i?""+i.getLabelForValue(r[i.axis]):""}}_update(t){let o=this._cachedMeta;this.update(t||"default"),o._clip=U6(N(this.options.clip,N6(o.xScale,o.yScale,this.getMaxOverflow())));}update(t){}draw(){let t=this._ctx,o=this.chart,n=this._cachedMeta,i=n.data||[],r=o.chartArea,a=[],s=this._drawStart||0,l=this._drawCount||i.length-s,c=this.options.drawActiveElementsOnTop,d;for(n.dataset&&n.dataset.draw(t,r,s,l),d=s;d<s+l;++d){let u=i[d];u.hidden||(u.active&&c?a.push(u):u.draw(t,r));}for(d=0;d<a.length;++d)a[d].draw(t,r);}getStyle(t,o){let n=o?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(n):this.resolveDataElementOptions(t||0,n)}getContext(t,o,n){let i=this.getDataset(),r;if(t>=0&&t<this._cachedMeta.data.length){let a=this._cachedMeta.data[t];r=a.$context||(a.$context=W6(this.getContext(),t,a)),r.parsed=this.getParsed(t),r.raw=i.data[t],r.index=r.dataIndex=t;}else r=this.$context||(this.$context=H6(this.chart.getContext(),this.index)),r.dataset=i,r.index=r.datasetIndex=this.index;return r.active=!!o,r.mode=n,r}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,o){return this._resolveElementOptions(this.dataElementType.id,o,t)}_resolveElementOptions(t,o="default",n){let i=o==="active",r=this._cachedDataOpts,a=t+"-"+o,s=r[a],l=this.enableOptionSharing&&st(n);if(s)return o0(s,l);let c=this.chart.config,d=c.datasetElementScopeKeys(this._type,t),u=i?[`${t}Hover`,"hover",t,""]:[t,""],p=c.getOptionScopes(this.getDataset(),d),h=Object.keys(H.elements[t]),m=()=>this.getContext(n,i),g=c.resolveNamedOptions(p,h,m,u);return g.$shared&&(g.$shared=l,r[a]=Object.freeze(o0(g,l))),g}_resolveAnimations(t,o,n){let i=this.chart,r=this._cachedDataOpts,a=`animation-${o}`,s=r[a];if(s)return s;let l;if(i.options.animation!==false){let d=this.chart.config,u=d.datasetAnimationScopeKeys(this._type,o),p=d.getOptionScopes(this.getDataset(),u);l=d.createResolver(p,this.getContext(t,n,o));}let c=new Wn(i,l&&l.animations);return l&&l._cacheable&&(r[a]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,o){return !o||Wd(t)||this.chart._animationsDisabled}_getSharedOptions(t,o){let n=this.resolveDataElementOptions(t,o),i=this._sharedOptions,r=this.getSharedOptions(n),a=this.includeOptions(o,r)||r!==i;return this.updateSharedOptions(r,o,n),{sharedOptions:r,includeOptions:a}}updateElement(t,o,n,i){Wd(i)?Object.assign(t,n):this._resolveAnimations(o,i).update(t,n);}updateSharedOptions(t,o,n){t&&!Wd(o)&&this._resolveAnimations(void 0,o).update(t,n);}_setStyle(t,o,n,i){t.active=i;let r=this.getStyle(o,i);this._resolveAnimations(o,n,i).update(t,{options:!i&&this.getSharedOptions(r)||r});}removeHoverStyle(t,o,n){this._setStyle(t,n,"active",false);}setHoverStyle(t,o,n){this._setStyle(t,n,"active",true);}_removeDatasetHoverStyle(){let t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",false);}_setDatasetHoverStyle(){let t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",true);}_resyncElements(t){let o=this._data,n=this._cachedMeta.data;for(let[s,l,c]of this._syncList)this[s](l,c);this._syncList=[];let i=n.length,r=o.length,a=Math.min(r,i);a&&this.parse(0,a),r>i?this._insertElements(i,r-i,t):r<i&&this._removeElements(r,i-r);}_insertElements(t,o,n=true){let i=this._cachedMeta,r=i.data,a=t+o,s,l=c=>{for(c.length+=o,s=c.length-1;s>=a;s--)c[s]=c[s-o];};for(l(r),s=t;s<a;++s)r[s]=new this.dataElementType;this._parsing&&l(i._parsed),this.parse(t,o),n&&this.updateElements(r,t,o,"reset");}updateElements(t,o,n,i){}_removeElements(t,o){let n=this._cachedMeta;if(this._parsing){let i=n._parsed.splice(t,o);n._stacked&&Ki(n,i);}n.data.splice(t,o);}_sync(t){if(this._parsing)this._syncList.push(t);else {let[o,n,i]=t;this[o](n,i);}this.chart._dataChanges.push([this.index,...t]);}_onDataPush(){let t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t]);}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1]);}_onDataShift(){this._sync(["_removeElements",0,1]);}_onDataSplice(t,o){o&&this._sync(["_removeElements",t,o]);let n=arguments.length-2;n&&this._sync(["_insertElements",t,n]);}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length]);}};qt.defaults={};qt.prototype.datasetElementType=null;qt.prototype.dataElementType=null;function j6(e,t){if(!e._cache.$bar){let o=e.getMatchingVisibleMetas(t),n=[];for(let i=0,r=o.length;i<r;i++)n=n.concat(o[i].controller.getAllParsedValues(e));e._cache.$bar=ss(n.sort((i,r)=>i-r));}return e._cache.$bar}function Y6(e){let t=e.iScale,o=j6(t,e.type),n=t._length,i,r,a,s,l=()=>{a===32767||a===-32768||(st(s)&&(n=Math.min(n,Math.abs(a-s)||n)),s=a);};for(i=0,r=o.length;i<r;++i)a=t.getPixelForValue(o[i]),l();for(s=void 0,i=0,r=t.ticks.length;i<r;++i)a=t.getPixelForTick(i),l();return n}function Z6(e,t,o,n){let i=o.barThickness,r,a;return W(i)?(r=t.min*o.categoryPercentage,a=o.barPercentage):(r=i*n,a=1),{chunk:r/n,ratio:a,start:t.pixels[e]-r/2}}function X6(e,t,o,n){let i=t.pixels,r=i[e],a=e>0?i[e-1]:null,s=e<i.length-1?i[e+1]:null,l=o.categoryPercentage;a===null&&(a=r-(s===null?t.end-t.start:s-r)),s===null&&(s=r+r-a);let c=r-(r-Math.min(a,s))/2*l;return {chunk:Math.abs(s-a)/2*l/n,ratio:o.barPercentage,start:c}}function K6(e,t,o,n){let i=o.parse(e[0],n),r=o.parse(e[1],n),a=Math.min(i,r),s=Math.max(i,r),l=a,c=s;Math.abs(a)>Math.abs(s)&&(l=s,c=a),t[o.axis]=c,t._custom={barStart:l,barEnd:c,start:i,end:r,min:a,max:s};}function V0(e,t,o,n){return Z(e)?K6(e,t,o,n):t[o.axis]=o.parse(e,n),t}function n0(e,t,o,n){let i=e.iScale,r=e.vScale,a=i.getLabels(),s=i===r,l=[],c,d,u,p;for(c=o,d=o+n;c<d;++c)p=t[c],u={},u[i.axis]=s||i.parse(a[c],c),l.push(V0(p,u,r,c));return l}function Gd(e){return e&&e.barStart!==void 0&&e.barEnd!==void 0}function q6(e,t,o){return e!==0?re(e):(t.isHorizontal()?1:-1)*(t.min>=o?1:-1)}function Q6(e){let t,o,n,i,r;return e.horizontal?(t=e.base>e.x,o="left",n="right"):(t=e.base<e.y,o="bottom",n="top"),t?(i="end",r="start"):(i="start",r="end"),{start:o,end:n,reverse:t,top:i,bottom:r}}function J6(e,t,o,n){let i=t.borderSkipped,r={};if(!i){e.borderSkipped=r;return}if(i===true){e.borderSkipped={top:true,right:true,bottom:true,left:true};return}let{start:a,end:s,reverse:l,top:c,bottom:d}=Q6(e);i==="middle"&&o&&(e.enableBorderRadius=true,(o._top||0)===n?i=c:(o._bottom||0)===n?i=d:(r[i0(d,a,s,l)]=true,i=c)),r[i0(i,a,s,l)]=true,e.borderSkipped=r;}function i0(e,t,o,n){return n?(e=t_(e,t,o),e=r0(e,o,t)):e=r0(e,t,o),e}function t_(e,t,o){return e===t?o:e===o?t:e}function r0(e,t,o){return e==="start"?t:e==="end"?o:e}function e_(e,{inflateAmount:t},o){e.inflateAmount=t==="auto"?o===1?.33:0:t;}var nn=class extends qt{parsePrimitiveData(t,o,n,i){return n0(t,o,n,i)}parseArrayData(t,o,n,i){return n0(t,o,n,i)}parseObjectData(t,o,n,i){let{iScale:r,vScale:a}=t,{xAxisKey:s="x",yAxisKey:l="y"}=this._parsing,c=r.axis==="x"?s:l,d=a.axis==="x"?s:l,u=[],p,h,m,g;for(p=n,h=n+i;p<h;++p)g=o[p],m={},m[r.axis]=r.parse(Ae(g,c),p),u.push(V0(Ae(g,d),m,a,p));return u}updateRangeFromParsed(t,o,n,i){super.updateRangeFromParsed(t,o,n,i);let r=n._custom;r&&o===this._cachedMeta.vScale&&(t.min=Math.min(t.min,r.min),t.max=Math.max(t.max,r.max));}getMaxOverflow(){return 0}getLabelAndValue(t){let o=this._cachedMeta,{iScale:n,vScale:i}=o,r=this.getParsed(t),a=r._custom,s=Gd(a)?"["+a.start+", "+a.end+"]":""+i.getLabelForValue(r[i.axis]);return {label:""+n.getLabelForValue(r[n.axis]),value:s}}initialize(){this.enableOptionSharing=true,super.initialize();let t=this._cachedMeta;t.stack=this.getDataset().stack;}update(t){let o=this._cachedMeta;this.updateElements(o.data,0,o.data.length,t);}updateElements(t,o,n,i){let r=i==="reset",{index:a,_cachedMeta:{vScale:s}}=this,l=s.getBasePixel(),c=s.isHorizontal(),d=this._getRuler(),{sharedOptions:u,includeOptions:p}=this._getSharedOptions(o,i);for(let h=o;h<o+n;h++){let m=this.getParsed(h),g=r||W(m[s.axis])?{base:l,head:l}:this._calculateBarValuePixels(h),f=this._calculateBarIndexPixels(h,d),x=(m._stacks||{})[s.axis],b={horizontal:c,base:g.base,enableBorderRadius:!x||Gd(m._custom)||a===x._top||a===x._bottom,x:c?g.head:f.center,y:c?f.center:g.head,height:c?f.size:Math.abs(g.size),width:c?Math.abs(g.size):f.size};p&&(b.options=u||this.resolveDataElementOptions(h,t[h].active?"active":i));let T=b.options||t[h].options;J6(b,T,x,a),e_(b,T,d.ratio),this.updateElement(t[h],h,b,i);}}_getStacks(t,o){let{iScale:n}=this._cachedMeta,i=n.getMatchingVisibleMetas(this._type).filter(l=>l.controller.options.grouped),r=n.options.stacked,a=[],s=l=>{let c=l.controller.getParsed(o),d=c&&c[l.vScale.axis];if(W(d)||isNaN(d))return true};for(let l of i)if(!(o!==void 0&&s(l))&&((r===false||a.indexOf(l.stack)===-1||r===void 0&&l.stack===void 0)&&a.push(l.stack),l.index===t))break;return a.length||a.push(void 0),a}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,o,n){let i=this._getStacks(t,n),r=o!==void 0?i.indexOf(o):-1;return r===-1?i.length-1:r}_getRuler(){let t=this.options,o=this._cachedMeta,n=o.iScale,i=[],r,a;for(r=0,a=o.data.length;r<a;++r)i.push(n.getPixelForValue(this.getParsed(r)[n.axis],r));let s=t.barThickness;return {min:s||Y6(o),pixels:i,start:n._startPixel,end:n._endPixel,stackCount:this._getStackCount(),scale:n,grouped:t.grouped,ratio:s?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){let{_cachedMeta:{vScale:o,_stacked:n},options:{base:i,minBarLength:r}}=this,a=i||0,s=this.getParsed(t),l=s._custom,c=Gd(l),d=s[o.axis],u=0,p=n?this.applyStack(o,s,n):d,h,m;p!==d&&(u=p-d,p=d),c&&(d=l.barStart,p=l.barEnd-l.barStart,d!==0&&re(d)!==re(l.barEnd)&&(u=0),u+=d);let g=!W(i)&&!c?i:u,f=o.getPixelForValue(g);if(this.chart.getDataVisibility(t)?h=o.getPixelForValue(u+p):h=f,m=h-f,Math.abs(m)<r){m=q6(m,o,a)*r,d===a&&(f-=m/2);let x=o.getPixelForDecimal(0),b=o.getPixelForDecimal(1),T=Math.min(x,b),k=Math.max(x,b);f=Math.max(Math.min(f,k),T),h=f+m;}if(f===o.getPixelForValue(a)){let x=re(m)*o.getLineWidthForValue(a)/2;f+=x,m-=x;}return {size:m,base:f,head:h,center:h+m/2}}_calculateBarIndexPixels(t,o){let n=o.scale,i=this.options,r=i.skipNull,a=N(i.maxBarThickness,1/0),s,l;if(o.grouped){let c=r?this._getStackCount(t):o.stackCount,d=i.barThickness==="flex"?X6(t,o,i,c):Z6(t,o,i,c),u=this._getStackIndex(this.index,this._cachedMeta.stack,r?t:void 0);s=d.start+d.chunk*u+d.chunk/2,l=Math.min(a,d.chunk*d.ratio);}else s=n.getPixelForValue(this.getParsed(t)[n.axis],t),l=Math.min(a,o.min*o.ratio);return {base:s-l/2,head:s+l/2,center:s,size:l}}draw(){let t=this._cachedMeta,o=t.vScale,n=t.data,i=n.length,r=0;for(;r<i;++r)this.getParsed(r)[o.axis]!==null&&n[r].draw(this._ctx);}};nn.id="bar";nn.defaults={datasetElementType:false,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:true,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}};nn.overrides={scales:{_index_:{type:"category",offset:true,grid:{offset:true}},_value_:{type:"linear",beginAtZero:true}}};var Gn=class extends qt{initialize(){this.enableOptionSharing=true,super.initialize();}parsePrimitiveData(t,o,n,i){let r=super.parsePrimitiveData(t,o,n,i);for(let a=0;a<r.length;a++)r[a]._custom=this.resolveDataElementOptions(a+n).radius;return r}parseArrayData(t,o,n,i){let r=super.parseArrayData(t,o,n,i);for(let a=0;a<r.length;a++){let s=o[n+a];r[a]._custom=N(s[2],this.resolveDataElementOptions(a+n).radius);}return r}parseObjectData(t,o,n,i){let r=super.parseObjectData(t,o,n,i);for(let a=0;a<r.length;a++){let s=o[n+a];r[a]._custom=N(s&&s.r&&+s.r,this.resolveDataElementOptions(a+n).radius);}return r}getMaxOverflow(){let t=this._cachedMeta.data,o=0;for(let n=t.length-1;n>=0;--n)o=Math.max(o,t[n].size(this.resolveDataElementOptions(n))/2);return o>0&&o}getLabelAndValue(t){let o=this._cachedMeta,{xScale:n,yScale:i}=o,r=this.getParsed(t),a=n.getLabelForValue(r.x),s=i.getLabelForValue(r.y),l=r._custom;return {label:o.label,value:"("+a+", "+s+(l?", "+l:"")+")"}}update(t){let o=this._cachedMeta.data;this.updateElements(o,0,o.length,t);}updateElements(t,o,n,i){let r=i==="reset",{iScale:a,vScale:s}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(o,i),d=a.axis,u=s.axis;for(let p=o;p<o+n;p++){let h=t[p],m=!r&&this.getParsed(p),g={},f=g[d]=r?a.getPixelForDecimal(.5):a.getPixelForValue(m[d]),x=g[u]=r?s.getBasePixel():s.getPixelForValue(m[u]);g.skip=isNaN(f)||isNaN(x),c&&(g.options=l||this.resolveDataElementOptions(p,h.active?"active":i),r&&(g.options.radius=0)),this.updateElement(h,p,g,i);}}resolveDataElementOptions(t,o){let n=this.getParsed(t),i=super.resolveDataElementOptions(t,o);i.$shared&&(i=Object.assign({},i,{$shared:false}));let r=i.radius;return o!=="active"&&(i.radius=0),i.radius+=N(n&&n._custom,r),i}};Gn.id="bubble";Gn.defaults={datasetElementType:false,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}};Gn.overrides={scales:{x:{type:"linear"},y:{type:"linear"}},plugins:{tooltip:{callbacks:{title(){return ""}}}}};function o_(e,t,o){let n=1,i=1,r=0,a=0;if(t<Q){let s=e,l=s+t,c=Math.cos(s),d=Math.sin(s),u=Math.cos(l),p=Math.sin(l),h=(T,k,w)=>Jo(T,s,l,true)?1:Math.max(k,k*o,w,w*o),m=(T,k,w)=>Jo(T,s,l,true)?-1:Math.min(k,k*o,w,w*o),g=h(0,c,u),f=h(et,d,p),x=m(G,c,u),b=m(G+et,d,p);n=(g-x)/2,i=(f-b)/2,r=-(g+x)/2,a=-(f+b)/2;}return {ratioX:n,ratioY:i,offsetX:r,offsetY:a}}var To=class extends qt{constructor(t,o){super(t,o),this.enableOptionSharing=true,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0;}linkScales(){}parse(t,o){let n=this.getDataset().data,i=this._cachedMeta;if(this._parsing===false)i._parsed=n;else {let r=l=>+n[l];if(z(n[t])){let{key:l="value"}=this._parsing;r=c=>+Ae(n[c],l);}let a,s;for(a=t,s=t+o;a<s;++a)i._parsed[a]=r(a);}}_getRotation(){return gt(this.options.rotation-90)}_getCircumference(){return gt(this.options.circumference)}_getRotationExtents(){let t=Q,o=-Q;for(let n=0;n<this.chart.data.datasets.length;++n)if(this.chart.isDatasetVisible(n)){let i=this.chart.getDatasetMeta(n).controller,r=i._getRotation(),a=i._getCircumference();t=Math.min(t,r),o=Math.max(o,r+a);}return {rotation:t,circumference:o-t}}update(t){let o=this.chart,{chartArea:n}=o,i=this._cachedMeta,r=i.data,a=this.getMaxBorderWidth()+this.getMaxOffset(r)+this.options.spacing,s=Math.max((Math.min(n.width,n.height)-a)/2,0),l=Math.min(yd(this.options.cutout,s),1),c=this._getRingWeight(this.index),{circumference:d,rotation:u}=this._getRotationExtents(),{ratioX:p,ratioY:h,offsetX:m,offsetY:g}=o_(u,d,l),f=(n.width-a)/p,x=(n.height-a)/h,b=Math.max(Math.min(f,x)/2,0),T=ts(this.options.radius,b),k=Math.max(T*l,0),w=(T-k)/this._getVisibleDatasetWeightTotal();this.offsetX=m*T,this.offsetY=g*T,i.total=this.calculateTotal(),this.outerRadius=T-w*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-w*c,0),this.updateElements(r,0,r.length,t);}_circumference(t,o){let n=this.options,i=this._cachedMeta,r=this._getCircumference();return o&&n.animation.animateRotate||!this.chart.getDataVisibility(t)||i._parsed[t]===null||i.data[t].hidden?0:this.calculateCircumference(i._parsed[t]*r/Q)}updateElements(t,o,n,i){let r=i==="reset",a=this.chart,s=a.chartArea,c=a.options.animation,d=(s.left+s.right)/2,u=(s.top+s.bottom)/2,p=r&&c.animateScale,h=p?0:this.innerRadius,m=p?0:this.outerRadius,{sharedOptions:g,includeOptions:f}=this._getSharedOptions(o,i),x=this._getRotation(),b;for(b=0;b<o;++b)x+=this._circumference(b,r);for(b=o;b<o+n;++b){let T=this._circumference(b,r),k=t[b],w={x:d+this.offsetX,y:u+this.offsetY,startAngle:x,endAngle:x+T,circumference:T,outerRadius:m,innerRadius:h};f&&(w.options=g||this.resolveDataElementOptions(b,k.active?"active":i)),x+=T,this.updateElement(k,b,w,i);}}calculateTotal(){let t=this._cachedMeta,o=t.data,n=0,i;for(i=0;i<o.length;i++){let r=t._parsed[i];r!==null&&!isNaN(r)&&this.chart.getDataVisibility(i)&&!o[i].hidden&&(n+=Math.abs(r));}return n}calculateCircumference(t){let o=this._cachedMeta.total;return o>0&&!isNaN(t)?Q*(Math.abs(t)/o):0}getLabelAndValue(t){let o=this._cachedMeta,n=this.chart,i=n.data.labels||[],r=en(o._parsed[t],n.options.locale);return {label:i[t]||"",value:r}}getMaxBorderWidth(t){let o=0,n=this.chart,i,r,a,s,l;if(!t){for(i=0,r=n.data.datasets.length;i<r;++i)if(n.isDatasetVisible(i)){a=n.getDatasetMeta(i),t=a.data,s=a.controller;break}}if(!t)return 0;for(i=0,r=t.length;i<r;++i)l=s.resolveDataElementOptions(i),l.borderAlign!=="inner"&&(o=Math.max(o,l.borderWidth||0,l.hoverBorderWidth||0));return o}getMaxOffset(t){let o=0;for(let n=0,i=t.length;n<i;++n){let r=this.resolveDataElementOptions(n);o=Math.max(o,r.offset||0,r.hoverOffset||0);}return o}_getRingWeightOffset(t){let o=0;for(let n=0;n<t;++n)this.chart.isDatasetVisible(n)&&(o+=this._getRingWeight(n));return o}_getRingWeight(t){return Math.max(N(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}};To.id="doughnut";To.defaults={datasetElementType:false,dataElementType:"arc",animation:{animateRotate:true,animateScale:false},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"};To.descriptors={_scriptable:e=>e!=="spacing",_indexable:e=>e!=="spacing"};To.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(e){let t=e.data;if(t.labels.length&&t.datasets.length){let{labels:{pointStyle:o}}=e.legend.options;return t.labels.map((n,i)=>{let a=e.getDatasetMeta(0).controller.getStyle(i);return {text:n,fillStyle:a.backgroundColor,strokeStyle:a.borderColor,lineWidth:a.borderWidth,pointStyle:o,hidden:!e.getDataVisibility(i),index:i}})}return []}},onClick(e,t,o){o.chart.toggleDataVisibility(t.index),o.chart.update();}},tooltip:{callbacks:{title(){return ""},label(e){let t=e.label,o=": "+e.formattedValue;return Z(t)?(t=t.slice(),t[0]+=o):t+=o,t}}}}};var jn=class extends qt{initialize(){this.enableOptionSharing=true,this.supportsDecimation=true,super.initialize();}update(t){let o=this._cachedMeta,{dataset:n,data:i=[],_dataset:r}=o,a=this.chart._animationsDisabled,{start:s,count:l}=ds(o,i,a);this._drawStart=s,this._drawCount=l,us(o)&&(s=0,l=i.length),n._chart=this.chart,n._datasetIndex=this.index,n._decimated=!!r._decimated,n.points=i;let c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(n,void 0,{animated:!a,options:c},t),this.updateElements(i,s,l,t);}updateElements(t,o,n,i){let r=i==="reset",{iScale:a,vScale:s,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:d,includeOptions:u}=this._getSharedOptions(o,i),p=a.axis,h=s.axis,{spanGaps:m,segment:g}=this.options,f=Kt(m)?m:Number.POSITIVE_INFINITY,x=this.chart._animationsDisabled||r||i==="none",b=o>0&&this.getParsed(o-1);for(let T=o;T<o+n;++T){let k=t[T],w=this.getParsed(T),v=x?k:{},_=W(w[h]),M=v[p]=a.getPixelForValue(w[p],T),I=v[h]=r||_?s.getBasePixel():s.getPixelForValue(l?this.applyStack(s,w,l):w[h],T);v.skip=isNaN(M)||isNaN(I)||_,v.stop=T>0&&Math.abs(w[p]-b[p])>f,g&&(v.parsed=w,v.raw=c.data[T]),u&&(v.options=d||this.resolveDataElementOptions(T,k.active?"active":i)),x||this.updateElement(k,T,v,i),b=w;}}getMaxOverflow(){let t=this._cachedMeta,o=t.dataset,n=o.options&&o.options.borderWidth||0,i=t.data||[];if(!i.length)return n;let r=i[0].size(this.resolveDataElementOptions(0)),a=i[i.length-1].size(this.resolveDataElementOptions(i.length-1));return Math.max(n,r,a)/2}draw(){let t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw();}};jn.id="line";jn.defaults={datasetElementType:"line",dataElementType:"point",showLine:true,spanGaps:false};jn.overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};var Yn=class extends qt{constructor(t,o){super(t,o),this.innerRadius=void 0,this.outerRadius=void 0;}getLabelAndValue(t){let o=this._cachedMeta,n=this.chart,i=n.data.labels||[],r=en(o._parsed[t].r,n.options.locale);return {label:i[t]||"",value:r}}parseObjectData(t,o,n,i){return ys.bind(this)(t,o,n,i)}update(t){let o=this._cachedMeta.data;this._updateRadius(),this.updateElements(o,0,o.length,t);}getMinMax(){let t=this._cachedMeta,o={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((n,i)=>{let r=this.getParsed(i).r;!isNaN(r)&&this.chart.getDataVisibility(i)&&(r<o.min&&(o.min=r),r>o.max&&(o.max=r));}),o}_updateRadius(){let t=this.chart,o=t.chartArea,n=t.options,i=Math.min(o.right-o.left,o.bottom-o.top),r=Math.max(i/2,0),a=Math.max(n.cutoutPercentage?r/100*n.cutoutPercentage:1,0),s=(r-a)/t.getVisibleDatasetCount();this.outerRadius=r-s*this.index,this.innerRadius=this.outerRadius-s;}updateElements(t,o,n,i){let r=i==="reset",a=this.chart,l=a.options.animation,c=this._cachedMeta.rScale,d=c.xCenter,u=c.yCenter,p=c.getIndexAngle(0)-.5*G,h=p,m,g=360/this.countVisibleElements();for(m=0;m<o;++m)h+=this._computeAngle(m,i,g);for(m=o;m<o+n;m++){let f=t[m],x=h,b=h+this._computeAngle(m,i,g),T=a.getDataVisibility(m)?c.getDistanceFromCenterForValue(this.getParsed(m).r):0;h=b,r&&(l.animateScale&&(T=0),l.animateRotate&&(x=b=p));let k={x:d,y:u,innerRadius:0,outerRadius:T,startAngle:x,endAngle:b,options:this.resolveDataElementOptions(m,f.active?"active":i)};this.updateElement(f,m,k,i);}}countVisibleElements(){let t=this._cachedMeta,o=0;return t.data.forEach((n,i)=>{!isNaN(this.getParsed(i).r)&&this.chart.getDataVisibility(i)&&o++;}),o}_computeAngle(t,o,n){return this.chart.getDataVisibility(t)?gt(this.resolveDataElementOptions(t,o).angle||n):0}};Yn.id="polarArea";Yn.defaults={dataElementType:"arc",animation:{animateRotate:true,animateScale:true},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};Yn.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(e){let t=e.data;if(t.labels.length&&t.datasets.length){let{labels:{pointStyle:o}}=e.legend.options;return t.labels.map((n,i)=>{let a=e.getDatasetMeta(0).controller.getStyle(i);return {text:n,fillStyle:a.backgroundColor,strokeStyle:a.borderColor,lineWidth:a.borderWidth,pointStyle:o,hidden:!e.getDataVisibility(i),index:i}})}return []}},onClick(e,t,o){o.chart.toggleDataVisibility(t.index),o.chart.update();}},tooltip:{callbacks:{title(){return ""},label(e){return e.chart.data.labels[e.dataIndex]+": "+e.formattedValue}}}},scales:{r:{type:"radialLinear",angleLines:{display:false},beginAtZero:true,grid:{circular:true},pointLabels:{display:false},startAngle:0}}};var nr=class extends To{};nr.id="pie";nr.defaults={cutout:0,rotation:0,circumference:360,radius:"100%"};var Zn=class extends qt{getLabelAndValue(t){let o=this._cachedMeta.vScale,n=this.getParsed(t);return {label:o.getLabels()[t],value:""+o.getLabelForValue(n[o.axis])}}parseObjectData(t,o,n,i){return ys.bind(this)(t,o,n,i)}update(t){let o=this._cachedMeta,n=o.dataset,i=o.data||[],r=o.iScale.getLabels();if(n.points=i,t!=="resize"){let a=this.resolveDatasetElementOptions(t);this.options.showLine||(a.borderWidth=0);let s={_loop:true,_fullLoop:r.length===i.length,options:a};this.updateElement(n,void 0,s,t);}this.updateElements(i,0,i.length,t);}updateElements(t,o,n,i){let r=this._cachedMeta.rScale,a=i==="reset";for(let s=o;s<o+n;s++){let l=t[s],c=this.resolveDataElementOptions(s,l.active?"active":i),d=r.getPointPositionForValue(s,this.getParsed(s).r),u=a?r.xCenter:d.x,p=a?r.yCenter:d.y,h={x:u,y:p,angle:d.angle,skip:isNaN(u)||isNaN(p),options:c};this.updateElement(l,s,h,i);}}};Zn.id="radar";Zn.defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:true,elements:{line:{fill:"start"}}};Zn.overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};var xt=class{constructor(){this.x=void 0,this.y=void 0,this.active=false,this.options=void 0,this.$animations=void 0;}tooltipPosition(t){let{x:o,y:n}=this.getProps(["x","y"],t);return {x:o,y:n}}hasValue(){return Kt(this.x)&&Kt(this.y)}getProps(t,o){let n=this.$animations;if(!o||!n)return this;let i={};return t.forEach(r=>{i[r]=n[r]&&n[r].active()?n[r]._to:this[r];}),i}};xt.defaults={};xt.defaultRoutes=void 0;var $0={values(e){return Z(e)?e:""+e},numeric(e,t,o){if(e===0)return "0";let n=this.chart.options.locale,i,r=e;if(o.length>1){let c=Math.max(Math.abs(o[0].value),Math.abs(o[o.length-1].value));(c<1e-4||c>1e15)&&(i="scientific"),r=n_(e,o);}let a=zt(Math.abs(r)),s=Math.max(Math.min(-1*Math.floor(a),20),0),l={notation:i,minimumFractionDigits:s,maximumFractionDigits:s};return Object.assign(l,this.options.ticks.format),en(e,n,l)},logarithmic(e,t,o){if(e===0)return "0";let n=e/Math.pow(10,Math.floor(zt(e)));return n===1||n===2||n===5?$0.numeric.call(this,e,t,o):""}};function n_(e,t){let o=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(o)>=1&&e!==Math.floor(e)&&(o=e-Math.floor(e)),o}var zs={formatters:$0};H.set("scale",{display:true,offset:false,reverse:false,beginAtZero:false,bounds:"ticks",grace:0,grid:{display:true,lineWidth:1,drawBorder:true,drawOnChartArea:true,drawTicks:true,tickLength:8,tickWidth:(e,t)=>t.lineWidth,tickColor:(e,t)=>t.color,offset:false,borderDash:[],borderDashOffset:0,borderWidth:1},title:{display:false,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:false,textStrokeWidth:0,textStrokeColor:"",padding:3,display:true,autoSkip:true,autoSkipPadding:3,labelOffset:0,callback:zs.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:false,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}});H.route("scale.ticks","color","","color");H.route("scale.grid","color","","borderColor");H.route("scale.grid","borderColor","","borderColor");H.route("scale.title","color","","color");H.describe("scale",{_fallback:false,_scriptable:e=>!e.startsWith("before")&&!e.startsWith("after")&&e!=="callback"&&e!=="parser",_indexable:e=>e!=="borderDash"&&e!=="tickBorderDash"});H.describe("scales",{_fallback:"scale"});H.describe("scale.ticks",{_scriptable:e=>e!=="backdropPadding"&&e!=="callback",_indexable:e=>e!=="backdropPadding"});function i_(e,t){let o=e.options.ticks,n=o.maxTicksLimit||r_(e),i=o.major.enabled?s_(t):[],r=i.length,a=i[0],s=i[r-1],l=[];if(r>n)return l_(t,l,i,r/n),l;let c=a_(i,t,n);if(r>0){let d,u,p=r>1?Math.round((s-a)/(r-1)):null;for(vs(t,l,c,W(p)?0:a-p,a),d=0,u=r-1;d<u;d++)vs(t,l,c,i[d],i[d+1]);return vs(t,l,c,s,W(p)?t.length:s+p),l}return vs(t,l,c),l}function r_(e){let t=e.options.offset,o=e._tickSize(),n=e._length/o+(t?0:1),i=e._maxLength/o;return Math.floor(Math.min(n,i))}function a_(e,t,o){let n=c_(e),i=t.length/o;if(!n)return Math.max(i,1);let r=bd(n);for(let a=0,s=r.length-1;a<s;a++){let l=r[a];if(l>i)return l}return Math.max(i,1)}function s_(e){let t=[],o,n;for(o=0,n=e.length;o<n;o++)e[o].major&&t.push(o);return t}function l_(e,t,o,n){let i=0,r=o[0],a;for(n=Math.ceil(n),a=0;a<e.length;a++)a===r&&(t.push(e[a]),i++,r=o[i*n]);}function vs(e,t,o,n,i){let r=N(n,0),a=Math.min(N(i,e.length),e.length),s=0,l,c,d;for(o=Math.ceil(o),i&&(l=i-n,o=l/Math.floor(l/o)),d=r;d<0;)s++,d=Math.round(r+s*o);for(c=Math.max(r,0);c<a;c++)c===d&&(t.push(e[c]),s++,d=Math.round(r+s*o));}function c_(e){let t=e.length,o,n;if(t<2)return false;for(n=e[0],o=1;o<t;++o)if(e[o]-e[o-1]!==n)return false;return n}var d_=e=>e==="left"?"right":e==="right"?"left":e,a0=(e,t,o)=>t==="top"||t==="left"?e[t]+o:e[t]-o;function s0(e,t){let o=[],n=e.length/t,i=e.length,r=0;for(;r<i;r+=n)o.push(e[Math.floor(r)]);return o}function u_(e,t,o){let n=e.ticks.length,i=Math.min(t,n-1),r=e._startPixel,a=e._endPixel,s=1e-6,l=e.getPixelForTick(i),c;if(!(o&&(n===1?c=Math.max(l-r,a-l):t===0?c=(e.getPixelForTick(1)-l)/2:c=(l-e.getPixelForTick(i-1))/2,l+=i<t?c:-c,l<r-s||l>a+s)))return l}function p_(e,t){K(e,o=>{let n=o.gc,i=n.length/2,r;if(i>t){for(r=0;r<i;++r)delete o.data[n[r]];n.splice(0,i);}});}function qi(e){return e.drawTicks?e.tickLength:0}function l0(e,t){if(!e.display)return 0;let o=it(e.font,t),n=pt(e.padding);return (Z(e.text)?e.text.length:1)*o.lineHeight+n.height}function m_(e,t){return Me(e,{scale:t,type:"scale"})}function h_(e,t,o){return Me(e,{tick:o,index:t,type:"tick"})}function g_(e,t,o){let n=Wi(e);return (o&&t!=="right"||!o&&t==="right")&&(n=d_(n)),n}function f_(e,t,o,n){let{top:i,left:r,bottom:a,right:s,chart:l}=e,{chartArea:c,scales:d}=l,u=0,p,h,m,g=a-i,f=s-r;if(e.isHorizontal()){if(h=Pt(n,r,s),z(o)){let x=Object.keys(o)[0],b=o[x];m=d[x].getPixelForValue(b)+g-t;}else o==="center"?m=(c.bottom+c.top)/2+g-t:m=a0(e,o,t);p=s-r;}else {if(z(o)){let x=Object.keys(o)[0],b=o[x];h=d[x].getPixelForValue(b)-f+t;}else o==="center"?h=(c.left+c.right)/2-f+t:h=a0(e,o,t);m=Pt(n,a,i),u=o==="left"?-et:et;}return {titleX:h,titleY:m,maxWidth:p,rotation:u}}var rn=class e extends xt{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=false,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=false,this.$context=void 0;}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax);}parse(t,o){return t}getUserBounds(){let{_userMin:t,_userMax:o,_suggestedMin:n,_suggestedMax:i}=this;return t=Ot(t,Number.POSITIVE_INFINITY),o=Ot(o,Number.NEGATIVE_INFINITY),n=Ot(n,Number.POSITIVE_INFINITY),i=Ot(i,Number.NEGATIVE_INFINITY),{min:Ot(t,n),max:Ot(o,i),minDefined:lt(t),maxDefined:lt(o)}}getMinMax(t){let{min:o,max:n,minDefined:i,maxDefined:r}=this.getUserBounds(),a;if(i&&r)return {min:o,max:n};let s=this.getMatchingVisibleMetas();for(let l=0,c=s.length;l<c;++l)a=s[l].controller.getMinMax(this,t),i||(o=Math.min(o,a.min)),r||(n=Math.max(n,a.max));return o=r&&o>n?n:o,n=i&&o>n?o:n,{min:Ot(o,Ot(n,o)),max:Ot(n,Ot(o,n))}}getPadding(){return {left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){let t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}beforeLayout(){this._cache={},this._dataLimitsCached=false;}beforeUpdate(){X(this.options.beforeUpdate,[this]);}update(t,o,n){let{beginAtZero:i,grace:r,ticks:a}=this.options,s=a.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=o,this._margins=n=Object.assign({left:0,right:0,top:0,bottom:0},n),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+n.left+n.right:this.height+n.top+n.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=Bd(this,r,i),this._dataLimitsCached=true),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();let l=s<this.ticks.length;this._convertTicksToLabels(l?s0(this.ticks,s):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),a.display&&(a.autoSkip||a.source==="auto")&&(this.ticks=i_(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate();}configure(){let t=this.options.reverse,o,n;this.isHorizontal()?(o=this.left,n=this.right):(o=this.top,n=this.bottom,t=!t),this._startPixel=o,this._endPixel=n,this._reversePixels=t,this._length=n-o,this._alignToPixels=this.options.alignToPixels;}afterUpdate(){X(this.options.afterUpdate,[this]);}beforeSetDimensions(){X(this.options.beforeSetDimensions,[this]);}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0;}afterSetDimensions(){X(this.options.afterSetDimensions,[this]);}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),X(this.options[t],[this]);}beforeDataLimits(){this._callHooks("beforeDataLimits");}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits");}beforeBuildTicks(){this._callHooks("beforeBuildTicks");}buildTicks(){return []}afterBuildTicks(){this._callHooks("afterBuildTicks");}beforeTickToLabelConversion(){X(this.options.beforeTickToLabelConversion,[this]);}generateTickLabels(t){let o=this.options.ticks,n,i,r;for(n=0,i=t.length;n<i;n++)r=t[n],r.label=X(o.callback,[r.value,n,t],this);}afterTickToLabelConversion(){X(this.options.afterTickToLabelConversion,[this]);}beforeCalculateLabelRotation(){X(this.options.beforeCalculateLabelRotation,[this]);}calculateLabelRotation(){let t=this.options,o=t.ticks,n=this.ticks.length,i=o.minRotation||0,r=o.maxRotation,a=i,s,l,c;if(!this._isVisible()||!o.display||i>=r||n<=1||!this.isHorizontal()){this.labelRotation=i;return}let d=this._getLabelSizes(),u=d.widest.width,p=d.highest.height,h=Ct(this.chart.width-u,0,this.maxWidth);s=t.offset?this.maxWidth/n:h/(n-1),u+6>s&&(s=h/(n-(t.offset?.5:1)),l=this.maxHeight-qi(t.grid)-o.padding-l0(t.title,this.chart.options.font),c=Math.sqrt(u*u+p*p),a=Qo(Math.min(Math.asin(Ct((d.highest.height+6)/s,-1,1)),Math.asin(Ct(l/c,-1,1))-Math.asin(Ct(p/c,-1,1)))),a=Math.max(i,Math.min(r,a))),this.labelRotation=a;}afterCalculateLabelRotation(){X(this.options.afterCalculateLabelRotation,[this]);}afterAutoSkip(){}beforeFit(){X(this.options.beforeFit,[this]);}fit(){let t={width:0,height:0},{chart:o,options:{ticks:n,title:i,grid:r}}=this,a=this._isVisible(),s=this.isHorizontal();if(a){let l=l0(i,o.options.font);if(s?(t.width=this.maxWidth,t.height=qi(r)+l):(t.height=this.maxHeight,t.width=qi(r)+l),n.display&&this.ticks.length){let{first:c,last:d,widest:u,highest:p}=this._getLabelSizes(),h=n.padding*2,m=gt(this.labelRotation),g=Math.cos(m),f=Math.sin(m);if(s){let x=n.mirror?0:f*u.width+g*p.height;t.height=Math.min(this.maxHeight,t.height+x+h);}else {let x=n.mirror?0:g*u.width+f*p.height;t.width=Math.min(this.maxWidth,t.width+x+h);}this._calculatePadding(c,d,f,g);}}this._handleMargins(),s?(this.width=this._length=o.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=o.height-this._margins.top-this._margins.bottom);}_calculatePadding(t,o,n,i){let{ticks:{align:r,padding:a},position:s}=this.options,l=this.labelRotation!==0,c=s!=="top"&&this.axis==="x";if(this.isHorizontal()){let d=this.getPixelForTick(0)-this.left,u=this.right-this.getPixelForTick(this.ticks.length-1),p=0,h=0;l?c?(p=i*t.width,h=n*o.height):(p=n*t.height,h=i*o.width):r==="start"?h=o.width:r==="end"?p=t.width:r!=="inner"&&(p=t.width/2,h=o.width/2),this.paddingLeft=Math.max((p-d+a)*this.width/(this.width-d),0),this.paddingRight=Math.max((h-u+a)*this.width/(this.width-u),0);}else {let d=o.height/2,u=t.height/2;r==="start"?(d=0,u=t.height):r==="end"&&(d=o.height,u=0),this.paddingTop=d+a,this.paddingBottom=u+a;}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom));}afterFit(){X(this.options.afterFit,[this]);}isHorizontal(){let{axis:t,position:o}=this.options;return o==="top"||o==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let o,n;for(o=0,n=t.length;o<n;o++)W(t[o].label)&&(t.splice(o,1),n--,o--);this.afterTickToLabelConversion();}_getLabelSizes(){let t=this._labelSizes;if(!t){let o=this.options.ticks.sampleSize,n=this.ticks;o<n.length&&(n=s0(n,o)),this._labelSizes=t=this._computeLabelSizes(n,n.length);}return t}_computeLabelSizes(t,o){let{ctx:n,_longestTextCache:i}=this,r=[],a=[],s=0,l=0,c,d,u,p,h,m,g,f,x,b,T;for(c=0;c<o;++c){if(p=t[c].label,h=this._resolveTickFontOptions(c),n.font=m=h.string,g=i[m]=i[m]||{data:{},gc:[]},f=h.lineHeight,x=b=0,!W(p)&&!Z(p))x=On(n,g.data,g.gc,x,p),b=f;else if(Z(p))for(d=0,u=p.length;d<u;++d)T=p[d],!W(T)&&!Z(T)&&(x=On(n,g.data,g.gc,x,T),b+=f);r.push(x),a.push(b),s=Math.max(x,s),l=Math.max(b,l);}p_(i,o);let k=r.indexOf(s),w=a.indexOf(l),v=_=>({width:r[_]||0,height:a[_]||0});return {first:v(0),last:v(o-1),widest:v(k),highest:v(w),widths:r,heights:a}}getLabelForValue(t){return t}getPixelForValue(t,o){return NaN}getValueForPixel(t){}getPixelForTick(t){let o=this.ticks;return t<0||t>o.length-1?null:this.getPixelForValue(o[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);let o=this._startPixel+t*this._length;return Pd(this._alignToPixels?$e(this.chart,o,0):o)}getDecimalForPixel(t){let o=(t-this._startPixel)/this._length;return this._reversePixels?1-o:o}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){let{min:t,max:o}=this;return t<0&&o<0?o:t>0&&o>0?t:0}getContext(t){let o=this.ticks||[];if(t>=0&&t<o.length){let n=o[t];return n.$context||(n.$context=h_(this.getContext(),t,n))}return this.$context||(this.$context=m_(this.chart.getContext(),this))}_tickSize(){let t=this.options.ticks,o=gt(this.labelRotation),n=Math.abs(Math.cos(o)),i=Math.abs(Math.sin(o)),r=this._getLabelSizes(),a=t.autoSkipPadding||0,s=r?r.widest.width+a:0,l=r?r.highest.height+a:0;return this.isHorizontal()?l*n>s*i?s/n:l/i:l*i<s*n?l/n:s/i}_isVisible(){let t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){let o=this.axis,n=this.chart,i=this.options,{grid:r,position:a}=i,s=r.offset,l=this.isHorizontal(),d=this.ticks.length+(s?1:0),u=qi(r),p=[],h=r.setContext(this.getContext()),m=h.drawBorder?h.borderWidth:0,g=m/2,f=function(L){return $e(n,L,m)},x,b,T,k,w,v,_,M,I,F,E,B;if(a==="top")x=f(this.bottom),v=this.bottom-u,M=x-g,F=f(t.top)+g,B=t.bottom;else if(a==="bottom")x=f(this.top),F=t.top,B=f(t.bottom)-g,v=x+g,M=this.top+u;else if(a==="left")x=f(this.right),w=this.right-u,_=x-g,I=f(t.left)+g,E=t.right;else if(a==="right")x=f(this.left),I=t.left,E=f(t.right)-g,w=x+g,_=this.left+u;else if(o==="x"){if(a==="center")x=f((t.top+t.bottom)/2+.5);else if(z(a)){let L=Object.keys(a)[0],V=a[L];x=f(this.chart.scales[L].getPixelForValue(V));}F=t.top,B=t.bottom,v=x+g,M=v+u;}else if(o==="y"){if(a==="center")x=f((t.left+t.right)/2);else if(z(a)){let L=Object.keys(a)[0],V=a[L];x=f(this.chart.scales[L].getPixelForValue(V));}w=x-g,_=w-u,I=t.left,E=t.right;}let O=N(i.ticks.maxTicksLimit,d),U=Math.max(1,Math.ceil(d/O));for(b=0;b<d;b+=U){let L=r.setContext(this.getContext(b)),V=L.lineWidth,J=L.color,Bt=L.borderDash||[],tt=L.borderDashOffset,bt=L.tickWidth,Eo=L.tickColor,Fe=L.tickBorderDash||[],Je=L.tickBorderDashOffset;T=u_(this,b,s),T!==void 0&&(k=$e(n,T,V),l?w=_=I=E=k:v=M=F=B=k,p.push({tx1:w,ty1:v,tx2:_,ty2:M,x1:I,y1:F,x2:E,y2:B,width:V,color:J,borderDash:Bt,borderDashOffset:tt,tickWidth:bt,tickColor:Eo,tickBorderDash:Fe,tickBorderDashOffset:Je}));}return this._ticksLength=d,this._borderValue=x,p}_computeLabelItems(t){let o=this.axis,n=this.options,{position:i,ticks:r}=n,a=this.isHorizontal(),s=this.ticks,{align:l,crossAlign:c,padding:d,mirror:u}=r,p=qi(n.grid),h=p+d,m=u?-d:h,g=-gt(this.labelRotation),f=[],x,b,T,k,w,v,_,M,I,F,E,B,O="middle";if(i==="top")v=this.bottom-m,_=this._getXAxisLabelAlignment();else if(i==="bottom")v=this.top+m,_=this._getXAxisLabelAlignment();else if(i==="left"){let L=this._getYAxisLabelAlignment(p);_=L.textAlign,w=L.x;}else if(i==="right"){let L=this._getYAxisLabelAlignment(p);_=L.textAlign,w=L.x;}else if(o==="x"){if(i==="center")v=(t.top+t.bottom)/2+h;else if(z(i)){let L=Object.keys(i)[0],V=i[L];v=this.chart.scales[L].getPixelForValue(V)+h;}_=this._getXAxisLabelAlignment();}else if(o==="y"){if(i==="center")w=(t.left+t.right)/2-h;else if(z(i)){let L=Object.keys(i)[0],V=i[L];w=this.chart.scales[L].getPixelForValue(V);}_=this._getYAxisLabelAlignment(p).textAlign;}o==="y"&&(l==="start"?O="top":l==="end"&&(O="bottom"));let U=this._getLabelSizes();for(x=0,b=s.length;x<b;++x){T=s[x],k=T.label;let L=r.setContext(this.getContext(x));M=this.getPixelForTick(x)+r.labelOffset,I=this._resolveTickFontOptions(x),F=I.lineHeight,E=Z(k)?k.length:1;let V=E/2,J=L.color,Bt=L.textStrokeColor,tt=L.textStrokeWidth,bt=_;a?(w=M,_==="inner"&&(x===b-1?bt=this.options.reverse?"left":"right":x===0?bt=this.options.reverse?"right":"left":bt="center"),i==="top"?c==="near"||g!==0?B=-E*F+F/2:c==="center"?B=-U.highest.height/2-V*F+F:B=-U.highest.height+F/2:c==="near"||g!==0?B=F/2:c==="center"?B=U.highest.height/2-V*F:B=U.highest.height-E*F,u&&(B*=-1)):(v=M,B=(1-E)*F/2);let Eo;if(L.showLabelBackdrop){let Fe=pt(L.backdropPadding),Je=U.heights[x],Fo=U.widths[x],gn=v+B-Fe.top,Lo=w-Fe.left;switch(O){case "middle":gn-=Je/2;break;case "bottom":gn-=Je;break}switch(_){case "center":Lo-=Fo/2;break;case "right":Lo-=Fo;break}Eo={left:Lo,top:gn,width:Fo+Fe.width,height:Je+Fe.height,color:L.backdropColor};}f.push({rotation:g,label:k,font:I,color:J,strokeColor:Bt,strokeWidth:tt,textOffset:B,textAlign:bt,textBaseline:O,translation:[w,v],backdrop:Eo});}return f}_getXAxisLabelAlignment(){let{position:t,ticks:o}=this.options;if(-gt(this.labelRotation))return t==="top"?"left":"right";let i="center";return o.align==="start"?i="left":o.align==="end"?i="right":o.align==="inner"&&(i="inner"),i}_getYAxisLabelAlignment(t){let{position:o,ticks:{crossAlign:n,mirror:i,padding:r}}=this.options,a=this._getLabelSizes(),s=t+r,l=a.widest.width,c,d;return o==="left"?i?(d=this.right+r,n==="near"?c="left":n==="center"?(c="center",d+=l/2):(c="right",d+=l)):(d=this.right-s,n==="near"?c="right":n==="center"?(c="center",d-=l/2):(c="left",d=this.left)):o==="right"?i?(d=this.left+r,n==="near"?c="right":n==="center"?(c="center",d-=l/2):(c="left",d-=l)):(d=this.left+s,n==="near"?c="left":n==="center"?(c="center",d+=l/2):(c="right",d=this.right)):c="right",{textAlign:c,x:d}}_computeLabelArea(){if(this.options.ticks.mirror)return;let t=this.chart,o=this.options.position;if(o==="left"||o==="right")return {top:0,left:this.left,bottom:t.height,right:this.right};if(o==="top"||o==="bottom")return {top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){let{ctx:t,options:{backgroundColor:o},left:n,top:i,width:r,height:a}=this;o&&(t.save(),t.fillStyle=o,t.fillRect(n,i,r,a),t.restore());}getLineWidthForValue(t){let o=this.options.grid;if(!this._isVisible()||!o.display)return 0;let i=this.ticks.findIndex(r=>r.value===t);return i>=0?o.setContext(this.getContext(i)).lineWidth:0}drawGrid(t){let o=this.options.grid,n=this.ctx,i=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t)),r,a,s=(l,c,d)=>{!d.width||!d.color||(n.save(),n.lineWidth=d.width,n.strokeStyle=d.color,n.setLineDash(d.borderDash||[]),n.lineDashOffset=d.borderDashOffset,n.beginPath(),n.moveTo(l.x,l.y),n.lineTo(c.x,c.y),n.stroke(),n.restore());};if(o.display)for(r=0,a=i.length;r<a;++r){let l=i[r];o.drawOnChartArea&&s({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),o.drawTicks&&s({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset});}}drawBorder(){let{chart:t,ctx:o,options:{grid:n}}=this,i=n.setContext(this.getContext()),r=n.drawBorder?i.borderWidth:0;if(!r)return;let a=n.setContext(this.getContext(0)).lineWidth,s=this._borderValue,l,c,d,u;this.isHorizontal()?(l=$e(t,this.left,r)-r/2,c=$e(t,this.right,a)+a/2,d=u=s):(d=$e(t,this.top,r)-r/2,u=$e(t,this.bottom,a)+a/2,l=c=s),o.save(),o.lineWidth=i.borderWidth,o.strokeStyle=i.borderColor,o.beginPath(),o.moveTo(l,d),o.lineTo(c,u),o.stroke(),o.restore();}drawLabels(t){if(!this.options.ticks.display)return;let n=this.ctx,i=this._computeLabelArea();i&&xo(n,i);let r=this._labelItems||(this._labelItems=this._computeLabelItems(t)),a,s;for(a=0,s=r.length;a<s;++a){let l=r[a],c=l.font,d=l.label;l.backdrop&&(n.fillStyle=l.backdrop.color,n.fillRect(l.backdrop.left,l.backdrop.top,l.backdrop.width,l.backdrop.height));let u=l.textOffset;He(n,d,0,u,c,l);}i&&bo(n);}drawTitle(){let{ctx:t,options:{position:o,title:n,reverse:i}}=this;if(!n.display)return;let r=it(n.font),a=pt(n.padding),s=n.align,l=r.lineHeight/2;o==="bottom"||o==="center"||z(o)?(l+=a.bottom,Z(n.text)&&(l+=r.lineHeight*(n.text.length-1))):l+=a.top;let{titleX:c,titleY:d,maxWidth:u,rotation:p}=f_(this,l,o,s);He(t,n.text,0,0,r,{color:n.color,maxWidth:u,rotation:p,textAlign:g_(s,o,i),textBaseline:"middle",translation:[c,d]});}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t));}_layers(){let t=this.options,o=t.ticks&&t.ticks.z||0,n=N(t.grid&&t.grid.z,-1);return !this._isVisible()||this.draw!==e.prototype.draw?[{z:o,draw:i=>{this.draw(i);}}]:[{z:n,draw:i=>{this.drawBackground(),this.drawGrid(i),this.drawTitle();}},{z:n+1,draw:()=>{this.drawBorder();}},{z:o,draw:i=>{this.drawLabels(i);}}]}getMatchingVisibleMetas(t){let o=this.chart.getSortedVisibleDatasetMetas(),n=this.axis+"AxisID",i=[],r,a;for(r=0,a=o.length;r<a;++r){let s=o[r];s[n]===this.id&&(!t||s.type===t)&&i.push(s);}return i}_resolveTickFontOptions(t){let o=this.options.ticks.setContext(this.getContext(t));return it(o.font)}_maxDigits(){let t=this._resolveTickFontOptions(0).lineHeight;return (this.isHorizontal()?this.width:this.height)/t}},Hn=class{constructor(t,o,n){this.type=t,this.scope=o,this.override=n,this.items=Object.create(null);}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){let o=Object.getPrototypeOf(t),n;b_(o)&&(n=this.register(o));let i=this.items,r=t.id,a=this.scope+"."+r;if(!r)throw new Error("class does not have id: "+t);return r in i||(i[r]=t,y_(t,a,n),this.override&&H.override(t.id,t.overrides)),a}get(t){return this.items[t]}unregister(t){let o=this.items,n=t.id,i=this.scope;n in o&&delete o[n],i&&n in H[i]&&(delete H[i][n],this.override&&delete yo[n]);}};function y_(e,t,o){let n=Xt(Object.create(null),[o?H.get(o):{},H.get(t),e.defaults]);H.set(t,n),e.defaultRoutes&&x_(t,e.defaultRoutes),e.descriptors&&H.describe(t,e.descriptors);}function x_(e,t){Object.keys(t).forEach(o=>{let n=o.split("."),i=n.pop(),r=[e].concat(n).join("."),a=t[o].split("."),s=a.pop(),l=a.join(".");H.route(r,i,l,s);});}function b_(e){return "id"in e&&"defaults"in e}var tu=class{constructor(){this.controllers=new Hn(qt,"datasets",true),this.elements=new Hn(xt,"elements"),this.plugins=new Hn(Object,"plugins"),this.scales=new Hn(rn,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements];}add(...t){this._each("register",t);}remove(...t){this._each("unregister",t);}addControllers(...t){this._each("register",t,this.controllers);}addElements(...t){this._each("register",t,this.elements);}addPlugins(...t){this._each("register",t,this.plugins);}addScales(...t){this._each("register",t,this.scales);}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers);}removeElements(...t){this._each("unregister",t,this.elements);}removePlugins(...t){this._each("unregister",t,this.plugins);}removeScales(...t){this._each("unregister",t,this.scales);}_each(t,o,n){[...o].forEach(i=>{let r=n||this._getRegistryForType(i);n||r.isForType(i)||r===this.plugins&&i.id?this._exec(t,r,i):K(i,a=>{let s=n||this._getRegistryForType(a);this._exec(t,s,a);});});}_exec(t,o,n){let i=Vi(t);X(n["before"+i],[],n),o[t](n),X(n["after"+i],[],n);}_getRegistryForType(t){for(let o=0;o<this._typedRegistries.length;o++){let n=this._typedRegistries[o];if(n.isForType(t))return n}return this.plugins}_get(t,o,n){let i=o.get(t);if(i===void 0)throw new Error('"'+t+'" is not a registered '+n+".");return i}},Ee=new tu,Xn=class extends qt{update(t){let o=this._cachedMeta,{data:n=[]}=o,i=this.chart._animationsDisabled,{start:r,count:a}=ds(o,n,i);if(this._drawStart=r,this._drawCount=a,us(o)&&(r=0,a=n.length),this.options.showLine){let{dataset:s,_dataset:l}=o;s._chart=this.chart,s._datasetIndex=this.index,s._decimated=!!l._decimated,s.points=n;let c=this.resolveDatasetElementOptions(t);c.segment=this.options.segment,this.updateElement(s,void 0,{animated:!i,options:c},t);}this.updateElements(n,r,a,t);}addElements(){let{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=Ee.getElement("line")),super.addElements();}updateElements(t,o,n,i){let r=i==="reset",{iScale:a,vScale:s,_stacked:l,_dataset:c}=this._cachedMeta,d=this.resolveDataElementOptions(o,i),u=this.getSharedOptions(d),p=this.includeOptions(i,u),h=a.axis,m=s.axis,{spanGaps:g,segment:f}=this.options,x=Kt(g)?g:Number.POSITIVE_INFINITY,b=this.chart._animationsDisabled||r||i==="none",T=o>0&&this.getParsed(o-1);for(let k=o;k<o+n;++k){let w=t[k],v=this.getParsed(k),_=b?w:{},M=W(v[m]),I=_[h]=a.getPixelForValue(v[h],k),F=_[m]=r||M?s.getBasePixel():s.getPixelForValue(l?this.applyStack(s,v,l):v[m],k);_.skip=isNaN(I)||isNaN(F)||M,_.stop=k>0&&Math.abs(v[h]-T[h])>x,f&&(_.parsed=v,_.raw=c.data[k]),p&&(_.options=u||this.resolveDataElementOptions(k,w.active?"active":i)),b||this.updateElement(w,k,_,i),T=v;}this.updateSharedOptions(u,i,d);}getMaxOverflow(){let t=this._cachedMeta,o=t.data||[];if(!this.options.showLine){let s=0;for(let l=o.length-1;l>=0;--l)s=Math.max(s,o[l].size(this.resolveDataElementOptions(l))/2);return s>0&&s}let n=t.dataset,i=n.options&&n.options.borderWidth||0;if(!o.length)return i;let r=o[0].size(this.resolveDataElementOptions(0)),a=o[o.length-1].size(this.resolveDataElementOptions(o.length-1));return Math.max(i,r,a)/2}};Xn.id="scatter";Xn.defaults={datasetElementType:false,dataElementType:"point",showLine:false,fill:false};Xn.overrides={interaction:{mode:"point"},plugins:{tooltip:{callbacks:{title(){return ""},label(e){return "("+e.label+", "+e.formattedValue+")"}}}},scales:{x:{type:"linear"},y:{type:"linear"}}};function on(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}var ir=class{constructor(t){this.options=t||{};}init(t){}formats(){return on()}parse(t,o){return on()}format(t,o){return on()}add(t,o,n){return on()}diff(t,o,n){return on()}startOf(t,o,n){return on()}endOf(t,o){return on()}};ir.override=function(e){Object.assign(ir.prototype,e);};var C_={_date:ir};function P_(e,t,o,n){let{controller:i,data:r,_sorted:a}=e,s=i._cachedMeta.iScale;if(s&&t===s.axis&&t!=="r"&&a&&r.length){let l=s._reversePixels?Sd:ze;if(n){if(i._sharedOptions){let c=r[0],d=typeof c.getRange=="function"&&c.getRange(t);if(d){let u=l(r,t,o-d),p=l(r,t,o+d);return {lo:u.lo,hi:p.hi}}}}else return l(r,t,o)}return {lo:0,hi:r.length-1}}function sr(e,t,o,n,i){let r=e.getSortedVisibleDatasetMetas(),a=o[t];for(let s=0,l=r.length;s<l;++s){let{index:c,data:d}=r[s],{lo:u,hi:p}=P_(r[s],t,a,i);for(let h=u;h<=p;++h){let m=d[h];m.skip||n(m,c,h);}}}function S_(e){let t=e.indexOf("x")!==-1,o=e.indexOf("y")!==-1;return function(n,i){let r=t?Math.abs(n.x-i.x):0,a=o?Math.abs(n.y-i.y):0;return Math.sqrt(Math.pow(r,2)+Math.pow(a,2))}}function jd(e,t,o,n,i){let r=[];return !i&&!e.isPointInArea(t)||sr(e,o,t,function(s,l,c){!i&&!Xo(s,e.chartArea,0)||s.inRange(t.x,t.y,n)&&r.push({element:s,datasetIndex:l,index:c});},true),r}function T_(e,t,o,n){let i=[];function r(a,s,l){let{startAngle:c,endAngle:d}=a.getProps(["startAngle","endAngle"],n),{angle:u}=rs(a,{x:t.x,y:t.y});Jo(u,c,d)&&i.push({element:a,datasetIndex:s,index:l});}return sr(e,o,t,r),i}function k_(e,t,o,n,i,r){let a=[],s=S_(o),l=Number.POSITIVE_INFINITY;function c(d,u,p){let h=d.inRange(t.x,t.y,i);if(n&&!h)return;let m=d.getCenterPoint(i);if(!(!!r||e.isPointInArea(m))&&!h)return;let f=s(t,m);f<l?(a=[{element:d,datasetIndex:u,index:p}],l=f):f===l&&a.push({element:d,datasetIndex:u,index:p});}return sr(e,o,t,c),a}function Yd(e,t,o,n,i,r){return !r&&!e.isPointInArea(t)?[]:o==="r"&&!n?T_(e,t,o,i):k_(e,t,o,n,i,r)}function c0(e,t,o,n,i){let r=[],a=o==="x"?"inXRange":"inYRange",s=false;return sr(e,o,t,(l,c,d)=>{l[a](t[o],i)&&(r.push({element:l,datasetIndex:c,index:d}),s=s||l.inRange(t.x,t.y,i));}),n&&!s?[]:r}var w_={modes:{index(e,t,o,n){let i=Ge(t,e),r=o.axis||"x",a=o.includeInvisible||false,s=o.intersect?jd(e,i,r,n,a):Yd(e,i,r,false,n,a),l=[];return s.length?(e.getSortedVisibleDatasetMetas().forEach(c=>{let d=s[0].index,u=c.data[d];u&&!u.skip&&l.push({element:u,datasetIndex:c.index,index:d});}),l):[]},dataset(e,t,o,n){let i=Ge(t,e),r=o.axis||"xy",a=o.includeInvisible||false,s=o.intersect?jd(e,i,r,n,a):Yd(e,i,r,false,n,a);if(s.length>0){let l=s[0].datasetIndex,c=e.getDatasetMeta(l).data;s=[];for(let d=0;d<c.length;++d)s.push({element:c[d],datasetIndex:l,index:d});}return s},point(e,t,o,n){let i=Ge(t,e),r=o.axis||"xy",a=o.includeInvisible||false;return jd(e,i,r,n,a)},nearest(e,t,o,n){let i=Ge(t,e),r=o.axis||"xy",a=o.includeInvisible||false;return Yd(e,i,r,o.intersect,n,a)},x(e,t,o,n){let i=Ge(t,e);return c0(e,i,"x",o.intersect,n)},y(e,t,o,n){let i=Ge(t,e);return c0(e,i,"y",o.intersect,n)}}},H0=["left","top","right","bottom"];function Qi(e,t){return e.filter(o=>o.pos===t)}function d0(e,t){return e.filter(o=>H0.indexOf(o.pos)===-1&&o.box.axis===t)}function Ji(e,t){return e.sort((o,n)=>{let i=t?n:o,r=t?o:n;return i.weight===r.weight?i.index-r.index:i.weight-r.weight})}function v_(e){let t=[],o,n,i,r,a,s;for(o=0,n=(e||[]).length;o<n;++o)i=e[o],{position:r,options:{stack:a,stackWeight:s=1}}=i,t.push({index:o,box:i,pos:r,horizontal:i.isHorizontal(),weight:i.weight,stack:a&&r+a,stackWeight:s});return t}function __(e){let t={};for(let o of e){let{stack:n,pos:i,stackWeight:r}=o;if(!n||!H0.includes(i))continue;let a=t[n]||(t[n]={count:0,placed:0,weight:0,size:0});a.count++,a.weight+=r;}return t}function A_(e,t){let o=__(e),{vBoxMaxWidth:n,hBoxMaxHeight:i}=t,r,a,s;for(r=0,a=e.length;r<a;++r){s=e[r];let{fullSize:l}=s.box,c=o[s.stack],d=c&&s.stackWeight/c.weight;s.horizontal?(s.width=d?d*n:l&&t.availableWidth,s.height=i):(s.width=n,s.height=d?d*i:l&&t.availableHeight);}return o}function M_(e){let t=v_(e),o=Ji(t.filter(c=>c.box.fullSize),true),n=Ji(Qi(t,"left"),true),i=Ji(Qi(t,"right")),r=Ji(Qi(t,"top"),true),a=Ji(Qi(t,"bottom")),s=d0(t,"x"),l=d0(t,"y");return {fullSize:o,leftAndTop:n.concat(r),rightAndBottom:i.concat(l).concat(a).concat(s),chartArea:Qi(t,"chartArea"),vertical:n.concat(i).concat(l),horizontal:r.concat(a).concat(s)}}function u0(e,t,o,n){return Math.max(e[o],t[o])+Math.max(e[n],t[n])}function W0(e,t){e.top=Math.max(e.top,t.top),e.left=Math.max(e.left,t.left),e.bottom=Math.max(e.bottom,t.bottom),e.right=Math.max(e.right,t.right);}function I_(e,t,o,n){let{pos:i,box:r}=o,a=e.maxPadding;if(!z(i)){o.size&&(e[i]-=o.size);let u=n[o.stack]||{size:0,count:1};u.size=Math.max(u.size,o.horizontal?r.height:r.width),o.size=u.size/u.count,e[i]+=o.size;}r.getPadding&&W0(a,r.getPadding());let s=Math.max(0,t.outerWidth-u0(a,e,"left","right")),l=Math.max(0,t.outerHeight-u0(a,e,"top","bottom")),c=s!==e.w,d=l!==e.h;return e.w=s,e.h=l,o.horizontal?{same:c,other:d}:{same:d,other:c}}function E_(e){let t=e.maxPadding;function o(n){let i=Math.max(t[n]-e[n],0);return e[n]+=i,i}e.y+=o("top"),e.x+=o("left"),o("right"),o("bottom");}function F_(e,t){let o=t.maxPadding;function n(i){let r={left:0,top:0,right:0,bottom:0};return i.forEach(a=>{r[a]=Math.max(t[a],o[a]);}),r}return n(e?["left","right"]:["top","bottom"])}function er(e,t,o,n){let i=[],r,a,s,l,c,d;for(r=0,a=e.length,c=0;r<a;++r){s=e[r],l=s.box,l.update(s.width||t.w,s.height||t.h,F_(s.horizontal,t));let{same:u,other:p}=I_(t,o,s,n);c|=u&&i.length,d=d||p,l.fullSize||i.push(s);}return c&&er(i,t,o,n)||d}function _s(e,t,o,n,i){e.top=o,e.left=t,e.right=t+n,e.bottom=o+i,e.width=n,e.height=i;}function p0(e,t,o,n){let i=o.padding,{x:r,y:a}=t;for(let s of e){let l=s.box,c=n[s.stack]||{placed:0,weight:1},d=s.stackWeight/c.weight||1;if(s.horizontal){let u=t.w*d,p=c.size||l.height;st(c.start)&&(a=c.start),l.fullSize?_s(l,i.left,a,o.outerWidth-i.right-i.left,p):_s(l,t.left+c.placed,a,u,p),c.start=a,c.placed+=u,a=l.bottom;}else {let u=t.h*d,p=c.size||l.width;st(c.start)&&(r=c.start),l.fullSize?_s(l,r,i.top,p,o.outerHeight-i.bottom-i.top):_s(l,r,t.top+c.placed,p,u),c.start=r,c.placed+=u,r=l.right;}}t.x=r,t.y=a;}H.set("layout",{autoPadding:true,padding:{top:0,right:0,bottom:0,left:0}});var ae={addBox(e,t){e.boxes||(e.boxes=[]),t.fullSize=t.fullSize||false,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return [{z:0,draw(o){t.draw(o);}}]},e.boxes.push(t);},removeBox(e,t){let o=e.boxes?e.boxes.indexOf(t):-1;o!==-1&&e.boxes.splice(o,1);},configure(e,t,o){t.fullSize=o.fullSize,t.position=o.position,t.weight=o.weight;},update(e,t,o,n){if(!e)return;let i=pt(e.options.layout.padding),r=Math.max(t-i.width,0),a=Math.max(o-i.height,0),s=M_(e.boxes),l=s.vertical,c=s.horizontal;K(e.boxes,g=>{typeof g.beforeLayout=="function"&&g.beforeLayout();});let d=l.reduce((g,f)=>f.box.options&&f.box.options.display===false?g:g+1,0)||1,u=Object.freeze({outerWidth:t,outerHeight:o,padding:i,availableWidth:r,availableHeight:a,vBoxMaxWidth:r/2/d,hBoxMaxHeight:a/2}),p=Object.assign({},i);W0(p,pt(n));let h=Object.assign({maxPadding:p,w:r,h:a,x:i.left,y:i.top},i),m=A_(l.concat(c),u);er(s.fullSize,h,u,m),er(l,h,u,m),er(c,h,u,m)&&er(l,h,u,m),E_(h),p0(s.leftAndTop,h,u,m),h.x+=h.w,h.y+=h.h,p0(s.rightAndBottom,h,u,m),e.chartArea={left:h.left,top:h.top,right:h.left+h.w,bottom:h.top+h.h,height:h.h,width:h.w},K(s.chartArea,g=>{let f=g.box;Object.assign(f,e.chartArea),f.update(h.w,h.h,{left:0,top:0,right:0,bottom:0});});}},Fs=class{acquireContext(t,o){}releaseContext(t){return false}addEventListener(t,o,n){}removeEventListener(t,o,n){}getDevicePixelRatio(){return 1}getMaximumSize(t,o,n,i){return o=Math.max(0,o||t.width),n=n||t.height,{width:o,height:Math.max(0,i?Math.floor(o/i):n)}}isAttached(t){return true}updateConfig(t){}},eu=class extends Fs{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=false;}},Es="$chartjs",L_={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},m0=e=>e===null||e==="";function B_(e,t){let o=e.style,n=e.getAttribute("height"),i=e.getAttribute("width");if(e[Es]={initial:{height:n,width:i,style:{display:o.display,height:o.height,width:o.width}}},o.display=o.display||"block",o.boxSizing=o.boxSizing||"border-box",m0(i)){let r=Ps(e,"width");r!==void 0&&(e.width=r);}if(m0(n))if(e.style.height==="")e.height=e.width/(t||2);else {let r=Ps(e,"height");r!==void 0&&(e.height=r);}return e}var G0=Od?{passive:true}:false;function R_(e,t,o){e.addEventListener(t,o,G0);}function D_(e,t,o){e.canvas.removeEventListener(t,o,G0);}function N_(e,t){let o=L_[e.type]||e.type,{x:n,y:i}=Ge(e,t);return {type:o,chart:t,native:e,x:n!==void 0?n:null,y:i!==void 0?i:null}}function Ls(e,t){for(let o of e)if(o===t||o.contains(t))return true}function U_(e,t,o){let n=e.canvas,i=new MutationObserver(r=>{let a=false;for(let s of r)a=a||Ls(s.addedNodes,n),a=a&&!Ls(s.removedNodes,n);a&&o();});return i.observe(document,{childList:true,subtree:true}),i}function O_(e,t,o){let n=e.canvas,i=new MutationObserver(r=>{let a=false;for(let s of r)a=a||Ls(s.removedNodes,n),a=a&&!Ls(s.addedNodes,n);a&&o();});return i.observe(document,{childList:true,subtree:true}),i}var rr=new Map,h0=0;function j0(){let e=window.devicePixelRatio;e!==h0&&(h0=e,rr.forEach((t,o)=>{o.currentDevicePixelRatio!==e&&t();}));}function z_(e,t){rr.size||window.addEventListener("resize",j0),rr.set(e,t);}function V_(e){rr.delete(e),rr.size||window.removeEventListener("resize",j0);}function $_(e,t,o){let n=e.canvas,i=n&&Xi(n);if(!i)return;let r=cs((s,l)=>{let c=i.clientWidth;o(s,l),c<i.clientWidth&&o();},window),a=new ResizeObserver(s=>{let l=s[0],c=l.contentRect.width,d=l.contentRect.height;c===0&&d===0||r(c,d);});return a.observe(i),z_(e,r),a}function Zd(e,t,o){o&&o.disconnect(),t==="resize"&&V_(e);}function H_(e,t,o){let n=e.canvas,i=cs(r=>{e.ctx!==null&&o(N_(r,e));},e,r=>{let a=r[0];return [a,a.offsetX,a.offsetY]});return R_(n,t,i),i}var ou=class extends Fs{acquireContext(t,o){let n=t&&t.getContext&&t.getContext("2d");return n&&n.canvas===t?(B_(t,o),n):null}releaseContext(t){let o=t.canvas;if(!o[Es])return false;let n=o[Es].initial;["height","width"].forEach(r=>{let a=n[r];W(a)?o.removeAttribute(r):o.setAttribute(r,a);});let i=n.style||{};return Object.keys(i).forEach(r=>{o.style[r]=i[r];}),o.width=o.width,delete o[Es],true}addEventListener(t,o,n){this.removeEventListener(t,o);let i=t.$proxies||(t.$proxies={}),a={attach:U_,detach:O_,resize:$_}[o]||H_;i[o]=a(t,o,n);}removeEventListener(t,o){let n=t.$proxies||(t.$proxies={}),i=n[o];if(!i)return;(({attach:Zd,detach:Zd,resize:Zd})[o]||D_)(t,o,i),n[o]=void 0;}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,o,n,i){return Ud(t,o,n,i)}isAttached(t){let o=Xi(t);return !!(o&&o.isConnected)}};function W_(e){return !xs()||typeof OffscreenCanvas!="undefined"&&e instanceof OffscreenCanvas?eu:ou}var nu=class{constructor(){this._init=[];}notify(t,o,n,i){o==="beforeInit"&&(this._init=this._createDescriptors(t,true),this._notify(this._init,t,"install"));let r=i?this._descriptors(t).filter(i):this._descriptors(t),a=this._notify(r,t,o,n);return o==="afterDestroy"&&(this._notify(r,t,"stop"),this._notify(this._init,t,"uninstall")),a}_notify(t,o,n,i){i=i||{};for(let r of t){let a=r.plugin,s=a[n],l=[o,i,r.options];if(X(s,l,a)===false&&i.cancelable)return false}return true}invalidate(){W(this._cache)||(this._oldCache=this._cache,this._cache=void 0);}_descriptors(t){if(this._cache)return this._cache;let o=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),o}_createDescriptors(t,o){let n=t&&t.config,i=N(n.options&&n.options.plugins,{}),r=G_(n);return i===false&&!o?[]:Y_(t,r,i,o)}_notifyStateChanges(t){let o=this._oldCache||[],n=this._cache,i=(r,a)=>r.filter(s=>!a.some(l=>s.plugin.id===l.plugin.id));this._notify(i(o,n),t,"stop"),this._notify(i(n,o),t,"start");}};function G_(e){let t={},o=[],n=Object.keys(Ee.plugins.items);for(let r=0;r<n.length;r++)o.push(Ee.getPlugin(n[r]));let i=e.plugins||[];for(let r=0;r<i.length;r++){let a=i[r];o.indexOf(a)===-1&&(o.push(a),t[a.id]=true);}return {plugins:o,localIds:t}}function j_(e,t){return !t&&e===false?null:e===true?{}:e}function Y_(e,{plugins:t,localIds:o},n,i){let r=[],a=e.getContext();for(let s of t){let l=s.id,c=j_(n[l],i);c!==null&&r.push({plugin:s,options:Z_(e.config,{plugin:s,local:o[l]},c,a)});}return r}function Z_(e,{plugin:t,local:o},n,i){let r=e.pluginScopeKeys(t),a=e.getOptionScopes(n,r);return o&&t.defaults&&a.push(t.defaults),e.createResolver(a,i,[""],{scriptable:false,indexable:false,allKeys:true})}function iu(e,t){let o=H.datasets[e]||{};return ((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||o.indexAxis||"x"}function X_(e,t){let o=e;return e==="_index_"?o=t:e==="_value_"&&(o=t==="x"?"y":"x"),o}function K_(e,t){return e===t?"_index_":"_value_"}function q_(e){if(e==="top"||e==="bottom")return "x";if(e==="left"||e==="right")return "y"}function ru(e,t){return e==="x"||e==="y"?e:t.axis||q_(t.position)||e.charAt(0).toLowerCase()}function Q_(e,t){let o=yo[e.type]||{scales:{}},n=t.scales||{},i=iu(e.type,t),r=Object.create(null),a=Object.create(null);return Object.keys(n).forEach(s=>{let l=n[s];if(!z(l))return console.error(`Invalid scale configuration for scale: ${s}`);if(l._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${s}`);let c=ru(s,l),d=K_(c,i),u=o.scales||{};r[c]=r[c]||s,a[s]=Ko(Object.create(null),[{axis:c},l,u[c],u[d]]);}),e.data.datasets.forEach(s=>{let l=s.type||e.type,c=s.indexAxis||iu(l,t),u=(yo[l]||{}).scales||{};Object.keys(u).forEach(p=>{let h=X_(p,c),m=s[h+"AxisID"]||r[h]||h;a[m]=a[m]||Object.create(null),Ko(a[m],[{axis:h},n[m],u[p]]);});}),Object.keys(a).forEach(s=>{let l=a[s];Ko(l,[H.scales[l.type],H.scale]);}),a}function Y0(e){let t=e.options||(e.options={});t.plugins=N(t.plugins,{}),t.scales=Q_(e,t);}function Z0(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function J_(e){return e=e||{},e.data=Z0(e.data),Y0(e),e}var g0=new Map,X0=new Set;function As(e,t){let o=g0.get(e);return o||(o=t(),g0.set(e,o),X0.add(o)),o}var tr=(e,t,o)=>{let n=Ae(t,o);n!==void 0&&e.add(n);},au=class{constructor(t){this._config=J_(t),this._scopeCache=new Map,this._resolverCache=new Map;}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t;}get data(){return this._config.data}set data(t){this._config.data=Z0(t);}get options(){return this._config.options}set options(t){this._config.options=t;}get plugins(){return this._config.plugins}update(){let t=this._config;this.clearCache(),Y0(t);}clearCache(){this._scopeCache.clear(),this._resolverCache.clear();}datasetScopeKeys(t){return As(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,o){return As(`${t}.transition.${o}`,()=>[[`datasets.${t}.transitions.${o}`,`transitions.${o}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,o){return As(`${t}-${o}`,()=>[[`datasets.${t}.elements.${o}`,`datasets.${t}`,`elements.${o}`,""]])}pluginScopeKeys(t){let o=t.id,n=this.type;return As(`${n}-plugin-${o}`,()=>[[`plugins.${o}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,o){let n=this._scopeCache,i=n.get(t);return (!i||o)&&(i=new Map,n.set(t,i)),i}getOptionScopes(t,o,n){let{options:i,type:r}=this,a=this._cachedScopes(t,n),s=a.get(o);if(s)return s;let l=new Set;o.forEach(d=>{t&&(l.add(t),d.forEach(u=>tr(l,t,u))),d.forEach(u=>tr(l,i,u)),d.forEach(u=>tr(l,yo[r]||{},u)),d.forEach(u=>tr(l,H,u)),d.forEach(u=>tr(l,ps,u));});let c=Array.from(l);return c.length===0&&c.push(Object.create(null)),X0.has(o)&&a.set(o,c),c}chartOptionScopes(){let{options:t,type:o}=this;return [t,yo[o]||{},H.datasets[o]||{},{type:o},H,ps]}resolveNamedOptions(t,o,n,i=[""]){let r={$shared:true},{resolver:a,subPrefixes:s}=f0(this._resolverCache,t,i),l=a;if(e4(a,o)){r.$shared=false,n=Tt(n)?n():n;let c=this.createResolver(t,n,s);l=fo(a,n,c);}for(let c of o)r[c]=l[c];return r}createResolver(t,o,n=[""],i){let{resolver:r}=f0(this._resolverCache,t,n);return z(o)?fo(r,o,void 0,i):r}};function f0(e,t,o){let n=e.get(t);n||(n=new Map,e.set(t,n));let i=o.join(),r=n.get(i);return r||(r={resolver:Zi(t,o),subPrefixes:o.filter(s=>!s.toLowerCase().includes("hover"))},n.set(i,r)),r}var t4=e=>z(e)&&Object.getOwnPropertyNames(e).reduce((t,o)=>t||Tt(e[o]),false);function e4(e,t){let{isScriptable:o,isIndexable:n}=fs(e);for(let i of t){let r=o(i),a=n(i),s=(a||r)&&e[i];if(r&&(Tt(s)||t4(s))||a&&Z(s))return true}return false}var o4="3.9.1",n4=["top","bottom","left","right","chartArea"];function y0(e,t){return e==="top"||e==="bottom"||n4.indexOf(e)===-1&&t==="x"}function x0(e,t){return function(o,n){return o[e]===n[e]?o[t]-n[t]:o[e]-n[e]}}function b0(e){let t=e.chart,o=t.options.animation;t.notifyPlugins("afterRender"),X(o&&o.onComplete,[e],t);}function i4(e){let t=e.chart,o=t.options.animation;X(o&&o.onProgress,[e],t);}function K0(e){return xs()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}var Bs={},q0=e=>{let t=K0(e);return Object.values(Bs).filter(o=>o.canvas===t).pop()};function r4(e,t,o){let n=Object.keys(e);for(let i of n){let r=+i;if(r>=t){let a=e[i];delete e[i],(o>0||r>t)&&(e[r+o]=a);}}}function a4(e,t,o,n){return !o||e.type==="mouseout"?null:n?t:e}var Lt=class{constructor(t,o){let n=this.config=new au(o),i=K0(t),r=q0(i);if(r)throw new Error("Canvas is already in use. Chart with ID '"+r.id+"' must be destroyed before the canvas with ID '"+r.canvas.id+"' can be reused.");let a=n.createResolver(n.chartOptionScopes(),this.getContext());this.platform=new(n.platform||W_(i)),this.platform.updateConfig(n);let s=this.platform.acquireContext(i,a.aspectRatio),l=s&&s.canvas,c=l&&l.height,d=l&&l.width;if(this.id=fd(),this.ctx=s,this.canvas=l,this.width=d,this.height=c,this._options=a,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new nu,this.$proxies={},this._hiddenIndices={},this.attached=false,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=wd(u=>this.update(u),a.resizeDelay||0),this._dataChanges=[],Bs[this.id]=this,!s||!l){console.error("Failed to create chart: can't acquire context from the given item");return}je.listen(this,"complete",b0),je.listen(this,"progress",i4),this._initialize(),this.attached&&this.update();}get aspectRatio(){let{options:{aspectRatio:t,maintainAspectRatio:o},width:n,height:i,_aspectRatio:r}=this;return W(t)?o&&r?r:i?n/i:null:t}get data(){return this.config.data}set data(t){this.config.data=t;}get options(){return this._options}set options(t){this.config.options=t;}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Cs(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return ms(this.canvas,this.ctx),this}stop(){return je.stop(this),this}resize(t,o){je.running(this)?this._resizeBeforeDraw={width:t,height:o}:this._resize(t,o);}_resize(t,o){let n=this.options,i=this.canvas,r=n.maintainAspectRatio&&this.aspectRatio,a=this.platform.getMaximumSize(i,t,o,r),s=n.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,Cs(this,s,true)&&(this.notifyPlugins("resize",{size:a}),X(n.onResize,[this,a],this),this.attached&&this._doResize(l)&&this.render());}ensureScalesHaveIDs(){let o=this.options.scales||{};K(o,(n,i)=>{n.id=i;});}buildOrUpdateScales(){let t=this.options,o=t.scales,n=this.scales,i=Object.keys(n).reduce((a,s)=>(a[s]=false,a),{}),r=[];o&&(r=r.concat(Object.keys(o).map(a=>{let s=o[a],l=ru(a,s),c=l==="r",d=l==="x";return {options:s,dposition:c?"chartArea":d?"bottom":"left",dtype:c?"radialLinear":d?"category":"linear"}}))),K(r,a=>{let s=a.options,l=s.id,c=ru(l,s),d=N(s.type,a.dtype);(s.position===void 0||y0(s.position,c)!==y0(a.dposition))&&(s.position=a.dposition),i[l]=true;let u=null;if(l in n&&n[l].type===d)u=n[l];else {let p=Ee.getScale(d);u=new p({id:l,type:d,ctx:this.ctx,chart:this}),n[u.id]=u;}u.init(s,t);}),K(i,(a,s)=>{a||delete n[s];}),K(n,a=>{ae.configure(this,a,a.options),ae.addBox(this,a);});}_updateMetasets(){let t=this._metasets,o=this.data.datasets.length,n=t.length;if(t.sort((i,r)=>i.index-r.index),n>o){for(let i=o;i<n;++i)this._destroyDatasetMeta(i);t.splice(o,n-o);}this._sortedMetasets=t.slice(0).sort(x0("order","index"));}_removeUnreferencedMetasets(){let{_metasets:t,data:{datasets:o}}=this;t.length>o.length&&delete this._stacks,t.forEach((n,i)=>{o.filter(r=>r===n._dataset).length===0&&this._destroyDatasetMeta(i);});}buildOrUpdateControllers(){let t=[],o=this.data.datasets,n,i;for(this._removeUnreferencedMetasets(),n=0,i=o.length;n<i;n++){let r=o[n],a=this.getDatasetMeta(n),s=r.type||this.config.type;if(a.type&&a.type!==s&&(this._destroyDatasetMeta(n),a=this.getDatasetMeta(n)),a.type=s,a.indexAxis=r.indexAxis||iu(s,this.options),a.order=r.order||0,a.index=n,a.label=""+r.label,a.visible=this.isDatasetVisible(n),a.controller)a.controller.updateIndex(n),a.controller.linkScales();else {let l=Ee.getController(s),{datasetElementType:c,dataElementType:d}=H.datasets[s];Object.assign(l.prototype,{dataElementType:Ee.getElement(d),datasetElementType:c&&Ee.getElement(c)}),a.controller=new l(this,n),t.push(a.controller);}}return this._updateMetasets(),t}_resetElements(){K(this.data.datasets,(t,o)=>{this.getDatasetMeta(o).controller.reset();},this);}reset(){this._resetElements(),this.notifyPlugins("reset");}update(t){let o=this.config;o.update();let n=this._options=o.createResolver(o.chartOptionScopes(),this.getContext()),i=this._animationsDisabled=!n.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:true})===false)return;let r=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let a=0;for(let c=0,d=this.data.datasets.length;c<d;c++){let{controller:u}=this.getDatasetMeta(c),p=!i&&r.indexOf(u)===-1;u.buildOrUpdateElements(p),a=Math.max(+u.getMaxOverflow(),a);}a=this._minPadding=n.layout.autoPadding?a:0,this._updateLayout(a),i||K(r,c=>{c.reset();}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(x0("z","_idx"));let{_active:s,_lastEvent:l}=this;l?this._eventHandler(l,true):s.length&&this._updateHoverStyles(s,s,true),this.render();}_updateScales(){K(this.scales,t=>{ae.removeBox(this,t);}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales();}_checkEventBindings(){let t=this.options,o=new Set(Object.keys(this._listeners)),n=new Set(t.events);(!es(o,n)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents());}_updateHiddenIndices(){let{_hiddenIndices:t}=this,o=this._getUniformDataChanges()||[];for(let{method:n,start:i,count:r}of o){let a=n==="_removeElements"?-r:r;r4(t,i,a);}}_getUniformDataChanges(){let t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];let o=this.data.datasets.length,n=r=>new Set(t.filter(a=>a[0]===r).map((a,s)=>s+","+a.splice(1).join(","))),i=n(0);for(let r=1;r<o;r++)if(!es(i,n(r)))return;return Array.from(i).map(r=>r.split(",")).map(r=>({method:r[1],start:+r[2],count:+r[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:true})===false)return;ae.update(this,this.width,this.height,t);let o=this.chartArea,n=o.width<=0||o.height<=0;this._layers=[],K(this.boxes,i=>{n&&i.position==="chartArea"||(i.configure&&i.configure(),this._layers.push(...i._layers()));},this),this._layers.forEach((i,r)=>{i._idx=r;}),this.notifyPlugins("afterLayout");}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:true})!==false){for(let o=0,n=this.data.datasets.length;o<n;++o)this.getDatasetMeta(o).controller.configure();for(let o=0,n=this.data.datasets.length;o<n;++o)this._updateDataset(o,Tt(t)?t({datasetIndex:o}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t});}}_updateDataset(t,o){let n=this.getDatasetMeta(t),i={meta:n,index:t,mode:o,cancelable:true};this.notifyPlugins("beforeDatasetUpdate",i)!==false&&(n.controller._update(o),i.cancelable=false,this.notifyPlugins("afterDatasetUpdate",i));}render(){this.notifyPlugins("beforeRender",{cancelable:true})!==false&&(je.has(this)?this.attached&&!je.running(this)&&je.start(this):(this.draw(),b0({chart:this})));}draw(){let t;if(this._resizeBeforeDraw){let{width:n,height:i}=this._resizeBeforeDraw;this._resize(n,i),this._resizeBeforeDraw=null;}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:true})===false)return;let o=this._layers;for(t=0;t<o.length&&o[t].z<=0;++t)o[t].draw(this.chartArea);for(this._drawDatasets();t<o.length;++t)o[t].draw(this.chartArea);this.notifyPlugins("afterDraw");}_getSortedDatasetMetas(t){let o=this._sortedMetasets,n=[],i,r;for(i=0,r=o.length;i<r;++i){let a=o[i];(!t||a.visible)&&n.push(a);}return n}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(true)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:true})===false)return;let t=this.getSortedVisibleDatasetMetas();for(let o=t.length-1;o>=0;--o)this._drawDataset(t[o]);this.notifyPlugins("afterDatasetsDraw");}_drawDataset(t){let o=this.ctx,n=t._clip,i=!n.disabled,r=this.chartArea,a={meta:t,index:t.index,cancelable:true};this.notifyPlugins("beforeDatasetDraw",a)!==false&&(i&&xo(o,{left:n.left===false?0:r.left-n.left,right:n.right===false?this.width:r.right+n.right,top:n.top===false?0:r.top-n.top,bottom:n.bottom===false?this.height:r.bottom+n.bottom}),t.controller.draw(),i&&bo(o),a.cancelable=false,this.notifyPlugins("afterDatasetDraw",a));}isPointInArea(t){return Xo(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,o,n,i){let r=w_.modes[o];return typeof r=="function"?r(this,t,n,i):[]}getDatasetMeta(t){let o=this.data.datasets[t],n=this._metasets,i=n.filter(r=>r&&r._dataset===o).pop();return i||(i={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:o&&o.order||0,index:t,_dataset:o,_parsed:[],_sorted:false},n.push(i)),i}getContext(){return this.$context||(this.$context=Me(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){let o=this.data.datasets[t];if(!o)return false;let n=this.getDatasetMeta(t);return typeof n.hidden=="boolean"?!n.hidden:!o.hidden}setDatasetVisibility(t,o){let n=this.getDatasetMeta(t);n.hidden=!o;}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t];}getDataVisibility(t){return !this._hiddenIndices[t]}_updateVisibility(t,o,n){let i=n?"show":"hide",r=this.getDatasetMeta(t),a=r.controller._resolveAnimations(void 0,i);st(o)?(r.data[o].hidden=!n,this.update()):(this.setDatasetVisibility(t,n),a.update(r,{visible:n}),this.update(s=>s.datasetIndex===t?i:void 0));}hide(t,o){this._updateVisibility(t,o,false);}show(t,o){this._updateVisibility(t,o,true);}_destroyDatasetMeta(t){let o=this._metasets[t];o&&o.controller&&o.controller._destroy(),delete this._metasets[t];}_stop(){let t,o;for(this.stop(),je.remove(this),t=0,o=this.data.datasets.length;t<o;++t)this._destroyDatasetMeta(t);}destroy(){this.notifyPlugins("beforeDestroy");let{canvas:t,ctx:o}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),ms(t,o),this.platform.releaseContext(o),this.canvas=null,this.ctx=null),this.notifyPlugins("destroy"),delete Bs[this.id],this.notifyPlugins("afterDestroy");}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=true;}bindUserEvents(){let t=this._listeners,o=this.platform,n=(r,a)=>{o.addEventListener(this,r,a),t[r]=a;},i=(r,a,s)=>{r.offsetX=a,r.offsetY=s,this._eventHandler(r);};K(this.options.events,r=>n(r,i));}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});let t=this._responsiveListeners,o=this.platform,n=(l,c)=>{o.addEventListener(this,l,c),t[l]=c;},i=(l,c)=>{t[l]&&(o.removeEventListener(this,l,c),delete t[l]);},r=(l,c)=>{this.canvas&&this.resize(l,c);},a,s=()=>{i("attach",s),this.attached=true,this.resize(),n("resize",r),n("detach",a);};a=()=>{this.attached=false,i("resize",r),this._stop(),this._resize(0,0),n("attach",s);},o.isAttached(this.canvas)?s():a();}unbindEvents(){K(this._listeners,(t,o)=>{this.platform.removeEventListener(this,o,t);}),this._listeners={},K(this._responsiveListeners,(t,o)=>{this.platform.removeEventListener(this,o,t);}),this._responsiveListeners=void 0;}updateHoverStyle(t,o,n){let i=n?"set":"remove",r,a,s,l;for(o==="dataset"&&(r=this.getDatasetMeta(t[0].datasetIndex),r.controller["_"+i+"DatasetHoverStyle"]()),s=0,l=t.length;s<l;++s){a=t[s];let c=a&&this.getDatasetMeta(a.datasetIndex).controller;c&&c[i+"HoverStyle"](a.element,a.datasetIndex,a.index);}}getActiveElements(){return this._active||[]}setActiveElements(t){let o=this._active||[],n=t.map(({datasetIndex:r,index:a})=>{let s=this.getDatasetMeta(r);if(!s)throw new Error("No dataset found at index "+r);return {datasetIndex:r,element:s.data[a],index:a}});!Vn(n,o)&&(this._active=n,this._lastEvent=null,this._updateHoverStyles(n,o));}notifyPlugins(t,o,n){return this._plugins.notify(this,t,o,n)}_updateHoverStyles(t,o,n){let i=this.options.hover,r=(l,c)=>l.filter(d=>!c.some(u=>d.datasetIndex===u.datasetIndex&&d.index===u.index)),a=r(o,t),s=n?t:r(t,o);a.length&&this.updateHoverStyle(a,i.mode,false),s.length&&i.mode&&this.updateHoverStyle(s,i.mode,true);}_eventHandler(t,o){let n={event:t,replay:o,cancelable:true,inChartArea:this.isPointInArea(t)},i=a=>(a.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",n,i)===false)return;let r=this._handleEvent(t,o,n.inChartArea);return n.cancelable=false,this.notifyPlugins("afterEvent",n,i),(r||n.changed)&&this.render(),this}_handleEvent(t,o,n){let{_active:i=[],options:r}=this,a=o,s=this._getActiveElements(t,i,n,a),l=xd(t),c=a4(t,this._lastEvent,n,l);n&&(this._lastEvent=null,X(r.onHover,[t,s,this],this),l&&X(r.onClick,[t,s,this],this));let d=!Vn(s,i);return (d||o)&&(this._active=s,this._updateHoverStyles(s,i,o)),this._lastEvent=c,d}_getActiveElements(t,o,n,i){if(t.type==="mouseout")return [];if(!n)return o;let r=this.options.hover;return this.getElementsAtEventForMode(t,r.mode,r,i)}},C0=()=>K(Lt.instances,e=>e._plugins.invalidate()),Po=true;Object.defineProperties(Lt,{defaults:{enumerable:Po,value:H},instances:{enumerable:Po,value:Bs},overrides:{enumerable:Po,value:yo},registry:{enumerable:Po,value:Ee},version:{enumerable:Po,value:o4},getChart:{enumerable:Po,value:q0},register:{enumerable:Po,value:(...e)=>{Ee.add(...e),C0();}},unregister:{enumerable:Po,value:(...e)=>{Ee.remove(...e),C0();}}});function Q0(e,t,o){let{startAngle:n,pixelMargin:i,x:r,y:a,outerRadius:s,innerRadius:l}=t,c=i/s;e.beginPath(),e.arc(r,a,s,n-c,o+c),l>i?(c=i/l,e.arc(r,a,l,o+c,n-c,true)):e.arc(r,a,i,o+et,n-et),e.closePath(),e.clip();}function s4(e){return Yi(e,["outerStart","outerEnd","innerStart","innerEnd"])}function l4(e,t,o,n){let i=s4(e.options.borderRadius),r=(o-t)/2,a=Math.min(r,n*t/2),s=l=>{let c=(o-Math.min(r,l))*n/2;return Ct(l,0,Math.min(r,c))};return {outerStart:s(i.outerStart),outerEnd:s(i.outerEnd),innerStart:Ct(i.innerStart,0,a),innerEnd:Ct(i.innerEnd,0,a)}}function $n(e,t,o,n){return {x:o+e*Math.cos(t),y:n+e*Math.sin(t)}}function su(e,t,o,n,i,r){let{x:a,y:s,startAngle:l,pixelMargin:c,innerRadius:d}=t,u=Math.max(t.outerRadius+n+o-c,0),p=d>0?d+n+o+c:0,h=0,m=i-l;if(n){let L=d>0?d-n:0,V=u>0?u-n:0,J=(L+V)/2,Bt=J!==0?m*J/(J+n):m;h=(m-Bt)/2;}let g=Math.max(.001,m*u-o/G)/u,f=(m-g)/2,x=l+f+h,b=i-f-h,{outerStart:T,outerEnd:k,innerStart:w,innerEnd:v}=l4(t,p,u,b-x),_=u-T,M=u-k,I=x+T/_,F=b-k/M,E=p+w,B=p+v,O=x+w/E,U=b-v/B;if(e.beginPath(),r){if(e.arc(a,s,u,I,F),k>0){let J=$n(M,F,a,s);e.arc(J.x,J.y,k,F,b+et);}let L=$n(B,b,a,s);if(e.lineTo(L.x,L.y),v>0){let J=$n(B,U,a,s);e.arc(J.x,J.y,v,b+et,U+Math.PI);}if(e.arc(a,s,p,b-v/p,x+w/p,true),w>0){let J=$n(E,O,a,s);e.arc(J.x,J.y,w,O+Math.PI,x-et);}let V=$n(_,x,a,s);if(e.lineTo(V.x,V.y),T>0){let J=$n(_,I,a,s);e.arc(J.x,J.y,T,x-et,I);}}else {e.moveTo(a,s);let L=Math.cos(I)*u+a,V=Math.sin(I)*u+s;e.lineTo(L,V);let J=Math.cos(F)*u+a,Bt=Math.sin(F)*u+s;e.lineTo(J,Bt);}e.closePath();}function c4(e,t,o,n,i){let{fullCircles:r,startAngle:a,circumference:s}=t,l=t.endAngle;if(r){su(e,t,o,n,a+Q,i);for(let c=0;c<r;++c)e.fill();isNaN(s)||(l=a+s%Q,s%Q===0&&(l+=Q));}return su(e,t,o,n,l,i),e.fill(),l}function d4(e,t,o){let{x:n,y:i,startAngle:r,pixelMargin:a,fullCircles:s}=t,l=Math.max(t.outerRadius-a,0),c=t.innerRadius+a,d;for(o&&Q0(e,t,r+Q),e.beginPath(),e.arc(n,i,c,r+Q,r,true),d=0;d<s;++d)e.stroke();for(e.beginPath(),e.arc(n,i,l,r,r+Q),d=0;d<s;++d)e.stroke();}function u4(e,t,o,n,i,r){let{options:a}=t,{borderWidth:s,borderJoinStyle:l}=a,c=a.borderAlign==="inner";s&&(c?(e.lineWidth=s*2,e.lineJoin=l||"round"):(e.lineWidth=s,e.lineJoin=l||"bevel"),t.fullCircles&&d4(e,t,c),c&&Q0(e,t,i),su(e,t,o,n,i,r),e.stroke());}var Ze=class extends xt{constructor(t){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,t&&Object.assign(this,t);}inRange(t,o,n){let i=this.getProps(["x","y"],n),{angle:r,distance:a}=rs(i,{x:t,y:o}),{startAngle:s,endAngle:l,innerRadius:c,outerRadius:d,circumference:u}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],n),p=this.options.spacing/2,m=N(u,l-s)>=Q||Jo(r,s,l),g=ge(a,c+p,d+p);return m&&g}getCenterPoint(t){let{x:o,y:n,startAngle:i,endAngle:r,innerRadius:a,outerRadius:s}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius","circumference"],t),{offset:l,spacing:c}=this.options,d=(i+r)/2,u=(a+s+c+l)/2;return {x:o+Math.cos(d)*u,y:n+Math.sin(d)*u}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){let{options:o,circumference:n}=this,i=(o.offset||0)/2,r=(o.spacing||0)/2,a=o.circular;if(this.pixelMargin=o.borderAlign==="inner"?.33:0,this.fullCircles=n>Q?Math.floor(n/Q):0,n===0||this.innerRadius<0||this.outerRadius<0)return;t.save();let s=0;if(i){s=i/2;let c=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(c)*s,Math.sin(c)*s),this.circumference>=G&&(s=i);}t.fillStyle=o.backgroundColor,t.strokeStyle=o.borderColor;let l=c4(t,this,s,r,a);u4(t,this,s,r,l,a),t.restore();}};Ze.id="arc";Ze.defaults={borderAlign:"center",borderColor:"#fff",borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:true};Ze.defaultRoutes={backgroundColor:"backgroundColor"};function J0(e,t,o=t){e.lineCap=N(o.borderCapStyle,t.borderCapStyle),e.setLineDash(N(o.borderDash,t.borderDash)),e.lineDashOffset=N(o.borderDashOffset,t.borderDashOffset),e.lineJoin=N(o.borderJoinStyle,t.borderJoinStyle),e.lineWidth=N(o.borderWidth,t.borderWidth),e.strokeStyle=N(o.borderColor,t.borderColor);}function p4(e,t,o){e.lineTo(o.x,o.y);}function m4(e){return e.stepped?Fd:e.tension||e.cubicInterpolationMode==="monotone"?Ld:p4}function tx(e,t,o={}){let n=e.length,{start:i=0,end:r=n-1}=o,{start:a,end:s}=t,l=Math.max(i,a),c=Math.min(r,s),d=i<a&&r<a||i>s&&r>s;return {count:n,start:l,loop:t.loop,ilen:c<l&&!d?n+c-l:c-l}}function h4(e,t,o,n){let{points:i,options:r}=t,{count:a,start:s,loop:l,ilen:c}=tx(i,o,n),d=m4(r),{move:u=true,reverse:p}=n||{},h,m,g;for(h=0;h<=c;++h)m=i[(s+(p?c-h:h))%a],!m.skip&&(u?(e.moveTo(m.x,m.y),u=false):d(e,g,m,p,r.stepped),g=m);return l&&(m=i[(s+(p?c:0))%a],d(e,g,m,p,r.stepped)),!!l}function g4(e,t,o,n){let i=t.points,{count:r,start:a,ilen:s}=tx(i,o,n),{move:l=true,reverse:c}=n||{},d=0,u=0,p,h,m,g,f,x,b=k=>(a+(c?s-k:k))%r,T=()=>{g!==f&&(e.lineTo(d,f),e.lineTo(d,g),e.lineTo(d,x));};for(l&&(h=i[b(0)],e.moveTo(h.x,h.y)),p=0;p<=s;++p){if(h=i[b(p)],h.skip)continue;let k=h.x,w=h.y,v=k|0;v===m?(w<g?g=w:w>f&&(f=w),d=(u*d+k)/++u):(T(),e.lineTo(k,w),m=v,u=0,g=f=w),x=w;}T();}function lu(e){let t=e.options,o=t.borderDash&&t.borderDash.length;return !e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!o?g4:h4}function f4(e){return e.stepped?zd:e.tension||e.cubicInterpolationMode==="monotone"?Vd:Oe}function y4(e,t,o,n){let i=t._path;i||(i=t._path=new Path2D,t.path(i,o,n)&&i.closePath()),J0(e,t.options),e.stroke(i);}function x4(e,t,o,n){let{segments:i,options:r}=t,a=lu(t);for(let s of i)J0(e,r,s.style),e.beginPath(),a(e,t,s,{start:o,end:o+n-1})&&e.closePath(),e.stroke();}var b4=typeof Path2D=="function";function C4(e,t,o,n){b4&&!t.options.segment?y4(e,t,o,n):x4(e,t,o,n);}var ye=class extends xt{constructor(t){super(),this.animated=true,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=false,this._pointsUpdated=false,this._datasetIndex=void 0,t&&Object.assign(this,t);}updateControlPoints(t,o){let n=this.options;if((n.tension||n.cubicInterpolationMode==="monotone")&&!n.stepped&&!this._pointsUpdated){let i=n.spanGaps?this._loop:this._fullLoop;Nd(this._points,n,t,i,o),this._pointsUpdated=true;}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=false;}get points(){return this._points}get segments(){return this._segments||(this._segments=$d(this,this.options.segment))}first(){let t=this.segments,o=this.points;return t.length&&o[t[0].start]}last(){let t=this.segments,o=this.points,n=t.length;return n&&o[t[n-1].end]}interpolate(t,o){let n=this.options,i=t[o],r=this.points,a=ws(this,{property:o,start:i,end:i});if(!a.length)return;let s=[],l=f4(n),c,d;for(c=0,d=a.length;c<d;++c){let{start:u,end:p}=a[c],h=r[u],m=r[p];if(h===m){s.push(h);continue}let g=Math.abs((i-h[o])/(m[o]-h[o])),f=l(h,m,g,n.stepped);f[o]=t[o],s.push(f);}return s.length===1?s[0]:s}pathSegment(t,o,n){return lu(this)(t,this,o,n)}path(t,o,n){let i=this.segments,r=lu(this),a=this._loop;o=o||0,n=n||this.points.length-o;for(let s of i)a&=r(t,this,s,{start:o,end:o+n-1});return !!a}draw(t,o,n,i){let r=this.options||{};(this.points||[]).length&&r.borderWidth&&(t.save(),C4(t,this,n,i),t.restore()),this.animated&&(this._pointsUpdated=false,this._path=void 0);}};ye.id="line";ye.defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:true,cubicInterpolationMode:"default",fill:false,spanGaps:false,stepped:false,tension:0};ye.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};ye.descriptors={_scriptable:true,_indexable:e=>e!=="borderDash"&&e!=="fill"};function P0(e,t,o,n){let i=e.options,{[o]:r}=e.getProps([o],n);return Math.abs(t-r)<i.radius+i.hitRadius}var Xe=class extends xt{constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t);}inRange(t,o,n){let i=this.options,{x:r,y:a}=this.getProps(["x","y"],n);return Math.pow(t-r,2)+Math.pow(o-a,2)<Math.pow(i.hitRadius+i.radius,2)}inXRange(t,o){return P0(this,t,"x",o)}inYRange(t,o){return P0(this,t,"y",o)}getCenterPoint(t){let{x:o,y:n}=this.getProps(["x","y"],t);return {x:o,y:n}}size(t){t=t||this.options||{};let o=t.radius||0;o=Math.max(o,o&&t.hoverRadius||0);let n=o&&t.borderWidth||0;return (o+n)*2}draw(t,o){let n=this.options;this.skip||n.radius<.1||!Xo(this,o,this.size(n)/2)||(t.strokeStyle=n.borderColor,t.lineWidth=n.borderWidth,t.fillStyle=n.backgroundColor,ji(t,n,this.x,this.y));}getRange(){let t=this.options||{};return t.radius+t.hitRadius}};Xe.id="point";Xe.defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0};Xe.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};function ex(e,t){let{x:o,y:n,base:i,width:r,height:a}=e.getProps(["x","y","base","width","height"],t),s,l,c,d,u;return e.horizontal?(u=a/2,s=Math.min(o,i),l=Math.max(o,i),c=n-u,d=n+u):(u=r/2,s=o-u,l=o+u,c=Math.min(n,i),d=Math.max(n,i)),{left:s,top:c,right:l,bottom:d}}function So(e,t,o,n){return e?0:Ct(t,o,n)}function P4(e,t,o){let n=e.options.borderWidth,i=e.borderSkipped,r=gs(n);return {t:So(i.top,r.top,0,o),r:So(i.right,r.right,0,t),b:So(i.bottom,r.bottom,0,o),l:So(i.left,r.left,0,t)}}function S4(e,t,o){let{enableBorderRadius:n}=e.getProps(["enableBorderRadius"]),i=e.options.borderRadius,r=fe(i),a=Math.min(t,o),s=e.borderSkipped,l=n||z(i);return {topLeft:So(!l||s.top||s.left,r.topLeft,0,a),topRight:So(!l||s.top||s.right,r.topRight,0,a),bottomLeft:So(!l||s.bottom||s.left,r.bottomLeft,0,a),bottomRight:So(!l||s.bottom||s.right,r.bottomRight,0,a)}}function T4(e){let t=ex(e),o=t.right-t.left,n=t.bottom-t.top,i=P4(e,o/2,n/2),r=S4(e,o/2,n/2);return {outer:{x:t.left,y:t.top,w:o,h:n,radius:r},inner:{x:t.left+i.l,y:t.top+i.t,w:o-i.l-i.r,h:n-i.t-i.b,radius:{topLeft:Math.max(0,r.topLeft-Math.max(i.t,i.l)),topRight:Math.max(0,r.topRight-Math.max(i.t,i.r)),bottomLeft:Math.max(0,r.bottomLeft-Math.max(i.b,i.l)),bottomRight:Math.max(0,r.bottomRight-Math.max(i.b,i.r))}}}}function Xd(e,t,o,n){let i=t===null,r=o===null,s=e&&!(i&&r)&&ex(e,n);return s&&(i||ge(t,s.left,s.right))&&(r||ge(o,s.top,s.bottom))}function k4(e){return e.topLeft||e.topRight||e.bottomLeft||e.bottomRight}function w4(e,t){e.rect(t.x,t.y,t.w,t.h);}function Kd(e,t,o={}){let n=e.x!==o.x?-t:0,i=e.y!==o.y?-t:0,r=(e.x+e.w!==o.x+o.w?t:0)-n,a=(e.y+e.h!==o.y+o.h?t:0)-i;return {x:e.x+n,y:e.y+i,w:e.w+r,h:e.h+a,radius:e.radius}}var Ke=class extends xt{constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t);}draw(t){let{inflateAmount:o,options:{borderColor:n,backgroundColor:i}}=this,{inner:r,outer:a}=T4(this),s=k4(a.radius)?We:w4;t.save(),(a.w!==r.w||a.h!==r.h)&&(t.beginPath(),s(t,Kd(a,o,r)),t.clip(),s(t,Kd(r,-o,a)),t.fillStyle=n,t.fill("evenodd")),t.beginPath(),s(t,Kd(r,o)),t.fillStyle=i,t.fill(),t.restore();}inRange(t,o,n){return Xd(this,t,o,n)}inXRange(t,o){return Xd(this,t,null,o)}inYRange(t,o){return Xd(this,null,t,o)}getCenterPoint(t){let{x:o,y:n,base:i,horizontal:r}=this.getProps(["x","y","base","horizontal"],t);return {x:r?(o+i)/2:o,y:r?n:(n+i)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}};Ke.id="bar";Ke.defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0};Ke.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};function v4(e,t,o){let n=e.segments,i=e.points,r=t.points,a=[];for(let s of n){let{start:l,end:c}=s;c=uu(l,c,i);let d=cu(o,i[l],i[c],s.loop);if(!t.segments){a.push({source:s,target:d,start:i[l],end:i[c]});continue}let u=ws(t,d);for(let p of u){let h=cu(o,r[p.start],r[p.end],p.loop),m=ks(s,i,h);for(let g of m)a.push({source:g,target:p,start:{[o]:S0(d,h,"start",Math.max)},end:{[o]:S0(d,h,"end",Math.min)}});}}return a}function cu(e,t,o,n){if(n)return;let i=t[e],r=o[e];return e==="angle"&&(i=Ft(i),r=Ft(r)),{property:e,start:i,end:r}}function _4(e,t){let{x:o=null,y:n=null}=e||{},i=t.points,r=[];return t.segments.forEach(({start:a,end:s})=>{s=uu(a,s,i);let l=i[a],c=i[s];n!==null?(r.push({x:l.x,y:n}),r.push({x:c.x,y:n})):o!==null&&(r.push({x:o,y:l.y}),r.push({x:o,y:c.y}));}),r}function uu(e,t,o){for(;t>e;t--){let n=o[t];if(!isNaN(n.x)&&!isNaN(n.y))break}return t}function S0(e,t,o,n){return e&&t?n(e[o],t[o]):e?e[o]:t?t[o]:0}function ox(e,t){let o=[],n=false;return Z(e)?(n=true,o=e):o=_4(e,t),o.length?new ye({points:o,options:{tension:0},_loop:n,_fullLoop:n}):null}function T0(e){return e&&e.fill!==false}function A4(e,t,o){let i=e[t].fill,r=[t],a;if(!o)return i;for(;i!==false&&r.indexOf(i)===-1;){if(!lt(i))return i;if(a=e[i],!a)return false;if(a.visible)return i;r.push(i),i=a.fill;}return false}function M4(e,t,o){let n=L4(e);if(z(n))return isNaN(n.value)?false:n;let i=parseFloat(n);return lt(i)&&Math.floor(i)===i?I4(n[0],t,i,o):["origin","start","end","stack","shape"].indexOf(n)>=0&&n}function I4(e,t,o,n){return (e==="-"||e==="+")&&(o=t+o),o===t||o<0||o>=n?false:o}function E4(e,t){let o=null;return e==="start"?o=t.bottom:e==="end"?o=t.top:z(e)?o=t.getPixelForValue(e.value):t.getBasePixel&&(o=t.getBasePixel()),o}function F4(e,t,o){let n;return e==="start"?n=o:e==="end"?n=t.options.reverse?t.min:t.max:z(e)?n=e.value:n=t.getBaseValue(),n}function L4(e){let t=e.options,o=t.fill,n=N(o&&o.target,o);return n===void 0&&(n=!!t.backgroundColor),n===false||n===null?false:n===true?"origin":n}function B4(e){let{scale:t,index:o,line:n}=e,i=[],r=n.segments,a=n.points,s=R4(t,o);s.push(ox({x:null,y:t.bottom},n));for(let l=0;l<r.length;l++){let c=r[l];for(let d=c.start;d<=c.end;d++)D4(i,a[d],s);}return new ye({points:i,options:{}})}function R4(e,t){let o=[],n=e.getMatchingVisibleMetas("line");for(let i=0;i<n.length;i++){let r=n[i];if(r.index===t)break;r.hidden||o.unshift(r.dataset);}return o}function D4(e,t,o){let n=[];for(let i=0;i<o.length;i++){let r=o[i],{first:a,last:s,point:l}=N4(r,t,"x");if(!(!l||a&&s)){if(a)n.unshift(l);else if(e.push(l),!s)break}}e.push(...n);}function N4(e,t,o){let n=e.interpolate(t,o);if(!n)return {};let i=n[o],r=e.segments,a=e.points,s=false,l=false;for(let c=0;c<r.length;c++){let d=r[c],u=a[d.start][o],p=a[d.end][o];if(ge(i,u,p)){s=i===u,l=i===p;break}}return {first:s,last:l,point:n}}var Rs=class{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius;}pathSegment(t,o,n){let{x:i,y:r,radius:a}=this;return o=o||{start:0,end:Q},t.arc(i,r,a,o.end,o.start,true),!n.bounds}interpolate(t){let{x:o,y:n,radius:i}=this,r=t.angle;return {x:o+Math.cos(r)*i,y:n+Math.sin(r)*i,angle:r}}};function U4(e){let{chart:t,fill:o,line:n}=e;if(lt(o))return O4(t,o);if(o==="stack")return B4(e);if(o==="shape")return true;let i=z4(e);return i instanceof Rs?i:ox(i,n)}function O4(e,t){let o=e.getDatasetMeta(t);return o&&e.isDatasetVisible(t)?o.dataset:null}function z4(e){return (e.scale||{}).getPointPositionForValue?$4(e):V4(e)}function V4(e){let{scale:t={},fill:o}=e,n=E4(o,t);if(lt(n)){let i=t.isHorizontal();return {x:i?n:null,y:i?null:n}}return null}function $4(e){let{scale:t,fill:o}=e,n=t.options,i=t.getLabels().length,r=n.reverse?t.max:t.min,a=F4(o,t,r),s=[];if(n.grid.circular){let l=t.getPointPositionForValue(0,r);return new Rs({x:l.x,y:l.y,radius:t.getDistanceFromCenterForValue(a)})}for(let l=0;l<i;++l)s.push(t.getPointPositionForValue(l,a));return s}function qd(e,t,o){let n=U4(t),{line:i,scale:r,axis:a}=t,s=i.options,l=s.fill,c=s.backgroundColor,{above:d=c,below:u=c}=l||{};n&&i.points.length&&(xo(e,o),H4(e,{line:i,target:n,above:d,below:u,area:o,scale:r,axis:a}),bo(e));}function H4(e,t){let{line:o,target:n,above:i,below:r,area:a,scale:s}=t,l=o._loop?"angle":t.axis;e.save(),l==="x"&&r!==i&&(k0(e,n,a.top),w0(e,{line:o,target:n,color:i,scale:s,property:l}),e.restore(),e.save(),k0(e,n,a.bottom)),w0(e,{line:o,target:n,color:r,scale:s,property:l}),e.restore();}function k0(e,t,o){let{segments:n,points:i}=t,r=true,a=false;e.beginPath();for(let s of n){let{start:l,end:c}=s,d=i[l],u=i[uu(l,c,i)];r?(e.moveTo(d.x,d.y),r=false):(e.lineTo(d.x,o),e.lineTo(d.x,d.y)),a=!!t.pathSegment(e,s,{move:a}),a?e.closePath():e.lineTo(u.x,o);}e.lineTo(t.first().x,o),e.closePath(),e.clip();}function w0(e,t){let{line:o,target:n,property:i,color:r,scale:a}=t,s=v4(o,n,i);for(let{source:l,target:c,start:d,end:u}of s){let{style:{backgroundColor:p=r}={}}=l,h=n!==true;e.save(),e.fillStyle=p,W4(e,a,h&&cu(i,d,u)),e.beginPath();let m=!!o.pathSegment(e,l),g;if(h){m?e.closePath():v0(e,n,u,i);let f=!!n.pathSegment(e,c,{move:m,reverse:true});g=m&&f,g||v0(e,n,d,i);}e.closePath(),e.fill(g?"evenodd":"nonzero"),e.restore();}}function W4(e,t,o){let{top:n,bottom:i}=t.chart.chartArea,{property:r,start:a,end:s}=o||{};r==="x"&&(e.beginPath(),e.rect(a,n,s-a,i-n),e.clip());}function v0(e,t,o,n){let i=t.interpolate(o,n);i&&e.lineTo(i.x,i.y);}var nx={id:"filler",afterDatasetsUpdate(e,t,o){let n=(e.data.datasets||[]).length,i=[],r,a,s,l;for(a=0;a<n;++a)r=e.getDatasetMeta(a),s=r.dataset,l=null,s&&s.options&&s instanceof ye&&(l={visible:e.isDatasetVisible(a),index:a,fill:M4(s,a,n),chart:e,axis:r.controller.options.indexAxis,scale:r.vScale,line:s}),r.$filler=l,i.push(l);for(a=0;a<n;++a)l=i[a],!(!l||l.fill===false)&&(l.fill=A4(i,a,o.propagate));},beforeDraw(e,t,o){let n=o.drawTime==="beforeDraw",i=e.getSortedVisibleDatasetMetas(),r=e.chartArea;for(let a=i.length-1;a>=0;--a){let s=i[a].$filler;s&&(s.line.updateControlPoints(r,s.axis),n&&s.fill&&qd(e.ctx,s,r));}},beforeDatasetsDraw(e,t,o){if(o.drawTime!=="beforeDatasetsDraw")return;let n=e.getSortedVisibleDatasetMetas();for(let i=n.length-1;i>=0;--i){let r=n[i].$filler;T0(r)&&qd(e.ctx,r,e.chartArea);}},beforeDatasetDraw(e,t,o){let n=t.meta.$filler;!T0(n)||o.drawTime!=="beforeDatasetDraw"||qd(e.ctx,n,e.chartArea);},defaults:{propagate:true,drawTime:"beforeDatasetDraw"}},_0=(e,t)=>{let{boxHeight:o=t,boxWidth:n=t}=e;return e.usePointStyle&&(o=Math.min(o,t),n=e.pointStyleWidth||Math.min(n,t)),{boxWidth:n,boxHeight:o,itemHeight:Math.max(t,o)}},G4=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index,Ds=class extends xt{constructor(t){super(),this._added=false,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=false,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0;}update(t,o,n){this.maxWidth=t,this.maxHeight=o,this._margins=n,this.setDimensions(),this.buildLabels(),this.fit();}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height);}buildLabels(){let t=this.options.labels||{},o=X(t.generateLabels,[this.chart],this)||[];t.filter&&(o=o.filter(n=>t.filter(n,this.chart.data))),t.sort&&(o=o.sort((n,i)=>t.sort(n,i,this.chart.data))),this.options.reverse&&o.reverse(),this.legendItems=o;}fit(){let{options:t,ctx:o}=this;if(!t.display){this.width=this.height=0;return}let n=t.labels,i=it(n.font),r=i.size,a=this._computeTitleHeight(),{boxWidth:s,itemHeight:l}=_0(n,r),c,d;o.font=i.string,this.isHorizontal()?(c=this.maxWidth,d=this._fitRows(a,r,s,l)+10):(d=this.maxHeight,c=this._fitCols(a,r,s,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(d,t.maxHeight||this.maxHeight);}_fitRows(t,o,n,i){let{ctx:r,maxWidth:a,options:{labels:{padding:s}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],d=i+s,u=t;r.textAlign="left",r.textBaseline="middle";let p=-1,h=-d;return this.legendItems.forEach((m,g)=>{let f=n+o/2+r.measureText(m.text).width;(g===0||c[c.length-1]+f+2*s>a)&&(u+=d,c[c.length-(g>0?0:1)]=0,h+=d,p++),l[g]={left:0,top:h,row:p,width:f,height:i},c[c.length-1]+=f+s;}),u}_fitCols(t,o,n,i){let{ctx:r,maxHeight:a,options:{labels:{padding:s}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],d=a-t,u=s,p=0,h=0,m=0,g=0;return this.legendItems.forEach((f,x)=>{let b=n+o/2+r.measureText(f.text).width;x>0&&h+i+2*s>d&&(u+=p+s,c.push({width:p,height:h}),m+=p+s,g++,p=h=0),l[x]={left:m,top:h,col:g,width:b,height:i},p=Math.max(p,b),h+=i+s;}),u+=p,c.push({width:p,height:h}),u}adjustHitBoxes(){if(!this.options.display)return;let t=this._computeTitleHeight(),{legendHitBoxes:o,options:{align:n,labels:{padding:i},rtl:r}}=this,a=Co(r,this.left,this.width);if(this.isHorizontal()){let s=0,l=Pt(n,this.left+i,this.right-this.lineWidths[s]);for(let c of o)s!==c.row&&(s=c.row,l=Pt(n,this.left+i,this.right-this.lineWidths[s])),c.top+=this.top+t+i,c.left=a.leftForLtr(a.x(l),c.width),l+=c.width+i;}else {let s=0,l=Pt(n,this.top+t+i,this.bottom-this.columnSizes[s].height);for(let c of o)c.col!==s&&(s=c.col,l=Pt(n,this.top+t+i,this.bottom-this.columnSizes[s].height)),c.top=l,c.left+=this.left+i,c.left=a.leftForLtr(a.x(c.left),c.width),l+=c.height+i;}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){let t=this.ctx;xo(t,this),this._draw(),bo(t);}}_draw(){let{options:t,columnSizes:o,lineWidths:n,ctx:i}=this,{align:r,labels:a}=t,s=H.color,l=Co(t.rtl,this.left,this.width),c=it(a.font),{color:d,padding:u}=a,p=c.size,h=p/2,m;this.drawTitle(),i.textAlign=l.textAlign("left"),i.textBaseline="middle",i.lineWidth=.5,i.font=c.string;let{boxWidth:g,boxHeight:f,itemHeight:x}=_0(a,p),b=function(_,M,I){if(isNaN(g)||g<=0||isNaN(f)||f<0)return;i.save();let F=N(I.lineWidth,1);if(i.fillStyle=N(I.fillStyle,s),i.lineCap=N(I.lineCap,"butt"),i.lineDashOffset=N(I.lineDashOffset,0),i.lineJoin=N(I.lineJoin,"miter"),i.lineWidth=F,i.strokeStyle=N(I.strokeStyle,s),i.setLineDash(N(I.lineDash,[])),a.usePointStyle){let E={radius:f*Math.SQRT2/2,pointStyle:I.pointStyle,rotation:I.rotation,borderWidth:F},B=l.xPlus(_,g/2),O=M+h;hs(i,E,B,O,a.pointStyleWidth&&g);}else {let E=M+Math.max((p-f)/2,0),B=l.leftForLtr(_,g),O=fe(I.borderRadius);i.beginPath(),Object.values(O).some(U=>U!==0)?We(i,{x:B,y:E,w:g,h:f,radius:O}):i.rect(B,E,g,f),i.fill(),F!==0&&i.stroke();}i.restore();},T=function(_,M,I){He(i,I.text,_,M+x/2,c,{strikethrough:I.hidden,textAlign:l.textAlign(I.textAlign)});},k=this.isHorizontal(),w=this._computeTitleHeight();k?m={x:Pt(r,this.left+u,this.right-n[0]),y:this.top+u+w,line:0}:m={x:this.left+u,y:Pt(r,this.top+w+u,this.bottom-o[0].height),line:0},Ss(this.ctx,t.textDirection);let v=x+u;this.legendItems.forEach((_,M)=>{i.strokeStyle=_.fontColor||d,i.fillStyle=_.fontColor||d;let I=i.measureText(_.text).width,F=l.textAlign(_.textAlign||(_.textAlign=a.textAlign)),E=g+h+I,B=m.x,O=m.y;l.setWidth(this.width),k?M>0&&B+E+u>this.right&&(O=m.y+=v,m.line++,B=m.x=Pt(r,this.left+u,this.right-n[m.line])):M>0&&O+v>this.bottom&&(B=m.x=B+o[m.line].width+u,m.line++,O=m.y=Pt(r,this.top+w+u,this.bottom-o[m.line].height));let U=l.x(B);b(U,O,_),B=vd(F,B+g+h,k?B+E:this.right,t.rtl),T(l.x(B),O,_),k?m.x+=E+u:m.y+=v;}),Ts(this.ctx,t.textDirection);}drawTitle(){let t=this.options,o=t.title,n=it(o.font),i=pt(o.padding);if(!o.display)return;let r=Co(t.rtl,this.left,this.width),a=this.ctx,s=o.position,l=n.size/2,c=i.top+l,d,u=this.left,p=this.width;if(this.isHorizontal())p=Math.max(...this.lineWidths),d=this.top+c,u=Pt(t.align,u,this.right-p);else {let m=this.columnSizes.reduce((g,f)=>Math.max(g,f.height),0);d=c+Pt(t.align,this.top,this.bottom-m-t.labels.padding-this._computeTitleHeight());}let h=Pt(s,u,u+p);a.textAlign=r.textAlign(Wi(s)),a.textBaseline="middle",a.strokeStyle=o.color,a.fillStyle=o.color,a.font=n.string,He(a,o.text,h,d,n);}_computeTitleHeight(){let t=this.options.title,o=it(t.font),n=pt(t.padding);return t.display?o.lineHeight+n.height:0}_getLegendItemAt(t,o){let n,i,r;if(ge(t,this.left,this.right)&&ge(o,this.top,this.bottom)){for(r=this.legendHitBoxes,n=0;n<r.length;++n)if(i=r[n],ge(t,i.left,i.left+i.width)&&ge(o,i.top,i.top+i.height))return this.legendItems[n]}return null}handleEvent(t){let o=this.options;if(!j4(t.type,o))return;let n=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){let i=this._hoveredItem,r=G4(i,n);i&&!r&&X(o.onLeave,[t,i,this],this),this._hoveredItem=n,n&&!r&&X(o.onHover,[t,n,this],this);}else n&&X(o.onClick,[t,n,this],this);}};function j4(e,t){return !!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var ix={id:"legend",_element:Ds,start(e,t,o){let n=e.legend=new Ds({ctx:e.ctx,options:o,chart:e});ae.configure(e,n,o),ae.addBox(e,n);},stop(e){ae.removeBox(e,e.legend),delete e.legend;},beforeUpdate(e,t,o){let n=e.legend;ae.configure(e,n,o),n.options=o;},afterUpdate(e){let t=e.legend;t.buildLabels(),t.adjustHitBoxes();},afterEvent(e,t){t.replay||e.legend.handleEvent(t.event);},defaults:{display:true,position:"top",align:"center",fullSize:true,reverse:false,weight:1e3,onClick(e,t,o){let n=t.datasetIndex,i=o.chart;i.isDatasetVisible(n)?(i.hide(n),t.hidden=true):(i.show(n),t.hidden=false);},onHover:null,onLeave:null,labels:{color:e=>e.chart.options.color,boxWidth:40,padding:10,generateLabels(e){let t=e.data.datasets,{labels:{usePointStyle:o,pointStyle:n,textAlign:i,color:r}}=e.legend.options;return e._getSortedDatasetMetas().map(a=>{let s=a.controller.getStyle(o?0:void 0),l=pt(s.borderWidth);return {text:t[a.index].label,fillStyle:s.backgroundColor,fontColor:r,hidden:!a.visible,lineCap:s.borderCapStyle,lineDash:s.borderDash,lineDashOffset:s.borderDashOffset,lineJoin:s.borderJoinStyle,lineWidth:(l.width+l.height)/4,strokeStyle:s.borderColor,pointStyle:n||s.pointStyle,rotation:s.rotation,textAlign:i||s.textAlign,borderRadius:0,datasetIndex:a.index}},this)}},title:{color:e=>e.chart.options.color,display:false,position:"center",text:""}},descriptors:{_scriptable:e=>!e.startsWith("on"),labels:{_scriptable:e=>!["generateLabels","filter","sort"].includes(e)}}},Ns=class extends xt{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0;}update(t,o){let n=this.options;if(this.left=0,this.top=0,!n.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=o;let i=Z(n.text)?n.text.length:1;this._padding=pt(n.padding);let r=i*it(n.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=r:this.width=r;}isHorizontal(){let t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){let{top:o,left:n,bottom:i,right:r,options:a}=this,s=a.align,l=0,c,d,u;return this.isHorizontal()?(d=Pt(s,n,r),u=o+t,c=r-n):(a.position==="left"?(d=n+t,u=Pt(s,i,o),l=G*-0.5):(d=r-t,u=Pt(s,o,i),l=G*.5),c=i-o),{titleX:d,titleY:u,maxWidth:c,rotation:l}}draw(){let t=this.ctx,o=this.options;if(!o.display)return;let n=it(o.font),r=n.lineHeight/2+this._padding.top,{titleX:a,titleY:s,maxWidth:l,rotation:c}=this._drawArgs(r);He(t,o.text,0,0,n,{color:o.color,maxWidth:l,rotation:c,textAlign:Wi(o.align),textBaseline:"middle",translation:[a,s]});}};function Y4(e,t){let o=new Ns({ctx:e.ctx,options:t,chart:e});ae.configure(e,o,t),ae.addBox(e,o),e.titleBlock=o;}var rx={id:"title",_element:Ns,start(e,t,o){Y4(e,o);},stop(e){let t=e.titleBlock;ae.removeBox(e,t),delete e.titleBlock;},beforeUpdate(e,t,o){let n=e.titleBlock;ae.configure(e,n,o),n.options=o;},defaults:{align:"center",display:false,font:{weight:"bold"},fullSize:true,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:true,_indexable:false}};var or={average(e){if(!e.length)return false;let t,o,n=0,i=0,r=0;for(t=0,o=e.length;t<o;++t){let a=e[t].element;if(a&&a.hasValue()){let s=a.tooltipPosition();n+=s.x,i+=s.y,++r;}}return {x:n/r,y:i/r}},nearest(e,t){if(!e.length)return false;let o=t.x,n=t.y,i=Number.POSITIVE_INFINITY,r,a,s;for(r=0,a=e.length;r<a;++r){let l=e[r].element;if(l&&l.hasValue()){let c=l.getCenterPoint(),d=Ve(t,c);d<i&&(i=d,s=l);}}if(s){let l=s.tooltipPosition();o=l.x,n=l.y;}return {x:o,y:n}}};function Ie(e,t){return t&&(Z(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function Ye(e){return (typeof e=="string"||e instanceof String)&&e.indexOf(`
1016
- `)>-1?e.split(`
1017
- `):e}function Z4(e,t){let{element:o,datasetIndex:n,index:i}=t,r=e.getDatasetMeta(n).controller,{label:a,value:s}=r.getLabelAndValue(i);return {chart:e,label:a,parsed:r.getParsed(i),raw:e.data.datasets[n].data[i],formattedValue:s,dataset:r.getDataset(),dataIndex:i,datasetIndex:n,element:o}}function A0(e,t){let o=e.chart.ctx,{body:n,footer:i,title:r}=e,{boxWidth:a,boxHeight:s}=t,l=it(t.bodyFont),c=it(t.titleFont),d=it(t.footerFont),u=r.length,p=i.length,h=n.length,m=pt(t.padding),g=m.height,f=0,x=n.reduce((k,w)=>k+w.before.length+w.lines.length+w.after.length,0);if(x+=e.beforeBody.length+e.afterBody.length,u&&(g+=u*c.lineHeight+(u-1)*t.titleSpacing+t.titleMarginBottom),x){let k=t.displayColors?Math.max(s,l.lineHeight):l.lineHeight;g+=h*k+(x-h)*l.lineHeight+(x-1)*t.bodySpacing;}p&&(g+=t.footerMarginTop+p*d.lineHeight+(p-1)*t.footerSpacing);let b=0,T=function(k){f=Math.max(f,o.measureText(k).width+b);};return o.save(),o.font=c.string,K(e.title,T),o.font=l.string,K(e.beforeBody.concat(e.afterBody),T),b=t.displayColors?a+2+t.boxPadding:0,K(n,k=>{K(k.before,T),K(k.lines,T),K(k.after,T);}),b=0,o.font=d.string,K(e.footer,T),o.restore(),f+=m.width,{width:f,height:g}}function X4(e,t){let{y:o,height:n}=t;return o<n/2?"top":o>e.height-n/2?"bottom":"center"}function K4(e,t,o,n){let{x:i,width:r}=n,a=o.caretSize+o.caretPadding;if(e==="left"&&i+r+a>t.width||e==="right"&&i-r-a<0)return true}function q4(e,t,o,n){let{x:i,width:r}=o,{width:a,chartArea:{left:s,right:l}}=e,c="center";return n==="center"?c=i<=(s+l)/2?"left":"right":i<=r/2?c="left":i>=a-r/2&&(c="right"),K4(c,e,t,o)&&(c="center"),c}function M0(e,t,o){let n=o.yAlign||t.yAlign||X4(e,o);return {xAlign:o.xAlign||t.xAlign||q4(e,t,o,n),yAlign:n}}function Q4(e,t){let{x:o,width:n}=e;return t==="right"?o-=n:t==="center"&&(o-=n/2),o}function J4(e,t,o){let{y:n,height:i}=e;return t==="top"?n+=o:t==="bottom"?n-=i+o:n-=i/2,n}function I0(e,t,o,n){let{caretSize:i,caretPadding:r,cornerRadius:a}=e,{xAlign:s,yAlign:l}=o,c=i+r,{topLeft:d,topRight:u,bottomLeft:p,bottomRight:h}=fe(a),m=Q4(t,s),g=J4(t,l,c);return l==="center"?s==="left"?m+=c:s==="right"&&(m-=c):s==="left"?m-=Math.max(d,p)+i:s==="right"&&(m+=Math.max(u,h)+i),{x:Ct(m,0,n.width-t.width),y:Ct(g,0,n.height-t.height)}}function Ms(e,t,o){let n=pt(o.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-n.right:e.x+n.left}function E0(e){return Ie([],Ye(e))}function t8(e,t,o){return Me(e,{tooltip:t,tooltipItems:o,type:"tooltip"})}function F0(e,t){let o=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return o?e.override(o):e}var ar=class extends xt{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart||t._chart,this._chart=this.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0;}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0;}_resolveAnimations(){let t=this._cachedAnimations;if(t)return t;let o=this.chart,n=this.options.setContext(this.getContext()),i=n.enabled&&o.options.animation&&n.animations,r=new Wn(this.chart,i);return i._cacheable&&(this._cachedAnimations=Object.freeze(r)),r}getContext(){return this.$context||(this.$context=t8(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,o){let{callbacks:n}=o,i=n.beforeTitle.apply(this,[t]),r=n.title.apply(this,[t]),a=n.afterTitle.apply(this,[t]),s=[];return s=Ie(s,Ye(i)),s=Ie(s,Ye(r)),s=Ie(s,Ye(a)),s}getBeforeBody(t,o){return E0(o.callbacks.beforeBody.apply(this,[t]))}getBody(t,o){let{callbacks:n}=o,i=[];return K(t,r=>{let a={before:[],lines:[],after:[]},s=F0(n,r);Ie(a.before,Ye(s.beforeLabel.call(this,r))),Ie(a.lines,s.label.call(this,r)),Ie(a.after,Ye(s.afterLabel.call(this,r))),i.push(a);}),i}getAfterBody(t,o){return E0(o.callbacks.afterBody.apply(this,[t]))}getFooter(t,o){let{callbacks:n}=o,i=n.beforeFooter.apply(this,[t]),r=n.footer.apply(this,[t]),a=n.afterFooter.apply(this,[t]),s=[];return s=Ie(s,Ye(i)),s=Ie(s,Ye(r)),s=Ie(s,Ye(a)),s}_createItems(t){let o=this._active,n=this.chart.data,i=[],r=[],a=[],s=[],l,c;for(l=0,c=o.length;l<c;++l)s.push(Z4(this.chart,o[l]));return t.filter&&(s=s.filter((d,u,p)=>t.filter(d,u,p,n))),t.itemSort&&(s=s.sort((d,u)=>t.itemSort(d,u,n))),K(s,d=>{let u=F0(t.callbacks,d);i.push(u.labelColor.call(this,d)),r.push(u.labelPointStyle.call(this,d)),a.push(u.labelTextColor.call(this,d));}),this.labelColors=i,this.labelPointStyles=r,this.labelTextColors=a,this.dataPoints=s,s}update(t,o){let n=this.options.setContext(this.getContext()),i=this._active,r,a=[];if(!i.length)this.opacity!==0&&(r={opacity:0});else {let s=or[n.position].call(this,i,this._eventPosition);a=this._createItems(n),this.title=this.getTitle(a,n),this.beforeBody=this.getBeforeBody(a,n),this.body=this.getBody(a,n),this.afterBody=this.getAfterBody(a,n),this.footer=this.getFooter(a,n);let l=this._size=A0(this,n),c=Object.assign({},s,l),d=M0(this.chart,n,c),u=I0(n,c,d,this.chart);this.xAlign=d.xAlign,this.yAlign=d.yAlign,r={opacity:1,x:u.x,y:u.y,width:l.width,height:l.height,caretX:s.x,caretY:s.y};}this._tooltipItems=a,this.$context=void 0,r&&this._resolveAnimations().update(this,r),t&&n.external&&n.external.call(this,{chart:this.chart,tooltip:this,replay:o});}drawCaret(t,o,n,i){let r=this.getCaretPosition(t,n,i);o.lineTo(r.x1,r.y1),o.lineTo(r.x2,r.y2),o.lineTo(r.x3,r.y3);}getCaretPosition(t,o,n){let{xAlign:i,yAlign:r}=this,{caretSize:a,cornerRadius:s}=n,{topLeft:l,topRight:c,bottomLeft:d,bottomRight:u}=fe(s),{x:p,y:h}=t,{width:m,height:g}=o,f,x,b,T,k,w;return r==="center"?(k=h+g/2,i==="left"?(f=p,x=f-a,T=k+a,w=k-a):(f=p+m,x=f+a,T=k-a,w=k+a),b=f):(i==="left"?x=p+Math.max(l,d)+a:i==="right"?x=p+m-Math.max(c,u)-a:x=this.caretX,r==="top"?(T=h,k=T-a,f=x-a,b=x+a):(T=h+g,k=T+a,f=x+a,b=x-a),w=T),{x1:f,x2:x,x3:b,y1:T,y2:k,y3:w}}drawTitle(t,o,n){let i=this.title,r=i.length,a,s,l;if(r){let c=Co(n.rtl,this.x,this.width);for(t.x=Ms(this,n.titleAlign,n),o.textAlign=c.textAlign(n.titleAlign),o.textBaseline="middle",a=it(n.titleFont),s=n.titleSpacing,o.fillStyle=n.titleColor,o.font=a.string,l=0;l<r;++l)o.fillText(i[l],c.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+s,l+1===r&&(t.y+=n.titleMarginBottom-s);}}_drawColorBox(t,o,n,i,r){let a=this.labelColors[n],s=this.labelPointStyles[n],{boxHeight:l,boxWidth:c,boxPadding:d}=r,u=it(r.bodyFont),p=Ms(this,"left",r),h=i.x(p),m=l<u.lineHeight?(u.lineHeight-l)/2:0,g=o.y+m;if(r.usePointStyle){let f={radius:Math.min(c,l)/2,pointStyle:s.pointStyle,rotation:s.rotation,borderWidth:1},x=i.leftForLtr(h,c)+c/2,b=g+l/2;t.strokeStyle=r.multiKeyBackground,t.fillStyle=r.multiKeyBackground,ji(t,f,x,b),t.strokeStyle=a.borderColor,t.fillStyle=a.backgroundColor,ji(t,f,x,b);}else {t.lineWidth=z(a.borderWidth)?Math.max(...Object.values(a.borderWidth)):a.borderWidth||1,t.strokeStyle=a.borderColor,t.setLineDash(a.borderDash||[]),t.lineDashOffset=a.borderDashOffset||0;let f=i.leftForLtr(h,c-d),x=i.leftForLtr(i.xPlus(h,1),c-d-2),b=fe(a.borderRadius);Object.values(b).some(T=>T!==0)?(t.beginPath(),t.fillStyle=r.multiKeyBackground,We(t,{x:f,y:g,w:c,h:l,radius:b}),t.fill(),t.stroke(),t.fillStyle=a.backgroundColor,t.beginPath(),We(t,{x,y:g+1,w:c-2,h:l-2,radius:b}),t.fill()):(t.fillStyle=r.multiKeyBackground,t.fillRect(f,g,c,l),t.strokeRect(f,g,c,l),t.fillStyle=a.backgroundColor,t.fillRect(x,g+1,c-2,l-2));}t.fillStyle=this.labelTextColors[n];}drawBody(t,o,n){let{body:i}=this,{bodySpacing:r,bodyAlign:a,displayColors:s,boxHeight:l,boxWidth:c,boxPadding:d}=n,u=it(n.bodyFont),p=u.lineHeight,h=0,m=Co(n.rtl,this.x,this.width),g=function(M){o.fillText(M,m.x(t.x+h),t.y+p/2),t.y+=p+r;},f=m.textAlign(a),x,b,T,k,w,v,_;for(o.textAlign=a,o.textBaseline="middle",o.font=u.string,t.x=Ms(this,f,n),o.fillStyle=n.bodyColor,K(this.beforeBody,g),h=s&&f!=="right"?a==="center"?c/2+d:c+2+d:0,k=0,v=i.length;k<v;++k){for(x=i[k],b=this.labelTextColors[k],o.fillStyle=b,K(x.before,g),T=x.lines,s&&T.length&&(this._drawColorBox(o,t,k,m,n),p=Math.max(u.lineHeight,l)),w=0,_=T.length;w<_;++w)g(T[w]),p=u.lineHeight;K(x.after,g);}h=0,p=u.lineHeight,K(this.afterBody,g),t.y-=r;}drawFooter(t,o,n){let i=this.footer,r=i.length,a,s;if(r){let l=Co(n.rtl,this.x,this.width);for(t.x=Ms(this,n.footerAlign,n),t.y+=n.footerMarginTop,o.textAlign=l.textAlign(n.footerAlign),o.textBaseline="middle",a=it(n.footerFont),o.fillStyle=n.footerColor,o.font=a.string,s=0;s<r;++s)o.fillText(i[s],l.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+n.footerSpacing;}}drawBackground(t,o,n,i){let{xAlign:r,yAlign:a}=this,{x:s,y:l}=t,{width:c,height:d}=n,{topLeft:u,topRight:p,bottomLeft:h,bottomRight:m}=fe(i.cornerRadius);o.fillStyle=i.backgroundColor,o.strokeStyle=i.borderColor,o.lineWidth=i.borderWidth,o.beginPath(),o.moveTo(s+u,l),a==="top"&&this.drawCaret(t,o,n,i),o.lineTo(s+c-p,l),o.quadraticCurveTo(s+c,l,s+c,l+p),a==="center"&&r==="right"&&this.drawCaret(t,o,n,i),o.lineTo(s+c,l+d-m),o.quadraticCurveTo(s+c,l+d,s+c-m,l+d),a==="bottom"&&this.drawCaret(t,o,n,i),o.lineTo(s+h,l+d),o.quadraticCurveTo(s,l+d,s,l+d-h),a==="center"&&r==="left"&&this.drawCaret(t,o,n,i),o.lineTo(s,l+u),o.quadraticCurveTo(s,l,s+u,l),o.closePath(),o.fill(),i.borderWidth>0&&o.stroke();}_updateAnimationTarget(t){let o=this.chart,n=this.$animations,i=n&&n.x,r=n&&n.y;if(i||r){let a=or[t.position].call(this,this._active,this._eventPosition);if(!a)return;let s=this._size=A0(this,t),l=Object.assign({},a,this._size),c=M0(o,t,l),d=I0(t,l,c,o);(i._to!==d.x||r._to!==d.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=s.width,this.height=s.height,this.caretX=a.x,this.caretY=a.y,this._resolveAnimations().update(this,d));}}_willRender(){return !!this.opacity}draw(t){let o=this.options.setContext(this.getContext()),n=this.opacity;if(!n)return;this._updateAnimationTarget(o);let i={width:this.width,height:this.height},r={x:this.x,y:this.y};n=Math.abs(n)<.001?0:n;let a=pt(o.padding),s=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;o.enabled&&s&&(t.save(),t.globalAlpha=n,this.drawBackground(r,t,i,o),Ss(t,o.textDirection),r.y+=a.top,this.drawTitle(r,t,o),this.drawBody(r,t,o),this.drawFooter(r,t,o),Ts(t,o.textDirection),t.restore());}getActiveElements(){return this._active||[]}setActiveElements(t,o){let n=this._active,i=t.map(({datasetIndex:s,index:l})=>{let c=this.chart.getDatasetMeta(s);if(!c)throw new Error("Cannot find a dataset at index "+s);return {datasetIndex:s,element:c.data[l],index:l}}),r=!Vn(n,i),a=this._positionChanged(i,o);(r||a)&&(this._active=i,this._eventPosition=o,this._ignoreReplayEvents=true,this.update(true));}handleEvent(t,o,n=true){if(o&&this._ignoreReplayEvents)return false;this._ignoreReplayEvents=false;let i=this.options,r=this._active||[],a=this._getActiveElements(t,r,o,n),s=this._positionChanged(a,t),l=o||!Vn(a,r)||s;return l&&(this._active=a,(i.enabled||i.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(true,o))),l}_getActiveElements(t,o,n,i){let r=this.options;if(t.type==="mouseout")return [];if(!i)return o;let a=this.chart.getElementsAtEventForMode(t,r.mode,r,n);return r.reverse&&a.reverse(),a}_positionChanged(t,o){let{caretX:n,caretY:i,options:r}=this,a=or[r.position].call(this,t,o);return a!==false&&(n!==a.x||i!==a.y)}};ar.positioners=or;var ax={id:"tooltip",_element:ar,positioners:or,afterInit(e,t,o){o&&(e.tooltip=new ar({chart:e,options:o}));},beforeUpdate(e,t,o){e.tooltip&&e.tooltip.initialize(o);},reset(e,t,o){e.tooltip&&e.tooltip.initialize(o);},afterDraw(e){let t=e.tooltip;if(t&&t._willRender()){let o={tooltip:t};if(e.notifyPlugins("beforeTooltipDraw",o)===false)return;t.draw(e.ctx),e.notifyPlugins("afterTooltipDraw",o);}},afterEvent(e,t){if(e.tooltip){let o=t.replay;e.tooltip.handleEvent(t.event,o,t.inChartArea)&&(t.changed=true);}},defaults:{enabled:true,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(e,t)=>t.bodyFont.size,boxWidth:(e,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:true,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:{beforeTitle:he,title(e){if(e.length>0){let t=e[0],o=t.chart.data.labels,n=o?o.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(n>0&&t.dataIndex<n)return o[t.dataIndex]}return ""},afterTitle:he,beforeBody:he,beforeLabel:he,label(e){if(this&&this.options&&this.options.mode==="dataset")return e.label+": "+e.formattedValue||e.formattedValue;let t=e.dataset.label||"";t&&(t+=": ");let o=e.formattedValue;return W(o)||(t+=o),t},labelColor(e){let o=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return {borderColor:o.borderColor,backgroundColor:o.backgroundColor,borderWidth:o.borderWidth,borderDash:o.borderDash,borderDashOffset:o.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(e){let o=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return {pointStyle:o.pointStyle,rotation:o.rotation}},afterLabel:he,afterBody:he,beforeFooter:he,footer:he,afterFooter:he}},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:e=>e!=="filter"&&e!=="itemSort"&&e!=="external",_indexable:false,callbacks:{_scriptable:false,_indexable:false},animation:{_fallback:false},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};var e8=(e,t,o,n)=>(typeof t=="string"?(o=e.push(t)-1,n.unshift({index:o,label:t})):isNaN(t)&&(o=null),o);function o8(e,t,o,n){let i=e.indexOf(t);if(i===-1)return e8(e,t,o,n);let r=e.lastIndexOf(t);return i!==r?o:i}var n8=(e,t)=>e===null?null:Ct(Math.round(e),0,t),an=class extends rn{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[];}init(t){let o=this._addedLabels;if(o.length){let n=this.getLabels();for(let{index:i,label:r}of o)n[i]===r&&n.splice(i,1);this._addedLabels=[];}super.init(t);}parse(t,o){if(W(t))return null;let n=this.getLabels();return o=isFinite(o)&&n[o]===t?o:o8(n,t,N(o,t),this._addedLabels),n8(o,n.length-1)}determineDataLimits(){let{minDefined:t,maxDefined:o}=this.getUserBounds(),{min:n,max:i}=this.getMinMax(true);this.options.bounds==="ticks"&&(t||(n=0),o||(i=this.getLabels().length-1)),this.min=n,this.max=i;}buildTicks(){let t=this.min,o=this.max,n=this.options.offset,i=[],r=this.getLabels();r=t===0&&o===r.length-1?r:r.slice(t,o+1),this._valueRange=Math.max(r.length-(n?0:1),1),this._startValue=this.min-(n?.5:0);for(let a=t;a<=o;a++)i.push({value:a});return i}getLabelForValue(t){let o=this.getLabels();return t>=0&&t<o.length?o[t]:t}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels);}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){let o=this.ticks;return t<0||t>o.length-1?null:this.getPixelForValue(o[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}};an.id="category";an.defaults={ticks:{callback:an.prototype.getLabelForValue}};function i8(e,t){let o=[],{bounds:i,step:r,min:a,max:s,precision:l,count:c,maxTicks:d,maxDigits:u,includeBounds:p}=e,h=r||1,m=d-1,{min:g,max:f}=t,x=!W(a),b=!W(s),T=!W(c),k=(f-g)/(u+1),w=os((f-g)/m/h)*h,v,_,M,I;if(w<1e-14&&!x&&!b)return [{value:g},{value:f}];I=Math.ceil(f/w)-Math.floor(g/w),I>m&&(w=os(I*w/m/h)*h),W(l)||(v=Math.pow(10,l),w=Math.ceil(w*v)/v),i==="ticks"?(_=Math.floor(g/w)*w,M=Math.ceil(f/w)*w):(_=g,M=f),x&&b&&r&&Cd((s-a)/r,w/1e3)?(I=Math.round(Math.min((s-a)/w,d)),w=(s-a)/I,_=a,M=s):T?(_=x?a:_,M=b?s:M,I=c-1,w=(M-_)/I):(I=(M-_)/w,qo(I,Math.round(I),w/1e3)?I=Math.round(I):I=Math.ceil(I));let F=Math.max(is(w),is(_));v=Math.pow(10,W(l)?F:l),_=Math.round(_*v)/v,M=Math.round(M*v)/v;let E=0;for(x&&(p&&_!==a?(o.push({value:a}),_<a&&E++,qo(Math.round((_+E*w)*v)/v,a,L0(a,k,e))&&E++):_<a&&E++);E<I;++E)o.push({value:Math.round((_+E*w)*v)/v});return b&&p&&M!==s?o.length&&qo(o[o.length-1].value,s,L0(s,k,e))?o[o.length-1].value=s:o.push({value:s}):(!b||M===s)&&o.push({value:M}),o}function L0(e,t,{horizontal:o,minRotation:n}){let i=gt(n),r=(o?Math.sin(i):Math.cos(i))||.001,a=.75*t*(""+e).length;return Math.min(t/r,a)}var Kn=class extends rn{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0;}parse(t,o){return W(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){let{beginAtZero:t}=this.options,{minDefined:o,maxDefined:n}=this.getUserBounds(),{min:i,max:r}=this,a=l=>i=o?i:l,s=l=>r=n?r:l;if(t){let l=re(i),c=re(r);l<0&&c<0?s(0):l>0&&c>0&&a(0);}if(i===r){let l=1;(r>=Number.MAX_SAFE_INTEGER||i<=Number.MIN_SAFE_INTEGER)&&(l=Math.abs(r*.05)),s(r+l),t||a(i-l);}this.min=i,this.max=r;}getTickLimit(){let t=this.options.ticks,{maxTicksLimit:o,stepSize:n}=t,i;return n?(i=Math.ceil(this.max/n)-Math.floor(this.min/n)+1,i>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${n} would result generating up to ${i} ticks. Limiting to 1000.`),i=1e3)):(i=this.computeTickLimit(),o=o||11),o&&(i=Math.min(o,i)),i}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){let t=this.options,o=t.ticks,n=this.getTickLimit();n=Math.max(2,n);let i={maxTicks:n,bounds:t.bounds,min:t.min,max:t.max,precision:o.precision,step:o.stepSize,count:o.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:o.minRotation||0,includeBounds:o.includeBounds!==false},r=this._range||this,a=i8(i,r);return t.bounds==="ticks"&&ns(a,this,"value"),t.reverse?(a.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),a}configure(){let t=this.ticks,o=this.min,n=this.max;if(super.configure(),this.options.offset&&t.length){let i=(n-o)/Math.max(t.length-1,1)/2;o-=i,n+=i;}this._startValue=o,this._endValue=n,this._valueRange=n-o;}getLabelForValue(t){return en(t,this.chart.options.locale,this.options.ticks.format)}},qn=class extends Kn{determineDataLimits(){let{min:t,max:o}=this.getMinMax(true);this.min=lt(t)?t:0,this.max=lt(o)?o:1,this.handleTickRangeOptions();}computeTickLimit(){let t=this.isHorizontal(),o=t?this.width:this.height,n=gt(this.options.ticks.minRotation),i=(t?Math.sin(n):Math.cos(n))||.001,r=this._resolveTickFontOptions(0);return Math.ceil(o/Math.min(40,r.lineHeight/i))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}};qn.id="linear";qn.defaults={ticks:{callback:zs.formatters.numeric}};function B0(e){return e/Math.pow(10,Math.floor(zt(e)))===1}function r8(e,t){let o=Math.floor(zt(t.max)),n=Math.ceil(t.max/Math.pow(10,o)),i=[],r=Ot(e.min,Math.pow(10,Math.floor(zt(t.min)))),a=Math.floor(zt(r)),s=Math.floor(r/Math.pow(10,a)),l=a<0?Math.pow(10,Math.abs(a)):1;do i.push({value:r,major:B0(r)}),++s,s===10&&(s=1,++a,l=a>=0?1:l),r=Math.round(s*Math.pow(10,a)*l)/l;while(a<o||a===o&&s<n);let c=Ot(e.max,r);return i.push({value:c,major:B0(r)}),i}var Us=class extends rn{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0;}parse(t,o){let n=Kn.prototype.parse.apply(this,[t,o]);if(n===0){this._zero=true;return}return lt(n)&&n>0?n:null}determineDataLimits(){let{min:t,max:o}=this.getMinMax(true);this.min=lt(t)?Math.max(0,t):null,this.max=lt(o)?Math.max(0,o):null,this.options.beginAtZero&&(this._zero=true),this.handleTickRangeOptions();}handleTickRangeOptions(){let{minDefined:t,maxDefined:o}=this.getUserBounds(),n=this.min,i=this.max,r=l=>n=t?n:l,a=l=>i=o?i:l,s=(l,c)=>Math.pow(10,Math.floor(zt(l))+c);n===i&&(n<=0?(r(1),a(10)):(r(s(n,-1)),a(s(i,1)))),n<=0&&r(s(i,-1)),i<=0&&a(s(n,1)),this._zero&&this.min!==this._suggestedMin&&n===s(this.min,0)&&r(s(n,-1)),this.min=n,this.max=i;}buildTicks(){let t=this.options,o={min:this._userMin,max:this._userMax},n=r8(o,this);return t.bounds==="ticks"&&ns(n,this,"value"),t.reverse?(n.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),n}getLabelForValue(t){return t===void 0?"0":en(t,this.chart.options.locale,this.options.ticks.format)}configure(){let t=this.min;super.configure(),this._startValue=zt(t),this._valueRange=zt(this.max)-zt(t);}getPixelForValue(t){return (t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(zt(t)-this._startValue)/this._valueRange)}getValueForPixel(t){let o=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+o*this._valueRange)}};Us.id="logarithmic";Us.defaults={ticks:{callback:zs.formatters.logarithmic,major:{enabled:true}}};function du(e){let t=e.ticks;if(t.display&&e.display){let o=pt(t.backdropPadding);return N(t.font&&t.font.size,H.font.size)+o.height}return 0}function a8(e,t,o){return o=Z(o)?o:[o],{w:Ed(e,t.string,o),h:o.length*t.lineHeight}}function R0(e,t,o,n,i){return e===n||e===i?{start:t-o/2,end:t+o/2}:e<n||e>i?{start:t-o,end:t}:{start:t,end:t+o}}function s8(e){let t={l:e.left+e._padding.left,r:e.right-e._padding.right,t:e.top+e._padding.top,b:e.bottom-e._padding.bottom},o=Object.assign({},t),n=[],i=[],r=e._pointLabels.length,a=e.options.pointLabels,s=a.centerPointLabels?G/r:0;for(let l=0;l<r;l++){let c=a.setContext(e.getPointLabelContext(l));i[l]=c.padding;let d=e.getPointPosition(l,e.drawingArea+i[l],s),u=it(c.font),p=a8(e.ctx,u,e._pointLabels[l]);n[l]=p;let h=Ft(e.getIndexAngle(l)+s),m=Math.round(Qo(h)),g=R0(m,d.x,p.w,0,180),f=R0(m,d.y,p.h,90,270);l8(o,t,h,g,f);}e.setCenterPoint(t.l-o.l,o.r-t.r,t.t-o.t,o.b-t.b),e._pointLabelItems=c8(e,n,i);}function l8(e,t,o,n,i){let r=Math.abs(Math.sin(o)),a=Math.abs(Math.cos(o)),s=0,l=0;n.start<t.l?(s=(t.l-n.start)/r,e.l=Math.min(e.l,t.l-s)):n.end>t.r&&(s=(n.end-t.r)/r,e.r=Math.max(e.r,t.r+s)),i.start<t.t?(l=(t.t-i.start)/a,e.t=Math.min(e.t,t.t-l)):i.end>t.b&&(l=(i.end-t.b)/a,e.b=Math.max(e.b,t.b+l));}function c8(e,t,o){let n=[],i=e._pointLabels.length,r=e.options,a=du(r)/2,s=e.drawingArea,l=r.pointLabels.centerPointLabels?G/i:0;for(let c=0;c<i;c++){let d=e.getPointPosition(c,s+a+o[c],l),u=Math.round(Qo(Ft(d.angle+et))),p=t[c],h=p8(d.y,p.h,u),m=d8(u),g=u8(d.x,p.w,m);n.push({x:d.x,y:h,textAlign:m,left:g,top:h,right:g+p.w,bottom:h+p.h});}return n}function d8(e){return e===0||e===180?"center":e<180?"left":"right"}function u8(e,t,o){return o==="right"?e-=t:o==="center"&&(e-=t/2),e}function p8(e,t,o){return o===90||o===270?e-=t/2:(o>270||o<90)&&(e-=t),e}function m8(e,t){let{ctx:o,options:{pointLabels:n}}=e;for(let i=t-1;i>=0;i--){let r=n.setContext(e.getPointLabelContext(i)),a=it(r.font),{x:s,y:l,textAlign:c,left:d,top:u,right:p,bottom:h}=e._pointLabelItems[i],{backdropColor:m}=r;if(!W(m)){let g=fe(r.borderRadius),f=pt(r.backdropPadding);o.fillStyle=m;let x=d-f.left,b=u-f.top,T=p-d+f.width,k=h-u+f.height;Object.values(g).some(w=>w!==0)?(o.beginPath(),We(o,{x,y:b,w:T,h:k,radius:g}),o.fill()):o.fillRect(x,b,T,k);}He(o,e._pointLabels[i],s,l+a.lineHeight/2,a,{color:r.color,textAlign:c,textBaseline:"middle"});}}function sx(e,t,o,n){let{ctx:i}=e;if(o)i.arc(e.xCenter,e.yCenter,t,0,Q);else {let r=e.getPointPosition(0,t);i.moveTo(r.x,r.y);for(let a=1;a<n;a++)r=e.getPointPosition(a,t),i.lineTo(r.x,r.y);}}function h8(e,t,o,n){let i=e.ctx,r=t.circular,{color:a,lineWidth:s}=t;!r&&!n||!a||!s||o<0||(i.save(),i.strokeStyle=a,i.lineWidth=s,i.setLineDash(t.borderDash),i.lineDashOffset=t.borderDashOffset,i.beginPath(),sx(e,o,r,n),i.closePath(),i.stroke(),i.restore());}function g8(e,t,o){return Me(e,{label:o,index:t,type:"pointLabel"})}var Qn=class extends Kn{constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[];}setDimensions(){let t=this._padding=pt(du(this.options)/2),o=this.width=this.maxWidth-t.width,n=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+o/2+t.left),this.yCenter=Math.floor(this.top+n/2+t.top),this.drawingArea=Math.floor(Math.min(o,n)/2);}determineDataLimits(){let{min:t,max:o}=this.getMinMax(false);this.min=lt(t)&&!isNaN(t)?t:0,this.max=lt(o)&&!isNaN(o)?o:0,this.handleTickRangeOptions();}computeTickLimit(){return Math.ceil(this.drawingArea/du(this.options))}generateTickLabels(t){Kn.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((o,n)=>{let i=X(this.options.pointLabels.callback,[o,n],this);return i||i===0?i:""}).filter((o,n)=>this.chart.getDataVisibility(n));}fit(){let t=this.options;t.display&&t.pointLabels.display?s8(this):this.setCenterPoint(0,0,0,0);}setCenterPoint(t,o,n,i){this.xCenter+=Math.floor((t-o)/2),this.yCenter+=Math.floor((n-i)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,o,n,i));}getIndexAngle(t){let o=Q/(this._pointLabels.length||1),n=this.options.startAngle||0;return Ft(t*o+gt(n))}getDistanceFromCenterForValue(t){if(W(t))return NaN;let o=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*o:(t-this.min)*o}getValueForDistanceFromCenter(t){if(W(t))return NaN;let o=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-o:this.min+o}getPointLabelContext(t){let o=this._pointLabels||[];if(t>=0&&t<o.length){let n=o[t];return g8(this.getContext(),t,n)}}getPointPosition(t,o,n=0){let i=this.getIndexAngle(t)-et+n;return {x:Math.cos(i)*o+this.xCenter,y:Math.sin(i)*o+this.yCenter,angle:i}}getPointPositionForValue(t,o){return this.getPointPosition(t,this.getDistanceFromCenterForValue(o))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){let{left:o,top:n,right:i,bottom:r}=this._pointLabelItems[t];return {left:o,top:n,right:i,bottom:r}}drawBackground(){let{backgroundColor:t,grid:{circular:o}}=this.options;if(t){let n=this.ctx;n.save(),n.beginPath(),sx(this,this.getDistanceFromCenterForValue(this._endValue),o,this._pointLabels.length),n.closePath(),n.fillStyle=t,n.fill(),n.restore();}}drawGrid(){let t=this.ctx,o=this.options,{angleLines:n,grid:i}=o,r=this._pointLabels.length,a,s,l;if(o.pointLabels.display&&m8(this,r),i.display&&this.ticks.forEach((c,d)=>{if(d!==0){s=this.getDistanceFromCenterForValue(c.value);let u=i.setContext(this.getContext(d-1));h8(this,u,s,r);}}),n.display){for(t.save(),a=r-1;a>=0;a--){let c=n.setContext(this.getPointLabelContext(a)),{color:d,lineWidth:u}=c;!u||!d||(t.lineWidth=u,t.strokeStyle=d,t.setLineDash(c.borderDash),t.lineDashOffset=c.borderDashOffset,s=this.getDistanceFromCenterForValue(o.ticks.reverse?this.min:this.max),l=this.getPointPosition(a,s),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(l.x,l.y),t.stroke());}t.restore();}}drawBorder(){}drawLabels(){let t=this.ctx,o=this.options,n=o.ticks;if(!n.display)return;let i=this.getIndexAngle(0),r,a;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(i),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((s,l)=>{if(l===0&&!o.reverse)return;let c=n.setContext(this.getContext(l)),d=it(c.font);if(r=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=d.string,a=t.measureText(s.label).width,t.fillStyle=c.backdropColor;let u=pt(c.backdropPadding);t.fillRect(-a/2-u.left,-r-d.size/2-u.top,a+u.width,d.size+u.height);}He(t,s.label,0,-r,d,{color:c.color});}),t.restore();}drawTitle(){}};Qn.id="radialLinear";Qn.defaults={display:true,animate:true,position:"chartArea",angleLines:{display:true,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:false},startAngle:0,ticks:{showLabelBackdrop:true,callback:zs.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:true,font:{size:10},callback(e){return e},padding:5,centerPointLabels:false}};Qn.defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};Qn.descriptors={angleLines:{_fallback:"grid"}};var Vs={millisecond:{common:true,size:1,steps:1e3},second:{common:true,size:1e3,steps:60},minute:{common:true,size:6e4,steps:60},hour:{common:true,size:36e5,steps:24},day:{common:true,size:864e5,steps:30},week:{common:false,size:6048e5,steps:4},month:{common:true,size:2628e6,steps:12},quarter:{common:false,size:7884e6,steps:4},year:{common:true,size:3154e7}},Vt=Object.keys(Vs);function f8(e,t){return e-t}function D0(e,t){if(W(t))return null;let o=e._adapter,{parser:n,round:i,isoWeekday:r}=e._parseOpts,a=t;return typeof n=="function"&&(a=n(a)),lt(a)||(a=typeof n=="string"?o.parse(a,n):o.parse(a)),a===null?null:(i&&(a=i==="week"&&(Kt(r)||r===true)?o.startOf(a,"isoWeek",r):o.startOf(a,i)),+a)}function N0(e,t,o,n){let i=Vt.length;for(let r=Vt.indexOf(e);r<i-1;++r){let a=Vs[Vt[r]],s=a.steps?a.steps:Number.MAX_SAFE_INTEGER;if(a.common&&Math.ceil((o-t)/(s*a.size))<=n)return Vt[r]}return Vt[i-1]}function y8(e,t,o,n,i){for(let r=Vt.length-1;r>=Vt.indexOf(o);r--){let a=Vt[r];if(Vs[a].common&&e._adapter.diff(i,n,a)>=t-1)return a}return Vt[o?Vt.indexOf(o):0]}function x8(e){for(let t=Vt.indexOf(e)+1,o=Vt.length;t<o;++t)if(Vs[Vt[t]].common)return Vt[t]}function U0(e,t,o){if(!o)e[t]=true;else if(o.length){let{lo:n,hi:i}=Hi(o,t),r=o[n]>=t?o[n]:o[i];e[r]=true;}}function b8(e,t,o,n){let i=e._adapter,r=+i.startOf(t[0].value,n),a=t[t.length-1].value,s,l;for(s=r;s<=a;s=+i.add(s,1,n))l=o[s],l>=0&&(t[l].major=true);return t}function O0(e,t,o){let n=[],i={},r=t.length,a,s;for(a=0;a<r;++a)s=t[a],i[s]=a,n.push({value:s,major:false});return r===0||!o?n:b8(e,n,i,o)}var Jn=class extends rn{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=false,this._parseOpts=void 0;}init(t,o){let n=t.time||(t.time={}),i=this._adapter=new C_._date(t.adapters.date);i.init(o),Ko(n.displayFormats,i.formats()),this._parseOpts={parser:n.parser,round:n.round,isoWeekday:n.isoWeekday},super.init(t),this._normalized=o.normalized;}parse(t,o){return t===void 0?null:D0(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]};}determineDataLimits(){let t=this.options,o=this._adapter,n=t.time.unit||"day",{min:i,max:r,minDefined:a,maxDefined:s}=this.getUserBounds();function l(c){!a&&!isNaN(c.min)&&(i=Math.min(i,c.min)),!s&&!isNaN(c.max)&&(r=Math.max(r,c.max));}(!a||!s)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(false))),i=lt(i)&&!isNaN(i)?i:+o.startOf(Date.now(),n),r=lt(r)&&!isNaN(r)?r:+o.endOf(Date.now(),n)+1,this.min=Math.min(i,r-1),this.max=Math.max(i+1,r);}_getLabelBounds(){let t=this.getLabelTimestamps(),o=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY;return t.length&&(o=t[0],n=t[t.length-1]),{min:o,max:n}}buildTicks(){let t=this.options,o=t.time,n=t.ticks,i=n.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&i.length&&(this.min=this._userMin||i[0],this.max=this._userMax||i[i.length-1]);let r=this.min,a=this.max,s=Td(i,r,a);return this._unit=o.unit||(n.autoSkip?N0(o.minUnit,this.min,this.max,this._getLabelCapacity(r)):y8(this,s.length,o.minUnit,this.min,this.max)),this._majorUnit=!n.major.enabled||this._unit==="year"?void 0:x8(this._unit),this.initOffsets(i),t.reverse&&s.reverse(),O0(this,s,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value));}initOffsets(t){let o=0,n=0,i,r;this.options.offset&&t.length&&(i=this.getDecimalForValue(t[0]),t.length===1?o=1-i:o=(this.getDecimalForValue(t[1])-i)/2,r=this.getDecimalForValue(t[t.length-1]),t.length===1?n=r:n=(r-this.getDecimalForValue(t[t.length-2]))/2);let a=t.length<3?.5:.25;o=Ct(o,0,a),n=Ct(n,0,a),this._offsets={start:o,end:n,factor:1/(o+1+n)};}_generate(){let t=this._adapter,o=this.min,n=this.max,i=this.options,r=i.time,a=r.unit||N0(r.minUnit,o,n,this._getLabelCapacity(o)),s=N(r.stepSize,1),l=a==="week"?r.isoWeekday:false,c=Kt(l)||l===true,d={},u=o,p,h;if(c&&(u=+t.startOf(u,"isoWeek",l)),u=+t.startOf(u,c?"day":a),t.diff(n,o,a)>1e5*s)throw new Error(o+" and "+n+" are too far apart with stepSize of "+s+" "+a);let m=i.ticks.source==="data"&&this.getDataTimestamps();for(p=u,h=0;p<n;p=+t.add(p,s,a),h++)U0(d,p,m);return (p===n||i.bounds==="ticks"||h===1)&&U0(d,p,m),Object.keys(d).sort((g,f)=>g-f).map(g=>+g)}getLabelForValue(t){let o=this._adapter,n=this.options.time;return n.tooltipFormat?o.format(t,n.tooltipFormat):o.format(t,n.displayFormats.datetime)}_tickFormatFunction(t,o,n,i){let r=this.options,a=r.time.displayFormats,s=this._unit,l=this._majorUnit,c=s&&a[s],d=l&&a[l],u=n[o],p=l&&d&&u&&u.major,h=this._adapter.format(t,i||(p?d:c)),m=r.ticks.callback;return m?X(m,[h,o,n],this):h}generateTickLabels(t){let o,n,i;for(o=0,n=t.length;o<n;++o)i=t[o],i.label=this._tickFormatFunction(i.value,o,t);}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){let o=this._offsets,n=this.getDecimalForValue(t);return this.getPixelForDecimal((o.start+n)*o.factor)}getValueForPixel(t){let o=this._offsets,n=this.getDecimalForPixel(t)/o.factor-o.end;return this.min+n*(this.max-this.min)}_getLabelSize(t){let o=this.options.ticks,n=this.ctx.measureText(t).width,i=gt(this.isHorizontal()?o.maxRotation:o.minRotation),r=Math.cos(i),a=Math.sin(i),s=this._resolveTickFontOptions(0).size;return {w:n*r+s*a,h:n*a+s*r}}_getLabelCapacity(t){let o=this.options.time,n=o.displayFormats,i=n[o.unit]||n.millisecond,r=this._tickFormatFunction(t,0,O0(this,[t],this._majorUnit),i),a=this._getLabelSize(r),s=Math.floor(this.isHorizontal()?this.width/a.w:this.height/a.h)-1;return s>0?s:1}getDataTimestamps(){let t=this._cache.data||[],o,n;if(t.length)return t;let i=this.getMatchingVisibleMetas();if(this._normalized&&i.length)return this._cache.data=i[0].controller.getAllParsedValues(this);for(o=0,n=i.length;o<n;++o)t=t.concat(i[o].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){let t=this._cache.labels||[],o,n;if(t.length)return t;let i=this.getLabels();for(o=0,n=i.length;o<n;++o)t.push(D0(this,i[o]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return ss(t.sort(f8))}};Jn.id="time";Jn.defaults={bounds:"data",adapters:{},time:{parser:false,unit:false,round:false,isoWeekday:false,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",major:{enabled:false}}};function Is(e,t,o){let n=0,i=e.length-1,r,a,s,l;o?(t>=e[n].pos&&t<=e[i].pos&&({lo:n,hi:i}=ze(e,"pos",t)),{pos:r,time:s}=e[n],{pos:a,time:l}=e[i]):(t>=e[n].time&&t<=e[i].time&&({lo:n,hi:i}=ze(e,"time",t)),{time:r,pos:s}=e[n],{time:a,pos:l}=e[i]);let c=a-r;return c?s+(l-s)*(t-r)/c:s}var Os=class extends Jn{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0;}initOffsets(){let t=this._getTimestampsForTable(),o=this._table=this.buildLookupTable(t);this._minPos=Is(o,this.min),this._tableRange=Is(o,this.max)-this._minPos,super.initOffsets(t);}buildLookupTable(t){let{min:o,max:n}=this,i=[],r=[],a,s,l,c,d;for(a=0,s=t.length;a<s;++a)c=t[a],c>=o&&c<=n&&i.push(c);if(i.length<2)return [{time:o,pos:0},{time:n,pos:1}];for(a=0,s=i.length;a<s;++a)d=i[a+1],l=i[a-1],c=i[a],Math.round((d+l)/2)!==c&&r.push({time:c,pos:a/(s-1)});return r}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;let o=this.getDataTimestamps(),n=this.getLabelTimestamps();return o.length&&n.length?t=this.normalize(o.concat(n)):t=o.length?o:n,t=this._cache.all=t,t}getDecimalForValue(t){return (Is(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){let o=this._offsets,n=this.getDecimalForPixel(t)/o.factor-o.end;return Is(this._table,n*this._tableRange+this._minPos,true)}};Os.id="timeseries";Os.defaults=Jn.defaults;var lx=(function(){if(typeof window!="undefined"){if(window.devicePixelRatio)return window.devicePixelRatio;var e=window.screen;if(e)return (e.deviceXDPI||1)/(e.logicalXDPI||1)}return 1})(),cr={toTextLines:function(e){var t=[],o;for(e=[].concat(e);e.length;)o=e.pop(),typeof o=="string"?t.unshift.apply(t,o.split(`
1018
- `)):Array.isArray(o)?e.push.apply(e,o):W(e)||t.unshift(""+o);return t},textSize:function(e,t,o){var n=[].concat(t),i=n.length,r=e.font,a=0,s;for(e.font=o.string,s=0;s<i;++s)a=Math.max(e.measureText(n[s]).width,a);return e.font=r,{height:i*o.lineHeight,width:a}},bound:function(e,t,o){return Math.max(e,Math.min(t,o))},arrayDiff:function(e,t){var o=e.slice(),n=[],i,r,a,s;for(i=0,a=t.length;i<a;++i)s=t[i],r=o.indexOf(s),r===-1?n.push([s,1]):o.splice(r,1);for(i=0,a=o.length;i<a;++i)n.push([o[i],-1]);return n},rasterize:function(e){return Math.round(e*lx)/lx}};function pu(e,t){var o=t.x,n=t.y;if(o===null)return {x:0,y:-1};if(n===null)return {x:1,y:0};var i=e.x-o,r=e.y-n,a=Math.sqrt(i*i+r*r);return {x:a?i/a:0,y:a?r/a:-1}}function C8(e,t,o,n,i){switch(i){case "center":o=n=0;break;case "bottom":o=0,n=1;break;case "right":o=1,n=0;break;case "left":o=-1,n=0;break;case "top":o=0,n=-1;break;case "start":o=-o,n=-n;break;case "end":break;default:i*=Math.PI/180,o=Math.cos(i),n=Math.sin(i);break}return {x:e,y:t,vx:o,vy:n}}var P8=0,dx=1,ux=2,px=4,mx=8;function $s(e,t,o){var n=P8;return e<o.left?n|=dx:e>o.right&&(n|=ux),t<o.top?n|=mx:t>o.bottom&&(n|=px),n}function S8(e,t){for(var o=e.x0,n=e.y0,i=e.x1,r=e.y1,a=$s(o,n,t),s=$s(i,r,t),l,c,d;!(!(a|s)||a&s);)l=a||s,l&mx?(c=o+(i-o)*(t.top-n)/(r-n),d=t.top):l&px?(c=o+(i-o)*(t.bottom-n)/(r-n),d=t.bottom):l&ux?(d=n+(r-n)*(t.right-o)/(i-o),c=t.right):l&dx&&(d=n+(r-n)*(t.left-o)/(i-o),c=t.left),l===a?(o=c,n=d,a=$s(o,n,t)):(i=c,r=d,s=$s(i,r,t));return {x0:o,x1:i,y0:n,y1:r}}function Hs(e,t){var o=t.anchor,n=e,i,r;return t.clamp&&(n=S8(n,t.area)),o==="start"?(i=n.x0,r=n.y0):o==="end"?(i=n.x1,r=n.y1):(i=(n.x0+n.x1)/2,r=(n.y0+n.y1)/2),C8(i,r,e.vx,e.vy,t.align)}var Ws={arc:function(e,t){var o=(e.startAngle+e.endAngle)/2,n=Math.cos(o),i=Math.sin(o),r=e.innerRadius,a=e.outerRadius;return Hs({x0:e.x+n*r,y0:e.y+i*r,x1:e.x+n*a,y1:e.y+i*a,vx:n,vy:i},t)},point:function(e,t){var o=pu(e,t.origin),n=o.x*e.options.radius,i=o.y*e.options.radius;return Hs({x0:e.x-n,y0:e.y-i,x1:e.x+n,y1:e.y+i,vx:o.x,vy:o.y},t)},bar:function(e,t){var o=pu(e,t.origin),n=e.x,i=e.y,r=0,a=0;return e.horizontal?(n=Math.min(e.x,e.base),r=Math.abs(e.base-e.x)):(i=Math.min(e.y,e.base),a=Math.abs(e.base-e.y)),Hs({x0:n,y0:i+a,x1:n+r,y1:i,vx:o.x,vy:o.y},t)},fallback:function(e,t){var o=pu(e,t.origin);return Hs({x0:e.x,y0:e.y,x1:e.x+(e.width||0),y1:e.y+(e.height||0),vx:o.x,vy:o.y},t)}},qe=cr.rasterize;function T8(e){var t=e.borderWidth||0,o=e.padding,n=e.size.height,i=e.size.width,r=-i/2,a=-n/2;return {frame:{x:r-o.left-t,y:a-o.top-t,w:i+o.width+t*2,h:n+o.height+t*2},text:{x:r,y:a,w:i,h:n}}}function k8(e,t){var o=t.chart.getDatasetMeta(t.datasetIndex).vScale;if(!o)return null;if(o.xCenter!==void 0&&o.yCenter!==void 0)return {x:o.xCenter,y:o.yCenter};var n=o.getBasePixel();return e.horizontal?{x:n,y:null}:{x:null,y:n}}function w8(e){return e instanceof Ze?Ws.arc:e instanceof Xe?Ws.point:e instanceof Ke?Ws.bar:Ws.fallback}function v8(e,t,o,n,i,r){var a=Math.PI/2;if(r){var s=Math.min(r,i/2,n/2),l=t+s,c=o+s,d=t+n-s,u=o+i-s;e.moveTo(t,c),l<d&&c<u?(e.arc(l,c,s,-Math.PI,-a),e.arc(d,c,s,-a,0),e.arc(d,u,s,0,a),e.arc(l,u,s,a,Math.PI)):l<d?(e.moveTo(l,o),e.arc(d,c,s,-a,a),e.arc(l,c,s,a,Math.PI+a)):c<u?(e.arc(l,c,s,-Math.PI,0),e.arc(l,u,s,0,Math.PI)):e.arc(l,c,s,-Math.PI,Math.PI),e.closePath(),e.moveTo(t,o);}else e.rect(t,o,n,i);}function _8(e,t,o){var n=o.backgroundColor,i=o.borderColor,r=o.borderWidth;!n&&(!i||!r)||(e.beginPath(),v8(e,qe(t.x)+r/2,qe(t.y)+r/2,qe(t.w)-r,qe(t.h)-r,o.borderRadius),e.closePath(),n&&(e.fillStyle=n,e.fill()),i&&r&&(e.strokeStyle=i,e.lineWidth=r,e.lineJoin="miter",e.stroke()));}function A8(e,t,o){var n=o.lineHeight,i=e.w,r=e.x,a=e.y+n/2;return t==="center"?r+=i/2:(t==="end"||t==="right")&&(r+=i),{h:n,w:i,x:r,y:a}}function M8(e,t,o){var n=e.shadowBlur,i=o.stroked,r=qe(o.x),a=qe(o.y),s=qe(o.w);i&&e.strokeText(t,r,a,s),o.filled&&(n&&i&&(e.shadowBlur=0),e.fillText(t,r,a,s),n&&i&&(e.shadowBlur=n));}function I8(e,t,o,n){var i=n.textAlign,r=n.color,a=!!r,s=n.font,l=t.length,c=n.textStrokeColor,d=n.textStrokeWidth,u=c&&d,p;if(!(!l||!a&&!u))for(o=A8(o,i,s),e.font=s.string,e.textAlign=i,e.textBaseline="middle",e.shadowBlur=n.textShadowBlur,e.shadowColor=n.textShadowColor,a&&(e.fillStyle=r),u&&(e.lineJoin="round",e.lineWidth=d,e.strokeStyle=c),p=0,l=t.length;p<l;++p)M8(e,t[p],{stroked:u,filled:a,w:o.w,x:o.x,y:o.y+o.h*p});}var hx=function(e,t,o,n){var i=this;i._config=e,i._index=n,i._model=null,i._rects=null,i._ctx=t,i._el=o;};Xt(hx.prototype,{_modelize:function(e,t,o,n){var i=this,r=i._index,a=it(rt([o.font,{}],n,r)),s=rt([o.color,H.color],n,r);return {align:rt([o.align,"center"],n,r),anchor:rt([o.anchor,"center"],n,r),area:n.chart.chartArea,backgroundColor:rt([o.backgroundColor,null],n,r),borderColor:rt([o.borderColor,null],n,r),borderRadius:rt([o.borderRadius,0],n,r),borderWidth:rt([o.borderWidth,0],n,r),clamp:rt([o.clamp,false],n,r),clip:rt([o.clip,false],n,r),color:s,display:e,font:a,lines:t,offset:rt([o.offset,4],n,r),opacity:rt([o.opacity,1],n,r),origin:k8(i._el,n),padding:pt(rt([o.padding,4],n,r)),positioner:w8(i._el),rotation:rt([o.rotation,0],n,r)*(Math.PI/180),size:cr.textSize(i._ctx,t,a),textAlign:rt([o.textAlign,"start"],n,r),textShadowBlur:rt([o.textShadowBlur,0],n,r),textShadowColor:rt([o.textShadowColor,s],n,r),textStrokeColor:rt([o.textStrokeColor,s],n,r),textStrokeWidth:rt([o.textStrokeWidth,0],n,r)}},update:function(e){var t=this,o=null,n=null,i=t._index,r=t._config,a,s,l,c=rt([r.display,true],e,i);c&&(a=e.dataset.data[i],s=N(X(r.formatter,[a,e]),a),l=W(s)?[]:cr.toTextLines(s),l.length&&(o=t._modelize(c,l,r,e),n=T8(o))),t._model=o,t._rects=n;},geometry:function(){return this._rects?this._rects.frame:{}},rotation:function(){return this._model?this._model.rotation:0},visible:function(){return this._model&&this._model.opacity},model:function(){return this._model},draw:function(e,t){var o=this,n=e.ctx,i=o._model,r=o._rects,a;this.visible()&&(n.save(),i.clip&&(a=i.area,n.beginPath(),n.rect(a.left,a.top,a.right-a.left,a.bottom-a.top),n.clip()),n.globalAlpha=cr.bound(0,i.opacity,1),n.translate(qe(t.x),qe(t.y)),n.rotate(i.rotation),_8(n,r.frame,i),I8(n,i.lines,r.text,i),n.restore());}});var E8=Number.MIN_SAFE_INTEGER||-9007199254740991,F8=Number.MAX_SAFE_INTEGER||9007199254740991;function lr(e,t,o){var n=Math.cos(o),i=Math.sin(o),r=t.x,a=t.y;return {x:r+n*(e.x-r)-i*(e.y-a),y:a+i*(e.x-r)+n*(e.y-a)}}function cx(e,t){var o=F8,n=E8,i=t.origin,r,a,s,l,c;for(r=0;r<e.length;++r)a=e[r],s=a.x-i.x,l=a.y-i.y,c=t.vx*s+t.vy*l,o=Math.min(o,c),n=Math.max(n,c);return {min:o,max:n}}function Gs(e,t){var o=t.x-e.x,n=t.y-e.y,i=Math.sqrt(o*o+n*n);return {vx:(t.x-e.x)/i,vy:(t.y-e.y)/i,origin:e,ln:i}}var gx=function(){this._rotation=0,this._rect={x:0,y:0,w:0,h:0};};Xt(gx.prototype,{center:function(){var e=this._rect;return {x:e.x+e.w/2,y:e.y+e.h/2}},update:function(e,t,o){this._rotation=o,this._rect={x:t.x+e.x,y:t.y+e.y,w:t.w,h:t.h};},contains:function(e){var t=this,o=1,n=t._rect;return e=lr(e,t.center(),-t._rotation),!(e.x<n.x-o||e.y<n.y-o||e.x>n.x+n.w+o*2||e.y>n.y+n.h+o*2)},intersects:function(e){var t=this._points(),o=e._points(),n=[Gs(t[0],t[1]),Gs(t[0],t[3])],i,r,a;for(this._rotation!==e._rotation&&n.push(Gs(o[0],o[1]),Gs(o[0],o[3])),i=0;i<n.length;++i)if(r=cx(t,n[i]),a=cx(o,n[i]),r.max<a.min||a.max<r.min)return false;return true},_points:function(){var e=this,t=e._rect,o=e._rotation,n=e.center();return [lr({x:t.x,y:t.y},n,o),lr({x:t.x+t.w,y:t.y},n,o),lr({x:t.x+t.w,y:t.y+t.h},n,o),lr({x:t.x,y:t.y+t.h},n,o)]}});function fx(e,t,o){var n=t.positioner(e,t),i=n.vx,r=n.vy;if(!i&&!r)return {x:n.x,y:n.y};var a=o.w,s=o.h,l=t.rotation,c=Math.abs(a/2*Math.cos(l))+Math.abs(s/2*Math.sin(l)),d=Math.abs(a/2*Math.sin(l))+Math.abs(s/2*Math.cos(l)),u=1/Math.max(Math.abs(i),Math.abs(r));return c*=i*u,d*=r*u,c+=t.offset*i,d+=t.offset*r,{x:n.x+c,y:n.y+d}}function L8(e,t){var o,n,i,r;for(o=e.length-1;o>=0;--o)for(i=e[o].$layout,n=o-1;n>=0&&i._visible;--n)r=e[n].$layout,r._visible&&i._box.intersects(r._box)&&t(i,r);return e}function B8(e){var t,o,n,i,r,a,s;for(t=0,o=e.length;t<o;++t)n=e[t],i=n.$layout,i._visible&&(s=new Proxy(n._el,{get:(l,c)=>l.getProps([c],true)[c]}),r=n.geometry(),a=fx(s,n.model(),r),i._box.update(a,r,n.rotation()));return L8(e,function(l,c){var d=l._hidable,u=c._hidable;d&&u||u?c._visible=false:d&&(l._visible=false);})}var dr={prepare:function(e){var t=[],o,n,i,r,a;for(o=0,i=e.length;o<i;++o)for(n=0,r=e[o].length;n<r;++n)a=e[o][n],t.push(a),a.$layout={_box:new gx,_hidable:false,_visible:true,_set:o,_idx:a._index};return t.sort(function(s,l){var c=s.$layout,d=l.$layout;return c._idx===d._idx?d._set-c._set:d._idx-c._idx}),this.update(t),t},update:function(e){var t=false,o,n,i,r,a;for(o=0,n=e.length;o<n;++o)i=e[o],r=i.model(),a=i.$layout,a._hidable=r&&r.display==="auto",a._visible=i.visible(),t|=a._hidable;t&&B8(e);},lookup:function(e,t){var o,n;for(o=e.length-1;o>=0;--o)if(n=e[o].$layout,n&&n._visible&&n._box.contains(t))return e[o];return null},draw:function(e,t){var o,n,i,r,a,s;for(o=0,n=t.length;o<n;++o)i=t[o],r=i.$layout,r._visible&&(a=i.geometry(),s=fx(i._el,i.model(),a),r._box.update(s,a,i.rotation()),i.draw(e,s));}},R8=function(e){if(W(e))return null;var t=e,o,n,i;if(z(e))if(!W(e.label))t=e.label;else if(!W(e.r))t=e.r;else for(t="",o=Object.keys(e),i=0,n=o.length;i<n;++i)t+=(i!==0?", ":"")+o[i]+": "+e[o[i]];return ""+t},D8={align:"center",anchor:"center",backgroundColor:null,borderColor:null,borderRadius:0,borderWidth:0,clamp:false,clip:false,color:void 0,display:true,font:{family:void 0,lineHeight:1.2,size:void 0,style:void 0,weight:null},formatter:R8,labels:void 0,listeners:{},offset:4,opacity:1,padding:{top:4,right:4,bottom:4,left:4},rotation:0,textAlign:"start",textStrokeColor:void 0,textStrokeWidth:0,textShadowBlur:0,textShadowColor:void 0},$t="$datalabels",yx="$default";function N8(e,t){var o=e.datalabels,n={},i=[],r,a;return o===false?null:(o===true&&(o={}),t=Xt({},[t,o]),r=t.labels||{},a=Object.keys(r),delete t.labels,a.length?a.forEach(function(s){r[s]&&i.push(Xt({},[t,r[s],{_key:s}]));}):i.push(t),n=i.reduce(function(s,l){return K(l.listeners||{},function(c,d){s[d]=s[d]||{},s[d][l._key||yx]=c;}),delete l.listeners,s},{}),{labels:i,listeners:n})}function mu(e,t,o,n){if(t){var i=o.$context,r=o.$groups,a;t[r._set]&&(a=t[r._set][r._key],a&&X(a,[i,n])===true&&(e[$t]._dirty=true,o.update(i)));}}function U8(e,t,o,n,i){var r,a;!o&&!n||(o?n?o!==n&&(a=r=true):a=true:r=true,a&&mu(e,t.leave,o,i),r&&mu(e,t.enter,n,i));}function O8(e,t){var o=e[$t],n=o._listeners,i,r;if(!(!n.enter&&!n.leave)){if(t.type==="mousemove")r=dr.lookup(o._labels,t);else if(t.type!=="mouseout")return;i=o._hovered,o._hovered=r,U8(e,n,i,r,t);}}function z8(e,t){var o=e[$t],n=o._listeners.click,i=n&&dr.lookup(o._labels,t);i&&mu(e,n,i,t);}var xx={id:"datalabels",defaults:D8,beforeInit:function(e){e[$t]={_actives:[]};},beforeUpdate:function(e){var t=e[$t];t._listened=false,t._listeners={},t._datasets=[],t._labels=[];},afterDatasetUpdate:function(e,t,o){var n=t.index,i=e[$t],r=i._datasets[n]=[],a=e.isDatasetVisible(n),s=e.data.datasets[n],l=N8(s,o),c=t.meta.data||[],d=e.ctx,u,p,h,m,g,f,x,b;for(d.save(),u=0,h=c.length;u<h;++u)if(x=c[u],x[$t]=[],a&&x&&e.getDataVisibility(u)&&!x.skip)for(p=0,m=l.labels.length;p<m;++p)g=l.labels[p],f=g._key,b=new hx(g,d,x,u),b.$groups={_set:n,_key:f||yx},b.$context={active:false,chart:e,dataIndex:u,dataset:s,datasetIndex:n},b.update(b.$context),x[$t].push(b),r.push(b);d.restore(),Xt(i._listeners,l.listeners,{merger:function(T,k,w){k[T]=k[T]||{},k[T][t.index]=w[T],i._listened=true;}});},afterUpdate:function(e){e[$t]._labels=dr.prepare(e[$t]._datasets);},afterDatasetsDraw:function(e){dr.draw(e,e[$t]._labels);},beforeEvent:function(e,t){if(e[$t]._listened){var o=t.event;switch(o.type){case "mousemove":case "mouseout":O8(e,o);break;case "click":z8(e,o);break}}},afterEvent:function(e){var t=e[$t],o=t._actives,n=t._actives=e.getActiveElements(),i=cr.arrayDiff(o,n),r,a,s,l,c,d,u;for(r=0,a=i.length;r<a;++r)if(c=i[r],c[1])for(u=c[0].element[$t]||[],s=0,l=u.length;s<l;++s)d=u[s],d.$context.active=c[1]===1,d.update(d.$context);(t._dirty||i.length)&&(dr.update(t._labels),e.render()),delete t._dirty;}};var bx={modes:{point(e,t){return Ys(e,t,{intersect:true})},nearest(e,t,o){return H8(e,t,o)},x(e,t,o){return Ys(e,t,{intersect:o.intersect,axis:"x"})},y(e,t,o){return Ys(e,t,{intersect:o.intersect,axis:"y"})}}};function Su(e,t,o){return (bx.modes[o.mode]||bx.modes.nearest)(e,t,o)}function V8(e,t,o){return o!=="x"&&o!=="y"?e.inRange(t.x,t.y,"x",true)||e.inRange(t.x,t.y,"y",true):e.inRange(t.x,t.y,o,true)}function $8(e,t,o){return o==="x"?{x:e.x,y:t.y}:o==="y"?{x:t.x,y:e.y}:t}function Ys(e,t,o){return e.visibleElements.filter(n=>o.intersect?n.inRange(t.x,t.y):V8(n,t,o.axis))}function H8(e,t,o){let n=Number.POSITIVE_INFINITY;return Ys(e,t,o).reduce((i,r)=>{let a=r.getCenterPoint(),s=$8(t,a,o.axis),l=Ve(t,s);return l<n?(i=[r],n=l):l===n&&i.push(r),i},[]).sort((i,r)=>i._index-r._index).slice(0,1)}var W8=(e,t)=>t>e||e.length>t.length&&e.slice(0,t.length)===t,sn=.001,Xs=(e,t,o)=>Math.min(o,Math.max(t,e));function G8(e,t,o){for(let n of Object.keys(e))e[n]=Xs(e[n],t,o);return e}function j8(e,t,o,n){if(!e||!t||o<=0)return false;let i=n/2;return Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)<=Math.pow(o+i,2)}function Ux(e,{x:t,y:o,x2:n,y2:i},r,a){let s=a/2,l=e.x>=t-s-sn&&e.x<=n+s+sn,c=e.y>=o-s-sn&&e.y<=i+s+sn;return r==="x"?l:(r==="y"||l)&&c}function ni(e,t){let{centerX:o,centerY:n}=e.getProps(["centerX","centerY"],t);return {x:o,y:n}}function Y8(e,t,o,n=true){let i=o.split("."),r=0;for(let a of t.split(".")){let s=i[r++];if(parseInt(a,10)<parseInt(s,10))break;if(W8(s,a)){if(n)throw new Error(`${e} v${o} is not supported. v${t} or newer is required.`);return false}}return true}var Ox=e=>typeof e=="string"&&e.endsWith("%"),zx=e=>parseFloat(e)/100,Vx=e=>Xs(zx(e),0,1);function Tu(e,t){return t==="start"?0:t==="end"?e:Ox(t)?Vx(t)*e:e/2}function vo(e,t,o=true){return typeof t=="number"?t:Ox(t)?(o?Vx(t):zx(t))*e:e}function Z8(e,t){let{x:o,width:n}=e,i=t.textAlign;return i==="center"?o+n/2:i==="end"||i==="right"?o+n:o}function ku(e,t="center"){return z(e)?{x:N(e.x,t),y:N(e.y,t)}:(e=N(e,t),{x:e,y:e})}function $x(e){return e&&(st(e.xValue)||st(e.yValue))}function pr(e,t,o,n=false){let i=o.init;if(i){if(i===true)return Wx(t,n)}else return;return X8(t,n,X(i,[{chart:e,properties:t,options:o}]))}function Hx(e,t,o){let n=false;return t.forEach(i=>{Tt(e[i])?(n=true,o[i]=e[i]):st(o[i])&&delete o[i];}),n}function Wx({centerX:e,centerY:t},o){return o?{centerX:e,centerY:t,radius:0,width:0,height:0}:{x:e,y:t,x2:e,y2:t,width:0,height:0}}function X8(e,t,o){if(o===true)return Wx(e,t);if(z(o))return o}var hu=new Map,K8=e=>isNaN(e)||e<=0,q8=e=>e.reduce(function(t,o){return t+=o.string,t},"");function Ks(e){if(e&&typeof e=="object"){let t=e.toString();return t==="[object HTMLImageElement]"||t==="[object HTMLCanvasElement]"}}function wu(e,{x:t,y:o},n){n&&(e.translate(t,o),e.rotate(gt(n)),e.translate(-t,-o));}function _o(e,t){if(t&&t.borderWidth)return e.lineCap=t.borderCapStyle,e.setLineDash(t.borderDash),e.lineDashOffset=t.borderDashOffset,e.lineJoin=t.borderJoinStyle,e.lineWidth=t.borderWidth,e.strokeStyle=t.borderColor,true}function ii(e,t){e.shadowColor=t.backgroundShadowColor,e.shadowBlur=t.shadowBlur,e.shadowOffsetX=t.shadowOffsetX,e.shadowOffsetY=t.shadowOffsetY;}function vu(e,t){let o=t.content;if(Ks(o))return {width:vo(o.width,t.width),height:vo(o.height,t.height)};let n=t.font,i=Z(n)?n.map(l=>it(l)):[it(n)],r=t.textStrokeWidth,a=Z(o)?o:[o],s=a.join()+q8(i)+r+(e._measureText?"-spriting":"");return hu.has(s)||hu.set(s,o7(e,a,i,r)),hu.get(s)}function Gx(e,t,o){let{x:n,y:i,width:r,height:a}=t;e.save(),ii(e,o);let s=_o(e,o);e.fillStyle=o.backgroundColor,e.beginPath(),We(e,{x:n,y:i,w:r,h:a,radius:G8(fe(o.borderRadius),0,Math.min(r,a)/2)}),e.closePath(),e.fill(),s&&(e.shadowColor=o.borderShadowColor,e.stroke()),e.restore();}function Q8(e,t,o){let n=o.content;if(Ks(n)){e.save(),e.globalAlpha=r7(o.opacity,n.style.opacity),e.drawImage(n,t.x,t.y,t.width,t.height),e.restore();return}let i=Z(n)?n:[n],r=o.font,a=Z(r)?r.map(u=>it(u)):[it(r)],s=o.color,l=Z(s)?s:[s],c=Z8(t,o),d=t.y+o.textStrokeWidth/2;e.save(),e.textBaseline="middle",e.textAlign=o.textAlign,J8(e,o)&&n7(e,{x:c,y:d},i,a),i7(e,{x:c,y:d},i,{fonts:a,colors:l}),e.restore();}function J8(e,t){if(t.textStrokeWidth>0)return e.lineJoin="round",e.miterLimit=2,e.lineWidth=t.textStrokeWidth,e.strokeStyle=t.textStrokeColor,true}function t7(e,t,o,n){let{radius:i,options:r}=t,a=r.pointStyle,s=r.rotation,l=(s||0)*$i;if(Ks(a)){e.save(),e.translate(o,n),e.rotate(l),e.drawImage(a,-a.width/2,-a.height/2,a.width,a.height),e.restore();return}K8(i)||e7(e,{x:o,y:n,radius:i,rotation:s,style:a,rad:l});}function e7(e,{x:t,y:o,radius:n,rotation:i,style:r,rad:a}){let s,l,c,d;switch(e.beginPath(),r){default:e.arc(t,o,n,0,Q),e.closePath();break;case "triangle":e.moveTo(t+Math.sin(a)*n,o-Math.cos(a)*n),a+=Un,e.lineTo(t+Math.sin(a)*n,o-Math.cos(a)*n),a+=Un,e.lineTo(t+Math.sin(a)*n,o-Math.cos(a)*n),e.closePath();break;case "rectRounded":d=n*.516,c=n-d,s=Math.cos(a+ie)*c,l=Math.sin(a+ie)*c,e.arc(t-s,o-l,d,a-G,a-et),e.arc(t+l,o-s,d,a-et,a),e.arc(t+s,o+l,d,a,a+et),e.arc(t-l,o+s,d,a+et,a+G),e.closePath();break;case "rect":if(!i){c=Math.SQRT1_2*n,e.rect(t-c,o-c,2*c,2*c);break}a+=ie;case "rectRot":s=Math.cos(a)*n,l=Math.sin(a)*n,e.moveTo(t-s,o-l),e.lineTo(t+l,o-s),e.lineTo(t+s,o+l),e.lineTo(t-l,o+s),e.closePath();break;case "crossRot":a+=ie;case "cross":s=Math.cos(a)*n,l=Math.sin(a)*n,e.moveTo(t-s,o-l),e.lineTo(t+s,o+l),e.moveTo(t+l,o-s),e.lineTo(t-l,o+s);break;case "star":s=Math.cos(a)*n,l=Math.sin(a)*n,e.moveTo(t-s,o-l),e.lineTo(t+s,o+l),e.moveTo(t+l,o-s),e.lineTo(t-l,o+s),a+=ie,s=Math.cos(a)*n,l=Math.sin(a)*n,e.moveTo(t-s,o-l),e.lineTo(t+s,o+l),e.moveTo(t+l,o-s),e.lineTo(t-l,o+s);break;case "line":s=Math.cos(a)*n,l=Math.sin(a)*n,e.moveTo(t-s,o-l),e.lineTo(t+s,o+l);break;case "dash":e.moveTo(t,o),e.lineTo(t+Math.cos(a)*n,o+Math.sin(a)*n);break}e.fill();}function o7(e,t,o,n){e.save();let i=t.length,r=0,a=n;for(let s=0;s<i;s++){let l=o[Math.min(s,o.length-1)];e.font=l.string;let c=t[s];r=Math.max(r,e.measureText(c).width+n),a+=l.lineHeight;}return e.restore(),{width:r,height:a}}function n7(e,{x:t,y:o},n,i){e.beginPath();let r=0;n.forEach(function(a,s){let l=i[Math.min(s,i.length-1)],c=l.lineHeight;e.font=l.string,e.strokeText(a,t,o+c/2+r),r+=c;}),e.stroke();}function i7(e,{x:t,y:o},n,{fonts:i,colors:r}){let a=0;n.forEach(function(s,l){let c=r[Math.min(l,r.length-1)],d=i[Math.min(l,i.length-1)],u=d.lineHeight;e.beginPath(),e.font=d.string,e.fillStyle=c,e.fillText(s,t,o+u/2+a),a+=u,e.fill();});}function r7(e,t){let o=Kt(e)?e:t;return Kt(o)?Xs(o,0,1):1}var Cx={xScaleID:{min:"xMin",max:"xMax",start:"left",end:"right",startProp:"x",endProp:"x2"},yScaleID:{min:"yMin",max:"yMax",start:"bottom",end:"top",startProp:"y",endProp:"y2"}};function ti(e,t,o){return t=typeof t=="number"?t:e.parse(t),lt(t)?e.getPixelForValue(t):o}function ln(e,t,o){let n=t[o];if(n||o==="scaleID")return n;let i=o.charAt(0),r=Object.values(e).filter(a=>a.axis&&a.axis===i);return r.length?r[0].id:i}function jx(e,t){if(e){let o=e.options.reverse,n=ti(e,t.min,o?t.end:t.start),i=ti(e,t.max,o?t.start:t.end);return {start:n,end:i}}}function Yx(e,t){let{chartArea:o,scales:n}=e,i=n[ln(n,t,"xScaleID")],r=n[ln(n,t,"yScaleID")],a=o.width/2,s=o.height/2;return i&&(a=ti(i,t.xValue,i.left+i.width/2)),r&&(s=ti(r,t.yValue,r.top+r.height/2)),{x:a,y:s}}function _u(e,t){let o=e.scales,n=o[ln(o,t,"xScaleID")],i=o[ln(o,t,"yScaleID")];if(!n&&!i)return {};let{left:r,right:a}=n||e.chartArea,{top:s,bottom:l}=i||e.chartArea,c=Px(n,{min:t.xMin,max:t.xMax,start:r,end:a});r=c.start,a=c.end;let d=Px(i,{min:t.yMin,max:t.yMax,start:l,end:s});return s=d.start,l=d.end,{x:r,y:s,x2:a,y2:l,width:a-r,height:l-s,centerX:r+(a-r)/2,centerY:s+(l-s)/2}}function Zx(e,t){if(!$x(t)){let o=_u(e,t),n=t.radius;(!n||isNaN(n))&&(n=Math.min(o.width,o.height)/2,t.radius=n);let i=n*2,r=o.centerX+t.xAdjust,a=o.centerY+t.yAdjust;return {x:r-n,y:a-n,x2:r+n,y2:a+n,centerX:r,centerY:a,width:i,height:i,radius:n}}return s7(e,t)}function a7(e,t){let{scales:o,chartArea:n}=e,i=o[t.scaleID],r={x:n.left,y:n.top,x2:n.right,y2:n.bottom};return i?l7(i,r,t):c7(o,r,t),r}function Xx(e,t,o){let n=_u(e,t);return n.initProperties=pr(e,n,t,o),n.elements=[{type:"label",optionScope:"label",properties:p7(e,n,t),initProperties:n.initProperties}],n}function s7(e,t){let o=Yx(e,t),n=t.radius*2;return {x:o.x-t.radius+t.xAdjust,y:o.y-t.radius+t.yAdjust,x2:o.x+t.radius+t.xAdjust,y2:o.y+t.radius+t.yAdjust,centerX:o.x+t.xAdjust,centerY:o.y+t.yAdjust,radius:t.radius,width:n,height:n}}function Px(e,t){let o=jx(e,t)||t;return {start:Math.min(o.start,o.end),end:Math.max(o.start,o.end)}}function l7(e,t,o){let n=ti(e,o.value,NaN),i=ti(e,o.endValue,n);e.isHorizontal()?(t.x=n,t.x2=i):(t.y=n,t.y2=i);}function c7(e,t,o){for(let n of Object.keys(Cx)){let i=e[ln(e,o,n)];if(i){let{min:r,max:a,start:s,end:l,startProp:c,endProp:d}=Cx[n],u=jx(i,{min:o[r],max:o[a],start:i[s],end:i[l]});t[c]=u.start,t[d]=u.end;}}}function d7({properties:e,options:t},o,n,i){let{x:r,x2:a,width:s}=e;return Kx({start:r,end:a,borderWidth:t.borderWidth},{position:n.x,padding:{start:i.left,end:i.right},adjust:t.label.xAdjust,size:o.width})}function u7({properties:e,options:t},o,n,i){let{y:r,y2:a,height:s}=e;return Kx({start:r,end:a,borderWidth:t.borderWidth},{position:n.y,padding:{start:i.top,end:i.bottom},adjust:t.label.yAdjust,size:o.height})}function Kx(e,t){let{start:o,end:n,borderWidth:i}=e,{position:r,padding:{start:a,end:s},adjust:l}=t,c=n-i-o-a-s-t.size;return o+i/2+l+Tu(c,r)}function p7(e,t,o){let n=o.label;n.backgroundColor="transparent",n.callout.display=false;let i=ku(n.position),r=pt(n.padding),a=vu(e.ctx,n),s=d7({properties:t,options:o},a,i,r),l=u7({properties:t,options:o},a,i,r),c=a.width+r.width,d=a.height+r.height;return {x:s,y:l,x2:s+c,y2:l+d,width:c,height:d,centerX:s+c/2,centerY:l+d/2,rotation:n.rotation}}function pn(e,t,o){let n=Math.cos(o),i=Math.sin(o),r=t.x,a=t.y;return {x:r+n*(e.x-r)-i*(e.y-a),y:a+i*(e.x-r)+n*(e.y-a)}}var gu=["enter","leave"],Au=gu.concat("click");function m7(e,t,o){t.listened=Hx(o,Au,t.listeners),t.moveListened=false,t._getElements=Su,gu.forEach(n=>{Tt(o[n])&&(t.moveListened=true);}),(!t.listened||!t.moveListened)&&t.annotations.forEach(n=>{!t.listened&&Tt(n.click)&&(t.listened=true),t.moveListened||gu.forEach(i=>{Tt(n[i])&&(t.listened=true,t.moveListened=true);});});}function h7(e,t,o){if(e.listened)switch(t.type){case "mousemove":case "mouseout":return g7(e,t,o);case "click":return f7(e,t,o)}}function g7(e,t,o){if(!e.moveListened)return;let n;t.type==="mousemove"?n=Su(e,t,o.interaction):n=[];let i=e.hovered;e.hovered=n;let r={state:e,event:t},a=Sx(r,"leave",i,n);return Sx(r,"enter",n,i)||a}function Sx({state:e,event:t},o,n,i){let r;for(let a of n)i.indexOf(a)<0&&(r=qx(a.options[o]||e.listeners[o],a,t)||r);return r}function f7(e,t,o){let n=e.listeners,i=Su(e,t,o.interaction),r;for(let a of i)r=qx(a.options.click||n.click,a,t)||r;return r}function qx(e,t,o){return X(e,[t.$context,o])===true}var Zs=["afterDraw","beforeDraw"];function y7(e,t,o){let n=t.visibleElements;t.hooked=Hx(o,Zs,t.hooks),t.hooked||n.forEach(i=>{t.hooked||Zs.forEach(r=>{Tt(i.options[r])&&(t.hooked=true);});});}function Tx(e,t,o){if(e.hooked){let n=t.options[o]||e.hooks[o];return X(n,[t.$context])}}function x7(e,t,o){let n=T7(e.scales,t,o),i=kx(t,n,"min","suggestedMin");i=kx(t,n,"max","suggestedMax")||i,i&&Tt(t.handleTickRangeOptions)&&t.handleTickRangeOptions();}function b7(e,t){for(let o of e)P7(o,t);}function kx(e,t,o,n){if(lt(t[o])&&!C7(e.options,o,n)){let i=e[o]!==t[o];return e[o]=t[o],i}}function C7(e,t,o){return st(e[t])||st(e[o])}function P7(e,t){for(let o of ["scaleID","xScaleID","yScaleID"]){let n=ln(t,e,o);n&&!t[n]&&S7(e,o)&&console.warn(`No scale found with id '${n}' for annotation '${e.id}'`);}}function S7(e,t){if(t==="scaleID")return true;let o=t.charAt(0);for(let n of ["Min","Max","Value"])if(st(e[o+n]))return true;return false}function T7(e,t,o){let n=t.axis,i=t.id,r=n+"ScaleID",a={min:N(t.min,Number.NEGATIVE_INFINITY),max:N(t.max,Number.POSITIVE_INFINITY)};for(let s of o)s.scaleID===i?wx(s,t,["value","endValue"],a):ln(e,s,r)===i&&wx(s,t,[n+"Min",n+"Max",n+"Value"],a);return a}function wx(e,t,o,n){for(let i of o){let r=e[i];if(st(r)){let a=t.parse(r);n.min=Math.min(n.min,a),n.max=Math.max(n.max,a);}}}var Ao=class extends xt{inRange(t,o,n,i){let{x:r,y:a}=pn({x:t,y:o},this.getCenterPoint(i),gt(-this.options.rotation));return Ux({x:r,y:a},this.getProps(["x","y","x2","y2"],i),n,this.options.borderWidth)}getCenterPoint(t){return ni(this,t)}draw(t){t.save(),wu(t,this.getCenterPoint(),this.options.rotation),Gx(t,this,this.options),t.restore();}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,o){return Xx(t,o)}};Ao.id="boxAnnotation";Ao.defaults={adjustScaleRange:true,backgroundShadowColor:"transparent",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderRadius:0,borderShadowColor:"transparent",borderWidth:1,display:true,init:void 0,label:{backgroundColor:"transparent",borderWidth:0,callout:{display:false},color:"black",content:null,display:false,drawTime:void 0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:"bold"},height:void 0,opacity:void 0,padding:6,position:"center",rotation:void 0,textAlign:"start",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,yAdjust:0,z:void 0},rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,xMax:void 0,xMin:void 0,xScaleID:void 0,yMax:void 0,yMin:void 0,yScaleID:void 0,z:0};Ao.defaultRoutes={borderColor:"color",backgroundColor:"color"};Ao.descriptors={label:{_fallback:true}};var Qx=["left","bottom","top","right"],cn=class extends xt{inRange(t,o,n,i){let{x:r,y:a}=pn({x:t,y:o},this.getCenterPoint(i),gt(-this.rotation));return Ux({x:r,y:a},this.getProps(["x","y","x2","y2"],i),n,this.options.borderWidth)}getCenterPoint(t){return ni(this,t)}draw(t){let o=this.options,n=!st(this._visible)||this._visible;!o.display||!o.content||!n||(t.save(),wu(t,this.getCenterPoint(),this.rotation),w7(t,this),Gx(t,this,o),Q8(t,F7(this),o),t.restore());}resolveElementProperties(t,o){let n;if($x(o))n=Yx(t,o);else {let{centerX:s,centerY:l}=_u(t,o);n={x:s,y:l};}let i=pt(o.padding),r=vu(t.ctx,o),a=k7(n,r,o,i);return A(S({initProperties:pr(t,a,o),pointX:n.x,pointY:n.y},a),{rotation:o.rotation})}};cn.id="labelAnnotation";cn.defaults={adjustScaleRange:true,backgroundColor:"transparent",backgroundShadowColor:"transparent",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderRadius:0,borderShadowColor:"transparent",borderWidth:0,callout:{borderCapStyle:"butt",borderColor:void 0,borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:1,display:false,margin:5,position:"auto",side:5,start:"50%"},color:"black",content:null,display:true,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:void 0},height:void 0,init:void 0,opacity:void 0,padding:6,position:"center",rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,textAlign:"center",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,xMax:void 0,xMin:void 0,xScaleID:void 0,xValue:void 0,yAdjust:0,yMax:void 0,yMin:void 0,yScaleID:void 0,yValue:void 0,z:0};cn.defaultRoutes={borderColor:"color"};function k7(e,t,o,n){let i=t.width+n.width+o.borderWidth,r=t.height+n.height+o.borderWidth,a=ku(o.position,"center"),s=vx(e.x,i,o.xAdjust,a.x),l=vx(e.y,r,o.yAdjust,a.y);return {x:s,y:l,x2:s+i,y2:l+r,width:i,height:r,centerX:s+i/2,centerY:l+r/2}}function vx(e,t,o=0,n){return e-Tu(t,n)+o}function w7(e,t){let{pointX:o,pointY:n,options:i}=t,r=i.callout,a=r&&r.display&&I7(t,r);if(!a||L7(t,r,a))return;if(e.save(),e.beginPath(),!_o(e,r))return e.restore();let{separatorStart:l,separatorEnd:c}=v7(t,a),{sideStart:d,sideEnd:u}=A7(t,a,l);(r.margin>0||i.borderWidth===0)&&(e.moveTo(l.x,l.y),e.lineTo(c.x,c.y)),e.moveTo(d.x,d.y),e.lineTo(u.x,u.y);let p=pn({x:o,y:n},t.getCenterPoint(),gt(-t.rotation));e.lineTo(p.x,p.y),e.stroke(),e.restore();}function v7(e,t){let{x:o,y:n,x2:i,y2:r}=e,a=_7(e,t),s,l;return t==="left"||t==="right"?(s={x:o+a,y:n},l={x:s.x,y:r}):(s={x:o,y:n+a},l={x:i,y:s.y}),{separatorStart:s,separatorEnd:l}}function _7(e,t){let{width:o,height:n,options:i}=e,r=i.callout.margin+i.borderWidth/2;return t==="right"?o+r:t==="bottom"?n+r:-r}function A7(e,t,o){let{y:n,width:i,height:r,options:a}=e,s=a.callout.start,l=M7(t,a.callout),c,d;return t==="left"||t==="right"?(c={x:o.x,y:n+vo(r,s)},d={x:c.x+l,y:c.y}):(c={x:o.x+vo(i,s),y:o.y},d={x:c.x,y:c.y+l}),{sideStart:c,sideEnd:d}}function M7(e,t){let o=t.side;return e==="left"||e==="top"?-o:o}function I7(e,t){let o=t.position;return Qx.includes(o)?o:E7(e,t)}function E7(e,t){let{x:o,y:n,x2:i,y2:r,width:a,height:s,pointX:l,pointY:c,centerX:d,centerY:u,rotation:p}=e,h={x:d,y:u},m=t.start,g=vo(a,m),f=vo(s,m),x=[o,o+g,o+g,i],b=[n+f,r,n,r],T=[];for(let k=0;k<4;k++){let w=pn({x:x[k],y:b[k]},h,gt(p));T.push({position:Qx[k],distance:Ve(w,{x:l,y:c})});}return T.sort((k,w)=>k.distance-w.distance)[0].position}function F7({x:e,y:t,width:o,height:n,options:i}){let r=i.borderWidth/2,a=pt(i.padding);return {x:e+a.left+r,y:t+a.top+r,width:o-a.left-a.right-i.borderWidth,height:n-a.top-a.bottom-i.borderWidth}}function L7(e,t,o){let{pointX:n,pointY:i}=e,r=t.margin,a=n,s=i;return o==="left"?a+=r:o==="right"?a-=r:o==="top"?s+=r:o==="bottom"&&(s-=r),e.inRange(a,s)}var Mu=(e,t,o)=>({x:e.x+o*(t.x-e.x),y:e.y+o*(t.y-e.y)}),fu=(e,t,o)=>Mu(t,o,Math.abs((e-t.y)/(o.y-t.y))).x,_x=(e,t,o)=>Mu(t,o,Math.abs((e-t.x)/(o.x-t.x))).y,ur=e=>e*e,B7=(e,t,{x:o,y:n,x2:i,y2:r},a)=>a==="y"?{start:Math.min(n,r),end:Math.max(n,r),value:t}:{start:Math.min(o,i),end:Math.max(o,i),value:e},Ax=(e,t,o,n)=>(1-n)*(1-n)*e+2*(1-n)*n*t+n*n*o,yu=(e,t,o,n)=>({x:Ax(e.x,t.x,o.x,n),y:Ax(e.y,t.y,o.y,n)}),Mx=(e,t,o,n)=>2*(1-n)*(t-e)+2*n*(o-t),Ix=(e,t,o,n)=>-Math.atan2(Mx(e.x,t.x,o.x,n),Mx(e.y,t.y,o.y,n))+.5*G,dn=class extends xt{inRange(t,o,n,i){let r=this.options.borderWidth/2;if(n!=="x"&&n!=="y"){let a={mouseX:t,mouseY:o},{path:s,ctx:l}=this;if(s){_o(l,this.options);let{chart:d}=this.$context,u=t*d.currentDevicePixelRatio,p=o*d.currentDevicePixelRatio,h=l.isPointInStroke(s,u,p)||xu(this,a,i);return l.restore(),h}let c=ur(r);return U7(this,a,c,i)||xu(this,a,i)}return R7(this,{mouseX:t,mouseY:o},n,{hBorderWidth:r,useFinalPosition:i})}getCenterPoint(t){return ni(this,t)}draw(t){let{x:o,y:n,x2:i,y2:r,cp:a,options:s}=this;if(t.save(),!_o(t,s))return t.restore();ii(t,s);let l=Math.sqrt(Math.pow(i-o,2)+Math.pow(r-n,2));if(s.curve&&a)return j7(t,this,a,l),t.restore();let{startOpts:c,endOpts:d,startAdjust:u,endAdjust:p}=Jx(this),h=Math.atan2(r-n,i-o);t.translate(o,n),t.rotate(h),t.beginPath(),t.moveTo(0+u,0),t.lineTo(l-p,0),t.shadowColor=s.borderShadowColor,t.stroke(),bu(t,0,u,c),bu(t,l,-p,d),t.restore();}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,o){let n=a7(t,o),{x:i,y:r,x2:a,y2:s}=n,l=D7(n,t.chartArea),c=l?N7({x:i,y:r},{x:a,y:s},t.chartArea):{x:i,y:r,x2:a,y2:s,width:Math.abs(a-i),height:Math.abs(s-r)};if(c.centerX=(a+i)/2,c.centerY=(s+r)/2,c.initProperties=pr(t,c,o),o.curve){let u={x:c.x,y:c.y},p={x:c.x2,y:c.y2};c.cp=G7(c,o,Ve(u,p));}let d=O7(t,c,o.label);return d._visible=l,c.elements=[{type:"label",optionScope:"label",properties:d,initProperties:c.initProperties}],c}};dn.id="lineAnnotation";var Ex={backgroundColor:void 0,backgroundShadowColor:void 0,borderColor:void 0,borderDash:void 0,borderDashOffset:void 0,borderShadowColor:void 0,borderWidth:void 0,display:void 0,fill:void 0,length:void 0,shadowBlur:void 0,shadowOffsetX:void 0,shadowOffsetY:void 0,width:void 0};dn.defaults={adjustScaleRange:true,arrowHeads:{display:false,end:Object.assign({},Ex),fill:false,length:12,start:Object.assign({},Ex),width:6},borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:2,curve:false,controlPoint:{y:"-50%"},display:true,endValue:void 0,init:void 0,label:{backgroundColor:"rgba(0,0,0,0.8)",backgroundShadowColor:"transparent",borderCapStyle:"butt",borderColor:"black",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderRadius:6,borderShadowColor:"transparent",borderWidth:0,callout:Object.assign({},cn.defaults.callout),color:"#fff",content:null,display:false,drawTime:void 0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:"bold"},height:void 0,opacity:void 0,padding:6,position:"center",rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,textAlign:"center",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,yAdjust:0,z:void 0},scaleID:void 0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,value:void 0,xMax:void 0,xMin:void 0,xScaleID:void 0,yMax:void 0,yMin:void 0,yScaleID:void 0,z:0};dn.descriptors={arrowHeads:{start:{_fallback:true},end:{_fallback:true},_fallback:true}};dn.defaultRoutes={borderColor:"color"};function R7(e,{mouseX:t,mouseY:o},n,{hBorderWidth:i,useFinalPosition:r}){let a=B7(t,o,e.getProps(["x","y","x2","y2"],r),n);return a.value>=a.start-i&&a.value<=a.end+i||xu(e,{mouseX:t,mouseY:o},r,n)}function D7({x:e,y:t,x2:o,y2:n},{top:i,right:r,bottom:a,left:s}){return !(e<s&&o<s||e>r&&o>r||t<i&&n<i||t>a&&n>a)}function Fx({x:e,y:t},o,{top:n,right:i,bottom:r,left:a}){return e<a&&(t=_x(a,{x:e,y:t},o),e=a),e>i&&(t=_x(i,{x:e,y:t},o),e=i),t<n&&(e=fu(n,{x:e,y:t},o),t=n),t>r&&(e=fu(r,{x:e,y:t},o),t=r),{x:e,y:t}}function N7(e,t,o){let{x:n,y:i}=Fx(e,t,o),{x:r,y:a}=Fx(t,e,o);return {x:n,y:i,x2:r,y2:a,width:Math.abs(r-n),height:Math.abs(a-i)}}function U7(e,{mouseX:t,mouseY:o},n=sn,i){let{x:r,y:a,x2:s,y2:l}=e.getProps(["x","y","x2","y2"],i),c=s-r,d=l-a,u=ur(c)+ur(d),p=u===0?-1:((t-r)*c+(o-a)*d)/u,h,m;return p<0?(h=r,m=a):p>1?(h=s,m=l):(h=r+p*c,m=a+p*d),ur(t-h)+ur(o-m)<=n}function xu(e,{mouseX:t,mouseY:o},n,i){let r=e.label;return r.options.display&&r.inRange(t,o,i,n)}function O7(e,t,o){let n=o.borderWidth,i=pt(o.padding),r=vu(e.ctx,o),a=r.width+i.width+n,s=r.height+i.height+n;return V7(t,o,{width:a,height:s,padding:i},e.chartArea)}function z7(e){let{x:t,y:o,x2:n,y2:i}=e,r=Math.atan2(i-o,n-t);return r>G/2?r-G:r<G/-2?r+G:r}function V7(e,t,o,n){let{width:i,height:r,padding:a}=o,{xAdjust:s,yAdjust:l}=t,c={x:e.x,y:e.y},d={x:e.x2,y:e.y2},u=t.rotation==="auto"?z7(e):gt(t.rotation),p=$7(i,r,u),h=H7(e,t,{labelSize:p,padding:a},n),m=e.cp?yu(c,e.cp,d,h):Mu(c,d,h),g={size:p.w,min:n.left,max:n.right,padding:a.left},f={size:p.h,min:n.top,max:n.bottom,padding:a.top},x=Bx(m.x,g)+s,b=Bx(m.y,f)+l;return {x:x-i/2,y:b-r/2,x2:x+i/2,y2:b+r/2,centerX:x,centerY:b,pointX:m.x,pointY:m.y,width:i,height:r,rotation:Qo(u)}}function $7(e,t,o){let n=Math.cos(o),i=Math.sin(o);return {w:Math.abs(e*n)+Math.abs(t*i),h:Math.abs(e*i)+Math.abs(t*n)}}function H7(e,t,o,n){let i,r=W7(e,n);return t.position==="start"?i=Lx({w:e.x2-e.x,h:e.y2-e.y},o,t,r):t.position==="end"?i=1-Lx({w:e.x-e.x2,h:e.y-e.y2},o,t,r):i=Tu(1,t.position),i}function Lx(e,t,o,n){let{labelSize:i,padding:r}=t,a=e.w*n.dx,s=e.h*n.dy,l=a>0&&(i.w/2+r.left-n.x)/a,c=s>0&&(i.h/2+r.top-n.y)/s;return Xs(Math.max(l,c),0,.25)}function W7(e,t){let{x:o,x2:n,y:i,y2:r}=e,a=Math.min(i,r)-t.top,s=Math.min(o,n)-t.left,l=t.bottom-Math.max(i,r),c=t.right-Math.max(o,n);return {x:Math.min(s,c),y:Math.min(a,l),dx:s<=c?1:-1,dy:a<=l?1:-1}}function Bx(e,t){let{size:o,min:n,max:i,padding:r}=t,a=o/2;return o>i-n?(i+n)/2:(n>=e-r-a&&(e=n+r+a),i<=e+r+a&&(e=i-r-a),e)}function Jx(e){let t=e.options,o=t.arrowHeads&&t.arrowHeads.start,n=t.arrowHeads&&t.arrowHeads.end;return {startOpts:o,endOpts:n,startAdjust:Rx(e,o),endAdjust:Rx(e,n)}}function Rx(e,t){if(!t||!t.display)return 0;let{length:o,width:n}=t,i=e.options.borderWidth/2,r={x:o,y:n+i};return Math.abs(fu(0,r,{x:0,y:i}))}function bu(e,t,o,n){if(!n||!n.display)return;let{length:i,width:r,fill:a,backgroundColor:s,borderColor:l}=n,c=Math.abs(t-i)+o;e.beginPath(),ii(e,n),_o(e,n),e.moveTo(c,-r),e.lineTo(t+o,0),e.lineTo(c,r),a===true?(e.fillStyle=s||l,e.closePath(),e.fill(),e.shadowColor="transparent"):e.shadowColor=n.borderShadowColor,e.stroke();}function G7(e,t,o){let{x:n,y:i,x2:r,y2:a,centerX:s,centerY:l}=e,c=Math.atan2(a-i,r-n),d=ku(t.controlPoint,0),u={x:s+vo(o,d.x,false),y:l+vo(o,d.y,false)};return pn(u,{x:s,y:l},c)}function Dx(e,{x:t,y:o},{angle:n,adjust:i},r){!r||!r.display||(e.save(),e.translate(t,o),e.rotate(n),bu(e,0,-i,r),e.restore());}function j7(e,t,o,n){let{x:i,y:r,x2:a,y2:s,options:l}=t,{startOpts:c,endOpts:d,startAdjust:u,endAdjust:p}=Jx(t),h={x:i,y:r},m={x:a,y:s},g=Ix(h,o,m,0),f=Ix(h,o,m,1)-G,x=yu(h,o,m,u/n),b=yu(h,o,m,1-p/n),T=new Path2D;e.beginPath(),T.moveTo(x.x,x.y),T.quadraticCurveTo(o.x,o.y,b.x,b.y),e.shadowColor=l.borderShadowColor,e.stroke(T),t.path=T,t.ctx=e,Dx(e,x,{angle:g,adjust:u},c),Dx(e,b,{angle:f,adjust:p},d);}var un=class extends xt{inRange(t,o,n,i){let r=this.options.rotation,a=this.options.borderWidth;if(n!=="x"&&n!=="y")return Y7({x:t,y:o},this.getProps(["width","height","centerX","centerY"],i),r,a);let{x:s,y:l,x2:c,y2:d}=this.getProps(["x","y","x2","y2"],i),u=a/2,p=n==="y"?{start:l,end:d}:{start:s,end:c},h=pn({x:t,y:o},this.getCenterPoint(i),gt(-r));return h[n]>=p.start-u-sn&&h[n]<=p.end+u+sn}getCenterPoint(t){return ni(this,t)}draw(t){let{width:o,height:n,centerX:i,centerY:r,options:a}=this;t.save(),wu(t,this.getCenterPoint(),a.rotation),ii(t,this.options),t.beginPath(),t.fillStyle=a.backgroundColor;let s=_o(t,a);t.ellipse(i,r,n/2,o/2,G/2,0,2*G),t.fill(),s&&(t.shadowColor=a.borderShadowColor,t.stroke()),t.restore();}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,o){return Xx(t,o,true)}};un.id="ellipseAnnotation";un.defaults={adjustScaleRange:true,backgroundShadowColor:"transparent",borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:1,display:true,init:void 0,label:Object.assign({},Ao.defaults.label),rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,xMax:void 0,xMin:void 0,xScaleID:void 0,yMax:void 0,yMin:void 0,yScaleID:void 0,z:0};un.defaultRoutes={borderColor:"color",backgroundColor:"color"};un.descriptors={label:{_fallback:true}};function Y7(e,t,o,n){let{width:i,height:r,centerX:a,centerY:s}=t,l=i/2,c=r/2;if(l<=0||c<=0)return false;let d=gt(o||0),u=n/2||0,p=Math.cos(d),h=Math.sin(d),m=Math.pow(p*(e.x-a)+h*(e.y-s),2),g=Math.pow(h*(e.x-a)-p*(e.y-s),2);return m/Math.pow(l+u,2)+g/Math.pow(c+u,2)<=1.0001}var ei=class extends xt{inRange(t,o,n,i){let{x:r,y:a,x2:s,y2:l,width:c}=this.getProps(["x","y","x2","y2","width"],i),d=this.options.borderWidth;if(n!=="x"&&n!=="y")return j8({x:t,y:o},this.getCenterPoint(i),c/2,d);let u=d/2,p=n==="y"?{start:a,end:l,value:o}:{start:r,end:s,value:t};return p.value>=p.start-u&&p.value<=p.end+u}getCenterPoint(t){return ni(this,t)}draw(t){let o=this.options,n=o.borderWidth;if(o.radius<.1)return;t.save(),t.fillStyle=o.backgroundColor,ii(t,o);let i=_o(t,o);t7(t,this,this.centerX,this.centerY),i&&!Ks(o.pointStyle)&&(t.shadowColor=o.borderShadowColor,t.stroke()),t.restore(),o.borderWidth=n;}resolveElementProperties(t,o){let n=Zx(t,o);return n.initProperties=pr(t,n,o,true),n}};ei.id="pointAnnotation";ei.defaults={adjustScaleRange:true,backgroundShadowColor:"transparent",borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:1,display:true,init:void 0,pointStyle:"circle",radius:10,rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,xAdjust:0,xMax:void 0,xMin:void 0,xScaleID:void 0,xValue:void 0,yAdjust:0,yMax:void 0,yMin:void 0,yScaleID:void 0,yValue:void 0,z:0};ei.defaultRoutes={borderColor:"color",backgroundColor:"color"};var oi=class extends xt{inRange(t,o,n,i){if(n!=="x"&&n!=="y")return this.options.radius>=.1&&this.elements.length>1&&X7(this.elements,t,o,i);let r=pn({x:t,y:o},this.getCenterPoint(i),gt(-this.options.rotation)),a=this.elements.map(c=>n==="y"?c.bY:c.bX),s=Math.min(...a),l=Math.max(...a);return r[n]>=s&&r[n]<=l}getCenterPoint(t){return ni(this,t)}draw(t){let{elements:o,options:n}=this;t.save(),t.beginPath(),t.fillStyle=n.backgroundColor,ii(t,n);let i=_o(t,n),r=true;for(let a of o)r?(t.moveTo(a.x,a.y),r=false):t.lineTo(a.x,a.y);t.closePath(),t.fill(),i&&(t.shadowColor=n.borderShadowColor,t.stroke()),t.restore();}resolveElementProperties(t,o){let n=Zx(t,o),{sides:i,rotation:r}=o,a=[],s=2*G/i,l=r*$i;for(let c=0;c<i;c++,l+=s){let d=Z7(n,o,l);d.initProperties=pr(t,n,o),a.push(d);}return n.elements=a,n}};oi.id="polygonAnnotation";oi.defaults={adjustScaleRange:true,backgroundShadowColor:"transparent",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderShadowColor:"transparent",borderWidth:1,display:true,init:void 0,point:{radius:0},radius:10,rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,sides:3,xAdjust:0,xMax:void 0,xMin:void 0,xScaleID:void 0,xValue:void 0,yAdjust:0,yMax:void 0,yMin:void 0,yScaleID:void 0,yValue:void 0,z:0};oi.defaultRoutes={borderColor:"color",backgroundColor:"color"};function Z7({centerX:e,centerY:t},{radius:o,borderWidth:n},i){let r=n/2,a=Math.sin(i),s=Math.cos(i),l={x:e+a*o,y:t-s*o};return {type:"point",optionScope:"point",properties:{x:l.x,y:l.y,centerX:l.x,centerY:l.y,bX:e+a*(o+r),bY:t-s*(o+r)}}}function X7(e,t,o,n){let i=false,r=e[e.length-1].getProps(["bX","bY"],n);for(let a of e){let s=a.getProps(["bX","bY"],n);s.bY>o!=r.bY>o&&t<(r.bX-s.bX)*(o-s.bY)/(r.bY-s.bY)+s.bX&&(i=!i),r=s;}return i}var wo={box:Ao,ellipse:un,label:cn,line:dn,point:ei,polygon:oi};Object.keys(wo).forEach(e=>{H.describe(`elements.${wo[e].id}`,{_fallback:"plugins.annotation.common"});});var K7={update:Object.assign},q7=Au.concat(Zs),Nx=(e,t)=>z(t)?Pu(e,t):e,Cu=e=>e==="color"||e==="font";function Iu(e="line"){return wo[e]?e:(console.warn(`Unknown annotation type: '${e}', defaulting to 'line'`),"line")}function Q7(e,t,o,n){let i=t9(e,o.animations,n),r=t.annotations,a=n9(t.elements,r);for(let s=0;s<r.length;s++){let l=r[s],c=tb(a,s,l.type),d=l.setContext(o9(e,c,l)),u=c.resolveElementProperties(e,d);u.skip=J7(u),"elements"in u&&(e9(c,u.elements,d,i),delete u.elements),st(c.x)||Object.assign(c,u),Object.assign(c,u.initProperties),u.options=eb(d),i.update(c,u);}}function J7(e){return isNaN(e.x)||isNaN(e.y)}function t9(e,t,o){return o==="reset"||o==="none"||o==="resize"?K7:new Wn(e,t)}function e9(e,t,o,n){let i=e.elements||(e.elements=[]);i.length=t.length;for(let r=0;r<t.length;r++){let a=t[r],s=a.properties,l=tb(i,r,a.type,a.initProperties),c=o[a.optionScope].override(a);s.options=eb(c),n.update(l,s);}}function tb(e,t,o,n){let i=wo[Iu(o)],r=e[t];return (!r||!(r instanceof i))&&(r=e[t]=new i,Object.assign(r,n)),r}function eb(e){let t=wo[Iu(e.type)],o={};o.id=e.id,o.type=e.type,o.drawTime=e.drawTime,Object.assign(o,Pu(e,t.defaults),Pu(e,t.defaultRoutes));for(let n of q7)o[n]=e[n];return o}function Pu(e,t){let o={};for(let n of Object.keys(t)){let i=t[n],r=e[n];Cu(n)&&Z(r)?o[n]=r.map(a=>Nx(a,i)):o[n]=Nx(r,i);}return o}function o9(e,t,o){return t.$context||(t.$context=Object.assign(Object.create(e.getContext()),{element:t,id:o.id,type:"annotation"}))}function n9(e,t){let o=t.length,n=e.length;if(n<o){let i=o-n;e.splice(n,0,...new Array(i));}else n>o&&e.splice(o,n-o);return e}var i9="2.2.1",ko=new Map,r9=Au.concat(Zs),ob={id:"annotation",version:i9,beforeRegister(){Y8("chart.js","3.7",Lt.version);},afterRegister(){Lt.register(wo);},afterUnregister(){Lt.unregister(wo);},beforeInit(e){ko.set(e,{annotations:[],elements:[],visibleElements:[],listeners:{},listened:false,moveListened:false,hooks:{},hooked:false,hovered:[]});},beforeUpdate(e,t,o){let n=ko.get(e),i=n.annotations=[],r=o.annotations;z(r)?Object.keys(r).forEach(a=>{let s=r[a];z(s)&&(s.id=a,i.push(s));}):Z(r)&&i.push(...r),b7(i,e.scales);},afterDataLimits(e,t){let o=ko.get(e);x7(e,t.scale,o.annotations.filter(n=>n.display&&n.adjustScaleRange));},afterUpdate(e,t,o){let n=ko.get(e);m7(e,n,o),Q7(e,n,o,t.mode),n.visibleElements=n.elements.filter(i=>!i.skip&&i.options.display),y7(e,n,o);},beforeDatasetsDraw(e,t,o){js(e,"beforeDatasetsDraw",o.clip);},afterDatasetsDraw(e,t,o){js(e,"afterDatasetsDraw",o.clip);},beforeDraw(e,t,o){js(e,"beforeDraw",o.clip);},afterDraw(e,t,o){js(e,"afterDraw",o.clip);},beforeEvent(e,t,o){let n=ko.get(e);h7(n,t.event,o)&&(t.changed=true);},afterDestroy(e){ko.delete(e);},_getState(e){return ko.get(e)},defaults:{animations:{numbers:{properties:["x","y","x2","y2","width","height","centerX","centerY","pointX","pointY","radius"],type:"number"}},clip:true,interaction:{mode:void 0,axis:void 0,intersect:void 0},common:{drawTime:"afterDatasetsDraw",init:false,label:{}}},descriptors:{_indexable:false,_scriptable:e=>!r9.includes(e)&&e!=="init",annotations:{_allKeys:false,_fallback:(e,t)=>`elements.${wo[Iu(t.type)].id}`},interaction:{_fallback:true},common:{label:{_indexable:Cu,_fallback:true},_indexable:Cu}},additionalOptionScopes:[""]};function js(e,t,o){let{ctx:n,chartArea:i}=e,r=ko.get(e);o&&xo(n,i);let a=a9(r.visibleElements,t).sort((s,l)=>s.element.options.z-l.element.options.z);for(let s of a)s9(n,i,r,s);o&&bo(n);}function a9(e,t){let o=[];for(let n of e)if(n.options.drawTime===t&&o.push({element:n,main:true}),n.elements&&n.elements.length)for(let i of n.elements)i.options.display&&i.options.drawTime===t&&o.push({element:i});return o}function s9(e,t,o,n){let i=n.element;n.main?(Tx(o,i,"beforeDraw"),i.draw(e,t),Tx(o,i,"afterDraw")):i.draw(e,t);}var Fu=Lt.version,l9=Fu?(e,t)=>e.parse(t):(e,t)=>t;function c9(e,t){let o=Kt(t)?parseFloat(t):l9(e,t);return e.getPixelForValue(o)}var nb=e=>e&&e.right>e.left&&e.bottom>e.top;function ib(e,t,o){return t==="r"?e.createRadialGradient(o.xCenter,o.yCenter,0,o.xCenter,o.yCenter,o.drawingArea):t==="y"?e.createLinearGradient(0,o.bottom,0,o.top):e.createLinearGradient(o.left,0,o.right,0)}function rb(e,t){t.forEach(function(o){e.addColorStop(o.stop,o.color.rgbString());});}function ab(e,t,o){if(e.options.has(t.key)){let i=e.options.get(t.key).filter(r=>r.datasetIndex===o);if(i.length)return i[0]}}function sb(e,t){if(e.type==="radialLinear"){let r=e.getDistanceFromCenterForValue(t);return {pixel:r,stop:r/e.drawingArea}}let o=e.options.reverse,n=c9(e,t),i=e.getDecimalForPixel(n);return {pixel:n,stop:o?1-i:i}}var Eu=e=>e<=.0031308?e*12.92:Math.pow(e,1/2.4)*1.055-.055,ri=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);function d9(e,t,o){let n=t.color.rgb,i=ri(n.r/255),r=ri(n.g/255),a=ri(n.b/255),s=o.color.rgb,l=ri(s.r/255),c=ri(s.g/255),d=ri(s.b/255);return tn({r:Math.round(Eu(i+e*(l-i))*255),g:Math.round(Eu(r+e*(c-r))*255),b:Math.round(Eu(a+e*(d-a))*255),a:n.a+e*Math.abs(s.a-n.a)})}function u9(e,t,o,n){let i=ab(e,t,o);if(!i||!i.stopColors.length)return;let{stop:r}=sb(i.scale,n),a,s;for(let l of i.stopColors){if(l.stop===r)return l.color;l.stop<r?a=l:l.stop>r&&!s&&(s=l);}return s?d9(r,a,s):a}var lb=[{key:"backgroundColor",legendItemKey:"fillStyle"},{key:"borderColor",legendItemKey:"strokeStyle"}],p9=(e,t)=>t.labels&&t.labels.font&&st(t.labels.font.size)?t.labels.font.size:e.options.font.size;function m9(e,t,o,n,i){let r=ab(e,o,n.datasetIndex);if(!r||!r.stopColors.length)return;let a=ib(t,r.axis,i);rb(a,r.stopColors),n[o.legendItemKey]=a;}function h9(e,{boxWidth:t,boxHeight:o}){return {top:e.top,left:e.left,bottom:e.top+o,right:e.left+t,xCenter:e.left+t/2,yCenter:e.top+o/2,drawingArea:Math.max(t,o)/2}}function g9(e,t,o,n){let i=e.legend.legendHitBoxes[o.datasetIndex],r=h9(i,n);nb(r)&&lb.forEach(function(a){m9(t,e.ctx,a,o,r);});}function f9(e,t,o,n){for(let i of e.legend.legendItems)lb.forEach(function(r){let a=o.data[i.index],s=u9(t,r,n,a);s&&s.valid&&(i[r.legendItemKey]=s.rgbString());});}function y9(e,t){let o=e.legend,n=o.options,i=n.labels.boxHeight?n.labels.boxHeight:p9(e,n),r=n.labels.boxWidth,a=e.data.datasets;for(let s=0;s<a.length;s++){let l=o.legendItems[s];l.datasetIndex===s?g9(e,t,l,{boxWidth:r,boxHeight:i}):f9(e,t,a[s],s);}}var qs=new Map,x9=Fu?(e,t)=>e[t+"Scale"]:(e,t)=>e.controller["_"+t+"Scale"];function b9(e,t,o){for(let n of Object.keys(t)){let{pixel:i,stop:r}=sb(e,n);if(isFinite(i)&&isFinite(r)){let a=tn(t[n]);a&&a.valid&&o.push({stop:Math.max(0,Math.min(1,r)),color:a});}}o.sort((n,i)=>n.stop-i.stop);}function C9(e,t,o,n){t[o]=n,e.dataset&&(e.dataset.options?e.dataset.options[o]=n:e.dataset[o]=n);}function P9(e,t,o,n){let i=e.options.get(o);return i?t.hidden||(i=i.filter(r=>r.datasetIndex!==n),e.options.set(o,i)):(i=[],e.options.set(o,i)),i}function S9(e,t,o,n,i){let r=e.ctx,a=e.getDatasetMeta(i);if(!a.hidden)for(let[s,l]of Object.entries(o)){let{axis:c,colors:d}=l;if(!d)continue;let u=x9(a,c);if(!u){console.warn(`Scale not found for '${c}'-axis in datasets[${i}] of chart id ${e.id}, skipping.`);continue}let p=P9(t,a,s,i),h={datasetIndex:i,axis:c,scale:u,stopColors:[]};p.push(h);let m=ib(r,c,u);b9(u,d,h.stopColors),h.stopColors.length&&(rb(m,h.stopColors),C9(a,n,s,m));}}var cb={id:"gradient",beforeInit(e){let t={};t.options=new Map,qs.set(e,t);},beforeDatasetsUpdate(e){let t=e.chartArea;if(!nb(t))return;let o=qs.get(e),n=e.data.datasets;for(let i=0;i<n.length;i++){let r=n[i],a=r.gradient;a&&S9(e,o,a,r,i);}},afterUpdate(e){let t=qs.get(e);e.legend&&e.legend.options.display!==false&&Fu&&y9(e,t);},destroy(e){qs.delete(e);}};var T9=[an,qn,Ke,rx,ax,ix,xx,Xe,ye,nx,Ze,ob,cb];Lt.register(...T9);var hb="label";function ub(e,t){typeof e=="function"?e(t):e&&(e.current=t);}function k9(e,t){Object.assign(e.options,t);}function gb(e,t){e.labels=t;}function fb(e,t){let o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:hb,n=[];e.datasets=t.map(i=>{let r=e.datasets.find(a=>a[o]===i[o]);return !r||!i.data||n.includes(r)?S({},i):(n.push(r),Object.assign(r,i),r)});}function w9(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:hb,o={labels:[],datasets:[]};return gb(o,e.labels),fb(o,e.datasets,t),o}function v9(e,t){let x=e,{height:o=150,width:n=300,redraw:i=false,datasetIdKey:r,type:a,data:s,options:l,plugins:c=[],fallbackContent:d,updateMode:u}=x,p=ot(x,["height","width","redraw","datasetIdKey","type","data","options","plugins","fallbackContent","updateMode"]),h=Fc.useRef(null),m=Fc.useRef(),g=()=>{h.current&&(m.current=new Lt(h.current,{type:a,data:w9(s,r),options:l&&S({},l),plugins:c}),ub(t,m.current));},f=()=>{ub(t,null),m.current&&(m.current.destroy(),m.current=null);};return Fc.useEffect(()=>{!i&&m.current&&l&&k9(m.current,l);},[i,l]),Fc.useEffect(()=>{!i&&m.current&&gb(m.current.config.data,s.labels);},[i,s.labels]),Fc.useEffect(()=>{!i&&m.current&&s.datasets&&fb(m.current.config.data,s.datasets,r);},[i,s.datasets]),Fc.useEffect(()=>{m.current&&(i?(f(),setTimeout(g)):m.current.update(u));},[i,l,s.labels,s.datasets,u]),Fc.useEffect(()=>{m.current&&(f(),setTimeout(g));},[a]),Fc.useEffect(()=>(g(),()=>f()),[]),Fc__default.default.createElement("canvas",Object.assign({ref:h,role:"img",height:o,width:n},p),d)}var _9=Fc.forwardRef(v9);function A9(e,t){return Lt.register(t),Fc.forwardRef((o,n)=>Fc__default.default.createElement(_9,Object.assign({},o,{ref:n,type:e})))}var yb=A9("bar",nn);function Qs(e){let t=D(),o=t==null?void 0:t.stigg,n=t==null?void 0:t.updatedAt,i=Fc.useCallback(()=>R(null,null,function*(){if(!o||!o.isCustomerLoaded)return null;try{let l={currencyId:e.currencyId,timeRange:e.timeRange};return yield o.getCreditUsage(l)}catch(l){throw console.error(l),l}}),[o,e.currencyId,e.timeRange,n]),{data:r,error:a,isLoading:s}=Ut({func:i});return Fc.useMemo(()=>({creditUsage:r,isLoading:s,error:a}),[r,a,s])}var xb={id:"redrawBeforeFirstDrawPlugin",beforeDraw(e){e.$rendered||(e.$rendered=true,e.update("none"));}};var Lu=(e,t=1)=>{let o=Math.round(t*255).toString(16).padStart(2,"0");return `${e}${o}`};var Bu=e=>e.palette.text.secondary,Ru=e=>e.palette.outlinedBorder,Du=e=>({family:e.typography.fontFamily,size:parseInt(e.typography.body.fontSize)});function Nu(e){let t=["#4caf50","#2196f3","#ff5722","#ff9800","#e91e63","#3f51b5","#00bcd4","#81c784","#64b5f6","#ff8a65","#ffb74d","#f06292","#7986cb","#4dd0e1","#a5d6a7","#90caf9","#ffab91","#ffcc80","#f48fb1","#9fa8da","#80deea"];return t[e%t.length]}function E9(e){let t=[],o=new Date;switch(e){case ah.CreditUsageTimeRange.LastDay:{let n=new Date(o);n.setHours(n.getHours()-23),n.setMinutes(0,0,0);for(let i=0;i<24;i++){let r=new Date(n);r.setHours(r.getHours()+i),t.push(r.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"}));}break}case ah.CreditUsageTimeRange.LastWeek:{for(let n=6;n>=0;n--){let i=new Date(o);i.setDate(i.getDate()-n),t.push(i.toLocaleDateString("en-US",{month:"short",day:"2-digit"}));}break}case ah.CreditUsageTimeRange.LastYear:{for(let n=11;n>=0;n--){let i=new Date(o);i.setMonth(i.getMonth()-n),t.push(i.toLocaleDateString("en-US",{month:"short",year:"2-digit"}));}break}case ah.CreditUsageTimeRange.LastMonth:default:{for(let n=29;n>=0;n--){let i=new Date(o);i.setDate(i.getDate()-n),t.push(i.toLocaleDateString("en-US",{month:"short",day:"2-digit"}));}break}}return t}function F9(e,t){let o=new Date(e);switch(o.setMinutes(0,0,0),t){case ah.CreditUsageTimeRange.LastDay:return o.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"});case ah.CreditUsageTimeRange.LastYear:return e.toLocaleDateString("en-US",{month:"short",year:"2-digit"});case ah.CreditUsageTimeRange.LastWeek:case ah.CreditUsageTimeRange.LastMonth:default:return e.toLocaleDateString("en-US",{month:"short",day:"2-digit"})}}function L9(e,t){return {responsive:true,maintainAspectRatio:false,interaction:{mode:"point",intersect:true},elements:{bar:{borderRadius:4,borderSkipped:"bottom"}},plugins:{legend:{display:false},tooltip:{enabled:false,external:t},datalabels:{display:false}},scales:{x:{type:"category",stacked:true,ticks:{color:Bu(e),font:Du(e),maxRotation:45,maxTicksLimit:15},grid:{color:Ru(e),drawOnChartArea:false,drawTicks:false}},y:{type:"linear",stacked:true,beginAtZero:true,ticks:{color:Bu(e),font:Du(e),callback:o=>ft(Number(o))},grid:{color:Lu(Ru(e),.5),drawOnChartArea:true,drawTicks:false,borderDash:[5,5]}}}}}function bb(e,t,o,n){let i=E9(n);if(!e||!e.series||e.series.length===0)return {data:null,options:null};let r=e.series.map((l,c)=>{let d=l.featureName,u=new Map;l.points.forEach(m=>{let g=F9(new Date(m.timestamp),n),f=u.get(g)||0;u.set(g,f+m.value);});let p=i.map(m=>u.get(m)||0),h=Nu(c);return {label:d,data:p,backgroundColor:Lu(h,.8),borderColor:h,borderWidth:1}}).reverse(),a={labels:i,datasets:r},s=L9(t,o);return {data:a,options:s}}var O9=300;function Pb(e,t){let o=t.dataPoints[0],n=o.parsed.y,i=e.scales.y,r=n/i.max*(i.bottom-i.top),a=t.caretY+r/2,s=e.getDatasetMeta(o.datasetIndex).data[o.dataIndex],l=s.x-s.width/2,c=e.canvas.offsetTop+a,d=e.canvas.offsetLeft+l;return {top:c,left:d}}function z9(e,t){let o=e.canvas.offsetTop+t.caretY,n=e.canvas.offsetLeft+t.caretX;return {top:o,left:n}}function Sb(e,t=z9){let[o,n]=Fc.useState(0),[i,r]=Fc.useState(0),[a,s]=Fc.useState(false),[l,c]=Fc.useState(),d=Fc.useCallback(p=>{let{chart:h,tooltip:m}=p;if(m.opacity===0){s(false);return}let{top:g,left:f}=t(h,m);r(f),n(g),c(e(m)),s(true);},[e,t]);return {tooltipInfo:{positionTop:o,positionLeft:i,isOpen:a,payload:l},tooltipHandler:d}}var V9=y(material.Box)`
1019
- position: absolute;
1020
- `,$9=y.div`
1021
- position: absolute;
1022
- background-color: white;
1023
- border-radius: 8px;
1024
- box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
1025
- padding: ${({$padding:e=16})=>e}px;
1026
- max-width: 500px;
1027
- z-index: 1000;
1028
- pointer-events: none;
1029
- opacity: ${({$isOpen:e})=>e?1:0};
1030
- transition: opacity 0.2s ease-in-out;
1031
- transform: translateY(-50%); /* Center vertically on the anchor point */
1032
-
1033
- &::before {
1034
- content: '';
1035
- position: absolute;
1036
- width: 0;
1037
- height: 0;
1038
- border: 8px solid transparent;
1039
- border-left-color: white;
1040
- right: -16px;
1041
- top: 50%;
1042
- transform: translateY(-50%);
1043
- filter: drop-shadow(2px 0 2px rgba(0, 0, 0, 0.1));
1044
- }
1045
- `,Tb=({children:e,tooltipInfo:{positionTop:t,positionLeft:o,payload:n,isOpen:i},$padding:r})=>{let[a,s]=Fc.useState(false),[l,c]=Fc.useState(false),d=Fc.useRef(U9__default.default(()=>c(false),O9));return Fc.useEffect(()=>{n&&(a||i)?(d.current.cancel(),c(true)):d.current();},[n,a,i]),jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(V9,{style:{top:t,left:o}}),jsxRuntime.jsx($9,{$isOpen:l,$padding:r,style:{top:t,left:o-140},onMouseEnter:()=>s(true),onMouseLeave:()=>s(false),children:e})]})};var j9=y.div`
1046
- width: 3px;
1047
- margin-right: 15px;
1048
- `;function wb({tooltipInfo:e}){if(!e.payload)return jsxRuntime.jsx(jsxRuntime.Fragment,{});let{featureName:t,usage:o,date:n,color:i}=e.payload;return jsxRuntime.jsx(Tb,{tooltipInfo:e,placement:"top",$padding:16,children:jsxRuntime.jsxs("div",{style:{display:"flex",flexDirection:"row",gap:8},className:"stigg-credit-usage-chart-tooltip",children:[jsxRuntime.jsx(j9,{style:{backgroundColor:i,marginTop:2}}),jsxRuntime.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:2},children:[jsxRuntime.jsx(P,{variant:"body1",color:"secondary",children:n}),jsxRuntime.jsx(P,{variant:"body1",color:"primary",children:t}),jsxRuntime.jsxs("div",{style:{display:"flex",flexDirection:"row",gap:4,alignItems:"center"},children:[jsxRuntime.jsx(P,{variant:"body1",color:"primary",children:ft(o)}),jsxRuntime.jsx(P,{variant:"body1",color:"primary",children:"Credits"})]})]})]})})}function vb(){let e=Fc.useCallback(t=>{if(lodash.isEmpty(t.dataPoints)||lodash.isEmpty(t.labelColors))return;let o=t.dataPoints[0],n=t.labelColors[0];if(!o||!n)return;let i=o.dataset.label||"Unknown Feature",r=o.parsed.y||0,a=o.label||"",s=n.backgroundColor;return {featureName:i,usage:r,date:a,color:s}},[]);return Sb(e,Pb)}var Z9=y.div`
1049
- padding: 8px;
1050
- margin: 0 12px;
1051
- `,X9=y.div`
1052
- display: flex;
1053
- align-items: center;
1054
- `,K9=y.div`
1055
- flex: 1;
1056
- position: relative;
1057
- align-items: center;
1058
- display: flex;
1059
- `,q9=y.div`
1060
- height: 24px;
1061
- width: ${({$width:e,$minContentWidth:t})=>{let o=Math.min(e,100),n=Math.max(t,80);return `max(${o}%, ${n}px)`}};
1062
- background-color: #f5f6f9;
1063
- border-radius: 4px;
1064
- position: relative;
1065
- display: flex;
1066
- align-items: center;
1067
- justify-content: space-between;
1068
- padding: 0 8px;
1069
- `,Q9=y.div`
1070
- width: 12px;
1071
- height: 12px;
1072
- border-radius: 2px;
1073
- background-color: ${({$color:e})=>e};
1074
- margin-right: 8px;
1075
- flex-shrink: 0;
1076
- `,J9=y.div`
1077
- margin-right: 24px;
1078
- flex-shrink: 0;
1079
- overflow: hidden;
1080
- text-overflow: ellipsis;
1081
- white-space: nowrap;
1082
- `;function _b({creditUsageData:e}){var i,r;if(!e||!e.series||e.series.length===0)return null;let t=e.series.map((a,s)=>{let l=a.featureId,c=a.featureName,d=a.totalCredits,u=Nu(s);return {featureId:l,featureName:c,totalCredits:d,color:u}}).sort((a,s)=>s.totalCredits-a.totalCredits),o=Math.max(...t.map(a=>a.totalCredits)),n=(a,s)=>{let l=Math.min(a.length*7,200),c=ft(s).length*8;return 20+l+16+c+16};return jsxRuntime.jsxs(Z9,{className:"stigg-credit-usage-chart-legend",children:[jsxRuntime.jsxs("div",{style:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center"},children:[jsxRuntime.jsx(P,{style:{marginBottom:12},variant:"body1",color:"secondary",className:"stigg-credit-usage-chart-legend-title",children:"Top sources"}),jsxRuntime.jsx(P,{variant:"caption",color:"disabled",className:"stigg-credit-usage-chart-legend-title-currency-units",children:(r=(i=e.currency)==null?void 0:i.units)==null?void 0:r.plural})]}),jsxRuntime.jsx("div",{style:{display:"flex",flexDirection:"column",gap:12},children:t.map(a=>{let s=o>0?a.totalCredits/o*100:0,l=n(a.featureName,a.totalCredits);return jsxRuntime.jsx(X9,{className:`stigg-credit-usage-chart-legend-item stigg-credit-usage-chart-legend-item-${a.featureId}`,children:jsxRuntime.jsx(K9,{className:"stigg-credit-usage-chart-legend-bar-container",children:jsxRuntime.jsxs(q9,{$width:s,$minContentWidth:l,children:[jsxRuntime.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[jsxRuntime.jsx(Q9,{$color:a.color}),jsxRuntime.jsx(J9,{className:"stigg-credit-usage-chart-legend-feature-name",children:jsxRuntime.jsx(P,{variant:"body1",color:"primary",className:"stigg-credit-usage-chart-legend-feature-name-text",children:a.featureName})})]}),jsxRuntime.jsx(P,{variant:"caption",color:"primary",bold:true,className:"stigg-credit-usage-chart-legend-value",children:ft(a.totalCredits)})]})})},a.featureId)})})]})}var tA=y.div`
1083
- display: flex;
1084
- flex-direction: column;
1085
- justify-content: center;
1086
- align-items: center;
1087
- height: 100%;
1088
- `,eA=y(mt)`
1089
- svg {
1090
- width: 32px;
1091
- height: 32px;
1092
- }
1093
- `;function Mb(){return jsxRuntime.jsxs(tA,{className:"stigg-credit-usage-chart-empty-state",children:[jsxRuntime.jsx(eA,{icon:"PayAsYouGoCharge",style:{display:"flex"}}),jsxRuntime.jsx(P,{variant:"body1",color:"primary",bold:true,children:"No Usage Recorded"})]})}var nA=y.div`
1094
- display: flex;
1095
- justify-content: center;
1096
- align-items: center;
1097
- height: 100%;
1098
- `;function Eb(){return jsxRuntime.jsx(nA,{className:"stigg-credit-usage-chart-error-state",children:jsxRuntime.jsx(P,{variant:"body1",color:"error",children:"Failed to load credit usage"})})}var Fb=[{value:ah.CreditUsageTimeRange.LastDay,label:"Last 24 Hours"},{value:ah.CreditUsageTimeRange.LastWeek,label:"Last 7 Days"},{value:ah.CreditUsageTimeRange.LastMonth,label:"Last 30 Days"},{value:ah.CreditUsageTimeRange.LastYear,label:"Last 12 Months"}],sA=y(material.Select)`
1099
- border-radius: 10px;
1100
- height: 38px;
1101
- min-width: 150px;
1102
-
1103
- &:hover .MuiOutlinedInput-notchedOutline {
1104
- border-color: ${({theme:e})=>e.stigg.palette.outlinedBorder};
1105
- }
1106
- `,lA=y(material.OutlinedInput)`
1107
- & .MuiInputBase-input {
1108
- padding: 10px 12px;
1109
- }
1110
-
1111
- &.Mui-focused .MuiOutlinedInput-notchedOutline {
1112
- border-color: ${({theme:e})=>e.stigg.palette.primary} !important;
1113
- }
1114
- `;function Lb({isLoading:e,totalCredits:t,selectedTimeRange:o,setSelectedTimeRange:n,error:i,localization:r,currencyUnit:a}){return jsxRuntime.jsxs("div",{className:"stigg-credit-usage-chart-header",style:{display:"flex",flexDirection:"row",marginBottom:16,justifyContent:"space-between"},children:[jsxRuntime.jsxs("div",{style:{display:"flex",flexDirection:"row",gap:8,alignItems:"center"},children:[jsxRuntime.jsx(P,{variant:"h3",color:"primary",className:"stigg-credit-usage-chart-title",children:r.title}),e?jsxRuntime.jsx(dt,{width:100,height:24}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(P,{variant:"h6",color:"secondary",className:"stigg-credit-usage-chart-total",children:"|"}),jsxRuntime.jsxs(P,{variant:"h6",color:"secondary",className:"stigg-credit-usage-chart-total",children:[r.totalSpend,": ",ft(t||0)," ",a||""]})]})]}),!e&&!i&&jsxRuntime.jsx(sA,{className:"stigg-credit-usage-chart-time-range-select",value:o,input:jsxRuntime.jsx(lA,{}),onChange:s=>n(s.target.value),renderValue:s=>{var l;return jsxRuntime.jsxs(P,{variant:"body1",color:"primary",children:[((l=Fb.find(c=>c.value===s))==null?void 0:l.label)||""," "]})},children:Fb.map(s=>jsxRuntime.jsx(material.MenuItem,{value:s.value,children:jsxRuntime.jsx(P,{variant:"body1",color:"primary",children:s.label})},s.value))})]})}var pA=y.div`
1115
- display: flex;
1116
- flex-direction: column;
1117
- gap: 8px;
1118
- `,mA=y.div`
1119
- align-items: center;
1120
- justify-content: center;
1121
- min-height: 480px;
1122
- display: flex;
1123
- flex-direction: column;
1124
- gap: 8px;
1125
- padding: 16px;
1126
- border-radius: 8px;
1127
- border: 1px solid ${({theme:e})=>{var t,o;return ((o=(t=e==null?void 0:e.stigg)==null?void 0:t.palette)==null?void 0:o.outlinedBorder)||"#e0e0e0"}};
1128
- 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)||"#ffffff"}};
1129
- `,hA=y(ro__default.default)`
1130
- border-radius: 4px;
1131
- height: 400px;
1132
- width: 100%;
1133
- `;function Rb({currencyId:e,timeRange:t,localization:o}){var b,T;let n=Vo(),i=D({optional:true}),r=i==null?void 0:i.stigg,a=S(S({},m1),o),[s,l]=Fc.useState(t),{creditUsage:c,isLoading:d,error:u}=Qs({currencyId:e,timeRange:s}),{tooltipInfo:p,tooltipHandler:h}=vb(),{data:m,options:g}=Fc.useMemo(()=>bb(c||null,n,h,s),[c,n,h,s]),f=Fc.useMemo(()=>(c==null?void 0:c.series.reduce((k,w)=>k+w.totalCredits,0))||0,[c]),x=(T=(b=c==null?void 0:c.currency)==null?void 0:b.units)==null?void 0:T.plural;return jsxRuntime.jsx(ht,{componentTheme:n,children:jsxRuntime.jsxs(pA,{className:"stigg-credit-usage-chart-container",children:[jsxRuntime.jsx(mA,{className:"stigg-credit-usage-chart-card",children:jsxRuntime.jsxs("div",{style:{width:"100%"},children:[jsxRuntime.jsx(Lb,{isLoading:d,totalCredits:f,selectedTimeRange:s,setSelectedTimeRange:l,error:u,localization:a,currencyUnit:x}),jsxRuntime.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[jsxRuntime.jsx("div",{style:{height:"400px",position:"relative"},children:d?jsxRuntime.jsx(hA,{className:"stigg-credit-usage-chart-skeleton"}):u?jsxRuntime.jsx(Eb,{}):(c==null?void 0:c.series.length)===0?jsxRuntime.jsx(Mb,{}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(wb,{tooltipInfo:p}),jsxRuntime.jsx(yb,{className:"stigg-credit-usage-chart-bar",data:m!=null?m:{labels:[],datasets:[]},options:g!=null?g:{},plugins:[xb]})]})}),!d&&jsxRuntime.jsx(_b,{creditUsageData:c})]})]})}),jsxRuntime.jsx(Jt,{source:"credit_usage_chart",align:"end",smallScreenAlign:"end",style:{marginTop:0},showWatermark:r==null?void 0:r.getShowWatermark()})]})})}var fA=(e,t,o)=>o==="primary"?t.palette.primary:e>=100?t.palette.progress.high:e>=75?t.palette.progress.medium:t.palette.progress.low,yA=y.div`
886
+ `;function wp({currencyId:e,localization:t,decimalPlaces:o,showUnits:r=true,showSymbol:n=false,onAddCredits:i}){let s=fe(ee),l=chunkMY4ZIUAV_cjs_js.u({optional:true}),a=l==null?void 0:l.theme,{balance:c,isLoading:u,error:f}=et({currencyId:e}),{title:p,addCredits:h}=chunkMY4ZIUAV_cjs_js.a(chunkMY4ZIUAV_cjs_js.a({},chunkMY4ZIUAV_cjs_js.F),t),g=jsxRuntime.jsx(Qb,{className:"stigg-credit-balance-container",children:jsxRuntime.jsxs(Kb,{className:"stigg-credit-balance-card",children:[jsxRuntime.jsxs(Lt,{children:[jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.f,{variant:"h6",color:"primary",className:"stigg-credit-balance-title",children:p}),i&&c&&!f&&jsxRuntime.jsxs(Nt,{type:"button",onClick:()=>i(c),className:"stigg-credit-balance-add-credits-button",children:[jsxRuntime.jsx(Nr,{className:"stigg-credit-balance-add-credits-icon"}),h]})]}),jsxRuntime.jsx(kp,{balance:c,isLoading:u,error:f,decimalPlaces:o,showUnits:r,showSymbol:n})]})});return s?g:jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.w,{componentTheme:a,children:g})}var Xb=ii.lazy(()=>import('./CreditUsageChart-Z2VEQGTE.cjs.js').then(e=>({default:e.CreditUsageChart})));function Ap(e){return jsxRuntime.jsx(ii.Suspense,{fallback:null,children:jsxRuntime.jsx(Xb,chunkMY4ZIUAV_cjs_js.a({},e))})}var jb=(e,t,o)=>o==="primary"?t.palette.primary:e>=100?t.palette.progress.high:e>=75?t.palette.progress.medium:t.palette.progress.low,eS=chunkMY4ZIUAV_cjs_js.e.div`
1134
887
  width: 100%;
1135
888
  height: 8px;
1136
889
  background-color: ${({theme:e})=>e.stigg.palette.progress.background};
1137
890
  border-radius: 4px;
1138
891
  overflow: hidden;
1139
- `,xA=y.div`
892
+ `,tS=chunkMY4ZIUAV_cjs_js.e.div`
1140
893
  height: 100%;
1141
894
  width: ${({percentage:e})=>Math.max(0,Math.min(100,e))}%;
1142
- background-color: ${({theme:e,percentage:t,variant:o})=>fA(t,e.stigg,o)};
895
+ background-color: ${({theme:e,percentage:t,variant:o})=>jb(t,e.stigg,o)};
1143
896
  border-radius: 4px;
1144
897
  transition: width 0.3s ease-in-out;
1145
- `;function ol({percentage:e,className:t,variant:o="utilization"}){return jsxRuntime.jsx(yA,{className:t,children:jsxRuntime.jsx(xA,{percentage:e,variant:o})})}var CA=y.div`
898
+ `;function Mr({percentage:e,className:t,variant:o="utilization"}){return jsxRuntime.jsx(eS,{className:t,children:jsxRuntime.jsx(tS,{percentage:e,variant:o})})}var rS=chunkMY4ZIUAV_cjs_js.e.div`
1146
899
  display: flex;
1147
900
  flex-direction: row;
1148
901
  justify-content: space-between;
1149
902
  align-items: baseline;
1150
903
  width: 100%;
1151
- `,PA=y.div`
904
+ `,nS=chunkMY4ZIUAV_cjs_js.e.div`
1152
905
  display: flex;
1153
906
  flex-direction: row;
1154
907
  gap: 4px;
1155
908
  align-items: baseline;
1156
- `,SA=y.div`
909
+ `,iS=chunkMY4ZIUAV_cjs_js.e.div`
1157
910
  display: flex;
1158
911
  flex-direction: row;
1159
912
  gap: 4px;
1160
913
  align-items: baseline;
1161
- `,TA=({totalConsumed:e,totalGranted:t})=>{let o=Ha(e!=null?e:0,t!=null?t:0);return jsxRuntime.jsx(ol,{percentage:o,className:"stigg-credit-utilization-progress"})};function Nb({balance:e,isLoading:t,error:o,decimalPlaces:n=null,showUnits:i=true,showSymbol:r=false,remainingLabel:a=Ga.remaining}){if(o)return jsxRuntime.jsx(P,{variant:"body1",color:"error",className:"stigg-credit-utilization-value-error",children:o.message||"Failed to load balance"});if(t)return jsxRuntime.jsx(ro__default.default,{width:280,height:24,className:"stigg-credit-utilization-value-loading"});if(e){let{currentBalance:s,totalConsumed:l,totalGranted:c}=e,d=$a(e,i,r);return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(CA,{children:[jsxRuntime.jsxs(PA,{children:[jsxRuntime.jsx(P,{variant:"h3",color:"primary",bold:true,className:"stigg-credit-utilization-usage",children:mo(l,n)}),jsxRuntime.jsx(P,{variant:"h3",color:"primary",className:"stigg-credit-utilization-separator",children:"/"}),jsxRuntime.jsx(P,{variant:"h3",color:"primary",className:"stigg-credit-utilization-total",children:mo(c,n)}),jsxRuntime.jsx(P,{variant:"caption",color:"secondary",className:"stigg-credit-utilization-suffix",children:d})]}),jsxRuntime.jsxs(SA,{children:[jsxRuntime.jsx(P,{variant:"caption",color:"secondary",className:"stigg-credit-utilization-remaining-label",children:a}),jsxRuntime.jsx(P,{variant:"caption",color:"primary",bold:true,className:"stigg-credit-utilization-remaining-value",children:mo(s,n)})]})]}),jsxRuntime.jsx(TA,{totalConsumed:e.totalConsumed,totalGranted:e.totalGranted}),jsxRuntime.jsx(Wa,{usagePeriodEnd:e.usagePeriodEnd,className:"stigg-credit-utilization-reset-period"})]})}return jsxRuntime.jsx(P,{variant:"body1",color:"disabled",className:"stigg-credit-utilization-value-no-balance",children:"No balance data available"})}var wA=y.div`
914
+ `,aS=({totalConsumed:e,totalGranted:t})=>{let o=Er(e!=null?e:0,t!=null?t:0);return jsxRuntime.jsx(Mr,{percentage:o,className:"stigg-credit-utilization-progress"})};function Fp({balance:e,isLoading:t,error:o,decimalPlaces:r=null,showUnits:n=true,showSymbol:i=false,remainingLabel:s=chunkMY4ZIUAV_cjs_js.G.remaining}){if(o)return jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.f,{variant:"body1",color:"error",className:"stigg-credit-utilization-value-error",children:o.message||"Failed to load balance"});if(t)return jsxRuntime.jsx(Qe__default.default,{width:280,height:24,className:"stigg-credit-utilization-value-loading"});if(e){let{currentBalance:l,totalConsumed:a,totalGranted:c}=e,u=vr(e,n,i);return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(rS,{children:[jsxRuntime.jsxs(nS,{children:[jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.f,{variant:"h3",color:"primary",bold:true,className:"stigg-credit-utilization-usage",children:tt(a,r)}),jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.f,{variant:"h3",color:"primary",className:"stigg-credit-utilization-separator",children:"/"}),jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.f,{variant:"h3",color:"primary",className:"stigg-credit-utilization-total",children:tt(c,r)}),jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.f,{variant:"caption",color:"secondary",className:"stigg-credit-utilization-suffix",children:u})]}),jsxRuntime.jsxs(iS,{children:[jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.f,{variant:"caption",color:"secondary",className:"stigg-credit-utilization-remaining-label",children:s}),jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.f,{variant:"caption",color:"primary",bold:true,className:"stigg-credit-utilization-remaining-value",children:tt(l,r)})]})]}),jsxRuntime.jsx(aS,{totalConsumed:e.totalConsumed,totalGranted:e.totalGranted}),jsxRuntime.jsx(Lr,{usagePeriodEnd:e.usagePeriodEnd,className:"stigg-credit-utilization-reset-period"})]})}return jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.f,{variant:"body1",color:"disabled",className:"stigg-credit-utilization-value-no-balance",children:"No balance data available"})}var lS=chunkMY4ZIUAV_cjs_js.e.div`
1162
915
  display: flex;
1163
916
  flex-direction: column;
1164
917
  gap: 8px;
1165
918
  width: 100%;
1166
- `,vA=y.div`
919
+ `,cS=chunkMY4ZIUAV_cjs_js.e.div`
1167
920
  display: flex;
1168
921
  flex-direction: column;
1169
922
  gap: 16px;
@@ -1172,7 +925,7 @@
1172
925
  border: 1px solid ${({theme:e})=>{var t,o;return (o=(t=e.stigg)==null?void 0:t.palette)==null?void 0:o.outlinedBorder}};
1173
926
  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}};
1174
927
  min-height: 90px;
1175
- `;function Ub({currencyId:e,localization:t,decimalPlaces:o,showUnits:n=true,showSymbol:i=false,onAddCredits:r}){let a=jt(St),s=D({optional:true}),l=s==null?void 0:s.theme,{balance:c,isLoading:d,error:u}=po({currencyId:e}),{title:p,remaining:h,addCredits:m}=S(S({},Ga),t),g=jsxRuntime.jsx(wA,{className:"stigg-credit-utilization-container",children:jsxRuntime.jsxs(vA,{className:"stigg-credit-utilization-card",children:[jsxRuntime.jsxs(Bn,{children:[jsxRuntime.jsx(P,{variant:"h6",color:"primary",className:"stigg-credit-utilization-title",children:p}),r&&c&&!u&&jsxRuntime.jsxs(Rn,{type:"button",onClick:()=>r(c),className:"stigg-credit-utilization-add-credits-button",children:[jsxRuntime.jsx(ja,{className:"stigg-credit-utilization-add-credits-icon"}),m]})]}),jsxRuntime.jsx(Nb,{balance:c,isLoading:d,error:u,decimalPlaces:o,showUnits:n,showSymbol:i,remainingLabel:h})]})});return a?g:jsxRuntime.jsx(ht,{componentTheme:l,children:g})}function il(e){let t=D(),o=t==null?void 0:t.stigg,n=t==null?void 0:t.updatedAt,i=Fc.useCallback(()=>R(null,null,function*(){if(!o||!o.isCustomerLoaded)return null;try{return o.getCreditGrants({currencyId:e.currencyId,paging:e.paging})}catch(l){throw console.error("Error fetching credit grants:",l),l}}),[o,e.currencyId,e.paging,n]),{data:r,error:a,isLoading:s}=Ut({func:i});return Fc.useMemo(()=>({creditGrants:(r==null?void 0:r.data)||[],paging:r==null?void 0:r.pageInfo,totalCount:r==null?void 0:r.totalCount,isLoading:s,error:a}),[r,a,s])}function zu({skeletonRows:e,visibleHeadCells:t,hideLastRowBorder:o}){return jsxRuntime.jsx(jsxRuntime.Fragment,{children:Array.from({length:e}).map((n,i)=>jsxRuntime.jsx(material.TableRow,{children:t.map(r=>jsxRuntime.jsx(li,{$alignment:r.alignment,$width:r.width,$maxWidth:r.maxWidth,$minWidth:r.minWidth,$isLastRow:i===e-1,$hideLastRowBorder:o,children:jsxRuntime.jsx(ro__default.default,{width:r.width?parseInt(r.width.replace("px",""))-40:100,height:20})},String(r.id)))},i))})}function Vu({data:e,visibleHeadCells:t,onRowClick:o,hideLastRowBorder:n}){return jsxRuntime.jsx(jsxRuntime.Fragment,{children:e.map((i,r)=>jsxRuntime.jsx($u,{$clickable:!!o,onClick:()=>o&&o(i),children:t.map(a=>jsxRuntime.jsx(li,{$alignment:a.alignment,$width:a.width,$maxWidth:a.maxWidth,$minWidth:a.minWidth,$isLastRow:r===e.length-1,$hideLastRowBorder:n,onClick:a.disableClick?s=>s.stopPropagation():void 0,children:jsxRuntime.jsx(Hu,{$alignment:a.alignment,children:a.render(i)})},String(a.id)))},r))})}function sl({errorMessage:e,className:t}){return e===void 0||typeof e=="string"?jsxRuntime.jsx(P,{variant:"body1",color:"error",className:t,children:e||"An error occurred"}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:e})}function ll({message:e,className:t}){return e===void 0||typeof e=="string"?jsxRuntime.jsx(P,{variant:"body1",color:"secondary",className:t,children:e||"No data available"}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:e})}var $A=y(material.TableContainer)`
928
+ `;function vp({currencyId:e,localization:t,decimalPlaces:o,showUnits:r=true,showSymbol:n=false,onAddCredits:i}){let s=fe(ee),l=chunkMY4ZIUAV_cjs_js.u({optional:true}),a=l==null?void 0:l.theme,{balance:c,isLoading:u,error:f}=et({currencyId:e}),{title:p,remaining:h,addCredits:g}=chunkMY4ZIUAV_cjs_js.a(chunkMY4ZIUAV_cjs_js.a({},chunkMY4ZIUAV_cjs_js.G),t),y=jsxRuntime.jsx(lS,{className:"stigg-credit-utilization-container",children:jsxRuntime.jsxs(cS,{className:"stigg-credit-utilization-card",children:[jsxRuntime.jsxs(Lt,{children:[jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.f,{variant:"h6",color:"primary",className:"stigg-credit-utilization-title",children:p}),i&&c&&!f&&jsxRuntime.jsxs(Nt,{type:"button",onClick:()=>i(c),className:"stigg-credit-utilization-add-credits-button",children:[jsxRuntime.jsx(Nr,{className:"stigg-credit-utilization-add-credits-icon"}),g]})]}),jsxRuntime.jsx(Fp,{balance:c,isLoading:u,error:f,decimalPlaces:o,showUnits:r,showSymbol:n,remainingLabel:h})]})});return s?y:jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.w,{componentTheme:a,children:y})}function Ur(e){let t=chunkMY4ZIUAV_cjs_js.u(),o=t==null?void 0:t.stigg,r=t==null?void 0:t.updatedAt,n=ii.useCallback(()=>chunkMY4ZIUAV_cjs_js.d(null,null,function*(){if(!o||!o.isCustomerLoaded)return null;try{return o.getCreditGrants({currencyId:e.currencyId,paging:e.paging})}catch(a){throw console.error("Error fetching credit grants:",a),a}}),[o,e.currencyId,e.paging,r]),{data:i,error:s,isLoading:l}=chunkMY4ZIUAV_cjs_js.B({func:n});return ii.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:s}),[i,s,l])}function Gi({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(Rt,{$alignment:i.alignment,$width:i.width,$maxWidth:i.maxWidth,$minWidth:i.minWidth,$isLastRow:n===e-1,$hideLastRowBorder:o,children:jsxRuntime.jsx(Qe__default.default,{width:i.width?parseInt(i.width.replace("px",""))-40:100,height:20})},String(i.id)))},n))})}function zi({data:e,visibleHeadCells:t,onRowClick:o,hideLastRowBorder:r}){return jsxRuntime.jsx(jsxRuntime.Fragment,{children:e.map((n,i)=>jsxRuntime.jsx(Vi,{$clickable:!!o,onClick:()=>o&&o(n),children:t.map(s=>jsxRuntime.jsx(Rt,{$alignment:s.alignment,$width:s.width,$maxWidth:s.maxWidth,$minWidth:s.minWidth,$isLastRow:i===e.length-1,$hideLastRowBorder:r,onClick:s.disableClick?l=>l.stopPropagation():void 0,children:jsxRuntime.jsx(Hi,{$alignment:s.alignment,children:s.render(n)})},String(s.id)))},i))})}function $r({errorMessage:e,className:t}){return e===void 0||typeof e=="string"?jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.f,{variant:"body1",color:"error",className:t,children:e||"An error occurred"}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:e})}function Gr({message:e,className:t}){return e===void 0||typeof e=="string"?jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.f,{variant:"body1",color:"secondary",className:t,children:e||"No data available"}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:e})}var wS=chunkMY4ZIUAV_cjs_js.e(material.TableContainer)`
1176
929
  border-radius: 8px;
1177
930
  border: 1px solid ${({theme:e})=>e.stigg.palette.outlinedBorder};
1178
931
  background-color: ${({theme:e})=>e.stigg.palette.backgroundPaper};
@@ -1185,13 +938,13 @@
1185
938
  align-items: center;
1186
939
  justify-content: center;
1187
940
  `}
1188
- `,HA=y(material.Table)`
941
+ `,BS=chunkMY4ZIUAV_cjs_js.e(material.Table)`
1189
942
  min-width: 600px;
1190
943
  table-layout: auto;
1191
944
  width: 100%;
1192
- `,WA=y(material.Divider)`
945
+ `,AS=chunkMY4ZIUAV_cjs_js.e(material.Divider)`
1193
946
  border-color: ${({theme:e})=>e.stigg.palette.outlinedBorder};
1194
- `,li=y(material.TableCell)`
947
+ `,Rt=chunkMY4ZIUAV_cjs_js.e(material.TableCell)`
1195
948
  padding: 8px 12px;
1196
949
  border-bottom: 1px solid ${({theme:e})=>e.stigg.palette.outlinedBorder};
1197
950
  text-align: ${({$alignment:e})=>e||"left"};
@@ -1204,38 +957,38 @@
1204
957
  ${({$minWidth:e})=>e&&`min-width: ${e};`}
1205
958
 
1206
959
  ${({$isLastRow:e,$hideLastRowBorder:t})=>e&&t&&"border-bottom: none;"}
1207
- `,GA=y(li)`
960
+ `,IS=chunkMY4ZIUAV_cjs_js.e(Rt)`
1208
961
  background-color: transparent;
1209
- `,$u=y(material.TableRow)`
962
+ `,Vi=chunkMY4ZIUAV_cjs_js.e(material.TableRow)`
1210
963
  ${({$clickable:e,theme:t})=>e&&`
1211
964
  cursor: pointer;
1212
965
  &:hover {
1213
966
  background-color: ${t.stigg.palette.backgroundHighlight};
1214
967
  }
1215
968
  `}
1216
- `,Hu=y.div`
969
+ `,Hi=chunkMY4ZIUAV_cjs_js.e.div`
1217
970
  display: flex;
1218
971
  align-items: center;
1219
972
  justify-content: ${({$alignment:e})=>{switch(e){case "center":return "center";case "right":return "flex-end";default:return "flex-start"}}};
1220
973
  width: 100%;
1221
- `,jA=y(material.TablePagination)`
974
+ `,FS=chunkMY4ZIUAV_cjs_js.e(material.TablePagination)`
1222
975
  color: ${({theme:e})=>e.stigg.palette.text.secondary};
1223
- `;function YA({visibleHeadCells:e}){return jsxRuntime.jsx(material.TableHead,{children:jsxRuntime.jsx(material.TableRow,{children:e.map(t=>jsxRuntime.jsx(GA,{$alignment:t.alignment,$width:t.width,$maxWidth:t.maxWidth,$minWidth:t.minWidth,children:jsxRuntime.jsx(P,{variant:"caption",children:t.label})},String(t.id)))})})}function cl({data:e,headCells:t,isLoading:o=false,error:n=null,emptyMessage:i,errorMessage:r,onRowClick:a,className:s,skeletonRows:l=3,hideLastRowBorder:c=true,pageSize:d,pageNum:u,totalCount:p,onPageChange:h}){let m=t.filter(f=>f.visible!==false),g=!!n||!o&&e.length===0;return jsxRuntime.jsx($A,{className:s,$hasMinHeight:g,children:n?jsxRuntime.jsx(sl,{errorMessage:r,className:`${s}-error`}):!o&&e.length===0?jsxRuntime.jsx(ll,{message:i,className:`${s}-empty`}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(HA,{children:[jsxRuntime.jsx(YA,{visibleHeadCells:m}),jsxRuntime.jsx(material.TableBody,{children:o?jsxRuntime.jsx(zu,{skeletonRows:l,visibleHeadCells:m,hideLastRowBorder:c}):jsxRuntime.jsx(Vu,{data:e,visibleHeadCells:m,onRowClick:a,hideLastRowBorder:c})})]}),!!(e!=null&&e.length)&&h&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(WA,{}),jsxRuntime.jsx(jA,{component:"div",rowsPerPage:d!=null?d:e.length,rowsPerPageOptions:[d!=null?d:e.length],count:p!=null?p:e.length,page:u!=null?u:1,onPageChange:h,labelDisplayedRows:({from:f,to:x,count:b})=>`${At(f)}-${At(x)} of ${b!==-1?At(b):`more than ${At(x)}`}`})]})]})})}var XA=y(material.Chip)`
976
+ `;function vS({visibleHeadCells:e}){return jsxRuntime.jsx(material.TableHead,{children:jsxRuntime.jsx(material.TableRow,{children:e.map(t=>jsxRuntime.jsx(IS,{$alignment:t.alignment,$width:t.width,$maxWidth:t.maxWidth,$minWidth:t.minWidth,children:jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.f,{variant:"caption",children:t.label})},String(t.id)))})})}function zr({data:e,headCells:t,isLoading:o=false,error:r=null,emptyMessage:n,errorMessage:i,onRowClick:s,className:l,skeletonRows:a=3,hideLastRowBorder:c=true,pageSize:u,pageNum:f,totalCount:p,onPageChange:h}){let g=t.filter(C=>C.visible!==false),y=!!r||!o&&e.length===0;return jsxRuntime.jsx(wS,{className:l,$hasMinHeight:y,children:r?jsxRuntime.jsx($r,{errorMessage:i,className:`${l}-error`}):!o&&e.length===0?jsxRuntime.jsx(Gr,{message:n,className:`${l}-empty`}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(BS,{children:[jsxRuntime.jsx(vS,{visibleHeadCells:g}),jsxRuntime.jsx(material.TableBody,{children:o?jsxRuntime.jsx(Gi,{skeletonRows:a,visibleHeadCells:g,hideLastRowBorder:c}):jsxRuntime.jsx(zi,{data:e,visibleHeadCells:g,onRowClick:s,hideLastRowBorder:c})})]}),!!(e!=null&&e.length)&&h&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(AS,{}),jsxRuntime.jsx(FS,{component:"div",rowsPerPage:u!=null?u:e.length,rowsPerPageOptions:[u!=null?u:e.length],count:p!=null?p:e.length,page:f!=null?f:1,onPageChange:h,labelDisplayedRows:({from:C,to:b,count:x})=>`${ie(C)}-${ie(b)} of ${x!==-1?ie(x):`more than ${ie(b)}`}`})]})]})})}var LS=chunkMY4ZIUAV_cjs_js.e(tb__default.default)`
1224
977
  font-size: 0.75rem;
1225
978
  height: 24px;
1226
979
  border-radius: 4px;
1227
980
  border: none;
1228
- background-color: ${({theme:e,$variant:t})=>{var o,n,i,r;return (r=(i=(n=(o=e==null?void 0:e.stigg)==null?void 0:o.palette)==null?void 0:n.statusChips)==null?void 0:i[t])==null?void 0:r.background}};
1229
- color: ${({theme:e,$variant:t})=>{var o,n,i,r;return (r=(i=(n=(o=e==null?void 0:e.stigg)==null?void 0:o.palette)==null?void 0:n.statusChips)==null?void 0:i[t])==null?void 0:r.text}};
1230
- `;function gr(r){var a=r,{variant:e,label:t,className:o,size:n="small"}=a,i=ot(a,["variant","label","className","size"]);return jsxRuntime.jsx(XA,S({label:t,size:n,$variant:e,className:o},i))}function Hb(e){let t=fc__default.default(),o=fc__default.default(e.effectiveAt),n=e.expireAt?fc__default.default(e.expireAt):null;return o.isAfter(t)?"SCHEDULED":n&&n.isBefore(t)?"EXPIRED":"AVAILABLE"}function Wb(e,t){return console.log("decimalPlaces",t),`${mo(e.consumedAmount,t)} / ${e.amount}`}var Yu=e=>{switch(e){case "AVAILABLE":return "success";case "SCHEDULED":return "warning";case "EXPIRED":return "error";default:return "neutral"}},Gb=e=>{if(e.automaticRechargeConfigurationId)return "Automatic recharge";switch(e.grantType){case ah.CreditGrantType.Promotional:return "Promotional";case ah.CreditGrantType.Paid:return "Top-up";case ah.CreditGrantType.Recurring:return "Recurring";default:return "Unknown"}};function jb({creditGrants:e,isLoading:t,error:o,localization:n,decimalPlaces:i,pageSize:r,pageNum:a,totalCount:s,onPageChange:l}){let c=e.map(u=>A(S({},u),{status:Hb(u)})),d=[{id:"effectiveAt",label:n.receivedAt,width:"205px",render:({effectiveAt:u})=>jsxRuntime.jsx(P,{variant:"body1",className:"stigg-credit-grants-effective-date",children:yc(u)})},{id:"grantType",label:n.grantType,width:"205px",render:u=>jsxRuntime.jsx(P,{variant:"body1",className:"stigg-credit-grants-grant-type",children:Gb(u)})},{id:"status",label:n.status,width:"205px",render:({status:u})=>{let p=lodash.capitalize(u),h=Yu(u);return jsxRuntime.jsx(gr,{label:p,variant:h,className:"stigg-credit-grants-status-chip"})}},{id:"amount",label:n.balance,width:"205px",render:u=>jsxRuntime.jsx(P,{variant:"body1",className:"stigg-credit-grants-balance",children:Wb(u,i)})},{id:"expireAt",label:n.expiryDate,width:"205px",render:({expireAt:u})=>jsxRuntime.jsx(P,{variant:"body1",className:"stigg-credit-grants-expiry-date",children:u?xc(u):"-"})}];return jsxRuntime.jsx(cl,{data:c,headCells:d,isLoading:t,error:o,emptyMessage:n.emptyState,loadingMessage:n.loadingState,errorMessage:n.errorState,className:"stigg-credit-grants-table",skeletonRows:(c==null?void 0:c.length)||3,pageNum:a,pageSize:r,totalCount:s,onPageChange:l})}var Zb=(e,t,o)=>{let[n,i]=Fc.useState(0),[r,a]=Fc.useState(0);return {pageNumber:r,lastVisitedPage:n,pageChangeFunc:(l,c)=>{let d=c>r?{after:e==null?void 0:e.endCursor,first:o}:{before:e==null?void 0:e.startCursor,last:o};t(d),i(r),a(c);}}};var tM=10,eM=y.div`
981
+ 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
+ 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 ao(i){var s=i,{variant:e,label:t,className:o,size:r="small"}=s,n=chunkMY4ZIUAV_cjs_js.c(s,["variant","label","className","size"]);return jsxRuntime.jsx(LS,chunkMY4ZIUAV_cjs_js.a({label:t,size:r,$variant:e,className:o},n))}function Rp(e){let t=Q(),o=Q(e.effectiveAt),r=e.expireAt?Q(e.expireAt):null;return o.isAfter(t)?"SCHEDULED":r&&r.isBefore(t)?"EXPIRED":"AVAILABLE"}function Up(e,t){return `${tt(e.consumedAmount,t)} / ${e.amount}`}var Zi=e=>{switch(e){case "AVAILABLE":return "success";case "SCHEDULED":return "warning";case "EXPIRED":return "error";default:return "neutral"}},_p=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 Dp({creditGrants:e,isLoading:t,error:o,localization:r,decimalPlaces:n,pageSize:i,pageNum:s,totalCount:l,onPageChange:a}){let c=e.map(f=>chunkMY4ZIUAV_cjs_js.b(chunkMY4ZIUAV_cjs_js.a({},f),{status:Rp(f)})),u=[{id:"effectiveAt",label:r.receivedAt,width:"205px",render:({effectiveAt:f})=>jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.f,{variant:"body1",className:"stigg-credit-grants-effective-date",children:On(f)})},{id:"grantType",label:r.grantType,width:"205px",render:f=>jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.f,{variant:"body1",className:"stigg-credit-grants-grant-type",children:_p(f)})},{id:"status",label:r.status,width:"205px",render:({status:f})=>{let p=RS__default.default(f),h=Zi(f);return jsxRuntime.jsx(ao,{label:p,variant:h,className:"stigg-credit-grants-status-chip"})}},{id:"amount",label:r.balance,width:"205px",render:f=>jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.f,{variant:"body1",className:"stigg-credit-grants-balance",children:Up(f,n)})},{id:"expireAt",label:r.expiryDate,width:"205px",render:({expireAt:f})=>jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.f,{variant:"body1",className:"stigg-credit-grants-expiry-date",children:f?Wn(f):"-"})}];return jsxRuntime.jsx(zr,{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:s,pageSize:i,totalCount:l,onPageChange:a})}var Gp=(e,t,o)=>{let[r,n]=ii.useState(0),[i,s]=ii.useState(0);return {pageNumber:i,lastVisitedPage:r,pageChangeFunc:(a,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),s(c);}}};var _S=10,DS=chunkMY4ZIUAV_cjs_js.e.div`
1231
984
  display: flex;
1232
985
  flex-direction: column;
1233
986
  gap: 8px;
1234
- `,oM=y.div`
987
+ `,$S=chunkMY4ZIUAV_cjs_js.e.div`
1235
988
  display: flex;
1236
989
  flex-direction: column;
1237
990
  gap: 16px;
1238
- `;function Xb({currencyId:e,localization:t,decimalPlaces:o,pageSize:n=tM}){let i=D({optional:true}),r=i==null?void 0:i.stigg,a=i==null?void 0:i.theme,s=S(S({},p1),t),[l,c]=Fc.useState({first:n}),{creditGrants:d,isLoading:u,error:p,paging:h,totalCount:m}=il({currencyId:e,pageSize:n,paging:l}),{pageNumber:g,pageChangeFunc:f}=Zb(h,c,n);return jsxRuntime.jsx(ht,{componentTheme:a,children:jsxRuntime.jsxs(eM,{className:"stigg-credit-grants-container",children:[jsxRuntime.jsx(oM,{className:"stigg-credit-grants-card",children:jsxRuntime.jsx(jb,{creditGrants:d,isLoading:u,error:p,localization:s,decimalPlaces:o,pageSize:n,pageNum:g,totalCount:m,onPageChange:f})}),jsxRuntime.jsx(Jt,{source:"grant_list",align:"end",smallScreenAlign:"end",style:{marginTop:0},showWatermark:r==null?void 0:r.getShowWatermark()})]})})}var Kb=y.div`
991
+ `;function zp({currencyId:e,localization:t,decimalPlaces:o,pageSize:r=_S}){let n=chunkMY4ZIUAV_cjs_js.u({optional:true}),i=n==null?void 0:n.stigg,s=n==null?void 0:n.theme,l=chunkMY4ZIUAV_cjs_js.a(chunkMY4ZIUAV_cjs_js.a({},chunkMY4ZIUAV_cjs_js.H),t),[a,c]=ii.useState({first:r}),{creditGrants:u,isLoading:f,error:p,paging:h,totalCount:g}=Ur({currencyId:e,pageSize:r,paging:a}),{pageNumber:y,pageChangeFunc:C}=Gp(h,c,r);return jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.w,{componentTheme:s,children:jsxRuntime.jsxs(DS,{className:"stigg-credit-grants-container",children:[jsxRuntime.jsx($S,{className:"stigg-credit-grants-card",children:jsxRuntime.jsx(Dp,{creditGrants:u,isLoading:f,error:p,localization:l,decimalPlaces:o,pageSize:r,pageNum:y,totalCount:g,onPageChange:C})}),jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.q,{source:"grant_list",align:"end",smallScreenAlign:"end",style:{marginTop:0},showWatermark:i==null?void 0:i.getShowWatermark()})]})})}var Vp=chunkMY4ZIUAV_cjs_js.e.div`
1239
992
  display: flex;
1240
993
  flex-direction: column;
1241
994
  gap: 16px;
@@ -1244,16 +997,16 @@
1244
997
  border: 1px solid ${({theme:e})=>{var t,o;return (o=(t=e.stigg)==null?void 0:t.palette)==null?void 0:o.outlinedBorder}};
1245
998
  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}};
1246
999
  min-height: 90px;
1247
- `;var qb=y.div`
1000
+ `;var Hp=chunkMY4ZIUAV_cjs_js.e.div`
1248
1001
  display: flex;
1249
1002
  align-items: center;
1250
1003
  gap: 4px;
1251
- `;var Zu=y.div`
1004
+ `;var Yi=chunkMY4ZIUAV_cjs_js.e.div`
1252
1005
  display: flex;
1253
1006
  flex-direction: column;
1254
1007
  gap: 4px;
1255
1008
  width: 100%;
1256
- `;var Qb=y.div`
1009
+ `;var Op=chunkMY4ZIUAV_cjs_js.e.div`
1257
1010
  display: flex;
1258
1011
  align-items: center;
1259
1012
  justify-content: center;
@@ -1261,26 +1014,26 @@
1261
1014
  min-height: 60px;
1262
1015
  border: 1px dashed ${({theme:e})=>{var t,o;return (o=(t=e.stigg)==null?void 0:t.palette)==null?void 0:o.outlinedBorder}};
1263
1016
  border-radius: 8px;
1264
- `;function ul(e){let t=D(),o=t==null?void 0:t.stigg,n=t==null?void 0:t.updatedAt,i=Fc.useCallback(()=>R(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 l={customerId:e.customerId,currencyId:e.currencyId};return yield o.getAutomaticRechargeConfiguration(l)}catch(l){throw console.error("Error fetching automatic recharge configuration:",l),l}}),[o,e.customerId,e.currencyId,n]),{data:r,error:a,isLoading:s}=Ut({func:i});return {config:r,isLoading:s,error:a}}function Jb({customerId:e,currencyId:t}){let{config:o,isLoading:n,error:i}=ul({customerId:e,currencyId:t}),r=Fc.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?Ha(o.currentMonthlySpend||0,o.maxSpendLimit):0,s=true,l=s&&o.isEnabled;return {isConfigured:s,isEnabled:o.isEnabled,thresholdValue:o.thresholdValue||0,targetBalance:o.targetBalance||0,currentMonthlySpend:o.currentMonthlySpend||0,maxSpendLimit:o.maxSpendLimit||0,spendPercentage:a,showActiveState:l}},[o]);return A(S({},r),{isLoading:n,error:i})}var tC=y(Kb)`
1017
+ `;function Hr(e){let t=chunkMY4ZIUAV_cjs_js.u(),o=t==null?void 0:t.stigg,r=t==null?void 0:t.updatedAt,n=ii.useCallback(()=>chunkMY4ZIUAV_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 a={customerId:e.customerId,currencyId:e.currencyId};return yield o.getAutomaticRechargeConfiguration(a)}catch(a){throw console.error("Error fetching automatic recharge configuration:",a),a}}),[o,e.customerId,e.currencyId,r]),{data:i,error:s,isLoading:l}=chunkMY4ZIUAV_cjs_js.B({func:n});return {config:i,isLoading:l,error:s}}function Wp({customerId:e,currencyId:t}){let{config:o,isLoading:r,error:n}=Hr({customerId:e,currencyId:t}),i=ii.useMemo(()=>{if(!o)return {isConfigured:false,isEnabled:false,thresholdValue:0,targetBalance:0,currentMonthlySpend:0,maxSpendLimit:0,spendPercentage:0,showActiveState:false};let s=o.maxSpendLimit&&o.maxSpendLimit>0?Er(o.currentMonthlySpend||0,o.maxSpendLimit):0,l=true,a=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:s,showActiveState:a}},[o]);return chunkMY4ZIUAV_cjs_js.b(chunkMY4ZIUAV_cjs_js.a({},i),{isLoading:r,error:n})}var Zp=chunkMY4ZIUAV_cjs_js.e(Vp)`
1265
1018
  width: 406px;
1266
1019
  box-shadow: 0px 1px 1px 0px rgba(0, 0, 0, 0.05);
1267
1020
  box-sizing: border-box;
1268
- `,eC=y.div`
1021
+ `,Yp=chunkMY4ZIUAV_cjs_js.e.div`
1269
1022
  display: flex;
1270
1023
  align-items: center;
1271
1024
  justify-content: flex-start;
1272
- `;function oC(e,t){return e?Object.entries(t).reduce((o,[n,i])=>{let r=new RegExp(`{{\\s*${n}\\s*}}`,"g"),s=String(i!=null?i:"").replace(/\$/g,"$$$$");return o.replace(r,s)},e):""}function nC({customerId:e,currencyId:t,currencyUnit:o="Credits",billingCurrency:n="$",onManageClick:i,className:r,localization:a}){let{thresholdValue:s,targetBalance:l,currentMonthlySpend:c,maxSpendLimit:d,spendPercentage:u,showActiveState:p,isLoading:h,error:m}=Jb({customerId:e,currencyId:t}),g=S(S({},h1),a&&Object.fromEntries(Object.entries(a).filter(([b,T])=>T!==void 0))),f=oC(g.descriptionTemplate,{target:di(l),unit:o,threshold:di(s)}),x=oC(g.spendTemplate,{currency:n,current:di(c),limit:di(d)});return m?jsxRuntime.jsx(tC,{className:`stigg-auto-recharge-status stigg-auto-recharge-status-error ${r||""}`,children:jsxRuntime.jsx(P,{variant:"body1",color:"error",children:m.message||"Failed to load auto-recharge status"})}):jsxRuntime.jsxs(tC,{className:`stigg-auto-recharge-status ${r||""}`,children:[jsxRuntime.jsxs(Bn,{children:[jsxRuntime.jsxs(qb,{children:[jsxRuntime.jsx(P,{variant:"h6",color:"primary",className:"stigg-auto-recharge-title",children:g.title}),!h&&p&&jsxRuntime.jsx(gr,{variant:"success",label:g.activeLabel,className:"stigg-auto-recharge-status-chip",size:"small"})]}),h?jsxRuntime.jsx(ro__default.default,{width:70,height:38,borderRadius:10}):jsxRuntime.jsx(Rn,{type:"button",onClick:i,className:"stigg-auto-recharge-manage-button","aria-label":`${g.manageButton} auto-recharge settings`,children:g.manageButton})]}),h?jsxRuntime.jsxs(Zu,{children:[jsxRuntime.jsx(ro__default.default,{width:"100%",height:20}),jsxRuntime.jsx(ro__default.default,{width:"100%",height:8,borderRadius:0}),jsxRuntime.jsx(eC,{children:jsxRuntime.jsx(ro__default.default,{width:200,height:16})})]}):p?jsxRuntime.jsxs(Zu,{children:[jsxRuntime.jsx(P,{variant:"body1",color:"primary",className:"stigg-auto-recharge-description",children:f}),jsxRuntime.jsx(ol,{percentage:u,variant:"primary",className:"stigg-auto-recharge-progress"}),jsxRuntime.jsx(eC,{children:jsxRuntime.jsx(P,{variant:"caption",color:"tertiary",className:"stigg-auto-recharge-spend",children:d>0?x:g.unlimitedSpendLimit})})]}):jsxRuntime.jsx(Qb,{className:"stigg-auto-recharge-empty",children:jsxRuntime.jsx(P,{variant:"caption",color:"tertiary",className:"stigg-auto-recharge-empty-text",children:g.emptyStateMessage})})]})}var aM=y.div`
1025
+ `;function Qp(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 Kp({customerId:e,currencyId:t,currencyUnit:o="Credits",billingCurrency:r="$",onManageClick:n,className:i,localization:s}){let{thresholdValue:l,targetBalance:a,currentMonthlySpend:c,maxSpendLimit:u,spendPercentage:f,showActiveState:p,isLoading:h,error:g}=Wp({customerId:e,currencyId:t}),y=chunkMY4ZIUAV_cjs_js.a(chunkMY4ZIUAV_cjs_js.a({},chunkMY4ZIUAV_cjs_js.J),s&&Object.fromEntries(Object.entries(s).filter(([x,S])=>S!==void 0))),C=Qp(y.descriptionTemplate,{target:Dt(a),unit:o,threshold:Dt(l)}),b=Qp(y.spendTemplate,{currency:r,current:Dt(c),limit:Dt(u)});return g?jsxRuntime.jsx(Zp,{className:`stigg-auto-recharge-status stigg-auto-recharge-status-error ${i||""}`,children:jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.f,{variant:"body1",color:"error",children:g.message||"Failed to load auto-recharge status"})}):jsxRuntime.jsxs(Zp,{className:`stigg-auto-recharge-status ${i||""}`,children:[jsxRuntime.jsxs(Lt,{children:[jsxRuntime.jsxs(Hp,{children:[jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.f,{variant:"h6",color:"primary",className:"stigg-auto-recharge-title",children:y.title}),!h&&p&&jsxRuntime.jsx(ao,{variant:"success",label:y.activeLabel,className:"stigg-auto-recharge-status-chip",size:"small"})]}),h?jsxRuntime.jsx(Qe__default.default,{width:70,height:38,borderRadius:10}):jsxRuntime.jsx(Nt,{type:"button",onClick:n,className:"stigg-auto-recharge-manage-button","aria-label":`${y.manageButton} auto-recharge settings`,children:y.manageButton})]}),h?jsxRuntime.jsxs(Yi,{children:[jsxRuntime.jsx(Qe__default.default,{width:"100%",height:20}),jsxRuntime.jsx(Qe__default.default,{width:"100%",height:8,borderRadius:0}),jsxRuntime.jsx(Yp,{children:jsxRuntime.jsx(Qe__default.default,{width:200,height:16})})]}):p?jsxRuntime.jsxs(Yi,{children:[jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.f,{variant:"body1",color:"primary",className:"stigg-auto-recharge-description",children:C}),jsxRuntime.jsx(Mr,{percentage:f,variant:"primary",className:"stigg-auto-recharge-progress"}),jsxRuntime.jsx(Yp,{children:jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.f,{variant:"caption",color:"tertiary",className:"stigg-auto-recharge-spend",children:u>0?b:y.unlimitedSpendLimit})})]}):jsxRuntime.jsx(Op,{className:"stigg-auto-recharge-empty",children:jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.f,{variant:"caption",color:"tertiary",className:"stigg-auto-recharge-empty-text",children:y.emptyStateMessage})})]})}var HS=chunkMY4ZIUAV_cjs_js.e.div`
1273
1026
  display: flex;
1274
1027
  flex-direction: column;
1275
1028
  gap: 8px;
1276
1029
  width: 100%;
1277
- `;function iC(e){let t=jt(St),o=D({optional:true}),n=o==null?void 0:o.theme,i=jsxRuntime.jsx(aM,{className:"stigg-auto-recharge-status-container",children:jsxRuntime.jsx(nC,S({},e))});return t?i:jsxRuntime.jsx(ht,{componentTheme:n,children:i})}function rC(e){return f2__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 Io(e,t={},o){var a,s,l,c;let n={};if(!e.enabled)return n;let i=parseFloat(e.thresholdAmount);!e.thresholdAmount||e.thresholdAmount.trim()===""?n.thresholdAmount=o.thresholdRequired||"Threshold amount is required":isNaN(i)?n.thresholdAmount="Threshold must be a valid number":i<0?n.thresholdAmount=o.thresholdMin||"Threshold must be at least 0":t.poolSize!==void 0&&i>=t.poolSize&&(n.thresholdAmount=((a=o.thresholdMax)==null?void 0:a.replace("{{max}}",String(t.poolSize)))||`Threshold must be less than ${t.poolSize}`);let r=parseFloat(e.targetBalance);if(!e.targetBalance||e.targetBalance.trim()===""?n.targetBalance=o.targetRequired||"Target balance is required":isNaN(r)?n.targetBalance="Target balance must be a valid number":!isNaN(i)&&r<=i?n.targetBalance=o.targetMin||"Target balance must be greater than threshold":t.poolSize!==void 0&&r>t.poolSize&&(n.targetBalance=((s=o.targetMax)==null?void 0:s.replace("{{max}}",String(t.poolSize)))||`Target balance cannot exceed ${t.poolSize}`),e.maxSpendLimit&&e.maxSpendLimit.trim()!==""){let d=parseFloat(e.maxSpendLimit);isNaN(d)?n.maxSpendLimit="Spend limit must be a valid number":d<=0?n.maxSpendLimit=o.spendLimitPositive||"Spend limit must be greater than 0":t.minSpendLimit!==void 0&&d<t.minSpendLimit?n.maxSpendLimit=((l=o.spendLimitMin)==null?void 0:l.replace("{{min}}",String(t.minSpendLimit)))||`Spend limit must be at least ${t.minSpendLimit}`:t.maxSpendLimit!==void 0&&d>t.maxSpendLimit&&(n.maxSpendLimit=((c=o.spendLimitMax)==null?void 0:c.replace("{{max}}",String(t.maxSpendLimit)))||`Spend limit cannot exceed ${t.maxSpendLimit}`);}return n}function ml({initialData:e,poolSize:t,localization:o}){var f,x,b,T,k,w,v,_,M,I,F,E,B,O;let[n,i]=Fc.useState({enabled:(f=e==null?void 0:e.enabled)!=null?f:false,thresholdAmount:(b=(x=e==null?void 0:e.thresholdAmount)==null?void 0:x.toString())!=null?b:"",targetBalance:(k=(T=e==null?void 0:e.targetBalance)==null?void 0:T.toString())!=null?k:"",maxSpendLimit:(v=(w=e==null?void 0:e.maxSpendLimit)==null?void 0:w.toString())!=null?v:""}),[r,a]=Fc.useState({thresholdAmount:true,targetBalance:true,maxSpendLimit:true}),s=Io({enabled:(_=e==null?void 0:e.enabled)!=null?_:false,thresholdAmount:(I=(M=e==null?void 0:e.thresholdAmount)==null?void 0:M.toString())!=null?I:"",targetBalance:(E=(F=e==null?void 0:e.targetBalance)==null?void 0:F.toString())!=null?E:"",maxSpendLimit:(O=(B=e==null?void 0:e.maxSpendLimit)==null?void 0:B.toString())!=null?O:""},{poolSize:t},o),[l,c]=Fc.useState(s);return {formData:n,errors:l,touched:r,handleEnabledChange:U=>{let L=U.target.checked;if(i(V=>A(S({},V),{enabled:L})),!L)c({}),a({});else {let V=Io(A(S({},n),{enabled:true}),{poolSize:t},o);c(V),a({thresholdAmount:true,targetBalance:true,maxSpendLimit:true});}},handleFieldChange:U=>L=>{let V=L.target.value,J=A(S({},n),{[U]:V});i(J),a(tt=>A(S({},tt),{[U]:true}));let Bt=Io(J,{poolSize:t},o);c(Bt);},handleFieldBlur:U=>()=>{a(V=>A(S({},V),{[U]:true}));let L=Io(n,{poolSize:t},o);c(L);},getFieldError:U=>r[U]?l[U]:void 0,validate:()=>{let U=Io(n,{poolSize:t},o);return c(U),n.enabled&&a({thresholdAmount:true,targetBalance:true,maxSpendLimit:true}),Object.keys(U).length===0},getFormValues:()=>{var U,L,V;return {enabled:n.enabled,thresholdAmount:(U=n.thresholdAmount)!=null&&U.trim()?parseFloat(n.thresholdAmount.trim()):void 0,targetBalance:(L=n.targetBalance)!=null&&L.trim()?parseFloat(n.targetBalance.trim()):void 0,maxSpendLimit:(V=n.maxSpendLimit)!=null&&V.trim()?parseFloat(n.maxSpendLimit.trim()):void 0}}}}var yr=y.div`
1030
+ `;function qp(e){let t=fe(ee),o=chunkMY4ZIUAV_cjs_js.u({optional:true}),r=o==null?void 0:o.theme,n=jsxRuntime.jsx(HS,{className:"stigg-auto-recharge-status-container",children:jsxRuntime.jsx(Kp,chunkMY4ZIUAV_cjs_js.a({},e))});return t?n:jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.w,{componentTheme:r,children:n})}function Jp(e){return dg__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 ot(e,t={},o){var s,l,a,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=((s=o.thresholdMax)==null?void 0:s.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=((a=o.spendLimitMin)==null?void 0:a.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 Wr({initialData:e,poolSize:t,localization:o}){var C,b,x,S,T,F,w,I,k,L,E,A,Z,$;let[r,n]=ii.useState({enabled:(C=e==null?void 0:e.enabled)!=null?C:false,thresholdAmount:(x=(b=e==null?void 0:e.thresholdAmount)==null?void 0:b.toString())!=null?x:"",targetBalance:(T=(S=e==null?void 0:e.targetBalance)==null?void 0:S.toString())!=null?T:"",maxSpendLimit:(w=(F=e==null?void 0:e.maxSpendLimit)==null?void 0:F.toString())!=null?w:""}),[i,s]=ii.useState({thresholdAmount:true,targetBalance:true,maxSpendLimit:true}),l=ot({enabled:(I=e==null?void 0:e.enabled)!=null?I:false,thresholdAmount:(L=(k=e==null?void 0:e.thresholdAmount)==null?void 0:k.toString())!=null?L:"",targetBalance:(A=(E=e==null?void 0:e.targetBalance)==null?void 0:E.toString())!=null?A:"",maxSpendLimit:($=(Z=e==null?void 0:e.maxSpendLimit)==null?void 0:Z.toString())!=null?$:""},{poolSize:t},o),[a,c]=ii.useState(l);return {formData:r,errors:a,touched:i,handleEnabledChange:_=>{let z=_.target.checked;if(n(q=>chunkMY4ZIUAV_cjs_js.b(chunkMY4ZIUAV_cjs_js.a({},q),{enabled:z})),!z)c({}),s({});else {let q=ot(chunkMY4ZIUAV_cjs_js.b(chunkMY4ZIUAV_cjs_js.a({},r),{enabled:true}),{poolSize:t},o);c(q),s({thresholdAmount:true,targetBalance:true,maxSpendLimit:true});}},handleFieldChange:_=>z=>{let q=z.target.value,Ge=chunkMY4ZIUAV_cjs_js.b(chunkMY4ZIUAV_cjs_js.a({},r),{[_]:q});n(Ge),s(V=>chunkMY4ZIUAV_cjs_js.b(chunkMY4ZIUAV_cjs_js.a({},V),{[_]:true}));let pt=ot(Ge,{poolSize:t},o);c(pt);},handleFieldBlur:_=>()=>{s(q=>chunkMY4ZIUAV_cjs_js.b(chunkMY4ZIUAV_cjs_js.a({},q),{[_]:true}));let z=ot(r,{poolSize:t},o);c(z);},getFieldError:_=>i[_]?a[_]:void 0,validate:()=>{let _=ot(r,{poolSize:t},o);return c(_),r.enabled&&s({thresholdAmount:true,targetBalance:true,maxSpendLimit:true}),Object.keys(_).length===0},getFormValues:()=>{var _,z,q;return {enabled:r.enabled,thresholdAmount:(_=r.thresholdAmount)!=null&&_.trim()?parseFloat(r.thresholdAmount.trim()):void 0,targetBalance:(z=r.targetBalance)!=null&&z.trim()?parseFloat(r.targetBalance.trim()):void 0,maxSpendLimit:(q=r.maxSpendLimit)!=null&&q.trim()?parseFloat(r.maxSpendLimit.trim()):void 0}}}}var lo=chunkMY4ZIUAV_cjs_js.e.div`
1278
1031
  display: flex;
1279
1032
  flex-direction: column;
1280
1033
  gap: 16px;
1281
1034
  width: 100%;
1282
1035
  max-width: 506px;
1283
- `,xr=y.div`
1036
+ `,co=chunkMY4ZIUAV_cjs_js.e.div`
1284
1037
  display: flex;
1285
1038
  flex-direction: column;
1286
1039
  gap: 8px;
@@ -1289,55 +1042,12 @@
1289
1042
  border: 1px solid ${({theme:e})=>{var t,o;return (o=(t=e.stigg)==null?void 0:t.palette)==null?void 0:o.outlinedBorder}};
1290
1043
  background-color: ${({theme:e})=>{var t,o;return (o=(t=e.stigg)==null?void 0:t.palette)==null?void 0:o.backgroundPaper}};
1291
1044
  box-shadow: 1px 6px 14px 0px rgba(26, 26, 26, 0.1);
1292
- `,qu=y(reactFeather.Info)`
1045
+ `,qi=chunkMY4ZIUAV_cjs_js.e(reactFeather.Info)`
1293
1046
  width: 12px;
1294
1047
  height: 12px;
1295
- color: ${({theme:e})=>{var t,o,n;return (n=(o=(t=e.stigg)==null?void 0:t.palette)==null?void 0:o.text)==null?void 0:n.secondary}};
1048
+ 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}};
1296
1049
  cursor: help;
1297
- `,Qu=y(material.Alert)`
1050
+ `,Ji=chunkMY4ZIUAV_cjs_js.e(SP__default.default)`
1298
1051
  font-family: custom-font, 'DM Sans', sans-serif;
1299
1052
  align-items: center;
1300
- `;function hl({customerId:e,currencyId:t,initialData:o,currencyUnit:n,poolSize:i,currentBalance:r,currentMonthlySpend:a,readOnly:s=false,localization:l,onSave:c,onCancel:d}){var F,E,B;let u=jt(St),p=D({optional:true}),h=p==null?void 0:p.theme,m=Fc.useMemo(()=>rC(l),[l]),{formData:g,errors:f,handleEnabledChange:x,handleFieldChange:b,handleFieldBlur:T,getFieldError:k,validate:w,getFormValues:v}=ml({initialData:o,poolSize:i,localization:m}),_=Fc.useMemo(()=>g.enabled?Object.keys(f).length>0:false,[f,g.enabled]),M=Fc.useCallback(()=>{if(w()&&c){let O=v();c(S({customerId:e,currencyId:t},O));}},[w,c,v,e,t]),I=jsxRuntime.jsx(yr,{className:"stigg-automatic-recharge-form-container",children:jsxRuntime.jsxs(xr,{className:"stigg-automatic-recharge-form-card",children:[jsxRuntime.jsxs(material.Box,{display:"flex",flexDirection:"column",gap:.5,children:[jsxRuntime.jsx(P,{variant:"h3",color:"primary",className:"stigg-automatic-recharge-form-title",children:m.title}),jsxRuntime.jsx(P,{variant:"body1",color:"secondary",className:"stigg-automatic-recharge-form-subtitle",children:m.enableLabel})]}),jsxRuntime.jsx(material.Box,{display:"flex",flexDirection:"column",gap:1,children:jsxRuntime.jsx(material.FormControlLabel,{control:jsxRuntime.jsx(material.Checkbox,{checked:g.enabled,onChange:x,disabled:s}),label:jsxRuntime.jsx(P,{variant:"body1",color:"primary",children:m.enableDescription}),className:"stigg-automatic-recharge-form-enable-checkbox"})}),jsxRuntime.jsxs(material.Box,{display:"flex",flexDirection:"column",gap:1,className:"stigg-automatic-recharge-form-threshold-field",children:[jsxRuntime.jsxs(material.Box,{display:"flex",alignItems:"center",gap:1,children:[jsxRuntime.jsxs(P,{variant:"body1",color:"primary",children:[jsxRuntime.jsx(material.Box,{component:"span",fontWeight:"bold",children:m.thresholdFieldPrefix})," ",m.thresholdFieldSuffix]}),jsxRuntime.jsx(Be,{title:m.thresholdTooltip,children:jsxRuntime.jsx(qu,{})})]}),jsxRuntime.jsx(reactNumberFormat.NumericFormat,{customInput:Rt,fullWidth:true,thousandSeparator:true,value:g.thresholdAmount,onValueChange:O=>{let U={target:{value:O.value}};b("thresholdAmount")(U);},onBlur:T("thresholdAmount"),placeholder:m.thresholdFieldPlaceholder,error:!!k("thresholdAmount"),helperText:(F=k("thresholdAmount"))!=null?F:"",disabled:s||!g.enabled,InputProps:{endAdornment:n?jsxRuntime.jsx(P,{variant:"body1",color:"secondary",style:{whiteSpace:"nowrap"},children:n}):void 0},className:"stigg-automatic-recharge-form-threshold-input"})]}),jsxRuntime.jsxs(material.Box,{display:"flex",flexDirection:"column",gap:1,className:"stigg-automatic-recharge-form-target-field",children:[jsxRuntime.jsxs(material.Box,{display:"flex",alignItems:"center",gap:1,children:[jsxRuntime.jsxs(P,{variant:"body1",color:"primary",children:[jsxRuntime.jsx(material.Box,{component:"span",fontWeight:"bold",children:m.targetFieldPrefix})," ",m.targetFieldSuffix]}),jsxRuntime.jsx(Be,{title:m.targetBalanceTooltip,children:jsxRuntime.jsx(qu,{})})]}),jsxRuntime.jsx(reactNumberFormat.NumericFormat,{customInput:Rt,fullWidth:true,thousandSeparator:true,value:g.targetBalance,onValueChange:O=>{let U={target:{value:O.value}};b("targetBalance")(U);},onBlur:T("targetBalance"),placeholder:m.targetFieldPlaceholder,error:!!k("targetBalance"),helperText:(E=k("targetBalance"))!=null?E:"",disabled:s||!g.enabled,InputProps:{endAdornment:n?jsxRuntime.jsx(P,{variant:"body1",color:"secondary",style:{whiteSpace:"nowrap"},children:n}):void 0},className:"stigg-automatic-recharge-form-target-input"})]}),jsxRuntime.jsxs(material.Box,{display:"flex",flexDirection:"column",gap:1,className:"stigg-automatic-recharge-form-spend-limit-field",children:[jsxRuntime.jsxs(material.Box,{display:"flex",flexDirection:"column",gap:.5,children:[jsxRuntime.jsxs(P,{variant:"body1",color:"primary",children:[jsxRuntime.jsx(material.Box,{component:"span",fontWeight:"bold",children:m.spendLimitFieldPrefix})," ",m.spendLimitFieldSuffix]}),jsxRuntime.jsx(P,{variant:"caption",color:"secondary",style:{fontSize:"12px"},children:m.spendLimitHelpText})]}),jsxRuntime.jsx(reactNumberFormat.NumericFormat,{customInput:Rt,fullWidth:true,thousandSeparator:true,value:g.maxSpendLimit,onValueChange:O=>{let U={target:{value:O.value}};b("maxSpendLimit")(U);},onBlur:T("maxSpendLimit"),placeholder:m.spendLimitFieldPlaceholder,error:!!k("maxSpendLimit"),helperText:(B=k("maxSpendLimit"))!=null?B:"",disabled:s||!g.enabled,InputProps:{startAdornment:jsxRuntime.jsx(P,{variant:"body1",color:"secondary",children:"$"}),endAdornment:jsxRuntime.jsxs(P,{variant:"body1",color:"secondary",style:{whiteSpace:"nowrap"},children:["/ ",m.spendLimitPeriod]})},className:"stigg-automatic-recharge-form-spend-limit-input"})]}),!s&&g.enabled&&g.thresholdAmount&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[r!==void 0&&r<=parseFloat(g.thresholdAmount)&&jsxRuntime.jsx(Qu,{severity:"warning",className:"stigg-automatic-recharge-form-warning",children:m.immediateRechargeWarning.replace("{{threshold}}",At(parseFloat(g.thresholdAmount))||"0").replace("{{currencyUnit}}",n||"")}),g.maxSpendLimit&&g.maxSpendLimit.trim()!==""&&parseFloat(g.maxSpendLimit)>0&&a!==void 0&&a+0>=parseFloat(g.maxSpendLimit)&&jsxRuntime.jsx(Qu,{severity:"warning",className:"stigg-automatic-recharge-form-spend-limit-warning",children:m.spendLimitTooLowWarning.replace("{{currentSpend}}",gl(a)).replace("{{spendLimit}}",gl(parseFloat(g.maxSpendLimit)))})]}),!s&&jsxRuntime.jsxs(material.Box,{display:"flex",justifyContent:"flex-end",gap:1,pt:2,className:"stigg-automatic-recharge-form-actions",children:[d&&jsxRuntime.jsx(kt,{variant:"outlined",onClick:d,className:"stigg-automatic-recharge-form-cancel-button",children:m.cancelButton}),c&&jsxRuntime.jsx(kt,{variant:"contained",onClick:M,disabled:_,className:"stigg-automatic-recharge-form-save-button",children:m.saveButton})]})]})});return u?I:jsxRuntime.jsx(ht,{componentTheme:h,children:I})}function lC(){let e=D(),t=e==null?void 0:e.stigg,[o,n]=Fc.useState(false),[i,r]=Fc.useState(null);return {updateConfig:Fc.useCallback(s=>R(null,null,function*(){var l,c,d;if(!t||!t.isCustomerLoaded){let u=new Error("Stigg SDK not initialized or customer not loaded");throw r(u),u}n(true),r(null);try{let u={customerId:s.customerId,currencyId:s.currencyId,isEnabled:s.enabled,thresholdValue:(l=s.thresholdAmount)!=null?l:0,thresholdType:ah.ThresholdType.CreditAmount,targetBalance:(c=s.targetBalance)!=null?c:0,maxSpendLimit:(d=s.maxSpendLimit)!=null?d:null},p=yield t.saveAutomaticRechargeConfiguration(u);return yield t.refresh(),n(!1),p}catch(u){let p=u instanceof Error?u:new Error("Failed to save automatic recharge configuration");throw console.error("Error saving automatic recharge configuration:",p),r(p),n(false),p}}),[t]),isLoading:o,error:i}}function uC({customerId:e,currencyId:t,currencyUnit:o,poolSize:n,readOnly:i=false,localization:r,onSave:a,onCancel:s}){var M,I;let l=jt(St),c=D({optional:true}),d=c==null?void 0:c.theme,{config:u,isLoading:p,error:h}=ul({customerId:e,currencyId:t}),{balance:m,isLoading:g,error:f}=po({currencyId:t}),{updateConfig:x,isLoading:b,error:T}=lC(),k=Fc.useCallback(F=>R(null,null,function*(){try{yield x(F),a&&a(F);}catch(E){console.error("Failed to save automatic recharge configuration:",E);}}),[x,a]),w=u?{id:"",enabled:u.isEnabled,thresholdAmount:u.thresholdValue,targetBalance:u.targetBalance,maxSpendLimit:(M=u.maxSpendLimit)!=null?M:void 0,currencyId:u.currencyId,customerId:u.customerId}:void 0;if(p||g){let F=jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx(ro__default.default,{width:300,height:24,style:{marginBottom:"16px"}}),jsxRuntime.jsx(ro__default.default,{width:400,height:200})]});return l?F:jsxRuntime.jsx(ht,{componentTheme:d,children:F})}if(h){let F=jsxRuntime.jsx(yr,{className:"stigg-automatic-recharge-form-container",children:jsxRuntime.jsx(xr,{className:"stigg-automatic-recharge-form-card",children:jsxRuntime.jsx(P,{variant:"body1",color:"error",children:h.message||"Failed to load automatic recharge configuration"})})});return l?F:jsxRuntime.jsx(ht,{componentTheme:d,children:F})}if(f){let F=jsxRuntime.jsx(yr,{className:"stigg-automatic-recharge-form-container",children:jsxRuntime.jsx(xr,{className:"stigg-automatic-recharge-form-card",children:jsxRuntime.jsx(P,{variant:"body1",color:"error",children:f.message||"Failed to load credit balance"})})});return l?F:jsxRuntime.jsx(ht,{componentTheme:d,children:F})}let v=o||((I=m==null?void 0:m.units)==null?void 0:I.plural)||(m==null?void 0:m.displayName)||"Credits",_=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[T&&jsxRuntime.jsx(P,{variant:"body1",color:"error",style:{marginBottom:"16px"},children:T.message||"Failed to save automatic recharge configuration"}),jsxRuntime.jsx(hl,{customerId:e,currencyId:t,initialData:w,currencyUnit:v,poolSize:n,currentBalance:m==null?void 0:m.currentBalance,currentMonthlySpend:u==null?void 0:u.currentMonthlySpend,readOnly:i||b,localization:r,onSave:k,onCancel:s})]});return l?_:jsxRuntime.jsx(ht,{componentTheme:d,children:_})}/*! Bundled license information:
1301
-
1302
- chart.js/dist/chunks/helpers.segment.mjs:
1303
- chart.js/dist/chart.mjs:
1304
- chart.js/dist/helpers.mjs:
1305
- (*!
1306
- * Chart.js v3.9.1
1307
- * https://www.chartjs.org
1308
- * (c) 2022 Chart.js Contributors
1309
- * Released under the MIT License
1310
- *)
1311
-
1312
- chart.js/dist/chunks/helpers.segment.mjs:
1313
- (*!
1314
- * @kurkle/color v0.2.1
1315
- * https://github.com/kurkle/color#readme
1316
- * (c) 2022 Jukka Kurkela
1317
- * Released under the MIT License
1318
- *)
1319
-
1320
- chartjs-plugin-datalabels/dist/chartjs-plugin-datalabels.esm.js:
1321
- (*!
1322
- * chartjs-plugin-datalabels v2.2.0
1323
- * https://chartjs-plugin-datalabels.netlify.app
1324
- * (c) 2017-2022 chartjs-plugin-datalabels contributors
1325
- * Released under the MIT license
1326
- *)
1327
-
1328
- chartjs-plugin-annotation/dist/chartjs-plugin-annotation.esm.js:
1329
- (*!
1330
- * chartjs-plugin-annotation v2.2.1
1331
- * https://www.chartjs.org/chartjs-plugin-annotation/index
1332
- * (c) 2023 chartjs-plugin-annotation Contributors
1333
- * Released under the MIT License
1334
- *)
1335
-
1336
- chartjs-plugin-gradient/dist/chartjs-plugin-gradient.esm.js:
1337
- (*!
1338
- * chartjs-plugin-gradient v0.6.1
1339
- * https://github.com/kurkle/chartjs-plugin-gradient#readme
1340
- * (c) 2022 Jukka Kurkela
1341
- * Released under the MIT License
1342
- *)
1343
- */exports.AddonsList=Ur;exports.AutoRechargeStatus=iC;exports.AutomaticRechargeConfig=uC;exports.AutomaticRechargeConfigForm=hl;exports.BooleanEntitlementGuard=pv;exports.Checkout=a1;exports.CreditBalance=g1;exports.CreditGrants=Xb;exports.CreditUsageChart=Rb;exports.CreditUtilization=Ub;exports.CustomerPortal=Wg;exports.CustomerPortalProvider=Nr;exports.CustomerUsageData=pa;exports.EmptyState=ll;exports.EnumEntitlementGuard=Pv;exports.ErrorState=sl;exports.GenericTable=cl;exports.InvoicesSection=ma;exports.MeteredEntitlementGuard=xv;exports.NumericEntitlementGuard=gv;exports.PaymentDetailsSection=ra;exports.Paywall=fh;exports.Promotions=zr;exports.ProvisionStatus=ld;exports.StatusChip=gr;exports.StiggContext=Ti;exports.StiggProvider=rS;exports.SubscribeIntentionType=wl;exports.SubscriptionsOverview=ta;exports.formatDateOnly=xc;exports.formatDateTime=yc;exports.isCreditEntitlement=Jr;exports.isFeatureEntitlement=kn;exports.mapCreditGrantStatusToVariant=Yu;exports.useActiveSubscriptions=$f;exports.useAutomaticRechargeForm=ml;exports.useBooleanEntitlement=ka;exports.useCreditBalance=po;exports.useCreditGrants=il;exports.useCreditUsage=Qs;exports.useCustomerPortal=Wf;exports.useEnumEntitlement=_a;exports.useMeteredEntitlement=va;exports.useNumericEntitlement=wa;exports.usePaywall=Hf;exports.useStiggContext=D;exports.useWaitForCheckoutCompleted=l1;exports.validateAutomaticRechargeForm=Io;Object.keys(ah).forEach(function(k){if(k!=='default'&&!Object.prototype.hasOwnProperty.call(exports,k))Object.defineProperty(exports,k,{enumerable:true,get:function(){return ah[k]}})});
1053
+ `;function Zr({customerId:e,currencyId:t,initialData:o,currencyUnit:r,poolSize:n,currentBalance:i,currentMonthlySpend:s,readOnly:l=false,localization:a,onSave:c,onCancel:u}){var E,A,Z;let f=fe(ee),p=chunkMY4ZIUAV_cjs_js.u({optional:true}),h=p==null?void 0:p.theme,g=ii.useMemo(()=>Jp(a),[a]),{formData:y,errors:C,handleEnabledChange:b,handleFieldChange:x,handleFieldBlur:S,getFieldError:T,validate:F,getFormValues:w}=Wr({initialData:o,poolSize:n,localization:g}),I=ii.useMemo(()=>y.enabled?Object.keys(C).length>0:false,[C,y.enabled]),k=ii.useCallback(()=>{if(F()&&c){let $=w();c(chunkMY4ZIUAV_cjs_js.a({customerId:e,currencyId:t},$));}},[F,c,w,e,t]),L=jsxRuntime.jsx(lo,{className:"stigg-automatic-recharge-form-container",children:jsxRuntime.jsxs(co,{className:"stigg-automatic-recharge-form-card",children:[jsxRuntime.jsxs(ke__default.default,{display:"flex",flexDirection:"column",gap:.5,children:[jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.f,{variant:"h3",color:"primary",className:"stigg-automatic-recharge-form-title",children:g.title}),jsxRuntime.jsx(chunkMY4ZIUAV_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(Bh__default.default,{control:jsxRuntime.jsx(wh__default.default,{checked:y.enabled,onChange:b,disabled:l}),label:jsxRuntime.jsx(chunkMY4ZIUAV_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(chunkMY4ZIUAV_cjs_js.f,{variant:"body1",color:"primary",children:[jsxRuntime.jsx(ke__default.default,{component:"span",fontWeight:"bold",children:g.thresholdFieldPrefix})," ",g.thresholdFieldSuffix]}),jsxRuntime.jsx(Ve,{title:g.thresholdTooltip,children:jsxRuntime.jsx(qi,{})})]}),jsxRuntime.jsx(reactNumberFormat.NumericFormat,{customInput:ce,fullWidth:true,thousandSeparator:true,value:y.thresholdAmount,onValueChange:$=>{let _={target:{value:$.value}};x("thresholdAmount")(_);},onBlur:S("thresholdAmount"),placeholder:g.thresholdFieldPlaceholder,error:!!T("thresholdAmount"),helperText:(E=T("thresholdAmount"))!=null?E:"",disabled:l||!y.enabled,InputProps:{endAdornment:r?jsxRuntime.jsx(chunkMY4ZIUAV_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(chunkMY4ZIUAV_cjs_js.f,{variant:"body1",color:"primary",children:[jsxRuntime.jsx(ke__default.default,{component:"span",fontWeight:"bold",children:g.targetFieldPrefix})," ",g.targetFieldSuffix]}),jsxRuntime.jsx(Ve,{title:g.targetBalanceTooltip,children:jsxRuntime.jsx(qi,{})})]}),jsxRuntime.jsx(reactNumberFormat.NumericFormat,{customInput:ce,fullWidth:true,thousandSeparator:true,value:y.targetBalance,onValueChange:$=>{let _={target:{value:$.value}};x("targetBalance")(_);},onBlur:S("targetBalance"),placeholder:g.targetFieldPlaceholder,error:!!T("targetBalance"),helperText:(A=T("targetBalance"))!=null?A:"",disabled:l||!y.enabled,InputProps:{endAdornment:r?jsxRuntime.jsx(chunkMY4ZIUAV_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(chunkMY4ZIUAV_cjs_js.f,{variant:"body1",color:"primary",children:[jsxRuntime.jsx(ke__default.default,{component:"span",fontWeight:"bold",children:g.spendLimitFieldPrefix})," ",g.spendLimitFieldSuffix]}),jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.f,{variant:"caption",color:"secondary",style:{fontSize:"12px"},children:g.spendLimitHelpText})]}),jsxRuntime.jsx(reactNumberFormat.NumericFormat,{customInput:ce,fullWidth:true,thousandSeparator:true,value:y.maxSpendLimit,onValueChange:$=>{let _={target:{value:$.value}};x("maxSpendLimit")(_);},onBlur:S("maxSpendLimit"),placeholder:g.spendLimitFieldPlaceholder,error:!!T("maxSpendLimit"),helperText:(Z=T("maxSpendLimit"))!=null?Z:"",disabled:l||!y.enabled,InputProps:{startAdornment:jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.f,{variant:"body1",color:"secondary",children:"$"}),endAdornment:jsxRuntime.jsxs(chunkMY4ZIUAV_cjs_js.f,{variant:"body1",color:"secondary",style:{whiteSpace:"nowrap"},children:["/ ",g.spendLimitPeriod]})},className:"stigg-automatic-recharge-form-spend-limit-input"})]}),!l&&y.enabled&&y.thresholdAmount&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[i!==void 0&&i<=parseFloat(y.thresholdAmount)&&jsxRuntime.jsx(Ji,{severity:"warning",className:"stigg-automatic-recharge-form-warning",children:g.immediateRechargeWarning.replace("{{threshold}}",ie(parseFloat(y.thresholdAmount))||"0").replace("{{currencyUnit}}",r||"")}),y.maxSpendLimit&&y.maxSpendLimit.trim()!==""&&parseFloat(y.maxSpendLimit)>0&&s!==void 0&&s+0>=parseFloat(y.maxSpendLimit)&&jsxRuntime.jsx(Ji,{severity:"warning",className:"stigg-automatic-recharge-form-spend-limit-warning",children:g.spendLimitTooLowWarning.replace("{{currentSpend}}",jr(s)).replace("{{spendLimit}}",jr(parseFloat(y.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:k,disabled:I,className:"stigg-automatic-recharge-form-save-button",children:g.saveButton})]})]})});return f?L:jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.w,{componentTheme:h,children:L})}function em(){let e=chunkMY4ZIUAV_cjs_js.u(),t=e==null?void 0:e.stigg,[o,r]=ii.useState(false),[n,i]=ii.useState(null);return {updateConfig:ii.useCallback(l=>chunkMY4ZIUAV_cjs_js.d(null,null,function*(){var a,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:(a=l.thresholdAmount)!=null?a:0,thresholdType:jsClientSdk.ThresholdType.CreditAmount,targetBalance:(c=l.targetBalance)!=null?c:0,maxSpendLimit:(u=l.maxSpendLimit)!=null?u:null},p=yield t.saveAutomaticRechargeConfiguration(f);return yield t.refresh(),r(!1),p}catch(f){let p=f instanceof Error?f:new Error("Failed to save automatic recharge configuration");throw console.error("Error saving automatic recharge configuration:",p),i(p),r(false),p}}),[t]),isLoading:o,error:n}}function rm({customerId:e,currencyId:t,currencyUnit:o,poolSize:r,readOnly:n=false,localization:i,onSave:s,onCancel:l}){var k,L;let a=fe(ee),c=chunkMY4ZIUAV_cjs_js.u({optional:true}),u=c==null?void 0:c.theme,{config:f,isLoading:p,error:h}=Hr({customerId:e,currencyId:t}),{balance:g,isLoading:y,error:C}=et({currencyId:t}),{updateConfig:b,isLoading:x,error:S}=em(),T=ii.useCallback(E=>chunkMY4ZIUAV_cjs_js.d(null,null,function*(){try{yield b(E),s&&s(E);}catch(A){console.error("Failed to save automatic recharge configuration:",A);}}),[b,s]),F=f?{id:"",enabled:f.isEnabled,thresholdAmount:f.thresholdValue,targetBalance:f.targetBalance,maxSpendLimit:(k=f.maxSpendLimit)!=null?k:void 0,currencyId:f.currencyId,customerId:f.customerId}:void 0;if(p||y){let E=jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx(Qe__default.default,{width:300,height:24,style:{marginBottom:"16px"}}),jsxRuntime.jsx(Qe__default.default,{width:400,height:200})]});return a?E:jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.w,{componentTheme:u,children:E})}if(h){let E=jsxRuntime.jsx(lo,{className:"stigg-automatic-recharge-form-container",children:jsxRuntime.jsx(co,{className:"stigg-automatic-recharge-form-card",children:jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.f,{variant:"body1",color:"error",children:h.message||"Failed to load automatic recharge configuration"})})});return a?E:jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.w,{componentTheme:u,children:E})}if(C){let E=jsxRuntime.jsx(lo,{className:"stigg-automatic-recharge-form-container",children:jsxRuntime.jsx(co,{className:"stigg-automatic-recharge-form-card",children:jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.f,{variant:"body1",color:"error",children:C.message||"Failed to load credit balance"})})});return a?E:jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.w,{componentTheme:u,children:E})}let w=o||((L=g==null?void 0:g.units)==null?void 0:L.plural)||(g==null?void 0:g.displayName)||"Credits",I=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[S&&jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.f,{variant:"body1",color:"error",style:{marginBottom:"16px"},children:S.message||"Failed to save automatic recharge configuration"}),jsxRuntime.jsx(Zr,{customerId:e,currencyId:t,initialData:F,currencyUnit:w,poolSize:r,currentBalance:g==null?void 0:g.currentBalance,currentMonthlySpend:f==null?void 0:f.currentMonthlySpend,readOnly:n||x,localization:i,onSave:T,onCancel:l})]});return a?I:jsxRuntime.jsx(chunkMY4ZIUAV_cjs_js.w,{componentTheme:u,children:I})}Object.defineProperty(exports,"StiggContext",{enumerable:true,get:function(){return chunkMY4ZIUAV_cjs_js.s}});Object.defineProperty(exports,"StiggProvider",{enumerable:true,get:function(){return chunkMY4ZIUAV_cjs_js.t}});Object.defineProperty(exports,"useActiveSubscriptions",{enumerable:true,get:function(){return chunkMY4ZIUAV_cjs_js.C}});Object.defineProperty(exports,"useBooleanEntitlement",{enumerable:true,get:function(){return chunkMY4ZIUAV_cjs_js.x}});Object.defineProperty(exports,"useCreditUsage",{enumerable:true,get:function(){return chunkMY4ZIUAV_cjs_js.K}});Object.defineProperty(exports,"useCustomerPortal",{enumerable:true,get:function(){return chunkMY4ZIUAV_cjs_js.E}});Object.defineProperty(exports,"useEnumEntitlement",{enumerable:true,get:function(){return chunkMY4ZIUAV_cjs_js.A}});Object.defineProperty(exports,"useMeteredEntitlement",{enumerable:true,get:function(){return chunkMY4ZIUAV_cjs_js.z}});Object.defineProperty(exports,"useNumericEntitlement",{enumerable:true,get:function(){return chunkMY4ZIUAV_cjs_js.y}});Object.defineProperty(exports,"usePaywall",{enumerable:true,get:function(){return chunkMY4ZIUAV_cjs_js.D}});Object.defineProperty(exports,"useStiggContext",{enumerable:true,get:function(){return chunkMY4ZIUAV_cjs_js.u}});exports.AddonsList=vo;exports.AutoRechargeStatus=qp;exports.AutomaticRechargeConfig=rm;exports.AutomaticRechargeConfigForm=Zr;exports.BooleanEntitlementGuard=vb;exports.Checkout=Pp;exports.CreditBalance=wp;exports.CreditGrants=zp;exports.CreditUsageChart=Ap;exports.CreditUtilization=vp;exports.CustomerPortal=Yl;exports.CustomerPortalProvider=Fo;exports.CustomerUsageData=nr;exports.EmptyState=Gr;exports.EnumEntitlementGuard=$b;exports.ErrorState=$r;exports.GenericTable=zr;exports.InvoicesSection=ir;exports.MeteredEntitlementGuard=Ub;exports.NumericEntitlementGuard=Nb;exports.PaymentDetailsSection=Jo;exports.Paywall=Ps;exports.Promotions=Lo;exports.ProvisionStatus=_i;exports.StatusChip=ao;exports.SubscribeIntentionType=on;exports.SubscriptionsOverview=Zo;exports.formatDateOnly=Wn;exports.formatDateTime=On;exports.isCreditEntitlement=Wo;exports.isFeatureEntitlement=bt;exports.mapCreditGrantStatusToVariant=Zi;exports.useAutomaticRechargeForm=Wr;exports.useCreditBalance=et;exports.useCreditGrants=Ur;exports.useWaitForCheckoutCompleted=Sp;exports.validateAutomaticRechargeForm=ot;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]}})});