-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreport-test.html
More file actions
1540 lines (1360 loc) · 810 KB
/
report-test.html
File metadata and controls
1540 lines (1360 loc) · 810 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>claude-traffic-3 API Calls</title>
</head>
<body>
<div id="app"></div>
<script>
window.claudeData = JSON.parse(decodeURIComponent(escape(atob('eyJyYXdQYWlycyI6W3sicmVxdWVzdCI6eyJ0aW1lc3RhbXAiOjE3NjAzMjUzODIuNTM4LCJtZXRob2QiOiJHRVQiLCJ1cmwiOiJodHRwczovL2FwaS5yZHNlYy50cmVuZG1pY3JvLmNvbS8iLCJoZWFkZXJzIjp7Imhvc3QiOiIwLjAuMC4wOjgwODAiLCJjb25uZWN0aW9uIjoia2VlcC1hbGl2ZSIsInByYWdtYSI6Im5vLWNhY2hlIiwiY2FjaGUtY29udHJvbCI6Im5vLWNhY2hlIiwidXBncmFkZS1pbnNlY3VyZS1yZXF1ZXN0cyI6IjEiLCJ1c2VyLWFnZW50IjoiTW96aWxsYS81LjAgKE1hY2ludG9zaDsgSW50ZWwgTWFjIE9TIFggMTBfMTVfNykgQXBwbGVXZWJLaXQvNTM3LjM2IChLSFRNTCwgbGlrZSBHZWNrbykgQ2hyb21lLzE0MS4wLjAuMCBTYWZhcmkvNTM3LjM2IiwiYWNjZXB0IjoidGV4dC9odG1sLGFwcGxpY2F0aW9uL3hodG1sK3htbCxhcHBsaWNhdGlvbi94bWw7cT0wLjksaW1hZ2UvYXZpZixpbWFnZS93ZWJwLGltYWdlL2FwbmcsKi8qO3E9MC44LGFwcGxpY2F0aW9uL3NpZ25lZC1leGNoYW5nZTt2PWIzO3E9MC43IiwiYWNjZXB0LWVuY29kaW5nIjoiZ3ppcCwgZGVmbGF0ZSIsImFjY2VwdC1sYW5ndWFnZSI6ImVuLUFVLGVuLVVTO3E9MC45LGVuO3E9MC44In0sImJvZHkiOm51bGx9LCJyZXNwb25zZSI6eyJ0aW1lc3RhbXAiOjE3NjAzMjUzODMuMzc2LCJzdGF0dXNfY29kZSI6NDA0LCJoZWFkZXJzIjp7ImNvbm5lY3Rpb24iOiJrZWVwLWFsaXZlIiwiY29udGVudC1sZW5ndGgiOiIxOSIsImNvbnRlbnQtdHlwZSI6InRleHQvcGxhaW47IGNoYXJzZXQ9dXRmLTgiLCJkYXRlIjoiTW9uLCAxMyBPY3QgMjAyNSAwMzoxNjoyMyBHTVQiLCJ4LWNvbnRlbnQtdHlwZS1vcHRpb25zIjoibm9zbmlmZiJ9LCJib2R5IjpudWxsfSwibG9nZ2VkX2F0IjoiMjAyNS0xMC0xM1QwMzoxNjoyMy4zODVaIn0seyJyZXF1ZXN0Ijp7InRpbWVzdGFtcCI6MTc2MDMyNTM4My42MjgsIm1ldGhvZCI6IkdFVCIsInVybCI6Imh0dHBzOi8vYXBpLnJkc2VjLnRyZW5kbWljcm8uY29tL2Zhdmljb24uaWNvIiwiaGVhZGVycyI6eyJob3N0IjoiMC4wLjAuMDo4MDgwIiwiY29ubmVjdGlvbiI6ImtlZXAtYWxpdmUiLCJwcmFnbWEiOiJuby1jYWNoZSIsImNhY2hlLWNvbnRyb2wiOiJuby1jYWNoZSIsInVzZXItYWdlbnQiOiJNb3ppbGxhLzUuMCAoTWFjaW50b3NoOyBJbnRlbCBNYWMgT1MgWCAxMF8xNV83KSBBcHBsZVdlYktpdC81MzcuMzYgKEtIVE1MLCBsaWtlIEdlY2tvKSBDaHJvbWUvMTQxLjAuMC4wIFNhZmFyaS81MzcuMzYiLCJhY2NlcHQiOiJpbWFnZS9hdmlmLGltYWdlL3dlYnAsaW1hZ2UvYXBuZyxpbWFnZS9zdmcreG1sLGltYWdlLyosKi8qO3E9MC44IiwicmVmZXJlciI6Imh0dHA6Ly8wLjAuMC4wOjgwODAvIiwiYWNjZXB0LWVuY29kaW5nIjoiZ3ppcCwgZGVmbGF0ZSIsImFjY2VwdC1sYW5ndWFnZSI6ImVuLUFVLGVuLVVTO3E9MC45LGVuO3E9MC44In0sImJvZHkiOm51bGx9LCJyZXNwb25zZSI6eyJ0aW1lc3RhbXAiOjE3NjAzMjUzODMuODIyLCJzdGF0dXNfY29kZSI6NDA0LCJoZWFkZXJzIjp7ImNvbm5lY3Rpb24iOiJrZWVwLWFsaXZlIiwiY29udGVudC1sZW5ndGgiOiIxOSIsImNvbnRlbnQtdHlwZSI6InRleHQvcGxhaW47IGNoYXJzZXQ9dXRmLTgiLCJkYXRlIjoiTW9uLCAxMyBPY3QgMjAyNSAwMzoxNjoyMyBHTVQiLCJ4LWNvbnRlbnQtdHlwZS1vcHRpb25zIjoibm9zbmlmZiJ9LCJib2R5IjpudWxsfSwibG9nZ2VkX2F0IjoiMjAyNS0xMC0xM1QwMzoxNjoyMy44MjNaIn0seyJyZXF1ZXN0Ijp7InRpbWVzdGFtcCI6MTc2MDMyNTM4Ny42ODMsIm1ldGhvZCI6IkdFVCIsInVybCI6Imh0dHBzOi8vYXBpLnJkc2VjLnRyZW5kbWljcm8uY29tLyIsImhlYWRlcnMiOnsiaG9zdCI6IjAuMC4wLjA6ODA4MCIsImNvbm5lY3Rpb24iOiJrZWVwLWFsaXZlIiwidXBncmFkZS1pbnNlY3VyZS1yZXF1ZXN0cyI6IjEiLCJ1c2VyLWFnZW50IjoiTW96aWxsYS81LjAgKE1hY2ludG9zaDsgSW50ZWwgTWFjIE9TIFggMTBfMTVfNykgQXBwbGVXZWJLaXQvNTM3LjM2IChLSFRNTCwgbGlrZSBHZWNrbykgQ2hyb21lLzE0MS4wLjAuMCBTYWZhcmkvNTM3LjM2IiwiYWNjZXB0IjoidGV4dC9odG1sLGFwcGxpY2F0aW9uL3hodG1sK3htbCxhcHBsaWNhdGlvbi94bWw7cT0wLjksaW1hZ2UvYXZpZixpbWFnZS93ZWJwLGltYWdlL2FwbmcsKi8qO3E9MC44LGFwcGxpY2F0aW9uL3NpZ25lZC1leGNoYW5nZTt2PWIzO3E9MC43IiwiYWNjZXB0LWVuY29kaW5nIjoiZ3ppcCwgZGVmbGF0ZSIsImFjY2VwdC1sYW5ndWFnZSI6ImVuLUFVLGVuLVVTO3E9MC45LGVuO3E9MC44In0sImJvZHkiOm51bGx9LCJyZXNwb25zZSI6eyJ0aW1lc3RhbXAiOjE3NjAzMjUzODcuODgyLCJzdGF0dXNfY29kZSI6NDA0LCJoZWFkZXJzIjp7ImNvbm5lY3Rpb24iOiJrZWVwLWFsaXZlIiwiY29udGVudC1sZW5ndGgiOiIxOSIsImNvbnRlbnQtdHlwZSI6InRleHQvcGxhaW47IGNoYXJzZXQ9dXRmLTgiLCJkYXRlIjoiTW9uLCAxMyBPY3QgMjAyNSAwMzoxNjoyOCBHTVQiLCJ4LWNvbnRlbnQtdHlwZS1vcHRpb25zIjoibm9zbmlmZiJ9LCJib2R5IjpudWxsfSwibG9nZ2VkX2F0IjoiMjAyNS0xMC0xM1QwMzoxNjoyNy44ODNaIn1dLCJ0aW1lc3RhbXAiOiIyMDI1LTEwLTE0IDA3OjMxOjA0IiwibWV0YWRhdGEiOnsiaW5jbHVkZUFsbFJlcXVlc3RzIjpmYWxzZX19'))));
</script>
<script>
/* Claude Tools Frontend Bundle */
"use strict";var ClaudeApp=(()=>{var os=Object.defineProperty;var as=Object.getOwnPropertyDescriptor;var S=(l,e,t,s)=>{for(var n=s>1?void 0:s?as(e,t):e,i=l.length-1,r;i>=0;i--)(r=l[i])&&(n=(s?r(e,t,n):r(n))||n);return s&&n&&os(e,t,n),n};var vt=class{get shadowRoot(){return this.__host.__shadowRoot}constructor(e){this.ariaAtomic="",this.ariaAutoComplete="",this.ariaBrailleLabel="",this.ariaBrailleRoleDescription="",this.ariaBusy="",this.ariaChecked="",this.ariaColCount="",this.ariaColIndex="",this.ariaColSpan="",this.ariaCurrent="",this.ariaDescription="",this.ariaDisabled="",this.ariaExpanded="",this.ariaHasPopup="",this.ariaHidden="",this.ariaInvalid="",this.ariaKeyShortcuts="",this.ariaLabel="",this.ariaLevel="",this.ariaLive="",this.ariaModal="",this.ariaMultiLine="",this.ariaMultiSelectable="",this.ariaOrientation="",this.ariaPlaceholder="",this.ariaPosInSet="",this.ariaPressed="",this.ariaReadOnly="",this.ariaRequired="",this.ariaRoleDescription="",this.ariaRowCount="",this.ariaRowIndex="",this.ariaRowSpan="",this.ariaSelected="",this.ariaSetSize="",this.ariaSort="",this.ariaValueMax="",this.ariaValueMin="",this.ariaValueNow="",this.ariaValueText="",this.role="",this.form=null,this.labels=[],this.states=new Set,this.validationMessage="",this.validity={},this.willValidate=!0,this.__host=e}checkValidity(){return console.warn("`ElementInternals.checkValidity()` was called on the server.This method always returns true."),!0}reportValidity(){return!0}setFormValue(){}setValidity(){}};var R=function(l,e,t,s,n){if(s==="m")throw new TypeError("Private method is not writable");if(s==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?l!==e||!n:!e.has(l))throw new TypeError("Cannot write private member to an object whose class did not declare it");return s==="a"?n.call(l,t):n?n.value=t:e.set(l,t),t},T=function(l,e,t,s){if(t==="a"&&!s)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?l!==e||!s:!e.has(l))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?s:t==="a"?s.call(l):s?s.value:e.get(l)},Z,Te,Se,se,Ue,ne,Ee,j,ie,z,Pe,xt,bt=l=>typeof l=="boolean"?l:l?.capture??!1;var ls=class{constructor(){this.__eventListeners=new Map,this.__captureEventListeners=new Map}addEventListener(e,t,s){if(t==null)return;let n=bt(s)?this.__captureEventListeners:this.__eventListeners,i=n.get(e);if(i===void 0)i=new Map,n.set(e,i);else if(i.has(t))return;let r=typeof s=="object"&&s?s:{};r.signal?.addEventListener("abort",()=>this.removeEventListener(e,t,s)),i.set(t,r??{})}removeEventListener(e,t,s){if(t==null)return;let n=bt(s)?this.__captureEventListeners:this.__eventListeners,i=n.get(e);i!==void 0&&(i.delete(t),i.size||n.delete(e))}dispatchEvent(e){let t=[this],s=this.__eventTargetParent;if(e.composed)for(;s;)t.push(s),s=s.__eventTargetParent;else for(;s&&s!==this.__host;)t.push(s),s=s.__eventTargetParent;let n=!1,i=!1,r=0,a=null,o=null,c=null,h=e.stopPropagation,p=e.stopImmediatePropagation;Object.defineProperties(e,{target:{get(){return a??o},...b},srcElement:{get(){return e.target},...b},currentTarget:{get(){return c},...b},eventPhase:{get(){return r},...b},composedPath:{value:()=>t,...b},stopPropagation:{value:()=>{n=!0,h.call(e)},...b},stopImmediatePropagation:{value:()=>{i=!0,p.call(e)},...b}});let d=(g,f,_)=>{typeof g=="function"?g(e):typeof g?.handleEvent=="function"&&g.handleEvent(e),f.once&&_.delete(g)},m=()=>(c=null,r=0,!e.defaultPrevented),x=t.slice().reverse();a=!this.__host||!e.composed?this:null;let w=g=>{for(o=this;o.__host&&g.includes(o.__host);)o=o.__host};for(let g of x){!a&&(!o||o===g.__host)&&w(x.slice(x.indexOf(g))),c=g,r=g===e.target?2:1;let f=g.__captureEventListeners.get(e.type);if(f){for(let[_,E]of f)if(d(_,E,f),i)return m()}if(n)return m()}let $=e.bubbles?t:[this];o=null;for(let g of $){!a&&(!o||g===o.__host)&&w($.slice(0,$.indexOf(g)+1)),c=g,r=g===e.target?2:3;let f=g.__eventListeners.get(e.type);if(f){for(let[_,E]of f)if(d(_,E,f),i)return m()}if(n)return m()}return m()}},je=ls;var b={__proto__:null};b.enumerable=!0;Object.freeze(b);var We=(z=class{constructor(e,t={}){if(Z.set(this,!1),Te.set(this,!1),Se.set(this,!1),se.set(this,!1),Ue.set(this,Date.now()),ne.set(this,!1),Ee.set(this,void 0),j.set(this,void 0),ie.set(this,void 0),this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,arguments.length===0)throw new Error("The type argument must be specified");if(typeof t!="object"||!t)throw new Error('The "options" argument must be an object');let{bubbles:s,cancelable:n,composed:i}=t;R(this,Z,!!n,"f"),R(this,Te,!!s,"f"),R(this,Se,!!i,"f"),R(this,Ee,`${e}`,"f"),R(this,j,null,"f"),R(this,ie,!1,"f")}initEvent(e,t,s){throw new Error("Method not implemented.")}stopImmediatePropagation(){this.stopPropagation()}preventDefault(){R(this,se,!0,"f")}get target(){return T(this,j,"f")}get currentTarget(){return T(this,j,"f")}get srcElement(){return T(this,j,"f")}get type(){return T(this,Ee,"f")}get cancelable(){return T(this,Z,"f")}get defaultPrevented(){return T(this,Z,"f")&&T(this,se,"f")}get timeStamp(){return T(this,Ue,"f")}composedPath(){return T(this,ie,"f")?[T(this,j,"f")]:[]}get returnValue(){return!T(this,Z,"f")||!T(this,se,"f")}get bubbles(){return T(this,Te,"f")}get composed(){return T(this,Se,"f")}get eventPhase(){return T(this,ie,"f")?z.AT_TARGET:z.NONE}get cancelBubble(){return T(this,ne,"f")}set cancelBubble(e){e&&R(this,ne,!0,"f")}stopPropagation(){R(this,ne,!0,"f")}get isTrusted(){return!1}},Z=new WeakMap,Te=new WeakMap,Se=new WeakMap,se=new WeakMap,Ue=new WeakMap,ne=new WeakMap,Ee=new WeakMap,j=new WeakMap,ie=new WeakMap,z.NONE=0,z.CAPTURING_PHASE=1,z.AT_TARGET=2,z.BUBBLING_PHASE=3,z);Object.defineProperties(We.prototype,{initEvent:b,stopImmediatePropagation:b,preventDefault:b,target:b,currentTarget:b,srcElement:b,type:b,cancelable:b,defaultPrevented:b,timeStamp:b,composedPath:b,returnValue:b,bubbles:b,composed:b,eventPhase:b,cancelBubble:b,stopPropagation:b,isTrusted:b});var kt=(xt=class extends We{constructor(e,t={}){super(e,t),Pe.set(this,void 0),R(this,Pe,t?.detail??null,"f")}initCustomEvent(e,t,s,n){throw new Error("Method not implemented.")}get detail(){return T(this,Pe,"f")}},Pe=new WeakMap,xt);Object.defineProperties(kt.prototype,{detail:b});var Fe=We,Je=kt;globalThis.Event??=Fe;globalThis.CustomEvent??=Je;var wt=new WeakMap,re=l=>{let e=wt.get(l);return e===void 0&&wt.set(l,e=new Map),e},cs=class extends je{constructor(){super(...arguments),this.__shadowRootMode=null,this.__shadowRoot=null,this.__internals=null}get attributes(){return Array.from(re(this)).map(([e,t])=>({name:e,value:t}))}get shadowRoot(){return this.__shadowRootMode==="closed"?null:this.__shadowRoot}get localName(){return this.constructor.__localName}get tagName(){return this.localName?.toUpperCase()}setAttribute(e,t){re(this).set(e,String(t))}removeAttribute(e){re(this).delete(e)}toggleAttribute(e,t){if(this.hasAttribute(e)){if(t===void 0||!t)return this.removeAttribute(e),!1}else return t===void 0||t?(this.setAttribute(e,""),!0):!1;return!0}hasAttribute(e){return re(this).has(e)}attachShadow(e){let t={host:this};return this.__shadowRootMode=e.mode,e&&e.mode==="open"&&(this.__shadowRoot=t),t}attachInternals(){if(this.__internals!==null)throw new Error("Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.");let e=new vt(this);return this.__internals=e,e}getAttribute(e){return re(this).get(e)??null}};var hs=class extends cs{},Ve=hs;globalThis.litServerRoot??=Object.defineProperty(new Ve,"localName",{get(){return"lit-server-root"}});var ps=class{constructor(){this.__definitions=new Map}define(e,t){if(this.__definitions.has(e))if(process.env.NODE_ENV==="development")console.warn(`'CustomElementRegistry' already has "${e}" defined. This may have been caused by live reload or hot module replacement in which case it can be safely ignored.
Make sure to test your application with a production build as repeat registrations will throw in production.`);else throw new Error(`Failed to execute 'define' on 'CustomElementRegistry': the name "${e}" has already been used with this registry`);t.__localName=e,this.__definitions.set(e,{ctor:t,observedAttributes:t.observedAttributes??[]})}get(e){return this.__definitions.get(e)?.ctor}},us=ps;var yt=new us;var oe=globalThis,Ae=oe.ShadowRoot&&(oe.ShadyCSS===void 0||oe.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,$t=Symbol(),_t=new WeakMap,Ce=class{constructor(e,t,s){if(this._$cssResult$=!0,s!==$t)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if(Ae&&e===void 0){let s=t!==void 0&&t.length===1;s&&(e=_t.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),s&&_t.set(t,e))}return e}toString(){return this.cssText}},Tt=l=>new Ce(typeof l=="string"?l:l+"",void 0,$t);var St=(l,e)=>{if(Ae)l.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(let t of e){let s=document.createElement("style"),n=oe.litNonce;n!==void 0&&s.setAttribute("nonce",n),s.textContent=t.cssText,l.appendChild(s)}},Ge=Ae||oe.CSSStyleSheet===void 0?l=>l:l=>l instanceof CSSStyleSheet?(e=>{let t="";for(let s of e.cssRules)t+=s.cssText;return Tt(t)})(l):l;var{is:ds,defineProperty:ms,getOwnPropertyDescriptor:fs,getOwnPropertyNames:gs,getOwnPropertySymbols:vs,getPrototypeOf:xs}=Object,ce=globalThis;ce.customElements??=yt;var Et=ce.trustedTypes,bs=Et?Et.emptyScript:"",ks=ce.reactiveElementPolyfillSupport,ae=(l,e)=>l,le={toAttribute(l,e){switch(e){case Boolean:l=l?bs:null;break;case Object:case Array:l=l==null?l:JSON.stringify(l)}return l},fromAttribute(l,e){let t=l;switch(e){case Boolean:t=l!==null;break;case Number:t=l===null?null:Number(l);break;case Object:case Array:try{t=JSON.parse(l)}catch{t=null}}return t}},Re=(l,e)=>!ds(l,e),Pt={attribute:!0,type:String,converter:le,reflect:!1,useDefault:!1,hasChanged:Re};Symbol.metadata??=Symbol("metadata"),ce.litPropertyMetadata??=new WeakMap;var L=class extends(globalThis.HTMLElement??Ve){static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=Pt){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){let s=Symbol(),n=this.getPropertyDescriptor(e,s,t);n!==void 0&&ms(this.prototype,e,n)}}static getPropertyDescriptor(e,t,s){let{get:n,set:i}=fs(this.prototype,e)??{get(){return this[t]},set(r){this[t]=r}};return{get:n,set(r){let a=n?.call(this);i?.call(this,r),this.requestUpdate(e,a,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??Pt}static _$Ei(){if(this.hasOwnProperty(ae("elementProperties")))return;let e=xs(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(ae("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(ae("properties"))){let t=this.properties,s=[...gs(t),...vs(t)];for(let n of s)this.createProperty(n,t[n])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[s,n]of t)this.elementProperties.set(s,n)}this._$Eh=new Map;for(let[t,s]of this.elementProperties){let n=this._$Eu(t,s);n!==void 0&&this._$Eh.set(n,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let s=new Set(e.flat(1/0).reverse());for(let n of s)t.unshift(Ge(n))}else e!==void 0&&t.push(Ge(e));return t}static _$Eu(e,t){let s=t.attribute;return s===!1?void 0:typeof s=="string"?s:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){let e=new Map,t=this.constructor.elementProperties;for(let s of t.keys())this.hasOwnProperty(s)&&(e.set(s,this[s]),delete this[s]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return St(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,t,s){this._$AK(e,s)}_$ET(e,t){let s=this.constructor.elementProperties.get(e),n=this.constructor._$Eu(e,s);if(n!==void 0&&s.reflect===!0){let i=(s.converter?.toAttribute!==void 0?s.converter:le).toAttribute(t,s.type);this._$Em=e,i==null?this.removeAttribute(n):this.setAttribute(n,i),this._$Em=null}}_$AK(e,t){let s=this.constructor,n=s._$Eh.get(e);if(n!==void 0&&this._$Em!==n){let i=s.getPropertyOptions(n),r=typeof i.converter=="function"?{fromAttribute:i.converter}:i.converter?.fromAttribute!==void 0?i.converter:le;this._$Em=n,this[n]=r.fromAttribute(t,i.type)??this._$Ej?.get(n)??null,this._$Em=null}}requestUpdate(e,t,s){if(e!==void 0){let n=this.constructor,i=this[e];if(s??=n.getPropertyOptions(e),!((s.hasChanged??Re)(i,t)||s.useDefault&&s.reflect&&i===this._$Ej?.get(e)&&!this.hasAttribute(n._$Eu(e,s))))return;this.C(e,t,s)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,t,{useDefault:s,reflect:n,wrapped:i},r){s&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,r??t??this[e]),i!==!0||r!==void 0)||(this._$AL.has(e)||(this.hasUpdated||s||(t=void 0),this._$AL.set(e,t)),n===!0&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[n,i]of this._$Ep)this[n]=i;this._$Ep=void 0}let s=this.constructor.elementProperties;if(s.size>0)for(let[n,i]of s){let{wrapped:r}=i,a=this[n];r!==!0||this._$AL.has(n)||a===void 0||this.C(n,void 0,i,a)}}let e=!1,t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach(s=>s.hostUpdate?.()),this.update(t)):this._$EM()}catch(s){throw e=!1,this._$EM(),s}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach(t=>t.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach(t=>this._$ET(t,this[t])),this._$EM()}updated(e){}firstUpdated(e){}};L.elementStyles=[],L.shadowRootOptions={mode:"open"},L[ae("elementProperties")]=new Map,L[ae("finalized")]=new Map,ks?.({ReactiveElement:L}),(ce.reactiveElementVersions??=[]).push("2.1.0");var Le=globalThis,Me=Le.trustedTypes,Ct=Me?Me.createPolicy("lit-html",{createHTML:l=>l}):void 0,Nt="$lit$",D=`lit$${Math.random().toFixed(9).slice(2)}$`,Bt="?"+D,ws=`<${Bt}>`,J=Le.document===void 0?{createTreeWalker:()=>({})}:document,pe=()=>J.createComment(""),ue=l=>l===null||typeof l!="object"&&typeof l!="function",tt=Array.isArray,ys=l=>tt(l)||typeof l?.[Symbol.iterator]=="function",Ze=`[
\f\r]`,he=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,At=/-->/g,Rt=/>/g,W=RegExp(`>|${Ze}(?:([^\\s"'>=/]+)(${Ze}*=${Ze}*(?:[^
\f\r"'\`<>=]|("|')|))|$)`,"g"),Mt=/'/g,Lt=/"/g,Ot=/^(?:script|style|textarea|title)$/i,st=l=>(e,...t)=>({_$litType$:l,strings:e,values:t}),u=st(1),Nn=st(2),Bn=st(3),I=Symbol.for("lit-noChange"),y=Symbol.for("lit-nothing"),It=new WeakMap,F=J.createTreeWalker(J,129);function zt(l,e){if(!tt(l)||!l.hasOwnProperty("raw"))throw Error("invalid template strings array");return Ct!==void 0?Ct.createHTML(e):e}var _s=(l,e)=>{let t=l.length-1,s=[],n,i=e===2?"<svg>":e===3?"<math>":"",r=he;for(let a=0;a<t;a++){let o=l[a],c,h,p=-1,d=0;for(;d<o.length&&(r.lastIndex=d,h=r.exec(o),h!==null);)d=r.lastIndex,r===he?h[1]==="!--"?r=At:h[1]!==void 0?r=Rt:h[2]!==void 0?(Ot.test(h[2])&&(n=RegExp("</"+h[2],"g")),r=W):h[3]!==void 0&&(r=W):r===W?h[0]===">"?(r=n??he,p=-1):h[1]===void 0?p=-2:(p=r.lastIndex-h[2].length,c=h[1],r=h[3]===void 0?W:h[3]==='"'?Lt:Mt):r===Lt||r===Mt?r=W:r===At||r===Rt?r=he:(r=W,n=void 0);let m=r===W&&l[a+1].startsWith("/>")?" ":"";i+=r===he?o+ws:p>=0?(s.push(c),o.slice(0,p)+Nt+o.slice(p)+D+m):o+D+(p===-2?a:m)}return[zt(l,i+(l[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),s]},de=class l{constructor({strings:e,_$litType$:t},s){let n;this.parts=[];let i=0,r=0,a=e.length-1,o=this.parts,[c,h]=_s(e,t);if(this.el=l.createElement(c,s),F.currentNode=this.el.content,t===2||t===3){let p=this.el.content.firstChild;p.replaceWith(...p.childNodes)}for(;(n=F.nextNode())!==null&&o.length<a;){if(n.nodeType===1){if(n.hasAttributes())for(let p of n.getAttributeNames())if(p.endsWith(Nt)){let d=h[r++],m=n.getAttribute(p).split(D),x=/([.?@])?(.*)/.exec(d);o.push({type:1,index:i,name:x[2],strings:m,ctor:x[1]==="."?Ke:x[1]==="?"?Xe:x[1]==="@"?Ye:K}),n.removeAttribute(p)}else p.startsWith(D)&&(o.push({type:6,index:i}),n.removeAttribute(p));if(Ot.test(n.tagName)){let p=n.textContent.split(D),d=p.length-1;if(d>0){n.textContent=Me?Me.emptyScript:"";for(let m=0;m<d;m++)n.append(p[m],pe()),F.nextNode(),o.push({type:2,index:++i});n.append(p[d],pe())}}}else if(n.nodeType===8)if(n.data===Bt)o.push({type:2,index:i});else{let p=-1;for(;(p=n.data.indexOf(D,p+1))!==-1;)o.push({type:7,index:i}),p+=D.length-1}i++}}static createElement(e,t){let s=J.createElement("template");return s.innerHTML=e,s}};function Q(l,e,t=l,s){if(e===I)return e;let n=s!==void 0?t._$Co?.[s]:t._$Cl,i=ue(e)?void 0:e._$litDirective$;return n?.constructor!==i&&(n?._$AO?.(!1),i===void 0?n=void 0:(n=new i(l),n._$AT(l,t,s)),s!==void 0?(t._$Co??=[])[s]=n:t._$Cl=n),n!==void 0&&(e=Q(l,n._$AS(l,e.values),n,s)),e}var Qe=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:t},parts:s}=this._$AD,n=(e?.creationScope??J).importNode(t,!0);F.currentNode=n;let i=F.nextNode(),r=0,a=0,o=s[0];for(;o!==void 0;){if(r===o.index){let c;o.type===2?c=new me(i,i.nextSibling,this,e):o.type===1?c=new o.ctor(i,o.name,o.strings,this,e):o.type===6&&(c=new et(i,this,e)),this._$AV.push(c),o=s[++a]}r!==o?.index&&(i=F.nextNode(),r++)}return F.currentNode=J,n}p(e){let t=0;for(let s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(e,s,t),t+=s.strings.length-2):s._$AI(e[t])),t++}},me=class l{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,s,n){this.type=2,this._$AH=y,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=s,this.options=n,this._$Cv=n?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=Q(this,e,t),ue(e)?e===y||e==null||e===""?(this._$AH!==y&&this._$AR(),this._$AH=y):e!==this._$AH&&e!==I&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):ys(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==y&&ue(this._$AH)?this._$AA.nextSibling.data=e:this.T(J.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:s}=e,n=typeof s=="number"?this._$AC(e):(s.el===void 0&&(s.el=de.createElement(zt(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===n)this._$AH.p(t);else{let i=new Qe(n,this),r=i.u(this.options);i.p(t),this.T(r),this._$AH=i}}_$AC(e){let t=It.get(e.strings);return t===void 0&&It.set(e.strings,t=new de(e)),t}k(e){tt(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,s,n=0;for(let i of e)n===t.length?t.push(s=new l(this.O(pe()),this.O(pe()),this,this.options)):s=t[n],s._$AI(i),n++;n<t.length&&(this._$AR(s&&s._$AB.nextSibling,n),t.length=n)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e&&e!==this._$AB;){let s=e.nextSibling;e.remove(),e=s}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},K=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,s,n,i){this.type=1,this._$AH=y,this._$AN=void 0,this.element=e,this.name=t,this._$AM=n,this.options=i,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=y}_$AI(e,t=this,s,n){let i=this.strings,r=!1;if(i===void 0)e=Q(this,e,t,0),r=!ue(e)||e!==this._$AH&&e!==I,r&&(this._$AH=e);else{let a=e,o,c;for(e=i[0],o=0;o<i.length-1;o++)c=Q(this,a[s+o],t,o),c===I&&(c=this._$AH[o]),r||=!ue(c)||c!==this._$AH[o],c===y?e=y:e!==y&&(e+=(c??"")+i[o+1]),this._$AH[o]=c}r&&!n&&this.j(e)}j(e){e===y?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},Ke=class extends K{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===y?void 0:e}},Xe=class extends K{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==y)}},Ye=class extends K{constructor(e,t,s,n,i){super(e,t,s,n,i),this.type=5}_$AI(e,t=this){if((e=Q(this,e,t,0)??y)===I)return;let s=this._$AH,n=e===y&&s!==y||e.capture!==s.capture||e.once!==s.once||e.passive!==s.passive,i=e!==y&&(s===y||n);n&&this.element.removeEventListener(this.name,this,s),i&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}},et=class{constructor(e,t,s){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(e){Q(this,e)}};var $s=Le.litHtmlPolyfillSupport;$s?.(de,me),(Le.litHtmlVersions??=[]).push("3.3.0");var Dt=(l,e,t)=>{let s=t?.renderBefore??e,n=s._$litPart$;if(n===void 0){let i=t?.renderBefore??null;s._$litPart$=n=new me(e.insertBefore(pe(),i),i,void 0,t??{})}return n._$AI(l),n};var nt=globalThis,P=class extends L{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=Dt(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return I}};P._$litElement$=!0,P.finalized=!0,nt.litElementHydrateSupport?.({LitElement:P});var Ts=nt.litElementPolyfillSupport;Ts?.({LitElement:P});(nt.litElementVersions??=[]).push("4.2.0");var H=l=>(e,t)=>{t!==void 0?t.addInitializer(()=>{customElements.define(l,e)}):customElements.define(l,e)};var Ss={attribute:!0,type:String,converter:le,reflect:!1,hasChanged:Re},Es=(l=Ss,e,t)=>{let{kind:s,metadata:n}=t,i=globalThis.litPropertyMetadata.get(n);if(i===void 0&&globalThis.litPropertyMetadata.set(n,i=new Map),s==="setter"&&((l=Object.create(l)).wrapped=!0),i.set(t.name,l),s==="accessor"){let{name:r}=t;return{set(a){let o=e.get.call(this);e.set.call(this,a),this.requestUpdate(r,o,l)},init(a){return a!==void 0&&this.C(r,void 0,l,a),a}}}if(s==="setter"){let{name:r}=t;return function(a){let o=this[r];e.call(this,a),this.requestUpdate(r,o,l)}}throw Error("Unsupported decorator location: "+s)};function q(l){return(e,t)=>typeof t=="object"?Es(l,e,t):((s,n,i)=>{let r=n.hasOwnProperty(i);return n.constructor.createProperty(i,s),r?Object.getOwnPropertyDescriptor(n,i):void 0})(l,e,t)}function X(l){return q({...l,state:!0,attribute:!1})}var Ne=class{processRawPairs(e){if(!e||e.length===0)return[];let t=[];for(let s=0;s<e.length;s++){let n=e[s];if(!(!n?.request||!n?.response))try{let i=!!n.response.body_raw,r,a=null;if(n.response.body_raw)a=this.isBedrockResponse(n.response.body_raw)?"bedrock":"standard",r=this.parseStreamingResponse(n.response.body_raw);else if(n.response.body)r=n.response.body;else continue;let o=this.extractModel(n);t.push({id:`${n.request.timestamp||Date.now()}_${Math.random()}`,timestamp:new Date((n.request.timestamp||Date.now())*1e3).toISOString(),request:n.request.body,response:r,model:o,isStreaming:i,rawStreamData:n.response.body_raw,streamFormat:a})}catch(i){console.warn(`Failed to process raw pair at index ${s}:`,i)}}return t}isBedrockResponse(e){return e.startsWith("\0\0")}parseBedrockStreamingResponse(e){if(!e||e.length===0)throw new Error("Empty bodyRaw provided to parseBedrockStreamingResponse");let t=[],s=null;try{let n=this.extractJsonChunksFromEventStream(e);for(let i of n)try{let r=JSON.parse(i);if(r.bytes){let a=r.bytes,o=this.decodeBase64ToUtf8(a),c=JSON.parse(o);t.push(c)}}catch(r){console.warn("Failed to parse JSON chunk:",i,r)}s=this.extractBedrockMetrics(e)}catch(n){throw console.error("Failed to parse Bedrock streaming response:",n),new Error(`Bedrock streaming response parsing failed: ${n}`)}return this.buildMessageFromEvents(t,s)}decodeBase64ToUtf8(e){if(typeof window<"u"&&typeof atob<"u")return atob(e);if(typeof Buffer<"u")return Buffer.from(e,"base64").toString("utf-8");throw new Error("Base64 decoding not supported in this environment")}extractJsonChunksFromEventStream(e){if(!e||e.length===0)return[];let t=[],s='event{"bytes":',n=0;for(;n<e.length;){let i=e.indexOf(s,n);if(i===-1)break;let r=i+5,a=0,o=-1;for(let c=r;c<e.length;c++){let h=e[c];if(h==="{")a++;else if(h==="}"&&(a--,a===0)){o=c;break}}if(o!==-1){let c=e.substring(r,o+1);t.push(c),n=o+1}else n=i+s.length}return t}extractBedrockMetrics(e){try{let t=e.match(/"amazon-bedrock-invocationMetrics":\s*(\{[^}]+\})/);if(t&&t[1])return JSON.parse(t[1])}catch{}return null}parseStreamingResponse(e){return this.isBedrockResponse(e)?this.parseBedrockStreamingResponse(e):this.parseStandardStreamingResponse(e)}parseStandardStreamingResponse(e){if(!e||e.length===0)throw new Error("Empty bodyRaw provided to parseStandardStreamingResponse");let t=e.split(`
`),s=[];for(let n of t){if(!n.startsWith("data: "))continue;let i=n.substring(6).trim();if(i==="[DONE]")break;try{let r=JSON.parse(i);s.push(r)}catch(r){console.warn("Failed to parse SSE event:",i,r)}}return this.buildMessageFromEvents(s)}buildMessageFromEvents(e,t){let s={id:"",type:"message",role:"assistant",content:[],model:"",stop_reason:null,stop_sequence:null,usage:{input_tokens:0,output_tokens:0,cache_creation_input_tokens:null,cache_read_input_tokens:null,server_tool_use:null,service_tier:null}},n=[],i=-1;for(let r of e)switch(r.type){case"message_start":s={...s,...r.message};break;case"content_block_start":i=r.index,n[i]={...r.content_block};break;case"content_block_delta":if(i>=0&&n[i]){let a=n[i],o=r.delta;switch(o.type){case"text_delta":a.type==="text"&&(a.text=(a.text||"")+o.text);break;case"input_json_delta":if(a.type==="tool_use"){let c=a;typeof c.input=="string"?c.input=c.input+o.partial_json:c.input=o.partial_json}break;case"thinking_delta":a.type==="thinking"&&(a.thinking=(a.thinking||"")+o.thinking);break;case"signature_delta":a.type==="thinking"&&(a.signature=(a.signature||"")+o.signature);break;case"citations_delta":break}}break;case"content_block_stop":if(i>=0&&n[i]){let a=n[i];if(a.type==="tool_use"){let o=a;if(typeof o.input=="string")try{o.input=JSON.parse(o.input)}catch{console.warn("Failed to parse tool input JSON:",o.input)}}}break;case"message_delta":if(r.delta.stop_reason&&(s.stop_reason=r.delta.stop_reason),r.delta.stop_sequence&&(s.stop_sequence=r.delta.stop_sequence),r.usage){let a=s.usage?.input_tokens??0;s.usage={input_tokens:r.usage.input_tokens??a,output_tokens:r.usage.output_tokens??s.usage?.output_tokens??0,cache_creation_input_tokens:r.usage.cache_creation_input_tokens??s.usage?.cache_creation_input_tokens??null,cache_read_input_tokens:r.usage.cache_read_input_tokens??s.usage?.cache_read_input_tokens??null,server_tool_use:r.usage.server_tool_use??s.usage?.server_tool_use??null,service_tier:null}}break;case"message_stop":break}return s.content=n.filter(r=>r!=null),t&&s.usage&&(s.usage.input_tokens=t.inputTokenCount,s.usage.output_tokens=t.outputTokenCount),s}extractModel(e){if(e.request?.url&&e.request.url.includes("bedrock-runtime")){let t=e.request.url.match(/\/model\/([^\/]+)/);if(t&&t[1])return this.normalizeModelName(t[1])}return e.request?.body&&typeof e.request.body=="object"&&"model"in e.request.body?this.normalizeModelName(e.request.body.model):e.response?.body&&typeof e.response.body=="object"&&"model"in e.response.body?this.normalizeModelName(e.response.body.model):"unknown"}normalizeModelName(e){if(!e)return"unknown";if(e.startsWith("us.anthropic.")){let t=e.match(/us\.anthropic\.([^:]+)/);if(t&&t[1])return t[1]}return e}mergeConversations(e,t={}){if(!e||e.length===0)return[];let s=new Map;for(let a of e){let o=a.request.system,c=a.model,h=JSON.stringify({system:o,model:c});s.has(h)||s.set(h,[]),s.get(h).push(a)}let n=[];for(let[,a]of s){let o=[...a].sort((h,p)=>new Date(h.timestamp).getTime()-new Date(p.timestamp).getTime()),c=new Map;for(let h of o){let p=h.request.messages||[];if(p.length===0)continue;let d=p[0],m=this.normalizeMessageForGrouping(d),x=JSON.stringify({firstMessage:m}),w=this.hashString(x);c.has(w)||c.set(w,[]),c.get(w).push(h)}for(let[h,p]of c){let d=[...p].sort((g,f)=>new Date(g.timestamp).getTime()-new Date(f.timestamp).getTime()),m=d.reduce((g,f)=>{let _=f.request.messages||[],E=g.request.messages||[];return _.length>E.length?f:g}),x=new Set(d.map(g=>g.model)),w=this.processToolResults(m.request.messages||[]),$={id:this.hashString(h),models:x,system:m.request.system,messages:w,response:m.response,allPairs:d,finalPair:m,metadata:{startTime:d[0].timestamp,endTime:m.timestamp,totalPairs:d.length,inputTokens:m.response.usage?.input_tokens||0,outputTokens:m.response.usage?.output_tokens||0,totalTokens:(m.response.usage?.input_tokens||0)+(m.response.usage?.output_tokens||0)}};n.push($)}}let i=this.detectAndMergeCompactConversations(n);return(t.includeShortConversations?i:i.filter(a=>a.messages.length>2)).sort((a,o)=>new Date(a.metadata.startTime).getTime()-new Date(o.metadata.startTime).getTime())}processToolResults(e){let t=[],s={};for(let n=0;n<e.length;n++){let i=e[n],r={...i,toolResults:{},hide:!1};if(Array.isArray(i.content)){let a=!0,o=!1;for(let c=0;c<i.content.length;c++){let h=i.content[c];if(h.type==="tool_use"&&"id"in h){let p=h;s[p.id]={messageIndex:n,toolIndex:c},a=!1}else if(h.type==="tool_result"&&"tool_use_id"in h){let p=h,d=p.tool_use_id;if(s[d]){let{messageIndex:m}=s[d];t[m]||(t[m]={...e[m],toolResults:{},hide:!1}),t[m].toolResults[d]=p,delete s[d]}}else h.type==="text"&&(o=!0),a=!1}a&&!o&&(r.hide=!0)}t[n]=r}return t}detectAndMergeCompactConversations(e){if(e.length<=1)return e;let t=[...e].sort((i,r)=>new Date(i.metadata.startTime).getTime()-new Date(r.metadata.startTime).getTime()),s=new Set,n=[];for(let i=0;i<t.length;i++){let r=t[i];if(!s.has(i))if(r.allPairs.length===1&&r.messages.length>2){let a=null,o=-1;for(let c=0;c<t.length;c++){if(c===i||s.has(c))continue;let h=t[c];if(h.messages.length===r.messages.length-2){let p=!0;for(let d=1;d<h.messages.length;d++)if(!this.messagesRoughlyEqual(h.messages[d],r.messages[d])){p=!1;break}if(p){a=h,o=c;break}}}if(a){let c=this.mergeCompactConversation(a,r);n.push(c),s.add(i),s.add(o)}else r.compacted=!0,n.push(r),s.add(i)}else n.push(r),s.add(i)}for(let i=0;i<t.length;i++)s.has(i)||n.push(t[i]);return n.sort((i,r)=>new Date(i.metadata.startTime).getTime()-new Date(r.metadata.startTime).getTime())}mergeCompactConversation(e,t){let s=e.messages||[],i=[...t.messages||[]];s.length>0&&i.length>0&&(i[0]=s[0]);let r=[...e.allPairs,...t.allPairs].sort((h,p)=>new Date(h.timestamp).getTime()-new Date(p.timestamp).getTime()),a=new Set([...e.models,...t.models]),o=r[0].timestamp,c=r[r.length-1].timestamp;return{id:t.id,models:a,system:e.system,messages:i,response:t.response,allPairs:r,finalPair:t.finalPair,compacted:!0,metadata:{startTime:o,endTime:c,totalPairs:r.length,inputTokens:(e.metadata.inputTokens||0)+(t.metadata.inputTokens||0),outputTokens:(e.metadata.outputTokens||0)+(t.metadata.outputTokens||0),totalTokens:(e.metadata.totalTokens||0)+(t.metadata.totalTokens||0)}}}messagesRoughlyEqual(e,t){if(e.role!==t.role)return!1;let s=e.content,n=t.content;return!(typeof s!=typeof n||Array.isArray(s)!==Array.isArray(n))}normalizeMessageForGrouping(e){if(!e||!e.content)return e;let t;return Array.isArray(e.content)?t=e.content.map(s=>{if(s.type==="text"&&"text"in s){let n=s.text;return n=n.replace(/Generated \d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/g,"Generated [TIMESTAMP]"),n=n.replace(/The user opened the file [^\s]+ in the IDE\./g,"The user opened file in IDE."),n=n.replace(/<system-reminder>.*?<\/system-reminder>/gs,"[SYSTEM-REMINDER]"),{type:"text",text:n}}return s}):t=e.content,{role:e.role,content:t}}hashString(e){let t=0;for(let s=0;s<e.length;s++){let n=e.charCodeAt(s);t=(t<<5)-t+n,t=t&t}return Math.abs(t).toString()}};var A=class extends P{constructor(){super(...arguments);this.data={rawPairs:[]};this.conversations=[];this.processedPairs=[];this.currentView="conversations";this.selectedModels=new Set}createRenderRoot(){return console.log("createRenderRoot"),this}connectedCallback(){super.connectedCallback(),this.data=window.claudeData||{rawPairs:[]},this.processData()}processData(){let t=performance.now(),s=new Ne;this.processedPairs=s.processRawPairs(this.data.rawPairs);let n=this.data.metadata?.includeAllRequests||!1;this.conversations=s.mergeConversations(this.processedPairs,{includeShortConversations:n});let i=new Set(this.conversations.flatMap(c=>Array.from(c.models))),r=new Set(this.processedPairs.map(c=>c.model)),a=new Set(this.data.rawPairs.map(c=>c.request.body?.model||"unknown")),o=new Set([...i,...r,...a]);this.selectedModels=o,console.log(`Processed data in ${performance.now()-t}ms`)}switchView(t){this.currentView=t}toggleModel(t){let s=new Set(this.selectedModels);s.has(t)?s.delete(t):s.add(t),this.selectedModels=s}get filteredConversations(){return this.conversations.filter(t=>Array.from(t.models).some(s=>this.selectedModels.has(s)))}get filteredProcessedPairs(){return this.processedPairs.filter(t=>this.selectedModels.has(t.model))}get filteredRawPairs(){return this.data.rawPairs.filter(t=>{let s=t.request.body?.model||"unknown";return this.selectedModels.has(s)})}get allRawPairs(){return this.data.rawPairs.filter(t=>t.response!==null)}get modelCounts(){let t=new Map;return this.conversations.forEach(s=>{Array.from(s.models).forEach(n=>{t.set(n,(t.get(n)||0)+1)})}),t}render(){let t=this.modelCounts,s=this.filteredConversations;return u`
<div class="min-h-screen bg-vs-bg text-vs-text font-mono">
<div class="max-w-[60em] mx-auto p-4">
<div class="mb-8">
<div class="mb-4 text-center">
<span class="text-vs-function">~ claude-traffic</span>
<span class="text-vs-muted ml-8">${this.data.timestamp||new Date().toISOString()}</span>
</div>
<div class="mb-8 text-center">
<span
@click=${()=>this.switchView("conversations")}
class="cursor-pointer mr-12 ${this.currentView==="conversations"?"text-vs-nav-active":"text-vs-text hover:text-vs-accent"}"
>
conversations (${s.length})
</span>
<span
@click=${()=>this.switchView("raw")}
class="cursor-pointer mr-12 ${this.currentView==="raw"?"text-vs-nav-active":"text-vs-text hover:text-vs-accent"}"
>
raw calls (${this.allRawPairs.length})
</span>
<span
@click=${()=>this.switchView("json")}
class="cursor-pointer mr-12 ${this.currentView==="json"?"text-vs-nav-active":"text-vs-text hover:text-vs-accent"}"
>
json debug (${this.filteredProcessedPairs.length})
</span>
</div>
${t.size>1&&this.currentView!=="raw"?u`
<div class="mb-4 text-center">
${Array.from(t.entries()).map(([n,i])=>u`
<span
@click=${()=>this.toggleModel(n)}
class="cursor-pointer hover:text-vs-accent mr-8"
>
${this.selectedModels.has(n)?"[x]":"[ ]"} ${n}
</span>
`)}
</div>
`:""}
</div>
<div>
${this.currentView==="conversations"?u`
<div id="conversations-view">
${s.length===0?u`<div>No conversations found for selected models.</div>`:u`<simple-conversation-view
.conversations=${s}
></simple-conversation-view>`}
</div>
`:""}
${this.currentView==="raw"?u`
<div id="raw-view">
${this.allRawPairs.length===0?u`<div>No raw pairs found.</div>`:u`<raw-pairs-view .rawPairs=${this.allRawPairs}></raw-pairs-view>`}
</div>
`:""}
${this.currentView==="json"?u`
<div id="json-view">
${this.filteredProcessedPairs.length===0?u`<div>No processed pairs found for selected models.</div>`:u`<json-view .processedPairs=${this.filteredProcessedPairs}></json-view>`}
</div>
`:""}
</div>
</div>
</div>
`}};S([X()],A.prototype,"data",2),S([X()],A.prototype,"conversations",2),S([X()],A.prototype,"processedPairs",2),S([X()],A.prototype,"currentView",2),S([X()],A.prototype,"selectedModels",2),A=S([H("claude-app")],A);var Ht={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},qt=l=>(...e)=>({_$litDirective$:l,values:e}),Be=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,s){this._$Ct=e,this._$AM=t,this._$Ci=s}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}};var fe=class extends Be{constructor(e){if(super(e),this.it=y,e.type!==Ht.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===y||e==null)return this._t=void 0,this.it=e;if(e===I)return e;if(typeof e!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this._t;this.it=e;let t=[e];return t.raw=t,this._t={_$litType$:this.constructor.resultType,strings:t,values:[]}}};fe.directiveName="unsafeHTML",fe.resultType=1;var U=qt(fe);var ge=class{diff(e,t,s={}){let n;typeof s=="function"?(n=s,s={}):"callback"in s&&(n=s.callback);let i=this.castInput(e,s),r=this.castInput(t,s),a=this.removeEmpty(this.tokenize(i,s)),o=this.removeEmpty(this.tokenize(r,s));return this.diffWithOptionsObj(a,o,s,n)}diffWithOptionsObj(e,t,s,n){var i;let r=f=>{if(f=this.postProcess(f,s),n){setTimeout(function(){n(f)},0);return}else return f},a=t.length,o=e.length,c=1,h=a+o;s.maxEditLength!=null&&(h=Math.min(h,s.maxEditLength));let p=(i=s.timeout)!==null&&i!==void 0?i:1/0,d=Date.now()+p,m=[{oldPos:-1,lastComponent:void 0}],x=this.extractCommon(m[0],t,e,0,s);if(m[0].oldPos+1>=o&&x+1>=a)return r(this.buildValues(m[0].lastComponent,t,e));let w=-1/0,$=1/0,g=()=>{for(let f=Math.max(w,-c);f<=Math.min($,c);f+=2){let _,E=m[f-1],M=m[f+1];E&&(m[f-1]=void 0);let qe=!1;if(M){let gt=M.oldPos-f;qe=M&&0<=gt&><a}let ft=E&&E.oldPos+1<o;if(!qe&&!ft){m[f]=void 0;continue}if(!ft||qe&&E.oldPos<M.oldPos?_=this.addToPath(M,!0,!1,0,s):_=this.addToPath(E,!1,!0,1,s),x=this.extractCommon(_,t,e,f,s),_.oldPos+1>=o&&x+1>=a)return r(this.buildValues(_.lastComponent,t,e))||!0;m[f]=_,_.oldPos+1>=o&&($=Math.min($,f-1)),x+1>=a&&(w=Math.max(w,f+1))}c++};if(n)(function f(){setTimeout(function(){if(c>h||Date.now()>d)return n(void 0);g()||f()},0)})();else for(;c<=h&&Date.now()<=d;){let f=g();if(f)return f}}addToPath(e,t,s,n,i){let r=e.lastComponent;return r&&!i.oneChangePerToken&&r.added===t&&r.removed===s?{oldPos:e.oldPos+n,lastComponent:{count:r.count+1,added:t,removed:s,previousComponent:r.previousComponent}}:{oldPos:e.oldPos+n,lastComponent:{count:1,added:t,removed:s,previousComponent:r}}}extractCommon(e,t,s,n,i){let r=t.length,a=s.length,o=e.oldPos,c=o-n,h=0;for(;c+1<r&&o+1<a&&this.equals(s[o+1],t[c+1],i);)c++,o++,h++,i.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return h&&!i.oneChangePerToken&&(e.lastComponent={count:h,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=o,c}equals(e,t,s){return s.comparator?s.comparator(e,t):e===t||!!s.ignoreCase&&e.toLowerCase()===t.toLowerCase()}removeEmpty(e){let t=[];for(let s=0;s<e.length;s++)e[s]&&t.push(e[s]);return t}castInput(e,t){return e}tokenize(e,t){return Array.from(e)}join(e){return e.join("")}postProcess(e,t){return e}get useLongestToken(){return!1}buildValues(e,t,s){let n=[],i;for(;e;)n.push(e),i=e.previousComponent,delete e.previousComponent,e=i;n.reverse();let r=n.length,a=0,o=0,c=0;for(;a<r;a++){let h=n[a];if(h.removed)h.value=this.join(s.slice(c,c+h.count)),c+=h.count;else{if(!h.added&&this.useLongestToken){let p=t.slice(o,o+h.count);p=p.map(function(d,m){let x=s[c+m];return x.length>d.length?x:d}),h.value=this.join(p)}else h.value=this.join(t.slice(o,o+h.count));o+=h.count,h.added||(c+=h.count)}}return n}};var it=class extends ge{constructor(){super(...arguments),this.tokenize=Ps}equals(e,t,s){return s.ignoreWhitespace?((!s.newlineIsToken||!e.includes(`
`))&&(e=e.trim()),(!s.newlineIsToken||!t.includes(`
`))&&(t=t.trim())):s.ignoreNewlineAtEof&&!s.newlineIsToken&&(e.endsWith(`
`)&&(e=e.slice(0,-1)),t.endsWith(`
`)&&(t=t.slice(0,-1))),super.equals(e,t,s)}},Ut=new it;function rt(l,e,t){return Ut.diff(l,e,t)}function Ps(l,e){e.stripTrailingCr&&(l=l.replace(/\r\n/g,`
`));let t=[],s=l.split(/(\n|\r\n)/);s[s.length-1]||s.pop();for(let n=0;n<s.length;n++){let i=s[n];n%2&&!e.newlineIsToken?t[t.length-1]+=i:t.push(i)}return t}function lt(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var G=lt();function Gt(l){G=l}var Zt=/[&<>"']/,As=new RegExp(Zt.source,"g"),Qt=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,Rs=new RegExp(Qt.source,"g"),Ms={"&":"&","<":"<",">":">",'"':""","'":"'"},jt=l=>Ms[l];function C(l,e){if(e){if(Zt.test(l))return l.replace(As,jt)}else if(Qt.test(l))return l.replace(Rs,jt);return l}var Ls=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function Is(l){return l.replace(Ls,(e,t)=>(t=t.toLowerCase(),t==="colon"?":":t.charAt(0)==="#"?t.charAt(1)==="x"?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""))}var Ns=/(^|[^\[])\^/g;function k(l,e){let t=typeof l=="string"?l:l.source;e=e||"";let s={replace:(n,i)=>{let r=typeof i=="string"?i:i.source;return r=r.replace(Ns,"$1"),t=t.replace(n,r),s},getRegex:()=>new RegExp(t,e)};return s}function Wt(l){try{l=encodeURI(l).replace(/%25/g,"%")}catch{return null}return l}var xe={exec:()=>null};function Ft(l,e){let t=l.replace(/\|/g,(i,r,a)=>{let o=!1,c=r;for(;--c>=0&&a[c]==="\\";)o=!o;return o?"|":" |"}),s=t.split(/ \|/),n=0;if(s[0].trim()||s.shift(),s.length>0&&!s[s.length-1].trim()&&s.pop(),e)if(s.length>e)s.splice(e);else for(;s.length<e;)s.push("");for(;n<s.length;n++)s[n]=s[n].trim().replace(/\\\|/g,"|");return s}function Oe(l,e,t){let s=l.length;if(s===0)return"";let n=0;for(;n<s;){let i=l.charAt(s-n-1);if(i===e&&!t)n++;else if(i!==e&&t)n++;else break}return l.slice(0,s-n)}function Bs(l,e){if(l.indexOf(e[1])===-1)return-1;let t=0;for(let s=0;s<l.length;s++)if(l[s]==="\\")s++;else if(l[s]===e[0])t++;else if(l[s]===e[1]&&(t--,t<0))return s;return-1}function Jt(l,e,t,s){let n=e.href,i=e.title?C(e.title):null,r=l[1].replace(/\\([\[\]])/g,"$1");if(l[0].charAt(0)!=="!"){s.state.inLink=!0;let a={type:"link",raw:t,href:n,title:i,text:r,tokens:s.inlineTokens(r)};return s.state.inLink=!1,a}return{type:"image",raw:t,href:n,title:i,text:C(r)}}function Os(l,e){let t=l.match(/^(\s+)(?:```)/);if(t===null)return e;let s=t[1];return e.split(`
`).map(n=>{let i=n.match(/^\s+/);if(i===null)return n;let[r]=i;return r.length>=s.length?n.slice(s.length):n}).join(`
`)}var ee=class{options;rules;lexer;constructor(e){this.options=e||G}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let s=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?s:Oe(s,`
`)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let s=t[0],n=Os(s,t[3]||"");return{type:"code",raw:s,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let s=t[2].trim();if(/#$/.test(s)){let n=Oe(s,"#");(this.options.pedantic||!n||/ $/.test(n))&&(s=n.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:s,tokens:this.lexer.inline(s)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let s=t[0].replace(/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,`
$1`);s=Oe(s.replace(/^ *>[ \t]?/gm,""),`
`);let n=this.lexer.state.top;this.lexer.state.top=!0;let i=this.lexer.blockTokens(s);return this.lexer.state.top=n,{type:"blockquote",raw:t[0],tokens:i,text:s}}}list(e){let t=this.rules.block.list.exec(e);if(t){let s=t[1].trim(),n=s.length>1,i={type:"list",raw:"",ordered:n,start:n?+s.slice(0,-1):"",loose:!1,items:[]};s=n?`\\d{1,9}\\${s.slice(-1)}`:`\\${s}`,this.options.pedantic&&(s=n?s:"[*+-]");let r=new RegExp(`^( {0,3}${s})((?:[ ][^\\n]*)?(?:\\n|$))`),a="",o="",c=!1;for(;e;){let h=!1;if(!(t=r.exec(e))||this.rules.block.hr.test(e))break;a=t[0],e=e.substring(a.length);let p=t[2].split(`
`,1)[0].replace(/^\t+/,g=>" ".repeat(3*g.length)),d=e.split(`
`,1)[0],m=0;this.options.pedantic?(m=2,o=p.trimStart()):(m=t[2].search(/[^ ]/),m=m>4?1:m,o=p.slice(m),m+=t[1].length);let x=!1;if(!p&&/^ *$/.test(d)&&(a+=d+`
`,e=e.substring(d.length+1),h=!0),!h){let g=new RegExp(`^ {0,${Math.min(3,m-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),f=new RegExp(`^ {0,${Math.min(3,m-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),_=new RegExp(`^ {0,${Math.min(3,m-1)}}(?:\`\`\`|~~~)`),E=new RegExp(`^ {0,${Math.min(3,m-1)}}#`);for(;e;){let M=e.split(`
`,1)[0];if(d=M,this.options.pedantic&&(d=d.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),_.test(d)||E.test(d)||g.test(d)||f.test(e))break;if(d.search(/[^ ]/)>=m||!d.trim())o+=`
`+d.slice(m);else{if(x||p.search(/[^ ]/)>=4||_.test(p)||E.test(p)||f.test(p))break;o+=`
`+d}!x&&!d.trim()&&(x=!0),a+=M+`
`,e=e.substring(M.length+1),p=d.slice(m)}}i.loose||(c?i.loose=!0:/\n *\n *$/.test(a)&&(c=!0));let w=null,$;this.options.gfm&&(w=/^\[[ xX]\] /.exec(o),w&&($=w[0]!=="[ ] ",o=o.replace(/^\[[ xX]\] +/,""))),i.items.push({type:"list_item",raw:a,task:!!w,checked:$,loose:!1,text:o,tokens:[]}),i.raw+=a}i.items[i.items.length-1].raw=a.trimEnd(),i.items[i.items.length-1].text=o.trimEnd(),i.raw=i.raw.trimEnd();for(let h=0;h<i.items.length;h++)if(this.lexer.state.top=!1,i.items[h].tokens=this.lexer.blockTokens(i.items[h].text,[]),!i.loose){let p=i.items[h].tokens.filter(m=>m.type==="space"),d=p.length>0&&p.some(m=>/\n.*\n/.test(m.raw));i.loose=d}if(i.loose)for(let h=0;h<i.items.length;h++)i.items[h].loose=!0;return i}}html(e){let t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:t[0]}}def(e){let t=this.rules.block.def.exec(e);if(t){let s=t[1].toLowerCase().replace(/\s+/g," "),n=t[2]?t[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",i=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:s,raw:t[0],href:n,title:i}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!/[:|]/.test(t[2]))return;let s=Ft(t[1]),n=t[2].replace(/^\||\| *$/g,"").split("|"),i=t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split(`
`):[],r={type:"table",raw:t[0],header:[],align:[],rows:[]};if(s.length===n.length){for(let a of n)/^ *-+: *$/.test(a)?r.align.push("right"):/^ *:-+: *$/.test(a)?r.align.push("center"):/^ *:-+ *$/.test(a)?r.align.push("left"):r.align.push(null);for(let a of s)r.header.push({text:a,tokens:this.lexer.inline(a)});for(let a of i)r.rows.push(Ft(a,r.header.length).map(o=>({text:o,tokens:this.lexer.inline(o)})));return r}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let s=t[1].charAt(t[1].length-1)===`
`?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:s,tokens:this.lexer.inline(s)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:C(t[1])}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&/^<a /i.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let s=t[2].trim();if(!this.options.pedantic&&/^</.test(s)){if(!/>$/.test(s))return;let r=Oe(s.slice(0,-1),"\\");if((s.length-r.length)%2===0)return}else{let r=Bs(t[2],"()");if(r>-1){let o=(t[0].indexOf("!")===0?5:4)+t[1].length+r;t[2]=t[2].substring(0,r),t[0]=t[0].substring(0,o).trim(),t[3]=""}}let n=t[2],i="";if(this.options.pedantic){let r=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(n);r&&(n=r[1],i=r[3])}else i=t[3]?t[3].slice(1,-1):"";return n=n.trim(),/^</.test(n)&&(this.options.pedantic&&!/>$/.test(s)?n=n.slice(1):n=n.slice(1,-1)),Jt(t,{href:n&&n.replace(this.rules.inline.anyPunctuation,"$1"),title:i&&i.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer)}}reflink(e,t){let s;if((s=this.rules.inline.reflink.exec(e))||(s=this.rules.inline.nolink.exec(e))){let n=(s[2]||s[1]).replace(/\s+/g," "),i=t[n.toLowerCase()];if(!i){let r=s[0].charAt(0);return{type:"text",raw:r,text:r}}return Jt(s,i,s[0],this.lexer)}}emStrong(e,t,s=""){let n=this.rules.inline.emStrongLDelim.exec(e);if(!n||n[3]&&s.match(/[\p{L}\p{N}]/u))return;if(!(n[1]||n[2]||"")||!s||this.rules.inline.punctuation.exec(s)){let r=[...n[0]].length-1,a,o,c=r,h=0,p=n[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(p.lastIndex=0,t=t.slice(-1*e.length+r);(n=p.exec(t))!=null;){if(a=n[1]||n[2]||n[3]||n[4]||n[5]||n[6],!a)continue;if(o=[...a].length,n[3]||n[4]){c+=o;continue}else if((n[5]||n[6])&&r%3&&!((r+o)%3)){h+=o;continue}if(c-=o,c>0)continue;o=Math.min(o,o+c+h);let d=[...n[0]][0].length,m=e.slice(0,r+n.index+d+o);if(Math.min(r,o)%2){let w=m.slice(1,-1);return{type:"em",raw:m,text:w,tokens:this.lexer.inlineTokens(w)}}let x=m.slice(2,-2);return{type:"strong",raw:m,text:x,tokens:this.lexer.inlineTokens(x)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let s=t[2].replace(/\n/g," "),n=/[^ ]/.test(s),i=/^ /.test(s)&&/ $/.test(s);return n&&i&&(s=s.substring(1,s.length-1)),s=C(s,!0),{type:"codespan",raw:t[0],text:s}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){let t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let s,n;return t[2]==="@"?(s=C(t[1]),n="mailto:"+s):(s=C(t[1]),n=s),{type:"link",raw:t[0],text:s,href:n,tokens:[{type:"text",raw:s,text:s}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let s,n;if(t[2]==="@")s=C(t[0]),n="mailto:"+s;else{let i;do i=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??"";while(i!==t[0]);s=C(t[0]),t[1]==="www."?n="http://"+t[0]:n=t[0]}return{type:"link",raw:t[0],text:s,href:n,tokens:[{type:"text",raw:s,text:s}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let s;return this.lexer.state.inRawBlock?s=t[0]:s=C(t[0]),{type:"text",raw:t[0],text:s}}}},zs=/^(?: *(?:\n|$))+/,Ds=/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,Hs=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,ke=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,qs=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Kt=/(?:[*+-]|\d{1,9}[.)])/,Xt=k(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g,Kt).replace(/blockCode/g,/ {4}/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).getRegex(),ct=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Us=/^[^\n]+/,ht=/(?!\s*\])(?:\\.|[^\[\]\\])+/,js=k(/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/).replace("label",ht).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Ws=k(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Kt).getRegex(),He="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",pt=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Fs=k("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))","i").replace("comment",pt).replace("tag",He).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Yt=k(ct).replace("hr",ke).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",He).getRegex(),Js=k(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Yt).getRegex(),ut={blockquote:Js,code:Ds,def:js,fences:Hs,heading:qs,hr:ke,html:Fs,lheading:Xt,list:Ws,newline:zs,paragraph:Yt,table:xe,text:Us},Vt=k("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",ke).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",He).getRegex(),Vs={...ut,table:Vt,paragraph:k(ct).replace("hr",ke).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Vt).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",He).getRegex()},Gs={...ut,html:k(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",pt).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:xe,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:k(ct).replace("hr",ke).replace("heading",` *#{1,6} *[^
]`).replace("lheading",Xt).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},es=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Zs=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,ts=/^( {2,}|\\)\n(?!\s*$)/,Qs=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,we="\\p{P}\\p{S}",Ks=k(/^((?![*_])[\spunctuation])/,"u").replace(/punctuation/g,we).getRegex(),Xs=/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g,Ys=k(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,"u").replace(/punct/g,we).getRegex(),en=k("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])","gu").replace(/punct/g,we).getRegex(),tn=k("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])","gu").replace(/punct/g,we).getRegex(),sn=k(/\\([punct])/,"gu").replace(/punct/g,we).getRegex(),nn=k(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),rn=k(pt).replace("(?:-->|$)","-->").getRegex(),on=k("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",rn).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),De=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,an=k(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",De).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),ss=k(/^!?\[(label)\]\[(ref)\]/).replace("label",De).replace("ref",ht).getRegex(),ns=k(/^!?\[(ref)\](?:\[\])?/).replace("ref",ht).getRegex(),ln=k("reflink|nolink(?!\\()","g").replace("reflink",ss).replace("nolink",ns).getRegex(),dt={_backpedal:xe,anyPunctuation:sn,autolink:nn,blockSkip:Xs,br:ts,code:Zs,del:xe,emStrongLDelim:Ys,emStrongRDelimAst:en,emStrongRDelimUnd:tn,escape:es,link:an,nolink:ns,punctuation:Ks,reflink:ss,reflinkSearch:ln,tag:on,text:Qs,url:xe},cn={...dt,link:k(/^!?\[(label)\]\((.*?)\)/).replace("label",De).getRegex(),reflink:k(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",De).getRegex()},ot={...dt,escape:k(es).replace("])","~|])").getRegex(),url:k(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},hn={...ot,br:k(ts).replace("{2,}","*").getRegex(),text:k(ot.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},ze={normal:ut,gfm:Vs,pedantic:Gs},ve={normal:dt,gfm:ot,breaks:hn,pedantic:cn},N=class l{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||G,this.options.tokenizer=this.options.tokenizer||new ee,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let t={block:ze.normal,inline:ve.normal};this.options.pedantic?(t.block=ze.pedantic,t.inline=ve.pedantic):this.options.gfm&&(t.block=ze.gfm,this.options.breaks?t.inline=ve.breaks:t.inline=ve.gfm),this.tokenizer.rules=t}static get rules(){return{block:ze,inline:ve}}static lex(e,t){return new l(t).lex(e)}static lexInline(e,t){return new l(t).inlineTokens(e)}lex(e){e=e.replace(/\r\n|\r/g,`
`),this.blockTokens(e,this.tokens);for(let t=0;t<this.inlineQueue.length;t++){let s=this.inlineQueue[t];this.inlineTokens(s.src,s.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[]){this.options.pedantic?e=e.replace(/\t/g," ").replace(/^ +$/gm,""):e=e.replace(/^( *)(\t+)/gm,(a,o,c)=>o+" ".repeat(c.length));let s,n,i,r;for(;e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(a=>(s=a.call({lexer:this},e,t))?(e=e.substring(s.raw.length),t.push(s),!0):!1))){if(s=this.tokenizer.space(e)){e=e.substring(s.raw.length),s.raw.length===1&&t.length>0?t[t.length-1].raw+=`
`:t.push(s);continue}if(s=this.tokenizer.code(e)){e=e.substring(s.raw.length),n=t[t.length-1],n&&(n.type==="paragraph"||n.type==="text")?(n.raw+=`
`+s.raw,n.text+=`
`+s.text,this.inlineQueue[this.inlineQueue.length-1].src=n.text):t.push(s);continue}if(s=this.tokenizer.fences(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.heading(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.hr(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.blockquote(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.list(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.html(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.def(e)){e=e.substring(s.raw.length),n=t[t.length-1],n&&(n.type==="paragraph"||n.type==="text")?(n.raw+=`
`+s.raw,n.text+=`
`+s.raw,this.inlineQueue[this.inlineQueue.length-1].src=n.text):this.tokens.links[s.tag]||(this.tokens.links[s.tag]={href:s.href,title:s.title});continue}if(s=this.tokenizer.table(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.lheading(e)){e=e.substring(s.raw.length),t.push(s);continue}if(i=e,this.options.extensions&&this.options.extensions.startBlock){let a=1/0,o=e.slice(1),c;this.options.extensions.startBlock.forEach(h=>{c=h.call({lexer:this},o),typeof c=="number"&&c>=0&&(a=Math.min(a,c))}),a<1/0&&a>=0&&(i=e.substring(0,a+1))}if(this.state.top&&(s=this.tokenizer.paragraph(i))){n=t[t.length-1],r&&n.type==="paragraph"?(n.raw+=`
`+s.raw,n.text+=`
`+s.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=n.text):t.push(s),r=i.length!==e.length,e=e.substring(s.raw.length);continue}if(s=this.tokenizer.text(e)){e=e.substring(s.raw.length),n=t[t.length-1],n&&n.type==="text"?(n.raw+=`
`+s.raw,n.text+=`
`+s.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=n.text):t.push(s);continue}if(e){let a="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let s,n,i,r=e,a,o,c;if(this.tokens.links){let h=Object.keys(this.tokens.links);if(h.length>0)for(;(a=this.tokenizer.rules.inline.reflinkSearch.exec(r))!=null;)h.includes(a[0].slice(a[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(a=this.tokenizer.rules.inline.blockSkip.exec(r))!=null;)r=r.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(a=this.tokenizer.rules.inline.anyPunctuation.exec(r))!=null;)r=r.slice(0,a.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;e;)if(o||(c=""),o=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(h=>(s=h.call({lexer:this},e,t))?(e=e.substring(s.raw.length),t.push(s),!0):!1))){if(s=this.tokenizer.escape(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.tag(e)){e=e.substring(s.raw.length),n=t[t.length-1],n&&s.type==="text"&&n.type==="text"?(n.raw+=s.raw,n.text+=s.text):t.push(s);continue}if(s=this.tokenizer.link(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(s.raw.length),n=t[t.length-1],n&&s.type==="text"&&n.type==="text"?(n.raw+=s.raw,n.text+=s.text):t.push(s);continue}if(s=this.tokenizer.emStrong(e,r,c)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.codespan(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.br(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.del(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.autolink(e)){e=e.substring(s.raw.length),t.push(s);continue}if(!this.state.inLink&&(s=this.tokenizer.url(e))){e=e.substring(s.raw.length),t.push(s);continue}if(i=e,this.options.extensions&&this.options.extensions.startInline){let h=1/0,p=e.slice(1),d;this.options.extensions.startInline.forEach(m=>{d=m.call({lexer:this},p),typeof d=="number"&&d>=0&&(h=Math.min(h,d))}),h<1/0&&h>=0&&(i=e.substring(0,h+1))}if(s=this.tokenizer.inlineText(i)){e=e.substring(s.raw.length),s.raw.slice(-1)!=="_"&&(c=s.raw.slice(-1)),o=!0,n=t[t.length-1],n&&n.type==="text"?(n.raw+=s.raw,n.text+=s.text):t.push(s);continue}if(e){let h="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(h);break}else throw new Error(h)}}return t}},te=class{options;constructor(e){this.options=e||G}code(e,t,s){let n=(t||"").match(/^\S*/)?.[0];return e=e.replace(/\n$/,"")+`
`,n?'<pre><code class="language-'+C(n)+'">'+(s?e:C(e,!0))+`</code></pre>
`:"<pre><code>"+(s?e:C(e,!0))+`</code></pre>
`}blockquote(e){return`<blockquote>
${e}</blockquote>
`}html(e,t){return e}heading(e,t,s){return`<h${t}>${e}</h${t}>
`}hr(){return`<hr>
`}list(e,t,s){let n=t?"ol":"ul",i=t&&s!==1?' start="'+s+'"':"";return"<"+n+i+`>
`+e+"</"+n+`>
`}listitem(e,t,s){return`<li>${e}</li>
`}checkbox(e){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph(e){return`<p>${e}</p>
`}table(e,t){return t&&(t=`<tbody>${t}</tbody>`),`<table>
<thead>
`+e+`</thead>
`+t+`</table>
`}tablerow(e){return`<tr>
${e}</tr>
`}tablecell(e,t){let s=t.header?"th":"td";return(t.align?`<${s} align="${t.align}">`:`<${s}>`)+e+`</${s}>
`}strong(e){return`<strong>${e}</strong>`}em(e){return`<em>${e}</em>`}codespan(e){return`<code>${e}</code>`}br(){return"<br>"}del(e){return`<del>${e}</del>`}link(e,t,s){let n=Wt(e);if(n===null)return s;e=n;let i='<a href="'+e+'"';return t&&(i+=' title="'+t+'"'),i+=">"+s+"</a>",i}image(e,t,s){let n=Wt(e);if(n===null)return s;e=n;let i=`<img src="${e}" alt="${s}"`;return t&&(i+=` title="${t}"`),i+=">",i}text(e){return e}},be=class{strong(e){return e}em(e){return e}codespan(e){return e}del(e){return e}html(e){return e}text(e){return e}link(e,t,s){return""+s}image(e,t,s){return""+s}br(){return""}},B=class l{options;renderer;textRenderer;constructor(e){this.options=e||G,this.options.renderer=this.options.renderer||new te,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new be}static parse(e,t){return new l(t).parse(e)}static parseInline(e,t){return new l(t).parseInline(e)}parse(e,t=!0){let s="";for(let n=0;n<e.length;n++){let i=e[n];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[i.type]){let r=i,a=this.options.extensions.renderers[r.type].call({parser:this},r);if(a!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(r.type)){s+=a||"";continue}}switch(i.type){case"space":continue;case"hr":{s+=this.renderer.hr();continue}case"heading":{let r=i;s+=this.renderer.heading(this.parseInline(r.tokens),r.depth,Is(this.parseInline(r.tokens,this.textRenderer)));continue}case"code":{let r=i;s+=this.renderer.code(r.text,r.lang,!!r.escaped);continue}case"table":{let r=i,a="",o="";for(let h=0;h<r.header.length;h++)o+=this.renderer.tablecell(this.parseInline(r.header[h].tokens),{header:!0,align:r.align[h]});a+=this.renderer.tablerow(o);let c="";for(let h=0;h<r.rows.length;h++){let p=r.rows[h];o="";for(let d=0;d<p.length;d++)o+=this.renderer.tablecell(this.parseInline(p[d].tokens),{header:!1,align:r.align[d]});c+=this.renderer.tablerow(o)}s+=this.renderer.table(a,c);continue}case"blockquote":{let r=i,a=this.parse(r.tokens);s+=this.renderer.blockquote(a);continue}case"list":{let r=i,a=r.ordered,o=r.start,c=r.loose,h="";for(let p=0;p<r.items.length;p++){let d=r.items[p],m=d.checked,x=d.task,w="";if(d.task){let $=this.renderer.checkbox(!!m);c?d.tokens.length>0&&d.tokens[0].type==="paragraph"?(d.tokens[0].text=$+" "+d.tokens[0].text,d.tokens[0].tokens&&d.tokens[0].tokens.length>0&&d.tokens[0].tokens[0].type==="text"&&(d.tokens[0].tokens[0].text=$+" "+d.tokens[0].tokens[0].text)):d.tokens.unshift({type:"text",text:$+" "}):w+=$+" "}w+=this.parse(d.tokens,c),h+=this.renderer.listitem(w,x,!!m)}s+=this.renderer.list(h,a,o);continue}case"html":{let r=i;s+=this.renderer.html(r.text,r.block);continue}case"paragraph":{let r=i;s+=this.renderer.paragraph(this.parseInline(r.tokens));continue}case"text":{let r=i,a=r.tokens?this.parseInline(r.tokens):r.text;for(;n+1<e.length&&e[n+1].type==="text";)r=e[++n],a+=`
`+(r.tokens?this.parseInline(r.tokens):r.text);s+=t?this.renderer.paragraph(a):a;continue}default:{let r='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(r),"";throw new Error(r)}}}return s}parseInline(e,t){t=t||this.renderer;let s="";for(let n=0;n<e.length;n++){let i=e[n];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[i.type]){let r=this.options.extensions.renderers[i.type].call({parser:this},i);if(r!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type)){s+=r||"";continue}}switch(i.type){case"escape":{let r=i;s+=t.text(r.text);break}case"html":{let r=i;s+=t.html(r.text);break}case"link":{let r=i;s+=t.link(r.href,r.title,this.parseInline(r.tokens,t));break}case"image":{let r=i;s+=t.image(r.href,r.title,r.text);break}case"strong":{let r=i;s+=t.strong(this.parseInline(r.tokens,t));break}case"em":{let r=i;s+=t.em(this.parseInline(r.tokens,t));break}case"codespan":{let r=i;s+=t.codespan(r.text);break}case"br":{s+=t.br();break}case"del":{let r=i;s+=t.del(this.parseInline(r.tokens,t));break}case"text":{let r=i;s+=t.text(r.text);break}default:{let r='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(r),"";throw new Error(r)}}}return s}},Y=class{options;constructor(e){this.options=e||G}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}},at=class{defaults=lt();options=this.setOptions;parse=this.#e(N.lex,B.parse);parseInline=this.#e(N.lexInline,B.parseInline);Parser=B;Renderer=te;TextRenderer=be;Lexer=N;Tokenizer=ee;Hooks=Y;constructor(...e){this.use(...e)}walkTokens(e,t){let s=[];for(let n of e)switch(s=s.concat(t.call(this,n)),n.type){case"table":{let i=n;for(let r of i.header)s=s.concat(this.walkTokens(r.tokens,t));for(let r of i.rows)for(let a of r)s=s.concat(this.walkTokens(a.tokens,t));break}case"list":{let i=n;s=s.concat(this.walkTokens(i.items,t));break}default:{let i=n;this.defaults.extensions?.childTokens?.[i.type]?this.defaults.extensions.childTokens[i.type].forEach(r=>{let a=i[r].flat(1/0);s=s.concat(this.walkTokens(a,t))}):i.tokens&&(s=s.concat(this.walkTokens(i.tokens,t)))}}return s}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(s=>{let n={...s};if(n.async=this.defaults.async||n.async||!1,s.extensions&&(s.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if("renderer"in i){let r=t.renderers[i.name];r?t.renderers[i.name]=function(...a){let o=i.renderer.apply(this,a);return o===!1&&(o=r.apply(this,a)),o}:t.renderers[i.name]=i.renderer}if("tokenizer"in i){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let r=t[i.level];r?r.unshift(i.tokenizer):t[i.level]=[i.tokenizer],i.start&&(i.level==="block"?t.startBlock?t.startBlock.push(i.start):t.startBlock=[i.start]:i.level==="inline"&&(t.startInline?t.startInline.push(i.start):t.startInline=[i.start]))}"childTokens"in i&&i.childTokens&&(t.childTokens[i.name]=i.childTokens)}),n.extensions=t),s.renderer){let i=this.defaults.renderer||new te(this.defaults);for(let r in s.renderer){if(!(r in i))throw new Error(`renderer '${r}' does not exist`);if(r==="options")continue;let a=r,o=s.renderer[a],c=i[a];i[a]=(...h)=>{let p=o.apply(i,h);return p===!1&&(p=c.apply(i,h)),p||""}}n.renderer=i}if(s.tokenizer){let i=this.defaults.tokenizer||new ee(this.defaults);for(let r in s.tokenizer){if(!(r in i))throw new Error(`tokenizer '${r}' does not exist`);if(["options","rules","lexer"].includes(r))continue;let a=r,o=s.tokenizer[a],c=i[a];i[a]=(...h)=>{let p=o.apply(i,h);return p===!1&&(p=c.apply(i,h)),p}}n.tokenizer=i}if(s.hooks){let i=this.defaults.hooks||new Y;for(let r in s.hooks){if(!(r in i))throw new Error(`hook '${r}' does not exist`);if(r==="options")continue;let a=r,o=s.hooks[a],c=i[a];Y.passThroughHooks.has(r)?i[a]=h=>{if(this.defaults.async)return Promise.resolve(o.call(i,h)).then(d=>c.call(i,d));let p=o.call(i,h);return c.call(i,p)}:i[a]=(...h)=>{let p=o.apply(i,h);return p===!1&&(p=c.apply(i,h)),p}}n.hooks=i}if(s.walkTokens){let i=this.defaults.walkTokens,r=s.walkTokens;n.walkTokens=function(a){let o=[];return o.push(r.call(this,a)),i&&(o=o.concat(i.call(this,a))),o}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return N.lex(e,t??this.defaults)}parser(e,t){return B.parse(e,t??this.defaults)}#e(e,t){return(s,n)=>{let i={...n},r={...this.defaults,...i};this.defaults.async===!0&&i.async===!1&&(r.silent||console.warn("marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored."),r.async=!0);let a=this.#t(!!r.silent,!!r.async);if(typeof s>"u"||s===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof s!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(s)+", string expected"));if(r.hooks&&(r.hooks.options=r),r.async)return Promise.resolve(r.hooks?r.hooks.preprocess(s):s).then(o=>e(o,r)).then(o=>r.hooks?r.hooks.processAllTokens(o):o).then(o=>r.walkTokens?Promise.all(this.walkTokens(o,r.walkTokens)).then(()=>o):o).then(o=>t(o,r)).then(o=>r.hooks?r.hooks.postprocess(o):o).catch(a);try{r.hooks&&(s=r.hooks.preprocess(s));let o=e(s,r);r.hooks&&(o=r.hooks.processAllTokens(o)),r.walkTokens&&this.walkTokens(o,r.walkTokens);let c=t(o,r);return r.hooks&&(c=r.hooks.postprocess(c)),c}catch(o){return a(o)}}}#t(e,t){return s=>{if(s.message+=`
Please report this to https://github.com/markedjs/marked.`,e){let n="<p>An error occurred:</p><pre>"+C(s.message+"",!0)+"</pre>";return t?Promise.resolve(n):n}if(t)return Promise.reject(s);throw s}}},V=new at;function v(l,e){return V.parse(l,e)}v.options=v.setOptions=function(l){return V.setOptions(l),v.defaults=V.defaults,Gt(v.defaults),v};v.getDefaults=lt;v.defaults=G;v.use=function(...l){return V.use(...l),v.defaults=V.defaults,Gt(v.defaults),v};v.walkTokens=function(l,e){return V.walkTokens(l,e)};v.parseInline=V.parseInline;v.Parser=B;v.parser=B.parse;v.Renderer=te;v.TextRenderer=be;v.Lexer=N;v.lexer=N.lex;v.Tokenizer=ee;v.Hooks=Y;v.parse=v;var qi=v.options,Ui=v.setOptions,ji=v.use,Wi=v.walkTokens,Fi=v.parseInline;var Ji=B.parse,Vi=N.lex;v.setOptions({gfm:!0,breaks:!0});function is(l){return l.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function O(l){if(!l)return"";try{let e=is(l);return v(e)}catch(e){return console.warn("Failed to parse markdown:",e),is(l).replace(/\n/g,"<br>")}}var ye=class extends P{constructor(){super(...arguments);this.conversations=[]}createRenderRoot(){return this}handleToggle(t,s={}){let{type:n="content",targetSelector:i,toggleSelector:r,customHandler:a}=s,o=t.currentTarget;if(n==="write"){let p=o.previousElementSibling;p&&(!p.classList.contains("hidden")?(p.classList.add("hidden"),o.classList.remove("hidden")):(p.classList.remove("hidden"),o.classList.add("hidden")));return}let c=i?o.querySelector(i):o.nextElementSibling,h=r?o.querySelector(r):o.querySelector("span:first-child");if(c){let p=c.classList.contains("hidden");a?a(c,p):(c.classList.toggle("hidden",!p),h&&(h.textContent=p?"[-]":"[+]"))}}toggleContent(t){this.handleToggle(t)}toggleWriteContent(t){this.handleToggle(t,{type:"write"})}formatContent(t,s){return typeof t=="string"?this.formatStringContent(t):Array.isArray(t)?u`
${t.map(n=>{if(n.type==="text")return this.formatStringContent(n.text);if(n.type==="thinking")return u`
<div class="mt-4 mb-4">
<div class="text-gray-500 italic">
<em>Thinking</em>
</div>
<div class="text-gray-400 mt-2 markdown-content">
${U(O(n.thinking||""))}
</div>
</div>
`;if(n.type==="tool_result")return u``;if(n.type==="tool_use"){let r=s?.[n.id];if(n.name==="TodoWrite"||n.name==="Edit"||n.name==="MultiEdit")return this.renderToolContainer(n,r);if(n.name==="Write"){let a=u`
<div class="bg-vs-bg-secondary p-4 text-vs-text hidden">
${this.renderToolUseContent(n)}
</div>
<div
class="bg-vs-bg-secondary mx-4 p-4 text-vs-text cursor-pointer hover:bg-vs-border transition-colors"
@click=${this.toggleWriteContent}
>
${this.renderWritePreview(n)}
</div>
`;return u`
<div class="mt-4 mb-4">
<div class="text-vs-type px-4 break-all">${this.getToolDisplayName(n)}</div>
${a} ${r?this.renderToolResult(r,n):""}
</div>
`}return this.renderToolContainer(n,r,{isCollapsible:!0,isCollapsed:!0,isClickToExpand:!0})}return u`<pre class="mb-4">${JSON.stringify(n,null,2)}</pre>`})}
`:u`<pre>${JSON.stringify(t,null,2)}</pre>`}formatStringContent(t){let s=/<system-reminder>([\s\S]*?)<\/system-reminder>/g,n=/<system-reminder>([\s\S]*?)<\/system-reminder>/g,i=[],r;for(;(r=s.exec(t))!==null;)i.push(r[1].trim());for(;(r=n.exec(t))!==null;)i.push(r[1].trim());let a=t.replace(s,"").replace(n,"").trim();return u`
${a?u`<div class="mt-4 markdown-content">${U(O(a))}</div>`:""}
${i.length>0?this.renderCollapsibleSection("System Reminder",u`<div class="text-vs-muted">
${i.map((o,c)=>u`
<div class="mb-4">
${i.length>1?u`<div class="text-vs-function font-bold mb-2">Reminder ${c+1}:</div>`:""}
<div class="markdown-content">${U(O(o))}</div>
</div>
`)}
</div>`,{titleClasses:"text-vs-muted",containerClasses:"mt-4 mb-4",count:i.length>1?i.length:void 0}):""}
`}formatSystem(t){if(!t)return"";if(typeof t=="string")return O(t);if(Array.isArray(t)){let s=t.map(n=>n.type==="text"?n.text:JSON.stringify(n,null,2)).join(`
`);return O(s)}return JSON.stringify(t,null,2)}formatResponseContent(t){return t?t.content&&Array.isArray(t.content)?u`
${t.content.map(s=>s.type==="text"?u`<div class="mt-4 markdown-content">${U(O(s.text))}</div>`:s.type==="thinking"?u`
<div class="mt-4 mb-4">
<div class="text-gray-500 italic">
<em>Thinking</em>
</div>
<div class="text-gray-400 mt-2 markdown-content">
${U(O(s.thinking||""))}
</div>
</div>
`:s.type==="tool_use"?s.name==="TodoWrite"?u`
<div class="mt-4 mb-4">
<div class="text-vs-type px-4 break-all">${this.getToolDisplayName(s)}</div>
<div class="bg-vs-bg-secondary mx-4 p-4 text-vs-text">
${this.renderToolUseContent(s)}
</div>
</div>
`:u`
<div class="mt-4 mb-4">
<div
class="text-vs-type px-4 py-2 break-all cursor-pointer hover:text-white transition-colors"
@click=${this.toggleContent}
>
<span class="mr-2">[+]</span>
${this.getToolDisplayName(s)}
</div>
<div class="bg-vs-bg-secondary mx-4 p-4 text-vs-text hidden">
${this.renderToolUseContent(s)}
</div>
</div>
`:u`<pre class="mb-4">${JSON.stringify(s,null,2)}</pre>`)}
`:u`<pre>${JSON.stringify(t,null,2)}</pre>`:u``}formatSingleParam(t,s,n=""){return s?u`${t}(<span class="text-vs-text">${this.unescapeHtml(s)}</span>)`:u`${t}`}formatMultiParam(t,s){return s.length>0?u`${t}(<span class="text-vs-text">${s.join(", ")}</span>)`:u`${t}`}unescapeHtml(t){let s=document.createElement("div");return s.innerHTML=t,s.textContent||s.innerText||""}wrapInScrollable(t,s=!0){return s&&typeof t=="string"?u`
<div class="overflow-x-auto">
<pre class="text-vs-text m-0" style="white-space: pre; font-family: monospace;">${t}</pre>
</div>
`:u` <div class="overflow-x-auto">${t}</div> `}renderCollapsibleSection(t,s,n={}){let{isExpanded:i=!1,titleClasses:r="",containerClasses:a="",count:o}=n,c=i?"":"hidden",h=i?"[-]":"[+]",p=o!==void 0?`${t} (${o})`:t;return u`
<div class="${a}">
<div class="cursor-pointer hover:text-white transition-colors ${r}" @click=${this.toggleContent}>
<span class="mr-2">${h}</span>
<span>${p}</span>
</div>
<div class="${c} mt-4">${s}</div>
</div>
`}getToolDisplayName(t,s){let n=t.name,i=t.input;switch(n){case"Read":return this.formatSingleParam(n,i?.file_path);case"Bash":return this.formatSingleParam(n,i?.command);case"Write":return this.formatSingleParam(n,i?.file_path);case"Glob":if(i?.pattern){let r=[this.unescapeHtml(i.pattern)];return i?.path&&r.push(this.unescapeHtml(i.path)),this.formatMultiParam(n,r)}return u`${n}`;case"Grep":if(i?.pattern){let r=[this.unescapeHtml(i.pattern)];return i?.include&&r.push(this.unescapeHtml(i.include)),i?.path&&r.push(this.unescapeHtml(i.path)),this.formatMultiParam(n,r)}return u`${n}`;case"LS":if(i?.path){let r=[this.unescapeHtml(i.path)];if(i?.ignore){let a=i.ignore.map(o=>this.unescapeHtml(o)).join(", ");r.push(`ignore: ${a}`)}return this.formatMultiParam(n,r)}return u`${n}`;case"Edit":return i?.file_path?this.formatSingleParam(n,this.unescapeHtml(i.file_path).split("/").pop()):u`${n}`;case"MultiEdit":if(i?.file_path){let r=this.unescapeHtml(i.file_path).split("/").pop()||i.file_path,a=i?.edits?i.edits.length:0;return this.formatMultiParam(n,[r,`${a} edits`])}return u`${n}`;case"NotebookRead":return i?.notebook_path?this.formatSingleParam(n,this.unescapeHtml(i.notebook_path).split("/").pop()):u`${n}`;case"NotebookEdit":if(i?.notebook_path&&i?.cell_number!==void 0){let r=this.unescapeHtml(i.notebook_path).split("/").pop(),a=i.cell_number,o=i?.edit_mode||"replace";return this.formatMultiParam(n,[r,`cell ${a}`,o])}return u`${n}`;case"WebFetch":return i?.url?this.formatSingleParam(n,i.url):u`${n}`;case"WebSearch":return i?.query?this.formatSingleParam(n,i.query):u`${n}`;default:return u`${n}`}}renderToolUseContent(t){let s=t.name,n=t.input;if(s==="TodoWrite"&&n?.todos){let i=n.todos;return this.wrapInScrollable(u`${i.map(r=>{let a=r.status==="completed"?"line-through text-vs-text":r.status==="in_progress"?"text-green-400":"text-vs-muted";return u`
<div class="overflow-hidden whitespace-nowrap text-ellipsis ${a}">• ${r.content}</div>
`})}`,!1)}if(s==="NotebookEdit"&&n?.new_source){let i=n.new_source;return this.wrapInScrollable(i)}if(s==="Write"&&n?.content){let i=n.content;return this.wrapInScrollable(i)}if(s==="MultiEdit"&&n?.edits){let i=n.edits;return this.wrapInScrollable(u`${i.map((r,a)=>{let o=r.old_string,c=r.new_string,h=this.renderDiff(o,c);return u`
<div class="mb-4">
<div class="text-vs-muted mb-2">Edit ${a+1}:</div>
<div>${h}</div>
</div>
`})}`,!1)}if(s==="Edit"&&n?.old_string&&n?.new_string){let i=n.old_string,r=n.new_string,a=this.renderDiff(i,r);return this.wrapInScrollable(u`${a}`,!1)}if(s==="WebFetch"&&n?.url&&n?.prompt)return this.wrapInScrollable(u`
<div class="mb-3">
<div class="text-vs-muted mb-1">URL:</div>
<div class="text-vs-text">${n.url}</div>
</div>
<div>
<div class="text-vs-muted mb-1">Prompt:</div>
<div class="text-vs-text">${n.prompt}</div>
</div>
`,!1);if(s==="WebSearch"&&n?.query){let i=[];return i.push(u`
<div class="mb-3">
<div class="text-vs-muted mb-1">Query:</div>
<div class="text-vs-text">${n.query}</div>
</div>
`),n?.allowed_domains&&i.push(u`
<div class="mb-3">
<div class="text-vs-muted mb-1">Allowed Domains:</div>
<div class="text-vs-text">${n.allowed_domains.join(", ")}</div>
</div>
`),n?.blocked_domains&&i.push(u`
<div class="mb-3">
<div class="text-vs-muted mb-1">Blocked Domains:</div>
<div class="text-vs-text">${n.blocked_domains.join(", ")}</div>
</div>
`),this.wrapInScrollable(u`${i}`,!1)}return this.wrapInScrollable(JSON.stringify(n,null,2))}renderToolResult(t,s){return u`
<div class="mb-4">
<div
class="text-vs-muted px-4 pb-0 cursor-pointer hover:text-white transition-colors"
@click=${this.toggleContent}
>
<span class="mr-2">[+]</span>
Tool Result ${t?.is_error?"\u274C":"\u2705"}
</div>
<div class="bg-vs-bg-secondary mx-4 p-4 text-vs-text hidden overflow-x-auto">
<pre class="whitespace-pre overflow-x-auto" style="white-space: pre; font-family: monospace;">
${typeof t.content=="string"?t.content:JSON.stringify(t.content,null,2)}</pre
>
</div>
${s?u`
<div>
<div
class="text-vs-muted px-4 cursor-pointer hover:text-white transition-colors"
@click=${this.toggleContent}
>
<span class="mr-2">[+]</span>
Raw Tool Call
</div>
<div class="bg-vs-bg-secondary mx-4 p-4 text-vs-text hidden">
${this.wrapInScrollable(JSON.stringify(s,null,2))}
</div>
</div>
`:""}
</div>
`}renderToolContainer(t,s,n={}){let{isCollapsible:i=!1,isCollapsed:r=!1,isClickToExpand:a=!1,customContent:o}=n,c=o||u`${this.renderToolUseContent(t)}`,h=a?"text-vs-type px-4 break-all cursor-pointer hover:text-white transition-colors":"text-vs-type px-4 break-all",p=r?"bg-vs-bg-secondary mx-4 p-4 text-vs-text hidden":"bg-vs-bg-secondary mx-4 p-4 text-vs-text";return u`
<div class="mt-4 mb-4">
<div class="${h}" @click=${a?this.toggleContent:void 0}>
${i?u`<span class="mr-2">[${r?"+":"-"}]</span>`:""}
${this.getToolDisplayName(t)}
</div>
<div class="${p}">${c}</div>
${s?this.renderToolResult(s,t):""}
</div>
`}renderWritePreview(t){let s=t.input;if(!s?.content)return u`<div class="text-vs-muted">No content</div>`;let i=s.content.split(`
`),r=i.slice(0,10),a=i.length>10;return u`
${this.wrapInScrollable(r.join(`
`))}
${a?u`<div class="text-vs-muted">... ${i.length-10} more lines (click to expand)</div>`:""}
`}renderDiff(t,s){let n=rt(t,s),i=[];for(let r of n){let a=r.value.split(`
`);a[a.length-1]===""&&a.pop();for(let o of a)r.added?i.push(u`<div class="bg-green-600/20"><pre class="text-vs-text m-0">+ ${o}</pre></div>`):r.removed?i.push(u`<div class="bg-red-600/20"><pre class="text-vs-text m-0">- ${o}</pre></div>`):i.push(u`<div><pre class="text-vs-text m-0"> ${o}</pre></div>`)}return i}hasTools(t){return!!(t.finalPair.request.tools&&t.finalPair.request.tools.length>0)}renderTools(t){return u`
${t.map(s=>{if("name"in s&&s.name){let n="description"in s&&s.description||"No description";return this.renderCollapsibleSection(s.name,u`
<div class="text-vs-text ml-4 mb-3 markdown-content">
${U(O(n))}
</div>
${"input_schema"in s&&s.input_schema&&typeof s.input_schema=="object"?(()=>{let i=s.input_schema;return i.properties?u`
<div class="text-vs-muted mb-2">Parameters:</div>
${Object.entries(i.properties).map(([r,a])=>{let o=a,c=i.required?.includes(r)?" (required)":"",h=o.type?` [${o.type}]`:"",p=o.description?` - ${o.description}`:"";return u`
<div class="ml-4 mb-1">
<span class="text-vs-user">${r}</span>
<span class="text-vs-muted">${h}${c}${p}</span>
</div>
`})}
`:u``})():u``}
`,{titleClasses:"text-vs-type font-bold",containerClasses:"mb-4",isExpanded:!0})}return u`<pre class="mb-4">${JSON.stringify(s,null,2)}</pre>`})}
`}renderConversationContent(t){return u`
<!-- System Prompt (Expandable) -->
${t.system?this.renderCollapsibleSection("System Prompt",u`<div class="text-vs-text markdown-content mb-4">
${U(this.formatSystem(t.system))}
</div>`,{titleClasses:"text-vs-function",containerClasses:"px-4 mt-4"}):""}
<!-- Tools (Expandable) -->
${this.hasTools(t)?this.renderCollapsibleSection("Tools",u`<div class="ml-4">
<div class="text-vs-text">${this.renderTools(t.finalPair.request.tools||[])}</div>
</div>`,{titleClasses:"text-vs-type",containerClasses:"px-4",count:t.finalPair.request.tools?.length||0}):""}
<!-- Conversation Messages -->
<div class="px-4 mt-4">
${t.messages.filter(s=>!s.hide).map((s,n)=>u`
<div class="mb-4">
<div
class="font-bold uppercase ${s.role==="user"?"text-vs-user":"text-vs-assistant"}"
>
<span>${s.role}</span>
</div>
<div class="text-vs-text">
${this.formatContent(s.content,s.toolResults)}
</div>
</div>
`)}
<!-- Assistant Response -->
<div class="mb-4">
<div class="font-bold uppercase text-vs-assistant">
<span>assistant</span>
</div>
<div class="text-vs-text">${this.formatResponseContent(t.response)}</div>
</div>
</div>
`}render(){return this.conversations.length===0?u`<div>No conversations found.</div>`:u`
<div class="max-w-[60em] mx-auto">
${this.conversations.map(t=>u`
<div class="mt-8 first:mt-0">
${t.compacted?u`
<!-- Compacted Conversation (Collapsed) -->
<div
class="cursor-pointer text-red-400 hover:text-red-300 transition-colors border border-red-700 p-4"
@click=${this.toggleContent}
>
<span class="mr-2">[+]</span>
<span>Compacted (click to view details)</span>
</div>
<div class="hidden mt-8">
<!-- Conversation Header -->
<div class="border border-red-700 p-4 mb-0">
<div class="text-red-400">${Array.from(t.models).join(", ")}</div>
<div class="text-vs-muted">
${new Date(t.metadata.startTime).toLocaleString()}
<span class="ml-4">${t.messages.length+1} messages</span>
</div>
</div>
${this.renderConversationContent(t)}
</div>
`:u`
<!-- Regular Conversation -->
<!-- Conversation Header -->
<div class="border border-vs-highlight p-4 mb-0">
<div class="text-vs-assistant">${Array.from(t.models).join(", ")}</div>
<div class="text-vs-muted">
${new Date(t.metadata.startTime).toLocaleString()}
<span class="ml-4">${t.messages.length+1} messages</span>
</div>
</div>
${this.renderConversationContent(t)}
`}
</div>
`)}
</div>
`}};S([q({type:Array})],ye.prototype,"conversations",2),ye=S([H("simple-conversation-view")],ye);var _e=class extends P{constructor(){super(...arguments);this.rawPairs=[]}createRenderRoot(){return this}render(){if(this.rawPairs.length===0)return u`<div class="text-vs-muted">No raw pairs found.</div>`;let t=this.rawPairs.filter(s=>s.response!==null);return u`
<div>
${t.map((s,n)=>u`
<div class="mt-8 first:mt-0">
<!-- Pair Header -->
<div class="border border-vs-highlight p-4 mb-0">
<div class="text-vs-assistant font-bold">
${s.request.method} ${this.getUrlPath(s.request.url)}
</div>
<div class="text-vs-muted">
Raw Pair ${n+1} • ${this.getModelName(s)} • Status ${s.response.status_code} •
${new Date(s.logged_at).toLocaleString()}
</div>
</div>
<!-- Request Section -->
<div class="px-4 mt-4">
<div class="mb-4">
<div
class="cursor-pointer text-vs-user font-bold hover:text-white transition-colors"
@click=${i=>this.toggleContent(i)}
>
<span class="mr-2">[+]</span>
<span>Request</span>
</div>
<div class="hidden mt-2">
<div class="bg-vs-bg-secondary p-4 text-vs-text overflow-x-auto">
<pre class="whitespace-pre text-vs-text m-0">${this.formatJson(s.request)}</pre>
</div>
</div>
</div>
<!-- Response Section -->
<div class="mb-4">
<div
class="cursor-pointer text-vs-assistant font-bold hover:text-white transition-colors"
@click=${i=>this.toggleContent(i)}
>
<span class="mr-2">[+]</span>
<span>Response</span>
</div>
<div class="hidden mt-2">
<div class="bg-vs-bg-secondary p-4 text-vs-text overflow-x-auto">
<pre class="whitespace-pre text-vs-text m-0">${this.formatJson(s.response)}</pre>
</div>
</div>
</div>
<!-- SSE Events Section -->
${s.response.events&&s.response.events.length>0?u`
<div class="mb-4">
<div
class="cursor-pointer text-vs-type font-bold hover:text-white transition-colors"
@click=${i=>this.toggleContent(i)}
>
<span class="mr-2">[+]</span>
<span>SSE Events (${s.response.events.length})</span>
</div>
<div class="hidden mt-2">
<div class="bg-vs-bg-secondary p-4 text-vs-text overflow-x-auto">
<pre class="whitespace-pre text-vs-text m-0">
${this.formatJson(s.response.events)}</pre
>
</div>
</div>
</div>
`:""}
</div>
</div>
`)}
</div>
`}getUrlPath(t){try{return new URL(t).pathname}catch{return t}}getModelName(t){if(t.request.url&&t.request.url.includes("bedrock-runtime")){let s=t.request.url.match(/\/model\/([^\/]+)/);if(s&&s[1])return this.normalizeModelName(s[1])}return t.request.body&&t.request.body.model?this.normalizeModelName(t.request.body.model):"unknown"}normalizeModelName(t){if(!t)return"unknown";if(t.startsWith("us.anthropic.")){let s=t.match(/us\.anthropic\.([^:]+)/);if(s&&s[1])return s[1]}return t}formatJson(t){try{return JSON.stringify(t,null,2)}catch{return String(t)}}toggleContent(t){let s=t.currentTarget,n=s.nextElementSibling,i=s.querySelector("span:first-child");if(n&&i){let r=n.classList.contains("hidden");n.classList.toggle("hidden",!r),i.textContent=r?"[-]":"[+]"}}};S([q({type:Array})],_e.prototype,"rawPairs",2),_e=S([H("raw-pairs-view")],_e);var $e=class extends P{constructor(){super(...arguments);this.processedPairs=[]}createRenderRoot(){return this}render(){return this.processedPairs.length===0?u`<div class="text-vs-muted">No processed pairs found.</div>`:u`
<div>
${this.processedPairs.map((t,s)=>u`
<div class="mt-8 first:mt-0">
<!-- Pair Header -->
<div class="border border-vs-highlight p-4 mb-0">
<div class="text-vs-assistant font-bold">${t.model}</div>
<div class="text-vs-muted">
Pair ${s+1} • ${t.isStreaming?"streaming":"non-streaming"} •
${new Date(t.timestamp).toLocaleString()}
</div>
</div>
<!-- Request Section -->
<div class="px-4 mt-4">
<div class="mb-4">
<div
class="cursor-pointer text-vs-user font-bold hover:text-white transition-colors"
@click=${n=>this.toggleContent(n)}
>
<span class="mr-2">[+]</span>
<span>Request (MessageCreateParams)</span>
</div>
<div class="hidden mt-2">
<div class="bg-vs-bg-secondary p-4 text-vs-text overflow-x-auto">
<pre class="whitespace-pre text-vs-text m-0">${this.formatJson(t.request)}</pre>
</div>
</div>
</div>
<!-- Response Section -->
<div class="mb-4">
<div
class="cursor-pointer text-vs-assistant font-bold hover:text-white transition-colors"
@click=${n=>this.toggleContent(n)}
>
<span class="mr-2">[+]</span>
<span>Response (Message)${t.isStreaming?" - Reconstructed from SSE":""}</span>
</div>
<div class="hidden mt-2">
<div class="bg-vs-bg-secondary p-4 text-vs-text overflow-x-auto">
<pre class="whitespace-pre text-vs-text m-0">${this.formatJson(t.response)}</pre>
</div>
</div>
</div>
</div>
</div>
`)}
</div>
`}formatJson(t){try{return JSON.stringify(t,null,2)}catch(s){return`Error formatting JSON: ${s}`}}toggleContent(t){let s=t.currentTarget,n=s.nextElementSibling,i=s.querySelector("span:first-child");if(n&&i){let r=n.classList.contains("hidden");n.classList.toggle("hidden",!r),i.textContent=r?"[-]":"[+]"}}};S([q({type:Array})],$e.prototype,"processedPairs",2),$e=S([H("json-view")],$e);var mt=`*, ::before, ::after {
--tw-border-spacing-x: 0;
--tw-border-spacing-y: 0;
--tw-translate-x: 0;
--tw-translate-y: 0;
--tw-rotate: 0;
--tw-skew-x: 0;
--tw-skew-y: 0;
--tw-scale-x: 1;
--tw-scale-y: 1;
--tw-pan-x: ;
--tw-pan-y: ;
--tw-pinch-zoom: ;
--tw-scroll-snap-strictness: proximity;
--tw-gradient-from-position: ;
--tw-gradient-via-position: ;
--tw-gradient-to-position: ;
--tw-ordinal: ;
--tw-slashed-zero: ;
--tw-numeric-figure: ;
--tw-numeric-spacing: ;
--tw-numeric-fraction: ;
--tw-ring-inset: ;
--tw-ring-offset-width: 0px;
--tw-ring-offset-color: #fff;
--tw-ring-color: rgb(59 130 246 / 0.5);
--tw-ring-offset-shadow: 0 0 #0000;
--tw-ring-shadow: 0 0 #0000;
--tw-shadow: 0 0 #0000;
--tw-shadow-colored: 0 0 #0000;
--tw-blur: ;
--tw-brightness: ;
--tw-contrast: ;
--tw-grayscale: ;
--tw-hue-rotate: ;
--tw-invert: ;
--tw-saturate: ;
--tw-sepia: ;
--tw-drop-shadow: ;
--tw-backdrop-blur: ;
--tw-backdrop-brightness: ;
--tw-backdrop-contrast: ;
--tw-backdrop-grayscale: ;
--tw-backdrop-hue-rotate: ;
--tw-backdrop-invert: ;
--tw-backdrop-opacity: ;
--tw-backdrop-saturate: ;
--tw-backdrop-sepia: ;
--tw-contain-size: ;
--tw-contain-layout: ;
--tw-contain-paint: ;
--tw-contain-style: ;
}
::backdrop {
--tw-border-spacing-x: 0;
--tw-border-spacing-y: 0;
--tw-translate-x: 0;
--tw-translate-y: 0;
--tw-rotate: 0;
--tw-skew-x: 0;
--tw-skew-y: 0;
--tw-scale-x: 1;
--tw-scale-y: 1;
--tw-pan-x: ;
--tw-pan-y: ;
--tw-pinch-zoom: ;
--tw-scroll-snap-strictness: proximity;
--tw-gradient-from-position: ;
--tw-gradient-via-position: ;
--tw-gradient-to-position: ;
--tw-ordinal: ;
--tw-slashed-zero: ;
--tw-numeric-figure: ;
--tw-numeric-spacing: ;
--tw-numeric-fraction: ;
--tw-ring-inset: ;
--tw-ring-offset-width: 0px;
--tw-ring-offset-color: #fff;
--tw-ring-color: rgb(59 130 246 / 0.5);
--tw-ring-offset-shadow: 0 0 #0000;
--tw-ring-shadow: 0 0 #0000;
--tw-shadow: 0 0 #0000;
--tw-shadow-colored: 0 0 #0000;
--tw-blur: ;
--tw-brightness: ;
--tw-contrast: ;
--tw-grayscale: ;
--tw-hue-rotate: ;
--tw-invert: ;
--tw-saturate: ;
--tw-sepia: ;
--tw-drop-shadow: ;
--tw-backdrop-blur: ;
--tw-backdrop-brightness: ;
--tw-backdrop-contrast: ;
--tw-backdrop-grayscale: ;
--tw-backdrop-hue-rotate: ;
--tw-backdrop-invert: ;
--tw-backdrop-opacity: ;
--tw-backdrop-saturate: ;
--tw-backdrop-sepia: ;
--tw-contain-size: ;
--tw-contain-layout: ;
--tw-contain-paint: ;
--tw-contain-style: ;
}
/*
! tailwindcss v3.4.17 | MIT License | https://tailwindcss.com
*/
/*
1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4)
2. Allow adding a border to an element by just adding a border-width. (https://github.com/tailwindcss/tailwindcss/pull/116)
*/
*,
::before,
::after {
box-sizing: border-box;
/* 1 */
border-width: 0;
/* 2 */
border-style: solid;
/* 2 */
border-color: #e5e7eb;
/* 2 */
}
::before,
::after {
--tw-content: '';
}
/*
1. Use a consistent sensible line-height in all browsers.
2. Prevent adjustments of font size after orientation changes in iOS.
3. Use a more readable tab size.
4. Use the user's configured \`sans\` font-family by default.
5. Use the user's configured \`sans\` font-feature-settings by default.
6. Use the user's configured \`sans\` font-variation-settings by default.
7. Disable tap highlights on iOS
*/
html,
:host {
line-height: 1.5;
/* 1 */
-webkit-text-size-adjust: 100%;
/* 2 */
-moz-tab-size: 4;
/* 3 */
-o-tab-size: 4;
tab-size: 4;
/* 3 */
font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
/* 4 */
font-feature-settings: normal;
/* 5 */
font-variation-settings: normal;
/* 6 */
-webkit-tap-highlight-color: transparent;
/* 7 */
}
/*
1. Remove the margin in all browsers.
2. Inherit line-height from \`html\` so users can set them as a class directly on the \`html\` element.
*/
body {
margin: 0;
/* 1 */
line-height: inherit;
/* 2 */
}
/*
1. Add the correct height in Firefox.
2. Correct the inheritance of border color in Firefox. (https://bugzilla.mozilla.org/show_bug.cgi?id=190655)
3. Ensure horizontal rules are visible by default.
*/
hr {
height: 0;
/* 1 */
color: inherit;
/* 2 */
border-top-width: 1px;
/* 3 */
}
/*
Add the correct text decoration in Chrome, Edge, and Safari.
*/
abbr:where([title]) {
-webkit-text-decoration: underline dotted;
text-decoration: underline dotted;
}
/*
Remove the default font size and weight for headings.
*/
h1,
h2,
h3,
h4,
h5,
h6 {
font-size: inherit;
font-weight: inherit;
}
/*
Reset links to optimize for opt-in styling instead of opt-out.
*/
a {
color: inherit;
text-decoration: inherit;
}
/*
Add the correct font weight in Edge and Safari.
*/
b,
strong {
font-weight: bolder;
}
/*
1. Use the user's configured \`mono\` font-family by default.
2. Use the user's configured \`mono\` font-feature-settings by default.
3. Use the user's configured \`mono\` font-variation-settings by default.
4. Correct the odd \`em\` font sizing in all browsers.
*/
code,
kbd,
samp,
pre {
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
/* 1 */
font-feature-settings: normal;
/* 2 */
font-variation-settings: normal;
/* 3 */
font-size: 1em;
/* 4 */
}
/*
Add the correct font size in all browsers.
*/
small {
font-size: 80%;
}
/*
Prevent \`sub\` and \`sup\` elements from affecting the line height in all browsers.
*/
sub,
sup {
font-size: 75%;
line-height: 0;
position: relative;
vertical-align: baseline;
}
sub {
bottom: -0.25em;
}
sup {
top: -0.5em;
}
/*
1. Remove text indentation from table contents in Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=999088, https://bugs.webkit.org/show_bug.cgi?id=201297)
2. Correct table border color inheritance in all Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=935729, https://bugs.webkit.org/show_bug.cgi?id=195016)
3. Remove gaps between table borders by default.
*/
table {
text-indent: 0;
/* 1 */
border-color: inherit;
/* 2 */
border-collapse: collapse;
/* 3 */
}
/*
1. Change the font styles in all browsers.
2. Remove the margin in Firefox and Safari.
3. Remove default padding in all browsers.
*/
button,
input,
optgroup,
select,
textarea {
font-family: inherit;
/* 1 */
font-feature-settings: inherit;
/* 1 */
font-variation-settings: inherit;
/* 1 */
font-size: 100%;
/* 1 */
font-weight: inherit;
/* 1 */
line-height: inherit;
/* 1 */
letter-spacing: inherit;
/* 1 */
color: inherit;
/* 1 */
margin: 0;
/* 2 */
padding: 0;
/* 3 */
}
/*
Remove the inheritance of text transform in Edge and Firefox.
*/
button,
select {
text-transform: none;
}
/*
1. Correct the inability to style clickable types in iOS and Safari.
2. Remove default button styles.
*/
button,
input:where([type='button']),
input:where([type='reset']),
input:where([type='submit']) {
-webkit-appearance: button;
/* 1 */
background-color: transparent;
/* 2 */
background-image: none;
/* 2 */
}
/*
Use the modern Firefox focus style for all focusable elements.
*/
:-moz-focusring {
outline: auto;
}
/*
Remove the additional \`:invalid\` styles in Firefox. (https://github.com/mozilla/gecko-dev/blob/2f9eacd9d3d995c937b4251a5557d95d494c9be1/layout/style/res/forms.css#L728-L737)
*/
:-moz-ui-invalid {
box-shadow: none;
}
/*
Add the correct vertical alignment in Chrome and Firefox.
*/
progress {
vertical-align: baseline;
}
/*
Correct the cursor style of increment and decrement buttons in Safari.
*/
::-webkit-inner-spin-button,
::-webkit-outer-spin-button {
height: auto;
}
/*
1. Correct the odd appearance in Chrome and Safari.
2. Correct the outline style in Safari.
*/
[type='search'] {
-webkit-appearance: textfield;
/* 1 */
outline-offset: -2px;
/* 2 */
}
/*
Remove the inner padding in Chrome and Safari on macOS.
*/
::-webkit-search-decoration {
-webkit-appearance: none;
}
/*
1. Correct the inability to style clickable types in iOS and Safari.
2. Change font properties to \`inherit\` in Safari.
*/
::-webkit-file-upload-button {
-webkit-appearance: button;
/* 1 */
font: inherit;
/* 2 */
}
/*
Add the correct display in Chrome and Safari.
*/
summary {
display: list-item;
}
/*
Removes the default spacing and border for appropriate elements.
*/
blockquote,
dl,
dd,
h1,
h2,
h3,
h4,
h5,
h6,
hr,
figure,
p,
pre {
margin: 0;
}
fieldset {
margin: 0;
padding: 0;
}
legend {
padding: 0;
}
ol,
ul,
menu {
list-style: none;
margin: 0;
padding: 0;
}
/*
Reset default styling for dialogs.
*/
dialog {
padding: 0;
}
/*
Prevent resizing textareas horizontally by default.
*/
textarea {
resize: vertical;
}
/*
1. Reset the default placeholder opacity in Firefox. (https://github.com/tailwindlabs/tailwindcss/issues/3300)
2. Set the default placeholder color to the user's configured gray 400 color.
*/
input::-moz-placeholder, textarea::-moz-placeholder {
opacity: 1;
/* 1 */
color: #9ca3af;
/* 2 */
}
input::placeholder,
textarea::placeholder {
opacity: 1;
/* 1 */
color: #9ca3af;
/* 2 */