s-platform-landing-section 0.1.10-alpha.15 → 0.1.10-alpha.17
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 +294 -27
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +295 -29
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -131,6 +131,7 @@ var LinkToPage = function LinkToPage(props) {
|
|
|
131
131
|
otherProps = _objectWithoutPropertiesLoose(props, _excluded);
|
|
132
132
|
return Link ? /*#__PURE__*/React__default.createElement(Link, otherProps, props.children) : /*#__PURE__*/React__default.createElement("a", otherProps, props.children);
|
|
133
133
|
};
|
|
134
|
+
var SSHOP_SPA_TOKEN = "sshop-spa-token";
|
|
134
135
|
|
|
135
136
|
var Options = function Options(props) {
|
|
136
137
|
var _props$className = props.className,
|
|
@@ -216,15 +217,17 @@ var NavBar7 = function NavBar7(props) {
|
|
|
216
217
|
_props$logout = props.logout,
|
|
217
218
|
logout = _props$logout === void 0 ? function () {} : _props$logout;
|
|
218
219
|
var cartItems = useSelector === null || useSelector === void 0 ? void 0 : useSelector(function (state) {
|
|
219
|
-
|
|
220
|
+
var _state$cart;
|
|
221
|
+
return state === null || state === void 0 ? void 0 : (_state$cart = state.cart) === null || _state$cart === void 0 ? void 0 : _state$cart.items;
|
|
220
222
|
});
|
|
221
223
|
var userInfo = useSelector === null || useSelector === void 0 ? void 0 : useSelector(function (state) {
|
|
222
|
-
|
|
224
|
+
var _state$user;
|
|
225
|
+
return state === null || state === void 0 ? void 0 : (_state$user = state.user) === null || _state$user === void 0 ? void 0 : _state$user.info;
|
|
223
226
|
});
|
|
224
227
|
var _useState2 = React.useState(""),
|
|
225
228
|
totalItem = _useState2[0],
|
|
226
229
|
setTotalItem = _useState2[1];
|
|
227
|
-
var profileRoute = (_routes$find = routes.find(function (e) {
|
|
230
|
+
var profileRoute = routes === null || routes === void 0 ? void 0 : (_routes$find = routes.find(function (e) {
|
|
228
231
|
return (e === null || e === void 0 ? void 0 : e.name) === "profile";
|
|
229
232
|
})) === null || _routes$find === void 0 ? void 0 : _routes$find.route;
|
|
230
233
|
var profileOptions = [{
|
|
@@ -244,8 +247,8 @@ var NavBar7 = function NavBar7(props) {
|
|
|
244
247
|
}];
|
|
245
248
|
React.useEffect(function () {
|
|
246
249
|
console.log("NavBar7 cartItems", cartItems);
|
|
247
|
-
var totalItem = cartItems.reduce(function (total, item) {
|
|
248
|
-
return total + item.quantity;
|
|
250
|
+
var totalItem = cartItems === null || cartItems === void 0 ? void 0 : cartItems.reduce(function (total, item) {
|
|
251
|
+
return total + (item === null || item === void 0 ? void 0 : item.quantity);
|
|
249
252
|
}, 0);
|
|
250
253
|
if (totalItem > 9) {
|
|
251
254
|
totalItem = "9+";
|
|
@@ -291,7 +294,7 @@ var NavBar7 = function NavBar7(props) {
|
|
|
291
294
|
}, (item === null || item === void 0 ? void 0 : item.name) === (route === null || route === void 0 ? void 0 : route.name) ? /*#__PURE__*/React__default.createElement("div", {
|
|
292
295
|
className: "py-1 border-b text-textHeading border-textHeading"
|
|
293
296
|
}, item === null || item === void 0 ? void 0 : item.label) : /*#__PURE__*/React__default.createElement("div", {
|
|
294
|
-
className: "py-1"
|
|
297
|
+
className: "py-1 text-textBody"
|
|
295
298
|
}, item === null || item === void 0 ? void 0 : item.label));
|
|
296
299
|
})), cart(), userInfo ?
|
|
297
300
|
/*#__PURE__*/
|
|
@@ -7110,10 +7113,32 @@ var ProductController = function ProductController(props) {
|
|
|
7110
7113
|
return Promise.reject(e);
|
|
7111
7114
|
}
|
|
7112
7115
|
};
|
|
7116
|
+
var getProductListSearch = function getProductListSearch(data) {
|
|
7117
|
+
try {
|
|
7118
|
+
return Promise.resolve(_catch(function () {
|
|
7119
|
+
setLoading(true);
|
|
7120
|
+
var filterParams = _extends({}, defaultParams, data);
|
|
7121
|
+
return Promise.resolve(getProductListApi(shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopId, filterParams)).then(function (res) {
|
|
7122
|
+
var _res$data4, _res$data4$status;
|
|
7123
|
+
if ((res === null || res === void 0 ? void 0 : (_res$data4 = res.data) === null || _res$data4 === void 0 ? void 0 : (_res$data4$status = _res$data4.status) === null || _res$data4$status === void 0 ? void 0 : _res$data4$status.code) == 200) {
|
|
7124
|
+
var _res$data5;
|
|
7125
|
+
setLoading(false);
|
|
7126
|
+
return res === null || res === void 0 ? void 0 : (_res$data5 = res.data) === null || _res$data5 === void 0 ? void 0 : _res$data5.data;
|
|
7127
|
+
}
|
|
7128
|
+
setLoading(false);
|
|
7129
|
+
});
|
|
7130
|
+
}, function (e) {
|
|
7131
|
+
console.log(e);
|
|
7132
|
+
}));
|
|
7133
|
+
} catch (e) {
|
|
7134
|
+
return Promise.reject(e);
|
|
7135
|
+
}
|
|
7136
|
+
};
|
|
7113
7137
|
return {
|
|
7114
7138
|
products: products,
|
|
7115
7139
|
loading: loading,
|
|
7116
|
-
page: page
|
|
7140
|
+
page: page,
|
|
7141
|
+
getProductListSearch: getProductListSearch
|
|
7117
7142
|
};
|
|
7118
7143
|
};
|
|
7119
7144
|
|
|
@@ -7296,12 +7321,13 @@ var BookingController = function BookingController(props) {
|
|
|
7296
7321
|
var createSchedule = function createSchedule(customerName, customerPhone, scheduleDate, services, shopId) {
|
|
7297
7322
|
try {
|
|
7298
7323
|
return Promise.resolve(_catch(function () {
|
|
7324
|
+
var _Date;
|
|
7299
7325
|
var data = {
|
|
7300
7326
|
appId: "SSPA",
|
|
7301
7327
|
customerName: customerName,
|
|
7302
|
-
customerPhone: customerPhone.replace("+", ""),
|
|
7328
|
+
customerPhone: customerPhone === null || customerPhone === void 0 ? void 0 : customerPhone.replace("+", ""),
|
|
7303
7329
|
isSellService: true,
|
|
7304
|
-
scheduleDate: new Date(scheduleDate).getTime(),
|
|
7330
|
+
scheduleDate: (_Date = new Date(scheduleDate)) === null || _Date === void 0 ? void 0 : _Date.getTime(),
|
|
7305
7331
|
services: services === null || services === void 0 ? void 0 : services.map(function (_ref) {
|
|
7306
7332
|
var productName = _ref.productName,
|
|
7307
7333
|
rest = _objectWithoutPropertiesLoose(_ref, _excluded$1);
|
|
@@ -7337,6 +7363,8 @@ var Input = React.forwardRef(function (props, ref) {
|
|
|
7337
7363
|
labelClassName = _props$labelClassName === void 0 ? "" : _props$labelClassName,
|
|
7338
7364
|
_props$name = props.name,
|
|
7339
7365
|
name = _props$name === void 0 ? "" : _props$name,
|
|
7366
|
+
_props$style = props.style,
|
|
7367
|
+
style = _props$style === void 0 ? {} : _props$style,
|
|
7340
7368
|
_props$onChange = props.onChange,
|
|
7341
7369
|
onChange = _props$onChange === void 0 ? function () {} : _props$onChange,
|
|
7342
7370
|
_props$defaultValue = props.defaultValue,
|
|
@@ -7426,7 +7454,7 @@ var Input = React.forwardRef(function (props, ref) {
|
|
|
7426
7454
|
setTypeInput("text");
|
|
7427
7455
|
}
|
|
7428
7456
|
};
|
|
7429
|
-
var _className = "h-10 py-1 px-2 border border-stroke rounded " + className;
|
|
7457
|
+
var _className = "h-10 py-1 px-2 border border-stroke rounded-lg " + className;
|
|
7430
7458
|
var _inputClassName = (isQuantity ? "text-center w-12" : "") + " focus:outline-none focus:ring-0 " + inputClassName;
|
|
7431
7459
|
var required = !!(rules !== null && rules !== void 0 && rules.find(function (e) {
|
|
7432
7460
|
return (e === null || e === void 0 ? void 0 : e.type) === "required";
|
|
@@ -7439,7 +7467,8 @@ var Input = React.forwardRef(function (props, ref) {
|
|
|
7439
7467
|
}, label ? /*#__PURE__*/React__default.createElement("div", {
|
|
7440
7468
|
className: "mb-1 " + labelClassName
|
|
7441
7469
|
}, label, labelRequired) : null, /*#__PURE__*/React__default.createElement("div", {
|
|
7442
|
-
className: "flex gap-2 " + _className
|
|
7470
|
+
className: "flex gap-2 " + _className,
|
|
7471
|
+
style: style
|
|
7443
7472
|
}, isQuantity ? /*#__PURE__*/React__default.createElement("button", {
|
|
7444
7473
|
onClick: function onClick() {
|
|
7445
7474
|
return changeQuantity(-1);
|
|
@@ -7762,7 +7791,7 @@ var DateTimePicker = React.forwardRef(function (props, ref) {
|
|
|
7762
7791
|
});
|
|
7763
7792
|
var _validateData = function _validateData() {
|
|
7764
7793
|
var count = 0;
|
|
7765
|
-
rules.forEach(function (e) {
|
|
7794
|
+
rules === null || rules === void 0 ? void 0 : rules.forEach(function (e) {
|
|
7766
7795
|
var _e$pattern;
|
|
7767
7796
|
if ((e === null || e === void 0 ? void 0 : e.type) === 'required' && value === '') {
|
|
7768
7797
|
_setError(e === null || e === void 0 ? void 0 : e.message);
|
|
@@ -7964,6 +7993,147 @@ var dayjs_min = createCommonjsModule(function (module, exports) {
|
|
|
7964
7993
|
!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}));
|
|
7965
7994
|
});
|
|
7966
7995
|
|
|
7996
|
+
var js_cookie = createCommonjsModule(function (module, exports) {
|
|
7997
|
+
(function (global, factory) {
|
|
7998
|
+
module.exports = factory() ;
|
|
7999
|
+
})(commonjsGlobal, (function () {
|
|
8000
|
+
/* eslint-disable no-var */
|
|
8001
|
+
function assign (target) {
|
|
8002
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
8003
|
+
var source = arguments[i];
|
|
8004
|
+
for (var key in source) {
|
|
8005
|
+
target[key] = source[key];
|
|
8006
|
+
}
|
|
8007
|
+
}
|
|
8008
|
+
return target
|
|
8009
|
+
}
|
|
8010
|
+
/* eslint-enable no-var */
|
|
8011
|
+
|
|
8012
|
+
/* eslint-disable no-var */
|
|
8013
|
+
var defaultConverter = {
|
|
8014
|
+
read: function (value) {
|
|
8015
|
+
if (value[0] === '"') {
|
|
8016
|
+
value = value.slice(1, -1);
|
|
8017
|
+
}
|
|
8018
|
+
return value.replace(/(%[\dA-F]{2})+/gi, decodeURIComponent)
|
|
8019
|
+
},
|
|
8020
|
+
write: function (value) {
|
|
8021
|
+
return encodeURIComponent(value).replace(
|
|
8022
|
+
/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,
|
|
8023
|
+
decodeURIComponent
|
|
8024
|
+
)
|
|
8025
|
+
}
|
|
8026
|
+
};
|
|
8027
|
+
/* eslint-enable no-var */
|
|
8028
|
+
|
|
8029
|
+
/* eslint-disable no-var */
|
|
8030
|
+
|
|
8031
|
+
function init (converter, defaultAttributes) {
|
|
8032
|
+
function set (name, value, attributes) {
|
|
8033
|
+
if (typeof document === 'undefined') {
|
|
8034
|
+
return
|
|
8035
|
+
}
|
|
8036
|
+
|
|
8037
|
+
attributes = assign({}, defaultAttributes, attributes);
|
|
8038
|
+
|
|
8039
|
+
if (typeof attributes.expires === 'number') {
|
|
8040
|
+
attributes.expires = new Date(Date.now() + attributes.expires * 864e5);
|
|
8041
|
+
}
|
|
8042
|
+
if (attributes.expires) {
|
|
8043
|
+
attributes.expires = attributes.expires.toUTCString();
|
|
8044
|
+
}
|
|
8045
|
+
|
|
8046
|
+
name = encodeURIComponent(name)
|
|
8047
|
+
.replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent)
|
|
8048
|
+
.replace(/[()]/g, escape);
|
|
8049
|
+
|
|
8050
|
+
var stringifiedAttributes = '';
|
|
8051
|
+
for (var attributeName in attributes) {
|
|
8052
|
+
if (!attributes[attributeName]) {
|
|
8053
|
+
continue
|
|
8054
|
+
}
|
|
8055
|
+
|
|
8056
|
+
stringifiedAttributes += '; ' + attributeName;
|
|
8057
|
+
|
|
8058
|
+
if (attributes[attributeName] === true) {
|
|
8059
|
+
continue
|
|
8060
|
+
}
|
|
8061
|
+
|
|
8062
|
+
// Considers RFC 6265 section 5.2:
|
|
8063
|
+
// ...
|
|
8064
|
+
// 3. If the remaining unparsed-attributes contains a %x3B (";")
|
|
8065
|
+
// character:
|
|
8066
|
+
// Consume the characters of the unparsed-attributes up to,
|
|
8067
|
+
// not including, the first %x3B (";") character.
|
|
8068
|
+
// ...
|
|
8069
|
+
stringifiedAttributes += '=' + attributes[attributeName].split(';')[0];
|
|
8070
|
+
}
|
|
8071
|
+
|
|
8072
|
+
return (document.cookie =
|
|
8073
|
+
name + '=' + converter.write(value, name) + stringifiedAttributes)
|
|
8074
|
+
}
|
|
8075
|
+
|
|
8076
|
+
function get (name) {
|
|
8077
|
+
if (typeof document === 'undefined' || (arguments.length && !name)) {
|
|
8078
|
+
return
|
|
8079
|
+
}
|
|
8080
|
+
|
|
8081
|
+
// To prevent the for loop in the first place assign an empty array
|
|
8082
|
+
// in case there are no cookies at all.
|
|
8083
|
+
var cookies = document.cookie ? document.cookie.split('; ') : [];
|
|
8084
|
+
var jar = {};
|
|
8085
|
+
for (var i = 0; i < cookies.length; i++) {
|
|
8086
|
+
var parts = cookies[i].split('=');
|
|
8087
|
+
var value = parts.slice(1).join('=');
|
|
8088
|
+
|
|
8089
|
+
try {
|
|
8090
|
+
var found = decodeURIComponent(parts[0]);
|
|
8091
|
+
jar[found] = converter.read(value, found);
|
|
8092
|
+
|
|
8093
|
+
if (name === found) {
|
|
8094
|
+
break
|
|
8095
|
+
}
|
|
8096
|
+
} catch (e) {}
|
|
8097
|
+
}
|
|
8098
|
+
|
|
8099
|
+
return name ? jar[name] : jar
|
|
8100
|
+
}
|
|
8101
|
+
|
|
8102
|
+
return Object.create(
|
|
8103
|
+
{
|
|
8104
|
+
set,
|
|
8105
|
+
get,
|
|
8106
|
+
remove: function (name, attributes) {
|
|
8107
|
+
set(
|
|
8108
|
+
name,
|
|
8109
|
+
'',
|
|
8110
|
+
assign({}, attributes, {
|
|
8111
|
+
expires: -1
|
|
8112
|
+
})
|
|
8113
|
+
);
|
|
8114
|
+
},
|
|
8115
|
+
withAttributes: function (attributes) {
|
|
8116
|
+
return init(this.converter, assign({}, this.attributes, attributes))
|
|
8117
|
+
},
|
|
8118
|
+
withConverter: function (converter) {
|
|
8119
|
+
return init(assign({}, this.converter, converter), this.attributes)
|
|
8120
|
+
}
|
|
8121
|
+
},
|
|
8122
|
+
{
|
|
8123
|
+
attributes: { value: Object.freeze(defaultAttributes) },
|
|
8124
|
+
converter: { value: Object.freeze(converter) }
|
|
8125
|
+
}
|
|
8126
|
+
)
|
|
8127
|
+
}
|
|
8128
|
+
|
|
8129
|
+
var api = init(defaultConverter, { path: '/' });
|
|
8130
|
+
/* eslint-enable no-var */
|
|
8131
|
+
|
|
8132
|
+
return api;
|
|
8133
|
+
|
|
8134
|
+
}));
|
|
8135
|
+
});
|
|
8136
|
+
|
|
7967
8137
|
var BookingForm = function BookingForm(props) {
|
|
7968
8138
|
var _props$shopConfig = props.shopConfig,
|
|
7969
8139
|
shopConfig = _props$shopConfig === void 0 ? {} : _props$shopConfig,
|
|
@@ -8007,6 +8177,10 @@ var BookingForm = function BookingForm(props) {
|
|
|
8007
8177
|
var _EmployeeController = EmployeeController(_extends({}, props)),
|
|
8008
8178
|
_EmployeeController$l = _EmployeeController.listEmployment,
|
|
8009
8179
|
listEmployment = _EmployeeController$l === void 0 ? [] : _EmployeeController$l;
|
|
8180
|
+
var token = js_cookie === null || js_cookie === void 0 ? void 0 : js_cookie.get(SSHOP_SPA_TOKEN);
|
|
8181
|
+
React.useEffect(function () {
|
|
8182
|
+
console.log("check kkkkk", token, token > 0);
|
|
8183
|
+
}, [token]);
|
|
8010
8184
|
var _ProductController = ProductController(_extends({}, props, {
|
|
8011
8185
|
params: productsParams
|
|
8012
8186
|
})),
|
|
@@ -8283,7 +8457,7 @@ var BookingForm = function BookingForm(props) {
|
|
|
8283
8457
|
onCloseFormBooking: onCloseFormBooking,
|
|
8284
8458
|
onClose: handleClosePopup
|
|
8285
8459
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
8286
|
-
className: "bg-white rounded-lg shadow-lg p-6 max-w-sm
|
|
8460
|
+
className: "bg-white rounded-lg shadow-lg p-6 max-w-sm flex flex-col items-center justify-center min-w-[320px] md:min-w-[650px] min-h-[420px] md:min-h-[380px] lg:h-auto "
|
|
8287
8461
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
8288
8462
|
className: "h-20 mb-4 flex items-center justify-center"
|
|
8289
8463
|
}, /*#__PURE__*/React__default.createElement(fa.FaCheckCircle, {
|
|
@@ -8297,12 +8471,14 @@ var BookingForm = function BookingForm(props) {
|
|
|
8297
8471
|
className: "mb-2"
|
|
8298
8472
|
}, "S\u1ED1 \u0111i\u1EC7n tho\u1EA1i: ", dataBooking === null || dataBooking === void 0 ? void 0 : dataBooking.customerPhone), /*#__PURE__*/React__default.createElement("div", {
|
|
8299
8473
|
className: "mb-4"
|
|
8300
|
-
}, "Th\u1EDDi gian: ", dayjs_min(dataBooking === null || dataBooking === void 0 ? void 0 : dataBooking.scheduleDate).format("DD/MM/YYYY")), /*#__PURE__*/React__default.createElement("
|
|
8301
|
-
className: "
|
|
8474
|
+
}, "Th\u1EDDi gian: ", dayjs_min(dataBooking === null || dataBooking === void 0 ? void 0 : dataBooking.scheduleDate).format("DD/MM/YYYY")), token ? /*#__PURE__*/React__default.createElement("div", null) : /*#__PURE__*/React__default.createElement("div", {
|
|
8475
|
+
className: "flex flex-col items-center"
|
|
8476
|
+
}, /*#__PURE__*/React__default.createElement("p", {
|
|
8477
|
+
className: "mb-4 text-center"
|
|
8302
8478
|
}, "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, {
|
|
8303
8479
|
label: "Đăng nhập",
|
|
8304
8480
|
shopConfigStyle: shopConfigStyle
|
|
8305
|
-
}))));
|
|
8481
|
+
})))));
|
|
8306
8482
|
};
|
|
8307
8483
|
|
|
8308
8484
|
var Treatments1 = function Treatments1(props) {
|
|
@@ -8768,8 +8944,11 @@ var ServiceDetail1 = function ServiceDetail1(props) {
|
|
|
8768
8944
|
};
|
|
8769
8945
|
|
|
8770
8946
|
var ProductItem2 = function ProductItem2(props) {
|
|
8771
|
-
var product = props.product
|
|
8772
|
-
|
|
8947
|
+
var product = props.product,
|
|
8948
|
+
_props$Link = props.Link,
|
|
8949
|
+
Link = _props$Link === void 0 ? null : _props$Link;
|
|
8950
|
+
return /*#__PURE__*/React__default.createElement(LinkToPage, {
|
|
8951
|
+
Link: Link,
|
|
8773
8952
|
href: getLinkProductDetail(product)
|
|
8774
8953
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
8775
8954
|
className: "text-center relative group"
|
|
@@ -8790,7 +8969,9 @@ var Products1 = function Products1(props) {
|
|
|
8790
8969
|
_props$data = props.data,
|
|
8791
8970
|
data = _props$data === void 0 ? {} : _props$data,
|
|
8792
8971
|
_props$SectionTitle = props.SectionTitle,
|
|
8793
|
-
SectionTitle = _props$SectionTitle === void 0 ? null : _props$SectionTitle
|
|
8972
|
+
SectionTitle = _props$SectionTitle === void 0 ? null : _props$SectionTitle,
|
|
8973
|
+
_props$Link = props.Link,
|
|
8974
|
+
Link = _props$Link === void 0 ? null : _props$Link;
|
|
8794
8975
|
var _shopConfigStyle$colo = shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : shopConfigStyle.color,
|
|
8795
8976
|
_shopConfigStyle$colo3 = _shopConfigStyle$colo.secondary,
|
|
8796
8977
|
secondary = _shopConfigStyle$colo3 === void 0 ? "#000" : _shopConfigStyle$colo3;
|
|
@@ -8813,6 +8994,7 @@ var Products1 = function Products1(props) {
|
|
|
8813
8994
|
className: "grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-10 mt-12"
|
|
8814
8995
|
}, products === null || products === void 0 ? void 0 : products.map(function (product, index) {
|
|
8815
8996
|
return /*#__PURE__*/React__default.createElement(ProductItem2, {
|
|
8997
|
+
Link: Link,
|
|
8816
8998
|
key: index,
|
|
8817
8999
|
product: product === null || product === void 0 ? void 0 : product.productInfo
|
|
8818
9000
|
});
|
|
@@ -9011,7 +9193,9 @@ var Products3 = function Products3(props) {
|
|
|
9011
9193
|
_props$data = props.data,
|
|
9012
9194
|
data = _props$data === void 0 ? {} : _props$data,
|
|
9013
9195
|
_props$SectionTitle = props.SectionTitle,
|
|
9014
|
-
SectionTitle = _props$SectionTitle === void 0 ? null : _props$SectionTitle
|
|
9196
|
+
SectionTitle = _props$SectionTitle === void 0 ? null : _props$SectionTitle,
|
|
9197
|
+
_props$Link = props.Link,
|
|
9198
|
+
Link = _props$Link === void 0 ? null : _props$Link;
|
|
9015
9199
|
var _shopConfigStyle$colo = shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : shopConfigStyle.color,
|
|
9016
9200
|
_shopConfigStyle$colo3 = _shopConfigStyle$colo.secondary,
|
|
9017
9201
|
secondary = _shopConfigStyle$colo3 === void 0 ? "#000" : _shopConfigStyle$colo3;
|
|
@@ -9093,6 +9277,7 @@ var Products3 = function Products3(props) {
|
|
|
9093
9277
|
className: "grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-12 mt-12"
|
|
9094
9278
|
}, products === null || products === void 0 ? void 0 : products.map(function (product, index) {
|
|
9095
9279
|
return /*#__PURE__*/React__default.createElement(ProductItem2, {
|
|
9280
|
+
Link: Link,
|
|
9096
9281
|
key: index,
|
|
9097
9282
|
product: product === null || product === void 0 ? void 0 : product.productInfo
|
|
9098
9283
|
});
|
|
@@ -9305,7 +9490,9 @@ var ProductHot3 = function ProductHot3(props) {
|
|
|
9305
9490
|
_props$data = props.data,
|
|
9306
9491
|
data = _props$data === void 0 ? {} : _props$data,
|
|
9307
9492
|
_props$SectionTitle = props.SectionTitle,
|
|
9308
|
-
SectionTitle = _props$SectionTitle === void 0 ? null : _props$SectionTitle
|
|
9493
|
+
SectionTitle = _props$SectionTitle === void 0 ? null : _props$SectionTitle,
|
|
9494
|
+
_props$Link = props.Link,
|
|
9495
|
+
Link = _props$Link === void 0 ? null : _props$Link;
|
|
9309
9496
|
var _shopConfigStyle$colo = shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : shopConfigStyle.color,
|
|
9310
9497
|
_shopConfigStyle$colo3 = _shopConfigStyle$colo.secondary,
|
|
9311
9498
|
secondary = _shopConfigStyle$colo3 === void 0 ? "#000" : _shopConfigStyle$colo3;
|
|
@@ -9329,6 +9516,7 @@ var ProductHot3 = function ProductHot3(props) {
|
|
|
9329
9516
|
className: "grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-10 mt-12"
|
|
9330
9517
|
}, products === null || products === void 0 ? void 0 : products.map(function (product, index) {
|
|
9331
9518
|
return /*#__PURE__*/React__default.createElement(ProductItem2, {
|
|
9519
|
+
Link: Link,
|
|
9332
9520
|
key: index,
|
|
9333
9521
|
product: product === null || product === void 0 ? void 0 : product.productInfo
|
|
9334
9522
|
});
|
|
@@ -10076,7 +10264,7 @@ var PageTitle1 = function PageTitle1(props) {
|
|
|
10076
10264
|
className: "relative w-full p-20 z-10 flex flex-col gap-6 items-center justify-center"
|
|
10077
10265
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
10078
10266
|
className: "text-3xl md:text-5xl text-white leading-[1.6] md:leading-[1.6] text-center font-headingFont"
|
|
10079
|
-
}, route === null || route === void 0 ? void 0 : route.label)));
|
|
10267
|
+
}, sectionData !== null && sectionData !== void 0 && sectionData.sectionTitle ? sectionData === null || sectionData === void 0 ? void 0 : sectionData.sectionTitle : route === null || route === void 0 ? void 0 : route.label)));
|
|
10080
10268
|
};
|
|
10081
10269
|
|
|
10082
10270
|
var About5 = function About5(props) {
|
|
@@ -10146,7 +10334,9 @@ var Breadcrumb1 = function Breadcrumb1(props) {
|
|
|
10146
10334
|
var shopConfigStyle = props.shopConfigStyle,
|
|
10147
10335
|
route = props.route,
|
|
10148
10336
|
_props$routes = props.routes,
|
|
10149
|
-
routes = _props$routes === void 0 ? [] : _props$routes
|
|
10337
|
+
routes = _props$routes === void 0 ? [] : _props$routes,
|
|
10338
|
+
_props$Link = props.Link,
|
|
10339
|
+
Link = _props$Link === void 0 ? null : _props$Link;
|
|
10150
10340
|
var _shopConfigStyle$colo = shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : shopConfigStyle.color,
|
|
10151
10341
|
_shopConfigStyle$colo3 = _shopConfigStyle$colo.textHeading,
|
|
10152
10342
|
textHeading = _shopConfigStyle$colo3 === void 0 ? "#000" : _shopConfigStyle$colo3;
|
|
@@ -10157,18 +10347,21 @@ var Breadcrumb1 = function Breadcrumb1(props) {
|
|
|
10157
10347
|
getItems();
|
|
10158
10348
|
}, [route]);
|
|
10159
10349
|
var getItems = function getItems() {
|
|
10160
|
-
var _route$route, _route$route$split, _route$route$split$fi;
|
|
10350
|
+
var _route$route, _route$route$split, _route$route$split$fi, _items, _items2;
|
|
10161
10351
|
var items = route === null || route === void 0 ? void 0 : (_route$route = route.route) === null || _route$route === void 0 ? void 0 : (_route$route$split = _route$route.split("/")) === null || _route$route$split === void 0 ? void 0 : (_route$route$split$fi = _route$route$split.filter(function (e) {
|
|
10162
10352
|
return e === null || e === void 0 ? void 0 : e.length;
|
|
10163
10353
|
})) === null || _route$route$split$fi === void 0 ? void 0 : _route$route$split$fi.slice(0, 2);
|
|
10164
|
-
items = items.map(function (e) {
|
|
10354
|
+
items = (_items = items) === null || _items === void 0 ? void 0 : _items.map(function (e) {
|
|
10355
|
+
if (e === "product") {
|
|
10356
|
+
e = "products";
|
|
10357
|
+
}
|
|
10165
10358
|
return (routes === null || routes === void 0 ? void 0 : routes.find(function (r) {
|
|
10166
10359
|
return (r === null || r === void 0 ? void 0 : r.name) === e;
|
|
10167
10360
|
})) || {
|
|
10168
10361
|
label: e
|
|
10169
10362
|
};
|
|
10170
10363
|
});
|
|
10171
|
-
items.unshift({
|
|
10364
|
+
(_items2 = items) === null || _items2 === void 0 ? void 0 : _items2.unshift({
|
|
10172
10365
|
name: "home",
|
|
10173
10366
|
label: "Trang chủ",
|
|
10174
10367
|
route: "/"
|
|
@@ -10183,7 +10376,8 @@ var Breadcrumb1 = function Breadcrumb1(props) {
|
|
|
10183
10376
|
className: "flex gap-2"
|
|
10184
10377
|
}, index ? /*#__PURE__*/React__default.createElement("div", {
|
|
10185
10378
|
className: "text-gray4"
|
|
10186
|
-
}, "/") : null, item !== null && item !== void 0 && item.route ? /*#__PURE__*/React__default.createElement(
|
|
10379
|
+
}, "/") : null, item !== null && item !== void 0 && item.route ? /*#__PURE__*/React__default.createElement(LinkToPage, {
|
|
10380
|
+
Link: Link,
|
|
10187
10381
|
href: item === null || item === void 0 ? void 0 : item.route,
|
|
10188
10382
|
style: {
|
|
10189
10383
|
color: textHeading
|
|
@@ -11024,6 +11218,78 @@ var CartItem = function CartItem(props) {
|
|
|
11024
11218
|
}, /*#__PURE__*/React__default.createElement(ri.RiDeleteBin7Line, null), /*#__PURE__*/React__default.createElement("span", null, "X\xF3a"))));
|
|
11025
11219
|
};
|
|
11026
11220
|
|
|
11221
|
+
var SearchProduct1 = function SearchProduct1(props) {
|
|
11222
|
+
var _props$Link = props.Link,
|
|
11223
|
+
Link = _props$Link === void 0 ? null : _props$Link;
|
|
11224
|
+
var _props$shopConfigStyl = props.shopConfigStyle,
|
|
11225
|
+
shopConfigStyle = _props$shopConfigStyl === void 0 ? {} : _props$shopConfigStyl,
|
|
11226
|
+
data = props.data;
|
|
11227
|
+
var _shopConfigStyle$colo = shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : shopConfigStyle.color,
|
|
11228
|
+
_shopConfigStyle$colo6 = _shopConfigStyle$colo.bgSecondary,
|
|
11229
|
+
bgSecondary = _shopConfigStyle$colo6 === void 0 ? "#fffff" : _shopConfigStyle$colo6;
|
|
11230
|
+
var _useState = React.useState([]),
|
|
11231
|
+
listProducts = _useState[0],
|
|
11232
|
+
setListProducts = _useState[1];
|
|
11233
|
+
var _ProductController = ProductController(_extends({}, props)),
|
|
11234
|
+
getProductListSearch = _ProductController.getProductListSearch;
|
|
11235
|
+
var handleSearch = function handleSearch(productName) {
|
|
11236
|
+
try {
|
|
11237
|
+
var _temp = function () {
|
|
11238
|
+
if (productName) {
|
|
11239
|
+
return Promise.resolve(getProductListSearch({
|
|
11240
|
+
productName: productName
|
|
11241
|
+
})).then(function (data) {
|
|
11242
|
+
setListProducts(data);
|
|
11243
|
+
});
|
|
11244
|
+
} else {
|
|
11245
|
+
setListProducts([]);
|
|
11246
|
+
}
|
|
11247
|
+
}();
|
|
11248
|
+
return Promise.resolve(_temp && _temp.then ? _temp.then(function () {}) : void 0);
|
|
11249
|
+
} catch (e) {
|
|
11250
|
+
return Promise.reject(e);
|
|
11251
|
+
}
|
|
11252
|
+
};
|
|
11253
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
11254
|
+
className: "flex flex-col gap-2 w-[720px] rounded-lg mx-auto mt-12 "
|
|
11255
|
+
}, /*#__PURE__*/React__default.createElement(Input, {
|
|
11256
|
+
className: "flex items-center w-full h-14",
|
|
11257
|
+
style: {
|
|
11258
|
+
backgroundColor: bgSecondary
|
|
11259
|
+
},
|
|
11260
|
+
inputClassName: "w-full h-full p-2 text-lg",
|
|
11261
|
+
placeholder: (data === null || data === void 0 ? void 0 : data.sectionTitle) || "Tìm kiếm sản phẩm",
|
|
11262
|
+
onChange: handleSearch,
|
|
11263
|
+
icons: /*#__PURE__*/React__default.createElement("div", {
|
|
11264
|
+
className: "px-2"
|
|
11265
|
+
}, /*#__PURE__*/React__default.createElement(fi.FiSearch, {
|
|
11266
|
+
style: {
|
|
11267
|
+
color: "#828282"
|
|
11268
|
+
}
|
|
11269
|
+
}))
|
|
11270
|
+
}), (listProducts === null || listProducts === void 0 ? void 0 : listProducts.length) > 0 ? /*#__PURE__*/React__default.createElement("div", {
|
|
11271
|
+
className: "max-h-64 overflow-y-auto flex flex-col gap-2 pr-3"
|
|
11272
|
+
}, listProducts === null || listProducts === void 0 ? void 0 : listProducts.map(function (item) {
|
|
11273
|
+
var _item$productInfo, _item$productInfo2;
|
|
11274
|
+
return /*#__PURE__*/React__default.createElement(LinkToPage, {
|
|
11275
|
+
Link: Link,
|
|
11276
|
+
href: getLinkProductDetail(item === null || item === void 0 ? void 0 : item.productInfo),
|
|
11277
|
+
className: "flex gap-2 text-Body"
|
|
11278
|
+
}, /*#__PURE__*/React__default.createElement(ProductImage, {
|
|
11279
|
+
product: item,
|
|
11280
|
+
className: "h-20 max-w-20 rounded-lg border"
|
|
11281
|
+
}), /*#__PURE__*/React__default.createElement("div", {
|
|
11282
|
+
className: "flex flex-col px-1 gap-2 border-b w-full"
|
|
11283
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
11284
|
+
className: "mt-1 text-lg font-medium\t"
|
|
11285
|
+
}, item === null || item === void 0 ? void 0 : (_item$productInfo = item.productInfo) === null || _item$productInfo === void 0 ? void 0 : _item$productInfo.productName), /*#__PURE__*/React__default.createElement("div", {
|
|
11286
|
+
className: " text-lg font-medium\t"
|
|
11287
|
+
}, formatCurrency(item === null || item === void 0 ? void 0 : (_item$productInfo2 = item.productInfo) === null || _item$productInfo2 === void 0 ? void 0 : _item$productInfo2.price))));
|
|
11288
|
+
})) : /*#__PURE__*/React__default.createElement("div", {
|
|
11289
|
+
className: "text-center"
|
|
11290
|
+
}, data === null || data === void 0 ? void 0 : data.sectionDescription));
|
|
11291
|
+
};
|
|
11292
|
+
|
|
11027
11293
|
exports.About5 = About5;
|
|
11028
11294
|
exports.Address1 = Address1;
|
|
11029
11295
|
exports.Banner1 = Banner1;
|
|
@@ -11060,6 +11326,7 @@ exports.Products10 = Products10;
|
|
|
11060
11326
|
exports.Products2 = Products2;
|
|
11061
11327
|
exports.Products3 = Products3;
|
|
11062
11328
|
exports.ProductsTop1 = ProductsTop1;
|
|
11329
|
+
exports.SearchProduct1 = SearchProduct1;
|
|
11063
11330
|
exports.SectionTitle1 = SectionTitle1;
|
|
11064
11331
|
exports.Select = Select$1;
|
|
11065
11332
|
exports.ServiceDetail1 = ServiceDetail1;
|