/* Brainstorm X — bundle compatibility shim.
   The shared NameCard had a prop collision (`style` used for BOTH the
   name-style tag and CSS overrides) which crashes when a string style is
   passed. The source is fixed (renamed to `wrapperStyle`); this shim keeps the
   prototype working against an older compiled bundle until it recompiles.
   Must load AFTER _ds_bundle.js and BEFORE any screen that reads NameCard. */
(function () {
  const DS = window.BrainstormXDesignSystem_f2a458;
  if (!DS || !DS.NameCard) return;
  const Orig = DS.NameCard;
  try {
    if (!/wrapperStyle/.test(Orig.toString())) {
      const Patched = function (props) {
        const p = Object.assign({}, props);
        // Old bundle spreads `style` into the CSS object — a string crashes it.
        if (typeof p.style === 'string') delete p.style;
        if (p.wrapperStyle) delete p.wrapperStyle;
        return React.createElement(Orig, p);
      };
      Patched.displayName = 'NameCardCompat';
      DS.NameCard = Patched;
      window.__BX_NAMECARD_SHIMMED = true;
    }
  } catch (e) { /* leave original in place */ }
})();
