Prevent error about "$.ui" being undefined when logged out.
I'm not sure if you recall where you saw the issue you mentioned in https://www.drupal.org/project/layout_builder_modal/issues/3063834#comment-13989779 but that makes you the ideal person to test if this fixes things for you as well.