-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathpopup.html
More file actions
926 lines (876 loc) · 59 KB
/
popup.html
File metadata and controls
926 lines (876 loc) · 59 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>ThinkReview</title>
<link rel="stylesheet" href="popup.css">
<link rel="stylesheet" href="components/utils/new-badge.css">
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500&display=swap" rel="stylesheet">
</head>
<body>
<div id="popup-container">
<div id="user-data-loading-overlay" hidden aria-live="polite" aria-busy="false"></div>
<header class="app-header">
<div class="header-top-row">
<div class="title-with-logo">
<img src="images/icon48.png" alt="ThinkReview Logo" class="header-logo">
<div class="header-title-block">
<h2>ThinkReview</h2>
<p class="header-subtitle">AI code reviews for your PRs</p>
</div>
</div>
</div>
<div class="header-bottom-row">
<div class="header-auth-section">
<google-signin></google-signin>
<div id="portal-buttons-row" class="portal-buttons-row" style="display: none;">
<button id="dashboard-btn" class="portal-button" aria-label="Open Dashboard" title="Dashboard">
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<rect x="3" y="3" width="7" height="7"></rect><rect x="14" y="3" width="7" height="7"></rect>
<rect x="14" y="14" width="7" height="7"></rect><rect x="3" y="14" width="7" height="7"></rect>
</svg>
<span>Dashboard</span>
</button>
<button id="agents-btn" class="portal-button" aria-label="Open Agents" title="Agents">
<svg width="18" height="18" viewBox="0 0 24 24" fill="currentColor">
<path d="M8.4 18.2c.38.5.6 1.12.6 1.8 0 1.66-1.34 3-3 3s-3-1.34-3-3 1.34-3 3-3c.44 0 .85.09 1.23.26l1.41-1.77c-.92-1.03-1.29-2.39-1.09-3.69l-2.03-.68c-.54.83-1.46 1.38-2.52 1.38-1.66 0-3-1.34-3-3s1.34-3 3-3 3 1.34 3 3c0 .07 0 .14-.01.21l2.03.68c.64-1.21 1.82-2.09 3.22-2.32V5.91C9.96 5.57 9 4.4 9 3c0-1.66 1.34-3 3-3s3 1.34 3 3c0 1.4-.96 2.57-2.25 2.91v2.16c1.4.23 2.58 1.11 3.22 2.32L18 9.71V9.5c0-1.66 1.34-3 3-3s3 1.34 3 3-1.34 3-3 3c-1.06 0-1.98-.55-2.52-1.37l-2.03.68c.2 1.29-.16 2.65-1.09 3.69l1.41 1.77Q17.34 17 18 17c1.66 0 3 1.34 3 3s-1.34 3-3 3-3-1.34-3-3c0-.68.22-1.3.6-1.8l-1.41-1.77c-1.35.75-3.01.76-4.37 0z"/>
</svg>
<span>Agents</span>
<span class="thinkreview-new-badge">New</span>
</button>
<button id="usage-btn" class="portal-button" aria-label="View my usage" title="View my usage">
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
<path d="M21.21 15.89A10 10 0 1 1 8 2.83"></path>
<path d="M22 12A10 10 0 0 0 12 2v10z"></path>
</svg>
<span>Usage</span>
<span class="thinkreview-new-badge">New</span>
</button>
<button id="analytics-btn" class="portal-button" aria-label="Open Analytics" title="Analytics">
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M3 3v18h18"></path><rect x="5" y="8" width="3" height="10"></rect>
<rect x="10" y="5" width="3" height="13"></rect><rect x="15" y="11" width="3" height="7"></rect>
</svg>
<span>Analytics</span>
</button>
<button id="model-selection-btn" class="portal-button" aria-label="Open Model Selection" title="Model Selection">
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<circle cx="12" cy="12" r="3"></circle><path d="M12 1v6m0 6v6m11-7h-6m-6 0H1"></path>
</svg>
<span>Model Selection</span>
</button>
<button id="scoring-metrics-btn" class="portal-button" aria-label="Open Custom Rules" title="Custom Rules">
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"></path>
</svg>
<span>Custom Rules</span>
</button>
<button id="signout-btn" class="portal-button signout-portal-button" aria-label="Sign out" title="Sign out">
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"></path>
<polyline points="16 17 21 12 16 7"></polyline><line x1="21" y1="12" x2="9" y2="12"></line>
</svg>
<span>Sign out</span>
</button>
</div>
</div>
<p id="session-expired-notice" class="session-expired-notice" style="display: none;">
Your session has expired. Please sign in again.
</p>
<p id="login-prompt" class="login-prompt" style="display: none;">Please login to continue</p>
<div id="privacy-policy-text" class="privacy-policy-text" style="display: none;">
<div class="privacy-policy-icon">🔒</div>
<p class="privacy-policy-content">
By signing up you agree to our <a href="https://thinkreview.dev/privacy-policy" target="_blank" rel="noopener noreferrer" class="privacy-policy-link">Privacy Policy</a>
</p>
</div>
</div>
</header>
<!-- Welcome Section for Non-Logged-In Users -->
<div id="welcome-content" class="welcome-content" style="display: none;">
<div class="welcome-hero">
<div class="welcome-title">
<h2>AI-Powered Code Reviews</h2>
<div class="gemini-badge">Powered by Frontier Models & Ollama</div>
</div>
<p class="welcome-subtitle">Transform your GitLab, GitHub, Bitbucket and Azure DevOps PR workflow with intelligent AI code analysis</p>
</div>
<div class="feature-preview-grid">
<div class="feature-preview-card">
<div class="feature-icon ai-powered">
<svg class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20"><path d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"></path></svg>
</div>
<h3>Works straight out of the box</h3>
<p>No repo admin access or CI integration required.</p>
</div>
<div class="feature-preview-card">
<div class="feature-icon ai-powered">
<svg class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20"><path fill-rule="evenodd" d="M18 10c0 3.866-3.582 7-8 7a8.841 8.841 0 01-4.083-.98L2 17l1.338-3.123C2.493 12.767 2 11.434 2 10c0-3.866 3.582-7 8-7s8 3.134 8 7zM7 9H5v2h2V9zm8 0h-2v2h2V9zM9 9h2v2H9V9z" clip-rule="evenodd"></path></svg>
</div>
<h3>Chat with your PRs</h3>
<p>Ask questions and get answers about your pull request changes</p>
</div>
<div class="feature-preview-card">
<div class="feature-icon ai-powered">
<svg class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20"><path fill-rule="evenodd" d="M5 9V7a5 5 0 0110 0v2a2 2 0 012 2v5a2 2 0 01-2 2H5a2 2 0 01-2-2v-5a2 2 0 012-2zm8-2v2H7V7a3 3 0 016 0z" clip-rule="evenodd"></path></svg>
</div>
<h3>Privacy Protected</h3>
<p>We never store your code or your tokens on our servers. <a href="https://thinkreview.dev/privacy-faqs.html" target="_blank" rel="noopener noreferrer" class="privacy-notice-link">Check Privacy FAQs</a></p>
</div>
<div class="feature-preview-card">
<div class="feature-icon ai-powered">
<svg class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20"><path d="M3 4a1 1 0 011-1h12a1 1 0 011 1v2a1 1 0 01-1 1H4a1 1 0 01-1-1V4zM3 10a1 1 0 011-1h6a1 1 0 011 1v6a1 1 0 01-1 1H4a1 1 0 01-1-1v-4h10zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v2H9z"></path></svg>
</div>
<h3>15+ frontier LLM models</h3>
<p>Choose from a wide range of leading AI models for your reviews</p>
</div>
<div class="feature-preview-card">
<div class="feature-icon ai-powered">
<svg class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20"><path d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"></path></svg>
</div>
<h3>Instant AI Reviews</h3>
<p>Get comprehensive code reviews in seconds</p>
</div>
<div class="feature-preview-card">
<div class="feature-icon ai-powered">
<svg class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20"><path d="M3 4a1 1 0 011-1h12a1 1 0 011 1v2a1 1 0 01-1 1H4a1 1 0 01-1-1V4zM3 10a1 1 0 011-1h6a1 1 0 011 1v6a1 1 0 01-1 1H4a1 1 0 01-1-1v-6zM14 9a1 1 0 00-1 1v6a1 1 0 001 1h2a1 1 0 001-1v-6a1 1 0 00-1-1h-2z"></path></svg>
</div>
<h3>GitLab, GitHub, Bitbucket & Azure DevOps</h3>
<p>Seamlessly integrated into your workflow</p>
</div>
<div class="feature-preview-card">
<div class="feature-icon ai-powered">
<svg class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20"><path fill-rule="evenodd" d="M3 4a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zm0 4a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zm0 4a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zm0 4a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1z" clip-rule="evenodd"></path></svg>
</div>
<h3>Custom review rules</h3>
<p>Select and apply custom rules to tailor how your code is reviewed</p>
</div>
<div class="feature-preview-card">
<div class="feature-icon ai-powered">
<svg class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20"><path fill-rule="evenodd" d="M12.316 3.051a1 1 0 01.633 1.265l-4 12a1 1 0 11-1.898-.632l4-12a1 1 0 011.265-.633zM5.707 6.293a1 1 0 010 1.414L3.414 10l2.293 2.293a1 1 0 11-1.414 1.414l-3-3a1 1 0 010-1.414l3-3a1 1 0 011.414 0zm8.586 0a1 1 0 011.414 0l3 3a1 1 0 010 1.414l-3 3a1 1 0 11-1.414-1.414L16.586 10l-2.293-2.293a1 1 0 010-1.414z" clip-rule="evenodd"></path></svg>
</div>
<h3>Open source</h3>
<p>Audit the code and contribute on <a href="https://github.com/Thinkode/thinkreview-browser-extension" target="_blank" rel="noopener noreferrer" class="privacy-notice-link">GitHub</a></p>
</div>
</div>
</div>
<!-- Authenticated Content -->
<div id="authenticated-content">
<div id="current-status">Loading...</div>
<div id="review-count-section" class="review-count-section">
<div class="review-count-label">Total AI Reviews Generated:</div>
<div id="review-count" class="review-count">-</div>
</div>
<!-- Subscription Status Section -->
<div id="subscription-status-section" class="subscription-status-section">
<div class="subscription-status-label">Current Plan:</div>
<div id="subscription-status" class="subscription-status">Free Plan</div>
<div id="next-payment-info" class="next-payment-info" style="display: none;">
<div class="next-payment-container">
<div class="next-payment-label">Valid To:</div>
<div id="next-payment-date" class="next-payment-date">-</div>
</div>
</div>
<div id="cancel-subscription-container" class="cancel-subscription-container">
<button id="cancel-subscription-btn" class="cancel-subscription-btn">Manage Subscription</button>
</div>
<div id="trial-expired-message" class="trial-expired-message" style="display: none;">
Your free trial has expired. Upgrade to continue enjoying Professional features.
</div>
</div>
<!-- ===================== PLATFORM HOME ===================== -->
<div id="platform-home">
<!-- Platform Cards -->
<div class="platform-section-header">
<h3 class="settings-title">Platform Setup</h3>
<p class="settings-description">Select your Git platform to configure and see how to get started</p>
</div>
<div class="platform-cards-grid">
<!-- GitHub.com -->
<button class="platform-card" id="card-github-com" data-platform="github" data-scroll-target="">
<div class="platform-card-icon">
<svg width="28" height="28" viewBox="0 0 24 24" fill="currentColor">
<path d="M12 0C5.374 0 0 5.373 0 12c0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576C20.566 21.797 24 17.3 24 12c0-6.627-5.373-12-12-12z"/>
</svg>
</div>
<div class="platform-card-info">
<span class="platform-card-name">GitHub.com</span>
<span class="platform-badge platform-badge-ready" id="badge-github-com">✓ Ready</span>
</div>
</button>
<!-- GitHub Enterprise Server -->
<button class="platform-card" id="card-github-enterprise" data-platform="github" data-scroll-target="github-enterprise-subsection">
<div class="platform-card-icon">
<svg width="28" height="28" viewBox="0 0 24 24" fill="currentColor">
<path d="M12 0C5.374 0 0 5.373 0 12c0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576C20.566 21.797 24 17.3 24 12c0-6.627-5.373-12-12-12z"/>
</svg>
</div>
<div class="platform-card-info">
<span class="platform-card-name">GitHub Enterprise Server</span>
<span class="platform-badge platform-badge-setup" id="badge-github-enterprise">⚙ Setup needed</span>
</div>
</button>
<!-- GitLab.com -->
<button class="platform-card" id="card-gitlab-com" data-platform="gitlab" data-scroll-target="">
<div class="platform-card-icon platform-card-icon--gitlab">
<svg width="28" height="28" viewBox="0 0 24 24" fill="currentColor">
<path d="M23.955 13.587l-1.342-4.135-2.664-8.189a.455.455 0 00-.867 0L16.418 9.45H7.582L4.918 1.263a.455.455 0 00-.867 0L1.386 9.45.044 13.587a.924.924 0 00.331 1.023L12 23.054l11.625-8.443a.92.92 0 00.33-1.024"/>
</svg>
</div>
<div class="platform-card-info">
<span class="platform-card-name">GitLab.com</span>
<span class="platform-badge platform-badge-ready" id="badge-gitlab-com">✓ Ready</span>
</div>
</button>
<!-- GitLab Self-Managed -->
<button class="platform-card" id="card-gitlab-self-managed" data-platform="gitlab" data-scroll-target="gitlab-self-managed-subsection">
<div class="platform-card-icon platform-card-icon--gitlab">
<svg width="28" height="28" viewBox="0 0 24 24" fill="currentColor">
<path d="M23.955 13.587l-1.342-4.135-2.664-8.189a.455.455 0 00-.867 0L16.418 9.45H7.582L4.918 1.263a.455.455 0 00-.867 0L1.386 9.45.044 13.587a.924.924 0 00.331 1.023L12 23.054l11.625-8.443a.92.92 0 00.33-1.024"/>
</svg>
</div>
<div class="platform-card-info">
<span class="platform-card-name">GitLab Self-Managed</span>
<span class="platform-badge platform-badge-setup" id="badge-gitlab-self-managed">⚙ Setup needed</span>
</div>
</button>
<!-- Azure DevOps Cloud -->
<button class="platform-card" id="card-azure-cloud" data-platform="azure" data-scroll-target="">
<div class="platform-card-icon platform-card-icon--azure">
<svg width="28" height="28" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true">
<path d="M0 8.877L2.247 5.91l8.405-3.416V.022l7.37 5.393L2.966 8.338v8.225L0 15.707zm24-4.45v14.651l-5.753 4.9-9.303-3.057v3.056l-5.978-7.416 15.057 1.798V5.415z"/>
</svg>
</div>
<div class="platform-card-info">
<span class="platform-card-name">Azure DevOps Cloud</span>
<span class="platform-card-subtitle">dev.azure.com or *.visualstudio.com</span>
<span class="platform-badge platform-badge-setup" id="badge-azure-cloud">⚙ Setup needed</span>
</div>
</button>
<!-- Azure DevOps Server -->
<button class="platform-card" id="card-azure-server" data-platform="azure" data-scroll-target="azure-server-subsection">
<div class="platform-card-icon platform-card-icon--azure">
<svg width="28" height="28" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true">
<path d="M0 8.877L2.247 5.91l8.405-3.416V.022l7.37 5.393L2.966 8.338v8.225L0 15.707zm24-4.45v14.651l-5.753 4.9-9.303-3.057v3.056l-5.978-7.416 15.057 1.798V5.415z"/>
</svg>
</div>
<div class="platform-card-info">
<span class="platform-card-name">Azure DevOps Server</span>
<span class="platform-badge platform-badge-setup" id="badge-azure-server">⚙ Setup needed</span>
</div>
</button>
<!-- Bitbucket Cloud -->
<button class="platform-card" id="card-bitbucket" data-platform="bitbucket" data-scroll-target="">
<div class="platform-card-icon platform-card-icon--bitbucket">
<svg width="28" height="28" viewBox="0 0 24 24" fill="currentColor">
<path d="M.778 1.213a.768.768 0 00-.768.892l3.263 19.81c.084.5.515.868 1.022.873H19.95a.772.772 0 00.77-.646l3.27-20.03a.768.768 0 00-.768-.891L.778 1.213zM14.52 15.53H9.522L8.17 8.466h7.561l-1.211 7.064z"/>
</svg>
</div>
<div class="platform-card-info">
<span class="platform-card-name">Bitbucket Cloud</span>
<span class="platform-badge platform-badge-setup" id="badge-bitbucket">⚙ Setup needed</span>
</div>
</button>
<!-- Bitbucket Data Center (self-hosted) -->
<button class="platform-card" id="card-bitbucket-dc" data-platform="bitbucket-dc" data-scroll-target="">
<div class="platform-card-icon platform-card-icon--bitbucket">
<svg width="28" height="28" viewBox="0 0 24 24" fill="currentColor">
<path d="M.778 1.213a.768.768 0 00-.768.892l3.263 19.81c.084.5.515.868 1.022.873H19.95a.772.772 0 00.77-.646l3.27-20.03a.768.768 0 00-.768-.891L.778 1.213zM14.52 15.53H9.522L8.17 8.466h7.561l-1.211 7.064z"/>
</svg>
</div>
<div class="platform-card-info">
<span class="platform-card-name">Bitbucket Data Center</span>
<span class="platform-badge platform-badge-setup" id="badge-bitbucket-dc">⚙ Setup needed</span>
</div>
</button>
</div>
<!-- AI Provider Settings (collapsed by default) -->
<div id="ai-provider-settings" class="ai-provider-settings-section">
<button class="collapsible-header" id="ai-provider-toggle" aria-expanded="true">
<h3 class="settings-title">AI Provider</h3>
<svg class="collapsible-chevron" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<polyline points="6 9 12 15 18 9"></polyline>
</svg>
</button>
<div id="ai-provider-body" class="collapsible-body" style="display:block;">
<div class="provider-cards">
<!-- ThinkReview Cloud Card -->
<label class="provider-card" id="provider-card-cloud">
<input type="radio" name="ai-provider" value="cloud" id="provider-cloud" checked class="provider-card-radio">
<div class="provider-card-inner">
<div class="provider-card-top">
<div class="provider-card-icon provider-card-icon--cloud">
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M18 10h-1.26A8 8 0 1 0 9 20h9a5 5 0 0 0 0-10z"></path>
</svg>
</div>
<div class="provider-card-title-group">
<span class="provider-card-name">ThinkReview Cloud</span>
<span class="provider-card-badge provider-card-badge--cloud">Recommended</span>
</div>
<div class="provider-card-check-icon">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round">
<polyline points="20 6 9 17 4 12"></polyline>
</svg>
</div>
</div>
<p class="provider-card-desc">Experience the most powerful code review features: flagship models, repo context, niche agents, zero code retention.</p>
<div class="provider-card-tags">
<span class="provider-tag provider-tag--cloud">Free Tier Available</span>
<span class="provider-tag provider-tag--cloud">15+ flagship models</span>
<span class="provider-tag provider-tag--cloud">Full Repo Context</span>
<span class="provider-tag provider-tag--cloud">Create Custom Agents</span>
<span class="provider-tag provider-tag--cloud">Custom rules</span>
<span class="provider-tag provider-tag--cloud">35% Cheaper than BYOK</span>
</div>
</div>
</label>
<!-- Ollama Card -->
<label class="provider-card" id="provider-card-ollama">
<input type="radio" name="ai-provider" value="ollama" id="provider-ollama" class="provider-card-radio">
<div class="provider-card-inner">
<div class="provider-card-top">
<div class="provider-card-icon provider-card-icon--ollama">
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<rect x="2" y="3" width="20" height="14" rx="2" ry="2"></rect>
<line x1="8" y1="21" x2="16" y2="21"></line>
<line x1="12" y1="17" x2="12" y2="21"></line>
</svg>
</div>
<div class="provider-card-title-group">
<span class="provider-card-name">Ollama</span>
<span class="provider-card-badge provider-card-badge--ollama">Open Source</span>
</div>
<div class="provider-card-check-icon">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round">
<polyline points="20 6 9 17 4 12"></polyline>
</svg>
</div>
</div>
<p class="provider-card-desc">Run your own LLM locally. Requires Setup.</p>
<div class="provider-card-tags">
<span class="provider-tag provider-tag--ollama">Limited Context to Diffs only</span>
<span class="provider-tag provider-tag--ollama">Runs locally</span>
<span class="provider-tag provider-tag--ollama">No caching</span>
</div>
</div>
</label>
<!-- OpenRouter Card -->
<label class="provider-card" id="provider-card-openrouter">
<input type="radio" name="ai-provider" value="openrouter" id="provider-openrouter" class="provider-card-radio">
<div class="provider-card-inner">
<div class="provider-card-top">
<div class="provider-card-icon provider-card-icon--openrouter">
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
<path d="M4 12h6.5"></path>
<path d="M10.5 12l4-4"></path>
<path d="M10.5 12l4 4"></path>
<path d="M14.5 8h4l-2 2"></path>
<path d="M14.5 16h4l-2-2"></path>
</svg>
</div>
<div class="provider-card-title-group">
<span class="provider-card-name">OpenRouter</span>
<span class="provider-card-badge provider-card-badge--openrouter">Unified LLM Interface</span>
</div>
<div class="provider-card-check-icon">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round">
<polyline points="20 6 9 17 4 12"></polyline>
</svg>
</div>
</div>
<p class="provider-card-desc">Access models from multiple providers with one OpenAI-compatible API key.</p>
<div class="provider-card-tags">
<span class="provider-tag provider-tag--openrouter">Multiple Models</span>
<span class="provider-tag provider-tag--openrouter">Limited Context to Diffs only</span>
<span class="provider-tag provider-tag--openrouter">BYOK</span>
</div>
</div>
</label>
</div>
<div id="ollama-config" class="ollama-config" style="display: none;">
<div class="ollama-config-row">
<label for="ollama-url" class="config-label">Ollama URL:</label>
<input type="text" id="ollama-url" class="config-input" value="http://localhost:11434" placeholder="http://localhost:11434">
</div>
<div class="ollama-config-row">
<label for="ollama-model" class="config-label">Model:</label>
<div class="model-select-wrapper">
<input type="text" id="ollama-model" class="config-input" list="ollama-model-list" placeholder="Loading models...">
<datalist id="ollama-model-list"></datalist>
<button id="refresh-models-btn" class="refresh-models-btn" title="Refresh available models">🔄</button>
</div>
</div>
<div class="ollama-config-row">
<label for="ollama-temperature" class="config-label">Temperature (min 0, max 2):</label>
<input type="number" id="ollama-temperature" class="config-input" min="0" max="2" step="0.1" value="0.3">
</div>
<div class="ollama-config-row">
<label for="ollama-top-p" class="config-label">Top P (min 0, max 1):</label>
<input type="number" id="ollama-top-p" class="config-input" min="0" max="1" step="0.05" value="0.4">
</div>
<div class="ollama-config-row">
<label for="ollama-top-k" class="config-label">Top K (min 1, max 200):</label>
<input type="number" id="ollama-top-k" class="config-input" min="1" max="200" step="1" value="90">
</div>
<div class="ollama-actions">
<button id="test-ollama-btn" class="test-ollama-btn">Test Connection</button>
<button id="save-ollama-btn" class="save-ollama-btn">Save Settings</button>
</div>
<div id="ollama-status" class="ollama-status"></div>
<div class="ollama-help">
<p class="help-text">
<strong>📖 <a href="https://github.com/Thinkode/thinkreview-browser-extension/blob/main/OLLAMA_SETUP.md" target="_blank">Full Setup Guide</a></strong>
— recommended model: <a href="https://ollama.com/library/gemma4" target="_blank">gemma4</a> (<code>ollama pull gemma4</code>)
</p>
</div>
</div>
<div id="openrouter-config" class="openrouter-config" style="display: none;">
<div id="openrouter-allow-section" class="openrouter-allow-section">
<div class="openrouter-allow-button-row">
<button id="allow-openrouter-btn" class="add-domain-btn">Allow OpenRouter</button>
<span id="openrouter-permission-status" class="openrouter-permission-status"></span>
</div>
<p class="help-text openrouter-allow-hint">Grant permission to connect to openrouter.ai for API requests.</p>
</div>
<div id="openrouter-enabled-message" class="github-info" style="display: none;">
<div class="github-info-icon thinkreview-tick-green">✓</div>
<div class="github-info-content">
<p class="github-info-text"><strong>OpenRouter enabled.</strong> You can test your API key and save settings below.</p>
</div>
</div>
<div class="openrouter-config-row">
<label for="openrouter-api-key" class="config-label">OpenRouter API Key:</label>
<input type="password" id="openrouter-api-key" class="config-input" placeholder="sk-or-...">
</div>
<div class="openrouter-config-row">
<label for="openrouter-model" class="config-label">Model:</label>
<div class="model-select-wrapper">
<input type="text" id="openrouter-model" class="config-input" list="openrouter-model-list" placeholder="Loading models...">
<datalist id="openrouter-model-list"></datalist>
<button id="refresh-openrouter-models-btn" class="refresh-models-btn" title="Refresh available models">🔄</button>
</div>
</div>
<div class="ollama-actions">
<button id="test-openrouter-btn" class="test-ollama-btn">Test Connection</button>
<button id="save-openrouter-btn" class="save-ollama-btn">Save Settings</button>
</div>
<div id="openrouter-status" class="openrouter-status"></div>
<div class="openrouter-help">
<p class="help-text">
<strong>📖 <a href="https://openrouter.ai/docs" target="_blank">OpenRouter Docs</a></strong>
— use any OpenRouter model id such as <code>openai/gpt-5.3</code> or <code>anthropic/claude-sonnet-4.6</code>
</p>
</div>
</div>
<!-- Auto-start review: hidden (manual-only / no UI toggle) -->
<div id="auto-start-review-section" class="auto-start-review-row" hidden>
<span class="auto-start-label">Start review automatically</span>
<div class="auto-start-options">
<div class="auto-start-option">
<label><input type="radio" name="auto-start-review" value="on" id="auto-start-review-on"><span> On</span></label>
<span class="auto-start-info-icon" data-tooltip="Review starts automatically when you open a PR/MR page." aria-label="Info">ⓘ</span>
</div>
<div class="auto-start-option">
<label><input type="radio" name="auto-start-review" value="off" id="auto-start-review-off" checked><span> Off</span></label>
<span class="auto-start-info-icon" data-tooltip="Review only starts when you click the ThinkReview button." aria-label="Info">ⓘ</span>
</div>
</div>
</div>
</div>
</div>
</div><!-- /platform-home -->
<!-- ===================== PLATFORM DETAIL VIEWS ===================== -->
<!-- ---- GITHUB ---- -->
<div id="platform-view-github" class="platform-view" style="display:none;">
<button class="platform-back-btn" data-back>
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="15 18 9 12 15 6"></polyline></svg>
All Platforms
</button>
<div class="platform-view-header">
<div class="platform-view-icon">
<svg width="24" height="24" viewBox="0 0 24 24" fill="currentColor"><path d="M12 0C5.374 0 0 5.373 0 12c0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576C20.566 21.797 24 17.3 24 12c0-6.627-5.373-12-12-12z"/></svg>
</div>
<h3>GitHub</h3>
</div>
<!-- github.com wizard -->
<div class="wizard-card wizard-card--ready">
<div class="wizard-ready-badge">✓ Works out of the box</div>
<p class="wizard-ready-desc">No setup needed for <strong>github.com</strong></p>
<div class="wizard-steps">
<div class="wizard-step" style="--step-delay:0s">
<div class="wizard-step-num">1</div>
<span>Navigate to any pull request on <strong>github.com</strong></span>
</div>
<div class="wizard-step" style="--step-delay:0.15s">
<div class="wizard-step-num">2</div>
<span>ThinkReview button appears automatically</span>
</div>
<div class="wizard-step" style="--step-delay:0.3s">
<div class="wizard-step-num">3</div>
<span>Click it to get an instant AI code review</span>
</div>
</div>
</div>
<!-- GHES section -->
<div class="platform-subsection" id="github-enterprise-subsection">
<h4 class="subsection-title">GitHub Enterprise Server (GHES)</h4>
<p class="settings-description">Self-hosted GitHub? Add your enterprise domain so the extension can activate on your instance.</p>
<div class="wizard-steps wizard-steps--compact">
<div class="wizard-step wizard-step--compact" style="--step-delay:0s">
<div class="wizard-step-num">1</div>
<span>Enter your enterprise domain below (e.g. <code>github.mycompany.com</code>)</span>
</div>
<div class="wizard-step wizard-step--compact" style="--step-delay:0.15s">
<div class="wizard-step-num">2</div>
<span>Navigate to any pull request on your GHES instance</span>
</div>
<div class="wizard-step wizard-step--compact" style="--step-delay:0.3s">
<div class="wizard-step-num">3</div>
<span>ThinkReview activates automatically</span>
</div>
</div>
<div class="domain-input-section">
<input type="text" id="github-enterprise-domain-input" placeholder="e.g., github.mycompany.com" class="domain-input">
<button id="add-github-enterprise-domain-btn" class="add-domain-btn">Add</button>
</div>
<div id="github-enterprise-domain-list" class="domain-list"></div>
</div>
<div class="platform-docs-actions">
<a id="not-working-github" href="https://thinkreview.dev/docs/troubleshooting#ai-button-not-visible" target="_blank" rel="noopener noreferrer" class="platform-docs-btn platform-docs-btn--help">
<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">
<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>
Not working?
</a>
<a id="setup-guide-github" href="https://thinkreview.dev/docs/github-enterprise-and-gitlab-self-managed" target="_blank" rel="noopener noreferrer" class="platform-docs-btn platform-docs-btn--guide">
<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">
<path d="M4 19.5A2.5 2.5 0 0 1 6.5 17H20"></path>
<path d="M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2z"></path>
</svg>
GitHub & GHES setup guide
</a>
</div>
</div><!-- /platform-view-github -->
<!-- ---- GITLAB ---- -->
<div id="platform-view-gitlab" class="platform-view" style="display:none;">
<button class="platform-back-btn" data-back>
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="15 18 9 12 15 6"></polyline></svg>
All Platforms
</button>
<div class="platform-view-header">
<div class="platform-view-icon platform-view-icon--gitlab">
<svg width="24" height="24" viewBox="0 0 24 24" fill="currentColor"><path d="M23.955 13.587l-1.342-4.135-2.664-8.189a.455.455 0 00-.867 0L16.418 9.45H7.582L4.918 1.263a.455.455 0 00-.867 0L1.386 9.45.044 13.587a.924.924 0 00.331 1.023L12 23.054l11.625-8.443a.92.92 0 00.33-1.024"/></svg>
</div>
<h3>GitLab</h3>
</div>
<!-- gitlab.com wizard -->
<div class="wizard-card wizard-card--ready">
<div class="wizard-ready-badge">✓ Works out of the box</div>
<p class="wizard-ready-desc">No setup needed for <strong>gitlab.com</strong></p>
<div class="wizard-steps">
<div class="wizard-step" style="--step-delay:0s">
<div class="wizard-step-num">1</div>
<span>Navigate to any merge request on <strong>gitlab.com</strong></span>
</div>
<div class="wizard-step" style="--step-delay:0.15s">
<div class="wizard-step-num">2</div>
<span>ThinkReview button appears automatically</span>
</div>
<div class="wizard-step" style="--step-delay:0.3s">
<div class="wizard-step-num">3</div>
<span>Click it to get an instant AI code review</span>
</div>
</div>
</div>
<!-- Self-managed section -->
<div class="platform-subsection" id="gitlab-self-managed-subsection">
<h4 class="subsection-title">GitLab Self-Managed</h4>
<p class="settings-description">Running your own GitLab instance? Add your domain so the extension can activate on your server.</p>
<div class="wizard-steps wizard-steps--compact">
<div class="wizard-step wizard-step--compact" style="--step-delay:0s">
<div class="wizard-step-num">1</div>
<span>Enter your GitLab domain below (e.g. <code>gitlab.mycompany.com</code>)</span>
</div>
<div class="wizard-step wizard-step--compact" style="--step-delay:0.15s">
<div class="wizard-step-num">2</div>
<span>Navigate to any merge request on your instance</span>
</div>
<div class="wizard-step wizard-step--compact" style="--step-delay:0.3s">
<div class="wizard-step-num">3</div>
<span>ThinkReview activates automatically</span>
</div>
</div>
<div class="domain-input-section">
<input type="text" id="domain-input" placeholder="e.g., gitlab.mycompany.com, localhost:8083" class="domain-input">
<button id="add-domain-btn" class="add-domain-btn">Add</button>
</div>
<div id="domain-list" class="domain-list"></div>
</div>
<div class="platform-docs-actions">
<a id="not-working-gitlab" href="https://thinkreview.dev/docs/troubleshooting#ai-button-not-visible" target="_blank" rel="noopener noreferrer" class="platform-docs-btn platform-docs-btn--help">
<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">
<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>
Not working?
</a>
<a id="setup-guide-gitlab" href="https://thinkreview.dev/docs/gitlab-integration" target="_blank" rel="noopener noreferrer" class="platform-docs-btn platform-docs-btn--guide">
<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">
<path d="M4 19.5A2.5 2.5 0 0 1 6.5 17H20"></path>
<path d="M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2z"></path>
</svg>
GitLab setup guide
</a>
</div>
</div><!-- /platform-view-gitlab -->
<!-- ---- AZURE DEVOPS ---- -->
<div id="platform-view-azure" class="platform-view" style="display:none;">
<button class="platform-back-btn" data-back>
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="15 18 9 12 15 6"></polyline></svg>
All Platforms
</button>
<div class="platform-view-header">
<div class="platform-view-icon platform-view-icon--azure">
<svg width="24" height="24" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M0 8.877L2.247 5.91l8.405-3.416V.022l7.37 5.393L2.966 8.338v8.225L0 15.707zm24-4.45v14.651l-5.753 4.9-9.303-3.057v3.056l-5.978-7.416 15.057 1.798V5.415z"/></svg>
</div>
<h3>Azure DevOps</h3>
</div>
<!-- Cloud wizard -->
<div class="wizard-card wizard-card--ready">
<div class="wizard-ready-badge">Azure DevOps Cloud</div>
<p class="wizard-ready-desc">Requires a Personal Access Token (save below) for <strong>dev.azure.com</strong> and <strong>*.visualstudio.com</strong></p>
<div class="wizard-steps">
<div class="wizard-step" style="--step-delay:0s">
<div class="wizard-step-num">1</div>
<span>Create a PAT in Azure DevOps and save it in the section below</span>
</div>
<div class="wizard-step" style="--step-delay:0.15s">
<div class="wizard-step-num">2</div>
<span>Navigate to any pull request on <strong>dev.azure.com</strong> or <strong>*.visualstudio.com</strong></span>
</div>
<div class="wizard-step" style="--step-delay:0.3s">
<div class="wizard-step-num">3</div>
<span>Click the ThinkReview button to get an AI code review</span>
</div>
</div>
</div>
<!-- Self-hosted section (mandatory PAT) -->
<div class="platform-subsection platform-subsection--required" id="azure-server-subsection">
<div class="subsection-required-badge">Setup required</div>
<h4 class="subsection-title">Azure DevOps Server (Self-Hosted)</h4>
<p class="settings-description">On-premises or self-hosted Azure DevOps? Follow these steps to get started:</p>
<div class="wizard-steps wizard-steps--compact">
<div class="wizard-step wizard-step--compact" style="--step-delay:0s">
<div class="wizard-step-num">1</div>
<span>In Azure DevOps, go to <strong>User Settings → Personal Access Tokens</strong> and create a token with <em>Code (read)</em> scope</span>
</div>
<div class="wizard-step wizard-step--compact" style="--step-delay:0.15s">
<div class="wizard-step-num">2</div>
<span>Paste your PAT in the field below and click <strong>Save Token</strong></span>
</div>
<div class="wizard-step wizard-step--compact" style="--step-delay:0.3s">
<div class="wizard-step-num">3</div>
<span>Enter your custom domain (e.g. <code>devops.mycompany.com</code>) and click <strong>Add</strong></span>
</div>
<div class="wizard-step wizard-step--compact" style="--step-delay:0.45s">
<div class="wizard-step-num">4</div>
<span>Navigate to any pull request on your instance — ThinkReview activates automatically</span>
</div>
</div>
<div class="token-input-section" style="margin-top:12px;">
<input type="password" id="azure-token-input" placeholder="Enter your Azure DevOps Personal Access Token" class="token-input">
<button id="save-token-btn" class="save-token-btn">Save Token</button>
</div>
<div id="token-status" class="token-status"></div>
<div class="domain-input-section" style="margin-top:10px;">
<input type="text" id="azure-domain-input" placeholder="e.g., devops.mycompany.com" class="domain-input">
<button id="add-azure-domain-btn" class="add-domain-btn">Add</button>
</div>
<div id="azure-domain-list" class="domain-list"></div>
</div>
<div class="platform-docs-actions">
<a id="not-working-azure" href="https://thinkreview.dev/docs/troubleshooting#azure-on-premise" target="_blank" rel="noopener noreferrer" class="platform-docs-btn platform-docs-btn--help">
<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">
<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>
Not working?
</a>
<a id="setup-guide-azure" href="https://thinkreview.dev/docs/azure-devops" target="_blank" rel="noopener noreferrer" class="platform-docs-btn platform-docs-btn--guide">
<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">
<path d="M4 19.5A2.5 2.5 0 0 1 6.5 17H20"></path>
<path d="M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2z"></path>
</svg>
Azure DevOps setup guide
</a>
</div>
</div><!-- /platform-view-azure -->
<!-- ---- BITBUCKET ---- -->
<div id="platform-view-bitbucket" class="platform-view" style="display:none;">
<button class="platform-back-btn" data-back>
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="15 18 9 12 15 6"></polyline></svg>
All Platforms
</button>
<div class="platform-view-header">
<div class="platform-view-icon platform-view-icon--bitbucket">
<svg width="24" height="24" viewBox="0 0 24 24" fill="currentColor"><path d="M.778 1.213a.768.768 0 00-.768.892l3.263 19.81c.084.5.515.868 1.022.873H19.95a.772.772 0 00.77-.646l3.27-20.03a.768.768 0 00-.768-.891L.778 1.213zM14.52 15.53H9.522L8.17 8.466h7.561l-1.211 7.064z"/></svg>
</div>
<h3>Bitbucket Cloud</h3>
</div>
<div class="platform-subsection platform-subsection--required">
<div class="subsection-required-badge">Setup required</div>
<p class="settings-description">Bitbucket requires you to grant browser permission and add an app password to enable the extension.</p>
<div class="wizard-steps">
<div class="wizard-step" style="--step-delay:0s">
<div class="wizard-step-num">1</div>
<span>Click <strong>Allow Bitbucket</strong> below to grant browser permission</span>
</div>
<div class="wizard-step" style="--step-delay:0.15s">
<div class="wizard-step-num">2</div>
<span>In Bitbucket, go to <strong>Profile → App passwords</strong> and create one with <em>Read Repository access</em> and <em>Read pull requests</em> permissions</span>
</div>
<div class="wizard-step" style="--step-delay:0.3s">
<div class="wizard-step-num">3</div>
<span>Enter your Atlassian email and app password below, then save</span>
</div>
<div class="wizard-step" style="--step-delay:0.45s">
<div class="wizard-step-num">4</div>
<span>Navigate to any pull request on <strong>bitbucket.org</strong></span>
</div>
</div>
<!-- Allow button -->
<div class="bitbucket-header-row" style="margin-top:14px;">
<div id="bitbucket-allow-section" class="bitbucket-allow-section">
<div class="bitbucket-allow-button-row">
<button id="allow-bitbucket-btn" class="add-domain-btn">Allow Bitbucket</button>
<span id="bitbucket-status" class="bitbucket-status"></span>
</div>
<p class="help-text bitbucket-allow-hint">You must grant permission by pressing the button above before using ThinkReview on Bitbucket.</p>
</div>
</div>
<div id="bitbucket-enabled-message" class="github-info" style="display: none;">
<div class="github-info-icon thinkreview-tick-green">✓</div>
<div class="github-info-content">
<p class="github-info-text"><strong>Bitbucket enabled.</strong> Reload Bitbucket pull request pages to use AI code reviews.</p>
</div>
</div>
<!-- Credentials -->
<div id="bitbucket-token-section" class="token-input-section bitbucket-token-section" style="margin-top:10px;">
<input type="email" id="bitbucket-email-input" placeholder="Atlassian account email" class="token-input bitbucket-email-input">
<input type="password" id="bitbucket-token-input" class="token-input" placeholder="App password or API token" aria-label="Bitbucket API token">
<button id="save-bitbucket-token-btn" class="save-token-btn">Save</button>
</div>
<div id="bitbucket-token-status" class="token-status bitbucket-token-status"></div>
<p class="help-text">For API tokens use your Atlassian account email + token. For app passwords use your Bitbucket username + app password.</p>
</div>
<div class="platform-docs-actions">
<a id="setup-guide-bitbucket" href="https://thinkreview.dev/docs/bitbucket-integration" target="_blank" rel="noopener noreferrer" class="platform-docs-btn platform-docs-btn--guide">
<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">
<path d="M4 19.5A2.5 2.5 0 0 1 6.5 17H20"></path>
<path d="M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2z"></path>
</svg>
Step by Step Bitbucket Setup Guide
</a>
</div>
</div><!-- /platform-view-bitbucket -->
<!-- ---- BITBUCKET DATA CENTER (SELF-HOSTED) ---- -->
<div id="platform-view-bitbucket-dc" class="platform-view" style="display:none;">
<button class="platform-back-btn" data-back>
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="15 18 9 12 15 6"></polyline></svg>
All Platforms
</button>
<div class="platform-view-header">
<div class="platform-view-icon platform-view-icon--bitbucket">
<svg width="24" height="24" viewBox="0 0 24 24" fill="currentColor"><path d="M.778 1.213a.768.768 0 00-.768.892l3.263 19.81c.084.5.515.868 1.022.873H19.95a.772.772 0 00.77-.646l3.27-20.03a.768.768 0 00-.768-.891L.778 1.213zM14.52 15.53H9.522L8.17 8.466h7.561l-1.211 7.064z"/></svg>
</div>
<h3>Bitbucket Data Center</h3>
</div>
<div class="platform-subsection platform-subsection--required">
<div class="subsection-required-badge">Setup required</div>
<p class="settings-description">Connect ThinkReview to your self-hosted Bitbucket Data Center instance.</p>
<div class="wizard-steps wizard-steps--compact">
<div class="wizard-step wizard-step--compact" style="--step-delay:0s">
<div class="wizard-step-num">1</div>
<span>In Bitbucket, go to your <strong>profile → Manage account → HTTP access tokens</strong> and create one with <em>Repository read</em> and <em>Pull request read</em> permissions</span>
</div>
<div class="wizard-step wizard-step--compact" style="--step-delay:0.15s">
<div class="wizard-step-num">2</div>
<span>Paste the token below and click <strong>Save</strong> — no username needed, the token authenticates on its own</span>
</div>
<div class="wizard-step wizard-step--compact" style="--step-delay:0.3s">
<div class="wizard-step-num">3</div>
<span>Enter your instance domain (e.g. <code>bitbucket.mycompany.com</code>) and click <strong>Add</strong> — approve the browser permission prompt</span>
</div>
<div class="wizard-step wizard-step--compact" style="--step-delay:0.45s">
<div class="wizard-step-num">4</div>
<span>Navigate to any pull request on your instance — ThinkReview activates automatically</span>
</div>
</div>
<div class="token-input-section" style="margin-top:12px;">
<input type="password" id="bitbucket-dc-token-input" class="token-input" placeholder="HTTP access token" aria-label="Bitbucket Data Center HTTP access token">
<button id="save-bitbucket-dc-token-btn" class="save-token-btn">Save</button>
</div>
<div id="bitbucket-dc-token-status" class="token-status"></div>
<p class="help-text">Uses Bearer token authentication — works even when Basic Authentication is disabled on the instance.</p>
<div class="domain-input-section" style="margin-top:14px;">
<input type="text" id="bitbucket-dc-domain-input" placeholder="e.g., bitbucket.mycompany.com" class="domain-input">
<button id="add-bitbucket-dc-domain-btn" class="add-domain-btn" disabled>Add</button>
</div>
<div id="bitbucket-dc-domain-list" class="domain-list"></div>
</div>
<div class="platform-docs-actions">
<a id="setup-guide-bitbucket-dc" href="https://thinkreview.dev/docs/bitbucket-data-center" target="_blank" rel="noopener noreferrer" class="platform-docs-btn platform-docs-btn--guide">
<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">
<path d="M4 19.5A2.5 2.5 0 0 1 6.5 17H20"></path>
<path d="M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2z"></path>
</svg>
Bitbucket Data Center Setup Guide
</a>
</div>
</div><!-- /platform-view-bitbucket-dc -->
</div><!-- /authenticated-content -->
<footer class="app-footer">
<button id="need-help-btn" class="footer-chip footer-chip--help" aria-label="Get help" title="Get help">
<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">
<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>
Having Problems?
</button>
<button id="report-bug-btn" class="footer-chip footer-chip--bug" aria-label="Report a bug" title="Report a bug">
<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">
<path d="M8 2l1.88 1.88"></path><path d="M14.12 3.88L16 2"></path>
<path d="M9 7.13v-1a3.003 3.003 0 1 1 6 0v1"></path>
<path d="M12 20c-3.3 0-6-2.7-6-6v-3a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v3c0 3.3-2.7 6-6 6z"></path>
<path d="M12 20v-9"></path><path d="M6.53 9C4.6 8.8 3 7.1 3 5"></path>
<path d="M6 13H2"></path><path d="M3 21c0-2.1 1.7-3.9 3.8-4"></path>
<path d="M20.97 5c0 2.1-1.6 3.8-3.5 4"></path><path d="M22 13h-4"></path>
<path d="M17.2 17c2.1.1 3.8 1.9 3.8 4"></path>
</svg>
Report a Bug
</button>
<button id="privacy-faq-btn" class="footer-chip footer-chip--privacy" aria-label="Privacy FAQ" title="Privacy FAQ">
<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">
<path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"></path>
</svg>
Privacy FAQ
</button>
<button id="how-it-works-btn" class="footer-chip footer-chip--docs" aria-label="Documentation" title="Documentation">
<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">
<path d="M4 19.5A2.5 2.5 0 0 1 6.5 17H20"></path>
<path d="M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2z"></path>
</svg>
Documentation
</button>
</footer>
</div>
<script type="module" src="popup-imports.js"></script>
<script type="module" src="popup.js"></script>
</body>
</html>