@hhgtech/hhg-components 1.28.67 → 1.28.69
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/build/BMI_BOYS.percentile.monthly-48c9471d.js +688 -0
- package/build/BMI_BOYS.percentile.weekly-4965852e.js +182 -0
- package/build/BMI_BOYS.percentile.yearly-0f7cc8f4.js +83 -0
- package/build/BMI_BOYS.zscore.monthly-5bb8a433.js +440 -0
- package/build/BMI_BOYS.zscore.weekly-3d56f80f.js +118 -0
- package/build/BMI_BOYS.zscore.yearly-57081f24.js +55 -0
- package/build/BMI_GIRLS.percentile.monthly-95859cd9.js +688 -0
- package/build/BMI_GIRLS.percentile.weekly-009cf4df.js +182 -0
- package/build/BMI_GIRLS.percentile.yearly-4436947b.js +83 -0
- package/build/BMI_GIRLS.zscore.monthly-689b4eee.js +440 -0
- package/build/BMI_GIRLS.zscore.weekly-dff693df.js +118 -0
- package/build/BMI_GIRLS.zscore.yearly-05ef5f4f.js +55 -0
- package/build/ChevronDown-275f1ab5.js +29 -0
- package/build/HEAD CIRCUM_BOYS.percentile.monthly-55c580a7.js +688 -0
- package/build/HEAD CIRCUM_BOYS.percentile.weekly-e30f4a42.js +182 -0
- package/build/HEAD CIRCUM_BOYS.percentile.yearly-2378a5f0.js +83 -0
- package/build/HEAD CIRCUM_BOYS.zscore.monthly-102d5559.js +440 -0
- package/build/HEAD CIRCUM_BOYS.zscore.weekly-7b0f1ba8.js +118 -0
- package/build/HEAD CIRCUM_BOYS.zscore.yearly-e9237d31.js +55 -0
- package/build/HEAD CIRCUM_GIRLS.percentile.monthly-1ddda8b3.js +688 -0
- package/build/HEAD CIRCUM_GIRLS.percentile.weekly-843147ea.js +182 -0
- package/build/HEAD CIRCUM_GIRLS.percentile.yearly-9b51c237.js +83 -0
- package/build/HEAD CIRCUM_GIRLS.zscore.monthly-3f1b233c.js +440 -0
- package/build/HEAD CIRCUM_GIRLS.zscore.weekly-9e14d3fe.js +118 -0
- package/build/HEAD CIRCUM_GIRLS.zscore.yearly-d924f5ae.js +55 -0
- package/build/HEIGHT_BOYS.percentile.monthly-15538920.js +688 -0
- package/build/HEIGHT_BOYS.percentile.weekly-10bd0277.js +182 -0
- package/build/HEIGHT_BOYS.percentile.yearly-8e678d38.js +237 -0
- package/build/HEIGHT_BOYS.zscore.monthly-2c110da9.js +440 -0
- package/build/HEIGHT_BOYS.zscore.weekly-288b7733.js +118 -0
- package/build/HEIGHT_BOYS.zscore.yearly-42f6f9f7.js +153 -0
- package/build/HEIGHT_GIRLS.percentile.monthly-04abe7d2.js +688 -0
- package/build/HEIGHT_GIRLS.percentile.weekly-9653b16c.js +182 -0
- package/build/HEIGHT_GIRLS.percentile.yearly-9efacd67.js +237 -0
- package/build/HEIGHT_GIRLS.zscore.monthly-c64a97b2.js +440 -0
- package/build/HEIGHT_GIRLS.zscore.weekly-3302dd83.js +118 -0
- package/build/HEIGHT_GIRLS.zscore.yearly-ebe5114f.js +153 -0
- package/build/Subot-5fc40fb5.js +217 -0
- package/build/Visible-5c5d57cf.js +29 -0
- package/build/WEIGHT_BOYS.percentile.monthly-5e11e7a0.js +688 -0
- package/build/WEIGHT_BOYS.percentile.weekly-68ae2578.js +182 -0
- package/build/WEIGHT_BOYS.percentile.yearly-030c06a4.js +138 -0
- package/build/WEIGHT_BOYS.zscore.monthly-d22c7b57.js +440 -0
- package/build/WEIGHT_BOYS.zscore.weekly-d8d901e6.js +118 -0
- package/build/WEIGHT_BOYS.zscore.yearly-c311a084.js +90 -0
- package/build/WEIGHT_GIRLS.percentile.monthly-5c44f8eb.js +688 -0
- package/build/WEIGHT_GIRLS.percentile.weekly-faa98671.js +182 -0
- package/build/WEIGHT_GIRLS.percentile.yearly-560b862e.js +138 -0
- package/build/WEIGHT_GIRLS.zscore.monthly-5365ba1a.js +440 -0
- package/build/WEIGHT_GIRLS.zscore.weekly-0d9dc521.js +118 -0
- package/build/WEIGHT_GIRLS.zscore.yearly-5a3c4e43.js +90 -0
- package/build/adapters.js +36 -1
- package/build/{esm/animation-0340efb3.js → animation-eb4e500b.js} +32 -10
- package/build/babyGrowth.js +913 -47
- package/build/cache.js +13 -1
- package/build/care.js +38 -1
- package/build/components/navigationV2/hooks/useNavConfig.d.ts +1 -3
- package/build/components.js +186 -1
- package/build/constants-8b8bc19f.js +255 -0
- package/build/constants-ae18ce18.js +935 -0
- package/build/constants.js +43 -1
- package/build/cookieHelper-5c9f4bb8.js +43 -0
- package/build/core-2aa8d86c.js +51 -0
- package/build/dataTransform-089f414c.js +66 -0
- package/build/ecom.js +745 -1
- package/build/esm/BMI_BOYS.percentile.monthly-de5dce68.js +686 -0
- package/build/esm/BMI_BOYS.percentile.weekly-9d3990b6.js +180 -0
- package/build/esm/BMI_BOYS.percentile.yearly-98b9114a.js +81 -0
- package/build/esm/BMI_BOYS.zscore.monthly-394646f0.js +438 -0
- package/build/esm/BMI_BOYS.zscore.weekly-c669ea51.js +116 -0
- package/build/esm/BMI_BOYS.zscore.yearly-771ef6b6.js +53 -0
- package/build/esm/BMI_GIRLS.percentile.monthly-1ff3d499.js +686 -0
- package/build/esm/BMI_GIRLS.percentile.weekly-211d2f27.js +180 -0
- package/build/esm/BMI_GIRLS.percentile.yearly-206fdcff.js +81 -0
- package/build/esm/BMI_GIRLS.zscore.monthly-b1137e36.js +438 -0
- package/build/esm/BMI_GIRLS.zscore.weekly-63ed3cd6.js +116 -0
- package/build/esm/BMI_GIRLS.zscore.yearly-221d187c.js +53 -0
- package/build/esm/ChevronDown-9a8ece61.js +7 -0
- package/build/esm/HEAD CIRCUM_BOYS.percentile.monthly-4c37847c.js +686 -0
- package/build/esm/HEAD CIRCUM_BOYS.percentile.weekly-8f6ea38a.js +180 -0
- package/build/esm/HEAD CIRCUM_BOYS.percentile.yearly-6c12a99a.js +81 -0
- package/build/esm/HEAD CIRCUM_BOYS.zscore.monthly-c531b497.js +438 -0
- package/build/esm/HEAD CIRCUM_BOYS.zscore.weekly-6cafba00.js +116 -0
- package/build/esm/HEAD CIRCUM_BOYS.zscore.yearly-fe8114a0.js +53 -0
- package/build/esm/HEAD CIRCUM_GIRLS.percentile.monthly-25ce0d36.js +686 -0
- package/build/esm/HEAD CIRCUM_GIRLS.percentile.weekly-5d3f2862.js +180 -0
- package/build/esm/HEAD CIRCUM_GIRLS.percentile.yearly-2b709ca5.js +81 -0
- package/build/esm/HEAD CIRCUM_GIRLS.zscore.monthly-e8617bae.js +438 -0
- package/build/esm/HEAD CIRCUM_GIRLS.zscore.weekly-f3252d67.js +116 -0
- package/build/esm/HEAD CIRCUM_GIRLS.zscore.yearly-5b62d41f.js +53 -0
- package/build/esm/HEIGHT_BOYS.percentile.monthly-63d2cf96.js +686 -0
- package/build/esm/HEIGHT_BOYS.percentile.weekly-8ea5102d.js +180 -0
- package/build/esm/HEIGHT_BOYS.percentile.yearly-8107b77b.js +235 -0
- package/build/esm/HEIGHT_BOYS.zscore.monthly-641cdfa3.js +438 -0
- package/build/esm/HEIGHT_BOYS.zscore.weekly-86da0362.js +116 -0
- package/build/esm/HEIGHT_BOYS.zscore.yearly-060f6e79.js +151 -0
- package/build/esm/HEIGHT_GIRLS.percentile.monthly-fb987d37.js +686 -0
- package/build/esm/HEIGHT_GIRLS.percentile.weekly-82655dc0.js +180 -0
- package/build/esm/HEIGHT_GIRLS.percentile.yearly-a63b8456.js +235 -0
- package/build/esm/HEIGHT_GIRLS.zscore.monthly-77d676a3.js +438 -0
- package/build/esm/HEIGHT_GIRLS.zscore.weekly-c0387a4e.js +116 -0
- package/build/esm/HEIGHT_GIRLS.zscore.yearly-41203c20.js +151 -0
- package/build/esm/Subot-3289bd8e.js +212 -0
- package/build/esm/Visible-a3d436dd.js +7 -0
- package/build/esm/WEIGHT_BOYS.percentile.monthly-50802d8b.js +686 -0
- package/build/esm/WEIGHT_BOYS.percentile.weekly-4d72ddd6.js +180 -0
- package/build/esm/WEIGHT_BOYS.percentile.yearly-20a29844.js +136 -0
- package/build/esm/WEIGHT_BOYS.zscore.monthly-729e6614.js +438 -0
- package/build/esm/WEIGHT_BOYS.zscore.weekly-90352f48.js +116 -0
- package/build/esm/WEIGHT_BOYS.zscore.yearly-fe1871cc.js +88 -0
- package/build/esm/WEIGHT_GIRLS.percentile.monthly-e6afb2e0.js +686 -0
- package/build/esm/WEIGHT_GIRLS.percentile.weekly-b66d3016.js +180 -0
- package/build/esm/WEIGHT_GIRLS.percentile.yearly-a55622c5.js +136 -0
- package/build/esm/WEIGHT_GIRLS.zscore.monthly-2cdcbe75.js +438 -0
- package/build/esm/WEIGHT_GIRLS.zscore.weekly-d5be31d5.js +116 -0
- package/build/esm/WEIGHT_GIRLS.zscore.yearly-99e8d3a7.js +88 -0
- package/build/esm/adapters.js +26 -1
- package/build/{animation-d5d9ef32.js → esm/animation-3d5edc39.js} +22 -10
- package/build/esm/babyGrowth.js +883 -47
- package/build/esm/cache.js +3 -1
- package/build/esm/care.js +26 -1
- package/build/esm/components/navigationV2/hooks/useNavConfig.d.ts +1 -3
- package/build/esm/components.js +88 -1
- package/build/esm/constants-2a6d2434.js +932 -0
- package/build/esm/constants-b77ffe3d.js +238 -0
- package/build/esm/constants.js +4 -1
- package/build/esm/cookieHelper-d314282c.js +39 -0
- package/build/esm/core-8c73d133.js +47 -0
- package/build/esm/dataTransform-8ecfc046.js +56 -0
- package/build/esm/ecom.js +737 -1
- package/build/esm/footer.js +31 -1
- package/build/esm/gAssets.js +5 -1
- package/build/esm/getDynamicHealthTool-f4497aa5.js +44 -0
- package/build/esm/getSocialList-a5b8462e.js +66 -0
- package/build/esm/hooks.js +21 -1
- package/build/esm/i18n-values/en-PH.js +600 -1
- package/build/esm/i18n-values/hi-IN.js +600 -1
- package/build/esm/i18n-values/id-ID.js +600 -1
- package/build/esm/i18n-values/km-KH.js +600 -1
- package/build/esm/i18n-values/ms-MY.js +602 -1
- package/build/esm/i18n-values/my-MM.js +600 -1
- package/build/esm/i18n-values/th-TH.js +600 -1
- package/build/esm/i18n-values/tl-PH.js +600 -1
- package/build/esm/i18n-values/vi-VN.js +607 -1
- package/build/esm/i18n-values/vi-VN_MB.js +607 -1
- package/build/esm/i18n-values/zh-TW.js +600 -1
- package/build/esm/i18n.js +55 -1
- package/build/esm/i18nV2.js +18 -1
- package/build/esm/index-12fa4985.js +8 -0
- package/build/esm/index-1e59f99a.js +152 -0
- package/build/esm/index-32e53dac.js +1936 -0
- package/build/esm/index-3474401a.js +149 -0
- package/build/esm/index-34899aa3.js +17 -0
- package/build/esm/index-350e8f5b.js +124 -0
- package/build/esm/index-41bf860a.js +151 -0
- package/build/esm/index-4aa8e518.js +116 -0
- package/build/esm/index-4fe2b03f.js +32 -0
- package/build/esm/index-6ea6484e.js +29 -0
- package/build/esm/index-717401ee.js +184 -0
- package/build/esm/index-7af5242a.js +24 -0
- package/build/esm/index-7b8c85cd.js +8302 -0
- package/build/esm/index-81f295b7.js +23 -0
- package/build/esm/index-8858383e.js +52 -0
- package/build/esm/index-8f52dcf3.js +33 -0
- package/build/esm/index-9ea7e838.js +33 -0
- package/build/esm/index-aabac2aa.js +3241 -0
- package/build/esm/index-b9b2c417.js +837 -0
- package/build/esm/index-c2da5293.js +12 -0
- package/build/esm/index-c56d60db.js +370 -0
- package/build/esm/index-c5d7f692.js +24 -0
- package/build/esm/index-cc93e010.js +53 -0
- package/build/esm/index-d7f046db.js +5 -0
- package/build/esm/index-d8177667.js +14 -0
- package/build/esm/index-da139dda.js +615 -0
- package/build/esm/index-e612be9c.js +905 -0
- package/build/esm/index-f3d0592b.js +71 -0
- package/build/esm/index.js +190 -1
- package/build/{index.styled-0a1fb891.js → esm/index.styled-9c9db9cc.js} +17 -5
- package/build/esm/index.styles-5add27c5.js +1303 -0
- package/build/esm/isProduction-0ea904dd.js +27 -0
- package/build/esm/lead.js +2140 -1
- package/build/esm/localizeNumberFormat-2ac3773e.js +23 -0
- package/build/esm/mantine.js +113 -1
- package/build/esm/misc.js +22 -1
- package/build/esm/navigation.js +51 -1
- package/build/esm/normalizeLink-d1c9617e.js +12 -0
- package/build/esm/number-0c126a39.js +38 -0
- package/build/esm/onboardingV2.js +860 -34
- package/build/esm/paths-a8204db4.js +14 -0
- package/build/esm/pwg.js +208 -7
- package/build/esm/routing-2474f896.js +40 -0
- package/build/esm/subot.js +4553 -134
- package/build/esm/theme-e74db08c.js +186 -0
- package/build/esm/together.js +52 -1
- package/build/esm/translationsContext-ad3e25de.js +5 -0
- package/build/esm/tslib.es6-1b1533a9.js +38 -0
- package/build/esm/types-06f00b3d.js +8015 -0
- package/build/esm/types-15e34418.js +3432 -0
- package/build/esm/types-ba190c26.js +21 -0
- package/build/esm/types.js +1 -1
- package/build/esm/unifyEnv.js +42 -1
- package/build/esm/useCategory-2c87152d.js +292 -0
- package/build/esm/useHealthToolCache-29d22ddb.js +17 -0
- package/build/esm/useIsInit-8a2fc8e5.js +11 -0
- package/build/esm/useOutsideClick-c8a7ff20.js +45 -0
- package/build/esm/usePlacesAutocomplete-63e04e8e.js +80 -0
- package/build/esm/useScrollbarSize-51ce1374.js +57 -0
- package/build/esm/useTranslations-4f1db486.js +26 -0
- package/build/esm/useUniqueId-3638402f.js +41 -0
- package/build/esm/utils-2c484c05.js +132 -0
- package/build/esm/utils-3a2a47d9.js +22 -0
- package/build/esm/utils-6d7b88da.js +367 -0
- package/build/esm/utils-70718e9c.js +1124 -0
- package/build/esm/vaccination.js +868 -40
- package/build/footer.js +39 -1
- package/build/gAssets.js +14 -1
- package/build/getDynamicHealthTool-114a1e27.js +48 -0
- package/build/getSocialList-4713441d.js +72 -0
- package/build/hooks.js +44 -1
- package/build/i18n-values/en-PH.js +611 -1
- package/build/i18n-values/hi-IN.js +611 -1
- package/build/i18n-values/id-ID.js +611 -1
- package/build/i18n-values/km-KH.js +611 -1
- package/build/i18n-values/ms-MY.js +613 -1
- package/build/i18n-values/my-MM.js +611 -1
- package/build/i18n-values/th-TH.js +611 -1
- package/build/i18n-values/tl-PH.js +611 -1
- package/build/i18n-values/vi-VN.js +618 -1
- package/build/i18n-values/vi-VN_MB.js +618 -1
- package/build/i18n-values/zh-TW.js +611 -1
- package/build/i18n.js +64 -1
- package/build/i18nV2.js +26 -1
- package/build/index-020e6908.js +39 -0
- package/build/index-0da9b2e8.js +59 -0
- package/build/index-11468c00.js +157 -0
- package/build/index-117448a5.js +133 -0
- package/build/index-12c07f71.js +18 -0
- package/build/index-1a105e87.js +123 -0
- package/build/index-1baaedb0.js +55 -0
- package/build/index-32d38318.js +7 -0
- package/build/index-38582ee0.js +8373 -0
- package/build/index-3e5fc2d6.js +1994 -0
- package/build/index-3eef6bed.js +853 -0
- package/build/index-4035e658.js +159 -0
- package/build/index-488d71ae.js +30 -0
- package/build/index-5553f9e1.js +930 -0
- package/build/index-5fa68e45.js +380 -0
- package/build/index-7b467209.js +39 -0
- package/build/index-81cb1142.js +77 -0
- package/build/index-84ab5b89.js +38 -0
- package/build/index-8a95d709.js +30 -0
- package/build/index-9da9f0c3.js +35 -0
- package/build/index-af91c83e.js +20 -0
- package/build/index-b6aea85e.js +191 -0
- package/build/index-bc4f4c33.js +156 -0
- package/build/index-c604d6bb.js +624 -0
- package/build/index-d330735e.js +30 -0
- package/build/index-d8a7efaf.js +14 -0
- package/build/index-e2e81fa2.js +23 -0
- package/build/index-e3d896b3.js +3261 -0
- package/build/index.js +436 -1
- package/build/{esm/index.styled-14b65c9e.js → index.styled-5628b3e7.js} +25 -5
- package/build/index.styles-b822bf42.js +1342 -0
- package/build/isProduction-5ce3a388.js +29 -0
- package/build/lead.js +2168 -1
- package/build/localizeNumberFormat-f5f50987.js +31 -0
- package/build/mantine.js +154 -1
- package/build/misc.js +70 -1
- package/build/navigation.js +61 -1
- package/build/normalizeLink-6f7b85d8.js +15 -0
- package/build/number-79fe92e1.js +40 -0
- package/build/onboardingV2.js +892 -34
- package/build/paths-a5643d9e.js +16 -0
- package/build/pwg.js +217 -7
- package/build/routing-191a9a00.js +46 -0
- package/build/subot.js +4592 -134
- package/build/theme-fa910869.js +189 -0
- package/build/together.js +112 -1
- package/build/translationsContext-950334bf.js +7 -0
- package/build/tslib.es6-65e312a5.js +41 -0
- package/build/types-0f117a9f.js +8084 -0
- package/build/types-1fedb3d1.js +3446 -0
- package/build/types-52a4e888.js +24 -0
- package/build/types.js +56 -1
- package/build/unifyEnv.js +46 -1
- package/build/useCategory-cfc702f5.js +299 -0
- package/build/useHealthToolCache-43a7014d.js +19 -0
- package/build/useIsInit-89535012.js +13 -0
- package/build/useOutsideClick-c6813964.js +49 -0
- package/build/usePlacesAutocomplete-297de092.js +84 -0
- package/build/useScrollbarSize-0fa31aa7.js +64 -0
- package/build/useTranslations-e1853417.js +32 -0
- package/build/useUniqueId-11369116.js +44 -0
- package/build/utils-52113753.js +384 -0
- package/build/utils-64bd0c42.js +143 -0
- package/build/utils-661411f6.js +1171 -0
- package/build/utils-e1513cbc.js +25 -0
- package/build/vaccination.js +891 -40
- package/package.json +4 -5
- package/build/BMI_BOYS.percentile.monthly-c56b0165.js +0 -1
- package/build/BMI_BOYS.percentile.weekly-64287e04.js +0 -1
- package/build/BMI_BOYS.percentile.yearly-8db65d54.js +0 -1
- package/build/BMI_BOYS.zscore.monthly-f12389cd.js +0 -1
- package/build/BMI_BOYS.zscore.weekly-fff37a57.js +0 -1
- package/build/BMI_BOYS.zscore.yearly-a19b57eb.js +0 -1
- package/build/BMI_GIRLS.percentile.monthly-a4b36d7d.js +0 -1
- package/build/BMI_GIRLS.percentile.weekly-b6089202.js +0 -1
- package/build/BMI_GIRLS.percentile.yearly-0d340818.js +0 -1
- package/build/BMI_GIRLS.zscore.monthly-fd5b57c0.js +0 -1
- package/build/BMI_GIRLS.zscore.weekly-d4577f50.js +0 -1
- package/build/BMI_GIRLS.zscore.yearly-e40b8a7d.js +0 -1
- package/build/ChevronDown-602ce39e.js +0 -1
- package/build/HEAD CIRCUM_BOYS.percentile.monthly-2e4c5776.js +0 -1
- package/build/HEAD CIRCUM_BOYS.percentile.weekly-fc5728a5.js +0 -1
- package/build/HEAD CIRCUM_BOYS.percentile.yearly-6bfab277.js +0 -1
- package/build/HEAD CIRCUM_BOYS.zscore.monthly-6af7ce44.js +0 -1
- package/build/HEAD CIRCUM_BOYS.zscore.weekly-9adb819b.js +0 -1
- package/build/HEAD CIRCUM_BOYS.zscore.yearly-9a6cdbcf.js +0 -1
- package/build/HEAD CIRCUM_GIRLS.percentile.monthly-e7bfe9c6.js +0 -1
- package/build/HEAD CIRCUM_GIRLS.percentile.weekly-9f17e019.js +0 -1
- package/build/HEAD CIRCUM_GIRLS.percentile.yearly-8a59f541.js +0 -1
- package/build/HEAD CIRCUM_GIRLS.zscore.monthly-b7ddb16c.js +0 -1
- package/build/HEAD CIRCUM_GIRLS.zscore.weekly-72701c55.js +0 -1
- package/build/HEAD CIRCUM_GIRLS.zscore.yearly-dd94bded.js +0 -1
- package/build/HEIGHT_BOYS.percentile.monthly-b890068c.js +0 -1
- package/build/HEIGHT_BOYS.percentile.weekly-a1aa5130.js +0 -1
- package/build/HEIGHT_BOYS.percentile.yearly-5727d920.js +0 -1
- package/build/HEIGHT_BOYS.zscore.monthly-13b70aa6.js +0 -1
- package/build/HEIGHT_BOYS.zscore.weekly-3e1d7f23.js +0 -1
- package/build/HEIGHT_BOYS.zscore.yearly-a956102d.js +0 -1
- package/build/HEIGHT_GIRLS.percentile.monthly-da5ec01b.js +0 -1
- package/build/HEIGHT_GIRLS.percentile.weekly-e6205d32.js +0 -1
- package/build/HEIGHT_GIRLS.percentile.yearly-caefa502.js +0 -1
- package/build/HEIGHT_GIRLS.zscore.monthly-102ba473.js +0 -1
- package/build/HEIGHT_GIRLS.zscore.weekly-db4f710b.js +0 -1
- package/build/HEIGHT_GIRLS.zscore.yearly-36465920.js +0 -1
- package/build/Subot-4751194d.js +0 -1
- package/build/Visible-9497c463.js +0 -1
- package/build/WEIGHT_BOYS.percentile.monthly-554d0361.js +0 -1
- package/build/WEIGHT_BOYS.percentile.weekly-8e5334b8.js +0 -1
- package/build/WEIGHT_BOYS.percentile.yearly-536e1ccb.js +0 -1
- package/build/WEIGHT_BOYS.zscore.monthly-01eccee1.js +0 -1
- package/build/WEIGHT_BOYS.zscore.weekly-ee8f2c6b.js +0 -1
- package/build/WEIGHT_BOYS.zscore.yearly-0aea2749.js +0 -1
- package/build/WEIGHT_GIRLS.percentile.monthly-7abf9d06.js +0 -1
- package/build/WEIGHT_GIRLS.percentile.weekly-f9b6e963.js +0 -1
- package/build/WEIGHT_GIRLS.percentile.yearly-254865a5.js +0 -1
- package/build/WEIGHT_GIRLS.zscore.monthly-909f7417.js +0 -1
- package/build/WEIGHT_GIRLS.zscore.weekly-e62cd084.js +0 -1
- package/build/WEIGHT_GIRLS.zscore.yearly-8d6e5405.js +0 -1
- package/build/constants-00e06f68.js +0 -108
- package/build/constants-51251306.js +0 -1
- package/build/cookieHelper-7d519a72.js +0 -1
- package/build/core-ba3af3e2.js +0 -1
- package/build/dataTransform-1805eae3.js +0 -1
- package/build/esm/BMI_BOYS.percentile.monthly-6272f835.js +0 -1
- package/build/esm/BMI_BOYS.percentile.weekly-80d18f47.js +0 -1
- package/build/esm/BMI_BOYS.percentile.yearly-a7e5b5f6.js +0 -1
- package/build/esm/BMI_BOYS.zscore.monthly-d3658f97.js +0 -1
- package/build/esm/BMI_BOYS.zscore.weekly-6e6708dc.js +0 -1
- package/build/esm/BMI_BOYS.zscore.yearly-b8400c9d.js +0 -1
- package/build/esm/BMI_GIRLS.percentile.monthly-98586b46.js +0 -1
- package/build/esm/BMI_GIRLS.percentile.weekly-7c1511b0.js +0 -1
- package/build/esm/BMI_GIRLS.percentile.yearly-ea667f90.js +0 -1
- package/build/esm/BMI_GIRLS.zscore.monthly-3a4fd1a6.js +0 -1
- package/build/esm/BMI_GIRLS.zscore.weekly-cc1de097.js +0 -1
- package/build/esm/BMI_GIRLS.zscore.yearly-6dd1a364.js +0 -1
- package/build/esm/ChevronDown-4e59cac6.js +0 -1
- package/build/esm/HEAD CIRCUM_BOYS.percentile.monthly-bd0965ae.js +0 -1
- package/build/esm/HEAD CIRCUM_BOYS.percentile.weekly-db1053f7.js +0 -1
- package/build/esm/HEAD CIRCUM_BOYS.percentile.yearly-cd38b622.js +0 -1
- package/build/esm/HEAD CIRCUM_BOYS.zscore.monthly-d7f88a95.js +0 -1
- package/build/esm/HEAD CIRCUM_BOYS.zscore.weekly-76f7db79.js +0 -1
- package/build/esm/HEAD CIRCUM_BOYS.zscore.yearly-3ce70f8e.js +0 -1
- package/build/esm/HEAD CIRCUM_GIRLS.percentile.monthly-b2e678ae.js +0 -1
- package/build/esm/HEAD CIRCUM_GIRLS.percentile.weekly-8e2664bb.js +0 -1
- package/build/esm/HEAD CIRCUM_GIRLS.percentile.yearly-f5c075a9.js +0 -1
- package/build/esm/HEAD CIRCUM_GIRLS.zscore.monthly-6f87849e.js +0 -1
- package/build/esm/HEAD CIRCUM_GIRLS.zscore.weekly-48da0aaa.js +0 -1
- package/build/esm/HEAD CIRCUM_GIRLS.zscore.yearly-4eea437b.js +0 -1
- package/build/esm/HEIGHT_BOYS.percentile.monthly-d1a8cc8e.js +0 -1
- package/build/esm/HEIGHT_BOYS.percentile.weekly-2b6cfe6c.js +0 -1
- package/build/esm/HEIGHT_BOYS.percentile.yearly-9e78afc3.js +0 -1
- package/build/esm/HEIGHT_BOYS.zscore.monthly-5292d78a.js +0 -1
- package/build/esm/HEIGHT_BOYS.zscore.weekly-fbdee645.js +0 -1
- package/build/esm/HEIGHT_BOYS.zscore.yearly-c11a8f1b.js +0 -1
- package/build/esm/HEIGHT_GIRLS.percentile.monthly-8e11e2dc.js +0 -1
- package/build/esm/HEIGHT_GIRLS.percentile.weekly-dc3965cb.js +0 -1
- package/build/esm/HEIGHT_GIRLS.percentile.yearly-490f7b4e.js +0 -1
- package/build/esm/HEIGHT_GIRLS.zscore.monthly-e3531c32.js +0 -1
- package/build/esm/HEIGHT_GIRLS.zscore.weekly-36a16a66.js +0 -1
- package/build/esm/HEIGHT_GIRLS.zscore.yearly-61736bba.js +0 -1
- package/build/esm/Subot-4642c5bf.js +0 -1
- package/build/esm/Visible-ff7d225c.js +0 -1
- package/build/esm/WEIGHT_BOYS.percentile.monthly-0cfe7ecd.js +0 -1
- package/build/esm/WEIGHT_BOYS.percentile.weekly-89802113.js +0 -1
- package/build/esm/WEIGHT_BOYS.percentile.yearly-0eb40972.js +0 -1
- package/build/esm/WEIGHT_BOYS.zscore.monthly-7f8c5a15.js +0 -1
- package/build/esm/WEIGHT_BOYS.zscore.weekly-3dcfa8ce.js +0 -1
- package/build/esm/WEIGHT_BOYS.zscore.yearly-98ce1ea0.js +0 -1
- package/build/esm/WEIGHT_GIRLS.percentile.monthly-df98e335.js +0 -1
- package/build/esm/WEIGHT_GIRLS.percentile.weekly-63fff42a.js +0 -1
- package/build/esm/WEIGHT_GIRLS.percentile.yearly-8db8cdd0.js +0 -1
- package/build/esm/WEIGHT_GIRLS.zscore.monthly-15c83c6d.js +0 -1
- package/build/esm/WEIGHT_GIRLS.zscore.weekly-747a55ec.js +0 -1
- package/build/esm/WEIGHT_GIRLS.zscore.yearly-197dc52d.js +0 -1
- package/build/esm/constants-6ecfa77c.js +0 -1
- package/build/esm/constants-f7c80032.js +0 -108
- package/build/esm/cookieHelper-4f089e3c.js +0 -1
- package/build/esm/core-80112758.js +0 -1
- package/build/esm/dataTransform-0fa341bb.js +0 -1
- package/build/esm/getDynamicHealthTool-a4c9d6dd.js +0 -1
- package/build/esm/getSocialList-4e48deba.js +0 -1
- package/build/esm/index-13dc1f44.js +0 -1
- package/build/esm/index-13e62563.js +0 -137
- package/build/esm/index-1e7ad007.js +0 -1
- package/build/esm/index-24557f2b.js +0 -1
- package/build/esm/index-252cb964.js +0 -1
- package/build/esm/index-2e99f941.js +0 -1
- package/build/esm/index-3452fed2.js +0 -1
- package/build/esm/index-3aff939b.js +0 -1
- package/build/esm/index-459e0362.js +0 -1
- package/build/esm/index-45dcd965.js +0 -1
- package/build/esm/index-486b71cd.js +0 -1
- package/build/esm/index-5408f5a4.js +0 -113
- package/build/esm/index-5e1af23a.js +0 -1
- package/build/esm/index-79ef3a30.js +0 -1
- package/build/esm/index-7c77273a.js +0 -1
- package/build/esm/index-823fd7c0.js +0 -117
- package/build/esm/index-8c77d7e0.js +0 -1
- package/build/esm/index-93e5b4f3.js +0 -1
- package/build/esm/index-9c7b9011.js +0 -2748
- package/build/esm/index-9e5956c2.js +0 -1
- package/build/esm/index-a83aad1c.js +0 -375
- package/build/esm/index-b7cc3ca2.js +0 -1
- package/build/esm/index-bf11f9e9.js +0 -50
- package/build/esm/index-ce3d38fd.js +0 -1
- package/build/esm/index-d27a0e25.js +0 -1
- package/build/esm/index-e21276e3.js +0 -1
- package/build/esm/index-f9514788.js +0 -177
- package/build/esm/index-fd04ccb7.js +0 -1430
- package/build/esm/index.styles-94af560f.js +0 -817
- package/build/esm/isProduction-00695d80.js +0 -1
- package/build/esm/localizeNumberFormat-8355a44f.js +0 -1
- package/build/esm/normalizeLink-1c194268.js +0 -1
- package/build/esm/number-1347eb7b.js +0 -1
- package/build/esm/paths-749b4b53.js +0 -1
- package/build/esm/routing-2b284b30.js +0 -1
- package/build/esm/theme-3db3c9a8.js +0 -1
- package/build/esm/translationsContext-6d2efd65.js +0 -1
- package/build/esm/tslib.es6-266309d1.js +0 -1
- package/build/esm/types-6d397125.js +0 -3004
- package/build/esm/types-850814a7.js +0 -785
- package/build/esm/types-d3da37d2.js +0 -1
- package/build/esm/useCategory-f5f74749.js +0 -1
- package/build/esm/useHealthToolCache-f1488032.js +0 -1
- package/build/esm/useIsInit-9661c5f5.js +0 -1
- package/build/esm/useOutsideClick-0704b383.js +0 -1
- package/build/esm/usePlacesAutocomplete-0733ec49.js +0 -1
- package/build/esm/useScrollbarSize-90b179a5.js +0 -1
- package/build/esm/useTranslations-df1b3bb8.js +0 -1
- package/build/esm/useUniqueId-03fbaecd.js +0 -1
- package/build/esm/utils-3d2e3f0f.js +0 -141
- package/build/esm/utils-5b4e60da.js +0 -1
- package/build/esm/utils-970ce0c0.js +0 -8
- package/build/esm/utils-b87ec473.js +0 -1
- package/build/getDynamicHealthTool-31f44ca1.js +0 -1
- package/build/getSocialList-29c0a6e8.js +0 -1
- package/build/index-1714c81c.js +0 -2748
- package/build/index-238813a4.js +0 -375
- package/build/index-2438163d.js +0 -1430
- package/build/index-29d302f4.js +0 -137
- package/build/index-3184ae4e.js +0 -1
- package/build/index-34b6bd24.js +0 -1
- package/build/index-35192783.js +0 -1
- package/build/index-41d684a8.js +0 -50
- package/build/index-4a8c8ce6.js +0 -1
- package/build/index-58e0d49f.js +0 -1
- package/build/index-64d2f812.js +0 -1
- package/build/index-85c621a2.js +0 -113
- package/build/index-90f4bc02.js +0 -1
- package/build/index-9a845847.js +0 -117
- package/build/index-9ed509d1.js +0 -1
- package/build/index-aa495d24.js +0 -1
- package/build/index-ad5cf64d.js +0 -1
- package/build/index-b21a1d96.js +0 -1
- package/build/index-b320255d.js +0 -1
- package/build/index-b9af15da.js +0 -1
- package/build/index-bd4b31bf.js +0 -1
- package/build/index-bf81cb71.js +0 -1
- package/build/index-c3cbb8f3.js +0 -1
- package/build/index-d25afe2f.js +0 -1
- package/build/index-e7c1ff53.js +0 -177
- package/build/index-ed8656f9.js +0 -1
- package/build/index-f6217f73.js +0 -1
- package/build/index-f7088d57.js +0 -1
- package/build/index.styles-2ecb9c85.js +0 -817
- package/build/isProduction-28d96804.js +0 -1
- package/build/localizeNumberFormat-22b2d7aa.js +0 -1
- package/build/normalizeLink-594ccff1.js +0 -1
- package/build/number-cf06dcc0.js +0 -1
- package/build/paths-ed72ecb8.js +0 -1
- package/build/routing-f2edd0d0.js +0 -1
- package/build/theme-f2b8aad7.js +0 -1
- package/build/translationsContext-4c4c33c4.js +0 -1
- package/build/tslib.es6-ceb091fd.js +0 -1
- package/build/types-49f0543a.js +0 -785
- package/build/types-5b303b71.js +0 -1
- package/build/types-bfd12e24.js +0 -3004
- package/build/useCategory-94d60dab.js +0 -1
- package/build/useHealthToolCache-7307d240.js +0 -1
- package/build/useIsInit-c3cf1925.js +0 -1
- package/build/useOutsideClick-15fef824.js +0 -1
- package/build/usePlacesAutocomplete-6ab0181b.js +0 -1
- package/build/useScrollbarSize-ab332673.js +0 -1
- package/build/useTranslations-233c68bc.js +0 -1
- package/build/useUniqueId-46834e18.js +0 -1
- package/build/utils-13ea4f2f.js +0 -8
- package/build/utils-45e691a3.js +0 -1
- package/build/utils-bee8be92.js +0 -141
- package/build/utils-d5766c73.js +0 -1
package/build/ecom.js
CHANGED
|
@@ -1 +1,745 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("./theme-f2b8aad7.js"),e=require("./constants-51251306.js"),o=require("./types-5b303b71.js");require("./index-90f4bc02.js"),require("date-fns/locale"),require("./Subot-4751194d.js"),require("./isProduction-28d96804.js");var i=Object.freeze({__proto__:null}),l=Object.freeze({__proto__:null});function a(t){return null!=t}const r={formatAutoCompleteAddress:t=>t&&t.place_id?{placeId:t.place_id,description:t.description||""}:null,formatPrice:(t,e)=>{const o="string"==typeof t?parseInt(t):t;return new Intl.NumberFormat(e||"vi-VN").format(o)},formatHotSearchKeyword:t=>({text:(null==t?void 0:t.name)||""}),formatHelpfulUrl:t=>({name:(null==t?void 0:t.name)||"",featuredImage:(null==t?void 0:t.featured_image)||"",url:(null==t?void 0:t.url)||""}),formatCategory:function(e,o,i){var l,a,n;const d=i?i+"/"+e.slug:e.slug,u=(null===(a=null===(l=null==e?void 0:e.children)||void 0===l?void 0:l.map)||void 0===a?void 0:a.call(l,(t=>r.formatCategory(t,e.id,d))))||[];return{id:null==e?void 0:e.id,name:(null==e?void 0:e.name)||"",logo:(null==e?void 0:e.logo)||"",slug:(null==e?void 0:e.slug)||"",fullSlug:d||"",children:u,backgroundColor:e.color||t.theme.colors.teal50,parentId:o||0,products:(null===(n=e.products)||void 0===n?void 0:n.map(r.formatProduct))||[]}},formatFooterInfo:t=>{var e,o,i,l,a,r,n,d,u,s,m,c,v,p,_,g,f,b,h;const y=(null===(i=null===(o=null===(e=null==t?void 0:t.branch)||void 0===e?void 0:e.branch)||void 0===o?void 0:o.map)||void 0===i?void 0:i.call(o,(t=>({flag:t.flag||"",name:t.name||"",url:t.url||""}))))||[],x=(null===(r=null===(a=null===(l=null==t?void 0:t.general)||void 0===l?void 0:l.verified)||void 0===a?void 0:a.map)||void 0===r?void 0:r.call(a,(t=>({image:t.image||"",url:t.url||""}))))||[],P=(null===(d=null===(n=null==t?void 0:t.menu)||void 0===n?void 0:n.map)||void 0===d?void 0:d.call(n,(t=>{var e,o;return{menu_title:t.menu_title,items:null===(o=null===(e=t.items)||void 0===e?void 0:e.map)||void 0===o?void 0:o.call(e,(t=>({title:t.title,url:t.url})))}})))||[],C=(null===(m=null===(s=null===(u=null==t?void 0:t.social)||void 0===u?void 0:u.socials)||void 0===s?void 0:s.map)||void 0===m?void 0:m.call(s,(t=>({icon:t.icon||"",name:t.name||"",url:t.url||""}))))||[];return{branch:{title:(null===(c=null==t?void 0:t.branch)||void 0===c?void 0:c.title)||"",branch:y},general:{logo:null!==(p=null===(v=null==t?void 0:t.general)||void 0===v?void 0:v.logo)&&void 0!==p?p:"",content:null!==(g=null===(_=null==t?void 0:t.general)||void 0===_?void 0:_.content)&&void 0!==g?g:"",copyright:null!==(b=null===(f=null==t?void 0:t.general)||void 0===f?void 0:f.copyright)&&void 0!==b?b:"",verified:x},menu:P,social:{title:(null===(h=null==t?void 0:t.social)||void 0===h?void 0:h.title)||"",socials:C}}},formatNavigation:function(t){var e,o,i,l,a,n;return{hotSearchKeywords:(null===(o=null===(e=null==t?void 0:t.hot_search_keywords)||void 0===e?void 0:e.map)||void 0===o?void 0:o.call(e,r.formatHotSearchKeyword))||[],helpfulUrls:(null===(l=null===(i=null==t?void 0:t.helpful_urls)||void 0===i?void 0:i.map)||void 0===l?void 0:l.call(i,r.formatHelpfulUrl))||[],categories:(null===(n=null===(a=null==t?void 0:t.categories)||void 0===a?void 0:a.map)||void 0===n?void 0:n.call(a,(t=>r.formatCategory(t))))||[],footer:r.formatFooterInfo(null==t?void 0:t.footer),storeId:(null==t?void 0:t.store_id)||0,customerId:(null==t?void 0:t.customer_id)||0,cartItemsQty:"number"==typeof(null==t?void 0:t.cart_items_qty)?t.cart_items_qty:null}},formatPriceInfo:t=>t?{final:t.final||0,regular:t.regular||0,discountPercent:t.discount_percent||0}:null,formatProduct:function(t){var e,o,i,l;if(!t)return null;const n={final:0,regular:0,discountPercent:0};return{id:t.id||0,price:t.price&&r.formatPriceInfo(t.price)||n,thumbnail:t.thumbnail||"",name:t.name||"",averageRating:Number((t.average_rating||0).toFixed(2)),reviewsCount:t.reviews_count||0,tag:t.tag||null,sku:t.sku||"",slug:t.slug||"",images:t.images||[],tags:t.tags||[],unit:t.unit||"",brand:t.brand?{name:t.brand.name||"",image:t.brand.image||"",slug:t.brand.slug||"",productsCount:t.brand.products_count||0}:null,description:t.description||"",productPromotions:(null===(o=null===(e=t.product_promotions)||void 0===e?void 0:e.map)||void 0===o?void 0:o.call(e,r.formatProductPromotion).filter(a))||[],categories:(null===(l=null===(i=t.categories)||void 0===i?void 0:i.map)||void 0===l?void 0:l.call(i,(t=>r.formatCategory(t))).filter(a))||[],isInStock:(null==t?void 0:t.is_in_stock)||!1}},formatBanner:t=>t?{name:t.name||"",url:t.url||"",featuredImage:t.featured_image||"",alt:t.image_alt}:null,formatBlogPost:t=>{var e,o;return t?{title:t.title||"",image:t.image||"",link:t.link||"",postData:t.post_data?{reviewed:t.post_data.reviewed?{author:r.formatBlogPostDataReviewedUser(t.post_data.reviewed.author||void 0),editor:r.formatBlogPostDataReviewedUser(t.post_data.reviewed.editor||void 0),expert:r.formatBlogPostDataReviewedUser(t.post_data.reviewed.expert||void 0),factCheck:r.formatBlogPostDataReviewedUser(t.post_data.reviewed.fact_check||void 0),isAuthor:Boolean(t.post_data.reviewed.is_author)}:null,categories:t.post_data.categories?null===(o=(e=t.post_data.categories).map)||void 0===o?void 0:o.call(e,(t=>({termId:t.term_id||0,name:t.name||"",permalink:t.permalink||"",textColor:t.text_color||""}))):[],postDate:t.post_data.post_date||"",postModified:t.post_data.post_modified||"",modifiedTime:t.post_data.modified_time||""}:null}:null},formatBlogPostDataReviewedUser:t=>t?{id:t.ID||0,userId:t.user_id||0,formerRole:t.former_role||"",role:t.role||"",slug:t.slug||"",displayName:t.display_name||"",description:t.description||"",profileUrl:t.profile_url||"",avatar:t.avatar||"",avatarThumbnail:t.avatar_thumbnail||"",turnOffProfile:Boolean(t.turn_off_profile)}:null,formatBrand:function(t){var e,o,i,l;return t?{id:t.id||0,image:t.image||"",position:t.position||"",isPopular:t.is_popular||!1,summary:t.summary||"",name:t.name||"",slug:t.slug||"",description:t.description||null,banners:(null===(o=null===(e=t.banners)||void 0===e?void 0:e.map)||void 0===o?void 0:o.call(e,r.formatBanner).filter(a))||[],bestsellerProducts:(null===(l=null===(i=t.bestseller_products)||void 0===i?void 0:i.map)||void 0===l?void 0:l.call(i,r.formatProduct).filter(a))||[]}:null},formatHomePage:t=>{var e,o,i,l,n,d,u,s,m,c,v,p,_,g,f,b,h,y,x,P;return t?{brands:t.brands?null===(o=(e=t.brands).map)||void 0===o?void 0:o.call(e,r.formatBrand).filter(a):[],hotDeals:t.hot_deals?null===(l=(i=t.hot_deals).map)||void 0===l?void 0:l.call(i,r.formatProduct).filter(a):[],newProducts:t.new_products?null===(d=(n=t.new_products).map)||void 0===d?void 0:d.call(n,r.formatProduct).filter(a):[],slideBanners:t.slide_banners?null===(s=(u=t.slide_banners).map)||void 0===s?void 0:s.call(u,r.formatBanner).filter(a):[],subBanners:t.sub_banners?null===(c=(m=t.sub_banners).map)||void 0===c?void 0:c.call(m,r.formatBanner).filter(a):[],footerBanners:t.footer_banners?null===(p=(v=t.footer_banners).map)||void 0===p?void 0:p.call(v,r.formatBanner).filter(a):[],blogPosts:t.blog_posts?null===(g=(_=t.blog_posts).map)||void 0===g?void 0:g.call(_,r.formatBlogPost).filter(a):[],popularCategories:t.popular_categories?null===(b=(f=t.popular_categories).map)||void 0===b?void 0:b.call(f,(t=>r.formatCategory(t))).filter(a):[],suggestProducts:t.suggest_products?null===(y=(h=t.suggest_products).map)||void 0===y?void 0:y.call(h,(t=>r.formatCategory(t))).filter(a):[],promotions:t.promotions?null===(P=(x=t.promotions).map)||void 0===P?void 0:P.call(x,(t=>r.formatPromotion(t))).filter(a):[]}:null},formatCategoryPage:function(t){var e,o,i,l;return t?{id:t.id||0,name:t.name||"",slug:t.slug||"",description:t.description||null,banners:(null===(o=null===(e=t.banners)||void 0===e?void 0:e.map)||void 0===o?void 0:o.call(e,r.formatBanner).filter(a))||[],bestsellerProducts:(null===(l=null===(i=t.bestseller_products)||void 0===i?void 0:i.map)||void 0===l?void 0:l.call(i,r.formatProduct).filter(a))||[]}:null},formatBrandPage:function(t){return t?r.formatBrand(t):null},formatPagination:t=>t?{current:t.current||0,first:t.first||0,itemsPerPage:t.items_per_page||0,last:t.last||0,next:t.next||0,prev:t.prev||0,totalItems:t.total_items||0}:null,formatProductDetailPage:function(t){var e,o,i,l,n,d,u,s;return t?Object.assign(Object.assign({},r.formatProduct(t)),{relatedProducts:(null===(o=null===(e=t.related_products)||void 0===e?void 0:e.map)||void 0===o?void 0:o.call(e,r.formatProduct).filter(a))||[],bestsellerProducts:(null===(l=null===(i=t.bestseller_products)||void 0===i?void 0:i.map)||void 0===l?void 0:l.call(i,r.formatProduct).filter(a))||[],viewedProducts:(null===(d=null===(n=t.viewed_products)||void 0===n?void 0:n.map)||void 0===d?void 0:d.call(n,r.formatProduct).filter(a))||[],promotions:(null===(s=null===(u=t.promotions)||void 0===u?void 0:u.map)||void 0===s?void 0:s.call(u,r.formatPromotion).filter(a))||[]}):null},formatProductReview:t=>{var e,o;return t?{reviewId:t.review_id||"",createdAt:t.created_at||"",title:t.title||"",detail:t.detail||"",nickname:t.nick_name||"",avatar:t.avatar||"",ratingVotes:(null===(o=null===(e=t.rating_votes)||void 0===e?void 0:e.map)||void 0===o?void 0:o.call(e,(t=>({ratingCode:t.rating_code||"",value:Number(t.value)||0,percent:Number(t.percent)||0}))))||[],images:t.images||[]}:null},formatProductPromotion:t=>t?{id:t.id||0,name:t.name||"",thumbnail:t.thumbnail||"",expirationDate:t.expiration_date||""}:null,formatPromotion:t=>t?{id:t.id||0,name:t.name||"",slug:t.slug||"",thumbnail:t.thumbnail||"",expiredDate:t.expired_date||"",banners:t.banners||[],points:0,description:t.description||"",metaTitle:t.meta_title||"",metaKeywords:t.meta_keywords||"",metaDescription:t.meta_description||""}:null,formatCustomAttributes:(t,e)=>{var o;return(null==t?void 0:t.length)&&(null===(o=null==t?void 0:t.find((t=>t.attribute_code===e)))||void 0===o?void 0:o.value)||""},formatAddress:t=>{var e,o,i,l;return t?{id:t.id||0,fullName:t.firstname||"",telephone:t.telephone||"",province:{value:null===(e=t.region)||void 0===e?void 0:e.region_id,label:null===(o=t.region)||void 0===o?void 0:o.region}||null,district:{value:r.formatCustomAttributes(t.custom_attributes,"district_id"),label:r.formatCustomAttributes(t.custom_attributes,"district")},commune:{value:r.formatCustomAttributes(t.custom_attributes,"ward_id"),label:r.formatCustomAttributes(t.custom_attributes,"ward")},street:(null===(i=null==t?void 0:t.street)||void 0===i?void 0:i.length)?null==t?void 0:t.street[0]:"",isDefault:t.default_billing&&t.default_shipping||!1,fullAddress:(null===(l=null==t?void 0:t.extension_attributes)||void 0===l?void 0:l.full_address)||""}:null},formatProvince:t=>(null==t?void 0:t.available_regions)?t.available_regions.map((t=>({value:t.id||"",label:t.name||""}))):[],formatDistrict:t=>(null==t?void 0:t.districts)?t.districts.map((t=>({value:t.id||"",label:t.name||""}))):[],formatCommune:t=>(null==t?void 0:t.communes)?t.communes.map((t=>({value:t.id||"",label:t.name||""}))):[],formatOrder:t=>{var e,o;return t?{orderNumber:(null==t?void 0:t.order_number)||"",shippingData:(null==t?void 0:t.shipping_data)?{shippingMethod:t.shipping_data.shipping_method||"",shippingDescription:t.shipping_data.shipping_description||"",shippingAddress:t.shipping_data.shipping_address?{fullName:t.shipping_data.shipping_address.firstname||"",fullAddress:t.shipping_data.shipping_address.full_address||"",telephone:t.shipping_data.shipping_address.telephone||""}:null,storeAddress:null}:null,orderedDate:(null==t?void 0:t.ordered_date)||"",status:(null==t?void 0:t.status)||null,totals:(null==t?void 0:t.totals)?{subtotal:t.totals.subtotal||0,shippingAmount:t.totals.shipping_amount||0,discountAmount:t.totals.discount_amount||0,grandTotal:t.totals.grand_total||0}:null,products:(null===(o=null===(e=null==t?void 0:t.products)||void 0===e?void 0:e.map)||void 0===o?void 0:o.call(e,(t=>({sku:t.sku||"",name:t.name||"",price:t.price||0,rowTotal:t.row_total||0,image:t.image||"",qty:t.qty||0}))))||[],paymentMethod:(null==t?void 0:t.payment_method)||""}:null},formatStatistic:t=>{var e,o,i,l,a;return t?{pending:Number(null===(e=null==t?void 0:t.find((t=>"pending"===t.status)))||void 0===e?void 0:e.amount)||0,processing:Number(null===(o=null==t?void 0:t.find((t=>"processing"===t.status)))||void 0===o?void 0:o.amount)||0,delivering:Number(null===(i=null==t?void 0:t.find((t=>"delivering"===t.status)))||void 0===i?void 0:i.amount)||0,complete:Number(null===(l=null==t?void 0:t.find((t=>"complete"===t.status)))||void 0===l?void 0:l.amount)||0,canceled:Number(null===(a=null==t?void 0:t.find((t=>"canceled"===t.status)))||void 0===a?void 0:a.amount)||0}:{}},formatCartItem:t=>{var e,o,i,l,a,n,d,u;return t?{itemId:t.item_id||0,sku:t.sku||"",qty:t.qty||0,name:t.name||"",price:t.price||0,basePrice:(null===(e=t.extension_attributes)||void 0===e?void 0:e.base_price)||0,productType:t.product_type||"",quoteId:t.quote_id||"",thumbnail:(null===(o=t.extension_attributes)||void 0===o?void 0:o.thumbnail)||"",rowTotal:(null===(i=t.extension_attributes)||void 0===i?void 0:i.row_total)||0,promotions:(null===(n=null===(a=null===(l=t.extension_attributes)||void 0===l?void 0:l.promotions)||void 0===a?void 0:a.map)||void 0===n?void 0:n.call(a,r.formatProductPromotion))||[],isInStock:(null===(d=t.extension_attributes)||void 0===d?void 0:d.is_in_stock)||!1,urlProduct:(null===(u=t.extension_attributes)||void 0===u?void 0:u.url_key)||""}:null},formatCartAddress:t=>{var e;return t?{customerAddressId:(null==t?void 0:t.customer_address_id)||0,id:t.id||0,region:t.region||"",regionId:t.region_id||0,regionCode:t.region_code||"",countryId:t.country_id||"",street:t.street||[],postcode:t.postcode||"",city:t.city||"",firstname:t.firstname||"",lastname:t.lastname||"",customerId:t.customer_id||0,email:t.email||"",telephone:t.telephone||"",sameAsBilling:t.same_as_billing||0,saveInAddressBook:t.save_in_address_book||0,fullAddress:(null===(e=t.extension_attributes)||void 0===e?void 0:e.full_address)||""}:null},formatEstimatedShipping:t=>t?{carrierCode:t.carrier_code||"",methodCode:t.method_code||"",carrierTitle:t.carrier_title||"",methodTitle:t.method_title||"",amount:t.amount||0,baseAmount:t.base_amount||0,available:t.available||!1,errorMessage:t.error_message||"",priceExclTax:t.price_excl_tax||0,priceInclTax:t.price_incl_tax||0}:null,formatCartLoggedInCustomer:t=>{var e,o,i;return t?{email:t.email||"",firstname:t.firstname||"",lastname:t.lastname||"",id:t.id||0,groupId:t.group_id||0,createdAt:t.created_at||"",updatedAt:t.updated_at||"",createdIn:t.created_in||"",storeId:t.store_id||0,websiteId:t.website_id||0,addresses:(null===(o=null===(e=t.addresses)||void 0===e?void 0:e.map)||void 0===o?void 0:o.call(e,r.formatCartAddress))||[],disableAutoGroupChange:t.disable_auto_group_change||0,isSubscribed:(null===(i=t.extension_attributes)||void 0===i?void 0:i.is_subscribed)||!1}:null},formatCart:t=>{var e,o,i,l,a,n,d,u,s,m,c,v,p,_;return t?{id:t.id||0,createdAt:t.created_at||"",updatedAt:t.updated_at||"",isActive:t.is_active||!1,isVirtual:t.is_virtual||!1,items:(null===(i=null===(o=null===(e=t.items)||void 0===e?void 0:e.map)||void 0===o?void 0:o.call(e,r.formatCartItem))||void 0===i?void 0:i.sort(((t,e)=>Number(null==e?void 0:e.isInStock)-Number(null==t?void 0:t.isInStock))))||[],itemsCount:t.items_count||0,itemsQty:t.items_qty||0,customer:t.customer?r.formatCartLoggedInCustomer(t.customer):null,billingAddress:t.billing_address?r.formatCartAddress(t.billing_address):null,origOrderId:t.orig_order_id||0,currency:{globalCurrencyCode:(null===(l=t.currency)||void 0===l?void 0:l.global_currency_code)||"",baseCurrencyCode:(null===(a=t.currency)||void 0===a?void 0:a.base_currency_code)||"",storeCurrencyCode:(null===(n=t.currency)||void 0===n?void 0:n.store_currency_code)||"",quoteCurrencyCode:(null===(d=t.currency)||void 0===d?void 0:d.quote_currency_code)||"",storeToBaseRate:(null===(u=t.currency)||void 0===u?void 0:u.store_to_base_rate)||0,storeToQuoteRate:(null===(s=t.currency)||void 0===s?void 0:s.store_to_quote_rate)||0,baseToGlobalRate:(null===(m=t.currency)||void 0===m?void 0:m.base_to_global_rate)||0,baseToQuoteRate:(null===(c=t.currency)||void 0===c?void 0:c.base_to_quote_rate)||0},customerIsGuest:t.customer_is_guest||!1,customerNoteNotify:t.customer_note_notify||!1,customerTaxClassId:t.customer_tax_class_id||0,storeId:t.store_id||0,shippingAssignments:null===(_=null===(p=null===(v=t.extension_attributes)||void 0===v?void 0:v.shipping_assignments)||void 0===p?void 0:p.map)||void 0===_?void 0:_.call(p,(t=>{var e,o,i;return{shipping:{address:t.shipping.address?r.formatCartAddress(t.shipping.address):null,method:(null===(e=t.shipping)||void 0===e?void 0:e.method)||""},items:(null===(i=(o=t.items).map)||void 0===i?void 0:i.call(o,r.formatCartItem))||[]}}))}:null},formatCartTotal:t=>{var e,o,i;return t?{grandTotal:t.grand_total||0,baseGrandTotal:t.base_grand_total||0,subtotal:t.subtotal||0,baseSubtotal:t.base_subtotal||0,discountAmount:t.discount_amount||0,baseDiscountAmount:t.base_discount_amount||0,subtotalWithDiscount:t.subtotal_with_discount||0,baseSubtotalWithDiscount:t.base_subtotal_with_discount||0,shippingAmount:t.shipping_amount||0,baseShippingAmount:t.base_shipping_amount||0,shippingDiscountAmount:t.shipping_discount_amount||0,baseShippingDiscountAmount:t.base_shipping_discount_amount||0,taxAmount:t.tax_amount||0,baseTaxAmount:t.base_tax_amount||0,weeeTaxAppliedAmount:t.weee_tax_applied_amount||0,shippingTaxAmount:t.shipping_tax_amount||0,baseShippingTaxAmount:t.base_shipping_tax_amount||0,subtotalInclTax:t.subtotal_incl_tax||0,shippingInclTax:t.shipping_incl_tax||0,baseShippingInclTax:t.base_shipping_incl_tax||0,baseCurrencyCode:t.base_currency_code||"",quoteCurrencyCode:t.quote_currency_code||"",itemsQty:t.items_qty||0,coupon:{couponCode:t.coupon_code||"",couponDescription:(null===(e=null==t?void 0:t.extension_attributes)||void 0===e?void 0:e.coupon_description_text)||""},items:(null===(i=null===(o=t.items)||void 0===o?void 0:o.map)||void 0===i?void 0:i.call(o,(t=>({itemId:t.item_id||0,price:t.price||0,basePrice:t.base_price||0,qty:t.qty||0,rowTotal:t.row_total||0,baseRowTotal:t.base_row_total||0,rowTotalWithDiscount:t.row_total_with_discount||0,taxAmount:t.tax_amount||0,baseTaxAmount:t.base_tax_amount||0,taxPercent:t.tax_percent||0,discountAmount:t.discount_amount||0,baseDiscountAmount:t.base_discount_amount||0,discountPercent:t.discount_percent||0,priceInclTax:t.price_incl_tax||0,basePriceInclTax:t.base_price_incl_tax||0,rowTotalInclTax:t.row_total_incl_tax||0,baseRowTotalInclTax:t.base_row_total_incl_tax||0,options:t.options||"",weeeTaxAppliedAmount:t.weee_tax_applied_amount||0,weeeTaxApplied:t.weee_tax_applied||0,name:t.name||""}))))||[],totalSegments:t.total_segments||[]}:null},formatPaymentMethod:t=>t?null==t?void 0:t.map((t=>({code:(null==t?void 0:t.payment_code)||"",title:(null==t?void 0:t.payment_title)||"",thumbnail:(null==t?void 0:t.payment_thumbnail)||""}))):null,formatPaymentInformation:t=>{var e;return t?{paymentMethods:r.formatPaymentMethod(null===(e=null==t?void 0:t.extension_attributes)||void 0===e?void 0:e.payment_detail_info)||[],totals:r.formatCartTotal(t.totals)}:null},formatOrderConfirmation:t=>t?{isSuccess:t.is_success||!1,orderInfo:r.formatOrder(t.order_info)}:null,formatCoupons:t=>{var e;return(null===(e=null==t?void 0:t.items)||void 0===e?void 0:e.length)?t.items.map((t=>({code:(null==t?void 0:t.code)||"",name:(null==t?void 0:t.name)||"",thumbnail:(null==t?void 0:t.thumbnail)||"",description:(null==t?void 0:t.expired_date)||""}))):null},formatShippings:t=>t?t.map((t=>{var e;return{carrierCode:t.carrier_code||"",methodCode:t.method_code||"",title:t.carrier_title||"",description:t.method_title||"",price:(null==t?void 0:t.base_amount)||0,thumbnail:(null===(e=null==t?void 0:t.extension_attributes)||void 0===e?void 0:e.thumbnail)||""}})):[]};var n=Object.freeze({__proto__:null,dataFormatter:r});exports.Constants=e.constants,exports.Types=o.types,exports.ApiTypes=i,exports.DataFormatter=n,exports.DataTypes=l;
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var theme = require('./theme-fa910869.js');
|
|
6
|
+
var constants = require('./constants-ae18ce18.js');
|
|
7
|
+
var types = require('./types-52a4e888.js');
|
|
8
|
+
require('./index-5553f9e1.js');
|
|
9
|
+
require('date-fns/locale');
|
|
10
|
+
require('./Subot-5fc40fb5.js');
|
|
11
|
+
require('./isProduction-5ce3a388.js');
|
|
12
|
+
|
|
13
|
+
// ===== CART END =====
|
|
14
|
+
|
|
15
|
+
var apiTypes = /*#__PURE__*/Object.freeze({
|
|
16
|
+
__proto__: null
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
var dataTypes = /*#__PURE__*/Object.freeze({
|
|
20
|
+
__proto__: null
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
function isDefined(argument) {
|
|
24
|
+
return argument !== undefined && argument !== null;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const dataFormatter = {
|
|
28
|
+
formatAutoCompleteAddress: (address) => {
|
|
29
|
+
if (!address || !address.place_id)
|
|
30
|
+
return null;
|
|
31
|
+
return {
|
|
32
|
+
placeId: address.place_id,
|
|
33
|
+
description: address.description || '',
|
|
34
|
+
};
|
|
35
|
+
},
|
|
36
|
+
formatPrice: (price, locale) => {
|
|
37
|
+
const formattedPrice = typeof price === 'string' ? parseInt(price) : price;
|
|
38
|
+
return new Intl.NumberFormat(locale || 'vi-VN').format(formattedPrice);
|
|
39
|
+
},
|
|
40
|
+
formatHotSearchKeyword: (data) => {
|
|
41
|
+
return {
|
|
42
|
+
text: (data === null || data === void 0 ? void 0 : data.name) || '',
|
|
43
|
+
};
|
|
44
|
+
},
|
|
45
|
+
formatHelpfulUrl: (data) => {
|
|
46
|
+
return {
|
|
47
|
+
name: (data === null || data === void 0 ? void 0 : data.name) || '',
|
|
48
|
+
featuredImage: (data === null || data === void 0 ? void 0 : data.featured_image) || '',
|
|
49
|
+
url: (data === null || data === void 0 ? void 0 : data.url) || '',
|
|
50
|
+
};
|
|
51
|
+
},
|
|
52
|
+
formatCategory: function (data, parentId, parentFullSlug) {
|
|
53
|
+
var _a, _b, _c;
|
|
54
|
+
const currentFullSlug = parentFullSlug
|
|
55
|
+
? parentFullSlug + '/' + data.slug
|
|
56
|
+
: data.slug;
|
|
57
|
+
const children = ((_b = (_a = data === null || data === void 0 ? void 0 : data.children) === null || _a === void 0 ? void 0 : _a.map) === null || _b === void 0 ? void 0 : _b.call(_a, (childCategory) => {
|
|
58
|
+
return dataFormatter.formatCategory(childCategory, data.id, currentFullSlug);
|
|
59
|
+
})) || [];
|
|
60
|
+
return {
|
|
61
|
+
id: data === null || data === void 0 ? void 0 : data.id,
|
|
62
|
+
name: (data === null || data === void 0 ? void 0 : data.name) || '',
|
|
63
|
+
logo: (data === null || data === void 0 ? void 0 : data.logo) || '',
|
|
64
|
+
slug: (data === null || data === void 0 ? void 0 : data.slug) || '',
|
|
65
|
+
fullSlug: currentFullSlug || '',
|
|
66
|
+
children,
|
|
67
|
+
backgroundColor: data.color || theme.theme.colors.teal50,
|
|
68
|
+
parentId: parentId || 0,
|
|
69
|
+
products: ((_c = data.products) === null || _c === void 0 ? void 0 : _c.map(dataFormatter.formatProduct)) || [],
|
|
70
|
+
};
|
|
71
|
+
},
|
|
72
|
+
formatFooterInfo: (data) => {
|
|
73
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
|
|
74
|
+
const branches = ((_c = (_b = (_a = data === null || data === void 0 ? void 0 : data.branch) === null || _a === void 0 ? void 0 : _a.branch) === null || _b === void 0 ? void 0 : _b.map) === null || _c === void 0 ? void 0 : _c.call(_b, (branch) => {
|
|
75
|
+
return {
|
|
76
|
+
flag: branch.flag || '',
|
|
77
|
+
name: branch.name || '',
|
|
78
|
+
url: branch.url || '',
|
|
79
|
+
};
|
|
80
|
+
})) || [];
|
|
81
|
+
const verified = ((_f = (_e = (_d = data === null || data === void 0 ? void 0 : data.general) === null || _d === void 0 ? void 0 : _d.verified) === null || _e === void 0 ? void 0 : _e.map) === null || _f === void 0 ? void 0 : _f.call(_e, (verifiedItem) => {
|
|
82
|
+
return {
|
|
83
|
+
image: verifiedItem.image || '',
|
|
84
|
+
url: verifiedItem.url || '',
|
|
85
|
+
};
|
|
86
|
+
})) || [];
|
|
87
|
+
const menu = ((_h = (_g = data === null || data === void 0 ? void 0 : data.menu) === null || _g === void 0 ? void 0 : _g.map) === null || _h === void 0 ? void 0 : _h.call(_g, (menuItem) => {
|
|
88
|
+
var _a, _b;
|
|
89
|
+
return {
|
|
90
|
+
menu_title: menuItem.menu_title,
|
|
91
|
+
items: (_b = (_a = menuItem.items) === null || _a === void 0 ? void 0 : _a.map) === null || _b === void 0 ? void 0 : _b.call(_a, (item) => {
|
|
92
|
+
return {
|
|
93
|
+
title: item.title,
|
|
94
|
+
url: item.url,
|
|
95
|
+
};
|
|
96
|
+
}),
|
|
97
|
+
};
|
|
98
|
+
})) || [];
|
|
99
|
+
const socials = ((_l = (_k = (_j = data === null || data === void 0 ? void 0 : data.social) === null || _j === void 0 ? void 0 : _j.socials) === null || _k === void 0 ? void 0 : _k.map) === null || _l === void 0 ? void 0 : _l.call(_k, (social) => {
|
|
100
|
+
return {
|
|
101
|
+
icon: social.icon || '',
|
|
102
|
+
name: social.name || '',
|
|
103
|
+
url: social.url || '',
|
|
104
|
+
};
|
|
105
|
+
})) || [];
|
|
106
|
+
return {
|
|
107
|
+
branch: {
|
|
108
|
+
title: ((_m = data === null || data === void 0 ? void 0 : data.branch) === null || _m === void 0 ? void 0 : _m.title) || '',
|
|
109
|
+
branch: branches,
|
|
110
|
+
},
|
|
111
|
+
general: {
|
|
112
|
+
logo: (_p = (_o = data === null || data === void 0 ? void 0 : data.general) === null || _o === void 0 ? void 0 : _o.logo) !== null && _p !== void 0 ? _p : '',
|
|
113
|
+
content: (_r = (_q = data === null || data === void 0 ? void 0 : data.general) === null || _q === void 0 ? void 0 : _q.content) !== null && _r !== void 0 ? _r : '',
|
|
114
|
+
copyright: (_t = (_s = data === null || data === void 0 ? void 0 : data.general) === null || _s === void 0 ? void 0 : _s.copyright) !== null && _t !== void 0 ? _t : '',
|
|
115
|
+
verified,
|
|
116
|
+
},
|
|
117
|
+
menu,
|
|
118
|
+
social: {
|
|
119
|
+
title: ((_u = data === null || data === void 0 ? void 0 : data.social) === null || _u === void 0 ? void 0 : _u.title) || '',
|
|
120
|
+
socials,
|
|
121
|
+
},
|
|
122
|
+
};
|
|
123
|
+
},
|
|
124
|
+
formatNavigation: function (data) {
|
|
125
|
+
var _a, _b, _c, _d, _e, _f;
|
|
126
|
+
return {
|
|
127
|
+
hotSearchKeywords: ((_b = (_a = data === null || data === void 0 ? void 0 : data.hot_search_keywords) === null || _a === void 0 ? void 0 : _a.map) === null || _b === void 0 ? void 0 : _b.call(_a, dataFormatter.formatHotSearchKeyword)) || [],
|
|
128
|
+
helpfulUrls: ((_d = (_c = data === null || data === void 0 ? void 0 : data.helpful_urls) === null || _c === void 0 ? void 0 : _c.map) === null || _d === void 0 ? void 0 : _d.call(_c, dataFormatter.formatHelpfulUrl)) || [],
|
|
129
|
+
categories: ((_f = (_e = data === null || data === void 0 ? void 0 : data.categories) === null || _e === void 0 ? void 0 : _e.map) === null || _f === void 0 ? void 0 : _f.call(_e, (category) => dataFormatter.formatCategory(category))) || [],
|
|
130
|
+
footer: dataFormatter.formatFooterInfo(data === null || data === void 0 ? void 0 : data.footer),
|
|
131
|
+
storeId: (data === null || data === void 0 ? void 0 : data.store_id) || 0,
|
|
132
|
+
customerId: (data === null || data === void 0 ? void 0 : data.customer_id) || 0,
|
|
133
|
+
cartItemsQty: typeof (data === null || data === void 0 ? void 0 : data.cart_items_qty) === 'number' ? data.cart_items_qty : null,
|
|
134
|
+
};
|
|
135
|
+
},
|
|
136
|
+
// === ECOM TYPES FORMAT ===
|
|
137
|
+
formatPriceInfo: (priceInfoApi) => {
|
|
138
|
+
if (!priceInfoApi)
|
|
139
|
+
return null;
|
|
140
|
+
return {
|
|
141
|
+
final: priceInfoApi.final || 0,
|
|
142
|
+
regular: priceInfoApi.regular || 0,
|
|
143
|
+
discountPercent: priceInfoApi.discount_percent || 0,
|
|
144
|
+
};
|
|
145
|
+
},
|
|
146
|
+
formatProduct: function (productApi) {
|
|
147
|
+
var _a, _b, _c, _d;
|
|
148
|
+
if (!productApi)
|
|
149
|
+
return null;
|
|
150
|
+
const defaultPriceInfo = {
|
|
151
|
+
final: 0,
|
|
152
|
+
regular: 0,
|
|
153
|
+
discountPercent: 0,
|
|
154
|
+
};
|
|
155
|
+
return {
|
|
156
|
+
id: productApi.id || 0,
|
|
157
|
+
price: productApi.price
|
|
158
|
+
? dataFormatter.formatPriceInfo(productApi.price) || defaultPriceInfo
|
|
159
|
+
: defaultPriceInfo,
|
|
160
|
+
thumbnail: productApi.thumbnail || '',
|
|
161
|
+
name: productApi.name || '',
|
|
162
|
+
averageRating: Number((productApi.average_rating || 0).toFixed(2)),
|
|
163
|
+
reviewsCount: productApi.reviews_count || 0,
|
|
164
|
+
tag: productApi.tag || null,
|
|
165
|
+
sku: productApi.sku || '',
|
|
166
|
+
slug: productApi.slug || '',
|
|
167
|
+
images: productApi.images || [],
|
|
168
|
+
tags: productApi.tags || [],
|
|
169
|
+
unit: productApi.unit || '',
|
|
170
|
+
brand: productApi.brand
|
|
171
|
+
? {
|
|
172
|
+
name: productApi.brand.name || '',
|
|
173
|
+
image: productApi.brand.image || '',
|
|
174
|
+
slug: productApi.brand.slug || '',
|
|
175
|
+
productsCount: productApi.brand.products_count || 0,
|
|
176
|
+
}
|
|
177
|
+
: null,
|
|
178
|
+
description: productApi.description || '',
|
|
179
|
+
productPromotions: ((_b = (_a = productApi.product_promotions) === null || _a === void 0 ? void 0 : _a.map) === null || _b === void 0 ? void 0 : _b.call(_a, dataFormatter.formatProductPromotion).filter(isDefined)) || [],
|
|
180
|
+
categories: ((_d = (_c = productApi.categories) === null || _c === void 0 ? void 0 : _c.map) === null || _d === void 0 ? void 0 : _d.call(_c, (c) => dataFormatter.formatCategory(c)).filter(isDefined)) || [],
|
|
181
|
+
isInStock: (productApi === null || productApi === void 0 ? void 0 : productApi.is_in_stock) || false,
|
|
182
|
+
};
|
|
183
|
+
},
|
|
184
|
+
formatBanner: (bannerApi) => {
|
|
185
|
+
if (!bannerApi)
|
|
186
|
+
return null;
|
|
187
|
+
return {
|
|
188
|
+
name: bannerApi.name || '',
|
|
189
|
+
url: bannerApi.url || '',
|
|
190
|
+
featuredImage: bannerApi.featured_image || '',
|
|
191
|
+
alt: bannerApi.image_alt,
|
|
192
|
+
};
|
|
193
|
+
},
|
|
194
|
+
formatBlogPost: (blogPostApi) => {
|
|
195
|
+
var _a, _b;
|
|
196
|
+
if (!blogPostApi)
|
|
197
|
+
return null;
|
|
198
|
+
return {
|
|
199
|
+
title: blogPostApi.title || '',
|
|
200
|
+
image: blogPostApi.image || '',
|
|
201
|
+
link: blogPostApi.link || '',
|
|
202
|
+
postData: blogPostApi.post_data
|
|
203
|
+
? {
|
|
204
|
+
reviewed: blogPostApi.post_data.reviewed
|
|
205
|
+
? {
|
|
206
|
+
author: dataFormatter.formatBlogPostDataReviewedUser(blogPostApi.post_data.reviewed.author || undefined),
|
|
207
|
+
editor: dataFormatter.formatBlogPostDataReviewedUser(blogPostApi.post_data.reviewed.editor || undefined),
|
|
208
|
+
expert: dataFormatter.formatBlogPostDataReviewedUser(blogPostApi.post_data.reviewed.expert || undefined),
|
|
209
|
+
factCheck: dataFormatter.formatBlogPostDataReviewedUser(blogPostApi.post_data.reviewed.fact_check || undefined),
|
|
210
|
+
isAuthor: Boolean(blogPostApi.post_data.reviewed.is_author),
|
|
211
|
+
}
|
|
212
|
+
: null,
|
|
213
|
+
categories: blogPostApi.post_data.categories
|
|
214
|
+
? (_b = (_a = blogPostApi.post_data.categories).map) === null || _b === void 0 ? void 0 : _b.call(_a, (item) => ({
|
|
215
|
+
termId: item.term_id || 0,
|
|
216
|
+
name: item.name || '',
|
|
217
|
+
permalink: item.permalink || '',
|
|
218
|
+
textColor: item.text_color || '',
|
|
219
|
+
}))
|
|
220
|
+
: [],
|
|
221
|
+
postDate: blogPostApi.post_data.post_date || '',
|
|
222
|
+
postModified: blogPostApi.post_data.post_modified || '',
|
|
223
|
+
modifiedTime: blogPostApi.post_data.modified_time || '',
|
|
224
|
+
}
|
|
225
|
+
: null,
|
|
226
|
+
};
|
|
227
|
+
},
|
|
228
|
+
formatBlogPostDataReviewedUser: (blogPostDataReviewedUserApi) => {
|
|
229
|
+
if (!blogPostDataReviewedUserApi)
|
|
230
|
+
return null;
|
|
231
|
+
return {
|
|
232
|
+
id: blogPostDataReviewedUserApi.ID || 0,
|
|
233
|
+
userId: blogPostDataReviewedUserApi.user_id || 0,
|
|
234
|
+
formerRole: blogPostDataReviewedUserApi.former_role || '',
|
|
235
|
+
role: blogPostDataReviewedUserApi.role || '',
|
|
236
|
+
slug: blogPostDataReviewedUserApi.slug || '',
|
|
237
|
+
displayName: blogPostDataReviewedUserApi.display_name || '',
|
|
238
|
+
description: blogPostDataReviewedUserApi.description || '',
|
|
239
|
+
profileUrl: blogPostDataReviewedUserApi.profile_url || '',
|
|
240
|
+
avatar: blogPostDataReviewedUserApi.avatar || '',
|
|
241
|
+
avatarThumbnail: blogPostDataReviewedUserApi.avatar_thumbnail || '',
|
|
242
|
+
turnOffProfile: Boolean(blogPostDataReviewedUserApi.turn_off_profile),
|
|
243
|
+
};
|
|
244
|
+
},
|
|
245
|
+
formatBrand: function (brandApi) {
|
|
246
|
+
var _a, _b, _c, _d;
|
|
247
|
+
if (!brandApi)
|
|
248
|
+
return null;
|
|
249
|
+
return {
|
|
250
|
+
id: brandApi.id || 0,
|
|
251
|
+
image: brandApi.image || '',
|
|
252
|
+
position: brandApi.position || '',
|
|
253
|
+
isPopular: brandApi.is_popular || false,
|
|
254
|
+
summary: brandApi.summary || '',
|
|
255
|
+
name: brandApi.name || '',
|
|
256
|
+
slug: brandApi.slug || '',
|
|
257
|
+
description: brandApi.description || null,
|
|
258
|
+
banners: ((_b = (_a = brandApi.banners) === null || _a === void 0 ? void 0 : _a.map) === null || _b === void 0 ? void 0 : _b.call(_a, dataFormatter.formatBanner).filter(isDefined)) ||
|
|
259
|
+
[],
|
|
260
|
+
bestsellerProducts: ((_d = (_c = brandApi.bestseller_products) === null || _c === void 0 ? void 0 : _c.map) === null || _d === void 0 ? void 0 : _d.call(_c, dataFormatter.formatProduct).filter(isDefined)) || [],
|
|
261
|
+
};
|
|
262
|
+
},
|
|
263
|
+
formatHomePage: (homePageApi) => {
|
|
264
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
|
|
265
|
+
if (!homePageApi)
|
|
266
|
+
return null;
|
|
267
|
+
return {
|
|
268
|
+
brands: homePageApi.brands
|
|
269
|
+
? (_b = (_a = homePageApi.brands).map) === null || _b === void 0 ? void 0 : _b.call(_a, dataFormatter.formatBrand).filter(isDefined)
|
|
270
|
+
: [],
|
|
271
|
+
hotDeals: homePageApi.hot_deals
|
|
272
|
+
? (_d = (_c = homePageApi.hot_deals).map) === null || _d === void 0 ? void 0 : _d.call(_c, dataFormatter.formatProduct).filter(isDefined)
|
|
273
|
+
: [],
|
|
274
|
+
newProducts: homePageApi.new_products
|
|
275
|
+
? (_f = (_e = homePageApi.new_products).map) === null || _f === void 0 ? void 0 : _f.call(_e, dataFormatter.formatProduct).filter(isDefined)
|
|
276
|
+
: [],
|
|
277
|
+
slideBanners: homePageApi.slide_banners
|
|
278
|
+
? (_h = (_g = homePageApi.slide_banners).map) === null || _h === void 0 ? void 0 : _h.call(_g, dataFormatter.formatBanner).filter(isDefined)
|
|
279
|
+
: [],
|
|
280
|
+
subBanners: homePageApi.sub_banners
|
|
281
|
+
? (_k = (_j = homePageApi.sub_banners).map) === null || _k === void 0 ? void 0 : _k.call(_j, dataFormatter.formatBanner).filter(isDefined)
|
|
282
|
+
: [],
|
|
283
|
+
footerBanners: homePageApi.footer_banners
|
|
284
|
+
? (_m = (_l = homePageApi.footer_banners).map) === null || _m === void 0 ? void 0 : _m.call(_l, dataFormatter.formatBanner).filter(isDefined)
|
|
285
|
+
: [],
|
|
286
|
+
blogPosts: homePageApi.blog_posts
|
|
287
|
+
? (_p = (_o = homePageApi.blog_posts).map) === null || _p === void 0 ? void 0 : _p.call(_o, dataFormatter.formatBlogPost).filter(isDefined)
|
|
288
|
+
: [],
|
|
289
|
+
popularCategories: homePageApi.popular_categories
|
|
290
|
+
? (_r = (_q = homePageApi.popular_categories).map) === null || _r === void 0 ? void 0 : _r.call(_q, (c) => dataFormatter.formatCategory(c)).filter(isDefined)
|
|
291
|
+
: [],
|
|
292
|
+
suggestProducts: homePageApi.suggest_products
|
|
293
|
+
? (_t = (_s = homePageApi.suggest_products).map) === null || _t === void 0 ? void 0 : _t.call(_s, (c) => dataFormatter.formatCategory(c)).filter(isDefined)
|
|
294
|
+
: [],
|
|
295
|
+
promotions: homePageApi.promotions
|
|
296
|
+
? (_v = (_u = homePageApi.promotions).map) === null || _v === void 0 ? void 0 : _v.call(_u, (c) => dataFormatter.formatPromotion(c)).filter(isDefined)
|
|
297
|
+
: [],
|
|
298
|
+
};
|
|
299
|
+
},
|
|
300
|
+
formatCategoryPage: function (categoryPageApi) {
|
|
301
|
+
var _a, _b, _c, _d;
|
|
302
|
+
if (!categoryPageApi)
|
|
303
|
+
return null;
|
|
304
|
+
return {
|
|
305
|
+
id: categoryPageApi.id || 0,
|
|
306
|
+
name: categoryPageApi.name || '',
|
|
307
|
+
slug: categoryPageApi.slug || '',
|
|
308
|
+
description: categoryPageApi.description || null,
|
|
309
|
+
banners: ((_b = (_a = categoryPageApi.banners) === null || _a === void 0 ? void 0 : _a.map) === null || _b === void 0 ? void 0 : _b.call(_a, dataFormatter.formatBanner).filter(isDefined)) || [],
|
|
310
|
+
bestsellerProducts: ((_d = (_c = categoryPageApi.bestseller_products) === null || _c === void 0 ? void 0 : _c.map) === null || _d === void 0 ? void 0 : _d.call(_c, dataFormatter.formatProduct).filter(isDefined)) || [],
|
|
311
|
+
};
|
|
312
|
+
},
|
|
313
|
+
formatBrandPage: function (brandPageApi) {
|
|
314
|
+
if (!brandPageApi)
|
|
315
|
+
return null;
|
|
316
|
+
return dataFormatter.formatBrand(brandPageApi);
|
|
317
|
+
},
|
|
318
|
+
formatPagination: (paginationApi) => {
|
|
319
|
+
if (!paginationApi)
|
|
320
|
+
return null;
|
|
321
|
+
return {
|
|
322
|
+
current: paginationApi.current || 0,
|
|
323
|
+
first: paginationApi.first || 0,
|
|
324
|
+
itemsPerPage: paginationApi.items_per_page || 0,
|
|
325
|
+
last: paginationApi.last || 0,
|
|
326
|
+
next: paginationApi.next || 0,
|
|
327
|
+
prev: paginationApi.prev || 0,
|
|
328
|
+
totalItems: paginationApi.total_items || 0,
|
|
329
|
+
};
|
|
330
|
+
},
|
|
331
|
+
formatProductDetailPage: function (productDetailPageApi) {
|
|
332
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
333
|
+
if (!productDetailPageApi)
|
|
334
|
+
return null;
|
|
335
|
+
return Object.assign(Object.assign({}, dataFormatter.formatProduct(productDetailPageApi)), { relatedProducts: ((_b = (_a = productDetailPageApi.related_products) === null || _a === void 0 ? void 0 : _a.map) === null || _b === void 0 ? void 0 : _b.call(_a, dataFormatter.formatProduct).filter(isDefined)) || [], bestsellerProducts: ((_d = (_c = productDetailPageApi.bestseller_products) === null || _c === void 0 ? void 0 : _c.map) === null || _d === void 0 ? void 0 : _d.call(_c, dataFormatter.formatProduct).filter(isDefined)) || [], viewedProducts: ((_f = (_e = productDetailPageApi.viewed_products) === null || _e === void 0 ? void 0 : _e.map) === null || _f === void 0 ? void 0 : _f.call(_e, dataFormatter.formatProduct).filter(isDefined)) || [], promotions: ((_h = (_g = productDetailPageApi.promotions) === null || _g === void 0 ? void 0 : _g.map) === null || _h === void 0 ? void 0 : _h.call(_g, dataFormatter.formatPromotion).filter(isDefined)) || [] });
|
|
336
|
+
},
|
|
337
|
+
formatProductReview: (productReview) => {
|
|
338
|
+
var _a, _b;
|
|
339
|
+
if (!productReview)
|
|
340
|
+
return null;
|
|
341
|
+
// TODO: avatar, images
|
|
342
|
+
return {
|
|
343
|
+
reviewId: productReview.review_id || '',
|
|
344
|
+
createdAt: productReview.created_at || '',
|
|
345
|
+
title: productReview.title || '',
|
|
346
|
+
detail: productReview.detail || '',
|
|
347
|
+
nickname: productReview.nick_name || '',
|
|
348
|
+
avatar: productReview.avatar || '',
|
|
349
|
+
ratingVotes: ((_b = (_a = productReview.rating_votes) === null || _a === void 0 ? void 0 : _a.map) === null || _b === void 0 ? void 0 : _b.call(_a, (vote) => {
|
|
350
|
+
return {
|
|
351
|
+
ratingCode: vote.rating_code || '',
|
|
352
|
+
value: Number(vote.value) || 0,
|
|
353
|
+
percent: Number(vote.percent) || 0,
|
|
354
|
+
};
|
|
355
|
+
})) || [],
|
|
356
|
+
images: productReview.images || [],
|
|
357
|
+
};
|
|
358
|
+
},
|
|
359
|
+
formatProductPromotion: (productPromotionApi) => {
|
|
360
|
+
if (!productPromotionApi)
|
|
361
|
+
return null;
|
|
362
|
+
return {
|
|
363
|
+
id: productPromotionApi.id || 0,
|
|
364
|
+
name: productPromotionApi.name || '',
|
|
365
|
+
thumbnail: productPromotionApi.thumbnail || '',
|
|
366
|
+
expirationDate: productPromotionApi.expiration_date || '',
|
|
367
|
+
};
|
|
368
|
+
},
|
|
369
|
+
formatPromotion: (promotionApi) => {
|
|
370
|
+
if (!promotionApi)
|
|
371
|
+
return null;
|
|
372
|
+
return {
|
|
373
|
+
id: promotionApi.id || 0,
|
|
374
|
+
name: promotionApi.name || '',
|
|
375
|
+
slug: promotionApi.slug || '',
|
|
376
|
+
thumbnail: promotionApi.thumbnail || '',
|
|
377
|
+
expiredDate: promotionApi.expired_date || '',
|
|
378
|
+
banners: promotionApi.banners || [],
|
|
379
|
+
points: 0,
|
|
380
|
+
description: promotionApi.description || '',
|
|
381
|
+
metaTitle: promotionApi.meta_title || '',
|
|
382
|
+
metaKeywords: promotionApi.meta_keywords || '',
|
|
383
|
+
metaDescription: promotionApi.meta_description || '',
|
|
384
|
+
};
|
|
385
|
+
},
|
|
386
|
+
formatCustomAttributes: (customAttributesApi, type) => {
|
|
387
|
+
var _a;
|
|
388
|
+
if (!(customAttributesApi === null || customAttributesApi === void 0 ? void 0 : customAttributesApi.length))
|
|
389
|
+
return '';
|
|
390
|
+
return (((_a = customAttributesApi === null || customAttributesApi === void 0 ? void 0 : customAttributesApi.find((item) => item.attribute_code === type)) === null || _a === void 0 ? void 0 : _a.value) || '');
|
|
391
|
+
},
|
|
392
|
+
formatAddress: (addressApi) => {
|
|
393
|
+
var _a, _b, _c, _d;
|
|
394
|
+
if (!addressApi)
|
|
395
|
+
return null;
|
|
396
|
+
return {
|
|
397
|
+
id: addressApi.id || 0,
|
|
398
|
+
fullName: addressApi.firstname || '',
|
|
399
|
+
telephone: addressApi.telephone || '',
|
|
400
|
+
province: {
|
|
401
|
+
value: (_a = addressApi.region) === null || _a === void 0 ? void 0 : _a.region_id,
|
|
402
|
+
label: (_b = addressApi.region) === null || _b === void 0 ? void 0 : _b.region,
|
|
403
|
+
} || null,
|
|
404
|
+
district: {
|
|
405
|
+
value: dataFormatter.formatCustomAttributes(addressApi.custom_attributes, 'district_id'),
|
|
406
|
+
label: dataFormatter.formatCustomAttributes(addressApi.custom_attributes, 'district'),
|
|
407
|
+
},
|
|
408
|
+
commune: {
|
|
409
|
+
value: dataFormatter.formatCustomAttributes(addressApi.custom_attributes, 'ward_id'),
|
|
410
|
+
label: dataFormatter.formatCustomAttributes(addressApi.custom_attributes, 'ward'),
|
|
411
|
+
},
|
|
412
|
+
street: ((_c = addressApi === null || addressApi === void 0 ? void 0 : addressApi.street) === null || _c === void 0 ? void 0 : _c.length) ? addressApi === null || addressApi === void 0 ? void 0 : addressApi.street[0] : '',
|
|
413
|
+
isDefault: (addressApi.default_billing && addressApi.default_shipping) || false,
|
|
414
|
+
fullAddress: ((_d = addressApi === null || addressApi === void 0 ? void 0 : addressApi.extension_attributes) === null || _d === void 0 ? void 0 : _d.full_address) || '',
|
|
415
|
+
};
|
|
416
|
+
},
|
|
417
|
+
formatProvince: (provinceApi) => {
|
|
418
|
+
if (!(provinceApi === null || provinceApi === void 0 ? void 0 : provinceApi.available_regions))
|
|
419
|
+
return [];
|
|
420
|
+
return provinceApi.available_regions.map((province) => ({
|
|
421
|
+
value: province.id || '',
|
|
422
|
+
label: province.name || '',
|
|
423
|
+
}));
|
|
424
|
+
},
|
|
425
|
+
formatDistrict: (districtApi) => {
|
|
426
|
+
if (!(districtApi === null || districtApi === void 0 ? void 0 : districtApi.districts))
|
|
427
|
+
return [];
|
|
428
|
+
return districtApi.districts.map((district) => ({
|
|
429
|
+
value: district.id || '',
|
|
430
|
+
label: district.name || '',
|
|
431
|
+
}));
|
|
432
|
+
},
|
|
433
|
+
formatCommune: (communeApi) => {
|
|
434
|
+
if (!(communeApi === null || communeApi === void 0 ? void 0 : communeApi.communes))
|
|
435
|
+
return [];
|
|
436
|
+
return communeApi.communes.map((commune) => ({
|
|
437
|
+
value: commune.id || '',
|
|
438
|
+
label: commune.name || '',
|
|
439
|
+
}));
|
|
440
|
+
},
|
|
441
|
+
formatOrder: (orderApi) => {
|
|
442
|
+
var _a, _b;
|
|
443
|
+
if (!orderApi)
|
|
444
|
+
return null;
|
|
445
|
+
return {
|
|
446
|
+
orderNumber: (orderApi === null || orderApi === void 0 ? void 0 : orderApi.order_number) || '',
|
|
447
|
+
shippingData: (orderApi === null || orderApi === void 0 ? void 0 : orderApi.shipping_data)
|
|
448
|
+
? {
|
|
449
|
+
shippingMethod: orderApi.shipping_data.shipping_method || '',
|
|
450
|
+
shippingDescription: orderApi.shipping_data.shipping_description || '',
|
|
451
|
+
shippingAddress: orderApi.shipping_data.shipping_address
|
|
452
|
+
? {
|
|
453
|
+
fullName: orderApi.shipping_data.shipping_address.firstname || '',
|
|
454
|
+
fullAddress: orderApi.shipping_data.shipping_address.full_address || '',
|
|
455
|
+
telephone: orderApi.shipping_data.shipping_address.telephone || '',
|
|
456
|
+
}
|
|
457
|
+
: null,
|
|
458
|
+
storeAddress: null,
|
|
459
|
+
}
|
|
460
|
+
: null,
|
|
461
|
+
orderedDate: (orderApi === null || orderApi === void 0 ? void 0 : orderApi.ordered_date) || '',
|
|
462
|
+
status: (orderApi === null || orderApi === void 0 ? void 0 : orderApi.status) || null,
|
|
463
|
+
totals: (orderApi === null || orderApi === void 0 ? void 0 : orderApi.totals)
|
|
464
|
+
? {
|
|
465
|
+
subtotal: orderApi.totals.subtotal || 0,
|
|
466
|
+
shippingAmount: orderApi.totals.shipping_amount || 0,
|
|
467
|
+
discountAmount: orderApi.totals.discount_amount || 0,
|
|
468
|
+
grandTotal: orderApi.totals.grand_total || 0,
|
|
469
|
+
}
|
|
470
|
+
: null,
|
|
471
|
+
products: ((_b = (_a = orderApi === null || orderApi === void 0 ? void 0 : orderApi.products) === null || _a === void 0 ? void 0 : _a.map) === null || _b === void 0 ? void 0 : _b.call(_a, (p) => ({
|
|
472
|
+
sku: p.sku || '',
|
|
473
|
+
name: p.name || '',
|
|
474
|
+
price: p.price || 0,
|
|
475
|
+
rowTotal: p.row_total || 0,
|
|
476
|
+
image: p.image || '',
|
|
477
|
+
qty: p.qty || 0,
|
|
478
|
+
}))) || [],
|
|
479
|
+
paymentMethod: (orderApi === null || orderApi === void 0 ? void 0 : orderApi.payment_method) || '',
|
|
480
|
+
};
|
|
481
|
+
},
|
|
482
|
+
formatStatistic: (statistic) => {
|
|
483
|
+
var _a, _b, _c, _d, _e;
|
|
484
|
+
if (!statistic)
|
|
485
|
+
return {};
|
|
486
|
+
return {
|
|
487
|
+
pending: Number((_a = statistic === null || statistic === void 0 ? void 0 : statistic.find((stt) => stt.status === 'pending')) === null || _a === void 0 ? void 0 : _a.amount) || 0,
|
|
488
|
+
processing: Number((_b = statistic === null || statistic === void 0 ? void 0 : statistic.find((stt) => stt.status === 'processing')) === null || _b === void 0 ? void 0 : _b.amount) || 0,
|
|
489
|
+
delivering: Number((_c = statistic === null || statistic === void 0 ? void 0 : statistic.find((stt) => stt.status === 'delivering')) === null || _c === void 0 ? void 0 : _c.amount) || 0,
|
|
490
|
+
complete: Number((_d = statistic === null || statistic === void 0 ? void 0 : statistic.find((stt) => stt.status === 'complete')) === null || _d === void 0 ? void 0 : _d.amount) || 0,
|
|
491
|
+
canceled: Number((_e = statistic === null || statistic === void 0 ? void 0 : statistic.find((stt) => stt.status === 'canceled')) === null || _e === void 0 ? void 0 : _e.amount) || 0,
|
|
492
|
+
};
|
|
493
|
+
},
|
|
494
|
+
formatCartItem: (cartItemApi) => {
|
|
495
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
496
|
+
if (!cartItemApi)
|
|
497
|
+
return null;
|
|
498
|
+
return {
|
|
499
|
+
itemId: cartItemApi.item_id || 0,
|
|
500
|
+
sku: cartItemApi.sku || '',
|
|
501
|
+
qty: cartItemApi.qty || 0,
|
|
502
|
+
name: cartItemApi.name || '',
|
|
503
|
+
price: cartItemApi.price || 0,
|
|
504
|
+
basePrice: ((_a = cartItemApi.extension_attributes) === null || _a === void 0 ? void 0 : _a.base_price) || 0,
|
|
505
|
+
productType: cartItemApi.product_type || '',
|
|
506
|
+
quoteId: cartItemApi.quote_id || '',
|
|
507
|
+
thumbnail: ((_b = cartItemApi.extension_attributes) === null || _b === void 0 ? void 0 : _b.thumbnail) || '',
|
|
508
|
+
rowTotal: ((_c = cartItemApi.extension_attributes) === null || _c === void 0 ? void 0 : _c.row_total) || 0,
|
|
509
|
+
promotions: (((_f = (_e = (_d = cartItemApi.extension_attributes) === null || _d === void 0 ? void 0 : _d.promotions) === null || _e === void 0 ? void 0 : _e.map) === null || _f === void 0 ? void 0 : _f.call(_e, dataFormatter.formatProductPromotion)) || []),
|
|
510
|
+
isInStock: ((_g = cartItemApi.extension_attributes) === null || _g === void 0 ? void 0 : _g.is_in_stock) || false,
|
|
511
|
+
urlProduct: ((_h = cartItemApi.extension_attributes) === null || _h === void 0 ? void 0 : _h.url_key) || '',
|
|
512
|
+
};
|
|
513
|
+
},
|
|
514
|
+
formatCartAddress: (cartAddressApi) => {
|
|
515
|
+
var _a;
|
|
516
|
+
if (!cartAddressApi)
|
|
517
|
+
return null;
|
|
518
|
+
return {
|
|
519
|
+
customerAddressId: (cartAddressApi === null || cartAddressApi === void 0 ? void 0 : cartAddressApi.customer_address_id) || 0,
|
|
520
|
+
id: cartAddressApi.id || 0,
|
|
521
|
+
region: cartAddressApi.region || '',
|
|
522
|
+
regionId: cartAddressApi.region_id || 0,
|
|
523
|
+
regionCode: cartAddressApi.region_code || '',
|
|
524
|
+
countryId: cartAddressApi.country_id || '',
|
|
525
|
+
street: cartAddressApi.street || [],
|
|
526
|
+
postcode: cartAddressApi.postcode || '',
|
|
527
|
+
city: cartAddressApi.city || '',
|
|
528
|
+
firstname: cartAddressApi.firstname || '',
|
|
529
|
+
lastname: cartAddressApi.lastname || '',
|
|
530
|
+
customerId: cartAddressApi.customer_id || 0,
|
|
531
|
+
email: cartAddressApi.email || '',
|
|
532
|
+
telephone: cartAddressApi.telephone || '',
|
|
533
|
+
sameAsBilling: cartAddressApi.same_as_billing || 0,
|
|
534
|
+
saveInAddressBook: cartAddressApi.save_in_address_book || 0,
|
|
535
|
+
fullAddress: ((_a = cartAddressApi.extension_attributes) === null || _a === void 0 ? void 0 : _a.full_address) || '',
|
|
536
|
+
};
|
|
537
|
+
},
|
|
538
|
+
formatEstimatedShipping: (estimatedShippingApi) => {
|
|
539
|
+
if (!estimatedShippingApi)
|
|
540
|
+
return null;
|
|
541
|
+
return {
|
|
542
|
+
carrierCode: estimatedShippingApi.carrier_code || '',
|
|
543
|
+
methodCode: estimatedShippingApi.method_code || '',
|
|
544
|
+
carrierTitle: estimatedShippingApi.carrier_title || '',
|
|
545
|
+
methodTitle: estimatedShippingApi.method_title || '',
|
|
546
|
+
amount: estimatedShippingApi.amount || 0,
|
|
547
|
+
baseAmount: estimatedShippingApi.base_amount || 0,
|
|
548
|
+
available: estimatedShippingApi.available || false,
|
|
549
|
+
errorMessage: estimatedShippingApi.error_message || '',
|
|
550
|
+
priceExclTax: estimatedShippingApi.price_excl_tax || 0,
|
|
551
|
+
priceInclTax: estimatedShippingApi.price_incl_tax || 0,
|
|
552
|
+
};
|
|
553
|
+
},
|
|
554
|
+
formatCartLoggedInCustomer: (cartLoggedInCustomerApi) => {
|
|
555
|
+
var _a, _b, _c;
|
|
556
|
+
if (!cartLoggedInCustomerApi)
|
|
557
|
+
return null;
|
|
558
|
+
return {
|
|
559
|
+
email: cartLoggedInCustomerApi.email || '',
|
|
560
|
+
firstname: cartLoggedInCustomerApi.firstname || '',
|
|
561
|
+
lastname: cartLoggedInCustomerApi.lastname || '',
|
|
562
|
+
id: cartLoggedInCustomerApi.id || 0,
|
|
563
|
+
groupId: cartLoggedInCustomerApi.group_id || 0,
|
|
564
|
+
createdAt: cartLoggedInCustomerApi.created_at || '',
|
|
565
|
+
updatedAt: cartLoggedInCustomerApi.updated_at || '',
|
|
566
|
+
createdIn: cartLoggedInCustomerApi.created_in || '',
|
|
567
|
+
storeId: cartLoggedInCustomerApi.store_id || 0,
|
|
568
|
+
websiteId: cartLoggedInCustomerApi.website_id || 0,
|
|
569
|
+
addresses: (((_b = (_a = cartLoggedInCustomerApi.addresses) === null || _a === void 0 ? void 0 : _a.map) === null || _b === void 0 ? void 0 : _b.call(_a, dataFormatter.formatCartAddress)) || []),
|
|
570
|
+
disableAutoGroupChange: cartLoggedInCustomerApi.disable_auto_group_change || 0,
|
|
571
|
+
isSubscribed: ((_c = cartLoggedInCustomerApi.extension_attributes) === null || _c === void 0 ? void 0 : _c.is_subscribed) || false,
|
|
572
|
+
};
|
|
573
|
+
},
|
|
574
|
+
formatCart: (cartApi) => {
|
|
575
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
576
|
+
if (!cartApi)
|
|
577
|
+
return null;
|
|
578
|
+
return {
|
|
579
|
+
id: cartApi.id || 0,
|
|
580
|
+
createdAt: cartApi.created_at || '',
|
|
581
|
+
updatedAt: cartApi.updated_at || '',
|
|
582
|
+
isActive: cartApi.is_active || false,
|
|
583
|
+
isVirtual: cartApi.is_virtual || false,
|
|
584
|
+
items: (((_c = (_b = (_a = cartApi.items) === null || _a === void 0 ? void 0 : _a.map) === null || _b === void 0 ? void 0 : _b.call(_a, dataFormatter.formatCartItem)) === null || _c === void 0 ? void 0 : _c.sort((a, b) => Number(b === null || b === void 0 ? void 0 : b.isInStock) - Number(a === null || a === void 0 ? void 0 : a.isInStock))) ||
|
|
585
|
+
[]),
|
|
586
|
+
itemsCount: cartApi.items_count || 0,
|
|
587
|
+
itemsQty: cartApi.items_qty || 0,
|
|
588
|
+
customer: cartApi.customer
|
|
589
|
+
? dataFormatter.formatCartLoggedInCustomer(cartApi.customer)
|
|
590
|
+
: null,
|
|
591
|
+
billingAddress: cartApi.billing_address
|
|
592
|
+
? dataFormatter.formatCartAddress(cartApi.billing_address)
|
|
593
|
+
: null,
|
|
594
|
+
origOrderId: cartApi.orig_order_id || 0,
|
|
595
|
+
currency: {
|
|
596
|
+
globalCurrencyCode: ((_d = cartApi.currency) === null || _d === void 0 ? void 0 : _d.global_currency_code) || '',
|
|
597
|
+
baseCurrencyCode: ((_e = cartApi.currency) === null || _e === void 0 ? void 0 : _e.base_currency_code) || '',
|
|
598
|
+
storeCurrencyCode: ((_f = cartApi.currency) === null || _f === void 0 ? void 0 : _f.store_currency_code) || '',
|
|
599
|
+
quoteCurrencyCode: ((_g = cartApi.currency) === null || _g === void 0 ? void 0 : _g.quote_currency_code) || '',
|
|
600
|
+
storeToBaseRate: ((_h = cartApi.currency) === null || _h === void 0 ? void 0 : _h.store_to_base_rate) || 0,
|
|
601
|
+
storeToQuoteRate: ((_j = cartApi.currency) === null || _j === void 0 ? void 0 : _j.store_to_quote_rate) || 0,
|
|
602
|
+
baseToGlobalRate: ((_k = cartApi.currency) === null || _k === void 0 ? void 0 : _k.base_to_global_rate) || 0,
|
|
603
|
+
baseToQuoteRate: ((_l = cartApi.currency) === null || _l === void 0 ? void 0 : _l.base_to_quote_rate) || 0,
|
|
604
|
+
},
|
|
605
|
+
customerIsGuest: cartApi.customer_is_guest || false,
|
|
606
|
+
customerNoteNotify: cartApi.customer_note_notify || false,
|
|
607
|
+
customerTaxClassId: cartApi.customer_tax_class_id || 0,
|
|
608
|
+
storeId: cartApi.store_id || 0,
|
|
609
|
+
shippingAssignments: (_p = (_o = (_m = cartApi.extension_attributes) === null || _m === void 0 ? void 0 : _m.shipping_assignments) === null || _o === void 0 ? void 0 : _o.map) === null || _p === void 0 ? void 0 : _p.call(_o, (s) => {
|
|
610
|
+
var _a, _b, _c;
|
|
611
|
+
return ({
|
|
612
|
+
shipping: {
|
|
613
|
+
address: s.shipping.address
|
|
614
|
+
? dataFormatter.formatCartAddress(s.shipping.address)
|
|
615
|
+
: null,
|
|
616
|
+
method: ((_a = s.shipping) === null || _a === void 0 ? void 0 : _a.method) || '',
|
|
617
|
+
},
|
|
618
|
+
items: (((_c = (_b = s.items).map) === null || _c === void 0 ? void 0 : _c.call(_b, dataFormatter.formatCartItem)) ||
|
|
619
|
+
[]),
|
|
620
|
+
});
|
|
621
|
+
}),
|
|
622
|
+
};
|
|
623
|
+
},
|
|
624
|
+
formatCartTotal: (cartTotalApi) => {
|
|
625
|
+
var _a, _b, _c;
|
|
626
|
+
if (!cartTotalApi)
|
|
627
|
+
return null;
|
|
628
|
+
return {
|
|
629
|
+
grandTotal: cartTotalApi.grand_total || 0,
|
|
630
|
+
baseGrandTotal: cartTotalApi.base_grand_total || 0,
|
|
631
|
+
subtotal: cartTotalApi.subtotal || 0,
|
|
632
|
+
baseSubtotal: cartTotalApi.base_subtotal || 0,
|
|
633
|
+
discountAmount: cartTotalApi.discount_amount || 0,
|
|
634
|
+
baseDiscountAmount: cartTotalApi.base_discount_amount || 0,
|
|
635
|
+
subtotalWithDiscount: cartTotalApi.subtotal_with_discount || 0,
|
|
636
|
+
baseSubtotalWithDiscount: cartTotalApi.base_subtotal_with_discount || 0,
|
|
637
|
+
shippingAmount: cartTotalApi.shipping_amount || 0,
|
|
638
|
+
baseShippingAmount: cartTotalApi.base_shipping_amount || 0,
|
|
639
|
+
shippingDiscountAmount: cartTotalApi.shipping_discount_amount || 0,
|
|
640
|
+
baseShippingDiscountAmount: cartTotalApi.base_shipping_discount_amount || 0,
|
|
641
|
+
taxAmount: cartTotalApi.tax_amount || 0,
|
|
642
|
+
baseTaxAmount: cartTotalApi.base_tax_amount || 0,
|
|
643
|
+
weeeTaxAppliedAmount: cartTotalApi.weee_tax_applied_amount || 0,
|
|
644
|
+
shippingTaxAmount: cartTotalApi.shipping_tax_amount || 0,
|
|
645
|
+
baseShippingTaxAmount: cartTotalApi.base_shipping_tax_amount || 0,
|
|
646
|
+
subtotalInclTax: cartTotalApi.subtotal_incl_tax || 0,
|
|
647
|
+
shippingInclTax: cartTotalApi.shipping_incl_tax || 0,
|
|
648
|
+
baseShippingInclTax: cartTotalApi.base_shipping_incl_tax || 0,
|
|
649
|
+
baseCurrencyCode: cartTotalApi.base_currency_code || '',
|
|
650
|
+
quoteCurrencyCode: cartTotalApi.quote_currency_code || '',
|
|
651
|
+
itemsQty: cartTotalApi.items_qty || 0,
|
|
652
|
+
coupon: {
|
|
653
|
+
couponCode: cartTotalApi.coupon_code || '',
|
|
654
|
+
couponDescription: ((_a = cartTotalApi === null || cartTotalApi === void 0 ? void 0 : cartTotalApi.extension_attributes) === null || _a === void 0 ? void 0 : _a.coupon_description_text) || '',
|
|
655
|
+
},
|
|
656
|
+
items: ((_c = (_b = cartTotalApi.items) === null || _b === void 0 ? void 0 : _b.map) === null || _c === void 0 ? void 0 : _c.call(_b, (item) => ({
|
|
657
|
+
itemId: item.item_id || 0,
|
|
658
|
+
price: item.price || 0,
|
|
659
|
+
basePrice: item.base_price || 0,
|
|
660
|
+
qty: item.qty || 0,
|
|
661
|
+
rowTotal: item.row_total || 0,
|
|
662
|
+
baseRowTotal: item.base_row_total || 0,
|
|
663
|
+
rowTotalWithDiscount: item.row_total_with_discount || 0,
|
|
664
|
+
taxAmount: item.tax_amount || 0,
|
|
665
|
+
baseTaxAmount: item.base_tax_amount || 0,
|
|
666
|
+
taxPercent: item.tax_percent || 0,
|
|
667
|
+
discountAmount: item.discount_amount || 0,
|
|
668
|
+
baseDiscountAmount: item.base_discount_amount || 0,
|
|
669
|
+
discountPercent: item.discount_percent || 0,
|
|
670
|
+
priceInclTax: item.price_incl_tax || 0,
|
|
671
|
+
basePriceInclTax: item.base_price_incl_tax || 0,
|
|
672
|
+
rowTotalInclTax: item.row_total_incl_tax || 0,
|
|
673
|
+
baseRowTotalInclTax: item.base_row_total_incl_tax || 0,
|
|
674
|
+
options: item.options || '',
|
|
675
|
+
weeeTaxAppliedAmount: item.weee_tax_applied_amount || 0,
|
|
676
|
+
weeeTaxApplied: item.weee_tax_applied || 0,
|
|
677
|
+
name: item.name || '',
|
|
678
|
+
}))) || [],
|
|
679
|
+
totalSegments: cartTotalApi.total_segments || [],
|
|
680
|
+
};
|
|
681
|
+
},
|
|
682
|
+
formatPaymentMethod: (methods) => {
|
|
683
|
+
if (!methods)
|
|
684
|
+
return null;
|
|
685
|
+
return methods === null || methods === void 0 ? void 0 : methods.map((method) => ({
|
|
686
|
+
code: (method === null || method === void 0 ? void 0 : method.payment_code) || '',
|
|
687
|
+
title: (method === null || method === void 0 ? void 0 : method.payment_title) || '',
|
|
688
|
+
thumbnail: (method === null || method === void 0 ? void 0 : method.payment_thumbnail) || '',
|
|
689
|
+
}));
|
|
690
|
+
},
|
|
691
|
+
formatPaymentInformation: (paymentInformationApi) => {
|
|
692
|
+
var _a;
|
|
693
|
+
if (!paymentInformationApi)
|
|
694
|
+
return null;
|
|
695
|
+
return {
|
|
696
|
+
paymentMethods: dataFormatter.formatPaymentMethod((_a = paymentInformationApi === null || paymentInformationApi === void 0 ? void 0 : paymentInformationApi.extension_attributes) === null || _a === void 0 ? void 0 : _a.payment_detail_info) || [],
|
|
697
|
+
totals: dataFormatter.formatCartTotal(paymentInformationApi.totals),
|
|
698
|
+
};
|
|
699
|
+
},
|
|
700
|
+
formatOrderConfirmation: (orderConfirmationApi) => {
|
|
701
|
+
if (!orderConfirmationApi)
|
|
702
|
+
return null;
|
|
703
|
+
return {
|
|
704
|
+
isSuccess: orderConfirmationApi.is_success || false,
|
|
705
|
+
orderInfo: dataFormatter.formatOrder(orderConfirmationApi.order_info),
|
|
706
|
+
};
|
|
707
|
+
},
|
|
708
|
+
formatCoupons: (couponListApi) => {
|
|
709
|
+
var _a;
|
|
710
|
+
if (!((_a = couponListApi === null || couponListApi === void 0 ? void 0 : couponListApi.items) === null || _a === void 0 ? void 0 : _a.length))
|
|
711
|
+
return null;
|
|
712
|
+
return couponListApi.items.map((couponApi) => ({
|
|
713
|
+
code: (couponApi === null || couponApi === void 0 ? void 0 : couponApi.code) || '',
|
|
714
|
+
name: (couponApi === null || couponApi === void 0 ? void 0 : couponApi.name) || '',
|
|
715
|
+
thumbnail: (couponApi === null || couponApi === void 0 ? void 0 : couponApi.thumbnail) || '',
|
|
716
|
+
description: (couponApi === null || couponApi === void 0 ? void 0 : couponApi.expired_date) || '',
|
|
717
|
+
}));
|
|
718
|
+
},
|
|
719
|
+
formatShippings: (shippingsApi) => {
|
|
720
|
+
if (!shippingsApi)
|
|
721
|
+
return [];
|
|
722
|
+
return shippingsApi.map((shippingApi) => {
|
|
723
|
+
var _a;
|
|
724
|
+
return ({
|
|
725
|
+
carrierCode: shippingApi.carrier_code || '',
|
|
726
|
+
methodCode: shippingApi.method_code || '',
|
|
727
|
+
title: shippingApi.carrier_title || '',
|
|
728
|
+
description: shippingApi.method_title || '',
|
|
729
|
+
price: (shippingApi === null || shippingApi === void 0 ? void 0 : shippingApi.base_amount) || 0,
|
|
730
|
+
thumbnail: ((_a = shippingApi === null || shippingApi === void 0 ? void 0 : shippingApi.extension_attributes) === null || _a === void 0 ? void 0 : _a.thumbnail) || '',
|
|
731
|
+
});
|
|
732
|
+
});
|
|
733
|
+
},
|
|
734
|
+
};
|
|
735
|
+
|
|
736
|
+
var index = /*#__PURE__*/Object.freeze({
|
|
737
|
+
__proto__: null,
|
|
738
|
+
dataFormatter: dataFormatter
|
|
739
|
+
});
|
|
740
|
+
|
|
741
|
+
exports.Constants = constants.constants;
|
|
742
|
+
exports.Types = types.types;
|
|
743
|
+
exports.ApiTypes = apiTypes;
|
|
744
|
+
exports.DataFormatter = index;
|
|
745
|
+
exports.DataTypes = dataTypes;
|