Changes for page Service Navigator

Last modified by Veronika Kocher on Thursday, 03 Sep 2026 14:15

From version 22.13
edited by Veronika Kocher
on Thursday, 03 Sep 2026 9:18
Change comment: There is no comment for this version
To version 22.17
edited by Veronika Kocher
on Thursday, 03 Sep 2026 14:15
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -286,21 +286,132 @@
286 286  {{/html}}
287 287  
288 288  {{html clean="false"}}
289 -<!-- SN_HORIZONTAL_BOX_HARMONIZER_START -->
290 -<style data-sn-horizontal-box-harmonizer="1">
291 -[data-sn-equal-height-managed="1"]{box-sizing:border-box}
292 -@media(max-width:767px){
293 - [data-sn-equal-height-managed="1"]{min-height:0!important}
289 +<!-- SN_SERVICE_NAVIGATOR_MASTER_STYLE_START -->
290 +
291 +<style data-sn-service-navigator-master="1">
292 +/* =========================================================
293 + MASTER TYPOGRAPHY
294 + ========================================================= */
295 +#xwikicontent h1,
296 +#xwikicontent h2,
297 +#xwikicontent h3,
298 +#xwikicontent h4,
299 +#xwikicontent h5,
300 +#xwikicontent h6,
301 +#xwikicontent .box-title,
302 +#xwikicontent [role="heading"],
303 +#xwikicontent h1 a,
304 +#xwikicontent h2 a,
305 +#xwikicontent h3 a,
306 +#xwikicontent h4 a,
307 +#xwikicontent h5 a,
308 +#xwikicontent h6 a,
309 +#xwikicontent .box-title a,
310 +#xwikicontent [role="heading"] a{
311 + text-align:left!important;
312 + text-justify:auto!important;
313 + word-spacing:normal!important;
294 294  }
315 +
316 +/* =========================================================
317 + COMING SOON / IN VORBEREITUNG
318 + ========================================================= */
319 +.sn-coming-soon-badge{
320 + display:inline-block;
321 + vertical-align:middle;
322 + margin-left:10px;
323 + padding:4px 8px;
324 + border-radius:14px;
325 + border:1px solid #efd9cc;
326 + background:#fff4ee;
327 + color:#8a4d36;
328 + font-size:11px;
329 + font-weight:700;
330 + letter-spacing:.055em;
331 + line-height:1.2;
332 + white-space:nowrap;
333 +}
334 +
335 +/* =========================================================
336 + NATIVE / DETAIL CALLOUT GEOMETRY
337 + Preserve existing backgrounds.
338 + ========================================================= */
339 +#xwikicontent .arsn-info,
340 +#xwikicontent .dmp-info,
341 +#xwikicontent .ido-info,
342 +#xwikicontent .pp-info,
343 +#xwikicontent .infomessage{
344 + box-sizing:border-box!important;
345 + border-left:4px solid #21b6d7!important;
346 + border-radius:8px;
347 + text-align:left!important;
348 + word-spacing:normal!important;
349 +}
350 +
351 +#xwikicontent .arsn-warn,
352 +#xwikicontent .dmp-warn,
353 +#xwikicontent .ido-warn,
354 +#xwikicontent .pp-warn,
355 +#xwikicontent .warn,
356 +#xwikicontent .warning,
357 +#xwikicontent .warningmessage,
358 +#xwikicontent .errormessage{
359 + box-sizing:border-box!important;
360 + border-left:4px solid #e94b13!important;
361 + border-radius:8px;
362 + text-align:left!important;
363 + word-spacing:normal!important;
364 +}
365 +
366 +[data-sn-master-equal-height],
367 +[data-sn-master-first-row]{
368 + box-sizing:border-box;
369 +}
370 +
371 +/* =========================================================
372 + FULL-WIDTH THREE-LINE NUMBER / TITLE / SUBTITLE BLOCKS
373 + ========================================================= */
374 +#xwikicontent .arsn-area-label[data-sn-three-line="1"]{
375 + display:grid!important;
376 + grid-template-columns:minmax(0,1fr)!important;
377 + grid-auto-rows:auto!important;
378 + width:100%!important;
379 + max-width:none!important;
380 + box-sizing:border-box!important;
381 + justify-items:start!important;
382 + align-items:start!important;
383 + gap:2px!important;
384 + text-align:left!important;
385 + text-align-last:left!important;
386 + text-justify:auto!important;
387 + word-spacing:normal!important;
388 + white-space:normal!important;
389 +}
390 +#xwikicontent .arsn-area-label[data-sn-three-line="1"] > .arsn-area-number,
391 +#xwikicontent .arsn-area-label[data-sn-three-line="1"] > .sn-area-label-title,
392 +#xwikicontent .arsn-area-label[data-sn-three-line="1"] > .arsn-area-action{
393 + display:block!important;
394 + width:100%!important;
395 + margin:0!important;
396 + text-align:left!important;
397 + text-align-last:left!important;
398 + text-justify:auto!important;
399 + word-spacing:normal!important;
400 + white-space:normal!important;
401 +}
295 295  </style>
296 -<script data-sn-horizontal-box-harmonizer="1">
403 +
404 +<script data-sn-service-navigator-master="1">
297 297  (function(){
298 298   "use strict";
299 299  
408 + var PAGE_KIND="overview";
409 + var PLACEHOLDER=false;
410 + var PLACEHOLDER_LABEL="COMING SOON";
411 +
300 300   var MOBILE_MAX=767;
301 - var ROW_TOLERANCE=4;
302 - var MIN_W=150;
303 - var MIN_H=36;
413 + var ROW_TOLERANCE=6;
414 + var RESIZE_DEBOUNCE=220;
304 304  
305 305   var root=
306 306   document.getElementById("xwikicontent")||
... ... @@ -310,212 +310,1268 @@
310 310  
311 311   if(!root)return;
312 312  
313 - var managed=new Set();
314 - var raf=0;
424 + var managedHeight=new Set();
425 + var managedMargin=new Set();
426 + var originalHeight=new WeakMap();
427 + var originalMargin=new WeakMap();
315 315  
316 - function num(v){
317 - var n=parseFloat(v);
429 + var resizeTimer=0;
430 + var running=false;
431 +
432 + var THEMES=[
433 + {
434 + name:"BLUE",
435 + accent:"#21b6d7",
436 + bg:"#eaf7fb",
437 + text:"#315d68",
438 + labels:[
439 + "HIER STARTEN",
440 + "ENTSCHEIDEN",
441 + "ÜBERPRÜFEN & ANPASSEN",
442 + "START HERE",
443 + "DECIDE",
444 + "REVIEW & ADAPT"
445 + ]
446 + },
447 + {
448 + name:"RED",
449 + accent:"#e94b13",
450 + bg:"#fff1ec",
451 + text:"#8a4d36",
452 + labels:[
453 + "PLANEN & ORGANISIEREN",
454 + "ORGANISIEREN & DOKUMENTIEREN",
455 + "PUBLIZIEREN & PRÄSENTIEREN",
456 + "PLAN & ORGANISE",
457 + "PLAN & ORGANIZE",
458 + "ORGANISE & DOCUMENT",
459 + "ORGANIZE & DOCUMENT",
460 + "PUBLISH & PRESENT"
461 + ]
462 + },
463 + {
464 + name:"YELLOW",
465 + accent:"#f0aa00",
466 + bg:"#fff8e7",
467 + text:"#785b17",
468 + labels:[
469 + "SCHÜTZEN & KLÄREN",
470 + "STANDARDISIEREN & IDENTIFIZIEREN",
471 + "ÖFFNEN, NACHNUTZEN & AUFFINDBAR MACHEN",
472 + "PROTECT & CLARIFY",
473 + "STANDARDISE & IDENTIFY",
474 + "STANDARDIZE & IDENTIFY",
475 + "OPEN, REUSE & MAKE FINDABLE"
476 + ]
477 + },
478 + {
479 + name:"GREEN",
480 + accent:"#38b76a",
481 + bg:"#edf9f1",
482 + text:"#3f7451",
483 + labels:[
484 + "INFRASTRUKTUR EINRICHTEN",
485 + "INFRASTRUKTUR & ZUSAMMENARBEIT EINRICHTEN",
486 + "SPEICHERN & ZUGRIFF STEUERN",
487 + "REPOSITORIUM, ERHALTEN & ÜBERGEBEN",
488 + "SET UP INFRASTRUCTURE",
489 + "SET UP INFRASTRUCTURE & COLLABORATION",
490 + "STORE & CONTROL ACCESS",
491 + "REPOSITORY, PRESERVE & HAND OVER"
492 + ]
493 + }
494 + ];
495 +
496 + function num(value){
497 + var n=parseFloat(value);
318 318   return Number.isFinite(n)?n:0;
319 319   }
320 320  
501 + function norm(value){
502 + return String(value||"")
503 + .replace(/\s+/g," ")
504 + .trim()
505 + .toUpperCase();
506 + }
507 +
321 321   function visible(el){
322 322   if(!el||el.nodeType!==1)return false;
323 - var s=getComputedStyle(el);
324 - if(s.display==="none"||s.visibility==="hidden"||Number(s.opacity)===0)return false;
325 - var r=el.getBoundingClientRect();
326 - return r.width>=MIN_W&&r.height>=MIN_H;
510 +
511 + var style=getComputedStyle(el);
512 + var rect=el.getBoundingClientRect();
513 +
514 + return (
515 + style.display!=="none"&&
516 + style.visibility!=="hidden"&&
517 + rect.width>20&&
518 + rect.height>4
519 + );
327 327   }
328 328  
329 - function excluded(el){
330 - return !el.matches||el.matches(
331 - "button,input,select,textarea,option,label,img,svg,canvas,table,thead,tbody,tfoot,tr,td,th,summary,script,style,noscript,template,.btn,.chip,[role=button]"
522 + function saveStyle(el,map,property){
523 + if(map.has(el))return;
524 +
525 + map.set(el,{
526 + value:el.style.getPropertyValue(property),
527 + priority:el.style.getPropertyPriority(property)
528 + });
529 + }
530 +
531 + function restoreStyle(el,map,property){
532 + var original=map.get(el);
533 +
534 + if(original&&original.value){
535 + el.style.setProperty(
536 + property,
537 + original.value,
538 + original.priority||""
539 + );
540 + }else{
541 + el.style.removeProperty(property);
542 + }
543 + }
544 +
545 + function resetRuntime(){
546 + managedHeight.forEach(function(el){
547 + restoreStyle(
548 + el,
549 + originalHeight,
550 + "min-height"
551 + );
552 + el.removeAttribute(
553 + "data-sn-master-equal-height"
554 + );
555 + });
556 +
557 + managedMargin.forEach(function(el){
558 + restoreStyle(
559 + el,
560 + originalMargin,
561 + "margin-top"
562 + );
563 + el.removeAttribute(
564 + "data-sn-master-first-row"
565 + );
566 + });
567 +
568 + managedHeight.clear();
569 + managedMargin.clear();
570 + }
571 +
572 + function themeFor(text){
573 + var value=norm(text);
574 +
575 + for(var i=0;i<THEMES.length;i++){
576 + for(var j=0;j<THEMES[i].labels.length;j++){
577 + var label=THEMES[i].labels[j];
578 +
579 + if(
580 + value===label||
581 + value.indexOf(label+" ")===0||
582 + value.indexOf(label+" -")===0||
583 + value.indexOf(label+" ·")===0
584 + ){
585 + return THEMES[i];
586 + }
587 + }
588 + }
589 +
590 + return null;
591 + }
592 +
593 + /* =======================================================
594 + BORDERLESS FILLED RED/ORANGE CTA BUTTONS
595 + ======================================================= */
596 +
597 + function colourDistance(a,b){
598 + return Math.sqrt(
599 + Math.pow(a[0]-b[0],2)+
600 + Math.pow(a[1]-b[1],2)+
601 + Math.pow(a[2]-b[2],2)
332 332   );
333 333   }
334 334  
335 - function namedLikeBox(el){
336 - var c=typeof el.className==="string"?el.className:"";
337 - return /(^|[\s_-])(box|card|tile|panel|role|check|service|source|call|area|detail|resource|topic|warn|info)([\s_-]|$)/i.test(c);
605 + function makeFilledRedOrangeCTAsBorderless(){
606 + var RED_ORANGE=[233,75,19];
607 +
608 + Array.from(
609 + root.querySelectorAll(
610 + 'a,button,[role="button"],input[type="submit"],input[type="button"]'
611 + )
612 + ).forEach(function(el){
613 + if(!visible(el))return;
614 +
615 + var style=getComputedStyle(el);
616 + var rgb=parseRGB(style.backgroundColor);
617 +
618 + if(!rgb)return;
619 +
620 + if(
621 + colourDistance(
622 + rgb,
623 + RED_ORANGE
624 + )>55
625 + ){
626 + return;
627 + }
628 +
629 + var rect=el.getBoundingClientRect();
630 +
631 + if(
632 + rect.width<80||
633 + rect.height<24
634 + ){
635 + return;
636 + }
637 +
638 + el.style.setProperty(
639 + "border",
640 + "none",
641 + "important"
642 + );
643 +
644 + el.style.setProperty(
645 + "border-left",
646 + "none",
647 + "important"
648 + );
649 +
650 + el.style.setProperty(
651 + "border-top",
652 + "none",
653 + "important"
654 + );
655 +
656 + el.style.setProperty(
657 + "border-right",
658 + "none",
659 + "important"
660 + );
661 +
662 + el.style.setProperty(
663 + "border-bottom",
664 + "none",
665 + "important"
666 + );
667 +
668 + el.style.setProperty(
669 + "box-shadow",
670 + "none",
671 + "important"
672 + );
673 + });
338 338   }
339 339  
340 - function boxLike(el){
341 - if(!visible(el)||excluded(el))return false;
342 - var s=getComputedStyle(el);
343 - var r=el.getBoundingClientRect();
344 - var border=
345 - num(s.borderTopWidth)+num(s.borderRightWidth)+
346 - num(s.borderBottomWidth)+num(s.borderLeftWidth);
347 - var radius=Math.max(
348 - num(s.borderTopLeftRadius),num(s.borderTopRightRadius),
349 - num(s.borderBottomLeftRadius),num(s.borderBottomRightRadius)
676 + /* =======================================================
677 + FULL-WIDTH THREE-LINE AREA LABELS
678 + ======================================================= */
679 +
680 + function compactText(value){
681 + return String(value||"")
682 + .replace(/\s+/g," ")
683 + .trim();
684 + }
685 +
686 + function makeThreeLineAreaLabels(){
687 + Array.from(
688 + root.querySelectorAll(
689 + ".arsn-area-label"
690 + )
691 + ).forEach(function(label){
692 + if(
693 + label.getAttribute(
694 + "data-sn-three-line"
695 + )==="1"
696 + ){
697 + return;
698 + }
699 +
700 + var number=
701 + label.querySelector(
702 + ":scope > .arsn-area-number"
703 + );
704 +
705 + var action=
706 + label.querySelector(
707 + ":scope > .arsn-area-action"
708 + );
709 +
710 + if(
711 + !number||
712 + !action
713 + ){
714 + return;
715 + }
716 +
717 + var clone=
718 + label.cloneNode(true);
719 +
720 + var cloneNumber=
721 + clone.querySelector(
722 + ":scope > .arsn-area-number"
723 + );
724 +
725 + var cloneAction=
726 + clone.querySelector(
727 + ":scope > .arsn-area-action"
728 + );
729 +
730 + if(cloneNumber){
731 + cloneNumber.remove();
732 + }
733 +
734 + if(cloneAction){
735 + cloneAction.remove();
736 + }
737 +
738 + var titleText=
739 + compactText(
740 + clone.textContent
741 + );
742 +
743 + if(!titleText){
744 + return;
745 + }
746 +
747 + var numberNode=
748 + number.cloneNode(true);
749 +
750 + var actionNode=
751 + action.cloneNode(true);
752 +
753 + var titleNode=
754 + document.createElement(
755 + "span"
756 + );
757 +
758 + titleNode.className=
759 + "sn-area-label-title";
760 +
761 + titleNode.textContent=
762 + titleText;
763 +
764 + while(label.firstChild){
765 + label.removeChild(
766 + label.firstChild
767 + );
768 + }
769 +
770 + label.appendChild(
771 + numberNode
772 + );
773 +
774 + label.appendChild(
775 + titleNode
776 + );
777 +
778 + label.appendChild(
779 + actionNode
780 + );
781 +
782 + label.setAttribute(
783 + "data-sn-three-line",
784 + "1"
785 + );
786 +
787 + var head=
788 + label.closest(
789 + ".arsn-area-head"
790 + );
791 +
792 + if(head){
793 + head.style.setProperty(
794 + "width",
795 + "100%",
796 + "important"
797 + );
798 +
799 + head.style.setProperty(
800 + "max-width",
801 + "100%",
802 + "important"
803 + );
804 +
805 + head.style.setProperty(
806 + "box-sizing",
807 + "border-box",
808 + "important"
809 + );
810 + }
811 + });
812 + }
813 +
814 + /* =======================================================
815 + PLACEHOLDER BADGE
816 + ======================================================= */
817 +
818 + function applyPlaceholderBadge(){
819 + if(!PLACEHOLDER)return;
820 +
821 + if(
822 + document.querySelector(
823 + ".sn-coming-soon-badge"
824 + )
825 + ){
826 + return;
827 + }
828 +
829 + var title=
830 + document.querySelector(
831 + "#document-title"
832 + )||
833 + document.querySelector(
834 + "h1"
835 + );
836 +
837 + if(!title)return;
838 +
839 + var badge=
840 + document.createElement(
841 + "span"
842 + );
843 +
844 + badge.className=
845 + "sn-coming-soon-badge";
846 +
847 + badge.textContent=
848 + PLACEHOLDER_LABEL;
849 +
850 + badge.setAttribute(
851 + "aria-label",
852 + PLACEHOLDER_LABEL
350 350   );
351 - var bg=s.backgroundColor&&s.backgroundColor!=="rgba(0, 0, 0, 0)"&&s.backgroundColor!=="transparent";
352 - var shadow=s.boxShadow&&s.boxShadow!=="none";
353 - return namedLikeBox(el)||border>=1||(bg&&radius>=3)||(shadow&&r.width>=180);
854 +
855 + title.appendChild(
856 + badge
857 + );
354 354   }
355 355  
356 - function pickTarget(child){
357 - if(!visible(child))return null;
358 - if(boxLike(child))return child;
860 + /* =======================================================
861 + DETAIL PAGE OWN-ACCENT PROPAGATION
862 + ======================================================= */
359 359  
360 - var cr=child.getBoundingClientRect();
361 - var q=[];
362 - Array.from(child.children||[]).forEach(function(el){
363 - q.push({el:el,depth:1});
864 + function parseRGB(value){
865 + var match=String(value||"").match(
866 + /rgba?\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)/i
867 + );
868 +
869 + if(!match)return null;
870 +
871 + return [
872 + Number(match[1]),
873 + Number(match[2]),
874 + Number(match[3])
875 + ];
876 + }
877 +
878 + function distance(a,b){
879 + return Math.sqrt(
880 + Math.pow(a[0]-b[0],2)+
881 + Math.pow(a[1]-b[1],2)+
882 + Math.pow(a[2]-b[2],2)
883 + );
884 + }
885 +
886 + function paletteMatch(cssColor){
887 + var rgb=parseRGB(cssColor);
888 +
889 + if(!rgb)return null;
890 +
891 + var palette=[
892 + {hex:"#21b6d7",rgb:[33,182,215]},
893 + {hex:"#e94b13",rgb:[233,75,19]},
894 + {hex:"#f0aa00",rgb:[240,170,0]},
895 + {hex:"#38b76a",rgb:[56,183,106]}
896 + ];
897 +
898 + var best=null;
899 + var bestDistance=Infinity;
900 +
901 + palette.forEach(function(item){
902 + var d=distance(rgb,item.rgb);
903 +
904 + if(d<bestDistance){
905 + best=item;
906 + bestDistance=d;
907 + }
364 364   });
365 365  
366 - var best=null,bestScore=-1;
910 + return bestDistance<=30
911 + ?best
912 + :null;
913 + }
367 367  
368 - while(q.length){
369 - var item=q.shift();
370 - var el=item.el;
371 - if(!visible(el))continue;
915 + function propagateDetailAccents(){
916 + if(PAGE_KIND!=="detail")return;
372 372  
373 - var r=el.getBoundingClientRect();
918 + Array.from(
919 + root.querySelectorAll(
920 + ".arsn-call,.dmp-call,.ido-call,.pp-call,"+
921 + ".arsn-source,.dmp-source,.ido-source,.pp-source"
922 + )
923 + ).forEach(function(el){
924 + if(!visible(el))return;
374 374  
375 - if(r.width>=cr.width*.72&&boxLike(el)){
376 - var widthFit=1-Math.min(1,Math.abs(cr.width-r.width)/Math.max(1,cr.width));
377 - var topFit=1-Math.min(1,Math.abs(cr.top-r.top)/80);
378 - var score=widthFit*5+topFit*2+Math.min(r.height,600)/600;
379 - if(score>bestScore){
380 - best=el;
381 - bestScore=score;
926 + var style=getComputedStyle(el);
927 +
928 + if(
929 + num(style.borderTopWidth)>=2
930 + ){
931 + var match=
932 + paletteMatch(
933 + style.borderTopColor
934 + );
935 +
936 + if(match){
937 + el.style.setProperty(
938 + "border-left",
939 + "4px solid "+match.hex,
940 + "important"
941 + );
382 382   }
383 383   }
944 + });
384 384  
385 - if(item.depth<3){
386 - Array.from(el.children||[]).forEach(function(next){
387 - q.push({el:next,depth:item.depth+1});
388 - });
946 + // Warning families: explicit safety override.
947 + Array.from(
948 + root.querySelectorAll(
949 + ".arsn-warn,.dmp-warn,.ido-warn,.pp-warn,"+
950 + ".warn,.warning,.warningmessage,.errormessage"
951 + )
952 + ).forEach(function(el){
953 + if(!visible(el))return;
954 +
955 + el.style.setProperty(
956 + "border-left",
957 + "4px solid #e94b13",
958 + "important"
959 + );
960 + });
961 +
962 + // Info families: explicit orientation override.
963 + Array.from(
964 + root.querySelectorAll(
965 + ".arsn-info,.dmp-info,.ido-info,.pp-info,.infomessage"
966 + )
967 + ).forEach(function(el){
968 + if(!visible(el))return;
969 +
970 + el.style.setProperty(
971 + "border-left",
972 + "4px solid #21b6d7",
973 + "important"
974 + );
975 + });
976 + }
977 +
978 + /* =======================================================
979 + OVERVIEW SEMANTIC THEME PALETTE
980 + ======================================================= */
981 +
982 + function smallestThemeHeaders(){
983 + return Array.from(
984 + root.querySelectorAll(
985 + "div,span,p,strong,h3,h4,h5,h6"
986 + )
987 + ).filter(function(el){
988 + if(!visible(el))return false;
989 + if(!themeFor(el.textContent))return false;
990 +
991 + return !Array.from(
992 + el.children||[]
993 + ).some(function(child){
994 + return !!themeFor(
995 + child.textContent
996 + );
997 + });
998 + });
999 + }
1000 +
1001 + function findOverviewCard(header){
1002 + var node=header.parentElement;
1003 + var candidates=[];
1004 +
1005 + while(node&&node!==root){
1006 + var rect=node.getBoundingClientRect();
1007 + var style=getComputedStyle(node);
1008 +
1009 + var border=
1010 + num(style.borderTopWidth)+
1011 + num(style.borderRightWidth)+
1012 + num(style.borderBottomWidth)+
1013 + num(style.borderLeftWidth);
1014 +
1015 + if(
1016 + rect.width>=220&&
1017 + rect.width<=800&&
1018 + rect.height>=120&&
1019 + border>=1
1020 + ){
1021 + candidates.push(node);
389 389   }
1023 +
1024 + node=node.parentElement;
390 390   }
391 391  
392 - return best;
1027 + if(!candidates.length)return null;
1028 +
1029 + candidates.sort(function(a,b){
1030 + return (
1031 + b.getBoundingClientRect().height-
1032 + a.getBoundingClientRect().height
1033 + );
1034 + });
1035 +
1036 + return candidates[0];
393 393   }
394 394  
395 - function reset(){
396 - managed.forEach(function(el){
397 - el.style.removeProperty("min-height");
398 - el.removeAttribute("data-sn-equal-height-managed");
1039 + function rowCandidates(link,card){
1040 + var result=[];
1041 + var cardRect=
1042 + card.getBoundingClientRect();
1043 +
1044 + var node=link;
1045 +
1046 + while(node&&node!==card){
1047 + if(visible(node)){
1048 + var rect=
1049 + node.getBoundingClientRect();
1050 +
1051 + if(
1052 + rect.height<=105&&
1053 + rect.width>=
1054 + cardRect.width*.50&&
1055 + rect.width<=
1056 + cardRect.width*1.03
1057 + ){
1058 + result.push(node);
1059 + }
1060 + }
1061 +
1062 + node=node.parentElement;
1063 + }
1064 +
1065 + return result;
1066 + }
1067 +
1068 + function chooseOuterRow(
1069 + candidates,
1070 + link
1071 + ){
1072 + if(!candidates.length){
1073 + return link;
1074 + }
1075 +
1076 + var bordered=
1077 + candidates.filter(function(el){
1078 + return (
1079 + num(
1080 + getComputedStyle(el)
1081 + .borderLeftWidth
1082 + )>=1
1083 + );
1084 + });
1085 +
1086 + var pool=
1087 + bordered.length
1088 + ?bordered
1089 + :candidates;
1090 +
1091 + pool.sort(function(a,b){
1092 + var ar=
1093 + a.getBoundingClientRect();
1094 +
1095 + var br=
1096 + b.getBoundingClientRect();
1097 +
1098 + return (
1099 + ar.left-br.left||
1100 + br.width-ar.width
1101 + );
399 399   });
400 - managed.clear();
1103 +
1104 + return pool[0]||link;
401 401   }
402 402  
403 - function horizontalLayout(parent){
404 - if(!visible(parent))return false;
405 - var s=getComputedStyle(parent);
406 - if(s.display==="grid"||s.display==="inline-grid")return true;
407 - if(s.display==="flex"||s.display==="inline-flex"){
408 - return s.flexDirection==="row"||s.flexDirection==="row-reverse";
1107 + function applyOverviewPalette(){
1108 + if(PAGE_KIND!=="overview"){
1109 + return [];
409 409   }
410 - return false;
1111 +
1112 + var headers=
1113 + smallestThemeHeaders()
1114 + .map(function(el){
1115 + return {
1116 + el:el,
1117 + theme:
1118 + themeFor(
1119 + el.textContent
1120 + ),
1121 + card:
1122 + findOverviewCard(
1123 + el
1124 + )
1125 + };
1126 + })
1127 + .filter(function(row){
1128 + return !!row.card;
1129 + });
1130 +
1131 + var unique=[];
1132 + var seenHeaders=new Set();
1133 +
1134 + headers.forEach(function(row){
1135 + var key=
1136 + row.theme.name+
1137 + "|"+
1138 + Math.round(
1139 + row.card
1140 + .getBoundingClientRect()
1141 + .left
1142 + )+
1143 + "|"+
1144 + Math.round(
1145 + row.el
1146 + .getBoundingClientRect()
1147 + .top
1148 + );
1149 +
1150 + if(!seenHeaders.has(key)){
1151 + seenHeaders.add(key);
1152 + unique.push(row);
1153 + }
1154 + });
1155 +
1156 + unique.forEach(function(row){
1157 + var headerRect=
1158 + row.el
1159 + .getBoundingClientRect();
1160 +
1161 + row.el.style.setProperty(
1162 + "background",
1163 + row.theme.bg,
1164 + "important"
1165 + );
1166 +
1167 + row.el.style.setProperty(
1168 + "color",
1169 + row.theme.text,
1170 + "important"
1171 + );
1172 +
1173 + row.el.style.setProperty(
1174 + "text-align",
1175 + "left",
1176 + "important"
1177 + );
1178 +
1179 + row.el.style.setProperty(
1180 + "word-spacing",
1181 + "normal",
1182 + "important"
1183 + );
1184 +
1185 + var later=
1186 + unique
1187 + .filter(function(other){
1188 + return (
1189 + other.card===row.card&&
1190 + other.el
1191 + .getBoundingClientRect()
1192 + .top>
1193 + headerRect.top+2
1194 + );
1195 + })
1196 + .sort(function(a,b){
1197 + return (
1198 + a.el
1199 + .getBoundingClientRect()
1200 + .top-
1201 + b.el
1202 + .getBoundingClientRect()
1203 + .top
1204 + );
1205 + });
1206 +
1207 + var stopTop=
1208 + later.length
1209 + ?later[0].el
1210 + .getBoundingClientRect()
1211 + .top
1212 + :Infinity;
1213 +
1214 + Array.from(
1215 + row.card.querySelectorAll("a")
1216 + ).forEach(function(link){
1217 + if(!visible(link))return;
1218 +
1219 + var rect=
1220 + link.getBoundingClientRect();
1221 +
1222 + if(
1223 + rect.top<=
1224 + headerRect.bottom-2||
1225 + rect.top>=
1226 + stopTop-2
1227 + ){
1228 + return;
1229 + }
1230 +
1231 + var candidates=
1232 + rowCandidates(
1233 + link,
1234 + row.card
1235 + );
1236 +
1237 + var target=
1238 + chooseOuterRow(
1239 + candidates,
1240 + link
1241 + );
1242 +
1243 + candidates.forEach(function(el){
1244 + el.style.setProperty(
1245 + "border-left",
1246 + "0 solid transparent",
1247 + "important"
1248 + );
1249 + });
1250 +
1251 + target.style.setProperty(
1252 + "border-left",
1253 + "3px solid "+
1254 + row.theme.accent,
1255 + "important"
1256 + );
1257 +
1258 + target.style.setProperty(
1259 + "box-sizing",
1260 + "border-box",
1261 + "important"
1262 + );
1263 + });
1264 + });
1265 +
1266 + return unique;
411 411   }
412 412  
413 - function rowGroups(entries){
1269 + /* =======================================================
1270 + OVERVIEW CARD HEIGHT + FIRST THEMATIC ROW
1271 + ======================================================= */
1272 +
1273 + function alignOverviewCards(headers){
1274 + if(
1275 + PAGE_KIND!=="overview"||
1276 + window.innerWidth<=MOBILE_MAX
1277 + ){
1278 + return;
1279 + }
1280 +
1281 + var cards=[];
1282 + var seen=new Set();
1283 +
1284 + headers.forEach(function(row){
1285 + if(!seen.has(row.card)){
1286 + seen.add(row.card);
1287 + cards.push(row.card);
1288 + }
1289 + });
1290 +
1291 + if(cards.length<2){
1292 + return;
1293 + }
1294 +
1295 + // Group cards by actual top position.
414 414   var groups=[];
415 - entries.slice().sort(function(a,b){
416 - return a.rect.top-b.rect.top||a.rect.left-b.rect.left;
417 - }).forEach(function(entry){
1297 +
1298 + cards.forEach(function(card){
1299 + var top=
1300 + card.getBoundingClientRect().top;
1301 +
418 418   var group=null;
1303 +
419 419   for(var i=0;i<groups.length;i++){
420 - if(Math.abs(groups[i].top-entry.rect.top)<=ROW_TOLERANCE){
1305 + if(
1306 + Math.abs(
1307 + groups[i].top-top
1308 + )<=ROW_TOLERANCE
1309 + ){
421 421   group=groups[i];
422 422   break;
423 423   }
424 424   }
1314 +
425 425   if(!group){
426 - group={top:entry.rect.top,entries:[]};
1316 + group={
1317 + top:top,
1318 + cards:[]
1319 + };
427 427   groups.push(group);
428 428   }
429 - group.entries.push(entry);
1322 +
1323 + group.cards.push(card);
430 430   });
431 - return groups;
432 - }
433 433  
434 - function run(){
435 - reset();
1326 + groups.forEach(function(group){
1327 + if(group.cards.length<2){
1328 + return;
1329 + }
436 436  
437 - if(window.innerWidth<=MOBILE_MAX)return;
1331 + var firstHeaders=
1332 + group.cards.map(function(card){
1333 + var candidates=
1334 + headers
1335 + .filter(function(row){
1336 + return row.card===card;
1337 + })
1338 + .sort(function(a,b){
1339 + return (
1340 + a.el
1341 + .getBoundingClientRect()
1342 + .top-
1343 + b.el
1344 + .getBoundingClientRect()
1345 + .top
1346 + );
1347 + });
438 438  
439 - var parents=Array.from(root.querySelectorAll("*")).filter(function(el){
440 - return el.children&&el.children.length>=2&&horizontalLayout(el);
441 - });
1349 + return candidates.length
1350 + ?candidates[0]
1351 + :null;
1352 + });
442 442  
443 - parents.forEach(function(parent){
444 - var entries=[];
1354 + if(
1355 + !firstHeaders.some(function(row){
1356 + return !row;
1357 + })
1358 + ){
1359 + var targetTop=
1360 + Math.max.apply(
1361 + Math,
1362 + firstHeaders.map(function(row){
1363 + return (
1364 + row.el
1365 + .getBoundingClientRect()
1366 + .top-
1367 + row.card
1368 + .getBoundingClientRect()
1369 + .top
1370 + );
1371 + })
1372 + );
445 445  
446 - Array.from(parent.children).forEach(function(child){
447 - if(!visible(child))return;
448 - var target=pickTarget(child);
449 - if(!target)return;
450 - entries.push({
451 - target:target,
452 - rect:target.getBoundingClientRect()
1374 + firstHeaders.forEach(function(row){
1375 + var relativeTop=
1376 + row.el
1377 + .getBoundingClientRect()
1378 + .top-
1379 + row.card
1380 + .getBoundingClientRect()
1381 + .top;
1382 +
1383 + var delta=
1384 + targetTop-relativeTop;
1385 +
1386 + if(delta>1){
1387 + saveStyle(
1388 + row.el,
1389 + originalMargin,
1390 + "margin-top"
1391 + );
1392 +
1393 + var current=
1394 + num(
1395 + getComputedStyle(
1396 + row.el
1397 + ).marginTop
1398 + );
1399 +
1400 + row.el.style.setProperty(
1401 + "margin-top",
1402 + (
1403 + current+delta
1404 + )+"px"
1405 + );
1406 +
1407 + row.el.setAttribute(
1408 + "data-sn-master-first-row",
1409 + "1"
1410 + );
1411 +
1412 + managedMargin.add(
1413 + row.el
1414 + );
1415 + }
453 453   });
1417 + }
1418 +
1419 + var maxHeight=0;
1420 +
1421 + group.cards.forEach(function(card){
1422 + maxHeight=
1423 + Math.max(
1424 + maxHeight,
1425 + card
1426 + .getBoundingClientRect()
1427 + .height
1428 + );
454 454   });
455 455  
456 - if(entries.length<2)return;
1431 + maxHeight=
1432 + Math.ceil(maxHeight);
457 457  
458 - rowGroups(entries).forEach(function(group){
459 - if(group.entries.length<2)return;
1434 + group.cards.forEach(function(card){
1435 + saveStyle(
1436 + card,
1437 + originalHeight,
1438 + "min-height"
1439 + );
460 460  
461 - var lefts=group.entries.map(function(e){return e.rect.left;}).sort(function(a,b){return a-b;});
462 - if(lefts[lefts.length-1]-lefts[0]<80)return;
1441 + card.style.setProperty(
1442 + "min-height",
1443 + maxHeight+"px"
1444 + );
463 463  
464 - var targets=[];
465 - var seen=new Set();
1446 + card.setAttribute(
1447 + "data-sn-master-equal-height",
1448 + "1"
1449 + );
466 466  
467 - group.entries.forEach(function(e){
468 - if(!seen.has(e.target)){
469 - seen.add(e.target);
470 - targets.push(e.target);
1451 + managedHeight.add(
1452 + card
1453 + );
1454 + });
1455 + });
1456 + }
1457 +
1458 + /* =======================================================
1459 + DETAIL GRID EQUAL HEIGHT, DESKTOP ONLY
1460 + ======================================================= */
1461 +
1462 + function equaliseDetailGrids(){
1463 + if(
1464 + PAGE_KIND!=="detail"||
1465 + window.innerWidth<=MOBILE_MAX
1466 + ){
1467 + return;
1468 + }
1469 +
1470 + var selectors=[
1471 + ".arsn-grid",
1472 + ".arsn-grid-2",
1473 + ".arsn-grid-3",
1474 + ".dmp-grid",
1475 + ".ido-grid",
1476 + ".pp-grid"
1477 + ];
1478 +
1479 + selectors.forEach(function(selector){
1480 + Array.from(
1481 + root.querySelectorAll(selector)
1482 + ).forEach(function(grid){
1483 + var children=
1484 + Array.from(
1485 + grid.children||[]
1486 + ).filter(visible);
1487 +
1488 + if(children.length<2){
1489 + return;
1490 + }
1491 +
1492 + var groups=[];
1493 +
1494 + children.forEach(function(child){
1495 + var top=
1496 + child
1497 + .getBoundingClientRect()
1498 + .top;
1499 +
1500 + var group=null;
1501 +
1502 + for(var i=0;i<groups.length;i++){
1503 + if(
1504 + Math.abs(
1505 + groups[i].top-top
1506 + )<=ROW_TOLERANCE
1507 + ){
1508 + group=groups[i];
1509 + break;
1510 + }
471 471   }
472 - });
473 473  
474 - if(targets.length<2)return;
1513 + if(!group){
1514 + group={
1515 + top:top,
1516 + items:[]
1517 + };
1518 + groups.push(group);
1519 + }
475 475  
476 - var max=0;
477 - targets.forEach(function(el){
478 - max=Math.max(max,el.getBoundingClientRect().height);
1521 + group.items.push(child);
479 479   });
480 480  
481 - max=Math.ceil(max);
482 - if(max<MIN_H)return;
1524 + groups.forEach(function(group){
1525 + if(group.items.length<2){
1526 + return;
1527 + }
483 483  
484 - targets.forEach(function(el){
485 - el.style.setProperty("min-height",max+"px");
486 - el.setAttribute("data-sn-equal-height-managed","1");
487 - managed.add(el);
1529 + var maxHeight=0;
1530 +
1531 + group.items.forEach(function(item){
1532 + maxHeight=
1533 + Math.max(
1534 + maxHeight,
1535 + item
1536 + .getBoundingClientRect()
1537 + .height
1538 + );
1539 + });
1540 +
1541 + maxHeight=
1542 + Math.ceil(maxHeight);
1543 +
1544 + group.items.forEach(function(item){
1545 + saveStyle(
1546 + item,
1547 + originalHeight,
1548 + "min-height"
1549 + );
1550 +
1551 + item.style.setProperty(
1552 + "min-height",
1553 + maxHeight+"px"
1554 + );
1555 +
1556 + item.setAttribute(
1557 + "data-sn-master-equal-height",
1558 + "1"
1559 + );
1560 +
1561 + managedHeight.add(item);
1562 + });
488 488   });
489 489   });
490 490   });
491 491   }
492 492  
493 - function schedule(){
494 - if(raf)cancelAnimationFrame(raf);
495 - raf=requestAnimationFrame(function(){
496 - raf=requestAnimationFrame(function(){
497 - raf=0;
498 - run();
499 - });
500 - });
1568 + /* =======================================================
1569 + RUN / RESPONSIVE SCHEDULING
1570 + ======================================================= */
1571 +
1572 + function run(){
1573 + if(running)return;
1574 +
1575 + running=true;
1576 +
1577 + try{
1578 + resetRuntime();
1579 + applyPlaceholderBadge();
1580 + propagateDetailAccents();
1581 +
1582 + var headers=
1583 + applyOverviewPalette();
1584 +
1585 + makeThreeLineAreaLabels();
1586 + makeFilledRedOrangeCTAsBorderless();
1587 +
1588 + if(
1589 + window.innerWidth>
1590 + MOBILE_MAX
1591 + ){
1592 + alignOverviewCards(
1593 + headers
1594 + );
1595 +
1596 + equaliseDetailGrids();
1597 + }
1598 + }finally{
1599 + running=false;
1600 + }
501 501   }
502 502  
503 - addEventListener("resize",schedule,{passive:true});
504 - addEventListener("load",schedule,{once:true});
1603 + function onResize(){
1604 + if(resizeTimer){
1605 + clearTimeout(
1606 + resizeTimer
1607 + );
1608 + }
505 505  
506 - root.addEventListener("click",function(){
507 - setTimeout(schedule,0);
508 - },true);
1610 + resizeTimer=
1611 + setTimeout(
1612 + function(){
1613 + resizeTimer=0;
1614 + run();
1615 + },
1616 + RESIZE_DEBOUNCE
1617 + );
1618 + }
509 509  
510 - if(document.fonts&&document.fonts.ready){
511 - document.fonts.ready.then(schedule);
1620 + async function waitForReady(){
1621 + if(
1622 + document.readyState!=="complete"
1623 + ){
1624 + await new Promise(function(resolve){
1625 + window.addEventListener(
1626 + "load",
1627 + resolve,
1628 + {once:true}
1629 + );
1630 + });
1631 + }
1632 +
1633 + if(
1634 + document.fonts&&
1635 + document.fonts.ready
1636 + ){
1637 + try{
1638 + await document.fonts.ready;
1639 + }catch(error){}
1640 + }
1641 +
1642 + var images=
1643 + Array.from(
1644 + root.querySelectorAll("img")
1645 + );
1646 +
1647 + await Promise.all(
1648 + images.map(function(img){
1649 + if(img.complete){
1650 + return Promise.resolve();
1651 + }
1652 +
1653 + return new Promise(function(resolve){
1654 + var done=function(){
1655 + resolve();
1656 + };
1657 +
1658 + img.addEventListener(
1659 + "load",
1660 + done,
1661 + {once:true}
1662 + );
1663 +
1664 + img.addEventListener(
1665 + "error",
1666 + done,
1667 + {once:true}
1668 + );
1669 + });
1670 + })
1671 + );
1672 +
1673 + run();
512 512   }
513 513  
514 - schedule();
515 - setTimeout(schedule,250);
516 - setTimeout(schedule,900);
1676 + window.addEventListener(
1677 + "resize",
1678 + onResize,
1679 + {passive:true}
1680 + );
1681 +
1682 + waitForReady();
517 517  })();
518 518  </script>
519 -<!-- SN_HORIZONTAL_BOX_HARMONIZER_END -->
1685 +
1686 +<!-- SN_SERVICE_NAVIGATOR_MASTER_STYLE_END -->
520 520  {{/html}}
521 521