System.register(["reactive-jsx", "./lively-ball.js"], function (_export, _context) {
  "use strict";

  var _addSourceLocation, Ball;

  return {
    setters: [function (_reactiveJsx) {
      _addSourceLocation = _reactiveJsx.addSourceLocation;
    }, function (_livelyBallJs) {
      Ball = _livelyBallJs.default;
    }],
    execute: function () {
      const __SystemJSRewritingHack = {};
      _recorder_._src_components_demo_lively_soapbubble_js = _recorder_._src_components_demo_lively_soapbubble_js || {};
      Object.defineProperty(_recorder_._src_components_demo_lively_soapbubble_js, "Ball", {
        get() {
          return Ball;
        },

        set(thisIsVererySecretVariableName) {
          Ball = thisIsVererySecretVariableName;
          return true;
        },

        enumerable: true,
        configurable: true
      });
      class SoapBubble extends Ball {
        initialize() {
          lively.setExtent(this, pt(30, 30));
          super.initialize();
          this.a = this.a || -0.003;
          this.total = this.total || 0;
          lively.addEventListener("soap", this, "click", evt => this.onClick(evt));
        }

        onClick() {
          this.remove();
        }

        simulate(t) {
          super.simulate(t);
          this.total += t;
          if (this.s < 10) this.remove();
        }

        static create() {
          return _addSourceLocation(document.createElement("lively-soapbubble"), {
            file: 'https://lively-kernel.org/lively4/lively4-petrinet/src/components/demo/lively-soapbubble.js',
            end: {
              column: 54,
              line: 25
            },
            start: {
              column: 11,
              line: 25
            }
          });
        }

        async livelyExample() {

          for (var i = 0; i < 3; i++) {
            var bubble = _addSourceLocation(document.createElement("lively-soapbubble"), {
              file: 'https://lively-kernel.org/lively4/lively4-petrinet/src/components/demo/lively-soapbubble.js',
              end: {
                column: 62,
                line: 32
              },
              start: {
                column: 19,
                line: 32
              }
            });
            await lively.components.openIn(this.parentElement, bubble);
            bubble.a = Math.random() * -1.0;
            bubble.s = Math.random() * 300.0;
          }
        }

        livelyMigrate(other) {
          super.livelyMigrate(other);
          this.total = other.total;
        }

      }

      _export("default", SoapBubble);

      Object.defineProperty(_recorder_._src_components_demo_lively_soapbubble_js, "SoapBubble", {
        get() {
          return SoapBubble;
        },

        set(thisIsVererySecretVariableName) {
          _export("default", SoapBubble = thisIsVererySecretVariableName);

          return true;
        },

        enumerable: true,
        configurable: true
      });
    }
  };
});