@cuemath/leap 2.9.4-link.0 → 2.9.4-link.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.
- package/dist/features/trial-session/comps/pricing/pricing-cards.js +9 -9
- package/dist/features/trial-session/comps/pricing/pricing-cards.js.map +1 -1
- package/dist/features/trial-session/comps/pricing/pricing.js +25 -25
- package/dist/features/trial-session/comps/pricing/pricing.js.map +1 -1
- package/package.json +2 -3
@@ -7,8 +7,8 @@ import { PricingBoard as p, ImageWrapper as f, OfferText as d } from "./pricing-
|
|
7
7
|
const c = {
|
8
8
|
0: "WHITE_4",
|
9
9
|
1: "GREEN_1"
|
10
|
-
},
|
11
|
-
if (y === "
|
10
|
+
}, F = ({ pricingConfig: h, intentType: y, colorIndex: i }) => {
|
11
|
+
if (y === "LOW") {
|
12
12
|
const {
|
13
13
|
plan_name: T,
|
14
14
|
original_price: m,
|
@@ -64,13 +64,13 @@ const c = {
|
|
64
64
|
amount: u,
|
65
65
|
duration: A,
|
66
66
|
amount_after_coupon: l,
|
67
|
-
classes_per_week:
|
67
|
+
classes_per_week: C,
|
68
68
|
currency_symbol: s,
|
69
|
-
discount_details:
|
70
|
-
fee_per_class_after_discount:
|
69
|
+
discount_details: k,
|
70
|
+
fee_per_class_after_discount: w,
|
71
71
|
meta_text: $,
|
72
72
|
no_of_classes: x
|
73
|
-
} = h || {}, { discount_duration: b, original_plan_details: E } =
|
73
|
+
} = h || {}, { discount_duration: b, original_plan_details: E } = k || {}, { duration: P } = E || {};
|
74
74
|
return /* @__PURE__ */ e(
|
75
75
|
p,
|
76
76
|
{
|
@@ -111,7 +111,7 @@ const c = {
|
|
111
111
|
] }) : /* @__PURE__ */ r(n, { $renderAs: "ab1-black", $inline: !0, children: s + l }),
|
112
112
|
/* @__PURE__ */ e(n, { $renderAs: "ub3", children: [
|
113
113
|
"(",
|
114
|
-
|
114
|
+
w,
|
115
115
|
"/class)"
|
116
116
|
] })
|
117
117
|
] }),
|
@@ -122,7 +122,7 @@ const c = {
|
|
122
122
|
] }),
|
123
123
|
/* @__PURE__ */ e(n, { $renderAs: "ub2", children: [
|
124
124
|
"(",
|
125
|
-
|
125
|
+
C * 4,
|
126
126
|
" classes/mo)"
|
127
127
|
] })
|
128
128
|
] }),
|
@@ -139,6 +139,6 @@ const c = {
|
|
139
139
|
);
|
140
140
|
};
|
141
141
|
export {
|
142
|
-
|
142
|
+
F as default
|
143
143
|
};
|
144
144
|
//# sourceMappingURL=pricing-cards.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"pricing-cards.js","sources":["../../../../../src/features/trial-session/comps/pricing/pricing-cards.tsx"],"sourcesContent":["import type { TColorNames } from '../../../ui/types';\nimport type {\n IPricingCardsProps,\n TLowIntentPricingDetails,\n TPricingDetails,\n} from './pricing-typed';\nimport type { FC } from 'react';\n\nimport FlexView from '../../../ui/layout/flex-view';\nimport Separator from '../../../ui/separator/separator';\nimport Text from '../../../ui/text/text';\nimport HangingBoardComp from './board-comp';\nimport * as Styled from './pricing-styled';\n\nconst layoutPrimaryColor: Record<number, TColorNames> = {\n 0: 'WHITE_4',\n 1: 'GREEN_1',\n};\n\nconst PricingCards: FC<IPricingCardsProps> = ({ pricingConfig, intentType, colorIndex }) => {\n if (intentType === '
|
1
|
+
{"version":3,"file":"pricing-cards.js","sources":["../../../../../src/features/trial-session/comps/pricing/pricing-cards.tsx"],"sourcesContent":["import type { TColorNames } from '../../../ui/types';\nimport type {\n IPricingCardsProps,\n TLowIntentPricingDetails,\n TPricingDetails,\n} from './pricing-typed';\nimport type { FC } from 'react';\n\nimport FlexView from '../../../ui/layout/flex-view';\nimport Separator from '../../../ui/separator/separator';\nimport Text from '../../../ui/text/text';\nimport HangingBoardComp from './board-comp';\nimport * as Styled from './pricing-styled';\n\nconst layoutPrimaryColor: Record<number, TColorNames> = {\n 0: 'WHITE_4',\n 1: 'GREEN_1',\n};\n\nconst PricingCards: FC<IPricingCardsProps> = ({ pricingConfig, intentType, colorIndex }) => {\n if (intentType === 'LOW') {\n const {\n plan_name: pricingName,\n original_price: originalPrice,\n discounted_price: discountedPrice,\n price_per_class: pricePerClass,\n classes_per_cycle: classesPerCycle,\n billing_cycle: billingCycle,\n offer: metaText,\n currency_symbol: currencySymbol,\n } = (pricingConfig as TLowIntentPricingDetails) || {};\n\n return (\n <Styled.PricingBoard $width={287} $height={393} $gutterX={2.5} $gapX={2.125}>\n <Styled.ImageWrapper $color={layoutPrimaryColor[colorIndex % 2] ?? 'WHITE_4'}>\n <HangingBoardComp width={287} height={393} />\n </Styled.ImageWrapper>\n <FlexView $height=\"100%\" $justifyContent=\"space-between\">\n <div>\n <Separator height={50} />\n <Text $renderAs=\"ac2-black\">{pricingName}</Text>\n <Separator height={20} />\n <FlexView $flexDirection=\"row\" $alignItems=\"center\">\n {originalPrice ? (\n <Text $renderAs=\"ub3-bold\" $textDecoration=\"line-through\">\n {currencySymbol + originalPrice}\n </Text>\n ) : null}\n <FlexView $flexDirection=\"row\" $alignItems=\"end\">\n <Text $renderAs=\"ah3-bold\">{currencySymbol + discountedPrice}</Text>\n <Text $renderAs=\"ab1-bold\">/{billingCycle === 'yearly' ? 'year' : 'month'}</Text>\n </FlexView>\n </FlexView>\n <Separator height={4} />\n <Text $renderAs=\"ub3\">({currencySymbol + pricePerClass}/class)</Text>\n <Separator height={4} />\n <Text $renderAs=\"ub3\">({classesPerCycle} classes/mo)</Text>\n </div>\n\n {metaText && (\n <Styled.OfferText\n $renderAs=\"ub3-bold\"\n $background={layoutPrimaryColor[colorIndex % 2] ?? 'WHITE_4'}\n >\n {metaText}\n </Styled.OfferText>\n )}\n </FlexView>\n </Styled.PricingBoard>\n );\n }\n\n const {\n amount,\n duration: durationWithoutCoupon,\n amount_after_coupon: amountAfterCoupon,\n classes_per_week: classesPerWeek,\n currency_symbol: currencySymbol,\n discount_details: discountDetails,\n fee_per_class_after_discount: feePerClassAfterDiscount,\n meta_text: metaText,\n no_of_classes: noOfClasses,\n } = (pricingConfig as TPricingDetails) || {};\n const { discount_duration: discountDuration, original_plan_details: originalPlanDetails } =\n discountDetails || {};\n const { duration } = originalPlanDetails || {};\n\n return (\n <Styled.PricingBoard\n $width={287}\n $height={393}\n $gutterX={2.5}\n $gapX={2.125}\n $justifyContent=\"space-between\"\n >\n <Styled.ImageWrapper $color={layoutPrimaryColor[colorIndex % 2] ?? 'WHITE_4'}>\n <HangingBoardComp width={287} height={393} />\n </Styled.ImageWrapper>\n <div>\n <Separator height={30} />\n <Text $renderAs=\"ah2-black\">\n {duration || durationWithoutCoupon} \n <Text $renderAs=\"ac2-black\" $inline>\n Months\n </Text>\n </Text>\n {discountDuration && (\n <Styled.OfferText\n $renderAs=\"ub3-bold\"\n $background={layoutPrimaryColor[colorIndex % 2] ?? 'WHITE_4'}\n >\n Get extra {discountDuration} Months FREE\n </Styled.OfferText>\n )}\n </div>\n\n <div>\n {amountAfterCoupon !== amount ? (\n <Text $renderAs=\"ab1\" $textDecoration=\"line-through\">\n {currencySymbol + amount}\n <Text $renderAs=\"ab1-black\" $inline>\n \n {currencySymbol + amountAfterCoupon}\n </Text>\n </Text>\n ) : (\n <Text $renderAs=\"ab1-black\" $inline>\n {currencySymbol + amountAfterCoupon}\n </Text>\n )}\n <Text $renderAs=\"ub3\">({feePerClassAfterDiscount}/class)</Text>\n </div>\n\n <div>\n <Text $renderAs=\"ab1\">{noOfClasses} classes</Text>\n <Text $renderAs=\"ub2\">({classesPerWeek * 4} classes/mo)</Text>\n </div>\n\n {metaText && (\n <Styled.OfferText\n $renderAs=\"ub3-bold\"\n $background={layoutPrimaryColor[colorIndex % 2] ?? 'WHITE_4'}\n >\n {metaText}\n </Styled.OfferText>\n )}\n </Styled.PricingBoard>\n );\n};\n\nexport default PricingCards;\n"],"names":["layoutPrimaryColor","PricingCards","pricingConfig","intentType","colorIndex","pricingName","originalPrice","discountedPrice","pricePerClass","classesPerCycle","billingCycle","metaText","currencySymbol","jsxs","Styled.PricingBoard","jsx","Styled.ImageWrapper","HangingBoardComp","FlexView","Separator","Text","Styled.OfferText","amount","durationWithoutCoupon","amountAfterCoupon","classesPerWeek","discountDetails","feePerClassAfterDiscount","noOfClasses","discountDuration","originalPlanDetails","duration"],"mappings":";;;;;;AAcA,MAAMA,IAAkD;AAAA,EACtD,GAAG;AAAA,EACH,GAAG;AACL,GAEMC,IAAuC,CAAC,EAAE,eAAAC,GAAe,YAAAC,GAAY,YAAAC,QAAiB;AAC1F,MAAID,MAAe,OAAO;AAClB,UAAA;AAAA,MACJ,WAAWE;AAAA,MACX,gBAAgBC;AAAA,MAChB,kBAAkBC;AAAA,MAClB,iBAAiBC;AAAA,MACjB,mBAAmBC;AAAA,MACnB,eAAeC;AAAA,MACf,OAAOC;AAAAA,MACP,iBAAiBC;AAAAA,IAAA,IACdV,KAA8C,CAAA;AAGjD,WAAA,gBAAAW,EAACC,GAAA,EAAoB,QAAQ,KAAK,SAAS,KAAK,UAAU,KAAK,OAAO,OACpE,UAAA;AAAA,MAAA,gBAAAC,EAACC,GAAA,EAAoB,QAAQhB,EAAmBI,IAAa,CAAC,KAAK,WACjE,4BAACa,GAAiB,EAAA,OAAO,KAAK,QAAQ,IAAK,CAAA,GAC7C;AAAA,MACC,gBAAAJ,EAAAK,GAAA,EAAS,SAAQ,QAAO,iBAAgB,iBACvC,UAAA;AAAA,QAAA,gBAAAL,EAAC,OACC,EAAA,UAAA;AAAA,UAAC,gBAAAE,EAAAI,GAAA,EAAU,QAAQ,GAAI,CAAA;AAAA,UACtB,gBAAAJ,EAAAK,GAAA,EAAK,WAAU,aAAa,UAAYf,GAAA;AAAA,UACzC,gBAAAU,EAACI,GAAU,EAAA,QAAQ,GAAI,CAAA;AAAA,UACtB,gBAAAN,EAAAK,GAAA,EAAS,gBAAe,OAAM,aAAY,UACxC,UAAA;AAAA,YACCZ,IAAA,gBAAAS,EAACK,KAAK,WAAU,YAAW,iBAAgB,gBACxC,UAAAR,IAAiBN,EAAA,CACpB,IACE;AAAA,Y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,GAC1D;AAAA,0BAEC,OACC,EAAA,UAAA;AAAA,UAAC,gBAAAd,EAAAO,GAAA,EAAK,WAAU,OAAO,UAAA;AAAA,YAAAQ;AAAA,YAAY;AAAA,UAAA,GAAQ;AAAA,UAC3C,gBAAAf,EAACO,GAAK,EAAA,WAAU,OAAM,UAAA;AAAA,YAAA;AAAA,YAAEK,IAAiB;AAAA,YAAE;AAAA,UAAA,GAAY;AAAA,QAAA,GACzD;AAAA,QAECd,KACC,gBAAAI;AAAA,UAACM;AAAAA,UAAA;AAAA,YACC,WAAU;AAAA,YACV,aAAarB,EAAmBI,IAAa,CAAC,KAAK;AAAA,YAElD,UAAAO;AAAA,UAAA;AAAA,QACH;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAIR;"}
|
@@ -1,61 +1,61 @@
|
|
1
1
|
import { jsx as r, jsxs as a } from "react/jsx-runtime";
|
2
|
-
import { memo as P, useCallback as x, useEffect as
|
2
|
+
import { memo as P, useCallback as x, useEffect as m } from "react";
|
3
3
|
import { ILLUSTRATIONS as T } from "../../../../assets/illustrations/illustrations.js";
|
4
|
-
import
|
5
|
-
import
|
6
|
-
import
|
7
|
-
import
|
4
|
+
import v from "../../../ui/error/error.js";
|
5
|
+
import y from "../../../ui/image/image.js";
|
6
|
+
import C from "../../../ui/layout/flex-view.js";
|
7
|
+
import I from "../../../ui/loader/app-loader/app-loader.js";
|
8
8
|
import d from "../../../ui/separator/separator.js";
|
9
|
-
import
|
10
|
-
import { useGetTrialPricing as
|
11
|
-
import { useTrialSessionContext as
|
12
|
-
import
|
13
|
-
import
|
14
|
-
import { Container as
|
9
|
+
import L from "../../../ui/text/text.js";
|
10
|
+
import { useGetTrialPricing as S } from "../../api/trial-pricing.js";
|
11
|
+
import { useTrialSessionContext as $ } from "../../context/use-trial-session-context.js";
|
12
|
+
import w from "../slide-header/index.js";
|
13
|
+
import A from "./pricing-cards.js";
|
14
|
+
import { Container as b, PricingWrapper as D, PolicyWrapper as E, RefundImageWrapper as W } from "./pricing-styled.js";
|
15
15
|
const z = P(() => {
|
16
|
-
const { isTeacher: f, studentId: i, updateButtonState: s } =
|
16
|
+
const { isTeacher: f, studentId: i, updateButtonState: s } = $(), {
|
17
17
|
data: g,
|
18
18
|
get: p,
|
19
19
|
isProcessed: e,
|
20
20
|
isProcessing: t,
|
21
21
|
isProcessingFailed: h
|
22
|
-
} =
|
22
|
+
} = S("trial-v3-pricing", {
|
23
23
|
student_id: i
|
24
|
-
}), { plans: o,
|
24
|
+
}), { plans: o, intent_level: c } = g || {}, n = x(() => {
|
25
25
|
i && !e && p("trial-v3-pricing", { student_id: i });
|
26
26
|
}, [p, e, i]);
|
27
|
-
return
|
27
|
+
return m(() => {
|
28
28
|
n();
|
29
|
-
}, [n]),
|
29
|
+
}, [n]), m(() => {
|
30
30
|
s("right", { isDisabled: t, isLoading: !1 });
|
31
|
-
}, [t, f, s]), t ? /* @__PURE__ */ r(
|
31
|
+
}, [t, f, s]), t ? /* @__PURE__ */ r(I, { height: "100vh" }) : h ? /* @__PURE__ */ r(v, { height: "100vh", onTryAgain: n }) : e ? /* @__PURE__ */ a(b, { children: [
|
32
32
|
/* @__PURE__ */ r(d, { height: 60 }),
|
33
|
-
/* @__PURE__ */ r(
|
33
|
+
/* @__PURE__ */ r(w, { marginBottom: 38 }),
|
34
34
|
/* @__PURE__ */ a(D, { children: [
|
35
35
|
/* @__PURE__ */ r(
|
36
|
-
|
36
|
+
C,
|
37
37
|
{
|
38
38
|
$width: "100%",
|
39
39
|
$flexDirection: "row",
|
40
40
|
$justifyContent: "space-between",
|
41
41
|
$flexGap: 20,
|
42
42
|
$flexWrap: !0,
|
43
|
-
children: c && o && Array.isArray(o) && o.map((u,
|
44
|
-
|
43
|
+
children: c && o && Array.isArray(o) && o.map((u, l) => /* @__PURE__ */ r(
|
44
|
+
A,
|
45
45
|
{
|
46
|
-
colorIndex:
|
46
|
+
colorIndex: l,
|
47
47
|
intentType: c,
|
48
48
|
pricingConfig: u
|
49
49
|
},
|
50
|
-
|
50
|
+
l
|
51
51
|
))
|
52
52
|
}
|
53
53
|
),
|
54
54
|
/* @__PURE__ */ r(d, { height: 50 }),
|
55
55
|
/* @__PURE__ */ a(E, { children: [
|
56
|
-
/* @__PURE__ */ r(
|
56
|
+
/* @__PURE__ */ r(L, { $renderAs: "ab1-bold", $color: "GREEN_6", children: "We have a no-questions-asked refund policy" }),
|
57
57
|
/* @__PURE__ */ r(W, { children: /* @__PURE__ */ r(
|
58
|
-
|
58
|
+
y,
|
59
59
|
{
|
60
60
|
src: T.REFUND_POLICY,
|
61
61
|
width: 168,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"pricing.js","sources":["../../../../../src/features/trial-session/comps/pricing/pricing.tsx"],"sourcesContent":["import { memo, useCallback, useEffect } from 'react';\n\nimport { ILLUSTRATIONS } from '../../../../assets/illustrations/illustrations';\nimport Error from '../../../ui/error/error';\nimport Image from '../../../ui/image/image';\nimport FlexView from '../../../ui/layout/flex-view';\nimport AppLoader from '../../../ui/loader/app-loader/app-loader';\nimport Separator from '../../../ui/separator/separator';\nimport Text from '../../../ui/text/text';\nimport { useGetTrialPricing } from '../../api/trial-pricing';\nimport { useTrialSessionContext } from '../../context/use-trial-session-context';\nimport SlideHeader from '../slide-header';\nimport PricingCards from './pricing-cards';\nimport * as Styled from './pricing-styled';\n\nconst SessionPricing = memo(() => {\n const { isTeacher, studentId, updateButtonState } = useTrialSessionContext();\n\n const {\n data: pricingData,\n get: getTrialPricing,\n isProcessed,\n isProcessing,\n isProcessingFailed,\n } = useGetTrialPricing('trial-v3-pricing', {\n student_id: studentId,\n });\n\n const { plans: pricingPlans,
|
1
|
+
{"version":3,"file":"pricing.js","sources":["../../../../../src/features/trial-session/comps/pricing/pricing.tsx"],"sourcesContent":["import { memo, useCallback, useEffect } from 'react';\n\nimport { ILLUSTRATIONS } from '../../../../assets/illustrations/illustrations';\nimport Error from '../../../ui/error/error';\nimport Image from '../../../ui/image/image';\nimport FlexView from '../../../ui/layout/flex-view';\nimport AppLoader from '../../../ui/loader/app-loader/app-loader';\nimport Separator from '../../../ui/separator/separator';\nimport Text from '../../../ui/text/text';\nimport { useGetTrialPricing } from '../../api/trial-pricing';\nimport { useTrialSessionContext } from '../../context/use-trial-session-context';\nimport SlideHeader from '../slide-header';\nimport PricingCards from './pricing-cards';\nimport * as Styled from './pricing-styled';\n\nconst SessionPricing = memo(() => {\n const { isTeacher, studentId, updateButtonState } = useTrialSessionContext();\n\n const {\n data: pricingData,\n get: getTrialPricing,\n isProcessed,\n isProcessing,\n isProcessingFailed,\n } = useGetTrialPricing('trial-v3-pricing', {\n student_id: studentId,\n });\n\n const { plans: pricingPlans, intent_level: intentLevel } = pricingData || {};\n const fetchData = useCallback(() => {\n if (studentId && !isProcessed) {\n getTrialPricing('trial-v3-pricing', { student_id: studentId });\n }\n }, [getTrialPricing, isProcessed, studentId]);\n\n useEffect(() => {\n fetchData();\n }, [fetchData]);\n\n useEffect(() => {\n updateButtonState('right', { isDisabled: isProcessing, isLoading: false });\n }, [isProcessing, isTeacher, updateButtonState]);\n\n if (isProcessing) {\n return <AppLoader height=\"100vh\" />;\n }\n\n if (isProcessingFailed) {\n return <Error height=\"100vh\" onTryAgain={fetchData} />;\n }\n\n if (isProcessed) {\n return (\n <Styled.Container>\n <Separator height={60} />\n <SlideHeader marginBottom={38} />\n <Styled.PricingWrapper>\n <FlexView\n $width=\"100%\"\n $flexDirection=\"row\"\n $justifyContent=\"space-between\"\n $flexGap={20}\n $flexWrap\n >\n {intentLevel &&\n pricingPlans &&\n Array.isArray(pricingPlans) &&\n pricingPlans.map((pricing, index) => {\n return (\n <PricingCards\n key={index}\n colorIndex={index}\n intentType={intentLevel}\n pricingConfig={pricing}\n />\n );\n })}\n </FlexView>\n <Separator height={50} />\n <Styled.PolicyWrapper>\n <Text $renderAs=\"ab1-bold\" $color=\"GREEN_6\">\n We have a no-questions-asked refund policy\n </Text>\n <Styled.RefundImageWrapper>\n <Image\n src={ILLUSTRATIONS.REFUND_POLICY}\n width={168}\n height={100}\n withLoader={false}\n />\n </Styled.RefundImageWrapper>\n </Styled.PolicyWrapper>\n </Styled.PricingWrapper>\n </Styled.Container>\n );\n }\n\n return null;\n});\n\nexport default SessionPricing;\n"],"names":["SessionPricing","memo","isTeacher","studentId","updateButtonState","useTrialSessionContext","pricingData","getTrialPricing","isProcessed","isProcessing","isProcessingFailed","useGetTrialPricing","pricingPlans","intentLevel","fetchData","useCallback","useEffect","jsx","AppLoader","Error","jsxs","Styled.Container","Separator","SlideHeader","Styled.PricingWrapper","FlexView","pricing","index","PricingCards","Styled.PolicyWrapper","Text","Styled.RefundImageWrapper","Image","ILLUSTRATIONS"],"mappings":";;;;;;;;;;;;;;AAeM,MAAAA,IAAiBC,EAAK,MAAM;AAChC,QAAM,EAAE,WAAAC,GAAW,WAAAC,GAAW,mBAAAC,MAAsBC,EAAuB,GAErE;AAAA,IACJ,MAAMC;AAAA,IACN,KAAKC;AAAA,IACL,aAAAC;AAAA,IACA,cAAAC;AAAA,IACA,oBAAAC;AAAA,EAAA,IACEC,EAAmB,oBAAoB;AAAA,IACzC,YAAYR;AAAA,EAAA,CACb,GAEK,EAAE,OAAOS,GAAc,cAAcC,EAAY,IAAIP,KAAe,IACpEQ,IAAYC,EAAY,MAAM;AAC9B,IAAAZ,KAAa,CAACK,KAChBD,EAAgB,oBAAoB,EAAE,YAAYJ,EAAW,CAAA;AAAA,EAE9D,GAAA,CAACI,GAAiBC,GAAaL,CAAS,CAAC;AAU5C,SARAa,EAAU,MAAM;AACJ,IAAAF;EAAA,GACT,CAACA,CAAS,CAAC,GAEdE,EAAU,MAAM;AACd,IAAAZ,EAAkB,SAAS,EAAE,YAAYK,GAAc,WAAW,IAAO;AAAA,EACxE,GAAA,CAACA,GAAcP,GAAWE,CAAiB,CAAC,GAE3CK,IACK,gBAAAQ,EAACC,GAAU,EAAA,QAAO,QAAQ,CAAA,IAG/BR,IACM,gBAAAO,EAAAE,GAAA,EAAM,QA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
|
@@ -93,6 +93,5 @@
|
|
93
93
|
"vite-plugin-dts": "3.6.4",
|
94
94
|
"vite-plugin-svgr": "3.2.0",
|
95
95
|
"vite-tsconfig-paths": "^4.2.2"
|
96
|
-
}
|
97
|
-
"packageManager": "yarn@4.4.1"
|
96
|
+
}
|
98
97
|
}
|