@mahatisystems/mahati-ui-components 5.3.2 → 6.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.css +337 -0
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +22 -1
- package/dist/index.d.ts +22 -1
- package/dist/index.js +525 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +518 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -12990,7 +12990,7 @@ var MahatiPromotionModalV3Modal = function MahatiPromotionModalV3Modal(param) {
|
|
|
12990
12990
|
onClick: function onClick(e) {
|
|
12991
12991
|
return e.stopPropagation();
|
|
12992
12992
|
},
|
|
12993
|
-
className: "w-
|
|
12993
|
+
className: "relative w-[420px] max-w-[90%] rounded-[16px] bg-white p-6 text-center shadow-[0_10px_30px_rgba(0,0,0,0.2)] border border-[#CFE8DC]",
|
|
12994
12994
|
children: [
|
|
12995
12995
|
/* @__PURE__ */ jsx33("button", {
|
|
12996
12996
|
onClick: onClose,
|
|
@@ -13120,5 +13120,521 @@ var MahatiNotificationCard = function MahatiNotificationCard(param) {
|
|
|
13120
13120
|
]
|
|
13121
13121
|
});
|
|
13122
13122
|
};
|
|
13123
|
-
|
|
13123
|
+
// src/components/AdvancedFeedbackModal.tsx
|
|
13124
|
+
import { useEffect as useEffect16, useState as useState19 } from "react";
|
|
13125
|
+
import { CheckCircle2, Angry, Frown, Meh, Smile, Laugh } from "lucide-react";
|
|
13126
|
+
import { Fragment as Fragment13, jsx as jsx34, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
13127
|
+
var ratings = [
|
|
13128
|
+
{
|
|
13129
|
+
id: 1,
|
|
13130
|
+
label: "Terrible",
|
|
13131
|
+
icon: /* @__PURE__ */ jsx34(Angry, {
|
|
13132
|
+
size: 34
|
|
13133
|
+
})
|
|
13134
|
+
},
|
|
13135
|
+
{
|
|
13136
|
+
id: 2,
|
|
13137
|
+
label: "Bad",
|
|
13138
|
+
icon: /* @__PURE__ */ jsx34(Frown, {
|
|
13139
|
+
size: 34
|
|
13140
|
+
})
|
|
13141
|
+
},
|
|
13142
|
+
{
|
|
13143
|
+
id: 3,
|
|
13144
|
+
label: "Okay",
|
|
13145
|
+
icon: /* @__PURE__ */ jsx34(Meh, {
|
|
13146
|
+
size: 34
|
|
13147
|
+
})
|
|
13148
|
+
},
|
|
13149
|
+
{
|
|
13150
|
+
id: 4,
|
|
13151
|
+
label: "Good",
|
|
13152
|
+
icon: /* @__PURE__ */ jsx34(Smile, {
|
|
13153
|
+
size: 34
|
|
13154
|
+
})
|
|
13155
|
+
},
|
|
13156
|
+
{
|
|
13157
|
+
id: 5,
|
|
13158
|
+
label: "Amazing",
|
|
13159
|
+
icon: /* @__PURE__ */ jsx34(Laugh, {
|
|
13160
|
+
size: 34
|
|
13161
|
+
})
|
|
13162
|
+
}
|
|
13163
|
+
];
|
|
13164
|
+
function AdvancedFeedbackModal(param) {
|
|
13165
|
+
var isOpen = param.isOpen, onClose = param.onClose, onSubmit = param.onSubmit, _param_maxChars = param.maxChars, maxChars = _param_maxChars === void 0 ? 200 : _param_maxChars, _param_title = param.title, title = _param_title === void 0 ? "Share Your Feedback" : _param_title, _param_ratingType = param.ratingType, ratingType = _param_ratingType === void 0 ? "emoji" : _param_ratingType, _param_optionalRating = param.optionalRating, optionalRating = _param_optionalRating === void 0 ? false : _param_optionalRating;
|
|
13166
|
+
var _useState19 = _sliced_to_array(useState19("rating"), 2), step = _useState19[0], setStep = _useState19[1];
|
|
13167
|
+
var _useState191 = _sliced_to_array(useState19(null), 2), rating = _useState191[0], setRating = _useState191[1];
|
|
13168
|
+
var _useState192 = _sliced_to_array(useState19(""), 2), message = _useState192[0], setMessage = _useState192[1];
|
|
13169
|
+
var _useState193 = _sliced_to_array(useState19(false), 2), showConfirm = _useState193[0], setShowConfirm = _useState193[1];
|
|
13170
|
+
var _useState194 = _sliced_to_array(useState19(false), 2), showForm = _useState194[0], setShowForm = _useState194[1];
|
|
13171
|
+
var _useState195 = _sliced_to_array(useState19(null), 2), emojiRating = _useState195[0], setEmojiRating = _useState195[1];
|
|
13172
|
+
var remaining = maxChars - message.length;
|
|
13173
|
+
var isValid = optionalRating ? message.trim().length > 0 : rating !== null && message.trim().length > 0;
|
|
13174
|
+
var handleSubmit = function handleSubmit() {
|
|
13175
|
+
if (!optionalRating && !rating) return;
|
|
13176
|
+
onSubmit === null || onSubmit === void 0 ? void 0 : onSubmit({
|
|
13177
|
+
rating: rating !== null && rating !== void 0 ? rating : 0,
|
|
13178
|
+
feedback: message
|
|
13179
|
+
});
|
|
13180
|
+
setStep("success");
|
|
13181
|
+
};
|
|
13182
|
+
var resetAndClose = function resetAndClose() {
|
|
13183
|
+
setStep("rating");
|
|
13184
|
+
setRating(null);
|
|
13185
|
+
setMessage("");
|
|
13186
|
+
onClose();
|
|
13187
|
+
};
|
|
13188
|
+
useEffect16(function() {
|
|
13189
|
+
if (isOpen) {
|
|
13190
|
+
setStep("rating");
|
|
13191
|
+
setRating(null);
|
|
13192
|
+
setShowConfirm(false);
|
|
13193
|
+
setEmojiRating(null);
|
|
13194
|
+
setShowForm(false);
|
|
13195
|
+
setMessage("");
|
|
13196
|
+
}
|
|
13197
|
+
}, [
|
|
13198
|
+
isOpen
|
|
13199
|
+
]);
|
|
13200
|
+
var words = title.trim().split(/\s+/);
|
|
13201
|
+
var mid = Math.floor(words.length / 2);
|
|
13202
|
+
var firstPart = words.slice(0, mid).join(" ");
|
|
13203
|
+
var secondPart = words.slice(mid).join(" ");
|
|
13204
|
+
return /* @__PURE__ */ jsx34("div", {
|
|
13205
|
+
className: "fixed inset-0 z-[9999] flex items-center justify-center transition-opacity duration-300 ".concat(isOpen ? "opacity-100 visible" : "opacity-0 invisible", " bg-black/40 backdrop-blur-sm"),
|
|
13206
|
+
children: /* @__PURE__ */ jsxs29("div", {
|
|
13207
|
+
className: "w-full max-w-xl relative",
|
|
13208
|
+
children: [
|
|
13209
|
+
/* @__PURE__ */ jsx34("div", {
|
|
13210
|
+
className: "absolute inset-0 opacity-[0.05] pointer-events-none",
|
|
13211
|
+
children: /* @__PURE__ */ jsx34("div", {
|
|
13212
|
+
className: "w-full h-full",
|
|
13213
|
+
style: {
|
|
13214
|
+
backgroundImage: "linear-gradient(#1761a3 1px, transparent 1px), linear-gradient(to right, #1761a3 1px, transparent 1px)",
|
|
13215
|
+
backgroundSize: "40px 40px"
|
|
13216
|
+
}
|
|
13217
|
+
})
|
|
13218
|
+
}),
|
|
13219
|
+
/* @__PURE__ */ jsxs29("div", {
|
|
13220
|
+
className: "w-full min-h-[430px] relative rounded-2xl p-[2px] bg-gradient-to-r from-[#16a34a]/50 via-transparent to-[#1761a3]/50 shadow-[0_10px_40px_rgba(23,97,163,0.15)]",
|
|
13221
|
+
children: [
|
|
13222
|
+
/* @__PURE__ */ jsx34("div", {
|
|
13223
|
+
className: "absolute inset-0 rounded-2xl bg-gradient-to-r from-[#1761a3]/20 via-transparent to-[#16a34a]/20 blur-xl opacity-60"
|
|
13224
|
+
}),
|
|
13225
|
+
/* @__PURE__ */ jsxs29("div", {
|
|
13226
|
+
className: "relative overflow-hidden rounded-2xl bg-gradient-to-br from-white/90 to-white/70 backdrop-blur-xl border border-white/20 min-h-[430px]",
|
|
13227
|
+
children: [
|
|
13228
|
+
/* @__PURE__ */ jsx34("button", {
|
|
13229
|
+
onClick: resetAndClose,
|
|
13230
|
+
className: "absolute top-4 right-4 text-gray-500 hover:text-black z-10",
|
|
13231
|
+
children: "\u2715"
|
|
13232
|
+
}),
|
|
13233
|
+
/* @__PURE__ */ jsx34("div", {
|
|
13234
|
+
className: "absolute -top-20 -left-20 w-60 h-60 bg-[#1761a3]/20 rounded-full blur-3xl"
|
|
13235
|
+
}),
|
|
13236
|
+
/* @__PURE__ */ jsx34("div", {
|
|
13237
|
+
className: "absolute -bottom-20 -right-20 w-60 h-60 bg-[#1761a3]/20 rounded-full blur-3xl"
|
|
13238
|
+
}),
|
|
13239
|
+
/* @__PURE__ */ jsxs29("div", {
|
|
13240
|
+
className: "relative p-6 md:p-8 min-h-[350px] flex flex-col justify-start",
|
|
13241
|
+
children: [
|
|
13242
|
+
step !== "success" && /* @__PURE__ */ jsxs29(Fragment13, {
|
|
13243
|
+
children: [
|
|
13244
|
+
/* @__PURE__ */ jsxs29("h2", {
|
|
13245
|
+
className: "text-2xl md:text-3xl font-bold text-center mb-6",
|
|
13246
|
+
children: [
|
|
13247
|
+
/* @__PURE__ */ jsx34("span", {
|
|
13248
|
+
className: "text-[#0f2a44]",
|
|
13249
|
+
children: firstPart
|
|
13250
|
+
}),
|
|
13251
|
+
" ",
|
|
13252
|
+
/* @__PURE__ */ jsx34("span", {
|
|
13253
|
+
className: "bg-gradient-to-r from-[#16a34a] to-[#1761a3] bg-clip-text text-transparent",
|
|
13254
|
+
children: secondPart
|
|
13255
|
+
})
|
|
13256
|
+
]
|
|
13257
|
+
}),
|
|
13258
|
+
/* @__PURE__ */ jsxs29("div", {
|
|
13259
|
+
className: "flex flex-col items-center gap-4 mb-6",
|
|
13260
|
+
children: [
|
|
13261
|
+
(ratingType === "star" || optionalRating) && /* @__PURE__ */ jsx34("div", {
|
|
13262
|
+
className: "flex justify-center gap-6 mb-6 w-full",
|
|
13263
|
+
children: [
|
|
13264
|
+
1,
|
|
13265
|
+
2,
|
|
13266
|
+
3,
|
|
13267
|
+
4,
|
|
13268
|
+
5
|
|
13269
|
+
].map(function(star) {
|
|
13270
|
+
return /* @__PURE__ */ jsx34("button", {
|
|
13271
|
+
onClick: function onClick() {
|
|
13272
|
+
setRating(star);
|
|
13273
|
+
},
|
|
13274
|
+
className: "transition-transform hover:scale-110",
|
|
13275
|
+
children: /* @__PURE__ */ jsx34("div", {
|
|
13276
|
+
className: "w-8 h-8 bg-center bg-no-repeat transition-all duration-200 ".concat(star <= (rating || 0) ? "opacity-100 scale-110" : "opacity-70 hover:opacity-100"),
|
|
13277
|
+
style: {
|
|
13278
|
+
backgroundImage: "url(".concat(star <= (rating || 0) ? "/icons/yellowstaremoji.png" : "/icons/staremoji.png", ")"),
|
|
13279
|
+
backgroundSize: "contain"
|
|
13280
|
+
}
|
|
13281
|
+
})
|
|
13282
|
+
}, star);
|
|
13283
|
+
})
|
|
13284
|
+
}),
|
|
13285
|
+
(ratingType === "emoji" || rating !== null) && /* @__PURE__ */ jsx34("div", {
|
|
13286
|
+
className: "flex justify-center gap-4 mb-4 w-full",
|
|
13287
|
+
children: ratings.map(function(item) {
|
|
13288
|
+
var isActive = emojiRating === item.id;
|
|
13289
|
+
return /* @__PURE__ */ jsxs29("button", {
|
|
13290
|
+
onClick: function onClick() {
|
|
13291
|
+
setEmojiRating(item.id);
|
|
13292
|
+
setShowConfirm(true);
|
|
13293
|
+
},
|
|
13294
|
+
className: "flex flex-col items-center gap-1 flex-1 py-3 rounded-xl transition-all duration-300\n ".concat(isActive ? "bg-gradient-to-r from-[#16a34a] to-[#1761a3] text-white scale-105 shadow-md" : "text-gray-500 hover:bg-mahati-light"),
|
|
13295
|
+
children: [
|
|
13296
|
+
/* @__PURE__ */ jsx34("div", {
|
|
13297
|
+
className: "".concat(isActive ? "scale-110 text-white" : "text-[#1761a3]"),
|
|
13298
|
+
children: item.icon
|
|
13299
|
+
}),
|
|
13300
|
+
/* @__PURE__ */ jsx34("span", {
|
|
13301
|
+
className: "text-xs font-medium",
|
|
13302
|
+
children: item.label
|
|
13303
|
+
})
|
|
13304
|
+
]
|
|
13305
|
+
}, item.id);
|
|
13306
|
+
})
|
|
13307
|
+
})
|
|
13308
|
+
]
|
|
13309
|
+
}),
|
|
13310
|
+
showConfirm && /* @__PURE__ */ jsxs29("div", {
|
|
13311
|
+
className: "text-center mt-4",
|
|
13312
|
+
children: [
|
|
13313
|
+
/* @__PURE__ */ jsx34("p", {
|
|
13314
|
+
className: "bg-gradient-to-r from-[#16a34a] to-[#1761a3] bg-clip-text text-transparent",
|
|
13315
|
+
children: "Would you like to give feedback?"
|
|
13316
|
+
}),
|
|
13317
|
+
/* @__PURE__ */ jsxs29("div", {
|
|
13318
|
+
className: "flex gap-4 justify-center mt-3",
|
|
13319
|
+
children: [
|
|
13320
|
+
/* @__PURE__ */ jsx34("button", {
|
|
13321
|
+
onClick: function onClick() {
|
|
13322
|
+
return setShowForm(true);
|
|
13323
|
+
},
|
|
13324
|
+
className: "px-6 py-2 rounded-xl text-white bg-gradient-to-r from-[#16a34a] to-[#1761a3]",
|
|
13325
|
+
children: "Yes"
|
|
13326
|
+
}),
|
|
13327
|
+
/* @__PURE__ */ jsx34("button", {
|
|
13328
|
+
onClick: function onClick() {
|
|
13329
|
+
return setStep("success");
|
|
13330
|
+
},
|
|
13331
|
+
className: "px-6 py-2 rounded-xl text-white bg-gradient-to-r from-[#16a34a] to-[#1761a3]",
|
|
13332
|
+
children: "No"
|
|
13333
|
+
})
|
|
13334
|
+
]
|
|
13335
|
+
})
|
|
13336
|
+
]
|
|
13337
|
+
}),
|
|
13338
|
+
showForm && /* @__PURE__ */ jsxs29(Fragment13, {
|
|
13339
|
+
children: [
|
|
13340
|
+
/* @__PURE__ */ jsx34("textarea", {
|
|
13341
|
+
value: message,
|
|
13342
|
+
onChange: function onChange(e) {
|
|
13343
|
+
if (e.target.value.length <= maxChars) {
|
|
13344
|
+
setMessage(e.target.value);
|
|
13345
|
+
}
|
|
13346
|
+
},
|
|
13347
|
+
placeholder: "Tell us about your experience...",
|
|
13348
|
+
className: "w-full h-28 mt-4 rounded-xl border border-gray-300 p-4"
|
|
13349
|
+
}),
|
|
13350
|
+
/* @__PURE__ */ jsx34("button", {
|
|
13351
|
+
onClick: handleSubmit,
|
|
13352
|
+
disabled: !isValid,
|
|
13353
|
+
className: "w-full mt-4 py-3 rounded-xl font-medium transition-all duration-300\n ".concat(isValid ? "text-white bg-gradient-to-r from-[#16a34a] to-[#1761a3] hover:scale-[1.02] shadow-md" : "bg-gray-300 text-gray-500 cursor-not-allowed", "\n "),
|
|
13354
|
+
children: "Submit Feedback"
|
|
13355
|
+
})
|
|
13356
|
+
]
|
|
13357
|
+
})
|
|
13358
|
+
]
|
|
13359
|
+
}),
|
|
13360
|
+
step === "success" && /* @__PURE__ */ jsxs29("div", {
|
|
13361
|
+
className: "flex flex-col items-center justify-center text-center h-full",
|
|
13362
|
+
children: [
|
|
13363
|
+
/* @__PURE__ */ jsxs29("div", {
|
|
13364
|
+
className: "mb-4 text-[#16a34a] relative",
|
|
13365
|
+
children: [
|
|
13366
|
+
/* @__PURE__ */ jsx34("div", {
|
|
13367
|
+
className: "absolute inset-0 bg-[#16a34a]/20 blur-xl rounded-full"
|
|
13368
|
+
}),
|
|
13369
|
+
/* @__PURE__ */ jsx34(CheckCircle2, {
|
|
13370
|
+
size: 56,
|
|
13371
|
+
className: "relative"
|
|
13372
|
+
})
|
|
13373
|
+
]
|
|
13374
|
+
}),
|
|
13375
|
+
/* @__PURE__ */ jsx34("h3", {
|
|
13376
|
+
className: "text-2xl font-bold mb-2 bg-gradient-to-r from-[#16a34a] to-[#1761a3] bg-clip-text text-transparent",
|
|
13377
|
+
children: "Thank You!"
|
|
13378
|
+
}),
|
|
13379
|
+
/* @__PURE__ */ jsx34("p", {
|
|
13380
|
+
className: "text-black mb-4",
|
|
13381
|
+
children: "Your feedback has been successfully submitted."
|
|
13382
|
+
}),
|
|
13383
|
+
/* @__PURE__ */ jsx34("button", {
|
|
13384
|
+
onClick: resetAndClose,
|
|
13385
|
+
className: "px-5 py-2 rounded-lg bg-gray-200 hover:bg-gray-300",
|
|
13386
|
+
children: "Close"
|
|
13387
|
+
})
|
|
13388
|
+
]
|
|
13389
|
+
})
|
|
13390
|
+
]
|
|
13391
|
+
})
|
|
13392
|
+
]
|
|
13393
|
+
})
|
|
13394
|
+
]
|
|
13395
|
+
})
|
|
13396
|
+
]
|
|
13397
|
+
})
|
|
13398
|
+
});
|
|
13399
|
+
}
|
|
13400
|
+
// src/components/AdvancedChatbot.tsx
|
|
13401
|
+
import { useState as useState20, useEffect as useEffect17 } from "react";
|
|
13402
|
+
import { createPortal as createPortal3 } from "react-dom";
|
|
13403
|
+
import { Fragment as Fragment14, jsx as jsx35, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
13404
|
+
function Chatbot(param) {
|
|
13405
|
+
var isOpen = param.isOpen, onClose = param.onClose;
|
|
13406
|
+
var _useState20 = _sliced_to_array(useState20("form"), 2), step = _useState20[0], setStep = _useState20[1];
|
|
13407
|
+
var _useState201 = _sliced_to_array(useState20([
|
|
13408
|
+
{
|
|
13409
|
+
type: "bot",
|
|
13410
|
+
text: "Welcome! I'm your Mahati Virtual Assistant. How can I help you today?"
|
|
13411
|
+
}
|
|
13412
|
+
]), 2), messages = _useState201[0], setMessages = _useState201[1];
|
|
13413
|
+
var _useState202 = _sliced_to_array(useState20(""), 2), input = _useState202[0], setInput = _useState202[1];
|
|
13414
|
+
useEffect17(function() {
|
|
13415
|
+
if (isOpen) {
|
|
13416
|
+
setStep("form");
|
|
13417
|
+
setMessages([
|
|
13418
|
+
{
|
|
13419
|
+
type: "bot",
|
|
13420
|
+
text: "Welcome! I'm your Mahati Virtual Assistant. How can I help you today?"
|
|
13421
|
+
}
|
|
13422
|
+
]);
|
|
13423
|
+
}
|
|
13424
|
+
}, [
|
|
13425
|
+
isOpen
|
|
13426
|
+
]);
|
|
13427
|
+
if (!isOpen) return null;
|
|
13428
|
+
var handleSend = function handleSend() {
|
|
13429
|
+
if (!input.trim()) return;
|
|
13430
|
+
setMessages(function(prev) {
|
|
13431
|
+
return _to_consumable_array(prev).concat([
|
|
13432
|
+
{
|
|
13433
|
+
type: "user",
|
|
13434
|
+
text: input
|
|
13435
|
+
}
|
|
13436
|
+
]);
|
|
13437
|
+
});
|
|
13438
|
+
setTimeout(function() {
|
|
13439
|
+
setMessages(function(prev) {
|
|
13440
|
+
return _to_consumable_array(prev).concat([
|
|
13441
|
+
{
|
|
13442
|
+
type: "bot",
|
|
13443
|
+
text: "Got it! Let me help you with that."
|
|
13444
|
+
}
|
|
13445
|
+
]);
|
|
13446
|
+
});
|
|
13447
|
+
}, 500);
|
|
13448
|
+
setInput("");
|
|
13449
|
+
};
|
|
13450
|
+
return createPortal3(/* @__PURE__ */ jsxs30(Fragment14, {
|
|
13451
|
+
children: [
|
|
13452
|
+
/* @__PURE__ */ jsx35("div", {
|
|
13453
|
+
onClick: onClose,
|
|
13454
|
+
className: "fixed inset-0 bg-black/30 backdrop-blur-[2px] z-40"
|
|
13455
|
+
}),
|
|
13456
|
+
/* @__PURE__ */ jsxs30("div", {
|
|
13457
|
+
className: "fixed bottom-6 right-6 w-[420px] h-[620px] bg-[#eef2f4] rounded-2xl shadow-2xl overflow-hidden flex flex-col z-[9999]",
|
|
13458
|
+
children: [
|
|
13459
|
+
/* @__PURE__ */ jsxs30("div", {
|
|
13460
|
+
className: "px-5 py-4 text-white flex justify-between items-center bg-gradient-to-r from-[#4daf83] to-[#1761a3]",
|
|
13461
|
+
children: [
|
|
13462
|
+
/* @__PURE__ */ jsxs30("div", {
|
|
13463
|
+
children: [
|
|
13464
|
+
/* @__PURE__ */ jsx35("h3", {
|
|
13465
|
+
className: "text-md font-semibold",
|
|
13466
|
+
children: "Mahati Virtual Assistant"
|
|
13467
|
+
}),
|
|
13468
|
+
/* @__PURE__ */ jsx35("p", {
|
|
13469
|
+
className: "text-xs opacity-80",
|
|
13470
|
+
children: "Ask anything. We're here to help."
|
|
13471
|
+
})
|
|
13472
|
+
]
|
|
13473
|
+
}),
|
|
13474
|
+
/* @__PURE__ */ jsx35("button", {
|
|
13475
|
+
onClick: onClose,
|
|
13476
|
+
className: "w-9 h-9 rounded-full bg-white/20 flex items-center justify-center",
|
|
13477
|
+
children: /* @__PURE__ */ jsx35("img", {
|
|
13478
|
+
src: "/images/close-icon.png",
|
|
13479
|
+
className: "w-3 h-3"
|
|
13480
|
+
})
|
|
13481
|
+
})
|
|
13482
|
+
]
|
|
13483
|
+
}),
|
|
13484
|
+
step === "form" && /* @__PURE__ */ jsxs30("div", {
|
|
13485
|
+
className: "flex flex-col h-full bg-[#f4f6f8]",
|
|
13486
|
+
children: [
|
|
13487
|
+
/* @__PURE__ */ jsxs30("div", {
|
|
13488
|
+
className: "flex-1 px-5 pt-6 pb-4",
|
|
13489
|
+
children: [
|
|
13490
|
+
/* @__PURE__ */ jsxs30("div", {
|
|
13491
|
+
className: "text-center mb-7",
|
|
13492
|
+
children: [
|
|
13493
|
+
/* @__PURE__ */ jsx35("div", {
|
|
13494
|
+
className: "w-14 h-14 mx-auto mb-3 rounded-xl bg-gradient-to-br from-[#1761a3]/10 to-[#4daf83]/10 flex items-center justify-center shadow-sm",
|
|
13495
|
+
children: /* @__PURE__ */ jsx35("img", {
|
|
13496
|
+
src: "/images/Mahati-Logo-graphics.png",
|
|
13497
|
+
className: "w-9 h-9"
|
|
13498
|
+
})
|
|
13499
|
+
}),
|
|
13500
|
+
/* @__PURE__ */ jsx35("h2", {
|
|
13501
|
+
className: "text-lg font-bold text-[#1f2d3d]",
|
|
13502
|
+
children: "Welcome to Mahati Assistant"
|
|
13503
|
+
}),
|
|
13504
|
+
/* @__PURE__ */ jsx35("p", {
|
|
13505
|
+
className: "text-xs text-gray-500",
|
|
13506
|
+
children: "Please enter your details to start the conversation"
|
|
13507
|
+
})
|
|
13508
|
+
]
|
|
13509
|
+
}),
|
|
13510
|
+
/* @__PURE__ */ jsxs30("div", {
|
|
13511
|
+
className: "space-y-5",
|
|
13512
|
+
children: [
|
|
13513
|
+
/* @__PURE__ */ jsx35("input", {
|
|
13514
|
+
className: "w-full px-4 py-2.5 rounded-lg border bg-gray-50",
|
|
13515
|
+
placeholder: "First Name"
|
|
13516
|
+
}),
|
|
13517
|
+
/* @__PURE__ */ jsx35("input", {
|
|
13518
|
+
className: "w-full px-4 py-2.5 rounded-lg border bg-gray-50",
|
|
13519
|
+
placeholder: "Last Name"
|
|
13520
|
+
}),
|
|
13521
|
+
/* @__PURE__ */ jsx35("input", {
|
|
13522
|
+
className: "w-full px-4 py-2.5 rounded-lg border bg-gray-50",
|
|
13523
|
+
placeholder: "Email"
|
|
13524
|
+
})
|
|
13525
|
+
]
|
|
13526
|
+
})
|
|
13527
|
+
]
|
|
13528
|
+
}),
|
|
13529
|
+
/* @__PURE__ */ jsx35("div", {
|
|
13530
|
+
className: "px-5 pb-5 pt-3 bg-white border-t",
|
|
13531
|
+
children: /* @__PURE__ */ jsx35("button", {
|
|
13532
|
+
onClick: function onClick() {
|
|
13533
|
+
return setStep("chat");
|
|
13534
|
+
},
|
|
13535
|
+
className: "w-full py-3 text-white bg-gradient-to-r from-[#1761a3] to-[#4daf83] rounded-lg",
|
|
13536
|
+
children: "Start Conversation"
|
|
13537
|
+
})
|
|
13538
|
+
})
|
|
13539
|
+
]
|
|
13540
|
+
}),
|
|
13541
|
+
step === "chat" && /* @__PURE__ */ jsxs30("div", {
|
|
13542
|
+
className: "flex flex-col flex-1 min-h-0",
|
|
13543
|
+
children: [
|
|
13544
|
+
/* @__PURE__ */ jsx35("div", {
|
|
13545
|
+
className: "flex-1 overflow-y-auto px-5 py-5 space-y-6",
|
|
13546
|
+
children: messages.map(function(msg, i) {
|
|
13547
|
+
return /* @__PURE__ */ jsx35("div", {
|
|
13548
|
+
children: msg.type === "bot" ? /* @__PURE__ */ jsxs30("div", {
|
|
13549
|
+
className: "flex items-start gap-3",
|
|
13550
|
+
children: [
|
|
13551
|
+
/* @__PURE__ */ jsx35("img", {
|
|
13552
|
+
src: "/images/chatbot-icon.png",
|
|
13553
|
+
className: "w-7 h-7 mt-1"
|
|
13554
|
+
}),
|
|
13555
|
+
/* @__PURE__ */ jsx35("div", {
|
|
13556
|
+
className: "px-4 py-3 max-w-[260px] rounded-[4px_16px_16px_16px] bg-gradient-to-br from-[#1761a3]/10 to-[#4daf83]/10 text-[#0f2a44] shadow-sm",
|
|
13557
|
+
children: /* @__PURE__ */ jsx35("p", {
|
|
13558
|
+
className: "text-sm text-[#2c3e50]",
|
|
13559
|
+
children: msg.text
|
|
13560
|
+
})
|
|
13561
|
+
})
|
|
13562
|
+
]
|
|
13563
|
+
}) : /* @__PURE__ */ jsxs30("div", {
|
|
13564
|
+
className: "flex justify-end items-start gap-3",
|
|
13565
|
+
children: [
|
|
13566
|
+
/* @__PURE__ */ jsx35("div", {
|
|
13567
|
+
className: "bg-gradient-to-r from-[#4daf83] to-[#1761a3] text-white px-4 py-3 rounded-[16px_4px_16px_16px] max-w-[220px] shadow-md",
|
|
13568
|
+
children: /* @__PURE__ */ jsx35("p", {
|
|
13569
|
+
className: "text-sm",
|
|
13570
|
+
children: msg.text
|
|
13571
|
+
})
|
|
13572
|
+
}),
|
|
13573
|
+
/* @__PURE__ */ jsx35("div", {
|
|
13574
|
+
className: "w-10 h-10 rounded-full bg-[#d9e2e7] flex items-center justify-center",
|
|
13575
|
+
children: /* @__PURE__ */ jsx35("img", {
|
|
13576
|
+
src: "/images/user-icon.png",
|
|
13577
|
+
className: "w-4 h-4"
|
|
13578
|
+
})
|
|
13579
|
+
})
|
|
13580
|
+
]
|
|
13581
|
+
})
|
|
13582
|
+
}, i);
|
|
13583
|
+
})
|
|
13584
|
+
}),
|
|
13585
|
+
/* @__PURE__ */ jsx35("div", {
|
|
13586
|
+
className: "flex justify-center py-3 bg-[#eef2f4] border-t border-[#e4ddd2]",
|
|
13587
|
+
children: /* @__PURE__ */ jsxs30("button", {
|
|
13588
|
+
className: "px-5 py-2 text-xs rounded-full border border-[#1761a3]/40 text-[#1761a3] font-semibold bg-white shadow-sm flex items-center gap-2",
|
|
13589
|
+
children: [
|
|
13590
|
+
/* @__PURE__ */ jsx35("img", {
|
|
13591
|
+
src: "/images/save-icon.png",
|
|
13592
|
+
className: "w-4 h-4"
|
|
13593
|
+
}),
|
|
13594
|
+
"Save Conversation"
|
|
13595
|
+
]
|
|
13596
|
+
})
|
|
13597
|
+
}),
|
|
13598
|
+
/* @__PURE__ */ jsxs30("div", {
|
|
13599
|
+
className: "px-4 py-3 bg-white border-t flex items-center gap-3 shadow-[0_-4px_20px_rgba(0,0,0,0.05)]",
|
|
13600
|
+
children: [
|
|
13601
|
+
/* @__PURE__ */ jsxs30("div", {
|
|
13602
|
+
className: "flex-1 flex items-center px-4 py-1 rounded-full border border-gray-300 bg-gray-50",
|
|
13603
|
+
children: [
|
|
13604
|
+
/* @__PURE__ */ jsx35("input", {
|
|
13605
|
+
type: "text",
|
|
13606
|
+
value: input,
|
|
13607
|
+
onChange: function onChange(e) {
|
|
13608
|
+
return setInput(e.target.value);
|
|
13609
|
+
},
|
|
13610
|
+
placeholder: "Type your message...",
|
|
13611
|
+
className: "flex-1 bg-transparent text-sm outline-none"
|
|
13612
|
+
}),
|
|
13613
|
+
/* @__PURE__ */ jsx35("div", {
|
|
13614
|
+
className: "p-2 rounded-full hover:bg-gray-200 cursor-pointer",
|
|
13615
|
+
children: /* @__PURE__ */ jsx35("img", {
|
|
13616
|
+
src: "/images/attach-icon.png",
|
|
13617
|
+
className: "w-4 h-4 opacity-60"
|
|
13618
|
+
})
|
|
13619
|
+
})
|
|
13620
|
+
]
|
|
13621
|
+
}),
|
|
13622
|
+
/* @__PURE__ */ jsx35("button", {
|
|
13623
|
+
onClick: handleSend,
|
|
13624
|
+
className: "w-11 h-11 rounded-full bg-gradient-to-r from-[#4daf83] to-[#1761a3] flex items-center justify-center",
|
|
13625
|
+
children: /* @__PURE__ */ jsx35("img", {
|
|
13626
|
+
src: "/images/send-icon.png",
|
|
13627
|
+
className: "w-4 h-4"
|
|
13628
|
+
})
|
|
13629
|
+
})
|
|
13630
|
+
]
|
|
13631
|
+
})
|
|
13632
|
+
]
|
|
13633
|
+
})
|
|
13634
|
+
]
|
|
13635
|
+
})
|
|
13636
|
+
]
|
|
13637
|
+
}), document.body);
|
|
13638
|
+
}
|
|
13639
|
+
export { Accordion, CardOverlayLoader, CardWithLoading, CircularSpinner, DEFAULT_ACTIVITY_OPTIONS, DEFAULT_STATUS_OPTIONS, Filter, LoadingDots, LoadingDotsLinear, MahatiActivity, Chatbot as MahatiAdvancedChatbotModal, AdvancedFeedbackModal as MahatiAdvancedFeedbackModal, AsyncDropdown as MahatiAsyncDropdown, AvatarDropdown as MahatiAvatarDropdown, AvatarMultiSelectDropdown as MahatiAvatarMultiSelectDropdown, Button as MahatiButton, Calendar as MahatiCalendar, MahatiCameraAccessModal, Card as MahatiCard, CascadingDropdown as MahatiCascadingDropdown, MahatiChartAnalyticsWidget, ConfettiExplosion as MahatiConfettiExplosion, Dropdown as MahatiDropdown, FormContainer as MahatiFormContainer, GroupedDropdown as MahatiGroupedDropdown, Input as MahatiInput, MahatiLocationAccessModal, MahatiMicrophoneAccessModal, Modal as MahatiModal, MultiSelectDropdown as MahatiMultiSelectDropdown, MahatiNotificationCard, MahatiPromotionModal as MahatiPromotionModal_V1, MahatiPromotionModalV2Modal as MahatiPromotionModal_V2, MahatiPromotionModalV3Modal as MahatiPromotionModal_V3, RealisticConfetti as MahatiRealisticConfetti, MahatiSearch, SearchableDropdown as MahatiSearchableDropdown, MahatiStatus, TabbedInterface as MahatiTabbedInterface, Table as MahatiTable, TableWithTab as MahatiTableWithTab, TexttoAudio as MahatiTexttoAudio, ToastMessage as MahatiToastMessage, Tooltip2 as MahatiTooltip, Spinner };
|
|
13124
13640
|
//# sourceMappingURL=index.mjs.map
|