-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
958 lines (928 loc) · 61.6 KB
/
index.html
File metadata and controls
958 lines (928 loc) · 61.6 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Alex+Brush&display=swap" rel="stylesheet">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="0">
<title>Library Item Reports</title>
<link href="https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css" rel="stylesheet">
<link href="styles/app.css?v=63" rel="stylesheet">
<link rel="icon" href="data:,">
</head>
<body class="relative min-h-screen overflow-x-hidden overflow-y-auto pt-16 px-6 pb-6" id="page-body">
<div id="overlay"></div>
<!-- New Header Bar -->
<div id="header-bar" class="fixed top-0 left-0 right-0 text-white py-3 px-6 flex justify-between items-center">
<span id="header-overlay-title" class="hidden" aria-live="polite" aria-atomic="true"></span>
<div class="w-32 flex items-center justify-start" style="min-width: 32px; gap:2px;">
</div>
<div id="header-controls" class="flex gap-2">
<button id="run-query-btn"
class="p-2 rounded-full bg-green-500 hover:bg-green-600 text-white focus:outline-none transition-colors"
aria-label="Run query" data-tooltip="Run Query" data-tooltip-delay="0">
<!-- Play icon -->
<svg id="run-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="w-5 h-5">
<polygon points="5,3 19,12 5,21"></polygon>
</svg>
<!-- Refresh icon (hidden by default) -->
<svg id="refresh-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="w-5 h-5 hidden">
<path d="M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8"/>
<path d="M21 3v5h-5"/>
<path d="M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16"/>
<path d="M3 21v-5h5"/>
</svg>
<!-- Stop icon (hidden by default) -->
<svg id="stop-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"
class="w-5 h-5 hidden">
<rect x="6" y="6" width="12" height="12" rx="2"/>
</svg>
</button>
<!-- Multi-value export mode toggle: stacked rows (default) vs split columns -->
<button id="split-columns-toggle"
class="p-2 rounded-full bg-white hover:bg-gray-100 text-black focus:outline-none transition-colors border border-gray-200"
aria-label="Toggle multi-value export mode" data-tooltip="Multi-value export: stacked in one cell (click to split into columns)" data-tooltip-delay="0">
<!-- Icon: two horizontal rows (stacked mode) -->
<svg id="split-toggle-icon-stack" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="w-5 h-5 pointer-events-none">
<rect x="3" y="3" width="18" height="7" rx="1"/>
<rect x="3" y="14" width="18" height="7" rx="1"/>
</svg>
<!-- Icon: two vertical columns (split mode) — hidden by default -->
<svg id="split-toggle-icon-cols" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="w-5 h-5 pointer-events-none hidden">
<rect x="3" y="3" width="7" height="18" rx="1"/>
<rect x="14" y="3" width="7" height="18" rx="1"/>
</svg>
</button>
<button id="toggle-json"
class="p-2 rounded-full bg-white hover:bg-gray-100 text-black focus:outline-none transition-colors border border-gray-200"
data-tooltip="Show Query JSON" data-tooltip-delay="0">
<svg width="24" height="24" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" class="w-5 h-5 pointer-events-none">
<path fill-rule="nonzero" clip-rule="nonzero" d="M7.58638 0.102166C7.8199 -0.0340553 8.10867 -0.0340553 8.34219 0.102166L14.5565 3.72717C14.7869 3.86157 14.9286 4.10825 14.9286 4.375V11.625C14.9286 11.8918 14.7869 12.1384 14.5565 12.2728L8.34219 15.8978C8.10867 16.0341 7.8199 16.0341 7.58638 15.8978L6.03281 14.9916C5.67502 14.7829 5.55417 14.3236 5.76288 13.9658C5.97159 13.6081 6.43083 13.4872 6.78862 13.6959L7.96429 14.3817L13.4286 11.1942V4.80578L7.96429 1.61828L2.5 4.80578V11.1942L3.6168 11.8457C3.96098 11.9561 4.38611 11.9831 4.68576 11.8507C4.82477 11.7893 4.95031 11.6893 5.04968 11.5107C5.15426 11.3227 5.25 11.0098 5.25 10.5V5.25C5.25 4.83579 5.58579 4.5 6 4.5C6.41421 4.5 6.75 4.83579 6.75 5.25V10.5C6.75 11.1902 6.62104 11.7716 6.36047 12.2399C6.09471 12.7176 5.71466 13.036 5.29192 13.2228C4.48562 13.579 3.59523 13.433 3.04999 13.2371C3.00686 13.2216 2.96525 13.2022 2.92567 13.1791L1.3721 12.2728C1.14168 12.1384 1 11.8918 1 11.625V4.375C1 4.10825 1.14168 3.86157 1.3721 3.72717L7.58638 0.102166ZM8.24655 5.28323C8.64339 4.81081 9.26318 4.5 10.1042 4.5C10.8847 4.5 11.4792 4.76756 11.8815 5.19314C12.166 5.49417 12.1527 5.96885 11.8516 6.25338C11.5506 6.53792 11.0759 6.52455 10.7914 6.22352C10.7038 6.13087 10.5202 6 10.1042 6C9.66182 6 9.47952 6.14753 9.39511 6.24802C9.28615 6.37774 9.25 6.54184 9.25 6.625C9.25 6.70816 9.28615 6.87226 9.39511 7.00198C9.47952 7.10247 9.66182 7.25 10.1042 7.25C10.1782 7.25 10.2497 7.26073 10.3173 7.28072C10.9368 7.37001 11.4089 7.64784 11.7326 8.03323C12.1049 8.47643 12.2292 8.99983 12.2292 9.375C12.2292 9.75017 12.1049 10.2736 11.7326 10.7168C11.3358 11.1892 10.716 11.5 9.87501 11.5C9.0945 11.5 8.49996 11.2324 8.09768 10.8069C7.81315 10.5058 7.82652 10.0311 8.12755 9.74662C8.42857 9.46208 8.90325 9.47546 9.18779 9.77648C9.27536 9.86913 9.459 10 9.87501 10C10.3174 10 10.4997 9.85247 10.5841 9.75198C10.693 9.62226 10.7292 9.45816 10.7292 9.375C10.7292 9.29184 10.693 9.12774 10.5841 8.99802C10.4997 8.89753 10.3174 8.75 9.87501 8.75C9.80097 8.75 9.72943 8.73927 9.66188 8.71928C9.04237 8.62999 8.57028 8.35216 8.24655 7.96677C7.87427 7.52357 7.75 7.00017 7.75 6.625C7.75 6.24983 7.87427 5.72643 8.24655 5.28323Z" fill="currentColor"/>
</svg>
</button>
<button id="toggle-queries"
class="p-2 rounded-full bg-white hover:bg-gray-100 text-black focus:outline-none transition-colors border border-gray-200"
aria-label="Queries" data-tooltip="Show Query History" data-tooltip-delay="0">
<svg class="history-animated w-5 h-5 pointer-events-none" viewBox="0 0 24 24" fill="none">
<circle cx="12" cy="12" r="10" stroke="currentColor" stroke-width="1.5" stroke-dasharray="0.5 3.5"/>
<path d="M22 12C22 6.47715 17.5228 2 12 2" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/>
<g class="clock-hour">
<line x1="12" y1="12" x2="12" y2="8.5" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
</g>
<g class="clock-minute">
<line x1="12" y1="12" x2="16.5" y2="10.5" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
</g>
</svg>
</button>
<button id="toggle-templates"
class="p-2 rounded-full bg-white hover:bg-gray-100 text-black focus:outline-none transition-colors border border-gray-200"
aria-label="Templates" data-tooltip="Show Query Templates" data-tooltip-delay="0">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" class="w-5 h-5 pointer-events-none" aria-hidden="true">
<polygon fill="#7AB9E8" points="512,48.762 512,414.476 341.333,463.238 170.667,414.476 0,463.238 0,97.524 170.667,48.762 341.333,97.524"/>
<polygon fill="#61AAE4" points="170.667,48.762 170.667,414.476 341.333,463.238 341.333,97.524"/>
<g>
<path fill="#F8F8F9" d="M456.554,132.02c-2.291-1.729-5.26-2.286-8.018-1.492l-107.203,30.63l-168.154-48.044c-1.642-0.469-3.382-0.469-5.024,0L58.441,144.461c-3.925,1.123-6.63,4.709-6.63,8.792v158.259v0.005v61.164c0,2.87,1.346,5.571,3.636,7.298c2.291,1.727,5.258,2.283,8.018,1.492l107.202-30.63l168.154,48.044c0.82,0.234,1.666,0.352,2.512,0.352c0.845,0,1.691-0.118,2.511-0.352l109.714-31.347c3.925-1.123,6.632-4.709,6.632-8.792V139.319C460.19,136.45,458.843,133.748,456.554,132.02z M341.333,380.587l-168.154-48.044c-0.82-0.234-1.666-0.352-2.512-0.352c-0.845,0-1.691,0.118-2.512,0.352L70.095,360.56v-41.935l10.951-3.128c4.855-1.386,7.667-6.448,6.279-11.302c-1.387-4.855-6.451-7.669-11.303-6.278l-5.927,1.693v-71.955c20.841-4.246,36.571-22.718,36.571-44.794c0-5.051-4.094-9.143-9.143-9.143s-9.143,4.092-9.143,9.143c0,11.919-7.645,22.081-18.286,25.856v-48.564l100.571-28.739l76.19,21.769v11.393c0,5.051,4.094,9.143,9.143,9.143c5.049,0,9.143-4.092,9.143-9.143v-6.168l73.678,21.052c1.642,0.469,3.382,0.469,5.024,0l98.06-28.016v49.301c-3.319,2.119-5.007,6.233-3.869,10.214c0.636,2.227,2.06,4.001,3.869,5.16v68.233c-20.841,4.246-36.571,22.718-36.571,44.794c0,5.051,4.094,9.143,9.143,9.143c5.049,0,9.143-4.092,9.143-9.143c0-11.919,7.643-22.081,18.286-25.856v48.564L341.333,380.587z"/>
<path fill="#F8F8F9" d="M356.403,224.772l-17.582,5.024c-4.855,1.387-7.667,6.448-6.279,11.302c1.147,4.016,4.808,6.633,8.786,6.633c0.831,0,1.677-0.115,2.516-0.355l17.582-5.024c4.855-1.386,7.667-6.448,6.279-11.302C366.319,226.196,361.256,223.376,356.403,224.772z"/>
<path fill="#F8F8F9" d="M420.453,215.98c-1.387-4.854-6.45-7.67-11.303-6.278l-17.582,5.024c-4.855,1.387-7.667,6.448-6.279,11.302c1.147,4.016,4.808,6.633,8.786,6.633c0.831,0,1.677-0.115,2.517-0.355l17.582-5.024C419.029,225.896,421.84,220.834,420.453,215.98z"/>
<path fill="#F8F8F9" d="M168.155,271.589l-4.222,1.206c-4.855,1.388-7.667,6.448-6.279,11.304c1.147,4.016,4.807,6.633,8.786,6.633c0.831,0,1.677-0.115,2.516-0.354l4.222-1.206c4.855-1.389,7.667-6.448,6.279-11.303C178.071,273.014,173.007,270.202,168.155,271.589z"/>
<path fill="#F8F8F9" d="M128.769,282.843l-17.582,5.024c-4.855,1.387-7.667,6.448-6.279,11.302c1.147,4.016,4.808,6.633,8.786,6.633c0.831,0,1.677-0.115,2.516-0.355l17.582-5.024c4.855-1.387,7.667-6.448,6.279-11.302C138.685,284.268,133.625,281.45,128.769,282.843z"/>
<path fill="#F8F8F9" d="M282.892,308.162l-48.762-13.934c-4.849-1.391-9.915,1.423-11.303,6.278c-1.387,4.854,1.424,9.916,6.279,11.302l48.762,13.934c0.839,0.24,1.685,0.355,2.516,0.355c3.978,0,7.639-2.619,8.787-6.634C290.56,314.609,287.748,309.549,282.892,308.162z"/>
<path fill="#F8F8F9" d="M256,228.574c5.049,0,9.143-4.092,9.143-9.143v-18.286c0-5.051-4.094-9.143-9.143-9.143c-5.049,0-9.143,4.092-9.143,9.143v18.286C246.857,224.482,250.951,228.574,256,228.574z"/>
<path fill="#F8F8F9" d="M256,283.431c5.049,0,9.143-4.092,9.143-9.143v-18.286c0-5.051-4.094-9.143-9.143-9.143c-5.049,0-9.143,4.092-9.143,9.143v18.286C246.857,279.339,250.951,283.431,256,283.431z"/>
</g>
<g>
<path fill="#EDEDED" d="M173.179,332.543c-0.82-0.234-1.666-0.352-2.512-0.352v18.651l168.154,48.044c0.82,0.234,1.666,0.352,2.512,0.352v-18.651L173.179,332.543z"/>
<path fill="#EDEDED" d="M246.857,153.181v11.393c0,5.051,4.094,9.143,9.143,9.143c5.049,0,9.143-4.092,9.143-9.143v-6.168l73.678,21.052c0.82,0.234,1.666,0.352,2.512,0.352v-18.651l-168.154-48.044c-0.82-0.234-1.666-0.352-2.512-0.352v18.651L246.857,153.181z"/>
<path fill="#EDEDED" d="M338.821,229.795c-4.855,1.387-7.667,6.448-6.279,11.302c1.147,4.016,4.808,6.633,8.786,6.633c0.001,0,0.002,0,0.005,0v-18.653L338.821,229.795z"/>
<path fill="#EDEDED" d="M173.178,289.173c4.855-1.388,7.667-6.448,6.279-11.303c-1.147-4.017-4.812-6.627-8.791-6.627v18.648L173.178,289.173z"/>
<path fill="#EDEDED" d="M282.892,308.162l-48.762-13.934c-4.849-1.391-9.915,1.423-11.303,6.278c-1.387,4.854,1.424,9.916,6.279,11.302l48.762,13.934c0.839,0.24,1.685,0.355,2.516,0.355c3.978,0,7.639-2.619,8.787-6.634C290.56,314.609,287.748,309.549,282.892,308.162z"/>
<path fill="#EDEDED" d="M256,228.574c5.049,0,9.143-4.092,9.143-9.143v-18.286c0-5.051-4.094-9.143-9.143-9.143c-5.049,0-9.143,4.092-9.143,9.143v18.286C246.857,224.482,250.951,228.574,256,228.574z"/>
<path fill="#EDEDED" d="M256,283.431c5.049,0,9.143-4.092,9.143-9.143v-18.286c0-5.051-4.094-9.143-9.143-9.143c-5.049,0-9.143,4.092-9.143,9.143v18.286C246.857,279.339,250.951,283.431,256,283.431z"/>
</g>
</svg>
</button>
<button id="toggle-help"
class="p-2 rounded-full bg-white hover:bg-gray-100 text-black focus:outline-none transition-colors border border-gray-200"
aria-label="Help" data-tooltip="Show Help" data-tooltip-delay="0">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="w-5 h-5 pointer-events-none">
<circle cx="12" cy="12" r="10"></circle>
<path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"></path>
<line x1="12" y1="17" x2="12.01" y2="17"></line>
</svg>
</button>
</div>
<!-- Hamburger Menu Button (only visible on mobile) -->
<button id="mobile-menu-toggle" class="p-2 rounded-full bg-white hover:bg-gray-100 text-black focus:outline-none transition-colors border border-gray-200" data-tooltip="Open Menu" data-tooltip-delay="0">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="w-5 h-5">
<line x1="3" y1="12" x2="21" y2="12"></line>
<line x1="3" y1="6" x2="21" y2="6"></line>
<line x1="3" y1="18" x2="21" y2="18"></line>
</svg>
</button>
<!-- Mobile Menu Dropdown -->
<div id="mobile-menu-dropdown" class="modal-panel hidden text-black p-6 overflow-y-auto">
<div class="flex justify-end mb-4">
<button class="collapse-btn p-1.5 rounded hover:bg-gray-200 focus:outline-none transition-colors" data-target="mobile-menu-dropdown" aria-label="Close">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="none" stroke="#374151" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="w-5 h-5">
<line x1="4" y1="4" x2="16" y2="16" />
<line x1="16" y1="4" x2="4" y2="16" />
</svg>
</button>
</div>
<div id="mobile-menu-items"></div>
</div>
</div>
<div id="filter-card">
<div id="filter-card-header">
<span id="filter-card-title"></span>
</div>
<div id="condition-panel" class="gap-4"></div>
<div id="bubble-cond-list"></div>
<div id="condition-input-wrapper">
<input id="condition-input" class="condition-field" type="text" placeholder="Enter value…" />
<span id="between-label" class="mx-2 font-semibold" style="display:none;">to</span>
<input id="condition-input-2" class="condition-field" type="text" placeholder="Enter value…" style="display:none;" />
<button id="confirm-btn" class="confirm-btn" data-tooltip="Confirm" data-tooltip-delay="0">✓</button>
<span id="filter-error"
class="ml-3 text-red-600 text-sm font-semibold"></span>
</div>
</div>
<div id="query-app-shell" class="max-w-5xl mx-auto">
<!-- Table + Filter Panel row -->
<div id="table-with-filter">
<!-- Filter Panel (left of table, populated by filterManager.js) -->
<aside id="filter-side-panel" class="panel-hidden" aria-label="Filter panel">
<!-- Content area -->
<div id="filter-panel-content">
<div id="filter-panel-header">
<span id="filter-panel-title">Filters</span>
</div>
<div id="filter-panel-body"></div>
</div>
</aside>
<!-- Table column -->
<div id="table-column">
<div id="table-shell" class="mb-6">
<div id="table-top-bar">
<div id="table-info-bar">
<div id="planning-badge" aria-live="polite" aria-label="Planning mode active">
<span class="planning-badge-dot" aria-hidden="true"></span>
<span>Planning</span>
</div>
<div id="partial-results-badge" aria-live="polite" aria-label="Partial results">
<span class="partial-results-badge-dot" aria-hidden="true"></span>
<span>Partial</span>
</div>
<div id="table-results-badge" class="hidden" aria-hidden="true">
<span class="table-info-metric">
<span id="table-results-count">0</span>
<span id="table-results-label">results</span>
</span>
<span class="table-info-separator" aria-hidden="true">•</span>
<span class="table-info-metric">
<span id="table-columns-count">0</span>
<span id="table-columns-label">columns</span>
</span>
</div>
</div>
<div id="table-name-shell">
<input
type="text"
id="table-name-input"
placeholder="Enter table name..."
class="text-xl font-semibold bg-transparent border-none text-center focus:outline-none focus:bg-white focus:px-3 focus:py-1 focus:rounded-lg focus:shadow-md transition-all duration-200 text-gray-800 min-w-0 max-w-md"
style="width: auto; min-width: 200px;"
data-tooltip="Enter a name for your table"
/>
</div>
<div id="table-toolbar">
<button id="table-add-field-btn"
class="table-toolbar-btn table-toolbar-btn-icon"
type="button"
aria-label="Add field"
data-tooltip="Add Field" data-tooltip-delay="0">
<svg xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
class="w-4 h-4 pointer-events-none">
<path d="M12 5v14"/>
<path d="M5 12h14"/>
</svg>
</button>
<button id="download-btn"
class="table-toolbar-btn table-toolbar-btn-icon"
type="button"
aria-label="Download results"
data-tooltip="Download Results" data-tooltip-delay="0">
<svg xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
class="w-4 h-4 pointer-events-none">
<path d="M4 16v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2"/>
<g id="download-arrow">
<path d="M7 10l5 5 5-5"/>
<path d="M12 15V4"/>
</g>
</svg>
</button>
<button id="post-filter-btn"
class="table-toolbar-btn table-toolbar-btn-icon"
type="button"
aria-label="Post filters"
data-tooltip="Post Filters" data-tooltip-delay="0">
<svg xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
class="w-4 h-4 pointer-events-none">
<path d="M4 6h16"/>
<path d="M7 12h10"/>
<path d="M10 18h4"/>
</svg>
</button>
<button id="clear-query-btn"
class="table-toolbar-btn table-toolbar-btn-icon table-toolbar-btn-danger"
type="button"
aria-label="Clear current query"
data-tooltip="Clear Query" data-tooltip-delay="0">
<svg xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 16 16"
fill="none"
stroke="currentColor"
stroke-width="0"
class="w-4 h-4 pointer-events-none">
<path fill="currentColor" d="M9.32 15.653a.812.812 0 0 1-.086-.855c.176-.342.245-.733.2-1.118a2.106 2.106 0 0 0-.267-.779 2.027 2.027 0 0 0-.541-.606 3.96 3.96 0 0 1-1.481-2.282c-1.708 2.239-1.053 3.51-.235 4.63a.748.748 0 0 1-.014.901.87.87 0 0 1-.394.283.838.838 0 0 1-.478.023c-1.105-.27-2.145-.784-2.85-1.603a4.686 4.686 0 0 1-.906-1.555 4.811 4.811 0 0 1-.263-1.797s-.133-2.463 2.837-4.876c0 0 3.51-2.978 2.292-5.18a.621.621 0 0 1 .112-.653.558.558 0 0 1 .623-.147l.146.058a7.63 7.63 0 0 1 2.96 3.5c.58 1.413.576 3.06.184 4.527.325-.292.596-.641.801-1.033l.029-.064c.198-.477.821-.325 1.055-.013.086.137 2.292 3.343 1.107 6.048a5.516 5.516 0 0 1-1.84 2.027 6.127 6.127 0 0 1-2.138.893.834.834 0 0 1-.472-.038.867.867 0 0 1-.381-.29zM7.554 7.892a.422.422 0 0 1 .55.146c.04.059.066.126.075.198l.045.349c.02.511.014 1.045.213 1.536.206.504.526.95.932 1.298a3.06 3.06 0 0 1 1.16 1.422c.22.564.25 1.19.084 1.773a4.123 4.123 0 0 0 1.39-.757l.103-.084c.336-.277.613-.623.813-1.017.201-.393.322-.825.354-1.269.065-1.025-.284-2.054-.827-2.972-.248.36-.59.639-.985.804-.247.105-.509.17-.776.19a.792.792 0 0 1-.439-.1.832.832 0 0 1-.321-.328.825.825 0 0 1-.035-.729c.412-.972.54-2.05.365-3.097a5.874 5.874 0 0 0-1.642-3.16c-.156 2.205-2.417 4.258-2.881 4.7a3.537 3.537 0 0 1-.224.194c-2.426 1.965-2.26 3.755-2.26 3.834a3.678 3.678 0 0 0 .459 2.043c.365.645.89 1.177 1.52 1.54C4.5 12.808 4.5 10.89 7.183 8.14l.372-.25z"/>
</svg>
</button>
<div id="table-zoom-controls" class="hidden" aria-label="Table zoom controls">
<button id="table-zoom-out-btn" class="table-toolbar-btn" type="button" aria-label="Zoom out table" data-tooltip="Zoom out" data-tooltip-delay="0">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="w-4 h-4 pointer-events-none">
<path d="M5 12h14"/>
</svg>
</button>
<span id="table-zoom-label">100%</span>
<button id="table-zoom-in-btn" class="table-toolbar-btn" type="button" aria-label="Zoom in table" data-tooltip="Zoom in" data-tooltip-delay="0">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="w-4 h-4 pointer-events-none">
<path d="M12 5v14"/>
<path d="M5 12h14"/>
</svg>
</button>
</div>
<button id="table-expand-btn" class="table-toolbar-btn table-expand-btn" type="button" aria-expanded="false" aria-label="Expand table" data-tooltip="Expand table" data-tooltip-delay="0">
<span class="table-expand-btn-icon" aria-hidden="true">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="w-4 h-4 pointer-events-none">
<path d="M8 3H3v5"/>
<path d="M16 3h5v5"/>
<path d="M3 16v5h5"/>
<path d="M21 16v5h-5"/>
<path d="M3 8l6-5"/>
<path d="M21 8l-6-5"/>
<path d="M3 16l6 5"/>
<path d="M21 16l-6 5"/>
</svg>
</span>
</button>
</div>
</div>
<div id="table-container" class="overflow-x-auto shadow relative" style="background: #fff; height: 400px;">
<table id="example-table" class="min-w-full divide-y divide-gray-200 bg-white">
<thead></thead>
<tbody></tbody>
</table>
<div id="placeholder-message"
class="py-8 absolute inset-0 flex items-center justify-center text-center text-gray-500 italic pointer-events-none"
data-empty-table-message>
Drag a bubble here to add your first column
</div>
</div>
</div>
</div><!-- end table-column -->
</div><!-- end table-with-filter -->
<!--
<section id="pinned-templates-strip" class="pinned-templates-strip hidden" aria-label="Pinned templates">
<div id="pinned-templates-list" class="pinned-templates-strip__list" aria-live="polite"></div>
</section>
-->
<div class="mb-6 text-center">
<div class="relative w-full max-w-3xl mx-auto">
<input
type="text"
placeholder="Type to find a specific field bubble…"
class="w-full pr-14 px-6 py-3 rounded-full shadow backdrop-blur-md focus:outline-none text-center transition-all duration-300"
id="query-input"
/>
<!-- clear‑search "×" button -->
<button id="clear-search-btn"
class="hidden absolute right-4 top-1/2 transform -translate-y-1/2 p-1 rounded-full bg-gray-200 bg-opacity-80 hover:bg-gray-300 focus:outline-none"
aria-label="Clear search">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="none" stroke="#374151" stroke-width="2"
stroke-linecap="round" stroke-linejoin="round" class="w-4 h-4">
<line x1="4" y1="4" x2="16" y2="16" />
<line x1="16" y1="4" x2="4" y2="16" />
</svg>
</button>
</div>
</div>
<div id="category-bar"
class="mb-4 flex w-max gap-0 mx-auto"></div>
<!-- Mobile category selector (only shown on small screens) -->
<select id="mobile-category-selector" class="mb-4 hidden"></select>
<!-- bubble grid + scrollbar -->
<div class="flex items-start justify-center">
<div id="bubble-container" class="overflow-hidden" style="max-width:720px;">
<div id="bubble-list" class="flex flex-wrap gap-4 justify-center"></div>
</div>
<!-- Bubble pagination -->
<div id="bubble-nav" class="ml-4 flex flex-col items-center">
<div id="bubble-scrollbar" class="bubble-scrollbar-container">
<div id="bubble-scrollbar-track" class="bubble-scrollbar-track"></div>
<div id="bubble-scrollbar-thumb" class="bubble-scrollbar-thumb"></div>
</div>
</div>
</div> <!-- end wrapper -->
<!-- JSON PANEL -->
<div id="json-panel" class="w-full modal-panel hidden">
<h2 class="mt-8 mb-0 px-3 py-2 bg-yellow-100 text-yellow-800 font-semibold text-sm uppercase tracking-wider border border-yellow-200 flex items-center justify-between">
<span class="sr-only">Query JSON</span>
<div class="flex gap-2 ml-auto items-center">
<button id="copy-json-btn"
class="p-1.5 rounded hover:bg-yellow-200 focus:outline-none transition-colors"
aria-label="Copy JSON to clipboard">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="#ca8a04" stroke-width="2"
stroke-linecap="round" stroke-linejoin="round" class="w-5 h-5">
<rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect>
<path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"/>
</svg>
</button>
<button class="collapse-btn p-1.5 rounded hover:bg-yellow-200 focus:outline-none transition-colors ml-2" data-target="json-panel" aria-label="Close">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="none" stroke="#ca8a04" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="w-5 h-5">
<line x1="4" y1="4" x2="16" y2="16" />
<line x1="16" y1="4" x2="4" y2="16" />
</svg>
</button>
</div>
</h2>
<div id="json-editor-shell" class="w-full -mt-px">
<div class="json-editor-topbar" aria-hidden="true">
<span class="json-editor-dot red"></span>
<span class="json-editor-dot amber"></span>
<span class="json-editor-dot green"></span>
<span class="json-editor-label">backend-query-payload.json</span>
</div>
<div id="query-json-tree" class="json-tree" role="tree" aria-label="Query JSON viewer"></div>
<textarea id="query-json"
class="w-full font-mono text-sm resize-none"
rows="10"
readonly
spellcheck="false"
aria-hidden="true"
tabindex="-1"
></textarea>
</div>
</div><!-- end json-panel -->
<!-- QUERIES PANEL -->
<div id="queries-panel" class="w-full modal-panel hidden">
<h2 class="mt-8 mb-0 px-3 py-2 bg-blue-100 text-blue-800 font-semibold text-sm uppercase tracking-wider border border-blue-200 flex items-center justify-between">
<span class="sr-only">Queries</span>
<div class="flex gap-2 ml-auto items-center">
<button class="collapse-btn p-1.5 rounded hover:bg-blue-200 focus:outline-none transition-colors ml-2" data-target="queries-panel" aria-label="Close">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="none" stroke="#2563eb" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="w-5 h-5">
<line x1="4" y1="4" x2="16" y2="16" />
<line x1="16" y1="4" x2="4" y2="16" />
</svg>
</button>
</div>
</h2>
<div id="queries-container"
class="w-full -mt-px border border-blue-200 border-t-0 rounded-b overflow-x-auto">
<div id="queries-search-wrapper" class="sticky top-0 z-10 pb-2 px-4 pt-4">
<input id="queries-search" type="search" placeholder="Search queries..." class="w-full px-3 py-2 rounded-lg focus:outline-none text-sm" data-search-ui="enhanced" data-search-wrapper-class="queries-search-field" data-search-clear-label="Clear query search" />
</div>
<div id="queries-list">
<!-- list will be injected here -->
</div>
</div>
</div><!-- end queries-panel -->
<!-- TEMPLATES PANEL -->
<div id="templates-panel" class="w-full modal-panel hidden">
<h2 class="mt-8 mb-0 px-3 py-2 bg-emerald-100 text-emerald-800 font-semibold text-sm uppercase tracking-wider border border-emerald-200 flex items-center justify-between">
<span class="sr-only">Templates</span>
<div class="flex gap-2 ml-auto items-center">
<button class="collapse-btn p-1.5 rounded hover:bg-emerald-200 focus:outline-none transition-colors ml-2" data-target="templates-panel" aria-label="Close">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="none" stroke="#047857" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="w-5 h-5">
<line x1="4" y1="4" x2="16" y2="16" />
<line x1="16" y1="4" x2="4" y2="16" />
</svg>
</button>
</div>
</h2>
<div id="templates-container" class="templates-panel-shell w-full -mt-px border border-emerald-200 border-t-0 rounded-b overflow-hidden bg-white">
<section class="templates-browser">
<div class="templates-browser-top">
<div class="templates-sidebar-header">
<div>
<div class="templates-sidebar-kicker">Server Templates</div>
<h3 class="templates-sidebar-title">Saved Queries</h3>
<p id="templates-mode-note" class="templates-sidebar-note">Create, edit, delete, and apply reusable query templates.</p>
</div>
</div>
<div class="templates-category-filter-shell">
<div class="templates-browser-toolbar templates-browser-toolbar--library">
<label class="templates-field templates-field--wide">
<span>Search Templates</span>
<input id="templates-search-input" type="search" maxlength="120" placeholder="Search templates">
</label>
<label class="templates-field">
<span>Filter By Category</span>
<select id="templates-category-filter"></select>
</label>
</div>
<div class="templates-sidebar-actions templates-sidebar-actions--library">
<button id="templates-refresh-btn" type="button" class="templates-secondary-btn">Refresh</button>
<button id="templates-manage-categories-btn" type="button" class="templates-secondary-btn">Manage Categories</button>
<button id="templates-new-btn" type="button" class="templates-primary-btn">New From Current Query</button>
</div>
<div id="templates-results-summary" class="templates-results-summary"></div>
</div>
</div>
<div class="templates-browser-list-shell">
<div id="templates-list-status" class="templates-status">Loading templates…</div>
<div id="templates-list" class="templates-list" aria-live="polite"></div>
</div>
<div id="templates-empty-state" class="templates-empty-state">
<div class="templates-empty-kicker">Templates</div>
<h3>No templates match the current view.</h3>
<p>Adjust the search or category filter, refresh from the server, or create a new template from the current query.</p>
</div>
</section>
<div id="templates-detail-overlay" class="templates-detail-overlay hidden" aria-hidden="true">
<div id="templates-detail-backdrop" class="templates-detail-backdrop" data-templates-detail-close></div>
<section id="templates-detail" class="templates-detail hidden" role="dialog" aria-modal="true" aria-labelledby="templates-detail-title">
<div class="templates-detail-header">
<div>
<div id="templates-detail-mode" class="templates-detail-mode">Template</div>
<h3 id="templates-detail-title" class="templates-detail-title">Template Details</h3>
</div>
<div class="templates-detail-actions">
<button id="template-use-btn" type="button" class="templates-primary-btn">Use Template</button>
<button id="template-pin-btn" type="button" class="templates-secondary-btn">Pin Template</button>
<button id="template-save-btn" type="button" class="templates-primary-btn">Save Changes</button>
<button id="template-delete-btn" type="button" class="templates-danger-btn">Delete</button>
<button id="templates-detail-close-btn" type="button" class="templates-categories-close" aria-label="Close template details">×</button>
</div>
</div>
<div class="templates-detail-body">
<div class="templates-form-grid">
<label class="templates-field">
<span>Name</span>
<input id="template-name-input" type="text" maxlength="120" placeholder="Monthly overdues by branch">
</label>
<label class="templates-field templates-field--wide">
<span>Description</span>
<textarea id="template-description-input" rows="5" maxlength="1000" placeholder="Explain what this template is for and when to use it."></textarea>
</label>
<label class="templates-field templates-field--wide">
<span>Bubble SVG</span>
<textarea id="template-svg-input" rows="6" maxlength="12000" placeholder="Paste an SVG for the pinned template bubble. If left empty, the blueprint icon will be used."></textarea>
</label>
<div class="templates-field templates-field--wide">
<span>Bubble Preview</span>
<div id="template-svg-preview" class="template-svg-preview"></div>
</div>
<div class="templates-field templates-field--wide">
<span>Categories</span>
<div id="template-category-assignment" class="template-category-assignment"></div>
</div>
</div>
<div id="templates-validation" class="templates-validation" aria-live="polite"></div>
<div id="templates-meta" class="templates-meta"></div>
</div>
</section>
</div>
<div id="templates-categories-overlay" class="templates-categories-overlay hidden" aria-hidden="true">
<div id="templates-categories-backdrop" class="templates-categories-backdrop" data-templates-categories-close></div>
<section class="templates-categories-dialog" role="dialog" aria-modal="true" aria-labelledby="templates-categories-title">
<div class="templates-categories-header">
<div>
<div class="templates-sidebar-kicker">Categories</div>
<h3 id="templates-categories-title" class="templates-categories-title">Manage Template Categories</h3>
<p class="templates-sidebar-note">Use categories to group templates and make the library easier to scan.</p>
</div>
<button id="templates-categories-close-btn" type="button" class="templates-categories-close" aria-label="Close category manager">×</button>
</div>
<div class="templates-categories-body">
<div id="templates-category-list" class="templates-category-list"></div>
<div id="templates-category-form" class="templates-category-form">
<label class="templates-field">
<span id="template-category-name-label">New Category</span>
<input id="template-category-name-input" type="text" maxlength="80" placeholder="Circulation">
</label>
<label class="templates-field templates-field--wide">
<span>Category Description</span>
<textarea id="template-category-description-input" rows="4" maxlength="400" placeholder="Explain what belongs in this category."></textarea>
</label>
<div class="templates-sidebar-actions">
<button id="template-category-save-btn" type="button" class="templates-secondary-btn">Add Category</button>
<button id="template-category-cancel-btn" type="button" class="templates-secondary-btn hidden">Cancel</button>
</div>
</div>
</div>
</section>
</div>
</div>
</div><!-- end templates-panel -->
<!-- HELP PANEL -->
<div id="help-panel" class="w-full modal-panel hidden">
<h2 class="mt-8 mb-0 px-3 py-2 bg-purple-100 text-purple-800 font-semibold text-sm uppercase tracking-wider border border-purple-200 flex items-center justify-between">
<span class="sr-only">Help</span>
<div class="flex gap-2 ml-auto items-center">
<button class="collapse-btn p-1.5 rounded hover:bg-purple-200 focus:outline-none transition-colors ml-2" data-target="help-panel" aria-label="Close">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="none" stroke="#7e22ce" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="w-5 h-5">
<line x1="4" y1="4" x2="16" y2="16" />
<line x1="16" y1="4" x2="4" y2="16" />
</svg>
</button>
</div>
</h2>
<div id="help-container" class="w-full -mt-px border border-purple-200 border-t-0 rounded-b overflow-y-auto bg-white p-4">
<div class="help-shell">
<section class="help-hero">
<div class="help-hero-copy">
<span class="help-kicker">Query Guide</span>
<h3>Build library reports without guessing what the tool is doing.</h3>
<p>Start with bubbles, shape the result table, run the query, then reuse or export what worked. The interface is designed so the visual state stays aligned with the backend payload.</p>
</div>
<div class="help-summary-grid">
<article class="help-summary-card">
<span class="help-summary-label">1. Build</span>
<strong>Choose columns and filters from bubbles.</strong>
</article>
<article class="help-summary-card">
<span class="help-summary-label">2. Run</span>
<strong>Execute the flat backend query with the play button.</strong>
</article>
<article class="help-summary-card">
<span class="help-summary-label">3. Review</span>
<strong>Inspect results, history, JSON, and exports.</strong>
</article>
</div>
</section>
<section class="help-card-grid">
<article class="help-card help-card-wide">
<div class="help-card-heading">
<span class="help-card-tag">Workflow</span>
<h4>Recommended order</h4>
</div>
<ol class="help-step-list">
<li>
<span class="help-step-number">01</span>
<div>
<strong>Find a field.</strong>
<p>Use the search bar or category tabs to narrow the bubble list to the field you want.</p>
</div>
</li>
<li>
<span class="help-step-number">02</span>
<div>
<strong>Choose how it should be used.</strong>
<p>Drag a bubble to the table to add a column, or click it to open filter controls for that field.</p>
</div>
</li>
<li>
<span class="help-step-number">03</span>
<div>
<strong>Refine the query.</strong>
<p>Add more fields, reorder columns, and confirm filter values until the JSON matches the result shape you expect.</p>
</div>
</li>
<li>
<span class="help-step-number">04</span>
<div>
<strong>Run, review, reuse.</strong>
<p>Run the query, inspect history, reload useful configurations, and export results when the table looks right.</p>
</div>
</li>
</ol>
</article>
<article class="help-card">
<div class="help-card-heading">
<span class="help-card-tag">Bubbles</span>
<h4>How field bubbles behave</h4>
</div>
<ul class="help-detail-list">
<li>Click a bubble to open the filter card for that field.</li>
<li>Drag a bubble into the table area to add it as a displayed column.</li>
<li>Displayed or filtered bubbles stay visually marked so you can scan the current query quickly.</li>
<li>Some fields offer grouped lists or boolean pills because those values come from backend field metadata.</li>
</ul>
</article>
<article class="help-card">
<div class="help-card-heading">
<span class="help-card-tag">Filters</span>
<h4>How filtering works now</h4>
</div>
<ul class="help-detail-list">
<li>Filtering is flat and backend-aligned. There is no AND/OR group builder in the current query model.</li>
<li>Equals filters on selector fields replace the previous selection instead of stacking conflicting values.</li>
<li>The side filter panel and the bubble panel both edit the same live filter state.</li>
<li>Panels stay open after applying values so you can keep refining a field without reopening it.</li>
</ul>
</article>
<article class="help-card">
<div class="help-card-heading">
<span class="help-card-tag">Table</span>
<h4>Working with results</h4>
</div>
<ul class="help-detail-list">
<li>Drag table headers to reorder columns after you add them.</li>
<li>Remove columns from the table when they are no longer needed.</li>
<li>The split export toggle changes how multi-value cells are written when exporting results.</li>
<li>Clearing the query resets the current working state so you can start over cleanly.</li>
</ul>
</article>
<article class="help-card">
<div class="help-card-heading">
<span class="help-card-tag">Panels</span>
<h4>What each top button does</h4>
</div>
<div class="help-actions-grid">
<div class="help-action-item"><span class="help-action-pill run">Run</span><p>Runs the current query. While active, the button switches to stop mode.</p></div>
<div class="help-action-item"><span class="help-action-pill export">Download</span><p>Exports the current result set using the active multi-value export mode.</p></div>
<div class="help-action-item"><span class="help-action-pill clear">Clear</span><p>Removes the current query setup and result state.</p></div>
<div class="help-action-item"><span class="help-action-pill json">JSON</span><p>Shows the exact payload being built for the current query.</p></div>
<div class="help-action-item"><span class="help-action-pill history">Queries</span><p>Shows running, completed, failed, and cancelled history entries.</p></div>
<div class="help-action-item"><span class="help-action-pill help">Help</span><p>Opens this guide and summarizes the current interaction model.</p></div>
</div>
</article>
<article class="help-card help-card-wide">
<div class="help-card-heading">
<span class="help-card-tag">History</span>
<h4>Query history and recovery</h4>
</div>
<div class="help-two-column">
<div>
<p class="help-mini-heading">What you can do</p>
<ul class="help-detail-list compact">
<li>Reload a past query’s displayed columns and filters.</li>
<li>Open saved results for completed runs.</li>
<li>Cancel a query that is still running.</li>
<li>Rerun a previous query from the history panel.</li>
</ul>
</div>
<div>
<p class="help-mini-heading">Status meanings</p>
<ul class="help-status-list">
<li><span class="help-status running">Running</span><span>Currently executing on the backend.</span></li>
<li><span class="help-status complete">Completed</span><span>Finished successfully and ready to reload.</span></li>
<li><span class="help-status failed">Failed</span><span>Stopped because of an error or interrupted backend state.</span></li>
<li><span class="help-status canceled">Cancelled</span><span>Stopped intentionally before completion.</span></li>
</ul>
</div>
</div>
</article>
<article class="help-card help-card-wide help-callout-card">
<div class="help-card-heading">
<span class="help-card-tag">Practical Tips</span>
<h4>Things that save time</h4>
</div>
<div class="help-tip-grid">
<div class="help-tip-item">
<strong>Use JSON as a truth check.</strong>
<p>If the UI feels off, open the JSON panel. It shows the real query payload the backend will receive.</p>
</div>
<div class="help-tip-item">
<strong>Use history for repeat work.</strong>
<p>If a report is close to what you need, reload it from query history instead of rebuilding it manually.</p>
</div>
<div class="help-tip-item">
<strong>Prefer selectors for policy fields.</strong>
<p>When a field offers a list or boolean pill, use it instead of typing freeform text to avoid bad literals.</p>
</div>
<div class="help-tip-item">
<strong>Refine before exporting.</strong>
<p>Check split export mode and column order first so the downloaded file matches how you intend to use it.</p>
</div>
</div>
</article>
</section>
</div>
</div>
</div><!-- end help-panel -->
</div>
<div id="post-filter-overlay" class="post-filter-overlay hidden" aria-hidden="true">
<div id="post-filter-overlay-backdrop" class="post-filter-overlay-backdrop"></div>
<div class="post-filter-dialog" role="dialog" aria-modal="true" aria-labelledby="post-filter-dialog-title">
<div class="post-filter-dialog__header">
<div>
<p class="post-filter-dialog__eyebrow">Result Filters</p>
<h2 id="post-filter-dialog-title" class="post-filter-dialog__title">Filter the loaded results</h2>
<p class="post-filter-dialog__description">Use post filters for result-only checks the backend query does not naturally support. These filters only affect the rows currently loaded in the table.</p>
</div>
<button id="post-filter-overlay-close" class="post-filter-dialog__close" type="button" aria-label="Close post filters">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="w-4 h-4 pointer-events-none">
<line x1="4" y1="4" x2="16" y2="16"></line>
<line x1="16" y1="4" x2="4" y2="16"></line>
</svg>
</button>
</div>
<div class="post-filter-dialog__summary" aria-label="Post filter summary">
<div class="post-filter-summary-pill">
<span class="post-filter-summary-pill__label">Showing</span>
<strong id="post-filter-summary-rows" class="post-filter-summary-pill__value">0</strong>
</div>
<div class="post-filter-summary-pill">
<span class="post-filter-summary-pill__label">Loaded</span>
<strong id="post-filter-summary-base-rows" class="post-filter-summary-pill__value">0</strong>
</div>
<div class="post-filter-summary-pill">
<span class="post-filter-summary-pill__label">Active Filters</span>
<strong id="post-filter-summary-count" class="post-filter-summary-pill__value">0</strong>
</div>
</div>
<div class="post-filter-dialog__body">
<div class="post-filter-builder">
<div class="post-filter-field">
<label class="post-filter-field__label" for="post-filter-field">Field</label>
<select id="post-filter-field" class="post-filter-field__select"></select>
</div>
<div class="post-filter-field">
<label class="post-filter-field__label" for="post-filter-operator">Condition</label>
<select id="post-filter-operator" class="post-filter-field__select"></select>
</div>
<div class="post-filter-field">
<label class="post-filter-field__label" for="post-filter-logic">Combine With Existing Rules</label>
<select id="post-filter-logic" class="post-filter-field__select">
<option value="all">Require all</option>
<option value="any">Allow any</option>
</select>
<p class="post-filter-field__hint">This only appears after the field already has a rule.</p>
</div>
<div class="post-filter-field post-filter-field--value">
<label class="post-filter-field__label" for="post-filter-value">Value</label>
<div class="post-filter-value-row">
<input id="post-filter-value" class="post-filter-field__input" type="text" placeholder="Value">
<span id="post-filter-between-label" class="post-filter-between-label hidden">and</span>
<input id="post-filter-value-2" class="post-filter-field__input hidden" type="text" placeholder="Value">
</div>
<div id="post-filter-value-picker-host" class="post-filter-value-picker-host hidden"></div>
</div>
<button id="post-filter-add-btn" class="post-filter-add-btn" type="button">Apply Filter</button>
</div>
<div class="post-filter-list-panel">
<div class="post-filter-list-panel__header">
<h3 class="post-filter-list-panel__title">Active Post Filters</h3>
<p class="post-filter-list-panel__text">These are layered on top of the loaded result set only.</p>
</div>
<div id="post-filter-empty" class="post-filter-empty">No post filters yet. Add one rule at a time, then decide whether additional rules for the same field should all match or if any one can match.</div>
<div id="post-filter-list" class="post-filter-list"></div>
</div>
</div>
<div class="post-filter-dialog__footer">
<div class="post-filter-dialog__hint">Post filters do not change the backend query payload. Clear them if you want to return to the full loaded result set.</div>
<div class="post-filter-dialog__actions">
<button id="post-filter-clear-btn" class="export-action-btn export-action-btn--secondary" type="button">Clear All</button>
<button id="post-filter-done-btn" class="export-action-btn export-action-btn--primary" type="button">Done</button>
</div>
</div>
</div>
</div>
<div id="export-overlay" class="export-overlay hidden" aria-hidden="true">
<div id="export-overlay-backdrop" class="export-overlay-backdrop"></div>
<div class="export-dialog" role="dialog" aria-modal="true" aria-labelledby="export-dialog-title" aria-describedby="export-dialog-description">
<div class="export-dialog__header">
<div>
<p class="export-dialog__eyebrow">Excel Export</p>
<h2 id="export-dialog-title" class="export-dialog__title">Choose how to package the results</h2>
<p id="export-dialog-description" class="export-dialog__description">Export one workbook sheet like before, or split the workbook into sheets grouped by a result field such as library or branch.</p>
<div class="export-dialog__summary" aria-label="Export summary">
<div class="export-summary-pill export-summary-pill--name">
<span class="export-summary-pill__label">Workbook</span>
<strong id="export-summary-name" class="export-summary-pill__value">Query Results</strong>
</div>
<div class="export-summary-pill">
<span class="export-summary-pill__label">Rows</span>
<strong id="export-summary-rows" class="export-summary-pill__value">0</strong>
</div>
<div class="export-summary-pill">
<span class="export-summary-pill__label">Columns</span>
<strong id="export-summary-columns" class="export-summary-pill__value">0</strong>
</div>
<div class="export-summary-pill">
<span class="export-summary-pill__label">Grouping Fields</span>
<strong id="export-summary-groups" class="export-summary-pill__value">0</strong>
</div>
</div>
</div>
<button id="export-overlay-close" class="export-dialog__close" type="button" aria-label="Close export options">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="w-4 h-4 pointer-events-none">
<line x1="4" y1="4" x2="16" y2="16"></line>
<line x1="16" y1="4" x2="4" y2="16"></line>
</svg>
</button>
</div>
<div class="export-dialog__body">
<section class="export-mode-grid" aria-label="Export mode">
<label class="export-mode-card export-mode-card--active" data-export-mode-card="single">
<input id="export-mode-single" type="radio" name="export-mode" value="single" checked>
<span class="export-mode-card__check" aria-hidden="true"></span>
<span class="export-mode-card__icon" aria-hidden="true">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" class="w-5 h-5 pointer-events-none">
<rect x="4" y="4" width="16" height="16" rx="2"></rect>
<path d="M8 9h8"></path>
<path d="M8 13h8"></path>
<path d="M8 17h5"></path>
</svg>
</span>
<span class="export-mode-card__content">
<span class="export-mode-card__title-row">
<span class="export-mode-card__title">One sheet</span>
<span class="export-mode-card__badge">Default</span>
</span>
<span class="export-mode-card__text">Download the current results into a single worksheet, same as the current flow.</span>
</span>
</label>
<label class="export-mode-card" data-export-mode-card="grouped">
<input id="export-mode-grouped" type="radio" name="export-mode" value="grouped">
<span class="export-mode-card__check" aria-hidden="true"></span>
<span class="export-mode-card__icon" aria-hidden="true">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" class="w-5 h-5 pointer-events-none">
<rect x="3" y="4" width="7" height="16" rx="1.5"></rect>
<rect x="14" y="4" width="7" height="7" rx="1.5"></rect>
<rect x="14" y="13" width="7" height="7" rx="1.5"></rect>
</svg>
</span>
<span class="export-mode-card__content">
<span class="export-mode-card__title-row">
<span class="export-mode-card__title">Split into sheets</span>
</span>
<span class="export-mode-card__text">Group the workbook by a displayed field so each distinct value gets its own worksheet.</span>
</span>
</label>
</section>
<section class="export-group-panel" id="export-group-panel" aria-live="polite">
<div class="export-group-panel__header">
<div>
<p class="export-section-kicker">Grouped Export</p>
<h3 class="export-group-panel__title">Split settings</h3>
<p class="export-group-panel__text">Pick any displayed field from the current results. Each distinct value in that field becomes its own worksheet.</p>
</div>
<div id="export-group-preview" class="export-group-preview">Choose a field to preview the sheet breakdown.</div>
</div>
<div class="export-field-picker">
<label class="export-field-picker__label" for="export-group-field">Group sheets by</label>
<div class="export-field-picker__shell">
<select id="export-group-field" class="export-field-picker__select"></select>
<span class="export-field-picker__icon" aria-hidden="true">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="w-4 h-4 pointer-events-none">
<path d="m6 9 6 6 6-6"></path>
</svg>
</span>
</div>
</div>
<div class="export-option-grid">
<label class="export-option-card">
<input id="export-include-master-sheet" type="checkbox" checked>
<span>
<strong>Keep an All Results sheet</strong>
<span>Useful when you want the branch tabs but still need one full sheet for quick search and filters.</span>
</span>
</label>
<label class="export-option-card">
<input id="export-include-overview-sheet" type="checkbox" checked>
<span>
<strong>Add an overview sheet</strong>
<span>Starts the workbook with a compact tab showing each group value and the row count it contains.</span>
</span>
</label>
</div>
</section>
</div>
<div class="export-dialog__footer">
<div id="export-dialog-hint" class="export-dialog__hint">One sheet is fastest. Split sheets are best when the workbook will be handed off by branch or location.</div>
<div class="export-dialog__actions">
<button id="export-cancel-btn" class="export-action-btn export-action-btn--secondary" type="button">Cancel</button>
<button id="export-confirm-btn" class="export-action-btn export-action-btn--primary" type="button">Download</button>
</div>
</div>
</div>
</div>
<!-- ExcelJS for generating spreadsheets with freeze panes support -->
<script src="https://cdn.jsdelivr.net/npm/exceljs@4.3.0/dist/exceljs.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/autonumeric@4.10.9/dist/autoNumeric.min.js"></script>
<script type="module" src="appModules.js"></script>
</body>