Deduction capacity in calendar based on “adults” and “children” selection

In Booking Calendar Business Large or higher versions possible to define capacity for booking resources (calendars), for ability to receive several bookings for the same date(s)/times in the same calendar (booking resource).

Please read more about it here.
Configuration. Set capacity of booking resources at WP Booking Calendar > Resources page. You can read more info about configurations of booking resources, capacity and availability at this page.
You can test it in the live demo.

Its means that during the booking process, user can book several "child booking resources" and deduct availability for selected date on number of booked "child booking resources". This number (how many items to book), can depend only from one field, that you defined at the WP Booking Calendar > Settings General page in "Capacity" section as the option for "Quantity field name", after enabling this toggle: "Booking Quantity Control".

Usually it is field from the booking form (configured at WP Booking Calendar > Settings > Booking Form page), such as this:

Visitors: [select visitors class:visitors "1" "2" "3" "4" "5" "6"]

It is often require to make deduction of availability based on 2 parameters - selection of "adults" and "children" number.
In this case possible to make this JavaScript customization in the booking form, for automatic selection of specific number of visitors, depend from the selection of number of "adults" and "children" in booking form.
Example of configuration:

<r>
        <c> <l>Adults:</l><br />[select adults class:adults "1" "2" "3"]</c>
    <c> <l>Children:</l><br />[select children class:children "0" "1" "2" "3"]</c>
</r>
<r>
    <c>
        <l>Total number of visitors:</l><div class="visitors_num">1</div>
        <div class="total_visitors_count">[select visitors class:visitors "1" "2" "3" "4" "5" "6"]</div>
    </c>
    <style type="text/css">
        .total_visitors_count select { visibility:hidden;}
     </style>
<script type="text/javascript">
    jQuery( 'select.adults').on( 'change',  wpbc_set_visitors_number );
    jQuery( 'select.children').on( 'change',  wpbc_set_visitors_number );
function wpbc_set_visitors_number() {
    var s_adults   = jQuery('select.adults option:selected').val();
    var s_children = jQuery('select.children option:selected').val();
    var s_visitors = parseInt(s_adults) + parseInt(s_children);
console.log( s_visitors );
jQuery('select.visitors option[value=' + s_visitors + ']').prop({selected: true});
    var resource_id = jQuery( "input[name^='bk_type']" ).val();
    jQuery('.visitors_num').html(s_visitors);
    if (typeof(showCostHintInsideBkForm) == 'function') {
          showCostHintInsideBkForm( resource_id );
    }
}
</script>
</r>

In case, if you select adults and children than available slots for the booking, system does not allow to submit the booking and show warning.
WP Booking Calendar - Warning message,  if booked more than  available slots for specific date/time