import { __extends } from "tslib"; import { CustomElement } from '../shapes'; import { createOffscreenGroup, deepAssign, visibility } from '../util'; function applyVisibility() { visibility(this, this.attributes.visibility !== 'hidden'); } var GUI = /** @class */ (function (_super) { __extends(GUI, _super); function GUI(options, defaultStyleProps) { if (defaultStyleProps === void 0) { defaultStyleProps = {}; } var _this = _super.call(this, deepAssign({}, { style: defaultStyleProps }, options)) || this; _this.initialized = false; _this._defaultOptions = defaultStyleProps; return _this; } Object.defineProperty(GUI.prototype, "offscreenGroup", { get: function () { if (!this._offscreen) this._offscreen = createOffscreenGroup(this); return this._offscreen; }, enumerable: false, configurable: true }); Object.defineProperty(GUI.prototype, "defaultOptions", { get: function () { return this._defaultOptions; }, enumerable: false, configurable: true }); GUI.prototype.connectedCallback = function () { this.render(this.attributes, this); this.bindEvents(this.attributes, this); // applyVisibility.call(this); this.initialized = true; }; GUI.prototype.disconnectedCallback = function () { var _a; (_a = this._offscreen) === null || _a === void 0 ? void 0 : _a.destroy(); }; GUI.prototype.attributeChangedCallback = function (name) { if (name === 'visibility') { applyVisibility.call(this); } }; GUI.prototype.update = function (attr, animate) { var _a; if (attr === void 0) { attr = {}; } this.attr(deepAssign({}, this.attributes, attr)); return (_a = this.render) === null || _a === void 0 ? void 0 : _a.call(this, this.attributes, this, animate); }; GUI.prototype.clear = function () { this.removeChildren(); }; GUI.prototype.bindEvents = function (attributes, container) { }; return GUI; }(CustomElement)); export { GUI }; //# sourceMappingURL=gui.js.map