@aizu-chat/react 0.0.5 → 0.0.7
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/chunk-27KHUFCW.mjs +826 -0
- package/dist/chunk-2E7KQQED.mjs +816 -0
- package/dist/chunk-2PRXGXTN.mjs +826 -0
- package/dist/chunk-2UZJYWLD.mjs +49 -0
- package/dist/chunk-2ZNJT52V.mjs +814 -0
- package/dist/chunk-33CPD3DF.mjs +59 -0
- package/dist/chunk-34B6VEJC.mjs +677 -0
- package/dist/chunk-35JN2QFA.mjs +784 -0
- package/dist/chunk-3FHGECHR.mjs +829 -0
- package/dist/chunk-3IU2OVAG.mjs +780 -0
- package/dist/chunk-3QKHSOJ4.mjs +728 -0
- package/dist/chunk-3XKU4RH2.mjs +814 -0
- package/dist/chunk-432NOVMD.mjs +822 -0
- package/dist/chunk-4FW2X356.mjs +653 -0
- package/dist/chunk-4KUZUKKS.mjs +776 -0
- package/dist/chunk-4UO5EJ54.mjs +826 -0
- package/dist/chunk-66DXSMQL.mjs +826 -0
- package/dist/chunk-6IIUDDOD.mjs +775 -0
- package/dist/chunk-6LVL2AO4.mjs +660 -0
- package/dist/chunk-6OMCLP7J.mjs +727 -0
- package/dist/chunk-6SYZLU5L.mjs +782 -0
- package/dist/chunk-6XLUHLNW.mjs +826 -0
- package/dist/chunk-6Z4U3TJM.mjs +728 -0
- package/dist/chunk-6ZNP2727.mjs +686 -0
- package/dist/chunk-75Q3MZEF.mjs +52 -0
- package/dist/chunk-A4YWLH3K.mjs +751 -0
- package/dist/chunk-AT5CG6CS.mjs +53 -0
- package/dist/chunk-B4CPQFKO.mjs +826 -0
- package/dist/chunk-BH52V6JW.mjs +776 -0
- package/dist/chunk-BYPRKP6J.mjs +782 -0
- package/dist/chunk-BZVP32PP.mjs +826 -0
- package/dist/chunk-C6T755JT.mjs +780 -0
- package/dist/chunk-CCFEXIKG.mjs +815 -0
- package/dist/chunk-CTYW4VK4.mjs +815 -0
- package/dist/chunk-D2UMLUGP.mjs +685 -0
- package/dist/chunk-D4DQP4GI.mjs +817 -0
- package/dist/chunk-DIBJNQPT.mjs +782 -0
- package/dist/chunk-DJQK65LJ.mjs +822 -0
- package/dist/chunk-DLQEX6QS.mjs +661 -0
- package/dist/chunk-EADN4TWS.mjs +819 -0
- package/dist/chunk-EAW7EHJI.mjs +826 -0
- package/dist/chunk-EBU5NLRJ.mjs +661 -0
- package/dist/chunk-EDBTUKCC.mjs +738 -0
- package/dist/chunk-EHQQJPCV.mjs +53 -0
- package/dist/chunk-EKELJTME.mjs +674 -0
- package/dist/chunk-ELAN3AIY.mjs +784 -0
- package/dist/chunk-EWW3DF5X.mjs +814 -0
- package/dist/chunk-EXJ5M326.mjs +826 -0
- package/dist/chunk-F3DEI4YK.mjs +682 -0
- package/dist/chunk-FBJJFSCR.mjs +778 -0
- package/dist/chunk-G7M72PUZ.mjs +776 -0
- package/dist/chunk-GFVIBK25.mjs +673 -0
- package/dist/chunk-GYZ6ICY2.mjs +685 -0
- package/dist/chunk-H733EISO.mjs +826 -0
- package/dist/chunk-H7C7VETZ.mjs +776 -0
- package/dist/chunk-HD2IHWNW.mjs +776 -0
- package/dist/chunk-HKAXD2CX.mjs +776 -0
- package/dist/chunk-HLRWI4YU.mjs +778 -0
- package/dist/chunk-HNPNRGTG.mjs +686 -0
- package/dist/chunk-HQYDHSWS.mjs +678 -0
- package/dist/chunk-HVPJAO66.mjs +654 -0
- package/dist/chunk-I36Q4NZE.mjs +675 -0
- package/dist/chunk-ICOCFEPA.mjs +776 -0
- package/dist/chunk-IMM7TFAT.mjs +685 -0
- package/dist/chunk-J5OEYYWK.mjs +728 -0
- package/dist/chunk-JDR62NUF.mjs +729 -0
- package/dist/chunk-JEOWW4D7.mjs +49 -0
- package/dist/chunk-JIAD2PHZ.mjs +779 -0
- package/dist/chunk-JMHZ4OMV.mjs +814 -0
- package/dist/chunk-JUYVQ5F6.mjs +673 -0
- package/dist/chunk-K2EPLJ4A.mjs +728 -0
- package/dist/chunk-K2WK46MB.mjs +776 -0
- package/dist/chunk-KM4P2EHL.mjs +729 -0
- package/dist/chunk-KR4PTVQ4.mjs +779 -0
- package/dist/chunk-KUHNPG4Q.mjs +796 -0
- package/dist/chunk-KXFNNAMR.mjs +814 -0
- package/dist/chunk-LEZIDZXE.mjs +831 -0
- package/dist/chunk-LMFIKGQM.mjs +782 -0
- package/dist/chunk-LT43AVHN.mjs +780 -0
- package/dist/chunk-MBHPFGVB.mjs +782 -0
- package/dist/chunk-MDMZAAPV.mjs +685 -0
- package/dist/chunk-MFFRGYEX.mjs +728 -0
- package/dist/chunk-O3U6ONKJ.mjs +677 -0
- package/dist/chunk-OEPSB4XZ.mjs +686 -0
- package/dist/chunk-OJ5M55LN.mjs +660 -0
- package/dist/chunk-OSHAWBTV.mjs +800 -0
- package/dist/chunk-OVDFBN6H.mjs +800 -0
- package/dist/chunk-OWFM4DXQ.mjs +686 -0
- package/dist/chunk-P4FEBZ5I.mjs +829 -0
- package/dist/chunk-QBXYSNTR.mjs +675 -0
- package/dist/chunk-QDS6QW7Y.mjs +738 -0
- package/dist/chunk-QN5L3XNN.mjs +830 -0
- package/dist/chunk-QOK4APM5.mjs +728 -0
- package/dist/chunk-QR37WSLB.mjs +826 -0
- package/dist/chunk-QS7TKK6W.mjs +685 -0
- package/dist/chunk-QTL5KRV3.mjs +686 -0
- package/dist/chunk-QV2LQKNI.mjs +686 -0
- package/dist/chunk-QV74GE66.mjs +778 -0
- package/dist/chunk-R3NQ7SPU.mjs +780 -0
- package/dist/chunk-R3Z7JF73.mjs +673 -0
- package/dist/chunk-S63OOCED.mjs +781 -0
- package/dist/chunk-SJJDDFKI.mjs +830 -0
- package/dist/chunk-SLS4OSOJ.mjs +826 -0
- package/dist/chunk-SRFLVMCW.mjs +685 -0
- package/dist/chunk-SUOZPZBK.mjs +826 -0
- package/dist/chunk-TBBN7SM4.mjs +660 -0
- package/dist/chunk-TLJKLZBR.mjs +734 -0
- package/dist/chunk-U4ODVQIJ.mjs +728 -0
- package/dist/chunk-UA2YL34U.mjs +782 -0
- package/dist/chunk-UOQWXJXH.mjs +779 -0
- package/dist/chunk-UYBDUWOL.mjs +776 -0
- package/dist/chunk-UZD3IED4.mjs +676 -0
- package/dist/chunk-V2YCL6RC.mjs +798 -0
- package/dist/chunk-V5ROKX6T.mjs +779 -0
- package/dist/chunk-VBZLGI7W.mjs +819 -0
- package/dist/chunk-VEAZMIG4.mjs +830 -0
- package/dist/chunk-VMG4TRFB.mjs +750 -0
- package/dist/chunk-VOLA2PFJ.mjs +676 -0
- package/dist/chunk-VTBZU2XN.mjs +826 -0
- package/dist/chunk-WC37DM4U.mjs +816 -0
- package/dist/chunk-WDLA4JJY.mjs +778 -0
- package/dist/chunk-WQ6BKSTC.mjs +815 -0
- package/dist/chunk-WXSNIINA.mjs +778 -0
- package/dist/chunk-WYBPKSFQ.mjs +816 -0
- package/dist/chunk-XFRN7OPZ.mjs +686 -0
- package/dist/chunk-XLRF64SW.mjs +53 -0
- package/dist/chunk-YLNMIJBD.mjs +728 -0
- package/dist/chunk-YUGESFKI.mjs +819 -0
- package/dist/chunk-YVDMWPWQ.mjs +776 -0
- package/dist/chunk-Z6L7TEVJ.mjs +828 -0
- package/dist/chunk-Z72DRRM6.mjs +829 -0
- package/dist/chunk-ZXF3RMZZ.mjs +685 -0
- package/dist/components.d.mts +56 -8
- package/dist/components.d.ts +56 -8
- package/dist/components.js +825 -13
- package/dist/components.mjs +12 -3
- package/dist/hooks.mjs +1 -0
- package/dist/index.d.mts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +869 -13
- package/dist/index.mjs +17 -2
- package/dist/sdk.d.mts +39 -0
- package/dist/sdk.d.ts +39 -0
- package/dist/sdk.js +121 -0
- package/dist/sdk.mjs +10 -0
- package/package.json +7 -18
- package/dist/chunk-R4SQBMHN.mjs +0 -55
package/dist/index.js
CHANGED
|
@@ -1,9 +1,38 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
"use strict";
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
|
+
var __defProps = Object.defineProperties;
|
|
4
5
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
5
7
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
8
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
6
9
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
11
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
12
|
+
var __spreadValues = (a, b) => {
|
|
13
|
+
for (var prop in b || (b = {}))
|
|
14
|
+
if (__hasOwnProp.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
if (__getOwnPropSymbols)
|
|
17
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
18
|
+
if (__propIsEnum.call(b, prop))
|
|
19
|
+
__defNormalProp(a, prop, b[prop]);
|
|
20
|
+
}
|
|
21
|
+
return a;
|
|
22
|
+
};
|
|
23
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
24
|
+
var __objRest = (source, exclude) => {
|
|
25
|
+
var target = {};
|
|
26
|
+
for (var prop in source)
|
|
27
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
28
|
+
target[prop] = source[prop];
|
|
29
|
+
if (source != null && __getOwnPropSymbols)
|
|
30
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
31
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
32
|
+
target[prop] = source[prop];
|
|
33
|
+
}
|
|
34
|
+
return target;
|
|
35
|
+
};
|
|
7
36
|
var __export = (target, all) => {
|
|
8
37
|
for (var name in all)
|
|
9
38
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -17,11 +46,37 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
46
|
return to;
|
|
18
47
|
};
|
|
19
48
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
49
|
+
var __async = (__this, __arguments, generator) => {
|
|
50
|
+
return new Promise((resolve, reject) => {
|
|
51
|
+
var fulfilled = (value) => {
|
|
52
|
+
try {
|
|
53
|
+
step(generator.next(value));
|
|
54
|
+
} catch (e) {
|
|
55
|
+
reject(e);
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
var rejected = (value) => {
|
|
59
|
+
try {
|
|
60
|
+
step(generator.throw(value));
|
|
61
|
+
} catch (e) {
|
|
62
|
+
reject(e);
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
66
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
67
|
+
});
|
|
68
|
+
};
|
|
20
69
|
|
|
21
70
|
// src/index.ts
|
|
22
71
|
var src_exports = {};
|
|
23
72
|
__export(src_exports, {
|
|
73
|
+
AizuChat: () => AizuChat,
|
|
74
|
+
AizuClient: () => AizuClient,
|
|
24
75
|
Button: () => Button,
|
|
76
|
+
Loading: () => Loading,
|
|
77
|
+
QuickMenus: () => QuickMenus,
|
|
78
|
+
TestComponent: () => TestComponent,
|
|
79
|
+
createAizuClient: () => createAizuClient,
|
|
25
80
|
useCustom: () => useCustom
|
|
26
81
|
});
|
|
27
82
|
module.exports = __toCommonJS(src_exports);
|
|
@@ -49,7 +104,243 @@ function styleInject(css, { insertAt } = {}) {
|
|
|
49
104
|
}
|
|
50
105
|
|
|
51
106
|
// src/global.css
|
|
52
|
-
styleInject('/*! tailwindcss v4.1.18 | MIT License | https://tailwindcss.com */\n@layer properties;\n@layer theme, base, components, utilities;\n@layer theme {\n :root,\n :host {\n --font-sans:\n ui-sans-serif,\n system-ui,\n sans-serif,\n "Apple Color Emoji",\n "Segoe UI Emoji",\n "Segoe UI Symbol",\n "Noto Color Emoji";\n --font-mono:\n ui-monospace,\n SFMono-Regular,\n Menlo,\n Monaco,\n Consolas,\n "Liberation Mono",\n "Courier New",\n monospace;\n --color-red-500: oklch(63.7% 0.237 25.331);\n --spacing: 0.25rem;\n --default-font-family: var(--font-sans);\n --default-mono-font-family: var(--font-mono);\n }\n}\n@layer base {\n *,\n ::after,\n ::before,\n ::backdrop,\n ::file-selector-button {\n box-sizing: border-box;\n margin: 0;\n padding: 0;\n border: 0 solid;\n }\n html,\n :host {\n line-height: 1.5;\n -webkit-text-size-adjust: 100%;\n tab-size: 4;\n font-family: var(--default-font-family, ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");\n font-feature-settings: var(--default-font-feature-settings, normal);\n font-variation-settings: var(--default-font-variation-settings, normal);\n -webkit-tap-highlight-color: transparent;\n }\n hr {\n height: 0;\n color: inherit;\n border-top-width: 1px;\n }\n abbr:where([title]) {\n -webkit-text-decoration: underline dotted;\n text-decoration: underline dotted;\n }\n h1,\n h2,\n h3,\n h4,\n h5,\n h6 {\n font-size: inherit;\n font-weight: inherit;\n }\n a {\n color: inherit;\n -webkit-text-decoration: inherit;\n text-decoration: inherit;\n }\n b,\n strong {\n font-weight: bolder;\n }\n code,\n kbd,\n samp,\n pre {\n font-family: var(--default-mono-font-family, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);\n font-feature-settings: var(--default-mono-font-feature-settings, normal);\n font-variation-settings: var(--default-mono-font-variation-settings, normal);\n font-size: 1em;\n }\n small {\n font-size: 80%;\n }\n sub,\n sup {\n font-size: 75%;\n line-height: 0;\n position: relative;\n vertical-align: baseline;\n }\n sub {\n bottom: -0.25em;\n }\n sup {\n top: -0.5em;\n }\n table {\n text-indent: 0;\n border-color: inherit;\n border-collapse: collapse;\n }\n :-moz-focusring {\n outline: auto;\n }\n progress {\n vertical-align: baseline;\n }\n summary {\n display: list-item;\n }\n ol,\n ul,\n menu {\n list-style: none;\n }\n img,\n svg,\n video,\n canvas,\n audio,\n iframe,\n embed,\n object {\n display: block;\n vertical-align: middle;\n }\n img,\n video {\n max-width: 100%;\n height: auto;\n }\n button,\n input,\n select,\n optgroup,\n textarea,\n ::file-selector-button {\n font: inherit;\n font-feature-settings: inherit;\n font-variation-settings: inherit;\n letter-spacing: inherit;\n color: inherit;\n border-radius: 0;\n background-color: transparent;\n opacity: 1;\n }\n :where(select:is([multiple], [size])) optgroup {\n font-weight: bolder;\n }\n :where(select:is([multiple], [size])) optgroup option {\n padding-inline-start: 20px;\n }\n ::file-selector-button {\n margin-inline-end: 4px;\n }\n ::placeholder {\n opacity: 1;\n }\n @supports (not (-webkit-appearance: -apple-pay-button)) or (contain-intrinsic-size: 1px) {\n ::placeholder {\n color: currentcolor;\n @supports (color: color-mix(in lab, red, red)) {\n color: color-mix(in oklab, currentcolor 50%, transparent);\n }\n }\n }\n textarea {\n resize: vertical;\n }\n ::-webkit-search-decoration {\n -webkit-appearance: none;\n }\n ::-webkit-date-and-time-value {\n min-height: 1lh;\n text-align: inherit;\n }\n ::-webkit-datetime-edit {\n display: inline-flex;\n }\n ::-webkit-datetime-edit-fields-wrapper {\n padding: 0;\n }\n ::-webkit-datetime-edit,\n ::-webkit-datetime-edit-year-field,\n ::-webkit-datetime-edit-month-field,\n ::-webkit-datetime-edit-day-field,\n ::-webkit-datetime-edit-hour-field,\n ::-webkit-datetime-edit-minute-field,\n ::-webkit-datetime-edit-second-field,\n ::-webkit-datetime-edit-millisecond-field,\n ::-webkit-datetime-edit-meridiem-field {\n padding-block: 0;\n }\n ::-webkit-calendar-picker-indicator {\n line-height: 1;\n }\n :-moz-ui-invalid {\n box-shadow: none;\n }\n button,\n input:where([type=button], [type=reset], [type=submit]),\n ::file-selector-button {\n appearance: button;\n }\n ::-webkit-inner-spin-button,\n ::-webkit-outer-spin-button {\n height: auto;\n }\n [hidden]:where(:not([hidden=until-found])) {\n display: none !important;\n }\n}\n@layer utilities {\n .border {\n border-style: var(--tw-border-style);\n border-width: 1px;\n }\n .border-red-500 {\n border-color: var(--color-red-500);\n }\n .p-3 {\n padding: calc(var(--spacing) * 3);\n }\n .hover\\:bg-red-500 {\n &:hover {\n @media (hover: hover) {\n background-color: var(--color-red-500);\n }\n }\n }\n}\n@property --tw-border-style { syntax: "*"; inherits: false; initial-value: solid; }\n@layer properties {\n @supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))) {\n *,\n ::before,\n ::after,\n ::backdrop {\n --tw-border-style: solid;\n }\n }\n}\n');
|
|
107
|
+
styleInject('/*! tailwindcss v4.1.18 | MIT License | https://tailwindcss.com */\n@layer properties;\n@layer theme, base, components, utilities;\n@layer theme {\n :root,\n :host {\n --font-sans:\n ui-sans-serif,\n system-ui,\n sans-serif,\n "Apple Color Emoji",\n "Segoe UI Emoji",\n "Segoe UI Symbol",\n "Noto Color Emoji";\n --font-mono:\n ui-monospace,\n SFMono-Regular,\n Menlo,\n Monaco,\n Consolas,\n "Liberation Mono",\n "Courier New",\n monospace;\n --color-orange-200: oklch(90.1% 0.076 70.697);\n --color-orange-300: oklch(83.7% 0.128 66.29);\n --color-orange-400: oklch(75% 0.183 55.934);\n --color-orange-500: oklch(70.5% 0.213 47.604);\n --color-blue-500: oklch(62.3% 0.214 259.815);\n --color-blue-600: oklch(54.6% 0.245 262.881);\n --color-gray-100: oklch(96.7% 0.003 264.542);\n --color-gray-200: oklch(92.8% 0.006 264.531);\n --color-gray-400: oklch(70.7% 0.022 261.325);\n --color-gray-500: oklch(55.1% 0.027 264.364);\n --color-gray-600: oklch(44.6% 0.03 256.802);\n --color-black: #000;\n --color-white: #fff;\n --spacing: 0.25rem;\n --text-sm: 0.875rem;\n --text-sm--line-height: calc(1.25 / 0.875);\n --text-xl: 1.25rem;\n --text-xl--line-height: calc(1.75 / 1.25);\n --font-weight-bold: 700;\n --radius-3xl: 1.5rem;\n --radius-4xl: 2rem;\n --default-transition-duration: 150ms;\n --default-transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n --default-font-family: var(--font-sans);\n --default-mono-font-family: var(--font-mono);\n --font-sukhumvit:\n "Sukhumvit Set",\n ui-sans-serif,\n system-ui,\n sans-serif;\n --animate-wiggle: wiggle 1s ease-in-out infinite;\n }\n}\n@layer base {\n *,\n ::after,\n ::before,\n ::backdrop,\n ::file-selector-button {\n box-sizing: border-box;\n margin: 0;\n padding: 0;\n border: 0 solid;\n }\n html,\n :host {\n line-height: 1.5;\n -webkit-text-size-adjust: 100%;\n tab-size: 4;\n font-family: var(--default-font-family, ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");\n font-feature-settings: var(--default-font-feature-settings, normal);\n font-variation-settings: var(--default-font-variation-settings, normal);\n -webkit-tap-highlight-color: transparent;\n }\n hr {\n height: 0;\n color: inherit;\n border-top-width: 1px;\n }\n abbr:where([title]) {\n -webkit-text-decoration: underline dotted;\n text-decoration: underline dotted;\n }\n h1,\n h2,\n h3,\n h4,\n h5,\n h6 {\n font-size: inherit;\n font-weight: inherit;\n }\n a {\n color: inherit;\n -webkit-text-decoration: inherit;\n text-decoration: inherit;\n }\n b,\n strong {\n font-weight: bolder;\n }\n code,\n kbd,\n samp,\n pre {\n font-family: var(--default-mono-font-family, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);\n font-feature-settings: var(--default-mono-font-feature-settings, normal);\n font-variation-settings: var(--default-mono-font-variation-settings, normal);\n font-size: 1em;\n }\n small {\n font-size: 80%;\n }\n sub,\n sup {\n font-size: 75%;\n line-height: 0;\n position: relative;\n vertical-align: baseline;\n }\n sub {\n bottom: -0.25em;\n }\n sup {\n top: -0.5em;\n }\n table {\n text-indent: 0;\n border-color: inherit;\n border-collapse: collapse;\n }\n :-moz-focusring {\n outline: auto;\n }\n progress {\n vertical-align: baseline;\n }\n summary {\n display: list-item;\n }\n ol,\n ul,\n menu {\n list-style: none;\n }\n img,\n svg,\n video,\n canvas,\n audio,\n iframe,\n embed,\n object {\n display: block;\n vertical-align: middle;\n }\n img,\n video {\n max-width: 100%;\n height: auto;\n }\n button,\n input,\n select,\n optgroup,\n textarea,\n ::file-selector-button {\n font: inherit;\n font-feature-settings: inherit;\n font-variation-settings: inherit;\n letter-spacing: inherit;\n color: inherit;\n border-radius: 0;\n background-color: transparent;\n opacity: 1;\n }\n :where(select:is([multiple], [size])) optgroup {\n font-weight: bolder;\n }\n :where(select:is([multiple], [size])) optgroup option {\n padding-inline-start: 20px;\n }\n ::file-selector-button {\n margin-inline-end: 4px;\n }\n ::placeholder {\n opacity: 1;\n }\n @supports (not (-webkit-appearance: -apple-pay-button)) or (contain-intrinsic-size: 1px) {\n ::placeholder {\n color: currentcolor;\n @supports (color: color-mix(in lab, red, red)) {\n color: color-mix(in oklab, currentcolor 50%, transparent);\n }\n }\n }\n textarea {\n resize: vertical;\n }\n ::-webkit-search-decoration {\n -webkit-appearance: none;\n }\n ::-webkit-date-and-time-value {\n min-height: 1lh;\n text-align: inherit;\n }\n ::-webkit-datetime-edit {\n display: inline-flex;\n }\n ::-webkit-datetime-edit-fields-wrapper {\n padding: 0;\n }\n ::-webkit-datetime-edit,\n ::-webkit-datetime-edit-year-field,\n ::-webkit-datetime-edit-month-field,\n ::-webkit-datetime-edit-day-field,\n ::-webkit-datetime-edit-hour-field,\n ::-webkit-datetime-edit-minute-field,\n ::-webkit-datetime-edit-second-field,\n ::-webkit-datetime-edit-millisecond-field,\n ::-webkit-datetime-edit-meridiem-field {\n padding-block: 0;\n }\n ::-webkit-calendar-picker-indicator {\n line-height: 1;\n }\n :-moz-ui-invalid {\n box-shadow: none;\n }\n button,\n input:where([type=button], [type=reset], [type=submit]),\n ::file-selector-button {\n appearance: button;\n }\n ::-webkit-inner-spin-button,\n ::-webkit-outer-spin-button {\n height: auto;\n }\n [hidden]:where(:not([hidden=until-found])) {\n display: none !important;\n }\n}\n@layer utilities {\n .pointer-events-none {\n pointer-events: none;\n }\n .invisible {\n visibility: hidden;\n }\n .absolute {\n position: absolute;\n }\n .fixed {\n position: fixed;\n }\n .relative {\n position: relative;\n }\n .top-0 {\n top: calc(var(--spacing) * 0);\n }\n .top-1\\/2 {\n top: calc(1/2 * 100%);\n }\n .right-0 {\n right: calc(var(--spacing) * 0);\n }\n .right-2 {\n right: calc(var(--spacing) * 2);\n }\n .right-5 {\n right: calc(var(--spacing) * 5);\n }\n .bottom-0 {\n bottom: calc(var(--spacing) * 0);\n }\n .bottom-4 {\n bottom: calc(var(--spacing) * 4);\n }\n .bottom-5 {\n bottom: calc(var(--spacing) * 5);\n }\n .left-1\\/2 {\n left: calc(1/2 * 100%);\n }\n .z-10 {\n z-index: 10;\n }\n .z-9999 {\n z-index: 9999;\n }\n .mt-1 {\n margin-top: calc(var(--spacing) * 1);\n }\n .mr-auto {\n margin-right: auto;\n }\n .mb-4 {\n margin-bottom: calc(var(--spacing) * 4);\n }\n .ml-auto {\n margin-left: auto;\n }\n .block {\n display: block;\n }\n .flex {\n display: flex;\n }\n .aspect-square {\n aspect-ratio: 1 / 1;\n }\n .h-0\\.75 {\n height: calc(var(--spacing) * 0.75);\n }\n .h-1\\.25 {\n height: calc(var(--spacing) * 1.25);\n }\n .h-2 {\n height: calc(var(--spacing) * 2);\n }\n .h-8 {\n height: calc(var(--spacing) * 8);\n }\n .h-10 {\n height: calc(var(--spacing) * 10);\n }\n .h-16 {\n height: calc(var(--spacing) * 16);\n }\n .h-29\\.5 {\n height: calc(var(--spacing) * 29.5);\n }\n .h-42\\.5 {\n height: calc(var(--spacing) * 42.5);\n }\n .h-full {\n height: 100%;\n }\n .w-0\\.75 {\n width: calc(var(--spacing) * 0.75);\n }\n .w-1\\.25 {\n width: calc(var(--spacing) * 1.25);\n }\n .w-2 {\n width: calc(var(--spacing) * 2);\n }\n .w-8 {\n width: calc(var(--spacing) * 8);\n }\n .w-10 {\n width: calc(var(--spacing) * 10);\n }\n .w-75\\.5 {\n width: calc(var(--spacing) * 75.5);\n }\n .w-full {\n width: 100%;\n }\n .max-w-69\\.5 {\n max-width: calc(var(--spacing) * 69.5);\n }\n .max-w-75\\.5 {\n max-width: calc(var(--spacing) * 75.5);\n }\n .min-w-max {\n min-width: max-content;\n }\n .flex-1 {\n flex: 1;\n }\n .shrink-0 {\n flex-shrink: 0;\n }\n .-translate-x-1\\/2 {\n --tw-translate-x: calc(calc(1/2 * 100%) * -1);\n translate: var(--tw-translate-x) var(--tw-translate-y);\n }\n .-translate-y-1\\/2 {\n --tw-translate-y: calc(calc(1/2 * 100%) * -1);\n translate: var(--tw-translate-x) var(--tw-translate-y);\n }\n .animate-wiggle {\n animation: var(--animate-wiggle);\n }\n .cursor-pointer {\n cursor: pointer;\n }\n .flex-col {\n flex-direction: column;\n }\n .flex-wrap {\n flex-wrap: wrap;\n }\n .items-center {\n align-items: center;\n }\n .justify-between {\n justify-content: space-between;\n }\n .justify-center {\n justify-content: center;\n }\n .gap-2 {\n gap: calc(var(--spacing) * 2);\n }\n .gap-3 {\n gap: calc(var(--spacing) * 3);\n }\n .space-y-1 {\n :where(& > :not(:last-child)) {\n --tw-space-y-reverse: 0;\n margin-block-start: calc(calc(var(--spacing) * 1) * var(--tw-space-y-reverse));\n margin-block-end: calc(calc(var(--spacing) * 1) * calc(1 - var(--tw-space-y-reverse)));\n }\n }\n .space-y-4 {\n :where(& > :not(:last-child)) {\n --tw-space-y-reverse: 0;\n margin-block-start: calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));\n margin-block-end: calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)));\n }\n }\n .gap-x-1 {\n column-gap: calc(var(--spacing) * 1);\n }\n .gap-x-2 {\n column-gap: calc(var(--spacing) * 2);\n }\n .gap-y-3 {\n row-gap: calc(var(--spacing) * 3);\n }\n .overflow-hidden {\n overflow: hidden;\n }\n .overflow-x-scroll {\n overflow-x: scroll;\n }\n .overflow-y-auto {\n overflow-y: auto;\n }\n .rounded {\n border-radius: 0.25rem;\n }\n .rounded-3xl {\n border-radius: var(--radius-3xl);\n }\n .rounded-full {\n border-radius: calc(infinity * 1px);\n }\n .border {\n border-style: var(--tw-border-style);\n border-width: 1px;\n }\n .border-2 {\n border-style: var(--tw-border-style);\n border-width: 2px;\n }\n .border-b {\n border-bottom-style: var(--tw-border-style);\n border-bottom-width: 1px;\n }\n .border-none {\n --tw-border-style: none;\n border-style: none;\n }\n .border-black\\/50 {\n border-color: color-mix(in srgb, #000 50%, transparent);\n @supports (color: color-mix(in lab, red, red)) {\n border-color: color-mix(in oklab, var(--color-black) 50%, transparent);\n }\n }\n .border-blue-500 {\n border-color: var(--color-blue-500);\n }\n .border-gray-200 {\n border-color: var(--color-gray-200);\n }\n .border-orange-300 {\n border-color: var(--color-orange-300);\n }\n .border-orange-400 {\n border-color: var(--color-orange-400);\n }\n .bg-\\[\\#F8F8FA\\] {\n background-color: #F8F8FA;\n }\n .bg-black\\/60 {\n background-color: color-mix(in srgb, #000 60%, transparent);\n @supports (color: color-mix(in lab, red, red)) {\n background-color: color-mix(in oklab, var(--color-black) 60%, transparent);\n }\n }\n .bg-blue-500 {\n background-color: var(--color-blue-500);\n }\n .bg-gray-100 {\n background-color: var(--color-gray-100);\n }\n .bg-orange-200 {\n background-color: var(--color-orange-200);\n }\n .bg-orange-400 {\n background-color: var(--color-orange-400);\n }\n .bg-white {\n background-color: var(--color-white);\n }\n .bg-linear-to-l {\n --tw-gradient-position: to left;\n @supports (background-image: linear-gradient(in lab, red, red)) {\n --tw-gradient-position: to left in oklab;\n }\n background-image: linear-gradient(var(--tw-gradient-stops));\n }\n .from-white {\n --tw-gradient-from: var(--color-white);\n --tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position));\n }\n .to-transparent {\n --tw-gradient-to: transparent;\n --tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position));\n }\n .p-2 {\n padding: calc(var(--spacing) * 2);\n }\n .p-3 {\n padding: calc(var(--spacing) * 3);\n }\n .p-4 {\n padding: calc(var(--spacing) * 4);\n }\n .px-4 {\n padding-inline: calc(var(--spacing) * 4);\n }\n .py-2 {\n padding-block: calc(var(--spacing) * 2);\n }\n .py-3 {\n padding-block: calc(var(--spacing) * 3);\n }\n .pt-4 {\n padding-top: calc(var(--spacing) * 4);\n }\n .pr-12 {\n padding-right: calc(var(--spacing) * 12);\n }\n .pb-2 {\n padding-bottom: calc(var(--spacing) * 2);\n }\n .pl-4 {\n padding-left: calc(var(--spacing) * 4);\n }\n .text-center {\n text-align: center;\n }\n .text-sm {\n font-size: var(--text-sm);\n line-height: var(--tw-leading, var(--text-sm--line-height));\n }\n .text-xl {\n font-size: var(--text-xl);\n line-height: var(--tw-leading, var(--text-xl--line-height));\n }\n .text-\\[10px\\] {\n font-size: 10px;\n }\n .text-\\[12px\\] {\n font-size: 12px;\n }\n .font-bold {\n --tw-font-weight: var(--font-weight-bold);\n font-weight: var(--font-weight-bold);\n }\n .text-nowrap {\n text-wrap: nowrap;\n }\n .whitespace-pre-wrap {\n white-space: pre-wrap;\n }\n .text-black\\/85 {\n color: color-mix(in srgb, #000 85%, transparent);\n @supports (color: color-mix(in lab, red, red)) {\n color: color-mix(in oklab, var(--color-black) 85%, transparent);\n }\n }\n .text-gray-500 {\n color: var(--color-gray-500);\n }\n .text-gray-600 {\n color: var(--color-gray-600);\n }\n .text-orange-500 {\n color: var(--color-orange-500);\n }\n .text-white {\n color: var(--color-white);\n }\n .shadow {\n --tw-shadow: 0 1px 3px 0 var(--tw-shadow-color, rgb(0 0 0 / 0.1)), 0 1px 2px -1px var(--tw-shadow-color, rgb(0 0 0 / 0.1));\n box-shadow:\n var(--tw-inset-shadow),\n var(--tw-inset-ring-shadow),\n var(--tw-ring-offset-shadow),\n var(--tw-ring-shadow),\n var(--tw-shadow);\n }\n .shadow-2xl {\n --tw-shadow: 0 25px 50px -12px var(--tw-shadow-color, rgb(0 0 0 / 0.25));\n box-shadow:\n var(--tw-inset-shadow),\n var(--tw-inset-ring-shadow),\n var(--tw-ring-offset-shadow),\n var(--tw-ring-shadow),\n var(--tw-shadow);\n }\n .shadow-orange-400 {\n --tw-shadow-color: oklch(75% 0.183 55.934);\n @supports (color: color-mix(in lab, red, red)) {\n --tw-shadow-color: color-mix(in oklab, var(--color-orange-400) var(--tw-shadow-alpha), transparent);\n }\n }\n .transition-colors {\n transition-property:\n color,\n background-color,\n border-color,\n outline-color,\n text-decoration-color,\n fill,\n stroke,\n --tw-gradient-from,\n --tw-gradient-via,\n --tw-gradient-to;\n transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));\n transition-duration: var(--tw-duration, var(--default-transition-duration));\n }\n .outline-none {\n --tw-outline-style: none;\n outline-style: none;\n }\n .hover\\:bg-blue-600 {\n &:hover {\n @media (hover: hover) {\n background-color: var(--color-blue-600);\n }\n }\n }\n .hover\\:bg-gray-200 {\n &:hover {\n @media (hover: hover) {\n background-color: var(--color-gray-200);\n }\n }\n }\n .focus\\:ring-2 {\n &:focus {\n --tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);\n box-shadow:\n var(--tw-inset-shadow),\n var(--tw-inset-ring-shadow),\n var(--tw-ring-offset-shadow),\n var(--tw-ring-shadow),\n var(--tw-shadow);\n }\n }\n .focus\\:ring-orange-300 {\n &:focus {\n --tw-ring-color: var(--color-orange-300);\n }\n }\n .disabled\\:bg-gray-400 {\n &:disabled {\n background-color: var(--color-gray-400);\n }\n }\n .lg\\:top-auto {\n @media (width >= 64rem) {\n top: auto;\n }\n }\n .lg\\:right-5 {\n @media (width >= 64rem) {\n right: calc(var(--spacing) * 5);\n }\n }\n .lg\\:bottom-20 {\n @media (width >= 64rem) {\n bottom: calc(var(--spacing) * 20);\n }\n }\n .lg\\:hidden {\n @media (width >= 64rem) {\n display: none;\n }\n }\n .lg\\:h-46 {\n @media (width >= 64rem) {\n height: calc(var(--spacing) * 46);\n }\n }\n .lg\\:max-h-201 {\n @media (width >= 64rem) {\n max-height: calc(var(--spacing) * 201);\n }\n }\n .lg\\:w-107\\.5 {\n @media (width >= 64rem) {\n width: calc(var(--spacing) * 107.5);\n }\n }\n .lg\\:max-w-80 {\n @media (width >= 64rem) {\n max-width: calc(var(--spacing) * 80);\n }\n }\n .lg\\:flex-wrap {\n @media (width >= 64rem) {\n flex-wrap: wrap;\n }\n }\n .lg\\:rounded-4xl {\n @media (width >= 64rem) {\n border-radius: var(--radius-4xl);\n }\n }\n}\n@layer base {\n * {\n font-family: var(--font-sukhumvit);\n }\n}\n@layer utilities {\n .scrollbar-hide::-webkit-scrollbar {\n display: none;\n }\n .scrollbar-hide {\n -ms-overflow-style: none;\n scrollbar-width: none;\n }\n}\n@property --tw-translate-x { syntax: "*"; inherits: false; initial-value: 0; }\n@property --tw-translate-y { syntax: "*"; inherits: false; initial-value: 0; }\n@property --tw-translate-z { syntax: "*"; inherits: false; initial-value: 0; }\n@property --tw-space-y-reverse { syntax: "*"; inherits: false; initial-value: 0; }\n@property --tw-border-style { syntax: "*"; inherits: false; initial-value: solid; }\n@property --tw-gradient-position { syntax: "*"; inherits: false; }\n@property --tw-gradient-from { syntax: "<color>"; inherits: false; initial-value: #0000; }\n@property --tw-gradient-via { syntax: "<color>"; inherits: false; initial-value: #0000; }\n@property --tw-gradient-to { syntax: "<color>"; inherits: false; initial-value: #0000; }\n@property --tw-gradient-stops { syntax: "*"; inherits: false; }\n@property --tw-gradient-via-stops { syntax: "*"; inherits: false; }\n@property --tw-gradient-from-position { syntax: "<length-percentage>"; inherits: false; initial-value: 0%; }\n@property --tw-gradient-via-position { syntax: "<length-percentage>"; inherits: false; initial-value: 50%; }\n@property --tw-gradient-to-position { syntax: "<length-percentage>"; inherits: false; initial-value: 100%; }\n@property --tw-font-weight { syntax: "*"; inherits: false; }\n@property --tw-shadow { syntax: "*"; inherits: false; initial-value: 0 0 #0000; }\n@property --tw-shadow-color { syntax: "*"; inherits: false; }\n@property --tw-shadow-alpha { syntax: "<percentage>"; inherits: false; initial-value: 100%; }\n@property --tw-inset-shadow { syntax: "*"; inherits: false; initial-value: 0 0 #0000; }\n@property --tw-inset-shadow-color { syntax: "*"; inherits: false; }\n@property --tw-inset-shadow-alpha { syntax: "<percentage>"; inherits: false; initial-value: 100%; }\n@property --tw-ring-color { syntax: "*"; inherits: false; }\n@property --tw-ring-shadow { syntax: "*"; inherits: false; initial-value: 0 0 #0000; }\n@property --tw-inset-ring-color { syntax: "*"; inherits: false; }\n@property --tw-inset-ring-shadow { syntax: "*"; inherits: false; initial-value: 0 0 #0000; }\n@property --tw-ring-inset { syntax: "*"; inherits: false; }\n@property --tw-ring-offset-width { syntax: "<length>"; inherits: false; initial-value: 0px; }\n@property --tw-ring-offset-color { syntax: "*"; inherits: false; initial-value: #fff; }\n@property --tw-ring-offset-shadow { syntax: "*"; inherits: false; initial-value: 0 0 #0000; }\n@keyframes wiggle {\n 0%, 100% {\n transform: translateY(-50%);\n animation-timing-function: cubic-bezier(0.8, 0, 1, 1);\n }\n 50% {\n transform: none;\n animation-timing-function: cubic-bezier(0, 0, 0.2, 1);\n }\n}\n@layer properties {\n @supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))) {\n *,\n ::before,\n ::after,\n ::backdrop {\n --tw-translate-x: 0;\n --tw-translate-y: 0;\n --tw-translate-z: 0;\n --tw-space-y-reverse: 0;\n --tw-border-style: solid;\n --tw-gradient-position: initial;\n --tw-gradient-from: #0000;\n --tw-gradient-via: #0000;\n --tw-gradient-to: #0000;\n --tw-gradient-stops: initial;\n --tw-gradient-via-stops: initial;\n --tw-gradient-from-position: 0%;\n --tw-gradient-via-position: 50%;\n --tw-gradient-to-position: 100%;\n --tw-font-weight: initial;\n --tw-shadow: 0 0 #0000;\n --tw-shadow-color: initial;\n --tw-shadow-alpha: 100%;\n --tw-inset-shadow: 0 0 #0000;\n --tw-inset-shadow-color: initial;\n --tw-inset-shadow-alpha: 100%;\n --tw-ring-color: initial;\n --tw-ring-shadow: 0 0 #0000;\n --tw-inset-ring-color: initial;\n --tw-inset-ring-shadow: 0 0 #0000;\n --tw-ring-inset: initial;\n --tw-ring-offset-width: 0px;\n --tw-ring-offset-color: #fff;\n --tw-ring-offset-shadow: 0 0 #0000;\n }\n }\n}\n');
|
|
108
|
+
|
|
109
|
+
// src/constant/default.ts
|
|
110
|
+
var defaultQuickMenuMessage = "\u0E2A\u0E27\u0E31\u0E2A\u0E14\u0E35\u0E04\u0E23\u0E31\u0E1A Brooklyn! \u{1F44B} UTECH \u0E1E\u0E23\u0E49\u0E2D\u0E21\u0E0A\u0E48\u0E27\u0E22\u0E04\u0E38\u0E13\u0E2B\u0E32\u0E2D\u0E38\u0E1B\u0E01\u0E23\u0E13\u0E4C IT \u0E17\u0E35\u0E48\u0E15\u0E2D\u0E1A\u0E42\u0E08\u0E17\u0E22\u0E4C\u0E17\u0E35\u0E48\u0E2A\u0E38\u0E14 \u0E44\u0E21\u0E48\u0E27\u0E48\u0E32\u0E08\u0E30\u0E40\u0E1B\u0E47\u0E19\u0E04\u0E2D\u0E21\u0E1E\u0E34\u0E27\u0E40\u0E15\u0E2D\u0E23\u0E4C \u0E2D\u0E38\u0E1B\u0E01\u0E23\u0E13\u0E4C\u0E40\u0E2A\u0E23\u0E34\u0E21 \u0E2B\u0E23\u0E37\u0E2D\u0E2D\u0E30\u0E44\u0E23\u0E01\u0E47\u0E15\u0E32\u0E21 \u0E16\u0E32\u0E21\u0E44\u0E14\u0E49\u0E40\u0E25\u0E22\u0E04\u0E23\u0E31\u0E1A \u{1F60A}";
|
|
111
|
+
var defaultBanner = "https://utech-dev.zimpligital.com/_next/image?url=%2F_next%2Fstatic%2Fmedia%2Fcoupon-banner-th.edad52fd.webp&w=640&q=75";
|
|
112
|
+
var defaultQuickMenus = [
|
|
113
|
+
{ id: "1", title: "\u0E2A\u0E31\u0E48\u0E07\u0E0B\u0E37\u0E49\u0E2D\u0E2A\u0E34\u0E19\u0E04\u0E49\u0E32 \u{1F6CD}\uFE0F", value: "\u0E2A\u0E31\u0E48\u0E07\u0E0B\u0E37\u0E49\u0E2D\u0E2A\u0E34\u0E19\u0E04\u0E49\u0E32", mockResponse: "QUICK_MENU_SHOP" /* QUICK_MENU_SHOP */ },
|
|
114
|
+
{ id: "2", title: "\u0E0A\u0E48\u0E27\u0E22\u0E2B\u0E32\u0E2A\u0E34\u0E19\u0E04\u0E49\u0E32 \u{1F50D}", value: "\u0E0A\u0E48\u0E27\u0E22\u0E2B\u0E32\u0E2A\u0E34\u0E19\u0E04\u0E49\u0E32", mockResponse: "ERROR" /* ERROR */ },
|
|
115
|
+
{ id: "3", title: "\u0E15\u0E34\u0E14\u0E15\u0E32\u0E21\u0E1E\u0E31\u0E2A\u0E14\u0E38 \u{1F69A}", value: "\u0E15\u0E34\u0E14\u0E15\u0E32\u0E21\u0E1E\u0E31\u0E2A\u0E14\u0E38", mockResponse: "ERROR" /* ERROR */ },
|
|
116
|
+
{ id: "4", title: "\u0E2B\u0E31\u0E27\u0E02\u0E49\u0E2D\u0E2D\u0E37\u0E48\u0E19\u0E46 \u{1F4AC}", value: "\u0E2B\u0E31\u0E27\u0E02\u0E49\u0E2D\u0E2D\u0E37\u0E48\u0E19\u0E46", mockResponse: "ERROR" /* ERROR */ }
|
|
117
|
+
];
|
|
118
|
+
var defaultCategory = [
|
|
119
|
+
{ id: "1", title: "\u0E2A\u0E21\u0E32\u0E23\u0E4C\u0E17\u0E42\u0E1F\u0E19", value: "\u0E2A\u0E21\u0E32\u0E23\u0E4C\u0E17\u0E42\u0E1F\u0E19", mockResponse: "CATEGORY_SMARTPHONE" /* CATEGORY_SMARTPHONE */ },
|
|
120
|
+
{ id: "2", title: "\u0E42\u0E19\u0E4A\u0E15\u0E1A\u0E38\u0E4A\u0E04", value: "\u0E42\u0E19\u0E4A\u0E15\u0E1A\u0E38\u0E4A\u0E04", mockResponse: "CATEGORY_NOTEBOOK" /* CATEGORY_NOTEBOOK */ },
|
|
121
|
+
{ id: "3", title: "\u0E04\u0E2D\u0E21\u0E1E\u0E34\u0E27\u0E40\u0E15\u0E2D\u0E23\u0E4C", value: "\u0E04\u0E2D\u0E21\u0E1E\u0E34\u0E27\u0E40\u0E15\u0E2D\u0E23\u0E4C", mockResponse: "ERROR" /* ERROR */ },
|
|
122
|
+
{ id: "4", title: "\u0E40\u0E01\u0E21\u0E21\u0E34\u0E48\u0E07\u0E40\u0E01\u0E35\u0E22\u0E23\u0E4C", value: "\u0E40\u0E01\u0E21\u0E21\u0E34\u0E48\u0E07\u0E40\u0E01\u0E35\u0E22\u0E23\u0E4C", mockResponse: "ERROR" /* ERROR */ },
|
|
123
|
+
{ id: "5", title: "\u0E40\u0E01\u0E21\u0E04\u0E2D\u0E19\u0E42\u0E0B\u0E25", value: "\u0E40\u0E01\u0E21\u0E04\u0E2D\u0E19\u0E42\u0E0B\u0E25", mockResponse: "ERROR" /* ERROR */ },
|
|
124
|
+
{ id: "6", title: "\u0E41\u0E01\u0E14\u0E40\u0E08\u0E47\u0E15 ", value: "\u0E41\u0E01\u0E14\u0E40\u0E08\u0E47\u0E15 ", mockResponse: "ERROR" /* ERROR */ }
|
|
125
|
+
];
|
|
126
|
+
var tryAgain = "\u0E25\u0E2D\u0E07\u0E43\u0E2B\u0E21\u0E48\u0E2D\u0E35\u0E01\u0E04\u0E23\u0E31\u0E49\u0E07";
|
|
127
|
+
var defaultFailMenu = [
|
|
128
|
+
{ id: "1", title: "\u0E25\u0E2D\u0E07\u0E43\u0E2B\u0E21\u0E48\u0E2D\u0E35\u0E01\u0E04\u0E23\u0E31\u0E49\u0E07 \u{1F504}\xA0", value: "\u0E2A\u0E31\u0E48\u0E07\u0E0B\u0E37\u0E49\u0E2D\u0E2A\u0E34\u0E19\u0E04\u0E49\u0E32 \u{1F6CD}\uFE0F", mockResponse: "ERROR" /* ERROR */ },
|
|
129
|
+
{ id: "2", title: "\u0E15\u0E34\u0E14\u0E15\u0E48\u0E2D\u0E40\u0E23\u0E32 \u{1F4DE}\xA0", phoneNumber: "099999999", mockResponse: "ERROR" /* ERROR */ }
|
|
130
|
+
];
|
|
131
|
+
var defaultQuickMenuChips = [
|
|
132
|
+
{ id: "1", title: "\u0E0B\u0E37\u0E49\u0E2D\u0E02\u0E2D\u0E07/\u0E0A\u0E33\u0E23\u0E30\u0E40\u0E07\u0E34\u0E19\u0E44\u0E21\u0E48\u0E44\u0E14\u0E49", value: "\u0E0B\u0E37\u0E49\u0E2D\u0E02\u0E2D\u0E07/\u0E0A\u0E33\u0E23\u0E30\u0E40\u0E07\u0E34\u0E19\u0E44\u0E21\u0E48\u0E44\u0E14\u0E49", mockResponse: "PAYMENT_METHODS" /* PAYMENT_METHODS */ },
|
|
133
|
+
{ id: "2", title: "\u0E43\u0E0A\u0E49\u0E42\u0E04\u0E49\u0E14\u0E2A\u0E48\u0E27\u0E19\u0E25\u0E14\u0E44\u0E21\u0E48\u0E44\u0E14\u0E49", value: "\u0E43\u0E0A\u0E49\u0E42\u0E04\u0E49\u0E14\u0E2A\u0E48\u0E27\u0E19\u0E25\u0E14\u0E44\u0E21\u0E48\u0E44\u0E14\u0E49", mockResponse: "CODE_CANT_USE" /* CODE_CANT_USE */ },
|
|
134
|
+
{ id: "3", title: "\u0E43\u0E0A\u0E49\u0E42\u0E04\u0E49\u0E14\u0E2A\u0E48\u0E27\u0E19\u0E25\u0E14\u0E44\u0E21\u0E48\u0E44\u0E14\u0E49", value: "\u0E43\u0E0A\u0E49\u0E42\u0E04\u0E49\u0E14\u0E2A\u0E48\u0E27\u0E19\u0E25\u0E14\u0E44\u0E21\u0E48\u0E44\u0E14\u0E49", mockResponse: "CODE_CANT_USE" /* CODE_CANT_USE */ },
|
|
135
|
+
{ id: "4", title: "\u0E43\u0E0A\u0E49\u0E42\u0E04\u0E49\u0E14\u0E2A\u0E48\u0E27\u0E19\u0E25\u0E14\u0E44\u0E21\u0E48\u0E44\u0E14\u0E49", value: "\u0E43\u0E0A\u0E49\u0E42\u0E04\u0E49\u0E14\u0E2A\u0E48\u0E27\u0E19\u0E25\u0E14\u0E44\u0E21\u0E48\u0E44\u0E14\u0E49", mockResponse: "CODE_CANT_USE" /* CODE_CANT_USE */ }
|
|
136
|
+
];
|
|
137
|
+
var budgetRanges = [
|
|
138
|
+
{ id: "1", title: "\u0E15\u0E48\u0E33\u0E01\u0E27\u0E48\u0E32 10,000 \u0E1A\u0E32\u0E17", value: "\u0E15\u0E48\u0E33\u0E01\u0E27\u0E48\u0E32 10,000 \u0E1A\u0E32\u0E17", mockResponse: "PRODUCT_FOUND_LESS_10000" /* PRODUCT_FOUND_LESS_10000 */ },
|
|
139
|
+
{ id: "2", title: "10,000 - 20,000 \u0E1A\u0E32\u0E17", value: "10,000 - 20,000 \u0E1A\u0E32\u0E17", mockResponse: "PRODUCT_FOUND_RANGE_10000_20000" /* PRODUCT_FOUND_RANGE_10000_20000 */ },
|
|
140
|
+
{ id: "3", title: "20,000 - 30,000 \u0E1A\u0E32\u0E17", value: "20,000 - 30,000 \u0E1A\u0E32\u0E17", mockResponse: "PRODUCT_FOUND_RANGE_20000_30000" /* PRODUCT_FOUND_RANGE_20000_30000 */ },
|
|
141
|
+
{ id: "4", title: "\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32 30,000 \u0E1A\u0E32\u0E17", value: "\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32 30,000 \u0E1A\u0E32\u0E17", mockResponse: "PRODUCT_FOUND_MORE_30000" /* PRODUCT_FOUND_MORE_30000 */ }
|
|
142
|
+
];
|
|
143
|
+
var shippingOptions = [
|
|
144
|
+
{ id: "1", title: "\u0E08\u0E31\u0E14\u0E2A\u0E48\u0E07\u0E1B\u0E01\u0E15\u0E34 (3-5 \u0E27\u0E31\u0E19)", value: "\u0E08\u0E31\u0E14\u0E2A\u0E48\u0E07\u0E1B\u0E01\u0E15\u0E34", mockResponse: "PAYMENT_METHODS" /* PAYMENT_METHODS */ },
|
|
145
|
+
{ id: "2", title: "\u0E08\u0E31\u0E14\u0E2A\u0E48\u0E07\u0E14\u0E48\u0E27\u0E19 (1-2 \u0E27\u0E31\u0E19)", value: "\u0E08\u0E31\u0E14\u0E2A\u0E48\u0E07\u0E14\u0E48\u0E27\u0E19", mockResponse: "PAYMENT_METHODS" /* PAYMENT_METHODS */ },
|
|
146
|
+
{ id: "3", title: "\u0E23\u0E31\u0E1A\u0E40\u0E2D\u0E07\u0E17\u0E35\u0E48\u0E23\u0E49\u0E32\u0E19", value: "\u0E23\u0E31\u0E1A\u0E40\u0E2D\u0E07\u0E17\u0E35\u0E48\u0E23\u0E49\u0E32\u0E19", mockResponse: "PAYMENT_METHODS" /* PAYMENT_METHODS */ }
|
|
147
|
+
];
|
|
148
|
+
var supportTopics = [
|
|
149
|
+
{ id: "1", title: "\u0E01\u0E32\u0E23\u0E08\u0E31\u0E14\u0E2A\u0E48\u0E07 \u{1F69A}", value: "\u0E01\u0E32\u0E23\u0E08\u0E31\u0E14\u0E2A\u0E48\u0E07", mockResponse: "SHIPPING_INFO" /* SHIPPING_INFO */ },
|
|
150
|
+
{ id: "2", title: "\u0E01\u0E32\u0E23\u0E0A\u0E33\u0E23\u0E30\u0E40\u0E07\u0E34\u0E19 \u{1F4B3}", value: "\u0E01\u0E32\u0E23\u0E0A\u0E33\u0E23\u0E30\u0E40\u0E07\u0E34\u0E19", mockResponse: "PAYMENT_METHODS" /* PAYMENT_METHODS */ },
|
|
151
|
+
{ id: "3", title: "\u0E01\u0E32\u0E23\u0E04\u0E37\u0E19\u0E2A\u0E34\u0E19\u0E04\u0E49\u0E32 \u{1F504}", value: "\u0E01\u0E32\u0E23\u0E04\u0E37\u0E19\u0E2A\u0E34\u0E19\u0E04\u0E49\u0E32", mockResponse: "RETURN_POLICY" /* RETURN_POLICY */ },
|
|
152
|
+
{ id: "4", title: "\u0E01\u0E32\u0E23\u0E23\u0E31\u0E1A\u0E1B\u0E23\u0E30\u0E01\u0E31\u0E19 \u{1F6E1}\uFE0F", value: "\u0E01\u0E32\u0E23\u0E23\u0E31\u0E1A\u0E1B\u0E23\u0E30\u0E01\u0E31\u0E19", mockResponse: "WARRANTY_INFO" /* WARRANTY_INFO */ }
|
|
153
|
+
];
|
|
154
|
+
var searchableMenus = [
|
|
155
|
+
...defaultQuickMenus,
|
|
156
|
+
...defaultCategory,
|
|
157
|
+
...defaultQuickMenuChips,
|
|
158
|
+
...budgetRanges,
|
|
159
|
+
...shippingOptions,
|
|
160
|
+
...supportTopics
|
|
161
|
+
];
|
|
162
|
+
var mockResponse = {
|
|
163
|
+
["CATEGORY_SMARTPHONE" /* CATEGORY_SMARTPHONE */]: {
|
|
164
|
+
id: "bot-category-smartphone",
|
|
165
|
+
type: "BOT_TEXT_WITH_MENUS" /* BOT_TEXT_WITH_MENUS */,
|
|
166
|
+
text: "\u0E22\u0E2D\u0E14\u0E40\u0E22\u0E35\u0E48\u0E22\u0E21! \u0E04\u0E38\u0E13\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E2B\u0E21\u0E27\u0E14\u0E2B\u0E21\u0E39\u0E48\u0E2A\u0E21\u0E32\u0E23\u0E4C\u0E17\u0E42\u0E1F\u0E19\u0E41\u0E25\u0E49\u0E27 \u0E1A\u0E2D\u0E01\u0E1C\u0E21\u0E2B\u0E19\u0E48\u0E2D\u0E22\u0E04\u0E23\u0E31\u0E1A \u0E27\u0E48\u0E32\u0E07\u0E1A\u0E1B\u0E23\u0E30\u0E21\u0E32\u0E13\u0E02\u0E2D\u0E07\u0E04\u0E38\u0E13\u0E2D\u0E22\u0E39\u0E48\u0E17\u0E35\u0E48\u0E40\u0E17\u0E48\u0E32\u0E44\u0E2B\u0E23\u0E48?",
|
|
167
|
+
menus: budgetRanges
|
|
168
|
+
},
|
|
169
|
+
["CATEGORY_NOTEBOOK" /* CATEGORY_NOTEBOOK */]: {
|
|
170
|
+
id: "bot-category-notebook",
|
|
171
|
+
type: "BOT_TEXT_WITH_MENUS" /* BOT_TEXT_WITH_MENUS */,
|
|
172
|
+
text: "\u0E02\u0E13\u0E30\u0E19\u0E35\u0E49\u0E44\u0E21\u0E48\u0E21\u0E35\u0E2A\u0E34\u0E19\u0E04\u0E49\u0E32\u0E17\u0E35\u0E48\u0E04\u0E38\u0E13\u0E15\u0E32\u0E21\u0E2B\u0E32 \u0E43\u0E19\u0E2B\u0E21\u0E27\u0E14\u0E42\u0E19\u0E4A\u0E15\u0E1A\u0E38\u0E4A\u0E04\u0E04\u0E23\u0E31\u0E1A \u0E25\u0E2D\u0E07\u0E14\u0E39\u0E2B\u0E21\u0E27\u0E14\u0E2D\u0E37\u0E48\u0E19\u0E44\u0E2B\u0E21?",
|
|
173
|
+
menus: defaultCategory
|
|
174
|
+
},
|
|
175
|
+
["ERROR" /* ERROR */]: {
|
|
176
|
+
id: "bot-error-response",
|
|
177
|
+
type: "BOT_ERROR_WITH_MENUS" /* BOT_ERROR_WITH_MENUS */,
|
|
178
|
+
text: "\u0E40\u0E2D\u0E4A\u0E30! \u0E40\u0E01\u0E34\u0E14\u0E02\u0E49\u0E2D\u0E1C\u0E34\u0E14\u0E1E\u0E25\u0E32\u0E14\u0E19\u0E34\u0E14\u0E2B\u0E19\u0E48\u0E2D\u0E22\u0E04\u0E23\u0E31\u0E1A \u{1F613} \u0E44\u0E21\u0E48\u0E40\u0E1B\u0E47\u0E19\u0E44\u0E23\u0E19\u0E30 \u0E25\u0E2D\u0E07\u0E17\u0E32\u0E07\u0E19\u0E35\u0E49\u0E14\u0E39\u0E04\u0E23\u0E31\u0E1A\u{1F447}",
|
|
179
|
+
menus: defaultFailMenu
|
|
180
|
+
},
|
|
181
|
+
["QUICK_MENU_SHOP" /* QUICK_MENU_SHOP */]: {
|
|
182
|
+
id: "bot-shop-response",
|
|
183
|
+
type: "BOT_TEXT_WITH_MENUS" /* BOT_TEXT_WITH_MENUS */,
|
|
184
|
+
text: "\u0E2A\u0E19\u0E43\u0E08\u0E2A\u0E34\u0E19\u0E04\u0E49\u0E32\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E44\u0E2B\u0E19\u0E04\u0E23\u0E31\u0E1A \u0E40\u0E23\u0E32\u0E0A\u0E48\u0E27\u0E22\u0E41\u0E19\u0E30\u0E19\u0E33\u0E44\u0E14\u0E49\u0E19\u0E30 \u{1F60A}",
|
|
185
|
+
menus: defaultCategory
|
|
186
|
+
},
|
|
187
|
+
["CODE_CANT_USE" /* CODE_CANT_USE */]: {
|
|
188
|
+
id: "bot-code-cant-use",
|
|
189
|
+
type: "BOT_TEXT" /* BOT_TEXT */,
|
|
190
|
+
text: "\u0E02\u0E2D\u0E2D\u0E20\u0E31\u0E22\u0E04\u0E23\u0E31\u0E1A \u0E42\u0E04\u0E49\u0E14\u0E2A\u0E48\u0E27\u0E19\u0E25\u0E14\u0E17\u0E35\u0E48\u0E04\u0E38\u0E13\u0E43\u0E0A\u0E49\u0E44\u0E21\u0E48\u0E2A\u0E32\u0E21\u0E32\u0E23\u0E16\u0E43\u0E0A\u0E49\u0E07\u0E32\u0E19\u0E44\u0E14\u0E49\u0E43\u0E19\u0E02\u0E13\u0E30\u0E19\u0E35\u0E49 \u0E01\u0E23\u0E38\u0E13\u0E32\u0E15\u0E23\u0E27\u0E08\u0E2A\u0E2D\u0E1A\u0E40\u0E07\u0E37\u0E48\u0E2D\u0E19\u0E44\u0E02\u0E01\u0E32\u0E23\u0E43\u0E0A\u0E49\u0E07\u0E32\u0E19\u0E2B\u0E23\u0E37\u0E2D\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E42\u0E04\u0E49\u0E14\u0E2A\u0E48\u0E27\u0E19\u0E25\u0E14\u0E2D\u0E37\u0E48\u0E19\u0E04\u0E23\u0E31\u0E1A"
|
|
191
|
+
},
|
|
192
|
+
["BUDGET_INQUIRY" /* BUDGET_INQUIRY */]: {
|
|
193
|
+
id: "bot-budget-inquiry",
|
|
194
|
+
type: "BOT_TEXT_WITH_MENUS" /* BOT_TEXT_WITH_MENUS */,
|
|
195
|
+
text: "\u0E07\u0E1A\u0E1B\u0E23\u0E30\u0E21\u0E32\u0E13\u0E02\u0E2D\u0E07\u0E04\u0E38\u0E13\u0E2D\u0E22\u0E39\u0E48\u0E43\u0E19\u0E0A\u0E48\u0E27\u0E07\u0E44\u0E2B\u0E19\u0E04\u0E23\u0E31\u0E1A? \u0E40\u0E23\u0E32\u0E08\u0E30\u0E0A\u0E48\u0E27\u0E22\u0E2B\u0E32\u0E2A\u0E34\u0E19\u0E04\u0E49\u0E32\u0E17\u0E35\u0E48\u0E40\u0E2B\u0E21\u0E32\u0E30\u0E2A\u0E21\u0E43\u0E2B\u0E49 \u{1F60A}",
|
|
196
|
+
menus: budgetRanges
|
|
197
|
+
},
|
|
198
|
+
["PRODUCT_FOUND_LESS_10000" /* PRODUCT_FOUND_LESS_10000 */]: {
|
|
199
|
+
id: "bot-product-found",
|
|
200
|
+
type: "BOT_TEXT_WITH_MENUS" /* BOT_TEXT_WITH_MENUS */,
|
|
201
|
+
text: "\u0E40\u0E08\u0E2D\u0E41\u0E25\u0E49\u0E27\u0E04\u0E23\u0E31\u0E1A! \u0E40\u0E23\u0E32\u0E21\u0E35\u0E2A\u0E34\u0E19\u0E04\u0E49\u0E32\u0E17\u0E35\u0E48\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E17\u0E35\u0E48\u0E04\u0E38\u0E13\u0E15\u0E49\u0E2D\u0E07\u0E01\u0E32\u0E23 \u{1F389}\n\niPhone 4 Pro 16GB\n\u0E23\u0E32\u0E04\u0E32: \u0E3F5,900\n- \u0E2B\u0E19\u0E49\u0E32\u0E08\u0E2D 6.9 \u0E19\u0E34\u0E49\u0E27\n- \u0E0A\u0E34\u0E1B A18 Pro\n- \u0E01\u0E25\u0E49\u0E2D\u0E07 48MP\n\n\u0E2A\u0E19\u0E43\u0E08\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E0A\u0E48\u0E2D\u0E07\u0E17\u0E32\u0E07\u0E08\u0E31\u0E14\u0E2A\u0E48\u0E07\u0E44\u0E2B\u0E21\u0E04\u0E23\u0E31\u0E1A?",
|
|
202
|
+
menus: shippingOptions
|
|
203
|
+
},
|
|
204
|
+
["PRODUCT_FOUND_RANGE_10000_20000" /* PRODUCT_FOUND_RANGE_10000_20000 */]: {
|
|
205
|
+
id: "bot-product-found",
|
|
206
|
+
type: "BOT_TEXT_WITH_MENUS" /* BOT_TEXT_WITH_MENUS */,
|
|
207
|
+
text: "\u0E40\u0E08\u0E2D\u0E41\u0E25\u0E49\u0E27\u0E04\u0E23\u0E31\u0E1A! \u0E40\u0E23\u0E32\u0E21\u0E35\u0E2A\u0E34\u0E19\u0E04\u0E49\u0E32\u0E17\u0E35\u0E48\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E17\u0E35\u0E48\u0E04\u0E38\u0E13\u0E15\u0E49\u0E2D\u0E07\u0E01\u0E32\u0E23 \u{1F389}\n\niPhone 16 Pro Max 128GB\n\u0E23\u0E32\u0E04\u0E32: \u0E3F19,000\n- \u0E2B\u0E19\u0E49\u0E32\u0E08\u0E2D 6.9 \u0E19\u0E34\u0E49\u0E27\n- \u0E0A\u0E34\u0E1B A18 Pro\n- \u0E01\u0E25\u0E49\u0E2D\u0E07 48MP\n\n\u0E2A\u0E19\u0E43\u0E08\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E0A\u0E48\u0E2D\u0E07\u0E17\u0E32\u0E07\u0E08\u0E31\u0E14\u0E2A\u0E48\u0E07\u0E44\u0E2B\u0E21\u0E04\u0E23\u0E31\u0E1A?",
|
|
208
|
+
menus: shippingOptions
|
|
209
|
+
},
|
|
210
|
+
["PRODUCT_FOUND_RANGE_20000_30000" /* PRODUCT_FOUND_RANGE_20000_30000 */]: {
|
|
211
|
+
id: "bot-product-found",
|
|
212
|
+
type: "BOT_TEXT_WITH_MENUS" /* BOT_TEXT_WITH_MENUS */,
|
|
213
|
+
text: "\u0E40\u0E08\u0E2D\u0E41\u0E25\u0E49\u0E27\u0E04\u0E23\u0E31\u0E1A! \u0E40\u0E23\u0E32\u0E21\u0E35\u0E2A\u0E34\u0E19\u0E04\u0E49\u0E32\u0E17\u0E35\u0E48\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E17\u0E35\u0E48\u0E04\u0E38\u0E13\u0E15\u0E49\u0E2D\u0E07\u0E01\u0E32\u0E23 \u{1F389}\n\niPhone 16 Pro Max 256GB\n\u0E23\u0E32\u0E04\u0E32: \u0E3F30,000\n- \u0E2B\u0E19\u0E49\u0E32\u0E08\u0E2D 6.9 \u0E19\u0E34\u0E49\u0E27\n- \u0E0A\u0E34\u0E1B A18 Pro\n- \u0E01\u0E25\u0E49\u0E2D\u0E07 48MP\n\n\u0E2A\u0E19\u0E43\u0E08\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E0A\u0E48\u0E2D\u0E07\u0E17\u0E32\u0E07\u0E08\u0E31\u0E14\u0E2A\u0E48\u0E07\u0E44\u0E2B\u0E21\u0E04\u0E23\u0E31\u0E1A?",
|
|
214
|
+
menus: shippingOptions
|
|
215
|
+
},
|
|
216
|
+
["PRODUCT_FOUND_MORE_30000" /* PRODUCT_FOUND_MORE_30000 */]: {
|
|
217
|
+
id: "bot-product-found",
|
|
218
|
+
type: "BOT_TEXT_WITH_MENUS" /* BOT_TEXT_WITH_MENUS */,
|
|
219
|
+
text: "\u0E40\u0E08\u0E2D\u0E41\u0E25\u0E49\u0E27\u0E04\u0E23\u0E31\u0E1A! \u0E40\u0E23\u0E32\u0E21\u0E35\u0E2A\u0E34\u0E19\u0E04\u0E49\u0E32\u0E17\u0E35\u0E48\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E17\u0E35\u0E48\u0E04\u0E38\u0E13\u0E15\u0E49\u0E2D\u0E07\u0E01\u0E32\u0E23 \u{1F389}\n\niPhone 16 Pro Max 512GB\n\u0E23\u0E32\u0E04\u0E32: \u0E3F45,900\n- \u0E2B\u0E19\u0E49\u0E32\u0E08\u0E2D 6.9 \u0E19\u0E34\u0E49\u0E27\n- \u0E0A\u0E34\u0E1B A18 Pro\n- \u0E01\u0E25\u0E49\u0E2D\u0E07 48MP\n\n\u0E2A\u0E19\u0E43\u0E08\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E0A\u0E48\u0E2D\u0E07\u0E17\u0E32\u0E07\u0E08\u0E31\u0E14\u0E2A\u0E48\u0E07\u0E44\u0E2B\u0E21\u0E04\u0E23\u0E31\u0E1A?",
|
|
220
|
+
menus: shippingOptions
|
|
221
|
+
},
|
|
222
|
+
["SHIPPING_INFO" /* SHIPPING_INFO */]: {
|
|
223
|
+
id: "bot-shipping-info",
|
|
224
|
+
type: "BOT_TEXT" /* BOT_TEXT */,
|
|
225
|
+
text: "\u{1F4E6} \u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E01\u0E32\u0E23\u0E08\u0E31\u0E14\u0E2A\u0E48\u0E07\n\n\u2705 \u0E08\u0E31\u0E14\u0E2A\u0E48\u0E07\u0E1F\u0E23\u0E35 \u0E2A\u0E33\u0E2B\u0E23\u0E31\u0E1A\u0E04\u0E33\u0E2A\u0E31\u0E48\u0E07\u0E0B\u0E37\u0E49\u0E2D\u0E15\u0E31\u0E49\u0E07\u0E41\u0E15\u0E48 1,000 \u0E1A\u0E32\u0E17\u0E02\u0E36\u0E49\u0E19\u0E44\u0E1B\n\u2705 \u0E08\u0E31\u0E14\u0E2A\u0E48\u0E07\u0E1B\u0E01\u0E15\u0E34 3-5 \u0E27\u0E31\u0E19\u0E17\u0E33\u0E01\u0E32\u0E23\n\u2705 \u0E08\u0E31\u0E14\u0E2A\u0E48\u0E07\u0E14\u0E48\u0E27\u0E19 1-2 \u0E27\u0E31\u0E19\u0E17\u0E33\u0E01\u0E32\u0E23 (\u0E40\u0E2A\u0E35\u0E22\u0E04\u0E48\u0E32\u0E1A\u0E23\u0E34\u0E01\u0E32\u0E23\u0E40\u0E1E\u0E34\u0E48\u0E21 100 \u0E1A\u0E32\u0E17)\n\u2705 \u0E23\u0E31\u0E1A\u0E40\u0E2D\u0E07\u0E17\u0E35\u0E48\u0E23\u0E49\u0E32\u0E19\u0E44\u0E14\u0E49\u0E17\u0E31\u0E19\u0E17\u0E35\n\n\u0E15\u0E49\u0E2D\u0E07\u0E01\u0E32\u0E23\u0E2A\u0E2D\u0E1A\u0E16\u0E32\u0E21\u0E40\u0E1E\u0E34\u0E48\u0E21\u0E40\u0E15\u0E34\u0E21\u0E44\u0E2B\u0E21\u0E04\u0E23\u0E31\u0E1A?"
|
|
226
|
+
},
|
|
227
|
+
["PAYMENT_METHODS" /* PAYMENT_METHODS */]: {
|
|
228
|
+
id: "bot-payment-methods",
|
|
229
|
+
type: "BOT_TEXT" /* BOT_TEXT */,
|
|
230
|
+
text: "\u{1F4B3} \u0E0A\u0E48\u0E2D\u0E07\u0E17\u0E32\u0E07\u0E01\u0E32\u0E23\u0E0A\u0E33\u0E23\u0E30\u0E40\u0E07\u0E34\u0E19\n\n\u2705 \u0E42\u0E2D\u0E19\u0E1C\u0E48\u0E32\u0E19\u0E18\u0E19\u0E32\u0E04\u0E32\u0E23\n\u2705 \u0E1A\u0E31\u0E15\u0E23\u0E40\u0E04\u0E23\u0E14\u0E34\u0E15/\u0E40\u0E14\u0E1A\u0E34\u0E15 (Visa, Mastercard, JCB)\n\u2705 \u0E1E\u0E23\u0E49\u0E2D\u0E21\u0E40\u0E1E\u0E22\u0E4C\n\u2705 \u0E1C\u0E48\u0E2D\u0E19\u0E0A\u0E33\u0E23\u0E30 0% (\u0E1A\u0E31\u0E15\u0E23\u0E40\u0E04\u0E23\u0E14\u0E34\u0E15\u0E18\u0E19\u0E32\u0E04\u0E32\u0E23\u0E0A\u0E31\u0E49\u0E19\u0E19\u0E33)\n\u2705 \u0E40\u0E01\u0E47\u0E1A\u0E40\u0E07\u0E34\u0E19\u0E1B\u0E25\u0E32\u0E22\u0E17\u0E32\u0E07\n\n\u0E0A\u0E33\u0E23\u0E30\u0E14\u0E49\u0E27\u0E22\u0E27\u0E34\u0E18\u0E35\u0E44\u0E2B\u0E19\u0E2A\u0E30\u0E14\u0E27\u0E01\u0E04\u0E23\u0E31\u0E1A?"
|
|
231
|
+
},
|
|
232
|
+
["WARRANTY_INFO" /* WARRANTY_INFO */]: {
|
|
233
|
+
id: "bot-warranty-info",
|
|
234
|
+
type: "BOT_TEXT" /* BOT_TEXT */,
|
|
235
|
+
text: "\u{1F6E1}\uFE0F \u0E40\u0E07\u0E37\u0E48\u0E2D\u0E19\u0E44\u0E02\u0E01\u0E32\u0E23\u0E23\u0E31\u0E1A\u0E1B\u0E23\u0E30\u0E01\u0E31\u0E19\n\n\u2705 \u0E23\u0E31\u0E1A\u0E1B\u0E23\u0E30\u0E01\u0E31\u0E19\u0E2A\u0E34\u0E19\u0E04\u0E49\u0E32 1 \u0E1B\u0E35\u0E40\u0E15\u0E47\u0E21 (\u0E15\u0E32\u0E21\u0E40\u0E07\u0E37\u0E48\u0E2D\u0E19\u0E44\u0E02\u0E1C\u0E39\u0E49\u0E1C\u0E25\u0E34\u0E15)\n\u2705 \u0E28\u0E39\u0E19\u0E22\u0E4C\u0E1A\u0E23\u0E34\u0E01\u0E32\u0E23\u0E17\u0E31\u0E48\u0E27\u0E1B\u0E23\u0E30\u0E40\u0E17\u0E28\n\u2705 \u0E40\u0E1B\u0E25\u0E35\u0E48\u0E22\u0E19\u0E2A\u0E34\u0E19\u0E04\u0E49\u0E32\u0E43\u0E2B\u0E21\u0E48 \u0E2B\u0E32\u0E01\u0E15\u0E23\u0E27\u0E08\u0E2A\u0E2D\u0E1A\u0E1E\u0E1A\u0E27\u0E48\u0E32\u0E40\u0E1B\u0E47\u0E19\u0E02\u0E2D\u0E07\u0E40\u0E2A\u0E35\u0E22\u0E08\u0E32\u0E01\u0E42\u0E23\u0E07\u0E07\u0E32\u0E19\n\u2705 \u0E0B\u0E48\u0E2D\u0E21\u0E1F\u0E23\u0E35 \u0E2B\u0E32\u0E01\u0E0A\u0E33\u0E23\u0E38\u0E14\u0E08\u0E32\u0E01\u0E01\u0E32\u0E23\u0E43\u0E0A\u0E49\u0E07\u0E32\u0E19\u0E1B\u0E01\u0E15\u0E34\n\n\u0E2B\u0E21\u0E32\u0E22\u0E40\u0E2B\u0E15\u0E38: \u0E44\u0E21\u0E48\u0E23\u0E27\u0E21\u0E04\u0E27\u0E32\u0E21\u0E40\u0E2A\u0E35\u0E22\u0E2B\u0E32\u0E22\u0E08\u0E32\u0E01\u0E01\u0E32\u0E23\u0E43\u0E0A\u0E49\u0E07\u0E32\u0E19\u0E17\u0E35\u0E48\u0E1C\u0E34\u0E14\u0E27\u0E34\u0E18\u0E35\u0E2B\u0E23\u0E37\u0E2D\u0E2D\u0E38\u0E1A\u0E31\u0E15\u0E34\u0E40\u0E2B\u0E15\u0E38"
|
|
236
|
+
},
|
|
237
|
+
["RETURN_POLICY" /* RETURN_POLICY */]: {
|
|
238
|
+
id: "bot-return-policy",
|
|
239
|
+
type: "BOT_TEXT" /* BOT_TEXT */,
|
|
240
|
+
text: "\u{1F504} \u0E19\u0E42\u0E22\u0E1A\u0E32\u0E22\u0E01\u0E32\u0E23\u0E04\u0E37\u0E19\u0E2A\u0E34\u0E19\u0E04\u0E49\u0E32\n\n\u2705 \u0E04\u0E37\u0E19\u0E2A\u0E34\u0E19\u0E04\u0E49\u0E32\u0E44\u0E14\u0E49\u0E20\u0E32\u0E22\u0E43\u0E19 7 \u0E27\u0E31\u0E19\n\u2705 \u0E2A\u0E34\u0E19\u0E04\u0E49\u0E32\u0E15\u0E49\u0E2D\u0E07\u0E2D\u0E22\u0E39\u0E48\u0E43\u0E19\u0E2A\u0E20\u0E32\u0E1E\u0E40\u0E14\u0E34\u0E21 \u0E1E\u0E23\u0E49\u0E2D\u0E21\u0E01\u0E25\u0E48\u0E2D\u0E07\u0E41\u0E25\u0E30\u0E2D\u0E38\u0E1B\u0E01\u0E23\u0E13\u0E4C\u0E04\u0E23\u0E1A\u0E16\u0E49\u0E27\u0E19\n\u2705 \u0E44\u0E21\u0E48\u0E21\u0E35\u0E23\u0E2D\u0E22\u0E01\u0E23\u0E2D\u0E22\u0E01\u0E32\u0E23\u0E43\u0E0A\u0E49\u0E07\u0E32\u0E19\n\u2705 \u0E04\u0E37\u0E19\u0E40\u0E07\u0E34\u0E19\u0E40\u0E15\u0E47\u0E21\u0E08\u0E33\u0E19\u0E27\u0E19 (\u0E2B\u0E31\u0E01\u0E04\u0E48\u0E32\u0E08\u0E31\u0E14\u0E2A\u0E48\u0E07)\n\n\u274C \u0E44\u0E21\u0E48\u0E23\u0E31\u0E1A\u0E04\u0E37\u0E19: \u0E2A\u0E34\u0E19\u0E04\u0E49\u0E32\u0E25\u0E14\u0E23\u0E32\u0E04\u0E32\u0E1E\u0E34\u0E40\u0E28\u0E29, \u0E2A\u0E34\u0E19\u0E04\u0E49\u0E32 Clearance Sale\n\n\u0E15\u0E49\u0E2D\u0E07\u0E01\u0E32\u0E23\u0E14\u0E33\u0E40\u0E19\u0E34\u0E19\u0E01\u0E32\u0E23\u0E04\u0E37\u0E19\u0E2A\u0E34\u0E19\u0E04\u0E49\u0E32\u0E44\u0E2B\u0E21\u0E04\u0E23\u0E31\u0E1A?"
|
|
241
|
+
},
|
|
242
|
+
["PROMOTION_INFO" /* PROMOTION_INFO */]: {
|
|
243
|
+
id: "bot-promotion-info",
|
|
244
|
+
type: "BOT_TEXT" /* BOT_TEXT */,
|
|
245
|
+
text: "\u{1F389} \u0E42\u0E1B\u0E23\u0E42\u0E21\u0E0A\u0E31\u0E48\u0E19\u0E1E\u0E34\u0E40\u0E28\u0E29\u0E1B\u0E23\u0E30\u0E08\u0E33\u0E40\u0E14\u0E37\u0E2D\u0E19\n\n\u{1F525} \u0E25\u0E14\u0E2A\u0E39\u0E07\u0E2A\u0E38\u0E14 30% \u0E2A\u0E34\u0E19\u0E04\u0E49\u0E32\u0E17\u0E38\u0E01\u0E2B\u0E21\u0E27\u0E14\n\u{1F525} \u0E0B\u0E37\u0E49\u0E2D\u0E04\u0E23\u0E1A 5,000 \u0E1A\u0E32\u0E17 \u0E23\u0E31\u0E1A\u0E2A\u0E48\u0E27\u0E19\u0E25\u0E14 500 \u0E1A\u0E32\u0E17\n\u{1F525} \u0E1C\u0E48\u0E2D\u0E19 0% \u0E19\u0E32\u0E19 10 \u0E40\u0E14\u0E37\u0E2D\u0E19\n\u{1F525} \u0E02\u0E2D\u0E07\u0E41\u0E16\u0E21\u0E21\u0E39\u0E25\u0E04\u0E48\u0E32\u0E2A\u0E39\u0E07 \u0E2A\u0E33\u0E2B\u0E23\u0E31\u0E1A\u0E25\u0E39\u0E01\u0E04\u0E49\u0E32\u0E43\u0E2B\u0E21\u0E48\n\n\u0E43\u0E0A\u0E49\u0E42\u0E04\u0E49\u0E14: UTECH2024 \u0E23\u0E31\u0E1A\u0E2A\u0E48\u0E27\u0E19\u0E25\u0E14\u0E40\u0E1E\u0E34\u0E48\u0E21\u0E2D\u0E35\u0E01 5%!"
|
|
246
|
+
},
|
|
247
|
+
["STOCK_AVAILABLE" /* STOCK_AVAILABLE */]: {
|
|
248
|
+
id: "bot-stock-available",
|
|
249
|
+
type: "BOT_TEXT" /* BOT_TEXT */,
|
|
250
|
+
text: "\u2705 \u0E2A\u0E34\u0E19\u0E04\u0E49\u0E32\u0E21\u0E35\u0E43\u0E19\u0E2A\u0E15\u0E47\u0E2D\u0E01\u0E04\u0E23\u0E31\u0E1A!\n\n\u0E1E\u0E23\u0E49\u0E2D\u0E21\u0E08\u0E31\u0E14\u0E2A\u0E48\u0E07\u0E17\u0E31\u0E19\u0E17\u0E35 \u0E2B\u0E32\u0E01\u0E2A\u0E31\u0E48\u0E07\u0E0B\u0E37\u0E49\u0E2D\u0E20\u0E32\u0E22\u0E43\u0E19\u0E27\u0E31\u0E19\u0E19\u0E35\u0E49\n\u0E40\u0E2B\u0E25\u0E37\u0E2D\u0E2A\u0E34\u0E19\u0E04\u0E49\u0E32: 15 \u0E0A\u0E34\u0E49\u0E19\n\n\u0E15\u0E49\u0E2D\u0E07\u0E01\u0E32\u0E23\u0E2A\u0E31\u0E48\u0E07\u0E0B\u0E37\u0E49\u0E2D\u0E40\u0E25\u0E22\u0E44\u0E2B\u0E21\u0E04\u0E23\u0E31\u0E1A?"
|
|
251
|
+
},
|
|
252
|
+
["OUT_OF_STOCK" /* OUT_OF_STOCK */]: {
|
|
253
|
+
id: "bot-out-of-stock",
|
|
254
|
+
type: "BOT_TEXT_WITH_MENUS" /* BOT_TEXT_WITH_MENUS */,
|
|
255
|
+
text: "\u{1F614} \u0E02\u0E2D\u0E2D\u0E20\u0E31\u0E22\u0E04\u0E23\u0E31\u0E1A \u0E2A\u0E34\u0E19\u0E04\u0E49\u0E32\u0E2B\u0E21\u0E14\u0E0A\u0E31\u0E48\u0E27\u0E04\u0E23\u0E32\u0E27\n\n\u0E04\u0E32\u0E14\u0E27\u0E48\u0E32\u0E08\u0E30\u0E21\u0E35\u0E2A\u0E34\u0E19\u0E04\u0E49\u0E32\u0E40\u0E02\u0E49\u0E32\u0E43\u0E2B\u0E21\u0E48\u0E20\u0E32\u0E22\u0E43\u0E19 3-5 \u0E27\u0E31\u0E19\n\u0E15\u0E49\u0E2D\u0E07\u0E01\u0E32\u0E23\u0E14\u0E39\u0E2A\u0E34\u0E19\u0E04\u0E49\u0E32\u0E17\u0E32\u0E07\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E2D\u0E37\u0E48\u0E19\u0E44\u0E2B\u0E21\u0E04\u0E23\u0E31\u0E1A?",
|
|
256
|
+
menus: defaultCategory
|
|
257
|
+
},
|
|
258
|
+
["SPEC_INQUIRY" /* SPEC_INQUIRY */]: {
|
|
259
|
+
id: "bot-spec-inquiry",
|
|
260
|
+
type: "BOT_TEXT" /* BOT_TEXT */,
|
|
261
|
+
text: '\u{1F4F1} \u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E08\u0E33\u0E40\u0E1E\u0E32\u0E30\n\niPhone 16 Pro Max\n\u2022 \u0E2B\u0E19\u0E49\u0E32\u0E08\u0E2D: Super Retina XDR 6.9"\n\u2022 \u0E0A\u0E34\u0E1B\u0E1B\u0E23\u0E30\u0E21\u0E27\u0E25\u0E1C\u0E25: A18 Pro\n\u2022 \u0E01\u0E25\u0E49\u0E2D\u0E07: 48MP \u0E2B\u0E25\u0E31\u0E01 + 12MP Ultra Wide + 12MP Telephoto\n\u2022 \u0E41\u0E1A\u0E15\u0E40\u0E15\u0E2D\u0E23\u0E35\u0E48: \u0E2A\u0E39\u0E07\u0E2A\u0E38\u0E14 29 \u0E0A\u0E31\u0E48\u0E27\u0E42\u0E21\u0E07\n\u2022 \u0E2B\u0E19\u0E48\u0E27\u0E22\u0E04\u0E27\u0E32\u0E21\u0E08\u0E33: 256GB / 512GB / 1TB\n\u2022 \u0E2A\u0E35: Natural Titanium, Blue Titanium, White Titanium, Black Titanium\n\n\u0E15\u0E49\u0E2D\u0E07\u0E01\u0E32\u0E23\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E40\u0E1E\u0E34\u0E48\u0E21\u0E40\u0E15\u0E34\u0E21\u0E44\u0E2B\u0E21\u0E04\u0E23\u0E31\u0E1A?'
|
|
262
|
+
}
|
|
263
|
+
};
|
|
264
|
+
var mockMessages = [
|
|
265
|
+
{
|
|
266
|
+
id: "2",
|
|
267
|
+
type: "USER_TEXT" /* USER_TEXT */,
|
|
268
|
+
text: "\u0E2A\u0E31\u0E48\u0E07\u0E0B\u0E37\u0E49\u0E2D\u0E2A\u0E34\u0E19\u0E04\u0E49\u0E32 \u{1F6CD}\uFE0F"
|
|
269
|
+
},
|
|
270
|
+
__spreadValues({}, mockResponse["ERROR" /* ERROR */]),
|
|
271
|
+
{
|
|
272
|
+
id: "4",
|
|
273
|
+
type: "USER_TEXT" /* USER_TEXT */,
|
|
274
|
+
text: "\u0E2A\u0E31\u0E48\u0E07\u0E0B\u0E37\u0E49\u0E2D\u0E2A\u0E34\u0E19\u0E04\u0E49\u0E32 \u{1F6CD}\uFE0F"
|
|
275
|
+
},
|
|
276
|
+
__spreadValues({}, mockResponse["CATEGORY_NOTEBOOK" /* CATEGORY_NOTEBOOK */])
|
|
277
|
+
];
|
|
278
|
+
|
|
279
|
+
// src/hooks/use-openchat.tsx
|
|
280
|
+
var import_react = require("react");
|
|
281
|
+
var useOpenChat = () => {
|
|
282
|
+
const [isOpen, setIsOpen] = (0, import_react.useState)(true);
|
|
283
|
+
const openChat = (0, import_react.useCallback)(() => setIsOpen(true), []);
|
|
284
|
+
const closeChat = (0, import_react.useCallback)(() => setIsOpen(false), []);
|
|
285
|
+
const toggleChat = (0, import_react.useCallback)(() => setIsOpen((prev) => !prev), []);
|
|
286
|
+
return {
|
|
287
|
+
isOpen,
|
|
288
|
+
openChat,
|
|
289
|
+
closeChat,
|
|
290
|
+
toggleChat
|
|
291
|
+
};
|
|
292
|
+
};
|
|
293
|
+
|
|
294
|
+
// src/contexts/chat-context.tsx
|
|
295
|
+
var import_react2 = require("react");
|
|
296
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
297
|
+
var ChatContext = (0, import_react2.createContext)(void 0);
|
|
298
|
+
var ChatProvider = ({ children }) => {
|
|
299
|
+
const [messages, setMessages] = (0, import_react2.useState)([]);
|
|
300
|
+
const [latestMessage, setLatestMessage] = (0, import_react2.useState)();
|
|
301
|
+
const chatControls = useOpenChat();
|
|
302
|
+
const [isLoading, setIsLoading] = (0, import_react2.useState)(false);
|
|
303
|
+
const addUserMessage = (0, import_react2.useCallback)((text) => {
|
|
304
|
+
const newMessage = {
|
|
305
|
+
id: Date.now().toString() + Math.random().toString(),
|
|
306
|
+
text,
|
|
307
|
+
type: "USER_TEXT" /* USER_TEXT */
|
|
308
|
+
};
|
|
309
|
+
setLatestMessage(newMessage);
|
|
310
|
+
setMessages((prev) => [...prev, newMessage]);
|
|
311
|
+
setIsLoading(true);
|
|
312
|
+
}, []);
|
|
313
|
+
const addBotMessage = (0, import_react2.useCallback)((message) => __async(null, null, function* () {
|
|
314
|
+
yield new Promise((resolve) => setTimeout(resolve, Math.random() * 2e3 + 1e3));
|
|
315
|
+
setIsLoading(false);
|
|
316
|
+
const newMessage = __spreadProps(__spreadValues({}, message), {
|
|
317
|
+
id: Date.now().toString() + Math.random().toString()
|
|
318
|
+
});
|
|
319
|
+
setMessages((prev) => [...prev, newMessage]);
|
|
320
|
+
}), []);
|
|
321
|
+
const clearMessages = (0, import_react2.useCallback)(() => setMessages([]), []);
|
|
322
|
+
const value = (0, import_react2.useMemo)(
|
|
323
|
+
() => ({
|
|
324
|
+
messages,
|
|
325
|
+
latestMessage,
|
|
326
|
+
isLoading,
|
|
327
|
+
setIsLoading,
|
|
328
|
+
addUserMessage,
|
|
329
|
+
addBotMessage,
|
|
330
|
+
clearMessages,
|
|
331
|
+
chatControls
|
|
332
|
+
}),
|
|
333
|
+
[messages, latestMessage, isLoading, chatControls, addUserMessage, addBotMessage, clearMessages]
|
|
334
|
+
);
|
|
335
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ChatContext.Provider, { value, children });
|
|
336
|
+
};
|
|
337
|
+
var useChatContext = () => {
|
|
338
|
+
const context = (0, import_react2.useContext)(ChatContext);
|
|
339
|
+
if (!context) {
|
|
340
|
+
throw new Error("useChatContext must be used within ChatProvider");
|
|
341
|
+
}
|
|
342
|
+
return context;
|
|
343
|
+
};
|
|
53
344
|
|
|
54
345
|
// src/utils/cn.ts
|
|
55
346
|
var import_clsx = require("clsx");
|
|
@@ -58,35 +349,600 @@ function cn(...args) {
|
|
|
58
349
|
return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(args));
|
|
59
350
|
}
|
|
60
351
|
|
|
61
|
-
// src/
|
|
62
|
-
var
|
|
63
|
-
|
|
64
|
-
return /*
|
|
352
|
+
// src/utils/message.ts
|
|
353
|
+
var getMockBotMessage = (menu) => {
|
|
354
|
+
const newMessage = mockResponse[menu.mockResponse];
|
|
355
|
+
return newMessage ? newMessage : mockResponse["ERROR" /* ERROR */];
|
|
356
|
+
};
|
|
357
|
+
var getMockBotMessageByText = (text) => {
|
|
358
|
+
const menu = searchableMenus.find((menu2) => menu2.title.includes(text));
|
|
359
|
+
if (!menu) {
|
|
360
|
+
return mockResponse["ERROR" /* ERROR */];
|
|
361
|
+
}
|
|
362
|
+
const newMessage = mockResponse[menu.mockResponse];
|
|
363
|
+
return newMessage ? newMessage : mockResponse["ERROR" /* ERROR */];
|
|
364
|
+
};
|
|
365
|
+
|
|
366
|
+
// src/components/aizu-chat.tsx
|
|
367
|
+
var import_react4 = require("react");
|
|
368
|
+
|
|
369
|
+
// src/components/input-bar/index.tsx
|
|
370
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
371
|
+
var ButtonSelectImage = (_a) => {
|
|
372
|
+
var _b = _a, { onClick, className } = _b, props = __objRest(_b, ["onClick", "className"]);
|
|
373
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
374
|
+
"button",
|
|
375
|
+
__spreadProps(__spreadValues({
|
|
376
|
+
type: "button",
|
|
377
|
+
onClick,
|
|
378
|
+
className: cn(
|
|
379
|
+
"shrink-0 w-10 h-10 rounded-full bg-gray-100 flex items-center justify-center hover:bg-gray-200 transition-colors",
|
|
380
|
+
className
|
|
381
|
+
),
|
|
382
|
+
"aria-label": "Upload image"
|
|
383
|
+
}, props), {
|
|
384
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
|
|
385
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("title", { children: "Image Upload Icon" }),
|
|
386
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("rect", { x: "3", y: "3", width: "18", height: "18", rx: "2", ry: "2" }),
|
|
387
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("circle", { cx: "8.5", cy: "8.5", r: "1.5" }),
|
|
388
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("polyline", { points: "21 15 16 10 5 21" })
|
|
389
|
+
] })
|
|
390
|
+
})
|
|
391
|
+
);
|
|
392
|
+
};
|
|
393
|
+
var InputText = (_a) => {
|
|
394
|
+
var _b = _a, { onMagicClick, placeholder, className } = _b, props = __objRest(_b, ["onMagicClick", "placeholder", "className"]);
|
|
395
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "flex-1 relative", children: [
|
|
396
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
397
|
+
"input",
|
|
398
|
+
__spreadValues({
|
|
399
|
+
type: "text",
|
|
400
|
+
name: "message",
|
|
401
|
+
placeholder,
|
|
402
|
+
className: cn(
|
|
403
|
+
"w-full px-4 py-2 pr-12 rounded-full bg-gray-100 border-none outline-none focus:ring-2 focus:ring-orange-300 text-sm",
|
|
404
|
+
className
|
|
405
|
+
),
|
|
406
|
+
onKeyDown: (e) => {
|
|
407
|
+
var _a2;
|
|
408
|
+
if (e.key === "Enter" && !e.shiftKey) {
|
|
409
|
+
e.preventDefault();
|
|
410
|
+
(_a2 = e.currentTarget.form) == null ? void 0 : _a2.requestSubmit();
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
}, props)
|
|
414
|
+
),
|
|
415
|
+
onMagicClick && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
416
|
+
"button",
|
|
417
|
+
{
|
|
418
|
+
type: "button",
|
|
419
|
+
onClick: onMagicClick,
|
|
420
|
+
className: "absolute right-2 top-1/2 -translate-y-1/2 w-8 h-8 flex items-center justify-center hover:bg-gray-200 rounded-full transition-colors",
|
|
421
|
+
"aria-label": "AI assist",
|
|
422
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
|
|
423
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("title", { children: "Magic/AI Icon" }),
|
|
424
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "M12 2L15 8.5L22 9.27L17 14.14L18.18 21.02L12 17.77L5.82 21.02L7 14.14L2 9.27L9 8.5L12 2Z" })
|
|
425
|
+
] })
|
|
426
|
+
}
|
|
427
|
+
)
|
|
428
|
+
] });
|
|
429
|
+
};
|
|
430
|
+
var ButtonConfirm = (_a) => {
|
|
431
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
432
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
433
|
+
"button",
|
|
434
|
+
__spreadProps(__spreadValues({
|
|
435
|
+
type: "submit",
|
|
436
|
+
className: cn(
|
|
437
|
+
"shrink-0 w-10 h-10 rounded-full bg-gray-100 flex items-center justify-center hover:bg-gray-200 transition-colors",
|
|
438
|
+
className
|
|
439
|
+
),
|
|
440
|
+
"aria-label": "Send message"
|
|
441
|
+
}, props), {
|
|
442
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
|
|
443
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("title", { children: "Send Icon" }),
|
|
444
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("line", { x1: "12", y1: "19", x2: "12", y2: "5" }),
|
|
445
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("polyline", { points: "5 12 12 5 19 12" })
|
|
446
|
+
] })
|
|
447
|
+
})
|
|
448
|
+
);
|
|
449
|
+
};
|
|
450
|
+
var InputBar = (_a) => {
|
|
451
|
+
var _b = _a, {
|
|
452
|
+
onSend,
|
|
453
|
+
onImageClick,
|
|
454
|
+
onMagicClick,
|
|
455
|
+
placeholder = "\u0E16\u0E32\u0E21\u0E04\u0E33\u0E16\u0E32\u0E21\u0E44\u0E14\u0E49\u0E40\u0E25\u0E22...",
|
|
456
|
+
className
|
|
457
|
+
} = _b, props = __objRest(_b, [
|
|
458
|
+
"onSend",
|
|
459
|
+
"onImageClick",
|
|
460
|
+
"onMagicClick",
|
|
461
|
+
"placeholder",
|
|
462
|
+
"className"
|
|
463
|
+
]);
|
|
464
|
+
const handleSubmit = (e) => {
|
|
465
|
+
e.preventDefault();
|
|
466
|
+
const formData = new FormData(e.currentTarget);
|
|
467
|
+
const message = formData.get("message");
|
|
468
|
+
if ((message == null ? void 0 : message.trim()) && onSend) {
|
|
469
|
+
onSend(message);
|
|
470
|
+
e.currentTarget.reset();
|
|
471
|
+
}
|
|
472
|
+
};
|
|
473
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("section", __spreadProps(__spreadValues({ className: cn("bg-white p-4", className) }, props), { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("form", { onSubmit: handleSubmit, className: "flex items-center gap-3", children: [
|
|
474
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(ButtonSelectImage, { onClick: onImageClick }),
|
|
475
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(InputText, { placeholder, onMagicClick }),
|
|
476
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(ButtonConfirm, {})
|
|
477
|
+
] }) }));
|
|
478
|
+
};
|
|
479
|
+
InputBar.ButtonSelectImage = ButtonSelectImage;
|
|
480
|
+
InputBar.InputText = InputText;
|
|
481
|
+
InputBar.ButtonConfirm = ButtonConfirm;
|
|
482
|
+
|
|
483
|
+
// src/components/loading.tsx
|
|
484
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
485
|
+
var Loading = ({ message }) => {
|
|
486
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("section", { className: cn("flex flex-col justify-center items-center border border-orange-400 shadow shadow-orange-400 h-10 max-w-69.5 rounded-3xl", { "h-16": !!message }), children: [
|
|
487
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "flex justify-center items-center gap-x-1 ", children: [
|
|
488
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "w-2 h-2 rounded-full bg-orange-400 animate-wiggle" }),
|
|
489
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "w-1.25 h-1.25 rounded-full bg-orange-400 animate-wiggle" }),
|
|
490
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "w-0.75 h-0.75 rounded-full bg-orange-400 animate-wiggle" })
|
|
491
|
+
] }),
|
|
492
|
+
message && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { className: "text-center text-[12px] text-gray-500 mt-1", children: message })
|
|
493
|
+
] });
|
|
494
|
+
};
|
|
495
|
+
|
|
496
|
+
// src/components/button.tsx
|
|
497
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
498
|
+
var Button = (_a) => {
|
|
499
|
+
var _b = _a, { children, className, onClick, ref } = _b, props = __objRest(_b, ["children", "className", "onClick", "ref"]);
|
|
500
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
501
|
+
"button",
|
|
502
|
+
__spreadProps(__spreadValues({
|
|
503
|
+
ref,
|
|
504
|
+
type: "button",
|
|
505
|
+
onClick,
|
|
506
|
+
className: cn(
|
|
507
|
+
"border border-orange-300 rounded-3xl",
|
|
508
|
+
"px-4 py-2",
|
|
509
|
+
"text-orange-500 text-sm",
|
|
510
|
+
"cursor-pointer",
|
|
511
|
+
className
|
|
512
|
+
)
|
|
513
|
+
}, props), {
|
|
514
|
+
children
|
|
515
|
+
})
|
|
516
|
+
);
|
|
517
|
+
};
|
|
518
|
+
|
|
519
|
+
// src/components/container.tsx
|
|
520
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
521
|
+
var Container = (_a) => {
|
|
522
|
+
var _b = _a, { className, children } = _b, props = __objRest(_b, ["className", "children"]);
|
|
523
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: cn("p-3 rounded-3xl border border-orange-300", className), children });
|
|
524
|
+
};
|
|
525
|
+
|
|
526
|
+
// src/components/message/index.tsx
|
|
527
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
528
|
+
var MessageBubble = ({ message, handleClick }) => {
|
|
529
|
+
if (message.type === "USER_TEXT" /* USER_TEXT */) {
|
|
530
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Container, { className: "ml-auto bg-orange-200 border-none text-sm", children: message.text });
|
|
531
|
+
}
|
|
532
|
+
if (message.type === "BOT_TEXT" /* BOT_TEXT */) {
|
|
533
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Container, { className: "mr-auto max-w-75.5 text-sm", children: message.text });
|
|
534
|
+
}
|
|
535
|
+
if (message.type === "BOT_TEXT_WITH_MENUS" /* BOT_TEXT_WITH_MENUS */) {
|
|
536
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(MessageWithMenus, { type: message.type, message: message.text || "", menus: message.menus || [], handleClick });
|
|
537
|
+
}
|
|
538
|
+
if (message.type === "BOT_QUICK_MENUS" /* BOT_QUICK_MENUS */) {
|
|
539
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(MessageWithMenus, { type: message.type, message: message.text || "", menus: message.menus || [], handleClick });
|
|
540
|
+
}
|
|
541
|
+
if (message.type === "BOT_ERROR_WITH_MENUS" /* BOT_ERROR_WITH_MENUS */) {
|
|
542
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(MessageWithMenus, { type: message.type, message: message.text || "", menus: message.menus || [], handleClick });
|
|
543
|
+
}
|
|
544
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(MenusImage, { menus: message.menus || [] });
|
|
545
|
+
};
|
|
546
|
+
var MessageWithMenus = ({ type, message, menus, className, handleClick }) => {
|
|
547
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Container, { className: cn("mr-auto max-w-75.5 lg:max-w-80", className), children: [
|
|
548
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "text-sm mb-4", children: message }),
|
|
549
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("ul", { className: cn("flex flex-wrap gap-x-1 gap-y-3", { "flex-col": type === "BOT_ERROR_WITH_MENUS" /* BOT_ERROR_WITH_MENUS */ }), children: menus == null ? void 0 : menus.map((menu) => {
|
|
550
|
+
if (menu == null ? void 0 : menu.phoneNumber) {
|
|
551
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("li", { className: "w-full ", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
552
|
+
"a",
|
|
553
|
+
{
|
|
554
|
+
href: `tel:+${menu == null ? void 0 : menu.phoneNumber}`,
|
|
555
|
+
className: "border border-orange-300 rounded-3xl px-4 py-2 text-orange-500 text-sm text-center block",
|
|
556
|
+
children: menu.title
|
|
557
|
+
}
|
|
558
|
+
) }, menu.id);
|
|
559
|
+
}
|
|
560
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("li", { className: "min-w-max ", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
561
|
+
Button,
|
|
562
|
+
{
|
|
563
|
+
className: cn({ "w-full": type === "BOT_ERROR_WITH_MENUS" /* BOT_ERROR_WITH_MENUS */ }),
|
|
564
|
+
onClick: () => {
|
|
565
|
+
handleClick(menu);
|
|
566
|
+
},
|
|
567
|
+
children: menu.title
|
|
568
|
+
}
|
|
569
|
+
) }, menu.id);
|
|
570
|
+
}) })
|
|
571
|
+
] });
|
|
572
|
+
};
|
|
573
|
+
var MenusImage = ({ menus }) => {
|
|
574
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("ul", { className: "flex gap-x-2", children: menus == null ? void 0 : menus.map((menu) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("img", { src: menu == null ? void 0 : menu.imageUrl, alt: "menu-image" }) }, menu.id)) });
|
|
575
|
+
};
|
|
576
|
+
|
|
577
|
+
// src/components/quick-menus.tsx
|
|
578
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
579
|
+
var QuickMenus = ({ bannerSrc, message = "welcome message", menus, handleClick }) => {
|
|
580
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("section", { className: "w-75.5 bg-white shadow rounded-3xl overflow-hidden", children: [
|
|
581
|
+
bannerSrc ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("img", { src: bannerSrc, alt: "banner" }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "w-75.5 h-29.5 border-b border-gray-200" }),
|
|
582
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "p-3 flex flex-col gap-y-3", children: [
|
|
583
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "text-sm", children: message }),
|
|
584
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("ul", { className: "flex gap-3 flex-wrap", children: menus == null ? void 0 : menus.map((menu) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { onClick: () => {
|
|
585
|
+
handleClick(menu);
|
|
586
|
+
}, children: menu.title }) }, menu.id)) })
|
|
587
|
+
] })
|
|
588
|
+
] });
|
|
589
|
+
};
|
|
590
|
+
|
|
591
|
+
// src/components/quick-menus-chip.tsx
|
|
592
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
593
|
+
var QuickMenuChips = ({ menus, handleClick, className }) => {
|
|
594
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "relative", children: [
|
|
595
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "absolute lg:hidden right-0 top-0 bottom-0 w-8 bg-linear-to-l from-white to-transparent pointer-events-none z-10" }),
|
|
596
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("ul", { className: cn("flex lg:flex-wrap gap-3 overflow-x-scroll scrollbar-hide", className), children: menus == null ? void 0 : menus.map((menu) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
597
|
+
Button,
|
|
598
|
+
{
|
|
599
|
+
onClick: () => {
|
|
600
|
+
handleClick(menu);
|
|
601
|
+
},
|
|
602
|
+
className: "text-nowrap text-black/85 border-black/50",
|
|
603
|
+
children: menu.title
|
|
604
|
+
}
|
|
605
|
+
) }, menu.id)) })
|
|
606
|
+
] });
|
|
607
|
+
};
|
|
608
|
+
var quick_menus_chip_default = QuickMenuChips;
|
|
609
|
+
|
|
610
|
+
// src/contexts/aizu-client-context.tsx
|
|
611
|
+
var import_react3 = require("react");
|
|
612
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
613
|
+
var AizuClientContext = (0, import_react3.createContext)(
|
|
614
|
+
void 0
|
|
615
|
+
);
|
|
616
|
+
var AizuClientProvider = ({
|
|
617
|
+
children,
|
|
618
|
+
client,
|
|
619
|
+
initialThreadId,
|
|
620
|
+
initialResourceId
|
|
621
|
+
}) => {
|
|
622
|
+
const [threadId, setThreadId] = (0, import_react3.useState)(initialThreadId);
|
|
623
|
+
const [resourceId, setResourceId] = (0, import_react3.useState)(
|
|
624
|
+
initialResourceId
|
|
625
|
+
);
|
|
626
|
+
const sendMessage = (0, import_react3.useCallback)(
|
|
627
|
+
(query) => __async(null, null, function* () {
|
|
628
|
+
console.log("\u{1F4E4} Sending message:", query);
|
|
629
|
+
console.log("\u{1F517} Current threadId:", threadId);
|
|
630
|
+
console.log("\u{1F4E6} Current resourceId:", resourceId);
|
|
631
|
+
const params = __spreadValues(__spreadValues({
|
|
632
|
+
query
|
|
633
|
+
}, threadId && { thread_id: threadId }), resourceId && { resource_id: resourceId });
|
|
634
|
+
const response = yield client.chat(params);
|
|
635
|
+
console.log("\u{1F4E5} Response received:", {
|
|
636
|
+
thread_id: response.thread_id,
|
|
637
|
+
resource_id: response.resource_id
|
|
638
|
+
});
|
|
639
|
+
if (response.thread_id && response.thread_id !== threadId) {
|
|
640
|
+
console.log("\u2705 Update threadId:", response.thread_id);
|
|
641
|
+
setThreadId(response.thread_id);
|
|
642
|
+
}
|
|
643
|
+
if (response.resource_id && response.resource_id !== resourceId) {
|
|
644
|
+
console.log("\u2705 Update resourceId:", response.resource_id);
|
|
645
|
+
setResourceId(response.resource_id);
|
|
646
|
+
}
|
|
647
|
+
return response;
|
|
648
|
+
}),
|
|
649
|
+
[client, threadId, resourceId]
|
|
650
|
+
);
|
|
651
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
652
|
+
AizuClientContext.Provider,
|
|
653
|
+
{
|
|
654
|
+
value: { aizuClient: client, threadId, resourceId, sendMessage },
|
|
655
|
+
children
|
|
656
|
+
}
|
|
657
|
+
);
|
|
658
|
+
};
|
|
659
|
+
var useAizuClient = () => {
|
|
660
|
+
const context = (0, import_react3.useContext)(AizuClientContext);
|
|
661
|
+
if (!context) {
|
|
662
|
+
throw new Error("useAizuClient must be used within AizuClientProvider");
|
|
663
|
+
}
|
|
664
|
+
return context;
|
|
665
|
+
};
|
|
666
|
+
|
|
667
|
+
// src/components/aizu-chat.tsx
|
|
668
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
669
|
+
var AizuChat = ({ aizuClient }) => {
|
|
670
|
+
console.log("\u{1F680} ~ AizuChat ~ aizuClient:", aizuClient);
|
|
671
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(AizuClientProvider, { client: aizuClient, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ChatProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
672
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(FloatingButton, {}),
|
|
673
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(ChatWindow, { children: [
|
|
674
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ChatHeader, {}),
|
|
675
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ChatBody, {}),
|
|
676
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ChatFooter, {})
|
|
677
|
+
] })
|
|
678
|
+
] }) }) });
|
|
679
|
+
};
|
|
680
|
+
var FloatingButton = () => {
|
|
681
|
+
const { chatControls } = useChatContext();
|
|
682
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
65
683
|
"button",
|
|
66
684
|
{
|
|
67
685
|
type: "button",
|
|
68
|
-
onClick:
|
|
686
|
+
onClick: chatControls.toggleChat,
|
|
687
|
+
className: "rounded-full p-2 aspect-square w-10 bg-black/60 cursor-pointer fixed right-5 bottom-5",
|
|
688
|
+
children: "AI"
|
|
689
|
+
}
|
|
690
|
+
);
|
|
691
|
+
};
|
|
692
|
+
var ChatWindow = ({ children }) => {
|
|
693
|
+
const { chatControls } = useChatContext();
|
|
694
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
695
|
+
"div",
|
|
696
|
+
{
|
|
69
697
|
className: cn(
|
|
70
|
-
"
|
|
71
|
-
|
|
698
|
+
"w-full lg:w-107.5 h-full lg:max-h-201",
|
|
699
|
+
"z-9999 fixed top-0 right-0 lg:right-5 lg:bottom-20 lg:top-auto bg-[#F8F8FA]",
|
|
700
|
+
"lg:rounded-4xl shadow-2xl overflow-hidden",
|
|
701
|
+
"flex flex-col",
|
|
702
|
+
{ invisible: !chatControls.isOpen }
|
|
72
703
|
),
|
|
73
|
-
children
|
|
704
|
+
children
|
|
74
705
|
}
|
|
75
706
|
);
|
|
76
|
-
}
|
|
77
|
-
|
|
707
|
+
};
|
|
708
|
+
var ChatHeader = () => {
|
|
709
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("section", { className: "flex justify-between items-center bg-white py-3 px-4", children: [
|
|
710
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("button", { type: "button", children: " Back" }),
|
|
711
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex flex-col items-center", children: [
|
|
712
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: "Shop Logo" }),
|
|
713
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "text-[10px]", children: "Powered by Zimpligital" })
|
|
714
|
+
] }),
|
|
715
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", {})
|
|
716
|
+
] });
|
|
717
|
+
};
|
|
718
|
+
var ChatBody = () => {
|
|
719
|
+
const { isLoading, addUserMessage, addBotMessage, messages, latestMessage } = useChatContext();
|
|
720
|
+
const [showWaitMessage, setShowWaitMessage] = (0, import_react4.useState)(false);
|
|
721
|
+
const messagesEndRef = (0, import_react4.useRef)(null);
|
|
722
|
+
const loadingMessage = showWaitMessage ? "Wait a minute..." : void 0;
|
|
723
|
+
const messagesDisplay = messages || [];
|
|
724
|
+
const displayWelcomeMessage = messagesDisplay.length === 0 && !isLoading;
|
|
725
|
+
const handleClick = (0, import_react4.useCallback)(
|
|
726
|
+
(menu) => __async(null, null, function* () {
|
|
727
|
+
if (menu.title.includes(tryAgain) && !!(latestMessage == null ? void 0 : latestMessage.text)) {
|
|
728
|
+
return addUserMessage(latestMessage == null ? void 0 : latestMessage.text);
|
|
729
|
+
}
|
|
730
|
+
addUserMessage(menu.title);
|
|
731
|
+
const mockResponse2 = getMockBotMessage(menu);
|
|
732
|
+
addBotMessage(mockResponse2);
|
|
733
|
+
}),
|
|
734
|
+
[addUserMessage, addBotMessage, latestMessage]
|
|
735
|
+
);
|
|
736
|
+
(0, import_react4.useEffect)(() => {
|
|
737
|
+
var _a;
|
|
738
|
+
(_a = messagesEndRef.current) == null ? void 0 : _a.scrollIntoView({ behavior: "smooth" });
|
|
739
|
+
}, [isLoading, messagesDisplay.length]);
|
|
740
|
+
(0, import_react4.useEffect)(() => {
|
|
741
|
+
let timer;
|
|
742
|
+
if (isLoading) {
|
|
743
|
+
timer = setTimeout(() => {
|
|
744
|
+
setShowWaitMessage(true);
|
|
745
|
+
}, 2e3);
|
|
746
|
+
} else {
|
|
747
|
+
setShowWaitMessage(false);
|
|
748
|
+
}
|
|
749
|
+
return () => {
|
|
750
|
+
if (timer) clearTimeout(timer);
|
|
751
|
+
};
|
|
752
|
+
}, [isLoading]);
|
|
753
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("section", { className: "flex-1 overflow-y-auto relative", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("section", { className: " p-4 flex flex-col gap-y-3 overflow-y-auto", children: [
|
|
754
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
755
|
+
QuickMenus,
|
|
756
|
+
{
|
|
757
|
+
bannerSrc: defaultBanner,
|
|
758
|
+
menus: defaultQuickMenus,
|
|
759
|
+
message: defaultQuickMenuMessage,
|
|
760
|
+
handleClick
|
|
761
|
+
}
|
|
762
|
+
),
|
|
763
|
+
messagesDisplay == null ? void 0 : messagesDisplay.map((message) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
764
|
+
MessageBubble,
|
|
765
|
+
{
|
|
766
|
+
message,
|
|
767
|
+
handleClick
|
|
768
|
+
},
|
|
769
|
+
message.id
|
|
770
|
+
)),
|
|
771
|
+
isLoading && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Loading, { message: loadingMessage }),
|
|
772
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { ref: messagesEndRef }),
|
|
773
|
+
displayWelcomeMessage && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "absolute bottom-4 left-1/2 -translate-x-1/2 text-center text-sm text-gray-500", children: "\u0E04\u0E38\u0E13\u0E01\u0E33\u0E25\u0E31\u0E07\u0E40\u0E23\u0E34\u0E48\u0E21\u0E15\u0E49\u0E19\u0E2A\u0E19\u0E17\u0E19\u0E32\u0E01\u0E31\u0E1A UTECH AI" })
|
|
774
|
+
] }) });
|
|
775
|
+
};
|
|
776
|
+
var ChatFooter = () => {
|
|
777
|
+
const { addUserMessage, addBotMessage, latestMessage } = useChatContext();
|
|
778
|
+
const handleClick = (0, import_react4.useCallback)(
|
|
779
|
+
(menu) => __async(null, null, function* () {
|
|
780
|
+
if (menu.title.includes(tryAgain) && !!(latestMessage == null ? void 0 : latestMessage.text)) {
|
|
781
|
+
return addUserMessage(latestMessage == null ? void 0 : latestMessage.text);
|
|
782
|
+
}
|
|
783
|
+
addUserMessage(menu.title);
|
|
784
|
+
const mockResponse2 = getMockBotMessage(menu);
|
|
785
|
+
addBotMessage(mockResponse2);
|
|
786
|
+
}),
|
|
787
|
+
[addUserMessage, addBotMessage, latestMessage]
|
|
788
|
+
);
|
|
789
|
+
const handleSend = (0, import_react4.useCallback)(
|
|
790
|
+
(message) => {
|
|
791
|
+
addUserMessage(message);
|
|
792
|
+
const mockResponse2 = getMockBotMessageByText(message);
|
|
793
|
+
addBotMessage(mockResponse2);
|
|
794
|
+
},
|
|
795
|
+
[addUserMessage, addBotMessage]
|
|
796
|
+
);
|
|
797
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("section", { className: "bg-white h-42.5 lg:h-46", children: [
|
|
798
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
799
|
+
quick_menus_chip_default,
|
|
800
|
+
{
|
|
801
|
+
handleClick,
|
|
802
|
+
menus: defaultQuickMenuChips,
|
|
803
|
+
className: "pl-4 pt-4 pb-2"
|
|
804
|
+
}
|
|
805
|
+
),
|
|
806
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
807
|
+
InputBar,
|
|
808
|
+
{
|
|
809
|
+
placeholder: "\u0E16\u0E32\u0E21\u0E04\u0E33\u0E16\u0E32\u0E21\u0E44\u0E14\u0E49\u0E40\u0E25\u0E22...",
|
|
810
|
+
onSend: handleSend,
|
|
811
|
+
onImageClick: () => console.log("Image upload"),
|
|
812
|
+
onMagicClick: () => console.log("AI assist")
|
|
813
|
+
}
|
|
814
|
+
)
|
|
815
|
+
] });
|
|
816
|
+
};
|
|
817
|
+
|
|
818
|
+
// src/components/test-component.tsx
|
|
819
|
+
var import_react5 = require("react");
|
|
820
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
821
|
+
var TestComponent = ({ client }) => {
|
|
822
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(AizuClientProvider, { client, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(TestComponentContent, {}) });
|
|
823
|
+
};
|
|
824
|
+
var TestComponentContent = () => {
|
|
825
|
+
const { sendMessage, resourceId, threadId } = useAizuClient();
|
|
826
|
+
const [query, setQuery] = (0, import_react5.useState)("");
|
|
827
|
+
const [response, setResponse] = (0, import_react5.useState)("");
|
|
828
|
+
const [loading, setLoading] = (0, import_react5.useState)(false);
|
|
829
|
+
const handleSend = () => __async(null, null, function* () {
|
|
830
|
+
if (!query.trim()) return;
|
|
831
|
+
try {
|
|
832
|
+
setLoading(true);
|
|
833
|
+
setResponse("");
|
|
834
|
+
console.log("\u{1F4E4} Sending query:", query);
|
|
835
|
+
const result = yield sendMessage(query);
|
|
836
|
+
console.log("\u2705 Got response:", result);
|
|
837
|
+
setResponse(result.response);
|
|
838
|
+
setQuery("");
|
|
839
|
+
} catch (error) {
|
|
840
|
+
console.error("\u274C Error:", error);
|
|
841
|
+
setResponse(`\u274C Error: ${error.message}`);
|
|
842
|
+
} finally {
|
|
843
|
+
setLoading(false);
|
|
844
|
+
}
|
|
845
|
+
});
|
|
846
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "border-2 border-blue-500 p-4 rounded space-y-4", children: [
|
|
847
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("h2", { className: "font-bold text-xl", children: "Test API Call" }),
|
|
848
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "text-sm text-gray-600 space-y-1", children: [
|
|
849
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("p", { children: [
|
|
850
|
+
"\u{1F517} Thread ID: ",
|
|
851
|
+
threadId || "(none yet)"
|
|
852
|
+
] }),
|
|
853
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("p", { children: [
|
|
854
|
+
"\u{1F4E6} Resource ID: ",
|
|
855
|
+
resourceId || "(none yet)"
|
|
856
|
+
] })
|
|
857
|
+
] }),
|
|
858
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex gap-2", children: [
|
|
859
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
860
|
+
"input",
|
|
861
|
+
{
|
|
862
|
+
type: "text",
|
|
863
|
+
value: query,
|
|
864
|
+
onChange: (e) => setQuery(e.target.value),
|
|
865
|
+
onKeyDown: (e) => e.key === "Enter" && handleSend(),
|
|
866
|
+
placeholder: "Type your question...",
|
|
867
|
+
className: "flex-1 border p-2 rounded",
|
|
868
|
+
disabled: loading
|
|
869
|
+
}
|
|
870
|
+
),
|
|
871
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
872
|
+
"button",
|
|
873
|
+
{
|
|
874
|
+
type: "button",
|
|
875
|
+
onClick: handleSend,
|
|
876
|
+
disabled: loading || !query.trim(),
|
|
877
|
+
className: "bg-blue-500 text-white px-4 py-2 rounded hover:bg-blue-600 disabled:bg-gray-400",
|
|
878
|
+
children: loading ? "Sending..." : "Send"
|
|
879
|
+
}
|
|
880
|
+
)
|
|
881
|
+
] }),
|
|
882
|
+
response && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "p-3 bg-gray-100 rounded", children: [
|
|
883
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("strong", { children: "Response:" }),
|
|
884
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: "mt-1 whitespace-pre-wrap", children: response })
|
|
885
|
+
] })
|
|
886
|
+
] });
|
|
887
|
+
};
|
|
78
888
|
|
|
79
889
|
// src/hooks/use-custom.ts
|
|
80
|
-
var
|
|
890
|
+
var import_react6 = require("react");
|
|
81
891
|
var useCustom = () => {
|
|
82
|
-
const [count, setCount] = (0,
|
|
892
|
+
const [count, setCount] = (0, import_react6.useState)(0);
|
|
83
893
|
const increment = () => {
|
|
84
894
|
setCount(count + 1);
|
|
85
895
|
};
|
|
86
896
|
return { count, increment };
|
|
87
897
|
};
|
|
898
|
+
|
|
899
|
+
// src/sdk/client.ts
|
|
900
|
+
var AizuClient = class {
|
|
901
|
+
constructor(config) {
|
|
902
|
+
this.hostUrl = config.hostUrl;
|
|
903
|
+
this.apiKey = config.apiKey;
|
|
904
|
+
}
|
|
905
|
+
request(_0) {
|
|
906
|
+
return __async(this, arguments, function* (path, options = {}) {
|
|
907
|
+
const url = `${this.hostUrl}${path}`;
|
|
908
|
+
const _a = options, { body } = _a, restOptions = __objRest(_a, ["body"]);
|
|
909
|
+
const response = yield fetch(url, __spreadProps(__spreadValues({}, restOptions), {
|
|
910
|
+
headers: __spreadValues({
|
|
911
|
+
"Content-Type": "application/json",
|
|
912
|
+
"x-api-key": this.apiKey
|
|
913
|
+
}, options.headers),
|
|
914
|
+
body: body ? JSON.stringify(body) : void 0
|
|
915
|
+
}));
|
|
916
|
+
if (!response.ok) {
|
|
917
|
+
throw new Error(`API Error: ${response.statusText}`);
|
|
918
|
+
}
|
|
919
|
+
return yield response.json();
|
|
920
|
+
});
|
|
921
|
+
}
|
|
922
|
+
chat(params) {
|
|
923
|
+
return __async(this, null, function* () {
|
|
924
|
+
return this.request("/chat/query", {
|
|
925
|
+
method: "POST",
|
|
926
|
+
body: params
|
|
927
|
+
});
|
|
928
|
+
});
|
|
929
|
+
}
|
|
930
|
+
};
|
|
931
|
+
var createAizuClient = ({
|
|
932
|
+
hostUrl,
|
|
933
|
+
apiKey,
|
|
934
|
+
options
|
|
935
|
+
}) => {
|
|
936
|
+
return new AizuClient(__spreadValues({ hostUrl, apiKey }, options));
|
|
937
|
+
};
|
|
88
938
|
// Annotate the CommonJS export names for ESM import in node:
|
|
89
939
|
0 && (module.exports = {
|
|
940
|
+
AizuChat,
|
|
941
|
+
AizuClient,
|
|
90
942
|
Button,
|
|
943
|
+
Loading,
|
|
944
|
+
QuickMenus,
|
|
945
|
+
TestComponent,
|
|
946
|
+
createAizuClient,
|
|
91
947
|
useCustom
|
|
92
948
|
});
|