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