DEFINITIONS
   VISB_SVG_FILE == "pillbox_final_chatgpt.svg";
   VISB_SVG_UPDATES1 == (drawer_updates(drawer1,"#f00"), drawer_updates(drawer2,"#f00"),
                         drawer_updates(drawer3,"#f00"));
   drawer_updates(d,col) ==
       rec(`id`:("LED",d), fill: IF drawerLed(d) = ON THEN col ELSE "white" END,
           title: ```drawerLed(${d})=${drawerLed(d)}```);

   defaults == (0..10)*{-1}; // default time to avoid WD error
   VISB_SVG_UPDATES2 == {(d).d:Drawer | rec(`id`:("Drug",d),
               text:```${drug(d)} (${drugIndex(d)}/${size(time_consumption(d))} @ ${(defaults<+time_consumption(d))(drugIndex(d))} sec)```)};
   VISB_SVG_UPDATES3 == {(d).d:Drawer | 
        (rec(`id`:("isPillTobeTaken",d), fill: IF isPillTobeTaken(d)=TRUE THEN "#eee" ELSE "#aaa" END),
         rec(`id`:("Pill",d), visibility:isPillTobeTaken(d)))};
   VISB_SVG_UPDATES4 == (isPillTaken_updates(drawer1),isPillTaken_updates(drawer2),
                         isPillTaken_updates(drawer3));
   isPillTaken_updates(d) ==
       rec(`id`:("isPillTaken",d), fill: IF isPillTaken(d)=TRUE THEN "#ff1" ELSE "gray" END,
           title: ```isPillTaken(${d})=${isPillTaken(d)}```);
   VISB_SVG_UPDATES5 == rec(`id`:"Time_Text", text:```Time = ${mCurrTimeSecs} sec```);
   VISB_SVG_EVENTS1 == {(d).d:Drawer | rec(`id`:("isPillTaken",d),
                         event:"ENV_toggle_isPillTaken",
                         predicate:```d=${d}```) };
   VISB_SVG_HOVERS1 == {(d).d:Drawer | rec(`id`:("isPillTaken",d), stroke:"black", stroke_exit:"gray")};
   VISB_SVG_EVENTS2 == rec(`id`:"main", event:"r_Main");
   VISB_SVG_HOVERS2 == rec(`id`:"main", stroke:"black", stroke_exit:"#777");
   VISB_SVG_EVENTS3 == rec(`id`:"IncTime", event:"IncTimeByMinutes");
   VISB_SVG_HOVERS3 == rec(`id`:"IncTime", stroke:"black", stroke_exit:"#666");
