@pisell/private-materials 3.0.119 → 3.0.120

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.
Files changed (35) hide show
  1. package/build/lowcode/assets-daily.json +11 -11
  2. package/build/lowcode/assets-dev.json +2 -2
  3. package/build/lowcode/assets-prod.json +11 -11
  4. package/build/lowcode/meta.js +1 -1
  5. package/build/lowcode/render/default/view.css +1 -1
  6. package/build/lowcode/render/default/view.js +11 -11
  7. package/build/lowcode/view.css +1 -1
  8. package/build/lowcode/view.js +10 -10
  9. package/es/components/booking/addons/index.d.ts +1 -1
  10. package/es/components/booking/components/TabProduct/productItem/index.d.ts +2 -2
  11. package/es/components/booking/components/TabProduct/productItem/index.js +8 -7
  12. package/es/components/booking/forms/index.d.ts +1 -1
  13. package/es/components/booking/index.d.ts +1 -1
  14. package/es/components/booking/info/header/index.d.ts +2 -2
  15. package/es/components/booking/info/header/index.js +436 -44
  16. package/es/components/booking/info/header/index.less +110 -1
  17. package/es/components/booking/info/service/addService/index.js +3 -1
  18. package/es/components/booking/info/service/editService/index.js +3 -1
  19. package/es/components/booking/locales.d.ts +42 -0
  20. package/es/components/booking/locales.js +54 -6
  21. package/es/components/booking/payments/index.d.ts +1 -1
  22. package/lib/components/booking/addons/index.d.ts +1 -1
  23. package/lib/components/booking/components/TabProduct/productItem/index.d.ts +2 -2
  24. package/lib/components/booking/components/TabProduct/productItem/index.js +2 -1
  25. package/lib/components/booking/forms/index.d.ts +1 -1
  26. package/lib/components/booking/index.d.ts +1 -1
  27. package/lib/components/booking/info/header/index.d.ts +2 -2
  28. package/lib/components/booking/info/header/index.js +212 -11
  29. package/lib/components/booking/info/header/index.less +110 -1
  30. package/lib/components/booking/info/service/addService/index.js +3 -1
  31. package/lib/components/booking/info/service/editService/index.js +3 -1
  32. package/lib/components/booking/locales.d.ts +42 -0
  33. package/lib/components/booking/locales.js +48 -6
  34. package/lib/components/booking/payments/index.d.ts +1 -1
  35. package/package.json +3 -3
@@ -48,7 +48,7 @@
48
48
  display: flex;
49
49
  align-items: center;
50
50
  gap: 10px;
51
- color: var(--Base-White, #FFF);
51
+ color: var(--Base-White, #FFF) !important;
52
52
  font-size: 18px;
53
53
  font-style: normal;
54
54
  font-weight: 400;
@@ -57,10 +57,119 @@
57
57
  padding: 4px 12px;
58
58
  border-radius: 24px;
59
59
 
60
+ span {
61
+ color: var(--Base-White, #FFF) !important;
62
+ }
60
63
 
61
64
  .booking-header-right-status-icon {
62
65
  font-size: 20px;
63
66
  }
64
67
  }
65
68
  }
69
+ }
70
+
71
+ .go-payments-modal-wrap {
72
+ padding: 0;
73
+ }
74
+
75
+ .go-payments-modal-content {
76
+ margin: 0 -24px;
77
+
78
+ .go-payments-modal-content-title {
79
+ color: var(--Gray-900, #101828);
80
+ font-size: 24px;
81
+ font-style: normal;
82
+ font-weight: 600;
83
+ line-height: 32px;
84
+ padding: 0 24px;
85
+ }
86
+
87
+ .go-payments-modal-content-desc {
88
+ color: var(--Gray-900, #101828);
89
+ font-size: 16px;
90
+ font-style: normal;
91
+ font-weight: 500;
92
+ line-height: 24px;
93
+ padding: 0 24px;
94
+ margin-top: 4px;
95
+ }
96
+
97
+ .cancelled-modal-content-title {
98
+ color: var(--Gray-900, #101828);
99
+ font-size: 24px;
100
+ font-style: normal;
101
+ font-weight: 600;
102
+ line-height: 32px;
103
+ padding: 0 24px;
104
+ }
105
+
106
+ .cancelled-modal-content-desc {
107
+ margin-top: 4px;
108
+ color: #101828;
109
+ font-size: 16px;
110
+ font-style: normal;
111
+ font-weight: 500;
112
+ line-height: 24px;
113
+ padding: 0 24px;
114
+
115
+ &.cancelled-modal-content-desc-red {
116
+ color: var(--Error-600, #D92D20);
117
+ }
118
+ }
119
+
120
+ .cancelled-modal-content-list-wrap {
121
+ padding: 0 24px;
122
+
123
+ .cancelled-modal-content-list-title {
124
+ color: var(--Gray-900, #101828);
125
+ font-size: 16px;
126
+ font-style: normal;
127
+ font-weight: 500;
128
+ line-height: 24px;
129
+ margin-top: 4px;
130
+ }
131
+
132
+ .cancelled-modal-content-ul {
133
+ margin-top: 4px;
134
+
135
+ .cancelled-modal-content-li {
136
+ color: var(--Gray-900, #101828);
137
+ font-size: 16px;
138
+ font-style: normal;
139
+ font-weight: 500;
140
+ line-height: 24px;
141
+ }
142
+
143
+ }
144
+
145
+ }
146
+
147
+ .go-payments-footer {
148
+ display: flex;
149
+ align-items: center;
150
+ gap: 12px;
151
+ border-top: 1px solid var(--Gray-200, #EAECF0);
152
+ margin-top: 16px;
153
+ padding: 24px 24px 4px;
154
+ width: 100%;
155
+
156
+ .go-payments-footer-btn {
157
+ flex: 1;
158
+ font-size: 16px;
159
+ font-style: normal;
160
+ font-weight: 600;
161
+ }
162
+
163
+ &.go-payments-footer-column {
164
+ flex-direction: column;
165
+ gap: 12px;
166
+
167
+ .go-payments-footer-btn {
168
+ width: 100%;
169
+ }
170
+ }
171
+
172
+
173
+ }
174
+
66
175
  }
@@ -303,7 +303,9 @@ var Info = function Info(_ref) {
303
303
 
304
304
  // 如果弹窗打开,并且是创建, 则自动打开选择服务的弹窗
305
305
  if (state.modalOpen && !state.bookingId && state.renderType !== 'eventBooking' && ((_state$service4 = state.service) === null || _state$service4 === void 0 ? void 0 : (_state$service4$value = _state$service4.value) === null || _state$service4$value === void 0 ? void 0 : _state$service4$value.length) === 0) {
306
- handleSelectService();
306
+ setTimeout(function () {
307
+ handleSelectService();
308
+ }, 10);
307
309
  }
308
310
  }, [state.modalOpen, state.bookingId, (_state$service5 = state.service) === null || _state$service5 === void 0 ? void 0 : _state$service5.value]);
309
311
  var showAddButton = useMemo(function () {
@@ -560,7 +560,9 @@ var Info = function Info(_, ref) {
560
560
  };
561
561
  }();
562
562
  useEffect(function () {
563
- getResourcesData();
563
+ setTimeout(function () {
564
+ getResourcesData();
565
+ }, 20);
564
566
  }, [state.date.value]);
565
567
 
566
568
  /**
@@ -172,6 +172,20 @@ declare const _default: {
172
172
  list: any[];
173
173
  }) => string;
174
174
  'page.event.booking.text.duplicate-enrollment-confirm': string;
175
+ 'page.booking.text.unconfirmed-payements': string;
176
+ 'page.booking.text.unconfirmed-payements.msg': string;
177
+ 'page.booking.text.go-to-payments': string;
178
+ 'page.booking.text.cancel-only': string;
179
+ 'page.booking.text.refund': string;
180
+ 'page.booking.text.confirm': string;
181
+ 'page.booking.text.go-back': string;
182
+ 'page.booking.text.cancel-booking': string;
183
+ 'page.booking.text.cancel-booking.msg': string;
184
+ 'page.booking.text.disabled-tickets': string;
185
+ 'page.booking.text.paid.msg': (x: string) => string;
186
+ 'page.booking.text.please-choose-an-option': string;
187
+ 'page.booking.text.please-choose-an-option-1': string;
188
+ 'page.booking.text.please-choose-an-option-2': string;
175
189
  };
176
190
  'zh-CN': {
177
191
  'pisell2.text.refunded-amount': string;
@@ -346,6 +360,20 @@ declare const _default: {
346
360
  list: any[];
347
361
  }) => string;
348
362
  'page.event.booking.text.duplicate-enrollment-confirm': string;
363
+ 'page.booking.text.unconfirmed-payements': string;
364
+ 'page.booking.text.unconfirmed-payements.msg': string;
365
+ 'page.booking.text.go-to-payments': string;
366
+ 'page.booking.text.cancel-only': string;
367
+ 'page.booking.text.refund': string;
368
+ 'page.booking.text.confirm': string;
369
+ 'page.booking.text.go-back': string;
370
+ 'page.booking.text.cancel-booking': string;
371
+ 'page.booking.text.cancel-booking.msg': string;
372
+ 'page.booking.text.disabled-tickets': string;
373
+ 'page.booking.text.paid.msg': (x: string) => string;
374
+ 'page.booking.text.please-choose-an-option': string;
375
+ 'page.booking.text.please-choose-an-option-1': string;
376
+ 'page.booking.text.please-choose-an-option-2': string;
349
377
  };
350
378
  'zh-HK': {
351
379
  'pisell2.text.refunded-amount': string;
@@ -520,6 +548,20 @@ declare const _default: {
520
548
  list: any[];
521
549
  }) => string;
522
550
  'page.event.booking.text.duplicate-enrollment-confirm': string;
551
+ 'page.booking.text.unconfirmed-payements': string;
552
+ 'page.booking.text.unconfirmed-payements.msg': string;
553
+ 'page.booking.text.go-to-payments': string;
554
+ 'page.booking.text.cancel-only': string;
555
+ 'page.booking.text.refund': string;
556
+ 'page.booking.text.confirm': string;
557
+ 'page.booking.text.go-back': string;
558
+ 'page.booking.text.cancel-booking': string;
559
+ 'page.booking.text.cancel-booking.msg': string;
560
+ 'page.booking.text.disabled-tickets': string;
561
+ 'page.booking.text.paid.msg': (x: string) => string;
562
+ 'page.booking.text.please-choose-an-option': string;
563
+ 'page.booking.text.please-choose-an-option-1': string;
564
+ 'page.booking.text.please-choose-an-option-2': string;
523
565
  };
524
566
  };
525
567
  export default _default;
@@ -58,7 +58,7 @@ export default {
58
58
  'pisell2.text.status.confirmed': 'Confirmed',
59
59
  'pisell2.text.status.arrived': 'Arrived',
60
60
  'pisell2.text.status.started': 'Started',
61
- 'pisell2.text.status.cancelled': 'Cancelled',
61
+ 'pisell2.text.status.cancelled': 'Cancel',
62
62
  'pisell2.text.status.no_show': 'No show',
63
63
  'pisell2.text.status.completed': 'Completed',
64
64
  'pisell2.text.status.booking_id': 'Booking ID',
@@ -197,7 +197,23 @@ export default {
197
197
  });
198
198
  return "".concat(customerName || '', " has already enrolled in the ").concat(title, " ").concat(listStr.join(','), ", Are you sure you want to enroll again\uFF1F");
199
199
  },
200
- 'page.event.booking.text.duplicate-enrollment-confirm': 'Confirm'
200
+ 'page.event.booking.text.duplicate-enrollment-confirm': 'Confirm',
201
+ 'page.booking.text.unconfirmed-payements': 'Unconfirmed payements',
202
+ 'page.booking.text.unconfirmed-payements.msg': 'There are unconfirmed payments, please confirm or void the payments first.',
203
+ 'page.booking.text.go-to-payments': 'Go to payments',
204
+ 'page.booking.text.cancel-only': 'Cancel only',
205
+ 'page.booking.text.refund': 'Refund',
206
+ 'page.booking.text.confirm': 'Confirm',
207
+ 'page.booking.text.go-back': 'Go back',
208
+ 'page.booking.text.cancel-booking': "Cancel Booking",
209
+ 'page.booking.text.cancel-booking.msg': "The action is irreversible. Please proceed with caution. ",
210
+ 'page.booking.text.disabled-tickets': "All tickets will be disabled.",
211
+ 'page.booking.text.paid.msg': function pageBookingTextPaidMsg(x) {
212
+ return "The related order is ".concat(x === 'paid' ? 'paid' : 'partially paid', ".");
213
+ },
214
+ 'page.booking.text.please-choose-an-option': "Please choose an option:",
215
+ 'page.booking.text.please-choose-an-option-1': "Refund: Cancel the appointment and process a refund.",
216
+ 'page.booking.text.please-choose-an-option-2': "Cancel only: Cancel the appointment without processing a refund. (You can still process a refund after cancellation if needed)"
201
217
  },
202
218
  'zh-CN': {
203
219
  'pisell2.text.refunded-amount': '已退金额',
@@ -265,7 +281,7 @@ export default {
265
281
  'pisell2.text.status.confirmed': '已确认',
266
282
  'pisell2.text.status.arrived': '已到达',
267
283
  'pisell2.text.status.started': '已开始',
268
- 'pisell2.text.status.cancelled': '已取消',
284
+ 'pisell2.text.status.cancelled': '取消',
269
285
  'pisell2.text.status.no_show': '失约',
270
286
  'pisell2.text.status.completed': '已完成',
271
287
  'pisell2.text.status.booking_id': '预约 ID',
@@ -401,7 +417,23 @@ export default {
401
417
  });
402
418
  return "".concat(customerName || '', "\u5DF2\u62A5\u540D").concat(title, " ").concat(listStr.join(','), ", \u786E\u5B9A\u8981\u518D\u6B21\u62A5\u540D\u5417\uFF1F");
403
419
  },
404
- 'page.event.booking.text.duplicate-enrollment-confirm': '确认'
420
+ 'page.event.booking.text.duplicate-enrollment-confirm': '确认',
421
+ 'page.booking.text.unconfirmed-payements': '未确认的付款',
422
+ 'page.booking.text.unconfirmed-payements.msg': '存在未确认的付款,请先确认收款或作废。',
423
+ 'page.booking.text.go-to-payments': '前往收款界面',
424
+ 'page.booking.text.cancel-only': '仅取消',
425
+ 'page.booking.text.refund': '退款',
426
+ 'page.booking.text.confirm': '确认',
427
+ 'page.booking.text.go-back': '返回',
428
+ 'page.booking.text.cancel-booking': "取消预约",
429
+ 'page.booking.text.cancel-booking.msg': "该操作不可撤销,请谨慎操作。",
430
+ 'page.booking.text.disabled-tickets': "所有票单将被禁用。",
431
+ 'page.booking.text.paid.msg': function pageBookingTextPaidMsg(x) {
432
+ return "\u5173\u8054\u8BA2\u5355".concat(x === 'paid' ? '已支付' : '部分支付', "\u3002");
433
+ },
434
+ 'page.booking.text.please-choose-an-option': "请选择:",
435
+ 'page.booking.text.please-choose-an-option-1': "退款:取消预约,同时处理退款。",
436
+ 'page.booking.text.please-choose-an-option-2': "仅取消:仅取消预约,但不进行退款处理。(您仍然可以在取消后再进行退款操作)"
405
437
  },
406
438
  'zh-HK': {
407
439
  'pisell2.text.refunded-amount': '已退金額',
@@ -467,7 +499,7 @@ export default {
467
499
  'pisell2.text.status.confirmed': '已确認',
468
500
  'pisell2.text.status.arrived': '已到達',
469
501
  'pisell2.text.status.started': '已開始',
470
- 'pisell2.text.status.cancelled': '已取消',
502
+ 'pisell2.text.status.cancelled': '取消',
471
503
  'pisell2.text.status.no_show': '失約',
472
504
  'pisell2.text.status.completed': '已完成',
473
505
  'pisell2.text.status.booking_id': '預約 ID',
@@ -605,6 +637,22 @@ export default {
605
637
  });
606
638
  return "".concat(customerName || '', "\u5DF2\u5831\u540D").concat(title, " ").concat(listStr.join(','), ", \u78BA\u5B9A\u8981\u518D\u6B21\u5831\u540D\u55CE\uFF1F");
607
639
  },
608
- 'page.event.booking.text.duplicate-enrollment-confirm': '確認'
640
+ 'page.event.booking.text.duplicate-enrollment-confirm': '確認',
641
+ 'page.booking.text.unconfirmed-payements': '未確認的付款',
642
+ 'page.booking.text.unconfirmed-payements.msg': '存在未確認的付款,請先確認收款或作廢。',
643
+ 'page.booking.text.go-to-payments': '前往收款界面',
644
+ 'page.booking.text.cancel-only': '僅取消',
645
+ 'page.booking.text.refund': '退款',
646
+ 'page.booking.text.confirm': '確認',
647
+ 'page.booking.text.go-back': '返回',
648
+ 'page.booking.text.cancel-booking': '取消預約',
649
+ 'page.booking.text.cancel-booking.msg': '該操作不可撤銷,請謹慎操作。',
650
+ 'page.booking.text.disabled-tickets': '所有票單將被禁用。',
651
+ 'page.booking.text.paid.msg': function pageBookingTextPaidMsg(x) {
652
+ return "\u95DC\u806F\u8A02\u55AE".concat(x === 'paid' ? '已支付' : '部分支付', "\u3002");
653
+ },
654
+ 'page.booking.text.please-choose-an-option': '請選擇:',
655
+ 'page.booking.text.please-choose-an-option-1': '退款:取消預約,同時處理退款。',
656
+ 'page.booking.text.please-choose-an-option-2': '僅取消:僅取消預約,但不進行退款處理。(您仍然可以在取消後再進行退款操作)'
609
657
  }
610
658
  };
@@ -5,5 +5,5 @@ export interface InfoProps {
5
5
  globalState: any;
6
6
  setGlobalState: any;
7
7
  }
8
- declare const Payments: (props: any) => JSX.Element;
8
+ declare const Payments: any;
9
9
  export default Payments;
@@ -13,5 +13,5 @@ export interface InfoProps {
13
13
  setGlobalState: any;
14
14
  }
15
15
  export declare const formatProducts: (values: any) => any;
16
- declare const Addons: import("react").ForwardRefExoticComponent<Pick<any, string | number | symbol> & import("react").RefAttributes<unknown>>;
16
+ declare const Addons: any;
17
17
  export default Addons;
@@ -1,4 +1,4 @@
1
- import React from "react";
2
- import "./index.less";
1
+ import React from 'react';
2
+ import './index.less';
3
3
  declare const ProductItem: ({ item, onClick, amountSymbol, style, className, }: any) => React.JSX.Element;
4
4
  export default ProductItem;
@@ -63,7 +63,8 @@ var ProductItem = ({
63
63
  "img",
64
64
  {
65
65
  src: import_utils.image.ali(item.cover, 100),
66
- className: "server-product-cover"
66
+ className: "server-product-cover",
67
+ loading: "lazy"
67
68
  }
68
69
  ) : null,
69
70
  /* @__PURE__ */ import_react.default.createElement("div", { className: "server-product-content" }, /* @__PURE__ */ import_react.default.createElement(
@@ -5,5 +5,5 @@ export interface InfoProps {
5
5
  globalState: any;
6
6
  setGlobalState: any;
7
7
  }
8
- declare const Forms: import("react").ForwardRefExoticComponent<Pick<any, string | number | symbol> & import("react").RefAttributes<unknown>>;
8
+ declare const Forms: any;
9
9
  export default Forms;
@@ -1,2 +1,2 @@
1
- declare const Booking: import("react").ForwardRefExoticComponent<Pick<any, string | number | symbol> & import("react").RefAttributes<unknown>>;
1
+ declare const Booking: any;
2
2
  export default Booking;
@@ -1,4 +1,4 @@
1
- import React from "react";
2
- import "./index.less";
1
+ import React from 'react';
2
+ import './index.less';
3
3
  declare const header: ({ state, dispatch }: any) => React.JSX.Element;
4
4
  export default header;
@@ -36,9 +36,19 @@ var import_react = __toESM(require("react"));
36
36
  var import_antd = require("antd");
37
37
  var import_utils = require("@pisell/utils");
38
38
  var import_icons = require("@ant-design/icons");
39
+ var import_useEngineContext = __toESM(require("../../../../hooks/useEngineContext"));
39
40
  var import_index = require("./index.less");
41
+ var import_classnames = __toESM(require("classnames"));
40
42
  var header = ({ state, dispatch }) => {
41
- var _a, _b, _c;
43
+ var _a, _b, _c, _d, _e, _f, _g, _h;
44
+ const context = (0, import_useEngineContext.default)();
45
+ const [modalContent, setModalContent] = (0, import_react.useState)({
46
+ open: false,
47
+ children: "",
48
+ footer: null,
49
+ title: /* @__PURE__ */ import_react.default.createElement("div", { className: "", style: { height: 14 } })
50
+ });
51
+ const { isTerminal, interaction, store, storage } = (_a = context.appHelper) == null ? void 0 : _a.utils;
42
52
  const statusList = [
43
53
  {
44
54
  label: import_utils.locales.getText("pisell2.text.status.new"),
@@ -61,12 +71,12 @@ var header = ({ state, dispatch }) => {
61
71
  color: "#155EEF"
62
72
  },
63
73
  {
64
- label: import_utils.locales.getText("pisell2.text.status.cancelled"),
74
+ label: /* @__PURE__ */ import_react.default.createElement("span", { style: { color: "#D92D20" } }, import_utils.locales.getText("pisell2.text.status.cancelled")),
65
75
  key: "cancelled",
66
76
  color: "#DC6803"
67
77
  },
68
78
  {
69
- label: import_utils.locales.getText("pisell2.text.status.no_show"),
79
+ label: /* @__PURE__ */ import_react.default.createElement("span", { style: { color: "#D92D20" } }, import_utils.locales.getText("pisell2.text.status.no_show")),
70
80
  key: "no_show",
71
81
  color: "#D92D20"
72
82
  },
@@ -80,7 +90,9 @@ var header = ({ state, dispatch }) => {
80
90
  online_store: import_utils.locales.getText("pisell2.text.order.sales.channel.online"),
81
91
  pos: import_utils.locales.getText("pisell2.text.order.sales.channel.pos-terminal"),
82
92
  boxlocal: import_utils.locales.getText("pisell2.text.order.sales.channel.boxcocal"),
83
- "table-order": import_utils.locales.getText("pisell2.text.order.sales.channel.tableorder"),
93
+ "table-order": import_utils.locales.getText(
94
+ "pisell2.text.order.sales.channel.tableorder"
95
+ ),
84
96
  google_reserve: import_utils.locales.getText("pisell2.text.order.sales.channel.reserve")
85
97
  };
86
98
  const getStatusMap = () => {
@@ -91,13 +103,14 @@ var header = ({ state, dispatch }) => {
91
103
  return obj;
92
104
  };
93
105
  const statusMps = getStatusMap();
94
- const items = statusList;
106
+ const items = (0, import_react.useMemo)(() => {
107
+ return statusList.filter((item) => item.key !== state.appointment_status);
108
+ }, [statusList]);
95
109
  const currentStatus = (0, import_react.useMemo)(() => {
96
110
  let status = state.appointment_status;
97
111
  return statusMps[status] || statusMps["new"];
98
112
  }, [state.appointment_status]);
99
- const onSelect = async (e) => {
100
- const status = e.key;
113
+ const setBookingStatus = async (status) => {
101
114
  dispatch({
102
115
  type: "setStatus",
103
116
  payload: status
@@ -108,14 +121,202 @@ var header = ({ state, dispatch }) => {
108
121
  import_antd.message.success(import_utils.locales.getText("pisell1.text.edit-status-success"));
109
122
  state == null ? void 0 : state.callback({ order_id: state.bookingId });
110
123
  };
111
- return /* @__PURE__ */ import_react.default.createElement(
124
+ const onSelect = async (e) => {
125
+ if (e.key === "cancelled") {
126
+ handleCancel();
127
+ return;
128
+ }
129
+ await setBookingStatus(e.key);
130
+ };
131
+ const setModalContentState = (values) => {
132
+ setModalContent({ ...modalContent, ...values });
133
+ };
134
+ const goCheckout = async () => {
135
+ var _a2, _b2;
136
+ if (isTerminal == null ? void 0 : isTerminal()) {
137
+ return (_b2 = (_a2 = interaction == null ? void 0 : interaction.utils) == null ? void 0 : _a2.postMessageToApp) == null ? void 0 : _b2.call(_a2, {
138
+ module: "booking",
139
+ key: "booking_checkout",
140
+ data: {
141
+ order_id: state.bookingId
142
+ }
143
+ });
144
+ }
145
+ state.action({
146
+ type: "pisell1.handlePayment",
147
+ data: {
148
+ orderId: state.bookingId
149
+ },
150
+ callback: () => {
151
+ state == null ? void 0 : state.callback();
152
+ }
153
+ });
154
+ };
155
+ const isPaid = (0, import_react.useMemo)(() => {
156
+ return ["partially_paid", "paid"].find(
157
+ (d) => {
158
+ var _a2;
159
+ return d === ((_a2 = state.bookingDetail) == null ? void 0 : _a2.payment_status);
160
+ }
161
+ );
162
+ }, [(_b = state.bookingDetail) == null ? void 0 : _b.payment_status]);
163
+ const isTicket = (0, import_react.useMemo)(() => {
164
+ var _a2;
165
+ return (((_a2 = state.service) == null ? void 0 : _a2.value) || []).some(
166
+ (d) => ["appointment_ticket", "product_package_ticket", "ticket"].includes(
167
+ d.extension_type
168
+ )
169
+ );
170
+ }, [(_c = state.service) == null ? void 0 : _c.value]);
171
+ const isPaymentProcessingPayments = (0, import_react.useMemo)(() => {
172
+ var _a2;
173
+ return !!((_a2 = state.bookingDetail) == null ? void 0 : _a2.payment_processing_payment_nums);
174
+ }, [(_e = (_d = state.bookingDetail) == null ? void 0 : _d.payment_processing_payments) == null ? void 0 : _e.length]);
175
+ const handleCancel = () => {
176
+ if (isPaymentProcessingPayments) {
177
+ return showPaymentModal();
178
+ }
179
+ return showCancelledModal();
180
+ };
181
+ const handleRefund = () => {
182
+ var _a2, _b2;
183
+ if (isTerminal == null ? void 0 : isTerminal()) {
184
+ return (_b2 = (_a2 = interaction == null ? void 0 : interaction.utils) == null ? void 0 : _a2.postMessageToApp) == null ? void 0 : _b2.call(_a2, {
185
+ module: "booking",
186
+ key: "booking_refund",
187
+ data: {
188
+ order_id: state.bookingId
189
+ },
190
+ origin: "/booking"
191
+ });
192
+ }
193
+ state.action({
194
+ type: "pisell1.handleRefund",
195
+ data: {
196
+ orderId: state.bookingId
197
+ },
198
+ callback: () => {
199
+ state == null ? void 0 : state.callback({ order_id: state.bookingId });
200
+ }
201
+ });
202
+ };
203
+ const showPaymentModal = () => {
204
+ setModalContentState({
205
+ className: "go-payments-modal-wrap",
206
+ open: true,
207
+ width: 480,
208
+ onCancel: () => {
209
+ setModalContentState({ open: false });
210
+ },
211
+ children: /* @__PURE__ */ import_react.default.createElement("div", { className: "go-payments-modal-content" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "go-payments-modal-content-title" }, import_utils.locales.getText("page.booking.text.unconfirmed-payements")), /* @__PURE__ */ import_react.default.createElement("div", { className: "go-payments-modal-content-desc" }, import_utils.locales.getText("page.booking.text.unconfirmed-payements.msg")), /* @__PURE__ */ import_react.default.createElement("div", { className: "go-payments-footer" }, /* @__PURE__ */ import_react.default.createElement(
212
+ import_antd.Button,
213
+ {
214
+ className: "go-payments-footer-btn",
215
+ size: "large",
216
+ onClick: () => {
217
+ setModalContentState({ open: false });
218
+ }
219
+ },
220
+ import_utils.locales.getText("pisell2.text.status.cancelled")
221
+ ), /* @__PURE__ */ import_react.default.createElement(
222
+ import_antd.Button,
223
+ {
224
+ className: "go-payments-footer-btn",
225
+ type: "primary",
226
+ size: "large",
227
+ onClick: () => {
228
+ goCheckout();
229
+ setModalContentState({ open: false });
230
+ }
231
+ },
232
+ import_utils.locales.getText("page.booking.text.go-to-payments")
233
+ ))),
234
+ footer: null
235
+ });
236
+ };
237
+ const showCancelledModal = () => {
238
+ const cancelBtn = /* @__PURE__ */ import_react.default.createElement(
239
+ import_antd.Button,
240
+ {
241
+ className: "go-payments-footer-btn",
242
+ size: "large",
243
+ type: "primary",
244
+ onClick: () => {
245
+ setBookingStatus("cancelled");
246
+ setModalContentState({ open: false });
247
+ }
248
+ },
249
+ import_utils.locales.getText("page.booking.text.cancel-only")
250
+ );
251
+ const refundBtn = /* @__PURE__ */ import_react.default.createElement(
252
+ import_antd.Button,
253
+ {
254
+ className: "go-payments-footer-btn",
255
+ size: "large",
256
+ danger: true,
257
+ ghost: true,
258
+ onClick: () => {
259
+ handleRefund();
260
+ setModalContentState({ open: false });
261
+ }
262
+ },
263
+ import_utils.locales.getText("page.booking.text.refund")
264
+ );
265
+ const okBtn = /* @__PURE__ */ import_react.default.createElement(
266
+ import_antd.Button,
267
+ {
268
+ className: "go-payments-footer-btn",
269
+ size: "large",
270
+ type: "primary",
271
+ onClick: () => {
272
+ setBookingStatus("cancelled");
273
+ setModalContentState({ open: false });
274
+ }
275
+ },
276
+ import_utils.locales.getText("page.booking.text.confirm")
277
+ );
278
+ const backBtn = /* @__PURE__ */ import_react.default.createElement(
279
+ import_antd.Button,
280
+ {
281
+ className: "go-payments-footer-btn",
282
+ size: "large",
283
+ onClick: () => {
284
+ setModalContentState({ open: false });
285
+ }
286
+ },
287
+ import_utils.locales.getText("page.booking.text.go-back")
288
+ );
289
+ setModalContentState({
290
+ className: "go-payments-modal-wrap",
291
+ open: true,
292
+ width: 480,
293
+ onCancel: () => {
294
+ setModalContentState({ open: false });
295
+ },
296
+ children: /* @__PURE__ */ import_react.default.createElement("div", { className: "go-payments-modal-content" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "cancelled-modal-content-title" }, import_utils.locales.getText("page.booking.text.cancel-booking")), /* @__PURE__ */ import_react.default.createElement("div", { className: "cancelled-modal-content-desc cancelled-modal-content-desc-red" }, import_utils.locales.getText("page.booking.text.cancel-booking.msg")), isTicket ? /* @__PURE__ */ import_react.default.createElement("div", { className: "cancelled-modal-content-desc" }, import_utils.locales.getText("page.booking.text.disabled-tickets")) : null, isPaid ? /* @__PURE__ */ import_react.default.createElement("div", { className: "cancelled-modal-content-list-wrap" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "cancelled-modal-content-list-title" }, import_utils.locales.getText("page.booking.text.paid.msg")(isPaid), " ", import_utils.locales.getText("page.booking.text.please-choose-an-option")), /* @__PURE__ */ import_react.default.createElement("ul", { className: "cancelled-modal-content-ul" }, /* @__PURE__ */ import_react.default.createElement("li", { className: "cancelled-modal-content-li" }, import_utils.locales.getText(
297
+ "page.booking.text.please-choose-an-option-2"
298
+ )), /* @__PURE__ */ import_react.default.createElement("li", { className: "cancelled-modal-content-li" }, import_utils.locales.getText(
299
+ "page.booking.text.please-choose-an-option-1"
300
+ )))) : null, /* @__PURE__ */ import_react.default.createElement(
301
+ "div",
302
+ {
303
+ className: (0, import_classnames.default)("go-payments-footer", {
304
+ "go-payments-footer-column": isPaid
305
+ })
306
+ },
307
+ isPaid ? /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, cancelBtn, refundBtn, backBtn) : /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, backBtn, okBtn)
308
+ )),
309
+ footer: null
310
+ });
311
+ };
312
+ return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
112
313
  "div",
113
314
  {
114
315
  className: "booking-header",
115
316
  style: { backgroundColor: currentStatus.color }
116
317
  },
117
- /* @__PURE__ */ import_react.default.createElement("div", { className: "booking-order-sales-channel" }, orderSalesChannel[(_a = state.bookingDetail) == null ? void 0 : _a.order_sales_channel] || ""),
118
- /* @__PURE__ */ import_react.default.createElement("div", { className: "booking-header-line-2" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "booking-header-left" }, import_utils.locales.getText("pisell2.text.status.booking_id"), ":", " ", ((_c = (_b = state.bookingDetail) == null ? void 0 : _b.bookings) == null ? void 0 : _c.booking_id) || "-"), /* @__PURE__ */ import_react.default.createElement("div", { className: "booking-header-right" }, /* @__PURE__ */ import_react.default.createElement(
318
+ /* @__PURE__ */ import_react.default.createElement("div", { className: "booking-order-sales-channel" }, orderSalesChannel[(_f = state.bookingDetail) == null ? void 0 : _f.order_sales_channel] || ""),
319
+ /* @__PURE__ */ import_react.default.createElement("div", { className: "booking-header-line-2" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "booking-header-left" }, import_utils.locales.getText("pisell2.text.status.booking_id"), ":", " ", ((_h = (_g = state.bookingDetail) == null ? void 0 : _g.bookings) == null ? void 0 : _h.booking_id) || "-"), /* @__PURE__ */ import_react.default.createElement("div", { className: "booking-header-right" }, /* @__PURE__ */ import_react.default.createElement(
119
320
  import_antd.Dropdown,
120
321
  {
121
322
  menu: { items, onClick: onSelect },
@@ -123,6 +324,6 @@ var header = ({ state, dispatch }) => {
123
324
  },
124
325
  /* @__PURE__ */ import_react.default.createElement("div", { className: "booking-header-right-status" }, currentStatus.label, state.appointment_status !== "cancelled" ? /* @__PURE__ */ import_react.default.createElement(import_icons.DownOutlined, { className: "booking-header-right-status-icon" }) : null)
125
326
  )))
126
- );
327
+ ), /* @__PURE__ */ import_react.default.createElement(import_antd.Modal, { ...modalContent }));
127
328
  };
128
329
  var header_default = header;