s-platform-landing-section 0.1.12 → 0.1.15

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/index.js CHANGED
@@ -15,6 +15,9 @@ var bs = require('react-icons/bs');
15
15
  var lu = require('react-icons/lu');
16
16
  var DatePicker = _interopDefault(require('react-datepicker'));
17
17
  require('react-datepicker/dist/react-datepicker.css');
18
+ var Slider = _interopDefault(require('react-slick'));
19
+ require('slick-carousel/slick/slick.css');
20
+ require('slick-carousel/slick/slick-theme.css');
18
21
  var ai = require('react-icons/ai');
19
22
  var go = require('react-icons/go');
20
23
  var ri = require('react-icons/ri');
@@ -649,9 +652,9 @@ var SvgIcon = function SvgIcon(_ref) {
649
652
  var SectionTitle1 = function SectionTitle1(props) {
650
653
  var _props$data = props.data,
651
654
  data = _props$data === void 0 ? {} : _props$data;
652
- return /*#__PURE__*/React__default.createElement("div", null, data !== null && data !== void 0 && data.sectionTitle ? /*#__PURE__*/React__default.createElement("div", {
655
+ return /*#__PURE__*/React__default.createElement("div", null, data !== null && data !== void 0 && data.sectionTitle ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
653
656
  className: "text-center text-2xl md:text-4xl font-headingFont font-semibold leading-relaxed text-textHeading"
654
- }, data === null || data === void 0 ? void 0 : data.sectionTitle) : null, /*#__PURE__*/React__default.createElement("div", {
657
+ }, data === null || data === void 0 ? void 0 : data.sectionTitle), /*#__PURE__*/React__default.createElement("div", {
655
658
  className: "flex items-center justify-center"
656
659
  }, /*#__PURE__*/React__default.createElement("div", {
657
660
  className: "w-32 h-0.5 rounded-full bg-secondary"
@@ -659,7 +662,7 @@ var SectionTitle1 = function SectionTitle1(props) {
659
662
  className: "w-9 h-9 text-secondary"
660
663
  }), /*#__PURE__*/React__default.createElement("div", {
661
664
  className: " w-32 h-0.5 rounded-full bg-secondary"
662
- })), data !== null && data !== void 0 && data.sectionDescription ? /*#__PURE__*/React__default.createElement("div", {
665
+ }))) : null, data !== null && data !== void 0 && data.sectionDescription ? /*#__PURE__*/React__default.createElement("div", {
663
666
  className: "text-xl font-medium text-center leading-relaxed text-textSecondary"
664
667
  }, data === null || data === void 0 ? void 0 : data.sectionDescription) : null);
665
668
  };
@@ -988,54 +991,7 @@ var Hero10 = function Hero10(props) {
988
991
  })));
989
992
  };
990
993
 
991
- var Dash = function Dash(props) {
992
- var _props$color = props.color,
993
- color = _props$color === void 0 ? "#ccc" : _props$color,
994
- _props$className = props.className,
995
- className = _props$className === void 0 ? "" : _props$className;
996
- return /*#__PURE__*/React__default.createElement("div", {
997
- className: "mx-auto w-full max-w-[240px] md:max-w-[720px] border-b-0 " + className,
998
- style: {
999
- backgroundImage: "repeating-linear-gradient(to right, " + color + " 0, " + color + " 10px, transparent 10px, transparent 20px)",
1000
- height: "1px"
1001
- }
1002
- });
1003
- };
1004
-
1005
- var SECTION_DEFAULT_CLASS = "my-12 mx-4 xl:mx-20 bg-background";
1006
- var SECTION_CLASS = "my-6 md:my-12 px-4 xl:px-20 bg-background";
1007
-
1008
994
  var Hero11 = function Hero11(props) {
1009
- var _data$data;
1010
- var _props$shopConfigStyl = props.shopConfigStyle,
1011
- shopConfigStyle = _props$shopConfigStyl === void 0 ? {} : _props$shopConfigStyl,
1012
- _props$data = props.data,
1013
- data = _props$data === void 0 ? {} : _props$data,
1014
- _props$SectionTitle = props.SectionTitle,
1015
- SectionTitle = _props$SectionTitle === void 0 ? null : _props$SectionTitle;
1016
- var _shopConfigStyle$colo = shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : shopConfigStyle.color,
1017
- _shopConfigStyle$colo3 = _shopConfigStyle$colo.secondary,
1018
- secondary = _shopConfigStyle$colo3 === void 0 ? "#000" : _shopConfigStyle$colo3;
1019
- return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
1020
- className: "" + SECTION_DEFAULT_CLASS
1021
- }, /*#__PURE__*/React__default.createElement(SectionTitle, {
1022
- data: data,
1023
- shopConfigStyle: shopConfigStyle
1024
- }), /*#__PURE__*/React__default.createElement("div", {
1025
- className: "mt-6 grid grid-cols-2 md:grid-cols-4 gap-1 md:gap-2"
1026
- }, data === null || data === void 0 ? void 0 : (_data$data = data.data) === null || _data$data === void 0 ? void 0 : _data$data.map(function (it, index) {
1027
- var _it$srcImages;
1028
- return /*#__PURE__*/React__default.createElement("div", {
1029
- key: index
1030
- }, /*#__PURE__*/React__default.createElement("img", {
1031
- src: it === null || it === void 0 ? void 0 : (_it$srcImages = it.srcImages) === null || _it$srcImages === void 0 ? void 0 : _it$srcImages[0]
1032
- }));
1033
- }))), /*#__PURE__*/React__default.createElement(Dash, {
1034
- color: secondary
1035
- }));
1036
- };
1037
-
1038
- var Hero11$1 = function Hero11(props) {
1039
995
  var _data$data, _data$data$, _data$data$$srcImages, _data$data2, _data$data2$, _data$data3, _data$data3$;
1040
996
  var _props$data = props.data,
1041
997
  data = _props$data === void 0 ? {} : _props$data;
@@ -7334,55 +7290,8 @@ var Hero13 = function Hero13(props) {
7334
7290
  }));
7335
7291
  };
7336
7292
 
7337
- var Features1 = function Features1(props) {
7338
- var _data$data;
7339
- var _props$shopConfigStyl = props.shopConfigStyle,
7340
- shopConfigStyle = _props$shopConfigStyl === void 0 ? {} : _props$shopConfigStyl,
7341
- _props$data = props.data,
7342
- data = _props$data === void 0 ? {} : _props$data,
7343
- _props$SectionTitle = props.SectionTitle,
7344
- SectionTitle = _props$SectionTitle === void 0 ? null : _props$SectionTitle;
7345
- var _shopConfigStyle$colo = shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : shopConfigStyle.color,
7346
- _shopConfigStyle$colo3 = _shopConfigStyle$colo.secondary,
7347
- secondary = _shopConfigStyle$colo3 === void 0 ? "#000" : _shopConfigStyle$colo3;
7348
- return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
7349
- className: SECTION_DEFAULT_CLASS + " relative"
7350
- }, /*#__PURE__*/React__default.createElement(SectionTitle, {
7351
- data: data
7352
- }), /*#__PURE__*/React__default.createElement("div", {
7353
- className: "mt-6 grid grid-cols-3 gap-4 md:gap-8"
7354
- }, data === null || data === void 0 ? void 0 : (_data$data = data.data) === null || _data$data === void 0 ? void 0 : _data$data.map(function (it, index) {
7355
- return /*#__PURE__*/React__default.createElement("div", {
7356
- key: index,
7357
- className: "pt-6 col-span-3 md:col-span-1"
7358
- }, /*#__PURE__*/React__default.createElement("div", {
7359
- className: "relative w-40 h-24 flex items-center justify-center m-auto md:m-0"
7360
- }, /*#__PURE__*/React__default.createElement("div", {
7361
- className: "absolute w-40 h-24 rounded-2xl z-10 bg-primary"
7362
- }), /*#__PURE__*/React__default.createElement("div", {
7363
- className: "absolute w-24 h-16 rounded-2xl -right-2 -top-2 z-0 bg-secondary"
7364
- }), it !== null && it !== void 0 && it.svgImage ? /*#__PURE__*/React__default.createElement("div", {
7365
- className: "w-12 text-primary h-16 w-16 z-20 m-auto"
7366
- }, /*#__PURE__*/React__default.createElement("div", {
7367
- dangerouslySetInnerHTML: {
7368
- __html: configSvg(it === null || it === void 0 ? void 0 : it.svgImage)
7369
- }
7370
- })) : /*#__PURE__*/React__default.createElement("div", {
7371
- className: "h-16 m-auto bg-center w-16 bg-cover bg-no-repeat z-20",
7372
- style: {
7373
- backgroundImage: "url(" + it.srcImage + ")"
7374
- }
7375
- })), /*#__PURE__*/React__default.createElement("p", {
7376
- className: "mx-auto md:mt-3 md:mx-0 text-xl py-2 font-medium w-fit rounded-lg"
7377
- }, it.title), /*#__PURE__*/React__default.createElement("div", {
7378
- className: "mx-auto md:mx-0 mb-2 w-28 h-2px rounded-full bg-secondary"
7379
- }), /*#__PURE__*/React__default.createElement("p", {
7380
- className: "text-base mx-auto md:mx-0 text-center md:text-start"
7381
- }, it.description));
7382
- }))), /*#__PURE__*/React__default.createElement(Dash, {
7383
- color: secondary
7384
- }));
7385
- };
7293
+ var SECTION_DEFAULT_CLASS = "my-12 mx-4 xl:mx-20 bg-background";
7294
+ var SECTION_CLASS = "my-6 md:my-12 px-4 xl:px-20 bg-background";
7386
7295
 
7387
7296
  var Features2 = function Features2(props) {
7388
7297
  var data = props.data;
@@ -7542,7 +7451,7 @@ var ProductController = function ProductController(props) {
7542
7451
  };
7543
7452
  };
7544
7453
 
7545
- var _path, _path2, _path3;
7454
+ var _path;
7546
7455
  function _extends$1() {
7547
7456
  return _extends$1 = Object.assign ? Object.assign.bind() : function (n) {
7548
7457
  for (var e = 1; e < arguments.length; e++) {
@@ -7552,13 +7461,130 @@ function _extends$1() {
7552
7461
  return n;
7553
7462
  }, _extends$1.apply(null, arguments);
7554
7463
  }
7555
- function SvgImageGallery(props) {
7464
+ function SvgAngleSmallLeft(props) {
7556
7465
  return /*#__PURE__*/React.createElement("svg", _extends$1({
7466
+ xmlns: "http://www.w3.org/2000/svg",
7467
+ viewBox: "0 0 24 24",
7468
+ width: 512,
7469
+ height: 512
7470
+ }, props), _path || (_path = /*#__PURE__*/React.createElement("path", {
7471
+ d: "M10.6 12.71a1 1 0 010-1.42l4.59-4.58a1 1 0 000-1.42 1 1 0 00-1.41 0L9.19 9.88a3 3 0 000 4.24l4.59 4.59a1 1 0 00.7.29 1 1 0 00.71-.29 1 1 0 000-1.42z"
7472
+ })));
7473
+ }
7474
+
7475
+ var _path$1;
7476
+ function _extends$2() {
7477
+ return _extends$2 = Object.assign ? Object.assign.bind() : function (n) {
7478
+ for (var e = 1; e < arguments.length; e++) {
7479
+ var t = arguments[e];
7480
+ for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
7481
+ }
7482
+ return n;
7483
+ }, _extends$2.apply(null, arguments);
7484
+ }
7485
+ function SvgAngleSmallRight(props) {
7486
+ return /*#__PURE__*/React.createElement("svg", _extends$2({
7487
+ xmlns: "http://www.w3.org/2000/svg",
7488
+ viewBox: "0 0 24 24",
7489
+ width: 512,
7490
+ height: 512
7491
+ }, props), _path$1 || (_path$1 = /*#__PURE__*/React.createElement("path", {
7492
+ d: "M15.4 9.88l-4.59-4.59a1 1 0 00-1.41 0 1 1 0 000 1.42l4.6 4.58a1 1 0 010 1.42l-4.6 4.58a1 1 0 001.41 1.42l4.59-4.59a3 3 0 000-4.24z"
7493
+ })));
7494
+ }
7495
+
7496
+ var ScrollHorizontal = function ScrollHorizontal(props) {
7497
+ var _props$datas = props.datas,
7498
+ datas = _props$datas === void 0 ? [] : _props$datas,
7499
+ _props$className = props.className,
7500
+ className = _props$className === void 0 ? "" : _props$className,
7501
+ _props$style = props.style,
7502
+ style = _props$style === void 0 ? {} : _props$style,
7503
+ _props$renderItem = props.renderItem,
7504
+ renderItem = _props$renderItem === void 0 ? function () {} : _props$renderItem;
7505
+ var scrollContainerRef = React.useRef(null);
7506
+ var _useState = React.useState(true),
7507
+ isScrolledToLeft = _useState[0],
7508
+ setIsScrolledToLeft = _useState[1];
7509
+ var _useState2 = React.useState(false),
7510
+ isScrolledToRight = _useState2[0],
7511
+ setIsScrolledToRight = _useState2[1];
7512
+ var checkScrollPosition = function checkScrollPosition() {
7513
+ if (scrollContainerRef.current) {
7514
+ var _scrollContainerRef$c = scrollContainerRef.current,
7515
+ _scrollLeft = _scrollContainerRef$c.scrollLeft,
7516
+ scrollWidth = _scrollContainerRef$c.scrollWidth,
7517
+ clientWidth = _scrollContainerRef$c.clientWidth;
7518
+ setIsScrolledToLeft(_scrollLeft === 0);
7519
+ setIsScrolledToRight(_scrollLeft + clientWidth >= scrollWidth);
7520
+ }
7521
+ };
7522
+ var scrollLeft = function scrollLeft() {
7523
+ if (scrollContainerRef.current) {
7524
+ scrollContainerRef.current.scrollBy({
7525
+ left: -200,
7526
+ behavior: "smooth"
7527
+ });
7528
+ setTimeout(checkScrollPosition, 300);
7529
+ }
7530
+ };
7531
+ var scrollRight = function scrollRight() {
7532
+ if (scrollContainerRef.current) {
7533
+ scrollContainerRef.current.scrollBy({
7534
+ left: 200,
7535
+ behavior: "smooth"
7536
+ });
7537
+ setTimeout(checkScrollPosition, 300);
7538
+ }
7539
+ };
7540
+ React.useEffect(function () {
7541
+ checkScrollPosition();
7542
+ }, [datas]);
7543
+ return /*#__PURE__*/React__default.createElement("div", {
7544
+ className: "flex " + className,
7545
+ style: style
7546
+ }, /*#__PURE__*/React__default.createElement("div", {
7547
+ className: "flex w-full overflow-x-hidden",
7548
+ ref: scrollContainerRef,
7549
+ onScroll: checkScrollPosition
7550
+ }, datas === null || datas === void 0 ? void 0 : datas.map(function (item, index) {
7551
+ return renderItem(item, index);
7552
+ })), /*#__PURE__*/React__default.createElement("div", {
7553
+ className: "flex gap-2 items-center px-4"
7554
+ }, /*#__PURE__*/React__default.createElement("div", {
7555
+ onClick: scrollLeft,
7556
+ className: "cursor-pointer w-8 h-8 rounded-full flex justify-center items-center " + (isScrolledToLeft ? "bg-gray4" : "bg-primary")
7557
+ }, /*#__PURE__*/React__default.createElement(SvgAngleSmallLeft, {
7558
+ width: 24,
7559
+ height: 24,
7560
+ fill: "#fff"
7561
+ })), /*#__PURE__*/React__default.createElement("div", {
7562
+ onClick: scrollRight,
7563
+ className: "cursor-pointer w-8 h-8 rounded-full flex justify-center items-center " + (isScrolledToRight ? "bg-gray4" : "bg-primary")
7564
+ }, /*#__PURE__*/React__default.createElement(SvgAngleSmallRight, {
7565
+ width: 24,
7566
+ height: 24,
7567
+ fill: "#fff"
7568
+ }))));
7569
+ };
7570
+
7571
+ var _path$2, _path2, _path3;
7572
+ function _extends$3() {
7573
+ return _extends$3 = Object.assign ? Object.assign.bind() : function (n) {
7574
+ for (var e = 1; e < arguments.length; e++) {
7575
+ var t = arguments[e];
7576
+ for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
7577
+ }
7578
+ return n;
7579
+ }, _extends$3.apply(null, arguments);
7580
+ }
7581
+ function SvgImageGallery(props) {
7582
+ return /*#__PURE__*/React.createElement("svg", _extends$3({
7557
7583
  height: 512,
7558
7584
  viewBox: "0 0 24 24",
7559
7585
  width: 512,
7560
7586
  xmlns: "http://www.w3.org/2000/svg"
7561
- }, props), _path || (_path = /*#__PURE__*/React.createElement("path", {
7587
+ }, props), _path$2 || (_path$2 = /*#__PURE__*/React.createElement("path", {
7562
7588
  d: "M17.453 24c-.168 0-.34-.021-.51-.066L1.48 19.793a2.018 2.018 0 01-1.414-2.45l1.951-7.272a.5.5 0 01.966.258l-1.95 7.27c-.139.53.179 1.082.71 1.229L17.2 22.967a.995.995 0 001.217-.704l.781-2.894a.499.499 0 11.966.26l-.78 2.89A1.997 1.997 0 0117.453 24z"
7563
7589
  })), _path2 || (_path2 = /*#__PURE__*/React.createElement("path", {
7564
7590
  d: "M22 18H6c-1.103 0-2-.897-2-2V4c0-1.103.897-2 2-2h16c1.103 0 2 .897 2 2v12c0 1.103-.897 2-2 2zM6 3c-.551 0-1 .449-1 1v12c0 .551.449 1 1 1h16c.551 0 1-.449 1-1V4c0-.551-.449-1-1-1z"
@@ -7611,233 +7637,290 @@ var ProductImage = function ProductImage(props) {
7611
7637
  });
7612
7638
  };
7613
7639
 
7614
- var ModalNotification = function ModalNotification(props) {
7615
- var modalRef = React.useRef(null);
7616
- var onClose = props.onClose,
7617
- onCloseFormBooking = props.onCloseFormBooking,
7618
- _props$isButtonClose = props.isButtonClose,
7619
- isButtonClose = _props$isButtonClose === void 0 ? true : _props$isButtonClose;
7620
- var handleClickOutside = function handleClickOutside(event) {
7621
- if (modalRef.current && !modalRef.current.contains(event.target)) {
7622
- if (onClose) onClose();
7623
- if (onCloseFormBooking && typeof onCloseFormBooking === 'function') {
7624
- onCloseFormBooking();
7625
- }
7626
- }
7627
- };
7628
- React.useEffect(function () {
7629
- document.addEventListener('click', handleClickOutside);
7630
- return function () {
7631
- document.removeEventListener('click', handleClickOutside);
7632
- };
7633
- }, []);
7634
- return /*#__PURE__*/React__default.createElement("div", {
7635
- className: "fixed inset-0 bg-black flex items-center justify-center bg-opacity-50 z-50 "
7636
- }, /*#__PURE__*/React__default.createElement("div", {
7637
- className: " flex items-center justify-center relative bg-red",
7638
- ref: modalRef
7639
- }, props === null || props === void 0 ? void 0 : props.children, isButtonClose && /*#__PURE__*/React__default.createElement("button", {
7640
- className: "absolute top-4 right-4",
7641
- onClick: onClose
7642
- }, /*#__PURE__*/React__default.createElement(rx.RxCross2, null))));
7640
+ var formatCurrency = function formatCurrency(amount) {
7641
+ if (isNaN(amount)) {
7642
+ return '0 ₫';
7643
+ }
7644
+ var roundedAmount = Math.round(amount);
7645
+ var formattedAmount = roundedAmount.toString().replace(/\B(?=(\d{3})+(?!\d))/g, '.');
7646
+ return formattedAmount + " \u20AB";
7643
7647
  };
7644
-
7645
- var getEmployeeListApi = function getEmployeeListApi(shopId) {
7646
- return api({
7647
- method: "get",
7648
- url: "/chain-employment-profile/filter-employ-by-customer",
7649
- params: {
7650
- shopIds: shopId
7651
- },
7652
- headers: {
7653
- shopId: shopId
7654
- }
7655
- });
7648
+ var pattern = {
7649
+ phoneNumberPattern: /^(?:\+84|0)\d{9}$/
7650
+ };
7651
+ var numberPattern = /^\d+$/;
7652
+ var getYoutubeVideoIdByUrl = function getYoutubeVideoIdByUrl(url) {
7653
+ var regex = /(?:youtube\.com\/(?:[^\/\n\s]+\/\S+\/|(?:v|e(?:mbed)?)\/|.*[?&]v=)|youtu\.be\/|youtube\.com\/shorts\/)([a-zA-Z0-9_-]{11})/;
7654
+ var match = url === null || url === void 0 ? void 0 : url.match(regex);
7655
+ return match ? match[1] : null;
7656
7656
  };
7657
7657
 
7658
- var EmployeeController = function EmployeeController(props) {
7659
- var _props$isAutoGetList = props.isAutoGetList,
7660
- isAutoGetList = _props$isAutoGetList === void 0 ? true : _props$isAutoGetList,
7661
- shopConfig = props.shopConfig;
7662
- var _useState = React.useState([]),
7663
- listEmployment = _useState[0],
7664
- setListEmployment = _useState[1];
7658
+ function getMinMax(array, field) {
7659
+ if (!(array !== null && array !== void 0 && array.length) || !array[0].hasOwnProperty(field)) {
7660
+ return null;
7661
+ }
7662
+ var _array$reduce = array.reduce(function (acc, obj) {
7663
+ var value = obj[field];
7664
+ return {
7665
+ min: value < acc.min ? value : acc.min,
7666
+ max: value > acc.max ? value : acc.max
7667
+ };
7668
+ }, {
7669
+ min: array[0][field],
7670
+ max: array[0][field]
7671
+ }),
7672
+ min = _array$reduce.min,
7673
+ max = _array$reduce.max;
7674
+ return {
7675
+ min: min,
7676
+ max: max
7677
+ };
7678
+ }
7679
+ var ProductPrice = function ProductPrice(props) {
7680
+ var product = props.product,
7681
+ variant = props.variant,
7682
+ _props$className = props.className,
7683
+ className = _props$className === void 0 ? "" : _props$className,
7684
+ _props$style = props.style,
7685
+ style = _props$style === void 0 ? {} : _props$style;
7686
+ var _useState = React.useState(),
7687
+ displayPrice = _useState[0],
7688
+ setDisplayPrice = _useState[1];
7689
+ var _useState2 = React.useState(),
7690
+ displayPriceBeforeDiscount = _useState2[0],
7691
+ setDisplayPriceBeforeDiscount = _useState2[1];
7665
7692
  React.useEffect(function () {
7666
- if (isAutoGetList) {
7667
- getListEmployee();
7693
+ if (variant) {
7694
+ genProductPrice([variant]);
7695
+ } else if (product) {
7696
+ genProductPrice(product.variants);
7668
7697
  }
7669
- }, [isAutoGetList]);
7670
- var getListEmployee = function getListEmployee() {
7671
- try {
7672
- return Promise.resolve(_catch(function () {
7673
- return Promise.resolve(getEmployeeListApi(shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopId)).then(function (res) {
7674
- var _res$data, _res$data$status;
7675
- if ((res === null || res === void 0 ? void 0 : (_res$data = res.data) === null || _res$data === void 0 ? void 0 : (_res$data$status = _res$data.status) === null || _res$data$status === void 0 ? void 0 : _res$data$status.code) == 200) {
7676
- var _res$data2;
7677
- setListEmployment((res === null || res === void 0 ? void 0 : (_res$data2 = res.data) === null || _res$data2 === void 0 ? void 0 : _res$data2.data) || []);
7678
- }
7679
- return res;
7680
- });
7681
- }, function (e) {
7682
- console.log(e);
7683
- }));
7684
- } catch (e) {
7685
- return Promise.reject(e);
7698
+ }, [product, variant]);
7699
+ var genProductPrice = function genProductPrice(variants) {
7700
+ var mPrice = getMinMax(variants, 'price');
7701
+ var mPriceBeforeDiscount = getMinMax(variants, 'priceBeforeDiscount');
7702
+ if (mPrice && mPriceBeforeDiscount) {
7703
+ var _displayPriceBeforeDiscount = formatCurrency(mPriceBeforeDiscount.min);
7704
+ var _displayPrice = formatCurrency(mPrice.min);
7705
+ if (mPrice.min !== mPrice.max) {
7706
+ _displayPrice += " - " + formatCurrency(mPrice.max);
7707
+ }
7708
+ if (mPriceBeforeDiscount.min !== mPriceBeforeDiscount.max) {
7709
+ _displayPriceBeforeDiscount += " - " + formatCurrency(mPriceBeforeDiscount.max);
7710
+ }
7711
+ setDisplayPrice(_displayPrice);
7712
+ setDisplayPriceBeforeDiscount(_displayPriceBeforeDiscount);
7713
+ } else {
7714
+ var _displayPrice2 = formatCurrency(product === null || product === void 0 ? void 0 : product.price);
7715
+ setDisplayPrice(_displayPrice2);
7686
7716
  }
7687
7717
  };
7688
- return {
7689
- listEmployment: listEmployment,
7690
- getListEmployee: getListEmployee
7691
- };
7718
+ return /*#__PURE__*/React__default.createElement("div", {
7719
+ className: className
7720
+ }, displayPriceBeforeDiscount !== displayPrice && displayPriceBeforeDiscount != null ? /*#__PURE__*/React__default.createElement("span", {
7721
+ className: "text-gray3 line-through mr-2"
7722
+ }, displayPriceBeforeDiscount) : null, /*#__PURE__*/React__default.createElement("span", {
7723
+ className: "text-primary font-semibold",
7724
+ style: style
7725
+ }, displayPrice));
7692
7726
  };
7693
7727
 
7694
- var createSpaScheduleApi = function createSpaScheduleApi(shopId, data) {
7695
- return api({
7696
- method: "post",
7697
- url: "/spa-schedule/customer/create",
7698
- data: data,
7699
- headers: {
7700
- shopId: shopId
7701
- }
7702
- });
7728
+ var ProductItem1 = function ProductItem1(props) {
7729
+ var product = props.product;
7730
+ return /*#__PURE__*/React__default.createElement("div", {
7731
+ className: "flex"
7732
+ }, /*#__PURE__*/React__default.createElement(ProductImage, {
7733
+ product: product,
7734
+ className: "!w-20 rounded-lg"
7735
+ }), /*#__PURE__*/React__default.createElement("div", {
7736
+ className: "ml-4 border-b border-stroke flex-1"
7737
+ }, /*#__PURE__*/React__default.createElement("div", {
7738
+ className: "text-lg"
7739
+ }, product === null || product === void 0 ? void 0 : product.productName), /*#__PURE__*/React__default.createElement("div", {
7740
+ className: "flex mt-2"
7741
+ }, /*#__PURE__*/React__default.createElement("div", {
7742
+ className: "flex-1 text-gray3"
7743
+ }, getDurationValue(product === null || product === void 0 ? void 0 : product.attributes)), /*#__PURE__*/React__default.createElement(ProductPrice, {
7744
+ product: product
7745
+ }))));
7703
7746
  };
7704
- var draftOrderWithoutLoginApi = function draftOrderWithoutLoginApi(shopId, data) {
7705
- return api({
7706
- method: "post",
7707
- url: "/spa/orders/draft-online-without-login",
7708
- params: {
7709
- shopId: shopId
7710
- },
7711
- data: data,
7712
- headers: {
7713
- shopId: shopId
7747
+
7748
+ var Dash = function Dash(props) {
7749
+ var _props$color = props.color,
7750
+ color = _props$color === void 0 ? "#ccc" : _props$color,
7751
+ _props$className = props.className,
7752
+ className = _props$className === void 0 ? "" : _props$className;
7753
+ return /*#__PURE__*/React__default.createElement("div", {
7754
+ className: "mx-auto w-full max-w-[240px] md:max-w-[720px] border-b-0 " + className,
7755
+ style: {
7756
+ backgroundImage: "repeating-linear-gradient(to right, " + color + " 0, " + color + " 10px, transparent 10px, transparent 20px)",
7757
+ height: "1px"
7714
7758
  }
7715
7759
  });
7716
7760
  };
7717
7761
 
7718
- var _excluded$1 = ["productName"];
7719
- var BookingController = function BookingController(props) {
7720
- _objectDestructuringEmpty(props);
7721
- var createSchedule = function createSchedule(customerName, customerPhone, scheduleDate, services, shopId) {
7722
- try {
7723
- return Promise.resolve(_catch(function () {
7724
- var _Date;
7725
- var data = {
7726
- appId: "SSPA",
7727
- customerName: customerName,
7728
- customerPhone: customerPhone === null || customerPhone === void 0 ? void 0 : customerPhone.replace("+", ""),
7729
- isSellService: true,
7730
- scheduleDate: (_Date = new Date(scheduleDate)) === null || _Date === void 0 ? void 0 : _Date.getTime(),
7731
- services: services === null || services === void 0 ? void 0 : services.map(function (_ref) {
7732
- var productName = _ref.productName,
7733
- rest = _objectWithoutPropertiesLoose(_ref, _excluded$1);
7734
- return rest;
7735
- }),
7736
- shopId: shopId
7737
- };
7738
- return Promise.resolve(createSpaScheduleApi(shopId, data));
7739
- }, function (e) {
7740
- console.log(e);
7741
- }));
7742
- } catch (e) {
7743
- return Promise.reject(e);
7762
+ var Loading = function Loading(props) {
7763
+ var _props$size = props.size,
7764
+ size = _props$size === void 0 ? 24 : _props$size;
7765
+ return /*#__PURE__*/React__default.createElement("div", {
7766
+ className: "border-4 boder-[rgba(255, 255, 255, 0.2)] rounded-full border-t-4 border-t-primary animate-spin",
7767
+ style: {
7768
+ width: size,
7769
+ height: size
7744
7770
  }
7745
- };
7746
- return {
7747
- createSchedule: createSchedule
7748
- };
7771
+ });
7749
7772
  };
7750
7773
 
7751
- var Select = React.forwardRef(function (props, ref) {
7752
- var _props$label = props.label,
7753
- label = _props$label === void 0 ? "" : _props$label,
7754
- _props$labelClassName = props.labelClassName,
7755
- labelClassName = _props$labelClassName === void 0 ? "" : _props$labelClassName,
7756
- _props$placeholder = props.placeholder,
7757
- placeholder = _props$placeholder === void 0 ? "" : _props$placeholder,
7758
- _props$className = props.className,
7759
- className = _props$className === void 0 ? "" : _props$className,
7760
- _props$optionClassNam = props.optionClassName,
7761
- optionClassName = _props$optionClassNam === void 0 ? "" : _props$optionClassNam,
7762
- _props$wrapClassName = props.wrapClassName,
7763
- wrapClassName = _props$wrapClassName === void 0 ? "" : _props$wrapClassName,
7764
- _props$selectClassNam = props.selectClassName,
7765
- selectClassName = _props$selectClassNam === void 0 ? "" : _props$selectClassNam,
7766
- _props$rules = props.rules,
7767
- rules = _props$rules === void 0 ? [] : _props$rules,
7768
- options = props.options,
7769
- _props$defaultValue = props.defaultValue,
7770
- defaultValue = _props$defaultValue === void 0 ? {} : _props$defaultValue,
7771
- handleSearchOption = props.handleSearchOption,
7772
- _props$isMulti = props.isMulti,
7773
- isMulti = _props$isMulti === void 0 ? false : _props$isMulti,
7774
- _props$onClick = props.onClick,
7775
- onClick = _props$onClick === void 0 ? function () {} : _props$onClick,
7776
- _props$isButtonDelete = props.isButtonDelete,
7777
- isButtonDelete = _props$isButtonDelete === void 0 ? false : _props$isButtonDelete,
7778
- _props$funcDelete = props.funcDelete,
7779
- funcDelete = _props$funcDelete === void 0 ? function () {} : _props$funcDelete,
7780
- _props$isSearch = props.isSearch,
7781
- isSearch = _props$isSearch === void 0 ? true : _props$isSearch,
7782
- renderItem = props.renderItem;
7783
- var _useState = React.useState(false),
7784
- isOpen = _useState[0],
7785
- setIsOpen = _useState[1];
7786
- var selectRef = React.useRef(null);
7787
- var _useState2 = React.useState(""),
7788
- error = _useState2[0],
7789
- _setError = _useState2[1];
7790
- var _useState3 = React.useState(""),
7791
- inputSearch = _useState3[0],
7792
- setInputSearch = _useState3[1];
7793
- var _useState4 = React.useState(defaultValue),
7794
- value = _useState4[0],
7795
- setValue = _useState4[1];
7796
- var _useState5 = React.useState(options),
7797
- listOptions = _useState5[0],
7798
- setListOptions = _useState5[1];
7799
- var dropdownRef = React.useRef(null);
7800
- var _useState6 = React.useState('bottom'),
7801
- dropdownPosition = _useState6[0],
7802
- setDropdownPosition = _useState6[1];
7803
- var inputRef = React.useRef(null);
7804
- React.useEffect(function () {
7805
- if (isMulti) setValue(defaultValue);
7806
- }, [defaultValue]);
7807
- React.useEffect(function () {
7808
- setListOptions(options);
7809
- if (!isMulti) setValue(defaultValue);
7810
- }, [options]);
7811
- React.useEffect(function () {
7812
- var _inputRef$current;
7813
- inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.focus();
7814
- var updateDropdownPosition = function updateDropdownPosition() {
7815
- if (selectRef.current && dropdownRef.current) {
7816
- var _selectRef$current, _window;
7817
- var selectRect = selectRef === null || selectRef === void 0 ? void 0 : (_selectRef$current = selectRef.current) === null || _selectRef$current === void 0 ? void 0 : _selectRef$current.getBoundingClientRect();
7818
- var spaceBelow = ((_window = window) === null || _window === void 0 ? void 0 : _window.innerHeight) - (selectRect === null || selectRect === void 0 ? void 0 : selectRect.bottom);
7819
- var spaceAbove = selectRect === null || selectRect === void 0 ? void 0 : selectRect.top;
7820
- if (spaceBelow < spaceAbove) {
7821
- setDropdownPosition('top');
7822
- } else {
7823
- setDropdownPosition('bottom');
7774
+ var TreatmentsCategory7 = function TreatmentsCategory7(props) {
7775
+ var _props$shopConfigStyl = props.shopConfigStyle,
7776
+ shopConfigStyle = _props$shopConfigStyl === void 0 ? {} : _props$shopConfigStyl,
7777
+ _props$data = props.data,
7778
+ data = _props$data === void 0 ? {} : _props$data,
7779
+ _props$SectionTitle = props.SectionTitle,
7780
+ SectionTitle = _props$SectionTitle === void 0 ? null : _props$SectionTitle;
7781
+ var _shopConfigStyle$colo = shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : shopConfigStyle.color,
7782
+ _shopConfigStyle$colo2 = _shopConfigStyle$colo.secondary,
7783
+ secondary = _shopConfigStyle$colo2 === void 0 ? "#000" : _shopConfigStyle$colo2;
7784
+ var _useState = React.useState({
7785
+ types: "1"
7786
+ }),
7787
+ params = _useState[0],
7788
+ setParams = _useState[1];
7789
+ var _CategoryController = CategoryController(_extends({}, props, {
7790
+ types: "1"
7791
+ })),
7792
+ categories = _CategoryController.categories;
7793
+ var _ProductController = ProductController(_extends({}, props, {
7794
+ params: params
7795
+ })),
7796
+ _ProductController$pr = _ProductController.products,
7797
+ products = _ProductController$pr === void 0 ? [] : _ProductController$pr,
7798
+ loading = _ProductController.loading;
7799
+ var _useState2 = React.useState(0),
7800
+ selectedCategory = _useState2[0],
7801
+ setSelectedCategory = _useState2[1];
7802
+ React.useEffect(function () {
7803
+ var newParams = _extends({}, params, {
7804
+ categoryId: selectedCategory
7805
+ });
7806
+ if (!selectedCategory) {
7807
+ delete newParams.categoryId;
7808
+ }
7809
+ setParams(newParams);
7810
+ }, [selectedCategory]);
7811
+ return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
7812
+ className: SECTION_DEFAULT_CLASS + " relative"
7813
+ }, /*#__PURE__*/React__default.createElement(SectionTitle, {
7814
+ data: data,
7815
+ shopConfigStyle: shopConfigStyle
7816
+ }), /*#__PURE__*/React__default.createElement(ScrollHorizontal, {
7817
+ datas: [{
7818
+ categoryId: 0,
7819
+ cateName: "Tất cả"
7820
+ }].concat(categories),
7821
+ className: "mt-6 rounded-lg overflow-hidden bg-bgSecondary",
7822
+ renderItem: function renderItem(item, index) {
7823
+ return /*#__PURE__*/React__default.createElement("div", {
7824
+ key: index,
7825
+ className: "p-3 flex gap-3 shrink-0 cursor-pointer text-base " + (selectedCategory === item.categoryId ? "bg-primary text-textButton" : ""),
7826
+ onClick: function onClick() {
7827
+ return setSelectedCategory(item.categoryId);
7824
7828
  }
7825
- }
7826
- };
7827
- if (isOpen) {
7828
- updateDropdownPosition();
7829
- window.addEventListener('resize', updateDropdownPosition);
7829
+ }, item === null || item === void 0 ? void 0 : item.cateName);
7830
7830
  }
7831
- return function () {
7832
- window.removeEventListener('resize', updateDropdownPosition);
7833
- };
7834
- }, [isOpen]);
7831
+ }), loading ? /*#__PURE__*/React__default.createElement("div", {
7832
+ className: "flex w-full justify-center p-12"
7833
+ }, /*#__PURE__*/React__default.createElement(Loading, null)) : products !== null && products !== void 0 && products.length ? /*#__PURE__*/React__default.createElement("div", {
7834
+ className: "grid grid-cols-1 md:grid-cols-2 gap-10 mt-6"
7835
+ }, products === null || products === void 0 ? void 0 : products.map(function (product, index) {
7836
+ return /*#__PURE__*/React__default.createElement(ProductItem1, {
7837
+ key: index,
7838
+ product: product === null || product === void 0 ? void 0 : product.productInfo
7839
+ });
7840
+ })) : /*#__PURE__*/React__default.createElement("div", {
7841
+ className: "text-gray3 text-center p-12"
7842
+ }, "Kh\xF4ng c\xF3 d\u1ECBch v\u1EE5")), /*#__PURE__*/React__default.createElement(Dash, {
7843
+ color: secondary
7844
+ }));
7845
+ };
7846
+
7847
+ var NotFoundProduct = function NotFoundProduct() {
7848
+ return /*#__PURE__*/React__default.createElement("div", {
7849
+ className: "h-60 flex flex-col justify-center items-center text-xl text-gray3"
7850
+ }, /*#__PURE__*/React__default.createElement(fa.FaBoxOpen, {
7851
+ size: 80
7852
+ }), /*#__PURE__*/React__default.createElement("div", null, "Kh\xF4ng c\xF3 s\u1EA3n ph\u1EA9m"));
7853
+ };
7854
+
7855
+ var TreatmentsList6 = function TreatmentsList6(props) {
7856
+ var _products$slice;
7857
+ var data = props.data,
7858
+ _props$Link = props.Link,
7859
+ Link = _props$Link === void 0 ? null : _props$Link,
7860
+ _props$SectionTitle = props.SectionTitle,
7861
+ SectionTitle = _props$SectionTitle === void 0 ? null : _props$SectionTitle,
7862
+ _props$TreatmentItem = props.TreatmentItem,
7863
+ TreatmentItem = _props$TreatmentItem === void 0 ? null : _props$TreatmentItem,
7864
+ _props$shopConfigStyl = props.shopConfigStyle,
7865
+ shopConfigStyle = _props$shopConfigStyl === void 0 ? {} : _props$shopConfigStyl;
7866
+ var _useState = React.useState({
7867
+ size: 12,
7868
+ types: "1"
7869
+ }),
7870
+ params = _useState[0],
7871
+ setParams = _useState[1];
7872
+ var _useState2 = React.useState(true),
7873
+ isGetMore = _useState2[0],
7874
+ setIsGetMore = _useState2[1];
7875
+ var _ProductController = ProductController(_extends({}, props, {
7876
+ params: params
7877
+ })),
7878
+ products = _ProductController.products,
7879
+ loading = _ProductController.loading;
7880
+ var handleGetMoreProducts = function handleGetMoreProducts() {
7881
+ setIsGetMore(false);
7882
+ setParams(function (prev) {
7883
+ return _extends({}, prev, {
7884
+ size: (prev === null || prev === void 0 ? void 0 : prev.size) + 4
7885
+ });
7886
+ });
7887
+ };
7888
+ return /*#__PURE__*/React__default.createElement("div", {
7889
+ className: SECTION_CLASS + " flex flex-col gap-8 "
7890
+ }, /*#__PURE__*/React__default.createElement(SectionTitle, {
7891
+ data: data,
7892
+ shopConfigStyle: shopConfigStyle
7893
+ }), loading && isGetMore ? /*#__PURE__*/React__default.createElement("div", {
7894
+ className: "m-auto mt-20 min-h-32"
7895
+ }, /*#__PURE__*/React__default.createElement(Loading, null)) : (products === null || products === void 0 ? void 0 : products.length) > 0 ? /*#__PURE__*/React__default.createElement("div", {
7896
+ className: "grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-x-2 gap-y-4 md:gap-4 xl:gap-6"
7897
+ }, products === null || products === void 0 ? void 0 : (_products$slice = products.slice(0, params.size - 4)) === null || _products$slice === void 0 ? void 0 : _products$slice.map(function (product, idx) {
7898
+ return /*#__PURE__*/React__default.createElement(TreatmentItem, {
7899
+ Link: Link,
7900
+ shopConfigStyle: shopConfigStyle,
7901
+ product: product === null || product === void 0 ? void 0 : product.productInfo,
7902
+ key: "htrhr-" + idx
7903
+ });
7904
+ })) : /*#__PURE__*/React__default.createElement(NotFoundProduct, null), !loading && (products === null || products === void 0 ? void 0 : products.length) > (params === null || params === void 0 ? void 0 : params.size) - 4 ? /*#__PURE__*/React__default.createElement(Button, {
7905
+ label: "Xem thêm",
7906
+ onClick: handleGetMoreProducts,
7907
+ className: "mx-auto " + (shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : shopConfigStyle.buttonClass),
7908
+ type: "outline"
7909
+ }) : null);
7910
+ };
7911
+
7912
+ var ModalNotification = function ModalNotification(props) {
7913
+ var modalRef = React.useRef(null);
7914
+ var onClose = props.onClose,
7915
+ onCloseFormBooking = props.onCloseFormBooking,
7916
+ _props$isButtonClose = props.isButtonClose,
7917
+ isButtonClose = _props$isButtonClose === void 0 ? true : _props$isButtonClose;
7835
7918
  var handleClickOutside = function handleClickOutside(event) {
7836
- var _selectRef$current2;
7837
- if (selectRef !== null && selectRef !== void 0 && selectRef.current && !(selectRef !== null && selectRef !== void 0 && (_selectRef$current2 = selectRef.current) !== null && _selectRef$current2 !== void 0 && _selectRef$current2.contains(event.target))) {
7838
- setIsOpen(false);
7839
- setInputSearch("");
7840
- setListOptions(options);
7919
+ if (modalRef.current && !modalRef.current.contains(event.target)) {
7920
+ if (onClose) onClose();
7921
+ if (onCloseFormBooking && typeof onCloseFormBooking === 'function') {
7922
+ onCloseFormBooking();
7923
+ }
7841
7924
  }
7842
7925
  };
7843
7926
  React.useEffect(function () {
@@ -7846,42 +7929,257 @@ var Select = React.forwardRef(function (props, ref) {
7846
7929
  document.removeEventListener('click', handleClickOutside);
7847
7930
  };
7848
7931
  }, []);
7849
- React.useImperativeHandle(ref, function () {
7850
- return {
7851
- validateData: function validateData() {
7852
- return _validateData();
7853
- },
7854
- setError: function setError(err) {
7855
- return _setError(err);
7856
- }
7857
- };
7932
+ return /*#__PURE__*/React__default.createElement("div", {
7933
+ className: "fixed inset-0 bg-black flex items-center justify-center bg-opacity-50 z-50 "
7934
+ }, /*#__PURE__*/React__default.createElement("div", {
7935
+ className: " flex items-center justify-center relative bg-red",
7936
+ ref: modalRef
7937
+ }, props === null || props === void 0 ? void 0 : props.children, isButtonClose && /*#__PURE__*/React__default.createElement("button", {
7938
+ className: "absolute top-4 right-4",
7939
+ onClick: onClose
7940
+ }, /*#__PURE__*/React__default.createElement(rx.RxCross2, null))));
7941
+ };
7942
+
7943
+ var getEmployeeListApi = function getEmployeeListApi(shopId) {
7944
+ return api({
7945
+ method: "get",
7946
+ url: "/chain-employment-profile/filter-employ-by-customer",
7947
+ params: {
7948
+ shopIds: shopId
7949
+ },
7950
+ headers: {
7951
+ shopId: shopId
7952
+ }
7858
7953
  });
7859
- var isEmpty = function isEmpty(value) {
7860
- var _Object$keys;
7861
- if (Array !== null && Array !== void 0 && Array.isArray(value)) return (value === null || value === void 0 ? void 0 : value.length) <= 0;
7862
- if (typeof value === 'object') return (Object === null || Object === void 0 ? void 0 : (_Object$keys = Object.keys(value)) === null || _Object$keys === void 0 ? void 0 : _Object$keys.length) <= 0;
7863
- return false;
7864
- };
7865
- var _validateData = function _validateData() {
7866
- var count = 0;
7867
- for (var _iterator = _createForOfIteratorHelperLoose(rules), _step; !(_step = _iterator()).done;) {
7868
- var _e$pattern;
7869
- var e = _step.value;
7870
- if ((e === null || e === void 0 ? void 0 : e.type) === 'required' && isEmpty(value)) {
7871
- _setError(e === null || e === void 0 ? void 0 : e.message);
7872
- count++;
7873
- break;
7874
- } else if ((e === null || e === void 0 ? void 0 : e.type) === 'pattern' && !(e !== null && e !== void 0 && (_e$pattern = e.pattern) !== null && _e$pattern !== void 0 && _e$pattern.test(value))) {
7875
- _setError(e === null || e === void 0 ? void 0 : e.message);
7876
- count++;
7877
- break;
7878
- }
7954
+ };
7955
+
7956
+ var EmployeeController = function EmployeeController(props) {
7957
+ var _props$isAutoGetList = props.isAutoGetList,
7958
+ isAutoGetList = _props$isAutoGetList === void 0 ? true : _props$isAutoGetList,
7959
+ shopConfig = props.shopConfig;
7960
+ var _useState = React.useState([]),
7961
+ listEmployment = _useState[0],
7962
+ setListEmployment = _useState[1];
7963
+ React.useEffect(function () {
7964
+ if (isAutoGetList) {
7965
+ getListEmployee();
7879
7966
  }
7880
- if (count) {
7881
- return false;
7882
- } else {
7883
- _setError('');
7884
- return true;
7967
+ }, [isAutoGetList]);
7968
+ var getListEmployee = function getListEmployee() {
7969
+ try {
7970
+ return Promise.resolve(_catch(function () {
7971
+ return Promise.resolve(getEmployeeListApi(shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopId)).then(function (res) {
7972
+ var _res$data, _res$data$status;
7973
+ if ((res === null || res === void 0 ? void 0 : (_res$data = res.data) === null || _res$data === void 0 ? void 0 : (_res$data$status = _res$data.status) === null || _res$data$status === void 0 ? void 0 : _res$data$status.code) == 200) {
7974
+ var _res$data2;
7975
+ setListEmployment((res === null || res === void 0 ? void 0 : (_res$data2 = res.data) === null || _res$data2 === void 0 ? void 0 : _res$data2.data) || []);
7976
+ }
7977
+ return res;
7978
+ });
7979
+ }, function (e) {
7980
+ console.log(e);
7981
+ }));
7982
+ } catch (e) {
7983
+ return Promise.reject(e);
7984
+ }
7985
+ };
7986
+ return {
7987
+ listEmployment: listEmployment,
7988
+ getListEmployee: getListEmployee
7989
+ };
7990
+ };
7991
+
7992
+ var createSpaScheduleApi = function createSpaScheduleApi(shopId, data) {
7993
+ return api({
7994
+ method: "post",
7995
+ url: "/spa-schedule/customer/create",
7996
+ data: data,
7997
+ headers: {
7998
+ shopId: shopId
7999
+ }
8000
+ });
8001
+ };
8002
+ var draftOrderWithoutLoginApi = function draftOrderWithoutLoginApi(shopId, data) {
8003
+ return api({
8004
+ method: "post",
8005
+ url: "/spa/orders/draft-online-without-login",
8006
+ params: {
8007
+ shopId: shopId
8008
+ },
8009
+ data: data,
8010
+ headers: {
8011
+ shopId: shopId
8012
+ }
8013
+ });
8014
+ };
8015
+
8016
+ var _excluded$1 = ["productName"];
8017
+ var BookingController = function BookingController(props) {
8018
+ _objectDestructuringEmpty(props);
8019
+ var createSchedule = function createSchedule(customerName, customerPhone, scheduleDate, services, shopId) {
8020
+ try {
8021
+ return Promise.resolve(_catch(function () {
8022
+ var _Date;
8023
+ var data = {
8024
+ appId: "SSPA",
8025
+ customerName: customerName,
8026
+ customerPhone: customerPhone === null || customerPhone === void 0 ? void 0 : customerPhone.replace("+", ""),
8027
+ isSellService: true,
8028
+ scheduleDate: (_Date = new Date(scheduleDate)) === null || _Date === void 0 ? void 0 : _Date.getTime(),
8029
+ services: services === null || services === void 0 ? void 0 : services.map(function (_ref) {
8030
+ var productName = _ref.productName,
8031
+ rest = _objectWithoutPropertiesLoose(_ref, _excluded$1);
8032
+ return rest;
8033
+ }),
8034
+ shopId: shopId
8035
+ };
8036
+ return Promise.resolve(createSpaScheduleApi(shopId, data));
8037
+ }, function (e) {
8038
+ console.log(e);
8039
+ }));
8040
+ } catch (e) {
8041
+ return Promise.reject(e);
8042
+ }
8043
+ };
8044
+ return {
8045
+ createSchedule: createSchedule
8046
+ };
8047
+ };
8048
+
8049
+ var Select = React.forwardRef(function (props, ref) {
8050
+ var _props$label = props.label,
8051
+ label = _props$label === void 0 ? "" : _props$label,
8052
+ _props$labelClassName = props.labelClassName,
8053
+ labelClassName = _props$labelClassName === void 0 ? "" : _props$labelClassName,
8054
+ _props$placeholder = props.placeholder,
8055
+ placeholder = _props$placeholder === void 0 ? "" : _props$placeholder,
8056
+ _props$className = props.className,
8057
+ className = _props$className === void 0 ? "" : _props$className,
8058
+ _props$optionClassNam = props.optionClassName,
8059
+ optionClassName = _props$optionClassNam === void 0 ? "" : _props$optionClassNam,
8060
+ _props$wrapClassName = props.wrapClassName,
8061
+ wrapClassName = _props$wrapClassName === void 0 ? "" : _props$wrapClassName,
8062
+ _props$selectClassNam = props.selectClassName,
8063
+ selectClassName = _props$selectClassNam === void 0 ? "" : _props$selectClassNam,
8064
+ _props$rules = props.rules,
8065
+ rules = _props$rules === void 0 ? [] : _props$rules,
8066
+ options = props.options,
8067
+ _props$defaultValue = props.defaultValue,
8068
+ defaultValue = _props$defaultValue === void 0 ? {} : _props$defaultValue,
8069
+ handleSearchOption = props.handleSearchOption,
8070
+ _props$isMulti = props.isMulti,
8071
+ isMulti = _props$isMulti === void 0 ? false : _props$isMulti,
8072
+ _props$onClick = props.onClick,
8073
+ onClick = _props$onClick === void 0 ? function () {} : _props$onClick,
8074
+ _props$isButtonDelete = props.isButtonDelete,
8075
+ isButtonDelete = _props$isButtonDelete === void 0 ? false : _props$isButtonDelete,
8076
+ _props$funcDelete = props.funcDelete,
8077
+ funcDelete = _props$funcDelete === void 0 ? function () {} : _props$funcDelete,
8078
+ _props$isSearch = props.isSearch,
8079
+ isSearch = _props$isSearch === void 0 ? true : _props$isSearch,
8080
+ renderItem = props.renderItem;
8081
+ var _useState = React.useState(false),
8082
+ isOpen = _useState[0],
8083
+ setIsOpen = _useState[1];
8084
+ var selectRef = React.useRef(null);
8085
+ var _useState2 = React.useState(""),
8086
+ error = _useState2[0],
8087
+ _setError = _useState2[1];
8088
+ var _useState3 = React.useState(""),
8089
+ inputSearch = _useState3[0],
8090
+ setInputSearch = _useState3[1];
8091
+ var _useState4 = React.useState(defaultValue),
8092
+ value = _useState4[0],
8093
+ setValue = _useState4[1];
8094
+ var _useState5 = React.useState(options),
8095
+ listOptions = _useState5[0],
8096
+ setListOptions = _useState5[1];
8097
+ var dropdownRef = React.useRef(null);
8098
+ var _useState6 = React.useState('bottom'),
8099
+ dropdownPosition = _useState6[0],
8100
+ setDropdownPosition = _useState6[1];
8101
+ var inputRef = React.useRef(null);
8102
+ React.useEffect(function () {
8103
+ if (isMulti) setValue(defaultValue);
8104
+ }, [defaultValue]);
8105
+ React.useEffect(function () {
8106
+ setListOptions(options);
8107
+ if (!isMulti) setValue(defaultValue);
8108
+ }, [options]);
8109
+ React.useEffect(function () {
8110
+ var _inputRef$current;
8111
+ inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.focus();
8112
+ var updateDropdownPosition = function updateDropdownPosition() {
8113
+ if (selectRef.current && dropdownRef.current) {
8114
+ var _selectRef$current, _window;
8115
+ var selectRect = selectRef === null || selectRef === void 0 ? void 0 : (_selectRef$current = selectRef.current) === null || _selectRef$current === void 0 ? void 0 : _selectRef$current.getBoundingClientRect();
8116
+ var spaceBelow = ((_window = window) === null || _window === void 0 ? void 0 : _window.innerHeight) - (selectRect === null || selectRect === void 0 ? void 0 : selectRect.bottom);
8117
+ var spaceAbove = selectRect === null || selectRect === void 0 ? void 0 : selectRect.top;
8118
+ if (spaceBelow < spaceAbove) {
8119
+ setDropdownPosition('top');
8120
+ } else {
8121
+ setDropdownPosition('bottom');
8122
+ }
8123
+ }
8124
+ };
8125
+ if (isOpen) {
8126
+ updateDropdownPosition();
8127
+ window.addEventListener('resize', updateDropdownPosition);
8128
+ }
8129
+ return function () {
8130
+ window.removeEventListener('resize', updateDropdownPosition);
8131
+ };
8132
+ }, [isOpen]);
8133
+ var handleClickOutside = function handleClickOutside(event) {
8134
+ var _selectRef$current2;
8135
+ if (selectRef !== null && selectRef !== void 0 && selectRef.current && !(selectRef !== null && selectRef !== void 0 && (_selectRef$current2 = selectRef.current) !== null && _selectRef$current2 !== void 0 && _selectRef$current2.contains(event.target))) {
8136
+ setIsOpen(false);
8137
+ setInputSearch("");
8138
+ setListOptions(options);
8139
+ }
8140
+ };
8141
+ React.useEffect(function () {
8142
+ document.addEventListener('click', handleClickOutside);
8143
+ return function () {
8144
+ document.removeEventListener('click', handleClickOutside);
8145
+ };
8146
+ }, []);
8147
+ React.useImperativeHandle(ref, function () {
8148
+ return {
8149
+ validateData: function validateData() {
8150
+ return _validateData();
8151
+ },
8152
+ setError: function setError(err) {
8153
+ return _setError(err);
8154
+ }
8155
+ };
8156
+ });
8157
+ var isEmpty = function isEmpty(value) {
8158
+ var _Object$keys;
8159
+ if (Array !== null && Array !== void 0 && Array.isArray(value)) return (value === null || value === void 0 ? void 0 : value.length) <= 0;
8160
+ if (typeof value === 'object') return (Object === null || Object === void 0 ? void 0 : (_Object$keys = Object.keys(value)) === null || _Object$keys === void 0 ? void 0 : _Object$keys.length) <= 0;
8161
+ return false;
8162
+ };
8163
+ var _validateData = function _validateData() {
8164
+ var count = 0;
8165
+ for (var _iterator = _createForOfIteratorHelperLoose(rules), _step; !(_step = _iterator()).done;) {
8166
+ var _e$pattern;
8167
+ var e = _step.value;
8168
+ if ((e === null || e === void 0 ? void 0 : e.type) === 'required' && isEmpty(value)) {
8169
+ _setError(e === null || e === void 0 ? void 0 : e.message);
8170
+ count++;
8171
+ break;
8172
+ } else if ((e === null || e === void 0 ? void 0 : e.type) === 'pattern' && !(e !== null && e !== void 0 && (_e$pattern = e.pattern) !== null && _e$pattern !== void 0 && _e$pattern.test(value))) {
8173
+ _setError(e === null || e === void 0 ? void 0 : e.message);
8174
+ count++;
8175
+ break;
8176
+ }
8177
+ }
8178
+ if (count) {
8179
+ return false;
8180
+ } else {
8181
+ _setError('');
8182
+ return true;
7885
8183
  }
7886
8184
  };
7887
8185
  var handleSearch = function handleSearch(e) {
@@ -8228,19 +8526,6 @@ var InputPhoneNumber = React.forwardRef(function (props, ref) {
8228
8526
  }, error) : null);
8229
8527
  });
8230
8528
 
8231
- var formatCurrency = function formatCurrency(amount) {
8232
- if (isNaN(amount)) {
8233
- return '0 ₫';
8234
- }
8235
- var roundedAmount = Math.round(amount);
8236
- var formattedAmount = roundedAmount.toString().replace(/\B(?=(\d{3})+(?!\d))/g, '.');
8237
- return formattedAmount + " \u20AB";
8238
- };
8239
- var pattern = {
8240
- phoneNumberPattern: /^(?:\+84|0)\d{9}$/
8241
- };
8242
- var numberPattern = /^\d+$/;
8243
-
8244
8529
  var dayjs_min = createCommonjsModule(function (module, exports) {
8245
8530
  !function(t,e){module.exports=e();}(commonjsGlobal,(function(){var t=1e3,e=6e4,n=36e5,r="millisecond",i="second",s="minute",u="hour",a="day",o="week",c="month",f="quarter",h="year",d="date",l="Invalid Date",$=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],n=t%100;return "["+t+(e[(n-20)%10]||e[n]||e[0])+"]"}},m=function(t,e,n){var r=String(t);return !r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},v={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return (e<=0?"+":"-")+m(r,2,"0")+":"+m(i,2,"0")},m:function t(e,n){if(e.date()<n.date())return -t(n,e);var r=12*(n.year()-e.year())+(n.month()-e.month()),i=e.clone().add(r,c),s=n-i<0,u=e.clone().add(r+(s?-1:1),c);return +(-(r+(n-i)/(s?i-u:u-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return {M:c,y:h,w:o,d:a,D:d,h:u,m:s,s:i,ms:r,Q:f}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},g="en",D={};D[g]=M;var p="$isDayjsObject",S=function(t){return t instanceof _||!(!t||!t[p])},w=function t(e,n,r){var i;if(!e)return g;if("string"==typeof e){var s=e.toLowerCase();D[s]&&(i=s),n&&(D[s]=n,i=s);var u=e.split("-");if(!i&&u.length>1)return t(u[0])}else {var a=e.name;D[a]=e,i=a;}return !r&&i&&(g=i),i||!r&&g},O=function(t,e){if(S(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new _(n)},b=v;b.l=w,b.i=S,b.w=function(t,e){return O(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var _=function(){function M(t){this.$L=w(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[p]=!0;}var m=M.prototype;return m.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(b.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match($);if(r){var i=r[2]-1||0,s=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(e)}(t),this.init();},m.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds();},m.$utils=function(){return b},m.isValid=function(){return !(this.$d.toString()===l)},m.isSame=function(t,e){var n=O(t);return this.startOf(e)<=n&&n<=this.endOf(e)},m.isAfter=function(t,e){return O(t)<this.startOf(e)},m.isBefore=function(t,e){return this.endOf(e)<O(t)},m.$g=function(t,e,n){return b.u(t)?this[e]:this.set(n,t)},m.unix=function(){return Math.floor(this.valueOf()/1e3)},m.valueOf=function(){return this.$d.getTime()},m.startOf=function(t,e){var n=this,r=!!b.u(e)||e,f=b.p(t),l=function(t,e){var i=b.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return r?i:i.endOf(a)},$=function(t,e){return b.w(n.toDate()[t].apply(n.toDate("s"),(r?[0,0,0,0]:[23,59,59,999]).slice(e)),n)},y=this.$W,M=this.$M,m=this.$D,v="set"+(this.$u?"UTC":"");switch(f){case h:return r?l(1,0):l(31,11);case c:return r?l(1,M):l(0,M+1);case o:var g=this.$locale().weekStart||0,D=(y<g?y+7:y)-g;return l(r?m-D:m+(6-D),M);case a:case d:return $(v+"Hours",0);case u:return $(v+"Minutes",1);case s:return $(v+"Seconds",2);case i:return $(v+"Milliseconds",3);default:return this.clone()}},m.endOf=function(t){return this.startOf(t,!1)},m.$set=function(t,e){var n,o=b.p(t),f="set"+(this.$u?"UTC":""),l=(n={},n[a]=f+"Date",n[d]=f+"Date",n[c]=f+"Month",n[h]=f+"FullYear",n[u]=f+"Hours",n[s]=f+"Minutes",n[i]=f+"Seconds",n[r]=f+"Milliseconds",n)[o],$=o===a?this.$D+(e-this.$W):e;if(o===c||o===h){var y=this.clone().set(d,1);y.$d[l]($),y.init(),this.$d=y.set(d,Math.min(this.$D,y.daysInMonth())).$d;}else l&&this.$d[l]($);return this.init(),this},m.set=function(t,e){return this.clone().$set(t,e)},m.get=function(t){return this[b.p(t)]()},m.add=function(r,f){var d,l=this;r=Number(r);var $=b.p(f),y=function(t){var e=O(l);return b.w(e.date(e.date()+Math.round(t*r)),l)};if($===c)return this.set(c,this.$M+r);if($===h)return this.set(h,this.$y+r);if($===a)return y(1);if($===o)return y(7);var M=(d={},d[s]=e,d[u]=n,d[i]=t,d)[$]||1,m=this.$d.getTime()+r*M;return b.w(m,this)},m.subtract=function(t,e){return this.add(-1*t,e)},m.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return n.invalidDate||l;var r=t||"YYYY-MM-DDTHH:mm:ssZ",i=b.z(this),s=this.$H,u=this.$m,a=this.$M,o=n.weekdays,c=n.months,f=n.meridiem,h=function(t,n,i,s){return t&&(t[n]||t(e,r))||i[n].slice(0,s)},d=function(t){return b.s(s%12||12,t,"0")},$=f||function(t,e,n){var r=t<12?"AM":"PM";return n?r.toLowerCase():r};return r.replace(y,(function(t,r){return r||function(t){switch(t){case"YY":return String(e.$y).slice(-2);case"YYYY":return b.s(e.$y,4,"0");case"M":return a+1;case"MM":return b.s(a+1,2,"0");case"MMM":return h(n.monthsShort,a,c,3);case"MMMM":return h(c,a);case"D":return e.$D;case"DD":return b.s(e.$D,2,"0");case"d":return String(e.$W);case"dd":return h(n.weekdaysMin,e.$W,o,2);case"ddd":return h(n.weekdaysShort,e.$W,o,3);case"dddd":return o[e.$W];case"H":return String(s);case"HH":return b.s(s,2,"0");case"h":return d(1);case"hh":return d(2);case"a":return $(s,u,!0);case"A":return $(s,u,!1);case"m":return String(u);case"mm":return b.s(u,2,"0");case"s":return String(e.$s);case"ss":return b.s(e.$s,2,"0");case"SSS":return b.s(e.$ms,3,"0");case"Z":return i}return null}(t)||i.replace(":","")}))},m.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},m.diff=function(r,d,l){var $,y=this,M=b.p(d),m=O(r),v=(m.utcOffset()-this.utcOffset())*e,g=this-m,D=function(){return b.m(y,m)};switch(M){case h:$=D()/12;break;case c:$=D();break;case f:$=D()/3;break;case o:$=(g-v)/6048e5;break;case a:$=(g-v)/864e5;break;case u:$=g/n;break;case s:$=g/e;break;case i:$=g/t;break;default:$=g;}return l?$:b.a($)},m.daysInMonth=function(){return this.endOf(c).$D},m.$locale=function(){return D[this.$L]},m.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),r=w(t,e,!0);return r&&(n.$L=r),n},m.clone=function(){return b.w(this.$d,this)},m.toDate=function(){return new Date(this.valueOf())},m.toJSON=function(){return this.isValid()?this.toISOString():null},m.toISOString=function(){return this.$d.toISOString()},m.toString=function(){return this.$d.toUTCString()},M}(),k=_.prototype;return O.prototype=k,[["$ms",r],["$s",i],["$m",s],["$H",u],["$W",a],["$M",c],["$y",h],["$D",d]].forEach((function(t){k[t[1]]=function(e){return this.$g(e,t[0],t[1])};})),O.extend=function(t,e){return t.$i||(t(e,_,O),t.$i=!0),O},O.locale=w,O.isDayjs=S,O.unix=function(t){return O(1e3*t)},O.en=D[g],O.Ls=D,O.p={},O}));
8246
8531
  });
@@ -8724,465 +9009,142 @@ var BookingForm = function BookingForm(props) {
8724
9009
  className: "mb-4 text-center"
8725
9010
  }, "B\u1EA1n \u0111\xE3 c\xF3 t\xE0i kho\u1EA3n, vui l\xF2ng \u0111\u0103ng nh\u1EADp \u0111\u1EC3 xem chi ti\u1EBFt c\xE1c s\u1EA3n ph\u1EA9m, d\u1ECBch v\u1EE5 li\u1EC7u tr\xECnh m\xE0 b\u1EA1n \u0111ang s\u1EDF h\u1EEFu"), /*#__PURE__*/React__default.createElement(Button, {
8726
9011
  label: "Đăng nhập",
8727
- shopConfigStyle: shopConfigStyle
8728
- })))));
8729
- };
8730
-
8731
- var Treatments1 = function Treatments1(props) {
8732
- var _props$shopConfigStyl = props.shopConfigStyle,
8733
- shopConfigStyle = _props$shopConfigStyl === void 0 ? {} : _props$shopConfigStyl,
8734
- _props$shopConfig = props.shopConfig,
8735
- shopConfig = _props$shopConfig === void 0 ? {} : _props$shopConfig,
8736
- _props$data = props.data,
8737
- data = _props$data === void 0 ? {} : _props$data,
8738
- _props$SectionTitle = props.SectionTitle,
8739
- SectionTitle = _props$SectionTitle === void 0 ? null : _props$SectionTitle;
8740
- var _shopConfigStyle$colo = shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : shopConfigStyle.color,
8741
- _shopConfigStyle$colo3 = _shopConfigStyle$colo.secondary,
8742
- secondary = _shopConfigStyle$colo3 === void 0 ? "#000" : _shopConfigStyle$colo3;
8743
- var _useState = React.useState({
8744
- size: 10,
8745
- types: "1,10",
8746
- isHighlight: true
8747
- }),
8748
- params = _useState[0];
8749
- var _useState2 = React.useState(false),
8750
- isOpenModal = _useState2[0],
8751
- setIsOpenModal = _useState2[1];
8752
- var _useState3 = React.useState([]),
8753
- dataBooking = _useState3[0],
8754
- setDataBooking = _useState3[1];
8755
- var _ProductController = ProductController(_extends({}, props, {
8756
- params: params
8757
- })),
8758
- _ProductController$pr = _ProductController.products,
8759
- products = _ProductController$pr === void 0 ? [] : _ProductController$pr;
8760
- console.log("treatment1:", products);
8761
- var handleOpenModalBooking = function handleOpenModalBooking(event, data) {
8762
- try {
8763
- var _data$productInfo, _data$productInfo2;
8764
- event.stopPropagation();
8765
- setDataBooking([_extends({}, data, {
8766
- quantity: 1,
8767
- technical: {},
8768
- oldService: false,
8769
- label: data === null || data === void 0 ? void 0 : (_data$productInfo = data.productInfo) === null || _data$productInfo === void 0 ? void 0 : _data$productInfo.productName,
8770
- value: data === null || data === void 0 ? void 0 : (_data$productInfo2 = data.productInfo) === null || _data$productInfo2 === void 0 ? void 0 : _data$productInfo2.productId
8771
- })]);
8772
- setIsOpenModal(true);
8773
- } catch (error) {
8774
- console.log("::::::::::errrorrrrr::::::", error);
8775
- }
8776
- };
8777
- var handleCloseModal = function handleCloseModal() {
8778
- setIsOpenModal(false);
8779
- setDataBooking([]);
8780
- };
8781
- return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
8782
- className: "" + SECTION_DEFAULT_CLASS
8783
- }, /*#__PURE__*/React__default.createElement(SectionTitle, {
8784
- data: data,
8785
- shopConfigStyle: shopConfigStyle
8786
- }), products === null || products === void 0 ? void 0 : products.map(function (product, index) {
8787
- var _product$productInfo, _product$productInfo2;
8788
- return /*#__PURE__*/React__default.createElement("div", {
8789
- className: "grid grid-cols-1 md:grid-cols-2 gap-6 mt-12",
8790
- key: "rthirr-" + index
8791
- }, /*#__PURE__*/React__default.createElement("div", {
8792
- className: "block " + (index % 2 ? "md:hidden" : "")
8793
- }, /*#__PURE__*/React__default.createElement(ProductImage, {
8794
- product: product === null || product === void 0 ? void 0 : product.productInfo,
8795
- className: "aspect-video rounded-2xl"
8796
- })), /*#__PURE__*/React__default.createElement("div", {
8797
- className: "text-left " + (index % 2 ? "md:text-right" : "")
8798
- }, /*#__PURE__*/React__default.createElement("div", {
8799
- className: "font-medium text-2xl"
8800
- }, product === null || product === void 0 ? void 0 : (_product$productInfo = product.productInfo) === null || _product$productInfo === void 0 ? void 0 : _product$productInfo.productName), /*#__PURE__*/React__default.createElement("div", {
8801
- className: "mt-4 text-textBody",
8802
- dangerouslySetInnerHTML: {
8803
- __html: product === null || product === void 0 ? void 0 : (_product$productInfo2 = product.productInfo) === null || _product$productInfo2 === void 0 ? void 0 : _product$productInfo2.description
8804
- }
8805
- }), /*#__PURE__*/React__default.createElement(Button, {
8806
- label: "Đặt lịch ngay",
8807
- shopConfigStyle: shopConfigStyle,
8808
- className: "mt-4",
8809
- onClick: function onClick(event) {
8810
- handleOpenModalBooking(event, product);
8811
- }
8812
- })), /*#__PURE__*/React__default.createElement("div", {
8813
- className: "hidden " + (index % 2 ? "md:block" : "")
8814
- }, /*#__PURE__*/React__default.createElement(ProductImage, {
8815
- product: product === null || product === void 0 ? void 0 : product.productInfo,
8816
- className: "aspect-video rounded-2xl"
8817
- })));
8818
- })), /*#__PURE__*/React__default.createElement(Dash, {
8819
- color: secondary
8820
- }), isOpenModal ? /*#__PURE__*/React__default.createElement(ModalNotification, {
8821
- onClose: handleCloseModal
8822
- }, /*#__PURE__*/React__default.createElement(BookingForm, {
8823
- className: "overflow-y-auto hide-scrollbar max-h-[80vh] !bg-bgSecondary",
8824
- onCloseFormBooking: handleCloseModal,
8825
- defaultValue: dataBooking,
8826
- shopConfig: shopConfig,
8827
- shopConfigStyle: shopConfigStyle
8828
- })) : null);
8829
- };
8830
-
8831
- var _path$1;
8832
- function _extends$2() {
8833
- return _extends$2 = Object.assign ? Object.assign.bind() : function (n) {
8834
- for (var e = 1; e < arguments.length; e++) {
8835
- var t = arguments[e];
8836
- for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
8837
- }
8838
- return n;
8839
- }, _extends$2.apply(null, arguments);
8840
- }
8841
- function SvgAngleSmallLeft(props) {
8842
- return /*#__PURE__*/React.createElement("svg", _extends$2({
8843
- xmlns: "http://www.w3.org/2000/svg",
8844
- viewBox: "0 0 24 24",
8845
- width: 512,
8846
- height: 512
8847
- }, props), _path$1 || (_path$1 = /*#__PURE__*/React.createElement("path", {
8848
- d: "M10.6 12.71a1 1 0 010-1.42l4.59-4.58a1 1 0 000-1.42 1 1 0 00-1.41 0L9.19 9.88a3 3 0 000 4.24l4.59 4.59a1 1 0 00.7.29 1 1 0 00.71-.29 1 1 0 000-1.42z"
8849
- })));
8850
- }
8851
-
8852
- var _path$2;
8853
- function _extends$3() {
8854
- return _extends$3 = Object.assign ? Object.assign.bind() : function (n) {
8855
- for (var e = 1; e < arguments.length; e++) {
8856
- var t = arguments[e];
8857
- for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
8858
- }
8859
- return n;
8860
- }, _extends$3.apply(null, arguments);
8861
- }
8862
- function SvgAngleSmallRight(props) {
8863
- return /*#__PURE__*/React.createElement("svg", _extends$3({
8864
- xmlns: "http://www.w3.org/2000/svg",
8865
- viewBox: "0 0 24 24",
8866
- width: 512,
8867
- height: 512
8868
- }, props), _path$2 || (_path$2 = /*#__PURE__*/React.createElement("path", {
8869
- d: "M15.4 9.88l-4.59-4.59a1 1 0 00-1.41 0 1 1 0 000 1.42l4.6 4.58a1 1 0 010 1.42l-4.6 4.58a1 1 0 001.41 1.42l4.59-4.59a3 3 0 000-4.24z"
8870
- })));
8871
- }
8872
-
8873
- var ScrollHorizontal = function ScrollHorizontal(props) {
8874
- var _props$datas = props.datas,
8875
- datas = _props$datas === void 0 ? [] : _props$datas,
8876
- _props$className = props.className,
8877
- className = _props$className === void 0 ? "" : _props$className,
8878
- _props$style = props.style,
8879
- style = _props$style === void 0 ? {} : _props$style,
8880
- _props$renderItem = props.renderItem,
8881
- renderItem = _props$renderItem === void 0 ? function () {} : _props$renderItem;
8882
- var scrollContainerRef = React.useRef(null);
8883
- var _useState = React.useState(true),
8884
- isScrolledToLeft = _useState[0],
8885
- setIsScrolledToLeft = _useState[1];
8886
- var _useState2 = React.useState(false),
8887
- isScrolledToRight = _useState2[0],
8888
- setIsScrolledToRight = _useState2[1];
8889
- var checkScrollPosition = function checkScrollPosition() {
8890
- if (scrollContainerRef.current) {
8891
- var _scrollContainerRef$c = scrollContainerRef.current,
8892
- _scrollLeft = _scrollContainerRef$c.scrollLeft,
8893
- scrollWidth = _scrollContainerRef$c.scrollWidth,
8894
- clientWidth = _scrollContainerRef$c.clientWidth;
8895
- setIsScrolledToLeft(_scrollLeft === 0);
8896
- setIsScrolledToRight(_scrollLeft + clientWidth >= scrollWidth);
8897
- }
8898
- };
8899
- var scrollLeft = function scrollLeft() {
8900
- if (scrollContainerRef.current) {
8901
- scrollContainerRef.current.scrollBy({
8902
- left: -200,
8903
- behavior: "smooth"
8904
- });
8905
- setTimeout(checkScrollPosition, 300);
8906
- }
8907
- };
8908
- var scrollRight = function scrollRight() {
8909
- if (scrollContainerRef.current) {
8910
- scrollContainerRef.current.scrollBy({
8911
- left: 200,
8912
- behavior: "smooth"
8913
- });
8914
- setTimeout(checkScrollPosition, 300);
8915
- }
8916
- };
8917
- React.useEffect(function () {
8918
- checkScrollPosition();
8919
- }, [datas]);
8920
- return /*#__PURE__*/React__default.createElement("div", {
8921
- className: "flex " + className,
8922
- style: style
8923
- }, /*#__PURE__*/React__default.createElement("div", {
8924
- className: "flex w-full overflow-x-hidden",
8925
- ref: scrollContainerRef,
8926
- onScroll: checkScrollPosition
8927
- }, datas === null || datas === void 0 ? void 0 : datas.map(function (item, index) {
8928
- return renderItem(item, index);
8929
- })), /*#__PURE__*/React__default.createElement("div", {
8930
- className: "flex gap-2 items-center px-4"
8931
- }, /*#__PURE__*/React__default.createElement("div", {
8932
- onClick: scrollLeft,
8933
- className: "cursor-pointer w-8 h-8 rounded-full flex justify-center items-center " + (isScrolledToLeft ? "bg-gray4" : "bg-primary")
8934
- }, /*#__PURE__*/React__default.createElement(SvgAngleSmallLeft, {
8935
- width: 24,
8936
- height: 24,
8937
- fill: "#fff"
8938
- })), /*#__PURE__*/React__default.createElement("div", {
8939
- onClick: scrollRight,
8940
- className: "cursor-pointer w-8 h-8 rounded-full flex justify-center items-center " + (isScrolledToRight ? "bg-gray4" : "bg-primary")
8941
- }, /*#__PURE__*/React__default.createElement(SvgAngleSmallRight, {
8942
- width: 24,
8943
- height: 24,
8944
- fill: "#fff"
8945
- }))));
8946
- };
8947
-
8948
- function getMinMax(array, field) {
8949
- if (!(array !== null && array !== void 0 && array.length) || !array[0].hasOwnProperty(field)) {
8950
- return null;
8951
- }
8952
- var _array$reduce = array.reduce(function (acc, obj) {
8953
- var value = obj[field];
8954
- return {
8955
- min: value < acc.min ? value : acc.min,
8956
- max: value > acc.max ? value : acc.max
8957
- };
8958
- }, {
8959
- min: array[0][field],
8960
- max: array[0][field]
8961
- }),
8962
- min = _array$reduce.min,
8963
- max = _array$reduce.max;
8964
- return {
8965
- min: min,
8966
- max: max
8967
- };
8968
- }
8969
- var ProductPrice = function ProductPrice(props) {
8970
- var product = props.product,
8971
- variant = props.variant,
8972
- _props$className = props.className,
8973
- className = _props$className === void 0 ? "" : _props$className,
8974
- _props$style = props.style,
8975
- style = _props$style === void 0 ? {} : _props$style;
8976
- var _useState = React.useState(),
8977
- displayPrice = _useState[0],
8978
- setDisplayPrice = _useState[1];
8979
- var _useState2 = React.useState(),
8980
- displayPriceBeforeDiscount = _useState2[0],
8981
- setDisplayPriceBeforeDiscount = _useState2[1];
8982
- React.useEffect(function () {
8983
- if (variant) {
8984
- genProductPrice([variant]);
8985
- } else if (product) {
8986
- genProductPrice(product.variants);
8987
- }
8988
- }, [product, variant]);
8989
- var genProductPrice = function genProductPrice(variants) {
8990
- var mPrice = getMinMax(variants, 'price');
8991
- var mPriceBeforeDiscount = getMinMax(variants, 'priceBeforeDiscount');
8992
- if (mPrice && mPriceBeforeDiscount) {
8993
- var _displayPriceBeforeDiscount = formatCurrency(mPriceBeforeDiscount.min);
8994
- var _displayPrice = formatCurrency(mPrice.min);
8995
- if (mPrice.min !== mPrice.max) {
8996
- _displayPrice += " - " + formatCurrency(mPrice.max);
8997
- }
8998
- if (mPriceBeforeDiscount.min !== mPriceBeforeDiscount.max) {
8999
- _displayPriceBeforeDiscount += " - " + formatCurrency(mPriceBeforeDiscount.max);
9000
- }
9001
- setDisplayPrice(_displayPrice);
9002
- setDisplayPriceBeforeDiscount(_displayPriceBeforeDiscount);
9003
- } else {
9004
- var _displayPrice2 = formatCurrency(product === null || product === void 0 ? void 0 : product.price);
9005
- setDisplayPrice(_displayPrice2);
9006
- }
9007
- };
9008
- return /*#__PURE__*/React__default.createElement("div", {
9009
- className: className
9010
- }, displayPriceBeforeDiscount !== displayPrice && displayPriceBeforeDiscount != null ? /*#__PURE__*/React__default.createElement("span", {
9011
- className: "text-gray3 line-through mr-2"
9012
- }, displayPriceBeforeDiscount) : null, /*#__PURE__*/React__default.createElement("span", {
9013
- className: "text-primary font-semibold",
9014
- style: style
9015
- }, displayPrice));
9016
- };
9017
-
9018
- var ProductItem1 = function ProductItem1(props) {
9019
- var product = props.product;
9020
- return /*#__PURE__*/React__default.createElement("div", {
9021
- className: "flex"
9022
- }, /*#__PURE__*/React__default.createElement(ProductImage, {
9023
- product: product,
9024
- className: "!w-20 rounded-lg"
9025
- }), /*#__PURE__*/React__default.createElement("div", {
9026
- className: "ml-4 border-b border-stroke flex-1"
9027
- }, /*#__PURE__*/React__default.createElement("div", {
9028
- className: "text-lg"
9029
- }, product === null || product === void 0 ? void 0 : product.productName), /*#__PURE__*/React__default.createElement("div", {
9030
- className: "flex mt-2"
9031
- }, /*#__PURE__*/React__default.createElement("div", {
9032
- className: "flex-1 text-gray3"
9033
- }, getDurationValue(product === null || product === void 0 ? void 0 : product.attributes)), /*#__PURE__*/React__default.createElement(ProductPrice, {
9034
- product: product
9035
- }))));
9036
- };
9037
-
9038
- var Loading = function Loading(props) {
9039
- var _props$size = props.size,
9040
- size = _props$size === void 0 ? 24 : _props$size;
9041
- return /*#__PURE__*/React__default.createElement("div", {
9042
- className: "border-4 boder-[rgba(255, 255, 255, 0.2)] rounded-full border-t-4 border-t-primary animate-spin",
9043
- style: {
9044
- width: size,
9045
- height: size
9046
- }
9047
- });
9048
- };
9049
-
9050
- var Treatments1$1 = function Treatments1(props) {
9051
- var _props$shopConfigStyl = props.shopConfigStyle,
9052
- shopConfigStyle = _props$shopConfigStyl === void 0 ? {} : _props$shopConfigStyl,
9053
- _props$data = props.data,
9054
- data = _props$data === void 0 ? {} : _props$data,
9055
- _props$SectionTitle = props.SectionTitle,
9056
- SectionTitle = _props$SectionTitle === void 0 ? null : _props$SectionTitle;
9057
- var _shopConfigStyle$colo = shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : shopConfigStyle.color,
9058
- _shopConfigStyle$colo2 = _shopConfigStyle$colo.secondary,
9059
- secondary = _shopConfigStyle$colo2 === void 0 ? "#000" : _shopConfigStyle$colo2;
9060
- var _useState = React.useState({
9061
- types: "1"
9062
- }),
9063
- params = _useState[0],
9064
- setParams = _useState[1];
9065
- var _CategoryController = CategoryController(_extends({}, props, {
9066
- types: "1"
9067
- })),
9068
- categories = _CategoryController.categories;
9069
- var _ProductController = ProductController(_extends({}, props, {
9070
- params: params
9071
- })),
9072
- _ProductController$pr = _ProductController.products,
9073
- products = _ProductController$pr === void 0 ? [] : _ProductController$pr,
9074
- loading = _ProductController.loading;
9075
- var _useState2 = React.useState(0),
9076
- selectedCategory = _useState2[0],
9077
- setSelectedCategory = _useState2[1];
9078
- React.useEffect(function () {
9079
- var newParams = _extends({}, params, {
9080
- categoryId: selectedCategory
9081
- });
9082
- if (!selectedCategory) {
9083
- delete newParams.categoryId;
9084
- }
9085
- setParams(newParams);
9086
- }, [selectedCategory]);
9087
- return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
9088
- className: SECTION_DEFAULT_CLASS + " relative"
9089
- }, /*#__PURE__*/React__default.createElement(SectionTitle, {
9090
- data: data,
9091
- shopConfigStyle: shopConfigStyle
9092
- }), /*#__PURE__*/React__default.createElement(ScrollHorizontal, {
9093
- datas: [{
9094
- categoryId: 0,
9095
- cateName: "Tất cả"
9096
- }].concat(categories),
9097
- className: "mt-6 rounded-lg overflow-hidden bg-bgSecondary",
9098
- renderItem: function renderItem(item, index) {
9099
- return /*#__PURE__*/React__default.createElement("div", {
9100
- key: index,
9101
- className: "p-3 flex gap-3 shrink-0 cursor-pointer text-base " + (selectedCategory === item.categoryId ? "bg-primary text-textButton" : ""),
9102
- onClick: function onClick() {
9103
- return setSelectedCategory(item.categoryId);
9104
- }
9105
- }, item === null || item === void 0 ? void 0 : item.cateName);
9106
- }
9107
- }), loading ? /*#__PURE__*/React__default.createElement("div", {
9108
- className: "flex w-full justify-center p-12"
9109
- }, /*#__PURE__*/React__default.createElement(Loading, null)) : products !== null && products !== void 0 && products.length ? /*#__PURE__*/React__default.createElement("div", {
9110
- className: "grid grid-cols-1 md:grid-cols-2 gap-10 mt-6"
9111
- }, products === null || products === void 0 ? void 0 : products.map(function (product, index) {
9112
- return /*#__PURE__*/React__default.createElement(ProductItem1, {
9113
- key: index,
9114
- product: product === null || product === void 0 ? void 0 : product.productInfo
9115
- });
9116
- })) : /*#__PURE__*/React__default.createElement("div", {
9117
- className: "text-gray3 text-center p-12"
9118
- }, "Kh\xF4ng c\xF3 d\u1ECBch v\u1EE5")), /*#__PURE__*/React__default.createElement(Dash, {
9119
- color: secondary
9120
- }));
9121
- };
9122
-
9123
- var NotFoundProduct = function NotFoundProduct() {
9124
- return /*#__PURE__*/React__default.createElement("div", {
9125
- className: "h-60 flex flex-col justify-center items-center text-xl text-gray3"
9126
- }, /*#__PURE__*/React__default.createElement(fa.FaBoxOpen, {
9127
- size: 80
9128
- }), /*#__PURE__*/React__default.createElement("div", null, "Kh\xF4ng c\xF3 s\u1EA3n ph\u1EA9m"));
9012
+ shopConfigStyle: shopConfigStyle
9013
+ })))));
9129
9014
  };
9130
9015
 
9131
- var TreatmentsList6 = function TreatmentsList6(props) {
9132
- var _products$slice;
9133
- var data = props.data,
9134
- _props$Link = props.Link,
9135
- Link = _props$Link === void 0 ? null : _props$Link,
9016
+ var TreatmentsList7 = function TreatmentsList7(props) {
9017
+ var _props$shopConfigStyl = props.shopConfigStyle,
9018
+ shopConfigStyle = _props$shopConfigStyl === void 0 ? {} : _props$shopConfigStyl,
9019
+ _props$shopConfig = props.shopConfig,
9020
+ shopConfig = _props$shopConfig === void 0 ? {} : _props$shopConfig,
9021
+ _props$data = props.data,
9022
+ data = _props$data === void 0 ? {} : _props$data,
9136
9023
  _props$SectionTitle = props.SectionTitle,
9137
- SectionTitle = _props$SectionTitle === void 0 ? null : _props$SectionTitle,
9138
- _props$TreatmentItem = props.TreatmentItem,
9139
- TreatmentItem = _props$TreatmentItem === void 0 ? null : _props$TreatmentItem,
9140
- _props$shopConfigStyl = props.shopConfigStyle,
9141
- shopConfigStyle = _props$shopConfigStyl === void 0 ? {} : _props$shopConfigStyl;
9024
+ SectionTitle = _props$SectionTitle === void 0 ? null : _props$SectionTitle;
9025
+ var _shopConfigStyle$colo = shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : shopConfigStyle.color,
9026
+ _shopConfigStyle$colo3 = _shopConfigStyle$colo.secondary,
9027
+ secondary = _shopConfigStyle$colo3 === void 0 ? "#000" : _shopConfigStyle$colo3;
9142
9028
  var _useState = React.useState({
9143
- size: 12,
9144
- types: "1"
9029
+ size: 10,
9030
+ types: "1,10",
9031
+ isHighlight: true
9145
9032
  }),
9146
- params = _useState[0],
9147
- setParams = _useState[1];
9148
- var _useState2 = React.useState(true),
9149
- isGetMore = _useState2[0],
9150
- setIsGetMore = _useState2[1];
9033
+ params = _useState[0];
9034
+ var _useState2 = React.useState(false),
9035
+ isOpenModal = _useState2[0],
9036
+ setIsOpenModal = _useState2[1];
9037
+ var _useState3 = React.useState([]),
9038
+ dataBooking = _useState3[0],
9039
+ setDataBooking = _useState3[1];
9040
+ var _useState4 = React.useState(0),
9041
+ currentSlide = _useState4[0],
9042
+ setCurrentSlide = _useState4[1];
9151
9043
  var _ProductController = ProductController(_extends({}, props, {
9152
9044
  params: params
9153
9045
  })),
9154
- products = _ProductController.products,
9155
- loading = _ProductController.loading;
9156
- var handleGetMoreProducts = function handleGetMoreProducts() {
9157
- setIsGetMore(false);
9158
- setParams(function (prev) {
9159
- return _extends({}, prev, {
9160
- size: (prev === null || prev === void 0 ? void 0 : prev.size) + 4
9161
- });
9162
- });
9046
+ _ProductController$pr = _ProductController.products,
9047
+ products = _ProductController$pr === void 0 ? [] : _ProductController$pr;
9048
+ console.log("treatment1:", products);
9049
+ var handleOpenModalBooking = function handleOpenModalBooking(event, data) {
9050
+ try {
9051
+ var _data$productInfo, _data$productInfo2;
9052
+ event.stopPropagation();
9053
+ setDataBooking([_extends({}, data, {
9054
+ quantity: 1,
9055
+ technical: {},
9056
+ oldService: false,
9057
+ label: data === null || data === void 0 ? void 0 : (_data$productInfo = data.productInfo) === null || _data$productInfo === void 0 ? void 0 : _data$productInfo.productName,
9058
+ value: data === null || data === void 0 ? void 0 : (_data$productInfo2 = data.productInfo) === null || _data$productInfo2 === void 0 ? void 0 : _data$productInfo2.productId
9059
+ })]);
9060
+ setIsOpenModal(true);
9061
+ } catch (error) {
9062
+ console.log("::::::::::errrorrrrr::::::", error);
9063
+ }
9163
9064
  };
9164
- return /*#__PURE__*/React__default.createElement("div", {
9165
- className: SECTION_CLASS + " flex flex-col gap-8 "
9065
+ var handleCloseModal = function handleCloseModal() {
9066
+ setIsOpenModal(false);
9067
+ setDataBooking([]);
9068
+ };
9069
+ var renderItemSlide = function renderItemSlide(product, index) {
9070
+ var _product$productInfo, _product$productInfo2;
9071
+ return /*#__PURE__*/React__default.createElement("div", {
9072
+ className: "w-full"
9073
+ }, /*#__PURE__*/React__default.createElement("div", {
9074
+ className: "grid grid-cols-1 md:grid-cols-2 gap-6 mt-12",
9075
+ key: index
9076
+ }, /*#__PURE__*/React__default.createElement(ProductImage, {
9077
+ product: product === null || product === void 0 ? void 0 : product.productInfo,
9078
+ className: "aspect-video rounded-2xl"
9079
+ }), /*#__PURE__*/React__default.createElement("div", {
9080
+ className: ''
9081
+ }, /*#__PURE__*/React__default.createElement("div", {
9082
+ className: "font-medium text-2xl"
9083
+ }, product === null || product === void 0 ? void 0 : (_product$productInfo = product.productInfo) === null || _product$productInfo === void 0 ? void 0 : _product$productInfo.productName), /*#__PURE__*/React__default.createElement("div", {
9084
+ className: "mt-4 text-textBody",
9085
+ dangerouslySetInnerHTML: {
9086
+ __html: product === null || product === void 0 ? void 0 : (_product$productInfo2 = product.productInfo) === null || _product$productInfo2 === void 0 ? void 0 : _product$productInfo2.description
9087
+ }
9088
+ }), /*#__PURE__*/React__default.createElement(Button, {
9089
+ label: "Đặt lịch ngay",
9090
+ shopConfigStyle: shopConfigStyle,
9091
+ className: "mt-4",
9092
+ onClick: function onClick(event) {
9093
+ handleOpenModalBooking(event, product);
9094
+ }
9095
+ }))));
9096
+ };
9097
+ function RenderArrow(props) {
9098
+ var className = props.className,
9099
+ style = props.style,
9100
+ onClick = props.onClick;
9101
+ return /*#__PURE__*/React__default.createElement("div", {
9102
+ className: className,
9103
+ style: _extends({}, style, {
9104
+ display: "none"
9105
+ }),
9106
+ onClick: onClick
9107
+ });
9108
+ }
9109
+ return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
9110
+ className: "" + SECTION_DEFAULT_CLASS
9166
9111
  }, /*#__PURE__*/React__default.createElement(SectionTitle, {
9167
9112
  data: data,
9168
9113
  shopConfigStyle: shopConfigStyle
9169
- }), loading && isGetMore ? /*#__PURE__*/React__default.createElement("div", {
9170
- className: "m-auto mt-20 min-h-32"
9171
- }, /*#__PURE__*/React__default.createElement(Loading, null)) : (products === null || products === void 0 ? void 0 : products.length) > 0 ? /*#__PURE__*/React__default.createElement("div", {
9172
- className: "grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-x-2 gap-y-4 md:gap-4 xl:gap-6"
9173
- }, products === null || products === void 0 ? void 0 : (_products$slice = products.slice(0, params.size - 4)) === null || _products$slice === void 0 ? void 0 : _products$slice.map(function (product, idx) {
9174
- return /*#__PURE__*/React__default.createElement(TreatmentItem, {
9175
- Link: Link,
9176
- shopConfigStyle: shopConfigStyle,
9177
- product: product === null || product === void 0 ? void 0 : product.productInfo,
9178
- key: "htrhr-" + idx
9179
- });
9180
- })) : /*#__PURE__*/React__default.createElement(NotFoundProduct, null), !loading && (products === null || products === void 0 ? void 0 : products.length) > (params === null || params === void 0 ? void 0 : params.size) - 4 ? /*#__PURE__*/React__default.createElement(Button, {
9181
- label: "Xem thêm",
9182
- onClick: handleGetMoreProducts,
9183
- className: "mx-auto " + (shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : shopConfigStyle.buttonClass),
9184
- type: "outline"
9185
- }) : null);
9114
+ }), /*#__PURE__*/React__default.createElement(Slider, {
9115
+ className: "center",
9116
+ infinite: true,
9117
+ slidesToShow: 1,
9118
+ speed: 500,
9119
+ autoplay: true,
9120
+ autoplaySpeed: 4000,
9121
+ pauseOnHover: true,
9122
+ nextArrow: /*#__PURE__*/React__default.createElement(RenderArrow, null),
9123
+ prevArrow: /*#__PURE__*/React__default.createElement(RenderArrow, null),
9124
+ beforeChange: function beforeChange(oldIndex, newIndex) {
9125
+ return setCurrentSlide(newIndex);
9126
+ },
9127
+ dots: true,
9128
+ customPaging: function customPaging(i) {
9129
+ return i === currentSlide ? /*#__PURE__*/React__default.createElement("div", {
9130
+ className: "w-4 h-1 rounded-full bg-primary mt-4"
9131
+ }) : /*#__PURE__*/React__default.createElement("div", {
9132
+ className: "w-4 h-1 rounded-full bg-gray-300 mt-4"
9133
+ });
9134
+ }
9135
+ }, products === null || products === void 0 ? void 0 : products.map(function (product, index) {
9136
+ return renderItemSlide(product, index);
9137
+ }))), /*#__PURE__*/React__default.createElement(Dash, {
9138
+ color: secondary
9139
+ }), isOpenModal ? /*#__PURE__*/React__default.createElement(ModalNotification, {
9140
+ onClose: handleCloseModal
9141
+ }, /*#__PURE__*/React__default.createElement(BookingForm, {
9142
+ className: "overflow-y-auto hide-scrollbar max-h-[80vh] !bg-bgSecondary",
9143
+ onCloseFormBooking: handleCloseModal,
9144
+ defaultValue: dataBooking,
9145
+ shopConfig: shopConfig,
9146
+ shopConfigStyle: shopConfigStyle
9147
+ })) : null);
9186
9148
  };
9187
9149
 
9188
9150
  var ProductDetailController = function ProductDetailController(props) {
@@ -9613,7 +9575,7 @@ var TreatmentItem1 = function TreatmentItem1(props) {
9613
9575
  }))));
9614
9576
  };
9615
9577
 
9616
- var Products1 = function Products1(props) {
9578
+ var ProductsList7 = function ProductsList7(props) {
9617
9579
  var _props$shopConfigStyl = props.shopConfigStyle,
9618
9580
  shopConfigStyle = _props$shopConfigStyl === void 0 ? {} : _props$shopConfigStyl,
9619
9581
  _props$data = props.data,
@@ -10736,6 +10698,72 @@ var Banner1 = function Banner1(props) {
10736
10698
  })));
10737
10699
  };
10738
10700
 
10701
+ var Banner2 = function Banner2(props) {
10702
+ var data = props.data,
10703
+ shopConfigStyle = props.shopConfigStyle,
10704
+ _props$SectionTitle = props.SectionTitle,
10705
+ SectionTitle = _props$SectionTitle === void 0 ? null : _props$SectionTitle;
10706
+ var sectionData = data === null || data === void 0 ? void 0 : data.data;
10707
+ var _useState = React.useState(0),
10708
+ currentSlide = _useState[0],
10709
+ setCurrentSlide = _useState[1];
10710
+ function RenderArrow(props) {
10711
+ var className = props.className,
10712
+ style = props.style,
10713
+ onClick = props.onClick;
10714
+ return /*#__PURE__*/React__default.createElement("div", {
10715
+ className: className,
10716
+ style: _extends({}, style, {
10717
+ display: "none"
10718
+ }),
10719
+ onClick: onClick
10720
+ });
10721
+ }
10722
+ return /*#__PURE__*/React__default.createElement("div", {
10723
+ className: "" + SECTION_DEFAULT_CLASS
10724
+ }, /*#__PURE__*/React__default.createElement(SectionTitle, {
10725
+ data: data,
10726
+ shopConfigStyle: shopConfigStyle
10727
+ }), /*#__PURE__*/React__default.createElement(Slider, {
10728
+ className: "center",
10729
+ infinite: false,
10730
+ slidesToShow: 2,
10731
+ speed: 500,
10732
+ autoplay: true,
10733
+ autoplaySpeed: 4000,
10734
+ pauseOnHover: true,
10735
+ nextArrow: /*#__PURE__*/React__default.createElement(RenderArrow, null),
10736
+ prevArrow: /*#__PURE__*/React__default.createElement(RenderArrow, null),
10737
+ beforeChange: function beforeChange(oldIndex, newIndex) {
10738
+ return setCurrentSlide(newIndex);
10739
+ },
10740
+ dots: true,
10741
+ customPaging: function customPaging(i) {
10742
+ return i === currentSlide ? /*#__PURE__*/React__default.createElement("div", {
10743
+ className: "w-4 h-1 rounded-full bg-primary mt-4"
10744
+ }) : /*#__PURE__*/React__default.createElement("div", {
10745
+ className: "w-4 h-1 rounded-full bg-gray-300 mt-4"
10746
+ });
10747
+ },
10748
+ centerPadding: "20px",
10749
+ responsive: [{
10750
+ breakpoint: 600,
10751
+ settings: {
10752
+ slidesToShow: 1
10753
+ }
10754
+ }]
10755
+ }, (sectionData === null || sectionData === void 0 ? void 0 : sectionData.length) > 0 && (sectionData === null || sectionData === void 0 ? void 0 : sectionData.map(function (item, index) {
10756
+ return /*#__PURE__*/React__default.createElement("div", {
10757
+ className: 'px-2'
10758
+ }, /*#__PURE__*/React__default.createElement("img", {
10759
+ src: item === null || item === void 0 ? void 0 : item.srcImage,
10760
+ alt: "",
10761
+ className: "rounded-2xl",
10762
+ key: index
10763
+ }));
10764
+ }))));
10765
+ };
10766
+
10739
10767
  var Banner3 = function Banner3(props) {
10740
10768
  var data = props.data;
10741
10769
  var sectionData = data === null || data === void 0 ? void 0 : data.data;
@@ -10749,6 +10777,36 @@ var Banner3 = function Banner3(props) {
10749
10777
  }));
10750
10778
  };
10751
10779
 
10780
+ var Banner7 = function Banner7(props) {
10781
+ var _data$data;
10782
+ var _props$shopConfigStyl = props.shopConfigStyle,
10783
+ shopConfigStyle = _props$shopConfigStyl === void 0 ? {} : _props$shopConfigStyl,
10784
+ _props$data = props.data,
10785
+ data = _props$data === void 0 ? {} : _props$data,
10786
+ _props$SectionTitle = props.SectionTitle,
10787
+ SectionTitle = _props$SectionTitle === void 0 ? null : _props$SectionTitle;
10788
+ var _shopConfigStyle$colo = shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : shopConfigStyle.color,
10789
+ _shopConfigStyle$colo3 = _shopConfigStyle$colo.secondary,
10790
+ secondary = _shopConfigStyle$colo3 === void 0 ? "#000" : _shopConfigStyle$colo3;
10791
+ return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
10792
+ className: "" + SECTION_DEFAULT_CLASS
10793
+ }, /*#__PURE__*/React__default.createElement(SectionTitle, {
10794
+ data: data,
10795
+ shopConfigStyle: shopConfigStyle
10796
+ }), /*#__PURE__*/React__default.createElement("div", {
10797
+ className: "mt-6 grid grid-cols-2 md:grid-cols-4 gap-1 md:gap-2"
10798
+ }, data === null || data === void 0 ? void 0 : (_data$data = data.data) === null || _data$data === void 0 ? void 0 : _data$data.map(function (it, index) {
10799
+ var _it$srcImages;
10800
+ return /*#__PURE__*/React__default.createElement("div", {
10801
+ key: index
10802
+ }, /*#__PURE__*/React__default.createElement("img", {
10803
+ src: it === null || it === void 0 ? void 0 : (_it$srcImages = it.srcImages) === null || _it$srcImages === void 0 ? void 0 : _it$srcImages[0]
10804
+ }));
10805
+ }))), /*#__PURE__*/React__default.createElement(Dash, {
10806
+ color: secondary
10807
+ }));
10808
+ };
10809
+
10752
10810
  var BannerFull1 = function BannerFull1(props) {
10753
10811
  var data = props.data;
10754
10812
  var sectionData = data === null || data === void 0 ? void 0 : data.data;
@@ -12750,11 +12808,89 @@ var ShopHighlights6 = function ShopHighlights6(props) {
12750
12808
  }));
12751
12809
  };
12752
12810
 
12811
+ var ShopHighlights7 = function ShopHighlights7(props) {
12812
+ var _data$data;
12813
+ var _props$shopConfigStyl = props.shopConfigStyle,
12814
+ shopConfigStyle = _props$shopConfigStyl === void 0 ? {} : _props$shopConfigStyl,
12815
+ _props$data = props.data,
12816
+ data = _props$data === void 0 ? {} : _props$data,
12817
+ _props$SectionTitle = props.SectionTitle,
12818
+ SectionTitle = _props$SectionTitle === void 0 ? null : _props$SectionTitle;
12819
+ var _shopConfigStyle$colo = shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : shopConfigStyle.color,
12820
+ _shopConfigStyle$colo3 = _shopConfigStyle$colo.secondary,
12821
+ secondary = _shopConfigStyle$colo3 === void 0 ? "#000" : _shopConfigStyle$colo3;
12822
+ return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
12823
+ className: SECTION_DEFAULT_CLASS + " relative"
12824
+ }, /*#__PURE__*/React__default.createElement(SectionTitle, {
12825
+ data: data
12826
+ }), /*#__PURE__*/React__default.createElement("div", {
12827
+ className: "mt-6 grid grid-cols-3 gap-4 md:gap-8"
12828
+ }, data === null || data === void 0 ? void 0 : (_data$data = data.data) === null || _data$data === void 0 ? void 0 : _data$data.map(function (it, index) {
12829
+ return /*#__PURE__*/React__default.createElement("div", {
12830
+ key: index,
12831
+ className: "pt-6 col-span-3 md:col-span-1"
12832
+ }, /*#__PURE__*/React__default.createElement("div", {
12833
+ className: "relative w-40 h-24 flex items-center justify-center m-auto md:m-0"
12834
+ }, /*#__PURE__*/React__default.createElement("div", {
12835
+ className: "absolute w-40 h-24 rounded-2xl z-10 bg-primary"
12836
+ }), /*#__PURE__*/React__default.createElement("div", {
12837
+ className: "absolute w-24 h-16 rounded-2xl -right-2 -top-2 z-0 bg-secondary"
12838
+ }), it !== null && it !== void 0 && it.svgImage ? /*#__PURE__*/React__default.createElement("div", {
12839
+ className: "w-12 text-primary h-16 w-16 z-20 m-auto"
12840
+ }, /*#__PURE__*/React__default.createElement("div", {
12841
+ dangerouslySetInnerHTML: {
12842
+ __html: configSvg(it === null || it === void 0 ? void 0 : it.svgImage)
12843
+ }
12844
+ })) : /*#__PURE__*/React__default.createElement("div", {
12845
+ className: "h-16 m-auto bg-center w-16 bg-cover bg-no-repeat z-20",
12846
+ style: {
12847
+ backgroundImage: "url(" + it.srcImage + ")"
12848
+ }
12849
+ })), /*#__PURE__*/React__default.createElement("p", {
12850
+ className: "mx-auto md:mt-3 md:mx-0 text-xl py-2 font-medium w-fit rounded-lg"
12851
+ }, it.title), /*#__PURE__*/React__default.createElement("div", {
12852
+ className: "mx-auto md:mx-0 mb-2 w-28 h-2px rounded-full bg-secondary"
12853
+ }), /*#__PURE__*/React__default.createElement("p", {
12854
+ className: "text-base mx-auto md:mx-0 text-center md:text-start"
12855
+ }, it.description));
12856
+ }))), /*#__PURE__*/React__default.createElement(Dash, {
12857
+ color: secondary
12858
+ }));
12859
+ };
12860
+
12861
+ var VideoFull1 = function VideoFull1(props) {
12862
+ var _data$data, _data$data$;
12863
+ var shopConfigStyle = props.shopConfigStyle,
12864
+ data = props.data,
12865
+ _props$SectionTitle = props.SectionTitle,
12866
+ SectionTitle = _props$SectionTitle === void 0 ? null : _props$SectionTitle;
12867
+ console.log("VideoFull1 data", data);
12868
+ var youtubeVideoId = getYoutubeVideoIdByUrl(data === null || data === void 0 ? void 0 : (_data$data = data.data) === null || _data$data === void 0 ? void 0 : (_data$data$ = _data$data[0]) === null || _data$data$ === void 0 ? void 0 : _data$data$.link);
12869
+ console.log("VideoFull1 youtubeVideoId", youtubeVideoId);
12870
+ return /*#__PURE__*/React__default.createElement("div", {
12871
+ className: "" + SECTION_DEFAULT_CLASS
12872
+ }, /*#__PURE__*/React__default.createElement(SectionTitle, {
12873
+ data: data,
12874
+ shopConfigStyle: shopConfigStyle
12875
+ }), youtubeVideoId ? /*#__PURE__*/React__default.createElement("div", {
12876
+ className: "w-full aspect-video"
12877
+ }, /*#__PURE__*/React__default.createElement("iframe", {
12878
+ className: "w-full h-full",
12879
+ src: "https://www.youtube.com/embed/" + youtubeVideoId,
12880
+ title: "YouTube video player",
12881
+ frameBorder: "0",
12882
+ allow: "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",
12883
+ allowFullScreen: true
12884
+ })) : null);
12885
+ };
12886
+
12753
12887
  exports.About1 = About1;
12754
12888
  exports.About5 = About5;
12755
12889
  exports.Address1 = Address1;
12756
12890
  exports.Banner1 = Banner1;
12891
+ exports.Banner2 = Banner2;
12757
12892
  exports.Banner3 = Banner3;
12893
+ exports.Banner7 = Banner7;
12758
12894
  exports.BannerFull1 = BannerFull1;
12759
12895
  exports.BannerFull2 = BannerFull2;
12760
12896
  exports.Booking1 = Booking1;
@@ -12769,7 +12905,6 @@ exports.CustomerRating5 = CustomerRating5;
12769
12905
  exports.CustomerRating6 = CustomerRating6;
12770
12906
  exports.DateTimePicker = DateTimePicker;
12771
12907
  exports.Employees1 = Employees1;
12772
- exports.Features1 = Features1;
12773
12908
  exports.Features2 = Features2;
12774
12909
  exports.Features3 = Features3;
12775
12910
  exports.Footer1 = Footer1;
@@ -12777,8 +12912,7 @@ exports.Footer7 = Footer7;
12777
12912
  exports.Gallery1 = Gallery1;
12778
12913
  exports.Hero1 = Hero1;
12779
12914
  exports.Hero10 = Hero10;
12780
- exports.Hero11 = Hero11;
12781
- exports.Hero12 = Hero11$1;
12915
+ exports.Hero12 = Hero11;
12782
12916
  exports.Hero13 = Hero13;
12783
12917
  exports.Hero2 = Hero2;
12784
12918
  exports.Hero5 = Hero5;
@@ -12805,10 +12939,10 @@ exports.ProductItem7 = ProductItem7;
12805
12939
  exports.ProductList5 = ProductList5;
12806
12940
  exports.ProductSale2 = ProductSale2;
12807
12941
  exports.ProductSearch1 = ProductSearch1;
12808
- exports.Products1 = Products1;
12809
12942
  exports.Products10 = Products10;
12810
12943
  exports.Products2 = Products2;
12811
12944
  exports.Products3 = Products3;
12945
+ exports.ProductsList7 = ProductsList7;
12812
12946
  exports.ProductsTop1 = ProductsTop1;
12813
12947
  exports.SearchBar2 = SearchBar2;
12814
12948
  exports.SearchBar5 = SearchBar5;
@@ -12822,10 +12956,12 @@ exports.ServiceDetail1 = ServiceDetail1;
12822
12956
  exports.ShopHighlights2 = ShopHighlights2;
12823
12957
  exports.ShopHighlights5 = ShopHighlights5;
12824
12958
  exports.ShopHighlights6 = ShopHighlights6;
12959
+ exports.ShopHighlights7 = ShopHighlights7;
12825
12960
  exports.TextArea = TextArea;
12826
12961
  exports.TreatmentDetail1 = TreatmentDetail1;
12827
12962
  exports.TreatmentItem1 = TreatmentItem1;
12828
- exports.Treatments1 = Treatments1;
12829
- exports.Treatments2 = Treatments1$1;
12963
+ exports.TreatmentsCategory7 = TreatmentsCategory7;
12830
12964
  exports.TreatmentsList6 = TreatmentsList6;
12965
+ exports.TreatmentsList7 = TreatmentsList7;
12966
+ exports.VideoFull1 = VideoFull1;
12831
12967
  //# sourceMappingURL=index.js.map