@contenify/chatbot 0.1.1 → 0.1.4

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.mjs CHANGED
@@ -26,9 +26,8 @@ import { createContext, useContext, useState, useEffect } from "react";
26
26
  import axios from "axios";
27
27
 
28
28
  // lib/config.ts
29
- var DEFAULT_API_BASE_URL = "http://localhost:8080/api";
30
29
  function getApiBaseUrl() {
31
- return process.env.NEXT_PUBLIC_CONTENIFY_API_URL || DEFAULT_API_BASE_URL;
30
+ return process.env.NEXT_PUBLIC_CONTENIFY_API_URL || "http://localhost:8080/api";
32
31
  }
33
32
  function getServerBaseUrl() {
34
33
  const apiUrl = getApiBaseUrl();
@@ -179,31 +178,31 @@ function ArticleModal({
179
178
  onClose,
180
179
  onRecreate
181
180
  }) {
182
- return /* @__PURE__ */ jsx2("div", { className: "fixed inset-0 z-50 bg-black/50 backdrop-blur-sm flex items-center justify-center px-4", children: /* @__PURE__ */ jsxs("div", { className: "relative w-full max-w-3xl bg-white rounded-xl shadow-card border border-gray-200 animate-in fade-in zoom-in", children: [
183
- /* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between px-6 py-4 border-b border-gray-300", children: [
181
+ return /* @__PURE__ */ jsx2("div", { className: "cnfy-article-modal-overlay", children: /* @__PURE__ */ jsxs("div", { className: "cnfy-article-modal", children: [
182
+ /* @__PURE__ */ jsxs("div", { className: "cnfy-article-modal-header", children: [
184
183
  /* @__PURE__ */ jsxs("div", { children: [
185
- /* @__PURE__ */ jsx2("p", { className: "text-xs text-gray-500 mb-1", children: "Source Article" }),
186
- /* @__PURE__ */ jsx2("h2", { className: "text-lg font-semibold text-gray-900 leading-snug", children: article.title })
184
+ /* @__PURE__ */ jsx2("p", { className: "cnfy-article-modal-source", children: "Source Article" }),
185
+ /* @__PURE__ */ jsx2("h2", { className: "cnfy-article-modal-title", children: article.title })
187
186
  ] }),
188
187
  /* @__PURE__ */ jsx2(
189
188
  "button",
190
189
  {
191
190
  onClick: onClose,
192
- className: "text-gray-400 hover:text-gray-700 transition",
191
+ className: "cnfy-article-modal-close-btn",
193
192
  "aria-label": "Close modal",
194
193
  children: "\u2715"
195
194
  }
196
195
  )
197
196
  ] }),
198
- /* @__PURE__ */ jsx2("div", { className: "px-6 py-5 max-h-[65vh] overflow-y-auto", children: /* @__PURE__ */ jsx2("div", { className: "prose prose-sm max-w-none text-gray-800", children: article.content }) }),
199
- /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between px-6 py-4 border-t bg-gray-50 rounded-b-xl", children: [
200
- /* @__PURE__ */ jsx2("span", { className: "text-xs text-gray-400", children: "This content will be recreated using AI" }),
201
- /* @__PURE__ */ jsxs("div", { className: "flex gap-2", children: [
197
+ /* @__PURE__ */ jsx2("div", { className: "cnfy-article-modal-body", children: /* @__PURE__ */ jsx2("div", { className: "cnfy-article-modal-content", children: article.content }) }),
198
+ /* @__PURE__ */ jsxs("div", { className: "cnfy-article-modal-footer", children: [
199
+ /* @__PURE__ */ jsx2("span", { className: "cnfy-article-modal-footer-text", children: "This content will be recreated using AI" }),
200
+ /* @__PURE__ */ jsxs("div", { className: "cnfy-article-modal-footer-actions", children: [
202
201
  /* @__PURE__ */ jsx2(
203
202
  "button",
204
203
  {
205
204
  onClick: onClose,
206
- className: "px-4 py-2 text-sm rounded-md border border-gray-300 text-gray-700 hover:bg-gray-100 transition",
205
+ className: "cnfy-btn-cancel",
207
206
  children: "Cancel"
208
207
  }
209
208
  ),
@@ -214,9 +213,8 @@ function ArticleModal({
214
213
  title: article.title,
215
214
  content: article.content,
216
215
  id: article._id
217
- // Include article ID when available
218
216
  }),
219
- className: "px-4 py-2 text-sm rounded-md bg-gray-900 text-white hover:bg-black transition",
217
+ className: "cnfy-btn-recreate",
220
218
  children: "Recreate Article"
221
219
  }
222
220
  )
@@ -298,7 +296,7 @@ function RichTextEditor({
298
296
  content,
299
297
  editorProps: {
300
298
  attributes: {
301
- class: "prose prose-sm max-w-none focus:outline-none min-h-[350px] p-4"
299
+ class: "ProseMirror"
302
300
  }
303
301
  },
304
302
  onUpdate: ({ editor: editor2 }) => {
@@ -311,10 +309,10 @@ function RichTextEditor({
311
309
  }
312
310
  }, [content, editor]);
313
311
  if (!editor) {
314
- return /* @__PURE__ */ jsx3("div", { className: "w-full h-[400px] border border-gray-300 rounded-lg flex items-center justify-center text-gray-400", children: "Loading editor..." });
312
+ return /* @__PURE__ */ jsx3("div", { className: "cnfy-editor-loading", children: "Loading editor..." });
315
313
  }
316
- return /* @__PURE__ */ jsxs2("div", { className: "w-full border border-gray-300 rounded-lg overflow-hidden", children: [
317
- /* @__PURE__ */ jsxs2("div", { className: "flex flex-wrap items-center gap-1 p-2 border-b border-gray-200 bg-gray-50", children: [
314
+ return /* @__PURE__ */ jsxs2("div", { className: "cnfy-editor", children: [
315
+ /* @__PURE__ */ jsxs2("div", { className: "cnfy-toolbar", children: [
318
316
  /* @__PURE__ */ jsx3(
319
317
  ToolbarButton,
320
318
  {
@@ -342,7 +340,7 @@ function RichTextEditor({
342
340
  children: /* @__PURE__ */ jsx3(Pilcrow, { size: 18 })
343
341
  }
344
342
  ),
345
- /* @__PURE__ */ jsx3("div", { className: "w-px h-6 bg-gray-300 mx-1" }),
343
+ /* @__PURE__ */ jsx3("div", { className: "cnfy-toolbar-divider" }),
346
344
  /* @__PURE__ */ jsx3(
347
345
  ToolbarButton,
348
346
  {
@@ -361,7 +359,7 @@ function RichTextEditor({
361
359
  children: /* @__PURE__ */ jsx3(Italic, { size: 18 })
362
360
  }
363
361
  ),
364
- /* @__PURE__ */ jsx3("div", { className: "w-px h-6 bg-gray-300 mx-1" }),
362
+ /* @__PURE__ */ jsx3("div", { className: "cnfy-toolbar-divider" }),
365
363
  /* @__PURE__ */ jsx3(
366
364
  ToolbarButton,
367
365
  {
@@ -380,7 +378,7 @@ function RichTextEditor({
380
378
  children: /* @__PURE__ */ jsx3(ListOrdered, { size: 18 })
381
379
  }
382
380
  ),
383
- /* @__PURE__ */ jsx3("div", { className: "w-px h-6 bg-gray-300 mx-1" }),
381
+ /* @__PURE__ */ jsx3("div", { className: "cnfy-toolbar-divider" }),
384
382
  /* @__PURE__ */ jsx3(
385
383
  ToolbarButton,
386
384
  {
@@ -400,7 +398,7 @@ function RichTextEditor({
400
398
  }
401
399
  )
402
400
  ] }),
403
- /* @__PURE__ */ jsx3(EditorContent, { editor, className: "min-h-[350px]" })
401
+ /* @__PURE__ */ jsx3(EditorContent, { editor, className: "cnfy-editor-content" })
404
402
  ] });
405
403
  }
406
404
  function ToolbarButton({
@@ -416,7 +414,7 @@ function ToolbarButton({
416
414
  onClick,
417
415
  disabled,
418
416
  title,
419
- className: `p-2 rounded hover:bg-gray-200 transition-colors ${isActive ? "bg-gray-200 text-emerald-600" : "text-gray-600"} ${disabled ? "opacity-40 cursor-not-allowed" : ""}`,
417
+ className: `cnfy-toolbar-btn ${isActive ? "cnfy-toolbar-btn--active" : ""} ${disabled ? "cnfy-toolbar-btn--disabled" : ""}`,
420
418
  children
421
419
  }
422
420
  );
@@ -500,29 +498,29 @@ function EditModal({
500
498
  }
501
499
  };
502
500
  if (!isOpen) return null;
503
- return /* @__PURE__ */ jsxs3("div", { className: "fixed inset-0 z-50 flex items-center justify-center", children: [
501
+ return /* @__PURE__ */ jsxs3("div", { className: "cnfy-edit-modal-overlay", children: [
504
502
  /* @__PURE__ */ jsx4(
505
503
  "div",
506
504
  {
507
- className: "absolute inset-0 bg-black/50",
505
+ className: "cnfy-edit-modal-backdrop",
508
506
  onClick: onClose
509
507
  }
510
508
  ),
511
- /* @__PURE__ */ jsxs3("div", { className: "relative w-full h-full max-w-5xl max-h-[90vh] m-4 bg-white rounded-xl shadow-2xl flex flex-col overflow-hidden", children: [
512
- /* @__PURE__ */ jsxs3("div", { className: "flex items-center justify-between px-6 py-4 border-b", children: [
513
- /* @__PURE__ */ jsx4("h2", { className: "text-xl font-semibold text-gray-900", children: "Edit Article" }),
509
+ /* @__PURE__ */ jsxs3("div", { className: "cnfy-edit-modal", children: [
510
+ /* @__PURE__ */ jsxs3("div", { className: "cnfy-edit-modal-header", children: [
511
+ /* @__PURE__ */ jsx4("h2", { className: "cnfy-edit-modal-title", children: "Edit Article" }),
514
512
  /* @__PURE__ */ jsx4(
515
513
  "button",
516
514
  {
517
515
  onClick: onClose,
518
- className: "p-2 rounded-full hover:bg-gray-100 transition-colors",
519
- children: /* @__PURE__ */ jsx4(X, { size: 20, className: "text-gray-500" })
516
+ className: "cnfy-edit-modal-close-btn",
517
+ children: /* @__PURE__ */ jsx4(X, { size: 20, className: "cnfy-edit-modal-close-icon" })
520
518
  }
521
519
  )
522
520
  ] }),
523
- /* @__PURE__ */ jsxs3("div", { className: "flex-1 overflow-y-auto p-6 space-y-6", children: [
521
+ /* @__PURE__ */ jsxs3("div", { className: "cnfy-edit-modal-body", children: [
524
522
  /* @__PURE__ */ jsxs3("div", { children: [
525
- /* @__PURE__ */ jsx4("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "Article Content" }),
523
+ /* @__PURE__ */ jsx4("label", { className: "cnfy-edit-label", children: "Article Content" }),
526
524
  /* @__PURE__ */ jsx4(
527
525
  RichTextEditor,
528
526
  {
@@ -533,11 +531,11 @@ function EditModal({
533
531
  )
534
532
  ] }),
535
533
  /* @__PURE__ */ jsxs3("div", { children: [
536
- /* @__PURE__ */ jsx4("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "Meta Keywords" }),
537
- /* @__PURE__ */ jsx4("div", { className: "flex flex-wrap gap-2 mb-3", children: keywords.map((keyword, index) => /* @__PURE__ */ jsxs3(
534
+ /* @__PURE__ */ jsx4("label", { className: "cnfy-edit-label", children: "Meta Keywords" }),
535
+ /* @__PURE__ */ jsx4("div", { className: "cnfy-keyword-list", children: keywords.map((keyword, index) => /* @__PURE__ */ jsxs3(
538
536
  "span",
539
537
  {
540
- className: "inline-flex items-center gap-1 px-3 py-1 bg-gray-100 text-gray-700 rounded-full text-sm",
538
+ className: "cnfy-keyword-tag",
541
539
  children: [
542
540
  "#",
543
541
  keyword,
@@ -545,7 +543,7 @@ function EditModal({
545
543
  "button",
546
544
  {
547
545
  onClick: () => handleRemoveKeyword(index),
548
- className: "ml-1 text-gray-400 hover:text-gray-600",
546
+ className: "cnfy-keyword-remove-btn",
549
547
  children: /* @__PURE__ */ jsx4(X, { size: 14 })
550
548
  }
551
549
  )
@@ -553,7 +551,7 @@ function EditModal({
553
551
  },
554
552
  index
555
553
  )) }),
556
- /* @__PURE__ */ jsxs3("div", { className: "flex gap-2", children: [
554
+ /* @__PURE__ */ jsxs3("div", { className: "cnfy-keyword-input-row", children: [
557
555
  /* @__PURE__ */ jsx4(
558
556
  "input",
559
557
  {
@@ -562,26 +560,26 @@ function EditModal({
562
560
  onChange: (e) => setNewKeyword(e.target.value),
563
561
  onKeyDown: handleKeyDown,
564
562
  placeholder: "Add a keyword...",
565
- className: "flex-1 px-3 py-2 border border-gray-300 rounded-lg text-sm focus:ring-2 focus:ring-emerald-500 focus:border-emerald-500"
563
+ className: "cnfy-keyword-input"
566
564
  }
567
565
  ),
568
566
  /* @__PURE__ */ jsx4(
569
567
  "button",
570
568
  {
571
569
  onClick: handleAddKeyword,
572
- className: "px-4 py-2 bg-gray-100 text-gray-700 rounded-lg text-sm font-medium hover:bg-gray-200 transition-colors",
570
+ className: "cnfy-btn-add-keyword",
573
571
  children: "Add"
574
572
  }
575
573
  )
576
574
  ] })
577
575
  ] })
578
576
  ] }),
579
- /* @__PURE__ */ jsxs3("div", { className: "flex items-center justify-end gap-3 px-6 py-4 border-t bg-gray-50", children: [
577
+ /* @__PURE__ */ jsxs3("div", { className: "cnfy-edit-modal-footer", children: [
580
578
  /* @__PURE__ */ jsx4(
581
579
  "button",
582
580
  {
583
581
  onClick: onClose,
584
- className: "px-4 py-2 text-gray-700 text-sm font-medium hover:bg-gray-100 rounded-lg transition-colors",
582
+ className: "cnfy-btn-footer-cancel",
585
583
  children: "Cancel"
586
584
  }
587
585
  ),
@@ -589,7 +587,7 @@ function EditModal({
589
587
  "button",
590
588
  {
591
589
  onClick: () => onSaveDraft(content, keywords),
592
- className: "px-4 py-2 bg-gray-200 text-gray-800 text-sm font-medium rounded-lg hover:bg-gray-300 transition-colors",
590
+ className: "cnfy-btn-save-draft",
593
591
  children: "Save Draft"
594
592
  }
595
593
  ),
@@ -597,7 +595,7 @@ function EditModal({
597
595
  "button",
598
596
  {
599
597
  onClick: () => onPost(content, keywords),
600
- className: "px-4 py-2 bg-emerald-600 text-white text-sm font-medium rounded-lg hover:bg-emerald-700 transition-colors",
598
+ className: "cnfy-btn-post-article",
601
599
  style: { backgroundColor: primaryColor, color: "#fff" },
602
600
  children: "Post"
603
601
  }
@@ -652,22 +650,22 @@ function NewsList({
652
650
  b = Math.round(b + (255 - b) * (percent / 100));
653
651
  return `rgb(${r}, ${g}, ${b})`;
654
652
  };
655
- return /* @__PURE__ */ jsx5("div", { className: "p-4 space-y-3", children: news.flatMap((item) => {
653
+ return /* @__PURE__ */ jsx5("div", { className: "cnfy-news-list", children: news.flatMap((item) => {
656
654
  const publishedDate = new Date(item.publishedAt);
657
655
  const links = extractLinksFromContent(item.content);
658
656
  if (links.length > 0) {
659
657
  return links.map((link, idx) => /* @__PURE__ */ jsxs4(
660
658
  "div",
661
659
  {
662
- className: "flex items-start justify-between gap-3 rounded-lg border border-gray-200 bg-white p-3 text-sm hover:bg-gray-50 transition",
660
+ className: "cnfy-news-card",
663
661
  children: [
664
- /* @__PURE__ */ jsxs4("div", { className: "min-w-0", children: [
665
- /* @__PURE__ */ jsx5("p", { className: "font-bold text-gray-900 line-clamp-2", children: link.title }),
666
- /* @__PURE__ */ jsxs4("div", { className: "flex flex-wrap items-center gap-2 mt-2 text-xs text-gray-500", children: [
662
+ /* @__PURE__ */ jsxs4("div", { className: "cnfy-news-card-content", children: [
663
+ /* @__PURE__ */ jsx5("p", { className: "cnfy-news-card-title", children: link.title }),
664
+ /* @__PURE__ */ jsxs4("div", { className: "cnfy-news-card-meta", children: [
667
665
  /* @__PURE__ */ jsx5(
668
666
  "span",
669
667
  {
670
- className: "inline-flex items-center rounded-full px-2 py-0.5 font-medium border",
668
+ className: "cnfy-news-badge",
671
669
  style: {
672
670
  backgroundColor: lightenColor(primaryColorState, 95),
673
671
  color: primaryColor,
@@ -677,7 +675,7 @@ function NewsList({
677
675
  }
678
676
  ),
679
677
  /* @__PURE__ */ jsx5("span", { children: "\u2022" }),
680
- /* @__PURE__ */ jsx5("span", { className: "capitalize", children: item.category }),
678
+ /* @__PURE__ */ jsx5("span", { className: "cnfy-news-card-category", children: item.category }),
681
679
  /* @__PURE__ */ jsx5("span", { children: "\u2022" }),
682
680
  /* @__PURE__ */ jsxs4("span", { children: [
683
681
  dateFormatter.format(publishedDate),
@@ -686,12 +684,12 @@ function NewsList({
686
684
  ] })
687
685
  ] })
688
686
  ] }),
689
- /* @__PURE__ */ jsxs4("div", { className: "flex flex-col gap-2 shrink-0", children: [
687
+ /* @__PURE__ */ jsxs4("div", { className: "cnfy-news-card-actions", children: [
690
688
  /* @__PURE__ */ jsx5(
691
689
  "button",
692
690
  {
693
691
  onClick: () => window.open(link.url, "_blank"),
694
- className: "p-1 text-gray-400 hover:text-gray-700",
692
+ className: "cnfy-news-action-btn",
695
693
  title: "View",
696
694
  children: /* @__PURE__ */ jsx5(Eye, { size: 16 })
697
695
  }
@@ -703,9 +701,8 @@ function NewsList({
703
701
  title: link.title,
704
702
  content: link.title,
705
703
  id: item._id
706
- // Include article ID
707
704
  }),
708
- className: "p-1 text-gray-400 hover:text-gray-700",
705
+ className: "cnfy-news-action-btn",
709
706
  title: "Recreate",
710
707
  children: /* @__PURE__ */ jsx5(RefreshCcw, { size: 16 })
711
708
  }
@@ -719,15 +716,15 @@ function NewsList({
719
716
  return /* @__PURE__ */ jsxs4(
720
717
  "div",
721
718
  {
722
- className: "flex items-start justify-between gap-3 rounded-lg border border-gray-200 bg-white p-3 text-sm hover:bg-gray-50 transition",
719
+ className: "cnfy-news-card",
723
720
  children: [
724
- /* @__PURE__ */ jsxs4("div", { className: "min-w-0", children: [
725
- /* @__PURE__ */ jsx5("p", { className: "font-bold text-gray-900 line-clamp-2", children: item.title }),
726
- /* @__PURE__ */ jsxs4("div", { className: "flex flex-wrap items-center gap-2 mt-2 text-xs text-gray-500", children: [
721
+ /* @__PURE__ */ jsxs4("div", { className: "cnfy-news-card-content", children: [
722
+ /* @__PURE__ */ jsx5("p", { className: "cnfy-news-card-title", children: item.title }),
723
+ /* @__PURE__ */ jsxs4("div", { className: "cnfy-news-card-meta", children: [
727
724
  /* @__PURE__ */ jsx5(
728
725
  "span",
729
726
  {
730
- className: "inline-flex items-center rounded-full px-2 py-0.5 font-medium border",
727
+ className: "cnfy-news-badge",
731
728
  style: {
732
729
  backgroundColor: lightenColor(primaryColorState, 95),
733
730
  color: primaryColor,
@@ -737,7 +734,7 @@ function NewsList({
737
734
  }
738
735
  ),
739
736
  /* @__PURE__ */ jsx5("span", { children: "\u2022" }),
740
- /* @__PURE__ */ jsx5("span", { className: "capitalize", children: item.category }),
737
+ /* @__PURE__ */ jsx5("span", { className: "cnfy-news-card-category", children: item.category }),
741
738
  /* @__PURE__ */ jsx5("span", { children: "\u2022" }),
742
739
  /* @__PURE__ */ jsxs4("span", { children: [
743
740
  dateFormatter.format(publishedDate),
@@ -746,12 +743,12 @@ function NewsList({
746
743
  ] })
747
744
  ] })
748
745
  ] }),
749
- /* @__PURE__ */ jsxs4("div", { className: "flex flex-col gap-2 shrink-0", children: [
746
+ /* @__PURE__ */ jsxs4("div", { className: "cnfy-news-card-actions", children: [
750
747
  /* @__PURE__ */ jsx5(
751
748
  "button",
752
749
  {
753
750
  onClick: () => onView(item),
754
- className: "p-1 text-gray-400 hover:text-gray-700",
751
+ className: "cnfy-news-action-btn",
755
752
  title: "View",
756
753
  children: /* @__PURE__ */ jsx5(Eye, { size: 16 })
757
754
  }
@@ -763,9 +760,8 @@ function NewsList({
763
760
  title: item.title,
764
761
  content: item.content || item.title,
765
762
  id: item._id
766
- // Include article ID
767
763
  }),
768
- className: "p-1 text-gray-400 hover:text-gray-700",
764
+ className: "cnfy-news-action-btn",
769
765
  title: "Recreate",
770
766
  children: /* @__PURE__ */ jsx5(RefreshCcw, { size: 16 })
771
767
  }
@@ -974,30 +970,30 @@ function ChatWindow({
974
970
  });
975
971
  return { blocks, metaKeywords };
976
972
  }
977
- return /* @__PURE__ */ jsxs5("div", { className: "h-full flex w-full flex-col", children: [
978
- /* @__PURE__ */ jsx6("div", { className: "flex-1 px-4 py-6", children: /* @__PURE__ */ jsxs5("div", { className: "max-w-3xl chat-scroll mx-auto space-y-6", children: [
973
+ return /* @__PURE__ */ jsxs5("div", { className: "cnfy-chat", children: [
974
+ /* @__PURE__ */ jsx6("div", { className: "cnfy-chat-area", children: /* @__PURE__ */ jsxs5("div", { className: "cnfy-chat-scroll", children: [
979
975
  messages.map((msg) => {
980
976
  var _a2;
981
977
  const parsed = formatAIContent(msg.content);
982
- return /* @__PURE__ */ jsxs5("div", { className: "flex gap-3", children: [
983
- /* @__PURE__ */ jsx6("div", { className: "flex-shrink-0", children: /* @__PURE__ */ jsx6(
978
+ return /* @__PURE__ */ jsxs5("div", { className: "cnfy-msg", children: [
979
+ /* @__PURE__ */ jsx6("div", { className: "cnfy-msg-avatar-wrap", children: /* @__PURE__ */ jsx6(
984
980
  "div",
985
981
  {
986
- className: "h-8 w-8 rounded-full flex items-center justify-center text-xs font-semibold text-white",
982
+ className: "cnfy-msg-avatar",
987
983
  style: {
988
984
  backgroundColor: msg.role === "assistant" ? primaryColor : "#1f2937"
989
985
  },
990
986
  children: msg.role === "assistant" ? "AI" : "You"
991
987
  }
992
988
  ) }),
993
- /* @__PURE__ */ jsxs5("div", { className: "flex-1 text-sm space-y-3 leading-relaxed", children: [
994
- msg.role === "assistant" && parsed.blocks.length > 0 && /* @__PURE__ */ jsx6("div", { className: "flex justify-end -mt-1 mb-2", children: /* @__PURE__ */ jsx6(
989
+ /* @__PURE__ */ jsxs5("div", { className: "cnfy-msg-body", children: [
990
+ msg.role === "assistant" && parsed.blocks.length > 0 && /* @__PURE__ */ jsx6("div", { className: "cnfy-msg-copy-row", children: /* @__PURE__ */ jsx6(
995
991
  "button",
996
992
  {
997
993
  onClick: () => handleCopy(parsed.blocks, msg.id),
998
- className: "p-1.5 rounded-md hover:bg-gray-100 transition-colors text-gray-400 hover:text-gray-600",
994
+ className: "cnfy-copy-btn",
999
995
  title: "Copy to clipboard",
1000
- children: copiedId === msg.id ? /* @__PURE__ */ jsx6(Check, { size: 16, className: "text-emerald-600" }) : /* @__PURE__ */ jsx6(Copy, { size: 16 })
996
+ children: copiedId === msg.id ? /* @__PURE__ */ jsx6(Check, { size: 16, className: "cnfy-copy-icon--copied" }) : /* @__PURE__ */ jsx6(Copy, { size: 16 })
1001
997
  }
1002
998
  ) }),
1003
999
  parsed.blocks.map((block, idx) => {
@@ -1005,7 +1001,7 @@ function ChatWindow({
1005
1001
  return /* @__PURE__ */ jsx6(
1006
1002
  "h1",
1007
1003
  {
1008
- className: "text-sm font-semibold",
1004
+ className: "cnfy-block-h1",
1009
1005
  children: block.text
1010
1006
  },
1011
1007
  idx
@@ -1015,18 +1011,18 @@ function ChatWindow({
1015
1011
  return /* @__PURE__ */ jsx6(
1016
1012
  "h2",
1017
1013
  {
1018
- className: "text-base font-semibold mt-4",
1014
+ className: "cnfy-block-h2",
1019
1015
  children: block.text
1020
1016
  },
1021
1017
  idx
1022
1018
  );
1023
1019
  }
1024
- return /* @__PURE__ */ jsx6("p", { className: "text-gray-800", children: block.text }, idx);
1020
+ return /* @__PURE__ */ jsx6("p", { className: "cnfy-block-p", children: block.text }, idx);
1025
1021
  }),
1026
- parsed.metaKeywords.length > 0 && /* @__PURE__ */ jsx6("div", { className: "pt-4 border-t mt-6", children: /* @__PURE__ */ jsx6("div", { className: "flex flex-wrap gap-2", children: parsed.metaKeywords.map((tag, i) => /* @__PURE__ */ jsxs5(
1022
+ parsed.metaKeywords.length > 0 && /* @__PURE__ */ jsx6("div", { className: "cnfy-msg-keywords", children: /* @__PURE__ */ jsx6("div", { className: "cnfy-msg-keywords-list", children: parsed.metaKeywords.map((tag, i) => /* @__PURE__ */ jsxs5(
1027
1023
  "span",
1028
1024
  {
1029
- className: "text-xs px-3 py-1 rounded-full bg-gray-100 text-gray-700",
1025
+ className: "cnfy-msg-keyword-tag",
1030
1026
  children: [
1031
1027
  "#",
1032
1028
  tag
@@ -1034,13 +1030,13 @@ function ChatWindow({
1034
1030
  },
1035
1031
  i
1036
1032
  )) }) }),
1037
- msg.role === "assistant" && (analyzedData == null ? void 0 : analyzedData.messageId) === msg.id && analyzedData.options.length > 0 && /* @__PURE__ */ jsx6("div", { className: "flex flex-wrap gap-2 pt-4 mt-2", children: analyzedData.options.map((option) => {
1033
+ msg.role === "assistant" && (analyzedData == null ? void 0 : analyzedData.messageId) === msg.id && analyzedData.options.length > 0 && /* @__PURE__ */ jsx6("div", { className: "cnfy-action-options", children: analyzedData.options.map((option) => {
1038
1034
  const IconComponent = ACTION_ICONS[option.id] || FileText;
1039
1035
  return /* @__PURE__ */ jsxs5(
1040
1036
  "button",
1041
1037
  {
1042
1038
  onClick: () => onSelectAction == null ? void 0 : onSelectAction(option.id, analyzedData.url, analyzedData.content),
1043
- className: "flex items-center gap-2 px-4 py-2 border border-gray-200 rounded-lg text-sm font-medium text-gray-700 hover:bg-gray-50 hover:border-gray-300 transition-colors",
1039
+ className: "cnfy-action-btn",
1044
1040
  children: [
1045
1041
  /* @__PURE__ */ jsx6(IconComponent, { size: 16 }),
1046
1042
  option.name
@@ -1049,12 +1045,12 @@ function ChatWindow({
1049
1045
  option.id
1050
1046
  );
1051
1047
  }) }),
1052
- msg.role === "assistant" && parsed.blocks.length > 0 && !(analyzedData == null ? void 0 : analyzedData.messageId) && (!isStreaming || msg.id !== ((_a2 = messages[messages.length - 1]) == null ? void 0 : _a2.id)) && /* @__PURE__ */ jsxs5("div", { className: "flex gap-3 pt-4 mt-2", children: [
1048
+ msg.role === "assistant" && parsed.blocks.length > 0 && !(analyzedData == null ? void 0 : analyzedData.messageId) && (!isStreaming || msg.id !== ((_a2 = messages[messages.length - 1]) == null ? void 0 : _a2.id)) && /* @__PURE__ */ jsxs5("div", { className: "cnfy-msg-actions", children: [
1053
1049
  /* @__PURE__ */ jsxs5(
1054
1050
  "button",
1055
1051
  {
1056
1052
  onClick: () => handleEdit(parsed.blocks, parsed.metaKeywords, msg.id),
1057
- className: "flex items-center gap-2 px-4 py-2 border border-gray-300 rounded-lg text-sm font-medium text-gray-700 hover:bg-gray-50 transition-colors",
1053
+ className: "cnfy-btn-edit",
1058
1054
  children: [
1059
1055
  /* @__PURE__ */ jsx6(Edit3, { size: 16 }),
1060
1056
  "Edit"
@@ -1065,7 +1061,7 @@ function ChatWindow({
1065
1061
  "button",
1066
1062
  {
1067
1063
  onClick: () => handlePost(msg.content, parsed.metaKeywords),
1068
- className: "flex items-center gap-2 px-4 py-2 rounded-lg text-sm font-medium text-white hover:bg-emerald-700 transition-colors",
1064
+ className: "cnfy-btn-post",
1069
1065
  style: { backgroundColor: primaryColor, color: "#fff" },
1070
1066
  children: [
1071
1067
  /* @__PURE__ */ jsx6(Send, { size: 16 }),
@@ -1079,32 +1075,32 @@ function ChatWindow({
1079
1075
  }),
1080
1076
  /* @__PURE__ */ jsx6("div", { ref: bottomRef })
1081
1077
  ] }) }),
1082
- /* @__PURE__ */ jsx6("div", { className: "shrink-0 bg-white px-4 py-3", children: /* @__PURE__ */ jsxs5("div", { className: "max-w-3xl mx-auto relative flex gap-2 items-end", children: [
1083
- !showNewsPanel && /* @__PURE__ */ jsxs5("div", { ref: dropdownRef, className: "absolute left-3 top-1/2 -translate-y-1/2 z-10", children: [
1078
+ /* @__PURE__ */ jsx6("div", { className: "cnfy-input-area", children: /* @__PURE__ */ jsxs5("div", { className: "cnfy-input-inner", children: [
1079
+ !showNewsPanel && /* @__PURE__ */ jsxs5("div", { ref: dropdownRef, className: "cnfy-news-pulse-wrap", children: [
1084
1080
  /* @__PURE__ */ jsx6(
1085
1081
  "button",
1086
1082
  {
1087
1083
  onClick: handleOpenNewsDropdown,
1088
- className: "flex h-8 w-8 items-center justify-center rounded-full bg-gradient-to-r from-purple-500 to-pink-500 text-white hover:from-purple-600 hover:to-pink-600 transition-all animate-pulse hover:animate-none",
1084
+ className: "cnfy-news-pulse-btn cnfy-animate-pulse",
1089
1085
  title: "Select from trending news",
1090
1086
  children: /* @__PURE__ */ jsx6(Zap, { size: 16 })
1091
1087
  }
1092
1088
  ),
1093
- showNewsDropdown && /* @__PURE__ */ jsxs5("div", { className: "absolute bottom-full left-0 mb-2 w-[600px] bg-white border border-gray-200 rounded-lg shadow-xl max-h-[600px] overflow-hidden", children: [
1094
- /* @__PURE__ */ jsxs5("div", { className: "flex items-center justify-between px-3 py-2 border-b border-gray-100", style: { backgroundColor: primaryColor, color: "#fff" }, children: [
1095
- /* @__PURE__ */ jsx6("span", { className: "text-sm font-medium text-white", children: "Select News" }),
1089
+ showNewsDropdown && /* @__PURE__ */ jsxs5("div", { className: "cnfy-news-dropdown", children: [
1090
+ /* @__PURE__ */ jsxs5("div", { className: "cnfy-news-dropdown-header", style: { backgroundColor: primaryColor, color: "#fff" }, children: [
1091
+ /* @__PURE__ */ jsx6("span", { className: "cnfy-news-dropdown-title", children: "Select News" }),
1096
1092
  /* @__PURE__ */ jsx6(
1097
1093
  "button",
1098
1094
  {
1099
1095
  onClick: () => setShowNewsDropdown(false),
1100
- className: "p-1 hover:bg-gray-200 rounded transition",
1096
+ className: "cnfy-news-dropdown-close",
1101
1097
  style: { backgroundColor: primaryColor, color: "#fff" },
1102
- children: /* @__PURE__ */ jsx6(X2, { size: 14, className: "text-white" })
1098
+ children: /* @__PURE__ */ jsx6(X2, { size: 14 })
1103
1099
  }
1104
1100
  )
1105
1101
  ] }),
1106
- /* @__PURE__ */ jsxs5("div", { className: "px-3 py-2 border-b border-gray-100 flex items-center gap-2", children: [
1107
- /* @__PURE__ */ jsx6("div", { className: "flex-1 min-w-[180px]", children: /* @__PURE__ */ jsx6(
1102
+ /* @__PURE__ */ jsxs5("div", { className: "cnfy-news-dropdown-source", children: [
1103
+ /* @__PURE__ */ jsx6("div", { className: "cnfy-news-dropdown-select-wrap", children: /* @__PURE__ */ jsx6(
1108
1104
  Select,
1109
1105
  {
1110
1106
  options: [
@@ -1155,10 +1151,10 @@ function ChatWindow({
1155
1151
  {
1156
1152
  onClick: handleScrape,
1157
1153
  disabled: scraping,
1158
- className: "flex items-center gap-1.5 px-3 py-2 bg-emerald-600 text-white rounded-lg text-sm font-medium hover:bg-emerald-700 transition disabled:opacity-50",
1154
+ className: "cnfy-scrape-btn",
1159
1155
  title: "Fetch latest news",
1160
1156
  children: [
1161
- /* @__PURE__ */ jsx6(RefreshCcw2, { size: 14, className: scraping ? "animate-spin" : "" }),
1157
+ /* @__PURE__ */ jsx6(RefreshCcw2, { size: 14, className: scraping ? "cnfy-animate-spin" : "" }),
1162
1158
  scraping ? "Scraping..." : "Scrape"
1163
1159
  ]
1164
1160
  }
@@ -1168,17 +1164,17 @@ function ChatWindow({
1168
1164
  {
1169
1165
  onClick: () => fetchNews(null),
1170
1166
  disabled: loadingNews,
1171
- className: "flex items-center gap-1 px-3 py-2 text-sm text-gray-600 hover:text-gray-900 border border-gray-200 rounded-lg transition",
1167
+ className: "cnfy-refresh-btn",
1172
1168
  children: [
1173
- /* @__PURE__ */ jsx6(RefreshCcw2, { size: 14, className: loadingNews ? "animate-spin" : "" }),
1169
+ /* @__PURE__ */ jsx6(RefreshCcw2, { size: 14, className: loadingNews ? "cnfy-animate-spin" : "" }),
1174
1170
  "Refresh"
1175
1171
  ]
1176
1172
  }
1177
1173
  )
1178
1174
  ] }),
1179
- /* @__PURE__ */ jsx6("div", { className: "overflow-y-auto max-h-[320px]", children: loadingNews ? /* @__PURE__ */ jsx6("div", { className: "p-4 text-center text-sm text-gray-500", children: "Loading news..." }) : trendingNews.length === 0 ? /* @__PURE__ */ jsxs5("div", { className: "p-4 text-center text-sm text-gray-500", children: [
1175
+ /* @__PURE__ */ jsx6("div", { className: "cnfy-news-dropdown-list", children: loadingNews ? /* @__PURE__ */ jsx6("div", { className: "cnfy-news-dropdown-msg", children: "Loading news..." }) : trendingNews.length === 0 ? /* @__PURE__ */ jsxs5("div", { className: "cnfy-news-dropdown-msg", children: [
1180
1176
  /* @__PURE__ */ jsx6("p", { children: "No news found." }),
1181
- selectedSource && /* @__PURE__ */ jsx6("p", { className: "mt-1 text-xs", children: 'Click "Scrape" to fetch latest news.' })
1177
+ selectedSource && /* @__PURE__ */ jsx6("p", { className: "cnfy-news-dropdown-hint", children: 'Click "Scrape" to fetch latest news.' })
1182
1178
  ] }) : /* @__PURE__ */ jsx6(
1183
1179
  NewsList,
1184
1180
  {
@@ -1206,7 +1202,7 @@ function ChatWindow({
1206
1202
  },
1207
1203
  rows: 1,
1208
1204
  placeholder: "Ask AI something\u2026",
1209
- className: `flex-1 resize-none overflow-hidden border border-gray-300 ${!showNewsPanel ? "!pl-14" : "!pl-5"} !pr-[50px] input_box_textarea`,
1205
+ className: `cnfy-chat-textarea ${!showNewsPanel ? "cnfy-chat-textarea--with-pulse" : ""}`,
1210
1206
  style: { maxHeight: "200px", overflowY: input.split("\n").length > 6 ? "auto" : "hidden" }
1211
1207
  }
1212
1208
  ),
@@ -1214,7 +1210,7 @@ function ChatWindow({
1214
1210
  "button",
1215
1211
  {
1216
1212
  onClick: handleSend,
1217
- className: "flex h-10 w-10 absolute right-[10px] top-[5px] items-center justify-center rounded-full bg-emerald-600 text-white",
1213
+ className: "cnfy-send-btn",
1218
1214
  style: { backgroundColor: primaryColor, color: "#fff" },
1219
1215
  children: /* @__PURE__ */ jsx6(SendHorizontal, { size: 18 })
1220
1216
  }
@@ -1286,23 +1282,23 @@ function UserMenu({
1286
1282
  toast.error(err || "Logout failed");
1287
1283
  }
1288
1284
  }
1289
- return /* @__PURE__ */ jsxs6("div", { ref, className: "relative", children: [
1285
+ return /* @__PURE__ */ jsxs6("div", { ref, className: "cnfy-user-menu", children: [
1290
1286
  /* @__PURE__ */ jsx7(
1291
1287
  "button",
1292
1288
  {
1293
1289
  onClick: () => setOpen((v) => !v),
1294
- className: "p-2 rounded-full hover:bg-gray-100 transition",
1290
+ className: "cnfy-user-menu-trigger",
1295
1291
  "aria-label": "Settings",
1296
- children: /* @__PURE__ */ jsx7(Settings, { size: 20, className: "text-gray-600" })
1292
+ children: /* @__PURE__ */ jsx7(Settings, { size: 20, className: "cnfy-user-menu-trigger-icon" })
1297
1293
  }
1298
1294
  ),
1299
- open && /* @__PURE__ */ jsxs6("div", { className: "absolute right-0 top-full mb-2 w-52 bg-white border border-gray-200 rounded-lg shadow-lg z-50", children: [
1295
+ open && /* @__PURE__ */ jsxs6("div", { className: "cnfy-dropdown", children: [
1300
1296
  /* @__PURE__ */ jsx7(MenuItem, { icon: User, label: "Account", onClick: () => go("/dashboard/account") }),
1301
1297
  /* @__PURE__ */ jsx7(MenuItem, { icon: Settings, label: "Preferences", onClick: () => go("/dashboard/preferences") }),
1302
1298
  /* @__PURE__ */ jsx7(MenuItem, { icon: Palette, label: "Appearance", onClick: () => go("/dashboard/appearance") }),
1303
1299
  /* @__PURE__ */ jsx7(MenuItem, { icon: HelpCircle, label: "Settings", onClick: () => go("/dashboard/settings") }),
1304
1300
  /* @__PURE__ */ jsx7(MenuItem, { icon: HelpCircle, label: "Help & Support", onClick: () => go("/dashboard/help") }),
1305
- /* @__PURE__ */ jsx7("div", { className: "border-t border-gray-300 my-1" }),
1301
+ /* @__PURE__ */ jsx7("div", { className: "cnfy-dropdown-divider" }),
1306
1302
  /* @__PURE__ */ jsx7(
1307
1303
  MenuItem,
1308
1304
  {
@@ -1325,7 +1321,7 @@ function MenuItem({
1325
1321
  "button",
1326
1322
  {
1327
1323
  onClick,
1328
- className: `w-full flex items-center gap-2 px-4 py-2 text-sm transition ${danger ? "text-red-600 hover:bg-red-50" : "text-gray-700 hover:bg-gray-100"}`,
1324
+ className: `cnfy-menu-item ${danger ? "cnfy-menu-item--danger" : ""}`,
1329
1325
  children: [
1330
1326
  /* @__PURE__ */ jsx7(Icon, { size: 16 }),
1331
1327
  label
@@ -1341,19 +1337,19 @@ function HeaderBar({
1341
1337
  onLogout
1342
1338
  }) {
1343
1339
  const { primaryColor, botName, logoUrl } = useTheme();
1344
- return /* @__PURE__ */ jsx8("header", { className: "sticky top-0 z-40 bg-white border-b border-gray-200", children: /* @__PURE__ */ jsxs7("div", { className: "mx-auto flex h-14 items-center justify-between px-4", children: [
1345
- /* @__PURE__ */ jsxs7("div", { className: "flex items-center gap-3 cursor-pointer", onClick: () => onNavigate == null ? void 0 : onNavigate("/"), children: [
1346
- logoUrl ? /* @__PURE__ */ jsx8("img", { src: logoUrl, alt: "Logo", className: "h-8 w-8 rounded-md object-cover" }) : /* @__PURE__ */ jsx8(
1340
+ return /* @__PURE__ */ jsx8("header", { className: "cnfy-header", children: /* @__PURE__ */ jsxs7("div", { className: "cnfy-header-inner", children: [
1341
+ /* @__PURE__ */ jsxs7("div", { className: "cnfy-header-left", onClick: () => onNavigate == null ? void 0 : onNavigate("/"), children: [
1342
+ logoUrl ? /* @__PURE__ */ jsx8("img", { src: logoUrl, alt: "Logo", className: "cnfy-header-logo-img" }) : /* @__PURE__ */ jsx8(
1347
1343
  "div",
1348
1344
  {
1349
- className: "h-8 w-8 rounded-md text-white flex items-center justify-center font-bold text-sm",
1345
+ className: "cnfy-header-logo-fallback",
1350
1346
  style: { backgroundColor: primaryColor },
1351
1347
  children: botName.charAt(0).toUpperCase()
1352
1348
  }
1353
1349
  ),
1354
- /* @__PURE__ */ jsx8("span", { className: "font-semibold text-gray-900 text-base", children: botName.toUpperCase() })
1350
+ /* @__PURE__ */ jsx8("span", { className: "cnfy-header-brand", children: botName.toUpperCase() })
1355
1351
  ] }),
1356
- /* @__PURE__ */ jsx8("div", { className: "flex items-center gap-3", children: /* @__PURE__ */ jsx8(UserMenu, { onNavigate, onLogout }) })
1352
+ /* @__PURE__ */ jsx8("div", { className: "cnfy-header-right", children: /* @__PURE__ */ jsx8(UserMenu, { onNavigate, onLogout }) })
1357
1353
  ] }) });
1358
1354
  }
1359
1355
 
@@ -1398,12 +1394,12 @@ function TrendingNews({
1398
1394
  window.open(item.sourceUrl || item.link, "_blank");
1399
1395
  }
1400
1396
  if (isLoading) {
1401
- return /* @__PURE__ */ jsx9("div", { className: "p-4 text-sm text-gray-500", children: "Loading news..." });
1397
+ return /* @__PURE__ */ jsx9("div", { className: "cnfy-trending-msg", children: "Loading news..." });
1402
1398
  }
1403
1399
  if (!displayNews || displayNews.length === 0) {
1404
- return /* @__PURE__ */ jsxs8("div", { className: "p-4 text-sm text-gray-500 text-center", children: [
1400
+ return /* @__PURE__ */ jsxs8("div", { className: "cnfy-trending-msg cnfy-trending-msg--center", children: [
1405
1401
  /* @__PURE__ */ jsx9("p", { children: "No news found for this source." }),
1406
- /* @__PURE__ */ jsx9("p", { className: "mt-1 text-xs", children: 'Click "Scrape" to fetch latest news.' })
1402
+ /* @__PURE__ */ jsx9("p", { className: "cnfy-trending-hint", children: 'Click "Scrape" to fetch latest news.' })
1407
1403
  ] });
1408
1404
  }
1409
1405
  return /* @__PURE__ */ jsx9(
@@ -1503,8 +1499,8 @@ function SourceSelector({
1503
1499
  const selectedOption = options.find(
1504
1500
  (opt) => selectedSource === null ? opt.value === ALL_SOURCES_VALUE : opt.value === selectedSource
1505
1501
  ) || options[0];
1506
- return /* @__PURE__ */ jsxs9("div", { className: "px-3 py-2 border-b border-gray-100 flex items-center gap-2", children: [
1507
- /* @__PURE__ */ jsx10("div", { className: "flex-1 min-w-[180px]", children: /* @__PURE__ */ jsx10(
1502
+ return /* @__PURE__ */ jsxs9("div", { className: "cnfy-source-selector", children: [
1503
+ /* @__PURE__ */ jsx10("div", { className: "cnfy-source-selector-select-wrap", children: /* @__PURE__ */ jsx10(
1508
1504
  Select2,
1509
1505
  {
1510
1506
  options,
@@ -1549,10 +1545,10 @@ function SourceSelector({
1549
1545
  {
1550
1546
  onClick: handleScrape,
1551
1547
  disabled: scraping,
1552
- className: "flex items-center gap-1.5 px-3 py-2 bg-emerald-600 text-white rounded-lg text-sm font-medium hover:bg-emerald-700 transition disabled:opacity-50",
1548
+ className: "cnfy-scrape-btn",
1553
1549
  title: "Fetch latest news",
1554
1550
  children: [
1555
- /* @__PURE__ */ jsx10(RefreshCcw3, { size: 14, className: scraping ? "animate-spin" : "" }),
1551
+ /* @__PURE__ */ jsx10(RefreshCcw3, { size: 14, className: scraping ? "cnfy-animate-spin" : "" }),
1556
1552
  scraping ? "Scraping..." : "Scrape"
1557
1553
  ]
1558
1554
  }
@@ -1562,9 +1558,9 @@ function SourceSelector({
1562
1558
  {
1563
1559
  onClick: () => fetchNews(null),
1564
1560
  disabled: fetchingNews,
1565
- className: "flex items-center gap-1 px-3 py-2 text-sm text-gray-600 hover:text-gray-900 border border-gray-200 rounded-lg transition",
1561
+ className: "cnfy-refresh-btn",
1566
1562
  children: [
1567
- /* @__PURE__ */ jsx10(RefreshCcw3, { size: 14, className: fetchingNews ? "animate-spin" : "" }),
1563
+ /* @__PURE__ */ jsx10(RefreshCcw3, { size: 14, className: fetchingNews ? "cnfy-animate-spin" : "" }),
1568
1564
  "Refresh"
1569
1565
  ]
1570
1566
  }
@@ -1862,7 +1858,7 @@ ${title}`
1862
1858
  const lang = ((_a = preferences == null ? void 0 : preferences.localization) == null ? void 0 : _a.language) === "hi" ? "Hindi" : "English";
1863
1859
  try {
1864
1860
  await rewriteNewsStreamApi({
1865
- article: content,
1861
+ article: content || "",
1866
1862
  language: lang,
1867
1863
  articleId: id,
1868
1864
  tone: contentPrefs == null ? void 0 : contentPrefs.tone,
@@ -1907,7 +1903,7 @@ ${title}`
1907
1903
  )
1908
1904
  );
1909
1905
  const result = await rewriteNewsApi({
1910
- article: content,
1906
+ article: content || "",
1911
1907
  language: lang,
1912
1908
  articleId: id,
1913
1909
  tone: contentPrefs == null ? void 0 : contentPrefs.tone,
@@ -2099,83 +2095,77 @@ ${optionsList}`
2099
2095
  }
2100
2096
  };
2101
2097
  if (loading) {
2102
- return /* @__PURE__ */ jsx11("div", { className: "w-full h-screen flex items-center justify-center bg-white", children: /* @__PURE__ */ jsxs10("div", { className: "flex flex-col items-center gap-3", children: [
2103
- /* @__PURE__ */ jsx11(Loader2, { className: "h-8 w-8 animate-spin text-gray-400" }),
2104
- /* @__PURE__ */ jsx11("p", { className: "text-sm text-gray-500", children: "Loading..." })
2098
+ return /* @__PURE__ */ jsx11("div", { className: "cnfy-loading", children: /* @__PURE__ */ jsxs10("div", { className: "cnfy-loading-inner", children: [
2099
+ /* @__PURE__ */ jsx11(Loader2, { className: "cnfy-loading-spinner cnfy-animate-spin" }),
2100
+ /* @__PURE__ */ jsx11("p", { className: "cnfy-loading-text", children: "Loading..." })
2105
2101
  ] }) });
2106
2102
  }
2107
- return (
2108
- // FULL SCREEN
2109
- /* @__PURE__ */ jsxs10("div", { className: "w-full h-screen flex flex-col bg-white", children: [
2110
- /* @__PURE__ */ jsx11(HeaderBar, { onNavigate, onLogout }),
2111
- /* @__PURE__ */ jsxs10("div", { className: `flex-1 min-h-0 md:grid ${showNewsPanel ? "md:grid-cols-12" : ""}`, children: [
2112
- showNewsPanel && /* @__PURE__ */ jsxs10("aside", { className: "relative col-span-4 bg-gray-50/60 border-r border-gray-300 h-[90vh] overflow-y-auto", children: [
2113
- /* @__PURE__ */ jsx11("div", { className: "", children: /* @__PURE__ */ jsx11(
2114
- SourceSelector,
2115
- {
2116
- selectedSource,
2117
- onSourceChange: (value) => {
2118
- console.log("Selected source:", value);
2119
- setSelectedSource(value);
2120
- },
2121
- onNewsLoaded: handleNewsLoaded,
2122
- onLoadingChange: handleLoadingChange
2123
- }
2124
- ) }),
2125
- /* @__PURE__ */ jsx11(
2126
- TrendingNews,
2127
- {
2128
- onRecreate: handleRecreate,
2129
- news,
2130
- isLoading: newsLoading
2131
- }
2132
- )
2133
- ] }),
2134
- /* @__PURE__ */ jsxs10(
2135
- "section",
2103
+ return /* @__PURE__ */ jsxs10("div", { className: "cnfy-root", children: [
2104
+ /* @__PURE__ */ jsx11(HeaderBar, { onNavigate, onLogout }),
2105
+ /* @__PURE__ */ jsxs10("div", { className: `cnfy-main ${showNewsPanel ? "cnfy-main--with-news" : ""}`, children: [
2106
+ showNewsPanel && /* @__PURE__ */ jsxs10("aside", { className: "cnfy-sidebar", children: [
2107
+ /* @__PURE__ */ jsx11("div", { children: /* @__PURE__ */ jsx11(
2108
+ SourceSelector,
2136
2109
  {
2137
- className: `
2138
- ${showNewsPanel ? "md:col-span-8" : "w-full"} bg-white flex flex-col h-full relative
2139
- ${showChatMobile ? "block" : "hidden md:block"}
2140
- `,
2141
- children: [
2142
- /* @__PURE__ */ jsx11("div", { className: "md:hidden border-b border-gray-300 p-3", children: /* @__PURE__ */ jsx11(
2143
- "button",
2144
- {
2145
- onClick: () => setShowChatMobile(false),
2146
- className: "text-sm text-gray-600",
2147
- children: "\u2190 Back to news"
2148
- }
2149
- ) }),
2150
- /* @__PURE__ */ jsx11("div", { className: "flex-1 min-h-0", children: /* @__PURE__ */ jsx11(
2151
- ChatWindow,
2152
- {
2153
- messages,
2154
- onSend: handleSendMessage,
2155
- onSelectNews: handleRecreate,
2156
- isStreaming,
2157
- analyzedData,
2158
- onSelectAction: handleSelectAction
2159
- }
2160
- ) }),
2161
- !messages.length && /* @__PURE__ */ jsx11("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center text-center text-gray-400 text-sm px-4", children: /* @__PURE__ */ jsxs10("div", { children: [
2162
- /* @__PURE__ */ jsx11("p", { className: "font-medium", children: "AI News Assistant" }),
2163
- /* @__PURE__ */ jsx11("p", { className: "mt-1", children: "Select a news article or type a message to begin" })
2164
- ] }) })
2165
- ]
2110
+ selectedSource,
2111
+ onSourceChange: (value) => {
2112
+ console.log("Selected source:", value);
2113
+ setSelectedSource(value);
2114
+ },
2115
+ onNewsLoaded: handleNewsLoaded,
2116
+ onLoadingChange: handleLoadingChange
2117
+ }
2118
+ ) }),
2119
+ /* @__PURE__ */ jsx11(
2120
+ TrendingNews,
2121
+ {
2122
+ onRecreate: handleRecreate,
2123
+ news,
2124
+ isLoading: newsLoading
2166
2125
  }
2167
2126
  )
2168
2127
  ] }),
2169
- selectedArticle && /* @__PURE__ */ jsx11(
2170
- ArticleModal,
2128
+ /* @__PURE__ */ jsxs10(
2129
+ "section",
2171
2130
  {
2172
- article: selectedArticle,
2173
- onClose: () => setSelectedArticle(null),
2174
- onRecreate: handleRecreate
2131
+ className: `cnfy-chat-section ${showNewsPanel ? "cnfy-chat-section--with-news" : "cnfy-chat-section--full"} ${showChatMobile ? "cnfy-chat-section--visible" : "cnfy-chat-section--hidden-mobile"}`,
2132
+ children: [
2133
+ /* @__PURE__ */ jsx11("div", { className: "cnfy-mobile-back", children: /* @__PURE__ */ jsx11(
2134
+ "button",
2135
+ {
2136
+ onClick: () => setShowChatMobile(false),
2137
+ className: "cnfy-mobile-back-btn",
2138
+ children: "\u2190 Back to news"
2139
+ }
2140
+ ) }),
2141
+ /* @__PURE__ */ jsx11("div", { className: "cnfy-chat-inner", children: /* @__PURE__ */ jsx11(
2142
+ ChatWindow,
2143
+ {
2144
+ messages,
2145
+ onSend: handleSendMessage,
2146
+ onSelectNews: handleRecreate,
2147
+ isStreaming,
2148
+ analyzedData,
2149
+ onSelectAction: handleSelectAction
2150
+ }
2151
+ ) }),
2152
+ !messages.length && /* @__PURE__ */ jsx11("div", { className: "cnfy-empty-state", children: /* @__PURE__ */ jsxs10("div", { children: [
2153
+ /* @__PURE__ */ jsx11("p", { className: "cnfy-empty-state-title", children: "AI News Assistant" }),
2154
+ /* @__PURE__ */ jsx11("p", { className: "cnfy-empty-state-subtitle", children: "Select a news article or type a message to begin" })
2155
+ ] }) })
2156
+ ]
2175
2157
  }
2176
2158
  )
2177
- ] })
2178
- );
2159
+ ] }),
2160
+ selectedArticle && /* @__PURE__ */ jsx11(
2161
+ ArticleModal,
2162
+ {
2163
+ article: selectedArticle,
2164
+ onClose: () => setSelectedArticle(null),
2165
+ onRecreate: handleRecreate
2166
+ }
2167
+ )
2168
+ ] });
2179
2169
  }
2180
2170
 
2181
2171
  // src/index.tsx