Hi everyone! I have working code for this scenario, but I was wondering if there is a more optimized way of doing this. I would like users to be able to filter a gallery by multiple dropdowns but also have the option to decide whether its filtering by "And" or "Or". See the screenshot below.

Is there a better way to set up this logic rather than setting the filter conditions for every possible combination of operators?
Example:

Thanks everyone!