@jingx/lottery-components-react-jsx 1.0.29 → 1.0.30

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.esm.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import React__default, { forwardRef, Component, useRef, useState, useEffect, useLayoutEffect, useMemo, memo, useCallback, useContext, createContext as createContext$1, Fragment } from 'react';
2
+ import React__default, { forwardRef, Component, useRef, useState, useEffect, useLayoutEffect, useMemo, memo, useCallback, useContext, createContext as createContext$1, Fragment, isValidElement } from 'react';
3
3
  import ReactDOM, { createPortal } from 'react-dom';
4
4
 
5
5
  function styleInject(css, ref) {
@@ -32097,8 +32097,8 @@ function transformPostCode(posts, postCodeMap) {
32097
32097
  }
32098
32098
 
32099
32099
  var __defProp$a = Object.defineProperty;
32100
- var __defProps$2 = Object.defineProperties;
32101
- var __getOwnPropDescs$2 = Object.getOwnPropertyDescriptors;
32100
+ var __defProps$3 = Object.defineProperties;
32101
+ var __getOwnPropDescs$3 = Object.getOwnPropertyDescriptors;
32102
32102
  var __getOwnPropSymbols$b = Object.getOwnPropertySymbols;
32103
32103
  var __hasOwnProp$b = Object.prototype.hasOwnProperty;
32104
32104
  var __propIsEnum$b = Object.prototype.propertyIsEnumerable;
@@ -32114,7 +32114,7 @@ var __spreadValues$a = (a, b) => {
32114
32114
  }
32115
32115
  return a;
32116
32116
  };
32117
- var __spreadProps$2 = (a, b) => __defProps$2(a, __getOwnPropDescs$2(b));
32117
+ var __spreadProps$3 = (a, b) => __defProps$3(a, __getOwnPropDescs$3(b));
32118
32118
  const KPPostCode = {
32119
32119
  A: "\u179B\u17E1",
32120
32120
  F: "\u179B\u17E2",
@@ -32173,7 +32173,7 @@ const lotteryLabel = {
32173
32173
  HOSO: "\u1786\u17D2\u1793\u17C4\u178F HOSO",
32174
32174
  KP: "\u1780\u17C6\u1796\u178F KP"
32175
32175
  };
32176
- const lotteryLabelVN = __spreadProps$2(__spreadValues$a({}, lotteryLabel), {
32176
+ const lotteryLabelVN = __spreadProps$3(__spreadValues$a({}, lotteryLabel), {
32177
32177
  VN1: "\u1786\u17D2\u1793\u17C4\u178F\u1799\u17BD\u1793",
32178
32178
  TN: "\u1786\u17D2\u1793\u17C4\u178F\u1799\u17BD\u1793",
32179
32179
  KH: "\u1786\u17D2\u1793\u17C4\u178F\u1781\u17D2\u1798\u17C2\u179A"
@@ -38741,7 +38741,7 @@ const ProtestTicket = ({
38741
38741
  });
38742
38742
  };
38743
38743
  return /* @__PURE__ */ jsxRuntimeExports.jsx(ScopeHost, { children: /* @__PURE__ */ jsxRuntimeExports.jsx("table", { id: "transfer-ticket-58", className: "print-tb-58-1", cellPadding: "7px", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("tbody", { children: [
38744
- /* @__PURE__ */ jsxRuntimeExports.jsx("tr", { style: { lineHeight: "35px" }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
38744
+ /* @__PURE__ */ jsxRuntimeExports.jsx("tr", { style: { lineHeight: "35px" }, className: "no-hover", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
38745
38745
  RenderTitle,
38746
38746
  {
38747
38747
  className: "text-center ticket-logo pt-2 mt-1 p-0",
@@ -38751,8 +38751,8 @@ const ProtestTicket = ({
38751
38751
  logo
38752
38752
  }
38753
38753
  ) }),
38754
- /* @__PURE__ */ jsxRuntimeExports.jsx("tr", { children: /* @__PURE__ */ jsxRuntimeExports.jsx("td", { className: "p-0 pt-2", colSpan: 3, children: /* @__PURE__ */ jsxRuntimeExports.jsx("hr", { className: "border-top-ticket" }) }) }),
38755
- /* @__PURE__ */ jsxRuntimeExports.jsx("tr", { children: /* @__PURE__ */ jsxRuntimeExports.jsx("td", { className: "p-0 pt-2 text-black font-weight-bold", colSpan: 3, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-center", children: [
38754
+ /* @__PURE__ */ jsxRuntimeExports.jsx("tr", { className: "no-hover", children: /* @__PURE__ */ jsxRuntimeExports.jsx("td", { className: "p-0 pt-2", colSpan: 3, children: /* @__PURE__ */ jsxRuntimeExports.jsx("hr", { className: "border-top-ticket" }) }) }),
38755
+ /* @__PURE__ */ jsxRuntimeExports.jsx("tr", { className: "no-hover", children: /* @__PURE__ */ jsxRuntimeExports.jsx("td", { className: "p-0 pt-2 text-black font-weight-bold", colSpan: 3, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-center", children: [
38756
38756
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "f-16", children: [
38757
38757
  object == null ? void 0 : object.username,
38758
38758
  " / #",
@@ -38760,8 +38760,8 @@ const ProtestTicket = ({
38760
38760
  ] }),
38761
38761
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "f-16", children: getDateTime(object == null ? void 0 : object.drawAt) })
38762
38762
  ] }) }) }),
38763
- /* @__PURE__ */ jsxRuntimeExports.jsx("tr", { children: /* @__PURE__ */ jsxRuntimeExports.jsx("td", { className: "p-0 pb-2", colSpan: 3, children: /* @__PURE__ */ jsxRuntimeExports.jsx("hr", { className: "border-top-ticket" }) }) }),
38764
- /* @__PURE__ */ jsxRuntimeExports.jsx("tr", { children: /* @__PURE__ */ jsxRuntimeExports.jsx("td", { colSpan: 3, className: "p-0 text-left", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("label", { className: "m-0 d-inline-flex align-items-center text-black", children: [
38763
+ /* @__PURE__ */ jsxRuntimeExports.jsx("tr", { className: "no-hover", children: /* @__PURE__ */ jsxRuntimeExports.jsx("td", { className: "p-0 pb-2", colSpan: 3, children: /* @__PURE__ */ jsxRuntimeExports.jsx("hr", { className: "border-top-ticket" }) }) }),
38764
+ /* @__PURE__ */ jsxRuntimeExports.jsx("tr", { className: "no-hover", children: /* @__PURE__ */ jsxRuntimeExports.jsx("td", { colSpan: 3, className: "p-0 text-left", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("label", { className: "m-0 d-inline-flex align-items-center text-black", children: [
38765
38765
  /* @__PURE__ */ jsxRuntimeExports.jsx(
38766
38766
  "input",
38767
38767
  {
@@ -38775,7 +38775,7 @@ const ProtestTicket = ({
38775
38775
  ),
38776
38776
  /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "ml-2 f-16", children: "Check all" })
38777
38777
  ] }) }) }),
38778
- /* @__PURE__ */ jsxRuntimeExports.jsx("tr", { children: /* @__PURE__ */ jsxRuntimeExports.jsx("td", { colSpan: 3, className: "p-0", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
38778
+ /* @__PURE__ */ jsxRuntimeExports.jsx("tr", { className: "no-hover", children: /* @__PURE__ */ jsxRuntimeExports.jsx("td", { colSpan: 3, className: "p-0", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
38779
38779
  PrintTicket58,
38780
38780
  {
38781
38781
  isNight,
@@ -38788,7 +38788,7 @@ const ProtestTicket = ({
38788
38788
  isProtest
38789
38789
  }
38790
38790
  ) }) }),
38791
- /* @__PURE__ */ jsxRuntimeExports.jsx("tr", { children: /* @__PURE__ */ jsxRuntimeExports.jsx("td", { colSpan: 3, children: /* @__PURE__ */ jsxRuntimeExports.jsx("hr", { className: "border-top-ticket" }) }) })
38791
+ /* @__PURE__ */ jsxRuntimeExports.jsx("tr", { className: "no-hover", children: /* @__PURE__ */ jsxRuntimeExports.jsx("td", { colSpan: 3, children: /* @__PURE__ */ jsxRuntimeExports.jsx("hr", { className: "border-top-ticket" }) }) })
38792
38792
  ] }) }) });
38793
38793
  };
38794
38794
 
@@ -38855,8 +38855,8 @@ const BasePrinter = (_a) => {
38855
38855
  };
38856
38856
 
38857
38857
  var __defProp$8 = Object.defineProperty;
38858
- var __defProps$1 = Object.defineProperties;
38859
- var __getOwnPropDescs$1 = Object.getOwnPropertyDescriptors;
38858
+ var __defProps$2 = Object.defineProperties;
38859
+ var __getOwnPropDescs$2 = Object.getOwnPropertyDescriptors;
38860
38860
  var __getOwnPropSymbols$8 = Object.getOwnPropertySymbols;
38861
38861
  var __hasOwnProp$8 = Object.prototype.hasOwnProperty;
38862
38862
  var __propIsEnum$8 = Object.prototype.propertyIsEnumerable;
@@ -38872,7 +38872,7 @@ var __spreadValues$8 = (a, b) => {
38872
38872
  }
38873
38873
  return a;
38874
38874
  };
38875
- var __spreadProps$1 = (a, b) => __defProps$1(a, __getOwnPropDescs$1(b));
38875
+ var __spreadProps$2 = (a, b) => __defProps$2(a, __getOwnPropDescs$2(b));
38876
38876
  var __objRest$4 = (source, exclude) => {
38877
38877
  var target = {};
38878
38878
  for (var prop in source)
@@ -38889,7 +38889,7 @@ const Printer = (_a) => {
38889
38889
  var _b = _a, { children } = _b, props = __objRest$4(_b, ["children"]);
38890
38890
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
38891
38891
  BasePrinter,
38892
- __spreadProps$1(__spreadValues$8({
38892
+ __spreadProps$2(__spreadValues$8({
38893
38893
  component: /* @__PURE__ */ jsxRuntimeExports.jsx(Ticket, __spreadValues$8({}, props))
38894
38894
  }, props), {
38895
38895
  children: children != null ? children : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "btn btn-primary", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
@@ -47151,8 +47151,8 @@ const PostTable = memo(({ data = [], fallbackTwo = "", fallbackThree = "", usePo
47151
47151
  });
47152
47152
 
47153
47153
  var __defProp$5 = Object.defineProperty;
47154
- var __defProps = Object.defineProperties;
47155
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
47154
+ var __defProps$1 = Object.defineProperties;
47155
+ var __getOwnPropDescs$1 = Object.getOwnPropertyDescriptors;
47156
47156
  var __getOwnPropSymbols$5 = Object.getOwnPropertySymbols;
47157
47157
  var __hasOwnProp$5 = Object.prototype.hasOwnProperty;
47158
47158
  var __propIsEnum$5 = Object.prototype.propertyIsEnumerable;
@@ -47168,8 +47168,8 @@ var __spreadValues$5 = (a, b) => {
47168
47168
  }
47169
47169
  return a;
47170
47170
  };
47171
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
47172
- const loCellStyle = __spreadProps(__spreadValues$5({}, baseCellStyle), {
47171
+ var __spreadProps$1 = (a, b) => __defProps$1(a, __getOwnPropDescs$1(b));
47172
+ const loCellStyle = __spreadProps$1(__spreadValues$5({}, baseCellStyle), {
47173
47173
  width: "200px"
47174
47174
  });
47175
47175
  const LoTable = memo(({ LO = [], columnsCount = 3, showHeader = false }) => {
@@ -47181,7 +47181,7 @@ const LoTable = memo(({ LO = [], columnsCount = 3, showHeader = false }) => {
47181
47181
  "th",
47182
47182
  {
47183
47183
  className: "text-black text-center bg-light-red",
47184
- style: __spreadProps(__spreadValues$5({}, loCellStyle), { fontSize: "16px" }),
47184
+ style: __spreadProps$1(__spreadValues$5({}, loCellStyle), { fontSize: "16px" }),
47185
47185
  children: KPLO[col.columnNumber]
47186
47186
  },
47187
47187
  idx
@@ -59039,7 +59039,7 @@ var __objRest$2 = (source, exclude) => {
59039
59039
  const DEFAULT_API_BASE_URL$3 = "https://api-web.dev.lottery.aazz168.com/";
59040
59040
  function DeleteModal(_a) {
59041
59041
  var _b = _a, {
59042
- object,
59042
+ ticket,
59043
59043
  isOpen = false,
59044
59044
  onClose,
59045
59045
  onChange,
@@ -59050,7 +59050,7 @@ function DeleteModal(_a) {
59050
59050
  accessToken,
59051
59051
  isRemoveReason
59052
59052
  } = _b; __objRest$2(_b, [
59053
- "object",
59053
+ "ticket",
59054
59054
  "isOpen",
59055
59055
  "onClose",
59056
59056
  "onChange",
@@ -59072,7 +59072,7 @@ function DeleteModal(_a) {
59072
59072
  "X-DeviceType": "WEB"
59073
59073
  }, token ? { Authorization: `Bearer ${token}` } : {});
59074
59074
  useEffect(() => {
59075
- if (!object) return void 0;
59075
+ if (!ticket) return void 0;
59076
59076
  setSelectedReason(null);
59077
59077
  const fetchReasons = async () => {
59078
59078
  var _a2, _b2, _c;
@@ -59101,7 +59101,7 @@ function DeleteModal(_a) {
59101
59101
  }
59102
59102
  };
59103
59103
  fetchReasons();
59104
- }, [Env.REACT_APP_API_BASE_URL, Env.REACT_APP_BASIC_TOKEN, object]);
59104
+ }, [Env.REACT_APP_API_BASE_URL, Env.REACT_APP_BASIC_TOKEN, ticket]);
59105
59105
  const handleReasonChange = (option) => {
59106
59106
  setSelectedReason(option);
59107
59107
  if (typeof onChange === "function") {
@@ -59120,8 +59120,8 @@ function DeleteModal(_a) {
59120
59120
  try {
59121
59121
  setIsSubmitting(true);
59122
59122
  const payload = {
59123
- lotteryType: object == null ? void 0 : object.lotteryType,
59124
- ticketNumber: object == null ? void 0 : object.ticketNumber,
59123
+ lotteryType: ticket == null ? void 0 : ticket.lotteryType,
59124
+ ticketNumber: ticket == null ? void 0 : ticket.ticketNumber,
59125
59125
  message: (_a2 = selectedReason == null ? void 0 : selectedReason.value) != null ? _a2 : ""
59126
59126
  };
59127
59127
  const res = await axios$1.delete(
@@ -59152,58 +59152,71 @@ function DeleteModal(_a) {
59152
59152
  setIsSubmitting(false);
59153
59153
  }
59154
59154
  };
59155
- if (!object) return null;
59156
- return /* @__PURE__ */ jsxRuntimeExports.jsx(ScopeHost, { children: (container) => container && /* @__PURE__ */ jsxRuntimeExports.jsx(
59157
- Modal,
59158
- {
59159
- isOpen,
59160
- toggle: onClose,
59161
- container,
59162
- backdropClassName: "modal-backdrop",
59163
- modalClassName: "modal scroll-modal",
59164
- contentClassName: "",
59165
- style: { width: 380 },
59166
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(ModalBody, { className: "d-inline-flex justify-content-center p-0 font-Hanuman", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "w-75", children: [
59167
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-center", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
59168
- FeatherIcon,
59169
- {
59170
- icon: "alert-circle",
59171
- className: "text-warning px-1",
59172
- style: { width: 110, height: 110, marginTop: 20, marginBottom: 0 }
59173
- }
59174
- ) }),
59175
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "f-25 text-center mb-2", style: { color: "#000000a6" }, children: "\u178F\u17BE\u17A2\u17D2\u1793\u1780\u1794\u17D2\u179A\u17B6\u1780\u178A\u17AC\u17A2\u178F\u17CB?" }),
59176
- isRemoveReason && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
59177
- StateManagedSelect$1,
59178
- {
59179
- options,
59180
- value: selectedReason,
59181
- isLoading,
59182
- isDisabled: isLoading || isSubmitting || externalSubmitting,
59183
- onChange: handleReasonChange,
59184
- placeholder: "\u1798\u17BC\u179B\u17A0\u17C1\u178F\u17BB \u179B\u17BB\u1794..."
59185
- }
59186
- ) }),
59187
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "my-3 d-flex justify-content-center", children: [
59188
- /* @__PURE__ */ jsxRuntimeExports.jsx("button", { type: "button", className: "btn-cancel", onClick: onClose, children: "\u1791\u17C1" }),
59189
- /* @__PURE__ */ jsxRuntimeExports.jsx(
59190
- "button",
59155
+ if (!ticket) return null;
59156
+ console.log(ticket, "ticket");
59157
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(ScopeHost, { children: (container) => {
59158
+ var _a2, _b2;
59159
+ return container && /* @__PURE__ */ jsxRuntimeExports.jsx(
59160
+ Modal,
59161
+ {
59162
+ isOpen,
59163
+ toggle: onClose,
59164
+ container,
59165
+ backdropClassName: "modal-backdrop",
59166
+ modalClassName: "modal scroll-modal",
59167
+ contentClassName: "",
59168
+ style: { width: 380 },
59169
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(ModalBody, { className: "d-inline-flex justify-content-center p-0 font-Hanuman", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "w-75", children: [
59170
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-center", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
59171
+ FeatherIcon,
59191
59172
  {
59192
- type: "button",
59193
- className: "btn-confirm ml-3",
59194
- onClick: handleConfirm,
59195
- disabled: isLoading || isSubmitting || externalSubmitting,
59196
- children: "\u1794\u17B6\u1791/\u1785\u17B6\u179F\u17CE"
59173
+ icon: "alert-circle",
59174
+ className: "text-warning px-1",
59175
+ style: { width: 110, height: 110, marginTop: 20, marginBottom: 0 }
59197
59176
  }
59198
- )
59199
- ] })
59200
- ] }) })
59201
- }
59202
- ) });
59177
+ ) }),
59178
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "f-25 text-center mb-0", style: { color: "#000000a6" }, children: "\u178F\u17BE\u17A2\u17D2\u1793\u1780\u1794\u17D2\u179A\u17B6\u1780\u178A\u17AC\u17A2\u178F\u17CB?" }),
59179
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "f-14 text-center mb-2 text-danger", children: [
59180
+ "\u179B\u17BB\u1794\u179F\u17C6\u1794\u17BB\u178F\u17D2\u179A #",
59181
+ ticket.ticketNumber,
59182
+ " = ",
59183
+ moneyFormatter((_a2 = ticket.totalKhr) == null ? void 0 : _a2.betAmount, "KHR"),
59184
+ "/",
59185
+ moneyFormatter((_b2 = ticket.totalUsd) == null ? void 0 : _b2.betAmount, "USD")
59186
+ ] }),
59187
+ isRemoveReason && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
59188
+ StateManagedSelect$1,
59189
+ {
59190
+ options,
59191
+ value: selectedReason,
59192
+ isLoading,
59193
+ isDisabled: isLoading || isSubmitting || externalSubmitting,
59194
+ onChange: handleReasonChange,
59195
+ placeholder: "\u1798\u17BC\u179B\u17A0\u17C1\u178F\u17BB \u179B\u17BB\u1794..."
59196
+ }
59197
+ ) }),
59198
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "my-3 d-flex justify-content-center", children: [
59199
+ /* @__PURE__ */ jsxRuntimeExports.jsx("button", { type: "button", className: "btn-cancel", onClick: onClose, children: "\u1791\u17C1" }),
59200
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
59201
+ "button",
59202
+ {
59203
+ type: "button",
59204
+ className: "btn-confirm ml-3",
59205
+ onClick: handleConfirm,
59206
+ disabled: isLoading || isSubmitting || externalSubmitting,
59207
+ children: "\u1794\u17B6\u1791/\u1785\u17B6\u179F\u17CE"
59208
+ }
59209
+ )
59210
+ ] })
59211
+ ] }) })
59212
+ }
59213
+ );
59214
+ } });
59203
59215
  }
59204
59216
  DeleteModal.propTypes = {
59205
- object: PropTypes$2.object,
59217
+ ticket: PropTypes$2.object,
59206
59218
  isOpen: PropTypes$2.bool,
59219
+ isRemoveReason: PropTypes$2.bool.isRequired,
59207
59220
  onClose: PropTypes$2.func.isRequired,
59208
59221
  Env: PropTypes$2.object.isRequired,
59209
59222
  accessToken: PropTypes$2.string.isRequired
@@ -59230,7 +59243,7 @@ function DeleteTicketButton(props) {
59230
59243
  id,
59231
59244
  onOpen,
59232
59245
  Env,
59233
- object,
59246
+ ticket,
59234
59247
  onClose,
59235
59248
  accessToken,
59236
59249
  onChange,
@@ -59278,7 +59291,7 @@ function DeleteTicketButton(props) {
59278
59291
  DeleteModal,
59279
59292
  {
59280
59293
  Env,
59281
- object,
59294
+ ticket,
59282
59295
  isOpen,
59283
59296
  onClose: handleClose,
59284
59297
  accessToken,
@@ -59294,7 +59307,7 @@ DeleteTicketButton.propTypes = {
59294
59307
  id: PropTypes$2.string.isRequired,
59295
59308
  onOpen: PropTypes$2.func.isRequired,
59296
59309
  Env: PropTypes$2.object.isRequired,
59297
- object: PropTypes$2.object,
59310
+ ticket: PropTypes$2.object,
59298
59311
  onClose: PropTypes$2.func.isRequired,
59299
59312
  isOpen: PropTypes$2.bool,
59300
59313
  isRemoveReason: PropTypes$2.bool.isRequired,
@@ -59599,6 +59612,7 @@ const DEFAULT_API_BASE_URL$1 = "https://api-web.dev.lottery.aazz168.com/";
59599
59612
  function RemarkModal(_a) {
59600
59613
  var _b = _a, {
59601
59614
  object,
59615
+ ticket,
59602
59616
  onClose,
59603
59617
  onChange,
59604
59618
  onSuccess,
@@ -59608,6 +59622,7 @@ function RemarkModal(_a) {
59608
59622
  accessToken
59609
59623
  } = _b; __objRest$1(_b, [
59610
59624
  "object",
59625
+ "ticket",
59611
59626
  "onClose",
59612
59627
  "onChange",
59613
59628
  "onSuccess",
@@ -59619,6 +59634,10 @@ function RemarkModal(_a) {
59619
59634
  const [remark, setRemark] = useState("");
59620
59635
  const [loadError, setLoadError] = useState("");
59621
59636
  const [isSubmitting, setIsSubmitting] = useState(false);
59637
+ useEffect(() => {
59638
+ var _a2;
59639
+ setRemark((_a2 = ticket == null ? void 0 : ticket.remark) != null ? _a2 : "");
59640
+ }, [ticket]);
59622
59641
  const token = accessToken || localStorage.getItem("accessToken") || sessionStorage.getItem("accessToken");
59623
59642
  const headers = __spreadValues$1({
59624
59643
  "Content-Type": "application/json",
@@ -59637,7 +59656,7 @@ function RemarkModal(_a) {
59637
59656
  }
59638
59657
  };
59639
59658
  const handleConfirm = async () => {
59640
- var _a2, _b2;
59659
+ var _a2, _b2, _c;
59641
59660
  if (!remark) return setLoadError("\u179F\u17BC\u1798\u1794\u1789\u17D2\u1785\u17BC\u179B\u1780\u17C6\u178E\u178F\u17CB\u179F\u1798\u17D2\u1782\u17B6\u179B\u17CB!");
59642
59661
  try {
59643
59662
  setIsSubmitting(true);
@@ -59656,9 +59675,13 @@ function RemarkModal(_a) {
59656
59675
  if (typeof onSuccess === "function") {
59657
59676
  onSuccess(res.data, payload);
59658
59677
  }
59678
+ PNotify_1.alert({
59679
+ text: ((_a2 = res.data) == null ? void 0 : _a2.message) || "\u179F\u1798\u17D2\u1782\u17B6\u179B\u17CB\u179F\u17C6\u1794\u17BB\u178F\u17D2\u179A\u1787\u17C4\u1782\u1787\u17D0\u1799 !",
59680
+ type: "success"
59681
+ });
59659
59682
  onClose == null ? void 0 : onClose();
59660
59683
  } catch (err) {
59661
- const message = ((_b2 = (_a2 = err.response) == null ? void 0 : _a2.data) == null ? void 0 : _b2.message) || err.message || "\u1780\u17C6\u178E\u178F\u17CB\u179F\u1798\u17D2\u1782\u17B6\u179B\u17CB\u1794\u179A\u17B6\u1787\u17D0\u1799 !";
59684
+ const message = ((_c = (_b2 = err.response) == null ? void 0 : _b2.data) == null ? void 0 : _c.message) || err.message || "\u1780\u17C6\u178E\u178F\u17CB\u179F\u1798\u17D2\u1782\u17B6\u179B\u17CB\u1794\u179A\u17B6\u1787\u17D0\u1799 !";
59662
59685
  setLoadError(message);
59663
59686
  if (typeof onError === "function") {
59664
59687
  onError(err);
@@ -59720,12 +59743,15 @@ function RemarkModal(_a) {
59720
59743
  }
59721
59744
  RemarkModal.propTypes = {
59722
59745
  object: PropTypes$2.object,
59746
+ ticket: PropTypes$2.object,
59723
59747
  onClose: PropTypes$2.func.isRequired,
59724
59748
  Env: PropTypes$2.object.isRequired,
59725
59749
  accessToken: PropTypes$2.string.isRequired
59726
59750
  };
59727
59751
 
59728
59752
  var __defProp = Object.defineProperty;
59753
+ var __defProps = Object.defineProperties;
59754
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
59729
59755
  var __getOwnPropSymbols = Object.getOwnPropertySymbols;
59730
59756
  var __hasOwnProp = Object.prototype.hasOwnProperty;
59731
59757
  var __propIsEnum = Object.prototype.propertyIsEnumerable;
@@ -59741,6 +59767,7 @@ var __spreadValues = (a, b) => {
59741
59767
  }
59742
59768
  return a;
59743
59769
  };
59770
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
59744
59771
  var __objRest = (source, exclude) => {
59745
59772
  var target = {};
59746
59773
  for (var prop in source)
@@ -59770,8 +59797,9 @@ function MoreMenu(_a) {
59770
59797
  isSubmitting: externalSubmitting = false,
59771
59798
  accessToken,
59772
59799
  openCallback,
59773
- closeCallback
59774
- } = _b; __objRest(_b, [
59800
+ closeCallback,
59801
+ DropdownButton
59802
+ } = _b, props = __objRest(_b, [
59775
59803
  "id",
59776
59804
  "object",
59777
59805
  "ticket",
@@ -59786,13 +59814,16 @@ function MoreMenu(_a) {
59786
59814
  "isSubmitting",
59787
59815
  "accessToken",
59788
59816
  "openCallback",
59789
- "closeCallback"
59817
+ "closeCallback",
59818
+ "DropdownButton"
59790
59819
  ]);
59820
+ var _a2, _b2;
59791
59821
  const [activeModal, setActiveModal] = useState(null);
59792
59822
  const [isPaid, setIsPaid] = useState(Boolean(ticket == null ? void 0 : ticket.isPaid));
59793
59823
  const [isPayout, setIsPayout] = useState(Boolean(ticket == null ? void 0 : ticket.isPayout));
59794
59824
  const [isLoadingPaid, setLoadingPaid] = useState(false);
59795
59825
  const [isLoadingPayout, setLoadingPayout] = useState(false);
59826
+ const isShowPayout = ((_a2 = ticket == null ? void 0 : ticket.totalKhr) == null ? void 0 : _a2.winAmount) > 0 || ((_b2 = ticket == null ? void 0 : ticket.totalUsd) == null ? void 0 : _b2.winAmount) > 0;
59796
59827
  useEffect(() => {
59797
59828
  setIsPaid(Boolean(ticket == null ? void 0 : ticket.isPaid));
59798
59829
  setIsPayout(Boolean(ticket == null ? void 0 : ticket.isPayout));
@@ -59818,7 +59849,7 @@ function MoreMenu(_a) {
59818
59849
  };
59819
59850
  const createToggleHandler = ({ setValue, setLoading, successCallback, endpoint, failureMessage, successMessage }) => {
59820
59851
  return async (event) => {
59821
- var _a2, _b2, _c, _d, _e;
59852
+ var _a3, _b3, _c, _d, _e;
59822
59853
  const nextChecked = event.target.checked;
59823
59854
  const previousValue = !nextChecked;
59824
59855
  if (!ticket || !object) {
@@ -59828,8 +59859,8 @@ function MoreMenu(_a) {
59828
59859
  setLoading(true);
59829
59860
  setValue(nextChecked);
59830
59861
  const payload = {
59831
- lotteryType: (_a2 = object == null ? void 0 : object.lotteryType) != null ? _a2 : ticket == null ? void 0 : ticket.lotteryType,
59832
- ticketNumber: (_b2 = object == null ? void 0 : object.ticketNumber) != null ? _b2 : ticket == null ? void 0 : ticket.ticketNumber,
59862
+ lotteryType: (_a3 = object == null ? void 0 : object.lotteryType) != null ? _a3 : ticket == null ? void 0 : ticket.lotteryType,
59863
+ ticketNumber: (_b3 = object == null ? void 0 : object.ticketNumber) != null ? _b3 : ticket == null ? void 0 : ticket.ticketNumber,
59833
59864
  status: nextChecked
59834
59865
  };
59835
59866
  const res = await axios$1.post(
@@ -59874,28 +59905,55 @@ function MoreMenu(_a) {
59874
59905
  failureMessage: "Failed to mark as payout.",
59875
59906
  successMessage: "Marked as payout successfully."
59876
59907
  });
59908
+ const toggleProps = {
59909
+ id,
59910
+ tag: "button",
59911
+ type: "button",
59912
+ caret: false,
59913
+ className: "border-0 p-2 rounded mb-1",
59914
+ style: { background: "#6c757d8f" }
59915
+ };
59916
+ const defaultToggleContent = /* @__PURE__ */ jsxRuntimeExports.jsx(
59917
+ FeatherIcon,
59918
+ {
59919
+ icon: "more-horizontal",
59920
+ className: "f-16 text-white px-1",
59921
+ style: { outline: "none", boxShadow: "none" }
59922
+ }
59923
+ );
59924
+ const resolveDropdownButton = () => {
59925
+ if (!DropdownButton) {
59926
+ return {
59927
+ props: toggleProps,
59928
+ children: defaultToggleContent
59929
+ };
59930
+ }
59931
+ const resolvedButton = typeof DropdownButton === "function" ? DropdownButton(toggleProps) : DropdownButton;
59932
+ if (!isValidElement(resolvedButton)) {
59933
+ return {
59934
+ props: toggleProps,
59935
+ children: resolvedButton || defaultToggleContent
59936
+ };
59937
+ }
59938
+ const customProps = __spreadValues({}, resolvedButton.props);
59939
+ const customChildren = customProps.children;
59940
+ delete customProps.children;
59941
+ if (resolvedButton.type !== DropdownToggle) {
59942
+ customProps.tag = customProps.tag || resolvedButton.type;
59943
+ }
59944
+ return {
59945
+ props: __spreadValues(__spreadValues({}, toggleProps), customProps),
59946
+ children: customChildren || defaultToggleContent
59947
+ };
59948
+ };
59949
+ const renderDropdownToggle = () => {
59950
+ const resolvedToggle = resolveDropdownButton();
59951
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(DropdownToggle, __spreadProps(__spreadValues({}, resolvedToggle.props), { children: resolvedToggle.children }));
59952
+ };
59877
59953
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
59878
- /* @__PURE__ */ jsxRuntimeExports.jsx(ScopeHost, { children: (container) => container && /* @__PURE__ */ jsxRuntimeExports.jsxs(UncontrolledDropdown, { className: "drp-user font-Hanuman", children: [
59879
- /* @__PURE__ */ jsxRuntimeExports.jsx(
59880
- DropdownToggle,
59881
- {
59882
- id,
59883
- tag: "button",
59884
- type: "button",
59885
- caret: false,
59886
- className: "border-0 p-2 rounded mb-1",
59887
- style: { background: "#6c757d8f" },
59888
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(
59889
- FeatherIcon,
59890
- {
59891
- icon: "more-horizontal",
59892
- className: "f-16 text-white px-1",
59893
- style: { outline: "none", boxShadow: "none" }
59894
- }
59895
- )
59896
- }
59897
- ),
59898
- /* @__PURE__ */ jsxRuntimeExports.jsxs(DropdownMenu, { right: true, className: "profile-notification pt-0", children: [
59954
+ /* @__PURE__ */ jsxRuntimeExports.jsx(ScopeHost, { children: (container) => container && /* @__PURE__ */ jsxRuntimeExports.jsxs(UncontrolledDropdown, __spreadProps(__spreadValues({ className: "drp-user font-Hanuman" }, props), { children: [
59955
+ renderDropdownToggle(),
59956
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(DropdownMenu, { className: "profile-notification pt-0", children: [
59899
59957
  /* @__PURE__ */ jsxRuntimeExports.jsxs(DropdownItem, { header: true, className: "drop-header", children: [
59900
59958
  "#",
59901
59959
  ticket == null ? void 0 : ticket.ticketNumber
@@ -59947,7 +60005,7 @@ function MoreMenu(_a) {
59947
60005
  ] })
59948
60006
  }
59949
60007
  ),
59950
- /* @__PURE__ */ jsxRuntimeExports.jsx(DropdownItem, { tag: "div", toggle: false, className: "w-100", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "d-flex align-items-center justify-content-between w-100", children: [
60008
+ isShowPayout && /* @__PURE__ */ jsxRuntimeExports.jsx(DropdownItem, { tag: "div", toggle: false, className: "w-100", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "d-flex align-items-center justify-content-between w-100", children: [
59951
60009
  /* @__PURE__ */ jsxRuntimeExports.jsx(FeatherIcon, { icon: "check-circle", className: "mr-2 text-info", size: 16 }),
59952
60010
  /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "mr-3 drop-label", children: "\u1794\u17B6\u1793\u1791\u17BC\u1791\u17B6\u178F\u17CB\u179A\u1784\u17D2\u179C\u17B6\u1793\u17CB" }),
59953
60011
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ml-auto", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -59963,7 +60021,7 @@ function MoreMenu(_a) {
59963
60021
  ) })
59964
60022
  ] }) })
59965
60023
  ] })
59966
- ] }) }),
60024
+ ] })) }),
59967
60025
  ticket && activeModal === "protest" && /* @__PURE__ */ jsxRuntimeExports.jsx(
59968
60026
  ProtestModal,
59969
60027
  {
@@ -59982,6 +60040,7 @@ function MoreMenu(_a) {
59982
60040
  object && activeModal === "remark" && /* @__PURE__ */ jsxRuntimeExports.jsx(
59983
60041
  RemarkModal,
59984
60042
  {
60043
+ ticket,
59985
60044
  object,
59986
60045
  onClose: closeModal,
59987
60046
  accessToken,
@@ -60003,7 +60062,11 @@ MoreMenu.propTypes = {
60003
60062
  isSubmitting: PropTypes$2.bool,
60004
60063
  onChange: PropTypes$2.func,
60005
60064
  onSuccess: PropTypes$2.func,
60006
- onError: PropTypes$2.func
60065
+ onError: PropTypes$2.func,
60066
+ DropdownButton: PropTypes$2.oneOfType([
60067
+ PropTypes$2.func,
60068
+ PropTypes$2.node
60069
+ ])
60007
60070
  };
60008
60071
 
60009
60072
  export { DeleteModal, DeleteTicketButton, MoreMenu as DropdownMenu, KPLO, KPPostCode, Printer, ProtestButton, ProtestModal, ProtestTicket, RemarkModal, SCPostCode, SaryLottery, SaryPrintAll, THLabel, Ticket, TicketModal, TransferTicket, getS3ImgPrint, isVNType, lType, lotteryLabel, lotteryLabelOnline, lotteryLabelVN, mapBetTitle, mapLabels, mapStrPost };