System.register(['reactive-jsx'], function (_export, _context) {
  "use strict";

  var _addSourceLocation;

  return {
    setters: [function (_reactiveJsx) {
      _addSourceLocation = _reactiveJsx.addSourceLocation;
    }],
    execute: function () {
      const __SystemJSRewritingHack = {};
      _recorder_._src_client_preload_components_js = _recorder_._src_client_preload_components_js || {};

      _export('default', async function preloaWebComponents(tagNames) {
        // check already loaded components
        const namesToPreload = tagNames.difference(Object.keys(lively.components.templates));

        const loadingPromises = namesToPreload.map(tagName => {
          const tag = _addSourceLocation(document.createElement(tagName), {
            file: 'https://lively-kernel.org/lively4/composed-offset/src/client/preload-components.js',
            end: {
              column: 47,
              line: 6
            },
            start: {
              column: 16,
              line: 6
            }
          });
          tag.style.display = 'none';
          tag.setAttribute('for-preload', 'true');
          document.body.append(tag);
          function removeTag(arg) {
            tag.remove();
            return arg;
          }
          return lively.components.ensureLoadByName(tagName, undefined, tag).then(removeTag, removeTag);
        });
        return Promise.all(loadingPromises);
      });
    }
  };
});