-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnewtab.html
More file actions
1250 lines (1197 loc) · 65.3 KB
/
newtab.html
File metadata and controls
1250 lines (1197 loc) · 65.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>New Tab Note</title>
<link rel="stylesheet" href="css/editor.css">
<link rel="stylesheet" href="css/premium-chat.css">
<link rel="stylesheet" href="css/stats.css">
</head>
<body>
<a href="#editor-container" class="skip-to-content" id="skip-to-content">Skip to content</a>
<div id="app">
<!-- Sidebar -->
<aside id="sidebar" class="sidebar">
<div class="sidebar-header">
<div id="sidebar-toggle-container" class="sidebar-toggle-container"></div>
<div class="sidebar-tabs" role="tablist" aria-label="Sidebar navigation">
<button id="sidebar-tab-notes" class="sidebar-tab active" role="tab" aria-selected="true" aria-controls="sidebar-notes-list">Notes <span id="notes-count" class="sidebar-tab-badge hidden">0</span></button>
<button id="sidebar-tab-templates" class="sidebar-tab" role="tab" aria-selected="false">Templates</button>
<button id="sidebar-tab-archive" class="sidebar-tab" role="tab" aria-selected="false">Archive <span id="archive-count" class="sidebar-tab-badge hidden">0</span></button>
<button id="sidebar-tab-trash" class="sidebar-tab" role="tab" aria-selected="false">Trash <span id="trash-count" class="sidebar-tab-badge hidden">0</span></button>
</div>
</div>
<div class="sidebar-search">
<svg class="sidebar-search-icon" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor"
stroke-width="2">
<circle cx="11" cy="11" r="8"></circle>
<line x1="21" y1="21" x2="16.65" y2="16.65"></line>
</svg>
<input type="text" id="sidebar-search" placeholder="Search notes..." />
<select id="sidebar-sort" class="sidebar-sort-select" aria-label="Sort notes">
<option value="updated">Recent</option>
<option value="created">Created</option>
<option value="alphabetical">A-Z</option>
</select>
<div class="sidebar-view-toggle">
<button id="sidebar-view-list" class="sidebar-view-btn active" title="List View" aria-label="List View">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<line x1="9" y1="6" x2="20" y2="6"></line>
<line x1="9" y1="12" x2="20" y2="12"></line>
<line x1="9" y1="18" x2="20" y2="18"></line>
<circle cx="5" cy="6" r="1.5" fill="currentColor"></circle>
<circle cx="5" cy="12" r="1.5" fill="currentColor"></circle>
<circle cx="5" cy="18" r="1.5" fill="currentColor"></circle>
</svg>
</button>
<button id="sidebar-view-cards" class="sidebar-view-btn" title="Cards View" aria-label="Cards View">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<rect x="3" y="3" width="7" height="7" rx="1"></rect>
<rect x="14" y="3" width="7" height="7" rx="1"></rect>
<rect x="14" y="14" width="7" height="7" rx="1"></rect>
<rect x="3" y="14" width="7" height="7" rx="1"></rect>
</svg>
</button>
</div>
</div>
<div class="sidebar-note-actions">
<button id="sidebar-new-note" class="sidebar-action-btn primary" title="New Note" aria-label="Create New Note">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<line x1="12" y1="5" x2="12" y2="19"></line>
<line x1="5" y1="12" x2="19" y2="12"></line>
</svg>
</button>
<button id="sidebar-daily-note" class="sidebar-action-btn" title="Today's Daily Note" aria-label="Today's Daily Note">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<rect x="3" y="4" width="18" height="18" rx="2" ry="2"></rect>
<line x1="16" y1="2" x2="16" y2="6"></line>
<line x1="8" y1="2" x2="8" y2="6"></line>
<line x1="3" y1="10" x2="21" y2="10"></line>
</svg>
</button>
<button id="sidebar-new-folder" class="sidebar-action-btn" title="New Folder" aria-label="New Folder">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"></path>
<line x1="12" y1="11" x2="12" y2="17"></line>
<line x1="9" y1="14" x2="15" y2="14"></line>
</svg>
</button>
<button id="sidebar-import-note" class="sidebar-action-btn" title="Import Note" aria-label="Import Note">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path>
<polyline points="17 8 12 3 7 8"></polyline>
<line x1="12" y1="3" x2="12" y2="15"></line>
</svg>
</button>
</div>
<div id="sidebar-calendar" class="sidebar-calendar">
<div class="calendar-header">
<button id="calendar-prev" class="calendar-nav" title="Previous month" aria-label="Previous month">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<polyline points="15 18 9 12 15 6"></polyline>
</svg>
</button>
<span id="calendar-month-label" class="calendar-month-label"></span>
<button id="calendar-next" class="calendar-nav" title="Next month" aria-label="Next month">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<polyline points="9 18 15 12 9 6"></polyline>
</svg>
</button>
<button id="calendar-today" class="calendar-nav calendar-today-btn" title="Go to today" aria-label="Go to today">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<circle cx="12" cy="12" r="3"></circle>
</svg>
</button>
</div>
<div class="calendar-grid">
<div class="calendar-weekdays">
<span>Su</span><span>Mo</span><span>Tu</span><span>We</span><span>Th</span><span>Fr</span><span>Sa</span>
</div>
<div id="calendar-days" class="calendar-days"></div>
</div>
</div>
<div id="sidebar-notes-list" class="sidebar-notes-list"></div>
<!-- Bulk Actions Bar -->
<div id="sidebar-bulk-actions" class="sidebar-bulk-actions">
<div class="bulk-actions-count">0 selected</div>
<div class="bulk-actions-btns">
<button id="bulk-archive-btn" class="secondary-btn-small" title="Archive Selected">Archive</button>
<button id="bulk-delete-btn" class="secondary-btn-small danger" title="Move Selected to Trash">Trash</button>
<button id="bulk-cancel-btn" class="secondary-btn-small">Cancel</button>
</div>
</div>
<div id="sidebar-trash-actions" class="sidebar-trash-actions hidden">
<button id="empty-trash-btn" class="danger-btn-small">Empty Trash</button>
</div>
<div class="sidebar-footer">
<button id="sidebar-stats" class="sidebar-footer-btn" title="Analytics & Stats" aria-label="Analytics & Stats">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<line x1="18" y1="20" x2="18" y2="10"></line>
<line x1="12" y1="20" x2="12" y2="4"></line>
<line x1="6" y1="20" x2="6" y2="14"></line>
</svg>
</button>
<button id="sidebar-graph" class="sidebar-footer-btn" title="Graph View" aria-label="Graph View">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<circle cx="6" cy="6" r="3"></circle>
<circle cx="18" cy="6" r="3"></circle>
<circle cx="6" cy="18" r="3"></circle>
<circle cx="18" cy="18" r="3"></circle>
<line x1="8.5" y1="7.5" x2="15.5" y2="16.5"></line>
<line x1="15.5" y1="7.5" x2="8.5" y2="16.5"></line>
</svg>
</button>
<button id="shortcuts-btn" class="sidebar-footer-btn" title="Keyboard Shortcuts (?)" aria-label="Open Keyboard Shortcuts helper">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<circle cx="12" cy="12" r="10"></circle>
<path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"></path>
<line x1="12" y1="17" x2="12.01" y2="17"></line>
</svg>
</button>
</div>
<div id="sidebar-resize-handle" class="sidebar-resize-handle"></div>
</aside>
<!-- Note Context Menu -->
<div id="note-context-menu" class="context-menu hidden" role="menu" aria-label="Note actions">
<button id="ctx-select-note" class="context-menu-item" role="menuitem">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect>
<polyline points="9 11 12 14 22 4"></polyline>
</svg>
Select
</button>
<button id="ctx-pin-note" class="context-menu-item" role="menuitem">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M12 17v5"></path>
<path d="M5 3h14l-3 7v4l-4-2-4 2v-4z"></path>
</svg>
Pin Note
</button>
<button id="ctx-open-note" class="context-menu-item" role="menuitem">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"></path>
<polyline points="15 3 21 3 21 9"></polyline>
<line x1="10" y1="14" x2="21" y2="3"></line>
</svg>
Open in New Tab
</button>
<button id="ctx-generate-title" class="context-menu-item" role="menuitem">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path
d="M12 2a2 2 0 0 1 2 2c0 .74-.4 1.39-1 1.73V7h1a7 7 0 0 1 7 7h1a1 1 0 0 1 1 1v3a1 1 0 0 1-1 1h-1v1a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-1H2a1 1 0 0 1-1-1v-3a1 1 0 0 1 1-1h1a7 7 0 0 1 7-7h1V5.73c-.6-.34-1-.99-1-1.73a2 2 0 0 1 2-2z">
</path>
<line x1="8" y1="14" x2="16" y2="14"></line>
</svg>
Generate Title
</button>
<button id="ctx-export-note" class="context-menu-item" role="menuitem">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path>
<polyline points="7 10 12 15 17 10"></polyline>
<line x1="12" y1="15" x2="12" y2="3"></line>
</svg>
Export Note
</button>
<button id="ctx-extract-insights" class="context-menu-item" role="menuitem">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path
d="M12 2a2 2 0 0 1 2 2c0 .74-.4 1.39-1 1.73V7h1a7 7 0 0 1 7 7h1a1 1 0 0 1 1 1v3a1 1 0 0 1-1 1h-1v1a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-1H2a1 1 0 0 1-1-1v-3a1 1 0 0 1 1-1h1a7 7 0 0 1 7-7h1V5.73c-.6-.34-1-.99-1-1.73a2 2 0 0 1 2-2z">
</path>
<circle cx="8" cy="14" r="1"></circle>
<circle cx="16" cy="14" r="1"></circle>
</svg>
Extract Insights
</button>
<button id="ctx-archive-note" class="context-menu-item" role="menuitem">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<polyline points="21 8 21 21 3 21 3 8"></polyline>
<rect x="1" y="3" width="22" height="5"></rect>
<line x1="10" y1="12" x2="14" y2="12"></line>
</svg>
Archive
</button>
<button id="ctx-convert-template" class="context-menu-item" role="menuitem">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"></path>
<polyline points="14 2 14 8 20 8"></polyline>
</svg>
Convert to Template
</button>
<button id="ctx-back-to-note" class="context-menu-item hidden" role="menuitem">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"></path>
<polyline points="14 2 14 8 20 8"></polyline>
</svg>
Back to Note
</button>
<button id="ctx-unarchive-note" class="context-menu-item hidden" role="menuitem">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<polyline points="1 4 1 10 7 10"></polyline>
<path d="M3.51 15a9 9 0 1 0 2.13-9.36L1 10"></path>
</svg>
Restore from Archive
</button>
<button id="ctx-restore-note" class="context-menu-item hidden" role="menuitem">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<polyline points="1 4 1 10 7 10"></polyline>
<path d="M3.51 15a9 9 0 1 0 2.13-9.36L1 10"></path>
</svg>
Restore from Trash
</button>
<div class="context-menu-divider"></div>
<button id="ctx-delete-note" class="context-menu-item danger" role="menuitem">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<polyline points="3 6 5 6 21 6"></polyline>
<path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"></path>
</svg>
Move to Trash
</button>
<button id="ctx-delete-permanent" class="context-menu-item danger hidden" role="menuitem">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<polyline points="3 6 5 6 21 6"></polyline>
<path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"></path>
<line x1="10" y1="11" x2="10" y2="17"></line>
<line x1="14" y1="11" x2="14" y2="17"></line>
</svg>
Delete Permanently
</button>
</div>
<!-- Main Content -->
<div class="main-content">
<!-- Header -->
<header id="header">
<div class="header-left">
<button id="sidebar-toggle" class="icon-btn sidebar-toggle-btn active" title="Toggle Sidebar" aria-label="Toggle Sidebar">
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect>
<line x1="9" y1="3" x2="9" y2="21"></line>
</svg>
</button>
<button id="split-view-toggle" class="icon-btn" title="Toggle Split View" aria-label="Toggle Split View">
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect>
<line x1="12" y1="3" x2="12" y2="21"></line>
</svg>
</button>
<button id="pip-toggle" class="icon-btn" title="Pop out note" aria-label="Pop out note">
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"></path>
<polyline points="14 3 21 3 21 10"></polyline>
<line x1="10" y1="14" x2="21" y2="3"></line>
</svg>
</button>
</div>
<!-- Note Tabs -->
<div id="note-tabs" class="note-tabs">
<!-- Tabs populated dynamically -->
</div>
<div class="header-center">
<button id="new-tab-btn" class="icon-btn" title="New Tab" aria-label="New Tab">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<line x1="12" y1="5" x2="12" y2="19"></line>
<line x1="5" y1="12" x2="19" y2="12"></line>
</svg>
</button>
</div>
<div class="header-right">
<span id="save-status" class="save-status" aria-live="polite">Saved</span>
<span id="sync-status-indicator" class="sync-status-indicator hidden" aria-live="polite" title="Sync status">
<span class="sync-status-icon idle"></span>
<span class="sync-status-text">Not synced</span>
</span>
<button id="version-history-btn" class="icon-btn" title="Version History" aria-label="Version History">
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<circle cx="12" cy="12" r="10"></circle>
<polyline points="12 6 12 12 16 14"></polyline>
</svg>
</button>
<div id="width-selector-header" class="width-selector-header">
<button class="width-option" data-width="narrow" title="Narrow (540px)">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<rect x="6" y="4" width="12" height="16" rx="1"></rect>
</svg>
</button>
<button class="width-option" data-width="default" title="Default (720px)">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<rect x="4" y="4" width="16" height="16" rx="1"></rect>
</svg>
</button>
<button class="width-option" data-width="wide" title="Wide (900px)">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<rect x="2" y="5" width="20" height="14" rx="1"></rect>
</svg>
</button>
<button class="width-option" data-width="full" title="Full Width">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<rect x="1" y="6" width="22" height="12" rx="1"></rect>
</svg>
</button>
</div>
<button id="focus-mode-btn" class="icon-btn" title="Focus Mode (Ctrl+Shift+F11)" aria-label="Toggle Focus Mode">
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<circle cx="12" cy="12" r="10"></circle>
<circle cx="12" cy="12" r="4"></circle>
</svg>
</button>
<button id="settings-btn" class="icon-btn" title="Settings" aria-label="Settings">
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<circle cx="12" cy="12" r="3"></circle>
<path
d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z">
</path>
</svg>
</button>
</div>
</header>
<!-- Empty State (shown when no notes exist) -->
<div id="empty-state" class="empty-state hidden">
<div class="empty-state-icon">
<svg width="80" height="80" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5">
<path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"></path>
<polyline points="14 2 14 8 20 8"></polyline>
<line x1="16" y1="13" x2="8" y2="13"></line>
<line x1="16" y1="17" x2="8" y2="17"></line>
<polyline points="10 9 9 9 8 9"></polyline>
</svg>
</div>
<h2 class="empty-state-title">No notes yet</h2>
<p class="empty-state-text">Create your first note to get started</p>
<button id="empty-state-create-btn" class="primary-btn">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<line x1="12" y1="5" x2="12" y2="19"></line>
<line x1="5" y1="12" x2="19" y2="12"></line>
</svg>
Create Note
</button>
</div>
<!-- Main Workspace -->
<main id="workspace-container">
<!-- Left Editor Pane -->
<div id="editor-container" class="editor-pane active">
<div id="editor" class="editor">
<div id="page-title" class="page-title" contenteditable="true" data-placeholder="Untitled"
spellcheck="false"></div>
<div id="page-timestamp" class="page-timestamp"></div>
<div id="blocks-container" class="blocks-container"></div>
<div id="add-block-hint" class="add-block-hint">
<span>Press Enter to add a new block, or type / for commands</span>
</div>
<div id="backlinks-panel" class="backlinks-panel hidden">
<div class="backlinks-header">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path>
<path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path>
</svg>
<span>Backlinks</span>
</div>
<div id="backlinks-list" class="backlinks-list"></div>
</div>
<!-- Editor-specific floating menus -->
<div id="slash-menu" class="slash-menu hidden">
<div class="slash-menu-header">Basic blocks</div>
<div class="slash-menu-items"></div>
</div>
<div id="wiki-menu" class="slash-menu hidden">
<div class="slash-menu-header">Link to note</div>
<div class="slash-menu-items"></div>
</div>
<div id="template-menu" class="slash-menu hidden">
<div class="slash-menu-header">Insert template</div>
<div class="slash-menu-items"></div>
</div>
</div>
</div>
<!-- Right Editor Pane (initially hidden) -->
<div id="secondary-editor-container" class="editor-pane secondary hidden">
<div class="editor">
<div class="page-title" contenteditable="true" data-placeholder="Untitled" spellcheck="false"></div>
<div class="page-timestamp"></div>
<div class="blocks-container"></div>
<div class="add-block-hint">
<span>Press Enter to add a new block, or type / for commands</span>
</div>
<div class="backlinks-panel hidden">
<div class="backlinks-header">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path>
<path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path>
</svg>
<span>Backlinks</span>
</div>
<div class="backlinks-list"></div>
</div>
<div class="slash-menu hidden">
<div class="slash-menu-header">Basic blocks</div>
<div class="slash-menu-items"></div>
</div>
<div class="wiki-menu slash-menu hidden">
<div class="slash-menu-header">Link to note</div>
<div class="slash-menu-items"></div>
</div>
<div class="template-menu slash-menu hidden">
<div class="slash-menu-header">Insert template</div>
<div class="slash-menu-items"></div>
</div>
</div>
</div>
</main>
<!-- Stats Dashboard -->
<div id="stats-dashboard" class="stats-container hidden">
<div class="stats-header">
<h1>Analytics & Insights</h1>
<button id="stats-close-btn" class="stats-back-btn" aria-label="Back to Editor">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<line x1="19" y1="12" x2="5" y2="12"></line>
<polyline points="12 19 5 12 12 5"></polyline>
</svg>
Back to Editor
</button>
</div>
<div class="stats-overview">
<div class="stat-card">
<span class="label">Total Notes</span>
<span id="stat-total-notes" class="value">0</span>
</div>
<div class="stat-card">
<span class="label">Daily Notes</span>
<span id="stat-daily-notes" class="value">0</span>
</div>
<div class="stat-card">
<span class="label">Total Words</span>
<span id="stat-total-words" class="value">0</span>
</div>
<div class="stat-card">
<span class="label">Active Tags</span>
<span id="stat-active-tags" class="value">0</span>
</div>
</div>
<div class="charts-grid">
<div class="chart-wrapper">
<h3>Activity (Last 30 Days)</h3>
<div class="chart-container">
<canvas id="activity-chart"></canvas>
</div>
</div>
<div class="chart-wrapper">
<h3>Content Breakdown</h3>
<div class="chart-container">
<canvas id="content-chart"></canvas>
</div>
</div>
<div class="chart-wrapper">
<h3>Top Tags</h3>
<div class="chart-container">
<canvas id="tags-chart"></canvas>
</div>
</div>
<div class="chart-wrapper">
<h3>Notes by Folder</h3>
<div class="chart-container">
<canvas id="folders-chart"></canvas>
</div>
</div>
</div>
</div>
<!-- Graph View Panel -->
<div id="graph-view-panel" class="stats-container hidden">
<div class="stats-header">
<h1>Graph View</h1>
<button id="graph-close-btn" class="stats-back-btn" aria-label="Back to Editor">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<line x1="19" y1="12" x2="5" y2="12"></line>
<polyline points="12 19 5 12 12 5"></polyline>
</svg>
Back to Editor
</button>
</div>
<div class="graph-canvas-container">
<canvas id="graph-canvas"></canvas>
</div>
</div>
</div>
<!-- AI Chat Sidebar -->
<aside id="ai-sidebar" class="ai-sidebar hidden">
<div id="ai-sidebar-resize-handle" class="ai-sidebar-resize-handle"></div>
<div class="ai-sidebar-header">
<span class="ai-sidebar-title">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path
d="M12 2a2 2 0 0 1 2 2c0 .74-.4 1.39-1 1.73V7h1a7 7 0 0 1 7 7h1a1 1 0 0 1 1 1v3a1 1 0 0 1-1 1h-1v1a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-1H2a1 1 0 0 1-1-1v-3a1 1 0 0 1 1-1h1a7 7 0 0 1 7-7h1V5.73c-.6-.34-1-.99-1-1.73a2 2 0 0 1 2-2z">
</path>
<circle cx="7.5" cy="14.5" r="1.5"></circle>
<circle cx="16.5" cy="14.5" r="1.5"></circle>
</svg>
AI Chat
</span>
<button id="ai-sidebar-close" class="icon-btn" title="Close AI Chat" aria-label="Close AI Chat">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<line x1="18" y1="6" x2="6" y2="18"></line>
<line x1="6" y1="6" x2="18" y2="18"></line>
</svg>
</button>
</div>
<!-- Chat Mode Tabs -->
<div class="ai-chat-tabs" role="tablist" aria-label="AI chat modes">
<button id="ai-tab-note" class="ai-chat-tab active" role="tab" aria-selected="true" aria-controls="ai-panel-note" title="Chat about current note">This Note</button>
<button id="ai-tab-all" class="ai-chat-tab" role="tab" aria-selected="false" aria-controls="ai-panel-all" title="Search across all notes">All Notes</button>
<button id="ai-tab-smart" class="ai-chat-tab" role="tab" aria-selected="false" aria-controls="ai-panel-smart" title="Proactive insights and related notes">Insights</button>
</div>
<!-- Note Chat Panel -->
<div id="ai-panel-note" class="ai-chat-panel active" role="tabpanel" aria-labelledby="ai-tab-note">
<div id="ai-sticky-suggestions" class="ai-sticky-suggestions hidden">
<div id="ai-sticky-template-buttons" class="ai-sticky-template-buttons"></div>
<button class="ai-sticky-btn ai-extract-insights-btn" data-action="extract-insights" title="Extract insights"
aria-label="Extract insights">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path
d="M12 2a2 2 0 0 1 2 2c0 .74-.4 1.39-1 1.73V7h1a7 7 0 0 1 7 7h1a1 1 0 0 1 1 1v3a1 1 0 0 1-1 1h-1v1a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-1H2a1 1 0 0 1-1-1v-3a1 1 0 0 1 1-1h1a7 7 0 0 1 7-7h1V5.73c-.6-.34-1-.99-1-1.73a2 2 0 0 1 2-2z">
</path>
</svg>
</button>
</div>
<div id="ai-chat-messages" class="ai-chat-messages" aria-live="polite">
<div class="ai-chat-welcome">
<p>Chat with AI about your current note. Ask questions, request summaries, expand content, and more.</p>
<div class="ai-chat-suggestions">
<div id="ai-note-suggestion-buttons" class="ai-template-suggestion-list"></div>
<button class="ai-suggestion-btn ai-extract-insights-btn" data-action="extract-insights">Extract
insights</button>
</div>
</div>
</div>
<div id="ai-chat-loading" class="ai-chat-loading hidden">
<div class="ai-loading-spinner"></div>
<span>Thinking...</span>
</div>
<div class="ai-chat-input-area">
<textarea id="ai-chat-input" placeholder="Ask anything about your note..." rows="1"></textarea>
<button id="ai-chat-clear" class="ai-chat-clear-btn" title="Clear chat" aria-label="Clear chat">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<polyline points="3 6 5 6 21 6"></polyline>
<path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"></path>
</svg>
</button>
<button id="ai-chat-send" class="ai-chat-send-btn" title="Send" aria-label="Send message">
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<line x1="22" y1="2" x2="11" y2="13"></line>
<polygon points="22 2 15 22 11 13 2 9 22 2"></polygon>
</svg>
</button>
</div>
</div>
<!-- All Notes Chat Panel -->
<div id="ai-panel-all" class="ai-chat-panel" role="tabpanel" aria-labelledby="ai-tab-all">
<div id="global-chat-messages" class="ai-chat-messages" aria-live="polite">
<div class="ai-chat-welcome global-chat-welcome">
<p>Search across all your notes. AI will find relevant notes and answer based on their content.</p>
<div class="ai-chat-suggestions">
<div id="ai-global-suggestion-buttons"
class="ai-template-suggestion-list ai-template-suggestion-list-inline"></div>
</div>
</div>
</div>
<div id="global-chat-loading" class="ai-chat-loading hidden">
<div class="ai-loading-spinner"></div>
<span id="global-chat-loading-text">Searching notes...</span>
</div>
<div class="ai-chat-input-area">
<textarea id="global-chat-input" placeholder="Ask anything across all your notes..." rows="1"></textarea>
<button id="global-chat-clear" class="ai-chat-clear-btn" title="Clear chat" aria-label="Clear chat">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<polyline points="3 6 5 6 21 6"></polyline>
<path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"></path>
</svg>
</button>
<button id="global-chat-send" class="ai-chat-send-btn" title="Send" aria-label="Send message">
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<line x1="22" y1="2" x2="11" y2="13"></line>
<polygon points="22 2 15 22 11 13 2 9 22 2"></polygon>
</svg>
</button>
</div>
</div>
<!-- Smart Insights Panel -->
<div id="ai-panel-smart" class="ai-chat-panel" role="tabpanel" aria-labelledby="ai-tab-smart">
<div class="ai-smart-content">
<div id="ai-smart-empty" class="ai-smart-empty">
<p>Start writing to see smart suggestions, related notes, and extracted tasks.</p>
</div>
<div id="ai-smart-results" class="ai-smart-results hidden">
<!-- Suggested Tags -->
<div class="ai-smart-section">
<div class="ai-smart-section-header">
<span>Suggested Tags</span>
</div>
<div id="ai-suggested-tags" class="ai-tag-list"></div>
</div>
<!-- Action Items -->
<div class="ai-smart-section">
<div class="ai-smart-section-header">
<span>Action Items</span>
</div>
<div id="ai-extracted-actions" class="ai-action-list"></div>
</div>
<!-- Related Notes -->
<div class="ai-smart-section">
<div class="ai-smart-section-header">
<span>Related Notes</span>
</div>
<div id="ai-related-notes" class="ai-related-list"></div>
</div>
</div>
</div>
<div id="ai-smart-loading" class="ai-chat-loading hidden">
<div class="ai-loading-spinner"></div>
<span>Analyzing note...</span>
</div>
</div>
<div id="ai-not-configured-sidebar" class="ai-not-configured-sidebar hidden">
<p>AI not configured</p>
<button id="ai-sidebar-open-settings" class="secondary-btn">Open Settings</button>
</div>
</aside>
<!-- Floating AI Chat Button -->
<button id="ai-floating-btn" class="ai-floating-btn" title="AI Chat" aria-label="Open AI Chat">
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path
d="M12 2a2 2 0 0 1 2 2c0 .74-.4 1.39-1 1.73V7h1a7 7 0 0 1 7 7h1a1 1 0 0 1 1 1v3a1 1 0 0 1-1 1h-1v1a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-1H2a1 1 0 0 1-1-1v-3a1 1 0 0 1 1-1h1a7 7 0 0 1 7-7h1V5.73c-.6-.34-1-.99-1-1.73a2 2 0 0 1 2-2z">
</path>
<circle cx="7.5" cy="14.5" r="1.5"></circle>
<circle cx="16.5" cy="14.5" r="1.5"></circle>
</svg>
</button>
<!-- Settings Modal -->
<div id="settings-modal" class="modal hidden">
<div class="modal-content settings-modal-content" role="dialog" aria-modal="true" aria-label="Settings">
<div class="modal-header">
<h2>Settings</h2>
<div class="settings-search-wrapper">
<svg class="settings-search-icon" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<circle cx="11" cy="11" r="8"></circle>
<line x1="21" y1="21" x2="16.65" y2="16.65"></line>
</svg>
<input type="text" id="settings-search" placeholder="Search settings..." />
</div>
<button class="close-btn">×</button>
</div>
<div class="settings-layout">
<!-- Settings Sidebar Navigation -->
<nav id="settings-nav" class="settings-nav" aria-label="Settings categories">
<button class="settings-nav-item active" data-category="general">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="3"></circle><path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83-2.83l.06-.06A1.65 1.65 0 0 0 4.6 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 2.83-2.83l.06.06A1.65 1.65 0 0 0 9 4.6a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"></path></svg>
General
</button>
<button class="settings-nav-item" data-category="appearance">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="10"></circle><path d="M12 2a7 7 0 0 0 0 20 4 4 0 0 1 0-8 4 4 0 0 0 0-8"></path></svg>
Appearance
</button>
<button class="settings-nav-item" data-category="editor">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"></path><path d="M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"></path></svg>
Editor
</button>
<button class="settings-nav-item" data-category="ai">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M12 2a2 2 0 0 1 2 2c0 .74-.4 1.39-1 1.73V7h1a7 7 0 0 1 7 7h1a1 1 0 0 1 1 1v3a1 1 0 0 1-1 1h-1v1a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-1H2a1 1 0 0 1-1-1v-3a1 1 0 0 1 1-1h1a7 7 0 0 1 7-7h1V5.73c-.6-.34-1-.99-1-1.73a2 2 0 0 1 2-2z"></path><circle cx="8" cy="14" r="1"></circle><circle cx="16" cy="14" r="1"></circle></svg>
AI Configuration
</button>
<button class="settings-nav-item" data-category="data">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path><polyline points="7 10 12 15 17 10"></polyline><line x1="12" y1="15" x2="12" y2="3"></line></svg>
Data & Backup
</button>
<button class="settings-nav-item" data-category="advanced">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="16 18 22 12 16 6"></polyline><polyline points="8 6 2 12 8 18"></polyline></svg>
Advanced
</button>
</nav>
<!-- Settings Content Area -->
<div class="settings-content">
<div id="settings-no-results" class="settings-no-results hidden">
<p>No settings match your search.</p>
</div>
<!-- General Category -->
<div class="settings-category active" data-category="general">
<div class="settings-section" data-setting-label="daily note template" data-setting-desc="template for new daily notes">
<h3>Daily Notes</h3>
<div class="setting-row">
<label>Daily Note Template</label>
<select id="daily-note-template-select">
<option value="">No template</option>
</select>
</div>
<p class="setting-hint">New daily notes will automatically be initialized with this template.</p>
</div>
</div>
<!-- Appearance Category -->
<div class="settings-category" data-category="appearance">
<div class="settings-section" data-setting-label="theme" data-setting-desc="color scheme light dark system custom">
<h3>Theme</h3>
<div class="setting-row">
<label>Theme</label>
<div class="theme-select-wrapper">
<select id="theme-select">
<option value="light">Light</option>
<option value="dark">Dark</option>
<option value="system">System</option>
</select>
<button id="open-theme-builder-btn" class="secondary-btn-small">Builder</button>
</div>
</div>
<div id="theme-preview" class="theme-preview">
<div class="theme-preview-sidebar">
<div class="theme-preview-bar"></div>
<div class="theme-preview-bar short"></div>
<div class="theme-preview-bar"></div>
</div>
<div class="theme-preview-editor">
<div class="theme-preview-title"></div>
<div class="theme-preview-line"></div>
<div class="theme-preview-line short"></div>
<div class="theme-preview-line"></div>
</div>
</div>
</div>
<div class="settings-section" data-setting-label="font" data-setting-desc="typeface serif monospace system default">
<h3>Font</h3>
<div class="setting-row">
<label>Font</label>
<select id="font-select">
<option value="default">System Default</option>
<option value="serif">Serif</option>
<option value="mono">Monospace</option>
</select>
</div>
</div>
</div>
<!-- Editor Category -->
<div class="settings-category" data-category="editor">
<div class="settings-section" data-setting-label="editor width" data-setting-desc="narrow default wide full width">
<h3>Editor Width</h3>
<div class="setting-row">
<label>Editor Width</label>
<select id="width-select">
<option value="narrow">Narrow (540px)</option>
<option value="default">Default (720px)</option>
<option value="wide">Wide (900px)</option>
<option value="full">Full Width</option>
</select>
</div>
</div>
</div>
<!-- AI Configuration Category -->
<div class="settings-category" data-category="ai">
<div class="settings-section" data-setting-label="ai provider model api key" data-setting-desc="openai anthropic gemini ollama llm chat">
<h3>AI Chat (LLM)</h3>
<div class="setting-row">
<label>Provider</label>
<select id="llm-provider-select">
<option value="none">None (Disabled)</option>
<optgroup label="Major Providers">
<option value="openai">OpenAI</option>
<option value="anthropic">Anthropic</option>
<option value="gemini">Google Gemini</option>
<option value="xai">xAI (Grok)</option>
</optgroup>
<optgroup label="Open Source / Budget">
<option value="deepseek">Deepseek</option>
<option value="mistral">Mistral AI</option>
<option value="groq">Groq</option>
</optgroup>
<optgroup label="Chinese Providers">
<option value="qwen">Qwen (Alibaba)</option>
<option value="glm">GLM (Zhipu)</option>
<option value="kimi">Kimi (Moonshot)</option>
<option value="minimax">MiniMax</option>
</optgroup>
<optgroup label="Aggregators">
<option value="openrouter">OpenRouter</option>
</optgroup>
<optgroup label="Local">
<option value="ollama">Ollama (Local)</option>
</optgroup>
</select>
</div>
<div class="setting-row llm-api-key-row hidden">
<label>API Key</label>
<div class="api-key-input-group">
<input type="password" id="llm-api-key" placeholder="Enter API key..." />
<button type="button" class="icon-btn api-key-toggle-btn" title="Show API key" aria-label="Toggle API key visibility">
<svg class="eye-icon" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"></path>
<circle cx="12" cy="12" r="3"></circle>
</svg>
<svg class="eye-off-icon hidden" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94"></path>
<path d="M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19"></path>
<line x1="1" y1="1" x2="23" y2="23"></line>
</svg>
</button>
<button type="button" class="icon-btn api-key-clear-btn" title="Clear API key" aria-label="Clear API key">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<polyline points="3 6 5 6 21 6"></polyline>
<path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"></path>
</svg>
</button>
</div>
</div>
<p class="setting-hint api-key-warning llm-api-key-row hidden">
⚠️ API keys are stored in the browser's IndexedDB. They are accessible to this extension but are not encrypted at rest. Avoid using keys with broad permissions.
</p>
<div class="setting-row llm-ollama-url-row hidden">
<label>Ollama URL</label>
<input type="text" id="ollama-url" placeholder="http://localhost:11434" />
</div>
<p class="setting-hint llm-ollama-hint hidden">
<strong>Important:</strong> Start Ollama with CORS enabled:<br>
<code>OLLAMA_ORIGINS=chrome-extension://* ollama serve</code>
</p>
<div class="setting-row llm-model-row hidden">
<label>Model</label>
<div class="model-select-wrapper">
<select id="llm-model-select"></select>
<button id="refresh-models-btn" class="icon-btn refresh-btn" title="Refresh models">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<polyline points="23 4 23 10 17 10"></polyline>
<polyline points="1 20 1 14 7 14"></polyline>
<path d="M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15"></path>
</svg>
</button>
</div>
</div>
</div>
<div class="settings-section" data-setting-label="auto title generate" data-setting-desc="automatically generate note titles">
<h3>Auto Title</h3>
<div class="setting-row llm-auto-title-row hidden">
<label>Auto-generate titles</label>
<div class="toggle-switch-wrapper">
<label class="toggle-switch">
<input type="checkbox" id="auto-title-enabled">
<span class="toggle-slider"></span>
</label>
</div>
</div>
<div class="setting-row llm-auto-title-interval-row hidden">
<label>Auto-title interval</label>
<select id="auto-title-interval">
<option value="5">Every 5 minutes</option>
<option value="15">Every 15 minutes</option>
<option value="30">Every 30 minutes</option>
<option value="60">Every hour</option>
<option value="1440">Every day</option>
<option value="7200">Every 5 days</option>
<option value="10080">Every week</option>
<option value="20160">Every 2 weeks</option>
<option value="43200">Every month</option>
</select>
</div>
<p class="setting-hint llm-auto-title-hint hidden">
Automatically generates titles for "Untitled" notes when content changes.
</p>
</div>
<div class="settings-section" data-setting-label="insights extraction" data-setting-desc="extract action items reminders deadlines">
<h3>Insights</h3>
<div class="setting-row llm-insights-row hidden">
<label>Extract insights</label>
<div class="toggle-switch-wrapper">
<label class="toggle-switch">
<input type="checkbox" id="insights-enabled">
<span class="toggle-slider"></span>
</label>
</div>
</div>
<div class="setting-row llm-insights-interval-row hidden">
<label>Extraction interval</label>
<select id="insights-interval">
<option value="60">Every hour</option>
<option value="360">Every 6 hours</option>
<option value="720">Every 12 hours</option>
<option value="1440">Every day</option>
<option value="10080">Every week</option>
</select>
</div>
<p class="setting-hint llm-insights-hint hidden">
Periodically extracts action items, reminders, deadlines, and key points from your notes.
</p>
</div>
<div class="settings-section" data-setting-label="ai prompt templates" data-setting-desc="custom prompt suggestion chips">
<h3>Prompt Templates</h3>
<div class="ai-prompt-templates-settings">
<div class="ai-prompt-templates-header">
<h4>AI Prompt Templates</h4>
<div class="ai-prompt-templates-toolbar">
<button id="ai-template-add-btn" class="secondary-btn-small" type="button">Add</button>
<button id="ai-template-reset-btn" class="secondary-btn-small" type="button">Reset defaults</button>
</div>
</div>
<p class="setting-hint">Customize the note-chat and all-notes suggestion chips.</p>
<div id="ai-prompt-template-list" class="ai-prompt-template-list"></div>
<div id="ai-prompt-template-empty" class="ai-prompt-template-empty hidden">
No prompt templates yet. Add one or restore the defaults.
</div>
<form id="ai-prompt-template-form" class="ai-prompt-template-form hidden">
<input type="hidden" id="ai-prompt-template-edit-id">
<div class="setting-row">
<label for="ai-prompt-template-label">Label</label>
<input type="text" id="ai-prompt-template-label" placeholder="Summarize note" maxlength="40">
</div>
<div class="setting-row">
<label for="ai-prompt-template-scope">Show in</label>
<select id="ai-prompt-template-scope">
<option value="note">This Note</option>
<option value="global">All Notes</option>
<option value="both">Both</option>
</select>
</div>
<div class="setting-row">
<label for="ai-prompt-template-behavior">Action</label>
<select id="ai-prompt-template-behavior">
<option value="send">Send immediately</option>
<option value="prefill">Insert into input</option>
</select>
</div>
<div class="setting-row ai-prompt-template-textarea-row">
<label for="ai-prompt-template-prompt">Prompt</label>
<textarea id="ai-prompt-template-prompt" rows="3" maxlength="1000"
placeholder="Summarize the main ideas from this note"></textarea>
</div>
<div class="ai-prompt-template-form-actions">
<button id="ai-template-cancel-btn" class="secondary-btn" type="button">Cancel</button>